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>
diff --git a/net/mac802154/cfg.c b/net/mac802154/cfg.c
index 7def262..c035708 100644
--- a/net/mac802154/cfg.c
+++ b/net/mac802154/cfg.c
@@ -88,7 +88,7 @@
 
 static int
 ieee802154_set_pan_id(struct wpan_phy *wpan_phy, struct wpan_dev *wpan_dev,
-		      u16 pan_id)
+		      __le16 pan_id)
 {
 	ASSERT_RTNL();
 
@@ -99,10 +99,10 @@
 	 *
 	 * This could useful to simple deassociate an device.
 	 */
-	if (pan_id == IEEE802154_PAN_ID_BROADCAST)
+	if (pan_id == cpu_to_le16(IEEE802154_PAN_ID_BROADCAST))
 		return -EINVAL;
 
-	wpan_dev->pan_id = cpu_to_le16(pan_id);
+	wpan_dev->pan_id = pan_id;
 	return 0;
 }
 
@@ -125,7 +125,7 @@
 
 static int
 ieee802154_set_short_addr(struct wpan_phy *wpan_phy, struct wpan_dev *wpan_dev,
-			  u16 short_addr)
+			  __le16 short_addr)
 {
 	ASSERT_RTNL();
 
@@ -140,11 +140,11 @@
 	 * I think we should allow to set these settings but
 	 * don't allow to allow socket communication with it.
 	 */
-	if (short_addr == IEEE802154_ADDR_SHORT_UNSPEC ||
-	    short_addr == IEEE802154_ADDR_SHORT_BROADCAST)
+	if (short_addr == cpu_to_le16(IEEE802154_ADDR_SHORT_UNSPEC) ||
+	    short_addr == cpu_to_le16(IEEE802154_ADDR_SHORT_BROADCAST))
 		return -EINVAL;
 
-	wpan_dev->short_addr = cpu_to_le16(short_addr);
+	wpan_dev->short_addr = short_addr;
 	return 0;
 }