Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 254968
b: refs/heads/master
c: f3dc158
h: refs/heads/master
v: v3
  • Loading branch information
Sebastian Pöhn authored and David S. Miller committed Jul 15, 2011
1 parent de985eb commit 4cd091e
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 0d9b6e738a22244d38def847a24e5ee6fcedd898
refs/heads/master: f3dc1586375c3fa061c4867e8b076d09a53beb03
24 changes: 19 additions & 5 deletions trunk/drivers/net/gianfar.c
Original file line number Diff line number Diff line change
Expand Up @@ -2289,6 +2289,23 @@ static int gfar_set_mac_address(struct net_device *dev)
return 0;
}

/* Check if rx parser should be activated */
void gfar_check_rx_parser_mode(struct gfar_private *priv)
{
struct gfar __iomem *regs;
u32 tempval;

regs = priv->gfargrp[0].regs;

tempval = gfar_read(&regs->rctrl);
/* If parse is no longer required, then disable parser */
if (tempval & RCTRL_REQ_PARSER)
tempval |= RCTRL_PRSDEP_INIT;
else
tempval &= ~RCTRL_PRSDEP_INIT;
gfar_write(&regs->rctrl, tempval);
}


/* Enables and disables VLAN insertion/extraction */
static void gfar_vlan_rx_register(struct net_device *dev,
Expand Down Expand Up @@ -2325,12 +2342,9 @@ static void gfar_vlan_rx_register(struct net_device *dev,
/* Disable VLAN tag extraction */
tempval = gfar_read(&regs->rctrl);
tempval &= ~RCTRL_VLEX;
/* If parse is no longer required, then disable parser */
if (tempval & RCTRL_REQ_PARSER)
tempval |= RCTRL_PRSDEP_INIT;
else
tempval &= ~RCTRL_PRSDEP_INIT;
gfar_write(&regs->rctrl, tempval);

gfar_check_rx_parser_mode(priv);
}

gfar_change_mtu(dev, dev->mtu);
Expand Down
3 changes: 2 additions & 1 deletion trunk/drivers/net/gianfar.h
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ extern const char gfar_driver_version[];
#define RCTRL_PROM 0x00000008
#define RCTRL_EMEN 0x00000002
#define RCTRL_REQ_PARSER (RCTRL_VLEX | RCTRL_IPCSEN | \
RCTRL_TUCSEN)
RCTRL_TUCSEN | RCTRL_FILREN)
#define RCTRL_CHECKSUMMING (RCTRL_IPCSEN | RCTRL_TUCSEN | \
RCTRL_PRSDEP_INIT)
#define RCTRL_EXTHASH (RCTRL_GHTX)
Expand Down Expand Up @@ -1156,6 +1156,7 @@ extern void gfar_configure_coalescing(struct gfar_private *priv,
unsigned long tx_mask, unsigned long rx_mask);
void gfar_init_sysfs(struct net_device *dev);
int gfar_set_features(struct net_device *dev, u32 features);
extern void gfar_check_rx_parser_mode(struct gfar_private *priv);

extern const struct ethtool_ops gfar_ethtool_ops;

Expand Down

0 comments on commit 4cd091e

Please sign in to comment.