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>
diff --git a/net/ieee802154/af_ieee802154.c b/net/ieee802154/af_ieee802154.c
index a8db341..973cb11 100644
--- a/net/ieee802154/af_ieee802154.c
+++ b/net/ieee802154/af_ieee802154.c
@@ -48,7 +48,7 @@
 {
 	struct net_device *dev = NULL;
 	struct net_device *tmp;
-	u16 pan_id, short_addr;
+	__le16 pan_id, short_addr;
 
 	switch (addr->addr_type) {
 	case IEEE802154_ADDR_LONG:
@@ -59,9 +59,9 @@
 		rcu_read_unlock();
 		break;
 	case IEEE802154_ADDR_SHORT:
-		if (addr->pan_id == 0xffff ||
+		if (addr->pan_id == IEEE802154_PANID_BROADCAST ||
 		    addr->short_addr == IEEE802154_ADDR_UNDEF ||
-		    addr->short_addr == 0xffff)
+		    addr->short_addr == IEEE802154_ADDR_UNDEF)
 			break;
 
 		rtnl_lock();
@@ -74,8 +74,8 @@
 			short_addr =
 				ieee802154_mlme_ops(tmp)->get_short_addr(tmp);
 
-			if (pan_id == addr->pan_id &&
-			    short_addr == addr->short_addr) {
+			if (le16_to_cpu(pan_id) == addr->pan_id &&
+			    le16_to_cpu(short_addr) == addr->short_addr) {
 				dev = tmp;
 				dev_hold(dev);
 				break;