aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/gianfar.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/gianfar.c')
-rw-r--r--drivers/net/gianfar.c24
1 files changed, 19 insertions, 5 deletions
diff --git a/drivers/net/gianfar.c b/drivers/net/gianfar.c
index 3321d714ca22..d265c6e13873 100644
--- a/drivers/net/gianfar.c
+++ b/drivers/net/gianfar.c
@@ -2287,6 +2287,23 @@ static int gfar_set_mac_address(struct net_device *dev)
2287 return 0; 2287 return 0;
2288} 2288}
2289 2289
2290/* Check if rx parser should be activated */
2291void gfar_check_rx_parser_mode(struct gfar_private *priv)
2292{
2293 struct gfar __iomem *regs;
2294 u32 tempval;
2295
2296 regs = priv->gfargrp[0].regs;
2297
2298 tempval = gfar_read(&regs->rctrl);
2299 /* If parse is no longer required, then disable parser */
2300 if (tempval & RCTRL_REQ_PARSER)
2301 tempval |= RCTRL_PRSDEP_INIT;
2302 else
2303 tempval &= ~RCTRL_PRSDEP_INIT;
2304 gfar_write(&regs->rctrl, tempval);
2305}
2306
2290 2307
2291/* Enables and disables VLAN insertion/extraction */ 2308/* Enables and disables VLAN insertion/extraction */
2292static void gfar_vlan_rx_register(struct net_device *dev, 2309static void gfar_vlan_rx_register(struct net_device *dev,
@@ -2323,12 +2340,9 @@ static void gfar_vlan_rx_register(struct net_device *dev,
2323 /* Disable VLAN tag extraction */ 2340 /* Disable VLAN tag extraction */
2324 tempval = gfar_read(&regs->rctrl); 2341 tempval = gfar_read(&regs->rctrl);
2325 tempval &= ~RCTRL_VLEX; 2342 tempval &= ~RCTRL_VLEX;
2326 /* If parse is no longer required, then disable parser */
2327 if (tempval & RCTRL_REQ_PARSER)
2328 tempval |= RCTRL_PRSDEP_INIT;
2329 else
2330 tempval &= ~RCTRL_PRSDEP_INIT;
2331 gfar_write(&regs->rctrl, tempval); 2343 gfar_write(&regs->rctrl, tempval);
2344
2345 gfar_check_rx_parser_mode(priv);
2332 } 2346 }
2333 2347
2334 gfar_change_mtu(dev, dev->mtu); 2348 gfar_change_mtu(dev, dev->mtu);