diff options
Diffstat (limited to 'src/drivers/net/p80211hdr.h')
| -rw-r--r-- | src/drivers/net/p80211hdr.h | 102 |
1 files changed, 51 insertions, 51 deletions
diff --git a/src/drivers/net/p80211hdr.h b/src/drivers/net/p80211hdr.h index 110905c5f..6e427293a 100644 --- a/src/drivers/net/p80211hdr.h +++ b/src/drivers/net/p80211hdr.h @@ -39,7 +39,7 @@ * * -------------------------------------------------------------------- * -* Portions of the development of this software were funded by +* Portions of the development of this software were funded by * Intersil Corporation as part of PRISM(R) chipset product development. * * -------------------------------------------------------------------- @@ -47,7 +47,7 @@ * This file declares the constants and types used in the interface * between a wlan driver and the user mode utilities. * -* Note: +* Note: * - Constant values are always in HOST byte order. To assign * values to multi-byte fields they _must_ be converted to * ieee byte order. To retrieve multi-byte values from incoming @@ -117,7 +117,7 @@ FILE_LICENCE ( GPL2_ONLY ); #define WLAN_FSTYPE_ASSOCRESP 0x01 #define WLAN_FSTYPE_REASSOCREQ 0x02 #define WLAN_FSTYPE_REASSOCRESP 0x03 -#define WLAN_FSTYPE_PROBEREQ 0x04 +#define WLAN_FSTYPE_PROBEREQ 0x04 #define WLAN_FSTYPE_PROBERESP 0x05 #define WLAN_FSTYPE_BEACON 0x08 #define WLAN_FSTYPE_ATIM 0x09 @@ -168,29 +168,29 @@ FILE_LICENCE ( GPL2_ONLY ); /* SET_FC_FSTYPE(WLAN_FSTYPE_RTS) ); */ /*------------------------------------------------------------*/ -#define WLAN_GET_FC_PVER(n) (((UINT16)(n)) & (BIT0 | BIT1)) -#define WLAN_GET_FC_FTYPE(n) ((((UINT16)(n)) & (BIT2 | BIT3)) >> 2) -#define WLAN_GET_FC_FSTYPE(n) ((((UINT16)(n)) & (BIT4|BIT5|BIT6|BIT7)) >> 4) -#define WLAN_GET_FC_TODS(n) ((((UINT16)(n)) & (BIT8)) >> 8) -#define WLAN_GET_FC_FROMDS(n) ((((UINT16)(n)) & (BIT9)) >> 9) -#define WLAN_GET_FC_MOREFRAG(n) ((((UINT16)(n)) & (BIT10)) >> 10) -#define WLAN_GET_FC_RETRY(n) ((((UINT16)(n)) & (BIT11)) >> 11) -#define WLAN_GET_FC_PWRMGT(n) ((((UINT16)(n)) & (BIT12)) >> 12) -#define WLAN_GET_FC_MOREDATA(n) ((((UINT16)(n)) & (BIT13)) >> 13) -#define WLAN_GET_FC_ISWEP(n) ((((UINT16)(n)) & (BIT14)) >> 14) -#define WLAN_GET_FC_ORDER(n) ((((UINT16)(n)) & (BIT15)) >> 15) - -#define WLAN_SET_FC_PVER(n) ((UINT16)(n)) -#define WLAN_SET_FC_FTYPE(n) (((UINT16)(n)) << 2) -#define WLAN_SET_FC_FSTYPE(n) (((UINT16)(n)) << 4) -#define WLAN_SET_FC_TODS(n) (((UINT16)(n)) << 8) -#define WLAN_SET_FC_FROMDS(n) (((UINT16)(n)) << 9) -#define WLAN_SET_FC_MOREFRAG(n) (((UINT16)(n)) << 10) -#define WLAN_SET_FC_RETRY(n) (((UINT16)(n)) << 11) -#define WLAN_SET_FC_PWRMGT(n) (((UINT16)(n)) << 12) -#define WLAN_SET_FC_MOREDATA(n) (((UINT16)(n)) << 13) -#define WLAN_SET_FC_ISWEP(n) (((UINT16)(n)) << 14) -#define WLAN_SET_FC_ORDER(n) (((UINT16)(n)) << 15) +#define WLAN_GET_FC_PVER(n) (((uint16_t)(n)) & (BIT0 | BIT1)) +#define WLAN_GET_FC_FTYPE(n) ((((uint16_t)(n)) & (BIT2 | BIT3)) >> 2) +#define WLAN_GET_FC_FSTYPE(n) ((((uint16_t)(n)) & (BIT4|BIT5|BIT6|BIT7)) >> 4) +#define WLAN_GET_FC_TODS(n) ((((uint16_t)(n)) & (BIT8)) >> 8) +#define WLAN_GET_FC_FROMDS(n) ((((uint16_t)(n)) & (BIT9)) >> 9) +#define WLAN_GET_FC_MOREFRAG(n) ((((uint16_t)(n)) & (BIT10)) >> 10) +#define WLAN_GET_FC_RETRY(n) ((((uint16_t)(n)) & (BIT11)) >> 11) +#define WLAN_GET_FC_PWRMGT(n) ((((uint16_t)(n)) & (BIT12)) >> 12) +#define WLAN_GET_FC_MOREDATA(n) ((((uint16_t)(n)) & (BIT13)) >> 13) +#define WLAN_GET_FC_ISWEP(n) ((((uint16_t)(n)) & (BIT14)) >> 14) +#define WLAN_GET_FC_ORDER(n) ((((uint16_t)(n)) & (BIT15)) >> 15) + +#define WLAN_SET_FC_PVER(n) ((uint16_t)(n)) +#define WLAN_SET_FC_FTYPE(n) (((uint16_t)(n)) << 2) +#define WLAN_SET_FC_FSTYPE(n) (((uint16_t)(n)) << 4) +#define WLAN_SET_FC_TODS(n) (((uint16_t)(n)) << 8) +#define WLAN_SET_FC_FROMDS(n) (((uint16_t)(n)) << 9) +#define WLAN_SET_FC_MOREFRAG(n) (((uint16_t)(n)) << 10) +#define WLAN_SET_FC_RETRY(n) (((uint16_t)(n)) << 11) +#define WLAN_SET_FC_PWRMGT(n) (((uint16_t)(n)) << 12) +#define WLAN_SET_FC_MOREDATA(n) (((uint16_t)(n)) << 13) +#define WLAN_SET_FC_ISWEP(n) (((uint16_t)(n)) << 14) +#define WLAN_SET_FC_ORDER(n) (((uint16_t)(n)) << 15) /*--- Duration Macros ----------------------------------------*/ /* 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 */ /* Field. */ /*------------------------------------------------------------*/ -#define WLAN_GET_SEQ_FRGNUM(n) (((UINT16)(n)) & (BIT0|BIT1|BIT2|BIT3)) -#define WLAN_GET_SEQ_SEQNUM(n) ((((UINT16)(n)) & (~(BIT0|BIT1|BIT2|BIT3))) >> 4) +#define WLAN_GET_SEQ_FRGNUM(n) (((uint16_t)(n)) & (BIT0|BIT1|BIT2|BIT3)) +#define WLAN_GET_SEQ_SEQNUM(n) ((((uint16_t)(n)) & (~(BIT0|BIT1|BIT2|BIT3))) >> 4) /*--- 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*/ /*------------------------------------------------------------*/ -#define WLAN_HDR_A3_DATAP(p) (((UINT8*)(p)) + WLAN_HDR_A3_LEN) -#define WLAN_HDR_A4_DATAP(p) (((UINT8*)(p)) + WLAN_HDR_A4_LEN) +#define WLAN_HDR_A3_DATAP(p) (((uint8_t*)(p)) + WLAN_HDR_A3_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 */ /* 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 */ typedef struct p80211_hdr_a3 { - UINT16 fc; - UINT16 dur; - UINT8 a1[WLAN_ADDR_LEN]; - UINT8 a2[WLAN_ADDR_LEN]; - UINT8 a3[WLAN_ADDR_LEN]; - UINT16 seq; + uint16_t fc; + uint16_t dur; + uint8_t a1[WLAN_ADDR_LEN]; + uint8_t a2[WLAN_ADDR_LEN]; + uint8_t a3[WLAN_ADDR_LEN]; + uint16_t seq; } __WLAN_ATTRIB_PACK__ p80211_hdr_a3_t; typedef struct p80211_hdr_a4 { - UINT16 fc; - UINT16 dur; - UINT8 a1[WLAN_ADDR_LEN]; - UINT8 a2[WLAN_ADDR_LEN]; - UINT8 a3[WLAN_ADDR_LEN]; - UINT16 seq; - UINT8 a4[WLAN_ADDR_LEN]; + uint16_t fc; + uint16_t dur; + uint8_t a1[WLAN_ADDR_LEN]; + uint8_t a2[WLAN_ADDR_LEN]; + uint8_t a3[WLAN_ADDR_LEN]; + uint16_t seq; + uint8_t a4[WLAN_ADDR_LEN]; } __WLAN_ATTRIB_PACK__ p80211_hdr_a4_t; typedef union p80211_hdr @@ -273,9 +273,9 @@ typedef union p80211_hdr #define WLAN_FCS_LEN 4 /* 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) ) { case WLAN_FTYPE_MGMT: @@ -288,13 +288,13 @@ inline static UINT16 p80211_headerlen(UINT16 fctl) } break; case WLAN_FTYPE_CTL: - hdrlen = WLAN_CTL_FRAMELEN(WLAN_GET_FC_FSTYPE(fctl)) - - WLAN_FCS_LEN; + hdrlen = WLAN_CTL_FRAMELEN(WLAN_GET_FC_FSTYPE(fctl)) - + WLAN_FCS_LEN; break; default: hdrlen = WLAN_HDR_A3_LEN; } - + return hdrlen; } |
