diff options
Diffstat (limited to 'drivers/staging/vt6655')
74 files changed, 5929 insertions, 6157 deletions
diff --git a/drivers/staging/vt6655/80211hdr.h b/drivers/staging/vt6655/80211hdr.h index b7b170e19aa..f55283b8641 100644 --- a/drivers/staging/vt6655/80211hdr.h +++ b/drivers/staging/vt6655/80211hdr.h @@ -161,21 +161,21 @@ #ifdef __BIG_ENDIAN /* GET & SET Frame Control bit */ -#define WLAN_GET_FC_PRVER(n) ((((WORD)(n) >> 8) & (BIT0 | BIT1)) -#define WLAN_GET_FC_FTYPE(n) ((((WORD)(n) >> 8) & (BIT2 | BIT3)) >> 2) -#define WLAN_GET_FC_FSTYPE(n) ((((WORD)(n) >> 8) & (BIT4|BIT5|BIT6|BIT7)) >> 4) -#define WLAN_GET_FC_TODS(n) ((((WORD)(n) << 8) & (BIT8)) >> 8) -#define WLAN_GET_FC_FROMDS(n) ((((WORD)(n) << 8) & (BIT9)) >> 9) -#define WLAN_GET_FC_MOREFRAG(n) ((((WORD)(n) << 8) & (BIT10)) >> 10) -#define WLAN_GET_FC_RETRY(n) ((((WORD)(n) << 8) & (BIT11)) >> 11) -#define WLAN_GET_FC_PWRMGT(n) ((((WORD)(n) << 8) & (BIT12)) >> 12) -#define WLAN_GET_FC_MOREDATA(n) ((((WORD)(n) << 8) & (BIT13)) >> 13) -#define WLAN_GET_FC_ISWEP(n) ((((WORD)(n) << 8) & (BIT14)) >> 14) -#define WLAN_GET_FC_ORDER(n) ((((WORD)(n) << 8) & (BIT15)) >> 15) +#define WLAN_GET_FC_PRVER(n) ((((unsigned short)(n) >> 8) & (BIT0 | BIT1)) +#define WLAN_GET_FC_FTYPE(n) ((((unsigned short)(n) >> 8) & (BIT2 | BIT3)) >> 2) +#define WLAN_GET_FC_FSTYPE(n) ((((unsigned short)(n) >> 8) & (BIT4|BIT5|BIT6|BIT7)) >> 4) +#define WLAN_GET_FC_TODS(n) ((((unsigned short)(n) << 8) & (BIT8)) >> 8) +#define WLAN_GET_FC_FROMDS(n) ((((unsigned short)(n) << 8) & (BIT9)) >> 9) +#define WLAN_GET_FC_MOREFRAG(n) ((((unsigned short)(n) << 8) & (BIT10)) >> 10) +#define WLAN_GET_FC_RETRY(n) ((((unsigned short)(n) << 8) & (BIT11)) >> 11) +#define WLAN_GET_FC_PWRMGT(n) ((((unsigned short)(n) << 8) & (BIT12)) >> 12) +#define WLAN_GET_FC_MOREDATA(n) ((((unsigned short)(n) << 8) & (BIT13)) >> 13) +#define WLAN_GET_FC_ISWEP(n) ((((unsigned short)(n) << 8) & (BIT14)) >> 14) +#define WLAN_GET_FC_ORDER(n) ((((unsigned short)(n) << 8) & (BIT15)) >> 15) /* Sequence Field bit */ -#define WLAN_GET_SEQ_FRGNUM(n) (((WORD)(n) >> 8) & (BIT0|BIT1|BIT2|BIT3)) -#define WLAN_GET_SEQ_SEQNUM(n) ((((WORD)(n) >> 8) & (~(BIT0|BIT1|BIT2|BIT3))) >> 4) +#define WLAN_GET_SEQ_FRGNUM(n) (((unsigned short)(n) >> 8) & (BIT0|BIT1|BIT2|BIT3)) +#define WLAN_GET_SEQ_SEQNUM(n) ((((unsigned short)(n) >> 8) & (~(BIT0|BIT1|BIT2|BIT3))) >> 4) /* Capability Field bit */ @@ -196,22 +196,22 @@ #else /* GET & SET Frame Control bit */ -#define WLAN_GET_FC_PRVER(n) (((WORD)(n)) & (BIT0 | BIT1)) -#define WLAN_GET_FC_FTYPE(n) ((((WORD)(n)) & (BIT2 | BIT3)) >> 2) -#define WLAN_GET_FC_FSTYPE(n) ((((WORD)(n)) & (BIT4|BIT5|BIT6|BIT7)) >> 4) -#define WLAN_GET_FC_TODS(n) ((((WORD)(n)) & (BIT8)) >> 8) -#define WLAN_GET_FC_FROMDS(n) ((((WORD)(n)) & (BIT9)) >> 9) -#define WLAN_GET_FC_MOREFRAG(n) ((((WORD)(n)) & (BIT10)) >> 10) -#define WLAN_GET_FC_RETRY(n) ((((WORD)(n)) & (BIT11)) >> 11) -#define WLAN_GET_FC_PWRMGT(n) ((((WORD)(n)) & (BIT12)) >> 12) -#define WLAN_GET_FC_MOREDATA(n) ((((WORD)(n)) & (BIT13)) >> 13) -#define WLAN_GET_FC_ISWEP(n) ((((WORD)(n)) & (BIT14)) >> 14) -#define WLAN_GET_FC_ORDER(n) ((((WORD)(n)) & (BIT15)) >> 15) +#define WLAN_GET_FC_PRVER(n) (((unsigned short)(n)) & (BIT0 | BIT1)) +#define WLAN_GET_FC_FTYPE(n) ((((unsigned short)(n)) & (BIT2 | BIT3)) >> 2) +#define WLAN_GET_FC_FSTYPE(n) ((((unsigned short)(n)) & (BIT4|BIT5|BIT6|BIT7)) >> 4) +#define WLAN_GET_FC_TODS(n) ((((unsigned short)(n)) & (BIT8)) >> 8) +#define WLAN_GET_FC_FROMDS(n) ((((unsigned short)(n)) & (BIT9)) >> 9) +#define WLAN_GET_FC_MOREFRAG(n) ((((unsigned short)(n)) & (BIT10)) >> 10) +#define WLAN_GET_FC_RETRY(n) ((((unsigned short)(n)) & (BIT11)) >> 11) +#define WLAN_GET_FC_PWRMGT(n) ((((unsigned short)(n)) & (BIT12)) >> 12) +#define WLAN_GET_FC_MOREDATA(n) ((((unsigned short)(n)) & (BIT13)) >> 13) +#define WLAN_GET_FC_ISWEP(n) ((((unsigned short)(n)) & (BIT14)) >> 14) +#define WLAN_GET_FC_ORDER(n) ((((unsigned short)(n)) & (BIT15)) >> 15) /* Sequence Field bit */ -#define WLAN_GET_SEQ_FRGNUM(n) (((WORD)(n)) & (BIT0|BIT1|BIT2|BIT3)) -#define WLAN_GET_SEQ_SEQNUM(n) ((((WORD)(n)) & (~(BIT0|BIT1|BIT2|BIT3))) >> 4) +#define WLAN_GET_SEQ_FRGNUM(n) (((unsigned short)(n)) & (BIT0|BIT1|BIT2|BIT3)) +#define WLAN_GET_SEQ_SEQNUM(n) ((((unsigned short)(n)) & (~(BIT0|BIT1|BIT2|BIT3))) >> 4) /* Capability Field bit */ @@ -246,20 +246,20 @@ #define WLAN_SET_CAP_INFO_GRPACK(n) ((n) << 14) -#define WLAN_SET_FC_PRVER(n) ((WORD)(n)) -#define WLAN_SET_FC_FTYPE(n) (((WORD)(n)) << 2) -#define WLAN_SET_FC_FSTYPE(n) (((WORD)(n)) << 4) -#define WLAN_SET_FC_TODS(n) (((WORD)(n)) << 8) -#define WLAN_SET_FC_FROMDS(n) (((WORD)(n)) << 9) -#define WLAN_SET_FC_MOREFRAG(n) (((WORD)(n)) << 10) -#define WLAN_SET_FC_RETRY(n) (((WORD)(n)) << 11) -#define WLAN_SET_FC_PWRMGT(n) (((WORD)(n)) << 12) -#define WLAN_SET_FC_MOREDATA(n) (((WORD)(n)) << 13) -#define WLAN_SET_FC_ISWEP(n) (((WORD)(n)) << 14) -#define WLAN_SET_FC_ORDER(n) (((WORD)(n)) << 15) +#define WLAN_SET_FC_PRVER(n) ((unsigned short)(n)) +#define WLAN_SET_FC_FTYPE(n) (((unsigned short)(n)) << 2) +#define WLAN_SET_FC_FSTYPE(n) (((unsigned short)(n)) << 4) +#define WLAN_SET_FC_TODS(n) (((unsigned short)(n)) << 8) +#define WLAN_SET_FC_FROMDS(n) (((unsigned short)(n)) << 9) +#define WLAN_SET_FC_MOREFRAG(n) (((unsigned short)(n)) << 10) +#define WLAN_SET_FC_RETRY(n) (((unsigned short)(n)) << 11) +#define WLAN_SET_FC_PWRMGT(n) (((unsigned short)(n)) << 12) +#define WLAN_SET_FC_MOREDATA(n) (((unsigned short)(n)) << 13) +#define WLAN_SET_FC_ISWEP(n) (((unsigned short)(n)) << 14) +#define WLAN_SET_FC_ORDER(n) (((unsigned short)(n)) << 15) -#define WLAN_SET_SEQ_FRGNUM(n) ((WORD)(n)) -#define WLAN_SET_SEQ_SEQNUM(n) (((WORD)(n)) << 4) +#define WLAN_SET_SEQ_FRGNUM(n) ((unsigned short)(n)) +#define WLAN_SET_SEQ_SEQNUM(n) (((unsigned short)(n)) << 4) /* ERP Field bit */ @@ -282,50 +282,50 @@ #define WLAN_MGMT_GET_TIM_OFFSET(b) (((b) & ~BIT0) >> 1) /* 3-Addr & 4-Addr */ -#define WLAN_HDR_A3_DATA_PTR(p) (((PBYTE)(p)) + WLAN_HDR_ADDR3_LEN) -#define WLAN_HDR_A4_DATA_PTR(p) (((PBYTE)(p)) + WLAN_HDR_ADDR4_LEN) +#define WLAN_HDR_A3_DATA_PTR(p) (((unsigned char *)(p)) + WLAN_HDR_ADDR3_LEN) +#define WLAN_HDR_A4_DATA_PTR(p) (((unsigned char *)(p)) + WLAN_HDR_ADDR4_LEN) /* IEEE ADDR */ #define IEEE_ADDR_UNIVERSAL 0x02 #define IEEE_ADDR_GROUP 0x01 typedef struct { - BYTE abyAddr[6]; + unsigned char abyAddr[6]; } IEEE_ADDR, *PIEEE_ADDR; /* 802.11 Header Format */ typedef struct tagWLAN_80211HDR_A2 { - WORD wFrameCtl; - WORD wDurationID; - BYTE abyAddr1[WLAN_ADDR_LEN]; - BYTE abyAddr2[WLAN_ADDR_LEN]; + unsigned short wFrameCtl; + unsigned short wDurationID; + unsigned char abyAddr1[WLAN_ADDR_LEN]; + unsigned char abyAddr2[WLAN_ADDR_LEN]; } __attribute__ ((__packed__)) WLAN_80211HDR_A2, *PWLAN_80211HDR_A2; typedef struct tagWLAN_80211HDR_A3 { - WORD wFrameCtl; - WORD wDurationID; - BYTE abyAddr1[WLAN_ADDR_LEN]; - BYTE abyAddr2[WLAN_ADDR_LEN]; - BYTE abyAddr3[WLAN_ADDR_LEN]; - WORD wSeqCtl; + unsigned short wFrameCtl; + unsigned short wDurationID; + unsigned char abyAddr1[WLAN_ADDR_LEN]; + unsigned char abyAddr2[WLAN_ADDR_LEN]; + unsigned char abyAddr3[WLAN_ADDR_LEN]; + unsigned short wSeqCtl; }__attribute__ ((__packed__)) WLAN_80211HDR_A3, *PWLAN_80211HDR_A3; typedef struct tagWLAN_80211HDR_A4 { - WORD wFrameCtl; - WORD wDurationID; - BYTE abyAddr1[WLAN_ADDR_LEN]; - BYTE abyAddr2[WLAN_ADDR_LEN]; - BYTE abyAddr3[WLAN_ADDR_LEN]; - WORD wSeqCtl; - BYTE abyAddr4[WLAN_ADDR_LEN]; + unsigned short wFrameCtl; + unsigned short wDurationID; + unsigned char abyAddr1[WLAN_ADDR_LEN]; + unsigned char abyAddr2[WLAN_ADDR_LEN]; + unsigned char abyAddr3[WLAN_ADDR_LEN]; + unsigned short wSeqCtl; + unsigned char abyAddr4[WLAN_ADDR_LEN]; } __attribute__ ((__packed__)) WLAN_80211HDR_A4, *PWLAN_80211HDR_A4; diff --git a/drivers/staging/vt6655/80211mgr.c b/drivers/staging/vt6655/80211mgr.c index 38697c86248..1ed0f260b16 100644 --- a/drivers/staging/vt6655/80211mgr.c +++ b/drivers/staging/vt6655/80211mgr.c @@ -99,9 +99,9 @@ vMgrEncodeBeacon( // Fixed Fields pFrame->pqwTimestamp = (PQWORD)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3)) + WLAN_BEACON_OFF_TS); - pFrame->pwBeaconInterval = (PWORD)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3)) + pFrame->pwBeaconInterval = (unsigned short *)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3)) + WLAN_BEACON_OFF_BCN_INT); - pFrame->pwCapInfo = (PWORD)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3)) + pFrame->pwCapInfo = (unsigned short *)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3)) + WLAN_BEACON_OFF_CAPINFO); pFrame->len = WLAN_HDR_ADDR3_LEN + WLAN_BEACON_OFF_SSID; @@ -133,15 +133,15 @@ vMgrDecodeBeacon( // Fixed Fields pFrame->pqwTimestamp = (PQWORD)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3)) + WLAN_BEACON_OFF_TS); - pFrame->pwBeaconInterval = (PWORD)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3)) + pFrame->pwBeaconInterval = (unsigned short *)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3)) + WLAN_BEACON_OFF_BCN_INT); - pFrame->pwCapInfo = (PWORD)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3)) + pFrame->pwCapInfo = (unsigned short *)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3)) + WLAN_BEACON_OFF_CAPINFO); // Information elements - pItem = (PWLAN_IE)((PBYTE)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3))) + pItem = (PWLAN_IE)((unsigned char *)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3))) + WLAN_BEACON_OFF_SSID); - while( ((PBYTE)pItem) < (pFrame->pBuf + pFrame->len) ){ + while( ((unsigned char *)pItem) < (pFrame->pBuf + pFrame->len) ){ switch (pItem->byElementID) { case WLAN_EID_SSID: @@ -179,7 +179,7 @@ vMgrDecodeBeacon( break; case WLAN_EID_RSN_WPA: if (pFrame->pRSNWPA == NULL) { - if (WPAb_Is_RSN((PWLAN_IE_RSN_EXT)pItem) == TRUE) + if (WPAb_Is_RSN((PWLAN_IE_RSN_EXT)pItem) == true) pFrame->pRSNWPA = (PWLAN_IE_RSN_EXT)pItem; } break; @@ -223,7 +223,7 @@ vMgrDecodeBeacon( break; } - pItem = (PWLAN_IE)(((PBYTE)pItem) + 2 + pItem->len); + pItem = (PWLAN_IE)(((unsigned char *)pItem) + 2 + pItem->len); } return; @@ -296,7 +296,7 @@ vMgrEncodeDisassociation( // Fixed Fields - pFrame->pwReason = (PWORD)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3)) + pFrame->pwReason = (unsigned short *)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3)) + WLAN_DISASSOC_OFF_REASON); pFrame->len = WLAN_HDR_ADDR3_LEN + WLAN_DISASSOC_OFF_REASON + sizeof(*(pFrame->pwReason)); @@ -323,7 +323,7 @@ vMgrDecodeDisassociation( pFrame->pHdr = (PUWLAN_80211HDR)pFrame->pBuf; // Fixed Fields - pFrame->pwReason = (PWORD)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3)) + pFrame->pwReason = (unsigned short *)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3)) + WLAN_DISASSOC_OFF_REASON); return; @@ -348,9 +348,9 @@ vMgrEncodeAssocRequest( { pFrame->pHdr = (PUWLAN_80211HDR)pFrame->pBuf; // Fixed Fields - pFrame->pwCapInfo = (PWORD)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3)) + pFrame->pwCapInfo = (unsigned short *)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3)) + WLAN_ASSOCREQ_OFF_CAP_INFO); - pFrame->pwListenInterval = (PWORD)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3)) + pFrame->pwListenInterval = (unsigned short *)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3)) + WLAN_ASSOCREQ_OFF_LISTEN_INT); pFrame->len = WLAN_HDR_ADDR3_LEN + WLAN_ASSOCREQ_OFF_LISTEN_INT + sizeof(*(pFrame->pwListenInterval)); return; @@ -377,16 +377,16 @@ vMgrDecodeAssocRequest( pFrame->pHdr = (PUWLAN_80211HDR)pFrame->pBuf; // Fixed Fields - pFrame->pwCapInfo = (PWORD)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3)) + pFrame->pwCapInfo = (unsigned short *)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3)) + WLAN_ASSOCREQ_OFF_CAP_INFO); - pFrame->pwListenInterval = (PWORD)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3)) + pFrame->pwListenInterval = (unsigned short *)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3)) + WLAN_ASSOCREQ_OFF_LISTEN_INT); // Information elements pItem = (PWLAN_IE)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3)) + WLAN_ASSOCREQ_OFF_SSID); - while (((PBYTE)pItem) < (pFrame->pBuf + pFrame->len)) { + while (((unsigned char *)pItem) < (pFrame->pBuf + pFrame->len)) { switch (pItem->byElementID){ case WLAN_EID_SSID: if (pFrame->pSSID == NULL) @@ -404,7 +404,7 @@ vMgrDecodeAssocRequest( break; case WLAN_EID_RSN_WPA: if (pFrame->pRSNWPA == NULL) { - if (WPAb_Is_RSN((PWLAN_IE_RSN_EXT)pItem) == TRUE) + if (WPAb_Is_RSN((PWLAN_IE_RSN_EXT)pItem) == true) pFrame->pRSNWPA = (PWLAN_IE_RSN_EXT)pItem; } break; @@ -418,7 +418,7 @@ vMgrDecodeAssocRequest( pItem->byElementID); break; } - pItem = (PWLAN_IE)(((PBYTE)pItem) + 2 + pItem->len); + pItem = (PWLAN_IE)(((unsigned char *)pItem) + 2 + pItem->len); } return; } @@ -442,11 +442,11 @@ vMgrEncodeAssocResponse( pFrame->pHdr = (PUWLAN_80211HDR)pFrame->pBuf; // Fixed Fields - pFrame->pwCapInfo = (PWORD)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3)) + pFrame->pwCapInfo = (unsigned short *)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3)) + WLAN_ASSOCRESP_OFF_CAP_INFO); - pFrame->pwStatus = (PWORD)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3)) + pFrame->pwStatus = (unsigned short *)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3)) + WLAN_ASSOCRESP_OFF_STATUS); - pFrame->pwAid = (PWORD)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3)) + pFrame->pwAid = (unsigned short *)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3)) + WLAN_ASSOCRESP_OFF_AID); pFrame->len = WLAN_HDR_ADDR3_LEN + WLAN_ASSOCRESP_OFF_AID + sizeof(*(pFrame->pwAid)); @@ -476,11 +476,11 @@ vMgrDecodeAssocResponse( pFrame->pHdr = (PUWLAN_80211HDR)pFrame->pBuf; // Fixed Fields - pFrame->pwCapInfo = (PWORD)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3)) + pFrame->pwCapInfo = (unsigned short *)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3)) + WLAN_ASSOCRESP_OFF_CAP_INFO); - pFrame->pwStatus = (PWORD)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3)) + pFrame->pwStatus = (unsigned short *)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3)) + WLAN_ASSOCRESP_OFF_STATUS); - pFrame->pwAid = (PWORD)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3)) + pFrame->pwAid = (unsigned short *)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3)) + WLAN_ASSOCRESP_OFF_AID); // Information elements @@ -488,9 +488,10 @@ vMgrDecodeAssocResponse( + WLAN_ASSOCRESP_OFF_SUPP_RATES); pItem = (PWLAN_IE)(pFrame->pSuppRates); - pItem = (PWLAN_IE)(((PBYTE)pItem) + 2 + pItem->len); + pItem = (PWLAN_IE)(((unsigned char *)pItem) + 2 + pItem->len); - if ((((PBYTE)pItem) < (pFrame->pBuf + pFrame->len)) && (pItem->byElementID == WLAN_EID_EXTSUPP_RATES)) { + if ((((unsigned char *)pItem) < (pFrame->pBuf + pFrame->len)) && + (pItem->byElementID == WLAN_EID_EXTSUPP_RATES)) { pFrame->pExtSuppRates = (PWLAN_IE_SUPP_RATES)pItem; DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "pFrame->pExtSuppRates=[%p].\n", pItem); } @@ -520,9 +521,9 @@ vMgrEncodeReassocRequest( pFrame->pHdr = (PUWLAN_80211HDR)pFrame->pBuf; // Fixed Fields - pFrame->pwCapInfo = (PWORD)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3)) + pFrame->pwCapInfo = (unsigned short *)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3)) + WLAN_REASSOCREQ_OFF_CAP_INFO); - pFrame->pwListenInterval = (PWORD)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3)) + pFrame->pwListenInterval = (unsigned short *)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3)) + WLAN_REASSOCREQ_OFF_LISTEN_INT); pFrame->pAddrCurrAP = (PIEEE_ADDR)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3)) + WLAN_REASSOCREQ_OFF_CURR_AP); @@ -553,9 +554,9 @@ vMgrDecodeReassocRequest( pFrame->pHdr = (PUWLAN_80211HDR)pFrame->pBuf; // Fixed Fields - pFrame->pwCapInfo = (PWORD)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3)) + pFrame->pwCapInfo = (unsigned short *)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3)) + WLAN_REASSOCREQ_OFF_CAP_INFO); - pFrame->pwListenInterval = (PWORD)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3)) + pFrame->pwListenInterval = (unsigned short *)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3)) + WLAN_REASSOCREQ_OFF_LISTEN_INT); pFrame->pAddrCurrAP = (PIEEE_ADDR)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3)) + WLAN_REASSOCREQ_OFF_CURR_AP); @@ -564,7 +565,7 @@ vMgrDecodeReassocRequest( pItem = (PWLAN_IE)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3)) + WLAN_REASSOCREQ_OFF_SSID); - while(((PBYTE)pItem) < (pFrame->pBuf + pFrame->len)) { + while(((unsigned char *)pItem) < (pFrame->pBuf + pFrame->len)) { switch (pItem->byElementID){ case WLAN_EID_SSID: @@ -583,7 +584,7 @@ vMgrDecodeReassocRequest( break; case WLAN_EID_RSN_WPA: if (pFrame->pRSNWPA == NULL) { - if (WPAb_Is_RSN((PWLAN_IE_RSN_EXT)pItem) == TRUE) + if (WPAb_Is_RSN((PWLAN_IE_RSN_EXT)pItem) == true) pFrame->pRSNWPA = (PWLAN_IE_RSN_EXT)pItem; } break; @@ -597,7 +598,7 @@ vMgrDecodeReassocRequest( pItem->byElementID); break; } - pItem = (PWLAN_IE)(((PBYTE)pItem) + 2 + pItem->len); + pItem = (PWLAN_IE)(((unsigned char *)pItem) + 2 + pItem->len); } return; } @@ -649,7 +650,7 @@ vMgrDecodeProbeRequest( // Information elements pItem = (PWLAN_IE)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3))); - while( ((PBYTE)pItem) < (pFrame->pBuf + pFrame->len) ) { + while( ((unsigned char *)pItem) < (pFrame->pBuf + pFrame->len) ) { switch (pItem->byElementID) { case WLAN_EID_SSID: @@ -672,7 +673,7 @@ vMgrDecodeProbeRequest( break; } - pItem = (PWLAN_IE)(((PBYTE)pItem) + 2 + pItem->len); + pItem = (PWLAN_IE)(((unsigned char *)pItem) + 2 + pItem->len); } return; } @@ -700,9 +701,9 @@ vMgrEncodeProbeResponse( // Fixed Fields pFrame->pqwTimestamp = (PQWORD)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3)) + WLAN_PROBERESP_OFF_TS); - pFrame->pwBeaconInterval = (PWORD)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3)) + pFrame->pwBeaconInterval = (unsigned short *)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3)) + WLAN_PROBERESP_OFF_BCN_INT); - pFrame->pwCapInfo = (PWORD)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3)) + pFrame->pwCapInfo = (unsigned short *)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3)) + WLAN_PROBERESP_OFF_CAP_INFO); pFrame->len = WLAN_HDR_ADDR3_LEN + WLAN_PROBERESP_OFF_CAP_INFO + @@ -737,16 +738,16 @@ vMgrDecodeProbeResponse( // Fixed Fields pFrame->pqwTimestamp = (PQWORD)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3)) + WLAN_PROBERESP_OFF_TS); - pFrame->pwBeaconInterval = (PWORD)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3)) + pFrame->pwBeaconInterval = (unsigned short *)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3)) + WLAN_PROBERESP_OFF_BCN_INT); - pFrame->pwCapInfo = (PWORD)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3)) + pFrame->pwCapInfo = (unsigned short *)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3)) + WLAN_PROBERESP_OFF_CAP_INFO); // Information elements pItem = (PWLAN_IE)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3)) + WLAN_PROBERESP_OFF_SSID); - while( ((PBYTE)pItem) < (pFrame->pBuf + pFrame->len) ) { + while( ((unsigned char *)pItem) < (pFrame->pBuf + pFrame->len) ) { switch (pItem->byElementID) { case WLAN_EID_SSID: if (pFrame->pSSID == NULL) @@ -778,7 +779,7 @@ vMgrDecodeProbeResponse( break; case WLAN_EID_RSN_WPA: if (pFrame->pRSNWPA == NULL) { - if (WPAb_Is_RSN((PWLAN_IE_RSN_EXT)pItem) == TRUE) + if (WPAb_Is_RSN((PWLAN_IE_RSN_EXT)pItem) == true) pFrame->pRSNWPA = (PWLAN_IE_RSN_EXT)pItem; } break; @@ -821,7 +822,7 @@ vMgrDecodeProbeResponse( break; } - pItem = (PWLAN_IE)(((PBYTE)pItem) + 2 + pItem->len); + pItem = (PWLAN_IE)(((unsigned char *)pItem) + 2 + pItem->len); } return; } @@ -846,11 +847,11 @@ vMgrEncodeAuthen( pFrame->pHdr = (PUWLAN_80211HDR)pFrame->pBuf; // Fixed Fields - pFrame->pwAuthAlgorithm = (PWORD)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3)) + pFrame->pwAuthAlgorithm = (unsigned short *)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3)) + WLAN_AUTHEN_OFF_AUTH_ALG); - pFrame->pwAuthSequence = (PWORD)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3)) + pFrame->pwAuthSequence = (unsigned short *)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3)) + WLAN_AUTHEN_OFF_AUTH_SEQ); - pFrame->pwStatus = (PWORD)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3)) + pFrame->pwStatus = (unsigned short *)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3)) + WLAN_AUTHEN_OFF_STATUS); pFrame->len = WLAN_HDR_ADDR3_LEN + WLAN_AUTHEN_OFF_STATUS + sizeof(*(pFrame->pwStatus)); @@ -879,18 +880,18 @@ vMgrDecodeAuthen( pFrame->pHdr = (PUWLAN_80211HDR)pFrame->pBuf; // Fixed Fields - pFrame->pwAuthAlgorithm = (PWORD)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3)) + pFrame->pwAuthAlgorithm = (unsigned short *)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3)) + WLAN_AUTHEN_OFF_AUTH_ALG); - pFrame->pwAuthSequence = (PWORD)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3)) + pFrame->pwAuthSequence = (unsigned short *)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3)) + WLAN_AUTHEN_OFF_AUTH_SEQ); - pFrame->pwStatus = (PWORD)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3)) + pFrame->pwStatus = (unsigned short *)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3)) + WLAN_AUTHEN_OFF_STATUS); // Information elements pItem = (PWLAN_IE)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3)) + WLAN_AUTHEN_OFF_CHALLENGE); - if ((((PBYTE)pItem) < (pFrame->pBuf + pFrame->len)) && (pItem->byElementID == WLAN_EID_CHALLENGE)) { + if ((((unsigned char *)pItem) < (pFrame->pBuf + pFrame->len)) && (pItem->byElementID == WLAN_EID_CHALLENGE)) { pFrame->pChallenge = (PWLAN_IE_CHALLENGE)pItem; } @@ -917,7 +918,7 @@ vMgrEncodeDeauthen( pFrame->pHdr = (PUWLAN_80211HDR)pFrame->pBuf; // Fixed Fields - pFrame->pwReason = (PWORD)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3)) + pFrame->pwReason = (unsigned short *)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3)) + WLAN_DEAUTHEN_OFF_REASON); pFrame->len = WLAN_HDR_ADDR3_LEN + WLAN_DEAUTHEN_OFF_REASON + sizeof(*(pFrame->pwReason)); @@ -944,7 +945,7 @@ vMgrDecodeDeauthen( pFrame->pHdr = (PUWLAN_80211HDR)pFrame->pBuf; // Fixed Fields - pFrame->pwReason = (PWORD)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3)) + pFrame->pwReason = (unsigned short *)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3)) + WLAN_DEAUTHEN_OFF_REASON); return; @@ -970,11 +971,11 @@ vMgrEncodeReassocResponse( pFrame->pHdr = (PUWLAN_80211HDR)pFrame->pBuf; // Fixed Fields - pFrame->pwCapInfo = (PWORD)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3)) + pFrame->pwCapInfo = (unsigned short *)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3)) + WLAN_REASSOCRESP_OFF_CAP_INFO); - pFrame->pwStatus = (PWORD)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3)) + pFrame->pwStatus = (unsigned short *)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3)) + WLAN_REASSOCRESP_OFF_STATUS); - pFrame->pwAid = (PWORD)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3)) + pFrame->pwAid = (unsigned short *)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3)) + WLAN_REASSOCRESP_OFF_AID); pFrame->len = WLAN_HDR_ADDR3_LEN + WLAN_REASSOCRESP_OFF_AID + sizeof(*(pFrame->pwAid)); @@ -1005,11 +1006,11 @@ vMgrDecodeReassocResponse( pFrame->pHdr = (PUWLAN_80211HDR)pFrame->pBuf; // Fixed Fields - pFrame->pwCapInfo = (PWORD)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3)) + pFrame->pwCapInfo = (unsigned short *)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3)) + WLAN_REASSOCRESP_OFF_CAP_INFO); - pFrame->pwStatus = (PWORD)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3)) + pFrame->pwStatus = (unsigned short *)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3)) + WLAN_REASSOCRESP_OFF_STATUS); - pFrame->pwAid = (PWORD)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3)) + pFrame->pwAid = (unsigned short *)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3)) + WLAN_REASSOCRESP_OFF_AID); //Information elements @@ -1017,9 +1018,10 @@ vMgrDecodeReassocResponse( + WLAN_REASSOCRESP_OFF_SUPP_RATES); pItem = (PWLAN_IE)(pFrame->pSuppRates); - pItem = (PWLAN_IE)(((PBYTE)pItem) + 2 + pItem->len); + pItem = (PWLAN_IE)(((unsigned char *)pItem) + 2 + pItem->len); - if ((((PBYTE)pItem) < (pFrame->pBuf + pFrame->len)) && (pItem->byElementID == WLAN_EID_EXTSUPP_RATES)) { + if ((((unsigned char *)pItem) < (pFrame->pBuf + pFrame->len)) && + (pItem->byElementID == WLAN_EID_EXTSUPP_RATES)) { pFrame->pExtSuppRates = (PWLAN_IE_SUPP_RATES)pItem; } return; diff --git a/drivers/staging/vt6655/80211mgr.h b/drivers/staging/vt6655/80211mgr.h index 658fe144f89..3bdab3f56f1 100644 --- a/drivers/staging/vt6655/80211mgr.h +++ b/drivers/staging/vt6655/80211mgr.h @@ -19,7 +19,7 @@ * * File: 80211mgr.h * - * Purpose: 802.11 managment frames pre-defines. + * Purpose: 802.11 management frames pre-defines. * * * Author: Lyndon Chen @@ -230,8 +230,8 @@ #pragma pack(1) typedef struct tagWLAN_IE { - BYTE byElementID; - BYTE len; + unsigned char byElementID; + unsigned char len; }__attribute__ ((__packed__)) WLAN_IE, *PWLAN_IE; @@ -239,9 +239,9 @@ WLAN_IE, *PWLAN_IE; // Service Set Identity (SSID) #pragma pack(1) typedef struct tagWLAN_IE_SSID { - BYTE byElementID; - BYTE len; - BYTE abySSID[1]; + unsigned char byElementID; + unsigned char len; + unsigned char abySSID[1]; }__attribute__ ((__packed__)) WLAN_IE_SSID, *PWLAN_IE_SSID; @@ -249,9 +249,9 @@ WLAN_IE_SSID, *PWLAN_IE_SSID; // Supported Rates #pragma pack(1) typedef struct tagWLAN_IE_SUPP_RATES { - BYTE byElementID; - BYTE len; - BYTE abyRates[1]; + unsigned char byElementID; + unsigned char len; + unsigned char abyRates[1]; }__attribute__ ((__packed__)) WLAN_IE_SUPP_RATES, *PWLAN_IE_SUPP_RATES; @@ -260,20 +260,20 @@ WLAN_IE_SUPP_RATES, *PWLAN_IE_SUPP_RATES; // FH Parameter Set #pragma pack(1) typedef struct _WLAN_IE_FH_PARMS { - BYTE byElementID; - BYTE len; - WORD wDwellTime; - BYTE byHopSet; - BYTE byHopPattern; - BYTE byHopIndex; + unsigned char byElementID; + unsigned char len; + unsigned short wDwellTime; + unsigned char byHopSet; + unsigned char byHopPattern; + unsigned char byHopIndex; } WLAN_IE_FH_PARMS, *PWLAN_IE_FH_PARMS; // DS Parameter Set #pragma pack(1) typedef struct tagWLAN_IE_DS_PARMS { - BYTE byElementID; - BYTE len; - BYTE byCurrChannel; + unsigned char byElementID; + unsigned char len; + unsigned char byCurrChannel; }__attribute__ ((__packed__)) WLAN_IE_DS_PARMS, *PWLAN_IE_DS_PARMS; @@ -281,12 +281,12 @@ WLAN_IE_DS_PARMS, *PWLAN_IE_DS_PARMS; // CF Parameter Set #pragma pack(1) typedef struct tagWLAN_IE_CF_PARMS { - BYTE byElementID; - BYTE len; - BYTE byCFPCount; - BYTE byCFPPeriod; - WORD wCFPMaxDuration; - WORD wCFPDurRemaining; + unsigned char byElementID; + unsigned char len; + unsigned char byCFPCount; + unsigned char byCFPPeriod; + unsigned short wCFPMaxDuration; + unsigned short wCFPDurRemaining; }__attribute__ ((__packed__)) WLAN_IE_CF_PARMS, *PWLAN_IE_CF_PARMS; @@ -294,12 +294,12 @@ WLAN_IE_CF_PARMS, *PWLAN_IE_CF_PARMS; // TIM #pragma pack(1) typedef struct tagWLAN_IE_TIM { - BYTE byElementID; - BYTE len; - BYTE byDTIMCount; - BYTE byDTIMPeriod; - BYTE byBitMapCtl; - BYTE byVirtBitMap[1]; + unsigned char byElementID; + unsigned char len; + unsigned char byDTIMCount; + unsigned char byDTIMPeriod; + unsigned char byBitMapCtl; + unsigned char byVirtBitMap[1]; }__attribute__ ((__packed__)) WLAN_IE_TIM, *PWLAN_IE_TIM; @@ -307,9 +307,9 @@ WLAN_IE_TIM, *PWLAN_IE_TIM; // IBSS Parameter Set #pragma pack(1) typedef struct tagWLAN_IE_IBSS_PARMS { - BYTE byElementID; - BYTE len; - WORD wATIMWindow; + unsigned char byElementID; + unsigned char len; + unsigned short wATIMWindow; }__attribute__ ((__packed__)) WLAN_IE_IBSS_PARMS, *PWLAN_IE_IBSS_PARMS; @@ -317,84 +317,84 @@ WLAN_IE_IBSS_PARMS, *PWLAN_IE_IBSS_PARMS; // Challenge Text #pragma pack(1) typedef struct tagWLAN_IE_CHALLENGE { - BYTE byElementID; - BYTE len; - BYTE abyChallenge[1]; + unsigned char byElementID; + unsigned char len; + unsigned char abyChallenge[1]; }__attribute__ ((__packed__)) WLAN_IE_CHALLENGE, *PWLAN_IE_CHALLENGE; #pragma pack(1) typedef struct tagWLAN_IE_RSN_EXT { - BYTE byElementID; - BYTE len; - BYTE abyOUI[4]; - WORD wVersion; - BYTE abyMulticast[4]; - WORD wPKCount; + unsigned char byElementID; + unsigned char len; + unsigned char abyOUI[4]; + unsigned short wVersion; + unsigned char abyMulticast[4]; + unsigned short wPKCount; struct { - BYTE abyOUI[4]; + unsigned char abyOUI[4]; } PKSList[1]; // the rest is variable so need to // overlay ieauth structure } WLAN_IE_RSN_EXT, *PWLAN_IE_RSN_EXT; #pragma pack(1) typedef struct tagWLAN_IE_RSN_AUTH { - WORD wAuthCount; + unsigned short wAuthCount; struct { - BYTE abyOUI[4]; + unsigned char abyOUI[4]; } AuthKSList[1]; } WLAN_IE_RSN_AUTH, *PWLAN_IE_RSN_AUTH; // RSN Identity #pragma pack(1) typedef struct tagWLAN_IE_RSN { - BYTE byElementID; - BYTE len; - WORD wVersion; - BYTE abyRSN[WLAN_MIN_ARRAY]; + unsigned char byElementID; + unsigned char len; + unsigned short wVersion; + unsigned char abyRSN[WLAN_MIN_ARRAY]; } WLAN_IE_RSN, *PWLAN_IE_RSN; // ERP #pragma pack(1) typedef struct tagWLAN_IE_ERP { - BYTE byElementID; - BYTE len; - BYTE byContext; + unsigned char byElementID; + unsigned char len; + unsigned char byContext; }__attribute__ ((__packed__)) WLAN_IE_ERP, *PWLAN_IE_ERP; #pragma pack(1) typedef struct _MEASEURE_REQ { - BYTE byChannel; - BYTE abyStartTime[8]; - BYTE abyDuration[2]; + unsigned char byChannel; + unsigned char abyStartTime[8]; + unsigned char abyDuration[2]; } MEASEURE_REQ, *PMEASEURE_REQ, MEASEURE_REQ_BASIC, *PMEASEURE_REQ_BASIC, MEASEURE_REQ_CCA, *PMEASEURE_REQ_CCA, MEASEURE_REQ_RPI, *PMEASEURE_REQ_RPI; typedef struct _MEASEURE_REP_BASIC { - BYTE byChannel; - BYTE abyStartTime[8]; - BYTE abyDuration[2]; - BYTE byMap; + unsigned char byChannel; + unsigned char abyStartTime[8]; + unsigned char abyDuration[2]; + unsigned char byMap; } MEASEURE_REP_BASIC, *PMEASEURE_REP_BASIC; typedef struct _MEASEURE_REP_CCA { - BYTE byChannel; - BYTE abyStartTime[8]; - BYTE abyDuration[2]; - BYTE byCCABusyFraction; + unsigned char byChannel; + unsigned char abyStartTime[8]; + unsigned char abyDuration[2]; + unsigned char byCCABusyFraction; } MEASEURE_REP_CCA, *PMEASEURE_REP_CCA; typedef struct _MEASEURE_REP_RPI { - BYTE byChannel; - BYTE abyStartTime[8]; - BYTE abyDuration[2]; - BYTE abyRPIdensity[8]; + unsigned char byChannel; + unsigned char abyStartTime[8]; + unsigned char abyDuration[2]; + unsigned char abyRPIdensity[8]; } MEASEURE_REP_RPI, *PMEASEURE_REP_RPI; typedef union _MEASEURE_REP { @@ -406,85 +406,85 @@ typedef union _MEASEURE_REP { } MEASEURE_REP, *PMEASEURE_REP; typedef struct _WLAN_IE_MEASURE_REQ { - BYTE byElementID; - BYTE len; - BYTE byToken; - BYTE byMode; - BYTE byType; + unsigned char byElementID; + unsigned char len; + unsigned char byToken; + unsigned char byMode; + unsigned char byType; MEASEURE_REQ sReq; } WLAN_IE_MEASURE_REQ, *PWLAN_IE_MEASURE_REQ; typedef struct _WLAN_IE_MEASURE_REP { - BYTE byElementID; - BYTE len; - BYTE byToken; - BYTE byMode; - BYTE byType; + unsigned char byElementID; + unsigned char len; + unsigned char byToken; + unsigned char byMode; + unsigned char byType; MEASEURE_REP sRep; } WLAN_IE_MEASURE_REP, *PWLAN_IE_MEASURE_REP; typedef struct _WLAN_IE_CH_SW { - BYTE byElementID; - BYTE len; - BYTE byMode; - BYTE byChannel; - BYTE byCount; + unsigned char byElementID; + unsigned char len; + unsigned char byMode; + unsigned char byChannel; + unsigned char byCount; } WLAN_IE_CH_SW, *PWLAN_IE_CH_SW; typedef struct _WLAN_IE_QUIET { - BYTE byElementID; - BYTE len; - BYTE byQuietCount; - BYTE byQuietPeriod; - BYTE abyQuietDuration[2]; - BYTE abyQuietOffset[2]; + unsigned char byElementID; + unsigned char len; + unsigned char byQuietCount; + unsigned char byQuietPeriod; + unsigned char abyQuietDuration[2]; + unsigned char abyQuietOffset[2]; } WLAN_IE_QUIET, *PWLAN_IE_QUIET; typedef struct _WLAN_IE_COUNTRY { - BYTE byElementID; - BYTE len; - BYTE abyCountryString[3]; - BYTE abyCountryInfo[3]; + unsigned char byElementID; + unsigned char len; + unsigned char abyCountryString[3]; + unsigned char abyCountryInfo[3]; } WLAN_IE_COUNTRY, *PWLAN_IE_COUNTRY; typedef struct _WLAN_IE_PW_CONST { - BYTE byElementID; - BYTE len; - BYTE byPower; + unsigned char byElementID; + unsigned char len; + unsigned char byPower; } WLAN_IE_PW_CONST, *PWLAN_IE_PW_CONST; typedef struct _WLAN_IE_PW_CAP { - BYTE byElementID; - BYTE len; - BYTE byMinPower; - BYTE byMaxPower; + unsigned char byElementID; + unsigned char len; + unsigned char byMinPower; + unsigned char byMaxPower; } WLAN_IE_PW_CAP, *PWLAN_IE_PW_CAP; typedef struct _WLAN_IE_SUPP_CH { - BYTE byElementID; - BYTE len; - BYTE abyChannelTuple[2]; + unsigned char byElementID; + unsigned char len; + unsigned char abyChannelTuple[2]; } WLAN_IE_SUPP_CH, *PWLAN_IE_SUPP_CH; typedef struct _WLAN_IE_TPC_REQ { - BYTE byElementID; - BYTE len; + unsigned char byElementID; + unsigned char len; } WLAN_IE_TPC_REQ, *PWLAN_IE_TPC_REQ; typedef struct _WLAN_IE_TPC_REP { - BYTE byElementID; - BYTE len; - BYTE byTxPower; - BYTE byLinkMargin; + unsigned char byElementID; + unsigned char len; + unsigned char byTxPower; + unsigned char byLinkMargin; } WLAN_IE_TPC_REP, *PWLAN_IE_TPC_REP; typedef struct _WLAN_IE_IBSS_DFS { - BYTE byElementID; - BYTE len; - BYTE abyDFSOwner[6]; - BYTE byDFSRecovery; - BYTE abyChannelMap[2]; + unsigned char byElementID; + unsigned char len; + unsigned char abyDFSOwner[6]; + unsigned char byDFSRecovery; + unsigned char abyChannelMap[2]; } WLAN_IE_IBSS_DFS, *PWLAN_IE_IBSS_DFS; #pragma pack() @@ -495,9 +495,9 @@ typedef struct _WLAN_IE_IBSS_DFS { // prototype structure, all mgmt frame types will start with these members typedef struct tagWLAN_FR_MGMT { - UINT uType; - UINT len; - PBYTE pBuf; + unsigned int uType; + unsigned int len; + unsigned char *pBuf; PUWLAN_80211HDR pHdr; } WLAN_FR_MGMT, *PWLAN_FR_MGMT; @@ -505,14 +505,14 @@ typedef struct tagWLAN_FR_MGMT { // Beacon frame typedef struct tagWLAN_FR_BEACON { - UINT uType; - UINT len; - PBYTE pBuf; + unsigned int uType; + unsigned int len; + unsigned char *pBuf; PUWLAN_80211HDR pHdr; // fixed fields PQWORD pqwTimestamp; - PWORD pwBeaconInterval; - PWORD pwCapInfo; + unsigned short *pwBeaconInterval; + unsigned short *pwCapInfo; /*-- info elements ----------*/ PWLAN_IE_SSID pSSID; PWLAN_IE_SUPP_RATES pSuppRates; @@ -537,9 +537,9 @@ typedef struct tagWLAN_FR_BEACON { // IBSS ATIM frame typedef struct tagWLAN_FR_IBSSATIM { - UINT uType; - UINT len; - PBYTE pBuf; + unsigned int uType; + unsigned int len; + unsigned char *pBuf; PUWLAN_80211HDR pHdr; // fixed fields @@ -551,12 +551,12 @@ typedef struct tagWLAN_FR_IBSSATIM { // Disassociation typedef struct tagWLAN_FR_DISASSOC { - UINT uType; - UINT len; - PBYTE pBuf; + unsigned int uType; + unsigned int len; + unsigned char *pBuf; PUWLAN_80211HDR pHdr; /*-- fixed fields -----------*/ - PWORD pwReason; + unsigned short *pwReason; /*-- info elements ----------*/ } WLAN_FR_DISASSOC, *PWLAN_FR_DISASSOC; @@ -564,13 +564,13 @@ typedef struct tagWLAN_FR_DISASSOC { // Association Request typedef struct tagWLAN_FR_ASSOCREQ { - UINT uType; - UINT len; - PBYTE pBuf; + unsigned int uType; + unsigned int len; + unsigned char *pBuf; PUWLAN_80211HDR pHdr; /*-- fixed fields -----------*/ - PWORD pwCapInfo; - PWORD pwListenInterval; + unsigned short *pwCapInfo; + unsigned short *pwListenInterval; /*-- info elements ----------*/ PWLAN_IE_SSID pSSID; PWLAN_IE_SUPP_RATES pSuppRates; @@ -585,14 +585,14 @@ typedef struct tagWLAN_FR_ASSOCREQ { // Association Response typedef struct tagWLAN_FR_ASSOCRESP { - UINT uType; - UINT len; - PBYTE pBuf; + unsigned int uType; + unsigned int len; + unsigned char *pBuf; PUWLAN_80211HDR pHdr; /*-- fixed fields -----------*/ - PWORD pwCapInfo; - PWORD pwStatus; - PWORD pwAid; + unsigned short *pwCapInfo; + unsigned short *pwStatus; + unsigned short *pwAid; /*-- info elements ----------*/ PWLAN_IE_SUPP_RATES pSuppRates; PWLAN_IE_SUPP_RATES pExtSuppRates; @@ -602,14 +602,14 @@ typedef struct tagWLAN_FR_ASSOCRESP { // Reassociation Request typedef struct tagWLAN_FR_REASSOCREQ { - UINT uType; - UINT len; - PBYTE pBuf; + unsigned int uType; + unsigned int len; + unsigned char *pBuf; PUWLAN_80211HDR pHdr; /*-- fixed fields -----------*/ - PWORD pwCapInfo; - PWORD pwListenInterval; + unsigned short *pwCapInfo; + unsigned short *pwListenInterval; PIEEE_ADDR pAddrCurrAP; /*-- info elements ----------*/ @@ -624,14 +624,14 @@ typedef struct tagWLAN_FR_REASSOCREQ { // Reassociation Response typedef struct tagWLAN_FR_REASSOCRESP { - UINT uType; - UINT len; - PBYTE pBuf; + unsigned int uType; + unsigned int len; + unsigned char *pBuf; PUWLAN_80211HDR pHdr; /*-- fixed fields -----------*/ - PWORD pwCapInfo; - PWORD pwStatus; - PWORD pwAid; + unsigned short *pwCapInfo; + unsigned short *pwStatus; + unsigned short *pwAid; /*-- info elements ----------*/ PWLAN_IE_SUPP_RATES pSuppRates; PWLAN_IE_SUPP_RATES pExtSuppRates; @@ -641,9 +641,9 @@ typedef struct tagWLAN_FR_REASSOCRESP { // Probe Request typedef struct tagWLAN_FR_PROBEREQ { - UINT uType; - UINT len; - PBYTE pBuf; + unsigned int uType; + unsigned int len; + unsigned char *pBuf; PUWLAN_80211HDR pHdr; /*-- fixed fields -----------*/ /*-- info elements ----------*/ @@ -656,14 +656,14 @@ typedef struct tagWLAN_FR_PROBEREQ { // Probe Response typedef struct tagWLAN_FR_PROBERESP { - UINT uType; - UINT len; - PBYTE pBuf; + unsigned int uType; + unsigned int len; + unsigned char *pBuf; PUWLAN_80211HDR pHdr; /*-- fixed fields -----------*/ PQWORD pqwTimestamp; - PWORD pwBeaconInterval; - PWORD pwCapInfo; + unsigned short *pwBeaconInterval; + unsigned short *pwCapInfo; /*-- info elements ----------*/ PWLAN_IE_SSID pSSID; PWLAN_IE_SUPP_RATES pSuppRates; @@ -685,14 +685,14 @@ typedef struct tagWLAN_FR_PROBERESP { // Authentication typedef struct tagWLAN_FR_AUTHEN { - UINT uType; - UINT len; - PBYTE pBuf; + unsigned int uType; + unsigned int len; + unsigned char *pBuf; PUWLAN_80211HDR pHdr; /*-- fixed fields -----------*/ - PWORD pwAuthAlgorithm; - PWORD pwAuthSequence; - PWORD pwStatus; + unsigned short *pwAuthAlgorithm; + unsigned short *pwAuthSequence; + unsigned short *pwStatus; /*-- info elements ----------*/ PWLAN_IE_CHALLENGE pChallenge; @@ -701,12 +701,12 @@ typedef struct tagWLAN_FR_AUTHEN { // Deauthenication typedef struct tagWLAN_FR_DEAUTHEN { - UINT uType; - UINT len; - PBYTE pBuf; + unsigned int uType; + unsigned int len; + unsigned char *pBuf; PUWLAN_80211HDR pHdr; /*-- fixed fields -----------*/ - PWORD pwReason; + unsigned short *pwReason; /*-- info elements ----------*/ diff --git a/drivers/staging/vt6655/IEEE11h.c b/drivers/staging/vt6655/IEEE11h.c index 22f12f5ef90..e07ebd578d4 100644 --- a/drivers/staging/vt6655/IEEE11h.c +++ b/drivers/staging/vt6655/IEEE11h.c @@ -38,6 +38,7 @@ #include "device.h" #include "wmgr.h" #include "rxtx.h" +#include "channel.h" /*--------------------- Static Definitions -------------------------*/ static int msglevel =MSG_LEVEL_INFO; @@ -46,40 +47,40 @@ static int msglevel =MSG_LEVEL_INFO; typedef struct _WLAN_FRAME_ACTION { WLAN_80211HDR_A3 Header; - BYTE byCategory; - BYTE byAction; - BYTE abyVars[1]; + unsigned char byCategory; + unsigned char byAction; + unsigned char abyVars[1]; } WLAN_FRAME_ACTION, *PWLAN_FRAME_ACTION; typedef struct _WLAN_FRAME_MSRREQ { WLAN_80211HDR_A3 Header; - BYTE byCategory; - BYTE byAction; - BYTE byDialogToken; + unsigned char byCategory; + unsigned char byAction; + unsigned char byDialogToken; WLAN_IE_MEASURE_REQ sMSRReqEIDs[1]; } WLAN_FRAME_MSRREQ, *PWLAN_FRAME_MSRREQ; typedef struct _WLAN_FRAME_MSRREP { WLAN_80211HDR_A3 Header; - BYTE byCategory; - BYTE byAction; - BYTE byDialogToken; + unsigned char byCategory; + unsigned char byAction; + unsigned char byDialogToken; WLAN_IE_MEASURE_REP sMSRRepEIDs[1]; } WLAN_FRAME_MSRREP, *PWLAN_FRAME_MSRREP; typedef struct _WLAN_FRAME_TPCREQ { WLAN_80211HDR_A3 Header; - BYTE byCategory; - BYTE byAction; - BYTE byDialogToken; + unsigned char byCategory; + unsigned char byAction; + unsigned char byDialogToken; WLAN_IE_TPC_REQ sTPCReqEIDs; } WLAN_FRAME_TPCREQ, *PWLAN_FRAME_TPCREQ; typedef struct _WLAN_FRAME_TPCREP { WLAN_80211HDR_A3 Header; - BYTE byCategory; - BYTE byAction; - BYTE byDialogToken; + unsigned char byCategory; + unsigned char byAction; + unsigned char byDialogToken; WLAN_IE_TPC_REP sTPCRepEIDs; } WLAN_FRAME_TPCREP, *PWLAN_FRAME_TPCREP; @@ -97,10 +98,11 @@ typedef struct _WLAN_FRAME_TPCREP { /*--------------------- Static Variables --------------------------*/ /*--------------------- Static Functions --------------------------*/ -static BOOL s_bRxMSRReq(PSMgmtObject pMgmt, PWLAN_FRAME_MSRREQ pMSRReq, UINT uLength) +static bool s_bRxMSRReq(PSMgmtObject pMgmt, PWLAN_FRAME_MSRREQ pMSRReq, + unsigned int uLength) { size_t uNumOfEIDs = 0; - BOOL bResult = TRUE; + bool bResult = true; if (uLength <= WLAN_A3FR_MAXLEN) { memcpy(pMgmt->abyCurrentMSRReq, pMSRReq, uLength); @@ -116,7 +118,7 @@ static BOOL s_bRxMSRReq(PSMgmtObject pMgmt, PWLAN_FRAME_MSRREQ pMSRReq, UINT uLe } -static BOOL s_bRxTPCReq(PSMgmtObject pMgmt, PWLAN_FRAME_TPCREQ pTPCReq, BYTE byRate, BYTE byRSSI) +static bool s_bRxTPCReq(PSMgmtObject pMgmt, PWLAN_FRAME_TPCREQ pTPCReq, unsigned char byRate, unsigned char byRSSI) { PWLAN_FRAME_TPCREP pFrame; PSTxMgmtPacket pTxPacket = NULL; @@ -124,9 +126,9 @@ static BOOL s_bRxTPCReq(PSMgmtObject pMgmt, PWLAN_FRAME_TPCREQ pTPCReq, BYTE byR pTxPacket = (PSTxMgmtPacket)pMgmt->pbyMgmtPacketPool; memset(pTxPacket, 0, sizeof(STxMgmtPacket) + WLAN_A3FR_MAXLEN); - pTxPacket->p80211Header = (PUWLAN_80211HDR)((PBYTE)pTxPacket + sizeof(STxMgmtPacket)); + pTxPacket->p80211Header = (PUWLAN_80211HDR)((unsigned char *)pTxPacket + sizeof(STxMgmtPacket)); - pFrame = (PWLAN_FRAME_TPCREP)((PBYTE)pTxPacket + sizeof(STxMgmtPacket)); + pFrame = (PWLAN_FRAME_TPCREP)((unsigned char *)pTxPacket + sizeof(STxMgmtPacket)); pFrame->Header.wFrameCtl = ( WLAN_SET_FC_FTYPE(WLAN_FTYPE_MGMT) | WLAN_SET_FC_FSTYPE(WLAN_FSTYPE_ACTION) @@ -174,8 +176,8 @@ static BOOL s_bRxTPCReq(PSMgmtObject pMgmt, PWLAN_FRAME_TPCREQ pTPCReq, BYTE byR pTxPacket->cbMPDULen = sizeof(WLAN_FRAME_TPCREP); pTxPacket->cbPayloadLen = sizeof(WLAN_FRAME_TPCREP) - WLAN_HDR_ADDR3_LEN; if (csMgmt_xmit(pMgmt->pAdapter, pTxPacket) != CMD_STATUS_PENDING) - return (FALSE); - return (TRUE); + return (false); + return (true); // return (CARDbSendPacket(pMgmt->pAdapter, pFrame, PKT_TYPE_802_11_MNG, sizeof(WLAN_FRAME_TPCREP))); } @@ -201,7 +203,7 @@ static BOOL s_bRxTPCReq(PSMgmtObject pMgmt, PWLAN_FRAME_TPCREQ pTPCReq, BYTE byR * Return Value: None. * -*/ -BOOL +bool IEEE11hbMgrRxAction ( void *pMgmtHandle, void *pRxPacket @@ -209,14 +211,14 @@ IEEE11hbMgrRxAction ( { PSMgmtObject pMgmt = (PSMgmtObject) pMgmtHandle; PWLAN_FRAME_ACTION pAction = NULL; - UINT uLength = 0; + unsigned int uLength = 0; PWLAN_IE_CH_SW pChannelSwitch = NULL; // decode the frame uLength = ((PSRxMgmtPacket)pRxPacket)->cbMPDULen; if (uLength > WLAN_A3FR_MAXLEN) { - return (FALSE); + return (false); } @@ -233,7 +235,7 @@ IEEE11hbMgrRxAction ( return (s_bRxTPCReq(pMgmt, (PWLAN_FRAME_TPCREQ) pAction, ((PSRxMgmtPacket)pRxPacket)->byRxRate, - (BYTE) ((PSRxMgmtPacket)pRxPacket)->uRSSI)); + (unsigned char) ((PSRxMgmtPacket)pRxPacket)->uRSSI)); break; case ACTION_TPCREP: break; @@ -244,7 +246,7 @@ IEEE11hbMgrRxAction ( // valid element id CARDbChannelSwitch( pMgmt->pAdapter, pChannelSwitch->byMode, - CARDbyGetChannelMapping(pMgmt->pAdapter, pChannelSwitch->byChannel, pMgmt->eCurrentPHYMode), + get_channel_mapping(pMgmt->pAdapter, pChannelSwitch->byChannel, pMgmt->eCurrentPHYMode), pChannelSwitch->byCount ); } @@ -258,13 +260,13 @@ IEEE11hbMgrRxAction ( pAction->byCategory |= 0x80; //return (CARDbSendPacket(pMgmt->pAdapter, pAction, PKT_TYPE_802_11_MNG, uLength)); - return (TRUE); + return (true); } - return (TRUE); + return (true); } -BOOL IEEE11hbMSRRepTx ( +bool IEEE11hbMSRRepTx ( void *pMgmtHandle ) { @@ -275,7 +277,7 @@ BOOL IEEE11hbMSRRepTx ( pTxPacket = (PSTxMgmtPacket)pMgmt->abyCurrentMSRRep; memset(pTxPacket, 0, sizeof(STxMgmtPacket) + WLAN_A3FR_MAXLEN); - pTxPacket->p80211Header = (PUWLAN_80211HDR)((PBYTE)pTxPacket + sizeof(STxMgmtPacket)); + pTxPacket->p80211Header = (PUWLAN_80211HDR)((unsigned char *)pTxPacket + sizeof(STxMgmtPacket)); pMSRRep->Header.wFrameCtl = ( WLAN_SET_FC_FTYPE(WLAN_FTYPE_MGMT) | @@ -295,8 +297,8 @@ BOOL IEEE11hbMSRRepTx ( pTxPacket->cbMPDULen = uLength; pTxPacket->cbPayloadLen = uLength - WLAN_HDR_ADDR3_LEN; if (csMgmt_xmit(pMgmt->pAdapter, pTxPacket) != CMD_STATUS_PENDING) - return (FALSE); - return (TRUE); + return (false); + return (true); // return (CARDbSendPacket(pMgmt->pAdapter, pMSRRep, PKT_TYPE_802_11_MNG, uLength)); } diff --git a/drivers/staging/vt6655/IEEE11h.h b/drivers/staging/vt6655/IEEE11h.h index ae32498a511..542340b96e3 100644 --- a/drivers/staging/vt6655/IEEE11h.h +++ b/drivers/staging/vt6655/IEEE11h.h @@ -45,7 +45,7 @@ /*--------------------- Export Functions --------------------------*/ -BOOL IEEE11hbMSRRepTx ( +bool IEEE11hbMSRRepTx ( void *pMgmtHandle ); diff --git a/drivers/staging/vt6655/Makefile b/drivers/staging/vt6655/Makefile index 931deb109ee..824c9718787 100644 --- a/drivers/staging/vt6655/Makefile +++ b/drivers/staging/vt6655/Makefile @@ -4,6 +4,7 @@ EXTRA_CFLAGS += -DHOSTAP vt6655_stage-y += device_main.o \ card.o \ + channel.o \ mac.o \ baseband.o \ wctl.o \ diff --git a/drivers/staging/vt6655/TODO b/drivers/staging/vt6655/TODO index cb04aaafc46..63607ef9c97 100644 --- a/drivers/staging/vt6655/TODO +++ b/drivers/staging/vt6655/TODO @@ -3,7 +3,6 @@ TODO: - prepare for merge with vt6656 driver: - rename DEVICE_PRT() to DBG_PRT() -- done - share 80211*.h includes - - move code for channel mapping from card.c to channel.c - split rf.c - remove dead code - abstract VT3253 chipset specific code @@ -11,6 +10,8 @@ TODO: - kill ttype.h - switch to use LIB80211 - switch to use MAC80211 +- verify unsigned long usage for x86-64 arch +- reduce .data footprint - use kernel coding style - checkpatch.pl fixes - sparse fixes diff --git a/drivers/staging/vt6655/aes_ccmp.c b/drivers/staging/vt6655/aes_ccmp.c index fef1b91c292..e30168f2da2 100644 --- a/drivers/staging/vt6655/aes_ccmp.c +++ b/drivers/staging/vt6655/aes_ccmp.c @@ -46,7 +46,7 @@ * SBOX Table */ -BYTE sbox_table[256] = +unsigned char sbox_table[256] = { 0x63, 0x7c, 0x77, 0x7b, 0xf2, 0x6b, 0x6f, 0xc5, 0x30, 0x01, 0x67, 0x2b, 0xfe, 0xd7, 0xab, 0x76, 0xca, 0x82, 0xc9, 0x7d, 0xfa, 0x59, 0x47, 0xf0, 0xad, 0xd4, 0xa2, 0xaf, 0x9c, 0xa4, 0x72, 0xc0, @@ -66,7 +66,7 @@ BYTE sbox_table[256] = 0x8c, 0xa1, 0x89, 0x0d, 0xbf, 0xe6, 0x42, 0x68, 0x41, 0x99, 0x2d, 0x0f, 0xb0, 0x54, 0xbb, 0x16 }; -BYTE dot2_table[256] = { +unsigned char dot2_table[256] = { 0x00, 0x02, 0x04, 0x06, 0x08, 0x0a, 0x0c, 0x0e, 0x10, 0x12, 0x14, 0x16, 0x18, 0x1a, 0x1c, 0x1e, 0x20, 0x22, 0x24, 0x26, 0x28, 0x2a, 0x2c, 0x2e, 0x30, 0x32, 0x34, 0x36, 0x38, 0x3a, 0x3c, 0x3e, 0x40, 0x42, 0x44, 0x46, 0x48, 0x4a, 0x4c, 0x4e, 0x50, 0x52, 0x54, 0x56, 0x58, 0x5a, 0x5c, 0x5e, @@ -85,7 +85,7 @@ BYTE dot2_table[256] = { 0xfb, 0xf9, 0xff, 0xfd, 0xf3, 0xf1, 0xf7, 0xf5, 0xeb, 0xe9, 0xef, 0xed, 0xe3, 0xe1, 0xe7, 0xe5 }; -BYTE dot3_table[256] = { +unsigned char dot3_table[256] = { 0x00, 0x03, 0x06, 0x05, 0x0c, 0x0f, 0x0a, 0x09, 0x18, 0x1b, 0x1e, 0x1d, 0x14, 0x17, 0x12, 0x11, 0x30, 0x33, 0x36, 0x35, 0x3c, 0x3f, 0x3a, 0x39, 0x28, 0x2b, 0x2e, 0x2d, 0x24, 0x27, 0x22, 0x21, 0x60, 0x63, 0x66, 0x65, 0x6c, 0x6f, 0x6a, 0x69, 0x78, 0x7b, 0x7e, 0x7d, 0x74, 0x77, 0x72, 0x71, @@ -110,11 +110,11 @@ BYTE dot3_table[256] = { /*--------------------- Export Functions --------------------------*/ -void xor_128(BYTE *a, BYTE *b, BYTE *out) +void xor_128(unsigned char *a, unsigned char *b, unsigned char *out) { -PDWORD dwPtrA = (PDWORD) a; -PDWORD dwPtrB = (PDWORD) b; -PDWORD dwPtrOut =(PDWORD) out; +unsigned long *dwPtrA = (unsigned long *) a; +unsigned long *dwPtrB = (unsigned long *) b; +unsigned long *dwPtrOut =(unsigned long *) out; (*dwPtrOut++) = (*dwPtrA++) ^ (*dwPtrB++); (*dwPtrOut++) = (*dwPtrA++) ^ (*dwPtrB++); @@ -123,19 +123,19 @@ PDWORD dwPtrOut =(PDWORD) out; } -void xor_32(BYTE *a, BYTE *b, BYTE *out) +void xor_32(unsigned char *a, unsigned char *b, unsigned char *out) { -PDWORD dwPtrA = (PDWORD) a; -PDWORD dwPtrB = (PDWORD) b; -PDWORD dwPtrOut =(PDWORD) out; +unsigned long *dwPtrA = (unsigned long *) a; +unsigned long *dwPtrB = (unsigned long *) b; +unsigned long *dwPtrOut =(unsigned long *) out; (*dwPtrOut++) = (*dwPtrA++) ^ (*dwPtrB++); } -void AddRoundKey(BYTE *key, int round) +void AddRoundKey(unsigned char *key, int round) { -BYTE sbox_key[4]; -BYTE rcon_table[10] = { 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36}; +unsigned char sbox_key[4]; +unsigned char rcon_table[10] = { 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36}; sbox_key[0] = sbox_table[key[13]]; sbox_key[1] = sbox_table[key[14]]; @@ -150,7 +150,7 @@ BYTE rcon_table[10] = { 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x xor_32(&key[12], &key[8], &key[12]); } -void SubBytes(BYTE *in, BYTE *out) +void SubBytes(unsigned char *in, unsigned char *out) { int i; @@ -160,7 +160,7 @@ int i; } } -void ShiftRows(BYTE *in, BYTE *out) +void ShiftRows(unsigned char *in, unsigned char *out) { out[0] = in[0]; out[1] = in[5]; @@ -180,7 +180,7 @@ void ShiftRows(BYTE *in, BYTE *out) out[15] = in[11]; } -void MixColumns(BYTE *in, BYTE *out) +void MixColumns(unsigned char *in, unsigned char *out) { out[0] = dot2_table[in[0]] ^ dot3_table[in[1]] ^ in[2] ^ in[3]; @@ -190,13 +190,13 @@ void MixColumns(BYTE *in, BYTE *out) } -void AESv128(BYTE *key, BYTE *data, BYTE *ciphertext) +void AESv128(unsigned char *key, unsigned char *data, unsigned char *ciphertext) { int i; int round; -BYTE TmpdataA[16]; -BYTE TmpdataB[16]; -BYTE abyRoundKey[16]; +unsigned char TmpdataA[16]; +unsigned char TmpdataB[16]; +unsigned char abyRoundKey[16]; for(i=0; i<16; i++) abyRoundKey[i] = key[i]; @@ -243,33 +243,33 @@ BYTE abyRoundKey[16]; * Return Value: MIC compare result * */ -BOOL AESbGenCCMP(PBYTE pbyRxKey, PBYTE pbyFrame, WORD wFrameSize) +bool AESbGenCCMP(unsigned char *pbyRxKey, unsigned char *pbyFrame, unsigned short wFrameSize) { -BYTE abyNonce[13]; -BYTE MIC_IV[16]; -BYTE MIC_HDR1[16]; -BYTE MIC_HDR2[16]; -BYTE abyMIC[16]; -BYTE abyCTRPLD[16]; -BYTE abyTmp[16]; -BYTE abyPlainText[16]; -BYTE abyLastCipher[16]; +unsigned char abyNonce[13]; +unsigned char MIC_IV[16]; +unsigned char MIC_HDR1[16]; +unsigned char MIC_HDR2[16]; +unsigned char abyMIC[16]; +unsigned char abyCTRPLD[16]; +unsigned char abyTmp[16]; +unsigned char abyPlainText[16]; +unsigned char abyLastCipher[16]; PS802_11Header pMACHeader = (PS802_11Header) pbyFrame; -PBYTE pbyIV; -PBYTE pbyPayload; -WORD wHLen = 22; -WORD wPayloadSize = wFrameSize - 8 - 8 - 4 - WLAN_HDR_ADDR3_LEN;//8 is IV, 8 is MIC, 4 is CRC -BOOL bA4 = FALSE; -BYTE byTmp; -WORD wCnt; +unsigned char *pbyIV; +unsigned char *pbyPayload; +unsigned short wHLen = 22; +unsigned short wPayloadSize = wFrameSize - 8 - 8 - 4 - WLAN_HDR_ADDR3_LEN;//8 is IV, 8 is MIC, 4 is CRC +bool bA4 = false; +unsigned char byTmp; +unsigned short wCnt; int ii,jj,kk; pbyIV = pbyFrame + WLAN_HDR_ADDR3_LEN; - if ( WLAN_GET_FC_TODS(*(PWORD)pbyFrame) && - WLAN_GET_FC_FROMDS(*(PWORD)pbyFrame) ) { - bA4 = TRUE; + if ( WLAN_GET_FC_TODS(*(unsigned short *)pbyFrame) && + WLAN_GET_FC_FROMDS(*(unsigned short *)pbyFrame) ) { + bA4 = true; pbyIV += 6; // 6 is 802.11 address4 wHLen += 6; wPayloadSize -= 6; @@ -288,15 +288,15 @@ int ii,jj,kk; //MIC_IV MIC_IV[0] = 0x59; memcpy(&(MIC_IV[1]), &(abyNonce[0]), 13); - MIC_IV[14] = (BYTE)(wPayloadSize >> 8); - MIC_IV[15] = (BYTE)(wPayloadSize & 0xff); + MIC_IV[14] = (unsigned char)(wPayloadSize >> 8); + MIC_IV[15] = (unsigned char)(wPayloadSize & 0xff); //MIC_HDR1 - MIC_HDR1[0] = (BYTE)(wHLen >> 8); - MIC_HDR1[1] = (BYTE)(wHLen & 0xff); - byTmp = (BYTE)(pMACHeader->wFrameCtl & 0xff); + MIC_HDR1[0] = (unsigned char)(wHLen >> 8); + MIC_HDR1[1] = (unsigned char)(wHLen & 0xff); + byTmp = (unsigned char)(pMACHeader->wFrameCtl & 0xff); MIC_HDR1[2] = byTmp & 0x8f; - byTmp = (BYTE)(pMACHeader->wFrameCtl >> 8); + byTmp = (unsigned char)(pMACHeader->wFrameCtl >> 8); byTmp &= 0x87; MIC_HDR1[3] = byTmp | 0x40; memcpy(&(MIC_HDR1[4]), pMACHeader->abyAddr1, ETH_ALEN); @@ -304,7 +304,7 @@ int ii,jj,kk; //MIC_HDR2 memcpy(&(MIC_HDR2[0]), pMACHeader->abyAddr3, ETH_ALEN); - byTmp = (BYTE)(pMACHeader->wSeqCtl & 0xff); + byTmp = (unsigned char)(pMACHeader->wSeqCtl & 0xff); MIC_HDR2[6] = byTmp & 0x0f; MIC_HDR2[7] = 0; if ( bA4 ) { @@ -337,8 +337,8 @@ int ii,jj,kk; for(jj=wPayloadSize; jj>16; jj=jj-16) { - abyCTRPLD[14] = (BYTE) (wCnt >> 8); - abyCTRPLD[15] = (BYTE) (wCnt & 0xff); + abyCTRPLD[14] = (unsigned char) (wCnt >> 8); + abyCTRPLD[15] = (unsigned char) (wCnt & 0xff); AESv128(pbyRxKey,abyCTRPLD,abyTmp); @@ -361,8 +361,8 @@ int ii,jj,kk; abyLastCipher[ii] = 0x00; } - abyCTRPLD[14] = (BYTE) (wCnt >> 8); - abyCTRPLD[15] = (BYTE) (wCnt & 0xff); + abyCTRPLD[14] = (unsigned char) (wCnt >> 8); + abyCTRPLD[15] = (unsigned char) (wCnt & 0xff); AESv128(pbyRxKey,abyCTRPLD,abyTmp); for ( kk=0; kk<16; kk++ ) { @@ -384,8 +384,8 @@ int ii,jj,kk; //-------------------------------------------- wCnt = 0; - abyCTRPLD[14] = (BYTE) (wCnt >> 8); - abyCTRPLD[15] = (BYTE) (wCnt & 0xff); + abyCTRPLD[14] = (unsigned char) (wCnt >> 8); + abyCTRPLD[15] = (unsigned char) (wCnt & 0xff); AESv128(pbyRxKey,abyCTRPLD,abyTmp); for ( kk=0; kk<8; kk++ ) { abyTmp[kk] = abyTmp[kk] ^ pbyPayload[kk]; @@ -394,9 +394,9 @@ int ii,jj,kk; //-------------------------------------------- if ( !memcmp(abyMIC,abyTmp,8) ) { - return TRUE; + return true; } else { - return FALSE; + return false; } } diff --git a/drivers/staging/vt6655/aes_ccmp.h b/drivers/staging/vt6655/aes_ccmp.h index f2ba1d5aa1e..c8b28b0e9bd 100644 --- a/drivers/staging/vt6655/aes_ccmp.h +++ b/drivers/staging/vt6655/aes_ccmp.h @@ -41,6 +41,6 @@ /*--------------------- Export Variables --------------------------*/ /*--------------------- Export Functions --------------------------*/ -BOOL AESbGenCCMP(PBYTE pbyRxKey, PBYTE pbyFrame, WORD wFrameSize); +bool AESbGenCCMP(unsigned char *pbyRxKey, unsigned char *pbyFrame, unsigned short wFrameSize); #endif //__AES_H__ diff --git a/drivers/staging/vt6655/baseband.c b/drivers/staging/vt6655/baseband.c index 5414c6c6c05..1e1c6e34f78 100644 --- a/drivers/staging/vt6655/baseband.c +++ b/drivers/staging/vt6655/baseband.c @@ -79,7 +79,7 @@ static int msglevel =MSG_LEVEL_INFO; #define CB_VT3253_INIT_FOR_RFMD 446 -BYTE byVT3253InitTab_RFMD[CB_VT3253_INIT_FOR_RFMD][2] = { +unsigned char byVT3253InitTab_RFMD[CB_VT3253_INIT_FOR_RFMD][2] = { {0x00, 0x30}, {0x01, 0x00}, {0x02, 0x00}, @@ -529,7 +529,7 @@ BYTE byVT3253InitTab_RFMD[CB_VT3253_INIT_FOR_RFMD][2] = { }; #define CB_VT3253B0_INIT_FOR_RFMD 256 -BYTE byVT3253B0_RFMD[CB_VT3253B0_INIT_FOR_RFMD][2] = { +unsigned char byVT3253B0_RFMD[CB_VT3253B0_INIT_FOR_RFMD][2] = { {0x00, 0x31}, {0x01, 0x00}, {0x02, 0x00}, @@ -790,7 +790,7 @@ BYTE byVT3253B0_RFMD[CB_VT3253B0_INIT_FOR_RFMD][2] = { #define CB_VT3253B0_AGC_FOR_RFMD2959 195 // For RFMD2959 -BYTE byVT3253B0_AGC4_RFMD2959[CB_VT3253B0_AGC_FOR_RFMD2959][2] = { +unsigned char byVT3253B0_AGC4_RFMD2959[CB_VT3253B0_AGC_FOR_RFMD2959][2] = { {0xF0, 0x00}, {0xF1, 0x3E}, {0xF0, 0x80}, @@ -990,7 +990,7 @@ BYTE byVT3253B0_AGC4_RFMD2959[CB_VT3253B0_AGC_FOR_RFMD2959][2] = { #define CB_VT3253B0_INIT_FOR_AIROHA2230 256 // For AIROHA -BYTE byVT3253B0_AIROHA2230[CB_VT3253B0_INIT_FOR_AIROHA2230][2] = { +unsigned char byVT3253B0_AIROHA2230[CB_VT3253B0_INIT_FOR_AIROHA2230][2] = { {0x00, 0x31}, {0x01, 0x00}, {0x02, 0x00}, @@ -1254,7 +1254,7 @@ BYTE byVT3253B0_AIROHA2230[CB_VT3253B0_INIT_FOR_AIROHA2230][2] = { #define CB_VT3253B0_INIT_FOR_UW2451 256 //For UW2451 -BYTE byVT3253B0_UW2451[CB_VT3253B0_INIT_FOR_UW2451][2] = { +unsigned char byVT3253B0_UW2451[CB_VT3253B0_INIT_FOR_UW2451][2] = { {0x00, 0x31}, {0x01, 0x00}, {0x02, 0x00}, @@ -1516,7 +1516,7 @@ BYTE byVT3253B0_UW2451[CB_VT3253B0_INIT_FOR_UW2451][2] = { #define CB_VT3253B0_AGC 193 // For AIROHA -BYTE byVT3253B0_AGC[CB_VT3253B0_AGC][2] = { +unsigned char byVT3253B0_AGC[CB_VT3253B0_AGC][2] = { {0xF0, 0x00}, {0xF1, 0x00}, {0xF0, 0x80}, @@ -1712,14 +1712,14 @@ BYTE byVT3253B0_AGC[CB_VT3253B0_AGC][2] = { {0xF0, 0x00}, }; -const WORD awcFrameTime[MAX_RATE] = +const unsigned short awcFrameTime[MAX_RATE] = {10, 20, 55, 110, 24, 36, 48, 72, 96, 144, 192, 216}; /*--------------------- Static Functions --------------------------*/ static -ULONG +unsigned long s_ulGetRatio(PSDevice pDevice); static @@ -1740,13 +1740,13 @@ s_vChangeAntenna ( #endif if ( pDevice->dwRxAntennaSel == 0) { pDevice->dwRxAntennaSel=1; - if (pDevice->bTxRxAntInv == TRUE) + if (pDevice->bTxRxAntInv == true) BBvSetRxAntennaMode(pDevice->PortOffset, ANT_A); else BBvSetRxAntennaMode(pDevice->PortOffset, ANT_B); } else { pDevice->dwRxAntennaSel=0; - if (pDevice->bTxRxAntInv == TRUE) + if (pDevice->bTxRxAntInv == true) BBvSetRxAntennaMode(pDevice->PortOffset, ANT_B); else BBvSetRxAntennaMode(pDevice->PortOffset, ANT_A); @@ -1776,19 +1776,19 @@ s_vChangeAntenna ( * Return Value: FrameTime * */ -UINT +unsigned int BBuGetFrameTime ( - BYTE byPreambleType, - BYTE byPktType, - UINT cbFrameLength, - WORD wRate + unsigned char byPreambleType, + unsigned char byPktType, + unsigned int cbFrameLength, + unsigned short wRate ) { - UINT uFrameTime; - UINT uPreamble; - UINT uTmp; - UINT uRateIdx = (UINT)wRate; - UINT uRate = 0; + unsigned int uFrameTime; + unsigned int uPreamble; + unsigned int uTmp; + unsigned int uRateIdx = (unsigned int) wRate; + unsigned int uRate = 0; if (uRateIdx > RATE_54M) { @@ -1796,7 +1796,7 @@ BBuGetFrameTime ( return 0; } - uRate = (UINT)awcFrameTime[uRateIdx]; + uRate = (unsigned int) awcFrameTime[uRateIdx]; if (uRateIdx <= 3) { //CCK mode @@ -1846,23 +1846,23 @@ BBuGetFrameTime ( void BBvCaculateParameter ( PSDevice pDevice, - UINT cbFrameLength, - WORD wRate, - BYTE byPacketType, - PWORD pwPhyLen, - PBYTE pbyPhySrv, - PBYTE pbyPhySgn + unsigned int cbFrameLength, + unsigned short wRate, + unsigned char byPacketType, + unsigned short *pwPhyLen, + unsigned char *pbyPhySrv, + unsigned char *pbyPhySgn ) { - UINT cbBitCount; - UINT cbUsCount = 0; - UINT cbTmp; - BOOL bExtBit; - BYTE byPreambleType = pDevice->byPreambleType; - BOOL bCCK = pDevice->bCCK; + unsigned int cbBitCount; + unsigned int cbUsCount = 0; + unsigned int cbTmp; + bool bExtBit; + unsigned char byPreambleType = pDevice->byPreambleType; + bool bCCK = pDevice->bCCK; cbBitCount = cbFrameLength * 8; - bExtBit = FALSE; + bExtBit = false; switch (wRate) { case RATE_1M : @@ -1879,7 +1879,7 @@ BBvCaculateParameter ( break; case RATE_5M : - if (bCCK == FALSE) + if (bCCK == false) cbBitCount ++; cbUsCount = (cbBitCount * 10) / 55; cbTmp = (cbUsCount * 55) / 10; @@ -1893,14 +1893,14 @@ BBvCaculateParameter ( case RATE_11M : - if (bCCK == FALSE) + if (bCCK == false) cbBitCount ++; cbUsCount = cbBitCount / 11; cbTmp = cbUsCount * 11; if (cbTmp != cbBitCount) { cbUsCount ++; if ((cbBitCount - cbTmp) <= 3) - bExtBit = TRUE; + bExtBit = true; } if (byPreambleType == 1) *pbyPhySgn = 0x0b; @@ -1994,11 +1994,11 @@ BBvCaculateParameter ( *pbyPhySrv = 0x00; if (bExtBit) *pbyPhySrv = *pbyPhySrv | 0x80; - *pwPhyLen = (WORD)cbUsCount; + *pwPhyLen = (unsigned short)cbUsCount; } else { *pbyPhySrv = 0x00; - *pwPhyLen = (WORD)cbFrameLength; + *pwPhyLen = (unsigned short)cbFrameLength; } } @@ -2012,13 +2012,13 @@ BBvCaculateParameter ( * Out: * pbyData - data read * - * Return Value: TRUE if succeeded; FALSE if failed. + * Return Value: true if succeeded; false if failed. * */ -BOOL BBbReadEmbeded (DWORD_PTR dwIoBase, BYTE byBBAddr, PBYTE pbyData) +bool BBbReadEmbeded (unsigned long dwIoBase, unsigned char byBBAddr, unsigned char *pbyData) { - WORD ww; - BYTE byValue; + unsigned short ww; + unsigned char byValue; // BB reg offset VNSvOutPortB(dwIoBase + MAC_REG_BBREGADR, byBBAddr); @@ -2038,9 +2038,9 @@ BOOL BBbReadEmbeded (DWORD_PTR dwIoBase, BYTE byBBAddr, PBYTE pbyData) if (ww == W_MAX_TIMEOUT) { DBG_PORT80(0x30); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" DBG_PORT80(0x30)\n"); - return FALSE; + return false; } - return TRUE; + return true; } @@ -2055,13 +2055,13 @@ BOOL BBbReadEmbeded (DWORD_PTR dwIoBase, BYTE byBBAddr, PBYTE pbyData) * Out: * none * - * Return Value: TRUE if succeeded; FALSE if failed. + * Return Value: true if succeeded; false if failed. * */ -BOOL BBbWriteEmbeded (DWORD_PTR dwIoBase, BYTE byBBAddr, BYTE byData) +bool BBbWriteEmbeded (unsigned long dwIoBase, unsigned char byBBAddr, unsigned char byData) { - WORD ww; - BYTE byValue; + unsigned short ww; + unsigned char byValue; // BB reg offset VNSvOutPortB(dwIoBase + MAC_REG_BBREGADR, byBBAddr); @@ -2080,9 +2080,9 @@ BOOL BBbWriteEmbeded (DWORD_PTR dwIoBase, BYTE byBBAddr, BYTE byData) if (ww == W_MAX_TIMEOUT) { DBG_PORT80(0x31); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" DBG_PORT80(0x31)\n"); - return FALSE; + return false; } - return TRUE; + return true; } @@ -2097,12 +2097,12 @@ BOOL BBbWriteEmbeded (DWORD_PTR dwIoBase, BYTE byBBAddr, BYTE byData) * Out: * none * - * Return Value: TRUE if all TestBits are set; FALSE otherwise. + * Return Value: true if all TestBits are set; false otherwise. * */ -BOOL BBbIsRegBitsOn (DWORD_PTR dwIoBase, BYTE byBBAddr, BYTE byTestBits) +bool BBbIsRegBitsOn (unsigned long dwIoBase, unsigned char byBBAddr, unsigned char byTestBits) { - BYTE byOrgData; + unsigned char byOrgData; BBbReadEmbeded(dwIoBase, byBBAddr, &byOrgData); return (byOrgData & byTestBits) == byTestBits; @@ -2120,12 +2120,12 @@ BOOL BBbIsRegBitsOn (DWORD_PTR dwIoBase, BYTE byBBAddr, BYTE byTestBits) * Out: * none * - * Return Value: TRUE if all TestBits are clear; FALSE otherwise. + * Return Value: true if all TestBits are clear; false otherwise. * */ -BOOL BBbIsRegBitsOff (DWORD_PTR dwIoBase, BYTE byBBAddr, BYTE byTestBits) +bool BBbIsRegBitsOff (unsigned long dwIoBase, unsigned char byBBAddr, unsigned char byTestBits) { - BYTE byOrgData; + unsigned char byOrgData; BBbReadEmbeded(dwIoBase, byBBAddr, &byOrgData); return (byOrgData & byTestBits) == 0; @@ -2142,17 +2142,17 @@ BOOL BBbIsRegBitsOff (DWORD_PTR dwIoBase, BYTE byBBAddr, BYTE byTestBits) * Out: * none * - * Return Value: TRUE if succeeded; FALSE if failed. + * Return Value: true if succeeded; false if failed. * */ -BOOL BBbVT3253Init (PSDevice pDevice) +bool BBbVT3253Init (PSDevice pDevice) { - BOOL bResult = TRUE; + bool bResult = true; int ii; - DWORD_PTR dwIoBase = pDevice->PortOffset; - BYTE byRFType = pDevice->byRFType; - BYTE byLocalID = pDevice->byLocalID; + unsigned long dwIoBase = pDevice->PortOffset; + unsigned char byRFType = pDevice->byRFType; + unsigned char byLocalID = pDevice->byLocalID; if (byRFType == RF_RFMD2959) { if (byLocalID <= REV_ID_VT3253_A1) { @@ -2294,7 +2294,7 @@ BOOL BBbVT3253Init (PSDevice pDevice) //}} RobertYu } else { // No VGA Table now - pDevice->bUpdateBBVGA = FALSE; + pDevice->bUpdateBBVGA = false; pDevice->abyBBVGA[0] = 0x1C; } @@ -2321,12 +2321,12 @@ BOOL BBbVT3253Init (PSDevice pDevice) * Return Value: none * */ -void BBvReadAllRegs (DWORD_PTR dwIoBase, PBYTE pbyBBRegs) +void BBvReadAllRegs (unsigned long dwIoBase, unsigned char *pbyBBRegs) { int ii; - BYTE byBase = 1; + unsigned char byBase = 1; for (ii = 0; ii < BB_MAX_CONTEXT_SIZE; ii++) { - BBbReadEmbeded(dwIoBase, (BYTE)(ii*byBase), pbyBBRegs); + BBbReadEmbeded(dwIoBase, (unsigned char)(ii*byBase), pbyBBRegs); pbyBBRegs += byBase; } } @@ -2348,8 +2348,8 @@ void BBvReadAllRegs (DWORD_PTR dwIoBase, PBYTE pbyBBRegs) void BBvLoopbackOn (PSDevice pDevice) { - BYTE byData; - DWORD_PTR dwIoBase = pDevice->PortOffset; + unsigned char byData; + unsigned long dwIoBase = pDevice->PortOffset; //CR C9 = 0x00 BBbReadEmbeded(dwIoBase, 0xC9, &pDevice->byBBCRc9);//CR201 @@ -2363,7 +2363,7 @@ void BBvLoopbackOn (PSDevice pDevice) if (pDevice->uConnectionRate <= RATE_11M) { //CCK // Enable internal digital loopback: CR33 |= 0000 0001 BBbReadEmbeded(dwIoBase, 0x21, &byData);//CR33 - BBbWriteEmbeded(dwIoBase, 0x21, (BYTE)(byData | 0x01));//CR33 + BBbWriteEmbeded(dwIoBase, 0x21, (unsigned char)(byData | 0x01));//CR33 // CR154 = 0x00 BBbWriteEmbeded(dwIoBase, 0x9A, 0); //CR154 @@ -2372,7 +2372,7 @@ void BBvLoopbackOn (PSDevice pDevice) else { //OFDM // Enable internal digital loopback:CR154 |= 0000 0001 BBbReadEmbeded(dwIoBase, 0x9A, &byData);//CR154 - BBbWriteEmbeded(dwIoBase, 0x9A, (BYTE)(byData | 0x01));//CR154 + BBbWriteEmbeded(dwIoBase, 0x9A, (unsigned char)(byData | 0x01));//CR154 // CR33 = 0x00 BBbWriteEmbeded(dwIoBase, 0x21, 0); //CR33 @@ -2384,7 +2384,7 @@ void BBvLoopbackOn (PSDevice pDevice) // Disable TX_IQUN BBbReadEmbeded(pDevice->PortOffset, 0x09, &pDevice->byBBCR09); - BBbWriteEmbeded(pDevice->PortOffset, 0x09, (BYTE)(pDevice->byBBCR09 & 0xDE)); + BBbWriteEmbeded(pDevice->PortOffset, 0x09, (unsigned char)(pDevice->byBBCR09 & 0xDE)); } /* @@ -2402,8 +2402,8 @@ void BBvLoopbackOn (PSDevice pDevice) */ void BBvLoopbackOff (PSDevice pDevice) { - BYTE byData; - DWORD_PTR dwIoBase = pDevice->PortOffset; + unsigned char byData; + unsigned long dwIoBase = pDevice->PortOffset; BBbWriteEmbeded(dwIoBase, 0xC9, pDevice->byBBCRc9);//CR201 BBbWriteEmbeded(dwIoBase, 0x88, pDevice->byBBCR88);//CR136 @@ -2413,14 +2413,14 @@ void BBvLoopbackOff (PSDevice pDevice) if (pDevice->uConnectionRate <= RATE_11M) { // CCK // Set the CR33 Bit2 to disable internal Loopback. BBbReadEmbeded(dwIoBase, 0x21, &byData);//CR33 - BBbWriteEmbeded(dwIoBase, 0x21, (BYTE)(byData & 0xFE));//CR33 + BBbWriteEmbeded(dwIoBase, 0x21, (unsigned char)(byData & 0xFE));//CR33 } else { // OFDM BBbReadEmbeded(dwIoBase, 0x9A, &byData);//CR154 - BBbWriteEmbeded(dwIoBase, 0x9A, (BYTE)(byData & 0xFE));//CR154 + BBbWriteEmbeded(dwIoBase, 0x9A, (unsigned char)(byData & 0xFE));//CR154 } BBbReadEmbeded(dwIoBase, 0x0E, &byData);//CR14 - BBbWriteEmbeded(dwIoBase, 0x0E, (BYTE)(byData | 0x80));//CR14 + BBbWriteEmbeded(dwIoBase, 0x0E, (unsigned char)(byData | 0x80));//CR14 } @@ -2441,8 +2441,8 @@ void BBvLoopbackOff (PSDevice pDevice) void BBvSetShortSlotTime (PSDevice pDevice) { - BYTE byBBRxConf=0; - BYTE byBBVGA=0; + unsigned char byBBRxConf=0; + unsigned char byBBVGA=0; BBbReadEmbeded(pDevice->PortOffset, 0x0A, &byBBRxConf);//CR10 @@ -2462,9 +2462,9 @@ BBvSetShortSlotTime (PSDevice pDevice) } -void BBvSetVGAGainOffset(PSDevice pDevice, BYTE byData) +void BBvSetVGAGainOffset(PSDevice pDevice, unsigned char byData) { - BYTE byBBRxConf=0; + unsigned char byBBRxConf=0; BBbWriteEmbeded(pDevice->PortOffset, 0xE7, byData); @@ -2495,7 +2495,7 @@ void BBvSetVGAGainOffset(PSDevice pDevice, BYTE byData) * */ void -BBvSoftwareReset (DWORD_PTR dwIoBase) +BBvSoftwareReset (unsigned long dwIoBase) { BBbWriteEmbeded(dwIoBase, 0x50, 0x40); BBbWriteEmbeded(dwIoBase, 0x50, 0); @@ -2516,9 +2516,9 @@ BBvSoftwareReset (DWORD_PTR dwIoBase) * */ void -BBvPowerSaveModeON (DWORD_PTR dwIoBase) +BBvPowerSaveModeON (unsigned long dwIoBase) { - BYTE byOrgData; + unsigned char byOrgData; BBbReadEmbeded(dwIoBase, 0x0D, &byOrgData); byOrgData |= BIT0; @@ -2538,9 +2538,9 @@ BBvPowerSaveModeON (DWORD_PTR dwIoBase) * */ void -BBvPowerSaveModeOFF (DWORD_PTR dwIoBase) +BBvPowerSaveModeOFF (unsigned long dwIoBase) { - BYTE byOrgData; + unsigned char byOrgData; BBbReadEmbeded(dwIoBase, 0x0D, &byOrgData); byOrgData &= ~(BIT0); @@ -2562,9 +2562,9 @@ BBvPowerSaveModeOFF (DWORD_PTR dwIoBase) */ void -BBvSetTxAntennaMode (DWORD_PTR dwIoBase, BYTE byAntennaMode) +BBvSetTxAntennaMode (unsigned long dwIoBase, unsigned char byAntennaMode) { - BYTE byBBTxConf; + unsigned char byBBTxConf; #ifdef PLICE_DEBUG //printk("Enter BBvSetTxAntennaMode\n"); @@ -2604,9 +2604,9 @@ BBvSetTxAntennaMode (DWORD_PTR dwIoBase, BYTE byAntennaMode) */ void -BBvSetRxAntennaMode (DWORD_PTR dwIoBase, BYTE byAntennaMode) +BBvSetRxAntennaMode (unsigned long dwIoBase, unsigned char byAntennaMode) { - BYTE byBBRxConf; + unsigned char byBBRxConf; BBbReadEmbeded(dwIoBase, 0x0A, &byBBRxConf);//CR10 if (byAntennaMode == ANT_DIVERSITY) { @@ -2635,14 +2635,14 @@ BBvSetRxAntennaMode (DWORD_PTR dwIoBase, BYTE byAntennaMode) * */ void -BBvSetDeepSleep (DWORD_PTR dwIoBase, BYTE byLocalID) +BBvSetDeepSleep (unsigned long dwIoBase, unsigned char byLocalID) { BBbWriteEmbeded(dwIoBase, 0x0C, 0x17);//CR12 BBbWriteEmbeded(dwIoBase, 0x0D, 0xB9);//CR13 } void -BBvExitDeepSleep (DWORD_PTR dwIoBase, BYTE byLocalID) +BBvExitDeepSleep (unsigned long dwIoBase, unsigned char byLocalID) { BBbWriteEmbeded(dwIoBase, 0x0C, 0x00);//CR12 BBbWriteEmbeded(dwIoBase, 0x0D, 0x01);//CR13 @@ -2651,12 +2651,12 @@ BBvExitDeepSleep (DWORD_PTR dwIoBase, BYTE byLocalID) static -ULONG +unsigned long s_ulGetRatio (PSDevice pDevice) { -ULONG ulRatio = 0; -ULONG ulMaxPacket; -ULONG ulPacketNum; +unsigned long ulRatio = 0; +unsigned long ulMaxPacket; +unsigned long ulPacketNum; //This is a thousand-ratio ulMaxPacket = pDevice->uNumSQ3[RATE_54M]; @@ -2762,7 +2762,7 @@ ULONG ulPacketNum; void BBvClearAntDivSQ3Value (PSDevice pDevice) { - UINT ii; + unsigned int ii; pDevice->uDiversityCnt = 0; for (ii = 0; ii < MAX_RATE; ii++) { @@ -2787,7 +2787,7 @@ BBvClearAntDivSQ3Value (PSDevice pDevice) */ void -BBvAntennaDiversity (PSDevice pDevice, BYTE byRxRate, BYTE bySQ3) +BBvAntennaDiversity (PSDevice pDevice, unsigned char byRxRate, unsigned char bySQ3) { if ((byRxRate >= MAX_RATE) || (pDevice->wAntDiversityMaxRate >= MAX_RATE)) { diff --git a/drivers/staging/vt6655/baseband.h b/drivers/staging/vt6655/baseband.h index b236ff4139a..8294bdbb7b5 100644 --- a/drivers/staging/vt6655/baseband.h +++ b/drivers/staging/vt6655/baseband.h @@ -118,45 +118,45 @@ /*--------------------- Export Functions --------------------------*/ -UINT +unsigned int BBuGetFrameTime( - BYTE byPreambleType, - BYTE byPktType, - UINT cbFrameLength, - WORD wRate + unsigned char byPreambleType, + unsigned char byPktType, + unsigned int cbFrameLength, + unsigned short wRate ); void BBvCaculateParameter ( PSDevice pDevice, - UINT cbFrameLength, - WORD wRate, - BYTE byPacketType, - PWORD pwPhyLen, - PBYTE pbyPhySrv, - PBYTE pbyPhySgn + unsigned int cbFrameLength, + unsigned short wRate, + unsigned char byPacketType, + unsigned short *pwPhyLen, + unsigned char *pbyPhySrv, + unsigned char *pbyPhySgn ); -BOOL BBbReadEmbeded(DWORD_PTR dwIoBase, BYTE byBBAddr, PBYTE pbyData); -BOOL BBbWriteEmbeded(DWORD_PTR dwIoBase, BYTE byBBAddr, BYTE byData); +bool BBbReadEmbeded(unsigned long dwIoBase, unsigned char byBBAddr, unsigned char *pbyData); +bool BBbWriteEmbeded(unsigned long dwIoBase, unsigned char byBBAddr, unsigned char byData); -void BBvReadAllRegs(DWORD_PTR dwIoBase, PBYTE pbyBBRegs); +void BBvReadAllRegs(unsigned long dwIoBase, unsigned char *pbyBBRegs); void BBvLoopbackOn(PSDevice pDevice); void BBvLoopbackOff(PSDevice pDevice); void BBvSetShortSlotTime(PSDevice pDevice); -BOOL BBbIsRegBitsOn(DWORD_PTR dwIoBase, BYTE byBBAddr, BYTE byTestBits); -BOOL BBbIsRegBitsOff(DWORD_PTR dwIoBase, BYTE byBBAddr, BYTE byTestBits); -void BBvSetVGAGainOffset(PSDevice pDevice, BYTE byData); +bool BBbIsRegBitsOn(unsigned long dwIoBase, unsigned char byBBAddr, unsigned char byTestBits); +bool BBbIsRegBitsOff(unsigned long dwIoBase, unsigned char byBBAddr, unsigned char byTestBits); +void BBvSetVGAGainOffset(PSDevice pDevice, unsigned char byData); // VT3253 Baseband -BOOL BBbVT3253Init(PSDevice pDevice); -void BBvSoftwareReset(DWORD_PTR dwIoBase); -void BBvPowerSaveModeON(DWORD_PTR dwIoBase); -void BBvPowerSaveModeOFF(DWORD_PTR dwIoBase); -void BBvSetTxAntennaMode(DWORD_PTR dwIoBase, BYTE byAntennaMode); -void BBvSetRxAntennaMode(DWORD_PTR dwIoBase, BYTE byAntennaMode); -void BBvSetDeepSleep(DWORD_PTR dwIoBase, BYTE byLocalID); -void BBvExitDeepSleep(DWORD_PTR dwIoBase, BYTE byLocalID); +bool BBbVT3253Init(PSDevice pDevice); +void BBvSoftwareReset(unsigned long dwIoBase); +void BBvPowerSaveModeON(unsigned long dwIoBase); +void BBvPowerSaveModeOFF(unsigned long dwIoBase); +void BBvSetTxAntennaMode(unsigned long dwIoBase, unsigned char byAntennaMode); +void BBvSetRxAntennaMode(unsigned long dwIoBase, unsigned char byAntennaMode); +void BBvSetDeepSleep(unsigned long dwIoBase, unsigned char byLocalID); +void BBvExitDeepSleep(unsigned long dwIoBase, unsigned char byLocalID); // timer for antenna diversity @@ -170,7 +170,7 @@ TimerState1CallBack( void *hDeviceContext ); -void BBvAntennaDiversity(PSDevice pDevice, BYTE byRxRate, BYTE bySQ3); +void BBvAntennaDiversity(PSDevice pDevice, unsigned char byRxRate, unsigned char bySQ3); void BBvClearAntDivSQ3Value (PSDevice pDevice); diff --git a/drivers/staging/vt6655/bssdb.c b/drivers/staging/vt6655/bssdb.c index 6312a55dab1..57c1cc90afc 100644 --- a/drivers/staging/vt6655/bssdb.c +++ b/drivers/staging/vt6655/bssdb.c @@ -53,6 +53,7 @@ #include "baseband.h" #include "rf.h" #include "card.h" +#include "channel.h" #include "mac.h" #include "wpa2.h" #include "iowpa.h" @@ -71,14 +72,14 @@ static int msglevel =MSG_LEVEL_INFO; -const WORD awHWRetry0[5][5] = { +const unsigned short awHWRetry0[5][5] = { {RATE_18M, RATE_18M, RATE_12M, RATE_12M, RATE_12M}, {RATE_24M, RATE_24M, RATE_18M, RATE_12M, RATE_12M}, {RATE_36M, RATE_36M, RATE_24M, RATE_18M, RATE_18M}, {RATE_48M, RATE_48M, RATE_36M, RATE_24M, RATE_24M}, {RATE_54M, RATE_54M, RATE_48M, RATE_36M, RATE_36M} }; -const WORD awHWRetry1[5][5] = { +const unsigned short awHWRetry1[5][5] = { {RATE_18M, RATE_18M, RATE_12M, RATE_6M, RATE_6M}, {RATE_24M, RATE_24M, RATE_18M, RATE_6M, RATE_6M}, {RATE_36M, RATE_36M, RATE_24M, RATE_12M, RATE_12M}, @@ -126,25 +127,25 @@ void s_vCheckPreEDThreshold( PKnownBSS BSSpSearchBSSList( void *hDeviceContext, - PBYTE pbyDesireBSSID, - PBYTE pbyDesireSSID, + unsigned char *pbyDesireBSSID, + unsigned char *pbyDesireSSID, CARD_PHY_TYPE ePhyType ) { PSDevice pDevice = (PSDevice)hDeviceContext; PSMgmtObject pMgmt = pDevice->pMgmt; - PBYTE pbyBSSID = NULL; + unsigned char *pbyBSSID = NULL; PWLAN_IE_SSID pSSID = NULL; PKnownBSS pCurrBSS = NULL; PKnownBSS pSelect = NULL; -BYTE ZeroBSSID[WLAN_BSSID_LEN]={0x00,0x00,0x00,0x00,0x00,0x00}; - UINT ii = 0; -// UINT jj = 0; //DavidWang + unsigned char ZeroBSSID[WLAN_BSSID_LEN]={0x00,0x00,0x00,0x00,0x00,0x00}; + unsigned int ii = 0; + if (pbyDesireBSSID != NULL) { DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"BSSpSearchBSSList BSSID[%02X %02X %02X-%02X %02X %02X]\n", *pbyDesireBSSID,*(pbyDesireBSSID+1),*(pbyDesireBSSID+2), *(pbyDesireBSSID+3),*(pbyDesireBSSID+4),*(pbyDesireBSSID+5)); - if ((!IS_BROADCAST_ADDRESS(pbyDesireBSSID)) && + if ((!is_broadcast_ether_addr(pbyDesireBSSID)) && (memcmp(pbyDesireBSSID, ZeroBSSID, 6)!= 0)){ pbyBSSID = pbyDesireBSSID; } @@ -159,10 +160,10 @@ BYTE ZeroBSSID[WLAN_BSSID_LEN]={0x00,0x00,0x00,0x00,0x00,0x00}; // match BSSID first for (ii = 0; ii <MAX_BSS_NUM; ii++) { pCurrBSS = &(pMgmt->sBSSList[ii]); -if(pDevice->bLinkPass==FALSE) pCurrBSS->bSelected = FALSE; +if(pDevice->bLinkPass==false) pCurrBSS->bSelected = false; if ((pCurrBSS->bActive) && - (pCurrBSS->bSelected == FALSE)) { - if (IS_ETH_ADDRESS_EQUAL(pCurrBSS->abyBSSID, pbyBSSID)) { + (pCurrBSS->bSelected == false)) { + if (!compare_ether_addr(pCurrBSS->abyBSSID, pbyBSSID)) { if (pSSID != NULL) { // compare ssid if ( !memcmp(pSSID->abySSID, @@ -172,7 +173,7 @@ if(pDevice->bLinkPass==FALSE) pCurrBSS->bSelected = FALSE; ((pMgmt->eConfigMode == WMAC_CONFIG_IBSS_STA) && WLAN_GET_CAP_INFO_IBSS(pCurrBSS->wCapInfo)) || ((pMgmt->eConfigMode == WMAC_CONFIG_ESS_STA) && WLAN_GET_CAP_INFO_ESS(pCurrBSS->wCapInfo)) ) { - pCurrBSS->bSelected = TRUE; + pCurrBSS->bSelected = true; return(pCurrBSS); } } @@ -181,7 +182,7 @@ if(pDevice->bLinkPass==FALSE) pCurrBSS->bSelected = FALSE; ((pMgmt->eConfigMode == WMAC_CONFIG_IBSS_STA) && WLAN_GET_CAP_INFO_IBSS(pCurrBSS->wCapInfo)) || ((pMgmt->eConfigMode == WMAC_CONFIG_ESS_STA) && WLAN_GET_CAP_INFO_ESS(pCurrBSS->wCapInfo)) ) { - pCurrBSS->bSelected = TRUE; + pCurrBSS->bSelected = true; return(pCurrBSS); } } @@ -193,7 +194,7 @@ if(pDevice->bLinkPass==FALSE) pCurrBSS->bSelected = FALSE; for (ii = 0; ii <MAX_BSS_NUM; ii++) { pCurrBSS = &(pMgmt->sBSSList[ii]); //2007-0721-01<Add>by MikeLiu - pCurrBSS->bSelected = FALSE; + pCurrBSS->bSelected = false; if (pCurrBSS->bActive) { if (pSSID != NULL) { @@ -224,19 +225,19 @@ if(pDevice->bLinkPass==FALSE) pCurrBSS->bSelected = FALSE; } /* if (pMgmt->eAuthenMode < WMAC_AUTH_WPA) { - if (pCurrBSS->bWPAValid == TRUE) { + if (pCurrBSS->bWPAValid == true) { // WPA AP will reject connection of station without WPA enable. continue; } } else if ((pMgmt->eAuthenMode == WMAC_AUTH_WPA) || (pMgmt->eAuthenMode == WMAC_AUTH_WPAPSK)) { - if (pCurrBSS->bWPAValid == FALSE) { + if (pCurrBSS->bWPAValid == false) { // station with WPA enable can't join NonWPA AP. continue; } } else if ((pMgmt->eAuthenMode == WMAC_AUTH_WPA2) || (pMgmt->eAuthenMode == WMAC_AUTH_WPA2PSK)) { - if (pCurrBSS->bWPA2Valid == FALSE) { + if (pCurrBSS->bWPA2Valid == false) { // station with WPA2 enable can't join NonWPA2 AP. continue; } @@ -253,9 +254,9 @@ if(pDevice->bLinkPass==FALSE) pCurrBSS->bSelected = FALSE; } } if (pSelect != NULL) { - pSelect->bSelected = TRUE; + pSelect->bSelected = true; /* - if (pDevice->bRoaming == FALSE) { + if (pDevice->bRoaming == false) { // Einsn Add @20070907 memset(pbyDesireSSID, 0, WLAN_IEHDR_LEN + WLAN_SSID_MAXLEN + 1); memcpy(pbyDesireSSID,pCurrBSS->abySSID,WLAN_IEHDR_LEN + WLAN_SSID_MAXLEN + 1) ; @@ -283,18 +284,18 @@ if(pDevice->bLinkPass==FALSE) pCurrBSS->bSelected = FALSE; void BSSvClearBSSList( void *hDeviceContext, - BOOL bKeepCurrBSSID + bool bKeepCurrBSSID ) { PSDevice pDevice = (PSDevice)hDeviceContext; PSMgmtObject pMgmt = pDevice->pMgmt; - UINT ii; + unsigned int ii; for (ii = 0; ii < MAX_BSS_NUM; ii++) { if (bKeepCurrBSSID) { if (pMgmt->sBSSList[ii].bActive && - IS_ETH_ADDRESS_EQUAL(pMgmt->sBSSList[ii].abyBSSID, pMgmt->abyCurrBSSID)) { - // bKeepCurrBSSID = FALSE; + !compare_ether_addr(pMgmt->sBSSList[ii].abyBSSID, pMgmt->abyCurrBSSID)) { + // bKeepCurrBSSID = false; continue; } } @@ -304,7 +305,7 @@ BSSvClearBSSList( continue; } - pMgmt->sBSSList[ii].bActive = FALSE; + pMgmt->sBSSList[ii].bActive = false; memset(&pMgmt->sBSSList[ii], 0, sizeof(KnownBSS)); } BSSvClearAnyBSSJoinRecord(pDevice); @@ -320,25 +321,25 @@ BSSvClearBSSList( * search BSS list by BSSID & SSID if matched * * Return Value: - * TRUE if found. + * true if found. * -*/ PKnownBSS BSSpAddrIsInBSSList( void *hDeviceContext, - PBYTE abyBSSID, + unsigned char *abyBSSID, PWLAN_IE_SSID pSSID ) { PSDevice pDevice = (PSDevice)hDeviceContext; PSMgmtObject pMgmt = pDevice->pMgmt; PKnownBSS pBSSList = NULL; - UINT ii; + unsigned int ii; for (ii = 0; ii < MAX_BSS_NUM; ii++) { pBSSList = &(pMgmt->sBSSList[ii]); if (pBSSList->bActive) { - if (IS_ETH_ADDRESS_EQUAL(pBSSList->abyBSSID, abyBSSID)) { + if (!compare_ether_addr(pBSSList->abyBSSID, abyBSSID)) { // if (pSSID == NULL) // return pBSSList; if (pSSID->len == ((PWLAN_IE_SSID)pBSSList->abySSID)->len){ @@ -362,18 +363,18 @@ BSSpAddrIsInBSSList( * Insert a BSS set into known BSS list * * Return Value: - * TRUE if success. + * true if success. * -*/ -BOOL +bool BSSbInsertToBSSList ( void *hDeviceContext, - PBYTE abyBSSIDAddr, + unsigned char *abyBSSIDAddr, QWORD qwTimestamp, - WORD wBeaconInterval, - WORD wCapInfo, - BYTE byCurrChannel, + unsigned short wBeaconInterval, + unsigned short wCapInfo, + unsigned char byCurrChannel, PWLAN_IE_SSID pSSID, PWLAN_IE_SUPP_RATES pSuppRates, PWLAN_IE_SUPP_RATES pExtSuppRates, @@ -382,8 +383,8 @@ BSSbInsertToBSSList ( PWLAN_IE_RSN_EXT pRSNWPA, PWLAN_IE_COUNTRY pIE_Country, PWLAN_IE_QUIET pIE_Quiet, - UINT uIELength, - PBYTE pbyIEs, + unsigned int uIELength, + unsigned char *pbyIEs, void *pRxPacketContext ) { @@ -392,8 +393,8 @@ BSSbInsertToBSSList ( PSMgmtObject pMgmt = pDevice->pMgmt; PSRxMgmtPacket pRxPacket = (PSRxMgmtPacket)pRxPacketContext; PKnownBSS pBSSList = NULL; - UINT ii; - BOOL bParsingQuiet = FALSE; + unsigned int ii; + bool bParsingQuiet = false; PWLAN_IE_QUIET pQuiet = NULL; @@ -408,10 +409,10 @@ BSSbInsertToBSSList ( if (ii == MAX_BSS_NUM){ DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Get free KnowBSS node failed.\n"); - return FALSE; + return false; } // save the BSS info - pBSSList->bActive = TRUE; + pBSSList->bActive = true; memcpy( pBSSList->abyBSSID, abyBSSIDAddr, WLAN_BSSID_LEN); HIDWORD(pBSSList->qwBSSTimestamp) = cpu_to_le32(HIDWORD(qwTimestamp)); LODWORD(pBSSList->qwBSSTimestamp) = cpu_to_le32(LODWORD(qwTimestamp)); @@ -445,7 +446,7 @@ BSSbInsertToBSSList ( if (pBSSList->uChannel > CB_MAX_CHANNEL_24G) { pBSSList->eNetworkTypeInUse = PHY_TYPE_11A; } else { - if (pBSSList->sERP.bERPExist == TRUE) { + if (pBSSList->sERP.bERPExist == true) { pBSSList->eNetworkTypeInUse = PHY_TYPE_11G; } else { pBSSList->eNetworkTypeInUse = PHY_TYPE_11B; @@ -461,16 +462,16 @@ BSSbInsertToBSSList ( (pMgmt->eCurrState == WMAC_STATE_ASSOC)) { // assoc with BSS if (pBSSList == pMgmt->pCurrBSS) { - bParsingQuiet = TRUE; + bParsingQuiet = true; } } WPA_ClearRSN(pBSSList); if (pRSNWPA != NULL) { - UINT uLen = pRSNWPA->len + 2; + unsigned int uLen = pRSNWPA->len + 2; - if (uLen <= (uIELength - (UINT)(ULONG_PTR)((PBYTE)pRSNWPA - pbyIEs))) { + if (uLen <= (uIELength - (unsigned int)((unsigned char *)pRSNWPA - pbyIEs))) { pBSSList->wWPALen = uLen; memcpy(pBSSList->byWPAIE, pRSNWPA, uLen); WPA_ParseRSN(pBSSList, pRSNWPA); @@ -480,33 +481,33 @@ BSSbInsertToBSSList ( WPA2_ClearRSN(pBSSList); if (pRSN != NULL) { - UINT uLen = pRSN->len + 2; - if (uLen <= (uIELength - (UINT)(ULONG_PTR)((PBYTE)pRSN - pbyIEs))) { + unsigned int uLen = pRSN->len + 2; + if (uLen <= (uIELength - (unsigned int)((unsigned char *)pRSN - pbyIEs))) { pBSSList->wRSNLen = uLen; memcpy(pBSSList->byRSNIE, pRSN, uLen); WPA2vParseRSN(pBSSList, pRSN); } } - if ((pMgmt->eAuthenMode == WMAC_AUTH_WPA2) || (pBSSList->bWPA2Valid == TRUE)) { + if ((pMgmt->eAuthenMode == WMAC_AUTH_WPA2) || (pBSSList->bWPA2Valid == true)) { PSKeyItem pTransmitKey = NULL; - BOOL bIs802_1x = FALSE; + bool bIs802_1x = false; for (ii = 0; ii < pBSSList->wAKMSSAuthCount; ii ++) { if (pBSSList->abyAKMSSAuthType[ii] == WLAN_11i_AKMSS_802_1X) { - bIs802_1x = TRUE; + bIs802_1x = true; break; } } - if ((bIs802_1x == TRUE) && (pSSID->len == ((PWLAN_IE_SSID)pMgmt->abyDesireSSID)->len) && + if ((bIs802_1x == true) && (pSSID->len == ((PWLAN_IE_SSID)pMgmt->abyDesireSSID)->len) && ( !memcmp(pSSID->abySSID, ((PWLAN_IE_SSID)pMgmt->abyDesireSSID)->abySSID, pSSID->len))) { bAdd_PMKID_Candidate((void *)pDevice, pBSSList->abyBSSID, &pBSSList->sRSNCapObj); - if ((pDevice->bLinkPass == TRUE) && (pMgmt->eCurrState == WMAC_STATE_ASSOC)) { - if ((KeybGetTransmitKey(&(pDevice->sKey), pDevice->abyBSSID, PAIRWISE_KEY, &pTransmitKey) == TRUE) || - (KeybGetTransmitKey(&(pDevice->sKey), pDevice->abyBSSID, GROUP_KEY, &pTransmitKey) == TRUE)) { + if ((pDevice->bLinkPass == true) && (pMgmt->eCurrState == WMAC_STATE_ASSOC)) { + if ((KeybGetTransmitKey(&(pDevice->sKey), pDevice->abyBSSID, PAIRWISE_KEY, &pTransmitKey) == true) || + (KeybGetTransmitKey(&(pDevice->sKey), pDevice->abyBSSID, GROUP_KEY, &pTransmitKey) == true)) { pDevice->gsPMKIDCandidate.StatusType = Ndis802_11StatusType_PMKID_CandidateList; pDevice->gsPMKIDCandidate.Version = 1; @@ -519,46 +520,45 @@ BSSbInsertToBSSList ( if (pDevice->bUpdateBBVGA) { // Moniter if RSSI is too strong. pBSSList->byRSSIStatCnt = 0; - RFvRSSITodBm(pDevice, (BYTE)(pRxPacket->uRSSI), &pBSSList->ldBmMAX); + RFvRSSITodBm(pDevice, (unsigned char)(pRxPacket->uRSSI), &pBSSList->ldBmMAX); pBSSList->ldBmAverage[0] = pBSSList->ldBmMAX; for (ii = 1; ii < RSSI_STAT_COUNT; ii++) pBSSList->ldBmAverage[ii] = 0; } if ((pIE_Country != NULL) && - (pMgmt->b11hEnable == TRUE)) { - CARDvSetCountryInfo(pMgmt->pAdapter, - pBSSList->eNetworkTypeInUse, + (pMgmt->b11hEnable == true)) { + set_country_info(pMgmt->pAdapter, pBSSList->eNetworkTypeInUse, pIE_Country); } - if ((bParsingQuiet == TRUE) && (pIE_Quiet != NULL)) { + if ((bParsingQuiet == true) && (pIE_Quiet != NULL)) { if ((((PWLAN_IE_QUIET)pIE_Quiet)->len == 8) && (((PWLAN_IE_QUIET)pIE_Quiet)->byQuietCount != 0)) { // valid EID if (pQuiet == NULL) { pQuiet = (PWLAN_IE_QUIET)pIE_Quiet; CARDbSetQuiet( pMgmt->pAdapter, - TRUE, + true, pQuiet->byQuietCount, pQuiet->byQuietPeriod, - *((PWORD)pQuiet->abyQuietDuration), - *((PWORD)pQuiet->abyQuietOffset) + *((unsigned short *)pQuiet->abyQuietDuration), + *((unsigned short *)pQuiet->abyQuietOffset) ); } else { pQuiet = (PWLAN_IE_QUIET)pIE_Quiet; CARDbSetQuiet( pMgmt->pAdapter, - FALSE, + false, pQuiet->byQuietCount, pQuiet->byQuietPeriod, - *((PWORD)pQuiet->abyQuietDuration), - *((PWORD)pQuiet->abyQuietOffset) + *((unsigned short *)pQuiet->abyQuietDuration), + *((unsigned short *)pQuiet->abyQuietOffset) ); } } } - if ((bParsingQuiet == TRUE) && + if ((bParsingQuiet == true) && (pQuiet != NULL)) { CARDbStartQuiet(pMgmt->pAdapter); } @@ -568,7 +568,7 @@ BSSbInsertToBSSList ( pBSSList->uIELength = WLAN_BEACON_FR_MAXLEN; memcpy(pBSSList->abyIEs, pbyIEs, pBSSList->uIELength); - return TRUE; + return true; } @@ -578,19 +578,19 @@ BSSbInsertToBSSList ( * Update BSS set in known BSS list * * Return Value: - * TRUE if success. + * true if success. * -*/ // TODO: input structure modify -BOOL +bool BSSbUpdateToBSSList ( void *hDeviceContext, QWORD qwTimestamp, - WORD wBeaconInterval, - WORD wCapInfo, - BYTE byCurrChannel, - BOOL bChannelHit, + unsigned short wBeaconInterval, + unsigned short wCapInfo, + unsigned char byCurrChannel, + bool bChannelHit, PWLAN_IE_SSID pSSID, PWLAN_IE_SUPP_RATES pSuppRates, PWLAN_IE_SUPP_RATES pExtSuppRates, @@ -600,8 +600,8 @@ BSSbUpdateToBSSList ( PWLAN_IE_COUNTRY pIE_Country, PWLAN_IE_QUIET pIE_Quiet, PKnownBSS pBSSList, - UINT uIELength, - PBYTE pbyIEs, + unsigned int uIELength, + unsigned char *pbyIEs, void *pRxPacketContext ) { @@ -609,14 +609,14 @@ BSSbUpdateToBSSList ( PSDevice pDevice = (PSDevice)hDeviceContext; PSMgmtObject pMgmt = pDevice->pMgmt; PSRxMgmtPacket pRxPacket = (PSRxMgmtPacket)pRxPacketContext; - LONG ldBm; - BOOL bParsingQuiet = FALSE; + long ldBm; + bool bParsingQuiet = false; PWLAN_IE_QUIET pQuiet = NULL; if (pBSSList == NULL) - return FALSE; + return false; HIDWORD(pBSSList->qwBSSTimestamp) = cpu_to_le32(HIDWORD(qwTimestamp)); @@ -646,7 +646,7 @@ BSSbUpdateToBSSList ( if (pBSSList->uChannel > CB_MAX_CHANNEL_24G) { pBSSList->eNetworkTypeInUse = PHY_TYPE_11A; } else { - if (pBSSList->sERP.bERPExist == TRUE) { + if (pBSSList->sERP.bERPExist == true) { pBSSList->eNetworkTypeInUse = PHY_TYPE_11G; } else { pBSSList->eNetworkTypeInUse = PHY_TYPE_11B; @@ -663,15 +663,15 @@ BSSbUpdateToBSSList ( (pMgmt->eCurrState == WMAC_STATE_ASSOC)) { // assoc with BSS if (pBSSList == pMgmt->pCurrBSS) { - bParsingQuiet = TRUE; + bParsingQuiet = true; } } WPA_ClearRSN(pBSSList); //mike update if (pRSNWPA != NULL) { - UINT uLen = pRSNWPA->len + 2; - if (uLen <= (uIELength - (UINT)(ULONG_PTR)((PBYTE)pRSNWPA - pbyIEs))) { + unsigned int uLen = pRSNWPA->len + 2; + if (uLen <= (uIELength - (unsigned int)((unsigned char *)pRSNWPA - pbyIEs))) { pBSSList->wWPALen = uLen; memcpy(pBSSList->byWPAIE, pRSNWPA, uLen); WPA_ParseRSN(pBSSList, pRSNWPA); @@ -681,8 +681,8 @@ BSSbUpdateToBSSList ( WPA2_ClearRSN(pBSSList); //mike update if (pRSN != NULL) { - UINT uLen = pRSN->len + 2; - if (uLen <= (uIELength - (UINT)(ULONG_PTR)((PBYTE)pRSN - pbyIEs))) { + unsigned int uLen = pRSN->len + 2; + if (uLen <= (uIELength - (unsigned int)((unsigned char *)pRSN - pbyIEs))) { pBSSList->wRSNLen = uLen; memcpy(pBSSList->byRSNIE, pRSN, uLen); WPA2vParseRSN(pBSSList, pRSN); @@ -690,7 +690,7 @@ BSSbUpdateToBSSList ( } if (pRxPacket->uRSSI != 0) { - RFvRSSITodBm(pDevice, (BYTE)(pRxPacket->uRSSI), &ldBm); + RFvRSSITodBm(pDevice, (unsigned char)(pRxPacket->uRSSI), &ldBm); // Moniter if RSSI is too strong. pBSSList->byRSSIStatCnt++; pBSSList->byRSSIStatCnt %= RSSI_STAT_COUNT; @@ -703,39 +703,38 @@ BSSbUpdateToBSSList ( } if ((pIE_Country != NULL) && - (pMgmt->b11hEnable == TRUE)) { - CARDvSetCountryInfo(pMgmt->pAdapter, - pBSSList->eNetworkTypeInUse, + (pMgmt->b11hEnable == true)) { + set_country_info(pMgmt->pAdapter, pBSSList->eNetworkTypeInUse, pIE_Country); } - if ((bParsingQuiet == TRUE) && (pIE_Quiet != NULL)) { + if ((bParsingQuiet == true) && (pIE_Quiet != NULL)) { if ((((PWLAN_IE_QUIET)pIE_Quiet)->len == 8) && (((PWLAN_IE_QUIET)pIE_Quiet)->byQuietCount != 0)) { // valid EID if (pQuiet == NULL) { pQuiet = (PWLAN_IE_QUIET)pIE_Quiet; CARDbSetQuiet( pMgmt->pAdapter, - TRUE, + true, pQuiet->byQuietCount, pQuiet->byQuietPeriod, - *((PWORD)pQuiet->abyQuietDuration), - *((PWORD)pQuiet->abyQuietOffset) + *((unsigned short *)pQuiet->abyQuietDuration), + *((unsigned short *)pQuiet->abyQuietOffset) ); } else { pQuiet = (PWLAN_IE_QUIET)pIE_Quiet; CARDbSetQuiet( pMgmt->pAdapter, - FALSE, + false, pQuiet->byQuietCount, pQuiet->byQuietPeriod, - *((PWORD)pQuiet->abyQuietDuration), - *((PWORD)pQuiet->abyQuietOffset) + *((unsigned short *)pQuiet->abyQuietDuration), + *((unsigned short *)pQuiet->abyQuietOffset) ); } } } - if ((bParsingQuiet == TRUE) && + if ((bParsingQuiet == true) && (pQuiet != NULL)) { CARDbStartQuiet(pMgmt->pAdapter); } @@ -745,7 +744,7 @@ BSSbUpdateToBSSList ( pBSSList->uIELength = WLAN_BEACON_FR_MAXLEN; memcpy(pBSSList->abyIEs, pbyIEs, pBSSList->uIELength); - return TRUE; + return true; } @@ -762,27 +761,24 @@ BSSbUpdateToBSSList ( * -*/ -BOOL -BSSDBbIsSTAInNodeDB( - void *pMgmtObject, - PBYTE abyDstAddr, - PUINT puNodeIndex - ) +bool +BSSDBbIsSTAInNodeDB(void *pMgmtObject, unsigned char *abyDstAddr, + unsigned int *puNodeIndex) { PSMgmtObject pMgmt = (PSMgmtObject) pMgmtObject; - UINT ii; + unsigned int ii; // Index = 0 reserved for AP Node for (ii = 1; ii < (MAX_NODE_NUM + 1); ii++) { if (pMgmt->sNodeDBTable[ii].bActive) { - if (IS_ETH_ADDRESS_EQUAL(abyDstAddr, pMgmt->sNodeDBTable[ii].abyMACAddr)) { + if (!compare_ether_addr(abyDstAddr, pMgmt->sNodeDBTable[ii].abyMACAddr)) { *puNodeIndex = ii; - return TRUE; + return true; } } } - return FALSE; + return false; }; @@ -798,17 +794,14 @@ BSSDBbIsSTAInNodeDB( * -*/ void -BSSvCreateOneNode( - void *hDeviceContext, - PUINT puNodeIndex - ) +BSSvCreateOneNode(void *hDeviceContext, unsigned int *puNodeIndex) { PSDevice pDevice = (PSDevice)hDeviceContext; PSMgmtObject pMgmt = pDevice->pMgmt; - UINT ii; - UINT BigestCount = 0; - UINT SelectIndex; + unsigned int ii; + unsigned int BigestCount = 0; + unsigned int SelectIndex; struct sk_buff *skb; // Index = 0 reserved for AP Node (In STA mode) // Index = 0 reserved for Broadcast/MultiCast (In AP mode) @@ -840,7 +833,7 @@ BSSvCreateOneNode( } memset(&pMgmt->sNodeDBTable[*puNodeIndex], 0, sizeof(KnownNodeDB)); - pMgmt->sNodeDBTable[*puNodeIndex].bActive = TRUE; + pMgmt->sNodeDBTable[*puNodeIndex].bActive = true; pMgmt->sNodeDBTable[*puNodeIndex].uRatePollTimeout = FALLBACK_POLL_SECOND; // for AP mode PS queue skb_queue_head_init(&pMgmt->sNodeDBTable[*puNodeIndex].sTxPSQueue); @@ -865,13 +858,13 @@ BSSvCreateOneNode( void BSSvRemoveOneNode( void *hDeviceContext, - UINT uNodeIndex + unsigned int uNodeIndex ) { PSDevice pDevice = (PSDevice)hDeviceContext; PSMgmtObject pMgmt = pDevice->pMgmt; - BYTE byMask[8] = {1, 2, 4, 8, 0x10, 0x20, 0x40, 0x80}; + unsigned char byMask[8] = {1, 2, 4, 8, 0x10, 0x20, 0x40, 0x80}; struct sk_buff *skb; @@ -898,18 +891,18 @@ BSSvRemoveOneNode( void BSSvUpdateAPNode( void *hDeviceContext, - PWORD pwCapInfo, + unsigned short *pwCapInfo, PWLAN_IE_SUPP_RATES pSuppRates, PWLAN_IE_SUPP_RATES pExtSuppRates ) { PSDevice pDevice = (PSDevice)hDeviceContext; PSMgmtObject pMgmt = pDevice->pMgmt; - UINT uRateLen = WLAN_RATES_MAXLEN; + unsigned int uRateLen = WLAN_RATES_MAXLEN; memset(&pMgmt->sNodeDBTable[0], 0, sizeof(KnownNodeDB)); - pMgmt->sNodeDBTable[0].bActive = TRUE; + pMgmt->sNodeDBTable[0].bActive = true; if (pDevice->eCurrentPHYType == PHY_TYPE_11B) { uRateLen = WLAN_RATES_MAXLEN_11B; } @@ -922,7 +915,7 @@ BSSvUpdateAPNode( RATEvParseMaxRate((void *)pDevice, (PWLAN_IE_SUPP_RATES)pMgmt->abyCurrSuppRates, (PWLAN_IE_SUPP_RATES)pMgmt->abyCurrExtSuppRates, - TRUE, + true, &(pMgmt->sNodeDBTable[0].wMaxBasicRate), &(pMgmt->sNodeDBTable[0].wMaxSuppRate), &(pMgmt->sNodeDBTable[0].wSuppRate), @@ -969,13 +962,13 @@ BSSvAddMulticastNode( if (!pDevice->bEnableHostWEP) memset(&pMgmt->sNodeDBTable[0], 0, sizeof(KnownNodeDB)); memset(pMgmt->sNodeDBTable[0].abyMACAddr, 0xff, WLAN_ADDR_LEN); - pMgmt->sNodeDBTable[0].bActive = TRUE; - pMgmt->sNodeDBTable[0].bPSEnable = FALSE; + pMgmt->sNodeDBTable[0].bActive = true; + pMgmt->sNodeDBTable[0].bPSEnable = false; skb_queue_head_init(&pMgmt->sNodeDBTable[0].sTxPSQueue); RATEvParseMaxRate((void *)pDevice, (PWLAN_IE_SUPP_RATES)pMgmt->abyCurrSuppRates, (PWLAN_IE_SUPP_RATES)pMgmt->abyCurrExtSuppRates, - TRUE, + true, &(pMgmt->sNodeDBTable[0].wMaxBasicRate), &(pMgmt->sNodeDBTable[0].wMaxSuppRate), &(pMgmt->sNodeDBTable[0].wSuppRate), @@ -1008,8 +1001,8 @@ BSSvAddMulticastNode( -*/ //2008-4-14 <add> by chester for led issue #ifdef FOR_LED_ON_NOTEBOOK -BOOL cc=FALSE; -UINT status; +bool cc=false; +unsigned int status; #endif void BSSvSecondCallBack( @@ -1018,11 +1011,11 @@ BSSvSecondCallBack( { PSDevice pDevice = (PSDevice)hDeviceContext; PSMgmtObject pMgmt = pDevice->pMgmt; - UINT ii; + unsigned int ii; PWLAN_IE_SSID pItemSSID, pCurrSSID; - UINT uSleepySTACnt = 0; - UINT uNonShortSlotSTACnt = 0; - UINT uLongPreambleSTACnt = 0; + unsigned int uSleepySTACnt = 0; + unsigned int uNonShortSlotSTACnt = 0; + unsigned int uLongPreambleSTACnt = 0; viawget_wpa_header* wpahdr; //DavidWang spin_lock_irq(&pDevice->lock); @@ -1034,22 +1027,22 @@ BSSvSecondCallBack( //2008-4-14 <add> by chester for led issue #ifdef FOR_LED_ON_NOTEBOOK MACvGPIOIn(pDevice->PortOffset, &pDevice->byGPIO); -if ((( !(pDevice->byGPIO & GPIO0_DATA)&&(pDevice->bHWRadioOff == FALSE))||((pDevice->byGPIO & GPIO0_DATA)&&(pDevice->bHWRadioOff == TRUE)))&&(cc==FALSE)){ -cc=TRUE; +if ((( !(pDevice->byGPIO & GPIO0_DATA)&&(pDevice->bHWRadioOff == false))||((pDevice->byGPIO & GPIO0_DATA)&&(pDevice->bHWRadioOff == true)))&&(cc==false)){ +cc=true; } -else if(cc==TRUE){ +else if(cc==true){ -if(pDevice->bHWRadioOff == TRUE){ +if(pDevice->bHWRadioOff == true){ if ( !(pDevice->byGPIO & GPIO0_DATA)) //||( !(pDevice->byGPIO & GPIO0_DATA) && (pDevice->byRadioCtl & EEP_RADIOCTL_INV))) {if(status==1) goto start; status=1; CARDbRadioPowerOff(pDevice); - pMgmt->sNodeDBTable[0].bActive = FALSE; + pMgmt->sNodeDBTable[0].bActive = false; pMgmt->eCurrMode = WMAC_MODE_STANDBY; pMgmt->eCurrState = WMAC_STATE_IDLE; //netif_stop_queue(pDevice->dev); - pDevice->bLinkPass = FALSE; + pDevice->bLinkPass = false; } if (pDevice->byGPIO &GPIO0_DATA) @@ -1064,11 +1057,11 @@ else{ {if(status==3) goto start; status=3; CARDbRadioPowerOff(pDevice); - pMgmt->sNodeDBTable[0].bActive = FALSE; + pMgmt->sNodeDBTable[0].bActive = false; pMgmt->eCurrMode = WMAC_MODE_STANDBY; pMgmt->eCurrState = WMAC_STATE_IDLE; //netif_stop_queue(pDevice->dev); - pDevice->bLinkPass = FALSE; + pDevice->bLinkPass = false; } if ( !(pDevice->byGPIO & GPIO0_DATA)) @@ -1092,11 +1085,11 @@ start: { pDevice->byReAssocCount++; - if((pDevice->byReAssocCount > 10) && (pDevice->bLinkPass != TRUE)) { //10 sec timeout + if((pDevice->byReAssocCount > 10) && (pDevice->bLinkPass != true)) { //10 sec timeout printk("Re-association timeout!!!\n"); pDevice->byReAssocCount = 0; #ifdef WPA_SUPPLICANT_DRIVER_WEXT_SUPPORT - // if(pDevice->bWPASuppWextEnabled == TRUE) + // if(pDevice->bWPASuppWextEnabled == true) { union iwreq_data wrqu; memset(&wrqu, 0, sizeof (wrqu)); @@ -1106,7 +1099,7 @@ start: } #endif } - else if(pDevice->bLinkPass == TRUE) + else if(pDevice->bLinkPass == true) pDevice->byReAssocCount = 0; } @@ -1200,27 +1193,27 @@ start: if (WLAN_GET_ERP_USE_PROTECTION(pDevice->byERPFlag)) { if (!pDevice->bProtectMode) { MACvEnableProtectMD(pDevice->PortOffset); - pDevice->bProtectMode = TRUE; + pDevice->bProtectMode = true; } } else { if (pDevice->bProtectMode) { MACvDisableProtectMD(pDevice->PortOffset); - pDevice->bProtectMode = FALSE; + pDevice->bProtectMode = false; } } // on/off short slot time if (uNonShortSlotSTACnt > 0) { if (pDevice->bShortSlotTime) { - pDevice->bShortSlotTime = FALSE; + pDevice->bShortSlotTime = false; BBvSetShortSlotTime(pDevice); vUpdateIFS((void *)pDevice); } } else { if (!pDevice->bShortSlotTime) { - pDevice->bShortSlotTime = TRUE; + pDevice->bShortSlotTime = true; BBvSetShortSlotTime(pDevice); vUpdateIFS((void *)pDevice); } @@ -1231,13 +1224,13 @@ start: if (uLongPreambleSTACnt > 0) { if (!pDevice->bBarkerPreambleMd) { MACvEnableBarkerPreambleMd(pDevice->PortOffset); - pDevice->bBarkerPreambleMd = TRUE; + pDevice->bBarkerPreambleMd = true; } } else { if (pDevice->bBarkerPreambleMd) { MACvDisableBarkerPreambleMd(pDevice->PortOffset); - pDevice->bBarkerPreambleMd = FALSE; + pDevice->bBarkerPreambleMd = false; } } @@ -1247,9 +1240,9 @@ start: // Check if any STA in PS mode, enable DTIM multicast deliver if (pMgmt->eCurrMode == WMAC_MODE_ESS_AP) { if (uSleepySTACnt > 0) - pMgmt->sNodeDBTable[0].bPSEnable = TRUE; + pMgmt->sNodeDBTable[0].bPSEnable = true; else - pMgmt->sNodeDBTable[0].bPSEnable = FALSE; + pMgmt->sNodeDBTable[0].bPSEnable = false; } pItemSSID = (PWLAN_IE_SSID)pMgmt->abyDesireSSID; @@ -1276,12 +1269,12 @@ start: } if (pMgmt->sNodeDBTable[0].uInActiveCount >= LOST_BEACON_COUNT) { - pMgmt->sNodeDBTable[0].bActive = FALSE; + pMgmt->sNodeDBTable[0].bActive = false; pMgmt->eCurrMode = WMAC_MODE_STANDBY; pMgmt->eCurrState = WMAC_STATE_IDLE; netif_stop_queue(pDevice->dev); - pDevice->bLinkPass = FALSE; - pDevice->bRoaming = TRUE; + pDevice->bLinkPass = false; + pDevice->bRoaming = true; DBG_PRT(MSG_LEVEL_NOTICE, KERN_INFO "Lost AP beacon [%d] sec, disconnected !\n", pMgmt->sNodeDBTable[0].uInActiveCount); if ((pDevice->bWPADEVUp) && (pDevice->skb != NULL)) { wpahdr = (viawget_wpa_header *)pDevice->skb->data; @@ -1298,7 +1291,7 @@ start: pDevice->skb = dev_alloc_skb((int)pDevice->rx_buf_sz); }; #ifdef WPA_SUPPLICANT_DRIVER_WEXT_SUPPORT - // if(pDevice->bWPASuppWextEnabled == TRUE) + // if(pDevice->bWPASuppWextEnabled == true) { union iwreq_data wrqu; memset(&wrqu, 0, sizeof (wrqu)); @@ -1314,7 +1307,7 @@ start: pDevice->uAutoReConnectTime++; #ifdef WPA_SUPPLICANT_DRIVER_WEXT_SUPPORT //network manager support need not do Roaming scan??? - if(pDevice->bWPASuppWextEnabled ==TRUE) + if(pDevice->bWPASuppWextEnabled ==true) pDevice->uAutoReConnectTime = 0; #endif } @@ -1358,7 +1351,7 @@ start: pMgmt->sNodeDBTable[0].uInActiveCount = 0; pMgmt->eCurrState = WMAC_STATE_STARTED; netif_stop_queue(pDevice->dev); - pDevice->bLinkPass = FALSE; + pDevice->bLinkPass = false; } } } @@ -1391,23 +1384,23 @@ start: void BSSvUpdateNodeTxCounter( void *hDeviceContext, - BYTE byTsr0, - BYTE byTsr1, - PBYTE pbyBuffer, - UINT uFIFOHeaderSize + unsigned char byTsr0, + unsigned char byTsr1, + unsigned char *pbyBuffer, + unsigned int uFIFOHeaderSize ) { PSDevice pDevice = (PSDevice)hDeviceContext; PSMgmtObject pMgmt = pDevice->pMgmt; - UINT uNodeIndex = 0; - BYTE byTxRetry = (byTsr0 & TSR0_NCR); + unsigned int uNodeIndex = 0; + unsigned char byTxRetry = (byTsr0 & TSR0_NCR); PSTxBufHead pTxBufHead; PS802_11Header pMACHeader; - WORD wRate; - WORD wFallBackRate = RATE_1M; - BYTE byFallBack; - UINT ii; -// UINT txRetryTemp; + unsigned short wRate; + unsigned short wFallBackRate = RATE_1M; + unsigned char byFallBack; + unsigned int ii; +// unsigned int txRetryTemp; //PLICE_DEBUG-> //txRetryTemp = byTxRetry; //if (txRetryTemp== 8) @@ -1584,14 +1577,14 @@ BSSvUpdateNodeTxCounter( void BSSvClearNodeDBTable( void *hDeviceContext, - UINT uStartIndex + unsigned int uStartIndex ) { PSDevice pDevice = (PSDevice)hDeviceContext; PSMgmtObject pMgmt = pDevice->pMgmt; struct sk_buff *skb; - UINT ii; + unsigned int ii; for (ii = uStartIndex; ii < (MAX_NODE_NUM + 1); ii++) { if (pMgmt->sNodeDBTable[ii].bActive) { @@ -1629,8 +1622,8 @@ void s_vCheckSensitivity( pBSSList = BSSpAddrIsInBSSList(pDevice, pMgmt->abyCurrBSSID, (PWLAN_IE_SSID)pMgmt->abyCurrSSID); if (pBSSList != NULL) { // Updata BB Reg if RSSI is too strong. - LONG LocalldBmAverage = 0; - LONG uNumofdBm = 0; + long LocalldBmAverage = 0; + long uNumofdBm = 0; for (ii = 0; ii < RSSI_STAT_COUNT; ii++) { if (pBSSList->ldBmAverage[ii] != 0) { uNumofdBm ++; @@ -1666,10 +1659,10 @@ BSSvClearAnyBSSJoinRecord ( { PSDevice pDevice = (PSDevice)hDeviceContext; PSMgmtObject pMgmt = pDevice->pMgmt; - UINT ii; + unsigned int ii; for (ii = 0; ii < MAX_BSS_NUM; ii++) { - pMgmt->sBSSList[ii].bSelected = FALSE; + pMgmt->sBSSList[ii].bSelected = false; } return; } @@ -1680,9 +1673,9 @@ void s_uCalculateLinkQual( ) { PSDevice pDevice = (PSDevice)hDeviceContext; - ULONG TxOkRatio, TxCnt; - ULONG RxOkRatio,RxCnt; - ULONG RssiRatio; + unsigned long TxOkRatio, TxCnt; + unsigned long RxOkRatio,RxCnt; + unsigned long RssiRatio; long ldBm; TxCnt = pDevice->scStatistic.TxNoRetryOkCount + @@ -1693,7 +1686,7 @@ RxCnt = pDevice->scStatistic.RxFcsErrCnt + TxOkRatio = (TxCnt < 6) ? 4000:((pDevice->scStatistic.TxNoRetryOkCount * 4000) / TxCnt); RxOkRatio = (RxCnt < 6) ? 2000:((pDevice->scStatistic.RxOkCnt * 2000) / RxCnt); //decide link quality -if(pDevice->bLinkPass !=TRUE) +if(pDevice->bLinkPass !=true) { // printk("s_uCalculateLinkQual-->Link disconnect and Poor quality**\n"); pDevice->scStatistic.LinkQuality = 0; @@ -1701,7 +1694,7 @@ if(pDevice->bLinkPass !=TRUE) } else { - RFvRSSITodBm(pDevice, (BYTE)(pDevice->uCurrRSSI), &ldBm); + RFvRSSITodBm(pDevice, (unsigned char)(pDevice->uCurrRSSI), &ldBm); if(-ldBm < 50) { RssiRatio = 4000; } @@ -1735,8 +1728,8 @@ void s_vCheckPreEDThreshold( ((pMgmt->eCurrMode == WMAC_MODE_IBSS_STA) && (pMgmt->eCurrState == WMAC_STATE_JOINTED))) { pBSSList = BSSpAddrIsInBSSList(pDevice, pMgmt->abyCurrBSSID, (PWLAN_IE_SSID)pMgmt->abyCurrSSID); if (pBSSList != NULL) { - pDevice->byBBPreEDRSSI = (BYTE) (~(pBSSList->ldBmAverRange) + 1); - //BBvUpdatePreEDThreshold(pDevice, FALSE); + pDevice->byBBPreEDRSSI = (unsigned char) (~(pBSSList->ldBmAverRange) + 1); + //BBvUpdatePreEDThreshold(pDevice, false); } } return; diff --git a/drivers/staging/vt6655/bssdb.h b/drivers/staging/vt6655/bssdb.h index e09ef876297..0af42118612 100644 --- a/drivers/staging/vt6655/bssdb.h +++ b/drivers/staging/vt6655/bssdb.h @@ -90,69 +90,69 @@ typedef enum _NDIS_802_11_NETWORK_TYPE typedef struct tagSERPObject { - BOOL bERPExist; - BYTE byERP; + bool bERPExist; + unsigned char byERP; }ERPObject, *PERPObject; typedef struct tagSRSNCapObject { - BOOL bRSNCapExist; - WORD wRSNCap; + bool bRSNCapExist; + unsigned short wRSNCap; }SRSNCapObject, *PSRSNCapObject; // BSS info(AP) #pragma pack(1) typedef struct tagKnownBSS { // BSS info - BOOL bActive; - BYTE abyBSSID[WLAN_BSSID_LEN]; - UINT uChannel; - BYTE abySuppRates[WLAN_IEHDR_LEN + WLAN_RATES_MAXLEN + 1]; - BYTE abyExtSuppRates[WLAN_IEHDR_LEN + WLAN_RATES_MAXLEN + 1]; - UINT uRSSI; - BYTE bySQ; - WORD wBeaconInterval; - WORD wCapInfo; - BYTE abySSID[WLAN_IEHDR_LEN + WLAN_SSID_MAXLEN + 1]; - BYTE byRxRate; - -// WORD wATIMWindow; - BYTE byRSSIStatCnt; - LONG ldBmMAX; - LONG ldBmAverage[RSSI_STAT_COUNT]; - LONG ldBmAverRange; + bool bActive; + unsigned char abyBSSID[WLAN_BSSID_LEN]; + unsigned int uChannel; + unsigned char abySuppRates[WLAN_IEHDR_LEN + WLAN_RATES_MAXLEN + 1]; + unsigned char abyExtSuppRates[WLAN_IEHDR_LEN + WLAN_RATES_MAXLEN + 1]; + unsigned int uRSSI; + unsigned char bySQ; + unsigned short wBeaconInterval; + unsigned short wCapInfo; + unsigned char abySSID[WLAN_IEHDR_LEN + WLAN_SSID_MAXLEN + 1]; + unsigned char byRxRate; + +// unsigned short wATIMWindow; + unsigned char byRSSIStatCnt; + long ldBmMAX; + long ldBmAverage[RSSI_STAT_COUNT]; + long ldBmAverRange; //For any BSSID selection improvment - BOOL bSelected; + bool bSelected; //++ WPA informations - BOOL bWPAValid; - BYTE byGKType; - BYTE abyPKType[4]; - WORD wPKCount; - BYTE abyAuthType[4]; - WORD wAuthCount; - BYTE byDefaultK_as_PK; - BYTE byReplayIdx; + bool bWPAValid; + unsigned char byGKType; + unsigned char abyPKType[4]; + unsigned short wPKCount; + unsigned char abyAuthType[4]; + unsigned short wAuthCount; + unsigned char byDefaultK_as_PK; + unsigned char byReplayIdx; //-- //++ WPA2 informations - BOOL bWPA2Valid; - BYTE byCSSGK; - WORD wCSSPKCount; - BYTE abyCSSPK[4]; - WORD wAKMSSAuthCount; - BYTE abyAKMSSAuthType[4]; + bool bWPA2Valid; + unsigned char byCSSGK; + unsigned short wCSSPKCount; + unsigned char abyCSSPK[4]; + unsigned short wAKMSSAuthCount; + unsigned char abyAKMSSAuthType[4]; //++ wpactl - BYTE byWPAIE[MAX_WPA_IE_LEN]; - BYTE byRSNIE[MAX_WPA_IE_LEN]; - WORD wWPALen; - WORD wRSNLen; + unsigned char byWPAIE[MAX_WPA_IE_LEN]; + unsigned char byRSNIE[MAX_WPA_IE_LEN]; + unsigned short wWPALen; + unsigned short wRSNLen; // Clear count - UINT uClearCount; -// BYTE abyIEs[WLAN_BEACON_FR_MAXLEN]; - UINT uIELength; + unsigned int uClearCount; +// unsigned char abyIEs[WLAN_BEACON_FR_MAXLEN]; + unsigned int uIELength; QWORD qwBSSTimestamp; QWORD qwLocalTSF; // local TSF timer @@ -161,7 +161,7 @@ typedef struct tagKnownBSS { ERPObject sERP; SRSNCapObject sRSNCapObj; - BYTE abyIEs[1024]; // don't move this field !! + unsigned char abyIEs[1024]; // don't move this field !! }__attribute__ ((__packed__)) KnownBSS , *PKnownBSS; @@ -181,59 +181,59 @@ typedef enum tagNODE_STATE { // STA node info typedef struct tagKnownNodeDB { // STA info - BOOL bActive; - BYTE abyMACAddr[WLAN_ADDR_LEN]; - BYTE abyCurrSuppRates[WLAN_IEHDR_LEN + WLAN_RATES_MAXLEN]; - BYTE abyCurrExtSuppRates[WLAN_IEHDR_LEN + WLAN_RATES_MAXLEN]; - WORD wTxDataRate; - BOOL bShortPreamble; - BOOL bERPExist; - BOOL bShortSlotTime; - UINT uInActiveCount; - WORD wMaxBasicRate; //Get from byTopOFDMBasicRate or byTopCCKBasicRate which depends on packetTyp. - WORD wMaxSuppRate; //Records the highest supported rate getting from SuppRates IE and ExtSuppRates IE in Beacon. - WORD wSuppRate; - BYTE byTopOFDMBasicRate;//Records the highest basic rate in OFDM mode - BYTE byTopCCKBasicRate; //Records the highest basic rate in CCK mode + bool bActive; + unsigned char abyMACAddr[WLAN_ADDR_LEN]; + unsigned char abyCurrSuppRates[WLAN_IEHDR_LEN + WLAN_RATES_MAXLEN]; + unsigned char abyCurrExtSuppRates[WLAN_IEHDR_LEN + WLAN_RATES_MAXLEN]; + unsigned short wTxDataRate; + bool bShortPreamble; + bool bERPExist; + bool bShortSlotTime; + unsigned int uInActiveCount; + unsigned short wMaxBasicRate; //Get from byTopOFDMBasicRate or byTopCCKBasicRate which depends on packetTyp. + unsigned short wMaxSuppRate; //Records the highest supported rate getting from SuppRates IE and ExtSuppRates IE in Beacon. + unsigned short wSuppRate; + unsigned char byTopOFDMBasicRate;//Records the highest basic rate in OFDM mode + unsigned char byTopCCKBasicRate; //Records the highest basic rate in CCK mode // For AP mode struct sk_buff_head sTxPSQueue; - WORD wCapInfo; - WORD wListenInterval; - WORD wAID; + unsigned short wCapInfo; + unsigned short wListenInterval; + unsigned short wAID; NODE_STATE eNodeState; - BOOL bPSEnable; - BOOL bRxPSPoll; - BYTE byAuthSequence; - ULONG ulLastRxJiffer; - BYTE bySuppRate; - DWORD dwFlags; - WORD wEnQueueCnt; - - BOOL bOnFly; - ULONGLONG KeyRSC; - BYTE byKeyIndex; - DWORD dwKeyIndex; - BYTE byCipherSuite; - DWORD dwTSC47_16; - WORD wTSC15_0; - UINT uWepKeyLength; - BYTE abyWepKey[WLAN_WEPMAX_KEYLEN]; + bool bPSEnable; + bool bRxPSPoll; + unsigned char byAuthSequence; + unsigned long ulLastRxJiffer; + unsigned char bySuppRate; + unsigned long dwFlags; + unsigned short wEnQueueCnt; + + bool bOnFly; + unsigned long long KeyRSC; + unsigned char byKeyIndex; + unsigned long dwKeyIndex; + unsigned char byCipherSuite; + unsigned long dwTSC47_16; + unsigned short wTSC15_0; + unsigned int uWepKeyLength; + unsigned char abyWepKey[WLAN_WEPMAX_KEYLEN]; // // Auto rate fallback vars - BOOL bIsInFallback; - UINT uAverageRSSI; - UINT uRateRecoveryTimeout; - UINT uRatePollTimeout; - UINT uTxFailures; - UINT uTxAttempts; - - UINT uTxRetry; - UINT uFailureRatio; - UINT uRetryRatio; - UINT uTxOk[MAX_RATE+1]; - UINT uTxFail[MAX_RATE+1]; - UINT uTimeCount; + bool bIsInFallback; + unsigned int uAverageRSSI; + unsigned int uRateRecoveryTimeout; + unsigned int uRatePollTimeout; + unsigned int uTxFailures; + unsigned int uTxAttempts; + + unsigned int uTxRetry; + unsigned int uFailureRatio; + unsigned int uRetryRatio; + unsigned int uTxOk[MAX_RATE+1]; + unsigned int uTxFail[MAX_RATE+1]; + unsigned int uTimeCount; } KnownNodeDB, *PKnownNodeDB; @@ -245,32 +245,32 @@ typedef struct tagKnownNodeDB { PKnownBSS BSSpSearchBSSList( void *hDeviceContext, - PBYTE pbyDesireBSSID, - PBYTE pbyDesireSSID, + unsigned char *pbyDesireBSSID, + unsigned char *pbyDesireSSID, CARD_PHY_TYPE ePhyType ); PKnownBSS BSSpAddrIsInBSSList( void *hDeviceContext, - PBYTE abyBSSID, + unsigned char *abyBSSID, PWLAN_IE_SSID pSSID ); void BSSvClearBSSList( void *hDeviceContext, - BOOL bKeepCurrBSSID + bool bKeepCurrBSSID ); -BOOL +bool BSSbInsertToBSSList( void *hDeviceContext, - PBYTE abyBSSIDAddr, + unsigned char *abyBSSIDAddr, QWORD qwTimestamp, - WORD wBeaconInterval, - WORD wCapInfo, - BYTE byCurrChannel, + unsigned short wBeaconInterval, + unsigned short wCapInfo, + unsigned char byCurrChannel, PWLAN_IE_SSID pSSID, PWLAN_IE_SUPP_RATES pSuppRates, PWLAN_IE_SUPP_RATES pExtSuppRates, @@ -279,20 +279,20 @@ BSSbInsertToBSSList( PWLAN_IE_RSN_EXT pRSNWPA, PWLAN_IE_COUNTRY pIE_Country, PWLAN_IE_QUIET pIE_Quiet, - UINT uIELength, - PBYTE pbyIEs, + unsigned int uIELength, + unsigned char *pbyIEs, void *pRxPacketContext ); -BOOL +bool BSSbUpdateToBSSList( void *hDeviceContext, QWORD qwTimestamp, - WORD wBeaconInterval, - WORD wCapInfo, - BYTE byCurrChannel, - BOOL bChannelHit, + unsigned short wBeaconInterval, + unsigned short wCapInfo, + unsigned char byCurrChannel, + bool bChannelHit, PWLAN_IE_SSID pSSID, PWLAN_IE_SUPP_RATES pSuppRates, PWLAN_IE_SUPP_RATES pExtSuppRates, @@ -302,29 +302,23 @@ BSSbUpdateToBSSList( PWLAN_IE_COUNTRY pIE_Country, PWLAN_IE_QUIET pIE_Quiet, PKnownBSS pBSSList, - UINT uIELength, - PBYTE pbyIEs, + unsigned int uIELength, + unsigned char *pbyIEs, void *pRxPacketContext ); -BOOL -BSSDBbIsSTAInNodeDB( - void *hDeviceContext, - PBYTE abyDstAddr, - PUINT puNodeIndex - ); +bool +BSSDBbIsSTAInNodeDB(void *hDeviceContext, unsigned char *abyDstAddr, + unsigned int *puNodeIndex); void -BSSvCreateOneNode( - void *hDeviceContext, - PUINT puNodeIndex - ); +BSSvCreateOneNode(void *hDeviceContext, unsigned int *puNodeIndex); void BSSvUpdateAPNode( void *hDeviceContext, - PWORD pwCapInfo, + unsigned short *pwCapInfo, PWLAN_IE_SUPP_RATES pItemRates, PWLAN_IE_SUPP_RATES pExtSuppRates ); @@ -339,16 +333,16 @@ BSSvSecondCallBack( void BSSvUpdateNodeTxCounter( void *hDeviceContext, - BYTE byTsr0, - BYTE byTsr1, - PBYTE pbyBuffer, - UINT uFIFOHeaderSize + unsigned char byTsr0, + unsigned char byTsr1, + unsigned char *pbyBuffer, + unsigned int uFIFOHeaderSize ); void BSSvRemoveOneNode( void *hDeviceContext, - UINT uNodeIndex + unsigned int uNodeIndex ); void @@ -360,7 +354,7 @@ BSSvAddMulticastNode( void BSSvClearNodeDBTable( void *hDeviceContext, - UINT uStartIndex + unsigned int uStartIndex ); void diff --git a/drivers/staging/vt6655/card.c b/drivers/staging/vt6655/card.c index 7bc2d7654b0..32d095c4d51 100644 --- a/drivers/staging/vt6655/card.c +++ b/drivers/staging/vt6655/card.c @@ -56,6 +56,7 @@ #include "key.h" #include "rc4.h" #include "country.h" +#include "channel.h" /*--------------------- Static Definitions -------------------------*/ @@ -76,411 +77,39 @@ static int msglevel =MSG_LEVEL_INFO; #define C_CWMAX 1023 // slot time -#define CARD_MAX_CHANNEL_TBL 56 - #define WAIT_BEACON_TX_DOWN_TMO 3 // Times -typedef struct tagSChannelTblElement { - BYTE byChannelNumber; - UINT uFrequency; - BOOL bValid; - BYTE byMAP; -}SChannelTblElement, *PSChannelTblElement; - //1M, 2M, 5M, 11M, 18M, 24M, 36M, 54M -static BYTE abyDefaultSuppRatesG[] = {WLAN_EID_SUPP_RATES, 8, 0x02, 0x04, 0x0B, 0x16, 0x24, 0x30, 0x48, 0x6C}; +static unsigned char abyDefaultSuppRatesG[] = {WLAN_EID_SUPP_RATES, 8, 0x02, 0x04, 0x0B, 0x16, 0x24, 0x30, 0x48, 0x6C}; //6M, 9M, 12M, 48M -static BYTE abyDefaultExtSuppRatesG[] = {WLAN_EID_EXTSUPP_RATES, 4, 0x0C, 0x12, 0x18, 0x60}; +static unsigned char abyDefaultExtSuppRatesG[] = {WLAN_EID_EXTSUPP_RATES, 4, 0x0C, 0x12, 0x18, 0x60}; //6M, 9M, 12M, 18M, 24M, 36M, 48M, 54M -static BYTE abyDefaultSuppRatesA[] = {WLAN_EID_SUPP_RATES, 8, 0x0C, 0x12, 0x18, 0x24, 0x30, 0x48, 0x60, 0x6C}; +static unsigned char abyDefaultSuppRatesA[] = {WLAN_EID_SUPP_RATES, 8, 0x0C, 0x12, 0x18, 0x24, 0x30, 0x48, 0x60, 0x6C}; //1M, 2M, 5M, 11M, -static BYTE abyDefaultSuppRatesB[] = {WLAN_EID_SUPP_RATES, 4, 0x02, 0x04, 0x0B, 0x16}; - - +static unsigned char abyDefaultSuppRatesB[] = {WLAN_EID_SUPP_RATES, 4, 0x02, 0x04, 0x0B, 0x16}; -/*--------------------- Static Classes ----------------------------*/ /*--------------------- Static Variables --------------------------*/ -const WORD cwRXBCNTSFOff[MAX_RATE] = +const unsigned short cwRXBCNTSFOff[MAX_RATE] = {17, 17, 17, 17, 34, 23, 17, 11, 8, 5, 4, 3}; -static SChannelTblElement sChannelTbl[CARD_MAX_CHANNEL_TBL+1] = -{ - {0, 0, FALSE, 0}, - {1, 2412, TRUE, 0}, - {2, 2417, TRUE, 0}, - {3, 2422, TRUE, 0}, - {4, 2427, TRUE, 0}, - {5, 2432, TRUE, 0}, - {6, 2437, TRUE, 0}, - {7, 2442, TRUE, 0}, - {8, 2447, TRUE, 0}, - {9, 2452, TRUE, 0}, - {10, 2457, TRUE, 0}, - {11, 2462, TRUE, 0}, - {12, 2467, TRUE, 0}, - {13, 2472, TRUE, 0}, - {14, 2484, TRUE, 0}, - {183, 4915, TRUE, 0}, - {184, 4920, TRUE, 0}, - {185, 4925, TRUE, 0}, - {187, 4935, TRUE, 0}, - {188, 4940, TRUE, 0}, - {189, 4945, TRUE, 0}, - {192, 4960, TRUE, 0}, - {196, 4980, TRUE, 0}, - {7, 5035, TRUE, 0}, - {8, 5040, TRUE, 0}, - {9, 5045, TRUE, 0}, - {11, 5055, TRUE, 0}, - {12, 5060, TRUE, 0}, - {16, 5080, TRUE, 0}, - {34, 5170, TRUE, 0}, - {36, 5180, TRUE, 0}, - {38, 5190, TRUE, 0}, - {40, 5200, TRUE, 0}, - {42, 5210, TRUE, 0}, - {44, 5220, TRUE, 0}, - {46, 5230, TRUE, 0}, - {48, 5240, TRUE, 0}, - {52, 5260, TRUE, 0}, - {56, 5280, TRUE, 0}, - {60, 5300, TRUE, 0}, - {64, 5320, TRUE, 0}, - {100, 5500, TRUE, 0}, - {104, 5520, TRUE, 0}, - {108, 5540, TRUE, 0}, - {112, 5560, TRUE, 0}, - {116, 5580, TRUE, 0}, - {120, 5600, TRUE, 0}, - {124, 5620, TRUE, 0}, - {128, 5640, TRUE, 0}, - {132, 5660, TRUE, 0}, - {136, 5680, TRUE, 0}, - {140, 5700, TRUE, 0}, - {149, 5745, TRUE, 0}, - {153, 5765, TRUE, 0}, - {157, 5785, TRUE, 0}, - {161, 5805, TRUE, 0}, - {165, 5825, TRUE, 0} -}; - - -/************************************************************************ - * The Radar regulation rules for each country - ************************************************************************/ -SCountryTable ChannelRuleTab[CCODE_MAX+1] = -{ -/************************************************************************ - * This table is based on Athero driver rules - ************************************************************************/ -/* Country Available channels, ended with 0 */ -/* 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 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 0} }, -{CCODE_FINLAND, {'F','I'}, { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0} - , { 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20, 0, 20, 0, 20, 0, 20, 20, 20, 20, 20, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 0, 0, 0, 0, 0} }, -{CCODE_FRANCE, {'F','R'}, { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0} - , { 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20, 0, 20, 0, 20, 0, 20, 20, 20, 20, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0} }, -{CCODE_GERMANY, {'D','E'}, { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0} - , { 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20, 0, 20, 0, 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, 0, 0} - , { 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 18, 0, 18, 0, 18, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0} }, -{CCODE_LITHUANIA, {'L','T'}, { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0} - , { 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20, 0, 20, 0, 20, 0, 20, 20, 20, 20, 20, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 0, 0, 0, 0, 0} }, -{CCODE_LUXEMBURG, {'L','U'}, { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0} - , { 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20, 0, 20, 0, 20, 0, 20, 20, 20, 20, 20, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 0, 0, 0, 0, 0} }, -{CCODE_MACAU, {'M','O'}, { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0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 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0} - , { 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 16, 0, 16, 0, 16, 16, 16, 16, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 16, 16, 16, 0} }, -{CCODE_SWEDEN, {'S','E'}, { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0} - , { 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20, 0, 20, 0, 20, 0, 20, 20, 20, 20, 20, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 0, 0, 0, 0, 0} }, -{CCODE_SWITZERLAND, {'C','H'}, { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0} - , { 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 18, 0, 18, 0, 18, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0} }, -{CCODE_SYRIA, {'S','Y'}, { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0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}, -{CCODE_MAX, {'U','N'}, { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1} - , { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0} } -/* 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 */ -}; - /*--------------------- Static Functions --------------------------*/ static void s_vCaculateOFDMRParameter( - BYTE byRate, + unsigned char byRate, CARD_PHY_TYPE ePHYType, - PBYTE pbyTxRate, - PBYTE pbyRsvTime + unsigned char *pbyTxRate, + unsigned char *pbyRsvTime ); -/*--------------------- Export Variables --------------------------*/ - /*--------------------- Export Functions --------------------------*/ - -/*--------------------- Export function -------------------------*/ -/************************************************************************ - * Country Channel Valid - * Input: CountryCode, ChannelNum - * ChanneIndex is defined as VT3253 MAC channel: - * 1 = 2.4G channel 1 - * 2 = 2.4G channel 2 - * ... - * 14 = 2.4G channel 14 - * 15 = 4.9G channel 183 - * 16 = 4.9G channel 184 - * ..... - * Output: TRUE if the specified 5GHz band is allowed to be used. - False otherwise. -// 4.9G => Ch 183, 184, 185, 187, 188, 189, 192, 196 (Value:15 ~ 22) - -// 5G => Ch 7, 8, 9, 11, 12, 16, 34, 36, 38, 40, 42, 44, 46, 48, 52, 56, 60, 64, -// 100, 104, 108, 112, 116, 120, 124, 128, 132, 136, 140, 149, 153, 157, 161, 165 (Value 23 ~ 56) - ************************************************************************/ -//2008-8-4 <add> by chester -BOOL -ChannelValid(UINT CountryCode, UINT ChannelIndex) -{ - BOOL bValid; - - bValid = FALSE; - /* - * If Channel Index is invalid, return invalid - */ - if ((ChannelIndex > CB_MAX_CHANNEL) || - (ChannelIndex == 0)) - { - bValid = FALSE; - goto exit; - } - - bValid = sChannelTbl[ChannelIndex].bValid; - -exit: - return (bValid); - -} /* end ChannelValid */ - - /* * Description: Caculate TxRate and RsvTime fields for RSPINF in OFDM mode. * @@ -498,10 +127,10 @@ exit: static void s_vCaculateOFDMRParameter ( - BYTE byRate, + unsigned char byRate, CARD_PHY_TYPE ePHYType, - PBYTE pbyTxRate, - PBYTE pbyRsvTime + unsigned char *pbyTxRate, + unsigned char *pbyRsvTime ) { switch (byRate) { @@ -614,9 +243,9 @@ static void s_vSetRSPINF (PSDevice pDevice, CARD_PHY_TYPE ePHYType, void *pvSupportRateIEs, void *pvExtSupportRateIEs) { - BYTE byServ = 0, bySignal = 0; // For CCK - WORD wLen = 0; - BYTE byTxRate = 0, byRsvTime = 0; // For OFDM + unsigned char byServ = 0, bySignal = 0; // For CCK + unsigned short wLen = 0; + unsigned char byTxRate = 0, byRsvTime = 0; // For OFDM //Set to Page1 MACvSelectPage1(pDevice->PortOffset); @@ -722,120 +351,7 @@ s_vSetRSPINF (PSDevice pDevice, CARD_PHY_TYPE ePHYType, void *pvSupportRateIEs, MACvSelectPage0(pDevice->PortOffset); } - - - -/*--------------------- Export Variables --------------------------*/ - /*--------------------- Export Functions --------------------------*/ -BYTE CARDbyGetChannelMapping (void *pDeviceHandler, BYTE byChannelNumber, CARD_PHY_TYPE ePhyType) -{ - UINT ii; - - if ((ePhyType == PHY_TYPE_11B) || (ePhyType == PHY_TYPE_11G)) { - return (byChannelNumber); - } - - for(ii = (CB_MAX_CHANNEL_24G + 1); ii <= CB_MAX_CHANNEL; ) { - if (sChannelTbl[ii].byChannelNumber == byChannelNumber) { - return ((BYTE) ii); - } - ii++; - } - return (0); -} - - -BYTE CARDbyGetChannelNumber (void *pDeviceHandler, BYTE byChannelIndex) -{ -// PSDevice pDevice = (PSDevice) pDeviceHandler; - return(sChannelTbl[byChannelIndex].byChannelNumber); -} - -/* - * Description: Set NIC media channel - * - * Parameters: - * In: - * pDeviceHandler - The adapter to be set - * uConnectionChannel - Channel to be set - * Out: - * none - * - * Return Value: TRUE if succeeded; FALSE if failed. - * - */ -BOOL CARDbSetChannel (void *pDeviceHandler, UINT uConnectionChannel) -{ - PSDevice pDevice = (PSDevice) pDeviceHandler; - BOOL bResult = TRUE; - - - if (pDevice->byCurrentCh == uConnectionChannel) { - return bResult; - } - - if (sChannelTbl[uConnectionChannel].bValid == FALSE) { - return (FALSE); - } - - if ((uConnectionChannel > CB_MAX_CHANNEL_24G) && - (pDevice->eCurrentPHYType != PHY_TYPE_11A)) { - CARDbSetPhyParameter(pDevice, PHY_TYPE_11A, 0, 0, NULL, NULL); - } else if ((uConnectionChannel <= CB_MAX_CHANNEL_24G) && - (pDevice->eCurrentPHYType == PHY_TYPE_11A)) { - CARDbSetPhyParameter(pDevice, PHY_TYPE_11G, 0, 0, NULL, NULL); - } - // clear NAV - MACvRegBitsOn(pDevice->PortOffset, MAC_REG_MACCR, MACCR_CLRNAV); - - //{{ RobertYu: 20041202 - //// TX_PE will reserve 3 us for MAX2829 A mode only, it is for better TX throughput - - if ( pDevice->byRFType == RF_AIROHA7230 ) - { - RFbAL7230SelectChannelPostProcess(pDevice->PortOffset, pDevice->byCurrentCh, (BYTE)uConnectionChannel); - } - //}} RobertYu - - - pDevice->byCurrentCh = (BYTE)uConnectionChannel; - bResult &= RFbSelectChannel(pDevice->PortOffset, pDevice->byRFType, (BYTE)uConnectionChannel); - - // Init Synthesizer Table - if (pDevice->bEnablePSMode == TRUE) - RFvWriteWakeProgSyn(pDevice->PortOffset, pDevice->byRFType, uConnectionChannel); - - - //DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"CARDbSetMediaChannel: %d\n", (BYTE)uConnectionChannel); - BBvSoftwareReset(pDevice->PortOffset); - - if (pDevice->byLocalID > REV_ID_VT3253_B1) { - // set HW default power register - MACvSelectPage1(pDevice->PortOffset); - RFbSetPower(pDevice, RATE_1M, pDevice->byCurrentCh); - VNSvOutPortB(pDevice->PortOffset + MAC_REG_PWRCCK, pDevice->byCurPwr); - RFbSetPower(pDevice, RATE_6M, pDevice->byCurrentCh); - VNSvOutPortB(pDevice->PortOffset + MAC_REG_PWROFDM, pDevice->byCurPwr); - MACvSelectPage0(pDevice->PortOffset); - } - - if (pDevice->eCurrentPHYType == PHY_TYPE_11B) { -#ifdef PLICE_DEBUG - //printk("Func:CARDbSetChannel:call RFbSetPower:11B\n"); -#endif - RFbSetPower(pDevice, RATE_1M, pDevice->byCurrentCh); - } else { -#ifdef PLICE_DEBUG - //printk("Func:CARDbSetChannel:call RFbSetPower\n"); -#endif - RFbSetPower(pDevice, RATE_6M, pDevice->byCurrentCh); - } - - return(bResult); -} - - /* * Description: Card Send packet function @@ -849,11 +365,11 @@ BOOL CARDbSetChannel (void *pDeviceHandler, UINT uConnectionChannel) * Out: * none * - * Return Value: TRUE if succeeded; FALSE if failed. + * Return Value: true if succeeded; false if failed. * */ /* -BOOL CARDbSendPacket (void *pDeviceHandler, void *pPacket, CARD_PKT_TYPE ePktType, UINT uLength) +bool CARDbSendPacket (void *pDeviceHandler, void *pPacket, CARD_PKT_TYPE ePktType, unsigned int uLength) { PSDevice pDevice = (PSDevice) pDeviceHandler; if (ePktType == PKT_TYPE_802_11_MNG) { @@ -864,7 +380,7 @@ BOOL CARDbSendPacket (void *pDeviceHandler, void *pPacket, CARD_PKT_TYPE ePktTyp return TXbTD1Send(pDevice, pPacket, uLength); } - return (TRUE); + return (true); } */ @@ -878,16 +394,16 @@ BOOL CARDbSendPacket (void *pDeviceHandler, void *pPacket, CARD_PKT_TYPE ePktTyp * Out: * none * - * Return Value: TRUE if short preamble; otherwise FALSE + * Return Value: true if short preamble; otherwise false * */ -BOOL CARDbIsShortPreamble (void *pDeviceHandler) +bool CARDbIsShortPreamble (void *pDeviceHandler) { PSDevice pDevice = (PSDevice) pDeviceHandler; if (pDevice->byPreambleType == 0) { - return(FALSE); + return(false); } - return(TRUE); + return(true); } /* @@ -899,10 +415,10 @@ BOOL CARDbIsShortPreamble (void *pDeviceHandler) * Out: * none * - * Return Value: TRUE if short slot time; otherwise FALSE + * Return Value: true if short slot time; otherwise false * */ -BOOL CARDbIsShorSlotTime (void *pDeviceHandler) +bool CARDbIsShorSlotTime (void *pDeviceHandler) { PSDevice pDevice = (PSDevice) pDeviceHandler; return(pDevice->bShortSlotTime); @@ -921,14 +437,14 @@ BOOL CARDbIsShorSlotTime (void *pDeviceHandler) * Return Value: None. * */ -BOOL CARDbSetPhyParameter (void *pDeviceHandler, CARD_PHY_TYPE ePHYType, WORD wCapInfo, BYTE byERPField, void *pvSupportRateIEs, void *pvExtSupportRateIEs) +bool CARDbSetPhyParameter (void *pDeviceHandler, CARD_PHY_TYPE ePHYType, unsigned short wCapInfo, unsigned char byERPField, void *pvSupportRateIEs, void *pvExtSupportRateIEs) { PSDevice pDevice = (PSDevice) pDeviceHandler; - BYTE byCWMaxMin = 0; - BYTE bySlot = 0; - BYTE bySIFS = 0; - BYTE byDIFS = 0; - BYTE byData; + unsigned char byCWMaxMin = 0; + unsigned char bySlot = 0; + unsigned char bySIFS = 0; + unsigned char byDIFS = 0; + unsigned char byData; // PWLAN_IE_SUPP_RATES pRates = NULL; PWLAN_IE_SUPP_RATES pSupportRates = (PWLAN_IE_SUPP_RATES) pvSupportRateIEs; PWLAN_IE_SUPP_RATES pExtSupportRates = (PWLAN_IE_SUPP_RATES) pvExtSupportRateIEs; @@ -1071,9 +587,9 @@ BOOL CARDbSetPhyParameter (void *pDeviceHandler, CARD_PHY_TYPE ePHYType, WORD wC pDevice->bySlot = bySlot; VNSvOutPortB(pDevice->PortOffset + MAC_REG_SLOT, pDevice->bySlot); if (pDevice->bySlot == C_SLOT_SHORT) { - pDevice->bShortSlotTime = TRUE; + pDevice->bShortSlotTime = true; } else { - pDevice->bShortSlotTime = FALSE; + pDevice->bShortSlotTime = false; } BBvSetShortSlotTime(pDevice); } @@ -1089,7 +605,7 @@ BOOL CARDbSetPhyParameter (void *pDeviceHandler, CARD_PHY_TYPE ePHYType, WORD wC s_vSetRSPINF(pDevice, ePHYType, pSupportRates, pExtSupportRates); pDevice->eCurrentPHYType = ePHYType; // set for NDIS OID_802_11SUPPORTED_RATES - return (TRUE); + return (true); } /* @@ -1108,7 +624,7 @@ BOOL CARDbSetPhyParameter (void *pDeviceHandler, CARD_PHY_TYPE ePHYType, WORD wC * Return Value: none * */ -BOOL CARDbUpdateTSF (void *pDeviceHandler, BYTE byRxRate, QWORD qwBSSTimestamp, QWORD qwLocalTSF) +bool CARDbUpdateTSF (void *pDeviceHandler, unsigned char byRxRate, QWORD qwBSSTimestamp, QWORD qwLocalTSF) { PSDevice pDevice = (PSDevice) pDeviceHandler; QWORD qwTSFOffset; @@ -1125,7 +641,7 @@ BOOL CARDbUpdateTSF (void *pDeviceHandler, BYTE byRxRate, QWORD qwBSSTimestamp, VNSvOutPortD(pDevice->PortOffset + MAC_REG_TSFOFST + 4, HIDWORD(qwTSFOffset)); MACvRegBitsOn(pDevice->PortOffset, MAC_REG_TFTCTL, TFTCTL_TSFSYNCEN); } - return(TRUE); + return(true); } @@ -1140,16 +656,16 @@ BOOL CARDbUpdateTSF (void *pDeviceHandler, BYTE byRxRate, QWORD qwBSSTimestamp, * Out: * none * - * Return Value: TRUE if succeed; otherwise FALSE + * Return Value: true if succeed; otherwise false * */ -BOOL CARDbSetBeaconPeriod (void *pDeviceHandler, WORD wBeaconInterval) +bool CARDbSetBeaconPeriod (void *pDeviceHandler, unsigned short wBeaconInterval) { PSDevice pDevice = (PSDevice) pDeviceHandler; - UINT uBeaconInterval = 0; - UINT uLowNextTBTT = 0; - UINT uHighRemain = 0; - UINT uLowRemain = 0; + unsigned int uBeaconInterval = 0; + unsigned int uLowNextTBTT = 0; + unsigned int uHighRemain = 0; + unsigned int uLowRemain = 0; QWORD qwNextTBTT; HIDWORD(qwNextTBTT) = 0; @@ -1179,7 +695,7 @@ BOOL CARDbSetBeaconPeriod (void *pDeviceHandler, WORD wBeaconInterval) VNSvOutPortD(pDevice->PortOffset + MAC_REG_NEXTTBTT + 4, HIDWORD(qwNextTBTT)); MACvRegBitsOn(pDevice->PortOffset, MAC_REG_TFTCTL, TFTCTL_TBTTSYNCEN); - return(TRUE); + return(true); } @@ -1194,51 +710,51 @@ BOOL CARDbSetBeaconPeriod (void *pDeviceHandler, WORD wBeaconInterval) * Out: * none * - * Return Value: TRUE if all data packet complete; otherwise FALSE. + * Return Value: true if all data packet complete; otherwise false. * */ -BOOL CARDbStopTxPacket (void *pDeviceHandler, CARD_PKT_TYPE ePktType) +bool CARDbStopTxPacket (void *pDeviceHandler, CARD_PKT_TYPE ePktType) { PSDevice pDevice = (PSDevice) pDeviceHandler; if (ePktType == PKT_TYPE_802_11_ALL) { - pDevice->bStopBeacon = TRUE; - pDevice->bStopTx0Pkt = TRUE; - pDevice->bStopDataPkt = TRUE; + pDevice->bStopBeacon = true; + pDevice->bStopTx0Pkt = true; + pDevice->bStopDataPkt = true; } else if (ePktType == PKT_TYPE_802_11_BCN) { - pDevice->bStopBeacon = TRUE; + pDevice->bStopBeacon = true; } else if (ePktType == PKT_TYPE_802_11_MNG) { - pDevice->bStopTx0Pkt = TRUE; + pDevice->bStopTx0Pkt = true; } else if (ePktType == PKT_TYPE_802_11_DATA) { - pDevice->bStopDataPkt = TRUE; + pDevice->bStopDataPkt = true; } - if (pDevice->bStopBeacon == TRUE) { - if (pDevice->bIsBeaconBufReadySet == TRUE) { + if (pDevice->bStopBeacon == true) { + if (pDevice->bIsBeaconBufReadySet == true) { if (pDevice->cbBeaconBufReadySetCnt < WAIT_BEACON_TX_DOWN_TMO) { pDevice->cbBeaconBufReadySetCnt ++; - return(FALSE); + return(false); } } - pDevice->bIsBeaconBufReadySet = FALSE; + pDevice->bIsBeaconBufReadySet = false; pDevice->cbBeaconBufReadySetCnt = 0; MACvRegBitsOff(pDevice->PortOffset, MAC_REG_TCR, TCR_AUTOBCNTX); } // wait all TD0 complete - if (pDevice->bStopTx0Pkt == TRUE) { + if (pDevice->bStopTx0Pkt == true) { if (pDevice->iTDUsed[TYPE_TXDMA0] != 0){ - return(FALSE); + return(false); } } // wait all Data TD complete - if (pDevice->bStopDataPkt == TRUE) { + if (pDevice->bStopDataPkt == true) { if (pDevice->iTDUsed[TYPE_AC0DMA] != 0){ - return(FALSE); + return(false); } } - return(TRUE); + return(true); } @@ -1252,33 +768,33 @@ BOOL CARDbStopTxPacket (void *pDeviceHandler, CARD_PKT_TYPE ePktType) * Out: * none * - * Return Value: TRUE if success; FALSE if failed. + * Return Value: true if success; false if failed. * */ -BOOL CARDbStartTxPacket (void *pDeviceHandler, CARD_PKT_TYPE ePktType) +bool CARDbStartTxPacket (void *pDeviceHandler, CARD_PKT_TYPE ePktType) { PSDevice pDevice = (PSDevice) pDeviceHandler; if (ePktType == PKT_TYPE_802_11_ALL) { - pDevice->bStopBeacon = FALSE; - pDevice->bStopTx0Pkt = FALSE; - pDevice->bStopDataPkt = FALSE; + pDevice->bStopBeacon = false; + pDevice->bStopTx0Pkt = false; + pDevice->bStopDataPkt = false; } else if (ePktType == PKT_TYPE_802_11_BCN) { - pDevice->bStopBeacon = FALSE; + pDevice->bStopBeacon = false; } else if (ePktType == PKT_TYPE_802_11_MNG) { - pDevice->bStopTx0Pkt = FALSE; + pDevice->bStopTx0Pkt = false; } else if (ePktType == PKT_TYPE_802_11_DATA) { - pDevice->bStopDataPkt = FALSE; + pDevice->bStopDataPkt = false; } - if ((pDevice->bStopBeacon == FALSE) && - (pDevice->bBeaconBufReady == TRUE) && + if ((pDevice->bStopBeacon == false) && + (pDevice->bBeaconBufReady == true) && (pDevice->eOPMode == OP_MODE_ADHOC)) { MACvRegBitsOn(pDevice->PortOffset, MAC_REG_TCR, TCR_AUTOBCNTX); } - return(TRUE); + return(true); } @@ -1294,10 +810,10 @@ BOOL CARDbStartTxPacket (void *pDeviceHandler, CARD_PKT_TYPE ePktType) * Out: * none * - * Return Value: TRUE if success; FALSE if failed. + * Return Value: true if success; false if failed. * */ -BOOL CARDbSetBSSID(void *pDeviceHandler, PBYTE pbyBSSID, CARD_OP_MODE eOPMode) +bool CARDbSetBSSID(void *pDeviceHandler, unsigned char *pbyBSSID, CARD_OP_MODE eOPMode) { PSDevice pDevice = (PSDevice) pDeviceHandler; @@ -1315,20 +831,20 @@ BOOL CARDbSetBSSID(void *pDeviceHandler, PBYTE pbyBSSID, CARD_OP_MODE eOPMode) } if (eOPMode == OP_MODE_UNKNOWN) { MACvRegBitsOff(pDevice->PortOffset, MAC_REG_RCR, RCR_BSSID); - pDevice->bBSSIDFilter = FALSE; + pDevice->bBSSIDFilter = false; pDevice->byRxMode &= ~RCR_BSSID; DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "wcmd: rx_mode = %x\n", pDevice->byRxMode ); } else { - if (IS_NULL_ADDRESS(pDevice->abyBSSID) == FALSE) { + if (is_zero_ether_addr(pDevice->abyBSSID) == false) { MACvRegBitsOn(pDevice->PortOffset, MAC_REG_RCR, RCR_BSSID); - pDevice->bBSSIDFilter = TRUE; + pDevice->bBSSIDFilter = true; pDevice->byRxMode |= RCR_BSSID; } DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "wmgr: rx_mode = %x\n", pDevice->byRxMode ); } // Adopt BSS state in Adapter Device Object pDevice->eOPMode = eOPMode; - return(TRUE); + return(true); } @@ -1342,7 +858,7 @@ BOOL CARDbSetBSSID(void *pDeviceHandler, PBYTE pbyBSSID, CARD_OP_MODE eOPMode) * Out: * none * - * Return Value: TRUE if success; FALSE if failed. + * Return Value: true if success; false if failed. * */ @@ -1363,18 +879,18 @@ BOOL CARDbSetBSSID(void *pDeviceHandler, PBYTE pbyBSSID, CARD_OP_MODE eOPMode) * Out: * none * - * Return Value: TRUE if succeed; otherwise FALSE + * Return Value: true if succeed; otherwise false * */ -BOOL CARDbSetTxDataRate( +bool CARDbSetTxDataRate( void *pDeviceHandler, - WORD wDataRate + unsigned short wDataRate ) { PSDevice pDevice = (PSDevice) pDeviceHandler; pDevice->wCurrentRate = wDataRate; - return(TRUE); + return(true); } /*+ @@ -1388,20 +904,20 @@ BOOL CARDbSetTxDataRate( * Out: * none * - * Return Value: TRUE if power down success; otherwise FALSE + * Return Value: true if power down success; otherwise false * -*/ -BOOL +bool CARDbPowerDown( void *pDeviceHandler ) { PSDevice pDevice = (PSDevice)pDeviceHandler; - UINT uIdx; + unsigned int uIdx; // check if already in Doze mode if (MACbIsRegBitsOn(pDevice->PortOffset, MAC_REG_PSCTL, PSCTL_PS)) - return TRUE; + return true; // Froce PSEN on MACvRegBitsOn(pDevice->PortOffset, MAC_REG_PSCTL, PSCTL_PSEN); @@ -1410,12 +926,12 @@ CARDbPowerDown( for (uIdx = 0; uIdx < TYPE_MAXTD; uIdx ++) { if (pDevice->iTDUsed[uIdx] != 0) - return FALSE; + return false; } MACvRegBitsOn(pDevice->PortOffset, MAC_REG_PSCTL, PSCTL_GO2DOZE); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"Go to Doze ZZZZZZZZZZZZZZZ\n"); - return TRUE; + return true; } /* @@ -1427,16 +943,16 @@ CARDbPowerDown( * Out: * none * - * Return Value: TRUE if success; otherwise FALSE + * Return Value: true if success; otherwise false * */ -BOOL CARDbRadioPowerOff (void *pDeviceHandler) +bool CARDbRadioPowerOff (void *pDeviceHandler) { PSDevice pDevice = (PSDevice) pDeviceHandler; - BOOL bResult = TRUE; + bool bResult = true; - if (pDevice->bRadioOff == TRUE) - return TRUE; + if (pDevice->bRadioOff == true) + return true; switch (pDevice->byRFType) { @@ -1459,7 +975,7 @@ BOOL CARDbRadioPowerOff (void *pDeviceHandler) BBvSetDeepSleep(pDevice->PortOffset, pDevice->byLocalID); - pDevice->bRadioOff = TRUE; + pDevice->bRadioOff = true; //2007-0409-03,<Add> by chester printk("chester power off\n"); MACvRegBitsOn(pDevice->PortOffset, MAC_REG_GPIOCTL0, LED_ACTSET); //LED issue @@ -1476,23 +992,23 @@ MACvRegBitsOn(pDevice->PortOffset, MAC_REG_GPIOCTL0, LED_ACTSET); //LED issue * Out: * none * - * Return Value: TRUE if success; otherwise FALSE + * Return Value: true if success; otherwise false * */ -BOOL CARDbRadioPowerOn (void *pDeviceHandler) +bool CARDbRadioPowerOn (void *pDeviceHandler) { PSDevice pDevice = (PSDevice) pDeviceHandler; - BOOL bResult = TRUE; + bool bResult = true; printk("chester power on\n"); - if (pDevice->bRadioControlOff == TRUE){ -if (pDevice->bHWRadioOff == TRUE) printk("chester bHWRadioOff\n"); -if (pDevice->bRadioControlOff == TRUE) printk("chester bRadioControlOff\n"); - return FALSE;} + if (pDevice->bRadioControlOff == true){ +if (pDevice->bHWRadioOff == true) printk("chester bHWRadioOff\n"); +if (pDevice->bRadioControlOff == true) printk("chester bRadioControlOff\n"); + return false;} - if (pDevice->bRadioOff == FALSE) + if (pDevice->bRadioOff == false) { printk("chester pbRadioOff\n"); -return TRUE;} +return true;} BBvExitDeepSleep(pDevice->PortOffset, pDevice->byLocalID); @@ -1514,7 +1030,7 @@ return TRUE;} } - pDevice->bRadioOff = FALSE; + pDevice->bRadioOff = false; // 2007-0409-03,<Add> by chester printk("chester power on\n"); MACvRegBitsOff(pDevice->PortOffset, MAC_REG_GPIOCTL0, LED_ACTSET); //LED issue @@ -1523,12 +1039,12 @@ MACvRegBitsOff(pDevice->PortOffset, MAC_REG_GPIOCTL0, LED_ACTSET); //LED issue -BOOL CARDbRemoveKey (void *pDeviceHandler, PBYTE pbyBSSID) +bool CARDbRemoveKey (void *pDeviceHandler, unsigned char *pbyBSSID) { PSDevice pDevice = (PSDevice) pDeviceHandler; KeybRemoveAllKey(&(pDevice->sKey), pbyBSSID, pDevice->PortOffset); - return (TRUE); + return (true); } @@ -1548,17 +1064,17 @@ BOOL CARDbRemoveKey (void *pDeviceHandler, PBYTE pbyBSSID) * Return Value: none. * -*/ -BOOL +bool CARDbAdd_PMKID_Candidate ( void *pDeviceHandler, - PBYTE pbyBSSID, - BOOL bRSNCapExist, - WORD wRSNCap + unsigned char *pbyBSSID, + bool bRSNCapExist, + unsigned short wRSNCap ) { PSDevice pDevice = (PSDevice) pDeviceHandler; PPMKID_CANDIDATE pCandidateList; - UINT ii = 0; + unsigned int ii = 0; DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"bAdd_PMKID_Candidate START: (%d)\n", (int)pDevice->gsPMKIDCandidate.NumCandidates); @@ -1577,18 +1093,18 @@ CARDbAdd_PMKID_Candidate ( for (ii = 0; ii < pDevice->gsPMKIDCandidate.NumCandidates; ii++) { pCandidateList = &pDevice->gsPMKIDCandidate.CandidateList[ii]; if ( !memcmp(pCandidateList->BSSID, pbyBSSID, ETH_ALEN)) { - if ((bRSNCapExist == TRUE) && (wRSNCap & BIT0)) { + if ((bRSNCapExist == true) && (wRSNCap & BIT0)) { pCandidateList->Flags |= NDIS_802_11_PMKID_CANDIDATE_PREAUTH_ENABLED; } else { pCandidateList->Flags &= ~(NDIS_802_11_PMKID_CANDIDATE_PREAUTH_ENABLED); } - return TRUE; + return true; } } // New Candidate pCandidateList = &pDevice->gsPMKIDCandidate.CandidateList[pDevice->gsPMKIDCandidate.NumCandidates]; - if ((bRSNCapExist == TRUE) && (wRSNCap & BIT0)) { + if ((bRSNCapExist == true) && (wRSNCap & BIT0)) { pCandidateList->Flags |= NDIS_802_11_PMKID_CANDIDATE_PREAUTH_ENABLED; } else { pCandidateList->Flags &= ~(NDIS_802_11_PMKID_CANDIDATE_PREAUTH_ENABLED); @@ -1596,7 +1112,7 @@ CARDbAdd_PMKID_Candidate ( memcpy(pCandidateList->BSSID, pbyBSSID, ETH_ALEN); pDevice->gsPMKIDCandidate.NumCandidates++; DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"NumCandidates:%d\n", (int)pDevice->gsPMKIDCandidate.NumCandidates); - return TRUE; + return true; } void * @@ -1609,89 +1125,6 @@ CARDpGetCurrentAddress ( return (pDevice->abyCurrentNetAddr); } - - -void CARDvInitChannelTable (void *pDeviceHandler) -{ - PSDevice pDevice = (PSDevice) pDeviceHandler; - BOOL bMultiBand = FALSE; - UINT ii; - - for(ii=1;ii<=CARD_MAX_CHANNEL_TBL;ii++) { - sChannelTbl[ii].bValid = FALSE; - } - - switch (pDevice->byRFType) { - case RF_RFMD2959 : - case RF_AIROHA : - case RF_AL2230S: - case RF_UW2451 : - case RF_VT3226 : - // printk("chester-false\n"); - bMultiBand = FALSE; - break; - case RF_AIROHA7230 : - case RF_UW2452 : - case RF_NOTHING : - default : - bMultiBand = TRUE; - break; - } - - if ((pDevice->dwDiagRefCount != 0) || - (pDevice->b11hEnable == TRUE)) { - if (bMultiBand == TRUE) { - for(ii=0;ii<CARD_MAX_CHANNEL_TBL;ii++) { - sChannelTbl[ii+1].bValid = TRUE; - pDevice->abyRegPwr[ii+1] = pDevice->abyOFDMDefaultPwr[ii+1]; - pDevice->abyLocalPwr[ii+1] = pDevice->abyOFDMDefaultPwr[ii+1]; - } - for(ii=0;ii<CHANNEL_MAX_24G;ii++) { - pDevice->abyRegPwr[ii+1] = pDevice->abyCCKDefaultPwr[ii+1]; - pDevice->abyLocalPwr[ii+1] = pDevice->abyCCKDefaultPwr[ii+1]; - } - } else { - for(ii=0;ii<CHANNEL_MAX_24G;ii++) { -//2008-8-4 <add> by chester - if (ChannelRuleTab[pDevice->byZoneType].bChannelIdxList[ii] != 0) { - sChannelTbl[ii+1].bValid = TRUE; - pDevice->abyRegPwr[ii+1] = pDevice->abyCCKDefaultPwr[ii+1]; - pDevice->abyLocalPwr[ii+1] = pDevice->abyCCKDefaultPwr[ii+1]; - } - } - } - } else if (pDevice->byZoneType <= CCODE_MAX) { - if (bMultiBand == TRUE) { - for(ii=0;ii<CARD_MAX_CHANNEL_TBL;ii++) { - if (ChannelRuleTab[pDevice->byZoneType].bChannelIdxList[ii] != 0) { - sChannelTbl[ii+1].bValid = TRUE; - pDevice->abyRegPwr[ii+1] = ChannelRuleTab[pDevice->byZoneType].byPower[ii]; - pDevice->abyLocalPwr[ii+1] = ChannelRuleTab[pDevice->byZoneType].byPower[ii]; - } - } - } else { - for(ii=0;ii<CHANNEL_MAX_24G;ii++) { - if (ChannelRuleTab[pDevice->byZoneType].bChannelIdxList[ii] != 0) { - sChannelTbl[ii+1].bValid = TRUE; - pDevice->abyRegPwr[ii+1] = ChannelRuleTab[pDevice->byZoneType].byPower[ii]; - pDevice->abyLocalPwr[ii+1] = ChannelRuleTab[pDevice->byZoneType].byPower[ii]; - } - } - } - } - DBG_PRT(MSG_LEVEL_NOTICE, KERN_INFO"Zone=[%d][%c][%c]!!\n",pDevice->byZoneType,ChannelRuleTab[pDevice->byZoneType].chCountryCode[0],ChannelRuleTab[pDevice->byZoneType].chCountryCode[1]); - for(ii=0;ii<CARD_MAX_CHANNEL_TBL;ii++) { - if (pDevice->abyRegPwr[ii+1] == 0) { - pDevice->abyRegPwr[ii+1] = pDevice->abyOFDMDefaultPwr[ii+1]; - } - if (pDevice->abyLocalPwr[ii+1] == 0) { - pDevice->abyLocalPwr[ii+1] = pDevice->abyOFDMDefaultPwr[ii+1]; - } - } -} - - - /* * * Description: @@ -1706,27 +1139,27 @@ void CARDvInitChannelTable (void *pDeviceHandler) * Return Value: none. * -*/ -BOOL +bool CARDbStartMeasure ( void *pDeviceHandler, void *pvMeasureEIDs, - UINT uNumOfMeasureEIDs + unsigned int uNumOfMeasureEIDs ) { PSDevice pDevice = (PSDevice) pDeviceHandler; PWLAN_IE_MEASURE_REQ pEID = (PWLAN_IE_MEASURE_REQ) pvMeasureEIDs; QWORD qwCurrTSF; QWORD qwStartTSF; - BOOL bExpired = TRUE; - WORD wDuration = 0; + bool bExpired = true; + unsigned short wDuration = 0; if ((pEID == NULL) || (uNumOfMeasureEIDs == 0)) { - return (TRUE); + return (true); } CARDbGetCurrentTSF(pDevice->PortOffset, &qwCurrTSF); - if (pDevice->bMeasureInProgress == TRUE) { - pDevice->bMeasureInProgress = FALSE; + if (pDevice->bMeasureInProgress == true) { + pDevice->bMeasureInProgress = false; VNSvOutPortB(pDevice->PortOffset + MAC_REG_RCR, pDevice->byOrgRCR); MACvSelectPage1(pDevice->PortOffset); VNSvOutPortD(pDevice->PortOffset + MAC_REG_MAR0, pDevice->dwOrgMAR0); @@ -1734,7 +1167,7 @@ CARDbStartMeasure ( // clear measure control MACvRegBitsOff(pDevice->PortOffset, MAC_REG_MSRCTL, MSRCTL_EN); MACvSelectPage0(pDevice->PortOffset); - CARDbSetChannel(pDevice, pDevice->byOrgChannel); + set_channel(pDevice, pDevice->byOrgChannel); MACvSelectPage1(pDevice->PortOffset); MACvRegBitsOn(pDevice->PortOffset, MAC_REG_MSRCTL+1, MSRCTL1_TXPAUSE); MACvSelectPage0(pDevice->PortOffset); @@ -1749,7 +1182,7 @@ CARDbStartMeasure ( if (pDevice->byLocalID > REV_ID_VT3253_B1) { HIDWORD(qwStartTSF) = HIDWORD(*((PQWORD) (pDevice->pCurrMeasureEID->sReq.abyStartTime))); LODWORD(qwStartTSF) = LODWORD(*((PQWORD) (pDevice->pCurrMeasureEID->sReq.abyStartTime))); - wDuration = *((PWORD) (pDevice->pCurrMeasureEID->sReq.abyDuration)); + wDuration = *((unsigned short *) (pDevice->pCurrMeasureEID->sReq.abyDuration)); wDuration += 1; // 1 TU for channel switching if ((LODWORD(qwStartTSF) == 0) && (HIDWORD(qwStartTSF) == 0)) { @@ -1759,7 +1192,7 @@ CARDbStartMeasure ( if (LODWORD(qwCurrTSF) > LODWORD(qwStartTSF)) { HIDWORD(qwStartTSF)++; } - bExpired = FALSE; + bExpired = false; break; } else { // start at setting start TSF - 1TU(for channel switching) @@ -1773,11 +1206,11 @@ CARDbStartMeasure ( ((HIDWORD(qwCurrTSF) == HIDWORD(qwStartTSF)) && (LODWORD(qwCurrTSF) < LODWORD(qwStartTSF))) ) { - bExpired = FALSE; + bExpired = false; break; } VNTWIFIbMeasureReport( pDevice->pMgmt, - FALSE, + false, pDevice->pCurrMeasureEID, MEASURE_MODE_LATE, pDevice->byBasicMap, @@ -1787,7 +1220,7 @@ CARDbStartMeasure ( } else { // hardware do not support measure VNTWIFIbMeasureReport( pDevice->pMgmt, - FALSE, + false, pDevice->pCurrMeasureEID, MEASURE_MODE_INCAPABLE, pDevice->byBasicMap, @@ -1797,7 +1230,7 @@ CARDbStartMeasure ( } } while (pDevice->uNumOfMeasureEIDs != 0); - if (bExpired == FALSE) { + if (bExpired == false) { MACvSelectPage1(pDevice->PortOffset); VNSvOutPortD(pDevice->PortOffset + MAC_REG_MSRSTART, LODWORD(qwStartTSF)); VNSvOutPortD(pDevice->PortOffset + MAC_REG_MSRSTART + 4, HIDWORD(qwStartTSF)); @@ -1807,7 +1240,7 @@ CARDbStartMeasure ( } else { // all measure start time expired we should complete action VNTWIFIbMeasureReport( pDevice->pMgmt, - TRUE, + true, NULL, 0, pDevice->byBasicMap, @@ -1815,7 +1248,7 @@ CARDbStartMeasure ( pDevice->abyRPIs ); } - return (TRUE); + return (true); } @@ -1833,19 +1266,19 @@ CARDbStartMeasure ( * Return Value: none. * -*/ -BOOL +bool CARDbChannelSwitch ( void *pDeviceHandler, - BYTE byMode, - BYTE byNewChannel, - BYTE byCount + unsigned char byMode, + unsigned char byNewChannel, + unsigned char byCount ) { PSDevice pDevice = (PSDevice) pDeviceHandler; - BOOL bResult = TRUE; + bool bResult = true; if (byCount == 0) { - bResult = CARDbSetChannel(pDevice, byNewChannel); + bResult = set_channel(pDevice, byNewChannel); VNTWIFIbChannelSwitch(pDevice->pMgmt, byNewChannel); MACvSelectPage1(pDevice->PortOffset); MACvRegBitsOn(pDevice->PortOffset, MAC_REG_MSRCTL+1, MSRCTL1_TXPAUSE); @@ -1854,7 +1287,7 @@ CARDbChannelSwitch ( } pDevice->byChannelSwitchCount = byCount; pDevice->byNewChannel = byNewChannel; - pDevice->bChannelSwitch = TRUE; + pDevice->bChannelSwitch = true; if (byMode == 1) { bResult=CARDbStopTxPacket(pDevice, PKT_TYPE_802_11_ALL); } @@ -1876,34 +1309,34 @@ CARDbChannelSwitch ( * Return Value: none. * -*/ -BOOL +bool CARDbSetQuiet ( void *pDeviceHandler, - BOOL bResetQuiet, - BYTE byQuietCount, - BYTE byQuietPeriod, - WORD wQuietDuration, - WORD wQuietOffset + bool bResetQuiet, + unsigned char byQuietCount, + unsigned char byQuietPeriod, + unsigned short wQuietDuration, + unsigned short wQuietOffset ) { PSDevice pDevice = (PSDevice) pDeviceHandler; - UINT ii = 0; + unsigned int ii = 0; - if (bResetQuiet == TRUE) { + if (bResetQuiet == true) { MACvRegBitsOff(pDevice->PortOffset, MAC_REG_MSRCTL, (MSRCTL_QUIETTXCHK | MSRCTL_QUIETEN)); for(ii=0;ii<MAX_QUIET_COUNT;ii++) { - pDevice->sQuiet[ii].bEnable = FALSE; + pDevice->sQuiet[ii].bEnable = false; } pDevice->uQuietEnqueue = 0; - pDevice->bEnableFirstQuiet = FALSE; - pDevice->bQuietEnable = FALSE; + pDevice->bEnableFirstQuiet = false; + pDevice->bQuietEnable = false; pDevice->byQuietStartCount = byQuietCount; } - if (pDevice->sQuiet[pDevice->uQuietEnqueue].bEnable == FALSE) { - pDevice->sQuiet[pDevice->uQuietEnqueue].bEnable = TRUE; + if (pDevice->sQuiet[pDevice->uQuietEnqueue].bEnable == false) { + pDevice->sQuiet[pDevice->uQuietEnqueue].bEnable = true; pDevice->sQuiet[pDevice->uQuietEnqueue].byPeriod = byQuietPeriod; pDevice->sQuiet[pDevice->uQuietEnqueue].wDuration = wQuietDuration; - pDevice->sQuiet[pDevice->uQuietEnqueue].dwStartTime = (DWORD) byQuietCount; + pDevice->sQuiet[pDevice->uQuietEnqueue].dwStartTime = (unsigned long) byQuietCount; pDevice->sQuiet[pDevice->uQuietEnqueue].dwStartTime *= pDevice->wBeaconInterval; pDevice->sQuiet[pDevice->uQuietEnqueue].dwStartTime += wQuietOffset; pDevice->uQuietEnqueue++; @@ -1914,7 +1347,7 @@ CARDbSetQuiet ( } else { // we can not handle Quiet EID more } - return (TRUE); + return (true); } @@ -1932,21 +1365,21 @@ CARDbSetQuiet ( * Return Value: none. * -*/ -BOOL +bool CARDbStartQuiet ( void *pDeviceHandler ) { PSDevice pDevice = (PSDevice) pDeviceHandler; - UINT ii = 0; - DWORD dwStartTime = 0xFFFFFFFF; - UINT uCurrentQuietIndex = 0; - DWORD dwNextTime = 0; - DWORD dwGap = 0; - DWORD dwDuration = 0; + unsigned int ii = 0; + unsigned long dwStartTime = 0xFFFFFFFF; + unsigned int uCurrentQuietIndex = 0; + unsigned long dwNextTime = 0; + unsigned long dwGap = 0; + unsigned long dwDuration = 0; for(ii=0;ii<MAX_QUIET_COUNT;ii++) { - if ((pDevice->sQuiet[ii].bEnable == TRUE) && + if ((pDevice->sQuiet[ii].bEnable == true) && (dwStartTime > pDevice->sQuiet[ii].dwStartTime)) { dwStartTime = pDevice->sQuiet[ii].dwStartTime; uCurrentQuietIndex = ii; @@ -1954,22 +1387,22 @@ CARDbStartQuiet ( } if (dwStartTime == 0xFFFFFFFF) { // no more quiet - pDevice->bQuietEnable = FALSE; + pDevice->bQuietEnable = false; MACvRegBitsOff(pDevice->PortOffset, MAC_REG_MSRCTL, (MSRCTL_QUIETTXCHK | MSRCTL_QUIETEN)); } else { - if (pDevice->bQuietEnable == FALSE) { + if (pDevice->bQuietEnable == false) { // first quiet pDevice->byQuietStartCount--; dwNextTime = pDevice->sQuiet[uCurrentQuietIndex].dwStartTime; dwNextTime %= pDevice->wBeaconInterval; MACvSelectPage1(pDevice->PortOffset); - VNSvOutPortW(pDevice->PortOffset + MAC_REG_QUIETINIT, (WORD) dwNextTime); - VNSvOutPortW(pDevice->PortOffset + MAC_REG_QUIETDUR, (WORD) pDevice->sQuiet[uCurrentQuietIndex].wDuration); + VNSvOutPortW(pDevice->PortOffset + MAC_REG_QUIETINIT, (unsigned short) dwNextTime); + VNSvOutPortW(pDevice->PortOffset + MAC_REG_QUIETDUR, (unsigned short) pDevice->sQuiet[uCurrentQuietIndex].wDuration); if (pDevice->byQuietStartCount == 0) { - pDevice->bEnableFirstQuiet = FALSE; + pDevice->bEnableFirstQuiet = false; MACvRegBitsOn(pDevice->PortOffset, MAC_REG_MSRCTL, (MSRCTL_QUIETTXCHK | MSRCTL_QUIETEN)); } else { - pDevice->bEnableFirstQuiet = TRUE; + pDevice->bEnableFirstQuiet = true; } MACvSelectPage0(pDevice->PortOffset); } else { @@ -1977,8 +1410,8 @@ CARDbStartQuiet ( // overlap with previous Quiet dwGap = pDevice->dwCurrentQuietEndTime - pDevice->sQuiet[uCurrentQuietIndex].dwStartTime; if (dwGap >= pDevice->sQuiet[uCurrentQuietIndex].wDuration) { - // return FALSE to indicate next quiet expired, should call this function again - return (FALSE); + // return false to indicate next quiet expired, should call this function again + return (false); } dwDuration = pDevice->sQuiet[uCurrentQuietIndex].wDuration - dwGap; dwGap = 0; @@ -1988,94 +1421,34 @@ CARDbStartQuiet ( } // set GAP and Next duration MACvSelectPage1(pDevice->PortOffset); - VNSvOutPortW(pDevice->PortOffset + MAC_REG_QUIETGAP, (WORD) dwGap); - VNSvOutPortW(pDevice->PortOffset + MAC_REG_QUIETDUR, (WORD) dwDuration); + VNSvOutPortW(pDevice->PortOffset + MAC_REG_QUIETGAP, (unsigned short) dwGap); + VNSvOutPortW(pDevice->PortOffset + MAC_REG_QUIETDUR, (unsigned short) dwDuration); MACvRegBitsOn(pDevice->PortOffset, MAC_REG_MSRCTL, MSRCTL_QUIETRPT); MACvSelectPage0(pDevice->PortOffset); } - pDevice->bQuietEnable = TRUE; + pDevice->bQuietEnable = true; pDevice->dwCurrentQuietEndTime = pDevice->sQuiet[uCurrentQuietIndex].dwStartTime; pDevice->dwCurrentQuietEndTime += pDevice->sQuiet[uCurrentQuietIndex].wDuration; if (pDevice->sQuiet[uCurrentQuietIndex].byPeriod == 0) { // not period disable current quiet element - pDevice->sQuiet[uCurrentQuietIndex].bEnable = FALSE; + pDevice->sQuiet[uCurrentQuietIndex].bEnable = false; } else { // set next period start time - dwNextTime = (DWORD) pDevice->sQuiet[uCurrentQuietIndex].byPeriod; + dwNextTime = (unsigned long) pDevice->sQuiet[uCurrentQuietIndex].byPeriod; dwNextTime *= pDevice->wBeaconInterval; pDevice->sQuiet[uCurrentQuietIndex].dwStartTime = dwNextTime; } if (pDevice->dwCurrentQuietEndTime > 0x80010000) { // decreament all time to avoid wrap around for(ii=0;ii<MAX_QUIET_COUNT;ii++) { - if (pDevice->sQuiet[ii].bEnable == TRUE) { + if (pDevice->sQuiet[ii].bEnable == true) { pDevice->sQuiet[ii].dwStartTime -= 0x80000000; } } pDevice->dwCurrentQuietEndTime -= 0x80000000; } } - return (TRUE); -} - - -/* - * - * Description: - * Set Channel Info of Country - * - * Parameters: - * In: - * hDeviceContext - device structure point - * Out: - * none - * - * Return Value: none. - * --*/ -void -CARDvSetCountryInfo ( - void *pDeviceHandler, - CARD_PHY_TYPE ePHYType, - void *pIE - ) -{ - PSDevice pDevice = (PSDevice) pDeviceHandler; - UINT ii = 0; - UINT uu = 0; - UINT step = 0; - UINT uNumOfCountryInfo = 0; - BYTE byCh = 0; - PWLAN_IE_COUNTRY pIE_Country = (PWLAN_IE_COUNTRY) pIE; - - - uNumOfCountryInfo = (pIE_Country->len - 3); - uNumOfCountryInfo /= 3; - - if (ePHYType == PHY_TYPE_11A) { - pDevice->bCountryInfo5G = TRUE; - for(ii=CB_MAX_CHANNEL_24G+1;ii<=CARD_MAX_CHANNEL_TBL;ii++) { - sChannelTbl[ii].bValid = FALSE; - } - step = 4; - } else { - pDevice->bCountryInfo24G = TRUE; - for(ii=1;ii<=CB_MAX_CHANNEL_24G;ii++) { - sChannelTbl[ii].bValid = FALSE; - } - step = 1; - } - pDevice->abyCountryCode[0] = pIE_Country->abyCountryString[0]; - pDevice->abyCountryCode[1] = pIE_Country->abyCountryString[1]; - pDevice->abyCountryCode[2] = pIE_Country->abyCountryString[2]; - - for(ii=0;ii<uNumOfCountryInfo;ii++) { - for(uu=0;uu<pIE_Country->abyCountryInfo[ii*3+1];uu++) { - byCh = CARDbyGetChannelMapping(pDevice, (BYTE)(pIE_Country->abyCountryInfo[ii*3]+step*uu), ePHYType); - sChannelTbl[byCh].bValid = TRUE; - pDevice->abyRegPwr[byCh] = pIE_Country->abyCountryInfo[ii*3+2]; - } - } + return (true); } /* @@ -2095,18 +1468,18 @@ CARDvSetCountryInfo ( void CARDvSetPowerConstraint ( void *pDeviceHandler, - BYTE byChannel, - I8 byPower + unsigned char byChannel, + char byPower ) { PSDevice pDevice = (PSDevice) pDeviceHandler; if (byChannel > CB_MAX_CHANNEL_24G) { - if (pDevice->bCountryInfo5G == TRUE) { + if (pDevice->bCountryInfo5G == true) { pDevice->abyLocalPwr[byChannel] = pDevice->abyRegPwr[byChannel] - byPower; } } else { - if (pDevice->bCountryInfo24G == TRUE) { + if (pDevice->bCountryInfo24G == true) { pDevice->abyLocalPwr[byChannel] = pDevice->abyRegPwr[byChannel] - byPower; } } @@ -2130,12 +1503,12 @@ CARDvSetPowerConstraint ( void CARDvGetPowerCapability ( void *pDeviceHandler, - PBYTE pbyMinPower, - PBYTE pbyMaxPower + unsigned char *pbyMinPower, + unsigned char *pbyMaxPower ) { PSDevice pDevice = (PSDevice) pDeviceHandler; - BYTE byDec = 0; + unsigned char byDec = 0; *pbyMaxPower = pDevice->abyOFDMDefaultPwr[pDevice->byCurrentCh]; byDec = pDevice->abyOFDMPwrTbl[pDevice->byCurrentCh]; @@ -2148,98 +1521,6 @@ CARDvGetPowerCapability ( *pbyMinPower = pDevice->abyOFDMDefaultPwr[pDevice->byCurrentCh] - byDec; } - -/* - * - * Description: - * Set Support Channels IE defined in 802.11h - * - * Parameters: - * In: - * hDeviceContext - device structure point - * Out: - * none - * - * Return Value: none. - * --*/ -BYTE -CARDbySetSupportChannels ( - void *pDeviceHandler, - PBYTE pbyIEs - ) -{ - PSDevice pDevice = (PSDevice) pDeviceHandler; - UINT ii; - BYTE byCount; - PWLAN_IE_SUPP_CH pIE = (PWLAN_IE_SUPP_CH) pbyIEs; - PBYTE pbyChTupple; - BYTE byLen = 0; - - - pIE->byElementID = WLAN_EID_SUPP_CH; - pIE->len = 0; - pbyChTupple = pIE->abyChannelTuple; - byLen = 2; - // lower band - byCount = 0; - if (ChannelRuleTab[pDevice->byZoneType].bChannelIdxList[28] == TRUE) { - for (ii=28;ii<36;ii+=2) { - if (ChannelRuleTab[pDevice->byZoneType].bChannelIdxList[ii] == TRUE) { - byCount++; - } - } - *pbyChTupple++ = 34; - *pbyChTupple++ = byCount; - byLen += 2; - } else if (ChannelRuleTab[pDevice->byZoneType].bChannelIdxList[29] == TRUE) { - for (ii=29;ii<36;ii+=2) { - if (ChannelRuleTab[pDevice->byZoneType].bChannelIdxList[ii] == TRUE) { - byCount++; - } - } - *pbyChTupple++ = 36; - *pbyChTupple++ = byCount; - byLen += 2; - } - // middle band - byCount = 0; - if (ChannelRuleTab[pDevice->byZoneType].bChannelIdxList[36] == TRUE) { - for (ii=36;ii<40;ii++) { - if (ChannelRuleTab[pDevice->byZoneType].bChannelIdxList[ii] == TRUE) { - byCount++; - } - } - *pbyChTupple++ = 52; - *pbyChTupple++ = byCount; - byLen += 2; - } - // higher band - byCount = 0; - if (ChannelRuleTab[pDevice->byZoneType].bChannelIdxList[40] == TRUE) { - for (ii=40;ii<51;ii++) { - if (ChannelRuleTab[pDevice->byZoneType].bChannelIdxList[ii] == TRUE) { - byCount++; - } - } - *pbyChTupple++ = 100; - *pbyChTupple++ = byCount; - byLen += 2; - } else if (ChannelRuleTab[pDevice->byZoneType].bChannelIdxList[51] == TRUE) { - for (ii=51;ii<56;ii++) { - if (ChannelRuleTab[pDevice->byZoneType].bChannelIdxList[ii] == TRUE) { - byCount++; - } - } - *pbyChTupple++ = 149; - *pbyChTupple++ = byCount; - byLen += 2; - } - pIE->len += (byLen - 2); - return (byLen); -} - - /* * * Description: @@ -2253,8 +1534,8 @@ CARDbySetSupportChannels ( * * Return Value: none. * --*/ -I8 + */ +char CARDbyGetTransmitPower ( void *pDeviceHandler ) @@ -2264,161 +1545,6 @@ CARDbyGetTransmitPower ( return (pDevice->byCurPwrdBm); } - -BOOL -CARDbChannelGetList ( - UINT uCountryCodeIdx, - PBYTE pbyChannelTable - ) -{ - if (uCountryCodeIdx >= CCODE_MAX) { - return (FALSE); - } - memcpy(pbyChannelTable, ChannelRuleTab[uCountryCodeIdx].bChannelIdxList, CB_MAX_CHANNEL); - return (TRUE); -} - - -void -CARDvSetCountryIE( - void *pDeviceHandler, - void *pIE - ) -{ - PSDevice pDevice = (PSDevice) pDeviceHandler; - UINT ii; - PWLAN_IE_COUNTRY pIECountry = (PWLAN_IE_COUNTRY) pIE; - - pIECountry->byElementID = WLAN_EID_COUNTRY; - pIECountry->len = 0; - pIECountry->abyCountryString[0] = ChannelRuleTab[pDevice->byZoneType].chCountryCode[0]; - pIECountry->abyCountryString[1] = ChannelRuleTab[pDevice->byZoneType].chCountryCode[1]; - pIECountry->abyCountryString[2] = ' '; - for (ii = CB_MAX_CHANNEL_24G; ii < CB_MAX_CHANNEL; ii++ ) { - if (ChannelRuleTab[pDevice->byZoneType].bChannelIdxList[ii] != 0) { - pIECountry->abyCountryInfo[pIECountry->len++] = sChannelTbl[ii+1].byChannelNumber; - pIECountry->abyCountryInfo[pIECountry->len++] = 1; - pIECountry->abyCountryInfo[pIECountry->len++] = ChannelRuleTab[pDevice->byZoneType].byPower[ii]; - } - } - pIECountry->len += 3; -} - - -BOOL -CARDbGetChannelMapInfo( - void *pDeviceHandler, - UINT uChannelIndex, - PBYTE pbyChannelNumber, - PBYTE pbyMap - ) -{ -// PSDevice pDevice = (PSDevice) pDeviceHandler; - - if (uChannelIndex > CB_MAX_CHANNEL) { - return FALSE; - } - *pbyChannelNumber = sChannelTbl[uChannelIndex].byChannelNumber; - *pbyMap = sChannelTbl[uChannelIndex].byMAP; - return sChannelTbl[uChannelIndex].bValid; -} - - -void -CARDvSetChannelMapInfo( - void *pDeviceHandler, - UINT uChannelIndex, - BYTE byMap - ) -{ -// PSDevice pDevice = (PSDevice) pDeviceHandler; - - if (uChannelIndex > CB_MAX_CHANNEL) { - return; - } - sChannelTbl[uChannelIndex].byMAP |= byMap; -} - - -void -CARDvClearChannelMapInfo( - void *pDeviceHandler - ) -{ -// PSDevice pDevice = (PSDevice) pDeviceHandler; - UINT ii = 0; - - for (ii = 1; ii <= CB_MAX_CHANNEL; ii++) { - sChannelTbl[ii].byMAP = 0; - } -} - - -BYTE -CARDbyAutoChannelSelect( - void *pDeviceHandler, - CARD_PHY_TYPE ePHYType - ) -{ -// PSDevice pDevice = (PSDevice) pDeviceHandler; - UINT ii = 0; - BYTE byOptionChannel = 0; - INT aiWeight[CB_MAX_CHANNEL_24G+1] = {-1000,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; - - if (ePHYType == PHY_TYPE_11A) { - for(ii=CB_MAX_CHANNEL_24G+1;ii<=CB_MAX_CHANNEL;ii++) { - if (sChannelTbl[ii].bValid == TRUE) { - if (byOptionChannel == 0) { - byOptionChannel = (BYTE) ii; - } - if (sChannelTbl[ii].byMAP == 0) { - return ((BYTE) ii); - } else if ( !(sChannelTbl[ii].byMAP & 0x08)) { - byOptionChannel = (BYTE) ii; - } - } - } - } else { - byOptionChannel = 0; - for(ii=1;ii<=CB_MAX_CHANNEL_24G;ii++) { - if (sChannelTbl[ii].bValid == TRUE) { - if (sChannelTbl[ii].byMAP == 0) { - aiWeight[ii] += 100; - } else if (sChannelTbl[ii].byMAP & 0x01) { - if (ii > 3) { - aiWeight[ii-3] -= 10; - } - if (ii > 2) { - aiWeight[ii-2] -= 20; - } - if (ii > 1) { - aiWeight[ii-1] -= 40; - } - aiWeight[ii] -= 80; - if (ii < CB_MAX_CHANNEL_24G) { - aiWeight[ii+1] -= 40; - } - if (ii < (CB_MAX_CHANNEL_24G - 1)) { - aiWeight[ii+2] -= 20; - } - if (ii < (CB_MAX_CHANNEL_24G - 2)) { - aiWeight[ii+3] -= 10; - } - } - } - } - for(ii=1;ii<=CB_MAX_CHANNEL_24G;ii++) { - if ((sChannelTbl[ii].bValid == TRUE) && - (aiWeight[ii] > aiWeight[byOptionChannel])) { - byOptionChannel = (BYTE) ii; - } - } - } - return (byOptionChannel); -} - - - //xxx void CARDvSafeResetTx ( @@ -2426,7 +1552,7 @@ CARDvSafeResetTx ( ) { PSDevice pDevice = (PSDevice) pDeviceHandler; - UINT uu; + unsigned int uu; PSTxDesc pCurrTD; // initialize TD index @@ -2482,7 +1608,7 @@ CARDvSafeResetRx ( ) { PSDevice pDevice = (PSDevice) pDeviceHandler; - UINT uu; + unsigned int uu; PSRxDesc pDesc; @@ -2494,17 +1620,17 @@ CARDvSafeResetRx ( // init state, all RD is chip's for (uu = 0; uu < pDevice->sOpts.nRxDescs0; uu++) { pDesc =&(pDevice->aRD0Ring[uu]); - pDesc->m_rd0RD0.wResCount = (WORD)(pDevice->rx_buf_sz); + pDesc->m_rd0RD0.wResCount = (unsigned short)(pDevice->rx_buf_sz); pDesc->m_rd0RD0.f1Owner=OWNED_BY_NIC; - pDesc->m_rd1RD1.wReqCount = (WORD)(pDevice->rx_buf_sz); + pDesc->m_rd1RD1.wReqCount = (unsigned short)(pDevice->rx_buf_sz); } // init state, all RD is chip's for (uu = 0; uu < pDevice->sOpts.nRxDescs1; uu++) { pDesc =&(pDevice->aRD1Ring[uu]); - pDesc->m_rd0RD0.wResCount = (WORD)(pDevice->rx_buf_sz); + pDesc->m_rd0RD0.wResCount = (unsigned short)(pDevice->rx_buf_sz); pDesc->m_rd0RD0.f1Owner=OWNED_BY_NIC; - pDesc->m_rd1RD1.wReqCount = (WORD)(pDevice->rx_buf_sz); + pDesc->m_rd1RD1.wReqCount = (unsigned short)(pDevice->rx_buf_sz); } pDevice->cbDFCB = CB_MAX_RX_FRAG; @@ -2537,18 +1663,18 @@ CARDvSafeResetRx ( * Return Value: response Control frame rate * */ -WORD CARDwGetCCKControlRate(void *pDeviceHandler, WORD wRateIdx) +unsigned short CARDwGetCCKControlRate(void *pDeviceHandler, unsigned short wRateIdx) { PSDevice pDevice = (PSDevice) pDeviceHandler; - UINT ui = (UINT)wRateIdx; + unsigned int ui = (unsigned int) wRateIdx; while (ui > RATE_1M) { - if (pDevice->wBasicRate & ((WORD)1 << ui)) { - return (WORD)ui; + if (pDevice->wBasicRate & ((unsigned short)1 << ui)) { + return (unsigned short)ui; } ui --; } - return (WORD)RATE_1M; + return (unsigned short)RATE_1M; } /* @@ -2564,10 +1690,10 @@ WORD CARDwGetCCKControlRate(void *pDeviceHandler, WORD wRateIdx) * Return Value: response Control frame rate * */ -WORD CARDwGetOFDMControlRate (void *pDeviceHandler, WORD wRateIdx) +unsigned short CARDwGetOFDMControlRate (void *pDeviceHandler, unsigned short wRateIdx) { PSDevice pDevice = (PSDevice) pDeviceHandler; - UINT ui = (UINT)wRateIdx; + unsigned int ui = (unsigned int) wRateIdx; DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"BASIC RATE: %X\n", pDevice->wBasicRate); @@ -2578,14 +1704,14 @@ WORD CARDwGetOFDMControlRate (void *pDeviceHandler, WORD wRateIdx) return wRateIdx; } while (ui > RATE_11M) { - if (pDevice->wBasicRate & ((WORD)1 << ui)) { + if (pDevice->wBasicRate & ((unsigned short)1 << ui)) { DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"CARDwGetOFDMControlRate : %d\n", ui); - return (WORD)ui; + return (unsigned short)ui; } ui --; } DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"CARDwGetOFDMControlRate: 6M\n"); - return (WORD)RATE_24M; + return (unsigned short)RATE_24M; } @@ -2604,9 +1730,9 @@ WORD CARDwGetOFDMControlRate (void *pDeviceHandler, WORD wRateIdx) void CARDvSetRSPINF (void *pDeviceHandler, CARD_PHY_TYPE ePHYType) { PSDevice pDevice = (PSDevice) pDeviceHandler; - BYTE byServ = 0x00, bySignal = 0x00; //For CCK - WORD wLen = 0x0000; - BYTE byTxRate, byRsvTime; //For OFDM + unsigned char byServ = 0x00, bySignal = 0x00; //For CCK + unsigned short wLen = 0x0000; + unsigned char byTxRate, byRsvTime; //For OFDM //Set to Page1 MACvSelectPage1(pDevice->PortOffset); @@ -2731,7 +1857,7 @@ void vUpdateIFS (void *pDeviceHandler) //Set SIFS, DIFS, EIFS, SlotTime, CwMin PSDevice pDevice = (PSDevice) pDeviceHandler; - BYTE byMaxMin = 0; + unsigned char byMaxMin = 0; if (pDevice->byPacketType==PK_TYPE_11A) {//0000 0000 0000 0000,11a pDevice->uSlot = C_SLOT_SHORT; pDevice->uSIFS = C_SIFS_A; @@ -2768,27 +1894,27 @@ void vUpdateIFS (void *pDeviceHandler) pDevice->uEIFS = C_EIFS; if (pDevice->byRFType == RF_RFMD2959) { // bcs TX_PE will reserve 3 us - VNSvOutPortB(pDevice->PortOffset + MAC_REG_SIFS, (BYTE)(pDevice->uSIFS - 3)); - VNSvOutPortB(pDevice->PortOffset + MAC_REG_DIFS, (BYTE)(pDevice->uDIFS - 3)); + VNSvOutPortB(pDevice->PortOffset + MAC_REG_SIFS, (unsigned char)(pDevice->uSIFS - 3)); + VNSvOutPortB(pDevice->PortOffset + MAC_REG_DIFS, (unsigned char)(pDevice->uDIFS - 3)); } else { - VNSvOutPortB(pDevice->PortOffset + MAC_REG_SIFS, (BYTE)pDevice->uSIFS); - VNSvOutPortB(pDevice->PortOffset + MAC_REG_DIFS, (BYTE)pDevice->uDIFS); + VNSvOutPortB(pDevice->PortOffset + MAC_REG_SIFS, (unsigned char)pDevice->uSIFS); + VNSvOutPortB(pDevice->PortOffset + MAC_REG_DIFS, (unsigned char)pDevice->uDIFS); } - VNSvOutPortB(pDevice->PortOffset + MAC_REG_EIFS, (BYTE)pDevice->uEIFS); - VNSvOutPortB(pDevice->PortOffset + MAC_REG_SLOT, (BYTE)pDevice->uSlot); + VNSvOutPortB(pDevice->PortOffset + MAC_REG_EIFS, (unsigned char)pDevice->uEIFS); + VNSvOutPortB(pDevice->PortOffset + MAC_REG_SLOT, (unsigned char)pDevice->uSlot); byMaxMin |= 0xA0;//1010 1111,C_CWMAX = 1023 - VNSvOutPortB(pDevice->PortOffset + MAC_REG_CWMAXMIN0, (BYTE)byMaxMin); + VNSvOutPortB(pDevice->PortOffset + MAC_REG_CWMAXMIN0, (unsigned char)byMaxMin); } void CARDvUpdateBasicTopRate (void *pDeviceHandler) { PSDevice pDevice = (PSDevice) pDeviceHandler; - BYTE byTopOFDM = RATE_24M, byTopCCK = RATE_1M; - BYTE ii; + unsigned char byTopOFDM = RATE_24M, byTopCCK = RATE_1M; + unsigned char ii; //Determines the highest basic rate. for (ii = RATE_54M; ii >= RATE_6M; ii --) { - if ( (pDevice->wBasicRate) & ((WORD)(1<<ii)) ) { + if ( (pDevice->wBasicRate) & ((unsigned short)(1<<ii)) ) { byTopOFDM = ii; break; } @@ -2796,7 +1922,7 @@ void CARDvUpdateBasicTopRate (void *pDeviceHandler) pDevice->byTopOFDMBasicRate = byTopOFDM; for (ii = RATE_11M;; ii --) { - if ( (pDevice->wBasicRate) & ((WORD)(1<<ii)) ) { + if ( (pDevice->wBasicRate) & ((unsigned short)(1<<ii)) ) { byTopCCK = ii; break; } @@ -2817,40 +1943,40 @@ void CARDvUpdateBasicTopRate (void *pDeviceHandler) * Out: * none * - * Return Value: TRUE if succeeded; FALSE if failed. + * Return Value: true if succeeded; false if failed. * */ -BOOL CARDbAddBasicRate (void *pDeviceHandler, WORD wRateIdx) +bool CARDbAddBasicRate (void *pDeviceHandler, unsigned short wRateIdx) { PSDevice pDevice = (PSDevice) pDeviceHandler; - WORD wRate = (WORD)(1<<wRateIdx); + unsigned short wRate = (unsigned short)(1<<wRateIdx); pDevice->wBasicRate |= wRate; //Determines the highest basic rate. CARDvUpdateBasicTopRate((void *)pDevice); - return(TRUE); + return(true); } -BOOL CARDbIsOFDMinBasicRate (void *pDeviceHandler) +bool CARDbIsOFDMinBasicRate (void *pDeviceHandler) { PSDevice pDevice = (PSDevice) pDeviceHandler; int ii; for (ii = RATE_54M; ii >= RATE_6M; ii --) { - if ((pDevice->wBasicRate) & ((WORD)(1<<ii))) - return TRUE; + if ((pDevice->wBasicRate) & ((unsigned short)(1<<ii))) + return true; } - return FALSE; + return false; } -BYTE CARDbyGetPktType (void *pDeviceHandler) +unsigned char CARDbyGetPktType (void *pDeviceHandler) { PSDevice pDevice = (PSDevice) pDeviceHandler; if (pDevice->byBBType == BB_TYPE_11A || pDevice->byBBType == BB_TYPE_11B) { - return (BYTE)pDevice->byBBType; + return (unsigned char)pDevice->byBBType; } else if (CARDbIsOFDMinBasicRate((void *)pDevice)) { return PK_TYPE_11GA; @@ -2873,7 +1999,7 @@ BYTE CARDbyGetPktType (void *pDeviceHandler) * Return Value: none * */ -void CARDvSetLoopbackMode (DWORD_PTR dwIoBase, WORD wLoopbackMode) +void CARDvSetLoopbackMode (unsigned long dwIoBase, unsigned short wLoopbackMode) { switch(wLoopbackMode) { case CARD_LB_NONE: @@ -2881,7 +2007,7 @@ void CARDvSetLoopbackMode (DWORD_PTR dwIoBase, WORD wLoopbackMode) case CARD_LB_PHY: break; default: - ASSERT(FALSE); + ASSERT(false); break; } // set MAC loopback @@ -2902,15 +2028,15 @@ void CARDvSetLoopbackMode (DWORD_PTR dwIoBase, WORD wLoopbackMode) * Return Value: none * */ -BOOL CARDbSoftwareReset (void *pDeviceHandler) +bool CARDbSoftwareReset (void *pDeviceHandler) { PSDevice pDevice = (PSDevice) pDeviceHandler; // reset MAC if (!MACbSafeSoftwareReset(pDevice->PortOffset)) - return FALSE; + return false; - return TRUE; + return true; } @@ -2929,16 +2055,16 @@ BOOL CARDbSoftwareReset (void *pDeviceHandler) * Return Value: TSF Offset value * */ -QWORD CARDqGetTSFOffset (BYTE byRxRate, QWORD qwTSF1, QWORD qwTSF2) +QWORD CARDqGetTSFOffset (unsigned char byRxRate, QWORD qwTSF1, QWORD qwTSF2) { QWORD qwTSFOffset; - WORD wRxBcnTSFOffst= 0;; + unsigned short wRxBcnTSFOffst= 0;; HIDWORD(qwTSFOffset) = 0; LODWORD(qwTSFOffset) = 0; wRxBcnTSFOffst = cwRXBCNTSFOff[byRxRate%MAX_RATE]; - (qwTSF2).u.dwLowDword += (DWORD)(wRxBcnTSFOffst); - if ((qwTSF2).u.dwLowDword < (DWORD)(wRxBcnTSFOffst)) { + (qwTSF2).u.dwLowDword += (unsigned long)(wRxBcnTSFOffst); + if ((qwTSF2).u.dwLowDword < (unsigned long)(wRxBcnTSFOffst)) { (qwTSF2).u.dwHighDword++; } LODWORD(qwTSFOffset) = LODWORD(qwTSF1) - LODWORD(qwTSF2); @@ -2963,13 +2089,13 @@ QWORD CARDqGetTSFOffset (BYTE byRxRate, QWORD qwTSF1, QWORD qwTSF2) * Out: * qwCurrTSF - Current TSF counter * - * Return Value: TRUE if success; otherwise FALSE + * Return Value: true if success; otherwise false * */ -BOOL CARDbGetCurrentTSF (DWORD_PTR dwIoBase, PQWORD pqwCurrTSF) +bool CARDbGetCurrentTSF (unsigned long dwIoBase, PQWORD pqwCurrTSF) { - WORD ww; - BYTE byData; + unsigned short ww; + unsigned char byData; MACvRegBitsOn(dwIoBase, MAC_REG_TFTCTL, TFTCTL_TSFCNTRRD); for (ww = 0; ww < W_MAX_TIMEOUT; ww++) { @@ -2978,11 +2104,11 @@ BOOL CARDbGetCurrentTSF (DWORD_PTR dwIoBase, PQWORD pqwCurrTSF) break; } if (ww == W_MAX_TIMEOUT) - return(FALSE); + return(false); VNSvInPortD(dwIoBase + MAC_REG_TSFCNTR, &LODWORD(*pqwCurrTSF)); VNSvInPortD(dwIoBase + MAC_REG_TSFCNTR + 4, &HIDWORD(*pqwCurrTSF)); - return(TRUE); + return(true); } @@ -3000,12 +2126,12 @@ BOOL CARDbGetCurrentTSF (DWORD_PTR dwIoBase, PQWORD pqwCurrTSF) * Return Value: TSF value of next Beacon * */ -QWORD CARDqGetNextTBTT (QWORD qwTSF, WORD wBeaconInterval) +QWORD CARDqGetNextTBTT (QWORD qwTSF, unsigned short wBeaconInterval) { - UINT uLowNextTBTT; - UINT uHighRemain, uLowRemain; - UINT uBeaconInterval; + unsigned int uLowNextTBTT; + unsigned int uHighRemain, uLowRemain; + unsigned int uBeaconInterval; uBeaconInterval = wBeaconInterval * 1024; // Next TBTT = ((local_current_TSF / beacon_interval) + 1 ) * beacon_interval @@ -3044,7 +2170,7 @@ QWORD CARDqGetNextTBTT (QWORD qwTSF, WORD wBeaconInterval) * Return Value: none * */ -void CARDvSetFirstNextTBTT (DWORD_PTR dwIoBase, WORD wBeaconInterval) +void CARDvSetFirstNextTBTT (unsigned long dwIoBase, unsigned short wBeaconInterval) { QWORD qwNextTBTT; @@ -3077,7 +2203,7 @@ void CARDvSetFirstNextTBTT (DWORD_PTR dwIoBase, WORD wBeaconInterval) * Return Value: none * */ -void CARDvUpdateNextTBTT (DWORD_PTR dwIoBase, QWORD qwTSF, WORD wBeaconInterval) +void CARDvUpdateNextTBTT (unsigned long dwIoBase, QWORD qwTSF, unsigned short wBeaconInterval) { qwTSF = CARDqGetNextTBTT(qwTSF, wBeaconInterval); @@ -3085,7 +2211,8 @@ void CARDvUpdateNextTBTT (DWORD_PTR dwIoBase, QWORD qwTSF, WORD wBeaconInterval) VNSvOutPortD(dwIoBase + MAC_REG_NEXTTBTT, LODWORD(qwTSF)); VNSvOutPortD(dwIoBase + MAC_REG_NEXTTBTT + 4, HIDWORD(qwTSF)); MACvRegBitsOn(dwIoBase, MAC_REG_TFTCTL, TFTCTL_TBTTSYNCEN); - DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"Card:Update Next TBTT[%8xh:%8xh] \n",(UINT)HIDWORD(qwTSF), (UINT)LODWORD(qwTSF)); + DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"Card:Update Next TBTT[%8xh:%8xh] \n", + (unsigned int) HIDWORD(qwTSF), (unsigned int) LODWORD(qwTSF)); return; } diff --git a/drivers/staging/vt6655/card.h b/drivers/staging/vt6655/card.h index 76313462cf7..e0836e1d511 100644 --- a/drivers/staging/vt6655/card.h +++ b/drivers/staging/vt6655/card.h @@ -30,6 +30,7 @@ #define __CARD_H__ #include "ttype.h" +#include <linux/types.h> /*--------------------- Export Definitions -------------------------*/ // @@ -86,57 +87,55 @@ typedef enum _CARD_OP_MODE { /*--------------------- Export Functions --------------------------*/ -BOOL ChannelValid(UINT CountryCode, UINT ChannelIndex); void CARDvSetRSPINF(void *pDeviceHandler, CARD_PHY_TYPE ePHYType); void vUpdateIFS(void *pDeviceHandler); void CARDvUpdateBasicTopRate(void *pDeviceHandler); -BOOL CARDbAddBasicRate(void *pDeviceHandler, WORD wRateIdx); -BOOL CARDbIsOFDMinBasicRate(void *pDeviceHandler); -void CARDvSetLoopbackMode(DWORD_PTR dwIoBase, WORD wLoopbackMode); -BOOL CARDbSoftwareReset(void *pDeviceHandler); -void CARDvSetFirstNextTBTT(DWORD_PTR dwIoBase, WORD wBeaconInterval); -void CARDvUpdateNextTBTT(DWORD_PTR dwIoBase, QWORD qwTSF, WORD wBeaconInterval); -BOOL CARDbGetCurrentTSF(DWORD_PTR dwIoBase, PQWORD pqwCurrTSF); -QWORD CARDqGetNextTBTT(QWORD qwTSF, WORD wBeaconInterval); -QWORD CARDqGetTSFOffset(BYTE byRxRate, QWORD qwTSF1, QWORD qwTSF2); -BOOL CARDbSetTxPower(void *pDeviceHandler, ULONG ulTxPower); -BYTE CARDbyGetPktType(void *pDeviceHandler); +bool CARDbAddBasicRate(void *pDeviceHandler, unsigned short wRateIdx); +bool CARDbIsOFDMinBasicRate(void *pDeviceHandler); +void CARDvSetLoopbackMode(unsigned long dwIoBase, unsigned short wLoopbackMode); +bool CARDbSoftwareReset(void *pDeviceHandler); +void CARDvSetFirstNextTBTT(unsigned long dwIoBase, unsigned short wBeaconInterval); +void CARDvUpdateNextTBTT(unsigned long dwIoBase, QWORD qwTSF, unsigned short wBeaconInterval); +bool CARDbGetCurrentTSF(unsigned long dwIoBase, PQWORD pqwCurrTSF); +QWORD CARDqGetNextTBTT(QWORD qwTSF, unsigned short wBeaconInterval); +QWORD CARDqGetTSFOffset(unsigned char byRxRate, QWORD qwTSF1, QWORD qwTSF2); +bool CARDbSetTxPower(void *pDeviceHandler, unsigned long ulTxPower); +unsigned char CARDbyGetPktType(void *pDeviceHandler); void CARDvSafeResetTx(void *pDeviceHandler); void CARDvSafeResetRx(void *pDeviceHandler); //xxx -BOOL CARDbRadioPowerOff(void *pDeviceHandler); -BOOL CARDbRadioPowerOn(void *pDeviceHandler); -BOOL CARDbSetChannel(void *pDeviceHandler, UINT uConnectionChannel); -//BOOL CARDbSendPacket(void *pDeviceHandler, void *pPacket, CARD_PKT_TYPE ePktType, UINT uLength); -BOOL CARDbIsShortPreamble(void *pDeviceHandler); -BOOL CARDbIsShorSlotTime(void *pDeviceHandler); -BOOL CARDbSetPhyParameter(void *pDeviceHandler, CARD_PHY_TYPE ePHYType, WORD wCapInfo, BYTE byERPField, void *pvSupportRateIEs, void *pvExtSupportRateIEs); -BOOL CARDbUpdateTSF(void *pDeviceHandler, BYTE byRxRate, QWORD qwBSSTimestamp, QWORD qwLocalTSF); -BOOL CARDbStopTxPacket(void *pDeviceHandler, CARD_PKT_TYPE ePktType); -BOOL CARDbStartTxPacket(void *pDeviceHandler, CARD_PKT_TYPE ePktType); -BOOL CARDbSetBeaconPeriod(void *pDeviceHandler, WORD wBeaconInterval); -BOOL CARDbSetBSSID(void *pDeviceHandler, PBYTE pbyBSSID, CARD_OP_MODE eOPMode); - -BOOL +bool CARDbRadioPowerOff(void *pDeviceHandler); +bool CARDbRadioPowerOn(void *pDeviceHandler); +//bool CARDbSendPacket(void *pDeviceHandler, void *pPacket, CARD_PKT_TYPE ePktType, unsigned int uLength); +bool CARDbIsShortPreamble(void *pDeviceHandler); +bool CARDbIsShorSlotTime(void *pDeviceHandler); +bool CARDbSetPhyParameter(void *pDeviceHandler, CARD_PHY_TYPE ePHYType, unsigned short wCapInfo, unsigned char byERPField, void *pvSupportRateIEs, void *pvExtSupportRateIEs); +bool CARDbUpdateTSF(void *pDeviceHandler, unsigned char byRxRate, QWORD qwBSSTimestamp, QWORD qwLocalTSF); +bool CARDbStopTxPacket(void *pDeviceHandler, CARD_PKT_TYPE ePktType); +bool CARDbStartTxPacket(void *pDeviceHandler, CARD_PKT_TYPE ePktType); +bool CARDbSetBeaconPeriod(void *pDeviceHandler, unsigned short wBeaconInterval); +bool CARDbSetBSSID(void *pDeviceHandler, unsigned char *pbyBSSID, CARD_OP_MODE eOPMode); + +bool CARDbPowerDown( void *pDeviceHandler ); -BOOL CARDbSetTxDataRate( +bool CARDbSetTxDataRate( void *pDeviceHandler, - WORD wDataRate + unsigned short wDataRate ); -BOOL CARDbRemoveKey (void *pDeviceHandler, PBYTE pbyBSSID); +bool CARDbRemoveKey (void *pDeviceHandler, unsigned char *pbyBSSID); -BOOL +bool CARDbAdd_PMKID_Candidate ( void *pDeviceHandler, - PBYTE pbyBSSID, - BOOL bRSNCapExist, - WORD wRSNCap + unsigned char *pbyBSSID, + bool bRSNCapExist, + unsigned short wRSNCap ); void * @@ -144,112 +143,55 @@ CARDpGetCurrentAddress ( void *pDeviceHandler ); - -void CARDvInitChannelTable(void *pDeviceHandler); -BYTE CARDbyGetChannelMapping(void *pDeviceHandler, BYTE byChannelNumber, CARD_PHY_TYPE ePhyType); - -BOOL +bool CARDbStartMeasure ( void *pDeviceHandler, void *pvMeasureEIDs, - UINT uNumOfMeasureEIDs + unsigned int uNumOfMeasureEIDs ); -BOOL +bool CARDbChannelSwitch ( void *pDeviceHandler, - BYTE byMode, - BYTE byNewChannel, - BYTE byCount + unsigned char byMode, + unsigned char byNewChannel, + unsigned char byCount ); -BOOL +bool CARDbSetQuiet ( void *pDeviceHandler, - BOOL bResetQuiet, - BYTE byQuietCount, - BYTE byQuietPeriod, - WORD wQuietDuration, - WORD wQuietOffset + bool bResetQuiet, + unsigned char byQuietCount, + unsigned char byQuietPeriod, + unsigned short wQuietDuration, + unsigned short wQuietOffset ); -BOOL +bool CARDbStartQuiet ( void *pDeviceHandler ); void -CARDvSetCountryInfo ( - void *pDeviceHandler, - CARD_PHY_TYPE ePHYType, - void *pIE - ); - -void CARDvSetPowerConstraint ( void *pDeviceHandler, - BYTE byChannel, - I8 byPower + unsigned char byChannel, + char byPower ); void CARDvGetPowerCapability ( void *pDeviceHandler, - PBYTE pbyMinPower, - PBYTE pbyMaxPower + unsigned char *pbyMinPower, + unsigned char *pbyMaxPower ); -BYTE -CARDbySetSupportChannels ( - void *pDeviceHandler, - PBYTE pbyIEs - ); - -I8 +char CARDbyGetTransmitPower ( void *pDeviceHandler ); -BOOL -CARDbChannelGetList ( - UINT uCountryCodeIdx, - PBYTE pbyChannelTable - ); - -void -CARDvSetCountryIE( - void *pDeviceHandler, - void *pIE - ); - -BOOL -CARDbGetChannelMapInfo( - void *pDeviceHandler, - UINT uChannelIndex, - PBYTE pbyChannelNumber, - PBYTE pbyMap - ); - -void -CARDvSetChannelMapInfo( - void *pDeviceHandler, - UINT uChannelIndex, - BYTE byMap - ); - -void -CARDvClearChannelMapInfo( - void *pDeviceHandler - ); - -BYTE -CARDbyAutoChannelSelect( - void *pDeviceHandler, - CARD_PHY_TYPE ePHYType - ); - -BYTE CARDbyGetChannelNumber(void *pDeviceHandler, BYTE byChannelIndex); - #endif // __CARD_H__ diff --git a/drivers/staging/vt6655/channel.c b/drivers/staging/vt6655/channel.c new file mode 100644 index 00000000000..47c156bb70a --- /dev/null +++ b/drivers/staging/vt6655/channel.c @@ -0,0 +1,835 @@ +/* + * Copyright (c) 1996, 2003 VIA Networking Technologies, Inc. + * All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * File: channel.c + * + */ + +#include "baseband.h" +#include "country.h" +#include "channel.h" +#include "device.h" +#include "rf.h" + +/*--------------------- Static Definitions -------------------------*/ + +#define CARD_MAX_CHANNEL_TBL 56 + +//static int msglevel = MSG_LEVEL_DEBUG; +static int msglevel = MSG_LEVEL_INFO; + +/*--------------------- Static Variables --------------------------*/ + +static SChannelTblElement sChannelTbl[CARD_MAX_CHANNEL_TBL + 1] = +{ + {0, 0, false, 0}, + {1, 2412, true, 0}, + {2, 2417, true, 0}, + {3, 2422, true, 0}, + {4, 2427, true, 0}, + {5, 2432, true, 0}, + {6, 2437, true, 0}, + {7, 2442, true, 0}, + {8, 2447, true, 0}, + {9, 2452, true, 0}, + {10, 2457, true, 0}, + {11, 2462, true, 0}, + {12, 2467, true, 0}, + {13, 2472, true, 0}, + {14, 2484, true, 0}, + {183, 4915, true, 0}, + {184, 4920, true, 0}, + {185, 4925, true, 0}, + {187, 4935, true, 0}, + {188, 4940, true, 0}, + {189, 4945, true, 0}, + {192, 4960, true, 0}, + {196, 4980, true, 0}, + {7, 5035, true, 0}, + {8, 5040, true, 0}, + {9, 5045, true, 0}, + {11, 5055, true, 0}, + {12, 5060, true, 0}, + {16, 5080, true, 0}, + {34, 5170, true, 0}, + {36, 5180, true, 0}, + {38, 5190, true, 0}, + {40, 5200, true, 0}, + {42, 5210, true, 0}, + {44, 5220, true, 0}, + {46, 5230, true, 0}, + {48, 5240, true, 0}, + {52, 5260, true, 0}, + {56, 5280, true, 0}, + {60, 5300, true, 0}, + {64, 5320, true, 0}, + {100, 5500, true, 0}, + {104, 5520, true, 0}, + {108, 5540, true, 0}, + {112, 5560, true, 0}, + {116, 5580, true, 0}, + {120, 5600, true, 0}, + {124, 5620, true, 0}, + {128, 5640, true, 0}, + {132, 5660, true, 0}, + {136, 5680, true, 0}, + {140, 5700, true, 0}, + {149, 5745, true, 0}, + {153, 5765, true, 0}, + {157, 5785, true, 0}, + {161, 5805, true, 0}, + {165, 5825, true, 0} +}; + +/************************************************************************ + * The Radar regulation rules for each country + ************************************************************************/ +static struct +{ + unsigned char byChannelCountryCode; /* The country code */ + char chCountryCode[2]; + unsigned char bChannelIdxList[CB_MAX_CHANNEL]; /* Available channels Index */ + unsigned char byPower[CB_MAX_CHANNEL]; +} ChannelRuleTab[] = +{ +/************************************************************************ + * This table is based on Athero driver rules + ************************************************************************/ +/* Country Available channels, ended with 0 */ +/* 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 */ +{CCODE_FCC, {'U','S'}, { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1} + , { 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 17, 0, 17, 0, 17, 23, 23, 23, 23, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 30, 30, 30, 30, 30} }, +{CCODE_TELEC, {'J','P'}, { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0} + , { 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 0, 23, 0, 0, 23, 0, 23, 23, 0, 23, 0, 0, 23, 23, 23, 0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, 0, 0, 0, 30, 30, 30, 30, 30} }, +{CCODE_BULGARIA, {'B','G'}, { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0} + , { 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 23, 0, 23, 0, 23, 0, 23, 23, 23, 0, 0, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 0, 0, 0, 0, 0} }, +{CCODE_CANADA, {'C','A'}, { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1} + , { 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 17, 0, 17, 0, 17, 23, 23, 23, 23, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 30, 30, 30, 30, 30} }, +{CCODE_CHILE, {'C','L'}, { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1} + , { 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0} + , { 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20, 0, 20, 0, 20, 0, 20, 20, 20, 20, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0} }, +{CCODE_DENMARK, {'D','K'}, { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0} + , { 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20, 0, 20, 0, 20, 0, 20, 20, 20, 20, 20, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 0, 0, 0, 0, 0} }, +{CCODE_DOMINICAN_REPUBLIC, {'D','O'}, { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1} + , { 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 17, 0, 17, 0, 17, 23, 23, 23, 23, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 30, 30, 30, 30, 30} }, +{CCODE_ECUADOR, {'E','C'}, { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1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, 0, 0} }, +{CCODE_ESTONIA, {'E','E'}, { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0} + , { 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20, 0, 20, 0, 20, 0, 20, 20, 20, 20, 20, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 0, 0, 0, 0, 0} }, +{CCODE_FINLAND, {'F','I'}, { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0} + , { 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20, 0, 20, 0, 20, 0, 20, 20, 20, 20, 20, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 0, 0, 0, 0, 0} }, +{CCODE_FRANCE, {'F','R'}, { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0} + , { 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20, 0, 20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, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1} + , { 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 23, 0, 23, 0, 23, 0, 23, 23, 23, 23, 23, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 30, 30, 30, 30, 30} }, +{CCODE_HUNGARY, {'H','U'}, { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0} + , { 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 18, 0, 18, 0, 18, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0} }, +{CCODE_ICELAND, {'I','S'}, { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0} + , { 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20, 0, 20, 0, 20, 0, 20, 20, 20, 20, 20, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 0, 0, 0, 0, 0} }, +{CCODE_INDIA, {'I','N'}, { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,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 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0} + , { 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20, 0, 20, 0, 20, 0, 20, 20, 20, 20, 20, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 0, 0, 0, 0, 0} }, +{CCODE_PORTUGAL, {'P','T'}, { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0} + , { 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20, 0, 20, 0, 20, 0, 20, 20, 20, 20, 20, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 0, 0, 0, 0, 0} }, +{CCODE_PUERTO_RICO, {'P','R'}, { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1} + , { 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 17, 0, 17, 0, 17, 23, 23, 23, 23, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 30, 30, 30, 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, 23, 23, 23, 23, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 16, 0, 16, 0, 16, 16, 16, 16, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 16, 16, 16, 0} }, +{CCODE_SLOVENIA, {'S','I'}, { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0} + , { 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20, 0, 20, 0, 20, 0, 20, 20, 20, 20, 20, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 0, 0, 0, 0, 0} }, +{CCODE_SOUTH_AFRICA, {'Z','A'}, { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0} + , { 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20, 0, 20, 0, 20, 0, 20, 20, 20, 20, 20, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 0, 0, 0, 0, 0} }, +{CCODE_SOUTH_KOREA, {'K','R'}, { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0} + , { 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 23, 23, 23, 23, 0} }, +{CCODE_SPAIN, {'E','S'}, { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0} + , { 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 16, 0, 16, 0, 16, 16, 16, 16, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 16, 16, 16, 0} }, +{CCODE_SWEDEN, {'S','E'}, { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0} + , { 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20, 0, 20, 0, 20, 0, 20, 20, 20, 20, 20, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 0, 0, 0, 0, 0} }, +{CCODE_SWITZERLAND, {'C','H'}, { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 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, +{CCODE_JAPAN_W52_W53, {'J','J'}, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0} + , { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0} }, +{CCODE_MAX, {'U','N'}, { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1} + , { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0} } +/* 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 */ +}; + +/*--------------------- Export Functions --------------------------*/ + +/** + * is_channel_valid() - Is Country Channel Valid + * @ChanneIndex: defined as VT3253 MAC channel: + * 1 = 2.4G channel 1 + * 2 = 2.4G channel 2 + * ... + * 14 = 2.4G channel 14 + * 15 = 4.9G channel 183 + * 16 = 4.9G channel 184 + * ..... + * Output: true if the specified 5GHz band is allowed to be used, + * false otherwise. + * 4.9G => Ch 183, 184, 185, 187, 188, 189, 192, 196 (Value:15 ~ 22) + * + * 5G => Ch 7, 8, 9, 11, 12, 16, 34, 36, 38, 40, 42, 44, 46, 48, 52, 56, 60, 64, + * 100, 104, 108, 112, 116, 120, 124, 128, 132, 136, 140, 149, 153, 157, 161, 165 (Value 23 ~ 56) + */ + +bool is_channel_valid(unsigned int ChannelIndex) +{ + bool bValid; + + bValid = false; + /* + * If Channel Index is invalid, return invalid + */ + if ((ChannelIndex > CB_MAX_CHANNEL) || + (ChannelIndex == 0)) + { + bValid = false; + goto exit; + } + + bValid = sChannelTbl[ChannelIndex].bValid; + +exit: + return (bValid); + +} + +/** + * channel_get_list() - Get Available Channel List for a given country + * @CountryCode: The country code defined in country.h + * + * Output: + * pbyChannelTable: (QWORD *) correspondent bit mask + * of available channels + * 0x0000000000000001 means channel 1 is supported + * 0x0000000000000003 means channel 1,2 are supported + * 0x000000000000000F means channel 1,2,..15 are supported + */ + +bool channel_get_list(unsigned int uCountryCodeIdx, unsigned char *pbyChannelTable) +{ + if (uCountryCodeIdx >= CCODE_MAX) + return (false); + + memcpy(pbyChannelTable, ChannelRuleTab[uCountryCodeIdx].bChannelIdxList, CB_MAX_CHANNEL); + + return (true); +} + +void init_channel_table(void *pDeviceHandler) +{ + PSDevice pDevice = (PSDevice) pDeviceHandler; + bool bMultiBand = false; + unsigned int ii; + + for(ii = 1 ; ii<=CARD_MAX_CHANNEL_TBL ; ii++) { + sChannelTbl[ii].bValid = false; + } + + switch (pDevice->byRFType) { + case RF_RFMD2959 : + case RF_AIROHA : + case RF_AL2230S: + case RF_UW2451 : + case RF_VT3226 : + //printk("chester-false\n"); + bMultiBand = false; + break; + case RF_AIROHA7230 : + case RF_UW2452 : + case RF_NOTHING : + default : + bMultiBand = true; + break; + } + + if ((pDevice->dwDiagRefCount != 0) || (pDevice->b11hEnable == true)) { + if (bMultiBand == true) { + for(ii = 0 ; ii<CARD_MAX_CHANNEL_TBL ; ii++) { + sChannelTbl[ii+1].bValid = true; + pDevice->abyRegPwr[ii+1] = pDevice->abyOFDMDefaultPwr[ii+1]; + pDevice->abyLocalPwr[ii+1] = pDevice->abyOFDMDefaultPwr[ii+1]; + } + for(ii = 0 ; ii<CHANNEL_MAX_24G ; ii++) { + pDevice->abyRegPwr[ii+1] = pDevice->abyCCKDefaultPwr[ii+1]; + pDevice->abyLocalPwr[ii+1] = pDevice->abyCCKDefaultPwr[ii+1]; + } + } else { + for(ii = 0 ; ii<CHANNEL_MAX_24G ; ii++) { + //2008-8-4 <add> by chester + if (ChannelRuleTab[pDevice->byZoneType].bChannelIdxList[ii] != 0) { + sChannelTbl[ii+1].bValid = true; + pDevice->abyRegPwr[ii+1] = pDevice->abyCCKDefaultPwr[ii+1]; + pDevice->abyLocalPwr[ii+1] = pDevice->abyCCKDefaultPwr[ii+1]; + } + } + } + } else if (pDevice->byZoneType <= CCODE_MAX) { + if (bMultiBand == true) { + for(ii = 0 ; ii<CARD_MAX_CHANNEL_TBL ; ii++) { + if (ChannelRuleTab[pDevice->byZoneType].bChannelIdxList[ii] != 0) { + sChannelTbl[ii+1].bValid = true; + pDevice->abyRegPwr[ii+1] = ChannelRuleTab[pDevice->byZoneType].byPower[ii]; + pDevice->abyLocalPwr[ii+1] = ChannelRuleTab[pDevice->byZoneType].byPower[ii]; + } + } + } else { + for(ii = 0 ; ii<CHANNEL_MAX_24G ; ii++) { + if (ChannelRuleTab[pDevice->byZoneType].bChannelIdxList[ii] != 0) { + sChannelTbl[ii+1].bValid = true; + pDevice->abyRegPwr[ii+1] = ChannelRuleTab[pDevice->byZoneType].byPower[ii]; + pDevice->abyLocalPwr[ii+1] = ChannelRuleTab[pDevice->byZoneType].byPower[ii]; + } + } + } + } + + DBG_PRT(MSG_LEVEL_NOTICE, KERN_INFO"Zone=[%d][%c][%c]!!\n",pDevice->byZoneType,ChannelRuleTab[pDevice->byZoneType].chCountryCode[0],ChannelRuleTab[pDevice->byZoneType].chCountryCode[1]); + + for(ii = 0 ; ii<CARD_MAX_CHANNEL_TBL ; ii++) { + if (pDevice->abyRegPwr[ii+1] == 0) + pDevice->abyRegPwr[ii+1] = pDevice->abyOFDMDefaultPwr[ii+1]; + if (pDevice->abyLocalPwr[ii+1] == 0) + pDevice->abyLocalPwr[ii+1] = pDevice->abyOFDMDefaultPwr[ii+1]; + } +} + +unsigned char get_channel_mapping(void *pDeviceHandler, unsigned char byChannelNumber, CARD_PHY_TYPE ePhyType) +{ + unsigned int ii; + + if ((ePhyType == PHY_TYPE_11B) || (ePhyType == PHY_TYPE_11G)) + return (byChannelNumber); + + for(ii = (CB_MAX_CHANNEL_24G + 1); ii <= CB_MAX_CHANNEL; ) { + if (sChannelTbl[ii].byChannelNumber == byChannelNumber) + return ((unsigned char) ii); + ii++; + } + return 0; +} + +unsigned char get_channel_number(void *pDeviceHandler, unsigned char byChannelIndex) +{ + //PSDevice pDevice = (PSDevice) pDeviceHandler; + return(sChannelTbl[byChannelIndex].byChannelNumber); +} + +/** + * set_channel() - Set NIC media channel + * + * @pDeviceHandler: The adapter to be set + * @uConnectionChannel: Channel to be set + * + * Return Value: true if succeeded; false if failed. + * + */ +bool set_channel (void *pDeviceHandler, unsigned int uConnectionChannel) +{ + PSDevice pDevice = (PSDevice) pDeviceHandler; + bool bResult = true; + + + if (pDevice->byCurrentCh == uConnectionChannel) { + return bResult; + } + + if (sChannelTbl[uConnectionChannel].bValid == false) { + return (false); + } + + if ((uConnectionChannel > CB_MAX_CHANNEL_24G) && + (pDevice->eCurrentPHYType != PHY_TYPE_11A)) { + CARDbSetPhyParameter(pDevice, PHY_TYPE_11A, 0, 0, NULL, NULL); + } else if ((uConnectionChannel <= CB_MAX_CHANNEL_24G) && + (pDevice->eCurrentPHYType == PHY_TYPE_11A)) { + CARDbSetPhyParameter(pDevice, PHY_TYPE_11G, 0, 0, NULL, NULL); + } + // clear NAV + MACvRegBitsOn(pDevice->PortOffset, MAC_REG_MACCR, MACCR_CLRNAV); + + //{{ RobertYu: 20041202 + //// TX_PE will reserve 3 us for MAX2829 A mode only, it is for better TX throughput + + if ( pDevice->byRFType == RF_AIROHA7230 ) + { + RFbAL7230SelectChannelPostProcess(pDevice->PortOffset, pDevice->byCurrentCh, (unsigned char)uConnectionChannel); + } + //}} RobertYu + + + pDevice->byCurrentCh = (unsigned char)uConnectionChannel; + bResult &= RFbSelectChannel(pDevice->PortOffset, pDevice->byRFType, (unsigned char)uConnectionChannel); + + // Init Synthesizer Table + if (pDevice->bEnablePSMode == true) + RFvWriteWakeProgSyn(pDevice->PortOffset, pDevice->byRFType, uConnectionChannel); + + + //DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"CARDbSetMediaChannel: %d\n", (unsigned char)uConnectionChannel); + BBvSoftwareReset(pDevice->PortOffset); + + if (pDevice->byLocalID > REV_ID_VT3253_B1) { + // set HW default power register + MACvSelectPage1(pDevice->PortOffset); + RFbSetPower(pDevice, RATE_1M, pDevice->byCurrentCh); + VNSvOutPortB(pDevice->PortOffset + MAC_REG_PWRCCK, pDevice->byCurPwr); + RFbSetPower(pDevice, RATE_6M, pDevice->byCurrentCh); + VNSvOutPortB(pDevice->PortOffset + MAC_REG_PWROFDM, pDevice->byCurPwr); + MACvSelectPage0(pDevice->PortOffset); + } + + if (pDevice->eCurrentPHYType == PHY_TYPE_11B) { +#ifdef PLICE_DEBUG + //printk("Func:ChbSetChannel:call RFbSetPower:11B\n"); +#endif + RFbSetPower(pDevice, RATE_1M, pDevice->byCurrentCh); + } else { +#ifdef PLICE_DEBUG + //printk("Func:ChbSetChannel:call RFbSetPower\n"); +#endif + RFbSetPower(pDevice, RATE_6M, pDevice->byCurrentCh); + } + + return(bResult); +} + +/** + * set_country_info() - Set Channel Info of Country + * + * Return Value: none. + * + */ + +void set_country_info(void *pDeviceHandler, CARD_PHY_TYPE ePHYType, void *pIE) +{ + PSDevice pDevice = (PSDevice) pDeviceHandler; + unsigned int ii = 0; + unsigned int uu = 0; + unsigned int step = 0; + unsigned int uNumOfCountryInfo = 0; + unsigned char byCh = 0; + PWLAN_IE_COUNTRY pIE_Country = (PWLAN_IE_COUNTRY) pIE; + + + uNumOfCountryInfo = (pIE_Country->len - 3); + uNumOfCountryInfo /= 3; + + if (ePHYType == PHY_TYPE_11A) { + pDevice->bCountryInfo5G = true; + for(ii = CB_MAX_CHANNEL_24G + 1 ; ii <= CARD_MAX_CHANNEL_TBL ; ii++) { + sChannelTbl[ii].bValid = false; + } + step = 4; + } else { + pDevice->bCountryInfo24G = true; + for(ii = 1 ; ii <= CB_MAX_CHANNEL_24G ; ii++) { + sChannelTbl[ii].bValid = false; + } + step = 1; + } + pDevice->abyCountryCode[0] = pIE_Country->abyCountryString[0]; + pDevice->abyCountryCode[1] = pIE_Country->abyCountryString[1]; + pDevice->abyCountryCode[2] = pIE_Country->abyCountryString[2]; + + for(ii = 0 ; ii < uNumOfCountryInfo ; ii++) { + for(uu = 0 ; uu < pIE_Country->abyCountryInfo[ii*3+1] ; uu++) { + byCh = get_channel_mapping(pDevice, (unsigned char)(pIE_Country->abyCountryInfo[ii*3]+step*uu), ePHYType); + sChannelTbl[byCh].bValid = true; + pDevice->abyRegPwr[byCh] = pIE_Country->abyCountryInfo[ii*3+2]; + } + } +} + +/** + * + * set_support_channels() - Set Support Channels IE defined in 802.11h + * + * @hDeviceContext: device structure point + * + * Return Value: none. + * + */ + +unsigned char set_support_channels(void *pDeviceHandler, unsigned char *pbyIEs) +{ + PSDevice pDevice = (PSDevice) pDeviceHandler; + unsigned int ii; + unsigned char byCount; + PWLAN_IE_SUPP_CH pIE = (PWLAN_IE_SUPP_CH) pbyIEs; + unsigned char *pbyChTupple; + unsigned char byLen = 0; + + + pIE->byElementID = WLAN_EID_SUPP_CH; + pIE->len = 0; + pbyChTupple = pIE->abyChannelTuple; + byLen = 2; + // lower band + byCount = 0; + if (ChannelRuleTab[pDevice->byZoneType].bChannelIdxList[28] == true) { + for (ii = 28 ; ii < 36 ; ii+= 2) { + if (ChannelRuleTab[pDevice->byZoneType].bChannelIdxList[ii] == true) { + byCount++; + } + } + *pbyChTupple++ = 34; + *pbyChTupple++ = byCount; + byLen += 2; + } else if (ChannelRuleTab[pDevice->byZoneType].bChannelIdxList[29] == true) { + for (ii = 29 ; ii < 36 ; ii+= 2) { + if (ChannelRuleTab[pDevice->byZoneType].bChannelIdxList[ii] == true) { + byCount++; + } + } + *pbyChTupple++ = 36; + *pbyChTupple++ = byCount; + byLen += 2; + } + // middle band + byCount = 0; + if (ChannelRuleTab[pDevice->byZoneType].bChannelIdxList[36] == true) { + for (ii = 36 ; ii < 40 ; ii++) { + if (ChannelRuleTab[pDevice->byZoneType].bChannelIdxList[ii] == true) { + byCount++; + } + } + *pbyChTupple++ = 52; + *pbyChTupple++ = byCount; + byLen += 2; + } + // higher band + byCount = 0; + if (ChannelRuleTab[pDevice->byZoneType].bChannelIdxList[40] == true) { + for (ii = 40 ; ii < 51 ; ii++) { + if (ChannelRuleTab[pDevice->byZoneType].bChannelIdxList[ii] == true) { + byCount++; + } + } + *pbyChTupple++ = 100; + *pbyChTupple++ = byCount; + byLen += 2; + } else if (ChannelRuleTab[pDevice->byZoneType].bChannelIdxList[51] == true) { + for (ii = 51 ; ii < 56 ; ii++) { + if (ChannelRuleTab[pDevice->byZoneType].bChannelIdxList[ii] == true) { + byCount++; + } + } + *pbyChTupple++ = 149; + *pbyChTupple++ = byCount; + byLen += 2; + } + pIE->len += (byLen - 2); + return (byLen); +} + +void set_country_IE(void *pDeviceHandler, void *pIE) +{ + PSDevice pDevice = (PSDevice) pDeviceHandler; + unsigned int ii; + PWLAN_IE_COUNTRY pIECountry = (PWLAN_IE_COUNTRY) pIE; + + pIECountry->byElementID = WLAN_EID_COUNTRY; + pIECountry->len = 0; + pIECountry->abyCountryString[0] = ChannelRuleTab[pDevice->byZoneType].chCountryCode[0]; + pIECountry->abyCountryString[1] = ChannelRuleTab[pDevice->byZoneType].chCountryCode[1]; + pIECountry->abyCountryString[2] = ' '; + for (ii = CB_MAX_CHANNEL_24G; ii < CB_MAX_CHANNEL; ii++ ) { + if (ChannelRuleTab[pDevice->byZoneType].bChannelIdxList[ii] != 0) { + pIECountry->abyCountryInfo[pIECountry->len++] = sChannelTbl[ii+1].byChannelNumber; + pIECountry->abyCountryInfo[pIECountry->len++] = 1; + pIECountry->abyCountryInfo[pIECountry->len++] = ChannelRuleTab[pDevice->byZoneType].byPower[ii]; + } + } + pIECountry->len += 3; +} + +bool get_channel_map_info(void *pDeviceHandler, unsigned int uChannelIndex, + unsigned char *pbyChannelNumber, unsigned char *pbyMap) +{ + + if (uChannelIndex > CB_MAX_CHANNEL) { + return false; + } + *pbyChannelNumber = sChannelTbl[uChannelIndex].byChannelNumber; + *pbyMap = sChannelTbl[uChannelIndex].byMAP; + return sChannelTbl[uChannelIndex].bValid; +} + +void set_channel_map_info(void *pDeviceHandler, unsigned int uChannelIndex, + unsigned char byMap) +{ + + if (uChannelIndex > CB_MAX_CHANNEL) { + return; + } + sChannelTbl[uChannelIndex].byMAP |= byMap; +} + +void clear_channel_map_info(void *pDeviceHandler) +{ + unsigned int ii = 0; + + for (ii = 1; ii <= CB_MAX_CHANNEL; ii++) { + sChannelTbl[ii].byMAP = 0; + } +} + +unsigned char auto_channel_select(void *pDeviceHandler, CARD_PHY_TYPE ePHYType) +{ + unsigned int ii = 0; + unsigned char byOptionChannel = 0; + int aiWeight[CB_MAX_CHANNEL_24G+1] = {-1000,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; + + if (ePHYType == PHY_TYPE_11A) { + for(ii = CB_MAX_CHANNEL_24G + 1 ; ii <= CB_MAX_CHANNEL ; ii++) { + if (sChannelTbl[ii].bValid == true) { + if (byOptionChannel == 0) { + byOptionChannel = (unsigned char) ii; + } + if (sChannelTbl[ii].byMAP == 0) { + return ((unsigned char) ii); + } else if ( !(sChannelTbl[ii].byMAP & 0x08)) { + byOptionChannel = (unsigned char) ii; + } + } + } + } else { + byOptionChannel = 0; + for(ii = 1 ; ii <= CB_MAX_CHANNEL_24G ; ii++) { + if (sChannelTbl[ii].bValid == true) { + if (sChannelTbl[ii].byMAP == 0) { + aiWeight[ii] += 100; + } else if (sChannelTbl[ii].byMAP & 0x01) { + if (ii > 3) { + aiWeight[ii-3] -= 10; + } + if (ii > 2) { + aiWeight[ii-2] -= 20; + } + if (ii > 1) { + aiWeight[ii-1] -= 40; + } + aiWeight[ii] -= 80; + if (ii < CB_MAX_CHANNEL_24G) { + aiWeight[ii+1] -= 40; + } + if (ii < (CB_MAX_CHANNEL_24G - 1)) { + aiWeight[ii+2] -= 20; + } + if (ii < (CB_MAX_CHANNEL_24G - 2)) { + aiWeight[ii+3] -= 10; + } + } + } + } + for(ii = 1 ; ii <= CB_MAX_CHANNEL_24G ; ii++) { + if ((sChannelTbl[ii].bValid == true) && + (aiWeight[ii] > aiWeight[byOptionChannel])) { + byOptionChannel = (unsigned char) ii; + } + } + } + return (byOptionChannel); +} diff --git a/drivers/staging/vt6655/channel.h b/drivers/staging/vt6655/channel.h new file mode 100644 index 00000000000..7038f0d3bde --- /dev/null +++ b/drivers/staging/vt6655/channel.h @@ -0,0 +1,58 @@ +/* + * Copyright (c) 1996, 2003 VIA Networking Technologies, Inc. + * All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * File: channel.h + * + */ + +#ifndef _CHANNEL_H_ +#define _CHANNEL_H_ + +#include "ttype.h" +#include "card.h" + +/*--------------------- Export Classes ----------------------------*/ + +typedef struct tagSChannelTblElement { + unsigned char byChannelNumber; + unsigned int uFrequency; + bool bValid; + unsigned char byMAP; +}SChannelTblElement, *PSChannelTblElement; + + +/*--------------------- Export Functions --------------------------*/ + +bool is_channel_valid(unsigned int CountryCode); +void init_channel_table(void *pDeviceHandler); +unsigned char get_channel_mapping(void *pDeviceHandler, unsigned char byChannelNumber, CARD_PHY_TYPE ePhyType); +bool channel_get_list(unsigned int uCountryCodeIdx, unsigned char *pbyChannelTable); +unsigned char get_channel_number(void *pDeviceHandler, unsigned char byChannelIndex); +bool set_channel(void *pDeviceHandler, unsigned int uConnectionChannel); +void set_country_info(void *pDeviceHandler, CARD_PHY_TYPE ePHYType, void *pIE); +unsigned char set_support_channels(void *pDeviceHandler, unsigned char *pbyIEs); +void set_country_IE(void *pDeviceHandler, void *pIE); +bool get_channel_map_info(void *pDeviceHandler, unsigned int uChannelIndex, + unsigned char *pbyChannelNumber, unsigned char *pbyMap); +void set_channel_map_info(void *pDeviceHandler, unsigned int uChannelIndex, + unsigned char byMap); +void clear_channel_map_info(void *pDeviceHandler); +unsigned char auto_channel_select(void *pDeviceHandler, CARD_PHY_TYPE ePHYType); + + +#endif /* _CHANNEL_H_ */ diff --git a/drivers/staging/vt6655/country.h b/drivers/staging/vt6655/country.h index 2005d276868..05fda410420 100644 --- a/drivers/staging/vt6655/country.h +++ b/drivers/staging/vt6655/country.h @@ -159,19 +159,4 @@ typedef enum _COUNTRY_CODE { CCODE_MAX } COUNTRY_CODE; -typedef struct tagSCountryTable -{ - BYTE byChannelCountryCode; /* The country code */ - CHAR chCountryCode[2]; - BYTE bChannelIdxList[CB_MAX_CHANNEL]; /* Available channels Index */ - BYTE byPower[CB_MAX_CHANNEL]; -} SCountryTable, *PSCountryTable; - -/*--------------------- Export Classes ----------------------------*/ - -/*--------------------- Export Variables --------------------------*/ -extern SCountryTable ChannelRuleTab[CCODE_MAX+1]; - -/*--------------------- Export Functions --------------------------*/ - #endif /* __COUNTRY_H__ */ diff --git a/drivers/staging/vt6655/datarate.c b/drivers/staging/vt6655/datarate.c index 38b09a7fb53..efbb8f45f72 100644 --- a/drivers/staging/vt6655/datarate.c +++ b/drivers/staging/vt6655/datarate.c @@ -51,11 +51,11 @@ /*--------------------- Static Classes ----------------------------*/ - extern WORD TxRate_iwconfig; //2008-5-8 <add> by chester + extern unsigned short TxRate_iwconfig; //2008-5-8 <add> by chester /*--------------------- Static Variables --------------------------*/ //static int msglevel =MSG_LEVEL_DEBUG; static int msglevel =MSG_LEVEL_INFO; -const BYTE acbyIERate[MAX_RATE] = +const unsigned char acbyIERate[MAX_RATE] = {0x02, 0x04, 0x0B, 0x16, 0x0C, 0x12, 0x18, 0x24, 0x30, 0x48, 0x60, 0x6C}; #define AUTORATE_TXOK_CNT 0x0400 @@ -75,7 +75,7 @@ s_vResetCounter ( PKnownNodeDB psNodeDBTable ) { - BYTE ii; + unsigned char ii; // clear statistic counter for auto_rate for(ii=0;ii<=MAX_RATE;ii++) { @@ -97,19 +97,19 @@ s_vResetCounter ( * * Parameters: * In: - * BYTE - Rate value in SuppRates IE or ExtSuppRates IE + * unsigned char - Rate value in SuppRates IE or ExtSuppRates IE * Out: * none * * Return Value: RateIdx * -*/ -BYTE +unsigned char DATARATEbyGetRateIdx ( - BYTE byRate + unsigned char byRate ) { - BYTE ii; + unsigned char ii; //Erase basicRate flag. byRate = byRate & 0x7F;//0111 1111 @@ -151,19 +151,19 @@ DATARATEbyGetRateIdx ( * * Parameters: * In: - * BYTE - Rate value in SuppRates IE or ExtSuppRates IE + * unsigned char - Rate value in SuppRates IE or ExtSuppRates IE * Out: * none * * Return Value: RateIdx * -*/ -WORD +unsigned short wGetRateIdx( - BYTE byRate + unsigned char byRate ) { - WORD ii; + unsigned short ii; //Erase basicRate flag. byRate = byRate & 0x7F;//0111 1111 @@ -199,20 +199,20 @@ RATEvParseMaxRate ( void *pDeviceHandler, PWLAN_IE_SUPP_RATES pItemRates, PWLAN_IE_SUPP_RATES pItemExtRates, - BOOL bUpdateBasicRate, - PWORD pwMaxBasicRate, - PWORD pwMaxSuppRate, - PWORD pwSuppRate, - PBYTE pbyTopCCKRate, - PBYTE pbyTopOFDMRate + bool bUpdateBasicRate, + unsigned short *pwMaxBasicRate, + unsigned short *pwMaxSuppRate, + unsigned short *pwSuppRate, + unsigned char *pbyTopCCKRate, + unsigned char *pbyTopOFDMRate ) { PSDevice pDevice = (PSDevice) pDeviceHandler; -UINT ii; -BYTE byHighSuppRate = 0; -BYTE byRate = 0; -WORD wOldBasicRate = pDevice->wBasicRate; -UINT uRateLen; +unsigned int ii; +unsigned char byHighSuppRate = 0; +unsigned char byRate = 0; +unsigned short wOldBasicRate = pDevice->wBasicRate; +unsigned int uRateLen; if (pItemRates == NULL) @@ -231,14 +231,14 @@ UINT uRateLen; } for (ii = 0; ii < uRateLen; ii++) { - byRate = (BYTE)(pItemRates->abyRates[ii]); + byRate = (unsigned char)(pItemRates->abyRates[ii]); if (WLAN_MGMT_IS_BASICRATE(byRate) && - (bUpdateBasicRate == TRUE)) { + (bUpdateBasicRate == true)) { // Add to basic rate set, update pDevice->byTopCCKBasicRate and pDevice->byTopOFDMBasicRate CARDbAddBasicRate((void *)pDevice, wGetRateIdx(byRate)); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"ParseMaxRate AddBasicRate: %d\n", wGetRateIdx(byRate)); } - byRate = (BYTE)(pItemRates->abyRates[ii]&0x7F); + byRate = (unsigned char)(pItemRates->abyRates[ii]&0x7F); if (byHighSuppRate == 0) byHighSuppRate = byRate; if (byRate > byHighSuppRate) @@ -248,20 +248,20 @@ UINT uRateLen; if ((pItemExtRates != NULL) && (pItemExtRates->byElementID == WLAN_EID_EXTSUPP_RATES) && (pDevice->eCurrentPHYType != PHY_TYPE_11B)) { - UINT uExtRateLen = pItemExtRates->len; + unsigned int uExtRateLen = pItemExtRates->len; if (uExtRateLen > WLAN_RATES_MAXLEN) uExtRateLen = WLAN_RATES_MAXLEN; for (ii = 0; ii < uExtRateLen ; ii++) { - byRate = (BYTE)(pItemExtRates->abyRates[ii]); + byRate = (unsigned char)(pItemExtRates->abyRates[ii]); // select highest basic rate if (WLAN_MGMT_IS_BASICRATE(pItemExtRates->abyRates[ii])) { // Add to basic rate set, update pDevice->byTopCCKBasicRate and pDevice->byTopOFDMBasicRate CARDbAddBasicRate((void *)pDevice, wGetRateIdx(byRate)); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"ParseMaxRate AddBasicRate: %d\n", wGetRateIdx(byRate)); } - byRate = (BYTE)(pItemExtRates->abyRates[ii]&0x7F); + byRate = (unsigned char)(pItemExtRates->abyRates[ii]&0x7F); if (byHighSuppRate == 0) byHighSuppRate = byRate; if (byRate > byHighSuppRate) @@ -314,14 +314,14 @@ RATEvTxRateFallBack ( ) { PSDevice pDevice = (PSDevice) pDeviceHandler; -WORD wIdxDownRate = 0; -UINT ii; -//DWORD dwRateTable[MAX_RATE] = {1, 2, 5, 11, 6, 9, 12, 18, 24, 36, 48, 54}; -BOOL bAutoRate[MAX_RATE] = {TRUE,TRUE,TRUE,TRUE,FALSE,FALSE,TRUE,TRUE,TRUE,TRUE,TRUE,TRUE}; -DWORD dwThroughputTbl[MAX_RATE] = {10, 20, 55, 110, 60, 90, 120, 180, 240, 360, 480, 540}; -DWORD dwThroughput = 0; -WORD wIdxUpRate = 0; -DWORD dwTxDiff = 0; +unsigned short wIdxDownRate = 0; +unsigned int ii; +//unsigned long dwRateTable[MAX_RATE] = {1, 2, 5, 11, 6, 9, 12, 18, 24, 36, 48, 54}; +bool bAutoRate[MAX_RATE] = {true,true,true,true,false,false,true,true,true,true,true,true}; + unsigned long dwThroughputTbl[MAX_RATE] = {10, 20, 55, 110, 60, 90, 120, 180, 240, 360, 480, 540}; + unsigned long dwThroughput = 0; + unsigned short wIdxUpRate = 0; + unsigned long dwTxDiff = 0; if (pDevice->pMgmt->eScanState != WMAC_NO_SCANNING) { // Don't do Fallback when scanning Channel @@ -346,11 +346,11 @@ DWORD dwTxDiff = 0; for(ii=0;ii<MAX_RATE;ii++) { if (psNodeDBTable->wSuppRate & (0x0001<<ii)) { - if (bAutoRate[ii] == TRUE) { - wIdxUpRate = (WORD) ii; + if (bAutoRate[ii] == true) { + wIdxUpRate = (unsigned short) ii; } } else { - bAutoRate[ii] = FALSE; + bAutoRate[ii] = false; } } @@ -372,9 +372,9 @@ DWORD dwTxDiff = 0; for(ii = psNodeDBTable->wTxDataRate; ii > 0;) { ii--; if ( (dwThroughputTbl[ii] > dwThroughput) && - (bAutoRate[ii]==TRUE) ) { + (bAutoRate[ii]==true) ) { dwThroughput = dwThroughputTbl[ii]; - wIdxDownRate = (WORD) ii; + wIdxDownRate = (unsigned short) ii; } } psNodeDBTable->wTxDataRate = wIdxDownRate; @@ -409,14 +409,14 @@ TxRate_iwconfig=psNodeDBTable->wTxDataRate; * Return Value: None * -*/ -BYTE +unsigned char RATEuSetIE ( PWLAN_IE_SUPP_RATES pSrcRates, PWLAN_IE_SUPP_RATES pDstRates, - UINT uRateLen + unsigned int uRateLen ) { - UINT ii, uu, uRateCnt = 0; + unsigned int ii, uu, uRateCnt = 0; if ((pSrcRates == NULL) || (pDstRates == NULL)) return 0; @@ -432,6 +432,6 @@ RATEuSetIE ( } } } - return (BYTE)uRateCnt; + return (unsigned char)uRateCnt; } diff --git a/drivers/staging/vt6655/datarate.h b/drivers/staging/vt6655/datarate.h index b8ca792e9c6..4f8ea0b0532 100644 --- a/drivers/staging/vt6655/datarate.h +++ b/drivers/staging/vt6655/datarate.h @@ -59,12 +59,12 @@ RATEvParseMaxRate( void *pDeviceHandler, PWLAN_IE_SUPP_RATES pItemRates, PWLAN_IE_SUPP_RATES pItemExtRates, - BOOL bUpdateBasicRate, - PWORD pwMaxBasicRate, - PWORD pwMaxSuppRate, - PWORD pwSuppRate, - PBYTE pbyTopCCKRate, - PBYTE pbyTopOFDMRate + bool bUpdateBasicRate, + unsigned short *pwMaxBasicRate, + unsigned short *pwMaxSuppRate, + unsigned short *pwSuppRate, + unsigned char *pbyTopCCKRate, + unsigned char *pbyTopOFDMRate ); void @@ -73,22 +73,22 @@ RATEvTxRateFallBack( PKnownNodeDB psNodeDBTable ); -BYTE +unsigned char RATEuSetIE( PWLAN_IE_SUPP_RATES pSrcRates, PWLAN_IE_SUPP_RATES pDstRates, - UINT uRateLen + unsigned int uRateLen ); -WORD +unsigned short wGetRateIdx( - BYTE byRate + unsigned char byRate ); -BYTE +unsigned char DATARATEbyGetRateIdx( - BYTE byRate + unsigned char byRate ); diff --git a/drivers/staging/vt6655/desc.h b/drivers/staging/vt6655/desc.h index cedb1e7df4f..138897a7932 100644 --- a/drivers/staging/vt6655/desc.h +++ b/drivers/staging/vt6655/desc.h @@ -244,10 +244,10 @@ static inline PDEVICE_RD_INFO alloc_rd_info(void) { /* typedef struct tagRDES0 { - WORD wResCount; - WORD wf1Owner ; -// WORD f15Reserved : 15; -// WORD f1Owner : 1; + unsigned short wResCount; + unsigned short wf1Owner ; +// unsigned short f15Reserved : 15; +// unsigned short f1Owner : 1; } __attribute__ ((__packed__)) SRDES0; */ @@ -255,13 +255,13 @@ SRDES0; #ifdef __BIG_ENDIAN typedef struct tagRDES0 { - volatile WORD wResCount; + volatile unsigned short wResCount; union { - volatile U16 f15Reserved; + volatile u16 f15Reserved; struct { - volatile U8 f8Reserved1; - volatile U8 f1Owner:1; - volatile U8 f7Reserved:7; + volatile u8 f8Reserved1; + volatile u8 f1Owner:1; + volatile u8 f7Reserved:7; } __attribute__ ((__packed__)); } __attribute__ ((__packed__)); } __attribute__ ((__packed__)) @@ -270,9 +270,9 @@ SRDES0, *PSRDES0; #else typedef struct tagRDES0 { - WORD wResCount; - WORD f15Reserved : 15; - WORD f1Owner : 1; + unsigned short wResCount; + unsigned short f15Reserved : 15; + unsigned short f1Owner : 1; } __attribute__ ((__packed__)) SRDES0; @@ -280,8 +280,8 @@ SRDES0; #endif typedef struct tagRDES1 { - WORD wReqCount; - WORD wReserved; + unsigned short wReqCount; + unsigned short wReserved; } __attribute__ ((__packed__)) SRDES1; @@ -291,11 +291,11 @@ SRDES1; typedef struct tagSRxDesc { volatile SRDES0 m_rd0RD0; volatile SRDES1 m_rd1RD1; - volatile U32 buff_addr; - volatile U32 next_desc; + volatile u32 buff_addr; + volatile u32 next_desc; struct tagSRxDesc *next;//4 bytes volatile PDEVICE_RD_INFO pRDInfo;//4 bytes - volatile U32 Reserved[2];//8 bytes + volatile u32 Reserved[2];//8 bytes } __attribute__ ((__packed__)) SRxDesc, *PSRxDesc; typedef const SRxDesc *PCSRxDesc; @@ -304,24 +304,24 @@ typedef const SRxDesc *PCSRxDesc; /* typedef struct tagTDES0 { - volatile BYTE byTSR0; - volatile BYTE byTSR1; - volatile WORD wOwner_Txtime; -// volatile WORD f15Txtime : 15; -// volatile WORD f1Owner:1; + volatile unsigned char byTSR0; + volatile unsigned char byTSR1; + volatile unsigned short wOwner_Txtime; +// volatile unsigned short f15Txtime : 15; +// volatile unsigned short f1Owner:1; } __attribute__ ((__packed__)) STDES0; */ typedef struct tagTDES0 { - volatile BYTE byTSR0; - volatile BYTE byTSR1; + volatile unsigned char byTSR0; + volatile unsigned char byTSR1; union { - volatile U16 f15Txtime; + volatile u16 f15Txtime; struct { - volatile U8 f8Reserved1; - volatile U8 f1Owner:1; - volatile U8 f7Reserved:7; + volatile u8 f8Reserved1; + volatile u8 f1Owner:1; + volatile u8 f7Reserved:7; } __attribute__ ((__packed__)); } __attribute__ ((__packed__)); } __attribute__ ((__packed__)) @@ -330,10 +330,10 @@ STDES0, PSTDES0; #else typedef struct tagTDES0 { - volatile BYTE byTSR0; - volatile BYTE byTSR1; - volatile WORD f15Txtime : 15; - volatile WORD f1Owner:1; + volatile unsigned char byTSR0; + volatile unsigned char byTSR1; + volatile unsigned short f15Txtime : 15; + volatile unsigned short f1Owner:1; } __attribute__ ((__packed__)) STDES0; @@ -341,22 +341,22 @@ STDES0; typedef struct tagTDES1 { - volatile WORD wReqCount; - volatile BYTE byTCR; - volatile BYTE byReserved; + volatile unsigned short wReqCount; + volatile unsigned char byTCR; + volatile unsigned char byReserved; } __attribute__ ((__packed__)) STDES1; typedef struct tagDEVICE_TD_INFO{ struct sk_buff* skb; - PBYTE buf; + unsigned char *buf; dma_addr_t skb_dma; dma_addr_t buf_dma; dma_addr_t curr_desc; - DWORD dwReqCount; - DWORD dwHeaderLength; - BYTE byFlags; + unsigned long dwReqCount; + unsigned long dwHeaderLength; + unsigned char byFlags; } DEVICE_TD_INFO, *PDEVICE_TD_INFO; /* @@ -378,11 +378,11 @@ static inline PDEVICE_TD_INFO alloc_td_info(void) { typedef struct tagSTxDesc { volatile STDES0 m_td0TD0; volatile STDES1 m_td1TD1; - volatile U32 buff_addr; - volatile U32 next_desc; + volatile u32 buff_addr; + volatile u32 next_desc; struct tagSTxDesc* next; //4 bytes volatile PDEVICE_TD_INFO pTDInfo;//4 bytes - volatile U32 Reserved[2];//8 bytes + volatile u32 Reserved[2];//8 bytes } __attribute__ ((__packed__)) STxDesc, *PSTxDesc; typedef const STxDesc *PCSTxDesc; @@ -391,13 +391,13 @@ typedef const STxDesc *PCSTxDesc; typedef struct tagSTxSyncDesc { volatile STDES0 m_td0TD0; volatile STDES1 m_td1TD1; - volatile DWORD buff_addr; // pointer to logical buffer - volatile DWORD next_desc; // pointer to next logical descriptor - volatile WORD m_wFIFOCtl; - volatile WORD m_wTimeStamp; + volatile u32 buff_addr; // pointer to logical buffer + volatile u32 next_desc; // pointer to next logical descriptor + volatile unsigned short m_wFIFOCtl; + volatile unsigned short m_wTimeStamp; struct tagSTxSyncDesc* next; //4 bytes volatile PDEVICE_TD_INFO pTDInfo;//4 bytes - volatile DWORD m_dwReserved2; + volatile u32 m_dwReserved2; } __attribute__ ((__packed__)) STxSyncDesc, *PSTxSyncDesc; typedef const STxSyncDesc *PCSTxSyncDesc; @@ -407,35 +407,35 @@ typedef const STxSyncDesc *PCSTxSyncDesc; // RsvTime buffer header // typedef struct tagSRrvTime_gRTS { - WORD wRTSTxRrvTime_ba; - WORD wRTSTxRrvTime_aa; - WORD wRTSTxRrvTime_bb; - WORD wReserved; - WORD wTxRrvTime_b; - WORD wTxRrvTime_a; + unsigned short wRTSTxRrvTime_ba; + unsigned short wRTSTxRrvTime_aa; + unsigned short wRTSTxRrvTime_bb; + unsigned short wReserved; + unsigned short wTxRrvTime_b; + unsigned short wTxRrvTime_a; }__attribute__ ((__packed__)) SRrvTime_gRTS, *PSRrvTime_gRTS; typedef const SRrvTime_gRTS *PCSRrvTime_gRTS; typedef struct tagSRrvTime_gCTS { - WORD wCTSTxRrvTime_ba; - WORD wReserved; - WORD wTxRrvTime_b; - WORD wTxRrvTime_a; + unsigned short wCTSTxRrvTime_ba; + unsigned short wReserved; + unsigned short wTxRrvTime_b; + unsigned short wTxRrvTime_a; }__attribute__ ((__packed__)) SRrvTime_gCTS, *PSRrvTime_gCTS; typedef const SRrvTime_gCTS *PCSRrvTime_gCTS; typedef struct tagSRrvTime_ab { - WORD wRTSTxRrvTime; - WORD wTxRrvTime; + unsigned short wRTSTxRrvTime; + unsigned short wTxRrvTime; }__attribute__ ((__packed__)) SRrvTime_ab, *PSRrvTime_ab; typedef const SRrvTime_ab *PCSRrvTime_ab; typedef struct tagSRrvTime_atim { - WORD wCTSTxRrvTime_ba; - WORD wTxRrvTime_a; + unsigned short wCTSTxRrvTime_ba; + unsigned short wTxRrvTime_a; }__attribute__ ((__packed__)) SRrvTime_atim, *PSRrvTime_atim; typedef const SRrvTime_atim *PCSRrvTime_atim; @@ -444,25 +444,25 @@ typedef const SRrvTime_atim *PCSRrvTime_atim; // RTS buffer header // typedef struct tagSRTSData { - WORD wFrameControl; - WORD wDurationID; - BYTE abyRA[ETH_ALEN]; - BYTE abyTA[ETH_ALEN]; + unsigned short wFrameControl; + unsigned short wDurationID; + unsigned char abyRA[ETH_ALEN]; + unsigned char abyTA[ETH_ALEN]; }__attribute__ ((__packed__)) SRTSData, *PSRTSData; typedef const SRTSData *PCSRTSData; typedef struct tagSRTS_g { - BYTE bySignalField_b; - BYTE byServiceField_b; - WORD wTransmitLength_b; - BYTE bySignalField_a; - BYTE byServiceField_a; - WORD wTransmitLength_a; - WORD wDuration_ba; - WORD wDuration_aa; - WORD wDuration_bb; - WORD wReserved; + unsigned char bySignalField_b; + unsigned char byServiceField_b; + unsigned short wTransmitLength_b; + unsigned char bySignalField_a; + unsigned char byServiceField_a; + unsigned short wTransmitLength_a; + unsigned short wDuration_ba; + unsigned short wDuration_aa; + unsigned short wDuration_bb; + unsigned short wReserved; SRTSData Data; }__attribute__ ((__packed__)) SRTS_g, *PSRTS_g; @@ -470,20 +470,20 @@ typedef const SRTS_g *PCSRTS_g; typedef struct tagSRTS_g_FB { - BYTE bySignalField_b; - BYTE byServiceField_b; - WORD wTransmitLength_b; - BYTE bySignalField_a; - BYTE byServiceField_a; - WORD wTransmitLength_a; - WORD wDuration_ba; - WORD wDuration_aa; - WORD wDuration_bb; - WORD wReserved; - WORD wRTSDuration_ba_f0; - WORD wRTSDuration_aa_f0; - WORD wRTSDuration_ba_f1; - WORD wRTSDuration_aa_f1; + unsigned char bySignalField_b; + unsigned char byServiceField_b; + unsigned short wTransmitLength_b; + unsigned char bySignalField_a; + unsigned char byServiceField_a; + unsigned short wTransmitLength_a; + unsigned short wDuration_ba; + unsigned short wDuration_aa; + unsigned short wDuration_bb; + unsigned short wReserved; + unsigned short wRTSDuration_ba_f0; + unsigned short wRTSDuration_aa_f0; + unsigned short wRTSDuration_ba_f1; + unsigned short wRTSDuration_aa_f1; SRTSData Data; }__attribute__ ((__packed__)) SRTS_g_FB, *PSRTS_g_FB; @@ -491,11 +491,11 @@ typedef const SRTS_g_FB *PCSRTS_g_FB; typedef struct tagSRTS_ab { - BYTE bySignalField; - BYTE byServiceField; - WORD wTransmitLength; - WORD wDuration; - WORD wReserved; + unsigned char bySignalField; + unsigned char byServiceField; + unsigned short wTransmitLength; + unsigned short wDuration; + unsigned short wReserved; SRTSData Data; }__attribute__ ((__packed__)) SRTS_ab, *PSRTS_ab; @@ -503,13 +503,13 @@ typedef const SRTS_ab *PCSRTS_ab; typedef struct tagSRTS_a_FB { - BYTE bySignalField; - BYTE byServiceField; - WORD wTransmitLength; - WORD wDuration; - WORD wReserved; - WORD wRTSDuration_f0; - WORD wRTSDuration_f1; + unsigned char bySignalField; + unsigned char byServiceField; + unsigned short wTransmitLength; + unsigned short wDuration; + unsigned short wReserved; + unsigned short wRTSDuration_f0; + unsigned short wRTSDuration_f1; SRTSData Data; }__attribute__ ((__packed__)) SRTS_a_FB, *PSRTS_a_FB; @@ -520,32 +520,32 @@ typedef const SRTS_a_FB *PCSRTS_a_FB; // CTS buffer header // typedef struct tagSCTSData { - WORD wFrameControl; - WORD wDurationID; - BYTE abyRA[ETH_ALEN]; - WORD wReserved; + unsigned short wFrameControl; + unsigned short wDurationID; + unsigned char abyRA[ETH_ALEN]; + unsigned short wReserved; }__attribute__ ((__packed__)) SCTSData, *PSCTSData; typedef struct tagSCTS { - BYTE bySignalField_b; - BYTE byServiceField_b; - WORD wTransmitLength_b; - WORD wDuration_ba; - WORD wReserved; + unsigned char bySignalField_b; + unsigned char byServiceField_b; + unsigned short wTransmitLength_b; + unsigned short wDuration_ba; + unsigned short wReserved; SCTSData Data; }__attribute__ ((__packed__)) SCTS, *PSCTS; typedef const SCTS *PCSCTS; typedef struct tagSCTS_FB { - BYTE bySignalField_b; - BYTE byServiceField_b; - WORD wTransmitLength_b; - WORD wDuration_ba; - WORD wReserved; - WORD wCTSDuration_ba_f0; - WORD wCTSDuration_ba_f1; + unsigned char bySignalField_b; + unsigned char byServiceField_b; + unsigned short wTransmitLength_b; + unsigned short wDuration_ba; + unsigned short wReserved; + unsigned short wCTSDuration_ba_f0; + unsigned short wCTSDuration_ba_f1; SCTSData Data; }__attribute__ ((__packed__)) SCTS_FB, *PSCTS_FB; @@ -556,19 +556,19 @@ typedef const SCTS_FB *PCSCTS_FB; // Tx FIFO header // typedef struct tagSTxBufHead { - DWORD adwTxKey[4]; - WORD wFIFOCtl; - WORD wTimeStamp; - WORD wFragCtl; - BYTE byTxPower; - BYTE wReserved; + u32 adwTxKey[4]; + unsigned short wFIFOCtl; + unsigned short wTimeStamp; + unsigned short wFragCtl; + unsigned char byTxPower; + unsigned char wReserved; }__attribute__ ((__packed__)) STxBufHead, *PSTxBufHead; typedef const STxBufHead *PCSTxBufHead; typedef struct tagSTxShortBufHead { - WORD wFIFOCtl; - WORD wTimeStamp; + unsigned short wFIFOCtl; + unsigned short wTimeStamp; }__attribute__ ((__packed__)) STxShortBufHead, *PSTxShortBufHead; typedef const STxShortBufHead *PCSTxShortBufHead; @@ -577,57 +577,57 @@ typedef const STxShortBufHead *PCSTxShortBufHead; // Tx data header // typedef struct tagSTxDataHead_g { - BYTE bySignalField_b; - BYTE byServiceField_b; - WORD wTransmitLength_b; - BYTE bySignalField_a; - BYTE byServiceField_a; - WORD wTransmitLength_a; - WORD wDuration_b; - WORD wDuration_a; - WORD wTimeStampOff_b; - WORD wTimeStampOff_a; + unsigned char bySignalField_b; + unsigned char byServiceField_b; + unsigned short wTransmitLength_b; + unsigned char bySignalField_a; + unsigned char byServiceField_a; + unsigned short wTransmitLength_a; + unsigned short wDuration_b; + unsigned short wDuration_a; + unsigned short wTimeStampOff_b; + unsigned short wTimeStampOff_a; }__attribute__ ((__packed__)) STxDataHead_g, *PSTxDataHead_g; typedef const STxDataHead_g *PCSTxDataHead_g; typedef struct tagSTxDataHead_g_FB { - BYTE bySignalField_b; - BYTE byServiceField_b; - WORD wTransmitLength_b; - BYTE bySignalField_a; - BYTE byServiceField_a; - WORD wTransmitLength_a; - WORD wDuration_b; - WORD wDuration_a; - WORD wDuration_a_f0; - WORD wDuration_a_f1; - WORD wTimeStampOff_b; - WORD wTimeStampOff_a; + unsigned char bySignalField_b; + unsigned char byServiceField_b; + unsigned short wTransmitLength_b; + unsigned char bySignalField_a; + unsigned char byServiceField_a; + unsigned short wTransmitLength_a; + unsigned short wDuration_b; + unsigned short wDuration_a; + unsigned short wDuration_a_f0; + unsigned short wDuration_a_f1; + unsigned short wTimeStampOff_b; + unsigned short wTimeStampOff_a; }__attribute__ ((__packed__)) STxDataHead_g_FB, *PSTxDataHead_g_FB; typedef const STxDataHead_g_FB *PCSTxDataHead_g_FB; typedef struct tagSTxDataHead_ab { - BYTE bySignalField; - BYTE byServiceField; - WORD wTransmitLength; - WORD wDuration; - WORD wTimeStampOff; + unsigned char bySignalField; + unsigned char byServiceField; + unsigned short wTransmitLength; + unsigned short wDuration; + unsigned short wTimeStampOff; }__attribute__ ((__packed__)) STxDataHead_ab, *PSTxDataHead_ab; typedef const STxDataHead_ab *PCSTxDataHead_ab; typedef struct tagSTxDataHead_a_FB { - BYTE bySignalField; - BYTE byServiceField; - WORD wTransmitLength; - WORD wDuration; - WORD wTimeStampOff; - WORD wDuration_f0; - WORD wDuration_f1; + unsigned char bySignalField; + unsigned char byServiceField; + unsigned short wTransmitLength; + unsigned short wDuration; + unsigned short wTimeStampOff; + unsigned short wDuration_f0; + unsigned short wDuration_f1; }__attribute__ ((__packed__)) STxDataHead_a_FB, *PSTxDataHead_a_FB; typedef const STxDataHead_a_FB *PCSTxDataHead_a_FB; @@ -636,37 +636,37 @@ typedef const STxDataHead_a_FB *PCSTxDataHead_a_FB; // MICHDR data header // typedef struct tagSMICHDRHead { - DWORD adwHDR0[4]; - DWORD adwHDR1[4]; - DWORD adwHDR2[4]; + u32 adwHDR0[4]; + u32 adwHDR1[4]; + u32 adwHDR2[4]; }__attribute__ ((__packed__)) SMICHDRHead, *PSMICHDRHead; typedef const SMICHDRHead *PCSMICHDRHead; typedef struct tagSBEACONCtl { - DWORD BufReady : 1; - DWORD TSF : 15; - DWORD BufLen : 11; - DWORD Reserved : 5; + u32 BufReady : 1; + u32 TSF : 15; + u32 BufLen : 11; + u32 Reserved : 5; }__attribute__ ((__packed__)) SBEACONCtl; typedef struct tagSSecretKey { - DWORD dwLowDword; - BYTE byHighByte; + u32 dwLowDword; + unsigned char byHighByte; }__attribute__ ((__packed__)) SSecretKey; typedef struct tagSKeyEntry { - BYTE abyAddrHi[2]; - WORD wKCTL; - BYTE abyAddrLo[4]; - DWORD dwKey0[4]; - DWORD dwKey1[4]; - DWORD dwKey2[4]; - DWORD dwKey3[4]; - DWORD dwKey4[4]; + unsigned char abyAddrHi[2]; + unsigned short wKCTL; + unsigned char abyAddrLo[4]; + u32 dwKey0[4]; + u32 dwKey1[4]; + u32 dwKey2[4]; + u32 dwKey3[4]; + u32 dwKey4[4]; }__attribute__ ((__packed__)) SKeyEntry; /*--------------------- Export Macros ------------------------------*/ diff --git a/drivers/staging/vt6655/device.h b/drivers/staging/vt6655/device.h index 40ee4e14237..2e7c2fd7b7e 100644 --- a/drivers/staging/vt6655/device.h +++ b/drivers/staging/vt6655/device.h @@ -48,10 +48,10 @@ #include <linux/wait.h> #include <linux/if_arp.h> #include <linux/sched.h> -#include <asm/io.h> +#include <linux/io.h> #include <linux/if.h> //#include <linux/config.h> -#include <asm/uaccess.h> +#include <linux/uaccess.h> #include <linux/proc_fs.h> #include <linux/inetdevice.h> #include <linux/reboot.h> @@ -218,7 +218,7 @@ typedef enum __device_init_type { #define NDIS_802_11_PMKID_CANDIDATE_PREAUTH_ENABLED 0x01 // PMKID Structures -typedef UCHAR NDIS_802_11_PMKID_VALUE[16]; +typedef unsigned char NDIS_802_11_PMKID_VALUE[16]; typedef enum _NDIS_802_11_WEP_STATUS @@ -250,7 +250,7 @@ typedef enum _NDIS_802_11_STATUS_TYPE //Added new types for PMKID Candidate lists. typedef struct _PMKID_CANDIDATE { NDIS_802_11_MAC_ADDRESS BSSID; - ULONG Flags; + unsigned long Flags; } PMKID_CANDIDATE, *PPMKID_CANDIDATE; @@ -261,15 +261,15 @@ typedef struct _BSSID_INFO } BSSID_INFO, *PBSSID_INFO; typedef struct tagSPMKID { - ULONG Length; - ULONG BSSIDInfoCount; + unsigned long Length; + unsigned long BSSIDInfoCount; BSSID_INFO BSSIDInfo[MAX_BSSIDINFO_4_PMKID]; } SPMKID, *PSPMKID; typedef struct tagSPMKIDCandidateEvent { NDIS_802_11_STATUS_TYPE StatusType; - ULONG Version; // Version of the structure - ULONG NumCandidates; // No. of pmkid candidates + unsigned long Version; // Version of the structure + unsigned long NumCandidates; // No. of pmkid candidates PMKID_CANDIDATE CandidateList[MAX_PMKIDLIST]; } SPMKIDCandidateEvent, *PSPMKIDCandidateEvent; @@ -279,10 +279,10 @@ typedef struct tagSPMKIDCandidateEvent { #define MAX_QUIET_COUNT 8 typedef struct tagSQuietControl { - BOOL bEnable; - DWORD dwStartTime; - BYTE byPeriod; - WORD wDuration; + bool bEnable; + unsigned long dwStartTime; + unsigned char byPeriod; + unsigned short wDuration; } SQuietControl, *PSQuietControl; //-- @@ -291,7 +291,7 @@ typedef struct __chip_info_tbl{ char* name; int io_size; int nTxQueue; - U32 flags; + u32 flags; } CHIP_INFO, *PCHIP_INFO; @@ -303,15 +303,15 @@ typedef enum { // The receive duplicate detection cache entry typedef struct tagSCacheEntry{ - WORD wFmSequence; - BYTE abyAddr2[ETH_ALEN]; + unsigned short wFmSequence; + unsigned char abyAddr2[ETH_ALEN]; } SCacheEntry, *PSCacheEntry; typedef struct tagSCache{ /* The receive cache is updated circularly. The next entry to be written is * indexed by the "InPtr". */ - UINT uInPtr; // Place to use next + unsigned int uInPtr; // Place to use next SCacheEntry asCacheEntry[DUPLICATE_RX_CACHE_LENGTH]; } SCache, *PSCache; @@ -319,14 +319,14 @@ typedef struct tagSCache{ // DeFragment Control Block, used for collecting fragments prior to reassembly typedef struct tagSDeFragControlBlock { - WORD wSequence; - WORD wFragNum; - BYTE abyAddr2[ETH_ALEN]; - UINT uLifetime; + unsigned short wSequence; + unsigned short wFragNum; + unsigned char abyAddr2[ETH_ALEN]; + unsigned int uLifetime; struct sk_buff* skb; - PBYTE pbyRxBuffer; - UINT cbFrameLength; - BOOL bInUse; + unsigned char *pbyRxBuffer; + unsigned int cbFrameLength; + bool bInUse; } SDeFragControlBlock, *PSDeFragControlBlock; @@ -386,7 +386,7 @@ typedef struct __device_opt { int short_retry; int long_retry; int bbp_type; - U32 flags; + u32 flags; } OPTIONS, *POPTIONS; @@ -417,21 +417,21 @@ typedef struct __device_info { dma_addr_t tx_bufs_dma1; dma_addr_t tx_beacon_dma; - PBYTE tx0_bufs; - PBYTE tx1_bufs; - PBYTE tx_beacon_bufs; + unsigned char *tx0_bufs; + unsigned char *tx1_bufs; + unsigned char *tx_beacon_bufs; CHIP_TYPE chip_id; - U32 PortOffset; - DWORD dwIsr; - U32 memaddr; - U32 ioaddr; - U32 io_size; + unsigned long PortOffset; + unsigned long dwIsr; + u32 memaddr; + u32 ioaddr; + u32 io_size; - BYTE byRevId; - WORD SubSystemID; - WORD SubVendorID; + unsigned char byRevId; + unsigned short SubSystemID; + unsigned short SubVendorID; int nTxQueues; volatile int iTDUsed[TYPE_MAXTD]; @@ -448,17 +448,17 @@ typedef struct __device_info { SCache sDupRxCache; SDeFragControlBlock sRxDFCB[CB_MAX_RX_FRAG]; - UINT cbDFCB; - UINT cbFreeDFCB; - UINT uCurrentDFCBIdx; + unsigned int cbDFCB; + unsigned int cbFreeDFCB; + unsigned int uCurrentDFCBIdx; OPTIONS sOpts; - U32 flags; + u32 flags; - U32 rx_buf_sz; + u32 rx_buf_sz; int multicast_limit; - BYTE byRxMode; + unsigned char byRxMode; spinlock_t lock; //PLICE_DEBUG-> @@ -472,19 +472,19 @@ typedef struct __device_info { //PLICE_DEBUG <- - U32 rx_bytes; + u32 rx_bytes; // Version control - BYTE byLocalID; - BYTE byRFType; + unsigned char byLocalID; + unsigned char byRFType; - BYTE byMaxPwrLevel; - BYTE byZoneType; - BOOL bZoneRegExist; - BYTE byOriginalZonetype; - BYTE abyMacContext[MAC_MAX_CONTEXT_REG]; - BOOL bLinkPass; // link status: OK or fail - BYTE abyCurrentNetAddr[ETH_ALEN]; + unsigned char byMaxPwrLevel; + unsigned char byZoneType; + bool bZoneRegExist; + unsigned char byOriginalZonetype; + unsigned char abyMacContext[MAC_MAX_CONTEXT_REG]; + bool bLinkPass; // link status: OK or fail + unsigned char abyCurrentNetAddr[ETH_ALEN]; // Adapter statistics SStatCounter scStatistic; @@ -497,249 +497,249 @@ typedef struct __device_info { SMgmtObject sMgmtObj; // 802.11 MAC specific - UINT uCurrRSSI; - BYTE byCurrSQ; - - DWORD dwTxAntennaSel; - DWORD dwRxAntennaSel; - BYTE byAntennaCount; - BYTE byRxAntennaMode; - BYTE byTxAntennaMode; - BOOL bTxRxAntInv; - - PBYTE pbyTmpBuff; - UINT uSIFS; //Current SIFS - UINT uDIFS; //Current DIFS - UINT uEIFS; //Current EIFS - UINT uSlot; //Current SlotTime - UINT uCwMin; //Current CwMin - UINT uCwMax; //CwMax is fixed on 1023. + unsigned int uCurrRSSI; + unsigned char byCurrSQ; + + unsigned long dwTxAntennaSel; + unsigned long dwRxAntennaSel; + unsigned char byAntennaCount; + unsigned char byRxAntennaMode; + unsigned char byTxAntennaMode; + bool bTxRxAntInv; + + unsigned char *pbyTmpBuff; + unsigned int uSIFS; //Current SIFS + unsigned int uDIFS; //Current DIFS + unsigned int uEIFS; //Current EIFS + unsigned int uSlot; //Current SlotTime + unsigned int uCwMin; //Current CwMin + unsigned int uCwMax; //CwMax is fixed on 1023. // PHY parameter - BYTE bySIFS; - BYTE byDIFS; - BYTE byEIFS; - BYTE bySlot; - BYTE byCWMaxMin; + unsigned char bySIFS; + unsigned char byDIFS; + unsigned char byEIFS; + unsigned char bySlot; + unsigned char byCWMaxMin; CARD_PHY_TYPE eCurrentPHYType; VIA_BB_TYPE byBBType; //0: 11A, 1:11B, 2:11G VIA_PKT_TYPE byPacketType; //0:11a,1:11b,2:11gb(only CCK in BasicRate),3:11ga(OFDM in Basic Rate) - WORD wBasicRate; - BYTE byACKRate; - BYTE byTopOFDMBasicRate; - BYTE byTopCCKBasicRate; - - BYTE byMinChannel; - BYTE byMaxChannel; - UINT uConnectionRate; - - BYTE byPreambleType; - BYTE byShortPreamble; - - WORD wCurrentRate; - WORD wRTSThreshold; - WORD wFragmentationThreshold; - BYTE byShortRetryLimit; - BYTE byLongRetryLimit; + unsigned short wBasicRate; + unsigned char byACKRate; + unsigned char byTopOFDMBasicRate; + unsigned char byTopCCKBasicRate; + + unsigned char byMinChannel; + unsigned char byMaxChannel; + unsigned int uConnectionRate; + + unsigned char byPreambleType; + unsigned char byShortPreamble; + + unsigned short wCurrentRate; + unsigned short wRTSThreshold; + unsigned short wFragmentationThreshold; + unsigned char byShortRetryLimit; + unsigned char byLongRetryLimit; CARD_OP_MODE eOPMode; - BYTE byOpMode; - BOOL bBSSIDFilter; - WORD wMaxTransmitMSDULifetime; - BYTE abyBSSID[ETH_ALEN]; - BYTE abyDesireBSSID[ETH_ALEN]; - WORD wCTSDuration; // update while speed change - WORD wACKDuration; // update while speed change - WORD wRTSTransmitLen; // update while speed change - BYTE byRTSServiceField; // update while speed change - BYTE byRTSSignalField; // update while speed change - - DWORD dwMaxReceiveLifetime; // dot11MaxReceiveLifetime - - BOOL bCCK; - BOOL bEncryptionEnable; - BOOL bLongHeader; - BOOL bShortSlotTime; - BOOL bProtectMode; - BOOL bNonERPPresent; - BOOL bBarkerPreambleMd; - - BYTE byERPFlag; - WORD wUseProtectCntDown; - - BOOL bRadioControlOff; - BOOL bRadioOff; - BOOL bEnablePSMode; - WORD wListenInterval; - BOOL bPWBitOn; + unsigned char byOpMode; + bool bBSSIDFilter; + unsigned short wMaxTransmitMSDULifetime; + unsigned char abyBSSID[ETH_ALEN]; + unsigned char abyDesireBSSID[ETH_ALEN]; + unsigned short wCTSDuration; // update while speed change + unsigned short wACKDuration; // update while speed change + unsigned short wRTSTransmitLen; // update while speed change + unsigned char byRTSServiceField; // update while speed change + unsigned char byRTSSignalField; // update while speed change + + unsigned long dwMaxReceiveLifetime; // dot11MaxReceiveLifetime + + bool bCCK; + bool bEncryptionEnable; + bool bLongHeader; + bool bShortSlotTime; + bool bProtectMode; + bool bNonERPPresent; + bool bBarkerPreambleMd; + + unsigned char byERPFlag; + unsigned short wUseProtectCntDown; + + bool bRadioControlOff; + bool bRadioOff; + bool bEnablePSMode; + unsigned short wListenInterval; + bool bPWBitOn; WMAC_POWER_MODE ePSMode; // GPIO Radio Control - BYTE byRadioCtl; - BYTE byGPIO; - BOOL bHWRadioOff; - BOOL bPrvActive4RadioOFF; - BOOL bGPIOBlockRead; + unsigned char byRadioCtl; + unsigned char byGPIO; + bool bHWRadioOff; + bool bPrvActive4RadioOFF; + bool bGPIOBlockRead; // Beacon releated - WORD wSeqCounter; - WORD wBCNBufLen; - BOOL bBeaconBufReady; - BOOL bBeaconSent; - BOOL bIsBeaconBufReadySet; - UINT cbBeaconBufReadySetCnt; - BOOL bFixRate; - BYTE byCurrentCh; - UINT uScanTime; + unsigned short wSeqCounter; + unsigned short wBCNBufLen; + bool bBeaconBufReady; + bool bBeaconSent; + bool bIsBeaconBufReadySet; + unsigned int cbBeaconBufReadySetCnt; + bool bFixRate; + unsigned char byCurrentCh; + unsigned int uScanTime; CMD_STATE eCommandState; CMD_CODE eCommand; - BOOL bBeaconTx; + bool bBeaconTx; - BOOL bStopBeacon; - BOOL bStopDataPkt; - BOOL bStopTx0Pkt; - UINT uAutoReConnectTime; + bool bStopBeacon; + bool bStopDataPkt; + bool bStopTx0Pkt; + unsigned int uAutoReConnectTime; // 802.11 counter CMD_ITEM eCmdQueue[CMD_Q_SIZE]; - UINT uCmdDequeueIdx; - UINT uCmdEnqueueIdx; - UINT cbFreeCmdQueue; - BOOL bCmdRunning; - BOOL bCmdClear; + unsigned int uCmdDequeueIdx; + unsigned int uCmdEnqueueIdx; + unsigned int cbFreeCmdQueue; + bool bCmdRunning; + bool bCmdClear; - BOOL bRoaming; + bool bRoaming; //WOW - BYTE abyIPAddr[4]; + unsigned char abyIPAddr[4]; - ULONG ulTxPower; + unsigned long ulTxPower; NDIS_802_11_WEP_STATUS eEncryptionStatus; - BOOL bTransmitKey; + bool bTransmitKey; //2007-0925-01<Add>by MikeLiu //mike add :save old Encryption NDIS_802_11_WEP_STATUS eOldEncryptionStatus; SKeyManagement sKey; - DWORD dwIVCounter; + unsigned long dwIVCounter; QWORD qwPacketNumber; //For CCMP and TKIP as TSC(6 bytes) - UINT uCurrentWEPMode; + unsigned int uCurrentWEPMode; RC4Ext SBox; - BYTE abyPRNG[WLAN_WEPMAX_KEYLEN+3]; - BYTE byKeyIndex; - UINT uKeyLength; - BYTE abyKey[WLAN_WEP232_KEYLEN]; + unsigned char abyPRNG[WLAN_WEPMAX_KEYLEN+3]; + unsigned char byKeyIndex; + unsigned int uKeyLength; + unsigned char abyKey[WLAN_WEP232_KEYLEN]; - BOOL bAES; - BYTE byCntMeasure; + bool bAES; + unsigned char byCntMeasure; // for AP mode - UINT uAssocCount; - BOOL bMoreData; + unsigned int uAssocCount; + bool bMoreData; // QoS - BOOL bGrpAckPolicy; + bool bGrpAckPolicy; // for OID_802_11_ASSOCIATION_INFORMATION - BOOL bAssocInfoSet; + bool bAssocInfoSet; - BYTE byAutoFBCtrl; + unsigned char byAutoFBCtrl; - BOOL bTxMICFail; - BOOL bRxMICFail; + bool bTxMICFail; + bool bRxMICFail; - UINT uRATEIdx; + unsigned int uRATEIdx; // For Update BaseBand VGA Gain Offset - BOOL bUpdateBBVGA; - UINT uBBVGADiffCount; - BYTE byBBVGANew; - BYTE byBBVGACurrent; - BYTE abyBBVGA[BB_VGA_LEVEL]; - LONG ldBmThreshold[BB_VGA_LEVEL]; + bool bUpdateBBVGA; + unsigned int uBBVGADiffCount; + unsigned char byBBVGANew; + unsigned char byBBVGACurrent; + unsigned char abyBBVGA[BB_VGA_LEVEL]; + long ldBmThreshold[BB_VGA_LEVEL]; - BYTE byBBPreEDRSSI; - BYTE byBBPreEDIndex; + unsigned char byBBPreEDRSSI; + unsigned char byBBPreEDIndex; - BOOL bRadioCmd; - DWORD dwDiagRefCount; + bool bRadioCmd; + unsigned long dwDiagRefCount; // For FOE Tuning - BYTE byFOETuning; + unsigned char byFOETuning; // For Auto Power Tunning - BYTE byAutoPwrTunning; - SHORT sPSetPointCCK; - SHORT sPSetPointOFDMG; - SHORT sPSetPointOFDMA; - LONG lPFormulaOffset; - SHORT sPThreshold; - CHAR cAdjustStep; - CHAR cMinTxAGC; + unsigned char byAutoPwrTunning; + short sPSetPointCCK; + short sPSetPointOFDMG; + short sPSetPointOFDMA; + long lPFormulaOffset; + short sPThreshold; + char cAdjustStep; + char cMinTxAGC; // For RF Power table - BYTE byCCKPwr; - BYTE byOFDMPwrG; - BYTE byCurPwr; - I8 byCurPwrdBm; - BYTE abyCCKPwrTbl[CB_MAX_CHANNEL_24G+1]; - BYTE abyOFDMPwrTbl[CB_MAX_CHANNEL+1]; - I8 abyCCKDefaultPwr[CB_MAX_CHANNEL_24G+1]; - I8 abyOFDMDefaultPwr[CB_MAX_CHANNEL+1]; - I8 abyRegPwr[CB_MAX_CHANNEL+1]; - I8 abyLocalPwr[CB_MAX_CHANNEL+1]; + unsigned char byCCKPwr; + unsigned char byOFDMPwrG; + unsigned char byCurPwr; + char byCurPwrdBm; + unsigned char abyCCKPwrTbl[CB_MAX_CHANNEL_24G+1]; + unsigned char abyOFDMPwrTbl[CB_MAX_CHANNEL+1]; + char abyCCKDefaultPwr[CB_MAX_CHANNEL_24G+1]; + char abyOFDMDefaultPwr[CB_MAX_CHANNEL+1]; + char abyRegPwr[CB_MAX_CHANNEL+1]; + char abyLocalPwr[CB_MAX_CHANNEL+1]; // BaseBand Loopback Use - BYTE byBBCR4d; - BYTE byBBCRc9; - BYTE byBBCR88; - BYTE byBBCR09; + unsigned char byBBCR4d; + unsigned char byBBCRc9; + unsigned char byBBCR88; + unsigned char byBBCR09; // command timer struct timer_list sTimerCommand; #ifdef TxInSleep struct timer_list sTimerTxData; - ULONG nTxDataTimeCout; - BOOL fTxDataInSleep; - BOOL IsTxDataTrigger; + unsigned long nTxDataTimeCout; + bool fTxDataInSleep; + bool IsTxDataTrigger; #endif #ifdef WPA_SM_Transtatus - BOOL fWPA_Authened; //is WPA/WPA-PSK or WPA2/WPA2-PSK authen?? + bool fWPA_Authened; //is WPA/WPA-PSK or WPA2/WPA2-PSK authen?? #endif - BYTE byReAssocCount; //mike add:re-association retry times! - BYTE byLinkWaitCount; + unsigned char byReAssocCount; //mike add:re-association retry times! + unsigned char byLinkWaitCount; - BYTE abyNodeName[17]; + unsigned char abyNodeName[17]; - BOOL bDiversityRegCtlON; - BOOL bDiversityEnable; - ULONG ulDiversityNValue; - ULONG ulDiversityMValue; - BYTE byTMax; - BYTE byTMax2; - BYTE byTMax3; - ULONG ulSQ3TH; + bool bDiversityRegCtlON; + bool bDiversityEnable; + unsigned long ulDiversityNValue; + unsigned long ulDiversityMValue; + unsigned char byTMax; + unsigned char byTMax2; + unsigned char byTMax3; + unsigned long ulSQ3TH; // ANT diversity - ULONG uDiversityCnt; - BYTE byAntennaState; - ULONG ulRatio_State0; - ULONG ulRatio_State1; + unsigned long uDiversityCnt; + unsigned char byAntennaState; + unsigned long ulRatio_State0; + unsigned long ulRatio_State1; //SQ3 functions for antenna diversity struct timer_list TimerSQ3Tmax1; @@ -747,80 +747,80 @@ typedef struct __device_info { struct timer_list TimerSQ3Tmax3; - ULONG uNumSQ3[MAX_RATE]; - WORD wAntDiversityMaxRate; + unsigned long uNumSQ3[MAX_RATE]; + unsigned short wAntDiversityMaxRate; SEthernetHeader sTxEthHeader; SEthernetHeader sRxEthHeader; - BYTE abyBroadcastAddr[ETH_ALEN]; - BYTE abySNAP_RFC1042[ETH_ALEN]; - BYTE abySNAP_Bridgetunnel[ETH_ALEN]; - BYTE abyEEPROM[EEP_MAX_CONTEXT_SIZE]; //DWORD alignment + unsigned char abyBroadcastAddr[ETH_ALEN]; + unsigned char abySNAP_RFC1042[ETH_ALEN]; + unsigned char abySNAP_Bridgetunnel[ETH_ALEN]; + unsigned char abyEEPROM[EEP_MAX_CONTEXT_SIZE]; //unsigned long alignment // Pre-Authentication & PMK cache SPMKID gsPMKID; SPMKIDCandidateEvent gsPMKIDCandidate; // for 802.11h - BOOL b11hEnable; - BYTE abyCountryCode[3]; + bool b11hEnable; + unsigned char abyCountryCode[3]; // for 802.11h DFS - UINT uNumOfMeasureEIDs; + unsigned int uNumOfMeasureEIDs; PWLAN_IE_MEASURE_REQ pCurrMeasureEID; - BOOL bMeasureInProgress; - BYTE byOrgChannel; - BYTE byOrgRCR; - DWORD dwOrgMAR0; - DWORD dwOrgMAR4; - BYTE byBasicMap; - BYTE byCCAFraction; - BYTE abyRPIs[8]; - DWORD dwRPIs[8]; - BOOL bChannelSwitch; - BYTE byNewChannel; - BYTE byChannelSwitchCount; - BOOL bQuietEnable; - BOOL bEnableFirstQuiet; - BYTE byQuietStartCount; - UINT uQuietEnqueue; - DWORD dwCurrentQuietEndTime; + bool bMeasureInProgress; + unsigned char byOrgChannel; + unsigned char byOrgRCR; + unsigned long dwOrgMAR0; + unsigned long dwOrgMAR4; + unsigned char byBasicMap; + unsigned char byCCAFraction; + unsigned char abyRPIs[8]; + unsigned long dwRPIs[8]; + bool bChannelSwitch; + unsigned char byNewChannel; + unsigned char byChannelSwitchCount; + bool bQuietEnable; + bool bEnableFirstQuiet; + unsigned char byQuietStartCount; + unsigned int uQuietEnqueue; + unsigned long dwCurrentQuietEndTime; SQuietControl sQuiet[MAX_QUIET_COUNT]; // for 802.11h TPC - BOOL bCountryInfo5G; - BOOL bCountryInfo24G; + bool bCountryInfo5G; + bool bCountryInfo24G; - WORD wBeaconInterval; + unsigned short wBeaconInterval; //WPA supplicant deamon struct net_device *wpadev; - BOOL bWPADEVUp; + bool bWPADEVUp; struct sk_buff *skb; #ifdef WPA_SUPPLICANT_DRIVER_WEXT_SUPPORT /* - BOOL bwextstep0; - BOOL bwextstep1; - BOOL bwextstep2; - BOOL bwextstep3; + bool bwextstep0; + bool bwextstep1; + bool bwextstep2; + bool bwextstep3; */ - UINT bwextcount; - BOOL bWPASuppWextEnabled; + unsigned int bwextcount; + bool bWPASuppWextEnabled; #endif //-- #ifdef HOSTAP // user space daemon: hostapd, is used for HOSTAP - BOOL bEnableHostapd; - BOOL bEnable8021x; - BOOL bEnableHostWEP; + bool bEnableHostapd; + bool bEnable8021x; + bool bEnableHostWEP; struct net_device *apdev; int (*tx_80211)(struct sk_buff *skb, struct net_device *dev); #endif - UINT uChannel; - BOOL bMACSuspend; + unsigned int uChannel; + bool bMACSuspend; struct iw_statistics wstats; // wireless stats - BOOL bCommit; + bool bCommit; } DEVICE_INFO, *PSDevice; @@ -880,7 +880,7 @@ void InitRxManagementQueue(PSDevice pDevice); -inline static BOOL device_get_ip(PSDevice pInfo) { +inline static bool device_get_ip(PSDevice pInfo) { struct in_device* in_dev=(struct in_device*) pInfo->dev->ip_ptr; struct in_ifaddr* ifa; @@ -888,10 +888,10 @@ inline static BOOL device_get_ip(PSDevice pInfo) { ifa=(struct in_ifaddr*) in_dev->ifa_list; if (ifa!=NULL) { memcpy(pInfo->abyIPAddr,&ifa->ifa_address,4); - return TRUE; + return true; } } - return FALSE; + return false; } @@ -920,9 +920,9 @@ static inline PDEVICE_TD_INFO alloc_td_info(void) { /*--------------------- Export Functions --------------------------*/ -BOOL device_dma0_xmit(PSDevice pDevice, struct sk_buff *skb, UINT uNodeIndex); -BOOL device_alloc_frag_buf(PSDevice pDevice, PSDeFragControlBlock pDeF); -int Config_FileOperation(PSDevice pDevice,BOOL fwrite,unsigned char *Parameter); +bool device_dma0_xmit(PSDevice pDevice, struct sk_buff *skb, unsigned int uNodeIndex); +bool device_alloc_frag_buf(PSDevice pDevice, PSDeFragControlBlock pDeF); +int Config_FileOperation(PSDevice pDevice, bool fwrite, unsigned char *Parameter); #endif diff --git a/drivers/staging/vt6655/device_cfg.h b/drivers/staging/vt6655/device_cfg.h index d1e9c1930bd..408edc27075 100644 --- a/drivers/staging/vt6655/device_cfg.h +++ b/drivers/staging/vt6655/device_cfg.h @@ -39,14 +39,6 @@ struct _version { unsigned char build; } version_t, *pversion_t; -#ifndef FALSE -#define FALSE (0) -#endif - -#ifndef TRUE -#define TRUE (!(FALSE)) -#endif - #define VID_TABLE_SIZE 64 #define MCAST_TABLE_SIZE 64 #define MCAM_SIZE 32 diff --git a/drivers/staging/vt6655/device_main.c b/drivers/staging/vt6655/device_main.c index e49bb258b5c..4d6b66a4fd9 100644 --- a/drivers/staging/vt6655/device_main.c +++ b/drivers/staging/vt6655/device_main.c @@ -26,9 +26,9 @@ * * Functions: * - * device_found1 - module initial (insmod) driver entry - * device_remove1 - module remove entry - * device_init_info - device structure resource allocation function + * vt6655_probe - module initial (insmod) driver entry + * vt6655_remove - module remove entry + * vt6655_init_info - device structure resource allocation function * device_free_info - device structure resource free function * device_get_pci_info - get allocated pci io/mem resource * device_print_info - print out resource @@ -62,6 +62,7 @@ #include "device.h" #include "card.h" +#include "channel.h" #include "baseband.h" #include "mac.h" #include "tether.h" @@ -133,10 +134,10 @@ DEVICE_PARAM(TxDescriptors1,"Number of transmit descriptors1"); #define IP_ALIG_DEF 0 -/* IP_byte_align[] is used for IP header DWORD byte aligned - 0: indicate the IP header won't be DWORD byte aligned.(Default) . - 1: indicate the IP header will be DWORD byte aligned. - In some enviroment, the IP header should be DWORD byte aligned, +/* IP_byte_align[] is used for IP header unsigned long byte aligned + 0: indicate the IP header won't be unsigned long byte aligned.(Default) . + 1: indicate the IP header will be unsigned long byte aligned. + In some enviroment, the IP header should be unsigned long byte aligned, or the packet will be droped when we receive it. (eg: IPVS) */ DEVICE_PARAM(IP_byte_align,"Enable IP header dword aligned"); @@ -284,7 +285,7 @@ static CHIP_INFO chip_info_table[]= { {0,NULL} }; -DEFINE_PCI_DEVICE_TABLE(device_id_table) = { +DEFINE_PCI_DEVICE_TABLE(vt6655_pci_id_table) = { { PCI_VDEVICE(VIA, 0x3253), (kernel_ulong_t)chip_info_table}, { 0, } }; @@ -292,10 +293,10 @@ DEFINE_PCI_DEVICE_TABLE(device_id_table) = { /*--------------------- Static Functions --------------------------*/ -static int device_found1(struct pci_dev *pcid, const struct pci_device_id *ent); -static BOOL device_init_info(struct pci_dev* pcid, PSDevice* ppDevice, PCHIP_INFO); +static int vt6655_probe(struct pci_dev *pcid, const struct pci_device_id *ent); +static bool vt6655_init_info(struct pci_dev* pcid, PSDevice* ppDevice, PCHIP_INFO); static void device_free_info(PSDevice pDevice); -static BOOL device_get_pci_info(PSDevice, struct pci_dev* pcid); +static bool device_get_pci_info(PSDevice, struct pci_dev* pcid); static void device_print_info(PSDevice pDevice); static struct net_device_stats *device_get_stats(struct net_device *dev); static void device_init_diversity_timer(PSDevice pDevice); @@ -326,12 +327,12 @@ static void device_init_td1_ring(PSDevice pDevice); static int device_dma0_tx_80211(struct sk_buff *skb, struct net_device *dev); //2008-0714<Add>by Mike Liu -static BOOL device_release_WPADEV(PSDevice pDevice); +static bool device_release_WPADEV(PSDevice pDevice); static int ethtool_ioctl(struct net_device *dev, void *useraddr); -static int device_rx_srv(PSDevice pDevice, UINT uIdx); -static int device_tx_srv(PSDevice pDevice, UINT uIdx); -static BOOL device_alloc_rx_buf(PSDevice pDevice, PSRxDesc pDesc); +static int device_rx_srv(PSDevice pDevice, unsigned int uIdx); +static int device_tx_srv(PSDevice pDevice, unsigned int uIdx); +static bool device_alloc_rx_buf(PSDevice pDevice, PSRxDesc pDesc); static void device_init_registers(PSDevice pDevice, DEVICE_INIT_TYPE InitType); static void device_free_tx_buf(PSDevice pDevice, PSTxDesc pDesc); static void device_free_td0_ring(PSDevice pDevice); @@ -340,7 +341,8 @@ static void device_free_rd0_ring(PSDevice pDevice); static void device_free_rd1_ring(PSDevice pDevice); static void device_free_rings(PSDevice pDevice); static void device_free_frag_buf(PSDevice pDevice); -static int Config_FileGetParameter(UCHAR *string, UCHAR *dest,UCHAR *source); +static int Config_FileGetParameter(unsigned char *string, + unsigned char *dest, unsigned char *source); /*--------------------- Export Variables --------------------------*/ @@ -357,7 +359,7 @@ static char* get_chip_name(int chip_id) { return chip_info_table[i].name; } -static void device_remove1(struct pci_dev *pcid) +static void __devexit vt6655_remove(struct pci_dev *pcid) { PSDevice pDevice=pci_get_drvdata(pcid); @@ -384,7 +386,7 @@ device_set_int_opt(int *opt, int val, int min, int max, int def,char* name,char* } static void -device_set_bool_opt(unsigned int *opt, int val,BOOL def,U32 flag, char* name,char* devname) { +device_set_bool_opt(unsigned int *opt, int val,bool def,u32 flag, char* name,char* devname) { (*opt)&=(~flag); if (val==-1) *opt|=(def ? flag : 0); @@ -394,7 +396,7 @@ device_set_bool_opt(unsigned int *opt, int val,BOOL def,U32 flag, char* name,cha *opt|=(def ? flag : 0); } else { DBG_PRT(MSG_LEVEL_INFO, KERN_NOTICE "%s: set parameter %s to %s\n", - devname,name , val ? "TRUE" : "FALSE"); + devname,name , val ? "true" : "false"); *opt|=(val ? flag : 0); } } @@ -429,9 +431,9 @@ pOpts->flags|=DEVICE_FLAGS_DiversityANT; static void device_set_options(PSDevice pDevice) { - BYTE abyBroadcastAddr[ETH_ALEN] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff}; - BYTE abySNAP_RFC1042[ETH_ALEN] = {0xAA, 0xAA, 0x03, 0x00, 0x00, 0x00}; - BYTE abySNAP_Bridgetunnel[ETH_ALEN] = {0xAA, 0xAA, 0x03, 0x00, 0x00, 0xF8}; + unsigned char abyBroadcastAddr[ETH_ALEN] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff}; + unsigned char abySNAP_RFC1042[ETH_ALEN] = {0xAA, 0xAA, 0x03, 0x00, 0x00, 0x00}; + unsigned char abySNAP_Bridgetunnel[ETH_ALEN] = {0xAA, 0xAA, 0x03, 0x00, 0x00, 0xF8}; memcpy(pDevice->abyBroadcastAddr, abyBroadcastAddr, ETH_ALEN); @@ -450,7 +452,7 @@ device_set_options(PSDevice pDevice) { pDevice->b11hEnable = (pDevice->sOpts.flags & DEVICE_FLAGS_80211h_MODE) ? 1 : 0; pDevice->bDiversityRegCtlON = (pDevice->sOpts.flags & DEVICE_FLAGS_DiversityANT) ? 1 : 0; pDevice->uConnectionRate = pDevice->sOpts.data_rate; - if (pDevice->uConnectionRate < RATE_AUTO) pDevice->bFixRate = TRUE; + if (pDevice->uConnectionRate < RATE_AUTO) pDevice->bFixRate = true; pDevice->byBBType = pDevice->sOpts.bbp_type; pDevice->byPacketType = pDevice->byBBType; @@ -458,45 +460,45 @@ device_set_options(PSDevice pDevice) { pDevice->byAutoFBCtrl = AUTO_FB_0; //pDevice->byAutoFBCtrl = AUTO_FB_1; //PLICE_DEBUG<- -pDevice->bUpdateBBVGA = TRUE; +pDevice->bUpdateBBVGA = true; pDevice->byFOETuning = 0; pDevice->wCTSDuration = 0; pDevice->byPreambleType = 0; - DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" uChannel= %d\n",(INT)pDevice->uChannel); - DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" byOpMode= %d\n",(INT)pDevice->byOpMode); - DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" ePSMode= %d\n",(INT)pDevice->ePSMode); - DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" wRTSThreshold= %d\n",(INT)pDevice->wRTSThreshold); - DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" byShortRetryLimit= %d\n",(INT)pDevice->byShortRetryLimit); - DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" byLongRetryLimit= %d\n",(INT)pDevice->byLongRetryLimit); - DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" byPreambleType= %d\n",(INT)pDevice->byPreambleType); - DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" byShortPreamble= %d\n",(INT)pDevice->byShortPreamble); - DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" uConnectionRate= %d\n",(INT)pDevice->uConnectionRate); - DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" byBBType= %d\n",(INT)pDevice->byBBType); - DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" pDevice->b11hEnable= %d\n",(INT)pDevice->b11hEnable); - DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" pDevice->bDiversityRegCtlON= %d\n",(INT)pDevice->bDiversityRegCtlON); + DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" uChannel= %d\n",(int)pDevice->uChannel); + DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" byOpMode= %d\n",(int)pDevice->byOpMode); + DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" ePSMode= %d\n",(int)pDevice->ePSMode); + DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" wRTSThreshold= %d\n",(int)pDevice->wRTSThreshold); + DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" byShortRetryLimit= %d\n",(int)pDevice->byShortRetryLimit); + DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" byLongRetryLimit= %d\n",(int)pDevice->byLongRetryLimit); + DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" byPreambleType= %d\n",(int)pDevice->byPreambleType); + DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" byShortPreamble= %d\n",(int)pDevice->byShortPreamble); + DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" uConnectionRate= %d\n",(int)pDevice->uConnectionRate); + DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" byBBType= %d\n",(int)pDevice->byBBType); + DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" pDevice->b11hEnable= %d\n",(int)pDevice->b11hEnable); + DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" pDevice->bDiversityRegCtlON= %d\n",(int)pDevice->bDiversityRegCtlON); } -static void s_vCompleteCurrentMeasure (PSDevice pDevice, BYTE byResult) +static void s_vCompleteCurrentMeasure (PSDevice pDevice, unsigned char byResult) { - UINT ii; - DWORD dwDuration = 0; - BYTE byRPI0 = 0; + unsigned int ii; + unsigned long dwDuration = 0; + unsigned char byRPI0 = 0; for(ii=1;ii<8;ii++) { pDevice->dwRPIs[ii] *= 255; - dwDuration |= *((PWORD) (pDevice->pCurrMeasureEID->sReq.abyDuration)); + dwDuration |= *((unsigned short *) (pDevice->pCurrMeasureEID->sReq.abyDuration)); dwDuration <<= 10; pDevice->dwRPIs[ii] /= dwDuration; - pDevice->abyRPIs[ii] = (BYTE) pDevice->dwRPIs[ii]; + pDevice->abyRPIs[ii] = (unsigned char) pDevice->dwRPIs[ii]; byRPI0 += pDevice->abyRPIs[ii]; } pDevice->abyRPIs[0] = (0xFF - byRPI0); if (pDevice->uNumOfMeasureEIDs == 0) { VNTWIFIbMeasureReport( pDevice->pMgmt, - TRUE, + true, pDevice->pCurrMeasureEID, byResult, pDevice->byBasicMap, @@ -505,7 +507,7 @@ static void s_vCompleteCurrentMeasure (PSDevice pDevice, BYTE byResult) ); } else { VNTWIFIbMeasureReport( pDevice->pMgmt, - FALSE, + false, pDevice->pCurrMeasureEID, byResult, pDevice->byBasicMap, @@ -525,12 +527,12 @@ static void s_vCompleteCurrentMeasure (PSDevice pDevice, BYTE byResult) static void device_init_registers(PSDevice pDevice, DEVICE_INIT_TYPE InitType) { - UINT ii; - BYTE byValue; - BYTE byValue1; - BYTE byCCKPwrdBm = 0; - BYTE byOFDMPwrdBm = 0; - INT zonetype=0; + unsigned int ii; + unsigned char byValue; + unsigned char byValue1; + unsigned char byCCKPwrdBm = 0; + unsigned char byOFDMPwrdBm = 0; + int zonetype=0; PSMgmtObject pMgmt = &(pDevice->sMgmtObj); MACbShutdown(pDevice->PortOffset); BBvSoftwareReset(pDevice->PortOffset); @@ -540,11 +542,11 @@ static void device_init_registers(PSDevice pDevice, DEVICE_INIT_TYPE InitType) // Do MACbSoftwareReset in MACvInitialize MACbSoftwareReset(pDevice->PortOffset); // force CCK - pDevice->bCCK = TRUE; - pDevice->bAES = FALSE; - pDevice->bProtectMode = FALSE; //Only used in 11g type, sync with ERP IE - pDevice->bNonERPPresent = FALSE; - pDevice->bBarkerPreambleMd = FALSE; + pDevice->bCCK = true; + pDevice->bAES = false; + pDevice->bProtectMode = false; //Only used in 11g type, sync with ERP IE + pDevice->bNonERPPresent = false; + pDevice->bBarkerPreambleMd = false; pDevice->wCurrentRate = RATE_1M; pDevice->byTopOFDMBasicRate = RATE_24M; pDevice->byTopCCKBasicRate = RATE_1M; @@ -570,9 +572,9 @@ static void device_init_registers(PSDevice pDevice, DEVICE_INIT_TYPE InitType) // Get Antena byValue = SROMbyReadEmbedded(pDevice->PortOffset, EEP_OFS_ANTENNA); if (byValue & EEP_ANTINV) - pDevice->bTxRxAntInv = TRUE; + pDevice->bTxRxAntInv = true; else - pDevice->bTxRxAntInv = FALSE; + pDevice->bTxRxAntInv = false; #ifdef PLICE_DEBUG //printk("init_register:TxRxAntInv is %d,byValue is %d\n",pDevice->bTxRxAntInv,byValue); #endif @@ -587,7 +589,7 @@ static void device_init_registers(PSDevice pDevice, DEVICE_INIT_TYPE InitType) pDevice->ulDiversityMValue = 100*16;//SROMbyReadEmbedded(pDevice->PortOffset, 0x52); pDevice->byTMax = 1;//SROMbyReadEmbedded(pDevice->PortOffset, 0x53); pDevice->byTMax2 = 4;//SROMbyReadEmbedded(pDevice->PortOffset, 0x54); - pDevice->ulSQ3TH = 0;//(ULONG) SROMbyReadEmbedded(pDevice->PortOffset, 0x55); + pDevice->ulSQ3TH = 0;//(unsigned long) SROMbyReadEmbedded(pDevice->PortOffset, 0x55); pDevice->byTMax3 = 64;//SROMbyReadEmbedded(pDevice->PortOffset, 0x56); if (byValue == (EEP_ANTENNA_AUX | EEP_ANTENNA_MAIN)) { @@ -595,7 +597,7 @@ static void device_init_registers(PSDevice pDevice, DEVICE_INIT_TYPE InitType) pDevice->byTxAntennaMode = ANT_B; pDevice->dwTxAntennaSel = 1; pDevice->dwRxAntennaSel = 1; - if (pDevice->bTxRxAntInv == TRUE) + if (pDevice->bTxRxAntInv == true) pDevice->byRxAntennaMode = ANT_A; else pDevice->byRxAntennaMode = ANT_B; @@ -603,26 +605,26 @@ static void device_init_registers(PSDevice pDevice, DEVICE_INIT_TYPE InitType) byValue1 = SROMbyReadEmbedded(pDevice->PortOffset, EEP_OFS_ANTENNA); // if (pDevice->bDiversityRegCtlON) if((byValue1&0x08)==0) - pDevice->bDiversityEnable = FALSE;//SROMbyReadEmbedded(pDevice->PortOffset, 0x50); + pDevice->bDiversityEnable = false;//SROMbyReadEmbedded(pDevice->PortOffset, 0x50); else - pDevice->bDiversityEnable = TRUE; + pDevice->bDiversityEnable = true; #ifdef PLICE_DEBUG //printk("aux |main antenna: RxAntennaMode is %d\n",pDevice->byRxAntennaMode); #endif } else { - pDevice->bDiversityEnable = FALSE; + pDevice->bDiversityEnable = false; pDevice->byAntennaCount = 1; pDevice->dwTxAntennaSel = 0; pDevice->dwRxAntennaSel = 0; if (byValue & EEP_ANTENNA_AUX) { pDevice->byTxAntennaMode = ANT_A; - if (pDevice->bTxRxAntInv == TRUE) + if (pDevice->bTxRxAntInv == true) pDevice->byRxAntennaMode = ANT_B; else pDevice->byRxAntennaMode = ANT_A; } else { pDevice->byTxAntennaMode = ANT_B; - if (pDevice->bTxRxAntInv == TRUE) + if (pDevice->bTxRxAntInv == true) pDevice->byRxAntennaMode = ANT_A; else pDevice->byRxAntennaMode = ANT_B; @@ -638,7 +640,7 @@ byValue1 = SROMbyReadEmbedded(pDevice->PortOffset, EEP_OFS_ANTENNA); //2008-8-4 <add> by chester //zonetype initial pDevice->byOriginalZonetype = pDevice->abyEEPROM[EEP_OFS_ZONETYPE]; - zonetype = Config_FileOperation(pDevice,FALSE,NULL); + zonetype = Config_FileOperation(pDevice,false,NULL); if (zonetype >= 0) { //read zonetype file ok! if ((zonetype == 0)&& (pDevice->abyEEPROM[EEP_OFS_ZONETYPE] !=0x00)){ //for USA @@ -680,7 +682,7 @@ else pDevice->byRFType &= RF_MASK; DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "pDevice->byRFType = %x\n", pDevice->byRFType); - if (pDevice->bZoneRegExist == FALSE) { + if (pDevice->bZoneRegExist == false) { pDevice->byZoneType = pDevice->abyEEPROM[EEP_OFS_ZONETYPE]; } DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "pDevice->byZoneType = %x\n", pDevice->byZoneType); @@ -700,11 +702,11 @@ else for (ii=0;ii<CB_MAX_CHANNEL_24G;ii++) { - pDevice->abyCCKPwrTbl[ii+1] = SROMbyReadEmbedded(pDevice->PortOffset, (BYTE)(ii + EEP_OFS_CCK_PWR_TBL)); + pDevice->abyCCKPwrTbl[ii+1] = SROMbyReadEmbedded(pDevice->PortOffset, (unsigned char)(ii + EEP_OFS_CCK_PWR_TBL)); if (pDevice->abyCCKPwrTbl[ii+1] == 0) { pDevice->abyCCKPwrTbl[ii+1] = pDevice->byCCKPwr; } - pDevice->abyOFDMPwrTbl[ii+1] = SROMbyReadEmbedded(pDevice->PortOffset, (BYTE)(ii + EEP_OFS_OFDM_PWR_TBL)); + pDevice->abyOFDMPwrTbl[ii+1] = SROMbyReadEmbedded(pDevice->PortOffset, (unsigned char)(ii + EEP_OFS_OFDM_PWR_TBL)); if (pDevice->abyOFDMPwrTbl[ii+1] == 0) { pDevice->abyOFDMPwrTbl[ii+1] = pDevice->byOFDMPwrG; } @@ -726,10 +728,10 @@ else // Load OFDM A Power Table for (ii=0;ii<CB_MAX_CHANNEL_5G;ii++) { //RobertYu:20041224, bug using CB_MAX_CHANNEL - pDevice->abyOFDMPwrTbl[ii+CB_MAX_CHANNEL_24G+1] = SROMbyReadEmbedded(pDevice->PortOffset, (BYTE)(ii + EEP_OFS_OFDMA_PWR_TBL)); - pDevice->abyOFDMDefaultPwr[ii+CB_MAX_CHANNEL_24G+1] = SROMbyReadEmbedded(pDevice->PortOffset, (BYTE)(ii + EEP_OFS_OFDMA_PWR_dBm)); + pDevice->abyOFDMPwrTbl[ii+CB_MAX_CHANNEL_24G+1] = SROMbyReadEmbedded(pDevice->PortOffset, (unsigned char)(ii + EEP_OFS_OFDMA_PWR_TBL)); + pDevice->abyOFDMDefaultPwr[ii+CB_MAX_CHANNEL_24G+1] = SROMbyReadEmbedded(pDevice->PortOffset, (unsigned char)(ii + EEP_OFS_OFDMA_PWR_dBm)); } - CARDvInitChannelTable((void *)pDevice); + init_channel_table((void *)pDevice); if (pDevice->byLocalID > REV_ID_VT3253_B1) { @@ -773,38 +775,38 @@ else if (pDevice->uConnectionRate == RATE_AUTO) { pDevice->wCurrentRate = RATE_54M; } else { - pDevice->wCurrentRate = (WORD)pDevice->uConnectionRate; + pDevice->wCurrentRate = (unsigned short)pDevice->uConnectionRate; } // default G Mode VNTWIFIbConfigPhyMode(pDevice->pMgmt, PHY_TYPE_11G); VNTWIFIbConfigPhyMode(pDevice->pMgmt, PHY_TYPE_AUTO); - pDevice->bRadioOff = FALSE; + pDevice->bRadioOff = false; pDevice->byRadioCtl = SROMbyReadEmbedded(pDevice->PortOffset, EEP_OFS_RADIOCTL); - pDevice->bHWRadioOff = FALSE; + pDevice->bHWRadioOff = false; if (pDevice->byRadioCtl & EEP_RADIOCTL_ENABLE) { // Get GPIO MACvGPIOIn(pDevice->PortOffset, &pDevice->byGPIO); //2008-4-14 <add> by chester for led issue #ifdef FOR_LED_ON_NOTEBOOK -if (pDevice->byGPIO & GPIO0_DATA){pDevice->bHWRadioOff = TRUE;} -if ( !(pDevice->byGPIO & GPIO0_DATA)){pDevice->bHWRadioOff = FALSE;} +if (pDevice->byGPIO & GPIO0_DATA){pDevice->bHWRadioOff = true;} +if ( !(pDevice->byGPIO & GPIO0_DATA)){pDevice->bHWRadioOff = false;} } - if ( (pDevice->bRadioControlOff == TRUE)) { + if ( (pDevice->bRadioControlOff == true)) { CARDbRadioPowerOff(pDevice); } else CARDbRadioPowerOn(pDevice); #else if (((pDevice->byGPIO & GPIO0_DATA) && !(pDevice->byRadioCtl & EEP_RADIOCTL_INV)) || ( !(pDevice->byGPIO & GPIO0_DATA) && (pDevice->byRadioCtl & EEP_RADIOCTL_INV))) { - pDevice->bHWRadioOff = TRUE; + pDevice->bHWRadioOff = true; } } - if ((pDevice->bHWRadioOff == TRUE) || (pDevice->bRadioControlOff == TRUE)) { + if ((pDevice->bHWRadioOff == true) || (pDevice->bRadioControlOff == true)) { CARDbRadioPowerOff(pDevice); } @@ -850,17 +852,17 @@ else CARDbRadioPowerOn(pDevice); static void device_init_diversity_timer(PSDevice pDevice) { init_timer(&pDevice->TimerSQ3Tmax1); - pDevice->TimerSQ3Tmax1.data = (ULONG)pDevice; + pDevice->TimerSQ3Tmax1.data = (unsigned long) pDevice; pDevice->TimerSQ3Tmax1.function = (TimerFunction)TimerSQ3CallBack; pDevice->TimerSQ3Tmax1.expires = RUN_AT(HZ); init_timer(&pDevice->TimerSQ3Tmax2); - pDevice->TimerSQ3Tmax2.data = (ULONG)pDevice; + pDevice->TimerSQ3Tmax2.data = (unsigned long) pDevice; pDevice->TimerSQ3Tmax2.function = (TimerFunction)TimerSQ3CallBack; pDevice->TimerSQ3Tmax2.expires = RUN_AT(HZ); init_timer(&pDevice->TimerSQ3Tmax3); - pDevice->TimerSQ3Tmax3.data = (ULONG)pDevice; + pDevice->TimerSQ3Tmax3.data = (unsigned long) pDevice; pDevice->TimerSQ3Tmax3.function = (TimerFunction)TimerState1CallBack; pDevice->TimerSQ3Tmax3.expires = RUN_AT(HZ); @@ -868,13 +870,13 @@ static void device_init_diversity_timer(PSDevice pDevice) { } -static BOOL device_release_WPADEV(PSDevice pDevice) +static bool device_release_WPADEV(PSDevice pDevice) { viawget_wpa_header *wpahdr; int ii=0; // wait_queue_head_t Set_wait; //send device close to wpa_supplicnat layer - if (pDevice->bWPADEVUp==TRUE) { + if (pDevice->bWPADEVUp==true) { wpahdr = (viawget_wpa_header *)pDevice->skb->data; wpahdr->type = VIAWGET_DEVICECLOSE_MSG; wpahdr->resp_ie_len = 0; @@ -891,7 +893,7 @@ static BOOL device_release_WPADEV(PSDevice pDevice) //wait release WPADEV // init_waitqueue_head(&Set_wait); // wait_event_timeout(Set_wait, ((pDevice->wpadev==NULL)&&(pDevice->skb == NULL)),5*HZ); //1s wait - while((pDevice->bWPADEVUp==TRUE)) { + while((pDevice->bWPADEVUp==true)) { set_current_state(TASK_UNINTERRUPTIBLE); schedule_timeout (HZ/20); //wait 50ms ii++; @@ -899,7 +901,7 @@ static BOOL device_release_WPADEV(PSDevice pDevice) break; } }; - return TRUE; + return true; } @@ -914,10 +916,10 @@ static const struct net_device_ops device_netdev_ops = { -static int -device_found1(struct pci_dev *pcid, const struct pci_device_id *ent) +static int __devinit +vt6655_probe(struct pci_dev *pcid, const struct pci_device_id *ent) { - static BOOL bFirst = TRUE; + static bool bFirst = true; struct net_device* dev = NULL; PCHIP_INFO pChip_info = (PCHIP_INFO)ent->driver_data; PSDevice pDevice; @@ -944,10 +946,10 @@ device_found1(struct pci_dev *pcid, const struct pci_device_id *ent) if (bFirst) { printk(KERN_NOTICE "%s Ver. %s\n",DEVICE_FULL_DRV_NAM, DEVICE_VERSION); printk(KERN_NOTICE "Copyright (c) 2003 VIA Networking Technologies, Inc.\n"); - bFirst=FALSE; + bFirst=false; } - if (!device_init_info(pcid, &pDevice, pChip_info)) { + if (!vt6655_init_info(pcid, &pDevice, pChip_info)) { return -ENOMEM; } pDevice->dev = dev; @@ -962,7 +964,7 @@ device_found1(struct pci_dev *pcid, const struct pci_device_id *ent) #ifdef DEBUG printk("Before get pci_info memaddr is %x\n",pDevice->memaddr); #endif - if (device_get_pci_info(pDevice,pcid) == FALSE) { + if (device_get_pci_info(pDevice,pcid) == false) { printk(KERN_ERR DEVICE_NAME ": Failed to find PCI device.\n"); device_free_info(pDevice); return -ENODEV; @@ -976,7 +978,7 @@ device_found1(struct pci_dev *pcid, const struct pci_device_id *ent) printk("after get pci_info memaddr is %x, io addr is %x,io_size is %d\n",pDevice->memaddr,pDevice->ioaddr,pDevice->io_size); { int i; - U32 bar,len; + u32 bar,len; u32 address[] = { PCI_BASE_ADDRESS_0, PCI_BASE_ADDRESS_1, @@ -1020,8 +1022,8 @@ device_found1(struct pci_dev *pcid, const struct pci_device_id *ent) #ifdef DEBUG //return 0 ; #endif - pDevice->PortOffset = (DWORD)ioremap(pDevice->memaddr & PCI_BASE_ADDRESS_MEM_MASK, pDevice->io_size); - //pDevice->PortOffset = (DWORD)ioremap(pDevice->ioaddr & PCI_BASE_ADDRESS_IO_MASK, pDevice->io_size); + pDevice->PortOffset = (unsigned long)ioremap(pDevice->memaddr & PCI_BASE_ADDRESS_MEM_MASK, pDevice->io_size); + //pDevice->PortOffset = (unsigned long)ioremap(pDevice->ioaddr & PCI_BASE_ADDRESS_IO_MASK, pDevice->io_size); if(pDevice->PortOffset == 0) { printk(KERN_ERR DEVICE_NAME ": Failed to IO remapping ..\n"); @@ -1041,7 +1043,7 @@ device_found1(struct pci_dev *pcid, const struct pci_device_id *ent) dev->base_addr = pDevice->ioaddr; #ifdef PLICE_DEBUG - BYTE value; + unsigned char value; VNSvInPortB(pDevice->PortOffset+0x4F, &value); printk("Before write: value is %x\n",value); @@ -1111,16 +1113,17 @@ static void device_print_info(PSDevice pDevice) DBG_PRT(MSG_LEVEL_INFO, KERN_INFO "%s: %s\n",dev->name, get_chip_name(pDevice->chip_id)); DBG_PRT(MSG_LEVEL_INFO, KERN_INFO "%s: MAC=%pM", dev->name, dev->dev_addr); #ifdef IO_MAP - DBG_PRT(MSG_LEVEL_INFO, KERN_INFO" IO=0x%lx ",(ULONG) pDevice->ioaddr); + DBG_PRT(MSG_LEVEL_INFO, KERN_INFO" IO=0x%lx ",(unsigned long) pDevice->ioaddr); DBG_PRT(MSG_LEVEL_INFO, KERN_INFO" IRQ=%d \n", pDevice->dev->irq); #else - DBG_PRT(MSG_LEVEL_INFO, KERN_INFO" IO=0x%lx Mem=0x%lx ",(ULONG) pDevice->ioaddr,(ULONG) pDevice->PortOffset); + DBG_PRT(MSG_LEVEL_INFO, KERN_INFO" IO=0x%lx Mem=0x%lx ", + (unsigned long) pDevice->ioaddr,(unsigned long) pDevice->PortOffset); DBG_PRT(MSG_LEVEL_INFO, KERN_INFO" IRQ=%d \n", pDevice->dev->irq); #endif } -static BOOL device_init_info(struct pci_dev* pcid, PSDevice* ppDevice, +static bool __devinit vt6655_init_info(struct pci_dev* pcid, PSDevice* ppDevice, PCHIP_INFO pChip_info) { PSDevice p; @@ -1145,19 +1148,19 @@ static BOOL device_init_info(struct pci_dev* pcid, PSDevice* ppDevice, spin_lock_init(&((*ppDevice)->lock)); - return TRUE; + return true; } -static BOOL device_get_pci_info(PSDevice pDevice, struct pci_dev* pcid) { +static bool device_get_pci_info(PSDevice pDevice, struct pci_dev* pcid) { - U16 pci_cmd; - U8 b; - UINT cis_addr; + u16 pci_cmd; + u8 b; + unsigned int cis_addr; #ifdef PLICE_DEBUG - BYTE pci_config[256]; - BYTE value =0x00; + unsigned char pci_config[256]; + unsigned char value =0x00; int ii,j; - U16 max_lat=0x0000; + u16 max_lat=0x0000; memset(pci_config,0x00,256); #endif @@ -1211,7 +1214,7 @@ static BOOL device_get_pci_info(PSDevice pDevice, struct pci_dev* pcid) { } } #endif - return TRUE; + return true; } static void device_free_info(PSDevice pDevice) { @@ -1263,7 +1266,7 @@ device_release_WPADEV(pDevice); } } -static BOOL device_init_rings(PSDevice pDevice) { +static bool device_init_rings(PSDevice pDevice) { void* vir_pool; @@ -1277,7 +1280,7 @@ static BOOL device_init_rings(PSDevice pDevice) { if (vir_pool == NULL) { DBG_PRT(MSG_LEVEL_ERR,KERN_ERR "%s : allocate desc dma memory failed\n", pDevice->dev->name); - return FALSE; + return false; } memset(vir_pool, 0, @@ -1312,7 +1315,7 @@ static BOOL device_init_rings(PSDevice pDevice) { pDevice->sOpts.nTxDescs[1] * sizeof(STxDesc), vir_pool, pDevice->pool_dma ); - return FALSE; + return false; } memset(pDevice->tx0_bufs, 0, @@ -1358,7 +1361,7 @@ static BOOL device_init_rings(PSDevice pDevice) { pDevice->sOpts.nTxDescs[1] * PKT_BUF_SZ; - return TRUE; + return true; } static void device_free_rings(PSDevice pDevice) { @@ -1593,7 +1596,7 @@ static void device_free_td1_ring(PSDevice pDevice) { /*-----------------------------------------------------------------*/ -static int device_rx_srv(PSDevice pDevice, UINT uIdx) { +static int device_rx_srv(PSDevice pDevice, unsigned int uIdx) { PSRxDesc pRD; int works = 0; @@ -1621,7 +1624,7 @@ static int device_rx_srv(PSDevice pDevice, UINT uIdx) { } -static BOOL device_alloc_rx_buf(PSDevice pDevice, PSRxDesc pRD) { +static bool device_alloc_rx_buf(PSDevice pDevice, PSRxDesc pRD) { PDEVICE_RD_INFO pRDInfo=pRD->pRDInfo; @@ -1631,7 +1634,7 @@ static BOOL device_alloc_rx_buf(PSDevice pDevice, PSRxDesc pRD) { //printk("device_alloc_rx_buf:skb is %x\n",pRDInfo->skb); #endif if (pRDInfo->skb==NULL) - return FALSE; + return false; ASSERT(pRDInfo->skb); pRDInfo->skb->dev = pDevice->dev; pRDInfo->skb_dma = pci_map_single(pDevice->pcid, skb_tail_pointer(pRDInfo->skb), @@ -1643,35 +1646,35 @@ static BOOL device_alloc_rx_buf(PSDevice pDevice, PSRxDesc pRD) { pRD->m_rd1RD1.wReqCount = cpu_to_le16(pDevice->rx_buf_sz); pRD->buff_addr = cpu_to_le32(pRDInfo->skb_dma); - return TRUE; + return true; } -BOOL device_alloc_frag_buf(PSDevice pDevice, PSDeFragControlBlock pDeF) { +bool device_alloc_frag_buf(PSDevice pDevice, PSDeFragControlBlock pDeF) { pDeF->skb = dev_alloc_skb((int)pDevice->rx_buf_sz); if (pDeF->skb == NULL) - return FALSE; + return false; ASSERT(pDeF->skb); pDeF->skb->dev = pDevice->dev; - return TRUE; + return true; } -static int device_tx_srv(PSDevice pDevice, UINT uIdx) { +static int device_tx_srv(PSDevice pDevice, unsigned int uIdx) { PSTxDesc pTD; - BOOL bFull=FALSE; + bool bFull=false; int works = 0; - BYTE byTsr0; - BYTE byTsr1; - UINT uFrameSize, uFIFOHeaderSize; + unsigned char byTsr0; + unsigned char byTsr1; + unsigned int uFrameSize, uFIFOHeaderSize; PSTxBufHead pTxBufHead; struct net_device_stats* pStats = &pDevice->stats; struct sk_buff* skb; - UINT uNodeIndex; + unsigned int uNodeIndex; PSMgmtObject pMgmt = pDevice->pMgmt; @@ -1697,20 +1700,20 @@ static int device_tx_srv(PSDevice pDevice, UINT uIdx) { STAvUpdateTDStatCounter(&pDevice->scStatistic, byTsr0, byTsr1, - (PBYTE)(pTD->pTDInfo->buf + uFIFOHeaderSize), + (unsigned char *)(pTD->pTDInfo->buf + uFIFOHeaderSize), uFrameSize, uIdx); BSSvUpdateNodeTxCounter(pDevice, byTsr0, byTsr1, - (PBYTE)(pTD->pTDInfo->buf), + (unsigned char *)(pTD->pTDInfo->buf), uFIFOHeaderSize ); if ( !(byTsr1 & TSR1_TERR)) { if (byTsr0 != 0) { DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" Tx[%d] OK but has error. tsr1[%02X] tsr0[%02X].\n", - (INT)uIdx, byTsr1, byTsr0); + (int)uIdx, byTsr1, byTsr0); } if ((pTxBufHead->wFragCtl & FRAGCTL_ENDFRAG) != FRAGCTL_NONFRAG) { pDevice->s802_11Counter.TransmittedFragmentCount ++; @@ -1720,7 +1723,7 @@ static int device_tx_srv(PSDevice pDevice, UINT uIdx) { } else { DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" Tx[%d] dropped & tsr1[%02X] tsr0[%02X].\n", - (INT)uIdx, byTsr1, byTsr0); + (int)uIdx, byTsr1, byTsr0); pStats->tx_errors++; pStats->tx_dropped++; } @@ -1742,19 +1745,19 @@ static int device_tx_srv(PSDevice pDevice, UINT uIdx) { if (byTsr1 & TSR1_TERR) { if ((pTD->pTDInfo->byFlags & TD_FLAGS_PRIV_SKB) != 0) { DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" Tx[%d] fail has error. tsr1[%02X] tsr0[%02X].\n", - (INT)uIdx, byTsr1, byTsr0); + (int)uIdx, byTsr1, byTsr0); } // DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" Tx[%d] fail has error. tsr1[%02X] tsr0[%02X].\n", -// (INT)uIdx, byTsr1, byTsr0); +// (int)uIdx, byTsr1, byTsr0); if ((pMgmt->eCurrMode == WMAC_MODE_ESS_AP) && (pTD->pTDInfo->byFlags & TD_FLAGS_NETIF_SKB)) { - WORD wAID; - BYTE byMask[8] = {1, 2, 4, 8, 0x10, 0x20, 0x40, 0x80}; + unsigned short wAID; + unsigned char byMask[8] = {1, 2, 4, 8, 0x10, 0x20, 0x40, 0x80}; skb = pTD->pTDInfo->skb; - if (BSSDBbIsSTAInNodeDB(pMgmt, (PBYTE)(skb->data), &uNodeIndex)) { + if (BSSDBbIsSTAInNodeDB(pMgmt, (unsigned char *)(skb->data), &uNodeIndex)) { if (pMgmt->sNodeDBTable[uNodeIndex].bPSEnable) { skb_queue_tail(&pMgmt->sNodeDBTable[uNodeIndex].sTxPSQueue, skb); pMgmt->sNodeDBTable[uNodeIndex].wEnQueueCnt++; @@ -1763,7 +1766,7 @@ static int device_tx_srv(PSDevice pDevice, UINT uIdx) { pMgmt->abyPSTxMap[wAID >> 3] |= byMask[wAID & 7]; pTD->pTDInfo->byFlags &= ~(TD_FLAGS_NETIF_SKB); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "tx_srv:tx fail re-queue sta index= %d, QueCnt= %d\n" - ,(INT)uNodeIndex, pMgmt->sNodeDBTable[uNodeIndex].wEnQueueCnt); + ,(int)uNodeIndex, pMgmt->sNodeDBTable[uNodeIndex].wEnQueueCnt); pStats->tx_errors--; pStats->tx_dropped--; } @@ -1780,10 +1783,10 @@ static int device_tx_srv(PSDevice pDevice, UINT uIdx) { // RESERV_AC0DMA reserved for relay if (AVAIL_TD(pDevice, uIdx) < RESERV_AC0DMA) { - bFull = TRUE; + bFull = true; DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO " AC0DMA is Full = %d\n", pDevice->iTDUsed[uIdx]); } - if (netif_queue_stopped(pDevice->dev) && (bFull==FALSE)){ + if (netif_queue_stopped(pDevice->dev) && (bFull==false)){ netif_wake_queue(pDevice->dev); } } @@ -1795,7 +1798,7 @@ static int device_tx_srv(PSDevice pDevice, UINT uIdx) { } -static void device_error(PSDevice pDevice, WORD status) { +static void device_error(PSDevice pDevice, unsigned short status) { if (status & ISR_FETALERR) { DBG_PRT(MSG_LEVEL_ERR, KERN_ERR @@ -1804,7 +1807,7 @@ static void device_error(PSDevice pDevice, WORD status) { netif_stop_queue(pDevice->dev); del_timer(&pDevice->sTimerCommand); del_timer(&(pDevice->pMgmt->sTimerSecondCallback)); - pDevice->bCmdRunning = FALSE; + pDevice->bCmdRunning = false; MACbShutdown(pDevice->PortOffset); return; } @@ -1844,7 +1847,7 @@ void InitRxManagementQueue(PSDevice pDevice) //PLICE_DEBUG -> -INT MlmeThread( +int MlmeThread( void * Context) { PSDevice pDevice = (PSDevice) Context; @@ -1914,8 +1917,8 @@ static int device_open(struct net_device *dev) { wpa_Result.proto = 0; wpa_Result.key_mgmt = 0; wpa_Result.eap_type = 0; - wpa_Result.authenticated = FALSE; - pDevice->fWPA_Authened = FALSE; + wpa_Result.authenticated = false; + pDevice->fWPA_Authened = false; #endif DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "call device init rd0 ring\n"); device_init_rd0_ring(pDevice); @@ -1980,20 +1983,20 @@ DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "call device_init_registers\n"); #ifdef WPA_SUPPLICANT_DRIVER_WEXT_SUPPORT /* - pDevice->bwextstep0 = FALSE; - pDevice->bwextstep1 = FALSE; - pDevice->bwextstep2 = FALSE; - pDevice->bwextstep3 = FALSE; + pDevice->bwextstep0 = false; + pDevice->bwextstep1 = false; + pDevice->bwextstep2 = false; + pDevice->bwextstep3 = false; */ pDevice->bwextcount=0; - pDevice->bWPASuppWextEnabled = FALSE; + pDevice->bWPASuppWextEnabled = false; #endif pDevice->byReAssocCount = 0; - pDevice->bWPADEVUp = FALSE; + pDevice->bWPADEVUp = false; // Patch: if WEP key already set by iwconfig but device not yet open - if ((pDevice->bEncryptionEnable == TRUE) && (pDevice->bTransmitKey == TRUE)) { + if ((pDevice->bEncryptionEnable == true) && (pDevice->bTransmitKey == true)) { KeybSetDefaultKey(&(pDevice->sKey), - (DWORD)(pDevice->byKeyIndex | (1 << 31)), + (unsigned long)(pDevice->byKeyIndex | (1 << 31)), pDevice->uKeyLength, NULL, pDevice->abyKey, @@ -2052,12 +2055,12 @@ static int device_close(struct net_device *dev) { tasklet_kill(&pDevice->RxMngWorkItem); #endif netif_stop_queue(dev); - pDevice->bCmdRunning = FALSE; + pDevice->bCmdRunning = false; MACbShutdown(pDevice->PortOffset); MACbSoftwareReset(pDevice->PortOffset); CARDbRadioPowerOff(pDevice); - pDevice->bLinkPass = FALSE; + pDevice->bLinkPass = false; memset(pMgmt->abyCurrBSSID, 0, 6); pMgmt->eCurrState = WMAC_STATE_IDLE; device_free_td0_ring(pDevice); @@ -2082,8 +2085,8 @@ device_release_WPADEV(pDevice); static int device_dma0_tx_80211(struct sk_buff *skb, struct net_device *dev) { PSDevice pDevice=netdev_priv(dev); - PBYTE pbMPDU; - UINT cbMPDULen = 0; + unsigned char *pbMPDU; + unsigned int cbMPDULen = 0; DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "device_dma0_tx_80211\n"); @@ -2096,7 +2099,7 @@ static int device_dma0_tx_80211(struct sk_buff *skb, struct net_device *dev) { return 0; } - if (pDevice->bStopTx0Pkt == TRUE) { + if (pDevice->bStopTx0Pkt == true) { dev_kfree_skb_irq(skb); spin_unlock_irq(&pDevice->lock); return 0; @@ -2115,36 +2118,36 @@ static int device_dma0_tx_80211(struct sk_buff *skb, struct net_device *dev) { -BOOL device_dma0_xmit(PSDevice pDevice, struct sk_buff *skb, UINT uNodeIndex) { +bool device_dma0_xmit(PSDevice pDevice, struct sk_buff *skb, unsigned int uNodeIndex) { PSMgmtObject pMgmt = pDevice->pMgmt; PSTxDesc pHeadTD, pLastTD; - UINT cbFrameBodySize; - UINT uMACfragNum; - BYTE byPktType; - BOOL bNeedEncryption = FALSE; + unsigned int cbFrameBodySize; + unsigned int uMACfragNum; + unsigned char byPktType; + bool bNeedEncryption = false; PSKeyItem pTransmitKey = NULL; - UINT cbHeaderSize; - UINT ii; + unsigned int cbHeaderSize; + unsigned int ii; SKeyItem STempKey; -// BYTE byKeyIndex = 0; +// unsigned char byKeyIndex = 0; - if (pDevice->bStopTx0Pkt == TRUE) { + if (pDevice->bStopTx0Pkt == true) { dev_kfree_skb_irq(skb); - return FALSE; + return false; }; if (AVAIL_TD(pDevice, TYPE_TXDMA0) <= 0) { dev_kfree_skb_irq(skb); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "device_dma0_xmit, td0 <=0\n"); - return FALSE; + return false; } if (pMgmt->eCurrMode == WMAC_MODE_ESS_AP) { if (pDevice->uAssocCount == 0) { dev_kfree_skb_irq(skb); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "device_dma0_xmit, assocCount = 0\n"); - return FALSE; + return false; } } @@ -2152,7 +2155,7 @@ BOOL device_dma0_xmit(PSDevice pDevice, struct sk_buff *skb, UINT uNodeIndex) { pHeadTD->m_td1TD1.byTCR = (TCR_EDP|TCR_STP); - memcpy(pDevice->sTxEthHeader.abyDstAddr, (PBYTE)(skb->data), ETH_HLEN); + memcpy(pDevice->sTxEthHeader.abyDstAddr, (unsigned char *)(skb->data), ETH_HLEN); cbFrameBodySize = skb->len - ETH_HLEN; // 802.1H @@ -2163,9 +2166,9 @@ BOOL device_dma0_xmit(PSDevice pDevice, struct sk_buff *skb, UINT uNodeIndex) { if ( uMACfragNum > AVAIL_TD(pDevice, TYPE_TXDMA0)) { dev_kfree_skb_irq(skb); - return FALSE; + return false; } - byPktType = (BYTE)pDevice->byPacketType; + byPktType = (unsigned char)pDevice->byPacketType; if (pDevice->bFixRate) { @@ -2173,13 +2176,13 @@ BOOL device_dma0_xmit(PSDevice pDevice, struct sk_buff *skb, UINT uNodeIndex) { if (pDevice->uConnectionRate >= RATE_11M) { pDevice->wCurrentRate = RATE_11M; } else { - pDevice->wCurrentRate = (WORD)pDevice->uConnectionRate; + pDevice->wCurrentRate = (unsigned short)pDevice->uConnectionRate; } } else { if (pDevice->uConnectionRate >= RATE_54M) pDevice->wCurrentRate = RATE_54M; else - pDevice->wCurrentRate = (WORD)pDevice->uConnectionRate; + pDevice->wCurrentRate = (unsigned short)pDevice->uConnectionRate; } } else { @@ -2202,15 +2205,15 @@ BOOL device_dma0_xmit(PSDevice pDevice, struct sk_buff *skb, UINT uNodeIndex) { } else if (pDevice->eCurrentPHYType == PHY_TYPE_11A) { byPktType = PK_TYPE_11A; } else { - if (pDevice->bProtectMode == TRUE) { + if (pDevice->bProtectMode == true) { byPktType = PK_TYPE_11GB; } else { byPktType = PK_TYPE_11GA; } } - if (pDevice->bEncryptionEnable == TRUE) - bNeedEncryption = TRUE; + if (pDevice->bEncryptionEnable == true) + bNeedEncryption = true; if (pDevice->bEnableHostWEP) { pTransmitKey = &STempKey; @@ -2226,7 +2229,7 @@ BOOL device_dma0_xmit(PSDevice pDevice, struct sk_buff *skb, UINT uNodeIndex) { } vGenerateFIFOHeader(pDevice, byPktType, pDevice->pbyTmpBuff, bNeedEncryption, cbFrameBodySize, TYPE_TXDMA0, pHeadTD, - &pDevice->sTxEthHeader, (PBYTE)skb->data, pTransmitKey, uNodeIndex, + &pDevice->sTxEthHeader, (unsigned char *)skb->data, pTransmitKey, uNodeIndex, &uMACfragNum, &cbHeaderSize ); @@ -2236,7 +2239,7 @@ BOOL device_dma0_xmit(PSDevice pDevice, struct sk_buff *skb, UINT uNodeIndex) { MACbPSWakeup(pDevice->PortOffset); } - pDevice->bPWBitOn = FALSE; + pDevice->bPWBitOn = false; pLastTD = pHeadTD; for (ii = 0; ii < uMACfragNum; ii++) { @@ -2260,7 +2263,7 @@ BOOL device_dma0_xmit(PSDevice pDevice, struct sk_buff *skb, UINT uNodeIndex) { MACvTransmit0(pDevice->PortOffset); - return TRUE; + return true; } //TYPE_AC0DMA data tx @@ -2269,26 +2272,26 @@ static int device_xmit(struct sk_buff *skb, struct net_device *dev) { PSMgmtObject pMgmt = pDevice->pMgmt; PSTxDesc pHeadTD, pLastTD; - UINT uNodeIndex = 0; - BYTE byMask[8] = {1, 2, 4, 8, 0x10, 0x20, 0x40, 0x80}; - WORD wAID; - UINT uMACfragNum = 1; - UINT cbFrameBodySize; - BYTE byPktType; - UINT cbHeaderSize; - BOOL bNeedEncryption = FALSE; + unsigned int uNodeIndex = 0; + unsigned char byMask[8] = {1, 2, 4, 8, 0x10, 0x20, 0x40, 0x80}; + unsigned short wAID; + unsigned int uMACfragNum = 1; + unsigned int cbFrameBodySize; + unsigned char byPktType; + unsigned int cbHeaderSize; + bool bNeedEncryption = false; PSKeyItem pTransmitKey = NULL; SKeyItem STempKey; - UINT ii; - BOOL bTKIP_UseGTK = FALSE; - BOOL bNeedDeAuth = FALSE; - PBYTE pbyBSSID; - BOOL bNodeExist = FALSE; + unsigned int ii; + bool bTKIP_UseGTK = false; + bool bNeedDeAuth = false; + unsigned char *pbyBSSID; + bool bNodeExist = false; spin_lock_irq(&pDevice->lock); - if (pDevice->bLinkPass == FALSE) { + if (pDevice->bLinkPass == false) { dev_kfree_skb_irq(skb); spin_unlock_irq(&pDevice->lock); return 0; @@ -2307,9 +2310,9 @@ static int device_xmit(struct sk_buff *skb, struct net_device *dev) { spin_unlock_irq(&pDevice->lock); return 0; } - if (IS_MULTICAST_ADDRESS((PBYTE)(skb->data))) { + if (is_multicast_ether_addr((unsigned char *)(skb->data))) { uNodeIndex = 0; - bNodeExist = TRUE; + bNodeExist = true; if (pMgmt->sNodeDBTable[0].bPSEnable) { skb_queue_tail(&(pMgmt->sNodeDBTable[0].sTxPSQueue), skb); pMgmt->sNodeDBTable[0].wEnQueueCnt++; @@ -2319,7 +2322,7 @@ static int device_xmit(struct sk_buff *skb, struct net_device *dev) { return 0; } }else { - if (BSSDBbIsSTAInNodeDB(pMgmt, (PBYTE)(skb->data), &uNodeIndex)) { + if (BSSDBbIsSTAInNodeDB(pMgmt, (unsigned char *)(skb->data), &uNodeIndex)) { if (pMgmt->sNodeDBTable[uNodeIndex].bPSEnable) { skb_queue_tail(&pMgmt->sNodeDBTable[uNodeIndex].sTxPSQueue, skb); pMgmt->sNodeDBTable[uNodeIndex].wEnQueueCnt++; @@ -2338,12 +2341,12 @@ static int device_xmit(struct sk_buff *skb, struct net_device *dev) { }else { pDevice->byPreambleType = PREAMBLE_LONG; } - bNodeExist = TRUE; + bNodeExist = true; } } - if (bNodeExist == FALSE) { + if (bNodeExist == false) { DBG_PRT(MSG_LEVEL_DEBUG, KERN_DEBUG"Unknown STA not found in node DB \n"); dev_kfree_skb_irq(skb); spin_unlock_irq(&pDevice->lock); @@ -2356,7 +2359,7 @@ static int device_xmit(struct sk_buff *skb, struct net_device *dev) { pHeadTD->m_td1TD1.byTCR = (TCR_EDP|TCR_STP); - memcpy(pDevice->sTxEthHeader.abyDstAddr, (PBYTE)(skb->data), ETH_HLEN); + memcpy(pDevice->sTxEthHeader.abyDstAddr, (unsigned char *)(skb->data), ETH_HLEN); cbFrameBodySize = skb->len - ETH_HLEN; // 802.1H if (ntohs(pDevice->sTxEthHeader.wType) > ETH_DATA_LEN) { @@ -2364,18 +2367,18 @@ static int device_xmit(struct sk_buff *skb, struct net_device *dev) { } - if (pDevice->bEncryptionEnable == TRUE) { - bNeedEncryption = TRUE; + if (pDevice->bEncryptionEnable == true) { + bNeedEncryption = true; // get Transmit key do { if ((pDevice->pMgmt->eCurrMode == WMAC_MODE_ESS_STA) && (pDevice->pMgmt->eCurrState == WMAC_STATE_ASSOC)) { pbyBSSID = pDevice->abyBSSID; // get pairwise key - if (KeybGetTransmitKey(&(pDevice->sKey), pbyBSSID, PAIRWISE_KEY, &pTransmitKey) == FALSE) { + if (KeybGetTransmitKey(&(pDevice->sKey), pbyBSSID, PAIRWISE_KEY, &pTransmitKey) == false) { // get group key - if(KeybGetTransmitKey(&(pDevice->sKey), pbyBSSID, GROUP_KEY, &pTransmitKey) == TRUE) { - bTKIP_UseGTK = TRUE; + if(KeybGetTransmitKey(&(pDevice->sKey), pbyBSSID, GROUP_KEY, &pTransmitKey) == true) { + bTKIP_UseGTK = true; DBG_PRT(MSG_LEVEL_DEBUG, KERN_DEBUG"Get GTK.\n"); break; } @@ -2392,12 +2395,12 @@ static int device_xmit(struct sk_buff *skb, struct net_device *dev) { DBG_PRT(MSG_LEVEL_DEBUG, KERN_DEBUG"\n"); // get pairwise key - if(KeybGetTransmitKey(&(pDevice->sKey), pbyBSSID, PAIRWISE_KEY, &pTransmitKey) == TRUE) + if(KeybGetTransmitKey(&(pDevice->sKey), pbyBSSID, PAIRWISE_KEY, &pTransmitKey) == true) break; } // get group key pbyBSSID = pDevice->abyBroadcastAddr; - if(KeybGetTransmitKey(&(pDevice->sKey), pbyBSSID, GROUP_KEY, &pTransmitKey) == FALSE) { + if(KeybGetTransmitKey(&(pDevice->sKey), pbyBSSID, GROUP_KEY, &pTransmitKey) == false) { pTransmitKey = NULL; if (pDevice->pMgmt->eCurrMode == WMAC_MODE_IBSS_STA) { DBG_PRT(MSG_LEVEL_DEBUG, KERN_DEBUG"IBSS and KEY is NULL. [%d]\n", pDevice->pMgmt->eCurrMode); @@ -2405,15 +2408,15 @@ static int device_xmit(struct sk_buff *skb, struct net_device *dev) { else DBG_PRT(MSG_LEVEL_DEBUG, KERN_DEBUG"NOT IBSS and KEY is NULL. [%d]\n", pDevice->pMgmt->eCurrMode); } else { - bTKIP_UseGTK = TRUE; + bTKIP_UseGTK = true; DBG_PRT(MSG_LEVEL_DEBUG, KERN_DEBUG"Get GTK.\n"); } - } while(FALSE); + } while(false); } if (pDevice->bEnableHostWEP) { DBG_PRT(MSG_LEVEL_DEBUG, KERN_DEBUG"acdma0: STA index %d\n", uNodeIndex); - if (pDevice->bEncryptionEnable == TRUE) { + if (pDevice->bEncryptionEnable == true) { pTransmitKey = &STempKey; pTransmitKey->byCipherSuite = pMgmt->sNodeDBTable[uNodeIndex].byCipherSuite; pTransmitKey->dwKeyIndex = pMgmt->sNodeDBTable[uNodeIndex].dwKeyIndex; @@ -2443,7 +2446,7 @@ static int device_xmit(struct sk_buff *skb, struct net_device *dev) { } } - byPktType = (BYTE)pDevice->byPacketType; + byPktType = (unsigned char)pDevice->byPacketType; if (pDevice->bFixRate) { #ifdef PLICE_DEBUG @@ -2454,7 +2457,7 @@ static int device_xmit(struct sk_buff *skb, struct net_device *dev) { if (pDevice->uConnectionRate >= RATE_11M) { pDevice->wCurrentRate = RATE_11M; } else { - pDevice->wCurrentRate = (WORD)pDevice->uConnectionRate; + pDevice->wCurrentRate = (unsigned short)pDevice->uConnectionRate; } } else { if ((pDevice->eCurrentPHYType == PHY_TYPE_11A) && @@ -2464,11 +2467,11 @@ static int device_xmit(struct sk_buff *skb, struct net_device *dev) { if (pDevice->uConnectionRate >= RATE_54M) pDevice->wCurrentRate = RATE_54M; else - pDevice->wCurrentRate = (WORD)pDevice->uConnectionRate; + pDevice->wCurrentRate = (unsigned short)pDevice->uConnectionRate; } } - pDevice->byACKRate = (BYTE) pDevice->wCurrentRate; + pDevice->byACKRate = (unsigned char) pDevice->wCurrentRate; pDevice->byTopCCKBasicRate = RATE_1M; pDevice->byTopOFDMBasicRate = RATE_6M; } @@ -2521,7 +2524,7 @@ pDevice->byTopCCKBasicRate,pDevice->byTopOFDMBasicRate); } else if (pDevice->eCurrentPHYType == PHY_TYPE_11A) { byPktType = PK_TYPE_11A; } else { - if (pDevice->bProtectMode == TRUE) { + if (pDevice->bProtectMode == true) { byPktType = PK_TYPE_11GB; } else { byPktType = PK_TYPE_11GA; @@ -2532,28 +2535,28 @@ pDevice->byTopCCKBasicRate,pDevice->byTopOFDMBasicRate); // printk("FIX RATE:CurrentRate is %d"); //#endif - if (bNeedEncryption == TRUE) { + if (bNeedEncryption == true) { DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"ntohs Pkt Type=%04x\n", ntohs(pDevice->sTxEthHeader.wType)); if ((pDevice->sTxEthHeader.wType) == TYPE_PKT_802_1x) { - bNeedEncryption = FALSE; + bNeedEncryption = false; DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"Pkt Type=%04x\n", (pDevice->sTxEthHeader.wType)); if ((pDevice->pMgmt->eCurrMode == WMAC_MODE_ESS_STA) && (pDevice->pMgmt->eCurrState == WMAC_STATE_ASSOC)) { if (pTransmitKey == NULL) { DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"Don't Find TX KEY\n"); } else { - if (bTKIP_UseGTK == TRUE) { + if (bTKIP_UseGTK == true) { DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"error: KEY is GTK!!~~\n"); } else { DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"Find PTK [%lX]\n", pTransmitKey->dwKeyIndex); - bNeedEncryption = TRUE; + bNeedEncryption = true; } } } if (pDevice->byCntMeasure == 2) { - bNeedDeAuth = TRUE; + bNeedDeAuth = true; pDevice->s802_11Counter.TKIPCounterMeasuresInvoked++; } @@ -2561,7 +2564,7 @@ pDevice->byTopCCKBasicRate,pDevice->byTopOFDMBasicRate); if ((uNodeIndex != 0) && (pMgmt->sNodeDBTable[uNodeIndex].dwKeyIndex & PAIRWISE_KEY)) { DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"Find PTK [%lX]\n", pTransmitKey->dwKeyIndex); - bNeedEncryption = TRUE; + bNeedEncryption = true; } } } @@ -2584,7 +2587,7 @@ pDevice->byTopCCKBasicRate,pDevice->byTopOFDMBasicRate); #endif vGenerateFIFOHeader(pDevice, byPktType, pDevice->pbyTmpBuff, bNeedEncryption, cbFrameBodySize, TYPE_AC0DMA, pHeadTD, - &pDevice->sTxEthHeader, (PBYTE)skb->data, pTransmitKey, uNodeIndex, + &pDevice->sTxEthHeader, (unsigned char *)skb->data, pTransmitKey, uNodeIndex, &uMACfragNum, &cbHeaderSize ); @@ -2593,7 +2596,7 @@ pDevice->byTopCCKBasicRate,pDevice->byTopOFDMBasicRate); // Disable PS MACbPSWakeup(pDevice->PortOffset); } - pDevice->bPWBitOn = FALSE; + pDevice->bPWBitOn = false; pLastTD = pHeadTD; for (ii = 0; ii < uMACfragNum; ii++) { @@ -2631,11 +2634,11 @@ pDevice->byTopCCKBasicRate,pDevice->byTopOFDMBasicRate); //#endif { - BYTE Protocol_Version; //802.1x Authentication - BYTE Packet_Type; //802.1x Authentication - BYTE Descriptor_type; - WORD Key_info; -BOOL bTxeapol_key = FALSE; + unsigned char Protocol_Version; //802.1x Authentication + unsigned char Packet_Type; //802.1x Authentication + unsigned char Descriptor_type; + unsigned short Key_info; +bool bTxeapol_key = false; Protocol_Version = skb->data[ETH_HLEN]; Packet_Type = skb->data[ETH_HLEN+1]; Descriptor_type = skb->data[ETH_HLEN+1+1+2]; @@ -2643,11 +2646,11 @@ BOOL bTxeapol_key = FALSE; if (pDevice->sTxEthHeader.wType == TYPE_PKT_802_1x) { if(((Protocol_Version==1) ||(Protocol_Version==2)) && (Packet_Type==3)) { //802.1x OR eapol-key challenge frame transfer - bTxeapol_key = TRUE; + bTxeapol_key = true; if((Descriptor_type==254)||(Descriptor_type==2)) { //WPA or RSN if(!(Key_info & BIT3) && //group-key challenge (Key_info & BIT8) && (Key_info & BIT9)) { //send 2/2 key - pDevice->fWPA_Authened = TRUE; + pDevice->fWPA_Authened = true; if(Descriptor_type==254) printk("WPA "); else @@ -2674,13 +2677,13 @@ static irqreturn_t device_intr(int irq, void *dev_instance) { PSDevice pDevice=(PSDevice) netdev_priv(dev); int max_count=0; - DWORD dwMIBCounter=0; + unsigned long dwMIBCounter=0; PSMgmtObject pMgmt = pDevice->pMgmt; - BYTE byOrgPageSel=0; + unsigned char byOrgPageSel=0; int handled = 0; - BYTE byData = 0; + unsigned char byData = 0; int ii= 0; -// BYTE byRSSI; +// unsigned char byRSSI; MACvReadISR(pDevice->PortOffset, &pDevice->dwIsr); @@ -2697,7 +2700,7 @@ static irqreturn_t device_intr(int irq, void *dev_instance) { if ((pDevice->dwIsr & ISR_RXDMA0) && (pDevice->byLocalID != REV_ID_VT3253_B0) && - (pDevice->bBSSIDFilter == TRUE)) { + (pDevice->bBSSIDFilter == true)) { // update RSSI //BBbReadEmbeded(pDevice->PortOffset, 0x3E, &byRSSI); //pDevice->uCurrRSSI = byRSSI; @@ -2746,9 +2749,9 @@ static irqreturn_t device_intr(int irq, void *dev_instance) { VNSvInPortD(pDevice->PortOffset + MAC_REG_MAR4, &(pDevice->dwOrgMAR4)); MACvSelectPage0(pDevice->PortOffset); //xxxx - // WCMDbFlushCommandQueue(pDevice->pMgmt, TRUE); - if (CARDbSetChannel(pDevice, pDevice->pCurrMeasureEID->sReq.byChannel) == TRUE) { - pDevice->bMeasureInProgress = TRUE; + // WCMDbFlushCommandQueue(pDevice->pMgmt, true); + if (set_channel(pDevice, pDevice->pCurrMeasureEID->sReq.byChannel) == true) { + pDevice->bMeasureInProgress = true; MACvSelectPage1(pDevice->PortOffset); MACvRegBitsOn(pDevice->PortOffset, MAC_REG_MSRCTL, MSRCTL_READY); MACvSelectPage0(pDevice->PortOffset); @@ -2770,7 +2773,7 @@ static irqreturn_t device_intr(int irq, void *dev_instance) { } if (pDevice->dwIsr & ISR_MEASUREEND) { // 802.11h measure end - pDevice->bMeasureInProgress = FALSE; + pDevice->bMeasureInProgress = false; VNSvOutPortB(pDevice->PortOffset + MAC_REG_RCR, pDevice->byOrgRCR); MACvSelectPage1(pDevice->PortOffset); VNSvOutPortD(pDevice->PortOffset + MAC_REG_MAR0, pDevice->dwOrgMAR0); @@ -2782,7 +2785,7 @@ static irqreturn_t device_intr(int irq, void *dev_instance) { // clear measure control MACvRegBitsOff(pDevice->PortOffset, MAC_REG_MSRCTL, MSRCTL_EN); MACvSelectPage0(pDevice->PortOffset); - CARDbSetChannel(pDevice, pDevice->byOrgChannel); + set_channel(pDevice, pDevice->byOrgChannel); // WCMDbResetCommandQueue(pDevice->pMgmt); MACvSelectPage1(pDevice->PortOffset); MACvRegBitsOn(pDevice->PortOffset, MAC_REG_MSRCTL+1, MSRCTL1_TXPAUSE); @@ -2798,26 +2801,26 @@ static irqreturn_t device_intr(int irq, void *dev_instance) { if (pDevice->dwIsr & ISR_QUIETSTART) { do { ; - } while (CARDbStartQuiet(pDevice) == FALSE); + } while (CARDbStartQuiet(pDevice) == false); } } if (pDevice->dwIsr & ISR_TBTT) { - if (pDevice->bEnableFirstQuiet == TRUE) { + if (pDevice->bEnableFirstQuiet == true) { pDevice->byQuietStartCount--; if (pDevice->byQuietStartCount == 0) { - pDevice->bEnableFirstQuiet = FALSE; + pDevice->bEnableFirstQuiet = false; MACvSelectPage1(pDevice->PortOffset); MACvRegBitsOn(pDevice->PortOffset, MAC_REG_MSRCTL, (MSRCTL_QUIETTXCHK | MSRCTL_QUIETEN)); MACvSelectPage0(pDevice->PortOffset); } } - if ((pDevice->bChannelSwitch == TRUE) && + if ((pDevice->bChannelSwitch == true) && (pDevice->eOPMode == OP_MODE_INFRASTRUCTURE)) { pDevice->byChannelSwitchCount--; if (pDevice->byChannelSwitchCount == 0) { - pDevice->bChannelSwitch = FALSE; - CARDbSetChannel(pDevice, pDevice->byNewChannel); + pDevice->bChannelSwitch = false; + set_channel(pDevice, pDevice->byNewChannel); VNTWIFIbChannelSwitch(pDevice->pMgmt, pDevice->byNewChannel); MACvSelectPage1(pDevice->PortOffset); MACvRegBitsOn(pDevice->PortOffset, MAC_REG_MSRCTL+1, MSRCTL1_TXPAUSE); @@ -2827,12 +2830,12 @@ static irqreturn_t device_intr(int irq, void *dev_instance) { } } if (pDevice->eOPMode == OP_MODE_ADHOC) { - //pDevice->bBeaconSent = FALSE; + //pDevice->bBeaconSent = false; } else { - if ((pDevice->bUpdateBBVGA) && (pDevice->bLinkPass == TRUE) && (pDevice->uCurrRSSI != 0)) { - LONG ldBm; + if ((pDevice->bUpdateBBVGA) && (pDevice->bLinkPass == true) && (pDevice->uCurrRSSI != 0)) { + long ldBm; - RFvRSSITodBm(pDevice, (BYTE) pDevice->uCurrRSSI, &ldBm); + RFvRSSITodBm(pDevice, (unsigned char) pDevice->uCurrRSSI, &ldBm); for (ii=0;ii<BB_VGA_LEVEL;ii++) { if (ldBm < pDevice->ldBmThreshold[ii]) { pDevice->byBBVGANew = pDevice->abyBBVGA[ii]; @@ -2858,7 +2861,7 @@ static irqreturn_t device_intr(int irq, void *dev_instance) { } } - pDevice->bBeaconSent = FALSE; + pDevice->bBeaconSent = false; if (pDevice->bEnablePSMode) { PSbIsNextTBTTWakeUp((void *)pDevice); }; @@ -2879,31 +2882,31 @@ static irqreturn_t device_intr(int irq, void *dev_instance) { if (pDevice->dwIsr & ISR_BNTX) { if (pDevice->eOPMode == OP_MODE_ADHOC) { - pDevice->bIsBeaconBufReadySet = FALSE; + pDevice->bIsBeaconBufReadySet = false; pDevice->cbBeaconBufReadySetCnt = 0; }; if (pDevice->eOPMode == OP_MODE_AP) { if(pMgmt->byDTIMCount > 0) { pMgmt->byDTIMCount --; - pMgmt->sNodeDBTable[0].bRxPSPoll = FALSE; + pMgmt->sNodeDBTable[0].bRxPSPoll = false; } else { if(pMgmt->byDTIMCount == 0) { // check if mutltcast tx bufferring pMgmt->byDTIMCount = pMgmt->byDTIMPeriod - 1; - pMgmt->sNodeDBTable[0].bRxPSPoll = TRUE; + pMgmt->sNodeDBTable[0].bRxPSPoll = true; bScheduleCommand((void *)pDevice, WLAN_CMD_RX_PSPOLL, NULL); } } } - pDevice->bBeaconSent = TRUE; + pDevice->bBeaconSent = true; - if (pDevice->bChannelSwitch == TRUE) { + if (pDevice->bChannelSwitch == true) { pDevice->byChannelSwitchCount--; if (pDevice->byChannelSwitchCount == 0) { - pDevice->bChannelSwitch = FALSE; - CARDbSetChannel(pDevice, pDevice->byNewChannel); + pDevice->bChannelSwitch = false; + set_channel(pDevice, pDevice->byNewChannel); VNTWIFIbChannelSwitch(pDevice->pMgmt, pDevice->byNewChannel); MACvSelectPage1(pDevice->PortOffset); MACvRegBitsOn(pDevice->PortOffset, MAC_REG_MSRCTL+1, MSRCTL1_TXPAUSE); @@ -2978,9 +2981,10 @@ static inline u32 ether_crc(int length, unsigned char *data) } //2008-8-4 <add> by chester -static int Config_FileGetParameter(UCHAR *string, UCHAR *dest,UCHAR *source) +static int Config_FileGetParameter(unsigned char *string, + unsigned char *dest, unsigned char *source) { - UCHAR buf1[100]; + unsigned char buf1[100]; int source_len = strlen(source); memset(buf1,0,100); @@ -2989,13 +2993,13 @@ static int Config_FileGetParameter(UCHAR *string, UCHAR *dest,UCHAR *source) source+=strlen(buf1); memcpy(dest,source,source_len-strlen(buf1)); - return TRUE; + return true; } -int Config_FileOperation(PSDevice pDevice,BOOL fwrite,unsigned char *Parameter) { - UCHAR *config_path=CONFIG_PATH; - UCHAR *buffer=NULL; - UCHAR tmpbuffer[20]; +int Config_FileOperation(PSDevice pDevice,bool fwrite,unsigned char *Parameter) { + unsigned char *config_path = CONFIG_PATH; + unsigned char *buffer = NULL; + unsigned char tmpbuffer[20]; struct file *filp=NULL; mm_segment_t old_fs = get_fs(); //int oldfsuid=0,oldfsgid=0; @@ -3038,7 +3042,7 @@ if(filp->f_op->read(filp, buffer, 1024, &filp->f_pos)<0) { goto error1; } -if(Config_FileGetParameter("ZONETYPE",tmpbuffer,buffer)!=TRUE) { +if(Config_FileGetParameter("ZONETYPE",tmpbuffer,buffer)!=true) { printk("get parameter error?\n"); result = -1; goto error1; @@ -3555,19 +3559,19 @@ static int device_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) { else { DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Commit the settings\n"); spin_lock_irq(&pDevice->lock); - pDevice->bLinkPass = FALSE; + pDevice->bLinkPass = false; memset(pMgmt->abyCurrBSSID, 0, 6); pMgmt->eCurrState = WMAC_STATE_IDLE; netif_stop_queue(pDevice->dev); #ifdef WPA_SUPPLICANT_DRIVER_WEXT_SUPPORT pMgmt->eScanType = WMAC_SCAN_ACTIVE; - if(pDevice->bWPASuppWextEnabled !=TRUE) + if(pDevice->bWPASuppWextEnabled !=true) #endif bScheduleCommand((void *) pDevice, WLAN_CMD_BSSID_SCAN, pMgmt->abyDesireSSID); bScheduleCommand((void *) pDevice, WLAN_CMD_SSID, NULL); spin_unlock_irq(&pDevice->lock); } - pDevice->bCommit = FALSE; + pDevice->bCommit = false; } return rc; @@ -3598,20 +3602,20 @@ static int ethtool_ioctl(struct net_device *dev, void *useraddr) /*------------------------------------------------------------------*/ -MODULE_DEVICE_TABLE(pci, device_id_table); +MODULE_DEVICE_TABLE(pci, vt6655_pci_id_table); static struct pci_driver device_driver = { name: DEVICE_NAME, - id_table: device_id_table, - probe: device_found1, - remove: device_remove1, + id_table: vt6655_pci_id_table, + probe: vt6655_probe, + remove: vt6655_remove, #ifdef CONFIG_PM suspend: viawget_suspend, resume: viawget_resume, #endif }; -static int __init device_init_module(void) +static int __init vt6655_init_module(void) { int ret; @@ -3627,7 +3631,7 @@ static int __init device_init_module(void) return ret; } -static void __exit device_cleanup_module(void) +static void __exit vt6655_cleanup_module(void) { @@ -3638,8 +3642,8 @@ static void __exit device_cleanup_module(void) } -module_init(device_init_module); -module_exit(device_cleanup_module); +module_init(vt6655_init_module); +module_exit(vt6655_cleanup_module); #ifdef CONFIG_PM @@ -3651,7 +3655,7 @@ device_notify_reboot(struct notifier_block *nb, unsigned long event, void *p) case SYS_DOWN: case SYS_HALT: case SYS_POWER_OFF: - while ((pdev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, pdev)) != NULL) { + for_each_pci_dev(pdev) { if(pci_dev_driver(pdev) == &device_driver) { if (pci_get_drvdata(pdev)) viawget_suspend(pdev, PMSG_HIBERNATE); @@ -3677,10 +3681,10 @@ viawget_suspend(struct pci_dev *pcid, pm_message_t state) pDevice->cbFreeCmdQueue = CMD_Q_SIZE; pDevice->uCmdDequeueIdx = 0; pDevice->uCmdEnqueueIdx = 0; - pDevice->bCmdRunning = FALSE; + pDevice->bCmdRunning = false; MACbShutdown(pDevice->PortOffset); MACvSaveContext(pDevice->PortOffset, pDevice->abyMacContext); - pDevice->bLinkPass = FALSE; + pDevice->bLinkPass = false; memset(pMgmt->abyCurrBSSID, 0, 6); pMgmt->eCurrState = WMAC_STATE_IDLE; pci_disable_device(pcid); @@ -3704,9 +3708,9 @@ viawget_resume(struct pci_dev *pcid) spin_lock_irq(&pDevice->lock); MACvRestoreContext(pDevice->PortOffset, pDevice->abyMacContext); device_init_registers(pDevice, DEVICE_INIT_DXPL); - if (pMgmt->sNodeDBTable[0].bActive == TRUE) { // Assoc with BSS - pMgmt->sNodeDBTable[0].bActive = FALSE; - pDevice->bLinkPass = FALSE; + if (pMgmt->sNodeDBTable[0].bActive == true) { // Assoc with BSS + pMgmt->sNodeDBTable[0].bActive = false; + pDevice->bLinkPass = false; if(pMgmt->eCurrMode == WMAC_MODE_IBSS_STA) { // In Adhoc, BSS state set back to started. pMgmt->eCurrState = WMAC_STATE_STARTED; diff --git a/drivers/staging/vt6655/dpc.c b/drivers/staging/vt6655/dpc.c index 6b758a8c1af..15130733693 100644 --- a/drivers/staging/vt6655/dpc.c +++ b/drivers/staging/vt6655/dpc.c @@ -66,7 +66,7 @@ //static int msglevel =MSG_LEVEL_DEBUG; static int msglevel =MSG_LEVEL_INFO; -const BYTE acbyRxRate[MAX_RATE] = +const unsigned char acbyRxRate[MAX_RATE] = {2, 4, 11, 22, 12, 18, 24, 36, 48, 72, 96, 108}; @@ -76,70 +76,60 @@ const BYTE acbyRxRate[MAX_RATE] = /*--------------------- Static Functions --------------------------*/ -static BYTE s_byGetRateIdx(BYTE byRate); +static unsigned char s_byGetRateIdx(unsigned char byRate); -static -void -s_vGetDASA( - PBYTE pbyRxBufferAddr, - PUINT pcbHeaderSize, - PSEthernetHeader psEthHeader - ); +static void +s_vGetDASA(unsigned char *pbyRxBufferAddr, unsigned int *pcbHeaderSize, + PSEthernetHeader psEthHeader); -static -void -s_vProcessRxMACHeader ( - PSDevice pDevice, - PBYTE pbyRxBufferAddr, - UINT cbPacketSize, - BOOL bIsWEP, - BOOL bExtIV, - PUINT pcbHeadSize - ); +static void +s_vProcessRxMACHeader(PSDevice pDevice, unsigned char *pbyRxBufferAddr, + unsigned int cbPacketSize, bool bIsWEP, bool bExtIV, + unsigned int *pcbHeadSize); -static BOOL s_bAPModeRxCtl( +static bool s_bAPModeRxCtl( PSDevice pDevice, - PBYTE pbyFrame, - INT iSANodeIndex + unsigned char *pbyFrame, + int iSANodeIndex ); -static BOOL s_bAPModeRxData ( +static bool s_bAPModeRxData ( PSDevice pDevice, struct sk_buff* skb, - UINT FrameSize, - UINT cbHeaderOffset, - INT iSANodeIndex, - INT iDANodeIndex + unsigned int FrameSize, + unsigned int cbHeaderOffset, + int iSANodeIndex, + int iDANodeIndex ); -static BOOL s_bHandleRxEncryption( +static bool s_bHandleRxEncryption( PSDevice pDevice, - PBYTE pbyFrame, - UINT FrameSize, - PBYTE pbyRsr, - PBYTE pbyNewRsr, + unsigned char *pbyFrame, + unsigned int FrameSize, + unsigned char *pbyRsr, + unsigned char *pbyNewRsr, PSKeyItem *pKeyOut, - int * pbExtIV, - PWORD pwRxTSC15_0, - PDWORD pdwRxTSC47_16 + bool *pbExtIV, + unsigned short *pwRxTSC15_0, + unsigned long *pdwRxTSC47_16 ); -static BOOL s_bHostWepRxEncryption( +static bool s_bHostWepRxEncryption( PSDevice pDevice, - PBYTE pbyFrame, - UINT FrameSize, - PBYTE pbyRsr, - BOOL bOnFly, + unsigned char *pbyFrame, + unsigned int FrameSize, + unsigned char *pbyRsr, + bool bOnFly, PSKeyItem pKey, - PBYTE pbyNewRsr, - int * pbExtIV, - PWORD pwRxTSC15_0, - PDWORD pdwRxTSC47_16 + unsigned char *pbyNewRsr, + bool *pbExtIV, + unsigned short *pwRxTSC15_0, + unsigned long *pdwRxTSC47_16 ); @@ -162,27 +152,21 @@ static BOOL s_bHostWepRxEncryption( * Return Value: None * -*/ -static -void -s_vProcessRxMACHeader ( - PSDevice pDevice, - PBYTE pbyRxBufferAddr, - UINT cbPacketSize, - BOOL bIsWEP, - BOOL bExtIV, - PUINT pcbHeadSize - ) +static void +s_vProcessRxMACHeader(PSDevice pDevice, unsigned char *pbyRxBufferAddr, + unsigned int cbPacketSize, bool bIsWEP, bool bExtIV, + unsigned int *pcbHeadSize) { - PBYTE pbyRxBuffer; - UINT cbHeaderSize = 0; - PWORD pwType; + unsigned char *pbyRxBuffer; + unsigned int cbHeaderSize = 0; + unsigned short *pwType; PS802_11Header pMACHeader; int ii; pMACHeader = (PS802_11Header) (pbyRxBufferAddr + cbHeaderSize); - s_vGetDASA((PBYTE)pMACHeader, &cbHeaderSize, &pDevice->sRxEthHeader); + s_vGetDASA((unsigned char *)pMACHeader, &cbHeaderSize, &pDevice->sRxEthHeader); if (bIsWEP) { if (bExtIV) { @@ -197,18 +181,18 @@ s_vProcessRxMACHeader ( cbHeaderSize += WLAN_HDR_ADDR3_LEN; }; - pbyRxBuffer = (PBYTE) (pbyRxBufferAddr + cbHeaderSize); - if (IS_ETH_ADDRESS_EQUAL(pbyRxBuffer, &pDevice->abySNAP_Bridgetunnel[0])) { + pbyRxBuffer = (unsigned char *) (pbyRxBufferAddr + cbHeaderSize); + if (!compare_ether_addr(pbyRxBuffer, &pDevice->abySNAP_Bridgetunnel[0])) { cbHeaderSize += 6; } - else if (IS_ETH_ADDRESS_EQUAL(pbyRxBuffer, &pDevice->abySNAP_RFC1042[0])) { + else if (!compare_ether_addr(pbyRxBuffer, &pDevice->abySNAP_RFC1042[0])) { cbHeaderSize += 6; - pwType = (PWORD) (pbyRxBufferAddr + cbHeaderSize); + pwType = (unsigned short *) (pbyRxBufferAddr + cbHeaderSize); if ((*pwType!= TYPE_PKT_IPX) && (*pwType != cpu_to_le16(0xF380))) { } else { cbHeaderSize -= 8; - pwType = (PWORD) (pbyRxBufferAddr + cbHeaderSize); + pwType = (unsigned short *) (pbyRxBufferAddr + cbHeaderSize); if (bIsWEP) { if (bExtIV) { *pwType = htons(cbPacketSize - WLAN_HDR_ADDR3_LEN - 8); // 8 is IV&ExtIV @@ -223,7 +207,7 @@ s_vProcessRxMACHeader ( } else { cbHeaderSize -= 2; - pwType = (PWORD) (pbyRxBufferAddr + cbHeaderSize); + pwType = (unsigned short *) (pbyRxBufferAddr + cbHeaderSize); if (bIsWEP) { if (bExtIV) { *pwType = htons(cbPacketSize - WLAN_HDR_ADDR3_LEN - 8); // 8 is IV&ExtIV @@ -237,7 +221,7 @@ s_vProcessRxMACHeader ( } cbHeaderSize -= (ETH_ALEN * 2); - pbyRxBuffer = (PBYTE) (pbyRxBufferAddr + cbHeaderSize); + pbyRxBuffer = (unsigned char *) (pbyRxBufferAddr + cbHeaderSize); for(ii=0;ii<ETH_ALEN;ii++) *pbyRxBuffer++ = pDevice->sRxEthHeader.abyDstAddr[ii]; for(ii=0;ii<ETH_ALEN;ii++) @@ -249,9 +233,9 @@ s_vProcessRxMACHeader ( -static BYTE s_byGetRateIdx (BYTE byRate) +static unsigned char s_byGetRateIdx (unsigned char byRate) { - BYTE byRateIdx; + unsigned char byRateIdx; for (byRateIdx = 0; byRateIdx <MAX_RATE ; byRateIdx++) { if (acbyRxRate[byRateIdx%MAX_RATE] == byRate) @@ -261,15 +245,11 @@ static BYTE s_byGetRateIdx (BYTE byRate) } -static -void -s_vGetDASA ( - PBYTE pbyRxBufferAddr, - PUINT pcbHeaderSize, - PSEthernetHeader psEthHeader - ) +static void +s_vGetDASA(unsigned char *pbyRxBufferAddr, unsigned int *pcbHeaderSize, + PSEthernetHeader psEthHeader) { - UINT cbHeaderSize = 0; + unsigned int cbHeaderSize = 0; PS802_11Header pMACHeader; int ii; @@ -333,7 +313,7 @@ void MngWorkItem(void *Context) -BOOL +bool device_receive_frame ( PSDevice pDevice, PSRxDesc pCurrRD @@ -349,36 +329,36 @@ device_receive_frame ( PSMgmtObject pMgmt = pDevice->pMgmt; PSRxMgmtPacket pRxPacket = &(pDevice->pMgmt->sRxPacket); PS802_11Header p802_11Header; - PBYTE pbyRsr; - PBYTE pbyNewRsr; - PBYTE pbyRSSI; + unsigned char *pbyRsr; + unsigned char *pbyNewRsr; + unsigned char *pbyRSSI; PQWORD pqwTSFTime; - PWORD pwFrameSize; - PBYTE pbyFrame; - BOOL bDeFragRx = FALSE; - BOOL bIsWEP = FALSE; - UINT cbHeaderOffset; - UINT FrameSize; - WORD wEtherType = 0; - INT iSANodeIndex = -1; - INT iDANodeIndex = -1; - UINT ii; - UINT cbIVOffset; - BOOL bExtIV = FALSE; - PBYTE pbyRxSts; - PBYTE pbyRxRate; - PBYTE pbySQ; - UINT cbHeaderSize; + unsigned short *pwFrameSize; + unsigned char *pbyFrame; + bool bDeFragRx = false; + bool bIsWEP = false; + unsigned int cbHeaderOffset; + unsigned int FrameSize; + unsigned short wEtherType = 0; + int iSANodeIndex = -1; + int iDANodeIndex = -1; + unsigned int ii; + unsigned int cbIVOffset; + bool bExtIV = false; + unsigned char *pbyRxSts; + unsigned char *pbyRxRate; + unsigned char *pbySQ; + unsigned int cbHeaderSize; PSKeyItem pKey = NULL; - WORD wRxTSC15_0 = 0; - DWORD dwRxTSC47_16 = 0; + unsigned short wRxTSC15_0 = 0; + unsigned long dwRxTSC47_16 = 0; SKeyItem STempKey; // 802.11h RPI - DWORD dwDuration = 0; - LONG ldBm = 0; - LONG ldBmThreshold = 0; + unsigned long dwDuration = 0; + long ldBm = 0; + long ldBmThreshold = 0; PS802_11Header pMACHeader; - BOOL bRxeapol_key = FALSE; + bool bRxeapol_key = false; // DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"---------- device_receive_frame---\n"); @@ -391,7 +371,7 @@ device_receive_frame ( pDevice->rx_buf_sz, PCI_DMA_FROMDEVICE); #endif //PLICE_DEBUG<- - pwFrameSize = (PWORD)(skb->data + 2); + pwFrameSize = (unsigned short *)(skb->data + 2); FrameSize = cpu_to_le16(pCurrRD->m_rd1RD1.wReqCount) - cpu_to_le16(pCurrRD->m_rd0RD0.wResCount); // Max: 2312Payload + 30HD +4CRC + 2Padding + 4Len + 8TSF + 4RSR @@ -399,17 +379,17 @@ device_receive_frame ( if ((FrameSize > 2364)||(FrameSize <= 32)) { // Frame Size error drop this packet. DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"---------- WRONG Length 1 \n"); - return FALSE; + return false; } - pbyRxSts = (PBYTE) (skb->data); - pbyRxRate = (PBYTE) (skb->data + 1); - pbyRsr = (PBYTE) (skb->data + FrameSize - 1); - pbyRSSI = (PBYTE) (skb->data + FrameSize - 2); - pbyNewRsr = (PBYTE) (skb->data + FrameSize - 3); - pbySQ = (PBYTE) (skb->data + FrameSize - 4); + pbyRxSts = (unsigned char *) (skb->data); + pbyRxRate = (unsigned char *) (skb->data + 1); + pbyRsr = (unsigned char *) (skb->data + FrameSize - 1); + pbyRSSI = (unsigned char *) (skb->data + FrameSize - 2); + pbyNewRsr = (unsigned char *) (skb->data + FrameSize - 3); + pbySQ = (unsigned char *) (skb->data + FrameSize - 4); pqwTSFTime = (PQWORD) (skb->data + FrameSize - 12); - pbyFrame = (PBYTE)(skb->data + 4); + pbyFrame = (unsigned char *)(skb->data + 4); // get packet size FrameSize = cpu_to_le16(*pwFrameSize); @@ -417,7 +397,7 @@ device_receive_frame ( if ((FrameSize > 2346)|(FrameSize < 14)) { // Max: 2312Payload + 30HD +4CRC // Min: 14 bytes ACK DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"---------- WRONG Length 2 \n"); - return FALSE; + return false; } //PLICE_DEBUG-> #if 1 @@ -431,9 +411,9 @@ device_receive_frame ( #endif - pMACHeader=(PS802_11Header)((PBYTE) (skb->data)+8); + pMACHeader=(PS802_11Header)((unsigned char *) (skb->data)+8); //PLICE_DEBUG<- - if (pDevice->bMeasureInProgress == TRUE) { + if (pDevice->bMeasureInProgress == true) { if ((*pbyRsr & RSR_CRCOK) != 0) { pDevice->byBasicMap |= 0x01; } @@ -460,13 +440,13 @@ device_receive_frame ( ii--; } pDevice->dwRPIs[ii] += dwDuration; - return FALSE; + return false; } - if (!IS_MULTICAST_ADDRESS(pbyFrame) && !IS_BROADCAST_ADDRESS(pbyFrame)) { + if (!is_multicast_ether_addr(pbyFrame)) { if (WCTLbIsDuplicate(&(pDevice->sDupRxCache), (PS802_11Header) (skb->data + 4))) { pDevice->s802_11Counter.FrameDuplicateCount++; - return FALSE; + return false; } } @@ -475,14 +455,14 @@ device_receive_frame ( s_vGetDASA(skb->data+4, &cbHeaderSize, &pDevice->sRxEthHeader); // filter packet send from myself - if (IS_ETH_ADDRESS_EQUAL((PBYTE)&(pDevice->sRxEthHeader.abySrcAddr[0]), pDevice->abyCurrentNetAddr)) - return FALSE; + if (!compare_ether_addr((unsigned char *)&(pDevice->sRxEthHeader.abySrcAddr[0]), pDevice->abyCurrentNetAddr)) + return false; if ((pMgmt->eCurrMode == WMAC_MODE_ESS_AP) || (pMgmt->eCurrMode == WMAC_MODE_IBSS_STA)) { if (IS_CTL_PSPOLL(pbyFrame) || !IS_TYPE_CONTROL(pbyFrame)) { p802_11Header = (PS802_11Header) (pbyFrame); // get SA NodeIndex - if (BSSDBbIsSTAInNodeDB(pMgmt, (PBYTE)(p802_11Header->abyAddr2), &iSANodeIndex)) { + if (BSSDBbIsSTAInNodeDB(pMgmt, (unsigned char *)(p802_11Header->abyAddr2), &iSANodeIndex)) { pMgmt->sNodeDBTable[iSANodeIndex].ulLastRxJiffer = jiffies; pMgmt->sNodeDBTable[iSANodeIndex].uInActiveCount = 0; } @@ -490,17 +470,17 @@ device_receive_frame ( } if (pMgmt->eCurrMode == WMAC_MODE_ESS_AP) { - if (s_bAPModeRxCtl(pDevice, pbyFrame, iSANodeIndex) == TRUE) { - return FALSE; + if (s_bAPModeRxCtl(pDevice, pbyFrame, iSANodeIndex) == true) { + return false; } } if (IS_FC_WEP(pbyFrame)) { - BOOL bRxDecryOK = FALSE; + bool bRxDecryOK = false; DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"rx WEP pkt\n"); - bIsWEP = TRUE; + bIsWEP = true; if ((pDevice->bEnableHostWEP) && (iSANodeIndex >= 0)) { pKey = &STempKey; pKey->byCipherSuite = pMgmt->sNodeDBTable[iSANodeIndex].byCipherSuite; @@ -552,11 +532,11 @@ device_receive_frame ( // pDevice->s802_11Counter.WEPICVErrorCount.QuadPart++; } } - return FALSE; + return false; } } else { DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"WEP Func Fail\n"); - return FALSE; + return false; } if ((pKey != NULL) && (pKey->byCipherSuite == KEY_CTL_CCMP)) FrameSize -= 8; // Message Integrity Code @@ -584,18 +564,18 @@ device_receive_frame ( } else { - return FALSE; + return false; } } // Management & Control frame Handle - if ((IS_TYPE_DATA((skb->data+4))) == FALSE) { + if ((IS_TYPE_DATA((skb->data+4))) == false) { // Handle Control & Manage Frame if (IS_TYPE_MGMT((skb->data+4))) { - PBYTE pbyData1; - PBYTE pbyData2; + unsigned char *pbyData1; + unsigned char *pbyData2; pRxPacket->p80211Header = (PUWLAN_80211HDR)(skb->data+4); pRxPacket->cbMPDULen = FrameSize; @@ -649,13 +629,13 @@ device_receive_frame ( skb->protocol = htons(ETH_P_802_2); memset(skb->cb, 0, sizeof(skb->cb)); netif_rx(skb); - return TRUE; + return true; } } else { // Control Frame }; - return FALSE; + return false; } else { if (pMgmt->eCurrMode == WMAC_MODE_ESS_AP) { @@ -667,12 +647,12 @@ device_receive_frame ( pDevice->dev->name); } } - return FALSE; + return false; } } else { // discard DATA packet while not associate || BSSID error - if ((pDevice->bLinkPass == FALSE) || + if ((pDevice->bLinkPass == false) || !(*pbyRsr & RSR_BSSIDOK)) { if (bDeFragRx) { if (!device_alloc_frag_buf(pDevice, &pDevice->sRxDFCB[pDevice->uCurrentDFCBIdx])) { @@ -680,12 +660,12 @@ device_receive_frame ( pDevice->dev->name); } } - return FALSE; + return false; } //mike add:station mode check eapol-key challenge---> { - BYTE Protocol_Version; //802.1x Authentication - BYTE Packet_Type; //802.1x Authentication + unsigned char Protocol_Version; //802.1x Authentication + unsigned char Packet_Type; //802.1x Authentication if (bIsWEP) cbIVOffset = 8; else @@ -697,7 +677,7 @@ device_receive_frame ( if (wEtherType == ETH_P_PAE) { //Protocol Type in LLC-Header if(((Protocol_Version==1) ||(Protocol_Version==2)) && (Packet_Type==3)) { //802.1x OR eapol-key challenge frame receive - bRxeapol_key = TRUE; + bRxeapol_key = true; } } } @@ -716,8 +696,8 @@ device_receive_frame ( } } else { - if (pDevice->pMgmt->bInTIMWake == TRUE) { - pDevice->pMgmt->bInTIMWake = FALSE; + if (pDevice->pMgmt->bInTIMWake == true) { + pDevice->pMgmt->bInTIMWake = false; } } }; @@ -725,7 +705,7 @@ device_receive_frame ( // Now it only supports 802.11g Infrastructure Mode, and support rate must up to 54 Mbps if (pDevice->bDiversityEnable && (FrameSize>50) && (pDevice->eOPMode == OP_MODE_INFRASTRUCTURE) && - (pDevice->bLinkPass == TRUE)) { + (pDevice->bLinkPass == true)) { //printk("device_receive_frame: RxRate is %d\n",*pbyRxRate); BBvAntennaDiversity(pDevice, s_byGetRateIdx(*pbyRxRate), 0); } @@ -752,8 +732,8 @@ device_receive_frame ( // ----------------------------------------------- - if ((pMgmt->eCurrMode == WMAC_MODE_ESS_AP) && (pDevice->bEnable8021x == TRUE)){ - BYTE abyMacHdr[24]; + if ((pMgmt->eCurrMode == WMAC_MODE_ESS_AP) && (pDevice->bEnable8021x == true)){ + unsigned char abyMacHdr[24]; // Only 802.1x packet incoming allowed if (bIsWEP) @@ -767,7 +747,7 @@ device_receive_frame ( if (wEtherType == ETH_P_PAE) { skb->dev = pDevice->apdev; - if (bIsWEP == TRUE) { + if (bIsWEP == true) { // strip IV header(8) memcpy(&abyMacHdr[0], (skb->data + 4), 24); memcpy((skb->data + 4 + cbIVOffset), &abyMacHdr[0], 24); @@ -781,12 +761,12 @@ device_receive_frame ( skb->protocol = htons(ETH_P_802_2); memset(skb->cb, 0, sizeof(skb->cb)); netif_rx(skb); - return TRUE; + return true; } // check if 802.1x authorized if (!(pMgmt->sNodeDBTable[iSANodeIndex].dwFlags & WLAN_STA_AUTHORIZED)) - return FALSE; + return false; } @@ -800,53 +780,53 @@ device_receive_frame ( // Soft MIC if ((pKey != NULL) && (pKey->byCipherSuite == KEY_CTL_TKIP)) { if (bIsWEP) { - PDWORD pdwMIC_L; - PDWORD pdwMIC_R; - DWORD dwMIC_Priority; - DWORD dwMICKey0 = 0, dwMICKey1 = 0; - DWORD dwLocalMIC_L = 0; - DWORD dwLocalMIC_R = 0; + unsigned long *pdwMIC_L; + unsigned long *pdwMIC_R; + unsigned long dwMIC_Priority; + unsigned long dwMICKey0 = 0, dwMICKey1 = 0; + unsigned long dwLocalMIC_L = 0; + unsigned long dwLocalMIC_R = 0; viawget_wpa_header *wpahdr; if (pMgmt->eCurrMode == WMAC_MODE_ESS_AP) { - dwMICKey0 = cpu_to_le32(*(PDWORD)(&pKey->abyKey[24])); - dwMICKey1 = cpu_to_le32(*(PDWORD)(&pKey->abyKey[28])); + dwMICKey0 = cpu_to_le32(*(unsigned long *)(&pKey->abyKey[24])); + dwMICKey1 = cpu_to_le32(*(unsigned long *)(&pKey->abyKey[28])); } else { if (pDevice->pMgmt->eAuthenMode == WMAC_AUTH_WPANONE) { - dwMICKey0 = cpu_to_le32(*(PDWORD)(&pKey->abyKey[16])); - dwMICKey1 = cpu_to_le32(*(PDWORD)(&pKey->abyKey[20])); + dwMICKey0 = cpu_to_le32(*(unsigned long *)(&pKey->abyKey[16])); + dwMICKey1 = cpu_to_le32(*(unsigned long *)(&pKey->abyKey[20])); } else if ((pKey->dwKeyIndex & BIT28) == 0) { - dwMICKey0 = cpu_to_le32(*(PDWORD)(&pKey->abyKey[16])); - dwMICKey1 = cpu_to_le32(*(PDWORD)(&pKey->abyKey[20])); + dwMICKey0 = cpu_to_le32(*(unsigned long *)(&pKey->abyKey[16])); + dwMICKey1 = cpu_to_le32(*(unsigned long *)(&pKey->abyKey[20])); } else { - dwMICKey0 = cpu_to_le32(*(PDWORD)(&pKey->abyKey[24])); - dwMICKey1 = cpu_to_le32(*(PDWORD)(&pKey->abyKey[28])); + dwMICKey0 = cpu_to_le32(*(unsigned long *)(&pKey->abyKey[24])); + dwMICKey1 = cpu_to_le32(*(unsigned long *)(&pKey->abyKey[28])); } } MIC_vInit(dwMICKey0, dwMICKey1); - MIC_vAppend((PBYTE)&(pDevice->sRxEthHeader.abyDstAddr[0]), 12); + MIC_vAppend((unsigned char *)&(pDevice->sRxEthHeader.abyDstAddr[0]), 12); dwMIC_Priority = 0; - MIC_vAppend((PBYTE)&dwMIC_Priority, 4); + MIC_vAppend((unsigned char *)&dwMIC_Priority, 4); // 4 is Rcv buffer header, 24 is MAC Header, and 8 is IV and Ext IV. - MIC_vAppend((PBYTE)(skb->data + 4 + WLAN_HDR_ADDR3_LEN + 8), + MIC_vAppend((unsigned char *)(skb->data + 4 + WLAN_HDR_ADDR3_LEN + 8), FrameSize - WLAN_HDR_ADDR3_LEN - 8); MIC_vGetMIC(&dwLocalMIC_L, &dwLocalMIC_R); MIC_vUnInit(); - pdwMIC_L = (PDWORD)(skb->data + 4 + FrameSize); - pdwMIC_R = (PDWORD)(skb->data + 4 + FrameSize + 4); + pdwMIC_L = (unsigned long *)(skb->data + 4 + FrameSize); + pdwMIC_R = (unsigned long *)(skb->data + 4 + FrameSize + 4); //DBG_PRN_GRP12(("RxL: %lx, RxR: %lx\n", *pdwMIC_L, *pdwMIC_R)); //DBG_PRN_GRP12(("LocalL: %lx, LocalR: %lx\n", dwLocalMIC_L, dwLocalMIC_R)); //DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"dwMICKey0= %lx,dwMICKey1= %lx \n", dwMICKey0, dwMICKey1); if ((cpu_to_le32(*pdwMIC_L) != dwLocalMIC_L) || (cpu_to_le32(*pdwMIC_R) != dwLocalMIC_R) || - (pDevice->bRxMICFail == TRUE)) { + (pDevice->bRxMICFail == true)) { DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"MIC comparison is fail!\n"); - pDevice->bRxMICFail = FALSE; + pDevice->bRxMICFail = false; //pDevice->s802_11Counter.TKIPLocalMICFailures.QuadPart++; pDevice->s802_11Counter.TKIPLocalMICFailures++; if (bDeFragRx) { @@ -858,7 +838,7 @@ device_receive_frame ( //2008-0409-07, <Add> by Einsn Liu #ifdef WPA_SUPPLICANT_DRIVER_WEXT_SUPPORT //send event to wpa_supplicant - //if(pDevice->bWPADevEnable == TRUE) + //if(pDevice->bWPADevEnable == true) { union iwreq_data wrqu; struct iw_michaelmicfailure ev; @@ -906,7 +886,7 @@ device_receive_frame ( pDevice->skb = dev_alloc_skb((int)pDevice->rx_buf_sz); }; - return FALSE; + return false; } } @@ -917,13 +897,13 @@ device_receive_frame ( if ((pKey != NULL) && ((pKey->byCipherSuite == KEY_CTL_TKIP) || (pKey->byCipherSuite == KEY_CTL_CCMP))) { if (bIsWEP) { - WORD wLocalTSC15_0 = 0; - DWORD dwLocalTSC47_16 = 0; - ULONGLONG RSC = 0; + unsigned short wLocalTSC15_0 = 0; + unsigned long dwLocalTSC47_16 = 0; + unsigned long long RSC = 0; // endian issues - RSC = *((ULONGLONG *) &(pKey->KeyRSC)); - wLocalTSC15_0 = (WORD) RSC; - dwLocalTSC47_16 = (DWORD) (RSC>>16); + RSC = *((unsigned long long *) &(pKey->KeyRSC)); + wLocalTSC15_0 = (unsigned short) RSC; + dwLocalTSC47_16 = (unsigned long) (RSC>>16); RSC = dwRxTSC47_16; RSC <<= 16; @@ -950,7 +930,7 @@ device_receive_frame ( pDevice->dev->name); } } - return FALSE; + return false; } } } @@ -963,13 +943,13 @@ device_receive_frame ( } - s_vProcessRxMACHeader(pDevice, (PBYTE)(skb->data+4), FrameSize, bIsWEP, bExtIV, &cbHeaderOffset); + s_vProcessRxMACHeader(pDevice, (unsigned char *)(skb->data+4), FrameSize, bIsWEP, bExtIV, &cbHeaderOffset); FrameSize -= cbHeaderOffset; cbHeaderOffset += 4; // 4 is Rcv buffer header // Null data, framesize = 14 if (FrameSize < 15) - return FALSE; + return false; if (pMgmt->eCurrMode == WMAC_MODE_ESS_AP) { if (s_bAPModeRxData(pDevice, @@ -978,7 +958,7 @@ device_receive_frame ( cbHeaderOffset, iSANodeIndex, iDANodeIndex - ) == FALSE) { + ) == false) { if (bDeFragRx) { if (!device_alloc_frag_buf(pDevice, &pDevice->sRxDFCB[pDevice->uCurrentDFCBIdx])) { @@ -986,10 +966,10 @@ device_receive_frame ( pDevice->dev->name); } } - return FALSE; + return false; } -// if(pDevice->bRxMICFail == FALSE) { +// if(pDevice->bRxMICFail == false) { // for (ii =0; ii < 100; ii++) // printk(" %02x", *(skb->data + ii)); // printk("\n"); @@ -1016,7 +996,7 @@ device_receive_frame ( pDevice->dev->name); } } - return FALSE; + return false; } } */ @@ -1031,17 +1011,17 @@ device_receive_frame ( DBG_PRT(MSG_LEVEL_ERR,KERN_ERR "%s: can not alloc more frag bufs\n", pDevice->dev->name); } - return FALSE; + return false; } - return TRUE; + return true; } -static BOOL s_bAPModeRxCtl ( +static bool s_bAPModeRxCtl ( PSDevice pDevice, - PBYTE pbyFrame, - INT iSANodeIndex + unsigned char *pbyFrame, + int iSANodeIndex ) { PS802_11Header p802_11Header; @@ -1063,30 +1043,30 @@ static BOOL s_bAPModeRxCtl ( // reason = (6) class 2 received from nonauth sta vMgrDeAuthenBeginSta(pDevice, pMgmt, - (PBYTE)(p802_11Header->abyAddr2), + (unsigned char *)(p802_11Header->abyAddr2), (WLAN_MGMT_REASON_CLASS2_NONAUTH), &Status ); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "dpc: send vMgrDeAuthenBeginSta 1\n"); - return TRUE; + return true; }; if (pMgmt->sNodeDBTable[iSANodeIndex].eNodeState < NODE_ASSOC) { // send deassoc notification // reason = (7) class 3 received from nonassoc sta vMgrDisassocBeginSta(pDevice, pMgmt, - (PBYTE)(p802_11Header->abyAddr2), + (unsigned char *)(p802_11Header->abyAddr2), (WLAN_MGMT_REASON_CLASS3_NONASSOC), &Status ); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "dpc: send vMgrDisassocBeginSta 2\n"); - return TRUE; + return true; }; if (pMgmt->sNodeDBTable[iSANodeIndex].bPSEnable) { // delcare received ps-poll event if (IS_CTL_PSPOLL(pbyFrame)) { - pMgmt->sNodeDBTable[iSANodeIndex].bRxPSPoll = TRUE; + pMgmt->sNodeDBTable[iSANodeIndex].bRxPSPoll = true; bScheduleCommand((void *)pDevice, WLAN_CMD_RX_PSPOLL, NULL); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "dpc: WLAN_CMD_RX_PSPOLL 1\n"); } @@ -1094,8 +1074,8 @@ static BOOL s_bAPModeRxCtl ( // check Data PS state // if PW bit off, send out all PS bufferring packets. if (!IS_FC_POWERMGT(pbyFrame)) { - pMgmt->sNodeDBTable[iSANodeIndex].bPSEnable = FALSE; - pMgmt->sNodeDBTable[iSANodeIndex].bRxPSPoll = TRUE; + pMgmt->sNodeDBTable[iSANodeIndex].bPSEnable = false; + pMgmt->sNodeDBTable[iSANodeIndex].bRxPSPoll = true; bScheduleCommand((void *)pDevice, WLAN_CMD_RX_PSPOLL, NULL); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "dpc: WLAN_CMD_RX_PSPOLL 2\n"); } @@ -1103,15 +1083,15 @@ static BOOL s_bAPModeRxCtl ( } else { if (IS_FC_POWERMGT(pbyFrame)) { - pMgmt->sNodeDBTable[iSANodeIndex].bPSEnable = TRUE; + pMgmt->sNodeDBTable[iSANodeIndex].bPSEnable = true; // Once if STA in PS state, enable multicast bufferring - pMgmt->sNodeDBTable[0].bPSEnable = TRUE; + pMgmt->sNodeDBTable[0].bPSEnable = true; } else { // clear all pending PS frame. if (pMgmt->sNodeDBTable[iSANodeIndex].wEnQueueCnt > 0) { - pMgmt->sNodeDBTable[iSANodeIndex].bPSEnable = FALSE; - pMgmt->sNodeDBTable[iSANodeIndex].bRxPSPoll = TRUE; + pMgmt->sNodeDBTable[iSANodeIndex].bPSEnable = false; + pMgmt->sNodeDBTable[iSANodeIndex].bRxPSPoll = true; bScheduleCommand((void *)pDevice, WLAN_CMD_RX_PSPOLL, NULL); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "dpc: WLAN_CMD_RX_PSPOLL 3\n"); @@ -1122,7 +1102,7 @@ static BOOL s_bAPModeRxCtl ( else { vMgrDeAuthenBeginSta(pDevice, pMgmt, - (PBYTE)(p802_11Header->abyAddr2), + (unsigned char *)(p802_11Header->abyAddr2), (WLAN_MGMT_REASON_CLASS2_NONAUTH), &Status ); @@ -1154,31 +1134,31 @@ static BOOL s_bAPModeRxCtl ( DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "dpc: wFrameCtl= %x\n", p802_11Header->wFrameCtl ); VNSvInPortB(pDevice->PortOffset + MAC_REG_RCR, &(pDevice->byRxMode)); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "dpc:pDevice->byRxMode = %x\n", pDevice->byRxMode ); - return TRUE; + return true; } } } - return FALSE; + return false; } -static BOOL s_bHandleRxEncryption ( +static bool s_bHandleRxEncryption ( PSDevice pDevice, - PBYTE pbyFrame, - UINT FrameSize, - PBYTE pbyRsr, - PBYTE pbyNewRsr, + unsigned char *pbyFrame, + unsigned int FrameSize, + unsigned char *pbyRsr, + unsigned char *pbyNewRsr, PSKeyItem *pKeyOut, - int * pbExtIV, - PWORD pwRxTSC15_0, - PDWORD pdwRxTSC47_16 + bool *pbExtIV, + unsigned short *pwRxTSC15_0, + unsigned long *pdwRxTSC47_16 ) { - UINT PayloadLen = FrameSize; - PBYTE pbyIV; - BYTE byKeyIdx; + unsigned int PayloadLen = FrameSize; + unsigned char *pbyIV; + unsigned char byKeyIdx; PSKeyItem pKey = NULL; - BYTE byDecMode = KEY_CTL_WEP; + unsigned char byDecMode = KEY_CTL_WEP; PSMgmtObject pMgmt = pDevice->pMgmt; @@ -1186,8 +1166,8 @@ static BOOL s_bHandleRxEncryption ( *pdwRxTSC47_16 = 0; pbyIV = pbyFrame + WLAN_HDR_ADDR3_LEN; - if ( WLAN_GET_FC_TODS(*(PWORD)pbyFrame) && - WLAN_GET_FC_FROMDS(*(PWORD)pbyFrame) ) { + if ( WLAN_GET_FC_TODS(*(unsigned short *)pbyFrame) && + WLAN_GET_FC_FROMDS(*(unsigned short *)pbyFrame) ) { pbyIV += 6; // 6 is 802.11 address4 PayloadLen -= 6; } @@ -1204,7 +1184,7 @@ static BOOL s_bHandleRxEncryption ( (pDevice->pMgmt->byCSSPK != KEY_CTL_NONE)) { // unicast pkt use pairwise key DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"unicast pkt\n"); - if (KeybGetKey(&(pDevice->sKey), pDevice->abyBSSID, 0xFFFFFFFF, &pKey) == TRUE) { + if (KeybGetKey(&(pDevice->sKey), pDevice->abyBSSID, 0xFFFFFFFF, &pKey) == true) { if (pDevice->pMgmt->byCSSPK == KEY_CTL_TKIP) byDecMode = KEY_CTL_TKIP; else if (pDevice->pMgmt->byCSSPK == KEY_CTL_CCMP) @@ -1238,24 +1218,24 @@ static BOOL s_bHandleRxEncryption ( DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"pKey == NULL\n"); if (byDecMode == KEY_CTL_WEP) { // pDevice->s802_11Counter.WEPUndecryptableCount.QuadPart++; - } else if (pDevice->bLinkPass == TRUE) { + } else if (pDevice->bLinkPass == true) { // pDevice->s802_11Counter.DecryptFailureCount.QuadPart++; } - return FALSE; + return false; } if (byDecMode != pKey->byCipherSuite) { if (byDecMode == KEY_CTL_WEP) { // pDevice->s802_11Counter.WEPUndecryptableCount.QuadPart++; - } else if (pDevice->bLinkPass == TRUE) { + } else if (pDevice->bLinkPass == true) { // pDevice->s802_11Counter.DecryptFailureCount.QuadPart++; } *pKeyOut = NULL; - return FALSE; + return false; } if (byDecMode == KEY_CTL_WEP) { // handle WEP if ((pDevice->byLocalID <= REV_ID_VT3253_A1) || - (((PSKeyTable)(pKey->pvKeyTable))->bSoftWEP == TRUE)) { + (((PSKeyTable)(pKey->pvKeyTable))->bSoftWEP == true)) { // Software WEP // 1. 3253A // 2. WEP 256 @@ -1275,12 +1255,12 @@ static BOOL s_bHandleRxEncryption ( // TKIP/AES PayloadLen -= (WLAN_HDR_ADDR3_LEN + 8 + 4); // 24 is 802.11 header, 8 is IV&ExtIV, 4 is crc - *pdwRxTSC47_16 = cpu_to_le32(*(PDWORD)(pbyIV + 4)); + *pdwRxTSC47_16 = cpu_to_le32(*(unsigned long *)(pbyIV + 4)); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"ExtIV: %lx\n",*pdwRxTSC47_16); if (byDecMode == KEY_CTL_TKIP) { *pwRxTSC15_0 = cpu_to_le16(MAKEWORD(*(pbyIV+2), *pbyIV)); } else { - *pwRxTSC15_0 = cpu_to_le16(*(PWORD)pbyIV); + *pwRxTSC15_0 = cpu_to_le16(*(unsigned short *)pbyIV); } DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"TSC0_15: %x\n", *pwRxTSC15_0); @@ -1303,28 +1283,28 @@ static BOOL s_bHandleRxEncryption ( }// end of TKIP/AES if ((*(pbyIV+3) & 0x20) != 0) - *pbExtIV = TRUE; - return TRUE; + *pbExtIV = true; + return true; } -static BOOL s_bHostWepRxEncryption ( +static bool s_bHostWepRxEncryption ( PSDevice pDevice, - PBYTE pbyFrame, - UINT FrameSize, - PBYTE pbyRsr, - BOOL bOnFly, + unsigned char *pbyFrame, + unsigned int FrameSize, + unsigned char *pbyRsr, + bool bOnFly, PSKeyItem pKey, - PBYTE pbyNewRsr, - int * pbExtIV, - PWORD pwRxTSC15_0, - PDWORD pdwRxTSC47_16 + unsigned char *pbyNewRsr, + bool *pbExtIV, + unsigned short *pwRxTSC15_0, + unsigned long *pdwRxTSC47_16 ) { - UINT PayloadLen = FrameSize; - PBYTE pbyIV; - BYTE byKeyIdx; - BYTE byDecMode = KEY_CTL_WEP; + unsigned int PayloadLen = FrameSize; + unsigned char *pbyIV; + unsigned char byKeyIdx; + unsigned char byDecMode = KEY_CTL_WEP; PS802_11Header pMACHeader; @@ -1333,8 +1313,8 @@ static BOOL s_bHostWepRxEncryption ( *pdwRxTSC47_16 = 0; pbyIV = pbyFrame + WLAN_HDR_ADDR3_LEN; - if ( WLAN_GET_FC_TODS(*(PWORD)pbyFrame) && - WLAN_GET_FC_FROMDS(*(PWORD)pbyFrame) ) { + if ( WLAN_GET_FC_TODS(*(unsigned short *)pbyFrame) && + WLAN_GET_FC_FROMDS(*(unsigned short *)pbyFrame) ) { pbyIV += 6; // 6 is 802.11 address4 PayloadLen -= 6; } @@ -1353,18 +1333,18 @@ static BOOL s_bHostWepRxEncryption ( if (byDecMode != pKey->byCipherSuite) { if (byDecMode == KEY_CTL_WEP) { // pDevice->s802_11Counter.WEPUndecryptableCount.QuadPart++; - } else if (pDevice->bLinkPass == TRUE) { + } else if (pDevice->bLinkPass == true) { // pDevice->s802_11Counter.DecryptFailureCount.QuadPart++; } - return FALSE; + return false; } if (byDecMode == KEY_CTL_WEP) { // handle WEP DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"byDecMode == KEY_CTL_WEP \n"); if ((pDevice->byLocalID <= REV_ID_VT3253_A1) || - (((PSKeyTable)(pKey->pvKeyTable))->bSoftWEP == TRUE) || - (bOnFly == FALSE)) { + (((PSKeyTable)(pKey->pvKeyTable))->bSoftWEP == true) || + (bOnFly == false)) { // Software WEP // 1. 3253A // 2. WEP 256 @@ -1385,19 +1365,19 @@ static BOOL s_bHostWepRxEncryption ( // TKIP/AES PayloadLen -= (WLAN_HDR_ADDR3_LEN + 8 + 4); // 24 is 802.11 header, 8 is IV&ExtIV, 4 is crc - *pdwRxTSC47_16 = cpu_to_le32(*(PDWORD)(pbyIV + 4)); + *pdwRxTSC47_16 = cpu_to_le32(*(unsigned long *)(pbyIV + 4)); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"ExtIV: %lx\n",*pdwRxTSC47_16); if (byDecMode == KEY_CTL_TKIP) { *pwRxTSC15_0 = cpu_to_le16(MAKEWORD(*(pbyIV+2), *pbyIV)); } else { - *pwRxTSC15_0 = cpu_to_le16(*(PWORD)pbyIV); + *pwRxTSC15_0 = cpu_to_le16(*(unsigned short *)pbyIV); } DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"TSC0_15: %x\n", *pwRxTSC15_0); if (byDecMode == KEY_CTL_TKIP) { - if ((pDevice->byLocalID <= REV_ID_VT3253_A1) || (bOnFly == FALSE)) { + if ((pDevice->byLocalID <= REV_ID_VT3253_A1) || (bOnFly == false)) { // Software TKIP // 1. 3253 A // 2. NotOnFly @@ -1417,7 +1397,7 @@ static BOOL s_bHostWepRxEncryption ( } if (byDecMode == KEY_CTL_CCMP) { - if (bOnFly == FALSE) { + if (bOnFly == false) { // Software CCMP // NotOnFly DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"soft KEY_CTL_CCMP\n"); @@ -1433,34 +1413,34 @@ static BOOL s_bHostWepRxEncryption ( }// end of TKIP/AES if ((*(pbyIV+3) & 0x20) != 0) - *pbExtIV = TRUE; - return TRUE; + *pbExtIV = true; + return true; } -static BOOL s_bAPModeRxData ( +static bool s_bAPModeRxData ( PSDevice pDevice, struct sk_buff* skb, - UINT FrameSize, - UINT cbHeaderOffset, - INT iSANodeIndex, - INT iDANodeIndex + unsigned int FrameSize, + unsigned int cbHeaderOffset, + int iSANodeIndex, + int iDANodeIndex ) { PSMgmtObject pMgmt = pDevice->pMgmt; - BOOL bRelayAndForward = FALSE; - BOOL bRelayOnly = FALSE; - BYTE byMask[8] = {1, 2, 4, 8, 0x10, 0x20, 0x40, 0x80}; - WORD wAID; + bool bRelayAndForward = false; + bool bRelayOnly = false; + unsigned char byMask[8] = {1, 2, 4, 8, 0x10, 0x20, 0x40, 0x80}; + unsigned short wAID; struct sk_buff* skbcpy = NULL; if (FrameSize > CB_MAX_BUF_SIZE) - return FALSE; + return false; // check DA - if(IS_MULTICAST_ADDRESS((PBYTE)(skb->data+cbHeaderOffset))) { + if(is_multicast_ether_addr((unsigned char *)(skb->data+cbHeaderOffset))) { if (pMgmt->sNodeDBTable[0].bPSEnable) { skbcpy = dev_alloc_skb((int)pDevice->rx_buf_sz); @@ -1481,12 +1461,12 @@ static BOOL s_bAPModeRxData ( } } else { - bRelayAndForward = TRUE; + bRelayAndForward = true; } } else { // check if relay - if (BSSDBbIsSTAInNodeDB(pMgmt, (PBYTE)(skb->data+cbHeaderOffset), &iDANodeIndex)) { + if (BSSDBbIsSTAInNodeDB(pMgmt, (unsigned char *)(skb->data+cbHeaderOffset), &iDANodeIndex)) { if (pMgmt->sNodeDBTable[iDANodeIndex].eNodeState >= NODE_ASSOC) { if (pMgmt->sNodeDBTable[iDANodeIndex].bPSEnable) { // queue this skb until next PS tx, and then release. @@ -1500,10 +1480,10 @@ static BOOL s_bAPModeRxData ( pMgmt->abyPSTxMap[wAID >> 3] |= byMask[wAID & 7]; DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "relay: index= %d, pMgmt->abyPSTxMap[%d]= %d\n", iDANodeIndex, (wAID >> 3), pMgmt->abyPSTxMap[wAID >> 3]); - return TRUE; + return true; } else { - bRelayOnly = TRUE; + bRelayOnly = true; } } }; @@ -1515,16 +1495,16 @@ static BOOL s_bAPModeRxData ( iDANodeIndex = 0; if ((pDevice->uAssocCount > 1) && (iDANodeIndex >= 0)) { - ROUTEbRelay(pDevice, (PBYTE)(skb->data + cbHeaderOffset), FrameSize, (UINT)iDANodeIndex); + ROUTEbRelay(pDevice, (unsigned char *)(skb->data + cbHeaderOffset), FrameSize, (unsigned int)iDANodeIndex); } if (bRelayOnly) - return FALSE; + return false; } // none associate, don't forward if (pDevice->uAssocCount == 0) - return FALSE; + return false; - return TRUE; + return true; } diff --git a/drivers/staging/vt6655/dpc.h b/drivers/staging/vt6655/dpc.h index e574963fee0..c1b6e76a421 100644 --- a/drivers/staging/vt6655/dpc.h +++ b/drivers/staging/vt6655/dpc.h @@ -41,7 +41,7 @@ /*--------------------- Export Functions --------------------------*/ -BOOL +bool device_receive_frame ( PSDevice pDevice, PSRxDesc pCurrRD diff --git a/drivers/staging/vt6655/hostap.c b/drivers/staging/vt6655/hostap.c index 195cc36654a..5b83f942cda 100644 --- a/drivers/staging/vt6655/hostap.c +++ b/drivers/staging/vt6655/hostap.c @@ -154,9 +154,9 @@ static int hostap_disable_hostapd(PSDevice pDevice, int rtnl_locked) } kfree(pDevice->apdev); pDevice->apdev = NULL; - pDevice->bEnable8021x = FALSE; - pDevice->bEnableHostWEP = FALSE; - pDevice->bEncryptionEnable = FALSE; + pDevice->bEnable8021x = false; + pDevice->bEnableHostWEP = false; + pDevice->bEncryptionEnable = false; //4.2007-0118-03,<Add> by EinsnLiu //execute some clear work @@ -215,7 +215,7 @@ int vt6655_hostap_set_hostapd(PSDevice pDevice, int val, int rtnl_locked) static int hostap_remove_sta(PSDevice pDevice, struct viawget_hostapd_param *param) { - UINT uNodeIndex; + unsigned int uNodeIndex; if (BSSDBbIsSTAInNodeDB(pDevice->pMgmt, param->sta_addr, &uNodeIndex)) { @@ -244,7 +244,7 @@ static int hostap_add_sta(PSDevice pDevice, struct viawget_hostapd_param *param) { PSMgmtObject pMgmt = pDevice->pMgmt; - UINT uNodeIndex; + unsigned int uNodeIndex; if (!BSSDBbIsSTAInNodeDB(pMgmt, param->sta_addr, &uNodeIndex)) { @@ -255,7 +255,7 @@ static int hostap_add_sta(PSDevice pDevice, pMgmt->sNodeDBTable[uNodeIndex].wCapInfo = param->u.add_sta.capability; // TODO listenInterval // pMgmt->sNodeDBTable[uNodeIndex].wListenInterval = 1; - pMgmt->sNodeDBTable[uNodeIndex].bPSEnable = FALSE; + pMgmt->sNodeDBTable[uNodeIndex].bPSEnable = false; pMgmt->sNodeDBTable[uNodeIndex].bySuppRate = param->u.add_sta.tx_supp_rates; // set max tx rate @@ -267,7 +267,7 @@ static int hostap_add_sta(PSDevice pDevice, pMgmt->sNodeDBTable[uNodeIndex].bShortPreamble = WLAN_GET_CAP_INFO_SHORTPREAMBLE(pMgmt->sNodeDBTable[uNodeIndex].wCapInfo); - pMgmt->sNodeDBTable[uNodeIndex].wAID = (WORD)param->u.add_sta.aid; + pMgmt->sNodeDBTable[uNodeIndex].wAID = (unsigned short)param->u.add_sta.aid; pMgmt->sNodeDBTable[uNodeIndex].ulLastRxJiffer = jiffies; @@ -304,7 +304,7 @@ static int hostap_get_info_sta(PSDevice pDevice, struct viawget_hostapd_param *param) { PSMgmtObject pMgmt = pDevice->pMgmt; - UINT uNodeIndex; + unsigned int uNodeIndex; if (BSSDBbIsSTAInNodeDB(pMgmt, param->sta_addr, &uNodeIndex)) { param->u.get_info_sta.inactive_sec = @@ -328,7 +328,7 @@ static int hostap_get_info_sta(PSDevice pDevice, * pDevice - * param - * Out: - * TURE, FALSE + * true, false * * Return Value: * @@ -338,7 +338,7 @@ static int hostap_reset_txexc_sta(PSDevice pDevice, struct viawget_hostapd_param *param) { PSMgmtObject pMgmt = pDevice->pMgmt; - UINT uNodeIndex; + unsigned int uNodeIndex; if (BSSDBbIsSTAInNodeDB(pMgmt, param->sta_addr, &uNodeIndex)) { pMgmt->sNodeDBTable[uNodeIndex].uTxAttempts = 0; @@ -368,13 +368,13 @@ static int hostap_set_flags_sta(PSDevice pDevice, struct viawget_hostapd_param *param) { PSMgmtObject pMgmt = pDevice->pMgmt; - UINT uNodeIndex; + unsigned int uNodeIndex; if (BSSDBbIsSTAInNodeDB(pMgmt, param->sta_addr, &uNodeIndex)) { pMgmt->sNodeDBTable[uNodeIndex].dwFlags |= param->u.set_flags_sta.flags_or; pMgmt->sNodeDBTable[uNodeIndex].dwFlags &= param->u.set_flags_sta.flags_and; DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO " dwFlags = %x \n", - (UINT)pMgmt->sNodeDBTable[uNodeIndex].dwFlags); + (unsigned int)pMgmt->sNodeDBTable[uNodeIndex].dwFlags); } else { return -ENOENT; @@ -471,16 +471,16 @@ static int hostap_set_encryption(PSDevice pDevice, int param_len) { PSMgmtObject pMgmt = pDevice->pMgmt; - DWORD dwKeyIndex = 0; - BYTE abyKey[MAX_KEY_LEN]; - BYTE abySeq[MAX_KEY_LEN]; + unsigned long dwKeyIndex = 0; + unsigned char abyKey[MAX_KEY_LEN]; + unsigned char abySeq[MAX_KEY_LEN]; NDIS_802_11_KEY_RSC KeyRSC; - BYTE byKeyDecMode = KEY_CTL_WEP; + unsigned char byKeyDecMode = KEY_CTL_WEP; int ret = 0; int iNodeIndex = -1; int ii; - BOOL bKeyTableFull = FALSE; - WORD wKeyCtl = 0; + bool bKeyTableFull = false; + unsigned short wKeyCtl = 0; param->u.crypt.err = 0; @@ -509,7 +509,7 @@ static int hostap_set_encryption(PSDevice pDevice, iNodeIndex = 0; } else { - if (BSSDBbIsSTAInNodeDB(pMgmt, param->sta_addr, &iNodeIndex) == FALSE) { + if (BSSDBbIsSTAInNodeDB(pMgmt, param->sta_addr, &iNodeIndex) == false) { param->u.crypt.err = HOSTAP_CRYPT_ERR_UNKNOWN_ADDR; DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO " HOSTAP_CRYPT_ERR_UNKNOWN_ADDR\n"); return -EINVAL; @@ -520,14 +520,14 @@ static int hostap_set_encryption(PSDevice pDevice, if (param->u.crypt.alg == WPA_ALG_NONE) { - if (pMgmt->sNodeDBTable[iNodeIndex].bOnFly == TRUE) { + if (pMgmt->sNodeDBTable[iNodeIndex].bOnFly == true) { if (KeybRemoveKey(&(pDevice->sKey), param->sta_addr, pMgmt->sNodeDBTable[iNodeIndex].dwKeyIndex, - pDevice->PortOffset) == FALSE) { + pDevice->PortOffset) == false) { DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "KeybRemoveKey fail \n"); } - pMgmt->sNodeDBTable[iNodeIndex].bOnFly = FALSE; + pMgmt->sNodeDBTable[iNodeIndex].bOnFly = false; } pMgmt->sNodeDBTable[iNodeIndex].byKeyIndex = 0; pMgmt->sNodeDBTable[iNodeIndex].dwKeyIndex = 0; @@ -553,16 +553,16 @@ static int hostap_set_encryption(PSDevice pDevice, param->u.crypt.key_len ); - dwKeyIndex = (DWORD)(param->u.crypt.idx); + dwKeyIndex = (unsigned long)(param->u.crypt.idx); if (param->u.crypt.flags & HOSTAP_CRYPT_FLAG_SET_TX_KEY) { - pDevice->byKeyIndex = (BYTE)dwKeyIndex; - pDevice->bTransmitKey = TRUE; + pDevice->byKeyIndex = (unsigned char)dwKeyIndex; + pDevice->bTransmitKey = true; dwKeyIndex |= (1 << 31); } if (param->u.crypt.alg == WPA_ALG_WEP) { - if ((pDevice->bEnable8021x == FALSE) || (iNodeIndex == 0)) { + if ((pDevice->bEnable8021x == false) || (iNodeIndex == 0)) { KeybSetDefaultKey(&(pDevice->sKey), dwKeyIndex & ~(BIT30 | USE_KEYRSC), param->u.crypt.key_len, @@ -580,21 +580,21 @@ static int hostap_set_encryption(PSDevice pDevice, dwKeyIndex & ~(USE_KEYRSC), param->u.crypt.key_len, (PQWORD) &(KeyRSC), - (PBYTE)abyKey, + (unsigned char *)abyKey, KEY_CTL_WEP, pDevice->PortOffset, - pDevice->byLocalID) == TRUE) { + pDevice->byLocalID) == true) { - pMgmt->sNodeDBTable[iNodeIndex].bOnFly = TRUE; + pMgmt->sNodeDBTable[iNodeIndex].bOnFly = true; } else { // Key Table Full - pMgmt->sNodeDBTable[iNodeIndex].bOnFly = FALSE; - bKeyTableFull = TRUE; + pMgmt->sNodeDBTable[iNodeIndex].bOnFly = false; + bKeyTableFull = true; } } pDevice->eEncryptionStatus = Ndis802_11Encryption1Enabled; - pDevice->bEncryptionEnable = TRUE; + pDevice->bEncryptionEnable = true; pMgmt->byCSSPK = KEY_CTL_WEP; pMgmt->byCSSGK = KEY_CTL_WEP; pMgmt->sNodeDBTable[iNodeIndex].byCipherSuite = KEY_CTL_WEP; @@ -640,7 +640,7 @@ static int hostap_set_encryption(PSDevice pDevice, byKeyDecMode, pDevice->PortOffset, pDevice->byLocalID); - pMgmt->sNodeDBTable[iNodeIndex].bOnFly = TRUE; + pMgmt->sNodeDBTable[iNodeIndex].bOnFly = true; } else { dwKeyIndex |= (1 << 30); // set pairwise key @@ -649,23 +649,23 @@ static int hostap_set_encryption(PSDevice pDevice, dwKeyIndex, param->u.crypt.key_len, (PQWORD) &(KeyRSC), - (PBYTE)abyKey, + (unsigned char *)abyKey, byKeyDecMode, pDevice->PortOffset, - pDevice->byLocalID) == TRUE) { + pDevice->byLocalID) == true) { - pMgmt->sNodeDBTable[iNodeIndex].bOnFly = TRUE; + pMgmt->sNodeDBTable[iNodeIndex].bOnFly = true; } else { // Key Table Full - pMgmt->sNodeDBTable[iNodeIndex].bOnFly = FALSE; - bKeyTableFull = TRUE; + pMgmt->sNodeDBTable[iNodeIndex].bOnFly = false; + bKeyTableFull = true; DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO " Key Table Full\n"); } } - if (bKeyTableFull == TRUE) { + if (bKeyTableFull == true) { wKeyCtl &= 0x7F00; // clear all key control filed wKeyCtl |= (byKeyDecMode << 4); wKeyCtl |= (byKeyDecMode); @@ -686,7 +686,7 @@ static int hostap_set_encryption(PSDevice pDevice, ); // set wep key - pDevice->bEncryptionEnable = TRUE; + pDevice->bEncryptionEnable = true; pMgmt->sNodeDBTable[iNodeIndex].byCipherSuite = byKeyDecMode; pMgmt->sNodeDBTable[iNodeIndex].dwKeyIndex = dwKeyIndex; pMgmt->sNodeDBTable[iNodeIndex].dwTSC47_16 = 0; @@ -727,7 +727,7 @@ static int hostap_get_encryption(PSDevice pDevice, param->sta_addr[4] == 0xff && param->sta_addr[5] == 0xff) { iNodeIndex = 0; } else { - if (BSSDBbIsSTAInNodeDB(pMgmt, param->sta_addr, &iNodeIndex) == FALSE) { + if (BSSDBbIsSTAInNodeDB(pMgmt, param->sta_addr, &iNodeIndex) == false) { param->u.crypt.err = HOSTAP_CRYPT_ERR_UNKNOWN_ADDR; DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "hostap_get_encryption: HOSTAP_CRYPT_ERR_UNKNOWN_ADDR\n"); return -EINVAL; @@ -736,7 +736,7 @@ static int hostap_get_encryption(PSDevice pDevice, DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "hostap_get_encryption: %d\n", iNodeIndex); memset(param->u.crypt.seq, 0, 8); for (ii = 0 ; ii < 8 ; ii++) { - param->u.crypt.seq[ii] = (BYTE)pMgmt->sNodeDBTable[iNodeIndex].KeyRSC >> (ii * 8); + param->u.crypt.seq[ii] = (unsigned char)pMgmt->sNodeDBTable[iNodeIndex].KeyRSC >> (ii * 8); } return ret; diff --git a/drivers/staging/vt6655/iocmd.h b/drivers/staging/vt6655/iocmd.h index 60c0a362361..53c50c0fc81 100644 --- a/drivers/staging/vt6655/iocmd.h +++ b/drivers/staging/vt6655/iocmd.h @@ -37,7 +37,6 @@ #define DEF #endif -//typedef int BOOL; //typedef uint32_t u32; //typedef uint16_t u16; //typedef uint8_t u8; @@ -109,10 +108,10 @@ typedef enum tagWZONETYPE { // #pragma pack(1) typedef struct tagSCmdRequest { - U8 name[16]; + u8 name[16]; void *data; - U16 wResult; - U16 wCmdCode; + u16 wResult; + u16 wCmdCode; } SCmdRequest, *PSCmdRequest; // @@ -121,7 +120,7 @@ typedef struct tagSCmdRequest { typedef struct tagSCmdScan { - U8 ssid[SSID_MAXLEN + 2]; + u8 ssid[SSID_MAXLEN + 2]; } SCmdScan, *PSCmdScan; @@ -132,12 +131,12 @@ typedef struct tagSCmdScan { typedef struct tagSCmdBSSJoin { - U16 wBSSType; - U16 wBBPType; - U8 ssid[SSID_MAXLEN + 2]; - U32 uChannel; - BOOL bPSEnable; - BOOL bShareKeyAuth; + u16 wBSSType; + u16 wBBPType; + u8 ssid[SSID_MAXLEN + 2]; + u32 uChannel; + bool bPSEnable; + bool bShareKeyAuth; } SCmdBSSJoin, *PSCmdBSSJoin; @@ -147,7 +146,7 @@ typedef struct tagSCmdBSSJoin { typedef struct tagSCmdZoneTypeSet { - BOOL bWrite; + bool bWrite; WZONETYPE ZoneType; } SCmdZoneTypeSet, *PSCmdZoneTypeSet; @@ -155,33 +154,33 @@ typedef struct tagSCmdZoneTypeSet { #ifdef WPA_SM_Transtatus typedef struct tagSWPAResult { char ifname[100]; - U8 proto; - U8 key_mgmt; - U8 eap_type; - BOOL authenticated; + u8 proto; + u8 key_mgmt; + u8 eap_type; + bool authenticated; } SWPAResult, *PSWPAResult; #endif typedef struct tagSCmdStartAP { - U16 wBSSType; - U16 wBBPType; - U8 ssid[SSID_MAXLEN + 2]; - U32 uChannel; - U32 uBeaconInt; - BOOL bShareKeyAuth; - U8 byBasicRate; + u16 wBSSType; + u16 wBBPType; + u8 ssid[SSID_MAXLEN + 2]; + u32 uChannel; + u32 uBeaconInt; + bool bShareKeyAuth; + u8 byBasicRate; } SCmdStartAP, *PSCmdStartAP; typedef struct tagSCmdSetWEP { - BOOL bEnableWep; - U8 byKeyIndex; - U8 abyWepKey[WEP_NKEYS][WEP_KEYMAXLEN]; - BOOL bWepKeyAvailable[WEP_NKEYS]; - U32 auWepKeyLength[WEP_NKEYS]; + bool bEnableWep; + u8 byKeyIndex; + u8 abyWepKey[WEP_NKEYS][WEP_KEYMAXLEN]; + bool bWepKeyAvailable[WEP_NKEYS]; + u32 auWepKeyLength[WEP_NKEYS]; } SCmdSetWEP, *PSCmdSetWEP; @@ -189,39 +188,39 @@ typedef struct tagSCmdSetWEP { typedef struct tagSBSSIDItem { - U32 uChannel; - U8 abyBSSID[BSSID_LEN]; - U8 abySSID[SSID_MAXLEN + 1]; + u32 uChannel; + u8 abyBSSID[BSSID_LEN]; + u8 abySSID[SSID_MAXLEN + 1]; //2006-1116-01,<Modify> by NomadZhao - //U16 wBeaconInterval; - //U16 wCapInfo; - //U8 byNetType; - U8 byNetType; - U16 wBeaconInterval; - U16 wCapInfo; // for address of byNetType at align 4 + //u16 wBeaconInterval; + //u16 wCapInfo; + //u8 byNetType; + u8 byNetType; + u16 wBeaconInterval; + u16 wCapInfo; // for address of byNetType at align 4 - BOOL bWEPOn; - U32 uRSSI; + bool bWEPOn; + u32 uRSSI; } SBSSIDItem; typedef struct tagSBSSIDList { - U32 uItem; + u32 uItem; SBSSIDItem sBSSIDList[0]; } SBSSIDList, *PSBSSIDList; typedef struct tagSCmdLinkStatus { - BOOL bLink; - U16 wBSSType; - U8 byState; - U8 abyBSSID[BSSID_LEN]; - U8 abySSID[SSID_MAXLEN + 2]; - U32 uChannel; - U32 uLinkRate; + bool bLink; + u16 wBSSType; + u8 byState; + u8 abyBSSID[BSSID_LEN]; + u8 abySSID[SSID_MAXLEN + 2]; + u32 uChannel; + u32 uLinkRate; } SCmdLinkStatus, *PSCmdLinkStatus; @@ -229,18 +228,18 @@ typedef struct tagSCmdLinkStatus { // 802.11 counter // typedef struct tagSDot11MIBCount { - U32 TransmittedFragmentCount; - U32 MulticastTransmittedFrameCount; - U32 FailedCount; - U32 RetryCount; - U32 MultipleRetryCount; - U32 RTSSuccessCount; - U32 RTSFailureCount; - U32 ACKFailureCount; - U32 FrameDuplicateCount; - U32 ReceivedFragmentCount; - U32 MulticastReceivedFrameCount; - U32 FCSErrorCount; + u32 TransmittedFragmentCount; + u32 MulticastTransmittedFrameCount; + u32 FailedCount; + u32 RetryCount; + u32 MultipleRetryCount; + u32 RTSSuccessCount; + u32 RTSFailureCount; + u32 ACKFailureCount; + u32 FrameDuplicateCount; + u32 ReceivedFragmentCount; + u32 MulticastReceivedFrameCount; + u32 FCSErrorCount; } SDot11MIBCount, *PSDot11MIBCount; @@ -252,129 +251,129 @@ typedef struct tagSStatMIBCount { // // ISR status count // - U32 dwIsrTx0OK; - U32 dwIsrTx1OK; - U32 dwIsrBeaconTxOK; - U32 dwIsrRxOK; - U32 dwIsrTBTTInt; - U32 dwIsrSTIMERInt; - U32 dwIsrUnrecoverableError; - U32 dwIsrSoftInterrupt; - U32 dwIsrRxNoBuf; + u32 dwIsrTx0OK; + u32 dwIsrTx1OK; + u32 dwIsrBeaconTxOK; + u32 dwIsrRxOK; + u32 dwIsrTBTTInt; + u32 dwIsrSTIMERInt; + u32 dwIsrUnrecoverableError; + u32 dwIsrSoftInterrupt; + u32 dwIsrRxNoBuf; ///////////////////////////////////// - U32 dwIsrUnknown; // unknown interrupt count + u32 dwIsrUnknown; // unknown interrupt count // RSR status count // - U32 dwRsrFrmAlgnErr; - U32 dwRsrErr; - U32 dwRsrCRCErr; - U32 dwRsrCRCOk; - U32 dwRsrBSSIDOk; - U32 dwRsrADDROk; - U32 dwRsrICVOk; - U32 dwNewRsrShortPreamble; - U32 dwRsrLong; - U32 dwRsrRunt; - - U32 dwRsrRxControl; - U32 dwRsrRxData; - U32 dwRsrRxManage; - - U32 dwRsrRxPacket; - U32 dwRsrRxOctet; - U32 dwRsrBroadcast; - U32 dwRsrMulticast; - U32 dwRsrDirected; + u32 dwRsrFrmAlgnErr; + u32 dwRsrErr; + u32 dwRsrCRCErr; + u32 dwRsrCRCOk; + u32 dwRsrBSSIDOk; + u32 dwRsrADDROk; + u32 dwRsrICVOk; + u32 dwNewRsrShortPreamble; + u32 dwRsrLong; + u32 dwRsrRunt; + + u32 dwRsrRxControl; + u32 dwRsrRxData; + u32 dwRsrRxManage; + + u32 dwRsrRxPacket; + u32 dwRsrRxOctet; + u32 dwRsrBroadcast; + u32 dwRsrMulticast; + u32 dwRsrDirected; // 64-bit OID - U32 ullRsrOK; + u32 ullRsrOK; // for some optional OIDs (64 bits) and DMI support - U32 ullRxBroadcastBytes; - U32 ullRxMulticastBytes; - U32 ullRxDirectedBytes; - U32 ullRxBroadcastFrames; - U32 ullRxMulticastFrames; - U32 ullRxDirectedFrames; - - U32 dwRsrRxFragment; - U32 dwRsrRxFrmLen64; - U32 dwRsrRxFrmLen65_127; - U32 dwRsrRxFrmLen128_255; - U32 dwRsrRxFrmLen256_511; - U32 dwRsrRxFrmLen512_1023; - U32 dwRsrRxFrmLen1024_1518; + u32 ullRxBroadcastBytes; + u32 ullRxMulticastBytes; + u32 ullRxDirectedBytes; + u32 ullRxBroadcastFrames; + u32 ullRxMulticastFrames; + u32 ullRxDirectedFrames; + + u32 dwRsrRxFragment; + u32 dwRsrRxFrmLen64; + u32 dwRsrRxFrmLen65_127; + u32 dwRsrRxFrmLen128_255; + u32 dwRsrRxFrmLen256_511; + u32 dwRsrRxFrmLen512_1023; + u32 dwRsrRxFrmLen1024_1518; // TSR0,1 status count // - U32 dwTsrTotalRetry[2]; // total collision retry count - U32 dwTsrOnceRetry[2]; // this packet only occur one collision - U32 dwTsrMoreThanOnceRetry[2]; // this packet occur more than one collision - U32 dwTsrRetry[2]; // this packet has ever occur collision, + u32 dwTsrTotalRetry[2]; // total collision retry count + u32 dwTsrOnceRetry[2]; // this packet only occur one collision + u32 dwTsrMoreThanOnceRetry[2]; // this packet occur more than one collision + u32 dwTsrRetry[2]; // this packet has ever occur collision, // that is (dwTsrOnceCollision0 + dwTsrMoreThanOnceCollision0) - U32 dwTsrACKData[2]; - U32 dwTsrErr[2]; - U32 dwAllTsrOK[2]; - U32 dwTsrRetryTimeout[2]; - U32 dwTsrTransmitTimeout[2]; - - U32 dwTsrTxPacket[2]; - U32 dwTsrTxOctet[2]; - U32 dwTsrBroadcast[2]; - U32 dwTsrMulticast[2]; - U32 dwTsrDirected[2]; + u32 dwTsrACKData[2]; + u32 dwTsrErr[2]; + u32 dwAllTsrOK[2]; + u32 dwTsrRetryTimeout[2]; + u32 dwTsrTransmitTimeout[2]; + + u32 dwTsrTxPacket[2]; + u32 dwTsrTxOctet[2]; + u32 dwTsrBroadcast[2]; + u32 dwTsrMulticast[2]; + u32 dwTsrDirected[2]; // RD/TD count - U32 dwCntRxFrmLength; - U32 dwCntTxBufLength; + u32 dwCntRxFrmLength; + u32 dwCntTxBufLength; - U8 abyCntRxPattern[16]; - U8 abyCntTxPattern[16]; + u8 abyCntRxPattern[16]; + u8 abyCntTxPattern[16]; // Software check.... - U32 dwCntRxDataErr; // rx buffer data software compare CRC err count - U32 dwCntDecryptErr; // rx buffer data software compare CRC err count - U32 dwCntRxICVErr; // rx buffer data software compare CRC err count - U32 idxRxErrorDesc; // index for rx data error RD + u32 dwCntRxDataErr; // rx buffer data software compare CRC err count + u32 dwCntDecryptErr; // rx buffer data software compare CRC err count + u32 dwCntRxICVErr; // rx buffer data software compare CRC err count + u32 idxRxErrorDesc; // index for rx data error RD // 64-bit OID - U32 ullTsrOK[2]; + u32 ullTsrOK[2]; // for some optional OIDs (64 bits) and DMI support - U32 ullTxBroadcastFrames[2]; - U32 ullTxMulticastFrames[2]; - U32 ullTxDirectedFrames[2]; - U32 ullTxBroadcastBytes[2]; - U32 ullTxMulticastBytes[2]; - U32 ullTxDirectedBytes[2]; + u32 ullTxBroadcastFrames[2]; + u32 ullTxMulticastFrames[2]; + u32 ullTxDirectedFrames[2]; + u32 ullTxBroadcastBytes[2]; + u32 ullTxMulticastBytes[2]; + u32 ullTxDirectedBytes[2]; } SStatMIBCount, *PSStatMIBCount; typedef struct tagSNodeItem { // STA info - U16 wAID; - U8 abyMACAddr[6]; - U16 wTxDataRate; - U16 wInActiveCount; - U16 wEnQueueCnt; - U16 wFlags; - BOOL bPWBitOn; - U8 byKeyIndex; - U16 wWepKeyLength; - U8 abyWepKey[WEP_KEYMAXLEN]; + u16 wAID; + u8 abyMACAddr[6]; + u16 wTxDataRate; + u16 wInActiveCount; + u16 wEnQueueCnt; + u16 wFlags; + bool bPWBitOn; + u8 byKeyIndex; + u16 wWepKeyLength; + u8 abyWepKey[WEP_KEYMAXLEN]; // Auto rate fallback vars - BOOL bIsInFallback; - U32 uTxFailures; - U32 uTxAttempts; - U16 wFailureRatio; + bool bIsInFallback; + u32 uTxFailures; + u32 uTxAttempts; + u16 wFailureRatio; } SNodeItem; typedef struct tagSNodeList { - U32 uItem; + u32 uItem; SNodeItem sNodeList[0]; } SNodeList, *PSNodeList; @@ -383,7 +382,7 @@ typedef struct tagSNodeList { typedef struct tagSCmdValue { - U32 dwValue; + u32 dwValue; } SCmdValue, *PSCmdValue; @@ -418,46 +417,46 @@ enum { struct viawget_hostapd_param { - U32 cmd; - U8 sta_addr[6]; + u32 cmd; + u8 sta_addr[6]; union { struct { - U16 aid; - U16 capability; - U8 tx_supp_rates; + u16 aid; + u16 capability; + u8 tx_supp_rates; } add_sta; struct { - U32 inactive_sec; + u32 inactive_sec; } get_info_sta; struct { - U8 alg; - U32 flags; - U32 err; - U8 idx; - U8 seq[8]; - U16 key_len; - U8 key[0]; + u8 alg; + u32 flags; + u32 err; + u8 idx; + u8 seq[8]; + u16 key_len; + u8 key[0]; } crypt; struct { - U32 flags_and; - U32 flags_or; + u32 flags_and; + u32 flags_or; } set_flags_sta; struct { - U16 rid; - U16 len; - U8 data[0]; + u16 rid; + u16 len; + u8 data[0]; } rid; struct { - U8 len; - U8 data[0]; + u8 len; + u8 data[0]; } generic_elem; struct { - U16 cmd; - U16 reason_code; + u16 cmd; + u16 reason_code; } mlme; struct { - U8 ssid_len; - U8 ssid[32]; + u8 ssid_len; + u8 ssid[32]; } scan_req; } u; }; diff --git a/drivers/staging/vt6655/ioctl.c b/drivers/staging/vt6655/ioctl.c index 404287c6025..5624a41e3d5 100644 --- a/drivers/staging/vt6655/ioctl.c +++ b/drivers/staging/vt6655/ioctl.c @@ -70,16 +70,16 @@ int private_ioctl(PSDevice pDevice, struct ifreq *rq) { SNodeList sNodeList; PSBSSIDList pList; PSNodeList pNodeList; - UINT cbListCount; + unsigned int cbListCount; PKnownBSS pBSS; PKnownNodeDB pNode; - UINT ii, jj; + unsigned int ii, jj; SCmdLinkStatus sLinkStatus; - BYTE abySuppRates[] = {WLAN_EID_SUPP_RATES, 4, 0x02, 0x04, 0x0B, 0x16}; - BYTE abyNullAddr[] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; - DWORD dwKeyIndex= 0; - BYTE abyScanSSID[WLAN_IEHDR_LEN + WLAN_SSID_MAXLEN + 1]; - LONG ldBm; + unsigned char abySuppRates[] = {WLAN_EID_SUPP_RATES, 4, 0x02, 0x04, 0x0B, 0x16}; + unsigned char abyNullAddr[] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; + unsigned long dwKeyIndex= 0; + unsigned char abyScanSSID[WLAN_IEHDR_LEN + WLAN_SSID_MAXLEN + 1]; + long ldBm; pReq->wResult = 0; @@ -99,17 +99,17 @@ int private_ioctl(PSDevice pDevice, struct ifreq *rq) { memcpy(abyScanSSID, pItemSSID, pItemSSID->len + WLAN_IEHDR_LEN); } - if (pDevice->bMACSuspend == TRUE) { - if (pDevice->bRadioOff == TRUE) + if (pDevice->bMACSuspend == true) { + if (pDevice->bRadioOff == true) CARDbRadioPowerOn(pDevice); vMgrTimerInit(pDevice); MACvIntEnable(pDevice->PortOffset, IMR_MASK_VALUE); add_timer(&pMgmt->sTimerSecondCallback); - pDevice->bMACSuspend = FALSE; + pDevice->bMACSuspend = false; } spin_lock_irq(&pDevice->lock); if (memcmp(pMgmt->abyCurrBSSID, &abyNullAddr[0], 6) == 0) - BSSvClearBSSList((void *)pDevice, FALSE); + BSSvClearBSSList((void *)pDevice, false); else BSSvClearBSSList((void *)pDevice, pDevice->bLinkPass); @@ -130,7 +130,7 @@ int private_ioctl(PSDevice pDevice, struct ifreq *rq) { break; }; - if(sZoneTypeCmd.bWrite==TRUE) { + if(sZoneTypeCmd.bWrite==true) { //////write zonetype if(sZoneTypeCmd.ZoneType == ZoneType_USA) { //set to USA @@ -147,7 +147,7 @@ int private_ioctl(PSDevice pDevice, struct ifreq *rq) { } else { ///////read zonetype - BYTE zonetype=0; + unsigned char zonetype=0; if(zonetype == 0x00) { //USA @@ -174,13 +174,13 @@ int private_ioctl(PSDevice pDevice, struct ifreq *rq) { case WLAN_CMD_BSS_JOIN: - if (pDevice->bMACSuspend == TRUE) { - if (pDevice->bRadioOff == TRUE) + if (pDevice->bMACSuspend == true) { + if (pDevice->bRadioOff == true) CARDbRadioPowerOn(pDevice); vMgrTimerInit(pDevice); MACvIntEnable(pDevice->PortOffset, IMR_MASK_VALUE); add_timer(&pMgmt->sTimerSecondCallback); - pDevice->bMACSuspend = FALSE; + pDevice->bMACSuspend = false; } if (copy_from_user(&sJoinCmd, pReq->data, sizeof(SCmdBSSJoin))) { @@ -199,7 +199,7 @@ int private_ioctl(PSDevice pDevice, struct ifreq *rq) { pMgmt->eConfigMode = WMAC_CONFIG_ESS_STA; DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "ioct set to STA mode\n"); } - if (sJoinCmd.bPSEnable == TRUE) { + if (sJoinCmd.bPSEnable == true) { pDevice->ePSMode = WMAC_POWER_FAST; // pDevice->ePSMode = WMAC_POWER_MAX; pMgmt->wListenInterval = 2; @@ -211,12 +211,12 @@ int private_ioctl(PSDevice pDevice, struct ifreq *rq) { DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Power Saving Off \n"); } - if (sJoinCmd.bShareKeyAuth == TRUE){ - pMgmt->bShareKeyAlgorithm = TRUE; + if (sJoinCmd.bShareKeyAuth == true){ + pMgmt->bShareKeyAlgorithm = true; DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Share Key \n"); } else { - pMgmt->bShareKeyAlgorithm = FALSE; + pMgmt->bShareKeyAlgorithm = false; DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Open System \n"); } pDevice->uChannel = sJoinCmd.uChannel; @@ -235,8 +235,8 @@ int private_ioctl(PSDevice pDevice, struct ifreq *rq) { result = -EFAULT; break; }; - if (sWEPCmd.bEnableWep != TRUE) { - pDevice->bEncryptionEnable = FALSE; + if (sWEPCmd.bEnableWep != true) { + pDevice->bEncryptionEnable = false; pDevice->eEncryptionStatus = Ndis802_11EncryptionDisabled; MACvDisableDefaultKey(pDevice->PortOffset); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "WEP function disable. \n"); @@ -257,15 +257,15 @@ int private_ioctl(PSDevice pDevice, struct ifreq *rq) { dwKeyIndex, sWEPCmd.auWepKeyLength[ii], NULL, - (PBYTE)&sWEPCmd.abyWepKey[ii][0], + (unsigned char *)&sWEPCmd.abyWepKey[ii][0], KEY_CTL_WEP, pDevice->PortOffset, pDevice->byLocalID); } } pDevice->byKeyIndex = sWEPCmd.byKeyIndex; - pDevice->bTransmitKey = TRUE; - pDevice->bEncryptionEnable = TRUE; + pDevice->bTransmitKey = true; + pDevice->bEncryptionEnable = true; pDevice->eEncryptionStatus = Ndis802_11Encryption1Enabled; break; @@ -286,8 +286,8 @@ int private_ioctl(PSDevice pDevice, struct ifreq *rq) { sLinkStatus.byState = ADHOC_STARTED; sLinkStatus.uChannel = pMgmt->uCurrChannel; - if (pDevice->bLinkPass == TRUE) { - sLinkStatus.bLink = TRUE; + if (pDevice->bLinkPass == true) { + sLinkStatus.bLink = true; pItemSSID = (PWLAN_IE_SSID)pMgmt->abyCurrSSID; memcpy(sLinkStatus.abySSID, pItemSSID->abySSID, pItemSSID->len); memcpy(sLinkStatus.abyBSSID, pMgmt->abyCurrBSSID, WLAN_BSSID_LEN); @@ -295,7 +295,7 @@ int private_ioctl(PSDevice pDevice, struct ifreq *rq) { DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" Link Success ! \n"); } else { - sLinkStatus.bLink = FALSE; + sLinkStatus.bLink = false; } if (copy_to_user(pReq->data, &sLinkStatus, sizeof(SCmdLinkStatus))) { result = -EFAULT; @@ -340,8 +340,8 @@ int private_ioctl(PSDevice pDevice, struct ifreq *rq) { pList->sBSSIDList[ii].wBeaconInterval = pBSS->wBeaconInterval; pList->sBSSIDList[ii].wCapInfo = pBSS->wCapInfo; // pList->sBSSIDList[ii].uRSSI = pBSS->uRSSI; - RFvRSSITodBm(pDevice, (BYTE)(pBSS->uRSSI), &ldBm); - pList->sBSSIDList[ii].uRSSI = (UINT)ldBm; + RFvRSSITodBm(pDevice, (unsigned char)(pBSS->uRSSI), &ldBm); + pList->sBSSIDList[ii].uRSSI = (unsigned int)ldBm; memcpy(pList->sBSSIDList[ii].abyBSSID, pBSS->abyBSSID, WLAN_BSSID_LEN); pItemSSID = (PWLAN_IE_SSID)pBSS->abySSID; memset(pList->sBSSIDList[ii].abySSID, 0, WLAN_SSID_MAXLEN + 1); @@ -353,10 +353,10 @@ int private_ioctl(PSDevice pDevice, struct ifreq *rq) { pList->sBSSIDList[ii].byNetType = ADHOC; } if (WLAN_GET_CAP_INFO_PRIVACY(pBSS->wCapInfo)) { - pList->sBSSIDList[ii].bWEPOn = TRUE; + pList->sBSSIDList[ii].bWEPOn = true; } else { - pList->sBSSIDList[ii].bWEPOn = FALSE; + pList->sBSSIDList[ii].bWEPOn = false; } ii ++; if (ii >= pList->uItem) @@ -391,16 +391,16 @@ int private_ioctl(PSDevice pDevice, struct ifreq *rq) { netif_stop_queue(pDevice->dev); spin_lock_irq(&pDevice->lock); - if (pDevice->bRadioOff == FALSE) { + if (pDevice->bRadioOff == false) { CARDbRadioPowerOff(pDevice); } - pDevice->bLinkPass = FALSE; + pDevice->bLinkPass = false; memset(pMgmt->abyCurrBSSID, 0, 6); pMgmt->eCurrState = WMAC_STATE_IDLE; del_timer(&pDevice->sTimerCommand); del_timer(&pMgmt->sTimerSecondCallback); - pDevice->bCmdRunning = FALSE; - pDevice->bMACSuspend = TRUE; + pDevice->bCmdRunning = false; + pDevice->bMACSuspend = true; MACvIntDisable(pDevice->PortOffset); spin_unlock_irq(&pDevice->lock); @@ -410,13 +410,13 @@ int private_ioctl(PSDevice pDevice, struct ifreq *rq) { DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "WLAN_CMD_START_MAC\n"); - if (pDevice->bMACSuspend == TRUE) { - if (pDevice->bRadioOff == TRUE) + if (pDevice->bMACSuspend == true) { + if (pDevice->bRadioOff == true) CARDbRadioPowerOn(pDevice); vMgrTimerInit(pDevice); MACvIntEnable(pDevice->PortOffset, IMR_MASK_VALUE); add_timer(&pMgmt->sTimerSecondCallback); - pDevice->bMACSuspend = FALSE; + pDevice->bMACSuspend = false; } break; @@ -458,11 +458,11 @@ int private_ioctl(PSDevice pDevice, struct ifreq *rq) { }; if (sValue.dwValue == 1) { - pDevice->bEnable8021x = TRUE; + pDevice->bEnable8021x = true; DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Enable 802.1x\n"); } else { - pDevice->bEnable8021x = FALSE; + pDevice->bEnable8021x = false; DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Disable 802.1x\n"); } @@ -478,11 +478,11 @@ int private_ioctl(PSDevice pDevice, struct ifreq *rq) { }; if (sValue.dwValue == 1) { - pDevice->bEnableHostWEP = TRUE; + pDevice->bEnableHostWEP = true; DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Enable HostWEP\n"); } else { - pDevice->bEnableHostWEP = FALSE; + pDevice->bEnableHostWEP = false; DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Disable HostWEP\n"); } @@ -498,11 +498,11 @@ int private_ioctl(PSDevice pDevice, struct ifreq *rq) { if (sValue.dwValue == 1) { DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "up wpadev\n"); memcpy(pDevice->wpadev->dev_addr, pDevice->dev->dev_addr, ETH_ALEN); - pDevice->bWPADEVUp = TRUE; + pDevice->bWPADEVUp = true; } else { DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "close wpadev\n"); - pDevice->bWPADEVUp = FALSE; + pDevice->bWPADEVUp = false; } break; @@ -510,7 +510,7 @@ int private_ioctl(PSDevice pDevice, struct ifreq *rq) { case WLAN_CMD_AP_START: DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "WLAN_CMD_AP_START\n"); - if (pDevice->bRadioOff == TRUE) { + if (pDevice->bRadioOff == true) { CARDbRadioPowerOn(pDevice); vMgrTimerInit(pDevice); MACvIntEnable(pDevice->PortOffset, IMR_MASK_VALUE); @@ -554,12 +554,12 @@ int private_ioctl(PSDevice pDevice, struct ifreq *rq) { else pMgmt->wIBSSBeaconPeriod = 100; - if (sStartAPCmd.bShareKeyAuth == TRUE){ - pMgmt->bShareKeyAlgorithm = TRUE; + if (sStartAPCmd.bShareKeyAuth == true){ + pMgmt->bShareKeyAlgorithm = true; DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Share Key \n"); } else { - pMgmt->bShareKeyAlgorithm = FALSE; + pMgmt->bShareKeyAlgorithm = false; DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Open System \n"); } memcpy(pMgmt->abyIBSSSuppRates, abySuppRates, 6); @@ -635,9 +635,9 @@ int private_ioctl(PSDevice pDevice, struct ifreq *rq) { pNodeList->sNodeList[jj].wAID = pNode->wAID; memcpy(pNodeList->sNodeList[jj].abyMACAddr, pNode->abyMACAddr, WLAN_ADDR_LEN); pNodeList->sNodeList[jj].wTxDataRate = pNode->wTxDataRate; - pNodeList->sNodeList[jj].wInActiveCount = (WORD)pNode->uInActiveCount; - pNodeList->sNodeList[jj].wEnQueueCnt = (WORD)pNode->wEnQueueCnt; - pNodeList->sNodeList[jj].wFlags = (WORD)pNode->dwFlags; + pNodeList->sNodeList[jj].wInActiveCount = (unsigned short)pNode->uInActiveCount; + pNodeList->sNodeList[jj].wEnQueueCnt = (unsigned short)pNode->wEnQueueCnt; + pNodeList->sNodeList[jj].wFlags = (unsigned short)pNode->dwFlags; pNodeList->sNodeList[jj].bPWBitOn = pNode->bPSEnable; pNodeList->sNodeList[jj].byKeyIndex = pNode->byKeyIndex; pNodeList->sNodeList[jj].wWepKeyLength = pNode->uWepKeyLength; @@ -652,7 +652,7 @@ int private_ioctl(PSDevice pDevice, struct ifreq *rq) { pNodeList->sNodeList[jj].bIsInFallback = pNode->bIsInFallback; pNodeList->sNodeList[jj].uTxFailures = pNode->uTxFailures; pNodeList->sNodeList[jj].uTxAttempts = pNode->uTxAttempts; - pNodeList->sNodeList[jj].wFailureRatio = (WORD)pNode->uFailureRatio; + pNodeList->sNodeList[jj].wFailureRatio = (unsigned short)pNode->uFailureRatio; jj ++; if (jj >= pNodeList->uItem) break; @@ -672,14 +672,14 @@ int private_ioctl(PSDevice pDevice, struct ifreq *rq) { wpa_Result.proto = 0; wpa_Result.key_mgmt = 0; wpa_Result.eap_type = 0; - wpa_Result.authenticated = FALSE; - pDevice->fWPA_Authened = FALSE; + wpa_Result.authenticated = false; + pDevice->fWPA_Authened = false; if (copy_from_user(&wpa_Result, pReq->data, sizeof(wpa_Result))) { result = -EFAULT; break; } -if(wpa_Result.authenticated==TRUE) { +if(wpa_Result.authenticated==true) { #ifdef SndEvt_ToAPI { union iwreq_data wrqu; @@ -692,7 +692,7 @@ if(wpa_Result.authenticated==TRUE) { wireless_send_event(pDevice->dev, IWEVCUSTOM, &wrqu, pItemSSID->abySSID); } #endif - pDevice->fWPA_Authened = TRUE; //is successful peer to wpa_Result.authenticated? + pDevice->fWPA_Authened = true; //is successful peer to wpa_Result.authenticated? } //printk("get private wpa_supplicant announce WPA SM\n"); @@ -700,7 +700,7 @@ if(wpa_Result.authenticated==TRUE) { //printk("wpa-->proto=%d\n",wpa_Result.proto); //printk("wpa-->key-mgmt=%d\n",wpa_Result.key_mgmt); //printk("wpa-->eap_type=%d\n",wpa_Result.eap_type); - //printk("wpa-->authenticated is %s\n",(wpa_Result.authenticated==TRUE)?"TRUE":"FALSE"); + //printk("wpa-->authenticated is %s\n",(wpa_Result.authenticated==true)?"true":"false"); pReq->wResult = 0; break; @@ -717,9 +717,9 @@ if(wpa_Result.authenticated==TRUE) { void vConfigWEPKey ( PSDevice pDevice, - DWORD dwKeyIndex, - PBYTE pbyKey, - ULONG uKeyLength + unsigned long dwKeyIndex, + unsigned char *pbyKey, + unsigned long uKeyLength ) { int ii; @@ -728,15 +728,15 @@ vConfigWEPKey ( memset(&pDevice->abyWepKey[dwKeyIndex][0], 0, WLAN_WEPMAX_KEYLEN); memcpy(&pDevice->abyWepKey[dwKeyIndex][0], pbyKey, uKeyLength); - pDevice->bWepKeyAvailable[dwKeyIndex] = TRUE; + pDevice->bWepKeyAvailable[dwKeyIndex] = true; pDevice->auWepKeyLength[dwKeyIndex] = uKeyLength; MACvSetDefaultKeyEntry(pDevice->PortOffset, uKeyLength, dwKeyIndex, - (PDWORD) &(pDevice->abyWepKey[dwKeyIndex][0]), pDevice->byLocalID); + (unsigned long *) &(pDevice->abyWepKey[dwKeyIndex][0]), pDevice->byLocalID); if (pDevice->eEncryptionStatus < Ndis802_11EncryptionNotSupported) { for(ii=0; ii<MAX_GROUP_KEY; ii++) { - if ((pDevice->bWepKeyAvailable[ii] == TRUE) && + if ((pDevice->bWepKeyAvailable[ii] == true) && (pDevice->auWepKeyLength[ii] == WLAN_WEP232_KEYLEN)) { pDevice->uCurrentWEPMode = TX_WEP_SW232; MACvDisableDefaultKey(pDevice->PortOffset); diff --git a/drivers/staging/vt6655/ioctl.h b/drivers/staging/vt6655/ioctl.h index 0d10c2a923c..ba85015c11b 100644 --- a/drivers/staging/vt6655/ioctl.h +++ b/drivers/staging/vt6655/ioctl.h @@ -45,9 +45,9 @@ int private_ioctl(PSDevice pDevice, struct ifreq *rq); /* void vConfigWEPKey ( PSDevice pDevice, - DWORD dwKeyIndex, - PBYTE pbyKey, - ULONG uKeyLength + unsigned long dwKeyIndex, + unsigned char *pbyKey, + unsigned long uKeyLength ); */ diff --git a/drivers/staging/vt6655/iwctl.c b/drivers/staging/vt6655/iwctl.c index cf69034fc0f..43227617aab 100644 --- a/drivers/staging/vt6655/iwctl.c +++ b/drivers/staging/vt6655/iwctl.c @@ -45,7 +45,7 @@ #endif #include <net/iw_handler.h> -extern WORD TxRate_iwconfig;//2008-5-8 <add> by chester +extern unsigned short TxRate_iwconfig;//2008-5-8 <add> by chester /*--------------------- Static Definitions -------------------------*/ @@ -99,16 +99,16 @@ struct iw_statistics *iwctl_get_wireless_stats(struct net_device *dev) else pDevice->scStatistic.LinkQuality = (96-pDevice->byCurrSQ)*100/76; } - if(pDevice->bLinkPass !=TRUE) + if(pDevice->bLinkPass !=true) pDevice->scStatistic.LinkQuality = 0; #endif if(pDevice->scStatistic.LinkQuality > 100) pDevice->scStatistic.LinkQuality = 100; - pDevice->wstats.qual.qual =(BYTE) pDevice->scStatistic.LinkQuality; + pDevice->wstats.qual.qual =(unsigned char) pDevice->scStatistic.LinkQuality; #else pDevice->wstats.qual.qual = pDevice->byCurrSQ; #endif - RFvRSSITodBm(pDevice, (BYTE)(pDevice->uCurrRSSI), &ldBm); + RFvRSSITodBm(pDevice, (unsigned char)(pDevice->uCurrRSSI), &ldBm); pDevice->wstats.qual.level = ldBm; //pDevice->wstats.qual.level = 0x100 - pDevice->uCurrRSSI; pDevice->wstats.qual.noise = 0; @@ -116,7 +116,7 @@ struct iw_statistics *iwctl_get_wireless_stats(struct net_device *dev) pDevice->wstats.discard.nwid = 0; pDevice->wstats.discard.code = 0; pDevice->wstats.discard.fragment = 0; - pDevice->wstats.discard.retries = (U32)pDevice->scStatistic.dwTsrErr; + pDevice->wstats.discard.retries = (unsigned long)pDevice->scStatistic.dwTsrErr; pDevice->wstats.discard.misc = 0; pDevice->wstats.miss.beacon = 0; @@ -175,7 +175,7 @@ int iwctl_siwscan(struct net_device *dev, PSDevice pDevice = (PSDevice)netdev_priv(dev); PSMgmtObject pMgmt = &(pDevice->sMgmtObj); struct iw_scan_req *req = (struct iw_scan_req *)extra; - BYTE abyScanSSID[WLAN_IEHDR_LEN + WLAN_SSID_MAXLEN + 1]; + unsigned char abyScanSSID[WLAN_IEHDR_LEN + WLAN_SSID_MAXLEN + 1]; PWLAN_IE_SSID pItemSSID=NULL; DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO " SIOCSIWSCAN \n"); @@ -309,7 +309,7 @@ int iwctl_giwscan(struct net_device *dev, //ADD quality memset(&iwe, 0, sizeof(iwe)); iwe.cmd = IWEVQUAL; - RFvRSSITodBm(pDevice, (BYTE)(pBSS->uRSSI), &ldBm); + RFvRSSITodBm(pDevice, (unsigned char)(pBSS->uRSSI), &ldBm); iwe.u.qual.level = ldBm; iwe.u.qual.noise = 0; //2008-0409-01, <Add> by Einsn Liu @@ -426,7 +426,7 @@ int iwctl_siwfreq(struct net_device *dev, pDevice->uChannel = channel; //2007-0207-04,<Add> by EinsnLiu //Make change effect at once - pDevice->bCommit = TRUE; + pDevice->bCommit = true; } } @@ -489,7 +489,7 @@ int iwctl_siwmode(struct net_device *dev, if (pMgmt->eConfigMode != WMAC_CONFIG_IBSS_STA) { pMgmt->eConfigMode = WMAC_CONFIG_IBSS_STA; if (pDevice->flags & DEVICE_FLAGS_OPENED) { - pDevice->bCommit = TRUE; + pDevice->bCommit = true; } } DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "set mode to ad-hoc \n"); @@ -499,7 +499,7 @@ int iwctl_siwmode(struct net_device *dev, if (pMgmt->eConfigMode != WMAC_CONFIG_ESS_STA) { pMgmt->eConfigMode = WMAC_CONFIG_ESS_STA; if (pDevice->flags & DEVICE_FLAGS_OPENED) { - pDevice->bCommit = TRUE; + pDevice->bCommit = true; } } DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "set mode to infrastructure \n"); @@ -513,7 +513,7 @@ int iwctl_siwmode(struct net_device *dev, if (pMgmt->eConfigMode != WMAC_CONFIG_AP) { pMgmt->eConfigMode = WMAC_CONFIG_AP; if (pDevice->flags & DEVICE_FLAGS_OPENED) { - pDevice->bCommit = TRUE; + pDevice->bCommit = true; } } DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "set mode to Access Point \n"); @@ -577,7 +577,7 @@ int iwctl_giwrange(struct net_device *dev, { struct iw_range *range = (struct iw_range *) extra; int i,k; - BYTE abySupportedRates[13]= {0x02, 0x04, 0x0B, 0x16, 0x0c, 0x12, 0x18, 0x24, 0x30, 0x48, 0x60, 0x6C, 0x90}; + unsigned char abySupportedRates[13]= {0x02, 0x04, 0x0B, 0x16, 0x0c, 0x12, 0x18, 0x24, 0x30, 0x48, 0x60, 0x6C, 0x90}; DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO " SIOCGIWRANGE \n"); @@ -688,7 +688,7 @@ int iwctl_siwap(struct net_device *dev, PSDevice pDevice = (PSDevice)netdev_priv(dev); PSMgmtObject pMgmt = &(pDevice->sMgmtObj); int rc = 0; - BYTE ZeroBSSID[WLAN_BSSID_LEN]={0x00,0x00,0x00,0x00,0x00,0x00}; + unsigned char ZeroBSSID[WLAN_BSSID_LEN]={0x00,0x00,0x00,0x00,0x00,0x00}; DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO " SIOCSIWAP \n"); if (pMgmt->eScanState == WMAC_IS_SCANNING) { @@ -701,12 +701,12 @@ if (pMgmt->eScanState == WMAC_IS_SCANNING) { else { memcpy(pMgmt->abyDesireBSSID, wrq->sa_data, 6); //2008-0409-05, <Add> by Einsn Liu - if((pDevice->bLinkPass == TRUE) && + if((pDevice->bLinkPass == true) && (memcmp(pMgmt->abyDesireBSSID, pMgmt->abyCurrBSSID, 6)== 0)){ return rc; } //mike :add - if ((IS_BROADCAST_ADDRESS(pMgmt->abyDesireBSSID)) || + if ((is_broadcast_ether_addr(pMgmt->abyDesireBSSID)) || (memcmp(pMgmt->abyDesireBSSID, ZeroBSSID, 6) == 0)){ PRINT_K("SIOCSIWAP:invalid desired BSSID return!\n"); return rc; @@ -714,10 +714,10 @@ if (pMgmt->eScanState == WMAC_IS_SCANNING) { //mike add: if desired AP is hidden ssid(there are two same BSSID in list), // then ignore,because you don't known which one to be connect with?? { - UINT ii , uSameBssidNum=0; + unsigned int ii , uSameBssidNum=0; for (ii = 0; ii < MAX_BSS_NUM; ii++) { if (pMgmt->sBSSList[ii].bActive && - IS_ETH_ADDRESS_EQUAL(pMgmt->sBSSList[ii].abyBSSID,pMgmt->abyDesireBSSID)) { + !compare_ether_addr(pMgmt->sBSSList[ii].abyBSSID, pMgmt->abyDesireBSSID)) { uSameBssidNum++; } } @@ -728,7 +728,7 @@ if (pMgmt->eScanState == WMAC_IS_SCANNING) { } if (pDevice->flags & DEVICE_FLAGS_OPENED) { - pDevice->bCommit = TRUE; + pDevice->bCommit = true; } } return rc; @@ -751,7 +751,7 @@ int iwctl_giwap(struct net_device *dev, memcpy(wrq->sa_data, pMgmt->abyCurrBSSID, 6); //2008-0410,<Modify> by Einsn Liu - if ((pDevice->bLinkPass == FALSE) && (pMgmt->eCurrMode != WMAC_MODE_ESS_AP)) + if ((pDevice->bLinkPass == false) && (pMgmt->eCurrMode != WMAC_MODE_ESS_AP)) memset(wrq->sa_data, 0, 6); if (pMgmt->eCurrMode == WMAC_MODE_ESS_AP) { @@ -830,11 +830,11 @@ int iwctl_siwessid(struct net_device *dev, PSMgmtObject pMgmt = &(pDevice->sMgmtObj); PWLAN_IE_SSID pItemSSID; //2008-0409-05, <Add> by Einsn Liu - BYTE len; + unsigned char len; DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO " SIOCSIWESSID \n"); - pDevice->fWPA_Authened = FALSE; + pDevice->fWPA_Authened = false; if (pMgmt->eScanState == WMAC_IS_SCANNING) { // In scanning.. printk("SIOCSIWESSID(??)-->In scanning...\n"); @@ -848,7 +848,7 @@ if (pMgmt->eScanState == WMAC_IS_SCANNING) { PRINT_K("set essid to 'any' \n"); #ifdef WPA_SUPPLICANT_DRIVER_WEXT_SUPPORT //Unknown desired AP,so here need not associate?? - //if(pDevice->bWPASuppWextEnabled == TRUE) { + //if(pDevice->bWPASuppWextEnabled == true) { return 0; // } #endif @@ -868,7 +868,7 @@ if (pMgmt->eScanState == WMAC_IS_SCANNING) { printk("set essid to %s \n",pItemSSID->abySSID); //2008-0409-05, <Add> by Einsn Liu len=(pItemSSID->len > ((PWLAN_IE_SSID)pMgmt->abyCurrSSID)->len)?pItemSSID->len:((PWLAN_IE_SSID)pMgmt->abyCurrSSID)->len; - if((pDevice->bLinkPass == TRUE) && + if((pDevice->bLinkPass == true) && (memcmp(pItemSSID->abySSID,((PWLAN_IE_SSID)pMgmt->abyCurrSSID)->abySSID,len)==0)) return 0; @@ -881,12 +881,12 @@ if (pMgmt->eScanState == WMAC_IS_SCANNING) { #ifdef WPA_SUPPLICANT_DRIVER_WEXT_SUPPORT //Wext wil order another command of siwap to link with desired AP, //so here need not associate?? - if(pDevice->bWPASuppWextEnabled == TRUE) { + if(pDevice->bWPASuppWextEnabled == true) { /*******search if in hidden ssid mode ****/ { PKnownBSS pCurr = NULL; - BYTE abyTmpDesireSSID[WLAN_IEHDR_LEN + WLAN_SSID_MAXLEN + 1]; - UINT ii , uSameBssidNum=0; + unsigned char abyTmpDesireSSID[WLAN_IEHDR_LEN + WLAN_SSID_MAXLEN + 1]; + unsigned int ii , uSameBssidNum=0; memcpy(abyTmpDesireSSID,pMgmt->abyDesireSSID,sizeof(abyTmpDesireSSID)); pCurr = BSSpSearchBSSList(pDevice, @@ -906,7 +906,7 @@ if (pMgmt->eScanState == WMAC_IS_SCANNING) { // by means of judging if there are two same BSSID exist in list ? for (ii = 0; ii < MAX_BSS_NUM; ii++) { if (pMgmt->sBSSList[ii].bActive && - IS_ETH_ADDRESS_EQUAL(pMgmt->sBSSList[ii].abyBSSID, pCurr->abyBSSID)) { + !compare_ether_addr(pMgmt->sBSSList[ii].abyBSSID, pCurr->abyBSSID)) { uSameBssidNum++; } } @@ -927,7 +927,7 @@ if (pMgmt->eScanState == WMAC_IS_SCANNING) { } if (pDevice->flags & DEVICE_FLAGS_OPENED) { - pDevice->bCommit = TRUE; + pDevice->bCommit = true; } @@ -981,7 +981,7 @@ int iwctl_siwrate(struct net_device *dev, int rc = 0; u8 brate = 0; int i; - BYTE abySupportedRates[13]= {0x02, 0x04, 0x0B, 0x16, 0x0c, 0x12, 0x18, 0x24, 0x30, 0x48, 0x60, 0x6C, 0x90}; + unsigned char abySupportedRates[13]= {0x02, 0x04, 0x0B, 0x16, 0x0c, 0x12, 0x18, 0x24, 0x30, 0x48, 0x60, 0x6C, 0x90}; DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO " SIOCSIWRATE \n"); @@ -1033,7 +1033,7 @@ int iwctl_siwrate(struct net_device *dev, // Fixed mode // One rate, fixed printk("Rate Fix\n"); - pDevice->bFixRate = TRUE; + pDevice->bFixRate = true; if ((pDevice->byBBType == BB_TYPE_11B)&& (brate > 3)) { pDevice->uConnectionRate = 3; } @@ -1044,7 +1044,7 @@ int iwctl_siwrate(struct net_device *dev, } else { - pDevice->bFixRate = FALSE; + pDevice->bFixRate = false; pDevice->uConnectionRate = 13; printk("auto rate:connection_rate is 13\n"); } @@ -1068,11 +1068,11 @@ int iwctl_giwrate(struct net_device *dev, DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO " SIOCGIWRATE \n"); { - BYTE abySupportedRates[13]= {0x02, 0x04, 0x0B, 0x16, 0x0c, 0x12, 0x18, 0x24, 0x30, 0x48, 0x60, 0x6C, 0x90}; + unsigned char abySupportedRates[13]= {0x02, 0x04, 0x0B, 0x16, 0x0c, 0x12, 0x18, 0x24, 0x30, 0x48, 0x60, 0x6C, 0x90}; int brate = 0; //2008-5-8 <modify> by chester if(pDevice->bLinkPass){ -if(pDevice->bFixRate == TRUE){ +if(pDevice->bFixRate == true){ if (pDevice->uConnectionRate < 13) { brate = abySupportedRates[pDevice->uConnectionRate]; }else { @@ -1108,8 +1108,8 @@ else brate =0; // brate = abySupportedRates[pDevice->wCurrentRate]; wrq->value = brate * 500000; // If more than one rate, set auto - if (pDevice->bFixRate == TRUE) - wrq->fixed = TRUE; + if (pDevice->bFixRate == true) + wrq->fixed = true; } @@ -1294,7 +1294,7 @@ int iwctl_siwencode(struct net_device *dev, { PSDevice pDevice = (PSDevice)netdev_priv(dev); PSMgmtObject pMgmt = &(pDevice->sMgmtObj); - DWORD dwKeyIndex = (DWORD)(wrq->flags & IW_ENCODE_INDEX); + unsigned long dwKeyIndex = (unsigned long)(wrq->flags & IW_ENCODE_INDEX); int ii,uu, rc = 0; int index = (wrq->flags & IW_ENCODE_INDEX); @@ -1358,7 +1358,7 @@ if((wrq->flags & IW_ENCODE_DISABLED)==0){ if (pDevice->flags & DEVICE_FLAGS_OPENED) { spin_lock_irq(&pDevice->lock); KeybSetDefaultKey(&(pDevice->sKey), - (DWORD)(dwKeyIndex | (1 << 31)), + (unsigned long)(dwKeyIndex | (1 << 31)), wrq->length, NULL, pDevice->abyKey, @@ -1368,38 +1368,38 @@ if((wrq->flags & IW_ENCODE_DISABLED)==0){ ); spin_unlock_irq(&pDevice->lock); } - pDevice->byKeyIndex = (BYTE)dwKeyIndex; + pDevice->byKeyIndex = (unsigned char)dwKeyIndex; pDevice->uKeyLength = wrq->length; - pDevice->bTransmitKey = TRUE; - pDevice->bEncryptionEnable = TRUE; + pDevice->bTransmitKey = true; + pDevice->bEncryptionEnable = true; pDevice->eEncryptionStatus = Ndis802_11Encryption1Enabled; }else if(index>0){ //when the length is 0 the request only changes the default transmit key index //check the new key has a non zero lenget - if(pDevice->bEncryptionEnable==FALSE) + if(pDevice->bEncryptionEnable==false) { rc = -EINVAL; return rc; } DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Just set Default key Index:\n"); pkeytab=&(pDevice->sKey.KeyTable[MAX_KEY_TABLE-1]); - if(pkeytab->GroupKey[(BYTE)dwKeyIndex].uKeyLength==0){ + if(pkeytab->GroupKey[(unsigned char)dwKeyIndex].uKeyLength==0){ DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Default key len is 0\n"); rc = -EINVAL; return rc; } - pDevice->byKeyIndex =(BYTE)dwKeyIndex; + pDevice->byKeyIndex =(unsigned char)dwKeyIndex; pkeytab->dwGTKeyIndex =dwKeyIndex | (1 << 31); - pkeytab->GroupKey[(BYTE)dwKeyIndex].dwKeyIndex=dwKeyIndex | (1 << 31); + pkeytab->GroupKey[(unsigned char)dwKeyIndex].dwKeyIndex=dwKeyIndex | (1 << 31); } }else {//disable the key DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Disable WEP function\n"); - if(pDevice->bEncryptionEnable==FALSE) + if(pDevice->bEncryptionEnable==false) return 0; - pMgmt->bShareKeyAlgorithm = FALSE; - pDevice->bEncryptionEnable = FALSE; + pMgmt->bShareKeyAlgorithm = false; + pDevice->bEncryptionEnable = false; pDevice->eEncryptionStatus = Ndis802_11EncryptionDisabled; if (pDevice->flags & DEVICE_FLAGS_OPENED) { spin_lock_irq(&pDevice->lock); @@ -1450,7 +1450,7 @@ if((wrq->flags & IW_ENCODE_DISABLED)==0){ if (pDevice->flags & DEVICE_FLAGS_OPENED) { spin_lock_irq(&pDevice->lock); KeybSetDefaultKey(&(pDevice->sKey), - (DWORD)(pDevice->byKeyIndex | (1 << 31)), + (unsigned long)(pDevice->byKeyIndex | (1 << 31)), pDevice->uKeyLength, NULL, pDevice->abyKey, @@ -1460,10 +1460,10 @@ if((wrq->flags & IW_ENCODE_DISABLED)==0){ ); spin_unlock_irq(&pDevice->lock); } - pDevice->byKeyIndex = (BYTE)dwKeyIndex; + pDevice->byKeyIndex = (unsigned char)dwKeyIndex; pDevice->uKeyLength = wrq->length; - pDevice->bTransmitKey = TRUE; - pDevice->bEncryptionEnable = TRUE; + pDevice->bTransmitKey = true; + pDevice->bEncryptionEnable = true; pDevice->eEncryptionStatus = Ndis802_11Encryption1Enabled; // Do we want to just set the transmit key index ? @@ -1479,8 +1479,8 @@ if((wrq->flags & IW_ENCODE_DISABLED)==0){ if(wrq->flags & IW_ENCODE_DISABLED){ DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Disable WEP function\n"); - pMgmt->bShareKeyAlgorithm = FALSE; - pDevice->bEncryptionEnable = FALSE; + pMgmt->bShareKeyAlgorithm = false; + pDevice->bEncryptionEnable = false; pDevice->eEncryptionStatus = Ndis802_11EncryptionDisabled; if (pDevice->flags & DEVICE_FLAGS_OPENED) { spin_lock_irq(&pDevice->lock); @@ -1493,11 +1493,11 @@ if((wrq->flags & IW_ENCODE_DISABLED)==0){ if(wrq->flags & IW_ENCODE_RESTRICTED) { DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Enable WEP & ShareKey System\n"); - pMgmt->bShareKeyAlgorithm = TRUE; + pMgmt->bShareKeyAlgorithm = true; } if(wrq->flags & IW_ENCODE_OPEN) { DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Enable WEP & Open System\n"); - pMgmt->bShareKeyAlgorithm = FALSE; + pMgmt->bShareKeyAlgorithm = false; } return rc; } @@ -1515,7 +1515,7 @@ int iwctl_giwencode(struct net_device *dev, PSMgmtObject pMgmt = &(pDevice->sMgmtObj); int rc = 0; char abyKey[WLAN_WEP232_KEYLEN]; - UINT index = (UINT)(wrq->flags & IW_ENCODE_INDEX); + unsigned int index = (unsigned int)(wrq->flags & IW_ENCODE_INDEX); PSKeyItem pKey = NULL; DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO " SIOCGIWENCODE\n"); @@ -1549,7 +1549,7 @@ int iwctl_giwencode(struct net_device *dev, else wrq->flags |= IW_ENCODE_OPEN; - if (KeybGetKey(&(pDevice->sKey), pDevice->abyBroadcastAddr, (BYTE)index , &pKey)){ + if (KeybGetKey(&(pDevice->sKey), pDevice->abyBroadcastAddr, (unsigned char)index , &pKey)){ wrq->length = pKey->uKeyLength; memcpy(abyKey, pKey->abyKey, pKey->uKeyLength); //2007-0207-06,<Modify> by EinsnLiu @@ -1584,7 +1584,7 @@ int iwctl_giwencode(struct net_device *dev, PSMgmtObject pMgmt = &(pDevice->sMgmtObj); char abyKey[WLAN_WEP232_KEYLEN]; - UINT index = (UINT)(wrq->flags & IW_ENCODE_INDEX); + unsigned int index = (unsigned int)(wrq->flags & IW_ENCODE_INDEX); PSKeyItem pKey = NULL; DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO " SIOCGIWENCODE\n"); @@ -1622,7 +1622,7 @@ int iwctl_giwencode(struct net_device *dev, memcpy(abyKey, pKey->abyKey, pKey->uKeyLength); memcpy(extra, abyKey, WLAN_WEP232_KEYLEN); } - }else if (KeybGetKey(&(pDevice->sKey), pDevice->abyBroadcastAddr, (BYTE)index , &pKey)){ + }else if (KeybGetKey(&(pDevice->sKey), pDevice->abyBroadcastAddr, (unsigned char)index , &pKey)){ wrq->length = pKey->uKeyLength; memcpy(abyKey, pKey->abyKey, pKey->uKeyLength); memcpy(extra, abyKey, WLAN_WEP232_KEYLEN); @@ -1729,8 +1729,8 @@ int iwctl_giwsens(struct net_device *dev, long ldBm; DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO " SIOCGIWSENS \n"); - if (pDevice->bLinkPass == TRUE) { - RFvRSSITodBm(pDevice, (BYTE)(pDevice->uCurrRSSI), &ldBm); + if (pDevice->bLinkPass == true) { + RFvRSSITodBm(pDevice, (unsigned char)(pDevice->uCurrRSSI), &ldBm); wrq->value = ldBm; } else { @@ -1763,7 +1763,7 @@ int iwctl_siwauth(struct net_device *dev, wpa_version = wrq->value; if(wrq->value == IW_AUTH_WPA_VERSION_DISABLED) { PRINT_K("iwctl_siwauth:set WPADEV to disable at 1??????\n"); - //pDevice->bWPADevEnable = FALSE; + //pDevice->bWPADevEnable = false; } else if(wrq->value == IW_AUTH_WPA_VERSION_WPA) { PRINT_K("iwctl_siwauth:set WPADEV to WPA1******\n"); @@ -1771,7 +1771,7 @@ int iwctl_siwauth(struct net_device *dev, else { PRINT_K("iwctl_siwauth:set WPADEV to WPA2******\n"); } - //pDevice->bWPASuppWextEnabled =TRUE; + //pDevice->bWPASuppWextEnabled =true; break; case IW_AUTH_CIPHER_PAIRWISE: pairwise = wrq->value; @@ -1818,9 +1818,9 @@ int iwctl_siwauth(struct net_device *dev, break; case IW_AUTH_80211_AUTH_ALG: if(wrq->value==IW_AUTH_ALG_OPEN_SYSTEM){ - pMgmt->bShareKeyAlgorithm=FALSE; + pMgmt->bShareKeyAlgorithm=false; }else if(wrq->value==IW_AUTH_ALG_SHARED_KEY){ - pMgmt->bShareKeyAlgorithm=TRUE; + pMgmt->bShareKeyAlgorithm=true; } break; case IW_AUTH_WPA_ENABLED: @@ -1833,13 +1833,13 @@ int iwctl_siwauth(struct net_device *dev, break; case IW_AUTH_PRIVACY_INVOKED: pDevice->bEncryptionEnable = !!wrq->value; - if(pDevice->bEncryptionEnable == FALSE){ + if(pDevice->bEncryptionEnable == false){ wpa_version = 0; pairwise = 0; pDevice->eEncryptionStatus = Ndis802_11EncryptionDisabled; - pMgmt->bShareKeyAlgorithm = FALSE; - pMgmt->eAuthenMode = FALSE; - //pDevice->bWPADevEnable = FALSE; + pMgmt->bShareKeyAlgorithm = false; + pMgmt->eAuthenMode = false; + //pDevice->bWPADevEnable = false; } break; @@ -1852,9 +1852,9 @@ int iwctl_siwauth(struct net_device *dev, DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "pairwise = %d\n",pairwise); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "pDevice->eEncryptionStatus = %d\n",pDevice->eEncryptionStatus); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "pMgmt->eAuthenMode = %d\n",pMgmt->eAuthenMode); - DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "pMgmt->bShareKeyAlgorithm = %s\n",pMgmt->bShareKeyAlgorithm?"TRUE":"FALSE"); - DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "pDevice->bEncryptionEnable = %s\n",pDevice->bEncryptionEnable?"TRUE":"FALSE"); - DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "pDevice->bWPADevEnable = %s\n",pDevice->bWPADevEnable?"TRUE":"FALSE"); + DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "pMgmt->bShareKeyAlgorithm = %s\n",pMgmt->bShareKeyAlgorithm?"true":"false"); + DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "pDevice->bEncryptionEnable = %s\n",pDevice->bEncryptionEnable?"true":"false"); + DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "pDevice->bWPADevEnable = %s\n",pDevice->bWPADevEnable?"true":"false"); */ return ret; } @@ -2055,12 +2055,12 @@ if(param->u.wpa_key.alg_name == WPA_ALG_NONE) { if( pDevice->bwextcount == 4) { printk("SIOCSIWENCODEEXT:Enable WPA WEXT SUPPORT!!!!!\n"); pDevice->bwextcount=0; - pDevice->bWPASuppWextEnabled = TRUE; + pDevice->bWPASuppWextEnabled = true; } //****** spin_lock_irq(&pDevice->lock); - ret = wpa_set_keys(pDevice, param, TRUE); + ret = wpa_set_keys(pDevice, param, true); spin_unlock_irq(&pDevice->lock); error: @@ -2096,10 +2096,10 @@ int iwctl_siwmlme(struct net_device *dev, switch(mlme->cmd){ case IW_MLME_DEAUTH: //this command seems to be not complete,please test it --einsnliu - //bScheduleCommand((void *) pDevice, WLAN_CMD_DEAUTH, (PBYTE)&reason); + //bScheduleCommand((void *) pDevice, WLAN_CMD_DEAUTH, (unsigned char *)&reason); break; case IW_MLME_DISASSOC: - if(pDevice->bLinkPass == TRUE){ + if(pDevice->bLinkPass == true){ printk("iwctl_siwmlme--->send DISASSOCIATE\n"); //clear related flags memset(pMgmt->abyDesireBSSID, 0xFF,6); diff --git a/drivers/staging/vt6655/key.c b/drivers/staging/vt6655/key.c index bfc5c509d90..0ff8d7bbf2a 100644 --- a/drivers/staging/vt6655/key.c +++ b/drivers/staging/vt6655/key.c @@ -59,22 +59,22 @@ static int msglevel =MSG_LEVEL_INFO; /*--------------------- Static Functions --------------------------*/ static void -s_vCheckKeyTableValid (PSKeyManagement pTable, DWORD_PTR dwIoBase) +s_vCheckKeyTableValid (PSKeyManagement pTable, unsigned long dwIoBase) { int i; for (i=0;i<MAX_KEY_TABLE;i++) { - if ((pTable->KeyTable[i].bInUse == TRUE) && - (pTable->KeyTable[i].PairwiseKey.bKeyValid == FALSE) && - (pTable->KeyTable[i].GroupKey[0].bKeyValid == FALSE) && - (pTable->KeyTable[i].GroupKey[1].bKeyValid == FALSE) && - (pTable->KeyTable[i].GroupKey[2].bKeyValid == FALSE) && - (pTable->KeyTable[i].GroupKey[3].bKeyValid == FALSE) + if ((pTable->KeyTable[i].bInUse == true) && + (pTable->KeyTable[i].PairwiseKey.bKeyValid == false) && + (pTable->KeyTable[i].GroupKey[0].bKeyValid == false) && + (pTable->KeyTable[i].GroupKey[1].bKeyValid == false) && + (pTable->KeyTable[i].GroupKey[2].bKeyValid == false) && + (pTable->KeyTable[i].GroupKey[3].bKeyValid == false) ) { - pTable->KeyTable[i].bInUse = FALSE; + pTable->KeyTable[i].bInUse = false; pTable->KeyTable[i].wKeyCtl = 0; - pTable->KeyTable[i].bSoftWEP = FALSE; + pTable->KeyTable[i].bSoftWEP = false; MACvDisableKeyEntry(dwIoBase, i); } } @@ -96,22 +96,22 @@ s_vCheckKeyTableValid (PSKeyManagement pTable, DWORD_PTR dwIoBase) * Return Value: none * */ -void KeyvInitTable (PSKeyManagement pTable, DWORD_PTR dwIoBase) +void KeyvInitTable (PSKeyManagement pTable, unsigned long dwIoBase) { int i; int jj; for (i=0;i<MAX_KEY_TABLE;i++) { - pTable->KeyTable[i].bInUse = FALSE; - pTable->KeyTable[i].PairwiseKey.bKeyValid = FALSE; + pTable->KeyTable[i].bInUse = false; + pTable->KeyTable[i].PairwiseKey.bKeyValid = false; pTable->KeyTable[i].PairwiseKey.pvKeyTable = (void *)&pTable->KeyTable[i]; for (jj=0; jj < MAX_GROUP_KEY; jj++) { - pTable->KeyTable[i].GroupKey[jj].bKeyValid = FALSE; + pTable->KeyTable[i].GroupKey[jj].bKeyValid = false; pTable->KeyTable[i].GroupKey[jj].pvKeyTable = (void *)&pTable->KeyTable[i]; } pTable->KeyTable[i].wKeyCtl = 0; pTable->KeyTable[i].dwGTKeyIndex = 0; - pTable->KeyTable[i].bSoftWEP = FALSE; + pTable->KeyTable[i].bSoftWEP = false; MACvDisableKeyEntry(dwIoBase, i); } } @@ -128,13 +128,13 @@ void KeyvInitTable (PSKeyManagement pTable, DWORD_PTR dwIoBase) * Out: * pKey - Key return * - * Return Value: TRUE if found otherwise FALSE + * Return Value: true if found otherwise false * */ -BOOL KeybGetKey ( +bool KeybGetKey ( PSKeyManagement pTable, - PBYTE pbyBSSID, - DWORD dwKeyIndex, + unsigned char *pbyBSSID, + unsigned long dwKeyIndex, PSKeyItem *pKey ) { @@ -144,31 +144,31 @@ BOOL KeybGetKey ( *pKey = NULL; for (i=0;i<MAX_KEY_TABLE;i++) { - if ((pTable->KeyTable[i].bInUse == TRUE) && - IS_ETH_ADDRESS_EQUAL(pTable->KeyTable[i].abyBSSID,pbyBSSID)) { + if ((pTable->KeyTable[i].bInUse == true) && + !compare_ether_addr(pTable->KeyTable[i].abyBSSID, pbyBSSID)) { if (dwKeyIndex == 0xFFFFFFFF) { - if (pTable->KeyTable[i].PairwiseKey.bKeyValid == TRUE) { + if (pTable->KeyTable[i].PairwiseKey.bKeyValid == true) { *pKey = &(pTable->KeyTable[i].PairwiseKey); - return (TRUE); + return (true); } else { - return (FALSE); + return (false); } } else if (dwKeyIndex < MAX_GROUP_KEY) { - if (pTable->KeyTable[i].GroupKey[dwKeyIndex].bKeyValid == TRUE) { + if (pTable->KeyTable[i].GroupKey[dwKeyIndex].bKeyValid == true) { *pKey = &(pTable->KeyTable[i].GroupKey[dwKeyIndex]); - return (TRUE); + return (true); } else { - return (FALSE); + return (false); } } else { - return (FALSE); + return (false); } } } - return (FALSE); + return (false); } @@ -186,37 +186,37 @@ BOOL KeybGetKey ( * Out: * none * - * Return Value: TRUE if success otherwise FALSE + * Return Value: true if success otherwise false * */ -BOOL KeybSetKey ( +bool KeybSetKey ( PSKeyManagement pTable, - PBYTE pbyBSSID, - DWORD dwKeyIndex, - ULONG uKeyLength, + unsigned char *pbyBSSID, + unsigned long dwKeyIndex, + unsigned long uKeyLength, PQWORD pKeyRSC, - PBYTE pbyKey, - BYTE byKeyDecMode, - DWORD_PTR dwIoBase, - BYTE byLocalID + unsigned char *pbyKey, + unsigned char byKeyDecMode, + unsigned long dwIoBase, + unsigned char byLocalID ) { int i,j; - UINT ii; + unsigned int ii; PSKeyItem pKey; - UINT uKeyIdx; + unsigned int uKeyIdx; DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"Enter KeybSetKey: %lX\n", dwKeyIndex); j = (MAX_KEY_TABLE-1); for (i=0;i<(MAX_KEY_TABLE-1);i++) { - if ((pTable->KeyTable[i].bInUse == FALSE) && + if ((pTable->KeyTable[i].bInUse == false) && (j == (MAX_KEY_TABLE-1))) { // found empty table j = i; } - if ((pTable->KeyTable[i].bInUse == TRUE) && - IS_ETH_ADDRESS_EQUAL(pTable->KeyTable[i].abyBSSID,pbyBSSID)) { + if ((pTable->KeyTable[i].bInUse == true) && + !compare_ether_addr(pTable->KeyTable[i].abyBSSID, pbyBSSID)) { // found table already exist if ((dwKeyIndex & PAIRWISE_KEY) != 0) { // Pairwise key @@ -227,7 +227,7 @@ BOOL KeybSetKey ( } else { // Group key if ((dwKeyIndex & 0x000000FF) >= MAX_GROUP_KEY) - return (FALSE); + return (false); pKey = &(pTable->KeyTable[i].GroupKey[dwKeyIndex & 0x000000FF]); if ((dwKeyIndex & TRANSMIT_KEY) != 0) { // Group transmit key @@ -241,7 +241,7 @@ BOOL KeybSetKey ( } pTable->KeyTable[i].wKeyCtl |= 0x8000; // enable on-fly - pKey->bKeyValid = TRUE; + pKey->bKeyValid = true; pKey->uKeyLength = uKeyLength; pKey->dwKeyIndex = dwKeyIndex; pKey->byCipherSuite = byKeyDecMode; @@ -252,7 +252,7 @@ BOOL KeybSetKey ( if (uKeyLength == WLAN_WEP104_KEYLEN) pKey->abyKey[15] |= 0x80; } - MACvSetKeyEntry(dwIoBase, pTable->KeyTable[i].wKeyCtl, i, uKeyIdx, pbyBSSID, (PDWORD)pKey->abyKey, byLocalID); + MACvSetKeyEntry(dwIoBase, pTable->KeyTable[i].wKeyCtl, i, uKeyIdx, pbyBSSID, (unsigned long *)pKey->abyKey, byLocalID); if ((dwKeyIndex & USE_KEYRSC) == 0) { // RSC set by NIC @@ -277,12 +277,12 @@ BOOL KeybSetKey ( DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"pKey->wTSC15_0: %x\n ", pKey->wTSC15_0); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"pKey->dwKeyIndex: %lx\n ", pKey->dwKeyIndex); - return (TRUE); + return (true); } } if (j < (MAX_KEY_TABLE-1)) { memcpy(pTable->KeyTable[j].abyBSSID,pbyBSSID,ETH_ALEN); - pTable->KeyTable[j].bInUse = TRUE; + pTable->KeyTable[j].bInUse = true; if ((dwKeyIndex & PAIRWISE_KEY) != 0) { // Pairwise key pKey = &(pTable->KeyTable[j].PairwiseKey); @@ -292,7 +292,7 @@ BOOL KeybSetKey ( } else { // Group key if ((dwKeyIndex & 0x000000FF) >= MAX_GROUP_KEY) - return (FALSE); + return (false); pKey = &(pTable->KeyTable[j].GroupKey[dwKeyIndex & 0x000000FF]); if ((dwKeyIndex & TRANSMIT_KEY) != 0) { // Group transmit key @@ -306,7 +306,7 @@ BOOL KeybSetKey ( } pTable->KeyTable[j].wKeyCtl |= 0x8000; // enable on-fly - pKey->bKeyValid = TRUE; + pKey->bKeyValid = true; pKey->uKeyLength = uKeyLength; pKey->dwKeyIndex = dwKeyIndex; pKey->byCipherSuite = byKeyDecMode; @@ -317,7 +317,7 @@ BOOL KeybSetKey ( if (uKeyLength == WLAN_WEP104_KEYLEN) pKey->abyKey[15] |= 0x80; } - MACvSetKeyEntry(dwIoBase, pTable->KeyTable[j].wKeyCtl, j, uKeyIdx, pbyBSSID, (PDWORD)pKey->abyKey, byLocalID); + MACvSetKeyEntry(dwIoBase, pTable->KeyTable[j].wKeyCtl, j, uKeyIdx, pbyBSSID, (unsigned long *)pKey->abyKey, byLocalID); if ((dwKeyIndex & USE_KEYRSC) == 0) { // RSC set by NIC @@ -342,9 +342,9 @@ BOOL KeybSetKey ( DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"pKey->wTSC15_0: %x\n ", pKey->wTSC15_0); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"pKey->dwKeyIndex: %lx\n ", pKey->dwKeyIndex); - return (TRUE); + return (true); } - return (FALSE); + return (false); } @@ -359,66 +359,66 @@ BOOL KeybSetKey ( * Out: * none * - * Return Value: TRUE if success otherwise FALSE + * Return Value: true if success otherwise false * */ -BOOL KeybRemoveKey ( +bool KeybRemoveKey ( PSKeyManagement pTable, - PBYTE pbyBSSID, - DWORD dwKeyIndex, - DWORD_PTR dwIoBase + unsigned char *pbyBSSID, + unsigned long dwKeyIndex, + unsigned long dwIoBase ) { int i; - if (IS_BROADCAST_ADDRESS(pbyBSSID)) { + if (is_broadcast_ether_addr(pbyBSSID)) { // dealte all key if ((dwKeyIndex & PAIRWISE_KEY) != 0) { for (i=0;i<MAX_KEY_TABLE;i++) { - pTable->KeyTable[i].PairwiseKey.bKeyValid = FALSE; + pTable->KeyTable[i].PairwiseKey.bKeyValid = false; } s_vCheckKeyTableValid(pTable, dwIoBase); - return TRUE; + return true; } else if ((dwKeyIndex & 0x000000FF) < MAX_GROUP_KEY) { for (i=0;i<MAX_KEY_TABLE;i++) { - pTable->KeyTable[i].GroupKey[dwKeyIndex & 0x000000FF].bKeyValid = FALSE; + pTable->KeyTable[i].GroupKey[dwKeyIndex & 0x000000FF].bKeyValid = false; if ((dwKeyIndex & 0x7FFFFFFF) == (pTable->KeyTable[i].dwGTKeyIndex & 0x7FFFFFFF)) { // remove Group transmit key pTable->KeyTable[i].dwGTKeyIndex = 0; } } s_vCheckKeyTableValid(pTable, dwIoBase); - return TRUE; + return true; } else { - return FALSE; + return false; } } for (i=0;i<MAX_KEY_TABLE;i++) { - if ((pTable->KeyTable[i].bInUse == TRUE) && - IS_ETH_ADDRESS_EQUAL(pTable->KeyTable[i].abyBSSID,pbyBSSID)) { + if ((pTable->KeyTable[i].bInUse == true) && + !compare_ether_addr(pTable->KeyTable[i].abyBSSID, pbyBSSID)) { if ((dwKeyIndex & PAIRWISE_KEY) != 0) { - pTable->KeyTable[i].PairwiseKey.bKeyValid = FALSE; + pTable->KeyTable[i].PairwiseKey.bKeyValid = false; s_vCheckKeyTableValid(pTable, dwIoBase); - return (TRUE); + return (true); } else if ((dwKeyIndex & 0x000000FF) < MAX_GROUP_KEY) { - pTable->KeyTable[i].GroupKey[dwKeyIndex & 0x000000FF].bKeyValid = FALSE; + pTable->KeyTable[i].GroupKey[dwKeyIndex & 0x000000FF].bKeyValid = false; if ((dwKeyIndex & 0x7FFFFFFF) == (pTable->KeyTable[i].dwGTKeyIndex & 0x7FFFFFFF)) { // remove Group transmit key pTable->KeyTable[i].dwGTKeyIndex = 0; } s_vCheckKeyTableValid(pTable, dwIoBase); - return (TRUE); + return (true); } else { - return (FALSE); + return (false); } } } - return (FALSE); + return (false); } @@ -432,30 +432,30 @@ BOOL KeybRemoveKey ( * Out: * none * - * Return Value: TRUE if success otherwise FALSE + * Return Value: true if success otherwise false * */ -BOOL KeybRemoveAllKey ( +bool KeybRemoveAllKey ( PSKeyManagement pTable, - PBYTE pbyBSSID, - DWORD_PTR dwIoBase + unsigned char *pbyBSSID, + unsigned long dwIoBase ) { int i,u; for (i=0;i<MAX_KEY_TABLE;i++) { - if ((pTable->KeyTable[i].bInUse == TRUE) && - IS_ETH_ADDRESS_EQUAL(pTable->KeyTable[i].abyBSSID,pbyBSSID)) { - pTable->KeyTable[i].PairwiseKey.bKeyValid = FALSE; + if ((pTable->KeyTable[i].bInUse == true) && + !compare_ether_addr(pTable->KeyTable[i].abyBSSID, pbyBSSID)) { + pTable->KeyTable[i].PairwiseKey.bKeyValid = false; for(u=0;u<MAX_GROUP_KEY;u++) { - pTable->KeyTable[i].GroupKey[u].bKeyValid = FALSE; + pTable->KeyTable[i].GroupKey[u].bKeyValid = false; } pTable->KeyTable[i].dwGTKeyIndex = 0; s_vCheckKeyTableValid(pTable, dwIoBase); - return (TRUE); + return (true); } } - return (FALSE); + return (false); } /* @@ -467,20 +467,20 @@ BOOL KeybRemoveAllKey ( * Out: * none * - * Return Value: TRUE if success otherwise FALSE + * Return Value: true if success otherwise false * */ void KeyvRemoveWEPKey ( PSKeyManagement pTable, - DWORD dwKeyIndex, - DWORD_PTR dwIoBase + unsigned long dwKeyIndex, + unsigned long dwIoBase ) { if ((dwKeyIndex & 0x000000FF) < MAX_GROUP_KEY) { - if (pTable->KeyTable[MAX_KEY_TABLE-1].bInUse == TRUE) { + if (pTable->KeyTable[MAX_KEY_TABLE-1].bInUse == true) { if (pTable->KeyTable[MAX_KEY_TABLE-1].GroupKey[dwKeyIndex & 0x000000FF].byCipherSuite == KEY_CTL_WEP) { - pTable->KeyTable[MAX_KEY_TABLE-1].GroupKey[dwKeyIndex & 0x000000FF].bKeyValid = FALSE; + pTable->KeyTable[MAX_KEY_TABLE-1].GroupKey[dwKeyIndex & 0x000000FF].bKeyValid = false; if ((dwKeyIndex & 0x7FFFFFFF) == (pTable->KeyTable[MAX_KEY_TABLE-1].dwGTKeyIndex & 0x7FFFFFFF)) { // remove Group transmit key pTable->KeyTable[MAX_KEY_TABLE-1].dwGTKeyIndex = 0; @@ -494,7 +494,7 @@ void KeyvRemoveWEPKey ( void KeyvRemoveAllWEPKey ( PSKeyManagement pTable, - DWORD_PTR dwIoBase + unsigned long dwIoBase ) { int i; @@ -514,13 +514,13 @@ void KeyvRemoveAllWEPKey ( * Out: * pKey - Key return * - * Return Value: TRUE if found otherwise FALSE + * Return Value: true if found otherwise false * */ -BOOL KeybGetTransmitKey ( +bool KeybGetTransmitKey ( PSKeyManagement pTable, - PBYTE pbyBSSID, - DWORD dwKeyType, + unsigned char *pbyBSSID, + unsigned long dwKeyType, PSKeyItem *pKey ) { @@ -528,12 +528,12 @@ BOOL KeybGetTransmitKey ( *pKey = NULL; for (i=0;i<MAX_KEY_TABLE;i++) { - if ((pTable->KeyTable[i].bInUse == TRUE) && - IS_ETH_ADDRESS_EQUAL(pTable->KeyTable[i].abyBSSID,pbyBSSID)) { + if ((pTable->KeyTable[i].bInUse == true) && + !compare_ether_addr(pTable->KeyTable[i].abyBSSID, pbyBSSID)) { if (dwKeyType == PAIRWISE_KEY) { - if (pTable->KeyTable[i].PairwiseKey.bKeyValid == TRUE) { + if (pTable->KeyTable[i].PairwiseKey.bKeyValid == true) { *pKey = &(pTable->KeyTable[i].PairwiseKey); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"KeybGetTransmitKey:"); @@ -544,19 +544,19 @@ BOOL KeybGetTransmitKey ( DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"\n"); - return (TRUE); + return (true); } else { - DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"PairwiseKey.bKeyValid == FALSE\n"); - return (FALSE); + DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"PairwiseKey.bKeyValid == false\n"); + return (false); } } // End of Type == PAIRWISE else { if (pTable->KeyTable[i].dwGTKeyIndex == 0) { DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"ERROR: dwGTKeyIndex == 0 !!!\n"); - return FALSE; + return false; } - if (pTable->KeyTable[i].GroupKey[(pTable->KeyTable[i].dwGTKeyIndex&0x000000FF)].bKeyValid == TRUE) { + if (pTable->KeyTable[i].GroupKey[(pTable->KeyTable[i].dwGTKeyIndex&0x000000FF)].bKeyValid == true) { *pKey = &(pTable->KeyTable[i].GroupKey[(pTable->KeyTable[i].dwGTKeyIndex&0x000000FF)]); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"KeybGetTransmitKey:"); @@ -567,11 +567,11 @@ BOOL KeybGetTransmitKey ( DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"\n"); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"dwGTKeyIndex: %lX\n", pTable->KeyTable[i].dwGTKeyIndex); - return (TRUE); + return (true); } else { - DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"GroupKey.bKeyValid == FALSE\n"); - return (FALSE); + DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"GroupKey.bKeyValid == false\n"); + return (false); } } // End of Type = GROUP } // BSSID match @@ -581,7 +581,7 @@ BOOL KeybGetTransmitKey ( DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"%02x ", *(pbyBSSID+ii)); } DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"\n"); - return (FALSE); + return (false); } @@ -594,10 +594,10 @@ BOOL KeybGetTransmitKey ( * Out: * none * - * Return Value: TRUE if found otherwise FALSE + * Return Value: true if found otherwise false * */ -BOOL KeybCheckPairewiseKey ( +bool KeybCheckPairewiseKey ( PSKeyManagement pTable, PSKeyItem *pKey ) @@ -606,13 +606,13 @@ BOOL KeybCheckPairewiseKey ( *pKey = NULL; for (i=0;i<MAX_KEY_TABLE;i++) { - if ((pTable->KeyTable[i].bInUse == TRUE) && - (pTable->KeyTable[i].PairwiseKey.bKeyValid == TRUE)) { + if ((pTable->KeyTable[i].bInUse == true) && + (pTable->KeyTable[i].PairwiseKey.bKeyValid == true)) { *pKey = &(pTable->KeyTable[i].PairwiseKey); - return (TRUE); + return (true); } } - return (FALSE); + return (false); } /* @@ -628,34 +628,34 @@ BOOL KeybCheckPairewiseKey ( * Out: * none * - * Return Value: TRUE if success otherwise FALSE + * Return Value: true if success otherwise false * */ -BOOL KeybSetDefaultKey ( +bool KeybSetDefaultKey ( PSKeyManagement pTable, - DWORD dwKeyIndex, - ULONG uKeyLength, + unsigned long dwKeyIndex, + unsigned long uKeyLength, PQWORD pKeyRSC, - PBYTE pbyKey, - BYTE byKeyDecMode, - DWORD_PTR dwIoBase, - BYTE byLocalID + unsigned char *pbyKey, + unsigned char byKeyDecMode, + unsigned long dwIoBase, + unsigned char byLocalID ) { - UINT ii; + unsigned int ii; PSKeyItem pKey; - UINT uKeyIdx; + unsigned int uKeyIdx; DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"Enter KeybSetDefaultKey: %1x, %d \n", (int)dwKeyIndex, (int)uKeyLength); if ((dwKeyIndex & PAIRWISE_KEY) != 0) { // Pairwise key - return (FALSE); + return (false); } else if ((dwKeyIndex & 0x000000FF) >= MAX_GROUP_KEY) { - return (FALSE); + return (false); } - pTable->KeyTable[MAX_KEY_TABLE-1].bInUse = TRUE; + pTable->KeyTable[MAX_KEY_TABLE-1].bInUse = true; for(ii=0;ii<ETH_ALEN;ii++) pTable->KeyTable[MAX_KEY_TABLE-1].abyBSSID[ii] = 0xFF; @@ -676,13 +676,13 @@ BOOL KeybSetDefaultKey ( if ((uKeyLength == WLAN_WEP232_KEYLEN) && (byKeyDecMode == KEY_CTL_WEP)) { pTable->KeyTable[MAX_KEY_TABLE-1].wKeyCtl |= 0x4000; // disable on-fly disable address match - pTable->KeyTable[MAX_KEY_TABLE-1].bSoftWEP = TRUE; + pTable->KeyTable[MAX_KEY_TABLE-1].bSoftWEP = true; } else { - if (pTable->KeyTable[MAX_KEY_TABLE-1].bSoftWEP == FALSE) + if (pTable->KeyTable[MAX_KEY_TABLE-1].bSoftWEP == false) pTable->KeyTable[MAX_KEY_TABLE-1].wKeyCtl |= 0xC000; // enable on-fly disable address match } - pKey->bKeyValid = TRUE; + pKey->bKeyValid = true; pKey->uKeyLength = uKeyLength; pKey->dwKeyIndex = dwKeyIndex; pKey->byCipherSuite = byKeyDecMode; @@ -693,7 +693,7 @@ BOOL KeybSetDefaultKey ( if (uKeyLength == WLAN_WEP104_KEYLEN) pKey->abyKey[15] |= 0x80; } - MACvSetKeyEntry(dwIoBase, pTable->KeyTable[MAX_KEY_TABLE-1].wKeyCtl, MAX_KEY_TABLE-1, uKeyIdx, pTable->KeyTable[MAX_KEY_TABLE-1].abyBSSID, (PDWORD)pKey->abyKey, byLocalID); + MACvSetKeyEntry(dwIoBase, pTable->KeyTable[MAX_KEY_TABLE-1].wKeyCtl, MAX_KEY_TABLE-1, uKeyIdx, pTable->KeyTable[MAX_KEY_TABLE-1].abyBSSID, (unsigned long *)pKey->abyKey, byLocalID); if ((dwKeyIndex & USE_KEYRSC) == 0) { // RSC set by NIC @@ -718,7 +718,7 @@ BOOL KeybSetDefaultKey ( DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"pKey->wTSC15_0: %x\n", pKey->wTSC15_0); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"pKey->dwKeyIndex: %lx\n", pKey->dwKeyIndex); - return (TRUE); + return (true); } @@ -735,36 +735,36 @@ BOOL KeybSetDefaultKey ( * Out: * none * - * Return Value: TRUE if success otherwise FALSE + * Return Value: true if success otherwise false * */ -BOOL KeybSetAllGroupKey ( +bool KeybSetAllGroupKey ( PSKeyManagement pTable, - DWORD dwKeyIndex, - ULONG uKeyLength, + unsigned long dwKeyIndex, + unsigned long uKeyLength, PQWORD pKeyRSC, - PBYTE pbyKey, - BYTE byKeyDecMode, - DWORD_PTR dwIoBase, - BYTE byLocalID + unsigned char *pbyKey, + unsigned char byKeyDecMode, + unsigned long dwIoBase, + unsigned char byLocalID ) { int i; - UINT ii; + unsigned int ii; PSKeyItem pKey; - UINT uKeyIdx; + unsigned int uKeyIdx; DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"Enter KeybSetAllGroupKey: %lX\n", dwKeyIndex); if ((dwKeyIndex & PAIRWISE_KEY) != 0) { // Pairwise key - return (FALSE); + return (false); } else if ((dwKeyIndex & 0x000000FF) >= MAX_GROUP_KEY) { - return (FALSE); + return (false); } for (i=0; i < MAX_KEY_TABLE-1; i++) { - if (pTable->KeyTable[i].bInUse == TRUE) { + if (pTable->KeyTable[i].bInUse == true) { // found table already exist // Group key pKey = &(pTable->KeyTable[i].GroupKey[dwKeyIndex & 0x000000FF]); @@ -781,7 +781,7 @@ BOOL KeybSetAllGroupKey ( pTable->KeyTable[i].wKeyCtl |= 0x8000; // enable on-fly - pKey->bKeyValid = TRUE; + pKey->bKeyValid = true; pKey->uKeyLength = uKeyLength; pKey->dwKeyIndex = dwKeyIndex; pKey->byCipherSuite = byKeyDecMode; @@ -792,7 +792,7 @@ BOOL KeybSetAllGroupKey ( if (uKeyLength == WLAN_WEP104_KEYLEN) pKey->abyKey[15] |= 0x80; } - MACvSetKeyEntry(dwIoBase, pTable->KeyTable[i].wKeyCtl, i, uKeyIdx, pTable->KeyTable[i].abyBSSID, (PDWORD)pKey->abyKey, byLocalID); + MACvSetKeyEntry(dwIoBase, pTable->KeyTable[i].wKeyCtl, i, uKeyIdx, pTable->KeyTable[i].abyBSSID, (unsigned long *)pKey->abyKey, byLocalID); if ((dwKeyIndex & USE_KEYRSC) == 0) { // RSC set by NIC @@ -817,7 +817,7 @@ BOOL KeybSetAllGroupKey ( //DBG_PRN_GRP12(("pKey->wTSC15_0: %X\n ", pKey->wTSC15_0)); //DBG_PRN_GRP12(("pKey->dwKeyIndex: %lX\n ", pKey->dwKeyIndex)); - } // (pTable->KeyTable[i].bInUse == TRUE) + } // (pTable->KeyTable[i].bInUse == true) } - return (TRUE); + return (true); } diff --git a/drivers/staging/vt6655/key.h b/drivers/staging/vt6655/key.h index 39403d93aeb..6b2dad331a5 100644 --- a/drivers/staging/vt6655/key.h +++ b/drivers/staging/vt6655/key.h @@ -57,33 +57,33 @@ typedef struct tagSKeyItem { - BOOL bKeyValid; - ULONG uKeyLength; - BYTE abyKey[MAX_KEY_LEN]; + bool bKeyValid; + unsigned long uKeyLength; + unsigned char abyKey[MAX_KEY_LEN]; QWORD KeyRSC; - DWORD dwTSC47_16; - WORD wTSC15_0; - BYTE byCipherSuite; - BYTE byReserved0; - DWORD dwKeyIndex; + unsigned long dwTSC47_16; + unsigned short wTSC15_0; + unsigned char byCipherSuite; + unsigned char byReserved0; + unsigned long dwKeyIndex; void *pvKeyTable; } SKeyItem, *PSKeyItem; //64 typedef struct tagSKeyTable { - BYTE abyBSSID[ETH_ALEN]; //6 - BYTE byReserved0[2]; //8 + unsigned char abyBSSID[ETH_ALEN]; //6 + unsigned char byReserved0[2]; //8 SKeyItem PairwiseKey; SKeyItem GroupKey[MAX_GROUP_KEY]; //64*5 = 320, 320+8=328 - DWORD dwGTKeyIndex; // GroupTransmitKey Index - BOOL bInUse; + unsigned long dwGTKeyIndex; // GroupTransmitKey Index + bool bInUse; //2006-1116-01,<Modify> by NomadZhao - //WORD wKeyCtl; - //BOOL bSoftWEP; - BOOL bSoftWEP; - WORD wKeyCtl; // for address of wKeyCtl at align 4 + //unsigned short wKeyCtl; + //bool bSoftWEP; + bool bSoftWEP; + unsigned short wKeyCtl; // for address of wKeyCtl at align 4 - BYTE byReserved1[6]; + unsigned char byReserved1[6]; } SKeyTable, *PSKeyTable; //348 typedef struct tagSKeyManagement @@ -101,83 +101,83 @@ typedef struct tagSKeyManagement /*--------------------- Export Functions --------------------------*/ -void KeyvInitTable(PSKeyManagement pTable, DWORD_PTR dwIoBase); +void KeyvInitTable(PSKeyManagement pTable, unsigned long dwIoBase); -BOOL KeybGetKey( +bool KeybGetKey( PSKeyManagement pTable, - PBYTE pbyBSSID, - DWORD dwKeyIndex, + unsigned char *pbyBSSID, + unsigned long dwKeyIndex, PSKeyItem *pKey ); -BOOL KeybSetKey( +bool KeybSetKey( PSKeyManagement pTable, - PBYTE pbyBSSID, - DWORD dwKeyIndex, - ULONG uKeyLength, + unsigned char *pbyBSSID, + unsigned long dwKeyIndex, + unsigned long uKeyLength, PQWORD pKeyRSC, - PBYTE pbyKey, - BYTE byKeyDecMode, - DWORD_PTR dwIoBase, - BYTE byLocalID + unsigned char *pbyKey, + unsigned char byKeyDecMode, + unsigned long dwIoBase, + unsigned char byLocalID ); -BOOL KeybSetDefaultKey( +bool KeybSetDefaultKey( PSKeyManagement pTable, - DWORD dwKeyIndex, - ULONG uKeyLength, + unsigned long dwKeyIndex, + unsigned long uKeyLength, PQWORD pKeyRSC, - PBYTE pbyKey, - BYTE byKeyDecMode, - DWORD_PTR dwIoBase, - BYTE byLocalID + unsigned char *pbyKey, + unsigned char byKeyDecMode, + unsigned long dwIoBase, + unsigned char byLocalID ); -BOOL KeybRemoveKey( +bool KeybRemoveKey( PSKeyManagement pTable, - PBYTE pbyBSSID, - DWORD dwKeyIndex, - DWORD_PTR dwIoBase + unsigned char *pbyBSSID, + unsigned long dwKeyIndex, + unsigned long dwIoBase ); -BOOL KeybGetTransmitKey( +bool KeybGetTransmitKey( PSKeyManagement pTable, - PBYTE pbyBSSID, - DWORD dwKeyType, + unsigned char *pbyBSSID, + unsigned long dwKeyType, PSKeyItem *pKey ); -BOOL KeybCheckPairewiseKey( +bool KeybCheckPairewiseKey( PSKeyManagement pTable, PSKeyItem *pKey ); -BOOL KeybRemoveAllKey( +bool KeybRemoveAllKey( PSKeyManagement pTable, - PBYTE pbyBSSID, - DWORD_PTR dwIoBase + unsigned char *pbyBSSID, + unsigned long dwIoBase ); void KeyvRemoveWEPKey( PSKeyManagement pTable, - DWORD dwKeyIndex, - DWORD_PTR dwIoBase + unsigned long dwKeyIndex, + unsigned long dwIoBase ); void KeyvRemoveAllWEPKey( PSKeyManagement pTable, - DWORD_PTR dwIoBase + unsigned long dwIoBase ); -BOOL KeybSetAllGroupKey ( +bool KeybSetAllGroupKey ( PSKeyManagement pTable, - DWORD dwKeyIndex, - ULONG uKeyLength, + unsigned long dwKeyIndex, + unsigned long uKeyLength, PQWORD pKeyRSC, - PBYTE pbyKey, - BYTE byKeyDecMode, - DWORD_PTR dwIoBase, - BYTE byLocalID + unsigned char *pbyKey, + unsigned char byKeyDecMode, + unsigned long dwIoBase, + unsigned char byLocalID ); #endif // __KEY_H__ diff --git a/drivers/staging/vt6655/mac.c b/drivers/staging/vt6655/mac.c index f1ef7da75c2..f8d1651341f 100644 --- a/drivers/staging/vt6655/mac.c +++ b/drivers/staging/vt6655/mac.c @@ -72,7 +72,7 @@ #include "tether.h" #include "mac.h" -WORD TxRate_iwconfig;//2008-5-8 <add> by chester +unsigned short TxRate_iwconfig;//2008-5-8 <add> by chester /*--------------------- Static Definitions -------------------------*/ //static int msglevel =MSG_LEVEL_DEBUG; static int msglevel =MSG_LEVEL_INFO; @@ -103,7 +103,7 @@ static int msglevel =MSG_LEVEL_INFO; * Return Value: none * */ -void MACvReadAllRegs (DWORD_PTR dwIoBase, PBYTE pbyMacRegs) +void MACvReadAllRegs (unsigned long dwIoBase, unsigned char *pbyMacRegs) { int ii; @@ -137,12 +137,12 @@ void MACvReadAllRegs (DWORD_PTR dwIoBase, PBYTE pbyMacRegs) * Out: * none * - * Return Value: TRUE if all test bits On; otherwise FALSE + * Return Value: true if all test bits On; otherwise false * */ -BOOL MACbIsRegBitsOn (DWORD_PTR dwIoBase, BYTE byRegOfs, BYTE byTestBits) +bool MACbIsRegBitsOn (unsigned long dwIoBase, unsigned char byRegOfs, unsigned char byTestBits) { - BYTE byData; + unsigned char byData; VNSvInPortB(dwIoBase + byRegOfs, &byData); return (byData & byTestBits) == byTestBits; @@ -160,12 +160,12 @@ BOOL MACbIsRegBitsOn (DWORD_PTR dwIoBase, BYTE byRegOfs, BYTE byTestBits) * Out: * none * - * Return Value: TRUE if all test bits Off; otherwise FALSE + * Return Value: true if all test bits Off; otherwise false * */ -BOOL MACbIsRegBitsOff (DWORD_PTR dwIoBase, BYTE byRegOfs, BYTE byTestBits) +bool MACbIsRegBitsOff (unsigned long dwIoBase, unsigned char byRegOfs, unsigned char byTestBits) { - BYTE byData; + unsigned char byData; VNSvInPortB(dwIoBase + byRegOfs, &byData); return !(byData & byTestBits); @@ -181,18 +181,18 @@ BOOL MACbIsRegBitsOff (DWORD_PTR dwIoBase, BYTE byRegOfs, BYTE byTestBits) * Out: * none * - * Return Value: TRUE if interrupt is disable; otherwise FALSE + * Return Value: true if interrupt is disable; otherwise false * */ -BOOL MACbIsIntDisable (DWORD_PTR dwIoBase) +bool MACbIsIntDisable (unsigned long dwIoBase) { - DWORD dwData; + unsigned long dwData; VNSvInPortD(dwIoBase + MAC_REG_IMR, &dwData); if (dwData != 0) - return FALSE; + return false; - return TRUE; + return true; } /* @@ -209,9 +209,9 @@ BOOL MACbIsIntDisable (DWORD_PTR dwIoBase) * Return Value: Mask Value read * */ -BYTE MACbyReadMultiAddr (DWORD_PTR dwIoBase, UINT uByteIdx) +unsigned char MACbyReadMultiAddr (unsigned long dwIoBase, unsigned int uByteIdx) { - BYTE byData; + unsigned char byData; MACvSelectPage1(dwIoBase); VNSvInPortB(dwIoBase + MAC_REG_MAR0 + uByteIdx, &byData); @@ -234,7 +234,7 @@ BYTE MACbyReadMultiAddr (DWORD_PTR dwIoBase, UINT uByteIdx) * Return Value: none * */ -void MACvWriteMultiAddr (DWORD_PTR dwIoBase, UINT uByteIdx, BYTE byData) +void MACvWriteMultiAddr (unsigned long dwIoBase, unsigned int uByteIdx, unsigned char byData) { MACvSelectPage1(dwIoBase); VNSvOutPortB(dwIoBase + MAC_REG_MAR0 + uByteIdx, byData); @@ -255,11 +255,11 @@ void MACvWriteMultiAddr (DWORD_PTR dwIoBase, UINT uByteIdx, BYTE byData) * Return Value: none * */ -void MACvSetMultiAddrByHash (DWORD_PTR dwIoBase, BYTE byHashIdx) +void MACvSetMultiAddrByHash (unsigned long dwIoBase, unsigned char byHashIdx) { - UINT uByteIdx; - BYTE byBitMask; - BYTE byOrgValue; + unsigned int uByteIdx; + unsigned char byBitMask; + unsigned char byOrgValue; // calculate byte position uByteIdx = byHashIdx / 8; @@ -269,7 +269,7 @@ void MACvSetMultiAddrByHash (DWORD_PTR dwIoBase, BYTE byHashIdx) byBitMask <<= (byHashIdx % 8); // turn on the bit byOrgValue = MACbyReadMultiAddr(dwIoBase, uByteIdx); - MACvWriteMultiAddr(dwIoBase, uByteIdx, (BYTE)(byOrgValue | byBitMask)); + MACvWriteMultiAddr(dwIoBase, uByteIdx, (unsigned char)(byOrgValue | byBitMask)); } /* @@ -286,11 +286,11 @@ void MACvSetMultiAddrByHash (DWORD_PTR dwIoBase, BYTE byHashIdx) * Return Value: none * */ -void MACvResetMultiAddrByHash (DWORD_PTR dwIoBase, BYTE byHashIdx) +void MACvResetMultiAddrByHash (unsigned long dwIoBase, unsigned char byHashIdx) { - UINT uByteIdx; - BYTE byBitMask; - BYTE byOrgValue; + unsigned int uByteIdx; + unsigned char byBitMask; + unsigned char byOrgValue; // calculate byte position uByteIdx = byHashIdx / 8; @@ -300,7 +300,7 @@ void MACvResetMultiAddrByHash (DWORD_PTR dwIoBase, BYTE byHashIdx) byBitMask <<= (byHashIdx % 8); // turn off the bit byOrgValue = MACbyReadMultiAddr(dwIoBase, uByteIdx); - MACvWriteMultiAddr(dwIoBase, uByteIdx, (BYTE)(byOrgValue & (~byBitMask))); + MACvWriteMultiAddr(dwIoBase, uByteIdx, (unsigned char)(byOrgValue & (~byBitMask))); } /* @@ -317,9 +317,9 @@ void MACvResetMultiAddrByHash (DWORD_PTR dwIoBase, BYTE byHashIdx) * Return Value: none * */ -void MACvSetRxThreshold (DWORD_PTR dwIoBase, BYTE byThreshold) +void MACvSetRxThreshold (unsigned long dwIoBase, unsigned char byThreshold) { - BYTE byOrgValue; + unsigned char byOrgValue; ASSERT(byThreshold < 4); @@ -342,7 +342,7 @@ void MACvSetRxThreshold (DWORD_PTR dwIoBase, BYTE byThreshold) * Return Value: none * */ -void MACvGetRxThreshold (DWORD_PTR dwIoBase, PBYTE pbyThreshold) +void MACvGetRxThreshold (unsigned long dwIoBase, unsigned char *pbyThreshold) { // get FCR0 VNSvInPortB(dwIoBase + MAC_REG_FCR0, pbyThreshold); @@ -363,9 +363,9 @@ void MACvGetRxThreshold (DWORD_PTR dwIoBase, PBYTE pbyThreshold) * Return Value: none * */ -void MACvSetTxThreshold (DWORD_PTR dwIoBase, BYTE byThreshold) +void MACvSetTxThreshold (unsigned long dwIoBase, unsigned char byThreshold) { - BYTE byOrgValue; + unsigned char byOrgValue; ASSERT(byThreshold < 4); @@ -388,7 +388,7 @@ void MACvSetTxThreshold (DWORD_PTR dwIoBase, BYTE byThreshold) * Return Value: none * */ -void MACvGetTxThreshold (DWORD_PTR dwIoBase, PBYTE pbyThreshold) +void MACvGetTxThreshold (unsigned long dwIoBase, unsigned char *pbyThreshold) { // get FCR0 VNSvInPortB(dwIoBase + MAC_REG_FCR0, pbyThreshold); @@ -409,9 +409,9 @@ void MACvGetTxThreshold (DWORD_PTR dwIoBase, PBYTE pbyThreshold) * Return Value: none * */ -void MACvSetDmaLength (DWORD_PTR dwIoBase, BYTE byDmaLength) +void MACvSetDmaLength (unsigned long dwIoBase, unsigned char byDmaLength) { - BYTE byOrgValue; + unsigned char byOrgValue; ASSERT(byDmaLength < 4); @@ -434,7 +434,7 @@ void MACvSetDmaLength (DWORD_PTR dwIoBase, BYTE byDmaLength) * Return Value: none * */ -void MACvGetDmaLength (DWORD_PTR dwIoBase, PBYTE pbyDmaLength) +void MACvGetDmaLength (unsigned long dwIoBase, unsigned char *pbyDmaLength) { // get FCR0 VNSvInPortB(dwIoBase + MAC_REG_FCR0, pbyDmaLength); @@ -455,7 +455,7 @@ void MACvGetDmaLength (DWORD_PTR dwIoBase, PBYTE pbyDmaLength) * Return Value: none * */ -void MACvSetShortRetryLimit (DWORD_PTR dwIoBase, BYTE byRetryLimit) +void MACvSetShortRetryLimit (unsigned long dwIoBase, unsigned char byRetryLimit) { // set SRT VNSvOutPortB(dwIoBase + MAC_REG_SRT, byRetryLimit); @@ -474,7 +474,7 @@ void MACvSetShortRetryLimit (DWORD_PTR dwIoBase, BYTE byRetryLimit) * Return Value: none * */ -void MACvGetShortRetryLimit (DWORD_PTR dwIoBase, PBYTE pbyRetryLimit) +void MACvGetShortRetryLimit (unsigned long dwIoBase, unsigned char *pbyRetryLimit) { // get SRT VNSvInPortB(dwIoBase + MAC_REG_SRT, pbyRetryLimit); @@ -494,7 +494,7 @@ void MACvGetShortRetryLimit (DWORD_PTR dwIoBase, PBYTE pbyRetryLimit) * Return Value: none * */ -void MACvSetLongRetryLimit (DWORD_PTR dwIoBase, BYTE byRetryLimit) +void MACvSetLongRetryLimit (unsigned long dwIoBase, unsigned char byRetryLimit) { // set LRT VNSvOutPortB(dwIoBase + MAC_REG_LRT, byRetryLimit); @@ -513,7 +513,7 @@ void MACvSetLongRetryLimit (DWORD_PTR dwIoBase, BYTE byRetryLimit) * Return Value: none * */ -void MACvGetLongRetryLimit (DWORD_PTR dwIoBase, PBYTE pbyRetryLimit) +void MACvGetLongRetryLimit (unsigned long dwIoBase, unsigned char *pbyRetryLimit) { // get LRT VNSvInPortB(dwIoBase + MAC_REG_LRT, pbyRetryLimit); @@ -533,9 +533,9 @@ void MACvGetLongRetryLimit (DWORD_PTR dwIoBase, PBYTE pbyRetryLimit) * Return Value: none * */ -void MACvSetLoopbackMode (DWORD_PTR dwIoBase, BYTE byLoopbackMode) +void MACvSetLoopbackMode (unsigned long dwIoBase, unsigned char byLoopbackMode) { - BYTE byOrgValue; + unsigned char byOrgValue; ASSERT(byLoopbackMode < 3); byLoopbackMode <<= 6; @@ -556,17 +556,17 @@ void MACvSetLoopbackMode (DWORD_PTR dwIoBase, BYTE byLoopbackMode) * Out: * none * - * Return Value: TRUE if in Loopback mode; otherwise FALSE + * Return Value: true if in Loopback mode; otherwise false * */ -BOOL MACbIsInLoopbackMode (DWORD_PTR dwIoBase) +bool MACbIsInLoopbackMode (unsigned long dwIoBase) { - BYTE byOrgValue; + unsigned char byOrgValue; VNSvInPortB(dwIoBase + MAC_REG_TEST, &byOrgValue); if (byOrgValue & (TEST_LBINT | TEST_LBEXT)) - return TRUE; - return FALSE; + return true; + return false; } /* @@ -583,10 +583,10 @@ BOOL MACbIsInLoopbackMode (DWORD_PTR dwIoBase) * Return Value: none * */ -void MACvSetPacketFilter (DWORD_PTR dwIoBase, WORD wFilterType) +void MACvSetPacketFilter (unsigned long dwIoBase, unsigned short wFilterType) { - BYTE byOldRCR; - BYTE byNewRCR = 0; + unsigned char byOldRCR; + unsigned char byNewRCR = 0; // if only in DIRECTED mode, multicast-address will set to zero, // but if other mode exist (e.g. PROMISCUOUS), multicast-address @@ -595,7 +595,7 @@ void MACvSetPacketFilter (DWORD_PTR dwIoBase, WORD wFilterType) // set multicast address to accept none MACvSelectPage1(dwIoBase); VNSvOutPortD(dwIoBase + MAC_REG_MAR0, 0L); - VNSvOutPortD(dwIoBase + MAC_REG_MAR0 + sizeof(DWORD), 0L); + VNSvOutPortD(dwIoBase + MAC_REG_MAR0 + sizeof(unsigned long), 0L); MACvSelectPage0(dwIoBase); } @@ -603,7 +603,7 @@ void MACvSetPacketFilter (DWORD_PTR dwIoBase, WORD wFilterType) // set multicast address to accept all MACvSelectPage1(dwIoBase); VNSvOutPortD(dwIoBase + MAC_REG_MAR0, 0xFFFFFFFFL); - VNSvOutPortD(dwIoBase + MAC_REG_MAR0 + sizeof(DWORD), 0xFFFFFFFFL); + VNSvOutPortD(dwIoBase + MAC_REG_MAR0 + sizeof(unsigned long), 0xFFFFFFFFL); MACvSelectPage0(dwIoBase); } @@ -643,7 +643,7 @@ void MACvSetPacketFilter (DWORD_PTR dwIoBase, WORD wFilterType) * Return Value: none * */ -void MACvSaveContext (DWORD_PTR dwIoBase, PBYTE pbyCxtBuf) +void MACvSaveContext (unsigned long dwIoBase, unsigned char *pbyCxtBuf) { int ii; @@ -676,7 +676,7 @@ void MACvSaveContext (DWORD_PTR dwIoBase, PBYTE pbyCxtBuf) * Return Value: none * */ -void MACvRestoreContext (DWORD_PTR dwIoBase, PBYTE pbyCxtBuf) +void MACvRestoreContext (unsigned long dwIoBase, unsigned char *pbyCxtBuf) { int ii; @@ -703,14 +703,14 @@ void MACvRestoreContext (DWORD_PTR dwIoBase, PBYTE pbyCxtBuf) } // restore CURR_RX_DESC_ADDR, CURR_TX_DESC_ADDR - VNSvOutPortD(dwIoBase + MAC_REG_TXDMAPTR0, *(PDWORD)(pbyCxtBuf + MAC_REG_TXDMAPTR0)); - VNSvOutPortD(dwIoBase + MAC_REG_AC0DMAPTR, *(PDWORD)(pbyCxtBuf + MAC_REG_AC0DMAPTR)); - VNSvOutPortD(dwIoBase + MAC_REG_BCNDMAPTR, *(PDWORD)(pbyCxtBuf + MAC_REG_BCNDMAPTR)); + VNSvOutPortD(dwIoBase + MAC_REG_TXDMAPTR0, *(unsigned long *)(pbyCxtBuf + MAC_REG_TXDMAPTR0)); + VNSvOutPortD(dwIoBase + MAC_REG_AC0DMAPTR, *(unsigned long *)(pbyCxtBuf + MAC_REG_AC0DMAPTR)); + VNSvOutPortD(dwIoBase + MAC_REG_BCNDMAPTR, *(unsigned long *)(pbyCxtBuf + MAC_REG_BCNDMAPTR)); - VNSvOutPortD(dwIoBase + MAC_REG_RXDMAPTR0, *(PDWORD)(pbyCxtBuf + MAC_REG_RXDMAPTR0)); + VNSvOutPortD(dwIoBase + MAC_REG_RXDMAPTR0, *(unsigned long *)(pbyCxtBuf + MAC_REG_RXDMAPTR0)); - VNSvOutPortD(dwIoBase + MAC_REG_RXDMAPTR1, *(PDWORD)(pbyCxtBuf + MAC_REG_RXDMAPTR1)); + VNSvOutPortD(dwIoBase + MAC_REG_RXDMAPTR1, *(unsigned long *)(pbyCxtBuf + MAC_REG_RXDMAPTR1)); } @@ -725,39 +725,39 @@ void MACvRestoreContext (DWORD_PTR dwIoBase, PBYTE pbyCxtBuf) * Out: * none * - * Return Value: TRUE if all values are the same; otherwise FALSE + * Return Value: true if all values are the same; otherwise false * */ -BOOL MACbCompareContext (DWORD_PTR dwIoBase, PBYTE pbyCxtBuf) +bool MACbCompareContext (unsigned long dwIoBase, unsigned char *pbyCxtBuf) { - DWORD dwData; + unsigned long dwData; // compare MAC context to determine if this is a power lost init, - // return TRUE for power remaining init, return FALSE for power lost init + // return true for power remaining init, return false for power lost init // compare CURR_RX_DESC_ADDR, CURR_TX_DESC_ADDR VNSvInPortD(dwIoBase + MAC_REG_TXDMAPTR0, &dwData); - if (dwData != *(PDWORD)(pbyCxtBuf + MAC_REG_TXDMAPTR0)) { - return FALSE; + if (dwData != *(unsigned long *)(pbyCxtBuf + MAC_REG_TXDMAPTR0)) { + return false; } VNSvInPortD(dwIoBase + MAC_REG_AC0DMAPTR, &dwData); - if (dwData != *(PDWORD)(pbyCxtBuf + MAC_REG_AC0DMAPTR)) { - return FALSE; + if (dwData != *(unsigned long *)(pbyCxtBuf + MAC_REG_AC0DMAPTR)) { + return false; } VNSvInPortD(dwIoBase + MAC_REG_RXDMAPTR0, &dwData); - if (dwData != *(PDWORD)(pbyCxtBuf + MAC_REG_RXDMAPTR0)) { - return FALSE; + if (dwData != *(unsigned long *)(pbyCxtBuf + MAC_REG_RXDMAPTR0)) { + return false; } VNSvInPortD(dwIoBase + MAC_REG_RXDMAPTR1, &dwData); - if (dwData != *(PDWORD)(pbyCxtBuf + MAC_REG_RXDMAPTR1)) { - return FALSE; + if (dwData != *(unsigned long *)(pbyCxtBuf + MAC_REG_RXDMAPTR1)) { + return false; } - return TRUE; + return true; } /* @@ -770,13 +770,13 @@ BOOL MACbCompareContext (DWORD_PTR dwIoBase, PBYTE pbyCxtBuf) * Out: * none * - * Return Value: TRUE if Reset Success; otherwise FALSE + * Return Value: true if Reset Success; otherwise false * */ -BOOL MACbSoftwareReset (DWORD_PTR dwIoBase) +bool MACbSoftwareReset (unsigned long dwIoBase) { - BYTE byData; - WORD ww; + unsigned char byData; + unsigned short ww; // turn on HOSTCR_SOFTRST, just write 0x01 to reset //MACvRegBitsOn(dwIoBase, MAC_REG_HOSTCR, HOSTCR_SOFTRST); @@ -788,8 +788,8 @@ BOOL MACbSoftwareReset (DWORD_PTR dwIoBase) break; } if (ww == W_MAX_TIMEOUT) - return FALSE; - return TRUE; + return false; + return true; } @@ -803,13 +803,13 @@ BOOL MACbSoftwareReset (DWORD_PTR dwIoBase) * Out: * none * - * Return Value: TRUE if success; otherwise FALSE + * Return Value: true if success; otherwise false * */ -BOOL MACbSafeSoftwareReset (DWORD_PTR dwIoBase) +bool MACbSafeSoftwareReset (unsigned long dwIoBase) { - BYTE abyTmpRegData[MAC_MAX_CONTEXT_SIZE_PAGE0+MAC_MAX_CONTEXT_SIZE_PAGE1]; - BOOL bRetVal; + unsigned char abyTmpRegData[MAC_MAX_CONTEXT_SIZE_PAGE0+MAC_MAX_CONTEXT_SIZE_PAGE1]; + bool bRetVal; // PATCH.... // save some important register's value, then do @@ -836,14 +836,14 @@ BOOL MACbSafeSoftwareReset (DWORD_PTR dwIoBase) * Out: * none * - * Return Value: TRUE if success; otherwise FALSE + * Return Value: true if success; otherwise false * */ -BOOL MACbSafeRxOff (DWORD_PTR dwIoBase) +bool MACbSafeRxOff (unsigned long dwIoBase) { - WORD ww; - DWORD dwData; - BYTE byData; + unsigned short ww; + unsigned long dwData; + unsigned char byData; // turn off wow temp for turn off Rx safely @@ -858,7 +858,7 @@ BOOL MACbSafeRxOff (DWORD_PTR dwIoBase) if (ww == W_MAX_TIMEOUT) { DBG_PORT80(0x10); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" DBG_PORT80(0x10)\n"); - return(FALSE); + return(false); } for (ww = 0; ww < W_MAX_TIMEOUT; ww++) { VNSvInPortD(dwIoBase + MAC_REG_RXDMACTL1, &dwData); @@ -868,7 +868,7 @@ BOOL MACbSafeRxOff (DWORD_PTR dwIoBase) if (ww == W_MAX_TIMEOUT) { DBG_PORT80(0x11); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" DBG_PORT80(0x11)\n"); - return(FALSE); + return(false); } // try to safe shutdown RX @@ -882,9 +882,9 @@ BOOL MACbSafeRxOff (DWORD_PTR dwIoBase) if (ww == W_MAX_TIMEOUT) { DBG_PORT80(0x12); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" DBG_PORT80(0x12)\n"); - return(FALSE); + return(false); } - return TRUE; + return true; } /* @@ -897,14 +897,14 @@ BOOL MACbSafeRxOff (DWORD_PTR dwIoBase) * Out: * none * - * Return Value: TRUE if success; otherwise FALSE + * Return Value: true if success; otherwise false * */ -BOOL MACbSafeTxOff (DWORD_PTR dwIoBase) +bool MACbSafeTxOff (unsigned long dwIoBase) { - WORD ww; - DWORD dwData; - BYTE byData; + unsigned short ww; + unsigned long dwData; + unsigned char byData; // Clear TX DMA //Tx0 @@ -921,7 +921,7 @@ BOOL MACbSafeTxOff (DWORD_PTR dwIoBase) if (ww == W_MAX_TIMEOUT) { DBG_PORT80(0x20); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" DBG_PORT80(0x20)\n"); - return(FALSE); + return(false); } for (ww = 0; ww < W_MAX_TIMEOUT; ww++) { VNSvInPortD(dwIoBase + MAC_REG_AC0DMACTL, &dwData); @@ -931,7 +931,7 @@ BOOL MACbSafeTxOff (DWORD_PTR dwIoBase) if (ww == W_MAX_TIMEOUT) { DBG_PORT80(0x21); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" DBG_PORT80(0x21)\n"); - return(FALSE); + return(false); } // try to safe shutdown TX @@ -946,9 +946,9 @@ BOOL MACbSafeTxOff (DWORD_PTR dwIoBase) if (ww == W_MAX_TIMEOUT) { DBG_PORT80(0x24); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" DBG_PORT80(0x24)\n"); - return(FALSE); + return(false); } - return TRUE; + return true; } /* @@ -961,29 +961,29 @@ BOOL MACbSafeTxOff (DWORD_PTR dwIoBase) * Out: * none * - * Return Value: TRUE if success; otherwise FALSE + * Return Value: true if success; otherwise false * */ -BOOL MACbSafeStop (DWORD_PTR dwIoBase) +bool MACbSafeStop (unsigned long dwIoBase) { MACvRegBitsOff(dwIoBase, MAC_REG_TCR, TCR_AUTOBCNTX); - if (MACbSafeRxOff(dwIoBase) == FALSE) { + if (MACbSafeRxOff(dwIoBase) == false) { DBG_PORT80(0xA1); - DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" MACbSafeRxOff == FALSE)\n"); + DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" MACbSafeRxOff == false)\n"); MACbSafeSoftwareReset(dwIoBase); - return FALSE; + return false; } - if (MACbSafeTxOff(dwIoBase) == FALSE) { + if (MACbSafeTxOff(dwIoBase) == false) { DBG_PORT80(0xA2); - DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" MACbSafeTxOff == FALSE)\n"); + DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" MACbSafeTxOff == false)\n"); MACbSafeSoftwareReset(dwIoBase); - return FALSE; + return false; } MACvRegBitsOff(dwIoBase, MAC_REG_HOSTCR, HOSTCR_MACEN); - return TRUE; + return true; } /* @@ -996,10 +996,10 @@ BOOL MACbSafeStop (DWORD_PTR dwIoBase) * Out: * none * - * Return Value: TRUE if success; otherwise FALSE + * Return Value: true if success; otherwise false * */ -BOOL MACbShutdown (DWORD_PTR dwIoBase) +bool MACbShutdown (unsigned long dwIoBase) { // disable MAC IMR MACvIntDisable(dwIoBase); @@ -1007,10 +1007,10 @@ BOOL MACbShutdown (DWORD_PTR dwIoBase) // stop the adapter if (!MACbSafeStop(dwIoBase)) { MACvSetLoopbackMode(dwIoBase, MAC_LB_NONE); - return FALSE; + return false; } MACvSetLoopbackMode(dwIoBase, MAC_LB_NONE); - return TRUE; + return true; } /* @@ -1026,7 +1026,7 @@ BOOL MACbShutdown (DWORD_PTR dwIoBase) * Return Value: none * */ -void MACvInitialize (DWORD_PTR dwIoBase) +void MACvInitialize (unsigned long dwIoBase) { // clear sticky bits MACvClearStckDS(dwIoBase); @@ -1045,8 +1045,8 @@ void MACvInitialize (DWORD_PTR dwIoBase) // issue AUTOLD in EECSR to reload eeprom //MACvRegBitsOn(dwIoBase, MAC_REG_I2MCSR, I2MCSR_AUTOLD); // wait until EEPROM loading complete - //while (TRUE) { - // U8 u8Data; + //while (true) { + // u8 u8Data; // VNSvInPortB(dwIoBase + MAC_REG_I2MCSR, &u8Data); // if ( !(u8Data & I2MCSR_AUTOLD)) // break; @@ -1079,11 +1079,11 @@ void MACvInitialize (DWORD_PTR dwIoBase) * Return Value: none * */ -void MACvSetCurrRx0DescAddr (DWORD_PTR dwIoBase, DWORD dwCurrDescAddr) +void MACvSetCurrRx0DescAddr (unsigned long dwIoBase, unsigned long dwCurrDescAddr) { -WORD ww; -BYTE byData; -BYTE byOrgDMACtl; +unsigned short ww; +unsigned char byData; +unsigned char byOrgDMACtl; VNSvInPortB(dwIoBase + MAC_REG_RXDMACTL0, &byOrgDMACtl); if (byOrgDMACtl & DMACTL_RUN) { @@ -1117,11 +1117,11 @@ BYTE byOrgDMACtl; * Return Value: none * */ -void MACvSetCurrRx1DescAddr (DWORD_PTR dwIoBase, DWORD dwCurrDescAddr) +void MACvSetCurrRx1DescAddr (unsigned long dwIoBase, unsigned long dwCurrDescAddr) { -WORD ww; -BYTE byData; -BYTE byOrgDMACtl; +unsigned short ww; +unsigned char byData; +unsigned char byOrgDMACtl; VNSvInPortB(dwIoBase + MAC_REG_RXDMACTL1, &byOrgDMACtl); if (byOrgDMACtl & DMACTL_RUN) { @@ -1155,11 +1155,11 @@ BYTE byOrgDMACtl; * Return Value: none * */ -void MACvSetCurrTx0DescAddrEx (DWORD_PTR dwIoBase, DWORD dwCurrDescAddr) +void MACvSetCurrTx0DescAddrEx (unsigned long dwIoBase, unsigned long dwCurrDescAddr) { -WORD ww; -BYTE byData; -BYTE byOrgDMACtl; +unsigned short ww; +unsigned char byData; +unsigned char byOrgDMACtl; VNSvInPortB(dwIoBase + MAC_REG_TXDMACTL0, &byOrgDMACtl); if (byOrgDMACtl & DMACTL_RUN) { @@ -1194,11 +1194,11 @@ BYTE byOrgDMACtl; * */ //TxDMA1 = AC0DMA -void MACvSetCurrAC0DescAddrEx (DWORD_PTR dwIoBase, DWORD dwCurrDescAddr) +void MACvSetCurrAC0DescAddrEx (unsigned long dwIoBase, unsigned long dwCurrDescAddr) { -WORD ww; -BYTE byData; -BYTE byOrgDMACtl; +unsigned short ww; +unsigned char byData; +unsigned char byOrgDMACtl; VNSvInPortB(dwIoBase + MAC_REG_AC0DMACTL, &byOrgDMACtl); if (byOrgDMACtl & DMACTL_RUN) { @@ -1221,7 +1221,7 @@ BYTE byOrgDMACtl; -void MACvSetCurrTXDescAddr (int iTxType, DWORD_PTR dwIoBase, DWORD dwCurrDescAddr) +void MACvSetCurrTXDescAddr (int iTxType, unsigned long dwIoBase, unsigned long dwCurrDescAddr) { if(iTxType == TYPE_AC0DMA){ MACvSetCurrAC0DescAddrEx(dwIoBase, dwCurrDescAddr); @@ -1244,10 +1244,10 @@ void MACvSetCurrTXDescAddr (int iTxType, DWORD_PTR dwIoBase, DWORD dwCurrDescAdd * Return Value: none * */ -void MACvTimer0MicroSDelay (DWORD_PTR dwIoBase, UINT uDelay) +void MACvTimer0MicroSDelay (unsigned long dwIoBase, unsigned int uDelay) { -BYTE byValue; -UINT uu,ii; +unsigned char byValue; +unsigned int uu,ii; VNSvOutPortB(dwIoBase + MAC_REG_TMCTL0, 0); VNSvOutPortD(dwIoBase + MAC_REG_TMDATA0, uDelay); @@ -1280,7 +1280,7 @@ UINT uu,ii; * Return Value: none * */ -void MACvOneShotTimer0MicroSec (DWORD_PTR dwIoBase, UINT uDelayTime) +void MACvOneShotTimer0MicroSec (unsigned long dwIoBase, unsigned int uDelayTime) { VNSvOutPortB(dwIoBase + MAC_REG_TMCTL0, 0); VNSvOutPortD(dwIoBase + MAC_REG_TMDATA0, uDelayTime); @@ -1301,7 +1301,7 @@ void MACvOneShotTimer0MicroSec (DWORD_PTR dwIoBase, UINT uDelayTime) * Return Value: none * */ -void MACvOneShotTimer1MicroSec (DWORD_PTR dwIoBase, UINT uDelayTime) +void MACvOneShotTimer1MicroSec (unsigned long dwIoBase, unsigned int uDelayTime) { VNSvOutPortB(dwIoBase + MAC_REG_TMCTL1, 0); VNSvOutPortD(dwIoBase + MAC_REG_TMDATA1, uDelayTime); @@ -1309,7 +1309,7 @@ void MACvOneShotTimer1MicroSec (DWORD_PTR dwIoBase, UINT uDelayTime) } -void MACvSetMISCFifo (DWORD_PTR dwIoBase, WORD wOffset, DWORD dwData) +void MACvSetMISCFifo (unsigned long dwIoBase, unsigned short wOffset, unsigned long dwData) { if (wOffset > 273) return; @@ -1319,10 +1319,10 @@ void MACvSetMISCFifo (DWORD_PTR dwIoBase, WORD wOffset, DWORD dwData) } -BOOL MACbTxDMAOff (DWORD_PTR dwIoBase, UINT idx) +bool MACbTxDMAOff (unsigned long dwIoBase, unsigned int idx) { -BYTE byData; -UINT ww = 0; +unsigned char byData; +unsigned int ww = 0; if (idx == TYPE_TXDMA0) { VNSvOutPortB(dwIoBase + MAC_REG_TXDMACTL0+2, DMACTL_RUN); @@ -1342,15 +1342,15 @@ UINT ww = 0; if (ww == W_MAX_TIMEOUT) { DBG_PORT80(0x29); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" DBG_PORT80(0x29)\n"); - return FALSE; + return false; } - return TRUE; + return true; } -void MACvClearBusSusInd (DWORD_PTR dwIoBase) +void MACvClearBusSusInd (unsigned long dwIoBase) { - DWORD dwOrgValue; - UINT ww; + unsigned long dwOrgValue; + unsigned int ww; // check if BcnSusInd enabled VNSvInPortD(dwIoBase + MAC_REG_ENCFG , &dwOrgValue); if( !(dwOrgValue & EnCFG_BcnSusInd)) @@ -1369,11 +1369,11 @@ void MACvClearBusSusInd (DWORD_PTR dwIoBase) } } -void MACvEnableBusSusEn (DWORD_PTR dwIoBase) +void MACvEnableBusSusEn (unsigned long dwIoBase) { - BYTE byOrgValue; - DWORD dwOrgValue; - UINT ww; + unsigned char byOrgValue; + unsigned long dwOrgValue; + unsigned int ww; // check if BcnSusInd enabled VNSvInPortB(dwIoBase + MAC_REG_CFG , &byOrgValue); @@ -1391,10 +1391,10 @@ void MACvEnableBusSusEn (DWORD_PTR dwIoBase) } } -BOOL MACbFlushSYNCFifo (DWORD_PTR dwIoBase) +bool MACbFlushSYNCFifo (unsigned long dwIoBase) { - BYTE byOrgValue; - UINT ww; + unsigned char byOrgValue; + unsigned int ww; // Read MACCR VNSvInPortB(dwIoBase + MAC_REG_MACCR , &byOrgValue); @@ -1412,16 +1412,16 @@ BOOL MACbFlushSYNCFifo (DWORD_PTR dwIoBase) DBG_PORT80(0x35); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" DBG_PORT80(0x33)\n"); } - return TRUE; + return true; } -BOOL MACbPSWakeup (DWORD_PTR dwIoBase) +bool MACbPSWakeup (unsigned long dwIoBase) { - BYTE byOrgValue; - UINT ww; + unsigned char byOrgValue; + unsigned int ww; // Read PSCTL if (MACbIsRegBitsOff(dwIoBase, MAC_REG_PSCTL, PSCTL_PS)) { - return TRUE; + return true; } // Disable PS MACvRegBitsOff(dwIoBase, MAC_REG_PSCTL, PSCTL_PSEN); @@ -1435,9 +1435,9 @@ BOOL MACbPSWakeup (DWORD_PTR dwIoBase) if (ww == W_MAX_TIMEOUT) { DBG_PORT80(0x36); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" DBG_PORT80(0x33)\n"); - return FALSE; + return false; } - return TRUE; + return true; } /* @@ -1455,10 +1455,11 @@ BOOL MACbPSWakeup (DWORD_PTR dwIoBase) * */ -void MACvSetKeyEntry (DWORD_PTR dwIoBase, WORD wKeyCtl, UINT uEntryIdx, UINT uKeyIdx, PBYTE pbyAddr, PDWORD pdwKey, BYTE byLocalID) +void MACvSetKeyEntry (unsigned long dwIoBase, unsigned short wKeyCtl, unsigned int uEntryIdx, + unsigned int uKeyIdx, unsigned char *pbyAddr, unsigned long *pdwKey, unsigned char byLocalID) { -WORD wOffset; -DWORD dwData; +unsigned short wOffset; +unsigned long dwData; int ii; if (byLocalID <= 1) @@ -1521,9 +1522,9 @@ int ii; * Return Value: none * */ -void MACvDisableKeyEntry (DWORD_PTR dwIoBase, UINT uEntryIdx) +void MACvDisableKeyEntry (unsigned long dwIoBase, unsigned int uEntryIdx) { -WORD wOffset; +unsigned short wOffset; wOffset = MISCFIFO_KEYETRY0; wOffset += (uEntryIdx * MISCFIFO_KEYENTRYSIZE); @@ -1549,10 +1550,11 @@ WORD wOffset; * */ -void MACvSetDefaultKeyEntry (DWORD_PTR dwIoBase, UINT uKeyLen, UINT uKeyIdx, PDWORD pdwKey, BYTE byLocalID) +void MACvSetDefaultKeyEntry (unsigned long dwIoBase, unsigned int uKeyLen, + unsigned int uKeyIdx, unsigned long *pdwKey, unsigned char byLocalID) { -WORD wOffset; -DWORD dwData; +unsigned short wOffset; +unsigned long dwData; int ii; if (byLocalID <= 1) @@ -1599,10 +1601,10 @@ int ii; * */ /* -void MACvEnableDefaultKey (DWORD_PTR dwIoBase, BYTE byLocalID) +void MACvEnableDefaultKey (unsigned long dwIoBase, unsigned char byLocalID) { -WORD wOffset; -DWORD dwData; +unsigned short wOffset; +unsigned long dwData; if (byLocalID <= 1) @@ -1634,10 +1636,10 @@ DWORD dwData; * Return Value: none * */ -void MACvDisableDefaultKey (DWORD_PTR dwIoBase) +void MACvDisableDefaultKey (unsigned long dwIoBase) { -WORD wOffset; -DWORD dwData; +unsigned short wOffset; +unsigned long dwData; wOffset = MISCFIFO_KEYETRY0; @@ -1664,10 +1666,11 @@ DWORD dwData; * Return Value: none * */ -void MACvSetDefaultTKIPKeyEntry (DWORD_PTR dwIoBase, UINT uKeyLen, UINT uKeyIdx, PDWORD pdwKey, BYTE byLocalID) +void MACvSetDefaultTKIPKeyEntry (unsigned long dwIoBase, unsigned int uKeyLen, + unsigned int uKeyIdx, unsigned long *pdwKey, unsigned char byLocalID) { -WORD wOffset; -DWORD dwData; +unsigned short wOffset; +unsigned long dwData; int ii; if (byLocalID <= 1) @@ -1720,10 +1723,10 @@ int ii; * */ -void MACvSetDefaultKeyCtl (DWORD_PTR dwIoBase, WORD wKeyCtl, UINT uEntryIdx, BYTE byLocalID) +void MACvSetDefaultKeyCtl (unsigned long dwIoBase, unsigned short wKeyCtl, unsigned int uEntryIdx, unsigned char byLocalID) { -WORD wOffset; -DWORD dwData; +unsigned short wOffset; +unsigned long dwData; if (byLocalID <= 1) return; diff --git a/drivers/staging/vt6655/mac.h b/drivers/staging/vt6655/mac.h index 5eb7f57f718..b96d27ee254 100644 --- a/drivers/staging/vt6655/mac.h +++ b/drivers/staging/vt6655/mac.h @@ -663,28 +663,28 @@ #define MACvRegBitsOn(dwIoBase, byRegOfs, byBits) \ { \ - BYTE byData; \ + unsigned char byData; \ VNSvInPortB(dwIoBase + byRegOfs, &byData); \ VNSvOutPortB(dwIoBase + byRegOfs, byData | (byBits)); \ } #define MACvWordRegBitsOn(dwIoBase, byRegOfs, wBits) \ { \ - WORD wData; \ + unsigned short wData; \ VNSvInPortW(dwIoBase + byRegOfs, &wData); \ VNSvOutPortW(dwIoBase + byRegOfs, wData | (wBits)); \ } #define MACvDWordRegBitsOn(dwIoBase, byRegOfs, dwBits) \ { \ - DWORD dwData; \ + unsigned long dwData; \ VNSvInPortD(dwIoBase + byRegOfs, &dwData); \ VNSvOutPortD(dwIoBase + byRegOfs, dwData | (dwBits)); \ } #define MACvRegBitsOnEx(dwIoBase, byRegOfs, byMask, byBits) \ { \ - BYTE byData; \ + unsigned char byData; \ VNSvInPortB(dwIoBase + byRegOfs, &byData); \ byData &= byMask; \ VNSvOutPortB(dwIoBase + byRegOfs, byData | (byBits)); \ @@ -692,21 +692,21 @@ #define MACvRegBitsOff(dwIoBase, byRegOfs, byBits) \ { \ - BYTE byData; \ + unsigned char byData; \ VNSvInPortB(dwIoBase + byRegOfs, &byData); \ VNSvOutPortB(dwIoBase + byRegOfs, byData & ~(byBits)); \ } #define MACvWordRegBitsOff(dwIoBase, byRegOfs, wBits) \ { \ - WORD wData; \ + unsigned short wData; \ VNSvInPortW(dwIoBase + byRegOfs, &wData); \ VNSvOutPortW(dwIoBase + byRegOfs, wData & ~(wBits)); \ } #define MACvDWordRegBitsOff(dwIoBase, byRegOfs, dwBits) \ { \ - DWORD dwData; \ + unsigned long dwData; \ VNSvInPortD(dwIoBase + byRegOfs, &dwData); \ VNSvOutPortD(dwIoBase + byRegOfs, dwData & ~(dwBits)); \ } @@ -714,37 +714,37 @@ #define MACvGetCurrRx0DescAddr(dwIoBase, pdwCurrDescAddr) \ { \ VNSvInPortD(dwIoBase + MAC_REG_RXDMAPTR0, \ - (PDWORD)pdwCurrDescAddr); \ + (unsigned long *)pdwCurrDescAddr); \ } #define MACvGetCurrRx1DescAddr(dwIoBase, pdwCurrDescAddr) \ { \ VNSvInPortD(dwIoBase + MAC_REG_RXDMAPTR1, \ - (PDWORD)pdwCurrDescAddr); \ + (unsigned long *)pdwCurrDescAddr); \ } #define MACvGetCurrTx0DescAddr(dwIoBase, pdwCurrDescAddr) \ { \ VNSvInPortD(dwIoBase + MAC_REG_TXDMAPTR0, \ - (PDWORD)pdwCurrDescAddr); \ + (unsigned long *)pdwCurrDescAddr); \ } #define MACvGetCurrAC0DescAddr(dwIoBase, pdwCurrDescAddr) \ { \ VNSvInPortD(dwIoBase + MAC_REG_AC0DMAPTR, \ - (PDWORD)pdwCurrDescAddr); \ + (unsigned long *)pdwCurrDescAddr); \ } #define MACvGetCurrSyncDescAddr(dwIoBase, pdwCurrDescAddr) \ { \ VNSvInPortD(dwIoBase + MAC_REG_SYNCDMAPTR, \ - (PDWORD)pdwCurrDescAddr); \ + (unsigned long *)pdwCurrDescAddr); \ } #define MACvGetCurrATIMDescAddr(dwIoBase, pdwCurrDescAddr) \ { \ VNSvInPortD(dwIoBase + MAC_REG_ATIMDMAPTR, \ - (PDWORD)pdwCurrDescAddr); \ + (unsigned long *)pdwCurrDescAddr); \ } \ // set the chip with current BCN tx descriptor address @@ -765,7 +765,7 @@ { \ VNSvOutPortB(dwIoBase + MAC_REG_PAGE1SEL, 1); \ VNSvInPortB(dwIoBase + MAC_REG_BSSID0, \ - (PBYTE)pbyEtherAddr); \ + (unsigned char *)pbyEtherAddr); \ VNSvInPortB(dwIoBase + MAC_REG_BSSID0 + 1, \ pbyEtherAddr + 1); \ VNSvInPortB(dwIoBase + MAC_REG_BSSID0 + 2, \ @@ -801,7 +801,7 @@ { \ VNSvOutPortB(dwIoBase + MAC_REG_PAGE1SEL, 1); \ VNSvInPortB(dwIoBase + MAC_REG_PAR0, \ - (PBYTE)pbyEtherAddr); \ + (unsigned char *)pbyEtherAddr); \ VNSvInPortB(dwIoBase + MAC_REG_PAR0 + 1, \ pbyEtherAddr + 1); \ VNSvInPortB(dwIoBase + MAC_REG_PAR0 + 2, \ @@ -873,7 +873,7 @@ #define MACvReceive0(dwIoBase) \ { \ - DWORD dwData; \ + unsigned long dwData; \ VNSvInPortD(dwIoBase + MAC_REG_RXDMACTL0, &dwData); \ if (dwData & DMACTL_RUN) { \ VNSvOutPortD(dwIoBase + MAC_REG_RXDMACTL0, DMACTL_WAKE);\ @@ -885,7 +885,7 @@ #define MACvReceive1(dwIoBase) \ { \ - DWORD dwData; \ + unsigned long dwData; \ VNSvInPortD(dwIoBase + MAC_REG_RXDMACTL1, &dwData); \ if (dwData & DMACTL_RUN) { \ VNSvOutPortD(dwIoBase + MAC_REG_RXDMACTL1, DMACTL_WAKE);\ @@ -902,7 +902,7 @@ #define MACvTransmit0(dwIoBase) \ { \ - DWORD dwData; \ + unsigned long dwData; \ VNSvInPortD(dwIoBase + MAC_REG_TXDMACTL0, &dwData); \ if (dwData & DMACTL_RUN) { \ VNSvOutPortD(dwIoBase + MAC_REG_TXDMACTL0, DMACTL_WAKE);\ @@ -914,7 +914,7 @@ #define MACvTransmitAC0(dwIoBase) \ { \ - DWORD dwData; \ + unsigned long dwData; \ VNSvInPortD(dwIoBase + MAC_REG_AC0DMACTL, &dwData); \ if (dwData & DMACTL_RUN) { \ VNSvOutPortD(dwIoBase + MAC_REG_AC0DMACTL, DMACTL_WAKE);\ @@ -926,7 +926,7 @@ #define MACvTransmitSYNC(dwIoBase) \ { \ - DWORD dwData; \ + unsigned long dwData; \ VNSvInPortD(dwIoBase + MAC_REG_SYNCDMACTL, &dwData); \ if (dwData & DMACTL_RUN) { \ VNSvOutPortD(dwIoBase + MAC_REG_SYNCDMACTL, DMACTL_WAKE);\ @@ -938,7 +938,7 @@ #define MACvTransmitATIM(dwIoBase) \ { \ - DWORD dwData; \ + unsigned long dwData; \ VNSvInPortD(dwIoBase + MAC_REG_ATIMDMACTL, &dwData); \ if (dwData & DMACTL_RUN) { \ VNSvOutPortD(dwIoBase + MAC_REG_ATIMDMACTL, DMACTL_WAKE);\ @@ -955,7 +955,7 @@ #define MACvClearStckDS(dwIoBase) \ { \ - BYTE byOrgValue; \ + unsigned char byOrgValue; \ VNSvInPortB(dwIoBase + MAC_REG_STICKHW, &byOrgValue); \ byOrgValue = byOrgValue & 0xFC; \ VNSvOutPortB(dwIoBase + MAC_REG_STICKHW, byOrgValue); \ @@ -1002,7 +1002,7 @@ #define MACvEnableProtectMD(dwIoBase) \ { \ - DWORD dwOrgValue; \ + unsigned long dwOrgValue; \ VNSvInPortD(dwIoBase + MAC_REG_ENCFG , &dwOrgValue); \ dwOrgValue = dwOrgValue | EnCFG_ProtectMd; \ VNSvOutPortD(dwIoBase + MAC_REG_ENCFG, dwOrgValue); \ @@ -1010,7 +1010,7 @@ #define MACvDisableProtectMD(dwIoBase) \ { \ - DWORD dwOrgValue; \ + unsigned long dwOrgValue; \ VNSvInPortD(dwIoBase + MAC_REG_ENCFG , &dwOrgValue); \ dwOrgValue = dwOrgValue & ~EnCFG_ProtectMd; \ VNSvOutPortD(dwIoBase + MAC_REG_ENCFG, dwOrgValue); \ @@ -1018,7 +1018,7 @@ #define MACvEnableBarkerPreambleMd(dwIoBase) \ { \ - DWORD dwOrgValue; \ + unsigned long dwOrgValue; \ VNSvInPortD(dwIoBase + MAC_REG_ENCFG , &dwOrgValue); \ dwOrgValue = dwOrgValue | EnCFG_BarkerPream; \ VNSvOutPortD(dwIoBase + MAC_REG_ENCFG, dwOrgValue); \ @@ -1026,7 +1026,7 @@ #define MACvDisableBarkerPreambleMd(dwIoBase) \ { \ - DWORD dwOrgValue; \ + unsigned long dwOrgValue; \ VNSvInPortD(dwIoBase + MAC_REG_ENCFG , &dwOrgValue); \ dwOrgValue = dwOrgValue & ~EnCFG_BarkerPream; \ VNSvOutPortD(dwIoBase + MAC_REG_ENCFG, dwOrgValue); \ @@ -1034,10 +1034,10 @@ #define MACvSetBBType(dwIoBase, byTyp) \ { \ - DWORD dwOrgValue; \ + unsigned long dwOrgValue; \ VNSvInPortD(dwIoBase + MAC_REG_ENCFG , &dwOrgValue); \ dwOrgValue = dwOrgValue & ~EnCFG_BBType_MASK; \ - dwOrgValue = dwOrgValue | (DWORD) byTyp; \ + dwOrgValue = dwOrgValue | (unsigned long) byTyp; \ VNSvOutPortD(dwIoBase + MAC_REG_ENCFG, dwOrgValue); \ } @@ -1074,78 +1074,81 @@ /*--------------------- Export Functions --------------------------*/ -extern WORD TxRate_iwconfig;//2008-5-8 <add> by chester -void MACvReadAllRegs(DWORD_PTR dwIoBase, PBYTE pbyMacRegs); - -BOOL MACbIsRegBitsOn(DWORD_PTR dwIoBase, BYTE byRegOfs, BYTE byTestBits); -BOOL MACbIsRegBitsOff(DWORD_PTR dwIoBase, BYTE byRegOfs, BYTE byTestBits); - -BOOL MACbIsIntDisable(DWORD_PTR dwIoBase); - -BYTE MACbyReadMultiAddr(DWORD_PTR dwIoBase, UINT uByteIdx); -void MACvWriteMultiAddr(DWORD_PTR dwIoBase, UINT uByteIdx, BYTE byData); -void MACvSetMultiAddrByHash(DWORD_PTR dwIoBase, BYTE byHashIdx); -void MACvResetMultiAddrByHash(DWORD_PTR dwIoBase, BYTE byHashIdx); - -void MACvSetRxThreshold(DWORD_PTR dwIoBase, BYTE byThreshold); -void MACvGetRxThreshold(DWORD_PTR dwIoBase, PBYTE pbyThreshold); - -void MACvSetTxThreshold(DWORD_PTR dwIoBase, BYTE byThreshold); -void MACvGetTxThreshold(DWORD_PTR dwIoBase, PBYTE pbyThreshold); - -void MACvSetDmaLength(DWORD_PTR dwIoBase, BYTE byDmaLength); -void MACvGetDmaLength(DWORD_PTR dwIoBase, PBYTE pbyDmaLength); - -void MACvSetShortRetryLimit(DWORD_PTR dwIoBase, BYTE byRetryLimit); -void MACvGetShortRetryLimit(DWORD_PTR dwIoBase, PBYTE pbyRetryLimit); - -void MACvSetLongRetryLimit(DWORD_PTR dwIoBase, BYTE byRetryLimit); -void MACvGetLongRetryLimit(DWORD_PTR dwIoBase, PBYTE pbyRetryLimit); - -void MACvSetLoopbackMode(DWORD_PTR dwIoBase, BYTE byLoopbackMode); -BOOL MACbIsInLoopbackMode(DWORD_PTR dwIoBase); - -void MACvSetPacketFilter(DWORD_PTR dwIoBase, WORD wFilterType); - -void MACvSaveContext(DWORD_PTR dwIoBase, PBYTE pbyCxtBuf); -void MACvRestoreContext(DWORD_PTR dwIoBase, PBYTE pbyCxtBuf); -BOOL MACbCompareContext(DWORD_PTR dwIoBase, PBYTE pbyCxtBuf); - -BOOL MACbSoftwareReset(DWORD_PTR dwIoBase); -BOOL MACbSafeSoftwareReset(DWORD_PTR dwIoBase); -BOOL MACbSafeRxOff(DWORD_PTR dwIoBase); -BOOL MACbSafeTxOff(DWORD_PTR dwIoBase); -BOOL MACbSafeStop(DWORD_PTR dwIoBase); -BOOL MACbShutdown(DWORD_PTR dwIoBase); -void MACvInitialize(DWORD_PTR dwIoBase); -void MACvSetCurrRx0DescAddr(DWORD_PTR dwIoBase, DWORD dwCurrDescAddr); -void MACvSetCurrRx1DescAddr(DWORD_PTR dwIoBase, DWORD dwCurrDescAddr); -void MACvSetCurrTXDescAddr(int iTxType, DWORD_PTR dwIoBase, DWORD dwCurrDescAddr); -void MACvSetCurrTx0DescAddrEx(DWORD_PTR dwIoBase, DWORD dwCurrDescAddr); -void MACvSetCurrAC0DescAddrEx(DWORD_PTR dwIoBase, DWORD dwCurrDescAddr); -void MACvSetCurrSyncDescAddrEx(DWORD_PTR dwIoBase, DWORD dwCurrDescAddr); -void MACvSetCurrATIMDescAddrEx(DWORD_PTR dwIoBase, DWORD dwCurrDescAddr); -void MACvTimer0MicroSDelay(DWORD_PTR dwIoBase, UINT uDelay); -void MACvOneShotTimer0MicroSec(DWORD_PTR dwIoBase, UINT uDelayTime); -void MACvOneShotTimer1MicroSec(DWORD_PTR dwIoBase, UINT uDelayTime); - -void MACvSetMISCFifo(DWORD_PTR dwIoBase, WORD wOffset, DWORD dwData); - -BOOL MACbTxDMAOff (DWORD_PTR dwIoBase, UINT idx); - -void MACvClearBusSusInd(DWORD_PTR dwIoBase); -void MACvEnableBusSusEn(DWORD_PTR dwIoBase); - -BOOL MACbFlushSYNCFifo(DWORD_PTR dwIoBase); -BOOL MACbPSWakeup(DWORD_PTR dwIoBase); - -void MACvSetKeyEntry(DWORD_PTR dwIoBase, WORD wKeyCtl, UINT uEntryIdx, UINT uKeyIdx, PBYTE pbyAddr, PDWORD pdwKey, BYTE byLocalID); -void MACvDisableKeyEntry(DWORD_PTR dwIoBase, UINT uEntryIdx); -void MACvSetDefaultKeyEntry(DWORD_PTR dwIoBase, UINT uKeyLen, UINT uKeyIdx, PDWORD pdwKey, BYTE byLocalID); -//void MACvEnableDefaultKey(DWORD_PTR dwIoBase, BYTE byLocalID); -void MACvDisableDefaultKey(DWORD_PTR dwIoBase); -void MACvSetDefaultTKIPKeyEntry(DWORD_PTR dwIoBase, UINT uKeyLen, UINT uKeyIdx, PDWORD pdwKey, BYTE byLocalID); -void MACvSetDefaultKeyCtl(DWORD_PTR dwIoBase, WORD wKeyCtl, UINT uEntryIdx, BYTE byLocalID); +extern unsigned short TxRate_iwconfig;//2008-5-8 <add> by chester +void MACvReadAllRegs(unsigned long dwIoBase, unsigned char *pbyMacRegs); + +bool MACbIsRegBitsOn(unsigned long dwIoBase, unsigned char byRegOfs, unsigned char byTestBits); +bool MACbIsRegBitsOff(unsigned long dwIoBase, unsigned char byRegOfs, unsigned char byTestBits); + +bool MACbIsIntDisable(unsigned long dwIoBase); + +unsigned char MACbyReadMultiAddr(unsigned long dwIoBase, unsigned int uByteIdx); +void MACvWriteMultiAddr(unsigned long dwIoBase, unsigned int uByteIdx, unsigned char byData); +void MACvSetMultiAddrByHash(unsigned long dwIoBase, unsigned char byHashIdx); +void MACvResetMultiAddrByHash(unsigned long dwIoBase, unsigned char byHashIdx); + +void MACvSetRxThreshold(unsigned long dwIoBase, unsigned char byThreshold); +void MACvGetRxThreshold(unsigned long dwIoBase, unsigned char *pbyThreshold); + +void MACvSetTxThreshold(unsigned long dwIoBase, unsigned char byThreshold); +void MACvGetTxThreshold(unsigned long dwIoBase, unsigned char *pbyThreshold); + +void MACvSetDmaLength(unsigned long dwIoBase, unsigned char byDmaLength); +void MACvGetDmaLength(unsigned long dwIoBase, unsigned char *pbyDmaLength); + +void MACvSetShortRetryLimit(unsigned long dwIoBase, unsigned char byRetryLimit); +void MACvGetShortRetryLimit(unsigned long dwIoBase, unsigned char *pbyRetryLimit); + +void MACvSetLongRetryLimit(unsigned long dwIoBase, unsigned char byRetryLimit); +void MACvGetLongRetryLimit(unsigned long dwIoBase, unsigned char *pbyRetryLimit); + +void MACvSetLoopbackMode(unsigned long dwIoBase, unsigned char byLoopbackMode); +bool MACbIsInLoopbackMode(unsigned long dwIoBase); + +void MACvSetPacketFilter(unsigned long dwIoBase, unsigned short wFilterType); + +void MACvSaveContext(unsigned long dwIoBase, unsigned char *pbyCxtBuf); +void MACvRestoreContext(unsigned long dwIoBase, unsigned char *pbyCxtBuf); +bool MACbCompareContext(unsigned long dwIoBase, unsigned char *pbyCxtBuf); + +bool MACbSoftwareReset(unsigned long dwIoBase); +bool MACbSafeSoftwareReset(unsigned long dwIoBase); +bool MACbSafeRxOff(unsigned long dwIoBase); +bool MACbSafeTxOff(unsigned long dwIoBase); +bool MACbSafeStop(unsigned long dwIoBase); +bool MACbShutdown(unsigned long dwIoBase); +void MACvInitialize(unsigned long dwIoBase); +void MACvSetCurrRx0DescAddr(unsigned long dwIoBase, unsigned long dwCurrDescAddr); +void MACvSetCurrRx1DescAddr(unsigned long dwIoBase, unsigned long dwCurrDescAddr); +void MACvSetCurrTXDescAddr(int iTxType, unsigned long dwIoBase, unsigned long dwCurrDescAddr); +void MACvSetCurrTx0DescAddrEx(unsigned long dwIoBase, unsigned long dwCurrDescAddr); +void MACvSetCurrAC0DescAddrEx(unsigned long dwIoBase, unsigned long dwCurrDescAddr); +void MACvSetCurrSyncDescAddrEx(unsigned long dwIoBase, unsigned long dwCurrDescAddr); +void MACvSetCurrATIMDescAddrEx(unsigned long dwIoBase, unsigned long dwCurrDescAddr); +void MACvTimer0MicroSDelay(unsigned long dwIoBase, unsigned int uDelay); +void MACvOneShotTimer0MicroSec(unsigned long dwIoBase, unsigned int uDelayTime); +void MACvOneShotTimer1MicroSec(unsigned long dwIoBase, unsigned int uDelayTime); + +void MACvSetMISCFifo(unsigned long dwIoBase, unsigned short wOffset, unsigned long dwData); + +bool MACbTxDMAOff (unsigned long dwIoBase, unsigned int idx); + +void MACvClearBusSusInd(unsigned long dwIoBase); +void MACvEnableBusSusEn(unsigned long dwIoBase); + +bool MACbFlushSYNCFifo(unsigned long dwIoBase); +bool MACbPSWakeup(unsigned long dwIoBase); + +void MACvSetKeyEntry(unsigned long dwIoBase, unsigned short wKeyCtl, unsigned int uEntryIdx, + unsigned int uKeyIdx, unsigned char *pbyAddr, unsigned long *pdwKey, unsigned char byLocalID); +void MACvDisableKeyEntry(unsigned long dwIoBase, unsigned int uEntryIdx); +void MACvSetDefaultKeyEntry(unsigned long dwIoBase, unsigned int uKeyLen, + unsigned int uKeyIdx, unsigned long *pdwKey, unsigned char byLocalID); +//void MACvEnableDefaultKey(unsigned long dwIoBase, unsigned char byLocalID); +void MACvDisableDefaultKey(unsigned long dwIoBase); +void MACvSetDefaultTKIPKeyEntry(unsigned long dwIoBase, unsigned int uKeyLen, + unsigned int uKeyIdx, unsigned long *pdwKey, unsigned char byLocalID); +void MACvSetDefaultKeyCtl(unsigned long dwIoBase, unsigned short wKeyCtl, unsigned int uEntryIdx, unsigned char byLocalID); #endif // __MAC_H__ diff --git a/drivers/staging/vt6655/mib.c b/drivers/staging/vt6655/mib.c index 4ca7877075b..1b91a837095 100644 --- a/drivers/staging/vt6655/mib.c +++ b/drivers/staging/vt6655/mib.c @@ -90,7 +90,7 @@ void STAvClearAllCounter (PSStatCounter pStatistic) * Return Value: none * */ -void STAvUpdateIsrStatCounter (PSStatCounter pStatistic, DWORD dwIsr) +void STAvUpdateIsrStatCounter (PSStatCounter pStatistic, unsigned long dwIsr) { /**********************/ /* ABNORMAL interrupt */ @@ -177,8 +177,8 @@ void STAvUpdateIsrStatCounter (PSStatCounter pStatistic, DWORD dwIsr) * */ void STAvUpdateRDStatCounter (PSStatCounter pStatistic, - BYTE byRSR, BYTE byNewRSR, BYTE byRxRate, - PBYTE pbyBuffer, UINT cbFrameLength) + unsigned char byRSR, unsigned char byNewRSR, unsigned char byRxRate, + unsigned char *pbyBuffer, unsigned int cbFrameLength) { //need change PS802_11Header pHeader = (PS802_11Header)pbyBuffer; @@ -194,15 +194,15 @@ void STAvUpdateRDStatCounter (PSStatCounter pStatistic, // update counters in case that successful transmit if (byRSR & RSR_ADDRBROAD) { pStatistic->ullRxBroadcastFrames++; - pStatistic->ullRxBroadcastBytes += (ULONGLONG)cbFrameLength; + pStatistic->ullRxBroadcastBytes += (unsigned long long) cbFrameLength; } else if (byRSR & RSR_ADDRMULTI) { pStatistic->ullRxMulticastFrames++; - pStatistic->ullRxMulticastBytes += (ULONGLONG)cbFrameLength; + pStatistic->ullRxMulticastBytes += (unsigned long long) cbFrameLength; } else { pStatistic->ullRxDirectedFrames++; - pStatistic->ullRxDirectedBytes += (ULONGLONG)cbFrameLength; + pStatistic->ullRxDirectedBytes += (unsigned long long) cbFrameLength; } } } @@ -212,87 +212,87 @@ void STAvUpdateRDStatCounter (PSStatCounter pStatistic, if(byRSR & RSR_CRCOK) { pStatistic->CustomStat.ullRsr11MCRCOk++; } - DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"11M: ALL[%d], OK[%d]:[%02x]\n", (INT)pStatistic->CustomStat.ullRsr11M, (INT)pStatistic->CustomStat.ullRsr11MCRCOk, byRSR); + DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"11M: ALL[%d], OK[%d]:[%02x]\n", (int)pStatistic->CustomStat.ullRsr11M, (int)pStatistic->CustomStat.ullRsr11MCRCOk, byRSR); } else if(byRxRate==11) { pStatistic->CustomStat.ullRsr5M++; if(byRSR & RSR_CRCOK) { pStatistic->CustomStat.ullRsr5MCRCOk++; } - DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" 5M: ALL[%d], OK[%d]:[%02x]\n", (INT)pStatistic->CustomStat.ullRsr5M, (INT)pStatistic->CustomStat.ullRsr5MCRCOk, byRSR); + DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" 5M: ALL[%d], OK[%d]:[%02x]\n", (int)pStatistic->CustomStat.ullRsr5M, (int)pStatistic->CustomStat.ullRsr5MCRCOk, byRSR); } else if(byRxRate==4) { pStatistic->CustomStat.ullRsr2M++; if(byRSR & RSR_CRCOK) { pStatistic->CustomStat.ullRsr2MCRCOk++; } - DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" 2M: ALL[%d], OK[%d]:[%02x]\n", (INT)pStatistic->CustomStat.ullRsr2M, (INT)pStatistic->CustomStat.ullRsr2MCRCOk, byRSR); + DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" 2M: ALL[%d], OK[%d]:[%02x]\n", (int)pStatistic->CustomStat.ullRsr2M, (int)pStatistic->CustomStat.ullRsr2MCRCOk, byRSR); } else if(byRxRate==2){ pStatistic->CustomStat.ullRsr1M++; if(byRSR & RSR_CRCOK) { pStatistic->CustomStat.ullRsr1MCRCOk++; } - DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" 1M: ALL[%d], OK[%d]:[%02x]\n", (INT)pStatistic->CustomStat.ullRsr1M, (INT)pStatistic->CustomStat.ullRsr1MCRCOk, byRSR); + DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" 1M: ALL[%d], OK[%d]:[%02x]\n", (int)pStatistic->CustomStat.ullRsr1M, (int)pStatistic->CustomStat.ullRsr1MCRCOk, byRSR); } else if(byRxRate==12){ pStatistic->CustomStat.ullRsr6M++; if(byRSR & RSR_CRCOK) { pStatistic->CustomStat.ullRsr6MCRCOk++; } - DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" 6M: ALL[%d], OK[%d]\n", (INT)pStatistic->CustomStat.ullRsr6M, (INT)pStatistic->CustomStat.ullRsr6MCRCOk); + DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" 6M: ALL[%d], OK[%d]\n", (int)pStatistic->CustomStat.ullRsr6M, (int)pStatistic->CustomStat.ullRsr6MCRCOk); } else if(byRxRate==18){ pStatistic->CustomStat.ullRsr9M++; if(byRSR & RSR_CRCOK) { pStatistic->CustomStat.ullRsr9MCRCOk++; } - DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" 9M: ALL[%d], OK[%d]\n", (INT)pStatistic->CustomStat.ullRsr9M, (INT)pStatistic->CustomStat.ullRsr9MCRCOk); + DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" 9M: ALL[%d], OK[%d]\n", (int)pStatistic->CustomStat.ullRsr9M, (int)pStatistic->CustomStat.ullRsr9MCRCOk); } else if(byRxRate==24){ pStatistic->CustomStat.ullRsr12M++; if(byRSR & RSR_CRCOK) { pStatistic->CustomStat.ullRsr12MCRCOk++; } - DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"12M: ALL[%d], OK[%d]\n", (INT)pStatistic->CustomStat.ullRsr12M, (INT)pStatistic->CustomStat.ullRsr12MCRCOk); + DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"12M: ALL[%d], OK[%d]\n", (int)pStatistic->CustomStat.ullRsr12M, (int)pStatistic->CustomStat.ullRsr12MCRCOk); } else if(byRxRate==36){ pStatistic->CustomStat.ullRsr18M++; if(byRSR & RSR_CRCOK) { pStatistic->CustomStat.ullRsr18MCRCOk++; } - DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"18M: ALL[%d], OK[%d]\n", (INT)pStatistic->CustomStat.ullRsr18M, (INT)pStatistic->CustomStat.ullRsr18MCRCOk); + DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"18M: ALL[%d], OK[%d]\n", (int)pStatistic->CustomStat.ullRsr18M, (int)pStatistic->CustomStat.ullRsr18MCRCOk); } else if(byRxRate==48){ pStatistic->CustomStat.ullRsr24M++; if(byRSR & RSR_CRCOK) { pStatistic->CustomStat.ullRsr24MCRCOk++; } - DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"24M: ALL[%d], OK[%d]\n", (INT)pStatistic->CustomStat.ullRsr24M, (INT)pStatistic->CustomStat.ullRsr24MCRCOk); + DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"24M: ALL[%d], OK[%d]\n", (int)pStatistic->CustomStat.ullRsr24M, (int)pStatistic->CustomStat.ullRsr24MCRCOk); } else if(byRxRate==72){ pStatistic->CustomStat.ullRsr36M++; if(byRSR & RSR_CRCOK) { pStatistic->CustomStat.ullRsr36MCRCOk++; } - DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"36M: ALL[%d], OK[%d]\n", (INT)pStatistic->CustomStat.ullRsr36M, (INT)pStatistic->CustomStat.ullRsr36MCRCOk); + DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"36M: ALL[%d], OK[%d]\n", (int)pStatistic->CustomStat.ullRsr36M, (int)pStatistic->CustomStat.ullRsr36MCRCOk); } else if(byRxRate==96){ pStatistic->CustomStat.ullRsr48M++; if(byRSR & RSR_CRCOK) { pStatistic->CustomStat.ullRsr48MCRCOk++; } - DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"48M: ALL[%d], OK[%d]\n", (INT)pStatistic->CustomStat.ullRsr48M, (INT)pStatistic->CustomStat.ullRsr48MCRCOk); + DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"48M: ALL[%d], OK[%d]\n", (int)pStatistic->CustomStat.ullRsr48M, (int)pStatistic->CustomStat.ullRsr48MCRCOk); } else if(byRxRate==108){ pStatistic->CustomStat.ullRsr54M++; if(byRSR & RSR_CRCOK) { pStatistic->CustomStat.ullRsr54MCRCOk++; } - DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"54M: ALL[%d], OK[%d]\n", (INT)pStatistic->CustomStat.ullRsr54M, (INT)pStatistic->CustomStat.ullRsr54MCRCOk); + DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"54M: ALL[%d], OK[%d]\n", (int)pStatistic->CustomStat.ullRsr54M, (int)pStatistic->CustomStat.ullRsr54MCRCOk); } else { - DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"Unknown: Total[%d], CRCOK[%d]\n", (INT)pStatistic->dwRsrRxPacket+1, (INT)pStatistic->dwRsrCRCOk); + DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"Unknown: Total[%d], CRCOK[%d]\n", (int)pStatistic->dwRsrRxPacket+1, (int)pStatistic->dwRsrCRCOk); } if (byRSR & RSR_BSSIDOK) @@ -341,10 +341,10 @@ void STAvUpdateRDStatCounter (PSStatCounter pStatistic, if (WLAN_GET_FC_MOREFRAG(pHeader->wFrameCtl)) pStatistic->dwRsrRxFragment++; - if (cbFrameLength < MIN_PACKET_LEN + 4) { + if (cbFrameLength < ETH_ZLEN + 4) { pStatistic->dwRsrRunt++; } - else if (cbFrameLength == MIN_PACKET_LEN + 4) { + else if (cbFrameLength == ETH_ZLEN + 4) { pStatistic->dwRsrRxFrmLen64++; } else if ((65 <= cbFrameLength) && (cbFrameLength <= 127)) { @@ -389,11 +389,11 @@ void STAvUpdateRDStatCounter (PSStatCounter pStatistic, void STAvUpdateRDStatCounterEx ( PSStatCounter pStatistic, - BYTE byRSR, - BYTE byNewRSR, - BYTE byRxRate, - PBYTE pbyBuffer, - UINT cbFrameLength + unsigned char byRSR, + unsigned char byNewRSR, + unsigned char byRxRate, + unsigned char *pbyBuffer, + unsigned int cbFrameLength ) { STAvUpdateRDStatCounter( @@ -408,7 +408,7 @@ STAvUpdateRDStatCounterEx ( // rx length pStatistic->dwCntRxFrmLength = cbFrameLength; // rx pattern, we just see 10 bytes for sample - memcpy(pStatistic->abyCntRxPattern, (PBYTE)pbyBuffer, 10); + memcpy(pStatistic->abyCntRxPattern, (unsigned char *)pbyBuffer, 10); } @@ -432,16 +432,16 @@ STAvUpdateRDStatCounterEx ( void STAvUpdateTDStatCounter ( PSStatCounter pStatistic, - BYTE byTSR0, - BYTE byTSR1, - PBYTE pbyBuffer, - UINT cbFrameLength, - UINT uIdx + unsigned char byTSR0, + unsigned char byTSR1, + unsigned char *pbyBuffer, + unsigned int cbFrameLength, + unsigned int uIdx ) { PWLAN_80211HDR_A4 pHeader; - PBYTE pbyDestAddr; - BYTE byTSR0_NCR = byTSR0 & TSR0_NCR; + unsigned char *pbyDestAddr; + unsigned char byTSR0_NCR = byTSR0 & TSR0_NCR; @@ -471,17 +471,17 @@ STAvUpdateTDStatCounter ( pStatistic->CustomStat.ullTsrAllOK = (pStatistic->ullTsrOK[TYPE_AC0DMA] + pStatistic->ullTsrOK[TYPE_TXDMA0]); // update counters in case that successful transmit - if (IS_BROADCAST_ADDRESS(pbyDestAddr)) { + if (is_broadcast_ether_addr(pbyDestAddr)) { pStatistic->ullTxBroadcastFrames[uIdx]++; - pStatistic->ullTxBroadcastBytes[uIdx] += (ULONGLONG)cbFrameLength; + pStatistic->ullTxBroadcastBytes[uIdx] += (unsigned long long) cbFrameLength; } - else if (IS_MULTICAST_ADDRESS(pbyDestAddr)) { + else if (is_multicast_ether_addr(pbyDestAddr)) { pStatistic->ullTxMulticastFrames[uIdx]++; - pStatistic->ullTxMulticastBytes[uIdx] += (ULONGLONG)cbFrameLength; + pStatistic->ullTxMulticastBytes[uIdx] += (unsigned long long) cbFrameLength; } else { pStatistic->ullTxDirectedFrames[uIdx]++; - pStatistic->ullTxDirectedBytes[uIdx] += (ULONGLONG)cbFrameLength; + pStatistic->ullTxDirectedBytes[uIdx] += (unsigned long long) cbFrameLength; } } else { @@ -495,9 +495,9 @@ STAvUpdateTDStatCounter ( pStatistic->dwTsrACKData[uIdx]++; } - if (IS_BROADCAST_ADDRESS(pbyDestAddr)) + if (is_broadcast_ether_addr(pbyDestAddr)) pStatistic->dwTsrBroadcast[uIdx]++; - else if (IS_MULTICAST_ADDRESS(pbyDestAddr)) + else if (is_multicast_ether_addr(pbyDestAddr)) pStatistic->dwTsrMulticast[uIdx]++; else pStatistic->dwTsrDirected[uIdx]++; @@ -522,13 +522,13 @@ STAvUpdateTDStatCounter ( void STAvUpdateTDStatCounterEx ( PSStatCounter pStatistic, - PBYTE pbyBuffer, - DWORD cbFrameLength + unsigned char *pbyBuffer, + unsigned long cbFrameLength ) { - UINT uPktLength; + unsigned int uPktLength; - uPktLength = (UINT)cbFrameLength; + uPktLength = (unsigned int)cbFrameLength; // tx length pStatistic->dwCntTxBufLength = uPktLength; @@ -555,25 +555,25 @@ void STAvUpdate802_11Counter( PSDot11Counters p802_11Counter, PSStatCounter pStatistic, - DWORD dwCounter + unsigned long dwCounter ) { //p802_11Counter->TransmittedFragmentCount - p802_11Counter->MulticastTransmittedFrameCount = (ULONGLONG) (pStatistic->dwTsrBroadcast[TYPE_AC0DMA] + + p802_11Counter->MulticastTransmittedFrameCount = (unsigned long long) (pStatistic->dwTsrBroadcast[TYPE_AC0DMA] + pStatistic->dwTsrBroadcast[TYPE_TXDMA0] + pStatistic->dwTsrMulticast[TYPE_AC0DMA] + pStatistic->dwTsrMulticast[TYPE_TXDMA0]); - p802_11Counter->FailedCount = (ULONGLONG) (pStatistic->dwTsrErr[TYPE_AC0DMA] + pStatistic->dwTsrErr[TYPE_TXDMA0]); - p802_11Counter->RetryCount = (ULONGLONG) (pStatistic->dwTsrRetry[TYPE_AC0DMA] + pStatistic->dwTsrRetry[TYPE_TXDMA0]); - p802_11Counter->MultipleRetryCount = (ULONGLONG) (pStatistic->dwTsrMoreThanOnceRetry[TYPE_AC0DMA] + + p802_11Counter->FailedCount = (unsigned long long) (pStatistic->dwTsrErr[TYPE_AC0DMA] + pStatistic->dwTsrErr[TYPE_TXDMA0]); + p802_11Counter->RetryCount = (unsigned long long) (pStatistic->dwTsrRetry[TYPE_AC0DMA] + pStatistic->dwTsrRetry[TYPE_TXDMA0]); + p802_11Counter->MultipleRetryCount = (unsigned long long) (pStatistic->dwTsrMoreThanOnceRetry[TYPE_AC0DMA] + pStatistic->dwTsrMoreThanOnceRetry[TYPE_TXDMA0]); //p802_11Counter->FrameDuplicateCount - p802_11Counter->RTSSuccessCount += (ULONGLONG) (dwCounter & 0x000000ff); - p802_11Counter->RTSFailureCount += (ULONGLONG) ((dwCounter & 0x0000ff00) >> 8); - p802_11Counter->ACKFailureCount += (ULONGLONG) ((dwCounter & 0x00ff0000) >> 16); - p802_11Counter->FCSErrorCount += (ULONGLONG) ((dwCounter & 0xff000000) >> 24); + p802_11Counter->RTSSuccessCount += (unsigned long long) (dwCounter & 0x000000ff); + p802_11Counter->RTSFailureCount += (unsigned long long) ((dwCounter & 0x0000ff00) >> 8); + p802_11Counter->ACKFailureCount += (unsigned long long) ((dwCounter & 0x00ff0000) >> 16); + p802_11Counter->FCSErrorCount += (unsigned long long) ((dwCounter & 0xff000000) >> 24); //p802_11Counter->ReceivedFragmentCount - p802_11Counter->MulticastReceivedFrameCount = (ULONGLONG) (pStatistic->dwRsrBroadcast + + p802_11Counter->MulticastReceivedFrameCount = (unsigned long long) (pStatistic->dwRsrBroadcast + pStatistic->dwRsrMulticast); } diff --git a/drivers/staging/vt6655/mib.h b/drivers/staging/vt6655/mib.h index 2308319a405..009f3a4d29f 100644 --- a/drivers/staging/vt6655/mib.h +++ b/drivers/staging/vt6655/mib.h @@ -39,32 +39,32 @@ // typedef struct tagSDot11Counters { - ULONG Length; // Length of structure - ULONGLONG TransmittedFragmentCount; - ULONGLONG MulticastTransmittedFrameCount; - ULONGLONG FailedCount; - ULONGLONG RetryCount; - ULONGLONG MultipleRetryCount; - ULONGLONG RTSSuccessCount; - ULONGLONG RTSFailureCount; - ULONGLONG ACKFailureCount; - ULONGLONG FrameDuplicateCount; - ULONGLONG ReceivedFragmentCount; - ULONGLONG MulticastReceivedFrameCount; - ULONGLONG FCSErrorCount; - ULONGLONG TKIPLocalMICFailures; - ULONGLONG TKIPRemoteMICFailures; - ULONGLONG TKIPICVErrors; - ULONGLONG TKIPCounterMeasuresInvoked; - ULONGLONG TKIPReplays; - ULONGLONG CCMPFormatErrors; - ULONGLONG CCMPReplays; - ULONGLONG CCMPDecryptErrors; - ULONGLONG FourWayHandshakeFailures; -// ULONGLONG WEPUndecryptableCount; -// ULONGLONG WEPICVErrorCount; -// ULONGLONG DecryptSuccessCount; -// ULONGLONG DecryptFailureCount; + unsigned long Length; // Length of structure + unsigned long long TransmittedFragmentCount; + unsigned long long MulticastTransmittedFrameCount; + unsigned long long FailedCount; + unsigned long long RetryCount; + unsigned long long MultipleRetryCount; + unsigned long long RTSSuccessCount; + unsigned long long RTSFailureCount; + unsigned long long ACKFailureCount; + unsigned long long FrameDuplicateCount; + unsigned long long ReceivedFragmentCount; + unsigned long long MulticastReceivedFrameCount; + unsigned long long FCSErrorCount; + unsigned long long TKIPLocalMICFailures; + unsigned long long TKIPRemoteMICFailures; + unsigned long long TKIPICVErrors; + unsigned long long TKIPCounterMeasuresInvoked; + unsigned long long TKIPReplays; + unsigned long long CCMPFormatErrors; + unsigned long long CCMPReplays; + unsigned long long CCMPDecryptErrors; + unsigned long long FourWayHandshakeFailures; +// unsigned long long WEPUndecryptableCount; +// unsigned long long WEPICVErrorCount; +// unsigned long long DecryptSuccessCount; +// unsigned long long DecryptFailureCount; } SDot11Counters, *PSDot11Counters; @@ -72,29 +72,29 @@ typedef struct tagSDot11Counters { // MIB2 counter // typedef struct tagSMib2Counter { - LONG ifIndex; + long ifIndex; char ifDescr[256]; // max size 255 plus zero ending // e.g. "interface 1" - LONG ifType; - LONG ifMtu; - DWORD ifSpeed; - BYTE ifPhysAddress[ETH_ALEN]; - LONG ifAdminStatus; - LONG ifOperStatus; - DWORD ifLastChange; - DWORD ifInOctets; - DWORD ifInUcastPkts; - DWORD ifInNUcastPkts; - DWORD ifInDiscards; - DWORD ifInErrors; - DWORD ifInUnknownProtos; - DWORD ifOutOctets; - DWORD ifOutUcastPkts; - DWORD ifOutNUcastPkts; - DWORD ifOutDiscards; - DWORD ifOutErrors; - DWORD ifOutQLen; - DWORD ifSpecific; + long ifType; + long ifMtu; + unsigned long ifSpeed; + unsigned char ifPhysAddress[ETH_ALEN]; + long ifAdminStatus; + long ifOperStatus; + unsigned long ifLastChange; + unsigned long ifInOctets; + unsigned long ifInUcastPkts; + unsigned long ifInNUcastPkts; + unsigned long ifInDiscards; + unsigned long ifInErrors; + unsigned long ifInUnknownProtos; + unsigned long ifOutOctets; + unsigned long ifOutUcastPkts; + unsigned long ifOutNUcastPkts; + unsigned long ifOutDiscards; + unsigned long ifOutErrors; + unsigned long ifOutQLen; + unsigned long ifSpecific; } SMib2Counter, *PSMib2Counter; // Value in the ifType entry @@ -111,64 +111,64 @@ typedef struct tagSMib2Counter { // RMON counter // typedef struct tagSRmonCounter { - LONG etherStatsIndex; - DWORD etherStatsDataSource; - DWORD etherStatsDropEvents; - DWORD etherStatsOctets; - DWORD etherStatsPkts; - DWORD etherStatsBroadcastPkts; - DWORD etherStatsMulticastPkts; - DWORD etherStatsCRCAlignErrors; - DWORD etherStatsUndersizePkts; - DWORD etherStatsOversizePkts; - DWORD etherStatsFragments; - DWORD etherStatsJabbers; - DWORD etherStatsCollisions; - DWORD etherStatsPkt64Octets; - DWORD etherStatsPkt65to127Octets; - DWORD etherStatsPkt128to255Octets; - DWORD etherStatsPkt256to511Octets; - DWORD etherStatsPkt512to1023Octets; - DWORD etherStatsPkt1024to1518Octets; - DWORD etherStatsOwners; - DWORD etherStatsStatus; + long etherStatsIndex; + unsigned long etherStatsDataSource; + unsigned long etherStatsDropEvents; + unsigned long etherStatsOctets; + unsigned long etherStatsPkts; + unsigned long etherStatsBroadcastPkts; + unsigned long etherStatsMulticastPkts; + unsigned long etherStatsCRCAlignErrors; + unsigned long etherStatsUndersizePkts; + unsigned long etherStatsOversizePkts; + unsigned long etherStatsFragments; + unsigned long etherStatsJabbers; + unsigned long etherStatsCollisions; + unsigned long etherStatsPkt64Octets; + unsigned long etherStatsPkt65to127Octets; + unsigned long etherStatsPkt128to255Octets; + unsigned long etherStatsPkt256to511Octets; + unsigned long etherStatsPkt512to1023Octets; + unsigned long etherStatsPkt1024to1518Octets; + unsigned long etherStatsOwners; + unsigned long etherStatsStatus; } SRmonCounter, *PSRmonCounter; // // Custom counter // typedef struct tagSCustomCounters { - ULONG Length; - - ULONGLONG ullTsrAllOK; - - ULONGLONG ullRsr11M; - ULONGLONG ullRsr5M; - ULONGLONG ullRsr2M; - ULONGLONG ullRsr1M; - - ULONGLONG ullRsr11MCRCOk; - ULONGLONG ullRsr5MCRCOk; - ULONGLONG ullRsr2MCRCOk; - ULONGLONG ullRsr1MCRCOk; - - ULONGLONG ullRsr54M; - ULONGLONG ullRsr48M; - ULONGLONG ullRsr36M; - ULONGLONG ullRsr24M; - ULONGLONG ullRsr18M; - ULONGLONG ullRsr12M; - ULONGLONG ullRsr9M; - ULONGLONG ullRsr6M; - - ULONGLONG ullRsr54MCRCOk; - ULONGLONG ullRsr48MCRCOk; - ULONGLONG ullRsr36MCRCOk; - ULONGLONG ullRsr24MCRCOk; - ULONGLONG ullRsr18MCRCOk; - ULONGLONG ullRsr12MCRCOk; - ULONGLONG ullRsr9MCRCOk; - ULONGLONG ullRsr6MCRCOk; + unsigned long Length; + + unsigned long long ullTsrAllOK; + + unsigned long long ullRsr11M; + unsigned long long ullRsr5M; + unsigned long long ullRsr2M; + unsigned long long ullRsr1M; + + unsigned long long ullRsr11MCRCOk; + unsigned long long ullRsr5MCRCOk; + unsigned long long ullRsr2MCRCOk; + unsigned long long ullRsr1MCRCOk; + + unsigned long long ullRsr54M; + unsigned long long ullRsr48M; + unsigned long long ullRsr36M; + unsigned long long ullRsr24M; + unsigned long long ullRsr18M; + unsigned long long ullRsr12M; + unsigned long long ullRsr9M; + unsigned long long ullRsr6M; + + unsigned long long ullRsr54MCRCOk; + unsigned long long ullRsr48MCRCOk; + unsigned long long ullRsr36MCRCOk; + unsigned long long ullRsr24MCRCOk; + unsigned long long ullRsr18MCRCOk; + unsigned long long ullRsr12MCRCOk; + unsigned long long ullRsr9MCRCOk; + unsigned long long ullRsr6MCRCOk; } SCustomCounters, *PSCustomCounters; @@ -177,29 +177,29 @@ typedef struct tagSCustomCounters { // Custom counter // typedef struct tagSISRCounters { - ULONG Length; - - DWORD dwIsrTx0OK; - DWORD dwIsrAC0TxOK; - DWORD dwIsrBeaconTxOK; - DWORD dwIsrRx0OK; - DWORD dwIsrTBTTInt; - DWORD dwIsrSTIMERInt; - DWORD dwIsrWatchDog; - DWORD dwIsrUnrecoverableError; - DWORD dwIsrSoftInterrupt; - DWORD dwIsrMIBNearfull; - DWORD dwIsrRxNoBuf; - - DWORD dwIsrUnknown; // unknown interrupt count - - DWORD dwIsrRx1OK; - DWORD dwIsrATIMTxOK; - DWORD dwIsrSYNCTxOK; - DWORD dwIsrCFPEnd; - DWORD dwIsrATIMEnd; - DWORD dwIsrSYNCFlushOK; - DWORD dwIsrSTIMER1Int; + unsigned long Length; + + unsigned long dwIsrTx0OK; + unsigned long dwIsrAC0TxOK; + unsigned long dwIsrBeaconTxOK; + unsigned long dwIsrRx0OK; + unsigned long dwIsrTBTTInt; + unsigned long dwIsrSTIMERInt; + unsigned long dwIsrWatchDog; + unsigned long dwIsrUnrecoverableError; + unsigned long dwIsrSoftInterrupt; + unsigned long dwIsrMIBNearfull; + unsigned long dwIsrRxNoBuf; + + unsigned long dwIsrUnknown; // unknown interrupt count + + unsigned long dwIsrRx1OK; + unsigned long dwIsrATIMTxOK; + unsigned long dwIsrSYNCTxOK; + unsigned long dwIsrCFPEnd; + unsigned long dwIsrATIMEnd; + unsigned long dwIsrSYNCFlushOK; + unsigned long dwIsrSTIMER1Int; ///////////////////////////////////// } SISRCounters, *PSISRCounters; @@ -222,99 +222,99 @@ typedef struct tagSStatCounter { // RSR status count // - DWORD dwRsrFrmAlgnErr; - DWORD dwRsrErr; - DWORD dwRsrCRCErr; - DWORD dwRsrCRCOk; - DWORD dwRsrBSSIDOk; - DWORD dwRsrADDROk; - DWORD dwRsrBCNSSIDOk; - DWORD dwRsrLENErr; - DWORD dwRsrTYPErr; - - DWORD dwNewRsrDECRYPTOK; - DWORD dwNewRsrCFP; - DWORD dwNewRsrUTSF; - DWORD dwNewRsrHITAID; - DWORD dwNewRsrHITAID0; - - DWORD dwRsrLong; - DWORD dwRsrRunt; - - DWORD dwRsrRxControl; - DWORD dwRsrRxData; - DWORD dwRsrRxManage; - - DWORD dwRsrRxPacket; - DWORD dwRsrRxOctet; - DWORD dwRsrBroadcast; - DWORD dwRsrMulticast; - DWORD dwRsrDirected; + unsigned long dwRsrFrmAlgnErr; + unsigned long dwRsrErr; + unsigned long dwRsrCRCErr; + unsigned long dwRsrCRCOk; + unsigned long dwRsrBSSIDOk; + unsigned long dwRsrADDROk; + unsigned long dwRsrBCNSSIDOk; + unsigned long dwRsrLENErr; + unsigned long dwRsrTYPErr; + + unsigned long dwNewRsrDECRYPTOK; + unsigned long dwNewRsrCFP; + unsigned long dwNewRsrUTSF; + unsigned long dwNewRsrHITAID; + unsigned long dwNewRsrHITAID0; + + unsigned long dwRsrLong; + unsigned long dwRsrRunt; + + unsigned long dwRsrRxControl; + unsigned long dwRsrRxData; + unsigned long dwRsrRxManage; + + unsigned long dwRsrRxPacket; + unsigned long dwRsrRxOctet; + unsigned long dwRsrBroadcast; + unsigned long dwRsrMulticast; + unsigned long dwRsrDirected; // 64-bit OID - ULONGLONG ullRsrOK; + unsigned long long ullRsrOK; // for some optional OIDs (64 bits) and DMI support - ULONGLONG ullRxBroadcastBytes; - ULONGLONG ullRxMulticastBytes; - ULONGLONG ullRxDirectedBytes; - ULONGLONG ullRxBroadcastFrames; - ULONGLONG ullRxMulticastFrames; - ULONGLONG ullRxDirectedFrames; - - DWORD dwRsrRxFragment; - DWORD dwRsrRxFrmLen64; - DWORD dwRsrRxFrmLen65_127; - DWORD dwRsrRxFrmLen128_255; - DWORD dwRsrRxFrmLen256_511; - DWORD dwRsrRxFrmLen512_1023; - DWORD dwRsrRxFrmLen1024_1518; + unsigned long long ullRxBroadcastBytes; + unsigned long long ullRxMulticastBytes; + unsigned long long ullRxDirectedBytes; + unsigned long long ullRxBroadcastFrames; + unsigned long long ullRxMulticastFrames; + unsigned long long ullRxDirectedFrames; + + unsigned long dwRsrRxFragment; + unsigned long dwRsrRxFrmLen64; + unsigned long dwRsrRxFrmLen65_127; + unsigned long dwRsrRxFrmLen128_255; + unsigned long dwRsrRxFrmLen256_511; + unsigned long dwRsrRxFrmLen512_1023; + unsigned long dwRsrRxFrmLen1024_1518; // TSR status count // - DWORD dwTsrTotalRetry[TYPE_MAXTD]; // total collision retry count - DWORD dwTsrOnceRetry[TYPE_MAXTD]; // this packet only occur one collision - DWORD dwTsrMoreThanOnceRetry[TYPE_MAXTD]; // this packet occur more than one collision - DWORD dwTsrRetry[TYPE_MAXTD]; // this packet has ever occur collision, + unsigned long dwTsrTotalRetry[TYPE_MAXTD]; // total collision retry count + unsigned long dwTsrOnceRetry[TYPE_MAXTD]; // this packet only occur one collision + unsigned long dwTsrMoreThanOnceRetry[TYPE_MAXTD]; // this packet occur more than one collision + unsigned long dwTsrRetry[TYPE_MAXTD]; // this packet has ever occur collision, // that is (dwTsrOnceCollision0 + dwTsrMoreThanOnceCollision0) - DWORD dwTsrACKData[TYPE_MAXTD]; - DWORD dwTsrErr[TYPE_MAXTD]; - DWORD dwAllTsrOK[TYPE_MAXTD]; - DWORD dwTsrRetryTimeout[TYPE_MAXTD]; - DWORD dwTsrTransmitTimeout[TYPE_MAXTD]; - - DWORD dwTsrTxPacket[TYPE_MAXTD]; - DWORD dwTsrTxOctet[TYPE_MAXTD]; - DWORD dwTsrBroadcast[TYPE_MAXTD]; - DWORD dwTsrMulticast[TYPE_MAXTD]; - DWORD dwTsrDirected[TYPE_MAXTD]; + unsigned long dwTsrACKData[TYPE_MAXTD]; + unsigned long dwTsrErr[TYPE_MAXTD]; + unsigned long dwAllTsrOK[TYPE_MAXTD]; + unsigned long dwTsrRetryTimeout[TYPE_MAXTD]; + unsigned long dwTsrTransmitTimeout[TYPE_MAXTD]; + + unsigned long dwTsrTxPacket[TYPE_MAXTD]; + unsigned long dwTsrTxOctet[TYPE_MAXTD]; + unsigned long dwTsrBroadcast[TYPE_MAXTD]; + unsigned long dwTsrMulticast[TYPE_MAXTD]; + unsigned long dwTsrDirected[TYPE_MAXTD]; // RD/TD count - DWORD dwCntRxFrmLength; - DWORD dwCntTxBufLength; + unsigned long dwCntRxFrmLength; + unsigned long dwCntTxBufLength; - BYTE abyCntRxPattern[16]; - BYTE abyCntTxPattern[16]; + unsigned char abyCntRxPattern[16]; + unsigned char abyCntTxPattern[16]; // Software check.... - DWORD dwCntRxDataErr; // rx buffer data software compare CRC err count - DWORD dwCntDecryptErr; // rx buffer data software compare CRC err count - DWORD dwCntRxICVErr; // rx buffer data software compare CRC err count - UINT idxRxErrorDesc[TYPE_MAXRD]; // index for rx data error RD + unsigned long dwCntRxDataErr; // rx buffer data software compare CRC err count + unsigned long dwCntDecryptErr; // rx buffer data software compare CRC err count + unsigned long dwCntRxICVErr; // rx buffer data software compare CRC err count + unsigned int idxRxErrorDesc[TYPE_MAXRD]; // index for rx data error RD // 64-bit OID - ULONGLONG ullTsrOK[TYPE_MAXTD]; + unsigned long long ullTsrOK[TYPE_MAXTD]; // for some optional OIDs (64 bits) and DMI support - ULONGLONG ullTxBroadcastFrames[TYPE_MAXTD]; - ULONGLONG ullTxMulticastFrames[TYPE_MAXTD]; - ULONGLONG ullTxDirectedFrames[TYPE_MAXTD]; - ULONGLONG ullTxBroadcastBytes[TYPE_MAXTD]; - ULONGLONG ullTxMulticastBytes[TYPE_MAXTD]; - ULONGLONG ullTxDirectedBytes[TYPE_MAXTD]; - -// DWORD dwTxRetryCount[8]; + unsigned long long ullTxBroadcastFrames[TYPE_MAXTD]; + unsigned long long ullTxMulticastFrames[TYPE_MAXTD]; + unsigned long long ullTxDirectedFrames[TYPE_MAXTD]; + unsigned long long ullTxBroadcastBytes[TYPE_MAXTD]; + unsigned long long ullTxMulticastBytes[TYPE_MAXTD]; + unsigned long long ullTxDirectedBytes[TYPE_MAXTD]; + +// unsigned long dwTxRetryCount[8]; // // ISR status count // @@ -324,15 +324,15 @@ typedef struct tagSStatCounter { #ifdef Calcu_LinkQual //Tx count: - ULONG TxNoRetryOkCount; //success tx no retry ! - ULONG TxRetryOkCount; //success tx but retry ! - ULONG TxFailCount; //fail tx ? + unsigned long TxNoRetryOkCount; //success tx no retry ! + unsigned long TxRetryOkCount; //success tx but retry ! + unsigned long TxFailCount; //fail tx ? //Rx count: - ULONG RxOkCnt; //success rx ! - ULONG RxFcsErrCnt; //fail rx ? + unsigned long RxOkCnt; //success rx ! + unsigned long RxFcsErrCnt; //fail rx ? //statistic - ULONG SignalStren; - ULONG LinkQuality; + unsigned long SignalStren; + unsigned long LinkQuality; #endif } SStatCounter, *PSStatCounter; @@ -344,30 +344,29 @@ typedef struct tagSStatCounter { void STAvClearAllCounter(PSStatCounter pStatistic); -void STAvUpdateIsrStatCounter(PSStatCounter pStatistic, DWORD dwIsr); +void STAvUpdateIsrStatCounter(PSStatCounter pStatistic, unsigned long dwIsr); void STAvUpdateRDStatCounter(PSStatCounter pStatistic, - BYTE byRSR, BYTE byNewRSR, BYTE byRxRate, - PBYTE pbyBuffer, UINT cbFrameLength); + unsigned char byRSR, unsigned char byNewRSR, unsigned char byRxRate, + unsigned char *pbyBuffer, unsigned int cbFrameLength); void STAvUpdateRDStatCounterEx(PSStatCounter pStatistic, - BYTE byRSR, BYTE byNewRsr, BYTE byRxRate, - PBYTE pbyBuffer, UINT cbFrameLength); + unsigned char byRSR, unsigned char byNewRsr, unsigned char byRxRate, + unsigned char *pbyBuffer, unsigned int cbFrameLength); -void STAvUpdateTDStatCounter(PSStatCounter pStatistic, - BYTE byTSR0, BYTE byTSR1, - PBYTE pbyBuffer, UINT cbFrameLength, UINT uIdx ); +void STAvUpdateTDStatCounter(PSStatCounter pStatistic, unsigned char byTSR0, unsigned char byTSR1, + unsigned char *pbyBuffer, unsigned int cbFrameLength, unsigned int uIdx); void STAvUpdateTDStatCounterEx( PSStatCounter pStatistic, - PBYTE pbyBuffer, - DWORD cbFrameLength + unsigned char *pbyBuffer, + unsigned long cbFrameLength ); void STAvUpdate802_11Counter( PSDot11Counters p802_11Counter, PSStatCounter pStatistic, - DWORD dwCounter + unsigned long dwCounter ); void STAvClear802_11Counter(PSDot11Counters p802_11Counter); diff --git a/drivers/staging/vt6655/michael.c b/drivers/staging/vt6655/michael.c index 0bf57efdede..67618f069d0 100644 --- a/drivers/staging/vt6655/michael.c +++ b/drivers/staging/vt6655/michael.c @@ -26,8 +26,8 @@ * Date: Sep 4, 2002 * * Functions: - * s_dwGetUINT32 - Convert from BYTE[] to DWORD in a portable way - * s_vPutUINT32 - Convert from DWORD to BYTE[] in a portable way + * s_dwGetUINT32 - Convert from unsigned char [] to unsigned long in a portable way + * s_vPutUINT32 - Convert from unsigned long to unsigned char [] in a portable way * s_vClear - Reset the state to the empty message. * s_vSetKey - Set the key. * MIC_vInit - Set the key. @@ -48,29 +48,29 @@ /*--------------------- Static Functions --------------------------*/ /* -static DWORD s_dwGetUINT32(BYTE * p); // Get DWORD from 4 bytes LSByte first -static void s_vPutUINT32(BYTE* p, DWORD val); // Put DWORD into 4 bytes LSByte first +static unsigned long s_dwGetUINT32(unsigned char *p); // Get unsigned long from 4 bytes LSByte first +static void s_vPutUINT32(unsigned char *p, unsigned long val); // Put unsigned long into 4 bytes LSByte first */ static void s_vClear(void); // Clear the internal message, // resets the object to the state just after construction. -static void s_vSetKey(DWORD dwK0, DWORD dwK1); -static void s_vAppendByte(BYTE b); // Add a single byte to the internal message +static void s_vSetKey(unsigned long dwK0, unsigned long dwK1); +static void s_vAppendByte(unsigned char b); // Add a single byte to the internal message /*--------------------- Export Variables --------------------------*/ -static DWORD L, R; // Current state +static unsigned long L, R; // Current state -static DWORD K0, K1; // Key -static DWORD M; // Message accumulator (single word) -static UINT nBytesInM; // # bytes in M +static unsigned long K0, K1; // Key +static unsigned long M; // Message accumulator (single word) +static unsigned int nBytesInM; // # bytes in M /*--------------------- Export Functions --------------------------*/ /* -static DWORD s_dwGetUINT32 (BYTE * p) -// Convert from BYTE[] to DWORD in a portable way +static unsigned long s_dwGetUINT32 (unsigned char *p) +// Convert from unsigned char [] to unsigned long in a portable way { - DWORD res = 0; - UINT i; + unsigned long res = 0; + unsigned int i; for(i=0; i<4; i++ ) { res |= (*p++) << (8*i); @@ -78,13 +78,13 @@ static DWORD s_dwGetUINT32 (BYTE * p) return res; } -static void s_vPutUINT32 (BYTE* p, DWORD val) -// Convert from DWORD to BYTE[] in a portable way +static void s_vPutUINT32 (unsigned char *p, unsigned long val) +// Convert from unsigned long to unsigned char [] in a portable way { - UINT i; + unsigned int i; for(i=0; i<4; i++ ) { - *p++ = (BYTE) (val & 0xff); + *p++ = (unsigned char) (val & 0xff); val >>= 8; } } @@ -99,7 +99,7 @@ static void s_vClear (void) M = 0; } -static void s_vSetKey (DWORD dwK0, DWORD dwK1) +static void s_vSetKey (unsigned long dwK0, unsigned long dwK1) { // Set the key K0 = dwK0; @@ -108,7 +108,7 @@ static void s_vSetKey (DWORD dwK0, DWORD dwK1) s_vClear(); } -static void s_vAppendByte (BYTE b) +static void s_vAppendByte (unsigned char b) { // Append the byte to our word-sized buffer M |= b << (8*nBytesInM); @@ -131,7 +131,7 @@ static void s_vAppendByte (BYTE b) } } -void MIC_vInit (DWORD dwK0, DWORD dwK1) +void MIC_vInit (unsigned long dwK0, unsigned long dwK1) { // Set the key s_vSetKey(dwK0, dwK1); @@ -149,7 +149,7 @@ void MIC_vUnInit (void) s_vClear(); } -void MIC_vAppend (PBYTE src, UINT nBytes) +void MIC_vAppend (unsigned char *src, unsigned int nBytes) { // This is simple while (nBytes > 0) @@ -159,7 +159,7 @@ void MIC_vAppend (PBYTE src, UINT nBytes) } } -void MIC_vGetMIC (PDWORD pdwL, PDWORD pdwR) +void MIC_vGetMIC (unsigned long *pdwL, unsigned long *pdwR) { // Append the minimum padding s_vAppendByte(0x5a); diff --git a/drivers/staging/vt6655/michael.h b/drivers/staging/vt6655/michael.h index 97de77b4da2..3131b161d6a 100644 --- a/drivers/staging/vt6655/michael.h +++ b/drivers/staging/vt6655/michael.h @@ -35,16 +35,16 @@ /*--------------------- Export Types ------------------------------*/ -void MIC_vInit(DWORD dwK0, DWORD dwK1); +void MIC_vInit(unsigned long dwK0, unsigned long dwK1); void MIC_vUnInit(void); // Append bytes to the message to be MICed -void MIC_vAppend(PBYTE src, UINT nBytes); +void MIC_vAppend(unsigned char *src, unsigned int nBytes); // Get the MIC result. Destination should accept 8 bytes of result. // This also resets the message to empty. -void MIC_vGetMIC(PDWORD pdwL, PDWORD pdwR); +void MIC_vGetMIC(unsigned long *pdwL, unsigned long *pdwR); /*--------------------- Export Macros ------------------------------*/ diff --git a/drivers/staging/vt6655/power.c b/drivers/staging/vt6655/power.c index 64c22c3e4bb..7207aca1301 100644 --- a/drivers/staging/vt6655/power.c +++ b/drivers/staging/vt6655/power.c @@ -77,12 +77,12 @@ static int msglevel =MSG_LEVEL_INFO; void PSvEnablePowerSaving( void *hDeviceContext, - WORD wListenInterval + unsigned short wListenInterval ) { PSDevice pDevice = (PSDevice)hDeviceContext; PSMgmtObject pMgmt = pDevice->pMgmt; - WORD wAID = pMgmt->wCurrAID | BIT14 | BIT15; + unsigned short wAID = pMgmt->wCurrAID | BIT14 | BIT15; // set period of power up before TBTT VNSvOutPortW(pDevice->PortOffset + MAC_REG_PWBT, C_PWBT); @@ -115,7 +115,7 @@ PSvEnablePowerSaving( // enable power saving hw function MACvRegBitsOn(pDevice->PortOffset, MAC_REG_PSCTL, PSCTL_PSEN); - pDevice->bEnablePSMode = TRUE; + pDevice->bEnablePSMode = true; if (pDevice->eOPMode == OP_MODE_ADHOC) { // bMgrPrepareBeaconToSend((void *)pDevice, pMgmt); @@ -124,7 +124,7 @@ PSvEnablePowerSaving( else if (pDevice->eOPMode == OP_MODE_INFRASTRUCTURE) { PSbSendNullPacket(pDevice); } - pDevice->bPWBitOn = TRUE; + pDevice->bPWBitOn = true; DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "PS:Power Saving Mode Enable... \n"); return; } @@ -161,12 +161,12 @@ PSvDisablePowerSaving( // set always listen beacon MACvRegBitsOn(pDevice->PortOffset, MAC_REG_PSCTL, PSCTL_ALBCN); - pDevice->bEnablePSMode = FALSE; + pDevice->bEnablePSMode = false; if (pDevice->eOPMode == OP_MODE_INFRASTRUCTURE) { PSbSendNullPacket(pDevice); } - pDevice->bPWBitOn = FALSE; + pDevice->bPWBitOn = false; return; } @@ -177,35 +177,35 @@ PSvDisablePowerSaving( * Consider to power down when no more packets to tx or rx. * * Return Value: - * TRUE, if power down success - * FALSE, if fail + * true, if power down success + * false, if fail -*/ -BOOL +bool PSbConsiderPowerDown( void *hDeviceContext, - BOOL bCheckRxDMA, - BOOL bCheckCountToWakeUp + bool bCheckRxDMA, + bool bCheckCountToWakeUp ) { PSDevice pDevice = (PSDevice)hDeviceContext; PSMgmtObject pMgmt = pDevice->pMgmt; - UINT uIdx; + unsigned int uIdx; // check if already in Doze mode if (MACbIsRegBitsOn(pDevice->PortOffset, MAC_REG_PSCTL, PSCTL_PS)) - return TRUE; + return true; if (pMgmt->eCurrMode != WMAC_MODE_IBSS_STA) { // check if in TIM wake period if (pMgmt->bInTIMWake) - return FALSE; + return false; } // check scan state if (pDevice->bCmdRunning) - return FALSE; + return false; // Froce PSEN on MACvRegBitsOn(pDevice->PortOffset, MAC_REG_PSCTL, PSCTL_PSEN); @@ -213,27 +213,27 @@ PSbConsiderPowerDown( // check if all TD are empty, for (uIdx = 0; uIdx < TYPE_MAXTD; uIdx ++) { if (pDevice->iTDUsed[uIdx] != 0) - return FALSE; + return false; } // check if rx isr is clear if (bCheckRxDMA && ((pDevice->dwIsr& ISR_RXDMA0) != 0) && ((pDevice->dwIsr & ISR_RXDMA1) != 0)){ - return FALSE; + return false; }; if (pMgmt->eCurrMode != WMAC_MODE_IBSS_STA) { if (bCheckCountToWakeUp && (pMgmt->wCountToWakeUp == 0 || pMgmt->wCountToWakeUp == 1)) { - return FALSE; + return false; } } // no Tx, no Rx isr, now go to Doze MACvRegBitsOn(pDevice->PortOffset, MAC_REG_PSCTL, PSCTL_GO2DOZE); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Go to Doze ZZZZZZZZZZZZZZZ\n"); - return TRUE; + return true; } @@ -262,7 +262,7 @@ PSvSendPSPOLL( memset(pMgmt->pbyPSPacketPool, 0, sizeof(STxMgmtPacket) + WLAN_HDR_ADDR2_LEN); pTxPacket = (PSTxMgmtPacket)pMgmt->pbyPSPacketPool; - pTxPacket->p80211Header = (PUWLAN_80211HDR)((PBYTE)pTxPacket + sizeof(STxMgmtPacket)); + pTxPacket->p80211Header = (PUWLAN_80211HDR)((unsigned char *)pTxPacket + sizeof(STxMgmtPacket)); pTxPacket->p80211Header->sA2.wFrameCtl = cpu_to_le16( ( WLAN_SET_FC_FTYPE(WLAN_TYPE_CTL) | @@ -296,7 +296,7 @@ PSvSendPSPOLL( * None. * -*/ -BOOL +bool PSbSendNullPacket( void *hDeviceContext ) @@ -304,32 +304,32 @@ PSbSendNullPacket( PSDevice pDevice = (PSDevice)hDeviceContext; PSTxMgmtPacket pTxPacket = NULL; PSMgmtObject pMgmt = pDevice->pMgmt; - UINT uIdx; + unsigned int uIdx; - if (pDevice->bLinkPass == FALSE) { - return FALSE; + if (pDevice->bLinkPass == false) { + return false; } #ifdef TxInSleep - if ((pDevice->bEnablePSMode == FALSE) && - (pDevice->fTxDataInSleep == FALSE)){ - return FALSE; + if ((pDevice->bEnablePSMode == false) && + (pDevice->fTxDataInSleep == false)){ + return false; } #else - if (pDevice->bEnablePSMode == FALSE) { - return FALSE; + if (pDevice->bEnablePSMode == false) { + return false; } #endif if (pDevice->bEnablePSMode) { for (uIdx = 0; uIdx < TYPE_MAXTD; uIdx ++) { if (pDevice->iTDUsed[uIdx] != 0) - return FALSE; + return false; } } memset(pMgmt->pbyPSPacketPool, 0, sizeof(STxMgmtPacket) + WLAN_NULLDATA_FR_MAXLEN); pTxPacket = (PSTxMgmtPacket)pMgmt->pbyPSPacketPool; - pTxPacket->p80211Header = (PUWLAN_80211HDR)((PBYTE)pTxPacket + sizeof(STxMgmtPacket)); + pTxPacket->p80211Header = (PUWLAN_80211HDR)((unsigned char *)pTxPacket + sizeof(STxMgmtPacket)); if (pDevice->bEnablePSMode) { @@ -350,7 +350,7 @@ PSbSendNullPacket( } if(pMgmt->eCurrMode != WMAC_MODE_IBSS_STA) { - pTxPacket->p80211Header->sA3.wFrameCtl |= cpu_to_le16((WORD)WLAN_SET_FC_TODS(1)); + pTxPacket->p80211Header->sA3.wFrameCtl |= cpu_to_le16((unsigned short)WLAN_SET_FC_TODS(1)); } memcpy(pTxPacket->p80211Header->sA3.abyAddr1, pMgmt->abyCurrBSSID, WLAN_ADDR_LEN); @@ -361,7 +361,7 @@ PSbSendNullPacket( // send the frame if (csMgmt_xmit(pDevice, pTxPacket) != CMD_STATUS_PENDING) { DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Send Null Packet failed !\n"); - return FALSE; + return false; } else { @@ -369,7 +369,7 @@ PSbSendNullPacket( } - return TRUE ; + return true ; } /*+ @@ -382,7 +382,7 @@ PSbSendNullPacket( * -*/ -BOOL +bool PSbIsNextTBTTWakeUp( void *hDeviceContext ) @@ -390,7 +390,7 @@ PSbIsNextTBTTWakeUp( PSDevice pDevice = (PSDevice)hDeviceContext; PSMgmtObject pMgmt = pDevice->pMgmt; - BOOL bWakeUp = FALSE; + bool bWakeUp = false; if (pMgmt->wListenInterval >= 2) { if (pMgmt->wCountToWakeUp == 0) { @@ -402,7 +402,7 @@ PSbIsNextTBTTWakeUp( if (pMgmt->wCountToWakeUp == 1) { // Turn on wake up to listen next beacon MACvRegBitsOn(pDevice->PortOffset, MAC_REG_PSCTL, PSCTL_LNBCN); - bWakeUp = TRUE; + bWakeUp = true; } } diff --git a/drivers/staging/vt6655/power.h b/drivers/staging/vt6655/power.h index c0dbe216e97..01013b59228 100644 --- a/drivers/staging/vt6655/power.h +++ b/drivers/staging/vt6655/power.h @@ -48,11 +48,11 @@ // PSDevice pDevice // PSDevice hDeviceContext -BOOL +bool PSbConsiderPowerDown( void *hDeviceContext, - BOOL bCheckRxDMA, - BOOL bCheckCountToWakeUp + bool bCheckRxDMA, + bool bCheckCountToWakeUp ); void @@ -63,7 +63,7 @@ PSvDisablePowerSaving( void PSvEnablePowerSaving( void *hDeviceContext, - WORD wListenInterval + unsigned short wListenInterval ); void @@ -71,12 +71,12 @@ PSvSendPSPOLL( void *hDeviceContext ); -BOOL +bool PSbSendNullPacket( void *hDeviceContext ); -BOOL +bool PSbIsNextTBTTWakeUp( void *hDeviceContext ); diff --git a/drivers/staging/vt6655/rc4.c b/drivers/staging/vt6655/rc4.c index 4a53f159cb3..9856c08b3d7 100644 --- a/drivers/staging/vt6655/rc4.c +++ b/drivers/staging/vt6655/rc4.c @@ -32,38 +32,38 @@ #include "rc4.h" -void rc4_init(PRC4Ext pRC4, PBYTE pbyKey, UINT cbKey_len) +void rc4_init(PRC4Ext pRC4, unsigned char *pbyKey, unsigned int cbKey_len) { - UINT ust1, ust2; - UINT keyindex; - UINT stateindex; - PBYTE pbyst; - UINT idx; + unsigned int ust1, ust2; + unsigned int keyindex; + unsigned int stateindex; + unsigned char *pbyst; + unsigned int idx; pbyst = pRC4->abystate; pRC4->ux = 0; pRC4->uy = 0; for (idx = 0; idx < 256; idx++) - pbyst[idx] = (BYTE)idx; + pbyst[idx] = (unsigned char)idx; keyindex = 0; stateindex = 0; for (idx = 0; idx < 256; idx++) { ust1 = pbyst[idx]; stateindex = (stateindex + pbyKey[keyindex] + ust1) & 0xff; ust2 = pbyst[stateindex]; - pbyst[stateindex] = (BYTE)ust1; - pbyst[idx] = (BYTE)ust2; + pbyst[stateindex] = (unsigned char)ust1; + pbyst[idx] = (unsigned char)ust2; if (++keyindex >= cbKey_len) keyindex = 0; } } -UINT rc4_byte(PRC4Ext pRC4) +unsigned int rc4_byte(PRC4Ext pRC4) { - UINT ux; - UINT uy; - UINT ustx, usty; - PBYTE pbyst; + unsigned int ux; + unsigned int uy; + unsigned int ustx, usty; + unsigned char *pbyst; pbyst = pRC4->abystate; ux = (pRC4->ux + 1) & 0xff; @@ -72,16 +72,16 @@ UINT rc4_byte(PRC4Ext pRC4) usty = pbyst[uy]; pRC4->ux = ux; pRC4->uy = uy; - pbyst[uy] = (BYTE)ustx; - pbyst[ux] = (BYTE)usty; + pbyst[uy] = (unsigned char)ustx; + pbyst[ux] = (unsigned char)usty; return pbyst[(ustx + usty) & 0xff]; } -void rc4_encrypt(PRC4Ext pRC4, PBYTE pbyDest, - PBYTE pbySrc, UINT cbData_len) +void rc4_encrypt(PRC4Ext pRC4, unsigned char *pbyDest, + unsigned char *pbySrc, unsigned int cbData_len) { - UINT ii; + unsigned int ii; for (ii = 0; ii < cbData_len; ii++) - pbyDest[ii] = (BYTE)(pbySrc[ii] ^ rc4_byte(pRC4)); + pbyDest[ii] = (unsigned char)(pbySrc[ii] ^ rc4_byte(pRC4)); } diff --git a/drivers/staging/vt6655/rc4.h b/drivers/staging/vt6655/rc4.h index e65cae69efa..ad04e351365 100644 --- a/drivers/staging/vt6655/rc4.h +++ b/drivers/staging/vt6655/rc4.h @@ -35,13 +35,13 @@ /*--------------------- Export Definitions -------------------------*/ /*--------------------- Export Types ------------------------------*/ typedef struct { - UINT ux; - UINT uy; - BYTE abystate[256]; + unsigned int ux; + unsigned int uy; + unsigned char abystate[256]; } RC4Ext, *PRC4Ext; -void rc4_init(PRC4Ext pRC4, PBYTE pbyKey, UINT cbKey_len); -UINT rc4_byte(PRC4Ext pRC4); -void rc4_encrypt(PRC4Ext pRC4, PBYTE pbyDest, PBYTE pbySrc, UINT cbData_len); +void rc4_init(PRC4Ext pRC4, unsigned char *pbyKey, unsigned int cbKey_len); +unsigned int rc4_byte(PRC4Ext pRC4); +void rc4_encrypt(PRC4Ext pRC4, unsigned char *pbyDest, unsigned char *pbySrc, unsigned int cbData_len); #endif //__RC4_H__ diff --git a/drivers/staging/vt6655/rf.c b/drivers/staging/vt6655/rf.c index 7cb86fe2eeb..b8ec783e55e 100644 --- a/drivers/staging/vt6655/rf.c +++ b/drivers/staging/vt6655/rf.c @@ -94,7 +94,7 @@ -const DWORD dwAL2230InitTable[CB_AL2230_INIT_SEQ] = { +const unsigned long dwAL2230InitTable[CB_AL2230_INIT_SEQ] = { 0x03F79000+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW, // 0x03333100+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW, // 0x01A00200+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW, // @@ -112,7 +112,7 @@ const DWORD dwAL2230InitTable[CB_AL2230_INIT_SEQ] = { 0x00580F00+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW }; -const DWORD dwAL2230ChannelTable0[CB_MAX_CHANNEL] = { +const unsigned long dwAL2230ChannelTable0[CB_MAX_CHANNEL] = { 0x03F79000+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW, // channel = 1, Tf = 2412MHz 0x03F79000+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW, // channel = 2, Tf = 2417MHz 0x03E79000+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW, // channel = 3, Tf = 2422MHz @@ -129,7 +129,7 @@ const DWORD dwAL2230ChannelTable0[CB_MAX_CHANNEL] = { 0x03E7C000+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW // channel = 14, Tf = 2412M }; -const DWORD dwAL2230ChannelTable1[CB_MAX_CHANNEL] = { +const unsigned long dwAL2230ChannelTable1[CB_MAX_CHANNEL] = { 0x03333100+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW, // channel = 1, Tf = 2412MHz 0x0B333100+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW, // channel = 2, Tf = 2417MHz 0x03333100+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW, // channel = 3, Tf = 2422MHz @@ -146,7 +146,7 @@ const DWORD dwAL2230ChannelTable1[CB_MAX_CHANNEL] = { 0x06666100+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW // channel = 14, Tf = 2412M }; -DWORD dwAL2230PowerTable[AL2230_PWR_IDX_LEN] = { +unsigned long dwAL2230PowerTable[AL2230_PWR_IDX_LEN] = { 0x04040900+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW, 0x04041900+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW, 0x04042900+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW, @@ -216,7 +216,7 @@ DWORD dwAL2230PowerTable[AL2230_PWR_IDX_LEN] = { //{{ RobertYu:20050104 // 40MHz reference frequency // Need to Pull PLLON(PE3) low when writing channel registers through 3-wire. -const DWORD dwAL7230InitTable[CB_AL7230_INIT_SEQ] = { +const unsigned long dwAL7230InitTable[CB_AL7230_INIT_SEQ] = { 0x00379000+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // Channel1 // Need modify for 11a 0x13333100+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // Channel1 // Need modify for 11a 0x841FF200+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // Need modify for 11a: 451FE2 @@ -239,7 +239,7 @@ const DWORD dwAL7230InitTable[CB_AL7230_INIT_SEQ] = { 0x1ABA8F00+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW // Need modify for 11a: 12BACF }; -const DWORD dwAL7230InitTableAMode[CB_AL7230_INIT_SEQ] = { +const unsigned long dwAL7230InitTableAMode[CB_AL7230_INIT_SEQ] = { 0x0FF52000+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // Channel184 // Need modify for 11b/g 0x00000100+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // Channel184 // Need modify for 11b/g 0x451FE200+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // Need modify for 11b/g @@ -259,7 +259,7 @@ const DWORD dwAL7230InitTableAMode[CB_AL7230_INIT_SEQ] = { }; -const DWORD dwAL7230ChannelTable0[CB_MAX_CHANNEL] = { +const unsigned long dwAL7230ChannelTable0[CB_MAX_CHANNEL] = { 0x00379000+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel = 1, Tf = 2412MHz 0x00379000+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel = 2, Tf = 2417MHz 0x00379000+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel = 3, Tf = 2422MHz @@ -325,7 +325,7 @@ const DWORD dwAL7230ChannelTable0[CB_MAX_CHANNEL] = { 0x0FF61000+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW // channel = 165, Tf = 5825MHz (56) }; -const DWORD dwAL7230ChannelTable1[CB_MAX_CHANNEL] = { +const unsigned long dwAL7230ChannelTable1[CB_MAX_CHANNEL] = { 0x13333100+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel = 1, Tf = 2412MHz 0x1B333100+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel = 2, Tf = 2417MHz 0x03333100+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel = 3, Tf = 2422MHz @@ -389,7 +389,7 @@ const DWORD dwAL7230ChannelTable1[CB_MAX_CHANNEL] = { 0x02AAA100+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW // channel = 165, Tf = 5825MHz (56) }; -const DWORD dwAL7230ChannelTable2[CB_MAX_CHANNEL] = { +const unsigned long dwAL7230ChannelTable2[CB_MAX_CHANNEL] = { 0x7FD78400+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel = 1, Tf = 2412MHz 0x7FD78400+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel = 2, Tf = 2417MHz 0x7FD78400+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel = 3, Tf = 2422MHz @@ -471,15 +471,15 @@ const DWORD dwAL7230ChannelTable2[CB_MAX_CHANNEL] = { * Out: * none * - * Return Value: TRUE if succeeded; FALSE if failed. + * Return Value: true if succeeded; false if failed. * */ -BOOL s_bAL7230Init (DWORD_PTR dwIoBase) +bool s_bAL7230Init (unsigned long dwIoBase) { int ii; - BOOL bResult; + bool bResult; - bResult = TRUE; + bResult = true; //3-wire control for normal mode VNSvOutPortB(dwIoBase + MAC_REG_SOFTPWRCTL, 0); @@ -517,11 +517,11 @@ BOOL s_bAL7230Init (DWORD_PTR dwIoBase) } // Need to Pull PLLON low when writing channel registers through 3-wire interface -BOOL s_bAL7230SelectChannel (DWORD_PTR dwIoBase, BYTE byChannel) +bool s_bAL7230SelectChannel (unsigned long dwIoBase, unsigned char byChannel) { - BOOL bResult; + bool bResult; - bResult = TRUE; + bResult = true; // PLLON Off MACvWordRegBitsOff(dwIoBase, MAC_REG_SOFTPWRCTL, SOFTPWRCTL_SWPE3); @@ -552,7 +552,7 @@ BOOL s_bAL7230SelectChannel (DWORD_PTR dwIoBase, BYTE byChannel) * Out: * none * - * Return Value: TRUE if succeeded; FALSE if failed. + * Return Value: true if succeeded; false if failed. * */ @@ -567,7 +567,7 @@ BOOL s_bAL7230SelectChannel (DWORD_PTR dwIoBase, BYTE byChannel) * Out: * none * - * Return Value: TRUE if succeeded; FALSE if failed. + * Return Value: true if succeeded; false if failed. * */ @@ -585,7 +585,7 @@ BOOL s_bAL7230SelectChannel (DWORD_PTR dwIoBase, BYTE byChannel) * Out: * none * - * Return Value: TRUE if succeeded; FALSE if failed. + * Return Value: true if succeeded; false if failed. * */ @@ -599,7 +599,7 @@ BOOL s_bAL7230SelectChannel (DWORD_PTR dwIoBase, BYTE byChannel) * Out: * none * - * Return Value: TRUE if succeeded; FALSE if failed. + * Return Value: true if succeeded; false if failed. * */ @@ -619,13 +619,13 @@ BOOL s_bAL7230SelectChannel (DWORD_PTR dwIoBase, BYTE byChannel) * Out: * none * - * Return Value: TRUE if succeeded; FALSE if failed. + * Return Value: true if succeeded; false if failed. * */ -BOOL IFRFbWriteEmbeded (DWORD_PTR dwIoBase, DWORD dwData) +bool IFRFbWriteEmbeded (unsigned long dwIoBase, unsigned long dwData) { - WORD ww; - DWORD dwValue; + unsigned short ww; + unsigned long dwValue; VNSvOutPortD(dwIoBase + MAC_REG_IFREGCTL, dwData); @@ -638,9 +638,9 @@ BOOL IFRFbWriteEmbeded (DWORD_PTR dwIoBase, DWORD dwData) if (ww == W_MAX_TIMEOUT) { // DBG_PORT80_ALWAYS(0x32); - return FALSE; + return false; } - return TRUE; + return true; } @@ -654,7 +654,7 @@ BOOL IFRFbWriteEmbeded (DWORD_PTR dwIoBase, DWORD dwData) * Out: * none * - * Return Value: TRUE if succeeded; FALSE if failed. + * Return Value: true if succeeded; false if failed. * */ @@ -668,7 +668,7 @@ BOOL IFRFbWriteEmbeded (DWORD_PTR dwIoBase, DWORD dwData) * Out: * none * - * Return Value: TRUE if succeeded; FALSE if failed. + * Return Value: true if succeeded; false if failed. * */ @@ -681,15 +681,15 @@ BOOL IFRFbWriteEmbeded (DWORD_PTR dwIoBase, DWORD dwData) * Out: * none * - * Return Value: TRUE if succeeded; FALSE if failed. + * Return Value: true if succeeded; false if failed. * */ -BOOL RFbAL2230Init (DWORD_PTR dwIoBase) +bool RFbAL2230Init (unsigned long dwIoBase) { int ii; - BOOL bResult; + bool bResult; - bResult = TRUE; + bResult = true; //3-wire control for normal mode VNSvOutPortB(dwIoBase + MAC_REG_SOFTPWRCTL, 0); @@ -734,11 +734,11 @@ MACvTimer0MicroSDelay(dwIoBase, 30); //delay 30 us return bResult; } -BOOL RFbAL2230SelectChannel (DWORD_PTR dwIoBase, BYTE byChannel) +bool RFbAL2230SelectChannel (unsigned long dwIoBase, unsigned char byChannel) { - BOOL bResult; + bool bResult; - bResult = TRUE; + bResult = true; bResult &= IFRFbWriteEmbeded (dwIoBase, dwAL2230ChannelTable0[byChannel-1]); bResult &= IFRFbWriteEmbeded (dwIoBase, dwAL2230ChannelTable1[byChannel-1]); @@ -761,7 +761,7 @@ BOOL RFbAL2230SelectChannel (DWORD_PTR dwIoBase, BYTE byChannel) * Out: * none * - * Return Value: TRUE if succeeded; FALSE if failed. + * Return Value: true if succeeded; false if failed. * */ @@ -776,7 +776,7 @@ BOOL RFbAL2230SelectChannel (DWORD_PTR dwIoBase, BYTE byChannel) * Out: * none * - * Return Value: TRUE if succeeded; FALSE if failed. + * Return Value: true if succeeded; false if failed. * */ @@ -790,7 +790,7 @@ BOOL RFbAL2230SelectChannel (DWORD_PTR dwIoBase, BYTE byChannel) * Out: * none * - * Return Value: TRUE if succeeded; FALSE if failed. + * Return Value: true if succeeded; false if failed. * */ @@ -804,14 +804,14 @@ BOOL RFbAL2230SelectChannel (DWORD_PTR dwIoBase, BYTE byChannel) * Out: * none * - * Return Value: TRUE if succeeded; FALSE if failed. + * Return Value: true if succeeded; false if failed. * */ -BOOL RFbInit ( +bool RFbInit ( PSDevice pDevice ) { -BOOL bResult = TRUE; +bool bResult = true; switch (pDevice->byRFType) { case RF_AIROHA : case RF_AL2230S: @@ -823,10 +823,10 @@ BOOL bResult = TRUE; bResult = s_bAL7230Init(pDevice->PortOffset); break; case RF_NOTHING : - bResult = TRUE; + bResult = true; break; default : - bResult = FALSE; + bResult = false; break; } return bResult; @@ -842,21 +842,21 @@ BOOL bResult = TRUE; * Out: * none * - * Return Value: TRUE if succeeded; FALSE if failed. + * Return Value: true if succeeded; false if failed. * */ -BOOL RFbShutDown ( +bool RFbShutDown ( PSDevice pDevice ) { -BOOL bResult = TRUE; +bool bResult = true; switch (pDevice->byRFType) { case RF_AIROHA7230 : bResult = IFRFbWriteEmbeded (pDevice->PortOffset, 0x1ABAEF00+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW); break; default : - bResult = TRUE; + bResult = true; break; } return bResult; @@ -872,12 +872,12 @@ BOOL bResult = TRUE; * Out: * none * - * Return Value: TRUE if succeeded; FALSE if failed. + * Return Value: true if succeeded; false if failed. * */ -BOOL RFbSelectChannel (DWORD_PTR dwIoBase, BYTE byRFType, BYTE byChannel) +bool RFbSelectChannel (unsigned long dwIoBase, unsigned char byRFType, unsigned char byChannel) { -BOOL bResult = TRUE; +bool bResult = true; switch (byRFType) { case RF_AIROHA : @@ -890,10 +890,10 @@ BOOL bResult = TRUE; break; //}} RobertYu case RF_NOTHING : - bResult = TRUE; + bResult = true; break; default: - bResult = FALSE; + bResult = false; break; } return bResult; @@ -911,11 +911,11 @@ BOOL bResult = TRUE; * Return Value: None. * */ -BOOL RFvWriteWakeProgSyn (DWORD_PTR dwIoBase, BYTE byRFType, UINT uChannel) +bool RFvWriteWakeProgSyn (unsigned long dwIoBase, unsigned char byRFType, unsigned int uChannel) { int ii; - BYTE byInitCount = 0; - BYTE bySleepCount = 0; + unsigned char byInitCount = 0; + unsigned char bySleepCount = 0; VNSvOutPortW(dwIoBase + MAC_REG_MISCFFNDEX, 0); switch (byRFType) { @@ -923,20 +923,20 @@ BOOL RFvWriteWakeProgSyn (DWORD_PTR dwIoBase, BYTE byRFType, UINT uChannel) case RF_AL2230S: if (uChannel > CB_MAX_CHANNEL_24G) - return FALSE; + return false; byInitCount = CB_AL2230_INIT_SEQ + 2; // Init Reg + Channel Reg (2) bySleepCount = 0; if (byInitCount > (MISCFIFO_SYNDATASIZE - bySleepCount)) { - return FALSE; + return false; } for (ii = 0; ii < CB_AL2230_INIT_SEQ; ii++ ) { - MACvSetMISCFifo(dwIoBase, (WORD)(MISCFIFO_SYNDATA_IDX + ii), dwAL2230InitTable[ii]); + MACvSetMISCFifo(dwIoBase, (unsigned short)(MISCFIFO_SYNDATA_IDX + ii), dwAL2230InitTable[ii]); } - MACvSetMISCFifo(dwIoBase, (WORD)(MISCFIFO_SYNDATA_IDX + ii), dwAL2230ChannelTable0[uChannel-1]); + MACvSetMISCFifo(dwIoBase, (unsigned short)(MISCFIFO_SYNDATA_IDX + ii), dwAL2230ChannelTable0[uChannel-1]); ii ++; - MACvSetMISCFifo(dwIoBase, (WORD)(MISCFIFO_SYNDATA_IDX + ii), dwAL2230ChannelTable1[uChannel-1]); + MACvSetMISCFifo(dwIoBase, (unsigned short)(MISCFIFO_SYNDATA_IDX + ii), dwAL2230ChannelTable1[uChannel-1]); break; //{{ RobertYu: 20050104 @@ -945,42 +945,42 @@ BOOL RFvWriteWakeProgSyn (DWORD_PTR dwIoBase, BYTE byRFType, UINT uChannel) byInitCount = CB_AL7230_INIT_SEQ + 3; // Init Reg + Channel Reg (3) bySleepCount = 0; if (byInitCount > (MISCFIFO_SYNDATASIZE - bySleepCount)) { - return FALSE; + return false; } if (uChannel <= CB_MAX_CHANNEL_24G) { for (ii = 0; ii < CB_AL7230_INIT_SEQ; ii++ ) { - MACvSetMISCFifo(dwIoBase, (WORD)(MISCFIFO_SYNDATA_IDX + ii), dwAL7230InitTable[ii]); + MACvSetMISCFifo(dwIoBase, (unsigned short)(MISCFIFO_SYNDATA_IDX + ii), dwAL7230InitTable[ii]); } } else { for (ii = 0; ii < CB_AL7230_INIT_SEQ; ii++ ) { - MACvSetMISCFifo(dwIoBase, (WORD)(MISCFIFO_SYNDATA_IDX + ii), dwAL7230InitTableAMode[ii]); + MACvSetMISCFifo(dwIoBase, (unsigned short)(MISCFIFO_SYNDATA_IDX + ii), dwAL7230InitTableAMode[ii]); } } - MACvSetMISCFifo(dwIoBase, (WORD)(MISCFIFO_SYNDATA_IDX + ii), dwAL7230ChannelTable0[uChannel-1]); + MACvSetMISCFifo(dwIoBase, (unsigned short)(MISCFIFO_SYNDATA_IDX + ii), dwAL7230ChannelTable0[uChannel-1]); ii ++; - MACvSetMISCFifo(dwIoBase, (WORD)(MISCFIFO_SYNDATA_IDX + ii), dwAL7230ChannelTable1[uChannel-1]); + MACvSetMISCFifo(dwIoBase, (unsigned short)(MISCFIFO_SYNDATA_IDX + ii), dwAL7230ChannelTable1[uChannel-1]); ii ++; - MACvSetMISCFifo(dwIoBase, (WORD)(MISCFIFO_SYNDATA_IDX + ii), dwAL7230ChannelTable2[uChannel-1]); + MACvSetMISCFifo(dwIoBase, (unsigned short)(MISCFIFO_SYNDATA_IDX + ii), dwAL7230ChannelTable2[uChannel-1]); break; //}} RobertYu case RF_NOTHING : - return TRUE; + return true; break; default: - return FALSE; + return false; break; } - MACvSetMISCFifo(dwIoBase, MISCFIFO_SYNINFO_IDX, (DWORD)MAKEWORD(bySleepCount, byInitCount)); + MACvSetMISCFifo(dwIoBase, MISCFIFO_SYNINFO_IDX, (unsigned long )MAKEWORD(bySleepCount, byInitCount)); - return TRUE; + return true; } /* @@ -993,25 +993,25 @@ BOOL RFvWriteWakeProgSyn (DWORD_PTR dwIoBase, BYTE byRFType, UINT uChannel) * Out: * none * - * Return Value: TRUE if succeeded; FALSE if failed. + * Return Value: true if succeeded; false if failed. * */ -BOOL RFbSetPower ( +bool RFbSetPower ( PSDevice pDevice, - UINT uRATE, - UINT uCH + unsigned int uRATE, + unsigned int uCH ) { -BOOL bResult = TRUE; -BYTE byPwr = 0; -BYTE byDec = 0; -BYTE byPwrdBm = 0; +bool bResult = true; +unsigned char byPwr = 0; +unsigned char byDec = 0; +unsigned char byPwrdBm = 0; if (pDevice->dwDiagRefCount != 0) { - return TRUE; + return true; } if ((uCH < 1) || (uCH > CB_MAX_CHANNEL)) { - return FALSE; + return false; } switch (uRATE) { @@ -1070,7 +1070,7 @@ BYTE byPwrdBm = 0; #if 0 // 802.11h TPC - if (pDevice->bLinkPass == TRUE) { + if (pDevice->bLinkPass == true) { // do not over local constraint if (byPwrdBm > pDevice->abyLocalPwr[uCH]) { pDevice->byCurPwrdBm = pDevice->abyLocalPwr[uCH]; @@ -1111,11 +1111,11 @@ BYTE byPwrdBm = 0; // if (pDevice->byLocalID <= REV_ID_VT3253_B1) { if (pDevice->byCurPwr == byPwr) { - return TRUE; + return true; } bResult = RFbRawSetPower(pDevice, byPwr, uRATE); // } - if (bResult == TRUE) { + if (bResult == true) { pDevice->byCurPwr = byPwr; } return bResult; @@ -1131,21 +1131,21 @@ BYTE byPwrdBm = 0; * Out: * none * - * Return Value: TRUE if succeeded; FALSE if failed. + * Return Value: true if succeeded; false if failed. * */ -BOOL RFbRawSetPower ( +bool RFbRawSetPower ( PSDevice pDevice, - BYTE byPwr, - UINT uRATE + unsigned char byPwr, + unsigned int uRATE ) { -BOOL bResult = TRUE; -DWORD dwMax7230Pwr = 0; +bool bResult = true; +unsigned long dwMax7230Pwr = 0; if (byPwr >= pDevice->byMaxPwrLevel) { - return (FALSE); + return (false); } switch (pDevice->byRFType) { @@ -1204,14 +1204,14 @@ DWORD dwMax7230Pwr = 0; void RFvRSSITodBm ( PSDevice pDevice, - BYTE byCurrRSSI, + unsigned char byCurrRSSI, long * pldBm ) { - BYTE byIdx = (((byCurrRSSI & 0xC0) >> 6) & 0x03); - LONG b = (byCurrRSSI & 0x3F); - LONG a = 0; - BYTE abyAIROHARF[4] = {0, 18, 0, 40}; + unsigned char byIdx = (((byCurrRSSI & 0xC0) >> 6) & 0x03); + long b = (byCurrRSSI & 0x3F); + long a = 0; + unsigned char abyAIROHARF[4] = {0, 18, 0, 40}; switch (pDevice->byRFType) { case RF_AIROHA: @@ -1232,11 +1232,11 @@ RFvRSSITodBm ( // Post processing for the 11b/g and 11a. // for save time on changing Reg2,3,5,7,10,12,15 -BOOL RFbAL7230SelectChannelPostProcess (DWORD_PTR dwIoBase, BYTE byOldChannel, BYTE byNewChannel) +bool RFbAL7230SelectChannelPostProcess (unsigned long dwIoBase, unsigned char byOldChannel, unsigned char byNewChannel) { - BOOL bResult; + bool bResult; - bResult = TRUE; + bResult = true; // if change between 11 b/g and 11a need to update the following register // Channel Index 1~14 diff --git a/drivers/staging/vt6655/rf.h b/drivers/staging/vt6655/rf.h index 25dfc7942f6..1f8d82e1304 100644 --- a/drivers/staging/vt6655/rf.h +++ b/drivers/staging/vt6655/rf.h @@ -76,28 +76,28 @@ /*--------------------- Export Functions --------------------------*/ -BOOL IFRFbWriteEmbeded(DWORD_PTR dwIoBase, DWORD dwData); -BOOL RFbSelectChannel(DWORD_PTR dwIoBase, BYTE byRFType, BYTE byChannel); -BOOL RFbInit ( +bool IFRFbWriteEmbeded(unsigned long dwIoBase, unsigned long dwData); +bool RFbSelectChannel(unsigned long dwIoBase, unsigned char byRFType, unsigned char byChannel); +bool RFbInit ( PSDevice pDevice ); -BOOL RFvWriteWakeProgSyn(DWORD_PTR dwIoBase, BYTE byRFType, UINT uChannel); -BOOL RFbSetPower(PSDevice pDevice, UINT uRATE, UINT uCH); -BOOL RFbRawSetPower( +bool RFvWriteWakeProgSyn(unsigned long dwIoBase, unsigned char byRFType, unsigned int uChannel); +bool RFbSetPower(PSDevice pDevice, unsigned int uRATE, unsigned int uCH); +bool RFbRawSetPower( PSDevice pDevice, - BYTE byPwr, - UINT uRATE + unsigned char byPwr, + unsigned int uRATE ); void RFvRSSITodBm( PSDevice pDevice, - BYTE byCurrRSSI, + unsigned char byCurrRSSI, long *pldBm ); //{{ RobertYu: 20050104 -BOOL RFbAL7230SelectChannelPostProcess(DWORD_PTR dwIoBase, BYTE byOldChannel, BYTE byNewChannel); +bool RFbAL7230SelectChannelPostProcess(unsigned long dwIoBase, unsigned char byOldChannel, unsigned char byNewChannel); //}} RobertYu #endif // __RF_H__ diff --git a/drivers/staging/vt6655/rxtx.c b/drivers/staging/vt6655/rxtx.c index a0445c3427e..c920cf69405 100644 --- a/drivers/staging/vt6655/rxtx.c +++ b/drivers/staging/vt6655/rxtx.c @@ -80,16 +80,16 @@ static int msglevel =MSG_LEVEL_INFO; #define CRITICAL_PACKET_LEN 256 // if packet size < 256 -> in-direct send // packet size >= 256 -> direct send -const WORD wTimeStampOff[2][MAX_RATE] = { +const unsigned short wTimeStampOff[2][MAX_RATE] = { {384, 288, 226, 209, 54, 43, 37, 31, 28, 25, 24, 23}, // Long Preamble {384, 192, 130, 113, 54, 43, 37, 31, 28, 25, 24, 23}, // Short Preamble }; -const WORD wFB_Opt0[2][5] = { +const unsigned short wFB_Opt0[2][5] = { {RATE_12M, RATE_18M, RATE_24M, RATE_36M, RATE_48M}, // fallback_rate0 {RATE_12M, RATE_12M, RATE_18M, RATE_24M, RATE_36M}, // fallback_rate1 }; -const WORD wFB_Opt1[2][5] = { +const unsigned short wFB_Opt1[2][5] = { {RATE_12M, RATE_18M, RATE_24M, RATE_24M, RATE_36M}, // fallback_rate0 {RATE_6M , RATE_6M, RATE_12M, RATE_12M, RATE_18M}, // fallback_rate1 }; @@ -118,12 +118,12 @@ static void s_vFillTxKey( PSDevice pDevice, - PBYTE pbyBuf, - PBYTE pbyIVHead, + unsigned char *pbyBuf, + unsigned char *pbyIVHead, PSKeyItem pTransmitKey, - PBYTE pbyHdrBuf, - WORD wPayloadLen, - PBYTE pMICHDR + unsigned char *pbyHdrBuf, + unsigned short wPayloadLen, + unsigned char *pMICHDR ); @@ -132,76 +132,65 @@ static void s_vFillRTSHead( PSDevice pDevice, - BYTE byPktType, + unsigned char byPktType, void * pvRTS, - UINT cbFrameLength, - BOOL bNeedAck, - BOOL bDisCRC, + unsigned int cbFrameLength, + bool bNeedAck, + bool bDisCRC, PSEthernetHeader psEthHeader, - WORD wCurrentRate, - BYTE byFBOption + unsigned short wCurrentRate, + unsigned char byFBOption ); static void s_vGenerateTxParameter( PSDevice pDevice, - BYTE byPktType, + unsigned char byPktType, void * pTxBufHead, void * pvRrvTime, void * pvRTS, void * pvCTS, - UINT cbFrameSize, - BOOL bNeedACK, - UINT uDMAIdx, + unsigned int cbFrameSize, + bool bNeedACK, + unsigned int uDMAIdx, PSEthernetHeader psEthHeader, - WORD wCurrentRate + unsigned short wCurrentRate ); static void s_vFillFragParameter( PSDevice pDevice, - PBYTE pbyBuffer, - UINT uTxType, + unsigned char *pbyBuffer, + unsigned int uTxType, void * pvtdCurr, - WORD wFragType, - UINT cbReqCount + unsigned short wFragType, + unsigned int cbReqCount ); -static -UINT -s_cbFillTxBufHead ( - PSDevice pDevice, - BYTE byPktType, - PBYTE pbyTxBufferAddr, - UINT cbFrameBodySize, - UINT uDMAIdx, - PSTxDesc pHeadTD, - PSEthernetHeader psEthHeader, - PBYTE pPacket, - BOOL bNeedEncrypt, - PSKeyItem pTransmitKey, - UINT uNodeIndex, - PUINT puMACfragNum - ); +static unsigned int +s_cbFillTxBufHead(PSDevice pDevice, unsigned char byPktType, unsigned char *pbyTxBufferAddr, + unsigned int cbFrameBodySize, unsigned int uDMAIdx, PSTxDesc pHeadTD, + PSEthernetHeader psEthHeader, unsigned char *pPacket, bool bNeedEncrypt, + PSKeyItem pTransmitKey, unsigned int uNodeIndex, unsigned int *puMACfragNum); static -UINT +unsigned int s_uFillDataHead ( PSDevice pDevice, - BYTE byPktType, + unsigned char byPktType, void * pTxDataHead, - UINT cbFrameLength, - UINT uDMAIdx, - BOOL bNeedAck, - UINT uFragIdx, - UINT cbLastFragmentSize, - UINT uMACfragNum, - BYTE byFBOption, - WORD wCurrentRate + unsigned int cbFrameLength, + unsigned int uDMAIdx, + bool bNeedAck, + unsigned int uFragIdx, + unsigned int cbLastFragmentSize, + unsigned int uMACfragNum, + unsigned char byFBOption, + unsigned short wCurrentRate ); @@ -213,20 +202,20 @@ static void s_vFillTxKey ( PSDevice pDevice, - PBYTE pbyBuf, - PBYTE pbyIVHead, + unsigned char *pbyBuf, + unsigned char *pbyIVHead, PSKeyItem pTransmitKey, - PBYTE pbyHdrBuf, - WORD wPayloadLen, - PBYTE pMICHDR + unsigned char *pbyHdrBuf, + unsigned short wPayloadLen, + unsigned char *pMICHDR ) { - PDWORD pdwIV = (PDWORD) pbyIVHead; - PDWORD pdwExtIV = (PDWORD) ((PBYTE)pbyIVHead+4); - WORD wValue; + unsigned long *pdwIV = (unsigned long *) pbyIVHead; + unsigned long *pdwExtIV = (unsigned long *) ((unsigned char *)pbyIVHead+4); + unsigned short wValue; PS802_11Header pMACHeader = (PS802_11Header)pbyHdrBuf; - DWORD dwRevIVCounter; - BYTE byKeyIndex = 0; + unsigned long dwRevIVCounter; + unsigned char byKeyIndex = 0; @@ -240,13 +229,13 @@ s_vFillTxKey ( if (pTransmitKey->byCipherSuite == KEY_CTL_WEP) { if (pTransmitKey->uKeyLength == WLAN_WEP232_KEYLEN ){ - memcpy(pDevice->abyPRNG, (PBYTE)&(dwRevIVCounter), 3); + memcpy(pDevice->abyPRNG, (unsigned char *)&(dwRevIVCounter), 3); memcpy(pDevice->abyPRNG+3, pTransmitKey->abyKey, pTransmitKey->uKeyLength); } else { - memcpy(pbyBuf, (PBYTE)&(dwRevIVCounter), 3); + memcpy(pbyBuf, (unsigned char *)&(dwRevIVCounter), 3); memcpy(pbyBuf+3, pTransmitKey->abyKey, pTransmitKey->uKeyLength); if(pTransmitKey->uKeyLength == WLAN_WEP40_KEYLEN) { - memcpy(pbyBuf+8, (PBYTE)&(dwRevIVCounter), 3); + memcpy(pbyBuf+8, (unsigned char *)&(dwRevIVCounter), 3); memcpy(pbyBuf+11, pTransmitKey->abyKey, pTransmitKey->uKeyLength); } memcpy(pDevice->abyPRNG, pbyBuf, 16); @@ -270,7 +259,7 @@ s_vFillTxKey ( // Make IV memcpy(pdwIV, pDevice->abyPRNG, 3); - *(pbyIVHead+3) = (BYTE)(((byKeyIndex << 6) & 0xc0) | 0x20); // 0x20 is ExtIV + *(pbyIVHead+3) = (unsigned char)(((byKeyIndex << 6) & 0xc0) | 0x20); // 0x20 is ExtIV // Append IV&ExtIV after Mac Header *pdwExtIV = cpu_to_le32(pTransmitKey->dwTSC47_16); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"vFillTxKey()---- pdwExtIV: %lx\n", *pdwExtIV); @@ -284,33 +273,33 @@ s_vFillTxKey ( // Make IV *pdwIV = 0; - *(pbyIVHead+3) = (BYTE)(((byKeyIndex << 6) & 0xc0) | 0x20); // 0x20 is ExtIV - *pdwIV |= cpu_to_le16((WORD)(pTransmitKey->wTSC15_0)); + *(pbyIVHead+3) = (unsigned char)(((byKeyIndex << 6) & 0xc0) | 0x20); // 0x20 is ExtIV + *pdwIV |= cpu_to_le16((unsigned short)(pTransmitKey->wTSC15_0)); //Append IV&ExtIV after Mac Header *pdwExtIV = cpu_to_le32(pTransmitKey->dwTSC47_16); //Fill MICHDR0 *pMICHDR = 0x59; - *((PBYTE)(pMICHDR+1)) = 0; // TxPriority + *((unsigned char *)(pMICHDR+1)) = 0; // TxPriority memcpy(pMICHDR+2, &(pMACHeader->abyAddr2[0]), 6); - *((PBYTE)(pMICHDR+8)) = HIBYTE(HIWORD(pTransmitKey->dwTSC47_16)); - *((PBYTE)(pMICHDR+9)) = LOBYTE(HIWORD(pTransmitKey->dwTSC47_16)); - *((PBYTE)(pMICHDR+10)) = HIBYTE(LOWORD(pTransmitKey->dwTSC47_16)); - *((PBYTE)(pMICHDR+11)) = LOBYTE(LOWORD(pTransmitKey->dwTSC47_16)); - *((PBYTE)(pMICHDR+12)) = HIBYTE(pTransmitKey->wTSC15_0); - *((PBYTE)(pMICHDR+13)) = LOBYTE(pTransmitKey->wTSC15_0); - *((PBYTE)(pMICHDR+14)) = HIBYTE(wPayloadLen); - *((PBYTE)(pMICHDR+15)) = LOBYTE(wPayloadLen); + *((unsigned char *)(pMICHDR+8)) = HIBYTE(HIWORD(pTransmitKey->dwTSC47_16)); + *((unsigned char *)(pMICHDR+9)) = LOBYTE(HIWORD(pTransmitKey->dwTSC47_16)); + *((unsigned char *)(pMICHDR+10)) = HIBYTE(LOWORD(pTransmitKey->dwTSC47_16)); + *((unsigned char *)(pMICHDR+11)) = LOBYTE(LOWORD(pTransmitKey->dwTSC47_16)); + *((unsigned char *)(pMICHDR+12)) = HIBYTE(pTransmitKey->wTSC15_0); + *((unsigned char *)(pMICHDR+13)) = LOBYTE(pTransmitKey->wTSC15_0); + *((unsigned char *)(pMICHDR+14)) = HIBYTE(wPayloadLen); + *((unsigned char *)(pMICHDR+15)) = LOBYTE(wPayloadLen); //Fill MICHDR1 - *((PBYTE)(pMICHDR+16)) = 0; // HLEN[15:8] + *((unsigned char *)(pMICHDR+16)) = 0; // HLEN[15:8] if (pDevice->bLongHeader) { - *((PBYTE)(pMICHDR+17)) = 28; // HLEN[7:0] + *((unsigned char *)(pMICHDR+17)) = 28; // HLEN[7:0] } else { - *((PBYTE)(pMICHDR+17)) = 22; // HLEN[7:0] + *((unsigned char *)(pMICHDR+17)) = 22; // HLEN[7:0] } wValue = cpu_to_le16(pMACHeader->wFrameCtl & 0xC78F); - memcpy(pMICHDR+18, (PBYTE)&wValue, 2); // MSKFRACTL + memcpy(pMICHDR+18, (unsigned char *)&wValue, 2); // MSKFRACTL memcpy(pMICHDR+20, &(pMACHeader->abyAddr1[0]), 6); memcpy(pMICHDR+26, &(pMACHeader->abyAddr2[0]), 6); @@ -319,7 +308,7 @@ s_vFillTxKey ( wValue = pMACHeader->wSeqCtl; wValue &= 0x000F; wValue = cpu_to_le16(wValue); - memcpy(pMICHDR+38, (PBYTE)&wValue, 2); // MSKSEQCTL + memcpy(pMICHDR+38, (unsigned char *)&wValue, 2); // MSKSEQCTL if (pDevice->bLongHeader) { memcpy(pMICHDR+40, &(pMACHeader->abyAddr4[0]), 6); } @@ -332,13 +321,13 @@ void s_vSWencryption ( PSDevice pDevice, PSKeyItem pTransmitKey, - PBYTE pbyPayloadHead, - WORD wPayloadSize + unsigned char *pbyPayloadHead, + unsigned short wPayloadSize ) { - UINT cbICVlen = 4; - DWORD dwICV = 0xFFFFFFFFL; - PDWORD pdwICV; + unsigned int cbICVlen = 4; + unsigned long dwICV = 0xFFFFFFFFL; + unsigned long *pdwICV; if (pTransmitKey == NULL) return; @@ -347,7 +336,7 @@ s_vSWencryption ( //======================================================================= // Append ICV after payload dwICV = CRCdwGetCrc32Ex(pbyPayloadHead, wPayloadSize, dwICV);//ICV(Payload) - pdwICV = (PDWORD)(pbyPayloadHead + wPayloadSize); + pdwICV = (unsigned long *)(pbyPayloadHead + wPayloadSize); // finally, we must invert dwCRC to get the correct answer *pdwICV = cpu_to_le32(~dwICV); // RC4 encryption @@ -358,7 +347,7 @@ s_vSWencryption ( //======================================================================= //Append ICV after payload dwICV = CRCdwGetCrc32Ex(pbyPayloadHead, wPayloadSize, dwICV);//ICV(Payload) - pdwICV = (PDWORD)(pbyPayloadHead + wPayloadSize); + pdwICV = (unsigned long *)(pbyPayloadHead + wPayloadSize); // finally, we must invert dwCRC to get the correct answer *pdwICV = cpu_to_le32(~dwICV); // RC4 encryption @@ -377,25 +366,25 @@ s_vSWencryption ( PK_TYPE_11GA 3 */ static -UINT +unsigned int s_uGetTxRsvTime ( PSDevice pDevice, - BYTE byPktType, - UINT cbFrameLength, - WORD wRate, - BOOL bNeedAck + unsigned char byPktType, + unsigned int cbFrameLength, + unsigned short wRate, + bool bNeedAck ) { - UINT uDataTime, uAckTime; + unsigned int uDataTime, uAckTime; uDataTime = BBuGetFrameTime(pDevice->byPreambleType, byPktType, cbFrameLength, wRate); #ifdef PLICE_DEBUG //printk("s_uGetTxRsvTime is %d\n",uDataTime); #endif if (byPktType == PK_TYPE_11B) {//llb,CCK mode - uAckTime = BBuGetFrameTime(pDevice->byPreambleType, byPktType, 14, (WORD)pDevice->byTopCCKBasicRate); + uAckTime = BBuGetFrameTime(pDevice->byPreambleType, byPktType, 14, (unsigned short)pDevice->byTopCCKBasicRate); } else {//11g 2.4G OFDM mode & 11a 5G OFDM mode - uAckTime = BBuGetFrameTime(pDevice->byPreambleType, byPktType, 14, (WORD)pDevice->byTopOFDMBasicRate); + uAckTime = BBuGetFrameTime(pDevice->byPreambleType, byPktType, 14, (unsigned short)pDevice->byTopOFDMBasicRate); } if (bNeedAck) { @@ -408,16 +397,16 @@ s_uGetTxRsvTime ( //byFreqType: 0=>5GHZ 1=>2.4GHZ static -UINT +unsigned int s_uGetRTSCTSRsvTime ( PSDevice pDevice, - BYTE byRTSRsvType, - BYTE byPktType, - UINT cbFrameLength, - WORD wCurrentRate + unsigned char byRTSRsvType, + unsigned char byPktType, + unsigned int cbFrameLength, + unsigned short wCurrentRate ) { - UINT uRrvTime , uRTSTime, uCTSTime, uAckTime, uDataTime; + unsigned int uRrvTime , uRTSTime, uCTSTime, uAckTime, uDataTime; uRrvTime = uRTSTime = uCTSTime = uAckTime = uDataTime = 0; @@ -450,22 +439,22 @@ s_uGetRTSCTSRsvTime ( //byFreqType 0: 5GHz, 1:2.4Ghz static -UINT +unsigned int s_uGetDataDuration ( PSDevice pDevice, - BYTE byDurType, - UINT cbFrameLength, - BYTE byPktType, - WORD wRate, - BOOL bNeedAck, - UINT uFragIdx, - UINT cbLastFragmentSize, - UINT uMACfragNum, - BYTE byFBOption + unsigned char byDurType, + unsigned int cbFrameLength, + unsigned char byPktType, + unsigned short wRate, + bool bNeedAck, + unsigned int uFragIdx, + unsigned int cbLastFragmentSize, + unsigned int uMACfragNum, + unsigned char byFBOption ) { - BOOL bLastFrag = 0; - UINT uAckTime =0, uNextPktTime = 0; + bool bLastFrag = 0; + unsigned int uAckTime =0, uNextPktTime = 0; @@ -614,25 +603,25 @@ s_uGetDataDuration ( break; } - ASSERT(FALSE); + ASSERT(false); return 0; } //byFreqType: 0=>5GHZ 1=>2.4GHZ static -UINT +unsigned int s_uGetRTSCTSDuration ( PSDevice pDevice, - BYTE byDurType, - UINT cbFrameLength, - BYTE byPktType, - WORD wRate, - BOOL bNeedAck, - BYTE byFBOption + unsigned char byDurType, + unsigned int cbFrameLength, + unsigned char byPktType, + unsigned short wRate, + bool bNeedAck, + unsigned char byFBOption ) { - UINT uCTSTime = 0, uDurTime = 0; + unsigned int uCTSTime = 0, uDurTime = 0; switch (byDurType) { @@ -719,22 +708,22 @@ s_uGetRTSCTSDuration ( static -UINT +unsigned int s_uFillDataHead ( PSDevice pDevice, - BYTE byPktType, + unsigned char byPktType, void * pTxDataHead, - UINT cbFrameLength, - UINT uDMAIdx, - BOOL bNeedAck, - UINT uFragIdx, - UINT cbLastFragmentSize, - UINT uMACfragNum, - BYTE byFBOption, - WORD wCurrentRate + unsigned int cbFrameLength, + unsigned int uDMAIdx, + bool bNeedAck, + unsigned int uFragIdx, + unsigned int cbLastFragmentSize, + unsigned int uMACfragNum, + unsigned char byFBOption, + unsigned short wCurrentRate ) { - WORD wLen = 0x0000; + unsigned short wLen = 0x0000; if (pTxDataHead == NULL) { return 0; @@ -745,19 +734,19 @@ s_uFillDataHead ( PSTxDataHead_g pBuf = (PSTxDataHead_g)pTxDataHead; //Get SignalField,ServiceField,Length BBvCaculateParameter(pDevice, cbFrameLength, wCurrentRate, byPktType, - (PWORD)&(wLen), (PBYTE)&(pBuf->byServiceField_a), (PBYTE)&(pBuf->bySignalField_a) + (unsigned short *)&(wLen), (unsigned char *)&(pBuf->byServiceField_a), (unsigned char *)&(pBuf->bySignalField_a) ); pBuf->wTransmitLength_a = cpu_to_le16(wLen); BBvCaculateParameter(pDevice, cbFrameLength, pDevice->byTopCCKBasicRate, PK_TYPE_11B, - (PWORD)&(wLen), (PBYTE)&(pBuf->byServiceField_b), (PBYTE)&(pBuf->bySignalField_b) + (unsigned short *)&(wLen), (unsigned char *)&(pBuf->byServiceField_b), (unsigned char *)&(pBuf->bySignalField_b) ); pBuf->wTransmitLength_b = cpu_to_le16(wLen); //Get Duration and TimeStamp - pBuf->wDuration_a = cpu_to_le16((WORD)s_uGetDataDuration(pDevice, DATADUR_A, cbFrameLength, + pBuf->wDuration_a = cpu_to_le16((unsigned short)s_uGetDataDuration(pDevice, DATADUR_A, cbFrameLength, byPktType, wCurrentRate, bNeedAck, uFragIdx, cbLastFragmentSize, uMACfragNum, byFBOption)); //1: 2.4GHz - pBuf->wDuration_b = cpu_to_le16((WORD)s_uGetDataDuration(pDevice, DATADUR_B, cbFrameLength, + pBuf->wDuration_b = cpu_to_le16((unsigned short)s_uGetDataDuration(pDevice, DATADUR_B, cbFrameLength, PK_TYPE_11B, pDevice->byTopCCKBasicRate, bNeedAck, uFragIdx, cbLastFragmentSize, uMACfragNum, byFBOption)); //1: 2.4 @@ -771,21 +760,21 @@ s_uFillDataHead ( PSTxDataHead_g_FB pBuf = (PSTxDataHead_g_FB)pTxDataHead; //Get SignalField,ServiceField,Length BBvCaculateParameter(pDevice, cbFrameLength, wCurrentRate, byPktType, - (PWORD)&(wLen), (PBYTE)&(pBuf->byServiceField_a), (PBYTE)&(pBuf->bySignalField_a) + (unsigned short *)&(wLen), (unsigned char *)&(pBuf->byServiceField_a), (unsigned char *)&(pBuf->bySignalField_a) ); pBuf->wTransmitLength_a = cpu_to_le16(wLen); BBvCaculateParameter(pDevice, cbFrameLength, pDevice->byTopCCKBasicRate, PK_TYPE_11B, - (PWORD)&(wLen), (PBYTE)&(pBuf->byServiceField_b), (PBYTE)&(pBuf->bySignalField_b) + (unsigned short *)&(wLen), (unsigned char *)&(pBuf->byServiceField_b), (unsigned char *)&(pBuf->bySignalField_b) ); pBuf->wTransmitLength_b = cpu_to_le16(wLen); //Get Duration and TimeStamp - pBuf->wDuration_a = cpu_to_le16((WORD)s_uGetDataDuration(pDevice, DATADUR_A, cbFrameLength, byPktType, + pBuf->wDuration_a = cpu_to_le16((unsigned short)s_uGetDataDuration(pDevice, DATADUR_A, cbFrameLength, byPktType, wCurrentRate, bNeedAck, uFragIdx, cbLastFragmentSize, uMACfragNum, byFBOption)); //1: 2.4GHz - pBuf->wDuration_b = cpu_to_le16((WORD)s_uGetDataDuration(pDevice, DATADUR_B, cbFrameLength, PK_TYPE_11B, + pBuf->wDuration_b = cpu_to_le16((unsigned short)s_uGetDataDuration(pDevice, DATADUR_B, cbFrameLength, PK_TYPE_11B, pDevice->byTopCCKBasicRate, bNeedAck, uFragIdx, cbLastFragmentSize, uMACfragNum, byFBOption)); //1: 2.4GHz - pBuf->wDuration_a_f0 = cpu_to_le16((WORD)s_uGetDataDuration(pDevice, DATADUR_A_F0, cbFrameLength, byPktType, + pBuf->wDuration_a_f0 = cpu_to_le16((unsigned short)s_uGetDataDuration(pDevice, DATADUR_A_F0, cbFrameLength, byPktType, wCurrentRate, bNeedAck, uFragIdx, cbLastFragmentSize, uMACfragNum, byFBOption)); //1: 2.4GHz - pBuf->wDuration_a_f1 = cpu_to_le16((WORD)s_uGetDataDuration(pDevice, DATADUR_A_F1, cbFrameLength, byPktType, + pBuf->wDuration_a_f1 = cpu_to_le16((unsigned short)s_uGetDataDuration(pDevice, DATADUR_A_F1, cbFrameLength, byPktType, wCurrentRate, bNeedAck, uFragIdx, cbLastFragmentSize, uMACfragNum, byFBOption)); //1: 2.4GHz pBuf->wTimeStampOff_a = cpu_to_le16(wTimeStampOff[pDevice->byPreambleType%2][wCurrentRate%MAX_RATE]); @@ -800,16 +789,16 @@ s_uFillDataHead ( PSTxDataHead_a_FB pBuf = (PSTxDataHead_a_FB)pTxDataHead; //Get SignalField,ServiceField,Length BBvCaculateParameter(pDevice, cbFrameLength, wCurrentRate, byPktType, - (PWORD)&(wLen), (PBYTE)&(pBuf->byServiceField), (PBYTE)&(pBuf->bySignalField) + (unsigned short *)&(wLen), (unsigned char *)&(pBuf->byServiceField), (unsigned char *)&(pBuf->bySignalField) ); pBuf->wTransmitLength = cpu_to_le16(wLen); //Get Duration and TimeStampOff - pBuf->wDuration = cpu_to_le16((WORD)s_uGetDataDuration(pDevice, DATADUR_A, cbFrameLength, byPktType, + pBuf->wDuration = cpu_to_le16((unsigned short)s_uGetDataDuration(pDevice, DATADUR_A, cbFrameLength, byPktType, wCurrentRate, bNeedAck, uFragIdx, cbLastFragmentSize, uMACfragNum, byFBOption)); //0: 5GHz - pBuf->wDuration_f0 = cpu_to_le16((WORD)s_uGetDataDuration(pDevice, DATADUR_A_F0, cbFrameLength, byPktType, + pBuf->wDuration_f0 = cpu_to_le16((unsigned short)s_uGetDataDuration(pDevice, DATADUR_A_F0, cbFrameLength, byPktType, wCurrentRate, bNeedAck, uFragIdx, cbLastFragmentSize, uMACfragNum, byFBOption)); //0: 5GHz - pBuf->wDuration_f1 = cpu_to_le16((WORD)s_uGetDataDuration(pDevice, DATADUR_A_F1, cbFrameLength, byPktType, + pBuf->wDuration_f1 = cpu_to_le16((unsigned short)s_uGetDataDuration(pDevice, DATADUR_A_F1, cbFrameLength, byPktType, wCurrentRate, bNeedAck, uFragIdx, cbLastFragmentSize, uMACfragNum, byFBOption)); //0: 5GHz pBuf->wTimeStampOff = cpu_to_le16(wTimeStampOff[pDevice->byPreambleType%2][wCurrentRate%MAX_RATE]); return (pBuf->wDuration); @@ -817,12 +806,12 @@ s_uFillDataHead ( PSTxDataHead_ab pBuf = (PSTxDataHead_ab)pTxDataHead; //Get SignalField,ServiceField,Length BBvCaculateParameter(pDevice, cbFrameLength, wCurrentRate, byPktType, - (PWORD)&(wLen), (PBYTE)&(pBuf->byServiceField), (PBYTE)&(pBuf->bySignalField) + (unsigned short *)&(wLen), (unsigned char *)&(pBuf->byServiceField), (unsigned char *)&(pBuf->bySignalField) ); pBuf->wTransmitLength = cpu_to_le16(wLen); //Get Duration and TimeStampOff - pBuf->wDuration = cpu_to_le16((WORD)s_uGetDataDuration(pDevice, DATADUR_A, cbFrameLength, byPktType, + pBuf->wDuration = cpu_to_le16((unsigned short)s_uGetDataDuration(pDevice, DATADUR_A, cbFrameLength, byPktType, wCurrentRate, bNeedAck, uFragIdx, cbLastFragmentSize, uMACfragNum, byFBOption)); @@ -835,11 +824,11 @@ s_uFillDataHead ( PSTxDataHead_ab pBuf = (PSTxDataHead_ab)pTxDataHead; //Get SignalField,ServiceField,Length BBvCaculateParameter(pDevice, cbFrameLength, wCurrentRate, byPktType, - (PWORD)&(wLen), (PBYTE)&(pBuf->byServiceField), (PBYTE)&(pBuf->bySignalField) + (unsigned short *)&(wLen), (unsigned char *)&(pBuf->byServiceField), (unsigned char *)&(pBuf->bySignalField) ); pBuf->wTransmitLength = cpu_to_le16(wLen); //Get Duration and TimeStampOff - pBuf->wDuration = cpu_to_le16((WORD)s_uGetDataDuration(pDevice, DATADUR_B, cbFrameLength, byPktType, + pBuf->wDuration = cpu_to_le16((unsigned short)s_uGetDataDuration(pDevice, DATADUR_B, cbFrameLength, byPktType, wCurrentRate, bNeedAck, uFragIdx, cbLastFragmentSize, uMACfragNum, byFBOption)); @@ -854,18 +843,18 @@ static void s_vFillRTSHead ( PSDevice pDevice, - BYTE byPktType, + unsigned char byPktType, void * pvRTS, - UINT cbFrameLength, - BOOL bNeedAck, - BOOL bDisCRC, + unsigned int cbFrameLength, + bool bNeedAck, + bool bDisCRC, PSEthernetHeader psEthHeader, - WORD wCurrentRate, - BYTE byFBOption + unsigned short wCurrentRate, + unsigned char byFBOption ) { - UINT uRTSFrameLen = 20; - WORD wLen = 0x0000; + unsigned int uRTSFrameLen = 20; + unsigned short wLen = 0x0000; if (pvRTS == NULL) return; @@ -883,17 +872,17 @@ s_vFillRTSHead ( PSRTS_g pBuf = (PSRTS_g)pvRTS; //Get SignalField,ServiceField,Length BBvCaculateParameter(pDevice, uRTSFrameLen, pDevice->byTopCCKBasicRate, PK_TYPE_11B, - (PWORD)&(wLen), (PBYTE)&(pBuf->byServiceField_b), (PBYTE)&(pBuf->bySignalField_b) + (unsigned short *)&(wLen), (unsigned char *)&(pBuf->byServiceField_b), (unsigned char *)&(pBuf->bySignalField_b) ); pBuf->wTransmitLength_b = cpu_to_le16(wLen); BBvCaculateParameter(pDevice, uRTSFrameLen, pDevice->byTopOFDMBasicRate, byPktType, - (PWORD)&(wLen), (PBYTE)&(pBuf->byServiceField_a), (PBYTE)&(pBuf->bySignalField_a) + (unsigned short *)&(wLen), (unsigned char *)&(pBuf->byServiceField_a), (unsigned char *)&(pBuf->bySignalField_a) ); pBuf->wTransmitLength_a = cpu_to_le16(wLen); //Get Duration - pBuf->wDuration_bb = cpu_to_le16((WORD)s_uGetRTSCTSDuration(pDevice, RTSDUR_BB, cbFrameLength, PK_TYPE_11B, pDevice->byTopCCKBasicRate, bNeedAck, byFBOption)); //0:RTSDuration_bb, 1:2.4G, 1:CCKData - pBuf->wDuration_aa = cpu_to_le16((WORD)s_uGetRTSCTSDuration(pDevice, RTSDUR_AA, cbFrameLength, byPktType, wCurrentRate, bNeedAck, byFBOption)); //2:RTSDuration_aa, 1:2.4G, 2,3: 2.4G OFDMData - pBuf->wDuration_ba = cpu_to_le16((WORD)s_uGetRTSCTSDuration(pDevice, RTSDUR_BA, cbFrameLength, byPktType, wCurrentRate, bNeedAck, byFBOption)); //1:RTSDuration_ba, 1:2.4G, 2,3:2.4G OFDM Data + pBuf->wDuration_bb = cpu_to_le16((unsigned short)s_uGetRTSCTSDuration(pDevice, RTSDUR_BB, cbFrameLength, PK_TYPE_11B, pDevice->byTopCCKBasicRate, bNeedAck, byFBOption)); //0:RTSDuration_bb, 1:2.4G, 1:CCKData + pBuf->wDuration_aa = cpu_to_le16((unsigned short)s_uGetRTSCTSDuration(pDevice, RTSDUR_AA, cbFrameLength, byPktType, wCurrentRate, bNeedAck, byFBOption)); //2:RTSDuration_aa, 1:2.4G, 2,3: 2.4G OFDMData + pBuf->wDuration_ba = cpu_to_le16((unsigned short)s_uGetRTSCTSDuration(pDevice, RTSDUR_BA, cbFrameLength, byPktType, wCurrentRate, bNeedAck, byFBOption)); //1:RTSDuration_ba, 1:2.4G, 2,3:2.4G OFDM Data pBuf->Data.wDurationID = pBuf->wDuration_aa; //Get RTS Frame body @@ -916,22 +905,22 @@ s_vFillRTSHead ( PSRTS_g_FB pBuf = (PSRTS_g_FB)pvRTS; //Get SignalField,ServiceField,Length BBvCaculateParameter(pDevice, uRTSFrameLen, pDevice->byTopCCKBasicRate, PK_TYPE_11B, - (PWORD)&(wLen), (PBYTE)&(pBuf->byServiceField_b), (PBYTE)&(pBuf->bySignalField_b) + (unsigned short *)&(wLen), (unsigned char *)&(pBuf->byServiceField_b), (unsigned char *)&(pBuf->bySignalField_b) ); pBuf->wTransmitLength_b = cpu_to_le16(wLen); BBvCaculateParameter(pDevice, uRTSFrameLen, pDevice->byTopOFDMBasicRate, byPktType, - (PWORD)&(wLen), (PBYTE)&(pBuf->byServiceField_a), (PBYTE)&(pBuf->bySignalField_a) + (unsigned short *)&(wLen), (unsigned char *)&(pBuf->byServiceField_a), (unsigned char *)&(pBuf->bySignalField_a) ); pBuf->wTransmitLength_a = cpu_to_le16(wLen); //Get Duration - pBuf->wDuration_bb = cpu_to_le16((WORD)s_uGetRTSCTSDuration(pDevice, RTSDUR_BB, cbFrameLength, PK_TYPE_11B, pDevice->byTopCCKBasicRate, bNeedAck, byFBOption)); //0:RTSDuration_bb, 1:2.4G, 1:CCKData - pBuf->wDuration_aa = cpu_to_le16((WORD)s_uGetRTSCTSDuration(pDevice, RTSDUR_AA, cbFrameLength, byPktType, wCurrentRate, bNeedAck, byFBOption)); //2:RTSDuration_aa, 1:2.4G, 2,3:2.4G OFDMData - pBuf->wDuration_ba = cpu_to_le16((WORD)s_uGetRTSCTSDuration(pDevice, RTSDUR_BA, cbFrameLength, byPktType, wCurrentRate, bNeedAck, byFBOption)); //1:RTSDuration_ba, 1:2.4G, 2,3:2.4G OFDMData - pBuf->wRTSDuration_ba_f0 = cpu_to_le16((WORD)s_uGetRTSCTSDuration(pDevice, RTSDUR_BA_F0, cbFrameLength, byPktType, wCurrentRate, bNeedAck, byFBOption)); //4:wRTSDuration_ba_f0, 1:2.4G, 1:CCKData - pBuf->wRTSDuration_aa_f0 = cpu_to_le16((WORD)s_uGetRTSCTSDuration(pDevice, RTSDUR_AA_F0, cbFrameLength, byPktType, wCurrentRate, bNeedAck, byFBOption)); //5:wRTSDuration_aa_f0, 1:2.4G, 1:CCKData - pBuf->wRTSDuration_ba_f1 = cpu_to_le16((WORD)s_uGetRTSCTSDuration(pDevice, RTSDUR_BA_F1, cbFrameLength, byPktType, wCurrentRate, bNeedAck, byFBOption)); //6:wRTSDuration_ba_f1, 1:2.4G, 1:CCKData - pBuf->wRTSDuration_aa_f1 = cpu_to_le16((WORD)s_uGetRTSCTSDuration(pDevice, RTSDUR_AA_F1, cbFrameLength, byPktType, wCurrentRate, bNeedAck, byFBOption)); //7:wRTSDuration_aa_f1, 1:2.4G, 1:CCKData + pBuf->wDuration_bb = cpu_to_le16((unsigned short)s_uGetRTSCTSDuration(pDevice, RTSDUR_BB, cbFrameLength, PK_TYPE_11B, pDevice->byTopCCKBasicRate, bNeedAck, byFBOption)); //0:RTSDuration_bb, 1:2.4G, 1:CCKData + pBuf->wDuration_aa = cpu_to_le16((unsigned short)s_uGetRTSCTSDuration(pDevice, RTSDUR_AA, cbFrameLength, byPktType, wCurrentRate, bNeedAck, byFBOption)); //2:RTSDuration_aa, 1:2.4G, 2,3:2.4G OFDMData + pBuf->wDuration_ba = cpu_to_le16((unsigned short)s_uGetRTSCTSDuration(pDevice, RTSDUR_BA, cbFrameLength, byPktType, wCurrentRate, bNeedAck, byFBOption)); //1:RTSDuration_ba, 1:2.4G, 2,3:2.4G OFDMData + pBuf->wRTSDuration_ba_f0 = cpu_to_le16((unsigned short)s_uGetRTSCTSDuration(pDevice, RTSDUR_BA_F0, cbFrameLength, byPktType, wCurrentRate, bNeedAck, byFBOption)); //4:wRTSDuration_ba_f0, 1:2.4G, 1:CCKData + pBuf->wRTSDuration_aa_f0 = cpu_to_le16((unsigned short)s_uGetRTSCTSDuration(pDevice, RTSDUR_AA_F0, cbFrameLength, byPktType, wCurrentRate, bNeedAck, byFBOption)); //5:wRTSDuration_aa_f0, 1:2.4G, 1:CCKData + pBuf->wRTSDuration_ba_f1 = cpu_to_le16((unsigned short)s_uGetRTSCTSDuration(pDevice, RTSDUR_BA_F1, cbFrameLength, byPktType, wCurrentRate, bNeedAck, byFBOption)); //6:wRTSDuration_ba_f1, 1:2.4G, 1:CCKData + pBuf->wRTSDuration_aa_f1 = cpu_to_le16((unsigned short)s_uGetRTSCTSDuration(pDevice, RTSDUR_AA_F1, cbFrameLength, byPktType, wCurrentRate, bNeedAck, byFBOption)); //7:wRTSDuration_aa_f1, 1:2.4G, 1:CCKData pBuf->Data.wDurationID = pBuf->wDuration_aa; //Get RTS Frame body pBuf->Data.wFrameControl = TYPE_CTL_RTS;//0x00B4 @@ -958,11 +947,11 @@ s_vFillRTSHead ( PSRTS_ab pBuf = (PSRTS_ab)pvRTS; //Get SignalField,ServiceField,Length BBvCaculateParameter(pDevice, uRTSFrameLen, pDevice->byTopOFDMBasicRate, byPktType, - (PWORD)&(wLen), (PBYTE)&(pBuf->byServiceField), (PBYTE)&(pBuf->bySignalField) + (unsigned short *)&(wLen), (unsigned char *)&(pBuf->byServiceField), (unsigned char *)&(pBuf->bySignalField) ); pBuf->wTransmitLength = cpu_to_le16(wLen); //Get Duration - pBuf->wDuration = cpu_to_le16((WORD)s_uGetRTSCTSDuration(pDevice, RTSDUR_AA, cbFrameLength, byPktType, wCurrentRate, bNeedAck, byFBOption)); //0:RTSDuration_aa, 0:5G, 0: 5G OFDMData + pBuf->wDuration = cpu_to_le16((unsigned short)s_uGetRTSCTSDuration(pDevice, RTSDUR_AA, cbFrameLength, byPktType, wCurrentRate, bNeedAck, byFBOption)); //0:RTSDuration_aa, 0:5G, 0: 5G OFDMData pBuf->Data.wDurationID = pBuf->wDuration; //Get RTS Frame body pBuf->Data.wFrameControl = TYPE_CTL_RTS;//0x00B4 @@ -987,13 +976,13 @@ s_vFillRTSHead ( PSRTS_a_FB pBuf = (PSRTS_a_FB)pvRTS; //Get SignalField,ServiceField,Length BBvCaculateParameter(pDevice, uRTSFrameLen, pDevice->byTopOFDMBasicRate, byPktType, - (PWORD)&(wLen), (PBYTE)&(pBuf->byServiceField), (PBYTE)&(pBuf->bySignalField) + (unsigned short *)&(wLen), (unsigned char *)&(pBuf->byServiceField), (unsigned char *)&(pBuf->bySignalField) ); pBuf->wTransmitLength = cpu_to_le16(wLen); //Get Duration - pBuf->wDuration = cpu_to_le16((WORD)s_uGetRTSCTSDuration(pDevice, RTSDUR_AA, cbFrameLength, byPktType, wCurrentRate, bNeedAck, byFBOption)); //0:RTSDuration_aa, 0:5G, 0: 5G OFDMData - pBuf->wRTSDuration_f0 = cpu_to_le16((WORD)s_uGetRTSCTSDuration(pDevice, RTSDUR_AA_F0, cbFrameLength, byPktType, wCurrentRate, bNeedAck, byFBOption)); //5:RTSDuration_aa_f0, 0:5G, 0: 5G OFDMData - pBuf->wRTSDuration_f1 = cpu_to_le16((WORD)s_uGetRTSCTSDuration(pDevice, RTSDUR_AA_F1, cbFrameLength, byPktType, wCurrentRate, bNeedAck, byFBOption)); //7:RTSDuration_aa_f1, 0:5G, 0: + pBuf->wDuration = cpu_to_le16((unsigned short)s_uGetRTSCTSDuration(pDevice, RTSDUR_AA, cbFrameLength, byPktType, wCurrentRate, bNeedAck, byFBOption)); //0:RTSDuration_aa, 0:5G, 0: 5G OFDMData + pBuf->wRTSDuration_f0 = cpu_to_le16((unsigned short)s_uGetRTSCTSDuration(pDevice, RTSDUR_AA_F0, cbFrameLength, byPktType, wCurrentRate, bNeedAck, byFBOption)); //5:RTSDuration_aa_f0, 0:5G, 0: 5G OFDMData + pBuf->wRTSDuration_f1 = cpu_to_le16((unsigned short)s_uGetRTSCTSDuration(pDevice, RTSDUR_AA_F1, cbFrameLength, byPktType, wCurrentRate, bNeedAck, byFBOption)); //7:RTSDuration_aa_f1, 0:5G, 0: pBuf->Data.wDurationID = pBuf->wDuration; //Get RTS Frame body pBuf->Data.wFrameControl = TYPE_CTL_RTS;//0x00B4 @@ -1017,11 +1006,11 @@ s_vFillRTSHead ( PSRTS_ab pBuf = (PSRTS_ab)pvRTS; //Get SignalField,ServiceField,Length BBvCaculateParameter(pDevice, uRTSFrameLen, pDevice->byTopCCKBasicRate, PK_TYPE_11B, - (PWORD)&(wLen), (PBYTE)&(pBuf->byServiceField), (PBYTE)&(pBuf->bySignalField) + (unsigned short *)&(wLen), (unsigned char *)&(pBuf->byServiceField), (unsigned char *)&(pBuf->bySignalField) ); pBuf->wTransmitLength = cpu_to_le16(wLen); //Get Duration - pBuf->wDuration = cpu_to_le16((WORD)s_uGetRTSCTSDuration(pDevice, RTSDUR_BB, cbFrameLength, byPktType, wCurrentRate, bNeedAck, byFBOption)); //0:RTSDuration_bb, 1:2.4G, 1:CCKData + pBuf->wDuration = cpu_to_le16((unsigned short)s_uGetRTSCTSDuration(pDevice, RTSDUR_BB, cbFrameLength, byPktType, wCurrentRate, bNeedAck, byFBOption)); //0:RTSDuration_bb, 1:2.4G, 1:CCKData pBuf->Data.wDurationID = pBuf->wDuration; //Get RTS Frame body pBuf->Data.wFrameControl = TYPE_CTL_RTS;//0x00B4 @@ -1048,18 +1037,18 @@ static void s_vFillCTSHead ( PSDevice pDevice, - UINT uDMAIdx, - BYTE byPktType, + unsigned int uDMAIdx, + unsigned char byPktType, void * pvCTS, - UINT cbFrameLength, - BOOL bNeedAck, - BOOL bDisCRC, - WORD wCurrentRate, - BYTE byFBOption + unsigned int cbFrameLength, + bool bNeedAck, + bool bDisCRC, + unsigned short wCurrentRate, + unsigned char byFBOption ) { - UINT uCTSFrameLen = 14; - WORD wLen = 0x0000; + unsigned int uCTSFrameLen = 14; + unsigned short wLen = 0x0000; if (pvCTS == NULL) { return; @@ -1077,21 +1066,21 @@ s_vFillCTSHead ( PSCTS_FB pBuf = (PSCTS_FB)pvCTS; //Get SignalField,ServiceField,Length BBvCaculateParameter(pDevice, uCTSFrameLen, pDevice->byTopCCKBasicRate, PK_TYPE_11B, - (PWORD)&(wLen), (PBYTE)&(pBuf->byServiceField_b), (PBYTE)&(pBuf->bySignalField_b) + (unsigned short *)&(wLen), (unsigned char *)&(pBuf->byServiceField_b), (unsigned char *)&(pBuf->bySignalField_b) ); pBuf->wTransmitLength_b = cpu_to_le16(wLen); - pBuf->wDuration_ba = (WORD)s_uGetRTSCTSDuration(pDevice, CTSDUR_BA, cbFrameLength, byPktType, wCurrentRate, bNeedAck, byFBOption); //3:CTSDuration_ba, 1:2.4G, 2,3:2.4G OFDM Data + pBuf->wDuration_ba = (unsigned short)s_uGetRTSCTSDuration(pDevice, CTSDUR_BA, cbFrameLength, byPktType, wCurrentRate, bNeedAck, byFBOption); //3:CTSDuration_ba, 1:2.4G, 2,3:2.4G OFDM Data pBuf->wDuration_ba += pDevice->wCTSDuration; pBuf->wDuration_ba = cpu_to_le16(pBuf->wDuration_ba); //Get CTSDuration_ba_f0 - pBuf->wCTSDuration_ba_f0 = (WORD)s_uGetRTSCTSDuration(pDevice, CTSDUR_BA_F0, cbFrameLength, byPktType, wCurrentRate, bNeedAck, byFBOption); //8:CTSDuration_ba_f0, 1:2.4G, 2,3:2.4G OFDM Data + pBuf->wCTSDuration_ba_f0 = (unsigned short)s_uGetRTSCTSDuration(pDevice, CTSDUR_BA_F0, cbFrameLength, byPktType, wCurrentRate, bNeedAck, byFBOption); //8:CTSDuration_ba_f0, 1:2.4G, 2,3:2.4G OFDM Data pBuf->wCTSDuration_ba_f0 += pDevice->wCTSDuration; pBuf->wCTSDuration_ba_f0 = cpu_to_le16(pBuf->wCTSDuration_ba_f0); //Get CTSDuration_ba_f1 - pBuf->wCTSDuration_ba_f1 = (WORD)s_uGetRTSCTSDuration(pDevice, CTSDUR_BA_F1, cbFrameLength, byPktType, wCurrentRate, bNeedAck, byFBOption); //9:CTSDuration_ba_f1, 1:2.4G, 2,3:2.4G OFDM Data + pBuf->wCTSDuration_ba_f1 = (unsigned short)s_uGetRTSCTSDuration(pDevice, CTSDUR_BA_F1, cbFrameLength, byPktType, wCurrentRate, bNeedAck, byFBOption); //9:CTSDuration_ba_f1, 1:2.4G, 2,3:2.4G OFDM Data pBuf->wCTSDuration_ba_f1 += pDevice->wCTSDuration; pBuf->wCTSDuration_ba_f1 = cpu_to_le16(pBuf->wCTSDuration_ba_f1); //Get CTS Frame body @@ -1104,11 +1093,11 @@ s_vFillCTSHead ( PSCTS pBuf = (PSCTS)pvCTS; //Get SignalField,ServiceField,Length BBvCaculateParameter(pDevice, uCTSFrameLen, pDevice->byTopCCKBasicRate, PK_TYPE_11B, - (PWORD)&(wLen), (PBYTE)&(pBuf->byServiceField_b), (PBYTE)&(pBuf->bySignalField_b) + (unsigned short *)&(wLen), (unsigned char *)&(pBuf->byServiceField_b), (unsigned char *)&(pBuf->bySignalField_b) ); pBuf->wTransmitLength_b = cpu_to_le16(wLen); //Get CTSDuration_ba - pBuf->wDuration_ba = cpu_to_le16((WORD)s_uGetRTSCTSDuration(pDevice, CTSDUR_BA, cbFrameLength, byPktType, wCurrentRate, bNeedAck, byFBOption)); //3:CTSDuration_ba, 1:2.4G, 2,3:2.4G OFDM Data + pBuf->wDuration_ba = cpu_to_le16((unsigned short)s_uGetRTSCTSDuration(pDevice, CTSDUR_BA, cbFrameLength, byPktType, wCurrentRate, bNeedAck, byFBOption)); //3:CTSDuration_ba, 1:2.4G, 2,3:2.4G OFDM Data pBuf->wDuration_ba += pDevice->wCTSDuration; pBuf->wDuration_ba = cpu_to_le16(pBuf->wDuration_ba); @@ -1148,28 +1137,28 @@ s_vFillCTSHead ( * Return Value: none * -*/ -// UINT cbFrameSize,//Hdr+Payload+FCS +// unsigned int cbFrameSize,//Hdr+Payload+FCS static void s_vGenerateTxParameter ( PSDevice pDevice, - BYTE byPktType, + unsigned char byPktType, void * pTxBufHead, void * pvRrvTime, void * pvRTS, void * pvCTS, - UINT cbFrameSize, - BOOL bNeedACK, - UINT uDMAIdx, + unsigned int cbFrameSize, + bool bNeedACK, + unsigned int uDMAIdx, PSEthernetHeader psEthHeader, - WORD wCurrentRate + unsigned short wCurrentRate ) { - UINT cbMACHdLen = WLAN_HDR_ADDR3_LEN; //24 - WORD wFifoCtl; - BOOL bDisCRC = FALSE; - BYTE byFBOption = AUTO_FB_NONE; -// WORD wCurrentRate = pDevice->wCurrentRate; + unsigned int cbMACHdLen = WLAN_HDR_ADDR3_LEN; //24 + unsigned short wFifoCtl; + bool bDisCRC = false; + unsigned char byFBOption = AUTO_FB_NONE; +// unsigned short wCurrentRate = pDevice->wCurrentRate; //DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"s_vGenerateTxParameter...\n"); PSTxBufHead pFifoHead = (PSTxBufHead)pTxBufHead; @@ -1177,7 +1166,7 @@ s_vGenerateTxParameter ( wFifoCtl = pFifoHead->wFIFOCtl; if (wFifoCtl & FIFOCTL_CRCDIS) { - bDisCRC = TRUE; + bDisCRC = true; } if (wFifoCtl & FIFOCTL_AUTO_FB_0) { @@ -1196,11 +1185,11 @@ s_vGenerateTxParameter ( //Fill RsvTime if (pvRrvTime) { PSRrvTime_gRTS pBuf = (PSRrvTime_gRTS)pvRrvTime; - pBuf->wRTSTxRrvTime_aa = cpu_to_le16((WORD)s_uGetRTSCTSRsvTime(pDevice, 2, byPktType, cbFrameSize, wCurrentRate));//2:RTSTxRrvTime_aa, 1:2.4GHz - pBuf->wRTSTxRrvTime_ba = cpu_to_le16((WORD)s_uGetRTSCTSRsvTime(pDevice, 1, byPktType, cbFrameSize, wCurrentRate));//1:RTSTxRrvTime_ba, 1:2.4GHz - pBuf->wRTSTxRrvTime_bb = cpu_to_le16((WORD)s_uGetRTSCTSRsvTime(pDevice, 0, byPktType, cbFrameSize, wCurrentRate));//0:RTSTxRrvTime_bb, 1:2.4GHz - pBuf->wTxRrvTime_a = cpu_to_le16((WORD) s_uGetTxRsvTime(pDevice, byPktType, cbFrameSize, wCurrentRate, bNeedACK));//2.4G OFDM - pBuf->wTxRrvTime_b = cpu_to_le16((WORD) s_uGetTxRsvTime(pDevice, PK_TYPE_11B, cbFrameSize, pDevice->byTopCCKBasicRate, bNeedACK));//1:CCK + pBuf->wRTSTxRrvTime_aa = cpu_to_le16((unsigned short)s_uGetRTSCTSRsvTime(pDevice, 2, byPktType, cbFrameSize, wCurrentRate));//2:RTSTxRrvTime_aa, 1:2.4GHz + pBuf->wRTSTxRrvTime_ba = cpu_to_le16((unsigned short)s_uGetRTSCTSRsvTime(pDevice, 1, byPktType, cbFrameSize, wCurrentRate));//1:RTSTxRrvTime_ba, 1:2.4GHz + pBuf->wRTSTxRrvTime_bb = cpu_to_le16((unsigned short)s_uGetRTSCTSRsvTime(pDevice, 0, byPktType, cbFrameSize, wCurrentRate));//0:RTSTxRrvTime_bb, 1:2.4GHz + pBuf->wTxRrvTime_a = cpu_to_le16((unsigned short) s_uGetTxRsvTime(pDevice, byPktType, cbFrameSize, wCurrentRate, bNeedACK));//2.4G OFDM + pBuf->wTxRrvTime_b = cpu_to_le16((unsigned short) s_uGetTxRsvTime(pDevice, PK_TYPE_11B, cbFrameSize, pDevice->byTopCCKBasicRate, bNeedACK));//1:CCK } //Fill RTS s_vFillRTSHead(pDevice, byPktType, pvRTS, cbFrameSize, bNeedACK, bDisCRC, psEthHeader, wCurrentRate, byFBOption); @@ -1210,9 +1199,9 @@ s_vGenerateTxParameter ( //Fill RsvTime if (pvRrvTime) { PSRrvTime_gCTS pBuf = (PSRrvTime_gCTS)pvRrvTime; - pBuf->wTxRrvTime_a = cpu_to_le16((WORD)s_uGetTxRsvTime(pDevice, byPktType, cbFrameSize, wCurrentRate, bNeedACK));//2.4G OFDM - pBuf->wTxRrvTime_b = cpu_to_le16((WORD)s_uGetTxRsvTime(pDevice, PK_TYPE_11B, cbFrameSize, pDevice->byTopCCKBasicRate, bNeedACK));//1:CCK - pBuf->wCTSTxRrvTime_ba = cpu_to_le16((WORD)s_uGetRTSCTSRsvTime(pDevice, 3, byPktType, cbFrameSize, wCurrentRate));//3:CTSTxRrvTime_Ba, 1:2.4GHz + pBuf->wTxRrvTime_a = cpu_to_le16((unsigned short)s_uGetTxRsvTime(pDevice, byPktType, cbFrameSize, wCurrentRate, bNeedACK));//2.4G OFDM + pBuf->wTxRrvTime_b = cpu_to_le16((unsigned short)s_uGetTxRsvTime(pDevice, PK_TYPE_11B, cbFrameSize, pDevice->byTopCCKBasicRate, bNeedACK));//1:CCK + pBuf->wCTSTxRrvTime_ba = cpu_to_le16((unsigned short)s_uGetRTSCTSRsvTime(pDevice, 3, byPktType, cbFrameSize, wCurrentRate));//3:CTSTxRrvTime_Ba, 1:2.4GHz } @@ -1226,8 +1215,8 @@ s_vGenerateTxParameter ( //Fill RsvTime if (pvRrvTime) { PSRrvTime_ab pBuf = (PSRrvTime_ab)pvRrvTime; - pBuf->wRTSTxRrvTime = cpu_to_le16((WORD)s_uGetRTSCTSRsvTime(pDevice, 2, byPktType, cbFrameSize, wCurrentRate));//2:RTSTxRrvTime_aa, 0:5GHz - pBuf->wTxRrvTime = cpu_to_le16((WORD)s_uGetTxRsvTime(pDevice, byPktType, cbFrameSize, wCurrentRate, bNeedACK));//0:OFDM + pBuf->wRTSTxRrvTime = cpu_to_le16((unsigned short)s_uGetRTSCTSRsvTime(pDevice, 2, byPktType, cbFrameSize, wCurrentRate));//2:RTSTxRrvTime_aa, 0:5GHz + pBuf->wTxRrvTime = cpu_to_le16((unsigned short)s_uGetTxRsvTime(pDevice, byPktType, cbFrameSize, wCurrentRate, bNeedACK));//0:OFDM } //Fill RTS s_vFillRTSHead(pDevice, byPktType, pvRTS, cbFrameSize, bNeedACK, bDisCRC, psEthHeader, wCurrentRate, byFBOption); @@ -1236,7 +1225,7 @@ s_vGenerateTxParameter ( //Fill RsvTime if (pvRrvTime) { PSRrvTime_ab pBuf = (PSRrvTime_ab)pvRrvTime; - pBuf->wTxRrvTime = cpu_to_le16((WORD)s_uGetTxRsvTime(pDevice, PK_TYPE_11A, cbFrameSize, wCurrentRate, bNeedACK)); //0:OFDM + pBuf->wTxRrvTime = cpu_to_le16((unsigned short)s_uGetTxRsvTime(pDevice, PK_TYPE_11A, cbFrameSize, wCurrentRate, bNeedACK)); //0:OFDM } } } @@ -1246,8 +1235,8 @@ s_vGenerateTxParameter ( //Fill RsvTime if (pvRrvTime) { PSRrvTime_ab pBuf = (PSRrvTime_ab)pvRrvTime; - pBuf->wRTSTxRrvTime = cpu_to_le16((WORD)s_uGetRTSCTSRsvTime(pDevice, 0, byPktType, cbFrameSize, wCurrentRate));//0:RTSTxRrvTime_bb, 1:2.4GHz - pBuf->wTxRrvTime = cpu_to_le16((WORD)s_uGetTxRsvTime(pDevice, PK_TYPE_11B, cbFrameSize, wCurrentRate, bNeedACK));//1:CCK + pBuf->wRTSTxRrvTime = cpu_to_le16((unsigned short)s_uGetRTSCTSRsvTime(pDevice, 0, byPktType, cbFrameSize, wCurrentRate));//0:RTSTxRrvTime_bb, 1:2.4GHz + pBuf->wTxRrvTime = cpu_to_le16((unsigned short)s_uGetTxRsvTime(pDevice, PK_TYPE_11B, cbFrameSize, wCurrentRate, bNeedACK));//1:CCK } //Fill RTS s_vFillRTSHead(pDevice, byPktType, pvRTS, cbFrameSize, bNeedACK, bDisCRC, psEthHeader, wCurrentRate, byFBOption); @@ -1256,26 +1245,26 @@ s_vGenerateTxParameter ( //Fill RsvTime if (pvRrvTime) { PSRrvTime_ab pBuf = (PSRrvTime_ab)pvRrvTime; - pBuf->wTxRrvTime = cpu_to_le16((WORD)s_uGetTxRsvTime(pDevice, PK_TYPE_11B, cbFrameSize, wCurrentRate, bNeedACK)); //1:CCK + pBuf->wTxRrvTime = cpu_to_le16((unsigned short)s_uGetTxRsvTime(pDevice, PK_TYPE_11B, cbFrameSize, wCurrentRate, bNeedACK)); //1:CCK } } } //DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"s_vGenerateTxParameter END.\n"); } /* - PBYTE pbyBuffer,//point to pTxBufHead - WORD wFragType,//00:Non-Frag, 01:Start, 02:Mid, 03:Last - UINT cbFragmentSize,//Hdr+payoad+FCS + unsigned char *pbyBuffer,//point to pTxBufHead + unsigned short wFragType,//00:Non-Frag, 01:Start, 02:Mid, 03:Last + unsigned int cbFragmentSize,//Hdr+payoad+FCS */ static void s_vFillFragParameter( PSDevice pDevice, - PBYTE pbyBuffer, - UINT uTxType, + unsigned char *pbyBuffer, + unsigned int uTxType, void * pvtdCurr, - WORD wFragType, - UINT cbReqCount + unsigned short wFragType, + unsigned int cbReqCount ) { PSTxBufHead pTxBufHead = (PSTxBufHead) pbyBuffer; @@ -1289,7 +1278,7 @@ s_vFillFragParameter( ptdCurr->m_wFIFOCtl = pTxBufHead->wFIFOCtl; ptdCurr->m_wTimeStamp = pTxBufHead->wTimeStamp; //Set TSR1 & ReqCount in TxDescHead - ptdCurr->m_td1TD1.wReqCount = cpu_to_le16((WORD)(cbReqCount)); + ptdCurr->m_td1TD1.wReqCount = cpu_to_le16((unsigned short)(cbReqCount)); if (wFragType == FRAGCTL_ENDFRAG) { //Last Fragmentation ptdCurr->m_td1TD1.byTCR |= (TCR_STP | TCR_EDP | EDMSDU); } @@ -1301,7 +1290,7 @@ s_vFillFragParameter( //PSTxDesc ptdCurr = (PSTxDesc)s_pvGetTxDescHead(pDevice, uTxType, uCurIdx); PSTxDesc ptdCurr = (PSTxDesc)pvtdCurr; //Set TSR1 & ReqCount in TxDescHead - ptdCurr->m_td1TD1.wReqCount = cpu_to_le16((WORD)(cbReqCount)); + ptdCurr->m_td1TD1.wReqCount = cpu_to_le16((unsigned short)(cbReqCount)); if (wFragType == FRAGCTL_ENDFRAG) { //Last Fragmentation ptdCurr->m_td1TD1.byTCR |= (TCR_STP | TCR_EDP | EDMSDU); } @@ -1310,81 +1299,70 @@ s_vFillFragParameter( } } - pTxBufHead->wFragCtl |= (WORD)wFragType;//0x0001; //0000 0000 0000 0001 + pTxBufHead->wFragCtl |= (unsigned short)wFragType;//0x0001; //0000 0000 0000 0001 //DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"s_vFillFragParameter END\n"); } -static -UINT -s_cbFillTxBufHead ( - PSDevice pDevice, - BYTE byPktType, - PBYTE pbyTxBufferAddr, - UINT cbFrameBodySize, - UINT uDMAIdx, - PSTxDesc pHeadTD, - PSEthernetHeader psEthHeader, - PBYTE pPacket, - BOOL bNeedEncrypt, - PSKeyItem pTransmitKey, - UINT uNodeIndex, - PUINT puMACfragNum - ) +static unsigned int +s_cbFillTxBufHead(PSDevice pDevice, unsigned char byPktType, unsigned char *pbyTxBufferAddr, + unsigned int cbFrameBodySize, unsigned int uDMAIdx, PSTxDesc pHeadTD, + PSEthernetHeader psEthHeader, unsigned char *pPacket, bool bNeedEncrypt, + PSKeyItem pTransmitKey, unsigned int uNodeIndex, unsigned int *puMACfragNum) { - UINT cbMACHdLen; - UINT cbFrameSize; - UINT cbFragmentSize; //Hdr+(IV)+payoad+(MIC)+(ICV)+FCS - UINT cbFragPayloadSize; - UINT cbLastFragmentSize; //Hdr+(IV)+payoad+(MIC)+(ICV)+FCS - UINT cbLastFragPayloadSize; - UINT uFragIdx; - PBYTE pbyPayloadHead; - PBYTE pbyIVHead; - PBYTE pbyMacHdr; - WORD wFragType; //00:Non-Frag, 01:Start, 10:Mid, 11:Last - UINT uDuration; - PBYTE pbyBuffer; -// UINT uKeyEntryIdx = NUM_KEY_ENTRY+1; -// BYTE byKeySel = 0xFF; - UINT cbIVlen = 0; - UINT cbICVlen = 0; - UINT cbMIClen = 0; - UINT cbFCSlen = 4; - UINT cb802_1_H_len = 0; - UINT uLength = 0; - UINT uTmpLen = 0; -// BYTE abyTmp[8]; -// DWORD dwCRC; - UINT cbMICHDR = 0; - DWORD dwMICKey0, dwMICKey1; - DWORD dwMIC_Priority; - PDWORD pdwMIC_L; - PDWORD pdwMIC_R; - DWORD dwSafeMIC_L, dwSafeMIC_R; //Fix "Last Frag Size" < "MIC length". - BOOL bMIC2Frag = FALSE; - UINT uMICFragLen = 0; - UINT uMACfragNum = 1; - UINT uPadding = 0; - UINT cbReqCount = 0; - - BOOL bNeedACK; - BOOL bRTS; - BOOL bIsAdhoc; - PBYTE pbyType; + unsigned int cbMACHdLen; + unsigned int cbFrameSize; + unsigned int cbFragmentSize; //Hdr+(IV)+payoad+(MIC)+(ICV)+FCS + unsigned int cbFragPayloadSize; + unsigned int cbLastFragmentSize; //Hdr+(IV)+payoad+(MIC)+(ICV)+FCS + unsigned int cbLastFragPayloadSize; + unsigned int uFragIdx; + unsigned char *pbyPayloadHead; + unsigned char *pbyIVHead; + unsigned char *pbyMacHdr; + unsigned short wFragType; //00:Non-Frag, 01:Start, 10:Mid, 11:Last + unsigned int uDuration; + unsigned char *pbyBuffer; +// unsigned int uKeyEntryIdx = NUM_KEY_ENTRY+1; +// unsigned char byKeySel = 0xFF; + unsigned int cbIVlen = 0; + unsigned int cbICVlen = 0; + unsigned int cbMIClen = 0; + unsigned int cbFCSlen = 4; + unsigned int cb802_1_H_len = 0; + unsigned int uLength = 0; + unsigned int uTmpLen = 0; +// unsigned char abyTmp[8]; +// unsigned long dwCRC; + unsigned int cbMICHDR = 0; + unsigned long dwMICKey0, dwMICKey1; + unsigned long dwMIC_Priority; + unsigned long *pdwMIC_L; + unsigned long *pdwMIC_R; + unsigned long dwSafeMIC_L, dwSafeMIC_R; //Fix "Last Frag Size" < "MIC length". + bool bMIC2Frag = false; + unsigned int uMICFragLen = 0; + unsigned int uMACfragNum = 1; + unsigned int uPadding = 0; + unsigned int cbReqCount = 0; + + bool bNeedACK; + bool bRTS; + bool bIsAdhoc; + unsigned char *pbyType; PSTxDesc ptdCurr; PSTxBufHead psTxBufHd = (PSTxBufHead) pbyTxBufferAddr; -// UINT tmpDescIdx; - UINT cbHeaderLength = 0; +// unsigned int tmpDescIdx; + unsigned int cbHeaderLength = 0; void * pvRrvTime; PSMICHDRHead pMICHDR; void * pvRTS; void * pvCTS; void * pvTxDataHd; - WORD wTxBufSize; // FFinfo size - UINT uTotalCopyLength = 0; - BYTE byFBOption = AUTO_FB_NONE; - BOOL bIsWEP256 = FALSE; + unsigned short wTxBufSize; // FFinfo size + unsigned int uTotalCopyLength = 0; + unsigned char byFBOption = AUTO_FB_NONE; + bool bIsWEP256 = false; PSMgmtObject pMgmt = pDevice->pMgmt; @@ -1394,19 +1372,16 @@ s_cbFillTxBufHead ( if ((pDevice->eOPMode == OP_MODE_ADHOC) || (pDevice->eOPMode == OP_MODE_AP)) { - if (IS_MULTICAST_ADDRESS(&(psEthHeader->abyDstAddr[0])) || - IS_BROADCAST_ADDRESS(&(psEthHeader->abyDstAddr[0]))) { - bNeedACK = FALSE; - } - else { - bNeedACK = TRUE; - } - bIsAdhoc = TRUE; + if (is_multicast_ether_addr(&(psEthHeader->abyDstAddr[0]))) + bNeedACK = false; + else + bNeedACK = true; + bIsAdhoc = true; } else { // MSDUs in Infra mode always need ACK - bNeedACK = TRUE; - bIsAdhoc = FALSE; + bNeedACK = true; + bIsAdhoc = false; } if (pDevice->bLongHeader) @@ -1415,12 +1390,12 @@ s_cbFillTxBufHead ( cbMACHdLen = WLAN_HDR_ADDR3_LEN; - if ((bNeedEncrypt == TRUE) && (pTransmitKey != NULL)) { + if ((bNeedEncrypt == true) && (pTransmitKey != NULL)) { if (pTransmitKey->byCipherSuite == KEY_CTL_WEP) { cbIVlen = 4; cbICVlen = 4; if (pTransmitKey->uKeyLength == WLAN_WEP232_KEYLEN) { - bIsWEP256 = TRUE; + bIsWEP256 = true; } } if (pTransmitKey->byCipherSuite == KEY_CTL_TKIP) { @@ -1443,14 +1418,14 @@ s_cbFillTxBufHead ( cbFrameSize = cbMACHdLen + cbIVlen + (cbFrameBodySize + cbMIClen) + cbICVlen + cbFCSlen; - if ((bNeedACK == FALSE) || + if ((bNeedACK == false) || (cbFrameSize < pDevice->wRTSThreshold) || ((cbFrameSize >= pDevice->wFragmentationThreshold) && (pDevice->wFragmentationThreshold <= pDevice->wRTSThreshold)) ) { - bRTS = FALSE; + bRTS = false; } else { - bRTS = TRUE; + bRTS = true; psTxBufHd->wFIFOCtl |= (FIFOCTL_RTS | FIFOCTL_LRETRY); } // @@ -1469,7 +1444,7 @@ s_cbFillTxBufHead ( if (byPktType == PK_TYPE_11GB || byPktType == PK_TYPE_11GA) {//802.11g packet if (byFBOption == AUTO_FB_NONE) { - if (bRTS == TRUE) {//RTS_need + if (bRTS == true) {//RTS_need pvRrvTime = (PSRrvTime_gRTS) (pbyTxBufferAddr + wTxBufSize); pMICHDR = (PSMICHDRHead) (pbyTxBufferAddr + wTxBufSize + sizeof(SRrvTime_gRTS)); pvRTS = (PSRTS_g) (pbyTxBufferAddr + wTxBufSize + sizeof(SRrvTime_gRTS) + cbMICHDR); @@ -1487,7 +1462,7 @@ s_cbFillTxBufHead ( } } else { // Auto Fall Back - if (bRTS == TRUE) {//RTS_need + if (bRTS == true) {//RTS_need pvRrvTime = (PSRrvTime_gRTS) (pbyTxBufferAddr + wTxBufSize); pMICHDR = (PSMICHDRHead) (pbyTxBufferAddr + wTxBufSize + sizeof(SRrvTime_gRTS)); pvRTS = (PSRTS_g_FB) (pbyTxBufferAddr + wTxBufSize + sizeof(SRrvTime_gRTS) + cbMICHDR); @@ -1508,7 +1483,7 @@ s_cbFillTxBufHead ( else {//802.11a/b packet if (byFBOption == AUTO_FB_NONE) { - if (bRTS == TRUE) { + if (bRTS == true) { pvRrvTime = (PSRrvTime_ab) (pbyTxBufferAddr + wTxBufSize); pMICHDR = (PSMICHDRHead) (pbyTxBufferAddr + wTxBufSize + sizeof(SRrvTime_ab)); pvRTS = (PSRTS_ab) (pbyTxBufferAddr + wTxBufSize + sizeof(SRrvTime_ab) + cbMICHDR); @@ -1526,7 +1501,7 @@ s_cbFillTxBufHead ( } } else { // Auto Fall Back - if (bRTS == TRUE) {//RTS_need + if (bRTS == true) {//RTS_need pvRrvTime = (PSRrvTime_ab) (pbyTxBufferAddr + wTxBufSize); pMICHDR = (PSMICHDRHead) (pbyTxBufferAddr + wTxBufSize + sizeof(SRrvTime_ab)); pvRTS = (PSRTS_a_FB) (pbyTxBufferAddr + wTxBufSize + sizeof(SRrvTime_ab) + cbMICHDR); @@ -1547,40 +1522,40 @@ s_cbFillTxBufHead ( memset((void *)(pbyTxBufferAddr + wTxBufSize), 0, (cbHeaderLength - wTxBufSize)); ////////////////////////////////////////////////////////////////// - if ((bNeedEncrypt == TRUE) && (pTransmitKey != NULL) && (pTransmitKey->byCipherSuite == KEY_CTL_TKIP)) { + if ((bNeedEncrypt == true) && (pTransmitKey != NULL) && (pTransmitKey->byCipherSuite == KEY_CTL_TKIP)) { if (pDevice->pMgmt->eAuthenMode == WMAC_AUTH_WPANONE) { - dwMICKey0 = *(PDWORD)(&pTransmitKey->abyKey[16]); - dwMICKey1 = *(PDWORD)(&pTransmitKey->abyKey[20]); + dwMICKey0 = *(unsigned long *)(&pTransmitKey->abyKey[16]); + dwMICKey1 = *(unsigned long *)(&pTransmitKey->abyKey[20]); } else if ((pTransmitKey->dwKeyIndex & AUTHENTICATOR_KEY) != 0) { - dwMICKey0 = *(PDWORD)(&pTransmitKey->abyKey[16]); - dwMICKey1 = *(PDWORD)(&pTransmitKey->abyKey[20]); + dwMICKey0 = *(unsigned long *)(&pTransmitKey->abyKey[16]); + dwMICKey1 = *(unsigned long *)(&pTransmitKey->abyKey[20]); } else { - dwMICKey0 = *(PDWORD)(&pTransmitKey->abyKey[24]); - dwMICKey1 = *(PDWORD)(&pTransmitKey->abyKey[28]); + dwMICKey0 = *(unsigned long *)(&pTransmitKey->abyKey[24]); + dwMICKey1 = *(unsigned long *)(&pTransmitKey->abyKey[28]); } // DO Software Michael MIC_vInit(dwMICKey0, dwMICKey1); - MIC_vAppend((PBYTE)&(psEthHeader->abyDstAddr[0]), 12); + MIC_vAppend((unsigned char *)&(psEthHeader->abyDstAddr[0]), 12); dwMIC_Priority = 0; - MIC_vAppend((PBYTE)&dwMIC_Priority, 4); + MIC_vAppend((unsigned char *)&dwMIC_Priority, 4); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"MIC KEY: %lX, %lX\n", dwMICKey0, dwMICKey1); } /////////////////////////////////////////////////////////////////// - pbyMacHdr = (PBYTE)(pbyTxBufferAddr + cbHeaderLength); - pbyPayloadHead = (PBYTE)(pbyMacHdr + cbMACHdLen + uPadding + cbIVlen); - pbyIVHead = (PBYTE)(pbyMacHdr + cbMACHdLen + uPadding); + pbyMacHdr = (unsigned char *)(pbyTxBufferAddr + cbHeaderLength); + pbyPayloadHead = (unsigned char *)(pbyMacHdr + cbMACHdLen + uPadding + cbIVlen); + pbyIVHead = (unsigned char *)(pbyMacHdr + cbMACHdLen + uPadding); - if ((cbFrameSize > pDevice->wFragmentationThreshold) && (bNeedACK == TRUE) && (bIsWEP256 == FALSE)) { + if ((cbFrameSize > pDevice->wFragmentationThreshold) && (bNeedACK == true) && (bIsWEP256 == false)) { // Fragmentation // FragThreshold = Fragment size(Hdr+(IV)+fragment payload+(MIC)+(ICV)+FCS) cbFragmentSize = pDevice->wFragmentationThreshold; cbFragPayloadSize = cbFragmentSize - cbMACHdLen - cbIVlen - cbICVlen - cbFCSlen; //FragNum = (FrameSize-(Hdr+FCS))/(Fragment Size -(Hrd+FCS))) - uMACfragNum = (WORD) ((cbFrameBodySize + cbMIClen) / cbFragPayloadSize); + uMACfragNum = (unsigned short) ((cbFrameBodySize + cbMIClen) / cbFragPayloadSize); cbLastFragPayloadSize = (cbFrameBodySize + cbMIClen) % cbFragPayloadSize; if (cbLastFragPayloadSize == 0) { cbLastFragPayloadSize = cbFragPayloadSize; @@ -1606,13 +1581,13 @@ s_cbFillTxBufHead ( uDuration = s_uFillDataHead(pDevice, byPktType, pvTxDataHd, cbFragmentSize, uDMAIdx, bNeedACK, uFragIdx, cbLastFragmentSize, uMACfragNum, byFBOption, pDevice->wCurrentRate); // Generate TX MAC Header - vGenerateMACHeader(pDevice, pbyMacHdr, (WORD)uDuration, psEthHeader, bNeedEncrypt, + vGenerateMACHeader(pDevice, pbyMacHdr, (unsigned short)uDuration, psEthHeader, bNeedEncrypt, wFragType, uDMAIdx, uFragIdx); - if (bNeedEncrypt == TRUE) { + if (bNeedEncrypt == true) { //Fill TXKEY - s_vFillTxKey(pDevice, (PBYTE)(psTxBufHd->adwTxKey), pbyIVHead, pTransmitKey, - pbyMacHdr, (WORD)cbFragPayloadSize, (PBYTE)pMICHDR); + s_vFillTxKey(pDevice, (unsigned char *)(psTxBufHd->adwTxKey), pbyIVHead, pTransmitKey, + pbyMacHdr, (unsigned short)cbFragPayloadSize, (unsigned char *)pMICHDR); //Fill IV(ExtIV,RSNHDR) if (pDevice->bEnableHostWEP) { pMgmt->sNodeDBTable[uNodeIndex].dwTSC47_16 = pTransmitKey->dwTSC47_16; @@ -1625,13 +1600,13 @@ s_cbFillTxBufHead ( if (ntohs(psEthHeader->wType) > ETH_DATA_LEN) { if ((psEthHeader->wType == TYPE_PKT_IPX) || (psEthHeader->wType == cpu_to_le16(0xF380))) { - memcpy((PBYTE) (pbyPayloadHead), &pDevice->abySNAP_Bridgetunnel[0], 6); + memcpy((unsigned char *) (pbyPayloadHead), &pDevice->abySNAP_Bridgetunnel[0], 6); } else { - memcpy((PBYTE) (pbyPayloadHead), &pDevice->abySNAP_RFC1042[0], 6); + memcpy((unsigned char *) (pbyPayloadHead), &pDevice->abySNAP_RFC1042[0], 6); } - pbyType = (PBYTE) (pbyPayloadHead + 6); - memcpy(pbyType, &(psEthHeader->wType), sizeof(WORD)); + pbyType = (unsigned char *) (pbyPayloadHead + 6); + memcpy(pbyType, &(psEthHeader->wType), sizeof(unsigned short)); cb802_1_H_len = 8; } @@ -1641,15 +1616,15 @@ s_cbFillTxBufHead ( //--------------------------- //Fill MICHDR //if (pDevice->bAES) { - // s_vFillMICHDR(pDevice, (PBYTE)pMICHDR, pbyMacHdr, (WORD)cbFragPayloadSize); + // s_vFillMICHDR(pDevice, (unsigned char *)pMICHDR, pbyMacHdr, (unsigned short)cbFragPayloadSize); //} //cbReqCount += s_uDoEncryption(pDevice, psEthHeader, (void *)psTxBufHd, byKeySel, - // pbyPayloadHead, (WORD)cbFragPayloadSize, uDMAIdx); + // pbyPayloadHead, (unsigned short)cbFragPayloadSize, uDMAIdx); - //pbyBuffer = (PBYTE)pDevice->aamTxBuf[uDMAIdx][uDescIdx].pbyVAddr; - pbyBuffer = (PBYTE)pHeadTD->pTDInfo->buf; + //pbyBuffer = (unsigned char *)pDevice->aamTxBuf[uDMAIdx][uDescIdx].pbyVAddr; + pbyBuffer = (unsigned char *)pHeadTD->pTDInfo->buf; uLength = cbHeaderLength + cbMACHdLen + uPadding + cbIVlen + cb802_1_H_len; //copy TxBufferHeader + MacHeader to desc @@ -1661,7 +1636,7 @@ s_cbFillTxBufHead ( uTotalCopyLength += cbFragPayloadSize - cb802_1_H_len; - if ((bNeedEncrypt == TRUE) && (pTransmitKey != NULL) && (pTransmitKey->byCipherSuite == KEY_CTL_TKIP)) { + if ((bNeedEncrypt == true) && (pTransmitKey != NULL) && (pTransmitKey->byCipherSuite == KEY_CTL_TKIP)) { DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"Start MIC: %d\n", cbFragPayloadSize); MIC_vAppend((pbyBuffer + uLength - cb802_1_H_len), cbFragPayloadSize); @@ -1672,7 +1647,7 @@ s_cbFillTxBufHead ( //--------------------------- if ((pDevice->byLocalID <= REV_ID_VT3253_A1)) { if (bNeedEncrypt) { - s_vSWencryption(pDevice, pTransmitKey, (pbyBuffer + uLength - cb802_1_H_len), (WORD)cbFragPayloadSize); + s_vSWencryption(pDevice, pTransmitKey, (pbyBuffer + uLength - cb802_1_H_len), (unsigned short)cbFragPayloadSize); cbReqCount += cbICVlen; } } @@ -1711,13 +1686,13 @@ s_cbFillTxBufHead ( uFragIdx, cbLastFragmentSize, uMACfragNum, byFBOption, pDevice->wCurrentRate); // Generate TX MAC Header - vGenerateMACHeader(pDevice, pbyMacHdr, (WORD)uDuration, psEthHeader, bNeedEncrypt, + vGenerateMACHeader(pDevice, pbyMacHdr, (unsigned short)uDuration, psEthHeader, bNeedEncrypt, wFragType, uDMAIdx, uFragIdx); - if (bNeedEncrypt == TRUE) { + if (bNeedEncrypt == true) { //Fill TXKEY - s_vFillTxKey(pDevice, (PBYTE)(psTxBufHd->adwTxKey), pbyIVHead, pTransmitKey, - pbyMacHdr, (WORD)cbLastFragPayloadSize, (PBYTE)pMICHDR); + s_vFillTxKey(pDevice, (unsigned char *)(psTxBufHd->adwTxKey), pbyIVHead, pTransmitKey, + pbyMacHdr, (unsigned short)cbLastFragPayloadSize, (unsigned char *)pMICHDR); if (pDevice->bEnableHostWEP) { pMgmt->sNodeDBTable[uNodeIndex].dwTSC47_16 = pTransmitKey->dwTSC47_16; @@ -1734,8 +1709,8 @@ s_cbFillTxBufHead ( - pbyBuffer = (PBYTE)pHeadTD->pTDInfo->buf; - //pbyBuffer = (PBYTE)pDevice->aamTxBuf[uDMAIdx][tmpDescIdx].pbyVAddr; + pbyBuffer = (unsigned char *)pHeadTD->pTDInfo->buf; + //pbyBuffer = (unsigned char *)pDevice->aamTxBuf[uDMAIdx][tmpDescIdx].pbyVAddr; uLength = cbHeaderLength + cbMACHdLen + uPadding + cbIVlen; @@ -1743,7 +1718,7 @@ s_cbFillTxBufHead ( memcpy(pbyBuffer, (void *)psTxBufHd, uLength); // Copy the Packet into a tx Buffer - if (bMIC2Frag == FALSE) { + if (bMIC2Frag == false) { memcpy((pbyBuffer + uLength), (pPacket + 14 + uTotalCopyLength), @@ -1753,36 +1728,36 @@ s_cbFillTxBufHead ( uTmpLen = cbLastFragPayloadSize - cbMIClen; } - if ((bNeedEncrypt == TRUE) && (pTransmitKey != NULL) && (pTransmitKey->byCipherSuite == KEY_CTL_TKIP)) { + if ((bNeedEncrypt == true) && (pTransmitKey != NULL) && (pTransmitKey->byCipherSuite == KEY_CTL_TKIP)) { DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"LAST: uMICFragLen:%d, cbLastFragPayloadSize:%d, uTmpLen:%d\n", uMICFragLen, cbLastFragPayloadSize, uTmpLen); - if (bMIC2Frag == FALSE) { + if (bMIC2Frag == false) { if (uTmpLen != 0) MIC_vAppend((pbyBuffer + uLength), uTmpLen); - pdwMIC_L = (PDWORD)(pbyBuffer + uLength + uTmpLen); - pdwMIC_R = (PDWORD)(pbyBuffer + uLength + uTmpLen + 4); + pdwMIC_L = (unsigned long *)(pbyBuffer + uLength + uTmpLen); + pdwMIC_R = (unsigned long *)(pbyBuffer + uLength + uTmpLen + 4); MIC_vGetMIC(pdwMIC_L, pdwMIC_R); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"Last MIC:%lX, %lX\n", *pdwMIC_L, *pdwMIC_R); } else { if (uMICFragLen >= 4) { - memcpy((pbyBuffer + uLength), ((PBYTE)&dwSafeMIC_R + (uMICFragLen - 4)), + memcpy((pbyBuffer + uLength), ((unsigned char *)&dwSafeMIC_R + (uMICFragLen - 4)), (cbMIClen - uMICFragLen)); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"LAST: uMICFragLen >= 4: %X, %d\n", - *(PBYTE)((PBYTE)&dwSafeMIC_R + (uMICFragLen - 4)), + *(unsigned char *)((unsigned char *)&dwSafeMIC_R + (uMICFragLen - 4)), (cbMIClen - uMICFragLen)); } else { - memcpy((pbyBuffer + uLength), ((PBYTE)&dwSafeMIC_L + uMICFragLen), + memcpy((pbyBuffer + uLength), ((unsigned char *)&dwSafeMIC_L + uMICFragLen), (4 - uMICFragLen)); memcpy((pbyBuffer + uLength + (4 - uMICFragLen)), &dwSafeMIC_R, 4); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"LAST: uMICFragLen < 4: %X, %d\n", - *(PBYTE)((PBYTE)&dwSafeMIC_R + uMICFragLen - 4), + *(unsigned char *)((unsigned char *)&dwSafeMIC_R + uMICFragLen - 4), (cbMIClen - uMICFragLen)); } /* for (ii = 0; ii < cbLastFragPayloadSize + 8 + 24; ii++) { - DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"%02x ", *((PBYTE)((pbyBuffer + uLength) + ii - 8 - 24))); + DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"%02x ", *((unsigned char *)((pbyBuffer + uLength) + ii - 8 - 24))); } DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"\n\n"); */ @@ -1798,7 +1773,7 @@ s_cbFillTxBufHead ( //--------------------------- if ((pDevice->byLocalID <= REV_ID_VT3253_A1)) { if (bNeedEncrypt) { - s_vSWencryption(pDevice, pTransmitKey, (pbyBuffer + uLength), (WORD)cbLastFragPayloadSize); + s_vSWencryption(pDevice, pTransmitKey, (pbyBuffer + uLength), (unsigned short)cbLastFragPayloadSize); cbReqCount += cbICVlen; } } @@ -1841,14 +1816,14 @@ s_cbFillTxBufHead ( uFragIdx, cbLastFragmentSize, uMACfragNum, byFBOption, pDevice->wCurrentRate); // Generate TX MAC Header - vGenerateMACHeader(pDevice, pbyMacHdr, (WORD)uDuration, psEthHeader, bNeedEncrypt, + vGenerateMACHeader(pDevice, pbyMacHdr, (unsigned short)uDuration, psEthHeader, bNeedEncrypt, wFragType, uDMAIdx, uFragIdx); - if (bNeedEncrypt == TRUE) { + if (bNeedEncrypt == true) { //Fill TXKEY - s_vFillTxKey(pDevice, (PBYTE)(psTxBufHd->adwTxKey), pbyIVHead, pTransmitKey, - pbyMacHdr, (WORD)cbFragPayloadSize, (PBYTE)pMICHDR); + s_vFillTxKey(pDevice, (unsigned char *)(psTxBufHd->adwTxKey), pbyIVHead, pTransmitKey, + pbyMacHdr, (unsigned short)cbFragPayloadSize, (unsigned char *)pMICHDR); if (pDevice->bEnableHostWEP) { pMgmt->sNodeDBTable[uNodeIndex].dwTSC47_16 = pTransmitKey->dwTSC47_16; @@ -1862,14 +1837,14 @@ s_cbFillTxBufHead ( //--------------------------- //Fill MICHDR //if (pDevice->bAES) { - // s_vFillMICHDR(pDevice, (PBYTE)pMICHDR, pbyMacHdr, (WORD)cbFragPayloadSize); + // s_vFillMICHDR(pDevice, (unsigned char *)pMICHDR, pbyMacHdr, (unsigned short)cbFragPayloadSize); //} //cbReqCount += s_uDoEncryption(pDevice, psEthHeader, (void *)psTxBufHd, byKeySel, - // pbyPayloadHead, (WORD)cbFragPayloadSize, uDMAIdx); + // pbyPayloadHead, (unsigned short)cbFragPayloadSize, uDMAIdx); - pbyBuffer = (PBYTE)pHeadTD->pTDInfo->buf; - //pbyBuffer = (PBYTE)pDevice->aamTxBuf[uDMAIdx][tmpDescIdx].pbyVAddr; + pbyBuffer = (unsigned char *)pHeadTD->pTDInfo->buf; + //pbyBuffer = (unsigned char *)pDevice->aamTxBuf[uDMAIdx][tmpDescIdx].pbyVAddr; uLength = cbHeaderLength + cbMACHdLen + uPadding + cbIVlen; @@ -1886,17 +1861,17 @@ s_cbFillTxBufHead ( uTotalCopyLength += uTmpLen; - if ((bNeedEncrypt == TRUE) && (pTransmitKey != NULL) && (pTransmitKey->byCipherSuite == KEY_CTL_TKIP)) { + if ((bNeedEncrypt == true) && (pTransmitKey != NULL) && (pTransmitKey->byCipherSuite == KEY_CTL_TKIP)) { MIC_vAppend((pbyBuffer + uLength), uTmpLen); if (uTmpLen < cbFragPayloadSize) { - bMIC2Frag = TRUE; + bMIC2Frag = true; uMICFragLen = cbFragPayloadSize - uTmpLen; ASSERT(uMICFragLen < cbMIClen); - pdwMIC_L = (PDWORD)(pbyBuffer + uLength + uTmpLen); - pdwMIC_R = (PDWORD)(pbyBuffer + uLength + uTmpLen + 4); + pdwMIC_L = (unsigned long *)(pbyBuffer + uLength + uTmpLen); + pdwMIC_R = (unsigned long *)(pbyBuffer + uLength + uTmpLen + 4); MIC_vGetMIC(pdwMIC_L, pdwMIC_R); dwSafeMIC_L = *pdwMIC_L; dwSafeMIC_R = *pdwMIC_R; @@ -1906,7 +1881,7 @@ s_cbFillTxBufHead ( DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"Fill MIC in Middle frag [%d]\n", uMICFragLen); /* for (ii = 0; ii < uMICFragLen; ii++) { - DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"%02x ", *((PBYTE)((pbyBuffer + uLength + uTmpLen) + ii))); + DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"%02x ", *((unsigned char *)((pbyBuffer + uLength + uTmpLen) + ii))); } DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"\n"); */ @@ -1915,7 +1890,7 @@ s_cbFillTxBufHead ( DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"Middle frag len: %d\n", uTmpLen); /* for (ii = 0; ii < uTmpLen; ii++) { - DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"%02x ", *((PBYTE)((pbyBuffer + uLength) + ii))); + DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"%02x ", *((unsigned char *)((pbyBuffer + uLength) + ii))); } DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"\n\n"); */ @@ -1926,7 +1901,7 @@ s_cbFillTxBufHead ( if ((pDevice->byLocalID <= REV_ID_VT3253_A1)) { if (bNeedEncrypt) { - s_vSWencryption(pDevice, pTransmitKey, (pbyBuffer + uLength), (WORD)cbFragPayloadSize); + s_vSWencryption(pDevice, pTransmitKey, (pbyBuffer + uLength), (unsigned short)cbFragPayloadSize); cbReqCount += cbICVlen; } } @@ -1961,7 +1936,7 @@ s_cbFillTxBufHead ( wFragType = FRAGCTL_NONFRAG; //Set FragCtl in TxBufferHead - psTxBufHd->wFragCtl |= (WORD)wFragType; + psTxBufHd->wFragCtl |= (unsigned short)wFragType; //Fill FIFO,RrvTime,RTS,and CTS s_vGenerateTxParameter(pDevice, byPktType, (void *)psTxBufHd, pvRrvTime, pvRTS, pvCTS, @@ -1971,13 +1946,13 @@ s_cbFillTxBufHead ( 0, 0, uMACfragNum, byFBOption, pDevice->wCurrentRate); // Generate TX MAC Header - vGenerateMACHeader(pDevice, pbyMacHdr, (WORD)uDuration, psEthHeader, bNeedEncrypt, + vGenerateMACHeader(pDevice, pbyMacHdr, (unsigned short)uDuration, psEthHeader, bNeedEncrypt, wFragType, uDMAIdx, 0); - if (bNeedEncrypt == TRUE) { + if (bNeedEncrypt == true) { //Fill TXKEY - s_vFillTxKey(pDevice, (PBYTE)(psTxBufHd->adwTxKey), pbyIVHead, pTransmitKey, - pbyMacHdr, (WORD)cbFrameBodySize, (PBYTE)pMICHDR); + s_vFillTxKey(pDevice, (unsigned char *)(psTxBufHd->adwTxKey), pbyIVHead, pTransmitKey, + pbyMacHdr, (unsigned short)cbFrameBodySize, (unsigned char *)pMICHDR); if (pDevice->bEnableHostWEP) { pMgmt->sNodeDBTable[uNodeIndex].dwTSC47_16 = pTransmitKey->dwTSC47_16; @@ -1989,13 +1964,13 @@ s_cbFillTxBufHead ( if (ntohs(psEthHeader->wType) > ETH_DATA_LEN) { if ((psEthHeader->wType == TYPE_PKT_IPX) || (psEthHeader->wType == cpu_to_le16(0xF380))) { - memcpy((PBYTE) (pbyPayloadHead), &pDevice->abySNAP_Bridgetunnel[0], 6); + memcpy((unsigned char *) (pbyPayloadHead), &pDevice->abySNAP_Bridgetunnel[0], 6); } else { - memcpy((PBYTE) (pbyPayloadHead), &pDevice->abySNAP_RFC1042[0], 6); + memcpy((unsigned char *) (pbyPayloadHead), &pDevice->abySNAP_RFC1042[0], 6); } - pbyType = (PBYTE) (pbyPayloadHead + 6); - memcpy(pbyType, &(psEthHeader->wType), sizeof(WORD)); + pbyType = (unsigned char *) (pbyPayloadHead + 6); + memcpy(pbyType, &(psEthHeader->wType), sizeof(unsigned short)); cb802_1_H_len = 8; } @@ -2006,11 +1981,11 @@ s_cbFillTxBufHead ( //Fill MICHDR //if (pDevice->bAES) { // DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"Fill MICHDR...\n"); - // s_vFillMICHDR(pDevice, (PBYTE)pMICHDR, pbyMacHdr, (WORD)cbFrameBodySize); + // s_vFillMICHDR(pDevice, (unsigned char *)pMICHDR, pbyMacHdr, (unsigned short)cbFrameBodySize); //} - pbyBuffer = (PBYTE)pHeadTD->pTDInfo->buf; - //pbyBuffer = (PBYTE)pDevice->aamTxBuf[uDMAIdx][uDescIdx].pbyVAddr; + pbyBuffer = (unsigned char *)pHeadTD->pTDInfo->buf; + //pbyBuffer = (unsigned char *)pDevice->aamTxBuf[uDMAIdx][uDescIdx].pbyVAddr; uLength = cbHeaderLength + cbMACHdLen + uPadding + cbIVlen + cb802_1_H_len; @@ -2023,29 +1998,29 @@ s_cbFillTxBufHead ( cbFrameBodySize - cb802_1_H_len ); - if ((bNeedEncrypt == TRUE) && (pTransmitKey != NULL) && (pTransmitKey->byCipherSuite == KEY_CTL_TKIP)){ + if ((bNeedEncrypt == true) && (pTransmitKey != NULL) && (pTransmitKey->byCipherSuite == KEY_CTL_TKIP)){ DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"Length:%d, %d\n", cbFrameBodySize - cb802_1_H_len, uLength); /* for (ii = 0; ii < (cbFrameBodySize - cb802_1_H_len); ii++) { - DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"%02x ", *((PBYTE)((pbyBuffer + uLength) + ii))); + DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"%02x ", *((unsigned char *)((pbyBuffer + uLength) + ii))); } DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"\n"); */ MIC_vAppend((pbyBuffer + uLength - cb802_1_H_len), cbFrameBodySize); - pdwMIC_L = (PDWORD)(pbyBuffer + uLength - cb802_1_H_len + cbFrameBodySize); - pdwMIC_R = (PDWORD)(pbyBuffer + uLength - cb802_1_H_len + cbFrameBodySize + 4); + pdwMIC_L = (unsigned long *)(pbyBuffer + uLength - cb802_1_H_len + cbFrameBodySize); + pdwMIC_R = (unsigned long *)(pbyBuffer + uLength - cb802_1_H_len + cbFrameBodySize + 4); MIC_vGetMIC(pdwMIC_L, pdwMIC_R); MIC_vUnInit(); - if (pDevice->bTxMICFail == TRUE) { + if (pDevice->bTxMICFail == true) { *pdwMIC_L = 0; *pdwMIC_R = 0; - pDevice->bTxMICFail = FALSE; + pDevice->bTxMICFail = false; } DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"uLength: %d, %d\n", uLength, cbFrameBodySize); @@ -2053,7 +2028,7 @@ s_cbFillTxBufHead ( DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"MIC:%lx, %lx\n", *pdwMIC_L, *pdwMIC_R); /* for (ii = 0; ii < 8; ii++) { - DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"%02x ", *(((PBYTE)(pdwMIC_L) + ii))); + DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"%02x ", *(((unsigned char *)(pdwMIC_L) + ii))); } DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"\n"); */ @@ -2064,7 +2039,7 @@ s_cbFillTxBufHead ( if ((pDevice->byLocalID <= REV_ID_VT3253_A1)){ if (bNeedEncrypt) { s_vSWencryption(pDevice, pTransmitKey, (pbyBuffer + uLength - cb802_1_H_len), - (WORD)(cbFrameBodySize + cbMIClen)); + (unsigned short)(cbFrameBodySize + cbMIClen)); cbReqCount += cbICVlen; } } @@ -2078,7 +2053,7 @@ s_cbFillTxBufHead ( ptdCurr->buff_addr = cpu_to_le32(ptdCurr->pTDInfo->skb_dma); //Set TSR1 & ReqCount in TxDescHead ptdCurr->m_td1TD1.byTCR |= (TCR_STP | TCR_EDP | EDMSDU); - ptdCurr->m_td1TD1.wReqCount = cpu_to_le16((WORD)(cbReqCount)); + ptdCurr->m_td1TD1.wReqCount = cpu_to_le16((unsigned short)(cbReqCount)); pDevice->iTDUsed[uDMAIdx]++; @@ -2094,26 +2069,16 @@ s_cbFillTxBufHead ( void -vGenerateFIFOHeader ( - PSDevice pDevice, - BYTE byPktType, - PBYTE pbyTxBufferAddr, - BOOL bNeedEncrypt, - UINT cbPayloadSize, - UINT uDMAIdx, - PSTxDesc pHeadTD, - PSEthernetHeader psEthHeader, - PBYTE pPacket, - PSKeyItem pTransmitKey, - UINT uNodeIndex, - PUINT puMACfragNum, - PUINT pcbHeaderSize - ) +vGenerateFIFOHeader(PSDevice pDevice, unsigned char byPktType, unsigned char *pbyTxBufferAddr, + bool bNeedEncrypt, unsigned int cbPayloadSize, unsigned int uDMAIdx, + PSTxDesc pHeadTD, PSEthernetHeader psEthHeader, unsigned char *pPacket, + PSKeyItem pTransmitKey, unsigned int uNodeIndex, unsigned int *puMACfragNum, + unsigned int *pcbHeaderSize) { - UINT wTxBufSize; // FFinfo size - BOOL bNeedACK; - BOOL bIsAdhoc; - WORD cbMacHdLen; + unsigned int wTxBufSize; // FFinfo size + bool bNeedACK; + bool bIsAdhoc; + unsigned short cbMacHdLen; PSTxBufHead pTxBufHead = (PSTxBufHead) pbyTxBufferAddr; wTxBufSize = sizeof(STxBufHead); @@ -2123,22 +2088,21 @@ vGenerateFIFOHeader ( if ((pDevice->eOPMode == OP_MODE_ADHOC) || (pDevice->eOPMode == OP_MODE_AP)) { - if (IS_MULTICAST_ADDRESS(&(psEthHeader->abyDstAddr[0])) || - IS_BROADCAST_ADDRESS(&(psEthHeader->abyDstAddr[0]))) { - bNeedACK = FALSE; + if (is_multicast_ether_addr(&(psEthHeader->abyDstAddr[0]))) { + bNeedACK = false; pTxBufHead->wFIFOCtl = pTxBufHead->wFIFOCtl & (~FIFOCTL_NEEDACK); } else { - bNeedACK = TRUE; + bNeedACK = true; pTxBufHead->wFIFOCtl |= FIFOCTL_NEEDACK; } - bIsAdhoc = TRUE; + bIsAdhoc = true; } else { // MSDUs in Infra mode always need ACK - bNeedACK = TRUE; + bNeedACK = true; pTxBufHead->wFIFOCtl |= FIFOCTL_NEEDACK; - bIsAdhoc = FALSE; + bIsAdhoc = false; } @@ -2165,7 +2129,7 @@ vGenerateFIFOHeader ( } else { cbMacHdLen = WLAN_HDR_ADDR3_LEN; } - pTxBufHead->wFragCtl |= cpu_to_le16((WORD)(cbMacHdLen << 10)); + pTxBufHead->wFragCtl |= cpu_to_le16((unsigned short)(cbMacHdLen << 10)); //Set packet type if (byPktType == PK_TYPE_11A) {//0000 0000 0000 0000 @@ -2181,7 +2145,7 @@ vGenerateFIFOHeader ( pTxBufHead->wFIFOCtl |= FIFOCTL_11GA; } //Set FIFOCTL_GrpAckPolicy - if (pDevice->bGrpAckPolicy == TRUE) {//0000 0100 0000 0000 + if (pDevice->bGrpAckPolicy == true) {//0000 0100 0000 0000 pTxBufHead->wFIFOCtl |= FIFOCTL_GRPACK; } @@ -2195,7 +2159,7 @@ vGenerateFIFOHeader ( } //Set FRAGCTL_WEPTYP - pDevice->bAES = FALSE; + pDevice->bAES = false; //Set FRAGCTL_WEPTYP if (pDevice->byLocalID > REV_ID_VT3253_A1) { @@ -2267,13 +2231,13 @@ vGenerateFIFOHeader ( void vGenerateMACHeader ( PSDevice pDevice, - PBYTE pbyBufferAddr, - WORD wDuration, + unsigned char *pbyBufferAddr, + unsigned short wDuration, PSEthernetHeader psEthHeader, - BOOL bNeedEncrypt, - WORD wFragType, - UINT uDMAIdx, - UINT uFragIdx + bool bNeedEncrypt, + unsigned short wFragType, + unsigned int uDMAIdx, + unsigned int uFragIdx ) { PS802_11Header pMACHeader = (PS802_11Header)pbyBufferAddr; @@ -2307,7 +2271,7 @@ vGenerateMACHeader ( } if (bNeedEncrypt) - pMACHeader->wFrameCtl |= cpu_to_le16((WORD)WLAN_SET_FC_ISWEP(1)); + pMACHeader->wFrameCtl |= cpu_to_le16((unsigned short)WLAN_SET_FC_ISWEP(1)); pMACHeader->wDurationID = cpu_to_le16(wDuration); @@ -2319,7 +2283,7 @@ vGenerateMACHeader ( pMACHeader->wSeqCtl = cpu_to_le16(pDevice->wSeqCounter << 4); //Set FragNumber in Sequence Control - pMACHeader->wSeqCtl |= cpu_to_le16((WORD)uFragIdx); + pMACHeader->wSeqCtl |= cpu_to_le16((unsigned short)uFragIdx); if ((wFragType == FRAGCTL_ENDFRAG) || (wFragType == FRAGCTL_NONFRAG)) { pDevice->wSeqCounter++; @@ -2340,32 +2304,32 @@ vGenerateMACHeader ( CMD_STATUS csMgmt_xmit(PSDevice pDevice, PSTxMgmtPacket pPacket) { PSTxDesc pFrstTD; - BYTE byPktType; - PBYTE pbyTxBufferAddr; + unsigned char byPktType; + unsigned char *pbyTxBufferAddr; void * pvRTS; PSCTS pCTS; void * pvTxDataHd; - UINT uDuration; - UINT cbReqCount; + unsigned int uDuration; + unsigned int cbReqCount; PS802_11Header pMACHeader; - UINT cbHeaderSize; - UINT cbFrameBodySize; - BOOL bNeedACK; - BOOL bIsPSPOLL = FALSE; + unsigned int cbHeaderSize; + unsigned int cbFrameBodySize; + bool bNeedACK; + bool bIsPSPOLL = false; PSTxBufHead pTxBufHead; - UINT cbFrameSize; - UINT cbIVlen = 0; - UINT cbICVlen = 0; - UINT cbMIClen = 0; - UINT cbFCSlen = 4; - UINT uPadding = 0; - WORD wTxBufSize; - UINT cbMacHdLen; + unsigned int cbFrameSize; + unsigned int cbIVlen = 0; + unsigned int cbICVlen = 0; + unsigned int cbMIClen = 0; + unsigned int cbFCSlen = 4; + unsigned int uPadding = 0; + unsigned short wTxBufSize; + unsigned int cbMacHdLen; SEthernetHeader sEthHeader; void * pvRrvTime; void * pMICHDR; PSMgmtObject pMgmt = pDevice->pMgmt; - WORD wCurrentRate = RATE_1M; + unsigned short wCurrentRate = RATE_1M; if (AVAIL_TD(pDevice, TYPE_TXDMA0) <= 0) { @@ -2373,7 +2337,7 @@ CMD_STATUS csMgmt_xmit(PSDevice pDevice, PSTxMgmtPacket pPacket) { } pFrstTD = pDevice->apCurrTD[TYPE_TXDMA0]; - pbyTxBufferAddr = (PBYTE)pFrstTD->pTDInfo->buf; + pbyTxBufferAddr = (unsigned char *)pFrstTD->pTDInfo->buf; cbFrameBodySize = pPacket->cbPayloadLen; pTxBufHead = (PSTxBufHead) pbyTxBufferAddr; wTxBufSize = sizeof(STxBufHead); @@ -2424,12 +2388,10 @@ CMD_STATUS csMgmt_xmit(PSDevice pDevice, PSTxMgmtPacket pPacket) { pTxBufHead->wTimeStamp = cpu_to_le16(DEFAULT_MGN_LIFETIME_RES_64us); - if (IS_MULTICAST_ADDRESS(&(pPacket->p80211Header->sA3.abyAddr1[0])) || - IS_BROADCAST_ADDRESS(&(pPacket->p80211Header->sA3.abyAddr1[0]))) { - bNeedACK = FALSE; - } + if (is_multicast_ether_addr(&(pPacket->p80211Header->sA3.abyAddr1[0]))) + bNeedACK = false; else { - bNeedACK = TRUE; + bNeedACK = true; pTxBufHead->wFIFOCtl |= FIFOCTL_NEEDACK; }; @@ -2441,7 +2403,7 @@ CMD_STATUS csMgmt_xmit(PSDevice pDevice, PSTxMgmtPacket pPacket) { //pDevice->byPreambleType = PREAMBLE_LONG; // probe-response don't retry //if ((pPacket->p80211Header->sA4.wFrameCtl & TYPE_SUBTYPE_MASK) == TYPE_MGMT_PROBE_RSP) { - // bNeedACK = FALSE; + // bNeedACK = false; // pTxBufHead->wFIFOCtl &= (~FIFOCTL_NEEDACK); //} } @@ -2449,19 +2411,19 @@ CMD_STATUS csMgmt_xmit(PSDevice pDevice, PSTxMgmtPacket pPacket) { pTxBufHead->wFIFOCtl |= (FIFOCTL_GENINT | FIFOCTL_ISDMA0); if ((pPacket->p80211Header->sA4.wFrameCtl & TYPE_SUBTYPE_MASK) == TYPE_CTL_PSPOLL) { - bIsPSPOLL = TRUE; + bIsPSPOLL = true; cbMacHdLen = WLAN_HDR_ADDR2_LEN; } else { cbMacHdLen = WLAN_HDR_ADDR3_LEN; } //Set FRAGCTL_MACHDCNT - pTxBufHead->wFragCtl |= cpu_to_le16((WORD)(cbMacHdLen << 10)); + pTxBufHead->wFragCtl |= cpu_to_le16((unsigned short)(cbMacHdLen << 10)); // Notes: // Although spec says MMPDU can be fragmented; In most case, // no one will send a MMPDU under fragmentation. With RTS may occur. - pDevice->bAES = FALSE; //Set FRAGCTL_WEPTYP + pDevice->bAES = false; //Set FRAGCTL_WEPTYP if (WLAN_GET_FC_ISWEP(pPacket->p80211Header->sA4.wFrameCtl) != 0) { if (pDevice->eEncryptionStatus == Ndis802_11Encryption1Enabled) { @@ -2482,7 +2444,7 @@ CMD_STATUS csMgmt_xmit(PSDevice pDevice, PSTxMgmtPacket pPacket) { cbIVlen = 8;//RSN Header cbICVlen = 8;//MIC pTxBufHead->wFragCtl |= FRAGCTL_AES; - pDevice->bAES = TRUE; + pDevice->bAES = true; } //MAC Header should be padding 0 to DW alignment. uPadding = 4 - (cbMacHdLen%4); @@ -2492,7 +2454,7 @@ CMD_STATUS csMgmt_xmit(PSDevice pDevice, PSTxMgmtPacket pPacket) { cbFrameSize = cbMacHdLen + cbFrameBodySize + cbIVlen + cbMIClen + cbICVlen + cbFCSlen; //Set FIFOCTL_GrpAckPolicy - if (pDevice->bGrpAckPolicy == TRUE) {//0000 0100 0000 0000 + if (pDevice->bGrpAckPolicy == true) {//0000 0100 0000 0000 pTxBufHead->wFIFOCtl |= FIFOCTL_GRPACK; } //the rest of pTxBufHead->wFragCtl:FragTyp will be set later in s_vFillFragParameter() @@ -2523,7 +2485,7 @@ CMD_STATUS csMgmt_xmit(PSDevice pDevice, PSTxMgmtPacket pPacket) { //========================= // No Fragmentation //========================= - pTxBufHead->wFragCtl |= (WORD)FRAGCTL_NONFRAG; + pTxBufHead->wFragCtl |= (unsigned short)FRAGCTL_NONFRAG; //Fill FIFO,RrvTime,RTS,and CTS @@ -2539,17 +2501,17 @@ CMD_STATUS csMgmt_xmit(PSDevice pDevice, PSTxMgmtPacket pPacket) { cbReqCount = cbHeaderSize + cbMacHdLen + uPadding + cbIVlen + cbFrameBodySize; if (WLAN_GET_FC_ISWEP(pPacket->p80211Header->sA4.wFrameCtl) != 0) { - PBYTE pbyIVHead; - PBYTE pbyPayloadHead; - PBYTE pbyBSSID; + unsigned char *pbyIVHead; + unsigned char *pbyPayloadHead; + unsigned char *pbyBSSID; PSKeyItem pTransmitKey = NULL; - pbyIVHead = (PBYTE)(pbyTxBufferAddr + cbHeaderSize + cbMacHdLen + uPadding); - pbyPayloadHead = (PBYTE)(pbyTxBufferAddr + cbHeaderSize + cbMacHdLen + uPadding + cbIVlen); + pbyIVHead = (unsigned char *)(pbyTxBufferAddr + cbHeaderSize + cbMacHdLen + uPadding); + pbyPayloadHead = (unsigned char *)(pbyTxBufferAddr + cbHeaderSize + cbMacHdLen + uPadding + cbIVlen); //Fill TXKEY //Kyle: Need fix: TKIP and AES did't encryt Mnt Packet. - //s_vFillTxKey(pDevice, (PBYTE)pTxBufHead->adwTxKey, NULL); + //s_vFillTxKey(pDevice, (unsigned char *)pTxBufHead->adwTxKey, NULL); //Fill IV(ExtIV,RSNHDR) //s_vFillPrePayload(pDevice, pbyIVHead, NULL); @@ -2558,16 +2520,16 @@ CMD_STATUS csMgmt_xmit(PSDevice pDevice, PSTxMgmtPacket pPacket) { //--------------------------- //Fill MICHDR //if (pDevice->bAES) { - // s_vFillMICHDR(pDevice, (PBYTE)pMICHDR, (PBYTE)pMACHeader, (WORD)cbFrameBodySize); + // s_vFillMICHDR(pDevice, (unsigned char *)pMICHDR, (unsigned char *)pMACHeader, (unsigned short)cbFrameBodySize); //} do { if ((pDevice->eOPMode == OP_MODE_INFRASTRUCTURE) && - (pDevice->bLinkPass == TRUE)) { + (pDevice->bLinkPass == true)) { pbyBSSID = pDevice->abyBSSID; // get pairwise key - if (KeybGetTransmitKey(&(pDevice->sKey), pbyBSSID, PAIRWISE_KEY, &pTransmitKey) == FALSE) { + if (KeybGetTransmitKey(&(pDevice->sKey), pbyBSSID, PAIRWISE_KEY, &pTransmitKey) == false) { // get group key - if(KeybGetTransmitKey(&(pDevice->sKey), pbyBSSID, GROUP_KEY, &pTransmitKey) == TRUE) { + if(KeybGetTransmitKey(&(pDevice->sKey), pbyBSSID, GROUP_KEY, &pTransmitKey) == true) { DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"Get GTK.\n"); break; } @@ -2578,19 +2540,19 @@ CMD_STATUS csMgmt_xmit(PSDevice pDevice, PSTxMgmtPacket pPacket) { } // get group key pbyBSSID = pDevice->abyBroadcastAddr; - if(KeybGetTransmitKey(&(pDevice->sKey), pbyBSSID, GROUP_KEY, &pTransmitKey) == FALSE) { + if(KeybGetTransmitKey(&(pDevice->sKey), pbyBSSID, GROUP_KEY, &pTransmitKey) == false) { pTransmitKey = NULL; DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"KEY is NULL. OP Mode[%d]\n", pDevice->eOPMode); } else { DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"Get GTK.\n"); } - } while(FALSE); + } while(false); //Fill TXKEY - s_vFillTxKey(pDevice, (PBYTE)(pTxBufHead->adwTxKey), pbyIVHead, pTransmitKey, - (PBYTE)pMACHeader, (WORD)cbFrameBodySize, NULL); + s_vFillTxKey(pDevice, (unsigned char *)(pTxBufHead->adwTxKey), pbyIVHead, pTransmitKey, + (unsigned char *)pMACHeader, (unsigned short)cbFrameBodySize, NULL); memcpy(pMACHeader, pPacket->p80211Header, cbMacHdLen); - memcpy(pbyPayloadHead, ((PBYTE)(pPacket->p80211Header) + cbMacHdLen), + memcpy(pbyPayloadHead, ((unsigned char *)(pPacket->p80211Header) + cbMacHdLen), cbFrameBodySize); } else { @@ -2622,7 +2584,7 @@ CMD_STATUS csMgmt_xmit(PSDevice pDevice, PSTxMgmtPacket pPacket) { //Set TSR1 & ReqCount in TxDescHead pFrstTD->m_td1TD1.byTCR = (TCR_STP | TCR_EDP | EDMSDU); pFrstTD->pTDInfo->skb_dma = pFrstTD->pTDInfo->buf_dma; - pFrstTD->m_td1TD1.wReqCount = cpu_to_le16((WORD)(cbReqCount)); + pFrstTD->m_td1TD1.wReqCount = cpu_to_le16((unsigned short)(cbReqCount)); pFrstTD->buff_addr = cpu_to_le32(pFrstTD->pTDInfo->skb_dma); pFrstTD->pTDInfo->byFlags = 0; @@ -2630,7 +2592,7 @@ CMD_STATUS csMgmt_xmit(PSDevice pDevice, PSTxMgmtPacket pPacket) { // Disable PS MACbPSWakeup(pDevice->PortOffset); } - pDevice->bPWBitOn = FALSE; + pDevice->bPWBitOn = false; wmb(); pFrstTD->m_td0TD0.f1Owner = OWNED_BY_NIC; @@ -2661,16 +2623,16 @@ CMD_STATUS csMgmt_xmit(PSDevice pDevice, PSTxMgmtPacket pPacket) { CMD_STATUS csBeacon_xmit(PSDevice pDevice, PSTxMgmtPacket pPacket) { - BYTE byPktType; - PBYTE pbyBuffer = (PBYTE)pDevice->tx_beacon_bufs; - UINT cbFrameSize = pPacket->cbMPDULen + WLAN_FCS_LEN; - UINT cbHeaderSize = 0; - WORD wTxBufSize = sizeof(STxShortBufHead); + unsigned char byPktType; + unsigned char *pbyBuffer = (unsigned char *)pDevice->tx_beacon_bufs; + unsigned int cbFrameSize = pPacket->cbMPDULen + WLAN_FCS_LEN; + unsigned int cbHeaderSize = 0; + unsigned short wTxBufSize = sizeof(STxShortBufHead); PSTxShortBufHead pTxBufHead = (PSTxShortBufHead) pbyBuffer; PSTxDataHead_ab pTxDataHead = (PSTxDataHead_ab) (pbyBuffer + wTxBufSize); PS802_11Header pMACHeader; - WORD wCurrentRate; - WORD wLen = 0x0000; + unsigned short wCurrentRate; + unsigned short wLen = 0x0000; memset(pTxBufHead, 0, wTxBufSize); @@ -2693,17 +2655,17 @@ CMD_STATUS csBeacon_xmit(PSDevice pDevice, PSTxMgmtPacket pPacket) { //Set packet type & Get Duration if (byPktType == PK_TYPE_11A) {//0000 0000 0000 0000 - pTxDataHead->wDuration = cpu_to_le16((WORD)s_uGetDataDuration(pDevice, DATADUR_A, cbFrameSize, byPktType, - wCurrentRate, FALSE, 0, 0, 1, AUTO_FB_NONE)); + pTxDataHead->wDuration = cpu_to_le16((unsigned short)s_uGetDataDuration(pDevice, DATADUR_A, cbFrameSize, byPktType, + wCurrentRate, false, 0, 0, 1, AUTO_FB_NONE)); } else if (byPktType == PK_TYPE_11B) {//0000 0001 0000 0000 pTxBufHead->wFIFOCtl |= FIFOCTL_11B; - pTxDataHead->wDuration = cpu_to_le16((WORD)s_uGetDataDuration(pDevice, DATADUR_B, cbFrameSize, byPktType, - wCurrentRate, FALSE, 0, 0, 1, AUTO_FB_NONE)); + pTxDataHead->wDuration = cpu_to_le16((unsigned short)s_uGetDataDuration(pDevice, DATADUR_B, cbFrameSize, byPktType, + wCurrentRate, false, 0, 0, 1, AUTO_FB_NONE)); } BBvCaculateParameter(pDevice, cbFrameSize, wCurrentRate, byPktType, - (PWORD)&(wLen), (PBYTE)&(pTxDataHead->byServiceField), (PBYTE)&(pTxDataHead->bySignalField) + (unsigned short *)&(wLen), (unsigned char *)&(pTxDataHead->byServiceField), (unsigned char *)&(pTxDataHead->bySignalField) ); pTxDataHead->wTransmitLength = cpu_to_le16(wLen); //Get TimeStampOff @@ -2736,41 +2698,38 @@ CMD_STATUS csBeacon_xmit(PSDevice pDevice, PSTxMgmtPacket pPacket) { -UINT +unsigned int cbGetFragCount ( PSDevice pDevice, PSKeyItem pTransmitKey, - UINT cbFrameBodySize, + unsigned int cbFrameBodySize, PSEthernetHeader psEthHeader ) { - UINT cbMACHdLen; - UINT cbFrameSize; - UINT cbFragmentSize; //Hdr+(IV)+payoad+(MIC)+(ICV)+FCS - UINT cbFragPayloadSize; - UINT cbLastFragPayloadSize; - UINT cbIVlen = 0; - UINT cbICVlen = 0; - UINT cbMIClen = 0; - UINT cbFCSlen = 4; - UINT uMACfragNum = 1; - BOOL bNeedACK; + unsigned int cbMACHdLen; + unsigned int cbFrameSize; + unsigned int cbFragmentSize; //Hdr+(IV)+payoad+(MIC)+(ICV)+FCS + unsigned int cbFragPayloadSize; + unsigned int cbLastFragPayloadSize; + unsigned int cbIVlen = 0; + unsigned int cbICVlen = 0; + unsigned int cbMIClen = 0; + unsigned int cbFCSlen = 4; + unsigned int uMACfragNum = 1; + bool bNeedACK; if ((pDevice->eOPMode == OP_MODE_ADHOC) || (pDevice->eOPMode == OP_MODE_AP)) { - if (IS_MULTICAST_ADDRESS(&(psEthHeader->abyDstAddr[0])) || - IS_BROADCAST_ADDRESS(&(psEthHeader->abyDstAddr[0]))) { - bNeedACK = FALSE; - } - else { - bNeedACK = TRUE; - } + if (is_multicast_ether_addr(&(psEthHeader->abyDstAddr[0]))) + bNeedACK = false; + else + bNeedACK = true; } else { // MSDUs in Infra mode always need ACK - bNeedACK = TRUE; + bNeedACK = true; } if (pDevice->bLongHeader) @@ -2779,7 +2738,7 @@ cbGetFragCount ( cbMACHdLen = WLAN_HDR_ADDR3_LEN; - if (pDevice->bEncryptionEnable == TRUE) { + if (pDevice->bEncryptionEnable == true) { if (pTransmitKey == NULL) { if ((pDevice->eEncryptionStatus == Ndis802_11Encryption1Enabled) || @@ -2809,11 +2768,11 @@ cbGetFragCount ( cbFrameSize = cbMACHdLen + cbIVlen + (cbFrameBodySize + cbMIClen) + cbICVlen + cbFCSlen; - if ((cbFrameSize > pDevice->wFragmentationThreshold) && (bNeedACK == TRUE)) { + if ((cbFrameSize > pDevice->wFragmentationThreshold) && (bNeedACK == true)) { // Fragmentation cbFragmentSize = pDevice->wFragmentationThreshold; cbFragPayloadSize = cbFragmentSize - cbMACHdLen - cbIVlen - cbICVlen - cbFCSlen; - uMACfragNum = (WORD) ((cbFrameBodySize + cbMIClen) / cbFragPayloadSize); + uMACfragNum = (unsigned short) ((cbFrameBodySize + cbMIClen) / cbFragPayloadSize); cbLastFragPayloadSize = (cbFrameBodySize + cbMIClen) % cbFragPayloadSize; if (cbLastFragPayloadSize == 0) { cbLastFragPayloadSize = cbFragPayloadSize; @@ -2826,51 +2785,51 @@ cbGetFragCount ( void -vDMA0_tx_80211(PSDevice pDevice, struct sk_buff *skb, PBYTE pbMPDU, UINT cbMPDULen) { +vDMA0_tx_80211(PSDevice pDevice, struct sk_buff *skb, unsigned char *pbMPDU, unsigned int cbMPDULen) { PSTxDesc pFrstTD; - BYTE byPktType; - PBYTE pbyTxBufferAddr; + unsigned char byPktType; + unsigned char *pbyTxBufferAddr; void * pvRTS; void * pvCTS; void * pvTxDataHd; - UINT uDuration; - UINT cbReqCount; + unsigned int uDuration; + unsigned int cbReqCount; PS802_11Header pMACHeader; - UINT cbHeaderSize; - UINT cbFrameBodySize; - BOOL bNeedACK; - BOOL bIsPSPOLL = FALSE; + unsigned int cbHeaderSize; + unsigned int cbFrameBodySize; + bool bNeedACK; + bool bIsPSPOLL = false; PSTxBufHead pTxBufHead; - UINT cbFrameSize; - UINT cbIVlen = 0; - UINT cbICVlen = 0; - UINT cbMIClen = 0; - UINT cbFCSlen = 4; - UINT uPadding = 0; - UINT cbMICHDR = 0; - UINT uLength = 0; - DWORD dwMICKey0, dwMICKey1; - DWORD dwMIC_Priority; - PDWORD pdwMIC_L; - PDWORD pdwMIC_R; - WORD wTxBufSize; - UINT cbMacHdLen; + unsigned int cbFrameSize; + unsigned int cbIVlen = 0; + unsigned int cbICVlen = 0; + unsigned int cbMIClen = 0; + unsigned int cbFCSlen = 4; + unsigned int uPadding = 0; + unsigned int cbMICHDR = 0; + unsigned int uLength = 0; + unsigned long dwMICKey0, dwMICKey1; + unsigned long dwMIC_Priority; + unsigned long *pdwMIC_L; + unsigned long *pdwMIC_R; + unsigned short wTxBufSize; + unsigned int cbMacHdLen; SEthernetHeader sEthHeader; void * pvRrvTime; void * pMICHDR; PSMgmtObject pMgmt = pDevice->pMgmt; - WORD wCurrentRate = RATE_1M; + unsigned short wCurrentRate = RATE_1M; PUWLAN_80211HDR p80211Header; - UINT uNodeIndex = 0; - BOOL bNodeExist = FALSE; + unsigned int uNodeIndex = 0; + bool bNodeExist = false; SKeyItem STempKey; PSKeyItem pTransmitKey = NULL; - PBYTE pbyIVHead; - PBYTE pbyPayloadHead; - PBYTE pbyMacHdr; + unsigned char *pbyIVHead; + unsigned char *pbyPayloadHead; + unsigned char *pbyMacHdr; - UINT cbExtSuppRate = 0; + unsigned int cbExtSuppRate = 0; // PWLAN_IE pItem; @@ -2886,7 +2845,7 @@ vDMA0_tx_80211(PSDevice pDevice, struct sk_buff *skb, PBYTE pbMPDU, UINT cbMPDU pFrstTD = pDevice->apCurrTD[TYPE_TXDMA0]; - pbyTxBufferAddr = (PBYTE)pFrstTD->pTDInfo->buf; + pbyTxBufferAddr = (unsigned char *)pFrstTD->pTDInfo->buf; pTxBufHead = (PSTxBufHead) pbyTxBufferAddr; wTxBufSize = sizeof(STxBufHead); memset(pTxBufHead, 0, wTxBufSize); @@ -2938,20 +2897,19 @@ vDMA0_tx_80211(PSDevice pDevice, struct sk_buff *skb, PBYTE pbMPDU, UINT cbMPDU pTxBufHead->wTimeStamp = cpu_to_le16(DEFAULT_MGN_LIFETIME_RES_64us); - if (IS_MULTICAST_ADDRESS(&(p80211Header->sA3.abyAddr1[0])) || - IS_BROADCAST_ADDRESS(&(p80211Header->sA3.abyAddr1[0]))) { - bNeedACK = FALSE; + if (is_multicast_ether_addr(&(p80211Header->sA3.abyAddr1[0]))) { + bNeedACK = false; if (pDevice->bEnableHostWEP) { uNodeIndex = 0; - bNodeExist = TRUE; + bNodeExist = true; }; } else { if (pDevice->bEnableHostWEP) { - if (BSSDBbIsSTAInNodeDB(pDevice->pMgmt, (PBYTE)(p80211Header->sA3.abyAddr1), &uNodeIndex)) - bNodeExist = TRUE; + if (BSSDBbIsSTAInNodeDB(pDevice->pMgmt, (unsigned char *)(p80211Header->sA3.abyAddr1), &uNodeIndex)) + bNodeExist = true; }; - bNeedACK = TRUE; + bNeedACK = true; pTxBufHead->wFIFOCtl |= FIFOCTL_NEEDACK; }; @@ -2964,7 +2922,7 @@ vDMA0_tx_80211(PSDevice pDevice, struct sk_buff *skb, PBYTE pbMPDU, UINT cbMPDU // probe-response don't retry //if ((p80211Header->sA4.wFrameCtl & TYPE_SUBTYPE_MASK) == TYPE_MGMT_PROBE_RSP) { - // bNeedACK = FALSE; + // bNeedACK = false; // pTxBufHead->wFIFOCtl &= (~FIFOCTL_NEEDACK); //} } @@ -2972,7 +2930,7 @@ vDMA0_tx_80211(PSDevice pDevice, struct sk_buff *skb, PBYTE pbMPDU, UINT cbMPDU pTxBufHead->wFIFOCtl |= (FIFOCTL_GENINT | FIFOCTL_ISDMA0); if ((p80211Header->sA4.wFrameCtl & TYPE_SUBTYPE_MASK) == TYPE_CTL_PSPOLL) { - bIsPSPOLL = TRUE; + bIsPSPOLL = true; cbMacHdLen = WLAN_HDR_ADDR2_LEN; } else { cbMacHdLen = WLAN_HDR_ADDR3_LEN; @@ -2996,12 +2954,12 @@ vDMA0_tx_80211(PSDevice pDevice, struct sk_buff *skb, PBYTE pbMPDU, UINT cbMPDU //Set FRAGCTL_MACHDCNT - pTxBufHead->wFragCtl |= cpu_to_le16((WORD)cbMacHdLen << 10); + pTxBufHead->wFragCtl |= cpu_to_le16((unsigned short)cbMacHdLen << 10); // Notes: // Although spec says MMPDU can be fragmented; In most case, // no one will send a MMPDU under fragmentation. With RTS may occur. - pDevice->bAES = FALSE; //Set FRAGCTL_WEPTYP + pDevice->bAES = false; //Set FRAGCTL_WEPTYP if (WLAN_GET_FC_ISWEP(p80211Header->sA4.wFrameCtl) != 0) { @@ -3024,7 +2982,7 @@ vDMA0_tx_80211(PSDevice pDevice, struct sk_buff *skb, PBYTE pbMPDU, UINT cbMPDU cbICVlen = 8;//MIC cbMICHDR = sizeof(SMICHDRHead); pTxBufHead->wFragCtl |= FRAGCTL_AES; - pDevice->bAES = TRUE; + pDevice->bAES = true; } //MAC Header should be padding 0 to DW alignment. uPadding = 4 - (cbMacHdLen%4); @@ -3034,7 +2992,7 @@ vDMA0_tx_80211(PSDevice pDevice, struct sk_buff *skb, PBYTE pbMPDU, UINT cbMPDU cbFrameSize = cbMacHdLen + cbFrameBodySize + cbIVlen + cbMIClen + cbICVlen + cbFCSlen + cbExtSuppRate; //Set FIFOCTL_GrpAckPolicy - if (pDevice->bGrpAckPolicy == TRUE) {//0000 0100 0000 0000 + if (pDevice->bGrpAckPolicy == true) {//0000 0100 0000 0000 pTxBufHead->wFIFOCtl |= FIFOCTL_GRPACK; } //the rest of pTxBufHead->wFragCtl:FragTyp will be set later in s_vFillFragParameter() @@ -3067,7 +3025,7 @@ vDMA0_tx_80211(PSDevice pDevice, struct sk_buff *skb, PBYTE pbMPDU, UINT cbMPDU //========================= // No Fragmentation //========================= - pTxBufHead->wFragCtl |= (WORD)FRAGCTL_NONFRAG; + pTxBufHead->wFragCtl |= (unsigned short)FRAGCTL_NONFRAG; //Fill FIFO,RrvTime,RTS,and CTS @@ -3082,9 +3040,9 @@ vDMA0_tx_80211(PSDevice pDevice, struct sk_buff *skb, PBYTE pbMPDU, UINT cbMPDU cbReqCount = cbHeaderSize + cbMacHdLen + uPadding + cbIVlen + (cbFrameBodySize + cbMIClen) + cbExtSuppRate; - pbyMacHdr = (PBYTE)(pbyTxBufferAddr + cbHeaderSize); - pbyPayloadHead = (PBYTE)(pbyMacHdr + cbMacHdLen + uPadding + cbIVlen); - pbyIVHead = (PBYTE)(pbyMacHdr + cbMacHdLen + uPadding); + pbyMacHdr = (unsigned char *)(pbyTxBufferAddr + cbHeaderSize); + pbyPayloadHead = (unsigned char *)(pbyMacHdr + cbMacHdLen + uPadding + cbIVlen); + pbyIVHead = (unsigned char *)(pbyMacHdr + cbMacHdLen + uPadding); // Copy the Packet into a tx Buffer memcpy(pbyMacHdr, pbMPDU, cbMacHdLen); @@ -3127,30 +3085,30 @@ vDMA0_tx_80211(PSDevice pDevice, struct sk_buff *skb, PBYTE pbMPDU, UINT cbMPDU if ((pTransmitKey != NULL) && (pTransmitKey->byCipherSuite == KEY_CTL_TKIP)) { - dwMICKey0 = *(PDWORD)(&pTransmitKey->abyKey[16]); - dwMICKey1 = *(PDWORD)(&pTransmitKey->abyKey[20]); + dwMICKey0 = *(unsigned long *)(&pTransmitKey->abyKey[16]); + dwMICKey1 = *(unsigned long *)(&pTransmitKey->abyKey[20]); // DO Software Michael MIC_vInit(dwMICKey0, dwMICKey1); - MIC_vAppend((PBYTE)&(sEthHeader.abyDstAddr[0]), 12); + MIC_vAppend((unsigned char *)&(sEthHeader.abyDstAddr[0]), 12); dwMIC_Priority = 0; - MIC_vAppend((PBYTE)&dwMIC_Priority, 4); + MIC_vAppend((unsigned char *)&dwMIC_Priority, 4); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"DMA0_tx_8021:MIC KEY: %lX, %lX\n", dwMICKey0, dwMICKey1); uLength = cbHeaderSize + cbMacHdLen + uPadding + cbIVlen; MIC_vAppend((pbyTxBufferAddr + uLength), cbFrameBodySize); - pdwMIC_L = (PDWORD)(pbyTxBufferAddr + uLength + cbFrameBodySize); - pdwMIC_R = (PDWORD)(pbyTxBufferAddr + uLength + cbFrameBodySize + 4); + pdwMIC_L = (unsigned long *)(pbyTxBufferAddr + uLength + cbFrameBodySize); + pdwMIC_R = (unsigned long *)(pbyTxBufferAddr + uLength + cbFrameBodySize + 4); MIC_vGetMIC(pdwMIC_L, pdwMIC_R); MIC_vUnInit(); - if (pDevice->bTxMICFail == TRUE) { + if (pDevice->bTxMICFail == true) { *pdwMIC_L = 0; *pdwMIC_R = 0; - pDevice->bTxMICFail = FALSE; + pDevice->bTxMICFail = false; } DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"uLength: %d, %d\n", uLength, cbFrameBodySize); @@ -3160,8 +3118,8 @@ vDMA0_tx_80211(PSDevice pDevice, struct sk_buff *skb, PBYTE pbMPDU, UINT cbMPDU } - s_vFillTxKey(pDevice, (PBYTE)(pTxBufHead->adwTxKey), pbyIVHead, pTransmitKey, - pbyMacHdr, (WORD)cbFrameBodySize, (PBYTE)pMICHDR); + s_vFillTxKey(pDevice, (unsigned char *)(pTxBufHead->adwTxKey), pbyIVHead, pTransmitKey, + pbyMacHdr, (unsigned short)cbFrameBodySize, (unsigned char *)pMICHDR); if (pDevice->bEnableHostWEP) { pMgmt->sNodeDBTable[uNodeIndex].dwTSC47_16 = pTransmitKey->dwTSC47_16; @@ -3169,7 +3127,7 @@ vDMA0_tx_80211(PSDevice pDevice, struct sk_buff *skb, PBYTE pbMPDU, UINT cbMPDU } if ((pDevice->byLocalID <= REV_ID_VT3253_A1)) { - s_vSWencryption(pDevice, pTransmitKey, pbyPayloadHead, (WORD)(cbFrameBodySize + cbMIClen)); + s_vSWencryption(pDevice, pTransmitKey, pbyPayloadHead, (unsigned short)(cbFrameBodySize + cbMIClen)); } } @@ -3208,7 +3166,7 @@ vDMA0_tx_80211(PSDevice pDevice, struct sk_buff *skb, PBYTE pbMPDU, UINT cbMPDU // Disable PS MACbPSWakeup(pDevice->PortOffset); } - pDevice->bPWBitOn = FALSE; + pDevice->bPWBitOn = false; wmb(); pFrstTD->m_td0TD0.f1Owner = OWNED_BY_NIC; diff --git a/drivers/staging/vt6655/rxtx.h b/drivers/staging/vt6655/rxtx.h index b008fc23adb..fa827b828a3 100644 --- a/drivers/staging/vt6655/rxtx.h +++ b/drivers/staging/vt6655/rxtx.h @@ -40,67 +40,47 @@ /*--------------------- Export Functions --------------------------*/ /* -void vGenerateMACHeader( - PSDevice pDevice, - DWORD dwTxBufferAddr, - PBYTE pbySkbData, - UINT cbPacketSize, - BOOL bDMA0Used, - PUINT pcbHeadSize, - PUINT pcbAppendPayload - ); - -void vProcessRxMACHeader ( - PSDevice pDevice, - DWORD dwRxBufferAddr, - UINT cbPacketSize, - BOOL bIsWEP, - PUINT pcbHeadSize - ); +void +vGenerateMACHeader(PSDevice pDevice, unsigned long dwTxBufferAddr, unsigned char *pbySkbData, + unsigned int cbPacketSize, bool bDMA0Used, unsigned int *pcbHeadSize, + unsigned int *pcbAppendPayload); + +void +vProcessRxMACHeader(PSDevice pDevice, unsigned long dwRxBufferAddr, unsigned int cbPacketSize, + bool bIsWEP, unsigned int *pcbHeadSize); */ void vGenerateMACHeader ( PSDevice pDevice, - PBYTE pbyBufferAddr, - WORD wDuration, + unsigned char *pbyBufferAddr, + unsigned short wDuration, PSEthernetHeader psEthHeader, - BOOL bNeedEncrypt, - WORD wFragType, - UINT uDMAIdx, - UINT uFragIdx + bool bNeedEncrypt, + unsigned short wFragType, + unsigned int uDMAIdx, + unsigned int uFragIdx ); -UINT +unsigned int cbGetFragCount( PSDevice pDevice, PSKeyItem pTransmitKey, - UINT cbFrameBodySize, + unsigned int cbFrameBodySize, PSEthernetHeader psEthHeader ); void -vGenerateFIFOHeader ( - PSDevice pDevice, - BYTE byPktTyp, - PBYTE pbyTxBufferAddr, - BOOL bNeedEncrypt, - UINT cbPayloadSize, - UINT uDMAIdx, - PSTxDesc pHeadTD, - PSEthernetHeader psEthHeader, - PBYTE pPacket, - PSKeyItem pTransmitKey, - UINT uNodeIndex, - PUINT puMACfragNum, - PUINT pcbHeaderSize - ); +vGenerateFIFOHeader(PSDevice pDevice, unsigned char byPktTyp, unsigned char *pbyTxBufferAddr, + bool bNeedEncrypt, unsigned int cbPayloadSize, unsigned int uDMAIdx, PSTxDesc pHeadTD, + PSEthernetHeader psEthHeader, unsigned char *pPacket, PSKeyItem pTransmitKey, + unsigned int uNodeIndex, unsigned int *puMACfragNum, unsigned int *pcbHeaderSize); -void vDMA0_tx_80211(PSDevice pDevice, struct sk_buff *skb, PBYTE pbMPDU, UINT cbMPDULen); +void vDMA0_tx_80211(PSDevice pDevice, struct sk_buff *skb, unsigned char *pbMPDU, unsigned int cbMPDULen); CMD_STATUS csMgmt_xmit(PSDevice pDevice, PSTxMgmtPacket pPacket); CMD_STATUS csBeacon_xmit(PSDevice pDevice, PSTxMgmtPacket pPacket); diff --git a/drivers/staging/vt6655/srom.c b/drivers/staging/vt6655/srom.c index 418575fdc2c..6a0a232d1a0 100644 --- a/drivers/staging/vt6655/srom.c +++ b/drivers/staging/vt6655/srom.c @@ -76,12 +76,12 @@ * Return Value: data read * */ -BYTE SROMbyReadEmbedded(DWORD_PTR dwIoBase, BYTE byContntOffset) +unsigned char SROMbyReadEmbedded(unsigned long dwIoBase, unsigned char byContntOffset) { - WORD wDelay, wNoACK; - BYTE byWait; - BYTE byData; - BYTE byOrg; + unsigned short wDelay, wNoACK; + unsigned char byWait; + unsigned char byData; + unsigned char byOrg; byData = 0xFF; VNSvInPortB(dwIoBase + MAC_REG_I2MCFG, &byOrg); @@ -122,15 +122,15 @@ BYTE SROMbyReadEmbedded(DWORD_PTR dwIoBase, BYTE byContntOffset) * Out: * none * - * Return Value: TRUE if succeeded; FALSE if failed. + * Return Value: true if succeeded; false if failed. * */ -BOOL SROMbWriteEmbedded(DWORD_PTR dwIoBase, BYTE byContntOffset, BYTE byData) +bool SROMbWriteEmbedded(unsigned long dwIoBase, unsigned char byContntOffset, unsigned char byData) { - WORD wDelay, wNoACK; - BYTE byWait; + unsigned short wDelay, wNoACK; + unsigned char byWait; - BYTE byOrg; + unsigned char byOrg; VNSvInPortB(dwIoBase + MAC_REG_I2MCFG, &byOrg); /* turn off hardware retry for getting NACK */ @@ -157,10 +157,10 @@ BOOL SROMbWriteEmbedded(DWORD_PTR dwIoBase, BYTE byContntOffset, BYTE byData) } if (wNoACK == W_MAX_I2CRETRY) { VNSvOutPortB(dwIoBase + MAC_REG_I2MCFG, byOrg); - return FALSE; + return false; } VNSvOutPortB(dwIoBase + MAC_REG_I2MCFG, byOrg); - return TRUE; + return true; } @@ -178,12 +178,12 @@ BOOL SROMbWriteEmbedded(DWORD_PTR dwIoBase, BYTE byContntOffset, BYTE byData) * Return Value: none * */ -void SROMvRegBitsOn(DWORD_PTR dwIoBase, BYTE byContntOffset, BYTE byBits) +void SROMvRegBitsOn(unsigned long dwIoBase, unsigned char byContntOffset, unsigned char byBits) { - BYTE byOrgData; + unsigned char byOrgData; byOrgData = SROMbyReadEmbedded(dwIoBase, byContntOffset); - SROMbWriteEmbedded(dwIoBase, byContntOffset,(BYTE)(byOrgData | byBits)); + SROMbWriteEmbedded(dwIoBase, byContntOffset,(unsigned char)(byOrgData | byBits)); } @@ -199,12 +199,12 @@ void SROMvRegBitsOn(DWORD_PTR dwIoBase, BYTE byContntOffset, BYTE byBits) * none * */ -void SROMvRegBitsOff(DWORD_PTR dwIoBase, BYTE byContntOffset, BYTE byBits) +void SROMvRegBitsOff(unsigned long dwIoBase, unsigned char byContntOffset, unsigned char byBits) { - BYTE byOrgData; + unsigned char byOrgData; byOrgData = SROMbyReadEmbedded(dwIoBase, byContntOffset); - SROMbWriteEmbedded(dwIoBase, byContntOffset,(BYTE)(byOrgData & (~byBits))); + SROMbWriteEmbedded(dwIoBase, byContntOffset,(unsigned char)(byOrgData & (~byBits))); } @@ -219,12 +219,12 @@ void SROMvRegBitsOff(DWORD_PTR dwIoBase, BYTE byContntOffset, BYTE byBits) * Out: * none * - * Return Value: TRUE if all test bits on; otherwise FALSE + * Return Value: true if all test bits on; otherwise false * */ -BOOL SROMbIsRegBitsOn(DWORD_PTR dwIoBase, BYTE byContntOffset, BYTE byTestBits) +bool SROMbIsRegBitsOn(unsigned long dwIoBase, unsigned char byContntOffset, unsigned char byTestBits) { - BYTE byOrgData; + unsigned char byOrgData; byOrgData = SROMbyReadEmbedded(dwIoBase, byContntOffset); return (byOrgData & byTestBits) == byTestBits; @@ -242,12 +242,12 @@ BOOL SROMbIsRegBitsOn(DWORD_PTR dwIoBase, BYTE byContntOffset, BYTE byTestBits) * Out: * none * - * Return Value: TRUE if all test bits off; otherwise FALSE + * Return Value: true if all test bits off; otherwise false * */ -BOOL SROMbIsRegBitsOff(DWORD_PTR dwIoBase, BYTE byContntOffset, BYTE byTestBits) +bool SROMbIsRegBitsOff(unsigned long dwIoBase, unsigned char byContntOffset, unsigned char byTestBits) { - BYTE byOrgData; + unsigned char byOrgData; byOrgData = SROMbyReadEmbedded(dwIoBase, byContntOffset); return !(byOrgData & byTestBits); @@ -266,13 +266,13 @@ BOOL SROMbIsRegBitsOff(DWORD_PTR dwIoBase, BYTE byContntOffset, BYTE byTestBits) * Return Value: none * */ -void SROMvReadAllContents(DWORD_PTR dwIoBase, PBYTE pbyEepromRegs) +void SROMvReadAllContents(unsigned long dwIoBase, unsigned char *pbyEepromRegs) { int ii; /* ii = Rom Address */ for (ii = 0; ii < EEP_MAX_CONTEXT_SIZE; ii++) { - *pbyEepromRegs = SROMbyReadEmbedded(dwIoBase,(BYTE) ii); + *pbyEepromRegs = SROMbyReadEmbedded(dwIoBase,(unsigned char) ii); pbyEepromRegs++; } } @@ -291,13 +291,13 @@ void SROMvReadAllContents(DWORD_PTR dwIoBase, PBYTE pbyEepromRegs) * Return Value: none * */ -void SROMvWriteAllContents(DWORD_PTR dwIoBase, PBYTE pbyEepromRegs) +void SROMvWriteAllContents(unsigned long dwIoBase, unsigned char *pbyEepromRegs) { int ii; /* ii = Rom Address */ for (ii = 0; ii < EEP_MAX_CONTEXT_SIZE; ii++) { - SROMbWriteEmbedded(dwIoBase,(BYTE) ii, *pbyEepromRegs); + SROMbWriteEmbedded(dwIoBase,(unsigned char) ii, *pbyEepromRegs); pbyEepromRegs++; } } @@ -315,9 +315,9 @@ void SROMvWriteAllContents(DWORD_PTR dwIoBase, PBYTE pbyEepromRegs) * Return Value: none * */ -void SROMvReadEtherAddress(DWORD_PTR dwIoBase, PBYTE pbyEtherAddress) +void SROMvReadEtherAddress(unsigned long dwIoBase, unsigned char *pbyEtherAddress) { - BYTE ii; + unsigned char ii; /* ii = Rom Address */ for (ii = 0; ii < ETH_ALEN; ii++) { @@ -340,9 +340,9 @@ void SROMvReadEtherAddress(DWORD_PTR dwIoBase, PBYTE pbyEtherAddress) * Return Value: none * */ -void SROMvWriteEtherAddress(DWORD_PTR dwIoBase, PBYTE pbyEtherAddress) +void SROMvWriteEtherAddress(unsigned long dwIoBase, unsigned char *pbyEtherAddress) { - BYTE ii; + unsigned char ii; /* ii = Rom Address */ for (ii = 0; ii < ETH_ALEN; ii++) { @@ -364,11 +364,11 @@ void SROMvWriteEtherAddress(DWORD_PTR dwIoBase, PBYTE pbyEtherAddress) * Return Value: none * */ -void SROMvReadSubSysVenId(DWORD_PTR dwIoBase, PDWORD pdwSubSysVenId) +void SROMvReadSubSysVenId(unsigned long dwIoBase, unsigned long *pdwSubSysVenId) { - PBYTE pbyData; + unsigned char *pbyData; - pbyData = (PBYTE)pdwSubSysVenId; + pbyData = (unsigned char *)pdwSubSysVenId; /* sub vendor */ *pbyData = SROMbyReadEmbedded(dwIoBase, 6); *(pbyData+1) = SROMbyReadEmbedded(dwIoBase, 7); @@ -386,15 +386,15 @@ void SROMvReadSubSysVenId(DWORD_PTR dwIoBase, PDWORD pdwSubSysVenId) * Out: * none * - * Return Value: TRUE if success; otherwise FALSE + * Return Value: true if success; otherwise false * */ -BOOL SROMbAutoLoad(DWORD_PTR dwIoBase) +bool SROMbAutoLoad(unsigned long dwIoBase) { - BYTE byWait; + unsigned char byWait; int ii; - BYTE byOrg; + unsigned char byOrg; VNSvInPortB(dwIoBase + MAC_REG_I2MCFG, &byOrg); /* turn on hardware retry */ @@ -413,8 +413,8 @@ BOOL SROMbAutoLoad(DWORD_PTR dwIoBase) VNSvOutPortB(dwIoBase + MAC_REG_I2MCFG, byOrg); if (ii == EEP_MAX_CONTEXT_SIZE) - return FALSE; - return TRUE; + return false; + return true; } diff --git a/drivers/staging/vt6655/srom.h b/drivers/staging/vt6655/srom.h index dbb3f5efe97..4c261dac01b 100644 --- a/drivers/staging/vt6655/srom.h +++ b/drivers/staging/vt6655/srom.h @@ -97,34 +97,34 @@ // 2048 bits = 256 bytes = 128 words // typedef struct tagSSromReg { - BYTE abyPAR[6]; // 0x00 (WORD) - - WORD wSUB_VID; // 0x03 (WORD) - WORD wSUB_SID; - - BYTE byBCFG0; // 0x05 (WORD) - BYTE byBCFG1; - - BYTE byFCR0; // 0x06 (WORD) - BYTE byFCR1; - BYTE byPMC0; // 0x07 (WORD) - BYTE byPMC1; - BYTE byMAXLAT; // 0x08 (WORD) - BYTE byMINGNT; - BYTE byCFG0; // 0x09 (WORD) - BYTE byCFG1; - WORD wCISPTR; // 0x0A (WORD) - WORD wRsv0; // 0x0B (WORD) - WORD wRsv1; // 0x0C (WORD) - BYTE byBBPAIR; // 0x0D (WORD) - BYTE byRFTYPE; - BYTE byMinChannel; // 0x0E (WORD) - BYTE byMaxChannel; - BYTE bySignature; // 0x0F (WORD) - BYTE byCheckSum; - - BYTE abyReserved0[96]; // 0x10 (WORD) - BYTE abyCIS[128]; // 0x80 (WORD) + unsigned char abyPAR[6]; // 0x00 (unsigned short) + + unsigned short wSUB_VID; // 0x03 (unsigned short) + unsigned short wSUB_SID; + + unsigned char byBCFG0; // 0x05 (unsigned short) + unsigned char byBCFG1; + + unsigned char byFCR0; // 0x06 (unsigned short) + unsigned char byFCR1; + unsigned char byPMC0; // 0x07 (unsigned short) + unsigned char byPMC1; + unsigned char byMAXLAT; // 0x08 (unsigned short) + unsigned char byMINGNT; + unsigned char byCFG0; // 0x09 (unsigned short) + unsigned char byCFG1; + unsigned short wCISPTR; // 0x0A (unsigned short) + unsigned short wRsv0; // 0x0B (unsigned short) + unsigned short wRsv1; // 0x0C (unsigned short) + unsigned char byBBPAIR; // 0x0D (unsigned short) + unsigned char byRFTYPE; + unsigned char byMinChannel; // 0x0E (unsigned short) + unsigned char byMaxChannel; + unsigned char bySignature; // 0x0F (unsigned short) + unsigned char byCheckSum; + + unsigned char abyReserved0[96]; // 0x10 (unsigned short) + unsigned char abyCIS[128]; // 0x80 (unsigned short) } SSromReg, *PSSromReg; /*--------------------- Export Macros ------------------------------*/ @@ -135,23 +135,23 @@ typedef struct tagSSromReg { /*--------------------- Export Functions --------------------------*/ -BYTE SROMbyReadEmbedded(DWORD_PTR dwIoBase, BYTE byContntOffset); -BOOL SROMbWriteEmbedded(DWORD_PTR dwIoBase, BYTE byContntOffset, BYTE byData); +unsigned char SROMbyReadEmbedded(unsigned long dwIoBase, unsigned char byContntOffset); +bool SROMbWriteEmbedded(unsigned long dwIoBase, unsigned char byContntOffset, unsigned char byData); -void SROMvRegBitsOn(DWORD_PTR dwIoBase, BYTE byContntOffset, BYTE byBits); -void SROMvRegBitsOff(DWORD_PTR dwIoBase, BYTE byContntOffset, BYTE byBits); +void SROMvRegBitsOn(unsigned long dwIoBase, unsigned char byContntOffset, unsigned char byBits); +void SROMvRegBitsOff(unsigned long dwIoBase, unsigned char byContntOffset, unsigned char byBits); -BOOL SROMbIsRegBitsOn(DWORD_PTR dwIoBase, BYTE byContntOffset, BYTE byTestBits); -BOOL SROMbIsRegBitsOff(DWORD_PTR dwIoBase, BYTE byContntOffset, BYTE byTestBits); +bool SROMbIsRegBitsOn(unsigned long dwIoBase, unsigned char byContntOffset, unsigned char byTestBits); +bool SROMbIsRegBitsOff(unsigned long dwIoBase, unsigned char byContntOffset, unsigned char byTestBits); -void SROMvReadAllContents(DWORD_PTR dwIoBase, PBYTE pbyEepromRegs); -void SROMvWriteAllContents(DWORD_PTR dwIoBase, PBYTE pbyEepromRegs); +void SROMvReadAllContents(unsigned long dwIoBase, unsigned char *pbyEepromRegs); +void SROMvWriteAllContents(unsigned long dwIoBase, unsigned char *pbyEepromRegs); -void SROMvReadEtherAddress(DWORD_PTR dwIoBase, PBYTE pbyEtherAddress); -void SROMvWriteEtherAddress(DWORD_PTR dwIoBase, PBYTE pbyEtherAddress); +void SROMvReadEtherAddress(unsigned long dwIoBase, unsigned char *pbyEtherAddress); +void SROMvWriteEtherAddress(unsigned long dwIoBase, unsigned char *pbyEtherAddress); -void SROMvReadSubSysVenId(DWORD_PTR dwIoBase, PDWORD pdwSubSysVenId); +void SROMvReadSubSysVenId(unsigned long dwIoBase, unsigned long *pdwSubSysVenId); -BOOL SROMbAutoLoad (DWORD_PTR dwIoBase); +bool SROMbAutoLoad (unsigned long dwIoBase); #endif // __EEPROM_H__ diff --git a/drivers/staging/vt6655/tcrc.c b/drivers/staging/vt6655/tcrc.c index 5f0c74763f8..f9c28bf8a6a 100644 --- a/drivers/staging/vt6655/tcrc.c +++ b/drivers/staging/vt6655/tcrc.c @@ -42,7 +42,7 @@ /*--------------------- Static Variables --------------------------*/ // 32-bit CRC table -static const DWORD s_adwCrc32Table[256] = { +static const unsigned long s_adwCrc32Table[256] = { 0x00000000L, 0x77073096L, 0xEE0E612CL, 0x990951BAL, 0x076DC419L, 0x706AF48FL, 0xE963A535L, 0x9E6495A3L, 0x0EDB8832L, 0x79DCB8A4L, 0xE0D5E91EL, 0x97D2D988L, @@ -132,13 +132,13 @@ static const DWORD s_adwCrc32Table[256] = { * Return Value: CRC-32 * -*/ -DWORD CRCdwCrc32 (PBYTE pbyData, UINT cbByte, DWORD dwCrcSeed) +unsigned long CRCdwCrc32 (unsigned char *pbyData, unsigned int cbByte, unsigned long dwCrcSeed) { - DWORD dwCrc; + unsigned long dwCrc; dwCrc = dwCrcSeed; while (cbByte--) { - dwCrc = s_adwCrc32Table[(BYTE)((dwCrc ^ (*pbyData)) & 0xFF)] ^ (dwCrc >> 8); + dwCrc = s_adwCrc32Table[(unsigned char)((dwCrc ^ (*pbyData)) & 0xFF)] ^ (dwCrc >> 8); pbyData++; } @@ -164,7 +164,7 @@ DWORD CRCdwCrc32 (PBYTE pbyData, UINT cbByte, DWORD dwCrcSeed) * Return Value: CRC-32 * -*/ -DWORD CRCdwGetCrc32 (PBYTE pbyData, UINT cbByte) +unsigned long CRCdwGetCrc32 (unsigned char *pbyData, unsigned int cbByte) { return ~CRCdwCrc32(pbyData, cbByte, 0xFFFFFFFFL); } @@ -190,7 +190,7 @@ DWORD CRCdwGetCrc32 (PBYTE pbyData, UINT cbByte) * Return Value: CRC-32 * -*/ -DWORD CRCdwGetCrc32Ex(PBYTE pbyData, UINT cbByte, DWORD dwPreCRC) +unsigned long CRCdwGetCrc32Ex(unsigned char *pbyData, unsigned int cbByte, unsigned long dwPreCRC) { return CRCdwCrc32(pbyData, cbByte, dwPreCRC); } diff --git a/drivers/staging/vt6655/tcrc.h b/drivers/staging/vt6655/tcrc.h index 5faa48b0a74..d0449855beb 100644 --- a/drivers/staging/vt6655/tcrc.h +++ b/drivers/staging/vt6655/tcrc.h @@ -43,9 +43,9 @@ /*--------------------- Export Functions --------------------------*/ -DWORD CRCdwCrc32(PBYTE pbyData, UINT cbByte, DWORD dwCrcSeed); -DWORD CRCdwGetCrc32(PBYTE pbyData, UINT cbByte); -DWORD CRCdwGetCrc32Ex(PBYTE pbyData, UINT cbByte, DWORD dwPreCRC); +unsigned long CRCdwCrc32(unsigned char *pbyData, unsigned int cbByte, unsigned long dwCrcSeed); +unsigned long CRCdwGetCrc32(unsigned char *pbyData, unsigned int cbByte); +unsigned long CRCdwGetCrc32Ex(unsigned char *pbyData, unsigned int cbByte, unsigned long dwPreCRC); #endif // __TCRC_H__ diff --git a/drivers/staging/vt6655/tether.c b/drivers/staging/vt6655/tether.c index d8ba67395cb..1cf8508e407 100644 --- a/drivers/staging/vt6655/tether.c +++ b/drivers/staging/vt6655/tether.c @@ -61,14 +61,14 @@ * Return Value: Hash value * */ -BYTE ETHbyGetHashIndexByCrc32 (PBYTE pbyMultiAddr) +unsigned char ETHbyGetHashIndexByCrc32 (unsigned char *pbyMultiAddr) { int ii; - BYTE byTmpHash; - BYTE byHash = 0; + unsigned char byTmpHash; + unsigned char byHash = 0; // get the least 6-bits from CRC generator - byTmpHash = (BYTE)(CRCdwCrc32(pbyMultiAddr, ETH_ALEN, + byTmpHash = (unsigned char)(CRCdwCrc32(pbyMultiAddr, ETH_ALEN, 0xFFFFFFFFL) & 0x3F); // reverse most bit to least bit for (ii = 0; ii < (sizeof(byTmpHash) * 8); ii++) { @@ -93,17 +93,17 @@ BYTE ETHbyGetHashIndexByCrc32 (PBYTE pbyMultiAddr) * Out: * none * - * Return Value: TRUE if ok; FALSE if error. + * Return Value: true if ok; false if error. * */ -BOOL ETHbIsBufferCrc32Ok (PBYTE pbyBuffer, UINT cbFrameLength) +bool ETHbIsBufferCrc32Ok (unsigned char *pbyBuffer, unsigned int cbFrameLength) { - DWORD dwCRC; + unsigned long dwCRC; dwCRC = CRCdwGetCrc32(pbyBuffer, cbFrameLength - 4); - if (cpu_to_le32(*((PDWORD)(pbyBuffer + cbFrameLength - 4))) != dwCRC) { - return FALSE; + if (cpu_to_le32(*((unsigned long *)(pbyBuffer + cbFrameLength - 4))) != dwCRC) { + return false; } - return TRUE; + return true; } diff --git a/drivers/staging/vt6655/tether.h b/drivers/staging/vt6655/tether.h index 3c9acd7903a..787d885deee 100644 --- a/drivers/staging/vt6655/tether.h +++ b/drivers/staging/vt6655/tether.h @@ -29,7 +29,7 @@ #ifndef __TETHER_H__ #define __TETHER_H__ -#include <linux/if_ether.h> +#include <linux/etherdevice.h> #include "ttype.h" /*--------------------- Export Definitions -------------------------*/ @@ -39,12 +39,6 @@ #define U_ETHER_ADDR_STR_LEN (ETH_ALEN * 2 + 1) // Ethernet address string length -#define MIN_DATA_LEN 46 // min data length - -#define MIN_PACKET_LEN (MIN_DATA_LEN + ETH_HLEN) - // 60 - // min total packet length (tx) - #define MAX_LOOKAHEAD_SIZE ETH_FRAME_LEN #define U_MULTI_ADDR_LEN 8 // multicast address length @@ -160,9 +154,9 @@ // Ethernet packet // typedef struct tagSEthernetHeader { - BYTE abyDstAddr[ETH_ALEN]; - BYTE abySrcAddr[ETH_ALEN]; - WORD wType; + unsigned char abyDstAddr[ETH_ALEN]; + unsigned char abySrcAddr[ETH_ALEN]; + unsigned short wType; }__attribute__ ((__packed__)) SEthernetHeader, *PSEthernetHeader; @@ -171,9 +165,9 @@ SEthernetHeader, *PSEthernetHeader; // 802_3 packet // typedef struct tagS802_3Header { - BYTE abyDstAddr[ETH_ALEN]; - BYTE abySrcAddr[ETH_ALEN]; - WORD wLen; + unsigned char abyDstAddr[ETH_ALEN]; + unsigned char abySrcAddr[ETH_ALEN]; + unsigned short wLen; }__attribute__ ((__packed__)) S802_3Header, *PS802_3Header; @@ -181,37 +175,17 @@ S802_3Header, *PS802_3Header; // 802_11 packet // typedef struct tagS802_11Header { - WORD wFrameCtl; - WORD wDurationID; - BYTE abyAddr1[ETH_ALEN]; - BYTE abyAddr2[ETH_ALEN]; - BYTE abyAddr3[ETH_ALEN]; - WORD wSeqCtl; - BYTE abyAddr4[ETH_ALEN]; + unsigned short wFrameCtl; + unsigned short wDurationID; + unsigned char abyAddr1[ETH_ALEN]; + unsigned char abyAddr2[ETH_ALEN]; + unsigned char abyAddr3[ETH_ALEN]; + unsigned short wSeqCtl; + unsigned char abyAddr4[ETH_ALEN]; }__attribute__ ((__packed__)) S802_11Header, *PS802_11Header; /*--------------------- Export Macros ------------------------------*/ -// Frame type macro - -#define IS_MULTICAST_ADDRESS(pbyEtherAddr) \ - ((*(PBYTE)(pbyEtherAddr) & 0x01) == 1) - -#define IS_BROADCAST_ADDRESS(pbyEtherAddr) ( \ - (*(PDWORD)(pbyEtherAddr) == 0xFFFFFFFFL) && \ - (*(PWORD)((PBYTE)(pbyEtherAddr) + 4) == 0xFFFF) \ -) - -#define IS_NULL_ADDRESS(pbyEtherAddr) ( \ - (*(PDWORD)(pbyEtherAddr) == 0L) && \ - (*(PWORD)((PBYTE)(pbyEtherAddr) + 4) == 0) \ -) - -#define IS_ETH_ADDRESS_EQUAL(pbyAddr1, pbyAddr2) ( \ - (*(PDWORD)(pbyAddr1) == *(PDWORD)(pbyAddr2)) && \ - (*(PWORD)((PBYTE)(pbyAddr1) + 4) == \ - *(PWORD)((PBYTE)(pbyAddr2) + 4)) \ -) /*--------------------- Export Classes ----------------------------*/ @@ -219,9 +193,9 @@ S802_11Header, *PS802_11Header; /*--------------------- Export Functions --------------------------*/ -BYTE ETHbyGetHashIndexByCrc32(PBYTE pbyMultiAddr); -//BYTE ETHbyGetHashIndexByCrc(PBYTE pbyMultiAddr); -BOOL ETHbIsBufferCrc32Ok(PBYTE pbyBuffer, UINT cbFrameLength); +unsigned char ETHbyGetHashIndexByCrc32(unsigned char *pbyMultiAddr); +//unsigned char ETHbyGetHashIndexByCrc(unsigned char *pbyMultiAddr); +bool ETHbIsBufferCrc32Ok(unsigned char *pbyBuffer, unsigned int cbFrameLength); #endif // __TETHER_H__ diff --git a/drivers/staging/vt6655/tkip.c b/drivers/staging/vt6655/tkip.c index f83af5913aa..ed3eac17ae8 100644 --- a/drivers/staging/vt6655/tkip.c +++ b/drivers/staging/vt6655/tkip.c @@ -55,7 +55,7 @@ /* The 2nd table is the same as the 1st but with the upper and lower */ /* bytes swapped. To allow an endian tolerant implementation, the byte */ /* halves have been expressed independently here. */ -const BYTE TKIP_Sbox_Lower[256] = { +const unsigned char TKIP_Sbox_Lower[256] = { 0xA5,0x84,0x99,0x8D,0x0D,0xBD,0xB1,0x54, 0x50,0x03,0xA9,0x7D,0x19,0x62,0xE6,0x9A, 0x45,0x9D,0x40,0x87,0x15,0xEB,0xC9,0x0B, @@ -90,7 +90,7 @@ const BYTE TKIP_Sbox_Lower[256] = { 0xC3,0xB0,0x77,0x11,0xCB,0xFC,0xD6,0x3A }; -const BYTE TKIP_Sbox_Upper[256] = { +const unsigned char TKIP_Sbox_Upper[256] = { 0xC6,0xF8,0xEE,0xF6,0xFF,0xD6,0xDE,0x91, 0x60,0x02,0xCE,0x56,0xE7,0xB5,0x4D,0xEC, 0x8F,0x1F,0x89,0xFA,0xEF,0xB2,0x8E,0xFB, @@ -184,11 +184,11 @@ unsigned int rotr1(unsigned int a) * */ void TKIPvMixKey( - PBYTE pbyTKey, - PBYTE pbyTA, - WORD wTSC15_0, - DWORD dwTSC47_16, - PBYTE pbyRC4Key + unsigned char *pbyTKey, + unsigned char *pbyTA, + unsigned short wTSC15_0, + unsigned long dwTSC47_16, + unsigned char *pbyRC4Key ) { unsigned int p1k[5]; diff --git a/drivers/staging/vt6655/tkip.h b/drivers/staging/vt6655/tkip.h index 3dfa7f5ee7e..eb5951d726e 100644 --- a/drivers/staging/vt6655/tkip.h +++ b/drivers/staging/vt6655/tkip.h @@ -47,11 +47,11 @@ /*--------------------- Export Functions --------------------------*/ void TKIPvMixKey( - PBYTE pbyTKey, - PBYTE pbyTA, - WORD wTSC15_0, - DWORD dwTSC47_16, - PBYTE pbyRC4Key + unsigned char *pbyTKey, + unsigned char *pbyTA, + unsigned short wTSC15_0, + unsigned long dwTSC47_16, + unsigned char *pbyRC4Key ); #endif // __TKIP_H__ diff --git a/drivers/staging/vt6655/tmacro.h b/drivers/staging/vt6655/tmacro.h index e96c140de05..e8b177d4128 100644 --- a/drivers/staging/vt6655/tmacro.h +++ b/drivers/staging/vt6655/tmacro.h @@ -34,27 +34,27 @@ /****** Common helper macros ***********************************************/ #if !defined(LOBYTE) -#define LOBYTE(w) ((BYTE)(w)) +#define LOBYTE(w) ((unsigned char)(w)) #endif #if !defined(HIBYTE) -#define HIBYTE(w) ((BYTE)(((WORD)(w) >> 8) & 0xFF)) +#define HIBYTE(w) ((unsigned char)(((unsigned short)(w) >> 8) & 0xFF)) #endif #if !defined(LOWORD) -#define LOWORD(d) ((WORD)(d)) +#define LOWORD(d) ((unsigned short)(d)) #endif #if !defined(HIWORD) -#define HIWORD(d) ((WORD)((((DWORD)(d)) >> 16) & 0xFFFF)) +#define HIWORD(d) ((unsigned short)((((unsigned long)(d)) >> 16) & 0xFFFF)) #endif #define LODWORD(q) ((q).u.dwLowDword) #define HIDWORD(q) ((q).u.dwHighDword) #if !defined(MAKEWORD) -#define MAKEWORD(lb, hb) ((WORD)(((BYTE)(lb)) | (((WORD)((BYTE)(hb))) << 8))) +#define MAKEWORD(lb, hb) ((unsigned short)(((unsigned char)(lb)) | (((unsigned short)((unsigned char)(hb))) << 8))) #endif #if !defined(MAKEDWORD) -#define MAKEDWORD(lw, hw) ((DWORD)(((WORD)(lw)) | (((DWORD)((WORD)(hw))) << 16))) +#define MAKEDWORD(lw, hw) ((unsigned long)(((unsigned short)(lw)) | (((unsigned long)((unsigned short)(hw))) << 16))) #endif #endif // __TMACRO_H__ diff --git a/drivers/staging/vt6655/ttype.h b/drivers/staging/vt6655/ttype.h index 2921083a9f2..37c8fba1fd1 100644 --- a/drivers/staging/vt6655/ttype.h +++ b/drivers/staging/vt6655/ttype.h @@ -33,23 +33,10 @@ /******* Common definitions and typedefs ***********************************/ -#ifndef OUT -#define OUT -#endif - #ifndef TxInSleep #define TxInSleep #endif -typedef int BOOL; - -#if !defined(TRUE) -#define TRUE 1 -#endif -#if !defined(FALSE) -#define FALSE 0 -#endif - //2007-0809-01<Add>by MikeLiu #ifndef update_BssList #define update_BssList @@ -65,10 +52,6 @@ typedef int BOOL; #define Calcu_LinkQual #endif -#ifndef Calcu_LinkQual -#define Calcu_LinkQual -#endif - /****** Simple typedefs ***************************************************/ /* These lines assume that your compiler's longs are 32 bits and @@ -76,37 +59,13 @@ typedef int BOOL; * but it doesn't matter if they're signed or unsigned. */ -typedef signed char I8; /* 8-bit signed integer */ - -typedef unsigned char U8; /* 8-bit unsigned integer */ -typedef unsigned short U16; /* 16-bit unsigned integer */ -typedef unsigned long U32; /* 32-bit unsigned integer */ - - -typedef char CHAR; -typedef signed short SHORT; -typedef signed int INT; -typedef signed long LONG; - -typedef unsigned char UCHAR; -typedef unsigned short USHORT; -typedef unsigned int UINT; -typedef unsigned long ULONG; -typedef unsigned long long ULONGLONG; //64 bit - - - -typedef unsigned char BYTE; // 8-bit -typedef unsigned short WORD; // 16-bit -typedef unsigned long DWORD; // 32-bit - // QWORD is for those situation that we want // an 8-byte-aligned 8 byte long structure // which is NOT really a floating point number. typedef union tagUQuadWord { struct { - DWORD dwLowDword; - DWORD dwHighDword; + unsigned int dwLowDword; + unsigned int dwHighDword; } u; double DoNotUseThisField; } UQuadWord; @@ -114,18 +73,6 @@ typedef UQuadWord QWORD; // 64-bit /****** Common pointer types ***********************************************/ -typedef unsigned long ULONG_PTR; // 32-bit -typedef unsigned long DWORD_PTR; // 32-bit - -// boolean pointer -typedef unsigned int * PUINT; - -typedef BYTE * PBYTE; - -typedef WORD * PWORD; - -typedef DWORD * PDWORD; - typedef QWORD * PQWORD; #endif // __TTYPE_H__ diff --git a/drivers/staging/vt6655/upc.h b/drivers/staging/vt6655/upc.h index acd1b661490..9596fdef0e3 100644 --- a/drivers/staging/vt6655/upc.h +++ b/drivers/staging/vt6655/upc.h @@ -76,36 +76,36 @@ #define VNSvInPortB(dwIOAddress, pbyData) { \ - volatile BYTE* pbyAddr = ((PBYTE)(dwIOAddress)); \ + volatile unsigned char * pbyAddr = ((unsigned char *)(dwIOAddress)); \ *(pbyData) = readb(pbyAddr); \ } #define VNSvInPortW(dwIOAddress, pwData) { \ - volatile WORD* pwAddr = ((PWORD)(dwIOAddress)); \ + volatile unsigned short *pwAddr = ((unsigned short *)(dwIOAddress)); \ *(pwData) = readw(pwAddr); \ } #define VNSvInPortD(dwIOAddress, pdwData) { \ - volatile DWORD* pdwAddr = ((PDWORD)(dwIOAddress)); \ + volatile unsigned long *pdwAddr = ((unsigned long *)(dwIOAddress)); \ *(pdwData) = readl(pdwAddr); \ } #define VNSvOutPortB(dwIOAddress, byData) { \ - volatile BYTE* pbyAddr = ((PBYTE)(dwIOAddress)); \ - writeb((BYTE)byData, pbyAddr); \ + volatile unsigned char * pbyAddr = ((unsigned char *)(dwIOAddress)); \ + writeb((unsigned char)byData, pbyAddr); \ } #define VNSvOutPortW(dwIOAddress, wData) { \ - volatile WORD* pwAddr = ((PWORD)(dwIOAddress)); \ - writew((WORD)wData, pwAddr); \ + volatile unsigned short *pwAddr = ((unsigned short *)(dwIOAddress)); \ + writew((unsigned short)wData, pwAddr); \ } #define VNSvOutPortD(dwIOAddress, dwData) { \ - volatile DWORD* pdwAddr = ((PDWORD)(dwIOAddress)); \ - writel((DWORD)dwData, pdwAddr); \ + volatile unsigned long *pdwAddr = ((unsigned long *)(dwIOAddress)); \ + writel((unsigned long)dwData, pdwAddr); \ } #endif @@ -140,8 +140,8 @@ #define PCAvDelayByIO(uDelayUnit) { \ - BYTE byData; \ - ULONG ii; \ + unsigned char byData; \ + unsigned long ii; \ \ if (uDelayUnit <= 50) { \ udelay(uDelayUnit); \ diff --git a/drivers/staging/vt6655/vntwifi.c b/drivers/staging/vt6655/vntwifi.c index b527a019188..fcf26ab920d 100644 --- a/drivers/staging/vt6655/vntwifi.c +++ b/drivers/staging/vt6655/vntwifi.c @@ -101,9 +101,9 @@ VNTWIFIvSetOPMode ( void VNTWIFIvSetIBSSParameter ( void *pMgmtHandle, - WORD wBeaconPeriod, - WORD wATIMWindow, - UINT uChannel + unsigned short wBeaconPeriod, + unsigned short wATIMWindow, + unsigned int uChannel ) { PSMgmtObject pMgmt = (PSMgmtObject)pMgmtHandle; @@ -150,7 +150,7 @@ VNTWIFIpGetCurrentSSID ( * Return Value: current Channel. * -*/ -UINT +unsigned int VNTWIFIpGetCurrentChannel ( void *pMgmtHandle ) @@ -176,7 +176,7 @@ VNTWIFIpGetCurrentChannel ( * Return Value: current Assoc ID * -*/ -WORD +unsigned short VNTWIFIwGetAssocID ( void *pMgmtHandle ) @@ -202,15 +202,15 @@ VNTWIFIwGetAssocID ( * Return Value: max support rate * -*/ -BYTE +unsigned char VNTWIFIbyGetMaxSupportRate ( PWLAN_IE_SUPP_RATES pSupportRateIEs, PWLAN_IE_SUPP_RATES pExtSupportRateIEs ) { - BYTE byMaxSupportRate = RATE_1M; - BYTE bySupportRate = RATE_1M; - UINT ii = 0; + unsigned char byMaxSupportRate = RATE_1M; + unsigned char bySupportRate = RATE_1M; + unsigned int ii = 0; if (pSupportRateIEs) { for (ii = 0; ii < pSupportRateIEs->len; ii++) { @@ -248,16 +248,16 @@ VNTWIFIbyGetMaxSupportRate ( * Return Value: max support rate * -*/ -BYTE +unsigned char VNTWIFIbyGetACKTxRate ( - BYTE byRxDataRate, + unsigned char byRxDataRate, PWLAN_IE_SUPP_RATES pSupportRateIEs, PWLAN_IE_SUPP_RATES pExtSupportRateIEs ) { - BYTE byMaxAckRate; - BYTE byBasicRate; - UINT ii; + unsigned char byMaxAckRate; + unsigned char byBasicRate; + unsigned int ii; if (byRxDataRate <= RATE_11M) { byMaxAckRate = RATE_1M; @@ -317,9 +317,9 @@ VNTWIFIvSetAuthenticationMode ( pMgmt->eAuthenMode = eAuthMode; if ((eAuthMode == WMAC_AUTH_SHAREKEY) || (eAuthMode == WMAC_AUTH_AUTO)) { - pMgmt->bShareKeyAlgorithm = TRUE; + pMgmt->bShareKeyAlgorithm = true; } else { - pMgmt->bShareKeyAlgorithm = FALSE; + pMgmt->bShareKeyAlgorithm = false; } } @@ -350,15 +350,15 @@ VNTWIFIvSetEncryptionMode ( if ((eEncryptionMode == WMAC_ENCRYPTION_WEPEnabled) || (eEncryptionMode == WMAC_ENCRYPTION_TKIPEnabled) || (eEncryptionMode == WMAC_ENCRYPTION_AESEnabled) ) { - pMgmt->bPrivacyInvoked = TRUE; + pMgmt->bPrivacyInvoked = true; } else { - pMgmt->bPrivacyInvoked = FALSE; + pMgmt->bPrivacyInvoked = false; } } -BOOL +bool VNTWIFIbConfigPhyMode ( void *pMgmtHandle, CARD_PHY_TYPE ePhyType @@ -368,14 +368,14 @@ VNTWIFIbConfigPhyMode ( if ((ePhyType != PHY_TYPE_AUTO) && (ePhyType != pMgmt->eCurrentPHYMode)) { - if (CARDbSetPhyParameter(pMgmt->pAdapter, ePhyType, 0, 0, NULL, NULL)==TRUE) { + if (CARDbSetPhyParameter(pMgmt->pAdapter, ePhyType, 0, 0, NULL, NULL)==true) { pMgmt->eCurrentPHYMode = ePhyType; } else { - return(FALSE); + return(false); } } pMgmt->eConfigPHYMode = ePhyType; - return(TRUE); + return(true); } @@ -425,16 +425,12 @@ VNTWIFIbGetConfigPhyMode ( -*/ void -VNTWIFIvQueryBSSList ( - void *pMgmtHandle, - PUINT puBSSCount, - void **pvFirstBSS - ) +VNTWIFIvQueryBSSList(void *pMgmtHandle, unsigned int *puBSSCount, void **pvFirstBSS) { - UINT ii = 0; + unsigned int ii = 0; PSMgmtObject pMgmt = (PSMgmtObject)pMgmtHandle; PKnownBSS pBSS = NULL; - UINT uCount = 0; + unsigned int uCount = 0; *pvFirstBSS = NULL; @@ -471,7 +467,7 @@ VNTWIFIvGetNextBSS ( if (pBSS > &(pMgmt->sBSSList[MAX_BSS_NUM])) { return; } - if (pBSS->bActive == TRUE) { + if (pBSS->bActive == true) { *pvNextBSS = pBSS; return; } @@ -497,24 +493,24 @@ VNTWIFIvGetNextBSS ( void VNTWIFIvUpdateNodeTxCounter( void *pMgmtHandle, - PBYTE pbyDestAddress, - BOOL bTxOk, - WORD wRate, - PBYTE pbyTxFailCount + unsigned char *pbyDestAddress, + bool bTxOk, + unsigned short wRate, + unsigned char *pbyTxFailCount ) { PSMgmtObject pMgmt = (PSMgmtObject)pMgmtHandle; - UINT uNodeIndex = 0; - UINT ii; + unsigned int uNodeIndex = 0; + unsigned int ii; if ((pMgmt->eCurrMode == WMAC_MODE_IBSS_STA) || (pMgmt->eCurrMode == WMAC_MODE_ESS_AP)) { - if (BSSDBbIsSTAInNodeDB(pMgmt, pbyDestAddress, &uNodeIndex) == FALSE) { + if (BSSDBbIsSTAInNodeDB(pMgmt, pbyDestAddress, &uNodeIndex) == false) { return; } } pMgmt->sNodeDBTable[uNodeIndex].uTxAttempts++; - if (bTxOk == TRUE) { + if (bTxOk == true) { // transmit success, TxAttempts at least plus one pMgmt->sNodeDBTable[uNodeIndex].uTxOk[MAX_RATE]++; pMgmt->sNodeDBTable[uNodeIndex].uTxOk[wRate]++; @@ -532,19 +528,19 @@ VNTWIFIvUpdateNodeTxCounter( void VNTWIFIvGetTxRate( void *pMgmtHandle, - PBYTE pbyDestAddress, - PWORD pwTxDataRate, - PBYTE pbyACKRate, - PBYTE pbyCCKBasicRate, - PBYTE pbyOFDMBasicRate + unsigned char *pbyDestAddress, + unsigned short *pwTxDataRate, + unsigned char *pbyACKRate, + unsigned char *pbyCCKBasicRate, + unsigned char *pbyOFDMBasicRate ) { PSMgmtObject pMgmt = (PSMgmtObject)pMgmtHandle; - UINT uNodeIndex = 0; - WORD wTxDataRate = RATE_1M; - BYTE byACKRate = RATE_1M; - BYTE byCCKBasicRate = RATE_1M; - BYTE byOFDMBasicRate = RATE_24M; + unsigned int uNodeIndex = 0; + unsigned short wTxDataRate = RATE_1M; + unsigned char byACKRate = RATE_1M; + unsigned char byCCKBasicRate = RATE_1M; + unsigned char byOFDMBasicRate = RATE_24M; PWLAN_IE_SUPP_RATES pSupportRateIEs = NULL; PWLAN_IE_SUPP_RATES pExtSupportRateIEs = NULL; @@ -579,12 +575,12 @@ VNTWIFIvGetTxRate( pSupportRateIEs = (PWLAN_IE_SUPP_RATES) pMgmt->abyCurrSuppRates; pExtSupportRateIEs = (PWLAN_IE_SUPP_RATES) pMgmt->abyCurrExtSuppRates; } - byACKRate = VNTWIFIbyGetACKTxRate( (BYTE) wTxDataRate, + byACKRate = VNTWIFIbyGetACKTxRate( (unsigned char) wTxDataRate, pSupportRateIEs, pExtSupportRateIEs ); - if (byACKRate > (BYTE) wTxDataRate) { - byACKRate = (BYTE) wTxDataRate; + if (byACKRate > (unsigned char) wTxDataRate) { + byACKRate = (unsigned char) wTxDataRate; } byCCKBasicRate = VNTWIFIbyGetACKTxRate( RATE_11M, pSupportRateIEs, @@ -601,15 +597,15 @@ VNTWIFIvGetTxRate( return; } -BYTE +unsigned char VNTWIFIbyGetKeyCypher( void *pMgmtHandle, - BOOL bGroupKey + bool bGroupKey ) { PSMgmtObject pMgmt = (PSMgmtObject)pMgmtHandle; - if (bGroupKey == TRUE) { + if (bGroupKey == true) { return (pMgmt->byCSSGK); } else { return (pMgmt->byCSSPK); @@ -618,7 +614,7 @@ VNTWIFIbyGetKeyCypher( /* -BOOL +bool VNTWIFIbInit( void *pAdapterHandler, void **pMgmtHandler @@ -626,13 +622,13 @@ VNTWIFIbInit( { PSMgmtObject pMgmt = NULL; - UINT ii; + unsigned int ii; pMgmt = (PSMgmtObject)kmalloc(sizeof(SMgmtObject), (int)GFP_ATOMIC); if (pMgmt == NULL) { *pMgmtHandler = NULL; - return FALSE; + return false; } memset(pMgmt, 0, sizeof(SMgmtObject)); @@ -652,41 +648,41 @@ VNTWIFIbInit( pMgmt->uCmdDequeueIdx = 0; pMgmt->uCmdEnqueueIdx = 0; pMgmt->eCommandState = WLAN_CMD_STATE_IDLE; - pMgmt->bCmdStop = FALSE; - pMgmt->bCmdRunning = FALSE; + pMgmt->bCmdStop = false; + pMgmt->bCmdRunning = false; *pMgmtHandler = pMgmt; - return TRUE; + return true; } */ -BOOL +bool VNTWIFIbSetPMKIDCache ( void *pMgmtObject, - ULONG ulCount, + unsigned long ulCount, void *pPMKIDInfo ) { PSMgmtObject pMgmt = (PSMgmtObject) pMgmtObject; if (ulCount > MAX_PMKID_CACHE) { - return (FALSE); + return (false); } pMgmt->gsPMKIDCache.BSSIDInfoCount = ulCount; memcpy(pMgmt->gsPMKIDCache.BSSIDInfo, pPMKIDInfo, (ulCount*sizeof(PMKIDInfo))); - return (TRUE); + return (true); } -WORD +unsigned short VNTWIFIwGetMaxSupportRate( void *pMgmtObject ) { - WORD wRate = RATE_54M; + unsigned short wRate = RATE_54M; PSMgmtObject pMgmt = (PSMgmtObject) pMgmtObject; for(wRate = RATE_54M; wRate > RATE_1M; wRate--) { @@ -705,7 +701,7 @@ VNTWIFIwGetMaxSupportRate( void VNTWIFIvSet11h ( void *pMgmtObject, - BOOL b11hEnable + bool b11hEnable ) { PSMgmtObject pMgmt = (PSMgmtObject) pMgmtObject; @@ -713,19 +709,19 @@ VNTWIFIvSet11h ( pMgmt->b11hEnable = b11hEnable; } -BOOL +bool VNTWIFIbMeasureReport( void *pMgmtObject, - BOOL bEndOfReport, + bool bEndOfReport, void *pvMeasureEID, - BYTE byReportMode, - BYTE byBasicMap, - BYTE byCCAFraction, - PBYTE pbyRPIs + unsigned char byReportMode, + unsigned char byBasicMap, + unsigned char byCCAFraction, + unsigned char *pbyRPIs ) { PSMgmtObject pMgmt = (PSMgmtObject) pMgmtObject; - PBYTE pbyCurrentEID = (PBYTE) (pMgmt->pCurrMeasureEIDRep); + unsigned char *pbyCurrentEID = (unsigned char *) (pMgmt->pCurrMeasureEIDRep); //spin_lock_irq(&pDevice->lock); if ((pvMeasureEID != NULL) && @@ -765,49 +761,49 @@ VNTWIFIbMeasureReport( pMgmt->uLengthOfRepEIDs += (2 + pMgmt->pCurrMeasureEIDRep->len); pMgmt->pCurrMeasureEIDRep = (PWLAN_IE_MEASURE_REP) pbyCurrentEID; } - if (bEndOfReport == TRUE) { + if (bEndOfReport == true) { IEEE11hbMSRRepTx(pMgmt); } //spin_unlock_irq(&pDevice->lock); - return (TRUE); + return (true); } -BOOL +bool VNTWIFIbChannelSwitch( void *pMgmtObject, - BYTE byNewChannel + unsigned char byNewChannel ) { PSMgmtObject pMgmt = (PSMgmtObject) pMgmtObject; //spin_lock_irq(&pDevice->lock); pMgmt->uCurrChannel = byNewChannel; - pMgmt->bSwitchChannel = FALSE; + pMgmt->bSwitchChannel = false; //spin_unlock_irq(&pDevice->lock); - return TRUE; + return true; } /* -BOOL +bool VNTWIFIbRadarPresent( void *pMgmtObject, - BYTE byChannel + unsigned char byChannel ) { PSMgmtObject pMgmt = (PSMgmtObject) pMgmtObject; if ((pMgmt->eCurrMode == WMAC_MODE_IBSS_STA) && - (byChannel == (BYTE) pMgmt->uCurrChannel) && - (pMgmt->bSwitchChannel != TRUE) && - (pMgmt->b11hEnable == TRUE)) { - if (IS_ETH_ADDRESS_EQUAL(pMgmt->abyIBSSDFSOwner, CARDpGetCurrentAddress(pMgmt->pAdapter))) { - pMgmt->byNewChannel = CARDbyAutoChannelSelect(pMgmt->pAdapter,(BYTE) pMgmt->uCurrChannel); - pMgmt->bSwitchChannel = TRUE; + (byChannel == (unsigned char) pMgmt->uCurrChannel) && + (pMgmt->bSwitchChannel != true) && + (pMgmt->b11hEnable == true)) { + if (!compare_ether_addr(pMgmt->abyIBSSDFSOwner, CARDpGetCurrentAddress(pMgmt->pAdapter))) { + pMgmt->byNewChannel = CARDbyAutoChannelSelect(pMgmt->pAdapter,(unsigned char) pMgmt->uCurrChannel); + pMgmt->bSwitchChannel = true; } BEACONbSendBeacon(pMgmt); CARDbChannelSwitch(pMgmt->pAdapter, 0, pMgmt->byNewChannel, 10); } - return TRUE; + return true; } */ diff --git a/drivers/staging/vt6655/vntwifi.h b/drivers/staging/vt6655/vntwifi.h index c91dfd79adc..f4327abaa77 100644 --- a/drivers/staging/vt6655/vntwifi.h +++ b/drivers/staging/vt6655/vntwifi.h @@ -143,9 +143,9 @@ typedef enum tagWMAC_POWER_MODE { void VNTWIFIvSetIBSSParameter ( void *pMgmtHandle, - WORD wBeaconPeriod, - WORD wATIMWindow, - UINT uChannel + unsigned short wBeaconPeriod, + unsigned short wATIMWindow, + unsigned int uChannel ); void @@ -159,25 +159,25 @@ VNTWIFIpGetCurrentSSID( void *pMgmtHandle ); -UINT +unsigned int VNTWIFIpGetCurrentChannel( void *pMgmtHandle ); -WORD +unsigned short VNTWIFIwGetAssocID ( void *pMgmtHandle ); -BYTE +unsigned char VNTWIFIbyGetMaxSupportRate ( PWLAN_IE_SUPP_RATES pSupportRateIEs, PWLAN_IE_SUPP_RATES pExtSupportRateIEs ); -BYTE +unsigned char VNTWIFIbyGetACKTxRate ( - BYTE byRxDataRate, + unsigned char byRxDataRate, PWLAN_IE_SUPP_RATES pSupportRateIEs, PWLAN_IE_SUPP_RATES pExtSupportRateIEs ); @@ -195,7 +195,7 @@ VNTWIFIvSetEncryptionMode ( ); -BOOL +bool VNTWIFIbConfigPhyMode( void *pMgmtHandle, CARD_PHY_TYPE ePhyType @@ -208,14 +208,8 @@ VNTWIFIbGetConfigPhyMode( ); void -VNTWIFIvQueryBSSList( - void *pMgmtHandle, - PUINT puBSSCount, - void **pvFirstBSS - ); - - - +VNTWIFIvQueryBSSList(void *pMgmtHandle, unsigned int *puBSSCount, + void **pvFirstBSS); void VNTWIFIvGetNextBSS ( @@ -229,52 +223,52 @@ VNTWIFIvGetNextBSS ( void VNTWIFIvUpdateNodeTxCounter( void *pMgmtHandle, - PBYTE pbyDestAddress, - BOOL bTxOk, - WORD wRate, - PBYTE pbyTxFailCount + unsigned char *pbyDestAddress, + bool bTxOk, + unsigned short wRate, + unsigned char *pbyTxFailCount ); void VNTWIFIvGetTxRate( void *pMgmtHandle, - PBYTE pbyDestAddress, - PWORD pwTxDataRate, - PBYTE pbyACKRate, - PBYTE pbyCCKBasicRate, - PBYTE pbyOFDMBasicRate + unsigned char *pbyDestAddress, + unsigned short *pwTxDataRate, + unsigned char *pbyACKRate, + unsigned char *pbyCCKBasicRate, + unsigned char *pbyOFDMBasicRate ); /* -BOOL +bool VNTWIFIbInit( void *pAdapterHandler, void **pMgmtHandler ); */ -BYTE +unsigned char VNTWIFIbyGetKeyCypher( void *pMgmtHandle, - BOOL bGroupKey + bool bGroupKey ); -BOOL +bool VNTWIFIbSetPMKIDCache ( void *pMgmtObject, - ULONG ulCount, + unsigned long ulCount, void *pPMKIDInfo ); -BOOL +bool VNTWIFIbCommandRunning ( void *pMgmtObject ); -WORD +unsigned short VNTWIFIwGetMaxSupportRate( void *pMgmtObject ); @@ -283,30 +277,30 @@ VNTWIFIwGetMaxSupportRate( void VNTWIFIvSet11h ( void *pMgmtObject, - BOOL b11hEnable + bool b11hEnable ); -BOOL +bool VNTWIFIbMeasureReport( void *pMgmtObject, - BOOL bEndOfReport, + bool bEndOfReport, void *pvMeasureEID, - BYTE byReportMode, - BYTE byBasicMap, - BYTE byCCAFraction, - PBYTE pbyRPIs + unsigned char byReportMode, + unsigned char byBasicMap, + unsigned char byCCAFraction, + unsigned char *pbyRPIs ); -BOOL +bool VNTWIFIbChannelSwitch( void *pMgmtObject, - BYTE byNewChannel + unsigned char byNewChannel ); /* -BOOL +bool VNTWIFIbRadarPresent( void *pMgmtObject, - BYTE byChannel + unsigned char byChannel ); */ diff --git a/drivers/staging/vt6655/wcmd.c b/drivers/staging/vt6655/wcmd.c index 28665d870f5..abd6745bc3f 100644 --- a/drivers/staging/vt6655/wcmd.c +++ b/drivers/staging/vt6655/wcmd.c @@ -52,6 +52,7 @@ #include "rxtx.h" #include "rf.h" #include "iowpa.h" +#include "channel.h" /*--------------------- Static Definitions -------------------------*/ @@ -77,7 +78,7 @@ PSTxMgmtPacket s_MgrMakeProbeRequest( PSDevice pDevice, PSMgmtObject pMgmt, - PBYTE pScanBSSID, + unsigned char *pScanBSSID, PWLAN_IE_SSID pSSID, PWLAN_IE_SUPP_RATES pCurrRates, PWLAN_IE_SUPP_RATES pCurrExtSuppRates @@ -85,7 +86,7 @@ s_MgrMakeProbeRequest( static -BOOL +bool s_bCommandComplete ( PSDevice pDevice ); @@ -116,7 +117,7 @@ vAdHocBeaconStop(PSDevice pDevice) { PSMgmtObject pMgmt = &(pDevice->sMgmtObj); - BOOL bStop; + bool bStop; /* * temporarily stop Beacon packet for AdHoc Server @@ -129,18 +130,18 @@ vAdHocBeaconStop(PSDevice pDevice) * or * (3.2) AdHoc channel is in A mode */ - bStop = FALSE; + bStop = false; if ((pMgmt->eCurrMode == WMAC_MODE_IBSS_STA) && (pMgmt->eCurrState >= WMAC_STATE_STARTED)) { if ((pMgmt->uIBSSChannel <= CB_MAX_CHANNEL_24G) && (pMgmt->uScanChannel > CB_MAX_CHANNEL_24G)) { - bStop = TRUE; + bStop = true; } if (pMgmt->uIBSSChannel > CB_MAX_CHANNEL_24G) { - bStop = TRUE; + bStop = true; } } @@ -208,15 +209,15 @@ s_vProbeChannel( ) { //1M, 2M, 5M, 11M, 18M, 24M, 36M, 54M - BYTE abyCurrSuppRatesG[] = {WLAN_EID_SUPP_RATES, 8, 0x02, 0x04, 0x0B, 0x16, 0x24, 0x30, 0x48, 0x6C}; - BYTE abyCurrExtSuppRatesG[] = {WLAN_EID_EXTSUPP_RATES, 4, 0x0C, 0x12, 0x18, 0x60}; + unsigned char abyCurrSuppRatesG[] = {WLAN_EID_SUPP_RATES, 8, 0x02, 0x04, 0x0B, 0x16, 0x24, 0x30, 0x48, 0x6C}; + unsigned char abyCurrExtSuppRatesG[] = {WLAN_EID_EXTSUPP_RATES, 4, 0x0C, 0x12, 0x18, 0x60}; //6M, 9M, 12M, 48M - BYTE abyCurrSuppRatesA[] = {WLAN_EID_SUPP_RATES, 8, 0x0C, 0x12, 0x18, 0x24, 0x30, 0x48, 0x60, 0x6C}; - BYTE abyCurrSuppRatesB[] = {WLAN_EID_SUPP_RATES, 4, 0x02, 0x04, 0x0B, 0x16}; - PBYTE pbyRate; + unsigned char abyCurrSuppRatesA[] = {WLAN_EID_SUPP_RATES, 8, 0x0C, 0x12, 0x18, 0x24, 0x30, 0x48, 0x60, 0x6C}; + unsigned char abyCurrSuppRatesB[] = {WLAN_EID_SUPP_RATES, 4, 0x02, 0x04, 0x0B, 0x16}; + unsigned char *pbyRate; PSTxMgmtPacket pTxPacket; PSMgmtObject pMgmt = pDevice->pMgmt; - UINT ii; + unsigned int ii; if (pDevice->eCurrentPHYType == PHY_TYPE_11A) { @@ -269,7 +270,7 @@ PSTxMgmtPacket s_MgrMakeProbeRequest( PSDevice pDevice, PSMgmtObject pMgmt, - PBYTE pScanBSSID, + unsigned char *pScanBSSID, PWLAN_IE_SSID pSSID, PWLAN_IE_SUPP_RATES pCurrRates, PWLAN_IE_SUPP_RATES pCurrExtSuppRates @@ -282,8 +283,8 @@ s_MgrMakeProbeRequest( pTxPacket = (PSTxMgmtPacket)pMgmt->pbyMgmtPacketPool; memset(pTxPacket, 0, sizeof(STxMgmtPacket) + WLAN_PROBEREQ_FR_MAXLEN); - pTxPacket->p80211Header = (PUWLAN_80211HDR)((PBYTE)pTxPacket + sizeof(STxMgmtPacket)); - sFrame.pBuf = (PBYTE)pTxPacket->p80211Header; + pTxPacket->p80211Header = (PUWLAN_80211HDR)((unsigned char *)pTxPacket + sizeof(STxMgmtPacket)); + sFrame.pBuf = (unsigned char *)pTxPacket->p80211Header; sFrame.len = WLAN_PROBEREQ_FR_MAXLEN; vMgrEncodeProbeRequest(&sFrame); sFrame.pHdr->sA3.wFrameCtl = cpu_to_le16( @@ -320,16 +321,16 @@ s_MgrMakeProbeRequest( void vCommandTimerWait( void *hDeviceContext, - UINT MSecond + unsigned int MSecond ) { PSDevice pDevice = (PSDevice)hDeviceContext; init_timer(&pDevice->sTimerCommand); - pDevice->sTimerCommand.data = (ULONG)pDevice; + pDevice->sTimerCommand.data = (unsigned long) pDevice; pDevice->sTimerCommand.function = (TimerFunction)vCommandTimer; // RUN_AT :1 msec ~= (HZ/1024) - pDevice->sTimerCommand.expires = (UINT)RUN_AT((MSecond * HZ) >> 10); + pDevice->sTimerCommand.expires = (unsigned int)RUN_AT((MSecond * HZ) >> 10); add_timer(&pDevice->sTimerCommand); return; } @@ -347,14 +348,14 @@ vCommandTimer ( PWLAN_IE_SSID pItemSSID; PWLAN_IE_SSID pItemSSIDCurr; CMD_STATUS Status; - UINT ii; - BYTE byMask[8] = {1, 2, 4, 8, 0x10, 0x20, 0x40, 0x80}; + unsigned int ii; + unsigned char byMask[8] = {1, 2, 4, 8, 0x10, 0x20, 0x40, 0x80}; struct sk_buff *skb; if (pDevice->dwDiagRefCount != 0) return; - if (pDevice->bCmdRunning != TRUE) + if (pDevice->bCmdRunning != true) return; spin_lock_irq(&pDevice->lock); @@ -364,7 +365,7 @@ vCommandTimer ( case WLAN_CMD_SCAN_START: pDevice->byReAssocCount = 0; - if (pDevice->bRadioOff == TRUE) { + if (pDevice->bRadioOff == true) { s_bCommandComplete(pDevice); spin_unlock_irq(&pDevice->lock); return; @@ -396,7 +397,7 @@ vCommandTimer ( // Set Baseband's sensitivity back. // Set channel back - CARDbSetChannel(pMgmt->pAdapter, pMgmt->uCurrChannel); + set_channel(pMgmt->pAdapter, pMgmt->uCurrChannel); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Scanning, set back to channel: [%d]\n", pMgmt->uCurrChannel); if (pMgmt->eCurrMode == WMAC_MODE_IBSS_STA) { CARDbSetBSSID(pMgmt->pAdapter, pMgmt->abyCurrBSSID, OP_MODE_ADHOC); @@ -408,7 +409,7 @@ vCommandTimer ( } else { //2008-8-4 <add> by chester - if (!ChannelValid(pDevice->byZoneType, pMgmt->uScanChannel)) { + if (!is_channel_valid(pMgmt->uScanChannel)) { DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Invalid channel pMgmt->uScanChannel = %d \n",pMgmt->uScanChannel); s_bCommandComplete(pDevice); return; @@ -431,7 +432,7 @@ vCommandTimer ( vAdHocBeaconStop(pDevice); - if (CARDbSetChannel(pMgmt->pAdapter, pMgmt->uScanChannel) == TRUE) { + if (set_channel(pMgmt->pAdapter, pMgmt->uScanChannel) == true) { DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"SCAN Channel: %d\n", pMgmt->uScanChannel); } else { DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"SET SCAN Channel Fail: %d\n", pMgmt->uScanChannel); @@ -441,7 +442,7 @@ vCommandTimer ( // printk("chester-ch=%d\n",pMgmt->uScanChannel); pMgmt->uScanChannel++; //2008-8-4 <modify> by chester - if (!ChannelValid(pDevice->byZoneType, pMgmt->uScanChannel) && + if (!is_channel_valid(pMgmt->uScanChannel) && pMgmt->uScanChannel <= pDevice->byMaxChannel ){ pMgmt->uScanChannel=pDevice->byMaxChannel+1; pMgmt->eCommandState = WLAN_CMD_SCAN_END; @@ -449,7 +450,7 @@ vCommandTimer ( } - if ((pMgmt->b11hEnable == FALSE) || + if ((pMgmt->b11hEnable == false) || (pMgmt->uScanChannel < CB_MAX_CHANNEL_24G)) { s_vProbeChannel(pDevice); spin_unlock_irq(&pDevice->lock); @@ -469,7 +470,7 @@ vCommandTimer ( // Set Baseband's sensitivity back. // Set channel back - CARDbSetChannel(pMgmt->pAdapter, pMgmt->uCurrChannel); + set_channel(pMgmt->pAdapter, pMgmt->uCurrChannel); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Scanning, set back to channel: [%d]\n", pMgmt->uCurrChannel); if (pMgmt->eCurrMode == WMAC_MODE_IBSS_STA) { CARDbSetBSSID(pMgmt->pAdapter, pMgmt->abyCurrBSSID, OP_MODE_ADHOC); @@ -502,14 +503,14 @@ vCommandTimer ( DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"Send Disassociation Packet..\n"); // reason = 8 : disassoc because sta has left vMgrDisassocBeginSta((void *)pDevice, pMgmt, pMgmt->abyCurrBSSID, (8), &Status); - pDevice->bLinkPass = FALSE; + pDevice->bLinkPass = false; // unlock command busy pItemSSID = (PWLAN_IE_SSID)pMgmt->abyCurrSSID; pItemSSID->len = 0; memset(pItemSSID->abySSID, 0, WLAN_SSID_MAXLEN); pMgmt->eCurrState = WMAC_STATE_IDLE; - pMgmt->sNodeDBTable[0].bActive = FALSE; -// pDevice->bBeaconBufReady = FALSE; + pMgmt->sNodeDBTable[0].bActive = false; +// pDevice->bBeaconBufReady = false; } netif_stop_queue(pDevice->dev); pDevice->eCommandState = WLAN_DISASSOCIATE_WAIT; @@ -539,7 +540,7 @@ vCommandTimer ( case WLAN_CMD_SSID_START: pDevice->byReAssocCount = 0; - if (pDevice->bRadioOff == TRUE) { + if (pDevice->bRadioOff == true) { s_bCommandComplete(pDevice); spin_unlock_irq(&pDevice->lock); return; @@ -573,7 +574,7 @@ printk("chester-abyDesireSSID=%s\n",((PWLAN_IE_SSID)pMgmt->abyDesireSSID)->abySS } netif_stop_queue(pDevice->dev); - pDevice->bLinkPass = FALSE; + pDevice->bLinkPass = false; } // set initial state pMgmt->eCurrState = WMAC_STATE_IDLE; @@ -607,9 +608,9 @@ printk("chester-abyDesireSSID=%s\n",((PWLAN_IE_SSID)pMgmt->abyDesireSSID)->abySS if (netif_queue_stopped(pDevice->dev)){ netif_wake_queue(pDevice->dev); } - pDevice->bLinkPass = TRUE; + pDevice->bLinkPass = true; - pMgmt->sNodeDBTable[0].bActive = TRUE; + pMgmt->sNodeDBTable[0].bActive = true; pMgmt->sNodeDBTable[0].uInActiveCount = 0; bClearBSSID_SCAN(pDevice); } @@ -635,12 +636,12 @@ printk("chester-abyDesireSSID=%s\n",((PWLAN_IE_SSID)pMgmt->abyDesireSSID)->abySS if (netif_queue_stopped(pDevice->dev)){ netif_wake_queue(pDevice->dev); } - pDevice->bLinkPass = TRUE; + pDevice->bLinkPass = true; } else { DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Disconnect SSID none\n"); #ifdef WPA_SUPPLICANT_DRIVER_WEXT_SUPPORT - // if(pDevice->bWPASuppWextEnabled == TRUE) + // if(pDevice->bWPASuppWextEnabled == true) { union iwreq_data wrqu; memset(&wrqu, 0, sizeof (wrqu)); @@ -685,7 +686,7 @@ printk("chester-abyDesireSSID=%s\n",((PWLAN_IE_SSID)pMgmt->abyDesireSSID)->abySS pDevice->byLinkWaitCount = 0; #if 0 #ifdef WPA_SUPPLICANT_DRIVER_WEXT_SUPPORT - // if(pDevice->bWPASuppWextEnabled == TRUE) + // if(pDevice->bWPASuppWextEnabled == true) { union iwreq_data wrqu; memset(&wrqu, 0, sizeof (wrqu)); @@ -707,7 +708,7 @@ printk("chester-abyDesireSSID=%s\n",((PWLAN_IE_SSID)pMgmt->abyDesireSSID)->abySS if (pMgmt->eAuthenMode >= WMAC_AUTH_WPA) { KeybRemoveAllKey(&(pDevice->sKey), pDevice->abyBSSID, pDevice->PortOffset); } - pDevice->bLinkPass = TRUE; + pDevice->bLinkPass = true; pDevice->byLinkWaitCount = 0; pDevice->byReAssocCount = 0; bClearBSSID_SCAN(pDevice); @@ -719,20 +720,20 @@ printk("chester-abyDesireSSID=%s\n",((PWLAN_IE_SSID)pMgmt->abyDesireSSID)->abySS netif_wake_queue(pDevice->dev); } #ifdef TxInSleep - if(pDevice->IsTxDataTrigger != FALSE) { //TxDataTimer is not triggered at the first time + if(pDevice->IsTxDataTrigger != false) { //TxDataTimer is not triggered at the first time // printk("Re-initial TxDataTimer****\n"); del_timer(&pDevice->sTimerTxData); init_timer(&pDevice->sTimerTxData); - pDevice->sTimerTxData.data = (ULONG)pDevice; + pDevice->sTimerTxData.data = (unsigned long) pDevice; pDevice->sTimerTxData.function = (TimerFunction)BSSvSecondTxData; pDevice->sTimerTxData.expires = RUN_AT(10*HZ); //10s callback - pDevice->fTxDataInSleep = FALSE; + pDevice->fTxDataInSleep = false; pDevice->nTxDataTimeCout = 0; } else { // printk("mike:-->First time triger TimerTxData InSleep\n"); } - pDevice->IsTxDataTrigger = TRUE; + pDevice->IsTxDataTrigger = true; add_timer(&pDevice->sTimerTxData); #endif } @@ -749,7 +750,7 @@ printk("chester-abyDesireSSID=%s\n",((PWLAN_IE_SSID)pMgmt->abyDesireSSID)->abySS pDevice->byLinkWaitCount = 0; #if 0 #ifdef WPA_SUPPLICANT_DRIVER_WEXT_SUPPORT - // if(pDevice->bWPASuppWextEnabled == TRUE) + // if(pDevice->bWPASuppWextEnabled == true) { union iwreq_data wrqu; memset(&wrqu, 0, sizeof (wrqu)); @@ -770,14 +771,14 @@ printk("chester-abyDesireSSID=%s\n",((PWLAN_IE_SSID)pMgmt->abyDesireSSID)->abySS del_timer(&pMgmt->sTimerSecondCallback); pMgmt->eCurrState = WMAC_STATE_IDLE; pMgmt->eCurrMode = WMAC_MODE_STANDBY; - pDevice->bLinkPass = FALSE; - if (pDevice->bEnableHostWEP == TRUE) + pDevice->bLinkPass = false; + if (pDevice->bEnableHostWEP == true) BSSvClearNodeDBTable(pDevice, 1); else BSSvClearNodeDBTable(pDevice, 0); pDevice->uAssocCount = 0; pMgmt->eCurrState = WMAC_STATE_IDLE; - pDevice->bFixRate = FALSE; + pDevice->bFixRate = false; vMgrCreateOwnIBSS((void *)pDevice, &Status); if (Status != CMD_STATUS_SUCCESS){ @@ -791,7 +792,7 @@ printk("chester-abyDesireSSID=%s\n",((PWLAN_IE_SSID)pMgmt->abyDesireSSID)->abySS if (netif_queue_stopped(pDevice->dev)){ netif_wake_queue(pDevice->dev); } - pDevice->bLinkPass = TRUE; + pDevice->bLinkPass = true; add_timer(&pMgmt->sTimerSecondCallback); } s_bCommandComplete(pDevice); @@ -803,10 +804,10 @@ printk("chester-abyDesireSSID=%s\n",((PWLAN_IE_SSID)pMgmt->abyDesireSSID)->abySS while ((skb = skb_dequeue(&pMgmt->sNodeDBTable[0].sTxPSQueue)) != NULL) { if (skb_queue_empty(&pMgmt->sNodeDBTable[0].sTxPSQueue)) { pMgmt->abyPSTxMap[0] &= ~byMask[0]; - pDevice->bMoreData = FALSE; + pDevice->bMoreData = false; } else { - pDevice->bMoreData = TRUE; + pDevice->bMoreData = true; } if (!device_dma0_xmit(pDevice, skb, 0)) { DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Multicast ps tx fail \n"); @@ -826,10 +827,10 @@ printk("chester-abyDesireSSID=%s\n",((PWLAN_IE_SSID)pMgmt->abyDesireSSID)->abySS // clear tx map pMgmt->abyPSTxMap[pMgmt->sNodeDBTable[ii].wAID >> 3] &= ~byMask[pMgmt->sNodeDBTable[ii].wAID & 7]; - pDevice->bMoreData = FALSE; + pDevice->bMoreData = false; } else { - pDevice->bMoreData = TRUE; + pDevice->bMoreData = true; } if (!device_dma0_xmit(pDevice, skb, ii)) { DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "sta ps tx fail \n"); @@ -846,7 +847,7 @@ printk("chester-abyDesireSSID=%s\n",((PWLAN_IE_SSID)pMgmt->abyDesireSSID)->abySS ~byMask[pMgmt->sNodeDBTable[ii].wAID & 7]; DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Index=%d PS queue clear \n", ii); } - pMgmt->sNodeDBTable[ii].bRxPSPoll = FALSE; + pMgmt->sNodeDBTable[ii].bRxPSPoll = false; } } @@ -856,7 +857,7 @@ printk("chester-abyDesireSSID=%s\n",((PWLAN_IE_SSID)pMgmt->abyDesireSSID)->abySS case WLAN_CMD_RADIO_START : DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"eCommandState == WLAN_CMD_RADIO_START\n"); - if (pDevice->bRadioCmd == TRUE) + if (pDevice->bRadioCmd == true) CARDbRadioPowerOn(pDevice); else CARDbRadioPowerOff(pDevice); @@ -896,23 +897,23 @@ printk("chester-abyDesireSSID=%s\n",((PWLAN_IE_SSID)pMgmt->abyDesireSSID)->abySS static -BOOL +bool s_bCommandComplete ( PSDevice pDevice ) { PWLAN_IE_SSID pSSID; - BOOL bRadioCmd = FALSE; - //WORD wDeAuthenReason = 0; - BOOL bForceSCAN = TRUE; + bool bRadioCmd = false; + //unsigned short wDeAuthenReason = 0; + bool bForceSCAN = true; PSMgmtObject pMgmt = pDevice->pMgmt; pDevice->eCommandState = WLAN_CMD_IDLE; if (pDevice->cbFreeCmdQueue == CMD_Q_SIZE) { //Command Queue Empty - pDevice->bCmdRunning = FALSE; - return TRUE; + pDevice->bCmdRunning = false; + return true; } else { pDevice->eCommand = pDevice->eCmdQueue[pDevice->uCmdDequeueIdx].eCmd; @@ -921,7 +922,7 @@ s_bCommandComplete ( bForceSCAN = pDevice->eCmdQueue[pDevice->uCmdDequeueIdx].bForceSCAN; ADD_ONE_WITH_WRAP_AROUND(pDevice->uCmdDequeueIdx, CMD_Q_SIZE); pDevice->cbFreeCmdQueue++; - pDevice->bCmdRunning = TRUE; + pDevice->bCmdRunning = true; switch ( pDevice->eCommand ) { case WLAN_CMD_BSSID_SCAN: DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"eCommandState= WLAN_CMD_BSSID_SCAN\n"); @@ -933,7 +934,7 @@ s_bCommandComplete ( memset(pMgmt->abyScanSSID, 0, WLAN_IEHDR_LEN + WLAN_SSID_MAXLEN + 1); } /* - if ((bForceSCAN == FALSE) && (pDevice->bLinkPass == TRUE)) { + if ((bForceSCAN == false) && (pDevice->bLinkPass == true)) { if ((pSSID->len == ((PWLAN_IE_SSID)pMgmt->abyCurrSSID)->len) && ( !memcmp(pSSID->abySSID, ((PWLAN_IE_SSID)pMgmt->abyCurrSSID)->abySSID, pSSID->len))) { pDevice->eCommandState = WLAN_CMD_IDLE; @@ -974,25 +975,25 @@ s_bCommandComplete ( vCommandTimerWait((void *)pDevice, 0); } - return TRUE; + return true; } -BOOL bScheduleCommand ( +bool bScheduleCommand ( void *hDeviceContext, CMD_CODE eCommand, - PBYTE pbyItem0 + unsigned char *pbyItem0 ) { PSDevice pDevice = (PSDevice)hDeviceContext; if (pDevice->cbFreeCmdQueue == 0) { - return (FALSE); + return (false); } pDevice->eCmdQueue[pDevice->uCmdEnqueueIdx].eCmd = eCommand; - pDevice->eCmdQueue[pDevice->uCmdEnqueueIdx].bForceSCAN = TRUE; + pDevice->eCmdQueue[pDevice->uCmdEnqueueIdx].bForceSCAN = true; memset(pDevice->eCmdQueue[pDevice->uCmdEnqueueIdx].abyCmdDesireSSID, 0 , WLAN_IEHDR_LEN + WLAN_SSID_MAXLEN + 1); if (pbyItem0 != NULL) { @@ -1001,7 +1002,7 @@ BOOL bScheduleCommand ( case WLAN_CMD_BSSID_SCAN: memcpy(pDevice->eCmdQueue[pDevice->uCmdEnqueueIdx].abyCmdDesireSSID, pbyItem0, WLAN_IEHDR_LEN + WLAN_SSID_MAXLEN + 1); - pDevice->eCmdQueue[pDevice->uCmdEnqueueIdx].bForceSCAN = FALSE; + pDevice->eCmdQueue[pDevice->uCmdEnqueueIdx].bForceSCAN = false; break; case WLAN_CMD_SSID: @@ -1014,7 +1015,7 @@ BOOL bScheduleCommand ( break; /* case WLAN_CMD_DEAUTH: - pDevice->eCmdQueue[pDevice->uCmdEnqueueIdx].wDeAuthenReason = *((PWORD)pbyItem0); + pDevice->eCmdQueue[pDevice->uCmdEnqueueIdx].wDeAuthenReason = *((unsigned short *)pbyItem0); break; */ @@ -1037,12 +1038,12 @@ BOOL bScheduleCommand ( ADD_ONE_WITH_WRAP_AROUND(pDevice->uCmdEnqueueIdx, CMD_Q_SIZE); pDevice->cbFreeCmdQueue--; - if (pDevice->bCmdRunning == FALSE) { + if (pDevice->bCmdRunning == false) { s_bCommandComplete(pDevice); } else { } - return (TRUE); + return (true); } @@ -1057,16 +1058,16 @@ BOOL bScheduleCommand ( * Out: * none * - * Return Value: TRUE if success; otherwise FALSE + * Return Value: true if success; otherwise false * */ -BOOL bClearBSSID_SCAN ( +bool bClearBSSID_SCAN ( void *hDeviceContext ) { PSDevice pDevice = (PSDevice)hDeviceContext; - UINT uCmdDequeueIdx = pDevice->uCmdDequeueIdx; - UINT ii; + unsigned int uCmdDequeueIdx = pDevice->uCmdDequeueIdx; + unsigned int ii; if ((pDevice->cbFreeCmdQueue < CMD_Q_SIZE) && (uCmdDequeueIdx != pDevice->uCmdEnqueueIdx)) { for (ii = 0; ii < (CMD_Q_SIZE - pDevice->cbFreeCmdQueue); ii ++) { @@ -1077,7 +1078,7 @@ BOOL bClearBSSID_SCAN ( break; } } - return TRUE; + return true; } //mike add:reset command timer @@ -1092,15 +1093,15 @@ vResetCommandTimer( del_timer(&pDevice->sTimerCommand); //init timer init_timer(&pDevice->sTimerCommand); - pDevice->sTimerCommand.data = (ULONG)pDevice; + pDevice->sTimerCommand.data = (unsigned long) pDevice; pDevice->sTimerCommand.function = (TimerFunction)vCommandTimer; pDevice->sTimerCommand.expires = RUN_AT(HZ); pDevice->cbFreeCmdQueue = CMD_Q_SIZE; pDevice->uCmdDequeueIdx = 0; pDevice->uCmdEnqueueIdx = 0; pDevice->eCommandState = WLAN_CMD_IDLE; - pDevice->bCmdRunning = FALSE; - pDevice->bCmdClear = FALSE; + pDevice->bCmdRunning = false; + pDevice->bCmdClear = false; } @@ -1125,16 +1126,16 @@ BSSvSecondTxData( spin_lock_irq(&pDevice->lock); #if 1 - if(((pDevice->bLinkPass ==TRUE)&&(pMgmt->eAuthenMode < WMAC_AUTH_WPA)) || //open && sharekey linking - (pDevice->fWPA_Authened == TRUE)) { //wpa linking + if(((pDevice->bLinkPass ==true)&&(pMgmt->eAuthenMode < WMAC_AUTH_WPA)) || //open && sharekey linking + (pDevice->fWPA_Authened == true)) { //wpa linking #else - if(pDevice->bLinkPass ==TRUE) { + if(pDevice->bLinkPass ==true) { #endif // printk("mike:%s-->InSleep Tx Data Procedure\n",__FUNCTION__); - pDevice->fTxDataInSleep = TRUE; + pDevice->fTxDataInSleep = true; PSbSendNullPacket(pDevice); //send null packet - pDevice->fTxDataInSleep = FALSE; + pDevice->fTxDataInSleep = false; } spin_unlock_irq(&pDevice->lock); diff --git a/drivers/staging/vt6655/wcmd.h b/drivers/staging/vt6655/wcmd.h index c3c41808951..69d4fc55b84 100644 --- a/drivers/staging/vt6655/wcmd.h +++ b/drivers/staging/vt6655/wcmd.h @@ -75,11 +75,11 @@ typedef enum tagCMD_STATUS { typedef struct tagCMD_ITEM { CMD_CODE eCmd; - BYTE abyCmdDesireSSID[WLAN_IEHDR_LEN + WLAN_SSID_MAXLEN + 1]; - BOOL bNeedRadioOFF; - WORD wDeAuthenReason; - BOOL bRadioCmd; - BOOL bForceSCAN; + unsigned char abyCmdDesireSSID[WLAN_IEHDR_LEN + WLAN_SSID_MAXLEN + 1]; + bool bNeedRadioOFF; + unsigned short wDeAuthenReason; + bool bRadioCmd; + bool bForceSCAN; } CMD_ITEM, *PCMD_ITEM; // Command state @@ -119,21 +119,21 @@ vCommandTimer ( void *hDeviceContext ); -BOOL bClearBSSID_SCAN( +bool bClearBSSID_SCAN( void *hDeviceContext ); -BOOL +bool bScheduleCommand( void *hDeviceContext, CMD_CODE eCommand, - PBYTE pbyItem0 + unsigned char *pbyItem0 ); void vCommandTimerWait( void *hDeviceContext, - UINT MSecond + unsigned int MSecond ); #ifdef TxInSleep void diff --git a/drivers/staging/vt6655/wctl.c b/drivers/staging/vt6655/wctl.c index 64a66b2f1fc..c096583a772 100644 --- a/drivers/staging/vt6655/wctl.c +++ b/drivers/staging/vt6655/wctl.c @@ -52,8 +52,8 @@ /* * Description: - * Scan Rx cache. Return TRUE if packet is duplicate, else - * inserts in receive cache and returns FALSE. + * Scan Rx cache. Return true if packet is duplicate, else + * inserts in receive cache and returns false. * * Parameters: * In: @@ -62,14 +62,14 @@ * Out: * none * - * Return Value: TRUE if packet duplicate; otherwise FALSE + * Return Value: true if packet duplicate; otherwise false * */ -BOOL WCTLbIsDuplicate (PSCache pCache, PS802_11Header pMACHeader) +bool WCTLbIsDuplicate (PSCache pCache, PS802_11Header pMACHeader) { - UINT uIndex; - UINT ii; + unsigned int uIndex; + unsigned int ii; PSCacheEntry pCacheEntry; if (IS_FC_RETRY(pMACHeader)) { @@ -78,10 +78,10 @@ BOOL WCTLbIsDuplicate (PSCache pCache, PS802_11Header pMACHeader) for (ii = 0; ii < DUPLICATE_RX_CACHE_LENGTH; ii++) { pCacheEntry = &(pCache->asCacheEntry[uIndex]); if ((pCacheEntry->wFmSequence == pMACHeader->wSeqCtl) && - (IS_ETH_ADDRESS_EQUAL (&(pCacheEntry->abyAddr2[0]), &(pMACHeader->abyAddr2[0]))) + (!compare_ether_addr(&(pCacheEntry->abyAddr2[0]), &(pMACHeader->abyAddr2[0]))) ) { /* Duplicate match */ - return TRUE; + return true; } ADD_ONE_WITH_WRAP_AROUND(uIndex, DUPLICATE_RX_CACHE_LENGTH); } @@ -91,7 +91,7 @@ BOOL WCTLbIsDuplicate (PSCache pCache, PS802_11Header pMACHeader) pCacheEntry->wFmSequence = pMACHeader->wSeqCtl; memcpy(&(pCacheEntry->abyAddr2[0]), &(pMACHeader->abyAddr2[0]), ETH_ALEN); ADD_ONE_WITH_WRAP_AROUND(pCache->uInPtr, DUPLICATE_RX_CACHE_LENGTH); - return FALSE; + return false; } /* @@ -108,13 +108,13 @@ BOOL WCTLbIsDuplicate (PSCache pCache, PS802_11Header pMACHeader) * Return Value: index number in Defragment Database * */ -UINT WCTLuSearchDFCB (PSDevice pDevice, PS802_11Header pMACHeader) +unsigned int WCTLuSearchDFCB (PSDevice pDevice, PS802_11Header pMACHeader) { -UINT ii; +unsigned int ii; for(ii=0;ii<pDevice->cbDFCB;ii++) { - if ((pDevice->sRxDFCB[ii].bInUse == TRUE) && - (IS_ETH_ADDRESS_EQUAL (&(pDevice->sRxDFCB[ii].abyAddr2[0]), &(pMACHeader->abyAddr2[0]))) + if ((pDevice->sRxDFCB[ii].bInUse == true) && + (!compare_ether_addr(&(pDevice->sRxDFCB[ii].abyAddr2[0]), &(pMACHeader->abyAddr2[0]))) ) { // return(ii); @@ -138,17 +138,17 @@ UINT ii; * Return Value: index number in Defragment Database * */ -UINT WCTLuInsertDFCB (PSDevice pDevice, PS802_11Header pMACHeader) +unsigned int WCTLuInsertDFCB (PSDevice pDevice, PS802_11Header pMACHeader) { -UINT ii; +unsigned int ii; if (pDevice->cbFreeDFCB == 0) return(pDevice->cbDFCB); for(ii=0;ii<pDevice->cbDFCB;ii++) { - if (pDevice->sRxDFCB[ii].bInUse == FALSE) { + if (pDevice->sRxDFCB[ii].bInUse == false) { pDevice->cbFreeDFCB--; pDevice->sRxDFCB[ii].uLifetime = pDevice->dwMaxReceiveLifetime; - pDevice->sRxDFCB[ii].bInUse = TRUE; + pDevice->sRxDFCB[ii].bInUse = true; pDevice->sRxDFCB[ii].wSequence = (pMACHeader->wSeqCtl >> 4); pDevice->sRxDFCB[ii].wFragNum = (pMACHeader->wSeqCtl & 0x000F); memcpy(&(pDevice->sRxDFCB[ii].abyAddr2[0]), &(pMACHeader->abyAddr2[0]), ETH_ALEN); @@ -172,15 +172,15 @@ UINT ii; * Out: * none * - * Return Value: TRUE if it is valid fragment packet and we have resource to defragment; otherwise FALSE + * Return Value: true if it is valid fragment packet and we have resource to defragment; otherwise false * */ -BOOL WCTLbHandleFragment (PSDevice pDevice, PS802_11Header pMACHeader, UINT cbFrameLength, BOOL bWEP, BOOL bExtIV) +bool WCTLbHandleFragment (PSDevice pDevice, PS802_11Header pMACHeader, unsigned int cbFrameLength, bool bWEP, bool bExtIV) { -UINT uHeaderSize; +unsigned int uHeaderSize; - if (bWEP == TRUE) { + if (bWEP == true) { uHeaderSize = 28; if (bExtIV) // ExtIV @@ -201,17 +201,17 @@ UINT uHeaderSize; else { pDevice->uCurrentDFCBIdx = WCTLuInsertDFCB(pDevice, pMACHeader); if (pDevice->uCurrentDFCBIdx == pDevice->cbDFCB) { - return(FALSE); + return(false); } } // reserve 4 byte to match MAC RX Buffer - pDevice->sRxDFCB[pDevice->uCurrentDFCBIdx].pbyRxBuffer = (PBYTE) (pDevice->sRxDFCB[pDevice->uCurrentDFCBIdx].skb->data + 4); + pDevice->sRxDFCB[pDevice->uCurrentDFCBIdx].pbyRxBuffer = (unsigned char *) (pDevice->sRxDFCB[pDevice->uCurrentDFCBIdx].skb->data + 4); memcpy(pDevice->sRxDFCB[pDevice->uCurrentDFCBIdx].pbyRxBuffer, pMACHeader, cbFrameLength); pDevice->sRxDFCB[pDevice->uCurrentDFCBIdx].cbFrameLength = cbFrameLength; pDevice->sRxDFCB[pDevice->uCurrentDFCBIdx].pbyRxBuffer += cbFrameLength; pDevice->sRxDFCB[pDevice->uCurrentDFCBIdx].wFragNum++; //DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "First pDevice->uCurrentDFCBIdx= %d\n", pDevice->uCurrentDFCBIdx); - return(FALSE); + return(false); } else { pDevice->uCurrentDFCBIdx = WCTLuSearchDFCB(pDevice, pMACHeader); @@ -220,7 +220,7 @@ UINT uHeaderSize; (pDevice->sRxDFCB[pDevice->uCurrentDFCBIdx].wFragNum == (pMACHeader->wSeqCtl & 0x000F)) && ((pDevice->sRxDFCB[pDevice->uCurrentDFCBIdx].cbFrameLength + cbFrameLength - uHeaderSize) < 2346)) { - memcpy(pDevice->sRxDFCB[pDevice->uCurrentDFCBIdx].pbyRxBuffer, ((PBYTE) (pMACHeader) + uHeaderSize), (cbFrameLength - uHeaderSize)); + memcpy(pDevice->sRxDFCB[pDevice->uCurrentDFCBIdx].pbyRxBuffer, ((unsigned char *) (pMACHeader) + uHeaderSize), (cbFrameLength - uHeaderSize)); pDevice->sRxDFCB[pDevice->uCurrentDFCBIdx].cbFrameLength += (cbFrameLength - uHeaderSize); pDevice->sRxDFCB[pDevice->uCurrentDFCBIdx].pbyRxBuffer += (cbFrameLength - uHeaderSize); pDevice->sRxDFCB[pDevice->uCurrentDFCBIdx].wFragNum++; @@ -229,21 +229,21 @@ UINT uHeaderSize; else { // seq error or frag # error flush DFCB pDevice->cbFreeDFCB++; - pDevice->sRxDFCB[pDevice->uCurrentDFCBIdx].bInUse = FALSE; - return(FALSE); + pDevice->sRxDFCB[pDevice->uCurrentDFCBIdx].bInUse = false; + return(false); } } else { - return(FALSE); + return(false); } if (IS_LAST_FRAGMENT_PKT(pMACHeader)) { //enq defragcontrolblock pDevice->cbFreeDFCB++; - pDevice->sRxDFCB[pDevice->uCurrentDFCBIdx].bInUse = FALSE; + pDevice->sRxDFCB[pDevice->uCurrentDFCBIdx].bInUse = false; //DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Last pDevice->uCurrentDFCBIdx= %d\n", pDevice->uCurrentDFCBIdx); - return(TRUE); + return(true); } - return(FALSE); + return(false); } } diff --git a/drivers/staging/vt6655/wctl.h b/drivers/staging/vt6655/wctl.h index a1ac4791bfd..a92bb6d2b3f 100644 --- a/drivers/staging/vt6655/wctl.h +++ b/drivers/staging/vt6655/wctl.h @@ -97,10 +97,11 @@ /*--------------------- Export Functions --------------------------*/ -BOOL WCTLbIsDuplicate(PSCache pCache, PS802_11Header pMACHeader); -BOOL WCTLbHandleFragment(PSDevice pDevice, PS802_11Header pMACHeader, UINT cbFrameLength, BOOL bWEP, BOOL bExtIV); -UINT WCTLuSearchDFCB(PSDevice pDevice, PS802_11Header pMACHeader); -UINT WCTLuInsertDFCB(PSDevice pDevice, PS802_11Header pMACHeader); +bool WCTLbIsDuplicate(PSCache pCache, PS802_11Header pMACHeader); +bool WCTLbHandleFragment(PSDevice pDevice, PS802_11Header pMACHeader, + unsigned int cbFrameLength, bool bWEP, bool bExtIV); +unsigned int WCTLuSearchDFCB(PSDevice pDevice, PS802_11Header pMACHeader); +unsigned int WCTLuInsertDFCB(PSDevice pDevice, PS802_11Header pMACHeader); #endif // __WCTL_H__ diff --git a/drivers/staging/vt6655/wmgr.c b/drivers/staging/vt6655/wmgr.c index 8af356fd139..e540110a430 100644 --- a/drivers/staging/vt6655/wmgr.c +++ b/drivers/staging/vt6655/wmgr.c @@ -65,6 +65,7 @@ #include "desc.h" #include "device.h" #include "card.h" +#include "channel.h" #include "80211hdr.h" #include "80211mgr.h" #include "wmgr.h" @@ -93,9 +94,9 @@ static int msglevel =MSG_LEVEL_INFO; /*--------------------- Static Functions --------------------------*/ //2008-8-4 <add> by chester -static BOOL ChannelExceedZoneType( +static bool ChannelExceedZoneType( PSDevice pDevice, - BYTE byCurrChannel + unsigned char byCurrChannel ); // Association/diassociation functions @@ -104,9 +105,9 @@ PSTxMgmtPacket s_MgrMakeAssocRequest( PSDevice pDevice, PSMgmtObject pMgmt, - PBYTE pDAddr, - WORD wCurrCapInfo, - WORD wListenInterval, + unsigned char *pDAddr, + unsigned short wCurrCapInfo, + unsigned short wListenInterval, PWLAN_IE_SSID pCurrSSID, PWLAN_IE_SUPP_RATES pCurrRates, PWLAN_IE_SUPP_RATES pCurrExtSuppRates @@ -118,7 +119,7 @@ s_vMgrRxAssocRequest( PSDevice pDevice, PSMgmtObject pMgmt, PSRxMgmtPacket pRxPacket, - UINT uNodeIndex + unsigned int uNodeIndex ); static @@ -126,9 +127,9 @@ PSTxMgmtPacket s_MgrMakeReAssocRequest( PSDevice pDevice, PSMgmtObject pMgmt, - PBYTE pDAddr, - WORD wCurrCapInfo, - WORD wListenInterval, + unsigned char *pDAddr, + unsigned short wCurrCapInfo, + unsigned short wListenInterval, PWLAN_IE_SSID pCurrSSID, PWLAN_IE_SUPP_RATES pCurrRates, PWLAN_IE_SUPP_RATES pCurrExtSuppRates @@ -140,7 +141,7 @@ s_vMgrRxAssocResponse( PSDevice pDevice, PSMgmtObject pMgmt, PSRxMgmtPacket pRxPacket, - BOOL bReAssocType + bool bReAssocType ); static @@ -225,7 +226,7 @@ s_vMgrRxBeacon( PSDevice pDevice, PSMgmtObject pMgmt, PSRxMgmtPacket pRxPacket, - BOOL bInScan + bool bInScan ); static @@ -240,12 +241,12 @@ PSTxMgmtPacket s_MgrMakeBeacon( PSDevice pDevice, PSMgmtObject pMgmt, - WORD wCurrCapInfo, - WORD wCurrBeaconPeriod, - UINT uCurrChannel, - WORD wCurrATIMWinodw, + unsigned short wCurrCapInfo, + unsigned short wCurrBeaconPeriod, + unsigned int uCurrChannel, + unsigned short wCurrATIMWinodw, PWLAN_IE_SSID pCurrSSID, - PBYTE pCurrBSSID, + unsigned char *pCurrBSSID, PWLAN_IE_SUPP_RATES pCurrSuppRates, PWLAN_IE_SUPP_RATES pCurrExtSuppRates ); @@ -257,10 +258,10 @@ PSTxMgmtPacket s_MgrMakeAssocResponse( PSDevice pDevice, PSMgmtObject pMgmt, - WORD wCurrCapInfo, - WORD wAssocStatus, - WORD wAssocAID, - PBYTE pDstAddr, + unsigned short wCurrCapInfo, + unsigned short wAssocStatus, + unsigned short wAssocAID, + unsigned char *pDstAddr, PWLAN_IE_SUPP_RATES pCurrSuppRates, PWLAN_IE_SUPP_RATES pCurrExtSuppRates ); @@ -271,10 +272,10 @@ PSTxMgmtPacket s_MgrMakeReAssocResponse( PSDevice pDevice, PSMgmtObject pMgmt, - WORD wCurrCapInfo, - WORD wAssocStatus, - WORD wAssocAID, - PBYTE pDstAddr, + unsigned short wCurrCapInfo, + unsigned short wAssocStatus, + unsigned short wAssocAID, + unsigned char *pDstAddr, PWLAN_IE_SUPP_RATES pCurrSuppRates, PWLAN_IE_SUPP_RATES pCurrExtSuppRates ); @@ -285,16 +286,16 @@ PSTxMgmtPacket s_MgrMakeProbeResponse( PSDevice pDevice, PSMgmtObject pMgmt, - WORD wCurrCapInfo, - WORD wCurrBeaconPeriod, - UINT uCurrChannel, - WORD wCurrATIMWinodw, - PBYTE pDstAddr, + unsigned short wCurrCapInfo, + unsigned short wCurrBeaconPeriod, + unsigned int uCurrChannel, + unsigned short wCurrATIMWinodw, + unsigned char *pDstAddr, PWLAN_IE_SSID pCurrSSID, - PBYTE pCurrBSSID, + unsigned char *pCurrBSSID, PWLAN_IE_SUPP_RATES pCurrSuppRates, PWLAN_IE_SUPP_RATES pCurrExtSuppRates, - BYTE byPHYType + unsigned char byPHYType ); // received status @@ -302,7 +303,7 @@ static void s_vMgrLogStatus( PSMgmtObject pMgmt, - WORD wStatus + unsigned short wStatus ); @@ -310,18 +311,18 @@ static void s_vMgrSynchBSS ( PSDevice pDevice, - UINT uBSSMode, + unsigned int uBSSMode, PKnownBSS pCurr, PCMD_STATUS pStatus ); -static BOOL +static bool s_bCipherMatch ( PKnownBSS pBSSNode, NDIS_802_11_ENCRYPTION_STATUS EncStatus, - PBYTE pbyCCSPK, - PBYTE pbyCCSGK + unsigned char *pbyCCSPK, + unsigned char *pbyCCSGK ); static void Encyption_Rebuild( @@ -368,7 +369,7 @@ vMgrObjectInit( pMgmt->byCSSPK = KEY_CTL_NONE; pMgmt->byCSSGK = KEY_CTL_NONE; pMgmt->wIBSSBeaconPeriod = DEFAULT_IBSS_BI; - BSSvClearBSSList((void *)pDevice, FALSE); + BSSvClearBSSList((void *)pDevice, false); return; } @@ -393,22 +394,22 @@ vMgrTimerInit( init_timer(&pMgmt->sTimerSecondCallback); - pMgmt->sTimerSecondCallback.data = (ULONG)pDevice; + pMgmt->sTimerSecondCallback.data = (unsigned long) pDevice; pMgmt->sTimerSecondCallback.function = (TimerFunction)BSSvSecondCallBack; pMgmt->sTimerSecondCallback.expires = RUN_AT(HZ); init_timer(&pDevice->sTimerCommand); - pDevice->sTimerCommand.data = (ULONG)pDevice; + pDevice->sTimerCommand.data = (unsigned long) pDevice; pDevice->sTimerCommand.function = (TimerFunction)vCommandTimer; pDevice->sTimerCommand.expires = RUN_AT(HZ); #ifdef TxInSleep init_timer(&pDevice->sTimerTxData); - pDevice->sTimerTxData.data = (ULONG)pDevice; + pDevice->sTimerTxData.data = (unsigned long) pDevice; pDevice->sTimerTxData.function = (TimerFunction)BSSvSecondTxData; pDevice->sTimerTxData.expires = RUN_AT(10*HZ); //10s callback - pDevice->fTxDataInSleep = FALSE; - pDevice->IsTxDataTrigger = FALSE; + pDevice->fTxDataInSleep = false; + pDevice->IsTxDataTrigger = false; pDevice->nTxDataTimeCout = 0; #endif @@ -441,7 +442,7 @@ vMgrObjectReset( pMgmt->eCurrMode = WMAC_MODE_STANDBY; pMgmt->eCurrState = WMAC_STATE_IDLE; - pDevice->bEnablePSMode = FALSE; + pDevice->bEnablePSMode = false; // TODO: timer return; @@ -487,15 +488,15 @@ vMgrAssocBeginSta( // ERP Phy (802.11g) should support short preamble. if (pMgmt->eCurrentPHYMode == PHY_TYPE_11G) { pMgmt->wCurrCapInfo |= WLAN_SET_CAP_INFO_SHORTPREAMBLE(1); - if (CARDbIsShorSlotTime(pMgmt->pAdapter) == TRUE) { + if (CARDbIsShorSlotTime(pMgmt->pAdapter) == true) { pMgmt->wCurrCapInfo |= WLAN_SET_CAP_INFO_SHORTSLOTTIME(1); } } else if (pMgmt->eCurrentPHYMode == PHY_TYPE_11B) { - if (CARDbIsShortPreamble(pMgmt->pAdapter) == TRUE) { + if (CARDbIsShortPreamble(pMgmt->pAdapter) == true) { pMgmt->wCurrCapInfo |= WLAN_SET_CAP_INFO_SHORTPREAMBLE(1); } } - if (pMgmt->b11hEnable == TRUE) + if (pMgmt->b11hEnable == true) pMgmt->wCurrCapInfo |= WLAN_SET_CAP_INFO_SPECTRUMMNG(1); /* build an assocreq frame and send it */ @@ -566,15 +567,15 @@ vMgrReAssocBeginSta( // ERP Phy (802.11g) should support short preamble. if (pMgmt->eCurrentPHYMode == PHY_TYPE_11G) { pMgmt->wCurrCapInfo |= WLAN_SET_CAP_INFO_SHORTPREAMBLE(1); - if (CARDbIsShorSlotTime(pMgmt->pAdapter) == TRUE) { + if (CARDbIsShorSlotTime(pMgmt->pAdapter) == true) { pMgmt->wCurrCapInfo |= WLAN_SET_CAP_INFO_SHORTSLOTTIME(1); } } else if (pMgmt->eCurrentPHYMode == PHY_TYPE_11B) { - if (CARDbIsShortPreamble(pMgmt->pAdapter) == TRUE) { + if (CARDbIsShortPreamble(pMgmt->pAdapter) == true) { pMgmt->wCurrCapInfo |= WLAN_SET_CAP_INFO_SHORTPREAMBLE(1); } } - if (pMgmt->b11hEnable == TRUE) + if (pMgmt->b11hEnable == true) pMgmt->wCurrCapInfo |= WLAN_SET_CAP_INFO_SPECTRUMMNG(1); @@ -619,8 +620,8 @@ void vMgrDisassocBeginSta( void *hDeviceContext, PSMgmtObject pMgmt, - PBYTE abyDestAddress, - WORD wReason, + unsigned char *abyDestAddress, + unsigned short wReason, PCMD_STATUS pStatus ) { @@ -630,10 +631,10 @@ vMgrDisassocBeginSta( pTxPacket = (PSTxMgmtPacket)pMgmt->pbyMgmtPacketPool; memset(pTxPacket, 0, sizeof(STxMgmtPacket) + WLAN_DISASSOC_FR_MAXLEN); - pTxPacket->p80211Header = (PUWLAN_80211HDR)((PBYTE)pTxPacket + sizeof(STxMgmtPacket)); + pTxPacket->p80211Header = (PUWLAN_80211HDR)((unsigned char *)pTxPacket + sizeof(STxMgmtPacket)); // Setup the sFrame structure - sFrame.pBuf = (PBYTE)pTxPacket->p80211Header; + sFrame.pBuf = (unsigned char *)pTxPacket->p80211Header; sFrame.len = WLAN_DISASSOC_FR_MAXLEN; // format fixed field frame structure @@ -683,17 +684,17 @@ s_vMgrRxAssocRequest( PSDevice pDevice, PSMgmtObject pMgmt, PSRxMgmtPacket pRxPacket, - UINT uNodeIndex + unsigned int uNodeIndex ) { WLAN_FR_ASSOCREQ sFrame; CMD_STATUS Status; PSTxMgmtPacket pTxPacket; - WORD wAssocStatus = 0; - WORD wAssocAID = 0; - UINT uRateLen = WLAN_RATES_MAXLEN; - BYTE abyCurrSuppRates[WLAN_IEHDR_LEN + WLAN_RATES_MAXLEN + 1]; - BYTE abyCurrExtSuppRates[WLAN_IEHDR_LEN + WLAN_RATES_MAXLEN + 1]; + unsigned short wAssocStatus = 0; + unsigned short wAssocAID = 0; + unsigned int uRateLen = WLAN_RATES_MAXLEN; + unsigned char abyCurrSuppRates[WLAN_IEHDR_LEN + WLAN_RATES_MAXLEN + 1]; + unsigned char abyCurrExtSuppRates[WLAN_IEHDR_LEN + WLAN_RATES_MAXLEN + 1]; if (pMgmt->eCurrMode != WMAC_MODE_ESS_AP) @@ -708,7 +709,7 @@ s_vMgrRxAssocRequest( memset(abyCurrSuppRates, 0, WLAN_IEHDR_LEN + WLAN_RATES_MAXLEN + 1); memset(abyCurrExtSuppRates, 0, WLAN_IEHDR_LEN + WLAN_RATES_MAXLEN + 1); sFrame.len = pRxPacket->cbMPDULen; - sFrame.pBuf = (PBYTE)pRxPacket->p80211Header; + sFrame.pBuf = (unsigned char *)pRxPacket->p80211Header; vMgrDecodeAssocRequest(&sFrame); @@ -717,7 +718,7 @@ s_vMgrRxAssocRequest( pMgmt->sNodeDBTable[uNodeIndex].wCapInfo = cpu_to_le16(*sFrame.pwCapInfo); pMgmt->sNodeDBTable[uNodeIndex].wListenInterval = cpu_to_le16(*sFrame.pwListenInterval); pMgmt->sNodeDBTable[uNodeIndex].bPSEnable = - WLAN_GET_FC_PWRMGT(sFrame.pHdr->sA3.wFrameCtl) ? TRUE : FALSE; + WLAN_GET_FC_PWRMGT(sFrame.pHdr->sA3.wFrameCtl) ? true : false; // Todo: check sta basic rate, if ap can't support, set status code if (pDevice->eCurrentPHYType == PHY_TYPE_11B) { uRateLen = WLAN_RATES_MAXLEN_11B; @@ -739,7 +740,7 @@ s_vMgrRxAssocRequest( RATEvParseMaxRate((void *)pDevice, (PWLAN_IE_SUPP_RATES)abyCurrSuppRates, (PWLAN_IE_SUPP_RATES)abyCurrExtSuppRates, - FALSE, // do not change our basic rate + false, // do not change our basic rate &(pMgmt->sNodeDBTable[uNodeIndex].wMaxBasicRate), &(pMgmt->sNodeDBTable[uNodeIndex].wMaxSuppRate), &(pMgmt->sNodeDBTable[uNodeIndex].wSuppRate), @@ -758,20 +759,20 @@ s_vMgrRxAssocRequest( WLAN_GET_CAP_INFO_SHORTPREAMBLE(*sFrame.pwCapInfo); pMgmt->sNodeDBTable[uNodeIndex].bShortSlotTime = WLAN_GET_CAP_INFO_SHORTSLOTTIME(*sFrame.pwCapInfo); - pMgmt->sNodeDBTable[uNodeIndex].wAID = (WORD)uNodeIndex; + pMgmt->sNodeDBTable[uNodeIndex].wAID = (unsigned short)uNodeIndex; wAssocStatus = WLAN_MGMT_STATUS_SUCCESS; - wAssocAID = (WORD)uNodeIndex; + wAssocAID = (unsigned short)uNodeIndex; // check if ERP support if(pMgmt->sNodeDBTable[uNodeIndex].wMaxSuppRate > RATE_11M) - pMgmt->sNodeDBTable[uNodeIndex].bERPExist = TRUE; + pMgmt->sNodeDBTable[uNodeIndex].bERPExist = true; if (pMgmt->sNodeDBTable[uNodeIndex].wMaxSuppRate <= RATE_11M) { // B only STA join - pDevice->bProtectMode = TRUE; - pDevice->bNonERPPresent = TRUE; + pDevice->bProtectMode = true; + pDevice->bNonERPPresent = true; } - if (pMgmt->sNodeDBTable[uNodeIndex].bShortPreamble == FALSE) { - pDevice->bBarkerPreambleMd = TRUE; + if (pMgmt->sNodeDBTable[uNodeIndex].bShortPreamble == false) { + pDevice->bBarkerPreambleMd = true; } DBG_PRT(MSG_LEVEL_INFO, KERN_INFO "Associate AID= %d \n", wAssocAID); @@ -845,17 +846,17 @@ s_vMgrRxReAssocRequest( PSDevice pDevice, PSMgmtObject pMgmt, PSRxMgmtPacket pRxPacket, - UINT uNodeIndex + unsigned int uNodeIndex ) { WLAN_FR_REASSOCREQ sFrame; CMD_STATUS Status; PSTxMgmtPacket pTxPacket; - WORD wAssocStatus = 0; - WORD wAssocAID = 0; - UINT uRateLen = WLAN_RATES_MAXLEN; - BYTE abyCurrSuppRates[WLAN_IEHDR_LEN + WLAN_RATES_MAXLEN + 1]; - BYTE abyCurrExtSuppRates[WLAN_IEHDR_LEN + WLAN_RATES_MAXLEN + 1]; + unsigned short wAssocStatus = 0; + unsigned short wAssocAID = 0; + unsigned int uRateLen = WLAN_RATES_MAXLEN; + unsigned char abyCurrSuppRates[WLAN_IEHDR_LEN + WLAN_RATES_MAXLEN + 1]; + unsigned char abyCurrExtSuppRates[WLAN_IEHDR_LEN + WLAN_RATES_MAXLEN + 1]; if (pMgmt->eCurrMode != WMAC_MODE_ESS_AP) return; @@ -866,7 +867,7 @@ s_vMgrRxReAssocRequest( //decode the frame memset(&sFrame, 0, sizeof(WLAN_FR_REASSOCREQ)); sFrame.len = pRxPacket->cbMPDULen; - sFrame.pBuf = (PBYTE)pRxPacket->p80211Header; + sFrame.pBuf = (unsigned char *)pRxPacket->p80211Header; vMgrDecodeReassocRequest(&sFrame); if (pMgmt->sNodeDBTable[uNodeIndex].eNodeState >= NODE_AUTH) { @@ -874,7 +875,7 @@ s_vMgrRxReAssocRequest( pMgmt->sNodeDBTable[uNodeIndex].wCapInfo = cpu_to_le16(*sFrame.pwCapInfo); pMgmt->sNodeDBTable[uNodeIndex].wListenInterval = cpu_to_le16(*sFrame.pwListenInterval); pMgmt->sNodeDBTable[uNodeIndex].bPSEnable = - WLAN_GET_FC_PWRMGT(sFrame.pHdr->sA3.wFrameCtl) ? TRUE : FALSE; + WLAN_GET_FC_PWRMGT(sFrame.pHdr->sA3.wFrameCtl) ? true : false; // Todo: check sta basic rate, if ap can't support, set status code if (pDevice->eCurrentPHYType == PHY_TYPE_11B) { @@ -898,7 +899,7 @@ s_vMgrRxReAssocRequest( RATEvParseMaxRate((void *)pDevice, (PWLAN_IE_SUPP_RATES)abyCurrSuppRates, (PWLAN_IE_SUPP_RATES)abyCurrExtSuppRates, - FALSE, // do not change our basic rate + false, // do not change our basic rate &(pMgmt->sNodeDBTable[uNodeIndex].wMaxBasicRate), &(pMgmt->sNodeDBTable[uNodeIndex].wMaxSuppRate), &(pMgmt->sNodeDBTable[uNodeIndex].wSuppRate), @@ -917,21 +918,21 @@ s_vMgrRxReAssocRequest( WLAN_GET_CAP_INFO_SHORTPREAMBLE(*sFrame.pwCapInfo); pMgmt->sNodeDBTable[uNodeIndex].bShortSlotTime = WLAN_GET_CAP_INFO_SHORTSLOTTIME(*sFrame.pwCapInfo); - pMgmt->sNodeDBTable[uNodeIndex].wAID = (WORD)uNodeIndex; + pMgmt->sNodeDBTable[uNodeIndex].wAID = (unsigned short)uNodeIndex; wAssocStatus = WLAN_MGMT_STATUS_SUCCESS; - wAssocAID = (WORD)uNodeIndex; + wAssocAID = (unsigned short)uNodeIndex; // if suppurt ERP if(pMgmt->sNodeDBTable[uNodeIndex].wMaxSuppRate > RATE_11M) - pMgmt->sNodeDBTable[uNodeIndex].bERPExist = TRUE; + pMgmt->sNodeDBTable[uNodeIndex].bERPExist = true; if (pMgmt->sNodeDBTable[uNodeIndex].wMaxSuppRate <= RATE_11M) { // B only STA join - pDevice->bProtectMode = TRUE; - pDevice->bNonERPPresent = TRUE; + pDevice->bProtectMode = true; + pDevice->bNonERPPresent = true; } - if (pMgmt->sNodeDBTable[uNodeIndex].bShortPreamble == FALSE) { - pDevice->bBarkerPreambleMd = TRUE; + if (pMgmt->sNodeDBTable[uNodeIndex].bShortPreamble == false) { + pDevice->bBarkerPreambleMd = true; } DBG_PRT(MSG_LEVEL_INFO, KERN_INFO "Rx ReAssociate AID= %d \n", wAssocAID); @@ -995,12 +996,12 @@ s_vMgrRxAssocResponse( PSDevice pDevice, PSMgmtObject pMgmt, PSRxMgmtPacket pRxPacket, - BOOL bReAssocType + bool bReAssocType ) { WLAN_FR_ASSOCRESP sFrame; PWLAN_IE_SSID pItemSSID; - PBYTE pbyIEs; + unsigned char *pbyIEs; viawget_wpa_header *wpahdr; @@ -1009,7 +1010,7 @@ s_vMgrRxAssocResponse( pMgmt->eCurrState == WMAC_STATE_ASSOC) { sFrame.len = pRxPacket->cbMPDULen; - sFrame.pBuf = (PBYTE)pRxPacket->p80211Header; + sFrame.pBuf = (unsigned char *)pRxPacket->p80211Header; // decode the frame vMgrDecodeAssocResponse(&sFrame); if ((sFrame.pwCapInfo == 0) || @@ -1044,7 +1045,7 @@ s_vMgrRxAssocResponse( BSSvUpdateAPNode((void *)pDevice, sFrame.pwCapInfo, sFrame.pSuppRates, sFrame.pExtSuppRates); pItemSSID = (PWLAN_IE_SSID)pMgmt->abyCurrSSID; DBG_PRT(MSG_LEVEL_INFO, KERN_INFO "Link with AP(SSID): %s\n", pItemSSID->abySSID); - pDevice->bLinkPass = TRUE; + pDevice->bLinkPass = true; pDevice->uBBVGADiffCount = 0; if ((pDevice->bWPADEVUp) && (pDevice->skb != NULL)) { if(skb_tailroom(pDevice->skb) <(sizeof(viawget_wpa_header)+pMgmt->sAssocInfo.AssocInfo.ResponseIELength+ @@ -1073,9 +1074,9 @@ s_vMgrRxAssocResponse( //2008-0409-07, <Add> by Einsn Liu #ifdef WPA_SUPPLICANT_DRIVER_WEXT_SUPPORT - //if(pDevice->bWPADevEnable == TRUE) + //if(pDevice->bWPADevEnable == true) { - BYTE buf[512]; + unsigned char buf[512]; size_t len; union iwreq_data wrqu; int we_event; @@ -1128,7 +1129,7 @@ s_vMgrRxAssocResponse( //need clear flags related to Networkmanager pDevice->bwextcount = 0; - pDevice->bWPASuppWextEnabled = FALSE; + pDevice->bWPASuppWextEnabled = false; #endif @@ -1163,8 +1164,8 @@ vMgrAuthenBeginSta( pTxPacket = (PSTxMgmtPacket)pMgmt->pbyMgmtPacketPool; memset(pTxPacket, 0, sizeof(STxMgmtPacket) + WLAN_AUTHEN_FR_MAXLEN); - pTxPacket->p80211Header = (PUWLAN_80211HDR)((PBYTE)pTxPacket + sizeof(STxMgmtPacket)); - sFrame.pBuf = (PBYTE)pTxPacket->p80211Header; + pTxPacket->p80211Header = (PUWLAN_80211HDR)((unsigned char *)pTxPacket + sizeof(STxMgmtPacket)); + sFrame.pBuf = (unsigned char *)pTxPacket->p80211Header; sFrame.len = WLAN_AUTHEN_FR_MAXLEN; vMgrEncodeAuthen(&sFrame); /* insert values */ @@ -1212,8 +1213,8 @@ void vMgrDeAuthenBeginSta( void *hDeviceContext, PSMgmtObject pMgmt, - PBYTE abyDestAddress, - WORD wReason, + unsigned char *abyDestAddress, + unsigned short wReason, PCMD_STATUS pStatus ) { @@ -1224,8 +1225,8 @@ vMgrDeAuthenBeginSta( pTxPacket = (PSTxMgmtPacket)pMgmt->pbyMgmtPacketPool; memset(pTxPacket, 0, sizeof(STxMgmtPacket) + WLAN_DEAUTHEN_FR_MAXLEN); - pTxPacket->p80211Header = (PUWLAN_80211HDR)((PBYTE)pTxPacket + sizeof(STxMgmtPacket)); - sFrame.pBuf = (PBYTE)pTxPacket->p80211Header; + pTxPacket->p80211Header = (PUWLAN_80211HDR)((unsigned char *)pTxPacket + sizeof(STxMgmtPacket)); + sFrame.pBuf = (unsigned char *)pTxPacket->p80211Header; sFrame.len = WLAN_DEAUTHEN_FR_MAXLEN; vMgrEncodeDeauthen(&sFrame); /* insert values */ @@ -1282,7 +1283,7 @@ s_vMgrRxAuthentication( // decode the frame sFrame.len = pRxPacket->cbMPDULen; - sFrame.pBuf = (PBYTE)pRxPacket->p80211Header; + sFrame.pBuf = (unsigned char *)pRxPacket->p80211Header; vMgrDecodeAuthen(&sFrame); switch (cpu_to_le16((*(sFrame.pwAuthSequence )))){ case 1: @@ -1331,7 +1332,7 @@ s_vMgrRxAuthenSequence_1( ) { PSTxMgmtPacket pTxPacket = NULL; - UINT uNodeIndex; + unsigned int uNodeIndex; WLAN_FR_AUTHEN sFrame; PSKeyItem pTransmitKey; @@ -1353,8 +1354,8 @@ s_vMgrRxAuthenSequence_1( // send auth reply pTxPacket = (PSTxMgmtPacket)pMgmt->pbyMgmtPacketPool; memset(pTxPacket, 0, sizeof(STxMgmtPacket) + WLAN_AUTHEN_FR_MAXLEN); - pTxPacket->p80211Header = (PUWLAN_80211HDR)((PBYTE)pTxPacket + sizeof(STxMgmtPacket)); - sFrame.pBuf = (PBYTE)pTxPacket->p80211Header; + pTxPacket->p80211Header = (PUWLAN_80211HDR)((unsigned char *)pTxPacket + sizeof(STxMgmtPacket)); + sFrame.pBuf = (unsigned char *)pTxPacket->p80211Header; sFrame.len = WLAN_AUTHEN_FR_MAXLEN; // format buffer structure vMgrEncodeAuthen(&sFrame); @@ -1393,7 +1394,7 @@ s_vMgrRxAuthenSequence_1( sFrame.pChallenge->len = WLAN_CHALLENGE_LEN; memset(pMgmt->abyChallenge, 0, WLAN_CHALLENGE_LEN); // get group key - if(KeybGetTransmitKey(&(pDevice->sKey), pDevice->abyBroadcastAddr, GROUP_KEY, &pTransmitKey) == TRUE) { + if(KeybGetTransmitKey(&(pDevice->sKey), pDevice->abyBroadcastAddr, GROUP_KEY, &pTransmitKey) == true) { rc4_init(&pDevice->SBox, pDevice->abyPRNG, pTransmitKey->uKeyLength+3); rc4_encrypt(&pDevice->SBox, pMgmt->abyChallenge, pMgmt->abyChallenge, WLAN_CHALLENGE_LEN); } @@ -1466,8 +1467,8 @@ s_vMgrRxAuthenSequence_2( if (cpu_to_le16((*(pFrame->pwStatus))) == WLAN_MGMT_STATUS_SUCCESS) { pTxPacket = (PSTxMgmtPacket)pMgmt->pbyMgmtPacketPool; memset(pTxPacket, 0, sizeof(STxMgmtPacket) + WLAN_AUTHEN_FR_MAXLEN); - pTxPacket->p80211Header = (PUWLAN_80211HDR)((PBYTE)pTxPacket + sizeof(STxMgmtPacket)); - sFrame.pBuf = (PBYTE)pTxPacket->p80211Header; + pTxPacket->p80211Header = (PUWLAN_80211HDR)((unsigned char *)pTxPacket + sizeof(STxMgmtPacket)); + sFrame.pBuf = (unsigned char *)pTxPacket->p80211Header; sFrame.len = WLAN_AUTHEN_FR_MAXLEN; // format buffer structure vMgrEncodeAuthen(&sFrame); @@ -1539,8 +1540,8 @@ s_vMgrRxAuthenSequence_3( ) { PSTxMgmtPacket pTxPacket = NULL; - UINT uStatusCode = 0 ; - UINT uNodeIndex = 0; + unsigned int uStatusCode = 0 ; + unsigned int uNodeIndex = 0; WLAN_FR_AUTHEN sFrame; if (!WLAN_GET_FC_ISWEP(pFrame->pHdr->sA3.wFrameCtl)) { @@ -1573,8 +1574,8 @@ reply: // send auth reply pTxPacket = (PSTxMgmtPacket)pMgmt->pbyMgmtPacketPool; memset(pTxPacket, 0, sizeof(STxMgmtPacket) + WLAN_AUTHEN_FR_MAXLEN); - pTxPacket->p80211Header = (PUWLAN_80211HDR)((PBYTE)pTxPacket + sizeof(STxMgmtPacket)); - sFrame.pBuf = (PBYTE)pTxPacket->p80211Header; + pTxPacket->p80211Header = (PUWLAN_80211HDR)((unsigned char *)pTxPacket + sizeof(STxMgmtPacket)); + sFrame.pBuf = (unsigned char *)pTxPacket->p80211Header; sFrame.len = WLAN_AUTHEN_FR_MAXLEN; // format buffer structure vMgrEncodeAuthen(&sFrame); @@ -1666,7 +1667,7 @@ s_vMgrRxDisassociation( ) { WLAN_FR_DISASSOC sFrame; - UINT uNodeIndex = 0; + unsigned int uNodeIndex = 0; // CMD_STATUS CmdStatus; viawget_wpa_header *wpahdr; @@ -1674,7 +1675,7 @@ s_vMgrRxDisassociation( // if is acting an AP.. // a STA is leaving this BSS.. sFrame.len = pRxPacket->cbMPDULen; - sFrame.pBuf = (PBYTE)pRxPacket->p80211Header; + sFrame.pBuf = (unsigned char *)pRxPacket->p80211Header; if (BSSDBbIsSTAInNodeDB(pMgmt, pRxPacket->p80211Header->sA3.abyAddr2, &uNodeIndex)) { BSSvRemoveOneNode(pDevice, uNodeIndex); } @@ -1684,7 +1685,7 @@ s_vMgrRxDisassociation( } else if (pMgmt->eCurrMode == WMAC_MODE_ESS_STA ){ sFrame.len = pRxPacket->cbMPDULen; - sFrame.pBuf = (PBYTE)pRxPacket->p80211Header; + sFrame.pBuf = (unsigned char *)pRxPacket->p80211Header; vMgrDecodeDisassociation(&sFrame); DBG_PRT(MSG_LEVEL_NOTICE, KERN_INFO "AP disassociated me, reason=%d.\n", cpu_to_le16(*(sFrame.pwReason))); //TODO: do something let upper layer know or @@ -1709,7 +1710,7 @@ s_vMgrRxDisassociation( }; #ifdef WPA_SUPPLICANT_DRIVER_WEXT_SUPPORT - // if(pDevice->bWPASuppWextEnabled == TRUE) + // if(pDevice->bWPASuppWextEnabled == true) { union iwreq_data wrqu; memset(&wrqu, 0, sizeof (wrqu)); @@ -1745,7 +1746,7 @@ s_vMgrRxDeauthentication( ) { WLAN_FR_DEAUTHEN sFrame; - UINT uNodeIndex = 0; + unsigned int uNodeIndex = 0; viawget_wpa_header *wpahdr; @@ -1754,7 +1755,7 @@ s_vMgrRxDeauthentication( // if is acting an AP.. // a STA is leaving this BSS.. sFrame.len = pRxPacket->cbMPDULen; - sFrame.pBuf = (PBYTE)pRxPacket->p80211Header; + sFrame.pBuf = (unsigned char *)pRxPacket->p80211Header; if (BSSDBbIsSTAInNodeDB(pMgmt, pRxPacket->p80211Header->sA3.abyAddr2, &uNodeIndex)) { BSSvRemoveOneNode(pDevice, uNodeIndex); } @@ -1765,17 +1766,17 @@ s_vMgrRxDeauthentication( else { if (pMgmt->eCurrMode == WMAC_MODE_ESS_STA ) { sFrame.len = pRxPacket->cbMPDULen; - sFrame.pBuf = (PBYTE)pRxPacket->p80211Header; + sFrame.pBuf = (unsigned char *)pRxPacket->p80211Header; vMgrDecodeDeauthen(&sFrame); DBG_PRT(MSG_LEVEL_NOTICE, KERN_INFO "AP deauthed me, reason=%d.\n", cpu_to_le16((*(sFrame.pwReason)))); // TODO: update BSS list for specific BSSID if pre-authentication case - if (IS_ETH_ADDRESS_EQUAL(sFrame.pHdr->sA3.abyAddr3, pMgmt->abyCurrBSSID)) { + if (!compare_ether_addr(sFrame.pHdr->sA3.abyAddr3, pMgmt->abyCurrBSSID)) { if (pMgmt->eCurrState >= WMAC_STATE_AUTHPENDING) { - pMgmt->sNodeDBTable[0].bActive = FALSE; + pMgmt->sNodeDBTable[0].bActive = false; pMgmt->eCurrMode = WMAC_MODE_STANDBY; pMgmt->eCurrState = WMAC_STATE_IDLE; netif_stop_queue(pDevice->dev); - pDevice->bLinkPass = FALSE; + pDevice->bLinkPass = false; } }; @@ -1795,7 +1796,7 @@ s_vMgrRxDeauthentication( }; #ifdef WPA_SUPPLICANT_DRIVER_WEXT_SUPPORT - // if(pDevice->bWPASuppWextEnabled == TRUE) + // if(pDevice->bWPASuppWextEnabled == true) { union iwreq_data wrqu; memset(&wrqu, 0, sizeof (wrqu)); @@ -1825,23 +1826,23 @@ s_vMgrRxDeauthentication( * True:exceed; * False:normal case -*/ -static BOOL +static bool ChannelExceedZoneType( PSDevice pDevice, - BYTE byCurrChannel + unsigned char byCurrChannel ) { - BOOL exceed=FALSE; + bool exceed=false; switch(pDevice->byZoneType) { case 0x00: //USA:1~11 if((byCurrChannel<1) ||(byCurrChannel>11)) - exceed = TRUE; + exceed = true; break; case 0x01: //Japan:1~13 case 0x02: //Europe:1~13 if((byCurrChannel<1) ||(byCurrChannel>13)) - exceed = TRUE; + exceed = true; break; default: //reserve for other zonetype break; @@ -1868,39 +1869,39 @@ s_vMgrRxBeacon( PSDevice pDevice, PSMgmtObject pMgmt, PSRxMgmtPacket pRxPacket, - BOOL bInScan + bool bInScan ) { PKnownBSS pBSSList; WLAN_FR_BEACON sFrame; QWORD qwTSFOffset; - BOOL bIsBSSIDEqual = FALSE; - BOOL bIsSSIDEqual = FALSE; - BOOL bTSFLargeDiff = FALSE; - BOOL bTSFOffsetPostive = FALSE; - BOOL bUpdateTSF = FALSE; - BOOL bIsAPBeacon = FALSE; - BOOL bIsChannelEqual = FALSE; - UINT uLocateByteIndex; - BYTE byTIMBitOn = 0; - WORD wAIDNumber = 0; - UINT uNodeIndex; + bool bIsBSSIDEqual = false; + bool bIsSSIDEqual = false; + bool bTSFLargeDiff = false; + bool bTSFOffsetPostive = false; + bool bUpdateTSF = false; + bool bIsAPBeacon = false; + bool bIsChannelEqual = false; + unsigned int uLocateByteIndex; + unsigned char byTIMBitOn = 0; + unsigned short wAIDNumber = 0; + unsigned int uNodeIndex; QWORD qwTimestamp, qwLocalTSF; QWORD qwCurrTSF; - WORD wStartIndex = 0; - WORD wAIDIndex = 0; - BYTE byCurrChannel = pRxPacket->byRxChannel; + unsigned short wStartIndex = 0; + unsigned short wAIDIndex = 0; + unsigned char byCurrChannel = pRxPacket->byRxChannel; ERPObject sERP; - UINT uRateLen = WLAN_RATES_MAXLEN; - BOOL bChannelHit = FALSE; - BOOL bUpdatePhyParameter = FALSE; - BYTE byIEChannel = 0; + unsigned int uRateLen = WLAN_RATES_MAXLEN; + bool bChannelHit = false; + bool bUpdatePhyParameter = false; + unsigned char byIEChannel = 0; memset(&sFrame, 0, sizeof(WLAN_FR_BEACON)); sFrame.len = pRxPacket->cbMPDULen; - sFrame.pBuf = (PBYTE)pRxPacket->p80211Header; + sFrame.pBuf = (unsigned char *)pRxPacket->p80211Header; // decode the beacon frame vMgrDecodeBeacon(&sFrame); @@ -1917,29 +1918,29 @@ s_vMgrRxBeacon( if (sFrame.pDSParms != NULL) { if (byCurrChannel > CB_MAX_CHANNEL_24G) { // channel remapping to - byIEChannel = CARDbyGetChannelMapping(pDevice, sFrame.pDSParms->byCurrChannel, PHY_TYPE_11A); + byIEChannel = get_channel_mapping(pDevice, sFrame.pDSParms->byCurrChannel, PHY_TYPE_11A); } else { byIEChannel = sFrame.pDSParms->byCurrChannel; } if (byCurrChannel != byIEChannel) { // adjust channel info. bcs we rcv adjcent channel pakckets - bChannelHit = FALSE; + bChannelHit = false; byCurrChannel = byIEChannel; } } else { // no DS channel info - bChannelHit = TRUE; + bChannelHit = true; } //2008-0730-01<Add>by MikeLiu -if(ChannelExceedZoneType(pDevice,byCurrChannel)==TRUE) +if(ChannelExceedZoneType(pDevice,byCurrChannel)==true) return; if (sFrame.pERP != NULL) { sERP.byERP = sFrame.pERP->byContext; - sERP.bERPExist = TRUE; + sERP.bERPExist = true; } else { - sERP.bERPExist = FALSE; + sERP.bERPExist = false; sERP.byERP = 0; } @@ -1993,8 +1994,8 @@ if(ChannelExceedZoneType(pDevice,byCurrChannel)==TRUE) return; } - if(byCurrChannel == (BYTE)pMgmt->uCurrChannel) - bIsChannelEqual = TRUE; + if(byCurrChannel == (unsigned char)pMgmt->uCurrChannel) + bIsChannelEqual = true; if (bIsChannelEqual && (pMgmt->eCurrMode == WMAC_MODE_ESS_AP)) { @@ -2021,7 +2022,7 @@ if(ChannelExceedZoneType(pDevice,byCurrChannel)==TRUE) if (WLAN_GET_ERP_USE_PROTECTION(pDevice->byERPFlag)){ if (!pDevice->bProtectMode) { MACvEnableProtectMD(pDevice->PortOffset); - pDevice->bProtectMode = TRUE; + pDevice->bProtectMode = true; } } } @@ -2035,7 +2036,7 @@ if(ChannelExceedZoneType(pDevice,byCurrChannel)==TRUE) pMgmt->abyCurrBSSID, WLAN_BSSID_LEN) == 0) { - bIsBSSIDEqual = TRUE; + bIsBSSIDEqual = true; // 2008-05-21 <add> by Richardtai pDevice->uCurrRSSI = pRxPacket->uRSSI; @@ -2052,30 +2053,30 @@ if(ChannelExceedZoneType(pDevice,byCurrChannel)==TRUE) ((PWLAN_IE_SSID)pMgmt->abyCurrSSID)->abySSID, sFrame.pSSID->len ) == 0) { - bIsSSIDEqual = TRUE; + bIsSSIDEqual = true; }; } - if ((WLAN_GET_CAP_INFO_ESS(*sFrame.pwCapInfo)== TRUE) && - (bIsBSSIDEqual == TRUE) && - (bIsSSIDEqual == TRUE) && + if ((WLAN_GET_CAP_INFO_ESS(*sFrame.pwCapInfo)== true) && + (bIsBSSIDEqual == true) && + (bIsSSIDEqual == true) && (pMgmt->eCurrMode == WMAC_MODE_ESS_STA) && (pMgmt->eCurrState == WMAC_STATE_ASSOC)) { // add state check to prevent reconnect fail since we'll receive Beacon - bIsAPBeacon = TRUE; + bIsAPBeacon = true; if (pBSSList != NULL) { // Compare PHY paramater setting if (pMgmt->wCurrCapInfo != pBSSList->wCapInfo) { - bUpdatePhyParameter = TRUE; + bUpdatePhyParameter = true; pMgmt->wCurrCapInfo = pBSSList->wCapInfo; } if (sFrame.pERP != NULL) { if ((sFrame.pERP->byElementID == WLAN_EID_ERP) && (pMgmt->byERPContext != sFrame.pERP->byContext)) { - bUpdatePhyParameter = TRUE; + bUpdatePhyParameter = true; pMgmt->byERPContext = sFrame.pERP->byContext; } } @@ -2094,7 +2095,7 @@ if(ChannelExceedZoneType(pDevice,byCurrChannel)==TRUE) RATEvParseMaxRate( (void *)pDevice, (PWLAN_IE_SUPP_RATES)pMgmt->abyCurrSuppRates, (PWLAN_IE_SUPP_RATES)pMgmt->abyCurrExtSuppRates, - TRUE, + true, &(pMgmt->sNodeDBTable[0].wMaxBasicRate), &(pMgmt->sNodeDBTable[0].wMaxSuppRate), &(pMgmt->sNodeDBTable[0].wSuppRate), @@ -2104,7 +2105,7 @@ if(ChannelExceedZoneType(pDevice,byCurrChannel)==TRUE) #ifdef PLICE_DEBUG //printk("RxBeacon:MaxSuppRate is %d\n",pMgmt->sNodeDBTable[0].wMaxSuppRate); #endif - if (bUpdatePhyParameter == TRUE) { + if (bUpdatePhyParameter == true) { CARDbSetPhyParameter( pMgmt->pAdapter, pMgmt->eCurrentPHYMode, pMgmt->wCurrCapInfo, @@ -2115,19 +2116,19 @@ if(ChannelExceedZoneType(pDevice,byCurrChannel)==TRUE) } if (sFrame.pIE_PowerConstraint != NULL) { CARDvSetPowerConstraint(pMgmt->pAdapter, - (BYTE) pBSSList->uChannel, + (unsigned char) pBSSList->uChannel, sFrame.pIE_PowerConstraint->byPower ); } if (sFrame.pIE_CHSW != NULL) { CARDbChannelSwitch( pMgmt->pAdapter, sFrame.pIE_CHSW->byMode, - CARDbyGetChannelMapping(pMgmt->pAdapter, sFrame.pIE_CHSW->byMode, pMgmt->eCurrentPHYMode), + get_channel_mapping(pMgmt->pAdapter, sFrame.pIE_CHSW->byMode, pMgmt->eCurrentPHYMode), sFrame.pIE_CHSW->byCount ); - } else if (bIsChannelEqual == FALSE) { - CARDbSetChannel(pMgmt->pAdapter, pBSSList->uChannel); + } else if (bIsChannelEqual == false) { + set_channel(pMgmt->pAdapter, pBSSList->uChannel); } } } @@ -2148,17 +2149,17 @@ if(ChannelExceedZoneType(pDevice,byCurrChannel)==TRUE) // check if beacon TSF larger or small than our local TSF if (HIDWORD(qwTimestamp) == HIDWORD(qwLocalTSF)) { if (LODWORD(qwTimestamp) >= LODWORD(qwLocalTSF)) { - bTSFOffsetPostive = TRUE; + bTSFOffsetPostive = true; } else { - bTSFOffsetPostive = FALSE; + bTSFOffsetPostive = false; } } else if (HIDWORD(qwTimestamp) > HIDWORD(qwLocalTSF)) { - bTSFOffsetPostive = TRUE; + bTSFOffsetPostive = true; } else if (HIDWORD(qwTimestamp) < HIDWORD(qwLocalTSF)) { - bTSFOffsetPostive = FALSE; + bTSFOffsetPostive = false; }; if (bTSFOffsetPostive) { @@ -2170,21 +2171,21 @@ if(ChannelExceedZoneType(pDevice,byCurrChannel)==TRUE) if (HIDWORD(qwTSFOffset) != 0 || (LODWORD(qwTSFOffset) > TRIVIAL_SYNC_DIFFERENCE )) { - bTSFLargeDiff = TRUE; + bTSFLargeDiff = true; } // if infra mode - if (bIsAPBeacon == TRUE) { + if (bIsAPBeacon == true) { // Infra mode: Local TSF always follow AP's TSF if Difference huge. if (bTSFLargeDiff) - bUpdateTSF = TRUE; + bUpdateTSF = true; - if ((pDevice->bEnablePSMode == TRUE) &&(sFrame.pTIM != 0)) { + if ((pDevice->bEnablePSMode == true) &&(sFrame.pTIM != 0)) { // deal with DTIM, analysis TIM - pMgmt->bMulticastTIM = WLAN_MGMT_IS_MULTICAST_TIM(sFrame.pTIM->byBitMapCtl) ? TRUE : FALSE ; + pMgmt->bMulticastTIM = WLAN_MGMT_IS_MULTICAST_TIM(sFrame.pTIM->byBitMapCtl) ? true : false ; pMgmt->byDTIMCount = sFrame.pTIM->byDTIMCount; pMgmt->byDTIMPeriod = sFrame.pTIM->byDTIMPeriod; wAIDNumber = pMgmt->wCurrAID & ~(BIT14|BIT15); @@ -2199,19 +2200,19 @@ if(ChannelExceedZoneType(pDevice,byCurrChannel)==TRUE) // len = byDTIMCount + byDTIMPeriod + byDTIMPeriod + byVirtBitMap[0~250] if (sFrame.pTIM->len >= (uLocateByteIndex + 4)) { byTIMBitOn = (0x01) << ((wAIDNumber) % 8); - pMgmt->bInTIM = sFrame.pTIM->byVirtBitMap[uLocateByteIndex] & byTIMBitOn ? TRUE : FALSE; + pMgmt->bInTIM = sFrame.pTIM->byVirtBitMap[uLocateByteIndex] & byTIMBitOn ? true : false; } else { - pMgmt->bInTIM = FALSE; + pMgmt->bInTIM = false; }; } else { - pMgmt->bInTIM = FALSE; + pMgmt->bInTIM = false; }; if (pMgmt->bInTIM || (pMgmt->bMulticastTIM && (pMgmt->byDTIMCount == 0))) { - pMgmt->bInTIMWake = TRUE; + pMgmt->bInTIMWake = true; // send out ps-poll packet // DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "BCN:In TIM\n"); if (pMgmt->bInTIM) { @@ -2221,14 +2222,14 @@ if(ChannelExceedZoneType(pDevice,byCurrChannel)==TRUE) } else { - pMgmt->bInTIMWake = FALSE; + pMgmt->bInTIMWake = false; DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "BCN: Not In TIM..\n"); - if (pDevice->bPWBitOn == FALSE) { + if (pDevice->bPWBitOn == false) { DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "BCN: Send Null Packet\n"); if (PSbSendNullPacket(pDevice)) - pDevice->bPWBitOn = TRUE; + pDevice->bPWBitOn = true; } - if(PSbConsiderPowerDown(pDevice, FALSE, FALSE)) { + if(PSbConsiderPowerDown(pDevice, false, false)) { DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "BCN: Power down now...\n"); }; } @@ -2246,7 +2247,7 @@ if(ChannelExceedZoneType(pDevice,byCurrChannel)==TRUE) // adhoc mode:TSF updated only when beacon larger then local TSF if (bTSFLargeDiff && bTSFOffsetPostive && (pMgmt->eCurrState == WMAC_STATE_JOINTED)) - bUpdateTSF = TRUE; + bUpdateTSF = true; // During dpc, already in spinlocked. if (BSSDBbIsSTAInNodeDB(pMgmt, sFrame.pHdr->sA3.abyAddr2, &uNodeIndex)) { @@ -2259,7 +2260,7 @@ if(ChannelExceedZoneType(pDevice,byCurrChannel)==TRUE) RATEvParseMaxRate( (void *)pDevice, (PWLAN_IE_SUPP_RATES)pMgmt->abyCurrSuppRates, NULL, - TRUE, + true, &(pMgmt->sNodeDBTable[uNodeIndex].wMaxBasicRate), &(pMgmt->sNodeDBTable[uNodeIndex].wMaxSuppRate), &(pMgmt->sNodeDBTable[uNodeIndex].wSuppRate), @@ -2280,7 +2281,7 @@ if(ChannelExceedZoneType(pDevice,byCurrChannel)==TRUE) RATEvParseMaxRate( (void *)pDevice, (PWLAN_IE_SUPP_RATES)pMgmt->abyCurrSuppRates, NULL, - TRUE, + true, &(pMgmt->sNodeDBTable[uNodeIndex].wMaxBasicRate), &(pMgmt->sNodeDBTable[uNodeIndex].wMaxSuppRate), &(pMgmt->sNodeDBTable[uNodeIndex].wSuppRate), @@ -2300,7 +2301,7 @@ if(ChannelExceedZoneType(pDevice,byCurrChannel)==TRUE) /* pMgmt->sNodeDBTable[uNodeIndex].bShortSlotTime = WLAN_GET_CAP_INFO_SHORTSLOTTIME(*sFrame.pwCapInfo); if(pMgmt->sNodeDBTable[uNodeIndex].wMaxSuppRate > RATE_11M) - pMgmt->sNodeDBTable[uNodeIndex].bERPExist = TRUE; + pMgmt->sNodeDBTable[uNodeIndex].bERPExist = true; */ } @@ -2308,11 +2309,11 @@ if(ChannelExceedZoneType(pDevice,byCurrChannel)==TRUE) if (pMgmt->eCurrState == WMAC_STATE_STARTED) { DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Current IBSS State: [Started]........to: [Jointed] \n"); pMgmt->eCurrState = WMAC_STATE_JOINTED; - pDevice->bLinkPass = TRUE; + pDevice->bLinkPass = true; if (netif_queue_stopped(pDevice->dev)){ netif_wake_queue(pDevice->dev); } - pMgmt->sNodeDBTable[0].bActive = TRUE; + pMgmt->sNodeDBTable[0].bActive = true; pMgmt->sNodeDBTable[0].uInActiveCount = 0; }; @@ -2392,16 +2393,16 @@ vMgrCreateOwnIBSS( { PSDevice pDevice = (PSDevice)hDeviceContext; PSMgmtObject pMgmt = pDevice->pMgmt; - WORD wMaxBasicRate; - WORD wMaxSuppRate; - BYTE byTopCCKBasicRate; - BYTE byTopOFDMBasicRate; + unsigned short wMaxBasicRate; + unsigned short wMaxSuppRate; + unsigned char byTopCCKBasicRate; + unsigned char byTopOFDMBasicRate; QWORD qwCurrTSF; - UINT ii; - BYTE abyRATE[] = {0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, 0x0C, 0x12, 0x18, 0x60}; - BYTE abyCCK_RATE[] = {0x82, 0x84, 0x8B, 0x96}; - BYTE abyOFDM_RATE[] = {0x0C, 0x12, 0x18, 0x24, 0x30, 0x48, 0x60, 0x6C}; - WORD wSuppRate; + unsigned int ii; + unsigned char abyRATE[] = {0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, 0x0C, 0x12, 0x18, 0x60}; + unsigned char abyCCK_RATE[] = {0x82, 0x84, 0x8B, 0x96}; + unsigned char abyOFDM_RATE[] = {0x0C, 0x12, 0x18, 0x24, 0x30, 0x48, 0x60, 0x6C}; + unsigned short wSuppRate; DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Create Basic Service Set .......\n"); @@ -2486,7 +2487,7 @@ vMgrCreateOwnIBSS( // set basic rate RATEvParseMaxRate((void *)pDevice, (PWLAN_IE_SUPP_RATES)pMgmt->abyCurrSuppRates, - (PWLAN_IE_SUPP_RATES)pMgmt->abyCurrExtSuppRates, TRUE, + (PWLAN_IE_SUPP_RATES)pMgmt->abyCurrExtSuppRates, true, &wMaxBasicRate, &wMaxSuppRate, &wSuppRate, &byTopCCKBasicRate, &byTopOFDMBasicRate); @@ -2533,12 +2534,12 @@ vMgrCreateOwnIBSS( if (pMgmt->eCurrMode == WMAC_MODE_IBSS_STA) { // BSSID selected must be randomized as spec 11.1.3 - pMgmt->abyCurrBSSID[5] = (BYTE) (LODWORD(qwCurrTSF)& 0x000000ff); - pMgmt->abyCurrBSSID[4] = (BYTE)((LODWORD(qwCurrTSF)& 0x0000ff00) >> 8); - pMgmt->abyCurrBSSID[3] = (BYTE)((LODWORD(qwCurrTSF)& 0x00ff0000) >> 16); - pMgmt->abyCurrBSSID[2] = (BYTE)((LODWORD(qwCurrTSF)& 0x00000ff0) >> 4); - pMgmt->abyCurrBSSID[1] = (BYTE)((LODWORD(qwCurrTSF)& 0x000ff000) >> 12); - pMgmt->abyCurrBSSID[0] = (BYTE)((LODWORD(qwCurrTSF)& 0x0ff00000) >> 20); + pMgmt->abyCurrBSSID[5] = (unsigned char) (LODWORD(qwCurrTSF)& 0x000000ff); + pMgmt->abyCurrBSSID[4] = (unsigned char)((LODWORD(qwCurrTSF)& 0x0000ff00) >> 8); + pMgmt->abyCurrBSSID[3] = (unsigned char)((LODWORD(qwCurrTSF)& 0x00ff0000) >> 16); + pMgmt->abyCurrBSSID[2] = (unsigned char)((LODWORD(qwCurrTSF)& 0x00000ff0) >> 4); + pMgmt->abyCurrBSSID[1] = (unsigned char)((LODWORD(qwCurrTSF)& 0x000ff000) >> 12); + pMgmt->abyCurrBSSID[0] = (unsigned char)((LODWORD(qwCurrTSF)& 0x0ff00000) >> 20); pMgmt->abyCurrBSSID[5] ^= pMgmt->abyMACAddr[0]; pMgmt->abyCurrBSSID[4] ^= pMgmt->abyMACAddr[1]; pMgmt->abyCurrBSSID[3] ^= pMgmt->abyMACAddr[2]; @@ -2611,7 +2612,7 @@ vMgrCreateOwnIBSS( CARDbSetBeaconPeriod(pMgmt->pAdapter, pMgmt->wIBSSBeaconPeriod); // set channel and clear NAV - CARDbSetChannel(pMgmt->pAdapter, pMgmt->uIBSSChannel); + set_channel(pMgmt->pAdapter, pMgmt->uIBSSChannel); pMgmt->uCurrChannel = pMgmt->uIBSSChannel; if (CARDbIsShortPreamble(pMgmt->pAdapter)) { @@ -2620,7 +2621,7 @@ vMgrCreateOwnIBSS( pMgmt->wCurrCapInfo &= (~WLAN_SET_CAP_INFO_SHORTPREAMBLE(1)); } - if ((pMgmt->b11hEnable == TRUE) && + if ((pMgmt->b11hEnable == true) && (pMgmt->eCurrentPHYMode == PHY_TYPE_11A)) { pMgmt->wCurrCapInfo |= WLAN_SET_CAP_INFO_SPECTRUMMNG(1); } else { @@ -2661,20 +2662,20 @@ vMgrJoinBSSBegin( PSDevice pDevice = (PSDevice)hDeviceContext; PSMgmtObject pMgmt = pDevice->pMgmt; PKnownBSS pCurr = NULL; - UINT ii, uu; + unsigned int ii, uu; PWLAN_IE_SUPP_RATES pItemRates = NULL; PWLAN_IE_SUPP_RATES pItemExtRates = NULL; PWLAN_IE_SSID pItemSSID; - UINT uRateLen = WLAN_RATES_MAXLEN; - WORD wMaxBasicRate = RATE_1M; - WORD wMaxSuppRate = RATE_1M; - WORD wSuppRate; - BYTE byTopCCKBasicRate = RATE_1M; - BYTE byTopOFDMBasicRate = RATE_1M; + unsigned int uRateLen = WLAN_RATES_MAXLEN; + unsigned short wMaxBasicRate = RATE_1M; + unsigned short wMaxSuppRate = RATE_1M; + unsigned short wSuppRate; + unsigned char byTopCCKBasicRate = RATE_1M; + unsigned char byTopOFDMBasicRate = RATE_1M; for (ii = 0; ii < MAX_BSS_NUM; ii++) { - if (pMgmt->sBSSList[ii].bActive == TRUE) + if (pMgmt->sBSSList[ii].bActive == true) break; } @@ -2708,14 +2709,14 @@ vMgrJoinBSSBegin( // patch for CISCO migration mode /* if (pDevice->eEncryptionStatus == Ndis802_11Encryption2Enabled) { - if (WPA_SearchRSN(0, WPA_TKIP, pCurr) == FALSE) { + if (WPA_SearchRSN(0, WPA_TKIP, pCurr) == false) { DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"No match RSN info. ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n"); // encryption mode error pMgmt->eCurrState = WMAC_STATE_IDLE; return; } } else if (pDevice->eEncryptionStatus == Ndis802_11Encryption3Enabled) { - if (WPA_SearchRSN(0, WPA_AESCCMP, pCurr) == FALSE) { + if (WPA_SearchRSN(0, WPA_AESCCMP, pCurr) == false) { DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"No match RSN info. ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n"); // encryption mode error pMgmt->eCurrState = WMAC_STATE_IDLE; @@ -2726,7 +2727,7 @@ vMgrJoinBSSBegin( } #ifdef WPA_SUPPLICANT_DRIVER_WEXT_SUPPORT - //if(pDevice->bWPASuppWextEnabled == TRUE) + //if(pDevice->bWPASuppWextEnabled == true) Encyption_Rebuild(pDevice, pCurr); #endif // Infrastructure BSS @@ -2764,15 +2765,15 @@ vMgrJoinBSSBegin( uRateLen); // Stuffing Rate IE if ((pItemExtRates->len > 0) && (pItemRates->len < 8)) { - for (ii = 0; ii < (UINT)(8 - pItemRates->len); ) { + for (ii = 0; ii < (unsigned int)(8 - pItemRates->len); ) { pItemRates->abyRates[pItemRates->len + ii] = pItemExtRates->abyRates[ii]; ii ++; if (pItemExtRates->len <= ii) break; } - pItemRates->len += (BYTE)ii; + pItemRates->len += (unsigned char)ii; if (pItemExtRates->len - ii > 0) { - pItemExtRates->len -= (BYTE)ii; + pItemExtRates->len -= (unsigned char)ii; for (uu = 0; uu < pItemExtRates->len; uu ++) { pItemExtRates->abyRates[uu] = pItemExtRates->abyRates[uu + ii]; } @@ -2781,7 +2782,7 @@ vMgrJoinBSSBegin( } } - RATEvParseMaxRate((void *)pDevice, pItemRates, pItemExtRates, TRUE, + RATEvParseMaxRate((void *)pDevice, pItemRates, pItemExtRates, true, &wMaxBasicRate, &wMaxSuppRate, &wSuppRate, &byTopCCKBasicRate, &byTopOFDMBasicRate); @@ -2802,9 +2803,9 @@ vMgrJoinBSSBegin( // Add current BSS to Candidate list // This should only works for WPA2 BSS, and WPA2 BSS check must be done before. if (pMgmt->eAuthenMode == WMAC_AUTH_WPA2) { - BOOL bResult = bAdd_PMKID_Candidate((void *)pDevice, pMgmt->abyCurrBSSID, &pCurr->sRSNCapObj); + bool bResult = bAdd_PMKID_Candidate((void *)pDevice, pMgmt->abyCurrBSSID, &pCurr->sRSNCapObj); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"bAdd_PMKID_Candidate: 1(%d)\n", bResult); - if (bResult == FALSE) { + if (bResult == false) { vFlush_PMKID_Candidate((void *)pDevice); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"vFlush_PMKID_Candidate: 4\n"); bAdd_PMKID_Candidate((void *)pDevice, pMgmt->abyCurrBSSID, &pCurr->sRSNCapObj); @@ -2831,13 +2832,13 @@ vMgrJoinBSSBegin( if (pMgmt->eAuthenMode == WMAC_AUTH_WPANONE) { if (pDevice->eEncryptionStatus == Ndis802_11Encryption2Enabled) { - if (WPA_SearchRSN(0, WPA_TKIP, pCurr) == FALSE) { + if (WPA_SearchRSN(0, WPA_TKIP, pCurr) == false) { // encryption mode error pMgmt->eCurrState = WMAC_STATE_IDLE; return; } } else if (pDevice->eEncryptionStatus == Ndis802_11Encryption3Enabled) { - if (WPA_SearchRSN(0, WPA_AESCCMP, pCurr) == FALSE) { + if (WPA_SearchRSN(0, WPA_AESCCMP, pCurr) == false) { // encryption mode error pMgmt->eCurrState = WMAC_STATE_IDLE; return; @@ -2868,7 +2869,7 @@ vMgrJoinBSSBegin( WLAN_RATES_MAXLEN_11B); // set basic rate RATEvParseMaxRate((void *)pDevice, (PWLAN_IE_SUPP_RATES)pMgmt->abyCurrSuppRates, - NULL, TRUE, &wMaxBasicRate, &wMaxSuppRate, &wSuppRate, + NULL, true, &wMaxBasicRate, &wMaxSuppRate, &wSuppRate, &byTopCCKBasicRate, &byTopOFDMBasicRate); pMgmt->wCurrCapInfo = pCurr->wCapInfo; @@ -2883,7 +2884,7 @@ vMgrJoinBSSBegin( pMgmt->eCurrState = WMAC_STATE_STARTED; // Adopt BSS state in Adapter Device Object //pDevice->byOpMode = OP_MODE_ADHOC; -// pDevice->bLinkPass = TRUE; +// pDevice->bLinkPass = true; // memcpy(pDevice->abyBSSID, pCurr->abyBSSID, WLAN_BSSID_LEN); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"Join IBSS ok:%02x-%02x-%02x-%02x-%02x-%02x \n", @@ -2923,7 +2924,7 @@ static void s_vMgrSynchBSS ( PSDevice pDevice, - UINT uBSSMode, + unsigned int uBSSMode, PKnownBSS pCurr, PCMD_STATUS pStatus ) @@ -2932,11 +2933,11 @@ s_vMgrSynchBSS ( PSMgmtObject pMgmt = pDevice->pMgmt; // int ii; //1M, 2M, 5M, 11M, 18M, 24M, 36M, 54M - BYTE abyCurrSuppRatesG[] = {WLAN_EID_SUPP_RATES, 8, 0x02, 0x04, 0x0B, 0x16, 0x24, 0x30, 0x48, 0x6C}; - BYTE abyCurrExtSuppRatesG[] = {WLAN_EID_EXTSUPP_RATES, 4, 0x0C, 0x12, 0x18, 0x60}; + unsigned char abyCurrSuppRatesG[] = {WLAN_EID_SUPP_RATES, 8, 0x02, 0x04, 0x0B, 0x16, 0x24, 0x30, 0x48, 0x6C}; + unsigned char abyCurrExtSuppRatesG[] = {WLAN_EID_EXTSUPP_RATES, 4, 0x0C, 0x12, 0x18, 0x60}; //6M, 9M, 12M, 48M - BYTE abyCurrSuppRatesA[] = {WLAN_EID_SUPP_RATES, 8, 0x0C, 0x12, 0x18, 0x24, 0x30, 0x48, 0x60, 0x6C}; - BYTE abyCurrSuppRatesB[] = {WLAN_EID_SUPP_RATES, 4, 0x02, 0x04, 0x0B, 0x16}; + unsigned char abyCurrSuppRatesA[] = {WLAN_EID_SUPP_RATES, 8, 0x0C, 0x12, 0x18, 0x24, 0x30, 0x48, 0x60, 0x6C}; + unsigned char abyCurrSuppRatesB[] = {WLAN_EID_SUPP_RATES, 4, 0x02, 0x04, 0x0B, 0x16}; *pStatus = CMD_STATUS_FAILURE; @@ -2944,7 +2945,7 @@ s_vMgrSynchBSS ( if (s_bCipherMatch(pCurr, pDevice->eEncryptionStatus, &(pMgmt->byCSSPK), - &(pMgmt->byCSSGK)) == FALSE) { + &(pMgmt->byCSSGK)) == false) { DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "s_bCipherMatch Fail .......\n"); return; } @@ -2958,12 +2959,12 @@ s_vMgrSynchBSS ( } // Init the BSS informations - pDevice->bCCK = TRUE; - pDevice->bProtectMode = FALSE; + pDevice->bCCK = true; + pDevice->bProtectMode = false; MACvDisableProtectMD(pDevice->PortOffset); - pDevice->bBarkerPreambleMd = FALSE; + pDevice->bBarkerPreambleMd = false; MACvDisableBarkerPreambleMd(pDevice->PortOffset); - pDevice->bNonERPPresent = FALSE; + pDevice->bNonERPPresent = false; pDevice->byPreambleType = 0; pDevice->wBasicRate = 0; // Set Basic Rate @@ -3046,12 +3047,12 @@ s_vMgrSynchBSS ( pCurr->sERP.byERP, pMgmt->abyCurrSuppRates, pMgmt->abyCurrExtSuppRates - ) != TRUE) { + ) != true) { DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "<----s_bSynchBSS Set Phy Mode Fail [%d]\n", ePhyType); return; } // set channel and clear NAV - if (CARDbSetChannel(pMgmt->pAdapter, pCurr->uChannel) == FALSE) { + if (set_channel(pMgmt->pAdapter, pCurr->uChannel) == false) { DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "<----s_bSynchBSS Set Channel [%d]\n", pCurr->uChannel); return; } @@ -3077,7 +3078,7 @@ s_vMgrSynchBSS ( pMgmt->uCurrChannel = pCurr->uChannel; pMgmt->eCurrentPHYMode = ePhyType; pMgmt->byERPContext = pCurr->sERP.byERP; - DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Sync:Set to channel = [%d]\n", (INT)pCurr->uChannel); + DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Sync:Set to channel = [%d]\n", (int)pCurr->uChannel); *pStatus = CMD_STATUS_SUCCESS; @@ -3094,18 +3095,18 @@ s_vMgrSynchBSS ( ) { PSMgmtObject pMgmt = &(pDevice->sMgmtObj); - // UINT ii , uSameBssidNum=0; + // unsigned int ii , uSameBssidNum=0; // for (ii = 0; ii < MAX_BSS_NUM; ii++) { // if (pMgmt->sBSSList[ii].bActive && - // IS_ETH_ADDRESS_EQUAL(pMgmt->sBSSList[ii].abyBSSID, pCurr->abyBSSID)) { + // !compare_ether_addr(pMgmt->sBSSList[ii].abyBSSID, pCurr->abyBSSID)) { // uSameBssidNum++; // } // } // if( uSameBssidNum>=2) { //we only check AP in hidden sssid mode if ((pMgmt->eAuthenMode == WMAC_AUTH_WPAPSK) || //networkmanager 0.7.0 does not give the pairwise-key selsection, (pMgmt->eAuthenMode == WMAC_AUTH_WPA2PSK)) { // so we need re-selsect it according to real pairwise-key info. - if(pCurr->bWPAValid == TRUE) { //WPA-PSK + if(pCurr->bWPAValid == true) { //WPA-PSK pMgmt->eAuthenMode = WMAC_AUTH_WPAPSK; if(pCurr->abyPKType[0] == WPA_TKIP) { pDevice->eEncryptionStatus = Ndis802_11Encryption2Enabled; //TKIP @@ -3116,7 +3117,7 @@ s_vMgrSynchBSS ( PRINT_K("Encyption_Rebuild--->ssid reset config to [WPAPSK-AES]\n"); } } - else if(pCurr->bWPA2Valid == TRUE) { //WPA2-PSK + else if(pCurr->bWPA2Valid == true) { //WPA2-PSK pMgmt->eAuthenMode = WMAC_AUTH_WPA2PSK; if(pCurr->abyCSSPK[0] == WLAN_11i_CSS_TKIP) { pDevice->eEncryptionStatus = Ndis802_11Encryption2Enabled; //TKIP @@ -3151,13 +3152,13 @@ s_vMgrFormatTIM( PWLAN_IE_TIM pTIM ) { - BYTE byMask[8] = {1, 2, 4, 8, 0x10, 0x20, 0x40, 0x80}; - BYTE byMap; - UINT ii, jj; - BOOL bStartFound = FALSE; - BOOL bMulticast = FALSE; - WORD wStartIndex = 0; - WORD wEndIndex = 0; + unsigned char byMask[8] = {1, 2, 4, 8, 0x10, 0x20, 0x40, 0x80}; + unsigned char byMap; + unsigned int ii, jj; + bool bStartFound = false; + bool bMulticast = false; + unsigned short wStartIndex = 0; + unsigned short wEndIndex = 0; // Find size of partial virtual bitmap @@ -3167,13 +3168,13 @@ s_vMgrFormatTIM( // Mask out the broadcast bit which is indicated separately. bMulticast = (byMap & byMask[0]) != 0; if(bMulticast) { - pMgmt->sNodeDBTable[0].bRxPSPoll = TRUE; + pMgmt->sNodeDBTable[0].bRxPSPoll = true; } byMap = 0; } if (byMap) { if (!bStartFound) { - bStartFound = TRUE; + bStartFound = true; wStartIndex = ii; } wEndIndex = ii; @@ -3224,30 +3225,30 @@ PSTxMgmtPacket s_MgrMakeBeacon( PSDevice pDevice, PSMgmtObject pMgmt, - WORD wCurrCapInfo, - WORD wCurrBeaconPeriod, - UINT uCurrChannel, - WORD wCurrATIMWinodw, + unsigned short wCurrCapInfo, + unsigned short wCurrBeaconPeriod, + unsigned int uCurrChannel, + unsigned short wCurrATIMWinodw, PWLAN_IE_SSID pCurrSSID, - PBYTE pCurrBSSID, + unsigned char *pCurrBSSID, PWLAN_IE_SUPP_RATES pCurrSuppRates, PWLAN_IE_SUPP_RATES pCurrExtSuppRates ) { PSTxMgmtPacket pTxPacket = NULL; WLAN_FR_BEACON sFrame; - BYTE abyBroadcastAddr[] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff}; - PBYTE pbyBuffer; - UINT uLength = 0; + unsigned char abyBroadcastAddr[] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff}; + unsigned char *pbyBuffer; + unsigned int uLength = 0; PWLAN_IE_IBSS_DFS pIBSSDFS = NULL; - UINT ii; + unsigned int ii; // prepare beacon frame pTxPacket = (PSTxMgmtPacket)pMgmt->pbyMgmtPacketPool; memset(pTxPacket, 0, sizeof(STxMgmtPacket) + WLAN_BEACON_FR_MAXLEN); - pTxPacket->p80211Header = (PUWLAN_80211HDR)((PBYTE)pTxPacket + sizeof(STxMgmtPacket)); + pTxPacket->p80211Header = (PUWLAN_80211HDR)((unsigned char *)pTxPacket + sizeof(STxMgmtPacket)); // Setup the sFrame structure. - sFrame.pBuf = (PBYTE)pTxPacket->p80211Header; + sFrame.pBuf = (unsigned char *)pTxPacket->p80211Header; sFrame.len = WLAN_BEACON_FR_MAXLEN; vMgrEncodeBeacon(&sFrame); // Setup the header @@ -3258,7 +3259,7 @@ s_MgrMakeBeacon( )); if (pDevice->bEnablePSMode) { - sFrame.pHdr->sA3.wFrameCtl |= cpu_to_le16((WORD)WLAN_SET_FC_PWRMGT(1)); + sFrame.pHdr->sA3.wFrameCtl |= cpu_to_le16((unsigned short)WLAN_SET_FC_PWRMGT(1)); } memcpy( sFrame.pHdr->sA3.abyAddr1, abyBroadcastAddr, WLAN_ADDR_LEN); @@ -3286,7 +3287,7 @@ s_MgrMakeBeacon( sFrame.len += (1) + WLAN_IEHDR_LEN; sFrame.pDSParms->byElementID = WLAN_EID_DS_PARMS; sFrame.pDSParms->len = 1; - sFrame.pDSParms->byCurrChannel = (BYTE)uCurrChannel; + sFrame.pDSParms->byCurrChannel = (unsigned char)uCurrChannel; } // TIM field if (pMgmt->eCurrMode == WMAC_MODE_ESS_AP) { @@ -3329,22 +3330,22 @@ s_MgrMakeBeacon( // Pairwise Key Cipher Suite sFrame.pRSNWPA->wPKCount = 0; // Auth Key Management Suite - *((PWORD)(sFrame.pBuf + sFrame.len + sFrame.pRSNWPA->len))=0; + *((unsigned short *)(sFrame.pBuf + sFrame.len + sFrame.pRSNWPA->len))=0; sFrame.pRSNWPA->len +=2; // RSN Capabilites - *((PWORD)(sFrame.pBuf + sFrame.len + sFrame.pRSNWPA->len))=0; + *((unsigned short *)(sFrame.pBuf + sFrame.len + sFrame.pRSNWPA->len))=0; sFrame.pRSNWPA->len +=2; sFrame.len += sFrame.pRSNWPA->len + WLAN_IEHDR_LEN; } } - if ((pMgmt->b11hEnable == TRUE) && + if ((pMgmt->b11hEnable == true) && (pMgmt->eCurrentPHYMode == PHY_TYPE_11A)) { // Country IE - pbyBuffer = (PBYTE)(sFrame.pBuf + sFrame.len); - CARDvSetCountryIE(pMgmt->pAdapter, pbyBuffer); - CARDvSetCountryInfo(pMgmt->pAdapter, PHY_TYPE_11A, pbyBuffer); + pbyBuffer = (unsigned char *)(sFrame.pBuf + sFrame.len); + set_country_IE(pMgmt->pAdapter, pbyBuffer); + set_country_info(pMgmt->pAdapter, PHY_TYPE_11A, pbyBuffer); uLength += ((PWLAN_IE_COUNTRY) pbyBuffer)->len + WLAN_IEHDR_LEN; pbyBuffer += (((PWLAN_IE_COUNTRY) pbyBuffer)->len + WLAN_IEHDR_LEN); // Power Constrain IE @@ -3353,12 +3354,12 @@ s_MgrMakeBeacon( ((PWLAN_IE_PW_CONST) pbyBuffer)->byPower = 0; pbyBuffer += (1) + WLAN_IEHDR_LEN; uLength += (1) + WLAN_IEHDR_LEN; - if (pMgmt->bSwitchChannel == TRUE) { + if (pMgmt->bSwitchChannel == true) { // Channel Switch IE ((PWLAN_IE_CH_SW) pbyBuffer)->byElementID = WLAN_EID_CH_SWITCH; ((PWLAN_IE_CH_SW) pbyBuffer)->len = 3; ((PWLAN_IE_CH_SW) pbyBuffer)->byMode = 1; - ((PWLAN_IE_CH_SW) pbyBuffer)->byChannel = CARDbyGetChannelNumber(pMgmt->pAdapter, pMgmt->byNewChannel); + ((PWLAN_IE_CH_SW) pbyBuffer)->byChannel = get_channel_number(pMgmt->pAdapter, pMgmt->byNewChannel); ((PWLAN_IE_CH_SW) pbyBuffer)->byCount = 0; pbyBuffer += (3) + WLAN_IEHDR_LEN; uLength += (3) + WLAN_IEHDR_LEN; @@ -3382,7 +3383,7 @@ s_MgrMakeBeacon( pbyBuffer += (7) + WLAN_IEHDR_LEN; uLength += (7) + WLAN_IEHDR_LEN; for(ii=CB_MAX_CHANNEL_24G+1; ii<=CB_MAX_CHANNEL; ii++ ) { - if (CARDbGetChannelMapInfo(pMgmt->pAdapter, ii, pbyBuffer, pbyBuffer+1) == TRUE) { + if (get_channel_map_info(pMgmt->pAdapter, ii, pbyBuffer, pbyBuffer+1) == true) { pbyBuffer += 2; uLength += 2; pIBSSDFS->len += 2; @@ -3398,11 +3399,11 @@ s_MgrMakeBeacon( sFrame.pERP->byElementID = WLAN_EID_ERP; sFrame.pERP->len = 1; sFrame.pERP->byContext = 0; - if (pDevice->bProtectMode == TRUE) + if (pDevice->bProtectMode == true) sFrame.pERP->byContext |= WLAN_EID_ERP_USE_PROTECTION; - if (pDevice->bNonERPPresent == TRUE) + if (pDevice->bNonERPPresent == true) sFrame.pERP->byContext |= WLAN_EID_ERP_NONERP_PRESENT; - if (pDevice->bBarkerPreambleMd == TRUE) + if (pDevice->bBarkerPreambleMd == true) sFrame.pERP->byContext |= WLAN_EID_ERP_BARKER_MODE; } if (((PWLAN_IE_SUPP_RATES)pCurrExtSuppRates)->len != 0) { @@ -3414,7 +3415,7 @@ s_MgrMakeBeacon( ); } // hostapd wpa/wpa2 IE - if ((pMgmt->eCurrMode == WMAC_MODE_ESS_AP) && (pDevice->bEnableHostapd == TRUE)) { + if ((pMgmt->eCurrMode == WMAC_MODE_ESS_AP) && (pDevice->bEnableHostapd == true)) { if (pMgmt->eAuthenMode == WMAC_AUTH_WPANONE) { if (pMgmt->wWPAIELen != 0) { sFrame.pRSN = (PWLAN_IE_RSN)(sFrame.pBuf + sFrame.len); @@ -3453,31 +3454,31 @@ PSTxMgmtPacket s_MgrMakeProbeResponse( PSDevice pDevice, PSMgmtObject pMgmt, - WORD wCurrCapInfo, - WORD wCurrBeaconPeriod, - UINT uCurrChannel, - WORD wCurrATIMWinodw, - PBYTE pDstAddr, + unsigned short wCurrCapInfo, + unsigned short wCurrBeaconPeriod, + unsigned int uCurrChannel, + unsigned short wCurrATIMWinodw, + unsigned char *pDstAddr, PWLAN_IE_SSID pCurrSSID, - PBYTE pCurrBSSID, + unsigned char *pCurrBSSID, PWLAN_IE_SUPP_RATES pCurrSuppRates, PWLAN_IE_SUPP_RATES pCurrExtSuppRates, - BYTE byPHYType + unsigned char byPHYType ) { PSTxMgmtPacket pTxPacket = NULL; WLAN_FR_PROBERESP sFrame; - PBYTE pbyBuffer; - UINT uLength = 0; + unsigned char *pbyBuffer; + unsigned int uLength = 0; PWLAN_IE_IBSS_DFS pIBSSDFS = NULL; - UINT ii; + unsigned int ii; pTxPacket = (PSTxMgmtPacket)pMgmt->pbyMgmtPacketPool; memset(pTxPacket, 0, sizeof(STxMgmtPacket) + WLAN_PROBERESP_FR_MAXLEN); - pTxPacket->p80211Header = (PUWLAN_80211HDR)((PBYTE)pTxPacket + sizeof(STxMgmtPacket)); + pTxPacket->p80211Header = (PUWLAN_80211HDR)((unsigned char *)pTxPacket + sizeof(STxMgmtPacket)); // Setup the sFrame structure. - sFrame.pBuf = (PBYTE)pTxPacket->p80211Header; + sFrame.pBuf = (unsigned char *)pTxPacket->p80211Header; sFrame.len = WLAN_PROBERESP_FR_MAXLEN; vMgrEncodeProbeResponse(&sFrame); // Setup the header @@ -3493,7 +3494,7 @@ s_MgrMakeProbeResponse( *sFrame.pwCapInfo = cpu_to_le16(wCurrCapInfo); if (byPHYType == BB_TYPE_11B) { - *sFrame.pwCapInfo &= cpu_to_le16((WORD)~(WLAN_SET_CAP_INFO_SHORTSLOTTIME(1))); + *sFrame.pwCapInfo &= cpu_to_le16((unsigned short)~(WLAN_SET_CAP_INFO_SHORTSLOTTIME(1))); } // Copy SSID @@ -3518,7 +3519,7 @@ s_MgrMakeProbeResponse( sFrame.len += (1) + WLAN_IEHDR_LEN; sFrame.pDSParms->byElementID = WLAN_EID_DS_PARMS; sFrame.pDSParms->len = 1; - sFrame.pDSParms->byCurrChannel = (BYTE)uCurrChannel; + sFrame.pDSParms->byCurrChannel = (unsigned char)uCurrChannel; } if (pMgmt->eCurrMode != WMAC_MODE_ESS_AP) { @@ -3535,20 +3536,20 @@ s_MgrMakeProbeResponse( sFrame.pERP->byElementID = WLAN_EID_ERP; sFrame.pERP->len = 1; sFrame.pERP->byContext = 0; - if (pDevice->bProtectMode == TRUE) + if (pDevice->bProtectMode == true) sFrame.pERP->byContext |= WLAN_EID_ERP_USE_PROTECTION; - if (pDevice->bNonERPPresent == TRUE) + if (pDevice->bNonERPPresent == true) sFrame.pERP->byContext |= WLAN_EID_ERP_NONERP_PRESENT; - if (pDevice->bBarkerPreambleMd == TRUE) + if (pDevice->bBarkerPreambleMd == true) sFrame.pERP->byContext |= WLAN_EID_ERP_BARKER_MODE; } - if ((pMgmt->b11hEnable == TRUE) && + if ((pMgmt->b11hEnable == true) && (pMgmt->eCurrentPHYMode == PHY_TYPE_11A)) { // Country IE - pbyBuffer = (PBYTE)(sFrame.pBuf + sFrame.len); - CARDvSetCountryIE(pMgmt->pAdapter, pbyBuffer); - CARDvSetCountryInfo(pMgmt->pAdapter, PHY_TYPE_11A, pbyBuffer); + pbyBuffer = (unsigned char *)(sFrame.pBuf + sFrame.len); + set_country_IE(pMgmt->pAdapter, pbyBuffer); + set_country_info(pMgmt->pAdapter, PHY_TYPE_11A, pbyBuffer); uLength += ((PWLAN_IE_COUNTRY) pbyBuffer)->len + WLAN_IEHDR_LEN; pbyBuffer += (((PWLAN_IE_COUNTRY) pbyBuffer)->len + WLAN_IEHDR_LEN); // Power Constrain IE @@ -3557,12 +3558,12 @@ s_MgrMakeProbeResponse( ((PWLAN_IE_PW_CONST) pbyBuffer)->byPower = 0; pbyBuffer += (1) + WLAN_IEHDR_LEN; uLength += (1) + WLAN_IEHDR_LEN; - if (pMgmt->bSwitchChannel == TRUE) { + if (pMgmt->bSwitchChannel == true) { // Channel Switch IE ((PWLAN_IE_CH_SW) pbyBuffer)->byElementID = WLAN_EID_CH_SWITCH; ((PWLAN_IE_CH_SW) pbyBuffer)->len = 3; ((PWLAN_IE_CH_SW) pbyBuffer)->byMode = 1; - ((PWLAN_IE_CH_SW) pbyBuffer)->byChannel = CARDbyGetChannelNumber(pMgmt->pAdapter, pMgmt->byNewChannel); + ((PWLAN_IE_CH_SW) pbyBuffer)->byChannel = get_channel_number(pMgmt->pAdapter, pMgmt->byNewChannel); ((PWLAN_IE_CH_SW) pbyBuffer)->byCount = 0; pbyBuffer += (3) + WLAN_IEHDR_LEN; uLength += (3) + WLAN_IEHDR_LEN; @@ -3586,7 +3587,7 @@ s_MgrMakeProbeResponse( pbyBuffer += (7) + WLAN_IEHDR_LEN; uLength += (7) + WLAN_IEHDR_LEN; for(ii=CB_MAX_CHANNEL_24G+1; ii<=CB_MAX_CHANNEL; ii++ ) { - if (CARDbGetChannelMapInfo(pMgmt->pAdapter, ii, pbyBuffer, pbyBuffer+1) == TRUE) { + if (get_channel_map_info(pMgmt->pAdapter, ii, pbyBuffer, pbyBuffer+1) == true) { pbyBuffer += 2; uLength += 2; pIBSSDFS->len += 2; @@ -3607,7 +3608,7 @@ s_MgrMakeProbeResponse( } // hostapd wpa/wpa2 IE - if ((pMgmt->eCurrMode == WMAC_MODE_ESS_AP) && (pDevice->bEnableHostapd == TRUE)) { + if ((pMgmt->eCurrMode == WMAC_MODE_ESS_AP) && (pDevice->bEnableHostapd == true)) { if (pMgmt->eAuthenMode == WMAC_AUTH_WPANONE) { if (pMgmt->wWPAIELen != 0) { sFrame.pRSN = (PWLAN_IE_RSN)(sFrame.pBuf + sFrame.len); @@ -3642,9 +3643,9 @@ PSTxMgmtPacket s_MgrMakeAssocRequest( PSDevice pDevice, PSMgmtObject pMgmt, - PBYTE pDAddr, - WORD wCurrCapInfo, - WORD wListenInterval, + unsigned char *pDAddr, + unsigned short wCurrCapInfo, + unsigned short wListenInterval, PWLAN_IE_SSID pCurrSSID, PWLAN_IE_SUPP_RATES pCurrRates, PWLAN_IE_SUPP_RATES pCurrExtSuppRates @@ -3652,15 +3653,15 @@ s_MgrMakeAssocRequest( { PSTxMgmtPacket pTxPacket = NULL; WLAN_FR_ASSOCREQ sFrame; - PBYTE pbyIEs; - PBYTE pbyRSN; + unsigned char *pbyIEs; + unsigned char *pbyRSN; pTxPacket = (PSTxMgmtPacket)pMgmt->pbyMgmtPacketPool; memset(pTxPacket, 0, sizeof(STxMgmtPacket) + WLAN_ASSOCREQ_FR_MAXLEN); - pTxPacket->p80211Header = (PUWLAN_80211HDR)((PBYTE)pTxPacket + sizeof(STxMgmtPacket)); + pTxPacket->p80211Header = (PUWLAN_80211HDR)((unsigned char *)pTxPacket + sizeof(STxMgmtPacket)); // Setup the sFrame structure. - sFrame.pBuf = (PBYTE)pTxPacket->p80211Header; + sFrame.pBuf = (unsigned char *)pTxPacket->p80211Header; sFrame.len = WLAN_ASSOCREQ_FR_MAXLEN; // format fixed field frame structure vMgrEncodeAssocRequest(&sFrame); @@ -3709,7 +3710,7 @@ s_MgrMakeAssocRequest( pbyIEs += pCurrRates->len + WLAN_IEHDR_LEN; // for 802.11h - if (pMgmt->b11hEnable == TRUE) { + if (pMgmt->b11hEnable == true) { if (sFrame.pCurrPowerCap == NULL) { sFrame.pCurrPowerCap = (PWLAN_IE_PW_CAP)(sFrame.pBuf + sFrame.len); sFrame.len += (2 + WLAN_IEHDR_LEN); @@ -3722,7 +3723,7 @@ s_MgrMakeAssocRequest( } if (sFrame.pCurrSuppCh == NULL) { sFrame.pCurrSuppCh = (PWLAN_IE_SUPP_CH)(sFrame.pBuf + sFrame.len); - sFrame.len += CARDbySetSupportChannels(pMgmt->pAdapter,(PBYTE)sFrame.pCurrSuppCh); + sFrame.len += set_support_channels(pMgmt->pAdapter,(unsigned char *)sFrame.pCurrSuppCh); } } @@ -3765,7 +3766,7 @@ s_MgrMakeAssocRequest( sFrame.pRSNWPA->PKSList[0].abyOUI[3] = WPA_NONE; } // Auth Key Management Suite - pbyRSN = (PBYTE)(sFrame.pBuf + sFrame.len + 2 + sFrame.pRSNWPA->len); + pbyRSN = (unsigned char *)(sFrame.pBuf + sFrame.len + 2 + sFrame.pRSNWPA->len); *pbyRSN++=0x01; *pbyRSN++=0x00; *pbyRSN++=0x00; @@ -3799,8 +3800,8 @@ s_MgrMakeAssocRequest( } else if (((pMgmt->eAuthenMode == WMAC_AUTH_WPA2) || (pMgmt->eAuthenMode == WMAC_AUTH_WPA2PSK)) && (pMgmt->pCurrBSS != NULL)) { - UINT ii; - PWORD pwPMKID; + unsigned int ii; + unsigned short *pwPMKID; // WPA IE sFrame.pRSN = (PWLAN_IE_RSN)(sFrame.pBuf + sFrame.len); @@ -3854,7 +3855,7 @@ s_MgrMakeAssocRequest( sFrame.pRSN->len +=6; // RSN Capabilites - if (pMgmt->pCurrBSS->sRSNCapObj.bRSNCapExist == TRUE) { + if (pMgmt->pCurrBSS->sRSNCapObj.bRSNCapExist == true) { memcpy(&sFrame.pRSN->abyRSN[16], &pMgmt->pCurrBSS->sRSNCapObj.wRSNCap, 2); } else { sFrame.pRSN->abyRSN[16] = 0; @@ -3862,10 +3863,10 @@ s_MgrMakeAssocRequest( } sFrame.pRSN->len +=2; - if ((pDevice->gsPMKID.BSSIDInfoCount > 0) && (pDevice->bRoaming == TRUE) && (pMgmt->eAuthenMode == WMAC_AUTH_WPA2)) { + if ((pDevice->gsPMKID.BSSIDInfoCount > 0) && (pDevice->bRoaming == true) && (pMgmt->eAuthenMode == WMAC_AUTH_WPA2)) { // RSN PMKID pbyRSN = &sFrame.pRSN->abyRSN[18]; - pwPMKID = (PWORD)pbyRSN; // Point to PMKID count + pwPMKID = (unsigned short *)pbyRSN; // Point to PMKID count *pwPMKID = 0; // Initialize PMKID count pbyRSN += 2; // Point to PMKID list for (ii = 0; ii < pDevice->gsPMKID.BSSIDInfoCount; ii++) { @@ -3917,9 +3918,9 @@ PSTxMgmtPacket s_MgrMakeReAssocRequest( PSDevice pDevice, PSMgmtObject pMgmt, - PBYTE pDAddr, - WORD wCurrCapInfo, - WORD wListenInterval, + unsigned char *pDAddr, + unsigned short wCurrCapInfo, + unsigned short wListenInterval, PWLAN_IE_SSID pCurrSSID, PWLAN_IE_SUPP_RATES pCurrRates, PWLAN_IE_SUPP_RATES pCurrExtSuppRates @@ -3927,15 +3928,15 @@ s_MgrMakeReAssocRequest( { PSTxMgmtPacket pTxPacket = NULL; WLAN_FR_REASSOCREQ sFrame; - PBYTE pbyIEs; - PBYTE pbyRSN; + unsigned char *pbyIEs; + unsigned char *pbyRSN; pTxPacket = (PSTxMgmtPacket)pMgmt->pbyMgmtPacketPool; memset( pTxPacket, 0, sizeof(STxMgmtPacket) + WLAN_REASSOCREQ_FR_MAXLEN); - pTxPacket->p80211Header = (PUWLAN_80211HDR)((PBYTE)pTxPacket + sizeof(STxMgmtPacket)); + pTxPacket->p80211Header = (PUWLAN_80211HDR)((unsigned char *)pTxPacket + sizeof(STxMgmtPacket)); /* Setup the sFrame structure. */ - sFrame.pBuf = (PBYTE)pTxPacket->p80211Header; + sFrame.pBuf = (unsigned char *)pTxPacket->p80211Header; sFrame.len = WLAN_REASSOCREQ_FR_MAXLEN; // format fixed field frame structure @@ -4024,7 +4025,7 @@ s_MgrMakeReAssocRequest( sFrame.pRSNWPA->PKSList[0].abyOUI[3] = WPA_NONE; } // Auth Key Management Suite - pbyRSN = (PBYTE)(sFrame.pBuf + sFrame.len + 2 + sFrame.pRSNWPA->len); + pbyRSN = (unsigned char *)(sFrame.pBuf + sFrame.len + 2 + sFrame.pRSNWPA->len); *pbyRSN++=0x01; *pbyRSN++=0x00; *pbyRSN++=0x00; @@ -4055,8 +4056,8 @@ s_MgrMakeReAssocRequest( } else if (((pMgmt->eAuthenMode == WMAC_AUTH_WPA2) || (pMgmt->eAuthenMode == WMAC_AUTH_WPA2PSK)) && (pMgmt->pCurrBSS != NULL)) { - UINT ii; - PWORD pwPMKID; + unsigned int ii; + unsigned short *pwPMKID; /* WPA IE */ sFrame.pRSN = (PWLAN_IE_RSN)(sFrame.pBuf + sFrame.len); @@ -4110,7 +4111,7 @@ s_MgrMakeReAssocRequest( sFrame.pRSN->len +=6; // RSN Capabilites - if (pMgmt->pCurrBSS->sRSNCapObj.bRSNCapExist == TRUE) { + if (pMgmt->pCurrBSS->sRSNCapObj.bRSNCapExist == true) { memcpy(&sFrame.pRSN->abyRSN[16], &pMgmt->pCurrBSS->sRSNCapObj.wRSNCap, 2); } else { sFrame.pRSN->abyRSN[16] = 0; @@ -4118,10 +4119,10 @@ s_MgrMakeReAssocRequest( } sFrame.pRSN->len +=2; - if ((pDevice->gsPMKID.BSSIDInfoCount > 0) && (pDevice->bRoaming == TRUE) && (pMgmt->eAuthenMode == WMAC_AUTH_WPA2)) { + if ((pDevice->gsPMKID.BSSIDInfoCount > 0) && (pDevice->bRoaming == true) && (pMgmt->eAuthenMode == WMAC_AUTH_WPA2)) { // RSN PMKID pbyRSN = &sFrame.pRSN->abyRSN[18]; - pwPMKID = (PWORD)pbyRSN; // Point to PMKID count + pwPMKID = (unsigned short *)pbyRSN; // Point to PMKID count *pwPMKID = 0; // Initialize PMKID count pbyRSN += 2; // Point to PMKID list for (ii = 0; ii < pDevice->gsPMKID.BSSIDInfoCount; ii++) { @@ -4169,10 +4170,10 @@ PSTxMgmtPacket s_MgrMakeAssocResponse( PSDevice pDevice, PSMgmtObject pMgmt, - WORD wCurrCapInfo, - WORD wAssocStatus, - WORD wAssocAID, - PBYTE pDstAddr, + unsigned short wCurrCapInfo, + unsigned short wAssocStatus, + unsigned short wAssocAID, + unsigned char *pDstAddr, PWLAN_IE_SUPP_RATES pCurrSuppRates, PWLAN_IE_SUPP_RATES pCurrExtSuppRates ) @@ -4183,9 +4184,9 @@ s_MgrMakeAssocResponse( pTxPacket = (PSTxMgmtPacket)pMgmt->pbyMgmtPacketPool; memset(pTxPacket, 0, sizeof(STxMgmtPacket) + WLAN_ASSOCREQ_FR_MAXLEN); - pTxPacket->p80211Header = (PUWLAN_80211HDR)((PBYTE)pTxPacket + sizeof(STxMgmtPacket)); + pTxPacket->p80211Header = (PUWLAN_80211HDR)((unsigned char *)pTxPacket + sizeof(STxMgmtPacket)); // Setup the sFrame structure - sFrame.pBuf = (PBYTE)pTxPacket->p80211Header; + sFrame.pBuf = (unsigned char *)pTxPacket->p80211Header; sFrame.len = WLAN_REASSOCRESP_FR_MAXLEN; vMgrEncodeAssocResponse(&sFrame); // Setup the header @@ -4200,7 +4201,7 @@ s_MgrMakeAssocResponse( *sFrame.pwCapInfo = cpu_to_le16(wCurrCapInfo); *sFrame.pwStatus = cpu_to_le16(wAssocStatus); - *sFrame.pwAid = cpu_to_le16((WORD)(wAssocAID | BIT14 | BIT15)); + *sFrame.pwAid = cpu_to_le16((unsigned short)(wAssocAID | BIT14 | BIT15)); // Copy the rate set sFrame.pSuppRates = (PWLAN_IE_SUPP_RATES)(sFrame.pBuf + sFrame.len); @@ -4243,10 +4244,10 @@ PSTxMgmtPacket s_MgrMakeReAssocResponse( PSDevice pDevice, PSMgmtObject pMgmt, - WORD wCurrCapInfo, - WORD wAssocStatus, - WORD wAssocAID, - PBYTE pDstAddr, + unsigned short wCurrCapInfo, + unsigned short wAssocStatus, + unsigned short wAssocAID, + unsigned char *pDstAddr, PWLAN_IE_SUPP_RATES pCurrSuppRates, PWLAN_IE_SUPP_RATES pCurrExtSuppRates ) @@ -4257,9 +4258,9 @@ s_MgrMakeReAssocResponse( pTxPacket = (PSTxMgmtPacket)pMgmt->pbyMgmtPacketPool; memset(pTxPacket, 0, sizeof(STxMgmtPacket) + WLAN_ASSOCREQ_FR_MAXLEN); - pTxPacket->p80211Header = (PUWLAN_80211HDR)((PBYTE)pTxPacket + sizeof(STxMgmtPacket)); + pTxPacket->p80211Header = (PUWLAN_80211HDR)((unsigned char *)pTxPacket + sizeof(STxMgmtPacket)); // Setup the sFrame structure - sFrame.pBuf = (PBYTE)pTxPacket->p80211Header; + sFrame.pBuf = (unsigned char *)pTxPacket->p80211Header; sFrame.len = WLAN_REASSOCRESP_FR_MAXLEN; vMgrEncodeReassocResponse(&sFrame); // Setup the header @@ -4274,7 +4275,7 @@ s_MgrMakeReAssocResponse( *sFrame.pwCapInfo = cpu_to_le16(wCurrCapInfo); *sFrame.pwStatus = cpu_to_le16(wAssocStatus); - *sFrame.pwAid = cpu_to_le16((WORD)(wAssocAID | BIT14 | BIT15)); + *sFrame.pwAid = cpu_to_le16((unsigned short)(wAssocAID | BIT14 | BIT15)); // Copy the rate set sFrame.pSuppRates = (PWLAN_IE_SUPP_RATES)(sFrame.pBuf + sFrame.len); @@ -4322,16 +4323,16 @@ s_vMgrRxProbeResponse( { PKnownBSS pBSSList = NULL; WLAN_FR_PROBERESP sFrame; - BYTE byCurrChannel = pRxPacket->byRxChannel; + unsigned char byCurrChannel = pRxPacket->byRxChannel; ERPObject sERP; - BYTE byIEChannel = 0; - BOOL bChannelHit = TRUE; + unsigned char byIEChannel = 0; + bool bChannelHit = true; memset(&sFrame, 0, sizeof(WLAN_FR_PROBERESP)); // decode the frame sFrame.len = pRxPacket->cbMPDULen; - sFrame.pBuf = (PBYTE)pRxPacket->p80211Header; + sFrame.pBuf = (unsigned char *)pRxPacket->p80211Header; vMgrDecodeProbeResponse(&sFrame); if ((sFrame.pqwTimestamp == 0) || @@ -4350,29 +4351,29 @@ s_vMgrRxProbeResponse( if (sFrame.pDSParms != 0) { if (byCurrChannel > CB_MAX_CHANNEL_24G) { // channel remapping to - byIEChannel = CARDbyGetChannelMapping(pMgmt->pAdapter, sFrame.pDSParms->byCurrChannel, PHY_TYPE_11A); + byIEChannel = get_channel_mapping(pMgmt->pAdapter, sFrame.pDSParms->byCurrChannel, PHY_TYPE_11A); } else { byIEChannel = sFrame.pDSParms->byCurrChannel; } if (byCurrChannel != byIEChannel) { // adjust channel info. bcs we rcv adjcent channel pakckets - bChannelHit = FALSE; + bChannelHit = false; byCurrChannel = byIEChannel; } } else { // no DS channel info - bChannelHit = TRUE; + bChannelHit = true; } //2008-0730-01<Add>by MikeLiu -if(ChannelExceedZoneType(pDevice,byCurrChannel)==TRUE) +if(ChannelExceedZoneType(pDevice,byCurrChannel)==true) return; if (sFrame.pERP != NULL) { sERP.byERP = sFrame.pERP->byContext; - sERP.bERPExist = TRUE; + sERP.bERPExist = true; } else { - sERP.bERPExist = FALSE; + sERP.bERPExist = false; sERP.byERP = 0; } @@ -4448,7 +4449,7 @@ s_vMgrRxProbeRequest( WLAN_FR_PROBEREQ sFrame; CMD_STATUS Status; PSTxMgmtPacket pTxPacket; - BYTE byPHYType = BB_TYPE_11B; + unsigned char byPHYType = BB_TYPE_11B; // STA in Ad-hoc mode: when latest TBTT beacon transmit success, // STA have to response this request. @@ -4458,7 +4459,7 @@ s_vMgrRxProbeRequest( memset(&sFrame, 0, sizeof(WLAN_FR_PROBEREQ)); // decode the frame sFrame.len = pRxPacket->cbMPDULen; - sFrame.pBuf = (PBYTE)pRxPacket->p80211Header; + sFrame.pBuf = (unsigned char *)pRxPacket->p80211Header; vMgrDecodeProbeRequest(&sFrame); /* DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Probe request rx:MAC addr:%02x-%02x-%02x=%02x-%02x-%02x \n", @@ -4495,7 +4496,7 @@ s_vMgrRxProbeRequest( 0, sFrame.pHdr->sA3.abyAddr2, (PWLAN_IE_SSID)pMgmt->abyCurrSSID, - (PBYTE)pMgmt->abyCurrBSSID, + (unsigned char *)pMgmt->abyCurrBSSID, (PWLAN_IE_SUPP_RATES)pMgmt->abyCurrSuppRates, (PWLAN_IE_SUPP_RATES)pMgmt->abyCurrExtSuppRates, byPHYType @@ -4542,8 +4543,8 @@ vMgrRxManagePacket( ) { PSDevice pDevice = (PSDevice)hDeviceContext; - BOOL bInScan = FALSE; - UINT uNodeIndex = 0; + bool bInScan = false; + unsigned int uNodeIndex = 0; NODE_STATE eNodeState = 0; CMD_STATUS Status; @@ -4577,7 +4578,7 @@ vMgrRxManagePacket( case WLAN_FSTYPE_ASSOCRESP: // Frame Clase = 2 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "rx assocresp1\n"); - s_vMgrRxAssocResponse(pDevice, pMgmt, pRxPacket, FALSE); + s_vMgrRxAssocResponse(pDevice, pMgmt, pRxPacket, false); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "rx assocresp2\n"); break; @@ -4603,7 +4604,7 @@ vMgrRxManagePacket( case WLAN_FSTYPE_REASSOCRESP: // Frame Clase = 2 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "rx reassocresp\n"); - s_vMgrRxAssocResponse(pDevice, pMgmt, pRxPacket, TRUE); + s_vMgrRxAssocResponse(pDevice, pMgmt, pRxPacket, true); break; case WLAN_FSTYPE_PROBEREQ: @@ -4623,7 +4624,7 @@ vMgrRxManagePacket( // Frame Clase = 0 //DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "rx beacon\n"); if (pMgmt->eScanState != WMAC_NO_SCANNING) { - bInScan = TRUE; + bInScan = true; }; s_vMgrRxBeacon(pDevice, pMgmt, pRxPacket, bInScan); break; @@ -4680,10 +4681,10 @@ vMgrRxManagePacket( * Prepare beacon to send * * Return Value: - * TRUE if success; FALSE if failed. + * true if success; false if failed. * -*/ -BOOL +bool bMgrPrepareBeaconToSend( void *hDeviceContext, PSMgmtObject pMgmt @@ -4692,7 +4693,7 @@ bMgrPrepareBeaconToSend( PSDevice pDevice = (PSDevice)hDeviceContext; PSTxMgmtPacket pTxPacket; -// pDevice->bBeaconBufReady = FALSE; +// pDevice->bBeaconBufReady = false; if (pDevice->bEncryptionEnable || pDevice->bEnable8021x){ pMgmt->wCurrCapInfo |= WLAN_SET_CAP_INFO_PRIVACY(1); } @@ -4708,18 +4709,18 @@ bMgrPrepareBeaconToSend( pMgmt->uCurrChannel, pMgmt->wCurrATIMWindow, //0, (PWLAN_IE_SSID)pMgmt->abyCurrSSID, - (PBYTE)pMgmt->abyCurrBSSID, + (unsigned char *)pMgmt->abyCurrBSSID, (PWLAN_IE_SUPP_RATES)pMgmt->abyCurrSuppRates, (PWLAN_IE_SUPP_RATES)pMgmt->abyCurrExtSuppRates ); if ((pMgmt->eCurrMode == WMAC_MODE_IBSS_STA) && (pMgmt->abyCurrBSSID[0] == 0)) - return FALSE; + return false; csBeacon_xmit(pDevice, pTxPacket); - return TRUE; + return true; } @@ -4741,7 +4742,7 @@ static void s_vMgrLogStatus( PSMgmtObject pMgmt, - WORD wStatus + unsigned short wStatus ) { switch( wStatus ){ @@ -4807,24 +4808,24 @@ s_vMgrLogStatus( * Return Value: none. * -*/ -BOOL +bool bAdd_PMKID_Candidate ( void *hDeviceContext, - PBYTE pbyBSSID, + unsigned char *pbyBSSID, PSRSNCapObject psRSNCapObj ) { PSDevice pDevice = (PSDevice)hDeviceContext; PPMKID_CANDIDATE pCandidateList; - UINT ii = 0; + unsigned int ii = 0; DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"bAdd_PMKID_Candidate START: (%d)\n", (int)pDevice->gsPMKIDCandidate.NumCandidates); if ((pDevice == NULL) || (pbyBSSID == NULL) || (psRSNCapObj == NULL)) - return FALSE; + return false; if (pDevice->gsPMKIDCandidate.NumCandidates >= MAX_PMKIDLIST) - return FALSE; + return false; @@ -4832,18 +4833,18 @@ bAdd_PMKID_Candidate ( for (ii = 0; ii < pDevice->gsPMKIDCandidate.NumCandidates; ii++) { pCandidateList = &pDevice->gsPMKIDCandidate.CandidateList[ii]; if ( !memcmp(pCandidateList->BSSID, pbyBSSID, ETH_ALEN)) { - if ((psRSNCapObj->bRSNCapExist == TRUE) && (psRSNCapObj->wRSNCap & BIT0)) { + if ((psRSNCapObj->bRSNCapExist == true) && (psRSNCapObj->wRSNCap & BIT0)) { pCandidateList->Flags |= NDIS_802_11_PMKID_CANDIDATE_PREAUTH_ENABLED; } else { pCandidateList->Flags &= ~(NDIS_802_11_PMKID_CANDIDATE_PREAUTH_ENABLED); } - return TRUE; + return true; } } // New Candidate pCandidateList = &pDevice->gsPMKIDCandidate.CandidateList[pDevice->gsPMKIDCandidate.NumCandidates]; - if ((psRSNCapObj->bRSNCapExist == TRUE) && (psRSNCapObj->wRSNCap & BIT0)) { + if ((psRSNCapObj->bRSNCapExist == true) && (psRSNCapObj->wRSNCap & BIT0)) { pCandidateList->Flags |= NDIS_802_11_PMKID_CANDIDATE_PREAUTH_ENABLED; } else { pCandidateList->Flags &= ~(NDIS_802_11_PMKID_CANDIDATE_PREAUTH_ENABLED); @@ -4851,7 +4852,7 @@ bAdd_PMKID_Candidate ( memcpy(pCandidateList->BSSID, pbyBSSID, ETH_ALEN); pDevice->gsPMKIDCandidate.NumCandidates++; DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"NumCandidates:%d\n", (int)pDevice->gsPMKIDCandidate.NumCandidates); - return TRUE; + return true; } /* @@ -4881,20 +4882,20 @@ vFlush_PMKID_Candidate ( memset(&pDevice->gsPMKIDCandidate, 0, sizeof(SPMKIDCandidateEvent)); } -static BOOL +static bool s_bCipherMatch ( PKnownBSS pBSSNode, NDIS_802_11_ENCRYPTION_STATUS EncStatus, - PBYTE pbyCCSPK, - PBYTE pbyCCSGK + unsigned char *pbyCCSPK, + unsigned char *pbyCCSGK ) { - BYTE byMulticastCipher = KEY_CTL_INVALID; - BYTE byCipherMask = 0x00; + unsigned char byMulticastCipher = KEY_CTL_INVALID; + unsigned char byCipherMask = 0x00; int i; if (pBSSNode == NULL) - return FALSE; + return false; // check cap. of BSS if ((WLAN_GET_CAP_INFO_PRIVACY(pBSSNode->wCapInfo) != 0) && @@ -4904,7 +4905,7 @@ s_bCipherMatch ( } if ((WLAN_GET_CAP_INFO_PRIVACY(pBSSNode->wCapInfo) != 0) && - (pBSSNode->bWPA2Valid == TRUE) && + (pBSSNode->bWPA2Valid == true) && //20080123-01,<Add> by Einsn Liu ((EncStatus == Ndis802_11Encryption3Enabled)||(EncStatus == Ndis802_11Encryption2Enabled))) { //WPA2 @@ -4938,7 +4939,7 @@ s_bCipherMatch ( } } else if ((WLAN_GET_CAP_INFO_PRIVACY(pBSSNode->wCapInfo) != 0) && - (pBSSNode->bWPAValid == TRUE) && + (pBSSNode->bWPAValid == true) && ((EncStatus == Ndis802_11Encryption3Enabled) || (EncStatus == Ndis802_11Encryption2Enabled))) { //WPA // check Group Key Cipher @@ -4978,9 +4979,9 @@ s_bCipherMatch ( (byCipherMask == 0)) { *pbyCCSGK = KEY_CTL_WEP; *pbyCCSPK = KEY_CTL_NONE; - return TRUE; + return true; } else { - return FALSE; + return false; } } else if (EncStatus == Ndis802_11Encryption2Enabled) { @@ -4988,45 +4989,45 @@ s_bCipherMatch ( (byCipherMask == 0)) { *pbyCCSGK = KEY_CTL_TKIP; *pbyCCSPK = KEY_CTL_NONE; - return TRUE; + return true; } else if ((byMulticastCipher == KEY_CTL_WEP) && ((byCipherMask & 0x02) != 0)) { *pbyCCSGK = KEY_CTL_WEP; *pbyCCSPK = KEY_CTL_TKIP; - return TRUE; + return true; } else if ((byMulticastCipher == KEY_CTL_TKIP) && ((byCipherMask & 0x02) != 0)) { *pbyCCSGK = KEY_CTL_TKIP; *pbyCCSPK = KEY_CTL_TKIP; - return TRUE; + return true; } else { - return FALSE; + return false; } } else if (EncStatus == Ndis802_11Encryption3Enabled) { if ((byMulticastCipher == KEY_CTL_CCMP) && (byCipherMask == 0)) { // When CCMP is enable, "Use group cipher suite" shall not be a valid option. - return FALSE; + return false; } else if ((byMulticastCipher == KEY_CTL_WEP) && ((byCipherMask & 0x04) != 0)) { *pbyCCSGK = KEY_CTL_WEP; *pbyCCSPK = KEY_CTL_CCMP; - return TRUE; + return true; } else if ((byMulticastCipher == KEY_CTL_TKIP) && ((byCipherMask & 0x04) != 0)) { *pbyCCSGK = KEY_CTL_TKIP; *pbyCCSPK = KEY_CTL_CCMP; - return TRUE; + return true; } else if ((byMulticastCipher == KEY_CTL_CCMP) && ((byCipherMask & 0x04) != 0)) { *pbyCCSGK = KEY_CTL_CCMP; *pbyCCSPK = KEY_CTL_CCMP; - return TRUE; + return true; } else { - return FALSE; + return false; } } - return TRUE; + return true; } diff --git a/drivers/staging/vt6655/wmgr.h b/drivers/staging/vt6655/wmgr.h index 9ae7e0d55bc..141e80b843a 100644 --- a/drivers/staging/vt6655/wmgr.h +++ b/drivers/staging/vt6655/wmgr.h @@ -83,47 +83,47 @@ /*--------------------- Export Types ------------------------------*/ #define timer_expire(timer,next_tick) mod_timer(&timer, RUN_AT(next_tick)) -typedef void (*TimerFunction)(ULONG); +typedef void (*TimerFunction)(unsigned long); //+++ NDIS related -typedef UCHAR NDIS_802_11_MAC_ADDRESS[6]; +typedef unsigned char NDIS_802_11_MAC_ADDRESS[6]; typedef struct _NDIS_802_11_AI_REQFI { - USHORT Capabilities; - USHORT ListenInterval; + unsigned short Capabilities; + unsigned short ListenInterval; NDIS_802_11_MAC_ADDRESS CurrentAPAddress; } NDIS_802_11_AI_REQFI, *PNDIS_802_11_AI_REQFI; typedef struct _NDIS_802_11_AI_RESFI { - USHORT Capabilities; - USHORT StatusCode; - USHORT AssociationId; + unsigned short Capabilities; + unsigned short StatusCode; + unsigned short AssociationId; } NDIS_802_11_AI_RESFI, *PNDIS_802_11_AI_RESFI; typedef struct _NDIS_802_11_ASSOCIATION_INFORMATION { - ULONG Length; - USHORT AvailableRequestFixedIEs; + unsigned long Length; + unsigned short AvailableRequestFixedIEs; NDIS_802_11_AI_REQFI RequestFixedIEs; - ULONG RequestIELength; - ULONG OffsetRequestIEs; - USHORT AvailableResponseFixedIEs; + unsigned long RequestIELength; + unsigned long OffsetRequestIEs; + unsigned short AvailableResponseFixedIEs; NDIS_802_11_AI_RESFI ResponseFixedIEs; - ULONG ResponseIELength; - ULONG OffsetResponseIEs; + unsigned long ResponseIELength; + unsigned long OffsetResponseIEs; } NDIS_802_11_ASSOCIATION_INFORMATION, *PNDIS_802_11_ASSOCIATION_INFORMATION; typedef struct tagSAssocInfo { NDIS_802_11_ASSOCIATION_INFORMATION AssocInfo; - BYTE abyIEs[WLAN_BEACON_FR_MAXLEN+WLAN_BEACON_FR_MAXLEN]; + unsigned char abyIEs[WLAN_BEACON_FR_MAXLEN+WLAN_BEACON_FR_MAXLEN]; // store ReqIEs set by OID_802_11_ASSOCIATION_INFORMATION - ULONG RequestIELength; - BYTE abyReqIEs[WLAN_BEACON_FR_MAXLEN]; + unsigned long RequestIELength; + unsigned char abyReqIEs[WLAN_BEACON_FR_MAXLEN]; } SAssocInfo, *PSAssocInfo; //--- @@ -224,8 +224,8 @@ typedef enum tagWMAC_POWER_MODE { typedef struct tagSTxMgmtPacket { PUWLAN_80211HDR p80211Header; - UINT cbMPDULen; - UINT cbPayloadLen; + unsigned int cbMPDULen; + unsigned int cbPayloadLen; } STxMgmtPacket, *PSTxMgmtPacket; @@ -235,12 +235,12 @@ typedef struct tagSRxMgmtPacket { PUWLAN_80211HDR p80211Header; QWORD qwLocalTSF; - UINT cbMPDULen; - UINT cbPayloadLen; - UINT uRSSI; - BYTE bySQ; - BYTE byRxRate; - BYTE byRxChannel; + unsigned int cbMPDULen; + unsigned int cbPayloadLen; + unsigned int uRSSI; + unsigned char bySQ; + unsigned char byRxRate; + unsigned char byRxChannel; } SRxMgmtPacket, *PSRxMgmtPacket; @@ -251,7 +251,7 @@ typedef struct tagSMgmtObject void * pAdapter; // MAC address - BYTE abyMACAddr[WLAN_ADDR_LEN]; + unsigned char abyMACAddr[WLAN_ADDR_LEN]; // Configuration Mode WMAC_CONFIG_MODE eConfigMode; // MAC pre-configed mode @@ -264,86 +264,86 @@ typedef struct tagSMgmtObject WMAC_BSS_STATE eCurrState; // MAC current BSS state PKnownBSS pCurrBSS; - BYTE byCSSGK; - BYTE byCSSPK; + unsigned char byCSSGK; + unsigned char byCSSPK; -// BYTE abyNewSuppRates[WLAN_IEHDR_LEN + WLAN_RATES_MAXLEN]; -// BYTE abyNewExtSuppRates[WLAN_IEHDR_LEN + WLAN_RATES_MAXLEN]; +// unsigned char abyNewSuppRates[WLAN_IEHDR_LEN + WLAN_RATES_MAXLEN]; +// unsigned char abyNewExtSuppRates[WLAN_IEHDR_LEN + WLAN_RATES_MAXLEN]; // Current state vars - UINT uCurrChannel; - BYTE abyCurrSuppRates[WLAN_IEHDR_LEN + WLAN_RATES_MAXLEN + 1]; - BYTE abyCurrExtSuppRates[WLAN_IEHDR_LEN + WLAN_RATES_MAXLEN + 1]; - BYTE abyCurrSSID[WLAN_IEHDR_LEN + WLAN_SSID_MAXLEN + 1]; - BYTE abyCurrBSSID[WLAN_BSSID_LEN]; - WORD wCurrCapInfo; - WORD wCurrAID; - WORD wCurrATIMWindow; - WORD wCurrBeaconPeriod; - BOOL bIsDS; - BYTE byERPContext; + unsigned int uCurrChannel; + unsigned char abyCurrSuppRates[WLAN_IEHDR_LEN + WLAN_RATES_MAXLEN + 1]; + unsigned char abyCurrExtSuppRates[WLAN_IEHDR_LEN + WLAN_RATES_MAXLEN + 1]; + unsigned char abyCurrSSID[WLAN_IEHDR_LEN + WLAN_SSID_MAXLEN + 1]; + unsigned char abyCurrBSSID[WLAN_BSSID_LEN]; + unsigned short wCurrCapInfo; + unsigned short wCurrAID; + unsigned short wCurrATIMWindow; + unsigned short wCurrBeaconPeriod; + bool bIsDS; + unsigned char byERPContext; CMD_STATE eCommandState; - UINT uScanChannel; + unsigned int uScanChannel; // Desire joinning BSS vars - BYTE abyDesireSSID[WLAN_IEHDR_LEN + WLAN_SSID_MAXLEN + 1]; - BYTE abyDesireBSSID[WLAN_BSSID_LEN]; + unsigned char abyDesireSSID[WLAN_IEHDR_LEN + WLAN_SSID_MAXLEN + 1]; + unsigned char abyDesireBSSID[WLAN_BSSID_LEN]; // Adhoc or AP configuration vars - //BYTE abyAdHocSSID[WLAN_IEHDR_LEN + WLAN_SSID_MAXLEN + 1]; - WORD wIBSSBeaconPeriod; - WORD wIBSSATIMWindow; - UINT uIBSSChannel; - BYTE abyIBSSSuppRates[WLAN_IEHDR_LEN + WLAN_RATES_MAXLEN + 1]; - BYTE byAPBBType; - BYTE abyWPAIE[MAX_WPA_IE_LEN]; - WORD wWPAIELen; - - UINT uAssocCount; - BOOL bMoreData; + //unsigned char abyAdHocSSID[WLAN_IEHDR_LEN + WLAN_SSID_MAXLEN + 1]; + unsigned short wIBSSBeaconPeriod; + unsigned short wIBSSATIMWindow; + unsigned int uIBSSChannel; + unsigned char abyIBSSSuppRates[WLAN_IEHDR_LEN + WLAN_RATES_MAXLEN + 1]; + unsigned char byAPBBType; + unsigned char abyWPAIE[MAX_WPA_IE_LEN]; + unsigned short wWPAIELen; + + unsigned int uAssocCount; + bool bMoreData; // Scan state vars WMAC_SCAN_STATE eScanState; WMAC_SCAN_TYPE eScanType; - UINT uScanStartCh; - UINT uScanEndCh; - WORD wScanSteps; - UINT uScanBSSType; + unsigned int uScanStartCh; + unsigned int uScanEndCh; + unsigned short wScanSteps; + unsigned int uScanBSSType; // Desire scannig vars - BYTE abyScanSSID[WLAN_IEHDR_LEN + WLAN_SSID_MAXLEN + 1]; - BYTE abyScanBSSID[WLAN_BSSID_LEN]; + unsigned char abyScanSSID[WLAN_IEHDR_LEN + WLAN_SSID_MAXLEN + 1]; + unsigned char abyScanBSSID[WLAN_BSSID_LEN]; // Privacy WMAC_AUTHENTICATION_MODE eAuthenMode; WMAC_ENCRYPTION_MODE eEncryptionMode; - BOOL bShareKeyAlgorithm; - BYTE abyChallenge[WLAN_CHALLENGE_LEN]; - BOOL bPrivacyInvoked; + bool bShareKeyAlgorithm; + unsigned char abyChallenge[WLAN_CHALLENGE_LEN]; + bool bPrivacyInvoked; // Received beacon state vars - BOOL bInTIM; - BOOL bMulticastTIM; - BYTE byDTIMCount; - BYTE byDTIMPeriod; + bool bInTIM; + bool bMulticastTIM; + unsigned char byDTIMCount; + unsigned char byDTIMPeriod; // Power saving state vars WMAC_POWER_MODE ePSMode; - WORD wListenInterval; - WORD wCountToWakeUp; - BOOL bInTIMWake; - PBYTE pbyPSPacketPool; - BYTE byPSPacketPool[sizeof(STxMgmtPacket) + WLAN_NULLDATA_FR_MAXLEN]; - BOOL bRxBeaconInTBTTWake; - BYTE abyPSTxMap[MAX_NODE_NUM + 1]; + unsigned short wListenInterval; + unsigned short wCountToWakeUp; + bool bInTIMWake; + unsigned char *pbyPSPacketPool; + unsigned char byPSPacketPool[sizeof(STxMgmtPacket) + WLAN_NULLDATA_FR_MAXLEN]; + bool bRxBeaconInTBTTWake; + unsigned char abyPSTxMap[MAX_NODE_NUM + 1]; // management command related - UINT uCmdBusy; - UINT uCmdHostAPBusy; + unsigned int uCmdBusy; + unsigned int uCmdHostAPBusy; // management packet pool - PBYTE pbyMgmtPacketPool; - BYTE byMgmtPacketPool[sizeof(STxMgmtPacket) + WLAN_A3FR_MAXLEN]; + unsigned char *pbyMgmtPacketPool; + unsigned char byMgmtPacketPool[sizeof(STxMgmtPacket) + WLAN_A3FR_MAXLEN]; // One second callback timer @@ -366,7 +366,7 @@ typedef struct tagSMgmtObject // WPA2 PMKID Cache SPMKIDCache gsPMKIDCache; - BOOL bRoaming; + bool bRoaming; // rate fall back vars @@ -377,16 +377,16 @@ typedef struct tagSMgmtObject // for 802.11h - BOOL b11hEnable; - BOOL bSwitchChannel; - BYTE byNewChannel; + bool b11hEnable; + bool bSwitchChannel; + unsigned char byNewChannel; PWLAN_IE_MEASURE_REP pCurrMeasureEIDRep; - UINT uLengthOfRepEIDs; - BYTE abyCurrentMSRReq[sizeof(STxMgmtPacket) + WLAN_A3FR_MAXLEN]; - BYTE abyCurrentMSRRep[sizeof(STxMgmtPacket) + WLAN_A3FR_MAXLEN]; - BYTE abyIECountry[WLAN_A3FR_MAXLEN]; - BYTE abyIBSSDFSOwner[6]; - BYTE byIBSSDFSRecovery; + unsigned int uLengthOfRepEIDs; + unsigned char abyCurrentMSRReq[sizeof(STxMgmtPacket) + WLAN_A3FR_MAXLEN]; + unsigned char abyCurrentMSRRep[sizeof(STxMgmtPacket) + WLAN_A3FR_MAXLEN]; + unsigned char abyIECountry[WLAN_A3FR_MAXLEN]; + unsigned char abyIBSSDFSOwner[6]; + unsigned char byIBSSDFSRecovery; struct sk_buff skb; @@ -432,8 +432,8 @@ void vMgrDisassocBeginSta( void *hDeviceContext, PSMgmtObject pMgmt, - PBYTE abyDestAddress, - WORD wReason, + unsigned char *abyDestAddress, + unsigned short wReason, PCMD_STATUS pStatus ); @@ -475,22 +475,22 @@ void vMgrDeAuthenBeginSta( void *hDeviceContext, PSMgmtObject pMgmt, - PBYTE abyDestAddress, - WORD wReason, + unsigned char *abyDestAddress, + unsigned short wReason, PCMD_STATUS pStatus ); -BOOL +bool bMgrPrepareBeaconToSend( void *hDeviceContext, PSMgmtObject pMgmt ); -BOOL +bool bAdd_PMKID_Candidate ( void *hDeviceContext, - PBYTE pbyBSSID, + unsigned char *pbyBSSID, PSRSNCapObject psRSNCapObj ); diff --git a/drivers/staging/vt6655/wpa.c b/drivers/staging/vt6655/wpa.c index da5c814e200..61ac46fa505 100644 --- a/drivers/staging/vt6655/wpa.c +++ b/drivers/staging/vt6655/wpa.c @@ -45,12 +45,12 @@ /*--------------------- Static Variables --------------------------*/ static int msglevel =MSG_LEVEL_INFO; -const BYTE abyOUI00[4] = { 0x00, 0x50, 0xf2, 0x00 }; -const BYTE abyOUI01[4] = { 0x00, 0x50, 0xf2, 0x01 }; -const BYTE abyOUI02[4] = { 0x00, 0x50, 0xf2, 0x02 }; -const BYTE abyOUI03[4] = { 0x00, 0x50, 0xf2, 0x03 }; -const BYTE abyOUI04[4] = { 0x00, 0x50, 0xf2, 0x04 }; -const BYTE abyOUI05[4] = { 0x00, 0x50, 0xf2, 0x05 }; +const unsigned char abyOUI00[4] = { 0x00, 0x50, 0xf2, 0x00 }; +const unsigned char abyOUI01[4] = { 0x00, 0x50, 0xf2, 0x01 }; +const unsigned char abyOUI02[4] = { 0x00, 0x50, 0xf2, 0x02 }; +const unsigned char abyOUI03[4] = { 0x00, 0x50, 0xf2, 0x03 }; +const unsigned char abyOUI04[4] = { 0x00, 0x50, 0xf2, 0x04 }; +const unsigned char abyOUI05[4] = { 0x00, 0x50, 0xf2, 0x05 }; /*+ @@ -83,9 +83,9 @@ WPA_ClearRSN ( pBSSList->wAuthCount = 0; pBSSList->byDefaultK_as_PK = 0; pBSSList->byReplayIdx = 0; - pBSSList->sRSNCapObj.bRSNCapExist = FALSE; + pBSSList->sRSNCapObj.bRSNCapExist = false; pBSSList->sRSNCapObj.wRSNCap = 0; - pBSSList->bWPAValid = FALSE; + pBSSList->bWPAValid = false; } @@ -112,7 +112,7 @@ WPA_ParseRSN ( { PWLAN_IE_RSN_AUTH pIE_RSN_Auth = NULL; int i, j, m, n = 0; - PBYTE pbyCaps; + unsigned char *pbyCaps; WPA_ClearRSN(pBSSList); @@ -148,7 +148,7 @@ WPA_ParseRSN ( { j = 0; DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"wPKCount: %d, sizeof(pBSSList->abyPKType): %zu\n", pRSN->wPKCount, sizeof(pBSSList->abyPKType)); - for(i = 0; (i < pRSN->wPKCount) && (j < sizeof(pBSSList->abyPKType)/sizeof(BYTE)); i++) { + for(i = 0; (i < pRSN->wPKCount) && (j < sizeof(pBSSList->abyPKType)/sizeof(unsigned char)); i++) { if(pRSN->len >= 12+i*4+4) { //oui1(4)+ver(2)+GKS(4)+PKSCnt(2)+PKS(4*i) if ( !memcmp(pRSN->PKSList[i].abyOUI, abyOUI00, 4)) pBSSList->abyPKType[j++] = WPA_NONE; @@ -166,7 +166,7 @@ WPA_ParseRSN ( break; //DBG_PRN_GRP14(("abyPKType[%d]: %X\n", j-1, pBSSList->abyPKType[j-1])); } //for - pBSSList->wPKCount = (WORD)j; + pBSSList->wPKCount = (unsigned short)j; DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"wPKCount: %d\n", pBSSList->wPKCount); } @@ -180,7 +180,7 @@ WPA_ParseRSN ( j = 0; DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"wAuthCount: %d, sizeof(pBSSList->abyAuthType): %zu\n", pIE_RSN_Auth->wAuthCount, sizeof(pBSSList->abyAuthType)); - for(i = 0; (i < pIE_RSN_Auth->wAuthCount) && (j < sizeof(pBSSList->abyAuthType)/sizeof(BYTE)); i++) { + for(i = 0; (i < pIE_RSN_Auth->wAuthCount) && (j < sizeof(pBSSList->abyAuthType)/sizeof(unsigned char)); i++) { if(pRSN->len >= 14+4+(m+i)*4) { //oui1(4)+ver(2)+GKS(4)+PKSCnt(2)+PKS(4*m)+AKC(2)+AKS(4*i) if ( !memcmp(pIE_RSN_Auth->AuthKSList[i].abyOUI, abyOUI01, 4)) pBSSList->abyAuthType[j++] = WPA_AUTH_IEEE802_1X; @@ -195,7 +195,7 @@ WPA_ParseRSN ( //DBG_PRN_GRP14(("abyAuthType[%d]: %X\n", j-1, pBSSList->abyAuthType[j-1])); } if(j > 0) - pBSSList->wAuthCount = (WORD)j; + pBSSList->wAuthCount = (unsigned short)j; DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"wAuthCount: %d\n", pBSSList->wAuthCount); } @@ -207,17 +207,17 @@ WPA_ParseRSN ( DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"14+4+(m+n)*4: %d\n", 14+4+(m+n)*4); if(pRSN->len+2 >= 14+4+(m+n)*4) { //oui1(4)+ver(2)+GKS(4)+PKSCnt(2)+PKS(4*m)+AKC(2)+AKS(4*n)+Cap(2) - pbyCaps = (PBYTE)pIE_RSN_Auth->AuthKSList[n].abyOUI; + pbyCaps = (unsigned char *)pIE_RSN_Auth->AuthKSList[n].abyOUI; pBSSList->byDefaultK_as_PK = (*pbyCaps) & WPA_GROUPFLAG; pBSSList->byReplayIdx = 2 << ((*pbyCaps >> WPA_REPLAYBITSSHIFT) & WPA_REPLAYBITS); - pBSSList->sRSNCapObj.bRSNCapExist = TRUE; - pBSSList->sRSNCapObj.wRSNCap = *(PWORD)pbyCaps; + pBSSList->sRSNCapObj.bRSNCapExist = true; + pBSSList->sRSNCapObj.wRSNCap = *(unsigned short *)pbyCaps; //DBG_PRN_GRP14(("pbyCaps: %X\n", *pbyCaps)); //DBG_PRN_GRP14(("byDefaultK_as_PK: %X\n", pBSSList->byDefaultK_as_PK)); //DBG_PRN_GRP14(("byReplayIdx: %X\n", pBSSList->byReplayIdx)); } } - pBSSList->bWPAValid = TRUE; + pBSSList->bWPAValid = true; } } @@ -237,24 +237,24 @@ WPA_ParseRSN ( * Return Value: none. * -*/ -BOOL +bool WPA_SearchRSN ( - BYTE byCmd, - BYTE byEncrypt, + unsigned char byCmd, + unsigned char byEncrypt, PKnownBSS pBSSList ) { int ii; - BYTE byPKType = WPA_NONE; + unsigned char byPKType = WPA_NONE; - if (pBSSList->bWPAValid == FALSE) - return FALSE; + if (pBSSList->bWPAValid == false) + return false; switch(byCmd) { case 0: if (byEncrypt != pBSSList->byGKType) - return FALSE; + return false; if (pBSSList->wPKCount > 0) { for (ii = 0; ii < pBSSList->wPKCount; ii ++) { @@ -268,9 +268,9 @@ WPA_SearchRSN ( byPKType = WPA_WEP104; } if (byEncrypt != byPKType) - return FALSE; + return false; } - return TRUE; + return true; // if (pBSSList->wAuthCount > 0) // for (ii=0; ii < pBSSList->wAuthCount; ii ++) // if (byAuth == pBSSList->abyAuthType[ii]) @@ -280,7 +280,7 @@ WPA_SearchRSN ( default: break; } - return FALSE; + return false; } /*+ @@ -297,20 +297,20 @@ WPA_SearchRSN ( * Return Value: none. * -*/ -BOOL +bool WPAb_Is_RSN ( PWLAN_IE_RSN_EXT pRSN ) { if (pRSN == NULL) - return FALSE; + return false; if ((pRSN->len >= 6) && // oui1(4)+ver(2) (pRSN->byElementID == WLAN_EID_RSN_WPA) && !memcmp(pRSN->abyOUI, abyOUI01, 4) && (pRSN->wVersion == 1)) { - return TRUE; + return true; } else - return FALSE; + return false; } diff --git a/drivers/staging/vt6655/wpa.h b/drivers/staging/vt6655/wpa.h index 80d990b09d2..921fd7ae9d3 100644 --- a/drivers/staging/vt6655/wpa.h +++ b/drivers/staging/vt6655/wpa.h @@ -69,14 +69,14 @@ WPA_ParseRSN( PWLAN_IE_RSN_EXT pRSN ); -BOOL +bool WPA_SearchRSN( - BYTE byCmd, - BYTE byEncrypt, + unsigned char byCmd, + unsigned char byEncrypt, PKnownBSS pBSSList ); -BOOL +bool WPAb_Is_RSN( PWLAN_IE_RSN_EXT pRSN ); diff --git a/drivers/staging/vt6655/wpa2.c b/drivers/staging/vt6655/wpa2.c index 7a42a0aad7d..805164bed7e 100644 --- a/drivers/staging/vt6655/wpa2.c +++ b/drivers/staging/vt6655/wpa2.c @@ -42,14 +42,14 @@ static int msglevel =MSG_LEVEL_INFO; /*--------------------- Static Variables --------------------------*/ -const BYTE abyOUIGK[4] = { 0x00, 0x0F, 0xAC, 0x00 }; -const BYTE abyOUIWEP40[4] = { 0x00, 0x0F, 0xAC, 0x01 }; -const BYTE abyOUIWEP104[4] = { 0x00, 0x0F, 0xAC, 0x05 }; -const BYTE abyOUITKIP[4] = { 0x00, 0x0F, 0xAC, 0x02 }; -const BYTE abyOUICCMP[4] = { 0x00, 0x0F, 0xAC, 0x04 }; +const unsigned char abyOUIGK[4] = { 0x00, 0x0F, 0xAC, 0x00 }; +const unsigned char abyOUIWEP40[4] = { 0x00, 0x0F, 0xAC, 0x01 }; +const unsigned char abyOUIWEP104[4] = { 0x00, 0x0F, 0xAC, 0x05 }; +const unsigned char abyOUITKIP[4] = { 0x00, 0x0F, 0xAC, 0x02 }; +const unsigned char abyOUICCMP[4] = { 0x00, 0x0F, 0xAC, 0x04 }; -const BYTE abyOUI8021X[4] = { 0x00, 0x0F, 0xAC, 0x01 }; -const BYTE abyOUIPSK[4] = { 0x00, 0x0F, 0xAC, 0x02 }; +const unsigned char abyOUI8021X[4] = { 0x00, 0x0F, 0xAC, 0x01 }; +const unsigned char abyOUIPSK[4] = { 0x00, 0x0F, 0xAC, 0x02 }; /*--------------------- Static Functions --------------------------*/ @@ -79,7 +79,7 @@ WPA2_ClearRSN ( { int ii; - pBSSNode->bWPA2Valid = FALSE; + pBSSNode->bWPA2Valid = false; pBSSNode->byCSSGK = WLAN_11i_CSS_CCMP; for (ii=0; ii < 4; ii ++) @@ -88,7 +88,7 @@ WPA2_ClearRSN ( for (ii=0; ii < 4; ii ++) pBSSNode->abyAKMSSAuthType[ii] = WLAN_11i_AKMSS_802_1X; pBSSNode->wAKMSSAuthCount = 1; - pBSSNode->sRSNCapObj.bRSNCapExist = FALSE; + pBSSNode->sRSNCapObj.bRSNCapExist = false; pBSSNode->sRSNCapObj.wRSNCap = 0; } @@ -114,9 +114,9 @@ WPA2vParseRSN ( ) { int i, j; - WORD m = 0, n = 0; - PBYTE pbyOUI; - BOOL bUseGK = FALSE; + unsigned short m = 0, n = 0; + unsigned char *pbyOUI; + bool bUseGK = false; DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"WPA2_ParseRSN: [%d]\n", pRSN->len); @@ -124,7 +124,7 @@ WPA2vParseRSN ( if (pRSN->len == 2) { // ver(2) if ((pRSN->byElementID == WLAN_EID_RSN) && (pRSN->wVersion == 1)) { - pBSSNode->bWPA2Valid = TRUE; + pBSSNode->bWPA2Valid = true; } return; } @@ -159,21 +159,21 @@ WPA2vParseRSN ( DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"802.11i CSS: %X\n", pBSSNode->byCSSGK); if (pRSN->len == 6) { - pBSSNode->bWPA2Valid = TRUE; + pBSSNode->bWPA2Valid = true; return; } if (pRSN->len >= 8) { // ver(2) + GK(4) + PK count(2) - pBSSNode->wCSSPKCount = *((PWORD) &(pRSN->abyRSN[4])); + pBSSNode->wCSSPKCount = *((unsigned short *) &(pRSN->abyRSN[4])); j = 0; pbyOUI = &(pRSN->abyRSN[6]); - for (i = 0; (i < pBSSNode->wCSSPKCount) && (j < sizeof(pBSSNode->abyCSSPK)/sizeof(BYTE)); i++) { + for (i = 0; (i < pBSSNode->wCSSPKCount) && (j < sizeof(pBSSNode->abyCSSPK)/sizeof(unsigned char)); i++) { if (pRSN->len >= 8+i*4+4) { // ver(2)+GK(4)+PKCnt(2)+PKS(4*i) if ( !memcmp(pbyOUI, abyOUIGK, 4)) { pBSSNode->abyCSSPK[j++] = WLAN_11i_CSS_USE_GROUP; - bUseGK = TRUE; + bUseGK = true; } else if ( !memcmp(pbyOUI, abyOUIWEP40, 4)) { // Invialid CSS, continue to parsing } else if ( !memcmp(pbyOUI, abyOUITKIP, 4)) { @@ -195,7 +195,7 @@ WPA2vParseRSN ( break; } //for - if (bUseGK == TRUE) { + if (bUseGK == true) { if (j != 1) { // invalid CSS, This should be only PK CSS. return; @@ -209,17 +209,17 @@ WPA2vParseRSN ( // invalid CSS, No valid PK. return; } - pBSSNode->wCSSPKCount = (WORD)j; + pBSSNode->wCSSPKCount = (unsigned short)j; DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"wCSSPKCount: %d\n", pBSSNode->wCSSPKCount); } - m = *((PWORD) &(pRSN->abyRSN[4])); + m = *((unsigned short *) &(pRSN->abyRSN[4])); if (pRSN->len >= 10+m*4) { // ver(2) + GK(4) + PK count(2) + PKS(4*m) + AKMSS count(2) - pBSSNode->wAKMSSAuthCount = *((PWORD) &(pRSN->abyRSN[6+4*m]));; + pBSSNode->wAKMSSAuthCount = *((unsigned short *) &(pRSN->abyRSN[6+4*m]));; j = 0; pbyOUI = &(pRSN->abyRSN[8+4*m]); - for (i = 0; (i < pBSSNode->wAKMSSAuthCount) && (j < sizeof(pBSSNode->abyAKMSSAuthType)/sizeof(BYTE)); i++) { + for (i = 0; (i < pBSSNode->wAKMSSAuthCount) && (j < sizeof(pBSSNode->abyAKMSSAuthType)/sizeof(unsigned char)); i++) { if (pRSN->len >= 10+(m+i)*4+4) { // ver(2)+GK(4)+PKCnt(2)+PKS(4*m)+AKMSS(2)+AKS(4*i) if ( !memcmp(pbyOUI, abyOUI8021X, 4)) pBSSNode->abyAKMSSAuthType[j++] = WLAN_11i_AKMSS_802_1X; @@ -232,17 +232,17 @@ WPA2vParseRSN ( } else break; } - pBSSNode->wAKMSSAuthCount = (WORD)j; + pBSSNode->wAKMSSAuthCount = (unsigned short)j; DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"wAKMSSAuthCount: %d\n", pBSSNode->wAKMSSAuthCount); - n = *((PWORD) &(pRSN->abyRSN[6+4*m]));; + n = *((unsigned short *) &(pRSN->abyRSN[6+4*m]));; if (pRSN->len >= 12+4*m+4*n) { // ver(2)+GK(4)+PKCnt(2)+PKS(4*m)+AKMSSCnt(2)+AKMSS(4*n)+Cap(2) - pBSSNode->sRSNCapObj.bRSNCapExist = TRUE; - pBSSNode->sRSNCapObj.wRSNCap = *((PWORD) &(pRSN->abyRSN[8+4*m+4*n])); + pBSSNode->sRSNCapObj.bRSNCapExist = true; + pBSSNode->sRSNCapObj.wRSNCap = *((unsigned short *) &(pRSN->abyRSN[8+4*m+4*n])); } } //ignore PMKID lists bcs only (Re)Assocrequest has this field - pBSSNode->bWPA2Valid = TRUE; + pBSSNode->bWPA2Valid = true; } } @@ -261,16 +261,16 @@ WPA2vParseRSN ( * Return Value: length of IEs. * -*/ -UINT +unsigned int WPA2uSetIEs( void *pMgmtHandle, PWLAN_IE_RSN pRSNIEs ) { PSMgmtObject pMgmt = (PSMgmtObject) pMgmtHandle; - PBYTE pbyBuffer = NULL; - UINT ii = 0; - PWORD pwPMKID = NULL; + unsigned char *pbyBuffer = NULL; + unsigned int ii = 0; + unsigned short *pwPMKID = NULL; if (pRSNIEs == NULL) { return(0); @@ -279,7 +279,7 @@ WPA2uSetIEs( (pMgmt->eAuthenMode == WMAC_AUTH_WPA2PSK)) && (pMgmt->pCurrBSS != NULL)) { /* WPA2 IE */ - pbyBuffer = (PBYTE) pRSNIEs; + pbyBuffer = (unsigned char *) pRSNIEs; pRSNIEs->byElementID = WLAN_EID_RSN; pRSNIEs->len = 6; //Version(2)+GK(4) pRSNIEs->wVersion = 1; @@ -330,7 +330,7 @@ WPA2uSetIEs( pRSNIEs->len +=6; // RSN Capabilites - if (pMgmt->pCurrBSS->sRSNCapObj.bRSNCapExist == TRUE) { + if (pMgmt->pCurrBSS->sRSNCapObj.bRSNCapExist == true) { memcpy(&pRSNIEs->abyRSN[16], &pMgmt->pCurrBSS->sRSNCapObj.wRSNCap, 2); } else { pRSNIEs->abyRSN[16] = 0; @@ -339,10 +339,10 @@ WPA2uSetIEs( pRSNIEs->len +=2; if ((pMgmt->gsPMKIDCache.BSSIDInfoCount > 0) && - (pMgmt->bRoaming == TRUE) && + (pMgmt->bRoaming == true) && (pMgmt->eAuthenMode == WMAC_AUTH_WPA2)) { // RSN PMKID - pwPMKID = (PWORD)(&pRSNIEs->abyRSN[18]); // Point to PMKID count + pwPMKID = (unsigned short *)(&pRSNIEs->abyRSN[18]); // Point to PMKID count *pwPMKID = 0; // Initialize PMKID count pbyBuffer = &pRSNIEs->abyRSN[20]; // Point to PMKID list for (ii = 0; ii < pMgmt->gsPMKIDCache.BSSIDInfoCount; ii++) { diff --git a/drivers/staging/vt6655/wpa2.h b/drivers/staging/vt6655/wpa2.h index 7200db37f43..718208beb72 100644 --- a/drivers/staging/vt6655/wpa2.h +++ b/drivers/staging/vt6655/wpa2.h @@ -40,12 +40,12 @@ #define MAX_PMKID_CACHE 16 typedef struct tagsPMKIDInfo { - BYTE abyBSSID[6]; - BYTE abyPMKID[16]; + unsigned char abyBSSID[6]; + unsigned char abyPMKID[16]; } PMKIDInfo, *PPMKIDInfo; typedef struct tagSPMKIDCache { - ULONG BSSIDInfoCount; + unsigned long BSSIDInfoCount; PMKIDInfo BSSIDInfo[MAX_PMKID_CACHE]; } SPMKIDCache, *PSPMKIDCache; @@ -69,7 +69,7 @@ WPA2vParseRSN ( PWLAN_IE_RSN pRSN ); -UINT +unsigned int WPA2uSetIEs( void *pMgmtHandle, PWLAN_IE_RSN pRSNIEs diff --git a/drivers/staging/vt6655/wpactl.c b/drivers/staging/vt6655/wpactl.c index 22c2fab3f32..0142338bcaf 100644 --- a/drivers/staging/vt6655/wpactl.c +++ b/drivers/staging/vt6655/wpactl.c @@ -199,16 +199,16 @@ int wpa_set_wpadev(PSDevice pDevice, int val) * */ - int wpa_set_keys(PSDevice pDevice, void *ctx, BOOL fcpfkernel) + int wpa_set_keys(PSDevice pDevice, void *ctx, bool fcpfkernel) { struct viawget_wpa_param *param=ctx; PSMgmtObject pMgmt = pDevice->pMgmt; - DWORD dwKeyIndex = 0; - BYTE abyKey[MAX_KEY_LEN]; - BYTE abySeq[MAX_KEY_LEN]; + unsigned long dwKeyIndex = 0; + unsigned char abyKey[MAX_KEY_LEN]; + unsigned char abySeq[MAX_KEY_LEN]; QWORD KeyRSC; // NDIS_802_11_KEY_RSC KeyRSC; - BYTE byKeyDecMode = KEY_CTL_WEP; + unsigned char byKeyDecMode = KEY_CTL_WEP; int ret = 0; int uu, ii; @@ -219,9 +219,9 @@ int wpa_set_wpadev(PSDevice pDevice, int val) DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "param->u.wpa_key.alg_name = %d \n", param->u.wpa_key.alg_name); if (param->u.wpa_key.alg_name == WPA_ALG_NONE) { pDevice->eEncryptionStatus = Ndis802_11EncryptionDisabled; - pDevice->bEncryptionEnable = FALSE; + pDevice->bEncryptionEnable = false; pDevice->byKeyIndex = 0; - pDevice->bTransmitKey = FALSE; + pDevice->bTransmitKey = false; KeyvRemoveAllWEPKey(&(pDevice->sKey), pDevice->PortOffset); for (uu=0; uu<MAX_KEY_TABLE; uu++) { MACvDisableKeyEntry(pDevice->PortOffset, uu); @@ -243,7 +243,7 @@ int wpa_set_wpadev(PSDevice pDevice, int val) spin_lock_irq(&pDevice->lock); } - dwKeyIndex = (DWORD)(param->u.wpa_key.key_index); + dwKeyIndex = (unsigned long)(param->u.wpa_key.key_index); if (param->u.wpa_key.alg_name == WPA_ALG_WEP) { if (dwKeyIndex > 3) { @@ -251,8 +251,8 @@ spin_lock_irq(&pDevice->lock); } else { if (param->u.wpa_key.set_tx) { - pDevice->byKeyIndex = (BYTE)dwKeyIndex; - pDevice->bTransmitKey = TRUE; + pDevice->byKeyIndex = (unsigned char)dwKeyIndex; + pDevice->bTransmitKey = true; dwKeyIndex |= (1 << 31); } KeybSetDefaultKey(&(pDevice->sKey), @@ -266,7 +266,7 @@ spin_lock_irq(&pDevice->lock); } pDevice->eEncryptionStatus = Ndis802_11Encryption1Enabled; - pDevice->bEncryptionEnable = TRUE; + pDevice->bEncryptionEnable = true; return ret; } @@ -351,26 +351,26 @@ spin_lock_irq(&pDevice->lock); } // spin_lock_irq(&pDevice->lock); - if (IS_BROADCAST_ADDRESS(¶m->addr[0]) || (param->addr == NULL)) { - // If IS_BROADCAST_ADDRESS, set the key as every key entry's group key. + if (is_broadcast_ether_addr(¶m->addr[0]) || (param->addr == NULL)) { + // If is_broadcast_ether_addr, set the key as every key entry's group key. DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Groupe Key Assign.\n"); if ((KeybSetAllGroupKey(&(pDevice->sKey), dwKeyIndex, param->u.wpa_key.key_len, (PQWORD) &(KeyRSC), - (PBYTE)abyKey, + (unsigned char *)abyKey, byKeyDecMode, pDevice->PortOffset, - pDevice->byLocalID) == TRUE) && + pDevice->byLocalID) == true) && (KeybSetDefaultKey(&(pDevice->sKey), dwKeyIndex, param->u.wpa_key.key_len, (PQWORD) &(KeyRSC), - (PBYTE)abyKey, + (unsigned char *)abyKey, byKeyDecMode, pDevice->PortOffset, - pDevice->byLocalID) == TRUE) ) { + pDevice->byLocalID) == true) ) { DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "GROUP Key Assign.\n"); } else { @@ -400,15 +400,15 @@ spin_lock_irq(&pDevice->lock); dwKeyIndex, param->u.wpa_key.key_len, (PQWORD) &(KeyRSC), - (PBYTE)abyKey, + (unsigned char *)abyKey, byKeyDecMode, pDevice->PortOffset, - pDevice->byLocalID) == TRUE) { + pDevice->byLocalID) == true) { DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Pairwise Key Set\n"); } else { // Key Table Full - if (IS_ETH_ADDRESS_EQUAL(¶m->addr[0], pDevice->abyBSSID)) { + if (!compare_ether_addr(¶m->addr[0], pDevice->abyBSSID)) { //DBG_PRN_WLAN03(("return NDIS_STATUS_INVALID_DATA -Key Table Full.2\n")); //spin_unlock_irq(&pDevice->lock); return -EINVAL; @@ -422,10 +422,10 @@ spin_lock_irq(&pDevice->lock); } } // BSSID not 0xffffffffffff if ((ret == 0) && ((param->u.wpa_key.set_tx) != 0)) { - pDevice->byKeyIndex = (BYTE)param->u.wpa_key.key_index; - pDevice->bTransmitKey = TRUE; + pDevice->byKeyIndex = (unsigned char)param->u.wpa_key.key_index; + pDevice->bTransmitKey = true; } - pDevice->bEncryptionEnable = TRUE; + pDevice->bEncryptionEnable = true; //spin_unlock_irq(&pDevice->lock); /* @@ -465,7 +465,7 @@ static int wpa_set_wpa(PSDevice pDevice, int ret = 0; pMgmt->eAuthenMode = WMAC_AUTH_OPEN; - pMgmt->bShareKeyAlgorithm = FALSE; + pMgmt->bShareKeyAlgorithm = false; return ret; } @@ -613,13 +613,13 @@ static int wpa_get_scan(PSDevice pDevice, PSMgmtObject pMgmt = pDevice->pMgmt; PWLAN_IE_SSID pItemSSID; PKnownBSS pBSS; - PBYTE pBuf; + unsigned char *pBuf; int ret = 0; u16 count = 0; u16 ii, jj; #if 1 - PBYTE ptempBSS; + unsigned char *ptempBSS; @@ -639,9 +639,9 @@ static int wpa_get_scan(PSDevice pDevice, for(jj=0;jj<MAX_BSS_NUM-ii-1;jj++) { - if((pMgmt->sBSSList[jj].bActive!=TRUE) || + if((pMgmt->sBSSList[jj].bActive!=true) || - ((pMgmt->sBSSList[jj].uRSSI>pMgmt->sBSSList[jj+1].uRSSI) &&(pMgmt->sBSSList[jj+1].bActive!=FALSE))) { + ((pMgmt->sBSSList[jj].uRSSI>pMgmt->sBSSList[jj+1].uRSSI) &&(pMgmt->sBSSList[jj+1].bActive!=false))) { memcpy(ptempBSS,&pMgmt->sBSSList[jj],sizeof(KnownBSS)); @@ -713,7 +713,7 @@ static int wpa_get_scan(PSDevice pDevice, scan_buf->rsn_ie_len = pBSS->wRSNLen; memcpy(scan_buf->rsn_ie, pBSS->byRSNIE, pBSS->wRSNLen); } - scan_buf = (struct viawget_scan_result *)((PBYTE)scan_buf + sizeof(struct viawget_scan_result)); + scan_buf = (struct viawget_scan_result *)((unsigned char *)scan_buf + sizeof(struct viawget_scan_result)); jj ++; } } @@ -752,10 +752,10 @@ static int wpa_set_associate(PSDevice pDevice, { PSMgmtObject pMgmt = pDevice->pMgmt; PWLAN_IE_SSID pItemSSID; - BYTE abyNullAddr[] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; - BYTE abyWPAIE[64]; + unsigned char abyNullAddr[] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; + unsigned char abyWPAIE[64]; int ret = 0; - BOOL bWepEnabled=FALSE; + bool bWepEnabled=false; // set key type & algorithm DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "pairwise_suite = %d\n", param->u.wpa_associate.pairwise_suite); @@ -817,7 +817,7 @@ else case CIPHER_WEP40: case CIPHER_WEP104: pDevice->eEncryptionStatus = Ndis802_11Encryption1Enabled; - bWepEnabled=TRUE; + bWepEnabled=true; break; case CIPHER_NONE: if (param->u.wpa_associate.group_suite == CIPHER_CCMP) @@ -834,26 +834,26 @@ else if (pMgmt->eAuthenMode == WMAC_AUTH_SHAREKEY) { pDevice->eEncryptionStatus = Ndis802_11Encryption1Enabled; //pMgmt->eAuthenMode = WMAC_AUTH_SHAREKEY; - pMgmt->bShareKeyAlgorithm = TRUE; + pMgmt->bShareKeyAlgorithm = true; } else if (pMgmt->eAuthenMode == WMAC_AUTH_OPEN) { if(!bWepEnabled) pDevice->eEncryptionStatus = Ndis802_11EncryptionDisabled; else pDevice->eEncryptionStatus = Ndis802_11Encryption1Enabled; //pMgmt->eAuthenMode = WMAC_AUTH_OPEN; - //pMgmt->bShareKeyAlgorithm = FALSE; //20080717-06,<Modify> by chester//Fix Open mode, WEP encrytion + //pMgmt->bShareKeyAlgorithm = false; //20080717-06,<Modify> by chester//Fix Open mode, WEP encrytion } //mike save old encryption status pDevice->eOldEncryptionStatus = pDevice->eEncryptionStatus; if (pDevice->eEncryptionStatus != Ndis802_11EncryptionDisabled) - pDevice->bEncryptionEnable = TRUE; + pDevice->bEncryptionEnable = true; else - pDevice->bEncryptionEnable = FALSE; + pDevice->bEncryptionEnable = false; if (!((pMgmt->eAuthenMode == WMAC_AUTH_SHAREKEY) || - ((pMgmt->eAuthenMode == WMAC_AUTH_OPEN) && (bWepEnabled==TRUE))) ) //DavidWang //20080717-06,<Modify> by chester//Not to initial WEP + ((pMgmt->eAuthenMode == WMAC_AUTH_OPEN) && (bWepEnabled==true))) ) //DavidWang //20080717-06,<Modify> by chester//Not to initial WEP KeyvInitTable(&pDevice->sKey, pDevice->PortOffset); spin_lock_irq(&pDevice->lock); - pDevice->bLinkPass = FALSE; + pDevice->bLinkPass = false; memset(pMgmt->abyCurrBSSID, 0, 6); pMgmt->eCurrState = WMAC_STATE_IDLE; netif_stop_queue(pDevice->dev); @@ -922,7 +922,7 @@ int wpa_ioctl(PSDevice pDevice, struct iw_point *p) case VIAWGET_SET_KEY: DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "VIAWGET_SET_KEY \n"); spin_lock_irq(&pDevice->lock); - ret = wpa_set_keys(pDevice, param, FALSE); + ret = wpa_set_keys(pDevice, param, false); spin_unlock_irq(&pDevice->lock); break; diff --git a/drivers/staging/vt6655/wpactl.h b/drivers/staging/vt6655/wpactl.h index b0d92d51a2a..dbe8e861d99 100644 --- a/drivers/staging/vt6655/wpactl.h +++ b/drivers/staging/vt6655/wpactl.h @@ -54,7 +54,7 @@ typedef enum { KEY_MGMT_802_1X, KEY_MGMT_CCKM,KEY_MGMT_PSK, KEY_MGMT_NONE, -typedef ULONGLONG NDIS_802_11_KEY_RSC; +typedef unsigned long long NDIS_802_11_KEY_RSC; /*--------------------- Export Classes ----------------------------*/ @@ -64,7 +64,7 @@ typedef ULONGLONG NDIS_802_11_KEY_RSC; int wpa_set_wpadev(PSDevice pDevice, int val); int wpa_ioctl(PSDevice pDevice, struct iw_point *p); -int wpa_set_keys(PSDevice pDevice, void *ctx, BOOL fcpfkernel); +int wpa_set_keys(PSDevice pDevice, void *ctx, bool fcpfkernel); #endif // __WPACL_H__ diff --git a/drivers/staging/vt6655/wroute.c b/drivers/staging/vt6655/wroute.c index bf92fb9908f..66e2eeae628 100644 --- a/drivers/staging/vt6655/wroute.c +++ b/drivers/staging/vt6655/wroute.c @@ -53,45 +53,45 @@ static int msglevel =MSG_LEVEL_INFO; /* * Description: - * Relay packet. Return TRUE if packet is copy to DMA1 + * Relay packet. Return true if packet is copy to DMA1 * * Parameters: * In: * pDevice - * pbySkbData - rx packet skb data * Out: - * TURE, FALSE + * true, false * - * Return Value: TRUE if packet duplicate; otherwise FALSE + * Return Value: true if packet duplicate; otherwise false * */ -BOOL ROUTEbRelay (PSDevice pDevice, PBYTE pbySkbData, UINT uDataLen, UINT uNodeIndex) +bool ROUTEbRelay (PSDevice pDevice, unsigned char *pbySkbData, unsigned int uDataLen, unsigned int uNodeIndex) { PSMgmtObject pMgmt = pDevice->pMgmt; PSTxDesc pHeadTD, pLastTD; - UINT cbFrameBodySize; - UINT uMACfragNum; - BYTE byPktType; - BOOL bNeedEncryption = FALSE; + unsigned int cbFrameBodySize; + unsigned int uMACfragNum; + unsigned char byPktType; + bool bNeedEncryption = false; SKeyItem STempKey; PSKeyItem pTransmitKey = NULL; - UINT cbHeaderSize; - UINT ii; - PBYTE pbyBSSID; + unsigned int cbHeaderSize; + unsigned int ii; + unsigned char *pbyBSSID; if (AVAIL_TD(pDevice, TYPE_AC0DMA)<=0) { DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Relay can't allocate TD1..\n"); - return FALSE; + return false; } pHeadTD = pDevice->apCurrTD[TYPE_AC0DMA]; pHeadTD->m_td1TD1.byTCR = (TCR_EDP|TCR_STP); - memcpy(pDevice->sTxEthHeader.abyDstAddr, (PBYTE)pbySkbData, ETH_HLEN); + memcpy(pDevice->sTxEthHeader.abyDstAddr, (unsigned char *)pbySkbData, ETH_HLEN); cbFrameBodySize = uDataLen - ETH_HLEN; @@ -99,12 +99,12 @@ BOOL ROUTEbRelay (PSDevice pDevice, PBYTE pbySkbData, UINT uDataLen, UINT uNodeI cbFrameBodySize += 8; } - if (pDevice->bEncryptionEnable == TRUE) { - bNeedEncryption = TRUE; + if (pDevice->bEncryptionEnable == true) { + bNeedEncryption = true; // get group key pbyBSSID = pDevice->abyBroadcastAddr; - if(KeybGetTransmitKey(&(pDevice->sKey), pbyBSSID, GROUP_KEY, &pTransmitKey) == FALSE) { + if(KeybGetTransmitKey(&(pDevice->sKey), pbyBSSID, GROUP_KEY, &pTransmitKey) == false) { pTransmitKey = NULL; DBG_PRT(MSG_LEVEL_DEBUG, KERN_DEBUG"KEY is NULL. [%d]\n", pDevice->pMgmt->eCurrMode); } else { @@ -130,16 +130,16 @@ BOOL ROUTEbRelay (PSDevice pDevice, PBYTE pbySkbData, UINT uDataLen, UINT uNodeI uMACfragNum = cbGetFragCount(pDevice, pTransmitKey, cbFrameBodySize, &pDevice->sTxEthHeader); if (uMACfragNum > AVAIL_TD(pDevice,TYPE_AC0DMA)) { - return FALSE; + return false; } - byPktType = (BYTE)pDevice->byPacketType; + byPktType = (unsigned char)pDevice->byPacketType; if (pDevice->bFixRate) { if (pDevice->eCurrentPHYType == PHY_TYPE_11B) { if (pDevice->uConnectionRate >= RATE_11M) { pDevice->wCurrentRate = RATE_11M; } else { - pDevice->wCurrentRate = (WORD)pDevice->uConnectionRate; + pDevice->wCurrentRate = (unsigned short)pDevice->uConnectionRate; } } else { if ((pDevice->eCurrentPHYType == PHY_TYPE_11A) && @@ -149,7 +149,7 @@ BOOL ROUTEbRelay (PSDevice pDevice, PBYTE pbySkbData, UINT uDataLen, UINT uNodeI if (pDevice->uConnectionRate >= RATE_54M) pDevice->wCurrentRate = RATE_54M; else - pDevice->wCurrentRate = (WORD)pDevice->uConnectionRate; + pDevice->wCurrentRate = (unsigned short)pDevice->uConnectionRate; } } } @@ -172,7 +172,7 @@ BOOL ROUTEbRelay (PSDevice pDevice, PBYTE pbySkbData, UINT uDataLen, UINT uNodeI MACbPSWakeup(pDevice->PortOffset); } - pDevice->bPWBitOn = FALSE; + pDevice->bPWBitOn = false; pLastTD = pHeadTD; for (ii = 0; ii < uMACfragNum; ii++) { @@ -192,7 +192,7 @@ BOOL ROUTEbRelay (PSDevice pDevice, PBYTE pbySkbData, UINT uDataLen, UINT uNodeI MACvTransmitAC0(pDevice->PortOffset); - return TRUE; + return true; } diff --git a/drivers/staging/vt6655/wroute.h b/drivers/staging/vt6655/wroute.h index 295cdc5b8e9..34f9e43a6cc 100644 --- a/drivers/staging/vt6655/wroute.h +++ b/drivers/staging/vt6655/wroute.h @@ -39,7 +39,7 @@ /*--------------------- Export Functions --------------------------*/ -BOOL ROUTEbRelay (PSDevice pDevice, PBYTE pbySkbData, UINT uDataLen, UINT uNodeIndex); +bool ROUTEbRelay (PSDevice pDevice, unsigned char *pbySkbData, unsigned int uDataLen, unsigned int uNodeIndex); #endif // __WROUTE_H__ |