[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>
pull/13/head
Michael Brown 2013-03-25 18:02:20 +00:00
parent dab7910beb
commit 8a49782eeb
4 changed files with 1348 additions and 1370 deletions

File diff suppressed because it is too large Load Diff

View File

@ -168,29 +168,29 @@ FILE_LICENCE ( GPL2_ONLY );
/* SET_FC_FSTYPE(WLAN_FSTYPE_RTS) ); */ /* SET_FC_FSTYPE(WLAN_FSTYPE_RTS) ); */
/*------------------------------------------------------------*/ /*------------------------------------------------------------*/
#define WLAN_GET_FC_PVER(n) (((UINT16)(n)) & (BIT0 | BIT1)) #define WLAN_GET_FC_PVER(n) (((uint16_t)(n)) & (BIT0 | BIT1))
#define WLAN_GET_FC_FTYPE(n) ((((UINT16)(n)) & (BIT2 | BIT3)) >> 2) #define WLAN_GET_FC_FTYPE(n) ((((uint16_t)(n)) & (BIT2 | BIT3)) >> 2)
#define WLAN_GET_FC_FSTYPE(n) ((((UINT16)(n)) & (BIT4|BIT5|BIT6|BIT7)) >> 4) #define WLAN_GET_FC_FSTYPE(n) ((((uint16_t)(n)) & (BIT4|BIT5|BIT6|BIT7)) >> 4)
#define WLAN_GET_FC_TODS(n) ((((UINT16)(n)) & (BIT8)) >> 8) #define WLAN_GET_FC_TODS(n) ((((uint16_t)(n)) & (BIT8)) >> 8)
#define WLAN_GET_FC_FROMDS(n) ((((UINT16)(n)) & (BIT9)) >> 9) #define WLAN_GET_FC_FROMDS(n) ((((uint16_t)(n)) & (BIT9)) >> 9)
#define WLAN_GET_FC_MOREFRAG(n) ((((UINT16)(n)) & (BIT10)) >> 10) #define WLAN_GET_FC_MOREFRAG(n) ((((uint16_t)(n)) & (BIT10)) >> 10)
#define WLAN_GET_FC_RETRY(n) ((((UINT16)(n)) & (BIT11)) >> 11) #define WLAN_GET_FC_RETRY(n) ((((uint16_t)(n)) & (BIT11)) >> 11)
#define WLAN_GET_FC_PWRMGT(n) ((((UINT16)(n)) & (BIT12)) >> 12) #define WLAN_GET_FC_PWRMGT(n) ((((uint16_t)(n)) & (BIT12)) >> 12)
#define WLAN_GET_FC_MOREDATA(n) ((((UINT16)(n)) & (BIT13)) >> 13) #define WLAN_GET_FC_MOREDATA(n) ((((uint16_t)(n)) & (BIT13)) >> 13)
#define WLAN_GET_FC_ISWEP(n) ((((UINT16)(n)) & (BIT14)) >> 14) #define WLAN_GET_FC_ISWEP(n) ((((uint16_t)(n)) & (BIT14)) >> 14)
#define WLAN_GET_FC_ORDER(n) ((((UINT16)(n)) & (BIT15)) >> 15) #define WLAN_GET_FC_ORDER(n) ((((uint16_t)(n)) & (BIT15)) >> 15)
#define WLAN_SET_FC_PVER(n) ((UINT16)(n)) #define WLAN_SET_FC_PVER(n) ((uint16_t)(n))
#define WLAN_SET_FC_FTYPE(n) (((UINT16)(n)) << 2) #define WLAN_SET_FC_FTYPE(n) (((uint16_t)(n)) << 2)
#define WLAN_SET_FC_FSTYPE(n) (((UINT16)(n)) << 4) #define WLAN_SET_FC_FSTYPE(n) (((uint16_t)(n)) << 4)
#define WLAN_SET_FC_TODS(n) (((UINT16)(n)) << 8) #define WLAN_SET_FC_TODS(n) (((uint16_t)(n)) << 8)
#define WLAN_SET_FC_FROMDS(n) (((UINT16)(n)) << 9) #define WLAN_SET_FC_FROMDS(n) (((uint16_t)(n)) << 9)
#define WLAN_SET_FC_MOREFRAG(n) (((UINT16)(n)) << 10) #define WLAN_SET_FC_MOREFRAG(n) (((uint16_t)(n)) << 10)
#define WLAN_SET_FC_RETRY(n) (((UINT16)(n)) << 11) #define WLAN_SET_FC_RETRY(n) (((uint16_t)(n)) << 11)
#define WLAN_SET_FC_PWRMGT(n) (((UINT16)(n)) << 12) #define WLAN_SET_FC_PWRMGT(n) (((uint16_t)(n)) << 12)
#define WLAN_SET_FC_MOREDATA(n) (((UINT16)(n)) << 13) #define WLAN_SET_FC_MOREDATA(n) (((uint16_t)(n)) << 13)
#define WLAN_SET_FC_ISWEP(n) (((UINT16)(n)) << 14) #define WLAN_SET_FC_ISWEP(n) (((uint16_t)(n)) << 14)
#define WLAN_SET_FC_ORDER(n) (((UINT16)(n)) << 15) #define WLAN_SET_FC_ORDER(n) (((uint16_t)(n)) << 15)
/*--- Duration Macros ----------------------------------------*/ /*--- Duration Macros ----------------------------------------*/
/* Macros to get/set the bitfields of the Duration Field */ /* Macros to get/set the bitfields of the Duration Field */
@ -203,45 +203,45 @@ FILE_LICENCE ( GPL2_ONLY );
/* Macros to get/set the bitfields of the Sequence Control */ /* Macros to get/set the bitfields of the Sequence Control */
/* Field. */ /* Field. */
/*------------------------------------------------------------*/ /*------------------------------------------------------------*/
#define WLAN_GET_SEQ_FRGNUM(n) (((UINT16)(n)) & (BIT0|BIT1|BIT2|BIT3)) #define WLAN_GET_SEQ_FRGNUM(n) (((uint16_t)(n)) & (BIT0|BIT1|BIT2|BIT3))
#define WLAN_GET_SEQ_SEQNUM(n) ((((UINT16)(n)) & (~(BIT0|BIT1|BIT2|BIT3))) >> 4) #define WLAN_GET_SEQ_SEQNUM(n) ((((uint16_t)(n)) & (~(BIT0|BIT1|BIT2|BIT3))) >> 4)
/*--- Data ptr macro -----------------------------------------*/ /*--- Data ptr macro -----------------------------------------*/
/* Creates a UINT8* to the data portion of a frame */ /* Creates a uint8_t* to the data portion of a frame */
/* Assumes you're passing in a ptr to the beginning of the hdr*/ /* Assumes you're passing in a ptr to the beginning of the hdr*/
/*------------------------------------------------------------*/ /*------------------------------------------------------------*/
#define WLAN_HDR_A3_DATAP(p) (((UINT8*)(p)) + WLAN_HDR_A3_LEN) #define WLAN_HDR_A3_DATAP(p) (((uint8_t*)(p)) + WLAN_HDR_A3_LEN)
#define WLAN_HDR_A4_DATAP(p) (((UINT8*)(p)) + WLAN_HDR_A4_LEN) #define WLAN_HDR_A4_DATAP(p) (((uint8_t*)(p)) + WLAN_HDR_A4_LEN)
#define DOT11_RATE5_ISBASIC_GET(r) (((UINT8)(r)) & BIT7) #define DOT11_RATE5_ISBASIC_GET(r) (((uint8_t)(r)) & BIT7)
/*================================================================*/ /*================================================================*/
/* Types */ /* Types */
/* BSS Timestamp */ /* BSS Timestamp */
typedef UINT8 wlan_bss_ts_t[WLAN_BSS_TS_LEN]; typedef uint8_t wlan_bss_ts_t[WLAN_BSS_TS_LEN];
/* Generic 802.11 Header types */ /* Generic 802.11 Header types */
typedef struct p80211_hdr_a3 typedef struct p80211_hdr_a3
{ {
UINT16 fc; uint16_t fc;
UINT16 dur; uint16_t dur;
UINT8 a1[WLAN_ADDR_LEN]; uint8_t a1[WLAN_ADDR_LEN];
UINT8 a2[WLAN_ADDR_LEN]; uint8_t a2[WLAN_ADDR_LEN];
UINT8 a3[WLAN_ADDR_LEN]; uint8_t a3[WLAN_ADDR_LEN];
UINT16 seq; uint16_t seq;
} __WLAN_ATTRIB_PACK__ p80211_hdr_a3_t; } __WLAN_ATTRIB_PACK__ p80211_hdr_a3_t;
typedef struct p80211_hdr_a4 typedef struct p80211_hdr_a4
{ {
UINT16 fc; uint16_t fc;
UINT16 dur; uint16_t dur;
UINT8 a1[WLAN_ADDR_LEN]; uint8_t a1[WLAN_ADDR_LEN];
UINT8 a2[WLAN_ADDR_LEN]; uint8_t a2[WLAN_ADDR_LEN];
UINT8 a3[WLAN_ADDR_LEN]; uint8_t a3[WLAN_ADDR_LEN];
UINT16 seq; uint16_t seq;
UINT8 a4[WLAN_ADDR_LEN]; uint8_t a4[WLAN_ADDR_LEN];
} __WLAN_ATTRIB_PACK__ p80211_hdr_a4_t; } __WLAN_ATTRIB_PACK__ p80211_hdr_a4_t;
typedef union p80211_hdr typedef union p80211_hdr
@ -273,9 +273,9 @@ typedef union p80211_hdr
#define WLAN_FCS_LEN 4 #define WLAN_FCS_LEN 4
/* ftcl in HOST order */ /* ftcl in HOST order */
inline static UINT16 p80211_headerlen(UINT16 fctl) inline static uint16_t p80211_headerlen(uint16_t fctl)
{ {
UINT16 hdrlen = 0; uint16_t hdrlen = 0;
switch ( WLAN_GET_FC_FTYPE(fctl) ) { switch ( WLAN_GET_FC_FTYPE(fctl) ) {
case WLAN_FTYPE_MGMT: case WLAN_FTYPE_MGMT:

View File

@ -69,10 +69,10 @@ static const char hardcoded_ssid[] = "";
#define __cpu_to_le16(x) (x) #define __cpu_to_le16(x) (x)
#define __cpu_to_le32(x) (x) #define __cpu_to_le32(x) (x)
#define hfa384x2host_16(n) (__le16_to_cpu((UINT16)(n))) #define hfa384x2host_16(n) (__le16_to_cpu((uint16_t)(n)))
#define hfa384x2host_32(n) (__le32_to_cpu((UINT32)(n))) #define hfa384x2host_32(n) (__le32_to_cpu((uint32_t)(n)))
#define host2hfa384x_16(n) (__cpu_to_le16((UINT16)(n))) #define host2hfa384x_16(n) (__cpu_to_le16((uint16_t)(n)))
#define host2hfa384x_32(n) (__cpu_to_le32((UINT32)(n))) #define host2hfa384x_32(n) (__cpu_to_le32((uint32_t)(n)))
/* /*
* PLX9052 PCI register offsets * PLX9052 PCI register offsets
@ -119,14 +119,14 @@ static const char hardcoded_ssid[] = "";
typedef struct hfa384x typedef struct hfa384x
{ {
UINT32 iobase; uint32_t iobase;
void *membase; void *membase;
UINT16 lastcmd; uint16_t lastcmd;
UINT16 status; /* in host order */ uint16_t status; /* in host order */
UINT16 resp0; /* in host order */ uint16_t resp0; /* in host order */
UINT16 resp1; /* in host order */ uint16_t resp1; /* in host order */
UINT16 resp2; /* in host order */ uint16_t resp2; /* in host order */
UINT8 bssid[WLAN_BSSID_LEN]; uint8_t bssid[WLAN_BSSID_LEN];
} hfa384x_t; } hfa384x_t;
/* The global instance of the hardware (i.e. where we store iobase and membase, in the absence of anywhere better to put them */ /* The global instance of the hardware (i.e. where we store iobase and membase, in the absence of anywhere better to put them */
@ -141,9 +141,9 @@ static hfa384x_t hw_global = {
typedef struct wlan_llc typedef struct wlan_llc
{ {
UINT8 dsap; uint8_t dsap;
UINT8 ssap; uint8_t ssap;
UINT8 ctl; uint8_t ctl;
} wlan_llc_t; } wlan_llc_t;
static const wlan_llc_t wlan_llc_snap = { 0xaa, 0xaa, 0x03 }; /* LLC header indicating SNAP (?) */ static const wlan_llc_t wlan_llc_snap = { 0xaa, 0xaa, 0x03 }; /* LLC header indicating SNAP (?) */
@ -151,8 +151,8 @@ static const wlan_llc_t wlan_llc_snap = { 0xaa, 0xaa, 0x03 }; /* LLC header indi
#define WLAN_IEEE_OUI_LEN 3 #define WLAN_IEEE_OUI_LEN 3
typedef struct wlan_snap typedef struct wlan_snap
{ {
UINT8 oui[WLAN_IEEE_OUI_LEN]; uint8_t oui[WLAN_IEEE_OUI_LEN];
UINT16 type; uint16_t type;
} wlan_snap_t; } wlan_snap_t;
typedef struct wlan_80211hdr typedef struct wlan_80211hdr
@ -172,7 +172,7 @@ typedef struct wlan_80211hdr
*/ */
/* Retrieve the value of one of the MAC registers. */ /* Retrieve the value of one of the MAC registers. */
static inline UINT16 hfa384x_getreg( hfa384x_t *hw, UINT reg ) static inline uint16_t hfa384x_getreg( hfa384x_t *hw, unsigned int reg )
{ {
#if (WLAN_HOSTIF == WLAN_PLX) #if (WLAN_HOSTIF == WLAN_PLX)
return inw ( hw->iobase + reg ); return inw ( hw->iobase + reg );
@ -182,7 +182,7 @@ static inline UINT16 hfa384x_getreg( hfa384x_t *hw, UINT reg )
} }
/* Set the value of one of the MAC registers. */ /* Set the value of one of the MAC registers. */
static inline void hfa384x_setreg( hfa384x_t *hw, UINT16 val, UINT reg ) static inline void hfa384x_setreg( hfa384x_t *hw, uint16_t val, unsigned int reg )
{ {
#if (WLAN_HOSTIF == WLAN_PLX) #if (WLAN_HOSTIF == WLAN_PLX)
outw ( val, hw->iobase + reg ); outw ( val, hw->iobase + reg );
@ -196,11 +196,11 @@ static inline void hfa384x_setreg( hfa384x_t *hw, UINT16 val, UINT reg )
* Noswap versions * Noswap versions
* Etherboot is i386 only, so swap and noswap are the same... * Etherboot is i386 only, so swap and noswap are the same...
*/ */
static inline UINT16 hfa384x_getreg_noswap( hfa384x_t *hw, UINT reg ) static inline uint16_t hfa384x_getreg_noswap( hfa384x_t *hw, unsigned int reg )
{ {
return hfa384x_getreg ( hw, reg ); return hfa384x_getreg ( hw, reg );
} }
static inline void hfa384x_setreg_noswap( hfa384x_t *hw, UINT16 val, UINT reg ) static inline void hfa384x_setreg_noswap( hfa384x_t *hw, uint16_t val, unsigned int reg )
{ {
hfa384x_setreg ( hw, val, reg ); hfa384x_setreg ( hw, val, reg );
} }
@ -227,10 +227,10 @@ static inline void hfa384x_setreg_noswap( hfa384x_t *hw, UINT16 val, UINT reg )
* >0 command indicated error, Status and Resp0-2 are * >0 command indicated error, Status and Resp0-2 are
* in hw structure. * in hw structure.
*/ */
static int hfa384x_docmd_wait( hfa384x_t *hw, UINT16 cmd, UINT16 parm0, UINT16 parm1, UINT16 parm2) static int hfa384x_docmd_wait( hfa384x_t *hw, uint16_t cmd, uint16_t parm0, uint16_t parm1, uint16_t parm2)
{ {
UINT16 reg = 0; uint16_t reg = 0;
UINT16 counter = 0; uint16_t counter = 0;
/* wait for the busy bit to clear */ /* wait for the busy bit to clear */
counter = 0; counter = 0;
@ -289,11 +289,11 @@ static int hfa384x_docmd_wait( hfa384x_t *hw, UINT16 cmd, UINT16 parm0, UINT16 p
* Returns: * Returns:
* 0 success * 0 success
*/ */
static int hfa384x_prepare_bap(hfa384x_t *hw, UINT16 id, UINT16 offset) static int hfa384x_prepare_bap(hfa384x_t *hw, uint16_t id, uint16_t offset)
{ {
int result = 0; int result = 0;
UINT16 reg; uint16_t reg;
UINT16 i; uint16_t i;
/* Validate offset, buf, and len */ /* Validate offset, buf, and len */
if ( (offset > HFA384x_BAP_OFFSET_MAX) || (offset % 2) ) { if ( (offset > HFA384x_BAP_OFFSET_MAX) || (offset % 2) ) {
@ -333,25 +333,25 @@ static int hfa384x_prepare_bap(hfa384x_t *hw, UINT16 id, UINT16 offset)
* Returns: * Returns:
* 0 success * 0 success
*/ */
static int hfa384x_copy_from_bap(hfa384x_t *hw, UINT16 id, UINT16 offset, static int hfa384x_copy_from_bap(hfa384x_t *hw, uint16_t id, uint16_t offset,
void *buf, UINT len) void *buf, unsigned int len)
{ {
int result = 0; int result = 0;
UINT8 *d = (UINT8*)buf; uint8_t *d = (uint8_t*)buf;
UINT16 i; uint16_t i;
UINT16 reg = 0; uint16_t reg = 0;
/* Prepare BAP */ /* Prepare BAP */
result = hfa384x_prepare_bap ( hw, id, offset ); result = hfa384x_prepare_bap ( hw, id, offset );
if ( result == 0 ) { if ( result == 0 ) {
/* Read even(len) buf contents from data reg */ /* Read even(len) buf contents from data reg */
for ( i = 0; i < (len & 0xfffe); i+=2 ) { for ( i = 0; i < (len & 0xfffe); i+=2 ) {
*(UINT16*)(&(d[i])) = hfa384x_getreg_noswap(hw, HFA384x_DATA0); *(uint16_t*)(&(d[i])) = hfa384x_getreg_noswap(hw, HFA384x_DATA0);
} }
/* If len odd, handle last byte */ /* If len odd, handle last byte */
if ( len % 2 ){ if ( len % 2 ){
reg = hfa384x_getreg_noswap(hw, HFA384x_DATA0); reg = hfa384x_getreg_noswap(hw, HFA384x_DATA0);
d[len-1] = ((UINT8*)(&reg))[0]; d[len-1] = ((uint8_t*)(&reg))[0];
} }
} }
if (result) { if (result) {
@ -372,27 +372,27 @@ static int hfa384x_copy_from_bap(hfa384x_t *hw, UINT16 id, UINT16 offset,
* Returns: * Returns:
* 0 success * 0 success
*/ */
static int hfa384x_copy_to_bap(hfa384x_t *hw, UINT16 id, UINT16 offset, static int hfa384x_copy_to_bap(hfa384x_t *hw, uint16_t id, uint16_t offset,
void *buf, UINT len) void *buf, unsigned int len)
{ {
int result = 0; int result = 0;
UINT8 *d = (UINT8*)buf; uint8_t *d = (uint8_t*)buf;
UINT16 i; uint16_t i;
UINT16 savereg; uint16_t savereg;
/* Prepare BAP */ /* Prepare BAP */
result = hfa384x_prepare_bap ( hw, id, offset ); result = hfa384x_prepare_bap ( hw, id, offset );
if ( result == 0 ) { if ( result == 0 ) {
/* Write even(len) buf contents to data reg */ /* Write even(len) buf contents to data reg */
for ( i = 0; i < (len & 0xfffe); i+=2 ) { for ( i = 0; i < (len & 0xfffe); i+=2 ) {
hfa384x_setreg_noswap(hw, *(UINT16*)(&(d[i])), HFA384x_DATA0); hfa384x_setreg_noswap(hw, *(uint16_t*)(&(d[i])), HFA384x_DATA0);
} }
/* If len odd, handle last byte */ /* If len odd, handle last byte */
if ( len % 2 ){ if ( len % 2 ){
savereg = hfa384x_getreg_noswap(hw, HFA384x_DATA0); savereg = hfa384x_getreg_noswap(hw, HFA384x_DATA0);
result = hfa384x_prepare_bap ( hw, id, offset + (len & 0xfffe) ); result = hfa384x_prepare_bap ( hw, id, offset + (len & 0xfffe) );
if ( result == 0 ) { if ( result == 0 ) {
((UINT8*)(&savereg))[0] = d[len-1]; ((uint8_t*)(&savereg))[0] = d[len-1];
hfa384x_setreg_noswap(hw, savereg, HFA384x_DATA0); hfa384x_setreg_noswap(hw, savereg, HFA384x_DATA0);
} }
} }
@ -415,7 +415,7 @@ static int hfa384x_copy_to_bap(hfa384x_t *hw, UINT16 id, UINT16 offset,
* Returns: * Returns:
* 0 success * 0 success
*/ */
static inline int hfa384x_cmd_access(hfa384x_t *hw, UINT16 write, UINT16 rid) static inline int hfa384x_cmd_access(hfa384x_t *hw, uint16_t write, uint16_t rid)
{ {
return hfa384x_docmd_wait(hw, HFA384x_CMD_CMDCODE_SET(HFA384x_CMDCODE_ACCESS) | HFA384x_CMD_WRITE_SET(write), rid, 0, 0); return hfa384x_docmd_wait(hw, HFA384x_CMD_CMDCODE_SET(HFA384x_CMDCODE_ACCESS) | HFA384x_CMD_WRITE_SET(write), rid, 0, 0);
} }
@ -434,7 +434,7 @@ static inline int hfa384x_cmd_access(hfa384x_t *hw, UINT16 write, UINT16 rid)
* Returns: * Returns:
* 0 success * 0 success
*/ */
static int hfa384x_drvr_getconfig(hfa384x_t *hw, UINT16 rid, void *buf, UINT16 len) static int hfa384x_drvr_getconfig(hfa384x_t *hw, uint16_t rid, void *buf, uint16_t len)
{ {
int result = 0; int result = 0;
hfa384x_rec_t rec; hfa384x_rec_t rec;
@ -473,23 +473,23 @@ static int hfa384x_drvr_getconfig(hfa384x_t *hw, UINT16 rid, void *buf, UINT16 l
* 0 success * 0 success
*/ */
#if 0 /* Not actually used anywhere */ #if 0 /* Not actually used anywhere */
static int hfa384x_drvr_getconfig16(hfa384x_t *hw, UINT16 rid, void *val) static int hfa384x_drvr_getconfig16(hfa384x_t *hw, uint16_t rid, void *val)
{ {
int result = 0; int result = 0;
result = hfa384x_drvr_getconfig(hw, rid, val, sizeof(UINT16)); result = hfa384x_drvr_getconfig(hw, rid, val, sizeof(uint16_t));
if ( result == 0 ) { if ( result == 0 ) {
*((UINT16*)val) = hfa384x2host_16(*((UINT16*)val)); *((uint16_t*)val) = hfa384x2host_16(*((uint16_t*)val));
} }
return result; return result;
} }
#endif #endif
#if 0 /* Not actually used anywhere */ #if 0 /* Not actually used anywhere */
static int hfa384x_drvr_getconfig32(hfa384x_t *hw, UINT16 rid, void *val) static int hfa384x_drvr_getconfig32(hfa384x_t *hw, uint16_t rid, void *val)
{ {
int result = 0; int result = 0;
result = hfa384x_drvr_getconfig(hw, rid, val, sizeof(UINT32)); result = hfa384x_drvr_getconfig(hw, rid, val, sizeof(uint32_t));
if ( result == 0 ) { if ( result == 0 ) {
*((UINT32*)val) = hfa384x2host_32(*((UINT32*)val)); *((uint32_t*)val) = hfa384x2host_32(*((uint32_t*)val));
} }
return result; return result;
} }
@ -507,7 +507,7 @@ static int hfa384x_drvr_getconfig32(hfa384x_t *hw, UINT16 rid, void *val)
* Returns: * Returns:
* 0 success * 0 success
*/ */
static int hfa384x_drvr_setconfig(hfa384x_t *hw, UINT16 rid, void *buf, UINT16 len) static int hfa384x_drvr_setconfig(hfa384x_t *hw, uint16_t rid, void *buf, uint16_t len)
{ {
int result = 0; int result = 0;
hfa384x_rec_t rec; hfa384x_rec_t rec;
@ -544,18 +544,18 @@ static int hfa384x_drvr_setconfig(hfa384x_t *hw, UINT16 rid, void *buf, UINT16 l
* Returns: * Returns:
* 0 success * 0 success
*/ */
static int hfa384x_drvr_setconfig16(hfa384x_t *hw, UINT16 rid, UINT16 *val) static int hfa384x_drvr_setconfig16(hfa384x_t *hw, uint16_t rid, uint16_t *val)
{ {
UINT16 value; uint16_t value;
value = host2hfa384x_16(*val); value = host2hfa384x_16(*val);
return hfa384x_drvr_setconfig(hw, rid, &value, sizeof(UINT16)); return hfa384x_drvr_setconfig(hw, rid, &value, sizeof(uint16_t));
} }
#if 0 /* Not actually used anywhere */ #if 0 /* Not actually used anywhere */
static int hfa384x_drvr_setconfig32(hfa384x_t *hw, UINT16 rid, UINT32 *val) static int hfa384x_drvr_setconfig32(hfa384x_t *hw, uint16_t rid, uint32_t *val)
{ {
UINT32 value; uint32_t value;
value = host2hfa384x_32(*val); value = host2hfa384x_32(*val);
return hfa384x_drvr_setconfig(hw, rid, &value, sizeof(UINT32)); return hfa384x_drvr_setconfig(hw, rid, &value, sizeof(uint32_t));
} }
#endif #endif
@ -576,9 +576,9 @@ static int hfa384x_drvr_setconfig32(hfa384x_t *hw, UINT16 rid, UINT32 *val)
* Returns: * Returns:
* value of EVSTAT register, or 0 on failure * value of EVSTAT register, or 0 on failure
*/ */
static int hfa384x_wait_for_event(hfa384x_t *hw, UINT16 event_mask, UINT16 event_ack, int wait, int timeout, const char *descr) static int hfa384x_wait_for_event(hfa384x_t *hw, uint16_t event_mask, uint16_t event_ack, int wait, int timeout, const char *descr)
{ {
UINT16 reg; uint16_t reg;
int count = 0; int count = 0;
do { do {
@ -600,9 +600,9 @@ POLL - Wait for a frame
***************************************************************************/ ***************************************************************************/
static int prism2_poll(struct nic *nic, int retrieve) static int prism2_poll(struct nic *nic, int retrieve)
{ {
UINT16 reg; uint16_t reg;
UINT16 rxfid; uint16_t rxfid;
UINT16 result; uint16_t result;
hfa384x_rx_frame_t rxdesc; hfa384x_rx_frame_t rxdesc;
hfa384x_t *hw = &hw_global; hfa384x_t *hw = &hw_global;
@ -660,8 +660,8 @@ static void prism2_transmit(
hfa384x_t *hw = &hw_global; hfa384x_t *hw = &hw_global;
hfa384x_tx_frame_t txdesc; hfa384x_tx_frame_t txdesc;
wlan_80211hdr_t p80211hdr = { wlan_llc_snap, {{0,0,0},0} }; wlan_80211hdr_t p80211hdr = { wlan_llc_snap, {{0,0,0},0} };
UINT16 fid; uint16_t fid;
UINT16 status; uint16_t status;
int result; int result;
// Request FID allocation // Request FID allocation
@ -693,7 +693,7 @@ static void prism2_transmit(
if ( result ) return; /* fail */ if ( result ) return; /* fail */
result = hfa384x_copy_to_bap( hw, fid, sizeof(txdesc), &p80211hdr, sizeof(p80211hdr) ); result = hfa384x_copy_to_bap( hw, fid, sizeof(txdesc), &p80211hdr, sizeof(p80211hdr) );
if ( result ) return; /* fail */ if ( result ) return; /* fail */
result = hfa384x_copy_to_bap( hw, fid, sizeof(txdesc) + sizeof(p80211hdr), (UINT8*)p, s ); result = hfa384x_copy_to_bap( hw, fid, sizeof(txdesc) + sizeof(p80211hdr), (uint8_t*)p, s );
if ( result ) return; /* fail */ if ( result ) return; /* fail */
/* Issue Tx command */ /* Issue Tx command */
@ -760,8 +760,8 @@ You should omit the last argument struct pci_device * for a non-PCI NIC
***************************************************************************/ ***************************************************************************/
static int prism2_probe ( struct nic *nic, hfa384x_t *hw ) { static int prism2_probe ( struct nic *nic, hfa384x_t *hw ) {
int result; int result;
UINT16 tmp16 = 0; uint16_t tmp16 = 0;
UINT16 infofid; uint16_t infofid;
hfa384x_InfFrame_t inf; hfa384x_InfFrame_t inf;
char ssid[HFA384x_RID_CNFDESIREDSSID_LEN]; char ssid[HFA384x_RID_CNFDESIREDSSID_LEN];
int info_count = 0; int info_count = 0;
@ -825,12 +825,12 @@ static int prism2_probe ( struct nic *nic, hfa384x_t *hw ) {
printf("done\n"); printf("done\n");
infofid = hfa384x_getreg(hw, HFA384x_INFOFID); infofid = hfa384x_getreg(hw, HFA384x_INFOFID);
/* Retrieve the length */ /* Retrieve the length */
result = hfa384x_copy_from_bap( hw, infofid, 0, &inf.framelen, sizeof(UINT16)); result = hfa384x_copy_from_bap( hw, infofid, 0, &inf.framelen, sizeof(uint16_t));
if ( result ) return 0; /* fail */ if ( result ) return 0; /* fail */
inf.framelen = hfa384x2host_16(inf.framelen); inf.framelen = hfa384x2host_16(inf.framelen);
/* Retrieve the rest */ /* Retrieve the rest */
result = hfa384x_copy_from_bap( hw, infofid, sizeof(UINT16), result = hfa384x_copy_from_bap( hw, infofid, sizeof(uint16_t),
&(inf.infotype), inf.framelen * sizeof(UINT16)); &(inf.infotype), inf.framelen * sizeof(uint16_t));
if ( result ) return 0; /* fail */ if ( result ) return 0; /* fail */
if ( inf.infotype != HFA384x_IT_LINKSTATUS ) { if ( inf.infotype != HFA384x_IT_LINKSTATUS ) {
/* Not a Link Status info frame: die */ /* Not a Link Status info frame: die */

View File

@ -226,28 +226,6 @@ FILE_LICENCE ( GPL2_ONLY );
#define BIT30 0x40000000 #define BIT30 0x40000000
#define BIT31 0x80000000 #define BIT31 0x80000000
typedef unsigned char UINT8;
typedef unsigned short UINT16;
typedef unsigned long UINT32;
typedef signed char INT8;
typedef signed short INT16;
typedef signed long INT32;
typedef unsigned int UINT;
typedef signed int INT;
typedef unsigned long long UINT64;
typedef signed long long INT64;
#define UINT8_MAX (0xffUL)
#define UINT16_MAX (0xffffUL)
#define UINT32_MAX (0xffffffffUL)
#define INT8_MAX (0x7fL)
#define INT16_MAX (0x7fffL)
#define INT32_MAX (0x7fffffffL)
/*=============================================================*/ /*=============================================================*/
/*------ Compiler Portability Macros --------------------------*/ /*------ Compiler Portability Macros --------------------------*/
/*=============================================================*/ /*=============================================================*/
@ -298,7 +276,7 @@ typedef signed long long INT64;
int __i__; \ int __i__; \
printk(KERN_DEBUG x ":"); \ printk(KERN_DEBUG x ":"); \
for( __i__=0; __i__ < (n); __i__++) \ for( __i__=0; __i__ < (n); __i__++) \
printk( " %02x", ((UINT8*)(p))[__i__]); \ printk( " %02x", ((uint8_t*)(p))[__i__]); \
printk("\n"); } printk("\n"); }
#define DBFENTER { if ( WLAN_DBVAR >= 4 ){ WLAN_LOG_DEBUG0(3,"Enter\n"); } } #define DBFENTER { if ( WLAN_DBVAR >= 4 ){ WLAN_LOG_DEBUG0(3,"Enter\n"); } }