diff options
author | Florian Fainelli <florian@openwrt.org> | 2012-09-03 10:26:01 +0000 |
---|---|---|
committer | Florian Fainelli <florian@openwrt.org> | 2012-09-03 10:26:01 +0000 |
commit | a7b6531eea8816a1987e5fcb0e2c0c9c32a12680 (patch) | |
tree | f84059f58f6e1c5a561661ec2afdc1acb5be30e6 /target | |
parent | a57015d0dc7810ae5b22e968ff2fab52c74f6487 (diff) | |
download | upstream-a7b6531eea8816a1987e5fcb0e2c0c9c32a12680.tar.gz upstream-a7b6531eea8816a1987e5fcb0e2c0c9c32a12680.tar.bz2 upstream-a7b6531eea8816a1987e5fcb0e2c0c9c32a12680.zip |
[mcs814x] nuport-mac: disable MAC RX and TX during interface close
Fixes sporadic crashes while reconfiguring the network interface.
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@33312 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target')
-rw-r--r-- | target/linux/mcs814x/files-3.3/drivers/net/ethernet/mcs8140/nuport_mac.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/target/linux/mcs814x/files-3.3/drivers/net/ethernet/mcs8140/nuport_mac.c b/target/linux/mcs814x/files-3.3/drivers/net/ethernet/mcs8140/nuport_mac.c index b14019d578..4a42086046 100644 --- a/target/linux/mcs814x/files-3.3/drivers/net/ethernet/mcs8140/nuport_mac.c +++ b/target/linux/mcs814x/files-3.3/drivers/net/ethernet/mcs8140/nuport_mac.c @@ -829,9 +829,14 @@ out_emac_clk: static int nuport_mac_close(struct net_device *dev) { + u32 reg; struct nuport_mac_priv *priv = netdev_priv(dev); spin_lock_irq(&priv->lock); + reg = nuport_mac_readl(CTRL_REG); + reg &= ~(RX_ENABLE | TX_ENABLE); + nuport_mac_writel(reg, CTRL_REG); + napi_disable(&priv->napi); netif_stop_queue(dev); |