aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorian Fainelli <florian@openwrt.org>2012-09-03 10:26:01 +0000
committerFlorian Fainelli <florian@openwrt.org>2012-09-03 10:26:01 +0000
commite88e20d9755e40c215f74ea5065af1fd3fd11a89 (patch)
tree4a750f39254f86a681146c623e24be1820eaf018
parent088a126240afe031df25a5589f6f1f6c5a6a7d8c (diff)
downloadupstream-e88e20d9755e40c215f74ea5065af1fd3fd11a89.tar.gz
upstream-e88e20d9755e40c215f74ea5065af1fd3fd11a89.tar.bz2
upstream-e88e20d9755e40c215f74ea5065af1fd3fd11a89.zip
nuport-mac: disable MAC RX and TX during interface close
Fixes sporadic crashes while reconfiguring the network interface. SVN-Revision: 33312
-rw-r--r--target/linux/mcs814x/files-3.3/drivers/net/ethernet/mcs8140/nuport_mac.c5
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);