diff options
author | Alexander Aring <alex.aring@gmail.com> | 2014-10-25 11:16:38 -0400 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2014-10-25 15:55:38 -0400 |
commit | d98be45b3657fc233f5a098279a4e42ab6f0fa4f (patch) | |
tree | 3014bbeb14981bb3b3c4b913a09c6a44eeb5f8bb | |
parent | 04e850fe06312a9f570fcc7dbd0f141c012df404 (diff) |
mac802154: rename sdata slaves and slaves_mtx
This patch renamens the slaves attribute in sdata to interfaces and
slaves_mtx to iflist_mtx. This is similar like the mac80211 stack naming
convention.
Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
-rw-r--r-- | net/mac802154/ieee802154_i.h | 4 | ||||
-rw-r--r-- | net/mac802154/iface.c | 10 | ||||
-rw-r--r-- | net/mac802154/main.c | 54 | ||||
-rw-r--r-- | net/mac802154/monitor.c | 2 | ||||
-rw-r--r-- | net/mac802154/tx.c | 4 |
5 files changed, 37 insertions, 37 deletions
diff --git a/net/mac802154/ieee802154_i.h b/net/mac802154/ieee802154_i.h index c5b1ab743695..b7cf41c989ec 100644 --- a/net/mac802154/ieee802154_i.h +++ b/net/mac802154/ieee802154_i.h | |||
@@ -42,8 +42,8 @@ struct ieee802154_local { | |||
42 | * | 42 | * |
43 | * So atomic readers can use any of this protection methods. | 43 | * So atomic readers can use any of this protection methods. |
44 | */ | 44 | */ |
45 | struct list_head slaves; | 45 | struct list_head interfaces; |
46 | struct mutex slaves_mtx; | 46 | struct mutex iflist_mtx; |
47 | 47 | ||
48 | /* This one is used for scanning and other jobs not to be interfered | 48 | /* This one is used for scanning and other jobs not to be interfered |
49 | * with serial driver. | 49 | * with serial driver. |
diff --git a/net/mac802154/iface.c b/net/mac802154/iface.c index 6eace90da3ed..c0dbb402b99b 100644 --- a/net/mac802154/iface.c +++ b/net/mac802154/iface.c | |||
@@ -125,9 +125,9 @@ int mac802154_set_mac_params(struct net_device *dev, | |||
125 | { | 125 | { |
126 | struct ieee802154_sub_if_data *sdata = netdev_priv(dev); | 126 | struct ieee802154_sub_if_data *sdata = netdev_priv(dev); |
127 | 127 | ||
128 | mutex_lock(&sdata->local->slaves_mtx); | 128 | mutex_lock(&sdata->local->iflist_mtx); |
129 | sdata->mac_params = *params; | 129 | sdata->mac_params = *params; |
130 | mutex_unlock(&sdata->local->slaves_mtx); | 130 | mutex_unlock(&sdata->local->iflist_mtx); |
131 | 131 | ||
132 | return 0; | 132 | return 0; |
133 | } | 133 | } |
@@ -137,9 +137,9 @@ void mac802154_get_mac_params(struct net_device *dev, | |||
137 | { | 137 | { |
138 | struct ieee802154_sub_if_data *sdata = netdev_priv(dev); | 138 | struct ieee802154_sub_if_data *sdata = netdev_priv(dev); |
139 | 139 | ||
140 | mutex_lock(&sdata->local->slaves_mtx); | 140 | mutex_lock(&sdata->local->iflist_mtx); |
141 | *params = sdata->mac_params; | 141 | *params = sdata->mac_params; |
142 | mutex_unlock(&sdata->local->slaves_mtx); | 142 | mutex_unlock(&sdata->local->iflist_mtx); |
143 | } | 143 | } |
144 | 144 | ||
145 | static int mac802154_wpan_open(struct net_device *dev) | 145 | static int mac802154_wpan_open(struct net_device *dev) |
@@ -580,7 +580,7 @@ void mac802154_wpans_rx(struct ieee802154_local *local, struct sk_buff *skb) | |||
580 | } | 580 | } |
581 | 581 | ||
582 | rcu_read_lock(); | 582 | rcu_read_lock(); |
583 | list_for_each_entry_rcu(sdata, &local->slaves, list) { | 583 | list_for_each_entry_rcu(sdata, &local->interfaces, list) { |
584 | if (sdata->type != IEEE802154_DEV_WPAN || | 584 | if (sdata->type != IEEE802154_DEV_WPAN || |
585 | !netif_running(sdata->dev)) | 585 | !netif_running(sdata->dev)) |
586 | continue; | 586 | continue; |
diff --git a/net/mac802154/main.c b/net/mac802154/main.c index 9b2644ff6de5..34e7e617611a 100644 --- a/net/mac802154/main.c +++ b/net/mac802154/main.c | |||
@@ -39,20 +39,20 @@ int mac802154_slave_open(struct net_device *dev) | |||
39 | ASSERT_RTNL(); | 39 | ASSERT_RTNL(); |
40 | 40 | ||
41 | if (sdata->type == IEEE802154_DEV_WPAN) { | 41 | if (sdata->type == IEEE802154_DEV_WPAN) { |
42 | mutex_lock(&sdata->local->slaves_mtx); | 42 | mutex_lock(&sdata->local->iflist_mtx); |
43 | list_for_each_entry(subif, &sdata->local->slaves, list) { | 43 | list_for_each_entry(subif, &sdata->local->interfaces, list) { |
44 | if (subif != sdata && subif->type == sdata->type && | 44 | if (subif != sdata && subif->type == sdata->type && |
45 | subif->running) { | 45 | subif->running) { |
46 | mutex_unlock(&sdata->local->slaves_mtx); | 46 | mutex_unlock(&sdata->local->iflist_mtx); |
47 | return -EBUSY; | 47 | return -EBUSY; |
48 | } | 48 | } |
49 | } | 49 | } |
50 | mutex_unlock(&sdata->local->slaves_mtx); | 50 | mutex_unlock(&sdata->local->iflist_mtx); |
51 | } | 51 | } |
52 | 52 | ||
53 | mutex_lock(&sdata->local->slaves_mtx); | 53 | mutex_lock(&sdata->local->iflist_mtx); |
54 | sdata->running = true; | 54 | sdata->running = true; |
55 | mutex_unlock(&sdata->local->slaves_mtx); | 55 | mutex_unlock(&sdata->local->iflist_mtx); |
56 | 56 | ||
57 | if (local->open_count++ == 0) { | 57 | if (local->open_count++ == 0) { |
58 | res = local->ops->start(&local->hw); | 58 | res = local->ops->start(&local->hw); |
@@ -88,9 +88,9 @@ int mac802154_slave_close(struct net_device *dev) | |||
88 | 88 | ||
89 | netif_stop_queue(dev); | 89 | netif_stop_queue(dev); |
90 | 90 | ||
91 | mutex_lock(&sdata->local->slaves_mtx); | 91 | mutex_lock(&sdata->local->iflist_mtx); |
92 | sdata->running = false; | 92 | sdata->running = false; |
93 | mutex_unlock(&sdata->local->slaves_mtx); | 93 | mutex_unlock(&sdata->local->iflist_mtx); |
94 | 94 | ||
95 | if (!--local->open_count) | 95 | if (!--local->open_count) |
96 | local->ops->stop(&local->hw); | 96 | local->ops->stop(&local->hw); |
@@ -115,21 +115,21 @@ mac802154_netdev_register(struct wpan_phy *phy, struct net_device *dev) | |||
115 | 115 | ||
116 | SET_NETDEV_DEV(dev, &local->phy->dev); | 116 | SET_NETDEV_DEV(dev, &local->phy->dev); |
117 | 117 | ||
118 | mutex_lock(&local->slaves_mtx); | 118 | mutex_lock(&local->iflist_mtx); |
119 | if (!local->running) { | 119 | if (!local->running) { |
120 | mutex_unlock(&local->slaves_mtx); | 120 | mutex_unlock(&local->iflist_mtx); |
121 | return -ENODEV; | 121 | return -ENODEV; |
122 | } | 122 | } |
123 | mutex_unlock(&local->slaves_mtx); | 123 | mutex_unlock(&local->iflist_mtx); |
124 | 124 | ||
125 | err = register_netdev(dev); | 125 | err = register_netdev(dev); |
126 | if (err < 0) | 126 | if (err < 0) |
127 | return err; | 127 | return err; |
128 | 128 | ||
129 | rtnl_lock(); | 129 | rtnl_lock(); |
130 | mutex_lock(&local->slaves_mtx); | 130 | mutex_lock(&local->iflist_mtx); |
131 | list_add_tail_rcu(&sdata->list, &local->slaves); | 131 | list_add_tail_rcu(&sdata->list, &local->interfaces); |
132 | mutex_unlock(&local->slaves_mtx); | 132 | mutex_unlock(&local->iflist_mtx); |
133 | rtnl_unlock(); | 133 | rtnl_unlock(); |
134 | 134 | ||
135 | return 0; | 135 | return 0; |
@@ -146,9 +146,9 @@ mac802154_del_iface(struct wpan_phy *phy, struct net_device *dev) | |||
146 | 146 | ||
147 | BUG_ON(sdata->local->phy != phy); | 147 | BUG_ON(sdata->local->phy != phy); |
148 | 148 | ||
149 | mutex_lock(&sdata->local->slaves_mtx); | 149 | mutex_lock(&sdata->local->iflist_mtx); |
150 | list_del_rcu(&sdata->list); | 150 | list_del_rcu(&sdata->list); |
151 | mutex_unlock(&sdata->local->slaves_mtx); | 151 | mutex_unlock(&sdata->local->iflist_mtx); |
152 | 152 | ||
153 | synchronize_rcu(); | 153 | synchronize_rcu(); |
154 | unregister_netdevice(sdata->dev); | 154 | unregister_netdevice(sdata->dev); |
@@ -280,8 +280,8 @@ ieee802154_alloc_hw(size_t priv_data_len, struct ieee802154_ops *ops) | |||
280 | local->hw.priv = (char *)local + ALIGN(sizeof(*local), NETDEV_ALIGN); | 280 | local->hw.priv = (char *)local + ALIGN(sizeof(*local), NETDEV_ALIGN); |
281 | local->ops = ops; | 281 | local->ops = ops; |
282 | 282 | ||
283 | INIT_LIST_HEAD(&local->slaves); | 283 | INIT_LIST_HEAD(&local->interfaces); |
284 | mutex_init(&local->slaves_mtx); | 284 | mutex_init(&local->iflist_mtx); |
285 | 285 | ||
286 | return &local->hw; | 286 | return &local->hw; |
287 | } | 287 | } |
@@ -291,9 +291,9 @@ void ieee802154_free_hw(struct ieee802154_hw *hw) | |||
291 | { | 291 | { |
292 | struct ieee802154_local *local = mac802154_to_priv(hw); | 292 | struct ieee802154_local *local = mac802154_to_priv(hw); |
293 | 293 | ||
294 | BUG_ON(!list_empty(&local->slaves)); | 294 | BUG_ON(!list_empty(&local->interfaces)); |
295 | 295 | ||
296 | mutex_destroy(&local->slaves_mtx); | 296 | mutex_destroy(&local->iflist_mtx); |
297 | 297 | ||
298 | wpan_phy_free(local->phy); | 298 | wpan_phy_free(local->phy); |
299 | } | 299 | } |
@@ -364,9 +364,9 @@ int ieee802154_register_hw(struct ieee802154_hw *hw) | |||
364 | 364 | ||
365 | rtnl_lock(); | 365 | rtnl_lock(); |
366 | 366 | ||
367 | mutex_lock(&local->slaves_mtx); | 367 | mutex_lock(&local->iflist_mtx); |
368 | local->running = MAC802154_DEVICE_RUN; | 368 | local->running = MAC802154_DEVICE_RUN; |
369 | mutex_unlock(&local->slaves_mtx); | 369 | mutex_unlock(&local->iflist_mtx); |
370 | 370 | ||
371 | rtnl_unlock(); | 371 | rtnl_unlock(); |
372 | 372 | ||
@@ -389,14 +389,14 @@ void ieee802154_unregister_hw(struct ieee802154_hw *hw) | |||
389 | 389 | ||
390 | rtnl_lock(); | 390 | rtnl_lock(); |
391 | 391 | ||
392 | mutex_lock(&local->slaves_mtx); | 392 | mutex_lock(&local->iflist_mtx); |
393 | local->running = MAC802154_DEVICE_STOPPED; | 393 | local->running = MAC802154_DEVICE_STOPPED; |
394 | mutex_unlock(&local->slaves_mtx); | 394 | mutex_unlock(&local->iflist_mtx); |
395 | 395 | ||
396 | list_for_each_entry_safe(sdata, next, &local->slaves, list) { | 396 | list_for_each_entry_safe(sdata, next, &local->interfaces, list) { |
397 | mutex_lock(&sdata->local->slaves_mtx); | 397 | mutex_lock(&sdata->local->iflist_mtx); |
398 | list_del(&sdata->list); | 398 | list_del(&sdata->list); |
399 | mutex_unlock(&sdata->local->slaves_mtx); | 399 | mutex_unlock(&sdata->local->iflist_mtx); |
400 | 400 | ||
401 | unregister_netdevice(sdata->dev); | 401 | unregister_netdevice(sdata->dev); |
402 | } | 402 | } |
diff --git a/net/mac802154/monitor.c b/net/mac802154/monitor.c index 79bce5258b0c..9d2ac5ea6634 100644 --- a/net/mac802154/monitor.c +++ b/net/mac802154/monitor.c | |||
@@ -65,7 +65,7 @@ void mac802154_monitors_rx(struct ieee802154_local *local, struct sk_buff *skb) | |||
65 | u8 *data; | 65 | u8 *data; |
66 | 66 | ||
67 | rcu_read_lock(); | 67 | rcu_read_lock(); |
68 | list_for_each_entry_rcu(sdata, &local->slaves, list) { | 68 | list_for_each_entry_rcu(sdata, &local->interfaces, list) { |
69 | if (sdata->type != IEEE802154_DEV_MONITOR || | 69 | if (sdata->type != IEEE802154_DEV_MONITOR || |
70 | !netif_running(sdata->dev)) | 70 | !netif_running(sdata->dev)) |
71 | continue; | 71 | continue; |
diff --git a/net/mac802154/tx.c b/net/mac802154/tx.c index d20dadd6f27c..b6039c75d175 100644 --- a/net/mac802154/tx.c +++ b/net/mac802154/tx.c | |||
@@ -68,7 +68,7 @@ out: | |||
68 | 68 | ||
69 | /* Restart the netif queue on each sub_if_data object. */ | 69 | /* Restart the netif queue on each sub_if_data object. */ |
70 | rcu_read_lock(); | 70 | rcu_read_lock(); |
71 | list_for_each_entry_rcu(sdata, &xw->local->slaves, list) | 71 | list_for_each_entry_rcu(sdata, &xw->local->interfaces, list) |
72 | netif_wake_queue(sdata->dev); | 72 | netif_wake_queue(sdata->dev); |
73 | rcu_read_unlock(); | 73 | rcu_read_unlock(); |
74 | 74 | ||
@@ -109,7 +109,7 @@ netdev_tx_t mac802154_tx(struct ieee802154_local *local, struct sk_buff *skb, | |||
109 | 109 | ||
110 | /* Stop the netif queue on each sub_if_data object. */ | 110 | /* Stop the netif queue on each sub_if_data object. */ |
111 | rcu_read_lock(); | 111 | rcu_read_lock(); |
112 | list_for_each_entry_rcu(sdata, &local->slaves, list) | 112 | list_for_each_entry_rcu(sdata, &local->interfaces, list) |
113 | netif_stop_queue(sdata->dev); | 113 | netif_stop_queue(sdata->dev); |
114 | rcu_read_unlock(); | 114 | rcu_read_unlock(); |
115 | 115 | ||