Remove typedefs from rtmp_type.h.
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
#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__ */
//
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;
//
//
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 ----------------- */
/* ----------------- 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) \
#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)
// 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) \
// 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)); \
// 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))); \
#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;
/* */
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;
/* */
/* */
typedef struct _MGMT_STRUC {
BOOLEAN Valid;
- PUCHAR pBuffer;
- ULONG Length;
+ u8 *pBuffer;
+ unsigned long Length;
} MGMT_STRUC, *PMGMT_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;
/* 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. */
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)); \
}\
}
#ifdef RT30xx
extern REG_PAIR RT30xx_RFRegTable[];
-extern UCHAR NUM_RF_REG_PARMS;
+extern u8 NUM_RF_REG_PARMS;
#endif /* RT30xx // */
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;
/* */
/* */
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;
/* ================================================================================= */
#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;
/* */
#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 */
#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;
/* */
#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;
/* */
#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;
/* */
#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
#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;
/* */
#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 */
/* */
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;
/* */
/* */
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 */
/* */
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 */
/* */
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
/* */
/* */
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) */
#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 */
/* */
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 */
/* */
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) */
#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
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;
/*======================================================= */
/*======================================================= */
#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 */
/* */
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 */
/* */
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;
/* */
/* */
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 /* */
/* */
/* */
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 /* */
/* */
/* */
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 /* */
/* */
/* */
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 /* */
/* */
/* */
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 */
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;
/* ================================================================================= */
/* ================================================================================= */
/*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;
/* ================================================================================= */
/* */
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;
/* */
/* */
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;
/* */
/* */
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;
/* */
/* */
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;
/* */
/* */
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;
/* */
/* */
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;
/* */
/* */
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;
/* */
/* */
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;
/* */
/* */
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;
/* */
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); \
if ((BbpCsr.field.Busy == IDLE) && \
(BbpCsr.field.RegNum == _bbpID)) \
{ \
- *(_pV) = (UCHAR)BbpCsr.field.Value; \
+ *(_pV) = (u8)BbpCsr.field.Value; \
break; \
} \
} \
if ((BbpCsr.field.Busy == IDLE) && \
(BbpCsr.field.RegNum == _I)) \
{ \
- *(_pV) = (UCHAR)BbpCsr.field.Value; \
+ *(_pV) = (u8)BbpCsr.field.Value; \
break; \
} \
} \
if ((BbpCsr.field.Busy == IDLE) && \
(BbpCsr.field.RegNum == _I)) \
{ \
- *(_pV) = (UCHAR)BbpCsr.field.Value; \
+ *(_pV) = (u8)BbpCsr.field.Value; \
break; \
} \
} \
#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) \
{ \
#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*/ \
#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*/ \
#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++) {
}
} 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);
#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);
}
/* 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);
,
};
-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) ||
========================================================================
*/
-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;
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
==========================================================================
*/
-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);
==========================================================================
*/
-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))
==========================================================================
*/
-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))
/* 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 */
#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[];
(_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__ */
#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);
/*
==========================================================================
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[])
{
(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;
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);
==========================================================================
*/
-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;
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,
}
}
-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:
}
}
-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;
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 */
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;
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;
}
}
-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++) {
}
}
-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;
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;
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);
#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;
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);
#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 */
{
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;
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;
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);
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;
/*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))) //|| */
* 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)
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;
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;
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);
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) {
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;
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;
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;
}
}
-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;
}
}
-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;
}
}
-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) {
&& (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);
BATableFreeRecEntry(pAd, Idx);
}
-VOID BASessionTearDownALL(IN OUT PRTMP_ADAPTER pAd, IN UCHAR Wcid)
+void BASessionTearDownALL(IN OUT PRTMP_ADAPTER pAd, u8 Wcid)
{
int i;
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;
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",
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;
}
}
-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,
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)) {
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);
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; */
}
}
-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__));
}
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
/*
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) {
#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 */
} \
} 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))) {
==========================================================================
*/
-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)) {
/* 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);
/* 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) {
#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;
/******** 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,
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
};
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]);
}
}
-VOID shift_row(IN PUCHAR in, OUT PUCHAR out)
+void shift_row(u8 *in, u8 *out)
{
out[0] = in[0];
out[1] = in[5];
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)
}
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);
if (a4_exists)
HeaderLen += 6;
- KeyID = *((PUCHAR) (pData + HeaderLen + 3));
+ KeyID = *((u8 *)(pData + HeaderLen + 3));
KeyID = KeyID >> 6;
if (pWpaKey[KeyID].KeyLen == 0) {
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);
========================================================================
*/
-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,
/* 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[] = {
/**************************************************/
,
};
-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;
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 */
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;
==========================================================================
*/
-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 */
/* 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)));
}
#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)));
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"));
==========================================================================
*/
-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)
{
}
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
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,
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 */
==========================================================================
*/
-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);
}
in INFRA BSS, we should use AsicSleepThenAutoWakeup() instead.
==========================================================================
*/
-VOID AsicForceSleep(IN PRTMP_ADAPTER pAd)
+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);
==========================================================================
*/
-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 */
==========================================================================
*/
-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;
==========================================================================
*/
-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;
==========================================================================
*/
-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;
==========================================================================
*/
-VOID AsicDisableSync(IN PRTMP_ADAPTER pAd)
+void AsicDisableSync(IN PRTMP_ADAPTER pAd)
{
BCN_TIME_CFG_STRUC csr;
==========================================================================
*/
-VOID AsicEnableBssSync(IN PRTMP_ADAPTER pAd)
+void AsicEnableBssSync(IN PRTMP_ADAPTER pAd)
{
BCN_TIME_CFG_STRUC csr;
==========================================================================
*/
-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",
#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);
/* 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);
#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;
/* 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;
==========================================================================
*/
-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;
==========================================================================
*/
-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;
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,
}
/* 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,
}
-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. */
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);
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);
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); */
}
#endif /* RTMP_MAC_PCI // */
#ifdef RTMP_MAC_USB
- UINT32 tmpVal;
+ u32 tmpVal;
/* */
/* Write IV */
/* 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,
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 */
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);
}
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);
}
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)
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. */
#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;
}
}
-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
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);
}
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",
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;
}
-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);
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?? */
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)) {
#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 */
"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 };
========================================================================
*/
-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;
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) {
========================================================================
*/
-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)
}
-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);
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 */
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);
}
(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;
========================================================================
*/
-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;
}
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;
========================================================================
*/
-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 */
{
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 */
Duration = 20 + 6; /* 16+4 preamble+plcp + Signal Extension */
}
- return (USHORT) Duration;
+ return (u16)Duration;
}
/*
========================================================================
*/
-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;
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);
/* 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];
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;
/* 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 */
========================================================================
*/
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)) {
========================================================================
*/
-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; */
========================================================================
*/
-VOID RTMPSuspendMsduTransmission(IN PRTMP_ADAPTER pAd)
+void RTMPSuspendMsduTransmission(IN PRTMP_ADAPTER pAd)
{
DBGPRINT(RT_DEBUG_TRACE, ("SCANNING, suspend MSDU transmission ...\n"));
========================================================================
*/
-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"));
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;
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);
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);
}
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)
AsicRemovePairwiseKeyEntry(pAd,
pEntry->
apidx,
- (UCHAR) i);
+ (u8)i);
#endif /* RTMP_MAC_PCI // */
}
}
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;
==========================================================================
*/
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;
the power-saving queues are freed here.
==========================================================================
*/
-VOID MacTableReset(IN PRTMP_ADAPTER pAd)
+void MacTableReset(IN PRTMP_ADAPTER pAd)
{
int i;
==========================================================================
*/
-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 */
==========================================================================
*/
-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;
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);
/* */
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);
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. */
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. */
}
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);
}
-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;
}
/* 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 */
#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 */
}
/* 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)) {
}
}
-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);
{
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 */
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 {
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);
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;
}
#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);
*/
#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);
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);
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);
/* */
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);
}
-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;
}
-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;
}
-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);
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;
========================================================================
*/
-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)
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);
========================================================================
*/
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;
========================================================================
*/
-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);
========================================================================
*/
-VOID RTMPHandleTBTTInterrupt(IN PRTMP_ADAPTER pAd)
+void RTMPHandleTBTTInterrupt(IN PRTMP_ADAPTER pAd)
{
{
if (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_DOZE)) {
========================================================================
*/
-VOID RTMPHandlePreTBTTInterrupt(IN PRTMP_ADAPTER pAd)
+void RTMPHandlePreTBTTInterrupt(IN PRTMP_ADAPTER pAd)
{
{
if (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_DOZE)) {
}
-VOID RTMPHandleRxCoherentInterrupt(IN PRTMP_ADAPTER pAd)
+void RTMPHandleRxCoherentInterrupt(IN PRTMP_ADAPTER pAd)
{
WPDMA_GLO_CFG_STRUC GloCfg;
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;
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);
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);
}
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)
) {
========================================================================
*/
-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. */
=>
=>
*/
-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)
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. */
}
-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;
/* */
}
}
- 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]);
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) {
}
-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() */
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) >
}
-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 */
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);
}
-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];
|| ((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]);
/* */
}
-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. */
}
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);
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;
/* 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. */
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);
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],
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];
========================================================================
*/
-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);
/* 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)
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;
}
}
-VOID RT28xxUsbStaAsicForceWakeup(IN PRTMP_ADAPTER pAd, IN BOOLEAN bFromTx)
+void RT28xxUsbStaAsicForceWakeup(IN PRTMP_ADAPTER pAd, IN BOOLEAN bFromTx)
{
BOOLEAN Canceled;
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. */
========================================================================
*/
-VOID RTMPSetDesiredRates(IN PRTMP_ADAPTER pAdapter, IN LONG Rates)
+void RTMPSetDesiredRates(IN PRTMP_ADAPTER pAdapter, long Rates)
{
NDIS_802_11_RATES aryRates;
========================================================================
*/
-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",
========================================================================
*/
-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 */
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",
========================================================================
*/
-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",
/* 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",
========================================================================
*/
-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 {
{
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)
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)
========================================================================
*/
-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)
{
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;
{
{
Note:
==========================================================================
*/
-PSTRING GetEncryptType(CHAR enc)
+char *GetEncryptType(char enc)
{
if (enc == Ndis802_11WEPDisabled)
return "NONE";
return "UNKNOW";
}
-PSTRING GetAuthMode(CHAR auth)
+char *GetAuthMode(char auth)
{
if (auth == Ndis802_11AuthModeOpen)
return "OPEN";
return "UNKNOW";
}
-INT SetCommonHT(IN PRTMP_ADAPTER pAd)
+int SetCommonHT(IN PRTMP_ADAPTER pAd)
{
OID_SET_HT_PHYMODE SetHT;
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:
========================================================================
*/
-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;
/* 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) */
/* 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,
/* 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;
/* 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;
========================================================================
*/
-VOID RTMPRingCleanUp(IN PRTMP_ADAPTER pAd, IN UCHAR RingType)
+void RTMPRingCleanUp(IN PRTMP_ADAPTER pAd, u8 RingType)
{
PTXD_STRUC pTxD;
PRXD_STRUC pRxD;
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,
}
}
-VOID RTMPFreeTxRxRingMemory(IN PRTMP_ADAPTER pAd)
+void RTMPFreeTxRxRingMemory(IN PRTMP_ADAPTER pAd)
{
int index, num, j;
PRTMP_TX_RING pTxRing;
Note:
========================================================================
*/
-VOID RT28XXDMADisable(IN RTMP_ADAPTER * pAd)
+void RT28XXDMADisable(IN RTMP_ADAPTER * pAd)
{
WPDMA_GLO_CFG_STRUC GloCfg;
Note:
========================================================================
*/
-VOID RT28XXDMAEnable(IN RTMP_ADAPTER * pAd)
+void RT28XXDMAEnable(IN RTMP_ADAPTER * pAd)
{
WPDMA_GLO_CFG_STRUC GloCfg;
int i = 0;
}
-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 {
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,
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,
}
-VOID RT28xxPciStaAsicForceWakeup(IN PRTMP_ADAPTER pAd, IN BOOLEAN bFromTx)
+void RT28xxPciStaAsicForceWakeup(IN PRTMP_ADAPTER pAd, IN BOOLEAN bFromTx)
{
AUTO_WAKEUP_STRUC AutoWakeupCfg;
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;
}
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);
}
-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;
#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;
==========================================================================
*/
-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;
==========================================================================
*/
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,
return TRUE;
}
-VOID RT28xxPciMlmeRadioOn(IN PRTMP_ADAPTER pAd)
+void RT28xxPciMlmeRadioOn(IN PRTMP_ADAPTER pAd)
{
if (!RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_RADIO_OFF))
return;
}
}
-VOID RT28xxPciMlmeRadioOFF(IN PRTMP_ADAPTER pAd)
+void RT28xxPciMlmeRadioOFF(IN PRTMP_ADAPTER pAd)
{
BOOLEAN brc = TRUE;
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"));
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); \
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;
/* 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"));
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));
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"));
Note:
========================================================================
*/
-VOID RTMPFreeTxRxRingMemory(IN PRTMP_ADAPTER pAd)
+void RTMPFreeTxRxRingMemory(IN PRTMP_ADAPTER pAd)
{
#define LM_URB_FREE(pObj, Context, BufferSize) \
if (NULL != Context->pUrb) { \
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;
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 */
Note:
========================================================================
*/
-VOID RT28XXDMADisable(IN RTMP_ADAPTER * pAd)
+void RT28XXDMADisable(IN RTMP_ADAPTER * pAd)
{
/* no use */
}
Note:
========================================================================
*/
-VOID RT28XXDMAEnable(IN RTMP_ADAPTER * pAd)
+void RT28XXDMAEnable(IN RTMP_ADAPTER * pAd)
{
WPDMA_GLO_CFG_STRUC GloCfg;
USB_DMA_CFG_STRUC UsbCfg;
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"));
(~(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)));
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) {
}
-VOID RTUSBBssBeaconStop(IN RTMP_ADAPTER * pAd)
+void RTUSBBssBeaconStop(IN RTMP_ADAPTER * pAd)
{
BEACON_SYNC_STRUCT *pBeaconSync;
int i, offset;
pBeaconSync = pAd->CommonCfg.pBeaconSync;
if (pBeaconSync && pBeaconSync->EnableBeacon) {
- INT NumOfBcn;
+ int NumOfBcn;
{
NumOfBcn = MAX_MESH_NUM;
}
}
-VOID RTUSBBssBeaconStart(IN RTMP_ADAPTER * pAd)
+void RTUSBBssBeaconStart(IN RTMP_ADAPTER * pAd)
{
int apidx;
BEACON_SYNC_STRUCT *pBeaconSync;
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);
}
}
-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) {
}
}
-VOID RTUSBBssBeaconExit(IN RTMP_ADAPTER * pAd)
+void RTUSBBssBeaconExit(IN RTMP_ADAPTER * pAd)
{
BEACON_SYNC_STRUCT *pBeaconSync;
BOOLEAN Cancelled = TRUE;
========================================================================
*/
-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) {
* 2870 Radio on/off Related functions.
*
********************************************************************/
-VOID RT28xxUsbMlmeRadioOn(IN PRTMP_ADAPTER pAd)
+void RT28xxUsbMlmeRadioOn(IN PRTMP_ADAPTER pAd)
{
RTMP_CHIP_OP *pChipOps = &pAd->chipOps;
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"));
*/
#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[];
/*
==========================================================================
==========================================================================
*/
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;
==========================================================================
*/
-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;
}
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;
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);
}
BOOLEAN PeerAddBARspActionSanity(IN PRTMP_ADAPTER pAd,
- IN VOID * pMsg, IN ULONG MsgLen)
+ void * pMsg, unsigned long MsgLen)
{
PFRAME_ADDBA_RSP pAddFrame;
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);
}
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;
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)
==========================================================================
*/
-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;
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);
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);
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);
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);
}
}
} 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 */
(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 */
case IE_ERP:
if (pEid->Len == 1) {
- *pErp = (UCHAR) pEid->Octet[0];
+ *pErp = (u8)pEid->Octet[0];
}
break;
/* 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);
}
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;
==========================================================================
*/
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;
}
/* IRQL = DISPATCH_LEVEL */
-UCHAR ChannelSanity(IN PRTMP_ADAPTER pAd, IN UCHAR channel)
+u8 ChannelSanity(IN PRTMP_ADAPTER pAd, u8 channel)
{
int i;
==========================================================================
*/
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;
==========================================================================
*/
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;
==========================================================================
*/
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;
==========================================================================
*/
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;
==========================================================================
*/
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;
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;
*/
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)
{
/* 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
}
/* 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,
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);
}
/* 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);
/* 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));
}
} 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 {
/* 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)) {
#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 };
/*
==========================================================================
==========================================================================
*/
-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));
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 */
}
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++) {
==========================================================================
*/
-UCHAR FirstChannel(IN PRTMP_ADAPTER pAd)
+u8 FirstChannel(IN PRTMP_ADAPTER pAd)
{
return pAd->ChannelList[0].Channel;
}
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) {
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. */
}
-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)
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))
&& (INFRA_ON(pAd))) {
NStatus =
MlmeAllocateMemory(pAd,
- (PVOID) & pOutBuffer);
+ (void *)& pOutBuffer);
if (NStatus == NDIS_STATUS_SUCCESS) {
pHdr80211 = (PHEADER_802_11) pOutBuffer;
MgtMacHeaderInit(pAd, pHdr80211,
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,
}
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 =
}
}
-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));
( ((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,
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,
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
========================================================================
*/
-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);
========================================================================
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:
========================================================================
*/
-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;
}
}
========================================================================
*/
-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);
========================================================================
*/
-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));
========================================================================
*/
-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) {
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);
========================================================================
*/
-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;
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;
========================================================================
*/
-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);
/* 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);
}
/*
========================================================================
*/
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);
/* 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);
========================================================================
*/
-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);
/* 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);
return (left ^ right);
}
-UINT rotr1(UINT a)
+u32 rotr1(u32 a)
{
unsigned int b;
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);
/* 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++) {
/* 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);
if (a4_exists)
HeaderLen += 6;
- KeyID = *((PUCHAR) (pData + HeaderLen + 3));
+ KeyID = *((u8 *)(pData + HeaderLen + 3));
KeyID = KeyID >> 6;
if (pWpaKey[KeyID].KeyLen == 0) {
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));
}
}
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);
#include "../rt_config.h"
-UINT FCSTAB_32[256] = {
+u32 FCSTAB_32[256] = {
0x00000000, 0x77073096, 0xee0e612c, 0x990951ba,
0x076dc419, 0x706af48f, 0xe963a535, 0x9e6495a3,
0x0edb8832, 0x79dcb8a4, 0xe0d5e91e, 0x97d2d988,
};
/*
-UCHAR WEPKEY[] = {
+u8 WEPKEY[] = {
//IV
0x00, 0x11, 0x22,
//WEP KEY
========================================================================
*/
-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 */
========================================================================
*/
-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);
========================================================================
*/
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 */
========================================================================
*/
-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++) {
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;
========================================================================
*/
-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);
========================================================================
*/
-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);
========================================================================
*/
-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);
Len the length of the data
Return Value:
- UINT - FCS 32 bits
+ u32 - FCS 32 bits
IRQL = DISPATCH_LEVEL
========================================================================
*/
-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]);
========================================================================
*/
-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);
}
*/
#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);
/*
==========================================================================
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,
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)
{
}
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;
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;
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);
/* 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,
========================================================================
*/
-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;
pEntry->
apidx);
- RTMP_SET_PACKET_WCID(pPacket, (UCHAR) pEntry->Aid);
+ RTMP_SET_PACKET_WCID(pPacket, (u8)pEntry->Aid);
RTMP_SET_PACKET_MOREDATA(pPacket, FALSE);
}
/* 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. */
==========================================================================
*/
-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"));
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) */
/* 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);
========================================================================
*/
-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"));
LEN_KEY_DESC_NONCE);
/* Generate random SNonce */
- GenRandom(pAd, (UCHAR *) pCurrentAddr, pEntry->SNonce);
+ GenRandom(pAd, (u8 *) pCurrentAddr, pEntry->SNonce);
{
/* Calculate PTK(ANonce, SNonce) */
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"));
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"));
{
/* 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);
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);
========================================================================
*/
-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"));
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"));
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"));
/* 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 */
==========================================================================
*/
-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"));
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);
========================================================================
*/
-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"));
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"));
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"));
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;
========================================================================
*/
-BOOLEAN WpaMsgTypeSubst(IN UCHAR EAPType, OUT INT * MsgType)
+BOOLEAN WpaMsgTypeSubst(u8 EAPType, int * MsgType)
{
switch (EAPType) {
case EAPPacket:
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"));
* 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;
========================================================================
*/
-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'
};
========================================================================
*/
-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 */
========================================================================
*/
-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;
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,
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,
========================================================================
*/
-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));
========================================================================
*/
-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;
========================================================================
*/
-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;
*/
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))
==========================================================================
*/
-PSTRING GetEapolMsgType(CHAR msg)
+char *GetEapolMsgType(char msg)
{
if (msg == EAPOL_PAIR_MSG_1)
return "Pairwise Message 1";
========================================================================
*/
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;
========================================================================
*/
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) {
========================================================================
*/
-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) ||
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)
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 */
{
((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)));
}
========================================================================
*/
-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;
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,
/*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 */
/* 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;
}
/* 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);
========================================================================
*/
-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"));
}
/* 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));
========================================================================
*/
-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)
}
-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;
/* 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",
} else if (pEid->Eid == IE_RSN) {
PRSNIE2 pRsnie = (PRSNIE2) pBuf;
- UINT16 ucount;
+ u16 ucount;
isWPA2 = TRUE;
}
-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);
}
-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);
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));
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));
#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 */
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));
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);
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;
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);
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]);
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;
#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
};
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));
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);
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;
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);
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]);
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;
========================================================================
*/
-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++) {
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;
/*
========================================================================
*/
-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);
NdisMoveMemory(pData, &data, Length);
}
- return (UCHAR) eFuseCtrlStruc.field.EFSROM_AOUT;
+ return (u8)eFuseCtrlStruc.field.EFSROM_AOUT;
}
========================================================================
*/
-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);
========================================================================
*/
-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) {
========================================================================
*/
-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;
}
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++) {
}
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);
int RtmpEfuseSupportCheck(IN RTMP_ADAPTER * pAd)
{
- USHORT value;
+ u16 value;
if (IS_RT30xx(pAd)) {
eFusePhysicalReadRegisters(pAd, EFUSE_TAG, 2, &value);
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"));
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;
}
("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,
#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);
}
/* 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);
}
/* 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);
}
/* 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);
}
/* 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);
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);
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);
/* 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 */
*/
#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;
/* 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,
/* 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,
#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,
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,
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,
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,
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,
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,
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,
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,
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,
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,
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,
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 */
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 */
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 */
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 */ ,
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,
==========================================================================
*/
-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"));
==========================================================================
*/
-VOID MlmeHandler(IN PRTMP_ADAPTER pAd)
+void MlmeHandler(IN PRTMP_ADAPTER pAd)
{
MLME_QUEUE_ELEM *Elem = NULL;
==========================================================================
*/
-VOID MlmeHalt(IN PRTMP_ADAPTER pAd)
+void MlmeHalt(IN PRTMP_ADAPTER pAd)
{
BOOLEAN Cancelled;
DBGPRINT(RT_DEBUG_TRACE, ("<== MlmeHalt\n"));
}
-VOID MlmeResetRalinkCounters(IN PRTMP_ADAPTER pAd)
+void MlmeResetRalinkCounters(IN PRTMP_ADAPTER pAd)
{
pAd->RalinkCounters.LastOneSecRxOkDataCnt =
pAd->RalinkCounters.OneSecRxOkDataCnt;
==========================================================================
*/
#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
&& (!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
/* 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))
IRQL = DISPATCH_LEVEL
==========================================================================
*/
-BOOLEAN MlmeValidateSSID(IN PUCHAR pSsid, IN UCHAR SsidLen)
+BOOLEAN MlmeValidateSSID(u8 *pSsid, u8 SsidLen)
{
int index;
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 */
} while (FALSE);
}
-VOID STAMlmePeriodicExec(PRTMP_ADAPTER pAd)
+void STAMlmePeriodicExec(PRTMP_ADAPTER pAd)
{
- ULONG TxTotalCnt;
+ unsigned long TxTotalCnt;
int i;
/*
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.
&& (MaxRssi <= dBmToRoam)) {
DBGPRINT(RT_DEBUG_TRACE,
("Rssi=%d, dBmToRoam=%d\n", MaxRssi,
- (CHAR) dBmToRoam));
+ (char)dBmToRoam));
/* Add auto seamless roaming */
if (rv == FALSE)
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);
pAd->MlmeAux.
AutoReconnectSsid));
ScanParmFill(pAd, &ScanReq,
- (PSTRING) pAd->MlmeAux.
+ (char *)pAd->MlmeAux.
AutoReconnectSsid,
pAd->MlmeAux.
AutoReconnectSsidLen,
}
/* 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;
}
/* 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) {
}
/* IRQL = DISPATCH_LEVEL */
-VOID MlmeAutoReconnectLastSSID(IN PRTMP_ADAPTER pAd)
+void MlmeAutoReconnectLastSSID(IN PRTMP_ADAPTER pAd)
{
if (pAd->StaCfg.bAutoConnectByBssid) {
DBGPRINT(RT_DEBUG_TRACE,
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;
*/
BOOLEAN MlmeCheckForFastRoaming(IN PRTMP_ADAPTER pAd)
{
- USHORT i;
+ u16 i;
BSS_TABLE *pRoamTab = &pAd->MlmeAux.RoamTab;
BSS_ENTRY *pBss;
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;
pEntry->HTPhyMode.field.MODE = MODE_HTGREENFIELD;
}
- pAd->LastTxRate = (USHORT) (pEntry->HTPhyMode.word);
+ pAd->LastTxRate = (u16)(pEntry->HTPhyMode.word);
}
/*
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;
*/
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;
/* (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]) {
}
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 */
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. */
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);
/* */
pEntry->LastTxOkCount = TxSuccess;
{
- UCHAR tmpTxRate;
+ u8 tmpTxRate;
/* to fix tcp ack issue */
if (!bTxRateChanged
========================================================================
*/
-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;
/* */
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)
}
do {
- ULONG OneSecTxNoRetryOKRationCount;
+ unsigned long OneSecTxNoRetryOKRationCount;
if (pAd->DrsCounters.LastTimeTxRateChangeAction == 0)
ratio = 5;
}
pAd->DrsCounters.PER[CurrRateIdx] =
- (UCHAR) TxErrorRatio;
+ (u8)TxErrorRatio;
OneSecTxNoRetryOKRationCount = (TxSuccess * ratio);
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;
}
==========================================================================
*/
-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 */
/* 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;
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;
}
/* 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;
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;
}
==========================================================================
*/
-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) */
/* 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);
/* 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;
}
==========================================================================
*/
-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;
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);
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);
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)));
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;
}
/* 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);
}
IRQL = DISPATCH_LEVEL
*/
-VOID BssTableInit(IN BSS_TABLE * Tab)
+void BssTableInit(IN BSS_TABLE * Tab)
{
int i;
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++) {
/* */
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++) {
/* */
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)) ||
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
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) &&
// IRQL = DISPATCH_LEVEL
========================================================================
*/
-VOID BATableDeleteORIEntry(IN OUT PRTMP_ADAPTER pAd,
+void BATableDeleteORIEntry(IN OUT PRTMP_ADAPTER pAd,
IN BA_ORI_ENTRY * pBAORIEntry)
{
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 */
{
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)) {
}
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);
}
}
}
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) {
}
/* 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++) {
}
/* 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++) {
}
}
-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;
/* */
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:
/* 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. */
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) {
}
/* 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) {
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 */
}
/* 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 */
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)
* \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);
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));
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 */
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);
IRQL = PASSIVE_LEVEL
*/
-NDIS_STATUS MlmeQueueInit(IN MLME_QUEUE * Queue)
+int MlmeQueueInit(IN MLME_QUEUE * Queue)
{
- INT i;
+ int i;
NdisAllocateSpinLock(&Queue->Lock);
*/
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. */
*/
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. */
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;
}
/* IRQL = DISPATCH_LEVEL */
-VOID MlmeRestartStateMachine(IN PRTMP_ADAPTER pAd)
+void MlmeRestartStateMachine(IN PRTMP_ADAPTER pAd)
{
#ifdef RTMP_MAC_PCI
MLME_QUEUE_ELEM *Elem = NULL;
IRQL = PASSIVE_LEVEL
*/
-VOID MlmeQueueDestroy(IN MLME_QUEUE * pQueue)
+void MlmeQueueDestroy(IN MLME_QUEUE * pQueue)
{
NdisAcquireSpinLock(&(pQueue->Lock));
pQueue->Num = 0;
*/
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));
}
}
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;
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;
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;
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]))
StateMachinePerformAction()
==========================================================================
*/
-VOID Drop(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
+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;
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) {
========================================================================
*/
-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;
}
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) {
========================================================================
*/
BOOLEAN RTMPCheckHt(IN PRTMP_ADAPTER pAd,
- IN UCHAR Wcid,
+ u8 Wcid,
IN HT_CAPABILITY_IE * pHtCapability,
IN ADD_HT_INFO_IE * pAddHtInfo)
{
========================================================================
*/
-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) {
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;
========================================================================
*/
-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 |
if (OPSTATUS_TEST_FLAG
(pAd, fOP_STATUS_MEDIA_STATE_CONNECTED)
) {
- ULONG TxTotalCnt =
+ unsigned long TxTotalCnt =
pAd->RalinkCounters.OneSecTxNoRetryOkCount +
pAd->RalinkCounters.OneSecTxRetryOkCount +
pAd->RalinkCounters.OneSecTxFailCount;
========================================================================
*/
-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 |
}
-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;
========================================================================
*/
-VOID RTMPSetPiggyBack(IN PRTMP_ADAPTER pAd, IN BOOLEAN bPiggyBack)
+void RTMPSetPiggyBack(IN PRTMP_ADAPTER pAd, IN BOOLEAN bPiggyBack)
{
TX_LINK_CFG_STRUC TxLinkCfg;
========================================================================
*/
-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;
}
========================================================================
*/
-VOID RTMPUpdateLegacyTxSetting(UCHAR fixed_tx_mode, PMAC_TABLE_ENTRY pEntry)
+void RTMPUpdateLegacyTxSetting(u8 fixed_tx_mode, PMAC_TABLE_ENTRY pEntry)
{
HTTRANSMIT_SETTING TransmitSetting;
==========================================================================
*/
-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)
}
}
-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
{
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);
}
, /* 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 */
,
};
-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;
return pChRegion;
}
-static VOID ChBandCheck(IN UCHAR PhyMode, OUT PUCHAR pChType)
+static void ChBandCheck(u8 PhyMode, u8 *pChType)
{
switch (PhyMode) {
case PHY_11A:
}
}
-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++) {
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;
}
}
-VOID BuildChannelListEx(IN PRTMP_ADAPTER pAd)
+void BuildChannelListEx(IN PRTMP_ADAPTER pAd)
{
PCH_REGION pChReg;
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);
}
}
-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)
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;
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)) {
}
} else {
do {
- UCHAR ExtCh;
- UCHAR Dir =
+ u8 ExtCh;
+ u8 Dir =
pAd->CommonCfg.RegTransmitSetting.field.
EXTCHA;
ExtCh = GetExtCh(Channel, Dir);
}
-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 ==
}
}
-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++) {
========================================================================
*/
-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);
========================================================================
*/
-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);
}
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;
}
}
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;
*/
#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" };
========================================================================
*/
-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"));
}
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;
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);
========================================================================
*/
-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;
/* */
========================================================================
*/
-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;
========================================================================
*/
-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;
}
========================================================================
*/
-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;
/* 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);
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 // */
/* */
/* 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,
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);
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. */
value &= 0x00ff;
if (value != 0xff) {
value &= 0x07;
- pAd->TxMixerGain24G = (UCHAR) value;
+ pAd->TxMixerGain24G = (u8)value;
}
}
#endif /* RT30xx // */
========================================================================
*/
-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);
}
}
#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;
/* 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,
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",
========================================================================
*/
-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"));
========================================================================
*/
-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"));
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);
}
}
#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); */
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;
}
#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);
}
}
========================================================================
*/
-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 */
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);
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)
}
/* PID store Tx MCS Rate */
- pid = (UCHAR) StaFifo.field.PidType;
+ pid = (u8)StaFifo.field.PidType;
pEntry = &pAd->MacTab.Content[wcid];
========================================================================
*/
-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;
========================================================================
*/
-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 */
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);
========================================================================
*/
-VOID NICEraseFirmware(IN PRTMP_ADAPTER pAd)
+void NICEraseFirmware(IN PRTMP_ADAPTER pAd)
{
if (pAd->chipOps.eraseFirmware)
pAd->chipOps.eraseFirmware(pAd);
========================================================================
*/
-NDIS_STATUS NICLoadRateSwitchingParams(IN PRTMP_ADAPTER pAd)
+int NICLoadRateSwitchingParams(IN PRTMP_ADAPTER pAd)
{
return NDIS_STATUS_SUCCESS;
}
========================================================================
*/
-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])
========================================================================
*/
-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;
========================================================================
*/
-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];
========================================================================
*/
-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"));
/* 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 */
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),
}
/* IRQL = PASSIVE_LEVEL */
-UCHAR BtoH(STRING ch)
+u8 BtoH(char ch)
{
if (ch >= '0' && ch <= '9')
return (ch - '0'); /* Handle numerals */
}
/* */
-/* FUNCTION: AtoH(char *, UCHAR *, int) */
+/* FUNCTION: AtoH(char *, u8 *, int) */
/* */
/* PURPOSE: Converts ascii string to network order hex */
/* */
/* */
/* 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. */
========================================================================
*/
-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. */
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);
}
/*
========================================================================
*/
-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;
========================================================================
*/
-VOID RTMPModTimer(IN PRALINK_TIMER_STRUCT pTimer, IN ULONG Value)
+void RTMPModTimer(IN PRALINK_TIMER_STRUCT pTimer, unsigned long Value)
{
BOOLEAN Cancel;
========================================================================
*/
-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)
========================================================================
*/
-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) {
> -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)
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"));
}
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
{
/*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 */
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));
/*---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;
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;
#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,
}
/* 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;
/* 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
========================================================================
*/
-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);
========================================================================
*/
-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 */
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 {
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 */
#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
if ((pTimer->handle != NULL)
&& (!pAd->PM_FlgSuspend))
pTimer->handle(NULL,
- (PVOID) pTimer->cookie,
+ (void *)pTimer->cookie,
NULL, pTimer);
if ((pTimer->Repeat)
&& (pTimer->State == FALSE))
}
}
-INT RtmpTimerQThread(IN OUT PVOID Context)
+int RtmpTimerQThread(IN void *Context)
{
RTMP_OS_TASK *pTask;
PRTMP_ADAPTER pAd;
#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},
&& (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;
return CurTxPwr;
}
-VOID MeasureReqTabInit(IN PRTMP_ADAPTER pAd)
+void MeasureReqTabInit(IN PRTMP_ADAPTER pAd)
{
NdisAllocateSpinLock(&pAd->CommonCfg.MeasureReqTabLock);
return;
}
-VOID MeasureReqTabExit(IN PRTMP_ADAPTER pAd)
+void MeasureReqTabExit(IN PRTMP_ADAPTER pAd)
{
NdisFreeSpinLock(&pAd->CommonCfg.MeasureReqTabLock);
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;
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,
MQ_REQ_AGE_OUT)))
{
PMEASURE_REQ_ENTRY pPrevEntry = NULL;
- ULONG HashIdx =
+ unsigned long HashIdx =
MQ_DIALOGTOKEN_HASH_INDEX(pEntry->
DialogToken);
PMEASURE_REQ_ENTRY pProbeEntry =
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;
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);
return;
}
-VOID TpcReqTabInit(IN PRTMP_ADAPTER pAd)
+void TpcReqTabInit(IN PRTMP_ADAPTER pAd)
{
NdisAllocateSpinLock(&pAd->CommonCfg.TpcReqTabLock);
return;
}
-VOID TpcReqTabExit(IN PRTMP_ADAPTER pAd)
+void TpcReqTabExit(IN PRTMP_ADAPTER pAd)
{
NdisFreeSpinLock(&pAd->CommonCfg.TpcReqTabLock);
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;
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,
TPC_REQ_AGE_OUT)))
{
PTPC_REQ_ENTRY pPrevEntry = NULL;
- ULONG HashIdx =
+ unsigned long HashIdx =
TPC_DIALOGTOKEN_HASH_INDEX(pEntry->
DialogToken);
PTPC_REQ_ENTRY pProbeEntry =
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;
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);
Return : Current Time Stamp.
==========================================================================
*/
-static UINT64 GetCurrentTimeStamp(IN PRTMP_ADAPTER pAd)
+static u64 GetCurrentTimeStamp(IN PRTMP_ADAPTER pAd)
{
/* get current time stamp. */
return 0;
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 */
}
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) {
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;
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);
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;
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;
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,
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;
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,
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;
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,
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;
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,
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;
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,
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;
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,
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. */
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;
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;
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,
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;
==========================================================================
*/
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);
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,
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 =
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;
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);
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,
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);
} 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);
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);
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;
==========================================================================
*/
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;
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;
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;
==========================================================================
*/
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;
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);
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;
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)) {
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;
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; */
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 */
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;
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;
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__));
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. */
break;
case 3: /* Measurement channel. */
- MeasureCh = (UINT8) simple_strtol(thisChar, 0, 16);
+ MeasureCh = (u8)simple_strtol(thisChar, 0, 16);
break;
}
ArgIdx++;
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);
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);
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)) {
#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__ */
#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__ */
#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__ */
Fonchi 03-12-2007 created
*/
-BOOLEAN RadarChannelCheck(IN PRTMP_ADAPTER pAd, IN UCHAR Ch);
+BOOLEAN RadarChannelCheck(IN PRTMP_ADAPTER pAd, u8 Ch);
* 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__ // */
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))
#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
#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) \
/* */
/* 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.. */
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. */
/* 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 */
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 {
/* 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;
/* 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;
/*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;
/* */
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;
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 */
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;
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;
} 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;
/* 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 */
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;
} 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 =============================== */
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;
#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;
} 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;
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;
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 {
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;
} 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,
#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 {
} 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;
} 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;
*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;
/* 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 {
/* 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 */
/* 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
} 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;
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
***************************************************************************/
#ifdef CONFIG_PM
-VOID RT2860RejectPendingPackets(IN PRTMP_ADAPTER pAd)
+void RT2860RejectPendingPackets(IN PRTMP_ADAPTER pAd)
{
/* clear PS packets */
/* clear TxSw packets */
{
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"));
{
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) */
}
#endif /* CONFIG_PM // */
-static INT __init rt2860_init_module(VOID)
+static int __init rt2860_init_module(void)
{
return pci_register_driver(&rt2860_driver);
}
/* */
/* Driver module unload function */
/* */
-static VOID __exit rt2860_cleanup_module(VOID)
+static void __exit rt2860_cleanup_module(void)
{
pci_unregister_driver(&rt2860_driver);
}
/* */
/* 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"));
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,
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 */
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============================================== */
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);
* 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;
(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);
}
}
-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;
("====> 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;
PCIePowerSaveLevel));
AsicSendCommandToMcu(pAd, 0x83, 0xff,
- (UCHAR) PCIePowerSaveLevel,
+ (u8)PCIePowerSaveLevel,
0x00);
}
DBGPRINT(RT_DEBUG_TRACE,
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);
/* 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));
&& (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 (!
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)
("====> rt30xxF LinkCtrlSetting = 0x%x.\n",
LinkCtrlSetting));
AsicSendCommandToMcu(pAd, 0x83, 0xff,
- (UCHAR) PCIePowerSaveLevel,
+ (u8)PCIePowerSaveLevel,
LinkCtrlSetting);
}
}
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);
}
}
-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;
========================================================================
*/
-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;
========================================================================
*/
-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;
========================================================================
*/
-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;
#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] = {
};
/* 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);
}
/* 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))
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)) {
}
-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);
}
/* 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
}
/* 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);
}
PNDIS_PACKET RTMP_AllocateFragPacketBuffer(IN PRTMP_ADAPTER pAd,
- IN ULONG Length)
+ unsigned long Length)
{
struct sk_buff *pkt;
}
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;
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;
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;
========================================================================
*/
-NDIS_STATUS RTMPCloneNdisPacket(IN PRTMP_ADAPTER pAd,
+int RTMPCloneNdisPacket(IN PRTMP_ADAPTER pAd,
IN BOOLEAN pInsAMSDUHdr,
IN PNDIS_PACKET pInPacket,
OUT PNDIS_PACKET * ppOutPacket)
}
/* 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);
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));
}
/* 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);
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;
}
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) {
}
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;
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;
/* 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;
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;
========================================================================
*/
-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;
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);
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,
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;
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)
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;
}
-INT RtmpOSTaskNotifyToExit(IN RTMP_OS_TASK * pTask)
+int RtmpOSTaskNotifyToExit(IN RTMP_OS_TASK * pTask)
{
#ifndef KTHREAD_SUPPORT
#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);
#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;
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);
}
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;
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;
*/
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;
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;
return NDIS_STATUS_FAILURE;
}
-PNET_DEV RtmpOSNetDevGetByName(PNET_DEV pNetDev, PSTRING pDevName)
+PNET_DEV RtmpOSNetDevGetByName(PNET_DEV pNetDev, char *pDevName)
{
PNET_DEV pTargetNetDev = NULL;
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 */
}
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;
#define IN
#define OUT
#define INOUT
-#define NDIS_STATUS INT
/***********************************************************************************
* OS Specific definitions and data structures
#define ONE_TICK 1
-static inline void NdisGetSystemUpTime(ULONG * time)
+static inline void NdisGetSystemUpTime(unsigned long * time)
{
*time = jiffies;
}
#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
#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;
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{ \
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)
{ \
if ((_A)->bPCIclkOff == FALSE) \
{ \
- UINT Val; \
+ u32 Val; \
Val = readl((void *)((_A)->CSRBaseAddress + MAC_CSR0)); \
writel((_V), (void *)((_A)->CSRBaseAddress + (_R))); \
} \
#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))); \
}
#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 // */
#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)
/*(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)
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);
/* 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");
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
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);
#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);
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, ®); */
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),
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);
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);
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));
**************************************************************************/
/* 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;
/* 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;
* 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);
}
* 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)
{
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;
RX_BUFFER_NORMSIZE - 1600, -1, PCI_DMA_FROMDEVICE);
}
-NDIS_STATUS RtmpNetTaskInit(IN RTMP_ADAPTER * pAd)
+int RtmpNetTaskInit(IN RTMP_ADAPTER * pAd)
{
POS_COOKIE pObj;
tasklet_kill(&pObj->fifo_statistic_full_task);
}
-NDIS_STATUS RtmpMgmtTaskInit(IN RTMP_ADAPTER * pAd)
+int RtmpMgmtTaskInit(IN RTMP_ADAPTER * pAd)
{
return NDIS_STATUS_SUCCESS;
Note:
========================================================================
*/
-VOID RtmpMgmtTaskExit(IN RTMP_ADAPTER * pAd)
+void RtmpMgmtTaskExit(IN RTMP_ADAPTER * pAd)
{
return;
return;
}
- /* enable RxINT again */
+ /* enable Rxint again */
rt2860_int_enable(pAd, INT_RX);
RTMP_INT_UNLOCK(&pAd->irq_lock, flags);
return;
}
- /* enable RxINT again */
+ /* enable Rxint again */
rt2860_int_enable(pAd, FifoStaFullInt);
RTMP_INT_UNLOCK(&pAd->irq_lock, flags);
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);
}
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.
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 */
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;
} else /* STATUS_OTHER */
{
- PUCHAR pBuf;
+ u8 *pBuf;
pAd->BulkOutCompleteOther++;
PRTMP_ADAPTER pAd;
PTX_CONTEXT pNullContext;
purbb_t pUrb;
- NTSTATUS Status;
+ int Status;
unsigned long irqFlag;
pUrb = (purbb_t) data;
PRTMP_ADAPTER pAd;
PTX_CONTEXT pRTSContext;
purbb_t pUrb;
- NTSTATUS Status;
+ int Status;
unsigned long irqFlag;
pUrb = (purbb_t) data;
PRTMP_ADAPTER pAd;
PTX_CONTEXT pPsPollContext;
purbb_t pUrb;
- NTSTATUS Status;
+ int Status;
pUrb = (purbb_t) data;
pPsPollContext = (PTX_CONTEXT) pUrb->context;
purbb_t pUrb;
PRX_CONTEXT pRxContext;
PRTMP_ADAPTER pAd;
- NTSTATUS Status;
+ int Status;
unsigned int IrqFlags;
pUrb = (purbb_t) data;
int index;
PNDIS_PACKET pPacket;
purbb_t pUrb;
- NTSTATUS Status;
+ int Status;
unsigned long IrqFlags;
pUrb = (purbb_t) data;
{
PRTMP_ADAPTER pAd;
PHT_TX_CONTEXT pHTTXContext;
- UCHAR BulkOutPipeId = 3;
+ u8 BulkOutPipeId = 3;
purbb_t pUrb;
pUrb = (purbb_t) data;
{
PRTMP_ADAPTER pAd;
PHT_TX_CONTEXT pHTTXContext;
- UCHAR BulkOutPipeId = 2;
+ u8 BulkOutPipeId = 2;
purbb_t pUrb;
pUrb = (purbb_t) data;
{
PRTMP_ADAPTER pAd;
PHT_TX_CONTEXT pHTTXContext;
- UCHAR BulkOutPipeId = 1;
+ u8 BulkOutPipeId = 1;
purbb_t pUrb;
pUrb = (purbb_t) data;
{
PRTMP_ADAPTER pAd;
PHT_TX_CONTEXT pHTTXContext;
- UCHAR BulkOutPipeId = 0;
+ u8 BulkOutPipeId = 0;
purbb_t pUrb;
pUrb = (purbb_t) 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,
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;
/* */
typedef struct _QUEUE_HEADER {
PQUEUE_ENTRY Head;
PQUEUE_ENTRY Tail;
- ULONG Number;
+ unsigned long Number;
} QUEUE_HEADER, *PQUEUE_HEADER;
#define InitializeQueueHeader(QueueHeader) \
_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); \
}
/* */
/* */
/* 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) */
/* */
/* */
#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;
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 \
} \
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); \
} \
}
#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)))
/* */
/* 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;
/* 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;
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;
/* */
/* */
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;
} 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;
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
* 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;
#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 */
} ROGUEAP_ENTRY, *PROGUEAP_ENTRY;
typedef struct {
- UCHAR RogueApNr;
+ u8 RogueApNr;
ROGUEAP_ENTRY RogueApEntry[MAX_LEN_OF_BSS_TABLE];
} ROGUEAP_TABLE, *PROGUEAP_TABLE;
/* 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;
/*
*/
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;
/* 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;
/* 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;
**************************************************************************/
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_ {
/* 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 // */
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
};
struct reordering_mpdu_pool {
- PVOID mem;
+ void *mem;
NDIS_SPIN_LOCK lock;
struct reordering_list freelist;
};
} 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;
/*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;
/* 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
**************************************************************************/
#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 // */
/* 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;
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;
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. */
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;
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;
#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 */
/* 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 */
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 */
/* 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. */
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;
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. */
#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;
/* 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;
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 */
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 */
};
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;
/* 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 */
#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 */
/*======Semaphores (event) */
RTMP_OS_SEM UsbVendorReq_semaphore;
- PVOID UsbVendorReqBuf;
+ void *UsbVendorReqBuf;
wait_queue_head_t *wait;
#endif /* RTMP_MAC_USB // */
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 */
#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. */
/* 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;
/* ----------------------------------------------- */
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 */
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 */
/*--- */
/* --------------------------- */
/* 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;
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;
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 // */
};
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)
/* 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 */
/* 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. */
/***************************************************************************
* 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;
/* */
/* 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 */
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);
/* */
/* 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 */
/* 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);
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 */
/*======================================== */
-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);
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);
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 \
{ \
_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);
/* 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;
/* 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.
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);
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);
/* */
/* 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);
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);
#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) {
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)
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);
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);
/*
* 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 */
/* */
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;
/* */
/* */
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;
/* */
/* */
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__ // */
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__ */
#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 */
/*#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
/* 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
#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 */
#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
#define IFS_BACKOFF 3
/* pTxD->RetryMode */
-#define LONG_RETRY 1
+#define long_RETRY 1
#define SHORT_RETRY 0
/* Country Region definition */
/* ========================= 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" */
/* 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))
#define A2Dec(_X, _p) \
{ \
- UCHAR *p; \
+ u8 *p; \
_X = 0; \
p = _p; \
while (((*p >= '0') && (*p <= '9'))) \
/* 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__ // */
} 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_ {
#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__ // */
/* 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 {
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;
{ \
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); \
}
#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
/*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) \
#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);
/*
==========================================================================
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);
/*
==========================================================================
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);
/*
==========================================================================
Return : None.
==========================================================================
*/
-VOID EnqueueTPCReq(IN PRTMP_ADAPTER pAd, IN PUCHAR pDA, IN UCHAR DialogToken);
+void EnqueueTPCReq(IN PRTMP_ADAPTER pAd, u8 *pDA, u8 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);
/*
==========================================================================
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);
/*
==========================================================================
Return : None.
==========================================================================
*/
-VOID PeerSpectrumAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem);
+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__ // */
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;
#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__ // */
*/
#include "../rt_config.h"
-UCHAR CipherWpaTemplate[] = {
+u8 CipherWpaTemplate[] = {
0xdd, /* WPA IE */
0x16, /* Length */
0x00, 0x50, 0xf2, 0x01, /* oui */
0x00, 0x50, 0xf2, 0x01 /* authentication */
};
-UCHAR CipherWpa2Template[] = {
+u8 CipherWpa2Template[] = {
0x30, /* RSN IE */
0x14, /* Length */
0x01, 0x00, /* Version */
0x00, 0x00, /* RSN capability */
};
-UCHAR Ccx2IeInfo[] = { 0x00, 0x40, 0x96, 0x03, 0x02 };
+u8 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,
==========================================================================
*/
-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;
==========================================================================
*/
-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;
==========================================================================
*/
-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;
==========================================================================
*/
-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) {
/* 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,
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,
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,
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,
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); */
(pAd->StaCfg.AuthMode == Ndis802_11AuthModeWPA2)
)
) {
- UCHAR RSNIe = IE_WPA;
+ u8 RSNIe = IE_WPA;
if ((pAd->StaCfg.AuthMode == Ndis802_11AuthModeWPA2PSK)
|| (pAd->StaCfg.AuthMode ==
/* 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++) {
}
if (FoundPMK) {
/* Set PMK number */
- *(PUSHORT) & pAd->StaCfg.RSN_IE[pAd->
+ *(u16 *)& pAd->StaCfg.RSN_IE[pAd->
StaCfg.
RSNIE_Len]
= 1;
==========================================================================
*/
-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) {
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,
/* 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,
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,
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,
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,
==========================================================================
*/
-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);
==========================================================================
*/
-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,
&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++) {
==========================================================================
*/
-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,
==========================================================================
*/
-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);
/* 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;
==========================================================================
*/
-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)) {
==========================================================================
*/
-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;
==========================================================================
*/
-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;
==========================================================================
*/
-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;
&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));
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));
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));
==========================================================================
*/
-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)
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);
/* 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,
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
/* 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);
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);
}
==========================================================================
*/
-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;
==========================================================================
*/
-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;
==========================================================================
*/
-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",
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;
==========================================================================
*/
-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
==========================================================================
*/
-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;
==========================================================================
*/
-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;
==========================================================================
*/
-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));
==========================================================================
*/
-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)
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) {
==========================================================================
*/
-VOID AuthRspStateMachineInit(IN PRTMP_ADAPTER pAd,
+void AuthRspStateMachineInit(IN PRTMP_ADAPTER pAd,
IN PSTATE_MACHINE Sm,
IN STATE_MACHINE_FUNC Trans[])
{
==========================================================================
*/
-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"));
==========================================================================
*/
-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)
*/
#include "../rt_config.h"
-UCHAR CipherSuiteWpaNoneTkip[] = {
+u8 CipherSuiteWpaNoneTkip[] = {
0x00, 0x50, 0xf2, 0x01, /* oui */
0x01, 0x00, /* Version */
0x00, 0x50, 0xf2, 0x02, /* Multicast */
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 */
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 */
==========================================================================
*/
-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 */
==========================================================================
*/
-VOID MlmeCntlMachinePerformAction(IN PRTMP_ADAPTER pAd,
+void MlmeCntlMachinePerformAction(IN PRTMP_ADAPTER pAd,
IN STATE_MACHINE * S,
IN MLME_QUEUE_ELEM * Elem)
{
/* 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) {
==========================================================================
*/
-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;
}
}
-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. */
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) {
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);
==========================================================================
*/
-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;
/* 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",
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,
==========================================================================
*/
-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;
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);
/* 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"));
==========================================================================
*/
-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;
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);
==========================================================================
*/
-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) {
==========================================================================
*/
-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: */
==========================================================================
*/
-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,
==========================================================================
*/
-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,
==========================================================================
*/
-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,
==========================================================================
*/
-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)
}
}
-VOID AdhocTurnOnQos(IN PRTMP_ADAPTER pAd)
+void AdhocTurnOnQos(IN PRTMP_ADAPTER pAd)
{
#define AC0_DEF_TXOP 0
#define AC1_DEF_TXOP 0
==========================================================================
*/
-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 */
/* 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;
/* 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);
(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;
/* Set asic auto fall back */
{
- PUCHAR pTable;
- UCHAR TableSize = 0;
+ u8 *pTable;
+ u8 TableSize = 0;
MlmeSelectTxRateTable(pAd, &pAd->MacTab.Content[BSSID_WCID],
&pTable, &TableSize,
/* 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
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);
&& ((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);
==========================================================================
*/
-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))
==========================================================================
*/
-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;
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);
/* 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;
==========================================================================
*/
-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;
}
==========================================================================
*/
-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;
==========================================================================
*/
-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);
==========================================================================
*/
-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;
==========================================================================
*/
#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;
}
/* 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;
}
#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;
(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],
}
/* IRQL = DISPATCH_LEVEL */
-VOID ComposeNullFrame(IN PRTMP_ADAPTER pAd)
+void ComposeNullFrame(IN PRTMP_ADAPTER pAd)
{
PTXINFO_STRUC pTxInfo;
PTXWI_STRUC pTxWI;
(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,
==========================================================================
*/
-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)) {
/* add ERP_IE and EXT_RAE IE of in 802.11g */
if (ExtRateLen) {
- ULONG tmp;
+ unsigned long tmp;
MakeOutgoingFrame(pBeaconFrame + FrameLen, &tmp,
3, LocalErpIe,
}
/* 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);
}
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);
*/
#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) */
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,
WepKey.keyinfo.KeyLength = len;
pAd->SharedKey[BSS0][idx].
KeyLen =
- (UCHAR) (len <= 5 ? 5 : 13);
+ (u8)(len <= 5 ? 5 : 13);
pAd->IndicateMediaState =
NdisMediaStateConnected;
}
-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 */
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];
/* 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;
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 */
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"));
/* 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;
}
}
- pRxBlk->pData = (UCHAR *) pHeader;
+ pRxBlk->pData = (u8 *) pHeader;
/* */
/* update RxBlk->pData, DataSize */
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)) {
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++;
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;
&& (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 */
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;
*/
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;
RxCell.pRxWI = pRxWI;
RxCell.pHeader = pHeader;
RxCell.pRxPacket = pRxPacket;
- RxCell.pData = (UCHAR *) pHeader;
+ RxCell.pData = (u8 *) pHeader;
RxCell.DataSize = pRxWI->MPDUtotalByteCount;
RxCell.Flags = 0;
========================================================================
*/
-VOID RTMPHandleTwakeupInterrupt(IN PRTMP_ADAPTER pAd)
+void RTMPHandleTwakeupInterrupt(IN PRTMP_ADAPTER pAd)
{
AsicForceWakeup(pAd, FALSE);
}
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
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;
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. */
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. */
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
&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 */
========================================================================
*/
#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:
("RTMPFreeTXDRequest::Invalid QueIdx(=%d)\n", QueIdx));
break;
}
- *FreeNumberIs = (UCHAR) FreeNumber;
+ *FreeNumberIs = (u8)FreeNumber;
return (Status);
}
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;
}
#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 */
}
/* 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)
{
}
/* 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);
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;
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;
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);
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 */
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;
}
-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);
/* */
/* @@@ 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;
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 {
/* */
/* @@@ 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);
{
[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;
}
}
-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;
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;
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);
{
EXTRA_LLCSNAP_ENCAP_FROM_PKT_START(pTxBlk->pSrcBufHeader,
pTxBlk->pExtraLlcSnapEncap);
if (pTxBlk->pExtraLlcSnapEncap) {
- UCHAR vlan_size;
+ u8 vlan_size;
NdisMoveMemory(pHeaderBufPtr,
pTxBlk->pExtraLlcSnapEncap, 6);
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;
}
-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;
/* 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 */
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;
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) +
========================================================================
*/
-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;
}
-ULONG HashBytesPolynomial(UCHAR * value, unsigned int len)
+unsigned long HashBytesPolynomial(u8 * value, unsigned int len)
{
unsigned char *word = value;
unsigned int ret = 0;
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);
*/
#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[];
/*
==========================================================================
==========================================================================
*/
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;
==========================================================================
*/
-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);
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;
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;
/* handle WME PARAMTER ELEMENT */
if (NdisEqualMemory(pEid->Octet, WME_PARM_ELEM, 6)
&& (pEid->Len == 24)) {
- PUCHAR ptr;
+ u8 *ptr;
int i;
/* parsing EDCA parameters */
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 */
}
Length = Length + 2 + pEid->Len;
- pEid = (PEID_STRUCT) ((UCHAR *) pEid + 2 + pEid->Len);
+ pEid = (PEID_STRUCT) ((u8 *) pEid + 2 + pEid->Len);
}
return TRUE;
==========================================================================
*/
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);
==========================================================================
*/
-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;
==========================================================================
*/
-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,
==========================================================================
*/
-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;
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);
==========================================================================
*/
-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;
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! */
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 */
/* */
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,
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,
END_OF_ARGS);
if (ExtRateLen) {
- ULONG Tmp;
+ unsigned long Tmp;
MakeOutgoingFrame(pOutBuffer + FrameLen, &Tmp,
1, &ExtRateIe,
1, &ExtRateLen,
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;
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);
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;
Elem->Channel,
Addr2,
Bssid,
- (PCHAR) Ssid,
+ (char *)Ssid,
&SsidLen,
&BssType,
&BeaconPeriod,
&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)
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,
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 */
Elem->Channel,
Addr2,
Bssid,
- (PCHAR) Ssid,
+ (char *)Ssid,
&SsidLen,
&BssType,
&BeaconPeriod,
Channel);
if (Idx == BSS_NOT_FOUND) {
- CHAR Rssi = 0;
+ char Rssi = 0;
Rssi =
RTMPMaxRssi(pAd,
ConvertToRssi(pAd,
Idx =
BssTableSetEntry(pAd, &pAd->ScanTab,
Bssid,
- (CHAR *) Ssid,
+ (char *) Ssid,
SsidLen, BssType,
BeaconPeriod, &Cf,
AtimWin,
==========================================================================
*/
-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)
))
&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));
/* 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 !=
}
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 */
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
/* 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 */
due to MaxSPLength.
*/
} else {
- USHORT NextDtim = DtimCount;
+ u16 NextDtim = DtimCount;
if (NextDtim == 0)
NextDtim = DtimPeriod;
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;
&pAd->StaActive.AtimWin, END_OF_ARGS);
if (pAd->StaActive.ExtRateLen) {
- ULONG tmp;
+ unsigned long tmp;
MakeOutgoingFrame(pOutBuffer + FrameLen, &tmp,
3, LocalErpIe,
1, &ExtRateIe,
}
/* 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,
}
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;
}
}
-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;
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);
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));
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));
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));
==========================================================================
*/
-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));
}
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"));
*/
#include "../rt_config.h"
-void inc_byte_array(UCHAR * counter, int len);
+void inc_byte_array(u8 * 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);
#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;
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 };
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"));
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);
/* 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"));
}
* 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) {
}
}
-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;
pAd->StaCfg.bBlockAssoc = TRUE;
}
-VOID WpaStaPairwiseKeySetting(IN PRTMP_ADAPTER pAd)
+void WpaStaPairwiseKeySetting(IN PRTMP_ADAPTER pAd)
{
PCIPHER_KEY pSharedKey;
PMAC_TABLE_ENTRY pEntry;
}
-VOID WpaStaGroupKeySetting(IN PRTMP_ADAPTER pAd)
+void WpaStaGroupKeySetting(IN PRTMP_ADAPTER pAd)
{
PCIPHER_KEY pSharedKey;
#include "rt_config.h"
#ifdef DBG
-extern ULONG RTDebugLevel;
+extern unsigned long RTDebugLevel;
#endif
#define NR_WEP_KEYS 4
#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 */
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"));
}
} else /* dynamic WEP from wpa_supplicant */
{
- UCHAR CipherAlg;
- PUCHAR Key;
+ u8 CipherAlg;
+ u8 *Key;
if (pKey->KeyLength == 32)
goto end;
/* set key material and key length */
pEntry->PairwiseKey.KeyLen =
- (UCHAR) pKey->KeyLength;
+ (u8)pKey->KeyLength;
NdisMoveMemory(pEntry->PairwiseKey.Key,
&pKey->KeyMaterial,
pKey->KeyLength);
/* Add Pair-wise key to Asic */
AsicAddPairwiseKeyEntry(pAd,
pEntry->Addr,
- (UCHAR) pEntry->
+ (u8)pEntry->
Aid,
&pEntry->
PairwiseKey);
}
} 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);
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);
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],
{
PRTMP_ADAPTER pAdapter = NULL;
- ULONG Now;
+ unsigned long Now;
int Status = NDIS_STATUS_SUCCESS;
GET_PAD_FROM_NET_DEV(pAdapter, 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);
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;
/*Bit Rate */
/*================================ */
if (pAdapter->ScanTab.BssEntry[i].SupRateLen) {
- UCHAR tmpRate =
+ u8 tmpRate =
pAdapter->ScanTab.BssEntry[i].SupRate[pAdapter->
ScanTab.
BssEntry[i].
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)
}
if (data->flags) {
- PSTRING pSsidString = NULL;
+ char *pSsidString = NULL;
/* Includes null character. */
if (data->length > (IW_ESSID_MAX_SIZE + 1))
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';
}
-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;
}
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));
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,
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;
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:
return -E2BIG;
else {
ext->key_len = 32;
- pKey = (PCHAR) & pAd->StaCfg.PMK[0];
+ pKey = (char *)& pAd->StaCfg.PMK[0];
}
break;
default:
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;
{
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);
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);
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;
#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);
{
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);
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;
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,
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,
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) {
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);
{} /* 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);
{
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 &&
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;
#ifdef CONFIG_PM
-VOID RT2870RejectPendingPackets(IN PRTMP_ADAPTER pAd)
+void RT2870RejectPendingPackets(IN PRTMP_ADAPTER pAd)
{
/* clear PS packets */
/* clear TxSw packets */
#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");
Note:
========================================================================
*/
-INT MlmeThread(IN void *Context)
+int MlmeThread(IN void *Context)
{
RTMP_ADAPTER *pAd;
RTMP_OS_TASK *pTask;
Note:
========================================================================
*/
-INT RTUSBCmdThread(IN void *Context)
+int RTUSBCmdThread(IN void *Context)
{
RTMP_ADAPTER *pAd;
RTMP_OS_TASK *pTask;
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);
}
}
}
}
-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);
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]++;
/* 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];
{
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"));
#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; \
_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--; \
/* 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 */
} 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
#include "../rt_config.h"
/* Match total 6 bulkout endpoint to corresponding queue. */
-UCHAR EpToQueue[6] =
+u8 EpToQueue[6] =
{ FIFO_EDCA, FIFO_EDCA, FIFO_EDCA, FIFO_EDCA, FIFO_EDCA, FIFO_MGMT };
/*static BOOLEAN SingleBulkOut = FALSE; */
}
-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)
{
PURB pUrb;
- PUCHAR pSrc = NULL;
+ u8 *pSrc = NULL;
POS_COOKIE pObj = (POS_COOKIE) pAd->OS_Cookie;
pUrb = pTxContext->pUrb;
pSrc = &pTxContext->TransferBuffer->Aggregation[2];
} else {
pSrc =
- (PUCHAR) pTxContext->TransferBuffer->field.WirelessPacket;
+ (u8 *)pTxContext->TransferBuffer->field.WirelessPacket;
}
/*Initialize a tx bulk urb */
}
-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)
{
PURB pUrb;
- PUCHAR pSrc = NULL;
+ u8 *pSrc = NULL;
POS_COOKIE pObj = (POS_COOKIE) pAd->OS_Cookie;
pUrb = pTxContext->pUrb;
}
-VOID RTUSBInitRxDesc(IN PRTMP_ADAPTER pAd, IN PRX_CONTEXT pRxContext)
+void RTUSBInitRxDesc(IN PRTMP_ADAPTER pAd, IN PRX_CONTEXT pRxContext)
{
PURB pUrb;
POS_COOKIE pObj = (POS_COOKIE) pAd->OS_Cookie;
- ULONG RX_bulk_size;
+ unsigned long RX_bulk_size;
pUrb = pRxContext->pUrb;
ASSERT(pUrb);
if(1 /*!(in_interrupt() & 0xffff0000)*/) \
RTMP_IRQ_UNLOCK((pLock), IrqFlags);
-VOID RTUSBBulkOutDataPacket(IN PRTMP_ADAPTER pAd,
- IN UCHAR BulkOutPipeId, IN UCHAR Index)
+void RTUSBBulkOutDataPacket(IN PRTMP_ADAPTER pAd,
+ u8 BulkOutPipeId, u8 Index)
{
PHT_TX_CONTEXT pHTTXContext;
int ret = 0;
PTXINFO_STRUC pTxInfo, pLastTxInfo = NULL;
PTXWI_STRUC pTxWI;
- ULONG TmpBulkEndPos, ThisBulkSize;
+ unsigned long TmpBulkEndPos, ThisBulkSize;
unsigned long IrqFlags = 0, IrqFlags2 = 0;
- PUCHAR pWirelessPkt, pAppendant;
+ u8 *pWirelessPkt, *pAppendant;
BOOLEAN bTxQLastRound = FALSE;
- UCHAR allzero[4] = { 0x0, 0x0, 0x0, 0x0 };
+ u8 allzero[4] = { 0x0, 0x0, 0x0, 0x0 };
BULK_OUT_LOCK(&pAd->BulkOutLock[BulkOutPipeId], IrqFlags);
if ((pAd->BulkOutPending[BulkOutPipeId] == TRUE)
pHTTXContext->ENextBulkOutPosition,
pHTTXContext->bCopySavePad));
hex_dump("Wrong QSel Pkt:",
- (PUCHAR) & pWirelessPkt[TmpBulkEndPos],
+ (u8 *)& pWirelessPkt[TmpBulkEndPos],
(pHTTXContext->CurWritePosition -
pHTTXContext->NextBulkOutPosition));
}
ENextBulkOutPosition], 8);
pHTTXContext->bCopySavePad = TRUE;
if (RTMPEqualMemory(pHTTXContext->SavedPad, allzero, 4)) {
- PUCHAR pBuf = &pHTTXContext->SavedPad[0];
+ u8 *pBuf = &pHTTXContext->SavedPad[0];
DBGPRINT_RAW(RT_DEBUG_ERROR,
("WARNING-Zero-3:%02x%02x%02x%02x%02x%02x%02x%02x,CWPos=%ld, CWRPos=%ld, bCW=%d, NBPos=%ld, TBPos=%ld, TBSize=%ld\n",
pBuf[0], pBuf[1], pBuf[2], pBuf[3],
}
-VOID RTUSBBulkOutDataPacketComplete(purbb_t pUrb, struct pt_regs * pt_regs)
+void RTUSBBulkOutDataPacketComplete(purbb_t pUrb, struct pt_regs * pt_regs)
{
PHT_TX_CONTEXT pHTTXContext;
PRTMP_ADAPTER pAd;
POS_COOKIE pObj;
- UCHAR BulkOutPipeId;
+ u8 BulkOutPipeId;
pHTTXContext = (PHT_TX_CONTEXT) pUrb->context;
pAd = pHTTXContext->pAd;
========================================================================
*/
-VOID RTUSBBulkOutNullFrame(IN PRTMP_ADAPTER pAd)
+void RTUSBBulkOutNullFrame(IN PRTMP_ADAPTER pAd)
{
PTX_CONTEXT pNullContext = &(pAd->NullContext);
PURB pUrb;
}
/* NULL frame use BulkOutPipeId = 0 */
-VOID RTUSBBulkOutNullFrameComplete(purbb_t pUrb, struct pt_regs * pt_regs)
+void RTUSBBulkOutNullFrameComplete(purbb_t pUrb, struct pt_regs * pt_regs)
{
PRTMP_ADAPTER pAd;
PTX_CONTEXT pNullContext;
- NTSTATUS Status;
+ int Status;
POS_COOKIE pObj;
pNullContext = (PTX_CONTEXT) pUrb->context;
========================================================================
*/
-VOID RTUSBBulkOutMLMEPacket(IN PRTMP_ADAPTER pAd, IN UCHAR Index)
+void RTUSBBulkOutMLMEPacket(IN PRTMP_ADAPTER pAd, u8 Index)
{
PTX_CONTEXT pMLMEContext;
PURB pUrb;
/* printk("<---RTUSBBulkOutMLMEPacket,Cpu=%d!, Dma=%d, SwIdx=%d!\n", pAd->MgmtRing.TxCpuIdx, pAd->MgmtRing.TxDmaIdx, pAd->MgmtRing.TxSwFreeIdx); */
}
-VOID RTUSBBulkOutMLMEPacketComplete(purbb_t pUrb, struct pt_regs * pt_regs)
+void RTUSBBulkOutMLMEPacketComplete(purbb_t pUrb, struct pt_regs * pt_regs)
{
PTX_CONTEXT pMLMEContext;
PRTMP_ADAPTER pAd;
- NTSTATUS Status;
+ int Status;
POS_COOKIE pObj;
int index;
========================================================================
*/
-VOID RTUSBBulkOutPsPoll(IN PRTMP_ADAPTER pAd)
+void RTUSBBulkOutPsPoll(IN PRTMP_ADAPTER pAd)
{
PTX_CONTEXT pPsPollContext = &(pAd->PsPollContext);
PURB pUrb;
}
/* PS-Poll frame use BulkOutPipeId = 0 */
-VOID RTUSBBulkOutPsPollComplete(purbb_t pUrb, struct pt_regs * pt_regs)
+void RTUSBBulkOutPsPollComplete(purbb_t pUrb, struct pt_regs * pt_regs)
{
PRTMP_ADAPTER pAd;
PTX_CONTEXT pPsPollContext;
- NTSTATUS Status;
+ int Status;
POS_COOKIE pObj;
pPsPollContext = (PTX_CONTEXT) pUrb->context;
tasklet_hi_schedule(&pObj->pspoll_frame_complete_task);
}
-VOID DoBulkIn(IN RTMP_ADAPTER * pAd)
+void DoBulkIn(IN RTMP_ADAPTER * pAd)
{
PRX_CONTEXT pRxContext;
PURB pUrb;
fRTMP_ADAPTER_RADIO_OFF | fRTMP_ADAPTER_RESET_IN_PROGRESS | \
fRTMP_ADAPTER_REMOVE_IN_PROGRESS)
-VOID RTUSBBulkReceive(IN PRTMP_ADAPTER pAd)
+void RTUSBBulkReceive(IN PRTMP_ADAPTER pAd)
{
PRX_CONTEXT pRxContext;
unsigned long IrqFlags;
Always returns STATUS_MORE_PROCESSING_REQUIRED
========================================================================
*/
-VOID RTUSBBulkRxComplete(purbb_t pUrb, struct pt_regs *pt_regs)
+void RTUSBBulkRxComplete(purbb_t pUrb, struct pt_regs *pt_regs)
{
/* use a receive tasklet to handle received packets; */
/* or sometimes hardware IRQ will be disabled here, so we can not */
========================================================================
*/
-VOID RTUSBKickBulkOut(IN PRTMP_ADAPTER pAd)
+void RTUSBKickBulkOut(IN PRTMP_ADAPTER pAd)
{
/* BulkIn Reset will reset whole USB PHY. So we need to make sure fRTMP_ADAPTER_BULKIN_RESET not flaged. */
if (!RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_NEED_STOP_TX)
========================================================================
*/
-VOID RTUSBCleanUpDataBulkOutQueue(IN PRTMP_ADAPTER pAd)
+void RTUSBCleanUpDataBulkOutQueue(IN PRTMP_ADAPTER pAd)
{
- UCHAR Idx;
+ u8 Idx;
PHT_TX_CONTEXT pTxContext;
DBGPRINT(RT_DEBUG_TRACE, ("--->CleanUpDataBulkOutQueue\n"));
========================================================================
*/
-VOID RTUSBCleanUpMLMEBulkOutQueue(IN PRTMP_ADAPTER pAd)
+void RTUSBCleanUpMLMEBulkOutQueue(IN PRTMP_ADAPTER pAd)
{
DBGPRINT(RT_DEBUG_TRACE, ("--->CleanUpMLMEBulkOutQueue\n"));
DBGPRINT(RT_DEBUG_TRACE, ("<---CleanUpMLMEBulkOutQueue\n"));
========================================================================
*/
-VOID RTUSBCancelPendingIRPs(IN PRTMP_ADAPTER pAd)
+void RTUSBCancelPendingIRPs(IN PRTMP_ADAPTER pAd)
{
RTUSBCancelPendingBulkInIRP(pAd);
RTUSBCancelPendingBulkOutIRP(pAd);
========================================================================
*/
-VOID RTUSBCancelPendingBulkInIRP(IN PRTMP_ADAPTER pAd)
+void RTUSBCancelPendingBulkInIRP(IN PRTMP_ADAPTER pAd)
{
PRX_CONTEXT pRxContext;
- UINT i;
+ u32 i;
DBGPRINT_RAW(RT_DEBUG_TRACE, ("--->RTUSBCancelPendingBulkInIRP\n"));
for (i = 0; i < (RX_RING_SIZE); i++) {
========================================================================
*/
-VOID RTUSBCancelPendingBulkOutIRP(IN PRTMP_ADAPTER pAd)
+void RTUSBCancelPendingBulkOutIRP(IN PRTMP_ADAPTER pAd)
{
PHT_TX_CONTEXT pHTTXContext;
PTX_CONTEXT pMLMEContext;
PTX_CONTEXT pNullContext;
PTX_CONTEXT pPsPollContext;
PTX_CONTEXT pRTSContext;
- UINT i, Idx;
+ u32 i, Idx;
/* unsigned int IrqFlags; */
/* NDIS_SPIN_LOCK *pLock; */
/* BOOLEAN *pPending; */
#include "../rt_config.h"
-extern UCHAR Phy11BGNextRateUpward[]; /* defined in mlme.c */
-extern UCHAR EpToQueue[];
+extern u8 Phy11BGNextRateUpward[]; /* defined in mlme.c */
+extern u8 EpToQueue[];
-VOID REPORT_AMSDU_FRAMES_TO_LLC(IN PRTMP_ADAPTER pAd,
- IN PUCHAR pData, IN ULONG DataSize)
+void REPORT_AMSDU_FRAMES_TO_LLC(IN PRTMP_ADAPTER pAd,
+ u8 *pData, unsigned long DataSize)
{
PNDIS_PACKET pPacket;
- UINT nMSDU;
+ u32 nMSDU;
struct sk_buff *pSkb;
nMSDU = 0;
========================================================================
*/
-NDIS_STATUS RTUSBFreeDescriptorRequest(IN PRTMP_ADAPTER pAd,
- IN UCHAR BulkOutPipeId,
- IN UINT32 NumberRequired)
+int RTUSBFreeDescriptorRequest(IN PRTMP_ADAPTER pAd,
+ u8 BulkOutPipeId,
+ u32 NumberRequired)
{
-/* UCHAR FreeNumber = 0; */
-/* UINT Index; */
- NDIS_STATUS Status = NDIS_STATUS_FAILURE;
+/* u8 FreeNumber = 0; */
+/* u32 Index; */
+ int Status = NDIS_STATUS_FAILURE;
unsigned long IrqFlags;
HT_TX_CONTEXT *pHTTXContext;
return (Status);
}
-NDIS_STATUS RTUSBFreeDescriptorRelease(IN RTMP_ADAPTER * pAd,
- IN UCHAR BulkOutPipeId)
+int RTUSBFreeDescriptorRelease(IN RTMP_ADAPTER * pAd,
+ u8 BulkOutPipeId)
{
unsigned long IrqFlags;
HT_TX_CONTEXT *pHTTXContext;
return (NDIS_STATUS_SUCCESS);
}
-BOOLEAN RTUSBNeedQueueBackForAgg(IN RTMP_ADAPTER * pAd, IN UCHAR BulkOutPipeId)
+BOOLEAN RTUSBNeedQueueBackForAgg(IN RTMP_ADAPTER * pAd, u8 BulkOutPipeId)
{
unsigned long IrqFlags;
HT_TX_CONTEXT *pHTTXContext;
========================================================================
*/
-VOID RTUSBRejectPendingPackets(IN PRTMP_ADAPTER pAd)
+void RTUSBRejectPendingPackets(IN PRTMP_ADAPTER pAd)
{
- UCHAR Index;
+ u8 Index;
PQUEUE_ENTRY pEntry;
PNDIS_PACKET pPacket;
PQUEUE_HEADER pQueue;
========================================================================
*/
-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)
{
pTxInfo->USBDMATxPktLen = USBDMApktLen;
pTxInfo->QSEL = QueueSel;
========================================================================
*/
-static NTSTATUS RTUSBFirmwareRun(IN PRTMP_ADAPTER pAd)
+static int RTUSBFirmwareRun(IN PRTMP_ADAPTER pAd)
{
- NTSTATUS Status;
+ int Status;
Status = RTUSB_VendorRequest(pAd,
USBD_TRANSFER_DIRECTION_OUT,
========================================================================
*/
-NTSTATUS RTUSBFirmwareWrite(IN PRTMP_ADAPTER pAd,
- IN PUCHAR pFwImage, IN ULONG FwLen)
+int RTUSBFirmwareWrite(IN PRTMP_ADAPTER pAd,
+ u8 *pFwImage, unsigned long FwLen)
{
- UINT32 MacReg;
- NTSTATUS Status;
-/* ULONG i; */
- USHORT writeLen;
+ u32 MacReg;
+ int Status;
+/* unsigned long i; */
+ u16 writeLen;
Status = RTUSBReadMACRegister(pAd, MAC_CSR0, &MacReg);
return Status;
}
-NTSTATUS RTUSBVenderReset(IN PRTMP_ADAPTER pAd)
+int RTUSBVenderReset(IN PRTMP_ADAPTER pAd)
{
- NTSTATUS Status;
+ int Status;
DBGPRINT_RAW(RT_DEBUG_ERROR, ("-->RTUSBVenderReset\n"));
Status = RTUSB_VendorRequest(pAd,
USBD_TRANSFER_DIRECTION_OUT,
========================================================================
*/
-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 Status;
+ int Status;
Status = RTUSB_VendorRequest(pAd,
(USBD_TRANSFER_DIRECTION_IN |
========================================================================
*/
-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 Status;
+ int Status;
/* TODO: In 2870, use this funciton carefully cause it's not stable. */
Status = RTUSB_VendorRequest(pAd,
return Status;
}
-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 Status;
+ int Status;
- USHORT index = 0, Value;
- PUCHAR pSrc = pData;
- USHORT resude = 0;
+ u16 index = 0, Value;
+ u8 *pSrc = pData;
+ u16 resude = 0;
resude = length % 2;
length += resude;
do {
- Value = (USHORT) (*pSrc | (*(pSrc + 1) << 8));
+ Value = (u16)(*pSrc | (*(pSrc + 1) << 8));
Status = RTUSBSingleWrite(pAd, Offset + index, Value);
index += 2;
length -= 2;
return Status;
}
-NTSTATUS RTUSBSingleWrite(IN RTMP_ADAPTER * pAd,
- IN USHORT Offset, IN USHORT Value)
+int RTUSBSingleWrite(IN RTMP_ADAPTER * pAd,
+ u16 Offset, u16 Value)
{
- NTSTATUS Status;
+ int Status;
Status = RTUSB_VendorRequest(pAd,
USBD_TRANSFER_DIRECTION_OUT,
========================================================================
*/
-NTSTATUS RTUSBReadMACRegister(IN PRTMP_ADAPTER pAd,
- IN USHORT Offset, OUT PUINT32 pValue)
+int RTUSBReadMACRegister(IN PRTMP_ADAPTER pAd,
+ u16 Offset, u32 *pValue)
{
- NTSTATUS Status = 0;
- UINT32 localVal;
+ int Status = 0;
+ u32 localVal;
Status = RTUSB_VendorRequest(pAd,
(USBD_TRANSFER_DIRECTION_IN |
========================================================================
*/
-NTSTATUS RTUSBWriteMACRegister(IN PRTMP_ADAPTER pAd,
- IN USHORT Offset, IN UINT32 Value)
+int RTUSBWriteMACRegister(IN PRTMP_ADAPTER pAd,
+ u16 Offset, u32 Value)
{
- NTSTATUS Status;
- UINT32 localVal;
+ int Status;
+ u32 localVal;
localVal = Value;
- Status = RTUSBSingleWrite(pAd, Offset, (USHORT) (localVal & 0xffff));
+ Status = RTUSBSingleWrite(pAd, Offset, (u16)(localVal & 0xffff));
Status =
RTUSBSingleWrite(pAd, Offset + 2,
- (USHORT) ((localVal & 0xffff0000) >> 16));
+ (u16)((localVal & 0xffff0000) >> 16));
return Status;
}
========================================================================
*/
-NTSTATUS RTUSBReadBBPRegister(IN PRTMP_ADAPTER pAd,
- IN UCHAR Id, IN PUCHAR pValue)
+int RTUSBReadBBPRegister(IN PRTMP_ADAPTER pAd,
+ u8 Id, u8 *pValue)
{
BBP_CSR_CFG_STRUC BbpCsr;
- UINT i = 0;
- NTSTATUS status;
+ u32 i = 0;
+ int status;
/* Verify the busy condition */
do {
status = RTUSBReadMACRegister(pAd, BBP_CSR_CFG, &BbpCsr.word);
if (status >= 0) {
if (!(BbpCsr.field.Busy == BUSY)) {
- *pValue = (UCHAR) BbpCsr.field.Value;
+ *pValue = (u8)BbpCsr.field.Value;
break;
}
}
========================================================================
*/
-NTSTATUS RTUSBWriteBBPRegister(IN PRTMP_ADAPTER pAd,
- IN UCHAR Id, IN UCHAR Value)
+int RTUSBWriteBBPRegister(IN PRTMP_ADAPTER pAd,
+ u8 Id, u8 Value)
{
BBP_CSR_CFG_STRUC BbpCsr;
- UINT i = 0;
- NTSTATUS status;
+ u32 i = 0;
+ int status;
/* Verify the busy condition */
do {
status = RTUSBReadMACRegister(pAd, BBP_CSR_CFG, &BbpCsr.word);
========================================================================
*/
-NTSTATUS RTUSBWriteRFRegister(IN PRTMP_ADAPTER pAd, IN UINT32 Value)
+int RTUSBWriteRFRegister(IN PRTMP_ADAPTER pAd, u32 Value)
{
PHY_CSR4_STRUC PhyCsr4;
- UINT i = 0;
- NTSTATUS status;
+ u32 i = 0;
+ int status;
NdisZeroMemory(&PhyCsr4, sizeof(PHY_CSR4_STRUC));
do {
========================================================================
*/
-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 Status = STATUS_SUCCESS;
+ int Status = STATUS_SUCCESS;
Status = RTUSB_VendorRequest(pAd,
(USBD_TRANSFER_DIRECTION_IN |
========================================================================
*/
-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)
{
- NTSTATUS Status = STATUS_SUCCESS;
+ int Status = STATUS_SUCCESS;
Status = RTUSB_VendorRequest(pAd,
USBD_TRANSFER_DIRECTION_OUT,
return Status;
}
-NTSTATUS RTUSBReadEEPROM16(IN PRTMP_ADAPTER pAd,
- IN USHORT offset, OUT PUSHORT pData)
+int RTUSBReadEEPROM16(IN PRTMP_ADAPTER pAd,
+ u16 offset, u16 *pData)
{
- NTSTATUS status;
- USHORT localData;
+ int status;
+ u16 localData;
- status = RTUSBReadEEPROM(pAd, offset, (PUCHAR) (&localData), 2);
+ status = RTUSBReadEEPROM(pAd, offset, (u8 *)(&localData), 2);
if (status == STATUS_SUCCESS)
*pData = le2cpu16(localData);
========================================================================
*/
-VOID RTUSBPutToSleep(IN PRTMP_ADAPTER pAd)
+void RTUSBPutToSleep(IN PRTMP_ADAPTER pAd)
{
- UINT32 value;
+ u32 value;
/* Timeout 0x40 x 50us */
value = (SLEEPCID << 16) + (OWNERMCU << 24) + (0x40 << 8) + 1;
========================================================================
*/
-NTSTATUS RTUSBWakeUp(IN PRTMP_ADAPTER pAd)
+int RTUSBWakeUp(IN PRTMP_ADAPTER pAd)
{
- NTSTATUS Status;
+ int Status;
Status = RTUSB_VendorRequest(pAd,
USBD_TRANSFER_DIRECTION_OUT,
========================================================================
*/
-VOID RTUSBInitializeCmdQ(IN PCmdQ cmdq)
+void RTUSBInitializeCmdQ(IN PCmdQ cmdq)
{
cmdq->head = NULL;
cmdq->tail = NULL;
========================================================================
*/
-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 status;
+ int status;
PCmdQElmt cmdqelmt = NULL;
RTMP_OS_TASK *pTask = &pAd->cmdQTask;
#endif
return (NDIS_STATUS_RESOURCES);
- status = os_alloc_mem(pAd, (PUCHAR *) (&cmdqelmt), sizeof(CmdQElmt));
+ status = os_alloc_mem(pAd, (u8 **) (&cmdqelmt), sizeof(CmdQElmt));
if ((status != NDIS_STATUS_SUCCESS) || (cmdqelmt == NULL))
return (NDIS_STATUS_RESOURCES);
cmdqelmt->buffer = NULL;
if (pInformationBuffer != NULL) {
status =
- os_alloc_mem(pAd, (PUCHAR *) & cmdqelmt->buffer,
+ os_alloc_mem(pAd, (u8 **) & cmdqelmt->buffer,
InformationBufferLength);
if ((status != NDIS_STATUS_SUCCESS)
|| (cmdqelmt->buffer == NULL)) {
========================================================================
*/
-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)
{
- NDIS_STATUS status;
+ int status;
PCmdQElmt cmdqelmt = NULL;
- status = os_alloc_mem(pAd, (PUCHAR *) & cmdqelmt, sizeof(CmdQElmt));
+ status = os_alloc_mem(pAd, (u8 **) & cmdqelmt, sizeof(CmdQElmt));
if ((status != NDIS_STATUS_SUCCESS) || (cmdqelmt == NULL))
return (NDIS_STATUS_RESOURCES);
NdisZeroMemory(cmdqelmt, sizeof(CmdQElmt));
if (InformationBufferLength > 0) {
status =
- os_alloc_mem(pAd, (PUCHAR *) & cmdqelmt->buffer,
+ os_alloc_mem(pAd, (u8 **) & cmdqelmt->buffer,
InformationBufferLength);
if ((status != NDIS_STATUS_SUCCESS)
|| (cmdqelmt->buffer == NULL)) {
========================================================================
*/
-VOID RTUSBDequeueCmd(IN PCmdQ cmdq, OUT PCmdQElmt * pcmdqelmt)
+void RTUSBDequeueCmd(IN PCmdQ cmdq, OUT PCmdQElmt * pcmdqelmt)
{
*pcmdqelmt = cmdq->head;
========================================================================
*/
-NTSTATUS RTUSB_VendorRequest(IN PRTMP_ADAPTER pAd,
- IN UINT32 TransferFlags,
- IN UCHAR RequestType,
- 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 RequestType,
+ u8 Request,
+ u16 Value,
+ u16 Index,
+ void *TransferBuffer,
+ u32 TransferBufferLength)
{
int ret = 0;
POS_COOKIE pObj = (POS_COOKIE) pAd->OS_Cookie;
========================================================================
*/
-NTSTATUS RTUSB_ResetDevice(IN PRTMP_ADAPTER pAd)
+int RTUSB_ResetDevice(IN PRTMP_ADAPTER pAd)
{
- NTSTATUS Status = TRUE;
+ int Status = TRUE;
DBGPRINT_RAW(RT_DEBUG_TRACE, ("--->USB_ResetDevice\n"));
/*RTMP_SET_FLAG(pAd, fRTMP_ADAPTER_RESET_IN_PROGRESS); */
return Status;
}
-VOID CMDHandler(IN PRTMP_ADAPTER pAd)
+void CMDHandler(IN PRTMP_ADAPTER pAd)
{
PCmdQElmt cmdqelmt;
- PUCHAR pData;
- NDIS_STATUS NdisStatus = NDIS_STATUS_SUCCESS;
-/* ULONG Now = 0; */
- NTSTATUS ntStatus;
+ u8 *pData;
+ int NdisStatus = NDIS_STATUS_SUCCESS;
+/* unsigned long Now = 0; */
+ int ntStatus;
/* unsigned long IrqFlags; */
while (pAd && pAd->CmdQ.size > 0) {
switch (cmdqelmt->command) {
case CMDTHREAD_CHECK_GPIO:
{
- UINT32 data;
+ u32 data;
{
/* Read GPIO pin2 as Hardware controlled radio state */
case CMDTHREAD_RESET_BULK_OUT:
{
- UINT32 MACValue;
- UCHAR Index;
+ u32 MACValue;
+ u8 Index;
int ret = 0;
PHT_TX_CONTEXT pHTTXContext;
/* RTMP_TX_RING *pTxRing; */
if (pAd->
bulkResetPipeid ==
0) {
- UCHAR
+ u8
pendingContext
= 0;
PHT_TX_CONTEXT
if ((atomic_read(&pAd->PendingRx) == 0) && (!RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_HALT_IN_PROGRESS)))
{
- UCHAR i;
+ u8 i;
RTUSBRxPacket(pAd);
pAd->NextRxBulkInReadIndex = 0; // Next Rx Read index
pAd->NextRxBulkInIndex = 0; // Rx Bulk pointer
/* All transfers must be aborted or cancelled before attempting to reset the pipe. */
{
- UINT32 MACValue;
+ u32 MACValue;
{
/*while ((atomic_read(&pAd->PendingRx) > 0) && (!RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_NIC_NOT_EXIST))) */
|
fRTMP_ADAPTER_NIC_NOT_EXIST)))))
{
- UCHAR i;
+ u8 i;
if (RTMP_TEST_FLAG
(pAd,
case CMDTHREAD_SET_ASIC_WCID:
{
RT_SET_ASIC_WCID SetAsicWcid;
- USHORT offset;
- UINT32 MACValue, MACRValue = 0;
+ u16 offset;
+ u32 MACValue, MACRValue = 0;
SetAsicWcid =
*((PRT_SET_ASIC_WCID) (pData));
offset =
MAC_WCID_BASE +
- ((UCHAR) SetAsicWcid.WCID) *
+ ((u8)SetAsicWcid.WCID) *
HW_WCID_ENTRY_SIZE;
DBGPRINT_RAW(RT_DEBUG_TRACE,
case CMDTHREAD_SET_ASIC_WCID_CIPHER:
{
RT_SET_ASIC_WCID_ATTRI SetAsicWcidAttri;
- USHORT offset;
- UINT32 MACRValue = 0;
+ u16 offset;
+ u32 MACRValue = 0;
SHAREDKEY_MODE_STRUC csr1;
SetAsicWcidAttri =
*((PRT_SET_ASIC_WCID_ATTRI)
offset =
MAC_WCID_ATTRIBUTE_BASE +
- ((UCHAR) SetAsicWcidAttri.WCID) *
+ ((u8)SetAsicWcidAttri.WCID) *
HW_WCID_ATTRI_SIZE;
DBGPRINT_RAW(RT_DEBUG_TRACE,
&MACRValue);
MACRValue = 0;
MACRValue |=
- (((UCHAR) SetAsicWcidAttri.
+ (((u8)SetAsicWcidAttri.
Cipher) << 1);
RTUSBWriteMACRegister(pAd, offset,
offset =
PAIRWISE_IVEIV_TABLE_BASE +
- ((UCHAR) SetAsicWcidAttri.WCID) *
+ ((u8)SetAsicWcidAttri.WCID) *
HW_IVEIV_ENTRY_SIZE;
MACRValue = 0;
if ((SetAsicWcidAttri.Cipher <=
&MACRValue);
MACRValue &= (~0xe);
MACRValue |=
- (((UCHAR) SetAsicWcidAttri.
+ (((u8)SetAsicWcidAttri.
Cipher) << 1);
RTUSBWriteMACRegister(pAd,
(pData));
AsicAddPairwiseKeyEntry(pAd,
KeyInfo.MacAddr,
- (UCHAR) KeyInfo.
+ (u8)KeyInfo.
MacTabMatchWCID,
&KeyInfo.
CipherKey);
case RT_CMD_SET_RX_WCID_TABLE: /*General call for RTMPAddWcidAttributeEntry() */
{
PMAC_TABLE_ENTRY pEntry;
- UCHAR KeyIdx = 0;
- UCHAR CipherAlg = CIPHER_NONE;
- UCHAR ApIdx = BSS0;
+ u8 KeyIdx = 0;
+ u8 CipherAlg = CIPHER_NONE;
+ u8 ApIdx = BSS0;
pEntry = (PMAC_TABLE_ENTRY) (pData);
AsicRemovePairwiseKeyEntry(pAd,
pEntry->
apidx,
- (UCHAR)
+ (u8)
pEntry->
Aid);
if ((pEntry->AuthMode <=
&& (pEntry->WepStatus ==
Ndis802_11Encryption1Enabled))
{
- UINT32 uIV = 1;
- PUCHAR ptr;
+ u32 uIV = 1;
+ u8 *ptr;
- ptr = (PUCHAR) & uIV;
+ ptr = (u8 *)& uIV;
*(ptr + 3) =
(pAd->StaCfg.
DefaultKeyId << 6);
} else if (pEntry->AuthMode ==
Ndis802_11AuthModeWPANone)
{
- UINT32 uIV = 1;
- PUCHAR ptr;
+ u32 uIV = 1;
+ u8 *ptr;
- ptr = (PUCHAR) & uIV;
+ ptr = (u8 *)& uIV;
*(ptr + 3) =
(pAd->StaCfg.
DefaultKeyId << 6);
/* Other case, disable engine. */
/* Don't worry WPA key, we will add WPA Key after 4-Way handshaking. */
/* */
- USHORT offset;
+ u16 offset;
offset =
MAC_WCID_ATTRIBUTE_BASE
+
case OID_802_11_ADD_WEP:
{
- UINT i;
- UINT32 KeyIdx;
+ u32 i;
+ u32 KeyIdx;
PNDIS_802_11_WEP pWepKey;
DBGPRINT(RT_DEBUG_TRACE,
DBGPRINT(RT_DEBUG_ERROR,
("CmdThread::OID_802_11_ADD_WEP, INVALID_DATA!!\n"));
} else {
- UCHAR CipherAlg;
+ u8 CipherAlg;
pAd->SharedKey[BSS0][KeyIdx].
KeyLen =
- (UCHAR) pWepKey->KeyLength;
+ (u8)pWepKey->KeyLength;
NdisMoveMemory(pAd->
SharedKey[BSS0]
[KeyIdx].Key,
if (pWepKey->
KeyIndex & 0x80000000) {
/* Default key for tx (shared key) */
- UCHAR IVEIV[8];
- UINT32 WCIDAttri, Value;
- USHORT offset, offset2;
+ u8 IVEIV[8];
+ u32 WCIDAttri, Value;
+ u16 offset, offset2;
NdisZeroMemory(IVEIV,
8);
pAd->StaCfg.
DefaultKeyId =
- (UCHAR) KeyIdx;
+ (u8)KeyIdx;
/* Add BSSID to WCTable. because this is Tx wep key. */
/* WCID Attribute UDF:3, BSSIdx:3, Alg:3, Keytable:1=PAIRWISE KEY, BSSIdx is 0 */
WCIDAttri =
WCIDAttri);
/* 1. IV/EIV */
/* Specify key index to find shared key. */
- IVEIV[3] = (UCHAR) (KeyIdx << 6); /*WEP Eiv bit off. groupkey index is not 0 */
+ IVEIV[3] = (u8)(KeyIdx << 6); /*WEP Eiv bit off. groupkey index is not 0 */
offset =
PAIRWISE_IVEIV_TABLE_BASE
+
}
AsicAddSharedKeyEntry(pAd, BSS0,
- (UCHAR)
+ (u8)
KeyIdx,
CipherAlg,
pWepKey->
case CMDTHREAD_SET_PSM_BIT:
{
- USHORT *pPsm = (USHORT *) pData;
+ u16 *pPsm = (u16 *) pData;
MlmeSetPsmBit(pAd, *pPsm);
}
break;
/* AUTO GEN PLEASE DO NOT MODIFY IT */
-UCHAR FirmwareImage_2870 [] = {
+u8 FirmwareImage_2870 [] = {
0xff, 0xff, 0xff, 0x02, 0x10, 0x28, 0x02, 0x10, 0x32, 0x02, 0x10, 0x78, 0x02, 0x12, 0x67, 0x02,
0x12, 0x68, 0x02, 0x12, 0x87, 0x02, 0x12, 0x8c, 0x12, 0x12, 0x88, 0x22, 0x02, 0x16, 0x49, 0x02,
0x17, 0x1f, 0x02, 0x13, 0x77, 0x02, 0x12, 0x8d, 0x30, 0x05, 0x06, 0x20, 0x0d, 0x03, 0x12, 0x17,
/* MD4 context. */
typedef struct _MD4_CTX_ {
- ULONG state[4]; /* state (ABCD) */
- ULONG count[2]; /* number of bits, modulo 2^64 (lsb first) */
- UCHAR buffer[64]; /* input buffer */
+ unsigned long state[4]; /* state (ABCD) */
+ unsigned long count[2]; /* number of bits, modulo 2^64 (lsb first) */
+ u8 buffer[64]; /* input buffer */
} MD4_CTX;
-VOID MD4Init (MD4_CTX *);
-VOID MD4Update (MD4_CTX *, PUCHAR, UINT);
-VOID MD4Final (UCHAR [16], MD4_CTX *);
+void MD4Init (MD4_CTX *);
+void MD4Update (MD4_CTX *, u8 *, UINT);
+void MD4Final (u8 [16], MD4_CTX *);
#endif //__MD4_H__
\ No newline at end of file
/* AUTO GEN PLEASE DO NOT MODIFY IT */
-UCHAR FirmwareImage_3090 [] = {
+u8 FirmwareImage_3090 [] = {
0x02, 0x02, 0xf3, 0x02, 0x02, 0xa1, 0x22, 0x22, 0xff, 0xff, 0xff, 0x02, 0x01, 0x27, 0xff, 0xff,
0xff, 0xff, 0xff, 0x02, 0x00, 0x1e, 0xff, 0xff, 0xff, 0xff, 0xff, 0x02, 0x00, 0xd8, 0xc0, 0xe0,
0xc0, 0xf0, 0xc0, 0x83, 0xc0, 0x82, 0xc0, 0xd0, 0x75, 0xd0, 0x18, 0xc2, 0xaf, 0x30, 0x45, 0x03,