aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ieee802154/fakehard.c
diff options
context:
space:
mode:
authorPhoebe Buckheister <phoebe.buckheister@itwm.fraunhofer.de>2014-03-14 16:23:59 -0400
committerDavid S. Miller <davem@davemloft.net>2014-03-14 22:15:26 -0400
commitb70ab2e87f17176d18f67ef331064441a032b5f3 (patch)
tree634b1482ab909ebe4d62b2a786378ad9584f922a /drivers/net/ieee802154/fakehard.c
parent46ef0eb3ea65e7043aac17cb92982be879c65366 (diff)
ieee802154: enforce consistent endianness in the 802.15.4 stack
Enable sparse warnings about endianness, replace the remaining fields regarding network operations without explicit endianness annotations with such that are annotated, and propagate this through the entire stack. Uses of ieee802154_addr_sa are not changed yet, this patch is only concerned with all other fields (such as address filters, operation parameters and the likes). Signed-off-by: Phoebe Buckheister <phoebe.buckheister@itwm.fraunhofer.de> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ieee802154/fakehard.c')
-rw-r--r--drivers/net/ieee802154/fakehard.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/drivers/net/ieee802154/fakehard.c b/drivers/net/ieee802154/fakehard.c
index 06a400f10565..3c98030e0e0b 100644
--- a/drivers/net/ieee802154/fakehard.c
+++ b/drivers/net/ieee802154/fakehard.c
@@ -63,11 +63,11 @@ static struct wpan_phy *fake_get_phy(const struct net_device *dev)
63 * 63 *
64 * Return the ID of the PAN from the PIB. 64 * Return the ID of the PAN from the PIB.
65 */ 65 */
66static u16 fake_get_pan_id(const struct net_device *dev) 66static __le16 fake_get_pan_id(const struct net_device *dev)
67{ 67{
68 BUG_ON(dev->type != ARPHRD_IEEE802154); 68 BUG_ON(dev->type != ARPHRD_IEEE802154);
69 69
70 return 0xeba1; 70 return cpu_to_le16(0xeba1);
71} 71}
72 72
73/** 73/**
@@ -78,11 +78,11 @@ static u16 fake_get_pan_id(const struct net_device *dev)
78 * device. If the device has not yet had a short address assigned 78 * device. If the device has not yet had a short address assigned
79 * then this should return 0xFFFF to indicate a lack of association. 79 * then this should return 0xFFFF to indicate a lack of association.
80 */ 80 */
81static u16 fake_get_short_addr(const struct net_device *dev) 81static __le16 fake_get_short_addr(const struct net_device *dev)
82{ 82{
83 BUG_ON(dev->type != ARPHRD_IEEE802154); 83 BUG_ON(dev->type != ARPHRD_IEEE802154);
84 84
85 return 0x1; 85 return cpu_to_le16(0x1);
86} 86}
87 87
88/** 88/**
@@ -149,7 +149,7 @@ static int fake_assoc_req(struct net_device *dev,
149 * 802.15.4-2006 document. 149 * 802.15.4-2006 document.
150 */ 150 */
151static int fake_assoc_resp(struct net_device *dev, 151static int fake_assoc_resp(struct net_device *dev,
152 struct ieee802154_addr_sa *addr, u16 short_addr, u8 status) 152 struct ieee802154_addr_sa *addr, __le16 short_addr, u8 status)
153{ 153{
154 return 0; 154 return 0;
155} 155}
@@ -281,8 +281,8 @@ static int ieee802154_fake_ioctl(struct net_device *dev, struct ifreq *ifr,
281 switch (cmd) { 281 switch (cmd) {
282 case SIOCGIFADDR: 282 case SIOCGIFADDR:
283 /* FIXME: fixed here, get from device IRL */ 283 /* FIXME: fixed here, get from device IRL */
284 pan_id = fake_get_pan_id(dev); 284 pan_id = le16_to_cpu(fake_get_pan_id(dev));
285 short_addr = fake_get_short_addr(dev); 285 short_addr = le16_to_cpu(fake_get_short_addr(dev));
286 if (pan_id == IEEE802154_PANID_BROADCAST || 286 if (pan_id == IEEE802154_PANID_BROADCAST ||
287 short_addr == IEEE802154_ADDR_BROADCAST) 287 short_addr == IEEE802154_ADDR_BROADCAST)
288 return -EADDRNOTAVAIL; 288 return -EADDRNOTAVAIL;