diff options
author | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2009-12-11 20:23:15 (GMT) |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2009-12-11 20:23:15 (GMT) |
commit | 51126deb201c59cc8cdc4873e3d130d6bc60513d (patch) | |
tree | aae5d37bda36d40b6486021e5f2e4d8c7721dfba /drivers/staging/rt2860 | |
parent | cc27706961cbe2de1b2b1d1b498efa7b6f04a822 (diff) | |
download | linux-fsl-qoriq-51126deb201c59cc8cdc4873e3d130d6bc60513d.tar.xz |
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')
80 files changed, 6626 insertions, 6676 deletions
diff --git a/drivers/staging/rt2860/ap.h b/drivers/staging/rt2860/ap.h index c7ff694..fb6ab69 100644 --- a/drivers/staging/rt2860/ap.h +++ b/drivers/staging/rt2860/ap.h @@ -41,26 +41,26 @@ #define __AP_H__ /* ap_wpa.c */ -VOID WpaStateMachineInit(IN PRTMP_ADAPTER pAd, +void WpaStateMachineInit(IN PRTMP_ADAPTER pAd, IN STATE_MACHINE * Sm, OUT STATE_MACHINE_FUNC Trans[]); #ifdef RTMP_MAC_USB -VOID BeaconUpdateExec(IN PVOID SystemSpecific1, - IN PVOID FunctionContext, - IN PVOID SystemSpecific2, IN PVOID SystemSpecific3); +void BeaconUpdateExec(void *SystemSpecific1, + void *FunctionContext, + void *SystemSpecific2, void *SystemSpecific3); #endif /* RTMP_MAC_USB // */ -VOID RTMPSetPiggyBack(IN PRTMP_ADAPTER pAd, IN BOOLEAN bPiggyBack); +void RTMPSetPiggyBack(IN PRTMP_ADAPTER pAd, IN BOOLEAN bPiggyBack); -VOID MacTableReset(IN PRTMP_ADAPTER pAd); +void MacTableReset(IN PRTMP_ADAPTER pAd); MAC_TABLE_ENTRY *MacTableInsertEntry(IN PRTMP_ADAPTER pAd, - IN PUCHAR pAddr, - IN UCHAR apidx, IN BOOLEAN CleanAll); + u8 *pAddr, + u8 apidx, IN BOOLEAN CleanAll); BOOLEAN MacTableDeleteEntry(IN PRTMP_ADAPTER pAd, - IN USHORT wcid, IN PUCHAR pAddr); + u16 wcid, u8 *pAddr); -MAC_TABLE_ENTRY *MacTableLookup(IN PRTMP_ADAPTER pAd, IN PUCHAR pAddr); +MAC_TABLE_ENTRY *MacTableLookup(IN PRTMP_ADAPTER pAd, u8 *pAddr); #endif /* __AP_H__ */ diff --git a/drivers/staging/rt2860/chip/mac_pci.h b/drivers/staging/rt2860/chip/mac_pci.h index 34f7b9a..2d55327 100644 --- a/drivers/staging/rt2860/chip/mac_pci.h +++ b/drivers/staging/rt2860/chip/mac_pci.h @@ -71,24 +71,24 @@ // typedef struct PACKED _TXD_STRUC { // Word 0 - UINT32 SDPtr0; + u32 SDPtr0; // Word 1 - UINT32 SDLen1:14; - UINT32 LastSec1:1; - UINT32 Burst:1; - UINT32 SDLen0:14; - UINT32 LastSec0:1; - UINT32 DMADONE:1; + u32 SDLen1:14; + u32 LastSec1:1; + u32 Burst:1; + u32 SDLen0:14; + u32 LastSec0:1; + u32 DMADONE:1; //Word2 - UINT32 SDPtr1; + u32 SDPtr1; //Word3 - UINT32 rsv2:24; - UINT32 WIV:1; // Wireless Info Valid. 1 if Driver already fill WI, o if DMA needs to copy WI to correctposition - UINT32 QSEL:2; // select on-chip FIFO ID for 2nd-stage output scheduler.0:MGMT, 1:HCCA 2:EDCA - UINT32 rsv:2; - UINT32 TCO:1; // - UINT32 UCO:1; // - UINT32 ICO:1; // + u32 rsv2:24; + u32 WIV:1; /* Wireless Info Valid. 1 if Driver already fill WI, o if DMA needs to copy WI to correctposition */ + u32 QSEL:2; /* select on-chip FIFO ID for 2nd-stage output scheduler.0:MGMT, 1:HCCA 2:EDCA */ + u32 rsv:2; + u32 TCO:1; /* */ + u32 UCO:1; /* */ + u32 ICO:1; /* */ } TXD_STRUC, *PTXD_STRUC; // @@ -96,47 +96,47 @@ typedef struct PACKED _TXD_STRUC { // typedef struct PACKED _RXD_STRUC { // Word 0 - UINT32 SDP0; + u32 SDP0; // Word 1 - UINT32 SDL1:14; - UINT32 Rsv:2; - UINT32 SDL0:14; - UINT32 LS0:1; - UINT32 DDONE:1; + u32 SDL1:14; + u32 Rsv:2; + u32 SDL0:14; + u32 LS0:1; + u32 DDONE:1; // Word 2 - UINT32 SDP1; + u32 SDP1; // Word 3 - UINT32 BA:1; - UINT32 DATA:1; - UINT32 NULLDATA:1; - UINT32 FRAG:1; - UINT32 U2M:1; // 1: this RX frame is unicast to me - UINT32 Mcast:1; // 1: this is a multicast frame - UINT32 Bcast:1; // 1: this is a broadcast frame - UINT32 MyBss:1; // 1: this frame belongs to the same BSSID - UINT32 Crc:1; // 1: CRC error - UINT32 CipherErr:2; // 0: decryption okay, 1:ICV error, 2:MIC error, 3:KEY not valid - UINT32 AMSDU:1; // rx with 802.3 header, not 802.11 header. - UINT32 HTC:1; - UINT32 RSSI:1; - UINT32 L2PAD:1; - UINT32 AMPDU:1; - UINT32 Decrypted:1; // this frame is being decrypted. - UINT32 PlcpSignal:1; // To be moved - UINT32 PlcpRssil:1; // To be moved - UINT32 Rsv1:13; + u32 BA:1; + u32 DATA:1; + u32 NULLDATA:1; + u32 FRAG:1; + u32 U2M:1; /* 1: this RX frame is unicast to me */ + u32 Mcast:1; /* 1: this is a multicast frame */ + u32 Bcast:1; /* 1: this is a broadcast frame */ + u32 MyBss:1; /* 1: this frame belongs to the same BSSID */ + u32 Crc:1; /* 1: CRC error */ + u32 CipherErr:2; /* 0: decryption okay, 1:ICV error, 2:MIC error, 3:KEY not valid */ + u32 AMSDU:1; /* rx with 802.3 header, not 802.11 header. */ + u32 HTC:1; + u32 RSSI:1; + u32 L2PAD:1; + u32 AMPDU:1; + u32 Decrypted:1; /* this frame is being decrypted. */ + u32 PlcpSignal:1; /* To be moved */ + u32 PlcpRssil:1; /* To be moved */ + u32 Rsv1:13; } RXD_STRUC, *PRXD_STRUC, RT28XX_RXD_STRUC, *PRT28XX_RXD_STRUC; typedef union _TX_ATTENUATION_CTRL_STRUC { struct { - ULONG RF_ISOLATION_ENABLE:1; - ULONG Reserve2:7; - ULONG PCIE_PHY_TX_ATTEN_VALUE:3; - ULONG PCIE_PHY_TX_ATTEN_EN:1; - ULONG Reserve1:20; + unsigned long RF_ISOLATION_ENABLE:1; + unsigned long Reserve2:7; + unsigned long PCIE_PHY_TX_ATTEN_VALUE:3; + unsigned long PCIE_PHY_TX_ATTEN_EN:1; + unsigned long Reserve1:20; } field; - ULONG word; + unsigned long word; } TX_ATTENUATION_CTRL_STRUC, *PTX_ATTENUATION_CTRL_STRUC; /* ----------------- EEPROM Related MACRO ----------------- */ @@ -148,7 +148,7 @@ typedef union _TX_ATTENUATION_CTRL_STRUC { /* ----------------- Frimware Related MACRO ----------------- */ #define RTMP_WRITE_FIRMWARE(_pAd, _pFwImage, _FwLen) \ do{ \ - ULONG _i, _firm; \ + unsigned long _i, _firm; \ RTMP_IO_WRITE32(_pAd, PBF_SYS_CTRL, 0x10000); \ \ for(_i=0; _i<_FwLen; _i+=4) \ @@ -172,7 +172,7 @@ typedef union _TX_ATTENUATION_CTRL_STRUC { #define RTMP_STOP_DEQUEUE(pAd, QueIdx, irqFlags) do{}while(0) #define RTMP_HAS_ENOUGH_FREE_DESC(pAd, pTxBlk, freeNum, pPacket) \ - ((freeNum) >= (ULONG)(pTxBlk->TotalFragNum + RTMP_GET_PACKET_FRAGMENTS(pPacket) + 3)) /* rough estimate we will use 3 more descriptor. */ + ((freeNum) >= (unsigned long)(pTxBlk->TotalFragNum + RTMP_GET_PACKET_FRAGMENTS(pPacket) + 3)) /* rough estimate we will use 3 more descriptor. */ #define RTMP_RELEASE_DESC_RESOURCE(pAd, QueIdx) \ do{}while(0) @@ -238,7 +238,7 @@ typedef union _TX_ATTENUATION_CTRL_STRUC { // remove Pair-wise key material from ASIC #define RTMP_STA_ENTRY_KEY_DEL(pAd, BssIdx, Wcid) \ - AsicRemovePairwiseKeyEntry(pAd, BssIdx, (UCHAR)Wcid); + AsicRemovePairwiseKeyEntry(pAd, BssIdx, (u8)Wcid); // add Client security information into ASIC WCID table and IVEIV table #define RTMP_STA_SECURITY_INFO_ADD(pAd, apidx, KeyID, pEntry) \ @@ -260,7 +260,7 @@ typedef union _TX_ATTENUATION_CTRL_STRUC { // Insert the BA bitmap to ASIC for the Wcid entry #define RTMP_ADD_BA_SESSION_TO_ASIC(_pAd, _Aid, _TID) \ do{ \ - UINT32 _Value = 0, _Offset; \ + u32 _Value = 0, _Offset; \ _Offset = MAC_WCID_BASE + (_Aid) * HW_WCID_ENTRY_SIZE + 4; \ RTMP_IO_READ32((_pAd), _Offset, &_Value);\ _Value |= (0x10000<<(_TID)); \ @@ -271,7 +271,7 @@ typedef union _TX_ATTENUATION_CTRL_STRUC { // bitmap field starts at 0x10000 in ASIC WCID table #define RTMP_DEL_BA_SESSION_FROM_ASIC(_pAd, _Wcid, _TID) \ do{ \ - UINT32 _Value = 0, _Offset; \ + u32 _Value = 0, _Offset; \ _Offset = MAC_WCID_BASE + (_Wcid) * HW_WCID_ENTRY_SIZE + 4; \ RTMP_IO_READ32((_pAd), _Offset, &_Value); \ _Value &= (~(0x10000 << (_TID))); \ diff --git a/drivers/staging/rt2860/chip/mac_usb.h b/drivers/staging/rt2860/chip/mac_usb.h index fe7ba28..b902074 100644 --- a/drivers/staging/rt2860/chip/mac_usb.h +++ b/drivers/staging/rt2860/chip/mac_usb.h @@ -62,26 +62,26 @@ #define RT2870_RXDMALEN_FIELD_SIZE 4 typedef struct PACKED _RXINFO_STRUC { - UINT32 BA:1; - UINT32 DATA:1; - UINT32 NULLDATA:1; - UINT32 FRAG:1; - UINT32 U2M:1; /* 1: this RX frame is unicast to me */ - UINT32 Mcast:1; /* 1: this is a multicast frame */ - UINT32 Bcast:1; /* 1: this is a broadcast frame */ - UINT32 MyBss:1; /* 1: this frame belongs to the same BSSID */ - UINT32 Crc:1; /* 1: CRC error */ - UINT32 CipherErr:2; /* 0: decryption okay, 1:ICV error, 2:MIC error, 3:KEY not valid */ - UINT32 AMSDU:1; /* rx with 802.3 header, not 802.11 header. */ - UINT32 HTC:1; - UINT32 RSSI:1; - UINT32 L2PAD:1; - UINT32 AMPDU:1; /* To be moved */ - UINT32 Decrypted:1; - UINT32 PlcpRssil:1; - UINT32 CipherAlg:1; - UINT32 LastAMSDU:1; - UINT32 PlcpSignal:12; + u32 BA:1; + u32 DATA:1; + u32 NULLDATA:1; + u32 FRAG:1; + u32 U2M:1; /* 1: this RX frame is unicast to me */ + u32 Mcast:1; /* 1: this is a multicast frame */ + u32 Bcast:1; /* 1: this is a broadcast frame */ + u32 MyBss:1; /* 1: this frame belongs to the same BSSID */ + u32 Crc:1; /* 1: CRC error */ + u32 CipherErr:2; /* 0: decryption okay, 1:ICV error, 2:MIC error, 3:KEY not valid */ + u32 AMSDU:1; /* rx with 802.3 header, not 802.11 header. */ + u32 HTC:1; + u32 RSSI:1; + u32 L2PAD:1; + u32 AMPDU:1; /* To be moved */ + u32 Decrypted:1; + u32 PlcpRssil:1; + u32 CipherAlg:1; + u32 LastAMSDU:1; + u32 PlcpSignal:12; } RXINFO_STRUC, *PRXINFO_STRUC, RT28XX_RXD_STRUC, *PRT28XX_RXD_STRUC; /* */ @@ -91,14 +91,14 @@ typedef struct PACKED _RXINFO_STRUC { typedef struct _TXINFO_STRUC { /* Word 0 */ - UINT32 USBDMATxPktLen:16; /*used ONLY in USB bulk Aggregation, Total byte counts of all sub-frame. */ - UINT32 rsv:8; - UINT32 WIV:1; /* Wireless Info Valid. 1 if Driver already fill WI, o if DMA needs to copy WI to correctposition */ - UINT32 QSEL:2; /* select on-chip FIFO ID for 2nd-stage output scheduler.0:MGMT, 1:HCCA 2:EDCA */ - UINT32 SwUseLastRound:1; /* Software use. */ - UINT32 rsv2:2; /* Software use. */ - UINT32 USBDMANextVLD:1; /*used ONLY in USB bulk Aggregation, NextValid */ - UINT32 USBDMATxburst:1; /*used ONLY in USB bulk Aggre. Force USB DMA transmit frame from current selected endpoint */ + u32 USBDMATxPktLen:16; /*used ONLY in USB bulk Aggregation, Total byte counts of all sub-frame. */ + u32 rsv:8; + u32 WIV:1; /* Wireless Info Valid. 1 if Driver already fill WI, o if DMA needs to copy WI to correctposition */ + u32 QSEL:2; /* select on-chip FIFO ID for 2nd-stage output scheduler.0:MGMT, 1:HCCA 2:EDCA */ + u32 SwUseLastRound:1; /* Software use. */ + u32 rsv2:2; /* Software use. */ + u32 USBDMANextVLD:1; /*used ONLY in USB bulk Aggregation, NextValid */ + u32 USBDMATxburst:1; /*used ONLY in USB bulk Aggre. Force USB DMA transmit frame from current selected endpoint */ } TXINFO_STRUC, *PTXINFO_STRUC; /* */ @@ -106,8 +106,8 @@ typedef struct _TXINFO_STRUC { /* */ typedef struct _MGMT_STRUC { BOOLEAN Valid; - PUCHAR pBuffer; - ULONG Length; + u8 *pBuffer; + unsigned long Length; } MGMT_STRUC, *PMGMT_STRUC; /*////////////////////////////////////////////////////////////////////////// */ @@ -115,69 +115,69 @@ typedef struct _MGMT_STRUC { /*////////////////////////////////////////////////////////////////////////// */ typedef struct __TX_BUFFER { union { - UCHAR WirelessPacket[TX_BUFFER_NORMSIZE]; + u8 WirelessPacket[TX_BUFFER_NORMSIZE]; HEADER_802_11 NullFrame; PSPOLL_FRAME PsPollPacket; RTS_FRAME RTSFrame; } field; - UCHAR Aggregation[4]; /*Buffer for save Aggregation size. */ + u8 Aggregation[4]; /*Buffer for save Aggregation size. */ } TX_BUFFER, *PTX_BUFFER; typedef struct __HTTX_BUFFER { union { - UCHAR WirelessPacket[MAX_TXBULK_SIZE]; + u8 WirelessPacket[MAX_TXBULK_SIZE]; HEADER_802_11 NullFrame; PSPOLL_FRAME PsPollPacket; RTS_FRAME RTSFrame; } field; - UCHAR Aggregation[4]; /*Buffer for save Aggregation size. */ + u8 Aggregation[4]; /*Buffer for save Aggregation size. */ } HTTX_BUFFER, *PHTTX_BUFFER; /* used to track driver-generated write irps */ typedef struct _TX_CONTEXT { - PVOID pAd; /*Initialized in MiniportInitialize */ + void *pAd; /*Initialized in MiniportInitialize */ PURB pUrb; /*Initialized in MiniportInitialize */ PIRP pIrp; /*used to cancel pending bulk out. */ /*Initialized in MiniportInitialize */ PTX_BUFFER TransferBuffer; /*Initialized in MiniportInitialize */ - ULONG BulkOutSize; - UCHAR BulkOutPipeId; - UCHAR SelfIdx; + unsigned long BulkOutSize; + u8 BulkOutPipeId; + u8 SelfIdx; BOOLEAN InUse; BOOLEAN bWaitingBulkOut; /* at least one packet is in this TxContext, ready for making IRP anytime. */ BOOLEAN bFullForBulkOut; /* all tx buffer are full , so waiting for tx bulkout. */ BOOLEAN IRPPending; BOOLEAN LastOne; BOOLEAN bAggregatible; - UCHAR Header_802_3[LENGTH_802_3]; - UCHAR Rsv[2]; - ULONG DataOffset; - UINT TxRate; + u8 Header_802_3[LENGTH_802_3]; + u8 Rsv[2]; + unsigned long DataOffset; + u32 TxRate; dma_addr_t data_dma; /* urb dma on linux */ } TX_CONTEXT, *PTX_CONTEXT, **PPTX_CONTEXT; /* used to track driver-generated write irps */ typedef struct _HT_TX_CONTEXT { - PVOID pAd; /*Initialized in MiniportInitialize */ + void *pAd; /*Initialized in MiniportInitialize */ PURB pUrb; /*Initialized in MiniportInitialize */ PIRP pIrp; /*used to cancel pending bulk out. */ /*Initialized in MiniportInitialize */ PHTTX_BUFFER TransferBuffer; /*Initialized in MiniportInitialize */ - ULONG BulkOutSize; /* Indicate the total bulk-out size in bytes in one bulk-transmission */ - UCHAR BulkOutPipeId; + unsigned long BulkOutSize; /* Indicate the total bulk-out size in bytes in one bulk-transmission */ + u8 BulkOutPipeId; BOOLEAN IRPPending; BOOLEAN LastOne; BOOLEAN bCurWriting; BOOLEAN bRingEmpty; BOOLEAN bCopySavePad; - UCHAR SavedPad[8]; - UCHAR Header_802_3[LENGTH_802_3]; - ULONG CurWritePosition; /* Indicate the buffer offset which packet will be inserted start from. */ - ULONG CurWriteRealPos; /* Indicate the buffer offset which packet now are writing to. */ - ULONG NextBulkOutPosition; /* Indicate the buffer start offset of a bulk-transmission */ - ULONG ENextBulkOutPosition; /* Indicate the buffer end offset of a bulk-transmission */ - UINT TxRate; + u8 SavedPad[8]; + u8 Header_802_3[LENGTH_802_3]; + unsigned long CurWritePosition; /* Indicate the buffer offset which packet will be inserted start from. */ + unsigned long CurWriteRealPos; /* Indicate the buffer offset which packet now are writing to. */ + unsigned long NextBulkOutPosition; /* Indicate the buffer start offset of a bulk-transmission */ + unsigned long ENextBulkOutPosition; /* Indicate the buffer end offset of a bulk-transmission */ + u32 TxRate; dma_addr_t data_dma; /* urb dma on linux */ } HT_TX_CONTEXT, *PHT_TX_CONTEXT, **PPHT_TX_CONTEXT; @@ -186,12 +186,12 @@ typedef struct _HT_TX_CONTEXT { /* receive data to the protocol. */ /* */ typedef struct _RX_CONTEXT { - PUCHAR TransferBuffer; - PVOID pAd; + u8 *TransferBuffer; + void *pAd; PIRP pIrp; /*used to cancel pending bulk in. */ PURB pUrb; /*These 2 Boolean shouldn't both be 1 at the same time. */ - ULONG BulkInOffset; /* number of packets waiting for reordering . */ + unsigned long BulkInOffset; /* number of packets waiting for reordering . */ /* BOOLEAN ReorderInUse; // At least one packet in this buffer are in reordering buffer and wait for receive indication */ BOOLEAN bRxHandling; /* Notify this packet is being process now. */ BOOLEAN InUse; /* USB Hardware Occupied. Wait for USB HW to put packet. */ @@ -332,9 +332,9 @@ typedef struct _RX_CONTEXT { MlmeSetPsmBit(_pAd, _val);\ else \ { \ - USHORT _psm_val; \ + u16 _psm_val; \ _psm_val = _val; \ - RTUSBEnqueueInternalCmd(_pAd, CMDTHREAD_SET_PSM_BIT, &(_psm_val), sizeof(USHORT)); \ + RTUSBEnqueueInternalCmd(_pAd, CMDTHREAD_SET_PSM_BIT, &(_psm_val), sizeof(u16)); \ }\ } diff --git a/drivers/staging/rt2860/chip/rt30xx.h b/drivers/staging/rt2860/chip/rt30xx.h index 477a205..04c92ab 100644 --- a/drivers/staging/rt2860/chip/rt30xx.h +++ b/drivers/staging/rt2860/chip/rt30xx.h @@ -40,7 +40,7 @@ #ifdef RT30xx extern REG_PAIR RT30xx_RFRegTable[]; -extern UCHAR NUM_RF_REG_PARMS; +extern u8 NUM_RF_REG_PARMS; #endif /* RT30xx // */ diff --git a/drivers/staging/rt2860/chip/rtmp_mac.h b/drivers/staging/rt2860/chip/rtmp_mac.h index dac1577..5efe501 100644 --- a/drivers/staging/rt2860/chip/rtmp_mac.h +++ b/drivers/staging/rt2860/chip/rtmp_mac.h @@ -57,37 +57,37 @@ typedef struct PACKED _TXWI_STRUC { /* Word 0 */ /* ex: 00 03 00 40 means txop = 3, PHYMODE = 1 */ - UINT32 FRAG:1; /* 1 to inform TKIP engine this is a fragment. */ - UINT32 MIMOps:1; /* the remote peer is in dynamic MIMO-PS mode */ - UINT32 CFACK:1; - UINT32 TS:1; - - UINT32 AMPDU:1; - UINT32 MpduDensity:3; - UINT32 txop:2; /*FOR "THIS" frame. 0:HT TXOP rule , 1:PIFS TX ,2:Backoff, 3:sifs only when previous frame exchange is successful. */ - UINT32 rsv:6; - - UINT32 MCS:7; - UINT32 BW:1; /*channel bandwidth 20MHz or 40 MHz */ - UINT32 ShortGI:1; - UINT32 STBC:2; /* 1: STBC support MCS =0-7, 2,3 : RESERVE */ - UINT32 Ifs:1; /* */ -/* UINT32 rsv2:2; //channel bandwidth 20MHz or 40 MHz */ - UINT32 rsv2:1; - UINT32 TxBF:1; /* 3*3 */ - UINT32 PHYMODE:2; + u32 FRAG:1; /* 1 to inform TKIP engine this is a fragment. */ + u32 MIMOps:1; /* the remote peer is in dynamic MIMO-PS mode */ + u32 CFACK:1; + u32 TS:1; + + u32 AMPDU:1; + u32 MpduDensity:3; + u32 txop:2; /*FOR "THIS" frame. 0:HT TXOP rule , 1:PIFS TX ,2:Backoff, 3:sifs only when previous frame exchange is successful. */ + u32 rsv:6; + + u32 MCS:7; + u32 BW:1; /*channel bandwidth 20MHz or 40 MHz */ + u32 ShortGI:1; + u32 STBC:2; /* 1: STBC support MCS =0-7, 2,3 : RESERVE */ + u32 Ifs:1; /* */ +/* u32 rsv2:2; //channel bandwidth 20MHz or 40 MHz */ + u32 rsv2:1; + u32 TxBF:1; /* 3*3 */ + u32 PHYMODE:2; /* Word1 */ /* ex: 1c ff 38 00 means ACK=0, BAWinSize=7, MPDUtotalByteCount = 0x38 */ - UINT32 ACK:1; - UINT32 NSEQ:1; - UINT32 BAWinSize:6; - UINT32 WirelessCliID:8; - UINT32 MPDUtotalByteCount:12; - UINT32 PacketId:4; + u32 ACK:1; + u32 NSEQ:1; + u32 BAWinSize:6; + u32 WirelessCliID:8; + u32 MPDUtotalByteCount:12; + u32 PacketId:4; /*Word2 */ - UINT32 IV; + u32 IV; /*Word3 */ - UINT32 EIV; + u32 EIV; } TXWI_STRUC, *PTXWI_STRUC; /* */ @@ -95,32 +95,32 @@ typedef struct PACKED _TXWI_STRUC { /* */ typedef struct PACKED _RXWI_STRUC { /* Word 0 */ - UINT32 WirelessCliID:8; - UINT32 KeyIndex:2; - UINT32 BSSID:3; - UINT32 UDF:3; - UINT32 MPDUtotalByteCount:12; - UINT32 TID:4; + u32 WirelessCliID:8; + u32 KeyIndex:2; + u32 BSSID:3; + u32 UDF:3; + u32 MPDUtotalByteCount:12; + u32 TID:4; /* Word 1 */ - UINT32 FRAG:4; - UINT32 SEQUENCE:12; - UINT32 MCS:7; - UINT32 BW:1; - UINT32 ShortGI:1; - UINT32 STBC:2; - UINT32 rsv:3; - UINT32 PHYMODE:2; /* 1: this RX frame is unicast to me */ + u32 FRAG:4; + u32 SEQUENCE:12; + u32 MCS:7; + u32 BW:1; + u32 ShortGI:1; + u32 STBC:2; + u32 rsv:3; + u32 PHYMODE:2; /* 1: this RX frame is unicast to me */ /*Word2 */ - UINT32 RSSI0:8; - UINT32 RSSI1:8; - UINT32 RSSI2:8; - UINT32 rsv1:8; + u32 RSSI0:8; + u32 RSSI1:8; + u32 RSSI2:8; + u32 rsv1:8; /*Word3 */ - UINT32 SNR0:8; - UINT32 SNR1:8; - UINT32 FOFFSET:8; /* RT35xx */ - UINT32 rsv2:8; - /*UINT32 rsv2:16; */ + u32 SNR0:8; + u32 SNR1:8; + u32 FOFFSET:8; /* RT35xx */ + u32 rsv2:8; + /*u32 rsv2:16; */ } RXWI_STRUC, *PRXWI_STRUC; /* ================================================================================= */ @@ -136,27 +136,27 @@ typedef struct PACKED _RXWI_STRUC { #define INT_SOURCE_CSR 0x200 typedef union _INT_SOURCE_CSR_STRUC { struct { - UINT32 RxDelayINT:1; - UINT32 TxDelayINT:1; - UINT32 RxDone:1; - UINT32 Ac0DmaDone:1; /*4 */ - UINT32 Ac1DmaDone:1; - UINT32 Ac2DmaDone:1; - UINT32 Ac3DmaDone:1; - UINT32 HccaDmaDone:1; /* bit7 */ - UINT32 MgmtDmaDone:1; - UINT32 MCUCommandINT:1; /*bit 9 */ - UINT32 RxTxCoherent:1; - UINT32 TBTTInt:1; - UINT32 PreTBTT:1; - UINT32 TXFifoStatusInt:1; /*FIFO Statistics is full, sw should read 0x171c */ - UINT32 AutoWakeup:1; /*bit14 */ - UINT32 GPTimer:1; - UINT32 RxCoherent:1; /*bit16 */ - UINT32 TxCoherent:1; - UINT32:14; + u32 RxDelayINT:1; + u32 TxDelayINT:1; + u32 RxDone:1; + u32 Ac0DmaDone:1; /*4 */ + u32 Ac1DmaDone:1; + u32 Ac2DmaDone:1; + u32 Ac3DmaDone:1; + u32 HccaDmaDone:1; /* bit7 */ + u32 MgmtDmaDone:1; + u32 MCUCommandINT:1; /*bit 9 */ + u32 RxTxCoherent:1; + u32 TBTTInt:1; + u32 PreTBTT:1; + u32 TXFifoStatusInt:1; /*FIFO Statistics is full, sw should read 0x171c */ + u32 AutoWakeup:1; /*bit14 */ + u32 GPTimer:1; + u32 RxCoherent:1; /*bit16 */ + u32 TxCoherent:1; + u32 : 14; } field; - UINT32 word; + u32 word; } INT_SOURCE_CSR_STRUC, *PINT_SOURCE_CSR_STRUC; /* */ @@ -165,76 +165,76 @@ typedef union _INT_SOURCE_CSR_STRUC { #define INT_MASK_CSR 0x204 typedef union _INT_MASK_CSR_STRUC { struct { - UINT32 RXDelay_INT_MSK:1; - UINT32 TxDelay:1; - UINT32 RxDone:1; - UINT32 Ac0DmaDone:1; - UINT32 Ac1DmaDone:1; - UINT32 Ac2DmaDone:1; - UINT32 Ac3DmaDone:1; - UINT32 HccaDmaDone:1; - UINT32 MgmtDmaDone:1; - UINT32 MCUCommandINT:1; - UINT32:20; - UINT32 RxCoherent:1; - UINT32 TxCoherent:1; + u32 RXDelay_INT_MSK:1; + u32 TxDelay:1; + u32 RxDone:1; + u32 Ac0DmaDone:1; + u32 Ac1DmaDone:1; + u32 Ac2DmaDone:1; + u32 Ac3DmaDone:1; + u32 HccaDmaDone:1; + u32 MgmtDmaDone:1; + u32 MCUCommandINT:1; + u32 : 20; + u32 RxCoherent:1; + u32 TxCoherent:1; } field; - UINT32 word; + u32 word; } INT_MASK_CSR_STRUC, *PINT_MASK_CSR_STRUC; #define WPDMA_GLO_CFG 0x208 typedef union _WPDMA_GLO_CFG_STRUC { struct { - UINT32 EnableTxDMA:1; - UINT32 TxDMABusy:1; - UINT32 EnableRxDMA:1; - UINT32 RxDMABusy:1; - UINT32 WPDMABurstSIZE:2; - UINT32 EnTXWriteBackDDONE:1; - UINT32 BigEndian:1; - UINT32 RXHdrScater:8; - UINT32 HDR_SEG_LEN:16; + u32 EnableTxDMA:1; + u32 TxDMABusy:1; + u32 EnableRxDMA:1; + u32 RxDMABusy:1; + u32 WPDMABurstSIZE:2; + u32 EnTXWriteBackDDONE:1; + u32 BigEndian:1; + u32 RXHdrScater:8; + u32 HDR_SEG_LEN:16; } field; - UINT32 word; + u32 word; } WPDMA_GLO_CFG_STRUC, *PWPDMA_GLO_CFG_STRUC; #define WPDMA_RST_IDX 0x20c typedef union _WPDMA_RST_IDX_STRUC { struct { - UINT32 RST_DTX_IDX0:1; - UINT32 RST_DTX_IDX1:1; - UINT32 RST_DTX_IDX2:1; - UINT32 RST_DTX_IDX3:1; - UINT32 RST_DTX_IDX4:1; - UINT32 RST_DTX_IDX5:1; - UINT32 rsv:10; - UINT32 RST_DRX_IDX0:1; - UINT32:15; + u32 RST_DTX_IDX0:1; + u32 RST_DTX_IDX1:1; + u32 RST_DTX_IDX2:1; + u32 RST_DTX_IDX3:1; + u32 RST_DTX_IDX4:1; + u32 RST_DTX_IDX5:1; + u32 rsv:10; + u32 RST_DRX_IDX0:1; + u32 : 15; } field; - UINT32 word; + u32 word; } WPDMA_RST_IDX_STRUC, *PWPDMA_RST_IDX_STRUC; #define DELAY_INT_CFG 0x0210 typedef union _DELAY_INT_CFG_STRUC { struct { - UINT32 RXMAX_PTIME:8; - UINT32 RXMAX_PINT:7; - UINT32 RXDLY_INT_EN:1; - UINT32 TXMAX_PTIME:8; - UINT32 TXMAX_PINT:7; - UINT32 TXDLY_INT_EN:1; + u32 RXMAX_PTIME:8; + u32 RXMAX_PINT:7; + u32 RXDLY_INT_EN:1; + u32 TXMAX_PTIME:8; + u32 TXMAX_PINT:7; + u32 TXDLY_INT_EN:1; } field; - UINT32 word; + u32 word; } DELAY_INT_CFG_STRUC, *PDELAY_INT_CFG_STRUC; #define WMM_AIFSN_CFG 0x0214 typedef union _AIFSN_CSR_STRUC { struct { - UINT32 Aifsn0:4; /* for AC_BE */ - UINT32 Aifsn1:4; /* for AC_BK */ - UINT32 Aifsn2:4; /* for AC_VI */ - UINT32 Aifsn3:4; /* for AC_VO */ - UINT32 Rsv:16; + u32 Aifsn0:4; /* for AC_BE */ + u32 Aifsn1:4; /* for AC_BK */ + u32 Aifsn2:4; /* for AC_VI */ + u32 Aifsn3:4; /* for AC_VO */ + u32 Rsv:16; } field; - UINT32 word; + u32 word; } AIFSN_CSR_STRUC, *PAIFSN_CSR_STRUC; /* */ /* CWMIN_CSR: CWmin for each EDCA AC */ @@ -242,13 +242,13 @@ typedef union _AIFSN_CSR_STRUC { #define WMM_CWMIN_CFG 0x0218 typedef union _CWMIN_CSR_STRUC { struct { - UINT32 Cwmin0:4; /* for AC_BE */ - UINT32 Cwmin1:4; /* for AC_BK */ - UINT32 Cwmin2:4; /* for AC_VI */ - UINT32 Cwmin3:4; /* for AC_VO */ - UINT32 Rsv:16; + u32 Cwmin0:4; /* for AC_BE */ + u32 Cwmin1:4; /* for AC_BK */ + u32 Cwmin2:4; /* for AC_VI */ + u32 Cwmin3:4; /* for AC_VO */ + u32 Rsv:16; } field; - UINT32 word; + u32 word; } CWMIN_CSR_STRUC, *PCWMIN_CSR_STRUC; /* */ @@ -257,13 +257,13 @@ typedef union _CWMIN_CSR_STRUC { #define WMM_CWMAX_CFG 0x021c typedef union _CWMAX_CSR_STRUC { struct { - UINT32 Cwmax0:4; /* for AC_BE */ - UINT32 Cwmax1:4; /* for AC_BK */ - UINT32 Cwmax2:4; /* for AC_VI */ - UINT32 Cwmax3:4; /* for AC_VO */ - UINT32 Rsv:16; + u32 Cwmax0:4; /* for AC_BE */ + u32 Cwmax1:4; /* for AC_BK */ + u32 Cwmax2:4; /* for AC_VI */ + u32 Cwmax3:4; /* for AC_VO */ + u32 Rsv:16; } field; - UINT32 word; + u32 word; } CWMAX_CSR_STRUC, *PCWMAX_CSR_STRUC; /* */ @@ -272,10 +272,10 @@ typedef union _CWMAX_CSR_STRUC { #define WMM_TXOP0_CFG 0x0220 typedef union _AC_TXOP_CSR0_STRUC { struct { - USHORT Ac0Txop; /* for AC_BK, in unit of 32us */ - USHORT Ac1Txop; /* for AC_BE, in unit of 32us */ + u16 Ac0Txop; /* for AC_BK, in unit of 32us */ + u16 Ac1Txop; /* for AC_BE, in unit of 32us */ } field; - UINT32 word; + u32 word; } AC_TXOP_CSR0_STRUC, *PAC_TXOP_CSR0_STRUC; /* */ @@ -284,10 +284,10 @@ typedef union _AC_TXOP_CSR0_STRUC { #define WMM_TXOP1_CFG 0x0224 typedef union _AC_TXOP_CSR1_STRUC { struct { - USHORT Ac2Txop; /* for AC_VI, in unit of 32us */ - USHORT Ac3Txop; /* for AC_VO, in unit of 32us */ + u16 Ac2Txop; /* for AC_VI, in unit of 32us */ + u16 Ac3Txop; /* for AC_VO, in unit of 32us */ } field; - UINT32 word; + u32 word; } AC_TXOP_CSR1_STRUC, *PAC_TXOP_CSR1_STRUC; #define RINGREG_DIFF 0x10 @@ -328,20 +328,20 @@ typedef union _AC_TXOP_CSR1_STRUC { #define USB_DMA_CFG 0x02a0 typedef union _USB_DMA_CFG_STRUC { struct { - UINT32 RxBulkAggTOut:8; /*Rx Bulk Aggregation TimeOut in unit of 33ns */ - UINT32 RxBulkAggLmt:8; /*Rx Bulk Aggregation Limit in unit of 256 bytes */ - UINT32 phyclear:1; /*phy watch dog enable. write 1 */ - UINT32 rsv:2; - UINT32 TxClear:1; /*Clear USB DMA TX path */ - UINT32 TxopHalt:1; /*Halt TXOP count down when TX buffer is full. */ - UINT32 RxBulkAggEn:1; /*Enable Rx Bulk Aggregation */ - UINT32 RxBulkEn:1; /*Enable USB DMA Rx */ - UINT32 TxBulkEn:1; /*Enable USB DMA Tx */ - UINT32 EpoutValid:6; /*OUT endpoint data valid */ - UINT32 RxBusy:1; /*USB DMA RX FSM busy */ - UINT32 TxBusy:1; /*USB DMA TX FSM busy */ + u32 RxBulkAggTOut:8; /*Rx Bulk Aggregation TimeOut in unit of 33ns */ + u32 RxBulkAggLmt:8; /*Rx Bulk Aggregation Limit in unit of 256 bytes */ + u32 phyclear:1; /*phy watch dog enable. write 1 */ + u32 rsv:2; + u32 TxClear:1; /*Clear USB DMA TX path */ + u32 TxopHalt:1; /*Halt TXOP count down when TX buffer is full. */ + u32 RxBulkAggEn:1; /*Enable Rx Bulk Aggregation */ + u32 RxBulkEn:1; /*Enable USB DMA Rx */ + u32 TxBulkEn:1; /*Enable USB DMA Tx */ + u32 EpoutValid:6; /*OUT endpoint data valid */ + u32 RxBusy:1; /*USB DMA RX FSM busy */ + u32 TxBusy:1; /*USB DMA TX FSM busy */ } field; - UINT32 word; + u32 word; } USB_DMA_CFG_STRUC, *PUSB_DMA_CFG_STRUC; /* */ @@ -384,10 +384,10 @@ typedef union _USB_DMA_CFG_STRUC { #define MAC_CSR0 0x1000 typedef union _ASIC_VER_ID_STRUC { struct { - USHORT ASICRev; /* reversion : 0 */ - USHORT ASICVer; /* version : 2860 */ + u16 ASICRev; /* reversion : 0 */ + u16 ASICVer; /* version : 2860 */ } field; - UINT32 word; + u32 word; } ASIC_VER_ID_STRUC, *PASIC_VER_ID_STRUC; #define MAC_SYS_CTRL 0x1004 /*MAC_CSR1 */ #define MAC_ADDR_DW0 0x1008 /* MAC ADDR DW0 */ @@ -397,12 +397,12 @@ typedef union _ASIC_VER_ID_STRUC { /* */ typedef union _MAC_DW0_STRUC { struct { - UCHAR Byte0; /* MAC address byte 0 */ - UCHAR Byte1; /* MAC address byte 1 */ - UCHAR Byte2; /* MAC address byte 2 */ - UCHAR Byte3; /* MAC address byte 3 */ + u8 Byte0; /* MAC address byte 0 */ + u8 Byte1; /* MAC address byte 1 */ + u8 Byte2; /* MAC address byte 2 */ + u8 Byte3; /* MAC address byte 3 */ } field; - UINT32 word; + u32 word; } MAC_DW0_STRUC, *PMAC_DW0_STRUC; /* */ @@ -410,12 +410,12 @@ typedef union _MAC_DW0_STRUC { /* */ typedef union _MAC_DW1_STRUC { struct { - UCHAR Byte4; /* MAC address byte 4 */ - UCHAR Byte5; /* MAC address byte 5 */ - UCHAR U2MeMask; - UCHAR Rsvd1; + u8 Byte4; /* MAC address byte 4 */ + u8 Byte5; /* MAC address byte 5 */ + u8 U2MeMask; + u8 Rsvd1; } field; - UINT32 word; + u32 word; } MAC_DW1_STRUC, *PMAC_DW1_STRUC; #define MAC_BSSID_DW0 0x1010 /* MAC BSSID DW0 */ @@ -426,13 +426,13 @@ typedef union _MAC_DW1_STRUC { /* */ typedef union _MAC_CSR5_STRUC { struct { - UCHAR Byte4; /* BSSID byte 4 */ - UCHAR Byte5; /* BSSID byte 5 */ - USHORT BssIdMask:2; /* 0: one BSSID, 10: 4 BSSID, 01: 2 BSSID , 11: 8BSSID */ - USHORT MBssBcnNum:3; - USHORT Rsvd:11; + u8 Byte4; /* BSSID byte 4 */ + u8 Byte5; /* BSSID byte 5 */ + u16 BssIdMask:2; /* 0: one BSSID, 10: 4 BSSID, 01: 2 BSSID , 11: 8BSSID */ + u16 MBssBcnNum:3; + u16 Rsvd:11; } field; - UINT32 word; + u32 word; } MAC_CSR5_STRUC, *PMAC_CSR5_STRUC; #define MAX_LEN_CFG 0x1018 /* rt2860b max 16k bytes. bit12:13 Maximum PSDU length (power factor) 0:2^13, 1:2^14, 2:2^15, 3:2^16 */ @@ -442,15 +442,15 @@ typedef union _MAC_CSR5_STRUC { /* */ typedef union _BBP_CSR_CFG_STRUC { struct { - UINT32 Value:8; /* Register value to program into BBP */ - UINT32 RegNum:8; /* Selected BBP register */ - UINT32 fRead:1; /* 0: Write BBP, 1: Read BBP */ - UINT32 Busy:1; /* 1: ASIC is busy execute BBP programming. */ - UINT32 BBP_PAR_DUR:1; /* 0: 4 MAC clock cycles 1: 8 MAC clock cycles */ - UINT32 BBP_RW_MODE:1; /* 0: use serial mode 1:parallel */ - UINT32:12; + u32 Value:8; /* Register value to program into BBP */ + u32 RegNum:8; /* Selected BBP register */ + u32 fRead:1; /* 0: Write BBP, 1: Read BBP */ + u32 Busy:1; /* 1: ASIC is busy execute BBP programming. */ + u32 BBP_PAR_DUR:1; /* 0: 4 MAC clock cycles 1: 8 MAC clock cycles */ + u32 BBP_RW_MODE:1; /* 0: use serial mode 1:parallel */ + u32 : 12; } field; - UINT32 word; + u32 word; } BBP_CSR_CFG_STRUC, *PBBP_CSR_CFG_STRUC; #define RF_CSR_CFG0 0x1020 /* */ @@ -458,45 +458,45 @@ typedef union _BBP_CSR_CFG_STRUC { /* */ typedef union _RF_CSR_CFG0_STRUC { struct { - UINT32 RegIdAndContent:24; /* Register value to program into BBP */ - UINT32 bitwidth:5; /* Selected BBP register */ - UINT32 StandbyMode:1; /* 0: high when stand by 1: low when standby */ - UINT32 Sel:1; /* 0:RF_LE0 activate 1:RF_LE1 activate */ - UINT32 Busy:1; /* 0: idle 1: 8busy */ + u32 RegIdAndContent:24; /* Register value to program into BBP */ + u32 bitwidth:5; /* Selected BBP register */ + u32 StandbyMode:1; /* 0: high when stand by 1: low when standby */ + u32 Sel:1; /* 0:RF_LE0 activate 1:RF_LE1 activate */ + u32 Busy:1; /* 0: idle 1: 8busy */ } field; - UINT32 word; + u32 word; } RF_CSR_CFG0_STRUC, *PRF_CSR_CFG0_STRUC; #define RF_CSR_CFG1 0x1024 typedef union _RF_CSR_CFG1_STRUC { struct { - UINT32 RegIdAndContent:24; /* Register value to program into BBP */ - UINT32 RFGap:5; /* Gap between BB_CONTROL_RF and RF_LE. 0: 3 system clock cycle (37.5usec) 1: 5 system clock cycle (62.5usec) */ - UINT32 rsv:7; /* 0: idle 1: 8busy */ + u32 RegIdAndContent:24; /* Register value to program into BBP */ + u32 RFGap:5; /* Gap between BB_CONTROL_RF and RF_LE. 0: 3 system clock cycle (37.5usec) 1: 5 system clock cycle (62.5usec) */ + u32 rsv:7; /* 0: idle 1: 8busy */ } field; - UINT32 word; + u32 word; } RF_CSR_CFG1_STRUC, *PRF_CSR_CFG1_STRUC; #define RF_CSR_CFG2 0x1028 /* */ typedef union _RF_CSR_CFG2_STRUC { struct { - UINT32 RegIdAndContent:24; /* Register value to program into BBP */ - UINT32 rsv:8; /* 0: idle 1: 8busy */ + u32 RegIdAndContent:24; /* Register value to program into BBP */ + u32 rsv:8; /* 0: idle 1: 8busy */ } field; - UINT32 word; + u32 word; } RF_CSR_CFG2_STRUC, *PRF_CSR_CFG2_STRUC; #define LED_CFG 0x102c /* MAC_CSR14 */ typedef union _LED_CFG_STRUC { struct { - UINT32 OnPeriod:8; /* blinking on period unit 1ms */ - UINT32 OffPeriod:8; /* blinking off period unit 1ms */ - UINT32 SlowBlinkPeriod:6; /* slow blinking period. unit:1ms */ - UINT32 rsv:2; - UINT32 RLedMode:2; /* red Led Mode 0: off1: blinking upon TX2: periodic slow blinking3: always on */ - UINT32 GLedMode:2; /* green Led Mode */ - UINT32 YLedMode:2; /* yellow Led Mode */ - UINT32 LedPolar:1; /* Led Polarity. 0: active low1: active high */ - UINT32:1; + u32 OnPeriod:8; /* blinking on period unit 1ms */ + u32 OffPeriod:8; /* blinking off period unit 1ms */ + u32 SlowBlinkPeriod:6; /* slow blinking period. unit:1ms */ + u32 rsv:2; + u32 RLedMode:2; /* red Led Mode 0: off1: blinking upon TX2: periodic slow blinking3: always on */ + u32 GLedMode:2; /* green Led Mode */ + u32 YLedMode:2; /* yellow Led Mode */ + u32 LedPolar:1; /* Led Polarity. 0: active low1: active high */ + u32 : 1; } field; - UINT32 word; + u32 word; } LED_CFG_STRUC, *PLED_CFG_STRUC; /* */ /* 4.2 MAC TIMING configuration registers (offset:0x1100) */ @@ -504,14 +504,14 @@ typedef union _LED_CFG_STRUC { #define XIFS_TIME_CFG 0x1100 /* MAC_CSR8 MAC_CSR9 */ typedef union _IFS_SLOT_CFG_STRUC { struct { - UINT32 CckmSifsTime:8; /* unit 1us. Applied after CCK RX/TX */ - UINT32 OfdmSifsTime:8; /* unit 1us. Applied after OFDM RX/TX */ - UINT32 OfdmXifsTime:4; /*OFDM SIFS. unit 1us. Applied after OFDM RX when MAC doesn't reference BBP signal BBRXEND */ - UINT32 EIFS:9; /* unit 1us */ - UINT32 BBRxendEnable:1; /* reference RXEND signal to begin XIFS defer */ - UINT32 rsv:2; + u32 CckmSifsTime:8; /* unit 1us. Applied after CCK RX/TX */ + u32 OfdmSifsTime:8; /* unit 1us. Applied after OFDM RX/TX */ + u32 OfdmXifsTime:4; /*OFDM SIFS. unit 1us. Applied after OFDM RX when MAC doesn't reference BBP signal BBRXEND */ + u32 EIFS:9; /* unit 1us */ + u32 BBRxendEnable:1; /* reference RXEND signal to begin XIFS defer */ + u32 rsv:2; } field; - UINT32 word; + u32 word; } IFS_SLOT_CFG_STRUC, *PIFS_SLOT_CFG_STRUC; #define BKOFF_SLOT_CFG 0x1104 /* mac_csr9 last 8 bits */ @@ -528,15 +528,15 @@ typedef union _IFS_SLOT_CFG_STRUC { /* */ typedef union _BCN_TIME_CFG_STRUC { struct { - UINT32 BeaconInterval:16; /* in unit of 1/16 TU */ - UINT32 bTsfTicking:1; /* Enable TSF auto counting */ - UINT32 TsfSyncMode:2; /* Enable TSF sync, 00: disable, 01: infra mode, 10: ad-hoc mode */ - UINT32 bTBTTEnable:1; - UINT32 bBeaconGen:1; /* Enable beacon generator */ - UINT32:3; - UINT32 TxTimestampCompensate:8; + u32 BeaconInterval:16; /* in unit of 1/16 TU */ + u32 bTsfTicking:1; /* Enable TSF auto counting */ + u32 TsfSyncMode:2; /* Enable TSF sync, 00: disable, 01: infra mode, 10: ad-hoc mode */ + u32 bTBTTEnable:1; + u32 bBeaconGen:1; /* Enable beacon generator */ + u32 : 3; + u32 TxTimestampCompensate:8; } field; - UINT32 word; + u32 word; } BCN_TIME_CFG_STRUC, *PBCN_TIME_CFG_STRUC; #define TBTT_SYNC_CFG 0x1118 /* txrx_csr10 */ #define TSF_TIMER_DW0 0x111C /* Local TSF timer lsb 32 bits. Read-only */ @@ -557,12 +557,12 @@ typedef union _BCN_TIME_CFG_STRUC { /* */ typedef union _AUTO_WAKEUP_STRUC { struct { - UINT32 AutoLeadTime:8; - UINT32 NumofSleepingTbtt:7; /* ForceWake has high privilege than PutToSleep when both set */ - UINT32 EnableAutoWakeup:1; /* 0:sleep, 1:awake */ - UINT32:16; + u32 AutoLeadTime:8; + u32 NumofSleepingTbtt:7; /* ForceWake has high privilege than PutToSleep when both set */ + u32 EnableAutoWakeup:1; /* 0:sleep, 1:awake */ + u32 : 16; } field; - UINT32 word; + u32 word; } AUTO_WAKEUP_STRUC, *PAUTO_WAKEUP_STRUC; /* */ /* 4.3 MAC TX configuration registers (offset:0x1300) */ @@ -574,13 +574,13 @@ typedef union _AUTO_WAKEUP_STRUC { #define EDCA_AC3_CFG 0x130c typedef union _EDCA_AC_CFG_STRUC { struct { - UINT32 AcTxop:8; /* in unit of 32us */ - UINT32 Aifsn:4; /* # of slot time */ - UINT32 Cwmin:4; /* */ - UINT32 Cwmax:4; /*unit power of 2 */ - UINT32:12; /* */ + u32 AcTxop:8; /* in unit of 32us */ + u32 Aifsn:4; /* # of slot time */ + u32 Cwmin:4; /* */ + u32 Cwmax:4; /*unit power of 2 */ + u32 : 12; /* */ } field; - UINT32 word; + u32 word; } EDCA_AC_CFG_STRUC, *PEDCA_AC_CFG_STRUC; #define EDCA_TID_AC_MAP 0x1310 @@ -600,104 +600,104 @@ typedef union _EDCA_AC_CFG_STRUC { typedef union _TX_RTS_CFG_STRUC { struct { - UINT32 AutoRtsRetryLimit:8; - UINT32 RtsThres:16; /* unit:byte */ - UINT32 RtsFbkEn:1; /* enable rts rate fallback */ - UINT32 rsv:7; /* 1: HT non-STBC control frame enable */ + u32 AutoRtsRetryLimit:8; + u32 RtsThres:16; /* unit:byte */ + u32 RtsFbkEn:1; /* enable rts rate fallback */ + u32 rsv:7; /* 1: HT non-STBC control frame enable */ } field; - UINT32 word; + u32 word; } TX_RTS_CFG_STRUC, *PTX_RTS_CFG_STRUC; #define TX_TIMEOUT_CFG 0x1348 typedef union _TX_TIMEOUT_CFG_STRUC { struct { - UINT32 rsv:4; - UINT32 MpduLifeTime:4; /* expiration time = 2^(9+MPDU LIFE TIME) us */ - UINT32 RxAckTimeout:8; /* unit:slot. Used for TX precedure */ - UINT32 TxopTimeout:8; /*TXOP timeout value for TXOP truncation. It is recommended that (SLOT_TIME) > (TX_OP_TIMEOUT) > (RX_ACK_TIMEOUT) */ - UINT32 rsv2:8; /* 1: HT non-STBC control frame enable */ + u32 rsv:4; + u32 MpduLifeTime:4; /* expiration time = 2^(9+MPDU LIFE TIME) us */ + u32 RxAckTimeout:8; /* unit:slot. Used for TX precedure */ + u32 TxopTimeout:8; /*TXOP timeout value for TXOP truncation. It is recommended that (SLOT_TIME) > (TX_OP_TIMEOUT) > (RX_ACK_TIMEOUT) */ + u32 rsv2:8; /* 1: HT non-STBC control frame enable */ } field; - UINT32 word; + u32 word; } TX_TIMEOUT_CFG_STRUC, *PTX_TIMEOUT_CFG_STRUC; #define TX_RTY_CFG 0x134c typedef union PACKED _TX_RTY_CFG_STRUC { struct { - UINT32 ShortRtyLimit:8; /* short retry limit */ - UINT32 LongRtyLimit:8; /*long retry limit */ - UINT32 LongRtyThre:12; /* Long retry threshoold */ - UINT32 NonAggRtyMode:1; /* Non-Aggregate MPDU retry mode. 0:expired by retry limit, 1: expired by mpdu life timer */ - UINT32 AggRtyMode:1; /* Aggregate MPDU retry mode. 0:expired by retry limit, 1: expired by mpdu life timer */ - UINT32 TxautoFBEnable:1; /* Tx retry PHY rate auto fallback enable */ - UINT32 rsv:1; /* 1: HT non-STBC control frame enable */ + u32 ShortRtyLimit:8; /* short retry limit */ + u32 LongRtyLimit:8; /*long retry limit */ + u32 LongRtyThre:12; /* Long retry threshoold */ + u32 NonAggRtyMode:1; /* Non-Aggregate MPDU retry mode. 0:expired by retry limit, 1: expired by mpdu life timer */ + u32 AggRtyMode:1; /* Aggregate MPDU retry mode. 0:expired by retry limit, 1: expired by mpdu life timer */ + u32 TxautoFBEnable:1; /* Tx retry PHY rate auto fallback enable */ + u32 rsv:1; /* 1: HT non-STBC control frame enable */ } field; - UINT32 word; + u32 word; } TX_RTY_CFG_STRUC, *PTX_RTY_CFG_STRUC; #define TX_LINK_CFG 0x1350 typedef union PACKED _TX_LINK_CFG_STRUC { struct PACKED { - UINT32 RemoteMFBLifeTime:8; /*remote MFB life time. unit : 32us */ - UINT32 MFBEnable:1; /* TX apply remote MFB 1:enable */ - UINT32 RemoteUMFSEnable:1; /* remote unsolicit MFB enable. 0: not apply remote remote unsolicit (MFS=7) */ - UINT32 TxMRQEn:1; /* MCS request TX enable */ - UINT32 TxRDGEn:1; /* RDG TX enable */ - UINT32 TxCFAckEn:1; /* Piggyback CF-ACK enable */ - UINT32 rsv:3; /* */ - UINT32 RemotMFB:8; /* remote MCS feedback */ - UINT32 RemotMFS:8; /*remote MCS feedback sequence number */ + u32 RemoteMFBLifeTime:8; /*remote MFB life time. unit : 32us */ + u32 MFBEnable:1; /* TX apply remote MFB 1:enable */ + u32 RemoteUMFSEnable:1; /* remote unsolicit MFB enable. 0: not apply remote remote unsolicit (MFS=7) */ + u32 TxMRQEn:1; /* MCS request TX enable */ + u32 TxRDGEn:1; /* RDG TX enable */ + u32 TxCFAckEn:1; /* Piggyback CF-ACK enable */ + u32 rsv:3; /* */ + u32 RemotMFB:8; /* remote MCS feedback */ + u32 RemotMFS:8; /*remote MCS feedback sequence number */ } field; - UINT32 word; + u32 word; } TX_LINK_CFG_STRUC, *PTX_LINK_CFG_STRUC; #define HT_FBK_CFG0 0x1354 typedef union PACKED _HT_FBK_CFG0_STRUC { struct { - UINT32 HTMCS0FBK:4; - UINT32 HTMCS1FBK:4; - UINT32 HTMCS2FBK:4; - UINT32 HTMCS3FBK:4; - UINT32 HTMCS4FBK:4; - UINT32 HTMCS5FBK:4; - UINT32 HTMCS6FBK:4; - UINT32 HTMCS7FBK:4; + u32 HTMCS0FBK:4; + u32 HTMCS1FBK:4; + u32 HTMCS2FBK:4; + u32 HTMCS3FBK:4; + u32 HTMCS4FBK:4; + u32 HTMCS5FBK:4; + u32 HTMCS6FBK:4; + u32 HTMCS7FBK:4; } field; - UINT32 word; + u32 word; } HT_FBK_CFG0_STRUC, *PHT_FBK_CFG0_STRUC; #define HT_FBK_CFG1 0x1358 typedef union _HT_FBK_CFG1_STRUC { struct { - UINT32 HTMCS8FBK:4; - UINT32 HTMCS9FBK:4; - UINT32 HTMCS10FBK:4; - UINT32 HTMCS11FBK:4; - UINT32 HTMCS12FBK:4; - UINT32 HTMCS13FBK:4; - UINT32 HTMCS14FBK:4; - UINT32 HTMCS15FBK:4; + u32 HTMCS8FBK:4; + u32 HTMCS9FBK:4; + u32 HTMCS10FBK:4; + u32 HTMCS11FBK:4; + u32 HTMCS12FBK:4; + u32 HTMCS13FBK:4; + u32 HTMCS14FBK:4; + u32 HTMCS15FBK:4; } field; - UINT32 word; + u32 word; } HT_FBK_CFG1_STRUC, *PHT_FBK_CFG1_STRUC; #define LG_FBK_CFG0 0x135c typedef union _LG_FBK_CFG0_STRUC { struct { - UINT32 OFDMMCS0FBK:4; /*initial value is 0 */ - UINT32 OFDMMCS1FBK:4; /*initial value is 0 */ - UINT32 OFDMMCS2FBK:4; /*initial value is 1 */ - UINT32 OFDMMCS3FBK:4; /*initial value is 2 */ - UINT32 OFDMMCS4FBK:4; /*initial value is 3 */ - UINT32 OFDMMCS5FBK:4; /*initial value is 4 */ - UINT32 OFDMMCS6FBK:4; /*initial value is 5 */ - UINT32 OFDMMCS7FBK:4; /*initial value is 6 */ + u32 OFDMMCS0FBK:4; /*initial value is 0 */ + u32 OFDMMCS1FBK:4; /*initial value is 0 */ + u32 OFDMMCS2FBK:4; /*initial value is 1 */ + u32 OFDMMCS3FBK:4; /*initial value is 2 */ + u32 OFDMMCS4FBK:4; /*initial value is 3 */ + u32 OFDMMCS5FBK:4; /*initial value is 4 */ + u32 OFDMMCS6FBK:4; /*initial value is 5 */ + u32 OFDMMCS7FBK:4; /*initial value is 6 */ } field; - UINT32 word; + u32 word; } LG_FBK_CFG0_STRUC, *PLG_FBK_CFG0_STRUC; #define LG_FBK_CFG1 0x1360 typedef union _LG_FBK_CFG1_STRUC { struct { - UINT32 CCKMCS0FBK:4; /*initial value is 0 */ - UINT32 CCKMCS1FBK:4; /*initial value is 0 */ - UINT32 CCKMCS2FBK:4; /*initial value is 1 */ - UINT32 CCKMCS3FBK:4; /*initial value is 2 */ - UINT32 rsv:16; + u32 CCKMCS0FBK:4; /*initial value is 0 */ + u32 CCKMCS1FBK:4; /*initial value is 0 */ + u32 CCKMCS2FBK:4; /*initial value is 1 */ + u32 CCKMCS3FBK:4; /*initial value is 2 */ + u32 rsv:16; } field; - UINT32 word; + u32 word; } LG_FBK_CFG1_STRUC, *PLG_FBK_CFG1_STRUC; /*======================================================= */ @@ -705,24 +705,24 @@ typedef union _LG_FBK_CFG1_STRUC { /*======================================================= */ #define CCK_PROT_CFG 0x1364 /*CCK Protection */ #define ASIC_SHORTNAV 1 -#define ASIC_LONGNAV 2 +#define ASIC_longNAV 2 #define ASIC_RTS 1 #define ASIC_CTS 2 typedef union _PROT_CFG_STRUC { struct { - UINT32 ProtectRate:16; /*Protection control frame rate for CCK TX(RTS/CTS/CFEnd). */ - UINT32 ProtectCtrl:2; /*Protection control frame type for CCK TX. 1:RTS/CTS, 2:CTS-to-self, 0:None, 3:rsv */ - UINT32 ProtectNav:2; /*TXOP protection type for CCK TX. 0:None, 1:ShortNAVprotect, 2:LongNAVProtect, 3:rsv */ - UINT32 TxopAllowCck:1; /*CCK TXOP allowance.0:disallow. */ - UINT32 TxopAllowOfdm:1; /*CCK TXOP allowance.0:disallow. */ - UINT32 TxopAllowMM20:1; /*CCK TXOP allowance. 0:disallow. */ - UINT32 TxopAllowMM40:1; /*CCK TXOP allowance.0:disallow. */ - UINT32 TxopAllowGF20:1; /*CCK TXOP allowance.0:disallow. */ - UINT32 TxopAllowGF40:1; /*CCK TXOP allowance.0:disallow. */ - UINT32 RTSThEn:1; /*RTS threshold enable on CCK TX */ - UINT32 rsv:5; + u32 ProtectRate:16; /*Protection control frame rate for CCK TX(RTS/CTS/CFEnd). */ + u32 ProtectCtrl:2; /*Protection control frame type for CCK TX. 1:RTS/CTS, 2:CTS-to-self, 0:None, 3:rsv */ + u32 ProtectNav:2; /*TXOP protection type for CCK TX. 0:None, 1:ShortNAVprotect, 2:LongNAVProtect, 3:rsv */ + u32 TxopAllowCck:1; /*CCK TXOP allowance.0:disallow. */ + u32 TxopAllowOfdm:1; /*CCK TXOP allowance.0:disallow. */ + u32 TxopAllowMM20:1; /*CCK TXOP allowance. 0:disallow. */ + u32 TxopAllowMM40:1; /*CCK TXOP allowance.0:disallow. */ + u32 TxopAllowGF20:1; /*CCK TXOP allowance.0:disallow. */ + u32 TxopAllowGF40:1; /*CCK TXOP allowance.0:disallow. */ + u32 RTSThEn:1; /*RTS threshold enable on CCK TX */ + u32 rsv:5; } field; - UINT32 word; + u32 word; } PROT_CFG_STRUC, *PPROT_CFG_STRUC; #define OFDM_PROT_CFG 0x1368 /*OFDM Protection */ @@ -743,17 +743,17 @@ typedef union _PROT_CFG_STRUC { /* */ typedef union _AUTO_RSP_CFG_STRUC { struct { - UINT32 AutoResponderEnable:1; - UINT32 BACAckPolicyEnable:1; /* 0:long, 1:short preamble */ - UINT32 CTS40MMode:1; /* Response CTS 40MHz duplicate mode */ - UINT32 CTS40MRef:1; /* Response CTS 40MHz duplicate mode */ - UINT32 AutoResponderPreamble:1; /* 0:long, 1:short preamble */ - UINT32 rsv:1; /* Power bit value in conrtrol frame */ - UINT32 DualCTSEn:1; /* Power bit value in conrtrol frame */ - UINT32 AckCtsPsmBit:1; /* Power bit value in conrtrol frame */ - UINT32:24; + u32 AutoResponderEnable:1; + u32 BACAckPolicyEnable:1; /* 0:long, 1:short preamble */ + u32 CTS40MMode:1; /* Response CTS 40MHz duplicate mode */ + u32 CTS40MRef:1; /* Response CTS 40MHz duplicate mode */ + u32 AutoResponderPreamble:1; /* 0:long, 1:short preamble */ + u32 rsv:1; /* Power bit value in conrtrol frame */ + u32 DualCTSEn:1; /* Power bit value in conrtrol frame */ + u32 AckCtsPsmBit:1; /* Power bit value in conrtrol frame */ + u32 : 24; } field; - UINT32 word; + u32 word; } AUTO_RSP_CFG_STRUC, *PAUTO_RSP_CFG_STRUC; #define LEGACY_BASIC_RATE 0x1408 /* TXRX_CSR5 0x3054 */ @@ -789,21 +789,21 @@ typedef union _AUTO_RSP_CFG_STRUC { /* */ typedef union _RX_STA_CNT0_STRUC { struct { - USHORT CrcErr; - USHORT PhyErr; + u16 CrcErr; + u16 PhyErr; } field; - UINT32 word; + u32 word; } RX_STA_CNT0_STRUC, *PRX_STA_CNT0_STRUC; /* */ -/* RX_STA_CNT1_STRUC: RX False CCA count & RX LONG frame count */ +/* RX_STA_CNT1_STRUC: RX False CCA count & RX long frame count */ /* */ typedef union _RX_STA_CNT1_STRUC { struct { - USHORT FalseCca; - USHORT PlcpErr; + u16 FalseCca; + u16 PlcpErr; } field; - UINT32 word; + u32 word; } RX_STA_CNT1_STRUC, *PRX_STA_CNT1_STRUC; /* */ @@ -811,10 +811,10 @@ typedef union _RX_STA_CNT1_STRUC { /* */ typedef union _RX_STA_CNT2_STRUC { struct { - USHORT RxDupliCount; - USHORT RxFifoOverflowCount; + u16 RxDupliCount; + u16 RxFifoOverflowCount; } field; - UINT32 word; + u32 word; } RX_STA_CNT2_STRUC, *PRX_STA_CNT2_STRUC; #define TX_STA_CNT0 0x170C /* */ /* */ @@ -822,10 +822,10 @@ typedef union _RX_STA_CNT2_STRUC { /* */ typedef union _TX_STA_CNT0_STRUC { struct { - USHORT TxFailCount; - USHORT TxBeaconCount; + u16 TxFailCount; + u16 TxBeaconCount; } field; - UINT32 word; + u32 word; } TX_STA_CNT0_STRUC, *PTX_STA_CNT0_STRUC; #define TX_STA_CNT1 0x1710 /* */ /* */ @@ -833,10 +833,10 @@ typedef union _TX_STA_CNT0_STRUC { /* */ typedef union _TX_STA_CNT1_STRUC { struct { - USHORT TxSuccess; - USHORT TxRetransmit; + u16 TxSuccess; + u16 TxRetransmit; } field; - UINT32 word; + u32 word; } TX_STA_CNT1_STRUC, *PTX_STA_CNT1_STRUC; #define TX_STA_CNT2 0x1714 /* */ /* */ @@ -844,10 +844,10 @@ typedef union _TX_STA_CNT1_STRUC { /* */ typedef union _TX_STA_CNT2_STRUC { struct { - USHORT TxZeroLenCount; - USHORT TxUnderFlowCount; + u16 TxZeroLenCount; + u16 TxUnderFlowCount; } field; - UINT32 word; + u32 word; } TX_STA_CNT2_STRUC, *PTX_STA_CNT2_STRUC; #define TX_STA_FIFO 0x1718 /* */ /* */ @@ -855,103 +855,103 @@ typedef union _TX_STA_CNT2_STRUC { /* */ typedef union PACKED _TX_STA_FIFO_STRUC { struct { - UINT32 bValid:1; /* 1:This register contains a valid TX result */ - UINT32 PidType:4; - UINT32 TxSuccess:1; /* Tx No retry success */ - UINT32 TxAggre:1; /* Tx Retry Success */ - UINT32 TxAckRequired:1; /* Tx fail */ - UINT32 wcid:8; /*wireless client index */ -/* UINT32 SuccessRate:16; //include MCS, mode ,shortGI, BW settingSame format as TXWI Word 0 Bit 31-16. */ - UINT32 SuccessRate:13; /*include MCS, mode ,shortGI, BW settingSame format as TXWI Word 0 Bit 31-16. */ - UINT32 TxBF:1; - UINT32 Reserve:2; + u32 bValid:1; /* 1:This register contains a valid TX result */ + u32 PidType:4; + u32 TxSuccess:1; /* Tx No retry success */ + u32 TxAggre:1; /* Tx Retry Success */ + u32 TxAckRequired:1; /* Tx fail */ + u32 wcid:8; /*wireless client index */ +/* u32 SuccessRate:16; //include MCS, mode ,shortGI, BW settingSame format as TXWI Word 0 Bit 31-16. */ + u32 SuccessRate:13; /*include MCS, mode ,shortGI, BW settingSame format as TXWI Word 0 Bit 31-16. */ + u32 TxBF:1; + u32 Reserve:2; } field; - UINT32 word; + u32 word; } TX_STA_FIFO_STRUC, *PTX_STA_FIFO_STRUC; /* Debug counter */ #define TX_AGG_CNT 0x171c typedef union _TX_AGG_CNT_STRUC { struct { - USHORT NonAggTxCount; - USHORT AggTxCount; + u16 NonAggTxCount; + u16 AggTxCount; } field; - UINT32 word; + u32 word; } TX_AGG_CNT_STRUC, *PTX_AGG_CNT_STRUC; /* Debug counter */ #define TX_AGG_CNT0 0x1720 typedef union _TX_AGG_CNT0_STRUC { struct { - USHORT AggSize1Count; - USHORT AggSize2Count; + u16 AggSize1Count; + u16 AggSize2Count; } field; - UINT32 word; + u32 word; } TX_AGG_CNT0_STRUC, *PTX_AGG_CNT0_STRUC; /* Debug counter */ #define TX_AGG_CNT1 0x1724 typedef union _TX_AGG_CNT1_STRUC { struct { - USHORT AggSize3Count; - USHORT AggSize4Count; + u16 AggSize3Count; + u16 AggSize4Count; } field; - UINT32 word; + u32 word; } TX_AGG_CNT1_STRUC, *PTX_AGG_CNT1_STRUC; #define TX_AGG_CNT2 0x1728 typedef union _TX_AGG_CNT2_STRUC { struct { - USHORT AggSize5Count; - USHORT AggSize6Count; + u16 AggSize5Count; + u16 AggSize6Count; } field; - UINT32 word; + u32 word; } TX_AGG_CNT2_STRUC, *PTX_AGG_CNT2_STRUC; /* Debug counter */ #define TX_AGG_CNT3 0x172c typedef union _TX_AGG_CNT3_STRUC { struct { - USHORT AggSize7Count; - USHORT AggSize8Count; + u16 AggSize7Count; + u16 AggSize8Count; } field; - UINT32 word; + u32 word; } TX_AGG_CNT3_STRUC, *PTX_AGG_CNT3_STRUC; /* Debug counter */ #define TX_AGG_CNT4 0x1730 typedef union _TX_AGG_CNT4_STRUC { struct { - USHORT AggSize9Count; - USHORT AggSize10Count; + u16 AggSize9Count; + u16 AggSize10Count; } field; - UINT32 word; + u32 word; } TX_AGG_CNT4_STRUC, *PTX_AGG_CNT4_STRUC; #define TX_AGG_CNT5 0x1734 typedef union _TX_AGG_CNT5_STRUC { struct { - USHORT AggSize11Count; - USHORT AggSize12Count; + u16 AggSize11Count; + u16 AggSize12Count; } field; - UINT32 word; + u32 word; } TX_AGG_CNT5_STRUC, *PTX_AGG_CNT5_STRUC; #define TX_AGG_CNT6 0x1738 typedef union _TX_AGG_CNT6_STRUC { struct { - USHORT AggSize13Count; - USHORT AggSize14Count; + u16 AggSize13Count; + u16 AggSize14Count; } field; - UINT32 word; + u32 word; } TX_AGG_CNT6_STRUC, *PTX_AGG_CNT6_STRUC; #define TX_AGG_CNT7 0x173c typedef union _TX_AGG_CNT7_STRUC { struct { - USHORT AggSize15Count; - USHORT AggSize16Count; + u16 AggSize15Count; + u16 AggSize16Count; } field; - UINT32 word; + u32 word; } TX_AGG_CNT7_STRUC, *PTX_AGG_CNT7_STRUC; #define MPDU_DENSITY_CNT 0x1740 typedef union _MPDU_DEN_CNT_STRUC { struct { - USHORT TXZeroDelCount; /*TX zero length delimiter count */ - USHORT RXZeroDelCount; /*RX zero length delimiter count */ + u16 TXZeroDelCount; /*TX zero length delimiter count */ + u16 RXZeroDelCount; /*RX zero length delimiter count */ } field; - UINT32 word; + u32 word; } MPDU_DEN_CNT_STRUC, *PMPDU_DEN_CNT_STRUC; /* */ /* TXRX control registers - base address 0x3000 */ @@ -980,29 +980,29 @@ typedef union _MPDU_DEN_CNT_STRUC { typedef union _SHAREDKEY_MODE_STRUC { struct { - UINT32 Bss0Key0CipherAlg:3; - UINT32:1; - UINT32 Bss0Key1CipherAlg:3; - UINT32:1; - UINT32 Bss0Key2CipherAlg:3; - UINT32:1; - UINT32 Bss0Key3CipherAlg:3; - UINT32:1; - UINT32 Bss1Key0CipherAlg:3; - UINT32:1; - UINT32 Bss1Key1CipherAlg:3; - UINT32:1; - UINT32 Bss1Key2CipherAlg:3; - UINT32:1; - UINT32 Bss1Key3CipherAlg:3; - UINT32:1; + u32 Bss0Key0CipherAlg:3; + u32 : 1; + u32 Bss0Key1CipherAlg:3; + u32 : 1; + u32 Bss0Key2CipherAlg:3; + u32 : 1; + u32 Bss0Key3CipherAlg:3; + u32 : 1; + u32 Bss1Key0CipherAlg:3; + u32 : 1; + u32 Bss1Key1CipherAlg:3; + u32 : 1; + u32 Bss1Key2CipherAlg:3; + u32 : 1; + u32 Bss1Key3CipherAlg:3; + u32 : 1; } field; - UINT32 word; + u32 word; } SHAREDKEY_MODE_STRUC, *PSHAREDKEY_MODE_STRUC; /* 64-entry for pairwise key table */ typedef struct _HW_WCID_ENTRY { /* 8-byte per entry */ - UCHAR Address[6]; - UCHAR Rsv[2]; + u8 Address[6]; + u8 Rsv[2]; } HW_WCID_ENTRY, PHW_WCID_ENTRY; /* ================================================================================= */ @@ -1010,28 +1010,28 @@ typedef struct _HW_WCID_ENTRY { /* 8-byte per entry */ /* ================================================================================= */ /*7.1 WCID ENTRY format : 8bytes */ typedef struct _WCID_ENTRY_STRUC { - UCHAR RXBABitmap7; /* bit0 for TID8, bit7 for TID 15 */ - UCHAR RXBABitmap0; /* bit0 for TID0, bit7 for TID 7 */ - UCHAR MAC[6]; /* 0 for shared key table. 1 for pairwise key table */ + u8 RXBABitmap7; /* bit0 for TID8, bit7 for TID 15 */ + u8 RXBABitmap0; /* bit0 for TID0, bit7 for TID 7 */ + u8 MAC[6]; /* 0 for shared key table. 1 for pairwise key table */ } WCID_ENTRY_STRUC, *PWCID_ENTRY_STRUC; /*8.1.1 SECURITY KEY format : 8DW */ /* 32-byte per entry, total 16-entry for shared key table, 64-entry for pairwise key table */ typedef struct _HW_KEY_ENTRY { /* 32-byte per entry */ - UCHAR Key[16]; - UCHAR TxMic[8]; - UCHAR RxMic[8]; + u8 Key[16]; + u8 TxMic[8]; + u8 RxMic[8]; } HW_KEY_ENTRY, *PHW_KEY_ENTRY; /*8.1.2 IV/EIV format : 2DW */ /*8.1.3 RX attribute entry format : 1DW */ typedef struct _MAC_ATTRIBUTE_STRUC { - UINT32 KeyTab:1; /* 0 for shared key table. 1 for pairwise key table */ - UINT32 PairKeyMode:3; - UINT32 BSSIDIdx:3; /*multipleBSS index for the WCID */ - UINT32 RXWIUDF:3; - UINT32 rsv:22; + u32 KeyTab:1; /* 0 for shared key table. 1 for pairwise key table */ + u32 PairKeyMode:3; + u32 BSSIDIdx:3; /*multipleBSS index for the WCID */ + u32 RXWIUDF:3; + u32 rsv:22; } MAC_ATTRIBUTE_STRUC, *PMAC_ATTRIBUTE_STRUC; /* ================================================================================= */ @@ -1043,12 +1043,12 @@ typedef struct _MAC_ATTRIBUTE_STRUC { /* */ typedef union _H2M_MAILBOX_STRUC { struct { - UINT32 LowByte:8; - UINT32 HighByte:8; - UINT32 CmdToken:8; - UINT32 Owner:8; + u32 LowByte:8; + u32 HighByte:8; + u32 CmdToken:8; + u32 Owner:8; } field; - UINT32 word; + u32 word; } H2M_MAILBOX_STRUC, *PH2M_MAILBOX_STRUC; /* */ @@ -1056,24 +1056,24 @@ typedef union _H2M_MAILBOX_STRUC { /* */ typedef union _M2H_CMD_DONE_STRUC { struct { - UINT32 CmdToken0; - UINT32 CmdToken1; - UINT32 CmdToken2; - UINT32 CmdToken3; + u32 CmdToken0; + u32 CmdToken1; + u32 CmdToken2; + u32 CmdToken3; } field; - UINT32 word; + u32 word; } M2H_CMD_DONE_STRUC, *PM2H_CMD_DONE_STRUC; /*NAV_TIME_CFG :NAV */ typedef union _NAV_TIME_CFG_STRUC { struct { - UCHAR Sifs; /* in unit of 1-us */ - UCHAR SlotTime; /* in unit of 1-us */ - USHORT Eifs:9; /* in unit of 1-us */ - USHORT ZeroSifs:1; /* Applied zero SIFS timer after OFDM RX 0: disable */ - USHORT rsv:6; + u8 Sifs; /* in unit of 1-us */ + u8 SlotTime; /* in unit of 1-us */ + u16 Eifs:9; /* in unit of 1-us */ + u16 ZeroSifs:1; /* Applied zero SIFS timer after OFDM RX 0: disable */ + u16 rsv:6; } field; - UINT32 word; + u32 word; } NAV_TIME_CFG_STRUC, *PNAV_TIME_CFG_STRUC; /* */ @@ -1081,30 +1081,30 @@ typedef union _NAV_TIME_CFG_STRUC { /* */ typedef union _RX_FILTR_CFG_STRUC { struct { - UINT32 DropCRCErr:1; /* Drop CRC error */ - UINT32 DropPhyErr:1; /* Drop physical error */ - UINT32 DropNotToMe:1; /* Drop not to me unicast frame */ - UINT32 DropNotMyBSSID:1; /* Drop fram ToDs bit is true */ - - UINT32 DropVerErr:1; /* Drop version error frame */ - UINT32 DropMcast:1; /* Drop multicast frames */ - UINT32 DropBcast:1; /* Drop broadcast frames */ - UINT32 DropDuplicate:1; /* Drop duplicate frame */ - - UINT32 DropCFEndAck:1; /* Drop Ps-Poll */ - UINT32 DropCFEnd:1; /* Drop Ps-Poll */ - UINT32 DropAck:1; /* Drop Ps-Poll */ - UINT32 DropCts:1; /* Drop Ps-Poll */ - - UINT32 DropRts:1; /* Drop Ps-Poll */ - UINT32 DropPsPoll:1; /* Drop Ps-Poll */ - UINT32 DropBA:1; /* */ - UINT32 DropBAR:1; /* */ - - UINT32 DropRsvCntlType:1; - UINT32:15; + u32 DropCRCErr:1; /* Drop CRC error */ + u32 DropPhyErr:1; /* Drop physical error */ + u32 DropNotToMe:1; /* Drop not to me unicast frame */ + u32 DropNotMyBSSID:1; /* Drop fram ToDs bit is true */ + + u32 DropVerErr:1; /* Drop version error frame */ + u32 DropMcast:1; /* Drop multicast frames */ + u32 DropBcast:1; /* Drop broadcast frames */ + u32 DropDuplicate:1; /* Drop duplicate frame */ + + u32 DropCFEndAck:1; /* Drop Ps-Poll */ + u32 DropCFEnd:1; /* Drop Ps-Poll */ + u32 DropAck:1; /* Drop Ps-Poll */ + u32 DropCts:1; /* Drop Ps-Poll */ + + u32 DropRts:1; /* Drop Ps-Poll */ + u32 DropPsPoll:1; /* Drop Ps-Poll */ + u32 DropBA:1; /* */ + u32 DropBAR:1; /* */ + + u32 DropRsvCntlType:1; + u32 : 15; } field; - UINT32 word; + u32 word; } RX_FILTR_CFG_STRUC, *PRX_FILTR_CFG_STRUC; /* */ @@ -1112,13 +1112,13 @@ typedef union _RX_FILTR_CFG_STRUC { /* */ typedef union _PHY_CSR4_STRUC { struct { - UINT32 RFRegValue:24; /* Register value (include register id) serial out to RF/IF chip. */ - UINT32 NumberOfBits:5; /* Number of bits used in RFRegValue (I:20, RFMD:22) */ - UINT32 IFSelect:1; /* 1: select IF to program, 0: select RF to program */ - UINT32 PLL_LD:1; /* RF PLL_LD status */ - UINT32 Busy:1; /* 1: ASIC is busy execute RF programming. */ + u32 RFRegValue:24; /* Register value (include register id) serial out to RF/IF chip. */ + u32 NumberOfBits:5; /* Number of bits used in RFRegValue (I:20, RFMD:22) */ + u32 IFSelect:1; /* 1: select IF to program, 0: select RF to program */ + u32 PLL_LD:1; /* RF PLL_LD status */ + u32 Busy:1; /* 1: ASIC is busy execute RF programming. */ } field; - UINT32 word; + u32 word; } PHY_CSR4_STRUC, *PPHY_CSR4_STRUC; /* */ @@ -1126,24 +1126,24 @@ typedef union _PHY_CSR4_STRUC { /* */ typedef union _SEC_CSR5_STRUC { struct { - UINT32 Bss2Key0CipherAlg:3; - UINT32:1; - UINT32 Bss2Key1CipherAlg:3; - UINT32:1; - UINT32 Bss2Key2CipherAlg:3; - UINT32:1; - UINT32 Bss2Key3CipherAlg:3; - UINT32:1; - UINT32 Bss3Key0CipherAlg:3; - UINT32:1; - UINT32 Bss3Key1CipherAlg:3; - UINT32:1; - UINT32 Bss3Key2CipherAlg:3; - UINT32:1; - UINT32 Bss3Key3CipherAlg:3; - UINT32:1; + u32 Bss2Key0CipherAlg:3; + u32 : 1; + u32 Bss2Key1CipherAlg:3; + u32 : 1; + u32 Bss2Key2CipherAlg:3; + u32 : 1; + u32 Bss2Key3CipherAlg:3; + u32 : 1; + u32 Bss3Key0CipherAlg:3; + u32 : 1; + u32 Bss3Key1CipherAlg:3; + u32 : 1; + u32 Bss3Key2CipherAlg:3; + u32 : 1; + u32 Bss3Key3CipherAlg:3; + u32 : 1; } field; - UINT32 word; + u32 word; } SEC_CSR5_STRUC, *PSEC_CSR5_STRUC; /* */ @@ -1151,10 +1151,10 @@ typedef union _SEC_CSR5_STRUC { /* */ typedef union _HOST_CMD_CSR_STRUC { struct { - UINT32 HostCommand:8; - UINT32 Rsv:24; + u32 HostCommand:8; + u32 Rsv:24; } field; - UINT32 word; + u32 word; } HOST_CMD_CSR_STRUC, *PHOST_CMD_CSR_STRUC; /* */ @@ -1166,16 +1166,16 @@ typedef union _HOST_CMD_CSR_STRUC { /* */ typedef union _E2PROM_CSR_STRUC { struct { - UINT32 Reload:1; /* Reload EEPROM content, write one to reload, self-cleared. */ - UINT32 EepromSK:1; - UINT32 EepromCS:1; - UINT32 EepromDI:1; - UINT32 EepromDO:1; - UINT32 Type:1; /* 1: 93C46, 0:93C66 */ - UINT32 LoadStatus:1; /* 1:loading, 0:done */ - UINT32 Rsvd:25; + u32 Reload:1; /* Reload EEPROM content, write one to reload, self-cleared. */ + u32 EepromSK:1; + u32 EepromCS:1; + u32 EepromDI:1; + u32 EepromDO:1; + u32 Type:1; /* 1: 93C46, 0:93C66 */ + u32 LoadStatus:1; /* 1:loading, 0:done */ + u32 Rsvd:25; } field; - UINT32 word; + u32 word; } E2PROM_CSR_STRUC, *PE2PROM_CSR_STRUC; /* */ @@ -1183,12 +1183,12 @@ typedef union _E2PROM_CSR_STRUC { /* */ typedef union _QOS_CSR0_STRUC { struct { - UCHAR Byte0; /* MAC address byte 0 */ - UCHAR Byte1; /* MAC address byte 1 */ - UCHAR Byte2; /* MAC address byte 2 */ - UCHAR Byte3; /* MAC address byte 3 */ + u8 Byte0; /* MAC address byte 0 */ + u8 Byte1; /* MAC address byte 1 */ + u8 Byte2; /* MAC address byte 2 */ + u8 Byte3; /* MAC address byte 3 */ } field; - UINT32 word; + u32 word; } QOS_CSR0_STRUC, *PQOS_CSR0_STRUC; /* */ @@ -1196,25 +1196,25 @@ typedef union _QOS_CSR0_STRUC { /* */ typedef union _QOS_CSR1_STRUC { struct { - UCHAR Byte4; /* MAC address byte 4 */ - UCHAR Byte5; /* MAC address byte 5 */ - UCHAR Rsvd0; - UCHAR Rsvd1; + u8 Byte4; /* MAC address byte 4 */ + u8 Byte5; /* MAC address byte 5 */ + u8 Rsvd0; + u8 Rsvd1; } field; - UINT32 word; + u32 word; } QOS_CSR1_STRUC, *PQOS_CSR1_STRUC; #define RF_CSR_CFG 0x500 typedef union _RF_CSR_CFG_STRUC { struct { - UINT RF_CSR_DATA:8; /* DATA */ - UINT TESTCSR_RFACC_REGNUM:5; /* RF register ID */ - UINT Rsvd2:3; /* Reserved */ - UINT RF_CSR_WR:1; /* 0: read 1: write */ - UINT RF_CSR_KICK:1; /* kick RF register read/write */ - UINT Rsvd1:14; /* Reserved */ + u32 RF_CSR_DATA:8; /* DATA */ + u32 TESTCSR_RFACC_REGNUM:5; /* RF register ID */ + u32 Rsvd2:3; /* Reserved */ + u32 RF_CSR_WR:1; /* 0: read 1: write */ + u32 RF_CSR_KICK:1; /* kick RF register read/write */ + u32 Rsvd1:14; /* Reserved */ } field; - UINT word; + u32 word; } RF_CSR_CFG_STRUC, *PRF_CSR_CFG_STRUC; /* */ diff --git a/drivers/staging/rt2860/chip/rtmp_phy.h b/drivers/staging/rt2860/chip/rtmp_phy.h index fd1a989..48d1860 100644 --- a/drivers/staging/rt2860/chip/rtmp_phy.h +++ b/drivers/staging/rt2860/chip/rtmp_phy.h @@ -180,7 +180,7 @@ if ((_A)->bPCIclkOff == FALSE) \ { \ PHY_CSR4_STRUC _value; \ - ULONG _busyCnt = 0; \ + unsigned long _busyCnt = 0; \ \ do { \ RTMP_IO_READ32((_A), RF_CSR_CFG0, &_value.word); \ @@ -248,7 +248,7 @@ if ((BbpCsr.field.Busy == IDLE) && \ (BbpCsr.field.RegNum == _bbpID)) \ { \ - *(_pV) = (UCHAR)BbpCsr.field.Value; \ + *(_pV) = (u8)BbpCsr.field.Value; \ break; \ } \ } \ @@ -313,7 +313,7 @@ if ((BbpCsr.field.Busy == IDLE) && \ (BbpCsr.field.RegNum == _I)) \ { \ - *(_pV) = (UCHAR)BbpCsr.field.Value; \ + *(_pV) = (u8)BbpCsr.field.Value; \ break; \ } \ } \ @@ -351,7 +351,7 @@ if ((BbpCsr.field.Busy == IDLE) && \ (BbpCsr.field.RegNum == _I)) \ { \ - *(_pV) = (UCHAR)BbpCsr.field.Value; \ + *(_pV) = (u8)BbpCsr.field.Value; \ break; \ } \ } \ @@ -429,7 +429,7 @@ #define RTMP_BBP_IO_WRITE8_BY_REG_ID(_A, _I, _V) \ { \ BBP_CSR_CFG_STRUC BbpCsr; \ - INT BusyCnt = 0; \ + int BusyCnt = 0; \ BOOLEAN brc; \ if (_I < MAX_NUM_OF_BBP_LATCH) \ { \ @@ -523,8 +523,8 @@ #ifdef RT30xx #define RTMP_ASIC_MMPS_DISABLE(_pAd) \ do{ \ - UINT32 _macData; \ - UCHAR _bbpData = 0; \ + u32 _macData; \ + u8 _bbpData = 0; \ /* disable MMPS BBP control register */ \ RTMP_BBP_IO_READ8_BY_REG_ID(_pAd, BBP_R3, &_bbpData); \ _bbpData &= ~(0x04); /*bit 2*/ \ @@ -538,8 +538,8 @@ #define RTMP_ASIC_MMPS_ENABLE(_pAd) \ do{ \ - UINT32 _macData; \ - UCHAR _bbpData = 0; \ + u32 _macData; \ + u8 _bbpData = 0; \ /* enable MMPS BBP control register */ \ RTMP_BBP_IO_READ8_BY_REG_ID(_pAd, BBP_R3, &_bbpData); \ _bbpData |= (0x04); /*bit 2*/ \ diff --git a/drivers/staging/rt2860/chips/rt3070.c b/drivers/staging/rt2860/chips/rt3070.c index 4a62087..beaaafa 100644 --- a/drivers/staging/rt2860/chips/rt3070.c +++ b/drivers/staging/rt2860/chips/rt3070.c @@ -43,25 +43,25 @@ #error "You Should Enable compile flag RTMP_RF_RW_SUPPORT for this chip" #endif /* RTMP_RF_RW_SUPPORT // */ -VOID NICInitRT3070RFRegisters(IN PRTMP_ADAPTER pAd) +void NICInitRT3070RFRegisters(IN PRTMP_ADAPTER pAd) { - INT i; - UCHAR RFValue; + int i; + u8 RFValue; /* Driver must read EEPROM to get RfIcType before initial RF registers */ /* Initialize RF register to default value */ if (IS_RT3070(pAd) || IS_RT3071(pAd)) { /* Init RF calibration */ /* Driver should toggle RF R30 bit7 before init RF registers */ - UINT32 RfReg = 0; - UINT32 data; + u32 RfReg = 0; + u32 data; - RT30xxReadRFRegister(pAd, RF_R30, (PUCHAR) & RfReg); + RT30xxReadRFRegister(pAd, RF_R30, (u8 *)& RfReg); RfReg |= 0x80; - RT30xxWriteRFRegister(pAd, RF_R30, (UCHAR) RfReg); + RT30xxWriteRFRegister(pAd, RF_R30, (u8)RfReg); RTMPusecDelay(1000); RfReg &= 0x7F; - RT30xxWriteRFRegister(pAd, RF_R30, (UCHAR) RfReg); + RT30xxWriteRFRegister(pAd, RF_R30, (u8)RfReg); /* Initialize RF register to default value */ for (i = 0; i < NUM_RF_REG_PARMS; i++) { @@ -84,9 +84,9 @@ VOID NICInitRT3070RFRegisters(IN PRTMP_ADAPTER pAd) } } else if (IS_RT3071(pAd)) { /* Driver should set RF R6 bit6 on before init RF registers */ - RT30xxReadRFRegister(pAd, RF_R06, (PUCHAR) & RfReg); + RT30xxReadRFRegister(pAd, RF_R06, (u8 *)& RfReg); RfReg |= 0x40; - RT30xxWriteRFRegister(pAd, RF_R06, (UCHAR) RfReg); + RT30xxWriteRFRegister(pAd, RF_R06, (u8)RfReg); /* init R31 */ RT30xxWriteRFRegister(pAd, RF_R31, 0x14); diff --git a/drivers/staging/rt2860/chips/rt3090.c b/drivers/staging/rt2860/chips/rt3090.c index cedacfb..b80928c 100644 --- a/drivers/staging/rt2860/chips/rt3090.c +++ b/drivers/staging/rt2860/chips/rt3090.c @@ -43,22 +43,22 @@ #error "You Should Enable compile flag RTMP_RF_RW_SUPPORT for this chip" #endif /* RTMP_RF_RW_SUPPORT // */ -VOID NICInitRT3090RFRegisters(IN PRTMP_ADAPTER pAd) +void NICInitRT3090RFRegisters(IN PRTMP_ADAPTER pAd) { - INT i; + int i; /* Driver must read EEPROM to get RfIcType before initial RF registers */ /* Initialize RF register to default value */ if (IS_RT3090(pAd)) { /* Init RF calibration */ /* Driver should toggle RF R30 bit7 before init RF registers */ - UINT32 RfReg = 0, data; + u32 RfReg = 0, data; - RT30xxReadRFRegister(pAd, RF_R30, (PUCHAR) & RfReg); + RT30xxReadRFRegister(pAd, RF_R30, (u8 *)& RfReg); RfReg |= 0x80; - RT30xxWriteRFRegister(pAd, RF_R30, (UCHAR) RfReg); + RT30xxWriteRFRegister(pAd, RF_R30, (u8)RfReg); RTMPusecDelay(1000); RfReg &= 0x7F; - RT30xxWriteRFRegister(pAd, RF_R30, (UCHAR) RfReg); + RT30xxWriteRFRegister(pAd, RF_R30, (u8)RfReg); /* init R24, R31 */ RT30xxWriteRFRegister(pAd, RF_R24, 0x0F); @@ -90,9 +90,9 @@ VOID NICInitRT3090RFRegisters(IN PRTMP_ADAPTER pAd) } /* Driver should set RF R6 bit6 on before calibration */ - RT30xxReadRFRegister(pAd, RF_R06, (PUCHAR) & RfReg); + RT30xxReadRFRegister(pAd, RF_R06, (u8 *)& RfReg); RfReg |= 0x40; - RT30xxWriteRFRegister(pAd, RF_R06, (UCHAR) RfReg); + RT30xxWriteRFRegister(pAd, RF_R06, (u8)RfReg); /*For RF filter Calibration */ RTMPFilterCalibration(pAd); diff --git a/drivers/staging/rt2860/chips/rt30xx.c b/drivers/staging/rt2860/chips/rt30xx.c index b03d94d..39b483c 100644 --- a/drivers/staging/rt2860/chips/rt30xx.c +++ b/drivers/staging/rt2860/chips/rt30xx.c @@ -87,19 +87,19 @@ REG_PAIR RT30xx_RFRegTable[] = { , }; -UCHAR NUM_RF_REG_PARMS = (sizeof(RT30xx_RFRegTable) / sizeof(REG_PAIR)); +u8 NUM_RF_REG_PARMS = (sizeof(RT30xx_RFRegTable) / sizeof(REG_PAIR)); /* Antenna divesity use GPIO3 and EESK pin for control */ /* Antenna and EEPROM access are both using EESK pin, */ /* Therefor we should avoid accessing EESK at the same time */ /* Then restore antenna after EEPROM access */ /* The original name of this function is AsicSetRxAnt(), now change to */ -/*VOID AsicSetRxAnt( */ -VOID RT30xxSetRxAnt(IN PRTMP_ADAPTER pAd, IN UCHAR Ant) +/*void AsicSetRxAnt( */ +void RT30xxSetRxAnt(IN PRTMP_ADAPTER pAd, u8 Ant) { - UINT32 Value; + u32 Value; #ifdef RTMP_MAC_PCI - UINT32 x; + u32 x; #endif if ((pAd->EepromAccess) || @@ -159,11 +159,11 @@ VOID RT30xxSetRxAnt(IN PRTMP_ADAPTER pAd, IN UCHAR Ant) ======================================================================== */ -VOID RTMPFilterCalibration(IN PRTMP_ADAPTER pAd) +void RTMPFilterCalibration(IN PRTMP_ADAPTER pAd) { - UCHAR R55x = 0, value, FilterTarget = 0x1E, BBPValue = 0; - UINT loop = 0, count = 0, loopcnt = 0, ReTry = 0; - UCHAR RF_R24_Value = 0; + u8 R55x = 0, value, FilterTarget = 0x1E, BBPValue = 0; + u32 loop = 0, count = 0, loopcnt = 0, ReTry = 0; + u8 RF_R24_Value = 0; /* Give bbp filter initial value */ pAd->Mlme.CaliBW20RfR24 = 0x1F; @@ -263,10 +263,10 @@ VOID RTMPFilterCalibration(IN PRTMP_ADAPTER pAd) if (loopcnt < 100) { if (loop++ == 0) { /*BandWidth = 20 MHz */ - pAd->Mlme.CaliBW20RfR24 = (UCHAR) RF_R24_Value; + pAd->Mlme.CaliBW20RfR24 = (u8)RF_R24_Value; } else { /*BandWidth = 40 MHz */ - pAd->Mlme.CaliBW40RfR24 = (UCHAR) RF_R24_Value; + pAd->Mlme.CaliBW40RfR24 = (u8)RF_R24_Value; break; } } else @@ -306,9 +306,9 @@ VOID RTMPFilterCalibration(IN PRTMP_ADAPTER pAd) ========================================================================== */ -VOID RT30xxLoadRFNormalModeSetup(IN PRTMP_ADAPTER pAd) +void RT30xxLoadRFNormalModeSetup(IN PRTMP_ADAPTER pAd) { - UCHAR RFValue; + u8 RFValue; /* RX0_PD & TX0_PD, RF R1 register Bit 2 & Bit 3 to 0 and RF_BLOCK_en,RX1_PD & TX1_PD, Bit0, Bit 4 & Bit5 to 1 */ RT30xxReadRFRegister(pAd, RF_R01, &RFValue); @@ -372,10 +372,10 @@ VOID RT30xxLoadRFNormalModeSetup(IN PRTMP_ADAPTER pAd) ========================================================================== */ -VOID RT30xxLoadRFSleepModeSetup(IN PRTMP_ADAPTER pAd) +void RT30xxLoadRFSleepModeSetup(IN PRTMP_ADAPTER pAd) { - UCHAR RFValue; - UINT32 MACValue; + u8 RFValue; + u32 MACValue; #ifdef RTMP_MAC_USB if (!IS_RT3572(pAd)) @@ -428,10 +428,10 @@ VOID RT30xxLoadRFSleepModeSetup(IN PRTMP_ADAPTER pAd) ========================================================================== */ -VOID RT30xxReverseRFSleepModeSetup(IN PRTMP_ADAPTER pAd) +void RT30xxReverseRFSleepModeSetup(IN PRTMP_ADAPTER pAd) { - UCHAR RFValue; - UINT32 MACValue; + u8 RFValue; + u32 MACValue; #ifdef RTMP_MAC_USB if (!IS_RT3572(pAd)) @@ -493,9 +493,9 @@ VOID RT30xxReverseRFSleepModeSetup(IN PRTMP_ADAPTER pAd) /* end johnli */ -VOID RT30xxHaltAction(IN PRTMP_ADAPTER pAd) +void RT30xxHaltAction(IN PRTMP_ADAPTER pAd) { - UINT32 TxPinCfg = 0x00050F0F; + u32 TxPinCfg = 0x00050F0F; /* */ /* Turn off LNA_PE or TRSW_POL */ diff --git a/drivers/staging/rt2860/chlist.h b/drivers/staging/rt2860/chlist.h index af8b5ca..4183c8b 100644 --- a/drivers/staging/rt2860/chlist.h +++ b/drivers/staging/rt2860/chlist.h @@ -50,24 +50,24 @@ #define BAND_BOTH 2 typedef struct _CH_DESP { - UCHAR FirstChannel; - UCHAR NumOfCh; - CHAR MaxTxPwr; /* dBm */ - UCHAR Geography; /* 0:out door, 1:in door, 2:both */ + u8 FirstChannel; + u8 NumOfCh; + char MaxTxPwr; /* dBm */ + u8 Geography; /* 0:out door, 1:in door, 2:both */ BOOLEAN DfsReq; /* Dfs require, 0: No, 1: yes. */ } CH_DESP, *PCH_DESP; typedef struct _CH_REGION { - UCHAR CountReg[3]; - UCHAR DfsType; /* 0: CE, 1: FCC, 2: JAP, 3:JAP_W53, JAP_W56 */ + u8 CountReg[3]; + u8 DfsType; /* 0: CE, 1: FCC, 2: JAP, 3:JAP_W53, JAP_W56 */ CH_DESP ChDesp[10]; } CH_REGION, *PCH_REGION; extern CH_REGION ChRegion[]; typedef struct _CH_FREQ_MAP_ { - UINT16 channel; - UINT16 freqKHz; + u16 channel; + u16 freqKHz; } CH_FREQ_MAP; extern CH_FREQ_MAP CH_HZ_ID_MAP[]; @@ -103,15 +103,15 @@ extern int CH_HZ_ID_MAP_NUM; (_ch) = 1; \ }while(0) -VOID BuildChannelListEx(IN PRTMP_ADAPTER pAd); +void BuildChannelListEx(IN PRTMP_ADAPTER pAd); -VOID BuildBeaconChList(IN PRTMP_ADAPTER pAd, - OUT PUCHAR pBuf, OUT PULONG pBufLen); +void BuildBeaconChList(IN PRTMP_ADAPTER pAd, + u8 *pBuf, unsigned long *pBufLen); -VOID N_ChannelCheck(IN PRTMP_ADAPTER pAd); +void N_ChannelCheck(IN PRTMP_ADAPTER pAd); -VOID N_SetCenCh(IN PRTMP_ADAPTER pAd); +void N_SetCenCh(IN PRTMP_ADAPTER pAd); -UINT8 GetCuntryMaxTxPwr(IN PRTMP_ADAPTER pAd, IN UINT8 channel); +u8 GetCuntryMaxTxPwr(IN PRTMP_ADAPTER pAd, u8 channel); #endif /* __CHLIST_H__ */ diff --git a/drivers/staging/rt2860/common/action.c b/drivers/staging/rt2860/common/action.c index f69681d..8928ee7 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 2484c2e..f1d1ac7 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 97cb40a..1ffa176 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 030678c..99b0b1b 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 468aba5..ef7d2a6 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 7dbcb23..9c6b7ca 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 81766db..cd000fb 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 157ebc6..19eb928 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 da79fc0..7906756 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 610eb75..2178057 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 3b6f577..c7f4be1 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 70e47db..d5bc37d 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 bd12025..16cc31a 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 c29e087..2d7f36a 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 97f0543..ab00a0c 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 db40139..05a9214 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 6940d77..3fce5a7 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 a50326a..6a086f9 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 b3701f2..433aaf2 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 7b1bf8a..9166ea0 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 bfe742d..8bee5cf 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 8e49cd7..b997151 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 fa3f231..8cd654c 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 202d313..764de3a 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 e984725..2fecd32 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 1956940..b710d40 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 e047b89..fcf030b 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 0af7e6b..3fe5d97 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 8b5be17..6d6ca32 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 0a95870..5735dd7 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 09d46f7..3d69527 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 d29e6e8..d5648d8 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 2cc73de..b89ad5f 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)) { diff --git a/drivers/staging/rt2860/crypt_hmac.h b/drivers/staging/rt2860/crypt_hmac.h index 6211640..7a56515 100644 --- a/drivers/staging/rt2860/crypt_hmac.h +++ b/drivers/staging/rt2860/crypt_hmac.h @@ -48,18 +48,18 @@ #ifdef SHA1_SUPPORT #define HMAC_SHA1_SUPPORT -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); #endif /* SHA1_SUPPORT */ #ifdef MD5_SUPPORT #define HMAC_MD5_SUPPORT -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); #endif /* MD5_SUPPORT */ #endif /* __CRYPT_HMAC_H__ */ diff --git a/drivers/staging/rt2860/crypt_md5.h b/drivers/staging/rt2860/crypt_md5.h index ecc67e4..bbabf12 100644 --- a/drivers/staging/rt2860/crypt_md5.h +++ b/drivers/staging/rt2860/crypt_md5.h @@ -54,19 +54,19 @@ #define MD5_BLOCK_SIZE 64 /* 512 bits = 64 bytes */ #define MD5_DIGEST_SIZE 16 /* 128 bits = 16 bytes */ typedef struct { - UINT32 HashValue[4]; - UINT64 MessageLen; - UINT8 Block[MD5_BLOCK_SIZE]; - UINT BlockLen; + u32 HashValue[4]; + u64 MessageLen; + u8 Block[MD5_BLOCK_SIZE]; + u32 BlockLen; } MD5_CTX_STRUC, *PMD5_CTX_STRUC; -VOID MD5_Init(IN MD5_CTX_STRUC * pMD5_CTX); -VOID MD5_Hash(IN MD5_CTX_STRUC * pMD5_CTX); -VOID MD5_Append(IN MD5_CTX_STRUC * pMD5_CTX, - IN const UINT8 Message[], IN UINT MessageLen); -VOID MD5_End(IN MD5_CTX_STRUC * pMD5_CTX, OUT UINT8 DigestMessage[]); -VOID RT_MD5(IN const UINT8 Message[], - IN UINT MessageLen, OUT UINT8 DigestMessage[]); +void MD5_Init(IN MD5_CTX_STRUC * pMD5_CTX); +void MD5_Hash(IN MD5_CTX_STRUC * pMD5_CTX); +void MD5_Append(IN MD5_CTX_STRUC * pMD5_CTX, + IN const u8 Message[], u32 MessageLen); +void MD5_End(IN MD5_CTX_STRUC * pMD5_CTX, u8 DigestMessage[]); +void RT_MD5(IN const u8 Message[], + u32 MessageLen, u8 DigestMessage[]); #endif /* MD5_SUPPORT */ #endif /* __CRYPT_MD5_H__ */ diff --git a/drivers/staging/rt2860/crypt_sha2.h b/drivers/staging/rt2860/crypt_sha2.h index 33d999d..bfd88bc 100644 --- a/drivers/staging/rt2860/crypt_sha2.h +++ b/drivers/staging/rt2860/crypt_sha2.h @@ -55,19 +55,19 @@ #define SHA1_BLOCK_SIZE 64 /* 512 bits = 64 bytes */ #define SHA1_DIGEST_SIZE 20 /* 160 bits = 20 bytes */ typedef struct _SHA1_CTX_STRUC { - UINT32 HashValue[5]; /* 5 = (SHA1_DIGEST_SIZE / 32) */ - UINT64 MessageLen; /* total size */ - UINT8 Block[SHA1_BLOCK_SIZE]; - UINT BlockLen; + u32 HashValue[5]; /* 5 = (SHA1_DIGEST_SIZE / 32) */ + u64 MessageLen; /* total size */ + u8 Block[SHA1_BLOCK_SIZE]; + u32 BlockLen; } SHA1_CTX_STRUC, *PSHA1_CTX_STRUC; -VOID RT_SHA1_Init(IN SHA1_CTX_STRUC * pSHA_CTX); -VOID SHA1_Hash(IN SHA1_CTX_STRUC * pSHA_CTX); -VOID SHA1_Append(IN SHA1_CTX_STRUC * pSHA_CTX, - IN const UINT8 Message[], IN UINT MessageLen); -VOID SHA1_End(IN SHA1_CTX_STRUC * pSHA_CTX, OUT UINT8 DigestMessage[]); -VOID RT_SHA1(IN const UINT8 Message[], - IN UINT MessageLen, OUT UINT8 DigestMessage[]); +void RT_SHA1_Init(IN SHA1_CTX_STRUC * pSHA_CTX); +void SHA1_Hash(IN SHA1_CTX_STRUC * pSHA_CTX); +void SHA1_Append(IN SHA1_CTX_STRUC * pSHA_CTX, + IN const u8 Message[], u32 MessageLen); +void SHA1_End(IN SHA1_CTX_STRUC * pSHA_CTX, u8 DigestMessage[]); +void RT_SHA1(IN const u8 Message[], + u32 MessageLen, u8 DigestMessage[]); #endif /* SHA1_SUPPORT */ #endif /* __CRYPT_SHA2_H__ */ diff --git a/drivers/staging/rt2860/dfs.h b/drivers/staging/rt2860/dfs.h index 9e5e74d..d094490 100644 --- a/drivers/staging/rt2860/dfs.h +++ b/drivers/staging/rt2860/dfs.h @@ -36,4 +36,4 @@ Fonchi 03-12-2007 created */ -BOOLEAN RadarChannelCheck(IN PRTMP_ADAPTER pAd, IN UCHAR Ch); +BOOLEAN RadarChannelCheck(IN PRTMP_ADAPTER pAd, u8 Ch); diff --git a/drivers/staging/rt2860/eeprom.h b/drivers/staging/rt2860/eeprom.h index 4d8e8bf..50df5a2 100644 --- a/drivers/staging/rt2860/eeprom.h +++ b/drivers/staging/rt2860/eeprom.h @@ -42,26 +42,26 @@ * Public function declarations for prom-based chipset ************************************************************************/ int rtmp_ee_prom_read16(IN PRTMP_ADAPTER pAd, - IN USHORT Offset, OUT USHORT * pValue); + u16 Offset, u16 * pValue); #endif /* RTMP_PCI_SUPPORT // */ #ifdef RTMP_USB_SUPPORT /************************************************************************* * Public function declarations for usb-based prom chipset ************************************************************************/ -NTSTATUS RTUSBReadEEPROM16(IN PRTMP_ADAPTER pAd, - IN USHORT offset, OUT PUSHORT pData); +int RTUSBReadEEPROM16(IN PRTMP_ADAPTER pAd, + u16 offset, u16 *pData); #endif /* RTMP_USB_SUPPORT // */ #ifdef RT30xx #ifdef RTMP_EFUSE_SUPPORT int rtmp_ee_efuse_read16(IN RTMP_ADAPTER * pAd, - IN USHORT Offset, OUT USHORT * pValue); + u16 Offset, u16 * pValue); #endif /* RTMP_EFUSE_SUPPORT // */ #endif /* RT30xx // */ /************************************************************************* * Public function declarations for prom operation callback functions setting ************************************************************************/ -INT RtmpChipOpsEepromHook(IN RTMP_ADAPTER * pAd, IN INT infType); +int RtmpChipOpsEepromHook(IN RTMP_ADAPTER * pAd, int infType); #endif /* __EEPROM_H__ // */ diff --git a/drivers/staging/rt2860/iface/rtmp_usb.h b/drivers/staging/rt2860/iface/rtmp_usb.h index 26591b0..40d7d01 100644 --- a/drivers/staging/rt2860/iface/rtmp_usb.h +++ b/drivers/staging/rt2860/iface/rtmp_usb.h @@ -38,7 +38,7 @@ typedef struct urb *purbb_t; typedef struct usb_ctrlrequest devctrlrequest; #endif // LINUX // -extern UCHAR EpToQueue[6]; +extern u8 EpToQueue[6]; #define RXBULKAGGRE_ZISE 12 #define MAX_TXBULK_LIMIT (LOCAL_TXBUF_SIZE*(BULKAGGRE_ZISE-1)) @@ -110,8 +110,8 @@ extern void dump_urb(struct urb *purb); #define USBD_SHORT_TRANSFER_OK 0 #define PURB purbb_t -#define PIRP PVOID -#define NDIS_OID UINT +#define PIRP void * +#define NDIS_OID u32 #ifndef USB_ST_NOERROR #define USB_ST_NOERROR 0 #endif @@ -120,12 +120,12 @@ extern void dump_urb(struct urb *purb); #define CONTROL_TIMEOUT_JIFFIES ( (100 * OS_HZ) / 1000) #define UNLINK_TIMEOUT_MS 3 -VOID RTUSBBulkOutDataPacketComplete(purbb_t purb, struct pt_regs *pt_regs); -VOID RTUSBBulkOutMLMEPacketComplete(purbb_t pUrb, struct pt_regs *pt_regs); -VOID RTUSBBulkOutNullFrameComplete(purbb_t pUrb, struct pt_regs *pt_regs); -VOID RTUSBBulkOutRTSFrameComplete(purbb_t pUrb, struct pt_regs *pt_regs); -VOID RTUSBBulkOutPsPollComplete(purbb_t pUrb, struct pt_regs *pt_regs); -VOID RTUSBBulkRxComplete(purbb_t pUrb, struct pt_regs *pt_regs); +void RTUSBBulkOutDataPacketComplete(purbb_t purb, struct pt_regs *pt_regs); +void RTUSBBulkOutMLMEPacketComplete(purbb_t pUrb, struct pt_regs *pt_regs); +void RTUSBBulkOutNullFrameComplete(purbb_t pUrb, struct pt_regs *pt_regs); +void RTUSBBulkOutRTSFrameComplete(purbb_t pUrb, struct pt_regs *pt_regs); +void RTUSBBulkOutPsPollComplete(purbb_t pUrb, struct pt_regs *pt_regs); +void RTUSBBulkRxComplete(purbb_t pUrb, struct pt_regs *pt_regs); #ifdef KTHREAD_SUPPORT #define RTUSBMlmeUp(pAd) \ diff --git a/drivers/staging/rt2860/mlme.h b/drivers/staging/rt2860/mlme.h index 8585a4d..3be1bc8 100644 --- a/drivers/staging/rt2860/mlme.h +++ b/drivers/staging/rt2860/mlme.h @@ -188,86 +188,86 @@ if (((__pEntry)) != NULL) \ /* */ /* HT Capability INFO field in HT Cap IE . */ typedef struct PACKED { - USHORT AdvCoding:1; - USHORT ChannelWidth:1; - USHORT MimoPs:2; /*momi power safe */ - USHORT GF:1; /*green field */ - USHORT ShortGIfor20:1; - USHORT ShortGIfor40:1; /*for40MHz */ - USHORT TxSTBC:1; - USHORT RxSTBC:2; - USHORT DelayedBA:1; /*rt2860c not support */ - USHORT AMsduSize:1; /* only support as zero */ - USHORT CCKmodein40:1; - USHORT PSMP:1; - USHORT Forty_Mhz_Intolerant:1; - USHORT LSIGTxopProSup:1; + u16 AdvCoding:1; + u16 ChannelWidth:1; + u16 MimoPs:2; /*momi power safe */ + u16 GF:1; /*green field */ + u16 ShortGIfor20:1; + u16 ShortGIfor40:1; /*for40MHz */ + u16 TxSTBC:1; + u16 RxSTBC:2; + u16 DelayedBA:1; /*rt2860c not support */ + u16 AMsduSize:1; /* only support as zero */ + u16 CCKmodein40:1; + u16 PSMP:1; + u16 Forty_Mhz_Intolerant:1; + u16 LSIGTxopProSup:1; } HT_CAP_INFO, *PHT_CAP_INFO; /* HT Capability INFO field in HT Cap IE . */ typedef struct PACKED { - UCHAR MaxRAmpduFactor:2; - UCHAR MpduDensity:3; - UCHAR rsv:3; /*momi power safe */ + u8 MaxRAmpduFactor:2; + u8 MpduDensity:3; + u8 rsv:3; /*momi power safe */ } HT_CAP_PARM, *PHT_CAP_PARM; /* HT Capability INFO field in HT Cap IE . */ typedef struct PACKED { - UCHAR MCSSet[10]; - UCHAR SupRate[2]; /* unit : 1Mbps */ - UCHAR TxMCSSetDefined:1; - UCHAR TxRxNotEqual:1; - UCHAR TxStream:2; - UCHAR MpduDensity:1; - UCHAR rsv:3; - UCHAR rsv3[3]; + u8 MCSSet[10]; + u8 SupRate[2]; /* unit : 1Mbps */ + u8 TxMCSSetDefined:1; + u8 TxRxNotEqual:1; + u8 TxStream:2; + u8 MpduDensity:1; + u8 rsv:3; + u8 rsv3[3]; } HT_MCS_SET, *PHT_MCS_SET; /* HT Capability INFO field in HT Cap IE . */ typedef struct PACKED { - USHORT Pco:1; - USHORT TranTime:2; - USHORT rsv:5; /*momi power safe */ - USHORT MCSFeedback:2; /*0:no MCS feedback, 2:unsolicited MCS feedback, 3:Full MCS feedback, 1:rsv. */ - USHORT PlusHTC:1; /*+HTC control field support */ - USHORT RDGSupport:1; /*reverse Direction Grant support */ - USHORT rsv2:4; + u16 Pco:1; + u16 TranTime:2; + u16 rsv:5; /*momi power safe */ + u16 MCSFeedback:2; /*0:no MCS feedback, 2:unsolicited MCS feedback, 3:Full MCS feedback, 1:rsv. */ + u16 PlusHTC:1; /*+HTC control field support */ + u16 RDGSupport:1; /*reverse Direction Grant support */ + u16 rsv2:4; } EXT_HT_CAP_INFO, *PEXT_HT_CAP_INFO; /* HT Beamforming field in HT Cap IE . */ typedef struct PACKED _HT_BF_CAP { - ULONG TxBFRecCapable:1; - ULONG RxSoundCapable:1; - ULONG TxSoundCapable:1; - ULONG RxNDPCapable:1; - ULONG TxNDPCapable:1; - ULONG ImpTxBFCapable:1; - ULONG Calibration:2; - ULONG ExpCSICapable:1; - ULONG ExpNoComSteerCapable:1; - ULONG ExpComSteerCapable:1; - ULONG ExpCSIFbk:2; - ULONG ExpNoComBF:2; - ULONG ExpComBF:2; - ULONG MinGrouping:2; - ULONG CSIBFAntSup:2; - ULONG NoComSteerBFAntSup:2; - ULONG ComSteerBFAntSup:2; - ULONG CSIRowBFSup:2; - ULONG ChanEstimation:2; - ULONG rsv:3; + unsigned long TxBFRecCapable:1; + unsigned long RxSoundCapable:1; + unsigned long TxSoundCapable:1; + unsigned long RxNDPCapable:1; + unsigned long TxNDPCapable:1; + unsigned long ImpTxBFCapable:1; + unsigned long Calibration:2; + unsigned long ExpCSICapable:1; + unsigned long ExpNoComSteerCapable:1; + unsigned long ExpComSteerCapable:1; + unsigned long ExpCSIFbk:2; + unsigned long ExpNoComBF:2; + unsigned long ExpComBF:2; + unsigned long MinGrouping:2; + unsigned long CSIBFAntSup:2; + unsigned long NoComSteerBFAntSup:2; + unsigned long ComSteerBFAntSup:2; + unsigned long CSIRowBFSup:2; + unsigned long ChanEstimation:2; + unsigned long rsv:3; } HT_BF_CAP, *PHT_BF_CAP; /* HT antenna selection field in HT Cap IE . */ typedef struct PACKED _HT_AS_CAP { - UCHAR AntSelect:1; - UCHAR ExpCSIFbkTxASEL:1; - UCHAR AntIndFbkTxASEL:1; - UCHAR ExpCSIFbk:1; - UCHAR AntIndFbk:1; - UCHAR RxASel:1; - UCHAR TxSoundPPDU:1; - UCHAR rsv:1; + u8 AntSelect:1; + u8 ExpCSIFbkTxASEL:1; + u8 AntIndFbkTxASEL:1; + u8 ExpCSIFbk:1; + u8 AntIndFbk:1; + u8 RxASel:1; + u8 TxSoundPPDU:1; + u8 rsv:1; } HT_AS_CAP, *PHT_AS_CAP; /* Draft 1.0 set IE length 26, but is extensible.. */ @@ -277,7 +277,7 @@ typedef struct PACKED _HT_CAPABILITY_IE { HT_CAP_INFO HtCapInfo; HT_CAP_PARM HtCapParm; /* HT_MCS_SET HtMCSSet; */ - UCHAR MCSSet[16]; + u8 MCSSet[16]; EXT_HT_CAP_INFO ExtHtCapInfo; HT_BF_CAP TxBFCap; /* beamforming cap. rt2860c not support beamforming. */ HT_AS_CAP ASCap; /*antenna selection. */ @@ -297,77 +297,77 @@ typedef struct PACKED _HT_CAPABILITY_IE { /* being obligated to perform OBSS Scan operations. default is 25(== 0.25%) */ typedef struct PACKED _OVERLAP_BSS_SCAN_IE { - USHORT ScanPassiveDwell; - USHORT ScanActiveDwell; - USHORT TriggerScanInt; /* Trigger scan interval */ - USHORT PassiveTalPerChannel; /* passive total per channel */ - USHORT ActiveTalPerChannel; /* active total per channel */ - USHORT DelayFactor; /* BSS width channel transition delay factor */ - USHORT ScanActThre; /* Scan Activity threshold */ + u16 ScanPassiveDwell; + u16 ScanActiveDwell; + u16 TriggerScanInt; /* Trigger scan interval */ + u16 PassiveTalPerChannel; /* passive total per channel */ + u16 ActiveTalPerChannel; /* active total per channel */ + u16 DelayFactor; /* BSS width channel transition delay factor */ + u16 ScanActThre; /* Scan Activity threshold */ } OVERLAP_BSS_SCAN_IE, *POVERLAP_BSS_SCAN_IE; /* 7.3.2.56. 20/40 Coexistence element used in Element ID = 72 = IE_2040_BSS_COEXIST */ typedef union PACKED _BSS_2040_COEXIST_IE { struct PACKED { - UCHAR InfoReq:1; - UCHAR Intolerant40:1; /* Inter-BSS. set 1 when prohibits a receiving BSS from operating as a 20/40 Mhz BSS. */ - UCHAR BSS20WidthReq:1; /* Intra-BSS set 1 when prohibits a receiving AP from operating its BSS as a 20/40MHz BSS. */ - UCHAR rsv:5; + u8 InfoReq:1; + u8 Intolerant40:1; /* Inter-BSS. set 1 when prohibits a receiving BSS from operating as a 20/40 Mhz BSS. */ + u8 BSS20WidthReq:1; /* Intra-BSS set 1 when prohibits a receiving AP from operating its BSS as a 20/40MHz BSS. */ + u8 rsv:5; } field; - UCHAR word; + u8 word; } BSS_2040_COEXIST_IE, *PBSS_2040_COEXIST_IE; typedef struct _TRIGGER_EVENTA { BOOLEAN bValid; - UCHAR BSSID[6]; - UCHAR RegClass; /* Regulatory Class */ - USHORT Channel; - ULONG CDCounter; /* Maintain a seperate count down counter for each Event A. */ + u8 BSSID[6]; + u8 RegClass; /* Regulatory Class */ + u16 Channel; + unsigned long CDCounter; /* Maintain a seperate count down counter for each Event A. */ } TRIGGER_EVENTA, *PTRIGGER_EVENTA; /* 20/40 trigger event table */ /* If one Event A delete or created, or if Event B is detected or not detected, STA should send 2040BSSCoexistence to AP. */ #define MAX_TRIGGER_EVENT 64 typedef struct _TRIGGER_EVENT_TAB { - UCHAR EventANo; + u8 EventANo; TRIGGER_EVENTA EventA[MAX_TRIGGER_EVENT]; - ULONG EventBCountDown; /* Count down counter for Event B. */ + unsigned long EventBCountDown; /* Count down counter for Event B. */ } TRIGGER_EVENT_TAB, *PTRIGGER_EVENT_TAB; /* 7.3.27 20/40 Bss Coexistence Mgmt capability used in extended capabilities information IE( ID = 127 = IE_EXT_CAPABILITY). */ /* This is the first octet and was defined in 802.11n D3.03 and 802.11yD9.0 */ typedef struct PACKED _EXT_CAP_INFO_ELEMENT { - UCHAR BssCoexistMgmtSupport:1; - UCHAR rsv:1; - UCHAR ExtendChannelSwitch:1; - UCHAR rsv2:5; + u8 BssCoexistMgmtSupport:1; + u8 rsv:1; + u8 ExtendChannelSwitch:1; + u8 rsv2:5; } EXT_CAP_INFO_ELEMENT, *PEXT_CAP_INFO_ELEMENT; /* 802.11n 7.3.2.61 */ typedef struct PACKED _BSS_2040_COEXIST_ELEMENT { - UCHAR ElementID; /* ID = IE_2040_BSS_COEXIST = 72 */ - UCHAR Len; + u8 ElementID; /* ID = IE_2040_BSS_COEXIST = 72 */ + u8 Len; BSS_2040_COEXIST_IE BssCoexistIe; } BSS_2040_COEXIST_ELEMENT, *PBSS_2040_COEXIST_ELEMENT; /*802.11n 7.3.2.59 */ typedef struct PACKED _BSS_2040_INTOLERANT_CH_REPORT { - UCHAR ElementID; /* ID = IE_2040_BSS_INTOLERANT_REPORT = 73 */ - UCHAR Len; - UCHAR RegulatoryClass; - UCHAR ChList[0]; + u8 ElementID; /* ID = IE_2040_BSS_INTOLERANT_REPORT = 73 */ + u8 Len; + u8 RegulatoryClass; + u8 ChList[0]; } BSS_2040_INTOLERANT_CH_REPORT, *PBSS_2040_INTOLERANT_CH_REPORT; /* The structure for channel switch annoucement IE. This is in 802.11n D3.03 */ typedef struct PACKED _CHA_SWITCH_ANNOUNCE_IE { - UCHAR SwitchMode; /*channel switch mode */ - UCHAR NewChannel; /* */ - UCHAR SwitchCount; /* */ + u8 SwitchMode; /*channel switch mode */ + u8 NewChannel; /* */ + u8 SwitchCount; /* */ } CHA_SWITCH_ANNOUNCE_IE, *PCHA_SWITCH_ANNOUNCE_IE; /* The structure for channel switch annoucement IE. This is in 802.11n D3.03 */ typedef struct PACKED _SEC_CHA_OFFSET_IE { - UCHAR SecondaryChannelOffset; /* 1: Secondary above, 3: Secondary below, 0: no Secondary */ + u8 SecondaryChannelOffset; /* 1: Secondary above, 3: Secondary below, 0: no Secondary */ } SEC_CHA_OFFSET_IE, *PSEC_CHA_OFFSET_IE; /* This structure is extracted from struct RT_HT_CAPABILITY */ @@ -375,156 +375,156 @@ typedef struct { BOOLEAN bHtEnable; /* If we should use ht rate. */ BOOLEAN bPreNHt; /* If we should use ht rate. */ /*Substract from HT Capability IE */ - UCHAR MCSSet[16]; + u8 MCSSet[16]; } RT_HT_PHY_INFO, *PRT_HT_PHY_INFO; /*This structure substracts ralink supports from all 802.11n-related features. */ /*Features not listed here but contained in 802.11n spec are not supported in rt2860. */ typedef struct { - USHORT ChannelWidth:1; - USHORT MimoPs:2; /*mimo power safe MMPS_ */ - USHORT GF:1; /*green field */ - USHORT ShortGIfor20:1; - USHORT ShortGIfor40:1; /*for40MHz */ - USHORT TxSTBC:1; - USHORT RxSTBC:2; /* 2 bits */ - USHORT AmsduEnable:1; /* Enable to transmit A-MSDU. Suggest disable. We should use A-MPDU to gain best benifit of 802.11n */ - USHORT AmsduSize:1; /* Max receiving A-MSDU size */ - USHORT rsv:5; + u16 ChannelWidth:1; + u16 MimoPs:2; /*mimo power safe MMPS_ */ + u16 GF:1; /*green field */ + u16 ShortGIfor20:1; + u16 ShortGIfor40:1; /*for40MHz */ + u16 TxSTBC:1; + u16 RxSTBC:2; /* 2 bits */ + u16 AmsduEnable:1; /* Enable to transmit A-MSDU. Suggest disable. We should use A-MPDU to gain best benifit of 802.11n */ + u16 AmsduSize:1; /* Max receiving A-MSDU size */ + u16 rsv:5; /*Substract from Addiont HT INFO IE */ - UCHAR MaxRAmpduFactor:2; - UCHAR MpduDensity:3; - UCHAR ExtChanOffset:2; /* Please not the difference with following UCHAR NewExtChannelOffset; from 802.11n */ - UCHAR RecomWidth:1; + u8 MaxRAmpduFactor:2; + u8 MpduDensity:3; + u8 ExtChanOffset:2; /* Please not the difference with following u8 NewExtChannelOffset; from 802.11n */ + u8 RecomWidth:1; - USHORT OperaionMode:2; - USHORT NonGfPresent:1; - USHORT rsv3:1; - USHORT OBSS_NonHTExist:1; - USHORT rsv2:11; + u16 OperaionMode:2; + u16 NonGfPresent:1; + u16 rsv3:1; + u16 OBSS_NonHTExist:1; + u16 rsv2:11; /* New Extension Channel Offset IE */ - UCHAR NewExtChannelOffset; + u8 NewExtChannelOffset; /* Extension Capability IE = 127 */ - UCHAR BSSCoexist2040; + u8 BSSCoexist2040; } RT_HT_CAPABILITY, *PRT_HT_CAPABILITY; /* field in Addtional HT Information IE . */ typedef struct PACKED { - UCHAR ExtChanOffset:2; - UCHAR RecomWidth:1; - UCHAR RifsMode:1; - UCHAR S_PSMPSup:1; /*Indicate support for scheduled PSMP */ - UCHAR SerInterGranu:3; /*service interval granularity */ + u8 ExtChanOffset:2; + u8 RecomWidth:1; + u8 RifsMode:1; + u8 S_PSMPSup:1; /*Indicate support for scheduled PSMP */ + u8 SerInterGranu:3; /*service interval granularity */ } ADD_HTINFO, *PADD_HTINFO; typedef struct PACKED { - USHORT OperaionMode:2; - USHORT NonGfPresent:1; - USHORT rsv:1; - USHORT OBSS_NonHTExist:1; - USHORT rsv2:11; + u16 OperaionMode:2; + u16 NonGfPresent:1; + u16 rsv:1; + u16 OBSS_NonHTExist:1; + u16 rsv2:11; } ADD_HTINFO2, *PADD_HTINFO2; /* TODO: Need sync with spec about the definition of StbcMcs. In Draft 3.03, it's reserved. */ typedef struct PACKED { - USHORT StbcMcs:6; - USHORT DualBeacon:1; - USHORT DualCTSProtect:1; - USHORT STBCBeacon:1; - USHORT LsigTxopProt:1; /* L-SIG TXOP protection full support */ - USHORT PcoActive:1; - USHORT PcoPhase:1; - USHORT rsv:4; + u16 StbcMcs:6; + u16 DualBeacon:1; + u16 DualCTSProtect:1; + u16 STBCBeacon:1; + u16 LsigTxopProt:1; /* L-SIG TXOP protection full support */ + u16 PcoActive:1; + u16 PcoPhase:1; + u16 rsv:4; } ADD_HTINFO3, *PADD_HTINFO3; #define SIZE_ADD_HT_INFO_IE 22 typedef struct PACKED { - UCHAR ControlChan; + u8 ControlChan; ADD_HTINFO AddHtInfo; ADD_HTINFO2 AddHtInfo2; ADD_HTINFO3 AddHtInfo3; - UCHAR MCSSet[16]; /* Basic MCS set */ + u8 MCSSet[16]; /* Basic MCS set */ } ADD_HT_INFO_IE, *PADD_HT_INFO_IE; typedef struct PACKED { - UCHAR NewExtChanOffset; + u8 NewExtChanOffset; } NEW_EXT_CHAN_IE, *PNEW_EXT_CHAN_IE; typedef struct PACKED _FRAME_802_11 { HEADER_802_11 Hdr; - UCHAR Octet[1]; + u8 Octet[1]; } FRAME_802_11, *PFRAME_802_11; /* QoSNull embedding of management action. When HT Control MA field set to 1. */ typedef struct PACKED _MA_BODY { - UCHAR Category; - UCHAR Action; - UCHAR Octet[1]; + u8 Category; + u8 Action; + u8 Octet[1]; } MA_BODY, *PMA_BODY; typedef struct PACKED _HEADER_802_3 { - UCHAR DAAddr1[MAC_ADDR_LEN]; - UCHAR SAAddr2[MAC_ADDR_LEN]; - UCHAR Octet[2]; + u8 DAAddr1[MAC_ADDR_LEN]; + u8 SAAddr2[MAC_ADDR_LEN]; + u8 Octet[2]; } HEADER_802_3, *PHEADER_802_3; /*//Block ACK related format */ /* 2-byte BA Parameter field in DELBA frames to terminate an already set up bA */ typedef struct PACKED { - USHORT Rsv:11; /* always set to 0 */ - USHORT Initiator:1; /* 1: originator 0:recipient */ - USHORT TID:4; /* value of TC os TS */ + u16 Rsv:11; /* always set to 0 */ + u16 Initiator:1; /* 1: originator 0:recipient */ + u16 TID:4; /* value of TC os TS */ } DELBA_PARM, *PDELBA_PARM; /* 2-byte BA Parameter Set field in ADDBA frames to signal parm for setting up a BA */ typedef struct PACKED { - USHORT AMSDUSupported:1; /* 0: not permitted 1: permitted */ - USHORT BAPolicy:1; /* 1: immediately BA 0:delayed BA */ - USHORT TID:4; /* value of TC os TS */ - USHORT BufSize:10; /* number of buffe of size 2304 octetsr */ + u16 AMSDUSupported:1; /* 0: not permitted 1: permitted */ + u16 BAPolicy:1; /* 1: immediately BA 0:delayed BA */ + u16 TID:4; /* value of TC os TS */ + u16 BufSize:10; /* number of buffe of size 2304 octetsr */ } BA_PARM, *PBA_PARM; /* 2-byte BA Starting Seq CONTROL field */ typedef union PACKED { struct PACKED { - USHORT FragNum:4; /* always set to 0 */ - USHORT StartSeq:12; /* sequence number of the 1st MSDU for which this BAR is sent */ + u16 FragNum:4; /* always set to 0 */ + u16 StartSeq:12; /* sequence number of the 1st MSDU for which this BAR is sent */ } field; - USHORT word; + u16 word; } BASEQ_CONTROL, *PBASEQ_CONTROL; /*BAControl and BARControl are the same */ /* 2-byte BA CONTROL field in BA frame */ typedef struct PACKED { - USHORT ACKPolicy:1; /* only related to N-Delayed BA. But not support in RT2860b. 0:NormalACK 1:No ACK */ - USHORT MTID:1; /*EWC V1.24 */ - USHORT Compressed:1; - USHORT Rsv:9; - USHORT TID:4; + u16 ACKPolicy:1; /* only related to N-Delayed BA. But not support in RT2860b. 0:NormalACK 1:No ACK */ + u16 MTID:1; /*EWC V1.24 */ + u16 Compressed:1; + u16 Rsv:9; + u16 TID:4; } BA_CONTROL, *PBA_CONTROL; /* 2-byte BAR CONTROL field in BAR frame */ typedef struct PACKED { - USHORT ACKPolicy:1; /* 0:normal ack, 1:no ack. */ - USHORT MTID:1; /*if this bit1, use FRAME_MTBA_REQ, if 0, use FRAME_BA_REQ */ - USHORT Compressed:1; - USHORT Rsv1:9; - USHORT TID:4; + u16 ACKPolicy:1; /* 0:normal ack, 1:no ack. */ + u16 MTID:1; /*if this bit1, use FRAME_MTBA_REQ, if 0, use FRAME_BA_REQ */ + u16 Compressed:1; + u16 Rsv1:9; + u16 TID:4; } BAR_CONTROL, *PBAR_CONTROL; /* BARControl in MTBAR frame */ typedef struct PACKED { - USHORT ACKPolicy:1; - USHORT MTID:1; - USHORT Compressed:1; - USHORT Rsv1:9; - USHORT NumTID:4; + u16 ACKPolicy:1; + u16 MTID:1; + u16 Compressed:1; + u16 Rsv1:9; + u16 NumTID:4; } MTBAR_CONTROL, *PMTBAR_CONTROL; typedef struct PACKED { - USHORT Rsv1:12; - USHORT TID:4; + u16 Rsv1:12; + u16 TID:4; } PER_TID_INFO, *PPER_TID_INFO; typedef struct { @@ -535,18 +535,18 @@ typedef struct { /* BAREQ AND MTBAREQ have the same subtype BAR, 802.11n BAR use compressed bitmap. */ typedef struct PACKED _FRAME_BA_REQ { FRAME_CONTROL FC; - USHORT Duration; - UCHAR Addr1[MAC_ADDR_LEN]; - UCHAR Addr2[MAC_ADDR_LEN]; + u16 Duration; + u8 Addr1[MAC_ADDR_LEN]; + u8 Addr2[MAC_ADDR_LEN]; BAR_CONTROL BARControl; BASEQ_CONTROL BAStartingSeq; } FRAME_BA_REQ, *PFRAME_BA_REQ; typedef struct PACKED _FRAME_MTBA_REQ { FRAME_CONTROL FC; - USHORT Duration; - UCHAR Addr1[MAC_ADDR_LEN]; - UCHAR Addr2[MAC_ADDR_LEN]; + u16 Duration; + u8 Addr1[MAC_ADDR_LEN]; + u8 Addr2[MAC_ADDR_LEN]; MTBAR_CONTROL MTBARControl; PER_TID_INFO PerTIDInfo; BASEQ_CONTROL BAStartingSeq; @@ -555,84 +555,84 @@ typedef struct PACKED _FRAME_MTBA_REQ { /* Compressed format is mandantory in HT STA */ typedef struct PACKED _FRAME_MTBA { FRAME_CONTROL FC; - USHORT Duration; - UCHAR Addr1[MAC_ADDR_LEN]; - UCHAR Addr2[MAC_ADDR_LEN]; + u16 Duration; + u8 Addr1[MAC_ADDR_LEN]; + u8 Addr2[MAC_ADDR_LEN]; BA_CONTROL BAControl; BASEQ_CONTROL BAStartingSeq; - UCHAR BitMap[8]; + u8 BitMap[8]; } FRAME_MTBA, *PFRAME_MTBA; typedef struct PACKED _FRAME_PSMP_ACTION { HEADER_802_11 Hdr; - UCHAR Category; - UCHAR Action; - UCHAR Psmp; /* 7.3.1.25 */ + u8 Category; + u8 Action; + u8 Psmp; /* 7.3.1.25 */ } FRAME_PSMP_ACTION, *PFRAME_PSMP_ACTION; typedef struct PACKED _FRAME_ACTION_HDR { HEADER_802_11 Hdr; - UCHAR Category; - UCHAR Action; + u8 Category; + u8 Action; } FRAME_ACTION_HDR, *PFRAME_ACTION_HDR; /*Action Frame */ /*Action Frame Category:Spectrum, Action:Channel Switch. 7.3.2.20 */ typedef struct PACKED _CHAN_SWITCH_ANNOUNCE { - UCHAR ElementID; /* ID = IE_CHANNEL_SWITCH_ANNOUNCEMENT = 37 */ - UCHAR Len; + u8 ElementID; /* ID = IE_CHANNEL_SWITCH_ANNOUNCEMENT = 37 */ + u8 Len; CHA_SWITCH_ANNOUNCE_IE CSAnnounceIe; } CHAN_SWITCH_ANNOUNCE, *PCHAN_SWITCH_ANNOUNCE; /*802.11n : 7.3.2.20a */ typedef struct PACKED _SECOND_CHAN_OFFSET { - UCHAR ElementID; /* ID = IE_SECONDARY_CH_OFFSET = 62 */ - UCHAR Len; + u8 ElementID; /* ID = IE_SECONDARY_CH_OFFSET = 62 */ + u8 Len; SEC_CHA_OFFSET_IE SecChOffsetIe; } SECOND_CHAN_OFFSET, *PSECOND_CHAN_OFFSET; typedef struct PACKED _FRAME_SPETRUM_CS { HEADER_802_11 Hdr; - UCHAR Category; - UCHAR Action; + u8 Category; + u8 Action; CHAN_SWITCH_ANNOUNCE CSAnnounce; SECOND_CHAN_OFFSET SecondChannel; } FRAME_SPETRUM_CS, *PFRAME_SPETRUM_CS; typedef struct PACKED _FRAME_ADDBA_REQ { HEADER_802_11 Hdr; - UCHAR Category; - UCHAR Action; - UCHAR Token; /* 1 */ + u8 Category; + u8 Action; + u8 Token; /* 1 */ BA_PARM BaParm; /* 2 - 10 */ - USHORT TimeOutValue; /* 0 - 0 */ + u16 TimeOutValue; /* 0 - 0 */ BASEQ_CONTROL BaStartSeq; /* 0-0 */ } FRAME_ADDBA_REQ, *PFRAME_ADDBA_REQ; typedef struct PACKED _FRAME_ADDBA_RSP { HEADER_802_11 Hdr; - UCHAR Category; - UCHAR Action; - UCHAR Token; - USHORT StatusCode; + u8 Category; + u8 Action; + u8 Token; + u16 StatusCode; BA_PARM BaParm; /*0 - 2 */ - USHORT TimeOutValue; + u16 TimeOutValue; } FRAME_ADDBA_RSP, *PFRAME_ADDBA_RSP; typedef struct PACKED _FRAME_DELBA_REQ { HEADER_802_11 Hdr; - UCHAR Category; - UCHAR Action; + u8 Category; + u8 Action; DELBA_PARM DelbaParm; - USHORT ReasonCode; + u16 ReasonCode; } FRAME_DELBA_REQ, *PFRAME_DELBA_REQ; /*7.2.1.7 */ typedef struct PACKED _FRAME_BAR { FRAME_CONTROL FC; - USHORT Duration; - UCHAR Addr1[MAC_ADDR_LEN]; - UCHAR Addr2[MAC_ADDR_LEN]; + u16 Duration; + u8 Addr1[MAC_ADDR_LEN]; + u8 Addr2[MAC_ADDR_LEN]; BAR_CONTROL BarControl; BASEQ_CONTROL StartingSeq; } FRAME_BAR, *PFRAME_BAR; @@ -640,31 +640,31 @@ typedef struct PACKED _FRAME_BAR { /*7.2.1.7 */ typedef struct PACKED _FRAME_BA { FRAME_CONTROL FC; - USHORT Duration; - UCHAR Addr1[MAC_ADDR_LEN]; - UCHAR Addr2[MAC_ADDR_LEN]; + u16 Duration; + u8 Addr1[MAC_ADDR_LEN]; + u8 Addr2[MAC_ADDR_LEN]; BAR_CONTROL BarControl; BASEQ_CONTROL StartingSeq; - UCHAR bitmask[8]; + u8 bitmask[8]; } FRAME_BA, *PFRAME_BA; /* Radio Measuement Request Frame Format */ typedef struct PACKED _FRAME_RM_REQ_ACTION { HEADER_802_11 Hdr; - UCHAR Category; - UCHAR Action; - UCHAR Token; - USHORT Repetition; - UCHAR data[0]; + u8 Category; + u8 Action; + u8 Token; + u16 Repetition; + u8 data[0]; } FRAME_RM_REQ_ACTION, *PFRAME_RM_REQ_ACTION; typedef struct PACKED { - UCHAR ID; - UCHAR Length; - UCHAR ChannelSwitchMode; - UCHAR NewRegClass; - UCHAR NewChannelNum; - UCHAR ChannelSwitchCount; + u8 ID; + u8 Length; + u8 ChannelSwitchMode; + u8 NewRegClass; + u8 NewChannelNum; + u8 ChannelSwitchCount; } HT_EXT_CHANNEL_SWITCH_ANNOUNCEMENT_IE, *PHT_EXT_CHANNEL_SWITCH_ANNOUNCEMENT_IE; @@ -683,17 +683,17 @@ typedef struct PACKED { /* */ typedef struct PACKED { BOOLEAN bValid; /* 1: variable contains valid value */ - UCHAR CfpCount; - UCHAR CfpPeriod; - USHORT CfpMaxDuration; - USHORT CfpDurRemaining; + u8 CfpCount; + u8 CfpPeriod; + u16 CfpMaxDuration; + u16 CfpDurRemaining; } CF_PARM, *PCF_PARM; typedef struct _CIPHER_SUITE { NDIS_802_11_ENCRYPTION_STATUS PairCipher; /* Unicast cipher 1, this one has more secured cipher suite */ NDIS_802_11_ENCRYPTION_STATUS PairCipherAux; /* Unicast cipher 2 if AP announce two unicast cipher suite */ NDIS_802_11_ENCRYPTION_STATUS GroupCipher; /* Group cipher */ - USHORT RsnCapability; /* RSN capability from beacon */ + u16 RsnCapability; /* RSN capability from beacon */ BOOLEAN bMixMode; /* Indicate Pair & Group cipher might be different */ } CIPHER_SUITE, *PCIPHER_SUITE; @@ -706,38 +706,38 @@ typedef struct { BOOLEAN bTxopRequest; BOOLEAN bAPSDCapable; /* BOOLEAN bMoreDataAck; */ - UCHAR EdcaUpdateCount; - UCHAR Aifsn[4]; /* 0:AC_BK, 1:AC_BE, 2:AC_VI, 3:AC_VO */ - UCHAR Cwmin[4]; - UCHAR Cwmax[4]; - USHORT Txop[4]; /* in unit of 32-us */ + u8 EdcaUpdateCount; + u8 Aifsn[4]; /* 0:AC_BK, 1:AC_BE, 2:AC_VI, 3:AC_VO */ + u8 Cwmin[4]; + u8 Cwmax[4]; + u16 Txop[4]; /* in unit of 32-us */ BOOLEAN bACM[4]; /* 1: Admission Control of AC_BK is mandattory */ } EDCA_PARM, *PEDCA_PARM; /* QBSS LOAD information from QAP's BEACON/ProbeRsp */ typedef struct { BOOLEAN bValid; /* 1: variable contains valid value */ - USHORT StaNum; - UCHAR ChannelUtilization; - USHORT RemainingAdmissionControl; /* in unit of 32-us */ + u16 StaNum; + u8 ChannelUtilization; + u16 RemainingAdmissionControl; /* in unit of 32-us */ } QBSS_LOAD_PARM, *PQBSS_LOAD_PARM; /* QBSS Info field in QSTA's assoc req */ typedef struct PACKED { - UCHAR UAPSD_AC_VO:1; - UCHAR UAPSD_AC_VI:1; - UCHAR UAPSD_AC_BK:1; - UCHAR UAPSD_AC_BE:1; - UCHAR Rsv1:1; - UCHAR MaxSPLength:2; - UCHAR Rsv2:1; + u8 UAPSD_AC_VO:1; + u8 UAPSD_AC_VI:1; + u8 UAPSD_AC_BK:1; + u8 UAPSD_AC_BE:1; + u8 Rsv1:1; + u8 MaxSPLength:2; + u8 Rsv2:1; } QBSS_STA_INFO_PARM, *PQBSS_STA_INFO_PARM; /* QBSS Info field in QAP's Beacon/ProbeRsp */ typedef struct PACKED { - UCHAR ParamSetCount:4; - UCHAR Rsv:3; - UCHAR UAPSD:1; + u8 ParamSetCount:4; + u8 Rsv:3; + u8 UAPSD:1; } QBSS_AP_INFO_PARM, *PQBSS_AP_INFO_PARM; /* QOS Capability reported in QAP's BEACON/ProbeRsp */ @@ -748,46 +748,46 @@ typedef struct { BOOLEAN bQueueRequest; BOOLEAN bTxopRequest; /* BOOLEAN bMoreDataAck; */ - UCHAR EdcaUpdateCount; + u8 EdcaUpdateCount; } QOS_CAPABILITY_PARM, *PQOS_CAPABILITY_PARM; typedef struct { - UCHAR IELen; - UCHAR IE[MAX_CUSTOM_LEN]; + u8 IELen; + u8 IE[MAX_CUSTOM_LEN]; } WPA_IE_; typedef struct { - UCHAR Bssid[MAC_ADDR_LEN]; - UCHAR Channel; - UCHAR CentralChannel; /*Store the wide-band central channel for 40MHz. .used in 40MHz AP. Or this is the same as Channel. */ - UCHAR BssType; - USHORT AtimWin; - USHORT BeaconPeriod; - - UCHAR SupRate[MAX_LEN_OF_SUPPORTED_RATES]; - UCHAR SupRateLen; - UCHAR ExtRate[MAX_LEN_OF_SUPPORTED_RATES]; - UCHAR ExtRateLen; + u8 Bssid[MAC_ADDR_LEN]; + u8 Channel; + u8 CentralChannel; /*Store the wide-band central channel for 40MHz. .used in 40MHz AP. Or this is the same as Channel. */ + u8 BssType; + u16 AtimWin; + u16 BeaconPeriod; + + u8 SupRate[MAX_LEN_OF_SUPPORTED_RATES]; + u8 SupRateLen; + u8 ExtRate[MAX_LEN_OF_SUPPORTED_RATES]; + u8 ExtRateLen; HT_CAPABILITY_IE HtCapability; - UCHAR HtCapabilityLen; + u8 HtCapabilityLen; ADD_HT_INFO_IE AddHtInfo; /* AP might use this additional ht info IE */ - UCHAR AddHtInfoLen; - UCHAR NewExtChanOffset; - CHAR Rssi; - UCHAR Privacy; /* Indicate security function ON/OFF. Don't mess up with auth mode. */ - UCHAR Hidden; + u8 AddHtInfoLen; + u8 NewExtChanOffset; + char Rssi; + u8 Privacy; /* Indicate security function ON/OFF. Don't mess up with auth mode. */ + u8 Hidden; - USHORT DtimPeriod; - USHORT CapabilityInfo; + u16 DtimPeriod; + u16 CapabilityInfo; - USHORT CfpCount; - USHORT CfpPeriod; - USHORT CfpMaxDuration; - USHORT CfpDurRemaining; - UCHAR SsidLen; - CHAR Ssid[MAX_LEN_OF_SSID]; + u16 CfpCount; + u16 CfpPeriod; + u16 CfpMaxDuration; + u16 CfpDurRemaining; + u8 SsidLen; + char Ssid[MAX_LEN_OF_SSID]; - ULONG LastBeaconRxTime; /* OS's timestamp */ + unsigned long LastBeaconRxTime; /* OS's timestamp */ BOOLEAN bSES; @@ -800,15 +800,15 @@ typedef struct { NDIS_802_11_AUTHENTICATION_MODE AuthModeAux; /* Addition mode for WPA2 / WPA capable AP */ NDIS_802_11_AUTHENTICATION_MODE AuthMode; NDIS_802_11_WEP_STATUS WepStatus; /* Unicast Encryption Algorithm extract from VAR_IE */ - USHORT VarIELen; /* Length of next VIE include EID & Length */ - UCHAR VarIEs[MAX_VIE_LEN]; + u16 VarIELen; /* Length of next VIE include EID & Length */ + u8 VarIEs[MAX_VIE_LEN]; /* CCX Ckip information */ - UCHAR CkipFlag; + u8 CkipFlag; /* CCX 2 TSF */ - UCHAR PTSF[4]; /* Parent TSF */ - UCHAR TTSF[8]; /* Target TSF */ + u8 PTSF[4]; /* Parent TSF */ + u8 TTSF[8]; /* Target TSF */ /* 802.11e d9, and WMM */ EDCA_PARM EdcaParm; @@ -819,41 +819,41 @@ typedef struct { } BSS_ENTRY, *PBSS_ENTRY; typedef struct { - UCHAR BssNr; - UCHAR BssOverlapNr; + u8 BssNr; + u8 BssOverlapNr; BSS_ENTRY BssEntry[MAX_LEN_OF_BSS_TABLE]; } BSS_TABLE, *PBSS_TABLE; typedef struct _MLME_QUEUE_ELEM { - ULONG Machine; - ULONG MsgType; - ULONG MsgLen; - UCHAR Msg[MGMT_DMA_BUFFER_SIZE]; + unsigned long Machine; + unsigned long MsgType; + unsigned long MsgLen; + u8 Msg[MGMT_DMA_BUFFER_SIZE]; LARGE_INTEGER TimeStamp; - UCHAR Rssi0; - UCHAR Rssi1; - UCHAR Rssi2; - UCHAR Signal; - UCHAR Channel; - UCHAR Wcid; + u8 Rssi0; + u8 Rssi1; + u8 Rssi2; + u8 Signal; + u8 Channel; + u8 Wcid; BOOLEAN Occupied; } MLME_QUEUE_ELEM, *PMLME_QUEUE_ELEM; typedef struct _MLME_QUEUE { - ULONG Num; - ULONG Head; - ULONG Tail; + unsigned long Num; + unsigned long Head; + unsigned long Tail; NDIS_SPIN_LOCK Lock; MLME_QUEUE_ELEM Entry[MAX_LEN_OF_MLME_QUEUE]; } MLME_QUEUE, *PMLME_QUEUE; -typedef VOID(*STATE_MACHINE_FUNC) (VOID * Adaptor, MLME_QUEUE_ELEM * Elem); +typedef void(*STATE_MACHINE_FUNC) (void * Adaptor, MLME_QUEUE_ELEM * Elem); typedef struct _STATE_MACHINE { - ULONG Base; - ULONG NrState; - ULONG NrMsg; - ULONG CurrState; + unsigned long Base; + unsigned long NrState; + unsigned long NrMsg; + unsigned long CurrState; STATE_MACHINE_FUNC *TransFunc; } STATE_MACHINE, *PSTATE_MACHINE; @@ -864,33 +864,33 @@ typedef struct _STATE_MACHINE { /* separate this under-trial settings away from pAd->StaActive so that once */ /* this new attempt failed, driver can auto-recover back to the active settings. */ typedef struct _MLME_AUX { - UCHAR BssType; - UCHAR Ssid[MAX_LEN_OF_SSID]; - UCHAR SsidLen; - UCHAR Bssid[MAC_ADDR_LEN]; - UCHAR AutoReconnectSsid[MAX_LEN_OF_SSID]; - UCHAR AutoReconnectSsidLen; - USHORT Alg; - UCHAR ScanType; - UCHAR Channel; - UCHAR CentralChannel; - USHORT Aid; - USHORT CapabilityInfo; - USHORT BeaconPeriod; - USHORT CfpMaxDuration; - USHORT CfpPeriod; - USHORT AtimWin; + u8 BssType; + u8 Ssid[MAX_LEN_OF_SSID]; + u8 SsidLen; + u8 Bssid[MAC_ADDR_LEN]; + u8 AutoReconnectSsid[MAX_LEN_OF_SSID]; + u8 AutoReconnectSsidLen; + u16 Alg; + u8 ScanType; + u8 Channel; + u8 CentralChannel; + u16 Aid; + u16 CapabilityInfo; + u16 BeaconPeriod; + u16 CfpMaxDuration; + u16 CfpPeriod; + u16 AtimWin; /* Copy supported rate from desired AP's beacon. We are trying to match */ /* AP's supported and extended rate settings. */ - UCHAR SupRate[MAX_LEN_OF_SUPPORTED_RATES]; - UCHAR ExtRate[MAX_LEN_OF_SUPPORTED_RATES]; - UCHAR SupRateLen; - UCHAR ExtRateLen; + u8 SupRate[MAX_LEN_OF_SUPPORTED_RATES]; + u8 ExtRate[MAX_LEN_OF_SUPPORTED_RATES]; + u8 SupRateLen; + u8 ExtRateLen; HT_CAPABILITY_IE HtCapability; - UCHAR HtCapabilityLen; + u8 HtCapabilityLen; ADD_HT_INFO_IE AddHtInfo; /* AP might use this additional ht info IE */ - UCHAR NewExtChannelOffset; + u8 NewExtChannelOffset; /*RT_HT_CAPABILITY SupportedHtPhy; */ /* new for QOS */ @@ -899,12 +899,12 @@ typedef struct _MLME_AUX { QBSS_LOAD_PARM APQbssLoad; /* QBSS load of the current associated AP */ /* new to keep Ralink specific feature */ - ULONG APRalinkIe; + unsigned long APRalinkIe; BSS_TABLE SsidBssTab; /* AP list for the same SSID */ BSS_TABLE RoamTab; /* AP list eligible for roaming */ - ULONG BssIdx; - ULONG RoamIdx; + unsigned long BssIdx; + unsigned long RoamIdx; BOOLEAN CurrReqIsFromNdis; @@ -914,81 +914,81 @@ typedef struct _MLME_AUX { } MLME_AUX, *PMLME_AUX; typedef struct _MLME_ADDBA_REQ_STRUCT { - UCHAR Wcid; /* */ - UCHAR pAddr[MAC_ADDR_LEN]; - UCHAR BaBufSize; - USHORT TimeOutValue; - UCHAR TID; - UCHAR Token; - USHORT BaStartSeq; + u8 Wcid; /* */ + u8 pAddr[MAC_ADDR_LEN]; + u8 BaBufSize; + u16 TimeOutValue; + u8 TID; + u8 Token; + u16 BaStartSeq; } MLME_ADDBA_REQ_STRUCT, *PMLME_ADDBA_REQ_STRUCT; typedef struct _MLME_DELBA_REQ_STRUCT { - UCHAR Wcid; /* */ - UCHAR Addr[MAC_ADDR_LEN]; - UCHAR TID; - UCHAR Initiator; + u8 Wcid; /* */ + u8 Addr[MAC_ADDR_LEN]; + u8 TID; + u8 Initiator; } MLME_DELBA_REQ_STRUCT, *PMLME_DELBA_REQ_STRUCT; /* assoc struct is equal to reassoc */ typedef struct _MLME_ASSOC_REQ_STRUCT { - UCHAR Addr[MAC_ADDR_LEN]; - USHORT CapabilityInfo; - USHORT ListenIntv; - ULONG Timeout; + u8 Addr[MAC_ADDR_LEN]; + u16 CapabilityInfo; + u16 ListenIntv; + unsigned long Timeout; } MLME_ASSOC_REQ_STRUCT, *PMLME_ASSOC_REQ_STRUCT, MLME_REASSOC_REQ_STRUCT, *PMLME_REASSOC_REQ_STRUCT; typedef struct _MLME_DISASSOC_REQ_STRUCT { - UCHAR Addr[MAC_ADDR_LEN]; - USHORT Reason; + u8 Addr[MAC_ADDR_LEN]; + u16 Reason; } MLME_DISASSOC_REQ_STRUCT, *PMLME_DISASSOC_REQ_STRUCT; typedef struct _MLME_AUTH_REQ_STRUCT { - UCHAR Addr[MAC_ADDR_LEN]; - USHORT Alg; - ULONG Timeout; + u8 Addr[MAC_ADDR_LEN]; + u16 Alg; + unsigned long Timeout; } MLME_AUTH_REQ_STRUCT, *PMLME_AUTH_REQ_STRUCT; typedef struct _MLME_DEAUTH_REQ_STRUCT { - UCHAR Addr[MAC_ADDR_LEN]; - USHORT Reason; + u8 Addr[MAC_ADDR_LEN]; + u16 Reason; } MLME_DEAUTH_REQ_STRUCT, *PMLME_DEAUTH_REQ_STRUCT; typedef struct { - ULONG BssIdx; + unsigned long BssIdx; } MLME_JOIN_REQ_STRUCT; typedef struct _MLME_SCAN_REQ_STRUCT { - UCHAR Bssid[MAC_ADDR_LEN]; - UCHAR BssType; - UCHAR ScanType; - UCHAR SsidLen; - CHAR Ssid[MAX_LEN_OF_SSID]; + u8 Bssid[MAC_ADDR_LEN]; + u8 BssType; + u8 ScanType; + u8 SsidLen; + char Ssid[MAX_LEN_OF_SSID]; } MLME_SCAN_REQ_STRUCT, *PMLME_SCAN_REQ_STRUCT; typedef struct _MLME_START_REQ_STRUCT { - CHAR Ssid[MAX_LEN_OF_SSID]; - UCHAR SsidLen; + char Ssid[MAX_LEN_OF_SSID]; + u8 SsidLen; } MLME_START_REQ_STRUCT, *PMLME_START_REQ_STRUCT; typedef struct PACKED { - UCHAR Eid; - UCHAR Len; - UCHAR Octet[1]; + u8 Eid; + u8 Len; + u8 Octet[1]; } EID_STRUCT, *PEID_STRUCT, BEACON_EID_STRUCT, *PBEACON_EID_STRUCT; typedef struct PACKED _RTMP_TX_RATE_SWITCH { - UCHAR ItemNo; - UCHAR STBC:1; - UCHAR ShortGI:1; - UCHAR BW:1; - UCHAR Rsv1:1; - UCHAR Mode:2; - UCHAR Rsv2:2; - UCHAR CurrMCS; - UCHAR TrainUp; - UCHAR TrainDown; + u8 ItemNo; + u8 STBC:1; + u8 ShortGI:1; + u8 BW:1; + u8 Rsv1:1; + u8 Mode:2; + u8 Rsv2:2; + u8 CurrMCS; + u8 TrainUp; + u8 TrainDown; } RRTMP_TX_RATE_SWITCH, *PRTMP_TX_RATE_SWITCH; /* ========================== AP mlme.h =============================== */ diff --git a/drivers/staging/rt2860/oid.h b/drivers/staging/rt2860/oid.h index ba72141..05a71f0 100644 --- a/drivers/staging/rt2860/oid.h +++ b/drivers/staging/rt2860/oid.h @@ -135,7 +135,7 @@ typedef enum _NDIS_802_11_STATUS_TYPE { Ndis802_11StatusTypeMax /* not a real type, defined as an upper bound */ } NDIS_802_11_STATUS_TYPE, *PNDIS_802_11_STATUS_TYPE; -typedef UCHAR NDIS_802_11_MAC_ADDRESS[6]; +typedef u8 NDIS_802_11_MAC_ADDRESS[6]; typedef struct _NDIS_802_11_STATUS_INDICATION { NDIS_802_11_STATUS_TYPE StatusType; @@ -150,20 +150,20 @@ typedef struct _NDIS_802_11_STATUS_INDICATION { #define NDIS_802_11_AUTH_REQUEST_GROUP_ERROR 0x0E typedef struct _NDIS_802_11_AUTHENTICATION_REQUEST { - ULONG Length; /* Length of structure */ + unsigned long Length; /* Length of structure */ NDIS_802_11_MAC_ADDRESS Bssid; - ULONG Flags; + unsigned long Flags; } NDIS_802_11_AUTHENTICATION_REQUEST, *PNDIS_802_11_AUTHENTICATION_REQUEST; /*Added new types for PMKID Candidate lists. */ typedef struct _PMKID_CANDIDATE { NDIS_802_11_MAC_ADDRESS BSSID; - ULONG Flags; + unsigned long Flags; } PMKID_CANDIDATE, *PPMKID_CANDIDATE; typedef struct _NDIS_802_11_PMKID_CANDIDATE_LIST { - ULONG Version; /* Version of the structure */ - ULONG NumCandidates; /* No. of pmkid candidates */ + unsigned long Version; /* Version of the structure */ + unsigned long NumCandidates; /* No. of pmkid candidates */ PMKID_CANDIDATE CandidateList[1]; } NDIS_802_11_PMKID_CANDIDATE_LIST, *PNDIS_802_11_PMKID_CANDIDATE_LIST; @@ -183,7 +183,7 @@ typedef enum _NDIS_802_11_NETWORK_TYPE { } NDIS_802_11_NETWORK_TYPE, *PNDIS_802_11_NETWORK_TYPE; typedef struct _NDIS_802_11_NETWORK_TYPE_LIST { - UINT NumberOfItems; /* in list below, at least 1 */ + u32 NumberOfItems; /* in list below, at least 1 */ NDIS_802_11_NETWORK_TYPE NetworkType[1]; } NDIS_802_11_NETWORK_TYPE_LIST, *PNDIS_802_11_NETWORK_TYPE_LIST; @@ -195,30 +195,30 @@ typedef enum _NDIS_802_11_POWER_MODE { Ndis802_11PowerModeMax /* not a real mode, defined as an upper bound */ } NDIS_802_11_POWER_MODE, *PNDIS_802_11_POWER_MODE; -typedef ULONG NDIS_802_11_TX_POWER_LEVEL; /* in milliwatts */ +typedef unsigned long NDIS_802_11_TX_POWER_LEVEL; /* in milliwatts */ /* */ /* Received Signal Strength Indication */ /* */ -typedef LONG NDIS_802_11_RSSI; /* in dBm */ +typedef long NDIS_802_11_RSSI; /* in dBm */ typedef struct _NDIS_802_11_CONFIGURATION_FH { - ULONG Length; /* Length of structure */ - ULONG HopPattern; /* As defined by 802.11, MSB set */ - ULONG HopSet; /* to one if non-802.11 */ - ULONG DwellTime; /* units are Kusec */ + unsigned long Length; /* Length of structure */ + unsigned long HopPattern; /* As defined by 802.11, MSB set */ + unsigned long HopSet; /* to one if non-802.11 */ + unsigned long DwellTime; /* units are Kusec */ } NDIS_802_11_CONFIGURATION_FH, *PNDIS_802_11_CONFIGURATION_FH; typedef struct _NDIS_802_11_CONFIGURATION { - ULONG Length; /* Length of structure */ - ULONG BeaconPeriod; /* units are Kusec */ - ULONG ATIMWindow; /* units are Kusec */ - ULONG DSConfig; /* Frequency, units are kHz */ + unsigned long Length; /* Length of structure */ + unsigned long BeaconPeriod; /* units are Kusec */ + unsigned long ATIMWindow; /* units are Kusec */ + unsigned long DSConfig; /* Frequency, units are kHz */ NDIS_802_11_CONFIGURATION_FH FHConfig; } NDIS_802_11_CONFIGURATION, *PNDIS_802_11_CONFIGURATION; typedef struct _NDIS_802_11_STATISTICS { - ULONG Length; /* Length of structure */ + unsigned long Length; /* Length of structure */ LARGE_INTEGER TransmittedFragmentCount; LARGE_INTEGER MulticastTransmittedFrameCount; LARGE_INTEGER FailedCount; @@ -242,69 +242,69 @@ typedef struct _NDIS_802_11_STATISTICS { LARGE_INTEGER FourWayHandshakeFailures; } NDIS_802_11_STATISTICS, *PNDIS_802_11_STATISTICS; -typedef ULONG NDIS_802_11_KEY_INDEX; -typedef ULONGLONG NDIS_802_11_KEY_RSC; +typedef unsigned long NDIS_802_11_KEY_INDEX; +typedef unsigned long long NDIS_802_11_KEY_RSC; #define MAX_RADIUS_SRV_NUM 2 /* 802.1x failover number */ typedef struct PACKED _RADIUS_SRV_INFO { - UINT32 radius_ip; - UINT32 radius_port; - UCHAR radius_key[64]; - UCHAR radius_key_len; + u32 radius_ip; + u32 radius_port; + u8 radius_key[64]; + u8 radius_key_len; } RADIUS_SRV_INFO, *PRADIUS_SRV_INFO; typedef struct PACKED _RADIUS_KEY_INFO { - UCHAR radius_srv_num; + u8 radius_srv_num; RADIUS_SRV_INFO radius_srv_info[MAX_RADIUS_SRV_NUM]; - UCHAR ieee8021xWEP; /* dynamic WEP */ - UCHAR key_index; - UCHAR key_length; /* length of key in bytes */ - UCHAR key_material[13]; + u8 ieee8021xWEP; /* dynamic WEP */ + u8 key_index; + u8 key_length; /* length of key in bytes */ + u8 key_material[13]; } RADIUS_KEY_INFO, *PRADIUS_KEY_INFO; /* It's used by 802.1x daemon to require relative configuration */ typedef struct PACKED _RADIUS_CONF { - UINT32 Length; /* Length of this structure */ - UCHAR mbss_num; /* indicate multiple BSS number */ - UINT32 own_ip_addr; - UINT32 retry_interval; - UINT32 session_timeout_interval; - UCHAR EAPifname[8][IFNAMSIZ]; - UCHAR EAPifname_len[8]; - UCHAR PreAuthifname[8][IFNAMSIZ]; - UCHAR PreAuthifname_len[8]; + u32 Length; /* Length of this structure */ + u8 mbss_num; /* indicate multiple BSS number */ + u32 own_ip_addr; + u32 retry_interval; + u32 session_timeout_interval; + u8 EAPifname[8][IFNAMSIZ]; + u8 EAPifname_len[8]; + u8 PreAuthifname[8][IFNAMSIZ]; + u8 PreAuthifname_len[8]; RADIUS_KEY_INFO RadiusInfo[8]; } RADIUS_CONF, *PRADIUS_CONF; /* Key mapping keys require a BSSID */ typedef struct _NDIS_802_11_KEY { - UINT Length; /* Length of this structure */ - UINT KeyIndex; - UINT KeyLength; /* length of key in bytes */ + u32 Length; /* Length of this structure */ + u32 KeyIndex; + u32 KeyLength; /* length of key in bytes */ NDIS_802_11_MAC_ADDRESS BSSID; NDIS_802_11_KEY_RSC KeyRSC; - UCHAR KeyMaterial[1]; /* variable length depending on above field */ + u8 KeyMaterial[1]; /* variable length depending on above field */ } NDIS_802_11_KEY, *PNDIS_802_11_KEY; typedef struct _NDIS_802_11_PASSPHRASE { - UINT KeyLength; /* length of key in bytes */ + u32 KeyLength; /* length of key in bytes */ NDIS_802_11_MAC_ADDRESS BSSID; - UCHAR KeyMaterial[1]; /* variable length depending on above field */ + u8 KeyMaterial[1]; /* variable length depending on above field */ } NDIS_802_11_PASSPHRASE, *PNDIS_802_11_PASSPHRASE; typedef struct _NDIS_802_11_REMOVE_KEY { - UINT Length; /* Length of this structure */ - UINT KeyIndex; + u32 Length; /* Length of this structure */ + u32 KeyIndex; NDIS_802_11_MAC_ADDRESS BSSID; } NDIS_802_11_REMOVE_KEY, *PNDIS_802_11_REMOVE_KEY; typedef struct _NDIS_802_11_WEP { - UINT Length; /* Length of this structure */ - UINT KeyIndex; /* 0 is the per-client key, 1-N are the */ + u32 Length; /* Length of this structure */ + u32 KeyIndex; /* 0 is the per-client key, 1-N are the */ /* global keys */ - UINT KeyLength; /* length of key in bytes */ - UCHAR KeyMaterial[1]; /* variable length depending on above field */ + u32 KeyLength; /* length of key in bytes */ + u8 KeyMaterial[1]; /* variable length depending on above field */ } NDIS_802_11_WEP, *PNDIS_802_11_WEP; typedef enum _NDIS_802_11_NETWORK_INFRASTRUCTURE { @@ -330,21 +330,21 @@ typedef enum _NDIS_802_11_AUTHENTICATION_MODE { Ndis802_11AuthModeMax /* Not a real mode, defined as upper bound */ } NDIS_802_11_AUTHENTICATION_MODE, *PNDIS_802_11_AUTHENTICATION_MODE; -typedef UCHAR NDIS_802_11_RATES[NDIS_802_11_LENGTH_RATES]; /* Set of 8 data rates */ -typedef UCHAR NDIS_802_11_RATES_EX[NDIS_802_11_LENGTH_RATES_EX]; /* Set of 16 data rates */ +typedef u8 NDIS_802_11_RATES[NDIS_802_11_LENGTH_RATES]; /* Set of 8 data rates */ +typedef u8 NDIS_802_11_RATES_EX[NDIS_802_11_LENGTH_RATES_EX]; /* Set of 16 data rates */ typedef struct PACKED _NDIS_802_11_SSID { - UINT SsidLength; /* length of SSID field below, in bytes; */ + u32 SsidLength; /* length of SSID field below, in bytes; */ /* this can be zero. */ - UCHAR Ssid[NDIS_802_11_LENGTH_SSID]; /* SSID information field */ + u8 Ssid[NDIS_802_11_LENGTH_SSID]; /* SSID information field */ } NDIS_802_11_SSID, *PNDIS_802_11_SSID; typedef struct PACKED _NDIS_WLAN_BSSID { - ULONG Length; /* Length of this structure */ + unsigned long Length; /* Length of this structure */ NDIS_802_11_MAC_ADDRESS MacAddress; /* BSSID */ - UCHAR Reserved[2]; + u8 Reserved[2]; NDIS_802_11_SSID Ssid; /* SSID */ - ULONG Privacy; /* WEP encryption requirement */ + unsigned long Privacy; /* WEP encryption requirement */ NDIS_802_11_RSSI Rssi; /* receive signal strength in dBm */ NDIS_802_11_NETWORK_TYPE NetworkTypeInUse; NDIS_802_11_CONFIGURATION Configuration; @@ -353,49 +353,49 @@ typedef struct PACKED _NDIS_WLAN_BSSID { } NDIS_WLAN_BSSID, *PNDIS_WLAN_BSSID; typedef struct PACKED _NDIS_802_11_BSSID_LIST { - UINT NumberOfItems; /* in list below, at least 1 */ + u32 NumberOfItems; /* in list below, at least 1 */ NDIS_WLAN_BSSID Bssid[1]; } NDIS_802_11_BSSID_LIST, *PNDIS_802_11_BSSID_LIST; /* Added Capabilities, IELength and IEs for each BSSID */ typedef struct PACKED _NDIS_WLAN_BSSID_EX { - ULONG Length; /* Length of this structure */ + unsigned long Length; /* Length of this structure */ NDIS_802_11_MAC_ADDRESS MacAddress; /* BSSID */ - UCHAR Reserved[2]; + u8 Reserved[2]; NDIS_802_11_SSID Ssid; /* SSID */ - UINT Privacy; /* WEP encryption requirement */ + u32 Privacy; /* WEP encryption requirement */ NDIS_802_11_RSSI Rssi; /* receive signal */ /* strength in dBm */ NDIS_802_11_NETWORK_TYPE NetworkTypeInUse; NDIS_802_11_CONFIGURATION Configuration; NDIS_802_11_NETWORK_INFRASTRUCTURE InfrastructureMode; NDIS_802_11_RATES_EX SupportedRates; - ULONG IELength; - UCHAR IEs[1]; + unsigned long IELength; + u8 IEs[1]; } NDIS_WLAN_BSSID_EX, *PNDIS_WLAN_BSSID_EX; typedef struct PACKED _NDIS_802_11_BSSID_LIST_EX { - UINT NumberOfItems; /* in list below, at least 1 */ + u32 NumberOfItems; /* in list below, at least 1 */ NDIS_WLAN_BSSID_EX Bssid[1]; } NDIS_802_11_BSSID_LIST_EX, *PNDIS_802_11_BSSID_LIST_EX; typedef struct PACKED _NDIS_802_11_FIXED_IEs { - UCHAR Timestamp[8]; - USHORT BeaconInterval; - USHORT Capabilities; + u8 Timestamp[8]; + u16 BeaconInterval; + u16 Capabilities; } NDIS_802_11_FIXED_IEs, *PNDIS_802_11_FIXED_IEs; typedef struct _NDIS_802_11_VARIABLE_IEs { - UCHAR ElementID; - UCHAR Length; /* Number of bytes in data field */ - UCHAR data[1]; + u8 ElementID; + u8 Length; /* Number of bytes in data field */ + u8 data[1]; } NDIS_802_11_VARIABLE_IEs, *PNDIS_802_11_VARIABLE_IEs; -typedef ULONG NDIS_802_11_FRAGMENTATION_THRESHOLD; +typedef unsigned long NDIS_802_11_FRAGMENTATION_THRESHOLD; -typedef ULONG NDIS_802_11_RTS_THRESHOLD; +typedef unsigned long NDIS_802_11_RTS_THRESHOLD; -typedef ULONG NDIS_802_11_ANTENNA; +typedef unsigned long NDIS_802_11_ANTENNA; typedef enum _NDIS_802_11_PRIVACY_FILTER { Ndis802_11PrivFilterAcceptAll, @@ -437,27 +437,27 @@ typedef enum _NDIS_802_11_RELOAD_DEFAULTS { #define NDIS_802_11_AI_RESFI_ASSOCIATIONID 4 typedef struct _NDIS_802_11_AI_REQFI { - USHORT Capabilities; - USHORT ListenInterval; + u16 Capabilities; + u16 ListenInterval; NDIS_802_11_MAC_ADDRESS CurrentAPAddress; } NDIS_802_11_AI_REQFI, *PNDIS_802_11_AI_REQFI; typedef struct _NDIS_802_11_AI_RESFI { - USHORT Capabilities; - USHORT StatusCode; - USHORT AssociationId; + u16 Capabilities; + u16 StatusCode; + u16 AssociationId; } NDIS_802_11_AI_RESFI, *PNDIS_802_11_AI_RESFI; typedef struct _NDIS_802_11_ASSOCIATION_INFORMATION { - ULONG Length; - USHORT AvailableRequestFixedIEs; + unsigned long Length; + u16 AvailableRequestFixedIEs; NDIS_802_11_AI_REQFI RequestFixedIEs; - ULONG RequestIELength; - ULONG OffsetRequestIEs; - USHORT AvailableResponseFixedIEs; + unsigned long RequestIELength; + unsigned long OffsetRequestIEs; + u16 AvailableResponseFixedIEs; NDIS_802_11_AI_RESFI ResponseFixedIEs; - ULONG ResponseIELength; - ULONG OffsetResponseIEs; + unsigned long ResponseIELength; + unsigned long OffsetResponseIEs; } NDIS_802_11_ASSOCIATION_INFORMATION, *PNDIS_802_11_ASSOCIATION_INFORMATION; typedef struct _NDIS_802_11_AUTHENTICATION_EVENT { @@ -472,7 +472,7 @@ typedef enum _NDIS_802_11_MEDIA_STREAM_MODE { } NDIS_802_11_MEDIA_STREAM_MODE, *PNDIS_802_11_MEDIA_STREAM_MODE; /* PMKID Structures */ -typedef UCHAR NDIS_802_11_PMKID_VALUE[16]; +typedef u8 NDIS_802_11_PMKID_VALUE[16]; typedef struct _BSSID_INFO { NDIS_802_11_MAC_ADDRESS BSSID; @@ -480,8 +480,8 @@ typedef struct _BSSID_INFO { } BSSID_INFO, *PBSSID_INFO; typedef struct _NDIS_802_11_PMKID { - UINT Length; - UINT BSSIDInfoCount; + u32 Length; + u32 BSSIDInfoCount; BSSID_INFO BSSIDInfo[1]; } NDIS_802_11_PMKID, *PNDIS_802_11_PMKID; @@ -492,10 +492,10 @@ typedef struct _NDIS_802_11_AUTHENTICATION_ENCRYPTION { *PNDIS_802_11_AUTHENTICATION_ENCRYPTION; typedef struct _NDIS_802_11_CAPABILITY { - ULONG Length; - ULONG Version; - ULONG NoOfPMKIDs; - ULONG NoOfAuthEncryptPairsSupported; + unsigned long Length; + unsigned long Version; + unsigned long NoOfPMKIDs; + unsigned long NoOfAuthEncryptPairsSupported; NDIS_802_11_AUTHENTICATION_ENCRYPTION AuthenticationEncryptionSupported[1]; } NDIS_802_11_CAPABILITY, *PNDIS_802_11_CAPABILITY; @@ -561,16 +561,16 @@ enum { /* MIMO Tx parameter, ShortGI, MCS, STBC, etc. these are fields in TXWI. Don't change this definition!!! */ typedef union _HTTRANSMIT_SETTING { struct { - USHORT MCS:7; /* MCS */ - USHORT BW:1; /*channel bandwidth 20MHz or 40 MHz */ - USHORT ShortGI:1; - USHORT STBC:2; /*SPACE */ -/* USHORT rsv:3; */ - USHORT rsv:2; - USHORT TxBF:1; - USHORT MODE:2; /* Use definition MODE_xxx. */ + u16 MCS:7; /* MCS */ + u16 BW:1; /*channel bandwidth 20MHz or 40 MHz */ + u16 ShortGI:1; + u16 STBC:2; /*SPACE */ +/* u16 rsv:3; */ + u16 rsv:2; + u16 TxBF:1; + u16 MODE:2; /* Use definition MODE_xxx. */ } field; - USHORT word; + u16 word; } HTTRANSMIT_SETTING, *PHTTRANSMIT_SETTING; typedef enum _RT_802_11_PREAMBLE { @@ -596,122 +596,122 @@ typedef enum _RT_802_11_PHY_MODE { /* put all proprietery for-query objects here to reduce # of Query_OID */ typedef struct _RT_802_11_LINK_STATUS { - ULONG CurrTxRate; /* in units of 0.5Mbps */ - ULONG ChannelQuality; /* 0..100 % */ - ULONG TxByteCount; /* both ok and fail */ - ULONG RxByteCount; /* both ok and fail */ - ULONG CentralChannel; /* 40MHz central channel number */ + unsigned long CurrTxRate; /* in units of 0.5Mbps */ + unsigned long ChannelQuality; /* 0..100 % */ + unsigned long TxByteCount; /* both ok and fail */ + unsigned long RxByteCount; /* both ok and fail */ + unsigned long CentralChannel; /* 40MHz central channel number */ } RT_802_11_LINK_STATUS, *PRT_802_11_LINK_STATUS; typedef struct _RT_802_11_EVENT_LOG { LARGE_INTEGER SystemTime; /* timestammp via NdisGetCurrentSystemTime() */ - UCHAR Addr[MAC_ADDR_LENGTH]; - USHORT Event; /* EVENT_xxx */ + u8 Addr[MAC_ADDR_LENGTH]; + u16 Event; /* EVENT_xxx */ } RT_802_11_EVENT_LOG, *PRT_802_11_EVENT_LOG; typedef struct _RT_802_11_EVENT_TABLE { - ULONG Num; - ULONG Rsv; /* to align Log[] at LARGE_INEGER boundary */ + unsigned long Num; + unsigned long Rsv; /* to align Log[] at LARGE_INEGER boundary */ RT_802_11_EVENT_LOG Log[MAX_NUMBER_OF_EVENT]; } RT_802_11_EVENT_TABLE, PRT_802_11_EVENT_TABLE; /* MIMO Tx parameter, ShortGI, MCS, STBC, etc. these are fields in TXWI. Don't change this definition!!! */ typedef union _MACHTTRANSMIT_SETTING { struct { - USHORT MCS:7; /* MCS */ - USHORT BW:1; /*channel bandwidth 20MHz or 40 MHz */ - USHORT ShortGI:1; - USHORT STBC:2; /*SPACE */ - USHORT rsv:3; - USHORT MODE:2; /* Use definition MODE_xxx. */ + u16 MCS:7; /* MCS */ + u16 BW:1; /*channel bandwidth 20MHz or 40 MHz */ + u16 ShortGI:1; + u16 STBC:2; /*SPACE */ + u16 rsv:3; + u16 MODE:2; /* Use definition MODE_xxx. */ } field; - USHORT word; + u16 word; } MACHTTRANSMIT_SETTING, *PMACHTTRANSMIT_SETTING; typedef struct _RT_802_11_MAC_ENTRY { - UCHAR Addr[MAC_ADDR_LENGTH]; - UCHAR Aid; - UCHAR Psm; /* 0:PWR_ACTIVE, 1:PWR_SAVE */ - UCHAR MimoPs; /* 0:MMPS_STATIC, 1:MMPS_DYNAMIC, 3:MMPS_Enabled */ - CHAR AvgRssi0; - CHAR AvgRssi1; - CHAR AvgRssi2; - UINT32 ConnectedTime; + u8 Addr[MAC_ADDR_LENGTH]; + u8 Aid; + u8 Psm; /* 0:PWR_ACTIVE, 1:PWR_SAVE */ + u8 MimoPs; /* 0:MMPS_STATIC, 1:MMPS_DYNAMIC, 3:MMPS_Enabled */ + char AvgRssi0; + char AvgRssi1; + char AvgRssi2; + u32 ConnectedTime; MACHTTRANSMIT_SETTING TxRate; } RT_802_11_MAC_ENTRY, *PRT_802_11_MAC_ENTRY; typedef struct _RT_802_11_MAC_TABLE { - ULONG Num; + unsigned long Num; RT_802_11_MAC_ENTRY Entry[MAX_NUMBER_OF_MAC]; } RT_802_11_MAC_TABLE, *PRT_802_11_MAC_TABLE; /* structure for query/set hardware register - MAC, BBP, RF register */ typedef struct _RT_802_11_HARDWARE_REGISTER { - ULONG HardwareType; /* 0:MAC, 1:BBP, 2:RF register, 3:EEPROM */ - ULONG Offset; /* Q/S register offset addr */ - ULONG Data; /* R/W data buffer */ + unsigned long HardwareType; /* 0:MAC, 1:BBP, 2:RF register, 3:EEPROM */ + unsigned long Offset; /* Q/S register offset addr */ + unsigned long Data; /* R/W data buffer */ } RT_802_11_HARDWARE_REGISTER, *PRT_802_11_HARDWARE_REGISTER; typedef struct _RT_802_11_AP_CONFIG { - ULONG EnableTxBurst; /* 0-disable, 1-enable */ - ULONG EnableTurboRate; /* 0-disable, 1-enable 72/100mbps turbo rate */ - ULONG IsolateInterStaTraffic; /* 0-disable, 1-enable isolation */ - ULONG HideSsid; /* 0-disable, 1-enable hiding */ - ULONG UseBGProtection; /* 0-AUTO, 1-always ON, 2-always OFF */ - ULONG UseShortSlotTime; /* 0-no use, 1-use 9-us short slot time */ - ULONG Rsv1; /* must be 0 */ - ULONG SystemErrorBitmap; /* ignore upon SET, return system error upon QUERY */ + unsigned long EnableTxBurst; /* 0-disable, 1-enable */ + unsigned long EnableTurboRate; /* 0-disable, 1-enable 72/100mbps turbo rate */ + unsigned long IsolateInterStaTraffic; /* 0-disable, 1-enable isolation */ + unsigned long HideSsid; /* 0-disable, 1-enable hiding */ + unsigned long UseBGProtection; /* 0-AUTO, 1-always ON, 2-always OFF */ + unsigned long UseShortSlotTime; /* 0-no use, 1-use 9-us short slot time */ + unsigned long Rsv1; /* must be 0 */ + unsigned long SystemErrorBitmap; /* ignore upon SET, return system error upon QUERY */ } RT_802_11_AP_CONFIG, *PRT_802_11_AP_CONFIG; /* structure to query/set STA_CONFIG */ typedef struct _RT_802_11_STA_CONFIG { - ULONG EnableTxBurst; /* 0-disable, 1-enable */ - ULONG EnableTurboRate; /* 0-disable, 1-enable 72/100mbps turbo rate */ - ULONG UseBGProtection; /* 0-AUTO, 1-always ON, 2-always OFF */ - ULONG UseShortSlotTime; /* 0-no use, 1-use 9-us short slot time when applicable */ - ULONG AdhocMode; /* 0-11b rates only (WIFI spec), 1 - b/g mixed, 2 - g only */ - ULONG HwRadioStatus; /* 0-OFF, 1-ON, default is 1, Read-Only */ - ULONG Rsv1; /* must be 0 */ - ULONG SystemErrorBitmap; /* ignore upon SET, return system error upon QUERY */ + unsigned long EnableTxBurst; /* 0-disable, 1-enable */ + unsigned long EnableTurboRate; /* 0-disable, 1-enable 72/100mbps turbo rate */ + unsigned long UseBGProtection; /* 0-AUTO, 1-always ON, 2-always OFF */ + unsigned long UseShortSlotTime; /* 0-no use, 1-use 9-us short slot time when applicable */ + unsigned long AdhocMode; /* 0-11b rates only (WIFI spec), 1 - b/g mixed, 2 - g only */ + unsigned long HwRadioStatus; /* 0-OFF, 1-ON, default is 1, Read-Only */ + unsigned long Rsv1; /* must be 0 */ + unsigned long SystemErrorBitmap; /* ignore upon SET, return system error upon QUERY */ } RT_802_11_STA_CONFIG, *PRT_802_11_STA_CONFIG; /* */ /* For OID Query or Set about BA structure */ /* */ typedef struct _OID_BACAP_STRUC { - UCHAR RxBAWinLimit; - UCHAR TxBAWinLimit; - UCHAR Policy; /* 0: DELAY_BA 1:IMMED_BA (//BA Policy subfiled value in ADDBA frame) 2:BA-not use. other value invalid */ - UCHAR MpduDensity; /* 0: DELAY_BA 1:IMMED_BA (//BA Policy subfiled value in ADDBA frame) 2:BA-not use. other value invalid */ - UCHAR AmsduEnable; /*Enable AMSDU transmisstion */ - UCHAR AmsduSize; /* 0:3839, 1:7935 bytes. UINT MSDUSizeToBytes[] = { 3839, 7935}; */ - UCHAR MMPSmode; /* MIMO power save more, 0:static, 1:dynamic, 2:rsv, 3:mimo enable */ + u8 RxBAWinLimit; + u8 TxBAWinLimit; + u8 Policy; /* 0: DELAY_BA 1:IMMED_BA (//BA Policy subfiled value in ADDBA frame) 2:BA-not use. other value invalid */ + u8 MpduDensity; /* 0: DELAY_BA 1:IMMED_BA (//BA Policy subfiled value in ADDBA frame) 2:BA-not use. other value invalid */ + u8 AmsduEnable; /*Enable AMSDU transmisstion */ + u8 AmsduSize; /* 0:3839, 1:7935 bytes. u32 MSDUSizeToBytes[] = { 3839, 7935}; */ + u8 MMPSmode; /* MIMO power save more, 0:static, 1:dynamic, 2:rsv, 3:mimo enable */ BOOLEAN AutoBA; /* Auto BA will automatically */ } OID_BACAP_STRUC, *POID_BACAP_STRUC; typedef struct _RT_802_11_ACL_ENTRY { - UCHAR Addr[MAC_ADDR_LENGTH]; - USHORT Rsv; + u8 Addr[MAC_ADDR_LENGTH]; + u16 Rsv; } RT_802_11_ACL_ENTRY, *PRT_802_11_ACL_ENTRY; typedef struct PACKED _RT_802_11_ACL { - ULONG Policy; /* 0-disable, 1-positive list, 2-negative list */ - ULONG Num; + unsigned long Policy; /* 0-disable, 1-positive list, 2-negative list */ + unsigned long Num; RT_802_11_ACL_ENTRY Entry[MAX_NUMBER_OF_ACL]; } RT_802_11_ACL, *PRT_802_11_ACL; typedef struct _RT_802_11_WDS { - ULONG Num; + unsigned long Num; NDIS_802_11_MAC_ADDRESS Entry[24 /*MAX_NUM_OF_WDS_LINK */ ]; - ULONG KeyLength; - UCHAR KeyMaterial[32]; + unsigned long KeyLength; + u8 KeyMaterial[32]; } RT_802_11_WDS, *PRT_802_11_WDS; typedef struct _RT_802_11_TX_RATES_ { - UCHAR SupRateLen; - UCHAR SupRate[MAX_LENGTH_OF_SUPPORT_RATES]; - UCHAR ExtRateLen; - UCHAR ExtRate[MAX_LENGTH_OF_SUPPORT_RATES]; + u8 SupRateLen; + u8 SupRate[MAX_LENGTH_OF_SUPPORT_RATES]; + u8 ExtRateLen; + u8 ExtRate[MAX_LENGTH_OF_SUPPORT_RATES]; } RT_802_11_TX_RATES, *PRT_802_11_TX_RATES; /* Definition of extra information code */ @@ -734,14 +734,14 @@ typedef struct _RT_802_11_TX_RATES_ { /* This is OID setting structure. So only GF or MM as Mode. This is valid when our wirelss mode has 802.11n in use. */ typedef struct { RT_802_11_PHY_MODE PhyMode; /* */ - UCHAR TransmitNo; - UCHAR HtMode; /*HTMODE_GF or HTMODE_MM */ - UCHAR ExtOffset; /*extension channel above or below */ - UCHAR MCS; - UCHAR BW; - UCHAR STBC; - UCHAR SHORTGI; - UCHAR rsv; + u8 TransmitNo; + u8 HtMode; /*HTMODE_GF or HTMODE_MM */ + u8 ExtOffset; /*extension channel above or below */ + u8 MCS; + u8 BW; + u8 STBC; + u8 SHORTGI; + u8 rsv; } OID_SET_HT_PHYMODE, *POID_SET_HT_PHYMODE; #define MAX_CUSTOM_LEN 128 @@ -753,26 +753,26 @@ typedef enum _RT_802_11_D_CLIENT_MODE { } RT_802_11_D_CLIENT_MODE, *PRT_802_11_D_CLIENT_MODE; typedef struct _RT_CHANNEL_LIST_INFO { - UCHAR ChannelList[MAX_NUM_OF_CHS]; /* list all supported channels for site survey */ - UCHAR ChannelListNum; /* number of channel in ChannelList[] */ + u8 ChannelList[MAX_NUM_OF_CHS]; /* list all supported channels for site survey */ + u8 ChannelListNum; /* number of channel in ChannelList[] */ } RT_CHANNEL_LIST_INFO, *PRT_CHANNEL_LIST_INFO; /* WSC configured credential */ typedef struct _WSC_CREDENTIAL { NDIS_802_11_SSID SSID; /* mandatory */ - USHORT AuthType; /* mandatory, 1: open, 2: wpa-psk, 4: shared, 8:wpa, 0x10: wpa2, 0x20: wpa2-psk */ - USHORT EncrType; /* mandatory, 1: none, 2: wep, 4: tkip, 8: aes */ - UCHAR Key[64]; /* mandatory, Maximum 64 byte */ - USHORT KeyLength; - UCHAR MacAddr[6]; /* mandatory, AP MAC address */ - UCHAR KeyIndex; /* optional, default is 1 */ - UCHAR Rsvd[3]; /* Make alignment */ + u16 AuthType; /* mandatory, 1: open, 2: wpa-psk, 4: shared, 8:wpa, 0x10: wpa2, 0x20: wpa2-psk */ + u16 EncrType; /* mandatory, 1: none, 2: wep, 4: tkip, 8: aes */ + u8 Key[64]; /* mandatory, Maximum 64 byte */ + u16 KeyLength; + u8 MacAddr[6]; /* mandatory, AP MAC address */ + u8 KeyIndex; /* optional, default is 1 */ + u8 Rsvd[3]; /* Make alignment */ } WSC_CREDENTIAL, *PWSC_CREDENTIAL; /* WSC configured profiles */ typedef struct _WSC_PROFILE { - UINT ProfileCnt; - UINT ApplyProfileIdx; /* add by johnli, fix WPS test plan 5.1.1 */ + u32 ProfileCnt; + u32 ApplyProfileIdx; /* add by johnli, fix WPS test plan 5.1.1 */ WSC_CREDENTIAL Profile[8]; /* Support up to 8 profiles */ } WSC_PROFILE, *PWSC_PROFILE; diff --git a/drivers/staging/rt2860/pci_main_dev.c b/drivers/staging/rt2860/pci_main_dev.c index 76c71f1..24f939d 100644 --- a/drivers/staging/rt2860/pci_main_dev.c +++ b/drivers/staging/rt2860/pci_main_dev.c @@ -52,13 +52,13 @@ MODULE_ALIAS("rt3090sta"); extern int rt28xx_close(IN struct net_device *net_dev); extern int rt28xx_open(struct net_device *net_dev); -static VOID __devexit rt2860_remove_one(struct pci_dev *pci_dev); -static INT __devinit rt2860_probe(struct pci_dev *pci_dev, +static void __devexit rt2860_remove_one(struct pci_dev *pci_dev); +static int __devinit rt2860_probe(struct pci_dev *pci_dev, const struct pci_device_id *ent); static void __exit rt2860_cleanup_module(void); static int __init rt2860_init_module(void); -static VOID RTMPInitPCIeDevice(IN struct pci_dev *pci_dev, +static void RTMPInitPCIeDevice(IN struct pci_dev *pci_dev, IN PRTMP_ADAPTER pAd); #ifdef CONFIG_PM @@ -123,7 +123,7 @@ resume:rt2860_resume, ***************************************************************************/ #ifdef CONFIG_PM -VOID RT2860RejectPendingPackets(IN PRTMP_ADAPTER pAd) +void RT2860RejectPendingPackets(IN PRTMP_ADAPTER pAd) { /* clear PS packets */ /* clear TxSw packets */ @@ -133,7 +133,7 @@ static int rt2860_suspend(struct pci_dev *pci_dev, pm_message_t state) { struct net_device *net_dev = pci_get_drvdata(pci_dev); PRTMP_ADAPTER pAd = (PRTMP_ADAPTER) NULL; - INT32 retval = 0; + int retval = 0; DBGPRINT(RT_DEBUG_TRACE, ("===> rt2860_suspend()\n")); @@ -185,7 +185,7 @@ static int rt2860_resume(struct pci_dev *pci_dev) { struct net_device *net_dev = pci_get_drvdata(pci_dev); PRTMP_ADAPTER pAd = (PRTMP_ADAPTER) NULL; - INT32 retval; + int retval; /* set the power state of a PCI device */ /* PCI has 4 power states, DO (normal) ~ D3(less power) */ @@ -246,7 +246,7 @@ static int rt2860_resume(struct pci_dev *pci_dev) } #endif /* CONFIG_PM // */ -static INT __init rt2860_init_module(VOID) +static int __init rt2860_init_module(void) { return pci_register_driver(&rt2860_driver); } @@ -254,7 +254,7 @@ static INT __init rt2860_init_module(VOID) /* */ /* Driver module unload function */ /* */ -static VOID __exit rt2860_cleanup_module(VOID) +static void __exit rt2860_cleanup_module(void) { pci_unregister_driver(&rt2860_driver); } @@ -265,15 +265,15 @@ module_exit(rt2860_cleanup_module); /* */ /* PCI device probe & initialization function */ /* */ -static INT __devinit rt2860_probe(IN struct pci_dev *pci_dev, +static int __devinit rt2860_probe(IN struct pci_dev *pci_dev, IN const struct pci_device_id *pci_id) { PRTMP_ADAPTER pAd = (PRTMP_ADAPTER) NULL; struct net_device *net_dev; - PVOID handle; - PSTRING print_name; - ULONG csr_addr; - INT rv = 0; + void *handle; + char *print_name; + unsigned long csr_addr; + int rv = 0; RTMP_OS_NETDEV_OP_HOOK netDevHook; DBGPRINT(RT_DEBUG_TRACE, ("===> rt2860_probe\n")); @@ -286,7 +286,7 @@ static INT __devinit rt2860_probe(IN struct pci_dev *pci_dev, return rv; } - print_name = (PSTRING) pci_name(pci_dev); + print_name = (char *)pci_name(pci_dev); if ((rv = pci_request_regions(pci_dev, print_name)) != 0) { DBGPRINT(RT_DEBUG_ERROR, @@ -300,14 +300,14 @@ static INT __devinit rt2860_probe(IN struct pci_dev *pci_dev, if (!csr_addr) { DBGPRINT(RT_DEBUG_ERROR, ("ioremap failed for device %s, region 0x%lX @ 0x%lX\n", - print_name, (ULONG) pci_resource_len(pci_dev, 0), - (ULONG) pci_resource_start(pci_dev, 0))); + print_name, (unsigned long)pci_resource_len(pci_dev, 0), + (unsigned long)pci_resource_start(pci_dev, 0))); goto err_out_free_res; } else { DBGPRINT(RT_DEBUG_TRACE, ("%s: at 0x%lx, VA 0x%lx, IRQ %d. \n", print_name, - (ULONG) pci_resource_start(pci_dev, 0), - (ULONG) csr_addr, pci_dev->irq)); + (unsigned long)pci_resource_start(pci_dev, 0), + (unsigned long)csr_addr, pci_dev->irq)); } /* Set DMA master */ @@ -329,10 +329,10 @@ static INT __devinit rt2860_probe(IN struct pci_dev *pci_dev, if (rv != NDIS_STATUS_SUCCESS) goto err_out_iounmap; /* Here are the RTMP_ADAPTER structure with pci-bus specific parameters. */ - pAd->CSRBaseAddress = (PUCHAR) csr_addr; + pAd->CSRBaseAddress = (u8 *)csr_addr; DBGPRINT(RT_DEBUG_ERROR, ("pAd->CSRBaseAddress =0x%lx, csr_addr=0x%lx!\n", - (ULONG) pAd->CSRBaseAddress, csr_addr)); + (unsigned long)pAd->CSRBaseAddress, csr_addr)); RtmpRaDevCtrlInit(pAd, RTMP_DEV_INF_PCI); /*NetDevInit============================================== */ @@ -389,11 +389,11 @@ err_out: return -ENODEV; /* probe fail */ } -static VOID __devexit rt2860_remove_one(IN struct pci_dev *pci_dev) +static void __devexit rt2860_remove_one(IN struct pci_dev *pci_dev) { PNET_DEV net_dev = pci_get_drvdata(pci_dev); RTMP_ADAPTER *pAd = NULL; - ULONG csr_addr = net_dev->base_addr; /* pAd->CSRBaseAddress; */ + unsigned long csr_addr = net_dev->base_addr; /* pAd->CSRBaseAddress; */ GET_PAD_FROM_NET_DEV(pAd, net_dev); @@ -456,9 +456,9 @@ BOOLEAN RT28XXChipsetCheck(IN void *_dev_p) * PCIe device initialization related procedures. * ***************************************************************************/ -static VOID RTMPInitPCIeDevice(IN struct pci_dev *pci_dev, IN PRTMP_ADAPTER pAd) +static void RTMPInitPCIeDevice(IN struct pci_dev *pci_dev, IN PRTMP_ADAPTER pAd) { - USHORT device_id; + u16 device_id; POS_COOKIE pObj; pObj = (POS_COOKIE) pAd->OS_Cookie; @@ -477,7 +477,7 @@ static VOID RTMPInitPCIeDevice(IN struct pci_dev *pci_dev, IN PRTMP_ADAPTER pAd) (device_id == NIC3092_PCIe_DEVICE_ID) || #endif /* RT3090 // */ 0) { - UINT32 MacCsr0 = 0, Index = 0; + u32 MacCsr0 = 0, Index = 0; do { RTMP_IO_READ32(pAd, MAC_CSR0, &MacCsr0); @@ -495,11 +495,11 @@ static VOID RTMPInitPCIeDevice(IN struct pci_dev *pci_dev, IN PRTMP_ADAPTER pAd) } } -VOID RTMPInitPCIeLinkCtrlValue(IN PRTMP_ADAPTER pAd) +void RTMPInitPCIeLinkCtrlValue(IN PRTMP_ADAPTER pAd) { - INT pos; - USHORT reg16, data2, PCIePowerSaveLevel, Configuration; - UINT32 MacValue; + int pos; + u16 reg16, data2, PCIePowerSaveLevel, Configuration; + u32 MacValue; BOOLEAN bFindIntel = FALSE; POS_COOKIE pObj; @@ -536,7 +536,7 @@ VOID RTMPInitPCIeLinkCtrlValue(IN PRTMP_ADAPTER pAd) ("====> Write 0x83 = 0x%x.\n", PCIePowerSaveLevel)); AsicSendCommandToMcu(pAd, 0x83, 0xff, - (UCHAR) PCIePowerSaveLevel, 0x00); + (u8)PCIePowerSaveLevel, 0x00); RT28xx_EEPROM_READ16(pAd, 0x22, PCIePowerSaveLevel); PCIePowerSaveLevel &= 0xff; PCIePowerSaveLevel = PCIePowerSaveLevel >> 6; @@ -570,7 +570,7 @@ VOID RTMPInitPCIeLinkCtrlValue(IN PRTMP_ADAPTER pAd) PCIePowerSaveLevel)); AsicSendCommandToMcu(pAd, 0x83, 0xff, - (UCHAR) PCIePowerSaveLevel, + (u8)PCIePowerSaveLevel, 0x00); } DBGPRINT(RT_DEBUG_TRACE, @@ -578,7 +578,7 @@ VOID RTMPInitPCIeLinkCtrlValue(IN PRTMP_ADAPTER pAd) pAd->LnkCtrlBitMask)); } } else if (IS_RT3090(pAd) || IS_RT3572(pAd) || IS_RT3390(pAd)) { - UCHAR LinkCtrlSetting = 0; + u8 LinkCtrlSetting = 0; /* Check 3090E special setting chip. */ RT28xx_EEPROM_READ16(pAd, 0x24, data2); @@ -630,7 +630,7 @@ VOID RTMPInitPCIeLinkCtrlValue(IN PRTMP_ADAPTER pAd) /* 1. read setting from inf file. */ PCIePowerSaveLevel = - (USHORT) pAd->StaCfg.PSControl.field.rt30xxPowerMode; + (u16)pAd->StaCfg.PSControl.field.rt30xxPowerMode; DBGPRINT(RT_DEBUG_ERROR, ("====> rt30xx Read PowerLevelMode = 0x%x.\n", PCIePowerSaveLevel)); @@ -642,13 +642,13 @@ VOID RTMPInitPCIeLinkCtrlValue(IN PRTMP_ADAPTER pAd) && (pAd->b3090ESpecialChip == FALSE)) { /* Chip Version E only allow 1, So force set 1. */ PCIePowerSaveLevel &= 0x1; - pAd->PCIePowerSaveLevel = (USHORT) PCIePowerSaveLevel; + pAd->PCIePowerSaveLevel = (u16)PCIePowerSaveLevel; DBGPRINT(RT_DEBUG_TRACE, ("====> rt30xx E Write 0x83 Command = 0x%x.\n", PCIePowerSaveLevel)); AsicSendCommandToMcu(pAd, 0x83, 0xff, - (UCHAR) PCIePowerSaveLevel, 0x00); + (u8)PCIePowerSaveLevel, 0x00); } else { /* Chip Version F and after only allow 1 or 2 or 3. This might be modified after new chip version come out. */ if (! @@ -658,7 +658,7 @@ VOID RTMPInitPCIeLinkCtrlValue(IN PRTMP_ADAPTER pAd) DBGPRINT(RT_DEBUG_ERROR, ("====> rt30xx F Write 0x83 Command = 0x%x.\n", PCIePowerSaveLevel)); - pAd->PCIePowerSaveLevel = (USHORT) PCIePowerSaveLevel; + pAd->PCIePowerSaveLevel = (u16)PCIePowerSaveLevel; /* for 3090F , we need to add high-byte arg for 0x83 command to indicate the link control setting in */ /* PCI Configuration Space. Because firmware can't read PCI Configuration Space */ if ((pAd->Rt3xxRalinkLinkCtrl & 0x2) @@ -669,7 +669,7 @@ VOID RTMPInitPCIeLinkCtrlValue(IN PRTMP_ADAPTER pAd) ("====> rt30xxF LinkCtrlSetting = 0x%x.\n", LinkCtrlSetting)); AsicSendCommandToMcu(pAd, 0x83, 0xff, - (UCHAR) PCIePowerSaveLevel, + (u8)PCIePowerSaveLevel, LinkCtrlSetting); } } @@ -702,7 +702,7 @@ VOID RTMPInitPCIeLinkCtrlValue(IN PRTMP_ADAPTER pAd) RTMPFindHostPCIDev(pAd); if (pObj->parent_pci_dev) { - USHORT vendor_id; + u16 vendor_id; pci_read_config_word(pObj->parent_pci_dev, PCI_VENDOR_ID, &vendor_id); @@ -810,11 +810,11 @@ VOID RTMPInitPCIeLinkCtrlValue(IN PRTMP_ADAPTER pAd) } } -VOID RTMPFindHostPCIDev(IN PRTMP_ADAPTER pAd) +void RTMPFindHostPCIDev(IN PRTMP_ADAPTER pAd) { - USHORT reg16; - UCHAR reg8; - UINT DevFn; + u16 reg16; + u8 reg8; + u32 DevFn; PPCI_DEV pPci_dev; POS_COOKIE pObj; @@ -856,10 +856,10 @@ VOID RTMPFindHostPCIDev(IN PRTMP_ADAPTER pAd) ======================================================================== */ -VOID RTMPPCIeLinkCtrlValueRestore(IN PRTMP_ADAPTER pAd, IN UCHAR Level) +void RTMPPCIeLinkCtrlValueRestore(IN PRTMP_ADAPTER pAd, u8 Level) { - USHORT PCIePowerSaveLevel, reg16; - USHORT Configuration; + u16 PCIePowerSaveLevel, reg16; + u16 Configuration; POS_COOKIE pObj; pObj = (POS_COOKIE) pAd->OS_Cookie; @@ -950,10 +950,10 @@ VOID RTMPPCIeLinkCtrlValueRestore(IN PRTMP_ADAPTER pAd, IN UCHAR Level) ======================================================================== */ -VOID RTMPPCIeLinkCtrlSetting(IN PRTMP_ADAPTER pAd, IN USHORT Max) +void RTMPPCIeLinkCtrlSetting(IN PRTMP_ADAPTER pAd, u16 Max) { - USHORT PCIePowerSaveLevel, reg16; - USHORT Configuration; + u16 PCIePowerSaveLevel, reg16; + u16 Configuration; POS_COOKIE pObj; pObj = (POS_COOKIE) pAd->OS_Cookie; @@ -1076,14 +1076,14 @@ VOID RTMPPCIeLinkCtrlSetting(IN PRTMP_ADAPTER pAd, IN USHORT Max) ======================================================================== */ -VOID RTMPrt3xSetPCIePowerLinkCtrl(IN PRTMP_ADAPTER pAd) +void RTMPrt3xSetPCIePowerLinkCtrl(IN PRTMP_ADAPTER pAd) { - ULONG HostConfiguration = 0; - ULONG Configuration; + unsigned long HostConfiguration = 0; + unsigned long Configuration; POS_COOKIE pObj; - INT pos; - USHORT reg16; + int pos; + u16 reg16; pObj = (POS_COOKIE) pAd->OS_Cookie; diff --git a/drivers/staging/rt2860/rt_linux.c b/drivers/staging/rt2860/rt_linux.c index 8413998..5f781f5 100644 --- a/drivers/staging/rt2860/rt_linux.c +++ b/drivers/staging/rt2860/rt_linux.c @@ -28,7 +28,7 @@ #include <linux/sched.h> #include "rt_config.h" -ULONG RTDebugLevel = RT_DEBUG_ERROR; +unsigned long RTDebugLevel = RT_DEBUG_ERROR; /* for wireless system event message */ char const *pWirelessSysEventText[IW_SYS_EVENT_TYPE_NUM] = { @@ -80,7 +80,7 @@ char const *pWirelessFloodEventText[IW_FLOOD_EVENT_TYPE_NUM] = { }; /* timeout -- ms */ -VOID RTMP_SetPeriodicTimer(IN NDIS_MINIPORT_TIMER * pTimer, +void RTMP_SetPeriodicTimer(IN NDIS_MINIPORT_TIMER * pTimer, IN unsigned long timeout) { timeout = ((timeout * OS_HZ) / 1000); @@ -89,16 +89,16 @@ VOID RTMP_SetPeriodicTimer(IN NDIS_MINIPORT_TIMER * pTimer, } /* convert NdisMInitializeTimer --> RTMP_OS_Init_Timer */ -VOID RTMP_OS_Init_Timer(IN PRTMP_ADAPTER pAd, +void RTMP_OS_Init_Timer(IN PRTMP_ADAPTER pAd, IN NDIS_MINIPORT_TIMER * pTimer, - IN TIMER_FUNCTION function, IN PVOID data) + IN TIMER_FUNCTION function, void *data) { init_timer(pTimer); pTimer->data = (unsigned long)data; pTimer->function = function; } -VOID RTMP_OS_Add_Timer(IN NDIS_MINIPORT_TIMER * pTimer, +void RTMP_OS_Add_Timer(IN NDIS_MINIPORT_TIMER * pTimer, IN unsigned long timeout) { if (timer_pending(pTimer)) @@ -109,14 +109,14 @@ VOID RTMP_OS_Add_Timer(IN NDIS_MINIPORT_TIMER * pTimer, add_timer(pTimer); } -VOID RTMP_OS_Mod_Timer(IN NDIS_MINIPORT_TIMER * pTimer, +void RTMP_OS_Mod_Timer(IN NDIS_MINIPORT_TIMER * pTimer, IN unsigned long timeout) { timeout = ((timeout * OS_HZ) / 1000); mod_timer(pTimer, jiffies + timeout); } -VOID RTMP_OS_Del_Timer(IN NDIS_MINIPORT_TIMER * pTimer, +void RTMP_OS_Del_Timer(IN NDIS_MINIPORT_TIMER * pTimer, OUT BOOLEAN * pCancelled) { if (timer_pending(pTimer)) { @@ -127,15 +127,15 @@ VOID RTMP_OS_Del_Timer(IN NDIS_MINIPORT_TIMER * pTimer, } -VOID RTMP_OS_Release_Packet(IN PRTMP_ADAPTER pAd, IN PQUEUE_ENTRY pEntry) +void RTMP_OS_Release_Packet(IN PRTMP_ADAPTER pAd, IN PQUEUE_ENTRY pEntry) { /*RTMPFreeNdisPacket(pAd, (struct sk_buff *)pEntry); */ } /* Unify all delay routine by using udelay */ -VOID RTMPusecDelay(IN ULONG usec) +void RTMPusecDelay(unsigned long usec) { - ULONG i; + unsigned long i; for (i = 0; i < (usec / 50); i++) udelay(50); @@ -150,9 +150,9 @@ void RTMP_GetCurrentSystemTime(LARGE_INTEGER * time) } /* pAd MUST allow to be NULL */ -NDIS_STATUS os_alloc_mem(IN RTMP_ADAPTER * pAd, OUT UCHAR ** mem, IN ULONG size) +int os_alloc_mem(IN RTMP_ADAPTER * pAd, u8 ** mem, unsigned long size) { - *mem = (PUCHAR) kmalloc(size, GFP_ATOMIC); + *mem = (u8 *)kmalloc(size, GFP_ATOMIC); if (*mem) return (NDIS_STATUS_SUCCESS); else @@ -160,7 +160,7 @@ NDIS_STATUS os_alloc_mem(IN RTMP_ADAPTER * pAd, OUT UCHAR ** mem, IN ULONG size) } /* pAd MUST allow to be NULL */ -NDIS_STATUS os_free_mem(IN PRTMP_ADAPTER pAd, IN PVOID mem) +int os_free_mem(IN PRTMP_ADAPTER pAd, void *mem) { ASSERT(mem); @@ -178,7 +178,7 @@ PNDIS_PACKET RtmpOSNetPktAlloc(IN RTMP_ADAPTER * pAd, IN int size) } PNDIS_PACKET RTMP_AllocateFragPacketBuffer(IN PRTMP_ADAPTER pAd, - IN ULONG Length) + unsigned long Length) { struct sk_buff *pkt; @@ -197,9 +197,9 @@ PNDIS_PACKET RTMP_AllocateFragPacketBuffer(IN PRTMP_ADAPTER pAd, } PNDIS_PACKET RTMP_AllocateTxPacketBuffer(IN PRTMP_ADAPTER pAd, - IN ULONG Length, + unsigned long Length, IN BOOLEAN Cached, - OUT PVOID * VirtualAddress) + void ** VirtualAddress) { struct sk_buff *pkt; @@ -212,17 +212,17 @@ PNDIS_PACKET RTMP_AllocateTxPacketBuffer(IN PRTMP_ADAPTER pAd, if (pkt) { RTMP_SET_PACKET_SOURCE(OSPKT_TO_RTPKT(pkt), PKTSRC_NDIS); - *VirtualAddress = (PVOID) pkt->data; + *VirtualAddress = (void *)pkt->data; } else { - *VirtualAddress = (PVOID) NULL; + *VirtualAddress = (void *)NULL; } return (PNDIS_PACKET) pkt; } -VOID build_tx_packet(IN PRTMP_ADAPTER pAd, +void build_tx_packet(IN PRTMP_ADAPTER pAd, IN PNDIS_PACKET pPacket, - IN PUCHAR pFrame, IN ULONG FrameLen) + u8 *pFrame, unsigned long FrameLen) { struct sk_buff *pTxPkt; @@ -233,7 +233,7 @@ VOID build_tx_packet(IN PRTMP_ADAPTER pAd, NdisMoveMemory(skb_put(pTxPkt, FrameLen), pFrame, FrameLen); } -VOID RTMPFreeAdapter(IN PRTMP_ADAPTER pAd) +void RTMPFreeAdapter(IN PRTMP_ADAPTER pAd) { POS_COOKIE os_cookie; int index; @@ -292,7 +292,7 @@ BOOLEAN OS_Need_Clone_Packet(void) ======================================================================== */ -NDIS_STATUS RTMPCloneNdisPacket(IN PRTMP_ADAPTER pAd, +int RTMPCloneNdisPacket(IN PRTMP_ADAPTER pAd, IN BOOLEAN pInsAMSDUHdr, IN PNDIS_PACKET pInPacket, OUT PNDIS_PACKET * ppOutPacket) @@ -323,11 +323,11 @@ NDIS_STATUS RTMPCloneNdisPacket(IN PRTMP_ADAPTER pAd, } /* the allocated NDIS PACKET must be freed via RTMPFreeNdisPacket() */ -NDIS_STATUS RTMPAllocateNdisPacket(IN PRTMP_ADAPTER pAd, +int RTMPAllocateNdisPacket(IN PRTMP_ADAPTER pAd, OUT PNDIS_PACKET * ppPacket, - IN PUCHAR pHeader, - IN UINT HeaderLen, - IN PUCHAR pData, IN UINT DataLen) + u8 *pHeader, + u32 HeaderLen, + u8 *pData, u32 DataLen) { PNDIS_PACKET pPacket; ASSERT(pData); @@ -367,7 +367,7 @@ NDIS_STATUS RTMPAllocateNdisPacket(IN PRTMP_ADAPTER pAd, corresponding NDIS_BUFFER and allocated memory. ======================================================================== */ -VOID RTMPFreeNdisPacket(IN PRTMP_ADAPTER pAd, IN PNDIS_PACKET pPacket) +void RTMPFreeNdisPacket(IN PRTMP_ADAPTER pAd, IN PNDIS_PACKET pPacket) { dev_kfree_skb_any(RTPKT_TO_OSPKT(pPacket)); } @@ -375,19 +375,19 @@ VOID RTMPFreeNdisPacket(IN PRTMP_ADAPTER pAd, IN PNDIS_PACKET pPacket) /* IRQL = DISPATCH_LEVEL */ /* NOTE: we do have an assumption here, that Byte0 and Byte1 always reasid at the same */ /* scatter gather buffer */ -NDIS_STATUS Sniff2BytesFromNdisBuffer(IN PNDIS_BUFFER pFirstBuffer, - IN UCHAR DesiredOffset, - OUT PUCHAR pByte0, OUT PUCHAR pByte1) +int Sniff2BytesFromNdisBuffer(IN PNDIS_BUFFER pFirstBuffer, + u8 DesiredOffset, + u8 *pByte0, u8 *pByte1) { - *pByte0 = *(PUCHAR) (pFirstBuffer + DesiredOffset); - *pByte1 = *(PUCHAR) (pFirstBuffer + DesiredOffset + 1); + *pByte0 = *(u8 *)(pFirstBuffer + DesiredOffset); + *pByte1 = *(u8 *)(pFirstBuffer + DesiredOffset + 1); return NDIS_STATUS_SUCCESS; } void RTMP_QueryPacketInfo(IN PNDIS_PACKET pPacket, OUT PACKET_INFO * pPacketInfo, - OUT PUCHAR * pSrcBufVA, OUT UINT * pSrcBufLen) + u8 ** pSrcBufVA, u32 * pSrcBufLen) { pPacketInfo->BufferCount = 1; pPacketInfo->pFirstBuffer = (PNDIS_BUFFER) GET_OS_PKT_DATAPTR(pPacket); @@ -400,7 +400,7 @@ void RTMP_QueryPacketInfo(IN PNDIS_PACKET pPacket, void RTMP_QueryNextPacketInfo(IN PNDIS_PACKET * ppPacket, OUT PACKET_INFO * pPacketInfo, - OUT PUCHAR * pSrcBufVA, OUT UINT * pSrcBufLen) + u8 ** pSrcBufVA, u32 * pSrcBufLen) { PNDIS_PACKET pPacket = NULL; @@ -430,15 +430,15 @@ void RTMP_QueryNextPacketInfo(IN PNDIS_PACKET * ppPacket, } PNDIS_PACKET DuplicatePacket(IN PRTMP_ADAPTER pAd, - IN PNDIS_PACKET pPacket, IN UCHAR FromWhichBSSID) + IN PNDIS_PACKET pPacket, u8 FromWhichBSSID) { struct sk_buff *skb; PNDIS_PACKET pRetPacket = NULL; - USHORT DataSize; - UCHAR *pData; + u16 DataSize; + u8 *pData; - DataSize = (USHORT) GET_OS_PKT_LEN(pPacket); - pData = (PUCHAR) GET_OS_PKT_DATAPTR(pPacket); + DataSize = (u16)GET_OS_PKT_LEN(pPacket); + pData = (u8 *)GET_OS_PKT_DATAPTR(pPacket); skb = skb_clone(RTPKT_TO_OSPKT(pPacket), MEM_ALLOC_FLAG); if (skb) { @@ -451,10 +451,10 @@ PNDIS_PACKET DuplicatePacket(IN PRTMP_ADAPTER pAd, } PNDIS_PACKET duplicate_pkt(IN PRTMP_ADAPTER pAd, - IN PUCHAR pHeader802_3, - IN UINT HdrLen, - IN PUCHAR pData, - IN ULONG DataSize, IN UCHAR FromWhichBSSID) + u8 *pHeader802_3, + u32 HdrLen, + u8 *pData, + unsigned long DataSize, u8 FromWhichBSSID) { struct sk_buff *skb; PNDIS_PACKET pPacket = NULL; @@ -499,7 +499,7 @@ PNDIS_PACKET duplicate_pkt_with_TKIP_MIC(IN PRTMP_ADAPTER pAd, PNDIS_PACKET ClonePacket(IN PRTMP_ADAPTER pAd, IN PNDIS_PACKET pPacket, - IN PUCHAR pData, IN ULONG DataSize) + u8 *pData, unsigned long DataSize) { struct sk_buff *pRxPkt; struct sk_buff *pClonedPkt; @@ -525,7 +525,7 @@ PNDIS_PACKET ClonePacket(IN PRTMP_ADAPTER pAd, /* change OS packet DataPtr and DataLen */ /* */ void update_os_packet_info(IN PRTMP_ADAPTER pAd, - IN RX_BLK * pRxBlk, IN UCHAR FromWhichBSSID) + IN RX_BLK * pRxBlk, u8 FromWhichBSSID) { struct sk_buff *pOSPkt; @@ -540,8 +540,8 @@ void update_os_packet_info(IN PRTMP_ADAPTER pAd, void wlan_802_11_to_802_3_packet(IN PRTMP_ADAPTER pAd, IN RX_BLK * pRxBlk, - IN PUCHAR pHeader802_3, - IN UCHAR FromWhichBSSID) + u8 *pHeader802_3, + u8 FromWhichBSSID) { struct sk_buff *pOSPkt; @@ -628,15 +628,15 @@ void hex_dump(char *str, unsigned char *pSrcBufVA, unsigned int SrcBufLen) ======================================================================== */ -VOID RTMPSendWirelessEvent(IN PRTMP_ADAPTER pAd, - IN USHORT Event_flag, - IN PUCHAR pAddr, IN UCHAR BssIdx, IN CHAR Rssi) +void RTMPSendWirelessEvent(IN PRTMP_ADAPTER pAd, + u16 Event_flag, + u8 *pAddr, u8 BssIdx, char Rssi) { /*union iwreq_data wrqu; */ - PSTRING pBuf = NULL, pBufPtr = NULL; - USHORT event, type, BufLen; - UCHAR event_table_len = 0; + char *pBuf = NULL, *pBufPtr = NULL; + u16 event, type, BufLen; + u8 event_table_len = 0; type = Event_flag & 0xFF00; event = Event_flag & 0x00FF; @@ -705,7 +705,7 @@ VOID RTMPSendWirelessEvent(IN PRTMP_ADAPTER pAd, BufLen = pBufPtr - pBuf; RtmpOSWrielessEventSend(pAd, IWEVCUSTOM, Event_flag, NULL, - (PUCHAR) pBuf, BufLen); + (u8 *)pBuf, BufLen); /*DBGPRINT(RT_DEBUG_TRACE, ("%s : %s\n", __func__, pBuf)); */ kfree(pBuf); @@ -720,8 +720,8 @@ void send_monitor_packets(IN PRTMP_ADAPTER pAd, IN RX_BLK * pRxBlk) struct sk_buff *pOSPkt; wlan_ng_prism2_header *ph; int rate_index = 0; - USHORT header_len = 0; - UCHAR temp_header[40] = { 0 }; + u16 header_len = 0; + u8 temp_header[40] = { 0 }; u_int32_t ralinkrate[256] = { 2, 4, 11, 22, 12, 18, 24, 36, 48, 72, 96, 108, 109, 110, 111, 112, 13, 26, 39, 52, 78, 104, 117, 130, 26, 52, 78, 104, 156, 208, 234, 260, 27, 54, 81, 108, 162, 216, 243, 270, /* Last 38 */ 54, 108, 162, 216, 324, 432, 486, 540, 14, 29, 43, 57, 87, 115, @@ -816,7 +816,7 @@ void send_monitor_packets(IN PRTMP_ADAPTER pAd, IN RX_BLK * pRxBlk) ph->msgcode = DIDmsg_lnxind_wlansniffrm; ph->msglen = sizeof(wlan_ng_prism2_header); - strcpy((PSTRING) ph->devname, (PSTRING) pAd->net_dev->name); + strcpy((char *)ph->devname, (char *)pAd->net_dev->name); ph->hosttime.did = DIDmsg_lnxind_wlansniffrm_hosttime; ph->hosttime.status = 0; @@ -865,13 +865,13 @@ void send_monitor_packets(IN PRTMP_ADAPTER pAd, IN RX_BLK * pRxBlk) if (pRxBlk->pRxWI->PHYMODE >= MODE_HTMIX) { rate_index = - 16 + ((UCHAR) pRxBlk->pRxWI->BW * 16) + - ((UCHAR) pRxBlk->pRxWI->ShortGI * 32) + - ((UCHAR) pRxBlk->pRxWI->MCS); + 16 + ((u8)pRxBlk->pRxWI->BW * 16) + + ((u8)pRxBlk->pRxWI->ShortGI * 32) + + ((u8)pRxBlk->pRxWI->MCS); } else if (pRxBlk->pRxWI->PHYMODE == MODE_OFDM) - rate_index = (UCHAR) (pRxBlk->pRxWI->MCS) + 4; + rate_index = (u8)(pRxBlk->pRxWI->MCS) + 4; else - rate_index = (UCHAR) (pRxBlk->pRxWI->MCS); + rate_index = (u8)(pRxBlk->pRxWI->MCS); if (rate_index < 0) rate_index = 0; if (rate_index > 255) @@ -1005,7 +1005,7 @@ int RtmpOSFileWrite(RTMP_OS_FD osfd, char *pDataPtr, int writeLen) Task create/management/kill related functions. *******************************************************************************/ -NDIS_STATUS RtmpOSTaskKill(IN RTMP_OS_TASK * pTask) +int RtmpOSTaskKill(IN RTMP_OS_TASK * pTask) { RTMP_ADAPTER *pAd; int ret = NDIS_STATUS_FAILURE; @@ -1043,7 +1043,7 @@ NDIS_STATUS RtmpOSTaskKill(IN RTMP_OS_TASK * pTask) } -INT RtmpOSTaskNotifyToExit(IN RTMP_OS_TASK * pTask) +int RtmpOSTaskNotifyToExit(IN RTMP_OS_TASK * pTask) { #ifndef KTHREAD_SUPPORT @@ -1058,7 +1058,7 @@ void RtmpOSTaskCustomize(IN RTMP_OS_TASK * pTask) #ifndef KTHREAD_SUPPORT - daemonize((PSTRING) & pTask->taskName[0] /*"%s",pAd->net_dev->name */ ); + daemonize((char *)& pTask->taskName[0] /*"%s",pAd->net_dev->name */ ); allow_signal(SIGTERM); allow_signal(SIGKILL); @@ -1070,10 +1070,10 @@ void RtmpOSTaskCustomize(IN RTMP_OS_TASK * pTask) #endif } -NDIS_STATUS RtmpOSTaskAttach(IN RTMP_OS_TASK * pTask, +int RtmpOSTaskAttach(IN RTMP_OS_TASK * pTask, IN int (*fn) (void *), IN void *arg) { - NDIS_STATUS status = NDIS_STATUS_SUCCESS; + int status = NDIS_STATUS_SUCCESS; #ifdef KTHREAD_SUPPORT pTask->task_killed = 0; @@ -1098,15 +1098,15 @@ NDIS_STATUS RtmpOSTaskAttach(IN RTMP_OS_TASK * pTask, return status; } -NDIS_STATUS RtmpOSTaskInit(IN RTMP_OS_TASK * pTask, - IN PSTRING pTaskName, IN VOID * pPriv) +int RtmpOSTaskInit(IN RTMP_OS_TASK * pTask, + char *pTaskName, void * pPriv) { int len; ASSERT(pTask); #ifndef KTHREAD_SUPPORT - NdisZeroMemory((PUCHAR) (pTask), sizeof(RTMP_OS_TASK)); + NdisZeroMemory((u8 *)(pTask), sizeof(RTMP_OS_TASK)); #endif len = strlen(pTaskName); @@ -1142,10 +1142,10 @@ void RTMP_IndicateMediaState(IN PRTMP_ADAPTER pAd) } int RtmpOSWrielessEventSend(IN RTMP_ADAPTER * pAd, - IN UINT32 eventType, - IN INT flags, - IN PUCHAR pSrcMac, - IN PUCHAR pData, IN UINT32 dataLen) + u32 eventType, + int flags, + u8 *pSrcMac, + u8 *pData, u32 dataLen) { union iwreq_data wrqu; @@ -1164,7 +1164,7 @@ int RtmpOSWrielessEventSend(IN RTMP_ADAPTER * pAd, return 0; } -int RtmpOSNetDevAddrSet(IN PNET_DEV pNetDev, IN PUCHAR pMacAddr) +int RtmpOSNetDevAddrSet(IN PNET_DEV pNetDev, u8 *pMacAddr) { struct net_device *net_dev; RTMP_ADAPTER *pAd; @@ -1189,11 +1189,11 @@ int RtmpOSNetDevAddrSet(IN PNET_DEV pNetDev, IN PUCHAR pMacAddr) */ static int RtmpOSNetDevRequestName(IN RTMP_ADAPTER * pAd, IN PNET_DEV dev, - IN PSTRING pPrefixStr, IN INT devIdx) + char *pPrefixStr, int devIdx) { PNET_DEV existNetDev; - STRING suffixName[IFNAMSIZ]; - STRING desiredName[IFNAMSIZ]; + char suffixName[IFNAMSIZ]; + char desiredName[IFNAMSIZ]; int ifNameIdx, prefixLen, slotNameLen; int Status; @@ -1243,7 +1243,7 @@ void RtmpOSNetDevFree(PNET_DEV pNetDev) free_netdev(pNetDev); } -INT RtmpOSNetDevAlloc(IN PNET_DEV * new_dev_p, IN UINT32 privDataSize) +int RtmpOSNetDevAlloc(IN PNET_DEV * new_dev_p, u32 privDataSize) { /* assign it as null first. */ *new_dev_p = NULL; @@ -1258,7 +1258,7 @@ INT RtmpOSNetDevAlloc(IN PNET_DEV * new_dev_p, IN UINT32 privDataSize) return NDIS_STATUS_FAILURE; } -PNET_DEV RtmpOSNetDevGetByName(PNET_DEV pNetDev, PSTRING pDevName) +PNET_DEV RtmpOSNetDevGetByName(PNET_DEV pNetDev, char *pDevName) { PNET_DEV pTargetNetDev = NULL; @@ -1278,7 +1278,7 @@ void RtmpOSNetDeviceRefPut(PNET_DEV pNetDev) dev_put(pNetDev); } -INT RtmpOSNetDevDestory(IN RTMP_ADAPTER * pAd, IN PNET_DEV pNetDev) +int RtmpOSNetDevDestory(IN RTMP_ADAPTER * pAd, IN PNET_DEV pNetDev) { /* TODO: Need to fix this */ @@ -1332,9 +1332,9 @@ int RtmpOSNetDevAttach(IN PNET_DEV pNetDev, } PNET_DEV RtmpOSNetDevCreate(IN RTMP_ADAPTER * pAd, - IN INT devType, - IN INT devNum, - IN INT privMemSize, IN PSTRING pNamePrefix) + int devType, + int devNum, + int privMemSize, char *pNamePrefix) { struct net_device *pNetDev = NULL; int status; diff --git a/drivers/staging/rt2860/rt_linux.h b/drivers/staging/rt2860/rt_linux.h index 1e27c66..629310a 100644 --- a/drivers/staging/rt2860/rt_linux.h +++ b/drivers/staging/rt2860/rt_linux.h @@ -99,7 +99,6 @@ extern const struct iw_handler_def rt28xx_iw_handler_def; #define IN #define OUT #define INOUT -#define NDIS_STATUS INT /*********************************************************************************** * OS Specific definitions and data structures @@ -390,7 +389,7 @@ typedef void (*TIMER_FUNCTION) (unsigned long); #define ONE_TICK 1 -static inline void NdisGetSystemUpTime(ULONG * time) +static inline void NdisGetSystemUpTime(unsigned long * time) { *time = jiffies; } @@ -403,7 +402,7 @@ struct os_cookie { #ifdef RTMP_MAC_PCI struct pci_dev *pci_dev; struct pci_dev *parent_pci_dev; - USHORT DeviceID; + u16 DeviceID; dma_addr_t pAd_pa; #endif /* RTMP_MAC_PCI // */ #ifdef RTMP_MAC_USB @@ -427,8 +426,8 @@ struct os_cookie { #endif /* RTMP_MAC_USB // */ unsigned long apd_pid; /*802.1x daemon pid */ - INT ioctl_if_type; - INT ioctl_if; + int ioctl_if_type; + int ioctl_if; }; typedef struct os_cookie *POS_COOKIE; @@ -440,7 +439,7 @@ typedef struct os_cookie *POS_COOKIE; addr[0], addr[1], addr[2], addr[3], addr[4], addr[5] #ifdef DBG -extern ULONG RTDebugLevel; +extern unsigned long RTDebugLevel; #define DBGPRINT_RAW(Level, Fmt) \ do{ \ @@ -503,39 +502,39 @@ void linux_pci_unmap_single(void *handle, dma_addr_t dma_addr, size_t size, dev_alloc_skb(_length) #endif /* RTMP_MAC_PCI // */ #ifdef RTMP_MAC_USB -#define PCI_MAP_SINGLE(_handle, _ptr, _size, _dir) (ULONG)0 +#define PCI_MAP_SINGLE(_handle, _ptr, _size, _dir) (unsigned long)0 #define PCI_UNMAP_SINGLE(_handle, _ptr, _size, _dir) #endif /* RTMP_MAC_USB // */ /* - * ULONG + * unsigned long * RTMP_GetPhysicalAddressLow( * IN NDIS_PHYSICAL_ADDRESS PhysicalAddress); */ #define RTMP_GetPhysicalAddressLow(PhysicalAddress) (PhysicalAddress) /* - * ULONG + * unsigned long * RTMP_GetPhysicalAddressHigh( * IN NDIS_PHYSICAL_ADDRESS PhysicalAddress); */ #define RTMP_GetPhysicalAddressHigh(PhysicalAddress) (0) /* - * VOID + * void * RTMP_SetPhysicalAddressLow( * IN NDIS_PHYSICAL_ADDRESS PhysicalAddress, - * IN ULONG Value); + * unsigned long Value); */ #define RTMP_SetPhysicalAddressLow(PhysicalAddress, Value) \ PhysicalAddress = Value; /* - * VOID + * void * RTMP_SetPhysicalAddressHigh( * IN NDIS_PHYSICAL_ADDRESS PhysicalAddress, - * IN ULONG Value); + * unsigned long Value); */ #define RTMP_SetPhysicalAddressHigh(PhysicalAddress, Value) @@ -572,7 +571,7 @@ void linux_pci_unmap_single(void *handle, dma_addr_t dma_addr, size_t size, { \ if ((_A)->bPCIclkOff == FALSE) \ { \ - UINT Val; \ + u32 Val; \ Val = readl((void *)((_A)->CSRBaseAddress + MAC_CSR0)); \ writel((_V), (void *)((_A)->CSRBaseAddress + (_R))); \ } \ @@ -580,7 +579,7 @@ void linux_pci_unmap_single(void *handle, dma_addr_t dma_addr, size_t size, #define RTMP_IO_FORCE_WRITE32(_A, _R, _V) \ { \ - UINT Val; \ + u32 Val; \ Val = readl((void *)((_A)->CSRBaseAddress + MAC_CSR0)); \ writel(_V, (void *)((_A)->CSRBaseAddress + (_R))); \ } @@ -588,51 +587,51 @@ void linux_pci_unmap_single(void *handle, dma_addr_t dma_addr, size_t size, #if defined(RALINK_2880) || defined(RALINK_3052) #define RTMP_IO_WRITE8(_A, _R, _V) \ { \ - ULONG Val; \ - UCHAR _i; \ + unsigned long Val; \ + u8 _i; \ _i = ((_R) & 0x3); \ Val = readl((void *)((_A)->CSRBaseAddress + ((_R) - _i))); \ Val = Val & (~(0x000000ff << ((_i)*8))); \ - Val = Val | ((ULONG)(_V) << ((_i)*8)); \ + Val = Val | ((unsigned long)(_V) << ((_i)*8)); \ writel((Val), (void *)((_A)->CSRBaseAddress + ((_R) - _i))); \ } #else #define RTMP_IO_WRITE8(_A, _R, _V) \ { \ - UINT Val; \ + u32 Val; \ Val = readl((void *)((_A)->CSRBaseAddress + MAC_CSR0)); \ - writeb((_V), (PUCHAR)((_A)->CSRBaseAddress + (_R))); \ + writeb((_V), (u8 *)((_A)->CSRBaseAddress + (_R))); \ } #endif /* #if defined(BRCM_6358) || defined(RALINK_2880) // */ #define RTMP_IO_WRITE16(_A, _R, _V) \ { \ - UINT Val; \ + u32 Val; \ Val = readl((void *)((_A)->CSRBaseAddress + MAC_CSR0)); \ - writew((_V), (PUSHORT)((_A)->CSRBaseAddress + (_R))); \ + writew((_V), (u16 *)((_A)->CSRBaseAddress + (_R))); \ } #endif /* RTMP_MAC_PCI // */ #ifdef RTMP_MAC_USB /*Patch for ASIC turst read/write bug, needs to remove after metel fix */ #define RTMP_IO_READ32(_A, _R, _pV) \ - RTUSBReadMACRegister((_A), (_R), (PUINT32) (_pV)) + RTUSBReadMACRegister((_A), (_R), (u32 *)(_pV)) #define RTMP_IO_READ8(_A, _R, _pV) \ { \ } #define RTMP_IO_WRITE32(_A, _R, _V) \ - RTUSBWriteMACRegister((_A), (_R), (UINT32) (_V)) + RTUSBWriteMACRegister((_A), (_R), (u32)(_V)) #define RTMP_IO_WRITE8(_A, _R, _V) \ { \ - USHORT _Val = _V; \ - RTUSBSingleWrite((_A), (_R), (USHORT) (_Val)); \ + u16 _Val = _V; \ + RTUSBSingleWrite((_A), (_R), (u16)(_Val)); \ } #define RTMP_IO_WRITE16(_A, _R, _V) \ { \ - RTUSBSingleWrite((_A), (_R), (USHORT) (_V)); \ + RTUSBSingleWrite((_A), (_R), (u16)(_V)); \ } #endif /* RTMP_MAC_USB // */ @@ -687,7 +686,7 @@ void linux_pci_unmap_single(void *handle, dma_addr_t dma_addr, size_t size, #define GET_OS_PKT_DATATAIL(_pkt) \ (RTPKT_TO_OSPKT(_pkt)->tail) #define SET_OS_PKT_DATATAIL(_pkt, _start, _len) \ - ((RTPKT_TO_OSPKT(_pkt))->tail) = (PUCHAR)((_start) + (_len)) + ((RTPKT_TO_OSPKT(_pkt))->tail) = (u8 *)((_start) + (_len)) #define GET_OS_PKT_HEAD(_pkt) \ (RTPKT_TO_OSPKT(_pkt)->head) @@ -731,7 +730,7 @@ void linux_pci_unmap_single(void *handle, dma_addr_t dma_addr, size_t size, /*(this value also as MAC(on-chip WCID) table index) */ /* 0x80~0xff: TX to a WDS link. b0~6: WDS index */ #define RTMP_SET_PACKET_WCID(_p, _wdsidx) (RTPKT_TO_OSPKT(_p)->cb[CB_OFF+2] = _wdsidx) -#define RTMP_GET_PACKET_WCID(_p) ((UCHAR)(RTPKT_TO_OSPKT(_p)->cb[CB_OFF+2])) +#define RTMP_GET_PACKET_WCID(_p) ((u8)(RTPKT_TO_OSPKT(_p)->cb[CB_OFF+2])) /* 0xff: PKTSRC_NDIS, others: local TX buffer index. This value affects how to a packet */ #define RTMP_SET_PACKET_SOURCE(_p, _pktsrc) (RTPKT_TO_OSPKT(_p)->cb[CB_OFF+3] = _pktsrc) @@ -862,7 +861,7 @@ int rt28xx_packet_xmit(struct sk_buff *skb); IRQ_HANDLE_TYPE rt2860_interrupt(int irq, void *dev_instance); #endif /* RTMP_MAC_PCI // */ -INT rt28xx_sta_ioctl(IN PNET_DEV net_dev, IN OUT struct ifreq *rq, IN INT cmd); +int rt28xx_sta_ioctl(IN PNET_DEV net_dev, IN OUT struct ifreq *rq, int cmd); extern int ra_mtd_write(int num, loff_t to, size_t len, const u_char * buf); extern int ra_mtd_read(int num, loff_t from, size_t len, u_char * buf); diff --git a/drivers/staging/rt2860/rt_main_dev.c b/drivers/staging/rt2860/rt_main_dev.c index 84be9d0..21313ee 100644 --- a/drivers/staging/rt2860/rt_main_dev.c +++ b/drivers/staging/rt2860/rt_main_dev.c @@ -41,8 +41,8 @@ /* Private Variables Used */ /*---------------------------------------------------------------------*/ -PSTRING mac = ""; /* default 00:00:00:00:00:00 */ -PSTRING hostname = ""; /* default CMPC */ +char *mac = ""; /* default 00:00:00:00:00:00 */ +char *hostname = ""; /* default CMPC */ module_param(mac, charp, 0); MODULE_PARM_DESC(mac, "rt28xx: wireless mac addr"); @@ -55,7 +55,7 @@ int rt28xx_close(IN struct net_device *net_dev); int rt28xx_open(struct net_device *net_dev); /* private function prototype */ -static INT rt28xx_send_packets(IN struct sk_buff *skb_p, +static int rt28xx_send_packets(IN struct sk_buff *skb_p, IN struct net_device *net_dev); static struct net_device_stats *RT28xx_get_ether_stats(IN struct net_device @@ -213,7 +213,7 @@ int rt28xx_close(IN PNET_DEV dev) struct net_device *net_dev = (struct net_device *)dev; RTMP_ADAPTER *pAd = NULL; BOOLEAN Cancelled; - UINT32 i = 0; + u32 i = 0; #ifdef RTMP_MAC_USB DECLARE_WAIT_QUEUE_HEAD(unlink_wakeup); @@ -304,7 +304,7 @@ int rt28xx_close(IN PNET_DEV dev) #ifdef RTMP_MAC_PCI { BOOLEAN brc; - /* ULONG Value; */ + /* unsigned long Value; */ if (RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_INTERRUPT_ACTIVE)) { RTMP_ASIC_INTERRUPT_DISABLE(pAd); @@ -418,14 +418,14 @@ int rt28xx_open(IN PNET_DEV dev) RTMP_SET_FLAG(pAd, fRTMP_ADAPTER_START_UP); { - UINT32 reg = 0; + u32 reg = 0; RTMP_IO_READ32(pAd, 0x1300, ®); /* clear garbage interrupts */ printk("0x1300 = %08x\n", reg); } { /* u32 reg; */ -/* UINT8 byte; */ +/* u8 byte; */ /* u16 tmp; */ /* RTMP_IO_READ32(pAd, XIFS_TIME_CFG, ®); */ @@ -463,7 +463,7 @@ PNET_DEV RtmpPhyNetDevInit(IN RTMP_ADAPTER * pAd, IN RTMP_OS_NETDEV_OP_HOOK * pNetDevHook) { struct net_device *net_dev = NULL; -/* NDIS_STATUS Status; */ +/* int Status; */ net_dev = RtmpOSNetDevCreate(pAd, INT_MAIN, 0, sizeof(PRTMP_ADAPTER), @@ -480,7 +480,7 @@ PNET_DEV RtmpPhyNetDevInit(IN RTMP_ADAPTER * pAd, pNetDevHook->priv_flags = INT_MAIN; pNetDevHook->needProtcted = FALSE; - net_dev->ml_priv = (PVOID) pAd; + net_dev->ml_priv = (void *)pAd; pAd->net_dev = net_dev; netif_stop_queue(net_dev); @@ -571,7 +571,7 @@ static int rt28xx_send_packets(IN struct sk_buff *skb_p, return NETDEV_TX_OK; } - NdisZeroMemory((PUCHAR) & skb_p->cb[CB_OFF], 15); + NdisZeroMemory((u8 *)& skb_p->cb[CB_OFF], 15); RTMP_SET_PACKET_NET_DEVICE_MBSSID(skb_p, MAIN_MBSSID); return rt28xx_packet_xmit(skb_p); @@ -721,10 +721,10 @@ Return Value: Note: ======================================================================== */ -NDIS_STATUS AdapterBlockAllocateMemory(IN PVOID handle, OUT PVOID * ppAd) +int AdapterBlockAllocateMemory(void *handle, void ** ppAd) { - *ppAd = (PVOID) vmalloc(sizeof(RTMP_ADAPTER)); /*pci_alloc_consistent(pci_dev, sizeof(RTMP_ADAPTER), phy_addr); */ + *ppAd = (void *)vmalloc(sizeof(RTMP_ADAPTER)); /*pci_alloc_consistent(pci_dev, sizeof(RTMP_ADAPTER), phy_addr); */ if (*ppAd) { NdisZeroMemory(*ppAd, sizeof(RTMP_ADAPTER)); diff --git a/drivers/staging/rt2860/rt_pci_rbus.c b/drivers/staging/rt2860/rt_pci_rbus.c index 0f75c3f..8df44ba 100644 --- a/drivers/staging/rt2860/rt_pci_rbus.c +++ b/drivers/staging/rt2860/rt_pci_rbus.c @@ -78,54 +78,54 @@ static void fifo_statistic_full_tasklet(unsigned long data); **************************************************************************/ /* Function for TxDesc Memory allocation. */ void RTMP_AllocateTxDescMemory(IN PRTMP_ADAPTER pAd, - IN UINT Index, - IN ULONG Length, + u32 Index, + unsigned long Length, IN BOOLEAN Cached, - OUT PVOID * VirtualAddress, + void ** VirtualAddress, OUT PNDIS_PHYSICAL_ADDRESS PhysicalAddress) { POS_COOKIE pObj = (POS_COOKIE) pAd->OS_Cookie; *VirtualAddress = - (PVOID) pci_alloc_consistent(pObj->pci_dev, sizeof(char) * Length, + (void *)pci_alloc_consistent(pObj->pci_dev, sizeof(char) * Length, PhysicalAddress); } /* Function for MgmtDesc Memory allocation. */ void RTMP_AllocateMgmtDescMemory(IN PRTMP_ADAPTER pAd, - IN ULONG Length, + unsigned long Length, IN BOOLEAN Cached, - OUT PVOID * VirtualAddress, + void ** VirtualAddress, OUT PNDIS_PHYSICAL_ADDRESS PhysicalAddress) { POS_COOKIE pObj = (POS_COOKIE) pAd->OS_Cookie; *VirtualAddress = - (PVOID) pci_alloc_consistent(pObj->pci_dev, sizeof(char) * Length, + (void *)pci_alloc_consistent(pObj->pci_dev, sizeof(char) * Length, PhysicalAddress); } /* Function for RxDesc Memory allocation. */ void RTMP_AllocateRxDescMemory(IN PRTMP_ADAPTER pAd, - IN ULONG Length, + unsigned long Length, IN BOOLEAN Cached, - OUT PVOID * VirtualAddress, + void ** VirtualAddress, OUT PNDIS_PHYSICAL_ADDRESS PhysicalAddress) { POS_COOKIE pObj = (POS_COOKIE) pAd->OS_Cookie; *VirtualAddress = - (PVOID) pci_alloc_consistent(pObj->pci_dev, sizeof(char) * Length, + (void *)pci_alloc_consistent(pObj->pci_dev, sizeof(char) * Length, PhysicalAddress); } /* Function for free allocated Desc Memory. */ void RTMP_FreeDescMemory(IN PRTMP_ADAPTER pAd, - IN ULONG Length, - IN PVOID VirtualAddress, + unsigned long Length, + void *VirtualAddress, IN NDIS_PHYSICAL_ADDRESS PhysicalAddress) { POS_COOKIE pObj = (POS_COOKIE) pAd->OS_Cookie; @@ -136,23 +136,23 @@ void RTMP_FreeDescMemory(IN PRTMP_ADAPTER pAd, /* Function for TxData DMA Memory allocation. */ void RTMP_AllocateFirstTxBuffer(IN PRTMP_ADAPTER pAd, - IN UINT Index, - IN ULONG Length, + u32 Index, + unsigned long Length, IN BOOLEAN Cached, - OUT PVOID * VirtualAddress, + void ** VirtualAddress, OUT PNDIS_PHYSICAL_ADDRESS PhysicalAddress) { POS_COOKIE pObj = (POS_COOKIE) pAd->OS_Cookie; *VirtualAddress = - (PVOID) pci_alloc_consistent(pObj->pci_dev, sizeof(char) * Length, + (void *)pci_alloc_consistent(pObj->pci_dev, sizeof(char) * Length, PhysicalAddress); } void RTMP_FreeFirstTxBuffer(IN PRTMP_ADAPTER pAd, - IN ULONG Length, + unsigned long Length, IN BOOLEAN Cached, - IN PVOID VirtualAddress, + void *VirtualAddress, IN NDIS_PHYSICAL_ADDRESS PhysicalAddress) { POS_COOKIE pObj = (POS_COOKIE) pAd->OS_Cookie; @@ -171,15 +171,15 @@ void RTMP_FreeFirstTxBuffer(IN PRTMP_ADAPTER pAd, * PhysicalAddress: Physical address corresponding to virtual address */ void RTMP_AllocateSharedMemory(IN PRTMP_ADAPTER pAd, - IN ULONG Length, + unsigned long Length, IN BOOLEAN Cached, - OUT PVOID * VirtualAddress, + void ** VirtualAddress, OUT PNDIS_PHYSICAL_ADDRESS PhysicalAddress) { POS_COOKIE pObj = (POS_COOKIE) pAd->OS_Cookie; *VirtualAddress = - (PVOID) pci_alloc_consistent(pObj->pci_dev, sizeof(char) * Length, + (void *)pci_alloc_consistent(pObj->pci_dev, sizeof(char) * Length, PhysicalAddress); } @@ -195,9 +195,9 @@ void RTMP_AllocateSharedMemory(IN PRTMP_ADAPTER pAd, * Cached is ignored: always cached memory */ PNDIS_PACKET RTMP_AllocateRxPacketBuffer(IN PRTMP_ADAPTER pAd, - IN ULONG Length, + unsigned long Length, IN BOOLEAN Cached, - OUT PVOID * VirtualAddress, + void ** VirtualAddress, OUT PNDIS_PHYSICAL_ADDRESS PhysicalAddress) { @@ -212,19 +212,19 @@ PNDIS_PACKET RTMP_AllocateRxPacketBuffer(IN PRTMP_ADAPTER pAd, if (pkt) { RTMP_SET_PACKET_SOURCE(OSPKT_TO_RTPKT(pkt), PKTSRC_NDIS); - *VirtualAddress = (PVOID) pkt->data; + *VirtualAddress = (void *)pkt->data; *PhysicalAddress = PCI_MAP_SINGLE(pAd, *VirtualAddress, Length, -1, PCI_DMA_FROMDEVICE); } else { - *VirtualAddress = (PVOID) NULL; + *VirtualAddress = (void *)NULL; *PhysicalAddress = (NDIS_PHYSICAL_ADDRESS) NULL; } return (PNDIS_PACKET) pkt; } -VOID Invalid_Remaining_Packet(IN PRTMP_ADAPTER pAd, IN ULONG VirtualAddress) +void Invalid_Remaining_Packet(IN PRTMP_ADAPTER pAd, unsigned long VirtualAddress) { NDIS_PHYSICAL_ADDRESS PhysicalAddress; @@ -233,7 +233,7 @@ VOID Invalid_Remaining_Packet(IN PRTMP_ADAPTER pAd, IN ULONG VirtualAddress) RX_BUFFER_NORMSIZE - 1600, -1, PCI_DMA_FROMDEVICE); } -NDIS_STATUS RtmpNetTaskInit(IN RTMP_ADAPTER * pAd) +int RtmpNetTaskInit(IN RTMP_ADAPTER * pAd) { POS_COOKIE pObj; @@ -273,7 +273,7 @@ void RtmpNetTaskExit(IN RTMP_ADAPTER * pAd) tasklet_kill(&pObj->fifo_statistic_full_task); } -NDIS_STATUS RtmpMgmtTaskInit(IN RTMP_ADAPTER * pAd) +int RtmpMgmtTaskInit(IN RTMP_ADAPTER * pAd) { return NDIS_STATUS_SUCCESS; @@ -293,7 +293,7 @@ Return Value: Note: ======================================================================== */ -VOID RtmpMgmtTaskExit(IN RTMP_ADAPTER * pAd) +void RtmpMgmtTaskExit(IN RTMP_ADAPTER * pAd) { return; @@ -401,7 +401,7 @@ static void rx_done_tasklet(unsigned long data) return; } - /* enable RxINT again */ + /* enable Rxint again */ rt2860_int_enable(pAd, INT_RX); RTMP_INT_UNLOCK(&pAd->irq_lock, flags); @@ -434,7 +434,7 @@ void fifo_statistic_full_tasklet(unsigned long data) return; } - /* enable RxINT again */ + /* enable Rxint again */ rt2860_int_enable(pAd, FifoStaFullInt); RTMP_INT_UNLOCK(&pAd->irq_lock, flags); @@ -712,7 +712,7 @@ IRQ_HANDLE_TYPE rt2860_interrupt(int irq, void *dev_instance) if (IntSource.word & INT_RX) { if ((pAd->int_disable_mask & INT_RX) == 0) { - /* mask RxINT */ + /* mask Rxint */ rt2860_int_disable(pAd, INT_RX); tasklet_hi_schedule(&pObj->rx_done_task); } diff --git a/drivers/staging/rt2860/rt_usb.c b/drivers/staging/rt2860/rt_usb.c index e4668dc..2db7d6e 100644 --- a/drivers/staging/rt2860/rt_usb.c +++ b/drivers/staging/rt2860/rt_usb.c @@ -77,10 +77,10 @@ Return Value: Note: ======================================================================== */ -NDIS_STATUS RtmpMgmtTaskInit(IN RTMP_ADAPTER * pAd) +int RtmpMgmtTaskInit(IN RTMP_ADAPTER * pAd) { RTMP_OS_TASK *pTask; - NDIS_STATUS status; + int status; /* Creat TimerQ Thread, We need init timerQ related structure before create the timer thread. @@ -133,9 +133,9 @@ Return Value: Note: ======================================================================== */ -VOID RtmpMgmtTaskExit(IN RTMP_ADAPTER * pAd) +void RtmpMgmtTaskExit(IN RTMP_ADAPTER * pAd) { - INT ret; + int ret; RTMP_OS_TASK *pTask; /* Sleep 50 milliseconds so pending io might finish normally */ @@ -201,8 +201,8 @@ static void rtusb_dataout_complete(unsigned long data) purbb_t pUrb; POS_COOKIE pObj; PHT_TX_CONTEXT pHTTXContext; - UCHAR BulkOutPipeId; - NTSTATUS Status; + u8 BulkOutPipeId; + int Status; unsigned long IrqFlags; pUrb = (purbb_t) data; @@ -235,7 +235,7 @@ static void rtusb_dataout_complete(unsigned long data) } else /* STATUS_OTHER */ { - PUCHAR pBuf; + u8 *pBuf; pAd->BulkOutCompleteOther++; @@ -297,7 +297,7 @@ static void rtusb_null_frame_done_tasklet(unsigned long data) PRTMP_ADAPTER pAd; PTX_CONTEXT pNullContext; purbb_t pUrb; - NTSTATUS Status; + int Status; unsigned long irqFlag; pUrb = (purbb_t) data; @@ -346,7 +346,7 @@ static void rtusb_rts_frame_done_tasklet(unsigned long data) PRTMP_ADAPTER pAd; PTX_CONTEXT pRTSContext; purbb_t pUrb; - NTSTATUS Status; + int Status; unsigned long irqFlag; pUrb = (purbb_t) data; @@ -396,7 +396,7 @@ static void rtusb_pspoll_frame_done_tasklet(unsigned long data) PRTMP_ADAPTER pAd; PTX_CONTEXT pPsPollContext; purbb_t pUrb; - NTSTATUS Status; + int Status; pUrb = (purbb_t) data; pPsPollContext = (PTX_CONTEXT) pUrb->context; @@ -455,7 +455,7 @@ static void rx_done_tasklet(unsigned long data) purbb_t pUrb; PRX_CONTEXT pRxContext; PRTMP_ADAPTER pAd; - NTSTATUS Status; + int Status; unsigned int IrqFlags; pUrb = (purbb_t) data; @@ -519,7 +519,7 @@ static void rtusb_mgmt_dma_done_tasklet(unsigned long data) int index; PNDIS_PACKET pPacket; purbb_t pUrb; - NTSTATUS Status; + int Status; unsigned long IrqFlags; pUrb = (purbb_t) data; @@ -597,7 +597,7 @@ static void rtusb_ac3_dma_done_tasklet(unsigned long data) { PRTMP_ADAPTER pAd; PHT_TX_CONTEXT pHTTXContext; - UCHAR BulkOutPipeId = 3; + u8 BulkOutPipeId = 3; purbb_t pUrb; pUrb = (purbb_t) data; @@ -637,7 +637,7 @@ static void rtusb_ac2_dma_done_tasklet(unsigned long data) { PRTMP_ADAPTER pAd; PHT_TX_CONTEXT pHTTXContext; - UCHAR BulkOutPipeId = 2; + u8 BulkOutPipeId = 2; purbb_t pUrb; pUrb = (purbb_t) data; @@ -677,7 +677,7 @@ static void rtusb_ac1_dma_done_tasklet(unsigned long data) { PRTMP_ADAPTER pAd; PHT_TX_CONTEXT pHTTXContext; - UCHAR BulkOutPipeId = 1; + u8 BulkOutPipeId = 1; purbb_t pUrb; pUrb = (purbb_t) data; @@ -717,7 +717,7 @@ static void rtusb_ac0_dma_done_tasklet(unsigned long data) { PRTMP_ADAPTER pAd; PHT_TX_CONTEXT pHTTXContext; - UCHAR BulkOutPipeId = 0; + u8 BulkOutPipeId = 0; purbb_t pUrb; pUrb = (purbb_t) data; @@ -753,12 +753,12 @@ static void rtusb_ac0_dma_done_tasklet(unsigned long data) } -NDIS_STATUS RtmpNetTaskInit(IN RTMP_ADAPTER * pAd) +int RtmpNetTaskInit(IN RTMP_ADAPTER * pAd) { POS_COOKIE pObj = (POS_COOKIE) pAd->OS_Cookie; /* Create receive tasklet */ - tasklet_init(&pObj->rx_done_task, rx_done_tasklet, (ULONG) pAd); + tasklet_init(&pObj->rx_done_task, rx_done_tasklet, (unsigned long)pAd); tasklet_init(&pObj->mgmt_dma_done_task, rtusb_mgmt_dma_done_tasklet, (unsigned long)pAd); tasklet_init(&pObj->ac0_dma_done_task, rtusb_ac0_dma_done_tasklet, diff --git a/drivers/staging/rt2860/rtmp.h b/drivers/staging/rt2860/rtmp.h index 2ac9663..6acd29f 100644 --- a/drivers/staging/rt2860/rtmp.h +++ b/drivers/staging/rt2860/rtmp.h @@ -62,100 +62,100 @@ typedef struct _RTMP_CHIP_OP_ RTMP_CHIP_OP; extern unsigned char SNAP_AIRONET[]; extern unsigned char CISCO_OUI[]; -extern UCHAR BaSizeArray[4]; +extern u8 BaSizeArray[4]; -extern UCHAR BROADCAST_ADDR[MAC_ADDR_LEN]; -extern UCHAR ZERO_MAC_ADDR[MAC_ADDR_LEN]; -extern ULONG BIT32[32]; -extern UCHAR BIT8[8]; +extern u8 BROADCAST_ADDR[MAC_ADDR_LEN]; +extern u8 ZERO_MAC_ADDR[MAC_ADDR_LEN]; +extern unsigned long BIT32[32]; +extern u8 BIT8[8]; extern char *CipherName[]; extern char *MCSToMbps[]; -extern UCHAR RxwiMCSToOfdmRate[12]; -extern UCHAR SNAP_802_1H[6]; -extern UCHAR SNAP_BRIDGE_TUNNEL[6]; -extern UCHAR SNAP_AIRONET[8]; -extern UCHAR CKIP_LLC_SNAP[8]; -extern UCHAR EAPOL_LLC_SNAP[8]; -extern UCHAR EAPOL[2]; -extern UCHAR IPX[2]; -extern UCHAR APPLE_TALK[2]; -extern UCHAR RateIdToPlcpSignal[12]; /* see IEEE802.11a-1999 p.14 */ -extern UCHAR OfdmRateToRxwiMCS[]; -extern UCHAR OfdmSignalToRateId[16]; -extern UCHAR default_cwmin[4]; -extern UCHAR default_cwmax[4]; -extern UCHAR default_sta_aifsn[4]; -extern UCHAR MapUserPriorityToAccessCategory[8]; - -extern USHORT RateUpPER[]; -extern USHORT RateDownPER[]; -extern UCHAR Phy11BNextRateDownward[]; -extern UCHAR Phy11BNextRateUpward[]; -extern UCHAR Phy11BGNextRateDownward[]; -extern UCHAR Phy11BGNextRateUpward[]; -extern UCHAR Phy11ANextRateDownward[]; -extern UCHAR Phy11ANextRateUpward[]; -extern CHAR RssiSafeLevelForTxRate[]; -extern UCHAR RateIdToMbps[]; -extern USHORT RateIdTo500Kbps[]; - -extern UCHAR CipherSuiteWpaNoneTkip[]; -extern UCHAR CipherSuiteWpaNoneTkipLen; - -extern UCHAR CipherSuiteWpaNoneAes[]; -extern UCHAR CipherSuiteWpaNoneAesLen; - -extern UCHAR SsidIe; -extern UCHAR SupRateIe; -extern UCHAR ExtRateIe; - -extern UCHAR HtCapIe; -extern UCHAR AddHtInfoIe; -extern UCHAR NewExtChanIe; - -extern UCHAR ErpIe; -extern UCHAR DsIe; -extern UCHAR TimIe; -extern UCHAR WpaIe; -extern UCHAR Wpa2Ie; -extern UCHAR IbssIe; -extern UCHAR Ccx2Ie; -extern UCHAR WapiIe; - -extern UCHAR WPA_OUI[]; -extern UCHAR RSN_OUI[]; -extern UCHAR WAPI_OUI[]; -extern UCHAR WME_INFO_ELEM[]; -extern UCHAR WME_PARM_ELEM[]; -extern UCHAR Ccx2QosInfo[]; -extern UCHAR Ccx2IeInfo[]; -extern UCHAR RALINK_OUI[]; -extern UCHAR PowerConstraintIE[]; - -extern UCHAR RateSwitchTable[]; -extern UCHAR RateSwitchTable11B[]; -extern UCHAR RateSwitchTable11G[]; -extern UCHAR RateSwitchTable11BG[]; - -extern UCHAR RateSwitchTable11BGN1S[]; -extern UCHAR RateSwitchTable11BGN2S[]; -extern UCHAR RateSwitchTable11BGN2SForABand[]; -extern UCHAR RateSwitchTable11N1S[]; -extern UCHAR RateSwitchTable11N2S[]; -extern UCHAR RateSwitchTable11N2SForABand[]; - -extern UCHAR PRE_N_HT_OUI[]; +extern u8 RxwiMCSToOfdmRate[12]; +extern u8 SNAP_802_1H[6]; +extern u8 SNAP_BRIDGE_TUNNEL[6]; +extern u8 SNAP_AIRONET[8]; +extern u8 CKIP_LLC_SNAP[8]; +extern u8 EAPOL_LLC_SNAP[8]; +extern u8 EAPOL[2]; +extern u8 IPX[2]; +extern u8 APPLE_TALK[2]; +extern u8 RateIdToPlcpSignal[12]; /* see IEEE802.11a-1999 p.14 */ +extern u8 OfdmRateToRxwiMCS[]; +extern u8 OfdmSignalToRateId[16]; +extern u8 default_cwmin[4]; +extern u8 default_cwmax[4]; +extern u8 default_sta_aifsn[4]; +extern u8 MapUserPriorityToAccessCategory[8]; + +extern u16 RateUpPER[]; +extern u16 RateDownPER[]; +extern u8 Phy11BNextRateDownward[]; +extern u8 Phy11BNextRateUpward[]; +extern u8 Phy11BGNextRateDownward[]; +extern u8 Phy11BGNextRateUpward[]; +extern u8 Phy11ANextRateDownward[]; +extern u8 Phy11ANextRateUpward[]; +extern char RssiSafeLevelForTxRate[]; +extern u8 RateIdToMbps[]; +extern u16 RateIdTo500Kbps[]; + +extern u8 CipherSuiteWpaNoneTkip[]; +extern u8 CipherSuiteWpaNoneTkipLen; + +extern u8 CipherSuiteWpaNoneAes[]; +extern u8 CipherSuiteWpaNoneAesLen; + +extern u8 SsidIe; +extern u8 SupRateIe; +extern u8 ExtRateIe; + +extern u8 HtCapIe; +extern u8 AddHtInfoIe; +extern u8 NewExtChanIe; + +extern u8 ErpIe; +extern u8 DsIe; +extern u8 TimIe; +extern u8 WpaIe; +extern u8 Wpa2Ie; +extern u8 IbssIe; +extern u8 Ccx2Ie; +extern u8 WapiIe; + +extern u8 WPA_OUI[]; +extern u8 RSN_OUI[]; +extern u8 WAPI_OUI[]; +extern u8 WME_INFO_ELEM[]; +extern u8 WME_PARM_ELEM[]; +extern u8 Ccx2QosInfo[]; +extern u8 Ccx2IeInfo[]; +extern u8 RALINK_OUI[]; +extern u8 PowerConstraintIE[]; + +extern u8 RateSwitchTable[]; +extern u8 RateSwitchTable11B[]; +extern u8 RateSwitchTable11G[]; +extern u8 RateSwitchTable11BG[]; + +extern u8 RateSwitchTable11BGN1S[]; +extern u8 RateSwitchTable11BGN2S[]; +extern u8 RateSwitchTable11BGN2SForABand[]; +extern u8 RateSwitchTable11N1S[]; +extern u8 RateSwitchTable11N2S[]; +extern u8 RateSwitchTable11N2SForABand[]; + +extern u8 PRE_N_HT_OUI[]; typedef struct _RSSI_SAMPLE { - CHAR LastRssi0; /* last received RSSI */ - CHAR LastRssi1; /* last received RSSI */ - CHAR LastRssi2; /* last received RSSI */ - CHAR AvgRssi0; - CHAR AvgRssi1; - CHAR AvgRssi2; - SHORT AvgRssi0X8; - SHORT AvgRssi1X8; - SHORT AvgRssi2X8; + char LastRssi0; /* last received RSSI */ + char LastRssi1; /* last received RSSI */ + char LastRssi2; /* last received RSSI */ + char AvgRssi0; + char AvgRssi1; + char AvgRssi2; + short AvgRssi0X8; + short AvgRssi1X8; + short AvgRssi2X8; } RSSI_SAMPLE; /* */ @@ -169,7 +169,7 @@ typedef struct _QUEUE_ENTRY { typedef struct _QUEUE_HEADER { PQUEUE_ENTRY Head; PQUEUE_ENTRY Tail; - ULONG Number; + unsigned long Number; } QUEUE_HEADER, *PQUEUE_HEADER; #define InitializeQueueHeader(QueueHeader) \ @@ -280,14 +280,14 @@ typedef struct _QUEUE_HEADER { _pAd->StaActive.SupportedHtPhy.RecomWidth = _pAd->MlmeAux.AddHtInfo.AddHtInfo.RecomWidth; \ _pAd->StaActive.SupportedHtPhy.OperaionMode = _pAd->MlmeAux.AddHtInfo.AddHtInfo2.OperaionMode; \ _pAd->StaActive.SupportedHtPhy.NonGfPresent = _pAd->MlmeAux.AddHtInfo.AddHtInfo2.NonGfPresent; \ - NdisMoveMemory((_pAd)->MacTab.Content[BSSID_WCID].HTCapability.MCSSet, (_pAd)->StaActive.SupportedPhyInfo.MCSSet, sizeof(UCHAR) * 16);\ + NdisMoveMemory((_pAd)->MacTab.Content[BSSID_WCID].HTCapability.MCSSet, (_pAd)->StaActive.SupportedPhyInfo.MCSSet, sizeof(u8)* 16);\ } #define COPY_AP_HTSETTINGS_FROM_BEACON(_pAd, _pHtCapability) \ { \ - _pAd->MacTab.Content[BSSID_WCID].AMsduSize = (UCHAR)(_pHtCapability->HtCapInfo.AMsduSize); \ - _pAd->MacTab.Content[BSSID_WCID].MmpsMode= (UCHAR)(_pHtCapability->HtCapInfo.MimoPs); \ - _pAd->MacTab.Content[BSSID_WCID].MaxRAmpduFactor = (UCHAR)(_pHtCapability->HtCapParm.MaxRAmpduFactor); \ + _pAd->MacTab.Content[BSSID_WCID].AMsduSize = (u8)(_pHtCapability->HtCapInfo.AMsduSize); \ + _pAd->MacTab.Content[BSSID_WCID].MmpsMode= (u8)(_pHtCapability->HtCapInfo.MimoPs); \ + _pAd->MacTab.Content[BSSID_WCID].MaxRAmpduFactor = (u8)(_pHtCapability->HtCapParm.MaxRAmpduFactor); \ } /* */ @@ -295,13 +295,13 @@ typedef struct _QUEUE_HEADER { /* */ /* Usage : RTMP_IO_READ32( */ /* PRTMP_ADAPTER pAd, */ -/* ULONG Register_Offset, */ -/* PULONG pValue) */ +/* unsigned long Register_Offset, */ +/* unsigned long * pValue) */ /* */ /* RTMP_IO_WRITE32( */ /* PRTMP_ADAPTER pAd, */ -/* ULONG Register_Offset, */ -/* ULONG Value) */ +/* unsigned long Register_Offset, */ +/* unsigned long Value) */ /* */ /* */ @@ -312,14 +312,14 @@ typedef struct _QUEUE_HEADER { #define NIC_MAX_PHYS_BUF_COUNT 8 typedef struct _RTMP_SCATTER_GATHER_ELEMENT { - PVOID Address; - ULONG Length; - PULONG Reserved; + void *Address; + unsigned long Length; + unsigned long *Reserved; } RTMP_SCATTER_GATHER_ELEMENT, *PRTMP_SCATTER_GATHER_ELEMENT; typedef struct _RTMP_SCATTER_GATHER_LIST { - ULONG NumberOfElements; - PULONG Reserved; + unsigned long NumberOfElements; + unsigned long *Reserved; RTMP_SCATTER_GATHER_ELEMENT Elements[NIC_MAX_PHYS_BUF_COUNT]; } RTMP_SCATTER_GATHER_LIST, *PRTMP_SCATTER_GATHER_LIST; @@ -405,13 +405,13 @@ typedef struct _RTMP_SCATTER_GATHER_LIST { if (NdisEqualMemory(SNAP_802_1H, _pData, 6) || \ NdisEqualMemory(SNAP_BRIDGE_TUNNEL, _pData, 6)) \ { \ - PUCHAR pProto = _pData + 6; \ + u8 *pProto = _pData + 6; \ \ if ((NdisEqualMemory(IPX, pProto, 2) || NdisEqualMemory(APPLE_TALK, pProto, 2)) && \ NdisEqualMemory(SNAP_802_1H, _pData, 6)) \ { \ - LLC_Len[0] = (UCHAR)(_DataSize / 256); \ - LLC_Len[1] = (UCHAR)(_DataSize % 256); \ + LLC_Len[0] = (u8)(_DataSize / 256); \ + LLC_Len[1] = (u8)(_DataSize % 256); \ MAKE_802_3_HEADER(_p8023hdr, _pDA, _pSA, LLC_Len); \ } \ else \ @@ -424,8 +424,8 @@ typedef struct _RTMP_SCATTER_GATHER_LIST { } \ else \ { \ - LLC_Len[0] = (UCHAR)(_DataSize / 256); \ - LLC_Len[1] = (UCHAR)(_DataSize % 256); \ + LLC_Len[0] = (u8)(_DataSize / 256); \ + LLC_Len[1] = (u8)(_DataSize % 256); \ MAKE_802_3_HEADER(_p8023hdr, _pDA, _pSA, LLC_Len); \ } \ } @@ -436,21 +436,21 @@ typedef struct _RTMP_SCATTER_GATHER_LIST { #ifdef RTMP_MAC_PCI #define REPORT_MGMT_FRAME_TO_MLME(_pAd, Wcid, _pFrame, _FrameSize, _Rssi0, _Rssi1, _Rssi2, _PlcpSignal) \ { \ - UINT32 High32TSF, Low32TSF; \ + u32 High32TSF, Low32TSF; \ RTMP_IO_READ32(_pAd, TSF_TIMER_DW1, &High32TSF); \ RTMP_IO_READ32(_pAd, TSF_TIMER_DW0, &Low32TSF); \ - MlmeEnqueueForRecv(_pAd, Wcid, High32TSF, Low32TSF, (UCHAR)_Rssi0, (UCHAR)_Rssi1,(UCHAR)_Rssi2,_FrameSize, _pFrame, (UCHAR)_PlcpSignal); \ + MlmeEnqueueForRecv(_pAd, Wcid, High32TSF, Low32TSF, (u8)_Rssi0, (u8)_Rssi1,(u8)_Rssi2,_FrameSize, _pFrame, (u8)_PlcpSignal); \ } #endif /* RTMP_MAC_PCI // */ #ifdef RTMP_MAC_USB #define REPORT_MGMT_FRAME_TO_MLME(_pAd, Wcid, _pFrame, _FrameSize, _Rssi0, _Rssi1, _Rssi2, _PlcpSignal) \ { \ - UINT32 High32TSF=0, Low32TSF=0; \ - MlmeEnqueueForRecv(_pAd, Wcid, High32TSF, Low32TSF, (UCHAR)_Rssi0, (UCHAR)_Rssi1,(UCHAR)_Rssi2,_FrameSize, _pFrame, (UCHAR)_PlcpSignal); \ + u32 High32TSF=0, Low32TSF=0; \ + MlmeEnqueueForRecv(_pAd, Wcid, High32TSF, Low32TSF, (u8)_Rssi0, (u8)_Rssi1,(u8)_Rssi2,_FrameSize, _pFrame, (u8)_PlcpSignal); \ } #endif /* RTMP_MAC_USB // */ -#define MAC_ADDR_EQUAL(pAddr1,pAddr2) RTMPEqualMemory((PVOID)(pAddr1), (PVOID)(pAddr2), MAC_ADDR_LEN) +#define MAC_ADDR_EQUAL(pAddr1,pAddr2) RTMPEqualMemory((void *)(pAddr1), (void *)(pAddr2), MAC_ADDR_LEN) #define SSID_EQUAL(ssid1, len1, ssid2, len2) ((len1==len2) && (RTMPEqualMemory(ssid1, ssid2, len1))) /* */ @@ -477,8 +477,8 @@ typedef struct _RTMP_SCATTER_GATHER_LIST { /* Both DMA to / from CPU use the same structure. */ /* */ typedef struct _RTMP_DMABUF { - ULONG AllocSize; - PVOID AllocVa; /* TxBuf virtual address */ + unsigned long AllocSize; + void *AllocVa; /* TxBuf virtual address */ NDIS_PHYSICAL_ADDRESS AllocPa; /* TxBuf physical address */ } RTMP_DMABUF, *PRTMP_DMABUF; @@ -491,8 +491,8 @@ typedef struct _RTMP_DMABUF { /* which driver should ACK upper layer when the tx is physically done or failed. */ /* */ typedef struct _RTMP_DMACB { - ULONG AllocSize; /* Control block size */ - PVOID AllocVa; /* Control block virtual address */ + unsigned long AllocSize; /* Control block size */ + void *AllocVa; /* Control block virtual address */ NDIS_PHYSICAL_ADDRESS AllocPa; /* Control block physical address */ PNDIS_PACKET pNdisPacket; PNDIS_PACKET pNextNdisPacket; @@ -502,23 +502,23 @@ typedef struct _RTMP_DMACB { typedef struct _RTMP_TX_RING { RTMP_DMACB Cell[TX_RING_SIZE]; - UINT32 TxCpuIdx; - UINT32 TxDmaIdx; - UINT32 TxSwFreeIdx; /* software next free tx index */ + u32 TxCpuIdx; + u32 TxDmaIdx; + u32 TxSwFreeIdx; /* software next free tx index */ } RTMP_TX_RING, *PRTMP_TX_RING; typedef struct _RTMP_RX_RING { RTMP_DMACB Cell[RX_RING_SIZE]; - UINT32 RxCpuIdx; - UINT32 RxDmaIdx; - INT32 RxSwReadIdx; /* software next read index */ + u32 RxCpuIdx; + u32 RxDmaIdx; + int RxSwReadIdx; /* software next read index */ } RTMP_RX_RING, *PRTMP_RX_RING; typedef struct _RTMP_MGMT_RING { RTMP_DMACB Cell[MGMT_RING_SIZE]; - UINT32 TxCpuIdx; - UINT32 TxDmaIdx; - UINT32 TxSwFreeIdx; /* software next free tx index */ + u32 TxCpuIdx; + u32 TxDmaIdx; + u32 TxSwFreeIdx; /* software next free tx index */ } RTMP_MGMT_RING, *PRTMP_MGMT_RING; /* */ @@ -526,21 +526,21 @@ typedef struct _RTMP_MGMT_RING { /* */ typedef struct _COUNTER_802_3 { /* General Stats */ - ULONG GoodTransmits; - ULONG GoodReceives; - ULONG TxErrors; - ULONG RxErrors; - ULONG RxNoBuffer; + unsigned long GoodTransmits; + unsigned long GoodReceives; + unsigned long TxErrors; + unsigned long RxErrors; + unsigned long RxNoBuffer; /* Ethernet Stats */ - ULONG RcvAlignmentErrors; - ULONG OneCollision; - ULONG MoreCollisions; + unsigned long RcvAlignmentErrors; + unsigned long OneCollision; + unsigned long MoreCollisions; } COUNTER_802_3, *PCOUNTER_802_3; typedef struct _COUNTER_802_11 { - ULONG Length; + unsigned long Length; LARGE_INTEGER LastTransmittedFragmentCount; LARGE_INTEGER TransmittedFragmentCount; LARGE_INTEGER MulticastTransmittedFrameCount; @@ -557,59 +557,59 @@ typedef struct _COUNTER_802_11 { } COUNTER_802_11, *PCOUNTER_802_11; typedef struct _COUNTER_RALINK { - ULONG TransmittedByteCount; /* both successful and failure, used to calculate TX throughput */ - ULONG ReceivedByteCount; /* both CRC okay and CRC error, used to calculate RX throughput */ - ULONG BeenDisassociatedCount; - ULONG BadCQIAutoRecoveryCount; - ULONG PoorCQIRoamingCount; - ULONG MgmtRingFullCount; - ULONG RxCountSinceLastNULL; - ULONG RxCount; - ULONG RxRingErrCount; - ULONG KickTxCount; - ULONG TxRingErrCount; + unsigned long TransmittedByteCount; /* both successful and failure, used to calculate TX throughput */ + unsigned long ReceivedByteCount; /* both CRC okay and CRC error, used to calculate RX throughput */ + unsigned long BeenDisassociatedCount; + unsigned long BadCQIAutoRecoveryCount; + unsigned long PoorCQIRoamingCount; + unsigned long MgmtRingFullCount; + unsigned long RxCountSinceLastNULL; + unsigned long RxCount; + unsigned long RxRingErrCount; + unsigned long KickTxCount; + unsigned long TxRingErrCount; LARGE_INTEGER RealFcsErrCount; - ULONG PendingNdisPacketCount; - - ULONG OneSecOsTxCount[NUM_OF_TX_RING]; - ULONG OneSecDmaDoneCount[NUM_OF_TX_RING]; - UINT32 OneSecTxDoneCount; - ULONG OneSecRxCount; - UINT32 OneSecTxAggregationCount; - UINT32 OneSecRxAggregationCount; - UINT32 OneSecReceivedByteCount; - UINT32 OneSecFrameDuplicateCount; - - UINT32 OneSecTransmittedByteCount; /* both successful and failure, used to calculate TX throughput */ - UINT32 OneSecTxNoRetryOkCount; - UINT32 OneSecTxRetryOkCount; - UINT32 OneSecTxFailCount; - UINT32 OneSecFalseCCACnt; /* CCA error count, for debug purpose, might move to global counter */ - UINT32 OneSecRxOkCnt; /* RX without error */ - UINT32 OneSecRxOkDataCnt; /* unicast-to-me DATA frame count */ - UINT32 OneSecRxFcsErrCnt; /* CRC error */ - UINT32 OneSecBeaconSentCnt; - UINT32 LastOneSecTotalTxCount; /* OneSecTxNoRetryOkCount + OneSecTxRetryOkCount + OneSecTxFailCount */ - UINT32 LastOneSecRxOkDataCnt; /* OneSecRxOkDataCnt */ - ULONG DuplicateRcv; - ULONG TxAggCount; - ULONG TxNonAggCount; - ULONG TxAgg1MPDUCount; - ULONG TxAgg2MPDUCount; - ULONG TxAgg3MPDUCount; - ULONG TxAgg4MPDUCount; - ULONG TxAgg5MPDUCount; - ULONG TxAgg6MPDUCount; - ULONG TxAgg7MPDUCount; - ULONG TxAgg8MPDUCount; - ULONG TxAgg9MPDUCount; - ULONG TxAgg10MPDUCount; - ULONG TxAgg11MPDUCount; - ULONG TxAgg12MPDUCount; - ULONG TxAgg13MPDUCount; - ULONG TxAgg14MPDUCount; - ULONG TxAgg15MPDUCount; - ULONG TxAgg16MPDUCount; + unsigned long PendingNdisPacketCount; + + unsigned long OneSecOsTxCount[NUM_OF_TX_RING]; + unsigned long OneSecDmaDoneCount[NUM_OF_TX_RING]; + u32 OneSecTxDoneCount; + unsigned long OneSecRxCount; + u32 OneSecTxAggregationCount; + u32 OneSecRxAggregationCount; + u32 OneSecReceivedByteCount; + u32 OneSecFrameDuplicateCount; + + u32 OneSecTransmittedByteCount; /* both successful and failure, used to calculate TX throughput */ + u32 OneSecTxNoRetryOkCount; + u32 OneSecTxRetryOkCount; + u32 OneSecTxFailCount; + u32 OneSecFalseCCACnt; /* CCA error count, for debug purpose, might move to global counter */ + u32 OneSecRxOkCnt; /* RX without error */ + u32 OneSecRxOkDataCnt; /* unicast-to-me DATA frame count */ + u32 OneSecRxFcsErrCnt; /* CRC error */ + u32 OneSecBeaconSentCnt; + u32 LastOneSecTotalTxCount; /* OneSecTxNoRetryOkCount + OneSecTxRetryOkCount + OneSecTxFailCount */ + u32 LastOneSecRxOkDataCnt; /* OneSecRxOkDataCnt */ + unsigned long DuplicateRcv; + unsigned long TxAggCount; + unsigned long TxNonAggCount; + unsigned long TxAgg1MPDUCount; + unsigned long TxAgg2MPDUCount; + unsigned long TxAgg3MPDUCount; + unsigned long TxAgg4MPDUCount; + unsigned long TxAgg5MPDUCount; + unsigned long TxAgg6MPDUCount; + unsigned long TxAgg7MPDUCount; + unsigned long TxAgg8MPDUCount; + unsigned long TxAgg9MPDUCount; + unsigned long TxAgg10MPDUCount; + unsigned long TxAgg11MPDUCount; + unsigned long TxAgg12MPDUCount; + unsigned long TxAgg13MPDUCount; + unsigned long TxAgg14MPDUCount; + unsigned long TxAgg15MPDUCount; + unsigned long TxAgg16MPDUCount; LARGE_INTEGER TransmittedOctetsInAMSDU; LARGE_INTEGER TransmittedAMSDUCount; @@ -623,37 +623,37 @@ typedef struct _COUNTER_RALINK { typedef struct _COUNTER_DRS { /* to record the each TX rate's quality. 0 is best, the bigger the worse. */ - USHORT TxQuality[MAX_STEP_OF_TX_RATE_SWITCH]; - UCHAR PER[MAX_STEP_OF_TX_RATE_SWITCH]; - UCHAR TxRateUpPenalty; /* extra # of second penalty due to last unstable condition */ - ULONG CurrTxRateStableTime; /* # of second in current TX rate */ + u16 TxQuality[MAX_STEP_OF_TX_RATE_SWITCH]; + u8 PER[MAX_STEP_OF_TX_RATE_SWITCH]; + u8 TxRateUpPenalty; /* extra # of second penalty due to last unstable condition */ + unsigned long CurrTxRateStableTime; /* # of second in current TX rate */ BOOLEAN fNoisyEnvironment; BOOLEAN fLastSecAccordingRSSI; - UCHAR LastSecTxRateChangeAction; /* 0: no change, 1:rate UP, 2:rate down */ - UCHAR LastTimeTxRateChangeAction; /*Keep last time value of LastSecTxRateChangeAction */ - ULONG LastTxOkCount; + u8 LastSecTxRateChangeAction; /* 0: no change, 1:rate UP, 2:rate down */ + u8 LastTimeTxRateChangeAction; /*Keep last time value of LastSecTxRateChangeAction */ + unsigned long LastTxOkCount; } COUNTER_DRS, *PCOUNTER_DRS; /*************************************************************************** * security key related data structure **************************************************************************/ typedef struct _CIPHER_KEY { - UCHAR Key[16]; /* right now we implement 4 keys, 128 bits max */ - UCHAR RxMic[8]; /* make alignment */ - UCHAR TxMic[8]; - UCHAR TxTsc[6]; /* 48bit TSC value */ - UCHAR RxTsc[6]; /* 48bit TSC value */ - UCHAR CipherAlg; /* 0-none, 1:WEP64, 2:WEP128, 3:TKIP, 4:AES, 5:CKIP64, 6:CKIP128 */ - UCHAR KeyLen; - UCHAR BssId[6]; + u8 Key[16]; /* right now we implement 4 keys, 128 bits max */ + u8 RxMic[8]; /* make alignment */ + u8 TxMic[8]; + u8 TxTsc[6]; /* 48bit TSC value */ + u8 RxTsc[6]; /* 48bit TSC value */ + u8 CipherAlg; /* 0-none, 1:WEP64, 2:WEP128, 3:TKIP, 4:AES, 5:CKIP64, 6:CKIP128 */ + u8 KeyLen; + u8 BssId[6]; /* Key length for each key, 0: entry is invalid */ - UCHAR Type; /* Indicate Pairwise/Group when reporting MIC error */ + u8 Type; /* Indicate Pairwise/Group when reporting MIC error */ } CIPHER_KEY, *PCIPHER_KEY; /* structure to define WPA Group Key Rekey Interval */ typedef struct PACKED _RT_802_11_WPA_REKEY { - ULONG ReKeyMethod; /* mechanism for rekeying: 0:disable, 1: time-based, 2: packet-based */ - ULONG ReKeyInterval; /* time-based: seconds, packet-based: kilo-packets */ + unsigned long ReKeyMethod; /* mechanism for rekeying: 0:disable, 1: time-based, 2: packet-based */ + unsigned long ReKeyInterval; /* time-based: seconds, packet-based: kilo-packets */ } RT_WPA_REKEY, *PRT_WPA_REKEY, RT_802_11_WPA_REKEY, *PRT_802_11_WPA_REKEY; #ifdef RTMP_MAC_USB @@ -661,22 +661,22 @@ typedef struct PACKED _RT_802_11_WPA_REKEY { * RTUSB I/O related data structure **************************************************************************/ typedef struct _RT_SET_ASIC_WCID { - ULONG WCID; /* mechanism for rekeying: 0:disable, 1: time-based, 2: packet-based */ - ULONG SetTid; /* time-based: seconds, packet-based: kilo-packets */ - ULONG DeleteTid; /* time-based: seconds, packet-based: kilo-packets */ - UCHAR Addr[MAC_ADDR_LEN]; /* avoid in interrupt when write key */ + unsigned long WCID; /* mechanism for rekeying: 0:disable, 1: time-based, 2: packet-based */ + unsigned long SetTid; /* time-based: seconds, packet-based: kilo-packets */ + unsigned long DeleteTid; /* time-based: seconds, packet-based: kilo-packets */ + u8 Addr[MAC_ADDR_LEN]; /* avoid in interrupt when write key */ } RT_SET_ASIC_WCID, *PRT_SET_ASIC_WCID; typedef struct _RT_SET_ASIC_WCID_ATTRI { - ULONG WCID; /* mechanism for rekeying: 0:disable, 1: time-based, 2: packet-based */ - ULONG Cipher; /* ASIC Cipher definition */ - UCHAR Addr[ETH_LENGTH_OF_ADDRESS]; + unsigned long WCID; /* mechanism for rekeying: 0:disable, 1: time-based, 2: packet-based */ + unsigned long Cipher; /* ASIC Cipher definition */ + u8 Addr[ETH_LENGTH_OF_ADDRESS]; } RT_SET_ASIC_WCID_ATTRI, *PRT_SET_ASIC_WCID_ATTRI; /* for USB interface, avoid in interrupt when write key */ typedef struct RT_ADD_PAIRWISE_KEY_ENTRY { - UCHAR MacAddr[6]; - USHORT MacTabMatchWCID; /* ASIC */ + u8 MacAddr[6]; + u16 MacTabMatchWCID; /* ASIC */ CIPHER_KEY CipherKey; } RT_ADD_PAIRWISE_KEY_ENTRY, *PRT_ADD_PAIRWISE_KEY_ENTRY; @@ -692,8 +692,8 @@ typedef enum _RT_802_11_CIPHER_SUITE_TYPE { #endif /* RTMP_MAC_USB // */ typedef struct { - UCHAR Addr[MAC_ADDR_LEN]; - UCHAR ErrorCode[2]; /*00 01-Invalid authentication type */ + u8 Addr[MAC_ADDR_LEN]; + u8 ErrorCode[2]; /*00 01-Invalid authentication type */ /*00 02-Authentication timeout */ /*00 03-Challenge from AP failed */ /*00 04-Challenge to AP failed */ @@ -701,7 +701,7 @@ typedef struct { } ROGUEAP_ENTRY, *PROGUEAP_ENTRY; typedef struct { - UCHAR RogueApNr; + u8 RogueApNr; ROGUEAP_ENTRY RogueApEntry[MAX_LEN_OF_BSS_TABLE]; } ROGUEAP_TABLE, *PROGUEAP_TABLE; @@ -709,19 +709,19 @@ typedef struct { /* Cisco IAPP format */ /* */ typedef struct _CISCO_IAPP_CONTENT_ { - USHORT Length; /*IAPP Length */ - UCHAR MessageType; /*IAPP type */ - UCHAR FunctionCode; /*IAPP function type */ - UCHAR DestinaionMAC[MAC_ADDR_LEN]; - UCHAR SourceMAC[MAC_ADDR_LEN]; - USHORT Tag; /*Tag(element IE) - Adjacent AP report */ - USHORT TagLength; /*Length of element not including 4 byte header */ - UCHAR OUI[4]; /*0x00, 0x40, 0x96, 0x00 */ - UCHAR PreviousAP[MAC_ADDR_LEN]; /*MAC Address of access point */ - USHORT Channel; - USHORT SsidLen; - UCHAR Ssid[MAX_LEN_OF_SSID]; - USHORT Seconds; /*Seconds that the client has been disassociated. */ + u16 Length; /*IAPP Length */ + u8 MessageType; /*IAPP type */ + u8 FunctionCode; /*IAPP function type */ + u8 DestinaionMAC[MAC_ADDR_LEN]; + u8 SourceMAC[MAC_ADDR_LEN]; + u16 Tag; /*Tag(element IE) - Adjacent AP report */ + u16 TagLength; /*Length of element not including 4 byte header */ + u8 OUI[4]; /*0x00, 0x40, 0x96, 0x00 */ + u8 PreviousAP[MAC_ADDR_LEN]; /*MAC Address of access point */ + u16 Channel; + u16 SsidLen; + u8 Ssid[MAX_LEN_OF_SSID]; + u16 Seconds; /*Seconds that the client has been disassociated. */ } CISCO_IAPP_CONTENT, *PCISCO_IAPP_CONTENT; /* @@ -729,19 +729,19 @@ typedef struct _CISCO_IAPP_CONTENT_ { */ typedef struct _FRAGMENT_FRAME { PNDIS_PACKET pFragPacket; - ULONG RxSize; - USHORT Sequence; - USHORT LastFrag; - ULONG Flags; /* Some extra frame information. bit 0: LLC presented */ + unsigned long RxSize; + u16 Sequence; + u16 LastFrag; + unsigned long Flags; /* Some extra frame information. bit 0: LLC presented */ } FRAGMENT_FRAME, *PFRAGMENT_FRAME; /* */ /* Packet information for NdisQueryPacket */ /* */ typedef struct _PACKET_INFO { - UINT PhysicalBufferCount; /* Physical breaks of buffer descripor chained */ - UINT BufferCount; /* Number of Buffer descriptor chained */ - UINT TotalPacketLength; /* Self explained */ + u32 PhysicalBufferCount; /* Physical breaks of buffer descripor chained */ + u32 BufferCount; /* Number of Buffer descriptor chained */ + u32 TotalPacketLength; /* Self explained */ PNDIS_BUFFER pFirstBuffer; /* Pointer to first buffer descriptor */ } PACKET_INFO, *PPACKET_INFO; @@ -749,36 +749,36 @@ typedef struct _PACKET_INFO { /* Arcfour Structure Added by PaulWu */ /* */ typedef struct _ARCFOUR { - UINT X; - UINT Y; - UCHAR STATE[256]; + u32 X; + u32 Y; + u8 STATE[256]; } ARCFOURCONTEXT, *PARCFOURCONTEXT; /* */ /* Tkip Key structure which RC4 key & MIC calculation */ /* */ typedef struct _TKIP_KEY_INFO { - UINT nBytesInM; /* # bytes in M for MICKEY */ - ULONG IV16; - ULONG IV32; - ULONG K0; /* for MICKEY Low */ - ULONG K1; /* for MICKEY Hig */ - ULONG L; /* Current state for MICKEY */ - ULONG R; /* Current state for MICKEY */ - ULONG M; /* Message accumulator for MICKEY */ - UCHAR RC4KEY[16]; - UCHAR MIC[8]; + u32 nBytesInM; /* # bytes in M for MICKEY */ + unsigned long IV16; + unsigned long IV32; + unsigned long K0; /* for MICKEY Low */ + unsigned long K1; /* for MICKEY Hig */ + unsigned long L; /* Current state for MICKEY */ + unsigned long R; /* Current state for MICKEY */ + unsigned long M; /* Message accumulator for MICKEY */ + u8 RC4KEY[16]; + u8 MIC[8]; } TKIP_KEY_INFO, *PTKIP_KEY_INFO; /* */ /* Private / Misc data, counters for driver internal use */ /* */ typedef struct __PRIVATE_STRUC { - UINT SystemResetCnt; /* System reset counter */ - UINT TxRingFullCnt; /* Tx ring full occurrance number */ - UINT PhyRxErrCnt; /* PHY Rx error count, for debug purpose, might move to global counter */ + u32 SystemResetCnt; /* System reset counter */ + u32 TxRingFullCnt; /* Tx ring full occurrance number */ + u32 PhyRxErrCnt; /* PHY Rx error count, for debug purpose, might move to global counter */ /* Variables for WEP encryption / decryption in rtmp_wep.c */ - UINT FCSCRC32; + u32 FCSCRC32; ARCFOURCONTEXT WEPCONTEXT; /* Tkip stuff */ TKIP_KEY_INFO Tx; @@ -791,44 +791,44 @@ typedef struct __PRIVATE_STRUC { /* structure to tune BBP R66 (BBP TUNING) */ typedef struct _BBP_R66_TUNING { BOOLEAN bEnable; - USHORT FalseCcaLowerThreshold; /* default 100 */ - USHORT FalseCcaUpperThreshold; /* default 512 */ - UCHAR R66Delta; - UCHAR R66CurrentValue; + u16 FalseCcaLowerThreshold; /* default 100 */ + u16 FalseCcaUpperThreshold; /* default 512 */ + u8 R66Delta; + u8 R66CurrentValue; BOOLEAN R66LowerUpperSelect; /*Before LinkUp, Used LowerBound or UpperBound as R66 value. */ } BBP_R66_TUNING, *PBBP_R66_TUNING; /* structure to store channel TX power */ typedef struct _CHANNEL_TX_POWER { - USHORT RemainingTimeForUse; /*unit: sec */ - UCHAR Channel; - CHAR Power; - CHAR Power2; - UCHAR MaxTxPwr; - UCHAR DfsReq; + u16 RemainingTimeForUse; /*unit: sec */ + u8 Channel; + char Power; + char Power2; + u8 MaxTxPwr; + u8 DfsReq; } CHANNEL_TX_POWER, *PCHANNEL_TX_POWER; /* structure to store 802.11j channel TX power */ typedef struct _CHANNEL_11J_TX_POWER { - UCHAR Channel; - UCHAR BW; /* BW_10 or BW_20 */ - CHAR Power; - CHAR Power2; - USHORT RemainingTimeForUse; /*unit: sec */ + u8 Channel; + u8 BW; /* BW_10 or BW_20 */ + char Power; + char Power2; + u16 RemainingTimeForUse; /*unit: sec */ } CHANNEL_11J_TX_POWER, *PCHANNEL_11J_TX_POWER; typedef struct _SOFT_RX_ANT_DIVERSITY_STRUCT { - UCHAR EvaluatePeriod; /* 0:not evalute status, 1: evaluate status, 2: switching status */ - UCHAR EvaluateStableCnt; - UCHAR Pair1PrimaryRxAnt; /* 0:Ant-E1, 1:Ant-E2 */ - UCHAR Pair1SecondaryRxAnt; /* 0:Ant-E1, 1:Ant-E2 */ - UCHAR Pair2PrimaryRxAnt; /* 0:Ant-E3, 1:Ant-E4 */ - UCHAR Pair2SecondaryRxAnt; /* 0:Ant-E3, 1:Ant-E4 */ - SHORT Pair1AvgRssi[2]; /* AvgRssi[0]:E1, AvgRssi[1]:E2 */ - SHORT Pair2AvgRssi[2]; /* AvgRssi[0]:E3, AvgRssi[1]:E4 */ - SHORT Pair1LastAvgRssi; /* */ - SHORT Pair2LastAvgRssi; /* */ - ULONG RcvPktNumWhenEvaluate; + u8 EvaluatePeriod; /* 0:not evalute status, 1: evaluate status, 2: switching status */ + u8 EvaluateStableCnt; + u8 Pair1PrimaryRxAnt; /* 0:Ant-E1, 1:Ant-E2 */ + u8 Pair1SecondaryRxAnt; /* 0:Ant-E1, 1:Ant-E2 */ + u8 Pair2PrimaryRxAnt; /* 0:Ant-E3, 1:Ant-E4 */ + u8 Pair2SecondaryRxAnt; /* 0:Ant-E3, 1:Ant-E4 */ + short Pair1AvgRssi[2]; /* AvgRssi[0]:E1, AvgRssi[1]:E2 */ + short Pair2AvgRssi[2]; /* AvgRssi[0]:E3, AvgRssi[1]:E4 */ + short Pair1LastAvgRssi; /* */ + short Pair2LastAvgRssi; /* */ + unsigned long RcvPktNumWhenEvaluate; BOOLEAN FirstPktArrivedWhenEvaluate; RALINK_TIMER_STRUCT RxAntDiversityTimer; } SOFT_RX_ANT_DIVERSITY, *PSOFT_RX_ANT_DIVERSITY; @@ -838,22 +838,22 @@ typedef struct _SOFT_RX_ANT_DIVERSITY_STRUCT { **************************************************************************/ typedef struct _RADAR_DETECT_STRUCT { /*BOOLEAN IEEE80211H; // 0: disable, 1: enable IEEE802.11h */ - UCHAR CSCount; /*Channel switch counter */ - UCHAR CSPeriod; /*Channel switch period (beacon count) */ - UCHAR RDCount; /*Radar detection counter */ - UCHAR RDMode; /*Radar Detection mode */ - UCHAR RDDurRegion; /*Radar detection duration region */ - UCHAR BBPR16; - UCHAR BBPR17; - UCHAR BBPR18; - UCHAR BBPR21; - UCHAR BBPR22; - UCHAR BBPR64; - ULONG InServiceMonitorCount; /* unit: sec */ - UINT8 DfsSessionTime; + u8 CSCount; /*Channel switch counter */ + u8 CSPeriod; /*Channel switch period (beacon count) */ + u8 RDCount; /*Radar detection counter */ + u8 RDMode; /*Radar Detection mode */ + u8 RDDurRegion; /*Radar detection duration region */ + u8 BBPR16; + u8 BBPR17; + u8 BBPR18; + u8 BBPR21; + u8 BBPR22; + u8 BBPR64; + unsigned long InServiceMonitorCount; /* unit: sec */ + u8 DfsSessionTime; BOOLEAN bFastDfs; - UINT8 ChMovingTime; - UINT8 LongPulseRadarTh; + u8 ChMovingTime; + u8 LongPulseRadarTh; } RADAR_DETECT_STRUCT, *PRADAR_DETECT_STRUCT; typedef enum _ABGBAND_STATE_ { @@ -866,14 +866,14 @@ typedef enum _ABGBAND_STATE_ { /* Power save method control */ typedef union _PS_CONTROL { struct { - ULONG EnablePSinIdle:1; /* Enable radio off when not connect to AP. radio on only when sitesurvey, */ - ULONG EnableNewPS:1; /* Enable new Chip power save fucntion . New method can only be applied in chip version after 2872. and PCIe. */ - ULONG rt30xxPowerMode:2; /* Power Level Mode for rt30xx chip */ - ULONG rt30xxFollowHostASPM:1; /* Card Follows Host's setting for rt30xx chip. */ - ULONG rt30xxForceASPMTest:1; /* Force enable L1 for rt30xx chip. This has higher priority than rt30xxFollowHostASPM Mode. */ - ULONG rsv:26; /* Radio Measurement Enable */ + unsigned long EnablePSinIdle:1; /* Enable radio off when not connect to AP. radio on only when sitesurvey, */ + unsigned long EnableNewPS:1; /* Enable new Chip power save fucntion . New method can only be applied in chip version after 2872. and PCIe. */ + unsigned long rt30xxPowerMode:2; /* Power Level Mode for rt30xx chip */ + unsigned long rt30xxFollowHostASPM:1; /* Card Follows Host's setting for rt30xx chip. */ + unsigned long rt30xxForceASPMTest:1; /* Force enable L1 for rt30xx chip. This has higher priority than rt30xxFollowHostASPM Mode. */ + unsigned long rsv:26; /* Radio Measurement Enable */ } field; - ULONG word; + unsigned long word; } PS_CONTROL, *PPS_CONTROL; #endif /* RTMP_MAC_PCI // */ @@ -901,36 +901,36 @@ typedef struct _MLME_STRUCT { STATE_MACHINE WpaMachine; STATE_MACHINE_FUNC WpaFunc[WPA_FUNC_SIZE]; - ULONG ChannelQuality; /* 0..100, Channel Quality Indication for Roaming */ - ULONG Now32; /* latch the value of NdisGetSystemUpTime() */ - ULONG LastSendNULLpsmTime; + unsigned long ChannelQuality; /* 0..100, Channel Quality Indication for Roaming */ + unsigned long Now32; /* latch the value of NdisGetSystemUpTime() */ + unsigned long LastSendNULLpsmTime; BOOLEAN bRunning; NDIS_SPIN_LOCK TaskLock; MLME_QUEUE Queue; - UINT ShiftReg; + u32 ShiftReg; RALINK_TIMER_STRUCT PeriodicTimer; RALINK_TIMER_STRUCT APSDPeriodicTimer; RALINK_TIMER_STRUCT LinkDownTimer; RALINK_TIMER_STRUCT LinkUpTimer; #ifdef RTMP_MAC_PCI - UCHAR bPsPollTimerRunning; + u8 bPsPollTimerRunning; RALINK_TIMER_STRUCT PsPollTimer; RALINK_TIMER_STRUCT RadioOnOffTimer; #endif /* RTMP_MAC_PCI // */ - ULONG PeriodicRound; - ULONG OneSecPeriodicRound; + unsigned long PeriodicRound; + unsigned long OneSecPeriodicRound; - UCHAR RealRxPath; + u8 RealRxPath; BOOLEAN bLowThroughput; BOOLEAN bEnableAutoAntennaCheck; RALINK_TIMER_STRUCT RxAntEvalTimer; #ifdef RT30xx - UCHAR CaliBW40RfR24; - UCHAR CaliBW20RfR24; + u8 CaliBW40RfR24; + u8 CaliBW20RfR24; #endif /* RT30xx // */ #ifdef RTMP_MAC_USB @@ -955,7 +955,7 @@ struct reordering_list { }; struct reordering_mpdu_pool { - PVOID mem; + void *mem; NDIS_SPIN_LOCK lock; struct reordering_list freelist; }; @@ -975,97 +975,97 @@ typedef enum _ORI_BLOCKACK_STATUS { } ORI_BLOCKACK_STATUS, *PORI_BLOCKACK_STATUS; typedef struct _BA_ORI_ENTRY { - UCHAR Wcid; - UCHAR TID; - UCHAR BAWinSize; - UCHAR Token; + u8 Wcid; + u8 TID; + u8 BAWinSize; + u8 Token; /* Sequence is to fill every outgoing QoS DATA frame's sequence field in 802.11 header. */ - USHORT Sequence; - USHORT TimeOutValue; + u16 Sequence; + u16 TimeOutValue; ORI_BLOCKACK_STATUS ORI_BA_Status; RALINK_TIMER_STRUCT ORIBATimer; - PVOID pAdapter; + void *pAdapter; } BA_ORI_ENTRY, *PBA_ORI_ENTRY; typedef struct _BA_REC_ENTRY { - UCHAR Wcid; - UCHAR TID; - UCHAR BAWinSize; /* 7.3.1.14. each buffer is capable of holding a max AMSDU or MSDU. */ - /*UCHAR NumOfRxPkt; */ - /*UCHAR Curindidx; // the head in the RX reordering buffer */ - USHORT LastIndSeq; -/* USHORT LastIndSeqAtTimer; */ - USHORT TimeOutValue; + u8 Wcid; + u8 TID; + u8 BAWinSize; /* 7.3.1.14. each buffer is capable of holding a max AMSDU or MSDU. */ + /*u8 NumOfRxPkt; */ + /*u8 Curindidx; // the head in the RX reordering buffer */ + u16 LastIndSeq; +/* u16 LastIndSeqAtTimer; */ + u16 TimeOutValue; RALINK_TIMER_STRUCT RECBATimer; - ULONG LastIndSeqAtTimer; - ULONG nDropPacket; - ULONG rcvSeq; + unsigned long LastIndSeqAtTimer; + unsigned long nDropPacket; + unsigned long rcvSeq; REC_BLOCKACK_STATUS REC_BA_Status; -/* UCHAR RxBufIdxUsed; */ +/* u8 RxBufIdxUsed; */ /* corresponding virtual address for RX reordering packet storage. */ /*RTMP_REORDERDMABUF MAP_RXBuf[MAX_RX_REORDERBUF]; */ NDIS_SPIN_LOCK RxReRingLock; /* Rx Ring spinlock */ /* struct _BA_REC_ENTRY *pNext; */ - PVOID pAdapter; + void *pAdapter; struct reordering_list list; } BA_REC_ENTRY, *PBA_REC_ENTRY; typedef struct { - ULONG numAsRecipient; /* I am recipient of numAsRecipient clients. These client are in the BARecEntry[] */ - ULONG numAsOriginator; /* I am originator of numAsOriginator clients. These clients are in the BAOriEntry[] */ - ULONG numDoneOriginator; /* count Done Originator sessions */ + unsigned long numAsRecipient; /* I am recipient of numAsRecipient clients. These client are in the BARecEntry[] */ + unsigned long numAsOriginator; /* I am originator of numAsOriginator clients. These clients are in the BAOriEntry[] */ + unsigned long numDoneOriginator; /* count Done Originator sessions */ BA_ORI_ENTRY BAOriEntry[MAX_LEN_OF_BA_ORI_TABLE]; BA_REC_ENTRY BARecEntry[MAX_LEN_OF_BA_REC_TABLE]; } BA_TABLE, *PBA_TABLE; /*For QureyBATableOID use; */ typedef struct PACKED _OID_BA_REC_ENTRY { - UCHAR MACAddr[MAC_ADDR_LEN]; - UCHAR BaBitmap; /* if (BaBitmap&(1<<TID)), this session with{MACAddr, TID}exists, so read BufSize[TID] for BufferSize */ - UCHAR rsv; - UCHAR BufSize[8]; + u8 MACAddr[MAC_ADDR_LEN]; + u8 BaBitmap; /* if (BaBitmap&(1<<TID)), this session with{MACAddr, TID}exists, so read BufSize[TID] for BufferSize */ + u8 rsv; + u8 BufSize[8]; REC_BLOCKACK_STATUS REC_BA_Status[8]; } OID_BA_REC_ENTRY, *POID_BA_REC_ENTRY; /*For QureyBATableOID use; */ typedef struct PACKED _OID_BA_ORI_ENTRY { - UCHAR MACAddr[MAC_ADDR_LEN]; - UCHAR BaBitmap; /* if (BaBitmap&(1<<TID)), this session with{MACAddr, TID}exists, so read BufSize[TID] for BufferSize, read ORI_BA_Status[TID] for status */ - UCHAR rsv; - UCHAR BufSize[8]; + u8 MACAddr[MAC_ADDR_LEN]; + u8 BaBitmap; /* if (BaBitmap&(1<<TID)), this session with{MACAddr, TID}exists, so read BufSize[TID] for BufferSize, read ORI_BA_Status[TID] for status */ + u8 rsv; + u8 BufSize[8]; ORI_BLOCKACK_STATUS ORI_BA_Status[8]; } OID_BA_ORI_ENTRY, *POID_BA_ORI_ENTRY; typedef struct _QUERYBA_TABLE { OID_BA_ORI_ENTRY BAOriEntry[32]; OID_BA_REC_ENTRY BARecEntry[32]; - UCHAR OriNum; /* Number of below BAOriEntry */ - UCHAR RecNum; /* Number of below BARecEntry */ + u8 OriNum; /* Number of below BAOriEntry */ + u8 RecNum; /* Number of below BARecEntry */ } QUERYBA_TABLE, *PQUERYBA_TABLE; typedef union _BACAP_STRUC { struct { - UINT32 RxBAWinLimit:8; - UINT32 TxBAWinLimit:8; - UINT32 AutoBA:1; /* automatically BA */ - UINT32 Policy:2; /* 0: DELAY_BA 1:IMMED_BA (//BA Policy subfiled value in ADDBA frame) 2:BA-not use */ - UINT32 MpduDensity:3; - UINT32 AmsduEnable:1; /*Enable AMSDU transmisstion */ - UINT32 AmsduSize:1; /* 0:3839, 1:7935 bytes. UINT MSDUSizeToBytes[] = { 3839, 7935}; */ - UINT32 MMPSmode:2; /* MIMO power save more, 0:static, 1:dynamic, 2:rsv, 3:mimo enable */ - UINT32 bHtAdhoc:1; /* adhoc can use ht rate. */ - UINT32 b2040CoexistScanSup:1; /*As Sta, support do 2040 coexistence scan for AP. As Ap, support monitor trigger event to check if can use BW 40MHz. */ - UINT32:4; + u32 RxBAWinLimit:8; + u32 TxBAWinLimit:8; + u32 AutoBA:1; /* automatically BA */ + u32 Policy:2; /* 0: DELAY_BA 1:IMMED_BA (//BA Policy subfiled value in ADDBA frame) 2:BA-not use */ + u32 MpduDensity:3; + u32 AmsduEnable:1; /*Enable AMSDU transmisstion */ + u32 AmsduSize:1; /* 0:3839, 1:7935 bytes. u32 MSDUSizeToBytes[] = { 3839, 7935}; */ + u32 MMPSmode:2; /* MIMO power save more, 0:static, 1:dynamic, 2:rsv, 3:mimo enable */ + u32 bHtAdhoc:1; /* adhoc can use ht rate. */ + u32 b2040CoexistScanSup:1; /*As Sta, support do 2040 coexistence scan for AP. As Ap, support monitor trigger event to check if can use BW 40MHz. */ + u32 : 4; } field; - UINT32 word; + u32 word; } BACAP_STRUC, *PBACAP_STRUC; typedef struct { BOOLEAN IsRecipient; - UCHAR MACAddr[MAC_ADDR_LEN]; - UCHAR TID; - UCHAR nMSDU; - USHORT TimeOut; + u8 MACAddr[MAC_ADDR_LEN]; + u8 TID; + u8 nMSDU; + u16 TimeOut; BOOLEAN bAllTid; /* If True, delete all TID for BA sessions with this MACaddr. */ } OID_ADD_BA_ENTRY, *POID_ADD_BA_ENTRY; @@ -1080,16 +1080,16 @@ typedef struct { /*This structure is for all 802.11n card InterOptibilityTest action. Reset all Num every n second. (Details see MLMEPeriodic) */ typedef struct _IOT_STRUC { - UCHAR Threshold[2]; - UCHAR ReorderTimeOutNum[MAX_LEN_OF_BA_REC_TABLE]; /* compare with threshold[0] */ - UCHAR RefreshNum[MAX_LEN_OF_BA_REC_TABLE]; /* compare with threshold[1] */ - ULONG OneSecInWindowCount; - ULONG OneSecFrameDuplicateCount; - ULONG OneSecOutWindowCount; - UCHAR DelOriAct; - UCHAR DelRecAct; - UCHAR RTSShortProt; - UCHAR RTSLongProt; + u8 Threshold[2]; + u8 ReorderTimeOutNum[MAX_LEN_OF_BA_REC_TABLE]; /* compare with threshold[0] */ + u8 RefreshNum[MAX_LEN_OF_BA_REC_TABLE]; /* compare with threshold[1] */ + unsigned long OneSecInWindowCount; + unsigned long OneSecFrameDuplicateCount; + unsigned long OneSecOutWindowCount; + u8 DelOriAct; + u8 DelRecAct; + u8 RTSShortProt; + u8 RTSLongProt; BOOLEAN bRTSLongProtOn; BOOLEAN bLastAtheros; BOOLEAN bCurrentAtheros; @@ -1101,29 +1101,29 @@ typedef struct _IOT_STRUC { /* This is the registry setting for 802.11n transmit setting. Used in advanced page. */ typedef union _REG_TRANSMIT_SETTING { struct { - /*UINT32 PhyMode:4; */ - /*UINT32 MCS:7; // MCS */ - UINT32 rsv0:10; - UINT32 TxBF:1; - UINT32 BW:1; /*channel bandwidth 20MHz or 40 MHz */ - UINT32 ShortGI:1; - UINT32 STBC:1; /*SPACE */ - UINT32 TRANSNO:2; - UINT32 HTMODE:1; - UINT32 EXTCHA:2; - UINT32 rsv:13; + /*u32 PhyMode:4; */ + /*u32 MCS:7; // MCS */ + u32 rsv0:10; + u32 TxBF:1; + u32 BW:1; /*channel bandwidth 20MHz or 40 MHz */ + u32 ShortGI:1; + u32 STBC:1; /*SPACE */ + u32 TRANSNO:2; + u32 HTMODE:1; + u32 EXTCHA:2; + u32 rsv:13; } field; - UINT32 word; + u32 word; } REG_TRANSMIT_SETTING, *PREG_TRANSMIT_SETTING; typedef union _DESIRED_TRANSMIT_SETTING { struct { - USHORT MCS:7; /* MCS */ - USHORT PhyMode:4; - USHORT FixedTxMode:2; /* If MCS isn't AUTO, fix rate in CCK, OFDM or HT mode. */ - USHORT rsv:3; + u16 MCS:7; /* MCS */ + u16 PhyMode:4; + u16 FixedTxMode:2; /* If MCS isn't AUTO, fix rate in CCK, OFDM or HT mode. */ + u16 rsv:3; } field; - USHORT word; + u16 word; } DESIRED_TRANSMIT_SETTING, *PDESIRED_TRANSMIT_SETTING; #ifdef RTMP_MAC_USB @@ -1132,13 +1132,13 @@ typedef union _DESIRED_TRANSMIT_SETTING { **************************************************************************/ #define BEACON_BITMAP_MASK 0xff typedef struct _BEACON_SYNC_STRUCT_ { - UCHAR BeaconBuf[HW_BEACON_MAX_COUNT][HW_BEACON_OFFSET]; - UCHAR BeaconTxWI[HW_BEACON_MAX_COUNT][TXWI_SIZE]; - ULONG TimIELocationInBeacon[HW_BEACON_MAX_COUNT]; - ULONG CapabilityInfoLocationInBeacon[HW_BEACON_MAX_COUNT]; + u8 BeaconBuf[HW_BEACON_MAX_COUNT][HW_BEACON_OFFSET]; + u8 BeaconTxWI[HW_BEACON_MAX_COUNT][TXWI_SIZE]; + unsigned long TimIELocationInBeacon[HW_BEACON_MAX_COUNT]; + unsigned long CapabilityInfoLocationInBeacon[HW_BEACON_MAX_COUNT]; BOOLEAN EnableBeacon; /* trigger to enable beacon transmission. */ - UCHAR BeaconBitMap; /* NOTE: If the MAX_MBSSID_NUM is larger than 8, this parameter need to change. */ - UCHAR DtimBitOn; /* NOTE: If the MAX_MBSSID_NUM is larger than 8, this parameter need to change. */ + u8 BeaconBitMap; /* NOTE: If the MAX_MBSSID_NUM is larger than 8, this parameter need to change. */ + u8 DtimBitOn; /* NOTE: If the MAX_MBSSID_NUM is larger than 8, this parameter need to change. */ } BEACON_SYNC_STRUCT; #endif /* RTMP_MAC_USB // */ @@ -1158,49 +1158,49 @@ typedef struct _BEACON_SYNC_STRUCT_ { /* clear a station PS TIM bit */ #define WLAN_MR_TIM_BIT_CLEAR(ad_p, apidx, wcid) \ - { UCHAR tim_offset = wcid >> 3; \ - UCHAR bit_offset = wcid & 0x7; \ + { u8 tim_offset = wcid >> 3; \ + u8 bit_offset = wcid & 0x7; \ ad_p->ApCfg.MBSSID[apidx].TimBitmaps[tim_offset] &= (~BIT8[bit_offset]); } /* set a station PS TIM bit */ #define WLAN_MR_TIM_BIT_SET(ad_p, apidx, wcid) \ - { UCHAR tim_offset = wcid >> 3; \ - UCHAR bit_offset = wcid & 0x7; \ + { u8 tim_offset = wcid >> 3; \ + u8 bit_offset = wcid & 0x7; \ ad_p->ApCfg.MBSSID[apidx].TimBitmaps[tim_offset] |= BIT8[bit_offset]; } /* configuration common to OPMODE_AP as well as OPMODE_STA */ typedef struct _COMMON_CONFIG { BOOLEAN bCountryFlag; - UCHAR CountryCode[3]; - UCHAR Geography; - UCHAR CountryRegion; /* Enum of country region, 0:FCC, 1:IC, 2:ETSI, 3:SPAIN, 4:France, 5:MKK, 6:MKK1, 7:Israel */ - UCHAR CountryRegionForABand; /* Enum of country region for A band */ - UCHAR PhyMode; /* PHY_11A, PHY_11B, PHY_11BG_MIXED, PHY_ABG_MIXED */ - USHORT Dsifs; /* in units of usec */ - ULONG PacketFilter; /* Packet filter for receiving */ - UINT8 RegulatoryClass; - - CHAR Ssid[MAX_LEN_OF_SSID]; /* NOT NULL-terminated */ - UCHAR SsidLen; /* the actual ssid length in used */ - UCHAR LastSsidLen; /* the actual ssid length in used */ - CHAR LastSsid[MAX_LEN_OF_SSID]; /* NOT NULL-terminated */ - UCHAR LastBssid[MAC_ADDR_LEN]; - - UCHAR Bssid[MAC_ADDR_LEN]; - USHORT BeaconPeriod; - UCHAR Channel; - UCHAR CentralChannel; /* Central Channel when using 40MHz is indicating. not real channel. */ - - UCHAR SupRate[MAX_LEN_OF_SUPPORTED_RATES]; - UCHAR SupRateLen; - UCHAR ExtRate[MAX_LEN_OF_SUPPORTED_RATES]; - UCHAR ExtRateLen; - UCHAR DesireRate[MAX_LEN_OF_SUPPORTED_RATES]; /* OID_802_11_DESIRED_RATES */ - UCHAR MaxDesiredRate; - UCHAR ExpectedACKRate[MAX_LEN_OF_SUPPORTED_RATES]; - - ULONG BasicRateBitmap; /* backup basic ratebitmap */ + u8 CountryCode[3]; + u8 Geography; + u8 CountryRegion; /* Enum of country region, 0:FCC, 1:IC, 2:ETSI, 3:SPAIN, 4:France, 5:MKK, 6:MKK1, 7:Israel */ + u8 CountryRegionForABand; /* Enum of country region for A band */ + u8 PhyMode; /* PHY_11A, PHY_11B, PHY_11BG_MIXED, PHY_ABG_MIXED */ + u16 Dsifs; /* in units of usec */ + unsigned long PacketFilter; /* Packet filter for receiving */ + u8 RegulatoryClass; + + char Ssid[MAX_LEN_OF_SSID]; /* NOT NULL-terminated */ + u8 SsidLen; /* the actual ssid length in used */ + u8 LastSsidLen; /* the actual ssid length in used */ + char LastSsid[MAX_LEN_OF_SSID]; /* NOT NULL-terminated */ + u8 LastBssid[MAC_ADDR_LEN]; + + u8 Bssid[MAC_ADDR_LEN]; + u16 BeaconPeriod; + u8 Channel; + u8 CentralChannel; /* Central Channel when using 40MHz is indicating. not real channel. */ + + u8 SupRate[MAX_LEN_OF_SUPPORTED_RATES]; + u8 SupRateLen; + u8 ExtRate[MAX_LEN_OF_SUPPORTED_RATES]; + u8 ExtRateLen; + u8 DesireRate[MAX_LEN_OF_SUPPORTED_RATES]; /* OID_802_11_DESIRED_RATES */ + u8 MaxDesiredRate; + u8 ExpectedACKRate[MAX_LEN_OF_SUPPORTED_RATES]; + + unsigned long BasicRateBitmap; /* backup basic ratebitmap */ BOOLEAN bAPSDCapable; BOOLEAN bInServicePeriod; @@ -1217,45 +1217,45 @@ typedef struct _COMMON_CONFIG { BOOLEAN bNeedSendTriggerFrame; BOOLEAN bAPSDForcePowerSave; /* Force power save mode, should only use in APSD-STAUT */ - ULONG TriggerTimerCount; - UCHAR MaxSPLength; - UCHAR BBPCurrentBW; /* BW_10, BW_20, BW_40 */ + unsigned long TriggerTimerCount; + u8 MaxSPLength; + u8 BBPCurrentBW; /* BW_10, BW_20, BW_40 */ /* move to MULTISSID_STRUCT for MBSS */ /*HTTRANSMIT_SETTING HTPhyMode, MaxHTPhyMode, MinHTPhyMode;// For transmit phy setting in TXWI. */ REG_TRANSMIT_SETTING RegTransmitSetting; /*registry transmit setting. this is for reading registry setting only. not useful. */ - /*UCHAR FixedTxMode; // Fixed Tx Mode (CCK, OFDM), for HT fixed tx mode (GF, MIX) , refer to RegTransmitSetting.field.HTMode */ - UCHAR TxRate; /* Same value to fill in TXD. TxRate is 6-bit */ - UCHAR MaxTxRate; /* RATE_1, RATE_2, RATE_5_5, RATE_11 */ - UCHAR TxRateIndex; /* Tx rate index in RateSwitchTable */ - UCHAR TxRateTableSize; /* Valid Tx rate table size in RateSwitchTable */ + /*u8 FixedTxMode; // Fixed Tx Mode (CCK, OFDM), for HT fixed tx mode (GF, MIX) , refer to RegTransmitSetting.field.HTMode */ + u8 TxRate; /* Same value to fill in TXD. TxRate is 6-bit */ + u8 MaxTxRate; /* RATE_1, RATE_2, RATE_5_5, RATE_11 */ + u8 TxRateIndex; /* Tx rate index in RateSwitchTable */ + u8 TxRateTableSize; /* Valid Tx rate table size in RateSwitchTable */ /*BOOLEAN bAutoTxRateSwitch; */ - UCHAR MinTxRate; /* RATE_1, RATE_2, RATE_5_5, RATE_11 */ - UCHAR RtsRate; /* RATE_xxx */ + u8 MinTxRate; /* RATE_1, RATE_2, RATE_5_5, RATE_11 */ + u8 RtsRate; /* RATE_xxx */ HTTRANSMIT_SETTING MlmeTransmit; /* MGMT frame PHY rate setting when operatin at Ht rate. */ - UCHAR MlmeRate; /* RATE_xxx, used to send MLME frames */ - UCHAR BasicMlmeRate; /* Default Rate for sending MLME frames */ + u8 MlmeRate; /* RATE_xxx, used to send MLME frames */ + u8 BasicMlmeRate; /* Default Rate for sending MLME frames */ - USHORT RtsThreshold; /* in unit of BYTE */ - USHORT FragmentThreshold; /* in unit of BYTE */ + u16 RtsThreshold; /* in unit of BYTE */ + u16 FragmentThreshold; /* in unit of BYTE */ - UCHAR TxPower; /* in unit of mW */ - ULONG TxPowerPercentage; /* 0~100 % */ - ULONG TxPowerDefault; /* keep for TxPowerPercentage */ - UINT8 PwrConstraint; + u8 TxPower; /* in unit of mW */ + unsigned long TxPowerPercentage; /* 0~100 % */ + unsigned long TxPowerDefault; /* keep for TxPowerPercentage */ + u8 PwrConstraint; BACAP_STRUC BACapability; /* NO USE = 0XFF ; IMMED_BA =1 ; DELAY_BA=0 */ BACAP_STRUC REGBACapability; /* NO USE = 0XFF ; IMMED_BA =1 ; DELAY_BA=0 */ IOT_STRUC IOTestParm; /* 802.11n InterOpbility Test Parameter; */ - ULONG TxPreamble; /* Rt802_11PreambleLong, Rt802_11PreambleShort, Rt802_11PreambleAuto */ + unsigned long TxPreamble; /* Rt802_11PreambleLong, Rt802_11PreambleShort, Rt802_11PreambleAuto */ BOOLEAN bUseZeroToDisableFragment; /* Microsoft use 0 as disable */ - ULONG UseBGProtection; /* 0: auto, 1: always use, 2: always not use */ + unsigned long UseBGProtection; /* 0: auto, 1: always use, 2: always not use */ BOOLEAN bUseShortSlotTime; /* 0: disable, 1 - use short slot (9us) */ BOOLEAN bEnableTxBurst; /* 1: enble TX PACKET BURST (when BA is established or AP is not a legacy WMM AP), 0: disable TX PACKET BURST */ BOOLEAN bAggregationCapable; /* 1: enable TX aggregation when the peer supports it */ BOOLEAN bPiggyBackCapable; /* 1: enable TX piggy-back according MAC's version */ BOOLEAN bIEEE80211H; /* 1: enable IEEE802.11h spec. */ - ULONG DisableOLBCDetect; /* 0: enable OLBC detect; 1 disable OLBC detect */ + unsigned long DisableOLBCDetect; /* 0: enable OLBC detect; 1 disable OLBC detect */ BOOLEAN bRdg; @@ -1263,13 +1263,13 @@ typedef struct _COMMON_CONFIG { QOS_CAPABILITY_PARM APQosCapability; /* QOS capability of the current associated AP */ EDCA_PARM APEdcaParm; /* EDCA parameters of the current associated AP */ QBSS_LOAD_PARM APQbssLoad; /* QBSS load of the current associated AP */ - UCHAR AckPolicy[4]; /* ACK policy of the specified AC. see ACK_xxx */ + u8 AckPolicy[4]; /* ACK policy of the specified AC. see ACK_xxx */ BOOLEAN bDLSCapable; /* 0:disable DLS, 1:enable DLS */ /* a bitmap of BOOLEAN flags. each bit represent an operation status of a particular */ /* BOOLEAN control, either ON or OFF. These flags should always be accessed via */ /* OPSTATUS_TEST_FLAG(), OPSTATUS_SET_FLAG(), OP_STATUS_CLEAR_FLAG() macros. */ /* see fOP_STATUS_xxx in RTMP_DEF.C for detail bit definition */ - ULONG OpStatusFlags; + unsigned long OpStatusFlags; BOOLEAN NdisRadioStateOff; /*For HCT 12.0, set this flag to TRUE instead of called MlmeRadioOff. */ ABGBAND_STATE BandState; /* For setting BBP used on B/G or A mode. */ @@ -1278,7 +1278,7 @@ typedef struct _COMMON_CONFIG { RADAR_DETECT_STRUCT RadarDetect; /* HT */ - UCHAR BASize; /* USer desired BAWindowSize. Should not exceed our max capability */ + u8 BASize; /* USer desired BAWindowSize. Should not exceed our max capability */ /*RT_HT_CAPABILITY SupportedHtPhy; */ RT_HT_CAPABILITY DesiredHtPhy; HT_CAPABILITY_IE HtCapability; @@ -1297,34 +1297,34 @@ typedef struct _COMMON_CONFIG { BOOLEAN bForty_Mhz_Intolerant; BOOLEAN bExtChannelSwitchAnnouncement; BOOLEAN bRcvBSSWidthTriggerEvents; - ULONG LastRcvBSSWidthTriggerEventsTime; + unsigned long LastRcvBSSWidthTriggerEventsTime; - UCHAR TxBASize; + u8 TxBASize; /* Enable wireless event */ BOOLEAN bWirelessEvent; BOOLEAN bWiFiTest; /* Enable this parameter for WiFi test */ /* Tx & Rx Stream number selection */ - UCHAR TxStream; - UCHAR RxStream; + u8 TxStream; + u8 RxStream; BOOLEAN bHardwareRadio; /* Hardware controlled Radio enabled */ #ifdef RTMP_MAC_USB BOOLEAN bMultipleIRP; /* Multiple Bulk IN flag */ - UCHAR NumOfBulkInIRP; /* if bMultipleIRP == TRUE, NumOfBulkInIRP will be 4 otherwise be 1 */ + u8 NumOfBulkInIRP; /* if bMultipleIRP == TRUE, NumOfBulkInIRP will be 4 otherwise be 1 */ RT_HT_CAPABILITY SupportedHtPhy; - ULONG MaxPktOneTxBulk; - UCHAR TxBulkFactor; - UCHAR RxBulkFactor; + unsigned long MaxPktOneTxBulk; + u8 TxBulkFactor; + u8 RxBulkFactor; BOOLEAN IsUpdateBeacon; BEACON_SYNC_STRUCT *pBeaconSync; RALINK_TIMER_STRUCT BeaconUpdateTimer; - UINT32 BeaconAdjust; - UINT32 BeaconFactor; - UINT32 BeaconRemain; + u32 BeaconAdjust; + u32 BeaconFactor; + u32 BeaconRemain; #endif /* RTMP_MAC_USB // */ NDIS_SPIN_LOCK MeasureReqTabLock; @@ -1337,7 +1337,7 @@ typedef struct _COMMON_CONFIG { #if defined(RT305x)||defined(RT30xx) /* request by Gary, for High Power issue */ - UCHAR HighPowerPatchDisabled; + u8 HighPowerPatchDisabled; #endif BOOLEAN HT_DisallowTKIP; /* Restrict the encryption type in 11n HT mode */ @@ -1352,31 +1352,31 @@ typedef struct _STA_ADMIN_CONFIG { /* settings in ACTIVE BSS after negotiation/compromize with the BSS holder (either */ /* AP or IBSS holder). */ /* Once initialized, user configuration can only be changed via OID_xxx */ - UCHAR BssType; /* BSS_INFRA or BSS_ADHOC */ - USHORT AtimWin; /* used when starting a new IBSS */ + u8 BssType; /* BSS_INFRA or BSS_ADHOC */ + u16 AtimWin; /* used when starting a new IBSS */ /* GROUP 2 - */ /* User configuration loaded from Registry, E2PROM or OID_xxx. These settings describe */ /* the user intended configuration, and should be always applied to the final */ /* settings in ACTIVE BSS without compromising with the BSS holder. */ /* Once initialized, user configuration can only be changed via OID_xxx */ - UCHAR RssiTrigger; - UCHAR RssiTriggerMode; /* RSSI_TRIGGERED_UPON_BELOW_THRESHOLD or RSSI_TRIGGERED_UPON_EXCCEED_THRESHOLD */ - USHORT DefaultListenCount; /* default listen count; */ - ULONG WindowsPowerMode; /* Power mode for AC power */ - ULONG WindowsBatteryPowerMode; /* Power mode for battery if exists */ + u8 RssiTrigger; + u8 RssiTriggerMode; /* RSSI_TRIGGERED_UPON_BELOW_THRESHOLD or RSSI_TRIGGERED_UPON_EXCCEED_THRESHOLD */ + u16 DefaultListenCount; /* default listen count; */ + unsigned long WindowsPowerMode; /* Power mode for AC power */ + unsigned long WindowsBatteryPowerMode; /* Power mode for battery if exists */ BOOLEAN bWindowsACCAMEnable; /* Enable CAM power mode when AC on */ BOOLEAN bAutoReconnect; /* Set to TRUE when setting OID_802_11_SSID with no matching BSSID */ - ULONG WindowsPowerProfile; /* Windows power profile, for NDIS5.1 PnP */ + unsigned long WindowsPowerProfile; /* Windows power profile, for NDIS5.1 PnP */ /* MIB:ieee802dot11.dot11smt(1).dot11StationConfigTable(1) */ - USHORT Psm; /* power management mode (PWR_ACTIVE|PWR_SAVE) */ - USHORT DisassocReason; - UCHAR DisassocSta[MAC_ADDR_LEN]; - USHORT DeauthReason; - UCHAR DeauthSta[MAC_ADDR_LEN]; - USHORT AuthFailReason; - UCHAR AuthFailSta[MAC_ADDR_LEN]; + u16 Psm; /* power management mode (PWR_ACTIVE|PWR_SAVE) */ + u16 DisassocReason; + u8 DisassocSta[MAC_ADDR_LEN]; + u16 DeauthReason; + u8 DeauthSta[MAC_ADDR_LEN]; + u16 AuthFailReason; + u8 AuthFailSta[MAC_ADDR_LEN]; NDIS_802_11_PRIVACY_FILTER PrivacyFilter; /* PrivacyFilter enum for 802.1X */ NDIS_802_11_AUTHENTICATION_MODE AuthMode; /* This should match to whatever microsoft defined */ @@ -1387,45 +1387,45 @@ typedef struct _STA_ADMIN_CONFIG { NDIS_802_11_ENCRYPTION_STATUS GroupCipher; /* Multicast cipher suite */ NDIS_802_11_ENCRYPTION_STATUS PairCipher; /* Unicast cipher suite */ BOOLEAN bMixCipher; /* Indicate current Pair & Group use different cipher suites */ - USHORT RsnCapability; + u16 RsnCapability; NDIS_802_11_WEP_STATUS GroupKeyWepStatus; - UCHAR WpaPassPhrase[64]; /* WPA PSK pass phrase */ - UINT WpaPassPhraseLen; /* the length of WPA PSK pass phrase */ - UCHAR PMK[32]; /* WPA PSK mode PMK */ - UCHAR PTK[64]; /* WPA PSK mode PTK */ - UCHAR GTK[32]; /* GTK from authenticator */ + u8 WpaPassPhrase[64]; /* WPA PSK pass phrase */ + u32 WpaPassPhraseLen; /* the length of WPA PSK pass phrase */ + u8 PMK[32]; /* WPA PSK mode PMK */ + u8 PTK[64]; /* WPA PSK mode PTK */ + u8 GTK[32]; /* GTK from authenticator */ BSSID_INFO SavedPMK[PMKID_NO]; - UINT SavedPMKNum; /* Saved PMKID number */ + u32 SavedPMKNum; /* Saved PMKID number */ - UCHAR DefaultKeyId; + u8 DefaultKeyId; /* WPA 802.1x port control, WPA_802_1X_PORT_SECURED, WPA_802_1X_PORT_NOT_SECURED */ - UCHAR PortSecured; + u8 PortSecured; /* For WPA countermeasures */ - ULONG LastMicErrorTime; /* record last MIC error time */ - ULONG MicErrCnt; /* Should be 0, 1, 2, then reset to zero (after disassoiciation). */ + unsigned long LastMicErrorTime; /* record last MIC error time */ + unsigned long MicErrCnt; /* Should be 0, 1, 2, then reset to zero (after disassoiciation). */ BOOLEAN bBlockAssoc; /* Block associate attempt for 60 seconds after counter measure occurred. */ /* For WPA-PSK supplicant state */ WPA_STATE WpaState; /* Default is SS_NOTUSE and handled by microsoft 802.1x */ - UCHAR ReplayCounter[8]; - UCHAR ANonce[32]; /* ANonce for WPA-PSK from aurhenticator */ - UCHAR SNonce[32]; /* SNonce for WPA-PSK */ + u8 ReplayCounter[8]; + u8 ANonce[32]; /* ANonce for WPA-PSK from aurhenticator */ + u8 SNonce[32]; /* SNonce for WPA-PSK */ - UCHAR LastSNR0; /* last received BEACON's SNR */ - UCHAR LastSNR1; /* last received BEACON's SNR for 2nd antenna */ + u8 LastSNR0; /* last received BEACON's SNR */ + u8 LastSNR1; /* last received BEACON's SNR for 2nd antenna */ RSSI_SAMPLE RssiSample; - ULONG NumOfAvgRssiSample; + unsigned long NumOfAvgRssiSample; - ULONG LastBeaconRxTime; /* OS's timestamp of the last BEACON RX time */ - ULONG Last11bBeaconRxTime; /* OS's timestamp of the last 11B BEACON RX time */ - ULONG Last11gBeaconRxTime; /* OS's timestamp of the last 11G BEACON RX time */ - ULONG Last20NBeaconRxTime; /* OS's timestamp of the last 20MHz N BEACON RX time */ + unsigned long LastBeaconRxTime; /* OS's timestamp of the last BEACON RX time */ + unsigned long Last11bBeaconRxTime; /* OS's timestamp of the last 11B BEACON RX time */ + unsigned long Last11gBeaconRxTime; /* OS's timestamp of the last 11G BEACON RX time */ + unsigned long Last20NBeaconRxTime; /* OS's timestamp of the last 20MHz N BEACON RX time */ - ULONG LastScanTime; /* Record last scan time for issue BSSID_SCAN_LIST */ - ULONG ScanCnt; /* Scan counts since most recent SSID, BSSID, SCAN OID request */ + unsigned long LastScanTime; /* Record last scan time for issue BSSID_SCAN_LIST */ + unsigned long ScanCnt; /* Scan counts since most recent SSID, BSSID, SCAN OID request */ BOOLEAN bSwRadio; /* Software controlled Radio On/Off, TRUE: On */ BOOLEAN bHwRadio; /* Hardware controlled Radio On/Off, TRUE: On */ BOOLEAN bRadio; /* Radio state, And of Sw & Hw radio state */ @@ -1435,33 +1435,33 @@ typedef struct _STA_ADMIN_CONFIG { /* New for WPA, windows want us to keep association information and */ /* Fixed IEs from last association response */ NDIS_802_11_ASSOCIATION_INFORMATION AssocInfo; - USHORT ReqVarIELen; /* Length of next VIE include EID & Length */ - UCHAR ReqVarIEs[MAX_VIE_LEN]; /* The content saved here should be little-endian format. */ - USHORT ResVarIELen; /* Length of next VIE include EID & Length */ - UCHAR ResVarIEs[MAX_VIE_LEN]; + u16 ReqVarIELen; /* Length of next VIE include EID & Length */ + u8 ReqVarIEs[MAX_VIE_LEN]; /* The content saved here should be little-endian format. */ + u16 ResVarIELen; /* Length of next VIE include EID & Length */ + u8 ResVarIEs[MAX_VIE_LEN]; - UCHAR RSNIE_Len; - UCHAR RSN_IE[MAX_LEN_OF_RSNIE]; /* The content saved here should be little-endian format. */ + u8 RSNIE_Len; + u8 RSN_IE[MAX_LEN_OF_RSNIE]; /* The content saved here should be little-endian format. */ - ULONG CLBusyBytes; /* Save the total bytes received durning channel load scan time */ - USHORT RPIDensity[8]; /* Array for RPI density collection */ + unsigned long CLBusyBytes; /* Save the total bytes received durning channel load scan time */ + u16 RPIDensity[8]; /* Array for RPI density collection */ - UCHAR RMReqCnt; /* Number of measurement request saved. */ - UCHAR CurrentRMReqIdx; /* Number of measurement request saved. */ + u8 RMReqCnt; /* Number of measurement request saved. */ + u8 CurrentRMReqIdx; /* Number of measurement request saved. */ BOOLEAN ParallelReq; /* Parallel measurement, only one request performed, */ /* It must be the same channel with maximum duration */ - USHORT ParallelDuration; /* Maximum duration for parallel measurement */ - UCHAR ParallelChannel; /* Only one channel with parallel measurement */ - USHORT IAPPToken; /* IAPP dialog token */ + u16 ParallelDuration; /* Maximum duration for parallel measurement */ + u8 ParallelChannel; /* Only one channel with parallel measurement */ + u16 IAPPToken; /* IAPP dialog token */ /* Hack for channel load and noise histogram parameters */ - UCHAR NHFactor; /* Parameter for Noise histogram */ - UCHAR CLFactor; /* Parameter for channel load */ + u8 NHFactor; /* Parameter for Noise histogram */ + u8 CLFactor; /* Parameter for channel load */ RALINK_TIMER_STRUCT StaQuickResponeForRateUpTimer; BOOLEAN StaQuickResponeForRateUpTimerRunning; - UCHAR DtimCount; /* 0.. DtimPeriod-1 */ - UCHAR DtimPeriod; /* default = 3 */ + u8 DtimCount; /* 0.. DtimPeriod-1 */ + u8 DtimPeriod; /* default = 3 */ /*////////////////////////////////////////////////////////////////////////////////////// */ /* This is only for WHQL test. */ @@ -1471,22 +1471,22 @@ typedef struct _STA_ADMIN_CONFIG { RALINK_TIMER_STRUCT WpaDisassocAndBlockAssocTimer; /* Fast Roaming */ BOOLEAN bAutoRoaming; /* 0:disable auto roaming by RSSI, 1:enable auto roaming by RSSI */ - CHAR dBmToRoam; /* the condition to roam when receiving Rssi less than this value. It's negative value. */ + char dBmToRoam; /* the condition to roam when receiving Rssi less than this value. It's negative value. */ BOOLEAN IEEE8021X; BOOLEAN IEEE8021x_required_keys; CIPHER_KEY DesireSharedKey[4]; /* Record user desired WEP keys */ - UCHAR DesireSharedKeyId; + u8 DesireSharedKeyId; /* 0: driver ignores wpa_supplicant */ /* 1: wpa_supplicant initiates scanning and AP selection */ /* 2: driver takes care of scanning, AP selection, and IEEE 802.11 association parameters */ - UCHAR WpaSupplicantUP; - UCHAR WpaSupplicantScanCount; + u8 WpaSupplicantUP; + u8 WpaSupplicantScanCount; BOOLEAN bRSN_IE_FromWpaSupplicant; - CHAR dev_name[16]; - USHORT OriDevType; + char dev_name[16]; + u16 OriDevType; BOOLEAN bTGnWifiTest; BOOLEAN bScanReqIsFromWebUI; @@ -1497,7 +1497,7 @@ typedef struct _STA_ADMIN_CONFIG { BOOLEAN bAutoTxRateSwitch; #ifdef RTMP_MAC_PCI - UCHAR BBPR3; + u8 BBPR3; /* PS Control has 2 meanings for advanced power save function. */ /* 1. EnablePSinIdle : When no connection, always radio off except need to do site survey. */ /* 2. EnableNewPS : will save more current in sleep or radio off mode. */ @@ -1505,7 +1505,7 @@ typedef struct _STA_ADMIN_CONFIG { #endif /* RTMP_MAC_PCI // */ BOOLEAN bAutoConnectByBssid; - ULONG BeaconLostTime; /* seconds */ + unsigned long BeaconLostTime; /* seconds */ BOOLEAN bForceTxBurst; /* 1: force enble TX PACKET BURST, 0: disable */ } STA_ADMIN_CONFIG, *PSTA_ADMIN_CONFIG; @@ -1516,18 +1516,18 @@ typedef struct _STA_ADMIN_CONFIG { /* Normally, after SCAN or failed roaming attempts, we need to recover back to */ /* the current active settings. */ typedef struct _STA_ACTIVE_CONFIG { - USHORT Aid; - USHORT AtimWin; /* in kusec; IBSS parameter set element */ - USHORT CapabilityInfo; - USHORT CfpMaxDuration; - USHORT CfpPeriod; + u16 Aid; + u16 AtimWin; /* in kusec; IBSS parameter set element */ + u16 CapabilityInfo; + u16 CfpMaxDuration; + u16 CfpPeriod; /* Copy supported rate from desired AP's beacon. We are trying to match */ /* AP's supported and extended rate settings. */ - UCHAR SupRate[MAX_LEN_OF_SUPPORTED_RATES]; - UCHAR ExtRate[MAX_LEN_OF_SUPPORTED_RATES]; - UCHAR SupRateLen; - UCHAR ExtRateLen; + u8 SupRate[MAX_LEN_OF_SUPPORTED_RATES]; + u8 ExtRate[MAX_LEN_OF_SUPPORTED_RATES]; + u8 SupRateLen; + u8 ExtRateLen; /* Copy supported ht from desired AP's beacon. We are trying to match */ RT_HT_PHY_INFO SupportedPhyInfo; RT_HT_CAPABILITY SupportedHtPhy; @@ -1543,18 +1543,18 @@ typedef struct _MAC_TABLE_ENTRY { BOOLEAN isCached; BOOLEAN bIAmBadAtheros; /* Flag if this is Atheros chip that has IOT problem. We need to turn on RTS/CTS protection. */ - UCHAR EnqueueEapolStartTimerRunning; /* Enqueue EAPoL-Start for triggering EAP SM */ + u8 EnqueueEapolStartTimerRunning; /* Enqueue EAPoL-Start for triggering EAP SM */ /*jan for wpa */ /* record which entry revoke MIC Failure , if it leaves the BSS itself, AP won't update aMICFailTime MIB */ - UCHAR CMTimerRunning; - UCHAR apidx; /* MBSS number */ - UCHAR RSNIE_Len; - UCHAR RSN_IE[MAX_LEN_OF_RSNIE]; - UCHAR ANonce[LEN_KEY_DESC_NONCE]; - UCHAR SNonce[LEN_KEY_DESC_NONCE]; - UCHAR R_Counter[LEN_KEY_DESC_REPLAY]; - UCHAR PTK[64]; - UCHAR ReTryCounter; + u8 CMTimerRunning; + u8 apidx; /* MBSS number */ + u8 RSNIE_Len; + u8 RSN_IE[MAX_LEN_OF_RSNIE]; + u8 ANonce[LEN_KEY_DESC_NONCE]; + u8 SNonce[LEN_KEY_DESC_NONCE]; + u8 R_Counter[LEN_KEY_DESC_REPLAY]; + u8 PTK[64]; + u8 ReTryCounter; RALINK_TIMER_STRUCT RetryTimer; RALINK_TIMER_STRUCT EnqueueStartForPSKTimer; /* A timer which enqueue EAPoL-Start for triggering PSK SM */ NDIS_802_11_AUTHENTICATION_MODE AuthMode; /* This should match to whatever microsoft defined */ @@ -1562,113 +1562,113 @@ typedef struct _MAC_TABLE_ENTRY { NDIS_802_11_WEP_STATUS GroupKeyWepStatus; AP_WPA_STATE WpaState; GTK_STATE GTKState; - USHORT PortSecured; + u16 PortSecured; NDIS_802_11_PRIVACY_FILTER PrivacyFilter; /* PrivacyFilter enum for 802.1X */ CIPHER_KEY PairwiseKey; - PVOID pAd; - INT PMKID_CacheIdx; - UCHAR PMKID[LEN_PMKID]; + void *pAd; + int PMKID_CacheIdx; + u8 PMKID[LEN_PMKID]; - UCHAR Addr[MAC_ADDR_LEN]; - UCHAR PsMode; + u8 Addr[MAC_ADDR_LEN]; + u8 PsMode; SST Sst; AUTH_STATE AuthState; /* for SHARED KEY authentication state machine used only */ BOOLEAN IsReassocSta; /* Indicate whether this is a reassociation procedure */ - USHORT Aid; - USHORT CapabilityInfo; - UCHAR LastRssi; - ULONG NoDataIdleCount; - UINT16 StationKeepAliveCount; /* unit: second */ - ULONG PsQIdleCount; + u16 Aid; + u16 CapabilityInfo; + u8 LastRssi; + unsigned long NoDataIdleCount; + u16 StationKeepAliveCount; /* unit: second */ + unsigned long PsQIdleCount; QUEUE_HEADER PsQueue; - UINT32 StaConnectTime; /* the live time of this station since associated with AP */ + u32 StaConnectTime; /* the live time of this station since associated with AP */ BOOLEAN bSendBAR; - USHORT NoBADataCountDown; + u16 NoBADataCountDown; - UINT32 CachedBuf[16]; /* UINT (4 bytes) for alignment */ - UINT TxBFCount; /* 3*3 */ - UINT FIFOCount; - UINT DebugFIFOCount; - UINT DebugTxCount; + u32 CachedBuf[16]; /* u32 (4 bytes) for alignment */ + u32 TxBFCount; /* 3*3 */ + u32 FIFOCount; + u32 DebugFIFOCount; + u32 DebugTxCount; BOOLEAN bDlsInit; /*==================================================== */ /*WDS entry needs these */ /* if ValidAsWDS==TRUE, MatchWDSTabIdx is the index in WdsTab.MacTab */ - UINT MatchWDSTabIdx; - UCHAR MaxSupportedRate; - UCHAR CurrTxRate; - UCHAR CurrTxRateIndex; + u32 MatchWDSTabIdx; + u8 MaxSupportedRate; + u8 CurrTxRate; + u8 CurrTxRateIndex; /* to record the each TX rate's quality. 0 is best, the bigger the worse. */ - USHORT TxQuality[MAX_STEP_OF_TX_RATE_SWITCH]; -/* USHORT OneSecTxOkCount; */ - UINT32 OneSecTxNoRetryOkCount; - UINT32 OneSecTxRetryOkCount; - UINT32 OneSecTxFailCount; - UINT32 ContinueTxFailCnt; - UINT32 CurrTxRateStableTime; /* # of second in current TX rate */ - UCHAR TxRateUpPenalty; /* extra # of second penalty due to last unstable condition */ + u16 TxQuality[MAX_STEP_OF_TX_RATE_SWITCH]; +/* u16 OneSecTxOkCount; */ + u32 OneSecTxNoRetryOkCount; + u32 OneSecTxRetryOkCount; + u32 OneSecTxFailCount; + u32 ContinueTxFailCnt; + u32 CurrTxRateStableTime; /* # of second in current TX rate */ + u8 TxRateUpPenalty; /* extra # of second penalty due to last unstable condition */ /*==================================================== */ BOOLEAN fNoisyEnvironment; BOOLEAN fLastSecAccordingRSSI; - UCHAR LastSecTxRateChangeAction; /* 0: no change, 1:rate UP, 2:rate down */ - CHAR LastTimeTxRateChangeAction; /*Keep last time value of LastSecTxRateChangeAction */ - ULONG LastTxOkCount; - UCHAR PER[MAX_STEP_OF_TX_RATE_SWITCH]; + u8 LastSecTxRateChangeAction; /* 0: no change, 1:rate UP, 2:rate down */ + char LastTimeTxRateChangeAction; /*Keep last time value of LastSecTxRateChangeAction */ + unsigned long LastTxOkCount; + u8 PER[MAX_STEP_OF_TX_RATE_SWITCH]; /* a bitmap of BOOLEAN flags. each bit represent an operation status of a particular */ /* BOOLEAN control, either ON or OFF. These flags should always be accessed via */ /* CLIENT_STATUS_TEST_FLAG(), CLIENT_STATUS_SET_FLAG(), CLIENT_STATUS_CLEAR_FLAG() macros. */ /* see fOP_STATUS_xxx in RTMP_DEF.C for detail bit definition. fCLIENT_STATUS_AMSDU_INUSED */ - ULONG ClientStatusFlags; + unsigned long ClientStatusFlags; HTTRANSMIT_SETTING HTPhyMode, MaxHTPhyMode, MinHTPhyMode; /* For transmit phy setting in TXWI. */ /* HT EWC MIMO-N used parameters */ - USHORT RXBAbitmap; /* fill to on-chip RXWI_BA_BITMASK in 8.1.3RX attribute entry format */ - USHORT TXBAbitmap; /* This bitmap as originator, only keep in software used to mark AMPDU bit in TXWI */ - USHORT TXAutoBAbitmap; - USHORT BADeclineBitmap; - USHORT BARecWcidArray[NUM_OF_TID]; /* The mapping wcid of recipient session. if RXBAbitmap bit is masked */ - USHORT BAOriWcidArray[NUM_OF_TID]; /* The mapping wcid of originator session. if TXBAbitmap bit is masked */ - USHORT BAOriSequence[NUM_OF_TID]; /* The mapping wcid of originator session. if TXBAbitmap bit is masked */ + u16 RXBAbitmap; /* fill to on-chip RXWI_BA_BITMASK in 8.1.3RX attribute entry format */ + u16 TXBAbitmap; /* This bitmap as originator, only keep in software used to mark AMPDU bit in TXWI */ + u16 TXAutoBAbitmap; + u16 BADeclineBitmap; + u16 BARecWcidArray[NUM_OF_TID]; /* The mapping wcid of recipient session. if RXBAbitmap bit is masked */ + u16 BAOriWcidArray[NUM_OF_TID]; /* The mapping wcid of originator session. if TXBAbitmap bit is masked */ + u16 BAOriSequence[NUM_OF_TID]; /* The mapping wcid of originator session. if TXBAbitmap bit is masked */ /* 802.11n features. */ - UCHAR MpduDensity; - UCHAR MaxRAmpduFactor; - UCHAR AMsduSize; - UCHAR MmpsMode; /* MIMO power save more. */ + u8 MpduDensity; + u8 MaxRAmpduFactor; + u8 AMsduSize; + u8 MmpsMode; /* MIMO power save more. */ HT_CAPABILITY_IE HTCapability; BOOLEAN bAutoTxRateSwitch; - UCHAR RateLen; + u8 RateLen; struct _MAC_TABLE_ENTRY *pNext; - USHORT TxSeq[NUM_OF_TID]; - USHORT NonQosDataSeq; + u16 TxSeq[NUM_OF_TID]; + u16 NonQosDataSeq; RSSI_SAMPLE RssiSample; - UINT32 TXMCSExpected[16]; - UINT32 TXMCSSuccessful[16]; - UINT32 TXMCSFailed[16]; - UINT32 TXMCSAutoFallBack[16][16]; + u32 TXMCSExpected[16]; + u32 TXMCSSuccessful[16]; + u32 TXMCSFailed[16]; + u32 TXMCSAutoFallBack[16][16]; - ULONG LastBeaconRxTime; + unsigned long LastBeaconRxTime; - ULONG AssocDeadLine; + unsigned long AssocDeadLine; } MAC_TABLE_ENTRY, *PMAC_TABLE_ENTRY; typedef struct _MAC_TABLE { - USHORT Size; + u16 Size; MAC_TABLE_ENTRY *Hash[HASH_TABLE_SIZE]; MAC_TABLE_ENTRY Content[MAX_LEN_OF_MAC_TABLE]; QUEUE_HEADER McastPsQueue; - ULONG PsQIdleCount; + unsigned long PsQIdleCount; BOOLEAN fAnyStationInPsm; BOOLEAN fAnyStationBadAtheros; /* Check if any Station is atheros 802.11n Chip. We need to use RTS/CTS with Atheros 802,.11n chip. */ BOOLEAN fAnyTxOPForceDisable; /* Check if it is necessary to disable BE TxOP */ @@ -1688,19 +1688,19 @@ struct wificonf { }; typedef struct _RTMP_DEV_INFO_ { - UCHAR chipName[16]; + u8 chipName[16]; RTMP_INF_TYPE infType; } RTMP_DEV_INFO; struct _RTMP_CHIP_OP_ { /* Calibration access related callback functions */ int (*eeinit) (RTMP_ADAPTER * pAd); /* int (*eeinit)(RTMP_ADAPTER *pAd); */ - int (*eeread) (RTMP_ADAPTER * pAd, USHORT offset, PUSHORT pValue); /* int (*eeread)(RTMP_ADAPTER *pAd, int offset, PUSHORT pValue); */ + int (*eeread) (RTMP_ADAPTER * pAd, u16 offset, u16 *pValue); /* int (*eeread)(RTMP_ADAPTER *pAd, int offset, u16 *pValue); */ /* MCU related callback functions */ int (*loadFirmware) (RTMP_ADAPTER * pAd); /* int (*loadFirmware)(RTMP_ADAPTER *pAd); */ int (*eraseFirmware) (RTMP_ADAPTER * pAd); /* int (*eraseFirmware)(RTMP_ADAPTER *pAd); */ - int (*sendCommandToMcu) (RTMP_ADAPTER * pAd, UCHAR cmd, UCHAR token, UCHAR arg0, UCHAR arg1);; /* int (*sendCommandToMcu)(RTMP_ADAPTER *pAd, UCHAR cmd, UCHAR token, UCHAR arg0, UCHAR arg1); */ + int (*sendCommandToMcu) (RTMP_ADAPTER * pAd, u8 cmd, u8 token, u8 arg0, u8 arg1);; /* int (*sendCommandToMcu)(RTMP_ADAPTER *pAd, u8 cmd, u8 token, u8 arg0, u8 arg1); */ /* RF access related callback functions */ REG_PAIR *pRFRegTable; @@ -1715,40 +1715,40 @@ struct _RTMP_CHIP_OP_ { /* The miniport adapter structure */ /* */ struct _RTMP_ADAPTER { - PVOID OS_Cookie; /* save specific structure relative to OS */ + void *OS_Cookie; /* save specific structure relative to OS */ PNET_DEV net_dev; - ULONG VirtualIfCnt; + unsigned long VirtualIfCnt; RTMP_CHIP_OP chipOps; - USHORT ThisTbttNumToNextWakeUp; + u16 ThisTbttNumToNextWakeUp; #ifdef RTMP_MAC_PCI /*****************************************************************************************/ /* PCI related parameters */ /*****************************************************************************************/ - PUCHAR CSRBaseAddress; /* PCI MMIO Base Address, all access will use */ + u8 *CSRBaseAddress; /* PCI MMIO Base Address, all access will use */ unsigned int irq_num; - USHORT LnkCtrlBitMask; - USHORT RLnkCtrlConfiguration; - USHORT RLnkCtrlOffset; - USHORT HostLnkCtrlConfiguration; - USHORT HostLnkCtrlOffset; - USHORT PCIePowerSaveLevel; - ULONG Rt3xxHostLinkCtrl; /* USed for 3090F chip */ - ULONG Rt3xxRalinkLinkCtrl; /* USed for 3090F chip */ - USHORT DeviceID; /* Read from PCI config */ - ULONG AccessBBPFailCount; + u16 LnkCtrlBitMask; + u16 RLnkCtrlConfiguration; + u16 RLnkCtrlOffset; + u16 HostLnkCtrlConfiguration; + u16 HostLnkCtrlOffset; + u16 PCIePowerSaveLevel; + unsigned long Rt3xxHostLinkCtrl; /* USed for 3090F chip */ + unsigned long Rt3xxRalinkLinkCtrl; /* USed for 3090F chip */ + u16 DeviceID; /* Read from PCI config */ + unsigned long AccessBBPFailCount; BOOLEAN bPCIclkOff; /* flag that indicate if the PICE power status in Configuration SPace.. */ BOOLEAN bPCIclkOffDisableTx; /* */ BOOLEAN brt30xxBanMcuCmd; /*when = 0xff means all commands are ok to set . */ BOOLEAN b3090ESpecialChip; /*3090E special chip that write EEPROM 0x24=0x9280. */ - ULONG CheckDmaBusyCount; /* Check Interrupt Status Register Count. */ + unsigned long CheckDmaBusyCount; /* Check Interrupt Status Register Count. */ - UINT int_enable_reg; - UINT int_disable_mask; - UINT int_pending; + u32 int_enable_reg; + u32 int_disable_mask; + u32 int_pending; RTMP_DMABUF TxBufSpace[NUM_OF_TX_RING]; /* Shared memory of all 1st pre-allocated TxBuf associated with each TXD */ RTMP_DMABUF RxDescRing; /* Shared memory for RX descriptors */ @@ -1757,23 +1757,23 @@ struct _RTMP_ADAPTER { #endif /* RTMP_MAC_PCI // */ NDIS_SPIN_LOCK irq_lock; - UCHAR irq_disabled; + u8 irq_disabled; #ifdef RTMP_MAC_USB /*****************************************************************************************/ /* USB related parameters */ /*****************************************************************************************/ struct usb_config_descriptor *config; - UINT BulkInEpAddr; /* bulk-in endpoint address */ - UINT BulkOutEpAddr[6]; /* bulk-out endpoint address */ + u32 BulkInEpAddr; /* bulk-in endpoint address */ + u32 BulkOutEpAddr[6]; /* bulk-out endpoint address */ - UINT NumberOfPipes; - USHORT BulkOutMaxPacketSize; - USHORT BulkInMaxPacketSize; + u32 NumberOfPipes; + u16 BulkOutMaxPacketSize; + u16 BulkInMaxPacketSize; /*======Control Flags */ - LONG PendingIoCount; - ULONG BulkFlags; + long PendingIoCount; + unsigned long BulkFlags; BOOLEAN bUsbTxBulkAggre; /* Flags for bulk out data priority */ /*======Cmd Thread */ @@ -1783,7 +1783,7 @@ struct _RTMP_ADAPTER { /*======Semaphores (event) */ RTMP_OS_SEM UsbVendorReq_semaphore; - PVOID UsbVendorReqBuf; + void *UsbVendorReqBuf; wait_queue_head_t *wait; #endif /* RTMP_MAC_USB // */ @@ -1823,12 +1823,12 @@ struct _RTMP_ADAPTER { NDIS_SPIN_LOCK TxContextQueueLock[NUM_OF_TX_RING]; /* TxContextQueue spinlock */ /* 4 sets of Bulk Out index and pending flag */ - UCHAR NextBulkOutIndex[4]; /* only used for 4 EDCA bulkout pipe */ + u8 NextBulkOutIndex[4]; /* only used for 4 EDCA bulkout pipe */ BOOLEAN BulkOutPending[6]; /* used for total 6 bulkout pipe */ - UCHAR bulkResetPipeid; + u8 bulkResetPipeid; BOOLEAN MgmtBulkPending; - ULONG bulkResetReq[6]; + unsigned long bulkResetReq[6]; #endif /* RTMP_MAC_USB // */ /* resource for software backlog queues */ @@ -1853,41 +1853,41 @@ struct _RTMP_ADAPTER { #ifdef RTMP_MAC_USB RX_CONTEXT RxContext[RX_RING_SIZE]; /* 1 for redundant multiple IRP bulk in. */ NDIS_SPIN_LOCK BulkInLock; /* BulkIn spinlock for 4 ACs */ - UCHAR PendingRx; /* The Maximum pending Rx value should be RX_RING_SIZE. */ - UCHAR NextRxBulkInIndex; /* Indicate the current RxContext Index which hold by Host controller. */ - UCHAR NextRxBulkInReadIndex; /* Indicate the current RxContext Index which driver can read & process it. */ - ULONG NextRxBulkInPosition; /* Want to contatenate 2 URB buffer while 1st is bulkin failed URB. This Position is 1st URB TransferLength. */ - ULONG TransferBufferLength; /* current length of the packet buffer */ - ULONG ReadPosition; /* current read position in a packet buffer */ + u8 PendingRx; /* The Maximum pending Rx value should be RX_RING_SIZE. */ + u8 NextRxBulkInIndex; /* Indicate the current RxContext Index which hold by Host controller. */ + u8 NextRxBulkInReadIndex; /* Indicate the current RxContext Index which driver can read & process it. */ + unsigned long NextRxBulkInPosition; /* Want to contatenate 2 URB buffer while 1st is bulkin failed URB. This Position is 1st URB TransferLength. */ + unsigned long TransferBufferLength; /* current length of the packet buffer */ + unsigned long ReadPosition; /* current read position in a packet buffer */ #endif /* RTMP_MAC_USB // */ /*****************************************************************************************/ /* ASIC related parameters */ /*****************************************************************************************/ - UINT32 MACVersion; /* MAC version. Record rt2860C(0x28600100) or rt2860D (0x28600101).. */ + u32 MACVersion; /* MAC version. Record rt2860C(0x28600100) or rt2860D (0x28600101).. */ /* --------------------------- */ /* E2PROM */ /* --------------------------- */ - ULONG EepromVersion; /* byte 0: version, byte 1: revision, byte 2~3: unused */ - ULONG FirmwareVersion; /* byte 0: Minor version, byte 1: Major version, otherwise unused. */ - USHORT EEPROMDefaultValue[NUM_EEPROM_BBP_PARMS]; - UCHAR EEPROMAddressNum; /* 93c46=6 93c66=8 */ + unsigned long EepromVersion; /* byte 0: version, byte 1: revision, byte 2~3: unused */ + unsigned long FirmwareVersion; /* byte 0: Minor version, byte 1: Major version, otherwise unused. */ + u16 EEPROMDefaultValue[NUM_EEPROM_BBP_PARMS]; + u8 EEPROMAddressNum; /* 93c46=6 93c66=8 */ BOOLEAN EepromAccess; - UCHAR EFuseTag; + u8 EFuseTag; /* --------------------------- */ /* BBP Control */ /* --------------------------- */ - UCHAR BbpWriteLatch[140]; /* record last BBP register value written via BBP_IO_WRITE/BBP_IO_WRITE_VY_REG_ID */ - CHAR BbpRssiToDbmDelta; /* change from UCHAR to CHAR for high power */ + u8 BbpWriteLatch[140]; /* record last BBP register value written via BBP_IO_WRITE/BBP_IO_WRITE_VY_REG_ID */ + char BbpRssiToDbmDelta; /* change from u8 to char for high power */ BBP_R66_TUNING BbpTuning; /* ---------------------------- */ /* RFIC control */ /* ---------------------------- */ - UCHAR RfIcType; /* RFIC_xxx */ - ULONG RfFreqOffset; /* Frequency offset for channel switching */ + u8 RfIcType; /* RFIC_xxx */ + unsigned long RfFreqOffset; /* Frequency offset for channel switching */ RTMP_RF_REGS LatchRfRegs; /* latch th latest RF programming value since RF IC doesn't support READ */ EEPROM_ANTENNA_STRUC Antenna; /* Since ANtenna definition is different for a & g. We need to save it for future reference. */ @@ -1897,73 +1897,73 @@ struct _RTMP_ADAPTER { /* RX Antenna = DIVERSITY ON */ SOFT_RX_ANT_DIVERSITY RxAnt; - UCHAR RFProgSeq; + u8 RFProgSeq; CHANNEL_TX_POWER TxPower[MAX_NUM_OF_CHANNELS]; /* Store Tx power value for all channels. */ CHANNEL_TX_POWER ChannelList[MAX_NUM_OF_CHANNELS]; /* list all supported channels for site survey */ CHANNEL_11J_TX_POWER TxPower11J[MAX_NUM_OF_11JCHANNELS]; /* 802.11j channel and bw */ CHANNEL_11J_TX_POWER ChannelList11J[MAX_NUM_OF_11JCHANNELS]; /* list all supported channels for site survey */ - UCHAR ChannelListNum; /* number of channel in ChannelList[] */ - UCHAR Bbp94; + u8 ChannelListNum; /* number of channel in ChannelList[] */ + u8 Bbp94; BOOLEAN BbpForCCK; - ULONG Tx20MPwrCfgABand[5]; - ULONG Tx20MPwrCfgGBand[5]; - ULONG Tx40MPwrCfgABand[5]; - ULONG Tx40MPwrCfgGBand[5]; + unsigned long Tx20MPwrCfgABand[5]; + unsigned long Tx20MPwrCfgGBand[5]; + unsigned long Tx40MPwrCfgABand[5]; + unsigned long Tx40MPwrCfgGBand[5]; BOOLEAN bAutoTxAgcA; /* Enable driver auto Tx Agc control */ - UCHAR TssiRefA; /* Store Tssi reference value as 25 temperature. */ - UCHAR TssiPlusBoundaryA[5]; /* Tssi boundary for increase Tx power to compensate. */ - UCHAR TssiMinusBoundaryA[5]; /* Tssi boundary for decrease Tx power to compensate. */ - UCHAR TxAgcStepA; /* Store Tx TSSI delta increment / decrement value */ - CHAR TxAgcCompensateA; /* Store the compensation (TxAgcStep * (idx-1)) */ + u8 TssiRefA; /* Store Tssi reference value as 25 temperature. */ + u8 TssiPlusBoundaryA[5]; /* Tssi boundary for increase Tx power to compensate. */ + u8 TssiMinusBoundaryA[5]; /* Tssi boundary for decrease Tx power to compensate. */ + u8 TxAgcStepA; /* Store Tx TSSI delta increment / decrement value */ + char TxAgcCompensateA; /* Store the compensation (TxAgcStep * (idx-1)) */ BOOLEAN bAutoTxAgcG; /* Enable driver auto Tx Agc control */ - UCHAR TssiRefG; /* Store Tssi reference value as 25 temperature. */ - UCHAR TssiPlusBoundaryG[5]; /* Tssi boundary for increase Tx power to compensate. */ - UCHAR TssiMinusBoundaryG[5]; /* Tssi boundary for decrease Tx power to compensate. */ - UCHAR TxAgcStepG; /* Store Tx TSSI delta increment / decrement value */ - CHAR TxAgcCompensateG; /* Store the compensation (TxAgcStep * (idx-1)) */ - - CHAR BGRssiOffset0; /* Store B/G RSSI#0 Offset value on EEPROM 0x46h */ - CHAR BGRssiOffset1; /* Store B/G RSSI#1 Offset value */ - CHAR BGRssiOffset2; /* Store B/G RSSI#2 Offset value */ - - CHAR ARssiOffset0; /* Store A RSSI#0 Offset value on EEPROM 0x4Ah */ - CHAR ARssiOffset1; /* Store A RSSI#1 Offset value */ - CHAR ARssiOffset2; /* Store A RSSI#2 Offset value */ - - CHAR BLNAGain; /* Store B/G external LNA#0 value on EEPROM 0x44h */ - CHAR ALNAGain0; /* Store A external LNA#0 value for ch36~64 */ - CHAR ALNAGain1; /* Store A external LNA#1 value for ch100~128 */ - CHAR ALNAGain2; /* Store A external LNA#2 value for ch132~165 */ + u8 TssiRefG; /* Store Tssi reference value as 25 temperature. */ + u8 TssiPlusBoundaryG[5]; /* Tssi boundary for increase Tx power to compensate. */ + u8 TssiMinusBoundaryG[5]; /* Tssi boundary for decrease Tx power to compensate. */ + u8 TxAgcStepG; /* Store Tx TSSI delta increment / decrement value */ + char TxAgcCompensateG; /* Store the compensation (TxAgcStep * (idx-1)) */ + + char BGRssiOffset0; /* Store B/G RSSI#0 Offset value on EEPROM 0x46h */ + char BGRssiOffset1; /* Store B/G RSSI#1 Offset value */ + char BGRssiOffset2; /* Store B/G RSSI#2 Offset value */ + + char ARssiOffset0; /* Store A RSSI#0 Offset value on EEPROM 0x4Ah */ + char ARssiOffset1; /* Store A RSSI#1 Offset value */ + char ARssiOffset2; /* Store A RSSI#2 Offset value */ + + char BLNAGain; /* Store B/G external LNA#0 value on EEPROM 0x44h */ + char ALNAGain0; /* Store A external LNA#0 value for ch36~64 */ + char ALNAGain1; /* Store A external LNA#1 value for ch100~128 */ + char ALNAGain2; /* Store A external LNA#2 value for ch132~165 */ #ifdef RT30xx /* for 3572 */ - UCHAR Bbp25; - UCHAR Bbp26; + u8 Bbp25; + u8 Bbp26; - UCHAR TxMixerGain24G; /* Tx mixer gain value from EEPROM to improve Tx EVM / Tx DAC, 2.4G */ - UCHAR TxMixerGain5G; + u8 TxMixerGain24G; /* Tx mixer gain value from EEPROM to improve Tx EVM / Tx DAC, 2.4G */ + u8 TxMixerGain5G; #endif /* RT30xx // */ /* ---------------------------- */ /* LED control */ /* ---------------------------- */ MCU_LEDCS_STRUC LedCntl; - USHORT Led1; /* read from EEPROM 0x3c */ - USHORT Led2; /* EEPROM 0x3e */ - USHORT Led3; /* EEPROM 0x40 */ - UCHAR LedIndicatorStrength; - UCHAR RssiSingalstrengthOffet; + u16 Led1; /* read from EEPROM 0x3c */ + u16 Led2; /* EEPROM 0x3e */ + u16 Led3; /* EEPROM 0x40 */ + u8 LedIndicatorStrength; + u8 RssiSingalstrengthOffet; BOOLEAN bLedOnScanning; - UCHAR LedStatus; + u8 LedStatus; /*****************************************************************************************/ /* 802.11 related parameters */ /*****************************************************************************************/ /* outgoing BEACON frame buffer and corresponding TXD */ TXWI_STRUC BeaconTxWI; - PUCHAR BeaconBuf; - USHORT BeaconOffset[HW_BEACON_MAX_COUNT]; + u8 *BeaconBuf; + u16 BeaconOffset[HW_BEACON_MAX_COUNT]; /* pre-build PS-POLL and NULL frame upon link up. for efficiency purpose. */ PSPOLL_FRAME PsPollFrame; @@ -1985,21 +1985,21 @@ struct _RTMP_ADAPTER { /* ----------------------------------------------- */ STA_ADMIN_CONFIG StaCfg; /* user desired settings */ STA_ACTIVE_CONFIG StaActive; /* valid only when ADHOC_ON(pAd) || INFRA_ON(pAd) */ - CHAR nickname[IW_ESSID_MAX_SIZE + 1]; /* nickname, only used in the iwconfig i/f */ - NDIS_MEDIA_STATE PreMediaState; + char nickname[IW_ESSID_MAX_SIZE + 1]; /* nickname, only used in the iwconfig i/f */ + int PreMediaState; /*=======Common=========== */ /* OP mode: either AP or STA */ - UCHAR OpMode; /* OPMODE_STA, OPMODE_AP */ + u8 OpMode; /* OPMODE_STA, OPMODE_AP */ - NDIS_MEDIA_STATE IndicateMediaState; /* Base on Indication state, default is NdisMediaStateDisConnected */ + int IndicateMediaState; /* Base on Indication state, default is NdisMediaStateDisConnected */ /* MAT related parameters */ /* configuration: read from Registry & E2PROM */ BOOLEAN bLocalAdminMAC; /* Use user changed MAC */ - UCHAR PermanentAddress[MAC_ADDR_LEN]; /* Factory default MAC address */ - UCHAR CurrentAddress[MAC_ADDR_LEN]; /* User changed MAC address */ + u8 PermanentAddress[MAC_ADDR_LEN]; /* Factory default MAC address */ + u8 CurrentAddress[MAC_ADDR_LEN]; /* User changed MAC address */ /* ------------------------------------------------------ */ /* common configuration to both OPMODE_STA and OPMODE_AP */ @@ -2034,27 +2034,27 @@ struct _RTMP_ADAPTER { PRIVATE_STRUC PrivateInfo; /* Private information & counters */ /* flags, see fRTMP_ADAPTER_xxx flags */ - ULONG Flags; /* Represent current device status */ - ULONG PSFlags; /* Power Save operation flag. */ + unsigned long Flags; /* Represent current device status */ + unsigned long PSFlags; /* Power Save operation flag. */ /* current TX sequence # */ - USHORT Sequence; + u16 Sequence; /* Control disconnect / connect event generation */ /*+++Didn't used anymore */ - ULONG LinkDownTime; + unsigned long LinkDownTime; /*--- */ - ULONG LastRxRate; - ULONG LastTxRate; + unsigned long LastRxRate; + unsigned long LastTxRate; /*+++Used only for Station */ BOOLEAN bConfigChanged; /* Config Change flag for the same SSID setting */ /*--- */ - ULONG ExtraInfo; /* Extra information for displaying status */ - ULONG SystemErrorBitmap; /* b0: E2PROM version error */ + unsigned long ExtraInfo; /* Extra information for displaying status */ + unsigned long SystemErrorBitmap; /* b0: E2PROM version error */ /*+++Didn't used anymore */ - ULONG MacIcVersion; /* MAC/BBP serial interface issue solved after ver.D */ + unsigned long MacIcVersion; /* MAC/BBP serial interface issue solved after ver.D */ /*--- */ /* --------------------------- */ @@ -2068,33 +2068,33 @@ struct _RTMP_ADAPTER { /* Statistic related parameters */ /*****************************************************************************************/ #ifdef RTMP_MAC_USB - ULONG BulkOutDataOneSecCount; - ULONG BulkInDataOneSecCount; - ULONG BulkLastOneSecCount; /* BulkOutDataOneSecCount + BulkInDataOneSecCount */ - ULONG watchDogRxCnt; - ULONG watchDogRxOverFlowCnt; - ULONG watchDogTxPendingCnt[NUM_OF_TX_RING]; - INT TransferedLength[NUM_OF_TX_RING]; + unsigned long BulkOutDataOneSecCount; + unsigned long BulkInDataOneSecCount; + unsigned long BulkLastOneSecCount; /* BulkOutDataOneSecCount + BulkInDataOneSecCount */ + unsigned long watchDogRxCnt; + unsigned long watchDogRxOverFlowCnt; + unsigned long watchDogTxPendingCnt[NUM_OF_TX_RING]; + int TransferedLength[NUM_OF_TX_RING]; #endif /* RTMP_MAC_USB // */ BOOLEAN bUpdateBcnCntDone; - ULONG watchDogMacDeadlock; /* prevent MAC/BBP into deadlock condition */ + unsigned long watchDogMacDeadlock; /* prevent MAC/BBP into deadlock condition */ /* ---------------------------- */ /* DEBUG paramerts */ /* ---------------------------- */ - /*ULONG DebugSetting[4]; */ + /*unsigned long DebugSetting[4]; */ BOOLEAN bBanAllBaSetup; BOOLEAN bPromiscuous; /* ---------------------------- */ /* rt2860c emulation-use Parameters */ /* ---------------------------- */ - /*ULONG rtsaccu[30]; */ - /*ULONG ctsaccu[30]; */ - /*ULONG cfendaccu[30]; */ - /*ULONG bacontent[16]; */ - /*ULONG rxint[RX_RING_SIZE+1]; */ - /*UCHAR rcvba[60]; */ + /*unsigned long rtsaccu[30]; */ + /*unsigned long ctsaccu[30]; */ + /*unsigned long cfendaccu[30]; */ + /*unsigned long bacontent[16]; */ + /*unsigned long rxint[RX_RING_SIZE+1]; */ + /*u8 rcvba[60]; */ BOOLEAN bLinkAdapt; BOOLEAN bForcePrintTX; BOOLEAN bForcePrintRX; @@ -2103,20 +2103,20 @@ struct _RTMP_ADAPTER { BOOLEAN bProtectionTest; BOOLEAN bBroadComHT; /*+++Following add from RT2870 USB. */ - ULONG BulkOutReq; - ULONG BulkOutComplete; - ULONG BulkOutCompleteOther; - ULONG BulkOutCompleteCancel; /* seems not use now? */ - ULONG BulkInReq; - ULONG BulkInComplete; - ULONG BulkInCompleteFail; + unsigned long BulkOutReq; + unsigned long BulkOutComplete; + unsigned long BulkOutCompleteOther; + unsigned long BulkOutCompleteCancel; /* seems not use now? */ + unsigned long BulkInReq; + unsigned long BulkInComplete; + unsigned long BulkInCompleteFail; /*--- */ struct wificonf WIFItestbed; struct reordering_mpdu_pool mpdu_blk_pool; - ULONG OneSecondnonBEpackets; /* record non BE packets per second */ + unsigned long OneSecondnonBEpackets; /* record non BE packets per second */ #ifdef LINUX struct iw_statistics iw_stats; @@ -2124,25 +2124,25 @@ struct _RTMP_ADAPTER { struct net_device_stats stats; #endif /* LINUX // */ - ULONG TbttTickCount; + unsigned long TbttTickCount; #ifdef PCI_MSI_SUPPORT BOOLEAN HaveMsi; #endif /* PCI_MSI_SUPPORT // */ - UCHAR is_on; + u8 is_on; #define TIME_BASE (1000000/OS_HZ) #define TIME_ONE_SECOND (1000000/TIME_BASE) - UCHAR flg_be_adjust; - ULONG be_adjust_last_time; + u8 flg_be_adjust; + unsigned long be_adjust_last_time; - UINT8 FlgCtsEnabled; - UINT8 PM_FlgSuspend; + u8 FlgCtsEnabled; + u8 PM_FlgSuspend; #ifdef RT30xx #ifdef RTMP_EFUSE_SUPPORT BOOLEAN bUseEfuse; - UCHAR EEPROMImage[1024]; + u8 EEPROMImage[1024]; #endif /* RTMP_EFUSE_SUPPORT // */ #endif /* RT30xx // */ }; @@ -2171,10 +2171,10 @@ typedef struct _RX_BLK_ { PRXWI_STRUC pRxWI; PHEADER_802_11 pHeader; PNDIS_PACKET pRxPacket; - UCHAR *pData; - USHORT DataSize; - USHORT Flags; - UCHAR UserPriority; /* for calculate TKIP MIC using */ + u8 *pData; + u16 DataSize; + u16 Flags; + u8 UserPriority; /* for calculate TKIP MIC using */ } RX_BLK; #define RX_BLK_SET_FLAG(_pRxBlk, _flag) (_pRxBlk->Flags |= _flag) @@ -2212,11 +2212,11 @@ typedef struct _RX_BLK_ { /* Currently the sizeof(TX_BLK) is 148 bytes. */ typedef struct _TX_BLK_ { - UCHAR QueIdx; - UCHAR TxFrameType; /* Indicate the Transmission type of the all frames in one batch */ - UCHAR TotalFrameNum; /* Total frame number want to send-out in one batch */ - USHORT TotalFragNum; /* Total frame fragments required in one batch */ - USHORT TotalFrameLen; /* Total length of all frames want to send-out in one batch */ + u8 QueIdx; + u8 TxFrameType; /* Indicate the Transmission type of the all frames in one batch */ + u8 TotalFrameNum; /* Total frame number want to send-out in one batch */ + u16 TotalFragNum; /* Total frame fragments required in one batch */ + u16 TotalFrameLen; /* Total length of all frames want to send-out in one batch */ QUEUE_HEADER TxPacketList; MAC_TABLE_ENTRY *pMacEntry; /* NULL: packet with 802.11 RA field is multicast/broadcast address */ @@ -2224,29 +2224,29 @@ typedef struct _TX_BLK_ { /* Following structure used for the characteristics of a specific packet. */ PNDIS_PACKET pPacket; - PUCHAR pSrcBufHeader; /* Reference to the head of sk_buff->data */ - PUCHAR pSrcBufData; /* Reference to the sk_buff->data, will changed depends on hanlding progresss */ - UINT SrcBufLen; /* Length of packet payload which not including Layer 2 header */ - PUCHAR pExtraLlcSnapEncap; /* NULL means no extra LLC/SNAP is required */ - UCHAR HeaderBuf[128]; /* TempBuffer for TX_INFO + TX_WI + 802.11 Header + padding + AMSDU SubHeader + LLC/SNAP */ + u8 *pSrcBufHeader; /* Reference to the head of sk_buff->data */ + u8 *pSrcBufData; /* Reference to the sk_buff->data, will changed depends on hanlding progresss */ + u32 SrcBufLen; /* Length of packet payload which not including Layer 2 header */ + u8 *pExtraLlcSnapEncap; /* NULL means no extra LLC/SNAP is required */ + u8 HeaderBuf[128]; /* TempBuffer for TX_INFO + TX_WI + 802.11 Header + padding + AMSDU SubHeader + LLC/SNAP */ /*RT2870 2.1.0.0 uses only 80 bytes */ /*RT3070 2.1.1.0 uses only 96 bytes */ /*RT3090 2.1.0.0 uses only 96 bytes */ - UCHAR MpduHeaderLen; /* 802.11 header length NOT including the padding */ - UCHAR HdrPadLen; /* recording Header Padding Length; */ - UCHAR apidx; /* The interface associated to this packet */ - UCHAR Wcid; /* The MAC entry associated to this packet */ - UCHAR UserPriority; /* priority class of packet */ - UCHAR FrameGap; /* what kind of IFS this packet use */ - UCHAR MpduReqNum; /* number of fragments of this frame */ - UCHAR TxRate; /* TODO: Obsoleted? Should change to MCS? */ - UCHAR CipherAlg; /* cipher alogrithm */ + u8 MpduHeaderLen; /* 802.11 header length NOT including the padding */ + u8 HdrPadLen; /* recording Header Padding Length; */ + u8 apidx; /* The interface associated to this packet */ + u8 Wcid; /* The MAC entry associated to this packet */ + u8 UserPriority; /* priority class of packet */ + u8 FrameGap; /* what kind of IFS this packet use */ + u8 MpduReqNum; /* number of fragments of this frame */ + u8 TxRate; /* TODO: Obsoleted? Should change to MCS? */ + u8 CipherAlg; /* cipher alogrithm */ PCIPHER_KEY pKey; - USHORT Flags; /*See following definitions for detail. */ + u16 Flags; /*See following definitions for detail. */ /*YOU SHOULD NOT TOUCH IT! Following parameters are used for hardware-depended layer. */ - ULONG Priv; /* Hardware specific value saved in here. */ + unsigned long Priv; /* Hardware specific value saved in here. */ } TX_BLK, *PTX_BLK; #define fTX_bRtsRequired 0x0001 /* Indicate if need send RTS frame for protection. Not used in RT2860/RT2870. */ @@ -2266,9 +2266,9 @@ typedef struct _TX_BLK_ { /*************************************************************************** * Other static inline function definitions **************************************************************************/ -static inline VOID ConvertMulticastIP2MAC(IN PUCHAR pIpAddr, - IN PUCHAR * ppMacAddr, - IN UINT16 ProtoType) +static inline void ConvertMulticastIP2MAC(u8 *pIpAddr, + u8 ** ppMacAddr, + u16 ProtoType) { if (pIpAddr == NULL) return; @@ -2308,141 +2308,141 @@ char *GetBW(int BW); /* */ /* Private routines in rtmp_init.c */ /* */ -NDIS_STATUS RTMPAllocAdapterBlock(IN PVOID handle, +int RTMPAllocAdapterBlock(void *handle, OUT PRTMP_ADAPTER * ppAdapter); -NDIS_STATUS RTMPAllocTxRxRingMemory(IN PRTMP_ADAPTER pAd); +int RTMPAllocTxRxRingMemory(IN PRTMP_ADAPTER pAd); -VOID RTMPFreeAdapter(IN PRTMP_ADAPTER pAd); +void RTMPFreeAdapter(IN PRTMP_ADAPTER pAd); -NDIS_STATUS NICReadRegParameters(IN PRTMP_ADAPTER pAd, +int NICReadRegParameters(IN PRTMP_ADAPTER pAd, IN NDIS_HANDLE WrapperConfigurationContext); #ifdef RTMP_RF_RW_SUPPORT -VOID NICInitRFRegisters(IN PRTMP_ADAPTER pAd); +void NICInitRFRegisters(IN PRTMP_ADAPTER pAd); -VOID RtmpChipOpsRFHook(IN RTMP_ADAPTER * pAd); +void RtmpChipOpsRFHook(IN RTMP_ADAPTER * pAd); -NDIS_STATUS RT30xxWriteRFRegister(IN PRTMP_ADAPTER pAd, - IN UCHAR regID, IN UCHAR value); +int RT30xxWriteRFRegister(IN PRTMP_ADAPTER pAd, + u8 regID, u8 value); -NDIS_STATUS RT30xxReadRFRegister(IN PRTMP_ADAPTER pAd, - IN UCHAR regID, IN PUCHAR pValue); +int RT30xxReadRFRegister(IN PRTMP_ADAPTER pAd, + u8 regID, u8 *pValue); #endif /* RTMP_RF_RW_SUPPORT // */ -VOID NICReadEEPROMParameters(IN PRTMP_ADAPTER pAd, IN PUCHAR mac_addr); +void NICReadEEPROMParameters(IN PRTMP_ADAPTER pAd, u8 *mac_addr); -VOID NICInitAsicFromEEPROM(IN PRTMP_ADAPTER pAd); +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 NICInitializeAsic(IN PRTMP_ADAPTER pAd, IN BOOLEAN bHardReset); +int NICInitializeAsic(IN PRTMP_ADAPTER pAd, IN BOOLEAN bHardReset); -VOID NICIssueReset(IN PRTMP_ADAPTER pAd); +void NICIssueReset(IN PRTMP_ADAPTER pAd); -VOID RTMPRingCleanUp(IN PRTMP_ADAPTER pAd, IN UCHAR RingType); +void RTMPRingCleanUp(IN PRTMP_ADAPTER pAd, u8 RingType); -VOID UserCfgInit(IN PRTMP_ADAPTER pAd); +void UserCfgInit(IN PRTMP_ADAPTER pAd); -VOID NICResetFromError(IN PRTMP_ADAPTER pAd); +void NICResetFromError(IN PRTMP_ADAPTER pAd); -NDIS_STATUS NICLoadFirmware(IN PRTMP_ADAPTER pAd); +int NICLoadFirmware(IN PRTMP_ADAPTER pAd); -VOID NICEraseFirmware(IN PRTMP_ADAPTER pAd); +void NICEraseFirmware(IN PRTMP_ADAPTER pAd); -NDIS_STATUS NICLoadRateSwitchingParams(IN PRTMP_ADAPTER pAd); +int NICLoadRateSwitchingParams(IN PRTMP_ADAPTER pAd); BOOLEAN NICCheckForHang(IN PRTMP_ADAPTER pAd); -VOID NICUpdateFifoStaCounters(IN PRTMP_ADAPTER pAd); +void NICUpdateFifoStaCounters(IN PRTMP_ADAPTER pAd); -VOID NICUpdateRawCounters(IN PRTMP_ADAPTER pAd); +void NICUpdateRawCounters(IN PRTMP_ADAPTER pAd); -VOID RTMPZeroMemory(IN PVOID pSrc, IN ULONG Length); +void RTMPZeroMemory(void *pSrc, unsigned long Length); -ULONG RTMPCompareMemory(IN PVOID pSrc1, IN PVOID pSrc2, IN ULONG Length); +unsigned long RTMPCompareMemory(void *pSrc1, void *pSrc2, unsigned long Length); -VOID RTMPMoveMemory(OUT PVOID pDest, IN PVOID pSrc, IN ULONG Length); +void RTMPMoveMemory(void *pDest, void *pSrc, unsigned long Length); -VOID AtoH(PSTRING src, PUCHAR dest, int destlen); +void AtoH(char *src, u8 *dest, int destlen); -UCHAR BtoH(char ch); +u8 BtoH(char ch); -VOID RTMPPatchMacBbpBug(IN PRTMP_ADAPTER pAd); +void RTMPPatchMacBbpBug(IN PRTMP_ADAPTER pAd); -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); -VOID RTMPSetTimer(IN PRALINK_TIMER_STRUCT pTimer, IN ULONG Value); +void RTMPSetTimer(IN PRALINK_TIMER_STRUCT pTimer, unsigned long Value); -VOID RTMPModTimer(IN PRALINK_TIMER_STRUCT pTimer, IN ULONG Value); +void RTMPModTimer(IN PRALINK_TIMER_STRUCT pTimer, unsigned long Value); -VOID RTMPCancelTimer(IN PRALINK_TIMER_STRUCT pTimer, OUT BOOLEAN * pCancelled); +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); -VOID RTMPSetSignalLED(IN PRTMP_ADAPTER pAd, IN NDIS_802_11_RSSI Dbm); +void RTMPSetSignalLED(IN PRTMP_ADAPTER pAd, IN NDIS_802_11_RSSI Dbm); -VOID RTMPEnableRxTx(IN PRTMP_ADAPTER pAd); +void RTMPEnableRxTx(IN PRTMP_ADAPTER pAd); /* */ /* prototype in action.c */ /* */ -VOID ActionStateMachineInit(IN PRTMP_ADAPTER pAd, +void ActionStateMachineInit(IN PRTMP_ADAPTER pAd, IN STATE_MACHINE * S, OUT STATE_MACHINE_FUNC Trans[]); -VOID MlmeADDBAAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem); +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); -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); -VOID MlmeQOSAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem); +void MlmeQOSAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem); -VOID PeerAddBAReqAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem); +void PeerAddBAReqAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem); -VOID PeerAddBARspAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem); +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); -VOID PeerBAAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem); +void PeerBAAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem); -VOID SendPSMPAction(IN PRTMP_ADAPTER pAd, IN UCHAR Wcid, IN UCHAR Psmp); +void SendPSMPAction(IN PRTMP_ADAPTER pAd, u8 Wcid, u8 Psmp); -VOID PeerRMAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem); +void PeerRMAction(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); -VOID PeerHTAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem); +void PeerHTAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem); -VOID PeerQOSAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem); +void PeerQOSAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem); -VOID RECBATimerTimeout(IN PVOID SystemSpecific1, - IN PVOID FunctionContext, - IN PVOID SystemSpecific2, IN PVOID SystemSpecific3); +void RECBATimerTimeout(void *SystemSpecific1, + void *FunctionContext, + void *SystemSpecific2, void *SystemSpecific3); -VOID ORIBATimerTimeout(IN PRTMP_ADAPTER pAd); +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); -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); -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); -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); 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); /* */ /* Private routines in rtmp_data.c */ @@ -2450,139 +2450,139 @@ BOOLEAN CntlEnqueueForRecv(IN PRTMP_ADAPTER pAd, BOOLEAN RTMPHandleRxDoneInterrupt(IN PRTMP_ADAPTER pAd); BOOLEAN RTMPHandleTxRingDmaDoneInterrupt(IN PRTMP_ADAPTER pAd, - IN INT_SOURCE_CSR_STRUC TxRingBitmap); + INT_SOURCE_CSR_STRUC TxRingBitmap); -VOID RTMPHandleMgmtRingDmaDoneInterrupt(IN PRTMP_ADAPTER pAd); +void RTMPHandleMgmtRingDmaDoneInterrupt(IN PRTMP_ADAPTER pAd); -VOID RTMPHandleTBTTInterrupt(IN PRTMP_ADAPTER pAd); +void RTMPHandleTBTTInterrupt(IN PRTMP_ADAPTER pAd); -VOID RTMPHandlePreTBTTInterrupt(IN PRTMP_ADAPTER pAd); +void RTMPHandlePreTBTTInterrupt(IN PRTMP_ADAPTER pAd); void RTMPHandleTwakeupInterrupt(IN PRTMP_ADAPTER pAd); -VOID RTMPHandleRxCoherentInterrupt(IN PRTMP_ADAPTER pAd); +void RTMPHandleRxCoherentInterrupt(IN PRTMP_ADAPTER pAd); BOOLEAN TxFrameIsAggregatible(IN PRTMP_ADAPTER pAd, - IN PUCHAR pPrevAddr1, IN PUCHAR p8023hdr); + u8 *pPrevAddr1, u8 *p8023hdr); BOOLEAN PeerIsAggreOn(IN PRTMP_ADAPTER pAd, - IN ULONG TxRate, IN PMAC_TABLE_ENTRY pMacEntry); + unsigned long TxRate, IN PMAC_TABLE_ENTRY pMacEntry); -NDIS_STATUS Sniff2BytesFromNdisBuffer(IN PNDIS_BUFFER pFirstBuffer, - IN UCHAR DesiredOffset, - OUT PUCHAR pByte0, OUT PUCHAR pByte1); +int Sniff2BytesFromNdisBuffer(IN PNDIS_BUFFER pFirstBuffer, + u8 DesiredOffset, + u8 *pByte0, u8 *pByte1); -NDIS_STATUS STASendPacket(IN PRTMP_ADAPTER pAd, IN PNDIS_PACKET pPacket); +int STASendPacket(IN PRTMP_ADAPTER pAd, IN PNDIS_PACKET pPacket); -VOID STASendPackets(IN NDIS_HANDLE MiniportAdapterContext, - IN PPNDIS_PACKET ppPacketArray, IN UINT NumberOfPackets); +void STASendPackets(IN NDIS_HANDLE MiniportAdapterContext, + IN PPNDIS_PACKET ppPacketArray, u32 NumberOfPackets); -VOID RTMPDeQueuePacket(IN PRTMP_ADAPTER pAd, +void RTMPDeQueuePacket(IN PRTMP_ADAPTER pAd, IN BOOLEAN bIntContext, - IN UCHAR QueIdx, IN UCHAR Max_Tx_Packets); + u8 QueIdx, u8 Max_Tx_Packets); -NDIS_STATUS RTMPHardTransmit(IN PRTMP_ADAPTER pAd, +int RTMPHardTransmit(IN PRTMP_ADAPTER pAd, IN PNDIS_PACKET pPacket, - IN UCHAR QueIdx, OUT PULONG pFreeTXDLeft); + u8 QueIdx, unsigned long *pFreeTXDLeft); -NDIS_STATUS STAHardTransmit(IN PRTMP_ADAPTER pAd, - IN TX_BLK * pTxBlk, IN UCHAR QueIdx); +int STAHardTransmit(IN PRTMP_ADAPTER pAd, + IN TX_BLK * pTxBlk, u8 QueIdx); -VOID STARxEAPOLFrameIndicate(IN PRTMP_ADAPTER pAd, +void STARxEAPOLFrameIndicate(IN PRTMP_ADAPTER pAd, IN MAC_TABLE_ENTRY * pEntry, - IN RX_BLK * pRxBlk, IN UCHAR FromWhichBSSID); + IN RX_BLK * pRxBlk, u8 FromWhichBSSID); -NDIS_STATUS RTMPFreeTXDRequest(IN PRTMP_ADAPTER pAd, - IN UCHAR RingType, - IN UCHAR NumberRequired, IN PUCHAR FreeNumberIs); +int RTMPFreeTXDRequest(IN PRTMP_ADAPTER pAd, + u8 RingType, + u8 NumberRequired, u8 *FreeNumberIs); -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); -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); #ifdef RTMP_MAC_PCI -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); -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); -VOID RTMPWriteTxDescriptor(IN PRTMP_ADAPTER pAd, - IN PTXD_STRUC pTxD, IN BOOLEAN bWIV, IN UCHAR QSEL); +void RTMPWriteTxDescriptor(IN PRTMP_ADAPTER pAd, + IN PTXD_STRUC pTxD, IN BOOLEAN bWIV, u8 QSEL); #endif /* RTMP_MAC_PCI // */ -USHORT RTMPCalcDuration(IN PRTMP_ADAPTER pAd, IN UCHAR Rate, IN ULONG Size); +u16 RTMPCalcDuration(IN PRTMP_ADAPTER pAd, u8 Rate, unsigned long Size); -VOID RTMPWriteTxWI(IN PRTMP_ADAPTER pAd, IN PTXWI_STRUC pTxWI, 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 pTxWI, 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); -VOID RTMPWriteTxWI_Data(IN PRTMP_ADAPTER pAd, +void RTMPWriteTxWI_Data(IN PRTMP_ADAPTER pAd, IN OUT PTXWI_STRUC pTxWI, IN TX_BLK * pTxBlk); -VOID RTMPWriteTxWI_Cache(IN PRTMP_ADAPTER pAd, +void RTMPWriteTxWI_Cache(IN PRTMP_ADAPTER pAd, IN OUT PTXWI_STRUC pTxWI, IN TX_BLK * pTxBlk); -VOID RTMPSuspendMsduTransmission(IN PRTMP_ADAPTER pAd); +void RTMPSuspendMsduTransmission(IN PRTMP_ADAPTER pAd); -VOID RTMPResumeMsduTransmission(IN PRTMP_ADAPTER pAd); +void RTMPResumeMsduTransmission(IN PRTMP_ADAPTER pAd); -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); /*+++mark by shiang, now this function merge to MiniportMMRequest() */ /*---mark by shiang, now this function merge to MiniportMMRequest() */ -VOID RTMPSendNullFrame(IN PRTMP_ADAPTER pAd, - IN UCHAR TxRate, IN BOOLEAN bQosNull); +void RTMPSendNullFrame(IN PRTMP_ADAPTER pAd, + u8 TxRate, IN BOOLEAN bQosNull); -VOID RTMPSendDisassociationFrame(IN PRTMP_ADAPTER pAd); +void RTMPSendDisassociationFrame(IN PRTMP_ADAPTER pAd); -VOID RTMPSendRTSFrame(IN PRTMP_ADAPTER pAd, - IN PUCHAR pDA, +void RTMPSendRTSFrame(IN PRTMP_ADAPTER pAd, + u8 *pDA, IN unsigned int NextMpduSize, - IN UCHAR TxRate, - IN UCHAR RTSRate, - IN USHORT AckDuration, - IN UCHAR QueIdx, IN UCHAR FrameGap); + u8 TxRate, + u8 RTSRate, + u16 AckDuration, + u8 QueIdx, u8 FrameGap); -PQUEUE_HEADER RTMPCheckTxSwQueue(IN PRTMP_ADAPTER pAd, OUT UCHAR * QueIdx); +PQUEUE_HEADER RTMPCheckTxSwQueue(IN PRTMP_ADAPTER pAd, u8 * QueIdx); -VOID RTMPReportMicError(IN PRTMP_ADAPTER pAd, IN PCIPHER_KEY pWpaKey); +void RTMPReportMicError(IN PRTMP_ADAPTER pAd, IN PCIPHER_KEY pWpaKey); -VOID WpaMicFailureReportFrame(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem); +void WpaMicFailureReportFrame(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem); -VOID WpaDisassocApAndBlockAssoc(IN PVOID SystemSpecific1, - IN PVOID FunctionContext, - IN PVOID SystemSpecific2, - IN PVOID SystemSpecific3); +void WpaDisassocApAndBlockAssoc(void *SystemSpecific1, + void *FunctionContext, + void *SystemSpecific2, + void *SystemSpecific3); -VOID WpaStaPairwiseKeySetting(IN PRTMP_ADAPTER pAd); +void WpaStaPairwiseKeySetting(IN PRTMP_ADAPTER pAd); -VOID WpaStaGroupKeySetting(IN PRTMP_ADAPTER pAd); +void WpaStaGroupKeySetting(IN PRTMP_ADAPTER pAd); -NDIS_STATUS RTMPCloneNdisPacket(IN PRTMP_ADAPTER pAd, +int RTMPCloneNdisPacket(IN PRTMP_ADAPTER pAd, IN BOOLEAN pInsAMSDUHdr, IN PNDIS_PACKET pInPacket, OUT PNDIS_PACKET * ppOutPacket); -NDIS_STATUS RTMPAllocateNdisPacket(IN PRTMP_ADAPTER pAd, +int RTMPAllocateNdisPacket(IN PRTMP_ADAPTER pAd, IN PNDIS_PACKET * pPacket, - IN PUCHAR pHeader, - IN UINT HeaderLen, - IN PUCHAR pData, IN UINT DataLen); + u8 *pHeader, + u32 HeaderLen, + u8 *pData, u32 DataLen); -VOID RTMPFreeNdisPacket(IN PRTMP_ADAPTER pAd, IN PNDIS_PACKET pPacket); +void RTMPFreeNdisPacket(IN PRTMP_ADAPTER pAd, IN PNDIS_PACKET pPacket); -BOOLEAN RTMPFreeTXDUponTxDmaDone(IN PRTMP_ADAPTER pAd, IN UCHAR QueIdx); +BOOLEAN RTMPFreeTXDUponTxDmaDone(IN PRTMP_ADAPTER pAd, u8 QueIdx); BOOLEAN RTMPCheckDHCPFrame(IN PRTMP_ADAPTER pAd, IN PNDIS_PACKET pPacket); @@ -2591,33 +2591,33 @@ BOOLEAN RTMPCheckEtherType(IN PRTMP_ADAPTER pAd, IN PNDIS_PACKET pPacket); /* */ /* Private routines in rtmp_wep.c */ /* */ -VOID RTMPInitWepEngine(IN PRTMP_ADAPTER pAd, - IN PUCHAR pKey, - IN UCHAR KeyId, IN UCHAR KeyLen, IN PUCHAR pDest); +void RTMPInitWepEngine(IN PRTMP_ADAPTER pAd, + u8 *pKey, + u8 KeyId, u8 KeyLen, u8 *pDest); -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); 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); -VOID RTMPSetICV(IN PRTMP_ADAPTER pAd, IN PUCHAR pDest); +void RTMPSetICV(IN PRTMP_ADAPTER pAd, u8 *pDest); -VOID ARCFOUR_INIT(IN PARCFOURCONTEXT Ctx, IN PUCHAR pKey, IN UINT KeyLen); +void ARCFOUR_INIT(IN PARCFOURCONTEXT Ctx, u8 *pKey, u32 KeyLen); -UCHAR ARCFOUR_BYTE(IN PARCFOURCONTEXT Ctx); +u8 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); -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); -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 RTMP_CALC_FCS32(IN UINT Fcs, IN PUCHAR Cp, IN INT Len); +u32 RTMP_CALC_FCS32(u32 Fcs, u8 *Cp, int Len); /* */ /* MLME routines */ @@ -2625,190 +2625,190 @@ UINT RTMP_CALC_FCS32(IN UINT Fcs, IN PUCHAR Cp, IN INT Len); /* Asic/RF/BBP related functions */ -VOID AsicAdjustTxPower(IN PRTMP_ADAPTER pAd); +void AsicAdjustTxPower(IN PRTMP_ADAPTER pAd); -VOID AsicUpdateProtect(IN PRTMP_ADAPTER pAd, - IN USHORT OperaionMode, - IN UCHAR SetMask, +void AsicUpdateProtect(IN PRTMP_ADAPTER pAd, + u16 OperaionMode, + u8 SetMask, IN BOOLEAN bDisableBGProtect, IN BOOLEAN bNonGFExist); -VOID AsicSwitchChannel(IN PRTMP_ADAPTER pAd, - IN UCHAR Channel, IN BOOLEAN bScan); +void AsicSwitchChannel(IN PRTMP_ADAPTER pAd, + u8 Channel, IN BOOLEAN bScan); -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); -VOID AsicResetBBPAgent(IN PRTMP_ADAPTER pAd); +void AsicResetBBPAgent(IN PRTMP_ADAPTER pAd); -VOID AsicSleepThenAutoWakeup(IN PRTMP_ADAPTER pAd, - IN USHORT TbttNumToNextWakeUp); +void AsicSleepThenAutoWakeup(IN PRTMP_ADAPTER pAd, + u16 TbttNumToNextWakeUp); -VOID AsicForceSleep(IN PRTMP_ADAPTER pAd); +void AsicForceSleep(IN PRTMP_ADAPTER pAd); -VOID AsicForceWakeup(IN PRTMP_ADAPTER pAd, IN BOOLEAN bFromTx); +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); -VOID AsicSetMcastWC(IN PRTMP_ADAPTER pAd); +void AsicSetMcastWC(IN PRTMP_ADAPTER pAd); -VOID AsicDelWcidTab(IN PRTMP_ADAPTER pAd, IN UCHAR Wcid); +void AsicDelWcidTab(IN PRTMP_ADAPTER pAd, u8 Wcid); -VOID AsicEnableRDG(IN PRTMP_ADAPTER pAd); +void AsicEnableRDG(IN PRTMP_ADAPTER pAd); -VOID AsicDisableRDG(IN PRTMP_ADAPTER pAd); +void AsicDisableRDG(IN PRTMP_ADAPTER pAd); -VOID AsicDisableSync(IN PRTMP_ADAPTER pAd); +void AsicDisableSync(IN PRTMP_ADAPTER pAd); -VOID AsicEnableBssSync(IN PRTMP_ADAPTER pAd); +void AsicEnableBssSync(IN PRTMP_ADAPTER pAd); -VOID AsicEnableIbssSync(IN PRTMP_ADAPTER pAd); +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); -VOID AsicSetSlotTime(IN PRTMP_ADAPTER pAd, IN BOOLEAN bUseShortSlotTime); +void AsicSetSlotTime(IN PRTMP_ADAPTER pAd, IN BOOLEAN bUseShortSlotTime); -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); -VOID AsicRemoveSharedKeyEntry(IN PRTMP_ADAPTER pAd, - IN UCHAR BssIndex, IN UCHAR KeyIdx); +void AsicRemoveSharedKeyEntry(IN PRTMP_ADAPTER pAd, + u8 BssIndex, u8 KeyIdx); -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); -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); -VOID AsicUpdateRxWCIDTable(IN PRTMP_ADAPTER pAd, - IN USHORT WCID, IN PUCHAR pAddr); +void AsicUpdateRxWCIDTable(IN PRTMP_ADAPTER pAd, + u16 WCID, u8 *pAddr); -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); -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); -VOID AsicRemovePairwiseKeyEntry(IN PRTMP_ADAPTER pAd, - IN UCHAR BssIdx, IN UCHAR Wcid); +void AsicRemovePairwiseKeyEntry(IN PRTMP_ADAPTER pAd, + u8 BssIdx, u8 Wcid); 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); #ifdef RTMP_MAC_PCI -BOOLEAN AsicCheckCommanOk(IN PRTMP_ADAPTER pAd, IN UCHAR Command); +BOOLEAN AsicCheckCommanOk(IN PRTMP_ADAPTER pAd, u8 Command); #endif /* RTMP_MAC_PCI // */ -VOID MacAddrRandomBssid(IN PRTMP_ADAPTER pAd, OUT PUCHAR pAddr); +void MacAddrRandomBssid(IN PRTMP_ADAPTER pAd, u8 *pAddr); -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); -VOID MlmeRadioOff(IN PRTMP_ADAPTER pAd); +void MlmeRadioOff(IN PRTMP_ADAPTER pAd); -VOID MlmeRadioOn(IN PRTMP_ADAPTER pAd); +void MlmeRadioOn(IN PRTMP_ADAPTER pAd); -VOID BssTableInit(IN BSS_TABLE * Tab); +void BssTableInit(IN BSS_TABLE * Tab); -VOID BATableInit(IN PRTMP_ADAPTER pAd, IN BA_TABLE * Tab); +void BATableInit(IN PRTMP_ADAPTER pAd, IN BA_TABLE * Tab); -ULONG BssTableSearch(IN BSS_TABLE * Tab, IN PUCHAR pBssid, IN UCHAR Channel); +unsigned long BssTableSearch(IN BSS_TABLE * Tab, u8 *pBssid, u8 Channel); -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); -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); -ULONG BssSsidTableSearchBySSID(IN BSS_TABLE * Tab, - IN PUCHAR pSsid, IN UCHAR SsidLen); +unsigned long BssSsidTableSearchBySSID(IN BSS_TABLE * Tab, + u8 *pSsid, u8 SsidLen); -VOID BssTableDeleteEntry(IN OUT PBSS_TABLE pTab, - IN PUCHAR pBssid, IN UCHAR Channel); +void BssTableDeleteEntry(IN OUT PBSS_TABLE pTab, + u8 *pBssid, u8 Channel); -VOID BATableDeleteORIEntry(IN OUT PRTMP_ADAPTER pAd, +void BATableDeleteORIEntry(IN OUT PRTMP_ADAPTER pAd, IN BA_ORI_ENTRY * pBAORIEntry); -VOID BssEntrySet(IN PRTMP_ADAPTER pAd, OUT PBSS_ENTRY pBss, IN PUCHAR pBssid, IN CHAR Ssid[], IN UCHAR SsidLen, IN UCHAR BssType, IN USHORT BeaconPeriod, IN PCF_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 Channel, - IN CHAR Rssi, +void BssEntrySet(IN PRTMP_ADAPTER pAd, OUT PBSS_ENTRY pBss, u8 *pBssid, char Ssid[], u8 SsidLen, u8 BssType, u16 BeaconPeriod, IN PCF_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 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); - -ULONG BssTableSetEntry(IN PRTMP_ADAPTER pAd, OUT PBSS_TABLE pTab, 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 Channel, - IN CHAR Rssi, + u16 LengthVIE, IN PNDIS_802_11_VARIABLE_IEs pVIE); + +unsigned long BssTableSetEntry(IN PRTMP_ADAPTER pAd, OUT PBSS_TABLE pTab, 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 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); -VOID BATableInsertEntry(IN PRTMP_ADAPTER pAd, - IN USHORT Aid, - IN USHORT TimeOutValue, - IN USHORT StartingSeq, - IN UCHAR TID, - IN UCHAR BAWinSize, - IN UCHAR OriginatorStatus, IN BOOLEAN IsRecipient); +void BATableInsertEntry(IN PRTMP_ADAPTER pAd, + u16 Aid, + u16 TimeOutValue, + u16 StartingSeq, + u8 TID, + u8 BAWinSize, + u8 OriginatorStatus, IN BOOLEAN IsRecipient); -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); -VOID BssTableSortByRssi(IN OUT BSS_TABLE * OutTab); +void BssTableSortByRssi(IN OUT BSS_TABLE * OutTab); -VOID BssCipherParse(IN OUT PBSS_ENTRY pBss); +void BssCipherParse(IN OUT PBSS_ENTRY pBss); -NDIS_STATUS MlmeQueueInit(IN MLME_QUEUE * Queue); +int MlmeQueueInit(IN MLME_QUEUE * Queue); -VOID MlmeQueueDestroy(IN MLME_QUEUE * Queue); +void MlmeQueueDestroy(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); 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 PVOID 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); BOOLEAN MlmeDequeue(IN MLME_QUEUE * Queue, OUT MLME_QUEUE_ELEM ** Elem); -VOID MlmeRestartStateMachine(IN PRTMP_ADAPTER pAd); +void MlmeRestartStateMachine(IN PRTMP_ADAPTER pAd); BOOLEAN MlmeQueueEmpty(IN MLME_QUEUE * Queue); @@ -2816,121 +2816,121 @@ BOOLEAN MlmeQueueFull(IN MLME_QUEUE * Queue); BOOLEAN MsgTypeSubst(IN PRTMP_ADAPTER pAd, IN PFRAME_802_11 pFrame, - OUT INT * Machine, OUT INT * MsgType); + int * Machine, int * MsgType); -VOID StateMachineInit(IN STATE_MACHINE * Sm, +void StateMachineInit(IN STATE_MACHINE * Sm, 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); -VOID StateMachineSetAction(IN STATE_MACHINE * S, - IN ULONG St, ULONG Msg, IN STATE_MACHINE_FUNC F); +void StateMachineSetAction(IN STATE_MACHINE * S, + unsigned long St, unsigned long Msg, IN STATE_MACHINE_FUNC F); -VOID StateMachinePerformAction(IN PRTMP_ADAPTER pAd, +void StateMachinePerformAction(IN PRTMP_ADAPTER pAd, IN STATE_MACHINE * S, IN MLME_QUEUE_ELEM * Elem); -VOID Drop(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem); +void Drop(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem); -VOID AssocStateMachineInit(IN PRTMP_ADAPTER pAd, +void AssocStateMachineInit(IN PRTMP_ADAPTER pAd, IN STATE_MACHINE * Sm, OUT STATE_MACHINE_FUNC Trans[]); -VOID ReassocTimeout(IN PVOID SystemSpecific1, - IN PVOID FunctionContext, - IN PVOID SystemSpecific2, IN PVOID SystemSpecific3); +void ReassocTimeout(void *SystemSpecific1, + void *FunctionContext, + void *SystemSpecific2, void *SystemSpecific3); -VOID AssocTimeout(IN PVOID SystemSpecific1, - IN PVOID FunctionContext, - IN PVOID SystemSpecific2, IN PVOID SystemSpecific3); +void AssocTimeout(void *SystemSpecific1, + void *FunctionContext, + void *SystemSpecific2, void *SystemSpecific3); -VOID DisassocTimeout(IN PVOID SystemSpecific1, - IN PVOID FunctionContext, - IN PVOID SystemSpecific2, IN PVOID SystemSpecific3); +void DisassocTimeout(void *SystemSpecific1, + void *FunctionContext, + void *SystemSpecific2, void *SystemSpecific3); /*---------------------------------------------- */ -VOID MlmeAssocReqAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem); +void MlmeAssocReqAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem); -VOID MlmeReassocReqAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem); +void MlmeReassocReqAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem); -VOID MlmeDisassocReqAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem); +void MlmeDisassocReqAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem); -VOID PeerAssocRspAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem); +void PeerAssocRspAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem); -VOID PeerReassocRspAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem); +void PeerReassocRspAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem); -VOID PeerDisassocAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem); +void PeerDisassocAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem); -VOID DisassocTimeoutAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem); +void DisassocTimeoutAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem); -VOID AssocTimeoutAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem); +void AssocTimeoutAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem); -VOID ReassocTimeoutAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem); +void ReassocTimeoutAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem); -VOID Cls3errAction(IN PRTMP_ADAPTER pAd, IN PUCHAR pAddr); +void Cls3errAction(IN PRTMP_ADAPTER pAd, u8 *pAddr); -VOID InvalidStateWhenAssoc(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem); +void InvalidStateWhenAssoc(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem); -VOID InvalidStateWhenReassoc(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem); +void InvalidStateWhenReassoc(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem); -VOID InvalidStateWhenDisassociate(IN PRTMP_ADAPTER pAd, +void InvalidStateWhenDisassociate(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem); #ifdef RTMP_MAC_USB -VOID MlmeCntlConfirm(IN PRTMP_ADAPTER pAd, IN ULONG MsgType, IN USHORT Msg); +void MlmeCntlConfirm(IN PRTMP_ADAPTER pAd, unsigned long MsgType, u16 Msg); #endif /* RTMP_MAC_USB // */ -VOID ComposePsPoll(IN PRTMP_ADAPTER pAd); +void ComposePsPoll(IN PRTMP_ADAPTER pAd); -VOID ComposeNullFrame(IN PRTMP_ADAPTER pAd); +void ComposeNullFrame(IN PRTMP_ADAPTER pAd); -VOID AssocPostProc(IN PRTMP_ADAPTER pAd, - IN PUCHAR pAddr2, - IN USHORT CapabilityInfo, - IN USHORT Aid, - IN UCHAR SupRate[], - IN UCHAR SupRateLen, - IN UCHAR ExtRate[], - IN UCHAR ExtRateLen, +void AssocPostProc(IN PRTMP_ADAPTER pAd, + u8 *pAddr2, + u16 CapabilityInfo, + u16 Aid, + u8 SupRate[], + u8 SupRateLen, + u8 ExtRate[], + u8 ExtRateLen, IN PEDCA_PARM pEdcaParm, IN HT_CAPABILITY_IE * pHtCapability, - IN UCHAR HtCapabilityLen, IN ADD_HT_INFO_IE * pAddHtInfo); + u8 HtCapabilityLen, IN ADD_HT_INFO_IE * pAddHtInfo); -VOID AuthStateMachineInit(IN PRTMP_ADAPTER pAd, +void AuthStateMachineInit(IN PRTMP_ADAPTER pAd, IN PSTATE_MACHINE sm, OUT STATE_MACHINE_FUNC Trans[]); -VOID AuthTimeout(IN PVOID SystemSpecific1, - IN PVOID FunctionContext, - IN PVOID SystemSpecific2, IN PVOID SystemSpecific3); +void AuthTimeout(void *SystemSpecific1, + void *FunctionContext, + void *SystemSpecific2, void *SystemSpecific3); -VOID MlmeAuthReqAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem); +void MlmeAuthReqAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem); -VOID PeerAuthRspAtSeq2Action(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem); +void PeerAuthRspAtSeq2Action(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem); -VOID PeerAuthRspAtSeq4Action(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem); +void PeerAuthRspAtSeq4Action(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem); -VOID AuthTimeoutAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem); +void AuthTimeoutAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem); -VOID Cls2errAction(IN PRTMP_ADAPTER pAd, IN PUCHAR pAddr); +void Cls2errAction(IN PRTMP_ADAPTER pAd, u8 *pAddr); -VOID MlmeDeauthReqAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem); +void MlmeDeauthReqAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem); -VOID InvalidStateWhenAuth(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem); +void InvalidStateWhenAuth(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem); /*============================================= */ -VOID AuthRspStateMachineInit(IN PRTMP_ADAPTER pAd, +void AuthRspStateMachineInit(IN PRTMP_ADAPTER pAd, IN PSTATE_MACHINE Sm, IN STATE_MACHINE_FUNC Trans[]); -VOID PeerDeauthAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem); +void PeerDeauthAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem); -VOID PeerAuthSimpleRspGenAndSend(IN PRTMP_ADAPTER pAd, +void PeerAuthSimpleRspGenAndSend(IN PRTMP_ADAPTER pAd, IN PHEADER_802_11 pHdr80211, - IN USHORT Alg, - IN USHORT Seq, - IN USHORT Reason, IN USHORT Status); + u16 Alg, + u16 Seq, + u16 Reason, u16 Status); /* */ /* Private routines in dls.c */ @@ -2938,691 +2938,691 @@ VOID PeerAuthSimpleRspGenAndSend(IN PRTMP_ADAPTER pAd, /*======================================== */ -VOID SyncStateMachineInit(IN PRTMP_ADAPTER pAd, +void SyncStateMachineInit(IN PRTMP_ADAPTER pAd, IN STATE_MACHINE * Sm, OUT STATE_MACHINE_FUNC Trans[]); -VOID BeaconTimeout(IN PVOID SystemSpecific1, - IN PVOID FunctionContext, - IN PVOID SystemSpecific2, IN PVOID SystemSpecific3); +void BeaconTimeout(void *SystemSpecific1, + void *FunctionContext, + void *SystemSpecific2, void *SystemSpecific3); -VOID ScanTimeout(IN PVOID SystemSpecific1, - IN PVOID FunctionContext, - IN PVOID SystemSpecific2, IN PVOID SystemSpecific3); +void ScanTimeout(void *SystemSpecific1, + void *FunctionContext, + void *SystemSpecific2, void *SystemSpecific3); -VOID InvalidStateWhenScan(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem); +void InvalidStateWhenScan(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem); -VOID InvalidStateWhenJoin(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem); +void InvalidStateWhenJoin(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem); -VOID InvalidStateWhenStart(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem); +void InvalidStateWhenStart(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem); -VOID EnqueueProbeRequest(IN PRTMP_ADAPTER pAd); +void EnqueueProbeRequest(IN PRTMP_ADAPTER pAd); BOOLEAN ScanRunning(IN PRTMP_ADAPTER pAd); /*========================================= */ -VOID MlmeCntlInit(IN PRTMP_ADAPTER pAd, +void MlmeCntlInit(IN PRTMP_ADAPTER pAd, IN STATE_MACHINE * S, OUT STATE_MACHINE_FUNC Trans[]); -VOID MlmeCntlMachinePerformAction(IN PRTMP_ADAPTER pAd, +void MlmeCntlMachinePerformAction(IN PRTMP_ADAPTER pAd, IN STATE_MACHINE * S, IN MLME_QUEUE_ELEM * Elem); -VOID CntlIdleProc(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem); +void CntlIdleProc(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem); -VOID CntlOidScanProc(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem); +void CntlOidScanProc(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem); -VOID CntlOidSsidProc(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem); +void CntlOidSsidProc(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem); -VOID CntlOidRTBssidProc(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem); +void CntlOidRTBssidProc(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem); -VOID CntlMlmeRoamingProc(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem); +void CntlMlmeRoamingProc(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem); -VOID CntlWaitDisassocProc(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem); +void CntlWaitDisassocProc(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem); -VOID CntlWaitJoinProc(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem); +void CntlWaitJoinProc(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem); -VOID CntlWaitReassocProc(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem); +void CntlWaitReassocProc(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem); -VOID CntlWaitStartProc(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem); +void CntlWaitStartProc(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem); -VOID CntlWaitAuthProc(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem); +void CntlWaitAuthProc(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem); -VOID CntlWaitAuthProc2(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem); +void CntlWaitAuthProc2(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem); -VOID CntlWaitAssocProc(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem); +void CntlWaitAssocProc(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem); -VOID LinkUp(IN PRTMP_ADAPTER pAd, IN UCHAR BssType); +void LinkUp(IN PRTMP_ADAPTER pAd, u8 BssType); -VOID LinkDown(IN PRTMP_ADAPTER pAd, IN BOOLEAN IsReqFromAP); +void LinkDown(IN PRTMP_ADAPTER pAd, IN BOOLEAN IsReqFromAP); -VOID IterateOnBssTab(IN PRTMP_ADAPTER pAd); +void IterateOnBssTab(IN PRTMP_ADAPTER pAd); -VOID IterateOnBssTab2(IN PRTMP_ADAPTER pAd);; +void IterateOnBssTab2(IN PRTMP_ADAPTER pAd);; -VOID JoinParmFill(IN PRTMP_ADAPTER pAd, - IN OUT MLME_JOIN_REQ_STRUCT * JoinReq, IN ULONG BssIdx); +void JoinParmFill(IN PRTMP_ADAPTER pAd, + IN OUT MLME_JOIN_REQ_STRUCT * JoinReq, unsigned long BssIdx); -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); -VOID ScanParmFill(IN PRTMP_ADAPTER pAd, +void ScanParmFill(IN PRTMP_ADAPTER pAd, IN OUT MLME_SCAN_REQ_STRUCT * ScanReq, - IN STRING Ssid[], - IN UCHAR SsidLen, IN UCHAR BssType, IN UCHAR ScanType); + char Ssid[], + u8 SsidLen, u8 BssType, u8 ScanType); -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); -VOID StartParmFill(IN PRTMP_ADAPTER pAd, +void StartParmFill(IN PRTMP_ADAPTER pAd, IN OUT MLME_START_REQ_STRUCT * StartReq, - IN CHAR Ssid[], IN UCHAR SsidLen); + char Ssid[], u8 SsidLen); -VOID AuthParmFill(IN PRTMP_ADAPTER pAd, +void AuthParmFill(IN PRTMP_ADAPTER pAd, IN OUT MLME_AUTH_REQ_STRUCT * AuthReq, - IN PUCHAR pAddr, IN USHORT Alg); + u8 *pAddr, u16 Alg); -VOID EnqueuePsPoll(IN PRTMP_ADAPTER pAd); +void EnqueuePsPoll(IN PRTMP_ADAPTER pAd); -VOID EnqueueBeaconFrame(IN PRTMP_ADAPTER pAd); +void EnqueueBeaconFrame(IN PRTMP_ADAPTER pAd); -VOID MlmeJoinReqAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem); +void MlmeJoinReqAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem); -VOID MlmeScanReqAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem); +void MlmeScanReqAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem); -VOID MlmeStartReqAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem); +void MlmeStartReqAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem); -VOID ScanTimeoutAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem); +void ScanTimeoutAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem); -VOID BeaconTimeoutAtJoinAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem); +void BeaconTimeoutAtJoinAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem); -VOID PeerBeaconAtScanAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem); +void PeerBeaconAtScanAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem); -VOID PeerBeaconAtJoinAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem); +void PeerBeaconAtJoinAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem); -VOID PeerBeacon(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem); +void PeerBeacon(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem); -VOID PeerProbeReqAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem); +void PeerProbeReqAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem); -VOID ScanNextChannel(IN PRTMP_ADAPTER pAd); +void ScanNextChannel(IN PRTMP_ADAPTER pAd); -ULONG MakeIbssBeacon(IN PRTMP_ADAPTER pAd); +unsigned long MakeIbssBeacon(IN PRTMP_ADAPTER pAd); BOOLEAN MlmeScanReqSanity(IN PRTMP_ADAPTER pAd, - IN VOID * Msg, - IN ULONG MsgLen, - OUT UCHAR * BssType, - OUT CHAR ssid[], - OUT UCHAR * SsidLen, OUT UCHAR * ScanType); + void * Msg, + unsigned long MsgLen, + u8 * BssType, + char ssid[], + u8 * SsidLen, u8 * ScanType); 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, + 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, - 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, + 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, - OUT ULONG * pRalinkIe, - OUT UCHAR * pHtCapabilityLen, - OUT UCHAR * pPreNHtCapabilityLen, + unsigned long * pRalinkIe, + u8 * pHtCapabilityLen, + u8 * pPreNHtCapabilityLen, OUT HT_CAPABILITY_IE * pHtCapability, - OUT UCHAR * AddHtInfoLen, + u8 * AddHtInfoLen, OUT ADD_HT_INFO_IE * AddHtInfo, - OUT UCHAR * NewExtChannel, - OUT USHORT * LengthVIE, + u8 * NewExtChannel, + u16 * LengthVIE, OUT PNDIS_802_11_VARIABLE_IEs pVIE); BOOLEAN PeerAddBAReqActionSanity(IN PRTMP_ADAPTER pAd, - IN VOID * pMsg, - IN ULONG MsgLen, OUT PUCHAR pAddr2); + void * pMsg, + unsigned long MsgLen, u8 *pAddr2); BOOLEAN PeerAddBARspActionSanity(IN PRTMP_ADAPTER pAd, - IN VOID * pMsg, IN ULONG MsgLen); + void * pMsg, unsigned long MsgLen); BOOLEAN PeerDelBAActionSanity(IN PRTMP_ADAPTER pAd, - IN UCHAR Wcid, IN VOID * pMsg, IN ULONG MsgLen); + u8 Wcid, void * pMsg, unsigned long MsgLen); BOOLEAN MlmeAssocReqSanity(IN PRTMP_ADAPTER pAd, - IN VOID * Msg, - IN ULONG MsgLen, - OUT PUCHAR pApAddr, - OUT USHORT * CapabilityInfo, - OUT ULONG * Timeout, OUT USHORT * ListenIntv); + void * Msg, + unsigned long MsgLen, + u8 *pApAddr, + u16 * CapabilityInfo, + unsigned long * Timeout, u16 * ListenIntv); BOOLEAN MlmeAuthReqSanity(IN PRTMP_ADAPTER pAd, - IN VOID * Msg, - IN ULONG MsgLen, - OUT PUCHAR pAddr, - OUT ULONG * Timeout, OUT USHORT * Alg); + void * Msg, + unsigned long MsgLen, + u8 *pAddr, + unsigned long * Timeout, u16 * Alg); BOOLEAN MlmeStartReqSanity(IN PRTMP_ADAPTER pAd, - IN VOID * Msg, - IN ULONG MsgLen, - OUT CHAR Ssid[], OUT UCHAR * Ssidlen); + void * Msg, + unsigned long MsgLen, + char Ssid[], u8 * Ssidlen); BOOLEAN PeerAuthSanity(IN PRTMP_ADAPTER pAd, - IN VOID * Msg, - IN ULONG MsgLen, - OUT PUCHAR pAddr, - OUT USHORT * Alg, - OUT USHORT * Seq, - OUT USHORT * Status, OUT CHAR ChlgText[]); - -BOOLEAN PeerAssocRspSanity(IN PRTMP_ADAPTER pAd, IN VOID * pMsg, IN ULONG MsgLen, OUT PUCHAR pAddr2, OUT USHORT * pCapabilityInfo, OUT USHORT * pStatus, OUT USHORT * pAid, OUT UCHAR SupRate[], OUT UCHAR * pSupRateLen, OUT UCHAR ExtRate[], OUT UCHAR * pExtRateLen, OUT HT_CAPABILITY_IE * pHtCapability, OUT ADD_HT_INFO_IE * pAddHtInfo, /* AP might use this additional ht info IE */ - OUT UCHAR * pHtCapabilityLen, - OUT UCHAR * pAddHtInfoLen, - OUT UCHAR * pNewExtChannelOffset, - OUT PEDCA_PARM pEdcaParm, OUT UCHAR * pCkipFlag); + void * Msg, + unsigned long MsgLen, + u8 *pAddr, + u16 * Alg, + u16 * Seq, + u16 * Status, char ChlgText[]); + +BOOLEAN PeerAssocRspSanity(IN PRTMP_ADAPTER pAd, void * pMsg, unsigned long MsgLen, u8 *pAddr2, u16 * pCapabilityInfo, u16 * pStatus, u16 * pAid, u8 SupRate[], u8 * pSupRateLen, u8 ExtRate[], u8 * pExtRateLen, OUT HT_CAPABILITY_IE * pHtCapability, OUT ADD_HT_INFO_IE * pAddHtInfo, /* AP might use this additional ht info IE */ + u8 * pHtCapabilityLen, + u8 * pAddHtInfoLen, + u8 * pNewExtChannelOffset, + OUT PEDCA_PARM pEdcaParm, u8 * pCkipFlag); BOOLEAN PeerDisassocSanity(IN PRTMP_ADAPTER pAd, - IN VOID * Msg, - IN ULONG MsgLen, - OUT PUCHAR pAddr2, OUT USHORT * Reason); + void * Msg, + unsigned long MsgLen, + u8 *pAddr2, u16 * Reason); 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); BOOLEAN PeerDeauthSanity(IN PRTMP_ADAPTER pAd, - IN VOID * Msg, - IN ULONG MsgLen, - OUT PUCHAR pAddr2, OUT USHORT * Reason); + void * Msg, + unsigned long MsgLen, + u8 *pAddr2, u16 * Reason); BOOLEAN PeerProbeReqSanity(IN PRTMP_ADAPTER pAd, - IN VOID * Msg, - IN ULONG MsgLen, - OUT PUCHAR pAddr2, - OUT CHAR Ssid[], OUT UCHAR * pSsidLen); + void * Msg, + unsigned long MsgLen, + u8 *pAddr2, + char Ssid[], u8 * pSsidLen); -BOOLEAN GetTimBit(IN CHAR * Ptr, - IN USHORT Aid, - OUT UCHAR * TimLen, - OUT UCHAR * BcastFlag, - OUT UCHAR * DtimCount, - OUT UCHAR * DtimPeriod, OUT UCHAR * MessageToMe); +BOOLEAN GetTimBit(char * Ptr, + u16 Aid, + u8 * TimLen, + u8 * BcastFlag, + u8 * DtimCount, + u8 * DtimPeriod, u8 * MessageToMe); -UCHAR ChannelSanity(IN PRTMP_ADAPTER pAd, IN UCHAR channel); +u8 ChannelSanity(IN PRTMP_ADAPTER pAd, u8 channel); NDIS_802_11_NETWORK_TYPE NetworkTypeInUseSanity(IN PBSS_ENTRY pBss); BOOLEAN MlmeDelBAReqSanity(IN PRTMP_ADAPTER pAd, - IN VOID * Msg, IN ULONG MsgLen); + void * Msg, unsigned long MsgLen); BOOLEAN MlmeAddBAReqSanity(IN PRTMP_ADAPTER pAd, - IN VOID * Msg, IN ULONG MsgLen, OUT PUCHAR pAddr2); + void * Msg, unsigned long MsgLen, u8 *pAddr2); -ULONG MakeOutgoingFrame(OUT UCHAR * Buffer, OUT ULONG * Length, ...); +unsigned long MakeOutgoingFrame(u8 * Buffer, unsigned long * Length, ...); -VOID LfsrInit(IN PRTMP_ADAPTER pAd, IN ULONG Seed); +void LfsrInit(IN PRTMP_ADAPTER pAd, unsigned long Seed); -UCHAR RandomByte(IN PRTMP_ADAPTER pAd); +u8 RandomByte(IN PRTMP_ADAPTER pAd); -VOID AsicUpdateAutoFallBackTable(IN PRTMP_ADAPTER pAd, IN PUCHAR pTxRate); +void AsicUpdateAutoFallBackTable(IN PRTMP_ADAPTER pAd, u8 *pTxRate); -VOID MlmePeriodicExec(IN PVOID SystemSpecific1, - IN PVOID FunctionContext, - IN PVOID SystemSpecific2, IN PVOID SystemSpecific3); +void MlmePeriodicExec(void *SystemSpecific1, + void *FunctionContext, + void *SystemSpecific2, void *SystemSpecific3); -VOID LinkDownExec(IN PVOID SystemSpecific1, - IN PVOID FunctionContext, - IN PVOID SystemSpecific2, IN PVOID SystemSpecific3); +void LinkDownExec(void *SystemSpecific1, + void *FunctionContext, + void *SystemSpecific2, void *SystemSpecific3); -VOID STAMlmePeriodicExec(PRTMP_ADAPTER pAd); +void STAMlmePeriodicExec(PRTMP_ADAPTER pAd); -VOID MlmeAutoScan(IN PRTMP_ADAPTER pAd); +void MlmeAutoScan(IN PRTMP_ADAPTER pAd); -VOID MlmeAutoReconnectLastSSID(IN PRTMP_ADAPTER pAd); +void MlmeAutoReconnectLastSSID(IN PRTMP_ADAPTER pAd); -BOOLEAN MlmeValidateSSID(IN PUCHAR pSsid, IN UCHAR SsidLen); +BOOLEAN MlmeValidateSSID(u8 *pSsid, u8 SsidLen); -VOID MlmeCheckForRoaming(IN PRTMP_ADAPTER pAd, IN ULONG Now32); +void MlmeCheckForRoaming(IN PRTMP_ADAPTER pAd, unsigned long Now32); BOOLEAN MlmeCheckForFastRoaming(IN PRTMP_ADAPTER pAd); -VOID MlmeDynamicTxRateSwitching(IN PRTMP_ADAPTER pAd); +void MlmeDynamicTxRateSwitching(IN PRTMP_ADAPTER pAd); -VOID MlmeSetTxRate(IN PRTMP_ADAPTER pAd, +void MlmeSetTxRate(IN PRTMP_ADAPTER pAd, IN PMAC_TABLE_ENTRY pEntry, IN PRTMP_TX_RATE_SWITCH pTxRate); -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); -VOID MlmeCalculateChannelQuality(IN PRTMP_ADAPTER pAd, - IN PMAC_TABLE_ENTRY pMacEntry, IN ULONG Now); +void MlmeCalculateChannelQuality(IN PRTMP_ADAPTER pAd, + IN PMAC_TABLE_ENTRY pMacEntry, unsigned long Now); -VOID MlmeCheckPsmChange(IN PRTMP_ADAPTER pAd, IN ULONG Now32); +void MlmeCheckPsmChange(IN PRTMP_ADAPTER pAd, unsigned long Now32); -VOID MlmeSetPsmBit(IN PRTMP_ADAPTER pAd, IN USHORT psm); +void MlmeSetPsmBit(IN PRTMP_ADAPTER pAd, u16 psm); -VOID MlmeSetTxPreamble(IN PRTMP_ADAPTER pAd, IN USHORT TxPreamble); +void MlmeSetTxPreamble(IN PRTMP_ADAPTER pAd, u16 TxPreamble); -VOID UpdateBasicRateBitmap(IN PRTMP_ADAPTER pAd); +void UpdateBasicRateBitmap(IN PRTMP_ADAPTER pAd); -VOID MlmeUpdateTxRates(IN PRTMP_ADAPTER pAd, - IN BOOLEAN bLinkUp, IN UCHAR apidx); +void MlmeUpdateTxRates(IN PRTMP_ADAPTER pAd, + IN BOOLEAN bLinkUp, u8 apidx); -VOID MlmeUpdateHtTxRates(IN PRTMP_ADAPTER pAd, IN UCHAR apidx); +void MlmeUpdateHtTxRates(IN PRTMP_ADAPTER pAd, u8 apidx); -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); BOOLEAN RTMPCheckChannel(IN PRTMP_ADAPTER pAd, - IN UCHAR CentralChannel, IN UCHAR Channel); + u8 CentralChannel, u8 Channel); BOOLEAN RTMPCheckHt(IN PRTMP_ADAPTER pAd, - IN UCHAR Wcid, + u8 Wcid, IN OUT HT_CAPABILITY_IE * pHtCapability, IN OUT ADD_HT_INFO_IE * pAddHtInfo); -VOID StaQuickResponeForRateUpExec(IN PVOID SystemSpecific1, - IN PVOID FunctionContext, - IN PVOID SystemSpecific2, - IN PVOID SystemSpecific3); +void StaQuickResponeForRateUpExec(void *SystemSpecific1, + void *FunctionContext, + void *SystemSpecific2, + void *SystemSpecific3); -VOID RTMPUpdateMlmeRate(IN PRTMP_ADAPTER pAd); +void RTMPUpdateMlmeRate(IN PRTMP_ADAPTER pAd); -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); #ifdef RT30xx -VOID AsicSetRxAnt(IN PRTMP_ADAPTER pAd, IN UCHAR Ant); +void AsicSetRxAnt(IN PRTMP_ADAPTER pAd, u8 Ant); -VOID RTMPFilterCalibration(IN PRTMP_ADAPTER pAd); +void RTMPFilterCalibration(IN PRTMP_ADAPTER pAd); #ifdef RTMP_EFUSE_SUPPORT /*2008/09/11:KH add to support efuse<-- */ -INT set_eFuseGetFreeBlockCount_Proc(IN PRTMP_ADAPTER pAd, IN PSTRING arg); +int set_eFuseGetFreeBlockCount_Proc(IN PRTMP_ADAPTER pAd, char *arg); -INT set_eFusedump_Proc(IN PRTMP_ADAPTER pAd, IN PSTRING arg); +int set_eFusedump_Proc(IN PRTMP_ADAPTER pAd, char *arg); -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); int RtmpEfuseSupportCheck(IN RTMP_ADAPTER * pAd); -VOID eFuseGetFreeBlockCount(IN PRTMP_ADAPTER pAd, PUINT EfuseFreeBlock); +void eFuseGetFreeBlockCount(IN PRTMP_ADAPTER pAd, u32 *EfuseFreeBlock); -INT eFuse_init(IN PRTMP_ADAPTER pAd); +int eFuse_init(IN PRTMP_ADAPTER pAd); /*2008/09/11:KH add to support efuse--> */ #endif /* RTMP_EFUSE_SUPPORT // */ /* add by johnli, RF power sequence setup */ -VOID RT30xxLoadRFNormalModeSetup(IN PRTMP_ADAPTER pAd); +void RT30xxLoadRFNormalModeSetup(IN PRTMP_ADAPTER pAd); -VOID RT30xxLoadRFSleepModeSetup(IN PRTMP_ADAPTER pAd); +void RT30xxLoadRFSleepModeSetup(IN PRTMP_ADAPTER pAd); -VOID RT30xxReverseRFSleepModeSetup(IN PRTMP_ADAPTER pAd); +void RT30xxReverseRFSleepModeSetup(IN PRTMP_ADAPTER pAd); /* end johnli */ #ifdef RT3070 -VOID NICInitRT3070RFRegisters(IN RTMP_ADAPTER * pAd); +void NICInitRT3070RFRegisters(IN RTMP_ADAPTER * pAd); #endif /* RT3070 // */ #ifdef RT3090 -VOID NICInitRT3090RFRegisters(IN RTMP_ADAPTER * pAd); +void NICInitRT3090RFRegisters(IN RTMP_ADAPTER * pAd); #endif /* RT3090 // */ -VOID RT30xxHaltAction(IN PRTMP_ADAPTER pAd); +void RT30xxHaltAction(IN PRTMP_ADAPTER pAd); -VOID RT30xxSetRxAnt(IN PRTMP_ADAPTER pAd, IN UCHAR Ant); +void RT30xxSetRxAnt(IN PRTMP_ADAPTER pAd, u8 Ant); #endif /* RT30xx // */ -VOID AsicEvaluateRxAnt(IN PRTMP_ADAPTER pAd); +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); -VOID APSDPeriodicExec(IN PVOID SystemSpecific1, - IN PVOID FunctionContext, - IN PVOID SystemSpecific2, IN PVOID SystemSpecific3); +void APSDPeriodicExec(void *SystemSpecific1, + void *FunctionContext, + void *SystemSpecific2, void *SystemSpecific3); BOOLEAN RTMPCheckEntryEnableAutoRateSwitch(IN PRTMP_ADAPTER pAd, IN PMAC_TABLE_ENTRY pEntry); -UCHAR RTMPStaFixedTxMode(IN PRTMP_ADAPTER pAd, IN PMAC_TABLE_ENTRY pEntry); +u8 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); BOOLEAN RTMPAutoRateSwitchCheck(IN PRTMP_ADAPTER pAd); -NDIS_STATUS MlmeInit(IN PRTMP_ADAPTER pAd); +int MlmeInit(IN PRTMP_ADAPTER pAd); -VOID MlmeHandler(IN PRTMP_ADAPTER pAd); +void MlmeHandler(IN PRTMP_ADAPTER pAd); -VOID MlmeHalt(IN PRTMP_ADAPTER pAd); +void MlmeHalt(IN PRTMP_ADAPTER pAd); -VOID MlmeResetRalinkCounters(IN PRTMP_ADAPTER pAd); +void MlmeResetRalinkCounters(IN PRTMP_ADAPTER pAd); -VOID BuildChannelList(IN PRTMP_ADAPTER pAd); +void BuildChannelList(IN PRTMP_ADAPTER pAd); -UCHAR FirstChannel(IN PRTMP_ADAPTER pAd); +u8 FirstChannel(IN PRTMP_ADAPTER pAd); -UCHAR NextChannel(IN PRTMP_ADAPTER pAd, IN UCHAR channel); +u8 NextChannel(IN PRTMP_ADAPTER pAd, u8 channel); -VOID ChangeToCellPowerLimit(IN PRTMP_ADAPTER pAd, - IN UCHAR AironetCellPowerLimit); +void ChangeToCellPowerLimit(IN PRTMP_ADAPTER pAd, + u8 AironetCellPowerLimit); /* */ /* Prototypes of function definition in rtmp_tkip.c */ /* */ -VOID RTMPInitTkipEngine(IN PRTMP_ADAPTER pAd, - IN PUCHAR pTKey, - IN UCHAR KeyId, - IN PUCHAR pTA, - IN PUCHAR pMICKey, - IN PUCHAR pTSC, OUT PULONG pIV16, OUT PULONG pIV32); - -VOID RTMPInitMICEngine(IN PRTMP_ADAPTER pAd, - IN PUCHAR pKey, - IN PUCHAR pDA, - IN PUCHAR pSA, IN UCHAR UserPriority, IN PUCHAR pMICKey); +void RTMPInitTkipEngine(IN PRTMP_ADAPTER pAd, + u8 *pTKey, + u8 KeyId, + u8 *pTA, + u8 *pMICKey, + u8 *pTSC, unsigned long *pIV16, unsigned long *pIV32); + +void RTMPInitMICEngine(IN PRTMP_ADAPTER pAd, + u8 *pKey, + u8 *pDA, + u8 *pSA, u8 UserPriority, u8 *pMICKey); 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); -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); -VOID RTMPTkipAppendByte(IN PTKIP_KEY_INFO pTkip, IN UCHAR uChar); +void RTMPTkipAppendByte(IN PTKIP_KEY_INFO pTkip, u8 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); -VOID RTMPTkipGetMIC(IN PTKIP_KEY_INFO pTkip); +void RTMPTkipGetMIC(IN PTKIP_KEY_INFO pTkip); 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); 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); /* */ /* Prototypes of function definition in cmm_info.c */ /* */ -INT RT_CfgSetCountryRegion(IN PRTMP_ADAPTER pAd, IN PSTRING arg, IN INT band); +int RT_CfgSetCountryRegion(IN PRTMP_ADAPTER pAd, char *arg, int band); -INT RT_CfgSetWirelessMode(IN PRTMP_ADAPTER pAd, IN PSTRING arg); +int RT_CfgSetWirelessMode(IN PRTMP_ADAPTER pAd, char *arg); -INT RT_CfgSetShortSlot(IN PRTMP_ADAPTER pAd, IN PSTRING arg); +int RT_CfgSetShortSlot(IN PRTMP_ADAPTER pAd, char *arg); -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 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); /* */ /* Prototypes of function definition in cmm_info.c */ /* */ -VOID RTMPWPARemoveAllKeys(IN PRTMP_ADAPTER pAd); +void RTMPWPARemoveAllKeys(IN PRTMP_ADAPTER pAd); -VOID RTMPSetPhyMode(IN PRTMP_ADAPTER pAd, IN ULONG phymode); +void RTMPSetPhyMode(IN PRTMP_ADAPTER pAd, unsigned long phymode); -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); -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); -PSTRING GetEncryptType(CHAR enc); +char *GetEncryptType(char enc); -PSTRING GetAuthMode(CHAR auth); +char *GetAuthMode(char auth); -VOID RTMPSetHT(IN PRTMP_ADAPTER pAd, IN OID_SET_HT_PHYMODE * pHTPhyMode); +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); -VOID RTMPSendWirelessEvent(IN PRTMP_ADAPTER pAd, - IN USHORT Event_flag, - IN PUCHAR pAddr, IN UCHAR BssIdx, IN CHAR Rssi); +void RTMPSendWirelessEvent(IN PRTMP_ADAPTER pAd, + u16 Event_flag, + u8 *pAddr, u8 BssIdx, char Rssi); -CHAR ConvertToRssi(IN PRTMP_ADAPTER pAd, IN CHAR Rssi, IN UCHAR RssiNumber); +char ConvertToRssi(IN PRTMP_ADAPTER pAd, char Rssi, u8 RssiNumber); /*=================================== Function prototype in cmm_wpa.c =================================== */ -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); -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); -VOID GenRandom(IN PRTMP_ADAPTER pAd, IN UCHAR * macAddr, OUT UCHAR * random); +void GenRandom(IN PRTMP_ADAPTER pAd, u8 * macAddr, u8 * random); 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); -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); 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); -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); - -NDIS_STATUS RTMPSoftDecryptBroadCastData(IN PRTMP_ADAPTER pAd, +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); + +int RTMPSoftDecryptBroadCastData(IN PRTMP_ADAPTER pAd, IN RX_BLK * pRxBlk, IN NDIS_802_11_ENCRYPTION_STATUS GroupCipher, IN PCIPHER_KEY pShard_key); -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); /* */ /* function prototype in ap_wpa.c */ /* */ -VOID RTMPGetTxTscFromAsic(IN PRTMP_ADAPTER pAd, - IN UCHAR apidx, OUT PUCHAR pTxTsc); +void RTMPGetTxTscFromAsic(IN PRTMP_ADAPTER pAd, + u8 apidx, u8 *pTxTsc); -VOID APInstallPairwiseKey(PRTMP_ADAPTER pAd, PMAC_TABLE_ENTRY pEntry); +void APInstallPairwiseKey(PRTMP_ADAPTER pAd, PMAC_TABLE_ENTRY pEntry); -UINT APValidateRSNIE(IN PRTMP_ADAPTER pAd, +u32 APValidateRSNIE(IN PRTMP_ADAPTER pAd, IN PMAC_TABLE_ENTRY pEntry, - IN PUCHAR pRsnIe, IN UCHAR rsnie_len); + u8 *pRsnIe, u8 rsnie_len); -VOID HandleCounterMeasure(IN PRTMP_ADAPTER pAd, IN MAC_TABLE_ENTRY * pEntry); +void HandleCounterMeasure(IN PRTMP_ADAPTER pAd, IN MAC_TABLE_ENTRY * pEntry); -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); -VOID WPAStart2WayGroupHS(IN PRTMP_ADAPTER pAd, IN MAC_TABLE_ENTRY * pEntry); +void WPAStart2WayGroupHS(IN PRTMP_ADAPTER pAd, IN MAC_TABLE_ENTRY * pEntry); -VOID PeerPairMsg1Action(IN PRTMP_ADAPTER pAd, +void PeerPairMsg1Action(IN PRTMP_ADAPTER pAd, IN MAC_TABLE_ENTRY * pEntry, IN MLME_QUEUE_ELEM * Elem); -VOID PeerPairMsg2Action(IN PRTMP_ADAPTER pAd, +void PeerPairMsg2Action(IN PRTMP_ADAPTER pAd, IN MAC_TABLE_ENTRY * pEntry, IN MLME_QUEUE_ELEM * Elem); -VOID PeerPairMsg3Action(IN PRTMP_ADAPTER pAd, +void PeerPairMsg3Action(IN PRTMP_ADAPTER pAd, IN MAC_TABLE_ENTRY * pEntry, IN MLME_QUEUE_ELEM * Elem); -VOID PeerPairMsg4Action(IN PRTMP_ADAPTER pAd, +void PeerPairMsg4Action(IN PRTMP_ADAPTER pAd, IN MAC_TABLE_ENTRY * pEntry, IN MLME_QUEUE_ELEM * Elem); -VOID PeerGroupMsg1Action(IN PRTMP_ADAPTER pAd, +void PeerGroupMsg1Action(IN PRTMP_ADAPTER pAd, IN PMAC_TABLE_ENTRY pEntry, IN MLME_QUEUE_ELEM * Elem); -VOID PeerGroupMsg2Action(IN PRTMP_ADAPTER pAd, +void PeerGroupMsg2Action(IN PRTMP_ADAPTER pAd, IN PMAC_TABLE_ENTRY pEntry, - IN VOID * Msg, IN UINT MsgLen); + void * Msg, u32 MsgLen); -VOID WpaDeriveGTK(IN UCHAR * PMK, - IN UCHAR * GNonce, - IN UCHAR * AA, OUT UCHAR * output, IN UINT len); +void WpaDeriveGTK(u8 * PMK, + u8 * GNonce, + u8 * AA, u8 * output, u32 len); -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); /*typedef void (*TIMER_FUNCTION)(unsigned long); */ /* timeout -- ms */ -VOID RTMP_SetPeriodicTimer(IN NDIS_MINIPORT_TIMER * pTimer, +void RTMP_SetPeriodicTimer(IN NDIS_MINIPORT_TIMER * pTimer, IN unsigned long timeout); -VOID RTMP_OS_Init_Timer(IN PRTMP_ADAPTER pAd, +void RTMP_OS_Init_Timer(IN PRTMP_ADAPTER pAd, IN NDIS_MINIPORT_TIMER * pTimer, - IN TIMER_FUNCTION function, IN PVOID data); + IN TIMER_FUNCTION function, void *data); -VOID RTMP_OS_Add_Timer(IN NDIS_MINIPORT_TIMER * pTimer, +void RTMP_OS_Add_Timer(IN NDIS_MINIPORT_TIMER * pTimer, IN unsigned long timeout); -VOID RTMP_OS_Mod_Timer(IN NDIS_MINIPORT_TIMER * pTimer, +void RTMP_OS_Mod_Timer(IN NDIS_MINIPORT_TIMER * pTimer, IN unsigned long timeout); -VOID RTMP_OS_Del_Timer(IN NDIS_MINIPORT_TIMER * pTimer, +void RTMP_OS_Del_Timer(IN NDIS_MINIPORT_TIMER * pTimer, OUT BOOLEAN * pCancelled); -VOID RTMP_OS_Release_Packet(IN PRTMP_ADAPTER pAd, IN PQUEUE_ENTRY pEntry); +void RTMP_OS_Release_Packet(IN PRTMP_ADAPTER pAd, IN PQUEUE_ENTRY pEntry); -VOID RTMPusecDelay(IN ULONG usec); +void RTMPusecDelay(unsigned long usec); -NDIS_STATUS os_alloc_mem(IN RTMP_ADAPTER * pAd, - OUT UCHAR ** mem, IN ULONG size); +int os_alloc_mem(IN RTMP_ADAPTER * pAd, + u8 ** mem, unsigned long size); -NDIS_STATUS os_free_mem(IN PRTMP_ADAPTER pAd, IN PVOID mem); +int os_free_mem(IN PRTMP_ADAPTER pAd, void *mem); void RTMP_AllocateSharedMemory(IN PRTMP_ADAPTER pAd, - IN ULONG Length, + unsigned long Length, IN BOOLEAN Cached, - OUT PVOID * VirtualAddress, + void ** VirtualAddress, OUT PNDIS_PHYSICAL_ADDRESS PhysicalAddress); -VOID RTMPFreeTxRxRingMemory(IN PRTMP_ADAPTER pAd); +void RTMPFreeTxRxRingMemory(IN PRTMP_ADAPTER pAd); -NDIS_STATUS AdapterBlockAllocateMemory(IN PVOID handle, OUT PVOID * ppAd); +int AdapterBlockAllocateMemory(void *handle, void ** ppAd); void RTMP_AllocateTxDescMemory(IN PRTMP_ADAPTER pAd, - IN UINT Index, - IN ULONG Length, + u32 Index, + unsigned long Length, IN BOOLEAN Cached, - OUT PVOID * VirtualAddress, + void ** VirtualAddress, OUT PNDIS_PHYSICAL_ADDRESS PhysicalAddress); void RTMP_AllocateFirstTxBuffer(IN PRTMP_ADAPTER pAd, - IN UINT Index, - IN ULONG Length, + u32 Index, + unsigned long Length, IN BOOLEAN Cached, - OUT PVOID * VirtualAddress, + void ** VirtualAddress, OUT PNDIS_PHYSICAL_ADDRESS PhysicalAddress); void RTMP_FreeFirstTxBuffer(IN PRTMP_ADAPTER pAd, - IN ULONG Length, + unsigned long Length, IN BOOLEAN Cached, - IN PVOID VirtualAddress, + void *VirtualAddress, IN NDIS_PHYSICAL_ADDRESS PhysicalAddress); void RTMP_AllocateMgmtDescMemory(IN PRTMP_ADAPTER pAd, - IN ULONG Length, + unsigned long Length, IN BOOLEAN Cached, - OUT PVOID * VirtualAddress, + void ** VirtualAddress, OUT PNDIS_PHYSICAL_ADDRESS PhysicalAddress); void RTMP_AllocateRxDescMemory(IN PRTMP_ADAPTER pAd, - IN ULONG Length, + unsigned long Length, IN BOOLEAN Cached, - OUT PVOID * VirtualAddress, + void ** VirtualAddress, OUT PNDIS_PHYSICAL_ADDRESS PhysicalAddress); void RTMP_FreeDescMemory(IN PRTMP_ADAPTER pAd, - IN ULONG Length, - IN PVOID VirtualAddress, + unsigned long Length, + void *VirtualAddress, IN NDIS_PHYSICAL_ADDRESS PhysicalAddress); PNDIS_PACKET RtmpOSNetPktAlloc(IN RTMP_ADAPTER * pAd, IN int size); PNDIS_PACKET RTMP_AllocateRxPacketBuffer(IN PRTMP_ADAPTER pAd, - IN ULONG Length, + unsigned long Length, IN BOOLEAN Cached, - OUT PVOID * VirtualAddress, + void ** VirtualAddress, OUT PNDIS_PHYSICAL_ADDRESS PhysicalAddress); PNDIS_PACKET RTMP_AllocateTxPacketBuffer(IN PRTMP_ADAPTER pAd, - IN ULONG Length, + unsigned long Length, IN BOOLEAN Cached, - OUT PVOID * VirtualAddress); + void ** VirtualAddress); PNDIS_PACKET RTMP_AllocateFragPacketBuffer(IN PRTMP_ADAPTER pAd, - IN ULONG Length); + unsigned long Length); void RTMP_QueryPacketInfo(IN PNDIS_PACKET pPacket, OUT PACKET_INFO * pPacketInfo, - OUT PUCHAR * pSrcBufVA, OUT UINT * pSrcBufLen); + u8 ** pSrcBufVA, u32 * pSrcBufLen); void RTMP_QueryNextPacketInfo(IN PNDIS_PACKET * ppPacket, OUT PACKET_INFO * pPacketInfo, - OUT PUCHAR * pSrcBufVA, OUT UINT * pSrcBufLen); + u8 ** pSrcBufVA, u32 * pSrcBufLen); BOOLEAN RTMP_FillTxBlkInfo(IN RTMP_ADAPTER * pAd, IN TX_BLK * pTxBlk); @@ -3631,57 +3631,57 @@ rt_get_sg_list_from_packet(PNDIS_PACKET pPacket, RTMP_SCATTER_GATHER_LIST * sg); void announce_802_3_packet(IN PRTMP_ADAPTER pAd, IN PNDIS_PACKET pPacket); -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); -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); PNDIS_PACKET duplicate_pkt(IN PRTMP_ADAPTER pAd, - IN PUCHAR pHeader802_3, - IN UINT HdrLen, - IN PUCHAR pData, - IN ULONG DataSize, IN UCHAR FromWhichBSSID); + u8 *pHeader802_3, + u32 HdrLen, + u8 *pData, + unsigned long DataSize, u8 FromWhichBSSID); PNDIS_PACKET duplicate_pkt_with_TKIP_MIC(IN PRTMP_ADAPTER pAd, IN PNDIS_PACKET pOldPkt); void ba_flush_reordering_timeout_mpdus(IN PRTMP_ADAPTER pAd, IN PBA_REC_ENTRY pBAEntry, - IN ULONG Now32); + unsigned long Now32); -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); -VOID BASessionTearDownALL(IN OUT PRTMP_ADAPTER pAd, IN UCHAR Wcid); +void BASessionTearDownALL(IN OUT PRTMP_ADAPTER pAd, u8 Wcid); BOOLEAN OS_Need_Clone_Packet(void); -VOID build_tx_packet(IN PRTMP_ADAPTER pAd, +void build_tx_packet(IN PRTMP_ADAPTER pAd, IN PNDIS_PACKET pPacket, - IN PUCHAR pFrame, IN ULONG FrameLen); + u8 *pFrame, unsigned long FrameLen); -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); -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); BOOLEAN ba_reordering_resource_init(PRTMP_ADAPTER pAd, int num); void ba_reordering_resource_release(PRTMP_ADAPTER pAd); -PSTRING rstrtok(IN PSTRING s, IN const PSTRING ct); +char *rstrtok(char *s, IN const char *ct); /*//////// common ioctl functions ////////// */ -INT SetCommonHT(IN PRTMP_ADAPTER pAd); +int SetCommonHT(IN PRTMP_ADAPTER pAd); -INT WpaCheckEapCode(IN PRTMP_ADAPTER pAd, - IN PUCHAR pFrame, IN USHORT FrameLen, IN USHORT OffSet); +int WpaCheckEapCode(IN PRTMP_ADAPTER pAd, + u8 *pFrame, u16 FrameLen, u16 OffSet); -VOID WpaSendMicFailureToWpaSupplicant(IN PRTMP_ADAPTER pAd, +void WpaSendMicFailureToWpaSupplicant(IN PRTMP_ADAPTER pAd, IN BOOLEAN bUnicast); int wext_notify_event_assoc(IN RTMP_ADAPTER * pAd); @@ -3689,37 +3689,37 @@ int wext_notify_event_assoc(IN RTMP_ADAPTER * pAd); BOOLEAN STARxDoneInterruptHandle(IN PRTMP_ADAPTER pAd, IN BOOLEAN argc); /* AMPDU packet indication */ -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); /* AMSDU packet indication */ -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); /* 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); -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); void update_os_packet_info(IN PRTMP_ADAPTER pAd, - IN RX_BLK * pRxBlk, IN UCHAR FromWhichBSSID); + IN RX_BLK * pRxBlk, u8 FromWhichBSSID); void wlan_802_11_to_802_3_packet(IN PRTMP_ADAPTER pAd, IN RX_BLK * pRxBlk, - IN PUCHAR pHeader802_3, - IN UCHAR FromWhichBSSID); + u8 *pHeader802_3, + u8 FromWhichBSSID); /* remove LLC and get 802_3 Header */ #define RTMP_802_11_REMOVE_LLC_AND_CONVERT_TO_802_3(_pRxBlk, _pHeader802_3) \ { \ - PUCHAR _pRemovedLLCSNAP = NULL, _pDA, _pSA; \ + u8 *_pRemovedLLCSNAP = NULL, *_pDA, *_pSA; \ \ if (RX_BLK_TEST_FLAG(_pRxBlk, fRX_MESH)) \ { \ _pDA = _pRxBlk->pHeader->Addr3; \ - _pSA = (PUCHAR)_pRxBlk->pHeader + sizeof(HEADER_802_11); \ + _pSA = (u8 *)_pRxBlk->pHeader + sizeof(HEADER_802_11); \ } \ else \ { \ @@ -3742,36 +3742,36 @@ void wlan_802_11_to_802_3_packet(IN PRTMP_ADAPTER pAd, _pRxBlk->DataSize, _pRemovedLLCSNAP); \ } -VOID Sta_Announce_or_Forward_802_3_Packet(IN PRTMP_ADAPTER pAd, +void Sta_Announce_or_Forward_802_3_Packet(IN PRTMP_ADAPTER pAd, IN PNDIS_PACKET pPacket, - IN UCHAR FromWhichBSSID); + u8 FromWhichBSSID); #define ANNOUNCE_OR_FORWARD_802_3_PACKET(_pAd, _pPacket, _FromWhichBSS)\ Sta_Announce_or_Forward_802_3_Packet(_pAd, _pPacket, _FromWhichBSS); /*announce_802_3_packet(_pAd, _pPacket); */ PNDIS_PACKET DuplicatePacket(IN PRTMP_ADAPTER pAd, - IN PNDIS_PACKET pPacket, IN UCHAR FromWhichBSSID); + IN PNDIS_PACKET pPacket, u8 FromWhichBSSID); PNDIS_PACKET ClonePacket(IN PRTMP_ADAPTER pAd, IN PNDIS_PACKET pPacket, - IN PUCHAR pData, IN ULONG DataSize); + u8 *pData, unsigned long DataSize); /* 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); -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); -VOID Update_Rssi_Sample(IN PRTMP_ADAPTER pAd, +void Update_Rssi_Sample(IN PRTMP_ADAPTER pAd, IN RSSI_SAMPLE * pRssi, IN PRXWI_STRUC pRxWI); PNDIS_PACKET GetPacketFromRxRing(IN PRTMP_ADAPTER pAd, OUT PRT28XX_RXD_STRUC pSaveRxD, OUT BOOLEAN * pbReschedule, - IN OUT UINT32 * pRxPending); + IN u32 * pRxPending); PNDIS_PACKET RTMPDeFragmentDataFrame(IN PRTMP_ADAPTER pAd, IN RX_BLK * pRxBlk); @@ -3798,17 +3798,17 @@ enum { /* Definition from madwifi */ typedef struct { - UINT32 did; - UINT16 status; - UINT16 len; - UINT32 data; + u32 did; + u16 status; + u16 len; + u32 data; } p80211item_uint32_t; typedef struct { - UINT32 msgcode; - UINT32 msglen; + u32 msgcode; + u32 msglen; #define WLAN_DEVNAMELEN_MAX 16 - UINT8 devname[WLAN_DEVNAMELEN_MAX]; + u8 devname[WLAN_DEVNAMELEN_MAX]; p80211item_uint32_t hosttime; p80211item_uint32_t mactime; p80211item_uint32_t channel; @@ -3823,18 +3823,18 @@ typedef struct { /* The radio capture header precedes the 802.11 header. */ typedef struct PACKED _ieee80211_radiotap_header { - UINT8 it_version; /* Version 0. Only increases + u8 it_version; /* Version 0. Only increases * for drastic changes, * introduction of compatible * new fields does not count. */ - UINT8 it_pad; - UINT16 it_len; /* length of the whole + u8 it_pad; + u16 it_len; /* length of the whole * header in bytes, including * it_version, it_pad, * it_len, and data fields. */ - UINT32 it_present; /* A bitmap telling which + u32 it_present; /* A bitmap telling which * fields are present. Set bit 31 * (0x80000000) to extend the * bitmap by another 32 bits. @@ -3868,38 +3868,38 @@ enum ieee80211_radiotap_type { typedef struct _wlan_radiotap_header { ieee80211_radiotap_header wt_ihdr; - INT64 wt_tsft; - UINT8 wt_flags; - UINT8 wt_rate; + long long wt_tsft; + u8 wt_flags; + u8 wt_rate; } wlan_radiotap_header; /* Definition from madwifi */ void send_monitor_packets(IN PRTMP_ADAPTER pAd, IN RX_BLK * pRxBlk); -VOID RTMPSetDesiredRates(IN PRTMP_ADAPTER pAdapter, IN LONG Rates); +void RTMPSetDesiredRates(IN PRTMP_ADAPTER pAdapter, long Rates); -INT Set_FixedTxMode_Proc(IN PRTMP_ADAPTER pAd, IN PSTRING arg); +int Set_FixedTxMode_Proc(IN PRTMP_ADAPTER pAd, char *arg); BOOLEAN RT28XXChipsetCheck(IN void *_dev_p); -VOID RT28XXDMADisable(IN RTMP_ADAPTER * pAd); +void RT28XXDMADisable(IN RTMP_ADAPTER * pAd); -VOID RT28XXDMAEnable(IN RTMP_ADAPTER * pAd); +void RT28XXDMAEnable(IN RTMP_ADAPTER * pAd); -VOID RT28xx_UpdateBeaconToAsic(IN RTMP_ADAPTER * pAd, - IN INT apidx, - IN ULONG BeaconLen, IN ULONG UpdatePos); +void RT28xx_UpdateBeaconToAsic(IN RTMP_ADAPTER * pAd, + int apidx, + unsigned long BeaconLen, unsigned long UpdatePos); int rt28xx_init(IN PRTMP_ADAPTER pAd, - IN PSTRING pDefaultMac, IN PSTRING pHostName); + char *pDefaultMac, char *pHostName); -NDIS_STATUS RtmpNetTaskInit(IN RTMP_ADAPTER * pAd); +int RtmpNetTaskInit(IN RTMP_ADAPTER * pAd); -VOID RtmpNetTaskExit(IN PRTMP_ADAPTER pAd); +void RtmpNetTaskExit(IN PRTMP_ADAPTER pAd); -NDIS_STATUS RtmpMgmtTaskInit(IN RTMP_ADAPTER * pAd); +int RtmpMgmtTaskInit(IN RTMP_ADAPTER * pAd); -VOID RtmpMgmtTaskExit(IN RTMP_ADAPTER * pAd); +void RtmpMgmtTaskExit(IN RTMP_ADAPTER * pAd); void tbtt_tasklet(unsigned long data); @@ -3908,7 +3908,7 @@ PNET_DEV RtmpPhyNetDevInit(IN RTMP_ADAPTER * pAd, BOOLEAN RtmpPhyNetDevExit(IN RTMP_ADAPTER * pAd, IN PNET_DEV net_dev); -INT RtmpRaDevCtrlInit(IN RTMP_ADAPTER * pAd, IN RTMP_INF_TYPE infType); +int RtmpRaDevCtrlInit(IN RTMP_ADAPTER * pAd, IN RTMP_INF_TYPE infType); BOOLEAN RtmpRaDevCtrlExit(IN RTMP_ADAPTER * pAd); @@ -3916,317 +3916,317 @@ BOOLEAN RtmpRaDevCtrlExit(IN RTMP_ADAPTER * pAd); /* */ /* Function Prototype in cmm_data_pci.c */ /* */ -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); -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); -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); -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); -USHORT RtmpPCI_WriteSubTxResource(IN PRTMP_ADAPTER pAd, +u16 RtmpPCI_WriteSubTxResource(IN PRTMP_ADAPTER pAd, IN TX_BLK * pTxBlk, - IN BOOLEAN bIsLast, OUT USHORT * FreeNumber); + IN BOOLEAN bIsLast, u16 * FreeNumber); -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); -VOID RtmpPCIDataLastTxIdx(IN PRTMP_ADAPTER pAd, - IN UCHAR QueIdx, IN USHORT LastTxIdx); +void RtmpPCIDataLastTxIdx(IN PRTMP_ADAPTER pAd, + u8 QueIdx, u16 LastTxIdx); -VOID RtmpPCIDataKickOut(IN PRTMP_ADAPTER pAd, - IN TX_BLK * pTxBlk, IN UCHAR QueIdx); +void RtmpPCIDataKickOut(IN PRTMP_ADAPTER pAd, + IN TX_BLK * pTxBlk, u8 QueIdx); 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); -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); BOOLEAN RT28xxPciAsicRadioOff(IN PRTMP_ADAPTER pAd, - IN UCHAR Level, IN USHORT TbttNumToNextWakeUp); + u8 Level, u16 TbttNumToNextWakeUp); -BOOLEAN RT28xxPciAsicRadioOn(IN PRTMP_ADAPTER pAd, IN UCHAR Level); +BOOLEAN RT28xxPciAsicRadioOn(IN PRTMP_ADAPTER pAd, u8 Level); -VOID RTMPInitPCIeLinkCtrlValue(IN PRTMP_ADAPTER pAd); +void RTMPInitPCIeLinkCtrlValue(IN PRTMP_ADAPTER pAd); -VOID RTMPFindHostPCIDev(IN PRTMP_ADAPTER pAd); +void RTMPFindHostPCIDev(IN PRTMP_ADAPTER pAd); -VOID RTMPPCIeLinkCtrlValueRestore(IN PRTMP_ADAPTER pAd, IN UCHAR Level); +void RTMPPCIeLinkCtrlValueRestore(IN PRTMP_ADAPTER pAd, u8 Level); -VOID RTMPPCIeLinkCtrlSetting(IN PRTMP_ADAPTER pAd, IN USHORT Max); +void RTMPPCIeLinkCtrlSetting(IN PRTMP_ADAPTER pAd, u16 Max); -VOID RTMPrt3xSetPCIePowerLinkCtrl(IN PRTMP_ADAPTER pAd); +void RTMPrt3xSetPCIePowerLinkCtrl(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); -VOID RadioOnExec(IN PVOID SystemSpecific1, - IN PVOID FunctionContext, - IN PVOID SystemSpecific2, IN PVOID SystemSpecific3); +void RadioOnExec(void *SystemSpecific1, + void *FunctionContext, + void *SystemSpecific2, void *SystemSpecific3); -VOID RT28xxPciStaAsicForceWakeup(IN PRTMP_ADAPTER pAd, IN BOOLEAN bFromTx); +void RT28xxPciStaAsicForceWakeup(IN PRTMP_ADAPTER pAd, IN BOOLEAN bFromTx); -VOID RT28xxPciStaAsicSleepThenAutoWakeup(IN PRTMP_ADAPTER pAd, - IN USHORT TbttNumToNextWakeUp); +void RT28xxPciStaAsicSleepThenAutoWakeup(IN PRTMP_ADAPTER pAd, + u16 TbttNumToNextWakeUp); -VOID RT28xxPciMlmeRadioOn(IN PRTMP_ADAPTER pAd); +void RT28xxPciMlmeRadioOn(IN PRTMP_ADAPTER pAd); -VOID RT28xxPciMlmeRadioOFF(IN PRTMP_ADAPTER pAd); +void RT28xxPciMlmeRadioOFF(IN PRTMP_ADAPTER pAd); #endif /* RTMP_MAC_PCI // */ #ifdef RTMP_MAC_USB /* */ /* Function Prototype in rtusb_bulk.c */ /* */ -VOID RTUSBInitTxDesc(IN PRTMP_ADAPTER pAd, +void RTUSBInitTxDesc(IN PRTMP_ADAPTER pAd, IN PTX_CONTEXT pTxContext, - IN UCHAR BulkOutPipeId, IN usb_complete_t Func); + u8 BulkOutPipeId, IN usb_complete_t Func); -VOID RTUSBInitHTTxDesc(IN PRTMP_ADAPTER pAd, +void RTUSBInitHTTxDesc(IN PRTMP_ADAPTER pAd, IN PHT_TX_CONTEXT pTxContext, - IN UCHAR BulkOutPipeId, - IN ULONG BulkOutSize, IN usb_complete_t Func); + u8 BulkOutPipeId, + unsigned long BulkOutSize, IN usb_complete_t Func); -VOID RTUSBInitRxDesc(IN PRTMP_ADAPTER pAd, IN PRX_CONTEXT pRxContext); +void RTUSBInitRxDesc(IN PRTMP_ADAPTER pAd, IN PRX_CONTEXT pRxContext); -VOID RTUSBCleanUpDataBulkOutQueue(IN PRTMP_ADAPTER pAd); +void RTUSBCleanUpDataBulkOutQueue(IN PRTMP_ADAPTER pAd); -VOID RTUSBCancelPendingBulkOutIRP(IN PRTMP_ADAPTER pAd); +void RTUSBCancelPendingBulkOutIRP(IN PRTMP_ADAPTER pAd); -VOID RTUSBBulkOutDataPacket(IN PRTMP_ADAPTER pAd, - IN UCHAR BulkOutPipeId, IN UCHAR Index); +void RTUSBBulkOutDataPacket(IN PRTMP_ADAPTER pAd, + u8 BulkOutPipeId, u8 Index); -VOID RTUSBBulkOutNullFrame(IN PRTMP_ADAPTER pAd); +void RTUSBBulkOutNullFrame(IN PRTMP_ADAPTER pAd); -VOID RTUSBBulkOutRTSFrame(IN PRTMP_ADAPTER pAd); +void RTUSBBulkOutRTSFrame(IN PRTMP_ADAPTER pAd); -VOID RTUSBCancelPendingBulkInIRP(IN PRTMP_ADAPTER pAd); +void RTUSBCancelPendingBulkInIRP(IN PRTMP_ADAPTER pAd); -VOID RTUSBCancelPendingIRPs(IN PRTMP_ADAPTER pAd); +void RTUSBCancelPendingIRPs(IN PRTMP_ADAPTER pAd); -VOID RTUSBBulkOutMLMEPacket(IN PRTMP_ADAPTER pAd, IN UCHAR Index); +void RTUSBBulkOutMLMEPacket(IN PRTMP_ADAPTER pAd, u8 Index); -VOID RTUSBBulkOutPsPoll(IN PRTMP_ADAPTER pAd); +void RTUSBBulkOutPsPoll(IN PRTMP_ADAPTER pAd); -VOID RTUSBCleanUpMLMEBulkOutQueue(IN PRTMP_ADAPTER pAd); +void RTUSBCleanUpMLMEBulkOutQueue(IN PRTMP_ADAPTER pAd); -VOID RTUSBKickBulkOut(IN PRTMP_ADAPTER pAd); +void RTUSBKickBulkOut(IN PRTMP_ADAPTER pAd); -VOID RTUSBBulkReceive(IN PRTMP_ADAPTER pAd); +void RTUSBBulkReceive(IN PRTMP_ADAPTER pAd); -VOID DoBulkIn(IN RTMP_ADAPTER * pAd); +void DoBulkIn(IN RTMP_ADAPTER * pAd); -VOID RTUSBInitRxDesc(IN PRTMP_ADAPTER pAd, IN PRX_CONTEXT pRxContext); +void RTUSBInitRxDesc(IN PRTMP_ADAPTER pAd, IN PRX_CONTEXT pRxContext); -VOID RTUSBBulkRxHandle(IN unsigned long data); +void RTUSBBulkRxHandle(IN unsigned long data); /* */ /* Function Prototype in rtusb_io.c */ /* */ -NTSTATUS RTUSBMultiRead(IN PRTMP_ADAPTER pAd, - IN USHORT Offset, OUT PUCHAR pData, IN USHORT length); +int RTUSBMultiRead(IN PRTMP_ADAPTER pAd, + u16 Offset, u8 *pData, u16 length); -NTSTATUS RTUSBMultiWrite(IN PRTMP_ADAPTER pAd, - IN USHORT Offset, IN PUCHAR pData, IN USHORT length); +int RTUSBMultiWrite(IN PRTMP_ADAPTER pAd, + u16 Offset, u8 *pData, u16 length); -NTSTATUS RTUSBMultiWrite_OneByte(IN PRTMP_ADAPTER pAd, - IN USHORT Offset, IN PUCHAR pData); +int RTUSBMultiWrite_OneByte(IN PRTMP_ADAPTER pAd, + u16 Offset, u8 *pData); -NTSTATUS RTUSBReadBBPRegister(IN PRTMP_ADAPTER pAd, - IN UCHAR Id, IN PUCHAR pValue); +int RTUSBReadBBPRegister(IN PRTMP_ADAPTER pAd, + u8 Id, u8 *pValue); -NTSTATUS RTUSBWriteBBPRegister(IN PRTMP_ADAPTER pAd, - IN UCHAR Id, IN UCHAR Value); +int RTUSBWriteBBPRegister(IN PRTMP_ADAPTER pAd, + u8 Id, u8 Value); -NTSTATUS RTUSBWriteRFRegister(IN PRTMP_ADAPTER pAd, IN UINT32 Value); +int RTUSBWriteRFRegister(IN PRTMP_ADAPTER pAd, u32 Value); -NTSTATUS RTUSB_VendorRequest(IN PRTMP_ADAPTER pAd, - IN UINT32 TransferFlags, - IN UCHAR ReservedBits, - IN UCHAR Request, - IN USHORT Value, - IN USHORT Index, - IN PVOID TransferBuffer, - IN UINT32 TransferBufferLength); +int RTUSB_VendorRequest(IN PRTMP_ADAPTER pAd, + u32 TransferFlags, + u8 ReservedBits, + u8 Request, + u16 Value, + u16 Index, + void *TransferBuffer, + u32 TransferBufferLength); -NTSTATUS RTUSBReadEEPROM(IN PRTMP_ADAPTER pAd, - IN USHORT Offset, OUT PUCHAR pData, IN USHORT length); +int RTUSBReadEEPROM(IN PRTMP_ADAPTER pAd, + u16 Offset, u8 *pData, u16 length); -NTSTATUS RTUSBWriteEEPROM(IN PRTMP_ADAPTER pAd, - IN USHORT Offset, IN PUCHAR pData, IN USHORT length); +int RTUSBWriteEEPROM(IN PRTMP_ADAPTER pAd, + u16 Offset, u8 *pData, u16 length); -VOID RTUSBPutToSleep(IN PRTMP_ADAPTER pAd); +void RTUSBPutToSleep(IN PRTMP_ADAPTER pAd); -NTSTATUS RTUSBWakeUp(IN PRTMP_ADAPTER pAd); +int RTUSBWakeUp(IN PRTMP_ADAPTER pAd); -VOID RTUSBInitializeCmdQ(IN PCmdQ cmdq); +void RTUSBInitializeCmdQ(IN PCmdQ cmdq); -NDIS_STATUS RTUSBEnqueueCmdFromNdis(IN PRTMP_ADAPTER pAd, +int RTUSBEnqueueCmdFromNdis(IN PRTMP_ADAPTER pAd, IN NDIS_OID Oid, IN BOOLEAN SetInformation, - IN PVOID pInformationBuffer, - IN UINT32 InformationBufferLength); + void *pInformationBuffer, + u32 InformationBufferLength); -NDIS_STATUS RTUSBEnqueueInternalCmd(IN PRTMP_ADAPTER pAd, +int RTUSBEnqueueInternalCmd(IN PRTMP_ADAPTER pAd, IN NDIS_OID Oid, - IN PVOID pInformationBuffer, - IN UINT32 InformationBufferLength); + void *pInformationBuffer, + u32 InformationBufferLength); -VOID RTUSBDequeueCmd(IN PCmdQ cmdq, OUT PCmdQElmt * pcmdqelmt); +void RTUSBDequeueCmd(IN PCmdQ cmdq, OUT PCmdQElmt * pcmdqelmt); -INT RTUSBCmdThread(IN OUT PVOID Context); +int RTUSBCmdThread(IN void *Context); -VOID RTUSBBssBeaconExit(IN RTMP_ADAPTER * pAd); +void RTUSBBssBeaconExit(IN RTMP_ADAPTER * pAd); -VOID RTUSBBssBeaconStop(IN RTMP_ADAPTER * pAd); +void RTUSBBssBeaconStop(IN RTMP_ADAPTER * pAd); -VOID RTUSBBssBeaconStart(IN RTMP_ADAPTER * pAd); +void RTUSBBssBeaconStart(IN RTMP_ADAPTER * pAd); -VOID RTUSBBssBeaconInit(IN RTMP_ADAPTER * pAd); +void RTUSBBssBeaconInit(IN RTMP_ADAPTER * pAd); -VOID RTUSBWatchDog(IN RTMP_ADAPTER * pAd); +void RTUSBWatchDog(IN RTMP_ADAPTER * pAd); -NTSTATUS RTUSBWriteMACRegister(IN PRTMP_ADAPTER pAd, - IN USHORT Offset, IN UINT32 Value); +int RTUSBWriteMACRegister(IN PRTMP_ADAPTER pAd, + u16 Offset, u32 Value); -NTSTATUS RTUSBReadMACRegister(IN PRTMP_ADAPTER pAd, - IN USHORT Offset, OUT PUINT32 pValue); +int RTUSBReadMACRegister(IN PRTMP_ADAPTER pAd, + u16 Offset, u32 *pValue); -NTSTATUS RTUSBSingleWrite(IN RTMP_ADAPTER * pAd, - IN USHORT Offset, IN USHORT Value); +int RTUSBSingleWrite(IN RTMP_ADAPTER * pAd, + u16 Offset, u16 Value); -NTSTATUS RTUSBFirmwareWrite(IN PRTMP_ADAPTER pAd, - IN PUCHAR pFwImage, IN ULONG FwLen); +int RTUSBFirmwareWrite(IN PRTMP_ADAPTER pAd, + u8 *pFwImage, unsigned long FwLen); -NTSTATUS RTUSBVenderReset(IN PRTMP_ADAPTER pAd); +int RTUSBVenderReset(IN PRTMP_ADAPTER pAd); -NDIS_STATUS RTUSBSetHardWareRegister(IN PRTMP_ADAPTER pAdapter, IN PVOID pBuf); +int RTUSBSetHardWareRegister(IN PRTMP_ADAPTER pAdapter, void *pBuf); -NDIS_STATUS RTUSBQueryHardWareRegister(IN PRTMP_ADAPTER pAdapter, - IN PVOID pBuf); +int RTUSBQueryHardWareRegister(IN PRTMP_ADAPTER pAdapter, + void *pBuf); -VOID CMDHandler(IN PRTMP_ADAPTER pAd); +void CMDHandler(IN PRTMP_ADAPTER pAd); -NDIS_STATUS RTUSBWriteHWMACAddress(IN PRTMP_ADAPTER pAdapter); +int RTUSBWriteHWMACAddress(IN PRTMP_ADAPTER pAdapter); -VOID MacTableInitialize(IN PRTMP_ADAPTER pAd); +void MacTableInitialize(IN PRTMP_ADAPTER pAd); -VOID MlmeSetPsm(IN PRTMP_ADAPTER pAd, IN USHORT psm); +void MlmeSetPsm(IN PRTMP_ADAPTER pAd, u16 psm); -NDIS_STATUS RTMPWPAAddKeyProc(IN PRTMP_ADAPTER pAd, IN PVOID pBuf); +int RTMPWPAAddKeyProc(IN PRTMP_ADAPTER pAd, void *pBuf); -VOID AsicRxAntEvalAction(IN PRTMP_ADAPTER pAd); +void AsicRxAntEvalAction(IN PRTMP_ADAPTER pAd); void append_pkt(IN PRTMP_ADAPTER pAd, - IN PUCHAR pHeader802_3, - IN UINT HdrLen, - IN PUCHAR pData, - IN ULONG DataSize, OUT PNDIS_PACKET * ppPacket); + u8 *pHeader802_3, + u32 HdrLen, + u8 *pData, + unsigned long DataSize, OUT PNDIS_PACKET * ppPacket); -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); -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); -VOID RTUSBMlmeHardTransmit(IN PRTMP_ADAPTER pAd, IN PMGMT_STRUC pMgmt); +void RTUSBMlmeHardTransmit(IN PRTMP_ADAPTER pAd, IN PMGMT_STRUC pMgmt); -INT MlmeThread(IN PVOID Context); +int MlmeThread(void *Context); /* */ /* Function Prototype in rtusb_data.c */ /* */ -NDIS_STATUS RTUSBFreeDescriptorRequest(IN PRTMP_ADAPTER pAd, - IN UCHAR BulkOutPipeId, - IN UINT32 NumberRequired); +int RTUSBFreeDescriptorRequest(IN PRTMP_ADAPTER pAd, + u8 BulkOutPipeId, + u32 NumberRequired); -BOOLEAN RTUSBNeedQueueBackForAgg(IN RTMP_ADAPTER * pAd, IN UCHAR BulkOutPipeId); +BOOLEAN RTUSBNeedQueueBackForAgg(IN RTMP_ADAPTER * pAd, u8 BulkOutPipeId); -VOID RTMPWriteTxInfo(IN PRTMP_ADAPTER pAd, +void RTMPWriteTxInfo(IN PRTMP_ADAPTER pAd, IN PTXINFO_STRUC pTxInfo, - IN USHORT USBDMApktLen, + u16 USBDMApktLen, IN BOOLEAN bWiv, - IN UCHAR QueueSel, IN UCHAR NextValid, IN UCHAR TxBurst); + u8 QueueSel, u8 NextValid, u8 TxBurst); /* */ /* Function Prototype in cmm_data_usb.c */ /* */ -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); -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); -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); -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); -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); -VOID RtmpUSBDataLastTxIdx(IN PRTMP_ADAPTER pAd, - IN UCHAR QueIdx, IN USHORT TxIdx); +void RtmpUSBDataLastTxIdx(IN PRTMP_ADAPTER pAd, + u8 QueIdx, u16 TxIdx); -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); 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); -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); -VOID RtmpUsbStaAsicForceWakeupTimeout(IN PVOID SystemSpecific1, - IN PVOID FunctionContext, - IN PVOID SystemSpecific2, - IN PVOID SystemSpecific3); +void RtmpUsbStaAsicForceWakeupTimeout(void *SystemSpecific1, + void *FunctionContext, + void *SystemSpecific2, + void *SystemSpecific3); -VOID RT28xxUsbStaAsicForceWakeup(IN PRTMP_ADAPTER pAd, IN BOOLEAN bFromTx); +void RT28xxUsbStaAsicForceWakeup(IN PRTMP_ADAPTER pAd, IN BOOLEAN bFromTx); -VOID RT28xxUsbStaAsicSleepThenAutoWakeup(IN PRTMP_ADAPTER pAd, - IN USHORT TbttNumToNextWakeUp); +void RT28xxUsbStaAsicSleepThenAutoWakeup(IN PRTMP_ADAPTER pAd, + u16 TbttNumToNextWakeUp); -VOID RT28xxUsbMlmeRadioOn(IN PRTMP_ADAPTER pAd); +void RT28xxUsbMlmeRadioOn(IN PRTMP_ADAPTER pAd); -VOID RT28xxUsbMlmeRadioOFF(IN PRTMP_ADAPTER pAd); +void RT28xxUsbMlmeRadioOFF(IN PRTMP_ADAPTER pAd); #endif /* RTMP_MAC_USB // */ -VOID AsicTurnOffRFClk(IN PRTMP_ADAPTER pAd, IN UCHAR Channel); +void AsicTurnOffRFClk(IN PRTMP_ADAPTER pAd, u8 Channel); -VOID AsicTurnOnRFClk(IN PRTMP_ADAPTER pAd, IN UCHAR Channel); +void AsicTurnOnRFClk(IN PRTMP_ADAPTER pAd, u8 Channel); #ifdef RTMP_TIMER_TASK_SUPPORT -INT RtmpTimerQThread(IN OUT PVOID Context); +int RtmpTimerQThread(IN void *Context); RTMP_TIMER_TASK_ENTRY *RtmpTimerQInsert(IN RTMP_ADAPTER * pAd, IN RALINK_TIMER_STRUCT * pTimer); @@ -4239,28 +4239,28 @@ void RtmpTimerQExit(IN RTMP_ADAPTER * pAd); void RtmpTimerQInit(IN RTMP_ADAPTER * pAd); #endif /* RTMP_TIMER_TASK_SUPPORT // */ -VOID AsicStaBbpTuning(IN PRTMP_ADAPTER pAd); +void AsicStaBbpTuning(IN PRTMP_ADAPTER pAd); BOOLEAN StaAddMacTableEntry(IN PRTMP_ADAPTER pAd, IN PMAC_TABLE_ENTRY pEntry, - IN UCHAR MaxSupportedRateIn500Kbps, + u8 MaxSupportedRateIn500Kbps, IN HT_CAPABILITY_IE * pHtCapability, - IN UCHAR HtCapabilityLen, + u8 HtCapabilityLen, IN ADD_HT_INFO_IE * pAddHtInfo, - IN UCHAR AddHtInfoLen, IN USHORT CapabilityInfo); + u8 AddHtInfoLen, u16 CapabilityInfo); BOOLEAN AUTH_ReqSend(IN PRTMP_ADAPTER pAd, IN PMLME_QUEUE_ELEM pElem, IN PRALINK_TIMER_STRUCT pAuthTimer, - IN PSTRING pSMName, - IN USHORT SeqNo, - IN PUCHAR pNewElement, IN ULONG ElementLen); + char *pSMName, + u16 SeqNo, + u8 *pNewElement, unsigned long ElementLen); void RTMP_IndicateMediaState(IN PRTMP_ADAPTER pAd); -VOID ReSyncBeaconTime(IN PRTMP_ADAPTER pAd); +void ReSyncBeaconTime(IN PRTMP_ADAPTER pAd); -VOID RTMPSetAGCInitValue(IN PRTMP_ADAPTER pAd, IN UCHAR BandWidth); +void RTMPSetAGCInitValue(IN PRTMP_ADAPTER pAd, u8 BandWidth); int rt28xx_close(IN PNET_DEV dev); int rt28xx_open(IN PNET_DEV dev); @@ -4270,7 +4270,7 @@ int rt28xx_open(IN PNET_DEV dev); #define VIRTUAL_IF_NUM(__pAd) ((__pAd)->VirtualIfCnt) #ifdef LINUX -__inline INT VIRTUAL_IF_UP(PRTMP_ADAPTER pAd) +__inline int VIRTUAL_IF_UP(PRTMP_ADAPTER pAd) { if (VIRTUAL_IF_NUM(pAd) == 0) { if (rt28xx_open(pAd->net_dev) != 0) { @@ -4284,7 +4284,7 @@ __inline INT VIRTUAL_IF_UP(PRTMP_ADAPTER pAd) return 0; } -__inline VOID VIRTUAL_IF_DOWN(PRTMP_ADAPTER pAd) +__inline void VIRTUAL_IF_DOWN(PRTMP_ADAPTER pAd) { VIRTUAL_IF_DEC(pAd); if (VIRTUAL_IF_NUM(pAd) == 0) @@ -4298,12 +4298,12 @@ __inline VOID VIRTUAL_IF_DOWN(PRTMP_ADAPTER pAd) TODO: Maybe we need to move these function prototypes to other proper place. */ int RtmpOSWrielessEventSend(IN RTMP_ADAPTER * pAd, - IN UINT32 eventType, - IN INT flags, - IN PUCHAR pSrcMac, - IN PUCHAR pData, IN UINT32 dataLen); + u32 eventType, + int flags, + u8 *pSrcMac, + u8 *pData, u32 dataLen); -int RtmpOSNetDevAddrSet(IN PNET_DEV pNetDev, IN PUCHAR pMacAddr); +int RtmpOSNetDevAddrSet(IN PNET_DEV pNetDev, u8 *pMacAddr); int RtmpOSNetDevAttach(IN PNET_DEV pNetDev, IN RTMP_OS_NETDEV_OP_HOOK * pDevOpHook); @@ -4312,32 +4312,32 @@ void RtmpOSNetDevClose(IN PNET_DEV pNetDev); void RtmpOSNetDevDetach(IN PNET_DEV pNetDev); -INT RtmpOSNetDevAlloc(IN PNET_DEV * pNewNetDev, IN UINT32 privDataSize); +int RtmpOSNetDevAlloc(IN PNET_DEV * pNewNetDev, u32 privDataSize); void RtmpOSNetDevFree(IN PNET_DEV pNetDev); -PNET_DEV RtmpOSNetDevGetByName(IN PNET_DEV pNetDev, IN PSTRING pDevName); +PNET_DEV RtmpOSNetDevGetByName(IN PNET_DEV pNetDev, char *pDevName); void RtmpOSNetDeviceRefPut(IN PNET_DEV pNetDev); PNET_DEV RtmpOSNetDevCreate(IN RTMP_ADAPTER * pAd, - IN INT devType, - IN INT devNum, - IN INT privMemSize, IN PSTRING pNamePrefix); + int devType, + int devNum, + int privMemSize, char *pNamePrefix); /* Task operation related function prototypes */ void RtmpOSTaskCustomize(IN RTMP_OS_TASK * pTask); -INT RtmpOSTaskNotifyToExit(IN RTMP_OS_TASK * pTask); +int RtmpOSTaskNotifyToExit(IN RTMP_OS_TASK * pTask); -NDIS_STATUS RtmpOSTaskKill(IN RTMP_OS_TASK * pTask); +int RtmpOSTaskKill(IN RTMP_OS_TASK * pTask); -NDIS_STATUS RtmpOSTaskInit(IN RTMP_OS_TASK * pTask, - PSTRING pTaskName, VOID * pPriv); +int RtmpOSTaskInit(IN RTMP_OS_TASK * pTask, + char *pTaskName, void * pPriv); -NDIS_STATUS RtmpOSTaskAttach(IN RTMP_OS_TASK * pTask, +int RtmpOSTaskAttach(IN RTMP_OS_TASK * pTask, IN int (*fn) (void *), IN void *arg); /* diff --git a/drivers/staging/rt2860/rtmp_chip.h b/drivers/staging/rt2860/rtmp_chip.h index ea8d2ed..a089472 100644 --- a/drivers/staging/rt2860/rtmp_chip.h +++ b/drivers/staging/rt2860/rtmp_chip.h @@ -161,7 +161,7 @@ * EEPROM operation related marcos */ #define RT28xx_EEPROM_READ16(_pAd, _offset, _value) \ - (_pAd)->chipOps.eeread((RTMP_ADAPTER *)(_pAd), (USHORT)(_offset), (PUSHORT)&(_value)) + (_pAd)->chipOps.eeread((RTMP_ADAPTER *)(_pAd), (u16)(_offset), (u16 *)&(_value)) /* ------------------------------------------------------------------- */ /* E2PROM data layout */ @@ -172,10 +172,10 @@ /* */ typedef union _MCU_LEDCS_STRUC { struct { - UCHAR LedMode:7; - UCHAR Polarity:1; + u8 LedMode:7; + u8 Polarity:1; } field; - UCHAR word; + u8 word; } MCU_LEDCS_STRUC, *PMCU_LEDCS_STRUC; /* */ @@ -183,32 +183,32 @@ typedef union _MCU_LEDCS_STRUC { /* */ typedef union _EEPROM_ANTENNA_STRUC { struct { - USHORT RxPath:4; /* 1: 1R, 2: 2R, 3: 3R */ - USHORT TxPath:4; /* 1: 1T, 2: 2T */ - USHORT RfIcType:4; /* see E2PROM document */ - USHORT Rsv:4; + u16 RxPath:4; /* 1: 1R, 2: 2R, 3: 3R */ + u16 TxPath:4; /* 1: 1T, 2: 2T */ + u16 RfIcType:4; /* see E2PROM document */ + u16 Rsv:4; } field; - USHORT word; + u16 word; } EEPROM_ANTENNA_STRUC, *PEEPROM_ANTENNA_STRUC; typedef union _EEPROM_NIC_CINFIG2_STRUC { struct { - USHORT HardwareRadioControl:1; /* 1:enable, 0:disable */ - USHORT DynamicTxAgcControl:1; /* */ - USHORT ExternalLNAForG:1; /* */ - USHORT ExternalLNAForA:1; /* external LNA enable for 2.4G */ - USHORT CardbusAcceleration:1; /* !!! NOTE: 0 - enable, 1 - disable */ - USHORT BW40MSidebandForG:1; - USHORT BW40MSidebandForA:1; - USHORT EnableWPSPBC:1; /* WPS PBC Control bit */ - USHORT BW40MAvailForG:1; /* 0:enable, 1:disable */ - USHORT BW40MAvailForA:1; /* 0:enable, 1:disable */ - USHORT Rsv1:1; /* must be 0 */ - USHORT AntDiversity:1; /* Antenna diversity */ - USHORT Rsv2:3; /* must be 0 */ - USHORT DACTestBit:1; /* control if driver should patch the DAC issue */ + u16 HardwareRadioControl:1; /* 1:enable, 0:disable */ + u16 DynamicTxAgcControl:1; /* */ + u16 ExternalLNAForG:1; /* */ + u16 ExternalLNAForA:1; /* external LNA enable for 2.4G */ + u16 CardbusAcceleration:1; /* !!! NOTE: 0 - enable, 1 - disable */ + u16 BW40MSidebandForG:1; + u16 BW40MSidebandForA:1; + u16 EnableWPSPBC:1; /* WPS PBC Control bit */ + u16 BW40MAvailForG:1; /* 0:enable, 1:disable */ + u16 BW40MAvailForA:1; /* 0:enable, 1:disable */ + u16 Rsv1:1; /* must be 0 */ + u16 AntDiversity:1; /* Antenna diversity */ + u16 Rsv2:3; /* must be 0 */ + u16 DACTestBit:1; /* control if driver should patch the DAC issue */ } field; - USHORT word; + u16 word; } EEPROM_NIC_CONFIG2_STRUC, *PEEPROM_NIC_CONFIG2_STRUC; /* */ @@ -216,43 +216,43 @@ typedef union _EEPROM_NIC_CINFIG2_STRUC { /* */ typedef union _EEPROM_TX_PWR_STRUC { struct { - CHAR Byte0; /* Low Byte */ - CHAR Byte1; /* High Byte */ + char Byte0; /* Low Byte */ + char Byte1; /* High Byte */ } field; - USHORT word; + u16 word; } EEPROM_TX_PWR_STRUC, *PEEPROM_TX_PWR_STRUC; typedef union _EEPROM_VERSION_STRUC { struct { - UCHAR FaeReleaseNumber; /* Low Byte */ - UCHAR Version; /* High Byte */ + u8 FaeReleaseNumber; /* Low Byte */ + u8 Version; /* High Byte */ } field; - USHORT word; + u16 word; } EEPROM_VERSION_STRUC, *PEEPROM_VERSION_STRUC; typedef union _EEPROM_LED_STRUC { struct { - USHORT PolarityRDY_G:1; /* Polarity RDY_G setting. */ - USHORT PolarityRDY_A:1; /* Polarity RDY_A setting. */ - USHORT PolarityACT:1; /* Polarity ACT setting. */ - USHORT PolarityGPIO_0:1; /* Polarity GPIO#0 setting. */ - USHORT PolarityGPIO_1:1; /* Polarity GPIO#1 setting. */ - USHORT PolarityGPIO_2:1; /* Polarity GPIO#2 setting. */ - USHORT PolarityGPIO_3:1; /* Polarity GPIO#3 setting. */ - USHORT PolarityGPIO_4:1; /* Polarity GPIO#4 setting. */ - USHORT LedMode:5; /* Led mode. */ - USHORT Rsvd:3; /* Reserved */ + u16 PolarityRDY_G:1; /* Polarity RDY_G setting. */ + u16 PolarityRDY_A:1; /* Polarity RDY_A setting. */ + u16 PolarityACT:1; /* Polarity ACT setting. */ + u16 PolarityGPIO_0:1; /* Polarity GPIO#0 setting. */ + u16 PolarityGPIO_1:1; /* Polarity GPIO#1 setting. */ + u16 PolarityGPIO_2:1; /* Polarity GPIO#2 setting. */ + u16 PolarityGPIO_3:1; /* Polarity GPIO#3 setting. */ + u16 PolarityGPIO_4:1; /* Polarity GPIO#4 setting. */ + u16 LedMode:5; /* Led mode. */ + u16 Rsvd:3; /* Reserved */ } field; - USHORT word; + u16 word; } EEPROM_LED_STRUC, *PEEPROM_LED_STRUC; typedef union _EEPROM_TXPOWER_DELTA_STRUC { struct { - UCHAR DeltaValue:6; /* Tx Power dalta value (MAX=4) */ - UCHAR Type:1; /* 1: plus the delta value, 0: minus the delta value */ - UCHAR TxPowerEnable:1; /* Enable */ + u8 DeltaValue:6; /* Tx Power dalta value (MAX=4) */ + u8 Type:1; /* 1: plus the delta value, 0: minus the delta value */ + u8 TxPowerEnable:1; /* Enable */ } field; - UCHAR value; + u8 value; } EEPROM_TXPOWER_DELTA_STRUC, *PEEPROM_TXPOWER_DELTA_STRUC; #endif /* __RTMP_CHIP_H__ // */ diff --git a/drivers/staging/rt2860/rtmp_ckipmic.h b/drivers/staging/rt2860/rtmp_ckipmic.h index a8108f7..301ba5f 100644 --- a/drivers/staging/rt2860/rtmp_ckipmic.h +++ b/drivers/staging/rt2860/rtmp_ckipmic.h @@ -39,25 +39,25 @@ typedef struct _MIC_CONTEXT { /* --- MMH context */ - UCHAR CK[16]; /* the key */ - UCHAR coefficient[16]; /* current aes counter mode coefficients */ - ULONGLONG accum; /* accumulated mic, reduced to u32 in final() */ - UINT position; /* current position (byte offset) in message */ - UCHAR part[4]; /* for conversion of message to u32 for mmh */ + u8 CK[16]; /* the key */ + u8 coefficient[16]; /* current aes counter mode coefficients */ + unsigned long long accum; /* accumulated mic, reduced to u32 in final() */ + u32 position; /* current position (byte offset) in message */ + u8 part[4]; /* for conversion of message to u32 for mmh */ } MIC_CONTEXT, *PMIC_CONTEXT; -VOID xor_128(IN PUCHAR a, IN PUCHAR b, OUT PUCHAR out); +void xor_128(u8 *a, u8 *b, u8 *out); -UCHAR RTMPCkipSbox(IN UCHAR a); +u8 RTMPCkipSbox(u8 a); -VOID xor_32(IN PUCHAR a, IN PUCHAR b, OUT PUCHAR out); +void xor_32(u8 *a, u8 *b, u8 *out); -VOID next_key(IN PUCHAR key, IN INT round); +void next_key(u8 *key, int round); -VOID byte_sub(IN PUCHAR in, OUT PUCHAR out); +void byte_sub(u8 *in, u8 *out); -VOID shift_row(IN PUCHAR in, OUT PUCHAR out); +void shift_row(u8 *in, u8 *out); -VOID mix_column(IN PUCHAR in, OUT PUCHAR out); +void mix_column(u8 *in, u8 *out); #endif /*__RTMP_CKIPMIC_H__ */ diff --git a/drivers/staging/rt2860/rtmp_def.h b/drivers/staging/rt2860/rtmp_def.h index 39c27f9..92f6114 100644 --- a/drivers/staging/rt2860/rtmp_def.h +++ b/drivers/staging/rt2860/rtmp_def.h @@ -51,8 +51,8 @@ #define RT_DEBUG_INFO 4 #define RT_DEBUG_LOUD 5 -#define NIC_TAG ((ULONG)'0682') -#define NIC_DBG_STRING ("**RT28xx**") +#define NIC_TAG ((unsigned long)'0682') +#define NIC_DBG_char ("**RT28xx**") #ifdef RTMP_MAC_USB #define TX_RING_SIZE 8 /* 1 */ @@ -65,9 +65,9 @@ /*#define PACKED */ -#define RALINK_2883_VERSION ((UINT32)0x28830300) -#define RALINK_2880E_VERSION ((UINT32)0x28720200) -#define RALINK_3070_VERSION ((UINT32)0x30700200) +#define RALINK_2883_VERSION ((u32)0x28830300) +#define RALINK_2880E_VERSION ((u32)0x28720200) +#define RALINK_3070_VERSION ((u32)0x30700200) #define MAX_RX_PKT_LEN 1520 @@ -453,7 +453,7 @@ /* Reason code definitions */ #define REASON_RESERVED 0 #define REASON_UNSPECIFY 1 -#define REASON_NO_LONGER_VALID 2 +#define REASON_NO_longER_VALID 2 #define REASON_DEAUTH_STA_LEAVING 3 #define REASON_DISASSOC_INACTIVE 4 #define REASON_DISASSPC_AP_UNABLE 5 @@ -533,7 +533,7 @@ #define IE_TCLAS 14 /* 802.11e d9 */ #define IE_SCHEDULE 15 /* 802.11e d9 */ #define IE_CHALLENGE_TEXT 16 -#define IE_POWER_CONSTRAINT 32 /* 802.11h d3.3 */ +#define IE_POWER_CONSTRAint 32 /* 802.11h d3.3 */ #define IE_POWER_CAPABILITY 33 /* 802.11h d3.3 */ #define IE_TPC_REQUEST 34 /* 802.11h d3.3 */ #define IE_TPC_REPORT 35 /* 802.11h d3.3 */ @@ -980,10 +980,10 @@ #define MODE_HTGREENFIELD 3 /* MCS for CCK. BW.SGI.STBC are reserved */ -#define MCS_LONGP_RATE_1 0 /* long preamble CCK 1Mbps */ -#define MCS_LONGP_RATE_2 1 /* long preamble CCK 1Mbps */ -#define MCS_LONGP_RATE_5_5 2 -#define MCS_LONGP_RATE_11 3 +#define MCS_longP_RATE_1 0 /* long preamble CCK 1Mbps */ +#define MCS_longP_RATE_2 1 /* long preamble CCK 1Mbps */ +#define MCS_longP_RATE_5_5 2 +#define MCS_longP_RATE_11 3 #define MCS_SHORTP_RATE_1 4 /* long preamble CCK 1Mbps. short is forbidden in 1Mbps */ #define MCS_SHORTP_RATE_2 5 /* short preamble CCK 2Mbps */ #define MCS_SHORTP_RATE_5_5 6 @@ -1109,7 +1109,7 @@ #define IFS_BACKOFF 3 /* pTxD->RetryMode */ -#define LONG_RETRY 1 +#define long_RETRY 1 #define SHORT_RETRY 0 /* Country Region definition */ @@ -1211,7 +1211,7 @@ /* ========================= AP rtmp_def.h =========================== */ /* value domain for pAd->EventTab.Log[].Event */ -#define EVENT_RESET_ACCESS_POINT 0 /* Log = "hh:mm:ss Restart Access Point" */ +#define EVENT_RESET_ACCESS_POint 0 /* Log = "hh:mm:ss Restart Access Point" */ #define EVENT_ASSOCIATED 1 /* Log = "hh:mm:ss STA 00:01:02:03:04:05 associated" */ #define EVENT_DISASSOCIATED 2 /* Log = "hh:mm:ss STA 00:01:02:03:04:05 left this BSS" */ #define EVENT_AGED_OUT 3 /* Log = "hh:mm:ss STA 00:01:02:03:04:05 was aged-out and removed from this BSS" */ @@ -1356,34 +1356,34 @@ /* Endian byte swapping codes */ #define SWAP16(x) \ - ((UINT16)( \ - (((UINT16)(x) & (UINT16) 0x00ffU) << 8) | \ - (((UINT16)(x) & (UINT16) 0xff00U) >> 8) )) + ((u16)( \ + (((u16)(x) & (u16)0x00ffU) << 8) | \ + (((u16)(x) & (u16)0xff00U) >> 8) )) #define SWAP32(x) \ - ((UINT32)( \ - (((UINT32)(x) & (UINT32) 0x000000ffUL) << 24) | \ - (((UINT32)(x) & (UINT32) 0x0000ff00UL) << 8) | \ - (((UINT32)(x) & (UINT32) 0x00ff0000UL) >> 8) | \ - (((UINT32)(x) & (UINT32) 0xff000000UL) >> 24) )) + ((u32)( \ + (((u32)(x) & (u32)0x000000ffUL) << 24) | \ + (((u32)(x) & (u32)0x0000ff00UL) << 8) | \ + (((u32)(x) & (u32)0x00ff0000UL) >> 8) | \ + (((u32)(x) & (u32)0xff000000UL) >> 24) )) #define SWAP64(x) \ - ((UINT64)( \ - (UINT64)(((UINT64)(x) & (UINT64) 0x00000000000000ffULL) << 56) | \ - (UINT64)(((UINT64)(x) & (UINT64) 0x000000000000ff00ULL) << 40) | \ - (UINT64)(((UINT64)(x) & (UINT64) 0x0000000000ff0000ULL) << 24) | \ - (UINT64)(((UINT64)(x) & (UINT64) 0x00000000ff000000ULL) << 8) | \ - (UINT64)(((UINT64)(x) & (UINT64) 0x000000ff00000000ULL) >> 8) | \ - (UINT64)(((UINT64)(x) & (UINT64) 0x0000ff0000000000ULL) >> 24) | \ - (UINT64)(((UINT64)(x) & (UINT64) 0x00ff000000000000ULL) >> 40) | \ - (UINT64)(((UINT64)(x) & (UINT64) 0xff00000000000000ULL) >> 56) )) - -#define cpu2le64(x) ((UINT64)(x)) -#define le2cpu64(x) ((UINT64)(x)) -#define cpu2le32(x) ((UINT32)(x)) -#define le2cpu32(x) ((UINT32)(x)) -#define cpu2le16(x) ((UINT16)(x)) -#define le2cpu16(x) ((UINT16)(x)) + ((u64)( \ + (u64)(((u64)(x) & (u64)0x00000000000000ffULL) << 56) | \ + (u64)(((u64)(x) & (u64)0x000000000000ff00ULL) << 40) | \ + (u64)(((u64)(x) & (u64)0x0000000000ff0000ULL) << 24) | \ + (u64)(((u64)(x) & (u64)0x00000000ff000000ULL) << 8) | \ + (u64)(((u64)(x) & (u64)0x000000ff00000000ULL) >> 8) | \ + (u64)(((u64)(x) & (u64)0x0000ff0000000000ULL) >> 24) | \ + (u64)(((u64)(x) & (u64)0x00ff000000000000ULL) >> 40) | \ + (u64)(((u64)(x) & (u64)0xff00000000000000ULL) >> 56) )) + +#define cpu2le64(x) ((u64)(x)) +#define le2cpu64(x) ((u64)(x)) +#define cpu2le32(x) ((u32)(x)) +#define le2cpu32(x) ((u32)(x)) +#define cpu2le16(x) ((u16)(x)) +#define le2cpu16(x) ((u16)(x)) #define cpu2be64(x) SWAP64((x)) #define be2cpu64(x) SWAP64((x)) #define cpu2be32(x) SWAP32((x)) @@ -1395,7 +1395,7 @@ #define A2Dec(_X, _p) \ { \ - UCHAR *p; \ + u8 *p; \ _X = 0; \ p = _p; \ while (((*p >= '0') && (*p <= '9'))) \ diff --git a/drivers/staging/rt2860/rtmp_dot11.h b/drivers/staging/rt2860/rtmp_dot11.h index fd9c720..e970343 100644 --- a/drivers/staging/rt2860/rtmp_dot11.h +++ b/drivers/staging/rt2860/rtmp_dot11.h @@ -32,69 +32,69 @@ /* 4-byte HTC field. maybe included in any frame except non-QOS data frame. The Order bit must set 1. */ typedef struct PACKED { - UINT32 MA:1; /*management action payload exist in (QoS Null+HTC) */ - UINT32 TRQ:1; /*sounding request */ - UINT32 MRQ:1; /*MCS feedback. Request for a MCS feedback */ - UINT32 MRSorASI:3; /* MRQ Sequence identifier. unchanged during entire procedure. 0x000-0x110. */ - UINT32 MFS:3; /*SET to the received value of MRS. 0x111 for unsolicited MFB. */ - UINT32 MFBorASC:7; /*Link adaptation feedback containing recommended MCS. 0x7f for no feedback or not available */ - UINT32 CalPos:2; /* calibration position */ - UINT32 CalSeq:2; /*calibration sequence */ - UINT32 FBKReq:2; /*feedback request */ - UINT32 CSISTEERING:2; /*CSI/ STEERING */ - UINT32 ZLFAnnouce:1; /* ZLF announcement */ - UINT32 rsv:5; /*calibration sequence */ - UINT32 ACConstraint:1; /*feedback request */ - UINT32 RDG:1; /*RDG / More PPDU */ + u32 MA:1; /*management action payload exist in (QoS Null+HTC) */ + u32 TRQ:1; /*sounding request */ + u32 MRQ:1; /*MCS feedback. Request for a MCS feedback */ + u32 MRSorASI:3; /* MRQ Sequence identifier. unchanged during entire procedure. 0x000-0x110. */ + u32 MFS:3; /*SET to the received value of MRS. 0x111 for unsolicited MFB. */ + u32 MFBorASC:7; /*Link adaptation feedback containing recommended MCS. 0x7f for no feedback or not available */ + u32 CalPos:2; /* calibration position */ + u32 CalSeq:2; /*calibration sequence */ + u32 FBKReq:2; /*feedback request */ + u32 CSISTEERING:2; /*CSI/ STEERING */ + u32 ZLFAnnouce:1; /* ZLF announcement */ + u32 rsv:5; /*calibration sequence */ + u32 ACConstraint:1; /*feedback request */ + u32 RDG:1; /*RDG / More PPDU */ } HT_CONTROL, *PHT_CONTROL; /* 2-byte QOS CONTROL field */ typedef struct PACKED { - USHORT TID:4; - USHORT EOSP:1; - USHORT AckPolicy:2; /*0: normal ACK 1:No ACK 2:scheduled under MTBA/PSMP 3: BA */ - USHORT AMsduPresent:1; - USHORT Txop_QueueSize:8; + u16 TID:4; + u16 EOSP:1; + u16 AckPolicy:2; /*0: normal ACK 1:No ACK 2:scheduled under MTBA/PSMP 3: BA */ + u16 AMsduPresent:1; + u16 Txop_QueueSize:8; } QOS_CONTROL, *PQOS_CONTROL; /* 2-byte Frame control field */ typedef struct PACKED { - USHORT Ver:2; /* Protocol version */ - USHORT Type:2; /* MSDU type */ - USHORT SubType:4; /* MSDU subtype */ - USHORT ToDs:1; /* To DS indication */ - USHORT FrDs:1; /* From DS indication */ - USHORT MoreFrag:1; /* More fragment bit */ - USHORT Retry:1; /* Retry status bit */ - USHORT PwrMgmt:1; /* Power management bit */ - USHORT MoreData:1; /* More data bit */ - USHORT Wep:1; /* Wep data */ - USHORT Order:1; /* Strict order expected */ + u16 Ver:2; /* Protocol version */ + u16 Type:2; /* MSDU type */ + u16 SubType:4; /* MSDU subtype */ + u16 ToDs:1; /* To DS indication */ + u16 FrDs:1; /* From DS indication */ + u16 MoreFrag:1; /* More fragment bit */ + u16 Retry:1; /* Retry status bit */ + u16 PwrMgmt:1; /* Power management bit */ + u16 MoreData:1; /* More data bit */ + u16 Wep:1; /* Wep data */ + u16 Order:1; /* Strict order expected */ } FRAME_CONTROL, *PFRAME_CONTROL; typedef struct PACKED _HEADER_802_11 { FRAME_CONTROL FC; - USHORT Duration; - UCHAR Addr1[MAC_ADDR_LEN]; - UCHAR Addr2[MAC_ADDR_LEN]; - UCHAR Addr3[MAC_ADDR_LEN]; - USHORT Frag:4; - USHORT Sequence:12; - UCHAR Octet[0]; + u16 Duration; + u8 Addr1[MAC_ADDR_LEN]; + u8 Addr2[MAC_ADDR_LEN]; + u8 Addr3[MAC_ADDR_LEN]; + u16 Frag:4; + u16 Sequence:12; + u8 Octet[0]; } HEADER_802_11, *PHEADER_802_11; typedef struct PACKED _PSPOLL_FRAME { FRAME_CONTROL FC; - USHORT Aid; - UCHAR Bssid[MAC_ADDR_LEN]; - UCHAR Ta[MAC_ADDR_LEN]; + u16 Aid; + u8 Bssid[MAC_ADDR_LEN]; + u8 Ta[MAC_ADDR_LEN]; } PSPOLL_FRAME, *PPSPOLL_FRAME; typedef struct PACKED _RTS_FRAME { FRAME_CONTROL FC; - USHORT Duration; - UCHAR Addr1[MAC_ADDR_LEN]; - UCHAR Addr2[MAC_ADDR_LEN]; + u16 Duration; + u8 Addr1[MAC_ADDR_LEN]; + u8 Addr2[MAC_ADDR_LEN]; } RTS_FRAME, *PRTS_FRAME; #endif /* __DOT11_BASE_H__ // */ diff --git a/drivers/staging/rt2860/rtmp_iface.h b/drivers/staging/rt2860/rtmp_iface.h index 84b08a0..cafb618 100644 --- a/drivers/staging/rt2860/rtmp_iface.h +++ b/drivers/staging/rt2860/rtmp_iface.h @@ -50,8 +50,8 @@ typedef struct _INF_PCI_CONFIG_ { } INF_PCI_CONFIG; typedef struct _INF_USB_CONFIG_ { - UINT8 BulkInEpAddr; /* bulk-in endpoint address */ - UINT8 BulkOutEpAddr[6]; /* bulk-out endpoint address */ + u8 BulkInEpAddr; /* bulk-in endpoint address */ + u8 BulkOutEpAddr[6]; /* bulk-out endpoint address */ } INF_USB_CONFIG; typedef struct _INF_RBUS_CONFIG_ { diff --git a/drivers/staging/rt2860/rtmp_mcu.h b/drivers/staging/rt2860/rtmp_mcu.h index 1c31700..378f01e 100644 --- a/drivers/staging/rt2860/rtmp_mcu.h +++ b/drivers/staging/rt2860/rtmp_mcu.h @@ -38,12 +38,12 @@ #ifndef __RTMP_MCU_H__ #define __RTMP_MCU_H__ -INT RtmpAsicEraseFirmware(IN PRTMP_ADAPTER pAd); +int RtmpAsicEraseFirmware(IN PRTMP_ADAPTER pAd); -NDIS_STATUS RtmpAsicLoadFirmware(IN PRTMP_ADAPTER pAd); +int RtmpAsicLoadFirmware(IN PRTMP_ADAPTER pAd); -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); #endif /* __RTMP_MCU_H__ // */ diff --git a/drivers/staging/rt2860/rtmp_timer.h b/drivers/staging/rt2860/rtmp_timer.h index e136576..441571d 100644 --- a/drivers/staging/rt2860/rtmp_timer.h +++ b/drivers/staging/rt2860/rtmp_timer.h @@ -55,10 +55,10 @@ /* submit to ctrl pipe). So we need a wrapper function to take care it. */ #ifdef RTMP_TIMER_TASK_SUPPORT -typedef VOID(*RTMP_TIMER_TASK_HANDLE) (IN PVOID SystemSpecific1, - IN PVOID FunctionContext, - IN PVOID SystemSpecific2, - IN PVOID SystemSpecific3); +typedef void(*RTMP_TIMER_TASK_HANDLE) (void *SystemSpecific1, + void *FunctionContext, + void *SystemSpecific2, + void *SystemSpecific3); #endif /* RTMP_TIMER_TASK_SUPPORT // */ typedef struct _RALINK_TIMER_STRUCT { @@ -67,8 +67,8 @@ typedef struct _RALINK_TIMER_STRUCT { BOOLEAN State; /* True if timer cancelled */ BOOLEAN PeriodicType; /* True if timer is periodic timer */ BOOLEAN Repeat; /* True if periodic timer */ - ULONG TimerValue; /* Timer value in milliseconds */ - ULONG cookie; /* os specific object */ + unsigned long TimerValue; /* Timer value in milliseconds */ + unsigned long cookie; /* os specific object */ #ifdef RTMP_TIMER_TASK_SUPPORT RTMP_TIMER_TASK_HANDLE handle; void *pAd; @@ -109,7 +109,7 @@ void rtmp_timer_##_func(unsigned long data) \ { \ PRALINK_TIMER_STRUCT pTimer = (PRALINK_TIMER_STRUCT) data; \ \ - _func(NULL, (PVOID) pTimer->cookie, NULL, pTimer); \ + _func(NULL, (void *)pTimer->cookie, NULL, pTimer); \ if (pTimer->Repeat) \ RTMP_OS_Add_Timer(&pTimer->TimerObj, pTimer->TimerValue); \ } diff --git a/drivers/staging/rt2860/rtmp_type.h b/drivers/staging/rt2860/rtmp_type.h index 11e3591c..8de1428 100644 --- a/drivers/staging/rt2860/rtmp_type.h +++ b/drivers/staging/rt2860/rtmp_type.h @@ -38,100 +38,51 @@ #ifndef __RTMP_TYPE_H__ #define __RTMP_TYPE_H__ -#define PACKED __attribute__ ((packed)) - -#ifdef LINUX -/* Put platform dependent declaration here */ -/* For example, linux type definition */ -typedef unsigned char UINT8; -typedef unsigned short UINT16; -typedef unsigned int UINT32; -typedef unsigned long long UINT64; -typedef int INT32; -typedef long long INT64; -#endif /* LINUX // */ - -typedef unsigned char *PUINT8; -typedef unsigned short *PUINT16; -typedef unsigned int *PUINT32; -typedef unsigned long long *PUINT64; -typedef int *PINT32; -typedef long long *PINT64; - -/* modified for fixing compile warning on Sigma 8634 platform */ -typedef char STRING; -typedef signed char CHAR; - -typedef signed short SHORT; -typedef signed int INT; -typedef signed long LONG; -typedef signed long long LONGLONG; +#include <linux/types.h> -#ifdef LINUX -typedef unsigned char UCHAR; -typedef unsigned short USHORT; -typedef unsigned int UINT; -typedef unsigned long ULONG; -#endif /* LINUX // */ -typedef unsigned long long ULONGLONG; +#define PACKED __attribute__ ((packed)) typedef unsigned char BOOLEAN; -#ifdef LINUX -typedef void VOID; -#endif /* LINUX // */ - -typedef char *PSTRING; -typedef VOID *PVOID; -typedef CHAR *PCHAR; -typedef UCHAR *PUCHAR; -typedef USHORT *PUSHORT; -typedef LONG *PLONG; -typedef ULONG *PULONG; -typedef UINT *PUINT; - -typedef unsigned int NDIS_MEDIA_STATE; typedef union _LARGE_INTEGER { struct { - UINT LowPart; - INT32 HighPart; + u32 LowPart; + int HighPart; } u; - INT64 QuadPart; + long long QuadPart; } LARGE_INTEGER; /* */ /* Register set pair for initialzation register set definition */ /* */ typedef struct _RTMP_REG_PAIR { - ULONG Register; - ULONG Value; + unsigned long Register; + unsigned long Value; } RTMP_REG_PAIR, *PRTMP_REG_PAIR; typedef struct _REG_PAIR { - UCHAR Register; - UCHAR Value; + u8 Register; + u8 Value; } REG_PAIR, *PREG_PAIR; /* */ /* Register set pair for initialzation register set definition */ /* */ typedef struct _RTMP_RF_REGS { - UCHAR Channel; - ULONG R1; - ULONG R2; - ULONG R3; - ULONG R4; + u8 Channel; + unsigned long R1; + unsigned long R2; + unsigned long R3; + unsigned long R4; } RTMP_RF_REGS, *PRTMP_RF_REGS; typedef struct _FREQUENCY_ITEM { - UCHAR Channel; - UCHAR N; - UCHAR R; - UCHAR K; + u8 Channel; + u8 N; + u8 R; + u8 K; } FREQUENCY_ITEM, *PFREQUENCY_ITEM; -typedef int NTSTATUS; - #define STATUS_SUCCESS 0x00 #define STATUS_UNSUCCESSFUL 0x01 diff --git a/drivers/staging/rt2860/rtusb_io.h b/drivers/staging/rt2860/rtusb_io.h index ec1ffba..547f6ab 100644 --- a/drivers/staging/rt2860/rtusb_io.h +++ b/drivers/staging/rt2860/rtusb_io.h @@ -79,25 +79,25 @@ /*CMDTHREAD_VENDOR_EEPROM_READ */ /*CMDTHREAD_VENDOR_EEPROM_WRITE */ typedef struct _CMDHandler_TLV { - USHORT Offset; - USHORT Length; - UCHAR DataFirst; + u16 Offset; + u16 Length; + u8 DataFirst; } CMDHandler_TLV, *PCMDHandler_TLV; typedef struct _CmdQElmt { - UINT command; - PVOID buffer; - ULONG bufferlength; + u32 command; + void *buffer; + unsigned long bufferlength; BOOLEAN CmdFromNdis; BOOLEAN SetOperation; struct _CmdQElmt *next; } CmdQElmt, *PCmdQElmt; typedef struct _CmdQ { - UINT size; + u32 size; CmdQElmt *head; CmdQElmt *tail; - UINT32 CmdQState; + u32 CmdQState; } CmdQ, *PCmdQ; #define EnqueueCmd(cmdq, cmdqelmt) \ diff --git a/drivers/staging/rt2860/spectrum.h b/drivers/staging/rt2860/spectrum.h index b1e3ba0..b4e9fbc 100644 --- a/drivers/staging/rt2860/spectrum.h +++ b/drivers/staging/rt2860/spectrum.h @@ -31,7 +31,7 @@ #include "rtmp_type.h" #include "spectrum_def.h" -CHAR RTMP_GetTxPwr(IN PRTMP_ADAPTER pAd, IN HTTRANSMIT_SETTING HTTxMode); +char RTMP_GetTxPwr(IN PRTMP_ADAPTER pAd, IN HTTRANSMIT_SETTING HTTxMode); /* ========================================================================== @@ -45,16 +45,16 @@ CHAR RTMP_GetTxPwr(IN PRTMP_ADAPTER pAd, IN HTTRANSMIT_SETTING HTTxMode); 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); /* ========================================================================== @@ -68,13 +68,13 @@ 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); /* ========================================================================== @@ -88,7 +88,7 @@ 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); /* ========================================================================== @@ -102,9 +102,9 @@ 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); /* ========================================================================== @@ -120,8 +120,8 @@ 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); /* ========================================================================== @@ -135,7 +135,7 @@ VOID EnqueueChSwAnn(IN PRTMP_ADAPTER pAd, Return : None. ========================================================================== */ -VOID PeerSpectrumAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem); +void PeerSpectrumAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem); /* ========================================================================== @@ -146,44 +146,44 @@ 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); -INT Set_TpcReq_Proc(IN PRTMP_ADAPTER pAd, IN PSTRING arg); +int Set_TpcReq_Proc(IN PRTMP_ADAPTER pAd, char *arg); -INT Set_PwrConstraint(IN PRTMP_ADAPTER pAd, IN PSTRING arg); +int Set_PwrConstraint(IN PRTMP_ADAPTER pAd, char *arg); -VOID MeasureReqTabInit(IN PRTMP_ADAPTER pAd); +void MeasureReqTabInit(IN PRTMP_ADAPTER pAd); -VOID MeasureReqTabExit(IN PRTMP_ADAPTER pAd); +void MeasureReqTabExit(IN PRTMP_ADAPTER pAd); -PMEASURE_REQ_ENTRY MeasureReqLookUp(IN PRTMP_ADAPTER pAd, IN UINT8 DialogToken); +PMEASURE_REQ_ENTRY MeasureReqLookUp(IN PRTMP_ADAPTER pAd, u8 DialogToken); -PMEASURE_REQ_ENTRY MeasureReqInsert(IN PRTMP_ADAPTER pAd, IN UINT8 DialogToken); +PMEASURE_REQ_ENTRY MeasureReqInsert(IN PRTMP_ADAPTER pAd, u8 DialogToken); -VOID MeasureReqDelete(IN PRTMP_ADAPTER pAd, IN UINT8 DialogToken); +void MeasureReqDelete(IN PRTMP_ADAPTER pAd, u8 DialogToken); -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); -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); -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); -VOID TpcReqTabInit(IN PRTMP_ADAPTER pAd); +void TpcReqTabInit(IN PRTMP_ADAPTER pAd); -VOID TpcReqTabExit(IN PRTMP_ADAPTER pAd); +void TpcReqTabExit(IN PRTMP_ADAPTER pAd); -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); -VOID RguClass_BuildBcnChList(IN PRTMP_ADAPTER pAd, - OUT PUCHAR pBuf, OUT PULONG pBufLen); +void RguClass_BuildBcnChList(IN PRTMP_ADAPTER pAd, + u8 *pBuf, unsigned long *pBufLen); #endif /* __SPECTRUM_H__ // */ diff --git a/drivers/staging/rt2860/spectrum_def.h b/drivers/staging/rt2860/spectrum_def.h index d100c31..30678b9 100644 --- a/drivers/staging/rt2860/spectrum_def.h +++ b/drivers/staging/rt2860/spectrum_def.h @@ -55,40 +55,40 @@ typedef struct _MEASURE_REQ_ENTRY { struct _MEASURE_REQ_ENTRY *pNext; - ULONG lastTime; + unsigned long lastTime; BOOLEAN Valid; - UINT8 DialogToken; - UINT8 MeasureDialogToken[3]; /* 0:basic measure, 1: CCA measure, 2: RPI_Histogram measure. */ + u8 DialogToken; + u8 MeasureDialogToken[3]; /* 0:basic measure, 1: CCA measure, 2: RPI_Histogram measure. */ } MEASURE_REQ_ENTRY, *PMEASURE_REQ_ENTRY; typedef struct _MEASURE_REQ_TAB { - UCHAR Size; + u8 Size; PMEASURE_REQ_ENTRY Hash[MAX_HASH_MEASURE_REQ_TAB_SIZE]; MEASURE_REQ_ENTRY Content[MAX_MEASURE_REQ_TAB_SIZE]; } MEASURE_REQ_TAB, *PMEASURE_REQ_TAB; typedef struct _TPC_REQ_ENTRY { struct _TPC_REQ_ENTRY *pNext; - ULONG lastTime; + unsigned long lastTime; BOOLEAN Valid; - UINT8 DialogToken; + u8 DialogToken; } TPC_REQ_ENTRY, *PTPC_REQ_ENTRY; typedef struct _TPC_REQ_TAB { - UCHAR Size; + u8 Size; PTPC_REQ_ENTRY Hash[MAX_HASH_TPC_REQ_TAB_SIZE]; TPC_REQ_ENTRY Content[MAX_TPC_REQ_TAB_SIZE]; } TPC_REQ_TAB, *PTPC_REQ_TAB; /* The regulatory information */ typedef struct _DOT11_CHANNEL_SET { - UCHAR NumberOfChannels; - UINT8 MaxTxPwr; - UCHAR ChannelList[16]; + u8 NumberOfChannels; + u8 MaxTxPwr; + u8 ChannelList[16]; } DOT11_CHANNEL_SET, *PDOT11_CHANNEL_SET; typedef struct _DOT11_REGULATORY_INFORMATION { - UCHAR RegulatoryClass; + u8 RegulatoryClass; DOT11_CHANNEL_SET ChannelSet; } DOT11_REGULATORY_INFORMATION, *PDOT11_REGULATORY_INFORMATION; @@ -102,97 +102,97 @@ typedef struct _DOT11_REGULATORY_INFORMATION { #define RM_NOISE_HISTOGRAM 4 typedef struct PACKED _TPC_REPORT_INFO { - UINT8 TxPwr; - UINT8 LinkMargin; + u8 TxPwr; + u8 LinkMargin; } TPC_REPORT_INFO, *PTPC_REPORT_INFO; typedef struct PACKED _CH_SW_ANN_INFO { - UINT8 ChSwMode; - UINT8 Channel; - UINT8 ChSwCnt; + u8 ChSwMode; + u8 Channel; + u8 ChSwCnt; } CH_SW_ANN_INFO, *PCH_SW_ANN_INFO; typedef union PACKED _MEASURE_REQ_MODE { struct PACKED { - UINT8 Parallel:1; - UINT8 Enable:1; - UINT8 Request:1; - UINT8 Report:1; - UINT8 DurationMandatory:1; - UINT8:3; + u8 Parallel:1; + u8 Enable:1; + u8 Request:1; + u8 Report:1; + u8 DurationMandatory:1; + u8:3; } field; - UINT8 word; + u8 word; } MEASURE_REQ_MODE, *PMEASURE_REQ_MODE; typedef struct PACKED _MEASURE_REQ { - UINT8 ChNum; - UINT64 MeasureStartTime; - UINT16 MeasureDuration; + u8 ChNum; + u64 MeasureStartTime; + u16 MeasureDuration; } MEASURE_REQ, *PMEASURE_REQ; typedef struct PACKED _MEASURE_REQ_INFO { - UINT8 Token; + u8 Token; MEASURE_REQ_MODE ReqMode; - UINT8 ReqType; - UINT8 Oct[0]; + u8 ReqType; + u8 Oct[0]; } MEASURE_REQ_INFO, *PMEASURE_REQ_INFO; typedef union PACKED _MEASURE_BASIC_REPORT_MAP { struct PACKED { - UINT8 BSS:1; + u8 BSS:1; - UINT8 OfdmPreamble:1; - UINT8 UnidentifiedSignal:1; - UINT8 Radar:1; - UINT8 Unmeasure:1; - UINT8 Rev:3; + u8 OfdmPreamble:1; + u8 UnidentifiedSignal:1; + u8 Radar:1; + u8 Unmeasure:1; + u8 Rev:3; } field; - UINT8 word; + u8 word; } MEASURE_BASIC_REPORT_MAP, *PMEASURE_BASIC_REPORT_MAP; typedef struct PACKED _MEASURE_BASIC_REPORT { - UINT8 ChNum; - UINT64 MeasureStartTime; - UINT16 MeasureDuration; + u8 ChNum; + u64 MeasureStartTime; + u16 MeasureDuration; MEASURE_BASIC_REPORT_MAP Map; } MEASURE_BASIC_REPORT, *PMEASURE_BASIC_REPORT; typedef struct PACKED _MEASURE_CCA_REPORT { - UINT8 ChNum; - UINT64 MeasureStartTime; - UINT16 MeasureDuration; - UINT8 CCA_Busy_Fraction; + u8 ChNum; + u64 MeasureStartTime; + u16 MeasureDuration; + u8 CCA_Busy_Fraction; } MEASURE_CCA_REPORT, *PMEASURE_CCA_REPORT; typedef struct PACKED _MEASURE_RPI_REPORT { - UINT8 ChNum; - UINT64 MeasureStartTime; - UINT16 MeasureDuration; - UINT8 RPI_Density[8]; + u8 ChNum; + u64 MeasureStartTime; + u16 MeasureDuration; + u8 RPI_Density[8]; } MEASURE_RPI_REPORT, *PMEASURE_RPI_REPORT; typedef union PACKED _MEASURE_REPORT_MODE { struct PACKED { - UINT8 Late:1; - UINT8 Incapable:1; - UINT8 Refused:1; - UINT8 Rev:5; + u8 Late:1; + u8 Incapable:1; + u8 Refused:1; + u8 Rev:5; } field; - UINT8 word; + u8 word; } MEASURE_REPORT_MODE, *PMEASURE_REPORT_MODE; typedef struct PACKED _MEASURE_REPORT_INFO { - UINT8 Token; - UINT8 ReportMode; - UINT8 ReportType; - UINT8 Octect[0]; + u8 Token; + u8 ReportMode; + u8 ReportType; + u8 Octect[0]; } MEASURE_REPORT_INFO, *PMEASURE_REPORT_INFO; typedef struct PACKED _QUIET_INFO { - UINT8 QuietCnt; - UINT8 QuietPeriod; - UINT16 QuietDuration; - UINT16 QuietOffset; + u8 QuietCnt; + u8 QuietPeriod; + u16 QuietDuration; + u16 QuietOffset; } QUIET_INFO, *PQUIET_INFO; #endif /* __SPECTRUM_DEF_H__ // */ diff --git a/drivers/staging/rt2860/sta/assoc.c b/drivers/staging/rt2860/sta/assoc.c index c5a1738..f2192ff 100644 --- a/drivers/staging/rt2860/sta/assoc.c +++ b/drivers/staging/rt2860/sta/assoc.c @@ -36,7 +36,7 @@ */ #include "../rt_config.h" -UCHAR CipherWpaTemplate[] = { +u8 CipherWpaTemplate[] = { 0xdd, /* WPA IE */ 0x16, /* Length */ 0x00, 0x50, 0xf2, 0x01, /* oui */ @@ -48,7 +48,7 @@ UCHAR CipherWpaTemplate[] = { 0x00, 0x50, 0xf2, 0x01 /* authentication */ }; -UCHAR CipherWpa2Template[] = { +u8 CipherWpa2Template[] = { 0x30, /* RSN IE */ 0x14, /* Length */ 0x01, 0x00, /* Version */ @@ -60,7 +60,7 @@ UCHAR CipherWpa2Template[] = { 0x00, 0x00, /* RSN capability */ }; -UCHAR Ccx2IeInfo[] = { 0x00, 0x40, 0x96, 0x03, 0x02 }; +u8 Ccx2IeInfo[] = { 0x00, 0x40, 0x96, 0x03, 0x02 }; /* ========================================================================== @@ -73,7 +73,7 @@ UCHAR Ccx2IeInfo[] = { 0x00, 0x40, 0x96, 0x03, 0x02 }; ========================================================================== */ -VOID AssocStateMachineInit(IN PRTMP_ADAPTER pAd, +void AssocStateMachineInit(IN PRTMP_ADAPTER pAd, IN STATE_MACHINE * S, OUT STATE_MACHINE_FUNC Trans[]) { StateMachineInit(S, Trans, MAX_ASSOC_STATE, MAX_ASSOC_MSG, @@ -165,9 +165,9 @@ VOID AssocStateMachineInit(IN PRTMP_ADAPTER pAd, ========================================================================== */ -VOID AssocTimeout(IN PVOID SystemSpecific1, - IN PVOID FunctionContext, - IN PVOID SystemSpecific2, IN PVOID SystemSpecific3) +void AssocTimeout(void *SystemSpecific1, + void *FunctionContext, + void *SystemSpecific2, void *SystemSpecific3) { RTMP_ADAPTER *pAd = (RTMP_ADAPTER *) FunctionContext; @@ -193,9 +193,9 @@ VOID AssocTimeout(IN PVOID SystemSpecific1, ========================================================================== */ -VOID ReassocTimeout(IN PVOID SystemSpecific1, - IN PVOID FunctionContext, - IN PVOID SystemSpecific2, IN PVOID SystemSpecific3) +void ReassocTimeout(void *SystemSpecific1, + void *FunctionContext, + void *SystemSpecific2, void *SystemSpecific3) { RTMP_ADAPTER *pAd = (RTMP_ADAPTER *) FunctionContext; @@ -221,9 +221,9 @@ VOID ReassocTimeout(IN PVOID SystemSpecific1, ========================================================================== */ -VOID DisassocTimeout(IN PVOID SystemSpecific1, - IN PVOID FunctionContext, - IN PVOID SystemSpecific2, IN PVOID SystemSpecific3) +void DisassocTimeout(void *SystemSpecific1, + void *FunctionContext, + void *SystemSpecific2, void *SystemSpecific3) { RTMP_ADAPTER *pAd = (RTMP_ADAPTER *) FunctionContext; @@ -259,23 +259,23 @@ VOID DisassocTimeout(IN PVOID SystemSpecific1, ========================================================================== */ -VOID MlmeAssocReqAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) +void MlmeAssocReqAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) { - UCHAR ApAddr[6]; + u8 ApAddr[6]; HEADER_802_11 AssocHdr; - UCHAR WmeIe[9] = + u8 WmeIe[9] = { IE_VENDOR_SPECIFIC, 0x07, 0x00, 0x50, 0xf2, 0x02, 0x00, 0x01, 0x00 }; - USHORT ListenIntv; - ULONG Timeout; - USHORT CapabilityInfo; + u16 ListenIntv; + unsigned long Timeout; + u16 CapabilityInfo; BOOLEAN TimerCancelled; - PUCHAR pOutBuffer = NULL; - NDIS_STATUS NStatus; - ULONG FrameLen = 0; - ULONG tmp; - USHORT VarIesOffset; - USHORT Status; + u8 *pOutBuffer = NULL; + int NStatus; + unsigned long FrameLen = 0; + unsigned long tmp; + u16 VarIesOffset; + u16 Status; /* Block all authentication request durning WPA block period */ if (pAd->StaCfg.bBlockAssoc == TRUE) { @@ -377,9 +377,9 @@ VOID MlmeAssocReqAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) /* HT */ if ((pAd->MlmeAux.HtCapabilityLen > 0) && (pAd->CommonCfg.PhyMode >= PHY_11ABGN_MIXED)) { - ULONG TmpLen; - UCHAR HtLen; - UCHAR BROADCOM[4] = { 0x0, 0x90, 0x4c, 0x33 }; + unsigned long TmpLen; + u8 HtLen; + u8 BROADCOM[4] = { 0x0, 0x90, 0x4c, 0x33 }; if (pAd->StaActive.SupportedPhyInfo.bPreNHt == TRUE) { HtLen = SIZE_HT_CAP_IE + 4; MakeOutgoingFrame(pOutBuffer + FrameLen, @@ -409,8 +409,8 @@ VOID MlmeAssocReqAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) if (pAd->CommonCfg.bAggregationCapable) { if ((pAd->CommonCfg.bPiggyBackCapable) && ((pAd->MlmeAux.APRalinkIe & 0x00000003) == 3)) { - ULONG TmpLen; - UCHAR RalinkIe[9] = + unsigned long TmpLen; + u8 RalinkIe[9] = { IE_VENDOR_SPECIFIC, 7, 0x00, 0x0c, 0x43, 0x03, 0x00, 0x00, 0x00 }; MakeOutgoingFrame(pOutBuffer + FrameLen, @@ -418,8 +418,8 @@ VOID MlmeAssocReqAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) END_OF_ARGS); FrameLen += TmpLen; } else if (pAd->MlmeAux.APRalinkIe & 0x00000001) { - ULONG TmpLen; - UCHAR RalinkIe[9] = + unsigned long TmpLen; + u8 RalinkIe[9] = { IE_VENDOR_SPECIFIC, 7, 0x00, 0x0c, 0x43, 0x01, 0x00, 0x00, 0x00 }; MakeOutgoingFrame(pOutBuffer + FrameLen, @@ -428,8 +428,8 @@ VOID MlmeAssocReqAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) FrameLen += TmpLen; } } else { - ULONG TmpLen; - UCHAR RalinkIe[9] = + unsigned long TmpLen; + u8 RalinkIe[9] = { IE_VENDOR_SPECIFIC, 7, 0x00, 0x0c, 0x43, 0x06, 0x00, 0x00, 0x00 }; MakeOutgoingFrame(pOutBuffer + FrameLen, &TmpLen, 9, @@ -450,7 +450,7 @@ VOID MlmeAssocReqAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) QosInfo.UAPSD_AC_VO = pAd->CommonCfg.bAPSDAC_VO; QosInfo.MaxSPLength = pAd->CommonCfg.MaxSPLength; - WmeIe[8] |= *(PUCHAR) & QosInfo; + WmeIe[8] |= *(u8 *)& QosInfo; } else { /* The Parameter Set Count is set to ¡§0¡¨ in the association request frames */ /* WmeIe[8] |= (pAd->MlmeAux.APEdcaParm.EdcaUpdateCount & 0x0f); */ @@ -472,7 +472,7 @@ VOID MlmeAssocReqAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) (pAd->StaCfg.AuthMode == Ndis802_11AuthModeWPA2) ) ) { - UCHAR RSNIe = IE_WPA; + u8 RSNIe = IE_WPA; if ((pAd->StaCfg.AuthMode == Ndis802_11AuthModeWPA2PSK) || (pAd->StaCfg.AuthMode == @@ -488,7 +488,7 @@ VOID MlmeAssocReqAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) /* Check for WPA PMK cache list */ if (pAd->StaCfg.AuthMode == Ndis802_11AuthModeWPA2) { - INT idx; + int idx; BOOLEAN FoundPMK = FALSE; /* Search chched PMKID, append it if existed */ for (idx = 0; idx < PMKID_NO; idx++) { @@ -502,7 +502,7 @@ VOID MlmeAssocReqAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) } if (FoundPMK) { /* Set PMK number */ - *(PUSHORT) & pAd->StaCfg.RSN_IE[pAd-> + *(u16 *)& pAd->StaCfg.RSN_IE[pAd-> StaCfg. RSNIE_Len] = 1; @@ -589,21 +589,21 @@ VOID MlmeAssocReqAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) ========================================================================== */ -VOID MlmeReassocReqAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) +void MlmeReassocReqAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) { - UCHAR ApAddr[6]; + u8 ApAddr[6]; HEADER_802_11 ReassocHdr; - UCHAR WmeIe[9] = + u8 WmeIe[9] = { IE_VENDOR_SPECIFIC, 0x07, 0x00, 0x50, 0xf2, 0x02, 0x00, 0x01, 0x00 }; - USHORT CapabilityInfo, ListenIntv; - ULONG Timeout; - ULONG FrameLen = 0; + u16 CapabilityInfo, ListenIntv; + unsigned long Timeout; + unsigned long FrameLen = 0; BOOLEAN TimerCancelled; - NDIS_STATUS NStatus; - ULONG tmp; - PUCHAR pOutBuffer = NULL; - USHORT Status; + int NStatus; + unsigned long tmp; + u8 *pOutBuffer = NULL; + u16 Status; /* Block all authentication request durning WPA block period */ if (pAd->StaCfg.bBlockAssoc == TRUE) { @@ -669,7 +669,7 @@ VOID MlmeReassocReqAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) QosInfo.UAPSD_AC_VO = pAd->CommonCfg.bAPSDAC_VO; QosInfo.MaxSPLength = pAd->CommonCfg.MaxSPLength; - WmeIe[8] |= *(PUCHAR) & QosInfo; + WmeIe[8] |= *(u8 *)& QosInfo; } MakeOutgoingFrame(pOutBuffer + FrameLen, &tmp, @@ -679,9 +679,9 @@ VOID MlmeReassocReqAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) /* HT */ if ((pAd->MlmeAux.HtCapabilityLen > 0) && (pAd->CommonCfg.PhyMode >= PHY_11ABGN_MIXED)) { - ULONG TmpLen; - UCHAR HtLen; - UCHAR BROADCOM[4] = { 0x0, 0x90, 0x4c, 0x33 }; + unsigned long TmpLen; + u8 HtLen; + u8 BROADCOM[4] = { 0x0, 0x90, 0x4c, 0x33 }; if (pAd->StaActive.SupportedPhyInfo.bPreNHt == TRUE) { HtLen = SIZE_HT_CAP_IE + 4; MakeOutgoingFrame(pOutBuffer + FrameLen, @@ -711,8 +711,8 @@ VOID MlmeReassocReqAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) if (pAd->CommonCfg.bAggregationCapable) { if ((pAd->CommonCfg.bPiggyBackCapable) && ((pAd->MlmeAux.APRalinkIe & 0x00000003) == 3)) { - ULONG TmpLen; - UCHAR RalinkIe[9] = + unsigned long TmpLen; + u8 RalinkIe[9] = { IE_VENDOR_SPECIFIC, 7, 0x00, 0x0c, 0x43, 0x03, 0x00, 0x00, 0x00 }; MakeOutgoingFrame(pOutBuffer + FrameLen, @@ -720,8 +720,8 @@ VOID MlmeReassocReqAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) END_OF_ARGS); FrameLen += TmpLen; } else if (pAd->MlmeAux.APRalinkIe & 0x00000001) { - ULONG TmpLen; - UCHAR RalinkIe[9] = + unsigned long TmpLen; + u8 RalinkIe[9] = { IE_VENDOR_SPECIFIC, 7, 0x00, 0x0c, 0x43, 0x01, 0x00, 0x00, 0x00 }; MakeOutgoingFrame(pOutBuffer + FrameLen, @@ -730,8 +730,8 @@ VOID MlmeReassocReqAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) FrameLen += TmpLen; } } else { - ULONG TmpLen; - UCHAR RalinkIe[9] = + unsigned long TmpLen; + u8 RalinkIe[9] = { IE_VENDOR_SPECIFIC, 7, 0x00, 0x0c, 0x43, 0x04, 0x00, 0x00, 0x00 }; MakeOutgoingFrame(pOutBuffer + FrameLen, &TmpLen, 9, @@ -765,17 +765,17 @@ VOID MlmeReassocReqAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) ========================================================================== */ -VOID MlmeDisassocReqAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) +void MlmeDisassocReqAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) { PMLME_DISASSOC_REQ_STRUCT pDisassocReq; HEADER_802_11 DisassocHdr; PHEADER_802_11 pDisassocHdr; - PUCHAR pOutBuffer = NULL; - ULONG FrameLen = 0; - NDIS_STATUS NStatus; + u8 *pOutBuffer = NULL; + unsigned long FrameLen = 0; + int NStatus; BOOLEAN TimerCancelled; - ULONG Timeout = 500; - USHORT Status; + unsigned long Timeout = 500; + u16 Status; /* skip sanity check */ pDisassocReq = (PMLME_DISASSOC_REQ_STRUCT) (Elem->Msg); @@ -835,20 +835,20 @@ VOID MlmeDisassocReqAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) ========================================================================== */ -VOID PeerAssocRspAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) +void PeerAssocRspAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) { - USHORT CapabilityInfo, Status, Aid; - UCHAR SupRate[MAX_LEN_OF_SUPPORTED_RATES], SupRateLen; - UCHAR ExtRate[MAX_LEN_OF_SUPPORTED_RATES], ExtRateLen; - UCHAR Addr2[MAC_ADDR_LEN]; + u16 CapabilityInfo, Status, Aid; + u8 SupRate[MAX_LEN_OF_SUPPORTED_RATES], SupRateLen; + u8 ExtRate[MAX_LEN_OF_SUPPORTED_RATES], ExtRateLen; + u8 Addr2[MAC_ADDR_LEN]; BOOLEAN TimerCancelled; - UCHAR CkipFlag; + u8 CkipFlag; EDCA_PARM EdcaParm; HT_CAPABILITY_IE HtCapability; ADD_HT_INFO_IE AddHtInfo; /* AP might use this additional ht info IE */ - UCHAR HtCapabilityLen = 0; - UCHAR AddHtInfoLen; - UCHAR NewExtChannelOffset = 0xff; + u8 HtCapabilityLen = 0; + u8 AddHtInfoLen; + u8 NewExtChannelOffset = 0xff; if (PeerAssocRspSanity (pAd, Elem->Msg, Elem->MsgLen, Addr2, &CapabilityInfo, &Status, @@ -870,8 +870,8 @@ VOID PeerAssocRspAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) &TimerCancelled); if (Status == MLME_SUCCESS) { - UCHAR MaxSupportedRateIn500Kbps = 0; - UCHAR idx; + u8 MaxSupportedRateIn500Kbps = 0; + u8 idx; /* supported rates array may not be sorted. sort it and find the maximum rate */ for (idx = 0; idx < SupRateLen; idx++) { @@ -924,22 +924,22 @@ VOID PeerAssocRspAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) ========================================================================== */ -VOID PeerReassocRspAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) +void PeerReassocRspAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) { - USHORT CapabilityInfo; - USHORT Status; - USHORT Aid; - UCHAR SupRate[MAX_LEN_OF_SUPPORTED_RATES], SupRateLen; - UCHAR ExtRate[MAX_LEN_OF_SUPPORTED_RATES], ExtRateLen; - UCHAR Addr2[MAC_ADDR_LEN]; - UCHAR CkipFlag; + u16 CapabilityInfo; + u16 Status; + u16 Aid; + u8 SupRate[MAX_LEN_OF_SUPPORTED_RATES], SupRateLen; + u8 ExtRate[MAX_LEN_OF_SUPPORTED_RATES], ExtRateLen; + u8 Addr2[MAC_ADDR_LEN]; + u8 CkipFlag; BOOLEAN TimerCancelled; EDCA_PARM EdcaParm; HT_CAPABILITY_IE HtCapability; ADD_HT_INFO_IE AddHtInfo; /* AP might use this additional ht info IE */ - UCHAR HtCapabilityLen; - UCHAR AddHtInfoLen; - UCHAR NewExtChannelOffset = 0xff; + u8 HtCapabilityLen; + u8 AddHtInfoLen; + u8 NewExtChannelOffset = 0xff; if (PeerAssocRspSanity (pAd, Elem->Msg, Elem->MsgLen, Addr2, &CapabilityInfo, &Status, @@ -994,9 +994,9 @@ VOID PeerReassocRspAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) ========================================================================== */ -VOID AssocPostProc(IN PRTMP_ADAPTER pAd, IN PUCHAR pAddr2, IN USHORT CapabilityInfo, IN USHORT Aid, IN UCHAR SupRate[], IN UCHAR SupRateLen, IN UCHAR ExtRate[], IN UCHAR ExtRateLen, IN PEDCA_PARM pEdcaParm, IN HT_CAPABILITY_IE * pHtCapability, IN UCHAR HtCapabilityLen, IN ADD_HT_INFO_IE * pAddHtInfo) /* AP might use this additional ht info IE */ +void AssocPostProc(IN PRTMP_ADAPTER pAd, u8 *pAddr2, u16 CapabilityInfo, u16 Aid, u8 SupRate[], u8 SupRateLen, u8 ExtRate[], u8 ExtRateLen, IN PEDCA_PARM pEdcaParm, IN HT_CAPABILITY_IE * pHtCapability, u8 HtCapabilityLen, IN ADD_HT_INFO_IE * pAddHtInfo) /* AP might use this additional ht info IE */ { - ULONG Idx; + unsigned long Idx; pAd->MlmeAux.BssType = BSS_INFRA; COPY_MAC_ADDR(pAd->MlmeAux.Bssid, pAddr2); @@ -1067,8 +1067,8 @@ VOID AssocPostProc(IN PRTMP_ADAPTER pAd, IN PUCHAR pAddr2, IN USHORT CapabilityI /* Store appropriate RSN_IE for WPA SM negotiation later */ if ((pAd->StaCfg.AuthMode >= Ndis802_11AuthModeWPA) && (pAd->ScanTab.BssEntry[Idx].VarIELen != 0)) { - PUCHAR pVIE; - USHORT len; + u8 *pVIE; + u16 len; PEID_STRUCT pEid; pVIE = pAd->ScanTab.BssEntry[Idx].VarIEs; @@ -1144,10 +1144,10 @@ VOID AssocPostProc(IN PRTMP_ADAPTER pAd, IN PUCHAR pAddr2, IN USHORT CapabilityI ========================================================================== */ -VOID PeerDisassocAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) +void PeerDisassocAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) { - UCHAR Addr2[MAC_ADDR_LEN]; - USHORT Reason; + u8 Addr2[MAC_ADDR_LEN]; + u16 Reason; DBGPRINT(RT_DEBUG_TRACE, ("ASSOC - PeerDisassocAction()\n")); if (PeerDisassocSanity(pAd, Elem->Msg, Elem->MsgLen, Addr2, &Reason)) { @@ -1189,9 +1189,9 @@ VOID PeerDisassocAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) ========================================================================== */ -VOID AssocTimeoutAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) +void AssocTimeoutAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) { - USHORT Status; + u16 Status; DBGPRINT(RT_DEBUG_TRACE, ("ASSOC - AssocTimeoutAction\n")); pAd->Mlme.AssocMachine.CurrState = ASSOC_IDLE; Status = MLME_REJ_TIMEOUT; @@ -1207,9 +1207,9 @@ VOID AssocTimeoutAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) ========================================================================== */ -VOID ReassocTimeoutAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) +void ReassocTimeoutAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) { - USHORT Status; + u16 Status; DBGPRINT(RT_DEBUG_TRACE, ("ASSOC - ReassocTimeoutAction\n")); pAd->Mlme.AssocMachine.CurrState = ASSOC_IDLE; Status = MLME_REJ_TIMEOUT; @@ -1225,9 +1225,9 @@ VOID ReassocTimeoutAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) ========================================================================== */ -VOID DisassocTimeoutAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) +void DisassocTimeoutAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) { - USHORT Status; + u16 Status; DBGPRINT(RT_DEBUG_TRACE, ("ASSOC - DisassocTimeoutAction\n")); pAd->Mlme.AssocMachine.CurrState = ASSOC_IDLE; Status = MLME_SUCCESS; @@ -1235,9 +1235,9 @@ VOID DisassocTimeoutAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) &Status); } -VOID InvalidStateWhenAssoc(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) +void InvalidStateWhenAssoc(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) { - USHORT Status; + u16 Status; DBGPRINT(RT_DEBUG_TRACE, ("ASSOC - InvalidStateWhenAssoc(state=%ld), reset ASSOC state machine\n", pAd->Mlme.AssocMachine.CurrState)); @@ -1246,9 +1246,9 @@ VOID InvalidStateWhenAssoc(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) MlmeEnqueue(pAd, MLME_CNTL_STATE_MACHINE, MT2_ASSOC_CONF, 2, &Status); } -VOID InvalidStateWhenReassoc(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) +void InvalidStateWhenReassoc(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) { - USHORT Status; + u16 Status; DBGPRINT(RT_DEBUG_TRACE, ("ASSOC - InvalidStateWhenReassoc(state=%ld), reset ASSOC state machine\n", pAd->Mlme.AssocMachine.CurrState)); @@ -1257,10 +1257,10 @@ VOID InvalidStateWhenReassoc(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) MlmeEnqueue(pAd, MLME_CNTL_STATE_MACHINE, MT2_REASSOC_CONF, 2, &Status); } -VOID InvalidStateWhenDisassociate(IN PRTMP_ADAPTER pAd, +void InvalidStateWhenDisassociate(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) { - USHORT Status; + u16 Status; DBGPRINT(RT_DEBUG_TRACE, ("ASSOC - InvalidStateWhenDisassoc(state=%ld), reset ASSOC state machine\n", pAd->Mlme.AssocMachine.CurrState)); @@ -1283,14 +1283,14 @@ VOID InvalidStateWhenDisassociate(IN PRTMP_ADAPTER pAd, ========================================================================== */ -VOID Cls3errAction(IN PRTMP_ADAPTER pAd, IN PUCHAR pAddr) +void Cls3errAction(IN PRTMP_ADAPTER pAd, u8 *pAddr) { HEADER_802_11 DisassocHdr; PHEADER_802_11 pDisassocHdr; - PUCHAR pOutBuffer = NULL; - ULONG FrameLen = 0; - NDIS_STATUS NStatus; - USHORT Reason = REASON_CLS3ERR; + u8 *pOutBuffer = NULL; + unsigned long FrameLen = 0; + int NStatus; + u16 Reason = REASON_CLS3ERR; NStatus = MlmeAllocateMemory(pAd, &pOutBuffer); /*Get an unused nonpaged memory */ if (NStatus != NDIS_STATUS_SUCCESS) @@ -1336,13 +1336,13 @@ int wext_notify_event_assoc(IN RTMP_ADAPTER * pAd) BOOLEAN StaAddMacTableEntry(IN PRTMP_ADAPTER pAd, IN PMAC_TABLE_ENTRY pEntry, - IN UCHAR MaxSupportedRateIn500Kbps, + u8 MaxSupportedRateIn500Kbps, IN HT_CAPABILITY_IE * pHtCapability, - IN UCHAR HtCapabilityLen, + u8 HtCapabilityLen, IN ADD_HT_INFO_IE * pAddHtInfo, - IN UCHAR AddHtInfoLen, IN USHORT CapabilityInfo) + u8 AddHtInfoLen, u16 CapabilityInfo) { - UCHAR MaxSupportedRate = RATE_11; + u8 MaxSupportedRate = RATE_11; if (ADHOC_ON(pAd)) CLIENT_STATUS_CLEAR_FLAG(pEntry, fCLIENT_STATUS_WMM_CAPABLE); @@ -1448,8 +1448,8 @@ BOOLEAN StaAddMacTableEntry(IN PRTMP_ADAPTER pAd, /* If this Entry supports 802.11n, upgrade to HT rate. */ if ((HtCapabilityLen != 0) && (pAd->CommonCfg.PhyMode >= PHY_11ABGN_MIXED)) { - UCHAR j, bitmask; /*k,bitmask; */ - CHAR i; + u8 j, bitmask; /*k,bitmask; */ + char i; if (ADHOC_ON(pAd)) CLIENT_STATUS_SET_FLAG(pEntry, @@ -1526,8 +1526,8 @@ BOOLEAN StaAddMacTableEntry(IN PRTMP_ADAPTER pAd, pEntry->MpduDensity = pHtCapability->HtCapParm.MpduDensity; pEntry->MaxRAmpduFactor = pHtCapability->HtCapParm.MaxRAmpduFactor; - pEntry->MmpsMode = (UCHAR) pHtCapability->HtCapInfo.MimoPs; - pEntry->AMsduSize = (UCHAR) pHtCapability->HtCapInfo.AMsduSize; + pEntry->MmpsMode = (u8)pHtCapability->HtCapInfo.MimoPs; + pEntry->AMsduSize = (u8)pHtCapability->HtCapInfo.AMsduSize; pEntry->HTPhyMode.word = pEntry->MaxHTPhyMode.word; if (pAd->CommonCfg.DesiredHtPhy.AmsduEnable @@ -1567,8 +1567,8 @@ BOOLEAN StaAddMacTableEntry(IN PRTMP_ADAPTER pAd, /* Set asic auto fall back */ if (pAd->StaCfg.bAutoTxRateSwitch == TRUE) { - PUCHAR pTable; - UCHAR TableSize = 0; + u8 *pTable; + u8 TableSize = 0; MlmeSelectTxRateTable(pAd, pEntry, &pTable, &TableSize, &pEntry->CurrTxRateIndex); @@ -1579,7 +1579,7 @@ BOOLEAN StaAddMacTableEntry(IN PRTMP_ADAPTER pAd, pEntry->bAutoTxRateSwitch = FALSE; /* If the legacy mode is set, overwrite the transmit setting of this entry. */ - RTMPUpdateLegacyTxSetting((UCHAR) pAd->StaCfg. + RTMPUpdateLegacyTxSetting((u8)pAd->StaCfg. DesiredTransmitSetting.field. FixedTxMode, pEntry); } diff --git a/drivers/staging/rt2860/sta/auth.c b/drivers/staging/rt2860/sta/auth.c index a69b6a7..ddb357a 100644 --- a/drivers/staging/rt2860/sta/auth.c +++ b/drivers/staging/rt2860/sta/auth.c @@ -95,9 +95,9 @@ void AuthStateMachineInit(IN PRTMP_ADAPTER pAd, ========================================================================== */ -VOID AuthTimeout(IN PVOID SystemSpecific1, - IN PVOID FunctionContext, - IN PVOID SystemSpecific2, IN PVOID SystemSpecific3) +void AuthTimeout(void *SystemSpecific1, + void *FunctionContext, + void *SystemSpecific2, void *SystemSpecific3) { RTMP_ADAPTER *pAd = (RTMP_ADAPTER *) FunctionContext; @@ -125,13 +125,13 @@ VOID AuthTimeout(IN PVOID SystemSpecific1, ========================================================================== */ -VOID MlmeAuthReqAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) +void MlmeAuthReqAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) { if (AUTH_ReqSend (pAd, Elem, &pAd->MlmeAux.AuthTimer, "AUTH", 1, NULL, 0)) pAd->Mlme.AuthMachine.CurrState = AUTH_WAIT_SEQ2; else { - USHORT Status; + u16 Status; pAd->Mlme.AuthMachine.CurrState = AUTH_REQ_IDLE; Status = MLME_INVALID_FORMAT; @@ -148,23 +148,23 @@ VOID MlmeAuthReqAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) ========================================================================== */ -VOID PeerAuthRspAtSeq2Action(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) +void PeerAuthRspAtSeq2Action(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) { - UCHAR Addr2[MAC_ADDR_LEN]; - USHORT Seq, Status, RemoteStatus, Alg; - UCHAR ChlgText[CIPHER_TEXT_LEN]; - UCHAR CyperChlgText[CIPHER_TEXT_LEN + 8 + 8]; - UCHAR Element[2]; + u8 Addr2[MAC_ADDR_LEN]; + u16 Seq, Status, RemoteStatus, Alg; + u8 ChlgText[CIPHER_TEXT_LEN]; + u8 CyperChlgText[CIPHER_TEXT_LEN + 8 + 8]; + u8 Element[2]; HEADER_802_11 AuthHdr; BOOLEAN TimerCancelled; - PUCHAR pOutBuffer = NULL; - NDIS_STATUS NStatus; - ULONG FrameLen = 0; - USHORT Status2; + u8 *pOutBuffer = NULL; + int NStatus; + unsigned long FrameLen = 0; + u16 Status2; if (PeerAuthSanity (pAd, Elem->Msg, Elem->MsgLen, Addr2, &Alg, &Seq, &Status, - (PCHAR) ChlgText)) { + (char *)ChlgText)) { if (MAC_ADDR_EQUAL(pAd->MlmeAux.Bssid, Addr2) && Seq == 2) { DBGPRINT(RT_DEBUG_TRACE, ("AUTH - Receive AUTH_RSP seq#2 to me (Alg=%d, Status=%d)\n", @@ -224,18 +224,18 @@ VOID PeerAuthRspAtSeq2Action(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) KeyLen, CyperChlgText); - Alg = cpu2le16(*(USHORT *) & Alg); - Seq = cpu2le16(*(USHORT *) & Seq); + Alg = cpu2le16(*(u16 *) & Alg); + Seq = cpu2le16(*(u16 *) & Seq); RemoteStatus = - cpu2le16(*(USHORT *) & + cpu2le16(*(u16 *) & RemoteStatus); - RTMPEncryptData(pAd, (PUCHAR) & Alg, + RTMPEncryptData(pAd, (u8 *)& Alg, CyperChlgText + 4, 2); - RTMPEncryptData(pAd, (PUCHAR) & Seq, + RTMPEncryptData(pAd, (u8 *)& Seq, CyperChlgText + 6, 2); RTMPEncryptData(pAd, - (PUCHAR) & RemoteStatus, + (u8 *)& RemoteStatus, CyperChlgText + 8, 2); Element[0] = 16; Element[1] = 128; @@ -282,11 +282,11 @@ VOID PeerAuthRspAtSeq2Action(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) ========================================================================== */ -VOID PeerAuthRspAtSeq4Action(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) +void PeerAuthRspAtSeq4Action(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) { - UCHAR Addr2[MAC_ADDR_LEN]; - USHORT Alg, Seq, Status; - CHAR ChlgText[CIPHER_TEXT_LEN]; + u8 Addr2[MAC_ADDR_LEN]; + u16 Alg, Seq, Status; + char ChlgText[CIPHER_TEXT_LEN]; BOOLEAN TimerCancelled; if (PeerAuthSanity @@ -321,14 +321,14 @@ VOID PeerAuthRspAtSeq4Action(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) ========================================================================== */ -VOID MlmeDeauthReqAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) +void MlmeDeauthReqAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) { MLME_DEAUTH_REQ_STRUCT *pInfo; HEADER_802_11 DeauthHdr; - PUCHAR pOutBuffer = NULL; - NDIS_STATUS NStatus; - ULONG FrameLen = 0; - USHORT Status; + u8 *pOutBuffer = NULL; + int NStatus; + unsigned long FrameLen = 0; + u16 Status; pInfo = (MLME_DEAUTH_REQ_STRUCT *) Elem->Msg; @@ -374,9 +374,9 @@ VOID MlmeDeauthReqAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) ========================================================================== */ -VOID AuthTimeoutAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) +void AuthTimeoutAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) { - USHORT Status; + u16 Status; DBGPRINT(RT_DEBUG_TRACE, ("AUTH - AuthTimeoutAction\n")); pAd->Mlme.AuthMachine.CurrState = AUTH_REQ_IDLE; Status = MLME_REJ_TIMEOUT; @@ -391,9 +391,9 @@ VOID AuthTimeoutAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) ========================================================================== */ -VOID InvalidStateWhenAuth(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) +void InvalidStateWhenAuth(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) { - USHORT Status; + u16 Status; DBGPRINT(RT_DEBUG_TRACE, ("AUTH - InvalidStateWhenAuth (state=%ld), reset AUTH state machine\n", pAd->Mlme.AuthMachine.CurrState)); @@ -414,13 +414,13 @@ VOID InvalidStateWhenAuth(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) ========================================================================== */ -VOID Cls2errAction(IN PRTMP_ADAPTER pAd, IN PUCHAR pAddr) +void Cls2errAction(IN PRTMP_ADAPTER pAd, u8 *pAddr) { HEADER_802_11 DeauthHdr; - PUCHAR pOutBuffer = NULL; - NDIS_STATUS NStatus; - ULONG FrameLen = 0; - USHORT Reason = REASON_CLS2ERR; + u8 *pOutBuffer = NULL; + int NStatus; + unsigned long FrameLen = 0; + u16 Reason = REASON_CLS2ERR; NStatus = MlmeAllocateMemory(pAd, &pOutBuffer); /*Get an unused nonpaged memory */ if (NStatus != NDIS_STATUS_SUCCESS) @@ -442,18 +442,18 @@ VOID Cls2errAction(IN PRTMP_ADAPTER pAd, IN PUCHAR pAddr) BOOLEAN AUTH_ReqSend(IN PRTMP_ADAPTER pAd, IN PMLME_QUEUE_ELEM pElem, IN PRALINK_TIMER_STRUCT pAuthTimer, - IN PSTRING pSMName, - IN USHORT SeqNo, - IN PUCHAR pNewElement, IN ULONG ElementLen) + char *pSMName, + u16 SeqNo, + u8 *pNewElement, unsigned long ElementLen) { - USHORT Alg, Seq, Status; - UCHAR Addr[6]; - ULONG Timeout; + u16 Alg, Seq, Status; + u8 Addr[6]; + unsigned long Timeout; HEADER_802_11 AuthHdr; BOOLEAN TimerCancelled; - NDIS_STATUS NStatus; - PUCHAR pOutBuffer = NULL; - ULONG FrameLen = 0, tmp = 0; + int NStatus; + u8 *pOutBuffer = NULL; + unsigned long FrameLen = 0, tmp = 0; /* Block all authentication request durning WPA block period */ if (pAd->StaCfg.bBlockAssoc == TRUE) { diff --git a/drivers/staging/rt2860/sta/auth_rsp.c b/drivers/staging/rt2860/sta/auth_rsp.c index e3c07a4..d155dc6 100644 --- a/drivers/staging/rt2860/sta/auth_rsp.c +++ b/drivers/staging/rt2860/sta/auth_rsp.c @@ -47,7 +47,7 @@ ========================================================================== */ -VOID AuthRspStateMachineInit(IN PRTMP_ADAPTER pAd, +void AuthRspStateMachineInit(IN PRTMP_ADAPTER pAd, IN PSTATE_MACHINE Sm, IN STATE_MACHINE_FUNC Trans[]) { @@ -73,16 +73,16 @@ VOID AuthRspStateMachineInit(IN PRTMP_ADAPTER pAd, ========================================================================== */ -VOID PeerAuthSimpleRspGenAndSend(IN PRTMP_ADAPTER pAd, +void PeerAuthSimpleRspGenAndSend(IN PRTMP_ADAPTER pAd, IN PHEADER_802_11 pHdr80211, - IN USHORT Alg, - IN USHORT Seq, - IN USHORT Reason, IN USHORT Status) + u16 Alg, + u16 Seq, + u16 Reason, u16 Status) { HEADER_802_11 AuthHdr; - ULONG FrameLen = 0; - PUCHAR pOutBuffer = NULL; - NDIS_STATUS NStatus; + unsigned long FrameLen = 0; + u8 *pOutBuffer = NULL; + int NStatus; if (Reason != MLME_SUCCESS) { DBGPRINT(RT_DEBUG_TRACE, ("Peer AUTH fail...\n")); @@ -110,10 +110,10 @@ VOID PeerAuthSimpleRspGenAndSend(IN PRTMP_ADAPTER pAd, ========================================================================== */ -VOID PeerDeauthAction(IN PRTMP_ADAPTER pAd, IN PMLME_QUEUE_ELEM Elem) +void PeerDeauthAction(IN PRTMP_ADAPTER pAd, IN PMLME_QUEUE_ELEM Elem) { - UCHAR Addr2[MAC_ADDR_LEN]; - USHORT Reason; + u8 Addr2[MAC_ADDR_LEN]; + u16 Reason; if (PeerDeauthSanity(pAd, Elem->Msg, Elem->MsgLen, Addr2, &Reason)) { if (INFRA_ON(pAd) diff --git a/drivers/staging/rt2860/sta/connect.c b/drivers/staging/rt2860/sta/connect.c index 29906be..c11389f 100644 --- a/drivers/staging/rt2860/sta/connect.c +++ b/drivers/staging/rt2860/sta/connect.c @@ -36,7 +36,7 @@ */ #include "../rt_config.h" -UCHAR CipherSuiteWpaNoneTkip[] = { +u8 CipherSuiteWpaNoneTkip[] = { 0x00, 0x50, 0xf2, 0x01, /* oui */ 0x01, 0x00, /* Version */ 0x00, 0x50, 0xf2, 0x02, /* Multicast */ @@ -46,10 +46,10 @@ UCHAR CipherSuiteWpaNoneTkip[] = { 0x00, 0x50, 0xf2, 0x00 /* authentication */ }; -UCHAR CipherSuiteWpaNoneTkipLen = - (sizeof(CipherSuiteWpaNoneTkip) / sizeof(UCHAR)); +u8 CipherSuiteWpaNoneTkipLen = + (sizeof(CipherSuiteWpaNoneTkip) / sizeof(u8)); -UCHAR CipherSuiteWpaNoneAes[] = { +u8 CipherSuiteWpaNoneAes[] = { 0x00, 0x50, 0xf2, 0x01, /* oui */ 0x01, 0x00, /* Version */ 0x00, 0x50, 0xf2, 0x04, /* Multicast */ @@ -59,8 +59,8 @@ UCHAR CipherSuiteWpaNoneAes[] = { 0x00, 0x50, 0xf2, 0x00 /* authentication */ }; -UCHAR CipherSuiteWpaNoneAesLen = - (sizeof(CipherSuiteWpaNoneAes) / sizeof(UCHAR)); +u8 CipherSuiteWpaNoneAesLen = + (sizeof(CipherSuiteWpaNoneAes) / sizeof(u8)); /* The following MACRO is called after 1. starting an new IBSS, 2. succesfully JOIN an IBSS, */ /* or 3. succesfully ASSOCIATE to a BSS, 4. successfully RE_ASSOCIATE to a BSS */ @@ -102,7 +102,7 @@ UCHAR CipherSuiteWpaNoneAesLen = ========================================================================== */ -VOID MlmeCntlInit(IN PRTMP_ADAPTER pAd, +void MlmeCntlInit(IN PRTMP_ADAPTER pAd, IN STATE_MACHINE * S, OUT STATE_MACHINE_FUNC Trans[]) { /* Control state machine differs from other state machines, the interface */ @@ -118,7 +118,7 @@ VOID MlmeCntlInit(IN PRTMP_ADAPTER pAd, ========================================================================== */ -VOID MlmeCntlMachinePerformAction(IN PRTMP_ADAPTER pAd, +void MlmeCntlMachinePerformAction(IN PRTMP_ADAPTER pAd, IN STATE_MACHINE * S, IN MLME_QUEUE_ELEM * Elem) { @@ -204,7 +204,7 @@ VOID MlmeCntlMachinePerformAction(IN PRTMP_ADAPTER pAd, /* Check if we can connect to. */ /* */ BssTableSsidSort(pAd, &pAd->MlmeAux.SsidBssTab, - (CHAR *) pAd->MlmeAux. + (char *) pAd->MlmeAux. AutoReconnectSsid, pAd->MlmeAux.AutoReconnectSsidLen); if (pAd->MlmeAux.SsidBssTab.BssNr > 0) { @@ -228,7 +228,7 @@ VOID MlmeCntlMachinePerformAction(IN PRTMP_ADAPTER pAd, ========================================================================== */ -VOID CntlIdleProc(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) +void CntlIdleProc(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) { MLME_DISASSOC_REQ_STRUCT DisassocReq; @@ -281,10 +281,10 @@ VOID CntlIdleProc(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) } } -VOID CntlOidScanProc(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) +void CntlOidScanProc(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) { MLME_SCAN_REQ_STRUCT ScanReq; - ULONG BssIdx = BSS_NOT_FOUND; + unsigned long BssIdx = BSS_NOT_FOUND; BSS_ENTRY CurrBss; /* record current BSS if network is connected. */ @@ -292,7 +292,7 @@ VOID CntlOidScanProc(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) if (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_MEDIA_STATE_CONNECTED)) { BssIdx = BssSsidTableSearch(&pAd->ScanTab, pAd->CommonCfg.Bssid, - (PUCHAR) pAd->CommonCfg.Ssid, + (u8 *)pAd->CommonCfg.Ssid, pAd->CommonCfg.SsidLen, pAd->CommonCfg.Channel); if (BssIdx != BSS_NOT_FOUND) { @@ -313,7 +313,7 @@ VOID CntlOidScanProc(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) pAd->ScanTab.BssNr = 1; } - ScanParmFill(pAd, &ScanReq, (PSTRING) Elem->Msg, Elem->MsgLen, BSS_ANY, + ScanParmFill(pAd, &ScanReq, (char *)Elem->Msg, Elem->MsgLen, BSS_ANY, SCAN_ACTIVE); MlmeEnqueue(pAd, SYNC_STATE_MACHINE, MT2_MLME_SCAN_REQ, sizeof(MLME_SCAN_REQ_STRUCT), &ScanReq); @@ -329,16 +329,16 @@ VOID CntlOidScanProc(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) ========================================================================== */ -VOID CntlOidSsidProc(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) +void CntlOidSsidProc(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) { PNDIS_802_11_SSID pOidSsid = (NDIS_802_11_SSID *) Elem->Msg; MLME_DISASSOC_REQ_STRUCT DisassocReq; - ULONG Now; + unsigned long Now; /* Step 1. record the desired user settings to MlmeAux */ NdisZeroMemory(pAd->MlmeAux.Ssid, MAX_LEN_OF_SSID); NdisMoveMemory(pAd->MlmeAux.Ssid, pOidSsid->Ssid, pOidSsid->SsidLength); - pAd->MlmeAux.SsidLen = (UCHAR) pOidSsid->SsidLength; + pAd->MlmeAux.SsidLen = (u8)pOidSsid->SsidLength; NdisZeroMemory(pAd->MlmeAux.Bssid, MAC_ADDR_LEN); pAd->MlmeAux.BssType = pAd->StaCfg.BssType; @@ -355,7 +355,7 @@ VOID CntlOidSsidProc(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) /* step 2. find all matching BSS in the lastest SCAN result (inBssTab) */ /* & log them into MlmeAux.SsidBssTab for later-on iteration. Sort by RSSI order */ BssTableSsidSort(pAd, &pAd->MlmeAux.SsidBssTab, - (PCHAR) pAd->MlmeAux.Ssid, pAd->MlmeAux.SsidLen); + (char *)pAd->MlmeAux.Ssid, pAd->MlmeAux.SsidLen); DBGPRINT(RT_DEBUG_TRACE, ("CntlOidSsidProc():CNTL - %d BSS of %d BSS match the desire (%d)SSID - %s\n", @@ -481,7 +481,7 @@ VOID CntlOidSsidProc(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) DBGPRINT(RT_DEBUG_TRACE, ("CntlOidSsidProc():CNTL - No matching BSS, start a new scan\n")); - ScanParmFill(pAd, &ScanReq, (PSTRING) pAd->MlmeAux.Ssid, + ScanParmFill(pAd, &ScanReq, (char *)pAd->MlmeAux.Ssid, pAd->MlmeAux.SsidLen, BSS_ANY, SCAN_ACTIVE); MlmeEnqueue(pAd, SYNC_STATE_MACHINE, MT2_MLME_SCAN_REQ, @@ -505,10 +505,10 @@ VOID CntlOidSsidProc(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) ========================================================================== */ -VOID CntlOidRTBssidProc(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) +void CntlOidRTBssidProc(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) { - ULONG BssIdx; - PUCHAR pOidBssid = (PUCHAR) Elem->Msg; + unsigned long BssIdx; + u8 *pOidBssid = (u8 *)Elem->Msg; MLME_DISASSOC_REQ_STRUCT DisassocReq; MLME_JOIN_REQ_STRUCT JoinReq; @@ -527,7 +527,7 @@ VOID CntlOidRTBssidProc(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) DBGPRINT(RT_DEBUG_TRACE, ("CNTL - BSSID not found. start a new scan\n")); - ScanParmFill(pAd, &ScanReq, (PSTRING) pAd->MlmeAux.Ssid, + ScanParmFill(pAd, &ScanReq, (char *)pAd->MlmeAux.Ssid, pAd->MlmeAux.SsidLen, BSS_ANY, SCAN_ACTIVE); MlmeEnqueue(pAd, SYNC_STATE_MACHINE, MT2_MLME_SCAN_REQ, sizeof(MLME_SCAN_REQ_STRUCT), &ScanReq); @@ -675,9 +675,9 @@ VOID CntlOidRTBssidProc(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) /* or been corrupted by other "SET OID"? */ /* */ /* IRQL = DISPATCH_LEVEL */ -VOID CntlMlmeRoamingProc(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) +void CntlMlmeRoamingProc(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) { - UCHAR BBPValue = 0; + u8 BBPValue = 0; DBGPRINT(RT_DEBUG_TRACE, ("CNTL - Roaming in MlmeAux.RoamTab...\n")); @@ -705,7 +705,7 @@ VOID CntlMlmeRoamingProc(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) ========================================================================== */ -VOID CntlWaitDisassocProc(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) +void CntlWaitDisassocProc(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) { MLME_START_REQ_STRUCT StartReq; @@ -726,7 +726,7 @@ VOID CntlWaitDisassocProc(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) DBGPRINT(RT_DEBUG_TRACE, ("CNTL - No matching BSS, start a new ADHOC (Ssid=%s)...\n", pAd->MlmeAux.Ssid)); - StartParmFill(pAd, &StartReq, (PCHAR) pAd->MlmeAux.Ssid, + StartParmFill(pAd, &StartReq, (char *)pAd->MlmeAux.Ssid, pAd->MlmeAux.SsidLen); MlmeEnqueue(pAd, SYNC_STATE_MACHINE, MT2_MLME_START_REQ, sizeof(MLME_START_REQ_STRUCT), &StartReq); @@ -749,13 +749,13 @@ VOID CntlWaitDisassocProc(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) ========================================================================== */ -VOID CntlWaitJoinProc(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) +void CntlWaitJoinProc(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) { - USHORT Reason; + u16 Reason; MLME_AUTH_REQ_STRUCT AuthReq; if (Elem->MsgType == MT2_JOIN_CONF) { - NdisMoveMemory(&Reason, Elem->Msg, sizeof(USHORT)); + NdisMoveMemory(&Reason, Elem->Msg, sizeof(u16)); if (Reason == MLME_SUCCESS) { /* 1. joined an IBSS, we are pretty much done here */ if (pAd->MlmeAux.BssType == BSS_ADHOC) { @@ -832,12 +832,12 @@ VOID CntlWaitJoinProc(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) ========================================================================== */ -VOID CntlWaitStartProc(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) +void CntlWaitStartProc(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) { - USHORT Result; + u16 Result; if (Elem->MsgType == MT2_START_CONF) { - NdisMoveMemory(&Result, Elem->Msg, sizeof(USHORT)); + NdisMoveMemory(&Result, Elem->Msg, sizeof(u16)); if (Result == MLME_SUCCESS) { /* */ /* 5G bands rules of Japan: */ @@ -925,14 +925,14 @@ VOID CntlWaitStartProc(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) ========================================================================== */ -VOID CntlWaitAuthProc(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) +void CntlWaitAuthProc(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) { - USHORT Reason; + u16 Reason; MLME_ASSOC_REQ_STRUCT AssocReq; MLME_AUTH_REQ_STRUCT AuthReq; if (Elem->MsgType == MT2_AUTH_CONF) { - NdisMoveMemory(&Reason, Elem->Msg, sizeof(USHORT)); + NdisMoveMemory(&Reason, Elem->Msg, sizeof(u16)); if (Reason == MLME_SUCCESS) { DBGPRINT(RT_DEBUG_TRACE, ("CNTL - AUTH OK\n")); AssocParmFill(pAd, &AssocReq, pAd->MlmeAux.Bssid, @@ -989,14 +989,14 @@ VOID CntlWaitAuthProc(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) ========================================================================== */ -VOID CntlWaitAuthProc2(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) +void CntlWaitAuthProc2(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) { - USHORT Reason; + u16 Reason; MLME_ASSOC_REQ_STRUCT AssocReq; MLME_AUTH_REQ_STRUCT AuthReq; if (Elem->MsgType == MT2_AUTH_CONF) { - NdisMoveMemory(&Reason, Elem->Msg, sizeof(USHORT)); + NdisMoveMemory(&Reason, Elem->Msg, sizeof(u16)); if (Reason == MLME_SUCCESS) { DBGPRINT(RT_DEBUG_TRACE, ("CNTL - AUTH OK\n")); AssocParmFill(pAd, &AssocReq, pAd->MlmeAux.Bssid, @@ -1047,12 +1047,12 @@ VOID CntlWaitAuthProc2(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) ========================================================================== */ -VOID CntlWaitAssocProc(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) +void CntlWaitAssocProc(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) { - USHORT Reason; + u16 Reason; if (Elem->MsgType == MT2_ASSOC_CONF) { - NdisMoveMemory(&Reason, Elem->Msg, sizeof(USHORT)); + NdisMoveMemory(&Reason, Elem->Msg, sizeof(u16)); if (Reason == MLME_SUCCESS) { if (pAd->CommonCfg.bWirelessEvent) { RTMPSendWirelessEvent(pAd, IW_ASSOC_EVENT_FLAG, @@ -1085,12 +1085,12 @@ VOID CntlWaitAssocProc(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) ========================================================================== */ -VOID CntlWaitReassocProc(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) +void CntlWaitReassocProc(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) { - USHORT Result; + u16 Result; if (Elem->MsgType == MT2_REASSOC_CONF) { - NdisMoveMemory(&Result, Elem->Msg, sizeof(USHORT)); + NdisMoveMemory(&Result, Elem->Msg, sizeof(u16)); if (Result == MLME_SUCCESS) { /* send wireless event - for association */ if (pAd->CommonCfg.bWirelessEvent) @@ -1121,7 +1121,7 @@ VOID CntlWaitReassocProc(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) } } -VOID AdhocTurnOnQos(IN PRTMP_ADAPTER pAd) +void AdhocTurnOnQos(IN PRTMP_ADAPTER pAd) { #define AC0_DEF_TXOP 0 #define AC1_DEF_TXOP 0 @@ -1162,12 +1162,12 @@ VOID AdhocTurnOnQos(IN PRTMP_ADAPTER pAd) ========================================================================== */ -VOID LinkUp(IN PRTMP_ADAPTER pAd, IN UCHAR BssType) +void LinkUp(IN PRTMP_ADAPTER pAd, u8 BssType) { - ULONG Now; - UINT32 Data; + unsigned long Now; + u32 Data; BOOLEAN Cancelled; - UCHAR Value = 0, idx = 0, HashIdx = 0; + u8 Value = 0, idx = 0, HashIdx = 0; MAC_TABLE_ENTRY *pEntry = NULL, *pCurrEntry = NULL; /* Init ChannelQuality to prevent DEAD_CQI at initial LinkUp */ @@ -1408,8 +1408,8 @@ VOID LinkUp(IN PRTMP_ADAPTER pAd, IN UCHAR BssType) /* Fill in Shared Key Table(offset: 0x6c00) and Shared Key Mode(offset: 0x7000) */ if (pAd->StaCfg.WepStatus == Ndis802_11WEPEnabled) { - PUCHAR Key; - UCHAR CipherAlg; + u8 *Key; + u8 CipherAlg; for (idx = 0; idx < SHARE_KEY_NUM; idx++) { CipherAlg = pAd->SharedKey[BSS0][idx].CipherAlg; @@ -1511,7 +1511,7 @@ VOID LinkUp(IN PRTMP_ADAPTER pAd, IN UCHAR BssType) /* Key will be set after 4-way handshake. */ /* */ if (pAd->StaCfg.AuthMode >= Ndis802_11AuthModeWPA) { - ULONG IV; + unsigned long IV; /* Remove all WPA keys */ RTMP_CLEAR_PSFLAG(pAd, fRTMP_PS_CAN_GO_SLEEP); @@ -1548,8 +1548,8 @@ VOID LinkUp(IN PRTMP_ADAPTER pAd, IN UCHAR BssType) (pAd->StaCfg.PortSecured == WPA_802_1X_PORT_SECURED)) || ((pAd->StaCfg.WpaSupplicantUP == WPA_SUPPLICANT_DISABLE) && (pAd->StaCfg.WepStatus == Ndis802_11WEPEnabled))) { - PUCHAR Key; - UCHAR CipherAlg; + u8 *Key; + u8 CipherAlg; for (idx = 0; idx < SHARE_KEY_NUM; idx++) { CipherAlg = pAd->SharedKey[BSS0][idx].CipherAlg; @@ -1697,8 +1697,8 @@ VOID LinkUp(IN PRTMP_ADAPTER pAd, IN UCHAR BssType) /* Set asic auto fall back */ { - PUCHAR pTable; - UCHAR TableSize = 0; + u8 *pTable; + u8 TableSize = 0; MlmeSelectTxRateTable(pAd, &pAd->MacTab.Content[BSSID_WCID], &pTable, &TableSize, @@ -1721,7 +1721,7 @@ VOID LinkUp(IN PRTMP_ADAPTER pAd, IN UCHAR BssType) /* If the legacy mode is set, overwrite the transmit setting of this entry. */ if (pEntry->HTPhyMode.field.MODE <= MODE_OFDM) - RTMPUpdateLegacyTxSetting((UCHAR) pAd->StaCfg. + RTMPUpdateLegacyTxSetting((u8)pAd->StaCfg. DesiredTransmitSetting.field. FixedTxMode, pEntry); } else @@ -1729,7 +1729,7 @@ VOID LinkUp(IN PRTMP_ADAPTER pAd, IN UCHAR BssType) NdisReleaseSpinLock(&pAd->MacTabLock); /* Let Link Status Page display first initial rate. */ - pAd->LastTxRate = (USHORT) (pEntry->HTPhyMode.word); + pAd->LastTxRate = (u16)(pEntry->HTPhyMode.word); /* Select DAC according to HT or Legacy */ if (pAd->StaActive.SupportedPhyInfo.MCSSet[0] != 0x00) { RTMP_BBP_IO_READ8_BY_REG_ID(pAd, BBP_R1, &Value); @@ -1796,7 +1796,7 @@ VOID LinkUp(IN PRTMP_ADAPTER pAd, IN UCHAR BssType) && ((STA_WEP_ON(pAd)) || (STA_TKIP_ON(pAd)))) { pAd->CommonCfg.IOTestParm.bNextDisableRxBA = TRUE; if (pAd->CommonCfg.bEnableTxBurst) { - UINT32 MACValue = 0; + u32 MACValue = 0; /* Force disable TXOP value in this case. The same action in MLMEUpdateProtect too. */ /* I didn't change PBF_MAX_PCNT setting. */ RTMP_IO_READ32(pAd, EDCA_AC0_CFG, &MACValue); @@ -1873,9 +1873,9 @@ VOID LinkUp(IN PRTMP_ADAPTER pAd, IN UCHAR BssType) ========================================================================== */ -VOID LinkDown(IN PRTMP_ADAPTER pAd, IN BOOLEAN IsReqFromAP) +void LinkDown(IN PRTMP_ADAPTER pAd, IN BOOLEAN IsReqFromAP) { - UCHAR i, ByteValue = 0; + u8 i, ByteValue = 0; /* Do nothing if monitor mode is on */ if (MONITOR_ON(pAd)) @@ -2122,11 +2122,11 @@ VOID LinkDown(IN PRTMP_ADAPTER pAd, IN BOOLEAN IsReqFromAP) ========================================================================== */ -VOID IterateOnBssTab(IN PRTMP_ADAPTER pAd) +void IterateOnBssTab(IN PRTMP_ADAPTER pAd) { MLME_START_REQ_STRUCT StartReq; MLME_JOIN_REQ_STRUCT JoinReq; - ULONG BssIdx; + unsigned long BssIdx; /* Change the wepstatus to original wepstatus */ pAd->StaCfg.WepStatus = pAd->StaCfg.OrigWepStatus; @@ -2206,7 +2206,7 @@ VOID IterateOnBssTab(IN PRTMP_ADAPTER pAd) DBGPRINT(RT_DEBUG_TRACE, ("CNTL - All BSS fail; start a new ADHOC (Ssid=%s)...\n", pAd->MlmeAux.Ssid)); - StartParmFill(pAd, &StartReq, (PCHAR) pAd->MlmeAux.Ssid, + StartParmFill(pAd, &StartReq, (char *)pAd->MlmeAux.Ssid, pAd->MlmeAux.SsidLen); MlmeEnqueue(pAd, SYNC_STATE_MACHINE, MT2_MLME_START_REQ, sizeof(MLME_START_REQ_STRUCT), &StartReq); @@ -2228,10 +2228,10 @@ VOID IterateOnBssTab(IN PRTMP_ADAPTER pAd) /* for re-association only */ /* IRQL = DISPATCH_LEVEL */ -VOID IterateOnBssTab2(IN PRTMP_ADAPTER pAd) +void IterateOnBssTab2(IN PRTMP_ADAPTER pAd) { MLME_REASSOC_REQ_STRUCT ReassocReq; - ULONG BssIdx; + unsigned long BssIdx; BSS_ENTRY *pBss; BssIdx = pAd->MlmeAux.RoamIdx; @@ -2276,8 +2276,8 @@ VOID IterateOnBssTab2(IN PRTMP_ADAPTER pAd) ========================================================================== */ -VOID JoinParmFill(IN PRTMP_ADAPTER pAd, - IN OUT MLME_JOIN_REQ_STRUCT * JoinReq, IN ULONG BssIdx) +void JoinParmFill(IN PRTMP_ADAPTER pAd, + IN OUT MLME_JOIN_REQ_STRUCT * JoinReq, unsigned long BssIdx) { JoinReq->BssIdx = BssIdx; } @@ -2290,10 +2290,10 @@ VOID JoinParmFill(IN PRTMP_ADAPTER pAd, ========================================================================== */ -VOID ScanParmFill(IN PRTMP_ADAPTER pAd, +void ScanParmFill(IN PRTMP_ADAPTER pAd, IN OUT MLME_SCAN_REQ_STRUCT * ScanReq, - IN STRING Ssid[], - IN UCHAR SsidLen, IN UCHAR BssType, IN UCHAR ScanType) + char Ssid[], + u8 SsidLen, u8 BssType, u8 ScanType) { NdisZeroMemory(ScanReq->Ssid, MAX_LEN_OF_SSID); ScanReq->SsidLen = SsidLen; @@ -2310,9 +2310,9 @@ VOID ScanParmFill(IN PRTMP_ADAPTER pAd, ========================================================================== */ -VOID StartParmFill(IN PRTMP_ADAPTER pAd, +void StartParmFill(IN PRTMP_ADAPTER pAd, IN OUT MLME_START_REQ_STRUCT * StartReq, - IN CHAR Ssid[], IN UCHAR SsidLen) + char Ssid[], u8 SsidLen) { ASSERT(SsidLen <= MAX_LEN_OF_SSID); NdisMoveMemory(StartReq->Ssid, Ssid, SsidLen); @@ -2327,9 +2327,9 @@ VOID StartParmFill(IN PRTMP_ADAPTER pAd, ========================================================================== */ -VOID AuthParmFill(IN PRTMP_ADAPTER pAd, +void AuthParmFill(IN PRTMP_ADAPTER pAd, IN OUT MLME_AUTH_REQ_STRUCT * AuthReq, - IN PUCHAR pAddr, IN USHORT Alg) + u8 *pAddr, u16 Alg) { COPY_MAC_ADDR(AuthReq->Addr, pAddr); AuthReq->Alg = Alg; @@ -2345,7 +2345,7 @@ VOID AuthParmFill(IN PRTMP_ADAPTER pAd, ========================================================================== */ #ifdef RTMP_MAC_PCI -VOID ComposePsPoll(IN PRTMP_ADAPTER pAd) +void ComposePsPoll(IN PRTMP_ADAPTER pAd) { NdisZeroMemory(&pAd->PsPollFrame, sizeof(PSPOLL_FRAME)); pAd->PsPollFrame.FC.Type = BTYPE_CNTL; @@ -2356,7 +2356,7 @@ VOID ComposePsPoll(IN PRTMP_ADAPTER pAd) } /* IRQL = DISPATCH_LEVEL */ -VOID ComposeNullFrame(IN PRTMP_ADAPTER pAd) +void ComposeNullFrame(IN PRTMP_ADAPTER pAd) { NdisZeroMemory(&pAd->NullFrame, sizeof(HEADER_802_11)); pAd->NullFrame.FC.Type = BTYPE_DATA; @@ -2368,13 +2368,13 @@ VOID ComposeNullFrame(IN PRTMP_ADAPTER pAd) } #endif /* RTMP_MAC_PCI // */ #ifdef RTMP_MAC_USB -VOID MlmeCntlConfirm(IN PRTMP_ADAPTER pAd, IN ULONG MsgType, IN USHORT Msg) +void MlmeCntlConfirm(IN PRTMP_ADAPTER pAd, unsigned long MsgType, u16 Msg) { - MlmeEnqueue(pAd, MLME_CNTL_STATE_MACHINE, MsgType, sizeof(USHORT), + MlmeEnqueue(pAd, MLME_CNTL_STATE_MACHINE, MsgType, sizeof(u16), &Msg); } -VOID ComposePsPoll(IN PRTMP_ADAPTER pAd) +void ComposePsPoll(IN PRTMP_ADAPTER pAd) { PTXINFO_STRUC pTxInfo; PTXWI_STRUC pTxWI; @@ -2395,14 +2395,14 @@ VOID ComposePsPoll(IN PRTMP_ADAPTER pAd) (PTXINFO_STRUC) & pAd->PsPollContext.TransferBuffer->field. WirelessPacket[0]; RTMPWriteTxInfo(pAd, pTxInfo, - (USHORT) (sizeof(PSPOLL_FRAME) + TXWI_SIZE), TRUE, + (u16)(sizeof(PSPOLL_FRAME) + TXWI_SIZE), TRUE, EpToQueue[MGMTPIPEIDX], FALSE, FALSE); pTxWI = (PTXWI_STRUC) & pAd->PsPollContext.TransferBuffer->field. WirelessPacket[TXINFO_SIZE]; RTMPWriteTxWI(pAd, pTxWI, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, 0, BSSID_WCID, (sizeof(PSPOLL_FRAME)), 0, 0, - (UCHAR) pAd->CommonCfg.MlmeTransmit.field.MCS, + (u8)pAd->CommonCfg.MlmeTransmit.field.MCS, IFS_BACKOFF, FALSE, &pAd->CommonCfg.MlmeTransmit); RTMPMoveMemory(&pAd->PsPollContext.TransferBuffer->field. WirelessPacket[TXWI_SIZE + TXINFO_SIZE], @@ -2413,7 +2413,7 @@ VOID ComposePsPoll(IN PRTMP_ADAPTER pAd) } /* IRQL = DISPATCH_LEVEL */ -VOID ComposeNullFrame(IN PRTMP_ADAPTER pAd) +void ComposeNullFrame(IN PRTMP_ADAPTER pAd) { PTXINFO_STRUC pTxInfo; PTXWI_STRUC pTxWI; @@ -2431,14 +2431,14 @@ VOID ComposeNullFrame(IN PRTMP_ADAPTER pAd) (PTXINFO_STRUC) & pAd->NullContext.TransferBuffer->field. WirelessPacket[0]; RTMPWriteTxInfo(pAd, pTxInfo, - (USHORT) (sizeof(HEADER_802_11) + TXWI_SIZE), TRUE, + (u16)(sizeof(HEADER_802_11) + TXWI_SIZE), TRUE, EpToQueue[MGMTPIPEIDX], FALSE, FALSE); pTxWI = (PTXWI_STRUC) & pAd->NullContext.TransferBuffer->field. WirelessPacket[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, + (u8)pAd->CommonCfg.MlmeTransmit.field.MCS, IFS_BACKOFF, FALSE, &pAd->CommonCfg.MlmeTransmit); RTMPMoveMemory(&pAd->NullContext.TransferBuffer->field. WirelessPacket[TXWI_SIZE + TXINFO_SIZE], &pAd->NullFrame, @@ -2458,22 +2458,22 @@ VOID ComposeNullFrame(IN PRTMP_ADAPTER pAd) ========================================================================== */ -ULONG MakeIbssBeacon(IN PRTMP_ADAPTER pAd) +unsigned long MakeIbssBeacon(IN PRTMP_ADAPTER pAd) { - UCHAR DsLen = 1, IbssLen = 2; - UCHAR LocalErpIe[3] = { IE_ERP, 1, 0x04 }; + u8 DsLen = 1, IbssLen = 2; + u8 LocalErpIe[3] = { IE_ERP, 1, 0x04 }; HEADER_802_11 BcnHdr; - USHORT CapabilityInfo; + u16 CapabilityInfo; LARGE_INTEGER FakeTimestamp; - ULONG FrameLen = 0; + unsigned long FrameLen = 0; PTXWI_STRUC pTxWI = &pAd->BeaconTxWI; - UCHAR *pBeaconFrame = pAd->BeaconBuf; + u8 *pBeaconFrame = pAd->BeaconBuf; BOOLEAN Privacy; - UCHAR SupRate[MAX_LEN_OF_SUPPORTED_RATES]; - UCHAR SupRateLen = 0; - UCHAR ExtRate[MAX_LEN_OF_SUPPORTED_RATES]; - UCHAR ExtRateLen = 0; - UCHAR RSNIe = IE_WPA; + u8 SupRate[MAX_LEN_OF_SUPPORTED_RATES]; + u8 SupRateLen = 0; + u8 ExtRate[MAX_LEN_OF_SUPPORTED_RATES]; + u8 ExtRateLen = 0; + u8 RSNIe = IE_WPA; if ((pAd->CommonCfg.PhyMode == PHY_11B) && (pAd->CommonCfg.Channel <= 14)) { @@ -2560,7 +2560,7 @@ ULONG MakeIbssBeacon(IN PRTMP_ADAPTER pAd) /* add ERP_IE and EXT_RAE IE of in 802.11g */ if (ExtRateLen) { - ULONG tmp; + unsigned long tmp; MakeOutgoingFrame(pBeaconFrame + FrameLen, &tmp, 3, LocalErpIe, @@ -2571,7 +2571,7 @@ ULONG MakeIbssBeacon(IN PRTMP_ADAPTER pAd) } /* If adhoc secruity is set for WPA-None, append the cipher suite IE */ if (pAd->StaCfg.AuthMode == Ndis802_11AuthModeWPANone) { - ULONG tmp; + unsigned long tmp; RTMPMakeRSNIE(pAd, pAd->StaCfg.AuthMode, pAd->StaCfg.WepStatus, BSS0); @@ -2584,8 +2584,8 @@ ULONG MakeIbssBeacon(IN PRTMP_ADAPTER pAd) } if ((pAd->CommonCfg.PhyMode >= PHY_11ABGN_MIXED)) { - ULONG TmpLen; - UCHAR HtLen, HtLen1; + unsigned long TmpLen; + u8 HtLen, HtLen1; /* add HT Capability IE */ HtLen = sizeof(pAd->CommonCfg.HtCapability); diff --git a/drivers/staging/rt2860/sta/rtmp_data.c b/drivers/staging/rt2860/sta/rtmp_data.c index db65188..b40e511 100644 --- a/drivers/staging/rt2860/sta/rtmp_data.c +++ b/drivers/staging/rt2860/sta/rtmp_data.c @@ -36,13 +36,13 @@ */ #include "../rt_config.h" -VOID STARxEAPOLFrameIndicate(IN PRTMP_ADAPTER pAd, +void STARxEAPOLFrameIndicate(IN PRTMP_ADAPTER pAd, IN MAC_TABLE_ENTRY * pEntry, - IN RX_BLK * pRxBlk, IN UCHAR FromWhichBSSID) + IN RX_BLK * pRxBlk, u8 FromWhichBSSID) { PRT28XX_RXD_STRUC pRxD = &(pRxBlk->RxD); PRXWI_STRUC pRxWI = pRxBlk->pRxWI; - UCHAR *pTmpBuf; + u8 *pTmpBuf; if (pAd->StaCfg.WpaSupplicantUP) { /* All EAPoL frames have to pass to upper layer (ex. WPA_SUPPLICANT daemon) */ @@ -54,8 +54,8 @@ VOID STARxEAPOLFrameIndicate(IN PRTMP_ADAPTER pAd, WpaCheckEapCode(pAd, pRxBlk->pData, pRxBlk->DataSize, LENGTH_802_1_H))) { - PUCHAR Key; - UCHAR CipherAlg; + u8 *Key; + u8 CipherAlg; int idx = 0; DBGPRINT_RAW(RT_DEBUG_TRACE, @@ -138,7 +138,7 @@ VOID STARxEAPOLFrameIndicate(IN PRTMP_ADAPTER pAd, WepKey.keyinfo.KeyLength = len; pAd->SharedKey[BSS0][idx]. KeyLen = - (UCHAR) (len <= 5 ? 5 : 13); + (u8)(len <= 5 ? 5 : 13); pAd->IndicateMediaState = NdisMediaStateConnected; @@ -202,9 +202,9 @@ VOID STARxEAPOLFrameIndicate(IN PRTMP_ADAPTER pAd, } -VOID STARxDataFrameAnnounce(IN PRTMP_ADAPTER pAd, +void STARxDataFrameAnnounce(IN PRTMP_ADAPTER pAd, IN MAC_TABLE_ENTRY * pEntry, - IN RX_BLK * pRxBlk, IN UCHAR FromWhichBSSID) + IN RX_BLK * pRxBlk, u8 FromWhichBSSID) { /* non-EAP frame */ @@ -269,11 +269,11 @@ BOOLEAN STACheckTkipMICValue(IN PRTMP_ADAPTER pAd, IN MAC_TABLE_ENTRY * pEntry, IN RX_BLK * pRxBlk) { PHEADER_802_11 pHeader = pRxBlk->pHeader; - UCHAR *pData = pRxBlk->pData; - USHORT DataSize = pRxBlk->DataSize; - UCHAR UserPriority = pRxBlk->UserPriority; + u8 *pData = pRxBlk->pData; + u16 DataSize = pRxBlk->DataSize; + u8 UserPriority = pRxBlk->UserPriority; PCIPHER_KEY pWpaKey; - UCHAR *pDA, *pSA; + u8 *pDA, *pSA; pWpaKey = &pAd->SharedKey[BSS0][pRxBlk->pRxWI->KeyIndex]; @@ -318,7 +318,7 @@ BOOLEAN STACheckTkipMICValue(IN PRTMP_ADAPTER pAd, /* 3. set payload size including LLC to DataSize */ /* 4. set some flags with RX_BLK_SET_FLAG() */ /* */ -VOID STAHandleRxDataFrame(IN PRTMP_ADAPTER pAd, IN RX_BLK * pRxBlk) +void STAHandleRxDataFrame(IN PRTMP_ADAPTER pAd, IN RX_BLK * pRxBlk) { PRT28XX_RXD_STRUC pRxD = &(pRxBlk->RxD); PRXWI_STRUC pRxWI = pRxBlk->pRxWI; @@ -326,8 +326,8 @@ VOID STAHandleRxDataFrame(IN PRTMP_ADAPTER pAd, IN RX_BLK * pRxBlk) PNDIS_PACKET pRxPacket = pRxBlk->pRxPacket; BOOLEAN bFragment = FALSE; MAC_TABLE_ENTRY *pEntry = NULL; - UCHAR FromWhichBSSID = BSS0; - UCHAR UserPriority = 0; + u8 FromWhichBSSID = BSS0; + u8 UserPriority = 0; { /* before LINK UP, all DATA frames are rejected */ @@ -351,11 +351,11 @@ VOID STAHandleRxDataFrame(IN PRTMP_ADAPTER pAd, IN RX_BLK * pRxBlk) if (pAd->CommonCfg.bAPSDCapable && pAd->CommonCfg.APEdcaParm.bAPSDCapable && (pHeader->FC.SubType & 0x08)) { - UCHAR *pData; + u8 *pData; DBGPRINT(RT_DEBUG_INFO, ("bAPSDCapable\n")); /* Qos bit 4 */ - pData = (PUCHAR) pHeader + LENGTH_802_11; + pData = (u8 *)pHeader + LENGTH_802_11; if ((*pData >> 4) & 0x01) { DBGPRINT(RT_DEBUG_INFO, ("RxDone- Rcv EOSP frame, driver may fall into sleep\n")); @@ -363,14 +363,14 @@ VOID STAHandleRxDataFrame(IN PRTMP_ADAPTER pAd, IN RX_BLK * pRxBlk) /* Force driver to fall into sleep mode when rcv EOSP frame */ if (!OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_DOZE)) { - USHORT TbttNumToNextWakeUp; - USHORT NextDtim = + u16 TbttNumToNextWakeUp; + u16 NextDtim = pAd->StaCfg.DtimPeriod; - ULONG Now; + unsigned long Now; NdisGetSystemUpTime(&Now); NextDtim -= - (USHORT) (Now - + (u16)(Now - pAd->StaCfg. LastBeaconRxTime) / pAd->CommonCfg.BeaconPeriod; @@ -459,7 +459,7 @@ VOID STAHandleRxDataFrame(IN PRTMP_ADAPTER pAd, IN RX_BLK * pRxBlk) } } - pRxBlk->pData = (UCHAR *) pHeader; + pRxBlk->pData = (u8 *) pHeader; /* */ /* update RxBlk->pData, DataSize */ @@ -553,7 +553,7 @@ VOID STAHandleRxDataFrame(IN PRTMP_ADAPTER pAd, IN RX_BLK * pRxBlk) return; } else if (pRxD->U2M) { pAd->LastRxRate = - (USHORT) ((pRxWI->MCS) + (pRxWI->BW << 7) + + (u16)((pRxWI->MCS) + (pRxWI->BW << 7) + (pRxWI->ShortGI << 8) + (pRxWI->PHYMODE << 14)); if (ADHOC_ON(pAd)) { @@ -565,8 +565,8 @@ VOID STAHandleRxDataFrame(IN PRTMP_ADAPTER pAd, IN RX_BLK * pRxBlk) Update_Rssi_Sample(pAd, &pAd->StaCfg.RssiSample, pRxWI); - pAd->StaCfg.LastSNR0 = (UCHAR) (pRxWI->SNR0); - pAd->StaCfg.LastSNR1 = (UCHAR) (pRxWI->SNR1); + pAd->StaCfg.LastSNR0 = (u8)(pRxWI->SNR0); + pAd->StaCfg.LastSNR1 = (u8)(pRxWI->SNR1); pAd->RalinkCounters.OneSecRxOkDataCnt++; @@ -610,7 +610,7 @@ VOID STAHandleRxDataFrame(IN PRTMP_ADAPTER pAd, IN RX_BLK * pRxBlk) RELEASE_NDIS_PACKET(pAd, pRxPacket, NDIS_STATUS_FAILURE); } -VOID STAHandleRxMgmtFrame(IN PRTMP_ADAPTER pAd, IN RX_BLK * pRxBlk) +void STAHandleRxMgmtFrame(IN PRTMP_ADAPTER pAd, IN RX_BLK * pRxBlk) { PRT28XX_RXD_STRUC pRxD = &(pRxBlk->RxD); PRXWI_STRUC pRxWI = pRxBlk->pRxWI; @@ -637,8 +637,8 @@ VOID STAHandleRxMgmtFrame(IN PRTMP_ADAPTER pAd, IN RX_BLK * pRxBlk) && (pAd->RxAnt.EvaluatePeriod == 0)) { Update_Rssi_Sample(pAd, &pAd->StaCfg.RssiSample, pRxWI); - pAd->StaCfg.LastSNR0 = (UCHAR) (pRxWI->SNR0); - pAd->StaCfg.LastSNR1 = (UCHAR) (pRxWI->SNR1); + pAd->StaCfg.LastSNR0 = (u8)(pRxWI->SNR0); + pAd->StaCfg.LastSNR1 = (u8)(pRxWI->SNR1); } /* First check the size, it MUST not exceed the mlme queue size */ @@ -656,7 +656,7 @@ VOID STAHandleRxMgmtFrame(IN PRTMP_ADAPTER pAd, IN RX_BLK * pRxBlk) RELEASE_NDIS_PACKET(pAd, pRxPacket, NDIS_STATUS_SUCCESS); } -VOID STAHandleRxControlFrame(IN PRTMP_ADAPTER pAd, IN RX_BLK * pRxBlk) +void STAHandleRxControlFrame(IN PRTMP_ADAPTER pAd, IN RX_BLK * pRxBlk) { PRXWI_STRUC pRxWI = pRxBlk->pRxWI; PHEADER_802_11 pHeader = pRxBlk->pHeader; @@ -700,11 +700,11 @@ VOID STAHandleRxControlFrame(IN PRTMP_ADAPTER pAd, IN RX_BLK * pRxBlk) */ BOOLEAN STARxDoneInterruptHandle(IN PRTMP_ADAPTER pAd, IN BOOLEAN argc) { - NDIS_STATUS Status; - UINT32 RxProcessed, RxPending; + int Status; + u32 RxProcessed, RxPending; BOOLEAN bReschedule = FALSE; RT28XX_RXD_STRUC *pRxD; - UCHAR *pData; + u8 *pData; PRXWI_STRUC pRxWI; PNDIS_PACKET pRxPacket; PHEADER_802_11 pHeader; @@ -757,7 +757,7 @@ BOOLEAN STARxDoneInterruptHandle(IN PRTMP_ADAPTER pAd, IN BOOLEAN argc) RxCell.pRxWI = pRxWI; RxCell.pHeader = pHeader; RxCell.pRxPacket = pRxPacket; - RxCell.pData = (UCHAR *) pHeader; + RxCell.pData = (u8 *) pHeader; RxCell.DataSize = pRxWI->MPDUtotalByteCount; RxCell.Flags = 0; @@ -833,7 +833,7 @@ BOOLEAN STARxDoneInterruptHandle(IN PRTMP_ADAPTER pAd, IN BOOLEAN argc) ======================================================================== */ -VOID RTMPHandleTwakeupInterrupt(IN PRTMP_ADAPTER pAd) +void RTMPHandleTwakeupInterrupt(IN PRTMP_ADAPTER pAd) { AsicForceWakeup(pAd, FALSE); } @@ -846,7 +846,7 @@ Routine Description: Arguments: NDIS_HANDLE MiniportAdapterContext Pointer refer to the device handle, i.e., the pAd. PPNDIS_PACKET ppPacketArray The packet array need to do transmission. - UINT NumberOfPackets Number of packet in packet array. + u32 NumberOfPackets Number of packet in packet array. Return Value: NONE @@ -856,10 +856,10 @@ Note: You only can put OS-depened & STA related code in here. ======================================================================== */ -VOID STASendPackets(IN NDIS_HANDLE MiniportAdapterContext, - IN PPNDIS_PACKET ppPacketArray, IN UINT NumberOfPackets) +void STASendPackets(IN NDIS_HANDLE MiniportAdapterContext, + IN PPNDIS_PACKET ppPacketArray, u32 NumberOfPackets) { - UINT Index; + u32 Index; PRTMP_ADAPTER pAd = (PRTMP_ADAPTER) MiniportAdapterContext; PNDIS_PACKET pPacket; BOOLEAN allowToSend = FALSE; @@ -920,19 +920,19 @@ Note: You only can put OS-indepened & STA related code in here. ======================================================================== */ -NDIS_STATUS STASendPacket(IN PRTMP_ADAPTER pAd, IN PNDIS_PACKET pPacket) +int STASendPacket(IN PRTMP_ADAPTER pAd, IN PNDIS_PACKET pPacket) { PACKET_INFO PacketInfo; - PUCHAR pSrcBufVA; - UINT SrcBufLen; - UINT AllowFragSize; - UCHAR NumberOfFrag; - UCHAR RTSRequired; - UCHAR QueIdx, UserPriority; + u8 *pSrcBufVA; + u32 SrcBufLen; + u32 AllowFragSize; + u8 NumberOfFrag; + u8 RTSRequired; + u8 QueIdx, UserPriority; MAC_TABLE_ENTRY *pEntry = NULL; unsigned int IrqFlags; - UCHAR FlgIsIP = 0; - UCHAR Rate; + u8 FlgIsIP = 0; + u8 Rate; /* Prepare packet information structure for buffer descriptor */ /* chained within a single NDIS packet. */ @@ -986,7 +986,7 @@ NDIS_STATUS STASendPacket(IN PRTMP_ADAPTER pAd, IN PNDIS_PACKET pPacket) if (ADHOC_ON(pAd) ) { - RTMP_SET_PACKET_WCID(pPacket, (UCHAR) pEntry->Aid); + RTMP_SET_PACKET_WCID(pPacket, (u8)pEntry->Aid); } /* */ /* Check the Ethernet Frame type of this packet, and set the RTMP_SET_PACKET_SPECIFIC flags. */ @@ -1079,12 +1079,12 @@ NDIS_STATUS STASendPacket(IN PRTMP_ADAPTER pAd, IN PNDIS_PACKET pPacket) QueIdx = QID_AC_BE; if (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_WMM_INUSED) && CLIENT_STATUS_TEST_FLAG(pEntry, fCLIENT_STATUS_WMM_CAPABLE)) { - USHORT Protocol; - UCHAR LlcSnapLen = 0, Byte0, Byte1; + u16 Protocol; + u8 LlcSnapLen = 0, Byte0, Byte1; do { /* get Ethernet protocol field */ Protocol = - (USHORT) ((pSrcBufVA[12] << 8) + pSrcBufVA[13]); + (u16)((pSrcBufVA[12] << 8) + pSrcBufVA[13]); if (Protocol <= 1500) { /* get Ethernet protocol field from LLC/SNAP */ if (Sniff2BytesFromNdisBuffer @@ -1092,7 +1092,7 @@ NDIS_STATUS STASendPacket(IN PRTMP_ADAPTER pAd, IN PNDIS_PACKET pPacket) &Byte0, &Byte1) != NDIS_STATUS_SUCCESS) break; - Protocol = (USHORT) ((Byte0 << 8) + Byte1); + Protocol = (u16)((Byte0 << 8) + Byte1); LlcSnapLen = 8; } /* always AC_BE for non-IP packet */ @@ -1189,12 +1189,12 @@ NDIS_STATUS STASendPacket(IN PRTMP_ADAPTER pAd, IN PNDIS_PACKET pPacket) ======================================================================== */ #ifdef RTMP_MAC_PCI -NDIS_STATUS RTMPFreeTXDRequest(IN PRTMP_ADAPTER pAd, - IN UCHAR QueIdx, - IN UCHAR NumberRequired, IN PUCHAR FreeNumberIs) +int RTMPFreeTXDRequest(IN PRTMP_ADAPTER pAd, + u8 QueIdx, + u8 NumberRequired, u8 *FreeNumberIs) { - ULONG FreeNumber = 0; - NDIS_STATUS Status = NDIS_STATUS_FAILURE; + unsigned long FreeNumber = 0; + int Status = NDIS_STATUS_FAILURE; switch (QueIdx) { case QID_AC_BK: @@ -1234,7 +1234,7 @@ NDIS_STATUS RTMPFreeTXDRequest(IN PRTMP_ADAPTER pAd, ("RTMPFreeTXDRequest::Invalid QueIdx(=%d)\n", QueIdx)); break; } - *FreeNumberIs = (UCHAR) FreeNumber; + *FreeNumberIs = (u8)FreeNumber; return (Status); } @@ -1244,12 +1244,12 @@ NDIS_STATUS RTMPFreeTXDRequest(IN PRTMP_ADAPTER pAd, Actually, this function used to check if the TxHardware Queue still has frame need to send. If no frame need to send, go to sleep, else, still wake up. */ -NDIS_STATUS RTMPFreeTXDRequest(IN PRTMP_ADAPTER pAd, - IN UCHAR QueIdx, - IN UCHAR NumberRequired, IN PUCHAR FreeNumberIs) +int RTMPFreeTXDRequest(IN PRTMP_ADAPTER pAd, + u8 QueIdx, + u8 NumberRequired, u8 *FreeNumberIs) { - /*ULONG FreeNumber = 0; */ - NDIS_STATUS Status = NDIS_STATUS_FAILURE; + /*unsigned long FreeNumber = 0; */ + int Status = NDIS_STATUS_FAILURE; unsigned long IrqFlags; HT_TX_CONTEXT *pHTTXContext; @@ -1289,15 +1289,15 @@ NDIS_STATUS RTMPFreeTXDRequest(IN PRTMP_ADAPTER pAd, } #endif /* RTMP_MAC_USB // */ -VOID RTMPSendDisassociationFrame(IN PRTMP_ADAPTER pAd) +void RTMPSendDisassociationFrame(IN PRTMP_ADAPTER pAd) { } -VOID RTMPSendNullFrame(IN PRTMP_ADAPTER pAd, - IN UCHAR TxRate, IN BOOLEAN bQosNull) +void RTMPSendNullFrame(IN PRTMP_ADAPTER pAd, + u8 TxRate, IN BOOLEAN bQosNull) { - UCHAR NullFrame[48]; - ULONG Length; + u8 NullFrame[48]; + unsigned long Length; PHEADER_802_11 pHeader_802_11; /* WPA 802.1x secured port control */ @@ -1349,12 +1349,12 @@ VOID RTMPSendNullFrame(IN PRTMP_ADAPTER pAd, } /* IRQL = DISPATCH_LEVEL */ -VOID RTMPSendRTSFrame(IN PRTMP_ADAPTER pAd, - IN PUCHAR pDA, +void RTMPSendRTSFrame(IN PRTMP_ADAPTER pAd, + u8 *pDA, IN unsigned int NextMpduSize, - IN UCHAR TxRate, - IN UCHAR RTSRate, - IN USHORT AckDuration, IN UCHAR QueIdx, IN UCHAR FrameGap) + u8 TxRate, + u8 RTSRate, + u16 AckDuration, u8 QueIdx, u8 FrameGap) { } @@ -1367,12 +1367,12 @@ VOID RTMPSendRTSFrame(IN PRTMP_ADAPTER pAd, /* In Cisco CCX 2.0 Leap Authentication */ /* WepStatus is Ndis802_11Encryption1Enabled but the key will use PairwiseKey */ /* Instead of the SharedKey, SharedKey Length may be Zero. */ -VOID STAFindCipherAlgorithm(IN PRTMP_ADAPTER pAd, IN TX_BLK * pTxBlk) +void STAFindCipherAlgorithm(IN PRTMP_ADAPTER pAd, IN TX_BLK * pTxBlk) { NDIS_802_11_ENCRYPTION_STATUS Cipher; /* To indicate cipher used for this packet */ - UCHAR CipherAlg = CIPHER_NONE; /* cipher alogrithm */ - UCHAR KeyIdx = 0xff; - PUCHAR pSrcBufVA; + u8 CipherAlg = CIPHER_NONE; /* cipher alogrithm */ + u8 KeyIdx = 0xff; + u8 *pSrcBufVA; PCIPHER_KEY pKey = NULL; pSrcBufVA = GET_OS_PKT_DATAPTR(pTxBlk->pPacket); @@ -1429,7 +1429,7 @@ VOID STAFindCipherAlgorithm(IN PRTMP_ADAPTER pAd, IN TX_BLK * pTxBlk) pTxBlk->pKey = pKey; } -VOID STABuildCommon802_11Header(IN PRTMP_ADAPTER pAd, IN TX_BLK * pTxBlk) +void STABuildCommon802_11Header(IN PRTMP_ADAPTER pAd, IN TX_BLK * pTxBlk) { HEADER_802_11 *pHeader_802_11; @@ -1510,8 +1510,8 @@ VOID STABuildCommon802_11Header(IN PRTMP_ADAPTER pAd, IN TX_BLK * pTxBlk) pHeader_802_11->FC.PwrMgmt = (pAd->StaCfg.Psm == PWR_SAVE); } -VOID STABuildCache802_11Header(IN RTMP_ADAPTER * pAd, - IN TX_BLK * pTxBlk, IN UCHAR * pHeader) +void STABuildCache802_11Header(IN RTMP_ADAPTER * pAd, + IN TX_BLK * pTxBlk, u8 * pHeader) { MAC_TABLE_ENTRY *pMacEntry; PHEADER_802_11 pHeader80211; @@ -1556,13 +1556,13 @@ VOID STABuildCache802_11Header(IN RTMP_ADAPTER * pAd, pHeader80211->FC.PwrMgmt = (pAd->StaCfg.Psm == PWR_SAVE); } -static inline PUCHAR STA_Build_ARalink_Frame_Header(IN RTMP_ADAPTER * pAd, +static inline u8 *STA_Build_ARalink_Frame_Header(IN RTMP_ADAPTER * pAd, IN TX_BLK * pTxBlk) { - PUCHAR pHeaderBufPtr; + u8 *pHeaderBufPtr; HEADER_802_11 *pHeader_802_11; PNDIS_PACKET pNextPacket; - UINT32 nextBufLen; + u32 nextBufLen; PQUEUE_ENTRY pQEntry; STAFindCipherAlgorithm(pAd, pTxBlk); @@ -1588,9 +1588,9 @@ static inline PUCHAR STA_Build_ARalink_Frame_Header(IN RTMP_ADAPTER * pAd, pTxBlk->MpduHeaderLen += 2; } /* padding at front of LLC header. LLC header should at 4-bytes aligment. */ - pTxBlk->HdrPadLen = (ULONG) pHeaderBufPtr; - pHeaderBufPtr = (PUCHAR) ROUND_UP(pHeaderBufPtr, 4); - pTxBlk->HdrPadLen = (ULONG) (pHeaderBufPtr - pTxBlk->HdrPadLen); + pTxBlk->HdrPadLen = (unsigned long)pHeaderBufPtr; + pHeaderBufPtr = (u8 *)ROUND_UP(pHeaderBufPtr, 4); + pTxBlk->HdrPadLen = (unsigned long)(pHeaderBufPtr - pTxBlk->HdrPadLen); /* For RA Aggregation, */ /* put the 2nd MSDU length(extra 2-byte field) after QOS_CONTROL in little endian format */ @@ -1600,8 +1600,8 @@ static inline PUCHAR STA_Build_ARalink_Frame_Header(IN RTMP_ADAPTER * pAd, if (RTMP_GET_PACKET_VLAN(pNextPacket)) nextBufLen -= LENGTH_802_1Q; - *pHeaderBufPtr = (UCHAR) nextBufLen & 0xff; - *(pHeaderBufPtr + 1) = (UCHAR) (nextBufLen >> 8); + *pHeaderBufPtr = (u8)nextBufLen & 0xff; + *(pHeaderBufPtr + 1) = (u8)(nextBufLen >> 8); pHeaderBufPtr += 2; pTxBlk->MpduHeaderLen += 2; @@ -1610,10 +1610,10 @@ static inline PUCHAR STA_Build_ARalink_Frame_Header(IN RTMP_ADAPTER * pAd, } -static inline PUCHAR STA_Build_AMSDU_Frame_Header(IN RTMP_ADAPTER * pAd, +static inline u8 *STA_Build_AMSDU_Frame_Header(IN RTMP_ADAPTER * pAd, IN TX_BLK * pTxBlk) { - PUCHAR pHeaderBufPtr; /*, pSaveBufPtr; */ + u8 *pHeaderBufPtr; /*, pSaveBufPtr; */ HEADER_802_11 *pHeader_802_11; STAFindCipherAlgorithm(pAd, pTxBlk); @@ -1647,19 +1647,19 @@ static inline PUCHAR STA_Build_AMSDU_Frame_Header(IN RTMP_ADAPTER * pAd, /* */ /* @@@ MpduHeaderLen excluding padding @@@ */ /* */ - pTxBlk->HdrPadLen = (ULONG) pHeaderBufPtr; - pHeaderBufPtr = (PUCHAR) ROUND_UP(pHeaderBufPtr, 4); - pTxBlk->HdrPadLen = (ULONG) (pHeaderBufPtr - pTxBlk->HdrPadLen); + pTxBlk->HdrPadLen = (unsigned long)pHeaderBufPtr; + pHeaderBufPtr = (u8 *)ROUND_UP(pHeaderBufPtr, 4); + pTxBlk->HdrPadLen = (unsigned long)(pHeaderBufPtr - pTxBlk->HdrPadLen); return pHeaderBufPtr; } -VOID STA_AMPDU_Frame_Tx(IN PRTMP_ADAPTER pAd, IN TX_BLK * pTxBlk) +void STA_AMPDU_Frame_Tx(IN PRTMP_ADAPTER pAd, IN TX_BLK * pTxBlk) { HEADER_802_11 *pHeader_802_11; - PUCHAR pHeaderBufPtr; - USHORT FreeNumber; + u8 *pHeaderBufPtr; + u16 FreeNumber; MAC_TABLE_ENTRY *pMacEntry; BOOLEAN bVLANPkt; PQUEUE_ENTRY pQEntry; @@ -1681,12 +1681,12 @@ VOID STA_AMPDU_Frame_Tx(IN PRTMP_ADAPTER pAd, IN TX_BLK * pTxBlk) pMacEntry = pTxBlk->pMacEntry; if (pMacEntry->isCached) { /* NOTE: Please make sure the size of pMacEntry->CachedBuf[] is smaller than pTxBlk->HeaderBuf[]!!!! */ - NdisMoveMemory((PUCHAR) & pTxBlk-> + NdisMoveMemory((u8 *)& pTxBlk-> HeaderBuf[TXINFO_SIZE], - (PUCHAR) & pMacEntry->CachedBuf[0], + (u8 *)& pMacEntry->CachedBuf[0], TXWI_SIZE + sizeof(HEADER_802_11)); pHeaderBufPtr = - (PUCHAR) (&pTxBlk-> + (u8 *)(&pTxBlk-> HeaderBuf[TXINFO_SIZE + TXWI_SIZE]); STABuildCache802_11Header(pAd, pTxBlk, pHeaderBufPtr); } else { @@ -1745,9 +1745,9 @@ VOID STA_AMPDU_Frame_Tx(IN PRTMP_ADAPTER pAd, IN TX_BLK * pTxBlk) /* */ /* @@@ MpduHeaderLen excluding padding @@@ */ /* */ - pTxBlk->HdrPadLen = (ULONG) pHeaderBufPtr; - pHeaderBufPtr = (PUCHAR) ROUND_UP(pHeaderBufPtr, 4); - pTxBlk->HdrPadLen = (ULONG) (pHeaderBufPtr - pTxBlk->HdrPadLen); + pTxBlk->HdrPadLen = (unsigned long)pHeaderBufPtr; + pHeaderBufPtr = (u8 *)ROUND_UP(pHeaderBufPtr, 4); + pTxBlk->HdrPadLen = (unsigned long)(pHeaderBufPtr - pTxBlk->HdrPadLen); { @@ -1784,13 +1784,13 @@ VOID STA_AMPDU_Frame_Tx(IN PRTMP_ADAPTER pAd, IN TX_BLK * pTxBlk) [TXINFO_SIZE]), pTxBlk); - NdisZeroMemory((PUCHAR) (&pMacEntry->CachedBuf[0]), + NdisZeroMemory((u8 *)(&pMacEntry->CachedBuf[0]), sizeof(pMacEntry->CachedBuf)); - NdisMoveMemory((PUCHAR) (&pMacEntry->CachedBuf[0]), - (PUCHAR) (&pTxBlk-> + NdisMoveMemory((u8 *)(&pMacEntry->CachedBuf[0]), + (u8 *)(&pTxBlk-> HeaderBuf[TXINFO_SIZE]), (pHeaderBufPtr - - (PUCHAR) (&pTxBlk-> + (u8 *)(&pTxBlk-> HeaderBuf[TXINFO_SIZE]))); pMacEntry->isCached = TRUE; } @@ -1819,15 +1819,15 @@ VOID STA_AMPDU_Frame_Tx(IN PRTMP_ADAPTER pAd, IN TX_BLK * pTxBlk) } -VOID STA_AMSDU_Frame_Tx(IN PRTMP_ADAPTER pAd, IN TX_BLK * pTxBlk) +void STA_AMSDU_Frame_Tx(IN PRTMP_ADAPTER pAd, IN TX_BLK * pTxBlk) { - PUCHAR pHeaderBufPtr; - USHORT FreeNumber; - USHORT subFramePayloadLen = 0; /* AMSDU Subframe length without AMSDU-Header / Padding. */ - USHORT totalMPDUSize = 0; - UCHAR *subFrameHeader; - UCHAR padding = 0; - USHORT FirstTx = 0, LastTxIdx = 0; + u8 *pHeaderBufPtr; + u16 FreeNumber; + u16 subFramePayloadLen = 0; /* AMSDU Subframe length without AMSDU-Header / Padding. */ + u16 totalMPDUSize = 0; + u8 *subFrameHeader; + u8 padding = 0; + u16 FirstTx = 0, LastTxIdx = 0; BOOLEAN bVLANPkt; int frameNum = 0; PQUEUE_ENTRY pQEntry; @@ -1951,11 +1951,11 @@ VOID STA_AMSDU_Frame_Tx(IN PRTMP_ADAPTER pAd, IN TX_BLK * pTxBlk) HAL_KickOutTx(pAd, pTxBlk, pTxBlk->QueIdx); } -VOID STA_Legacy_Frame_Tx(IN PRTMP_ADAPTER pAd, IN TX_BLK * pTxBlk) +void STA_Legacy_Frame_Tx(IN PRTMP_ADAPTER pAd, IN TX_BLK * pTxBlk) { HEADER_802_11 *pHeader_802_11; - PUCHAR pHeaderBufPtr; - USHORT FreeNumber; + u8 *pHeaderBufPtr; + u16 FreeNumber; BOOLEAN bVLANPkt; PQUEUE_ENTRY pQEntry; @@ -2014,9 +2014,9 @@ VOID STA_Legacy_Frame_Tx(IN PRTMP_ADAPTER pAd, IN TX_BLK * pTxBlk) pTxBlk->MpduHeaderLen += 2; } /* The remaining content of MPDU header should locate at 4-octets aligment */ - pTxBlk->HdrPadLen = (ULONG) pHeaderBufPtr; - pHeaderBufPtr = (PUCHAR) ROUND_UP(pHeaderBufPtr, 4); - pTxBlk->HdrPadLen = (ULONG) (pHeaderBufPtr - pTxBlk->HdrPadLen); + pTxBlk->HdrPadLen = (unsigned long)pHeaderBufPtr; + pHeaderBufPtr = (u8 *)ROUND_UP(pHeaderBufPtr, 4); + pTxBlk->HdrPadLen = (unsigned long)(pHeaderBufPtr - pTxBlk->HdrPadLen); { @@ -2030,7 +2030,7 @@ VOID STA_Legacy_Frame_Tx(IN PRTMP_ADAPTER pAd, IN TX_BLK * pTxBlk) EXTRA_LLCSNAP_ENCAP_FROM_PKT_START(pTxBlk->pSrcBufHeader, pTxBlk->pExtraLlcSnapEncap); if (pTxBlk->pExtraLlcSnapEncap) { - UCHAR vlan_size; + u8 vlan_size; NdisMoveMemory(pHeaderBufPtr, pTxBlk->pExtraLlcSnapEncap, 6); @@ -2069,12 +2069,12 @@ VOID STA_Legacy_Frame_Tx(IN PRTMP_ADAPTER pAd, IN TX_BLK * pTxBlk) HAL_KickOutTx(pAd, pTxBlk, pTxBlk->QueIdx); } -VOID STA_ARalink_Frame_Tx(IN PRTMP_ADAPTER pAd, IN TX_BLK * pTxBlk) +void STA_ARalink_Frame_Tx(IN PRTMP_ADAPTER pAd, IN TX_BLK * pTxBlk) { - PUCHAR pHeaderBufPtr; - USHORT FreeNumber; - USHORT totalMPDUSize = 0; - USHORT FirstTx, LastTxIdx; + u8 *pHeaderBufPtr; + u16 FreeNumber; + u16 totalMPDUSize = 0; + u16 FirstTx, LastTxIdx; int frameNum = 0; BOOLEAN bVLANPkt; PQUEUE_ENTRY pQEntry; @@ -2186,17 +2186,17 @@ VOID STA_ARalink_Frame_Tx(IN PRTMP_ADAPTER pAd, IN TX_BLK * pTxBlk) } -VOID STA_Fragment_Frame_Tx(IN RTMP_ADAPTER * pAd, IN TX_BLK * pTxBlk) +void STA_Fragment_Frame_Tx(IN RTMP_ADAPTER * pAd, IN TX_BLK * pTxBlk) { HEADER_802_11 *pHeader_802_11; - PUCHAR pHeaderBufPtr; - USHORT FreeNumber; - UCHAR fragNum = 0; + u8 *pHeaderBufPtr; + u16 FreeNumber; + u8 fragNum = 0; PACKET_INFO PacketInfo; - USHORT EncryptionOverhead = 0; - UINT32 FreeMpduSize, SrcRemainingBytes; - USHORT AckDuration; - UINT NextMpduSize; + u16 EncryptionOverhead = 0; + u32 FreeMpduSize, SrcRemainingBytes; + u16 AckDuration; + u32 NextMpduSize; BOOLEAN bVLANPkt; PQUEUE_ENTRY pQEntry; HTTRANSMIT_SETTING *pTransmit; @@ -2255,9 +2255,9 @@ VOID STA_Fragment_Frame_Tx(IN RTMP_ADAPTER * pAd, IN TX_BLK * pTxBlk) /* padding at front of LLC header */ /* LLC header should locate at 4-octets aligment */ /* */ - pTxBlk->HdrPadLen = (ULONG) pHeaderBufPtr; - pHeaderBufPtr = (PUCHAR) ROUND_UP(pHeaderBufPtr, 4); - pTxBlk->HdrPadLen = (ULONG) (pHeaderBufPtr - pTxBlk->HdrPadLen); + pTxBlk->HdrPadLen = (unsigned long)pHeaderBufPtr; + pHeaderBufPtr = (u8 *)ROUND_UP(pHeaderBufPtr, 4); + pTxBlk->HdrPadLen = (unsigned long)(pHeaderBufPtr - pTxBlk->HdrPadLen); /* */ /* Insert LLC-SNAP encapsulation - 8 octets */ @@ -2269,7 +2269,7 @@ VOID STA_Fragment_Frame_Tx(IN RTMP_ADAPTER * pAd, IN TX_BLK * pTxBlk) EXTRA_LLCSNAP_ENCAP_FROM_PKT_START(pTxBlk->pSrcBufHeader, pTxBlk->pExtraLlcSnapEncap); if (pTxBlk->pExtraLlcSnapEncap) { - UCHAR vlan_size; + u8 vlan_size; NdisMoveMemory(pHeaderBufPtr, pTxBlk->pExtraLlcSnapEncap, 6); pHeaderBufPtr += 6; @@ -2360,8 +2360,8 @@ VOID STA_Fragment_Frame_Tx(IN RTMP_ADAPTER * pAd, IN TX_BLK * pTxBlk) pTxBlk->SrcBufLen = FreeMpduSize; NextMpduSize = - min(((UINT) SrcRemainingBytes - pTxBlk->SrcBufLen), - ((UINT) pAd->CommonCfg.FragmentThreshold)); + min(((u32)SrcRemainingBytes - pTxBlk->SrcBufLen), + ((u32)pAd->CommonCfg.FragmentThreshold)); pHeader_802_11->FC.MoreFrag = 1; pHeader_802_11->Duration = (3 * pAd->CommonCfg.Dsifs) + (2 * AckDuration) + @@ -2434,8 +2434,8 @@ VOID STA_Fragment_Frame_Tx(IN RTMP_ADAPTER * pAd, IN TX_BLK * pTxBlk) ======================================================================== */ -NDIS_STATUS STAHardTransmit(IN PRTMP_ADAPTER pAd, - IN TX_BLK * pTxBlk, IN UCHAR QueIdx) +int STAHardTransmit(IN PRTMP_ADAPTER pAd, + IN TX_BLK * pTxBlk, u8 QueIdx) { NDIS_PACKET *pPacket; PQUEUE_ENTRY pQEntry; @@ -2523,7 +2523,7 @@ NDIS_STATUS STAHardTransmit(IN PRTMP_ADAPTER pAd, } -ULONG HashBytesPolynomial(UCHAR * value, unsigned int len) +unsigned long HashBytesPolynomial(u8 * value, unsigned int len) { unsigned char *word = value; unsigned int ret = 0; @@ -2537,9 +2537,9 @@ ULONG HashBytesPolynomial(UCHAR * value, unsigned int len) return ret; } -VOID Sta_Announce_or_Forward_802_3_Packet(IN PRTMP_ADAPTER pAd, +void Sta_Announce_or_Forward_802_3_Packet(IN PRTMP_ADAPTER pAd, IN PNDIS_PACKET pPacket, - IN UCHAR FromWhichBSSID) + u8 FromWhichBSSID) { if (TRUE) { announce_802_3_packet(pAd, pPacket); diff --git a/drivers/staging/rt2860/sta/sanity.c b/drivers/staging/rt2860/sta/sanity.c index ba6eaf6..a79348f 100644 --- a/drivers/staging/rt2860/sta/sanity.c +++ b/drivers/staging/rt2860/sta/sanity.c @@ -36,15 +36,15 @@ */ #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 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[]; /* ========================================================================== @@ -55,9 +55,9 @@ extern UCHAR BROADCOM_OUI[]; ========================================================================== */ BOOLEAN MlmeStartReqSanity(IN PRTMP_ADAPTER pAd, - IN VOID * Msg, - IN ULONG MsgLen, - OUT CHAR Ssid[], OUT UCHAR * pSsidLen) + void * Msg, + unsigned long MsgLen, + char Ssid[], u8 * pSsidLen) { MLME_START_REQ_STRUCT *Info; @@ -86,22 +86,22 @@ BOOLEAN MlmeStartReqSanity(IN PRTMP_ADAPTER pAd, ========================================================================== */ -BOOLEAN PeerAssocRspSanity(IN PRTMP_ADAPTER pAd, IN VOID * pMsg, IN ULONG MsgLen, OUT PUCHAR pAddr2, OUT USHORT * pCapabilityInfo, OUT USHORT * pStatus, OUT USHORT * pAid, OUT UCHAR SupRate[], OUT UCHAR * pSupRateLen, OUT UCHAR ExtRate[], OUT UCHAR * pExtRateLen, OUT HT_CAPABILITY_IE * pHtCapability, OUT ADD_HT_INFO_IE * pAddHtInfo, /* AP might use this additional ht info IE */ - OUT UCHAR * pHtCapabilityLen, - OUT UCHAR * pAddHtInfoLen, - OUT UCHAR * pNewExtChannelOffset, - OUT PEDCA_PARM pEdcaParm, OUT UCHAR * pCkipFlag) +BOOLEAN PeerAssocRspSanity(IN PRTMP_ADAPTER pAd, void * pMsg, unsigned long MsgLen, u8 *pAddr2, u16 * pCapabilityInfo, u16 * pStatus, u16 * pAid, u8 SupRate[], u8 * pSupRateLen, u8 ExtRate[], u8 * pExtRateLen, OUT HT_CAPABILITY_IE * pHtCapability, OUT ADD_HT_INFO_IE * pAddHtInfo, /* AP might use this additional ht info IE */ + u8 * pHtCapabilityLen, + u8 * pAddHtInfoLen, + u8 * pNewExtChannelOffset, + OUT PEDCA_PARM pEdcaParm, u8 * pCkipFlag) { - CHAR IeType, *Ptr; + char IeType, *Ptr; PFRAME_802_11 pFrame = (PFRAME_802_11) pMsg; PEID_STRUCT pEid; - ULONG Length = 0; + unsigned long Length = 0; *pNewExtChannelOffset = 0xff; *pHtCapabilityLen = 0; *pAddHtInfoLen = 0; COPY_MAC_ADDR(pAddr2, pFrame->Hdr.Addr2); - Ptr = (PCHAR) pFrame->Octet; + Ptr = (char *)pFrame->Octet; Length += LENGTH_802_11; NdisMoveMemory(pCapabilityInfo, &pFrame->Octet[0], 2); @@ -155,11 +155,11 @@ BOOLEAN PeerAssocRspSanity(IN PRTMP_ADAPTER pAd, IN VOID * pMsg, IN ULONG MsgLen NdisMoveMemory(pHtCapability, pEid->Octet, SIZE_HT_CAP_IE); - *(USHORT *) (&pHtCapability->HtCapInfo) = - cpu2le16(*(USHORT *) + *(u16 *) (&pHtCapability->HtCapInfo) = + cpu2le16(*(u16 *) (&pHtCapability->HtCapInfo)); - *(USHORT *) (&pHtCapability->ExtHtCapInfo) = - cpu2le16(*(USHORT *) + *(u16 *) (&pHtCapability->ExtHtCapInfo) = + cpu2le16(*(u16 *) (&pHtCapability->ExtHtCapInfo)); *pHtCapabilityLen = SIZE_HT_CAP_IE; @@ -177,11 +177,11 @@ BOOLEAN PeerAssocRspSanity(IN PRTMP_ADAPTER pAd, IN VOID * pMsg, IN ULONG MsgLen NdisMoveMemory(pAddHtInfo, pEid->Octet, sizeof(ADD_HT_INFO_IE)); - *(USHORT *) (&pAddHtInfo->AddHtInfo2) = - cpu2le16(*(USHORT *) + *(u16 *) (&pAddHtInfo->AddHtInfo2) = + cpu2le16(*(u16 *) (&pAddHtInfo->AddHtInfo2)); - *(USHORT *) (&pAddHtInfo->AddHtInfo3) = - cpu2le16(*(USHORT *) + *(u16 *) (&pAddHtInfo->AddHtInfo3) = + cpu2le16(*(u16 *) (&pAddHtInfo->AddHtInfo3)); *pAddHtInfoLen = SIZE_ADD_HT_INFO_IE; @@ -204,7 +204,7 @@ BOOLEAN PeerAssocRspSanity(IN PRTMP_ADAPTER pAd, IN VOID * pMsg, IN ULONG MsgLen /* handle WME PARAMTER ELEMENT */ if (NdisEqualMemory(pEid->Octet, WME_PARM_ELEM, 6) && (pEid->Len == 24)) { - PUCHAR ptr; + u8 *ptr; int i; /* parsing EDCA parameters */ @@ -217,9 +217,9 @@ BOOLEAN PeerAssocRspSanity(IN PRTMP_ADAPTER pAd, IN VOID * pMsg, IN ULONG MsgLen pEid->Octet[6] & 0x0f; pEdcaParm->bAPSDCapable = (pEid->Octet[6] & 0x80) ? 1 : 0; - ptr = (PUCHAR) & pEid->Octet[8]; + ptr = (u8 *)& 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 */ @@ -237,7 +237,7 @@ BOOLEAN PeerAssocRspSanity(IN PRTMP_ADAPTER pAd, IN VOID * pMsg, IN ULONG MsgLen } Length = Length + 2 + pEid->Len; - pEid = (PEID_STRUCT) ((UCHAR *) pEid + 2 + pEid->Len); + pEid = (PEID_STRUCT) ((u8 *) pEid + 2 + pEid->Len); } return TRUE; @@ -255,14 +255,14 @@ BOOLEAN PeerAssocRspSanity(IN PRTMP_ADAPTER pAd, IN VOID * pMsg, IN ULONG MsgLen ========================================================================== */ BOOLEAN PeerProbeReqSanity(IN PRTMP_ADAPTER pAd, - IN VOID * Msg, - IN ULONG MsgLen, - OUT PUCHAR pAddr2, - OUT CHAR Ssid[], OUT UCHAR * pSsidLen) + void * Msg, + unsigned long MsgLen, + u8 *pAddr2, + char Ssid[], u8 * pSsidLen) { - UCHAR Idx; - UCHAR RateLen; - CHAR IeType; + u8 Idx; + u8 RateLen; + char IeType; PFRAME_802_11 pFrame = (PFRAME_802_11) Msg; COPY_MAC_ADDR(pAddr2, pFrame->Hdr.Addr2); @@ -304,15 +304,15 @@ BOOLEAN PeerProbeReqSanity(IN PRTMP_ADAPTER pAd, ========================================================================== */ -BOOLEAN GetTimBit(IN CHAR * Ptr, - IN USHORT Aid, - OUT UCHAR * TimLen, - OUT UCHAR * BcastFlag, - OUT UCHAR * DtimCount, - OUT UCHAR * DtimPeriod, OUT UCHAR * MessageToMe) +BOOLEAN GetTimBit(char * Ptr, + u16 Aid, + u8 * TimLen, + u8 * BcastFlag, + u8 * DtimCount, + u8 * DtimPeriod, u8 * MessageToMe) { - UCHAR BitCntl, N1, N2, MyByte, MyBit; - CHAR *IdxPtr; + u8 BitCntl, N1, N2, MyByte, MyBit; + char *IdxPtr; IdxPtr = Ptr; diff --git a/drivers/staging/rt2860/sta/sync.c b/drivers/staging/rt2860/sta/sync.c index 12ab2d4..448e75f 100644 --- a/drivers/staging/rt2860/sta/sync.c +++ b/drivers/staging/rt2860/sta/sync.c @@ -50,7 +50,7 @@ ========================================================================== */ -VOID SyncStateMachineInit(IN PRTMP_ADAPTER pAd, +void SyncStateMachineInit(IN PRTMP_ADAPTER pAd, IN STATE_MACHINE * Sm, OUT STATE_MACHINE_FUNC Trans[]) { StateMachineInit(Sm, Trans, MAX_SYNC_STATE, MAX_SYNC_MSG, @@ -111,9 +111,9 @@ VOID SyncStateMachineInit(IN PRTMP_ADAPTER pAd, ========================================================================== */ -VOID BeaconTimeout(IN PVOID SystemSpecific1, - IN PVOID FunctionContext, - IN PVOID SystemSpecific2, IN PVOID SystemSpecific3) +void BeaconTimeout(void *SystemSpecific1, + void *FunctionContext, + void *SystemSpecific2, void *SystemSpecific3) { RTMP_ADAPTER *pAd = (RTMP_ADAPTER *) FunctionContext; @@ -126,7 +126,7 @@ VOID BeaconTimeout(IN PVOID SystemSpecific1, if ((pAd->CommonCfg.BBPCurrentBW == BW_40) ) { - UCHAR BBPValue = 0; + u8 BBPValue = 0; AsicSwitchChannel(pAd, pAd->CommonCfg.CentralChannel, FALSE); AsicLockChannel(pAd, pAd->CommonCfg.CentralChannel); RTMP_BBP_IO_READ8_BY_REG_ID(pAd, BBP_R4, &BBPValue); @@ -151,9 +151,9 @@ VOID BeaconTimeout(IN PVOID SystemSpecific1, ========================================================================== */ -VOID ScanTimeout(IN PVOID SystemSpecific1, - IN PVOID FunctionContext, - IN PVOID SystemSpecific2, IN PVOID SystemSpecific3) +void ScanTimeout(void *SystemSpecific1, + void *FunctionContext, + void *SystemSpecific2, void *SystemSpecific3) { RTMP_ADAPTER *pAd = (RTMP_ADAPTER *) FunctionContext; @@ -183,15 +183,15 @@ VOID ScanTimeout(IN PVOID SystemSpecific1, MLME SCAN req state machine procedure ========================================================================== */ -VOID MlmeScanReqAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) +void MlmeScanReqAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) { - UCHAR Ssid[MAX_LEN_OF_SSID], SsidLen, ScanType, BssType, BBPValue = 0; + u8 Ssid[MAX_LEN_OF_SSID], SsidLen, ScanType, BssType, BBPValue = 0; BOOLEAN TimerCancelled; - ULONG Now; - USHORT Status; + unsigned long Now; + u16 Status; PHEADER_802_11 pHdr80211; - PUCHAR pOutBuffer = NULL; - NDIS_STATUS NStatus; + u8 *pOutBuffer = NULL; + int NStatus; /* Check the total scan tries for one single OID command */ /* If this is the CCX 2.0 Case, skip that! */ @@ -225,7 +225,7 @@ VOID MlmeScanReqAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) if (MlmeScanReqSanity(pAd, Elem->Msg, Elem->MsgLen, - &BssType, (PCHAR) Ssid, &SsidLen, &ScanType)) { + &BssType, (char *)Ssid, &SsidLen, &ScanType)) { /* Check for channel load and noise hist request */ /* Suspend MSDU only at scan request, not the last two mentioned */ @@ -239,7 +239,7 @@ VOID MlmeScanReqAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) /* */ if (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_MEDIA_STATE_CONNECTED) && (INFRA_ON(pAd))) { - NStatus = MlmeAllocateMemory(pAd, (PVOID) & pOutBuffer); + NStatus = MlmeAllocateMemory(pAd, (void *)& pOutBuffer); if (NStatus == NDIS_STATUS_SUCCESS) { pHdr80211 = (PHEADER_802_11) pOutBuffer; MgtMacHeaderInit(pAd, pHdr80211, @@ -297,21 +297,21 @@ VOID MlmeScanReqAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) MLME JOIN req state machine procedure ========================================================================== */ -VOID MlmeJoinReqAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) +void MlmeJoinReqAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) { - UCHAR BBPValue = 0; + u8 BBPValue = 0; BSS_ENTRY *pBss; BOOLEAN TimerCancelled; HEADER_802_11 Hdr80211; - NDIS_STATUS NStatus; - ULONG FrameLen = 0; - PUCHAR pOutBuffer = NULL; - PUCHAR pSupRate = NULL; - UCHAR SupRateLen; - PUCHAR pExtRate = NULL; - UCHAR ExtRateLen; - UCHAR ASupRate[] = { 0x8C, 0x12, 0x98, 0x24, 0xb0, 0x48, 0x60, 0x6C }; - UCHAR ASupRateLen = sizeof(ASupRate) / sizeof(UCHAR); + int NStatus; + unsigned long FrameLen = 0; + u8 *pOutBuffer = NULL; + u8 *pSupRate = NULL; + u8 SupRateLen; + u8 *pExtRate = NULL; + u8 ExtRateLen; + u8 ASupRate[] = { 0x8C, 0x12, 0x98, 0x24, 0xb0, 0x48, 0x60, 0x6C }; + u8 ASupRateLen = sizeof(ASupRate) / sizeof(u8); MLME_JOIN_REQ_STRUCT *pInfo = (MLME_JOIN_REQ_STRUCT *) (Elem->Msg); DBGPRINT(RT_DEBUG_TRACE, @@ -409,7 +409,7 @@ VOID MlmeJoinReqAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) END_OF_ARGS); if (ExtRateLen) { - ULONG Tmp; + unsigned long Tmp; MakeOutgoingFrame(pOutBuffer + FrameLen, &Tmp, 1, &ExtRateIe, 1, &ExtRateLen, @@ -437,17 +437,17 @@ VOID MlmeJoinReqAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) MLME START Request state machine procedure, starting an IBSS ========================================================================== */ -VOID MlmeStartReqAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) +void MlmeStartReqAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) { - UCHAR Ssid[MAX_LEN_OF_SSID], SsidLen; + u8 Ssid[MAX_LEN_OF_SSID], SsidLen; BOOLEAN TimerCancelled; /* New for WPA security suites */ - UCHAR VarIE[MAX_VIE_LEN]; /* Total VIE length = MAX_VIE_LEN - -5 */ + u8 VarIE[MAX_VIE_LEN]; /* Total VIE length = MAX_VIE_LEN - -5 */ NDIS_802_11_VARIABLE_IEs *pVIE = NULL; LARGE_INTEGER TimeStamp; BOOLEAN Privacy; - USHORT Status; + u16 Status; /* Init Variable IE structure */ pVIE = (PNDIS_802_11_VARIABLE_IEs) VarIE; @@ -456,7 +456,7 @@ VOID MlmeStartReqAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) TimeStamp.u.HighPart = 0; if (MlmeStartReqSanity - (pAd, Elem->Msg, Elem->MsgLen, (PCHAR) Ssid, &SsidLen)) { + (pAd, Elem->Msg, Elem->MsgLen, (char *)Ssid, &SsidLen)) { /* reset all the timers */ RTMPCancelTimer(&pAd->MlmeAux.ScanTimer, &TimerCancelled); RTMPCancelTimer(&pAd->MlmeAux.BeaconTimer, &TimerCancelled); @@ -550,33 +550,33 @@ VOID MlmeStartReqAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) peer sends beacon back when scanning ========================================================================== */ -VOID PeerBeaconAtScanAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) +void PeerBeaconAtScanAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) { - UCHAR Bssid[MAC_ADDR_LEN], Addr2[MAC_ADDR_LEN]; - UCHAR Ssid[MAX_LEN_OF_SSID], BssType, Channel, NewChannel, + u8 Bssid[MAC_ADDR_LEN], Addr2[MAC_ADDR_LEN]; + u8 Ssid[MAX_LEN_OF_SSID], BssType, Channel, NewChannel, SsidLen, DtimCount, DtimPeriod, BcastFlag, MessageToMe; CF_PARM CfParm; - USHORT BeaconPeriod, AtimWin, CapabilityInfo; + u16 BeaconPeriod, AtimWin, CapabilityInfo; PFRAME_802_11 pFrame; LARGE_INTEGER TimeStamp; - UCHAR Erp; - UCHAR SupRate[MAX_LEN_OF_SUPPORTED_RATES], + u8 Erp; + u8 SupRate[MAX_LEN_OF_SUPPORTED_RATES], ExtRate[MAX_LEN_OF_SUPPORTED_RATES]; - UCHAR SupRateLen, ExtRateLen; - USHORT LenVIE; - UCHAR CkipFlag; - UCHAR AironetCellPowerLimit; + u8 SupRateLen, ExtRateLen; + u16 LenVIE; + u8 CkipFlag; + u8 AironetCellPowerLimit; EDCA_PARM EdcaParm; QBSS_LOAD_PARM QbssLoad; QOS_CAPABILITY_PARM QosCapability; - ULONG RalinkIe; - UCHAR VarIE[MAX_VIE_LEN]; /* Total VIE length = MAX_VIE_LEN - -5 */ + unsigned long RalinkIe; + u8 VarIE[MAX_VIE_LEN]; /* Total VIE length = MAX_VIE_LEN - -5 */ NDIS_802_11_VARIABLE_IEs *pVIE = NULL; HT_CAPABILITY_IE HtCapability; ADD_HT_INFO_IE AddHtInfo; /* AP might use this additional ht info IE */ - UCHAR HtCapabilityLen = 0, PreNHtCapabilityLen = 0; - UCHAR AddHtInfoLen; - UCHAR NewExtChannelOffset = 0xff; + u8 HtCapabilityLen = 0, PreNHtCapabilityLen = 0; + u8 AddHtInfoLen; + u8 NewExtChannelOffset = 0xff; /* NdisFillMemory(Ssid, MAX_LEN_OF_SSID, 0x00); */ pFrame = (PFRAME_802_11) Elem->Msg; @@ -593,7 +593,7 @@ VOID PeerBeaconAtScanAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) Elem->Channel, Addr2, Bssid, - (PCHAR) Ssid, + (char *)Ssid, &SsidLen, &BssType, &BeaconPeriod, @@ -624,8 +624,8 @@ VOID PeerBeaconAtScanAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) &AddHtInfoLen, &AddHtInfo, &NewExtChannelOffset, &LenVIE, pVIE)) { - ULONG Idx; - CHAR Rssi = 0; + unsigned long Idx; + char Rssi = 0; Idx = BssTableSearch(&pAd->ScanTab, Bssid, Channel); if (Idx != BSS_NOT_FOUND) @@ -640,7 +640,7 @@ VOID PeerBeaconAtScanAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) HtCapabilityLen = SIZE_HT_CAP_IE; Idx = - BssTableSetEntry(pAd, &pAd->ScanTab, Bssid, (PCHAR) Ssid, + BssTableSetEntry(pAd, &pAd->ScanTab, Bssid, (char *)Ssid, SsidLen, BssType, BeaconPeriod, &CfParm, AtimWin, CapabilityInfo, SupRate, SupRateLen, ExtRate, ExtRateLen, @@ -668,36 +668,36 @@ VOID PeerBeaconAtScanAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) When waiting joining the (I)BSS, beacon received from external ========================================================================== */ -VOID PeerBeaconAtJoinAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) +void PeerBeaconAtJoinAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) { - UCHAR Bssid[MAC_ADDR_LEN], Addr2[MAC_ADDR_LEN]; - UCHAR Ssid[MAX_LEN_OF_SSID], SsidLen, BssType, Channel, MessageToMe, + u8 Bssid[MAC_ADDR_LEN], Addr2[MAC_ADDR_LEN]; + u8 Ssid[MAX_LEN_OF_SSID], SsidLen, BssType, Channel, MessageToMe, DtimCount, DtimPeriod, BcastFlag, NewChannel; LARGE_INTEGER TimeStamp; - USHORT BeaconPeriod, AtimWin, CapabilityInfo; + u16 BeaconPeriod, AtimWin, CapabilityInfo; CF_PARM Cf; BOOLEAN TimerCancelled; - UCHAR Erp; - UCHAR SupRate[MAX_LEN_OF_SUPPORTED_RATES], + u8 Erp; + u8 SupRate[MAX_LEN_OF_SUPPORTED_RATES], ExtRate[MAX_LEN_OF_SUPPORTED_RATES]; - UCHAR SupRateLen, ExtRateLen; - UCHAR CkipFlag; - USHORT LenVIE; - UCHAR AironetCellPowerLimit; + u8 SupRateLen, ExtRateLen; + u8 CkipFlag; + u16 LenVIE; + u8 AironetCellPowerLimit; EDCA_PARM EdcaParm; QBSS_LOAD_PARM QbssLoad; QOS_CAPABILITY_PARM QosCapability; - USHORT Status; - UCHAR VarIE[MAX_VIE_LEN]; /* Total VIE length = MAX_VIE_LEN - -5 */ + u16 Status; + u8 VarIE[MAX_VIE_LEN]; /* Total VIE length = MAX_VIE_LEN - -5 */ NDIS_802_11_VARIABLE_IEs *pVIE = NULL; - ULONG RalinkIe; - ULONG Idx; + unsigned long RalinkIe; + unsigned long Idx; HT_CAPABILITY_IE HtCapability; ADD_HT_INFO_IE AddHtInfo; /* AP might use this additional ht info IE */ - UCHAR HtCapabilityLen = 0, PreNHtCapabilityLen = 0; - UCHAR AddHtInfoLen; - UCHAR NewExtChannelOffset = 0xff; - UCHAR CentralChannel; + u8 HtCapabilityLen = 0, PreNHtCapabilityLen = 0; + u8 AddHtInfoLen; + u8 NewExtChannelOffset = 0xff; + u8 CentralChannel; BOOLEAN bAllowNrate = FALSE; /* Init Variable IE structure */ @@ -712,7 +712,7 @@ VOID PeerBeaconAtJoinAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) Elem->Channel, Addr2, Bssid, - (PCHAR) Ssid, + (char *)Ssid, &SsidLen, &BssType, &BeaconPeriod, @@ -798,7 +798,7 @@ VOID PeerBeaconAtJoinAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) Channel); if (Idx == BSS_NOT_FOUND) { - CHAR Rssi = 0; + char Rssi = 0; Rssi = RTMPMaxRssi(pAd, ConvertToRssi(pAd, @@ -816,7 +816,7 @@ VOID PeerBeaconAtJoinAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) Idx = BssTableSetEntry(pAd, &pAd->ScanTab, Bssid, - (CHAR *) Ssid, + (char *) Ssid, SsidLen, BssType, BeaconPeriod, &Cf, AtimWin, @@ -1041,35 +1041,35 @@ VOID PeerBeaconAtJoinAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) ========================================================================== */ -VOID PeerBeacon(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) +void PeerBeacon(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) { - UCHAR Bssid[MAC_ADDR_LEN], Addr2[MAC_ADDR_LEN]; - CHAR Ssid[MAX_LEN_OF_SSID]; + u8 Bssid[MAC_ADDR_LEN], Addr2[MAC_ADDR_LEN]; + char Ssid[MAX_LEN_OF_SSID]; CF_PARM CfParm; - UCHAR SsidLen, MessageToMe = 0, BssType, Channel, NewChannel, index = 0; - UCHAR DtimCount = 0, DtimPeriod = 0, BcastFlag = 0; - USHORT CapabilityInfo, AtimWin, BeaconPeriod; + u8 SsidLen, MessageToMe = 0, BssType, Channel, NewChannel, index = 0; + u8 DtimCount = 0, DtimPeriod = 0, BcastFlag = 0; + u16 CapabilityInfo, AtimWin, BeaconPeriod; LARGE_INTEGER TimeStamp; - USHORT TbttNumToNextWakeUp; - UCHAR Erp; - UCHAR SupRate[MAX_LEN_OF_SUPPORTED_RATES], + u16 TbttNumToNextWakeUp; + u8 Erp; + u8 SupRate[MAX_LEN_OF_SUPPORTED_RATES], ExtRate[MAX_LEN_OF_SUPPORTED_RATES]; - UCHAR SupRateLen, ExtRateLen; - UCHAR CkipFlag; - USHORT LenVIE; - UCHAR AironetCellPowerLimit; + u8 SupRateLen, ExtRateLen; + u8 CkipFlag; + u16 LenVIE; + u8 AironetCellPowerLimit; EDCA_PARM EdcaParm; QBSS_LOAD_PARM QbssLoad; QOS_CAPABILITY_PARM QosCapability; - ULONG RalinkIe; + unsigned long RalinkIe; /* New for WPA security suites */ - UCHAR VarIE[MAX_VIE_LEN]; /* Total VIE length = MAX_VIE_LEN - -5 */ + u8 VarIE[MAX_VIE_LEN]; /* Total VIE length = MAX_VIE_LEN - -5 */ NDIS_802_11_VARIABLE_IEs *pVIE = NULL; HT_CAPABILITY_IE HtCapability; ADD_HT_INFO_IE AddHtInfo; /* AP might use this additional ht info IE */ - UCHAR HtCapabilityLen, PreNHtCapabilityLen; - UCHAR AddHtInfoLen; - UCHAR NewExtChannelOffset = 0xff; + u8 HtCapabilityLen, PreNHtCapabilityLen; + u8 AddHtInfoLen; + u8 NewExtChannelOffset = 0xff; if (!(INFRA_ON(pAd) || ADHOC_ON(pAd) )) @@ -1119,9 +1119,9 @@ VOID PeerBeacon(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) &AddHtInfo, &NewExtChannelOffset, &LenVIE, pVIE)) { BOOLEAN is_my_bssid, is_my_ssid; - ULONG Bssidx, Now; + unsigned long Bssidx, Now; BSS_ENTRY *pBss; - CHAR RealRssi = + char RealRssi = RTMPMaxRssi(pAd, ConvertToRssi(pAd, Elem->Rssi0, RSSI_0), ConvertToRssi(pAd, Elem->Rssi1, RSSI_1), ConvertToRssi(pAd, Elem->Rssi2, RSSI_2)); @@ -1214,7 +1214,7 @@ VOID PeerBeacon(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) /* if the ssid matched & bssid unmatched, we should select the bssid with large value. */ /* This might happened when two STA start at the same time */ if ((!is_my_bssid) && ADHOC_ON(pAd)) { - INT i; + int i; /* Add the safeguard against the mismatch of adhoc wep status */ if (pAd->StaCfg.WepStatus != @@ -1279,8 +1279,8 @@ VOID PeerBeacon(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) } if (ADHOC_ON(pAd) && (CAP_IS_IBSS_ON(CapabilityInfo))) { - UCHAR MaxSupportedRateIn500Kbps = 0; - UCHAR idx; + u8 MaxSupportedRateIn500Kbps = 0; + u8 idx; MAC_TABLE_ENTRY *pEntry; /* supported rates array may not be sorted. sort it and find the maximum rate */ @@ -1516,7 +1516,7 @@ VOID PeerBeacon(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) MlmeSetTxPreamble(pAd, Rt802_11PreambleLong); DBGPRINT(RT_DEBUG_TRACE, - ("SYNC - AP forced to use LONG preamble\n")); + ("SYNC - AP forced to use long preamble\n")); } if (OPSTATUS_TEST_FLAG @@ -1543,7 +1543,7 @@ VOID PeerBeacon(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) /* only INFRASTRUCTURE mode support power-saving feature */ if ((INFRA_ON(pAd) && (pAd->StaCfg.Psm == PWR_SAVE)) || (pAd->CommonCfg.bAPSDForcePowerSave)) { - UCHAR FreeNumber; + u8 FreeNumber; /* 1. AP has backlogged unicast-to-me frame, stay AWAKE, send PSPOLL */ /* 2. AP has backlogged broadcast/multicast frame and we want those frames, stay AWAKE */ /* 3. we have outgoing frames in TxRing or MgmtRing, better stay AWAKE */ @@ -1660,7 +1660,7 @@ VOID PeerBeacon(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) due to MaxSPLength. */ } else { - USHORT NextDtim = DtimCount; + u16 NextDtim = DtimCount; if (NextDtim == 0) NextDtim = DtimPeriod; @@ -1703,22 +1703,22 @@ VOID PeerBeacon(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) Receive PROBE REQ from remote peer when operating in IBSS mode ========================================================================== */ -VOID PeerProbeReqAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) +void PeerProbeReqAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) { - UCHAR Addr2[MAC_ADDR_LEN]; - CHAR Ssid[MAX_LEN_OF_SSID]; - UCHAR SsidLen; - UCHAR HtLen, AddHtLen, NewExtLen; + u8 Addr2[MAC_ADDR_LEN]; + char Ssid[MAX_LEN_OF_SSID]; + u8 SsidLen; + u8 HtLen, AddHtLen, NewExtLen; HEADER_802_11 ProbeRspHdr; - NDIS_STATUS NStatus; - PUCHAR pOutBuffer = NULL; - ULONG FrameLen = 0; + int NStatus; + u8 *pOutBuffer = NULL; + unsigned long FrameLen = 0; LARGE_INTEGER FakeTimestamp; - UCHAR DsLen = 1, IbssLen = 2; - UCHAR LocalErpIe[3] = { IE_ERP, 1, 0 }; + u8 DsLen = 1, IbssLen = 2; + u8 LocalErpIe[3] = { IE_ERP, 1, 0 }; BOOLEAN Privacy; - USHORT CapabilityInfo; - UCHAR RSNIe = IE_WPA; + u16 CapabilityInfo; + u8 RSNIe = IE_WPA; if (!ADHOC_ON(pAd)) return; @@ -1764,7 +1764,7 @@ VOID PeerProbeReqAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) &pAd->StaActive.AtimWin, END_OF_ARGS); if (pAd->StaActive.ExtRateLen) { - ULONG tmp; + unsigned long tmp; MakeOutgoingFrame(pOutBuffer + FrameLen, &tmp, 3, LocalErpIe, 1, &ExtRateIe, @@ -1776,7 +1776,7 @@ VOID PeerProbeReqAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) } /* If adhoc secruity is set for WPA-None, append the cipher suite IE */ if (pAd->StaCfg.AuthMode == Ndis802_11AuthModeWPANone) { - ULONG tmp; + unsigned long tmp; MakeOutgoingFrame(pOutBuffer + FrameLen, &tmp, 1, &RSNIe, 1, &pAd->StaCfg.RSNIE_Len, @@ -1787,8 +1787,8 @@ VOID PeerProbeReqAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) } if (pAd->CommonCfg.PhyMode >= PHY_11ABGN_MIXED) { - ULONG TmpLen; - UCHAR BROADCOM[4] = { 0x0, 0x90, 0x4c, 0x33 }; + unsigned long TmpLen; + u8 BROADCOM[4] = { 0x0, 0x90, 0x4c, 0x33 }; HtLen = sizeof(pAd->CommonCfg.HtCapability); AddHtLen = sizeof(pAd->CommonCfg.AddHTInfo); NewExtLen = 1; @@ -1833,9 +1833,9 @@ VOID PeerProbeReqAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) } } -VOID BeaconTimeoutAtJoinAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) +void BeaconTimeoutAtJoinAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) { - USHORT Status; + u16 Status; DBGPRINT(RT_DEBUG_TRACE, ("SYNC - BeaconTimeoutAtJoinAction\n")); pAd->Mlme.SyncMachine.CurrState = SYNC_IDLE; Status = MLME_REJ_TIMEOUT; @@ -1848,7 +1848,7 @@ VOID BeaconTimeoutAtJoinAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) Scan timeout procedure. basically add channel index by 1 and rescan ========================================================================== */ -VOID ScanTimeoutAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) +void ScanTimeoutAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) { pAd->MlmeAux.Channel = NextChannel(pAd, pAd->MlmeAux.Channel); @@ -1868,9 +1868,9 @@ VOID ScanTimeoutAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) Description: ========================================================================== */ -VOID InvalidStateWhenScan(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) +void InvalidStateWhenScan(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) { - USHORT Status; + u16 Status; DBGPRINT(RT_DEBUG_TRACE, ("AYNC - InvalidStateWhenScan(state=%ld). Reset SYNC machine\n", pAd->Mlme.SyncMachine.CurrState)); @@ -1884,9 +1884,9 @@ VOID InvalidStateWhenScan(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) Description: ========================================================================== */ -VOID InvalidStateWhenJoin(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) +void InvalidStateWhenJoin(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) { - USHORT Status; + u16 Status; DBGPRINT(RT_DEBUG_TRACE, ("InvalidStateWhenJoin(state=%ld). Reset SYNC machine\n", pAd->Mlme.SyncMachine.CurrState)); @@ -1900,9 +1900,9 @@ VOID InvalidStateWhenJoin(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) Description: ========================================================================== */ -VOID InvalidStateWhenStart(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) +void InvalidStateWhenStart(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) { - USHORT Status; + u16 Status; DBGPRINT(RT_DEBUG_TRACE, ("InvalidStateWhenStart(state=%ld). Reset SYNC machine\n", pAd->Mlme.SyncMachine.CurrState)); @@ -1919,12 +1919,12 @@ VOID InvalidStateWhenStart(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) ========================================================================== */ -VOID EnqueuePsPoll(IN PRTMP_ADAPTER pAd) +void EnqueuePsPoll(IN PRTMP_ADAPTER pAd) { if (pAd->StaCfg.WindowsPowerMode == Ndis802_11PowerModeLegacy_PSP) pAd->PsPollFrame.FC.PwrMgmt = PWR_SAVE; - MiniportMMRequest(pAd, 0, (PUCHAR) & pAd->PsPollFrame, + MiniportMMRequest(pAd, 0, (u8 *)& pAd->PsPollFrame, sizeof(PSPOLL_FRAME)); } @@ -1933,11 +1933,11 @@ VOID EnqueuePsPoll(IN PRTMP_ADAPTER pAd) Description: ========================================================================== */ -VOID EnqueueProbeRequest(IN PRTMP_ADAPTER pAd) +void EnqueueProbeRequest(IN PRTMP_ADAPTER pAd) { - NDIS_STATUS NState; - PUCHAR pOutBuffer; - ULONG FrameLen = 0; + int NState; + u8 *pOutBuffer; + unsigned long FrameLen = 0; HEADER_802_11 Hdr80211; DBGPRINT(RT_DEBUG_TRACE, ("force out a ProbeRequest ...\n")); diff --git a/drivers/staging/rt2860/sta/wpa.c b/drivers/staging/rt2860/sta/wpa.c index 15ed01e..abc730b 100644 --- a/drivers/staging/rt2860/sta/wpa.c +++ b/drivers/staging/rt2860/sta/wpa.c @@ -37,7 +37,7 @@ */ #include "../rt_config.h" -void inc_byte_array(UCHAR * counter, int len); +void inc_byte_array(u8 * counter, int len); /* ======================================================================== @@ -58,10 +58,10 @@ void inc_byte_array(UCHAR * counter, int len); ======================================================================== */ -VOID RTMPReportMicError(IN PRTMP_ADAPTER pAd, IN PCIPHER_KEY pWpaKey) +void RTMPReportMicError(IN PRTMP_ADAPTER pAd, IN PCIPHER_KEY pWpaKey) { - ULONG Now; - UCHAR unicastKey = (pWpaKey->Type == PAIRWISE_KEY ? 1 : 0); + unsigned long Now; + u8 unicastKey = (pWpaKey->Type == PAIRWISE_KEY ? 1 : 0); /* Record Last MIC error time and count */ NdisGetSystemUpTime(&Now); @@ -113,12 +113,12 @@ VOID RTMPReportMicError(IN PRTMP_ADAPTER pAd, IN PCIPHER_KEY pWpaKey) #define LENGTH_EAP_H 4 /* If the received frame is EAP-Packet ,find out its EAP-Code (Request(0x01), Response(0x02), Success(0x03), Failure(0x04)). */ -INT WpaCheckEapCode(IN PRTMP_ADAPTER pAd, - IN PUCHAR pFrame, IN USHORT FrameLen, IN USHORT OffSet) +int WpaCheckEapCode(IN PRTMP_ADAPTER pAd, + u8 *pFrame, u16 FrameLen, u16 OffSet) { - PUCHAR pData; - INT result = 0; + u8 *pData; + int result = 0; if (FrameLen < OffSet + LENGTH_EAPOL_H + LENGTH_EAP_H) return result; @@ -133,7 +133,7 @@ INT WpaCheckEapCode(IN PRTMP_ADAPTER pAd, return result; } -VOID WpaSendMicFailureToWpaSupplicant(IN PRTMP_ADAPTER pAd, IN BOOLEAN bUnicast) +void WpaSendMicFailureToWpaSupplicant(IN PRTMP_ADAPTER pAd, IN BOOLEAN bUnicast) { char custom[IW_CUSTOM_MAX] = { 0 }; @@ -141,19 +141,19 @@ VOID WpaSendMicFailureToWpaSupplicant(IN PRTMP_ADAPTER pAd, IN BOOLEAN bUnicast) if (bUnicast) sprintf(custom, "%s unicast", custom); - RtmpOSWrielessEventSend(pAd, IWEVCUSTOM, -1, NULL, (PUCHAR) custom, + RtmpOSWrielessEventSend(pAd, IWEVCUSTOM, -1, NULL, (u8 *)custom, strlen(custom)); return; } -VOID WpaMicFailureReportFrame(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) +void WpaMicFailureReportFrame(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) { - PUCHAR pOutBuffer = NULL; - UCHAR Header802_3[14]; - ULONG FrameLen = 0; + u8 *pOutBuffer = NULL; + u8 Header802_3[14]; + unsigned long FrameLen = 0; EAPOL_PACKET Packet; - UCHAR Mic[16]; + u8 Mic[16]; BOOLEAN bUnicast; DBGPRINT(RT_DEBUG_TRACE, ("WpaMicFailureReportFrame ----->\n")); @@ -190,30 +190,30 @@ VOID WpaMicFailureReportFrame(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) Packet.KeyDesc.KeyInfo.Error = 1; /* Update packet length after decide Key data payload */ - SET_UINT16_TO_ARRARY(Packet.Body_Len, LEN_EAPOL_KEY_MSG) + SET_u16_TO_ARRARY(Packet.Body_Len, LEN_EAPOL_KEY_MSG) /* Key Replay Count */ NdisMoveMemory(Packet.KeyDesc.ReplayCounter, pAd->StaCfg.ReplayCounter, LEN_KEY_DESC_REPLAY); inc_byte_array(pAd->StaCfg.ReplayCounter, 8); /* Convert to little-endian format. */ - *((USHORT *) & Packet.KeyDesc.KeyInfo) = - cpu2le16(*((USHORT *) & Packet.KeyDesc.KeyInfo)); + *((u16 *) & Packet.KeyDesc.KeyInfo) = + cpu2le16(*((u16 *) & Packet.KeyDesc.KeyInfo)); - MlmeAllocateMemory(pAd, (PUCHAR *) & pOutBuffer); /* allocate memory */ + MlmeAllocateMemory(pAd, (u8 **) & pOutBuffer); /* allocate memory */ if (pOutBuffer == NULL) { return; } /* Prepare EAPOL frame for MIC calculation */ /* Be careful, only EAPOL frame is counted for MIC calculation */ MakeOutgoingFrame(pOutBuffer, &FrameLen, - CONV_ARRARY_TO_UINT16(Packet.Body_Len) + 4, &Packet, + CONV_ARRARY_TO_u16(Packet.Body_Len) + 4, &Packet, END_OF_ARGS); /* Prepare and Fill MIC value */ NdisZeroMemory(Mic, sizeof(Mic)); if (pAd->StaCfg.WepStatus == Ndis802_11Encryption3Enabled) { /* AES */ - UCHAR digest[20] = { 0 }; + u8 digest[20] = { 0 }; HMAC_SHA1(pAd->StaCfg.PTK, LEN_EAP_MICK, pOutBuffer, FrameLen, digest, SHA1_DIGEST_SIZE); NdisMoveMemory(Mic, digest, LEN_KEY_DESC_MIC); @@ -226,10 +226,10 @@ VOID WpaMicFailureReportFrame(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) /* copy frame to Tx ring and send MIC failure report frame to authenticator */ RTMPToWirelessSta(pAd, &pAd->MacTab.Content[BSSID_WCID], Header802_3, LENGTH_802_3, - (PUCHAR) & Packet, - CONV_ARRARY_TO_UINT16(Packet.Body_Len) + 4, FALSE); + (u8 *)& Packet, + CONV_ARRARY_TO_u16(Packet.Body_Len) + 4, FALSE); - MlmeFreeMemory(pAd, (PUCHAR) pOutBuffer); + MlmeFreeMemory(pAd, (u8 *)pOutBuffer); DBGPRINT(RT_DEBUG_TRACE, ("WpaMicFailureReportFrame <-----\n")); } @@ -243,7 +243,7 @@ VOID WpaMicFailureReportFrame(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) * rolling over to more significant bytes if the byte was incremented from * 0xff to 0x00. */ -void inc_byte_array(UCHAR * counter, int len) +void inc_byte_array(u8 * counter, int len) { int pos = len - 1; while (pos >= 0) { @@ -254,10 +254,10 @@ void inc_byte_array(UCHAR * counter, int len) } } -VOID WpaDisassocApAndBlockAssoc(IN PVOID SystemSpecific1, - IN PVOID FunctionContext, - IN PVOID SystemSpecific2, - IN PVOID SystemSpecific3) +void WpaDisassocApAndBlockAssoc(void *SystemSpecific1, + void *FunctionContext, + void *SystemSpecific2, + void *SystemSpecific3) { RTMP_ADAPTER *pAd = (PRTMP_ADAPTER) FunctionContext; MLME_DISASSOC_REQ_STRUCT DisassocReq; @@ -274,7 +274,7 @@ VOID WpaDisassocApAndBlockAssoc(IN PVOID SystemSpecific1, pAd->StaCfg.bBlockAssoc = TRUE; } -VOID WpaStaPairwiseKeySetting(IN PRTMP_ADAPTER pAd) +void WpaStaPairwiseKeySetting(IN PRTMP_ADAPTER pAd) { PCIPHER_KEY pSharedKey; PMAC_TABLE_ENTRY pEntry; @@ -330,7 +330,7 @@ VOID WpaStaPairwiseKeySetting(IN PRTMP_ADAPTER pAd) } -VOID WpaStaGroupKeySetting(IN PRTMP_ADAPTER pAd) +void WpaStaGroupKeySetting(IN PRTMP_ADAPTER pAd) { PCIPHER_KEY pSharedKey; diff --git a/drivers/staging/rt2860/sta_ioctl.c b/drivers/staging/rt2860/sta_ioctl.c index d92a41e..88a7922 100644 --- a/drivers/staging/rt2860/sta_ioctl.c +++ b/drivers/staging/rt2860/sta_ioctl.c @@ -40,7 +40,7 @@ #include "rt_config.h" #ifdef DBG -extern ULONG RTDebugLevel; +extern unsigned long RTDebugLevel; #endif #define NR_WEP_KEYS 4 @@ -49,16 +49,16 @@ extern ULONG RTDebugLevel; #define GROUP_KEY_NO 4 -extern UCHAR CipherWpa2Template[]; +extern u8 CipherWpa2Template[]; typedef struct PACKED _RT_VERSION_INFO { - UCHAR DriverVersionW; - UCHAR DriverVersionX; - UCHAR DriverVersionY; - UCHAR DriverVersionZ; - UINT DriverBuildYear; - UINT DriverBuildMonth; - UINT DriverBuildDay; + u8 DriverVersionW; + u8 DriverVersionX; + u8 DriverVersionY; + u8 DriverVersionZ; + u32 DriverBuildYear; + u32 DriverBuildMonth; + u32 DriverBuildDay; } RT_VERSION_INFO, *PRT_VERSION_INFO; static __s32 ralinkrate[] = { 2, 4, 11, 22, /* CCK */ @@ -73,13 +73,13 @@ static __s32 ralinkrate[] = { 2, 4, 11, 22, /* CCK */ 90, 180, 270, 360, 540, 720, 810, 900 }; -INT Set_SSID_Proc(IN PRTMP_ADAPTER pAdapter, IN PSTRING arg); +int Set_SSID_Proc(IN PRTMP_ADAPTER pAdapter, char *arg); -INT Set_NetworkType_Proc(IN PRTMP_ADAPTER pAdapter, IN PSTRING arg); +int Set_NetworkType_Proc(IN PRTMP_ADAPTER pAdapter, char *arg); -VOID RTMPAddKey(IN PRTMP_ADAPTER pAd, IN PNDIS_802_11_KEY pKey) +void RTMPAddKey(IN PRTMP_ADAPTER pAd, IN PNDIS_802_11_KEY pKey) { - ULONG KeyIdx; + unsigned long KeyIdx; MAC_TABLE_ENTRY *pEntry; DBGPRINT(RT_DEBUG_TRACE, ("RTMPAddKey ------>\n")); @@ -260,8 +260,8 @@ VOID RTMPAddKey(IN PRTMP_ADAPTER pAd, IN PNDIS_802_11_KEY pKey) } } else /* dynamic WEP from wpa_supplicant */ { - UCHAR CipherAlg; - PUCHAR Key; + u8 CipherAlg; + u8 *Key; if (pKey->KeyLength == 32) goto end; @@ -279,7 +279,7 @@ VOID RTMPAddKey(IN PRTMP_ADAPTER pAd, IN PNDIS_802_11_KEY pKey) /* set key material and key length */ pEntry->PairwiseKey.KeyLen = - (UCHAR) pKey->KeyLength; + (u8)pKey->KeyLength; NdisMoveMemory(pEntry->PairwiseKey.Key, &pKey->KeyMaterial, pKey->KeyLength); @@ -295,7 +295,7 @@ VOID RTMPAddKey(IN PRTMP_ADAPTER pAd, IN PNDIS_802_11_KEY pKey) /* Add Pair-wise key to Asic */ AsicAddPairwiseKeyEntry(pAd, pEntry->Addr, - (UCHAR) pEntry-> + (u8)pEntry-> Aid, &pEntry-> PairwiseKey); @@ -310,11 +310,11 @@ VOID RTMPAddKey(IN PRTMP_ADAPTER pAd, IN PNDIS_802_11_KEY pKey) } } else { /* Default key for tx (shared key) */ - pAd->StaCfg.DefaultKeyId = (UCHAR) KeyIdx; + pAd->StaCfg.DefaultKeyId = (u8)KeyIdx; /* set key material and key length */ pAd->SharedKey[BSS0][KeyIdx].KeyLen = - (UCHAR) pKey->KeyLength; + (u8)pKey->KeyLength; NdisMoveMemory(pAd->SharedKey[BSS0][KeyIdx].Key, &pKey->KeyMaterial, pKey->KeyLength); @@ -408,8 +408,8 @@ int rt_ioctl_giwfreq(struct net_device *dev, struct iw_freq *freq, char *extra) { PRTMP_ADAPTER pAdapter = NULL; - UCHAR ch; - ULONG m = 2412000; + u8 ch; + unsigned long m = 2412000; GET_PAD_FROM_NET_DEV(pAdapter, dev); @@ -613,7 +613,7 @@ int rt_ioctl_siwap(struct net_device *dev, MlmeEnqueue(pAdapter, MLME_CNTL_STATE_MACHINE, OID_802_11_BSSID, - sizeof(NDIS_802_11_MAC_ADDRESS), (VOID *) & Bssid); + sizeof(NDIS_802_11_MAC_ADDRESS), (void *) & Bssid); DBGPRINT(RT_DEBUG_TRACE, ("IOCTL::SIOCSIWAP %02x:%02x:%02x:%02x:%02x:%02x\n", Bssid[0], @@ -728,7 +728,7 @@ int rt_ioctl_siwscan(struct net_device *dev, { PRTMP_ADAPTER pAdapter = NULL; - ULONG Now; + unsigned long Now; int Status = NDIS_STATUS_SUCCESS; GET_PAD_FROM_NET_DEV(pAdapter, dev); @@ -804,10 +804,10 @@ int rt_ioctl_giwscan(struct net_device *dev, { PRTMP_ADAPTER pAdapter = NULL; int i = 0; - PSTRING current_ev = extra, previous_ev = extra; - PSTRING end_buf; - PSTRING current_val; - STRING custom[MAX_CUSTOM_LEN] = { 0 }; + char *current_ev = extra, *previous_ev = extra; + char *end_buf; + char *current_val; + char custom[MAX_CUSTOM_LEN] = { 0 }; struct iw_event iwe; GET_PAD_FROM_NET_DEV(pAdapter, dev); @@ -945,7 +945,7 @@ int rt_ioctl_giwscan(struct net_device *dev, previous_ev = current_ev; current_ev = iwe_stream_add_point(info, current_ev, end_buf, &iwe, - (PSTRING) pAdapter->ScanTab. + (char *)pAdapter->ScanTab. BssEntry[i].Ssid); if (current_ev == previous_ev) return -E2BIG; @@ -1027,7 +1027,7 @@ int rt_ioctl_giwscan(struct net_device *dev, /*Bit Rate */ /*================================ */ if (pAdapter->ScanTab.BssEntry[i].SupRateLen) { - UCHAR tmpRate = + u8 tmpRate = pAdapter->ScanTab.BssEntry[i].SupRate[pAdapter-> ScanTab. BssEntry[i]. @@ -1062,8 +1062,8 @@ int rt_ioctl_giwscan(struct net_device *dev, pAdapter->ScanTab.BssEntry[i].HtCapability. MCSSet[1] ? 15 : 7; int rate_index = - 12 + ((UCHAR) capInfo.ChannelWidth * 24) + - ((UCHAR) shortGI * 48) + ((UCHAR) maxMCS); + 12 + ((u8)capInfo.ChannelWidth * 24) + + ((u8)shortGI * 48) + ((u8)maxMCS); if (rate_index < 0) rate_index = 0; if (rate_index > rate_count) @@ -1140,7 +1140,7 @@ int rt_ioctl_siwessid(struct net_device *dev, } if (data->flags) { - PSTRING pSsidString = NULL; + char *pSsidString = NULL; /* Includes null character. */ if (data->length > (IW_ESSID_MAX_SIZE + 1)) @@ -1231,8 +1231,8 @@ int rt_ioctl_giwnickn(struct net_device *dev, GET_PAD_FROM_NET_DEV(pAdapter, dev); - if (data->length > strlen((PSTRING) pAdapter->nickname) + 1) - data->length = strlen((PSTRING) pAdapter->nickname) + 1; + if (data->length > strlen((char *)pAdapter->nickname) + 1) + data->length = strlen((char *)pAdapter->nickname) + 1; if (data->length > 0) { memcpy(nickname, pAdapter->nickname, data->length - 1); nickname[data->length - 1] = '\0'; @@ -1506,9 +1506,9 @@ rt_ioctl_giwencode(struct net_device *dev, } -void getBaInfo(IN PRTMP_ADAPTER pAd, IN PSTRING pOutBuf) +void getBaInfo(IN PRTMP_ADAPTER pAd, char *pOutBuf) { - INT i, j; + int i, j; BA_ORI_ENTRY *pOriBAEntry; BA_REC_ENTRY *pRecBAEntry; @@ -1816,8 +1816,8 @@ int rt_ioctl_giwauth(struct net_device *dev, } void fnSetCipherKey(IN PRTMP_ADAPTER pAdapter, - IN INT keyIdx, - IN UCHAR CipherAlg, + int keyIdx, + u8 CipherAlg, IN BOOLEAN bGTK, IN struct iw_encode_ext *ext) { NdisZeroMemory(&pAdapter->SharedKey[BSS0][keyIdx], sizeof(CIPHER_KEY)); @@ -1881,7 +1881,7 @@ int rt_ioctl_siwencodeext(struct net_device *dev, AsicRemovePairwiseKeyEntry(pAdapter, BSS0, BSSID_WCID); pAdapter->SharedKey[BSS0][keyIdx].KeyLen = 0; pAdapter->SharedKey[BSS0][keyIdx].CipherAlg = CIPHER_NONE; - AsicRemoveSharedKeyEntry(pAdapter, 0, (UCHAR) keyIdx); + AsicRemoveSharedKeyEntry(pAdapter, 0, (u8)keyIdx); NdisZeroMemory(&pAdapter->SharedKey[BSS0][keyIdx], sizeof(CIPHER_KEY)); DBGPRINT(RT_DEBUG_TRACE, @@ -2019,7 +2019,7 @@ rt_ioctl_giwencodeext(struct net_device *dev, union iwreq_data *wrqu, char *extra) { PRTMP_ADAPTER pAd = NULL; - PCHAR pKey = NULL; + char *pKey = NULL; struct iw_point *encoding = &wrqu->encoding; struct iw_encode_ext *ext = (struct iw_encode_ext *)extra; int idx, max_key_len; @@ -2063,7 +2063,7 @@ rt_ioctl_giwencodeext(struct net_device *dev, return -E2BIG; else { ext->key_len = pAd->SharedKey[BSS0][idx].KeyLen; - pKey = (PCHAR) & (pAd->SharedKey[BSS0][idx].Key[0]); + pKey = (char *)& (pAd->SharedKey[BSS0][idx].Key[0]); } break; case Ndis802_11Encryption2Enabled: @@ -2077,7 +2077,7 @@ rt_ioctl_giwencodeext(struct net_device *dev, return -E2BIG; else { ext->key_len = 32; - pKey = (PCHAR) & pAd->StaCfg.PMK[0]; + pKey = (char *)& pAd->StaCfg.PMK[0]; } break; default: @@ -2140,7 +2140,7 @@ int rt_ioctl_giwgenie(struct net_device *dev, wrqu->data.length = pAd->StaCfg.RSNIE_Len; memcpy(extra, &pAd->StaCfg.RSN_IE[0], pAd->StaCfg.RSNIE_Len); } else { - UCHAR RSNIe = IE_WPA; + u8 RSNIe = IE_WPA; if (wrqu->data.length < (pAd->StaCfg.RSNIE_Len + 2)) /* ID, Len */ return -E2BIG; @@ -2165,7 +2165,7 @@ int rt_ioctl_siwpmksa(struct net_device *dev, { PRTMP_ADAPTER pAd = NULL; struct iw_pmksa *pPmksa = (struct iw_pmksa *)wrqu->data.pointer; - INT CachedIdx = 0, idx = 0; + int CachedIdx = 0, idx = 0; GET_PAD_FROM_NET_DEV(pAd, dev); @@ -2268,7 +2268,7 @@ int rt_ioctl_siwrate(struct net_device *dev, union iwreq_data *wrqu, char *extra) { PRTMP_ADAPTER pAd = NULL; - UINT32 rate = wrqu->bitrate.value, fixed = wrqu->bitrate.fixed; + u32 rate = wrqu->bitrate.value, fixed = wrqu->bitrate.fixed; GET_PAD_FROM_NET_DEV(pAd, dev); @@ -2359,15 +2359,15 @@ int rt_ioctl_giwrate(struct net_device *dev, pAd->MacTab.Content[BSSID_WCID].HTPhyMode.word; if (ht_setting.field.MODE >= MODE_HTMIX) { -/* rate_index = 12 + ((UCHAR)ht_setting.field.BW *16) + ((UCHAR)ht_setting.field.ShortGI *32) + ((UCHAR)ht_setting.field.MCS); */ +/* rate_index = 12 + ((u8)ht_setting.field.BW *16) + ((u8)ht_setting.field.ShortGI *32) + ((u8)ht_setting.field.MCS); */ rate_index = - 12 + ((UCHAR) ht_setting.field.BW * 24) + - ((UCHAR) ht_setting.field.ShortGI * 48) + - ((UCHAR) ht_setting.field.MCS); + 12 + ((u8)ht_setting.field.BW * 24) + + ((u8)ht_setting.field.ShortGI * 48) + + ((u8)ht_setting.field.MCS); } else if (ht_setting.field.MODE == MODE_OFDM) - rate_index = (UCHAR) (ht_setting.field.MCS) + 4; + rate_index = (u8)(ht_setting.field.MCS) + 4; else if (ht_setting.field.MODE == MODE_CCK) - rate_index = (UCHAR) (ht_setting.field.MCS); + rate_index = (u8)(ht_setting.field.MCS); if (rate_index < 0) rate_index = 0; @@ -2447,14 +2447,14 @@ const struct iw_handler_def rt28xx_iw_handler_def = { #endif }; -INT rt28xx_sta_ioctl(IN struct net_device *net_dev, - IN OUT struct ifreq *rq, IN INT cmd) +int rt28xx_sta_ioctl(IN struct net_device *net_dev, + IN OUT struct ifreq *rq, int cmd) { POS_COOKIE pObj; RTMP_ADAPTER *pAd = NULL; struct iwreq *wrq = (struct iwreq *)rq; BOOLEAN StateMachineTouched = FALSE; - INT Status = NDIS_STATUS_SUCCESS; + int Status = NDIS_STATUS_SUCCESS; GET_PAD_FROM_NET_DEV(pAd, net_dev); @@ -2522,7 +2522,7 @@ INT rt28xx_sta_ioctl(IN struct net_device *net_dev, { struct iw_point *erq = NULL; erq = &wrq->u.data; - erq->length = strlen((PSTRING) pAd->nickname); + erq->length = strlen((char *)pAd->nickname); Status = copy_to_user(erq->pointer, pAd->nickname, erq->length); @@ -2639,7 +2639,7 @@ INT rt28xx_sta_ioctl(IN struct net_device *net_dev, TRUE if all parameters are OK, FALSE otherwise ========================================================================== */ -INT Set_SSID_Proc(IN PRTMP_ADAPTER pAdapter, IN PSTRING arg) +int Set_SSID_Proc(IN PRTMP_ADAPTER pAdapter, char *arg) { NDIS_802_11_SSID Ssid, *pSsid = NULL; BOOLEAN StateMachineTouched = FALSE; @@ -2669,18 +2669,18 @@ INT Set_SSID_Proc(IN PRTMP_ADAPTER pAdapter, IN PSTRING arg) if ((pAdapter->StaCfg.WpaPassPhraseLen >= 8) && (pAdapter->StaCfg.WpaPassPhraseLen <= 64)) { - STRING passphrase_str[65] = { 0 }; - UCHAR keyMaterial[40]; + char passphrase_str[65] = { 0 }; + u8 keyMaterial[40]; RTMPMoveMemory(passphrase_str, pAdapter->StaCfg.WpaPassPhrase, pAdapter->StaCfg.WpaPassPhraseLen); RTMPZeroMemory(pAdapter->StaCfg.PMK, 32); if (pAdapter->StaCfg.WpaPassPhraseLen == 64) { - AtoH((PSTRING) pAdapter->StaCfg.WpaPassPhrase, + AtoH((char *)pAdapter->StaCfg.WpaPassPhrase, pAdapter->StaCfg.PMK, 32); } else { - PasswordHash((PSTRING) pAdapter->StaCfg. + PasswordHash((char *)pAdapter->StaCfg. WpaPassPhrase, Ssid.Ssid, Ssid.SsidLength, keyMaterial); NdisMoveMemory(pAdapter->StaCfg.PMK, @@ -2695,7 +2695,7 @@ INT Set_SSID_Proc(IN PRTMP_ADAPTER pAdapter, IN PSTRING arg) MlmeEnqueue(pAdapter, MLME_CNTL_STATE_MACHINE, OID_802_11_SSID, - sizeof(NDIS_802_11_SSID), (VOID *) pSsid); + sizeof(NDIS_802_11_SSID), (void *) pSsid); StateMachineTouched = TRUE; DBGPRINT(RT_DEBUG_TRACE, @@ -2718,9 +2718,9 @@ INT Set_SSID_Proc(IN PRTMP_ADAPTER pAdapter, IN PSTRING arg) TRUE if all parameters are OK, FALSE otherwise ========================================================================== */ -INT Set_NetworkType_Proc(IN PRTMP_ADAPTER pAdapter, IN PSTRING arg) +int Set_NetworkType_Proc(IN PRTMP_ADAPTER pAdapter, char *arg) { - UINT32 Value = 0; + u32 Value = 0; if (strcmp(arg, "Adhoc") == 0) { if (pAdapter->StaCfg.BssType != BSS_ADHOC) { @@ -2789,7 +2789,7 @@ INT Set_NetworkType_Proc(IN PRTMP_ADAPTER pAdapter, IN PSTRING arg) DBGPRINT(RT_DEBUG_TRACE, ("===>Set_NetworkType_Proc::(INFRA)\n")); } else if (strcmp(arg, "Monitor") == 0) { - UCHAR bbpValue = 0; + u8 bbpValue = 0; BCN_TIME_CFG_STRUC csr; OPSTATUS_CLEAR_FLAG(pAdapter, fOP_STATUS_INFRA_ON); OPSTATUS_CLEAR_FLAG(pAdapter, fOP_STATUS_ADHOC_ON); diff --git a/drivers/staging/rt2860/usb_main_dev.c b/drivers/staging/rt2860/usb_main_dev.c index 74529d1..4e387d5 100644 --- a/drivers/staging/rt2860/usb_main_dev.c +++ b/drivers/staging/rt2860/usb_main_dev.c @@ -143,7 +143,7 @@ struct usb_device_id rtusb_usb_id[] = { {} /* Terminating entry */ }; -INT const rtusb_usb_id_len = +int const rtusb_usb_id_len = sizeof(rtusb_usb_id) / sizeof(struct usb_device_id); MODULE_DEVICE_TABLE(usb, rtusb_usb_id); @@ -185,7 +185,7 @@ BOOLEAN RT28XXChipsetCheck(IN void *_dev_p) { struct usb_interface *intf = (struct usb_interface *)_dev_p; struct usb_device *dev_p = interface_to_usbdev(intf); - UINT32 i; + u32 i; for (i = 0; i < rtusb_usb_id_len; i++) { if (dev_p->descriptor.idVendor == rtusb_usb_id[i].idVendor && @@ -225,8 +225,8 @@ static BOOLEAN USBDevConfigInit(IN struct usb_device *dev, IN RTMP_ADAPTER * pAd) { struct usb_host_interface *iface_desc; - ULONG BulkOutIdx; - UINT32 i; + unsigned long BulkOutIdx; + u32 i; /* get the active interface descriptor */ iface_desc = intf->cur_altsetting; @@ -338,7 +338,7 @@ resume:rt2870_resume, #ifdef CONFIG_PM -VOID RT2870RejectPendingPackets(IN PRTMP_ADAPTER pAd) +void RT2870RejectPendingPackets(IN PRTMP_ADAPTER pAd) { /* clear PS packets */ /* clear TxSw packets */ @@ -382,14 +382,14 @@ static int rt2870_resume(struct usb_interface *intf) #endif /* CONFIG_PM // */ /* Init driver module */ -INT __init rtusb_init(void) +int __init rtusb_init(void) { printk("rtusb init --->\n"); return usb_register(&rtusb_driver); } /* Deinit driver module */ -VOID __exit rtusb_exit(void) +void __exit rtusb_exit(void) { usb_deregister(&rtusb_driver); printk("<--- rtusb exit\n"); @@ -416,7 +416,7 @@ Return Value: Note: ======================================================================== */ -INT MlmeThread(IN void *Context) +int MlmeThread(IN void *Context) { RTMP_ADAPTER *pAd; RTMP_OS_TASK *pTask; @@ -485,7 +485,7 @@ Return Value: Note: ======================================================================== */ -INT RTUSBCmdThread(IN void *Context) +int RTUSBCmdThread(IN void *Context) { RTMP_ADAPTER *pAd; RTMP_OS_TASK *pTask; @@ -533,13 +533,13 @@ INT RTUSBCmdThread(IN void *Context) if (pCmdQElmt->buffer != NULL) os_free_mem(pAd, pCmdQElmt->buffer); - os_free_mem(pAd, (PUCHAR) pCmdQElmt); + os_free_mem(pAd, (u8 *)pCmdQElmt); } else { if ((pCmdQElmt->buffer != NULL) && (pCmdQElmt->bufferlength != 0)) os_free_mem(pAd, pCmdQElmt->buffer); - os_free_mem(pAd, (PUCHAR) pCmdQElmt); + os_free_mem(pAd, (u8 *)pCmdQElmt); } } } @@ -570,15 +570,15 @@ INT RTUSBCmdThread(IN void *Context) } -VOID RTUSBWatchDog(IN RTMP_ADAPTER * pAd) +void RTUSBWatchDog(IN RTMP_ADAPTER * pAd) { PHT_TX_CONTEXT pHTTXContext; int idx; - ULONG irqFlags; + unsigned long irqFlags; PURB pUrb; BOOLEAN needDumpSeq = FALSE; - UINT32 MACValue; - UINT32 TxRxQ_Pcnt; + u32 MACValue; + u32 TxRxQ_Pcnt; idx = 0; RTMP_IO_READ32(pAd, TXRXQ_PCNT, &MACValue); @@ -621,7 +621,7 @@ VOID RTUSBWatchDog(IN RTMP_ADAPTER * pAd) RTMP_IRQ_LOCK(&pAd->BulkOutLock[idx], irqFlags); if ((pAd->BulkOutPending[idx] == TRUE) && pAd->watchDogTxPendingCnt) { - INT actual_length = 0, transfer_buffer_length = 0; + int actual_length = 0, transfer_buffer_length = 0; BOOLEAN isDataPacket = FALSE; pAd->watchDogTxPendingCnt[idx]++; @@ -723,9 +723,9 @@ VOID RTUSBWatchDog(IN RTMP_ADAPTER * pAd) /* For Sigma debug, dump the ba_reordering sequence. */ if ((needDumpSeq == TRUE) && (pAd->CommonCfg.bDisableReordering == 0)) { - USHORT Idx; + u16 Idx; PBA_REC_ENTRY pBAEntry = NULL; - UCHAR count = 0; + u8 count = 0; struct reordering_mpdu *mpdu_blk; Idx = pAd->MacTab.Content[BSSID_WCID].BARecWcidArray[0]; @@ -809,8 +809,8 @@ static int __devinit rt2870_probe(IN struct usb_interface *intf, { struct net_device *net_dev = NULL; RTMP_ADAPTER *pAd = (RTMP_ADAPTER *) NULL; - INT status, rv; - PVOID handle; + int status, rv; + void *handle; RTMP_OS_NETDEV_OP_HOOK netDevHook; DBGPRINT(RT_DEBUG_TRACE, ("===>rt2870_probe()!\n")); diff --git a/drivers/staging/rt2860/wpa.h b/drivers/staging/rt2860/wpa.h index 5f998c7..05254c8 100644 --- a/drivers/staging/rt2860/wpa.h +++ b/drivers/staging/rt2860/wpa.h @@ -158,18 +158,18 @@ #ifndef ROUND_UP #define ROUND_UP(__x, __y) \ - (((ULONG)((__x)+((__y)-1))) & ((ULONG)~((__y)-1))) + (((unsigned long)((__x)+((__y)-1))) & ((unsigned long)~((__y)-1))) #endif -#define SET_UINT16_TO_ARRARY(_V, _LEN) \ +#define SET_u16_TO_ARRARY(_V, _LEN) \ { \ _V[0] = (_LEN & 0xFF00) >> 8; \ _V[1] = (_LEN & 0xFF); \ } -#define INC_UINT16_TO_ARRARY(_V, _LEN) \ +#define INC_u16_TO_ARRARY(_V, _LEN) \ { \ - UINT16 var_len; \ + u16 var_len; \ \ var_len = (_V[0]<<8) | (_V[1]); \ var_len += _LEN; \ @@ -178,11 +178,11 @@ _V[1] = (var_len & 0xFF); \ } -#define CONV_ARRARY_TO_UINT16(_V) ((_V[0]<<8) | (_V[1])) +#define CONV_ARRARY_TO_u16(_V) ((_V[0]<<8) | (_V[1])) #define ADD_ONE_To_64BIT_VAR(_V) \ { \ - UCHAR cnt = LEN_KEY_DESC_REPLAY; \ + u8 cnt = LEN_KEY_DESC_REPLAY; \ do \ { \ cnt--; \ @@ -196,105 +196,105 @@ /* EAPOL Key Information definition within Key descriptor format */ typedef struct PACKED _KEY_INFO { - UCHAR KeyMic:1; - UCHAR Secure:1; - UCHAR Error:1; - UCHAR Request:1; - UCHAR EKD_DL:1; /* EKD for AP; DL for STA */ - UCHAR Rsvd:3; - UCHAR KeyDescVer:3; - UCHAR KeyType:1; - UCHAR KeyIndex:2; - UCHAR Install:1; - UCHAR KeyAck:1; + u8 KeyMic:1; + u8 Secure:1; + u8 Error:1; + u8 Request:1; + u8 EKD_DL:1; /* EKD for AP; DL for STA */ + u8 Rsvd:3; + u8 KeyDescVer:3; + u8 KeyType:1; + u8 KeyIndex:2; + u8 Install:1; + u8 KeyAck:1; } KEY_INFO, *PKEY_INFO; /* EAPOL Key descriptor format */ typedef struct PACKED _KEY_DESCRIPTER { - UCHAR Type; + u8 Type; KEY_INFO KeyInfo; - UCHAR KeyLength[2]; - UCHAR ReplayCounter[LEN_KEY_DESC_REPLAY]; - UCHAR KeyNonce[LEN_KEY_DESC_NONCE]; - UCHAR KeyIv[LEN_KEY_DESC_IV]; - UCHAR KeyRsc[LEN_KEY_DESC_RSC]; - UCHAR KeyId[LEN_KEY_DESC_ID]; - UCHAR KeyMic[LEN_KEY_DESC_MIC]; - UCHAR KeyDataLen[2]; - UCHAR KeyData[MAX_LEN_OF_RSNIE]; + u8 KeyLength[2]; + u8 ReplayCounter[LEN_KEY_DESC_REPLAY]; + u8 KeyNonce[LEN_KEY_DESC_NONCE]; + u8 KeyIv[LEN_KEY_DESC_IV]; + u8 KeyRsc[LEN_KEY_DESC_RSC]; + u8 KeyId[LEN_KEY_DESC_ID]; + u8 KeyMic[LEN_KEY_DESC_MIC]; + u8 KeyDataLen[2]; + u8 KeyData[MAX_LEN_OF_RSNIE]; } KEY_DESCRIPTER, *PKEY_DESCRIPTER; typedef struct PACKED _EAPOL_PACKET { - UCHAR ProVer; - UCHAR ProType; - UCHAR Body_Len[2]; + u8 ProVer; + u8 ProType; + u8 Body_Len[2]; KEY_DESCRIPTER KeyDesc; } EAPOL_PACKET, *PEAPOL_PACKET; /*802.11i D10 page 83 */ typedef struct PACKED _GTK_ENCAP { - UCHAR Kid:2; - UCHAR tx:1; - UCHAR rsv:5; - UCHAR rsv1; - UCHAR GTK[TKIP_GTK_LENGTH]; + u8 Kid:2; + u8 tx:1; + u8 rsv:5; + u8 rsv1; + u8 GTK[TKIP_GTK_LENGTH]; } GTK_ENCAP, *PGTK_ENCAP; typedef struct PACKED _KDE_ENCAP { - UCHAR Type; - UCHAR Len; - UCHAR OUI[3]; - UCHAR DataType; + u8 Type; + u8 Len; + u8 OUI[3]; + u8 DataType; GTK_ENCAP GTKEncap; } KDE_ENCAP, *PKDE_ENCAP; /* For WPA1 */ typedef struct PACKED _RSNIE { - UCHAR oui[4]; - USHORT version; - UCHAR mcast[4]; - USHORT ucount; + u8 oui[4]; + u16 version; + u8 mcast[4]; + u16 ucount; struct PACKED { - UCHAR oui[4]; + u8 oui[4]; } ucast[1]; } RSNIE, *PRSNIE; /* For WPA2 */ typedef struct PACKED _RSNIE2 { - USHORT version; - UCHAR mcast[4]; - USHORT ucount; + u16 version; + u8 mcast[4]; + u16 ucount; struct PACKED { - UCHAR oui[4]; + u8 oui[4]; } ucast[1]; } RSNIE2, *PRSNIE2; /* AKM Suite */ typedef struct PACKED _RSNIE_AUTH { - USHORT acount; + u16 acount; struct PACKED { - UCHAR oui[4]; + u8 oui[4]; } auth[1]; } RSNIE_AUTH, *PRSNIE_AUTH; typedef union PACKED _RSN_CAPABILITIES { struct PACKED { - USHORT PreAuth:1; - USHORT No_Pairwise:1; - USHORT PTKSA_R_Counter:2; - USHORT GTKSA_R_Counter:2; - USHORT Rsvd:10; + u16 PreAuth:1; + u16 No_Pairwise:1; + u16 PTKSA_R_Counter:2; + u16 GTKSA_R_Counter:2; + u16 Rsvd:10; } field; - USHORT word; + u16 word; } RSN_CAPABILITIES, *PRSN_CAPABILITIES; typedef struct PACKED _EAP_HDR { - UCHAR ProVer; - UCHAR ProType; - UCHAR Body_Len[2]; - UCHAR code; - UCHAR identifier; - UCHAR length[2]; /* including code and identifier, followed by length-2 octets of data */ + u8 ProVer; + u8 ProType; + u8 Body_Len[2]; + u8 code; + u8 identifier; + u8 length[2]; /* including code and identifier, followed by length-2 octets of data */ } EAP_HDR, *PEAP_HDR; /* For supplicant state machine states. 802.11i Draft 4.1, p. 97 */ @@ -339,55 +339,55 @@ typedef enum _WpaMixPairCipher { } WPA_MIX_PAIR_CIPHER; typedef struct PACKED _RSN_IE_HEADER_STRUCT { - UCHAR Eid; - UCHAR Length; - USHORT Version; /* Little endian format */ + u8 Eid; + u8 Length; + u16 Version; /* Little endian format */ } RSN_IE_HEADER_STRUCT, *PRSN_IE_HEADER_STRUCT; /* Cipher suite selector types */ typedef struct PACKED _CIPHER_SUITE_STRUCT { - UCHAR Oui[3]; - UCHAR Type; + u8 Oui[3]; + u8 Type; } CIPHER_SUITE_STRUCT, *PCIPHER_SUITE_STRUCT; /* Authentication and Key Management suite selector */ typedef struct PACKED _AKM_SUITE_STRUCT { - UCHAR Oui[3]; - UCHAR Type; + u8 Oui[3]; + u8 Type; } AKM_SUITE_STRUCT, *PAKM_SUITE_STRUCT; /* RSN capability */ typedef struct PACKED _RSN_CAPABILITY { - USHORT Rsv:10; - USHORT GTKSAReplayCnt:2; - USHORT PTKSAReplayCnt:2; - USHORT NoPairwise:1; - USHORT PreAuth:1; + u16 Rsv:10; + u16 GTKSAReplayCnt:2; + u16 PTKSAReplayCnt:2; + u16 NoPairwise:1; + u16 PreAuth:1; } RSN_CAPABILITY, *PRSN_CAPABILITY; /*======================================== The prototype is defined in cmm_wpa.c ========================================*/ -BOOLEAN WpaMsgTypeSubst(IN UCHAR EAPType, OUT INT * MsgType); +BOOLEAN WpaMsgTypeSubst(u8 EAPType, int * MsgType); -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 PasswordHash(char *password, unsigned char *ssid, int ssidlength, unsigned char *output); -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); -VOID WpaShowAllsuite(IN PUINT8 rsnie, IN UINT rsnie_len); +void WpaShowAllsuite(u8 *rsnie, u32 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); #endif |