diff options
author | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2009-12-11 12:23:15 -0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2009-12-11 12:23:15 -0800 |
commit | 51126deb201c59cc8cdc4873e3d130d6bc60513d (patch) | |
tree | aae5d37bda36d40b6486021e5f2e4d8c7721dfba /drivers/staging/rt2860/common | |
parent | cc27706961cbe2de1b2b1d1b498efa7b6f04a822 (diff) |
Staging: rt28x0: remove typedefs (part one)
Remove typedefs from rtmp_type.h.
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging/rt2860/common')
33 files changed, 2315 insertions, 2315 deletions
diff --git a/drivers/staging/rt2860/common/action.c b/drivers/staging/rt2860/common/action.c index f69681d65fc..8928ee74267 100644 --- a/drivers/staging/rt2860/common/action.c +++ b/drivers/staging/rt2860/common/action.c @@ -39,7 +39,7 @@ #include "../rt_config.h" #include "action.h" -static VOID ReservedAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem); +static void ReservedAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem); /* ========================================================================== @@ -58,7 +58,7 @@ static VOID ReservedAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem); MT2_CLS3ERR cls3err_action ========================================================================== */ -VOID ActionStateMachineInit(IN PRTMP_ADAPTER pAd, +void ActionStateMachineInit(IN PRTMP_ADAPTER pAd, IN STATE_MACHINE * S, OUT STATE_MACHINE_FUNC Trans[]) { @@ -98,15 +98,15 @@ VOID ActionStateMachineInit(IN PRTMP_ADAPTER pAd, (STATE_MACHINE_FUNC) MlmeInvalidAction); } -VOID MlmeADDBAAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) +void MlmeADDBAAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) { MLME_ADDBA_REQ_STRUCT *pInfo; - UCHAR Addr[6]; - PUCHAR pOutBuffer = NULL; - NDIS_STATUS NStatus; - ULONG Idx; + u8 Addr[6]; + u8 *pOutBuffer = NULL; + int NStatus; + unsigned long Idx; FRAME_ADDBA_REQ Frame; - ULONG FrameLen; + unsigned long FrameLen; BA_ORI_ENTRY *pBAEntry = NULL; pInfo = (MLME_ADDBA_REQ_STRUCT *) Elem->Msg; @@ -155,8 +155,8 @@ VOID MlmeADDBAAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) Frame.BaStartSeq.field.StartSeq = pAd->MacTab.Content[pInfo->Wcid].TxSeq[pInfo->TID]; - *(USHORT *) (&Frame.BaParm) = - cpu2le16(*(USHORT *) (&Frame.BaParm)); + *(u16 *) (&Frame.BaParm) = + cpu2le16(*(u16 *) (&Frame.BaParm)); Frame.TimeOutValue = cpu2le16(Frame.TimeOutValue); Frame.BaStartSeq.word = cpu2le16(Frame.BaStartSeq.word); @@ -188,15 +188,15 @@ VOID MlmeADDBAAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) ========================================================================== */ -VOID MlmeDELBAAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) +void MlmeDELBAAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) { MLME_DELBA_REQ_STRUCT *pInfo; - PUCHAR pOutBuffer = NULL; - PUCHAR pOutBuffer2 = NULL; - NDIS_STATUS NStatus; - ULONG Idx; + u8 *pOutBuffer = NULL; + u8 *pOutBuffer2 = NULL; + int NStatus; + unsigned long Idx; FRAME_DELBA_REQ Frame; - ULONG FrameLen; + unsigned long FrameLen; FRAME_BAR FrameBar; pInfo = (MLME_DELBA_REQ_STRUCT *) Elem->Msg; @@ -264,8 +264,8 @@ VOID MlmeDELBAAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) Frame.DelbaParm.Initiator = pInfo->Initiator; Frame.DelbaParm.TID = pInfo->TID; Frame.ReasonCode = 39; /* Time Out */ - *(USHORT *) (&Frame.DelbaParm) = - cpu2le16(*(USHORT *) (&Frame.DelbaParm)); + *(u16 *) (&Frame.DelbaParm) = + cpu2le16(*(u16 *) (&Frame.DelbaParm)); Frame.ReasonCode = cpu2le16(Frame.ReasonCode); MakeOutgoingFrame(pOutBuffer, &FrameLen, @@ -278,27 +278,27 @@ VOID MlmeDELBAAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) } } -VOID MlmeQOSAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) +void MlmeQOSAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) { } -VOID MlmeDLSAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) +void MlmeDLSAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) { } -VOID MlmeInvalidAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) +void MlmeInvalidAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) { - /*PUCHAR pOutBuffer = NULL; */ + /*u8 * pOutBuffer = NULL; */ /*Return the receiving frame except the MSB of category filed set to 1. 7.3.1.11 */ } -VOID PeerQOSAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) +void PeerQOSAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) { } -VOID PeerBAAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) +void PeerBAAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) { - UCHAR Action = Elem->Msg[LENGTH_802_11 + 1]; + u8 Action = Elem->Msg[LENGTH_802_11 + 1]; switch (Action) { case ADDBA_REQ: @@ -313,15 +313,15 @@ VOID PeerBAAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) } } -VOID PeerPublicAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) +void PeerPublicAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) { if (Elem->Wcid >= MAX_LEN_OF_MAC_TABLE) return; } -static VOID ReservedAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) +static void ReservedAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) { - UCHAR Category; + u8 Category; if (Elem->MsgLen <= LENGTH_802_11) { return; @@ -333,19 +333,19 @@ static VOID ReservedAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) hex_dump("Reserved Action Frame", &Elem->Msg[0], Elem->MsgLen); } -VOID PeerRMAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) +void PeerRMAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) { return; } -static VOID respond_ht_information_exchange_action(IN PRTMP_ADAPTER pAd, +static void respond_ht_information_exchange_action(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) { - PUCHAR pOutBuffer = NULL; - NDIS_STATUS NStatus; - ULONG FrameLen; + u8 *pOutBuffer = NULL; + int NStatus; + unsigned long FrameLen; FRAME_HT_INFO HTINFOframe, *pFrame; - UCHAR *pAddr; + u8 *pAddr; /* 2. Always send back ADDBA Response */ NStatus = MlmeAllocateMemory(pAd, &pOutBuffer); /*Get an unused nonpaged memory */ @@ -387,9 +387,9 @@ static VOID respond_ht_information_exchange_action(IN PRTMP_ADAPTER pAd, MlmeFreeMemory(pAd, pOutBuffer); } -VOID PeerHTAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) +void PeerHTAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) { - UCHAR Action = Elem->Msg[LENGTH_802_11 + 1]; + u8 Action = Elem->Msg[LENGTH_802_11 + 1]; if (Elem->Wcid >= MAX_LEN_OF_MAC_TABLE) return; @@ -467,11 +467,11 @@ VOID PeerHTAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) FALSE , then continue indicaterx at this moment. ========================================================================== */ -VOID ORIBATimerTimeout(IN PRTMP_ADAPTER pAd) +void ORIBATimerTimeout(IN PRTMP_ADAPTER pAd) { MAC_TABLE_ENTRY *pEntry; - INT i, total; - UCHAR TID; + int i, total; + u8 TID; total = pAd->MacTab.Size * NUM_OF_TID; @@ -489,15 +489,15 @@ VOID ORIBATimerTimeout(IN PRTMP_ADAPTER pAd) } } -VOID SendRefreshBAR(IN PRTMP_ADAPTER pAd, IN MAC_TABLE_ENTRY * pEntry) +void SendRefreshBAR(IN PRTMP_ADAPTER pAd, IN MAC_TABLE_ENTRY * pEntry) { FRAME_BAR FrameBar; - ULONG FrameLen; - NDIS_STATUS NStatus; - PUCHAR pOutBuffer = NULL; - USHORT Sequence; - UCHAR i, TID; - USHORT idx; + unsigned long FrameLen; + int NStatus; + u8 *pOutBuffer = NULL; + u16 Sequence; + u8 i, TID; + u16 idx; BA_ORI_ENTRY *pBAEntry; for (i = 0; i < NUM_OF_TID; i++) { @@ -547,9 +547,9 @@ VOID SendRefreshBAR(IN PRTMP_ADAPTER pAd, IN MAC_TABLE_ENTRY * pEntry) } } -VOID ActHeaderInit(IN PRTMP_ADAPTER pAd, +void ActHeaderInit(IN PRTMP_ADAPTER pAd, IN OUT PHEADER_802_11 pHdr80211, - IN PUCHAR Addr1, IN PUCHAR Addr2, IN PUCHAR Addr3) + u8 *Addr1, u8 *Addr2, u8 *Addr3) { NdisZeroMemory(pHdr80211, sizeof(HEADER_802_11)); pHdr80211->FC.Type = BTYPE_MGMT; @@ -560,8 +560,8 @@ VOID ActHeaderInit(IN PRTMP_ADAPTER pAd, COPY_MAC_ADDR(pHdr80211->Addr3, Addr3); } -VOID BarHeaderInit(IN PRTMP_ADAPTER pAd, - IN OUT PFRAME_BAR pCntlBar, IN PUCHAR pDA, IN PUCHAR pSA) +void BarHeaderInit(IN PRTMP_ADAPTER pAd, + IN OUT PFRAME_BAR pCntlBar, u8 *pDA, u8 *pSA) { NdisZeroMemory(pCntlBar, sizeof(FRAME_BAR)); pCntlBar->FC.Type = BTYPE_CNTL; @@ -591,11 +591,11 @@ VOID BarHeaderInit(IN PRTMP_ADAPTER pAd, Return : None. ========================================================================== */ -VOID InsertActField(IN PRTMP_ADAPTER pAd, - OUT PUCHAR pFrameBuf, - OUT PULONG pFrameLen, IN UINT8 Category, IN UINT8 ActCode) +void InsertActField(IN PRTMP_ADAPTER pAd, + u8 *pFrameBuf, + unsigned long *pFrameLen, u8 Category, u8 ActCode) { - ULONG TempLen; + unsigned long TempLen; MakeOutgoingFrame(pFrameBuf, &TempLen, 1, &Category, 1, &ActCode, END_OF_ARGS); diff --git a/drivers/staging/rt2860/common/action.h b/drivers/staging/rt2860/common/action.h index 2484c2ebf51..f1d1ac73b1c 100644 --- a/drivers/staging/rt2860/common/action.h +++ b/drivers/staging/rt2860/common/action.h @@ -40,16 +40,16 @@ #define __ACTION_H__ typedef struct PACKED __HT_INFO_OCTET { - UCHAR Request:1; - UCHAR Forty_MHz_Intolerant:1; - UCHAR STA_Channel_Width:1; - UCHAR Reserved:5; + u8 Request:1; + u8 Forty_MHz_Intolerant:1; + u8 STA_Channel_Width:1; + u8 Reserved:5; } HT_INFORMATION_OCTET; typedef struct PACKED __FRAME_HT_INFO { HEADER_802_11 Hdr; - UCHAR Category; - UCHAR Action; + u8 Category; + u8 Action; HT_INFORMATION_OCTET HT_Info; } FRAME_HT_INFO, *PFRAME_HT_INFO; diff --git a/drivers/staging/rt2860/common/ba_action.c b/drivers/staging/rt2860/common/ba_action.c index 97cb40a2826..1ffa176ce8a 100644 --- a/drivers/staging/rt2860/common/ba_action.c +++ b/drivers/staging/rt2860/common/ba_action.c @@ -41,19 +41,19 @@ static void ba_mpdu_blk_free(PRTMP_ADAPTER pAd, struct reordering_mpdu *mpdu_blk); -BA_ORI_ENTRY *BATableAllocOriEntry(IN PRTMP_ADAPTER pAd, OUT USHORT * Idx); +BA_ORI_ENTRY *BATableAllocOriEntry(IN PRTMP_ADAPTER pAd, u16 * Idx); -BA_REC_ENTRY *BATableAllocRecEntry(IN PRTMP_ADAPTER pAd, OUT USHORT * Idx); +BA_REC_ENTRY *BATableAllocRecEntry(IN PRTMP_ADAPTER pAd, u16 * Idx); -VOID BAOriSessionSetupTimeout(IN PVOID SystemSpecific1, - IN PVOID FunctionContext, - IN PVOID SystemSpecific2, - IN PVOID SystemSpecific3); +void BAOriSessionSetupTimeout(void *SystemSpecific1, + void *FunctionContext, + void *SystemSpecific2, + void *SystemSpecific3); -VOID BARecSessionIdleTimeout(IN PVOID SystemSpecific1, - IN PVOID FunctionContext, - IN PVOID SystemSpecific2, - IN PVOID SystemSpecific3); +void BARecSessionIdleTimeout(void *SystemSpecific1, + void *FunctionContext, + void *SystemSpecific2, + void *SystemSpecific3); BUILD_TIMER_FUNCTION(BAOriSessionSetupTimeout); BUILD_TIMER_FUNCTION(BARecSessionIdleTimeout); @@ -61,10 +61,10 @@ BUILD_TIMER_FUNCTION(BARecSessionIdleTimeout); #define ANNOUNCE_REORDERING_PACKET(_pAd, _mpdu_blk) \ Announce_Reordering_Packet(_pAd, _mpdu_blk); -VOID BA_MaxWinSizeReasign(IN PRTMP_ADAPTER pAd, - IN MAC_TABLE_ENTRY * pEntryPeer, OUT UCHAR * pWinSize) +void BA_MaxWinSizeReasign(IN PRTMP_ADAPTER pAd, + IN MAC_TABLE_ENTRY * pEntryPeer, u8 * pWinSize) { - UCHAR MaxSize; + u8 MaxSize; if (pAd->MACVersion >= RALINK_2883_VERSION) /* 3*3 */ { @@ -232,7 +232,7 @@ void ba_reordering_resource_release(PRTMP_ADAPTER pAd) BOOLEAN ba_reordering_resource_init(PRTMP_ADAPTER pAd, int num) { int i; - PUCHAR mem; + u8 *mem; struct reordering_mpdu *mpdu_blk; struct reordering_list *freelist; @@ -246,10 +246,10 @@ BOOLEAN ba_reordering_resource_init(PRTMP_ADAPTER pAd, int num) DBGPRINT(RT_DEBUG_TRACE, ("Allocate %d memory for BA reordering\n", - (UINT32) (num * sizeof(struct reordering_mpdu)))); + (u32)(num * sizeof(struct reordering_mpdu)))); /* allocate number of mpdu_blk memory */ - os_alloc_mem(pAd, (PUCHAR *) & mem, + os_alloc_mem(pAd, (u8 **) & mem, (num * sizeof(struct reordering_mpdu))); pAd->mpdu_blk_pool.mem = mem; @@ -303,12 +303,12 @@ static void ba_mpdu_blk_free(PRTMP_ADAPTER pAd, NdisReleaseSpinLock(&pAd->mpdu_blk_pool.lock); } -static USHORT ba_indicate_reordering_mpdus_in_order(IN PRTMP_ADAPTER pAd, +static u16 ba_indicate_reordering_mpdus_in_order(IN PRTMP_ADAPTER pAd, IN PBA_REC_ENTRY pBAEntry, - IN USHORT StartSeq) + u16 StartSeq) { struct reordering_mpdu *mpdu_blk; - USHORT LastIndSeq = RESET_RCV_SEQ; + u16 LastIndSeq = RESET_RCV_SEQ; NdisAcquireSpinLock(&pBAEntry->RxReRingLock); @@ -336,7 +336,7 @@ static USHORT ba_indicate_reordering_mpdus_in_order(IN PRTMP_ADAPTER pAd, static void ba_indicate_reordering_mpdus_le_seq(IN PRTMP_ADAPTER pAd, IN PBA_REC_ENTRY pBAEntry, - IN USHORT Sequence) + u16 Sequence) { struct reordering_mpdu *mpdu_blk; @@ -383,9 +383,9 @@ static void ba_refresh_reordering_mpdus(IN PRTMP_ADAPTER pAd, /*static */ void ba_flush_reordering_timeout_mpdus(IN PRTMP_ADAPTER pAd, IN PBA_REC_ENTRY pBAEntry, - IN ULONG Now32) + unsigned long Now32) { - USHORT Sequence; + u16 Sequence; /* if ((RTMP_TIME_AFTER((unsigned long)Now32, (unsigned long)(pBAEntry->LastIndSeqAtTimer+REORDERING_PACKET_TIMEOUT)) && */ /* (pBAEntry->list.qlen > ((pBAEntry->BAWinSize*7)/8))) //|| */ @@ -440,15 +440,15 @@ void ba_flush_reordering_timeout_mpdus(IN PRTMP_ADAPTER pAd, * generate ADDBA request to * set up BA agreement */ -VOID BAOriSessionSetUp(IN PRTMP_ADAPTER pAd, +void BAOriSessionSetUp(IN PRTMP_ADAPTER pAd, IN MAC_TABLE_ENTRY * pEntry, - IN UCHAR TID, - IN USHORT TimeOut, - IN ULONG DelayTime, IN BOOLEAN isForced) + u8 TID, + u16 TimeOut, + unsigned long DelayTime, IN BOOLEAN isForced) { /*MLME_ADDBA_REQ_STRUCT AddbaReq; */ BA_ORI_ENTRY *pBAEntry = NULL; - USHORT Idx; + u16 Idx; BOOLEAN Cancelled; if ((pAd->CommonCfg.BACapability.field.AutoBA != TRUE) @@ -506,16 +506,16 @@ VOID BAOriSessionSetUp(IN PRTMP_ADAPTER pAd, RTMPSetTimer(&pBAEntry->ORIBATimer, DelayTime); } -VOID BAOriSessionAdd(IN PRTMP_ADAPTER pAd, +void BAOriSessionAdd(IN PRTMP_ADAPTER pAd, IN MAC_TABLE_ENTRY * pEntry, IN PFRAME_ADDBA_RSP pFrame) { BA_ORI_ENTRY *pBAEntry = NULL; BOOLEAN Cancelled; - UCHAR TID; - USHORT Idx; - PUCHAR pOutBuffer2 = NULL; - NDIS_STATUS NStatus; - ULONG FrameLen; + u8 TID; + u16 Idx; + u8 *pOutBuffer2 = NULL; + int NStatus; + unsigned long FrameLen; FRAME_BAR FrameBar; TID = pFrame->BaParm.TID; @@ -526,7 +526,7 @@ VOID BAOriSessionAdd(IN PRTMP_ADAPTER pAd, if ((Idx != 0) && (pBAEntry->TID == TID) && (pBAEntry->ORI_BA_Status == Originator_WaitRes)) { pBAEntry->BAWinSize = - min(pBAEntry->BAWinSize, ((UCHAR) pFrame->BaParm.BufSize)); + min(pBAEntry->BAWinSize, ((u8)pFrame->BaParm.BufSize)); BA_MaxWinSizeReasign(pAd, pEntry, &pBAEntry->BAWinSize); pBAEntry->TimeOutValue = pFrame->TimeOutValue; @@ -577,11 +577,11 @@ BOOLEAN BARecSessionAdd(IN PRTMP_ADAPTER pAd, BA_REC_ENTRY *pBAEntry = NULL; BOOLEAN Status = TRUE; BOOLEAN Cancelled; - USHORT Idx; - UCHAR TID; - UCHAR BAWinSize; - /*UINT32 Value; */ - /*UINT offset; */ + u16 Idx; + u8 TID; + u8 BAWinSize; + /*u32 Value; */ + /*u32 offset; */ ASSERT(pEntry); @@ -589,8 +589,8 @@ BOOLEAN BARecSessionAdd(IN PRTMP_ADAPTER pAd, TID = pFrame->BaParm.TID; BAWinSize = - min(((UCHAR) pFrame->BaParm.BufSize), - (UCHAR) pAd->CommonCfg.BACapability.field.RxBAWinLimit); + min(((u8)pFrame->BaParm.BufSize), + (u8)pAd->CommonCfg.BACapability.field.RxBAWinLimit); /* Intel patch */ if (BAWinSize == 0) { @@ -660,7 +660,7 @@ BOOLEAN BARecSessionAdd(IN PRTMP_ADAPTER pAd, return (Status); } -BA_REC_ENTRY *BATableAllocRecEntry(IN PRTMP_ADAPTER pAd, OUT USHORT * Idx) +BA_REC_ENTRY *BATableAllocRecEntry(IN PRTMP_ADAPTER pAd, u16 * Idx) { int i; BA_REC_ENTRY *pBAEntry = NULL; @@ -690,7 +690,7 @@ done: return pBAEntry; } -BA_ORI_ENTRY *BATableAllocOriEntry(IN PRTMP_ADAPTER pAd, OUT USHORT * Idx) +BA_ORI_ENTRY *BATableAllocOriEntry(IN PRTMP_ADAPTER pAd, u16 * Idx) { int i; BA_ORI_ENTRY *pBAEntry = NULL; @@ -718,7 +718,7 @@ done: return pBAEntry; } -VOID BATableFreeOriEntry(IN PRTMP_ADAPTER pAd, IN ULONG Idx) +void BATableFreeOriEntry(IN PRTMP_ADAPTER pAd, unsigned long Idx) { BA_ORI_ENTRY *pBAEntry = NULL; MAC_TABLE_ENTRY *pEntry; @@ -752,7 +752,7 @@ VOID BATableFreeOriEntry(IN PRTMP_ADAPTER pAd, IN ULONG Idx) } } -VOID BATableFreeRecEntry(IN PRTMP_ADAPTER pAd, IN ULONG Idx) +void BATableFreeRecEntry(IN PRTMP_ADAPTER pAd, unsigned long Idx) { BA_REC_ENTRY *pBAEntry = NULL; MAC_TABLE_ENTRY *pEntry; @@ -777,12 +777,12 @@ VOID BATableFreeRecEntry(IN PRTMP_ADAPTER pAd, IN ULONG Idx) } } -VOID BAOriSessionTearDown(IN OUT PRTMP_ADAPTER pAd, - IN UCHAR Wcid, - IN UCHAR TID, +void BAOriSessionTearDown(IN OUT PRTMP_ADAPTER pAd, + u8 Wcid, + u8 TID, IN BOOLEAN bPassive, IN BOOLEAN bForceSend) { - ULONG Idx = 0; + unsigned long Idx = 0; BA_ORI_ENTRY *pBAEntry; BOOLEAN Cancelled; @@ -867,10 +867,10 @@ VOID BAOriSessionTearDown(IN OUT PRTMP_ADAPTER pAd, } } -VOID BARecSessionTearDown(IN OUT PRTMP_ADAPTER pAd, - IN UCHAR Wcid, IN UCHAR TID, IN BOOLEAN bPassive) +void BARecSessionTearDown(IN OUT PRTMP_ADAPTER pAd, + u8 Wcid, u8 TID, IN BOOLEAN bPassive) { - ULONG Idx = 0; + unsigned long Idx = 0; BA_REC_ENTRY *pBAEntry; if (Wcid >= MAX_LEN_OF_MAC_TABLE) { @@ -897,8 +897,8 @@ VOID BARecSessionTearDown(IN OUT PRTMP_ADAPTER pAd, && (pBAEntry->REC_BA_Status == Recipient_Accept)) { MLME_DELBA_REQ_STRUCT DelbaReq; BOOLEAN Cancelled; - /*ULONG offset; */ - /*UINT32 VALUE; */ + /*unsigned long offset; */ + /*u32 VALUE; */ RTMPCancelTimer(&pBAEntry->RECBATimer, &Cancelled); @@ -956,7 +956,7 @@ VOID BARecSessionTearDown(IN OUT PRTMP_ADAPTER pAd, BATableFreeRecEntry(pAd, Idx); } -VOID BASessionTearDownALL(IN OUT PRTMP_ADAPTER pAd, IN UCHAR Wcid) +void BASessionTearDownALL(IN OUT PRTMP_ADAPTER pAd, u8 Wcid) { int i; @@ -980,10 +980,10 @@ VOID BASessionTearDownALL(IN OUT PRTMP_ADAPTER pAd, IN UCHAR Wcid) FALSE , then continue indicaterx at this moment. ========================================================================== */ -VOID BAOriSessionSetupTimeout(IN PVOID SystemSpecific1, - IN PVOID FunctionContext, - IN PVOID SystemSpecific2, - IN PVOID SystemSpecific3) +void BAOriSessionSetupTimeout(void *SystemSpecific1, + void *FunctionContext, + void *SystemSpecific2, + void *SystemSpecific3) { BA_ORI_ENTRY *pBAEntry = (BA_ORI_ENTRY *) FunctionContext; MAC_TABLE_ENTRY *pEntry; @@ -1008,14 +1008,14 @@ VOID BAOriSessionSetupTimeout(IN PVOID SystemSpecific1, NdisZeroMemory(&AddbaReq, sizeof(AddbaReq)); COPY_MAC_ADDR(AddbaReq.pAddr, pEntry->Addr); - AddbaReq.Wcid = (UCHAR) (pEntry->Aid); + AddbaReq.Wcid = (u8)(pEntry->Aid); AddbaReq.TID = pBAEntry->TID; AddbaReq.BaBufSize = pAd->CommonCfg.BACapability.field.RxBAWinLimit; AddbaReq.TimeOutValue = 0; AddbaReq.Token = pBAEntry->Token; MlmeEnqueue(pAd, ACTION_STATE_MACHINE, MT2_MLME_ADD_BA_CATE, - sizeof(MLME_ADDBA_REQ_STRUCT), (PVOID) & AddbaReq); + sizeof(MLME_ADDBA_REQ_STRUCT), (void *)& AddbaReq); RTMP_MLME_HANDLER(pAd); DBGPRINT(RT_DEBUG_TRACE, ("BA Ori Session Timeout(%d) : Send ADD BA again\n", @@ -1042,14 +1042,14 @@ VOID BAOriSessionSetupTimeout(IN PVOID SystemSpecific1, FALSE , then continue indicaterx at this moment. ========================================================================== */ -VOID BARecSessionIdleTimeout(IN PVOID SystemSpecific1, - IN PVOID FunctionContext, - IN PVOID SystemSpecific2, IN PVOID SystemSpecific3) +void BARecSessionIdleTimeout(void *SystemSpecific1, + void *FunctionContext, + void *SystemSpecific2, void *SystemSpecific3) { BA_REC_ENTRY *pBAEntry = (BA_REC_ENTRY *) FunctionContext; PRTMP_ADAPTER pAd; - ULONG Now32; + unsigned long Now32; if (pBAEntry == NULL) return; @@ -1070,19 +1070,19 @@ VOID BARecSessionIdleTimeout(IN PVOID SystemSpecific1, } } -VOID PeerAddBAReqAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) +void PeerAddBAReqAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) { /* 7.4.4.1 */ - /*ULONG Idx; */ - UCHAR Status = 1; - UCHAR pAddr[6]; + /*unsigned long Idx; */ + u8 Status = 1; + u8 pAddr[6]; FRAME_ADDBA_RSP ADDframe; - PUCHAR pOutBuffer = NULL; - NDIS_STATUS NStatus; + u8 *pOutBuffer = NULL; + int NStatus; PFRAME_ADDBA_REQ pAddreqFrame = NULL; - /*UCHAR BufSize; */ - ULONG FrameLen; - PULONG ptemp; + /*u8 BufSize; */ + unsigned long FrameLen; + unsigned long *ptemp; PMAC_TABLE_ENTRY pMacEntry; DBGPRINT(RT_DEBUG_TRACE, @@ -1096,7 +1096,7 @@ VOID PeerAddBAReqAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) pMacEntry = &pAd->MacTab.Content[Elem->Wcid]; DBGPRINT(RT_DEBUG_TRACE, ("BA - PeerAddBAReqAction----> \n")); - ptemp = (PULONG) Elem->Msg; + ptemp = (unsigned long *)Elem->Msg; /*DBGPRINT_RAW(RT_DEBUG_EMU, ("%08x:: %08x:: %08x:: %08x:: %08x:: %08x:: %08x:: %08x:: %08x\n", *(ptemp), *(ptemp+1), *(ptemp+2), *(ptemp+3), *(ptemp+4), *(ptemp+5), *(ptemp+6), *(ptemp+7), *(ptemp+8))); */ if (PeerAddBAReqActionSanity(pAd, Elem->Msg, Elem->MsgLen, pAddr)) { @@ -1151,15 +1151,15 @@ VOID PeerAddBAReqAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) ADDframe.BaParm.AMSDUSupported = 0; ADDframe.BaParm.TID = pAddreqFrame->BaParm.TID; ADDframe.BaParm.BufSize = - min(((UCHAR) pAddreqFrame->BaParm.BufSize), - (UCHAR) pAd->CommonCfg.BACapability.field.RxBAWinLimit); + min(((u8)pAddreqFrame->BaParm.BufSize), + (u8)pAd->CommonCfg.BACapability.field.RxBAWinLimit); if (ADDframe.BaParm.BufSize == 0) { ADDframe.BaParm.BufSize = 64; } ADDframe.TimeOutValue = 0; /*pAddreqFrame->TimeOutValue; */ - *(USHORT *) (&ADDframe.BaParm) = - cpu2le16(*(USHORT *) (&ADDframe.BaParm)); + *(u16 *) (&ADDframe.BaParm) = + cpu2le16(*(u16 *) (&ADDframe.BaParm)); ADDframe.StatusCode = cpu2le16(ADDframe.StatusCode); ADDframe.TimeOutValue = cpu2le16(ADDframe.TimeOutValue); @@ -1173,10 +1173,10 @@ VOID PeerAddBAReqAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) ADDframe.BaParm.TID, ADDframe.BaParm.BufSize)); } -VOID PeerAddBARspAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) +void PeerAddBARspAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) { - /*UCHAR Idx, i; */ - /*PUCHAR pOutBuffer = NULL; */ + /*u8 Idx, i; */ + /*u8 * pOutBuffer = NULL; */ PFRAME_ADDBA_RSP pFrame = NULL; /*PBA_ORI_ENTRY pBAEntry; */ @@ -1216,10 +1216,10 @@ VOID PeerAddBARspAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) } } -VOID PeerDelBAAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) +void PeerDelBAAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) { - /*UCHAR Idx; */ - /*PUCHAR pOutBuffer = NULL; */ + /*u8 Idx; */ + /*u8 * pOutBuffer = NULL; */ PFRAME_DELBA_REQ pDelFrame = NULL; DBGPRINT(RT_DEBUG_TRACE, ("%s ==>\n", __func__)); @@ -1244,23 +1244,23 @@ VOID PeerDelBAAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) } BOOLEAN CntlEnqueueForRecv(IN PRTMP_ADAPTER pAd, - IN ULONG Wcid, - IN ULONG MsgLen, IN PFRAME_BA_REQ pMsg) + unsigned long Wcid, + unsigned long MsgLen, IN PFRAME_BA_REQ pMsg) { PFRAME_BA_REQ pFrame = pMsg; /*PRTMP_REORDERBUF pBuffer; */ /*PRTMP_REORDERBUF pDmaBuf; */ PBA_REC_ENTRY pBAEntry; /*BOOLEAN Result; */ - ULONG Idx; - /*UCHAR NumRxPkt; */ - UCHAR TID; /*, i; */ + unsigned long Idx; + /*u8 NumRxPkt; */ + u8 TID; /*, i; */ - TID = (UCHAR) pFrame->BARControl.TID; + TID = (u8)pFrame->BARControl.TID; DBGPRINT(RT_DEBUG_TRACE, ("%s(): BAR-Wcid(%ld), Tid (%d)\n", __func__, Wcid, TID)); - /*hex_dump("BAR", (PCHAR) pFrame, MsgLen); */ + /*hex_dump("BAR", (char *)pFrame, MsgLen); */ /* Do nothing if the driver is starting halt state. */ /* This might happen when timer already been fired before cancel timer with mlmehalt */ if (RTMP_TEST_FLAG @@ -1309,13 +1309,13 @@ BOOLEAN CntlEnqueueForRecv(IN PRTMP_ADAPTER pAd, /* Description : Send PSMP Action frame If PSMP mode switches. */ -VOID SendPSMPAction(IN PRTMP_ADAPTER pAd, IN UCHAR Wcid, IN UCHAR Psmp) +void SendPSMPAction(IN PRTMP_ADAPTER pAd, u8 Wcid, u8 Psmp) { - PUCHAR pOutBuffer = NULL; - NDIS_STATUS NStatus; - /*ULONG Idx; */ + u8 *pOutBuffer = NULL; + int NStatus; + /*unsigned long Idx; */ FRAME_PSMP_ACTION Frame; - ULONG FrameLen; + unsigned long FrameLen; NStatus = MlmeAllocateMemory(pAd, &pOutBuffer); /*Get an unused nonpaged memory */ if (NStatus != NDIS_STATUS_SUCCESS) { @@ -1364,32 +1364,32 @@ VOID SendPSMPAction(IN PRTMP_ADAPTER pAd, IN UCHAR Wcid, IN UCHAR Psmp) #define RADIO_MEASUREMENT_REQUEST_ACTION 0 typedef struct PACKED { - UCHAR RegulatoryClass; - UCHAR ChannelNumber; - USHORT RandomInterval; - USHORT MeasurementDuration; - UCHAR MeasurementMode; - UCHAR BSSID[MAC_ADDR_LEN]; - UCHAR ReportingCondition; - UCHAR Threshold; - UCHAR SSIDIE[2]; /* 2 byte */ + u8 RegulatoryClass; + u8 ChannelNumber; + u16 RandomInterval; + u16 MeasurementDuration; + u8 MeasurementMode; + u8 BSSID[MAC_ADDR_LEN]; + u8 ReportingCondition; + u8 Threshold; + u8 SSIDIE[2]; /* 2 byte */ } BEACON_REQUEST; typedef struct PACKED { - UCHAR ID; - UCHAR Length; - UCHAR Token; - UCHAR RequestMode; - UCHAR Type; + u8 ID; + u8 Length; + u8 Token; + u8 RequestMode; + u8 Type; } MEASUREMENT_REQ; void convert_reordering_packet_to_preAMSDU_or_802_3_packet(IN PRTMP_ADAPTER pAd, IN RX_BLK * pRxBlk, - IN UCHAR + u8 FromWhichBSSID) { PNDIS_PACKET pRxPkt; - UCHAR Header802_3[LENGTH_802_3]; + u8 Header802_3[LENGTH_802_3]; /* 1. get 802.3 Header */ /* 2. remove LLC */ @@ -1436,13 +1436,13 @@ void convert_reordering_packet_to_preAMSDU_or_802_3_packet(IN PRTMP_ADAPTER pAd, } \ } while (0); -static VOID ba_enqueue_reordering_packet(IN PRTMP_ADAPTER pAd, +static void ba_enqueue_reordering_packet(IN PRTMP_ADAPTER pAd, IN PBA_REC_ENTRY pBAEntry, IN RX_BLK * pRxBlk, - IN UCHAR FromWhichBSSID) + u8 FromWhichBSSID) { struct reordering_mpdu *mpdu_blk; - UINT16 Sequence = (UINT16) pRxBlk->pHeader->Sequence; + u16 Sequence = (u16)pRxBlk->pHeader->Sequence; mpdu_blk = ba_mpdu_blk_alloc(pAd); if ((mpdu_blk != NULL) && (!RX_BLK_TEST_FLAG(pRxBlk, fRX_EAP))) { @@ -1515,15 +1515,15 @@ static VOID ba_enqueue_reordering_packet(IN PRTMP_ADAPTER pAd, ========================================================================== */ -VOID Indicate_AMPDU_Packet(IN PRTMP_ADAPTER pAd, - IN RX_BLK * pRxBlk, IN UCHAR FromWhichBSSID) +void Indicate_AMPDU_Packet(IN PRTMP_ADAPTER pAd, + IN RX_BLK * pRxBlk, u8 FromWhichBSSID) { - USHORT Idx; + u16 Idx; PBA_REC_ENTRY pBAEntry = NULL; - UINT16 Sequence = pRxBlk->pHeader->Sequence; - ULONG Now32; - UCHAR Wcid = pRxBlk->pRxWI->WirelessCliID; - UCHAR TID = pRxBlk->pRxWI->TID; + u16 Sequence = pRxBlk->pHeader->Sequence; + unsigned long Now32; + u8 Wcid = pRxBlk->pRxWI->WirelessCliID; + u8 TID = pRxBlk->pRxWI->TID; if (!RX_BLK_TEST_FLAG(pRxBlk, fRX_AMSDU) && (pRxBlk->DataSize > MAX_RX_PKT_LEN)) { @@ -1578,7 +1578,7 @@ VOID Indicate_AMPDU_Packet(IN PRTMP_ADAPTER pAd, /* I. Check if in order. */ /* */ if (SEQ_STEPONE(Sequence, pBAEntry->LastIndSeq, MAXSEQ)) { - USHORT LastIndSeq; + u16 LastIndSeq; pBAEntry->LastIndSeq = Sequence; INDICATE_LEGACY_OR_AMSDU(pAd, pRxBlk, FromWhichBSSID); @@ -1624,7 +1624,7 @@ VOID Indicate_AMPDU_Packet(IN PRTMP_ADAPTER pAd, /* V. Receive seq surpasses Win(lastseq + nMSDU). So refresh all reorder buffer */ /* */ else { - LONG WinStartSeq, TmpSeq; + long WinStartSeq, TmpSeq; TmpSeq = Sequence - (pBAEntry->BAWinSize) - 1; if (TmpSeq < 0) { diff --git a/drivers/staging/rt2860/common/cmm_aes.c b/drivers/staging/rt2860/common/cmm_aes.c index 030678caf34..99b0b1bff46 100644 --- a/drivers/staging/rt2860/common/cmm_aes.c +++ b/drivers/staging/rt2860/common/cmm_aes.c @@ -38,8 +38,8 @@ #include "../rt_config.h" typedef struct { - UINT32 erk[64]; /* encryption round keys */ - UINT32 drk[64]; /* decryption round keys */ + u32 erk[64]; /* encryption round keys */ + u32 drk[64]; /* decryption round keys */ int nr; /* number of rounds */ } aes_context; @@ -47,7 +47,7 @@ typedef struct { /******** SBOX Table *********/ /*****************************/ -UCHAR SboxTable[256] = { +u8 SboxTable[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, @@ -82,34 +82,34 @@ UCHAR SboxTable[256] = { 0x41, 0x99, 0x2d, 0x0f, 0xb0, 0x54, 0xbb, 0x16 }; -VOID xor_32(IN PUCHAR a, IN PUCHAR b, OUT PUCHAR out) +void xor_32(u8 *a, u8 *b, u8 *out) { - INT i; + int i; for (i = 0; i < 4; i++) { out[i] = a[i] ^ b[i]; } } -VOID xor_128(IN PUCHAR a, IN PUCHAR b, OUT PUCHAR out) +void xor_128(u8 *a, u8 *b, u8 *out) { - INT i; + int i; for (i = 0; i < 16; i++) { out[i] = a[i] ^ b[i]; } } -UCHAR RTMPCkipSbox(IN UCHAR a) +u8 RTMPCkipSbox(u8 a) { return SboxTable[(int)a]; } -VOID next_key(IN PUCHAR key, IN INT round) +void next_key(u8 *key, int round) { - UCHAR rcon; - UCHAR sbox_key[4]; - UCHAR rcon_table[12] = { + u8 rcon; + u8 sbox_key[4]; + u8 rcon_table[12] = { 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36, 0x36, 0x36 }; @@ -129,9 +129,9 @@ VOID next_key(IN PUCHAR key, IN INT round) xor_32(&key[12], &key[8], &key[12]); } -VOID byte_sub(IN PUCHAR in, OUT PUCHAR out) +void byte_sub(u8 *in, u8 *out) { - INT i; + int i; for (i = 0; i < 16; i++) { out[i] = RTMPCkipSbox(in[i]); @@ -151,7 +151,7 @@ void bitwise_xor(unsigned char *ina, unsigned char *inb, unsigned char *out) } } -VOID shift_row(IN PUCHAR in, OUT PUCHAR out) +void shift_row(u8 *in, u8 *out) { out[0] = in[0]; out[1] = in[5]; @@ -171,17 +171,17 @@ VOID shift_row(IN PUCHAR in, OUT PUCHAR out) out[15] = in[11]; } -VOID mix_column(IN PUCHAR in, OUT PUCHAR out) +void mix_column(u8 *in, u8 *out) { - INT i; - UCHAR add1b[4]; - UCHAR add1bf7[4]; - UCHAR rotl[4]; - UCHAR swap_halfs[4]; - UCHAR andf7[4]; - UCHAR rotr[4]; - UCHAR temp[4]; - UCHAR tempb[4]; + int i; + u8 add1b[4]; + u8 add1bf7[4]; + u8 rotl[4]; + u8 swap_halfs[4]; + u8 andf7[4]; + u8 rotr[4]; + u8 temp[4]; + u8 tempb[4]; for (i = 0; i < 4; i++) { if ((in[i] & 0x80) == 0x80) @@ -409,40 +409,40 @@ void construct_ctr_preload(unsigned char *ctr_preload, } BOOLEAN RTMPSoftDecryptAES(IN PRTMP_ADAPTER pAd, - IN PUCHAR pData, - IN ULONG DataByteCnt, IN PCIPHER_KEY pWpaKey) + u8 *pData, + unsigned long DataByteCnt, IN PCIPHER_KEY pWpaKey) { - UCHAR KeyID; - UINT HeaderLen; - UCHAR PN[6]; - UINT payload_len; - UINT num_blocks; - UINT payload_remainder; - USHORT fc; - UCHAR fc0; - UCHAR fc1; - UINT frame_type; - UINT frame_subtype; - UINT from_ds; - UINT to_ds; - INT a4_exists; - INT qc_exists; - UCHAR aes_out[16]; + u8 KeyID; + u32 HeaderLen; + u8 PN[6]; + u32 payload_len; + u32 num_blocks; + u32 payload_remainder; + u16 fc; + u8 fc0; + u8 fc1; + u32 frame_type; + u32 frame_subtype; + u32 from_ds; + u32 to_ds; + int a4_exists; + int qc_exists; + u8 aes_out[16]; int payload_index; - UINT i; - UCHAR ctr_preload[16]; - UCHAR chain_buffer[16]; - UCHAR padded_buffer[16]; - UCHAR mic_iv[16]; - UCHAR mic_header1[16]; - UCHAR mic_header2[16]; - UCHAR MIC[8]; - UCHAR TrailMIC[8]; + u32 i; + u8 ctr_preload[16]; + u8 chain_buffer[16]; + u8 padded_buffer[16]; + u8 mic_iv[16]; + u8 mic_header1[16]; + u8 mic_header2[16]; + u8 MIC[8]; + u8 TrailMIC[8]; fc0 = *pData; fc1 = *(pData + 1); - fc = *((PUSHORT) pData); + fc = *((u16 *)pData); frame_type = ((fc0 >> 2) & 0x03); frame_subtype = ((fc0 >> 4) & 0x0f); @@ -460,7 +460,7 @@ BOOLEAN RTMPSoftDecryptAES(IN PRTMP_ADAPTER pAd, if (a4_exists) HeaderLen += 6; - KeyID = *((PUCHAR) (pData + HeaderLen + 3)); + KeyID = *((u8 *)(pData + HeaderLen + 3)); KeyID = KeyID >> 6; if (pWpaKey[KeyID].KeyLen == 0) { @@ -1202,16 +1202,16 @@ void rt_aes_decrypt(aes_context * ctx, uint8 input[16], uint8 output[16]) Return: ========================================================================== */ -VOID AES_GTK_KEY_WRAP(IN UCHAR * key, - IN UCHAR * plaintext, - IN UINT32 p_len, OUT UCHAR * ciphertext) +void AES_GTK_KEY_WRAP(u8 * key, + u8 * plaintext, + u32 p_len, u8 * ciphertext) { - UCHAR A[8], BIN[16], BOUT[16]; - UCHAR R[512]; - INT num_blocks = p_len / 8; /* unit:64bits */ - INT i, j; + u8 A[8], BIN[16], BOUT[16]; + u8 R[512]; + int num_blocks = p_len / 8; /* unit:64bits */ + int i, j; aes_context aesctx; - UCHAR xor; + u8 xor; rt_aes_set_key(&aesctx, key, 128); @@ -1264,18 +1264,18 @@ VOID AES_GTK_KEY_WRAP(IN UCHAR * key, ======================================================================== */ -VOID AES_GTK_KEY_UNWRAP(IN UCHAR * key, - OUT UCHAR * plaintext, - IN UINT32 c_len, IN UCHAR * ciphertext) +void AES_GTK_KEY_UNWRAP(u8 * key, + u8 * plaintext, + u32 c_len, u8 * ciphertext) { - UCHAR A[8], BIN[16], BOUT[16]; - UCHAR xor; - INT i, j; + u8 A[8], BIN[16], BOUT[16]; + u8 xor; + int i, j; aes_context aesctx; - UCHAR *R; - INT num_blocks = c_len / 8; /* unit:64bits */ + u8 *R; + int num_blocks = c_len / 8; /* unit:64bits */ - os_alloc_mem(NULL, (PUCHAR *) & R, 512); + os_alloc_mem(NULL, (u8 **) & R, 512); if (R == NULL) { DBGPRINT(RT_DEBUG_ERROR, diff --git a/drivers/staging/rt2860/common/cmm_asic.c b/drivers/staging/rt2860/common/cmm_asic.c index 468aba574f4..ef7d2a6c58d 100644 --- a/drivers/staging/rt2860/common/cmm_asic.c +++ b/drivers/staging/rt2860/common/cmm_asic.c @@ -177,7 +177,7 @@ RTMP_RF_REGS RF2850RegTable[] = { /* still lack of MMAC(Japan) ch 34,38,42,46 */ }; -UCHAR NUM_OF_2850_CHNL = (sizeof(RF2850RegTable) / sizeof(RTMP_RF_REGS)); +u8 NUM_OF_2850_CHNL = (sizeof(RF2850RegTable) / sizeof(RTMP_RF_REGS)); FREQUENCY_ITEM FreqItems3020[] = { /**************************************************/ @@ -216,11 +216,11 @@ FREQUENCY_ITEM FreqItems3020[] = { , }; -UCHAR NUM_OF_3020_CHNL = (sizeof(FreqItems3020) / sizeof(FREQUENCY_ITEM)); +u8 NUM_OF_3020_CHNL = (sizeof(FreqItems3020) / sizeof(FREQUENCY_ITEM)); -VOID AsicUpdateAutoFallBackTable(IN PRTMP_ADAPTER pAd, IN PUCHAR pRateTable) +void AsicUpdateAutoFallBackTable(IN PRTMP_ADAPTER pAd, u8 *pRateTable) { - UCHAR i; + u8 i; HT_FBK_CFG0_STRUC HtCfg0; HT_FBK_CFG1_STRUC HtCfg1; LG_FBK_CFG0_STRUC LgCfg0; @@ -234,7 +234,7 @@ VOID AsicUpdateAutoFallBackTable(IN PRTMP_ADAPTER pAd, IN PUCHAR pRateTable) LgCfg1.word = 0x00002100; pNextTxRate = (PRTMP_TX_RATE_SWITCH) pRateTable + 1; - for (i = 1; i < *((PUCHAR) pRateTable); i++) { + for (i = 1; i < *((u8 *)pRateTable); i++) { pCurrTxRate = (PRTMP_TX_RATE_SWITCH) pRateTable + 1 + i; switch (pCurrTxRate->Mode) { case 0: /*CCK */ @@ -417,16 +417,16 @@ VOID AsicUpdateAutoFallBackTable(IN PRTMP_ADAPTER pAd, IN PUCHAR pRateTable) we should choose not to use GF. But still set correct ASIC registers. ======================================================================== */ -VOID AsicUpdateProtect(IN PRTMP_ADAPTER pAd, - IN USHORT OperationMode, - IN UCHAR SetMask, +void AsicUpdateProtect(IN PRTMP_ADAPTER pAd, + u16 OperationMode, + u8 SetMask, IN BOOLEAN bDisableBGProtect, IN BOOLEAN bNonGFExist) { PROT_CFG_STRUC ProtCfg, ProtCfg4; - UINT32 Protect[6]; - USHORT offset; - UCHAR i; - UINT32 MacReg = 0; + u32 Protect[6]; + u16 offset; + u8 i; + u32 MacReg = 0; if (!(pAd->CommonCfg.bHTProtect) && (OperationMode != 8)) { return; @@ -631,14 +631,14 @@ VOID AsicUpdateProtect(IN PRTMP_ADAPTER pAd, ========================================================================== */ -VOID AsicSwitchChannel(IN PRTMP_ADAPTER pAd, IN UCHAR Channel, IN BOOLEAN bScan) +void AsicSwitchChannel(IN PRTMP_ADAPTER pAd, u8 Channel, IN BOOLEAN bScan) { - ULONG R2 = 0, R3 = DEFAULT_RF_TX_POWER, R4 = 0; - CHAR TxPwer = 0, TxPwer2 = DEFAULT_RF_TX_POWER; /*Bbp94 = BBPR94_DEFAULT, TxPwer2 = DEFAULT_RF_TX_POWER; */ - UCHAR index; - UINT32 Value = 0; /*BbpReg, Value; */ + unsigned long R2 = 0, R3 = DEFAULT_RF_TX_POWER, R4 = 0; + char TxPwer = 0, TxPwer2 = DEFAULT_RF_TX_POWER; /*Bbp94 = BBPR94_DEFAULT, TxPwer2 = DEFAULT_RF_TX_POWER; */ + u8 index; + u32 Value = 0; /*BbpReg, Value; */ RTMP_RF_REGS *RFRegTable; - UCHAR RFValue; + u8 RFValue; RFValue = 0; /* Search Tx power value */ @@ -891,7 +891,7 @@ VOID AsicSwitchChannel(IN PRTMP_ADAPTER pAd, IN UCHAR Channel, IN BOOLEAN bScan) /* Change BBP setting during siwtch from a->g, g->a */ if (Channel <= 14) { - ULONG TxPinCfg = 0x00050F0A; /*Gary 2007/08/09 0x050A0A */ + unsigned long TxPinCfg = 0x00050F0A; /*Gary 2007/08/09 0x050A0A */ RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R62, (0x37 - GET_LNA_GAIN(pAd))); @@ -951,7 +951,7 @@ VOID AsicSwitchChannel(IN PRTMP_ADAPTER pAd, IN UCHAR Channel, IN BOOLEAN bScan) } #endif } else { - ULONG TxPinCfg = 0x00050F05; /*Gary 2007/8/9 0x050505 */ + unsigned long TxPinCfg = 0x00050F05; /*Gary 2007/8/9 0x050505 */ RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R62, (0x37 - GET_LNA_GAIN(pAd))); @@ -1002,7 +1002,7 @@ VOID AsicSwitchChannel(IN PRTMP_ADAPTER pAd, IN UCHAR Channel, IN BOOLEAN bScan) RTMPusecDelay(1000); } -VOID AsicResetBBPAgent(IN PRTMP_ADAPTER pAd) +void AsicResetBBPAgent(IN PRTMP_ADAPTER pAd) { BBP_CSR_CFG_STRUC BbpCsr; DBGPRINT(RT_DEBUG_ERROR, ("Reset BBP Agent busy bit.!! \n")); @@ -1025,13 +1025,13 @@ VOID AsicResetBBPAgent(IN PRTMP_ADAPTER pAd) ========================================================================== */ -VOID AsicLockChannel(IN PRTMP_ADAPTER pAd, IN UCHAR Channel) +void AsicLockChannel(IN PRTMP_ADAPTER pAd, u8 Channel) { } -VOID AsicRfTuningExec(IN PVOID SystemSpecific1, - IN PVOID FunctionContext, - IN PVOID SystemSpecific2, IN PVOID SystemSpecific3) +void AsicRfTuningExec(void *SystemSpecific1, + void *FunctionContext, + void *SystemSpecific2, void *SystemSpecific3) { } @@ -1052,17 +1052,17 @@ VOID AsicRfTuningExec(IN PVOID SystemSpecific1, it should be called AFTER MlmeDynamicTxRatSwitching() ========================================================================== */ -VOID AsicAdjustTxPower(IN PRTMP_ADAPTER pAd) +void AsicAdjustTxPower(IN PRTMP_ADAPTER pAd) { - INT i, j; - CHAR DeltaPwr = 0; + int i, j; + char DeltaPwr = 0; BOOLEAN bAutoTxAgc = FALSE; - UCHAR TssiRef, *pTssiMinusBoundary, *pTssiPlusBoundary, TxAgcStep; - UCHAR BbpR1 = 0, BbpR49 = 0, idx; - PCHAR pTxAgcCompensate; - ULONG TxPwr[5]; - CHAR Value; - CHAR Rssi = -127; + u8 TssiRef, *pTssiMinusBoundary, *pTssiPlusBoundary, TxAgcStep; + u8 BbpR1 = 0, BbpR49 = 0, idx; + char *pTxAgcCompensate; + unsigned long TxPwr[5]; + char Value; + char Rssi = -127; if (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_DOZE) || #ifdef RTMP_MAC_PCI @@ -1152,10 +1152,10 @@ VOID AsicAdjustTxPower(IN PRTMP_ADAPTER pAd) break; } /* The index is the step we should decrease, idx = 0 means there is nothing to compensate */ -/* if (R3 > (ULONG) (TxAgcStep * (idx-1))) */ +/* if (R3 > (unsigned long)(TxAgcStep * (idx-1))) */ *pTxAgcCompensate = -(TxAgcStep * (idx - 1)); /* else */ -/* *pTxAgcCompensate = -((UCHAR)R3); */ +/* *pTxAgcCompensate = -((u8)R3); */ DeltaPwr += (*pTxAgcCompensate); DBGPRINT(RT_DEBUG_TRACE, @@ -1236,7 +1236,7 @@ VOID AsicAdjustTxPower(IN PRTMP_ADAPTER pAd) for (i = 0; i < 5; i++) { if (TxPwr[i] != 0xffffffff) { for (j = 0; j < 8; j++) { - Value = (CHAR) ((TxPwr[i] >> j * 4) & 0x0F); /* 0 ~ 15 */ + Value = (char)((TxPwr[i] >> j * 4) & 0x0F); /* 0 ~ 15 */ if ((Value + DeltaPwr) < 0) { Value = 0; /* min */ @@ -1277,8 +1277,8 @@ VOID AsicAdjustTxPower(IN PRTMP_ADAPTER pAd) ========================================================================== */ -VOID AsicSleepThenAutoWakeup(IN PRTMP_ADAPTER pAd, - IN USHORT TbttNumToNextWakeUp) +void AsicSleepThenAutoWakeup(IN PRTMP_ADAPTER pAd, + u16 TbttNumToNextWakeUp) { RTMP_STA_SLEEP_THEN_AUTO_WAKEUP(pAd, TbttNumToNextWakeUp); } @@ -1291,7 +1291,7 @@ VOID AsicSleepThenAutoWakeup(IN PRTMP_ADAPTER pAd, in INFRA BSS, we should use AsicSleepThenAutoWakeup() instead. ========================================================================== */ -VOID AsicForceSleep(IN PRTMP_ADAPTER pAd) +void AsicForceSleep(IN PRTMP_ADAPTER pAd) { } @@ -1306,7 +1306,7 @@ VOID AsicForceSleep(IN PRTMP_ADAPTER pAd) IRQL = DISPATCH_LEVEL ========================================================================== */ -VOID AsicForceWakeup(IN PRTMP_ADAPTER pAd, IN BOOLEAN bFromTx) +void AsicForceWakeup(IN PRTMP_ADAPTER pAd, IN BOOLEAN bFromTx) { DBGPRINT(RT_DEBUG_INFO, ("--> AsicForceWakeup \n")); RTMP_STA_FORCE_WAKEUP(pAd, bFromTx); @@ -1321,29 +1321,29 @@ VOID AsicForceWakeup(IN PRTMP_ADAPTER pAd, IN BOOLEAN bFromTx) ========================================================================== */ -VOID AsicSetBssid(IN PRTMP_ADAPTER pAd, IN PUCHAR pBssid) +void AsicSetBssid(IN PRTMP_ADAPTER pAd, u8 *pBssid) { - ULONG Addr4; + unsigned long Addr4; DBGPRINT(RT_DEBUG_TRACE, ("==============> AsicSetBssid %x:%x:%x:%x:%x:%x\n", pBssid[0], pBssid[1], pBssid[2], pBssid[3], pBssid[4], pBssid[5])); - Addr4 = (ULONG) (pBssid[0]) | - (ULONG) (pBssid[1] << 8) | - (ULONG) (pBssid[2] << 16) | (ULONG) (pBssid[3] << 24); + Addr4 = (unsigned long)(pBssid[0]) | + (unsigned long)(pBssid[1] << 8) | + (unsigned long)(pBssid[2] << 16) | (unsigned long)(pBssid[3] << 24); RTMP_IO_WRITE32(pAd, MAC_BSSID_DW0, Addr4); Addr4 = 0; /* always one BSSID in STA mode */ - Addr4 = (ULONG) (pBssid[4]) | (ULONG) (pBssid[5] << 8); + Addr4 = (unsigned long)(pBssid[4]) | (unsigned long)(pBssid[5] << 8); RTMP_IO_WRITE32(pAd, MAC_BSSID_DW1, Addr4); } -VOID AsicSetMcastWC(IN PRTMP_ADAPTER pAd) +void AsicSetMcastWC(IN PRTMP_ADAPTER pAd) { MAC_TABLE_ENTRY *pEntry = &pAd->MacTab.Content[MCAST_WCID]; - USHORT offset; + u16 offset; pEntry->Sst = SST_ASSOC; pEntry->Aid = MCAST_WCID; /* Softap supports 1 BSSID and use WCID=0 as multicast Wcid index */ @@ -1360,10 +1360,10 @@ VOID AsicSetMcastWC(IN PRTMP_ADAPTER pAd) ========================================================================== */ -VOID AsicDelWcidTab(IN PRTMP_ADAPTER pAd, IN UCHAR Wcid) +void AsicDelWcidTab(IN PRTMP_ADAPTER pAd, u8 Wcid) { - ULONG Addr0 = 0x0, Addr1 = 0x0; - ULONG offset; + unsigned long Addr0 = 0x0, Addr1 = 0x0; + unsigned long offset; DBGPRINT(RT_DEBUG_TRACE, ("AsicDelWcidTab==>Wcid = 0x%x\n", Wcid)); offset = MAC_WCID_BASE + Wcid * HW_WCID_ENTRY_SIZE; @@ -1380,10 +1380,10 @@ VOID AsicDelWcidTab(IN PRTMP_ADAPTER pAd, IN UCHAR Wcid) ========================================================================== */ -VOID AsicEnableRDG(IN PRTMP_ADAPTER pAd) +void AsicEnableRDG(IN PRTMP_ADAPTER pAd) { TX_LINK_CFG_STRUC TxLinkCfg; - UINT32 Data = 0; + u32 Data = 0; RTMP_IO_READ32(pAd, TX_LINK_CFG, &TxLinkCfg.word); TxLinkCfg.field.TxRDGEn = 1; @@ -1405,10 +1405,10 @@ VOID AsicEnableRDG(IN PRTMP_ADAPTER pAd) ========================================================================== */ -VOID AsicDisableRDG(IN PRTMP_ADAPTER pAd) +void AsicDisableRDG(IN PRTMP_ADAPTER pAd) { TX_LINK_CFG_STRUC TxLinkCfg; - UINT32 Data = 0; + u32 Data = 0; RTMP_IO_READ32(pAd, TX_LINK_CFG, &TxLinkCfg.word); TxLinkCfg.field.TxRDGEn = 0; @@ -1441,7 +1441,7 @@ VOID AsicDisableRDG(IN PRTMP_ADAPTER pAd) ========================================================================== */ -VOID AsicDisableSync(IN PRTMP_ADAPTER pAd) +void AsicDisableSync(IN PRTMP_ADAPTER pAd) { BCN_TIME_CFG_STRUC csr; @@ -1468,7 +1468,7 @@ VOID AsicDisableSync(IN PRTMP_ADAPTER pAd) ========================================================================== */ -VOID AsicEnableBssSync(IN PRTMP_ADAPTER pAd) +void AsicEnableBssSync(IN PRTMP_ADAPTER pAd) { BCN_TIME_CFG_STRUC csr; @@ -1498,11 +1498,11 @@ VOID AsicEnableBssSync(IN PRTMP_ADAPTER pAd) ========================================================================== */ -VOID AsicEnableIbssSync(IN PRTMP_ADAPTER pAd) +void AsicEnableIbssSync(IN PRTMP_ADAPTER pAd) { BCN_TIME_CFG_STRUC csr9; - PUCHAR ptr; - UINT i; + u8 *ptr; + u32 i; DBGPRINT(RT_DEBUG_TRACE, ("--->AsicEnableIbssSync(ADHOC mode. MPDUtotalByteCount = %d)\n", @@ -1516,10 +1516,10 @@ VOID AsicEnableIbssSync(IN PRTMP_ADAPTER pAd) #ifdef RTMP_MAC_PCI /* move BEACON TXD and frame content to on-chip memory */ - ptr = (PUCHAR) & pAd->BeaconTxWI; + ptr = (u8 *)& pAd->BeaconTxWI; for (i = 0; i < TXWI_SIZE; i += 4) /* 16-byte TXWI field */ { - UINT32 longptr = + u32 longptr = *ptr + (*(ptr + 1) << 8) + (*(ptr + 2) << 16) + (*(ptr + 3) << 24); RTMP_IO_WRITE32(pAd, HW_BEACON_BASE0 + i, longptr); @@ -1529,7 +1529,7 @@ VOID AsicEnableIbssSync(IN PRTMP_ADAPTER pAd) /* start right after the 16-byte TXWI field */ ptr = pAd->BeaconBuf; for (i = 0; i < pAd->BeaconTxWI.MPDUtotalByteCount; i += 4) { - UINT32 longptr = + u32 longptr = *ptr + (*(ptr + 1) << 8) + (*(ptr + 2) << 16) + (*(ptr + 3) << 24); RTMP_IO_WRITE32(pAd, HW_BEACON_BASE0 + TXWI_SIZE + i, longptr); @@ -1538,10 +1538,10 @@ VOID AsicEnableIbssSync(IN PRTMP_ADAPTER pAd) #endif /* RTMP_MAC_PCI // */ #ifdef RTMP_MAC_USB /* move BEACON TXD and frame content to on-chip memory */ - ptr = (PUCHAR) & pAd->BeaconTxWI; + ptr = (u8 *)& pAd->BeaconTxWI; for (i = 0; i < TXWI_SIZE; i += 2) /* 16-byte TXWI field */ { - /*UINT32 longptr = *ptr + (*(ptr+1)<<8) + (*(ptr+2)<<16) + (*(ptr+3)<<24); */ + /*u32 longptr = *ptr + (*(ptr+1)<<8) + (*(ptr+2)<<16) + (*(ptr+3)<<24); */ /*RTMP_IO_WRITE32(pAd, HW_BEACON_BASE0 + i, longptr); */ RTUSBMultiWrite(pAd, HW_BEACON_BASE0 + i, ptr, 2); ptr += 2; @@ -1550,7 +1550,7 @@ VOID AsicEnableIbssSync(IN PRTMP_ADAPTER pAd) /* start right after the 16-byte TXWI field */ ptr = pAd->BeaconBuf; for (i = 0; i < pAd->BeaconTxWI.MPDUtotalByteCount; i += 2) { - /*UINT32 longptr = *ptr + (*(ptr+1)<<8) + (*(ptr+2)<<16) + (*(ptr+3)<<24); */ + /*u32 longptr = *ptr + (*(ptr+1)<<8) + (*(ptr+2)<<16) + (*(ptr+3)<<24); */ /*RTMP_IO_WRITE32(pAd, HW_BEACON_BASE0 + TXWI_SIZE + i, longptr); */ RTUSBMultiWrite(pAd, HW_BEACON_BASE0 + TXWI_SIZE + i, ptr, 2); ptr += 2; @@ -1581,7 +1581,7 @@ VOID AsicEnableIbssSync(IN PRTMP_ADAPTER pAd) ========================================================================== */ -VOID AsicSetEdcaParm(IN PRTMP_ADAPTER pAd, IN PEDCA_PARM pEdcaParm) +void AsicSetEdcaParm(IN PRTMP_ADAPTER pAd, IN PEDCA_PARM pEdcaParm) { EDCA_AC_CFG_STRUC Ac0Cfg, Ac1Cfg, Ac2Cfg, Ac3Cfg; AC_TXOP_CSR0_STRUC csr0; @@ -1862,10 +1862,10 @@ VOID AsicSetEdcaParm(IN PRTMP_ADAPTER pAd, IN PEDCA_PARM pEdcaParm) ========================================================================== */ -VOID AsicSetSlotTime(IN PRTMP_ADAPTER pAd, IN BOOLEAN bUseShortSlotTime) +void AsicSetSlotTime(IN PRTMP_ADAPTER pAd, IN BOOLEAN bUseShortSlotTime) { - ULONG SlotTime; - UINT32 RegValue = 0; + unsigned long SlotTime; + u32 RegValue = 0; if (pAd->CommonCfg.Channel > 14) bUseShortSlotTime = TRUE; @@ -1930,16 +1930,16 @@ VOID AsicSetSlotTime(IN PRTMP_ADAPTER pAd, IN BOOLEAN bUseShortSlotTime) Return: ======================================================================== */ -VOID AsicAddSharedKeyEntry(IN PRTMP_ADAPTER pAd, - IN UCHAR BssIndex, - IN UCHAR KeyIdx, - IN UCHAR CipherAlg, - IN PUCHAR pKey, IN PUCHAR pTxMic, IN PUCHAR pRxMic) +void AsicAddSharedKeyEntry(IN PRTMP_ADAPTER pAd, + u8 BssIndex, + u8 KeyIdx, + u8 CipherAlg, + u8 *pKey, u8 *pTxMic, u8 *pRxMic) { - ULONG offset; /*, csr0; */ + unsigned long offset; /*, csr0; */ SHAREDKEY_MODE_STRUC csr1; #ifdef RTMP_MAC_PCI - INT i; + int i; #endif /* RTMP_MAC_PCI // */ DBGPRINT(RT_DEBUG_TRACE, @@ -2048,10 +2048,10 @@ VOID AsicAddSharedKeyEntry(IN PRTMP_ADAPTER pAd, } /* IRQL = DISPATCH_LEVEL */ -VOID AsicRemoveSharedKeyEntry(IN PRTMP_ADAPTER pAd, - IN UCHAR BssIndex, IN UCHAR KeyIdx) +void AsicRemoveSharedKeyEntry(IN PRTMP_ADAPTER pAd, + u8 BssIndex, u8 KeyIdx) { - /*ULONG SecCsr0; */ + /*unsigned long SecCsr0; */ SHAREDKEY_MODE_STRUC csr1; DBGPRINT(RT_DEBUG_TRACE, @@ -2088,13 +2088,13 @@ VOID AsicRemoveSharedKeyEntry(IN PRTMP_ADAPTER pAd, } -VOID AsicUpdateWCIDAttribute(IN PRTMP_ADAPTER pAd, - IN USHORT WCID, - IN UCHAR BssIndex, - IN UCHAR CipherAlg, +void AsicUpdateWCIDAttribute(IN PRTMP_ADAPTER pAd, + u16 WCID, + u8 BssIndex, + u8 CipherAlg, IN BOOLEAN bUsePairewiseKeyTable) { - ULONG WCIDAttri = 0, offset; + unsigned long WCIDAttri = 0, offset; /* */ /* Update WCID attribute. */ @@ -2106,10 +2106,10 @@ VOID AsicUpdateWCIDAttribute(IN PRTMP_ADAPTER pAd, RTMP_IO_WRITE32(pAd, offset, WCIDAttri); } -VOID AsicUpdateWCIDIVEIV(IN PRTMP_ADAPTER pAd, - IN USHORT WCID, IN ULONG uIV, IN ULONG uEIV) +void AsicUpdateWCIDIVEIV(IN PRTMP_ADAPTER pAd, + u16 WCID, unsigned long uIV, unsigned long uEIV) { - ULONG offset; + unsigned long offset; offset = MAC_IVEIV_TABLE_BASE + (WCID * HW_IVEIV_ENTRY_SIZE); @@ -2117,11 +2117,11 @@ VOID AsicUpdateWCIDIVEIV(IN PRTMP_ADAPTER pAd, RTMP_IO_WRITE32(pAd, offset + 4, uEIV); } -VOID AsicUpdateRxWCIDTable(IN PRTMP_ADAPTER pAd, - IN USHORT WCID, IN PUCHAR pAddr) +void AsicUpdateRxWCIDTable(IN PRTMP_ADAPTER pAd, + u16 WCID, u8 *pAddr) { - ULONG offset; - ULONG Addr; + unsigned long offset; + unsigned long Addr; offset = MAC_WCID_BASE + (WCID * HW_WCID_ENTRY_SIZE); Addr = pAddr[0] + (pAddr[1] << 8) + (pAddr[2] << 16) + (pAddr[3] << 24); @@ -2163,25 +2163,25 @@ VOID AsicUpdateRxWCIDTable(IN PRTMP_ADAPTER pAd, For AP mode bTxKey must be always set to TRUE. ======================================================================== */ -VOID AsicAddKeyEntry(IN PRTMP_ADAPTER pAd, - IN USHORT WCID, - IN UCHAR BssIndex, - IN UCHAR KeyIdx, +void AsicAddKeyEntry(IN PRTMP_ADAPTER pAd, + u16 WCID, + u8 BssIndex, + u8 KeyIdx, IN PCIPHER_KEY pCipherKey, IN BOOLEAN bUsePairewiseKeyTable, IN BOOLEAN bTxKey) { - ULONG offset; -/* ULONG WCIDAttri = 0; */ - UCHAR IV4 = 0; - PUCHAR pKey = pCipherKey->Key; -/* ULONG KeyLen = pCipherKey->KeyLen; */ - PUCHAR pTxMic = pCipherKey->TxMic; - PUCHAR pRxMic = pCipherKey->RxMic; - PUCHAR pTxtsc = pCipherKey->TxTsc; - UCHAR CipherAlg = pCipherKey->CipherAlg; + unsigned long offset; +/* unsigned long WCIDAttri = 0; */ + u8 IV4 = 0; + u8 *pKey = pCipherKey->Key; +/* unsigned long KeyLen = pCipherKey->KeyLen; */ + u8 *pTxMic = pCipherKey->TxMic; + u8 *pRxMic = pCipherKey->RxMic; + u8 *pTxtsc = pCipherKey->TxTsc; + u8 CipherAlg = pCipherKey->CipherAlg; SHAREDKEY_MODE_STRUC csr1; #ifdef RTMP_MAC_PCI - UCHAR i; + u8 i; #endif /* RTMP_MAC_PCI // */ /* ASSERT(KeyLen <= MAX_LEN_OF_PEER_KEY); */ @@ -2271,7 +2271,7 @@ VOID AsicAddKeyEntry(IN PRTMP_ADAPTER pAd, } #endif /* RTMP_MAC_PCI // */ #ifdef RTMP_MAC_USB - UINT32 tmpVal; + u32 tmpVal; /* */ /* Write IV */ @@ -2291,7 +2291,7 @@ VOID AsicAddKeyEntry(IN PRTMP_ADAPTER pAd, /* Write EIV */ /* */ offset += 4; - RTMP_IO_WRITE32(pAd, offset, *(PUINT32) & pCipherKey->TxTsc[2]); + RTMP_IO_WRITE32(pAd, offset, *(u32 *)& pCipherKey->TxTsc[2]); #endif /* RTMP_MAC_USB // */ AsicUpdateWCIDAttribute(pAd, WCID, BssIndex, CipherAlg, @@ -2339,17 +2339,17 @@ VOID AsicAddKeyEntry(IN PRTMP_ADAPTER pAd, Return: ======================================================================== */ -VOID AsicAddPairwiseKeyEntry(IN PRTMP_ADAPTER pAd, - IN PUCHAR pAddr, - IN UCHAR WCID, IN CIPHER_KEY * pCipherKey) +void AsicAddPairwiseKeyEntry(IN PRTMP_ADAPTER pAd, + u8 *pAddr, + u8 WCID, IN CIPHER_KEY * pCipherKey) { - INT i; - ULONG offset; - PUCHAR pKey = pCipherKey->Key; - PUCHAR pTxMic = pCipherKey->TxMic; - PUCHAR pRxMic = pCipherKey->RxMic; + int i; + unsigned long offset; + u8 *pKey = pCipherKey->Key; + u8 *pTxMic = pCipherKey->TxMic; + u8 *pRxMic = pCipherKey->RxMic; #ifdef DBG - UCHAR CipherAlg = pCipherKey->CipherAlg; + u8 CipherAlg = pCipherKey->CipherAlg; #endif /* DBG // */ /* EKEY */ @@ -2363,7 +2363,7 @@ VOID AsicAddPairwiseKeyEntry(IN PRTMP_ADAPTER pAd, RTUSBMultiWrite(pAd, offset, &pCipherKey->Key[0], MAX_LEN_OF_PEER_KEY); #endif /* RTMP_MAC_USB // */ for (i = 0; i < MAX_LEN_OF_PEER_KEY; i += 4) { - UINT32 Value; + u32 Value; RTMP_IO_READ32(pAd, offset + i, &Value); } @@ -2422,11 +2422,11 @@ VOID AsicAddPairwiseKeyEntry(IN PRTMP_ADAPTER pAd, Return: ======================================================================== */ -VOID AsicRemovePairwiseKeyEntry(IN PRTMP_ADAPTER pAd, - IN UCHAR BssIdx, IN UCHAR Wcid) +void AsicRemovePairwiseKeyEntry(IN PRTMP_ADAPTER pAd, + u8 BssIdx, u8 Wcid) { - ULONG WCIDAttri; - USHORT offset; + unsigned long WCIDAttri; + u16 offset; /* re-set the entry's WCID attribute as OPEN-NONE. */ offset = MAC_WCID_ATTRIBUTE_BASE + (Wcid * HW_WCID_ATTRI_SIZE); @@ -2435,8 +2435,8 @@ VOID AsicRemovePairwiseKeyEntry(IN PRTMP_ADAPTER pAd, } BOOLEAN AsicSendCommandToMcu(IN PRTMP_ADAPTER pAd, - IN UCHAR Command, - IN UCHAR Token, IN UCHAR Arg0, IN UCHAR Arg1) + u8 Command, + u8 Token, u8 Arg0, u8 Arg1) { if (pAd->chipOps.sendCommandToMcu) @@ -2445,7 +2445,7 @@ BOOLEAN AsicSendCommandToMcu(IN PRTMP_ADAPTER pAd, return TRUE; } -VOID AsicSetRxAnt(IN PRTMP_ADAPTER pAd, IN UCHAR Ant) +void AsicSetRxAnt(IN PRTMP_ADAPTER pAd, u8 Ant) { #ifdef RT30xx /* RT3572 ATE need not to do this. */ @@ -2453,14 +2453,14 @@ VOID AsicSetRxAnt(IN PRTMP_ADAPTER pAd, IN UCHAR Ant) #endif /* RT30xx // */ } -VOID AsicTurnOffRFClk(IN PRTMP_ADAPTER pAd, IN UCHAR Channel) +void AsicTurnOffRFClk(IN PRTMP_ADAPTER pAd, u8 Channel) { if (pAd->chipOps.AsicRfTurnOff) { pAd->chipOps.AsicRfTurnOff(pAd); } else { /* RF R2 bit 18 = 0 */ - UINT32 R1 = 0, R2 = 0, R3 = 0; - UCHAR index; + u32 R1 = 0, R2 = 0, R3 = 0; + u8 index; RTMP_RF_REGS *RFRegTable; RFRegTable = RF2850RegTable; @@ -2507,11 +2507,11 @@ VOID AsicTurnOffRFClk(IN PRTMP_ADAPTER pAd, IN UCHAR Channel) } } -VOID AsicTurnOnRFClk(IN PRTMP_ADAPTER pAd, IN UCHAR Channel) +void AsicTurnOnRFClk(IN PRTMP_ADAPTER pAd, u8 Channel) { /* RF R2 bit 18 = 0 */ - UINT32 R1 = 0, R2 = 0, R3 = 0; - UCHAR index; + u32 R1 = 0, R2 = 0, R3 = 0; + u8 index; RTMP_RF_REGS *RFRegTable; #ifdef PCIE_PS_SUPPORT diff --git a/drivers/staging/rt2860/common/cmm_cfg.c b/drivers/staging/rt2860/common/cmm_cfg.c index 7dbcb2300a2..9c6b7cacb08 100644 --- a/drivers/staging/rt2860/common/cmm_cfg.c +++ b/drivers/staging/rt2860/common/cmm_cfg.c @@ -80,10 +80,10 @@ char *GetBW(int BW) TRUE if all parameters are OK, FALSE otherwise ========================================================================== */ -INT RT_CfgSetCountryRegion(IN PRTMP_ADAPTER pAd, IN PSTRING arg, IN INT band) +int RT_CfgSetCountryRegion(IN PRTMP_ADAPTER pAd, char *arg, int band) { - LONG region, regionMax; - UCHAR *pCountryRegion; + long region, regionMax; + u8 *pCountryRegion; region = simple_strtol(arg, 0, 10); @@ -104,9 +104,9 @@ INT RT_CfgSetCountryRegion(IN PRTMP_ADAPTER pAd, IN PSTRING arg, IN INT band) } if ((region >= 0) && (region <= REGION_MAXIMUM_BG_BAND)) { - *pCountryRegion = (UCHAR) region; + *pCountryRegion = (u8)region; } else if ((region == REGION_31_BG_BAND) && (band == BAND_24G)) { - *pCountryRegion = (UCHAR) region; + *pCountryRegion = (u8)region; } else { DBGPRINT(RT_DEBUG_ERROR, ("CfgSetCountryRegion():region(%ld) out of range!\n", @@ -126,10 +126,10 @@ INT RT_CfgSetCountryRegion(IN PRTMP_ADAPTER pAd, IN PSTRING arg, IN INT band) TRUE if all parameters are OK, FALSE otherwise ========================================================================== */ -INT RT_CfgSetWirelessMode(IN PRTMP_ADAPTER pAd, IN PSTRING arg) +int RT_CfgSetWirelessMode(IN PRTMP_ADAPTER pAd, char *arg) { - INT MaxPhyMode = PHY_11G; - LONG WirelessMode; + int MaxPhyMode = PHY_11G; + long WirelessMode; MaxPhyMode = PHY_11N_5G; @@ -143,9 +143,9 @@ INT RT_CfgSetWirelessMode(IN PRTMP_ADAPTER pAd, IN PSTRING arg) } -INT RT_CfgSetShortSlot(IN PRTMP_ADAPTER pAd, IN PSTRING arg) +int RT_CfgSetShortSlot(IN PRTMP_ADAPTER pAd, char *arg) { - LONG ShortSlot; + long ShortSlot; ShortSlot = simple_strtol(arg, 0, 10); @@ -167,13 +167,13 @@ INT RT_CfgSetShortSlot(IN PRTMP_ADAPTER pAd, IN PSTRING arg) TRUE if all parameters are OK, FALSE otherwise ========================================================================== */ -INT RT_CfgSetWepKey(IN PRTMP_ADAPTER pAd, - IN PSTRING keyString, - IN CIPHER_KEY * pSharedKey, IN INT keyIdx) +int RT_CfgSetWepKey(IN PRTMP_ADAPTER pAd, + char *keyString, + IN CIPHER_KEY * pSharedKey, int keyIdx) { - INT KeyLen; - INT i; - UCHAR CipherAlg = CIPHER_NONE; + int KeyLen; + int i; + u8 CipherAlg = CIPHER_NONE; BOOLEAN bKeyIsHex = FALSE; /* TODO: Shall we do memset for the original key info?? */ @@ -230,13 +230,13 @@ INT RT_CfgSetWepKey(IN PRTMP_ADAPTER pAd, TRUE if all parameters are OK, FALSE otherwise ========================================================================== */ -INT RT_CfgSetWPAPSKKey(IN RTMP_ADAPTER * pAd, - IN PSTRING keyString, - IN UCHAR * pHashStr, - IN INT hashStrLen, OUT PUCHAR pPMKBuf) +int RT_CfgSetWPAPSKKey(IN RTMP_ADAPTER * pAd, + char *keyString, + u8 * pHashStr, + int hashStrLen, u8 *pPMKBuf) { int keyLen; - UCHAR keyMaterial[40]; + u8 keyMaterial[40]; keyLen = strlen(keyString); if ((keyLen < 8) || (keyLen > 64)) { diff --git a/drivers/staging/rt2860/common/cmm_data.c b/drivers/staging/rt2860/common/cmm_data.c index 81766db533e..cd000fb2be9 100644 --- a/drivers/staging/rt2860/common/cmm_data.c +++ b/drivers/staging/rt2860/common/cmm_data.c @@ -27,39 +27,39 @@ #include "../rt_config.h" -UCHAR SNAP_802_1H[] = { 0xaa, 0xaa, 0x03, 0x00, 0x00, 0x00 }; -UCHAR SNAP_BRIDGE_TUNNEL[] = { 0xaa, 0xaa, 0x03, 0x00, 0x00, 0xf8 }; +u8 SNAP_802_1H[] = { 0xaa, 0xaa, 0x03, 0x00, 0x00, 0x00 }; +u8 SNAP_BRIDGE_TUNNEL[] = { 0xaa, 0xaa, 0x03, 0x00, 0x00, 0xf8 }; /* Add Cisco Aironet SNAP heade for CCX2 support */ -UCHAR SNAP_AIRONET[] = { 0xaa, 0xaa, 0x03, 0x00, 0x40, 0x96, 0x00, 0x00 }; -UCHAR CKIP_LLC_SNAP[] = { 0xaa, 0xaa, 0x03, 0x00, 0x40, 0x96, 0x00, 0x02 }; -UCHAR EAPOL_LLC_SNAP[] = { 0xaa, 0xaa, 0x03, 0x00, 0x00, 0x00, 0x88, 0x8e }; -UCHAR EAPOL[] = { 0x88, 0x8e }; -UCHAR TPID[] = { 0x81, 0x00 }; /* VLAN related */ +u8 SNAP_AIRONET[] = { 0xaa, 0xaa, 0x03, 0x00, 0x40, 0x96, 0x00, 0x00 }; +u8 CKIP_LLC_SNAP[] = { 0xaa, 0xaa, 0x03, 0x00, 0x40, 0x96, 0x00, 0x02 }; +u8 EAPOL_LLC_SNAP[] = { 0xaa, 0xaa, 0x03, 0x00, 0x00, 0x00, 0x88, 0x8e }; +u8 EAPOL[] = { 0x88, 0x8e }; +u8 TPID[] = { 0x81, 0x00 }; /* VLAN related */ -UCHAR IPX[] = { 0x81, 0x37 }; -UCHAR APPLE_TALK[] = { 0x80, 0xf3 }; +u8 IPX[] = { 0x81, 0x37 }; +u8 APPLE_TALK[] = { 0x80, 0xf3 }; -UCHAR RateIdToPlcpSignal[12] = { +u8 RateIdToPlcpSignal[12] = { 0, /* RATE_1 */ 1, /* RATE_2 */ 2, /* RATE_5_5 */ 3, /* RATE_11 *//* see BBP spec */ 11, /* RATE_6 */ 15, /* RATE_9 */ 10, /* RATE_12 */ 14, /* RATE_18 *//* see IEEE802.11a-1999 p.14 */ 9, /* RATE_24 */ 13, /* RATE_36 */ 8, /* RATE_48 */ 12 /* RATE_54 */ }; /* see IEEE802.11a-1999 p.14 */ -UCHAR OfdmSignalToRateId[16] = { +u8 OfdmSignalToRateId[16] = { RATE_54, RATE_54, RATE_54, RATE_54, /* OFDM PLCP Signal = 0, 1, 2, 3 respectively */ RATE_54, RATE_54, RATE_54, RATE_54, /* OFDM PLCP Signal = 4, 5, 6, 7 respectively */ RATE_48, RATE_24, RATE_12, RATE_6, /* OFDM PLCP Signal = 8, 9, 10, 11 respectively */ RATE_54, RATE_36, RATE_18, RATE_9, /* OFDM PLCP Signal = 12, 13, 14, 15 respectively */ }; -UCHAR OfdmRateToRxwiMCS[12] = { +u8 OfdmRateToRxwiMCS[12] = { 0, 0, 0, 0, 0, 1, 2, 3, /* OFDM rate 6,9,12,18 = rxwi mcs 0,1,2,3 */ 4, 5, 6, 7, /* OFDM rate 24,36,48,54 = rxwi mcs 4,5,6,7 */ }; -UCHAR RxwiMCSToOfdmRate[12] = { +u8 RxwiMCSToOfdmRate[12] = { RATE_6, RATE_9, RATE_12, RATE_18, RATE_24, RATE_36, RATE_48, RATE_54, /* OFDM rate 6,9,12,18 = rxwi mcs 0,1,2,3 */ 4, 5, 6, 7, /* OFDM rate 24,36,48,54 = rxwi mcs 4,5,6,7 */ @@ -71,12 +71,12 @@ char *MCSToMbps[] = "MM-4", "MM-5", "MM-6", "MM-7", "MM-8", "MM-9", "MM-10", "MM-11", "MM-12", "MM-13", "MM-14", "MM-15", "MM-32", "ee1", "ee2", "ee3" }; -UCHAR default_cwmin[] = +u8 default_cwmin[] = { CW_MIN_IN_BITS, CW_MIN_IN_BITS, CW_MIN_IN_BITS - 1, CW_MIN_IN_BITS - 2 }; -/*UCHAR default_cwmax[]={CW_MAX_IN_BITS, CW_MAX_IN_BITS, CW_MIN_IN_BITS, CW_MIN_IN_BITS-1}; */ -UCHAR default_sta_aifsn[] = { 3, 7, 2, 2 }; +/*u8 default_cwmax[]={CW_MAX_IN_BITS, CW_MAX_IN_BITS, CW_MIN_IN_BITS, CW_MIN_IN_BITS-1}; */ +u8 default_sta_aifsn[] = { 3, 7, 2, 2 }; -UCHAR MapUserPriorityToAccessCategory[8] = +u8 MapUserPriorityToAccessCategory[8] = { QID_AC_BE, QID_AC_BK, QID_AC_BK, QID_AC_BE, QID_AC_VI, QID_AC_VI, QID_AC_VO, QID_AC_VO }; @@ -104,16 +104,16 @@ QID_AC_VO, QID_AC_VO }; ======================================================================== */ -NDIS_STATUS MiniportMMRequest(IN PRTMP_ADAPTER pAd, - IN UCHAR QueIdx, IN PUCHAR pData, IN UINT Length) +int MiniportMMRequest(IN PRTMP_ADAPTER pAd, + u8 QueIdx, u8 *pData, u32 Length) { PNDIS_PACKET pPacket; - NDIS_STATUS Status = NDIS_STATUS_SUCCESS; - ULONG FreeNum; - UCHAR rtmpHwHdr[TXINFO_SIZE + TXWI_SIZE]; /*RTMP_HW_HDR_LEN]; */ + int Status = NDIS_STATUS_SUCCESS; + unsigned long FreeNum; + u8 rtmpHwHdr[TXINFO_SIZE + TXWI_SIZE]; /*RTMP_HW_HDR_LEN]; */ #ifdef RTMP_MAC_PCI unsigned long IrqFlags = 0; - UCHAR IrqState; + u8 IrqState; #endif /* RTMP_MAC_PCI // */ BOOLEAN bUseDataQ = FALSE; int retryCnt = 0; @@ -164,7 +164,7 @@ NDIS_STATUS MiniportMMRequest(IN PRTMP_ADAPTER pAd, NdisZeroMemory(&rtmpHwHdr, (TXINFO_SIZE + TXWI_SIZE)); Status = RTMPAllocateNdisPacket(pAd, &pPacket, - (PUCHAR) & rtmpHwHdr, + (u8 *)& rtmpHwHdr, (TXINFO_SIZE + TXWI_SIZE), pData, Length); if (Status != NDIS_STATUS_SUCCESS) { @@ -242,12 +242,12 @@ NDIS_STATUS MiniportMMRequest(IN PRTMP_ADAPTER pAd, ======================================================================== */ -NDIS_STATUS MlmeHardTransmit(IN PRTMP_ADAPTER pAd, - IN UCHAR QueIdx, IN PNDIS_PACKET pPacket) +int MlmeHardTransmit(IN PRTMP_ADAPTER pAd, + u8 QueIdx, IN PNDIS_PACKET pPacket) { PACKET_INFO PacketInfo; - PUCHAR pSrcBufVA; - UINT SrcBufLen; + u8 *pSrcBufVA; + u32 SrcBufLen; PHEADER_802_11 pHeader_802_11; if ((pAd->CommonCfg.RadarDetect.RDMode != RD_NORMAL_MODE) @@ -270,18 +270,18 @@ NDIS_STATUS MlmeHardTransmit(IN PRTMP_ADAPTER pAd, } -NDIS_STATUS MlmeHardTransmitMgmtRing(IN PRTMP_ADAPTER pAd, - IN UCHAR QueIdx, IN PNDIS_PACKET pPacket) +int MlmeHardTransmitMgmtRing(IN PRTMP_ADAPTER pAd, + u8 QueIdx, IN PNDIS_PACKET pPacket) { PACKET_INFO PacketInfo; - PUCHAR pSrcBufVA; - UINT SrcBufLen; + u8 *pSrcBufVA; + u32 SrcBufLen; PHEADER_802_11 pHeader_802_11; BOOLEAN bAckRequired, bInsertTimestamp; - UCHAR MlmeRate; + u8 MlmeRate; PTXWI_STRUC pFirstTxWI; MAC_TABLE_ENTRY *pMacEntry = NULL; - UCHAR PID; + u8 PID; RTMP_QueryPacketInfo(pPacket, &PacketInfo, &pSrcBufVA, &SrcBufLen); @@ -421,7 +421,7 @@ NDIS_STATUS MlmeHardTransmitMgmtRing(IN PRTMP_ADAPTER pAd, RTMPWriteTxWI(pAd, pFirstTxWI, FALSE, FALSE, bInsertTimestamp, FALSE, bAckRequired, FALSE, 0, RESERVED_WCID, (SrcBufLen - TXINFO_SIZE - TXWI_SIZE), PID, 0, - (UCHAR) pAd->CommonCfg.MlmeTransmit.field.MCS, + (u8)pAd->CommonCfg.MlmeTransmit.field.MCS, IFS_BACKOFF, FALSE, &pAd->CommonCfg.MlmeTransmit); } else { /* dont use low rate to send QoS Null data frame */ @@ -430,7 +430,7 @@ NDIS_STATUS MlmeHardTransmitMgmtRing(IN PRTMP_ADAPTER pAd, 0, pMacEntry->Aid, (SrcBufLen - TXINFO_SIZE - TXWI_SIZE), pMacEntry->MaxHTPhyMode.field.MCS, 0, - (UCHAR) pMacEntry->MaxHTPhyMode.field.MCS, + (u8)pMacEntry->MaxHTPhyMode.field.MCS, IFS_BACKOFF, FALSE, &pMacEntry->MaxHTPhyMode); } @@ -506,10 +506,10 @@ NDIS_STATUS MlmeHardTransmitMgmtRing(IN PRTMP_ADAPTER pAd, (2).Normal ======================================================================== */ -static UCHAR TxPktClassification(IN RTMP_ADAPTER * pAd, IN PNDIS_PACKET pPacket) +static u8 TxPktClassification(IN RTMP_ADAPTER * pAd, IN PNDIS_PACKET pPacket) { - UCHAR TxFrameType = TX_UNKOWN_FRAME; - UCHAR Wcid; + u8 TxFrameType = TX_UNKOWN_FRAME; + u8 Wcid; MAC_TABLE_ENTRY *pMacEntry = NULL; BOOLEAN bHTRate = FALSE; @@ -712,16 +712,16 @@ BOOLEAN CanDoAggregateTransmit(IN RTMP_ADAPTER * pAd, ======================================================================== */ -VOID RTMPDeQueuePacket(IN PRTMP_ADAPTER pAd, IN BOOLEAN bIntContext, IN UCHAR QIdx, /* BulkOutPipeId */ - IN UCHAR Max_Tx_Packets) +void RTMPDeQueuePacket(IN PRTMP_ADAPTER pAd, IN BOOLEAN bIntContext, u8 QIdx, /* BulkOutPipeId */ + u8 Max_Tx_Packets) { PQUEUE_ENTRY pEntry = NULL; PNDIS_PACKET pPacket; - NDIS_STATUS Status = NDIS_STATUS_SUCCESS; - UCHAR Count = 0; + int Status = NDIS_STATUS_SUCCESS; + u8 Count = 0; PQUEUE_HEADER pQueue; - ULONG FreeNumber[NUM_OF_TX_RING]; - UCHAR QueIdx, sQIdx, eQIdx; + unsigned long FreeNumber[NUM_OF_TX_RING]; + u8 QueIdx, sQIdx, eQIdx; unsigned long IrqFlags = 0; BOOLEAN hasTxDesc = FALSE; TX_BLK TxBlk; @@ -780,7 +780,7 @@ VOID RTMPDeQueuePacket(IN PRTMP_ADAPTER pAd, IN BOOLEAN bIntContext, IN UCHAR QI } pTxBlk = &TxBlk; - NdisZeroMemory((PUCHAR) pTxBlk, sizeof(TX_BLK)); + NdisZeroMemory((u8 *)pTxBlk, sizeof(TX_BLK)); /*InitializeQueueHeader(&pTxBlk->TxPacketList); // Didn't need it because we already memzero it. */ pTxBlk->QueIdx = QueIdx; @@ -908,9 +908,9 @@ VOID RTMPDeQueuePacket(IN PRTMP_ADAPTER pAd, IN BOOLEAN bIntContext, IN UCHAR QI ======================================================================== */ -USHORT RTMPCalcDuration(IN PRTMP_ADAPTER pAd, IN UCHAR Rate, IN ULONG Size) +u16 RTMPCalcDuration(IN PRTMP_ADAPTER pAd, u8 Rate, unsigned long Size) { - ULONG Duration = 0; + unsigned long Duration = 0; if (Rate < RATE_FIRST_OFDM_RATE) /* CCK */ { @@ -921,14 +921,14 @@ USHORT RTMPCalcDuration(IN PRTMP_ADAPTER pAd, IN UCHAR Rate, IN ULONG Size) else Duration = 192; /* 144+48 preamble+plcp */ - Duration += (USHORT) ((Size << 4) / RateIdTo500Kbps[Rate]); + Duration += (u16)((Size << 4) / RateIdTo500Kbps[Rate]); if ((Size << 4) % RateIdTo500Kbps[Rate]) Duration++; } else if (Rate <= RATE_LAST_OFDM_RATE) /* OFDM rates */ { Duration = 20 + 6; /* 16+4 preamble+plcp + Signal Extension */ Duration += - 4 * (USHORT) ((11 + Size * 4) / RateIdTo500Kbps[Rate]); + 4 * (u16)((11 + Size * 4) / RateIdTo500Kbps[Rate]); if ((11 + Size * 4) % RateIdTo500Kbps[Rate]) Duration += 4; } else /*mimo rate */ @@ -936,7 +936,7 @@ USHORT RTMPCalcDuration(IN PRTMP_ADAPTER pAd, IN UCHAR Rate, IN ULONG Size) Duration = 20 + 6; /* 16+4 preamble+plcp + Signal Extension */ } - return (USHORT) Duration; + return (u16)Duration; } /* @@ -968,14 +968,14 @@ USHORT RTMPCalcDuration(IN PRTMP_ADAPTER pAd, IN UCHAR Rate, IN ULONG Size) ======================================================================== */ -VOID RTMPWriteTxWI(IN PRTMP_ADAPTER pAd, IN PTXWI_STRUC pOutTxWI, IN BOOLEAN FRAG, IN BOOLEAN CFACK, IN BOOLEAN InsTimestamp, IN BOOLEAN AMPDU, IN BOOLEAN Ack, IN BOOLEAN NSeq, /* HW new a sequence. */ - IN UCHAR BASize, - IN UCHAR WCID, - IN ULONG Length, - IN UCHAR PID, - IN UCHAR TID, - IN UCHAR TxRate, - IN UCHAR Txopmode, +void RTMPWriteTxWI(IN PRTMP_ADAPTER pAd, IN PTXWI_STRUC pOutTxWI, IN BOOLEAN FRAG, IN BOOLEAN CFACK, IN BOOLEAN InsTimestamp, IN BOOLEAN AMPDU, IN BOOLEAN Ack, IN BOOLEAN NSeq, /* HW new a sequence. */ + u8 BASize, + u8 WCID, + unsigned long Length, + u8 PID, + u8 TID, + u8 TxRate, + u8 Txopmode, IN BOOLEAN CfAck, IN HTTRANSMIT_SETTING * pTransmit) { PMAC_TABLE_ENTRY pMac = NULL; @@ -1056,12 +1056,12 @@ VOID RTMPWriteTxWI(IN PRTMP_ADAPTER pAd, IN PTXWI_STRUC pOutTxWI, IN BOOLEAN FRA NdisMoveMemory(pOutTxWI, &TxWI, sizeof(TXWI_STRUC)); } -VOID RTMPWriteTxWI_Data(IN PRTMP_ADAPTER pAd, +void RTMPWriteTxWI_Data(IN PRTMP_ADAPTER pAd, IN OUT PTXWI_STRUC pTxWI, IN TX_BLK * pTxBlk) { HTTRANSMIT_SETTING *pTransmit; PMAC_TABLE_ENTRY pMacEntry; - UCHAR BASize; + u8 BASize; ASSERT(pTxWI); @@ -1093,7 +1093,7 @@ VOID RTMPWriteTxWI_Data(IN PRTMP_ADAPTER pAd, /* John tune the performace with Intel Client in 20 MHz performance */ BASize = pAd->CommonCfg.TxBASize; if ((pTxBlk->TxFrameType == TX_AMPDU_FRAME) && (pMacEntry)) { - UCHAR RABAOriIdx = 0; /*The RA's BA Originator table index. */ + u8 RABAOriIdx = 0; /*The RA's BA Originator table index. */ RABAOriIdx = pTxBlk->pMacEntry->BAOriWcidArray[pTxBlk->UserPriority]; @@ -1134,7 +1134,7 @@ VOID RTMPWriteTxWI_Data(IN PRTMP_ADAPTER pAd, pTxWI->PacketId = pTxWI->MCS; } -VOID RTMPWriteTxWI_Cache(IN PRTMP_ADAPTER pAd, +void RTMPWriteTxWI_Cache(IN PRTMP_ADAPTER pAd, IN OUT PTXWI_STRUC pTxWI, IN TX_BLK * pTxBlk) { PHTTRANSMIT_SETTING /*pTxHTPhyMode, */ pTransmit; @@ -1195,7 +1195,7 @@ VOID RTMPWriteTxWI_Cache(IN PRTMP_ADAPTER pAd, /* 3. Fragmentation not in used */ /* 4. either no previous frame (pPrevAddr1=NULL) .OR. previoud frame is aggregatible */ BOOLEAN TxFrameIsAggregatible(IN PRTMP_ADAPTER pAd, - IN PUCHAR pPrevAddr1, IN PUCHAR p8023hdr) + u8 *pPrevAddr1, u8 *p8023hdr) { /* can't aggregate EAPOL (802.1x) frame */ @@ -1231,9 +1231,9 @@ BOOLEAN TxFrameIsAggregatible(IN PRTMP_ADAPTER pAd, ======================================================================== */ BOOLEAN PeerIsAggreOn(IN PRTMP_ADAPTER pAd, - IN ULONG TxRate, IN PMAC_TABLE_ENTRY pMacEntry) + unsigned long TxRate, IN PMAC_TABLE_ENTRY pMacEntry) { - ULONG AFlags = + unsigned long AFlags = (fCLIENT_STATUS_AMSDU_INUSED | fCLIENT_STATUS_AGGREGATION_CAPABLE); if (pMacEntry != NULL && CLIENT_STATUS_TEST_FLAG(pMacEntry, AFlags)) { @@ -1269,10 +1269,10 @@ BOOLEAN PeerIsAggreOn(IN PRTMP_ADAPTER pAd, ======================================================================== */ -PQUEUE_HEADER RTMPCheckTxSwQueue(IN PRTMP_ADAPTER pAd, OUT PUCHAR pQueIdx) +PQUEUE_HEADER RTMPCheckTxSwQueue(IN PRTMP_ADAPTER pAd, u8 *pQueIdx) { - ULONG Number; + unsigned long Number; /* 2004-11-15 to be removed. test aggregation only */ /* if ((OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_AGGREGATION_INUSED)) && (*pNumber < 2)) */ /* return NULL; */ @@ -1317,7 +1317,7 @@ PQUEUE_HEADER RTMPCheckTxSwQueue(IN PRTMP_ADAPTER pAd, OUT PUCHAR pQueIdx) ======================================================================== */ -VOID RTMPSuspendMsduTransmission(IN PRTMP_ADAPTER pAd) +void RTMPSuspendMsduTransmission(IN PRTMP_ADAPTER pAd) { DBGPRINT(RT_DEBUG_TRACE, ("SCANNING, suspend MSDU transmission ...\n")); @@ -1354,9 +1354,9 @@ VOID RTMPSuspendMsduTransmission(IN PRTMP_ADAPTER pAd) ======================================================================== */ -VOID RTMPResumeMsduTransmission(IN PRTMP_ADAPTER pAd) +void RTMPResumeMsduTransmission(IN PRTMP_ADAPTER pAd) { -/* UCHAR IrqState; */ +/* u8 IrqState; */ DBGPRINT(RT_DEBUG_TRACE, ("SCAN done, resume MSDU transmission ...\n")); @@ -1379,17 +1379,17 @@ VOID RTMPResumeMsduTransmission(IN PRTMP_ADAPTER pAd) RTMPDeQueuePacket(pAd, FALSE, NUM_OF_TX_RING, MAX_TX_PROCESS); } -UINT deaggregate_AMSDU_announce(IN PRTMP_ADAPTER pAd, +u32 deaggregate_AMSDU_announce(IN PRTMP_ADAPTER pAd, PNDIS_PACKET pPacket, - IN PUCHAR pData, IN ULONG DataSize) + u8 *pData, unsigned long DataSize) { - USHORT PayloadSize; - USHORT SubFrameSize; + u16 PayloadSize; + u16 SubFrameSize; PHEADER_802_3 pAMSDUsubheader; - UINT nMSDU; - UCHAR Header802_3[14]; + u32 nMSDU; + u8 Header802_3[14]; - PUCHAR pPayload, pDA, pSA, pRemovedLLCSNAP; + u8 *pPayload, *pDA, *pSA, *pRemovedLLCSNAP; PNDIS_PACKET pClonePacket; nMSDU = 0; @@ -1479,14 +1479,14 @@ UINT deaggregate_AMSDU_announce(IN PRTMP_ADAPTER pAd, return nMSDU; } -UINT BA_Reorder_AMSDU_Annnounce(IN PRTMP_ADAPTER pAd, IN PNDIS_PACKET pPacket) +u32 BA_Reorder_AMSDU_Annnounce(IN PRTMP_ADAPTER pAd, IN PNDIS_PACKET pPacket) { - PUCHAR pData; - USHORT DataSize; - UINT nMSDU = 0; + u8 *pData; + u16 DataSize; + u32 nMSDU = 0; - pData = (PUCHAR) GET_OS_PKT_DATAPTR(pPacket); - DataSize = (USHORT) GET_OS_PKT_LEN(pPacket); + pData = (u8 *)GET_OS_PKT_DATAPTR(pPacket); + DataSize = (u16)GET_OS_PKT_LEN(pPacket); nMSDU = deaggregate_AMSDU_announce(pAd, pPacket, pData, DataSize); @@ -1501,9 +1501,9 @@ UINT BA_Reorder_AMSDU_Annnounce(IN PRTMP_ADAPTER pAd, IN PNDIS_PACKET pPacket) pEntry - pointer to the MAC entry; NULL is not found ========================================================================== */ -MAC_TABLE_ENTRY *MacTableLookup(IN PRTMP_ADAPTER pAd, PUCHAR pAddr) +MAC_TABLE_ENTRY *MacTableLookup(IN PRTMP_ADAPTER pAd, u8 *pAddr) { - ULONG HashIdx; + unsigned long HashIdx; MAC_TABLE_ENTRY *pEntry = NULL; HashIdx = MAC_ADDR_HASH_INDEX(pAddr); @@ -1522,14 +1522,14 @@ MAC_TABLE_ENTRY *MacTableLookup(IN PRTMP_ADAPTER pAd, PUCHAR pAddr) } MAC_TABLE_ENTRY *MacTableInsertEntry(IN PRTMP_ADAPTER pAd, - IN PUCHAR pAddr, - IN UCHAR apidx, IN BOOLEAN CleanAll) + u8 *pAddr, + u8 apidx, IN BOOLEAN CleanAll) { - UCHAR HashIdx; + u8 HashIdx; int i, FirstWcid; MAC_TABLE_ENTRY *pEntry = NULL, *pCurrEntry; -/* USHORT offset; */ -/* ULONG addr; */ +/* u16 offset; */ +/* unsigned long addr; */ /* if FULL, return */ if (pAd->MacTab.Size >= MAX_LEN_OF_MAC_TABLE) @@ -1601,7 +1601,7 @@ MAC_TABLE_ENTRY *MacTableInsertEntry(IN PRTMP_ADAPTER pAd, AsicRemovePairwiseKeyEntry(pAd, pEntry-> apidx, - (UCHAR) i); + (u8)i); #endif /* RTMP_MAC_PCI // */ } } @@ -1615,7 +1615,7 @@ MAC_TABLE_ENTRY *MacTableInsertEntry(IN PRTMP_ADAPTER pAd, COPY_MAC_ADDR(pEntry->Addr, pAddr); pEntry->Sst = SST_NOT_AUTH; pEntry->AuthState = AS_NOT_AUTH; - pEntry->Aid = (USHORT) i; /*0; */ + pEntry->Aid = (u16)i; /*0; */ pEntry->CapabilityInfo = 0; pEntry->PsMode = PWR_ACTIVE; pEntry->PsQIdleCount = 0; @@ -1659,13 +1659,13 @@ MAC_TABLE_ENTRY *MacTableInsertEntry(IN PRTMP_ADAPTER pAd, ========================================================================== */ BOOLEAN MacTableDeleteEntry(IN PRTMP_ADAPTER pAd, - IN USHORT wcid, IN PUCHAR pAddr) + u16 wcid, u8 *pAddr) { - USHORT HashIdx; + u16 HashIdx; MAC_TABLE_ENTRY *pEntry, *pPrevEntry, *pProbeEntry; BOOLEAN Cancelled; - /*USHORT offset; // unused variable */ - /*UCHAR j; // unused variable */ + /*u16 offset; // unused variable */ + /*u8 j; // unused variable */ if (wcid >= MAX_LEN_OF_MAC_TABLE) return FALSE; @@ -1752,7 +1752,7 @@ BOOLEAN MacTableDeleteEntry(IN PRTMP_ADAPTER pAd, the power-saving queues are freed here. ========================================================================== */ -VOID MacTableReset(IN PRTMP_ADAPTER pAd) +void MacTableReset(IN PRTMP_ADAPTER pAd) { int i; @@ -1790,11 +1790,11 @@ VOID MacTableReset(IN PRTMP_ADAPTER pAd) ========================================================================== */ -VOID AssocParmFill(IN PRTMP_ADAPTER pAd, +void AssocParmFill(IN PRTMP_ADAPTER pAd, IN OUT MLME_ASSOC_REQ_STRUCT * AssocReq, - IN PUCHAR pAddr, - IN USHORT CapabilityInfo, - IN ULONG Timeout, IN USHORT ListenIntv) + u8 *pAddr, + u16 CapabilityInfo, + unsigned long Timeout, u16 ListenIntv) { COPY_MAC_ADDR(AssocReq->Addr, pAddr); /* Add mask to support 802.11b mode only */ @@ -1811,9 +1811,9 @@ VOID AssocParmFill(IN PRTMP_ADAPTER pAd, ========================================================================== */ -VOID DisassocParmFill(IN PRTMP_ADAPTER pAd, +void DisassocParmFill(IN PRTMP_ADAPTER pAd, IN OUT MLME_DISASSOC_REQ_STRUCT * DisassocReq, - IN PUCHAR pAddr, IN USHORT Reason) + u8 *pAddr, u16 Reason) { COPY_MAC_ADDR(DisassocReq->Addr, pAddr); DisassocReq->Reason = Reason; @@ -1856,21 +1856,21 @@ VOID DisassocParmFill(IN PRTMP_ADAPTER pAd, BOOLEAN RTMPCheckDHCPFrame(IN PRTMP_ADAPTER pAd, IN PNDIS_PACKET pPacket) { PACKET_INFO PacketInfo; - ULONG NumberOfBytesRead = 0; - ULONG CurrentOffset = 0; - PVOID pVirtualAddress = NULL; - UINT NdisBufferLength; - PUCHAR pSrc; - USHORT Protocol; - UCHAR ByteOffset36 = 0; - UCHAR ByteOffset38 = 0; + unsigned long NumberOfBytesRead = 0; + unsigned long CurrentOffset = 0; + void *pVirtualAddress = NULL; + u32 NdisBufferLength; + u8 *pSrc; + u16 Protocol; + u8 ByteOffset36 = 0; + u8 ByteOffset38 = 0; BOOLEAN ReadFirstParm = TRUE; - RTMP_QueryPacketInfo(pPacket, &PacketInfo, (PUCHAR *) & pVirtualAddress, + RTMP_QueryPacketInfo(pPacket, &PacketInfo, (u8 **) & pVirtualAddress, &NdisBufferLength); NumberOfBytesRead += NdisBufferLength; - pSrc = (PUCHAR) pVirtualAddress; + pSrc = (u8 *)pVirtualAddress; Protocol = *(pSrc + 12) * 256 + *(pSrc + 13); /* */ @@ -1910,11 +1910,11 @@ BOOLEAN RTMPCheckDHCPFrame(IN PRTMP_ADAPTER pAd, IN PNDIS_PACKET pPacket) BOOLEAN RTMPCheckEtherType(IN PRTMP_ADAPTER pAd, IN PNDIS_PACKET pPacket) { - USHORT TypeLen; - UCHAR Byte0, Byte1; - PUCHAR pSrcBuf; - UINT32 pktLen; - UINT16 srcPort, dstPort; + u16 TypeLen; + u8 Byte0, Byte1; + u8 *pSrcBuf; + u32 pktLen; + u16 srcPort, dstPort; BOOLEAN status = TRUE; pSrcBuf = GET_OS_PKT_DATAPTR(pPacket); @@ -1941,7 +1941,7 @@ BOOLEAN RTMPCheckEtherType(IN PRTMP_ADAPTER pAd, IN PNDIS_PACKET pPacket) Sniff2BytesFromNdisBuffer((PNDIS_BUFFER) pSrcBuf, 6, &Byte0, &Byte1); RTMP_SET_PACKET_LLCSNAP(pPacket, 1); - TypeLen = (USHORT) ((Byte0 << 8) + Byte1); + TypeLen = (u16)((Byte0 << 8) + Byte1); pSrcBuf += 8; /* Skip this LLC/SNAP header */ } else { /*It just has 3-byte LLC header, maybe a legacy ether type frame. we didn't handle it. */ @@ -1963,7 +1963,7 @@ BOOLEAN RTMPCheckEtherType(IN PRTMP_ADAPTER pAd, IN PNDIS_PACKET pPacket) RTMP_SET_PACKET_VLAN(pPacket, 1); Sniff2BytesFromNdisBuffer((PNDIS_BUFFER) pSrcBuf, 2, &Byte0, &Byte1); - TypeLen = (USHORT) ((Byte0 << 8) + Byte1); + TypeLen = (u16)((Byte0 << 8) + Byte1); pSrcBuf += 4; /* Skip the VLAN Header. */ } @@ -1978,10 +1978,10 @@ BOOLEAN RTMPCheckEtherType(IN PRTMP_ADAPTER pAd, IN PNDIS_PACKET pPacket) pSrcBuf += 20; /* Skip the IP header */ srcPort = OS_NTOHS(get_unaligned - ((PUINT16) (pSrcBuf))); + ((u16 *)(pSrcBuf))); dstPort = OS_NTOHS(get_unaligned - ((PUINT16) (pSrcBuf + 2))); + ((u16 *)(pSrcBuf + 2))); if ((srcPort == 0x44 && dstPort == 0x43) || (srcPort == 0x43 && dstPort == 0x44)) { /*It's a BOOTP/DHCP packet */ RTMP_SET_PACKET_DHCP(pPacket, 1); @@ -2010,29 +2010,29 @@ BOOLEAN RTMPCheckEtherType(IN PRTMP_ADAPTER pAd, IN PNDIS_PACKET pPacket) } -VOID Update_Rssi_Sample(IN PRTMP_ADAPTER pAd, +void Update_Rssi_Sample(IN PRTMP_ADAPTER pAd, IN RSSI_SAMPLE * pRssi, IN PRXWI_STRUC pRxWI) { - CHAR rssi0 = pRxWI->RSSI0; - CHAR rssi1 = pRxWI->RSSI1; - CHAR rssi2 = pRxWI->RSSI2; + char rssi0 = pRxWI->RSSI0; + char rssi1 = pRxWI->RSSI1; + char rssi2 = pRxWI->RSSI2; if (rssi0 != 0) { - pRssi->LastRssi0 = ConvertToRssi(pAd, (CHAR) rssi0, RSSI_0); + pRssi->LastRssi0 = ConvertToRssi(pAd, (char)rssi0, RSSI_0); pRssi->AvgRssi0X8 = (pRssi->AvgRssi0X8 - pRssi->AvgRssi0) + pRssi->LastRssi0; pRssi->AvgRssi0 = pRssi->AvgRssi0X8 >> 3; } if (rssi1 != 0) { - pRssi->LastRssi1 = ConvertToRssi(pAd, (CHAR) rssi1, RSSI_1); + pRssi->LastRssi1 = ConvertToRssi(pAd, (char)rssi1, RSSI_1); pRssi->AvgRssi1X8 = (pRssi->AvgRssi1X8 - pRssi->AvgRssi1) + pRssi->LastRssi1; pRssi->AvgRssi1 = pRssi->AvgRssi1X8 >> 3; } if (rssi2 != 0) { - pRssi->LastRssi2 = ConvertToRssi(pAd, (CHAR) rssi2, RSSI_2); + pRssi->LastRssi2 = ConvertToRssi(pAd, (char)rssi2, RSSI_2); pRssi->AvgRssi2X8 = (pRssi->AvgRssi2X8 - pRssi->AvgRssi2) + pRssi->LastRssi2; pRssi->AvgRssi2 = pRssi->AvgRssi2X8 >> 3; @@ -2040,11 +2040,11 @@ VOID Update_Rssi_Sample(IN PRTMP_ADAPTER pAd, } /* Normal legacy Rx packet indication */ -VOID Indicate_Legacy_Packet(IN PRTMP_ADAPTER pAd, - IN RX_BLK * pRxBlk, IN UCHAR FromWhichBSSID) +void Indicate_Legacy_Packet(IN PRTMP_ADAPTER pAd, + IN RX_BLK * pRxBlk, u8 FromWhichBSSID) { PNDIS_PACKET pRxPacket = pRxBlk->pRxPacket; - UCHAR Header802_3[LENGTH_802_3]; + u8 Header802_3[LENGTH_802_3]; /* 1. get 802.3 Header */ /* 2. remove LLC */ @@ -2064,10 +2064,10 @@ VOID Indicate_Legacy_Packet(IN PRTMP_ADAPTER pAd, #ifdef RTMP_MAC_USB if (pAd->CommonCfg.bDisableReordering == 0) { PBA_REC_ENTRY pBAEntry; - ULONG Now32; - UCHAR Wcid = pRxBlk->pRxWI->WirelessCliID; - UCHAR TID = pRxBlk->pRxWI->TID; - USHORT Idx; + unsigned long Now32; + u8 Wcid = pRxBlk->pRxWI->WirelessCliID; + u8 TID = pRxBlk->pRxWI->TID; + u16 Idx; #define REORDERING_PACKET_TIMEOUT ((100 * OS_HZ)/1000) /* system ticks -- 100 ms */ @@ -2111,8 +2111,8 @@ VOID Indicate_Legacy_Packet(IN PRTMP_ADAPTER pAd, } /* Normal, AMPDU or AMSDU */ -VOID CmmRxnonRalinkFrameIndicate(IN PRTMP_ADAPTER pAd, - IN RX_BLK * pRxBlk, IN UCHAR FromWhichBSSID) +void CmmRxnonRalinkFrameIndicate(IN PRTMP_ADAPTER pAd, + IN RX_BLK * pRxBlk, u8 FromWhichBSSID) { if (RX_BLK_TEST_FLAG(pRxBlk, fRX_AMPDU) && (pAd->CommonCfg.bDisableReordering == 0)) { @@ -2127,14 +2127,14 @@ VOID CmmRxnonRalinkFrameIndicate(IN PRTMP_ADAPTER pAd, } } -VOID CmmRxRalinkFrameIndicate(IN PRTMP_ADAPTER pAd, +void CmmRxRalinkFrameIndicate(IN PRTMP_ADAPTER pAd, IN MAC_TABLE_ENTRY * pEntry, - IN RX_BLK * pRxBlk, IN UCHAR FromWhichBSSID) + IN RX_BLK * pRxBlk, u8 FromWhichBSSID) { - UCHAR Header802_3[LENGTH_802_3]; - UINT16 Msdu2Size; - UINT16 Payload1Size, Payload2Size; - PUCHAR pData2; + u8 Header802_3[LENGTH_802_3]; + u16 Msdu2Size; + u16 Payload1Size, Payload2Size; + u8 *pData2; PNDIS_PACKET pPacket2 = NULL; Msdu2Size = *(pRxBlk->pData) + (*(pRxBlk->pData + 1) << 8); @@ -2196,16 +2196,16 @@ PNDIS_PACKET RTMPDeFragmentDataFrame(IN PRTMP_ADAPTER pAd, IN RX_BLK * pRxBlk) { PHEADER_802_11 pHeader = pRxBlk->pHeader; PNDIS_PACKET pRxPacket = pRxBlk->pRxPacket; - UCHAR *pData = pRxBlk->pData; - USHORT DataSize = pRxBlk->DataSize; + u8 *pData = pRxBlk->pData; + u16 DataSize = pRxBlk->DataSize; PNDIS_PACKET pRetPacket = NULL; - UCHAR *pFragBuffer = NULL; + u8 *pFragBuffer = NULL; BOOLEAN bReassDone = FALSE; - UCHAR HeaderRoom = 0; + u8 HeaderRoom = 0; ASSERT(pHeader); - HeaderRoom = pData - (UCHAR *) pHeader; + HeaderRoom = pData - (u8 *) pHeader; /* Re-assemble the fragmented packets */ if (pHeader->Frag == 0) /* Frag. Number is 0 : First frag or only one pkt */ @@ -2284,7 +2284,7 @@ done: pAd->FragFrame.pFragPacket = pNewFragPacket; pRxBlk->pHeader = (PHEADER_802_11) GET_OS_PKT_DATAPTR(pRetPacket); - pRxBlk->pData = (UCHAR *) pRxBlk->pHeader + HeaderRoom; + pRxBlk->pData = (u8 *) pRxBlk->pHeader + HeaderRoom; pRxBlk->DataSize = pAd->FragFrame.RxSize - HeaderRoom; pRxBlk->pRxPacket = pRetPacket; } else { @@ -2295,10 +2295,10 @@ done: return pRetPacket; } -VOID Indicate_AMSDU_Packet(IN PRTMP_ADAPTER pAd, - IN RX_BLK * pRxBlk, IN UCHAR FromWhichBSSID) +void Indicate_AMSDU_Packet(IN PRTMP_ADAPTER pAd, + IN RX_BLK * pRxBlk, u8 FromWhichBSSID) { - UINT nMSDU; + u32 nMSDU; update_os_packet_info(pAd, pRxBlk, FromWhichBSSID); RTMP_SET_PACKET_IF(pRxBlk->pRxPacket, FromWhichBSSID); @@ -2307,8 +2307,8 @@ VOID Indicate_AMSDU_Packet(IN PRTMP_ADAPTER pAd, pRxBlk->DataSize); } -VOID Indicate_EAPOL_Packet(IN PRTMP_ADAPTER pAd, - IN RX_BLK * pRxBlk, IN UCHAR FromWhichBSSID) +void Indicate_EAPOL_Packet(IN PRTMP_ADAPTER pAd, + IN RX_BLK * pRxBlk, u8 FromWhichBSSID) { MAC_TABLE_ENTRY *pEntry = NULL; @@ -2329,10 +2329,10 @@ VOID Indicate_EAPOL_Packet(IN PRTMP_ADAPTER pAd, } #define BCN_TBTT_OFFSET 64 /*defer 64 us */ -VOID ReSyncBeaconTime(IN PRTMP_ADAPTER pAd) +void ReSyncBeaconTime(IN PRTMP_ADAPTER pAd) { - UINT32 Offset; + u32 Offset; Offset = (pAd->TbttTickCount) % (BCN_TBTT_OFFSET); diff --git a/drivers/staging/rt2860/common/cmm_data_pci.c b/drivers/staging/rt2860/common/cmm_data_pci.c index 157ebc6dd2b..19eb9286135 100644 --- a/drivers/staging/rt2860/common/cmm_data_pci.c +++ b/drivers/staging/rt2860/common/cmm_data_pci.c @@ -32,24 +32,24 @@ */ #include "../rt_config.h" -USHORT RtmpPCI_WriteTxResource(IN PRTMP_ADAPTER pAd, +u16 RtmpPCI_WriteTxResource(IN PRTMP_ADAPTER pAd, IN TX_BLK * pTxBlk, - IN BOOLEAN bIsLast, OUT USHORT * FreeNumber) + IN BOOLEAN bIsLast, u16 * FreeNumber) { - UCHAR *pDMAHeaderBufVA; - USHORT TxIdx, RetTxIdx; + u8 *pDMAHeaderBufVA; + u16 TxIdx, RetTxIdx; PTXD_STRUC pTxD; - UINT32 BufBasePaLow; + u32 BufBasePaLow; PRTMP_TX_RING pTxRing; - USHORT hwHeaderLen; + u16 hwHeaderLen; /* */ /* get Tx Ring Resource */ /* */ pTxRing = &pAd->TxRing[pTxBlk->QueIdx]; TxIdx = pAd->TxRing[pTxBlk->QueIdx].TxCpuIdx; - pDMAHeaderBufVA = (PUCHAR) pTxRing->Cell[TxIdx].DmaBuf.AllocVa; + pDMAHeaderBufVA = (u8 *)pTxRing->Cell[TxIdx].DmaBuf.AllocVa; BufBasePaLow = RTMP_GetPhysicalAddressLow(pTxRing->Cell[TxIdx].DmaBuf.AllocPa); @@ -97,25 +97,25 @@ USHORT RtmpPCI_WriteTxResource(IN PRTMP_ADAPTER pAd, return RetTxIdx; } -USHORT RtmpPCI_WriteSingleTxResource(IN PRTMP_ADAPTER pAd, +u16 RtmpPCI_WriteSingleTxResource(IN PRTMP_ADAPTER pAd, IN TX_BLK * pTxBlk, IN BOOLEAN bIsLast, - OUT USHORT * FreeNumber) + u16 * FreeNumber) { - UCHAR *pDMAHeaderBufVA; - USHORT TxIdx, RetTxIdx; + u8 *pDMAHeaderBufVA; + u16 TxIdx, RetTxIdx; PTXD_STRUC pTxD; - UINT32 BufBasePaLow; + u32 BufBasePaLow; PRTMP_TX_RING pTxRing; - USHORT hwHeaderLen; + u16 hwHeaderLen; /* */ /* get Tx Ring Resource */ /* */ pTxRing = &pAd->TxRing[pTxBlk->QueIdx]; TxIdx = pAd->TxRing[pTxBlk->QueIdx].TxCpuIdx; - pDMAHeaderBufVA = (PUCHAR) pTxRing->Cell[TxIdx].DmaBuf.AllocVa; + pDMAHeaderBufVA = (u8 *)pTxRing->Cell[TxIdx].DmaBuf.AllocVa; BufBasePaLow = RTMP_GetPhysicalAddressLow(pTxRing->Cell[TxIdx].DmaBuf.AllocPa); @@ -156,18 +156,18 @@ USHORT RtmpPCI_WriteSingleTxResource(IN PRTMP_ADAPTER pAd, return RetTxIdx; } -USHORT RtmpPCI_WriteMultiTxResource(IN PRTMP_ADAPTER pAd, +u16 RtmpPCI_WriteMultiTxResource(IN PRTMP_ADAPTER pAd, IN TX_BLK * pTxBlk, - IN UCHAR frameNum, OUT USHORT * FreeNumber) + u8 frameNum, u16 * FreeNumber) { BOOLEAN bIsLast; - UCHAR *pDMAHeaderBufVA; - USHORT TxIdx, RetTxIdx; + u8 *pDMAHeaderBufVA; + u16 TxIdx, RetTxIdx; PTXD_STRUC pTxD; - UINT32 BufBasePaLow; + u32 BufBasePaLow; PRTMP_TX_RING pTxRing; - USHORT hwHdrLen; - UINT32 firstDMALen; + u16 hwHdrLen; + u32 firstDMALen; bIsLast = ((frameNum == (pTxBlk->TotalFrameNum - 1)) ? 1 : 0); @@ -176,7 +176,7 @@ USHORT RtmpPCI_WriteMultiTxResource(IN PRTMP_ADAPTER pAd, /* */ pTxRing = &pAd->TxRing[pTxBlk->QueIdx]; TxIdx = pAd->TxRing[pTxBlk->QueIdx].TxCpuIdx; - pDMAHeaderBufVA = (PUCHAR) pTxRing->Cell[TxIdx].DmaBuf.AllocVa; + pDMAHeaderBufVA = (u8 *)pTxRing->Cell[TxIdx].DmaBuf.AllocVa; BufBasePaLow = RTMP_GetPhysicalAddressLow(pTxRing->Cell[TxIdx].DmaBuf.AllocPa); @@ -235,9 +235,9 @@ USHORT RtmpPCI_WriteMultiTxResource(IN PRTMP_ADAPTER pAd, } -VOID RtmpPCI_FinalWriteTxResource(IN PRTMP_ADAPTER pAd, +void RtmpPCI_FinalWriteTxResource(IN PRTMP_ADAPTER pAd, IN TX_BLK * pTxBlk, - IN USHORT totalMPDUSize, IN USHORT FirstTxIdx) + u16 totalMPDUSize, u16 FirstTxIdx) { PTXWI_STRUC pTxWI; @@ -252,8 +252,8 @@ VOID RtmpPCI_FinalWriteTxResource(IN PRTMP_ADAPTER pAd, } -VOID RtmpPCIDataLastTxIdx(IN PRTMP_ADAPTER pAd, - IN UCHAR QueIdx, IN USHORT LastTxIdx) +void RtmpPCIDataLastTxIdx(IN PRTMP_ADAPTER pAd, + u8 QueIdx, u16 LastTxIdx) { PTXD_STRUC pTxD; PRTMP_TX_RING pTxRing; @@ -272,24 +272,24 @@ VOID RtmpPCIDataLastTxIdx(IN PRTMP_ADAPTER pAd, } -USHORT RtmpPCI_WriteFragTxResource(IN PRTMP_ADAPTER pAd, +u16 RtmpPCI_WriteFragTxResource(IN PRTMP_ADAPTER pAd, IN TX_BLK * pTxBlk, - IN UCHAR fragNum, OUT USHORT * FreeNumber) + u8 fragNum, u16 * FreeNumber) { - UCHAR *pDMAHeaderBufVA; - USHORT TxIdx, RetTxIdx; + u8 *pDMAHeaderBufVA; + u16 TxIdx, RetTxIdx; PTXD_STRUC pTxD; - UINT32 BufBasePaLow; + u32 BufBasePaLow; PRTMP_TX_RING pTxRing; - USHORT hwHeaderLen; - UINT32 firstDMALen; + u16 hwHeaderLen; + u32 firstDMALen; /* */ /* Get Tx Ring Resource */ /* */ pTxRing = &pAd->TxRing[pTxBlk->QueIdx]; TxIdx = pAd->TxRing[pTxBlk->QueIdx].TxCpuIdx; - pDMAHeaderBufVA = (PUCHAR) pTxRing->Cell[TxIdx].DmaBuf.AllocVa; + pDMAHeaderBufVA = (u8 *)pTxRing->Cell[TxIdx].DmaBuf.AllocVa; BufBasePaLow = RTMP_GetPhysicalAddressLow(pTxRing->Cell[TxIdx].DmaBuf.AllocPa); @@ -342,12 +342,12 @@ USHORT RtmpPCI_WriteFragTxResource(IN PRTMP_ADAPTER pAd, This function handle PCI specific TxDesc and cpu index update and kick the packet out. */ int RtmpPCIMgmtKickOut(IN RTMP_ADAPTER * pAd, - IN UCHAR QueIdx, + u8 QueIdx, IN PNDIS_PACKET pPacket, - IN PUCHAR pSrcBufVA, IN UINT SrcBufLen) + u8 *pSrcBufVA, u32 SrcBufLen) { PTXD_STRUC pTxD; - ULONG SwIdx = pAd->MgmtRing.TxCpuIdx; + unsigned long SwIdx = pAd->MgmtRing.TxCpuIdx; pTxD = (PTXD_STRUC) pAd->MgmtRing.Cell[SwIdx].AllocVa; @@ -405,17 +405,17 @@ int RtmpPCIMgmtKickOut(IN RTMP_ADAPTER * pAd, ======================================================================== */ -NDIS_STATUS RTMPCheckRxError(IN PRTMP_ADAPTER pAd, +int RTMPCheckRxError(IN PRTMP_ADAPTER pAd, IN PHEADER_802_11 pHeader, IN PRXWI_STRUC pRxWI, IN PRT28XX_RXD_STRUC pRxD) { PCIPHER_KEY pWpaKey; - INT dBm; + int dBm; /* Phy errors & CRC errors */ if ( /*(pRxD->PhyErr) || */ (pRxD->Crc)) { /* Check RSSI for Noise Hist statistic collection. */ - dBm = (INT) (pRxWI->RSSI0) - pAd->BbpRssiToDbmDelta; + dBm = (int)(pRxWI->RSSI0) - pAd->BbpRssiToDbmDelta; if (dBm <= -87) pAd->StaCfg.RPIDensity[0] += 1; else if (dBm <= -82) @@ -516,14 +516,14 @@ NDIS_STATUS RTMPCheckRxError(IN PRTMP_ADAPTER pAd, return (NDIS_STATUS_SUCCESS); } -BOOLEAN RTMPFreeTXDUponTxDmaDone(IN PRTMP_ADAPTER pAd, IN UCHAR QueIdx) +BOOLEAN RTMPFreeTXDUponTxDmaDone(IN PRTMP_ADAPTER pAd, u8 QueIdx) { PRTMP_TX_RING pTxRing; PTXD_STRUC pTxD; PNDIS_PACKET pPacket; - UCHAR FREE = 0; + u8 FREE = 0; TXD_STRUC TxD, *pOriTxD; - /*ULONG IrqFlags; */ + /*unsigned long IrqFlags; */ BOOLEAN bReschedule = FALSE; ASSERT(QueIdx < NUM_OF_TX_RING); @@ -610,9 +610,9 @@ BOOLEAN RTMPFreeTXDUponTxDmaDone(IN PRTMP_ADAPTER pAd, IN UCHAR QueIdx) ======================================================================== */ BOOLEAN RTMPHandleTxRingDmaDoneInterrupt(IN PRTMP_ADAPTER pAd, - IN INT_SOURCE_CSR_STRUC TxRingBitmap) + INT_SOURCE_CSR_STRUC TxRingBitmap) { -/* UCHAR Count = 0; */ +/* u8 Count = 0; */ unsigned long IrqFlags; BOOLEAN bReschedule = FALSE; @@ -661,12 +661,12 @@ BOOLEAN RTMPHandleTxRingDmaDoneInterrupt(IN PRTMP_ADAPTER pAd, ======================================================================== */ -VOID RTMPHandleMgmtRingDmaDoneInterrupt(IN PRTMP_ADAPTER pAd) +void RTMPHandleMgmtRingDmaDoneInterrupt(IN PRTMP_ADAPTER pAd) { PTXD_STRUC pTxD; PNDIS_PACKET pPacket; /* int i; */ - UCHAR FREE = 0; + u8 FREE = 0; PRTMP_MGMT_RING pMgmtRing = &pAd->MgmtRing; NdisAcquireSpinLock(&pAd->MgmtRingLock); @@ -713,7 +713,7 @@ VOID RTMPHandleMgmtRingDmaDoneInterrupt(IN PRTMP_ADAPTER pAd) ======================================================================== */ -VOID RTMPHandleTBTTInterrupt(IN PRTMP_ADAPTER pAd) +void RTMPHandleTBTTInterrupt(IN PRTMP_ADAPTER pAd) { { if (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_DOZE)) { @@ -732,7 +732,7 @@ VOID RTMPHandleTBTTInterrupt(IN PRTMP_ADAPTER pAd) ======================================================================== */ -VOID RTMPHandlePreTBTTInterrupt(IN PRTMP_ADAPTER pAd) +void RTMPHandlePreTBTTInterrupt(IN PRTMP_ADAPTER pAd) { { if (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_DOZE)) { @@ -743,7 +743,7 @@ VOID RTMPHandlePreTBTTInterrupt(IN PRTMP_ADAPTER pAd) } -VOID RTMPHandleRxCoherentInterrupt(IN PRTMP_ADAPTER pAd) +void RTMPHandleRxCoherentInterrupt(IN PRTMP_ADAPTER pAd) { WPDMA_GLO_CFG_STRUC GloCfg; @@ -776,12 +776,12 @@ VOID RTMPHandleRxCoherentInterrupt(IN PRTMP_ADAPTER pAd) PNDIS_PACKET GetPacketFromRxRing(IN PRTMP_ADAPTER pAd, OUT PRT28XX_RXD_STRUC pSaveRxD, OUT BOOLEAN * pbReschedule, - IN OUT UINT32 * pRxPending) + IN u32 * pRxPending) { PRXD_STRUC pRxD; PNDIS_PACKET pRxPacket = NULL; PNDIS_PACKET pNewPacket; - PVOID AllocVa; + void *AllocVa; NDIS_PHYSICAL_ADDRESS AllocPa; BOOLEAN bReschedule = FALSE; RTMP_DMACB *pRxCell; @@ -864,23 +864,23 @@ done: return pRxPacket; } -NDIS_STATUS MlmeHardTransmitTxRing(IN PRTMP_ADAPTER pAd, - IN UCHAR QueIdx, IN PNDIS_PACKET pPacket) +int MlmeHardTransmitTxRing(IN PRTMP_ADAPTER pAd, + u8 QueIdx, IN PNDIS_PACKET pPacket) { PACKET_INFO PacketInfo; - PUCHAR pSrcBufVA; - UINT SrcBufLen; + u8 *pSrcBufVA; + u32 SrcBufLen; PTXD_STRUC pTxD; PHEADER_802_11 pHeader_802_11; BOOLEAN bAckRequired, bInsertTimestamp; - ULONG SrcBufPA; - /*UCHAR TxBufIdx; */ - UCHAR MlmeRate; - ULONG SwIdx = pAd->TxRing[QueIdx].TxCpuIdx; + unsigned long SrcBufPA; + /*u8 TxBufIdx; */ + u8 MlmeRate; + unsigned long SwIdx = pAd->TxRing[QueIdx].TxCpuIdx; PTXWI_STRUC pFirstTxWI; - /*ULONG i; */ + /*unsigned long i; */ /*HTTRANSMIT_SETTING MlmeTransmit; //Rate for this MGMT frame. */ - ULONG FreeNum; + unsigned long FreeNum; MAC_TABLE_ENTRY *pMacEntry = NULL; RTMP_QueryPacketInfo(pPacket, &PacketInfo, &pSrcBufVA, &SrcBufLen); @@ -1000,14 +1000,14 @@ NDIS_STATUS MlmeHardTransmitTxRing(IN PRTMP_ADAPTER pAd, RTMPWriteTxWI(pAd, pFirstTxWI, FALSE, FALSE, bInsertTimestamp, FALSE, bAckRequired, FALSE, 0, RESERVED_WCID, (SrcBufLen - TXWI_SIZE), PID_MGMT, 0, - (UCHAR) pAd->CommonCfg.MlmeTransmit.field.MCS, + (u8)pAd->CommonCfg.MlmeTransmit.field.MCS, IFS_BACKOFF, FALSE, &pAd->CommonCfg.MlmeTransmit); } else { RTMPWriteTxWI(pAd, pFirstTxWI, FALSE, FALSE, bInsertTimestamp, FALSE, bAckRequired, FALSE, 0, pMacEntry->Aid, (SrcBufLen - TXWI_SIZE), pMacEntry->MaxHTPhyMode.field.MCS, 0, - (UCHAR) pMacEntry->MaxHTPhyMode.field.MCS, + (u8)pMacEntry->MaxHTPhyMode.field.MCS, IFS_BACKOFF, FALSE, &pMacEntry->MaxHTPhyMode); } @@ -1040,8 +1040,8 @@ NDIS_STATUS MlmeHardTransmitTxRing(IN PRTMP_ADAPTER pAd, return NDIS_STATUS_SUCCESS; } -NDIS_STATUS MlmeDataHardTransmit(IN PRTMP_ADAPTER pAd, - IN UCHAR QueIdx, IN PNDIS_PACKET pPacket) +int MlmeDataHardTransmit(IN PRTMP_ADAPTER pAd, + u8 QueIdx, IN PNDIS_PACKET pPacket) { if ((pAd->CommonCfg.RadarDetect.RDMode != RD_NORMAL_MODE) ) { @@ -1078,9 +1078,9 @@ NDIS_STATUS MlmeDataHardTransmit(IN PRTMP_ADAPTER pAd, ======================================================================== */ -VOID RTMPWriteTxDescriptor(IN PRTMP_ADAPTER pAd, +void RTMPWriteTxDescriptor(IN PRTMP_ADAPTER pAd, IN PTXD_STRUC pTxD, - IN BOOLEAN bWIV, IN UCHAR QueueSEL) + IN BOOLEAN bWIV, u8 QueueSEL) { /* */ /* Always use Long preamble before verifiation short preamble functionality works well. */ diff --git a/drivers/staging/rt2860/common/cmm_data_usb.c b/drivers/staging/rt2860/common/cmm_data_usb.c index da79fc03d76..79067565936 100644 --- a/drivers/staging/rt2860/common/cmm_data_usb.c +++ b/drivers/staging/rt2860/common/cmm_data_usb.c @@ -41,11 +41,11 @@ => => */ -static inline NDIS_STATUS RtmpUSBCanDoWrite(IN RTMP_ADAPTER * pAd, - IN UCHAR QueIdx, +static inline int RtmpUSBCanDoWrite(IN RTMP_ADAPTER * pAd, + u8 QueIdx, IN HT_TX_CONTEXT * pHTTXContext) { - NDIS_STATUS canWrite = NDIS_STATUS_RESOURCES; + int canWrite = NDIS_STATUS_RESOURCES; if (((pHTTXContext->CurWritePosition) < pHTTXContext->NextBulkOutPosition) @@ -68,9 +68,9 @@ static inline NDIS_STATUS RtmpUSBCanDoWrite(IN RTMP_ADAPTER * pAd, return canWrite; } -USHORT RtmpUSB_WriteSubTxResource(IN PRTMP_ADAPTER pAd, +u16 RtmpUSB_WriteSubTxResource(IN PRTMP_ADAPTER pAd, IN TX_BLK * pTxBlk, - IN BOOLEAN bIsLast, OUT USHORT * FreeNumber) + IN BOOLEAN bIsLast, u16 * FreeNumber) { /* Dummy function. Should be removed in the future. */ @@ -78,20 +78,20 @@ USHORT RtmpUSB_WriteSubTxResource(IN PRTMP_ADAPTER pAd, } -USHORT RtmpUSB_WriteFragTxResource(IN PRTMP_ADAPTER pAd, +u16 RtmpUSB_WriteFragTxResource(IN PRTMP_ADAPTER pAd, IN TX_BLK * pTxBlk, - IN UCHAR fragNum, OUT USHORT * FreeNumber) + u8 fragNum, u16 * FreeNumber) { HT_TX_CONTEXT *pHTTXContext; - USHORT hwHdrLen; /* The hwHdrLen consist of 802.11 header length plus the header padding length. */ - UINT32 fillOffset; + u16 hwHdrLen; /* The hwHdrLen consist of 802.11 header length plus the header padding length. */ + u32 fillOffset; TXINFO_STRUC *pTxInfo; TXWI_STRUC *pTxWI; - PUCHAR pWirelessPacket = NULL; - UCHAR QueIdx; - NDIS_STATUS Status; + u8 *pWirelessPacket = NULL; + u8 QueIdx; + int Status; unsigned long IrqFlags; - UINT32 USBDMApktLen = 0, DMAHdrLen, padding; + u32 USBDMApktLen = 0, DMAHdrLen, padding; BOOLEAN TxQLastRound = FALSE; /* */ @@ -146,7 +146,7 @@ USHORT RtmpUSB_WriteFragTxResource(IN PRTMP_ADAPTER pAd, } } - NdisZeroMemory((PUCHAR) (&pTxBlk->HeaderBuf[0]), TXINFO_SIZE); + NdisZeroMemory((u8 *)(&pTxBlk->HeaderBuf[0]), TXINFO_SIZE); pTxInfo = (PTXINFO_STRUC) (&pTxBlk->HeaderBuf[0]); pTxWI = (PTXWI_STRUC) (&pTxBlk->HeaderBuf[TXINFO_SIZE]); @@ -166,7 +166,7 @@ USHORT RtmpUSB_WriteFragTxResource(IN PRTMP_ADAPTER pAd, pTxBlk->Priv += (TXINFO_SIZE + USBDMApktLen); /* For TxInfo, the length of USBDMApktLen = TXWI_SIZE + 802.11 header + payload */ - RTMPWriteTxInfo(pAd, pTxInfo, (USHORT) (USBDMApktLen), FALSE, FIFO_EDCA, + RTMPWriteTxInfo(pAd, pTxInfo, (u16)(USBDMApktLen), FALSE, FIFO_EDCA, FALSE /*NextValid */ , FALSE); if (fragNum == pTxBlk->TotalFragNum) { @@ -215,21 +215,21 @@ USHORT RtmpUSB_WriteFragTxResource(IN PRTMP_ADAPTER pAd, } -USHORT RtmpUSB_WriteSingleTxResource(IN PRTMP_ADAPTER pAd, +u16 RtmpUSB_WriteSingleTxResource(IN PRTMP_ADAPTER pAd, IN TX_BLK * pTxBlk, IN BOOLEAN bIsLast, - OUT USHORT * FreeNumber) + u16 * FreeNumber) { HT_TX_CONTEXT *pHTTXContext; - USHORT hwHdrLen; - UINT32 fillOffset; + u16 hwHdrLen; + u32 fillOffset; TXINFO_STRUC *pTxInfo; TXWI_STRUC *pTxWI; - PUCHAR pWirelessPacket; - UCHAR QueIdx; + u8 *pWirelessPacket; + u8 QueIdx; unsigned long IrqFlags; - NDIS_STATUS Status; - UINT32 USBDMApktLen = 0, DMAHdrLen, padding; + int Status; + u32 USBDMApktLen = 0, DMAHdrLen, padding; BOOLEAN bTxQLastRound = FALSE; /* For USB, didn't need PCI_MAP_SINGLE() */ @@ -278,7 +278,7 @@ USHORT RtmpUSB_WriteSingleTxResource(IN PRTMP_ADAPTER pAd, pTxBlk->Priv = (TXINFO_SIZE + USBDMApktLen); /* For TxInfo, the length of USBDMApktLen = TXWI_SIZE + 802.11 header + payload */ - RTMPWriteTxInfo(pAd, pTxInfo, (USHORT) (USBDMApktLen), FALSE, + RTMPWriteTxInfo(pAd, pTxInfo, (u16)(USBDMApktLen), FALSE, FIFO_EDCA, FALSE /*NextValid */ , FALSE); if ((pHTTXContext->CurWritePosition + 3906 + pTxBlk->Priv) > @@ -328,20 +328,20 @@ USHORT RtmpUSB_WriteSingleTxResource(IN PRTMP_ADAPTER pAd, } -USHORT RtmpUSB_WriteMultiTxResource(IN PRTMP_ADAPTER pAd, +u16 RtmpUSB_WriteMultiTxResource(IN PRTMP_ADAPTER pAd, IN TX_BLK * pTxBlk, - IN UCHAR frameNum, OUT USHORT * FreeNumber) + u8 frameNum, u16 * FreeNumber) { HT_TX_CONTEXT *pHTTXContext; - USHORT hwHdrLen; /* The hwHdrLen consist of 802.11 header length plus the header padding length. */ - UINT32 fillOffset; + u16 hwHdrLen; /* The hwHdrLen consist of 802.11 header length plus the header padding length. */ + u32 fillOffset; TXINFO_STRUC *pTxInfo; TXWI_STRUC *pTxWI; - PUCHAR pWirelessPacket = NULL; - UCHAR QueIdx; - NDIS_STATUS Status; + u8 *pWirelessPacket = NULL; + u8 QueIdx; + int Status; unsigned long IrqFlags; - /*UINT32 USBDMApktLen = 0, DMAHdrLen, padding; */ + /*u32 USBDMApktLen = 0, DMAHdrLen, padding; */ /* */ /* get Tx Ring Resource & Dma Buffer address */ @@ -401,7 +401,7 @@ USHORT RtmpUSB_WriteMultiTxResource(IN PRTMP_ADAPTER pAd, pTxBlk->Priv = TXINFO_SIZE + TXWI_SIZE + hwHdrLen; /* pTxInfo->USBDMApktLen now just a temp value and will to correct latter. */ - RTMPWriteTxInfo(pAd, pTxInfo, (USHORT) (pTxBlk->Priv), + RTMPWriteTxInfo(pAd, pTxInfo, (u16)(pTxBlk->Priv), FALSE, FIFO_EDCA, FALSE /*NextValid */ , FALSE); @@ -467,18 +467,18 @@ done: } -VOID RtmpUSB_FinalWriteTxResource(IN PRTMP_ADAPTER pAd, +void RtmpUSB_FinalWriteTxResource(IN PRTMP_ADAPTER pAd, IN TX_BLK * pTxBlk, - IN USHORT totalMPDUSize, IN USHORT TxIdx) + u16 totalMPDUSize, u16 TxIdx) { - UCHAR QueIdx; + u8 QueIdx; HT_TX_CONTEXT *pHTTXContext; - UINT32 fillOffset; + u32 fillOffset; TXINFO_STRUC *pTxInfo; TXWI_STRUC *pTxWI; - UINT32 USBDMApktLen, padding; + u32 USBDMApktLen, padding; unsigned long IrqFlags; - PUCHAR pWirelessPacket; + u8 *pWirelessPacket; QueIdx = pTxBlk->QueIdx; pHTTXContext = &pAd->TxContext[QueIdx]; @@ -492,10 +492,10 @@ VOID RtmpUSB_FinalWriteTxResource(IN PRTMP_ADAPTER pAd, || ((pHTTXContext->ENextBulkOutPosition - 8) == pHTTXContext->CurWritePosition)) && (pHTTXContext->bCopySavePad == TRUE)) - pWirelessPacket = (PUCHAR) (&pHTTXContext->SavedPad[0]); + pWirelessPacket = (u8 *)(&pHTTXContext->SavedPad[0]); else pWirelessPacket = - (PUCHAR) (&pHTTXContext->TransferBuffer->field. + (u8 *)(&pHTTXContext->TransferBuffer->field. WirelessPacket[fillOffset]); /* */ @@ -547,8 +547,8 @@ VOID RtmpUSB_FinalWriteTxResource(IN PRTMP_ADAPTER pAd, } -VOID RtmpUSBDataLastTxIdx(IN PRTMP_ADAPTER pAd, - IN UCHAR QueIdx, IN USHORT TxIdx) +void RtmpUSBDataLastTxIdx(IN PRTMP_ADAPTER pAd, + u8 QueIdx, u16 TxIdx) { /* DO nothing for USB. */ } @@ -561,8 +561,8 @@ VOID RtmpUSBDataLastTxIdx(IN PRTMP_ADAPTER pAd, Check if the CurWriting flag is FALSE, if it's FALSE, we can do kick out. */ -VOID RtmpUSBDataKickOut(IN PRTMP_ADAPTER pAd, - IN TX_BLK * pTxBlk, IN UCHAR QueIdx) +void RtmpUSBDataKickOut(IN PRTMP_ADAPTER pAd, + IN TX_BLK * pTxBlk, u8 QueIdx) { RTUSB_SET_BULK_FLAG(pAd, (fRTUSB_BULK_OUT_DATA_NORMAL << QueIdx)); RTUSBKickBulkOut(pAd); @@ -574,15 +574,15 @@ VOID RtmpUSBDataKickOut(IN PRTMP_ADAPTER pAd, This function handle RT2870 specific TxDesc and cpu index update and kick the packet out. */ int RtmpUSBMgmtKickOut(IN RTMP_ADAPTER * pAd, - IN UCHAR QueIdx, + u8 QueIdx, IN PNDIS_PACKET pPacket, - IN PUCHAR pSrcBufVA, IN UINT SrcBufLen) + u8 *pSrcBufVA, u32 SrcBufLen) { PTXINFO_STRUC pTxInfo; - ULONG BulkOutSize; - UCHAR padLen; - PUCHAR pDest; - ULONG SwIdx = pAd->MgmtRing.TxCpuIdx; + unsigned long BulkOutSize; + u8 padLen; + u8 *pDest; + unsigned long SwIdx = pAd->MgmtRing.TxCpuIdx; PTX_CONTEXT pMLMEContext = (PTX_CONTEXT) pAd->MgmtRing.Cell[SwIdx].AllocVa; unsigned long IrqFlags; @@ -592,7 +592,7 @@ int RtmpUSBMgmtKickOut(IN RTMP_ADAPTER * pAd, /* Build our URB for USBD */ BulkOutSize = SrcBufLen; BulkOutSize = (BulkOutSize + 3) & (~3); - RTMPWriteTxInfo(pAd, pTxInfo, (USHORT) (BulkOutSize - TXINFO_SIZE), + RTMPWriteTxInfo(pAd, pTxInfo, (u16)(BulkOutSize - TXINFO_SIZE), TRUE, EpToQueue[MGMTPIPEIDX], FALSE, FALSE); BulkOutSize += 4; /* Always add 4 extra bytes at every packet. */ @@ -605,7 +605,7 @@ int RtmpUSBMgmtKickOut(IN RTMP_ADAPTER * pAd, ASSERT((padLen <= RTMP_PKT_TAIL_PADDING)); /* Now memzero all extra padding bytes. */ - pDest = (PUCHAR) (pSrcBufVA + SrcBufLen); + pDest = (u8 *)(pSrcBufVA + SrcBufLen); skb_put(GET_OS_PKT_TYPE(pPacket), padLen); NdisZeroMemory(pDest, padLen); @@ -642,34 +642,34 @@ int RtmpUSBMgmtKickOut(IN RTMP_ADAPTER * pAd, return 0; } -VOID RtmpUSBNullFrameKickOut(IN RTMP_ADAPTER * pAd, - IN UCHAR QueIdx, - IN UCHAR * pNullFrame, IN UINT32 frameLen) +void RtmpUSBNullFrameKickOut(IN RTMP_ADAPTER * pAd, + u8 QueIdx, + u8 * pNullFrame, u32 frameLen) { if (pAd->NullContext.InUse == FALSE) { PTX_CONTEXT pNullContext; PTXINFO_STRUC pTxInfo; PTXWI_STRUC pTxWI; - PUCHAR pWirelessPkt; + u8 *pWirelessPkt; pNullContext = &(pAd->NullContext); /* Set the in use bit */ pNullContext->InUse = TRUE; pWirelessPkt = - (PUCHAR) & pNullContext->TransferBuffer->field. + (u8 *)& pNullContext->TransferBuffer->field. WirelessPacket[0]; RTMPZeroMemory(&pWirelessPkt[0], 100); pTxInfo = (PTXINFO_STRUC) & pWirelessPkt[0]; RTMPWriteTxInfo(pAd, pTxInfo, - (USHORT) (sizeof(HEADER_802_11) + TXWI_SIZE), + (u16)(sizeof(HEADER_802_11) + TXWI_SIZE), TRUE, EpToQueue[MGMTPIPEIDX], FALSE, FALSE); pTxInfo->QSEL = FIFO_EDCA; pTxWI = (PTXWI_STRUC) & pWirelessPkt[TXINFO_SIZE]; RTMPWriteTxWI(pAd, pTxWI, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, 0, BSSID_WCID, (sizeof(HEADER_802_11)), 0, - 0, (UCHAR) pAd->CommonCfg.MlmeTransmit.field.MCS, + 0, (u8)pAd->CommonCfg.MlmeTransmit.field.MCS, IFS_HTTXOP, FALSE, &pAd->CommonCfg.MlmeTransmit); RTMPMoveMemory(&pWirelessPkt[TXWI_SIZE + TXINFO_SIZE], @@ -710,13 +710,13 @@ Note: PNDIS_PACKET GetPacketFromRxRing(IN PRTMP_ADAPTER pAd, OUT PRT28XX_RXD_STRUC pSaveRxD, OUT BOOLEAN * pbReschedule, - IN OUT UINT32 * pRxPending) + IN u32 * pRxPending) { PRX_CONTEXT pRxContext; PNDIS_PACKET pSkb; - PUCHAR pData; - ULONG ThisFrameLen; - ULONG RxBufferLength; + u8 *pData; + unsigned long ThisFrameLen; + unsigned long RxBufferLength; PRXWI_STRUC pRxWI; pRxContext = &pAd->RxContext[pAd->NextRxBulkInReadIndex]; @@ -812,12 +812,12 @@ label_null: ======================================================================== */ -NDIS_STATUS RTMPCheckRxError(IN PRTMP_ADAPTER pAd, +int RTMPCheckRxError(IN PRTMP_ADAPTER pAd, IN PHEADER_802_11 pHeader, IN PRXWI_STRUC pRxWI, IN PRT28XX_RXD_STRUC pRxINFO) { PCIPHER_KEY pWpaKey; - INT dBm; + int dBm; if (pAd->bPromiscuous == TRUE) return (NDIS_STATUS_SUCCESS); @@ -827,7 +827,7 @@ NDIS_STATUS RTMPCheckRxError(IN PRTMP_ADAPTER pAd, /* Phy errors & CRC errors */ if (pRxINFO->Crc) { /* Check RSSI for Noise Hist statistic collection. */ - dBm = (INT) (pRxWI->RSSI0) - pAd->BbpRssiToDbmDelta; + dBm = (int)(pRxWI->RSSI0) - pAd->BbpRssiToDbmDelta; if (dBm <= -87) pAd->StaCfg.RPIDensity[0] += 1; else if (dBm <= -82) @@ -904,10 +904,10 @@ NDIS_STATUS RTMPCheckRxError(IN PRTMP_ADAPTER pAd, return (NDIS_STATUS_SUCCESS); } -VOID RtmpUsbStaAsicForceWakeupTimeout(IN PVOID SystemSpecific1, - IN PVOID FunctionContext, - IN PVOID SystemSpecific2, - IN PVOID SystemSpecific3) +void RtmpUsbStaAsicForceWakeupTimeout(void *SystemSpecific1, + void *FunctionContext, + void *SystemSpecific2, + void *SystemSpecific3) { RTMP_ADAPTER *pAd = (RTMP_ADAPTER *) FunctionContext; @@ -919,7 +919,7 @@ VOID RtmpUsbStaAsicForceWakeupTimeout(IN PVOID SystemSpecific1, } } -VOID RT28xxUsbStaAsicForceWakeup(IN PRTMP_ADAPTER pAd, IN BOOLEAN bFromTx) +void RT28xxUsbStaAsicForceWakeup(IN PRTMP_ADAPTER pAd, IN BOOLEAN bFromTx) { BOOLEAN Canceled; @@ -931,8 +931,8 @@ VOID RT28xxUsbStaAsicForceWakeup(IN PRTMP_ADAPTER pAd, IN BOOLEAN bFromTx) OPSTATUS_CLEAR_FLAG(pAd, fOP_STATUS_DOZE); } -VOID RT28xxUsbStaAsicSleepThenAutoWakeup(IN PRTMP_ADAPTER pAd, - IN USHORT TbttNumToNextWakeUp) +void RT28xxUsbStaAsicSleepThenAutoWakeup(IN PRTMP_ADAPTER pAd, + u16 TbttNumToNextWakeUp) { /* we have decided to SLEEP, so at least do it for a BEACON period. */ diff --git a/drivers/staging/rt2860/common/cmm_info.c b/drivers/staging/rt2860/common/cmm_info.c index 610eb75dd15..21780578f55 100644 --- a/drivers/staging/rt2860/common/cmm_info.c +++ b/drivers/staging/rt2860/common/cmm_info.c @@ -47,7 +47,7 @@ ======================================================================== */ -VOID RTMPSetDesiredRates(IN PRTMP_ADAPTER pAdapter, IN LONG Rates) +void RTMPSetDesiredRates(IN PRTMP_ADAPTER pAdapter, long Rates) { NDIS_802_11_RATES aryRates; @@ -235,10 +235,10 @@ VOID RTMPSetDesiredRates(IN PRTMP_ADAPTER pAdapter, IN LONG Rates) ======================================================================== */ -VOID RTMPWPARemoveAllKeys(IN PRTMP_ADAPTER pAd) +void RTMPWPARemoveAllKeys(IN PRTMP_ADAPTER pAd) { - UCHAR i; + u8 i; DBGPRINT(RT_DEBUG_TRACE, ("RTMPWPARemoveAllKeys(AuthMode=%d, WepStatus=%d)\n", @@ -307,9 +307,9 @@ VOID RTMPWPARemoveAllKeys(IN PRTMP_ADAPTER pAd) ======================================================================== */ -VOID RTMPSetPhyMode(IN PRTMP_ADAPTER pAd, IN ULONG phymode) +void RTMPSetPhyMode(IN PRTMP_ADAPTER pAd, unsigned long phymode) { - INT i; + int i; /* the selected phymode must be supported by the RF IC encoded in E2PROM */ /* if no change, do nothing */ @@ -317,7 +317,7 @@ VOID RTMPSetPhyMode(IN PRTMP_ADAPTER pAd, IN ULONG phymode) if (pAd->CommonCfg.PhyMode == phymode) return; */ - pAd->CommonCfg.PhyMode = (UCHAR) phymode; + pAd->CommonCfg.PhyMode = (u8)phymode; DBGPRINT(RT_DEBUG_TRACE, ("RTMPSetPhyMode : PhyMode=%d, channel=%d \n", @@ -435,13 +435,13 @@ VOID RTMPSetPhyMode(IN PRTMP_ADAPTER pAd, IN ULONG phymode) ======================================================================== */ -VOID RTMPSetHT(IN PRTMP_ADAPTER pAd, IN OID_SET_HT_PHYMODE * pHTPhyMode) +void RTMPSetHT(IN PRTMP_ADAPTER pAd, IN OID_SET_HT_PHYMODE * pHTPhyMode) { - /*ULONG *pmcs; */ - UINT32 Value = 0; - UCHAR BBPValue = 0; - UCHAR BBP3Value = 0; - UCHAR RxStream = pAd->CommonCfg.RxStream; + /*unsigned long *pmcs; */ + u32 Value = 0; + u8 BBPValue = 0; + u8 BBP3Value = 0; + u8 RxStream = pAd->CommonCfg.RxStream; DBGPRINT(RT_DEBUG_TRACE, ("RTMPSetHT : HT_mode(%d), ExtOffset(%d), MCS(%d), BW(%d), STBC(%d), SHORTGI(%d)\n", @@ -475,20 +475,20 @@ VOID RTMPSetHT(IN PRTMP_ADAPTER pAd, IN OID_SET_HT_PHYMODE * pHTPhyMode) /* Mimo power save, A-MSDU size, */ pAd->CommonCfg.DesiredHtPhy.AmsduEnable = - (USHORT) pAd->CommonCfg.BACapability.field.AmsduEnable; + (u16)pAd->CommonCfg.BACapability.field.AmsduEnable; pAd->CommonCfg.DesiredHtPhy.AmsduSize = - (UCHAR) pAd->CommonCfg.BACapability.field.AmsduSize; + (u8)pAd->CommonCfg.BACapability.field.AmsduSize; pAd->CommonCfg.DesiredHtPhy.MimoPs = - (UCHAR) pAd->CommonCfg.BACapability.field.MMPSmode; + (u8)pAd->CommonCfg.BACapability.field.MMPSmode; pAd->CommonCfg.DesiredHtPhy.MpduDensity = - (UCHAR) pAd->CommonCfg.BACapability.field.MpduDensity; + (u8)pAd->CommonCfg.BACapability.field.MpduDensity; pAd->CommonCfg.HtCapability.HtCapInfo.AMsduSize = - (USHORT) pAd->CommonCfg.BACapability.field.AmsduSize; + (u16)pAd->CommonCfg.BACapability.field.AmsduSize; pAd->CommonCfg.HtCapability.HtCapInfo.MimoPs = - (USHORT) pAd->CommonCfg.BACapability.field.MMPSmode; + (u16)pAd->CommonCfg.BACapability.field.MMPSmode; pAd->CommonCfg.HtCapability.HtCapParm.MpduDensity = - (UCHAR) pAd->CommonCfg.BACapability.field.MpduDensity; + (u8)pAd->CommonCfg.BACapability.field.MpduDensity; DBGPRINT(RT_DEBUG_TRACE, ("RTMPSetHT : AMsduSize = %d, MimoPs = %d, MpduDensity = %d, MaxRAmpduFactor = %d\n", @@ -648,11 +648,11 @@ VOID RTMPSetHT(IN PRTMP_ADAPTER pAd, IN OID_SET_HT_PHYMODE * pHTPhyMode) ======================================================================== */ -VOID RTMPSetIndividualHT(IN PRTMP_ADAPTER pAd, IN UCHAR apidx) +void RTMPSetIndividualHT(IN PRTMP_ADAPTER pAd, u8 apidx) { PRT_HT_PHY_INFO pDesired_ht_phy = NULL; - UCHAR TxStream = pAd->CommonCfg.TxStream; - UCHAR DesiredMcs = MCS_AUTO; + u8 TxStream = pAd->CommonCfg.TxStream; + u8 DesiredMcs = MCS_AUTO; do { { @@ -708,7 +708,7 @@ VOID RTMPSetIndividualHT(IN PRTMP_ADAPTER pAd, IN UCHAR apidx) pDesired_ht_phy->MCSSet[0] = 0xff; pDesired_ht_phy->MCSSet[1] = 0xff; } else if (DesiredMcs <= MCS_15) { - ULONG mode; + unsigned long mode; mode = DesiredMcs / 8; if (mode < 2) @@ -724,7 +724,7 @@ VOID RTMPSetIndividualHT(IN PRTMP_ADAPTER pAd, IN UCHAR apidx) pDesired_ht_phy->MCSSet[1] = 0xff; pDesired_ht_phy->MCSSet[2] = 0xff; } else if (DesiredMcs <= MCS_23) { - ULONG mode; + unsigned long mode; mode = DesiredMcs / 8; if (mode < 3) @@ -755,8 +755,8 @@ VOID RTMPSetIndividualHT(IN PRTMP_ADAPTER pAd, IN UCHAR apidx) ======================================================================== */ -VOID RTMPUpdateHTIE(IN RT_HT_CAPABILITY * pRtHt, - IN UCHAR * pMcsSet, +void RTMPUpdateHTIE(IN RT_HT_CAPABILITY * pRtHt, + u8 * pMcsSet, OUT HT_CAPABILITY_IE * pHtCapability, OUT ADD_HT_INFO_IE * pAddHtInfo) { @@ -790,15 +790,15 @@ VOID RTMPUpdateHTIE(IN RT_HT_CAPABILITY * pRtHt, Return: ======================================================================== */ -VOID RTMPAddWcidAttributeEntry(IN PRTMP_ADAPTER pAd, - IN UCHAR BssIdx, - IN UCHAR KeyIdx, - IN UCHAR CipherAlg, IN MAC_TABLE_ENTRY * pEntry) +void RTMPAddWcidAttributeEntry(IN PRTMP_ADAPTER pAd, + u8 BssIdx, + u8 KeyIdx, + u8 CipherAlg, IN MAC_TABLE_ENTRY * pEntry) { - UINT32 WCIDAttri = 0; - USHORT offset; - UCHAR IVEIV = 0; - USHORT Wcid = 0; + u32 WCIDAttri = 0; + u16 offset; + u8 IVEIV = 0; + u16 Wcid = 0; { { @@ -872,7 +872,7 @@ Arguments: Note: ========================================================================== */ -PSTRING GetEncryptType(CHAR enc) +char *GetEncryptType(char enc) { if (enc == Ndis802_11WEPDisabled) return "NONE"; @@ -888,7 +888,7 @@ PSTRING GetEncryptType(CHAR enc) return "UNKNOW"; } -PSTRING GetAuthMode(CHAR auth) +char *GetAuthMode(char auth) { if (auth == Ndis802_11AuthModeOpen) return "OPEN"; @@ -914,7 +914,7 @@ PSTRING GetAuthMode(CHAR auth) return "UNKNOW"; } -INT SetCommonHT(IN PRTMP_ADAPTER pAd) +int SetCommonHT(IN PRTMP_ADAPTER pAd) { OID_SET_HT_PHYMODE SetHT; @@ -922,21 +922,21 @@ INT SetCommonHT(IN PRTMP_ADAPTER pAd) return FALSE; SetHT.PhyMode = pAd->CommonCfg.PhyMode; - SetHT.TransmitNo = ((UCHAR) pAd->Antenna.field.TxPath); - SetHT.HtMode = (UCHAR) pAd->CommonCfg.RegTransmitSetting.field.HTMODE; + SetHT.TransmitNo = ((u8)pAd->Antenna.field.TxPath); + SetHT.HtMode = (u8)pAd->CommonCfg.RegTransmitSetting.field.HTMODE; SetHT.ExtOffset = - (UCHAR) pAd->CommonCfg.RegTransmitSetting.field.EXTCHA; + (u8)pAd->CommonCfg.RegTransmitSetting.field.EXTCHA; SetHT.MCS = MCS_AUTO; - SetHT.BW = (UCHAR) pAd->CommonCfg.RegTransmitSetting.field.BW; - SetHT.STBC = (UCHAR) pAd->CommonCfg.RegTransmitSetting.field.STBC; - SetHT.SHORTGI = (UCHAR) pAd->CommonCfg.RegTransmitSetting.field.ShortGI; + SetHT.BW = (u8)pAd->CommonCfg.RegTransmitSetting.field.BW; + SetHT.STBC = (u8)pAd->CommonCfg.RegTransmitSetting.field.STBC; + SetHT.SHORTGI = (u8)pAd->CommonCfg.RegTransmitSetting.field.ShortGI; RTMPSetHT(pAd, &SetHT); return TRUE; } -PSTRING RTMPGetRalinkEncryModeStr(IN USHORT encryMode) +char *RTMPGetRalinkEncryModeStr(u16 encryMode) { switch (encryMode) { case Ndis802_11WEPDisabled: diff --git a/drivers/staging/rt2860/common/cmm_mac_pci.c b/drivers/staging/rt2860/common/cmm_mac_pci.c index 3b6f577a291..c7f4be1181c 100644 --- a/drivers/staging/rt2860/common/cmm_mac_pci.c +++ b/drivers/staging/rt2860/common/cmm_mac_pci.c @@ -48,16 +48,16 @@ ======================================================================== */ -NDIS_STATUS RTMPAllocTxRxRingMemory(IN PRTMP_ADAPTER pAd) +int RTMPAllocTxRxRingMemory(IN PRTMP_ADAPTER pAd) { - NDIS_STATUS Status = NDIS_STATUS_SUCCESS; - ULONG RingBasePaHigh; - ULONG RingBasePaLow; - PVOID RingBaseVa; - INT index, num; + int Status = NDIS_STATUS_SUCCESS; + unsigned long RingBasePaHigh; + unsigned long RingBasePaLow; + void *RingBaseVa; + int index, num; PTXD_STRUC pTxD; PRXD_STRUC pRxD; - ULONG ErrorValue = 0; + unsigned long ErrorValue = 0; PRTMP_TX_RING pTxRing; PRTMP_DMABUF pDmaBuf; PNDIS_PACKET pPacket; @@ -71,9 +71,9 @@ NDIS_STATUS RTMPAllocTxRxRingMemory(IN PRTMP_ADAPTER pAd) /* issue, I intentional set them all to 64 bytes. */ /* */ for (num = 0; num < NUM_OF_TX_RING; num++) { - ULONG BufBasePaHigh; - ULONG BufBasePaLow; - PVOID BufBaseVa; + unsigned long BufBasePaHigh; + unsigned long BufBasePaLow; + void *BufBaseVa; /* */ /* Allocate Tx ring descriptor's memory (5 TX rings = 4 ACs + 1 HCCA) */ @@ -171,12 +171,12 @@ NDIS_STATUS RTMPAllocTxRxRingMemory(IN PRTMP_ADAPTER pAd) /* advance to next ring descriptor address */ pTxD->DMADONE = 1; RingBasePaLow += TXD_SIZE; - RingBaseVa = (PUCHAR) RingBaseVa + TXD_SIZE; + RingBaseVa = (u8 *)RingBaseVa + TXD_SIZE; /* advance to next TxBuf address */ BufBasePaLow += TX_DMA_1ST_BUFFER_SIZE; BufBaseVa = - (PUCHAR) BufBaseVa + TX_DMA_1ST_BUFFER_SIZE; + (u8 *)BufBaseVa + TX_DMA_1ST_BUFFER_SIZE; } DBGPRINT(RT_DEBUG_TRACE, ("TxRing[%d]: total %d entry allocated\n", num, @@ -228,7 +228,7 @@ NDIS_STATUS RTMPAllocTxRxRingMemory(IN PRTMP_ADAPTER pAd) /* Offset to next ring descriptor address */ RingBasePaLow += TXD_SIZE; - RingBaseVa = (PUCHAR) RingBaseVa + TXD_SIZE; + RingBaseVa = (u8 *)RingBaseVa + TXD_SIZE; /* link the pre-allocated TxBuf to TXD */ pTxD = (PTXD_STRUC) pAd->MgmtRing.Cell[index].AllocVa; @@ -286,7 +286,7 @@ NDIS_STATUS RTMPAllocTxRxRingMemory(IN PRTMP_ADAPTER pAd) /* Offset to next ring descriptor address */ RingBasePaLow += RXD_SIZE; - RingBaseVa = (PUCHAR) RingBaseVa + RXD_SIZE; + RingBaseVa = (u8 *)RingBaseVa + RXD_SIZE; /* Setup Rx associated Buffer size & allocate share memory */ pDmaBuf = &pAd->RxRing.Cell[index].DmaBuf; @@ -400,7 +400,7 @@ NDIS_STATUS RTMPAllocTxRxRingMemory(IN PRTMP_ADAPTER pAd) ======================================================================== */ -VOID RTMPRingCleanUp(IN PRTMP_ADAPTER pAd, IN UCHAR RingType) +void RTMPRingCleanUp(IN PRTMP_ADAPTER pAd, u8 RingType) { PTXD_STRUC pTxD; PRXD_STRUC pRxD; @@ -409,7 +409,7 @@ VOID RTMPRingCleanUp(IN PRTMP_ADAPTER pAd, IN UCHAR RingType) int i; PRTMP_TX_RING pTxRing; unsigned long IrqFlags; - /*UINT32 RxSwReadIdx; */ + /*u32 RxSwReadIdx; */ DBGPRINT(RT_DEBUG_TRACE, ("RTMPRingCleanUp(RingIdx=%d, Pending-NDIS=%ld)\n", RingType, @@ -533,7 +533,7 @@ VOID RTMPRingCleanUp(IN PRTMP_ADAPTER pAd, IN UCHAR RingType) } } -VOID RTMPFreeTxRxRingMemory(IN PRTMP_ADAPTER pAd) +void RTMPFreeTxRxRingMemory(IN PRTMP_ADAPTER pAd) { int index, num, j; PRTMP_TX_RING pTxRing; @@ -667,7 +667,7 @@ Return Value: Note: ======================================================================== */ -VOID RT28XXDMADisable(IN RTMP_ADAPTER * pAd) +void RT28XXDMADisable(IN RTMP_ADAPTER * pAd) { WPDMA_GLO_CFG_STRUC GloCfg; @@ -691,7 +691,7 @@ Return Value: Note: ======================================================================== */ -VOID RT28XXDMAEnable(IN RTMP_ADAPTER * pAd) +void RT28XXDMAEnable(IN RTMP_ADAPTER * pAd) { WPDMA_GLO_CFG_STRUC GloCfg; int i = 0; @@ -721,10 +721,10 @@ VOID RT28XXDMAEnable(IN RTMP_ADAPTER * pAd) } -BOOLEAN AsicCheckCommanOk(IN PRTMP_ADAPTER pAd, IN UCHAR Command) +BOOLEAN AsicCheckCommanOk(IN PRTMP_ADAPTER pAd, u8 Command) { - UINT32 CmdStatus = 0, CID = 0, i; - UINT32 ThisCIDMask = 0; + u32 CmdStatus = 0, CID = 0, i; + u32 ThisCIDMask = 0; i = 0; do { @@ -794,15 +794,15 @@ Return Value: Note: ======================================================================== */ -VOID RT28xx_UpdateBeaconToAsic(IN RTMP_ADAPTER * pAd, - IN INT apidx, - IN ULONG FrameLen, IN ULONG UpdatePos) +void RT28xx_UpdateBeaconToAsic(IN RTMP_ADAPTER * pAd, + int apidx, + unsigned long FrameLen, unsigned long UpdatePos) { - ULONG CapInfoPos = 0; - UCHAR *ptr, *ptr_update, *ptr_capinfo; - UINT i; + unsigned long CapInfoPos = 0; + u8 *ptr, *ptr_update, *ptr_capinfo; + u32 i; BOOLEAN bBcnReq = FALSE; - UCHAR bcn_idx = 0; + u8 bcn_idx = 0; { DBGPRINT(RT_DEBUG_ERROR, @@ -821,10 +821,10 @@ VOID RT28xx_UpdateBeaconToAsic(IN RTMP_ADAPTER * pAd, RTMP_IO_WRITE32(pAd, pAd->BeaconOffset[bcn_idx] + i, 0x00); } else { - ptr = (PUCHAR) & pAd->BeaconTxWI; + ptr = (u8 *)& pAd->BeaconTxWI; for (i = 0; i < TXWI_SIZE; i += 4) /* 16-byte TXWI field */ { - UINT32 longptr = + u32 longptr = *ptr + (*(ptr + 1) << 8) + (*(ptr + 2) << 16) + (*(ptr + 3) << 24); RTMP_IO_WRITE32(pAd, pAd->BeaconOffset[bcn_idx] + i, @@ -853,7 +853,7 @@ VOID RT28xx_UpdateBeaconToAsic(IN RTMP_ADAPTER * pAd, } -VOID RT28xxPciStaAsicForceWakeup(IN PRTMP_ADAPTER pAd, IN BOOLEAN bFromTx) +void RT28xxPciStaAsicForceWakeup(IN PRTMP_ADAPTER pAd, IN BOOLEAN bFromTx) { AUTO_WAKEUP_STRUC AutoWakeupCfg; @@ -949,8 +949,8 @@ VOID RT28xxPciStaAsicForceWakeup(IN PRTMP_ADAPTER pAd, IN BOOLEAN bFromTx) DBGPRINT(RT_DEBUG_TRACE, ("<=======RT28xxPciStaAsicForceWakeup\n")); } -VOID RT28xxPciStaAsicSleepThenAutoWakeup(IN PRTMP_ADAPTER pAd, - IN USHORT TbttNumToNextWakeUp) +void RT28xxPciStaAsicSleepThenAutoWakeup(IN PRTMP_ADAPTER pAd, + u16 TbttNumToNextWakeUp) { BOOLEAN brc; @@ -960,7 +960,7 @@ VOID RT28xxPciStaAsicSleepThenAutoWakeup(IN PRTMP_ADAPTER pAd, } if (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_PCIE_DEVICE) && pAd->StaCfg.PSControl.field.EnableNewPS == TRUE) { - ULONG Now = 0; + unsigned long Now = 0; if (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_WAKEUP_NOW)) { DBGPRINT(RT_DEBUG_TRACE, ("waking up now!\n")); OPSTATUS_CLEAR_FLAG(pAd, fOP_STATUS_DOZE); @@ -1016,9 +1016,9 @@ VOID RT28xxPciStaAsicSleepThenAutoWakeup(IN PRTMP_ADAPTER pAd, } -VOID PsPollWakeExec(IN PVOID SystemSpecific1, - IN PVOID FunctionContext, - IN PVOID SystemSpecific2, IN PVOID SystemSpecific3) +void PsPollWakeExec(void *SystemSpecific1, + void *FunctionContext, + void *SystemSpecific2, void *SystemSpecific3) { RTMP_ADAPTER *pAd = (RTMP_ADAPTER *) FunctionContext; unsigned long flags; @@ -1044,9 +1044,9 @@ VOID PsPollWakeExec(IN PVOID SystemSpecific1, #endif /* PCIE_PS_SUPPORT // */ } -VOID RadioOnExec(IN PVOID SystemSpecific1, - IN PVOID FunctionContext, - IN PVOID SystemSpecific2, IN PVOID SystemSpecific3) +void RadioOnExec(void *SystemSpecific1, + void *FunctionContext, + void *SystemSpecific2, void *SystemSpecific3) { RTMP_ADAPTER *pAd = (RTMP_ADAPTER *) FunctionContext; RTMP_CHIP_OP *pChipOps = &pAd->chipOps; @@ -1164,11 +1164,11 @@ VOID RadioOnExec(IN PVOID SystemSpecific1, ========================================================================== */ -BOOLEAN RT28xxPciAsicRadioOn(IN PRTMP_ADAPTER pAd, IN UCHAR Level) +BOOLEAN RT28xxPciAsicRadioOn(IN PRTMP_ADAPTER pAd, u8 Level) { /*WPDMA_GLO_CFG_STRUC DmaCfg; */ BOOLEAN Cancelled; - /*UINT32 MACValue; */ + /*u32 MACValue; */ if (pAd->OpMode == OPMODE_AP && Level == DOT11POWERSAVE) return FALSE; @@ -1287,15 +1287,15 @@ BOOLEAN RT28xxPciAsicRadioOn(IN PRTMP_ADAPTER pAd, IN UCHAR Level) ========================================================================== */ BOOLEAN RT28xxPciAsicRadioOff(IN PRTMP_ADAPTER pAd, - IN UCHAR Level, IN USHORT TbttNumToNextWakeUp) + u8 Level, u16 TbttNumToNextWakeUp) { WPDMA_GLO_CFG_STRUC DmaCfg; - UCHAR i, tempBBP_R3 = 0; + u8 i, tempBBP_R3 = 0; BOOLEAN brc = FALSE, Cancelled; - UINT32 TbTTTime = 0; - UINT32 PsPollTime = 0 /*, MACValue */ ; - ULONG BeaconPeriodTime; - UINT32 RxDmaIdx, RxCpuIdx; + u32 TbTTTime = 0; + u32 PsPollTime = 0 /*, MACValue */ ; + unsigned long BeaconPeriodTime; + u32 RxDmaIdx, RxCpuIdx; DBGPRINT(RT_DEBUG_TRACE, ("AsicRadioOff ===> Lv= %d, TxCpuIdx = %d, TxDmaIdx = %d. RxCpuIdx = %d, RxDmaIdx = %d.\n", Level, pAd->TxRing[0].TxCpuIdx, pAd->TxRing[0].TxDmaIdx, @@ -1497,7 +1497,7 @@ BOOLEAN RT28xxPciAsicRadioOff(IN PRTMP_ADAPTER pAd, return TRUE; } -VOID RT28xxPciMlmeRadioOn(IN PRTMP_ADAPTER pAd) +void RT28xxPciMlmeRadioOn(IN PRTMP_ADAPTER pAd) { if (!RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_RADIO_OFF)) return; @@ -1546,7 +1546,7 @@ VOID RT28xxPciMlmeRadioOn(IN PRTMP_ADAPTER pAd) } } -VOID RT28xxPciMlmeRadioOFF(IN PRTMP_ADAPTER pAd) +void RT28xxPciMlmeRadioOFF(IN PRTMP_ADAPTER pAd) { BOOLEAN brc = TRUE; diff --git a/drivers/staging/rt2860/common/cmm_mac_usb.c b/drivers/staging/rt2860/common/cmm_mac_usb.c index 70e47db7cd5..d5bc37d8279 100644 --- a/drivers/staging/rt2860/common/cmm_mac_usb.c +++ b/drivers/staging/rt2860/common/cmm_mac_usb.c @@ -48,10 +48,10 @@ Note: NDIS packet descriptor. ======================================================================== */ -NDIS_STATUS NICInitRecv(IN PRTMP_ADAPTER pAd) +int NICInitRecv(IN PRTMP_ADAPTER pAd) { - UCHAR i; - NDIS_STATUS Status = NDIS_STATUS_SUCCESS; + u8 i; + int Status = NDIS_STATUS_SUCCESS; POS_COOKIE pObj = (POS_COOKIE) pAd->OS_Cookie; DBGPRINT(RT_DEBUG_TRACE, ("--> NICInitRecv\n")); @@ -132,7 +132,7 @@ Return Value: Note: ======================================================================== */ -NDIS_STATUS NICInitTransmit(IN PRTMP_ADAPTER pAd) +int NICInitTransmit(IN PRTMP_ADAPTER pAd) { #define LM_USB_ALLOC(pObj, Context, TB_Type, BufferSize, Status, msg1, err1, msg2, err2) \ Context->pUrb = RTUSB_ALLOC_URB(0); \ @@ -159,15 +159,15 @@ NDIS_STATUS NICInitTransmit(IN PRTMP_ADAPTER pAd) Context->data_dma); \ Context->TransferBuffer = NULL; } - UCHAR i, acidx; - NDIS_STATUS Status = NDIS_STATUS_SUCCESS; + u8 i, acidx; + int Status = NDIS_STATUS_SUCCESS; PTX_CONTEXT pNullContext = &(pAd->NullContext); PTX_CONTEXT pPsPollContext = &(pAd->PsPollContext); PTX_CONTEXT pRTSContext = &(pAd->RTSContext); PTX_CONTEXT pMLMEContext = NULL; /* PHT_TX_CONTEXT pHTTXContext = NULL; */ POS_COOKIE pObj = (POS_COOKIE) pAd->OS_Cookie; - PVOID RingBaseVa; + void *RingBaseVa; /* RTMP_TX_RING *pTxRing; */ RTMP_MGMT_RING *pMgmtRing; @@ -233,7 +233,7 @@ NDIS_STATUS NICInitTransmit(IN PRTMP_ADAPTER pAd) /* Allocate MGMT ring descriptor's memory */ pAd->MgmtDescRing.AllocSize = MGMT_RING_SIZE * sizeof(TX_CONTEXT); - os_alloc_mem(pAd, (PUCHAR *) (&pAd->MgmtDescRing.AllocVa), + os_alloc_mem(pAd, (u8 **) (&pAd->MgmtDescRing.AllocVa), pAd->MgmtDescRing.AllocSize); if (pAd->MgmtDescRing.AllocVa == NULL) { DBGPRINT_ERR(("Failed to allocate a big buffer for MgmtDescRing!\n")); @@ -274,7 +274,7 @@ NDIS_STATUS NICInitTransmit(IN PRTMP_ADAPTER pAd) pMLMEContext->SelfIdx = i; /* Offset to next ring descriptor address */ - RingBaseVa = (PUCHAR) RingBaseVa + sizeof(TX_CONTEXT); + RingBaseVa = (u8 *)RingBaseVa + sizeof(TX_CONTEXT); } DBGPRINT(RT_DEBUG_TRACE, ("MGMT Ring: total %d entry allocated\n", i)); @@ -428,11 +428,11 @@ Return Value: Note: ======================================================================== */ -NDIS_STATUS RTMPAllocTxRxRingMemory(IN PRTMP_ADAPTER pAd) +int RTMPAllocTxRxRingMemory(IN PRTMP_ADAPTER pAd) { /* COUNTER_802_11 pCounter = &pAd->WlanCounters; */ - NDIS_STATUS Status; - INT num; + int Status; + int num; DBGPRINT(RT_DEBUG_TRACE, ("--> RTMPAllocTxRxRingMemory\n")); @@ -519,7 +519,7 @@ Return Value: Note: ======================================================================== */ -VOID RTMPFreeTxRxRingMemory(IN PRTMP_ADAPTER pAd) +void RTMPFreeTxRxRingMemory(IN PRTMP_ADAPTER pAd) { #define LM_URB_FREE(pObj, Context, BufferSize) \ if (NULL != Context->pUrb) { \ @@ -532,7 +532,7 @@ VOID RTMPFreeTxRxRingMemory(IN PRTMP_ADAPTER pAd) Context->data_dma); \ Context->TransferBuffer = NULL; } - UINT i, acidx; + u32 i, acidx; PTX_CONTEXT pNullContext = &pAd->NullContext; PTX_CONTEXT pPsPollContext = &pAd->PsPollContext; PTX_CONTEXT pRTSContext = &pAd->RTSContext; @@ -636,11 +636,11 @@ Return Value: Note: ======================================================================== */ -NDIS_STATUS RTUSBWriteHWMACAddress(IN PRTMP_ADAPTER pAd) +int RTUSBWriteHWMACAddress(IN PRTMP_ADAPTER pAd) { MAC_DW0_STRUC StaMacReg0; MAC_DW1_STRUC StaMacReg1; - NDIS_STATUS Status = NDIS_STATUS_SUCCESS; + int Status = NDIS_STATUS_SUCCESS; LARGE_INTEGER NOW; /* initialize the random number generator */ @@ -687,7 +687,7 @@ Return Value: Note: ======================================================================== */ -VOID RT28XXDMADisable(IN RTMP_ADAPTER * pAd) +void RT28XXDMADisable(IN RTMP_ADAPTER * pAd) { /* no use */ } @@ -706,7 +706,7 @@ Return Value: Note: ======================================================================== */ -VOID RT28XXDMAEnable(IN RTMP_ADAPTER * pAd) +void RT28XXDMAEnable(IN RTMP_ADAPTER * pAd) { WPDMA_GLO_CFG_STRUC GloCfg; USB_DMA_CFG_STRUC UsbCfg; @@ -767,18 +767,18 @@ Return Value: Note: ======================================================================== */ -VOID RT28xx_UpdateBeaconToAsic(IN RTMP_ADAPTER * pAd, - IN INT apidx, - IN ULONG FrameLen, IN ULONG UpdatePos) +void RT28xx_UpdateBeaconToAsic(IN RTMP_ADAPTER * pAd, + int apidx, + unsigned long FrameLen, unsigned long UpdatePos) { - PUCHAR pBeaconFrame = NULL; - UCHAR *ptr; - UINT i, padding; + u8 *pBeaconFrame = NULL; + u8 *ptr; + u32 i, padding; BEACON_SYNC_STRUCT *pBeaconSync = pAd->CommonCfg.pBeaconSync; - UINT32 longValue; -/* USHORT shortValue; */ + u32 longValue; +/* u16 shortValue; */ BOOLEAN bBcnReq = FALSE; - UCHAR bcn_idx = 0; + u8 bcn_idx = 0; if (pBeaconFrame == NULL) { DBGPRINT(RT_DEBUG_ERROR, ("pBeaconFrame is NULL!\n")); @@ -803,7 +803,7 @@ VOID RT28xx_UpdateBeaconToAsic(IN RTMP_ADAPTER * pAd, (~(BEACON_BITMAP_MASK & (1 << bcn_idx))); NdisZeroMemory(pBeaconSync->BeaconTxWI[bcn_idx], TXWI_SIZE); } else { - ptr = (PUCHAR) & pAd->BeaconTxWI; + ptr = (u8 *)& pAd->BeaconTxWI; if (NdisEqualMemory(pBeaconSync->BeaconTxWI[bcn_idx], &pAd->BeaconTxWI, TXWI_SIZE) == FALSE) { /* If BeaconTxWI changed, we need to rewrite the TxWI for the Beacon frames. */ pBeaconSync->BeaconBitMap &= (~(BEACON_BITMAP_MASK & (1 << bcn_idx))); @@ -827,7 +827,7 @@ VOID RT28xx_UpdateBeaconToAsic(IN RTMP_ADAPTER * pAd, ptr = pBeaconSync->BeaconBuf[bcn_idx]; padding = (FrameLen & 0x01); - NdisZeroMemory((PUCHAR) (pBeaconFrame + FrameLen), padding); + NdisZeroMemory((u8 *)(pBeaconFrame + FrameLen), padding); FrameLen += padding; for (i = 0; i < FrameLen /*HW_BEACON_OFFSET */ ; i += 2) { if (NdisEqualMemory(ptr, pBeaconFrame, 2) == FALSE) { @@ -849,7 +849,7 @@ VOID RT28xx_UpdateBeaconToAsic(IN RTMP_ADAPTER * pAd, } -VOID RTUSBBssBeaconStop(IN RTMP_ADAPTER * pAd) +void RTUSBBssBeaconStop(IN RTMP_ADAPTER * pAd) { BEACON_SYNC_STRUCT *pBeaconSync; int i, offset; @@ -857,7 +857,7 @@ VOID RTUSBBssBeaconStop(IN RTMP_ADAPTER * pAd) pBeaconSync = pAd->CommonCfg.pBeaconSync; if (pBeaconSync && pBeaconSync->EnableBeacon) { - INT NumOfBcn; + int NumOfBcn; { NumOfBcn = MAX_MESH_NUM; @@ -883,7 +883,7 @@ VOID RTUSBBssBeaconStop(IN RTMP_ADAPTER * pAd) } } -VOID RTUSBBssBeaconStart(IN RTMP_ADAPTER * pAd) +void RTUSBBssBeaconStart(IN RTMP_ADAPTER * pAd) { int apidx; BEACON_SYNC_STRUCT *pBeaconSync; @@ -891,15 +891,15 @@ VOID RTUSBBssBeaconStart(IN RTMP_ADAPTER * pAd) pBeaconSync = pAd->CommonCfg.pBeaconSync; if (pBeaconSync && pBeaconSync->EnableBeacon) { - INT NumOfBcn; + int NumOfBcn; { NumOfBcn = MAX_MESH_NUM; } for (apidx = 0; apidx < NumOfBcn; apidx++) { - UCHAR CapabilityInfoLocationInBeacon = 0; - UCHAR TimIELocationInBeacon = 0; + u8 CapabilityInfoLocationInBeacon = 0; + u8 TimIELocationInBeacon = 0; NdisZeroMemory(pBeaconSync->BeaconBuf[apidx], HW_BEACON_OFFSET); @@ -929,12 +929,12 @@ VOID RTUSBBssBeaconStart(IN RTMP_ADAPTER * pAd) } } -VOID RTUSBBssBeaconInit(IN RTMP_ADAPTER * pAd) +void RTUSBBssBeaconInit(IN RTMP_ADAPTER * pAd) { BEACON_SYNC_STRUCT *pBeaconSync; int i; - os_alloc_mem(pAd, (PUCHAR *) (&pAd->CommonCfg.pBeaconSync), + os_alloc_mem(pAd, (u8 **) (&pAd->CommonCfg.pBeaconSync), sizeof(BEACON_SYNC_STRUCT)); /*NdisAllocMemory(pAd->CommonCfg.pBeaconSync, sizeof(BEACON_SYNC_STRUCT), MEM_ALLOC_FLAG); */ if (pAd->CommonCfg.pBeaconSync) { @@ -954,7 +954,7 @@ VOID RTUSBBssBeaconInit(IN RTMP_ADAPTER * pAd) } } -VOID RTUSBBssBeaconExit(IN RTMP_ADAPTER * pAd) +void RTUSBBssBeaconExit(IN RTMP_ADAPTER * pAd) { BEACON_SYNC_STRUCT *pBeaconSync; BOOLEAN Cancelled = TRUE; @@ -997,13 +997,13 @@ VOID RTUSBBssBeaconExit(IN RTMP_ADAPTER * pAd) ======================================================================== */ -VOID BeaconUpdateExec(IN PVOID SystemSpecific1, - IN PVOID FunctionContext, - IN PVOID SystemSpecific2, IN PVOID SystemSpecific3) +void BeaconUpdateExec(void *SystemSpecific1, + void *FunctionContext, + void *SystemSpecific2, void *SystemSpecific3) { PRTMP_ADAPTER pAd = (PRTMP_ADAPTER) FunctionContext; LARGE_INTEGER tsfTime_a; /*, tsfTime_b, deltaTime_exp, deltaTime_ab; */ - UINT32 delta, delta2MS, period2US, remain, remain_low, remain_high; + u32 delta, delta2MS, period2US, remain, remain_low, remain_high; /* BOOLEAN positive; */ if (pAd->CommonCfg.IsUpdateBeacon == TRUE) { @@ -1038,7 +1038,7 @@ VOID BeaconUpdateExec(IN PVOID SystemSpecific1, * 2870 Radio on/off Related functions. * ********************************************************************/ -VOID RT28xxUsbMlmeRadioOn(IN PRTMP_ADAPTER pAd) +void RT28xxUsbMlmeRadioOn(IN PRTMP_ADAPTER pAd) { RTMP_CHIP_OP *pChipOps = &pAd->chipOps; @@ -1068,10 +1068,10 @@ VOID RT28xxUsbMlmeRadioOn(IN PRTMP_ADAPTER pAd) RTMPSetLED(pAd, LED_RADIO_ON); } -VOID RT28xxUsbMlmeRadioOFF(IN PRTMP_ADAPTER pAd) +void RT28xxUsbMlmeRadioOFF(IN PRTMP_ADAPTER pAd) { WPDMA_GLO_CFG_STRUC GloCfg; - UINT32 Value, i; + u32 Value, i; DBGPRINT(RT_DEBUG_TRACE, ("RT28xxUsbMlmeRadioOFF()\n")); diff --git a/drivers/staging/rt2860/common/cmm_sanity.c b/drivers/staging/rt2860/common/cmm_sanity.c index bd1202532aa..16cc31af325 100644 --- a/drivers/staging/rt2860/common/cmm_sanity.c +++ b/drivers/staging/rt2860/common/cmm_sanity.c @@ -36,16 +36,16 @@ */ #include "../rt_config.h" -extern UCHAR CISCO_OUI[]; +extern u8 CISCO_OUI[]; -extern UCHAR WPA_OUI[]; -extern UCHAR RSN_OUI[]; -extern UCHAR WME_INFO_ELEM[]; -extern UCHAR WME_PARM_ELEM[]; -extern UCHAR Ccx2QosInfo[]; -extern UCHAR RALINK_OUI[]; -extern UCHAR BROADCOM_OUI[]; -extern UCHAR WPS_OUI[]; +extern u8 WPA_OUI[]; +extern u8 RSN_OUI[]; +extern u8 WME_INFO_ELEM[]; +extern u8 WME_PARM_ELEM[]; +extern u8 Ccx2QosInfo[]; +extern u8 RALINK_OUI[]; +extern u8 BROADCOM_OUI[]; +extern u8 WPS_OUI[]; /* ========================================================================== @@ -59,7 +59,7 @@ extern UCHAR WPS_OUI[]; ========================================================================== */ BOOLEAN MlmeAddBAReqSanity(IN PRTMP_ADAPTER pAd, - IN VOID * Msg, IN ULONG MsgLen, OUT PUCHAR pAddr2) + void * Msg, unsigned long MsgLen, u8 *pAddr2) { PMLME_ADDBA_REQ_STRUCT pInfo; @@ -97,7 +97,7 @@ BOOLEAN MlmeAddBAReqSanity(IN PRTMP_ADAPTER pAd, ========================================================================== */ -BOOLEAN MlmeDelBAReqSanity(IN PRTMP_ADAPTER pAd, IN VOID * Msg, IN ULONG MsgLen) +BOOLEAN MlmeDelBAReqSanity(IN PRTMP_ADAPTER pAd, void * Msg, unsigned long MsgLen) { MLME_DELBA_REQ_STRUCT *pInfo; pInfo = (MLME_DELBA_REQ_STRUCT *) Msg; @@ -132,8 +132,8 @@ BOOLEAN MlmeDelBAReqSanity(IN PRTMP_ADAPTER pAd, IN VOID * Msg, IN ULONG MsgLen) } BOOLEAN PeerAddBAReqActionSanity(IN PRTMP_ADAPTER pAd, - IN VOID * pMsg, - IN ULONG MsgLen, OUT PUCHAR pAddr2) + void * pMsg, + unsigned long MsgLen, u8 *pAddr2) { PFRAME_802_11 pFrame = (PFRAME_802_11) pMsg; PFRAME_ADDBA_REQ pAddFrame; @@ -145,8 +145,8 @@ BOOLEAN PeerAddBAReqActionSanity(IN PRTMP_ADAPTER pAd, return FALSE; } /* we support immediate BA. */ - *(USHORT *) (&pAddFrame->BaParm) = - cpu2le16(*(USHORT *) (&pAddFrame->BaParm)); + *(u16 *) (&pAddFrame->BaParm) = + cpu2le16(*(u16 *) (&pAddFrame->BaParm)); pAddFrame->TimeOutValue = cpu2le16(pAddFrame->TimeOutValue); pAddFrame->BaStartSeq.word = cpu2le16(pAddFrame->BaStartSeq.word); @@ -172,7 +172,7 @@ BOOLEAN PeerAddBAReqActionSanity(IN PRTMP_ADAPTER pAd, } BOOLEAN PeerAddBARspActionSanity(IN PRTMP_ADAPTER pAd, - IN VOID * pMsg, IN ULONG MsgLen) + void * pMsg, unsigned long MsgLen) { PFRAME_ADDBA_RSP pAddFrame; @@ -184,8 +184,8 @@ BOOLEAN PeerAddBARspActionSanity(IN PRTMP_ADAPTER pAd, return FALSE; } /* we support immediate BA. */ - *(USHORT *) (&pAddFrame->BaParm) = - cpu2le16(*(USHORT *) (&pAddFrame->BaParm)); + *(u16 *) (&pAddFrame->BaParm) = + cpu2le16(*(u16 *) (&pAddFrame->BaParm)); pAddFrame->StatusCode = cpu2le16(pAddFrame->StatusCode); pAddFrame->TimeOutValue = cpu2le16(pAddFrame->TimeOutValue); @@ -207,7 +207,7 @@ BOOLEAN PeerAddBARspActionSanity(IN PRTMP_ADAPTER pAd, } BOOLEAN PeerDelBAActionSanity(IN PRTMP_ADAPTER pAd, - IN UCHAR Wcid, IN VOID * pMsg, IN ULONG MsgLen) + u8 Wcid, void * pMsg, unsigned long MsgLen) { /*PFRAME_802_11 pFrame = (PFRAME_802_11)pMsg; */ PFRAME_DELBA_REQ pDelFrame; @@ -219,8 +219,8 @@ BOOLEAN PeerDelBAActionSanity(IN PRTMP_ADAPTER pAd, pDelFrame = (PFRAME_DELBA_REQ) (pMsg); - *(USHORT *) (&pDelFrame->DelbaParm) = - cpu2le16(*(USHORT *) (&pDelFrame->DelbaParm)); + *(u16 *) (&pDelFrame->DelbaParm) = + cpu2le16(*(u16 *) (&pDelFrame->DelbaParm)); pDelFrame->ReasonCode = cpu2le16(pDelFrame->ReasonCode); if (pDelFrame->DelbaParm.TID & 0xfff0) @@ -240,24 +240,24 @@ BOOLEAN PeerDelBAActionSanity(IN PRTMP_ADAPTER pAd, ========================================================================== */ -BOOLEAN PeerBeaconAndProbeRspSanity(IN PRTMP_ADAPTER pAd, IN VOID * Msg, IN ULONG MsgLen, IN UCHAR MsgChannel, OUT PUCHAR pAddr2, OUT PUCHAR pBssid, OUT CHAR Ssid[], OUT UCHAR * pSsidLen, OUT UCHAR * pBssType, OUT USHORT * pBeaconPeriod, OUT UCHAR * pChannel, OUT UCHAR * pNewChannel, OUT LARGE_INTEGER * pTimestamp, OUT CF_PARM * pCfParm, OUT USHORT * pAtimWin, OUT USHORT * pCapabilityInfo, OUT UCHAR * pErp, OUT UCHAR * pDtimCount, OUT UCHAR * pDtimPeriod, OUT UCHAR * pBcastFlag, OUT UCHAR * pMessageToMe, OUT UCHAR SupRate[], OUT UCHAR * pSupRateLen, OUT UCHAR ExtRate[], OUT UCHAR * pExtRateLen, OUT UCHAR * pCkipFlag, OUT UCHAR * pAironetCellPowerLimit, OUT PEDCA_PARM pEdcaParm, OUT PQBSS_LOAD_PARM pQbssLoad, OUT PQOS_CAPABILITY_PARM pQosCapability, OUT ULONG * pRalinkIe, OUT UCHAR * pHtCapabilityLen, OUT UCHAR * pPreNHtCapabilityLen, OUT HT_CAPABILITY_IE * pHtCapability, OUT UCHAR * AddHtInfoLen, OUT ADD_HT_INFO_IE * AddHtInfo, OUT UCHAR * NewExtChannelOffset, /* Ht extension channel offset(above or below) */ - OUT USHORT * LengthVIE, +BOOLEAN PeerBeaconAndProbeRspSanity(IN PRTMP_ADAPTER pAd, void * Msg, unsigned long MsgLen, u8 MsgChannel, u8 *pAddr2, u8 *pBssid, char Ssid[], u8 * pSsidLen, u8 * pBssType, u16 * pBeaconPeriod, u8 * pChannel, u8 * pNewChannel, OUT LARGE_INTEGER * pTimestamp, OUT CF_PARM * pCfParm, u16 * pAtimWin, u16 * pCapabilityInfo, u8 * pErp, u8 * pDtimCount, u8 * pDtimPeriod, u8 * pBcastFlag, u8 * pMessageToMe, u8 SupRate[], u8 * pSupRateLen, u8 ExtRate[], u8 * pExtRateLen, u8 * pCkipFlag, u8 * pAironetCellPowerLimit, OUT PEDCA_PARM pEdcaParm, OUT PQBSS_LOAD_PARM pQbssLoad, OUT PQOS_CAPABILITY_PARM pQosCapability, unsigned long * pRalinkIe, u8 * pHtCapabilityLen, u8 * pPreNHtCapabilityLen, OUT HT_CAPABILITY_IE * pHtCapability, u8 * AddHtInfoLen, OUT ADD_HT_INFO_IE * AddHtInfo, u8 * NewExtChannelOffset, /* Ht extension channel offset(above or below) */ + u16 * LengthVIE, OUT PNDIS_802_11_VARIABLE_IEs pVIE) { - UCHAR *Ptr; - UCHAR TimLen; + u8 *Ptr; + u8 TimLen; PFRAME_802_11 pFrame; PEID_STRUCT pEid; - UCHAR SubType; - UCHAR Sanity; - /*UCHAR ECWMin, ECWMax; */ + u8 SubType; + u8 Sanity; + /*u8 ECWMin, ECWMax; */ /*MAC_CSR9_STRUC Csr9; */ - ULONG Length = 0; + unsigned long Length = 0; /* For some 11a AP which didn't have DS_IE, we use two conditions to decide the channel */ /* 1. If the AP is 11n enabled, then check the control channel. */ /* 2. If the AP didn't have any info about channel, use the channel we received this frame as the channel. (May inaccuracy!!) */ - UCHAR CtrlChannel = 0; + u8 CtrlChannel = 0; /* Add for 3 necessary EID field check */ Sanity = 0; @@ -287,7 +287,7 @@ BOOLEAN PeerBeaconAndProbeRspSanity(IN PRTMP_ADAPTER pAd, IN VOID * Msg, IN ULON pFrame = (PFRAME_802_11) Msg; /* get subtype from header */ - SubType = (UCHAR) pFrame->Hdr.FC.SubType; + SubType = (u8)pFrame->Hdr.FC.SubType; /* get Addr2 and BSSID from header */ COPY_MAC_ADDR(pAddr2, pFrame->Hdr.Addr2); @@ -377,17 +377,17 @@ BOOLEAN PeerBeaconAndProbeRspSanity(IN PRTMP_ADAPTER pAd, IN VOID * Msg, IN ULON sizeof(HT_CAPABILITY_IE)); *pHtCapabilityLen = SIZE_HT_CAP_IE; /* Nnow we only support 26 bytes. */ - *(USHORT *) (&pHtCapability->HtCapInfo) = - cpu2le16(*(USHORT *) + *(u16 *) (&pHtCapability->HtCapInfo) = + cpu2le16(*(u16 *) (&pHtCapability->HtCapInfo)); - *(USHORT *) (&pHtCapability->ExtHtCapInfo) = - cpu2le16(*(USHORT *) + *(u16 *) (&pHtCapability->ExtHtCapInfo) = + cpu2le16(*(u16 *) (&pHtCapability->ExtHtCapInfo)); { *pPreNHtCapabilityLen = 0; /* Nnow we only support 26 bytes. */ - Ptr = (PUCHAR) pVIE; + Ptr = (u8 *)pVIE; NdisMoveMemory(Ptr + *LengthVIE, &pEid->Eid, pEid->Len + 2); @@ -410,15 +410,15 @@ BOOLEAN PeerBeaconAndProbeRspSanity(IN PRTMP_ADAPTER pAd, IN VOID * Msg, IN ULON CtrlChannel = AddHtInfo->ControlChan; - *(USHORT *) (&AddHtInfo->AddHtInfo2) = - cpu2le16(*(USHORT *) + *(u16 *) (&AddHtInfo->AddHtInfo2) = + cpu2le16(*(u16 *) (&AddHtInfo->AddHtInfo2)); - *(USHORT *) (&AddHtInfo->AddHtInfo3) = - cpu2le16(*(USHORT *) + *(u16 *) (&AddHtInfo->AddHtInfo3) = + cpu2le16(*(u16 *) (&AddHtInfo->AddHtInfo3)); { - Ptr = (PUCHAR) pVIE; + Ptr = (u8 *)pVIE; NdisMoveMemory(Ptr + *LengthVIE, &pEid->Eid, pEid->Len + 2); @@ -493,7 +493,7 @@ BOOLEAN PeerBeaconAndProbeRspSanity(IN PRTMP_ADAPTER pAd, IN VOID * Msg, IN ULON case IE_TIM: if (INFRA_ON(pAd) && SubType == SUBTYPE_BEACON) { - GetTimBit((PCHAR) pEid, pAd->StaActive.Aid, + GetTimBit((char *)pEid, pAd->StaActive.Aid, &TimLen, pBcastFlag, pDtimCount, pDtimPeriod, pMessageToMe); } @@ -565,14 +565,14 @@ BOOLEAN PeerBeaconAndProbeRspSanity(IN PRTMP_ADAPTER pAd, IN VOID * Msg, IN ULON } } else if (NdisEqualMemory(pEid->Octet, WPA_OUI, 4)) { /* Copy to pVIE which will report to microsoft bssid list. */ - Ptr = (PUCHAR) pVIE; + Ptr = (u8 *)pVIE; NdisMoveMemory(Ptr + *LengthVIE, &pEid->Eid, pEid->Len + 2); *LengthVIE += (pEid->Len + 2); } else if (NdisEqualMemory(pEid->Octet, WME_PARM_ELEM, 6) && (pEid->Len == 24)) { - PUCHAR ptr; + u8 *ptr; int i; /* parsing EDCA parameters */ @@ -586,7 +586,7 @@ BOOLEAN PeerBeaconAndProbeRspSanity(IN PRTMP_ADAPTER pAd, IN VOID * Msg, IN ULON (pEid->Octet[6] & 0x80) ? 1 : 0; ptr = &pEid->Octet[8]; for (i = 0; i < 4; i++) { - UCHAR aci = (*ptr & 0x60) >> 5; /* b5~6 is AC INDEX */ + u8 aci = (*ptr & 0x60) >> 5; /* b5~6 is AC INDEX */ pEdcaParm->bACM[aci] = (((*ptr) & 0x10) == 0x10); /* b5 is ACM */ pEdcaParm->Aifsn[aci] = (*ptr) & 0x0f; /* b0~3 is AIFSN */ pEdcaParm->Cwmin[aci] = *(ptr + 1) & 0x0f; /* b0~4 is Cwmin */ @@ -653,7 +653,7 @@ BOOLEAN PeerBeaconAndProbeRspSanity(IN PRTMP_ADAPTER pAd, IN VOID * Msg, IN ULON case IE_ERP: if (pEid->Len == 1) { - *pErp = (UCHAR) pEid->Octet[0]; + *pErp = (u8)pEid->Octet[0]; } break; @@ -684,7 +684,7 @@ BOOLEAN PeerBeaconAndProbeRspSanity(IN PRTMP_ADAPTER pAd, IN VOID * Msg, IN ULON /* There is no OUI for version anymore, check the group cipher OUI before copying */ if (RTMPEqualMemory(pEid->Octet + 2, RSN_OUI, 3)) { /* Copy to pVIE which will report to microsoft bssid list. */ - Ptr = (PUCHAR) pVIE; + Ptr = (u8 *)pVIE; NdisMoveMemory(Ptr + *LengthVIE, &pEid->Eid, pEid->Len + 2); *LengthVIE += (pEid->Len + 2); @@ -696,12 +696,12 @@ BOOLEAN PeerBeaconAndProbeRspSanity(IN PRTMP_ADAPTER pAd, IN VOID * Msg, IN ULON } Length = Length + 2 + pEid->Len; /* Eid[1] + Len[1]+ content[Len] */ - pEid = (PEID_STRUCT) ((UCHAR *) pEid + 2 + pEid->Len); + pEid = (PEID_STRUCT) ((u8 *) pEid + 2 + pEid->Len); } /* For some 11a AP. it did not have the channel EID, patch here */ { - UCHAR LatchRfChannel = MsgChannel; + u8 LatchRfChannel = MsgChannel; if ((pAd->LatchRfRegs.Channel > 14) && ((Sanity & 0x4) == 0)) { if (CtrlChannel != 0) *pChannel = CtrlChannel; @@ -731,11 +731,11 @@ BOOLEAN PeerBeaconAndProbeRspSanity(IN PRTMP_ADAPTER pAd, IN VOID * Msg, IN ULON ========================================================================== */ BOOLEAN MlmeScanReqSanity(IN PRTMP_ADAPTER pAd, - IN VOID * Msg, - IN ULONG MsgLen, - OUT UCHAR * pBssType, - OUT CHAR Ssid[], - OUT UCHAR * pSsidLen, OUT UCHAR * pScanType) + void * Msg, + unsigned long MsgLen, + u8 * pBssType, + char Ssid[], + u8 * pSsidLen, u8 * pScanType) { MLME_SCAN_REQ_STRUCT *Info; @@ -757,7 +757,7 @@ BOOLEAN MlmeScanReqSanity(IN PRTMP_ADAPTER pAd, } /* IRQL = DISPATCH_LEVEL */ -UCHAR ChannelSanity(IN PRTMP_ADAPTER pAd, IN UCHAR channel) +u8 ChannelSanity(IN PRTMP_ADAPTER pAd, u8 channel) { int i; @@ -780,9 +780,9 @@ UCHAR ChannelSanity(IN PRTMP_ADAPTER pAd, IN UCHAR channel) ========================================================================== */ BOOLEAN PeerDeauthSanity(IN PRTMP_ADAPTER pAd, - IN VOID * Msg, - IN ULONG MsgLen, - OUT PUCHAR pAddr2, OUT USHORT * pReason) + void * Msg, + unsigned long MsgLen, + u8 *pAddr2, u16 * pReason) { PFRAME_802_11 pFrame = (PFRAME_802_11) Msg; @@ -804,12 +804,12 @@ BOOLEAN PeerDeauthSanity(IN PRTMP_ADAPTER pAd, ========================================================================== */ BOOLEAN PeerAuthSanity(IN PRTMP_ADAPTER pAd, - IN VOID * Msg, - IN ULONG MsgLen, - OUT PUCHAR pAddr, - OUT USHORT * pAlg, - OUT USHORT * pSeq, - OUT USHORT * pStatus, CHAR * pChlgText) + void * Msg, + unsigned long MsgLen, + u8 *pAddr, + u16 * pAlg, + u16 * pSeq, + u16 * pStatus, char * pChlgText) { PFRAME_802_11 pFrame = (PFRAME_802_11) Msg; @@ -854,10 +854,10 @@ BOOLEAN PeerAuthSanity(IN PRTMP_ADAPTER pAd, ========================================================================== */ BOOLEAN MlmeAuthReqSanity(IN PRTMP_ADAPTER pAd, - IN VOID * Msg, - IN ULONG MsgLen, - OUT PUCHAR pAddr, - OUT ULONG * pTimeout, OUT USHORT * pAlg) + void * Msg, + unsigned long MsgLen, + u8 *pAddr, + unsigned long * pTimeout, u16 * pAlg) { MLME_AUTH_REQ_STRUCT *pInfo; @@ -888,11 +888,11 @@ BOOLEAN MlmeAuthReqSanity(IN PRTMP_ADAPTER pAd, ========================================================================== */ BOOLEAN MlmeAssocReqSanity(IN PRTMP_ADAPTER pAd, - IN VOID * Msg, - IN ULONG MsgLen, - OUT PUCHAR pApAddr, - OUT USHORT * pCapabilityInfo, - OUT ULONG * pTimeout, OUT USHORT * pListenIntv) + void * Msg, + unsigned long MsgLen, + u8 *pApAddr, + u16 * pCapabilityInfo, + unsigned long * pTimeout, u16 * pListenIntv) { MLME_ASSOC_REQ_STRUCT *pInfo; @@ -917,9 +917,9 @@ BOOLEAN MlmeAssocReqSanity(IN PRTMP_ADAPTER pAd, ========================================================================== */ BOOLEAN PeerDisassocSanity(IN PRTMP_ADAPTER pAd, - IN VOID * Msg, - IN ULONG MsgLen, - OUT PUCHAR pAddr2, OUT USHORT * pReason) + void * Msg, + unsigned long MsgLen, + u8 *pAddr2, u16 * pReason) { PFRAME_802_11 pFrame = (PFRAME_802_11) Msg; @@ -949,7 +949,7 @@ BOOLEAN PeerDisassocSanity(IN PRTMP_ADAPTER pAd, NDIS_802_11_NETWORK_TYPE NetworkTypeInUseSanity(IN PBSS_ENTRY pBss) { NDIS_802_11_NETWORK_TYPE NetWorkType; - UCHAR rate, i; + u8 rate, i; NetWorkType = Ndis802_11DS; @@ -1014,24 +1014,24 @@ NDIS_802_11_NETWORK_TYPE NetworkTypeInUseSanity(IN PBSS_ENTRY pBss) */ BOOLEAN PeerWpaMessageSanity(IN PRTMP_ADAPTER pAd, IN PEAPOL_PACKET pMsg, - IN ULONG MsgLen, - IN UCHAR MsgType, IN MAC_TABLE_ENTRY * pEntry) + unsigned long MsgLen, + u8 MsgType, IN MAC_TABLE_ENTRY * pEntry) { - UCHAR mic[LEN_KEY_DESC_MIC], digest[80], KEYDATA[MAX_LEN_OF_RSNIE]; + u8 mic[LEN_KEY_DESC_MIC], digest[80], KEYDATA[MAX_LEN_OF_RSNIE]; BOOLEAN bReplayDiff = FALSE; BOOLEAN bWPA2 = FALSE; KEY_INFO EapolKeyInfo; - UCHAR GroupKeyIndex = 0; + u8 GroupKeyIndex = 0; NdisZeroMemory(mic, sizeof(mic)); NdisZeroMemory(digest, sizeof(digest)); NdisZeroMemory(KEYDATA, sizeof(KEYDATA)); - NdisZeroMemory((PUCHAR) & EapolKeyInfo, sizeof(EapolKeyInfo)); + NdisZeroMemory((u8 *)& EapolKeyInfo, sizeof(EapolKeyInfo)); - NdisMoveMemory((PUCHAR) & EapolKeyInfo, - (PUCHAR) & pMsg->KeyDesc.KeyInfo, sizeof(KEY_INFO)); + NdisMoveMemory((u8 *)& EapolKeyInfo, + (u8 *)& pMsg->KeyDesc.KeyInfo, sizeof(KEY_INFO)); - *((USHORT *) & EapolKeyInfo) = cpu2le16(*((USHORT *) & EapolKeyInfo)); + *((u16 *) & EapolKeyInfo) = cpu2le16(*((u16 *) & EapolKeyInfo)); /* Choose WPA2 or not */ if ((pEntry->AuthMode == Ndis802_11AuthModeWPA2) @@ -1049,7 +1049,7 @@ BOOLEAN PeerWpaMessageSanity(IN PRTMP_ADAPTER pAd, { /* First validate replay counter, only accept message with larger replay counter. */ /* Let equal pass, some AP start with all zero replay counter */ - UCHAR ZeroReplay[LEN_KEY_DESC_REPLAY]; + u8 ZeroReplay[LEN_KEY_DESC_REPLAY]; NdisZeroMemory(ZeroReplay, LEN_KEY_DESC_REPLAY); if ((RTMPCompareMemory @@ -1096,7 +1096,7 @@ BOOLEAN PeerWpaMessageSanity(IN PRTMP_ADAPTER pAd, } /* 2. Verify MIC except Pairwise Msg1 */ if (MsgType != EAPOL_PAIR_MSG_1) { - UCHAR rcvd_mic[LEN_KEY_DESC_MIC]; + u8 rcvd_mic[LEN_KEY_DESC_MIC]; /* Record the received MIC for check later */ NdisMoveMemory(rcvd_mic, pMsg->KeyDesc.KeyMic, @@ -1105,11 +1105,11 @@ BOOLEAN PeerWpaMessageSanity(IN PRTMP_ADAPTER pAd, if (EapolKeyInfo.KeyDescVer == DESC_TYPE_TKIP) /* TKIP */ { - HMAC_MD5(pEntry->PTK, LEN_EAP_MICK, (PUCHAR) pMsg, + HMAC_MD5(pEntry->PTK, LEN_EAP_MICK, (u8 *)pMsg, MsgLen, mic, MD5_DIGEST_SIZE); } else if (EapolKeyInfo.KeyDescVer == DESC_TYPE_AES) /* AES */ { - HMAC_SHA1(pEntry->PTK, LEN_EAP_MICK, (PUCHAR) pMsg, + HMAC_SHA1(pEntry->PTK, LEN_EAP_MICK, (u8 *)pMsg, MsgLen, digest, SHA1_DIGEST_SIZE); NdisMoveMemory(mic, digest, LEN_KEY_DESC_MIC); } @@ -1142,20 +1142,20 @@ BOOLEAN PeerWpaMessageSanity(IN PRTMP_ADAPTER pAd, /* 2. Extract the context of the Key Data field if it exist. */ /* The field in pairwise_msg_2_WPA1(WPA2) & pairwise_msg_3_WPA1 is clear. */ /* The field in group_msg_1_WPA1(WPA2) & pairwise_msg_3_WPA2 is encrypted. */ - if (CONV_ARRARY_TO_UINT16(pMsg->KeyDesc.KeyDataLen) > 0) { + if (CONV_ARRARY_TO_u16(pMsg->KeyDesc.KeyDataLen) > 0) { /* Decrypt this field */ if ((MsgType == EAPOL_PAIR_MSG_3 && bWPA2) || (MsgType == EAPOL_GROUP_MSG_1)) { if ((EapolKeyInfo.KeyDescVer == DESC_TYPE_AES)) { /* AES */ AES_GTK_KEY_UNWRAP(&pEntry->PTK[16], KEYDATA, - CONV_ARRARY_TO_UINT16(pMsg-> + CONV_ARRARY_TO_u16(pMsg-> KeyDesc. KeyDataLen), pMsg->KeyDesc.KeyData); } else { - INT i; - UCHAR Key[32]; + int i; + u8 Key[32]; /* Decrypt TKIP GTK */ /* Construct 32 bytes RC4 Key */ NdisMoveMemory(Key, pMsg->KeyDesc.KeyIv, 16); @@ -1169,7 +1169,7 @@ BOOLEAN PeerWpaMessageSanity(IN PRTMP_ADAPTER pAd, /* Decrypt GTK. Becareful, there is no ICV to check the result is correct or not */ ARCFOUR_DECRYPT(&pAd->PrivateInfo.WEPCONTEXT, KEYDATA, pMsg->KeyDesc.KeyData, - CONV_ARRARY_TO_UINT16(pMsg-> + CONV_ARRARY_TO_u16(pMsg-> KeyDesc. KeyDataLen)); } @@ -1180,7 +1180,7 @@ BOOLEAN PeerWpaMessageSanity(IN PRTMP_ADAPTER pAd, } else if ((MsgType == EAPOL_PAIR_MSG_2) || (MsgType == EAPOL_PAIR_MSG_3 && !bWPA2)) { NdisMoveMemory(KEYDATA, pMsg->KeyDesc.KeyData, - CONV_ARRARY_TO_UINT16(pMsg->KeyDesc. + CONV_ARRARY_TO_u16(pMsg->KeyDesc. KeyDataLen)); } else { @@ -1192,7 +1192,7 @@ BOOLEAN PeerWpaMessageSanity(IN PRTMP_ADAPTER pAd, /* 2. verify KDE format for pairwise_msg_3_WPA2, group_msg_1_WPA2 */ /* 3. update shared key for pairwise_msg_3_WPA2, group_msg_1_WPA1(WPA2) */ if (!RTMPParseEapolKeyData(pAd, KEYDATA, - CONV_ARRARY_TO_UINT16(pMsg->KeyDesc. + CONV_ARRARY_TO_u16(pMsg->KeyDesc. KeyDataLen), GroupKeyIndex, MsgType, bWPA2, pEntry)) { diff --git a/drivers/staging/rt2860/common/cmm_sync.c b/drivers/staging/rt2860/common/cmm_sync.c index c29e087a41d..2d7f36a3e62 100644 --- a/drivers/staging/rt2860/common/cmm_sync.c +++ b/drivers/staging/rt2860/common/cmm_sync.c @@ -57,41 +57,41 @@ #define BG_BAND_REGION_31_SIZE 14 /* 5 Ghz channel plan index in the TxPower arrays. */ -UCHAR A_BAND_REGION_0_CHANNEL_LIST[] = +u8 A_BAND_REGION_0_CHANNEL_LIST[] = { 36, 40, 44, 48, 52, 56, 60, 64, 149, 153, 157, 161, 165 }; -UCHAR A_BAND_REGION_1_CHANNEL_LIST[] = +u8 A_BAND_REGION_1_CHANNEL_LIST[] = { 36, 40, 44, 48, 52, 56, 60, 64, 100, 104, 108, 112, 116, 120, 124, 128, 132, 136, 140 }; -UCHAR A_BAND_REGION_2_CHANNEL_LIST[] = { 36, 40, 44, 48, 52, 56, 60, 64 }; -UCHAR A_BAND_REGION_3_CHANNEL_LIST[] = { 52, 56, 60, 64, 149, 153, 157, 161 }; -UCHAR A_BAND_REGION_4_CHANNEL_LIST[] = { 149, 153, 157, 161, 165 }; -UCHAR A_BAND_REGION_5_CHANNEL_LIST[] = { 149, 153, 157, 161 }; -UCHAR A_BAND_REGION_6_CHANNEL_LIST[] = { 36, 40, 44, 48 }; -UCHAR A_BAND_REGION_7_CHANNEL_LIST[] = +u8 A_BAND_REGION_2_CHANNEL_LIST[] = { 36, 40, 44, 48, 52, 56, 60, 64 }; +u8 A_BAND_REGION_3_CHANNEL_LIST[] = { 52, 56, 60, 64, 149, 153, 157, 161 }; +u8 A_BAND_REGION_4_CHANNEL_LIST[] = { 149, 153, 157, 161, 165 }; +u8 A_BAND_REGION_5_CHANNEL_LIST[] = { 149, 153, 157, 161 }; +u8 A_BAND_REGION_6_CHANNEL_LIST[] = { 36, 40, 44, 48 }; +u8 A_BAND_REGION_7_CHANNEL_LIST[] = { 36, 40, 44, 48, 52, 56, 60, 64, 100, 104, 108, 112, 116, 120, 124, 128, 132, 136, 140, 149, 153, 157, 161, 165, 169, 173 }; -UCHAR A_BAND_REGION_8_CHANNEL_LIST[] = { 52, 56, 60, 64 }; -UCHAR A_BAND_REGION_9_CHANNEL_LIST[] = +u8 A_BAND_REGION_8_CHANNEL_LIST[] = { 52, 56, 60, 64 }; +u8 A_BAND_REGION_9_CHANNEL_LIST[] = { 36, 40, 44, 48, 52, 56, 60, 64, 100, 104, 108, 112, 116, 132, 136, 140, 149, 153, 157, 161, 165 }; -UCHAR A_BAND_REGION_10_CHANNEL_LIST[] = +u8 A_BAND_REGION_10_CHANNEL_LIST[] = { 36, 40, 44, 48, 149, 153, 157, 161, 165 }; -UCHAR A_BAND_REGION_11_CHANNEL_LIST[] = +u8 A_BAND_REGION_11_CHANNEL_LIST[] = { 36, 40, 44, 48, 52, 56, 60, 64, 100, 104, 108, 112, 116, 120, 149, 153, 157, 161 }; -UCHAR A_BAND_REGION_12_CHANNEL_LIST[] = +u8 A_BAND_REGION_12_CHANNEL_LIST[] = { 36, 40, 44, 48, 52, 56, 60, 64, 100, 104, 108, 112, 116, 120, 124, 128, 132, 136, 140 }; -UCHAR A_BAND_REGION_13_CHANNEL_LIST[] = +u8 A_BAND_REGION_13_CHANNEL_LIST[] = { 52, 56, 60, 64, 100, 104, 108, 112, 116, 120, 124, 128, 132, 136, 140, 149, 153, 157, 161 }; -UCHAR A_BAND_REGION_14_CHANNEL_LIST[] = +u8 A_BAND_REGION_14_CHANNEL_LIST[] = { 36, 40, 44, 48, 52, 56, 60, 64, 100, 104, 108, 112, 116, 136, 140, 149, 153, 157, 161, 165 }; -UCHAR A_BAND_REGION_15_CHANNEL_LIST[] = { 149, 153, 157, 161, 165, 169, 173 }; +u8 A_BAND_REGION_15_CHANNEL_LIST[] = { 149, 153, 157, 161, 165, 169, 173 }; /*BaSizeArray follows the 802.11n definition as MaxRxFactor. 2^(13+factor) bytes. When factor =0, it's about Ba buffer size =8. */ -UCHAR BaSizeArray[4] = { 8, 16, 32, 64 }; +u8 BaSizeArray[4] = { 8, 16, 32, 64 }; /* ========================================================================== @@ -105,10 +105,10 @@ UCHAR BaSizeArray[4] = { 8, 16, 32, 64 }; ========================================================================== */ -VOID BuildChannelList(IN PRTMP_ADAPTER pAd) +void BuildChannelList(IN PRTMP_ADAPTER pAd) { - UCHAR i, j, index = 0, num = 0; - PUCHAR pChannelList = NULL; + u8 i, j, index = 0, num = 0; + u8 *pChannelList = NULL; NdisZeroMemory(pAd->ChannelList, MAX_NUM_OF_CHANNELS * sizeof(CHANNEL_TX_POWER)); @@ -200,99 +200,99 @@ VOID BuildChannelList(IN PRTMP_ADAPTER pAd) case REGION_0_A_BAND: num = sizeof(A_BAND_REGION_0_CHANNEL_LIST) / - sizeof(UCHAR); + sizeof(u8); pChannelList = A_BAND_REGION_0_CHANNEL_LIST; break; case REGION_1_A_BAND: num = sizeof(A_BAND_REGION_1_CHANNEL_LIST) / - sizeof(UCHAR); + sizeof(u8); pChannelList = A_BAND_REGION_1_CHANNEL_LIST; break; case REGION_2_A_BAND: num = sizeof(A_BAND_REGION_2_CHANNEL_LIST) / - sizeof(UCHAR); + sizeof(u8); pChannelList = A_BAND_REGION_2_CHANNEL_LIST; break; case REGION_3_A_BAND: num = sizeof(A_BAND_REGION_3_CHANNEL_LIST) / - sizeof(UCHAR); + sizeof(u8); pChannelList = A_BAND_REGION_3_CHANNEL_LIST; break; case REGION_4_A_BAND: num = sizeof(A_BAND_REGION_4_CHANNEL_LIST) / - sizeof(UCHAR); + sizeof(u8); pChannelList = A_BAND_REGION_4_CHANNEL_LIST; break; case REGION_5_A_BAND: num = sizeof(A_BAND_REGION_5_CHANNEL_LIST) / - sizeof(UCHAR); + sizeof(u8); pChannelList = A_BAND_REGION_5_CHANNEL_LIST; break; case REGION_6_A_BAND: num = sizeof(A_BAND_REGION_6_CHANNEL_LIST) / - sizeof(UCHAR); + sizeof(u8); pChannelList = A_BAND_REGION_6_CHANNEL_LIST; break; case REGION_7_A_BAND: num = sizeof(A_BAND_REGION_7_CHANNEL_LIST) / - sizeof(UCHAR); + sizeof(u8); pChannelList = A_BAND_REGION_7_CHANNEL_LIST; break; case REGION_8_A_BAND: num = sizeof(A_BAND_REGION_8_CHANNEL_LIST) / - sizeof(UCHAR); + sizeof(u8); pChannelList = A_BAND_REGION_8_CHANNEL_LIST; break; case REGION_9_A_BAND: num = sizeof(A_BAND_REGION_9_CHANNEL_LIST) / - sizeof(UCHAR); + sizeof(u8); pChannelList = A_BAND_REGION_9_CHANNEL_LIST; break; case REGION_10_A_BAND: num = sizeof(A_BAND_REGION_10_CHANNEL_LIST) / - sizeof(UCHAR); + sizeof(u8); pChannelList = A_BAND_REGION_10_CHANNEL_LIST; break; case REGION_11_A_BAND: num = sizeof(A_BAND_REGION_11_CHANNEL_LIST) / - sizeof(UCHAR); + sizeof(u8); pChannelList = A_BAND_REGION_11_CHANNEL_LIST; break; case REGION_12_A_BAND: num = sizeof(A_BAND_REGION_12_CHANNEL_LIST) / - sizeof(UCHAR); + sizeof(u8); pChannelList = A_BAND_REGION_12_CHANNEL_LIST; break; case REGION_13_A_BAND: num = sizeof(A_BAND_REGION_13_CHANNEL_LIST) / - sizeof(UCHAR); + sizeof(u8); pChannelList = A_BAND_REGION_13_CHANNEL_LIST; break; case REGION_14_A_BAND: num = sizeof(A_BAND_REGION_14_CHANNEL_LIST) / - sizeof(UCHAR); + sizeof(u8); pChannelList = A_BAND_REGION_14_CHANNEL_LIST; break; case REGION_15_A_BAND: num = sizeof(A_BAND_REGION_15_CHANNEL_LIST) / - sizeof(UCHAR); + sizeof(u8); pChannelList = A_BAND_REGION_15_CHANNEL_LIST; break; default: /* Error. should never happen */ @@ -303,7 +303,7 @@ VOID BuildChannelList(IN PRTMP_ADAPTER pAd) } if (num != 0) { - UCHAR RadarCh[15] = + u8 RadarCh[15] = { 52, 56, 60, 64, 100, 104, 108, 112, 116, 120, 124, 128, 132, 136, 140 }; for (i = 0; i < num; i++) { @@ -359,7 +359,7 @@ VOID BuildChannelList(IN PRTMP_ADAPTER pAd) ========================================================================== */ -UCHAR FirstChannel(IN PRTMP_ADAPTER pAd) +u8 FirstChannel(IN PRTMP_ADAPTER pAd) { return pAd->ChannelList[0].Channel; } @@ -375,10 +375,10 @@ UCHAR FirstChannel(IN PRTMP_ADAPTER pAd) return 0 if no more next channel ========================================================================== */ -UCHAR NextChannel(IN PRTMP_ADAPTER pAd, IN UCHAR channel) +u8 NextChannel(IN PRTMP_ADAPTER pAd, u8 channel) { int i; - UCHAR next_channel = 0; + u8 next_channel = 0; for (i = 0; i < (pAd->ChannelListNum - 1); i++) if (channel == pAd->ChannelList[i].Channel) { @@ -408,8 +408,8 @@ UCHAR NextChannel(IN PRTMP_ADAPTER pAd, IN UCHAR channel) the minimum value or next lower value. ========================================================================== */ -VOID ChangeToCellPowerLimit(IN PRTMP_ADAPTER pAd, - IN UCHAR AironetCellPowerLimit) +void ChangeToCellPowerLimit(IN PRTMP_ADAPTER pAd, + u8 AironetCellPowerLimit) { /*valud 0xFF means that hasn't found power limit information */ /*from the AP's Beacon/Probe response. */ @@ -435,9 +435,9 @@ VOID ChangeToCellPowerLimit(IN PRTMP_ADAPTER pAd, } -CHAR ConvertToRssi(IN PRTMP_ADAPTER pAd, IN CHAR Rssi, IN UCHAR RssiNumber) +char ConvertToRssi(IN PRTMP_ADAPTER pAd, char Rssi, u8 RssiNumber) { - UCHAR RssiOffset, LNAGain; + u8 RssiOffset, LNAGain; /* Rssi equals to zero should be an invalid value */ if (Rssi == 0) @@ -469,16 +469,16 @@ CHAR ConvertToRssi(IN PRTMP_ADAPTER pAd, IN CHAR Rssi, IN UCHAR RssiNumber) Scan next channel ========================================================================== */ -VOID ScanNextChannel(IN PRTMP_ADAPTER pAd) +void ScanNextChannel(IN PRTMP_ADAPTER pAd) { HEADER_802_11 Hdr80211; - PUCHAR pOutBuffer = NULL; - NDIS_STATUS NStatus; - ULONG FrameLen = 0; - UCHAR SsidLen = 0, ScanType = pAd->MlmeAux.ScanType, BBPValue = 0; - USHORT Status; + u8 *pOutBuffer = NULL; + int NStatus; + unsigned long FrameLen = 0; + u8 SsidLen = 0, ScanType = pAd->MlmeAux.ScanType, BBPValue = 0; + u16 Status; PHEADER_802_11 pHdr80211; - UINT ScanTimeIn5gChannel = SHORT_CHANNEL_TIME; + u32 ScanTimeIn5gChannel = SHORT_CHANNEL_TIME; { if (MONITOR_ON(pAd)) @@ -520,7 +520,7 @@ VOID ScanNextChannel(IN PRTMP_ADAPTER pAd) && (INFRA_ON(pAd))) { NStatus = MlmeAllocateMemory(pAd, - (PVOID) & pOutBuffer); + (void *)& pOutBuffer); if (NStatus == NDIS_STATUS_SUCCESS) { pHdr80211 = (PHEADER_802_11) pOutBuffer; MgtMacHeaderInit(pAd, pHdr80211, @@ -650,7 +650,7 @@ VOID ScanNextChannel(IN PRTMP_ADAPTER pAd) pAd->CommonCfg.SupRate, END_OF_ARGS); if (pAd->CommonCfg.ExtRateLen) { - ULONG Tmp; + unsigned long Tmp; MakeOutgoingFrame(pOutBuffer + FrameLen, &Tmp, 1, &ExtRateIe, 1, &pAd->CommonCfg.ExtRateLen, @@ -661,9 +661,9 @@ VOID ScanNextChannel(IN PRTMP_ADAPTER pAd) } if (pAd->CommonCfg.PhyMode >= PHY_11ABGN_MIXED) { - ULONG Tmp; - UCHAR HtLen; - UCHAR BROADCOM[4] = { 0x0, 0x90, 0x4c, 0x33 }; + unsigned long Tmp; + u8 HtLen; + u8 BROADCOM[4] = { 0x0, 0x90, 0x4c, 0x33 }; if (pAd->bBroadComHT == TRUE) { HtLen = @@ -700,10 +700,10 @@ VOID ScanNextChannel(IN PRTMP_ADAPTER pAd) } } -VOID MgtProbReqMacHeaderInit(IN PRTMP_ADAPTER pAd, +void MgtProbReqMacHeaderInit(IN PRTMP_ADAPTER pAd, IN OUT PHEADER_802_11 pHdr80211, - IN UCHAR SubType, - IN UCHAR ToDs, IN PUCHAR pDA, IN PUCHAR pBssid) + u8 SubType, + u8 ToDs, u8 *pDA, u8 *pBssid) { NdisZeroMemory(pHdr80211, sizeof(HEADER_802_11)); diff --git a/drivers/staging/rt2860/common/cmm_tkip.c b/drivers/staging/rt2860/common/cmm_tkip.c index 97f0543a7a1..ab00a0c5e3e 100644 --- a/drivers/staging/rt2860/common/cmm_tkip.c +++ b/drivers/staging/rt2860/common/cmm_tkip.c @@ -42,7 +42,7 @@ ( ((A) << (n)) | ( ((A)>>(32-(n))) & ( (1UL << (n)) - 1 ) ) ) #define ROR32( A, n ) ROL32( (A), 32-(n) ) -UINT Tkip_Sbox_Lower[256] = { +u32 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, @@ -77,7 +77,7 @@ UINT Tkip_Sbox_Lower[256] = { 0xC3, 0xB0, 0x77, 0x11, 0xCB, 0xFC, 0xD6, 0x3A }; -UINT Tkip_Sbox_Upper[256] = { +u32 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, @@ -118,31 +118,31 @@ UINT Tkip_Sbox_Upper[256] = { typedef struct PACKED _IV_CONTROL_ { union PACKED { struct PACKED { - UCHAR rc0; - UCHAR rc1; - UCHAR rc2; + u8 rc0; + u8 rc1; + u8 rc2; union PACKED { struct PACKED { - UCHAR Rsvd:5; - UCHAR ExtIV:1; - UCHAR KeyID:2; + u8 Rsvd:5; + u8 ExtIV:1; + u8 KeyID:2; } field; - UCHAR Byte; + u8 Byte; } CONTROL; } field; - ULONG word; + unsigned long word; } IV16; - ULONG IV32; + unsigned long IV32; } TKIP_IV, *PTKIP_IV; /* ======================================================================== Routine Description: - Convert from UCHAR[] to ULONG in a portable way + Convert from u8[] to unsigned long in a portable way Arguments: pMICKey pointer to MIC Key @@ -154,10 +154,10 @@ typedef struct PACKED _IV_CONTROL_ { ======================================================================== */ -ULONG RTMPTkipGetUInt32(IN PUCHAR pMICKey) +unsigned long RTMPTkipGetUInt32(u8 *pMICKey) { - ULONG res = 0; - INT i; + unsigned long res = 0; + int i; for (i = 0; i < 4; i++) { res |= (*pMICKey++) << (8 * i); @@ -170,10 +170,10 @@ ULONG RTMPTkipGetUInt32(IN PUCHAR pMICKey) ======================================================================== Routine Description: - Convert from ULONG to UCHAR[] in a portable way + Convert from unsigned long to u8[] in a portable way Arguments: - pDst pointer to destination for convert ULONG to UCHAR[] + pDst pointer to destination for convert unsigned long to u8[] val the value for convert Return Value: @@ -185,12 +185,12 @@ ULONG RTMPTkipGetUInt32(IN PUCHAR pMICKey) ======================================================================== */ -VOID RTMPTkipPutUInt32(IN OUT PUCHAR pDst, IN ULONG val) +void RTMPTkipPutUInt32(IN u8 *pDst, unsigned long val) { - INT i; + int i; for (i = 0; i < 4; i++) { - *pDst++ = (UCHAR) (val & 0xff); + *pDst++ = (u8)(val & 0xff); val >>= 8; } } @@ -214,7 +214,7 @@ VOID RTMPTkipPutUInt32(IN OUT PUCHAR pDst, IN ULONG val) ======================================================================== */ -VOID RTMPTkipSetMICKey(IN PTKIP_KEY_INFO pTkip, IN PUCHAR pMICKey) +void RTMPTkipSetMICKey(IN PTKIP_KEY_INFO pTkip, u8 *pMICKey) { /* Set the key */ pTkip->K0 = RTMPTkipGetUInt32(pMICKey); @@ -245,7 +245,7 @@ VOID RTMPTkipSetMICKey(IN PTKIP_KEY_INFO pTkip, IN PUCHAR pMICKey) ======================================================================== */ -VOID RTMPTkipAppendByte(IN PTKIP_KEY_INFO pTkip, IN UCHAR uChar) +void RTMPTkipAppendByte(IN PTKIP_KEY_INFO pTkip, u8 uChar) { /* Append the byte to our word-sized buffer */ pTkip->M |= (uChar << (8 * pTkip->nBytesInM)); @@ -289,7 +289,7 @@ VOID RTMPTkipAppendByte(IN PTKIP_KEY_INFO pTkip, IN UCHAR uChar) ======================================================================== */ -VOID RTMPTkipAppend(IN PTKIP_KEY_INFO pTkip, IN PUCHAR pSrc, IN UINT nBytes) +void RTMPTkipAppend(IN PTKIP_KEY_INFO pTkip, u8 *pSrc, u32 nBytes) { /* This is simple */ while (nBytes > 0) { @@ -316,7 +316,7 @@ VOID RTMPTkipAppend(IN PTKIP_KEY_INFO pTkip, IN PUCHAR pSrc, IN UINT nBytes) the MIC Value is store in pAd->PrivateInfo.MIC ======================================================================== */ -VOID RTMPTkipGetMIC(IN PTKIP_KEY_INFO pTkip) +void RTMPTkipGetMIC(IN PTKIP_KEY_INFO pTkip) { /* Append the minimum padding */ RTMPTkipAppendByte(pTkip, 0x5a); @@ -355,12 +355,12 @@ VOID RTMPTkipGetMIC(IN PTKIP_KEY_INFO pTkip) ======================================================================== */ -VOID RTMPInitTkipEngine(IN PRTMP_ADAPTER pAd, - IN PUCHAR pKey, - IN UCHAR KeyId, - IN PUCHAR pTA, - IN PUCHAR pMICKey, - IN PUCHAR pTSC, OUT PULONG pIV16, OUT PULONG pIV32) +void RTMPInitTkipEngine(IN PRTMP_ADAPTER pAd, + u8 *pKey, + u8 KeyId, + u8 *pTA, + u8 *pMICKey, + u8 *pTSC, unsigned long *pIV16, unsigned long *pIV32) { TKIP_IV tkipIv; @@ -371,7 +371,7 @@ VOID RTMPInitTkipEngine(IN PRTMP_ADAPTER pAd, tkipIv.IV16.field.rc2 = *pTSC; tkipIv.IV16.field.CONTROL.field.ExtIV = 1; /* 0: non-extended IV, 1: an extended IV */ tkipIv.IV16.field.CONTROL.field.KeyID = KeyId; -/* tkipIv.IV32 = *(PULONG)(pTSC + 2); */ +/* tkipIv.IV32 = *(unsigned long *)(pTSC + 2); */ NdisMoveMemory(&tkipIv.IV32, (pTSC + 2), 4); /* Copy IV */ *pIV16 = tkipIv.IV16.word; @@ -399,12 +399,12 @@ VOID RTMPInitTkipEngine(IN PRTMP_ADAPTER pAd, ======================================================================== */ -VOID RTMPInitMICEngine(IN PRTMP_ADAPTER pAd, - IN PUCHAR pKey, - IN PUCHAR pDA, - IN PUCHAR pSA, IN UCHAR UserPriority, IN PUCHAR pMICKey) +void RTMPInitMICEngine(IN PRTMP_ADAPTER pAd, + u8 *pKey, + u8 *pDA, + u8 *pSA, u8 UserPriority, u8 *pMICKey) { - ULONG Priority = UserPriority; + unsigned long Priority = UserPriority; /* Init MIC value calculation */ RTMPTkipSetMICKey(&pAd->PrivateInfo.Tx, pMICKey); @@ -413,7 +413,7 @@ VOID RTMPInitMICEngine(IN PRTMP_ADAPTER pAd, /* SA */ RTMPTkipAppend(&pAd->PrivateInfo.Tx, pSA, MAC_ADDR_LEN); /* Priority + 3 bytes of 0 */ - RTMPTkipAppend(&pAd->PrivateInfo.Tx, (PUCHAR) & Priority, 4); + RTMPTkipAppend(&pAd->PrivateInfo.Tx, (u8 *)& Priority, 4); } /* @@ -441,14 +441,14 @@ VOID RTMPInitMICEngine(IN PRTMP_ADAPTER pAd, ======================================================================== */ BOOLEAN RTMPTkipCompareMICValue(IN PRTMP_ADAPTER pAd, - IN PUCHAR pSrc, - IN PUCHAR pDA, - IN PUCHAR pSA, - IN PUCHAR pMICKey, - IN UCHAR UserPriority, IN UINT Len) + u8 *pSrc, + u8 *pDA, + u8 *pSA, + u8 *pMICKey, + u8 UserPriority, u32 Len) { - UCHAR OldMic[8]; - ULONG Priority = UserPriority; + u8 OldMic[8]; + unsigned long Priority = UserPriority; /* Init MIC value calculation */ RTMPTkipSetMICKey(&pAd->PrivateInfo.Rx, pMICKey); @@ -457,7 +457,7 @@ BOOLEAN RTMPTkipCompareMICValue(IN PRTMP_ADAPTER pAd, /* SA */ RTMPTkipAppend(&pAd->PrivateInfo.Rx, pSA, MAC_ADDR_LEN); /* Priority + 3 bytes of 0 */ - RTMPTkipAppend(&pAd->PrivateInfo.Rx, (PUCHAR) & Priority, 4); + RTMPTkipAppend(&pAd->PrivateInfo.Rx, (u8 *)& Priority, 4); /* Calculate MIC value from plain text data */ RTMPTkipAppend(&pAd->PrivateInfo.Rx, pSrc, Len); @@ -500,17 +500,17 @@ BOOLEAN RTMPTkipCompareMICValue(IN PRTMP_ADAPTER pAd, ======================================================================== */ -VOID RTMPCalculateMICValue(IN PRTMP_ADAPTER pAd, +void RTMPCalculateMICValue(IN PRTMP_ADAPTER pAd, IN PNDIS_PACKET pPacket, - IN PUCHAR pEncap, - IN PCIPHER_KEY pKey, IN UCHAR apidx) + u8 *pEncap, + IN PCIPHER_KEY pKey, u8 apidx) { PACKET_INFO PacketInfo; - PUCHAR pSrcBufVA; - UINT SrcBufLen; - PUCHAR pSrc; - UCHAR UserPriority; - UCHAR vlan_offset = 0; + u8 *pSrcBufVA; + u32 SrcBufLen; + u8 *pSrc; + u8 UserPriority; + u8 vlan_offset = 0; RTMP_QueryPacketInfo(pPacket, &PacketInfo, &pSrcBufVA, &SrcBufLen); @@ -555,11 +555,11 @@ VOID RTMPCalculateMICValue(IN PRTMP_ADAPTER pAd, /* is synthesized from two 256 entry byte wide tables. */ /************************************************************/ -UINT tkip_sbox(UINT index) +u32 tkip_sbox(u32 index) { - UINT index_low; - UINT index_high; - UINT left, right; + u32 index_low; + u32 index_high; + u32 left, right; index_low = (index % 256); index_high = ((index >> 8) % 256); @@ -571,7 +571,7 @@ UINT tkip_sbox(UINT index) return (left ^ right); } -UINT rotr1(UINT a) +u32 rotr1(u32 a) { unsigned int b; @@ -584,24 +584,24 @@ UINT rotr1(UINT a) return b; } -VOID RTMPTkipMixKey(UCHAR * key, UCHAR * ta, ULONG pnl, /* Least significant 16 bits of PN */ - ULONG pnh, /* Most significant 32 bits of PN */ - UCHAR * rc4key, UINT * p1k) +void RTMPTkipMixKey(u8 * key, u8 * ta, unsigned long pnl, /* Least significant 16 bits of PN */ + unsigned long pnh, /* Most significant 32 bits of PN */ + u8 * rc4key, u32 * p1k) { - UINT tsc0; - UINT tsc1; - UINT tsc2; + u32 tsc0; + u32 tsc1; + u32 tsc2; - UINT ppk0; - UINT ppk1; - UINT ppk2; - UINT ppk3; - UINT ppk4; - UINT ppk5; + u32 ppk0; + u32 ppk1; + u32 ppk2; + u32 ppk3; + u32 ppk4; + u32 ppk5; - INT i; - INT j; + int i; + int j; tsc0 = (unsigned int)((pnh >> 16) % 65536); /* msb */ tsc1 = (unsigned int)(pnh % 65536); @@ -610,9 +610,9 @@ VOID RTMPTkipMixKey(UCHAR * key, UCHAR * ta, ULONG pnl, /* Least significant 16 /* Phase 1, step 1 */ p1k[0] = tsc1; p1k[1] = tsc0; - p1k[2] = (UINT) (ta[0] + (ta[1] * 256)); - p1k[3] = (UINT) (ta[2] + (ta[3] * 256)); - p1k[4] = (UINT) (ta[4] + (ta[5] * 256)); + p1k[2] = (u32)(ta[0] + (ta[1] * 256)); + p1k[3] = (u32)(ta[2] + (ta[3] * 256)); + p1k[4] = (u32)(ta[4] + (ta[5] * 256)); /* Phase 1, step 2 */ for (i = 0; i < 8; i++) { @@ -699,43 +699,43 @@ VOID RTMPTkipMixKey(UCHAR * key, UCHAR * ta, ULONG pnl, /* Least significant 16 /* FALSE: Decrypt Error! */ /* */ BOOLEAN RTMPSoftDecryptTKIP(IN PRTMP_ADAPTER pAd, - IN PUCHAR pData, - IN ULONG DataByteCnt, - IN UCHAR UserPriority, IN PCIPHER_KEY pWpaKey) + u8 *pData, + unsigned long DataByteCnt, + u8 UserPriority, IN PCIPHER_KEY pWpaKey) { - UCHAR KeyID; - UINT HeaderLen; - UCHAR fc0; - UCHAR fc1; - USHORT fc; - UINT frame_type; - UINT frame_subtype; - UINT from_ds; - UINT to_ds; - INT a4_exists; - INT qc_exists; - USHORT duration; - USHORT seq_control; - USHORT qos_control; - UCHAR TA[MAC_ADDR_LEN]; - UCHAR DA[MAC_ADDR_LEN]; - UCHAR SA[MAC_ADDR_LEN]; - UCHAR RC4Key[16]; - UINT p1k[5]; /*for mix_key; */ - ULONG pnl; /* Least significant 16 bits of PN */ - ULONG pnh; /* Most significant 32 bits of PN */ - UINT num_blocks; - UINT payload_remainder; + u8 KeyID; + u32 HeaderLen; + u8 fc0; + u8 fc1; + u16 fc; + u32 frame_type; + u32 frame_subtype; + u32 from_ds; + u32 to_ds; + int a4_exists; + int qc_exists; + u16 duration; + u16 seq_control; + u16 qos_control; + u8 TA[MAC_ADDR_LEN]; + u8 DA[MAC_ADDR_LEN]; + u8 SA[MAC_ADDR_LEN]; + u8 RC4Key[16]; + u32 p1k[5]; /*for mix_key; */ + unsigned long pnl; /* Least significant 16 bits of PN */ + unsigned long pnh; /* Most significant 32 bits of PN */ + u32 num_blocks; + u32 payload_remainder; ARCFOURCONTEXT ArcFourContext; - UINT crc32 = 0; - UINT trailfcs = 0; - UCHAR MIC[8]; - UCHAR TrailMIC[8]; + u32 crc32 = 0; + u32 trailfcs = 0; + u8 MIC[8]; + u8 TrailMIC[8]; fc0 = *pData; fc1 = *(pData + 1); - fc = *((PUSHORT) pData); + fc = *((u16 *)pData); frame_type = ((fc0 >> 2) & 0x03); frame_subtype = ((fc0 >> 4) & 0x0f); @@ -753,7 +753,7 @@ BOOLEAN RTMPSoftDecryptTKIP(IN PRTMP_ADAPTER pAd, if (a4_exists) HeaderLen += 6; - KeyID = *((PUCHAR) (pData + HeaderLen + 3)); + KeyID = *((u8 *)(pData + HeaderLen + 3)); KeyID = KeyID >> 6; if (pWpaKey[KeyID].KeyLen == 0) { @@ -763,15 +763,15 @@ BOOLEAN RTMPSoftDecryptTKIP(IN PRTMP_ADAPTER pAd, return FALSE; } - duration = *((PUSHORT) (pData + 2)); + duration = *((u16 *)(pData + 2)); - seq_control = *((PUSHORT) (pData + 22)); + seq_control = *((u16 *)(pData + 22)); if (qc_exists) { if (a4_exists) { - qos_control = *((PUSHORT) (pData + 30)); + qos_control = *((u16 *)(pData + 30)); } else { - qos_control = *((PUSHORT) (pData + 24)); + qos_control = *((u16 *)(pData + 24)); } } @@ -797,7 +797,7 @@ BOOLEAN RTMPSoftDecryptTKIP(IN PRTMP_ADAPTER pAd, payload_remainder = (DataByteCnt - 16) % 16; pnl = (*(pData + HeaderLen)) * 256 + *(pData + HeaderLen + 2); - pnh = *((PULONG) (pData + HeaderLen + 4)); + pnh = *((unsigned long *)(pData + HeaderLen + 4)); pnh = cpu2le32(pnh); RTMPTkipMixKey(pWpaKey[KeyID].Key, TA, pnl, pnh, RC4Key, p1k); diff --git a/drivers/staging/rt2860/common/cmm_wep.c b/drivers/staging/rt2860/common/cmm_wep.c index db40139d1fb..05a921410ca 100644 --- a/drivers/staging/rt2860/common/cmm_wep.c +++ b/drivers/staging/rt2860/common/cmm_wep.c @@ -37,7 +37,7 @@ #include "../rt_config.h" -UINT FCSTAB_32[256] = { +u32 FCSTAB_32[256] = { 0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, 0x706af48f, 0xe963a535, 0x9e6495a3, 0x0edb8832, 0x79dcb8a4, 0xe0d5e91e, 0x97d2d988, @@ -105,7 +105,7 @@ UINT FCSTAB_32[256] = { }; /* -UCHAR WEPKEY[] = { +u8 WEPKEY[] = { //IV 0x00, 0x11, 0x22, //WEP KEY @@ -135,12 +135,12 @@ UCHAR WEPKEY[] = { ======================================================================== */ -VOID RTMPInitWepEngine(IN PRTMP_ADAPTER pAd, - IN PUCHAR pKey, - IN UCHAR KeyId, IN UCHAR KeyLen, IN OUT PUCHAR pDest) +void RTMPInitWepEngine(IN PRTMP_ADAPTER pAd, + u8 *pKey, + u8 KeyId, u8 KeyLen, IN u8 *pDest) { - UINT i; - UCHAR WEPKEY[] = { + u32 i; + u8 WEPKEY[] = { /*IV */ 0x00, 0x11, 0x22, /*WEP KEY */ @@ -184,8 +184,8 @@ VOID RTMPInitWepEngine(IN PRTMP_ADAPTER pAd, ======================================================================== */ -VOID RTMPEncryptData(IN PRTMP_ADAPTER pAd, - IN PUCHAR pSrc, IN PUCHAR pDest, IN UINT Len) +void RTMPEncryptData(IN PRTMP_ADAPTER pAd, + u8 *pSrc, u8 *pDest, u32 Len) { pAd->PrivateInfo.FCSCRC32 = RTMP_CALC_FCS32(pAd->PrivateInfo.FCSCRC32, pSrc, Len); @@ -212,21 +212,21 @@ VOID RTMPEncryptData(IN PRTMP_ADAPTER pAd, ======================================================================== */ BOOLEAN RTMPSoftDecryptWEP(IN PRTMP_ADAPTER pAd, - IN PUCHAR pData, - IN ULONG DataByteCnt, IN PCIPHER_KEY pGroupKey) + u8 *pData, + unsigned long DataByteCnt, IN PCIPHER_KEY pGroupKey) { - UINT trailfcs; - UINT crc32; - UCHAR KeyIdx; - UCHAR WEPKEY[] = { + u32 trailfcs; + u32 crc32; + u8 KeyIdx; + u8 WEPKEY[] = { /*IV */ 0x00, 0x11, 0x22, /*WEP KEY */ 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xAA, 0xBB, 0xCC }; - UCHAR *pPayload = (UCHAR *) pData + LENGTH_802_11; - ULONG payload_len = DataByteCnt - LENGTH_802_11; + u8 *pPayload = (u8 *) pData + LENGTH_802_11; + unsigned long payload_len = DataByteCnt - LENGTH_802_11; NdisMoveMemory(WEPKEY, pPayload, 3); /*Get WEP IV */ @@ -271,19 +271,19 @@ BOOLEAN RTMPSoftDecryptWEP(IN PRTMP_ADAPTER pAd, ======================================================================== */ -VOID ARCFOUR_INIT(IN PARCFOURCONTEXT Ctx, IN PUCHAR pKey, IN UINT KeyLen) +void ARCFOUR_INIT(IN PARCFOURCONTEXT Ctx, u8 *pKey, u32 KeyLen) { - UCHAR t, u; - UINT keyindex; - UINT stateindex; - PUCHAR state; - UINT counter; + u8 t, u; + u32 keyindex; + u32 stateindex; + u8 *state; + u32 counter; state = Ctx->STATE; Ctx->X = 0; Ctx->Y = 0; for (counter = 0; counter < 256; counter++) - state[counter] = (UCHAR) counter; + state[counter] = (u8)counter; keyindex = 0; stateindex = 0; for (counter = 0; counter < 256; counter++) { @@ -307,18 +307,18 @@ VOID ARCFOUR_INIT(IN PARCFOURCONTEXT Ctx, IN PUCHAR pKey, IN UINT KeyLen) Ctx Pointer to ARCFOUR CONTEXT (SBOX) Return Value: - UCHAR - the value of the ARCFOUR CONTEXT (S-BOX) + u8 - the value of the ARCFOUR CONTEXT (S-BOX) Note: ======================================================================== */ -UCHAR ARCFOUR_BYTE(IN PARCFOURCONTEXT Ctx) +u8 ARCFOUR_BYTE(IN PARCFOURCONTEXT Ctx) { - UINT x; - UINT y; - UCHAR sx, sy; - PUCHAR state; + u32 x; + u32 y; + u8 sx, sy; + u8 *state; state = Ctx->STATE; x = (Ctx->X + 1) & 0xff; @@ -353,10 +353,10 @@ UCHAR ARCFOUR_BYTE(IN PARCFOURCONTEXT Ctx) ======================================================================== */ -VOID ARCFOUR_DECRYPT(IN PARCFOURCONTEXT Ctx, - IN PUCHAR pDest, IN PUCHAR pSrc, IN UINT Len) +void ARCFOUR_DECRYPT(IN PARCFOURCONTEXT Ctx, + u8 *pDest, u8 *pSrc, u32 Len) { - UINT i; + u32 i; for (i = 0; i < Len; i++) pDest[i] = pSrc[i] ^ ARCFOUR_BYTE(Ctx); @@ -383,10 +383,10 @@ VOID ARCFOUR_DECRYPT(IN PARCFOURCONTEXT Ctx, ======================================================================== */ -VOID ARCFOUR_ENCRYPT(IN PARCFOURCONTEXT Ctx, - IN PUCHAR pDest, IN PUCHAR pSrc, IN UINT Len) +void ARCFOUR_ENCRYPT(IN PARCFOURCONTEXT Ctx, + u8 *pDest, u8 *pSrc, u32 Len) { - UINT i; + u32 i; for (i = 0; i < Len; i++) pDest[i] = pSrc[i] ^ ARCFOUR_BYTE(Ctx); @@ -407,10 +407,10 @@ VOID ARCFOUR_ENCRYPT(IN PARCFOURCONTEXT Ctx, ======================================================================== */ -VOID WPAARCFOUR_ENCRYPT(IN PARCFOURCONTEXT Ctx, - IN PUCHAR pDest, IN PUCHAR pSrc, IN UINT Len) +void WPAARCFOUR_ENCRYPT(IN PARCFOURCONTEXT Ctx, + u8 *pDest, u8 *pSrc, u32 Len) { - UINT i; + u32 i; /*discard first 256 bytes */ for (i = 0; i < 256; i++) ARCFOUR_BYTE(Ctx); @@ -431,7 +431,7 @@ VOID WPAARCFOUR_ENCRYPT(IN PARCFOURCONTEXT Ctx, Len the length of the data Return Value: - UINT - FCS 32 bits + u32 - FCS 32 bits IRQL = DISPATCH_LEVEL @@ -439,7 +439,7 @@ VOID WPAARCFOUR_ENCRYPT(IN PARCFOURCONTEXT Ctx, ======================================================================== */ -UINT RTMP_CALC_FCS32(IN UINT Fcs, IN PUCHAR Cp, IN INT Len) +u32 RTMP_CALC_FCS32(u32 Fcs, u8 *Cp, int Len) { while (Len--) Fcs = (((Fcs) >> 8) ^ FCSTAB_32[((Fcs) ^ (*Cp++)) & 0xff]); @@ -463,11 +463,11 @@ UINT RTMP_CALC_FCS32(IN UINT Fcs, IN PUCHAR Cp, IN INT Len) ======================================================================== */ -VOID RTMPSetICV(IN PRTMP_ADAPTER pAd, IN PUCHAR pDest) +void RTMPSetICV(IN PRTMP_ADAPTER pAd, u8 *pDest) { pAd->PrivateInfo.FCSCRC32 ^= 0xffffffff; /* complement */ pAd->PrivateInfo.FCSCRC32 = cpu2le32(pAd->PrivateInfo.FCSCRC32); ARCFOUR_ENCRYPT(&pAd->PrivateInfo.WEPCONTEXT, pDest, - (PUCHAR) & pAd->PrivateInfo.FCSCRC32, 4); + (u8 *)& pAd->PrivateInfo.FCSCRC32, 4); } diff --git a/drivers/staging/rt2860/common/cmm_wpa.c b/drivers/staging/rt2860/common/cmm_wpa.c index 6940d778985..3fce5a71719 100644 --- a/drivers/staging/rt2860/common/cmm_wpa.c +++ b/drivers/staging/rt2860/common/cmm_wpa.c @@ -37,47 +37,47 @@ */ #include "../rt_config.h" /* WPA OUI */ -UCHAR OUI_WPA_NONE_AKM[4] = { 0x00, 0x50, 0xF2, 0x00 }; -UCHAR OUI_WPA_VERSION[4] = { 0x00, 0x50, 0xF2, 0x01 }; -UCHAR OUI_WPA_WEP40[4] = { 0x00, 0x50, 0xF2, 0x01 }; -UCHAR OUI_WPA_TKIP[4] = { 0x00, 0x50, 0xF2, 0x02 }; -UCHAR OUI_WPA_CCMP[4] = { 0x00, 0x50, 0xF2, 0x04 }; -UCHAR OUI_WPA_WEP104[4] = { 0x00, 0x50, 0xF2, 0x05 }; -UCHAR OUI_WPA_8021X_AKM[4] = { 0x00, 0x50, 0xF2, 0x01 }; -UCHAR OUI_WPA_PSK_AKM[4] = { 0x00, 0x50, 0xF2, 0x02 }; +u8 OUI_WPA_NONE_AKM[4] = { 0x00, 0x50, 0xF2, 0x00 }; +u8 OUI_WPA_VERSION[4] = { 0x00, 0x50, 0xF2, 0x01 }; +u8 OUI_WPA_WEP40[4] = { 0x00, 0x50, 0xF2, 0x01 }; +u8 OUI_WPA_TKIP[4] = { 0x00, 0x50, 0xF2, 0x02 }; +u8 OUI_WPA_CCMP[4] = { 0x00, 0x50, 0xF2, 0x04 }; +u8 OUI_WPA_WEP104[4] = { 0x00, 0x50, 0xF2, 0x05 }; +u8 OUI_WPA_8021X_AKM[4] = { 0x00, 0x50, 0xF2, 0x01 }; +u8 OUI_WPA_PSK_AKM[4] = { 0x00, 0x50, 0xF2, 0x02 }; /* WPA2 OUI */ -UCHAR OUI_WPA2_WEP40[4] = { 0x00, 0x0F, 0xAC, 0x01 }; -UCHAR OUI_WPA2_TKIP[4] = { 0x00, 0x0F, 0xAC, 0x02 }; -UCHAR OUI_WPA2_CCMP[4] = { 0x00, 0x0F, 0xAC, 0x04 }; -UCHAR OUI_WPA2_8021X_AKM[4] = { 0x00, 0x0F, 0xAC, 0x01 }; -UCHAR OUI_WPA2_PSK_AKM[4] = { 0x00, 0x0F, 0xAC, 0x02 }; -UCHAR OUI_WPA2_WEP104[4] = { 0x00, 0x0F, 0xAC, 0x05 }; - -static VOID ConstructEapolKeyData(IN PMAC_TABLE_ENTRY pEntry, - IN UCHAR GroupKeyWepStatus, - IN UCHAR keyDescVer, - IN UCHAR MsgType, - IN UCHAR DefaultKeyIdx, - IN UCHAR * GTK, - IN UCHAR * RSNIE, - IN UCHAR RSNIE_LEN, OUT PEAPOL_PACKET pMsg); - -static VOID CalculateMIC(IN UCHAR KeyDescVer, - IN UCHAR * PTK, OUT PEAPOL_PACKET pMsg); - -static VOID WpaEAPPacketAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem); - -static VOID WpaEAPOLASFAlertAction(IN PRTMP_ADAPTER pAd, +u8 OUI_WPA2_WEP40[4] = { 0x00, 0x0F, 0xAC, 0x01 }; +u8 OUI_WPA2_TKIP[4] = { 0x00, 0x0F, 0xAC, 0x02 }; +u8 OUI_WPA2_CCMP[4] = { 0x00, 0x0F, 0xAC, 0x04 }; +u8 OUI_WPA2_8021X_AKM[4] = { 0x00, 0x0F, 0xAC, 0x01 }; +u8 OUI_WPA2_PSK_AKM[4] = { 0x00, 0x0F, 0xAC, 0x02 }; +u8 OUI_WPA2_WEP104[4] = { 0x00, 0x0F, 0xAC, 0x05 }; + +static void ConstructEapolKeyData(IN PMAC_TABLE_ENTRY pEntry, + u8 GroupKeyWepStatus, + u8 keyDescVer, + u8 MsgType, + u8 DefaultKeyIdx, + u8 * GTK, + u8 * RSNIE, + u8 RSNIE_LEN, OUT PEAPOL_PACKET pMsg); + +static void CalculateMIC(u8 KeyDescVer, + u8 * PTK, OUT PEAPOL_PACKET pMsg); + +static void WpaEAPPacketAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem); + +static void WpaEAPOLASFAlertAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem); -static VOID WpaEAPOLLogoffAction(IN PRTMP_ADAPTER pAd, +static void WpaEAPOLLogoffAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem); -static VOID WpaEAPOLStartAction(IN PRTMP_ADAPTER pAd, +static void WpaEAPOLStartAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem); -static VOID WpaEAPOLKeyAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem); +static void WpaEAPOLKeyAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem); /* ========================================================================== @@ -87,7 +87,7 @@ static VOID WpaEAPOLKeyAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem); S - pointer to the association state machine ========================================================================== */ -VOID WpaStateMachineInit(IN PRTMP_ADAPTER pAd, +void WpaStateMachineInit(IN PRTMP_ADAPTER pAd, IN STATE_MACHINE * S, OUT STATE_MACHINE_FUNC Trans[]) { StateMachineInit(S, (STATE_MACHINE_FUNC *) Trans, MAX_WPA_PTK_STATE, @@ -115,15 +115,15 @@ VOID WpaStateMachineInit(IN PRTMP_ADAPTER pAd, Return: ========================================================================== */ -VOID WpaEAPPacketAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) +void WpaEAPPacketAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) { } -VOID WpaEAPOLASFAlertAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) +void WpaEAPOLASFAlertAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) { } -VOID WpaEAPOLLogoffAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) +void WpaEAPOLLogoffAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) { } @@ -134,7 +134,7 @@ VOID WpaEAPOLLogoffAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) Return: ========================================================================== */ -VOID WpaEAPOLStartAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) +void WpaEAPOLStartAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) { MAC_TABLE_ENTRY *pEntry; PHEADER_802_11 pHeader; @@ -187,7 +187,7 @@ VOID WpaEAPOLStartAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) Return: ========================================================================== */ -VOID WpaEAPOLKeyAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) +void WpaEAPOLKeyAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) { MAC_TABLE_ENTRY *pEntry; PHEADER_802_11 pHeader; @@ -200,15 +200,15 @@ VOID WpaEAPOLKeyAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) pEapol_packet = (PEAPOL_PACKET) & Elem->Msg[LENGTH_802_11 + LENGTH_802_1_H]; - NdisZeroMemory((PUCHAR) & peerKeyInfo, sizeof(peerKeyInfo)); - NdisMoveMemory((PUCHAR) & peerKeyInfo, - (PUCHAR) & pEapol_packet->KeyDesc.KeyInfo, + NdisZeroMemory((u8 *)& peerKeyInfo, sizeof(peerKeyInfo)); + NdisMoveMemory((u8 *)& peerKeyInfo, + (u8 *)& pEapol_packet->KeyDesc.KeyInfo, sizeof(KEY_INFO)); hex_dump("Received Eapol frame", (unsigned char *)pEapol_packet, (Elem->MsgLen - LENGTH_802_11 - LENGTH_802_1_H)); - *((USHORT *) & peerKeyInfo) = cpu2le16(*((USHORT *) & peerKeyInfo)); + *((u16 *) & peerKeyInfo) = cpu2le16(*((u16 *) & peerKeyInfo)); do { pEntry = MacTableLookup(pAd, pHeader->Addr2); @@ -300,7 +300,7 @@ VOID WpaEAPOLKeyAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) /* EAPOL-Key(0,1,0,0,P,0,0,SNonce,MIC,Data) */ /* Process 1. message 2 of 4-way HS in WPA or WPA2 */ /* 2. message 4 of 4-way HS in WPA */ - if (CONV_ARRARY_TO_UINT16 + if (CONV_ARRARY_TO_u16 (pEapol_packet->KeyDesc. KeyDataLen) == 0) { PeerPairMsg4Action(pAd, @@ -357,14 +357,14 @@ VOID WpaEAPOLKeyAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) ======================================================================== */ -VOID RTMPToWirelessSta(IN PRTMP_ADAPTER pAd, +void RTMPToWirelessSta(IN PRTMP_ADAPTER pAd, IN PMAC_TABLE_ENTRY pEntry, - IN PUCHAR pHeader802_3, - IN UINT HdrLen, - IN PUCHAR pData, IN UINT DataLen, IN BOOLEAN bClearFrame) + u8 *pHeader802_3, + u32 HdrLen, + u8 *pData, u32 DataLen, IN BOOLEAN bClearFrame) { PNDIS_PACKET pPacket; - NDIS_STATUS Status; + int Status; if ((!pEntry) || ((!pEntry->ValidAsCLI) && (!pEntry->ValidAsApCli))) return; @@ -390,7 +390,7 @@ VOID RTMPToWirelessSta(IN PRTMP_ADAPTER pAd, pEntry-> apidx); - RTMP_SET_PACKET_WCID(pPacket, (UCHAR) pEntry->Aid); + RTMP_SET_PACKET_WCID(pPacket, (u8)pEntry->Aid); RTMP_SET_PACKET_MOREDATA(pPacket, FALSE); } @@ -398,7 +398,7 @@ VOID RTMPToWirelessSta(IN PRTMP_ADAPTER pAd, /* send out the packet */ Status = STASendPacket(pAd, pPacket); if (Status == NDIS_STATUS_SUCCESS) { - UCHAR Index; + u8 Index; /* Dequeue one frame from TxSwQueue0..3 queue and process it */ /* There are three place calling dequeue for TX ring. */ @@ -433,13 +433,13 @@ VOID RTMPToWirelessSta(IN PRTMP_ADAPTER pAd, ========================================================================== */ -VOID WPAStart4WayHS(IN PRTMP_ADAPTER pAd, - IN MAC_TABLE_ENTRY * pEntry, IN ULONG TimeInterval) +void WPAStart4WayHS(IN PRTMP_ADAPTER pAd, + IN MAC_TABLE_ENTRY * pEntry, unsigned long TimeInterval) { - UCHAR Header802_3[14]; + u8 Header802_3[14]; EAPOL_PACKET EAPOLPKT; - PUINT8 pBssid = NULL; - UCHAR group_cipher = Ndis802_11WEPDisabled; + u8 *pBssid = NULL; + u8 group_cipher = Ndis802_11WEPDisabled; DBGPRINT(RT_DEBUG_TRACE, ("===> WPAStart4WayHS\n")); @@ -468,7 +468,7 @@ VOID WPAStart4WayHS(IN PRTMP_ADAPTER pAd, ADD_ONE_To_64BIT_VAR(pEntry->R_Counter); /* Randomly generate ANonce */ - GenRandom(pAd, (UCHAR *) pBssid, pEntry->ANonce); + GenRandom(pAd, (u8 *) pBssid, pEntry->ANonce); /* Construct EAPoL message - Pairwise Msg 1 */ /* EAPOL-Key(0,0,1,0,P,0,0,ANonce,0,DataKD_M1) */ @@ -483,8 +483,8 @@ VOID WPAStart4WayHS(IN PRTMP_ADAPTER pAd, /* Make outgoing frame */ MAKE_802_3_HEADER(Header802_3, pEntry->Addr, pBssid, EAPOL); RTMPToWirelessSta(pAd, pEntry, Header802_3, - LENGTH_802_3, (PUCHAR) & EAPOLPKT, - CONV_ARRARY_TO_UINT16(EAPOLPKT.Body_Len) + 4, + LENGTH_802_3, (u8 *)& EAPOLPKT, + CONV_ARRARY_TO_u16(EAPOLPKT.Body_Len) + 4, (pEntry->PortSecured == WPA_802_1X_PORT_SECURED) ? FALSE : TRUE); @@ -516,19 +516,19 @@ VOID WPAStart4WayHS(IN PRTMP_ADAPTER pAd, ======================================================================== */ -VOID PeerPairMsg1Action(IN PRTMP_ADAPTER pAd, +void PeerPairMsg1Action(IN PRTMP_ADAPTER pAd, IN MAC_TABLE_ENTRY * pEntry, IN MLME_QUEUE_ELEM * Elem) { - UCHAR PTK[80]; - UCHAR Header802_3[14]; + u8 PTK[80]; + u8 Header802_3[14]; PEAPOL_PACKET pMsg1; - UINT MsgLen; + u32 MsgLen; EAPOL_PACKET EAPOLPKT; - PUINT8 pCurrentAddr = NULL; - PUINT8 pmk_ptr = NULL; - UCHAR group_cipher = Ndis802_11WEPDisabled; - PUINT8 rsnie_ptr = NULL; - UCHAR rsnie_len = 0; + u8 *pCurrentAddr = NULL; + u8 *pmk_ptr = NULL; + u8 group_cipher = Ndis802_11WEPDisabled; + u8 *rsnie_ptr = NULL; + u8 rsnie_len = 0; DBGPRINT(RT_DEBUG_TRACE, ("===> PeerPairMsg1Action \n")); @@ -566,7 +566,7 @@ VOID PeerPairMsg1Action(IN PRTMP_ADAPTER pAd, LEN_KEY_DESC_NONCE); /* Generate random SNonce */ - GenRandom(pAd, (UCHAR *) pCurrentAddr, pEntry->SNonce); + GenRandom(pAd, (u8 *) pCurrentAddr, pEntry->SNonce); { /* Calculate PTK(ANonce, SNonce) */ @@ -589,14 +589,14 @@ VOID PeerPairMsg1Action(IN PRTMP_ADAPTER pAd, ConstructEapolMsg(pEntry, group_cipher, EAPOL_PAIR_MSG_2, 0, /* DefaultKeyIdx */ pEntry->SNonce, NULL, /* TxRsc */ NULL, /* GTK */ - (UCHAR *) rsnie_ptr, rsnie_len, &EAPOLPKT); + (u8 *) rsnie_ptr, rsnie_len, &EAPOLPKT); /* Make outgoing frame */ MAKE_802_3_HEADER(Header802_3, pEntry->Addr, pCurrentAddr, EAPOL); RTMPToWirelessSta(pAd, pEntry, - Header802_3, sizeof(Header802_3), (PUCHAR) & EAPOLPKT, - CONV_ARRARY_TO_UINT16(EAPOLPKT.Body_Len) + 4, TRUE); + Header802_3, sizeof(Header802_3), (u8 *)& EAPOLPKT, + CONV_ARRARY_TO_u16(EAPOLPKT.Body_Len) + 4, TRUE); DBGPRINT(RT_DEBUG_TRACE, ("<=== PeerPairMsg1Action: send Msg2 of 4-way \n")); @@ -609,24 +609,24 @@ VOID PeerPairMsg1Action(IN PRTMP_ADAPTER pAd, Return: ========================================================================== */ -VOID PeerPairMsg2Action(IN PRTMP_ADAPTER pAd, +void PeerPairMsg2Action(IN PRTMP_ADAPTER pAd, IN MAC_TABLE_ENTRY * pEntry, IN MLME_QUEUE_ELEM * Elem) { - UCHAR PTK[80]; + u8 PTK[80]; BOOLEAN Cancelled; PHEADER_802_11 pHeader; EAPOL_PACKET EAPOLPKT; PEAPOL_PACKET pMsg2; - UINT MsgLen; - UCHAR Header802_3[LENGTH_802_3]; - UCHAR TxTsc[6]; - PUINT8 pBssid = NULL; - PUINT8 pmk_ptr = NULL; - PUINT8 gtk_ptr = NULL; - UCHAR default_key = 0; - UCHAR group_cipher = Ndis802_11WEPDisabled; - PUINT8 rsnie_ptr = NULL; - UCHAR rsnie_len = 0; + u32 MsgLen; + u8 Header802_3[LENGTH_802_3]; + u8 TxTsc[6]; + u8 *pBssid = NULL; + u8 *pmk_ptr = NULL; + u8 *gtk_ptr = NULL; + u8 default_key = 0; + u8 group_cipher = Ndis802_11WEPDisabled; + u8 *rsnie_ptr = NULL; + u8 rsnie_len = 0; DBGPRINT(RT_DEBUG_TRACE, ("===> PeerPairMsg2Action \n")); @@ -655,8 +655,8 @@ VOID PeerPairMsg2Action(IN PRTMP_ADAPTER pAd, { /* Derive PTK */ - WpaDerivePTK(pAd, (UCHAR *) pmk_ptr, pEntry->ANonce, /* ANONCE */ - (UCHAR *) pBssid, pEntry->SNonce, /* SNONCE */ + WpaDerivePTK(pAd, (u8 *) pmk_ptr, pEntry->ANonce, /* ANONCE */ + (u8 *) pBssid, pEntry->SNonce, /* SNONCE */ pEntry->Addr, PTK, LEN_PTK); NdisMoveMemory(pEntry->PTK, PTK, LEN_PTK); @@ -685,14 +685,14 @@ VOID PeerPairMsg2Action(IN PRTMP_ADAPTER pAd, default_key, pEntry->ANonce, TxTsc, - (UCHAR *) gtk_ptr, - (UCHAR *) rsnie_ptr, rsnie_len, &EAPOLPKT); + (u8 *) gtk_ptr, + (u8 *) rsnie_ptr, rsnie_len, &EAPOLPKT); /* Make outgoing frame */ MAKE_802_3_HEADER(Header802_3, pEntry->Addr, pBssid, EAPOL); RTMPToWirelessSta(pAd, pEntry, Header802_3, LENGTH_802_3, - (PUCHAR) & EAPOLPKT, - CONV_ARRARY_TO_UINT16(EAPOLPKT.Body_Len) + 4, + (u8 *)& EAPOLPKT, + CONV_ARRARY_TO_u16(EAPOLPKT.Body_Len) + 4, (pEntry->PortSecured == WPA_802_1X_PORT_SECURED) ? FALSE : TRUE); @@ -724,16 +724,16 @@ VOID PeerPairMsg2Action(IN PRTMP_ADAPTER pAd, ======================================================================== */ -VOID PeerPairMsg3Action(IN PRTMP_ADAPTER pAd, +void PeerPairMsg3Action(IN PRTMP_ADAPTER pAd, IN MAC_TABLE_ENTRY * pEntry, IN MLME_QUEUE_ELEM * Elem) { PHEADER_802_11 pHeader; - UCHAR Header802_3[14]; + u8 Header802_3[14]; EAPOL_PACKET EAPOLPKT; PEAPOL_PACKET pMsg3; - UINT MsgLen; - PUINT8 pCurrentAddr = NULL; - UCHAR group_cipher = Ndis802_11WEPDisabled; + u32 MsgLen; + u8 *pCurrentAddr = NULL; + u8 group_cipher = Ndis802_11WEPDisabled; DBGPRINT(RT_DEBUG_TRACE, ("===> PeerPairMsg3Action \n")); @@ -856,8 +856,8 @@ VOID PeerPairMsg3Action(IN PRTMP_ADAPTER pAd, MAKE_802_3_HEADER(Header802_3, pEntry->Addr, pCurrentAddr, EAPOL); RTMPToWirelessSta(pAd, pEntry, Header802_3, sizeof(Header802_3), - (PUCHAR) & EAPOLPKT, - CONV_ARRARY_TO_UINT16(EAPOLPKT.Body_Len) + 4, TRUE); + (u8 *)& EAPOLPKT, + CONV_ARRARY_TO_u16(EAPOLPKT.Body_Len) + 4, TRUE); DBGPRINT(RT_DEBUG_TRACE, ("<=== PeerPairMsg3Action: send Msg4 of 4-way \n")); @@ -871,14 +871,14 @@ VOID PeerPairMsg3Action(IN PRTMP_ADAPTER pAd, Return: ========================================================================== */ -VOID PeerPairMsg4Action(IN PRTMP_ADAPTER pAd, +void PeerPairMsg4Action(IN PRTMP_ADAPTER pAd, IN MAC_TABLE_ENTRY * pEntry, IN MLME_QUEUE_ELEM * Elem) { PEAPOL_PACKET pMsg4; PHEADER_802_11 pHeader; - UINT MsgLen; + u32 MsgLen; BOOLEAN Cancelled; - UCHAR group_cipher = Ndis802_11WEPDisabled; + u8 group_cipher = Ndis802_11WEPDisabled; DBGPRINT(RT_DEBUG_TRACE, ("===> PeerPairMsg4Action\n")); @@ -935,7 +935,7 @@ VOID PeerPairMsg4Action(IN PRTMP_ADAPTER pAd, /* Add Pair-wise key to Asic */ AsicAddPairwiseKeyEntry(pAd, pEntry->Addr, - (UCHAR) pEntry->Aid, + (u8)pEntry->Aid, &pEntry->PairwiseKey); /* update WCID attribute table and IVEIV table for this entry */ @@ -990,16 +990,16 @@ VOID PeerPairMsg4Action(IN PRTMP_ADAPTER pAd, ========================================================================== */ -VOID WPAStart2WayGroupHS(IN PRTMP_ADAPTER pAd, IN MAC_TABLE_ENTRY * pEntry) +void WPAStart2WayGroupHS(IN PRTMP_ADAPTER pAd, IN MAC_TABLE_ENTRY * pEntry) { - UCHAR Header802_3[14]; - UCHAR TxTsc[6]; + u8 Header802_3[14]; + u8 TxTsc[6]; EAPOL_PACKET EAPOLPKT; - UCHAR group_cipher = Ndis802_11WEPDisabled; - UCHAR default_key = 0; - PUINT8 gnonce_ptr = NULL; - PUINT8 gtk_ptr = NULL; - PUINT8 pBssid = NULL; + u8 group_cipher = Ndis802_11WEPDisabled; + u8 default_key = 0; + u8 *gnonce_ptr = NULL; + u8 *gtk_ptr = NULL; + u8 *pBssid = NULL; DBGPRINT(RT_DEBUG_TRACE, ("===> WPAStart2WayGroupHS\n")); @@ -1016,15 +1016,15 @@ VOID WPAStart2WayGroupHS(IN PRTMP_ADAPTER pAd, IN MAC_TABLE_ENTRY * pEntry) group_cipher, EAPOL_GROUP_MSG_1, default_key, - (UCHAR *) gnonce_ptr, - TxTsc, (UCHAR *) gtk_ptr, NULL, 0, &EAPOLPKT); + (u8 *) gnonce_ptr, + TxTsc, (u8 *) gtk_ptr, NULL, 0, &EAPOLPKT); /* Make outgoing frame */ MAKE_802_3_HEADER(Header802_3, pEntry->Addr, pBssid, EAPOL); RTMPToWirelessSta(pAd, pEntry, Header802_3, LENGTH_802_3, - (PUCHAR) & EAPOLPKT, - CONV_ARRARY_TO_UINT16(EAPOLPKT.Body_Len) + 4, + (u8 *)& EAPOLPKT, + CONV_ARRARY_TO_u16(EAPOLPKT.Body_Len) + 4, FALSE); } while (FALSE); @@ -1052,17 +1052,17 @@ VOID WPAStart2WayGroupHS(IN PRTMP_ADAPTER pAd, IN MAC_TABLE_ENTRY * pEntry) ======================================================================== */ -VOID PeerGroupMsg1Action(IN PRTMP_ADAPTER pAd, +void PeerGroupMsg1Action(IN PRTMP_ADAPTER pAd, IN MAC_TABLE_ENTRY * pEntry, IN MLME_QUEUE_ELEM * Elem) { - UCHAR Header802_3[14]; + u8 Header802_3[14]; EAPOL_PACKET EAPOLPKT; PEAPOL_PACKET pGroup; - UINT MsgLen; + u32 MsgLen; BOOLEAN Cancelled; - UCHAR default_key = 0; - UCHAR group_cipher = Ndis802_11WEPDisabled; - PUINT8 pCurrentAddr = NULL; + u8 default_key = 0; + u8 group_cipher = Ndis802_11WEPDisabled; + u8 *pCurrentAddr = NULL; DBGPRINT(RT_DEBUG_TRACE, ("===> PeerGroupMsg1Action \n")); @@ -1117,8 +1117,8 @@ VOID PeerGroupMsg1Action(IN PRTMP_ADAPTER pAd, MAKE_802_3_HEADER(Header802_3, pEntry->Addr, pCurrentAddr, EAPOL); RTMPToWirelessSta(pAd, pEntry, Header802_3, sizeof(Header802_3), - (PUCHAR) & EAPOLPKT, - CONV_ARRARY_TO_UINT16(EAPOLPKT.Body_Len) + 4, FALSE); + (u8 *)& EAPOLPKT, + CONV_ARRARY_TO_u16(EAPOLPKT.Body_Len) + 4, FALSE); DBGPRINT(RT_DEBUG_TRACE, ("<=== PeerGroupMsg1Action: sned group message 2\n")); @@ -1131,15 +1131,15 @@ VOID PeerGroupMsg1Action(IN PRTMP_ADAPTER pAd, Return: ========================================================================== */ -VOID PeerGroupMsg2Action(IN PRTMP_ADAPTER pAd, +void PeerGroupMsg2Action(IN PRTMP_ADAPTER pAd, IN MAC_TABLE_ENTRY * pEntry, - IN VOID * Msg, IN UINT MsgLen) + void * Msg, u32 MsgLen) { - UINT Len; - PUCHAR pData; + u32 Len; + u8 *pData; BOOLEAN Cancelled; PEAPOL_PACKET pMsg2; - UCHAR group_cipher = Ndis802_11WEPDisabled; + u8 group_cipher = Ndis802_11WEPDisabled; DBGPRINT(RT_DEBUG_TRACE, ("===> PeerGroupMsg2Action \n")); @@ -1155,7 +1155,7 @@ VOID PeerGroupMsg2Action(IN PRTMP_ADAPTER pAd, if (pEntry->WpaState != AS_PTKINITDONE) break; - pData = (PUCHAR) Msg; + pData = (u8 *)Msg; pMsg2 = (PEAPOL_PACKET) (pData + LENGTH_802_1_H); Len = MsgLen - LENGTH_802_1_H; @@ -1226,7 +1226,7 @@ VOID PeerGroupMsg2Action(IN PRTMP_ADAPTER pAd, ======================================================================== */ -BOOLEAN WpaMsgTypeSubst(IN UCHAR EAPType, OUT INT * MsgType) +BOOLEAN WpaMsgTypeSubst(u8 EAPType, int * MsgType) { switch (EAPType) { case EAPPacket: @@ -1261,35 +1261,35 @@ BOOLEAN WpaMsgTypeSubst(IN UCHAR EAPType, OUT INT * MsgType) It is used to generate PTK, GTK or some specific random value. Arguments: - UCHAR *key, - the key material for HMAC_SHA1 use - INT key_len - the length of key - UCHAR *prefix - a prefix label - INT prefix_len - the length of the label - UCHAR *data - a specific data with variable length - INT data_len - the length of a specific data - INT len - the output lenght + u8 *key, - the key material for HMAC_SHA1 use + int key_len - the length of key + u8 *prefix - a prefix label + int prefix_len - the length of the label + u8 *data - a specific data with variable length + int data_len - the length of a specific data + int len - the output lenght Return Value: - UCHAR *output - the calculated result + u8 *output - the calculated result Note: 802.11i-2004 Annex H.3 ======================================================================== */ -VOID PRF(IN UCHAR * key, - IN INT key_len, - IN UCHAR * prefix, - IN INT prefix_len, - IN UCHAR * data, IN INT data_len, OUT UCHAR * output, IN INT len) +void PRF(u8 * key, + int key_len, + u8 * prefix, + int prefix_len, + u8 * data, int data_len, u8 * output, int len) { - INT i; - UCHAR *input; - INT currentindex = 0; - INT total_len; + int i; + u8 *input; + int currentindex = 0; + int total_len; /* Allocate memory for input */ - os_alloc_mem(NULL, (PUCHAR *) & input, 1024); + os_alloc_mem(NULL, (u8 **) & input, 1024); if (input == NULL) { DBGPRINT(RT_DEBUG_ERROR, ("!!!PRF: no memory!!!\n")); @@ -1365,7 +1365,7 @@ static void F(char *password, unsigned char *ssid, int ssidlength, * ssidlength - length of ssid in octets * output must be 40 octets in length and outputs 256 bits of key */ -int PasswordHash(PSTRING password, PUCHAR ssid, INT ssidlength, PUCHAR output) +int PasswordHash(char *password, u8 *ssid, int ssidlength, u8 *output) { if ((strlen(password) > 63) || (ssidlength > 32)) return 0; @@ -1399,17 +1399,17 @@ int PasswordHash(PSTRING password, PUCHAR ssid, INT ssidlength, PUCHAR output) ======================================================================== */ -VOID WpaDerivePTK(IN PRTMP_ADAPTER pAd, - IN UCHAR * PMK, - IN UCHAR * ANonce, - IN UCHAR * AA, - IN UCHAR * SNonce, - IN UCHAR * SA, OUT UCHAR * output, IN UINT len) +void WpaDerivePTK(IN PRTMP_ADAPTER pAd, + u8 * PMK, + u8 * ANonce, + u8 * AA, + u8 * SNonce, + u8 * SA, u8 * output, u32 len) { - UCHAR concatenation[76]; - UINT CurrPos = 0; - UCHAR temp[32]; - UCHAR Prefix[] = + u8 concatenation[76]; + u32 CurrPos = 0; + u8 temp[32]; + u8 Prefix[] = { 'P', 'a', 'i', 'r', 'w', 'i', 's', 'e', ' ', 'k', 'e', 'y', ' ', 'e', 'x', 'p', 'a', 'n', 's', 'i', 'o', 'n' }; @@ -1478,13 +1478,13 @@ VOID WpaDerivePTK(IN PRTMP_ADAPTER pAd, ======================================================================== */ -VOID GenRandom(IN PRTMP_ADAPTER pAd, IN UCHAR * macAddr, OUT UCHAR * random) +void GenRandom(IN PRTMP_ADAPTER pAd, u8 * macAddr, u8 * random) { - INT i, curr; - UCHAR local[80], KeyCounter[32]; - UCHAR result[80]; - ULONG CurrentTime; - UCHAR prefix[] = + int i, curr; + u8 local[80], KeyCounter[32]; + u8 result[80]; + unsigned long CurrentTime; + u8 prefix[] = { 'I', 'n', 'i', 't', ' ', 'C', 'o', 'u', 'n', 't', 'e', 'r' }; /* Zero the related information */ @@ -1537,14 +1537,14 @@ VOID GenRandom(IN PRTMP_ADAPTER pAd, IN UCHAR * macAddr, OUT UCHAR * random) ======================================================================== */ -static VOID RTMPMakeRsnIeCipher(IN PRTMP_ADAPTER pAd, - IN UCHAR ElementID, - IN UINT WepStatus, +static void RTMPMakeRsnIeCipher(IN PRTMP_ADAPTER pAd, + u8 ElementID, + u32 WepStatus, IN BOOLEAN bMixCipher, - IN UCHAR FlexibleCipher, - OUT PUCHAR pRsnIe, OUT UCHAR * rsn_len) + u8 FlexibleCipher, + u8 *pRsnIe, u8 * rsn_len) { - UCHAR PairwiseCnt; + u8 PairwiseCnt; *rsn_len = 0; @@ -1609,7 +1609,7 @@ static VOID RTMPMakeRsnIeCipher(IN PRTMP_ADAPTER pAd, if ((pAd->OpMode == OPMODE_STA) && (pAd->StaCfg.GroupCipher != Ndis802_11Encryption2Enabled) && (pAd->StaCfg.GroupCipher != Ndis802_11Encryption3Enabled)) { - UINT GroupCipher = pAd->StaCfg.GroupCipher; + u32 GroupCipher = pAd->StaCfg.GroupCipher; switch (GroupCipher) { case Ndis802_11GroupWEP40Enabled: NdisMoveMemory(pRsnie_cipher->mcast, @@ -1685,7 +1685,7 @@ static VOID RTMPMakeRsnIeCipher(IN PRTMP_ADAPTER pAd, if ((pAd->OpMode == OPMODE_STA) && (pAd->StaCfg.GroupCipher != Ndis802_11Encryption2Enabled) && (pAd->StaCfg.GroupCipher != Ndis802_11Encryption3Enabled)) { - UINT GroupCipher = pAd->StaCfg.GroupCipher; + u32 GroupCipher = pAd->StaCfg.GroupCipher; switch (GroupCipher) { case Ndis802_11GroupWEP40Enabled: NdisMoveMemory(pRsnie_cipher->mcast, @@ -1722,14 +1722,14 @@ static VOID RTMPMakeRsnIeCipher(IN PRTMP_ADAPTER pAd, ======================================================================== */ -static VOID RTMPMakeRsnIeAKM(IN PRTMP_ADAPTER pAd, - IN UCHAR ElementID, - IN UINT AuthMode, - IN UCHAR apidx, - OUT PUCHAR pRsnIe, OUT UCHAR * rsn_len) +static void RTMPMakeRsnIeAKM(IN PRTMP_ADAPTER pAd, + u8 ElementID, + u32 AuthMode, + u8 apidx, + u8 *pRsnIe, u8 * rsn_len) { RSNIE_AUTH *pRsnie_auth; - UCHAR AkmCnt = 1; /* default as 1 */ + u8 AkmCnt = 1; /* default as 1 */ pRsnie_auth = (RSNIE_AUTH *) (pRsnIe + (*rsn_len)); @@ -1803,10 +1803,10 @@ static VOID RTMPMakeRsnIeAKM(IN PRTMP_ADAPTER pAd, ======================================================================== */ -static VOID RTMPMakeRsnIeCap(IN PRTMP_ADAPTER pAd, - IN UCHAR ElementID, - IN UCHAR apidx, - OUT PUCHAR pRsnIe, OUT UCHAR * rsn_len) +static void RTMPMakeRsnIeCap(IN PRTMP_ADAPTER pAd, + u8 ElementID, + u8 apidx, + u8 *pRsnIe, u8 * rsn_len) { RSN_CAPABILITIES *pRSN_Cap; @@ -1840,15 +1840,15 @@ static VOID RTMPMakeRsnIeCap(IN PRTMP_ADAPTER pAd, ======================================================================== */ -VOID RTMPMakeRSNIE(IN PRTMP_ADAPTER pAd, - IN UINT AuthMode, IN UINT WepStatus, IN UCHAR apidx) +void RTMPMakeRSNIE(IN PRTMP_ADAPTER pAd, + u32 AuthMode, u32 WepStatus, u8 apidx) { - PUCHAR pRsnIe = NULL; /* primary RSNIE */ - UCHAR *rsnielen_cur_p = 0; /* the length of the primary RSNIE */ - UCHAR *rsnielen_ex_cur_p = 0; /* the length of the secondary RSNIE */ - UCHAR PrimaryRsnie; + u8 *pRsnIe = NULL; /* primary RSNIE */ + u8 *rsnielen_cur_p = 0; /* the length of the primary RSNIE */ + u8 *rsnielen_ex_cur_p = 0; /* the length of the secondary RSNIE */ + u8 PrimaryRsnie; BOOLEAN bMixCipher = FALSE; /* indicate the pairwise and group cipher are different */ - UCHAR p_offset; + u8 p_offset; WPA_MIX_PAIR_CIPHER FlexibleCipher = WPA_TKIPAES_WPA2_TKIPAES; /* it provide the more flexible cipher combination in WPA-WPA2 and TKIPAES mode */ rsnielen_cur_p = NULL; @@ -1934,10 +1934,10 @@ VOID RTMPMakeRSNIE(IN PRTMP_ADAPTER pAd, */ BOOLEAN RTMPCheckWPAframe(IN PRTMP_ADAPTER pAd, IN PMAC_TABLE_ENTRY pEntry, - IN PUCHAR pData, - IN ULONG DataByteCount, IN UCHAR FromWhichBSSID) + u8 *pData, + unsigned long DataByteCount, u8 FromWhichBSSID) { - ULONG Body_len; + unsigned long Body_len; BOOLEAN Cancelled; if (DataByteCount < (LENGTH_802_1_H + LENGTH_EAPOL_H)) @@ -2014,7 +2014,7 @@ BOOLEAN RTMPCheckWPAframe(IN PRTMP_ADAPTER pAd, ========================================================================== */ -PSTRING GetEapolMsgType(CHAR msg) +char *GetEapolMsgType(char msg) { if (msg == EAPOL_PAIR_MSG_1) return "Pairwise Message 1"; @@ -2045,12 +2045,12 @@ PSTRING GetEapolMsgType(CHAR msg) ======================================================================== */ BOOLEAN RTMPCheckRSNIE(IN PRTMP_ADAPTER pAd, - IN PUCHAR pData, - IN UCHAR DataLen, - IN MAC_TABLE_ENTRY * pEntry, OUT UCHAR * Offset) + u8 *pData, + u8 DataLen, + IN MAC_TABLE_ENTRY * pEntry, u8 * Offset) { - PUCHAR pVIE; - UCHAR len; + u8 *pVIE; + u8 len; PEID_STRUCT pEid; BOOLEAN result = FALSE; @@ -2119,18 +2119,18 @@ BOOLEAN RTMPCheckRSNIE(IN PRTMP_ADAPTER pAd, ======================================================================== */ BOOLEAN RTMPParseEapolKeyData(IN PRTMP_ADAPTER pAd, - IN PUCHAR pKeyData, - IN UCHAR KeyDataLen, - IN UCHAR GroupKeyIndex, - IN UCHAR MsgType, + u8 *pKeyData, + u8 KeyDataLen, + u8 GroupKeyIndex, + u8 MsgType, IN BOOLEAN bWPA2, IN MAC_TABLE_ENTRY * pEntry) { PKDE_ENCAP pKDE = NULL; - PUCHAR pMyKeyData = pKeyData; - UCHAR KeyDataLength = KeyDataLen; - UCHAR GTKLEN = 0; - UCHAR DefaultIdx = 0; - UCHAR skip_offset; + u8 *pMyKeyData = pKeyData; + u8 KeyDataLength = KeyDataLen; + u8 GTKLEN = 0; + u8 DefaultIdx = 0; + u8 skip_offset; /* Verify The RSN IE contained in pairewise_msg_2 && pairewise_msg_3 and skip it */ if (MsgType == EAPOL_PAIR_MSG_2 || MsgType == EAPOL_PAIR_MSG_3) { @@ -2320,18 +2320,18 @@ BOOLEAN RTMPParseEapolKeyData(IN PRTMP_ADAPTER pAd, ======================================================================== */ -VOID ConstructEapolMsg(IN PMAC_TABLE_ENTRY pEntry, - IN UCHAR GroupKeyWepStatus, - IN UCHAR MsgType, - IN UCHAR DefaultKeyIdx, - IN UCHAR * KeyNonce, - IN UCHAR * TxRSC, - IN UCHAR * GTK, - IN UCHAR * RSNIE, - IN UCHAR RSNIE_Len, OUT PEAPOL_PACKET pMsg) +void ConstructEapolMsg(IN PMAC_TABLE_ENTRY pEntry, + u8 GroupKeyWepStatus, + u8 MsgType, + u8 DefaultKeyIdx, + u8 * KeyNonce, + u8 * TxRSC, + u8 * GTK, + u8 * RSNIE, + u8 RSNIE_Len, OUT PEAPOL_PACKET pMsg) { BOOLEAN bWPA2 = FALSE; - UCHAR KeyDescVer; + u8 KeyDescVer; /* Choose WPA2 or not */ if ((pEntry->AuthMode == Ndis802_11AuthModeWPA2) || @@ -2343,7 +2343,7 @@ VOID ConstructEapolMsg(IN PMAC_TABLE_ENTRY pEntry, pMsg->ProType = EAPOLKey; /* Default 95 bytes, the EAPoL-Key descriptor exclude Key-data field */ - SET_UINT16_TO_ARRARY(pMsg->Body_Len, LEN_EAPOL_KEY_MSG); + SET_u16_TO_ARRARY(pMsg->Body_Len, LEN_EAPOL_KEY_MSG); /* Fill in EAPoL descriptor */ if (bWPA2) @@ -2394,8 +2394,8 @@ VOID ConstructEapolMsg(IN PMAC_TABLE_ENTRY pEntry, pMsg->KeyDesc.KeyInfo.EKD_DL = 1; } /* key Information element has done. */ - *(USHORT *) (&pMsg->KeyDesc.KeyInfo) = - cpu2le16(*(USHORT *) (&pMsg->KeyDesc.KeyInfo)); + *(u16 *) (&pMsg->KeyDesc.KeyInfo) = + cpu2le16(*(u16 *) (&pMsg->KeyDesc.KeyInfo)); /* Fill in Key Length */ { @@ -2459,10 +2459,10 @@ VOID ConstructEapolMsg(IN PMAC_TABLE_ENTRY pEntry, ((bWPA2) ? "WPA2" : "WPA"), GetEapolMsgType(MsgType))); DBGPRINT(RT_DEBUG_TRACE, (" Body length = %d \n", - CONV_ARRARY_TO_UINT16(pMsg->Body_Len))); + CONV_ARRARY_TO_u16(pMsg->Body_Len))); DBGPRINT(RT_DEBUG_TRACE, (" Key length = %d \n", - CONV_ARRARY_TO_UINT16(pMsg->KeyDesc.KeyLength))); + CONV_ARRARY_TO_u16(pMsg->KeyDesc.KeyLength))); } @@ -2483,18 +2483,18 @@ VOID ConstructEapolMsg(IN PMAC_TABLE_ENTRY pEntry, ======================================================================== */ -VOID ConstructEapolKeyData(IN PMAC_TABLE_ENTRY pEntry, - IN UCHAR GroupKeyWepStatus, - IN UCHAR keyDescVer, - IN UCHAR MsgType, - IN UCHAR DefaultKeyIdx, - IN UCHAR * GTK, - IN UCHAR * RSNIE, - IN UCHAR RSNIE_LEN, OUT PEAPOL_PACKET pMsg) +void ConstructEapolKeyData(IN PMAC_TABLE_ENTRY pEntry, + u8 GroupKeyWepStatus, + u8 keyDescVer, + u8 MsgType, + u8 DefaultKeyIdx, + u8 * GTK, + u8 * RSNIE, + u8 RSNIE_LEN, OUT PEAPOL_PACKET pMsg) { - UCHAR *mpool, *Key_Data, *Rc4GTK; - UCHAR ekey[(LEN_KEY_DESC_IV + LEN_EAP_EK)]; - ULONG data_offset; + u8 *mpool, *Key_Data, *Rc4GTK; + u8 ekey[(LEN_KEY_DESC_IV + LEN_EAP_EK)]; + unsigned long data_offset; BOOLEAN bWPA2Capable = FALSE; PRTMP_ADAPTER pAd = pEntry->pAd; BOOLEAN GTK_Included = FALSE; @@ -2509,26 +2509,26 @@ VOID ConstructEapolKeyData(IN PMAC_TABLE_ENTRY pEntry, return; /* allocate memory pool */ - os_alloc_mem(NULL, (PUCHAR *) & mpool, 1500); + os_alloc_mem(NULL, (u8 **) & mpool, 1500); if (mpool == NULL) return; /* Rc4GTK Len = 512 */ - Rc4GTK = (UCHAR *) ROUND_UP(mpool, 4); + Rc4GTK = (u8 *) ROUND_UP(mpool, 4); /* Key_Data Len = 512 */ - Key_Data = (UCHAR *) ROUND_UP(Rc4GTK + 512, 4); + Key_Data = (u8 *) ROUND_UP(Rc4GTK + 512, 4); NdisZeroMemory(Key_Data, 512); - SET_UINT16_TO_ARRARY(pMsg->KeyDesc.KeyDataLen, 0); + SET_u16_TO_ARRARY(pMsg->KeyDesc.KeyDataLen, 0); data_offset = 0; /* Encapsulate RSNIE in pairwise_msg2 & pairwise_msg3 */ if (RSNIE_LEN && ((MsgType == EAPOL_PAIR_MSG_2) || (MsgType == EAPOL_PAIR_MSG_3))) { - PUINT8 pmkid_ptr = NULL; - UINT8 pmkid_len = 0; + u8 *pmkid_ptr = NULL; + u8 pmkid_len = 0; RTMPInsertRSNIE(&Key_Data[data_offset], &data_offset, @@ -2584,8 +2584,8 @@ VOID ConstructEapolKeyData(IN PMAC_TABLE_ENTRY pEntry, /*hex_dump("GTK_Included", Key_Data, data_offset); */ if ((keyDescVer == DESC_TYPE_AES)) { - UCHAR remainder = 0; - UCHAR pad_len = 0; + u8 remainder = 0; + u8 pad_len = 0; /* Key Descriptor Version 2 or 3: AES key wrap, defined in IETF RFC 3394, */ /* shall be used to encrypt the Key Data field using the KEK field from */ @@ -2596,7 +2596,7 @@ VOID ConstructEapolKeyData(IN PMAC_TABLE_ENTRY pEntry, /* octets or if it is not a multiple of 8. The padding consists of appending */ /* a single octet 0xdd followed by zero or more 0x00 octets. */ if ((remainder = data_offset & 0x07) != 0) { - INT i; + int i; pad_len = (8 - remainder); Key_Data[data_offset] = 0xDD; @@ -2637,8 +2637,8 @@ VOID ConstructEapolKeyData(IN PMAC_TABLE_ENTRY pEntry, } /* Update key data length field and total body length */ - SET_UINT16_TO_ARRARY(pMsg->KeyDesc.KeyDataLen, data_offset); - INC_UINT16_TO_ARRARY(pMsg->Body_Len, data_offset); + SET_u16_TO_ARRARY(pMsg->KeyDesc.KeyDataLen, data_offset); + INC_u16_TO_ARRARY(pMsg->Body_Len, data_offset); os_free_mem(NULL, mpool); @@ -2660,16 +2660,16 @@ VOID ConstructEapolKeyData(IN PMAC_TABLE_ENTRY pEntry, ======================================================================== */ -static VOID CalculateMIC(IN UCHAR KeyDescVer, - IN UCHAR * PTK, OUT PEAPOL_PACKET pMsg) +static void CalculateMIC(u8 KeyDescVer, + u8 * PTK, OUT PEAPOL_PACKET pMsg) { - UCHAR *OutBuffer; - ULONG FrameLen = 0; - UCHAR mic[LEN_KEY_DESC_MIC]; - UCHAR digest[80]; + u8 *OutBuffer; + unsigned long FrameLen = 0; + u8 mic[LEN_KEY_DESC_MIC]; + u8 digest[80]; /* allocate memory for MIC calculation */ - os_alloc_mem(NULL, (PUCHAR *) & OutBuffer, 512); + os_alloc_mem(NULL, (u8 **) & OutBuffer, 512); if (OutBuffer == NULL) { DBGPRINT(RT_DEBUG_ERROR, ("!!!CalculateMIC: no memory!!!\n")); @@ -2677,7 +2677,7 @@ static VOID CalculateMIC(IN UCHAR KeyDescVer, } /* make a frame for calculating MIC. */ MakeOutgoingFrame(OutBuffer, &FrameLen, - CONV_ARRARY_TO_UINT16(pMsg->Body_Len) + 4, pMsg, + CONV_ARRARY_TO_u16(pMsg->Body_Len) + 4, pMsg, END_OF_ARGS); NdisZeroMemory(mic, sizeof(mic)); @@ -2714,7 +2714,7 @@ static VOID CalculateMIC(IN UCHAR KeyDescVer, ======================================================================== */ -NDIS_STATUS RTMPSoftDecryptBroadCastData(IN PRTMP_ADAPTER pAd, +int RTMPSoftDecryptBroadCastData(IN PRTMP_ADAPTER pAd, IN RX_BLK * pRxBlk, IN NDIS_802_11_ENCRYPTION_STATUS GroupCipher, IN PCIPHER_KEY pShard_key) @@ -2774,20 +2774,20 @@ NDIS_STATUS RTMPSoftDecryptBroadCastData(IN PRTMP_ADAPTER pAd, } -PUINT8 GetSuiteFromRSNIE(IN PUINT8 rsnie, - IN UINT rsnie_len, IN UINT8 type, OUT UINT8 * count) +u8 *GetSuiteFromRSNIE(u8 *rsnie, + u32 rsnie_len, u8 type, u8 * count) { PEID_STRUCT pEid; - INT len; - PUINT8 pBuf; - INT offset = 0; + int len; + u8 *pBuf; + int offset = 0; PRSNIE_AUTH pAkm; - UINT16 acount; + u16 acount; BOOLEAN isWPA2 = FALSE; pEid = (PEID_STRUCT) rsnie; len = rsnie_len - 2; /* exclude IE and length */ - pBuf = (PUINT8) & pEid->Octet[0]; + pBuf = (u8 *)& pEid->Octet[0]; /* set default value */ *count = 0; @@ -2800,7 +2800,7 @@ PUINT8 GetSuiteFromRSNIE(IN PUINT8 rsnie, /* Check WPA or WPA2 */ if (pEid->Eid == IE_WPA) { PRSNIE pRsnie = (PRSNIE) pBuf; - UINT16 ucount; + u16 ucount; if (len < sizeof(RSNIE)) { DBGPRINT_ERR(("%s : The length is too short for WPA\n", @@ -2831,7 +2831,7 @@ PUINT8 GetSuiteFromRSNIE(IN PUINT8 rsnie, } else if (pEid->Eid == IE_RSN) { PRSNIE2 pRsnie = (PRSNIE2) pBuf; - UINT16 ucount; + u16 ucount; isWPA2 = TRUE; @@ -2920,10 +2920,10 @@ PUINT8 GetSuiteFromRSNIE(IN PUINT8 rsnie, } -VOID WpaShowAllsuite(IN PUINT8 rsnie, IN UINT rsnie_len) +void WpaShowAllsuite(u8 *rsnie, u32 rsnie_len) { - PUINT8 pSuite = NULL; - UINT8 count; + u8 *pSuite = NULL; + u8 count; hex_dump("RSNIE", rsnie, rsnie_len); @@ -2952,25 +2952,25 @@ VOID WpaShowAllsuite(IN PUINT8 rsnie, IN UINT rsnie_len) } -VOID RTMPInsertRSNIE(IN PUCHAR pFrameBuf, - OUT PULONG pFrameLen, - IN PUINT8 rsnie_ptr, - IN UINT8 rsnie_len, - IN PUINT8 pmkid_ptr, IN UINT8 pmkid_len) +void RTMPInsertRSNIE(u8 *pFrameBuf, + unsigned long *pFrameLen, + u8 *rsnie_ptr, + u8 rsnie_len, + u8 *pmkid_ptr, u8 pmkid_len) { - PUCHAR pTmpBuf; - ULONG TempLen = 0; - UINT8 extra_len = 0; - UINT16 pmk_count = 0; - UCHAR ie_num; - UINT8 total_len = 0; - UCHAR WPA2_OUI[3] = { 0x00, 0x0F, 0xAC }; + u8 *pTmpBuf; + unsigned long TempLen = 0; + u8 extra_len = 0; + u16 pmk_count = 0; + u8 ie_num; + u8 total_len = 0; + u8 WPA2_OUI[3] = { 0x00, 0x0F, 0xAC }; pTmpBuf = pFrameBuf; /* PMKID-List Must larger than 0 and the multiple of 16. */ if (pmkid_len > 0 && ((pmkid_len & 0x0f) == 0)) { - extra_len = sizeof(UINT16) + pmkid_len; + extra_len = sizeof(u16)+ pmkid_len; pmk_count = (pmkid_len >> 4); pmk_count = cpu2le16(pmk_count); diff --git a/drivers/staging/rt2860/common/crypt_hmac.c b/drivers/staging/rt2860/common/crypt_hmac.c index a50326af265..6a086f92278 100644 --- a/drivers/staging/rt2860/common/crypt_hmac.c +++ b/drivers/staging/rt2860/common/crypt_hmac.c @@ -46,16 +46,16 @@ Note: None ======================================================================== */ -VOID HMAC_SHA1(IN const UINT8 Key[], - IN UINT KeyLen, - IN const UINT8 Message[], - IN UINT MessageLen, OUT UINT8 MAC[], IN UINT MACLen) +void HMAC_SHA1(IN const u8 Key[], + u32 KeyLen, + IN const u8 Message[], + u32 MessageLen, u8 MAC[], u32 MACLen) { SHA1_CTX_STRUC sha_ctx1; SHA1_CTX_STRUC sha_ctx2; - UINT8 K0[SHA1_BLOCK_SIZE]; - UINT8 Digest[SHA1_DIGEST_SIZE]; - UINT index; + u8 K0[SHA1_BLOCK_SIZE]; + u8 Digest[SHA1_DIGEST_SIZE]; + u32 index; NdisZeroMemory(&sha_ctx1, sizeof(SHA1_CTX_STRUC)); NdisZeroMemory(&sha_ctx2, sizeof(SHA1_CTX_STRUC)); @@ -125,16 +125,16 @@ Note: None ======================================================================== */ -VOID HMAC_MD5(IN const UINT8 Key[], - IN UINT KeyLen, - IN const UINT8 Message[], - IN UINT MessageLen, OUT UINT8 MAC[], IN UINT MACLen) +void HMAC_MD5(IN const u8 Key[], + u32 KeyLen, + IN const u8 Message[], + u32 MessageLen, u8 MAC[], u32 MACLen) { MD5_CTX_STRUC md5_ctx1; MD5_CTX_STRUC md5_ctx2; - UINT8 K0[MD5_BLOCK_SIZE]; - UINT8 Digest[MD5_DIGEST_SIZE]; - UINT index; + u8 K0[MD5_BLOCK_SIZE]; + u8 Digest[MD5_DIGEST_SIZE]; + u32 index; NdisZeroMemory(&md5_ctx1, sizeof(MD5_CTX_STRUC)); NdisZeroMemory(&md5_ctx2, sizeof(MD5_CTX_STRUC)); diff --git a/drivers/staging/rt2860/common/crypt_md5.c b/drivers/staging/rt2860/common/crypt_md5.c index b3701f2bcc1..433aaf27dfa 100644 --- a/drivers/staging/rt2860/common/crypt_md5.c +++ b/drivers/staging/rt2860/common/crypt_md5.c @@ -39,26 +39,26 @@ #define ROTL32(x,n) ROTL(x,n,32) /* 32 bits word */ #define ROUND1(a, b, c, d, x, s, ac) { \ - (a) += F((b),(c),(d)) + (x) + (UINT32)(ac); \ + (a) += F((b),(c),(d)) + (x) + (u32)(ac); \ (a) = ROTL32((a),(s)); \ (a) += (b); \ } #define ROUND2(a, b, c, d, x, s, ac) { \ - (a) += G((b),(c),(d)) + (x) + (UINT32)(ac); \ + (a) += G((b),(c),(d)) + (x) + (u32)(ac); \ (a) = ROTL32((a),(s)); \ (a) += (b); \ } #define ROUND3(a, b, c, d, x, s, ac) { \ - (a) += H((b),(c),(d)) + (x) + (UINT32)(ac); \ + (a) += H((b),(c),(d)) + (x) + (u32)(ac); \ (a) = ROTL32((a),(s)); \ (a) += (b); \ } #define ROUND4(a, b, c, d, x, s, ac) { \ - (a) += I((b),(c),(d)) + (x) + (UINT32)(ac); \ + (a) += I((b),(c),(d)) + (x) + (u32)(ac); \ (a) = ROTL32((a),(s)); \ (a) += (b); \ } -static const UINT32 MD5_DefaultHashValue[4] = { +static const u32 MD5_DefaultHashValue[4] = { 0x67452301UL, 0xefcdab89UL, 0x98badcfeUL, 0x10325476UL }; #endif /* MD5_SUPPORT */ @@ -79,7 +79,7 @@ Note: None ======================================================================== */ -VOID MD5_Init(IN MD5_CTX_STRUC * pMD5_CTX) +void MD5_Init(IN MD5_CTX_STRUC * pMD5_CTX) { NdisMoveMemory(pMD5_CTX->HashValue, MD5_DefaultHashValue, sizeof(MD5_DefaultHashValue)); @@ -103,11 +103,11 @@ Note: T[i] := floor(abs(sin(i + 1)) * (2 pow 32)), i is number of round ======================================================================== */ -VOID MD5_Hash(IN MD5_CTX_STRUC * pMD5_CTX) +void MD5_Hash(IN MD5_CTX_STRUC * pMD5_CTX) { - UINT32 X_i; - UINT32 X[16]; - UINT32 a, b, c, d; + u32 X_i; + u32 X[16]; + u32 a, b, c, d; /* Prepare the message schedule, {X_i} */ NdisMoveMemory(X, pMD5_CTX->Block, MD5_BLOCK_SIZE); @@ -238,11 +238,11 @@ Note: None ======================================================================== */ -VOID MD5_Append(IN MD5_CTX_STRUC * pMD5_CTX, - IN const UINT8 Message[], IN UINT MessageLen) +void MD5_Append(IN MD5_CTX_STRUC * pMD5_CTX, + IN const u8 Message[], u32 MessageLen) { - UINT appendLen = 0; - UINT diffLen = 0; + u32 appendLen = 0; + u32 diffLen = 0; while (appendLen != MessageLen) { diffLen = MessageLen - appendLen; @@ -280,10 +280,10 @@ Note: None ======================================================================== */ -VOID MD5_End(IN MD5_CTX_STRUC * pMD5_CTX, OUT UINT8 DigestMessage[]) +void MD5_End(IN MD5_CTX_STRUC * pMD5_CTX, u8 DigestMessage[]) { - UINT index; - UINT64 message_length_bits; + u32 index; + u64 message_length_bits; /* append 1 bits to end of the message */ NdisFillMemory(pMD5_CTX->Block + pMD5_CTX->BlockLen, 1, 0x80); @@ -299,7 +299,7 @@ VOID MD5_End(IN MD5_CTX_STRUC * pMD5_CTX, OUT UINT8 DigestMessage[]) NdisMoveMemory(&pMD5_CTX->Block[56], &message_length_bits, 8); MD5_Hash(pMD5_CTX); - /* Return message digest, transform the UINT32 hash value to bytes */ + /* Return message digest, transform the u32 hash value to bytes */ for (index = 0; index < 4; index++) pMD5_CTX->HashValue[index] = cpu2le32(pMD5_CTX->HashValue[index]); @@ -323,8 +323,8 @@ Note: None ======================================================================== */ -VOID RT_MD5(IN const UINT8 Message[], - IN UINT MessageLen, OUT UINT8 DigestMessage[]) +void RT_MD5(IN const u8 Message[], + u32 MessageLen, u8 DigestMessage[]) { MD5_CTX_STRUC md5_ctx; diff --git a/drivers/staging/rt2860/common/crypt_sha2.c b/drivers/staging/rt2860/common/crypt_sha2.c index 7b1bf8a3a7e..9166ea019ed 100644 --- a/drivers/staging/rt2860/common/crypt_sha2.c +++ b/drivers/staging/rt2860/common/crypt_sha2.c @@ -41,11 +41,11 @@ #ifdef SHA1_SUPPORT /* SHA1 constants */ #define SHA1_MASK 0x0000000f -static const UINT32 SHA1_K[4] = { +static const u32 SHA1_K[4] = { 0x5a827999UL, 0x6ed9eba1UL, 0x8f1bbcdcUL, 0xca62c1d6UL }; -static const UINT32 SHA1_DefaultHashValue[5] = { +static const u32 SHA1_DefaultHashValue[5] = { 0x67452301UL, 0xefcdab89UL, 0x98badcfeUL, 0x10325476UL, 0xc3d2e1f0UL }; @@ -64,7 +64,7 @@ Note: None ======================================================================== */ -VOID RT_SHA1_Init(IN SHA1_CTX_STRUC * pSHA_CTX) +void RT_SHA1_Init(IN SHA1_CTX_STRUC * pSHA_CTX) { NdisMoveMemory(pSHA_CTX->HashValue, SHA1_DefaultHashValue, sizeof(SHA1_DefaultHashValue)); @@ -88,11 +88,11 @@ Note: None ======================================================================== */ -VOID SHA1_Hash(IN SHA1_CTX_STRUC * pSHA_CTX) +void SHA1_Hash(IN SHA1_CTX_STRUC * pSHA_CTX) { - UINT32 W_i, t, s; - UINT32 W[16]; - UINT32 a, b, c, d, e, T, f_t = 0; + u32 W_i, t, s; + u32 W[16]; + u32 a, b, c, d, e, T, f_t = 0; /* Prepare the message schedule, {W_i}, 0 < t < 15 */ NdisMoveMemory(W, pSHA_CTX->Block, SHA1_BLOCK_SIZE); @@ -168,11 +168,11 @@ Note: None ======================================================================== */ -VOID SHA1_Append(IN SHA1_CTX_STRUC * pSHA_CTX, - IN const UINT8 Message[], IN UINT MessageLen) +void SHA1_Append(IN SHA1_CTX_STRUC * pSHA_CTX, + IN const u8 Message[], u32 MessageLen) { - UINT appendLen = 0; - UINT diffLen = 0; + u32 appendLen = 0; + u32 diffLen = 0; while (appendLen != MessageLen) { diffLen = MessageLen - appendLen; @@ -210,10 +210,10 @@ Note: None ======================================================================== */ -VOID SHA1_End(IN SHA1_CTX_STRUC * pSHA_CTX, OUT UINT8 DigestMessage[]) +void SHA1_End(IN SHA1_CTX_STRUC * pSHA_CTX, u8 DigestMessage[]) { - UINT index; - UINT64 message_length_bits; + u32 index; + u64 message_length_bits; /* Append bit 1 to end of the message */ NdisFillMemory(pSHA_CTX->Block + pSHA_CTX->BlockLen, 1, 0x80); @@ -229,7 +229,7 @@ VOID SHA1_End(IN SHA1_CTX_STRUC * pSHA_CTX, OUT UINT8 DigestMessage[]) NdisMoveMemory(&pSHA_CTX->Block[56], &message_length_bits, 8); SHA1_Hash(pSHA_CTX); - /* Return message digest, transform the UINT32 hash value to bytes */ + /* Return message digest, transform the u32 hash value to bytes */ for (index = 0; index < 5; index++) pSHA_CTX->HashValue[index] = cpu2be32(pSHA_CTX->HashValue[index]); @@ -253,8 +253,8 @@ Note: None ======================================================================== */ -VOID RT_SHA1(IN const UINT8 Message[], - IN UINT MessageLen, OUT UINT8 DigestMessage[]) +void RT_SHA1(IN const u8 Message[], + u32 MessageLen, u8 DigestMessage[]) { SHA1_CTX_STRUC sha_ctx; diff --git a/drivers/staging/rt2860/common/dfs.c b/drivers/staging/rt2860/common/dfs.c index bfe742d9c69..8bee5cf03e4 100644 --- a/drivers/staging/rt2860/common/dfs.c +++ b/drivers/staging/rt2860/common/dfs.c @@ -52,9 +52,9 @@ ======================================================================== */ -BOOLEAN RadarChannelCheck(IN PRTMP_ADAPTER pAd, IN UCHAR Ch) +BOOLEAN RadarChannelCheck(IN PRTMP_ADAPTER pAd, u8 Ch) { - INT i; + int i; BOOLEAN result = FALSE; for (i = 0; i < pAd->ChannelListNum; i++) { diff --git a/drivers/staging/rt2860/common/ee_efuse.c b/drivers/staging/rt2860/common/ee_efuse.c index 8e49cd713d1..b997151c25f 100644 --- a/drivers/staging/rt2860/common/ee_efuse.c +++ b/drivers/staging/rt2860/common/ee_efuse.c @@ -48,16 +48,16 @@ typedef union _EFUSE_CTRL_STRUC { struct { - UINT32 EFSROM_AOUT:6; - UINT32 EFSROM_MODE:2; - UINT32 EFSROM_LDO_OFF_TIME:6; - UINT32 EFSROM_LDO_ON_TIME:2; - UINT32 EFSROM_AIN:10; - UINT32 RESERVED:4; - UINT32 EFSROM_KICK:1; - UINT32 SEL_EFUSE:1; + u32 EFSROM_AOUT:6; + u32 EFSROM_MODE:2; + u32 EFSROM_LDO_OFF_TIME:6; + u32 EFSROM_LDO_ON_TIME:2; + u32 EFSROM_AIN:10; + u32 RESERVED:4; + u32 EFSROM_KICK:1; + u32 SEL_EFUSE:1; } field; - UINT32 word; + u32 word; } EFUSE_CTRL_STRUC, *PEFUSE_CTRL_STRUC; /* @@ -73,13 +73,13 @@ typedef union _EFUSE_CTRL_STRUC { ======================================================================== */ -UCHAR eFuseReadRegisters(IN PRTMP_ADAPTER pAd, - IN USHORT Offset, IN USHORT Length, OUT USHORT * pData) +u8 eFuseReadRegisters(IN PRTMP_ADAPTER pAd, + u16 Offset, u16 Length, u16 * pData) { EFUSE_CTRL_STRUC eFuseCtrlStruc; int i; - USHORT efuseDataOffset; - UINT32 data; + u16 efuseDataOffset; + u32 data; RTMP_IO_READ32(pAd, EFUSE_CTRL, &eFuseCtrlStruc.word); @@ -132,7 +132,7 @@ UCHAR eFuseReadRegisters(IN PRTMP_ADAPTER pAd, NdisMoveMemory(pData, &data, Length); } - return (UCHAR) eFuseCtrlStruc.field.EFSROM_AOUT; + return (u8)eFuseCtrlStruc.field.EFSROM_AOUT; } @@ -149,14 +149,14 @@ UCHAR eFuseReadRegisters(IN PRTMP_ADAPTER pAd, ======================================================================== */ -VOID eFusePhysicalReadRegisters(IN PRTMP_ADAPTER pAd, - IN USHORT Offset, - IN USHORT Length, OUT USHORT * pData) +void eFusePhysicalReadRegisters(IN PRTMP_ADAPTER pAd, + u16 Offset, + u16 Length, u16 * pData) { EFUSE_CTRL_STRUC eFuseCtrlStruc; int i; - USHORT efuseDataOffset; - UINT32 data; + u16 efuseDataOffset; + u32 data; RTMP_IO_READ32(pAd, EFUSE_CTRL, &eFuseCtrlStruc.word); @@ -214,16 +214,16 @@ VOID eFusePhysicalReadRegisters(IN PRTMP_ADAPTER pAd, ======================================================================== */ -static VOID eFuseReadPhysical(IN PRTMP_ADAPTER pAd, - IN PUSHORT lpInBuffer, - IN ULONG nInBufferSize, - OUT PUSHORT lpOutBuffer, IN ULONG nOutBufferSize) +static void eFuseReadPhysical(IN PRTMP_ADAPTER pAd, + u16 *lpInBuffer, + unsigned long nInBufferSize, + u16 *lpOutBuffer, unsigned long nOutBufferSize) { - USHORT *pInBuf = (USHORT *) lpInBuffer; - USHORT *pOutBuf = (USHORT *) lpOutBuffer; + u16 *pInBuf = (u16 *) lpInBuffer; + u16 *pOutBuf = (u16 *) lpOutBuffer; - USHORT Offset = pInBuf[0]; /*addr */ - USHORT Length = pInBuf[1]; /*length */ + u16 Offset = pInBuf[0]; /*addr */ + u16 Length = pInBuf[1]; /*length */ int i; for (i = 0; i < Length; i += 2) { @@ -244,20 +244,20 @@ static VOID eFuseReadPhysical(IN PRTMP_ADAPTER pAd, ======================================================================== */ -INT set_eFuseGetFreeBlockCount_Proc(IN PRTMP_ADAPTER pAd, IN PSTRING arg) +int set_eFuseGetFreeBlockCount_Proc(IN PRTMP_ADAPTER pAd, char *arg) { - USHORT i; - USHORT LogicalAddress; - USHORT efusefreenum = 0; + u16 i; + u16 LogicalAddress; + u16 efusefreenum = 0; if (!pAd->bUseEfuse) return FALSE; for (i = EFUSE_USAGE_MAP_START; i <= EFUSE_USAGE_MAP_END; i += 2) { eFusePhysicalReadRegisters(pAd, i, 2, &LogicalAddress); if ((LogicalAddress & 0xff) == 0) { - efusefreenum = (UCHAR) (EFUSE_USAGE_MAP_END - i + 1); + efusefreenum = (u8)(EFUSE_USAGE_MAP_END - i + 1); break; } else if (((LogicalAddress >> 8) & 0xff) == 0) { - efusefreenum = (UCHAR) (EFUSE_USAGE_MAP_END - i); + efusefreenum = (u8)(EFUSE_USAGE_MAP_END - i); break; } @@ -268,10 +268,10 @@ INT set_eFuseGetFreeBlockCount_Proc(IN PRTMP_ADAPTER pAd, IN PSTRING arg) return TRUE; } -INT set_eFusedump_Proc(IN PRTMP_ADAPTER pAd, IN PSTRING arg) +int set_eFusedump_Proc(IN PRTMP_ADAPTER pAd, char *arg) { - USHORT InBuf[3]; - INT i = 0; + u16 InBuf[3]; + int i = 0; if (!pAd->bUseEfuse) return FALSE; for (i = 0; i < EFUSE_USAGE_MAP_END / 2; i++) { @@ -288,7 +288,7 @@ INT set_eFusedump_Proc(IN PRTMP_ADAPTER pAd, IN PSTRING arg) } int rtmp_ee_efuse_read16(IN RTMP_ADAPTER * pAd, - IN USHORT Offset, OUT USHORT * pValue) + u16 Offset, u16 * pValue) { eFuseReadRegisters(pAd, Offset, 2, pValue); return (*pValue); @@ -296,7 +296,7 @@ int rtmp_ee_efuse_read16(IN RTMP_ADAPTER * pAd, int RtmpEfuseSupportCheck(IN RTMP_ADAPTER * pAd) { - USHORT value; + u16 value; if (IS_RT30xx(pAd)) { eFusePhysicalReadRegisters(pAd, EFUSE_TAG, 2, &value); @@ -305,10 +305,10 @@ int RtmpEfuseSupportCheck(IN RTMP_ADAPTER * pAd) return 0; } -VOID eFuseGetFreeBlockCount(IN PRTMP_ADAPTER pAd, PUINT EfuseFreeBlock) +void eFuseGetFreeBlockCount(IN PRTMP_ADAPTER pAd, u32 *EfuseFreeBlock) { - USHORT i; - USHORT LogicalAddress; + u16 i; + u16 LogicalAddress; if (!pAd->bUseEfuse) { DBGPRINT(RT_DEBUG_TRACE, ("eFuseGetFreeBlockCount Only supports efuse Mode\n")); @@ -317,10 +317,10 @@ VOID eFuseGetFreeBlockCount(IN PRTMP_ADAPTER pAd, PUINT EfuseFreeBlock) for (i = EFUSE_USAGE_MAP_START; i <= EFUSE_USAGE_MAP_END; i += 2) { eFusePhysicalReadRegisters(pAd, i, 2, &LogicalAddress); if ((LogicalAddress & 0xff) == 0) { - *EfuseFreeBlock = (UCHAR) (EFUSE_USAGE_MAP_END - i + 1); + *EfuseFreeBlock = (u8)(EFUSE_USAGE_MAP_END - i + 1); break; } else if (((LogicalAddress >> 8) & 0xff) == 0) { - *EfuseFreeBlock = (UCHAR) (EFUSE_USAGE_MAP_END - i); + *EfuseFreeBlock = (u8)(EFUSE_USAGE_MAP_END - i); break; } @@ -331,9 +331,9 @@ VOID eFuseGetFreeBlockCount(IN PRTMP_ADAPTER pAd, PUINT EfuseFreeBlock) ("eFuseGetFreeBlockCount is 0x%x\n", *EfuseFreeBlock)); } -INT eFuse_init(IN PRTMP_ADAPTER pAd) +int eFuse_init(IN PRTMP_ADAPTER pAd) { - UINT EfuseFreeBlock = 0; + u32 EfuseFreeBlock = 0; DBGPRINT(RT_DEBUG_ERROR, ("NVM is Efuse and its size =%x[%x-%x] \n", EFUSE_USAGE_MAP_SIZE, EFUSE_USAGE_MAP_START, diff --git a/drivers/staging/rt2860/common/ee_prom.c b/drivers/staging/rt2860/common/ee_prom.c index fa3f2311f3c..8cd654c4f99 100644 --- a/drivers/staging/rt2860/common/ee_prom.c +++ b/drivers/staging/rt2860/common/ee_prom.c @@ -38,7 +38,7 @@ #include "../rt_config.h" /* IRQL = PASSIVE_LEVEL */ -static inline VOID RaiseClock(IN PRTMP_ADAPTER pAd, IN UINT32 * x) +static inline void RaiseClock(IN PRTMP_ADAPTER pAd, u32 * x) { *x = *x | EESK; RTMP_IO_WRITE32(pAd, E2PROM_CSR, *x); @@ -46,7 +46,7 @@ static inline VOID RaiseClock(IN PRTMP_ADAPTER pAd, IN UINT32 * x) } /* IRQL = PASSIVE_LEVEL */ -static inline VOID LowerClock(IN PRTMP_ADAPTER pAd, IN UINT32 * x) +static inline void LowerClock(IN PRTMP_ADAPTER pAd, u32 * x) { *x = *x & ~EESK; RTMP_IO_WRITE32(pAd, E2PROM_CSR, *x); @@ -54,10 +54,10 @@ static inline VOID LowerClock(IN PRTMP_ADAPTER pAd, IN UINT32 * x) } /* IRQL = PASSIVE_LEVEL */ -static inline USHORT ShiftInBits(IN PRTMP_ADAPTER pAd) +static inline u16 ShiftInBits(IN PRTMP_ADAPTER pAd) { - UINT32 x, i; - USHORT data = 0; + u32 x, i; + u16 data = 0; RTMP_IO_READ32(pAd, E2PROM_CSR, &x); @@ -79,10 +79,10 @@ static inline USHORT ShiftInBits(IN PRTMP_ADAPTER pAd) } /* IRQL = PASSIVE_LEVEL */ -static inline VOID ShiftOutBits(IN PRTMP_ADAPTER pAd, - IN USHORT data, IN USHORT count) +static inline void ShiftOutBits(IN PRTMP_ADAPTER pAd, + u16 data, u16 count) { - UINT32 x, mask; + u32 x, mask; mask = 0x01 << (count - 1); RTMP_IO_READ32(pAd, E2PROM_CSR, &x); @@ -107,9 +107,9 @@ static inline VOID ShiftOutBits(IN PRTMP_ADAPTER pAd, } /* IRQL = PASSIVE_LEVEL */ -static inline VOID EEpromCleanup(IN PRTMP_ADAPTER pAd) +static inline void EEpromCleanup(IN PRTMP_ADAPTER pAd) { - UINT32 x; + u32 x; RTMP_IO_READ32(pAd, E2PROM_CSR, &x); @@ -120,9 +120,9 @@ static inline VOID EEpromCleanup(IN PRTMP_ADAPTER pAd) LowerClock(pAd, &x); } -static inline VOID EWEN(IN PRTMP_ADAPTER pAd) +static inline void EWEN(IN PRTMP_ADAPTER pAd) { - UINT32 x; + u32 x; /* reset bits and set EECS */ RTMP_IO_READ32(pAd, E2PROM_CSR, &x); @@ -141,9 +141,9 @@ static inline VOID EWEN(IN PRTMP_ADAPTER pAd) EEpromCleanup(pAd); } -static inline VOID EWDS(IN PRTMP_ADAPTER pAd) +static inline void EWDS(IN PRTMP_ADAPTER pAd) { - UINT32 x; + u32 x; /* reset bits and set EECS */ RTMP_IO_READ32(pAd, E2PROM_CSR, &x); @@ -164,10 +164,10 @@ static inline VOID EWDS(IN PRTMP_ADAPTER pAd) /* IRQL = PASSIVE_LEVEL */ int rtmp_ee_prom_read16(IN PRTMP_ADAPTER pAd, - IN USHORT Offset, OUT USHORT * pValue) + u16 Offset, u16 * pValue) { - UINT32 x; - USHORT data; + u32 x; + u16 data; Offset /= 2; /* reset bits and set EECS */ diff --git a/drivers/staging/rt2860/common/eeprom.c b/drivers/staging/rt2860/common/eeprom.c index 202d313b655..764de3a7807 100644 --- a/drivers/staging/rt2860/common/eeprom.c +++ b/drivers/staging/rt2860/common/eeprom.c @@ -36,12 +36,12 @@ */ #include "../rt_config.h" -INT RtmpChipOpsEepromHook(IN RTMP_ADAPTER * pAd, IN INT infType) +int RtmpChipOpsEepromHook(IN RTMP_ADAPTER * pAd, int infType) { RTMP_CHIP_OP *pChipOps = &pAd->chipOps; #ifdef RT30xx #ifdef RTMP_EFUSE_SUPPORT - UINT32 eFuseCtrl, MacCsr0; + u32 eFuseCtrl, MacCsr0; int index; index = 0; diff --git a/drivers/staging/rt2860/common/firmware.h b/drivers/staging/rt2860/common/firmware.h index e984725358d..2fecd32f760 100644 --- a/drivers/staging/rt2860/common/firmware.h +++ b/drivers/staging/rt2860/common/firmware.h @@ -43,7 +43,7 @@ /* AUTO GEN PLEASE DO NOT MODIFY IT */ -UCHAR FirmwareImage_2860 [] = { +u8 FirmwareImage_2860 [] = { 0x02, 0x03, 0x5e, 0x02, 0x02, 0xb1, 0x22, 0x22, 0xff, 0xff, 0xff, 0x02, 0x01, 0x82, 0xff, 0xff, 0xff, 0xff, 0xff, 0x02, 0x00, 0x1e, 0xff, 0xff, 0xff, 0xff, 0xff, 0x02, 0x01, 0x33, 0xc0, 0xe0, 0xc0, 0xf0, 0xc0, 0x83, 0xc0, 0x82, 0xc0, 0xd0, 0x75, 0xd0, 0x18, 0xc2, 0xaf, 0x30, 0x45, 0x03, diff --git a/drivers/staging/rt2860/common/firmware_3070.h b/drivers/staging/rt2860/common/firmware_3070.h index 19569407f72..b710d40bc04 100644 --- a/drivers/staging/rt2860/common/firmware_3070.h +++ b/drivers/staging/rt2860/common/firmware_3070.h @@ -2,7 +2,7 @@ /* AUTO GEN PLEASE DO NOT MODIFY IT */ -UCHAR FirmwareImage_3070 [] = { +u8 FirmwareImage_3070 [] = { 0xff, 0xff, 0xff, 0x02, 0x10, 0x28, 0x02, 0x10, 0x32, 0x02, 0x10, 0x78, 0x02, 0x13, 0x1f, 0x02, 0x13, 0x20, 0x02, 0x13, 0x3f, 0x02, 0x13, 0x44, 0x12, 0x13, 0x40, 0x22, 0x02, 0x17, 0xae, 0x02, 0x18, 0xd2, 0x02, 0x14, 0x3d, 0x02, 0x13, 0x78, 0x30, 0x05, 0x06, 0x20, 0x0d, 0x03, 0x12, 0x19, diff --git a/drivers/staging/rt2860/common/mlme.c b/drivers/staging/rt2860/common/mlme.c index e047b89f88c..fcf030b7db6 100644 --- a/drivers/staging/rt2860/common/mlme.c +++ b/drivers/staging/rt2860/common/mlme.c @@ -39,19 +39,19 @@ #include "../rt_config.h" #include <stdarg.h> -UCHAR CISCO_OUI[] = { 0x00, 0x40, 0x96 }; - -UCHAR WPA_OUI[] = { 0x00, 0x50, 0xf2, 0x01 }; -UCHAR RSN_OUI[] = { 0x00, 0x0f, 0xac }; -UCHAR WME_INFO_ELEM[] = { 0x00, 0x50, 0xf2, 0x02, 0x00, 0x01 }; -UCHAR WME_PARM_ELEM[] = { 0x00, 0x50, 0xf2, 0x02, 0x01, 0x01 }; -UCHAR Ccx2QosInfo[] = { 0x00, 0x40, 0x96, 0x04 }; -UCHAR RALINK_OUI[] = { 0x00, 0x0c, 0x43 }; -UCHAR BROADCOM_OUI[] = { 0x00, 0x90, 0x4c }; -UCHAR WPS_OUI[] = { 0x00, 0x50, 0xf2, 0x04 }; -UCHAR PRE_N_HT_OUI[] = { 0x00, 0x90, 0x4c }; - -UCHAR RateSwitchTable[] = { +u8 CISCO_OUI[] = { 0x00, 0x40, 0x96 }; + +u8 WPA_OUI[] = { 0x00, 0x50, 0xf2, 0x01 }; +u8 RSN_OUI[] = { 0x00, 0x0f, 0xac }; +u8 WME_INFO_ELEM[] = { 0x00, 0x50, 0xf2, 0x02, 0x00, 0x01 }; +u8 WME_PARM_ELEM[] = { 0x00, 0x50, 0xf2, 0x02, 0x01, 0x01 }; +u8 Ccx2QosInfo[] = { 0x00, 0x40, 0x96, 0x04 }; +u8 RALINK_OUI[] = { 0x00, 0x0c, 0x43 }; +u8 BROADCOM_OUI[] = { 0x00, 0x90, 0x4c }; +u8 WPS_OUI[] = { 0x00, 0x50, 0xf2, 0x04 }; +u8 PRE_N_HT_OUI[] = { 0x00, 0x90, 0x4c }; + +u8 RateSwitchTable[] = { /* Item No. Mode Curr-MCS TrainUp TrainDown // Mode- Bit0: STBC, Bit1: Short GI, Bit4,5: Mode(0:CCK, 1:OFDM, 2:HT Mix, 3:HT GF) */ 0x11, 0x00, 0, 0, 0, /* Initial used item after association */ 0x00, 0x00, 0, 40, 101, @@ -88,7 +88,7 @@ UCHAR RateSwitchTable[] = { 0x1f, 0x00, 0, 0, 0, }; -UCHAR RateSwitchTable11B[] = { +u8 RateSwitchTable11B[] = { /* Item No. Mode Curr-MCS TrainUp TrainDown // Mode- Bit0: STBC, Bit1: Short GI, Bit4,5: Mode(0:CCK, 1:OFDM, 2:HT Mix, 3:HT GF) */ 0x04, 0x03, 0, 0, 0, /* Initial used item after association */ 0x00, 0x00, 0, 40, 101, @@ -97,7 +97,7 @@ UCHAR RateSwitchTable11B[] = { 0x03, 0x00, 3, 20, 45, }; -UCHAR RateSwitchTable11BG[] = { +u8 RateSwitchTable11BG[] = { /* Item No. Mode Curr-MCS TrainUp TrainDown // Mode- Bit0: STBC, Bit1: Short GI, Bit4,5: Mode(0:CCK, 1:OFDM, 2:HT Mix, 3:HT GF) */ 0x0a, 0x00, 0, 0, 0, /* Initial used item after association */ 0x00, 0x00, 0, 40, 101, @@ -112,7 +112,7 @@ UCHAR RateSwitchTable11BG[] = { 0x09, 0x10, 7, 10, 13, }; -UCHAR RateSwitchTable11G[] = { +u8 RateSwitchTable11G[] = { /* Item No. Mode Curr-MCS TrainUp TrainDown // Mode- Bit0: STBC, Bit1: Short GI, Bit4,5: Mode(0:CCK, 1:OFDM, 2:HT Mix, 3:HT GF) */ 0x08, 0x00, 0, 0, 0, /* Initial used item after association */ 0x00, 0x10, 0, 20, 101, @@ -125,7 +125,7 @@ UCHAR RateSwitchTable11G[] = { 0x07, 0x10, 7, 10, 13, }; -UCHAR RateSwitchTable11N1S[] = { +u8 RateSwitchTable11N1S[] = { /* Item No. Mode Curr-MCS TrainUp TrainDown // Mode- Bit0: STBC, Bit1: Short GI, Bit4,5: Mode(0:CCK, 1:OFDM, 2:HT Mix, 3:HT GF) */ 0x0c, 0x0a, 0, 0, 0, /* Initial used item after association */ 0x00, 0x00, 0, 40, 101, @@ -142,7 +142,7 @@ UCHAR RateSwitchTable11N1S[] = { 0x0b, 0x23, 7, 8, 14, }; -UCHAR RateSwitchTable11N2S[] = { +u8 RateSwitchTable11N2S[] = { /* Item No. Mode Curr-MCS TrainUp TrainDown // Mode- Bit0: STBC, Bit1: Short GI, Bit4,5: Mode(0:CCK, 1:OFDM, 2:HT Mix, 3:HT GF) */ 0x0e, 0x0c, 0, 0, 0, /* Initial used item after association */ 0x00, 0x00, 0, 40, 101, @@ -161,7 +161,7 @@ UCHAR RateSwitchTable11N2S[] = { 0x0d, 0x22, 15, 8, 15, }; -UCHAR RateSwitchTable11N3S[] = { +u8 RateSwitchTable11N3S[] = { /* Item No. Mode Curr-MCS TrainUp TrainDown // Mode- Bit0: STBC, Bit1: Short GI, Bit4,5: Mode(0:CCK, 1:OFDM, 2:HT Mix, 3:HT GF) */ 0x0b, 0x00, 0, 0, 0, /* 0x0a, 0x00, 0, 0, 0, // Initial used item after association */ 0x00, 0x21, 0, 30, 101, @@ -177,7 +177,7 @@ UCHAR RateSwitchTable11N3S[] = { 0x0a, 0x22, 15, 8, 25, /* 0x09, 0x22, 15, 8, 25, */ }; -UCHAR RateSwitchTable11N2SForABand[] = { +u8 RateSwitchTable11N2SForABand[] = { /* Item No. Mode Curr-MCS TrainUp TrainDown // Mode- Bit0: STBC, Bit1: Short GI, Bit4,5: Mode(0:CCK, 1:OFDM, 2:HT Mix, 3:HT GF) */ 0x0b, 0x09, 0, 0, 0, /* Initial used item after association */ 0x00, 0x21, 0, 30, 101, @@ -193,7 +193,7 @@ UCHAR RateSwitchTable11N2SForABand[] = { 0x0a, 0x22, 15, 8, 25, }; -UCHAR RateSwitchTable11N3SForABand[] = { /* 3*3 */ +u8 RateSwitchTable11N3SForABand[] = { /* 3*3 */ /* Item No. Mode Curr-MCS TrainUp TrainDown // Mode- Bit0: STBC, Bit1: Short GI, Bit4,5: Mode(0:CCK, 1:OFDM, 2:HT Mix, 3:HT GF) */ 0x0b, 0x09, 0, 0, 0, /* Initial used item after association */ 0x00, 0x21, 0, 30, 101, @@ -209,7 +209,7 @@ UCHAR RateSwitchTable11N3SForABand[] = { /* 3*3 */ 0x0a, 0x22, 15, 8, 25, }; -UCHAR RateSwitchTable11BGN1S[] = { +u8 RateSwitchTable11BGN1S[] = { /* Item No. Mode Curr-MCS TrainUp TrainDown // Mode- Bit0: STBC, Bit1: Short GI, Bit4,5: Mode(0:CCK, 1:OFDM, 2:HT Mix, 3:HT GF) */ 0x0c, 0x0a, 0, 0, 0, /* Initial used item after association */ 0x00, 0x00, 0, 40, 101, @@ -226,7 +226,7 @@ UCHAR RateSwitchTable11BGN1S[] = { 0x0b, 0x23, 7, 8, 14, }; -UCHAR RateSwitchTable11BGN2S[] = { +u8 RateSwitchTable11BGN2S[] = { /* Item No. Mode Curr-MCS TrainUp TrainDown // Mode- Bit0: STBC, Bit1: Short GI, Bit4,5: Mode(0:CCK, 1:OFDM, 2:HT Mix, 3:HT GF) */ 0x0e, 0x0c, 0, 0, 0, /* Initial used item after association */ 0x00, 0x00, 0, 40, 101, @@ -245,7 +245,7 @@ UCHAR RateSwitchTable11BGN2S[] = { 0x0d, 0x22, 15, 8, 15, }; -UCHAR RateSwitchTable11BGN3S[] = { /* 3*3 */ +u8 RateSwitchTable11BGN3S[] = { /* 3*3 */ /* Item No. Mode Curr-MCS TrainUp TrainDown // Mode- Bit0: STBC, Bit1: Short GI, Bit4,5: Mode(0:CCK, 1:OFDM, 2:HT Mix, 3:HT GF) */ 0x0a, 0x00, 0, 0, 0, /* Initial used item after association */ 0x00, 0x21, 0, 30, 101, /*50 */ @@ -260,7 +260,7 @@ UCHAR RateSwitchTable11BGN3S[] = { /* 3*3 */ 0x09, 0x22, 23, 8, 25, }; -UCHAR RateSwitchTable11BGN2SForABand[] = { +u8 RateSwitchTable11BGN2SForABand[] = { /* Item No. Mode Curr-MCS TrainUp TrainDown // Mode- Bit0: STBC, Bit1: Short GI, Bit4,5: Mode(0:CCK, 1:OFDM, 2:HT Mix, 3:HT GF) */ 0x0b, 0x09, 0, 0, 0, /* Initial used item after association */ 0x00, 0x21, 0, 30, 101, /*50 */ @@ -276,7 +276,7 @@ UCHAR RateSwitchTable11BGN2SForABand[] = { 0x0a, 0x22, 15, 8, 25, }; -UCHAR RateSwitchTable11BGN3SForABand[] = { /* 3*3 */ +u8 RateSwitchTable11BGN3SForABand[] = { /* 3*3 */ /* Item No. Mode Curr-MCS TrainUp TrainDown // Mode- Bit0: STBC, Bit1: Short GI, Bit4,5: Mode(0:CCK, 1:OFDM, 2:HT Mix, 3:HT GF) */ 0x0c, 0x09, 0, 0, 0, /* Initial used item after association */ 0x00, 0x21, 0, 30, 101, /*50 */ @@ -293,10 +293,10 @@ UCHAR RateSwitchTable11BGN3SForABand[] = { /* 3*3 */ 0x0b, 0x22, 23, 8, 25, }; -extern UCHAR OfdmRateToRxwiMCS[]; +extern u8 OfdmRateToRxwiMCS[]; /* since RT61 has better RX sensibility, we have to limit TX ACK rate not to exceed our normal data TX rate. */ /* otherwise the WLAN peer may not be able to receive the ACK thus downgrade its data TX rate */ -ULONG BasicRateMask[12] = +unsigned long BasicRateMask[12] = { 0xfffff001 /* 1-Mbps */ , 0xfffff003 /* 2 Mbps */ , 0xfffff007 /* 5.5 */ , 0xfffff00f /* 11 */ , 0xfffff01f /* 6 */ , 0xfffff03f /* 9 */ , 0xfffff07f /* 12 */ , @@ -305,38 +305,38 @@ ULONG BasicRateMask[12] = 0xffffffff /* 54 */ }; -UCHAR BROADCAST_ADDR[MAC_ADDR_LEN] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }; -UCHAR ZERO_MAC_ADDR[MAC_ADDR_LEN] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; +u8 BROADCAST_ADDR[MAC_ADDR_LEN] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }; +u8 ZERO_MAC_ADDR[MAC_ADDR_LEN] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; /* e.g. RssiSafeLevelForTxRate[RATE_36]" means if the current RSSI is greater than */ /* this value, then it's quaranteed capable of operating in 36 mbps TX rate in */ /* clean environment. */ /* TxRate: 1 2 5.5 11 6 9 12 18 24 36 48 54 72 100 */ -CHAR RssiSafeLevelForTxRate[] = +char RssiSafeLevelForTxRate[] = { -92, -91, -90, -87, -88, -86, -85, -83, -81, -78, -72, -71, -40, -40 }; -UCHAR RateIdToMbps[] = { 1, 2, 5, 11, 6, 9, 12, 18, 24, 36, 48, 54, 72, 100 }; -USHORT RateIdTo500Kbps[] = +u8 RateIdToMbps[] = { 1, 2, 5, 11, 6, 9, 12, 18, 24, 36, 48, 54, 72, 100 }; +u16 RateIdTo500Kbps[] = { 2, 4, 11, 22, 12, 18, 24, 36, 48, 72, 96, 108, 144, 200 }; -UCHAR SsidIe = IE_SSID; -UCHAR SupRateIe = IE_SUPP_RATES; -UCHAR ExtRateIe = IE_EXT_SUPP_RATES; -UCHAR HtCapIe = IE_HT_CAP; -UCHAR AddHtInfoIe = IE_ADD_HT; -UCHAR NewExtChanIe = IE_SECONDARY_CH_OFFSET; -UCHAR ErpIe = IE_ERP; -UCHAR DsIe = IE_DS_PARM; -UCHAR TimIe = IE_TIM; -UCHAR WpaIe = IE_WPA; -UCHAR Wpa2Ie = IE_WPA2; -UCHAR IbssIe = IE_IBSS_PARM; +u8 SsidIe = IE_SSID; +u8 SupRateIe = IE_SUPP_RATES; +u8 ExtRateIe = IE_EXT_SUPP_RATES; +u8 HtCapIe = IE_HT_CAP; +u8 AddHtInfoIe = IE_ADD_HT; +u8 NewExtChanIe = IE_SECONDARY_CH_OFFSET; +u8 ErpIe = IE_ERP; +u8 DsIe = IE_DS_PARM; +u8 TimIe = IE_TIM; +u8 WpaIe = IE_WPA; +u8 Wpa2Ie = IE_WPA2; +u8 IbssIe = IE_IBSS_PARM; -extern UCHAR WPA_OUI[]; +extern u8 WPA_OUI[]; -UCHAR SES_OUI[] = { 0x00, 0x90, 0x4c }; +u8 SES_OUI[] = { 0x00, 0x90, 0x4c }; -UCHAR ZeroSsid[32] = +u8 ZeroSsid[32] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -356,9 +356,9 @@ UCHAR ZeroSsid[32] = ========================================================================== */ -NDIS_STATUS MlmeInit(IN PRTMP_ADAPTER pAd) +int MlmeInit(IN PRTMP_ADAPTER pAd) { - NDIS_STATUS Status = NDIS_STATUS_SUCCESS; + int Status = NDIS_STATUS_SUCCESS; DBGPRINT(RT_DEBUG_TRACE, ("--> MLME Initialize\n")); @@ -453,7 +453,7 @@ NDIS_STATUS MlmeInit(IN PRTMP_ADAPTER pAd) ========================================================================== */ -VOID MlmeHandler(IN PRTMP_ADAPTER pAd) +void MlmeHandler(IN PRTMP_ADAPTER pAd) { MLME_QUEUE_ELEM *Elem = NULL; @@ -571,7 +571,7 @@ VOID MlmeHandler(IN PRTMP_ADAPTER pAd) ========================================================================== */ -VOID MlmeHalt(IN PRTMP_ADAPTER pAd) +void MlmeHalt(IN PRTMP_ADAPTER pAd) { BOOLEAN Cancelled; @@ -639,7 +639,7 @@ VOID MlmeHalt(IN PRTMP_ADAPTER pAd) DBGPRINT(RT_DEBUG_TRACE, ("<== MlmeHalt\n")); } -VOID MlmeResetRalinkCounters(IN PRTMP_ADAPTER pAd) +void MlmeResetRalinkCounters(IN PRTMP_ADAPTER pAd) { pAd->RalinkCounters.LastOneSecRxOkDataCnt = pAd->RalinkCounters.OneSecRxOkDataCnt; @@ -689,11 +689,11 @@ VOID MlmeResetRalinkCounters(IN PRTMP_ADAPTER pAd) ========================================================================== */ #define ADHOC_BEACON_LOST_TIME (8*OS_HZ) /* 8 sec */ -VOID MlmePeriodicExec(IN PVOID SystemSpecific1, - IN PVOID FunctionContext, - IN PVOID SystemSpecific2, IN PVOID SystemSpecific3) +void MlmePeriodicExec(void *SystemSpecific1, + void *FunctionContext, + void *SystemSpecific2, void *SystemSpecific3) { - ULONG TxTotalCnt; + unsigned long TxTotalCnt; PRTMP_ADAPTER pAd = (RTMP_ADAPTER *) FunctionContext; #ifdef RTMP_MAC_PCI @@ -706,7 +706,7 @@ VOID MlmePeriodicExec(IN PVOID SystemSpecific1, && (!RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_HALT_IN_PROGRESS)) /*&&(pAd->bPCIclkOff == FALSE) */ ) { - UINT32 data = 0; + u32 data = 0; /* Read GPIO pin2 as Hardware controlled radio state */ #ifndef RT3090 @@ -891,7 +891,7 @@ VOID MlmePeriodicExec(IN PVOID SystemSpecific1, /* 2. If in 0x10F4 the ((bit29==1) && (bit7==1)) OR ((bit29==1) && (bit5==1)), it means the deadlock has occurred. */ /* 3. If the deadlock occurred, reset MAC/BBP by setting 0x1004 to 0x0001 for a while then setting it back to 0x000C again. */ - UINT32 MacReg = 0; + u32 MacReg = 0; RTMP_IO_READ32(pAd, 0x10F4, &MacReg); if (((MacReg & 0x20000000) && (MacReg & 0x80)) @@ -921,7 +921,7 @@ VOID MlmePeriodicExec(IN PVOID SystemSpecific1, IRQL = DISPATCH_LEVEL ========================================================================== */ -BOOLEAN MlmeValidateSSID(IN PUCHAR pSsid, IN UCHAR SsidLen) +BOOLEAN MlmeValidateSSID(u8 *pSsid, u8 SsidLen) { int index; @@ -938,10 +938,10 @@ BOOLEAN MlmeValidateSSID(IN PUCHAR pSsid, IN UCHAR SsidLen) return (TRUE); } -VOID MlmeSelectTxRateTable(IN PRTMP_ADAPTER pAd, +void MlmeSelectTxRateTable(IN PRTMP_ADAPTER pAd, IN PMAC_TABLE_ENTRY pEntry, - IN PUCHAR * ppTable, - IN PUCHAR pTableSize, IN PUCHAR pInitTxRateIdx) + u8 ** ppTable, + u8 *pTableSize, u8 *pInitTxRateIdx) { do { /* decide the rate table for tuning */ @@ -1144,9 +1144,9 @@ VOID MlmeSelectTxRateTable(IN PRTMP_ADAPTER pAd, } while (FALSE); } -VOID STAMlmePeriodicExec(PRTMP_ADAPTER pAd) +void STAMlmePeriodicExec(PRTMP_ADAPTER pAd) { - ULONG TxTotalCnt; + unsigned long TxTotalCnt; int i; /* @@ -1341,8 +1341,8 @@ VOID STAMlmePeriodicExec(PRTMP_ADAPTER pAd) if (pAd->StaCfg.bAutoRoaming) { BOOLEAN rv = FALSE; - CHAR dBmToRoam = pAd->StaCfg.dBmToRoam; - CHAR MaxRssi = RTMPMaxRssi(pAd, + char dBmToRoam = pAd->StaCfg.dBmToRoam; + char MaxRssi = RTMPMaxRssi(pAd, pAd->StaCfg.RssiSample. LastRssi0, pAd->StaCfg.RssiSample. @@ -1357,7 +1357,7 @@ VOID STAMlmePeriodicExec(PRTMP_ADAPTER pAd) && (MaxRssi <= dBmToRoam)) { DBGPRINT(RT_DEBUG_TRACE, ("Rssi=%d, dBmToRoam=%d\n", MaxRssi, - (CHAR) dBmToRoam)); + (char)dBmToRoam)); /* Add auto seamless roaming */ if (rv == FALSE) @@ -1392,7 +1392,7 @@ VOID STAMlmePeriodicExec(PRTMP_ADAPTER pAd) LinkDown(pAd, FALSE); StartParmFill(pAd, &StartReq, - (CHAR *) pAd->MlmeAux.Ssid, + (char *) pAd->MlmeAux.Ssid, pAd->MlmeAux.SsidLen); MlmeEnqueue(pAd, SYNC_STATE_MACHINE, MT2_MLME_START_REQ, sizeof(MLME_START_REQ_STRUCT), &StartReq); @@ -1439,7 +1439,7 @@ VOID STAMlmePeriodicExec(PRTMP_ADAPTER pAd) pAd->MlmeAux. AutoReconnectSsid)); ScanParmFill(pAd, &ScanReq, - (PSTRING) pAd->MlmeAux. + (char *)pAd->MlmeAux. AutoReconnectSsid, pAd->MlmeAux. AutoReconnectSsidLen, @@ -1487,9 +1487,9 @@ SKIP_AUTO_SCAN_CONN: } /* Link down report */ -VOID LinkDownExec(IN PVOID SystemSpecific1, - IN PVOID FunctionContext, - IN PVOID SystemSpecific2, IN PVOID SystemSpecific3) +void LinkDownExec(void *SystemSpecific1, + void *FunctionContext, + void *SystemSpecific2, void *SystemSpecific3) { RTMP_ADAPTER *pAd = (RTMP_ADAPTER *) FunctionContext; @@ -1517,7 +1517,7 @@ VOID LinkDownExec(IN PVOID SystemSpecific1, } /* IRQL = DISPATCH_LEVEL */ -VOID MlmeAutoScan(IN PRTMP_ADAPTER pAd) +void MlmeAutoScan(IN PRTMP_ADAPTER pAd) { /* check CntlMachine.CurrState to avoid collision with NDIS SetOID request */ if (pAd->Mlme.CntlMachine.CurrState == CNTL_IDLE) { @@ -1532,7 +1532,7 @@ VOID MlmeAutoScan(IN PRTMP_ADAPTER pAd) } /* IRQL = DISPATCH_LEVEL */ -VOID MlmeAutoReconnectLastSSID(IN PRTMP_ADAPTER pAd) +void MlmeAutoReconnectLastSSID(IN PRTMP_ADAPTER pAd) { if (pAd->StaCfg.bAutoConnectByBssid) { DBGPRINT(RT_DEBUG_TRACE, @@ -1582,9 +1582,9 @@ VOID MlmeAutoReconnectLastSSID(IN PRTMP_ADAPTER pAd) Output: ========================================================================== */ -VOID MlmeCheckForRoaming(IN PRTMP_ADAPTER pAd, IN ULONG Now32) +void MlmeCheckForRoaming(IN PRTMP_ADAPTER pAd, unsigned long Now32) { - USHORT i; + u16 i; BSS_TABLE *pRoamTab = &pAd->MlmeAux.RoamTab; BSS_ENTRY *pBss; @@ -1642,7 +1642,7 @@ VOID MlmeCheckForRoaming(IN PRTMP_ADAPTER pAd, IN ULONG Now32) */ BOOLEAN MlmeCheckForFastRoaming(IN PRTMP_ADAPTER pAd) { - USHORT i; + u16 i; BSS_TABLE *pRoamTab = &pAd->MlmeAux.RoamTab; BSS_ENTRY *pBss; @@ -1699,10 +1699,10 @@ BOOLEAN MlmeCheckForFastRoaming(IN PRTMP_ADAPTER pAd) return FALSE; } -VOID MlmeSetTxRate(IN PRTMP_ADAPTER pAd, +void MlmeSetTxRate(IN PRTMP_ADAPTER pAd, IN PMAC_TABLE_ENTRY pEntry, IN PRTMP_TX_RATE_SWITCH pTxRate) { - UCHAR MaxMode = MODE_OFDM; + u8 MaxMode = MODE_OFDM; MaxMode = MODE_HTGREENFIELD; @@ -1820,7 +1820,7 @@ VOID MlmeSetTxRate(IN PRTMP_ADAPTER pAd, pEntry->HTPhyMode.field.MODE = MODE_HTGREENFIELD; } - pAd->LastTxRate = (USHORT) (pEntry->HTPhyMode.word); + pAd->LastTxRate = (u16)(pEntry->HTPhyMode.word); } /* @@ -1840,20 +1840,20 @@ VOID MlmeSetTxRate(IN PRTMP_ADAPTER pAd, call this routine every second ========================================================================== */ -VOID MlmeDynamicTxRateSwitching(IN PRTMP_ADAPTER pAd) +void MlmeDynamicTxRateSwitching(IN PRTMP_ADAPTER pAd) { - UCHAR UpRateIdx = 0, DownRateIdx = 0, CurrRateIdx; - ULONG i, AccuTxTotalCnt = 0, TxTotalCnt; - ULONG TxErrorRatio = 0; + u8 UpRateIdx = 0, DownRateIdx = 0, CurrRateIdx; + unsigned long i, AccuTxTotalCnt = 0, TxTotalCnt; + unsigned long TxErrorRatio = 0; BOOLEAN bTxRateChanged = FALSE, bUpgradeQuality = FALSE; PRTMP_TX_RATE_SWITCH pCurrTxRate, pNextTxRate = NULL; - PUCHAR pTable; - UCHAR TableSize = 0; - UCHAR InitTxRateIdx = 0, TrainUp, TrainDown; - CHAR Rssi, RssiOffset = 0; + u8 *pTable; + u8 TableSize = 0; + u8 InitTxRateIdx = 0, TrainUp, TrainDown; + char Rssi, RssiOffset = 0; TX_STA_CNT1_STRUC StaTx1; TX_STA_CNT0_STRUC TxStaCnt0; - ULONG TxRetransmit = 0, TxSuccess = 0, TxFailCount = 0; + unsigned long TxRetransmit = 0, TxSuccess = 0, TxFailCount = 0; MAC_TABLE_ENTRY *pEntry; RSSI_SAMPLE *pRssi = &pAd->StaCfg.RssiSample; @@ -1936,8 +1936,8 @@ VOID MlmeDynamicTxRateSwitching(IN PRTMP_ADAPTER pAd) */ if (TxErrorRatio == 100) { TX_RTY_CFG_STRUC TxRtyCfg, TxRtyCfgtmp; - ULONG Index; - ULONG MACValue; + unsigned long Index; + unsigned long MACValue; RTMP_IO_READ32(pAd, TX_RTY_CFG, &TxRtyCfg.word); TxRtyCfgtmp.word = TxRtyCfg.word; @@ -2039,12 +2039,12 @@ VOID MlmeDynamicTxRateSwitching(IN PRTMP_ADAPTER pAd) /* (criteria copied from RT2500 for Netopia case) */ /* */ if (TxTotalCnt <= 15) { - CHAR idx = 0; - UCHAR TxRateIdx; - UCHAR MCS0 = 0, MCS1 = 0, MCS2 = 0, MCS3 = 0, MCS4 = + char idx = 0; + u8 TxRateIdx; + u8 MCS0 = 0, MCS1 = 0, MCS2 = 0, MCS3 = 0, MCS4 = 0, MCS5 = 0, MCS6 = 0, MCS7 = 0; - UCHAR MCS12 = 0, MCS13 = 0, MCS14 = 0, MCS15 = 0; - UCHAR MCS20 = 0, MCS21 = 0, MCS22 = 0, MCS23 = 0; /* 3*3 */ + u8 MCS12 = 0, MCS13 = 0, MCS14 = 0, MCS15 = 0; + u8 MCS20 = 0, MCS21 = 0, MCS22 = 0, MCS23 = 0; /* 3*3 */ /* check the existence and index of each needed MCS */ while (idx < pTable[0]) { @@ -2198,10 +2198,10 @@ VOID MlmeDynamicTxRateSwitching(IN PRTMP_ADAPTER pAd) } NdisZeroMemory(pEntry->TxQuality, - sizeof(USHORT) * + sizeof(u16)* MAX_STEP_OF_TX_RATE_SWITCH); NdisZeroMemory(pEntry->PER, - sizeof(UCHAR) * + sizeof(u8)* MAX_STEP_OF_TX_RATE_SWITCH); pEntry->fLastSecAccordingRSSI = TRUE; /* reset all OneSecTx counters */ @@ -2243,7 +2243,7 @@ VOID MlmeDynamicTxRateSwitching(IN PRTMP_ADAPTER pAd) pEntry->TxQuality[UpRateIdx]--; /* may improve next UP rate's quality */ } - pEntry->PER[CurrRateIdx] = (UCHAR) TxErrorRatio; + pEntry->PER[CurrRateIdx] = (u8)TxErrorRatio; if (bTrainUpDown) { /* perform DRS - consider TxRate Down first, then rate up. */ @@ -2265,10 +2265,10 @@ VOID MlmeDynamicTxRateSwitching(IN PRTMP_ADAPTER pAd) pEntry->TxRateUpPenalty = 0; pEntry->LastSecTxRateChangeAction = 1; /* rate UP */ NdisZeroMemory(pEntry->TxQuality, - sizeof(USHORT) * + sizeof(u16)* MAX_STEP_OF_TX_RATE_SWITCH); NdisZeroMemory(pEntry->PER, - sizeof(UCHAR) * + sizeof(u8)* MAX_STEP_OF_TX_RATE_SWITCH); /* */ @@ -2311,7 +2311,7 @@ VOID MlmeDynamicTxRateSwitching(IN PRTMP_ADAPTER pAd) pEntry->LastTxOkCount = TxSuccess; { - UCHAR tmpTxRate; + u8 tmpTxRate; /* to fix tcp ack issue */ if (!bTxRateChanged @@ -2359,26 +2359,26 @@ VOID MlmeDynamicTxRateSwitching(IN PRTMP_ADAPTER pAd) ======================================================================== */ -VOID StaQuickResponeForRateUpExec(IN PVOID SystemSpecific1, - IN PVOID FunctionContext, - IN PVOID SystemSpecific2, - IN PVOID SystemSpecific3) +void StaQuickResponeForRateUpExec(void *SystemSpecific1, + void *FunctionContext, + void *SystemSpecific2, + void *SystemSpecific3) { PRTMP_ADAPTER pAd = (PRTMP_ADAPTER) FunctionContext; - UCHAR UpRateIdx = 0, DownRateIdx = 0, CurrRateIdx = 0; - ULONG TxTotalCnt; - ULONG TxErrorRatio = 0; + u8 UpRateIdx = 0, DownRateIdx = 0, CurrRateIdx = 0; + unsigned long TxTotalCnt; + unsigned long TxErrorRatio = 0; BOOLEAN bTxRateChanged; /*, bUpgradeQuality = FALSE; */ PRTMP_TX_RATE_SWITCH pCurrTxRate, pNextTxRate = NULL; - PUCHAR pTable; - UCHAR TableSize = 0; - UCHAR InitTxRateIdx = 0, TrainUp, TrainDown; + u8 *pTable; + u8 TableSize = 0; + u8 InitTxRateIdx = 0, TrainUp, TrainDown; TX_STA_CNT1_STRUC StaTx1; TX_STA_CNT0_STRUC TxStaCnt0; - CHAR Rssi, ratio; - ULONG TxRetransmit = 0, TxSuccess = 0, TxFailCount = 0; + char Rssi, ratio; + unsigned long TxRetransmit = 0, TxSuccess = 0, TxFailCount = 0; MAC_TABLE_ENTRY *pEntry; - ULONG i; + unsigned long i; pAd->StaCfg.StaQuickResponeForRateUpTimerRunning = FALSE; @@ -2480,10 +2480,10 @@ VOID StaQuickResponeForRateUpExec(IN PVOID SystemSpecific1, /* */ if (TxTotalCnt <= 12) { NdisZeroMemory(pAd->DrsCounters.TxQuality, - sizeof(USHORT) * + sizeof(u16)* MAX_STEP_OF_TX_RATE_SWITCH); NdisZeroMemory(pAd->DrsCounters.PER, - sizeof(UCHAR) * + sizeof(u8)* MAX_STEP_OF_TX_RATE_SWITCH); if ((pAd->DrsCounters.LastSecTxRateChangeAction == 1) @@ -2503,7 +2503,7 @@ VOID StaQuickResponeForRateUpExec(IN PVOID SystemSpecific1, } do { - ULONG OneSecTxNoRetryOKRationCount; + unsigned long OneSecTxNoRetryOKRationCount; if (pAd->DrsCounters.LastTimeTxRateChangeAction == 0) ratio = 5; @@ -2517,7 +2517,7 @@ VOID StaQuickResponeForRateUpExec(IN PVOID SystemSpecific1, } pAd->DrsCounters.PER[CurrRateIdx] = - (UCHAR) TxErrorRatio; + (u8)TxErrorRatio; OneSecTxNoRetryOKRationCount = (TxSuccess * ratio); @@ -2551,10 +2551,10 @@ VOID StaQuickResponeForRateUpExec(IN PVOID SystemSpecific1, if (pAd->CommonCfg.TxRateIndex > CurrRateIdx) { pAd->DrsCounters.TxRateUpPenalty = 0; NdisZeroMemory(pAd->DrsCounters.TxQuality, - sizeof(USHORT) * + sizeof(u16)* MAX_STEP_OF_TX_RATE_SWITCH); NdisZeroMemory(pAd->DrsCounters.PER, - sizeof(UCHAR) * + sizeof(u8)* MAX_STEP_OF_TX_RATE_SWITCH); bTxRateChanged = TRUE; } @@ -2601,9 +2601,9 @@ VOID StaQuickResponeForRateUpExec(IN PVOID SystemSpecific1, ========================================================================== */ -VOID MlmeCheckPsmChange(IN PRTMP_ADAPTER pAd, IN ULONG Now32) +void MlmeCheckPsmChange(IN PRTMP_ADAPTER pAd, unsigned long Now32) { - ULONG PowerMode; + unsigned long PowerMode; /* condition - */ /* 1. Psm maybe ON only happen in INFRASTRUCTURE mode */ @@ -2638,7 +2638,7 @@ VOID MlmeCheckPsmChange(IN PRTMP_ADAPTER pAd, IN ULONG Now32) /* IRQL = PASSIVE_LEVEL */ /* IRQL = DISPATCH_LEVEL */ -VOID MlmeSetPsmBit(IN PRTMP_ADAPTER pAd, IN USHORT psm) +void MlmeSetPsmBit(IN PRTMP_ADAPTER pAd, u16 psm) { AUTO_RSP_CFG_STRUC csr4; @@ -2669,21 +2669,21 @@ VOID MlmeSetPsmBit(IN PRTMP_ADAPTER pAd, IN USHORT psm) channel quality based on the most up-to-date information ========================================================================== */ -VOID MlmeCalculateChannelQuality(IN PRTMP_ADAPTER pAd, - IN PMAC_TABLE_ENTRY pMacEntry, IN ULONG Now32) +void MlmeCalculateChannelQuality(IN PRTMP_ADAPTER pAd, + IN PMAC_TABLE_ENTRY pMacEntry, unsigned long Now32) { - ULONG TxOkCnt, TxCnt, TxPER, TxPRR; - ULONG RxCnt, RxPER; - UCHAR NorRssi; - CHAR MaxRssi; + unsigned long TxOkCnt, TxCnt, TxPER, TxPRR; + unsigned long RxCnt, RxPER; + u8 NorRssi; + char MaxRssi; RSSI_SAMPLE *pRssiSample = NULL; - UINT32 OneSecTxNoRetryOkCount = 0; - UINT32 OneSecTxRetryOkCount = 0; - UINT32 OneSecTxFailCount = 0; - UINT32 OneSecRxOkCnt = 0; - UINT32 OneSecRxFcsErrCnt = 0; - ULONG ChannelQuality = 0; /* 0..100, Channel Quality Indication for Roaming */ - ULONG BeaconLostTime = pAd->StaCfg.BeaconLostTime; + u32 OneSecTxNoRetryOkCount = 0; + u32 OneSecTxRetryOkCount = 0; + u32 OneSecTxFailCount = 0; + u32 OneSecRxOkCnt = 0; + u32 OneSecRxFcsErrCnt = 0; + unsigned long ChannelQuality = 0; /* 0..100, Channel Quality Indication for Roaming */ + unsigned long BeaconLostTime = pAd->StaCfg.BeaconLostTime; if (pAd->OpMode == OPMODE_STA) { pRssiSample = &pAd->StaCfg.RssiSample; @@ -2751,7 +2751,7 @@ VOID MlmeCalculateChannelQuality(IN PRTMP_ADAPTER pAd, } /* IRQL = DISPATCH_LEVEL */ -VOID MlmeSetTxPreamble(IN PRTMP_ADAPTER pAd, IN USHORT TxPreamble) +void MlmeSetTxPreamble(IN PRTMP_ADAPTER pAd, u16 TxPreamble) { AUTO_RSP_CFG_STRUC csr4; @@ -2764,13 +2764,13 @@ VOID MlmeSetTxPreamble(IN PRTMP_ADAPTER pAd, IN USHORT TxPreamble) RTMP_IO_READ32(pAd, AUTO_RSP_CFG, &csr4.word); if (TxPreamble == Rt802_11PreambleLong) { DBGPRINT(RT_DEBUG_TRACE, - ("MlmeSetTxPreamble (= LONG PREAMBLE)\n")); + ("MlmeSetTxPreamble (= long PREAMBLE)\n")); OPSTATUS_CLEAR_FLAG(pAd, fOP_STATUS_SHORT_PREAMBLE_INUSED); csr4.field.AutoResponderPreamble = 0; } else { /* NOTE: 1Mbps should always use long preamble */ DBGPRINT(RT_DEBUG_TRACE, - ("MlmeSetTxPreamble (= SHORT PREAMBLE)\n")); + ("MlmeSetTxPreamble (= short PREAMBLE)\n")); OPSTATUS_SET_FLAG(pAd, fOP_STATUS_SHORT_PREAMBLE_INUSED); csr4.field.AutoResponderPreamble = 1; } @@ -2785,14 +2785,14 @@ VOID MlmeSetTxPreamble(IN PRTMP_ADAPTER pAd, IN USHORT TxPreamble) ========================================================================== */ -VOID UpdateBasicRateBitmap(IN PRTMP_ADAPTER pAdapter) +void UpdateBasicRateBitmap(IN PRTMP_ADAPTER pAdapter) { - INT i, j; + int i, j; /* 1 2 5.5, 11, 6, 9, 12, 18, 24, 36, 48, 54 */ - UCHAR rate[] = { 2, 4, 11, 22, 12, 18, 24, 36, 48, 72, 96, 108 }; - UCHAR *sup_p = pAdapter->CommonCfg.SupRate; - UCHAR *ext_p = pAdapter->CommonCfg.ExtRate; - ULONG bitmap = pAdapter->CommonCfg.BasicRateBitmap; + u8 rate[] = { 2, 4, 11, 22, 12, 18, 24, 36, 48, 72, 96, 108 }; + u8 *sup_p = pAdapter->CommonCfg.SupRate; + u8 *ext_p = pAdapter->CommonCfg.ExtRate; + unsigned long bitmap = pAdapter->CommonCfg.BasicRateBitmap; /* if A mode, always use fix BasicRateBitMap */ /*if (pAdapter->CommonCfg.Channel == PHY_11A) */ @@ -2831,19 +2831,19 @@ VOID UpdateBasicRateBitmap(IN PRTMP_ADAPTER pAdapter) /* IRQL = DISPATCH_LEVEL */ /* bLinkUp is to identify the inital link speed. */ /* TRUE indicates the rate update at linkup, we should not try to set the rate at 54Mbps. */ -VOID MlmeUpdateTxRates(IN PRTMP_ADAPTER pAd, IN BOOLEAN bLinkUp, IN UCHAR apidx) +void MlmeUpdateTxRates(IN PRTMP_ADAPTER pAd, IN BOOLEAN bLinkUp, u8 apidx) { int i, num; - UCHAR Rate = RATE_6, MaxDesire = RATE_1, MaxSupport = RATE_1; - UCHAR MinSupport = RATE_54; - ULONG BasicRateBitmap = 0; - UCHAR CurrBasicRate = RATE_1; - UCHAR *pSupRate, SupRateLen, *pExtRate, ExtRateLen; + u8 Rate = RATE_6, MaxDesire = RATE_1, MaxSupport = RATE_1; + u8 MinSupport = RATE_54; + unsigned long BasicRateBitmap = 0; + u8 CurrBasicRate = RATE_1; + u8 *pSupRate, SupRateLen, *pExtRate, ExtRateLen; PHTTRANSMIT_SETTING pHtPhy = NULL; PHTTRANSMIT_SETTING pMaxHtPhy = NULL; PHTTRANSMIT_SETTING pMinHtPhy = NULL; BOOLEAN *auto_rate_cur_p; - UCHAR HtMcs = MCS_AUTO; + u8 HtMcs = MCS_AUTO; /* find max desired rate */ UpdateBasicRateBitmap(pAd); @@ -3112,7 +3112,7 @@ VOID MlmeUpdateTxRates(IN PRTMP_ADAPTER pAd, IN BOOLEAN bLinkUp, IN UCHAR apidx) /* the DURATION field of outgoing uniicast DATA/MGMT frame */ for (i = 0; i < MAX_LEN_OF_SUPPORTED_RATES; i++) { if (BasicRateBitmap & (0x01 << i)) - CurrBasicRate = (UCHAR) i; + CurrBasicRate = (u8)i; pAd->CommonCfg.ExpectedACKRate[i] = CurrBasicRate; } @@ -3292,14 +3292,14 @@ VOID MlmeUpdateTxRates(IN PRTMP_ADAPTER pAd, IN BOOLEAN bLinkUp, IN UCHAR apidx) ========================================================================== */ -VOID MlmeUpdateHtTxRates(IN PRTMP_ADAPTER pAd, IN UCHAR apidx) +void MlmeUpdateHtTxRates(IN PRTMP_ADAPTER pAd, u8 apidx) { - UCHAR StbcMcs; /*j, StbcMcs, bitmask; */ - CHAR i; /* 3*3 */ + u8 StbcMcs; /*j, StbcMcs, bitmask; */ + char i; /* 3*3 */ RT_HT_CAPABILITY *pRtHtCap = NULL; RT_HT_PHY_INFO *pActiveHtPhy = NULL; - ULONG BasicMCS; - UCHAR j, bitmask; + unsigned long BasicMCS; + u8 j, bitmask; PRT_HT_PHY_INFO pDesireHtPhy = NULL; PHTTRANSMIT_SETTING pHtPhy = NULL; PHTTRANSMIT_SETTING pMaxHtPhy = NULL; @@ -3326,7 +3326,7 @@ VOID MlmeUpdateHtTxRates(IN PRTMP_ADAPTER pAd, IN UCHAR apidx) pRtHtCap = &pAd->StaActive.SupportedHtPhy; pActiveHtPhy = &pAd->StaActive.SupportedPhyInfo; - StbcMcs = (UCHAR) pAd->MlmeAux.AddHtInfo.AddHtInfo3.StbcMcs; + StbcMcs = (u8)pAd->MlmeAux.AddHtInfo.AddHtInfo3.StbcMcs; BasicMCS = pAd->MlmeAux.AddHtInfo.MCSSet[0] + (pAd->MlmeAux.AddHtInfo.MCSSet[1] << 8) + (StbcMcs << 16); @@ -3340,7 +3340,7 @@ VOID MlmeUpdateHtTxRates(IN PRTMP_ADAPTER pAd, IN UCHAR apidx) return; pRtHtCap = &pAd->CommonCfg.DesiredHtPhy; - StbcMcs = (UCHAR) pAd->CommonCfg.AddHTInfo.AddHtInfo3.StbcMcs; + StbcMcs = (u8)pAd->CommonCfg.AddHTInfo.AddHtInfo3.StbcMcs; BasicMCS = pAd->CommonCfg.AddHTInfo.MCSSet[0] + (pAd->CommonCfg.AddHTInfo.MCSSet[1] << 8) + (StbcMcs << 16); @@ -3406,7 +3406,7 @@ VOID MlmeUpdateHtTxRates(IN PRTMP_ADAPTER pAd, IN UCHAR apidx) pMinHtPhy->field.MCS)); } - for (i = 23; (CHAR) i >= 0; i--) /* 3*3 */ + for (i = 23; (char)i >= 0; i--) /* 3*3 */ { j = i / 8; bitmask = (1 << (i - (j * 8))); @@ -3444,7 +3444,7 @@ VOID MlmeUpdateHtTxRates(IN PRTMP_ADAPTER pAd, IN UCHAR apidx) DBGPRINT(RT_DEBUG_TRACE, ("MlmeUpdateHtTxRates<=== \n")); } -VOID BATableInit(IN PRTMP_ADAPTER pAd, IN BA_TABLE * Tab) +void BATableInit(IN PRTMP_ADAPTER pAd, IN BA_TABLE * Tab) { int i; @@ -3462,13 +3462,13 @@ VOID BATableInit(IN PRTMP_ADAPTER pAd, IN BA_TABLE * Tab) } /* IRQL = DISPATCH_LEVEL */ -VOID MlmeRadioOff(IN PRTMP_ADAPTER pAd) +void MlmeRadioOff(IN PRTMP_ADAPTER pAd) { RTMP_MLME_RADIO_OFF(pAd); } /* IRQL = DISPATCH_LEVEL */ -VOID MlmeRadioOn(IN PRTMP_ADAPTER pAd) +void MlmeRadioOn(IN PRTMP_ADAPTER pAd) { RTMP_MLME_RADIO_ON(pAd); } @@ -3487,7 +3487,7 @@ VOID MlmeRadioOn(IN PRTMP_ADAPTER pAd) IRQL = DISPATCH_LEVEL */ -VOID BssTableInit(IN BSS_TABLE * Tab) +void BssTableInit(IN BSS_TABLE * Tab) { int i; @@ -3510,9 +3510,9 @@ VOID BssTableInit(IN BSS_TABLE * Tab) IRQL = DISPATCH_LEVEL */ -ULONG BssTableSearch(IN BSS_TABLE * Tab, IN PUCHAR pBssid, IN UCHAR Channel) +unsigned long BssTableSearch(IN BSS_TABLE * Tab, u8 *pBssid, u8 Channel) { - UCHAR i; + u8 i; for (i = 0; i < Tab->BssNr; i++) { /* */ @@ -3525,14 +3525,14 @@ ULONG BssTableSearch(IN BSS_TABLE * Tab, IN PUCHAR pBssid, IN UCHAR Channel) return i; } } - return (ULONG) BSS_NOT_FOUND; + return (unsigned long)BSS_NOT_FOUND; } -ULONG BssSsidTableSearch(IN BSS_TABLE * Tab, - IN PUCHAR pBssid, - IN PUCHAR pSsid, IN UCHAR SsidLen, IN UCHAR Channel) +unsigned long BssSsidTableSearch(IN BSS_TABLE * Tab, + u8 *pBssid, + u8 *pSsid, u8 SsidLen, u8 Channel) { - UCHAR i; + u8 i; for (i = 0; i < Tab->BssNr; i++) { /* */ @@ -3547,15 +3547,15 @@ ULONG BssSsidTableSearch(IN BSS_TABLE * Tab, return i; } } - return (ULONG) BSS_NOT_FOUND; + return (unsigned long)BSS_NOT_FOUND; } -ULONG BssTableSearchWithSSID(IN BSS_TABLE * Tab, - IN PUCHAR Bssid, - IN PUCHAR pSsid, - IN UCHAR SsidLen, IN UCHAR Channel) +unsigned long BssTableSearchWithSSID(IN BSS_TABLE * Tab, + u8 *Bssid, + u8 *pSsid, + u8 SsidLen, u8 Channel) { - UCHAR i; + u8 i; for (i = 0; i < Tab->BssNr; i++) { if ((((Tab->BssEntry[i].Channel <= 14) && (Channel <= 14)) || @@ -3572,13 +3572,13 @@ ULONG BssTableSearchWithSSID(IN BSS_TABLE * Tab, return i; } } - return (ULONG) BSS_NOT_FOUND; + return (unsigned long)BSS_NOT_FOUND; } -ULONG BssSsidTableSearchBySSID(IN BSS_TABLE * Tab, - IN PUCHAR pSsid, IN UCHAR SsidLen) +unsigned long BssSsidTableSearchBySSID(IN BSS_TABLE * Tab, + u8 *pSsid, u8 SsidLen) { - UCHAR i; + u8 i; for (i = 0; i < Tab->BssNr; i++) { if (SSID_EQUAL @@ -3587,14 +3587,14 @@ ULONG BssSsidTableSearchBySSID(IN BSS_TABLE * Tab, return i; } } - return (ULONG) BSS_NOT_FOUND; + return (unsigned long)BSS_NOT_FOUND; } /* IRQL = DISPATCH_LEVEL */ -VOID BssTableDeleteEntry(IN OUT BSS_TABLE * Tab, - IN PUCHAR pBssid, IN UCHAR Channel) +void BssTableDeleteEntry(IN OUT BSS_TABLE * Tab, + u8 *pBssid, u8 Channel) { - UCHAR i, j; + u8 i, j; for (i = 0; i < Tab->BssNr; i++) { if ((Tab->BssEntry[i].Channel == Channel) && @@ -3621,7 +3621,7 @@ VOID BssTableDeleteEntry(IN OUT BSS_TABLE * Tab, // IRQL = DISPATCH_LEVEL ======================================================================== */ -VOID BATableDeleteORIEntry(IN OUT PRTMP_ADAPTER pAd, +void BATableDeleteORIEntry(IN OUT PRTMP_ADAPTER pAd, IN BA_ORI_ENTRY * pBAORIEntry) { @@ -3652,18 +3652,18 @@ VOID BATableDeleteORIEntry(IN OUT PRTMP_ADAPTER pAd, IRQL = DISPATCH_LEVEL */ -VOID BssEntrySet(IN PRTMP_ADAPTER pAd, OUT BSS_ENTRY * pBss, IN PUCHAR pBssid, IN CHAR Ssid[], IN UCHAR SsidLen, IN UCHAR BssType, IN USHORT BeaconPeriod, IN PCF_PARM pCfParm, IN USHORT AtimWin, IN USHORT CapabilityInfo, IN UCHAR SupRate[], IN UCHAR SupRateLen, IN UCHAR ExtRate[], IN UCHAR ExtRateLen, IN HT_CAPABILITY_IE * pHtCapability, IN ADD_HT_INFO_IE * pAddHtInfo, /* AP might use this additional ht info IE */ - IN UCHAR HtCapabilityLen, - IN UCHAR AddHtInfoLen, - IN UCHAR NewExtChanOffset, - IN UCHAR Channel, - IN CHAR Rssi, +void BssEntrySet(IN PRTMP_ADAPTER pAd, OUT BSS_ENTRY * pBss, u8 *pBssid, char Ssid[], u8 SsidLen, u8 BssType, u16 BeaconPeriod, IN PCF_PARM pCfParm, u16 AtimWin, u16 CapabilityInfo, u8 SupRate[], u8 SupRateLen, u8 ExtRate[], u8 ExtRateLen, IN HT_CAPABILITY_IE * pHtCapability, IN ADD_HT_INFO_IE * pAddHtInfo, /* AP might use this additional ht info IE */ + u8 HtCapabilityLen, + u8 AddHtInfoLen, + u8 NewExtChanOffset, + u8 Channel, + char Rssi, IN LARGE_INTEGER TimeStamp, - IN UCHAR CkipFlag, + u8 CkipFlag, IN PEDCA_PARM pEdcaParm, IN PQOS_CAPABILITY_PARM pQosCapability, IN PQBSS_LOAD_PARM pQbssLoad, - IN USHORT LengthVIE, IN PNDIS_802_11_VARIABLE_IEs pVIE) + u16 LengthVIE, IN PNDIS_802_11_VARIABLE_IEs pVIE) { COPY_MAC_ADDR(pBss->Bssid, pBssid); /* Default Hidden SSID to be TRUE, it will be turned to FALSE after coping SSID */ @@ -3777,12 +3777,12 @@ VOID BssEntrySet(IN PRTMP_ADAPTER pAd, OUT BSS_ENTRY * pBss, IN PUCHAR pBssid, I { PEID_STRUCT pEid; - USHORT Length = 0; + u16 Length = 0; NdisZeroMemory(&pBss->WpaIE.IE[0], MAX_CUSTOM_LEN); NdisZeroMemory(&pBss->RsnIE.IE[0], MAX_CUSTOM_LEN); pEid = (PEID_STRUCT) pVIE; - while ((Length + 2 + (USHORT) pEid->Len) <= LengthVIE) { + while ((Length + 2 + (u16)pEid->Len) <= LengthVIE) { switch (pEid->Eid) { case IE_WPA: if (NdisEqualMemory(pEid->Octet, WPA_OUI, 4)) { @@ -3808,8 +3808,8 @@ VOID BssEntrySet(IN PRTMP_ADAPTER pAd, OUT BSS_ENTRY * pBss, IN PUCHAR pBssid, I } break; } - Length = Length + 2 + (USHORT) pEid->Len; /* Eid[1] + Len[1]+ content[Len] */ - pEid = (PEID_STRUCT) ((UCHAR *) pEid + 2 + pEid->Len); + Length = Length + 2 + (u16)pEid->Len; /* Eid[1] + Len[1]+ content[Len] */ + pEid = (PEID_STRUCT) ((u8 *) pEid + 2 + pEid->Len); } } } @@ -3837,23 +3837,23 @@ VOID BssEntrySet(IN PRTMP_ADAPTER pAd, OUT BSS_ENTRY * pBss, IN PUCHAR pBssid, I IRQL = DISPATCH_LEVEL */ -ULONG BssTableSetEntry(IN PRTMP_ADAPTER pAd, OUT BSS_TABLE * Tab, IN PUCHAR pBssid, IN CHAR Ssid[], IN UCHAR SsidLen, IN UCHAR BssType, IN USHORT BeaconPeriod, IN CF_PARM * CfParm, IN USHORT AtimWin, IN USHORT CapabilityInfo, IN UCHAR SupRate[], IN UCHAR SupRateLen, IN UCHAR ExtRate[], IN UCHAR ExtRateLen, IN HT_CAPABILITY_IE * pHtCapability, IN ADD_HT_INFO_IE * pAddHtInfo, /* AP might use this additional ht info IE */ - IN UCHAR HtCapabilityLen, - IN UCHAR AddHtInfoLen, - IN UCHAR NewExtChanOffset, - IN UCHAR ChannelNo, - IN CHAR Rssi, +unsigned long BssTableSetEntry(IN PRTMP_ADAPTER pAd, OUT BSS_TABLE * Tab, u8 *pBssid, char Ssid[], u8 SsidLen, u8 BssType, u16 BeaconPeriod, IN CF_PARM * CfParm, u16 AtimWin, u16 CapabilityInfo, u8 SupRate[], u8 SupRateLen, u8 ExtRate[], u8 ExtRateLen, IN HT_CAPABILITY_IE * pHtCapability, IN ADD_HT_INFO_IE * pAddHtInfo, /* AP might use this additional ht info IE */ + u8 HtCapabilityLen, + u8 AddHtInfoLen, + u8 NewExtChanOffset, + u8 ChannelNo, + char Rssi, IN LARGE_INTEGER TimeStamp, - IN UCHAR CkipFlag, + u8 CkipFlag, IN PEDCA_PARM pEdcaParm, IN PQOS_CAPABILITY_PARM pQosCapability, IN PQBSS_LOAD_PARM pQbssLoad, - IN USHORT LengthVIE, IN PNDIS_802_11_VARIABLE_IEs pVIE) + u16 LengthVIE, IN PNDIS_802_11_VARIABLE_IEs pVIE) { - ULONG Idx; + unsigned long Idx; Idx = - BssTableSearchWithSSID(Tab, pBssid, (UCHAR *) Ssid, SsidLen, + BssTableSearchWithSSID(Tab, pBssid, (u8 *) Ssid, SsidLen, ChannelNo); if (Idx == BSS_NOT_FOUND) { if (Tab->BssNr >= MAX_LEN_OF_BSS_TABLE) { @@ -3924,10 +3924,10 @@ ULONG BssTableSetEntry(IN PRTMP_ADAPTER pAd, OUT BSS_TABLE * Tab, IN PUCHAR pBss } /* IRQL = DISPATCH_LEVEL */ -VOID BssTableSsidSort(IN PRTMP_ADAPTER pAd, - OUT BSS_TABLE * OutTab, IN CHAR Ssid[], IN UCHAR SsidLen) +void BssTableSsidSort(IN PRTMP_ADAPTER pAd, + OUT BSS_TABLE * OutTab, char Ssid[], u8 SsidLen) { - INT i; + int i; BssTableInit(OutTab); for (i = 0; i < pAd->ScanTab.BssNr; i++) { @@ -4180,9 +4180,9 @@ VOID BssTableSsidSort(IN PRTMP_ADAPTER pAd, } /* IRQL = DISPATCH_LEVEL */ -VOID BssTableSortByRssi(IN OUT BSS_TABLE * OutTab) +void BssTableSortByRssi(IN OUT BSS_TABLE * OutTab) { - INT i, j; + int i, j; BSS_ENTRY TmpBss; for (i = 0; i < OutTab->BssNr - 1; i++) { @@ -4200,15 +4200,15 @@ VOID BssTableSortByRssi(IN OUT BSS_TABLE * OutTab) } } -VOID BssCipherParse(IN OUT PBSS_ENTRY pBss) +void BssCipherParse(IN OUT PBSS_ENTRY pBss) { PEID_STRUCT pEid; - PUCHAR pTmp; + u8 *pTmp; PRSN_IE_HEADER_STRUCT pRsnHeader; PCIPHER_SUITE_STRUCT pCipher; PAKM_SUITE_STRUCT pAKM; - USHORT Count; - INT Length; + u16 Count; + int Length; NDIS_802_11_ENCRYPTION_STATUS TmpCipher; /* */ @@ -4237,11 +4237,11 @@ VOID BssCipherParse(IN OUT PBSS_ENTRY pBss) pBss->WPA2.RsnCapability = 0; pBss->WPA2.bMixMode = FALSE; - Length = (INT) pBss->VarIELen; + Length = (int)pBss->VarIELen; while (Length > 0) { /* Parse cipher suite base on WPA1 & WPA2, they should be parsed differently */ - pTmp = ((PUCHAR) pBss->VarIEs) + pBss->VarIELen - Length; + pTmp = ((u8 *)pBss->VarIEs) + pBss->VarIELen - Length; pEid = (PEID_STRUCT) pTmp; switch (pEid->Eid) { case IE_WPA: @@ -4257,7 +4257,7 @@ VOID BssCipherParse(IN OUT PBSS_ENTRY pBss) /* Skip OUI, version, and multicast suite */ /* This part should be improved in the future when AP supported multiple cipher suite. */ /* For now, it's OK since almost all APs have fixed cipher suite supported. */ - /* pTmp = (PUCHAR) pEid->Octet; */ + /* pTmp = (u8 *)pEid->Octet; */ pTmp += 11; /* Cipher Suite Selectors from Spec P802.11i/D3.2 P26. */ @@ -4293,9 +4293,9 @@ VOID BssCipherParse(IN OUT PBSS_ENTRY pBss) pTmp += 1; /* skip all unicast cipher suites */ - /*Count = *(PUSHORT) pTmp; */ + /*Count = *(u16 *)pTmp; */ Count = (pTmp[1] << 8) + pTmp[0]; - pTmp += sizeof(USHORT); + pTmp += sizeof(u16); /* Parsing all unicast cipher suite */ while (Count > 0) { @@ -4332,9 +4332,9 @@ VOID BssCipherParse(IN OUT PBSS_ENTRY pBss) } /* 4. get AKM suite counts */ - /*Count = *(PUSHORT) pTmp; */ + /*Count = *(u16 *)pTmp; */ Count = (pTmp[1] << 8) + pTmp[0]; - pTmp += sizeof(USHORT); + pTmp += sizeof(u16); pTmp += 3; switch (*pTmp) { @@ -4417,9 +4417,9 @@ VOID BssCipherParse(IN OUT PBSS_ENTRY pBss) pTmp += sizeof(CIPHER_SUITE_STRUCT); /* 2. Get pairwise cipher counts */ - /*Count = *(PUSHORT) pTmp; */ + /*Count = *(u16 *)pTmp; */ Count = (pTmp[1] << 8) + pTmp[0]; - pTmp += sizeof(USHORT); + pTmp += sizeof(u16); /* 3. Get pairwise cipher */ /* Parsing all unicast cipher suite */ @@ -4457,9 +4457,9 @@ VOID BssCipherParse(IN OUT PBSS_ENTRY pBss) } /* 4. get AKM suite counts */ - /*Count = *(PUSHORT) pTmp; */ + /*Count = *(u16 *)pTmp; */ Count = (pTmp[1] << 8) + pTmp[0]; - pTmp += sizeof(USHORT); + pTmp += sizeof(u16); /* 5. Get AKM ciphers */ /* Parsing all AKM ciphers */ @@ -4520,9 +4520,9 @@ VOID BssCipherParse(IN OUT PBSS_ENTRY pBss) pBss->WepStatus = pBss->WPA2.PairCipher; /* 6. Get RSN capability */ - /*pBss->WPA2.RsnCapability = *(PUSHORT) pTmp; */ + /*pBss->WPA2.RsnCapability = *(u16 *)pTmp; */ pBss->WPA2.RsnCapability = (pTmp[1] << 8) + pTmp[0]; - pTmp += sizeof(USHORT); + pTmp += sizeof(u16); /* Check the Pair & Group, if different, turn on mixed mode flag */ if (pBss->WPA2.GroupCipher != pBss->WPA2.PairCipher) @@ -4546,9 +4546,9 @@ VOID BssCipherParse(IN OUT PBSS_ENTRY pBss) * \pre * \post */ -VOID MacAddrRandomBssid(IN PRTMP_ADAPTER pAd, OUT PUCHAR pAddr) +void MacAddrRandomBssid(IN PRTMP_ADAPTER pAd, u8 *pAddr) { - INT i; + int i; for (i = 0; i < MAC_ADDR_LEN; i++) { pAddr[i] = RandomByte(pAd); @@ -4572,10 +4572,10 @@ VOID MacAddrRandomBssid(IN PRTMP_ADAPTER pAd, OUT PUCHAR pAddr) IRQL = DISPATCH_LEVEL */ -VOID MgtMacHeaderInit(IN PRTMP_ADAPTER pAd, +void MgtMacHeaderInit(IN PRTMP_ADAPTER pAd, IN OUT PHEADER_802_11 pHdr80211, - IN UCHAR SubType, - IN UCHAR ToDs, IN PUCHAR pDA, IN PUCHAR pBssid) + u8 SubType, + u8 ToDs, u8 *pDA, u8 *pBssid) { NdisZeroMemory(pHdr80211, sizeof(HEADER_802_11)); @@ -4611,11 +4611,11 @@ VOID MgtMacHeaderInit(IN PRTMP_ADAPTER pAd, IRQL = DISPATCH_LEVEL ****************************************************************************/ -ULONG MakeOutgoingFrame(OUT UCHAR * Buffer, OUT ULONG * FrameLen, ...) +unsigned long MakeOutgoingFrame(u8 * Buffer, unsigned long * FrameLen, ...) { - UCHAR *p; + u8 *p; int leng; - ULONG TotLeng; + unsigned long TotLeng; va_list Args; /* calculates the total length */ @@ -4626,7 +4626,7 @@ ULONG MakeOutgoingFrame(OUT UCHAR * Buffer, OUT ULONG * FrameLen, ...) if (leng == END_OF_ARGS) { break; } - p = va_arg(Args, PVOID); + p = va_arg(Args, void *); NdisMoveMemory(&Buffer[TotLeng], p, leng); TotLeng = TotLeng + leng; } while (TRUE); @@ -4650,9 +4650,9 @@ ULONG MakeOutgoingFrame(OUT UCHAR * Buffer, OUT ULONG * FrameLen, ...) IRQL = PASSIVE_LEVEL */ -NDIS_STATUS MlmeQueueInit(IN MLME_QUEUE * Queue) +int MlmeQueueInit(IN MLME_QUEUE * Queue) { - INT i; + int i; NdisAllocateSpinLock(&Queue->Lock); @@ -4685,10 +4685,10 @@ NDIS_STATUS MlmeQueueInit(IN MLME_QUEUE * Queue) */ BOOLEAN MlmeEnqueue(IN PRTMP_ADAPTER pAd, - IN ULONG Machine, - IN ULONG MsgType, IN ULONG MsgLen, IN VOID * Msg) + unsigned long Machine, + unsigned long MsgType, unsigned long MsgLen, void * Msg) { - INT Tail; + int Tail; MLME_QUEUE *Queue = (MLME_QUEUE *) & pAd->Mlme.Queue; /* Do nothing if the driver is starting halt state. */ @@ -4745,17 +4745,17 @@ BOOLEAN MlmeEnqueue(IN PRTMP_ADAPTER pAd, */ BOOLEAN MlmeEnqueueForRecv(IN PRTMP_ADAPTER pAd, - IN ULONG Wcid, - IN ULONG TimeStampHigh, - IN ULONG TimeStampLow, - IN UCHAR Rssi0, - IN UCHAR Rssi1, - IN UCHAR Rssi2, - IN ULONG MsgLen, IN VOID * Msg, IN UCHAR Signal) + unsigned long Wcid, + unsigned long TimeStampHigh, + unsigned long TimeStampLow, + u8 Rssi0, + u8 Rssi1, + u8 Rssi2, + unsigned long MsgLen, void * Msg, u8 Signal) { - INT Tail, Machine; + int Tail, Machine; PFRAME_802_11 pFrame = (PFRAME_802_11) Msg; - INT MsgType; + int MsgType; MLME_QUEUE *Queue = (MLME_QUEUE *) & pAd->Mlme.Queue; /* Do nothing if the driver is starting halt state. */ @@ -4801,7 +4801,7 @@ BOOLEAN MlmeEnqueueForRecv(IN PRTMP_ADAPTER pAd, Queue->Entry[Tail].Rssi1 = Rssi1; Queue->Entry[Tail].Rssi2 = Rssi2; Queue->Entry[Tail].Signal = Signal; - Queue->Entry[Tail].Wcid = (UCHAR) Wcid; + Queue->Entry[Tail].Wcid = (u8)Wcid; Queue->Entry[Tail].Channel = pAd->LatchRfRegs.Channel; @@ -4840,7 +4840,7 @@ BOOLEAN MlmeDequeue(IN MLME_QUEUE * Queue, OUT MLME_QUEUE_ELEM ** Elem) } /* IRQL = DISPATCH_LEVEL */ -VOID MlmeRestartStateMachine(IN PRTMP_ADAPTER pAd) +void MlmeRestartStateMachine(IN PRTMP_ADAPTER pAd) { #ifdef RTMP_MAC_PCI MLME_QUEUE_ELEM *Elem = NULL; @@ -4962,7 +4962,7 @@ BOOLEAN MlmeQueueFull(IN MLME_QUEUE * Queue) IRQL = PASSIVE_LEVEL */ -VOID MlmeQueueDestroy(IN MLME_QUEUE * pQueue) +void MlmeQueueDestroy(IN MLME_QUEUE * pQueue) { NdisAcquireSpinLock(&(pQueue->Lock)); pQueue->Num = 0; @@ -4985,23 +4985,23 @@ VOID MlmeQueueDestroy(IN MLME_QUEUE * pQueue) */ BOOLEAN MsgTypeSubst(IN PRTMP_ADAPTER pAd, IN PFRAME_802_11 pFrame, - OUT INT * Machine, OUT INT * MsgType) + int * Machine, int * MsgType) { - USHORT Seq, Alg; - UCHAR EAPType; - PUCHAR pData; + u16 Seq, Alg; + u8 EAPType; + u8 *pData; /* Pointer to start of data frames including SNAP header */ - pData = (PUCHAR) pFrame + LENGTH_802_11; + pData = (u8 *)pFrame + LENGTH_802_11; /* The only data type will pass to this function is EAPOL frame */ if (pFrame->Hdr.FC.Type == BTYPE_DATA) { { *Machine = WPA_STATE_MACHINE; EAPType = - *((UCHAR *) pFrame + LENGTH_802_11 + + *((u8 *) pFrame + LENGTH_802_11 + LENGTH_802_1_H + 1); - return (WpaMsgTypeSubst(EAPType, (INT *) MsgType)); + return (WpaMsgTypeSubst(EAPType, (int *) MsgType)); } } @@ -5044,8 +5044,8 @@ BOOLEAN MsgTypeSubst(IN PRTMP_ADAPTER pAd, break; case SUBTYPE_AUTH: /* get the sequence number from payload 24 Mac Header + 2 bytes algorithm */ - NdisMoveMemory(&Seq, &pFrame->Octet[2], sizeof(USHORT)); - NdisMoveMemory(&Alg, &pFrame->Octet[0], sizeof(USHORT)); + NdisMoveMemory(&Seq, &pFrame->Octet[2], sizeof(u16)); + NdisMoveMemory(&Alg, &pFrame->Octet[0], sizeof(u16)); if (Seq == 1 || Seq == 3) { *Machine = AUTH_RSP_STATE_MACHINE; *MsgType = MT2_PEER_AUTH_ODD; @@ -5097,14 +5097,14 @@ BOOLEAN MsgTypeSubst(IN PRTMP_ADAPTER pAd, IRQL = PASSIVE_LEVEL */ -VOID StateMachineInit(IN STATE_MACHINE * S, +void StateMachineInit(IN STATE_MACHINE * S, IN STATE_MACHINE_FUNC Trans[], - IN ULONG StNr, - IN ULONG MsgNr, + unsigned long StNr, + unsigned long MsgNr, IN STATE_MACHINE_FUNC DefFunc, - IN ULONG InitState, IN ULONG Base) + unsigned long InitState, unsigned long Base) { - ULONG i, j; + unsigned long i, j; /* set number of states and messages */ S->NrState = StNr; @@ -5135,11 +5135,11 @@ VOID StateMachineInit(IN STATE_MACHINE * S, IRQL = PASSIVE_LEVEL */ -VOID StateMachineSetAction(IN STATE_MACHINE * S, - IN ULONG St, - IN ULONG Msg, IN STATE_MACHINE_FUNC Func) +void StateMachineSetAction(IN STATE_MACHINE * S, + unsigned long St, + unsigned long Msg, IN STATE_MACHINE_FUNC Func) { - ULONG MsgIdx; + unsigned long MsgIdx; MsgIdx = Msg - S->Base; @@ -5158,7 +5158,7 @@ VOID StateMachineSetAction(IN STATE_MACHINE * S, IRQL = DISPATCH_LEVEL */ -VOID StateMachinePerformAction(IN PRTMP_ADAPTER pAd, +void StateMachinePerformAction(IN PRTMP_ADAPTER pAd, IN STATE_MACHINE * S, IN MLME_QUEUE_ELEM * Elem) { (*(S->TransFunc[S->CurrState * S->NrMsg + Elem->MsgType - S->Base])) @@ -5173,7 +5173,7 @@ VOID StateMachinePerformAction(IN PRTMP_ADAPTER pAd, StateMachinePerformAction() ========================================================================== */ -VOID Drop(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) +void Drop(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) { } @@ -5189,7 +5189,7 @@ VOID Drop(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) ========================================================================== */ -VOID LfsrInit(IN PRTMP_ADAPTER pAd, IN ULONG Seed) +void LfsrInit(IN PRTMP_ADAPTER pAd, unsigned long Seed) { if (Seed == 0) pAd->Mlme.ShiftReg = 1; @@ -5202,15 +5202,15 @@ VOID LfsrInit(IN PRTMP_ADAPTER pAd, IN ULONG Seed) Description: ========================================================================== */ -UCHAR RandomByte(IN PRTMP_ADAPTER pAd) +u8 RandomByte(IN PRTMP_ADAPTER pAd) { - ULONG i; - UCHAR R, Result; + unsigned long i; + u8 R, Result; R = 0; if (pAd->Mlme.ShiftReg == 0) - NdisGetSystemUpTime((ULONG *) & pAd->Mlme.ShiftReg); + NdisGetSystemUpTime((unsigned long *) & pAd->Mlme.ShiftReg); for (i = 0; i < 8; i++) { if (pAd->Mlme.ShiftReg & 0x00000001) { @@ -5244,11 +5244,11 @@ UCHAR RandomByte(IN PRTMP_ADAPTER pAd) ======================================================================== */ -VOID RTMPCheckRates(IN PRTMP_ADAPTER pAd, - IN OUT UCHAR SupRate[], IN OUT UCHAR * SupRateLen) +void RTMPCheckRates(IN PRTMP_ADAPTER pAd, + IN u8 SupRate[], IN u8 * SupRateLen) { - UCHAR RateIdx, i, j; - UCHAR NewRate[12], NewRateLen; + u8 RateIdx, i, j; + u8 NewRate[12], NewRateLen; NewRateLen = 0; @@ -5268,11 +5268,11 @@ VOID RTMPCheckRates(IN PRTMP_ADAPTER pAd, } BOOLEAN RTMPCheckChannel(IN PRTMP_ADAPTER pAd, - IN UCHAR CentralChannel, IN UCHAR Channel) + u8 CentralChannel, u8 Channel) { - UCHAR k; - UCHAR UpperChannel = 0, LowerChannel = 0; - UCHAR NoEffectChannelinList = 0; + u8 k; + u8 UpperChannel = 0, LowerChannel = 0; + u8 NoEffectChannelinList = 0; /* Find upper and lower channel according to 40MHz current operation. */ if (CentralChannel < Channel) { @@ -5321,7 +5321,7 @@ BOOLEAN RTMPCheckChannel(IN PRTMP_ADAPTER pAd, ======================================================================== */ BOOLEAN RTMPCheckHt(IN PRTMP_ADAPTER pAd, - IN UCHAR Wcid, + u8 Wcid, IN HT_CAPABILITY_IE * pHtCapability, IN ADD_HT_INFO_IE * pAddHtInfo) { @@ -5449,11 +5449,11 @@ BOOLEAN RTMPCheckHt(IN PRTMP_ADAPTER pAd, ======================================================================== */ -VOID RTMPUpdateMlmeRate(IN PRTMP_ADAPTER pAd) +void RTMPUpdateMlmeRate(IN PRTMP_ADAPTER pAd) { - UCHAR MinimumRate; - UCHAR ProperMlmeRate; /*= RATE_54; */ - UCHAR i, j, RateIdx = 12; /*1, 2, 5.5, 11, 6, 9, 12, 18, 24, 36, 48, 54 */ + u8 MinimumRate; + u8 ProperMlmeRate; /*= RATE_54; */ + u8 i, j, RateIdx = 12; /*1, 2, 5.5, 11, 6, 9, 12, 18, 24, 36, 48, 54 */ BOOLEAN bMatch = FALSE; switch (pAd->CommonCfg.PhyMode) { @@ -5558,10 +5558,10 @@ VOID RTMPUpdateMlmeRate(IN PRTMP_ADAPTER pAd) pAd->CommonCfg.MlmeTransmit.word)); } -CHAR RTMPMaxRssi(IN PRTMP_ADAPTER pAd, - IN CHAR Rssi0, IN CHAR Rssi1, IN CHAR Rssi2) +char RTMPMaxRssi(IN PRTMP_ADAPTER pAd, + char Rssi0, char Rssi1, char Rssi2) { - CHAR larger = -127; + char larger = -127; if ((pAd->Antenna.field.RxPath == 1) && (Rssi0 != 0)) { larger = Rssi0; @@ -5594,9 +5594,9 @@ CHAR RTMPMaxRssi(IN PRTMP_ADAPTER pAd, ======================================================================== */ -VOID AsicEvaluateRxAnt(IN PRTMP_ADAPTER pAd) +void AsicEvaluateRxAnt(IN PRTMP_ADAPTER pAd) { - UCHAR BBPR3 = 0; + u8 BBPR3 = 0; if (RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_RESET_IN_PROGRESS | fRTMP_ADAPTER_HALT_IN_PROGRESS | @@ -5638,7 +5638,7 @@ VOID AsicEvaluateRxAnt(IN PRTMP_ADAPTER pAd) if (OPSTATUS_TEST_FLAG (pAd, fOP_STATUS_MEDIA_STATE_CONNECTED) ) { - ULONG TxTotalCnt = + unsigned long TxTotalCnt = pAd->RalinkCounters.OneSecTxNoRetryOkCount + pAd->RalinkCounters.OneSecTxRetryOkCount + pAd->RalinkCounters.OneSecTxFailCount; @@ -5673,13 +5673,13 @@ VOID AsicEvaluateRxAnt(IN PRTMP_ADAPTER pAd) ======================================================================== */ -VOID AsicRxAntEvalTimeout(IN PVOID SystemSpecific1, - IN PVOID FunctionContext, - IN PVOID SystemSpecific2, IN PVOID SystemSpecific3) +void AsicRxAntEvalTimeout(void *SystemSpecific1, + void *FunctionContext, + void *SystemSpecific2, void *SystemSpecific3) { RTMP_ADAPTER *pAd = (RTMP_ADAPTER *) FunctionContext; - UCHAR BBPR3 = 0; - CHAR larger = -127, rssi0, rssi1, rssi2; + u8 BBPR3 = 0; + char larger = -127, rssi0, rssi1, rssi2; if (RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_RESET_IN_PROGRESS | fRTMP_ADAPTER_HALT_IN_PROGRESS | @@ -5745,9 +5745,9 @@ VOID AsicRxAntEvalTimeout(IN PVOID SystemSpecific1, } -VOID APSDPeriodicExec(IN PVOID SystemSpecific1, - IN PVOID FunctionContext, - IN PVOID SystemSpecific2, IN PVOID SystemSpecific3) +void APSDPeriodicExec(void *SystemSpecific1, + void *FunctionContext, + void *SystemSpecific2, void *SystemSpecific3) { RTMP_ADAPTER *pAd = (RTMP_ADAPTER *) FunctionContext; @@ -5784,7 +5784,7 @@ VOID APSDPeriodicExec(IN PVOID SystemSpecific1, ======================================================================== */ -VOID RTMPSetPiggyBack(IN PRTMP_ADAPTER pAd, IN BOOLEAN bPiggyBack) +void RTMPSetPiggyBack(IN PRTMP_ADAPTER pAd, IN BOOLEAN bPiggyBack) { TX_LINK_CFG_STRUC TxLinkCfg; @@ -5850,13 +5850,13 @@ BOOLEAN RTMPAutoRateSwitchCheck(IN PRTMP_ADAPTER pAd) ======================================================================== */ -UCHAR RTMPStaFixedTxMode(IN PRTMP_ADAPTER pAd, IN PMAC_TABLE_ENTRY pEntry) +u8 RTMPStaFixedTxMode(IN PRTMP_ADAPTER pAd, IN PMAC_TABLE_ENTRY pEntry) { - UCHAR tx_mode = FIXED_TXMODE_HT; + u8 tx_mode = FIXED_TXMODE_HT; { tx_mode = - (UCHAR) pAd->StaCfg.DesiredTransmitSetting.field. + (u8)pAd->StaCfg.DesiredTransmitSetting.field. FixedTxMode; } @@ -5878,7 +5878,7 @@ UCHAR RTMPStaFixedTxMode(IN PRTMP_ADAPTER pAd, IN PMAC_TABLE_ENTRY pEntry) ======================================================================== */ -VOID RTMPUpdateLegacyTxSetting(UCHAR fixed_tx_mode, PMAC_TABLE_ENTRY pEntry) +void RTMPUpdateLegacyTxSetting(u8 fixed_tx_mode, PMAC_TABLE_ENTRY pEntry) { HTTRANSMIT_SETTING TransmitSetting; @@ -5921,10 +5921,10 @@ VOID RTMPUpdateLegacyTxSetting(UCHAR fixed_tx_mode, PMAC_TABLE_ENTRY pEntry) ========================================================================== */ -VOID AsicStaBbpTuning(IN PRTMP_ADAPTER pAd) +void AsicStaBbpTuning(IN PRTMP_ADAPTER pAd) { - UCHAR OrigR66Value = 0, R66; /*, R66UpperBound = 0x30, R66LowerBound = 0x30; */ - CHAR Rssi; + u8 OrigR66Value = 0, R66; /*, R66UpperBound = 0x30, R66LowerBound = 0x30; */ + char Rssi; /* 2860C did not support Fase CCA, therefore can't tune */ if (pAd->MACVersion == 0x28600100) @@ -6033,9 +6033,9 @@ VOID AsicStaBbpTuning(IN PRTMP_ADAPTER pAd) } } -VOID RTMPSetAGCInitValue(IN PRTMP_ADAPTER pAd, IN UCHAR BandWidth) +void RTMPSetAGCInitValue(IN PRTMP_ADAPTER pAd, u8 BandWidth) { - UCHAR R66 = 0x30; + u8 R66 = 0x30; if (pAd->LatchRfRegs.Channel <= 14) { /* BG band */ #ifdef RT30xx @@ -6055,12 +6055,12 @@ VOID RTMPSetAGCInitValue(IN PRTMP_ADAPTER pAd, IN UCHAR BandWidth) { if (BandWidth == BW_20) { R66 = - (UCHAR) (0x32 + + (u8)(0x32 + (GET_LNA_GAIN(pAd) * 5) / 3); RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R66, R66); } else { R66 = - (UCHAR) (0x3A + + (u8)(0x3A + (GET_LNA_GAIN(pAd) * 5) / 3); RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R66, R66); } diff --git a/drivers/staging/rt2860/common/rt_channel.c b/drivers/staging/rt2860/common/rt_channel.c index 0af7e6b0a4c..3fe5d9762b2 100644 --- a/drivers/staging/rt2860/common/rt_channel.c +++ b/drivers/staging/rt2860/common/rt_channel.c @@ -144,7 +144,7 @@ CH_FREQ_MAP CH_HZ_ID_MAP[] = { , /* Japan, means J16 */ }; -INT CH_HZ_ID_MAP_NUM = (sizeof(CH_HZ_ID_MAP) / sizeof(CH_FREQ_MAP)); +int CH_HZ_ID_MAP_NUM = (sizeof(CH_HZ_ID_MAP) / sizeof(CH_FREQ_MAP)); CH_REGION ChRegion[] = { { /* Antigua and Berbuda */ @@ -1422,14 +1422,14 @@ CH_REGION ChRegion[] = { , }; -static PCH_REGION GetChRegion(IN PUCHAR CntryCode) +static PCH_REGION GetChRegion(u8 *CntryCode) { - INT loop = 0; + int loop = 0; PCH_REGION pChRegion = NULL; - while (strcmp((PSTRING) ChRegion[loop].CountReg, "") != 0) { + while (strcmp((char *)ChRegion[loop].CountReg, "") != 0) { if (strncmp - ((PSTRING) ChRegion[loop].CountReg, (PSTRING) CntryCode, + ((char *)ChRegion[loop].CountReg, (char *)CntryCode, 2) == 0) { pChRegion = &ChRegion[loop]; break; @@ -1442,7 +1442,7 @@ static PCH_REGION GetChRegion(IN PUCHAR CntryCode) return pChRegion; } -static VOID ChBandCheck(IN UCHAR PhyMode, OUT PUCHAR pChType) +static void ChBandCheck(u8 PhyMode, u8 *pChType) { switch (PhyMode) { case PHY_11A: @@ -1461,12 +1461,12 @@ static VOID ChBandCheck(IN UCHAR PhyMode, OUT PUCHAR pChType) } } -static UCHAR FillChList(IN PRTMP_ADAPTER pAd, +static u8 FillChList(IN PRTMP_ADAPTER pAd, IN PCH_DESP pChDesp, - IN UCHAR Offset, IN UCHAR increment) + u8 Offset, u8 increment) { - INT i, j, l; - UCHAR channel; + int i, j, l; + u8 channel; j = Offset; for (i = 0; i < pChDesp->NumOfCh; i++) { @@ -1494,14 +1494,14 @@ static UCHAR FillChList(IN PRTMP_ADAPTER pAd, return j; } -static inline VOID CreateChList(IN PRTMP_ADAPTER pAd, - IN PCH_REGION pChRegion, IN UCHAR Geography) +static inline void CreateChList(IN PRTMP_ADAPTER pAd, + IN PCH_REGION pChRegion, u8 Geography) { - INT i; - UCHAR offset = 0; + int i; + u8 offset = 0; PCH_DESP pChDesp; - UCHAR ChType; - UCHAR increment; + u8 ChType; + u8 increment; if (pChRegion == NULL) return; @@ -1532,7 +1532,7 @@ static inline VOID CreateChList(IN PRTMP_ADAPTER pAd, } } -VOID BuildChannelListEx(IN PRTMP_ADAPTER pAd) +void BuildChannelListEx(IN PRTMP_ADAPTER pAd) { PCH_REGION pChReg; @@ -1540,14 +1540,14 @@ VOID BuildChannelListEx(IN PRTMP_ADAPTER pAd) CreateChList(pAd, pChReg, pAd->CommonCfg.Geography); } -VOID BuildBeaconChList(IN PRTMP_ADAPTER pAd, - OUT PUCHAR pBuf, OUT PULONG pBufLen) +void BuildBeaconChList(IN PRTMP_ADAPTER pAd, + u8 *pBuf, unsigned long *pBufLen) { - INT i; - ULONG TmpLen; + int i; + unsigned long TmpLen; PCH_REGION pChRegion; PCH_DESP pChDesp; - UCHAR ChType; + u8 ChType; pChRegion = GetChRegion(pAd->CommonCfg.CountryCode); @@ -1581,9 +1581,9 @@ VOID BuildBeaconChList(IN PRTMP_ADAPTER pAd, } } -static BOOLEAN IsValidChannel(IN PRTMP_ADAPTER pAd, IN UCHAR channel) +static BOOLEAN IsValidChannel(IN PRTMP_ADAPTER pAd, u8 channel) { - INT i; + int i; for (i = 0; i < pAd->ChannelListNum; i++) { if (pAd->ChannelList[i].Channel == channel) @@ -1596,9 +1596,9 @@ static BOOLEAN IsValidChannel(IN PRTMP_ADAPTER pAd, IN UCHAR channel) return TRUE; } -static UCHAR GetExtCh(IN UCHAR Channel, IN UCHAR Direction) +static u8 GetExtCh(u8 Channel, u8 Direction) { - CHAR ExtCh; + char ExtCh; if (Direction == EXTCHA_ABOVE) ExtCh = Channel + 4; @@ -1608,10 +1608,10 @@ static UCHAR GetExtCh(IN UCHAR Channel, IN UCHAR Direction) return ExtCh; } -VOID N_ChannelCheck(IN PRTMP_ADAPTER pAd) +void N_ChannelCheck(IN PRTMP_ADAPTER pAd) { - /*UCHAR ChannelNum = pAd->ChannelListNum; */ - UCHAR Channel = pAd->CommonCfg.Channel; + /*u8 ChannelNum = pAd->ChannelListNum; */ + u8 Channel = pAd->CommonCfg.Channel; if ((pAd->CommonCfg.PhyMode >= PHY_11ABGN_MIXED) && (pAd->CommonCfg.RegTransmitSetting.field.BW == BW_40)) { @@ -1638,8 +1638,8 @@ VOID N_ChannelCheck(IN PRTMP_ADAPTER pAd) } } else { do { - UCHAR ExtCh; - UCHAR Dir = + u8 ExtCh; + u8 Dir = pAd->CommonCfg.RegTransmitSetting.field. EXTCHA; ExtCh = GetExtCh(Channel, Dir); @@ -1670,7 +1670,7 @@ VOID N_ChannelCheck(IN PRTMP_ADAPTER pAd) } -VOID N_SetCenCh(IN PRTMP_ADAPTER pAd) +void N_SetCenCh(IN PRTMP_ADAPTER pAd) { if (pAd->CommonCfg.RegTransmitSetting.field.BW == BW_40) { if (pAd->CommonCfg.RegTransmitSetting.field.EXTCHA == @@ -1690,7 +1690,7 @@ VOID N_SetCenCh(IN PRTMP_ADAPTER pAd) } } -UINT8 GetCuntryMaxTxPwr(IN PRTMP_ADAPTER pAd, IN UINT8 channel) +u8 GetCuntryMaxTxPwr(IN PRTMP_ADAPTER pAd, u8 channel) { int i; for (i = 0; i < pAd->ChannelListNum; i++) { diff --git a/drivers/staging/rt2860/common/rt_rf.c b/drivers/staging/rt2860/common/rt_rf.c index 8b5be1766fb..6d6ca32691f 100644 --- a/drivers/staging/rt2860/common/rt_rf.c +++ b/drivers/staging/rt2860/common/rt_rf.c @@ -53,11 +53,11 @@ ======================================================================== */ -NDIS_STATUS RT30xxWriteRFRegister(IN PRTMP_ADAPTER pAd, - IN UCHAR regID, IN UCHAR value) +int RT30xxWriteRFRegister(IN PRTMP_ADAPTER pAd, + u8 regID, u8 value) { RF_CSR_CFG_STRUC rfcsr; - UINT i = 0; + u32 i = 0; do { RTMP_IO_READ32(pAd, RF_CSR_CFG, &rfcsr.word); @@ -101,11 +101,11 @@ NDIS_STATUS RT30xxWriteRFRegister(IN PRTMP_ADAPTER pAd, ======================================================================== */ -NDIS_STATUS RT30xxReadRFRegister(IN PRTMP_ADAPTER pAd, - IN UCHAR regID, IN PUCHAR pValue) +int RT30xxReadRFRegister(IN PRTMP_ADAPTER pAd, + u8 regID, u8 *pValue) { RF_CSR_CFG_STRUC rfcsr; - UINT i = 0, k = 0; + u32 i = 0, k = 0; for (i = 0; i < MAX_BUSY_COUNT; i++) { RTMP_IO_READ32(pAd, RF_CSR_CFG, &rfcsr.word); @@ -126,7 +126,7 @@ NDIS_STATUS RT30xxReadRFRegister(IN PRTMP_ADAPTER pAd, } if ((rfcsr.field.RF_CSR_KICK == IDLE) && (rfcsr.field.TESTCSR_RFACC_REGNUM == regID)) { - *pValue = (UCHAR) rfcsr.field.RF_CSR_DATA; + *pValue = (u8)rfcsr.field.RF_CSR_DATA; break; } } @@ -139,13 +139,13 @@ NDIS_STATUS RT30xxReadRFRegister(IN PRTMP_ADAPTER pAd, return STATUS_SUCCESS; } -VOID NICInitRFRegisters(IN RTMP_ADAPTER * pAd) +void NICInitRFRegisters(IN RTMP_ADAPTER * pAd) { if (pAd->chipOps.AsicRfInit) pAd->chipOps.AsicRfInit(pAd); } -VOID RtmpChipOpsRFHook(IN RTMP_ADAPTER * pAd) +void RtmpChipOpsRFHook(IN RTMP_ADAPTER * pAd) { RTMP_CHIP_OP *pChipOps = &pAd->chipOps; diff --git a/drivers/staging/rt2860/common/rtmp_init.c b/drivers/staging/rt2860/common/rtmp_init.c index 0a958704e5a..5735dd7c182 100644 --- a/drivers/staging/rt2860/common/rtmp_init.c +++ b/drivers/staging/rt2860/common/rtmp_init.c @@ -36,7 +36,7 @@ */ #include "../rt_config.h" -UCHAR BIT8[] = { 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80 }; +u8 BIT8[] = { 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80 }; char *CipherName[] = { "none", "wep64", "wep128", "TKIP", "AES", "CKIP64", "CKIP128" }; @@ -152,13 +152,13 @@ RTMP_REG_PAIR STAMACRegTable[] = { ======================================================================== */ -NDIS_STATUS RTMPAllocAdapterBlock(IN PVOID handle, +int RTMPAllocAdapterBlock(void *handle, OUT PRTMP_ADAPTER * ppAdapter) { PRTMP_ADAPTER pAd; - NDIS_STATUS Status; - INT index; - UCHAR *pBeaconBuf = NULL; + int Status; + int index; + u8 *pBeaconBuf = NULL; DBGPRINT(RT_DEBUG_TRACE, ("--> RTMPAllocAdapterBlock\n")); @@ -174,7 +174,7 @@ NDIS_STATUS RTMPAllocAdapterBlock(IN PVOID handle, } NdisZeroMemory(pBeaconBuf, MAX_BEACON_SIZE); - Status = AdapterBlockAllocateMemory(handle, (PVOID *) & pAd); + Status = AdapterBlockAllocateMemory(handle, (void **) & pAd); if (Status != NDIS_STATUS_SUCCESS) { DBGPRINT_ERR(("Failed to allocate memory - ADAPTER\n")); break; @@ -182,7 +182,7 @@ NDIS_STATUS RTMPAllocAdapterBlock(IN PVOID handle, pAd->BeaconBuf = pBeaconBuf; DBGPRINT(RT_DEBUG_OFF, ("\n\n=== pAd = %p, size = %d ===\n\n", pAd, - (UINT32) sizeof(RTMP_ADAPTER))); + (u32)sizeof(RTMP_ADAPTER))); /* Init spin locks */ NdisAllocateSpinLock(&pAd->MgmtRingLock); @@ -230,12 +230,12 @@ NDIS_STATUS RTMPAllocAdapterBlock(IN PVOID handle, ======================================================================== */ -VOID RTMPReadTxPwrPerRate(IN PRTMP_ADAPTER pAd) +void RTMPReadTxPwrPerRate(IN PRTMP_ADAPTER pAd) { - ULONG data, Adata, Gdata; - USHORT i, value, value2; - INT Apwrdelta, Gpwrdelta; - UCHAR t1, t2, t3, t4; + unsigned long data, Adata, Gdata; + u16 i, value, value2; + int Apwrdelta, Gpwrdelta; + u8 t1, t2, t3, t4; BOOLEAN bApwrdeltaMinus = TRUE, bGpwrdeltaMinus = TRUE; /* */ @@ -441,9 +441,9 @@ VOID RTMPReadTxPwrPerRate(IN PRTMP_ADAPTER pAd) ======================================================================== */ -VOID RTMPReadChannelPwr(IN PRTMP_ADAPTER pAd) +void RTMPReadChannelPwr(IN PRTMP_ADAPTER pAd) { - UCHAR i, choffset; + u8 i, choffset; EEPROM_TX_PWR_STRUC Power; EEPROM_TX_PWR_STRUC Power2; @@ -650,10 +650,10 @@ VOID RTMPReadChannelPwr(IN PRTMP_ADAPTER pAd) ======================================================================== */ -NDIS_STATUS NICReadRegParameters(IN PRTMP_ADAPTER pAd, +int NICReadRegParameters(IN PRTMP_ADAPTER pAd, IN NDIS_HANDLE WrapperConfigurationContext) { - NDIS_STATUS Status = NDIS_STATUS_SUCCESS; + int Status = NDIS_STATUS_SUCCESS; DBGPRINT_S(Status, ("<-- NICReadRegParameters, Status=%x\n", Status)); return Status; } @@ -676,11 +676,11 @@ NDIS_STATUS NICReadRegParameters(IN PRTMP_ADAPTER pAd, ======================================================================== */ -VOID NICReadEEPROMParameters(IN PRTMP_ADAPTER pAd, IN PUCHAR mac_addr) +void NICReadEEPROMParameters(IN PRTMP_ADAPTER pAd, u8 *mac_addr) { - UINT32 data = 0; - USHORT i, value, value2; - UCHAR TmpPhy; + u32 data = 0; + u16 i, value, value2; + u8 TmpPhy; EEPROM_TX_PWR_STRUC Power; EEPROM_VERSION_STRUC Version; EEPROM_ANTENNA_STRUC Antenna; @@ -707,29 +707,29 @@ VOID NICReadEEPROMParameters(IN PRTMP_ADAPTER pAd, IN PUCHAR mac_addr) /* RT2860 MAC no longer auto load MAC address from E2PROM. Driver has to intialize */ /* MAC address registers according to E2PROM setting */ if (mac_addr == NULL || - strlen((PSTRING) mac_addr) != 17 || + strlen((char *)mac_addr) != 17 || mac_addr[2] != ':' || mac_addr[5] != ':' || mac_addr[8] != ':' || mac_addr[11] != ':' || mac_addr[14] != ':') { - USHORT Addr01, Addr23, Addr45; + u16 Addr01, Addr23, Addr45; RT28xx_EEPROM_READ16(pAd, 0x04, Addr01); RT28xx_EEPROM_READ16(pAd, 0x06, Addr23); RT28xx_EEPROM_READ16(pAd, 0x08, Addr45); - pAd->PermanentAddress[0] = (UCHAR) (Addr01 & 0xff); - pAd->PermanentAddress[1] = (UCHAR) (Addr01 >> 8); - pAd->PermanentAddress[2] = (UCHAR) (Addr23 & 0xff); - pAd->PermanentAddress[3] = (UCHAR) (Addr23 >> 8); - pAd->PermanentAddress[4] = (UCHAR) (Addr45 & 0xff); - pAd->PermanentAddress[5] = (UCHAR) (Addr45 >> 8); + pAd->PermanentAddress[0] = (u8)(Addr01 & 0xff); + pAd->PermanentAddress[1] = (u8)(Addr01 >> 8); + pAd->PermanentAddress[2] = (u8)(Addr23 & 0xff); + pAd->PermanentAddress[3] = (u8)(Addr23 >> 8); + pAd->PermanentAddress[4] = (u8)(Addr45 & 0xff); + pAd->PermanentAddress[5] = (u8)(Addr45 >> 8); DBGPRINT(RT_DEBUG_TRACE, ("Initialize MAC Address from E2PROM \n")); } else { - INT j; - PSTRING macptr; + int j; + char *macptr; - macptr = (PSTRING) mac_addr; + macptr = (char *)mac_addr; for (j = 0; j < MAC_ADDR_LEN; j++) { AtoH(macptr, &pAd->PermanentAddress[j], 1); @@ -898,15 +898,15 @@ VOID NICReadEEPROMParameters(IN PRTMP_ADAPTER pAd, IN PUCHAR mac_addr) pAd->Antenna.word = Antenna.word; /* Set the RfICType here, then we can initialize RFIC related operation callbacks */ - pAd->Mlme.RealRxPath = (UCHAR) Antenna.field.RxPath; - pAd->RfIcType = (UCHAR) Antenna.field.RfIcType; + pAd->Mlme.RealRxPath = (u8)Antenna.field.RxPath; + pAd->RfIcType = (u8)Antenna.field.RfIcType; #ifdef RTMP_RF_RW_SUPPORT RtmpChipOpsRFHook(pAd); #endif /* RTMP_RF_RW_SUPPORT // */ #ifdef RTMP_MAC_PCI - sprintf((PSTRING) pAd->nickname, "RT2860STA"); + sprintf((char *)pAd->nickname, "RT2860STA"); #endif /* RTMP_MAC_PCI // */ /* */ @@ -1005,7 +1005,7 @@ VOID NICReadEEPROMParameters(IN PRTMP_ADAPTER pAd, IN PUCHAR mac_addr) /* Read frequency offset setting for RF */ RT28xx_EEPROM_READ16(pAd, EEPROM_FREQ_OFFSET, value); if ((value & 0x00FF) != 0x00FF) - pAd->RfFreqOffset = (ULONG) (value & 0x00FF); + pAd->RfFreqOffset = (unsigned long)(value & 0x00FF); else pAd->RfFreqOffset = 0; DBGPRINT(RT_DEBUG_TRACE, @@ -1017,8 +1017,8 @@ VOID NICReadEEPROMParameters(IN PRTMP_ADAPTER pAd, IN PUCHAR mac_addr) if ((value <= REGION_MAXIMUM_BG_BAND) && (value2 <= REGION_MAXIMUM_A_BAND)) { - pAd->CommonCfg.CountryRegion = ((UCHAR) value) | 0x80; - pAd->CommonCfg.CountryRegionForABand = ((UCHAR) value2) | 0x80; + pAd->CommonCfg.CountryRegion = ((u8)value) | 0x80; + pAd->CommonCfg.CountryRegionForABand = ((u8)value2) | 0x80; TmpPhy = pAd->CommonCfg.PhyMode; pAd->CommonCfg.PhyMode = 0xff; RTMPSetPhyMode(pAd, TmpPhy); @@ -1057,9 +1057,9 @@ VOID NICReadEEPROMParameters(IN PRTMP_ADAPTER pAd, IN PUCHAR mac_addr) pAd->ARssiOffset2 = value & 0x00ff; pAd->ALNAGain2 = (value >> 8); - if (((UCHAR) pAd->ALNAGain1 == 0xFF) || (pAd->ALNAGain1 == 0x00)) + if (((u8)pAd->ALNAGain1 == 0xFF) || (pAd->ALNAGain1 == 0x00)) pAd->ALNAGain1 = pAd->ALNAGain0; - if (((UCHAR) pAd->ALNAGain2 == 0xFF) || (pAd->ALNAGain2 == 0x00)) + if (((u8)pAd->ALNAGain2 == 0xFF) || (pAd->ALNAGain2 == 0x00)) pAd->ALNAGain2 = pAd->ALNAGain0; /* Validate 11a RSSI_0 offset. */ @@ -1087,7 +1087,7 @@ VOID NICReadEEPROMParameters(IN PRTMP_ADAPTER pAd, IN PUCHAR mac_addr) value &= 0x00ff; if (value != 0xff) { value &= 0x07; - pAd->TxMixerGain24G = (UCHAR) value; + pAd->TxMixerGain24G = (u8)value; } } #endif /* RT30xx // */ @@ -1133,23 +1133,23 @@ VOID NICReadEEPROMParameters(IN PRTMP_ADAPTER pAd, IN PUCHAR mac_addr) ======================================================================== */ -VOID NICInitAsicFromEEPROM(IN PRTMP_ADAPTER pAd) +void NICInitAsicFromEEPROM(IN PRTMP_ADAPTER pAd) { - UINT32 data = 0; - UCHAR BBPR1 = 0; - USHORT i; + u32 data = 0; + u8 BBPR1 = 0; + u16 i; /* EEPROM_ANTENNA_STRUC Antenna; */ EEPROM_NIC_CONFIG2_STRUC NicConfig2; - UCHAR BBPR3 = 0; + u8 BBPR3 = 0; DBGPRINT(RT_DEBUG_TRACE, ("--> NICInitAsicFromEEPROM\n")); for (i = 3; i < NUM_EEPROM_BBP_PARMS; i++) { - UCHAR BbpRegIdx, BbpValue; + u8 BbpRegIdx, BbpValue; if ((pAd->EEPROMDefaultValue[i] != 0xFFFF) && (pAd->EEPROMDefaultValue[i] != 0)) { - BbpRegIdx = (UCHAR) (pAd->EEPROMDefaultValue[i] >> 8); - BbpValue = (UCHAR) (pAd->EEPROMDefaultValue[i] & 0xff); + BbpRegIdx = (u8)(pAd->EEPROMDefaultValue[i] >> 8); + BbpValue = (u8)(pAd->EEPROMDefaultValue[i] & 0xff); RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BbpRegIdx, BbpValue); } } @@ -1191,12 +1191,12 @@ VOID NICInitAsicFromEEPROM(IN PRTMP_ADAPTER pAd) #endif /* RTMP_MAC_USB // */ } - AsicSendCommandToMcu(pAd, 0x52, 0xff, (UCHAR) pAd->Led1, - (UCHAR) (pAd->Led1 >> 8)); - AsicSendCommandToMcu(pAd, 0x53, 0xff, (UCHAR) pAd->Led2, - (UCHAR) (pAd->Led2 >> 8)); - AsicSendCommandToMcu(pAd, 0x54, 0xff, (UCHAR) pAd->Led3, - (UCHAR) (pAd->Led3 >> 8)); + AsicSendCommandToMcu(pAd, 0x52, 0xff, (u8)pAd->Led1, + (u8)(pAd->Led1 >> 8)); + AsicSendCommandToMcu(pAd, 0x53, 0xff, (u8)pAd->Led2, + (u8)(pAd->Led2 >> 8)); + AsicSendCommandToMcu(pAd, 0x54, 0xff, (u8)pAd->Led3, + (u8)(pAd->Led3 >> 8)); AsicSendCommandToMcu(pAd, 0x51, 0xff, 0, pAd->LedCntl.field.Polarity); pAd->LedIndicatorStrength = 0xFF; @@ -1306,16 +1306,16 @@ VOID NICInitAsicFromEEPROM(IN PRTMP_ADAPTER pAd) /* update registers from EEPROM for RT3071 or later(3572/3592). */ if (IS_RT3090(pAd) || IS_RT3572(pAd) || IS_RT3390(pAd)) { - UCHAR RegIdx, RegValue; - USHORT value; + u8 RegIdx, RegValue; + u16 value; /* after RT3071, write BBP from EEPROM 0xF0 to 0x102 */ for (i = 0xF0; i <= 0x102; i = i + 2) { value = 0xFFFF; RT28xx_EEPROM_READ16(pAd, i, value); if ((value != 0xFFFF) && (value != 0)) { - RegIdx = (UCHAR) (value >> 8); - RegValue = (UCHAR) (value & 0xff); + RegIdx = (u8)(value >> 8); + RegValue = (u8)(value & 0xff); RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, RegIdx, RegValue); DBGPRINT(RT_DEBUG_TRACE, @@ -1329,8 +1329,8 @@ VOID NICInitAsicFromEEPROM(IN PRTMP_ADAPTER pAd) value = 0xFFFF; RT28xx_EEPROM_READ16(pAd, i, value); if ((value != 0xFFFF) && (value != 0)) { - RegIdx = (UCHAR) (value >> 8); - RegValue = (UCHAR) (value & 0xff); + RegIdx = (u8)(value >> 8); + RegValue = (u8)(value & 0xff); RT30xxWriteRFRegister(pAd, RegIdx, RegValue); DBGPRINT(RT_DEBUG_TRACE, ("Update RF Registers from EEPROM0x%x), BBP(0x%x) = 0x%x\n", @@ -1366,16 +1366,16 @@ VOID NICInitAsicFromEEPROM(IN PRTMP_ADAPTER pAd) ======================================================================== */ -NDIS_STATUS NICInitializeAdapter(IN PRTMP_ADAPTER pAd, IN BOOLEAN bHardReset) +int NICInitializeAdapter(IN PRTMP_ADAPTER pAd, IN BOOLEAN bHardReset) { - NDIS_STATUS Status = NDIS_STATUS_SUCCESS; + int Status = NDIS_STATUS_SUCCESS; WPDMA_GLO_CFG_STRUC GloCfg; #ifdef RTMP_MAC_PCI - UINT32 Value; + u32 Value; DELAY_INT_CFG_STRUC IntCfg; #endif /* RTMP_MAC_PCI // */ /* INT_MASK_CSR_STRUC IntMask; */ - ULONG i = 0, j = 0; + unsigned long i = 0, j = 0; AC_TXOP_CSR0_STRUC csr0; DBGPRINT(RT_DEBUG_TRACE, ("--> NICInitializeAdapter\n")); @@ -1562,22 +1562,22 @@ retry: ======================================================================== */ -NDIS_STATUS NICInitializeAsic(IN PRTMP_ADAPTER pAd, IN BOOLEAN bHardReset) +int NICInitializeAsic(IN PRTMP_ADAPTER pAd, IN BOOLEAN bHardReset) { - ULONG Index = 0; - UCHAR R0 = 0xff; - UINT32 MacCsr12 = 0, Counter = 0; + unsigned long Index = 0; + u8 R0 = 0xff; + u32 MacCsr12 = 0, Counter = 0; #ifdef RTMP_MAC_USB - UINT32 MacCsr0 = 0; - NTSTATUS Status; - UCHAR Value = 0xff; + u32 MacCsr0 = 0; + int Status; + u8 Value = 0xff; #endif /* RTMP_MAC_USB // */ #ifdef RT30xx - UCHAR bbpreg = 0; - UCHAR RFValue = 0; + u8 bbpreg = 0; + u8 RFValue = 0; #endif /* RT30xx // */ - USHORT KeyIdx; - INT i, apidx; + u16 KeyIdx; + int i, apidx; DBGPRINT(RT_DEBUG_TRACE, ("--> NICInitializeAsic\n")); @@ -1642,14 +1642,14 @@ NDIS_STATUS NICInitializeAsic(IN PRTMP_ADAPTER pAd, IN BOOLEAN bHardReset) MACRegTable[Index].Value = 0x00000400; } #endif /* RT30xx // */ - RTMP_IO_WRITE32(pAd, (USHORT) MACRegTable[Index].Register, + RTMP_IO_WRITE32(pAd, (u16)MACRegTable[Index].Register, MACRegTable[Index].Value); } { for (Index = 0; Index < NUM_STA_MAC_REG_PARMS; Index++) { RTMP_IO_WRITE32(pAd, - (USHORT) STAMACRegTable[Index].Register, + (u16)STAMACRegTable[Index].Register, STAMACRegTable[Index].Value); } } @@ -1726,8 +1726,8 @@ NDIS_STATUS NICInitializeAsic(IN PRTMP_ADAPTER pAd, IN BOOLEAN bHardReset) #ifdef RTMP_MAC_PCI /* TODO: shiang, check MACVersion, currently, rbus-based chip use this. */ if (pAd->MACVersion == 0x28720200) { - /*UCHAR value; */ - ULONG value2; + /*u8 value; */ + unsigned long value2; /*disable MLD by Bruce 20080704 */ /*BBP_IO_READ8_BY_REG_ID(pAd, BBP_R105, &value); */ @@ -1816,7 +1816,7 @@ NDIS_STATUS NICInitializeAsic(IN PRTMP_ADAPTER pAd, IN BOOLEAN bHardReset) if (pAd->MACVersion >= RALINK_2880E_VERSION && pAd->MACVersion < RALINK_3070_VERSION) /* 3*3 */ { /* enlarge MAX_LEN_CFG */ - UINT32 csr; + u32 csr; RTMP_IO_READ32(pAd, MAX_LEN_CFG, &csr); csr &= 0xFFF; csr |= 0x2000; @@ -1824,14 +1824,14 @@ NDIS_STATUS NICInitializeAsic(IN PRTMP_ADAPTER pAd, IN BOOLEAN bHardReset) } #ifdef RTMP_MAC_USB { - UCHAR MAC_Value[] = + u8 MAC_Value[] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0, 0 }; /*Initialize WCID table */ Value = 0xff; for (Index = 0; Index < 254; Index++) { RTUSBMultiWrite(pAd, - (USHORT) (MAC_WCID_BASE + Index * 8), + (u16)(MAC_WCID_BASE + Index * 8), MAC_Value, 8); } } @@ -1929,9 +1929,9 @@ NDIS_STATUS NICInitializeAsic(IN PRTMP_ADAPTER pAd, IN BOOLEAN bHardReset) ======================================================================== */ -VOID NICIssueReset(IN PRTMP_ADAPTER pAd) +void NICIssueReset(IN PRTMP_ADAPTER pAd) { - UINT32 Value = 0; + u32 Value = 0; DBGPRINT(RT_DEBUG_TRACE, ("--> NICIssueReset\n")); /* Abort Tx, prevent ASIC from writing to Host memory */ @@ -1970,14 +1970,14 @@ BOOLEAN NICCheckForHang(IN PRTMP_ADAPTER pAd) return (FALSE); } -VOID NICUpdateFifoStaCounters(IN PRTMP_ADAPTER pAd) +void NICUpdateFifoStaCounters(IN PRTMP_ADAPTER pAd) { TX_STA_FIFO_STRUC StaFifo; MAC_TABLE_ENTRY *pEntry; - UCHAR i = 0; - UCHAR pid = 0, wcid = 0; - CHAR reTry; - UCHAR succMCS; + u8 i = 0; + u8 pid = 0, wcid = 0; + char reTry; + u8 succMCS; do { RTMP_IO_READ32(pAd, TX_STA_FIFO, &StaFifo.word); @@ -1985,7 +1985,7 @@ VOID NICUpdateFifoStaCounters(IN PRTMP_ADAPTER pAd) if (StaFifo.field.bValid == 0) break; - wcid = (UCHAR) StaFifo.field.wcid; + wcid = (u8)StaFifo.field.wcid; /* ignore NoACK and MGMT frame use 0xFF as WCID */ if ((StaFifo.field.TxAckRequired == 0) @@ -1995,7 +1995,7 @@ VOID NICUpdateFifoStaCounters(IN PRTMP_ADAPTER pAd) } /* PID store Tx MCS Rate */ - pid = (UCHAR) StaFifo.field.PidType; + pid = (u8)StaFifo.field.PidType; pEntry = &pAd->MacTab.Content[wcid]; @@ -2094,11 +2094,11 @@ VOID NICUpdateFifoStaCounters(IN PRTMP_ADAPTER pAd) ======================================================================== */ -VOID NICUpdateRawCounters(IN PRTMP_ADAPTER pAd) +void NICUpdateRawCounters(IN PRTMP_ADAPTER pAd) { - UINT32 OldValue; /*, Value2; */ - /*ULONG PageSum, OneSecTransmitCount; */ - /*ULONG TxErrorRatio, Retry, Fail; */ + u32 OldValue; /*, Value2; */ + /*unsigned long PageSum, OneSecTransmitCount; */ + /*unsigned long TxErrorRatio, Retry, Fail; */ RX_STA_CNT0_STRUC RxStaCnt0; RX_STA_CNT1_STRUC RxStaCnt1; RX_STA_CNT2_STRUC RxStaCnt2; @@ -2299,7 +2299,7 @@ VOID NICUpdateRawCounters(IN PRTMP_ADAPTER pAd) ======================================================================== */ -VOID NICResetFromError(IN PRTMP_ADAPTER pAd) +void NICResetFromError(IN PRTMP_ADAPTER pAd) { /* Reset BBP (according to alex, reset ASIC will force reset BBP */ /* Therefore, skip the reset BBP */ @@ -2317,9 +2317,9 @@ VOID NICResetFromError(IN PRTMP_ADAPTER pAd) AsicLockChannel(pAd, pAd->CommonCfg.CentralChannel); } -NDIS_STATUS NICLoadFirmware(IN PRTMP_ADAPTER pAd) +int NICLoadFirmware(IN PRTMP_ADAPTER pAd) { - NDIS_STATUS status = NDIS_STATUS_SUCCESS; + int status = NDIS_STATUS_SUCCESS; if (pAd->chipOps.loadFirmware) status = pAd->chipOps.loadFirmware(pAd); @@ -2339,7 +2339,7 @@ NDIS_STATUS NICLoadFirmware(IN PRTMP_ADAPTER pAd) ======================================================================== */ -VOID NICEraseFirmware(IN PRTMP_ADAPTER pAd) +void NICEraseFirmware(IN PRTMP_ADAPTER pAd) { if (pAd->chipOps.eraseFirmware) pAd->chipOps.eraseFirmware(pAd); @@ -2367,7 +2367,7 @@ VOID NICEraseFirmware(IN PRTMP_ADAPTER pAd) ======================================================================== */ -NDIS_STATUS NICLoadRateSwitchingParams(IN PRTMP_ADAPTER pAd) +int NICLoadRateSwitchingParams(IN PRTMP_ADAPTER pAd) { return NDIS_STATUS_SUCCESS; } @@ -2393,14 +2393,14 @@ NDIS_STATUS NICLoadRateSwitchingParams(IN PRTMP_ADAPTER pAd) ======================================================================== */ -ULONG RTMPCompareMemory(IN PVOID pSrc1, IN PVOID pSrc2, IN ULONG Length) +unsigned long RTMPCompareMemory(void *pSrc1, void *pSrc2, unsigned long Length) { - PUCHAR pMem1; - PUCHAR pMem2; - ULONG Index = 0; + u8 *pMem1; + u8 *pMem2; + unsigned long Index = 0; - pMem1 = (PUCHAR) pSrc1; - pMem2 = (PUCHAR) pSrc2; + pMem1 = (u8 *)pSrc1; + pMem2 = (u8 *)pSrc2; for (Index = 0; Index < Length; Index++) { if (pMem1[Index] > pMem2[Index]) @@ -2433,12 +2433,12 @@ ULONG RTMPCompareMemory(IN PVOID pSrc1, IN PVOID pSrc2, IN ULONG Length) ======================================================================== */ -VOID RTMPZeroMemory(IN PVOID pSrc, IN ULONG Length) +void RTMPZeroMemory(void *pSrc, unsigned long Length) { - PUCHAR pMem; - ULONG Index = 0; + u8 *pMem; + unsigned long Index = 0; - pMem = (PUCHAR) pSrc; + pMem = (u8 *)pSrc; for (Index = 0; Index < Length; Index++) { pMem[Index] = 0x00; @@ -2466,16 +2466,16 @@ VOID RTMPZeroMemory(IN PVOID pSrc, IN ULONG Length) ======================================================================== */ -VOID RTMPMoveMemory(OUT PVOID pDest, IN PVOID pSrc, IN ULONG Length) +void RTMPMoveMemory(void *pDest, void *pSrc, unsigned long Length) { - PUCHAR pMem1; - PUCHAR pMem2; - UINT Index; + u8 *pMem1; + u8 *pMem2; + u32 Index; ASSERT((Length == 0) || (pDest && pSrc)); - pMem1 = (PUCHAR) pDest; - pMem2 = (PUCHAR) pSrc; + pMem1 = (u8 *)pDest; + pMem2 = (u8 *)pSrc; for (Index = 0; Index < Length; Index++) { pMem1[Index] = pMem2[Index]; @@ -2500,9 +2500,9 @@ VOID RTMPMoveMemory(OUT PVOID pDest, IN PVOID pSrc, IN ULONG Length) ======================================================================== */ -VOID UserCfgInit(IN PRTMP_ADAPTER pAd) +void UserCfgInit(IN PRTMP_ADAPTER pAd) { - UINT key_index, bss_index; + u32 key_index, bss_index; DBGPRINT(RT_DEBUG_TRACE, ("--> UserCfgInit\n")); @@ -2703,7 +2703,7 @@ VOID UserCfgInit(IN PRTMP_ADAPTER pAd) /* PHY specification */ pAd->CommonCfg.PhyMode = PHY_11BG_MIXED; /* default PHY mode */ - OPSTATUS_CLEAR_FLAG(pAd, fOP_STATUS_SHORT_PREAMBLE_INUSED); /* CCK use LONG preamble */ + OPSTATUS_CLEAR_FLAG(pAd, fOP_STATUS_SHORT_PREAMBLE_INUSED); /* CCK use long preamble */ { /* user desired power mode */ @@ -2736,10 +2736,10 @@ VOID UserCfgInit(IN PRTMP_ADAPTER pAd) NdisZeroMemory(pAd->nickname, IW_ESSID_MAX_SIZE + 1); #ifdef RTMP_MAC_PCI - sprintf((PSTRING) pAd->nickname, "RT2860STA"); + sprintf((char *)pAd->nickname, "RT2860STA"); #endif /* RTMP_MAC_PCI // */ #ifdef RTMP_MAC_USB - sprintf((PSTRING) pAd->nickname, "RT2870STA"); + sprintf((char *)pAd->nickname, "RT2870STA"); #endif /* RTMP_MAC_USB // */ RTMPInitTimer(pAd, &pAd->StaCfg.WpaDisassocAndBlockAssocTimer, GET_TIMER_FUNCTION(WpaDisassocApAndBlockAssoc), @@ -2810,7 +2810,7 @@ VOID UserCfgInit(IN PRTMP_ADAPTER pAd) } /* IRQL = PASSIVE_LEVEL */ -UCHAR BtoH(STRING ch) +u8 BtoH(char ch) { if (ch >= '0' && ch <= '9') return (ch - '0'); /* Handle numerals */ @@ -2822,7 +2822,7 @@ UCHAR BtoH(STRING ch) } /* */ -/* FUNCTION: AtoH(char *, UCHAR *, int) */ +/* FUNCTION: AtoH(char *, u8 *, int) */ /* */ /* PURPOSE: Converts ascii string to network order hex */ /* */ @@ -2838,13 +2838,13 @@ UCHAR BtoH(STRING ch) /* */ /* IRQL = PASSIVE_LEVEL */ -void AtoH(PSTRING src, PUCHAR dest, int destlen) +void AtoH(char *src, u8 *dest, int destlen) { - PSTRING srcptr; - PUCHAR destTemp; + char *srcptr; + u8 *destTemp; srcptr = src; - destTemp = (PUCHAR) dest; + destTemp = (u8 *)dest; while (destlen--) { *destTemp = BtoH(*srcptr++) << 4; /* Put 1st ascii byte in upper nibble. */ @@ -2875,9 +2875,9 @@ void AtoH(PSTRING src, PUCHAR dest, int destlen) ======================================================================== */ -VOID RTMPInitTimer(IN PRTMP_ADAPTER pAd, +void RTMPInitTimer(IN PRTMP_ADAPTER pAd, IN PRALINK_TIMER_STRUCT pTimer, - IN PVOID pTimerFunc, IN PVOID pData, IN BOOLEAN Repeat) + void *pTimerFunc, void *pData, IN BOOLEAN Repeat) { /* */ /* Set Valid to TRUE for later used. */ @@ -2888,13 +2888,13 @@ VOID RTMPInitTimer(IN PRTMP_ADAPTER pAd, pTimer->PeriodicType = Repeat; pTimer->State = FALSE; - pTimer->cookie = (ULONG) pData; + pTimer->cookie = (unsigned long)pData; #ifdef RTMP_TIMER_TASK_SUPPORT pTimer->pAd = pAd; #endif /* RTMP_TIMER_TASK_SUPPORT // */ - RTMP_OS_Init_Timer(pAd, &pTimer->TimerObj, pTimerFunc, (PVOID) pTimer); + RTMP_OS_Init_Timer(pAd, &pTimer->TimerObj, pTimerFunc, (void *)pTimer); } /* @@ -2915,7 +2915,7 @@ VOID RTMPInitTimer(IN PRTMP_ADAPTER pAd, ======================================================================== */ -VOID RTMPSetTimer(IN PRALINK_TIMER_STRUCT pTimer, IN ULONG Value) +void RTMPSetTimer(IN PRALINK_TIMER_STRUCT pTimer, unsigned long Value) { if (pTimer->Valid) { pTimer->TimerValue = Value; @@ -2950,7 +2950,7 @@ VOID RTMPSetTimer(IN PRALINK_TIMER_STRUCT pTimer, IN ULONG Value) ======================================================================== */ -VOID RTMPModTimer(IN PRALINK_TIMER_STRUCT pTimer, IN ULONG Value) +void RTMPModTimer(IN PRALINK_TIMER_STRUCT pTimer, unsigned long Value) { BOOLEAN Cancel; @@ -2989,7 +2989,7 @@ VOID RTMPModTimer(IN PRALINK_TIMER_STRUCT pTimer, IN ULONG Value) ======================================================================== */ -VOID RTMPCancelTimer(IN PRALINK_TIMER_STRUCT pTimer, OUT BOOLEAN * pCancelled) +void RTMPCancelTimer(IN PRALINK_TIMER_STRUCT pTimer, OUT BOOLEAN * pCancelled) { if (pTimer->Valid) { if (pTimer->State == FALSE) @@ -3030,11 +3030,11 @@ VOID RTMPCancelTimer(IN PRALINK_TIMER_STRUCT pTimer, OUT BOOLEAN * pCancelled) ======================================================================== */ -VOID RTMPSetLED(IN PRTMP_ADAPTER pAd, IN UCHAR Status) +void RTMPSetLED(IN PRTMP_ADAPTER pAd, u8 Status) { - /*ULONG data; */ - UCHAR HighByte = 0; - UCHAR LowByte; + /*unsigned long data; */ + u8 HighByte = 0; + u8 LowByte; LowByte = pAd->LedCntl.field.LedMode & 0x7f; switch (Status) { @@ -3117,9 +3117,9 @@ VOID RTMPSetLED(IN PRTMP_ADAPTER pAd, IN UCHAR Status) > -57 Excellent ======================================================================== */ -VOID RTMPSetSignalLED(IN PRTMP_ADAPTER pAd, IN NDIS_802_11_RSSI Dbm) +void RTMPSetSignalLED(IN PRTMP_ADAPTER pAd, IN NDIS_802_11_RSSI Dbm) { - UCHAR nLed = 0; + u8 nLed = 0; if (pAd->LedCntl.field.LedMode == LED_MODE_SIGNAL_STREGTH) { if (Dbm <= -90) @@ -3164,11 +3164,11 @@ VOID RTMPSetSignalLED(IN PRTMP_ADAPTER pAd, IN NDIS_802_11_RSSI Dbm) Before Enable RX, make sure you have enabled Interrupt. ======================================================================== */ -VOID RTMPEnableRxTx(IN PRTMP_ADAPTER pAd) +void RTMPEnableRxTx(IN PRTMP_ADAPTER pAd) { /* WPDMA_GLO_CFG_STRUC GloCfg; */ -/* ULONG i = 0; */ - UINT32 rx_filter_flag; +/* unsigned long i = 0; */ + u32 rx_filter_flag; DBGPRINT(RT_DEBUG_TRACE, ("==> RTMPEnableRxTx\n")); @@ -3199,12 +3199,12 @@ void CfgInitHook(PRTMP_ADAPTER pAd) } int rt28xx_init(IN PRTMP_ADAPTER pAd, - IN PSTRING pDefaultMac, IN PSTRING pHostName) + char *pDefaultMac, char *pHostName) { - UINT index; - UCHAR TmpPhy; - NDIS_STATUS Status; - UINT32 MacCsr0 = 0; + u32 index; + u8 TmpPhy; + int Status; + u32 MacCsr0 = 0; #ifdef RTMP_MAC_PCI { @@ -3346,20 +3346,20 @@ int rt28xx_init(IN PRTMP_ADAPTER pAd, /*Init Ba Capability parameters. */ /* RT28XX_BA_INIT(pAd); */ pAd->CommonCfg.DesiredHtPhy.MpduDensity = - (UCHAR) pAd->CommonCfg.BACapability.field.MpduDensity; + (u8)pAd->CommonCfg.BACapability.field.MpduDensity; pAd->CommonCfg.DesiredHtPhy.AmsduEnable = - (USHORT) pAd->CommonCfg.BACapability.field.AmsduEnable; + (u16)pAd->CommonCfg.BACapability.field.AmsduEnable; pAd->CommonCfg.DesiredHtPhy.AmsduSize = - (USHORT) pAd->CommonCfg.BACapability.field.AmsduSize; + (u16)pAd->CommonCfg.BACapability.field.AmsduSize; pAd->CommonCfg.DesiredHtPhy.MimoPs = - (USHORT) pAd->CommonCfg.BACapability.field.MMPSmode; + (u16)pAd->CommonCfg.BACapability.field.MMPSmode; /* UPdata to HT IE */ pAd->CommonCfg.HtCapability.HtCapInfo.MimoPs = - (USHORT) pAd->CommonCfg.BACapability.field.MMPSmode; + (u16)pAd->CommonCfg.BACapability.field.MMPSmode; pAd->CommonCfg.HtCapability.HtCapInfo.AMsduSize = - (USHORT) pAd->CommonCfg.BACapability.field.AmsduSize; + (u16)pAd->CommonCfg.BACapability.field.AmsduSize; pAd->CommonCfg.HtCapability.HtCapParm.MpduDensity = - (UCHAR) pAd->CommonCfg.BACapability.field.MpduDensity; + (u8)pAd->CommonCfg.BACapability.field.MpduDensity; /* after reading Registry, we now know if in AP mode or STA mode */ @@ -3371,7 +3371,7 @@ int rt28xx_init(IN PRTMP_ADAPTER pAd, DBGPRINT(RT_DEBUG_OFF, ("2. Phy Mode = %d\n", pAd->CommonCfg.PhyMode)); /* We should read EEPROM for all cases. rt2860b */ - NICReadEEPROMParameters(pAd, (PUCHAR) pDefaultMac); + NICReadEEPROMParameters(pAd, (u8 *)pDefaultMac); DBGPRINT(RT_DEBUG_OFF, ("3. Phy Mode = %d\n", pAd->CommonCfg.PhyMode)); @@ -3476,7 +3476,7 @@ err0: /*---Add by shiang, move from os/linux/rt_main_dev.c */ -static INT RtmpChipOpsRegister(IN RTMP_ADAPTER * pAd, IN INT infType) +static int RtmpChipOpsRegister(IN RTMP_ADAPTER * pAd, int infType) { RTMP_CHIP_OP *pChipOps = &pAd->chipOps; int status; @@ -3508,9 +3508,9 @@ static INT RtmpChipOpsRegister(IN RTMP_ADAPTER * pAd, IN INT infType) return status; } -INT RtmpRaDevCtrlInit(IN RTMP_ADAPTER * pAd, IN RTMP_INF_TYPE infType) +int RtmpRaDevCtrlInit(IN RTMP_ADAPTER * pAd, IN RTMP_INF_TYPE infType) { - /*VOID *handle; */ + /*void *handle; */ /* Assign the interface type. We need use it when do register/EEPROM access. */ pAd->infType = infType; @@ -3521,7 +3521,7 @@ INT RtmpRaDevCtrlInit(IN RTMP_ADAPTER * pAd, IN RTMP_INF_TYPE infType) #ifdef RTMP_MAC_USB init_MUTEX(&(pAd->UsbVendorReq_semaphore)); - os_alloc_mem(pAd, (PUCHAR *) & pAd->UsbVendorReqBuf, + os_alloc_mem(pAd, (u8 **) & pAd->UsbVendorReqBuf, MAX_PARAM_BUFFER_SIZE - 1); if (pAd->UsbVendorReqBuf == NULL) { DBGPRINT(RT_DEBUG_ERROR, @@ -3544,7 +3544,7 @@ BOOLEAN RtmpRaDevCtrlExit(IN RTMP_ADAPTER * pAd) } /* not yet support MBSS */ -PNET_DEV get_netdev_from_bssid(IN PRTMP_ADAPTER pAd, IN UCHAR FromWhichBSSID) +PNET_DEV get_netdev_from_bssid(IN PRTMP_ADAPTER pAd, u8 FromWhichBSSID) { PNET_DEV dev_p = NULL; diff --git a/drivers/staging/rt2860/common/rtmp_mcu.c b/drivers/staging/rt2860/common/rtmp_mcu.c index 09d46f779db..3d695278afe 100644 --- a/drivers/staging/rt2860/common/rtmp_mcu.c +++ b/drivers/staging/rt2860/common/rtmp_mcu.c @@ -57,7 +57,7 @@ /* New 8k byte firmware size for RT3071/RT3072 */ #define FIRMWAREIMAGE_MAX_LENGTH 0x2000 -#define FIRMWAREIMAGE_LENGTH (sizeof (FirmwareImage) / sizeof(UCHAR)) +#define FIRMWAREIMAGE_LENGTH (sizeof (FirmwareImage) / sizeof(u8)) #define FIRMWARE_MAJOR_VERSION 0 #define FIRMWAREIMAGEV1_LENGTH 0x1000 @@ -80,9 +80,9 @@ ======================================================================== */ -INT RtmpAsicEraseFirmware(IN PRTMP_ADAPTER pAd) +int RtmpAsicEraseFirmware(IN PRTMP_ADAPTER pAd) { - ULONG i; + unsigned long i; for (i = 0; i < MAX_FIRMWARE_IMAGE_SIZE; i += 4) RTMP_IO_WRITE32(pAd, FIRMWARE_IMAGE_BASE + i, 0); @@ -107,15 +107,15 @@ INT RtmpAsicEraseFirmware(IN PRTMP_ADAPTER pAd) ======================================================================== */ -NDIS_STATUS RtmpAsicLoadFirmware(IN PRTMP_ADAPTER pAd) +int RtmpAsicLoadFirmware(IN PRTMP_ADAPTER pAd) { - NDIS_STATUS Status = NDIS_STATUS_SUCCESS; - PUCHAR pFirmwareImage = NULL; - ULONG FileLength, Index; - UINT32 MacReg = 0; + int Status = NDIS_STATUS_SUCCESS; + u8 *pFirmwareImage = NULL; + unsigned long FileLength, Index; + u32 MacReg = 0; #ifdef RTMP_MAC_USB - UINT32 Version = (pAd->MACVersion >> 16); + u32 Version = (pAd->MACVersion >> 16); #endif /* New 8k byte firmware size for RT3071/RT3072 */ @@ -134,7 +134,7 @@ NDIS_STATUS RtmpAsicLoadFirmware(IN PRTMP_ADAPTER pAd) if ((Version != 0x2860) && (Version != 0x2872) && (Version != 0x3070)) { /* use the second part */ /*printk("KH:Use New Version,part2\n"); */ pFirmwareImage = - (PUCHAR) & + (u8 *)& FirmwareImage_3070[FIRMWAREIMAGEV1_LENGTH]; FileLength = FIRMWAREIMAGEV2_LENGTH; } else { @@ -172,13 +172,13 @@ NDIS_STATUS RtmpAsicLoadFirmware(IN PRTMP_ADAPTER pAd) return Status; } -INT RtmpAsicSendCommandToMcu(IN PRTMP_ADAPTER pAd, - IN UCHAR Command, - IN UCHAR Token, IN UCHAR Arg0, IN UCHAR Arg1) +int RtmpAsicSendCommandToMcu(IN PRTMP_ADAPTER pAd, + u8 Command, + u8 Token, u8 Arg0, u8 Arg1) { HOST_CMD_CSR_STRUC H2MCmd; H2M_MAILBOX_STRUC H2MMailbox; - ULONG i = 0; + unsigned long i = 0; #ifdef PCIE_PS_SUPPORT /* 3090F power solution 3 has hw limitation that needs to ban all mcu command */ diff --git a/drivers/staging/rt2860/common/rtmp_timer.c b/drivers/staging/rt2860/common/rtmp_timer.c index d29e6e8775e..d5648d8967d 100644 --- a/drivers/staging/rt2860/common/rtmp_timer.c +++ b/drivers/staging/rt2860/common/rtmp_timer.c @@ -67,9 +67,9 @@ BUILD_TIMER_FUNCTION(RtmpUsbStaAsicForceWakeupTimeout); #endif /* RTMP_MAC_USB // */ #if defined(AP_LED) || defined(STA_LED) -extern void LedCtrlMain(IN PVOID SystemSpecific1, - IN PVOID FunctionContext, - IN PVOID SystemSpecific2, IN PVOID SystemSpecific3); +extern void LedCtrlMain(void *SystemSpecific1, + void *FunctionContext, + void *SystemSpecific2, void *SystemSpecific3); BUILD_TIMER_FUNCTION(LedCtrlMain); #endif @@ -119,7 +119,7 @@ static void RtmpTimerQHandle(RTMP_ADAPTER * pAd) if ((pTimer->handle != NULL) && (!pAd->PM_FlgSuspend)) pTimer->handle(NULL, - (PVOID) pTimer->cookie, + (void *)pTimer->cookie, NULL, pTimer); if ((pTimer->Repeat) && (pTimer->State == FALSE)) @@ -138,7 +138,7 @@ static void RtmpTimerQHandle(RTMP_ADAPTER * pAd) } } -INT RtmpTimerQThread(IN OUT PVOID Context) +int RtmpTimerQThread(IN void *Context) { RTMP_OS_TASK *pTask; PRTMP_ADAPTER pAd; diff --git a/drivers/staging/rt2860/common/spectrum.c b/drivers/staging/rt2860/common/spectrum.c index 2cc73de092d..b89ad5f5a46 100644 --- a/drivers/staging/rt2860/common/spectrum.c +++ b/drivers/staging/rt2860/common/spectrum.c @@ -261,23 +261,23 @@ DOT11_REGULATORY_INFORMATION JapanRegulatoryInfo[] = { #define JP_REGULATORY_INFO_SIZE (sizeof(JapanRegulatoryInfo) / sizeof(DOT11_REGULATORY_INFORMATION)) -CHAR RTMP_GetTxPwr(IN PRTMP_ADAPTER pAd, IN HTTRANSMIT_SETTING HTTxMode) +char RTMP_GetTxPwr(IN PRTMP_ADAPTER pAd, IN HTTRANSMIT_SETTING HTTxMode) { typedef struct __TX_PWR_CFG { - UINT8 Mode; - UINT8 MCS; - UINT16 req; - UINT8 shift; - UINT32 BitMask; + u8 Mode; + u8 MCS; + u16 req; + u8 shift; + u32 BitMask; } TX_PWR_CFG; - UINT32 Value; - INT Idx; - UINT8 PhyMode; - CHAR CurTxPwr; - UINT8 TxPwrRef = 0; - CHAR DaltaPwr; - ULONG TxPwr[5]; + u32 Value; + int Idx; + u8 PhyMode; + char CurTxPwr; + u8 TxPwrRef = 0; + char DaltaPwr; + unsigned long TxPwr[5]; TX_PWR_CFG TxPwrCfg[] = { {MODE_CCK, 0, 0, 4, 0x000000f0}, @@ -385,7 +385,7 @@ CHAR RTMP_GetTxPwr(IN PRTMP_ADAPTER pAd, IN HTTRANSMIT_SETTING HTTxMode) && (TxPwrCfg[Idx].MCS == HTTxMode.field.MCS)) { Value = TxPwr[TxPwrCfg[Idx].req]; DaltaPwr = - TxPwrRef - (CHAR) ((Value & TxPwrCfg[Idx].BitMask) + TxPwrRef - (char)((Value & TxPwrCfg[Idx].BitMask) >> TxPwrCfg[Idx].shift); CurTxPwr -= DaltaPwr; break; @@ -395,7 +395,7 @@ CHAR RTMP_GetTxPwr(IN PRTMP_ADAPTER pAd, IN HTTRANSMIT_SETTING HTTxMode) return CurTxPwr; } -VOID MeasureReqTabInit(IN PRTMP_ADAPTER pAd) +void MeasureReqTabInit(IN PRTMP_ADAPTER pAd) { NdisAllocateSpinLock(&pAd->CommonCfg.MeasureReqTabLock); @@ -412,7 +412,7 @@ VOID MeasureReqTabInit(IN PRTMP_ADAPTER pAd) return; } -VOID MeasureReqTabExit(IN PRTMP_ADAPTER pAd) +void MeasureReqTabExit(IN PRTMP_ADAPTER pAd) { NdisFreeSpinLock(&pAd->CommonCfg.MeasureReqTabLock); @@ -423,9 +423,9 @@ VOID MeasureReqTabExit(IN PRTMP_ADAPTER pAd) return; } -PMEASURE_REQ_ENTRY MeasureReqLookUp(IN PRTMP_ADAPTER pAd, IN UINT8 DialogToken) +PMEASURE_REQ_ENTRY MeasureReqLookUp(IN PRTMP_ADAPTER pAd, u8 DialogToken) { - UINT HashIdx; + u32 HashIdx; PMEASURE_REQ_TAB pTab = pAd->CommonCfg.pMeasureReqTab; PMEASURE_REQ_ENTRY pEntry = NULL; PMEASURE_REQ_ENTRY pPrevEntry = NULL; @@ -455,13 +455,13 @@ PMEASURE_REQ_ENTRY MeasureReqLookUp(IN PRTMP_ADAPTER pAd, IN UINT8 DialogToken) return pEntry; } -PMEASURE_REQ_ENTRY MeasureReqInsert(IN PRTMP_ADAPTER pAd, IN UINT8 DialogToken) +PMEASURE_REQ_ENTRY MeasureReqInsert(IN PRTMP_ADAPTER pAd, u8 DialogToken) { - INT i; - ULONG HashIdx; + int i; + unsigned long HashIdx; PMEASURE_REQ_TAB pTab = pAd->CommonCfg.pMeasureReqTab; PMEASURE_REQ_ENTRY pEntry = NULL, pCurrEntry; - ULONG Now; + unsigned long Now; if (pTab == NULL) { DBGPRINT(RT_DEBUG_ERROR, @@ -483,7 +483,7 @@ PMEASURE_REQ_ENTRY MeasureReqInsert(IN PRTMP_ADAPTER pAd, IN UINT8 DialogToken) MQ_REQ_AGE_OUT))) { PMEASURE_REQ_ENTRY pPrevEntry = NULL; - ULONG HashIdx = + unsigned long HashIdx = MQ_DIALOGTOKEN_HASH_INDEX(pEntry-> DialogToken); PMEASURE_REQ_ENTRY pProbeEntry = @@ -548,7 +548,7 @@ PMEASURE_REQ_ENTRY MeasureReqInsert(IN PRTMP_ADAPTER pAd, IN UINT8 DialogToken) return pEntry; } -VOID MeasureReqDelete(IN PRTMP_ADAPTER pAd, IN UINT8 DialogToken) +void MeasureReqDelete(IN PRTMP_ADAPTER pAd, u8 DialogToken) { PMEASURE_REQ_TAB pTab = pAd->CommonCfg.pMeasureReqTab; PMEASURE_REQ_ENTRY pEntry = NULL; @@ -567,7 +567,7 @@ VOID MeasureReqDelete(IN PRTMP_ADAPTER pAd, IN UINT8 DialogToken) pEntry = MeasureReqLookUp(pAd, DialogToken); if (pEntry != NULL) { PMEASURE_REQ_ENTRY pPrevEntry = NULL; - ULONG HashIdx = MQ_DIALOGTOKEN_HASH_INDEX(pEntry->DialogToken); + unsigned long HashIdx = MQ_DIALOGTOKEN_HASH_INDEX(pEntry->DialogToken); PMEASURE_REQ_ENTRY pProbeEntry = pTab->Hash[HashIdx]; RTMP_SEM_LOCK(&pAd->CommonCfg.MeasureReqTabLock); @@ -595,7 +595,7 @@ VOID MeasureReqDelete(IN PRTMP_ADAPTER pAd, IN UINT8 DialogToken) return; } -VOID TpcReqTabInit(IN PRTMP_ADAPTER pAd) +void TpcReqTabInit(IN PRTMP_ADAPTER pAd) { NdisAllocateSpinLock(&pAd->CommonCfg.TpcReqTabLock); @@ -610,7 +610,7 @@ VOID TpcReqTabInit(IN PRTMP_ADAPTER pAd) return; } -VOID TpcReqTabExit(IN PRTMP_ADAPTER pAd) +void TpcReqTabExit(IN PRTMP_ADAPTER pAd) { NdisFreeSpinLock(&pAd->CommonCfg.TpcReqTabLock); @@ -621,9 +621,9 @@ VOID TpcReqTabExit(IN PRTMP_ADAPTER pAd) return; } -static PTPC_REQ_ENTRY TpcReqLookUp(IN PRTMP_ADAPTER pAd, IN UINT8 DialogToken) +static PTPC_REQ_ENTRY TpcReqLookUp(IN PRTMP_ADAPTER pAd, u8 DialogToken) { - UINT HashIdx; + u32 HashIdx; PTPC_REQ_TAB pTab = pAd->CommonCfg.pTpcReqTab; PTPC_REQ_ENTRY pEntry = NULL; PTPC_REQ_ENTRY pPrevEntry = NULL; @@ -653,13 +653,13 @@ static PTPC_REQ_ENTRY TpcReqLookUp(IN PRTMP_ADAPTER pAd, IN UINT8 DialogToken) return pEntry; } -static PTPC_REQ_ENTRY TpcReqInsert(IN PRTMP_ADAPTER pAd, IN UINT8 DialogToken) +static PTPC_REQ_ENTRY TpcReqInsert(IN PRTMP_ADAPTER pAd, u8 DialogToken) { - INT i; - ULONG HashIdx; + int i; + unsigned long HashIdx; PTPC_REQ_TAB pTab = pAd->CommonCfg.pTpcReqTab; PTPC_REQ_ENTRY pEntry = NULL, pCurrEntry; - ULONG Now; + unsigned long Now; if (pTab == NULL) { DBGPRINT(RT_DEBUG_ERROR, @@ -681,7 +681,7 @@ static PTPC_REQ_ENTRY TpcReqInsert(IN PRTMP_ADAPTER pAd, IN UINT8 DialogToken) TPC_REQ_AGE_OUT))) { PTPC_REQ_ENTRY pPrevEntry = NULL; - ULONG HashIdx = + unsigned long HashIdx = TPC_DIALOGTOKEN_HASH_INDEX(pEntry-> DialogToken); PTPC_REQ_ENTRY pProbeEntry = @@ -745,7 +745,7 @@ static PTPC_REQ_ENTRY TpcReqInsert(IN PRTMP_ADAPTER pAd, IN UINT8 DialogToken) return pEntry; } -static VOID TpcReqDelete(IN PRTMP_ADAPTER pAd, IN UINT8 DialogToken) +static void TpcReqDelete(IN PRTMP_ADAPTER pAd, u8 DialogToken) { PTPC_REQ_TAB pTab = pAd->CommonCfg.pTpcReqTab; PTPC_REQ_ENTRY pEntry = NULL; @@ -764,7 +764,7 @@ static VOID TpcReqDelete(IN PRTMP_ADAPTER pAd, IN UINT8 DialogToken) pEntry = TpcReqLookUp(pAd, DialogToken); if (pEntry != NULL) { PTPC_REQ_ENTRY pPrevEntry = NULL; - ULONG HashIdx = TPC_DIALOGTOKEN_HASH_INDEX(pEntry->DialogToken); + unsigned long HashIdx = TPC_DIALOGTOKEN_HASH_INDEX(pEntry->DialogToken); PTPC_REQ_ENTRY pProbeEntry = pTab->Hash[HashIdx]; RTMP_SEM_LOCK(&pAd->CommonCfg.TpcReqTabLock); @@ -802,7 +802,7 @@ static VOID TpcReqDelete(IN PRTMP_ADAPTER pAd, IN UINT8 DialogToken) Return : Current Time Stamp. ========================================================================== */ -static UINT64 GetCurrentTimeStamp(IN PRTMP_ADAPTER pAd) +static u64 GetCurrentTimeStamp(IN PRTMP_ADAPTER pAd) { /* get current time stamp. */ return 0; @@ -818,7 +818,7 @@ static UINT64 GetCurrentTimeStamp(IN PRTMP_ADAPTER pAd) Return : Current Time Stamp. ========================================================================== */ -static UINT8 GetCurTxPwr(IN PRTMP_ADAPTER pAd, IN UINT8 Wcid) +static u8 GetCurTxPwr(IN PRTMP_ADAPTER pAd, u8 Wcid) { return 16; /* 16 dBm */ } @@ -833,15 +833,15 @@ static UINT8 GetCurTxPwr(IN PRTMP_ADAPTER pAd, IN UINT8 Wcid) Return : Current Time Stamp. ========================================================================== */ -VOID InsertChannelRepIE(IN PRTMP_ADAPTER pAd, - OUT PUCHAR pFrameBuf, - OUT PULONG pFrameLen, - IN PSTRING pCountry, IN UINT8 RegulatoryClass) +void InsertChannelRepIE(IN PRTMP_ADAPTER pAd, + u8 *pFrameBuf, + unsigned long *pFrameLen, + char *pCountry, u8 RegulatoryClass) { - ULONG TempLen; - UINT8 Len; - UINT8 IEId = IE_AP_CHANNEL_REPORT; - PUCHAR pChListPtr = NULL; + unsigned long TempLen; + u8 Len; + u8 IEId = IE_AP_CHANNEL_REPORT; + u8 *pChListPtr = NULL; Len = 1; if (strncmp(pCountry, "US", 2) == 0) { @@ -900,11 +900,11 @@ VOID InsertChannelRepIE(IN PRTMP_ADAPTER pAd, Return : None. ========================================================================== */ -VOID InsertDialogToken(IN PRTMP_ADAPTER pAd, - OUT PUCHAR pFrameBuf, - OUT PULONG pFrameLen, IN UINT8 DialogToken) +void InsertDialogToken(IN PRTMP_ADAPTER pAd, + u8 *pFrameBuf, + unsigned long *pFrameLen, u8 DialogToken) { - ULONG TempLen; + unsigned long TempLen; MakeOutgoingFrame(pFrameBuf, &TempLen, 1, &DialogToken, END_OF_ARGS); *pFrameLen = *pFrameLen + TempLen; @@ -924,12 +924,12 @@ VOID InsertDialogToken(IN PRTMP_ADAPTER pAd, Return : None. ========================================================================== */ -static VOID InsertTpcReqIE(IN PRTMP_ADAPTER pAd, - OUT PUCHAR pFrameBuf, OUT PULONG pFrameLen) +static void InsertTpcReqIE(IN PRTMP_ADAPTER pAd, + u8 *pFrameBuf, unsigned long *pFrameLen) { - ULONG TempLen; - ULONG Len = 0; - UINT8 ElementID = IE_TPC_REQUEST; + unsigned long TempLen; + unsigned long Len = 0; + u8 ElementID = IE_TPC_REQUEST; MakeOutgoingFrame(pFrameBuf, &TempLen, 1, &ElementID, 1, &Len, END_OF_ARGS); @@ -953,14 +953,14 @@ static VOID InsertTpcReqIE(IN PRTMP_ADAPTER pAd, Return : None. ========================================================================== */ -VOID InsertTpcReportIE(IN PRTMP_ADAPTER pAd, - OUT PUCHAR pFrameBuf, - OUT PULONG pFrameLen, - IN UINT8 TxPwr, IN UINT8 LinkMargin) +void InsertTpcReportIE(IN PRTMP_ADAPTER pAd, + u8 *pFrameBuf, + unsigned long *pFrameLen, + u8 TxPwr, u8 LinkMargin) { - ULONG TempLen; - ULONG Len = sizeof(TPC_REPORT_INFO); - UINT8 ElementID = IE_TPC_REPORT; + unsigned long TempLen; + unsigned long Len = sizeof(TPC_REPORT_INFO); + u8 ElementID = IE_TPC_REPORT; TPC_REPORT_INFO TpcReportIE; TpcReportIE.TxPwr = TxPwr; @@ -990,15 +990,15 @@ VOID InsertTpcReportIE(IN PRTMP_ADAPTER pAd, Return : None. ========================================================================== */ -static VOID InsertChSwAnnIE(IN PRTMP_ADAPTER pAd, - OUT PUCHAR pFrameBuf, - OUT PULONG pFrameLen, - IN UINT8 ChSwMode, - IN UINT8 NewChannel, IN UINT8 ChSwCnt) +static void InsertChSwAnnIE(IN PRTMP_ADAPTER pAd, + u8 *pFrameBuf, + unsigned long *pFrameLen, + u8 ChSwMode, + u8 NewChannel, u8 ChSwCnt) { - ULONG TempLen; - ULONG Len = sizeof(CH_SW_ANN_INFO); - UINT8 ElementID = IE_CHANNEL_SWITCH_ANNOUNCEMENT; + unsigned long TempLen; + unsigned long Len = sizeof(CH_SW_ANN_INFO); + u8 ElementID = IE_CHANNEL_SWITCH_ANNOUNCEMENT; CH_SW_ANN_INFO ChSwAnnIE; ChSwAnnIE.ChSwMode = ChSwMode; @@ -1031,13 +1031,13 @@ static VOID InsertChSwAnnIE(IN PRTMP_ADAPTER pAd, Return : None. ========================================================================== */ -static VOID InsertMeasureReqIE(IN PRTMP_ADAPTER pAd, - OUT PUCHAR pFrameBuf, - OUT PULONG pFrameLen, - IN UINT8 Len, IN PMEASURE_REQ_INFO pMeasureReqIE) +static void InsertMeasureReqIE(IN PRTMP_ADAPTER pAd, + u8 *pFrameBuf, + unsigned long *pFrameLen, + u8 Len, IN PMEASURE_REQ_INFO pMeasureReqIE) { - ULONG TempLen; - UINT8 ElementID = IE_MEASUREMENT_REQUEST; + unsigned long TempLen; + u8 ElementID = IE_MEASUREMENT_REQUEST; MakeOutgoingFrame(pFrameBuf, &TempLen, 1, &ElementID, @@ -1066,15 +1066,15 @@ static VOID InsertMeasureReqIE(IN PRTMP_ADAPTER pAd, Return : None. ========================================================================== */ -static VOID InsertMeasureReportIE(IN PRTMP_ADAPTER pAd, - OUT PUCHAR pFrameBuf, - OUT PULONG pFrameLen, +static void InsertMeasureReportIE(IN PRTMP_ADAPTER pAd, + u8 *pFrameBuf, + unsigned long *pFrameLen, IN PMEASURE_REPORT_INFO pMeasureReportIE, - IN UINT8 ReportLnfoLen, IN PUINT8 pReportInfo) + u8 ReportLnfoLen, u8 *pReportInfo) { - ULONG TempLen; - ULONG Len; - UINT8 ElementID = IE_MEASUREMENT_REPORT; + unsigned long TempLen; + unsigned long Len; + u8 ElementID = IE_MEASUREMENT_REPORT; Len = sizeof(MEASURE_REPORT_INFO) + ReportLnfoLen; @@ -1105,17 +1105,17 @@ static VOID InsertMeasureReportIE(IN PRTMP_ADAPTER pAd, Return : None. ========================================================================== */ -VOID MakeMeasurementReqFrame(IN PRTMP_ADAPTER pAd, - OUT PUCHAR pOutBuffer, - OUT PULONG pFrameLen, - IN UINT8 TotalLen, - IN UINT8 Category, - IN UINT8 Action, - IN UINT8 MeasureToken, - IN UINT8 MeasureReqMode, - IN UINT8 MeasureReqType, IN UINT8 NumOfRepetitions) +void MakeMeasurementReqFrame(IN PRTMP_ADAPTER pAd, + u8 *pOutBuffer, + unsigned long *pFrameLen, + u8 TotalLen, + u8 Category, + u8 Action, + u8 MeasureToken, + u8 MeasureReqMode, + u8 MeasureReqType, u8 NumOfRepetitions) { - ULONG TempLen; + unsigned long TempLen; MEASURE_REQ_INFO MeasureReqIE; InsertActField(pAd, (pOutBuffer + *pFrameLen), pFrameLen, Category, @@ -1155,17 +1155,17 @@ VOID MakeMeasurementReqFrame(IN PRTMP_ADAPTER pAd, Return : None. ========================================================================== */ -VOID EnqueueMeasurementRep(IN PRTMP_ADAPTER pAd, - IN PUCHAR pDA, - IN UINT8 DialogToken, - IN UINT8 MeasureToken, - IN UINT8 MeasureReqMode, - IN UINT8 MeasureReqType, - IN UINT8 ReportInfoLen, IN PUINT8 pReportInfo) +void EnqueueMeasurementRep(IN PRTMP_ADAPTER pAd, + u8 *pDA, + u8 DialogToken, + u8 MeasureToken, + u8 MeasureReqMode, + u8 MeasureReqType, + u8 ReportInfoLen, u8 *pReportInfo) { - PUCHAR pOutBuffer = NULL; - NDIS_STATUS NStatus; - ULONG FrameLen; + u8 *pOutBuffer = NULL; + int NStatus; + unsigned long FrameLen; HEADER_802_11 ActHdr; MEASURE_REPORT_INFO MeasureRepIE; @@ -1173,13 +1173,13 @@ VOID EnqueueMeasurementRep(IN PRTMP_ADAPTER pAd, MgtMacHeaderInit(pAd, &ActHdr, SUBTYPE_ACTION, 0, pDA, pAd->CurrentAddress); - NStatus = MlmeAllocateMemory(pAd, (PVOID) & pOutBuffer); /*Get an unused nonpaged memory */ + NStatus = MlmeAllocateMemory(pAd, (void *)& pOutBuffer); /*Get an unused nonpaged memory */ if (NStatus != NDIS_STATUS_SUCCESS) { DBGPRINT(RT_DEBUG_TRACE, ("%s() allocate memory failed \n", __func__)); return; } - NdisMoveMemory(pOutBuffer, (PCHAR) & ActHdr, sizeof(HEADER_802_11)); + NdisMoveMemory(pOutBuffer, (char *)& ActHdr, sizeof(HEADER_802_11)); FrameLen = sizeof(HEADER_802_11); InsertActField(pAd, (pOutBuffer + FrameLen), &FrameLen, @@ -1214,11 +1214,11 @@ VOID EnqueueMeasurementRep(IN PRTMP_ADAPTER pAd, Return : None. ========================================================================== */ -VOID EnqueueTPCReq(IN PRTMP_ADAPTER pAd, IN PUCHAR pDA, IN UCHAR DialogToken) +void EnqueueTPCReq(IN PRTMP_ADAPTER pAd, u8 *pDA, u8 DialogToken) { - PUCHAR pOutBuffer = NULL; - NDIS_STATUS NStatus; - ULONG FrameLen; + u8 *pOutBuffer = NULL; + int NStatus; + unsigned long FrameLen; HEADER_802_11 ActHdr; @@ -1226,13 +1226,13 @@ VOID EnqueueTPCReq(IN PRTMP_ADAPTER pAd, IN PUCHAR pDA, IN UCHAR DialogToken) MgtMacHeaderInit(pAd, &ActHdr, SUBTYPE_ACTION, 0, pDA, pAd->CurrentAddress); - NStatus = MlmeAllocateMemory(pAd, (PVOID) & pOutBuffer); /*Get an unused nonpaged memory */ + NStatus = MlmeAllocateMemory(pAd, (void *)& pOutBuffer); /*Get an unused nonpaged memory */ if (NStatus != NDIS_STATUS_SUCCESS) { DBGPRINT(RT_DEBUG_TRACE, ("%s() allocate memory failed \n", __func__)); return; } - NdisMoveMemory(pOutBuffer, (PCHAR) & ActHdr, sizeof(HEADER_802_11)); + NdisMoveMemory(pOutBuffer, (char *)& ActHdr, sizeof(HEADER_802_11)); FrameLen = sizeof(HEADER_802_11); InsertActField(pAd, (pOutBuffer + FrameLen), &FrameLen, @@ -1262,13 +1262,13 @@ VOID EnqueueTPCReq(IN PRTMP_ADAPTER pAd, IN PUCHAR pDA, IN UCHAR DialogToken) Return : None. ========================================================================== */ -VOID EnqueueTPCRep(IN PRTMP_ADAPTER pAd, - IN PUCHAR pDA, - IN UINT8 DialogToken, IN UINT8 TxPwr, IN UINT8 LinkMargin) +void EnqueueTPCRep(IN PRTMP_ADAPTER pAd, + u8 *pDA, + u8 DialogToken, u8 TxPwr, u8 LinkMargin) { - PUCHAR pOutBuffer = NULL; - NDIS_STATUS NStatus; - ULONG FrameLen; + u8 *pOutBuffer = NULL; + int NStatus; + unsigned long FrameLen; HEADER_802_11 ActHdr; @@ -1276,13 +1276,13 @@ VOID EnqueueTPCRep(IN PRTMP_ADAPTER pAd, MgtMacHeaderInit(pAd, &ActHdr, SUBTYPE_ACTION, 0, pDA, pAd->CurrentAddress); - NStatus = MlmeAllocateMemory(pAd, (PVOID) & pOutBuffer); /*Get an unused nonpaged memory */ + NStatus = MlmeAllocateMemory(pAd, (void *)& pOutBuffer); /*Get an unused nonpaged memory */ if (NStatus != NDIS_STATUS_SUCCESS) { DBGPRINT(RT_DEBUG_TRACE, ("%s() allocate memory failed \n", __func__)); return; } - NdisMoveMemory(pOutBuffer, (PCHAR) & ActHdr, sizeof(HEADER_802_11)); + NdisMoveMemory(pOutBuffer, (char *)& ActHdr, sizeof(HEADER_802_11)); FrameLen = sizeof(HEADER_802_11); InsertActField(pAd, (pOutBuffer + FrameLen), &FrameLen, @@ -1315,12 +1315,12 @@ VOID EnqueueTPCRep(IN PRTMP_ADAPTER pAd, Return : None. ========================================================================== */ -VOID EnqueueChSwAnn(IN PRTMP_ADAPTER pAd, - IN PUCHAR pDA, IN UINT8 ChSwMode, IN UINT8 NewCh) +void EnqueueChSwAnn(IN PRTMP_ADAPTER pAd, + u8 *pDA, u8 ChSwMode, u8 NewCh) { - PUCHAR pOutBuffer = NULL; - NDIS_STATUS NStatus; - ULONG FrameLen; + u8 *pOutBuffer = NULL; + int NStatus; + unsigned long FrameLen; HEADER_802_11 ActHdr; @@ -1328,13 +1328,13 @@ VOID EnqueueChSwAnn(IN PRTMP_ADAPTER pAd, MgtMacHeaderInit(pAd, &ActHdr, SUBTYPE_ACTION, 0, pDA, pAd->CurrentAddress); - NStatus = MlmeAllocateMemory(pAd, (PVOID) & pOutBuffer); /*Get an unused nonpaged memory */ + NStatus = MlmeAllocateMemory(pAd, (void *)& pOutBuffer); /*Get an unused nonpaged memory */ if (NStatus != NDIS_STATUS_SUCCESS) { DBGPRINT(RT_DEBUG_TRACE, ("%s() allocate memory failed \n", __func__)); return; } - NdisMoveMemory(pOutBuffer, (PCHAR) & ActHdr, sizeof(HEADER_802_11)); + NdisMoveMemory(pOutBuffer, (char *)& ActHdr, sizeof(HEADER_802_11)); FrameLen = sizeof(HEADER_802_11); InsertActField(pAd, (pOutBuffer + FrameLen), &FrameLen, @@ -1349,10 +1349,10 @@ VOID EnqueueChSwAnn(IN PRTMP_ADAPTER pAd, return; } -static BOOLEAN DfsRequirementCheck(IN PRTMP_ADAPTER pAd, IN UINT8 Channel) +static BOOLEAN DfsRequirementCheck(IN PRTMP_ADAPTER pAd, u8 Channel) { BOOLEAN Result = FALSE; - INT i; + int i; do { /* check DFS procedure is running. */ @@ -1376,14 +1376,14 @@ static BOOLEAN DfsRequirementCheck(IN PRTMP_ADAPTER pAd, IN UINT8 Channel) return Result; } -VOID NotifyChSwAnnToPeerAPs(IN PRTMP_ADAPTER pAd, - IN PUCHAR pRA, - IN PUCHAR pTA, IN UINT8 ChSwMode, IN UINT8 Channel) +void NotifyChSwAnnToPeerAPs(IN PRTMP_ADAPTER pAd, + u8 *pRA, + u8 *pTA, u8 ChSwMode, u8 Channel) { } -static VOID StartDFSProcedure(IN PRTMP_ADAPTER pAd, - IN UCHAR Channel, IN UINT8 ChSwMode) +static void StartDFSProcedure(IN PRTMP_ADAPTER pAd, + u8 Channel, u8 ChSwMode) { /* start DFS procedure */ pAd->CommonCfg.Channel = Channel; @@ -1416,12 +1416,12 @@ static VOID StartDFSProcedure(IN PRTMP_ADAPTER pAd, 1 1 1 1 1 */ static BOOLEAN PeerChSwAnnSanity(IN PRTMP_ADAPTER pAd, - IN VOID * pMsg, - IN ULONG MsgLen, + void * pMsg, + unsigned long MsgLen, OUT PCH_SW_ANN_INFO pChSwAnnInfo) { PFRAME_802_11 Fr = (PFRAME_802_11) pMsg; - PUCHAR pFramePtr = Fr->Octet; + u8 *pFramePtr = Fr->Octet; BOOLEAN result = FALSE; PEID_STRUCT eid_ptr; @@ -1436,8 +1436,8 @@ static BOOLEAN PeerChSwAnnSanity(IN PRTMP_ADAPTER pAd, return result; eid_ptr = (PEID_STRUCT) pFramePtr; - while (((UCHAR *) eid_ptr + eid_ptr->Len + 1) < - ((PUCHAR) pFramePtr + MsgLen)) { + while (((u8 *) eid_ptr + eid_ptr->Len + 1) < + ((u8 *)pFramePtr + MsgLen)) { switch (eid_ptr->Eid) { case IE_CHANNEL_SWITCH_ANNOUNCEMENT: NdisMoveMemory(&pChSwAnnInfo->ChSwMode, eid_ptr->Octet, @@ -1453,7 +1453,7 @@ static BOOLEAN PeerChSwAnnSanity(IN PRTMP_ADAPTER pAd, default: break; } - eid_ptr = (PEID_STRUCT) ((UCHAR *) eid_ptr + 2 + eid_ptr->Len); + eid_ptr = (PEID_STRUCT) ((u8 *) eid_ptr + 2 + eid_ptr->Len); } return result; @@ -1473,19 +1473,19 @@ static BOOLEAN PeerChSwAnnSanity(IN PRTMP_ADAPTER pAd, ========================================================================== */ static BOOLEAN PeerMeasureReqSanity(IN PRTMP_ADAPTER pAd, - IN VOID * pMsg, - IN ULONG MsgLen, - OUT PUINT8 pDialogToken, + void * pMsg, + unsigned long MsgLen, + u8 *pDialogToken, OUT PMEASURE_REQ_INFO pMeasureReqInfo, OUT PMEASURE_REQ pMeasureReq) { PFRAME_802_11 Fr = (PFRAME_802_11) pMsg; - PUCHAR pFramePtr = Fr->Octet; + u8 *pFramePtr = Fr->Octet; BOOLEAN result = FALSE; PEID_STRUCT eid_ptr; - PUCHAR ptr; - UINT64 MeasureStartTime; - UINT16 MeasureDuration; + u8 *ptr; + u64 MeasureStartTime; + u16 MeasureDuration; /* skip 802.11 header. */ MsgLen -= sizeof(HEADER_802_11); @@ -1502,8 +1502,8 @@ static BOOLEAN PeerMeasureReqSanity(IN PRTMP_ADAPTER pAd, MsgLen -= 1; eid_ptr = (PEID_STRUCT) pFramePtr; - while (((UCHAR *) eid_ptr + eid_ptr->Len + 1) < - ((PUCHAR) pFramePtr + MsgLen)) { + while (((u8 *) eid_ptr + eid_ptr->Len + 1) < + ((u8 *)pFramePtr + MsgLen)) { switch (eid_ptr->Eid) { case IE_MEASUREMENT_REQUEST: NdisMoveMemory(&pMeasureReqInfo->Token, eid_ptr->Octet, @@ -1512,7 +1512,7 @@ static BOOLEAN PeerMeasureReqSanity(IN PRTMP_ADAPTER pAd, eid_ptr->Octet + 1, 1); NdisMoveMemory(&pMeasureReqInfo->ReqType, eid_ptr->Octet + 2, 1); - ptr = (PUCHAR) (eid_ptr->Octet + 3); + ptr = (u8 *)(eid_ptr->Octet + 3); NdisMoveMemory(&pMeasureReq->ChNum, ptr, 1); NdisMoveMemory(&MeasureStartTime, ptr + 1, 8); pMeasureReq->MeasureStartTime = @@ -1526,7 +1526,7 @@ static BOOLEAN PeerMeasureReqSanity(IN PRTMP_ADAPTER pAd, default: break; } - eid_ptr = (PEID_STRUCT) ((UCHAR *) eid_ptr + 2 + eid_ptr->Len); + eid_ptr = (PEID_STRUCT) ((u8 *) eid_ptr + 2 + eid_ptr->Len); } return result; @@ -1567,18 +1567,18 @@ static BOOLEAN PeerMeasureReqSanity(IN PRTMP_ADAPTER pAd, 0 1 2 3 4 5-7 */ static BOOLEAN PeerMeasureReportSanity(IN PRTMP_ADAPTER pAd, - IN VOID * pMsg, - IN ULONG MsgLen, - OUT PUINT8 pDialogToken, + void * pMsg, + unsigned long MsgLen, + u8 *pDialogToken, OUT PMEASURE_REPORT_INFO pMeasureReportInfo, - OUT PUINT8 pReportBuf) + u8 *pReportBuf) { PFRAME_802_11 Fr = (PFRAME_802_11) pMsg; - PUCHAR pFramePtr = Fr->Octet; + u8 *pFramePtr = Fr->Octet; BOOLEAN result = FALSE; PEID_STRUCT eid_ptr; - PUCHAR ptr; + u8 *ptr; /* skip 802.11 header. */ MsgLen -= sizeof(HEADER_802_11); @@ -1595,8 +1595,8 @@ static BOOLEAN PeerMeasureReportSanity(IN PRTMP_ADAPTER pAd, MsgLen -= 1; eid_ptr = (PEID_STRUCT) pFramePtr; - while (((UCHAR *) eid_ptr + eid_ptr->Len + 1) < - ((PUCHAR) pFramePtr + MsgLen)) { + while (((u8 *) eid_ptr + eid_ptr->Len + 1) < + ((u8 *)pFramePtr + MsgLen)) { switch (eid_ptr->Eid) { case IE_MEASUREMENT_REPORT: NdisMoveMemory(&pMeasureReportInfo->Token, @@ -1608,7 +1608,7 @@ static BOOLEAN PeerMeasureReportSanity(IN PRTMP_ADAPTER pAd, if (pMeasureReportInfo->ReportType == RM_BASIC) { PMEASURE_BASIC_REPORT pReport = (PMEASURE_BASIC_REPORT) pReportBuf; - ptr = (PUCHAR) (eid_ptr->Octet + 3); + ptr = (u8 *)(eid_ptr->Octet + 3); NdisMoveMemory(&pReport->ChNum, ptr, 1); NdisMoveMemory(&pReport->MeasureStartTime, ptr + 1, 8); @@ -1619,7 +1619,7 @@ static BOOLEAN PeerMeasureReportSanity(IN PRTMP_ADAPTER pAd, } else if (pMeasureReportInfo->ReportType == RM_CCA) { PMEASURE_CCA_REPORT pReport = (PMEASURE_CCA_REPORT) pReportBuf; - ptr = (PUCHAR) (eid_ptr->Octet + 3); + ptr = (u8 *)(eid_ptr->Octet + 3); NdisMoveMemory(&pReport->ChNum, ptr, 1); NdisMoveMemory(&pReport->MeasureStartTime, ptr + 1, 8); @@ -1632,7 +1632,7 @@ static BOOLEAN PeerMeasureReportSanity(IN PRTMP_ADAPTER pAd, RM_RPI_HISTOGRAM) { PMEASURE_RPI_REPORT pReport = (PMEASURE_RPI_REPORT) pReportBuf; - ptr = (PUCHAR) (eid_ptr->Octet + 3); + ptr = (u8 *)(eid_ptr->Octet + 3); NdisMoveMemory(&pReport->ChNum, ptr, 1); NdisMoveMemory(&pReport->MeasureStartTime, ptr + 1, 8); @@ -1647,7 +1647,7 @@ static BOOLEAN PeerMeasureReportSanity(IN PRTMP_ADAPTER pAd, default: break; } - eid_ptr = (PEID_STRUCT) ((UCHAR *) eid_ptr + 2 + eid_ptr->Len); + eid_ptr = (PEID_STRUCT) ((u8 *) eid_ptr + 2 + eid_ptr->Len); } return result; @@ -1667,11 +1667,11 @@ static BOOLEAN PeerMeasureReportSanity(IN PRTMP_ADAPTER pAd, ========================================================================== */ static BOOLEAN PeerTpcReqSanity(IN PRTMP_ADAPTER pAd, - IN VOID * pMsg, - IN ULONG MsgLen, OUT PUINT8 pDialogToken) + void * pMsg, + unsigned long MsgLen, u8 *pDialogToken) { PFRAME_802_11 Fr = (PFRAME_802_11) pMsg; - PUCHAR pFramePtr = Fr->Octet; + u8 *pFramePtr = Fr->Octet; BOOLEAN result = FALSE; PEID_STRUCT eid_ptr; @@ -1689,8 +1689,8 @@ static BOOLEAN PeerTpcReqSanity(IN PRTMP_ADAPTER pAd, MsgLen -= 1; eid_ptr = (PEID_STRUCT) pFramePtr; - while (((UCHAR *) eid_ptr + eid_ptr->Len + 1) < - ((PUCHAR) pFramePtr + MsgLen)) { + while (((u8 *) eid_ptr + eid_ptr->Len + 1) < + ((u8 *)pFramePtr + MsgLen)) { switch (eid_ptr->Eid) { case IE_TPC_REQUEST: result = TRUE; @@ -1699,7 +1699,7 @@ static BOOLEAN PeerTpcReqSanity(IN PRTMP_ADAPTER pAd, default: break; } - eid_ptr = (PEID_STRUCT) ((UCHAR *) eid_ptr + 2 + eid_ptr->Len); + eid_ptr = (PEID_STRUCT) ((u8 *) eid_ptr + 2 + eid_ptr->Len); } return result; @@ -1720,13 +1720,13 @@ static BOOLEAN PeerTpcReqSanity(IN PRTMP_ADAPTER pAd, ========================================================================== */ static BOOLEAN PeerTpcRepSanity(IN PRTMP_ADAPTER pAd, - IN VOID * pMsg, - IN ULONG MsgLen, - OUT PUINT8 pDialogToken, + void * pMsg, + unsigned long MsgLen, + u8 *pDialogToken, OUT PTPC_REPORT_INFO pTpcRepInfo) { PFRAME_802_11 Fr = (PFRAME_802_11) pMsg; - PUCHAR pFramePtr = Fr->Octet; + u8 *pFramePtr = Fr->Octet; BOOLEAN result = FALSE; PEID_STRUCT eid_ptr; @@ -1744,8 +1744,8 @@ static BOOLEAN PeerTpcRepSanity(IN PRTMP_ADAPTER pAd, MsgLen -= 1; eid_ptr = (PEID_STRUCT) pFramePtr; - while (((UCHAR *) eid_ptr + eid_ptr->Len + 1) < - ((PUCHAR) pFramePtr + MsgLen)) { + while (((u8 *) eid_ptr + eid_ptr->Len + 1) < + ((u8 *)pFramePtr + MsgLen)) { switch (eid_ptr->Eid) { case IE_TPC_REPORT: NdisMoveMemory(&pTpcRepInfo->TxPwr, eid_ptr->Octet, 1); @@ -1757,7 +1757,7 @@ static BOOLEAN PeerTpcRepSanity(IN PRTMP_ADAPTER pAd, default: break; } - eid_ptr = (PEID_STRUCT) ((UCHAR *) eid_ptr + 2 + eid_ptr->Len); + eid_ptr = (PEID_STRUCT) ((u8 *) eid_ptr + 2 + eid_ptr->Len); } return result; @@ -1774,12 +1774,12 @@ static BOOLEAN PeerTpcRepSanity(IN PRTMP_ADAPTER pAd, Return : None. ========================================================================== */ -static VOID PeerChSwAnnAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) +static void PeerChSwAnnAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) { CH_SW_ANN_INFO ChSwAnnInfo; PFRAME_802_11 pFr = (PFRAME_802_11) Elem->Msg; - UCHAR index = 0, Channel = 0, NewChannel = 0; - ULONG Bssidx = 0; + u8 index = 0, Channel = 0, NewChannel = 0; + unsigned long Bssidx = 0; NdisZeroMemory(&ChSwAnnInfo, sizeof(CH_SW_ANN_INFO)); if (!PeerChSwAnnSanity(pAd, Elem->Msg, Elem->MsgLen, &ChSwAnnInfo)) { @@ -1856,11 +1856,11 @@ static VOID PeerChSwAnnAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) Return : None. ========================================================================== */ -static VOID PeerMeasureReqAction(IN PRTMP_ADAPTER pAd, +static void PeerMeasureReqAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) { PFRAME_802_11 pFr = (PFRAME_802_11) Elem->Msg; - UINT8 DialogToken; + u8 DialogToken; MEASURE_REQ_INFO MeasureReqInfo; MEASURE_REQ MeasureReq; MEASURE_REPORT_MODE ReportMode; @@ -1889,13 +1889,13 @@ static VOID PeerMeasureReqAction(IN PRTMP_ADAPTER pAd, Return : None. ========================================================================== */ -static VOID PeerMeasureReportAction(IN PRTMP_ADAPTER pAd, +static void PeerMeasureReportAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) { MEASURE_REPORT_INFO MeasureReportInfo; PFRAME_802_11 pFr = (PFRAME_802_11) Elem->Msg; - UINT8 DialogToken; - PUINT8 pMeasureReportInfo; + u8 DialogToken; + u8 *pMeasureReportInfo; /* if (pAd->CommonCfg.bIEEE80211H != TRUE) */ /* return; */ @@ -1965,14 +1965,14 @@ static VOID PeerMeasureReportAction(IN PRTMP_ADAPTER pAd, Return : None. ========================================================================== */ -static VOID PeerTpcReqAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) +static void PeerTpcReqAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) { PFRAME_802_11 pFr = (PFRAME_802_11) Elem->Msg; - PUCHAR pFramePtr = pFr->Octet; - UINT8 DialogToken; - UINT8 TxPwr = GetCurTxPwr(pAd, Elem->Wcid); - UINT8 LinkMargin = 0; - CHAR RealRssi; + u8 *pFramePtr = pFr->Octet; + u8 DialogToken; + u8 TxPwr = GetCurTxPwr(pAd, Elem->Wcid); + u8 LinkMargin = 0; + char RealRssi; /* link margin: Ratio of the received signal power to the minimum desired by the station (STA). The */ /* STA may incorporate rate information and channel conditions, including interference, into its computation */ @@ -2007,9 +2007,9 @@ static VOID PeerTpcReqAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) Return : None. ========================================================================== */ -static VOID PeerTpcRepAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) +static void PeerTpcRepAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) { - UINT8 DialogToken; + u8 DialogToken; TPC_REPORT_INFO TpcRepInfo; PTPC_REQ_ENTRY pEntry = NULL; @@ -2040,10 +2040,10 @@ static VOID PeerTpcRepAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) Return : None. ========================================================================== */ -VOID PeerSpectrumAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) +void PeerSpectrumAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) { - UCHAR Action = Elem->Msg[LENGTH_802_11 + 1]; + u8 Action = Elem->Msg[LENGTH_802_11 + 1]; if (pAd->CommonCfg.bIEEE80211H != TRUE) return; @@ -2085,26 +2085,26 @@ VOID PeerSpectrumAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) Return : None. ========================================================================== */ -INT Set_MeasureReq_Proc(IN PRTMP_ADAPTER pAd, IN PSTRING arg) +int Set_MeasureReq_Proc(IN PRTMP_ADAPTER pAd, char *arg) { - UINT Aid = 1; - UINT ArgIdx; - PSTRING thisChar; + u32 Aid = 1; + u32 ArgIdx; + char *thisChar; MEASURE_REQ_MODE MeasureReqMode; - UINT8 MeasureReqToken = RandomByte(pAd); - UINT8 MeasureReqType = RM_BASIC; - UINT8 MeasureCh = 1; - UINT64 MeasureStartTime = GetCurrentTimeStamp(pAd); + u8 MeasureReqToken = RandomByte(pAd); + u8 MeasureReqType = RM_BASIC; + u8 MeasureCh = 1; + u64 MeasureStartTime = GetCurrentTimeStamp(pAd); MEASURE_REQ MeasureReq; - UINT8 TotalLen; + u8 TotalLen; HEADER_802_11 ActHdr; - PUCHAR pOutBuffer = NULL; - NDIS_STATUS NStatus; - ULONG FrameLen; + u8 *pOutBuffer = NULL; + int NStatus; + unsigned long FrameLen; - NStatus = MlmeAllocateMemory(pAd, (PVOID) & pOutBuffer); /*Get an unused nonpaged memory */ + NStatus = MlmeAllocateMemory(pAd, (void *)& pOutBuffer); /*Get an unused nonpaged memory */ if (NStatus != NDIS_STATUS_SUCCESS) { DBGPRINT(RT_DEBUG_TRACE, ("%s() allocate memory failed \n", __func__)); @@ -2115,7 +2115,7 @@ INT Set_MeasureReq_Proc(IN PRTMP_ADAPTER pAd, IN PSTRING arg) while ((thisChar = strsep((char **)&arg, "-")) != NULL) { switch (ArgIdx) { case 1: /* Aid. */ - Aid = (UINT8) simple_strtol(thisChar, 0, 16); + Aid = (u8)simple_strtol(thisChar, 0, 16); break; case 2: /* Measurement Request Type. */ @@ -2129,7 +2129,7 @@ INT Set_MeasureReq_Proc(IN PRTMP_ADAPTER pAd, IN PSTRING arg) break; case 3: /* Measurement channel. */ - MeasureCh = (UINT8) simple_strtol(thisChar, 0, 16); + MeasureCh = (u8)simple_strtol(thisChar, 0, 16); break; } ArgIdx++; @@ -2153,7 +2153,7 @@ INT Set_MeasureReq_Proc(IN PRTMP_ADAPTER pAd, IN PSTRING arg) MgtMacHeaderInit(pAd, &ActHdr, SUBTYPE_ACTION, 0, pAd->MacTab.Content[Aid].Addr, pAd->CurrentAddress); - NdisMoveMemory(pOutBuffer, (PCHAR) & ActHdr, sizeof(HEADER_802_11)); + NdisMoveMemory(pOutBuffer, (char *)& ActHdr, sizeof(HEADER_802_11)); FrameLen = sizeof(HEADER_802_11); TotalLen = sizeof(MEASURE_REQ_INFO) + sizeof(MEASURE_REQ); @@ -2168,14 +2168,14 @@ INT Set_MeasureReq_Proc(IN PRTMP_ADAPTER pAd, IN PSTRING arg) MeasureReq.MeasureDuration = cpu2le16(2000); { - ULONG TempLen; + unsigned long TempLen; MakeOutgoingFrame(pOutBuffer + FrameLen, &TempLen, sizeof(MEASURE_REQ), &MeasureReq, END_OF_ARGS); FrameLen += TempLen; } - MiniportMMRequest(pAd, QID_AC_BE, pOutBuffer, (UINT) FrameLen); + MiniportMMRequest(pAd, QID_AC_BE, pOutBuffer, (u32)FrameLen); END_OF_MEASURE_REQ: MlmeFreeMemory(pAd, pOutBuffer); @@ -2183,13 +2183,13 @@ END_OF_MEASURE_REQ: return TRUE; } -INT Set_TpcReq_Proc(IN PRTMP_ADAPTER pAd, IN PSTRING arg) +int Set_TpcReq_Proc(IN PRTMP_ADAPTER pAd, char *arg) { - UINT Aid; + u32 Aid; - UINT8 TpcReqToken = RandomByte(pAd); + u8 TpcReqToken = RandomByte(pAd); - Aid = (UINT) simple_strtol(arg, 0, 16); + Aid = (u32)simple_strtol(arg, 0, 16); DBGPRINT(RT_DEBUG_TRACE, ("%s::Aid = %d\n", __func__, Aid)); if (!VALID_WCID(Aid)) { |