aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorSebastian Pöhn <sebastian.belden@googlemail.com>2011-07-15 19:00:20 -0400
committerDavid S. Miller <davem@davemloft.net>2011-07-15 19:00:20 -0400
commitf3dc1586375c3fa061c4867e8b076d09a53beb03 (patch)
tree70202f8648dfdaa47c3a877425a60057d06ee7f1 /drivers
parent0d9b6e738a22244d38def847a24e5ee6fcedd898 (diff)
gianfar: rx parser
Only let the rx parser be enabled if it is necessary (if VLAN extraction, IP or TCP checksumming or the rx queue filer are enabled). Otherwise disable it. The new routine gfar_check_rx_parser_mode should be run after every change on this features and will enable/disable the parser as necessary. Signed-off-by: Jiri Pirko <jpirko@redhat.com> Signed-off-by: Sebastian Poehn <sebastian.poehn@belden.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/gianfar.c24
-rw-r--r--drivers/net/gianfar.h3
2 files changed, 21 insertions, 6 deletions
diff --git a/drivers/net/gianfar.c b/drivers/net/gianfar.c
index 2dfcc8047847..dfa55f94ba7f 100644
--- a/drivers/net/gianfar.c
+++ b/drivers/net/gianfar.c
@@ -2289,6 +2289,23 @@ static int gfar_set_mac_address(struct net_device *dev)
2289 return 0; 2289 return 0;
2290} 2290}
2291 2291
2292/* Check if rx parser should be activated */
2293void gfar_check_rx_parser_mode(struct gfar_private *priv)
2294{
2295 struct gfar __iomem *regs;
2296 u32 tempval;
2297
2298 regs = priv->gfargrp[0].regs;
2299
2300 tempval = gfar_read(&regs->rctrl);
2301 /* If parse is no longer required, then disable parser */
2302 if (tempval & RCTRL_REQ_PARSER)
2303 tempval |= RCTRL_PRSDEP_INIT;
2304 else
2305 tempval &= ~RCTRL_PRSDEP_INIT;
2306 gfar_write(&regs->rctrl, tempval);
2307}
2308
2292 2309
2293/* Enables and disables VLAN insertion/extraction */ 2310/* Enables and disables VLAN insertion/extraction */
2294static void gfar_vlan_rx_register(struct net_device *dev, 2311static void gfar_vlan_rx_register(struct net_device *dev,
@@ -2325,12 +2342,9 @@ static void gfar_vlan_rx_register(struct net_device *dev,
2325 /* Disable VLAN tag extraction */ 2342 /* Disable VLAN tag extraction */
2326 tempval = gfar_read(&regs->rctrl); 2343 tempval = gfar_read(&regs->rctrl);
2327 tempval &= ~RCTRL_VLEX; 2344 tempval &= ~RCTRL_VLEX;
2328 /* If parse is no longer required, then disable parser */
2329 if (tempval & RCTRL_REQ_PARSER)
2330 tempval |= RCTRL_PRSDEP_INIT;
2331 else
2332 tempval &= ~RCTRL_PRSDEP_INIT;
2333 gfar_write(&regs->rctrl, tempval); 2345 gfar_write(&regs->rctrl, tempval);
2346
2347 gfar_check_rx_parser_mode(priv);
2334 } 2348 }
2335 2349
2336 gfar_change_mtu(dev, dev->mtu); 2350 gfar_change_mtu(dev, dev->mtu);
diff --git a/drivers/net/gianfar.h b/drivers/net/gianfar.h
index ba36dc7a3435..440e69d8beff 100644
--- a/drivers/net/gianfar.h
+++ b/drivers/net/gianfar.h
@@ -274,7 +274,7 @@ extern const char gfar_driver_version[];
274#define RCTRL_PROM 0x00000008 274#define RCTRL_PROM 0x00000008
275#define RCTRL_EMEN 0x00000002 275#define RCTRL_EMEN 0x00000002
276#define RCTRL_REQ_PARSER (RCTRL_VLEX | RCTRL_IPCSEN | \ 276#define RCTRL_REQ_PARSER (RCTRL_VLEX | RCTRL_IPCSEN | \
277 RCTRL_TUCSEN) 277 RCTRL_TUCSEN | RCTRL_FILREN)
278#define RCTRL_CHECKSUMMING (RCTRL_IPCSEN | RCTRL_TUCSEN | \ 278#define RCTRL_CHECKSUMMING (RCTRL_IPCSEN | RCTRL_TUCSEN | \
279 RCTRL_PRSDEP_INIT) 279 RCTRL_PRSDEP_INIT)
280#define RCTRL_EXTHASH (RCTRL_GHTX) 280#define RCTRL_EXTHASH (RCTRL_GHTX)
@@ -1156,6 +1156,7 @@ extern void gfar_configure_coalescing(struct gfar_private *priv,
1156 unsigned long tx_mask, unsigned long rx_mask); 1156 unsigned long tx_mask, unsigned long rx_mask);
1157void gfar_init_sysfs(struct net_device *dev); 1157void gfar_init_sysfs(struct net_device *dev);
1158int gfar_set_features(struct net_device *dev, u32 features); 1158int gfar_set_features(struct net_device *dev, u32 features);
1159extern void gfar_check_rx_parser_mode(struct gfar_private *priv);
1159 1160
1160extern const struct ethtool_ops gfar_ethtool_ops; 1161extern const struct ethtool_ops gfar_ethtool_ops;
1161 1162