diff options
author | Alexander Aring <alex.aring@gmail.com> | 2014-10-28 13:21:29 -0400 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2014-10-28 18:19:08 -0400 |
commit | 12439a53560097bc8e42cf14967717d14588dddd (patch) | |
tree | 34a1bf967900cb2ca32e32eb4a9eb07a422ad079 /net | |
parent | 33d4189f51f0dbb522a4d81aafc7edb2e048c570 (diff) |
mac802154: remove channel attributes from sdata
These channel attributes was part of "channel context switch while xmit"
which was removed by commit dc67c6b30f36d57b70b70547a30e7a8432540c6f
("mac802154: tx: remove xmit channel context switch"). This patch
removes these unnecessary variables and use the current_page and
current_channel by wpan_phy struct now.
Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'net')
-rw-r--r-- | net/mac802154/ieee802154_i.h | 3 | ||||
-rw-r--r-- | net/mac802154/iface.c | 4 | ||||
-rw-r--r-- | net/mac802154/mib.c | 55 |
3 files changed, 9 insertions, 53 deletions
diff --git a/net/mac802154/ieee802154_i.h b/net/mac802154/ieee802154_i.h index bf0b5f613c36..46c9fe7ba2b2 100644 --- a/net/mac802154/ieee802154_i.h +++ b/net/mac802154/ieee802154_i.h | |||
@@ -85,9 +85,6 @@ struct ieee802154_sub_if_data { | |||
85 | __le16 short_addr; | 85 | __le16 short_addr; |
86 | __le64 extended_addr; | 86 | __le64 extended_addr; |
87 | 87 | ||
88 | u8 chan; | ||
89 | u8 page; | ||
90 | |||
91 | struct ieee802154_mac_params mac_params; | 88 | struct ieee802154_mac_params mac_params; |
92 | 89 | ||
93 | /* MAC BSN field */ | 90 | /* MAC BSN field */ |
diff --git a/net/mac802154/iface.c b/net/mac802154/iface.c index 2423aa7671df..1c0274ed9370 100644 --- a/net/mac802154/iface.c +++ b/net/mac802154/iface.c | |||
@@ -417,8 +417,6 @@ void mac802154_wpan_setup(struct net_device *dev) | |||
417 | sdata = IEEE802154_DEV_TO_SUB_IF(dev); | 417 | sdata = IEEE802154_DEV_TO_SUB_IF(dev); |
418 | sdata->type = IEEE802154_DEV_WPAN; | 418 | sdata->type = IEEE802154_DEV_WPAN; |
419 | 419 | ||
420 | sdata->chan = MAC802154_CHAN_NONE; | ||
421 | |||
422 | spin_lock_init(&sdata->mib_lock); | 420 | spin_lock_init(&sdata->mib_lock); |
423 | mutex_init(&sdata->sec_mtx); | 421 | mutex_init(&sdata->sec_mtx); |
424 | 422 | ||
@@ -454,6 +452,4 @@ void mac802154_monitor_setup(struct net_device *dev) | |||
454 | 452 | ||
455 | sdata = IEEE802154_DEV_TO_SUB_IF(dev); | 453 | sdata = IEEE802154_DEV_TO_SUB_IF(dev); |
456 | sdata->type = IEEE802154_DEV_MONITOR; | 454 | sdata->type = IEEE802154_DEV_MONITOR; |
457 | |||
458 | sdata->chan = MAC802154_CHAN_NONE; /* not initialized */ | ||
459 | } | 455 | } |
diff --git a/net/mac802154/mib.c b/net/mac802154/mib.c index 3fbc217dbdcc..0184fced2f62 100644 --- a/net/mac802154/mib.c +++ b/net/mac802154/mib.c | |||
@@ -26,11 +26,6 @@ | |||
26 | #include "ieee802154_i.h" | 26 | #include "ieee802154_i.h" |
27 | #include "driver-ops.h" | 27 | #include "driver-ops.h" |
28 | 28 | ||
29 | struct phy_chan_notify_work { | ||
30 | struct work_struct work; | ||
31 | struct net_device *dev; | ||
32 | }; | ||
33 | |||
34 | struct hw_addr_filt_notify_work { | 29 | struct hw_addr_filt_notify_work { |
35 | struct work_struct work; | 30 | struct work_struct work; |
36 | struct net_device *dev; | 31 | struct net_device *dev; |
@@ -161,54 +156,22 @@ u8 mac802154_dev_get_dsn(const struct net_device *dev) | |||
161 | return sdata->dsn++; | 156 | return sdata->dsn++; |
162 | } | 157 | } |
163 | 158 | ||
164 | static void phy_chan_notify(struct work_struct *work) | ||
165 | { | ||
166 | struct phy_chan_notify_work *nw = container_of(work, | ||
167 | struct phy_chan_notify_work, work); | ||
168 | struct net_device *dev = nw->dev; | ||
169 | struct ieee802154_local *local = mac802154_slave_get_priv(dev); | ||
170 | struct ieee802154_sub_if_data *sdata = IEEE802154_DEV_TO_SUB_IF(dev); | ||
171 | int res; | ||
172 | |||
173 | mutex_lock(&sdata->local->phy->pib_lock); | ||
174 | res = drv_set_channel(local, sdata->page, sdata->chan); | ||
175 | if (res) { | ||
176 | pr_debug("set_channel failed\n"); | ||
177 | } else { | ||
178 | sdata->local->phy->current_channel = sdata->chan; | ||
179 | sdata->local->phy->current_page = sdata->page; | ||
180 | } | ||
181 | mutex_unlock(&sdata->local->phy->pib_lock); | ||
182 | |||
183 | kfree(nw); | ||
184 | } | ||
185 | |||
186 | void mac802154_dev_set_page_channel(struct net_device *dev, u8 page, u8 chan) | 159 | void mac802154_dev_set_page_channel(struct net_device *dev, u8 page, u8 chan) |
187 | { | 160 | { |
188 | struct ieee802154_sub_if_data *sdata = IEEE802154_DEV_TO_SUB_IF(dev); | 161 | struct ieee802154_sub_if_data *sdata = IEEE802154_DEV_TO_SUB_IF(dev); |
189 | struct phy_chan_notify_work *work; | 162 | struct ieee802154_local *local = sdata->local; |
163 | int res; | ||
190 | 164 | ||
191 | BUG_ON(dev->type != ARPHRD_IEEE802154); | 165 | BUG_ON(dev->type != ARPHRD_IEEE802154); |
192 | 166 | ||
193 | spin_lock_bh(&sdata->mib_lock); | 167 | res = drv_set_channel(local, page, chan); |
194 | sdata->page = page; | 168 | if (res) { |
195 | sdata->chan = chan; | 169 | pr_debug("set_channel failed\n"); |
196 | spin_unlock_bh(&sdata->mib_lock); | ||
197 | |||
198 | mutex_lock(&sdata->local->phy->pib_lock); | ||
199 | if (sdata->local->phy->current_channel != sdata->chan || | ||
200 | sdata->local->phy->current_page != sdata->page) { | ||
201 | mutex_unlock(&sdata->local->phy->pib_lock); | ||
202 | |||
203 | work = kzalloc(sizeof(*work), GFP_ATOMIC); | ||
204 | if (!work) | ||
205 | return; | ||
206 | |||
207 | INIT_WORK(&work->work, phy_chan_notify); | ||
208 | work->dev = dev; | ||
209 | queue_work(sdata->local->workqueue, &work->work); | ||
210 | } else { | 170 | } else { |
211 | mutex_unlock(&sdata->local->phy->pib_lock); | 171 | mutex_lock(&local->phy->pib_lock); |
172 | local->phy->current_channel = chan; | ||
173 | local->phy->current_page = page; | ||
174 | mutex_unlock(&local->phy->pib_lock); | ||
212 | } | 175 | } |
213 | } | 176 | } |
214 | 177 | ||