Skip to contentSkip to conversation

d80211: endian annotations for ieee80211_frame_info, etc.

PATCH New David Kimdon 1 participant 1 message Nov 12, 2006

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 d80211: endian annotations for ieee80211_frame_info, etc.

Thanks to sparse for pointing out these missing endian annotations.

All the fields in the AVS capture header (struct ieee80211_frame_info) are in network byte order.

The length in the ethernet header is in network byte order.

last_seq_ctrl is stored little endian.

include/net/d80211_common.h +15 -15
Index: wireless-dev/include/net/d80211_common.h
===================================================================
@@ -20,26 +20,26 @@
 #define IEEE80211_FI_VERSION 0x80211001
 
 struct ieee80211_frame_info {
-        u32 version;
-        u32 length;
-        u64 mactime;
-        u64 hosttime;
-        u32 phytype;
-        u32 channel;
-        u32 datarate;
-        u32 antenna;
-        u32 priority;
-        u32 ssi_type;
-        u32 ssi_signal;
-        u32 ssi_noise;
-        u32 preamble;
-        u32 encoding;
+	__be32 version;
+	__be32 length;
+	__be64 mactime;
+	__be64 hosttime;
+	__be32 phytype;
+	__be32 channel;
+	__be32 datarate;
+	__be32 antenna;
+	__be32 priority;
+	__be32 ssi_type;
+	__be32 ssi_signal;
+	__be32 ssi_noise;
+	__be32 preamble;
+	__be32 encoding;
 
 	/* Note: this structure is otherwise identical to capture format used
 	 * in linux-wlan-ng, but this additional field is used to provide meta
 	 * data about the frame to hostapd. This was the easiest method for
 	 * providing this information, but this might change in the future. */
-	u32 msg_type;
+	__be32 msg_type;
 } __attribute__ ((packed));
 
 
net/d80211/ieee80211.c +1 -1
Index: wireless-dev/net/d80211/ieee80211.c
===================================================================
@@ -2427,7 +2427,7 @@
 		memcpy(skb_push(skb, ETH_ALEN), dst, ETH_ALEN);
 	} else {
 		struct ethhdr *ehdr;
-                unsigned short len;
+		__be16 len;
 		skb_pull(skb, hdrlen);
 		len = htons(skb->len);
 		ehdr = (struct ethhdr *) skb_push(skb, sizeof(struct ethhdr));
net/d80211/ieee80211_ioctl.c +1 -1
Index: wireless-dev/net/d80211/ieee80211_ioctl.c
===================================================================
@@ -218,7 +218,7 @@
 struct iapp_layer2_update {
 	u8 da[ETH_ALEN]; /* broadcast */
 	u8 sa[ETH_ALEN]; /* STA addr */
-	u16 len; /* 6 */
+	__be16 len; /* 6 */
 	u8 dsap; /* 0 */
 	u8 ssap; /* 0 */
 	u8 control;
net/d80211/sta_info.h +1 -1
Index: wireless-dev/net/d80211/sta_info.h
===================================================================
@@ -74,7 +74,7 @@
 	void *rate_ctrl_priv;
 
 	/* last received seq/frag number from this STA (per RX queue) */
-	u16 last_seq_ctrl[NUM_RX_DATA_QUEUES];
+	__le16 last_seq_ctrl[NUM_RX_DATA_QUEUES];
 	unsigned long num_duplicates; /* number of duplicate frames received
 				       * from this STA */
 	unsigned long tx_fragments; /* number of transmitted MPDUs */

--