Commit 51126deb authored by Bartlomiej Zolnierkiewicz's avatar Bartlomiej Zolnierkiewicz Committed by Greg Kroah-Hartman

Staging: rt28x0: remove typedefs (part one)

Remove typedefs from rtmp_type.h.
Signed-off-by: default avatarBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 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 // */
......
This diff is collapsed.
......@@ -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;
......
This diff is collapsed.
......@@ -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,
......
This diff is collapsed.
......@@ -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)) {
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -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;
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment