Skip to content

Commit d98be45

Browse files
alexaringholtmann
authored andcommitted
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>
1 parent 04e850f commit d98be45

5 files changed

Lines changed: 37 additions & 37 deletions

File tree

‎net/mac802154/ieee802154_i.h‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ struct ieee802154_local {
4242
*
4343
* So atomic readers can use any of this protection methods.
4444
*/
45-
struct list_head slaves;
46-
struct mutex slaves_mtx;
45+
struct list_head interfaces;
46+
struct mutex iflist_mtx;
4747

4848
/* This one is used for scanning and other jobs not to be interfered
4949
* with serial driver.

‎net/mac802154/iface.c‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -125,9 +125,9 @@ int mac802154_set_mac_params(struct net_device *dev,
125125
{
126126
struct ieee802154_sub_if_data *sdata = netdev_priv(dev);
127127

128-
mutex_lock(&sdata->local->slaves_mtx);
128+
mutex_lock(&sdata->local->iflist_mtx);
129129
sdata->mac_params = *params;
130-
mutex_unlock(&sdata->local->slaves_mtx);
130+
mutex_unlock(&sdata->local->iflist_mtx);
131131

132132
return 0;
133133
}
@@ -137,9 +137,9 @@ void mac802154_get_mac_params(struct net_device *dev,
137137
{
138138
struct ieee802154_sub_if_data *sdata = netdev_priv(dev);
139139

140-
mutex_lock(&sdata->local->slaves_mtx);
140+
mutex_lock(&sdata->local->iflist_mtx);
141141
*params = sdata->mac_params;
142-
mutex_unlock(&sdata->local->slaves_mtx);
142+
mutex_unlock(&sdata->local->iflist_mtx);
143143
}
144144

145145
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)
580580
}
581581

582582
rcu_read_lock();
583-
list_for_each_entry_rcu(sdata, &local->slaves, list) {
583+
list_for_each_entry_rcu(sdata, &local->interfaces, list) {
584584
if (sdata->type != IEEE802154_DEV_WPAN ||
585585
!netif_running(sdata->dev))
586586
continue;

‎net/mac802154/main.c‎

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -39,20 +39,20 @@ int mac802154_slave_open(struct net_device *dev)
3939
ASSERT_RTNL();
4040

4141
if (sdata->type == IEEE802154_DEV_WPAN) {
42-
mutex_lock(&sdata->local->slaves_mtx);
43-
list_for_each_entry(subif, &sdata->local->slaves, list) {
42+
mutex_lock(&sdata->local->iflist_mtx);
43+
list_for_each_entry(subif, &sdata->local->interfaces, list) {
4444
if (subif != sdata && subif->type == sdata->type &&
4545
subif->running) {
46-
mutex_unlock(&sdata->local->slaves_mtx);
46+
mutex_unlock(&sdata->local->iflist_mtx);
4747
return -EBUSY;
4848
}
4949
}
50-
mutex_unlock(&sdata->local->slaves_mtx);
50+
mutex_unlock(&sdata->local->iflist_mtx);
5151
}
5252

53-
mutex_lock(&sdata->local->slaves_mtx);
53+
mutex_lock(&sdata->local->iflist_mtx);
5454
sdata->running = true;
55-
mutex_unlock(&sdata->local->slaves_mtx);
55+
mutex_unlock(&sdata->local->iflist_mtx);
5656

5757
if (local->open_count++ == 0) {
5858
res = local->ops->start(&local->hw);
@@ -88,9 +88,9 @@ int mac802154_slave_close(struct net_device *dev)
8888

8989
netif_stop_queue(dev);
9090

91-
mutex_lock(&sdata->local->slaves_mtx);
91+
mutex_lock(&sdata->local->iflist_mtx);
9292
sdata->running = false;
93-
mutex_unlock(&sdata->local->slaves_mtx);
93+
mutex_unlock(&sdata->local->iflist_mtx);
9494

9595
if (!--local->open_count)
9696
local->ops->stop(&local->hw);
@@ -115,21 +115,21 @@ mac802154_netdev_register(struct wpan_phy *phy, struct net_device *dev)
115115

116116
SET_NETDEV_DEV(dev, &local->phy->dev);
117117

118-
mutex_lock(&local->slaves_mtx);
118+
mutex_lock(&local->iflist_mtx);
119119
if (!local->running) {
120-
mutex_unlock(&local->slaves_mtx);
120+
mutex_unlock(&local->iflist_mtx);
121121
return -ENODEV;
122122
}
123-
mutex_unlock(&local->slaves_mtx);
123+
mutex_unlock(&local->iflist_mtx);
124124

125125
err = register_netdev(dev);
126126
if (err < 0)
127127
return err;
128128

129129
rtnl_lock();
130-
mutex_lock(&local->slaves_mtx);
131-
list_add_tail_rcu(&sdata->list, &local->slaves);
132-
mutex_unlock(&local->slaves_mtx);
130+
mutex_lock(&local->iflist_mtx);
131+
list_add_tail_rcu(&sdata->list, &local->interfaces);
132+
mutex_unlock(&local->iflist_mtx);
133133
rtnl_unlock();
134134

135135
return 0;
@@ -146,9 +146,9 @@ mac802154_del_iface(struct wpan_phy *phy, struct net_device *dev)
146146

147147
BUG_ON(sdata->local->phy != phy);
148148

149-
mutex_lock(&sdata->local->slaves_mtx);
149+
mutex_lock(&sdata->local->iflist_mtx);
150150
list_del_rcu(&sdata->list);
151-
mutex_unlock(&sdata->local->slaves_mtx);
151+
mutex_unlock(&sdata->local->iflist_mtx);
152152

153153
synchronize_rcu();
154154
unregister_netdevice(sdata->dev);
@@ -280,8 +280,8 @@ ieee802154_alloc_hw(size_t priv_data_len, struct ieee802154_ops *ops)
280280
local->hw.priv = (char *)local + ALIGN(sizeof(*local), NETDEV_ALIGN);
281281
local->ops = ops;
282282

283-
INIT_LIST_HEAD(&local->slaves);
284-
mutex_init(&local->slaves_mtx);
283+
INIT_LIST_HEAD(&local->interfaces);
284+
mutex_init(&local->iflist_mtx);
285285

286286
return &local->hw;
287287
}
@@ -291,9 +291,9 @@ void ieee802154_free_hw(struct ieee802154_hw *hw)
291291
{
292292
struct ieee802154_local *local = mac802154_to_priv(hw);
293293

294-
BUG_ON(!list_empty(&local->slaves));
294+
BUG_ON(!list_empty(&local->interfaces));
295295

296-
mutex_destroy(&local->slaves_mtx);
296+
mutex_destroy(&local->iflist_mtx);
297297

298298
wpan_phy_free(local->phy);
299299
}
@@ -364,9 +364,9 @@ int ieee802154_register_hw(struct ieee802154_hw *hw)
364364

365365
rtnl_lock();
366366

367-
mutex_lock(&local->slaves_mtx);
367+
mutex_lock(&local->iflist_mtx);
368368
local->running = MAC802154_DEVICE_RUN;
369-
mutex_unlock(&local->slaves_mtx);
369+
mutex_unlock(&local->iflist_mtx);
370370

371371
rtnl_unlock();
372372

@@ -389,14 +389,14 @@ void ieee802154_unregister_hw(struct ieee802154_hw *hw)
389389

390390
rtnl_lock();
391391

392-
mutex_lock(&local->slaves_mtx);
392+
mutex_lock(&local->iflist_mtx);
393393
local->running = MAC802154_DEVICE_STOPPED;
394-
mutex_unlock(&local->slaves_mtx);
394+
mutex_unlock(&local->iflist_mtx);
395395

396-
list_for_each_entry_safe(sdata, next, &local->slaves, list) {
397-
mutex_lock(&sdata->local->slaves_mtx);
396+
list_for_each_entry_safe(sdata, next, &local->interfaces, list) {
397+
mutex_lock(&sdata->local->iflist_mtx);
398398
list_del(&sdata->list);
399-
mutex_unlock(&sdata->local->slaves_mtx);
399+
mutex_unlock(&sdata->local->iflist_mtx);
400400

401401
unregister_netdevice(sdata->dev);
402402
}

‎net/mac802154/monitor.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ void mac802154_monitors_rx(struct ieee802154_local *local, struct sk_buff *skb)
6565
u8 *data;
6666

6767
rcu_read_lock();
68-
list_for_each_entry_rcu(sdata, &local->slaves, list) {
68+
list_for_each_entry_rcu(sdata, &local->interfaces, list) {
6969
if (sdata->type != IEEE802154_DEV_MONITOR ||
7070
!netif_running(sdata->dev))
7171
continue;

‎net/mac802154/tx.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ static void mac802154_xmit_worker(struct work_struct *work)
6868

6969
/* Restart the netif queue on each sub_if_data object. */
7070
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)
7272
netif_wake_queue(sdata->dev);
7373
rcu_read_unlock();
7474

@@ -109,7 +109,7 @@ netdev_tx_t mac802154_tx(struct ieee802154_local *local, struct sk_buff *skb,
109109

110110
/* Stop the netif queue on each sub_if_data object. */
111111
rcu_read_lock();
112-
list_for_each_entry_rcu(sdata, &local->slaves, list)
112+
list_for_each_entry_rcu(sdata, &local->interfaces, list)
113113
netif_stop_queue(sdata->dev);
114114
rcu_read_unlock();
115115

0 commit comments

Comments
 (0)