aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/libertas/types.h
diff options
context:
space:
mode:
authorDavid Woodhouse <dwmw2@infradead.org>2007-05-25 23:36:54 -0400
committerJohn W. Linville <linville@tuxdriver.com>2007-06-11 14:28:45 -0400
commit981f187b7c4b237011d4175cae0120d5d203c0fd (patch)
treeb4508fc33a9aed0177c18c3a4db5c4e500fdb646 /drivers/net/wireless/libertas/types.h
parent123e0e044091ca35a4766b38ae15032f2d41bcd6 (diff)
[PATCH] libertas: first pass at fixing up endianness issues
Signed-off-by: David Woodhouse <dwmw2@infradead.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/libertas/types.h')
-rw-r--r--drivers/net/wireless/libertas/types.h63
1 files changed, 46 insertions, 17 deletions
diff --git a/drivers/net/wireless/libertas/types.h b/drivers/net/wireless/libertas/types.h
index 09d62f8b1a1..028e2f3b53d 100644
--- a/drivers/net/wireless/libertas/types.h
+++ b/drivers/net/wireless/libertas/types.h
@@ -5,6 +5,7 @@
5#define _WLAN_TYPES_ 5#define _WLAN_TYPES_
6 6
7#include <linux/if_ether.h> 7#include <linux/if_ether.h>
8#include <asm/byteorder.h>
8 9
9/** IEEE type definitions */ 10/** IEEE type definitions */
10enum ieeetypes_elementid { 11enum ieeetypes_elementid {
@@ -29,9 +30,30 @@ enum ieeetypes_elementid {
29 EXTRA_IE = 133, 30 EXTRA_IE = 133,
30} __attribute__ ((packed)); 31} __attribute__ ((packed));
31 32
33#ifdef __BIG_ENDIAN
32#define CAPINFO_MASK (~(0xda00)) 34#define CAPINFO_MASK (~(0xda00))
35#else
36#define CAPINFO_MASK (~(0x00da))
37#endif
33 38
34struct ieeetypes_capinfo { 39struct ieeetypes_capinfo {
40#ifdef __BIG_ENDIAN_BITFIELD
41 u8 chanagility:1;
42 u8 pbcc:1;
43 u8 shortpreamble:1;
44 u8 privacy:1;
45 u8 cfpollrqst:1;
46 u8 cfpollable:1;
47 u8 ibss:1;
48 u8 ess:1;
49 u8 rsrvd1:2;
50 u8 dsssofdm:1;
51 u8 rsvrd2:1;
52 u8 apsd:1;
53 u8 shortslottime:1;
54 u8 rsrvd3:1;
55 u8 spectrummgmt:1;
56#else
35 u8 ess:1; 57 u8 ess:1;
36 u8 ibss:1; 58 u8 ibss:1;
37 u8 cfpollable:1; 59 u8 cfpollable:1;
@@ -47,6 +69,7 @@ struct ieeetypes_capinfo {
47 u8 rsvrd2:1; 69 u8 rsvrd2:1;
48 u8 dsssofdm:1; 70 u8 dsssofdm:1;
49 u8 rsrvd1:2; 71 u8 rsrvd1:2;
72#endif
50} __attribute__ ((packed)); 73} __attribute__ ((packed));
51 74
52struct ieeetypes_cfparamset { 75struct ieeetypes_cfparamset {
@@ -54,15 +77,15 @@ struct ieeetypes_cfparamset {
54 u8 len; 77 u8 len;
55 u8 cfpcnt; 78 u8 cfpcnt;
56 u8 cfpperiod; 79 u8 cfpperiod;
57 u16 cfpmaxduration; 80 __le16 cfpmaxduration;
58 u16 cfpdurationremaining; 81 __le16 cfpdurationremaining;
59} __attribute__ ((packed)); 82} __attribute__ ((packed));
60 83
61 84
62struct ieeetypes_ibssparamset { 85struct ieeetypes_ibssparamset {
63 u8 elementid; 86 u8 elementid;
64 u8 len; 87 u8 len;
65 u16 atimwindow; 88 __le16 atimwindow;
66} __attribute__ ((packed)); 89} __attribute__ ((packed));
67 90
68union IEEEtypes_ssparamset { 91union IEEEtypes_ssparamset {
@@ -73,7 +96,7 @@ union IEEEtypes_ssparamset {
73struct ieeetypes_fhparamset { 96struct ieeetypes_fhparamset {
74 u8 elementid; 97 u8 elementid;
75 u8 len; 98 u8 len;
76 u16 dwelltime; 99 __le16 dwelltime;
77 u8 hopset; 100 u8 hopset;
78 u8 hoppattern; 101 u8 hoppattern;
79 u8 hopindex; 102 u8 hopindex;
@@ -92,8 +115,8 @@ union ieeetypes_phyparamset {
92 115
93struct ieeetypes_assocrsp { 116struct ieeetypes_assocrsp {
94 struct ieeetypes_capinfo capability; 117 struct ieeetypes_capinfo capability;
95 u16 statuscode; 118 __le16 statuscode;
96 u16 aid; 119 __le16 aid;
97 u8 iebuffer[1]; 120 u8 iebuffer[1];
98} __attribute__ ((packed)); 121} __attribute__ ((packed));
99 122
@@ -138,8 +161,8 @@ struct ieeetypes_assocrsp {
138 161
139/** TLV related data structures*/ 162/** TLV related data structures*/
140struct mrvlietypesheader { 163struct mrvlietypesheader {
141 u16 type; 164 __le16 type;
142 u16 len; 165 __le16 len;
143} __attribute__ ((packed)); 166} __attribute__ ((packed));
144 167
145struct mrvlietypes_data { 168struct mrvlietypes_data {
@@ -164,17 +187,23 @@ struct mrvlietypes_wildcardssidparamset {
164} __attribute__ ((packed)); 187} __attribute__ ((packed));
165 188
166struct chanscanmode { 189struct chanscanmode {
190#ifdef __BIG_ENDIAN_BITFIELD
191 u8 reserved_2_7:6;
192 u8 disablechanfilt:1;
193 u8 passivescan:1;
194#else
167 u8 passivescan:1; 195 u8 passivescan:1;
168 u8 disablechanfilt:1; 196 u8 disablechanfilt:1;
169 u8 reserved_2_7:6; 197 u8 reserved_2_7:6;
198#endif
170} __attribute__ ((packed)); 199} __attribute__ ((packed));
171 200
172struct chanscanparamset { 201struct chanscanparamset {
173 u8 radiotype; 202 u8 radiotype;
174 u8 channumber; 203 u8 channumber;
175 struct chanscanmode chanscanmode; 204 struct chanscanmode chanscanmode;
176 u16 minscantime; 205 __le16 minscantime;
177 u16 maxscantime; 206 __le16 maxscantime;
178} __attribute__ ((packed)); 207} __attribute__ ((packed));
179 208
180struct mrvlietypes_chanlistparamset { 209struct mrvlietypes_chanlistparamset {
@@ -185,12 +214,12 @@ struct mrvlietypes_chanlistparamset {
185struct cfparamset { 214struct cfparamset {
186 u8 cfpcnt; 215 u8 cfpcnt;
187 u8 cfpperiod; 216 u8 cfpperiod;
188 u16 cfpmaxduration; 217 __le16 cfpmaxduration;
189 u16 cfpdurationremaining; 218 __le16 cfpdurationremaining;
190} __attribute__ ((packed)); 219} __attribute__ ((packed));
191 220
192struct ibssparamset { 221struct ibssparamset {
193 u16 atimwindow; 222 __le16 atimwindow;
194} __attribute__ ((packed)); 223} __attribute__ ((packed));
195 224
196struct mrvlietypes_ssparamset { 225struct mrvlietypes_ssparamset {
@@ -202,7 +231,7 @@ struct mrvlietypes_ssparamset {
202} __attribute__ ((packed)); 231} __attribute__ ((packed));
203 232
204struct fhparamset { 233struct fhparamset {
205 u16 dwelltime; 234 __le16 dwelltime;
206 u8 hopset; 235 u8 hopset;
207 u8 hoppattern; 236 u8 hoppattern;
208 u8 hopindex; 237 u8 hopindex;
@@ -263,17 +292,17 @@ struct mrvlietypes_beaconsmissed {
263 292
264struct mrvlietypes_numprobes { 293struct mrvlietypes_numprobes {
265 struct mrvlietypesheader header; 294 struct mrvlietypesheader header;
266 u16 numprobes; 295 __le16 numprobes;
267} __attribute__ ((packed)); 296} __attribute__ ((packed));
268 297
269struct mrvlietypes_bcastprobe { 298struct mrvlietypes_bcastprobe {
270 struct mrvlietypesheader header; 299 struct mrvlietypesheader header;
271 u16 bcastprobe; 300 __le16 bcastprobe;
272} __attribute__ ((packed)); 301} __attribute__ ((packed));
273 302
274struct mrvlietypes_numssidprobe { 303struct mrvlietypes_numssidprobe {
275 struct mrvlietypesheader header; 304 struct mrvlietypesheader header;
276 u16 numssidprobe; 305 __le16 numssidprobe;
277} __attribute__ ((packed)); 306} __attribute__ ((packed));
278 307
279struct led_pin { 308struct led_pin {