aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac802154
diff options
context:
space:
mode:
authorAlexander Aring <alex.aring@gmail.com>2015-05-17 15:44:38 -0400
committerMarcel Holtmann <marcel@holtmann.org>2015-05-19 05:44:41 -0400
commit673692faf3fb42ec73ef7210238b5869d6e2873d (patch)
tree9de5b9e4408ec6de1b29bea56728adb4d9a6bbc5 /net/mac802154
parent0cf0879acdbeff695963d78940b89497803ae55c (diff)
ieee802154: move validation check out of softmac
This patch moves the value validation out of softmac layer. We need to be sure now that this value is accepted by the transceiver/mac802154 or "possible" hardmac drivers before calling rdev-ops. Signed-off-by: Alexander Aring <alex.aring@gmail.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'net/mac802154')
-rw-r--r--net/mac802154/cfg.c29
1 files changed, 0 insertions, 29 deletions
diff --git a/net/mac802154/cfg.c b/net/mac802154/cfg.c
index 70be9c799f8a..c63601582c71 100644
--- a/net/mac802154/cfg.c
+++ b/net/mac802154/cfg.c
@@ -73,10 +73,6 @@ ieee802154_set_channel(struct wpan_phy *wpan_phy, u8 page, u8 channel)
73 73
74 ASSERT_RTNL(); 74 ASSERT_RTNL();
75 75
76 /* check if phy support this setting */
77 if (!(wpan_phy->channels_supported[page] & BIT(channel)))
78 return -EINVAL;
79
80 ret = drv_set_channel(local, page, channel); 76 ret = drv_set_channel(local, page, channel);
81 if (!ret) { 77 if (!ret) {
82 wpan_phy->current_page = page; 78 wpan_phy->current_page = page;
@@ -112,16 +108,6 @@ ieee802154_set_pan_id(struct wpan_phy *wpan_phy, struct wpan_dev *wpan_dev,
112{ 108{
113 ASSERT_RTNL(); 109 ASSERT_RTNL();
114 110
115 /* TODO
116 * I am not sure about to check here on broadcast pan_id.
117 * Broadcast is a valid setting, comment from 802.15.4:
118 * If this value is 0xffff, the device is not associated.
119 *
120 * This could useful to simple deassociate an device.
121 */
122 if (pan_id == cpu_to_le16(IEEE802154_PAN_ID_BROADCAST))
123 return -EINVAL;
124
125 wpan_dev->pan_id = pan_id; 111 wpan_dev->pan_id = pan_id;
126 return 0; 112 return 0;
127} 113}
@@ -149,21 +135,6 @@ ieee802154_set_short_addr(struct wpan_phy *wpan_phy, struct wpan_dev *wpan_dev,
149{ 135{
150 ASSERT_RTNL(); 136 ASSERT_RTNL();
151 137
152 /* TODO
153 * I am not sure about to check here on broadcast short_addr.
154 * Broadcast is a valid setting, comment from 802.15.4:
155 * A value of 0xfffe indicates that the device has
156 * associated but has not been allocated an address. A
157 * value of 0xffff indicates that the device does not
158 * have a short address.
159 *
160 * I think we should allow to set these settings but
161 * don't allow to allow socket communication with it.
162 */
163 if (short_addr == cpu_to_le16(IEEE802154_ADDR_SHORT_UNSPEC) ||
164 short_addr == cpu_to_le16(IEEE802154_ADDR_SHORT_BROADCAST))
165 return -EINVAL;
166
167 wpan_dev->short_addr = short_addr; 138 wpan_dev->short_addr = short_addr;
168 return 0; 139 return 0;
169} 140}