aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac802154
diff options
context:
space:
mode:
authorAlexander Aring <alex.aring@gmail.com>2014-11-17 02:20:55 -0500
committerMarcel Holtmann <marcel@holtmann.org>2014-11-17 03:49:17 -0500
commitee7b9053bd69ff43cbc87a9bb987f4d92dc2c29f (patch)
treeeef6377b4bc5f6c76fffa547ee4d0872c58e8f3a /net/mac802154
parentcb41c8dd01d74d091618f72e28f0282f064a9f0a (diff)
ieee802154: fix byteorder for short address and panid
This patch changes the byteorder handling for short and panid handling. We now except to get little endian in nl802154 for these attributes. 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.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/net/mac802154/cfg.c b/net/mac802154/cfg.c
index 7def2625eaca..c035708ada16 100644
--- a/net/mac802154/cfg.c
+++ b/net/mac802154/cfg.c
@@ -88,7 +88,7 @@ ieee802154_set_channel(struct wpan_phy *wpan_phy, u8 page, u8 channel)
88 88
89static int 89static int
90ieee802154_set_pan_id(struct wpan_phy *wpan_phy, struct wpan_dev *wpan_dev, 90ieee802154_set_pan_id(struct wpan_phy *wpan_phy, struct wpan_dev *wpan_dev,
91 u16 pan_id) 91 __le16 pan_id)
92{ 92{
93 ASSERT_RTNL(); 93 ASSERT_RTNL();
94 94
@@ -99,10 +99,10 @@ ieee802154_set_pan_id(struct wpan_phy *wpan_phy, struct wpan_dev *wpan_dev,
99 * 99 *
100 * This could useful to simple deassociate an device. 100 * This could useful to simple deassociate an device.
101 */ 101 */
102 if (pan_id == IEEE802154_PAN_ID_BROADCAST) 102 if (pan_id == cpu_to_le16(IEEE802154_PAN_ID_BROADCAST))
103 return -EINVAL; 103 return -EINVAL;
104 104
105 wpan_dev->pan_id = cpu_to_le16(pan_id); 105 wpan_dev->pan_id = pan_id;
106 return 0; 106 return 0;
107} 107}
108 108
@@ -125,7 +125,7 @@ ieee802154_set_backoff_exponent(struct wpan_phy *wpan_phy,
125 125
126static int 126static int
127ieee802154_set_short_addr(struct wpan_phy *wpan_phy, struct wpan_dev *wpan_dev, 127ieee802154_set_short_addr(struct wpan_phy *wpan_phy, struct wpan_dev *wpan_dev,
128 u16 short_addr) 128 __le16 short_addr)
129{ 129{
130 ASSERT_RTNL(); 130 ASSERT_RTNL();
131 131
@@ -140,11 +140,11 @@ ieee802154_set_short_addr(struct wpan_phy *wpan_phy, struct wpan_dev *wpan_dev,
140 * I think we should allow to set these settings but 140 * I think we should allow to set these settings but
141 * don't allow to allow socket communication with it. 141 * don't allow to allow socket communication with it.
142 */ 142 */
143 if (short_addr == IEEE802154_ADDR_SHORT_UNSPEC || 143 if (short_addr == cpu_to_le16(IEEE802154_ADDR_SHORT_UNSPEC) ||
144 short_addr == IEEE802154_ADDR_SHORT_BROADCAST) 144 short_addr == cpu_to_le16(IEEE802154_ADDR_SHORT_BROADCAST))
145 return -EINVAL; 145 return -EINVAL;
146 146
147 wpan_dev->short_addr = cpu_to_le16(short_addr); 147 wpan_dev->short_addr = short_addr;
148 return 0; 148 return 0;
149} 149}
150 150