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>
This commit is contained in:
David S. Miller
2008-07-15 00:13:44 -07:00
parent f1f28aa351
commit e308a5d806
14 changed files with 94 additions and 0 deletions

View File

@@ -292,7 +292,9 @@ static int ieee80211_open(struct net_device *dev)
local->fif_other_bss++;
netif_tx_lock_bh(local->mdev);
netif_addr_lock(local->mdev);
ieee80211_configure_filter(local);
netif_addr_unlock(local->mdev);
netif_tx_unlock_bh(local->mdev);
break;
case IEEE80211_IF_TYPE_STA:
@@ -491,7 +493,9 @@ static int ieee80211_stop(struct net_device *dev)
local->fif_other_bss--;
netif_tx_lock_bh(local->mdev);
netif_addr_lock(local->mdev);
ieee80211_configure_filter(local);
netif_addr_unlock(local->mdev);
netif_tx_unlock_bh(local->mdev);
break;
case IEEE80211_IF_TYPE_MESH_POINT: