Browse Source

[prism2] Use standard type names

Avoid using UINT16 and similar typedefs, which are non-standard in the
iPXE codebase and generate conflicts when trying to include any of the
EFI headers.

Also fix trailing whitespace in the affected files, to prevent
complaints from git.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Michael Brown 11 years ago
parent
commit
8a49782eeb
4 changed files with 1361 additions and 1383 deletions
  1. 1203
    1203
      src/drivers/net/hfa384x.h
  2. 51
    51
      src/drivers/net/p80211hdr.h
  3. 95
    95
      src/drivers/net/prism2.c
  4. 12
    34
      src/drivers/net/wlan_compat.h

+ 1203
- 1203
src/drivers/net/hfa384x.h
File diff suppressed because it is too large
View File


+ 51
- 51
src/drivers/net/p80211hdr.h View File

39
 *
39
 *
40
 * --------------------------------------------------------------------
40
 * --------------------------------------------------------------------
41
 *
41
 *
42
-* Portions of the development of this software were funded by 
42
+* Portions of the development of this software were funded by
43
 * Intersil Corporation as part of PRISM(R) chipset product development.
43
 * Intersil Corporation as part of PRISM(R) chipset product development.
44
 *
44
 *
45
 * --------------------------------------------------------------------
45
 * --------------------------------------------------------------------
47
 * This file declares the constants and types used in the interface
47
 * This file declares the constants and types used in the interface
48
 * between a wlan driver and the user mode utilities.
48
 * between a wlan driver and the user mode utilities.
49
 *
49
 *
50
-* Note: 
50
+* Note:
51
 *  - Constant values are always in HOST byte order.  To assign
51
 *  - Constant values are always in HOST byte order.  To assign
52
 *    values to multi-byte fields they _must_ be converted to
52
 *    values to multi-byte fields they _must_ be converted to
53
 *    ieee byte order.  To retrieve multi-byte values from incoming
53
 *    ieee byte order.  To retrieve multi-byte values from incoming
117
 #define WLAN_FSTYPE_ASSOCRESP		0x01
117
 #define WLAN_FSTYPE_ASSOCRESP		0x01
118
 #define WLAN_FSTYPE_REASSOCREQ		0x02
118
 #define WLAN_FSTYPE_REASSOCREQ		0x02
119
 #define WLAN_FSTYPE_REASSOCRESP		0x03
119
 #define WLAN_FSTYPE_REASSOCRESP		0x03
120
-#define WLAN_FSTYPE_PROBEREQ		0x04 
120
+#define WLAN_FSTYPE_PROBEREQ		0x04
121
 #define WLAN_FSTYPE_PROBERESP		0x05
121
 #define WLAN_FSTYPE_PROBERESP		0x05
122
 #define WLAN_FSTYPE_BEACON		0x08
122
 #define WLAN_FSTYPE_BEACON		0x08
123
 #define WLAN_FSTYPE_ATIM		0x09
123
 #define WLAN_FSTYPE_ATIM		0x09
168
 /*                        SET_FC_FSTYPE(WLAN_FSTYPE_RTS) );   */
168
 /*                        SET_FC_FSTYPE(WLAN_FSTYPE_RTS) );   */
169
 /*------------------------------------------------------------*/
169
 /*------------------------------------------------------------*/
170
 
170
 
171
-#define WLAN_GET_FC_PVER(n)	 (((UINT16)(n)) & (BIT0 | BIT1))
172
-#define WLAN_GET_FC_FTYPE(n)	((((UINT16)(n)) & (BIT2 | BIT3)) >> 2)
173
-#define WLAN_GET_FC_FSTYPE(n)	((((UINT16)(n)) & (BIT4|BIT5|BIT6|BIT7)) >> 4)
174
-#define WLAN_GET_FC_TODS(n) 	((((UINT16)(n)) & (BIT8)) >> 8)
175
-#define WLAN_GET_FC_FROMDS(n)	((((UINT16)(n)) & (BIT9)) >> 9)
176
-#define WLAN_GET_FC_MOREFRAG(n) ((((UINT16)(n)) & (BIT10)) >> 10)
177
-#define WLAN_GET_FC_RETRY(n)	((((UINT16)(n)) & (BIT11)) >> 11)
178
-#define WLAN_GET_FC_PWRMGT(n)	((((UINT16)(n)) & (BIT12)) >> 12)
179
-#define WLAN_GET_FC_MOREDATA(n) ((((UINT16)(n)) & (BIT13)) >> 13)
180
-#define WLAN_GET_FC_ISWEP(n)	((((UINT16)(n)) & (BIT14)) >> 14)
181
-#define WLAN_GET_FC_ORDER(n)	((((UINT16)(n)) & (BIT15)) >> 15)
182
-
183
-#define WLAN_SET_FC_PVER(n)	((UINT16)(n))
184
-#define WLAN_SET_FC_FTYPE(n)	(((UINT16)(n)) << 2)
185
-#define WLAN_SET_FC_FSTYPE(n)	(((UINT16)(n)) << 4)
186
-#define WLAN_SET_FC_TODS(n) 	(((UINT16)(n)) << 8)
187
-#define WLAN_SET_FC_FROMDS(n)	(((UINT16)(n)) << 9)
188
-#define WLAN_SET_FC_MOREFRAG(n) (((UINT16)(n)) << 10)
189
-#define WLAN_SET_FC_RETRY(n)	(((UINT16)(n)) << 11)
190
-#define WLAN_SET_FC_PWRMGT(n)	(((UINT16)(n)) << 12)
191
-#define WLAN_SET_FC_MOREDATA(n) (((UINT16)(n)) << 13)
192
-#define WLAN_SET_FC_ISWEP(n)	(((UINT16)(n)) << 14)
193
-#define WLAN_SET_FC_ORDER(n)	(((UINT16)(n)) << 15)
171
+#define WLAN_GET_FC_PVER(n)	 (((uint16_t)(n)) & (BIT0 | BIT1))
172
+#define WLAN_GET_FC_FTYPE(n)	((((uint16_t)(n)) & (BIT2 | BIT3)) >> 2)
173
+#define WLAN_GET_FC_FSTYPE(n)	((((uint16_t)(n)) & (BIT4|BIT5|BIT6|BIT7)) >> 4)
174
+#define WLAN_GET_FC_TODS(n) 	((((uint16_t)(n)) & (BIT8)) >> 8)
175
+#define WLAN_GET_FC_FROMDS(n)	((((uint16_t)(n)) & (BIT9)) >> 9)
176
+#define WLAN_GET_FC_MOREFRAG(n) ((((uint16_t)(n)) & (BIT10)) >> 10)
177
+#define WLAN_GET_FC_RETRY(n)	((((uint16_t)(n)) & (BIT11)) >> 11)
178
+#define WLAN_GET_FC_PWRMGT(n)	((((uint16_t)(n)) & (BIT12)) >> 12)
179
+#define WLAN_GET_FC_MOREDATA(n) ((((uint16_t)(n)) & (BIT13)) >> 13)
180
+#define WLAN_GET_FC_ISWEP(n)	((((uint16_t)(n)) & (BIT14)) >> 14)
181
+#define WLAN_GET_FC_ORDER(n)	((((uint16_t)(n)) & (BIT15)) >> 15)
182
+
183
+#define WLAN_SET_FC_PVER(n)	((uint16_t)(n))
184
+#define WLAN_SET_FC_FTYPE(n)	(((uint16_t)(n)) << 2)
185
+#define WLAN_SET_FC_FSTYPE(n)	(((uint16_t)(n)) << 4)
186
+#define WLAN_SET_FC_TODS(n) 	(((uint16_t)(n)) << 8)
187
+#define WLAN_SET_FC_FROMDS(n)	(((uint16_t)(n)) << 9)
188
+#define WLAN_SET_FC_MOREFRAG(n) (((uint16_t)(n)) << 10)
189
+#define WLAN_SET_FC_RETRY(n)	(((uint16_t)(n)) << 11)
190
+#define WLAN_SET_FC_PWRMGT(n)	(((uint16_t)(n)) << 12)
191
+#define WLAN_SET_FC_MOREDATA(n) (((uint16_t)(n)) << 13)
192
+#define WLAN_SET_FC_ISWEP(n)	(((uint16_t)(n)) << 14)
193
+#define WLAN_SET_FC_ORDER(n)	(((uint16_t)(n)) << 15)
194
 
194
 
195
 /*--- Duration Macros ----------------------------------------*/
195
 /*--- Duration Macros ----------------------------------------*/
196
 /* Macros to get/set the bitfields of the Duration Field      */
196
 /* Macros to get/set the bitfields of the Duration Field      */
203
 /* Macros to get/set the bitfields of the Sequence Control    */
203
 /* Macros to get/set the bitfields of the Sequence Control    */
204
 /* Field.                                                     */
204
 /* Field.                                                     */
205
 /*------------------------------------------------------------*/
205
 /*------------------------------------------------------------*/
206
-#define WLAN_GET_SEQ_FRGNUM(n) (((UINT16)(n)) & (BIT0|BIT1|BIT2|BIT3))
207
-#define WLAN_GET_SEQ_SEQNUM(n) ((((UINT16)(n)) & (~(BIT0|BIT1|BIT2|BIT3))) >> 4) 
206
+#define WLAN_GET_SEQ_FRGNUM(n) (((uint16_t)(n)) & (BIT0|BIT1|BIT2|BIT3))
207
+#define WLAN_GET_SEQ_SEQNUM(n) ((((uint16_t)(n)) & (~(BIT0|BIT1|BIT2|BIT3))) >> 4)
208
 
208
 
209
 /*--- Data ptr macro -----------------------------------------*/
209
 /*--- Data ptr macro -----------------------------------------*/
210
-/* Creates a UINT8* to the data portion of a frame            */
210
+/* Creates a uint8_t* to the data portion of a frame            */
211
 /* Assumes you're passing in a ptr to the beginning of the hdr*/
211
 /* Assumes you're passing in a ptr to the beginning of the hdr*/
212
 /*------------------------------------------------------------*/
212
 /*------------------------------------------------------------*/
213
-#define WLAN_HDR_A3_DATAP(p) (((UINT8*)(p)) + WLAN_HDR_A3_LEN)
214
-#define WLAN_HDR_A4_DATAP(p) (((UINT8*)(p)) + WLAN_HDR_A4_LEN)
213
+#define WLAN_HDR_A3_DATAP(p) (((uint8_t*)(p)) + WLAN_HDR_A3_LEN)
214
+#define WLAN_HDR_A4_DATAP(p) (((uint8_t*)(p)) + WLAN_HDR_A4_LEN)
215
 
215
 
216
-#define DOT11_RATE5_ISBASIC_GET(r)     (((UINT8)(r)) & BIT7)
216
+#define DOT11_RATE5_ISBASIC_GET(r)     (((uint8_t)(r)) & BIT7)
217
 
217
 
218
 /*================================================================*/
218
 /*================================================================*/
219
 /* Types */
219
 /* Types */
220
 
220
 
221
 /* BSS Timestamp */
221
 /* BSS Timestamp */
222
-typedef UINT8 wlan_bss_ts_t[WLAN_BSS_TS_LEN];
222
+typedef uint8_t wlan_bss_ts_t[WLAN_BSS_TS_LEN];
223
 
223
 
224
 /* Generic 802.11 Header types */
224
 /* Generic 802.11 Header types */
225
 
225
 
226
 typedef struct p80211_hdr_a3
226
 typedef struct p80211_hdr_a3
227
 {
227
 {
228
-	UINT16	fc;
229
-	UINT16	dur;
230
-	UINT8	a1[WLAN_ADDR_LEN];
231
-	UINT8	a2[WLAN_ADDR_LEN];
232
-	UINT8	a3[WLAN_ADDR_LEN];
233
-	UINT16	seq;
228
+	uint16_t	fc;
229
+	uint16_t	dur;
230
+	uint8_t	a1[WLAN_ADDR_LEN];
231
+	uint8_t	a2[WLAN_ADDR_LEN];
232
+	uint8_t	a3[WLAN_ADDR_LEN];
233
+	uint16_t	seq;
234
 } __WLAN_ATTRIB_PACK__ p80211_hdr_a3_t;
234
 } __WLAN_ATTRIB_PACK__ p80211_hdr_a3_t;
235
 
235
 
236
 typedef struct p80211_hdr_a4
236
 typedef struct p80211_hdr_a4
237
 {
237
 {
238
-	UINT16	fc;
239
-	UINT16	dur;
240
-	UINT8	a1[WLAN_ADDR_LEN];
241
-	UINT8	a2[WLAN_ADDR_LEN];
242
-	UINT8	a3[WLAN_ADDR_LEN];
243
-	UINT16	seq;
244
-	UINT8	a4[WLAN_ADDR_LEN];
238
+	uint16_t	fc;
239
+	uint16_t	dur;
240
+	uint8_t	a1[WLAN_ADDR_LEN];
241
+	uint8_t	a2[WLAN_ADDR_LEN];
242
+	uint8_t	a3[WLAN_ADDR_LEN];
243
+	uint16_t	seq;
244
+	uint8_t	a4[WLAN_ADDR_LEN];
245
 } __WLAN_ATTRIB_PACK__ p80211_hdr_a4_t;
245
 } __WLAN_ATTRIB_PACK__ p80211_hdr_a4_t;
246
 
246
 
247
 typedef union p80211_hdr
247
 typedef union p80211_hdr
273
 #define WLAN_FCS_LEN			4
273
 #define WLAN_FCS_LEN			4
274
 
274
 
275
 /* ftcl in HOST order */
275
 /* ftcl in HOST order */
276
-inline static UINT16 p80211_headerlen(UINT16 fctl)
276
+inline static uint16_t p80211_headerlen(uint16_t fctl)
277
 {
277
 {
278
-	UINT16 hdrlen = 0;
278
+	uint16_t hdrlen = 0;
279
 
279
 
280
 	switch ( WLAN_GET_FC_FTYPE(fctl) ) {
280
 	switch ( WLAN_GET_FC_FTYPE(fctl) ) {
281
 	case WLAN_FTYPE_MGMT:
281
 	case WLAN_FTYPE_MGMT:
288
 		}
288
 		}
289
 		break;
289
 		break;
290
 	case WLAN_FTYPE_CTL:
290
 	case WLAN_FTYPE_CTL:
291
-		hdrlen = WLAN_CTL_FRAMELEN(WLAN_GET_FC_FSTYPE(fctl)) - 
292
-			WLAN_FCS_LEN; 
291
+		hdrlen = WLAN_CTL_FRAMELEN(WLAN_GET_FC_FSTYPE(fctl)) -
292
+			WLAN_FCS_LEN;
293
 		break;
293
 		break;
294
 	default:
294
 	default:
295
 		hdrlen = WLAN_HDR_A3_LEN;
295
 		hdrlen = WLAN_HDR_A3_LEN;
296
 	}
296
 	}
297
-	
297
+
298
 	return hdrlen;
298
 	return hdrlen;
299
 }
299
 }
300
 
300
 

+ 95
- 95
src/drivers/net/prism2.c View File

69
 #define __cpu_to_le16(x) (x)
69
 #define __cpu_to_le16(x) (x)
70
 #define __cpu_to_le32(x) (x)
70
 #define __cpu_to_le32(x) (x)
71
 
71
 
72
-#define hfa384x2host_16(n)	(__le16_to_cpu((UINT16)(n)))
73
-#define hfa384x2host_32(n)	(__le32_to_cpu((UINT32)(n)))
74
-#define host2hfa384x_16(n)	(__cpu_to_le16((UINT16)(n)))
75
-#define host2hfa384x_32(n)	(__cpu_to_le32((UINT32)(n)))
72
+#define hfa384x2host_16(n)	(__le16_to_cpu((uint16_t)(n)))
73
+#define hfa384x2host_32(n)	(__le32_to_cpu((uint32_t)(n)))
74
+#define host2hfa384x_16(n)	(__cpu_to_le16((uint16_t)(n)))
75
+#define host2hfa384x_32(n)	(__cpu_to_le32((uint32_t)(n)))
76
 
76
 
77
 /*
77
 /*
78
  * PLX9052 PCI register offsets
78
  * PLX9052 PCI register offsets
119
 
119
 
120
 typedef struct hfa384x
120
 typedef struct hfa384x
121
 {
121
 {
122
-  UINT32 iobase;
122
+  uint32_t iobase;
123
   void *membase;
123
   void *membase;
124
-  UINT16 lastcmd;
125
-  UINT16 status;         /* in host order */
126
-  UINT16 resp0;          /* in host order */
127
-  UINT16 resp1;          /* in host order */
128
-  UINT16 resp2;          /* in host order */
129
-  UINT8  bssid[WLAN_BSSID_LEN];
124
+  uint16_t lastcmd;
125
+  uint16_t status;         /* in host order */
126
+  uint16_t resp0;          /* in host order */
127
+  uint16_t resp1;          /* in host order */
128
+  uint16_t resp2;          /* in host order */
129
+  uint8_t  bssid[WLAN_BSSID_LEN];
130
 } hfa384x_t;
130
 } hfa384x_t;
131
 
131
 
132
 /* The global instance of the hardware (i.e. where we store iobase and membase, in the absence of anywhere better to put them */
132
 /* The global instance of the hardware (i.e. where we store iobase and membase, in the absence of anywhere better to put them */
141
 
141
 
142
 typedef struct wlan_llc
142
 typedef struct wlan_llc
143
 {
143
 {
144
-  UINT8   dsap;
145
-  UINT8   ssap;
146
-  UINT8   ctl;
144
+  uint8_t   dsap;
145
+  uint8_t   ssap;
146
+  uint8_t   ctl;
147
 }  wlan_llc_t;
147
 }  wlan_llc_t;
148
 
148
 
149
 static const wlan_llc_t wlan_llc_snap = { 0xaa, 0xaa, 0x03 }; /* LLC header indicating SNAP (?) */
149
 static const wlan_llc_t wlan_llc_snap = { 0xaa, 0xaa, 0x03 }; /* LLC header indicating SNAP (?) */
151
 #define WLAN_IEEE_OUI_LEN 3
151
 #define WLAN_IEEE_OUI_LEN 3
152
 typedef struct wlan_snap
152
 typedef struct wlan_snap
153
 {
153
 {
154
-  UINT8   oui[WLAN_IEEE_OUI_LEN];
155
-  UINT16  type;
154
+  uint8_t   oui[WLAN_IEEE_OUI_LEN];
155
+  uint16_t  type;
156
 } wlan_snap_t;
156
 } wlan_snap_t;
157
 
157
 
158
 typedef struct wlan_80211hdr
158
 typedef struct wlan_80211hdr
168
 /*
168
 /*
169
  * Hardware-level hfa384x functions
169
  * Hardware-level hfa384x functions
170
  * These are based on the ones in hfa384x.h (which are ifdef'd out since __KERNEL__ is not defined).
170
  * These are based on the ones in hfa384x.h (which are ifdef'd out since __KERNEL__ is not defined).
171
- * Basically, these functions are the result of hand-evaluating all the ifdefs and defines in the hfa384x.h versions. 
171
+ * Basically, these functions are the result of hand-evaluating all the ifdefs and defines in the hfa384x.h versions.
172
  */
172
  */
173
 
173
 
174
 /* Retrieve the value of one of the MAC registers. */
174
 /* Retrieve the value of one of the MAC registers. */
175
-static inline UINT16 hfa384x_getreg( hfa384x_t *hw, UINT reg )
175
+static inline uint16_t hfa384x_getreg( hfa384x_t *hw, unsigned int reg )
176
 {
176
 {
177
 #if (WLAN_HOSTIF == WLAN_PLX)
177
 #if (WLAN_HOSTIF == WLAN_PLX)
178
   return inw ( hw->iobase + reg );
178
   return inw ( hw->iobase + reg );
182
 }
182
 }
183
 
183
 
184
 /* Set the value of one of the MAC registers. */
184
 /* Set the value of one of the MAC registers. */
185
-static inline void hfa384x_setreg( hfa384x_t *hw, UINT16 val, UINT reg )
185
+static inline void hfa384x_setreg( hfa384x_t *hw, uint16_t val, unsigned int reg )
186
 {
186
 {
187
 #if (WLAN_HOSTIF == WLAN_PLX)
187
 #if (WLAN_HOSTIF == WLAN_PLX)
188
   outw ( val, hw->iobase + reg );
188
   outw ( val, hw->iobase + reg );
192
   return;
192
   return;
193
 }
193
 }
194
 
194
 
195
-/* 
195
+/*
196
  * Noswap versions
196
  * Noswap versions
197
  * Etherboot is i386 only, so swap and noswap are the same...
197
  * Etherboot is i386 only, so swap and noswap are the same...
198
  */
198
  */
199
-static inline UINT16 hfa384x_getreg_noswap( hfa384x_t *hw, UINT reg )
199
+static inline uint16_t hfa384x_getreg_noswap( hfa384x_t *hw, unsigned int reg )
200
 {
200
 {
201
   return hfa384x_getreg ( hw, reg );
201
   return hfa384x_getreg ( hw, reg );
202
 }
202
 }
203
-static inline void hfa384x_setreg_noswap( hfa384x_t *hw, UINT16 val, UINT reg )
203
+static inline void hfa384x_setreg_noswap( hfa384x_t *hw, uint16_t val, unsigned int reg )
204
 {
204
 {
205
   hfa384x_setreg ( hw, val, reg );
205
   hfa384x_setreg ( hw, val, reg );
206
 }
206
 }
227
  *       >0              command indicated error, Status and Resp0-2 are
227
  *       >0              command indicated error, Status and Resp0-2 are
228
  *                       in hw structure.
228
  *                       in hw structure.
229
  */
229
  */
230
-static int hfa384x_docmd_wait( hfa384x_t *hw, UINT16 cmd, UINT16 parm0, UINT16 parm1, UINT16 parm2)
230
+static int hfa384x_docmd_wait( hfa384x_t *hw, uint16_t cmd, uint16_t parm0, uint16_t parm1, uint16_t parm2)
231
 {
231
 {
232
-  UINT16 reg = 0;
233
-  UINT16 counter = 0;
234
-  
235
-  /* wait for the busy bit to clear */	
232
+  uint16_t reg = 0;
233
+  uint16_t counter = 0;
234
+
235
+  /* wait for the busy bit to clear */
236
   counter = 0;
236
   counter = 0;
237
   reg = hfa384x_getreg(hw, HFA384x_CMD);
237
   reg = hfa384x_getreg(hw, HFA384x_CMD);
238
   while ( HFA384x_CMD_ISBUSY(reg) && (counter < 10) ) {
238
   while ( HFA384x_CMD_ISBUSY(reg) && (counter < 10) ) {
251
   hfa384x_setreg(hw, parm2, HFA384x_PARAM2);
251
   hfa384x_setreg(hw, parm2, HFA384x_PARAM2);
252
   hw->lastcmd = cmd;
252
   hw->lastcmd = cmd;
253
   hfa384x_setreg(hw, cmd, HFA384x_CMD);
253
   hfa384x_setreg(hw, cmd, HFA384x_CMD);
254
-  
254
+
255
   /* Now wait for completion */
255
   /* Now wait for completion */
256
   counter = 0;
256
   counter = 0;
257
   reg = hfa384x_getreg(hw, HFA384x_EVSTAT);
257
   reg = hfa384x_getreg(hw, HFA384x_EVSTAT);
286
  *	hw		device structure
286
  *	hw		device structure
287
  *	id		FID or RID, destined for the select register (host order)
287
  *	id		FID or RID, destined for the select register (host order)
288
  *	offset		An _even_ offset into the buffer for the given FID/RID.
288
  *	offset		An _even_ offset into the buffer for the given FID/RID.
289
- * Returns: 
289
+ * Returns:
290
  *	0		success
290
  *	0		success
291
  */
291
  */
292
-static int hfa384x_prepare_bap(hfa384x_t *hw, UINT16 id, UINT16 offset)
292
+static int hfa384x_prepare_bap(hfa384x_t *hw, uint16_t id, uint16_t offset)
293
 {
293
 {
294
   int result = 0;
294
   int result = 0;
295
-  UINT16 reg;
296
-  UINT16 i;
295
+  uint16_t reg;
296
+  uint16_t i;
297
 
297
 
298
   /* Validate offset, buf, and len */
298
   /* Validate offset, buf, and len */
299
   if ( (offset > HFA384x_BAP_OFFSET_MAX) || (offset % 2) ) {
299
   if ( (offset > HFA384x_BAP_OFFSET_MAX) || (offset % 2) ) {
304
     udelay(10);
304
     udelay(10);
305
     hfa384x_setreg(hw, offset, HFA384x_OFFSET0);
305
     hfa384x_setreg(hw, offset, HFA384x_OFFSET0);
306
     /* Wait for offset[busy] to clear (see BAP_TIMEOUT) */
306
     /* Wait for offset[busy] to clear (see BAP_TIMEOUT) */
307
-    i = 0; 
307
+    i = 0;
308
     do {
308
     do {
309
       reg = hfa384x_getreg(hw, HFA384x_OFFSET0);
309
       reg = hfa384x_getreg(hw, HFA384x_OFFSET0);
310
       if ( i > 0 ) udelay(2);
310
       if ( i > 0 ) udelay(2);
330
  *	offset		An _even_ offset into the buffer for the given FID/RID.
330
  *	offset		An _even_ offset into the buffer for the given FID/RID.
331
  *	buf		ptr to array of bytes
331
  *	buf		ptr to array of bytes
332
  *	len		length of data to transfer in bytes
332
  *	len		length of data to transfer in bytes
333
- * Returns: 
333
+ * Returns:
334
  *	0		success
334
  *	0		success
335
  */
335
  */
336
-static int hfa384x_copy_from_bap(hfa384x_t *hw, UINT16 id, UINT16 offset,
337
-			  void *buf, UINT len)
336
+static int hfa384x_copy_from_bap(hfa384x_t *hw, uint16_t id, uint16_t offset,
337
+			  void *buf, unsigned int len)
338
 {
338
 {
339
   int result = 0;
339
   int result = 0;
340
-  UINT8	*d = (UINT8*)buf;
341
-  UINT16 i;
342
-  UINT16 reg = 0;
343
-  
340
+  uint8_t	*d = (uint8_t*)buf;
341
+  uint16_t i;
342
+  uint16_t reg = 0;
343
+
344
   /* Prepare BAP */
344
   /* Prepare BAP */
345
   result = hfa384x_prepare_bap ( hw, id, offset );
345
   result = hfa384x_prepare_bap ( hw, id, offset );
346
   if ( result == 0 ) {
346
   if ( result == 0 ) {
347
     /* Read even(len) buf contents from data reg */
347
     /* Read even(len) buf contents from data reg */
348
     for ( i = 0; i < (len & 0xfffe); i+=2 ) {
348
     for ( i = 0; i < (len & 0xfffe); i+=2 ) {
349
-      *(UINT16*)(&(d[i])) = hfa384x_getreg_noswap(hw, HFA384x_DATA0);
349
+      *(uint16_t*)(&(d[i])) = hfa384x_getreg_noswap(hw, HFA384x_DATA0);
350
     }
350
     }
351
     /* If len odd, handle last byte */
351
     /* If len odd, handle last byte */
352
     if ( len % 2 ){
352
     if ( len % 2 ){
353
       reg = hfa384x_getreg_noswap(hw, HFA384x_DATA0);
353
       reg = hfa384x_getreg_noswap(hw, HFA384x_DATA0);
354
-      d[len-1] = ((UINT8*)(&reg))[0];
354
+      d[len-1] = ((uint8_t*)(&reg))[0];
355
     }
355
     }
356
   }
356
   }
357
   if (result) {
357
   if (result) {
369
  *	offset		An _even_ offset into the buffer for the given FID/RID.
369
  *	offset		An _even_ offset into the buffer for the given FID/RID.
370
  *	buf		ptr to array of bytes
370
  *	buf		ptr to array of bytes
371
  *	len		length of data to transfer in bytes
371
  *	len		length of data to transfer in bytes
372
- * Returns: 
372
+ * Returns:
373
  *	0		success
373
  *	0		success
374
  */
374
  */
375
-static int hfa384x_copy_to_bap(hfa384x_t *hw, UINT16 id, UINT16 offset,
376
-			void *buf, UINT len)
375
+static int hfa384x_copy_to_bap(hfa384x_t *hw, uint16_t id, uint16_t offset,
376
+			void *buf, unsigned int len)
377
 {
377
 {
378
   int result = 0;
378
   int result = 0;
379
-  UINT8	*d = (UINT8*)buf;
380
-  UINT16 i;
381
-  UINT16 savereg;
379
+  uint8_t	*d = (uint8_t*)buf;
380
+  uint16_t i;
381
+  uint16_t savereg;
382
 
382
 
383
   /* Prepare BAP */
383
   /* Prepare BAP */
384
   result = hfa384x_prepare_bap ( hw, id, offset );
384
   result = hfa384x_prepare_bap ( hw, id, offset );
385
   if ( result == 0 ) {
385
   if ( result == 0 ) {
386
     /* Write even(len) buf contents to data reg */
386
     /* Write even(len) buf contents to data reg */
387
     for ( i = 0; i < (len & 0xfffe); i+=2 ) {
387
     for ( i = 0; i < (len & 0xfffe); i+=2 ) {
388
-      hfa384x_setreg_noswap(hw, *(UINT16*)(&(d[i])), HFA384x_DATA0);
388
+      hfa384x_setreg_noswap(hw, *(uint16_t*)(&(d[i])), HFA384x_DATA0);
389
     }
389
     }
390
     /* If len odd, handle last byte */
390
     /* If len odd, handle last byte */
391
     if ( len % 2 ){
391
     if ( len % 2 ){
392
       savereg = hfa384x_getreg_noswap(hw, HFA384x_DATA0);
392
       savereg = hfa384x_getreg_noswap(hw, HFA384x_DATA0);
393
       result = hfa384x_prepare_bap ( hw, id, offset + (len & 0xfffe) );
393
       result = hfa384x_prepare_bap ( hw, id, offset + (len & 0xfffe) );
394
       if ( result == 0 ) {
394
       if ( result == 0 ) {
395
-	((UINT8*)(&savereg))[0] = d[len-1];
395
+	((uint8_t*)(&savereg))[0] = d[len-1];
396
 	hfa384x_setreg_noswap(hw, savereg, HFA384x_DATA0);
396
 	hfa384x_setreg_noswap(hw, savereg, HFA384x_DATA0);
397
       }
397
       }
398
     }
398
     }
412
  *			configuration record. (host order)
412
  *			configuration record. (host order)
413
  *	rid		RID of the record to read/write. (host order)
413
  *	rid		RID of the record to read/write. (host order)
414
  *
414
  *
415
- * Returns: 
415
+ * Returns:
416
  *	0		success
416
  *	0		success
417
  */
417
  */
418
-static inline int hfa384x_cmd_access(hfa384x_t *hw, UINT16 write, UINT16 rid)
418
+static inline int hfa384x_cmd_access(hfa384x_t *hw, uint16_t write, uint16_t rid)
419
 {
419
 {
420
   return hfa384x_docmd_wait(hw, HFA384x_CMD_CMDCODE_SET(HFA384x_CMDCODE_ACCESS) | HFA384x_CMD_WRITE_SET(write), rid, 0, 0);
420
   return hfa384x_docmd_wait(hw, HFA384x_CMD_CMDCODE_SET(HFA384x_CMDCODE_ACCESS) | HFA384x_CMD_WRITE_SET(write), rid, 0, 0);
421
 }
421
 }
427
  *	hw		device structure
427
  *	hw		device structure
428
  *	rid		config/info record id (host order)
428
  *	rid		config/info record id (host order)
429
  *	buf		host side record buffer.  Upon return it will
429
  *	buf		host side record buffer.  Upon return it will
430
- *			contain the body portion of the record (minus the 
430
+ *			contain the body portion of the record (minus the
431
  *			RID and len).
431
  *			RID and len).
432
  *	len		buffer length (in bytes, should match record length)
432
  *	len		buffer length (in bytes, should match record length)
433
  *
433
  *
434
- * Returns: 
434
+ * Returns:
435
  *	0		success
435
  *	0		success
436
  */
436
  */
437
-static int hfa384x_drvr_getconfig(hfa384x_t *hw, UINT16 rid, void *buf, UINT16 len)
437
+static int hfa384x_drvr_getconfig(hfa384x_t *hw, uint16_t rid, void *buf, uint16_t len)
438
 {
438
 {
439
   int result = 0;
439
   int result = 0;
440
   hfa384x_rec_t	rec;
440
   hfa384x_rec_t	rec;
469
  *	rid		config/info record id (in host order)
469
  *	rid		config/info record id (in host order)
470
  *	val		ptr to 16/32 bit buffer to receive value (in host order)
470
  *	val		ptr to 16/32 bit buffer to receive value (in host order)
471
  *
471
  *
472
- * Returns: 
472
+ * Returns:
473
  *	0		success
473
  *	0		success
474
  */
474
  */
475
 #if 0 /* Not actually used anywhere */
475
 #if 0 /* Not actually used anywhere */
476
-static int hfa384x_drvr_getconfig16(hfa384x_t *hw, UINT16 rid, void *val)
476
+static int hfa384x_drvr_getconfig16(hfa384x_t *hw, uint16_t rid, void *val)
477
 {
477
 {
478
   int result = 0;
478
   int result = 0;
479
-  result = hfa384x_drvr_getconfig(hw, rid, val, sizeof(UINT16));
479
+  result = hfa384x_drvr_getconfig(hw, rid, val, sizeof(uint16_t));
480
   if ( result == 0 ) {
480
   if ( result == 0 ) {
481
-    *((UINT16*)val) = hfa384x2host_16(*((UINT16*)val));
481
+    *((uint16_t*)val) = hfa384x2host_16(*((uint16_t*)val));
482
   }
482
   }
483
   return result;
483
   return result;
484
 }
484
 }
485
 #endif
485
 #endif
486
 #if 0 /* Not actually used anywhere */
486
 #if 0 /* Not actually used anywhere */
487
-static int hfa384x_drvr_getconfig32(hfa384x_t *hw, UINT16 rid, void *val)
487
+static int hfa384x_drvr_getconfig32(hfa384x_t *hw, uint16_t rid, void *val)
488
 {
488
 {
489
   int result = 0;
489
   int result = 0;
490
-  result = hfa384x_drvr_getconfig(hw, rid, val, sizeof(UINT32));
490
+  result = hfa384x_drvr_getconfig(hw, rid, val, sizeof(uint32_t));
491
   if ( result == 0 ) {
491
   if ( result == 0 ) {
492
-    *((UINT32*)val) = hfa384x2host_32(*((UINT32*)val));
492
+    *((uint32_t*)val) = hfa384x2host_32(*((uint32_t*)val));
493
   }
493
   }
494
   return result;
494
   return result;
495
 }
495
 }
504
  *	buf		host side record buffer
504
  *	buf		host side record buffer
505
  *	len		buffer length (in bytes)
505
  *	len		buffer length (in bytes)
506
  *
506
  *
507
- * Returns: 
507
+ * Returns:
508
  *	0		success
508
  *	0		success
509
  */
509
  */
510
-static int hfa384x_drvr_setconfig(hfa384x_t *hw, UINT16 rid, void *buf, UINT16 len)
510
+static int hfa384x_drvr_setconfig(hfa384x_t *hw, uint16_t rid, void *buf, uint16_t len)
511
 {
511
 {
512
   int result = 0;
512
   int result = 0;
513
   hfa384x_rec_t	rec;
513
   hfa384x_rec_t	rec;
541
  *	rid		config/info record id (in host order)
541
  *	rid		config/info record id (in host order)
542
  *	val		16/32 bit value to store (in host order)
542
  *	val		16/32 bit value to store (in host order)
543
  *
543
  *
544
- * Returns: 
544
+ * Returns:
545
  *	0		success
545
  *	0		success
546
  */
546
  */
547
-static int hfa384x_drvr_setconfig16(hfa384x_t *hw, UINT16 rid, UINT16 *val)
547
+static int hfa384x_drvr_setconfig16(hfa384x_t *hw, uint16_t rid, uint16_t *val)
548
 {
548
 {
549
-  UINT16 value;
549
+  uint16_t value;
550
   value = host2hfa384x_16(*val);
550
   value = host2hfa384x_16(*val);
551
-  return hfa384x_drvr_setconfig(hw, rid, &value, sizeof(UINT16));
551
+  return hfa384x_drvr_setconfig(hw, rid, &value, sizeof(uint16_t));
552
 }
552
 }
553
 #if 0 /* Not actually used anywhere */
553
 #if 0 /* Not actually used anywhere */
554
-static int hfa384x_drvr_setconfig32(hfa384x_t *hw, UINT16 rid, UINT32 *val)
554
+static int hfa384x_drvr_setconfig32(hfa384x_t *hw, uint16_t rid, uint32_t *val)
555
 {
555
 {
556
-  UINT32 value;
556
+  uint32_t value;
557
   value = host2hfa384x_32(*val);
557
   value = host2hfa384x_32(*val);
558
-  return hfa384x_drvr_setconfig(hw, rid, &value, sizeof(UINT32));
558
+  return hfa384x_drvr_setconfig(hw, rid, &value, sizeof(uint32_t));
559
 }
559
 }
560
 #endif
560
 #endif
561
 
561
 
573
  *      descr           Descriptive text string of what is being waited for
573
  *      descr           Descriptive text string of what is being waited for
574
  *                      (will be printed out if a timeout happens)
574
  *                      (will be printed out if a timeout happens)
575
  *
575
  *
576
- * Returns: 
577
- *      value of EVSTAT register, or 0 on failure 
576
+ * Returns:
577
+ *      value of EVSTAT register, or 0 on failure
578
  */
578
  */
579
-static int hfa384x_wait_for_event(hfa384x_t *hw, UINT16 event_mask, UINT16 event_ack, int wait, int timeout, const char *descr)
579
+static int hfa384x_wait_for_event(hfa384x_t *hw, uint16_t event_mask, uint16_t event_ack, int wait, int timeout, const char *descr)
580
 {
580
 {
581
-  UINT16 reg;
581
+  uint16_t reg;
582
   int count = 0;
582
   int count = 0;
583
-  
583
+
584
   do {
584
   do {
585
     reg = hfa384x_getreg(hw, HFA384x_EVSTAT);
585
     reg = hfa384x_getreg(hw, HFA384x_EVSTAT);
586
     if ( count > 0 ) udelay(wait);
586
     if ( count > 0 ) udelay(wait);
600
 ***************************************************************************/
600
 ***************************************************************************/
601
 static int prism2_poll(struct nic *nic, int retrieve)
601
 static int prism2_poll(struct nic *nic, int retrieve)
602
 {
602
 {
603
-  UINT16 reg;
604
-  UINT16 rxfid;
605
-  UINT16 result;
603
+  uint16_t reg;
604
+  uint16_t rxfid;
605
+  uint16_t result;
606
   hfa384x_rx_frame_t rxdesc;
606
   hfa384x_rx_frame_t rxdesc;
607
   hfa384x_t *hw = &hw_global;
607
   hfa384x_t *hw = &hw_global;
608
-  
608
+
609
   /* Check for received packet */
609
   /* Check for received packet */
610
   reg = hfa384x_getreg(hw, HFA384x_EVSTAT);
610
   reg = hfa384x_getreg(hw, HFA384x_EVSTAT);
611
   if ( ! HFA384x_EVSTAT_ISRX(reg) ) {
611
   if ( ! HFA384x_EVSTAT_ISRX(reg) ) {
617
 
617
 
618
   /* Acknowledge RX event */
618
   /* Acknowledge RX event */
619
   hfa384x_setreg(hw, HFA384x_EVACK_RX_SET(1), HFA384x_EVACK);
619
   hfa384x_setreg(hw, HFA384x_EVACK_RX_SET(1), HFA384x_EVACK);
620
-  /* Get RX FID */  
620
+  /* Get RX FID */
621
   rxfid = hfa384x_getreg(hw, HFA384x_RXFID);
621
   rxfid = hfa384x_getreg(hw, HFA384x_RXFID);
622
   /* Get the descriptor (including headers) */
622
   /* Get the descriptor (including headers) */
623
   result = hfa384x_copy_from_bap(hw, rxfid, 0, &rxdesc, sizeof(rxdesc));
623
   result = hfa384x_copy_from_bap(hw, rxfid, 0, &rxdesc, sizeof(rxdesc));
660
   hfa384x_t *hw = &hw_global;
660
   hfa384x_t *hw = &hw_global;
661
   hfa384x_tx_frame_t txdesc;
661
   hfa384x_tx_frame_t txdesc;
662
   wlan_80211hdr_t p80211hdr = { wlan_llc_snap, {{0,0,0},0} };
662
   wlan_80211hdr_t p80211hdr = { wlan_llc_snap, {{0,0,0},0} };
663
-  UINT16 fid;
664
-  UINT16 status;
663
+  uint16_t fid;
664
+  uint16_t status;
665
   int result;
665
   int result;
666
 
666
 
667
   // Request FID allocation
667
   // Request FID allocation
675
 
675
 
676
   /* Build Tx frame structure */
676
   /* Build Tx frame structure */
677
   memset(&txdesc, 0, sizeof(txdesc));
677
   memset(&txdesc, 0, sizeof(txdesc));
678
-  txdesc.tx_control = host2hfa384x_16( HFA384x_TX_MACPORT_SET(0) | HFA384x_TX_STRUCTYPE_SET(1) | 
678
+  txdesc.tx_control = host2hfa384x_16( HFA384x_TX_MACPORT_SET(0) | HFA384x_TX_STRUCTYPE_SET(1) |
679
 				       HFA384x_TX_TXEX_SET(1) | HFA384x_TX_TXOK_SET(1) );
679
 				       HFA384x_TX_TXEX_SET(1) | HFA384x_TX_TXOK_SET(1) );
680
   txdesc.frame_control =  host2ieee16( WLAN_SET_FC_FTYPE(WLAN_FTYPE_DATA) |
680
   txdesc.frame_control =  host2ieee16( WLAN_SET_FC_FTYPE(WLAN_FTYPE_DATA) |
681
 				       WLAN_SET_FC_FSTYPE(WLAN_FSTYPE_DATAONLY) |
681
 				       WLAN_SET_FC_FSTYPE(WLAN_FSTYPE_DATAONLY) |
687
   /* Set up SNAP header */
687
   /* Set up SNAP header */
688
   /* Let OUI default to RFC1042 (0x000000) */
688
   /* Let OUI default to RFC1042 (0x000000) */
689
   p80211hdr.snap.type = htons(t);
689
   p80211hdr.snap.type = htons(t);
690
-  
690
+
691
   /* Copy txdesc, p80211hdr and payload parts to FID */
691
   /* Copy txdesc, p80211hdr and payload parts to FID */
692
   result = hfa384x_copy_to_bap(hw, fid, 0, &txdesc, sizeof(txdesc));
692
   result = hfa384x_copy_to_bap(hw, fid, 0, &txdesc, sizeof(txdesc));
693
   if ( result ) return; /* fail */
693
   if ( result ) return; /* fail */
694
   result = hfa384x_copy_to_bap( hw, fid, sizeof(txdesc), &p80211hdr, sizeof(p80211hdr) );
694
   result = hfa384x_copy_to_bap( hw, fid, sizeof(txdesc), &p80211hdr, sizeof(p80211hdr) );
695
   if ( result ) return; /* fail */
695
   if ( result ) return; /* fail */
696
-  result = hfa384x_copy_to_bap( hw, fid, sizeof(txdesc) + sizeof(p80211hdr), (UINT8*)p, s );
696
+  result = hfa384x_copy_to_bap( hw, fid, sizeof(txdesc) + sizeof(p80211hdr), (uint8_t*)p, s );
697
   if ( result ) return; /* fail */
697
   if ( result ) return; /* fail */
698
 
698
 
699
   /* Issue Tx command */
699
   /* Issue Tx command */
702
     printf("hfa384x: Transmit failed with result %#hx.\n", result);
702
     printf("hfa384x: Transmit failed with result %#hx.\n", result);
703
     return;
703
     return;
704
   }
704
   }
705
-  
705
+
706
   /* Wait for transmit completion (or exception) */
706
   /* Wait for transmit completion (or exception) */
707
   result = hfa384x_wait_for_event(hw, HFA384x_EVSTAT_TXEXC | HFA384x_EVSTAT_TX, HFA384x_EVACK_INFO,
707
   result = hfa384x_wait_for_event(hw, HFA384x_EVSTAT_TXEXC | HFA384x_EVSTAT_TX, HFA384x_EVACK_INFO,
708
 				  200, 500, "Tx to complete\n" );
708
 				  200, 500, "Tx to complete\n" );
760
 ***************************************************************************/
760
 ***************************************************************************/
761
 static int prism2_probe ( struct nic *nic, hfa384x_t *hw ) {
761
 static int prism2_probe ( struct nic *nic, hfa384x_t *hw ) {
762
   int result;
762
   int result;
763
-  UINT16 tmp16 = 0;
764
-  UINT16 infofid;
763
+  uint16_t tmp16 = 0;
764
+  uint16_t infofid;
765
   hfa384x_InfFrame_t inf;
765
   hfa384x_InfFrame_t inf;
766
   char ssid[HFA384x_RID_CNFDESIREDSSID_LEN];
766
   char ssid[HFA384x_RID_CNFDESIREDSSID_LEN];
767
   int info_count = 0;
767
   int info_count = 0;
820
     } else {
820
     } else {
821
       printf ( "Attempting to autojoin to SSID %s (attempt %d)...", &ssid[2], info_count );
821
       printf ( "Attempting to autojoin to SSID %s (attempt %d)...", &ssid[2], info_count );
822
     }
822
     }
823
-    
823
+
824
     if ( !hfa384x_wait_for_event(hw, HFA384x_EVSTAT_INFO, 0, 1000, 2000, "Info event" ) ) return 0;
824
     if ( !hfa384x_wait_for_event(hw, HFA384x_EVSTAT_INFO, 0, 1000, 2000, "Info event" ) ) return 0;
825
     printf("done\n");
825
     printf("done\n");
826
     infofid = hfa384x_getreg(hw, HFA384x_INFOFID);
826
     infofid = hfa384x_getreg(hw, HFA384x_INFOFID);
827
     /* Retrieve the length */
827
     /* Retrieve the length */
828
-    result = hfa384x_copy_from_bap( hw, infofid, 0, &inf.framelen, sizeof(UINT16));
828
+    result = hfa384x_copy_from_bap( hw, infofid, 0, &inf.framelen, sizeof(uint16_t));
829
     if ( result ) return 0; /* fail */
829
     if ( result ) return 0; /* fail */
830
     inf.framelen = hfa384x2host_16(inf.framelen);
830
     inf.framelen = hfa384x2host_16(inf.framelen);
831
     /* Retrieve the rest */
831
     /* Retrieve the rest */
832
-    result = hfa384x_copy_from_bap( hw, infofid, sizeof(UINT16),
833
-				    &(inf.infotype), inf.framelen * sizeof(UINT16));
832
+    result = hfa384x_copy_from_bap( hw, infofid, sizeof(uint16_t),
833
+				    &(inf.infotype), inf.framelen * sizeof(uint16_t));
834
     if ( result ) return 0; /* fail */
834
     if ( result ) return 0; /* fail */
835
     if ( inf.infotype != HFA384x_IT_LINKSTATUS ) {
835
     if ( inf.infotype != HFA384x_IT_LINKSTATUS ) {
836
       /* Not a Link Status info frame: die */
836
       /* Not a Link Status info frame: die */
843
       printf ( "Link not connected (status %#hx)\n", inf.info.linkstatus.linkstatus );
843
       printf ( "Link not connected (status %#hx)\n", inf.info.linkstatus.linkstatus );
844
     }
844
     }
845
   } while ( inf.info.linkstatus.linkstatus != HFA384x_LINK_CONNECTED );
845
   } while ( inf.info.linkstatus.linkstatus != HFA384x_LINK_CONNECTED );
846
-    
846
+
847
   /* Retrieve BSSID and print Connected message */
847
   /* Retrieve BSSID and print Connected message */
848
   result = hfa384x_drvr_getconfig(hw, HFA384x_RID_CURRENTBSSID, hw->bssid, WLAN_BSSID_LEN);
848
   result = hfa384x_drvr_getconfig(hw, HFA384x_RID_CURRENTBSSID, hw->bssid, WLAN_BSSID_LEN);
849
 
849
 
850
   DBG ( "Link connected (BSSID %s - ", eth_ntoa ( hw->bssid ) );
850
   DBG ( "Link connected (BSSID %s - ", eth_ntoa ( hw->bssid ) );
851
   DBG ( " MAC address %s)\n", eth_ntoa (nic->node_addr ) );
851
   DBG ( " MAC address %s)\n", eth_ntoa (nic->node_addr ) );
852
-  
852
+
853
   /* point to NIC specific routines */
853
   /* point to NIC specific routines */
854
   nic->nic_op	= &prism2_operations;
854
   nic->nic_op	= &prism2_operations;
855
   return 1;
855
   return 1;

+ 12
- 34
src/drivers/net/wlan_compat.h View File

39
 *
39
 *
40
 * --------------------------------------------------------------------
40
 * --------------------------------------------------------------------
41
 *
41
 *
42
-* Portions of the development of this software were funded by 
42
+* Portions of the development of this software were funded by
43
 * Intersil Corporation as part of PRISM(R) chipset product development.
43
 * Intersil Corporation as part of PRISM(R) chipset product development.
44
 *
44
 *
45
 * --------------------------------------------------------------------
45
 * --------------------------------------------------------------------
109
 /* Lets try to figure out what we've got.  Kernel mode or User mode? */
109
 /* Lets try to figure out what we've got.  Kernel mode or User mode? */
110
 #if defined(__KERNEL__)
110
 #if defined(__KERNEL__)
111
 	#define WLAN_OS				WLAN_LINUX_KERNEL
111
 	#define WLAN_OS				WLAN_LINUX_KERNEL
112
-#else 
112
+#else
113
 	#define WLAN_OS				WLAN_LINUX_USER
113
 	#define WLAN_OS				WLAN_LINUX_USER
114
 #endif
114
 #endif
115
 
115
 
179
           Linux/PPC on PowerMacs (PCI)
179
           Linux/PPC on PowerMacs (PCI)
180
 	  Arm/Intel Xscale (PCI)
180
 	  Arm/Intel Xscale (PCI)
181
 
181
 
182
-   This may also affect PLX boards and other BE &| PPC platforms; 
183
-   as new ones are discovered, add them below. 
182
+   This may also affect PLX boards and other BE &| PPC platforms;
183
+   as new ones are discovered, add them below.
184
 */
184
 */
185
 
185
 
186
 #if (WLAN_HOSTIF == WLAN_PCI)
186
 #if (WLAN_HOSTIF == WLAN_PCI)
226
 #define BIT30	0x40000000
226
 #define BIT30	0x40000000
227
 #define BIT31	0x80000000
227
 #define BIT31	0x80000000
228
 
228
 
229
-typedef unsigned char   UINT8;
230
-typedef unsigned short  UINT16;
231
-typedef unsigned long   UINT32;
232
-
233
-typedef signed char     INT8;
234
-typedef signed short    INT16;
235
-typedef signed long     INT32;
236
-
237
-typedef unsigned int    UINT;
238
-typedef signed int      INT;
239
-
240
-typedef unsigned long long	UINT64;
241
-typedef signed long long	INT64;
242
-
243
-#define UINT8_MAX	(0xffUL)
244
-#define UINT16_MAX	(0xffffUL)
245
-#define UINT32_MAX	(0xffffffffUL)
246
-
247
-#define INT8_MAX	(0x7fL)
248
-#define INT16_MAX	(0x7fffL)
249
-#define INT32_MAX	(0x7fffffffL)
250
-
251
 /*=============================================================*/
229
 /*=============================================================*/
252
 /*------ Compiler Portability Macros --------------------------*/
230
 /*------ Compiler Portability Macros --------------------------*/
253
 /*=============================================================*/
231
 /*=============================================================*/
298
 			int __i__; \
276
 			int __i__; \
299
 			printk(KERN_DEBUG x ":"); \
277
 			printk(KERN_DEBUG x ":"); \
300
 			for( __i__=0; __i__ < (n); __i__++) \
278
 			for( __i__=0; __i__ < (n); __i__++) \
301
-				printk( " %02x", ((UINT8*)(p))[__i__]); \
279
+				printk( " %02x", ((uint8_t*)(p))[__i__]); \
302
 			printk("\n"); }
280
 			printk("\n"); }
303
 
281
 
304
 		#define DBFENTER { if ( WLAN_DBVAR >= 4 ){ WLAN_LOG_DEBUG0(3,"Enter\n"); } }
282
 		#define DBFENTER { if ( WLAN_DBVAR >= 4 ){ WLAN_LOG_DEBUG0(3,"Enter\n"); } }
312
 		#define WLAN_LOG_DEBUG5(l,x,n1,n2,n3,n4,n5) if ( WLAN_DBVAR >= (l)) printk(KERN_DEBUG "%s: " x , __FUNCTION__ , (n1), (n2), (n3), (n4), (n5));
290
 		#define WLAN_LOG_DEBUG5(l,x,n1,n2,n3,n4,n5) if ( WLAN_DBVAR >= (l)) printk(KERN_DEBUG "%s: " x , __FUNCTION__ , (n1), (n2), (n3), (n4), (n5));
313
 		#define WLAN_LOG_DEBUG6(l,x,n1,n2,n3,n4,n5,n6) if ( WLAN_DBVAR >= (l)) printk(KERN_DEBUG "%s: " x , __FUNCTION__ , (n1), (n2), (n3), (n4), (n5), (n6));
291
 		#define WLAN_LOG_DEBUG6(l,x,n1,n2,n3,n4,n5,n6) if ( WLAN_DBVAR >= (l)) printk(KERN_DEBUG "%s: " x , __FUNCTION__ , (n1), (n2), (n3), (n4), (n5), (n6));
314
 	#else
292
 	#else
315
-		#define WLAN_ASSERT(c) 
293
+		#define WLAN_ASSERT(c)
316
 		#define WLAN_HEX_DUMP( l, s, p, n)
294
 		#define WLAN_HEX_DUMP( l, s, p, n)
317
 
295
 
318
-		#define DBFENTER 
319
-		#define DBFEXIT 
296
+		#define DBFENTER
297
+		#define DBFEXIT
320
 
298
 
321
 		#define WLAN_LOG_DEBUG0(l, s)
299
 		#define WLAN_LOG_DEBUG0(l, s)
322
 		#define WLAN_LOG_DEBUG1(l, s,n)
300
 		#define WLAN_LOG_DEBUG1(l, s,n)
344
 	#define WLAN_LOG_NOTICE3(s,n1,n2,n3)
322
 	#define WLAN_LOG_NOTICE3(s,n1,n2,n3)
345
 	#define WLAN_LOG_NOTICE4(s,n1,n2,n3,n4)
323
 	#define WLAN_LOG_NOTICE4(s,n1,n2,n3,n4)
346
 
324
 
347
-		#define WLAN_ASSERT(c) 
325
+		#define WLAN_ASSERT(c)
348
 		#define WLAN_HEX_DUMP( l, s, p, n)
326
 		#define WLAN_HEX_DUMP( l, s, p, n)
349
 
327
 
350
-		#define DBFENTER 
351
-		#define DBFEXIT 
328
+		#define DBFENTER
329
+		#define DBFEXIT
352
 
330
 
353
 		#define WLAN_LOG_INFO0(s)
331
 		#define WLAN_LOG_INFO0(s)
354
 		#define WLAN_LOG_INFO1(s,n)
332
 		#define WLAN_LOG_INFO1(s,n)
378
 
356
 
379
 #ifdef CONFIG_SMP
357
 #ifdef CONFIG_SMP
380
 #define __SMP__			1
358
 #define __SMP__			1
381
-#endif	
359
+#endif
382
 
360
 
383
 #ifndef KERNEL_VERSION
361
 #ifndef KERNEL_VERSION
384
 #define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))
362
 #define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))

Loading…
Cancel
Save