aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2008-07-09 02:13:53 -0400
committerDavid S. Miller <davem@davemloft.net>2008-07-09 02:13:53 -0400
commitc773e847ea8f6812804e40f52399c6921a00eab1 (patch)
tree952e0e262cc0b0f2136bc2a62938ae1d186f896a /drivers
parenteb6aafe3f843cb0e939546c03540a3b4911b6964 (diff)
netdev: Move _xmit_lock and xmit_lock_owner into netdev_queue.
Accesses are mostly structured such that when there are multiple TX queues the code transformations will be a little bit simpler. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/bonding/bond_main.c13
-rw-r--r--drivers/net/hamradio/bpqether.c12
-rw-r--r--drivers/net/macvlan.c14
-rw-r--r--drivers/net/wireless/hostap/hostap_hw.c12
4 files changed, 47 insertions, 4 deletions
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index d57b65dc2c72..dc733d75a5e9 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -5019,6 +5019,17 @@ static int bond_check_params(struct bond_params *params)
5019 5019
5020static struct lock_class_key bonding_netdev_xmit_lock_key; 5020static struct lock_class_key bonding_netdev_xmit_lock_key;
5021 5021
5022static void bond_set_lockdep_class_one(struct netdev_queue *txq)
5023{
5024 lockdep_set_class(&txq->_xmit_lock,
5025 &bonding_netdev_xmit_lock_key);
5026}
5027
5028static void bond_set_lockdep_class(struct net_device *dev)
5029{
5030 bond_set_lockdep_class_one(&dev->tx_queue);
5031}
5032
5022/* Create a new bond based on the specified name and bonding parameters. 5033/* Create a new bond based on the specified name and bonding parameters.
5023 * If name is NULL, obtain a suitable "bond%d" name for us. 5034 * If name is NULL, obtain a suitable "bond%d" name for us.
5024 * Caller must NOT hold rtnl_lock; we need to release it here before we 5035 * Caller must NOT hold rtnl_lock; we need to release it here before we
@@ -5076,7 +5087,7 @@ int bond_create(char *name, struct bond_params *params)
5076 goto out_bond; 5087 goto out_bond;
5077 } 5088 }
5078 5089
5079 lockdep_set_class(&bond_dev->_xmit_lock, &bonding_netdev_xmit_lock_key); 5090 bond_set_lockdep_class(bond_dev);
5080 5091
5081 netif_carrier_off(bond_dev); 5092 netif_carrier_off(bond_dev);
5082 5093
diff --git a/drivers/net/hamradio/bpqether.c b/drivers/net/hamradio/bpqether.c
index 5f4b4c6c9f76..fb186b8c3d4d 100644
--- a/drivers/net/hamradio/bpqether.c
+++ b/drivers/net/hamradio/bpqether.c
@@ -124,6 +124,16 @@ static LIST_HEAD(bpq_devices);
124 */ 124 */
125static struct lock_class_key bpq_netdev_xmit_lock_key; 125static struct lock_class_key bpq_netdev_xmit_lock_key;
126 126
127static void bpq_set_lockdep_class_one(struct netdev_queue *txq)
128{
129 lockdep_set_class(&txq->_xmit_lock, &bpq_netdev_xmit_lock_key);
130}
131
132static void bpq_set_lockdep_class(struct net_device *dev)
133{
134 bpq_set_lockdep_class_one(&dev->tx_queue);
135}
136
127/* ------------------------------------------------------------------------ */ 137/* ------------------------------------------------------------------------ */
128 138
129 139
@@ -523,7 +533,7 @@ static int bpq_new_device(struct net_device *edev)
523 err = register_netdevice(ndev); 533 err = register_netdevice(ndev);
524 if (err) 534 if (err)
525 goto error; 535 goto error;
526 lockdep_set_class(&ndev->_xmit_lock, &bpq_netdev_xmit_lock_key); 536 bpq_set_lockdep_class(ndev);
527 537
528 /* List protected by RTNL */ 538 /* List protected by RTNL */
529 list_add_rcu(&bpq->bpq_list, &bpq_devices); 539 list_add_rcu(&bpq->bpq_list, &bpq_devices);
diff --git a/drivers/net/macvlan.c b/drivers/net/macvlan.c
index c36a03ae9bfb..c02ceaa4a216 100644
--- a/drivers/net/macvlan.c
+++ b/drivers/net/macvlan.c
@@ -277,6 +277,17 @@ static struct lock_class_key macvlan_netdev_xmit_lock_key;
277#define MACVLAN_STATE_MASK \ 277#define MACVLAN_STATE_MASK \
278 ((1<<__LINK_STATE_NOCARRIER) | (1<<__LINK_STATE_DORMANT)) 278 ((1<<__LINK_STATE_NOCARRIER) | (1<<__LINK_STATE_DORMANT))
279 279
280static void macvlan_set_lockdep_class_one(struct netdev_queue *txq)
281{
282 lockdep_set_class(&txq->_xmit_lock,
283 &macvlan_netdev_xmit_lock_key);
284}
285
286static void macvlan_set_lockdep_class(struct net_device *dev)
287{
288 macvlan_set_lockdep_class_one(&dev->tx_queue);
289}
290
280static int macvlan_init(struct net_device *dev) 291static int macvlan_init(struct net_device *dev)
281{ 292{
282 struct macvlan_dev *vlan = netdev_priv(dev); 293 struct macvlan_dev *vlan = netdev_priv(dev);
@@ -287,7 +298,8 @@ static int macvlan_init(struct net_device *dev)
287 dev->features = lowerdev->features & MACVLAN_FEATURES; 298 dev->features = lowerdev->features & MACVLAN_FEATURES;
288 dev->iflink = lowerdev->ifindex; 299 dev->iflink = lowerdev->ifindex;
289 300
290 lockdep_set_class(&dev->_xmit_lock, &macvlan_netdev_xmit_lock_key); 301 macvlan_set_lockdep_class(dev);
302
291 return 0; 303 return 0;
292} 304}
293 305
diff --git a/drivers/net/wireless/hostap/hostap_hw.c b/drivers/net/wireless/hostap/hostap_hw.c
index 09004a632ae7..c1f4bb005d92 100644
--- a/drivers/net/wireless/hostap/hostap_hw.c
+++ b/drivers/net/wireless/hostap/hostap_hw.c
@@ -3102,6 +3102,16 @@ static void prism2_clear_set_tim_queue(local_info_t *local)
3102 */ 3102 */
3103static struct lock_class_key hostap_netdev_xmit_lock_key; 3103static struct lock_class_key hostap_netdev_xmit_lock_key;
3104 3104
3105static void prism2_set_lockdep_class_one(struct netdev_queue *txq)
3106{
3107 lockdep_set_class(&txq->_xmit_lock,
3108 &hostap_netdev_xmit_lock_key);
3109}
3110
3111static void prism2_set_lockdep_class(struct net_device *dev)
3112{
3113 prism2_set_lockdep_class_one(&dev->tx_queue);
3114}
3105 3115
3106static struct net_device * 3116static struct net_device *
3107prism2_init_local_data(struct prism2_helper_functions *funcs, int card_idx, 3117prism2_init_local_data(struct prism2_helper_functions *funcs, int card_idx,
@@ -3268,7 +3278,7 @@ while (0)
3268 if (ret >= 0) 3278 if (ret >= 0)
3269 ret = register_netdevice(dev); 3279 ret = register_netdevice(dev);
3270 3280
3271 lockdep_set_class(&dev->_xmit_lock, &hostap_netdev_xmit_lock_key); 3281 prism2_set_lockdep_class(dev);
3272 rtnl_unlock(); 3282 rtnl_unlock();
3273 if (ret < 0) { 3283 if (ret < 0) {
3274 printk(KERN_WARNING "%s: register netdevice failed!\n", 3284 printk(KERN_WARNING "%s: register netdevice failed!\n",