diff options
Diffstat (limited to 'drivers/net/ieee802154/fakehard.c')
-rw-r--r-- | drivers/net/ieee802154/fakehard.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/drivers/net/ieee802154/fakehard.c b/drivers/net/ieee802154/fakehard.c index bf0d55e2dd6..78f18be3bbf 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) * * Return the ID of the PAN from the PIB. */ -static u16 fake_get_pan_id(const struct net_device *dev) +static __le16 fake_get_pan_id(const struct net_device *dev) { BUG_ON(dev->type != ARPHRD_IEEE802154); - return 0xeba1; + return cpu_to_le16(0xeba1); } /** @@ -78,11 +78,11 @@ static u16 fake_get_pan_id(const struct net_device *dev) * device. If the device has not yet had a short address assigned * then this should return 0xFFFF to indicate a lack of association. */ -static u16 fake_get_short_addr(const struct net_device *dev) +static __le16 fake_get_short_addr(const struct net_device *dev) { BUG_ON(dev->type != ARPHRD_IEEE802154); - return 0x1; + return cpu_to_le16(0x1); } /** @@ -149,7 +149,7 @@ static int fake_assoc_req(struct net_device *dev, * 802.15.4-2006 document. */ static int fake_assoc_resp(struct net_device *dev, - struct ieee802154_addr *addr, u16 short_addr, u8 status) + struct ieee802154_addr *addr, __le16 short_addr, u8 status) { return 0; } @@ -191,10 +191,10 @@ static int fake_disassoc_req(struct net_device *dev, * Note: This is in section 7.5.2.3 of the IEEE 802.15.4-2006 * document, with 7.3.8 describing coordinator realignment. */ -static int fake_start_req(struct net_device *dev, struct ieee802154_addr *addr, - u8 channel, u8 page, - u8 bcn_ord, u8 sf_ord, u8 pan_coord, u8 blx, - u8 coord_realign) +static int fake_start_req(struct net_device *dev, + struct ieee802154_addr *addr, u8 channel, u8 page, + u8 bcn_ord, u8 sf_ord, u8 pan_coord, u8 blx, + u8 coord_realign) { struct wpan_phy *phy = fake_to_phy(dev); @@ -281,8 +281,8 @@ static int ieee802154_fake_ioctl(struct net_device *dev, struct ifreq *ifr, switch (cmd) { case SIOCGIFADDR: /* FIXME: fixed here, get from device IRL */ - pan_id = fake_get_pan_id(dev); - short_addr = fake_get_short_addr(dev); + pan_id = le16_to_cpu(fake_get_pan_id(dev)); + short_addr = le16_to_cpu(fake_get_short_addr(dev)); if (pan_id == IEEE802154_PANID_BROADCAST || short_addr == IEEE802154_ADDR_BROADCAST) return -EADDRNOTAVAIL; |