aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ibm_newemac
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2008-07-15 03:13:44 -0400
committerDavid S. Miller <davem@davemloft.net>2008-07-15 03:13:44 -0400
commite308a5d806c852f56590ffdd3834d0df0cbed8d7 (patch)
tree294ff654e90950f5162737c26f4799b0b710b748 /drivers/net/ibm_newemac
parentf1f28aa3510ddb84c966bac65611bb866c77a092 (diff)
netdev: Add netdev->addr_list_lock protection.
Add netif_addr_{lock,unlock}{,_bh}() helpers. Use them to protect operations that operate on or read the network device unicast and multicast address lists. Also use them in cases where the code simply wants to block calls into the driver's ->set_rx_mode() and ->set_multicast_list() methods. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ibm_newemac')
-rw-r--r--drivers/net/ibm_newemac/core.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/net/ibm_newemac/core.c b/drivers/net/ibm_newemac/core.c
index babc79ad490b..9ca57d365599 100644
--- a/drivers/net/ibm_newemac/core.c
+++ b/drivers/net/ibm_newemac/core.c
@@ -295,7 +295,9 @@ static void emac_rx_disable(struct emac_instance *dev)
295static inline void emac_netif_stop(struct emac_instance *dev) 295static inline void emac_netif_stop(struct emac_instance *dev)
296{ 296{
297 netif_tx_lock_bh(dev->ndev); 297 netif_tx_lock_bh(dev->ndev);
298 netif_addr_lock(dev->ndev);
298 dev->no_mcast = 1; 299 dev->no_mcast = 1;
300 netif_addr_unlock(dev->ndev);
299 netif_tx_unlock_bh(dev->ndev); 301 netif_tx_unlock_bh(dev->ndev);
300 dev->ndev->trans_start = jiffies; /* prevent tx timeout */ 302 dev->ndev->trans_start = jiffies; /* prevent tx timeout */
301 mal_poll_disable(dev->mal, &dev->commac); 303 mal_poll_disable(dev->mal, &dev->commac);
@@ -305,9 +307,11 @@ static inline void emac_netif_stop(struct emac_instance *dev)
305static inline void emac_netif_start(struct emac_instance *dev) 307static inline void emac_netif_start(struct emac_instance *dev)
306{ 308{
307 netif_tx_lock_bh(dev->ndev); 309 netif_tx_lock_bh(dev->ndev);
310 netif_addr_lock(dev->ndev);
308 dev->no_mcast = 0; 311 dev->no_mcast = 0;
309 if (dev->mcast_pending && netif_running(dev->ndev)) 312 if (dev->mcast_pending && netif_running(dev->ndev))
310 __emac_set_multicast_list(dev); 313 __emac_set_multicast_list(dev);
314 netif_addr_unlock(dev->ndev);
311 netif_tx_unlock_bh(dev->ndev); 315 netif_tx_unlock_bh(dev->ndev);
312 316
313 netif_wake_queue(dev->ndev); 317 netif_wake_queue(dev->ndev);