提交 51126deb 编写于 作者: B Bartlomiej Zolnierkiewicz 提交者: Greg Kroah-Hartman

Staging: rt28x0: remove typedefs (part one)

Remove typedefs from rtmp_type.h.
Signed-off-by: NBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
上级 cc277069
......@@ -41,26 +41,26 @@
#define __AP_H__
/* ap_wpa.c */
VOID WpaStateMachineInit(IN PRTMP_ADAPTER pAd,
void WpaStateMachineInit(IN PRTMP_ADAPTER pAd,
IN STATE_MACHINE * Sm, OUT STATE_MACHINE_FUNC Trans[]);
#ifdef RTMP_MAC_USB
VOID BeaconUpdateExec(IN PVOID SystemSpecific1,
IN PVOID FunctionContext,
IN PVOID SystemSpecific2, IN PVOID SystemSpecific3);
void BeaconUpdateExec(void *SystemSpecific1,
void *FunctionContext,
void *SystemSpecific2, void *SystemSpecific3);
#endif /* RTMP_MAC_USB // */
VOID RTMPSetPiggyBack(IN PRTMP_ADAPTER pAd, IN BOOLEAN bPiggyBack);
void RTMPSetPiggyBack(IN PRTMP_ADAPTER pAd, IN BOOLEAN bPiggyBack);
VOID MacTableReset(IN PRTMP_ADAPTER pAd);
void MacTableReset(IN PRTMP_ADAPTER pAd);
MAC_TABLE_ENTRY *MacTableInsertEntry(IN PRTMP_ADAPTER pAd,
IN PUCHAR pAddr,
IN UCHAR apidx, IN BOOLEAN CleanAll);
u8 *pAddr,
u8 apidx, IN BOOLEAN CleanAll);
BOOLEAN MacTableDeleteEntry(IN PRTMP_ADAPTER pAd,
IN USHORT wcid, IN PUCHAR pAddr);
u16 wcid, u8 *pAddr);
MAC_TABLE_ENTRY *MacTableLookup(IN PRTMP_ADAPTER pAd, IN PUCHAR pAddr);
MAC_TABLE_ENTRY *MacTableLookup(IN PRTMP_ADAPTER pAd, u8 *pAddr);
#endif /* __AP_H__ */
......@@ -71,24 +71,24 @@
//
typedef struct PACKED _TXD_STRUC {
// Word 0
UINT32 SDPtr0;
u32 SDPtr0;
// Word 1
UINT32 SDLen1:14;
UINT32 LastSec1:1;
UINT32 Burst:1;
UINT32 SDLen0:14;
UINT32 LastSec0:1;
UINT32 DMADONE:1;
u32 SDLen1:14;
u32 LastSec1:1;
u32 Burst:1;
u32 SDLen0:14;
u32 LastSec0:1;
u32 DMADONE:1;
//Word2
UINT32 SDPtr1;
u32 SDPtr1;
//Word3
UINT32 rsv2:24;
UINT32 WIV:1; // Wireless Info Valid. 1 if Driver already fill WI, o if DMA needs to copy WI to correctposition
UINT32 QSEL:2; // select on-chip FIFO ID for 2nd-stage output scheduler.0:MGMT, 1:HCCA 2:EDCA
UINT32 rsv:2;
UINT32 TCO:1; //
UINT32 UCO:1; //
UINT32 ICO:1; //
u32 rsv2:24;
u32 WIV:1; /* Wireless Info Valid. 1 if Driver already fill WI, o if DMA needs to copy WI to correctposition */
u32 QSEL:2; /* select on-chip FIFO ID for 2nd-stage output scheduler.0:MGMT, 1:HCCA 2:EDCA */
u32 rsv:2;
u32 TCO:1; /* */
u32 UCO:1; /* */
u32 ICO:1; /* */
} TXD_STRUC, *PTXD_STRUC;
//
......@@ -96,47 +96,47 @@ typedef struct PACKED _TXD_STRUC {
//
typedef struct PACKED _RXD_STRUC {
// Word 0
UINT32 SDP0;
u32 SDP0;
// Word 1
UINT32 SDL1:14;
UINT32 Rsv:2;
UINT32 SDL0:14;
UINT32 LS0:1;
UINT32 DDONE:1;
u32 SDL1:14;
u32 Rsv:2;
u32 SDL0:14;
u32 LS0:1;
u32 DDONE:1;
// Word 2
UINT32 SDP1;
u32 SDP1;
// Word 3
UINT32 BA:1;
UINT32 DATA:1;
UINT32 NULLDATA:1;
UINT32 FRAG:1;
UINT32 U2M:1; // 1: this RX frame is unicast to me
UINT32 Mcast:1; // 1: this is a multicast frame
UINT32 Bcast:1; // 1: this is a broadcast frame
UINT32 MyBss:1; // 1: this frame belongs to the same BSSID
UINT32 Crc:1; // 1: CRC error
UINT32 CipherErr:2; // 0: decryption okay, 1:ICV error, 2:MIC error, 3:KEY not valid
UINT32 AMSDU:1; // rx with 802.3 header, not 802.11 header.
UINT32 HTC:1;
UINT32 RSSI:1;
UINT32 L2PAD:1;
UINT32 AMPDU:1;
UINT32 Decrypted:1; // this frame is being decrypted.
UINT32 PlcpSignal:1; // To be moved
UINT32 PlcpRssil:1; // To be moved
UINT32 Rsv1:13;
u32 BA:1;
u32 DATA:1;
u32 NULLDATA:1;
u32 FRAG:1;
u32 U2M:1; /* 1: this RX frame is unicast to me */
u32 Mcast:1; /* 1: this is a multicast frame */
u32 Bcast:1; /* 1: this is a broadcast frame */
u32 MyBss:1; /* 1: this frame belongs to the same BSSID */
u32 Crc:1; /* 1: CRC error */
u32 CipherErr:2; /* 0: decryption okay, 1:ICV error, 2:MIC error, 3:KEY not valid */
u32 AMSDU:1; /* rx with 802.3 header, not 802.11 header. */
u32 HTC:1;
u32 RSSI:1;
u32 L2PAD:1;
u32 AMPDU:1;
u32 Decrypted:1; /* this frame is being decrypted. */
u32 PlcpSignal:1; /* To be moved */
u32 PlcpRssil:1; /* To be moved */
u32 Rsv1:13;
} RXD_STRUC, *PRXD_STRUC, RT28XX_RXD_STRUC, *PRT28XX_RXD_STRUC;
typedef union _TX_ATTENUATION_CTRL_STRUC {
struct {
ULONG RF_ISOLATION_ENABLE:1;
ULONG Reserve2:7;
ULONG PCIE_PHY_TX_ATTEN_VALUE:3;
ULONG PCIE_PHY_TX_ATTEN_EN:1;
ULONG Reserve1:20;
unsigned long RF_ISOLATION_ENABLE:1;
unsigned long Reserve2:7;
unsigned long PCIE_PHY_TX_ATTEN_VALUE:3;
unsigned long PCIE_PHY_TX_ATTEN_EN:1;
unsigned long Reserve1:20;
} field;
ULONG word;
unsigned long word;
} TX_ATTENUATION_CTRL_STRUC, *PTX_ATTENUATION_CTRL_STRUC;
/* ----------------- EEPROM Related MACRO ----------------- */
......@@ -148,7 +148,7 @@ typedef union _TX_ATTENUATION_CTRL_STRUC {
/* ----------------- Frimware Related MACRO ----------------- */
#define RTMP_WRITE_FIRMWARE(_pAd, _pFwImage, _FwLen) \
do{ \
ULONG _i, _firm; \
unsigned long _i, _firm; \
RTMP_IO_WRITE32(_pAd, PBF_SYS_CTRL, 0x10000); \
\
for(_i=0; _i<_FwLen; _i+=4) \
......@@ -172,7 +172,7 @@ typedef union _TX_ATTENUATION_CTRL_STRUC {
#define RTMP_STOP_DEQUEUE(pAd, QueIdx, irqFlags) do{}while(0)
#define RTMP_HAS_ENOUGH_FREE_DESC(pAd, pTxBlk, freeNum, pPacket) \
((freeNum) >= (ULONG)(pTxBlk->TotalFragNum + RTMP_GET_PACKET_FRAGMENTS(pPacket) + 3)) /* rough estimate we will use 3 more descriptor. */
((freeNum) >= (unsigned long)(pTxBlk->TotalFragNum + RTMP_GET_PACKET_FRAGMENTS(pPacket) + 3)) /* rough estimate we will use 3 more descriptor. */
#define RTMP_RELEASE_DESC_RESOURCE(pAd, QueIdx) \
do{}while(0)
......@@ -238,7 +238,7 @@ typedef union _TX_ATTENUATION_CTRL_STRUC {
// remove Pair-wise key material from ASIC
#define RTMP_STA_ENTRY_KEY_DEL(pAd, BssIdx, Wcid) \
AsicRemovePairwiseKeyEntry(pAd, BssIdx, (UCHAR)Wcid);
AsicRemovePairwiseKeyEntry(pAd, BssIdx, (u8)Wcid);
// add Client security information into ASIC WCID table and IVEIV table
#define RTMP_STA_SECURITY_INFO_ADD(pAd, apidx, KeyID, pEntry) \
......@@ -260,7 +260,7 @@ typedef union _TX_ATTENUATION_CTRL_STRUC {
// Insert the BA bitmap to ASIC for the Wcid entry
#define RTMP_ADD_BA_SESSION_TO_ASIC(_pAd, _Aid, _TID) \
do{ \
UINT32 _Value = 0, _Offset; \
u32 _Value = 0, _Offset; \
_Offset = MAC_WCID_BASE + (_Aid) * HW_WCID_ENTRY_SIZE + 4; \
RTMP_IO_READ32((_pAd), _Offset, &_Value);\
_Value |= (0x10000<<(_TID)); \
......@@ -271,7 +271,7 @@ typedef union _TX_ATTENUATION_CTRL_STRUC {
// bitmap field starts at 0x10000 in ASIC WCID table
#define RTMP_DEL_BA_SESSION_FROM_ASIC(_pAd, _Wcid, _TID) \
do{ \
UINT32 _Value = 0, _Offset; \
u32 _Value = 0, _Offset; \
_Offset = MAC_WCID_BASE + (_Wcid) * HW_WCID_ENTRY_SIZE + 4; \
RTMP_IO_READ32((_pAd), _Offset, &_Value); \
_Value &= (~(0x10000 << (_TID))); \
......
......@@ -62,26 +62,26 @@
#define RT2870_RXDMALEN_FIELD_SIZE 4
typedef struct PACKED _RXINFO_STRUC {
UINT32 BA:1;
UINT32 DATA:1;
UINT32 NULLDATA:1;
UINT32 FRAG:1;
UINT32 U2M:1; /* 1: this RX frame is unicast to me */
UINT32 Mcast:1; /* 1: this is a multicast frame */
UINT32 Bcast:1; /* 1: this is a broadcast frame */
UINT32 MyBss:1; /* 1: this frame belongs to the same BSSID */
UINT32 Crc:1; /* 1: CRC error */
UINT32 CipherErr:2; /* 0: decryption okay, 1:ICV error, 2:MIC error, 3:KEY not valid */
UINT32 AMSDU:1; /* rx with 802.3 header, not 802.11 header. */
UINT32 HTC:1;
UINT32 RSSI:1;
UINT32 L2PAD:1;
UINT32 AMPDU:1; /* To be moved */
UINT32 Decrypted:1;
UINT32 PlcpRssil:1;
UINT32 CipherAlg:1;
UINT32 LastAMSDU:1;
UINT32 PlcpSignal:12;
u32 BA:1;
u32 DATA:1;
u32 NULLDATA:1;
u32 FRAG:1;
u32 U2M:1; /* 1: this RX frame is unicast to me */
u32 Mcast:1; /* 1: this is a multicast frame */
u32 Bcast:1; /* 1: this is a broadcast frame */
u32 MyBss:1; /* 1: this frame belongs to the same BSSID */
u32 Crc:1; /* 1: CRC error */
u32 CipherErr:2; /* 0: decryption okay, 1:ICV error, 2:MIC error, 3:KEY not valid */
u32 AMSDU:1; /* rx with 802.3 header, not 802.11 header. */
u32 HTC:1;
u32 RSSI:1;
u32 L2PAD:1;
u32 AMPDU:1; /* To be moved */
u32 Decrypted:1;
u32 PlcpRssil:1;
u32 CipherAlg:1;
u32 LastAMSDU:1;
u32 PlcpSignal:12;
} RXINFO_STRUC, *PRXINFO_STRUC, RT28XX_RXD_STRUC, *PRT28XX_RXD_STRUC;
/* */
......@@ -91,14 +91,14 @@ typedef struct PACKED _RXINFO_STRUC {
typedef struct _TXINFO_STRUC {
/* Word 0 */
UINT32 USBDMATxPktLen:16; /*used ONLY in USB bulk Aggregation, Total byte counts of all sub-frame. */
UINT32 rsv:8;
UINT32 WIV:1; /* Wireless Info Valid. 1 if Driver already fill WI, o if DMA needs to copy WI to correctposition */
UINT32 QSEL:2; /* select on-chip FIFO ID for 2nd-stage output scheduler.0:MGMT, 1:HCCA 2:EDCA */
UINT32 SwUseLastRound:1; /* Software use. */
UINT32 rsv2:2; /* Software use. */
UINT32 USBDMANextVLD:1; /*used ONLY in USB bulk Aggregation, NextValid */
UINT32 USBDMATxburst:1; /*used ONLY in USB bulk Aggre. Force USB DMA transmit frame from current selected endpoint */
u32 USBDMATxPktLen:16; /*used ONLY in USB bulk Aggregation, Total byte counts of all sub-frame. */
u32 rsv:8;
u32 WIV:1; /* Wireless Info Valid. 1 if Driver already fill WI, o if DMA needs to copy WI to correctposition */
u32 QSEL:2; /* select on-chip FIFO ID for 2nd-stage output scheduler.0:MGMT, 1:HCCA 2:EDCA */
u32 SwUseLastRound:1; /* Software use. */
u32 rsv2:2; /* Software use. */
u32 USBDMANextVLD:1; /*used ONLY in USB bulk Aggregation, NextValid */
u32 USBDMATxburst:1; /*used ONLY in USB bulk Aggre. Force USB DMA transmit frame from current selected endpoint */
} TXINFO_STRUC, *PTXINFO_STRUC;
/* */
......@@ -106,8 +106,8 @@ typedef struct _TXINFO_STRUC {
/* */
typedef struct _MGMT_STRUC {
BOOLEAN Valid;
PUCHAR pBuffer;
ULONG Length;
u8 *pBuffer;
unsigned long Length;
} MGMT_STRUC, *PMGMT_STRUC;
/*////////////////////////////////////////////////////////////////////////// */
......@@ -115,69 +115,69 @@ typedef struct _MGMT_STRUC {
/*////////////////////////////////////////////////////////////////////////// */
typedef struct __TX_BUFFER {
union {
UCHAR WirelessPacket[TX_BUFFER_NORMSIZE];
u8 WirelessPacket[TX_BUFFER_NORMSIZE];
HEADER_802_11 NullFrame;
PSPOLL_FRAME PsPollPacket;
RTS_FRAME RTSFrame;
} field;
UCHAR Aggregation[4]; /*Buffer for save Aggregation size. */
u8 Aggregation[4]; /*Buffer for save Aggregation size. */
} TX_BUFFER, *PTX_BUFFER;
typedef struct __HTTX_BUFFER {
union {
UCHAR WirelessPacket[MAX_TXBULK_SIZE];
u8 WirelessPacket[MAX_TXBULK_SIZE];
HEADER_802_11 NullFrame;
PSPOLL_FRAME PsPollPacket;
RTS_FRAME RTSFrame;
} field;
UCHAR Aggregation[4]; /*Buffer for save Aggregation size. */
u8 Aggregation[4]; /*Buffer for save Aggregation size. */
} HTTX_BUFFER, *PHTTX_BUFFER;
/* used to track driver-generated write irps */
typedef struct _TX_CONTEXT {
PVOID pAd; /*Initialized in MiniportInitialize */
void *pAd; /*Initialized in MiniportInitialize */
PURB pUrb; /*Initialized in MiniportInitialize */
PIRP pIrp; /*used to cancel pending bulk out. */
/*Initialized in MiniportInitialize */
PTX_BUFFER TransferBuffer; /*Initialized in MiniportInitialize */
ULONG BulkOutSize;
UCHAR BulkOutPipeId;
UCHAR SelfIdx;
unsigned long BulkOutSize;
u8 BulkOutPipeId;
u8 SelfIdx;
BOOLEAN InUse;
BOOLEAN bWaitingBulkOut; /* at least one packet is in this TxContext, ready for making IRP anytime. */
BOOLEAN bFullForBulkOut; /* all tx buffer are full , so waiting for tx bulkout. */
BOOLEAN IRPPending;
BOOLEAN LastOne;
BOOLEAN bAggregatible;
UCHAR Header_802_3[LENGTH_802_3];
UCHAR Rsv[2];
ULONG DataOffset;
UINT TxRate;
u8 Header_802_3[LENGTH_802_3];
u8 Rsv[2];
unsigned long DataOffset;
u32 TxRate;
dma_addr_t data_dma; /* urb dma on linux */
} TX_CONTEXT, *PTX_CONTEXT, **PPTX_CONTEXT;
/* used to track driver-generated write irps */
typedef struct _HT_TX_CONTEXT {
PVOID pAd; /*Initialized in MiniportInitialize */
void *pAd; /*Initialized in MiniportInitialize */
PURB pUrb; /*Initialized in MiniportInitialize */
PIRP pIrp; /*used to cancel pending bulk out. */
/*Initialized in MiniportInitialize */
PHTTX_BUFFER TransferBuffer; /*Initialized in MiniportInitialize */
ULONG BulkOutSize; /* Indicate the total bulk-out size in bytes in one bulk-transmission */
UCHAR BulkOutPipeId;
unsigned long BulkOutSize; /* Indicate the total bulk-out size in bytes in one bulk-transmission */
u8 BulkOutPipeId;
BOOLEAN IRPPending;
BOOLEAN LastOne;
BOOLEAN bCurWriting;
BOOLEAN bRingEmpty;
BOOLEAN bCopySavePad;
UCHAR SavedPad[8];
UCHAR Header_802_3[LENGTH_802_3];
ULONG CurWritePosition; /* Indicate the buffer offset which packet will be inserted start from. */
ULONG CurWriteRealPos; /* Indicate the buffer offset which packet now are writing to. */
ULONG NextBulkOutPosition; /* Indicate the buffer start offset of a bulk-transmission */
ULONG ENextBulkOutPosition; /* Indicate the buffer end offset of a bulk-transmission */
UINT TxRate;
u8 SavedPad[8];
u8 Header_802_3[LENGTH_802_3];
unsigned long CurWritePosition; /* Indicate the buffer offset which packet will be inserted start from. */
unsigned long CurWriteRealPos; /* Indicate the buffer offset which packet now are writing to. */
unsigned long NextBulkOutPosition; /* Indicate the buffer start offset of a bulk-transmission */
unsigned long ENextBulkOutPosition; /* Indicate the buffer end offset of a bulk-transmission */
u32 TxRate;
dma_addr_t data_dma; /* urb dma on linux */
} HT_TX_CONTEXT, *PHT_TX_CONTEXT, **PPHT_TX_CONTEXT;
......@@ -186,12 +186,12 @@ typedef struct _HT_TX_CONTEXT {
/* receive data to the protocol. */
/* */
typedef struct _RX_CONTEXT {
PUCHAR TransferBuffer;
PVOID pAd;
u8 *TransferBuffer;
void *pAd;
PIRP pIrp; /*used to cancel pending bulk in. */
PURB pUrb;
/*These 2 Boolean shouldn't both be 1 at the same time. */
ULONG BulkInOffset; /* number of packets waiting for reordering . */
unsigned long BulkInOffset; /* number of packets waiting for reordering . */
/* BOOLEAN ReorderInUse; // At least one packet in this buffer are in reordering buffer and wait for receive indication */
BOOLEAN bRxHandling; /* Notify this packet is being process now. */
BOOLEAN InUse; /* USB Hardware Occupied. Wait for USB HW to put packet. */
......@@ -332,9 +332,9 @@ typedef struct _RX_CONTEXT {
MlmeSetPsmBit(_pAd, _val);\
else \
{ \
USHORT _psm_val; \
u16 _psm_val; \
_psm_val = _val; \
RTUSBEnqueueInternalCmd(_pAd, CMDTHREAD_SET_PSM_BIT, &(_psm_val), sizeof(USHORT)); \
RTUSBEnqueueInternalCmd(_pAd, CMDTHREAD_SET_PSM_BIT, &(_psm_val), sizeof(u16)); \
}\
}
......
......@@ -40,7 +40,7 @@
#ifdef RT30xx
extern REG_PAIR RT30xx_RFRegTable[];
extern UCHAR NUM_RF_REG_PARMS;
extern u8 NUM_RF_REG_PARMS;
#endif /* RT30xx // */
......
......@@ -180,7 +180,7 @@
if ((_A)->bPCIclkOff == FALSE) \
{ \
PHY_CSR4_STRUC _value; \
ULONG _busyCnt = 0; \
unsigned long _busyCnt = 0; \
\
do { \
RTMP_IO_READ32((_A), RF_CSR_CFG0, &_value.word); \
......@@ -248,7 +248,7 @@
if ((BbpCsr.field.Busy == IDLE) && \
(BbpCsr.field.RegNum == _bbpID)) \
{ \
*(_pV) = (UCHAR)BbpCsr.field.Value; \
*(_pV) = (u8)BbpCsr.field.Value; \
break; \
} \
} \
......@@ -313,7 +313,7 @@
if ((BbpCsr.field.Busy == IDLE) && \
(BbpCsr.field.RegNum == _I)) \
{ \
*(_pV) = (UCHAR)BbpCsr.field.Value; \
*(_pV) = (u8)BbpCsr.field.Value; \
break; \
} \
} \
......@@ -351,7 +351,7 @@
if ((BbpCsr.field.Busy == IDLE) && \
(BbpCsr.field.RegNum == _I)) \
{ \
*(_pV) = (UCHAR)BbpCsr.field.Value; \
*(_pV) = (u8)BbpCsr.field.Value; \
break; \
} \
} \
......@@ -429,7 +429,7 @@
#define RTMP_BBP_IO_WRITE8_BY_REG_ID(_A, _I, _V) \
{ \
BBP_CSR_CFG_STRUC BbpCsr; \
INT BusyCnt = 0; \
int BusyCnt = 0; \
BOOLEAN brc; \
if (_I < MAX_NUM_OF_BBP_LATCH) \
{ \
......@@ -523,8 +523,8 @@
#ifdef RT30xx
#define RTMP_ASIC_MMPS_DISABLE(_pAd) \
do{ \
UINT32 _macData; \
UCHAR _bbpData = 0; \
u32 _macData; \
u8 _bbpData = 0; \
/* disable MMPS BBP control register */ \
RTMP_BBP_IO_READ8_BY_REG_ID(_pAd, BBP_R3, &_bbpData); \
_bbpData &= ~(0x04); /*bit 2*/ \
......@@ -538,8 +538,8 @@
#define RTMP_ASIC_MMPS_ENABLE(_pAd) \
do{ \
UINT32 _macData; \
UCHAR _bbpData = 0; \
u32 _macData; \
u8 _bbpData = 0; \
/* enable MMPS BBP control register */ \
RTMP_BBP_IO_READ8_BY_REG_ID(_pAd, BBP_R3, &_bbpData); \
_bbpData |= (0x04); /*bit 2*/ \
......
......@@ -43,25 +43,25 @@
#error "You Should Enable compile flag RTMP_RF_RW_SUPPORT for this chip"
#endif /* RTMP_RF_RW_SUPPORT // */
VOID NICInitRT3070RFRegisters(IN PRTMP_ADAPTER pAd)
void NICInitRT3070RFRegisters(IN PRTMP_ADAPTER pAd)
{
INT i;
UCHAR RFValue;
int i;
u8 RFValue;
/* Driver must read EEPROM to get RfIcType before initial RF registers */
/* Initialize RF register to default value */
if (IS_RT3070(pAd) || IS_RT3071(pAd)) {
/* Init RF calibration */
/* Driver should toggle RF R30 bit7 before init RF registers */
UINT32 RfReg = 0;
UINT32 data;
u32 RfReg = 0;
u32 data;
RT30xxReadRFRegister(pAd, RF_R30, (PUCHAR) & RfReg);
RT30xxReadRFRegister(pAd, RF_R30, (u8 *)& RfReg);
RfReg |= 0x80;
RT30xxWriteRFRegister(pAd, RF_R30, (UCHAR) RfReg);
RT30xxWriteRFRegister(pAd, RF_R30, (u8)RfReg);
RTMPusecDelay(1000);
RfReg &= 0x7F;
RT30xxWriteRFRegister(pAd, RF_R30, (UCHAR) RfReg);
RT30xxWriteRFRegister(pAd, RF_R30, (u8)RfReg);
/* Initialize RF register to default value */
for (i = 0; i < NUM_RF_REG_PARMS; i++) {
......@@ -84,9 +84,9 @@ VOID NICInitRT3070RFRegisters(IN PRTMP_ADAPTER pAd)
}
} else if (IS_RT3071(pAd)) {
/* Driver should set RF R6 bit6 on before init RF registers */
RT30xxReadRFRegister(pAd, RF_R06, (PUCHAR) & RfReg);
RT30xxReadRFRegister(pAd, RF_R06, (u8 *)& RfReg);
RfReg |= 0x40;
RT30xxWriteRFRegister(pAd, RF_R06, (UCHAR) RfReg);
RT30xxWriteRFRegister(pAd, RF_R06, (u8)RfReg);
/* init R31 */
RT30xxWriteRFRegister(pAd, RF_R31, 0x14);
......
......@@ -43,22 +43,22 @@
#error "You Should Enable compile flag RTMP_RF_RW_SUPPORT for this chip"
#endif /* RTMP_RF_RW_SUPPORT // */
VOID NICInitRT3090RFRegisters(IN PRTMP_ADAPTER pAd)
void NICInitRT3090RFRegisters(IN PRTMP_ADAPTER pAd)
{
INT i;
int i;
/* Driver must read EEPROM to get RfIcType before initial RF registers */
/* Initialize RF register to default value */
if (IS_RT3090(pAd)) {
/* Init RF calibration */
/* Driver should toggle RF R30 bit7 before init RF registers */
UINT32 RfReg = 0, data;
u32 RfReg = 0, data;
RT30xxReadRFRegister(pAd, RF_R30, (PUCHAR) & RfReg);
RT30xxReadRFRegister(pAd, RF_R30, (u8 *)& RfReg);
RfReg |= 0x80;
RT30xxWriteRFRegister(pAd, RF_R30, (UCHAR) RfReg);
RT30xxWriteRFRegister(pAd, RF_R30, (u8)RfReg);
RTMPusecDelay(1000);
RfReg &= 0x7F;
RT30xxWriteRFRegister(pAd, RF_R30, (UCHAR) RfReg);
RT30xxWriteRFRegister(pAd, RF_R30, (u8)RfReg);
/* init R24, R31 */
RT30xxWriteRFRegister(pAd, RF_R24, 0x0F);
......@@ -90,9 +90,9 @@ VOID NICInitRT3090RFRegisters(IN PRTMP_ADAPTER pAd)
}
/* Driver should set RF R6 bit6 on before calibration */
RT30xxReadRFRegister(pAd, RF_R06, (PUCHAR) & RfReg);
RT30xxReadRFRegister(pAd, RF_R06, (u8 *)& RfReg);
RfReg |= 0x40;
RT30xxWriteRFRegister(pAd, RF_R06, (UCHAR) RfReg);
RT30xxWriteRFRegister(pAd, RF_R06, (u8)RfReg);
/*For RF filter Calibration */
RTMPFilterCalibration(pAd);
......
......@@ -87,19 +87,19 @@ REG_PAIR RT30xx_RFRegTable[] = {
,
};
UCHAR NUM_RF_REG_PARMS = (sizeof(RT30xx_RFRegTable) / sizeof(REG_PAIR));
u8 NUM_RF_REG_PARMS = (sizeof(RT30xx_RFRegTable) / sizeof(REG_PAIR));
/* Antenna divesity use GPIO3 and EESK pin for control */
/* Antenna and EEPROM access are both using EESK pin, */
/* Therefor we should avoid accessing EESK at the same time */
/* Then restore antenna after EEPROM access */
/* The original name of this function is AsicSetRxAnt(), now change to */
/*VOID AsicSetRxAnt( */
VOID RT30xxSetRxAnt(IN PRTMP_ADAPTER pAd, IN UCHAR Ant)
/*void AsicSetRxAnt( */
void RT30xxSetRxAnt(IN PRTMP_ADAPTER pAd, u8 Ant)
{
UINT32 Value;
u32 Value;
#ifdef RTMP_MAC_PCI
UINT32 x;
u32 x;
#endif
if ((pAd->EepromAccess) ||
......@@ -159,11 +159,11 @@ VOID RT30xxSetRxAnt(IN PRTMP_ADAPTER pAd, IN UCHAR Ant)
========================================================================
*/
VOID RTMPFilterCalibration(IN PRTMP_ADAPTER pAd)
void RTMPFilterCalibration(IN PRTMP_ADAPTER pAd)
{
UCHAR R55x = 0, value, FilterTarget = 0x1E, BBPValue = 0;
UINT loop = 0, count = 0, loopcnt = 0, ReTry = 0;
UCHAR RF_R24_Value = 0;
u8 R55x = 0, value, FilterTarget = 0x1E, BBPValue = 0;
u32 loop = 0, count = 0, loopcnt = 0, ReTry = 0;
u8 RF_R24_Value = 0;
/* Give bbp filter initial value */
pAd->Mlme.CaliBW20RfR24 = 0x1F;
......@@ -263,10 +263,10 @@ VOID RTMPFilterCalibration(IN PRTMP_ADAPTER pAd)
if (loopcnt < 100) {
if (loop++ == 0) {
/*BandWidth = 20 MHz */
pAd->Mlme.CaliBW20RfR24 = (UCHAR) RF_R24_Value;
pAd->Mlme.CaliBW20RfR24 = (u8)RF_R24_Value;
} else {
/*BandWidth = 40 MHz */
pAd->Mlme.CaliBW40RfR24 = (UCHAR) RF_R24_Value;
pAd->Mlme.CaliBW40RfR24 = (u8)RF_R24_Value;
break;
}
} else
......@@ -306,9 +306,9 @@ VOID RTMPFilterCalibration(IN PRTMP_ADAPTER pAd)
==========================================================================
*/
VOID RT30xxLoadRFNormalModeSetup(IN PRTMP_ADAPTER pAd)
void RT30xxLoadRFNormalModeSetup(IN PRTMP_ADAPTER pAd)
{
UCHAR RFValue;
u8 RFValue;
/* RX0_PD & TX0_PD, RF R1 register Bit 2 & Bit 3 to 0 and RF_BLOCK_en,RX1_PD & TX1_PD, Bit0, Bit 4 & Bit5 to 1 */
RT30xxReadRFRegister(pAd, RF_R01, &RFValue);
......@@ -372,10 +372,10 @@ VOID RT30xxLoadRFNormalModeSetup(IN PRTMP_ADAPTER pAd)
==========================================================================
*/
VOID RT30xxLoadRFSleepModeSetup(IN PRTMP_ADAPTER pAd)
void RT30xxLoadRFSleepModeSetup(IN PRTMP_ADAPTER pAd)
{
UCHAR RFValue;
UINT32 MACValue;
u8 RFValue;
u32 MACValue;
#ifdef RTMP_MAC_USB
if (!IS_RT3572(pAd))
......@@ -428,10 +428,10 @@ VOID RT30xxLoadRFSleepModeSetup(IN PRTMP_ADAPTER pAd)
==========================================================================
*/
VOID RT30xxReverseRFSleepModeSetup(IN PRTMP_ADAPTER pAd)
void RT30xxReverseRFSleepModeSetup(IN PRTMP_ADAPTER pAd)
{
UCHAR RFValue;
UINT32 MACValue;
u8 RFValue;
u32 MACValue;
#ifdef RTMP_MAC_USB
if (!IS_RT3572(pAd))
......@@ -493,9 +493,9 @@ VOID RT30xxReverseRFSleepModeSetup(IN PRTMP_ADAPTER pAd)
/* end johnli */
VOID RT30xxHaltAction(IN PRTMP_ADAPTER pAd)
void RT30xxHaltAction(IN PRTMP_ADAPTER pAd)
{
UINT32 TxPinCfg = 0x00050F0F;
u32 TxPinCfg = 0x00050F0F;
/* */
/* Turn off LNA_PE or TRSW_POL */
......
......@@ -50,24 +50,24 @@
#define BAND_BOTH 2
typedef struct _CH_DESP {
UCHAR FirstChannel;
UCHAR NumOfCh;
CHAR MaxTxPwr; /* dBm */
UCHAR Geography; /* 0:out door, 1:in door, 2:both */
u8 FirstChannel;
u8 NumOfCh;
char MaxTxPwr; /* dBm */
u8 Geography; /* 0:out door, 1:in door, 2:both */
BOOLEAN DfsReq; /* Dfs require, 0: No, 1: yes. */
} CH_DESP, *PCH_DESP;
typedef struct _CH_REGION {
UCHAR CountReg[3];
UCHAR DfsType; /* 0: CE, 1: FCC, 2: JAP, 3:JAP_W53, JAP_W56 */
u8 CountReg[3];
u8 DfsType; /* 0: CE, 1: FCC, 2: JAP, 3:JAP_W53, JAP_W56 */
CH_DESP ChDesp[10];
} CH_REGION, *PCH_REGION;
extern CH_REGION ChRegion[];
typedef struct _CH_FREQ_MAP_ {
UINT16 channel;
UINT16 freqKHz;
u16 channel;
u16 freqKHz;
} CH_FREQ_MAP;
extern CH_FREQ_MAP CH_HZ_ID_MAP[];
......@@ -103,15 +103,15 @@ extern int CH_HZ_ID_MAP_NUM;
(_ch) = 1; \
}while(0)
VOID BuildChannelListEx(IN PRTMP_ADAPTER pAd);
void BuildChannelListEx(IN PRTMP_ADAPTER pAd);
VOID BuildBeaconChList(IN PRTMP_ADAPTER pAd,
OUT PUCHAR pBuf, OUT PULONG pBufLen);
void BuildBeaconChList(IN PRTMP_ADAPTER pAd,
u8 *pBuf, unsigned long *pBufLen);
VOID N_ChannelCheck(IN PRTMP_ADAPTER pAd);
void N_ChannelCheck(IN PRTMP_ADAPTER pAd);
VOID N_SetCenCh(IN PRTMP_ADAPTER pAd);
void N_SetCenCh(IN PRTMP_ADAPTER pAd);
UINT8 GetCuntryMaxTxPwr(IN PRTMP_ADAPTER pAd, IN UINT8 channel);
u8 GetCuntryMaxTxPwr(IN PRTMP_ADAPTER pAd, u8 channel);
#endif /* __CHLIST_H__ */
......@@ -39,7 +39,7 @@
#include "../rt_config.h"
#include "action.h"
static VOID ReservedAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem);
static void ReservedAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem);
/*
==========================================================================
......@@ -58,7 +58,7 @@ static VOID ReservedAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem);
MT2_CLS3ERR cls3err_action
==========================================================================
*/
VOID ActionStateMachineInit(IN PRTMP_ADAPTER pAd,
void ActionStateMachineInit(IN PRTMP_ADAPTER pAd,
IN STATE_MACHINE * S,
OUT STATE_MACHINE_FUNC Trans[])
{
......@@ -98,15 +98,15 @@ VOID ActionStateMachineInit(IN PRTMP_ADAPTER pAd,
(STATE_MACHINE_FUNC) MlmeInvalidAction);
}
VOID MlmeADDBAAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
void MlmeADDBAAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
{
MLME_ADDBA_REQ_STRUCT *pInfo;
UCHAR Addr[6];
PUCHAR pOutBuffer = NULL;
NDIS_STATUS NStatus;
ULONG Idx;
u8 Addr[6];
u8 *pOutBuffer = NULL;
int NStatus;
unsigned long Idx;
FRAME_ADDBA_REQ Frame;
ULONG FrameLen;
unsigned long FrameLen;
BA_ORI_ENTRY *pBAEntry = NULL;
pInfo = (MLME_ADDBA_REQ_STRUCT *) Elem->Msg;
......@@ -155,8 +155,8 @@ VOID MlmeADDBAAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
Frame.BaStartSeq.field.StartSeq =
pAd->MacTab.Content[pInfo->Wcid].TxSeq[pInfo->TID];
*(USHORT *) (&Frame.BaParm) =
cpu2le16(*(USHORT *) (&Frame.BaParm));
*(u16 *) (&Frame.BaParm) =
cpu2le16(*(u16 *) (&Frame.BaParm));
Frame.TimeOutValue = cpu2le16(Frame.TimeOutValue);
Frame.BaStartSeq.word = cpu2le16(Frame.BaStartSeq.word);
......@@ -188,15 +188,15 @@ VOID MlmeADDBAAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
==========================================================================
*/
VOID MlmeDELBAAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
void MlmeDELBAAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
{
MLME_DELBA_REQ_STRUCT *pInfo;
PUCHAR pOutBuffer = NULL;
PUCHAR pOutBuffer2 = NULL;
NDIS_STATUS NStatus;
ULONG Idx;
u8 *pOutBuffer = NULL;
u8 *pOutBuffer2 = NULL;
int NStatus;
unsigned long Idx;
FRAME_DELBA_REQ Frame;
ULONG FrameLen;
unsigned long FrameLen;
FRAME_BAR FrameBar;
pInfo = (MLME_DELBA_REQ_STRUCT *) Elem->Msg;
......@@ -264,8 +264,8 @@ VOID MlmeDELBAAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
Frame.DelbaParm.Initiator = pInfo->Initiator;
Frame.DelbaParm.TID = pInfo->TID;
Frame.ReasonCode = 39; /* Time Out */
*(USHORT *) (&Frame.DelbaParm) =
cpu2le16(*(USHORT *) (&Frame.DelbaParm));
*(u16 *) (&Frame.DelbaParm) =
cpu2le16(*(u16 *) (&Frame.DelbaParm));
Frame.ReasonCode = cpu2le16(Frame.ReasonCode);
MakeOutgoingFrame(pOutBuffer, &FrameLen,
......@@ -278,27 +278,27 @@ VOID MlmeDELBAAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
}
}
VOID MlmeQOSAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
void MlmeQOSAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
{
}
VOID MlmeDLSAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
void MlmeDLSAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
{
}
VOID MlmeInvalidAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
void MlmeInvalidAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
{
/*PUCHAR pOutBuffer = NULL; */
/*u8 * pOutBuffer = NULL; */
/*Return the receiving frame except the MSB of category filed set to 1. 7.3.1.11 */
}
VOID PeerQOSAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
void PeerQOSAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
{
}
VOID PeerBAAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
void PeerBAAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
{
UCHAR Action = Elem->Msg[LENGTH_802_11 + 1];
u8 Action = Elem->Msg[LENGTH_802_11 + 1];
switch (Action) {
case ADDBA_REQ:
......@@ -313,15 +313,15 @@ VOID PeerBAAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
}
}
VOID PeerPublicAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
void PeerPublicAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
{
if (Elem->Wcid >= MAX_LEN_OF_MAC_TABLE)
return;
}
static VOID ReservedAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
static void ReservedAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
{
UCHAR Category;
u8 Category;
if (Elem->MsgLen <= LENGTH_802_11) {
return;
......@@ -333,19 +333,19 @@ static VOID ReservedAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
hex_dump("Reserved Action Frame", &Elem->Msg[0], Elem->MsgLen);
}
VOID PeerRMAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
void PeerRMAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
{
return;
}
static VOID respond_ht_information_exchange_action(IN PRTMP_ADAPTER pAd,
static void respond_ht_information_exchange_action(IN PRTMP_ADAPTER pAd,
IN MLME_QUEUE_ELEM * Elem)
{
PUCHAR pOutBuffer = NULL;
NDIS_STATUS NStatus;
ULONG FrameLen;
u8 *pOutBuffer = NULL;
int NStatus;
unsigned long FrameLen;
FRAME_HT_INFO HTINFOframe, *pFrame;
UCHAR *pAddr;
u8 *pAddr;
/* 2. Always send back ADDBA Response */
NStatus = MlmeAllocateMemory(pAd, &pOutBuffer); /*Get an unused nonpaged memory */
......@@ -387,9 +387,9 @@ static VOID respond_ht_information_exchange_action(IN PRTMP_ADAPTER pAd,
MlmeFreeMemory(pAd, pOutBuffer);
}
VOID PeerHTAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
void PeerHTAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
{
UCHAR Action = Elem->Msg[LENGTH_802_11 + 1];
u8 Action = Elem->Msg[LENGTH_802_11 + 1];
if (Elem->Wcid >= MAX_LEN_OF_MAC_TABLE)
return;
......@@ -467,11 +467,11 @@ VOID PeerHTAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
FALSE , then continue indicaterx at this moment.
==========================================================================
*/
VOID ORIBATimerTimeout(IN PRTMP_ADAPTER pAd)
void ORIBATimerTimeout(IN PRTMP_ADAPTER pAd)
{
MAC_TABLE_ENTRY *pEntry;
INT i, total;
UCHAR TID;
int i, total;
u8 TID;
total = pAd->MacTab.Size * NUM_OF_TID;
......@@ -489,15 +489,15 @@ VOID ORIBATimerTimeout(IN PRTMP_ADAPTER pAd)
}
}
VOID SendRefreshBAR(IN PRTMP_ADAPTER pAd, IN MAC_TABLE_ENTRY * pEntry)
void SendRefreshBAR(IN PRTMP_ADAPTER pAd, IN MAC_TABLE_ENTRY * pEntry)
{
FRAME_BAR FrameBar;
ULONG FrameLen;
NDIS_STATUS NStatus;
PUCHAR pOutBuffer = NULL;
USHORT Sequence;
UCHAR i, TID;
USHORT idx;
unsigned long FrameLen;
int NStatus;
u8 *pOutBuffer = NULL;
u16 Sequence;
u8 i, TID;
u16 idx;
BA_ORI_ENTRY *pBAEntry;
for (i = 0; i < NUM_OF_TID; i++) {
......@@ -547,9 +547,9 @@ VOID SendRefreshBAR(IN PRTMP_ADAPTER pAd, IN MAC_TABLE_ENTRY * pEntry)
}
}
VOID ActHeaderInit(IN PRTMP_ADAPTER pAd,
void ActHeaderInit(IN PRTMP_ADAPTER pAd,
IN OUT PHEADER_802_11 pHdr80211,
IN PUCHAR Addr1, IN PUCHAR Addr2, IN PUCHAR Addr3)
u8 *Addr1, u8 *Addr2, u8 *Addr3)
{
NdisZeroMemory(pHdr80211, sizeof(HEADER_802_11));
pHdr80211->FC.Type = BTYPE_MGMT;
......@@ -560,8 +560,8 @@ VOID ActHeaderInit(IN PRTMP_ADAPTER pAd,
COPY_MAC_ADDR(pHdr80211->Addr3, Addr3);
}
VOID BarHeaderInit(IN PRTMP_ADAPTER pAd,
IN OUT PFRAME_BAR pCntlBar, IN PUCHAR pDA, IN PUCHAR pSA)
void BarHeaderInit(IN PRTMP_ADAPTER pAd,
IN OUT PFRAME_BAR pCntlBar, u8 *pDA, u8 *pSA)
{
NdisZeroMemory(pCntlBar, sizeof(FRAME_BAR));
pCntlBar->FC.Type = BTYPE_CNTL;
......@@ -591,11 +591,11 @@ VOID BarHeaderInit(IN PRTMP_ADAPTER pAd,
Return : None.
==========================================================================
*/
VOID InsertActField(IN PRTMP_ADAPTER pAd,
OUT PUCHAR pFrameBuf,
OUT PULONG pFrameLen, IN UINT8 Category, IN UINT8 ActCode)
void InsertActField(IN PRTMP_ADAPTER pAd,
u8 *pFrameBuf,
unsigned long *pFrameLen, u8 Category, u8 ActCode)
{
ULONG TempLen;
unsigned long TempLen;
MakeOutgoingFrame(pFrameBuf, &TempLen,
1, &Category, 1, &ActCode, END_OF_ARGS);
......
......@@ -40,16 +40,16 @@
#define __ACTION_H__
typedef struct PACKED __HT_INFO_OCTET {
UCHAR Request:1;
UCHAR Forty_MHz_Intolerant:1;
UCHAR STA_Channel_Width:1;
UCHAR Reserved:5;
u8 Request:1;
u8 Forty_MHz_Intolerant:1;
u8 STA_Channel_Width:1;
u8 Reserved:5;
} HT_INFORMATION_OCTET;
typedef struct PACKED __FRAME_HT_INFO {
HEADER_802_11 Hdr;
UCHAR Category;
UCHAR Action;
u8 Category;
u8 Action;
HT_INFORMATION_OCTET HT_Info;
} FRAME_HT_INFO, *PFRAME_HT_INFO;
......
......@@ -41,19 +41,19 @@
static void ba_mpdu_blk_free(PRTMP_ADAPTER pAd,
struct reordering_mpdu *mpdu_blk);
BA_ORI_ENTRY *BATableAllocOriEntry(IN PRTMP_ADAPTER pAd, OUT USHORT * Idx);
BA_ORI_ENTRY *BATableAllocOriEntry(IN PRTMP_ADAPTER pAd, u16 * Idx);
BA_REC_ENTRY *BATableAllocRecEntry(IN PRTMP_ADAPTER pAd, OUT USHORT * Idx);
BA_REC_ENTRY *BATableAllocRecEntry(IN PRTMP_ADAPTER pAd, u16 * Idx);
VOID BAOriSessionSetupTimeout(IN PVOID SystemSpecific1,
IN PVOID FunctionContext,
IN PVOID SystemSpecific2,
IN PVOID SystemSpecific3);
void BAOriSessionSetupTimeout(void *SystemSpecific1,
void *FunctionContext,
void *SystemSpecific2,
void *SystemSpecific3);
VOID BARecSessionIdleTimeout(IN PVOID SystemSpecific1,
IN PVOID FunctionContext,
IN PVOID SystemSpecific2,
IN PVOID SystemSpecific3);
void BARecSessionIdleTimeout(void *SystemSpecific1,
void *FunctionContext,
void *SystemSpecific2,
void *SystemSpecific3);
BUILD_TIMER_FUNCTION(BAOriSessionSetupTimeout);
BUILD_TIMER_FUNCTION(BARecSessionIdleTimeout);
......@@ -61,10 +61,10 @@ BUILD_TIMER_FUNCTION(BARecSessionIdleTimeout);
#define ANNOUNCE_REORDERING_PACKET(_pAd, _mpdu_blk) \
Announce_Reordering_Packet(_pAd, _mpdu_blk);
VOID BA_MaxWinSizeReasign(IN PRTMP_ADAPTER pAd,
IN MAC_TABLE_ENTRY * pEntryPeer, OUT UCHAR * pWinSize)
void BA_MaxWinSizeReasign(IN PRTMP_ADAPTER pAd,
IN MAC_TABLE_ENTRY * pEntryPeer, u8 * pWinSize)
{
UCHAR MaxSize;
u8 MaxSize;
if (pAd->MACVersion >= RALINK_2883_VERSION) /* 3*3 */
{
......@@ -232,7 +232,7 @@ void ba_reordering_resource_release(PRTMP_ADAPTER pAd)
BOOLEAN ba_reordering_resource_init(PRTMP_ADAPTER pAd, int num)
{
int i;
PUCHAR mem;
u8 *mem;
struct reordering_mpdu *mpdu_blk;
struct reordering_list *freelist;
......@@ -246,10 +246,10 @@ BOOLEAN ba_reordering_resource_init(PRTMP_ADAPTER pAd, int num)
DBGPRINT(RT_DEBUG_TRACE,
("Allocate %d memory for BA reordering\n",
(UINT32) (num * sizeof(struct reordering_mpdu))));
(u32)(num * sizeof(struct reordering_mpdu))));
/* allocate number of mpdu_blk memory */
os_alloc_mem(pAd, (PUCHAR *) & mem,
os_alloc_mem(pAd, (u8 **) & mem,
(num * sizeof(struct reordering_mpdu)));
pAd->mpdu_blk_pool.mem = mem;
......@@ -303,12 +303,12 @@ static void ba_mpdu_blk_free(PRTMP_ADAPTER pAd,
NdisReleaseSpinLock(&pAd->mpdu_blk_pool.lock);
}
static USHORT ba_indicate_reordering_mpdus_in_order(IN PRTMP_ADAPTER pAd,
static u16 ba_indicate_reordering_mpdus_in_order(IN PRTMP_ADAPTER pAd,
IN PBA_REC_ENTRY pBAEntry,
IN USHORT StartSeq)
u16 StartSeq)
{
struct reordering_mpdu *mpdu_blk;
USHORT LastIndSeq = RESET_RCV_SEQ;
u16 LastIndSeq = RESET_RCV_SEQ;
NdisAcquireSpinLock(&pBAEntry->RxReRingLock);
......@@ -336,7 +336,7 @@ static USHORT ba_indicate_reordering_mpdus_in_order(IN PRTMP_ADAPTER pAd,
static void ba_indicate_reordering_mpdus_le_seq(IN PRTMP_ADAPTER pAd,
IN PBA_REC_ENTRY pBAEntry,
IN USHORT Sequence)
u16 Sequence)
{
struct reordering_mpdu *mpdu_blk;
......@@ -383,9 +383,9 @@ static void ba_refresh_reordering_mpdus(IN PRTMP_ADAPTER pAd,
/*static */
void ba_flush_reordering_timeout_mpdus(IN PRTMP_ADAPTER pAd,
IN PBA_REC_ENTRY pBAEntry,
IN ULONG Now32)
unsigned long Now32)
{
USHORT Sequence;
u16 Sequence;
/* if ((RTMP_TIME_AFTER((unsigned long)Now32, (unsigned long)(pBAEntry->LastIndSeqAtTimer+REORDERING_PACKET_TIMEOUT)) && */
/* (pBAEntry->list.qlen > ((pBAEntry->BAWinSize*7)/8))) //|| */
......@@ -440,15 +440,15 @@ void ba_flush_reordering_timeout_mpdus(IN PRTMP_ADAPTER pAd,
* generate ADDBA request to
* set up BA agreement
*/
VOID BAOriSessionSetUp(IN PRTMP_ADAPTER pAd,
void BAOriSessionSetUp(IN PRTMP_ADAPTER pAd,
IN MAC_TABLE_ENTRY * pEntry,
IN UCHAR TID,
IN USHORT TimeOut,
IN ULONG DelayTime, IN BOOLEAN isForced)
u8 TID,
u16 TimeOut,
unsigned long DelayTime, IN BOOLEAN isForced)
{
/*MLME_ADDBA_REQ_STRUCT AddbaReq; */
BA_ORI_ENTRY *pBAEntry = NULL;
USHORT Idx;
u16 Idx;
BOOLEAN Cancelled;
if ((pAd->CommonCfg.BACapability.field.AutoBA != TRUE)
......@@ -506,16 +506,16 @@ VOID BAOriSessionSetUp(IN PRTMP_ADAPTER pAd,
RTMPSetTimer(&pBAEntry->ORIBATimer, DelayTime);
}
VOID BAOriSessionAdd(IN PRTMP_ADAPTER pAd,
void BAOriSessionAdd(IN PRTMP_ADAPTER pAd,
IN MAC_TABLE_ENTRY * pEntry, IN PFRAME_ADDBA_RSP pFrame)
{
BA_ORI_ENTRY *pBAEntry = NULL;
BOOLEAN Cancelled;
UCHAR TID;
USHORT Idx;
PUCHAR pOutBuffer2 = NULL;
NDIS_STATUS NStatus;
ULONG FrameLen;
u8 TID;
u16 Idx;
u8 *pOutBuffer2 = NULL;
int NStatus;
unsigned long FrameLen;
FRAME_BAR FrameBar;
TID = pFrame->BaParm.TID;
......@@ -526,7 +526,7 @@ VOID BAOriSessionAdd(IN PRTMP_ADAPTER pAd,
if ((Idx != 0) && (pBAEntry->TID == TID)
&& (pBAEntry->ORI_BA_Status == Originator_WaitRes)) {
pBAEntry->BAWinSize =
min(pBAEntry->BAWinSize, ((UCHAR) pFrame->BaParm.BufSize));
min(pBAEntry->BAWinSize, ((u8)pFrame->BaParm.BufSize));
BA_MaxWinSizeReasign(pAd, pEntry, &pBAEntry->BAWinSize);
pBAEntry->TimeOutValue = pFrame->TimeOutValue;
......@@ -577,11 +577,11 @@ BOOLEAN BARecSessionAdd(IN PRTMP_ADAPTER pAd,
BA_REC_ENTRY *pBAEntry = NULL;
BOOLEAN Status = TRUE;
BOOLEAN Cancelled;
USHORT Idx;
UCHAR TID;
UCHAR BAWinSize;
/*UINT32 Value; */
/*UINT offset; */
u16 Idx;
u8 TID;
u8 BAWinSize;
/*u32 Value; */
/*u32 offset; */
ASSERT(pEntry);
......@@ -589,8 +589,8 @@ BOOLEAN BARecSessionAdd(IN PRTMP_ADAPTER pAd,
TID = pFrame->BaParm.TID;
BAWinSize =
min(((UCHAR) pFrame->BaParm.BufSize),
(UCHAR) pAd->CommonCfg.BACapability.field.RxBAWinLimit);
min(((u8)pFrame->BaParm.BufSize),
(u8)pAd->CommonCfg.BACapability.field.RxBAWinLimit);
/* Intel patch */
if (BAWinSize == 0) {
......@@ -660,7 +660,7 @@ BOOLEAN BARecSessionAdd(IN PRTMP_ADAPTER pAd,
return (Status);
}
BA_REC_ENTRY *BATableAllocRecEntry(IN PRTMP_ADAPTER pAd, OUT USHORT * Idx)
BA_REC_ENTRY *BATableAllocRecEntry(IN PRTMP_ADAPTER pAd, u16 * Idx)
{
int i;
BA_REC_ENTRY *pBAEntry = NULL;
......@@ -690,7 +690,7 @@ BA_REC_ENTRY *BATableAllocRecEntry(IN PRTMP_ADAPTER pAd, OUT USHORT * Idx)
return pBAEntry;
}
BA_ORI_ENTRY *BATableAllocOriEntry(IN PRTMP_ADAPTER pAd, OUT USHORT * Idx)
BA_ORI_ENTRY *BATableAllocOriEntry(IN PRTMP_ADAPTER pAd, u16 * Idx)
{
int i;
BA_ORI_ENTRY *pBAEntry = NULL;
......@@ -718,7 +718,7 @@ BA_ORI_ENTRY *BATableAllocOriEntry(IN PRTMP_ADAPTER pAd, OUT USHORT * Idx)
return pBAEntry;
}
VOID BATableFreeOriEntry(IN PRTMP_ADAPTER pAd, IN ULONG Idx)
void BATableFreeOriEntry(IN PRTMP_ADAPTER pAd, unsigned long Idx)
{
BA_ORI_ENTRY *pBAEntry = NULL;
MAC_TABLE_ENTRY *pEntry;
......@@ -752,7 +752,7 @@ VOID BATableFreeOriEntry(IN PRTMP_ADAPTER pAd, IN ULONG Idx)
}
}
VOID BATableFreeRecEntry(IN PRTMP_ADAPTER pAd, IN ULONG Idx)
void BATableFreeRecEntry(IN PRTMP_ADAPTER pAd, unsigned long Idx)
{
BA_REC_ENTRY *pBAEntry = NULL;
MAC_TABLE_ENTRY *pEntry;
......@@ -777,12 +777,12 @@ VOID BATableFreeRecEntry(IN PRTMP_ADAPTER pAd, IN ULONG Idx)
}
}
VOID BAOriSessionTearDown(IN OUT PRTMP_ADAPTER pAd,
IN UCHAR Wcid,
IN UCHAR TID,
void BAOriSessionTearDown(IN OUT PRTMP_ADAPTER pAd,
u8 Wcid,
u8 TID,
IN BOOLEAN bPassive, IN BOOLEAN bForceSend)
{
ULONG Idx = 0;
unsigned long Idx = 0;
BA_ORI_ENTRY *pBAEntry;
BOOLEAN Cancelled;
......@@ -867,10 +867,10 @@ VOID BAOriSessionTearDown(IN OUT PRTMP_ADAPTER pAd,
}
}
VOID BARecSessionTearDown(IN OUT PRTMP_ADAPTER pAd,
IN UCHAR Wcid, IN UCHAR TID, IN BOOLEAN bPassive)
void BARecSessionTearDown(IN OUT PRTMP_ADAPTER pAd,
u8 Wcid, u8 TID, IN BOOLEAN bPassive)
{
ULONG Idx = 0;
unsigned long Idx = 0;
BA_REC_ENTRY *pBAEntry;
if (Wcid >= MAX_LEN_OF_MAC_TABLE) {
......@@ -897,8 +897,8 @@ VOID BARecSessionTearDown(IN OUT PRTMP_ADAPTER pAd,
&& (pBAEntry->REC_BA_Status == Recipient_Accept)) {
MLME_DELBA_REQ_STRUCT DelbaReq;
BOOLEAN Cancelled;
/*ULONG offset; */
/*UINT32 VALUE; */
/*unsigned long offset; */
/*u32 VALUE; */
RTMPCancelTimer(&pBAEntry->RECBATimer, &Cancelled);
......@@ -956,7 +956,7 @@ VOID BARecSessionTearDown(IN OUT PRTMP_ADAPTER pAd,
BATableFreeRecEntry(pAd, Idx);
}
VOID BASessionTearDownALL(IN OUT PRTMP_ADAPTER pAd, IN UCHAR Wcid)
void BASessionTearDownALL(IN OUT PRTMP_ADAPTER pAd, u8 Wcid)
{
int i;
......@@ -980,10 +980,10 @@ VOID BASessionTearDownALL(IN OUT PRTMP_ADAPTER pAd, IN UCHAR Wcid)
FALSE , then continue indicaterx at this moment.
==========================================================================
*/
VOID BAOriSessionSetupTimeout(IN PVOID SystemSpecific1,
IN PVOID FunctionContext,
IN PVOID SystemSpecific2,
IN PVOID SystemSpecific3)
void BAOriSessionSetupTimeout(void *SystemSpecific1,
void *FunctionContext,
void *SystemSpecific2,
void *SystemSpecific3)
{
BA_ORI_ENTRY *pBAEntry = (BA_ORI_ENTRY *) FunctionContext;
MAC_TABLE_ENTRY *pEntry;
......@@ -1008,14 +1008,14 @@ VOID BAOriSessionSetupTimeout(IN PVOID SystemSpecific1,
NdisZeroMemory(&AddbaReq, sizeof(AddbaReq));
COPY_MAC_ADDR(AddbaReq.pAddr, pEntry->Addr);
AddbaReq.Wcid = (UCHAR) (pEntry->Aid);
AddbaReq.Wcid = (u8)(pEntry->Aid);
AddbaReq.TID = pBAEntry->TID;
AddbaReq.BaBufSize =
pAd->CommonCfg.BACapability.field.RxBAWinLimit;
AddbaReq.TimeOutValue = 0;
AddbaReq.Token = pBAEntry->Token;
MlmeEnqueue(pAd, ACTION_STATE_MACHINE, MT2_MLME_ADD_BA_CATE,
sizeof(MLME_ADDBA_REQ_STRUCT), (PVOID) & AddbaReq);
sizeof(MLME_ADDBA_REQ_STRUCT), (void *)& AddbaReq);
RTMP_MLME_HANDLER(pAd);
DBGPRINT(RT_DEBUG_TRACE,
("BA Ori Session Timeout(%d) : Send ADD BA again\n",
......@@ -1042,14 +1042,14 @@ VOID BAOriSessionSetupTimeout(IN PVOID SystemSpecific1,
FALSE , then continue indicaterx at this moment.
==========================================================================
*/
VOID BARecSessionIdleTimeout(IN PVOID SystemSpecific1,
IN PVOID FunctionContext,
IN PVOID SystemSpecific2, IN PVOID SystemSpecific3)
void BARecSessionIdleTimeout(void *SystemSpecific1,
void *FunctionContext,
void *SystemSpecific2, void *SystemSpecific3)
{
BA_REC_ENTRY *pBAEntry = (BA_REC_ENTRY *) FunctionContext;
PRTMP_ADAPTER pAd;
ULONG Now32;
unsigned long Now32;
if (pBAEntry == NULL)
return;
......@@ -1070,19 +1070,19 @@ VOID BARecSessionIdleTimeout(IN PVOID SystemSpecific1,
}
}
VOID PeerAddBAReqAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
void PeerAddBAReqAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
{
/* 7.4.4.1 */
/*ULONG Idx; */
UCHAR Status = 1;
UCHAR pAddr[6];
/*unsigned long Idx; */
u8 Status = 1;
u8 pAddr[6];
FRAME_ADDBA_RSP ADDframe;
PUCHAR pOutBuffer = NULL;
NDIS_STATUS NStatus;
u8 *pOutBuffer = NULL;
int NStatus;
PFRAME_ADDBA_REQ pAddreqFrame = NULL;
/*UCHAR BufSize; */
ULONG FrameLen;
PULONG ptemp;
/*u8 BufSize; */
unsigned long FrameLen;
unsigned long *ptemp;
PMAC_TABLE_ENTRY pMacEntry;
DBGPRINT(RT_DEBUG_TRACE,
......@@ -1096,7 +1096,7 @@ VOID PeerAddBAReqAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
pMacEntry = &pAd->MacTab.Content[Elem->Wcid];
DBGPRINT(RT_DEBUG_TRACE, ("BA - PeerAddBAReqAction----> \n"));
ptemp = (PULONG) Elem->Msg;
ptemp = (unsigned long *)Elem->Msg;
/*DBGPRINT_RAW(RT_DEBUG_EMU, ("%08x:: %08x:: %08x:: %08x:: %08x:: %08x:: %08x:: %08x:: %08x\n", *(ptemp), *(ptemp+1), *(ptemp+2), *(ptemp+3), *(ptemp+4), *(ptemp+5), *(ptemp+6), *(ptemp+7), *(ptemp+8))); */
if (PeerAddBAReqActionSanity(pAd, Elem->Msg, Elem->MsgLen, pAddr)) {
......@@ -1151,15 +1151,15 @@ VOID PeerAddBAReqAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
ADDframe.BaParm.AMSDUSupported = 0;
ADDframe.BaParm.TID = pAddreqFrame->BaParm.TID;
ADDframe.BaParm.BufSize =
min(((UCHAR) pAddreqFrame->BaParm.BufSize),
(UCHAR) pAd->CommonCfg.BACapability.field.RxBAWinLimit);
min(((u8)pAddreqFrame->BaParm.BufSize),
(u8)pAd->CommonCfg.BACapability.field.RxBAWinLimit);
if (ADDframe.BaParm.BufSize == 0) {
ADDframe.BaParm.BufSize = 64;
}
ADDframe.TimeOutValue = 0; /*pAddreqFrame->TimeOutValue; */
*(USHORT *) (&ADDframe.BaParm) =
cpu2le16(*(USHORT *) (&ADDframe.BaParm));
*(u16 *) (&ADDframe.BaParm) =
cpu2le16(*(u16 *) (&ADDframe.BaParm));
ADDframe.StatusCode = cpu2le16(ADDframe.StatusCode);
ADDframe.TimeOutValue = cpu2le16(ADDframe.TimeOutValue);
......@@ -1173,10 +1173,10 @@ VOID PeerAddBAReqAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
ADDframe.BaParm.TID, ADDframe.BaParm.BufSize));
}
VOID PeerAddBARspAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
void PeerAddBARspAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
{
/*UCHAR Idx, i; */
/*PUCHAR pOutBuffer = NULL; */
/*u8 Idx, i; */
/*u8 * pOutBuffer = NULL; */
PFRAME_ADDBA_RSP pFrame = NULL;
/*PBA_ORI_ENTRY pBAEntry; */
......@@ -1216,10 +1216,10 @@ VOID PeerAddBARspAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
}
}
VOID PeerDelBAAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
void PeerDelBAAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
{
/*UCHAR Idx; */
/*PUCHAR pOutBuffer = NULL; */
/*u8 Idx; */
/*u8 * pOutBuffer = NULL; */
PFRAME_DELBA_REQ pDelFrame = NULL;
DBGPRINT(RT_DEBUG_TRACE, ("%s ==>\n", __func__));
......@@ -1244,23 +1244,23 @@ VOID PeerDelBAAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
}
BOOLEAN CntlEnqueueForRecv(IN PRTMP_ADAPTER pAd,
IN ULONG Wcid,
IN ULONG MsgLen, IN PFRAME_BA_REQ pMsg)
unsigned long Wcid,
unsigned long MsgLen, IN PFRAME_BA_REQ pMsg)
{
PFRAME_BA_REQ pFrame = pMsg;
/*PRTMP_REORDERBUF pBuffer; */
/*PRTMP_REORDERBUF pDmaBuf; */
PBA_REC_ENTRY pBAEntry;
/*BOOLEAN Result; */
ULONG Idx;
/*UCHAR NumRxPkt; */
UCHAR TID; /*, i; */
unsigned long Idx;
/*u8 NumRxPkt; */
u8 TID; /*, i; */
TID = (UCHAR) pFrame->BARControl.TID;
TID = (u8)pFrame->BARControl.TID;
DBGPRINT(RT_DEBUG_TRACE,
("%s(): BAR-Wcid(%ld), Tid (%d)\n", __func__, Wcid, TID));
/*hex_dump("BAR", (PCHAR) pFrame, MsgLen); */
/*hex_dump("BAR", (char *)pFrame, MsgLen); */
/* Do nothing if the driver is starting halt state. */
/* This might happen when timer already been fired before cancel timer with mlmehalt */
if (RTMP_TEST_FLAG
......@@ -1309,13 +1309,13 @@ BOOLEAN CntlEnqueueForRecv(IN PRTMP_ADAPTER pAd,
/*
Description : Send PSMP Action frame If PSMP mode switches.
*/
VOID SendPSMPAction(IN PRTMP_ADAPTER pAd, IN UCHAR Wcid, IN UCHAR Psmp)
void SendPSMPAction(IN PRTMP_ADAPTER pAd, u8 Wcid, u8 Psmp)
{
PUCHAR pOutBuffer = NULL;
NDIS_STATUS NStatus;
/*ULONG Idx; */
u8 *pOutBuffer = NULL;
int NStatus;
/*unsigned long Idx; */
FRAME_PSMP_ACTION Frame;
ULONG FrameLen;
unsigned long FrameLen;
NStatus = MlmeAllocateMemory(pAd, &pOutBuffer); /*Get an unused nonpaged memory */
if (NStatus != NDIS_STATUS_SUCCESS) {
......@@ -1364,32 +1364,32 @@ VOID SendPSMPAction(IN PRTMP_ADAPTER pAd, IN UCHAR Wcid, IN UCHAR Psmp)
#define RADIO_MEASUREMENT_REQUEST_ACTION 0
typedef struct PACKED {
UCHAR RegulatoryClass;
UCHAR ChannelNumber;
USHORT RandomInterval;
USHORT MeasurementDuration;
UCHAR MeasurementMode;
UCHAR BSSID[MAC_ADDR_LEN];
UCHAR ReportingCondition;
UCHAR Threshold;
UCHAR SSIDIE[2]; /* 2 byte */
u8 RegulatoryClass;
u8 ChannelNumber;
u16 RandomInterval;
u16 MeasurementDuration;
u8 MeasurementMode;
u8 BSSID[MAC_ADDR_LEN];
u8 ReportingCondition;
u8 Threshold;
u8 SSIDIE[2]; /* 2 byte */
} BEACON_REQUEST;
typedef struct PACKED {
UCHAR ID;
UCHAR Length;
UCHAR Token;
UCHAR RequestMode;
UCHAR Type;
u8 ID;
u8 Length;
u8 Token;
u8 RequestMode;
u8 Type;
} MEASUREMENT_REQ;
void convert_reordering_packet_to_preAMSDU_or_802_3_packet(IN PRTMP_ADAPTER pAd,
IN RX_BLK * pRxBlk,
IN UCHAR
u8
FromWhichBSSID)
{
PNDIS_PACKET pRxPkt;
UCHAR Header802_3[LENGTH_802_3];
u8 Header802_3[LENGTH_802_3];
/* 1. get 802.3 Header */
/* 2. remove LLC */
......@@ -1436,13 +1436,13 @@ void convert_reordering_packet_to_preAMSDU_or_802_3_packet(IN PRTMP_ADAPTER pAd,
} \
} while (0);
static VOID ba_enqueue_reordering_packet(IN PRTMP_ADAPTER pAd,
static void ba_enqueue_reordering_packet(IN PRTMP_ADAPTER pAd,
IN PBA_REC_ENTRY pBAEntry,
IN RX_BLK * pRxBlk,
IN UCHAR FromWhichBSSID)
u8 FromWhichBSSID)
{
struct reordering_mpdu *mpdu_blk;
UINT16 Sequence = (UINT16) pRxBlk->pHeader->Sequence;
u16 Sequence = (u16)pRxBlk->pHeader->Sequence;
mpdu_blk = ba_mpdu_blk_alloc(pAd);
if ((mpdu_blk != NULL) && (!RX_BLK_TEST_FLAG(pRxBlk, fRX_EAP))) {
......@@ -1515,15 +1515,15 @@ static VOID ba_enqueue_reordering_packet(IN PRTMP_ADAPTER pAd,
==========================================================================
*/
VOID Indicate_AMPDU_Packet(IN PRTMP_ADAPTER pAd,
IN RX_BLK * pRxBlk, IN UCHAR FromWhichBSSID)
void Indicate_AMPDU_Packet(IN PRTMP_ADAPTER pAd,
IN RX_BLK * pRxBlk, u8 FromWhichBSSID)
{
USHORT Idx;
u16 Idx;
PBA_REC_ENTRY pBAEntry = NULL;
UINT16 Sequence = pRxBlk->pHeader->Sequence;
ULONG Now32;
UCHAR Wcid = pRxBlk->pRxWI->WirelessCliID;
UCHAR TID = pRxBlk->pRxWI->TID;
u16 Sequence = pRxBlk->pHeader->Sequence;
unsigned long Now32;
u8 Wcid = pRxBlk->pRxWI->WirelessCliID;
u8 TID = pRxBlk->pRxWI->TID;
if (!RX_BLK_TEST_FLAG(pRxBlk, fRX_AMSDU)
&& (pRxBlk->DataSize > MAX_RX_PKT_LEN)) {
......@@ -1578,7 +1578,7 @@ VOID Indicate_AMPDU_Packet(IN PRTMP_ADAPTER pAd,
/* I. Check if in order. */
/* */
if (SEQ_STEPONE(Sequence, pBAEntry->LastIndSeq, MAXSEQ)) {
USHORT LastIndSeq;
u16 LastIndSeq;
pBAEntry->LastIndSeq = Sequence;
INDICATE_LEGACY_OR_AMSDU(pAd, pRxBlk, FromWhichBSSID);
......@@ -1624,7 +1624,7 @@ VOID Indicate_AMPDU_Packet(IN PRTMP_ADAPTER pAd,
/* V. Receive seq surpasses Win(lastseq + nMSDU). So refresh all reorder buffer */
/* */
else {
LONG WinStartSeq, TmpSeq;
long WinStartSeq, TmpSeq;
TmpSeq = Sequence - (pBAEntry->BAWinSize) - 1;
if (TmpSeq < 0) {
......
......@@ -38,8 +38,8 @@
#include "../rt_config.h"
typedef struct {
UINT32 erk[64]; /* encryption round keys */
UINT32 drk[64]; /* decryption round keys */
u32 erk[64]; /* encryption round keys */
u32 drk[64]; /* decryption round keys */
int nr; /* number of rounds */
} aes_context;
......@@ -47,7 +47,7 @@ typedef struct {
/******** SBOX Table *********/
/*****************************/
UCHAR SboxTable[256] = {
u8 SboxTable[256] = {
0x63, 0x7c, 0x77, 0x7b, 0xf2, 0x6b, 0x6f, 0xc5,
0x30, 0x01, 0x67, 0x2b, 0xfe, 0xd7, 0xab, 0x76,
0xca, 0x82, 0xc9, 0x7d, 0xfa, 0x59, 0x47, 0xf0,
......@@ -82,34 +82,34 @@ UCHAR SboxTable[256] = {
0x41, 0x99, 0x2d, 0x0f, 0xb0, 0x54, 0xbb, 0x16
};
VOID xor_32(IN PUCHAR a, IN PUCHAR b, OUT PUCHAR out)
void xor_32(u8 *a, u8 *b, u8 *out)
{
INT i;
int i;
for (i = 0; i < 4; i++) {
out[i] = a[i] ^ b[i];
}
}
VOID xor_128(IN PUCHAR a, IN PUCHAR b, OUT PUCHAR out)
void xor_128(u8 *a, u8 *b, u8 *out)
{
INT i;
int i;
for (i = 0; i < 16; i++) {
out[i] = a[i] ^ b[i];
}
}
UCHAR RTMPCkipSbox(IN UCHAR a)
u8 RTMPCkipSbox(u8 a)
{
return SboxTable[(int)a];
}
VOID next_key(IN PUCHAR key, IN INT round)
void next_key(u8 *key, int round)
{
UCHAR rcon;
UCHAR sbox_key[4];
UCHAR rcon_table[12] = {
u8 rcon;
u8 sbox_key[4];
u8 rcon_table[12] = {
0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80,
0x1b, 0x36, 0x36, 0x36
};
......@@ -129,9 +129,9 @@ VOID next_key(IN PUCHAR key, IN INT round)
xor_32(&key[12], &key[8], &key[12]);
}
VOID byte_sub(IN PUCHAR in, OUT PUCHAR out)
void byte_sub(u8 *in, u8 *out)
{
INT i;
int i;
for (i = 0; i < 16; i++) {
out[i] = RTMPCkipSbox(in[i]);
......@@ -151,7 +151,7 @@ void bitwise_xor(unsigned char *ina, unsigned char *inb, unsigned char *out)
}
}
VOID shift_row(IN PUCHAR in, OUT PUCHAR out)
void shift_row(u8 *in, u8 *out)
{
out[0] = in[0];
out[1] = in[5];
......@@ -171,17 +171,17 @@ VOID shift_row(IN PUCHAR in, OUT PUCHAR out)
out[15] = in[11];
}
VOID mix_column(IN PUCHAR in, OUT PUCHAR out)
void mix_column(u8 *in, u8 *out)
{
INT i;
UCHAR add1b[4];
UCHAR add1bf7[4];
UCHAR rotl[4];
UCHAR swap_halfs[4];
UCHAR andf7[4];
UCHAR rotr[4];
UCHAR temp[4];
UCHAR tempb[4];
int i;
u8 add1b[4];
u8 add1bf7[4];
u8 rotl[4];
u8 swap_halfs[4];
u8 andf7[4];
u8 rotr[4];
u8 temp[4];
u8 tempb[4];
for (i = 0; i < 4; i++) {
if ((in[i] & 0x80) == 0x80)
......@@ -409,40 +409,40 @@ void construct_ctr_preload(unsigned char *ctr_preload,
}
BOOLEAN RTMPSoftDecryptAES(IN PRTMP_ADAPTER pAd,
IN PUCHAR pData,
IN ULONG DataByteCnt, IN PCIPHER_KEY pWpaKey)
u8 *pData,
unsigned long DataByteCnt, IN PCIPHER_KEY pWpaKey)
{
UCHAR KeyID;
UINT HeaderLen;
UCHAR PN[6];
UINT payload_len;
UINT num_blocks;
UINT payload_remainder;
USHORT fc;
UCHAR fc0;
UCHAR fc1;
UINT frame_type;
UINT frame_subtype;
UINT from_ds;
UINT to_ds;
INT a4_exists;
INT qc_exists;
UCHAR aes_out[16];
u8 KeyID;
u32 HeaderLen;
u8 PN[6];
u32 payload_len;
u32 num_blocks;
u32 payload_remainder;
u16 fc;
u8 fc0;
u8 fc1;
u32 frame_type;
u32 frame_subtype;
u32 from_ds;
u32 to_ds;
int a4_exists;
int qc_exists;
u8 aes_out[16];
int payload_index;
UINT i;
UCHAR ctr_preload[16];
UCHAR chain_buffer[16];
UCHAR padded_buffer[16];
UCHAR mic_iv[16];
UCHAR mic_header1[16];
UCHAR mic_header2[16];
UCHAR MIC[8];
UCHAR TrailMIC[8];
u32 i;
u8 ctr_preload[16];
u8 chain_buffer[16];
u8 padded_buffer[16];
u8 mic_iv[16];
u8 mic_header1[16];
u8 mic_header2[16];
u8 MIC[8];
u8 TrailMIC[8];
fc0 = *pData;
fc1 = *(pData + 1);
fc = *((PUSHORT) pData);
fc = *((u16 *)pData);
frame_type = ((fc0 >> 2) & 0x03);
frame_subtype = ((fc0 >> 4) & 0x0f);
......@@ -460,7 +460,7 @@ BOOLEAN RTMPSoftDecryptAES(IN PRTMP_ADAPTER pAd,
if (a4_exists)
HeaderLen += 6;
KeyID = *((PUCHAR) (pData + HeaderLen + 3));
KeyID = *((u8 *)(pData + HeaderLen + 3));
KeyID = KeyID >> 6;
if (pWpaKey[KeyID].KeyLen == 0) {
......@@ -1202,16 +1202,16 @@ void rt_aes_decrypt(aes_context * ctx, uint8 input[16], uint8 output[16])
Return:
==========================================================================
*/
VOID AES_GTK_KEY_WRAP(IN UCHAR * key,
IN UCHAR * plaintext,
IN UINT32 p_len, OUT UCHAR * ciphertext)
void AES_GTK_KEY_WRAP(u8 * key,
u8 * plaintext,
u32 p_len, u8 * ciphertext)
{
UCHAR A[8], BIN[16], BOUT[16];
UCHAR R[512];
INT num_blocks = p_len / 8; /* unit:64bits */
INT i, j;
u8 A[8], BIN[16], BOUT[16];
u8 R[512];
int num_blocks = p_len / 8; /* unit:64bits */
int i, j;
aes_context aesctx;
UCHAR xor;
u8 xor;
rt_aes_set_key(&aesctx, key, 128);
......@@ -1264,18 +1264,18 @@ VOID AES_GTK_KEY_WRAP(IN UCHAR * key,
========================================================================
*/
VOID AES_GTK_KEY_UNWRAP(IN UCHAR * key,
OUT UCHAR * plaintext,
IN UINT32 c_len, IN UCHAR * ciphertext)
void AES_GTK_KEY_UNWRAP(u8 * key,
u8 * plaintext,
u32 c_len, u8 * ciphertext)
{
UCHAR A[8], BIN[16], BOUT[16];
UCHAR xor;
INT i, j;
u8 A[8], BIN[16], BOUT[16];
u8 xor;
int i, j;
aes_context aesctx;
UCHAR *R;
INT num_blocks = c_len / 8; /* unit:64bits */
u8 *R;
int num_blocks = c_len / 8; /* unit:64bits */
os_alloc_mem(NULL, (PUCHAR *) & R, 512);
os_alloc_mem(NULL, (u8 **) & R, 512);
if (R == NULL) {
DBGPRINT(RT_DEBUG_ERROR,
......
......@@ -80,10 +80,10 @@ char *GetBW(int BW)
TRUE if all parameters are OK, FALSE otherwise
==========================================================================
*/
INT RT_CfgSetCountryRegion(IN PRTMP_ADAPTER pAd, IN PSTRING arg, IN INT band)
int RT_CfgSetCountryRegion(IN PRTMP_ADAPTER pAd, char *arg, int band)
{
LONG region, regionMax;
UCHAR *pCountryRegion;
long region, regionMax;
u8 *pCountryRegion;
region = simple_strtol(arg, 0, 10);
......@@ -104,9 +104,9 @@ INT RT_CfgSetCountryRegion(IN PRTMP_ADAPTER pAd, IN PSTRING arg, IN INT band)
}
if ((region >= 0) && (region <= REGION_MAXIMUM_BG_BAND)) {
*pCountryRegion = (UCHAR) region;
*pCountryRegion = (u8)region;
} else if ((region == REGION_31_BG_BAND) && (band == BAND_24G)) {
*pCountryRegion = (UCHAR) region;
*pCountryRegion = (u8)region;
} else {
DBGPRINT(RT_DEBUG_ERROR,
("CfgSetCountryRegion():region(%ld) out of range!\n",
......@@ -126,10 +126,10 @@ INT RT_CfgSetCountryRegion(IN PRTMP_ADAPTER pAd, IN PSTRING arg, IN INT band)
TRUE if all parameters are OK, FALSE otherwise
==========================================================================
*/
INT RT_CfgSetWirelessMode(IN PRTMP_ADAPTER pAd, IN PSTRING arg)
int RT_CfgSetWirelessMode(IN PRTMP_ADAPTER pAd, char *arg)
{
INT MaxPhyMode = PHY_11G;
LONG WirelessMode;
int MaxPhyMode = PHY_11G;
long WirelessMode;
MaxPhyMode = PHY_11N_5G;
......@@ -143,9 +143,9 @@ INT RT_CfgSetWirelessMode(IN PRTMP_ADAPTER pAd, IN PSTRING arg)
}
INT RT_CfgSetShortSlot(IN PRTMP_ADAPTER pAd, IN PSTRING arg)
int RT_CfgSetShortSlot(IN PRTMP_ADAPTER pAd, char *arg)
{
LONG ShortSlot;
long ShortSlot;
ShortSlot = simple_strtol(arg, 0, 10);
......@@ -167,13 +167,13 @@ INT RT_CfgSetShortSlot(IN PRTMP_ADAPTER pAd, IN PSTRING arg)
TRUE if all parameters are OK, FALSE otherwise
==========================================================================
*/
INT RT_CfgSetWepKey(IN PRTMP_ADAPTER pAd,
IN PSTRING keyString,
IN CIPHER_KEY * pSharedKey, IN INT keyIdx)
int RT_CfgSetWepKey(IN PRTMP_ADAPTER pAd,
char *keyString,
IN CIPHER_KEY * pSharedKey, int keyIdx)
{
INT KeyLen;
INT i;
UCHAR CipherAlg = CIPHER_NONE;
int KeyLen;
int i;
u8 CipherAlg = CIPHER_NONE;
BOOLEAN bKeyIsHex = FALSE;
/* TODO: Shall we do memset for the original key info?? */
......@@ -230,13 +230,13 @@ INT RT_CfgSetWepKey(IN PRTMP_ADAPTER pAd,
TRUE if all parameters are OK, FALSE otherwise
==========================================================================
*/
INT RT_CfgSetWPAPSKKey(IN RTMP_ADAPTER * pAd,
IN PSTRING keyString,
IN UCHAR * pHashStr,
IN INT hashStrLen, OUT PUCHAR pPMKBuf)
int RT_CfgSetWPAPSKKey(IN RTMP_ADAPTER * pAd,
char *keyString,
u8 * pHashStr,
int hashStrLen, u8 *pPMKBuf)
{
int keyLen;
UCHAR keyMaterial[40];
u8 keyMaterial[40];
keyLen = strlen(keyString);
if ((keyLen < 8) || (keyLen > 64)) {
......
......@@ -32,24 +32,24 @@
*/
#include "../rt_config.h"
USHORT RtmpPCI_WriteTxResource(IN PRTMP_ADAPTER pAd,
u16 RtmpPCI_WriteTxResource(IN PRTMP_ADAPTER pAd,
IN TX_BLK * pTxBlk,
IN BOOLEAN bIsLast, OUT USHORT * FreeNumber)
IN BOOLEAN bIsLast, u16 * FreeNumber)
{
UCHAR *pDMAHeaderBufVA;
USHORT TxIdx, RetTxIdx;
u8 *pDMAHeaderBufVA;
u16 TxIdx, RetTxIdx;
PTXD_STRUC pTxD;
UINT32 BufBasePaLow;
u32 BufBasePaLow;
PRTMP_TX_RING pTxRing;
USHORT hwHeaderLen;
u16 hwHeaderLen;
/* */
/* get Tx Ring Resource */
/* */
pTxRing = &pAd->TxRing[pTxBlk->QueIdx];
TxIdx = pAd->TxRing[pTxBlk->QueIdx].TxCpuIdx;
pDMAHeaderBufVA = (PUCHAR) pTxRing->Cell[TxIdx].DmaBuf.AllocVa;
pDMAHeaderBufVA = (u8 *)pTxRing->Cell[TxIdx].DmaBuf.AllocVa;
BufBasePaLow =
RTMP_GetPhysicalAddressLow(pTxRing->Cell[TxIdx].DmaBuf.AllocPa);
......@@ -97,25 +97,25 @@ USHORT RtmpPCI_WriteTxResource(IN PRTMP_ADAPTER pAd,
return RetTxIdx;
}
USHORT RtmpPCI_WriteSingleTxResource(IN PRTMP_ADAPTER pAd,
u16 RtmpPCI_WriteSingleTxResource(IN PRTMP_ADAPTER pAd,
IN TX_BLK * pTxBlk,
IN BOOLEAN bIsLast,
OUT USHORT * FreeNumber)
u16 * FreeNumber)
{
UCHAR *pDMAHeaderBufVA;
USHORT TxIdx, RetTxIdx;
u8 *pDMAHeaderBufVA;
u16 TxIdx, RetTxIdx;
PTXD_STRUC pTxD;
UINT32 BufBasePaLow;
u32 BufBasePaLow;
PRTMP_TX_RING pTxRing;
USHORT hwHeaderLen;
u16 hwHeaderLen;
/* */
/* get Tx Ring Resource */
/* */
pTxRing = &pAd->TxRing[pTxBlk->QueIdx];
TxIdx = pAd->TxRing[pTxBlk->QueIdx].TxCpuIdx;
pDMAHeaderBufVA = (PUCHAR) pTxRing->Cell[TxIdx].DmaBuf.AllocVa;
pDMAHeaderBufVA = (u8 *)pTxRing->Cell[TxIdx].DmaBuf.AllocVa;
BufBasePaLow =
RTMP_GetPhysicalAddressLow(pTxRing->Cell[TxIdx].DmaBuf.AllocPa);
......@@ -156,18 +156,18 @@ USHORT RtmpPCI_WriteSingleTxResource(IN PRTMP_ADAPTER pAd,
return RetTxIdx;
}
USHORT RtmpPCI_WriteMultiTxResource(IN PRTMP_ADAPTER pAd,
u16 RtmpPCI_WriteMultiTxResource(IN PRTMP_ADAPTER pAd,
IN TX_BLK * pTxBlk,
IN UCHAR frameNum, OUT USHORT * FreeNumber)
u8 frameNum, u16 * FreeNumber)
{
BOOLEAN bIsLast;
UCHAR *pDMAHeaderBufVA;
USHORT TxIdx, RetTxIdx;
u8 *pDMAHeaderBufVA;
u16 TxIdx, RetTxIdx;
PTXD_STRUC pTxD;
UINT32 BufBasePaLow;
u32 BufBasePaLow;
PRTMP_TX_RING pTxRing;
USHORT hwHdrLen;
UINT32 firstDMALen;
u16 hwHdrLen;
u32 firstDMALen;
bIsLast = ((frameNum == (pTxBlk->TotalFrameNum - 1)) ? 1 : 0);
......@@ -176,7 +176,7 @@ USHORT RtmpPCI_WriteMultiTxResource(IN PRTMP_ADAPTER pAd,
/* */
pTxRing = &pAd->TxRing[pTxBlk->QueIdx];
TxIdx = pAd->TxRing[pTxBlk->QueIdx].TxCpuIdx;
pDMAHeaderBufVA = (PUCHAR) pTxRing->Cell[TxIdx].DmaBuf.AllocVa;
pDMAHeaderBufVA = (u8 *)pTxRing->Cell[TxIdx].DmaBuf.AllocVa;
BufBasePaLow =
RTMP_GetPhysicalAddressLow(pTxRing->Cell[TxIdx].DmaBuf.AllocPa);
......@@ -235,9 +235,9 @@ USHORT RtmpPCI_WriteMultiTxResource(IN PRTMP_ADAPTER pAd,
}
VOID RtmpPCI_FinalWriteTxResource(IN PRTMP_ADAPTER pAd,
void RtmpPCI_FinalWriteTxResource(IN PRTMP_ADAPTER pAd,
IN TX_BLK * pTxBlk,
IN USHORT totalMPDUSize, IN USHORT FirstTxIdx)
u16 totalMPDUSize, u16 FirstTxIdx)
{
PTXWI_STRUC pTxWI;
......@@ -252,8 +252,8 @@ VOID RtmpPCI_FinalWriteTxResource(IN PRTMP_ADAPTER pAd,
}
VOID RtmpPCIDataLastTxIdx(IN PRTMP_ADAPTER pAd,
IN UCHAR QueIdx, IN USHORT LastTxIdx)
void RtmpPCIDataLastTxIdx(IN PRTMP_ADAPTER pAd,
u8 QueIdx, u16 LastTxIdx)
{
PTXD_STRUC pTxD;
PRTMP_TX_RING pTxRing;
......@@ -272,24 +272,24 @@ VOID RtmpPCIDataLastTxIdx(IN PRTMP_ADAPTER pAd,
}
USHORT RtmpPCI_WriteFragTxResource(IN PRTMP_ADAPTER pAd,
u16 RtmpPCI_WriteFragTxResource(IN PRTMP_ADAPTER pAd,
IN TX_BLK * pTxBlk,
IN UCHAR fragNum, OUT USHORT * FreeNumber)
u8 fragNum, u16 * FreeNumber)
{
UCHAR *pDMAHeaderBufVA;
USHORT TxIdx, RetTxIdx;
u8 *pDMAHeaderBufVA;
u16 TxIdx, RetTxIdx;
PTXD_STRUC pTxD;
UINT32 BufBasePaLow;
u32 BufBasePaLow;
PRTMP_TX_RING pTxRing;
USHORT hwHeaderLen;
UINT32 firstDMALen;
u16 hwHeaderLen;
u32 firstDMALen;
/* */
/* Get Tx Ring Resource */
/* */
pTxRing = &pAd->TxRing[pTxBlk->QueIdx];
TxIdx = pAd->TxRing[pTxBlk->QueIdx].TxCpuIdx;
pDMAHeaderBufVA = (PUCHAR) pTxRing->Cell[TxIdx].DmaBuf.AllocVa;
pDMAHeaderBufVA = (u8 *)pTxRing->Cell[TxIdx].DmaBuf.AllocVa;
BufBasePaLow =
RTMP_GetPhysicalAddressLow(pTxRing->Cell[TxIdx].DmaBuf.AllocPa);
......@@ -342,12 +342,12 @@ USHORT RtmpPCI_WriteFragTxResource(IN PRTMP_ADAPTER pAd,
This function handle PCI specific TxDesc and cpu index update and kick the packet out.
*/
int RtmpPCIMgmtKickOut(IN RTMP_ADAPTER * pAd,
IN UCHAR QueIdx,
u8 QueIdx,
IN PNDIS_PACKET pPacket,
IN PUCHAR pSrcBufVA, IN UINT SrcBufLen)
u8 *pSrcBufVA, u32 SrcBufLen)
{
PTXD_STRUC pTxD;
ULONG SwIdx = pAd->MgmtRing.TxCpuIdx;
unsigned long SwIdx = pAd->MgmtRing.TxCpuIdx;
pTxD = (PTXD_STRUC) pAd->MgmtRing.Cell[SwIdx].AllocVa;
......@@ -405,17 +405,17 @@ int RtmpPCIMgmtKickOut(IN RTMP_ADAPTER * pAd,
========================================================================
*/
NDIS_STATUS RTMPCheckRxError(IN PRTMP_ADAPTER pAd,
int RTMPCheckRxError(IN PRTMP_ADAPTER pAd,
IN PHEADER_802_11 pHeader,
IN PRXWI_STRUC pRxWI, IN PRT28XX_RXD_STRUC pRxD)
{
PCIPHER_KEY pWpaKey;
INT dBm;
int dBm;
/* Phy errors & CRC errors */
if ( /*(pRxD->PhyErr) || */ (pRxD->Crc)) {
/* Check RSSI for Noise Hist statistic collection. */
dBm = (INT) (pRxWI->RSSI0) - pAd->BbpRssiToDbmDelta;
dBm = (int)(pRxWI->RSSI0) - pAd->BbpRssiToDbmDelta;
if (dBm <= -87)
pAd->StaCfg.RPIDensity[0] += 1;
else if (dBm <= -82)
......@@ -516,14 +516,14 @@ NDIS_STATUS RTMPCheckRxError(IN PRTMP_ADAPTER pAd,
return (NDIS_STATUS_SUCCESS);
}
BOOLEAN RTMPFreeTXDUponTxDmaDone(IN PRTMP_ADAPTER pAd, IN UCHAR QueIdx)
BOOLEAN RTMPFreeTXDUponTxDmaDone(IN PRTMP_ADAPTER pAd, u8 QueIdx)
{
PRTMP_TX_RING pTxRing;
PTXD_STRUC pTxD;
PNDIS_PACKET pPacket;
UCHAR FREE = 0;
u8 FREE = 0;
TXD_STRUC TxD, *pOriTxD;
/*ULONG IrqFlags; */
/*unsigned long IrqFlags; */
BOOLEAN bReschedule = FALSE;
ASSERT(QueIdx < NUM_OF_TX_RING);
......@@ -610,9 +610,9 @@ BOOLEAN RTMPFreeTXDUponTxDmaDone(IN PRTMP_ADAPTER pAd, IN UCHAR QueIdx)
========================================================================
*/
BOOLEAN RTMPHandleTxRingDmaDoneInterrupt(IN PRTMP_ADAPTER pAd,
IN INT_SOURCE_CSR_STRUC TxRingBitmap)
INT_SOURCE_CSR_STRUC TxRingBitmap)
{
/* UCHAR Count = 0; */
/* u8 Count = 0; */
unsigned long IrqFlags;
BOOLEAN bReschedule = FALSE;
......@@ -661,12 +661,12 @@ BOOLEAN RTMPHandleTxRingDmaDoneInterrupt(IN PRTMP_ADAPTER pAd,
========================================================================
*/
VOID RTMPHandleMgmtRingDmaDoneInterrupt(IN PRTMP_ADAPTER pAd)
void RTMPHandleMgmtRingDmaDoneInterrupt(IN PRTMP_ADAPTER pAd)
{
PTXD_STRUC pTxD;
PNDIS_PACKET pPacket;
/* int i; */
UCHAR FREE = 0;
u8 FREE = 0;
PRTMP_MGMT_RING pMgmtRing = &pAd->MgmtRing;
NdisAcquireSpinLock(&pAd->MgmtRingLock);
......@@ -713,7 +713,7 @@ VOID RTMPHandleMgmtRingDmaDoneInterrupt(IN PRTMP_ADAPTER pAd)
========================================================================
*/
VOID RTMPHandleTBTTInterrupt(IN PRTMP_ADAPTER pAd)
void RTMPHandleTBTTInterrupt(IN PRTMP_ADAPTER pAd)
{
{
if (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_DOZE)) {
......@@ -732,7 +732,7 @@ VOID RTMPHandleTBTTInterrupt(IN PRTMP_ADAPTER pAd)
========================================================================
*/
VOID RTMPHandlePreTBTTInterrupt(IN PRTMP_ADAPTER pAd)
void RTMPHandlePreTBTTInterrupt(IN PRTMP_ADAPTER pAd)
{
{
if (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_DOZE)) {
......@@ -743,7 +743,7 @@ VOID RTMPHandlePreTBTTInterrupt(IN PRTMP_ADAPTER pAd)
}
VOID RTMPHandleRxCoherentInterrupt(IN PRTMP_ADAPTER pAd)
void RTMPHandleRxCoherentInterrupt(IN PRTMP_ADAPTER pAd)
{
WPDMA_GLO_CFG_STRUC GloCfg;
......@@ -776,12 +776,12 @@ VOID RTMPHandleRxCoherentInterrupt(IN PRTMP_ADAPTER pAd)
PNDIS_PACKET GetPacketFromRxRing(IN PRTMP_ADAPTER pAd,
OUT PRT28XX_RXD_STRUC pSaveRxD,
OUT BOOLEAN * pbReschedule,
IN OUT UINT32 * pRxPending)
IN u32 * pRxPending)
{
PRXD_STRUC pRxD;
PNDIS_PACKET pRxPacket = NULL;
PNDIS_PACKET pNewPacket;
PVOID AllocVa;
void *AllocVa;
NDIS_PHYSICAL_ADDRESS AllocPa;
BOOLEAN bReschedule = FALSE;
RTMP_DMACB *pRxCell;
......@@ -864,23 +864,23 @@ PNDIS_PACKET GetPacketFromRxRing(IN PRTMP_ADAPTER pAd,
return pRxPacket;
}
NDIS_STATUS MlmeHardTransmitTxRing(IN PRTMP_ADAPTER pAd,
IN UCHAR QueIdx, IN PNDIS_PACKET pPacket)
int MlmeHardTransmitTxRing(IN PRTMP_ADAPTER pAd,
u8 QueIdx, IN PNDIS_PACKET pPacket)
{
PACKET_INFO PacketInfo;
PUCHAR pSrcBufVA;
UINT SrcBufLen;
u8 *pSrcBufVA;
u32 SrcBufLen;
PTXD_STRUC pTxD;
PHEADER_802_11 pHeader_802_11;
BOOLEAN bAckRequired, bInsertTimestamp;
ULONG SrcBufPA;
/*UCHAR TxBufIdx; */
UCHAR MlmeRate;
ULONG SwIdx = pAd->TxRing[QueIdx].TxCpuIdx;
unsigned long SrcBufPA;
/*u8 TxBufIdx; */
u8 MlmeRate;
unsigned long SwIdx = pAd->TxRing[QueIdx].TxCpuIdx;
PTXWI_STRUC pFirstTxWI;
/*ULONG i; */
/*unsigned long i; */
/*HTTRANSMIT_SETTING MlmeTransmit; //Rate for this MGMT frame. */
ULONG FreeNum;
unsigned long FreeNum;
MAC_TABLE_ENTRY *pMacEntry = NULL;
RTMP_QueryPacketInfo(pPacket, &PacketInfo, &pSrcBufVA, &SrcBufLen);
......@@ -1000,14 +1000,14 @@ NDIS_STATUS MlmeHardTransmitTxRing(IN PRTMP_ADAPTER pAd,
RTMPWriteTxWI(pAd, pFirstTxWI, FALSE, FALSE, bInsertTimestamp,
FALSE, bAckRequired, FALSE, 0, RESERVED_WCID,
(SrcBufLen - TXWI_SIZE), PID_MGMT, 0,
(UCHAR) pAd->CommonCfg.MlmeTransmit.field.MCS,
(u8)pAd->CommonCfg.MlmeTransmit.field.MCS,
IFS_BACKOFF, FALSE, &pAd->CommonCfg.MlmeTransmit);
} else {
RTMPWriteTxWI(pAd, pFirstTxWI, FALSE, FALSE,
bInsertTimestamp, FALSE, bAckRequired, FALSE,
0, pMacEntry->Aid, (SrcBufLen - TXWI_SIZE),
pMacEntry->MaxHTPhyMode.field.MCS, 0,
(UCHAR) pMacEntry->MaxHTPhyMode.field.MCS,
(u8)pMacEntry->MaxHTPhyMode.field.MCS,
IFS_BACKOFF, FALSE, &pMacEntry->MaxHTPhyMode);
}
......@@ -1040,8 +1040,8 @@ NDIS_STATUS MlmeHardTransmitTxRing(IN PRTMP_ADAPTER pAd,
return NDIS_STATUS_SUCCESS;
}
NDIS_STATUS MlmeDataHardTransmit(IN PRTMP_ADAPTER pAd,
IN UCHAR QueIdx, IN PNDIS_PACKET pPacket)
int MlmeDataHardTransmit(IN PRTMP_ADAPTER pAd,
u8 QueIdx, IN PNDIS_PACKET pPacket)
{
if ((pAd->CommonCfg.RadarDetect.RDMode != RD_NORMAL_MODE)
) {
......@@ -1078,9 +1078,9 @@ NDIS_STATUS MlmeDataHardTransmit(IN PRTMP_ADAPTER pAd,
========================================================================
*/
VOID RTMPWriteTxDescriptor(IN PRTMP_ADAPTER pAd,
void RTMPWriteTxDescriptor(IN PRTMP_ADAPTER pAd,
IN PTXD_STRUC pTxD,
IN BOOLEAN bWIV, IN UCHAR QueueSEL)
IN BOOLEAN bWIV, u8 QueueSEL)
{
/* */
/* Always use Long preamble before verifiation short preamble functionality works well. */
......
......@@ -46,16 +46,16 @@ Return Value:
None
========================================================================
*/
VOID HMAC_SHA1(IN const UINT8 Key[],
IN UINT KeyLen,
IN const UINT8 Message[],
IN UINT MessageLen, OUT UINT8 MAC[], IN UINT MACLen)
void HMAC_SHA1(IN const u8 Key[],
u32 KeyLen,
IN const u8 Message[],
u32 MessageLen, u8 MAC[], u32 MACLen)
{
SHA1_CTX_STRUC sha_ctx1;
SHA1_CTX_STRUC sha_ctx2;
UINT8 K0[SHA1_BLOCK_SIZE];
UINT8 Digest[SHA1_DIGEST_SIZE];
UINT index;
u8 K0[SHA1_BLOCK_SIZE];
u8 Digest[SHA1_DIGEST_SIZE];
u32 index;
NdisZeroMemory(&sha_ctx1, sizeof(SHA1_CTX_STRUC));
NdisZeroMemory(&sha_ctx2, sizeof(SHA1_CTX_STRUC));
......@@ -125,16 +125,16 @@ Return Value:
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));
......
......@@ -39,26 +39,26 @@
#define ROTL32(x,n) ROTL(x,n,32) /* 32 bits word */
#define ROUND1(a, b, c, d, x, s, ac) { \
(a) += F((b),(c),(d)) + (x) + (UINT32)(ac); \
(a) += F((b),(c),(d)) + (x) + (u32)(ac); \
(a) = ROTL32((a),(s)); \
(a) += (b); \
}
#define ROUND2(a, b, c, d, x, s, ac) { \
(a) += G((b),(c),(d)) + (x) + (UINT32)(ac); \
(a) += G((b),(c),(d)) + (x) + (u32)(ac); \
(a) = ROTL32((a),(s)); \
(a) += (b); \
}
#define ROUND3(a, b, c, d, x, s, ac) { \
(a) += H((b),(c),(d)) + (x) + (UINT32)(ac); \
(a) += H((b),(c),(d)) + (x) + (u32)(ac); \
(a) = ROTL32((a),(s)); \
(a) += (b); \
}
#define ROUND4(a, b, c, d, x, s, ac) { \
(a) += I((b),(c),(d)) + (x) + (UINT32)(ac); \
(a) += I((b),(c),(d)) + (x) + (u32)(ac); \
(a) = ROTL32((a),(s)); \
(a) += (b); \
}
static const UINT32 MD5_DefaultHashValue[4] = {
static const u32 MD5_DefaultHashValue[4] = {
0x67452301UL, 0xefcdab89UL, 0x98badcfeUL, 0x10325476UL
};
#endif /* MD5_SUPPORT */
......@@ -79,7 +79,7 @@ Return Value:
None
========================================================================
*/
VOID MD5_Init(IN MD5_CTX_STRUC * pMD5_CTX)
void MD5_Init(IN MD5_CTX_STRUC * pMD5_CTX)
{
NdisMoveMemory(pMD5_CTX->HashValue, MD5_DefaultHashValue,
sizeof(MD5_DefaultHashValue));
......@@ -103,11 +103,11 @@ Return Value:
T[i] := floor(abs(sin(i + 1)) * (2 pow 32)), i is number of round
========================================================================
*/
VOID MD5_Hash(IN MD5_CTX_STRUC * pMD5_CTX)
void MD5_Hash(IN MD5_CTX_STRUC * pMD5_CTX)
{
UINT32 X_i;
UINT32 X[16];
UINT32 a, b, c, d;
u32 X_i;
u32 X[16];
u32 a, b, c, d;
/* Prepare the message schedule, {X_i} */
NdisMoveMemory(X, pMD5_CTX->Block, MD5_BLOCK_SIZE);
......@@ -238,11 +238,11 @@ Return Value:
None
========================================================================
*/
VOID MD5_Append(IN MD5_CTX_STRUC * pMD5_CTX,
IN const UINT8 Message[], IN UINT MessageLen)
void MD5_Append(IN MD5_CTX_STRUC * pMD5_CTX,
IN const u8 Message[], u32 MessageLen)
{
UINT appendLen = 0;
UINT diffLen = 0;
u32 appendLen = 0;
u32 diffLen = 0;
while (appendLen != MessageLen) {
diffLen = MessageLen - appendLen;
......@@ -280,10 +280,10 @@ Return Value:
None
========================================================================
*/
VOID MD5_End(IN MD5_CTX_STRUC * pMD5_CTX, OUT UINT8 DigestMessage[])
void MD5_End(IN MD5_CTX_STRUC * pMD5_CTX, u8 DigestMessage[])
{
UINT index;
UINT64 message_length_bits;
u32 index;
u64 message_length_bits;
/* append 1 bits to end of the message */
NdisFillMemory(pMD5_CTX->Block + pMD5_CTX->BlockLen, 1, 0x80);
......@@ -299,7 +299,7 @@ VOID MD5_End(IN MD5_CTX_STRUC * pMD5_CTX, OUT UINT8 DigestMessage[])
NdisMoveMemory(&pMD5_CTX->Block[56], &message_length_bits, 8);
MD5_Hash(pMD5_CTX);
/* Return message digest, transform the UINT32 hash value to bytes */
/* Return message digest, transform the u32 hash value to bytes */
for (index = 0; index < 4; index++)
pMD5_CTX->HashValue[index] =
cpu2le32(pMD5_CTX->HashValue[index]);
......@@ -323,8 +323,8 @@ Return Value:
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;
......
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册