diff options
author | Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> | 2009-08-19 11:32:24 -0400 |
---|---|---|
committer | Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> | 2009-08-19 15:08:22 -0400 |
commit | 16eea493da563b5a3356a77c6d8776dffc29d3b6 (patch) | |
tree | 6a6444442b8d7789d4c2fcb8ba990453969121fc /drivers/ieee802154 | |
parent | 81f9510381ee43205564063f2e8650672b11d453 (diff) |
ieee802154: add support for channel pages from IEEE 802.15.4-2006
IEEE 802.15.4-2006 adds new concept: channel pages, which can contain several
channels. Add support for channel pages in the API and in the fakehard driver.
Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Diffstat (limited to 'drivers/ieee802154')
-rw-r--r-- | drivers/ieee802154/fakehard.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/ieee802154/fakehard.c b/drivers/ieee802154/fakehard.c index 22a93bc764c5..c1c9697f9fde 100644 --- a/drivers/ieee802154/fakehard.c +++ b/drivers/ieee802154/fakehard.c | |||
@@ -119,12 +119,13 @@ static u8 fake_get_bsn(struct net_device *dev) | |||
119 | * 802.15.4-2006 document. | 119 | * 802.15.4-2006 document. |
120 | */ | 120 | */ |
121 | static int fake_assoc_req(struct net_device *dev, | 121 | static int fake_assoc_req(struct net_device *dev, |
122 | struct ieee802154_addr *addr, u8 channel, u8 cap) | 122 | struct ieee802154_addr *addr, u8 channel, u8 page, u8 cap) |
123 | { | 123 | { |
124 | struct wpan_phy *phy = net_to_phy(dev); | 124 | struct wpan_phy *phy = net_to_phy(dev); |
125 | 125 | ||
126 | mutex_lock(&phy->pib_lock); | 126 | mutex_lock(&phy->pib_lock); |
127 | phy->current_channel = channel; | 127 | phy->current_channel = channel; |
128 | phy->current_page = page; | ||
128 | mutex_unlock(&phy->pib_lock); | 129 | mutex_unlock(&phy->pib_lock); |
129 | 130 | ||
130 | /* We simply emulate it here */ | 131 | /* We simply emulate it here */ |
@@ -191,7 +192,7 @@ static int fake_disassoc_req(struct net_device *dev, | |||
191 | * document, with 7.3.8 describing coordinator realignment. | 192 | * document, with 7.3.8 describing coordinator realignment. |
192 | */ | 193 | */ |
193 | static int fake_start_req(struct net_device *dev, struct ieee802154_addr *addr, | 194 | static int fake_start_req(struct net_device *dev, struct ieee802154_addr *addr, |
194 | u8 channel, | 195 | u8 channel, u8 page, |
195 | u8 bcn_ord, u8 sf_ord, u8 pan_coord, u8 blx, | 196 | u8 bcn_ord, u8 sf_ord, u8 pan_coord, u8 blx, |
196 | u8 coord_realign) | 197 | u8 coord_realign) |
197 | { | 198 | { |
@@ -199,6 +200,7 @@ static int fake_start_req(struct net_device *dev, struct ieee802154_addr *addr, | |||
199 | 200 | ||
200 | mutex_lock(&phy->pib_lock); | 201 | mutex_lock(&phy->pib_lock); |
201 | phy->current_channel = channel; | 202 | phy->current_channel = channel; |
203 | phy->current_page = page; | ||
202 | mutex_unlock(&phy->pib_lock); | 204 | mutex_unlock(&phy->pib_lock); |
203 | 205 | ||
204 | /* We don't emulate beacons here at all, so START should fail */ | 206 | /* We don't emulate beacons here at all, so START should fail */ |
@@ -222,11 +224,11 @@ static int fake_start_req(struct net_device *dev, struct ieee802154_addr *addr, | |||
222 | * Note: This is in section 7.5.2.1 of the IEEE 802.15.4-2006 document. | 224 | * Note: This is in section 7.5.2.1 of the IEEE 802.15.4-2006 document. |
223 | */ | 225 | */ |
224 | static int fake_scan_req(struct net_device *dev, u8 type, u32 channels, | 226 | static int fake_scan_req(struct net_device *dev, u8 type, u32 channels, |
225 | u8 duration) | 227 | u8 page, u8 duration) |
226 | { | 228 | { |
227 | u8 edl[27] = {}; | 229 | u8 edl[27] = {}; |
228 | return ieee802154_nl_scan_confirm(dev, IEEE802154_SUCCESS, type, | 230 | return ieee802154_nl_scan_confirm(dev, IEEE802154_SUCCESS, type, |
229 | channels, | 231 | channels, page, |
230 | type == IEEE802154_MAC_SCAN_ED ? edl : NULL); | 232 | type == IEEE802154_MAC_SCAN_ED ? edl : NULL); |
231 | } | 233 | } |
232 | 234 | ||