Skip to content

Commit 04e850f

Browse files
alexaringholtmann
authored andcommitted
mac802154: rename hw subif_data variable to local
This patch renames the hw attribute in struct ieee802154_sub_if_data to local. This avoid confusing with the struct ieee802154_hw hw; inside of local struct. Signed-off-by: Alexander Aring <alex.aring@gmail.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
1 parent 036562f commit 04e850f

6 files changed

Lines changed: 47 additions & 47 deletions

File tree

‎net/mac802154/ieee802154_i.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ struct ieee802154_local {
6969
struct ieee802154_sub_if_data {
7070
struct list_head list; /* the ieee802154_priv->slaves list */
7171

72-
struct ieee802154_local *hw;
72+
struct ieee802154_local *local;
7373
struct net_device *dev;
7474

7575
int type;

‎net/mac802154/iface.c‎

Lines changed: 6 additions & 6 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->hw->slaves_mtx);
128+
mutex_lock(&sdata->local->slaves_mtx);
129129
sdata->mac_params = *params;
130-
mutex_unlock(&sdata->hw->slaves_mtx);
130+
mutex_unlock(&sdata->local->slaves_mtx);
131131

132132
return 0;
133133
}
@@ -137,16 +137,16 @@ 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->hw->slaves_mtx);
140+
mutex_lock(&sdata->local->slaves_mtx);
141141
*params = sdata->mac_params;
142-
mutex_unlock(&sdata->hw->slaves_mtx);
142+
mutex_unlock(&sdata->local->slaves_mtx);
143143
}
144144

145145
static int mac802154_wpan_open(struct net_device *dev)
146146
{
147147
int rc;
148148
struct ieee802154_sub_if_data *sdata = netdev_priv(dev);
149-
struct wpan_phy *phy = sdata->hw->phy;
149+
struct wpan_phy *phy = sdata->local->phy;
150150

151151
rc = mac802154_slave_open(dev);
152152
if (rc < 0)
@@ -339,7 +339,7 @@ mac802154_wpan_xmit(struct sk_buff *skb, struct net_device *dev)
339339
dev->stats.tx_packets++;
340340
dev->stats.tx_bytes += skb->len;
341341

342-
return mac802154_tx(sdata->hw, skb, page, chan);
342+
return mac802154_tx(sdata->local, skb, page, chan);
343343
}
344344

345345
static struct header_ops mac802154_header_ops = {

‎net/mac802154/mac_cmd.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ static struct wpan_phy *mac802154_get_phy(const struct net_device *dev)
7979

8080
BUG_ON(dev->type != ARPHRD_IEEE802154);
8181

82-
return to_phy(get_device(&sdata->hw->phy->dev));
82+
return to_phy(get_device(&sdata->local->phy->dev));
8383
}
8484

8585
static struct ieee802154_llsec_ops mac802154_llsec_ops = {

‎net/mac802154/main.c‎

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -33,26 +33,26 @@ int mac802154_slave_open(struct net_device *dev)
3333
{
3434
struct ieee802154_sub_if_data *sdata = netdev_priv(dev);
3535
struct ieee802154_sub_if_data *subif;
36-
struct ieee802154_local *local = sdata->hw;
36+
struct ieee802154_local *local = sdata->local;
3737
int res = 0;
3838

3939
ASSERT_RTNL();
4040

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

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

5757
if (local->open_count++ == 0) {
5858
res = local->ops->start(&local->hw);
@@ -74,23 +74,23 @@ int mac802154_slave_open(struct net_device *dev)
7474
netif_start_queue(dev);
7575
return 0;
7676
err:
77-
sdata->hw->open_count--;
77+
sdata->local->open_count--;
7878

7979
return res;
8080
}
8181

8282
int mac802154_slave_close(struct net_device *dev)
8383
{
8484
struct ieee802154_sub_if_data *sdata = netdev_priv(dev);
85-
struct ieee802154_local *local = sdata->hw;
85+
struct ieee802154_local *local = sdata->local;
8686

8787
ASSERT_RTNL();
8888

8989
netif_stop_queue(dev);
9090

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

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

110110
sdata = netdev_priv(dev);
111111
sdata->dev = dev;
112-
sdata->hw = local;
112+
sdata->local = local;
113113

114114
dev->needed_headroom = local->hw.extra_tx_headroom;
115115

@@ -144,11 +144,11 @@ mac802154_del_iface(struct wpan_phy *phy, struct net_device *dev)
144144

145145
sdata = netdev_priv(dev);
146146

147-
BUG_ON(sdata->hw->phy != phy);
147+
BUG_ON(sdata->local->phy != phy);
148148

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

153153
synchronize_rcu();
154154
unregister_netdevice(sdata->dev);
@@ -394,9 +394,9 @@ void ieee802154_unregister_hw(struct ieee802154_hw *hw)
394394
mutex_unlock(&local->slaves_mtx);
395395

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

401401
unregister_netdevice(sdata->dev);
402402
}

‎net/mac802154/mib.c‎

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ static struct ieee802154_local *mac802154_slave_get_priv(struct net_device *dev)
4242

4343
BUG_ON(dev->type != ARPHRD_IEEE802154);
4444

45-
return sdata->hw;
45+
return sdata->local;
4646
}
4747

4848
static void hw_addr_notify(struct work_struct *work)
@@ -72,7 +72,7 @@ static void set_hw_addr_filt(struct net_device *dev, unsigned long changed)
7272
INIT_WORK(&work->work, hw_addr_notify);
7373
work->dev = dev;
7474
work->changed = changed;
75-
queue_work(sdata->hw->dev_workqueue, &work->work);
75+
queue_work(sdata->local->dev_workqueue, &work->work);
7676
}
7777

7878
void mac802154_dev_set_short_addr(struct net_device *dev, __le16 val)
@@ -85,9 +85,9 @@ void mac802154_dev_set_short_addr(struct net_device *dev, __le16 val)
8585
sdata->short_addr = val;
8686
spin_unlock_bh(&sdata->mib_lock);
8787

88-
if ((sdata->hw->ops->set_hw_addr_filt) &&
89-
(sdata->hw->hw.hw_filt.short_addr != sdata->short_addr)) {
90-
sdata->hw->hw.hw_filt.short_addr = sdata->short_addr;
88+
if ((sdata->local->ops->set_hw_addr_filt) &&
89+
(sdata->local->hw.hw_filt.short_addr != sdata->short_addr)) {
90+
sdata->local->hw.hw_filt.short_addr = sdata->short_addr;
9191
set_hw_addr_filt(dev, IEEE802154_AFILT_SADDR_CHANGED);
9292
}
9393
}
@@ -109,7 +109,7 @@ __le16 mac802154_dev_get_short_addr(const struct net_device *dev)
109109
void mac802154_dev_set_ieee_addr(struct net_device *dev)
110110
{
111111
struct ieee802154_sub_if_data *sdata = netdev_priv(dev);
112-
struct ieee802154_local *local = sdata->hw;
112+
struct ieee802154_local *local = sdata->local;
113113

114114
sdata->extended_addr = ieee802154_devaddr_from_raw(dev->dev_addr);
115115

@@ -144,9 +144,9 @@ void mac802154_dev_set_pan_id(struct net_device *dev, __le16 val)
144144
sdata->pan_id = val;
145145
spin_unlock_bh(&sdata->mib_lock);
146146

147-
if ((sdata->hw->ops->set_hw_addr_filt) &&
148-
(sdata->hw->hw.hw_filt.pan_id != sdata->pan_id)) {
149-
sdata->hw->hw.hw_filt.pan_id = sdata->pan_id;
147+
if ((sdata->local->ops->set_hw_addr_filt) &&
148+
(sdata->local->hw.hw_filt.pan_id != sdata->pan_id)) {
149+
sdata->local->hw.hw_filt.pan_id = sdata->pan_id;
150150
set_hw_addr_filt(dev, IEEE802154_AFILT_PANID_CHANGED);
151151
}
152152
}
@@ -168,15 +168,15 @@ static void phy_chan_notify(struct work_struct *work)
168168
struct ieee802154_sub_if_data *sdata = netdev_priv(nw->dev);
169169
int res;
170170

171-
mutex_lock(&sdata->hw->phy->pib_lock);
171+
mutex_lock(&sdata->local->phy->pib_lock);
172172
res = local->ops->set_channel(&local->hw, sdata->page, sdata->chan);
173173
if (res) {
174174
pr_debug("set_channel failed\n");
175175
} else {
176-
sdata->hw->phy->current_channel = sdata->chan;
177-
sdata->hw->phy->current_page = sdata->page;
176+
sdata->local->phy->current_channel = sdata->chan;
177+
sdata->local->phy->current_page = sdata->page;
178178
}
179-
mutex_unlock(&sdata->hw->phy->pib_lock);
179+
mutex_unlock(&sdata->local->phy->pib_lock);
180180

181181
kfree(nw);
182182
}
@@ -193,20 +193,20 @@ void mac802154_dev_set_page_channel(struct net_device *dev, u8 page, u8 chan)
193193
sdata->chan = chan;
194194
spin_unlock_bh(&sdata->mib_lock);
195195

196-
mutex_lock(&sdata->hw->phy->pib_lock);
197-
if (sdata->hw->phy->current_channel != sdata->chan ||
198-
sdata->hw->phy->current_page != sdata->page) {
199-
mutex_unlock(&sdata->hw->phy->pib_lock);
196+
mutex_lock(&sdata->local->phy->pib_lock);
197+
if (sdata->local->phy->current_channel != sdata->chan ||
198+
sdata->local->phy->current_page != sdata->page) {
199+
mutex_unlock(&sdata->local->phy->pib_lock);
200200

201201
work = kzalloc(sizeof(*work), GFP_ATOMIC);
202202
if (!work)
203203
return;
204204

205205
INIT_WORK(&work->work, phy_chan_notify);
206206
work->dev = dev;
207-
queue_work(sdata->hw->dev_workqueue, &work->work);
207+
queue_work(sdata->local->dev_workqueue, &work->work);
208208
} else {
209-
mutex_unlock(&sdata->hw->phy->pib_lock);
209+
mutex_unlock(&sdata->local->phy->pib_lock);
210210
}
211211
}
212212

‎net/mac802154/monitor.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ static netdev_tx_t mac802154_monitor_xmit(struct sk_buff *skb,
3939
sdata = netdev_priv(dev);
4040

4141
/* FIXME: locking */
42-
chan = sdata->hw->phy->current_channel;
43-
page = sdata->hw->phy->current_page;
42+
chan = sdata->local->phy->current_channel;
43+
page = sdata->local->phy->current_page;
4444

4545
if (chan == MAC802154_CHAN_NONE) /* not initialized */
4646
return NETDEV_TX_OK;
@@ -53,7 +53,7 @@ static netdev_tx_t mac802154_monitor_xmit(struct sk_buff *skb,
5353
dev->stats.tx_packets++;
5454
dev->stats.tx_bytes += skb->len;
5555

56-
return mac802154_tx(sdata->hw, skb, page, chan);
56+
return mac802154_tx(sdata->local, skb, page, chan);
5757
}
5858

5959

0 commit comments

Comments
 (0)