mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-11 07:39:47 +00:00
Staging: rt28x0: remove typedefs (part one)
Remove typedefs from rtmp_type.h. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
parent
cc27706961
commit
51126deb20
@ -41,26 +41,26 @@
|
|||||||
#define __AP_H__
|
#define __AP_H__
|
||||||
|
|
||||||
/* ap_wpa.c */
|
/* ap_wpa.c */
|
||||||
VOID WpaStateMachineInit(IN PRTMP_ADAPTER pAd,
|
void WpaStateMachineInit(IN PRTMP_ADAPTER pAd,
|
||||||
IN STATE_MACHINE * Sm, OUT STATE_MACHINE_FUNC Trans[]);
|
IN STATE_MACHINE * Sm, OUT STATE_MACHINE_FUNC Trans[]);
|
||||||
|
|
||||||
#ifdef RTMP_MAC_USB
|
#ifdef RTMP_MAC_USB
|
||||||
VOID BeaconUpdateExec(IN PVOID SystemSpecific1,
|
void BeaconUpdateExec(void *SystemSpecific1,
|
||||||
IN PVOID FunctionContext,
|
void *FunctionContext,
|
||||||
IN PVOID SystemSpecific2, IN PVOID SystemSpecific3);
|
void *SystemSpecific2, void *SystemSpecific3);
|
||||||
#endif /* RTMP_MAC_USB // */
|
#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,
|
MAC_TABLE_ENTRY *MacTableInsertEntry(IN PRTMP_ADAPTER pAd,
|
||||||
IN PUCHAR pAddr,
|
u8 *pAddr,
|
||||||
IN UCHAR apidx, IN BOOLEAN CleanAll);
|
u8 apidx, IN BOOLEAN CleanAll);
|
||||||
|
|
||||||
BOOLEAN MacTableDeleteEntry(IN PRTMP_ADAPTER pAd,
|
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__ */
|
#endif /* __AP_H__ */
|
||||||
|
@ -71,24 +71,24 @@
|
|||||||
//
|
//
|
||||||
typedef struct PACKED _TXD_STRUC {
|
typedef struct PACKED _TXD_STRUC {
|
||||||
// Word 0
|
// Word 0
|
||||||
UINT32 SDPtr0;
|
u32 SDPtr0;
|
||||||
// Word 1
|
// Word 1
|
||||||
UINT32 SDLen1:14;
|
u32 SDLen1:14;
|
||||||
UINT32 LastSec1:1;
|
u32 LastSec1:1;
|
||||||
UINT32 Burst:1;
|
u32 Burst:1;
|
||||||
UINT32 SDLen0:14;
|
u32 SDLen0:14;
|
||||||
UINT32 LastSec0:1;
|
u32 LastSec0:1;
|
||||||
UINT32 DMADONE:1;
|
u32 DMADONE:1;
|
||||||
//Word2
|
//Word2
|
||||||
UINT32 SDPtr1;
|
u32 SDPtr1;
|
||||||
//Word3
|
//Word3
|
||||||
UINT32 rsv2:24;
|
u32 rsv2:24;
|
||||||
UINT32 WIV:1; // Wireless Info Valid. 1 if Driver already fill WI, o if DMA needs to copy WI to correctposition
|
u32 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
|
u32 QSEL:2; /* select on-chip FIFO ID for 2nd-stage output scheduler.0:MGMT, 1:HCCA 2:EDCA */
|
||||||
UINT32 rsv:2;
|
u32 rsv:2;
|
||||||
UINT32 TCO:1; //
|
u32 TCO:1; /* */
|
||||||
UINT32 UCO:1; //
|
u32 UCO:1; /* */
|
||||||
UINT32 ICO:1; //
|
u32 ICO:1; /* */
|
||||||
} TXD_STRUC, *PTXD_STRUC;
|
} TXD_STRUC, *PTXD_STRUC;
|
||||||
|
|
||||||
//
|
//
|
||||||
@ -96,47 +96,47 @@ typedef struct PACKED _TXD_STRUC {
|
|||||||
//
|
//
|
||||||
typedef struct PACKED _RXD_STRUC {
|
typedef struct PACKED _RXD_STRUC {
|
||||||
// Word 0
|
// Word 0
|
||||||
UINT32 SDP0;
|
u32 SDP0;
|
||||||
// Word 1
|
// Word 1
|
||||||
UINT32 SDL1:14;
|
u32 SDL1:14;
|
||||||
UINT32 Rsv:2;
|
u32 Rsv:2;
|
||||||
UINT32 SDL0:14;
|
u32 SDL0:14;
|
||||||
UINT32 LS0:1;
|
u32 LS0:1;
|
||||||
UINT32 DDONE:1;
|
u32 DDONE:1;
|
||||||
// Word 2
|
// Word 2
|
||||||
UINT32 SDP1;
|
u32 SDP1;
|
||||||
// Word 3
|
// Word 3
|
||||||
UINT32 BA:1;
|
u32 BA:1;
|
||||||
UINT32 DATA:1;
|
u32 DATA:1;
|
||||||
UINT32 NULLDATA:1;
|
u32 NULLDATA:1;
|
||||||
UINT32 FRAG:1;
|
u32 FRAG:1;
|
||||||
UINT32 U2M:1; // 1: this RX frame is unicast to me
|
u32 U2M:1; /* 1: this RX frame is unicast to me */
|
||||||
UINT32 Mcast:1; // 1: this is a multicast frame
|
u32 Mcast:1; /* 1: this is a multicast frame */
|
||||||
UINT32 Bcast:1; // 1: this is a broadcast frame
|
u32 Bcast:1; /* 1: this is a broadcast frame */
|
||||||
UINT32 MyBss:1; // 1: this frame belongs to the same BSSID
|
u32 MyBss:1; /* 1: this frame belongs to the same BSSID */
|
||||||
UINT32 Crc:1; // 1: CRC error
|
u32 Crc:1; /* 1: CRC error */
|
||||||
UINT32 CipherErr:2; // 0: decryption okay, 1:ICV error, 2:MIC error, 3:KEY not valid
|
u32 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.
|
u32 AMSDU:1; /* rx with 802.3 header, not 802.11 header. */
|
||||||
UINT32 HTC:1;
|
u32 HTC:1;
|
||||||
UINT32 RSSI:1;
|
u32 RSSI:1;
|
||||||
UINT32 L2PAD:1;
|
u32 L2PAD:1;
|
||||||
UINT32 AMPDU:1;
|
u32 AMPDU:1;
|
||||||
UINT32 Decrypted:1; // this frame is being decrypted.
|
u32 Decrypted:1; /* this frame is being decrypted. */
|
||||||
UINT32 PlcpSignal:1; // To be moved
|
u32 PlcpSignal:1; /* To be moved */
|
||||||
UINT32 PlcpRssil:1; // To be moved
|
u32 PlcpRssil:1; /* To be moved */
|
||||||
UINT32 Rsv1:13;
|
u32 Rsv1:13;
|
||||||
} RXD_STRUC, *PRXD_STRUC, RT28XX_RXD_STRUC, *PRT28XX_RXD_STRUC;
|
} RXD_STRUC, *PRXD_STRUC, RT28XX_RXD_STRUC, *PRT28XX_RXD_STRUC;
|
||||||
|
|
||||||
typedef union _TX_ATTENUATION_CTRL_STRUC {
|
typedef union _TX_ATTENUATION_CTRL_STRUC {
|
||||||
struct {
|
struct {
|
||||||
ULONG RF_ISOLATION_ENABLE:1;
|
unsigned long RF_ISOLATION_ENABLE:1;
|
||||||
ULONG Reserve2:7;
|
unsigned long Reserve2:7;
|
||||||
ULONG PCIE_PHY_TX_ATTEN_VALUE:3;
|
unsigned long PCIE_PHY_TX_ATTEN_VALUE:3;
|
||||||
ULONG PCIE_PHY_TX_ATTEN_EN:1;
|
unsigned long PCIE_PHY_TX_ATTEN_EN:1;
|
||||||
ULONG Reserve1:20;
|
unsigned long Reserve1:20;
|
||||||
} field;
|
} field;
|
||||||
|
|
||||||
ULONG word;
|
unsigned long word;
|
||||||
} TX_ATTENUATION_CTRL_STRUC, *PTX_ATTENUATION_CTRL_STRUC;
|
} TX_ATTENUATION_CTRL_STRUC, *PTX_ATTENUATION_CTRL_STRUC;
|
||||||
|
|
||||||
/* ----------------- EEPROM Related MACRO ----------------- */
|
/* ----------------- EEPROM Related MACRO ----------------- */
|
||||||
@ -148,7 +148,7 @@ typedef union _TX_ATTENUATION_CTRL_STRUC {
|
|||||||
/* ----------------- Frimware Related MACRO ----------------- */
|
/* ----------------- Frimware Related MACRO ----------------- */
|
||||||
#define RTMP_WRITE_FIRMWARE(_pAd, _pFwImage, _FwLen) \
|
#define RTMP_WRITE_FIRMWARE(_pAd, _pFwImage, _FwLen) \
|
||||||
do{ \
|
do{ \
|
||||||
ULONG _i, _firm; \
|
unsigned long _i, _firm; \
|
||||||
RTMP_IO_WRITE32(_pAd, PBF_SYS_CTRL, 0x10000); \
|
RTMP_IO_WRITE32(_pAd, PBF_SYS_CTRL, 0x10000); \
|
||||||
\
|
\
|
||||||
for(_i=0; _i<_FwLen; _i+=4) \
|
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_STOP_DEQUEUE(pAd, QueIdx, irqFlags) do{}while(0)
|
||||||
|
|
||||||
#define RTMP_HAS_ENOUGH_FREE_DESC(pAd, pTxBlk, freeNum, pPacket) \
|
#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) \
|
#define RTMP_RELEASE_DESC_RESOURCE(pAd, QueIdx) \
|
||||||
do{}while(0)
|
do{}while(0)
|
||||||
|
|
||||||
@ -238,7 +238,7 @@ typedef union _TX_ATTENUATION_CTRL_STRUC {
|
|||||||
|
|
||||||
// remove Pair-wise key material from ASIC
|
// remove Pair-wise key material from ASIC
|
||||||
#define RTMP_STA_ENTRY_KEY_DEL(pAd, BssIdx, Wcid) \
|
#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
|
// add Client security information into ASIC WCID table and IVEIV table
|
||||||
#define RTMP_STA_SECURITY_INFO_ADD(pAd, apidx, KeyID, pEntry) \
|
#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
|
// Insert the BA bitmap to ASIC for the Wcid entry
|
||||||
#define RTMP_ADD_BA_SESSION_TO_ASIC(_pAd, _Aid, _TID) \
|
#define RTMP_ADD_BA_SESSION_TO_ASIC(_pAd, _Aid, _TID) \
|
||||||
do{ \
|
do{ \
|
||||||
UINT32 _Value = 0, _Offset; \
|
u32 _Value = 0, _Offset; \
|
||||||
_Offset = MAC_WCID_BASE + (_Aid) * HW_WCID_ENTRY_SIZE + 4; \
|
_Offset = MAC_WCID_BASE + (_Aid) * HW_WCID_ENTRY_SIZE + 4; \
|
||||||
RTMP_IO_READ32((_pAd), _Offset, &_Value);\
|
RTMP_IO_READ32((_pAd), _Offset, &_Value);\
|
||||||
_Value |= (0x10000<<(_TID)); \
|
_Value |= (0x10000<<(_TID)); \
|
||||||
@ -271,7 +271,7 @@ typedef union _TX_ATTENUATION_CTRL_STRUC {
|
|||||||
// bitmap field starts at 0x10000 in ASIC WCID table
|
// bitmap field starts at 0x10000 in ASIC WCID table
|
||||||
#define RTMP_DEL_BA_SESSION_FROM_ASIC(_pAd, _Wcid, _TID) \
|
#define RTMP_DEL_BA_SESSION_FROM_ASIC(_pAd, _Wcid, _TID) \
|
||||||
do{ \
|
do{ \
|
||||||
UINT32 _Value = 0, _Offset; \
|
u32 _Value = 0, _Offset; \
|
||||||
_Offset = MAC_WCID_BASE + (_Wcid) * HW_WCID_ENTRY_SIZE + 4; \
|
_Offset = MAC_WCID_BASE + (_Wcid) * HW_WCID_ENTRY_SIZE + 4; \
|
||||||
RTMP_IO_READ32((_pAd), _Offset, &_Value); \
|
RTMP_IO_READ32((_pAd), _Offset, &_Value); \
|
||||||
_Value &= (~(0x10000 << (_TID))); \
|
_Value &= (~(0x10000 << (_TID))); \
|
||||||
|
@ -62,26 +62,26 @@
|
|||||||
#define RT2870_RXDMALEN_FIELD_SIZE 4
|
#define RT2870_RXDMALEN_FIELD_SIZE 4
|
||||||
|
|
||||||
typedef struct PACKED _RXINFO_STRUC {
|
typedef struct PACKED _RXINFO_STRUC {
|
||||||
UINT32 BA:1;
|
u32 BA:1;
|
||||||
UINT32 DATA:1;
|
u32 DATA:1;
|
||||||
UINT32 NULLDATA:1;
|
u32 NULLDATA:1;
|
||||||
UINT32 FRAG:1;
|
u32 FRAG:1;
|
||||||
UINT32 U2M:1; /* 1: this RX frame is unicast to me */
|
u32 U2M:1; /* 1: this RX frame is unicast to me */
|
||||||
UINT32 Mcast:1; /* 1: this is a multicast frame */
|
u32 Mcast:1; /* 1: this is a multicast frame */
|
||||||
UINT32 Bcast:1; /* 1: this is a broadcast frame */
|
u32 Bcast:1; /* 1: this is a broadcast frame */
|
||||||
UINT32 MyBss:1; /* 1: this frame belongs to the same BSSID */
|
u32 MyBss:1; /* 1: this frame belongs to the same BSSID */
|
||||||
UINT32 Crc:1; /* 1: CRC error */
|
u32 Crc:1; /* 1: CRC error */
|
||||||
UINT32 CipherErr:2; /* 0: decryption okay, 1:ICV error, 2:MIC error, 3:KEY not valid */
|
u32 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. */
|
u32 AMSDU:1; /* rx with 802.3 header, not 802.11 header. */
|
||||||
UINT32 HTC:1;
|
u32 HTC:1;
|
||||||
UINT32 RSSI:1;
|
u32 RSSI:1;
|
||||||
UINT32 L2PAD:1;
|
u32 L2PAD:1;
|
||||||
UINT32 AMPDU:1; /* To be moved */
|
u32 AMPDU:1; /* To be moved */
|
||||||
UINT32 Decrypted:1;
|
u32 Decrypted:1;
|
||||||
UINT32 PlcpRssil:1;
|
u32 PlcpRssil:1;
|
||||||
UINT32 CipherAlg:1;
|
u32 CipherAlg:1;
|
||||||
UINT32 LastAMSDU:1;
|
u32 LastAMSDU:1;
|
||||||
UINT32 PlcpSignal:12;
|
u32 PlcpSignal:12;
|
||||||
} RXINFO_STRUC, *PRXINFO_STRUC, RT28XX_RXD_STRUC, *PRT28XX_RXD_STRUC;
|
} RXINFO_STRUC, *PRXINFO_STRUC, RT28XX_RXD_STRUC, *PRT28XX_RXD_STRUC;
|
||||||
|
|
||||||
/* */
|
/* */
|
||||||
@ -91,14 +91,14 @@ typedef struct PACKED _RXINFO_STRUC {
|
|||||||
|
|
||||||
typedef struct _TXINFO_STRUC {
|
typedef struct _TXINFO_STRUC {
|
||||||
/* Word 0 */
|
/* Word 0 */
|
||||||
UINT32 USBDMATxPktLen:16; /*used ONLY in USB bulk Aggregation, Total byte counts of all sub-frame. */
|
u32 USBDMATxPktLen:16; /*used ONLY in USB bulk Aggregation, Total byte counts of all sub-frame. */
|
||||||
UINT32 rsv:8;
|
u32 rsv:8;
|
||||||
UINT32 WIV:1; /* Wireless Info Valid. 1 if Driver already fill WI, o if DMA needs to copy WI to correctposition */
|
u32 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 */
|
u32 QSEL:2; /* select on-chip FIFO ID for 2nd-stage output scheduler.0:MGMT, 1:HCCA 2:EDCA */
|
||||||
UINT32 SwUseLastRound:1; /* Software use. */
|
u32 SwUseLastRound:1; /* Software use. */
|
||||||
UINT32 rsv2:2; /* Software use. */
|
u32 rsv2:2; /* Software use. */
|
||||||
UINT32 USBDMANextVLD:1; /*used ONLY in USB bulk Aggregation, NextValid */
|
u32 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 USBDMATxburst:1; /*used ONLY in USB bulk Aggre. Force USB DMA transmit frame from current selected endpoint */
|
||||||
} TXINFO_STRUC, *PTXINFO_STRUC;
|
} TXINFO_STRUC, *PTXINFO_STRUC;
|
||||||
|
|
||||||
/* */
|
/* */
|
||||||
@ -106,8 +106,8 @@ typedef struct _TXINFO_STRUC {
|
|||||||
/* */
|
/* */
|
||||||
typedef struct _MGMT_STRUC {
|
typedef struct _MGMT_STRUC {
|
||||||
BOOLEAN Valid;
|
BOOLEAN Valid;
|
||||||
PUCHAR pBuffer;
|
u8 *pBuffer;
|
||||||
ULONG Length;
|
unsigned long Length;
|
||||||
} MGMT_STRUC, *PMGMT_STRUC;
|
} MGMT_STRUC, *PMGMT_STRUC;
|
||||||
|
|
||||||
/*////////////////////////////////////////////////////////////////////////// */
|
/*////////////////////////////////////////////////////////////////////////// */
|
||||||
@ -115,69 +115,69 @@ typedef struct _MGMT_STRUC {
|
|||||||
/*////////////////////////////////////////////////////////////////////////// */
|
/*////////////////////////////////////////////////////////////////////////// */
|
||||||
typedef struct __TX_BUFFER {
|
typedef struct __TX_BUFFER {
|
||||||
union {
|
union {
|
||||||
UCHAR WirelessPacket[TX_BUFFER_NORMSIZE];
|
u8 WirelessPacket[TX_BUFFER_NORMSIZE];
|
||||||
HEADER_802_11 NullFrame;
|
HEADER_802_11 NullFrame;
|
||||||
PSPOLL_FRAME PsPollPacket;
|
PSPOLL_FRAME PsPollPacket;
|
||||||
RTS_FRAME RTSFrame;
|
RTS_FRAME RTSFrame;
|
||||||
} field;
|
} field;
|
||||||
UCHAR Aggregation[4]; /*Buffer for save Aggregation size. */
|
u8 Aggregation[4]; /*Buffer for save Aggregation size. */
|
||||||
} TX_BUFFER, *PTX_BUFFER;
|
} TX_BUFFER, *PTX_BUFFER;
|
||||||
|
|
||||||
typedef struct __HTTX_BUFFER {
|
typedef struct __HTTX_BUFFER {
|
||||||
union {
|
union {
|
||||||
UCHAR WirelessPacket[MAX_TXBULK_SIZE];
|
u8 WirelessPacket[MAX_TXBULK_SIZE];
|
||||||
HEADER_802_11 NullFrame;
|
HEADER_802_11 NullFrame;
|
||||||
PSPOLL_FRAME PsPollPacket;
|
PSPOLL_FRAME PsPollPacket;
|
||||||
RTS_FRAME RTSFrame;
|
RTS_FRAME RTSFrame;
|
||||||
} field;
|
} field;
|
||||||
UCHAR Aggregation[4]; /*Buffer for save Aggregation size. */
|
u8 Aggregation[4]; /*Buffer for save Aggregation size. */
|
||||||
} HTTX_BUFFER, *PHTTX_BUFFER;
|
} HTTX_BUFFER, *PHTTX_BUFFER;
|
||||||
|
|
||||||
/* used to track driver-generated write irps */
|
/* used to track driver-generated write irps */
|
||||||
typedef struct _TX_CONTEXT {
|
typedef struct _TX_CONTEXT {
|
||||||
PVOID pAd; /*Initialized in MiniportInitialize */
|
void *pAd; /*Initialized in MiniportInitialize */
|
||||||
PURB pUrb; /*Initialized in MiniportInitialize */
|
PURB pUrb; /*Initialized in MiniportInitialize */
|
||||||
PIRP pIrp; /*used to cancel pending bulk out. */
|
PIRP pIrp; /*used to cancel pending bulk out. */
|
||||||
/*Initialized in MiniportInitialize */
|
/*Initialized in MiniportInitialize */
|
||||||
PTX_BUFFER TransferBuffer; /*Initialized in MiniportInitialize */
|
PTX_BUFFER TransferBuffer; /*Initialized in MiniportInitialize */
|
||||||
ULONG BulkOutSize;
|
unsigned long BulkOutSize;
|
||||||
UCHAR BulkOutPipeId;
|
u8 BulkOutPipeId;
|
||||||
UCHAR SelfIdx;
|
u8 SelfIdx;
|
||||||
BOOLEAN InUse;
|
BOOLEAN InUse;
|
||||||
BOOLEAN bWaitingBulkOut; /* at least one packet is in this TxContext, ready for making IRP anytime. */
|
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 bFullForBulkOut; /* all tx buffer are full , so waiting for tx bulkout. */
|
||||||
BOOLEAN IRPPending;
|
BOOLEAN IRPPending;
|
||||||
BOOLEAN LastOne;
|
BOOLEAN LastOne;
|
||||||
BOOLEAN bAggregatible;
|
BOOLEAN bAggregatible;
|
||||||
UCHAR Header_802_3[LENGTH_802_3];
|
u8 Header_802_3[LENGTH_802_3];
|
||||||
UCHAR Rsv[2];
|
u8 Rsv[2];
|
||||||
ULONG DataOffset;
|
unsigned long DataOffset;
|
||||||
UINT TxRate;
|
u32 TxRate;
|
||||||
dma_addr_t data_dma; /* urb dma on linux */
|
dma_addr_t data_dma; /* urb dma on linux */
|
||||||
|
|
||||||
} TX_CONTEXT, *PTX_CONTEXT, **PPTX_CONTEXT;
|
} TX_CONTEXT, *PTX_CONTEXT, **PPTX_CONTEXT;
|
||||||
|
|
||||||
/* used to track driver-generated write irps */
|
/* used to track driver-generated write irps */
|
||||||
typedef struct _HT_TX_CONTEXT {
|
typedef struct _HT_TX_CONTEXT {
|
||||||
PVOID pAd; /*Initialized in MiniportInitialize */
|
void *pAd; /*Initialized in MiniportInitialize */
|
||||||
PURB pUrb; /*Initialized in MiniportInitialize */
|
PURB pUrb; /*Initialized in MiniportInitialize */
|
||||||
PIRP pIrp; /*used to cancel pending bulk out. */
|
PIRP pIrp; /*used to cancel pending bulk out. */
|
||||||
/*Initialized in MiniportInitialize */
|
/*Initialized in MiniportInitialize */
|
||||||
PHTTX_BUFFER TransferBuffer; /*Initialized in MiniportInitialize */
|
PHTTX_BUFFER TransferBuffer; /*Initialized in MiniportInitialize */
|
||||||
ULONG BulkOutSize; /* Indicate the total bulk-out size in bytes in one bulk-transmission */
|
unsigned long BulkOutSize; /* Indicate the total bulk-out size in bytes in one bulk-transmission */
|
||||||
UCHAR BulkOutPipeId;
|
u8 BulkOutPipeId;
|
||||||
BOOLEAN IRPPending;
|
BOOLEAN IRPPending;
|
||||||
BOOLEAN LastOne;
|
BOOLEAN LastOne;
|
||||||
BOOLEAN bCurWriting;
|
BOOLEAN bCurWriting;
|
||||||
BOOLEAN bRingEmpty;
|
BOOLEAN bRingEmpty;
|
||||||
BOOLEAN bCopySavePad;
|
BOOLEAN bCopySavePad;
|
||||||
UCHAR SavedPad[8];
|
u8 SavedPad[8];
|
||||||
UCHAR Header_802_3[LENGTH_802_3];
|
u8 Header_802_3[LENGTH_802_3];
|
||||||
ULONG CurWritePosition; /* Indicate the buffer offset which packet will be inserted start from. */
|
unsigned long CurWritePosition; /* Indicate the buffer offset which packet will be inserted start from. */
|
||||||
ULONG CurWriteRealPos; /* Indicate the buffer offset which packet now are writing to. */
|
unsigned long CurWriteRealPos; /* Indicate the buffer offset which packet now are writing to. */
|
||||||
ULONG NextBulkOutPosition; /* Indicate the buffer start offset of a bulk-transmission */
|
unsigned long NextBulkOutPosition; /* Indicate the buffer start offset of a bulk-transmission */
|
||||||
ULONG ENextBulkOutPosition; /* Indicate the buffer end offset of a bulk-transmission */
|
unsigned long ENextBulkOutPosition; /* Indicate the buffer end offset of a bulk-transmission */
|
||||||
UINT TxRate;
|
u32 TxRate;
|
||||||
dma_addr_t data_dma; /* urb dma on linux */
|
dma_addr_t data_dma; /* urb dma on linux */
|
||||||
} HT_TX_CONTEXT, *PHT_TX_CONTEXT, **PPHT_TX_CONTEXT;
|
} HT_TX_CONTEXT, *PHT_TX_CONTEXT, **PPHT_TX_CONTEXT;
|
||||||
|
|
||||||
@ -186,12 +186,12 @@ typedef struct _HT_TX_CONTEXT {
|
|||||||
/* receive data to the protocol. */
|
/* receive data to the protocol. */
|
||||||
/* */
|
/* */
|
||||||
typedef struct _RX_CONTEXT {
|
typedef struct _RX_CONTEXT {
|
||||||
PUCHAR TransferBuffer;
|
u8 *TransferBuffer;
|
||||||
PVOID pAd;
|
void *pAd;
|
||||||
PIRP pIrp; /*used to cancel pending bulk in. */
|
PIRP pIrp; /*used to cancel pending bulk in. */
|
||||||
PURB pUrb;
|
PURB pUrb;
|
||||||
/*These 2 Boolean shouldn't both be 1 at the same time. */
|
/*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 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 bRxHandling; /* Notify this packet is being process now. */
|
||||||
BOOLEAN InUse; /* USB Hardware Occupied. Wait for USB HW to put packet. */
|
BOOLEAN InUse; /* USB Hardware Occupied. Wait for USB HW to put packet. */
|
||||||
@ -332,9 +332,9 @@ typedef struct _RX_CONTEXT {
|
|||||||
MlmeSetPsmBit(_pAd, _val);\
|
MlmeSetPsmBit(_pAd, _val);\
|
||||||
else \
|
else \
|
||||||
{ \
|
{ \
|
||||||
USHORT _psm_val; \
|
u16 _psm_val; \
|
||||||
_psm_val = _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
|
#ifdef RT30xx
|
||||||
|
|
||||||
extern REG_PAIR RT30xx_RFRegTable[];
|
extern REG_PAIR RT30xx_RFRegTable[];
|
||||||
extern UCHAR NUM_RF_REG_PARMS;
|
extern u8 NUM_RF_REG_PARMS;
|
||||||
|
|
||||||
#endif /* RT30xx // */
|
#endif /* RT30xx // */
|
||||||
|
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -180,7 +180,7 @@
|
|||||||
if ((_A)->bPCIclkOff == FALSE) \
|
if ((_A)->bPCIclkOff == FALSE) \
|
||||||
{ \
|
{ \
|
||||||
PHY_CSR4_STRUC _value; \
|
PHY_CSR4_STRUC _value; \
|
||||||
ULONG _busyCnt = 0; \
|
unsigned long _busyCnt = 0; \
|
||||||
\
|
\
|
||||||
do { \
|
do { \
|
||||||
RTMP_IO_READ32((_A), RF_CSR_CFG0, &_value.word); \
|
RTMP_IO_READ32((_A), RF_CSR_CFG0, &_value.word); \
|
||||||
@ -248,7 +248,7 @@
|
|||||||
if ((BbpCsr.field.Busy == IDLE) && \
|
if ((BbpCsr.field.Busy == IDLE) && \
|
||||||
(BbpCsr.field.RegNum == _bbpID)) \
|
(BbpCsr.field.RegNum == _bbpID)) \
|
||||||
{ \
|
{ \
|
||||||
*(_pV) = (UCHAR)BbpCsr.field.Value; \
|
*(_pV) = (u8)BbpCsr.field.Value; \
|
||||||
break; \
|
break; \
|
||||||
} \
|
} \
|
||||||
} \
|
} \
|
||||||
@ -313,7 +313,7 @@
|
|||||||
if ((BbpCsr.field.Busy == IDLE) && \
|
if ((BbpCsr.field.Busy == IDLE) && \
|
||||||
(BbpCsr.field.RegNum == _I)) \
|
(BbpCsr.field.RegNum == _I)) \
|
||||||
{ \
|
{ \
|
||||||
*(_pV) = (UCHAR)BbpCsr.field.Value; \
|
*(_pV) = (u8)BbpCsr.field.Value; \
|
||||||
break; \
|
break; \
|
||||||
} \
|
} \
|
||||||
} \
|
} \
|
||||||
@ -351,7 +351,7 @@
|
|||||||
if ((BbpCsr.field.Busy == IDLE) && \
|
if ((BbpCsr.field.Busy == IDLE) && \
|
||||||
(BbpCsr.field.RegNum == _I)) \
|
(BbpCsr.field.RegNum == _I)) \
|
||||||
{ \
|
{ \
|
||||||
*(_pV) = (UCHAR)BbpCsr.field.Value; \
|
*(_pV) = (u8)BbpCsr.field.Value; \
|
||||||
break; \
|
break; \
|
||||||
} \
|
} \
|
||||||
} \
|
} \
|
||||||
@ -429,7 +429,7 @@
|
|||||||
#define RTMP_BBP_IO_WRITE8_BY_REG_ID(_A, _I, _V) \
|
#define RTMP_BBP_IO_WRITE8_BY_REG_ID(_A, _I, _V) \
|
||||||
{ \
|
{ \
|
||||||
BBP_CSR_CFG_STRUC BbpCsr; \
|
BBP_CSR_CFG_STRUC BbpCsr; \
|
||||||
INT BusyCnt = 0; \
|
int BusyCnt = 0; \
|
||||||
BOOLEAN brc; \
|
BOOLEAN brc; \
|
||||||
if (_I < MAX_NUM_OF_BBP_LATCH) \
|
if (_I < MAX_NUM_OF_BBP_LATCH) \
|
||||||
{ \
|
{ \
|
||||||
@ -523,8 +523,8 @@
|
|||||||
#ifdef RT30xx
|
#ifdef RT30xx
|
||||||
#define RTMP_ASIC_MMPS_DISABLE(_pAd) \
|
#define RTMP_ASIC_MMPS_DISABLE(_pAd) \
|
||||||
do{ \
|
do{ \
|
||||||
UINT32 _macData; \
|
u32 _macData; \
|
||||||
UCHAR _bbpData = 0; \
|
u8 _bbpData = 0; \
|
||||||
/* disable MMPS BBP control register */ \
|
/* disable MMPS BBP control register */ \
|
||||||
RTMP_BBP_IO_READ8_BY_REG_ID(_pAd, BBP_R3, &_bbpData); \
|
RTMP_BBP_IO_READ8_BY_REG_ID(_pAd, BBP_R3, &_bbpData); \
|
||||||
_bbpData &= ~(0x04); /*bit 2*/ \
|
_bbpData &= ~(0x04); /*bit 2*/ \
|
||||||
@ -538,8 +538,8 @@
|
|||||||
|
|
||||||
#define RTMP_ASIC_MMPS_ENABLE(_pAd) \
|
#define RTMP_ASIC_MMPS_ENABLE(_pAd) \
|
||||||
do{ \
|
do{ \
|
||||||
UINT32 _macData; \
|
u32 _macData; \
|
||||||
UCHAR _bbpData = 0; \
|
u8 _bbpData = 0; \
|
||||||
/* enable MMPS BBP control register */ \
|
/* enable MMPS BBP control register */ \
|
||||||
RTMP_BBP_IO_READ8_BY_REG_ID(_pAd, BBP_R3, &_bbpData); \
|
RTMP_BBP_IO_READ8_BY_REG_ID(_pAd, BBP_R3, &_bbpData); \
|
||||||
_bbpData |= (0x04); /*bit 2*/ \
|
_bbpData |= (0x04); /*bit 2*/ \
|
||||||
|
@ -43,25 +43,25 @@
|
|||||||
#error "You Should Enable compile flag RTMP_RF_RW_SUPPORT for this chip"
|
#error "You Should Enable compile flag RTMP_RF_RW_SUPPORT for this chip"
|
||||||
#endif /* RTMP_RF_RW_SUPPORT // */
|
#endif /* RTMP_RF_RW_SUPPORT // */
|
||||||
|
|
||||||
VOID NICInitRT3070RFRegisters(IN PRTMP_ADAPTER pAd)
|
void NICInitRT3070RFRegisters(IN PRTMP_ADAPTER pAd)
|
||||||
{
|
{
|
||||||
INT i;
|
int i;
|
||||||
UCHAR RFValue;
|
u8 RFValue;
|
||||||
|
|
||||||
/* Driver must read EEPROM to get RfIcType before initial RF registers */
|
/* Driver must read EEPROM to get RfIcType before initial RF registers */
|
||||||
/* Initialize RF register to default value */
|
/* Initialize RF register to default value */
|
||||||
if (IS_RT3070(pAd) || IS_RT3071(pAd)) {
|
if (IS_RT3070(pAd) || IS_RT3071(pAd)) {
|
||||||
/* Init RF calibration */
|
/* Init RF calibration */
|
||||||
/* Driver should toggle RF R30 bit7 before init RF registers */
|
/* Driver should toggle RF R30 bit7 before init RF registers */
|
||||||
UINT32 RfReg = 0;
|
u32 RfReg = 0;
|
||||||
UINT32 data;
|
u32 data;
|
||||||
|
|
||||||
RT30xxReadRFRegister(pAd, RF_R30, (PUCHAR) & RfReg);
|
RT30xxReadRFRegister(pAd, RF_R30, (u8 *)& RfReg);
|
||||||
RfReg |= 0x80;
|
RfReg |= 0x80;
|
||||||
RT30xxWriteRFRegister(pAd, RF_R30, (UCHAR) RfReg);
|
RT30xxWriteRFRegister(pAd, RF_R30, (u8)RfReg);
|
||||||
RTMPusecDelay(1000);
|
RTMPusecDelay(1000);
|
||||||
RfReg &= 0x7F;
|
RfReg &= 0x7F;
|
||||||
RT30xxWriteRFRegister(pAd, RF_R30, (UCHAR) RfReg);
|
RT30xxWriteRFRegister(pAd, RF_R30, (u8)RfReg);
|
||||||
|
|
||||||
/* Initialize RF register to default value */
|
/* Initialize RF register to default value */
|
||||||
for (i = 0; i < NUM_RF_REG_PARMS; i++) {
|
for (i = 0; i < NUM_RF_REG_PARMS; i++) {
|
||||||
@ -84,9 +84,9 @@ VOID NICInitRT3070RFRegisters(IN PRTMP_ADAPTER pAd)
|
|||||||
}
|
}
|
||||||
} else if (IS_RT3071(pAd)) {
|
} else if (IS_RT3071(pAd)) {
|
||||||
/* Driver should set RF R6 bit6 on before init RF registers */
|
/* 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;
|
RfReg |= 0x40;
|
||||||
RT30xxWriteRFRegister(pAd, RF_R06, (UCHAR) RfReg);
|
RT30xxWriteRFRegister(pAd, RF_R06, (u8)RfReg);
|
||||||
|
|
||||||
/* init R31 */
|
/* init R31 */
|
||||||
RT30xxWriteRFRegister(pAd, RF_R31, 0x14);
|
RT30xxWriteRFRegister(pAd, RF_R31, 0x14);
|
||||||
|
@ -43,22 +43,22 @@
|
|||||||
#error "You Should Enable compile flag RTMP_RF_RW_SUPPORT for this chip"
|
#error "You Should Enable compile flag RTMP_RF_RW_SUPPORT for this chip"
|
||||||
#endif /* RTMP_RF_RW_SUPPORT // */
|
#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 */
|
/* Driver must read EEPROM to get RfIcType before initial RF registers */
|
||||||
/* Initialize RF register to default value */
|
/* Initialize RF register to default value */
|
||||||
if (IS_RT3090(pAd)) {
|
if (IS_RT3090(pAd)) {
|
||||||
/* Init RF calibration */
|
/* Init RF calibration */
|
||||||
/* Driver should toggle RF R30 bit7 before init RF registers */
|
/* 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;
|
RfReg |= 0x80;
|
||||||
RT30xxWriteRFRegister(pAd, RF_R30, (UCHAR) RfReg);
|
RT30xxWriteRFRegister(pAd, RF_R30, (u8)RfReg);
|
||||||
RTMPusecDelay(1000);
|
RTMPusecDelay(1000);
|
||||||
RfReg &= 0x7F;
|
RfReg &= 0x7F;
|
||||||
RT30xxWriteRFRegister(pAd, RF_R30, (UCHAR) RfReg);
|
RT30xxWriteRFRegister(pAd, RF_R30, (u8)RfReg);
|
||||||
|
|
||||||
/* init R24, R31 */
|
/* init R24, R31 */
|
||||||
RT30xxWriteRFRegister(pAd, RF_R24, 0x0F);
|
RT30xxWriteRFRegister(pAd, RF_R24, 0x0F);
|
||||||
@ -90,9 +90,9 @@ VOID NICInitRT3090RFRegisters(IN PRTMP_ADAPTER pAd)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Driver should set RF R6 bit6 on before calibration */
|
/* Driver should set RF R6 bit6 on before calibration */
|
||||||
RT30xxReadRFRegister(pAd, RF_R06, (PUCHAR) & RfReg);
|
RT30xxReadRFRegister(pAd, RF_R06, (u8 *)& RfReg);
|
||||||
RfReg |= 0x40;
|
RfReg |= 0x40;
|
||||||
RT30xxWriteRFRegister(pAd, RF_R06, (UCHAR) RfReg);
|
RT30xxWriteRFRegister(pAd, RF_R06, (u8)RfReg);
|
||||||
|
|
||||||
/*For RF filter Calibration */
|
/*For RF filter Calibration */
|
||||||
RTMPFilterCalibration(pAd);
|
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 divesity use GPIO3 and EESK pin for control */
|
||||||
/* Antenna and EEPROM access are both using EESK pin, */
|
/* Antenna and EEPROM access are both using EESK pin, */
|
||||||
/* Therefor we should avoid accessing EESK at the same time */
|
/* Therefor we should avoid accessing EESK at the same time */
|
||||||
/* Then restore antenna after EEPROM access */
|
/* Then restore antenna after EEPROM access */
|
||||||
/* The original name of this function is AsicSetRxAnt(), now change to */
|
/* The original name of this function is AsicSetRxAnt(), now change to */
|
||||||
/*VOID AsicSetRxAnt( */
|
/*void AsicSetRxAnt( */
|
||||||
VOID RT30xxSetRxAnt(IN PRTMP_ADAPTER pAd, IN UCHAR Ant)
|
void RT30xxSetRxAnt(IN PRTMP_ADAPTER pAd, u8 Ant)
|
||||||
{
|
{
|
||||||
UINT32 Value;
|
u32 Value;
|
||||||
#ifdef RTMP_MAC_PCI
|
#ifdef RTMP_MAC_PCI
|
||||||
UINT32 x;
|
u32 x;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if ((pAd->EepromAccess) ||
|
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;
|
u8 R55x = 0, value, FilterTarget = 0x1E, BBPValue = 0;
|
||||||
UINT loop = 0, count = 0, loopcnt = 0, ReTry = 0;
|
u32 loop = 0, count = 0, loopcnt = 0, ReTry = 0;
|
||||||
UCHAR RF_R24_Value = 0;
|
u8 RF_R24_Value = 0;
|
||||||
|
|
||||||
/* Give bbp filter initial value */
|
/* Give bbp filter initial value */
|
||||||
pAd->Mlme.CaliBW20RfR24 = 0x1F;
|
pAd->Mlme.CaliBW20RfR24 = 0x1F;
|
||||||
@ -263,10 +263,10 @@ VOID RTMPFilterCalibration(IN PRTMP_ADAPTER pAd)
|
|||||||
if (loopcnt < 100) {
|
if (loopcnt < 100) {
|
||||||
if (loop++ == 0) {
|
if (loop++ == 0) {
|
||||||
/*BandWidth = 20 MHz */
|
/*BandWidth = 20 MHz */
|
||||||
pAd->Mlme.CaliBW20RfR24 = (UCHAR) RF_R24_Value;
|
pAd->Mlme.CaliBW20RfR24 = (u8)RF_R24_Value;
|
||||||
} else {
|
} else {
|
||||||
/*BandWidth = 40 MHz */
|
/*BandWidth = 40 MHz */
|
||||||
pAd->Mlme.CaliBW40RfR24 = (UCHAR) RF_R24_Value;
|
pAd->Mlme.CaliBW40RfR24 = (u8)RF_R24_Value;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} else
|
} 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 */
|
/* 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);
|
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;
|
u8 RFValue;
|
||||||
UINT32 MACValue;
|
u32 MACValue;
|
||||||
|
|
||||||
#ifdef RTMP_MAC_USB
|
#ifdef RTMP_MAC_USB
|
||||||
if (!IS_RT3572(pAd))
|
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;
|
u8 RFValue;
|
||||||
UINT32 MACValue;
|
u32 MACValue;
|
||||||
|
|
||||||
#ifdef RTMP_MAC_USB
|
#ifdef RTMP_MAC_USB
|
||||||
if (!IS_RT3572(pAd))
|
if (!IS_RT3572(pAd))
|
||||||
@ -493,9 +493,9 @@ VOID RT30xxReverseRFSleepModeSetup(IN PRTMP_ADAPTER pAd)
|
|||||||
|
|
||||||
/* end johnli */
|
/* 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 */
|
/* Turn off LNA_PE or TRSW_POL */
|
||||||
|
@ -50,24 +50,24 @@
|
|||||||
#define BAND_BOTH 2
|
#define BAND_BOTH 2
|
||||||
|
|
||||||
typedef struct _CH_DESP {
|
typedef struct _CH_DESP {
|
||||||
UCHAR FirstChannel;
|
u8 FirstChannel;
|
||||||
UCHAR NumOfCh;
|
u8 NumOfCh;
|
||||||
CHAR MaxTxPwr; /* dBm */
|
char MaxTxPwr; /* dBm */
|
||||||
UCHAR Geography; /* 0:out door, 1:in door, 2:both */
|
u8 Geography; /* 0:out door, 1:in door, 2:both */
|
||||||
BOOLEAN DfsReq; /* Dfs require, 0: No, 1: yes. */
|
BOOLEAN DfsReq; /* Dfs require, 0: No, 1: yes. */
|
||||||
} CH_DESP, *PCH_DESP;
|
} CH_DESP, *PCH_DESP;
|
||||||
|
|
||||||
typedef struct _CH_REGION {
|
typedef struct _CH_REGION {
|
||||||
UCHAR CountReg[3];
|
u8 CountReg[3];
|
||||||
UCHAR DfsType; /* 0: CE, 1: FCC, 2: JAP, 3:JAP_W53, JAP_W56 */
|
u8 DfsType; /* 0: CE, 1: FCC, 2: JAP, 3:JAP_W53, JAP_W56 */
|
||||||
CH_DESP ChDesp[10];
|
CH_DESP ChDesp[10];
|
||||||
} CH_REGION, *PCH_REGION;
|
} CH_REGION, *PCH_REGION;
|
||||||
|
|
||||||
extern CH_REGION ChRegion[];
|
extern CH_REGION ChRegion[];
|
||||||
|
|
||||||
typedef struct _CH_FREQ_MAP_ {
|
typedef struct _CH_FREQ_MAP_ {
|
||||||
UINT16 channel;
|
u16 channel;
|
||||||
UINT16 freqKHz;
|
u16 freqKHz;
|
||||||
} CH_FREQ_MAP;
|
} CH_FREQ_MAP;
|
||||||
|
|
||||||
extern CH_FREQ_MAP CH_HZ_ID_MAP[];
|
extern CH_FREQ_MAP CH_HZ_ID_MAP[];
|
||||||
@ -103,15 +103,15 @@ extern int CH_HZ_ID_MAP_NUM;
|
|||||||
(_ch) = 1; \
|
(_ch) = 1; \
|
||||||
}while(0)
|
}while(0)
|
||||||
|
|
||||||
VOID BuildChannelListEx(IN PRTMP_ADAPTER pAd);
|
void BuildChannelListEx(IN PRTMP_ADAPTER pAd);
|
||||||
|
|
||||||
VOID BuildBeaconChList(IN PRTMP_ADAPTER pAd,
|
void BuildBeaconChList(IN PRTMP_ADAPTER pAd,
|
||||||
OUT PUCHAR pBuf, OUT PULONG pBufLen);
|
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__ */
|
#endif /* __CHLIST_H__ */
|
||||||
|
@ -39,7 +39,7 @@
|
|||||||
#include "../rt_config.h"
|
#include "../rt_config.h"
|
||||||
#include "action.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
|
MT2_CLS3ERR cls3err_action
|
||||||
==========================================================================
|
==========================================================================
|
||||||
*/
|
*/
|
||||||
VOID ActionStateMachineInit(IN PRTMP_ADAPTER pAd,
|
void ActionStateMachineInit(IN PRTMP_ADAPTER pAd,
|
||||||
IN STATE_MACHINE * S,
|
IN STATE_MACHINE * S,
|
||||||
OUT STATE_MACHINE_FUNC Trans[])
|
OUT STATE_MACHINE_FUNC Trans[])
|
||||||
{
|
{
|
||||||
@ -98,15 +98,15 @@ VOID ActionStateMachineInit(IN PRTMP_ADAPTER pAd,
|
|||||||
(STATE_MACHINE_FUNC) MlmeInvalidAction);
|
(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;
|
MLME_ADDBA_REQ_STRUCT *pInfo;
|
||||||
UCHAR Addr[6];
|
u8 Addr[6];
|
||||||
PUCHAR pOutBuffer = NULL;
|
u8 *pOutBuffer = NULL;
|
||||||
NDIS_STATUS NStatus;
|
int NStatus;
|
||||||
ULONG Idx;
|
unsigned long Idx;
|
||||||
FRAME_ADDBA_REQ Frame;
|
FRAME_ADDBA_REQ Frame;
|
||||||
ULONG FrameLen;
|
unsigned long FrameLen;
|
||||||
BA_ORI_ENTRY *pBAEntry = NULL;
|
BA_ORI_ENTRY *pBAEntry = NULL;
|
||||||
|
|
||||||
pInfo = (MLME_ADDBA_REQ_STRUCT *) Elem->Msg;
|
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 =
|
Frame.BaStartSeq.field.StartSeq =
|
||||||
pAd->MacTab.Content[pInfo->Wcid].TxSeq[pInfo->TID];
|
pAd->MacTab.Content[pInfo->Wcid].TxSeq[pInfo->TID];
|
||||||
|
|
||||||
*(USHORT *) (&Frame.BaParm) =
|
*(u16 *) (&Frame.BaParm) =
|
||||||
cpu2le16(*(USHORT *) (&Frame.BaParm));
|
cpu2le16(*(u16 *) (&Frame.BaParm));
|
||||||
Frame.TimeOutValue = cpu2le16(Frame.TimeOutValue);
|
Frame.TimeOutValue = cpu2le16(Frame.TimeOutValue);
|
||||||
Frame.BaStartSeq.word = cpu2le16(Frame.BaStartSeq.word);
|
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;
|
MLME_DELBA_REQ_STRUCT *pInfo;
|
||||||
PUCHAR pOutBuffer = NULL;
|
u8 *pOutBuffer = NULL;
|
||||||
PUCHAR pOutBuffer2 = NULL;
|
u8 *pOutBuffer2 = NULL;
|
||||||
NDIS_STATUS NStatus;
|
int NStatus;
|
||||||
ULONG Idx;
|
unsigned long Idx;
|
||||||
FRAME_DELBA_REQ Frame;
|
FRAME_DELBA_REQ Frame;
|
||||||
ULONG FrameLen;
|
unsigned long FrameLen;
|
||||||
FRAME_BAR FrameBar;
|
FRAME_BAR FrameBar;
|
||||||
|
|
||||||
pInfo = (MLME_DELBA_REQ_STRUCT *) Elem->Msg;
|
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.Initiator = pInfo->Initiator;
|
||||||
Frame.DelbaParm.TID = pInfo->TID;
|
Frame.DelbaParm.TID = pInfo->TID;
|
||||||
Frame.ReasonCode = 39; /* Time Out */
|
Frame.ReasonCode = 39; /* Time Out */
|
||||||
*(USHORT *) (&Frame.DelbaParm) =
|
*(u16 *) (&Frame.DelbaParm) =
|
||||||
cpu2le16(*(USHORT *) (&Frame.DelbaParm));
|
cpu2le16(*(u16 *) (&Frame.DelbaParm));
|
||||||
Frame.ReasonCode = cpu2le16(Frame.ReasonCode);
|
Frame.ReasonCode = cpu2le16(Frame.ReasonCode);
|
||||||
|
|
||||||
MakeOutgoingFrame(pOutBuffer, &FrameLen,
|
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 */
|
/*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) {
|
switch (Action) {
|
||||||
case ADDBA_REQ:
|
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)
|
if (Elem->Wcid >= MAX_LEN_OF_MAC_TABLE)
|
||||||
return;
|
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) {
|
if (Elem->MsgLen <= LENGTH_802_11) {
|
||||||
return;
|
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);
|
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;
|
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)
|
IN MLME_QUEUE_ELEM * Elem)
|
||||||
{
|
{
|
||||||
PUCHAR pOutBuffer = NULL;
|
u8 *pOutBuffer = NULL;
|
||||||
NDIS_STATUS NStatus;
|
int NStatus;
|
||||||
ULONG FrameLen;
|
unsigned long FrameLen;
|
||||||
FRAME_HT_INFO HTINFOframe, *pFrame;
|
FRAME_HT_INFO HTINFOframe, *pFrame;
|
||||||
UCHAR *pAddr;
|
u8 *pAddr;
|
||||||
|
|
||||||
/* 2. Always send back ADDBA Response */
|
/* 2. Always send back ADDBA Response */
|
||||||
NStatus = MlmeAllocateMemory(pAd, &pOutBuffer); /*Get an unused nonpaged memory */
|
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);
|
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)
|
if (Elem->Wcid >= MAX_LEN_OF_MAC_TABLE)
|
||||||
return;
|
return;
|
||||||
@ -467,11 +467,11 @@ VOID PeerHTAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
|||||||
FALSE , then continue indicaterx at this moment.
|
FALSE , then continue indicaterx at this moment.
|
||||||
==========================================================================
|
==========================================================================
|
||||||
*/
|
*/
|
||||||
VOID ORIBATimerTimeout(IN PRTMP_ADAPTER pAd)
|
void ORIBATimerTimeout(IN PRTMP_ADAPTER pAd)
|
||||||
{
|
{
|
||||||
MAC_TABLE_ENTRY *pEntry;
|
MAC_TABLE_ENTRY *pEntry;
|
||||||
INT i, total;
|
int i, total;
|
||||||
UCHAR TID;
|
u8 TID;
|
||||||
|
|
||||||
total = pAd->MacTab.Size * NUM_OF_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;
|
FRAME_BAR FrameBar;
|
||||||
ULONG FrameLen;
|
unsigned long FrameLen;
|
||||||
NDIS_STATUS NStatus;
|
int NStatus;
|
||||||
PUCHAR pOutBuffer = NULL;
|
u8 *pOutBuffer = NULL;
|
||||||
USHORT Sequence;
|
u16 Sequence;
|
||||||
UCHAR i, TID;
|
u8 i, TID;
|
||||||
USHORT idx;
|
u16 idx;
|
||||||
BA_ORI_ENTRY *pBAEntry;
|
BA_ORI_ENTRY *pBAEntry;
|
||||||
|
|
||||||
for (i = 0; i < NUM_OF_TID; i++) {
|
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 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));
|
NdisZeroMemory(pHdr80211, sizeof(HEADER_802_11));
|
||||||
pHdr80211->FC.Type = BTYPE_MGMT;
|
pHdr80211->FC.Type = BTYPE_MGMT;
|
||||||
@ -560,8 +560,8 @@ VOID ActHeaderInit(IN PRTMP_ADAPTER pAd,
|
|||||||
COPY_MAC_ADDR(pHdr80211->Addr3, Addr3);
|
COPY_MAC_ADDR(pHdr80211->Addr3, Addr3);
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID BarHeaderInit(IN PRTMP_ADAPTER pAd,
|
void BarHeaderInit(IN PRTMP_ADAPTER pAd,
|
||||||
IN OUT PFRAME_BAR pCntlBar, IN PUCHAR pDA, IN PUCHAR pSA)
|
IN OUT PFRAME_BAR pCntlBar, u8 *pDA, u8 *pSA)
|
||||||
{
|
{
|
||||||
NdisZeroMemory(pCntlBar, sizeof(FRAME_BAR));
|
NdisZeroMemory(pCntlBar, sizeof(FRAME_BAR));
|
||||||
pCntlBar->FC.Type = BTYPE_CNTL;
|
pCntlBar->FC.Type = BTYPE_CNTL;
|
||||||
@ -591,11 +591,11 @@ VOID BarHeaderInit(IN PRTMP_ADAPTER pAd,
|
|||||||
Return : None.
|
Return : None.
|
||||||
==========================================================================
|
==========================================================================
|
||||||
*/
|
*/
|
||||||
VOID InsertActField(IN PRTMP_ADAPTER pAd,
|
void InsertActField(IN PRTMP_ADAPTER pAd,
|
||||||
OUT PUCHAR pFrameBuf,
|
u8 *pFrameBuf,
|
||||||
OUT PULONG pFrameLen, IN UINT8 Category, IN UINT8 ActCode)
|
unsigned long *pFrameLen, u8 Category, u8 ActCode)
|
||||||
{
|
{
|
||||||
ULONG TempLen;
|
unsigned long TempLen;
|
||||||
|
|
||||||
MakeOutgoingFrame(pFrameBuf, &TempLen,
|
MakeOutgoingFrame(pFrameBuf, &TempLen,
|
||||||
1, &Category, 1, &ActCode, END_OF_ARGS);
|
1, &Category, 1, &ActCode, END_OF_ARGS);
|
||||||
|
@ -40,16 +40,16 @@
|
|||||||
#define __ACTION_H__
|
#define __ACTION_H__
|
||||||
|
|
||||||
typedef struct PACKED __HT_INFO_OCTET {
|
typedef struct PACKED __HT_INFO_OCTET {
|
||||||
UCHAR Request:1;
|
u8 Request:1;
|
||||||
UCHAR Forty_MHz_Intolerant:1;
|
u8 Forty_MHz_Intolerant:1;
|
||||||
UCHAR STA_Channel_Width:1;
|
u8 STA_Channel_Width:1;
|
||||||
UCHAR Reserved:5;
|
u8 Reserved:5;
|
||||||
} HT_INFORMATION_OCTET;
|
} HT_INFORMATION_OCTET;
|
||||||
|
|
||||||
typedef struct PACKED __FRAME_HT_INFO {
|
typedef struct PACKED __FRAME_HT_INFO {
|
||||||
HEADER_802_11 Hdr;
|
HEADER_802_11 Hdr;
|
||||||
UCHAR Category;
|
u8 Category;
|
||||||
UCHAR Action;
|
u8 Action;
|
||||||
HT_INFORMATION_OCTET HT_Info;
|
HT_INFORMATION_OCTET HT_Info;
|
||||||
} FRAME_HT_INFO, *PFRAME_HT_INFO;
|
} FRAME_HT_INFO, *PFRAME_HT_INFO;
|
||||||
|
|
||||||
|
@ -41,19 +41,19 @@
|
|||||||
static void ba_mpdu_blk_free(PRTMP_ADAPTER pAd,
|
static void ba_mpdu_blk_free(PRTMP_ADAPTER pAd,
|
||||||
struct reordering_mpdu *mpdu_blk);
|
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,
|
void BAOriSessionSetupTimeout(void *SystemSpecific1,
|
||||||
IN PVOID FunctionContext,
|
void *FunctionContext,
|
||||||
IN PVOID SystemSpecific2,
|
void *SystemSpecific2,
|
||||||
IN PVOID SystemSpecific3);
|
void *SystemSpecific3);
|
||||||
|
|
||||||
VOID BARecSessionIdleTimeout(IN PVOID SystemSpecific1,
|
void BARecSessionIdleTimeout(void *SystemSpecific1,
|
||||||
IN PVOID FunctionContext,
|
void *FunctionContext,
|
||||||
IN PVOID SystemSpecific2,
|
void *SystemSpecific2,
|
||||||
IN PVOID SystemSpecific3);
|
void *SystemSpecific3);
|
||||||
|
|
||||||
BUILD_TIMER_FUNCTION(BAOriSessionSetupTimeout);
|
BUILD_TIMER_FUNCTION(BAOriSessionSetupTimeout);
|
||||||
BUILD_TIMER_FUNCTION(BARecSessionIdleTimeout);
|
BUILD_TIMER_FUNCTION(BARecSessionIdleTimeout);
|
||||||
@ -61,10 +61,10 @@ BUILD_TIMER_FUNCTION(BARecSessionIdleTimeout);
|
|||||||
#define ANNOUNCE_REORDERING_PACKET(_pAd, _mpdu_blk) \
|
#define ANNOUNCE_REORDERING_PACKET(_pAd, _mpdu_blk) \
|
||||||
Announce_Reordering_Packet(_pAd, _mpdu_blk);
|
Announce_Reordering_Packet(_pAd, _mpdu_blk);
|
||||||
|
|
||||||
VOID BA_MaxWinSizeReasign(IN PRTMP_ADAPTER pAd,
|
void BA_MaxWinSizeReasign(IN PRTMP_ADAPTER pAd,
|
||||||
IN MAC_TABLE_ENTRY * pEntryPeer, OUT UCHAR * pWinSize)
|
IN MAC_TABLE_ENTRY * pEntryPeer, u8 * pWinSize)
|
||||||
{
|
{
|
||||||
UCHAR MaxSize;
|
u8 MaxSize;
|
||||||
|
|
||||||
if (pAd->MACVersion >= RALINK_2883_VERSION) /* 3*3 */
|
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)
|
BOOLEAN ba_reordering_resource_init(PRTMP_ADAPTER pAd, int num)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
PUCHAR mem;
|
u8 *mem;
|
||||||
struct reordering_mpdu *mpdu_blk;
|
struct reordering_mpdu *mpdu_blk;
|
||||||
struct reordering_list *freelist;
|
struct reordering_list *freelist;
|
||||||
|
|
||||||
@ -246,10 +246,10 @@ BOOLEAN ba_reordering_resource_init(PRTMP_ADAPTER pAd, int num)
|
|||||||
|
|
||||||
DBGPRINT(RT_DEBUG_TRACE,
|
DBGPRINT(RT_DEBUG_TRACE,
|
||||||
("Allocate %d memory for BA reordering\n",
|
("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 */
|
/* allocate number of mpdu_blk memory */
|
||||||
os_alloc_mem(pAd, (PUCHAR *) & mem,
|
os_alloc_mem(pAd, (u8 **) & mem,
|
||||||
(num * sizeof(struct reordering_mpdu)));
|
(num * sizeof(struct reordering_mpdu)));
|
||||||
|
|
||||||
pAd->mpdu_blk_pool.mem = mem;
|
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);
|
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 PBA_REC_ENTRY pBAEntry,
|
||||||
IN USHORT StartSeq)
|
u16 StartSeq)
|
||||||
{
|
{
|
||||||
struct reordering_mpdu *mpdu_blk;
|
struct reordering_mpdu *mpdu_blk;
|
||||||
USHORT LastIndSeq = RESET_RCV_SEQ;
|
u16 LastIndSeq = RESET_RCV_SEQ;
|
||||||
|
|
||||||
NdisAcquireSpinLock(&pBAEntry->RxReRingLock);
|
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,
|
static void ba_indicate_reordering_mpdus_le_seq(IN PRTMP_ADAPTER pAd,
|
||||||
IN PBA_REC_ENTRY pBAEntry,
|
IN PBA_REC_ENTRY pBAEntry,
|
||||||
IN USHORT Sequence)
|
u16 Sequence)
|
||||||
{
|
{
|
||||||
struct reordering_mpdu *mpdu_blk;
|
struct reordering_mpdu *mpdu_blk;
|
||||||
|
|
||||||
@ -383,9 +383,9 @@ static void ba_refresh_reordering_mpdus(IN PRTMP_ADAPTER pAd,
|
|||||||
/*static */
|
/*static */
|
||||||
void ba_flush_reordering_timeout_mpdus(IN PRTMP_ADAPTER pAd,
|
void ba_flush_reordering_timeout_mpdus(IN PRTMP_ADAPTER pAd,
|
||||||
IN PBA_REC_ENTRY pBAEntry,
|
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)) && */
|
/* if ((RTMP_TIME_AFTER((unsigned long)Now32, (unsigned long)(pBAEntry->LastIndSeqAtTimer+REORDERING_PACKET_TIMEOUT)) && */
|
||||||
/* (pBAEntry->list.qlen > ((pBAEntry->BAWinSize*7)/8))) //|| */
|
/* (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
|
* generate ADDBA request to
|
||||||
* set up BA agreement
|
* set up BA agreement
|
||||||
*/
|
*/
|
||||||
VOID BAOriSessionSetUp(IN PRTMP_ADAPTER pAd,
|
void BAOriSessionSetUp(IN PRTMP_ADAPTER pAd,
|
||||||
IN MAC_TABLE_ENTRY * pEntry,
|
IN MAC_TABLE_ENTRY * pEntry,
|
||||||
IN UCHAR TID,
|
u8 TID,
|
||||||
IN USHORT TimeOut,
|
u16 TimeOut,
|
||||||
IN ULONG DelayTime, IN BOOLEAN isForced)
|
unsigned long DelayTime, IN BOOLEAN isForced)
|
||||||
{
|
{
|
||||||
/*MLME_ADDBA_REQ_STRUCT AddbaReq; */
|
/*MLME_ADDBA_REQ_STRUCT AddbaReq; */
|
||||||
BA_ORI_ENTRY *pBAEntry = NULL;
|
BA_ORI_ENTRY *pBAEntry = NULL;
|
||||||
USHORT Idx;
|
u16 Idx;
|
||||||
BOOLEAN Cancelled;
|
BOOLEAN Cancelled;
|
||||||
|
|
||||||
if ((pAd->CommonCfg.BACapability.field.AutoBA != TRUE)
|
if ((pAd->CommonCfg.BACapability.field.AutoBA != TRUE)
|
||||||
@ -506,16 +506,16 @@ VOID BAOriSessionSetUp(IN PRTMP_ADAPTER pAd,
|
|||||||
RTMPSetTimer(&pBAEntry->ORIBATimer, DelayTime);
|
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)
|
IN MAC_TABLE_ENTRY * pEntry, IN PFRAME_ADDBA_RSP pFrame)
|
||||||
{
|
{
|
||||||
BA_ORI_ENTRY *pBAEntry = NULL;
|
BA_ORI_ENTRY *pBAEntry = NULL;
|
||||||
BOOLEAN Cancelled;
|
BOOLEAN Cancelled;
|
||||||
UCHAR TID;
|
u8 TID;
|
||||||
USHORT Idx;
|
u16 Idx;
|
||||||
PUCHAR pOutBuffer2 = NULL;
|
u8 *pOutBuffer2 = NULL;
|
||||||
NDIS_STATUS NStatus;
|
int NStatus;
|
||||||
ULONG FrameLen;
|
unsigned long FrameLen;
|
||||||
FRAME_BAR FrameBar;
|
FRAME_BAR FrameBar;
|
||||||
|
|
||||||
TID = pFrame->BaParm.TID;
|
TID = pFrame->BaParm.TID;
|
||||||
@ -526,7 +526,7 @@ VOID BAOriSessionAdd(IN PRTMP_ADAPTER pAd,
|
|||||||
if ((Idx != 0) && (pBAEntry->TID == TID)
|
if ((Idx != 0) && (pBAEntry->TID == TID)
|
||||||
&& (pBAEntry->ORI_BA_Status == Originator_WaitRes)) {
|
&& (pBAEntry->ORI_BA_Status == Originator_WaitRes)) {
|
||||||
pBAEntry->BAWinSize =
|
pBAEntry->BAWinSize =
|
||||||
min(pBAEntry->BAWinSize, ((UCHAR) pFrame->BaParm.BufSize));
|
min(pBAEntry->BAWinSize, ((u8)pFrame->BaParm.BufSize));
|
||||||
BA_MaxWinSizeReasign(pAd, pEntry, &pBAEntry->BAWinSize);
|
BA_MaxWinSizeReasign(pAd, pEntry, &pBAEntry->BAWinSize);
|
||||||
|
|
||||||
pBAEntry->TimeOutValue = pFrame->TimeOutValue;
|
pBAEntry->TimeOutValue = pFrame->TimeOutValue;
|
||||||
@ -577,11 +577,11 @@ BOOLEAN BARecSessionAdd(IN PRTMP_ADAPTER pAd,
|
|||||||
BA_REC_ENTRY *pBAEntry = NULL;
|
BA_REC_ENTRY *pBAEntry = NULL;
|
||||||
BOOLEAN Status = TRUE;
|
BOOLEAN Status = TRUE;
|
||||||
BOOLEAN Cancelled;
|
BOOLEAN Cancelled;
|
||||||
USHORT Idx;
|
u16 Idx;
|
||||||
UCHAR TID;
|
u8 TID;
|
||||||
UCHAR BAWinSize;
|
u8 BAWinSize;
|
||||||
/*UINT32 Value; */
|
/*u32 Value; */
|
||||||
/*UINT offset; */
|
/*u32 offset; */
|
||||||
|
|
||||||
ASSERT(pEntry);
|
ASSERT(pEntry);
|
||||||
|
|
||||||
@ -589,8 +589,8 @@ BOOLEAN BARecSessionAdd(IN PRTMP_ADAPTER pAd,
|
|||||||
TID = pFrame->BaParm.TID;
|
TID = pFrame->BaParm.TID;
|
||||||
|
|
||||||
BAWinSize =
|
BAWinSize =
|
||||||
min(((UCHAR) pFrame->BaParm.BufSize),
|
min(((u8)pFrame->BaParm.BufSize),
|
||||||
(UCHAR) pAd->CommonCfg.BACapability.field.RxBAWinLimit);
|
(u8)pAd->CommonCfg.BACapability.field.RxBAWinLimit);
|
||||||
|
|
||||||
/* Intel patch */
|
/* Intel patch */
|
||||||
if (BAWinSize == 0) {
|
if (BAWinSize == 0) {
|
||||||
@ -660,7 +660,7 @@ BOOLEAN BARecSessionAdd(IN PRTMP_ADAPTER pAd,
|
|||||||
return (Status);
|
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;
|
int i;
|
||||||
BA_REC_ENTRY *pBAEntry = NULL;
|
BA_REC_ENTRY *pBAEntry = NULL;
|
||||||
@ -690,7 +690,7 @@ done:
|
|||||||
return pBAEntry;
|
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;
|
int i;
|
||||||
BA_ORI_ENTRY *pBAEntry = NULL;
|
BA_ORI_ENTRY *pBAEntry = NULL;
|
||||||
@ -718,7 +718,7 @@ done:
|
|||||||
return pBAEntry;
|
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;
|
BA_ORI_ENTRY *pBAEntry = NULL;
|
||||||
MAC_TABLE_ENTRY *pEntry;
|
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;
|
BA_REC_ENTRY *pBAEntry = NULL;
|
||||||
MAC_TABLE_ENTRY *pEntry;
|
MAC_TABLE_ENTRY *pEntry;
|
||||||
@ -777,12 +777,12 @@ VOID BATableFreeRecEntry(IN PRTMP_ADAPTER pAd, IN ULONG Idx)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID BAOriSessionTearDown(IN OUT PRTMP_ADAPTER pAd,
|
void BAOriSessionTearDown(IN OUT PRTMP_ADAPTER pAd,
|
||||||
IN UCHAR Wcid,
|
u8 Wcid,
|
||||||
IN UCHAR TID,
|
u8 TID,
|
||||||
IN BOOLEAN bPassive, IN BOOLEAN bForceSend)
|
IN BOOLEAN bPassive, IN BOOLEAN bForceSend)
|
||||||
{
|
{
|
||||||
ULONG Idx = 0;
|
unsigned long Idx = 0;
|
||||||
BA_ORI_ENTRY *pBAEntry;
|
BA_ORI_ENTRY *pBAEntry;
|
||||||
BOOLEAN Cancelled;
|
BOOLEAN Cancelled;
|
||||||
|
|
||||||
@ -867,10 +867,10 @@ VOID BAOriSessionTearDown(IN OUT PRTMP_ADAPTER pAd,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID BARecSessionTearDown(IN OUT PRTMP_ADAPTER pAd,
|
void BARecSessionTearDown(IN OUT PRTMP_ADAPTER pAd,
|
||||||
IN UCHAR Wcid, IN UCHAR TID, IN BOOLEAN bPassive)
|
u8 Wcid, u8 TID, IN BOOLEAN bPassive)
|
||||||
{
|
{
|
||||||
ULONG Idx = 0;
|
unsigned long Idx = 0;
|
||||||
BA_REC_ENTRY *pBAEntry;
|
BA_REC_ENTRY *pBAEntry;
|
||||||
|
|
||||||
if (Wcid >= MAX_LEN_OF_MAC_TABLE) {
|
if (Wcid >= MAX_LEN_OF_MAC_TABLE) {
|
||||||
@ -897,8 +897,8 @@ VOID BARecSessionTearDown(IN OUT PRTMP_ADAPTER pAd,
|
|||||||
&& (pBAEntry->REC_BA_Status == Recipient_Accept)) {
|
&& (pBAEntry->REC_BA_Status == Recipient_Accept)) {
|
||||||
MLME_DELBA_REQ_STRUCT DelbaReq;
|
MLME_DELBA_REQ_STRUCT DelbaReq;
|
||||||
BOOLEAN Cancelled;
|
BOOLEAN Cancelled;
|
||||||
/*ULONG offset; */
|
/*unsigned long offset; */
|
||||||
/*UINT32 VALUE; */
|
/*u32 VALUE; */
|
||||||
|
|
||||||
RTMPCancelTimer(&pBAEntry->RECBATimer, &Cancelled);
|
RTMPCancelTimer(&pBAEntry->RECBATimer, &Cancelled);
|
||||||
|
|
||||||
@ -956,7 +956,7 @@ VOID BARecSessionTearDown(IN OUT PRTMP_ADAPTER pAd,
|
|||||||
BATableFreeRecEntry(pAd, Idx);
|
BATableFreeRecEntry(pAd, Idx);
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID BASessionTearDownALL(IN OUT PRTMP_ADAPTER pAd, IN UCHAR Wcid)
|
void BASessionTearDownALL(IN OUT PRTMP_ADAPTER pAd, u8 Wcid)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
@ -980,10 +980,10 @@ VOID BASessionTearDownALL(IN OUT PRTMP_ADAPTER pAd, IN UCHAR Wcid)
|
|||||||
FALSE , then continue indicaterx at this moment.
|
FALSE , then continue indicaterx at this moment.
|
||||||
==========================================================================
|
==========================================================================
|
||||||
*/
|
*/
|
||||||
VOID BAOriSessionSetupTimeout(IN PVOID SystemSpecific1,
|
void BAOriSessionSetupTimeout(void *SystemSpecific1,
|
||||||
IN PVOID FunctionContext,
|
void *FunctionContext,
|
||||||
IN PVOID SystemSpecific2,
|
void *SystemSpecific2,
|
||||||
IN PVOID SystemSpecific3)
|
void *SystemSpecific3)
|
||||||
{
|
{
|
||||||
BA_ORI_ENTRY *pBAEntry = (BA_ORI_ENTRY *) FunctionContext;
|
BA_ORI_ENTRY *pBAEntry = (BA_ORI_ENTRY *) FunctionContext;
|
||||||
MAC_TABLE_ENTRY *pEntry;
|
MAC_TABLE_ENTRY *pEntry;
|
||||||
@ -1008,14 +1008,14 @@ VOID BAOriSessionSetupTimeout(IN PVOID SystemSpecific1,
|
|||||||
|
|
||||||
NdisZeroMemory(&AddbaReq, sizeof(AddbaReq));
|
NdisZeroMemory(&AddbaReq, sizeof(AddbaReq));
|
||||||
COPY_MAC_ADDR(AddbaReq.pAddr, pEntry->Addr);
|
COPY_MAC_ADDR(AddbaReq.pAddr, pEntry->Addr);
|
||||||
AddbaReq.Wcid = (UCHAR) (pEntry->Aid);
|
AddbaReq.Wcid = (u8)(pEntry->Aid);
|
||||||
AddbaReq.TID = pBAEntry->TID;
|
AddbaReq.TID = pBAEntry->TID;
|
||||||
AddbaReq.BaBufSize =
|
AddbaReq.BaBufSize =
|
||||||
pAd->CommonCfg.BACapability.field.RxBAWinLimit;
|
pAd->CommonCfg.BACapability.field.RxBAWinLimit;
|
||||||
AddbaReq.TimeOutValue = 0;
|
AddbaReq.TimeOutValue = 0;
|
||||||
AddbaReq.Token = pBAEntry->Token;
|
AddbaReq.Token = pBAEntry->Token;
|
||||||
MlmeEnqueue(pAd, ACTION_STATE_MACHINE, MT2_MLME_ADD_BA_CATE,
|
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);
|
RTMP_MLME_HANDLER(pAd);
|
||||||
DBGPRINT(RT_DEBUG_TRACE,
|
DBGPRINT(RT_DEBUG_TRACE,
|
||||||
("BA Ori Session Timeout(%d) : Send ADD BA again\n",
|
("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.
|
FALSE , then continue indicaterx at this moment.
|
||||||
==========================================================================
|
==========================================================================
|
||||||
*/
|
*/
|
||||||
VOID BARecSessionIdleTimeout(IN PVOID SystemSpecific1,
|
void BARecSessionIdleTimeout(void *SystemSpecific1,
|
||||||
IN PVOID FunctionContext,
|
void *FunctionContext,
|
||||||
IN PVOID SystemSpecific2, IN PVOID SystemSpecific3)
|
void *SystemSpecific2, void *SystemSpecific3)
|
||||||
{
|
{
|
||||||
|
|
||||||
BA_REC_ENTRY *pBAEntry = (BA_REC_ENTRY *) FunctionContext;
|
BA_REC_ENTRY *pBAEntry = (BA_REC_ENTRY *) FunctionContext;
|
||||||
PRTMP_ADAPTER pAd;
|
PRTMP_ADAPTER pAd;
|
||||||
ULONG Now32;
|
unsigned long Now32;
|
||||||
|
|
||||||
if (pBAEntry == NULL)
|
if (pBAEntry == NULL)
|
||||||
return;
|
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 */
|
/* 7.4.4.1 */
|
||||||
/*ULONG Idx; */
|
/*unsigned long Idx; */
|
||||||
UCHAR Status = 1;
|
u8 Status = 1;
|
||||||
UCHAR pAddr[6];
|
u8 pAddr[6];
|
||||||
FRAME_ADDBA_RSP ADDframe;
|
FRAME_ADDBA_RSP ADDframe;
|
||||||
PUCHAR pOutBuffer = NULL;
|
u8 *pOutBuffer = NULL;
|
||||||
NDIS_STATUS NStatus;
|
int NStatus;
|
||||||
PFRAME_ADDBA_REQ pAddreqFrame = NULL;
|
PFRAME_ADDBA_REQ pAddreqFrame = NULL;
|
||||||
/*UCHAR BufSize; */
|
/*u8 BufSize; */
|
||||||
ULONG FrameLen;
|
unsigned long FrameLen;
|
||||||
PULONG ptemp;
|
unsigned long *ptemp;
|
||||||
PMAC_TABLE_ENTRY pMacEntry;
|
PMAC_TABLE_ENTRY pMacEntry;
|
||||||
|
|
||||||
DBGPRINT(RT_DEBUG_TRACE,
|
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];
|
pMacEntry = &pAd->MacTab.Content[Elem->Wcid];
|
||||||
DBGPRINT(RT_DEBUG_TRACE, ("BA - PeerAddBAReqAction----> \n"));
|
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))); */
|
/*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)) {
|
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.AMSDUSupported = 0;
|
||||||
ADDframe.BaParm.TID = pAddreqFrame->BaParm.TID;
|
ADDframe.BaParm.TID = pAddreqFrame->BaParm.TID;
|
||||||
ADDframe.BaParm.BufSize =
|
ADDframe.BaParm.BufSize =
|
||||||
min(((UCHAR) pAddreqFrame->BaParm.BufSize),
|
min(((u8)pAddreqFrame->BaParm.BufSize),
|
||||||
(UCHAR) pAd->CommonCfg.BACapability.field.RxBAWinLimit);
|
(u8)pAd->CommonCfg.BACapability.field.RxBAWinLimit);
|
||||||
if (ADDframe.BaParm.BufSize == 0) {
|
if (ADDframe.BaParm.BufSize == 0) {
|
||||||
ADDframe.BaParm.BufSize = 64;
|
ADDframe.BaParm.BufSize = 64;
|
||||||
}
|
}
|
||||||
ADDframe.TimeOutValue = 0; /*pAddreqFrame->TimeOutValue; */
|
ADDframe.TimeOutValue = 0; /*pAddreqFrame->TimeOutValue; */
|
||||||
|
|
||||||
*(USHORT *) (&ADDframe.BaParm) =
|
*(u16 *) (&ADDframe.BaParm) =
|
||||||
cpu2le16(*(USHORT *) (&ADDframe.BaParm));
|
cpu2le16(*(u16 *) (&ADDframe.BaParm));
|
||||||
ADDframe.StatusCode = cpu2le16(ADDframe.StatusCode);
|
ADDframe.StatusCode = cpu2le16(ADDframe.StatusCode);
|
||||||
ADDframe.TimeOutValue = cpu2le16(ADDframe.TimeOutValue);
|
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));
|
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; */
|
/*u8 Idx, i; */
|
||||||
/*PUCHAR pOutBuffer = NULL; */
|
/*u8 * pOutBuffer = NULL; */
|
||||||
PFRAME_ADDBA_RSP pFrame = NULL;
|
PFRAME_ADDBA_RSP pFrame = NULL;
|
||||||
/*PBA_ORI_ENTRY pBAEntry; */
|
/*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; */
|
/*u8 Idx; */
|
||||||
/*PUCHAR pOutBuffer = NULL; */
|
/*u8 * pOutBuffer = NULL; */
|
||||||
PFRAME_DELBA_REQ pDelFrame = NULL;
|
PFRAME_DELBA_REQ pDelFrame = NULL;
|
||||||
|
|
||||||
DBGPRINT(RT_DEBUG_TRACE, ("%s ==>\n", __func__));
|
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,
|
BOOLEAN CntlEnqueueForRecv(IN PRTMP_ADAPTER pAd,
|
||||||
IN ULONG Wcid,
|
unsigned long Wcid,
|
||||||
IN ULONG MsgLen, IN PFRAME_BA_REQ pMsg)
|
unsigned long MsgLen, IN PFRAME_BA_REQ pMsg)
|
||||||
{
|
{
|
||||||
PFRAME_BA_REQ pFrame = pMsg;
|
PFRAME_BA_REQ pFrame = pMsg;
|
||||||
/*PRTMP_REORDERBUF pBuffer; */
|
/*PRTMP_REORDERBUF pBuffer; */
|
||||||
/*PRTMP_REORDERBUF pDmaBuf; */
|
/*PRTMP_REORDERBUF pDmaBuf; */
|
||||||
PBA_REC_ENTRY pBAEntry;
|
PBA_REC_ENTRY pBAEntry;
|
||||||
/*BOOLEAN Result; */
|
/*BOOLEAN Result; */
|
||||||
ULONG Idx;
|
unsigned long Idx;
|
||||||
/*UCHAR NumRxPkt; */
|
/*u8 NumRxPkt; */
|
||||||
UCHAR TID; /*, i; */
|
u8 TID; /*, i; */
|
||||||
|
|
||||||
TID = (UCHAR) pFrame->BARControl.TID;
|
TID = (u8)pFrame->BARControl.TID;
|
||||||
|
|
||||||
DBGPRINT(RT_DEBUG_TRACE,
|
DBGPRINT(RT_DEBUG_TRACE,
|
||||||
("%s(): BAR-Wcid(%ld), Tid (%d)\n", __func__, Wcid, TID));
|
("%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. */
|
/* Do nothing if the driver is starting halt state. */
|
||||||
/* This might happen when timer already been fired before cancel timer with mlmehalt */
|
/* This might happen when timer already been fired before cancel timer with mlmehalt */
|
||||||
if (RTMP_TEST_FLAG
|
if (RTMP_TEST_FLAG
|
||||||
@ -1309,13 +1309,13 @@ BOOLEAN CntlEnqueueForRecv(IN PRTMP_ADAPTER pAd,
|
|||||||
/*
|
/*
|
||||||
Description : Send PSMP Action frame If PSMP mode switches.
|
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;
|
u8 *pOutBuffer = NULL;
|
||||||
NDIS_STATUS NStatus;
|
int NStatus;
|
||||||
/*ULONG Idx; */
|
/*unsigned long Idx; */
|
||||||
FRAME_PSMP_ACTION Frame;
|
FRAME_PSMP_ACTION Frame;
|
||||||
ULONG FrameLen;
|
unsigned long FrameLen;
|
||||||
|
|
||||||
NStatus = MlmeAllocateMemory(pAd, &pOutBuffer); /*Get an unused nonpaged memory */
|
NStatus = MlmeAllocateMemory(pAd, &pOutBuffer); /*Get an unused nonpaged memory */
|
||||||
if (NStatus != NDIS_STATUS_SUCCESS) {
|
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
|
#define RADIO_MEASUREMENT_REQUEST_ACTION 0
|
||||||
|
|
||||||
typedef struct PACKED {
|
typedef struct PACKED {
|
||||||
UCHAR RegulatoryClass;
|
u8 RegulatoryClass;
|
||||||
UCHAR ChannelNumber;
|
u8 ChannelNumber;
|
||||||
USHORT RandomInterval;
|
u16 RandomInterval;
|
||||||
USHORT MeasurementDuration;
|
u16 MeasurementDuration;
|
||||||
UCHAR MeasurementMode;
|
u8 MeasurementMode;
|
||||||
UCHAR BSSID[MAC_ADDR_LEN];
|
u8 BSSID[MAC_ADDR_LEN];
|
||||||
UCHAR ReportingCondition;
|
u8 ReportingCondition;
|
||||||
UCHAR Threshold;
|
u8 Threshold;
|
||||||
UCHAR SSIDIE[2]; /* 2 byte */
|
u8 SSIDIE[2]; /* 2 byte */
|
||||||
} BEACON_REQUEST;
|
} BEACON_REQUEST;
|
||||||
|
|
||||||
typedef struct PACKED {
|
typedef struct PACKED {
|
||||||
UCHAR ID;
|
u8 ID;
|
||||||
UCHAR Length;
|
u8 Length;
|
||||||
UCHAR Token;
|
u8 Token;
|
||||||
UCHAR RequestMode;
|
u8 RequestMode;
|
||||||
UCHAR Type;
|
u8 Type;
|
||||||
} MEASUREMENT_REQ;
|
} MEASUREMENT_REQ;
|
||||||
|
|
||||||
void convert_reordering_packet_to_preAMSDU_or_802_3_packet(IN PRTMP_ADAPTER pAd,
|
void convert_reordering_packet_to_preAMSDU_or_802_3_packet(IN PRTMP_ADAPTER pAd,
|
||||||
IN RX_BLK * pRxBlk,
|
IN RX_BLK * pRxBlk,
|
||||||
IN UCHAR
|
u8
|
||||||
FromWhichBSSID)
|
FromWhichBSSID)
|
||||||
{
|
{
|
||||||
PNDIS_PACKET pRxPkt;
|
PNDIS_PACKET pRxPkt;
|
||||||
UCHAR Header802_3[LENGTH_802_3];
|
u8 Header802_3[LENGTH_802_3];
|
||||||
|
|
||||||
/* 1. get 802.3 Header */
|
/* 1. get 802.3 Header */
|
||||||
/* 2. remove LLC */
|
/* 2. remove LLC */
|
||||||
@ -1436,13 +1436,13 @@ void convert_reordering_packet_to_preAMSDU_or_802_3_packet(IN PRTMP_ADAPTER pAd,
|
|||||||
} \
|
} \
|
||||||
} while (0);
|
} 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 PBA_REC_ENTRY pBAEntry,
|
||||||
IN RX_BLK * pRxBlk,
|
IN RX_BLK * pRxBlk,
|
||||||
IN UCHAR FromWhichBSSID)
|
u8 FromWhichBSSID)
|
||||||
{
|
{
|
||||||
struct reordering_mpdu *mpdu_blk;
|
struct reordering_mpdu *mpdu_blk;
|
||||||
UINT16 Sequence = (UINT16) pRxBlk->pHeader->Sequence;
|
u16 Sequence = (u16)pRxBlk->pHeader->Sequence;
|
||||||
|
|
||||||
mpdu_blk = ba_mpdu_blk_alloc(pAd);
|
mpdu_blk = ba_mpdu_blk_alloc(pAd);
|
||||||
if ((mpdu_blk != NULL) && (!RX_BLK_TEST_FLAG(pRxBlk, fRX_EAP))) {
|
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,
|
void Indicate_AMPDU_Packet(IN PRTMP_ADAPTER pAd,
|
||||||
IN RX_BLK * pRxBlk, IN UCHAR FromWhichBSSID)
|
IN RX_BLK * pRxBlk, u8 FromWhichBSSID)
|
||||||
{
|
{
|
||||||
USHORT Idx;
|
u16 Idx;
|
||||||
PBA_REC_ENTRY pBAEntry = NULL;
|
PBA_REC_ENTRY pBAEntry = NULL;
|
||||||
UINT16 Sequence = pRxBlk->pHeader->Sequence;
|
u16 Sequence = pRxBlk->pHeader->Sequence;
|
||||||
ULONG Now32;
|
unsigned long Now32;
|
||||||
UCHAR Wcid = pRxBlk->pRxWI->WirelessCliID;
|
u8 Wcid = pRxBlk->pRxWI->WirelessCliID;
|
||||||
UCHAR TID = pRxBlk->pRxWI->TID;
|
u8 TID = pRxBlk->pRxWI->TID;
|
||||||
|
|
||||||
if (!RX_BLK_TEST_FLAG(pRxBlk, fRX_AMSDU)
|
if (!RX_BLK_TEST_FLAG(pRxBlk, fRX_AMSDU)
|
||||||
&& (pRxBlk->DataSize > MAX_RX_PKT_LEN)) {
|
&& (pRxBlk->DataSize > MAX_RX_PKT_LEN)) {
|
||||||
@ -1578,7 +1578,7 @@ VOID Indicate_AMPDU_Packet(IN PRTMP_ADAPTER pAd,
|
|||||||
/* I. Check if in order. */
|
/* I. Check if in order. */
|
||||||
/* */
|
/* */
|
||||||
if (SEQ_STEPONE(Sequence, pBAEntry->LastIndSeq, MAXSEQ)) {
|
if (SEQ_STEPONE(Sequence, pBAEntry->LastIndSeq, MAXSEQ)) {
|
||||||
USHORT LastIndSeq;
|
u16 LastIndSeq;
|
||||||
|
|
||||||
pBAEntry->LastIndSeq = Sequence;
|
pBAEntry->LastIndSeq = Sequence;
|
||||||
INDICATE_LEGACY_OR_AMSDU(pAd, pRxBlk, FromWhichBSSID);
|
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 */
|
/* V. Receive seq surpasses Win(lastseq + nMSDU). So refresh all reorder buffer */
|
||||||
/* */
|
/* */
|
||||||
else {
|
else {
|
||||||
LONG WinStartSeq, TmpSeq;
|
long WinStartSeq, TmpSeq;
|
||||||
|
|
||||||
TmpSeq = Sequence - (pBAEntry->BAWinSize) - 1;
|
TmpSeq = Sequence - (pBAEntry->BAWinSize) - 1;
|
||||||
if (TmpSeq < 0) {
|
if (TmpSeq < 0) {
|
||||||
|
@ -38,8 +38,8 @@
|
|||||||
#include "../rt_config.h"
|
#include "../rt_config.h"
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
UINT32 erk[64]; /* encryption round keys */
|
u32 erk[64]; /* encryption round keys */
|
||||||
UINT32 drk[64]; /* decryption round keys */
|
u32 drk[64]; /* decryption round keys */
|
||||||
int nr; /* number of rounds */
|
int nr; /* number of rounds */
|
||||||
} aes_context;
|
} aes_context;
|
||||||
|
|
||||||
@ -47,7 +47,7 @@ typedef struct {
|
|||||||
/******** SBOX Table *********/
|
/******** SBOX Table *********/
|
||||||
/*****************************/
|
/*****************************/
|
||||||
|
|
||||||
UCHAR SboxTable[256] = {
|
u8 SboxTable[256] = {
|
||||||
0x63, 0x7c, 0x77, 0x7b, 0xf2, 0x6b, 0x6f, 0xc5,
|
0x63, 0x7c, 0x77, 0x7b, 0xf2, 0x6b, 0x6f, 0xc5,
|
||||||
0x30, 0x01, 0x67, 0x2b, 0xfe, 0xd7, 0xab, 0x76,
|
0x30, 0x01, 0x67, 0x2b, 0xfe, 0xd7, 0xab, 0x76,
|
||||||
0xca, 0x82, 0xc9, 0x7d, 0xfa, 0x59, 0x47, 0xf0,
|
0xca, 0x82, 0xc9, 0x7d, 0xfa, 0x59, 0x47, 0xf0,
|
||||||
@ -82,34 +82,34 @@ UCHAR SboxTable[256] = {
|
|||||||
0x41, 0x99, 0x2d, 0x0f, 0xb0, 0x54, 0xbb, 0x16
|
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++) {
|
for (i = 0; i < 4; i++) {
|
||||||
out[i] = a[i] ^ b[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++) {
|
for (i = 0; i < 16; i++) {
|
||||||
out[i] = a[i] ^ b[i];
|
out[i] = a[i] ^ b[i];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
UCHAR RTMPCkipSbox(IN UCHAR a)
|
u8 RTMPCkipSbox(u8 a)
|
||||||
{
|
{
|
||||||
return SboxTable[(int)a];
|
return SboxTable[(int)a];
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID next_key(IN PUCHAR key, IN INT round)
|
void next_key(u8 *key, int round)
|
||||||
{
|
{
|
||||||
UCHAR rcon;
|
u8 rcon;
|
||||||
UCHAR sbox_key[4];
|
u8 sbox_key[4];
|
||||||
UCHAR rcon_table[12] = {
|
u8 rcon_table[12] = {
|
||||||
0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80,
|
0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80,
|
||||||
0x1b, 0x36, 0x36, 0x36
|
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]);
|
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++) {
|
for (i = 0; i < 16; i++) {
|
||||||
out[i] = RTMPCkipSbox(in[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[0] = in[0];
|
||||||
out[1] = in[5];
|
out[1] = in[5];
|
||||||
@ -171,17 +171,17 @@ VOID shift_row(IN PUCHAR in, OUT PUCHAR out)
|
|||||||
out[15] = in[11];
|
out[15] = in[11];
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID mix_column(IN PUCHAR in, OUT PUCHAR out)
|
void mix_column(u8 *in, u8 *out)
|
||||||
{
|
{
|
||||||
INT i;
|
int i;
|
||||||
UCHAR add1b[4];
|
u8 add1b[4];
|
||||||
UCHAR add1bf7[4];
|
u8 add1bf7[4];
|
||||||
UCHAR rotl[4];
|
u8 rotl[4];
|
||||||
UCHAR swap_halfs[4];
|
u8 swap_halfs[4];
|
||||||
UCHAR andf7[4];
|
u8 andf7[4];
|
||||||
UCHAR rotr[4];
|
u8 rotr[4];
|
||||||
UCHAR temp[4];
|
u8 temp[4];
|
||||||
UCHAR tempb[4];
|
u8 tempb[4];
|
||||||
|
|
||||||
for (i = 0; i < 4; i++) {
|
for (i = 0; i < 4; i++) {
|
||||||
if ((in[i] & 0x80) == 0x80)
|
if ((in[i] & 0x80) == 0x80)
|
||||||
@ -409,40 +409,40 @@ void construct_ctr_preload(unsigned char *ctr_preload,
|
|||||||
}
|
}
|
||||||
|
|
||||||
BOOLEAN RTMPSoftDecryptAES(IN PRTMP_ADAPTER pAd,
|
BOOLEAN RTMPSoftDecryptAES(IN PRTMP_ADAPTER pAd,
|
||||||
IN PUCHAR pData,
|
u8 *pData,
|
||||||
IN ULONG DataByteCnt, IN PCIPHER_KEY pWpaKey)
|
unsigned long DataByteCnt, IN PCIPHER_KEY pWpaKey)
|
||||||
{
|
{
|
||||||
UCHAR KeyID;
|
u8 KeyID;
|
||||||
UINT HeaderLen;
|
u32 HeaderLen;
|
||||||
UCHAR PN[6];
|
u8 PN[6];
|
||||||
UINT payload_len;
|
u32 payload_len;
|
||||||
UINT num_blocks;
|
u32 num_blocks;
|
||||||
UINT payload_remainder;
|
u32 payload_remainder;
|
||||||
USHORT fc;
|
u16 fc;
|
||||||
UCHAR fc0;
|
u8 fc0;
|
||||||
UCHAR fc1;
|
u8 fc1;
|
||||||
UINT frame_type;
|
u32 frame_type;
|
||||||
UINT frame_subtype;
|
u32 frame_subtype;
|
||||||
UINT from_ds;
|
u32 from_ds;
|
||||||
UINT to_ds;
|
u32 to_ds;
|
||||||
INT a4_exists;
|
int a4_exists;
|
||||||
INT qc_exists;
|
int qc_exists;
|
||||||
UCHAR aes_out[16];
|
u8 aes_out[16];
|
||||||
int payload_index;
|
int payload_index;
|
||||||
UINT i;
|
u32 i;
|
||||||
UCHAR ctr_preload[16];
|
u8 ctr_preload[16];
|
||||||
UCHAR chain_buffer[16];
|
u8 chain_buffer[16];
|
||||||
UCHAR padded_buffer[16];
|
u8 padded_buffer[16];
|
||||||
UCHAR mic_iv[16];
|
u8 mic_iv[16];
|
||||||
UCHAR mic_header1[16];
|
u8 mic_header1[16];
|
||||||
UCHAR mic_header2[16];
|
u8 mic_header2[16];
|
||||||
UCHAR MIC[8];
|
u8 MIC[8];
|
||||||
UCHAR TrailMIC[8];
|
u8 TrailMIC[8];
|
||||||
|
|
||||||
fc0 = *pData;
|
fc0 = *pData;
|
||||||
fc1 = *(pData + 1);
|
fc1 = *(pData + 1);
|
||||||
|
|
||||||
fc = *((PUSHORT) pData);
|
fc = *((u16 *)pData);
|
||||||
|
|
||||||
frame_type = ((fc0 >> 2) & 0x03);
|
frame_type = ((fc0 >> 2) & 0x03);
|
||||||
frame_subtype = ((fc0 >> 4) & 0x0f);
|
frame_subtype = ((fc0 >> 4) & 0x0f);
|
||||||
@ -460,7 +460,7 @@ BOOLEAN RTMPSoftDecryptAES(IN PRTMP_ADAPTER pAd,
|
|||||||
if (a4_exists)
|
if (a4_exists)
|
||||||
HeaderLen += 6;
|
HeaderLen += 6;
|
||||||
|
|
||||||
KeyID = *((PUCHAR) (pData + HeaderLen + 3));
|
KeyID = *((u8 *)(pData + HeaderLen + 3));
|
||||||
KeyID = KeyID >> 6;
|
KeyID = KeyID >> 6;
|
||||||
|
|
||||||
if (pWpaKey[KeyID].KeyLen == 0) {
|
if (pWpaKey[KeyID].KeyLen == 0) {
|
||||||
@ -1202,16 +1202,16 @@ void rt_aes_decrypt(aes_context * ctx, uint8 input[16], uint8 output[16])
|
|||||||
Return:
|
Return:
|
||||||
==========================================================================
|
==========================================================================
|
||||||
*/
|
*/
|
||||||
VOID AES_GTK_KEY_WRAP(IN UCHAR * key,
|
void AES_GTK_KEY_WRAP(u8 * key,
|
||||||
IN UCHAR * plaintext,
|
u8 * plaintext,
|
||||||
IN UINT32 p_len, OUT UCHAR * ciphertext)
|
u32 p_len, u8 * ciphertext)
|
||||||
{
|
{
|
||||||
UCHAR A[8], BIN[16], BOUT[16];
|
u8 A[8], BIN[16], BOUT[16];
|
||||||
UCHAR R[512];
|
u8 R[512];
|
||||||
INT num_blocks = p_len / 8; /* unit:64bits */
|
int num_blocks = p_len / 8; /* unit:64bits */
|
||||||
INT i, j;
|
int i, j;
|
||||||
aes_context aesctx;
|
aes_context aesctx;
|
||||||
UCHAR xor;
|
u8 xor;
|
||||||
|
|
||||||
rt_aes_set_key(&aesctx, key, 128);
|
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,
|
void AES_GTK_KEY_UNWRAP(u8 * key,
|
||||||
OUT UCHAR * plaintext,
|
u8 * plaintext,
|
||||||
IN UINT32 c_len, IN UCHAR * ciphertext)
|
u32 c_len, u8 * ciphertext)
|
||||||
{
|
{
|
||||||
UCHAR A[8], BIN[16], BOUT[16];
|
u8 A[8], BIN[16], BOUT[16];
|
||||||
UCHAR xor;
|
u8 xor;
|
||||||
INT i, j;
|
int i, j;
|
||||||
aes_context aesctx;
|
aes_context aesctx;
|
||||||
UCHAR *R;
|
u8 *R;
|
||||||
INT num_blocks = c_len / 8; /* unit:64bits */
|
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) {
|
if (R == NULL) {
|
||||||
DBGPRINT(RT_DEBUG_ERROR,
|
DBGPRINT(RT_DEBUG_ERROR,
|
||||||
|
@ -177,7 +177,7 @@ RTMP_RF_REGS RF2850RegTable[] = {
|
|||||||
/* still lack of MMAC(Japan) ch 34,38,42,46 */
|
/* still lack of MMAC(Japan) ch 34,38,42,46 */
|
||||||
};
|
};
|
||||||
|
|
||||||
UCHAR NUM_OF_2850_CHNL = (sizeof(RF2850RegTable) / sizeof(RTMP_RF_REGS));
|
u8 NUM_OF_2850_CHNL = (sizeof(RF2850RegTable) / sizeof(RTMP_RF_REGS));
|
||||||
|
|
||||||
FREQUENCY_ITEM FreqItems3020[] = {
|
FREQUENCY_ITEM FreqItems3020[] = {
|
||||||
/**************************************************/
|
/**************************************************/
|
||||||
@ -216,11 +216,11 @@ FREQUENCY_ITEM FreqItems3020[] = {
|
|||||||
,
|
,
|
||||||
};
|
};
|
||||||
|
|
||||||
UCHAR NUM_OF_3020_CHNL = (sizeof(FreqItems3020) / sizeof(FREQUENCY_ITEM));
|
u8 NUM_OF_3020_CHNL = (sizeof(FreqItems3020) / sizeof(FREQUENCY_ITEM));
|
||||||
|
|
||||||
VOID AsicUpdateAutoFallBackTable(IN PRTMP_ADAPTER pAd, IN PUCHAR pRateTable)
|
void AsicUpdateAutoFallBackTable(IN PRTMP_ADAPTER pAd, u8 *pRateTable)
|
||||||
{
|
{
|
||||||
UCHAR i;
|
u8 i;
|
||||||
HT_FBK_CFG0_STRUC HtCfg0;
|
HT_FBK_CFG0_STRUC HtCfg0;
|
||||||
HT_FBK_CFG1_STRUC HtCfg1;
|
HT_FBK_CFG1_STRUC HtCfg1;
|
||||||
LG_FBK_CFG0_STRUC LgCfg0;
|
LG_FBK_CFG0_STRUC LgCfg0;
|
||||||
@ -234,7 +234,7 @@ VOID AsicUpdateAutoFallBackTable(IN PRTMP_ADAPTER pAd, IN PUCHAR pRateTable)
|
|||||||
LgCfg1.word = 0x00002100;
|
LgCfg1.word = 0x00002100;
|
||||||
|
|
||||||
pNextTxRate = (PRTMP_TX_RATE_SWITCH) pRateTable + 1;
|
pNextTxRate = (PRTMP_TX_RATE_SWITCH) pRateTable + 1;
|
||||||
for (i = 1; i < *((PUCHAR) pRateTable); i++) {
|
for (i = 1; i < *((u8 *)pRateTable); i++) {
|
||||||
pCurrTxRate = (PRTMP_TX_RATE_SWITCH) pRateTable + 1 + i;
|
pCurrTxRate = (PRTMP_TX_RATE_SWITCH) pRateTable + 1 + i;
|
||||||
switch (pCurrTxRate->Mode) {
|
switch (pCurrTxRate->Mode) {
|
||||||
case 0: /*CCK */
|
case 0: /*CCK */
|
||||||
@ -417,16 +417,16 @@ VOID AsicUpdateAutoFallBackTable(IN PRTMP_ADAPTER pAd, IN PUCHAR pRateTable)
|
|||||||
we should choose not to use GF. But still set correct ASIC registers.
|
we should choose not to use GF. But still set correct ASIC registers.
|
||||||
========================================================================
|
========================================================================
|
||||||
*/
|
*/
|
||||||
VOID AsicUpdateProtect(IN PRTMP_ADAPTER pAd,
|
void AsicUpdateProtect(IN PRTMP_ADAPTER pAd,
|
||||||
IN USHORT OperationMode,
|
u16 OperationMode,
|
||||||
IN UCHAR SetMask,
|
u8 SetMask,
|
||||||
IN BOOLEAN bDisableBGProtect, IN BOOLEAN bNonGFExist)
|
IN BOOLEAN bDisableBGProtect, IN BOOLEAN bNonGFExist)
|
||||||
{
|
{
|
||||||
PROT_CFG_STRUC ProtCfg, ProtCfg4;
|
PROT_CFG_STRUC ProtCfg, ProtCfg4;
|
||||||
UINT32 Protect[6];
|
u32 Protect[6];
|
||||||
USHORT offset;
|
u16 offset;
|
||||||
UCHAR i;
|
u8 i;
|
||||||
UINT32 MacReg = 0;
|
u32 MacReg = 0;
|
||||||
|
|
||||||
if (!(pAd->CommonCfg.bHTProtect) && (OperationMode != 8)) {
|
if (!(pAd->CommonCfg.bHTProtect) && (OperationMode != 8)) {
|
||||||
return;
|
return;
|
||||||
@ -631,14 +631,14 @@ VOID AsicUpdateProtect(IN PRTMP_ADAPTER pAd,
|
|||||||
|
|
||||||
==========================================================================
|
==========================================================================
|
||||||
*/
|
*/
|
||||||
VOID AsicSwitchChannel(IN PRTMP_ADAPTER pAd, IN UCHAR Channel, IN BOOLEAN bScan)
|
void AsicSwitchChannel(IN PRTMP_ADAPTER pAd, u8 Channel, IN BOOLEAN bScan)
|
||||||
{
|
{
|
||||||
ULONG R2 = 0, R3 = DEFAULT_RF_TX_POWER, R4 = 0;
|
unsigned long R2 = 0, R3 = DEFAULT_RF_TX_POWER, R4 = 0;
|
||||||
CHAR TxPwer = 0, TxPwer2 = DEFAULT_RF_TX_POWER; /*Bbp94 = BBPR94_DEFAULT, TxPwer2 = DEFAULT_RF_TX_POWER; */
|
char TxPwer = 0, TxPwer2 = DEFAULT_RF_TX_POWER; /*Bbp94 = BBPR94_DEFAULT, TxPwer2 = DEFAULT_RF_TX_POWER; */
|
||||||
UCHAR index;
|
u8 index;
|
||||||
UINT32 Value = 0; /*BbpReg, Value; */
|
u32 Value = 0; /*BbpReg, Value; */
|
||||||
RTMP_RF_REGS *RFRegTable;
|
RTMP_RF_REGS *RFRegTable;
|
||||||
UCHAR RFValue;
|
u8 RFValue;
|
||||||
|
|
||||||
RFValue = 0;
|
RFValue = 0;
|
||||||
/* Search Tx power value */
|
/* Search Tx power value */
|
||||||
@ -891,7 +891,7 @@ VOID AsicSwitchChannel(IN PRTMP_ADAPTER pAd, IN UCHAR Channel, IN BOOLEAN bScan)
|
|||||||
|
|
||||||
/* Change BBP setting during siwtch from a->g, g->a */
|
/* Change BBP setting during siwtch from a->g, g->a */
|
||||||
if (Channel <= 14) {
|
if (Channel <= 14) {
|
||||||
ULONG TxPinCfg = 0x00050F0A; /*Gary 2007/08/09 0x050A0A */
|
unsigned long TxPinCfg = 0x00050F0A; /*Gary 2007/08/09 0x050A0A */
|
||||||
|
|
||||||
RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R62,
|
RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R62,
|
||||||
(0x37 - GET_LNA_GAIN(pAd)));
|
(0x37 - GET_LNA_GAIN(pAd)));
|
||||||
@ -951,7 +951,7 @@ VOID AsicSwitchChannel(IN PRTMP_ADAPTER pAd, IN UCHAR Channel, IN BOOLEAN bScan)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
} else {
|
} else {
|
||||||
ULONG TxPinCfg = 0x00050F05; /*Gary 2007/8/9 0x050505 */
|
unsigned long TxPinCfg = 0x00050F05; /*Gary 2007/8/9 0x050505 */
|
||||||
|
|
||||||
RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R62,
|
RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R62,
|
||||||
(0x37 - GET_LNA_GAIN(pAd)));
|
(0x37 - GET_LNA_GAIN(pAd)));
|
||||||
@ -1002,7 +1002,7 @@ VOID AsicSwitchChannel(IN PRTMP_ADAPTER pAd, IN UCHAR Channel, IN BOOLEAN bScan)
|
|||||||
RTMPusecDelay(1000);
|
RTMPusecDelay(1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID AsicResetBBPAgent(IN PRTMP_ADAPTER pAd)
|
void AsicResetBBPAgent(IN PRTMP_ADAPTER pAd)
|
||||||
{
|
{
|
||||||
BBP_CSR_CFG_STRUC BbpCsr;
|
BBP_CSR_CFG_STRUC BbpCsr;
|
||||||
DBGPRINT(RT_DEBUG_ERROR, ("Reset BBP Agent busy bit.!! \n"));
|
DBGPRINT(RT_DEBUG_ERROR, ("Reset BBP Agent busy bit.!! \n"));
|
||||||
@ -1025,13 +1025,13 @@ VOID AsicResetBBPAgent(IN PRTMP_ADAPTER pAd)
|
|||||||
|
|
||||||
==========================================================================
|
==========================================================================
|
||||||
*/
|
*/
|
||||||
VOID AsicLockChannel(IN PRTMP_ADAPTER pAd, IN UCHAR Channel)
|
void AsicLockChannel(IN PRTMP_ADAPTER pAd, u8 Channel)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID AsicRfTuningExec(IN PVOID SystemSpecific1,
|
void AsicRfTuningExec(void *SystemSpecific1,
|
||||||
IN PVOID FunctionContext,
|
void *FunctionContext,
|
||||||
IN PVOID SystemSpecific2, IN PVOID SystemSpecific3)
|
void *SystemSpecific2, void *SystemSpecific3)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1052,17 +1052,17 @@ VOID AsicRfTuningExec(IN PVOID SystemSpecific1,
|
|||||||
it should be called AFTER MlmeDynamicTxRatSwitching()
|
it should be called AFTER MlmeDynamicTxRatSwitching()
|
||||||
==========================================================================
|
==========================================================================
|
||||||
*/
|
*/
|
||||||
VOID AsicAdjustTxPower(IN PRTMP_ADAPTER pAd)
|
void AsicAdjustTxPower(IN PRTMP_ADAPTER pAd)
|
||||||
{
|
{
|
||||||
INT i, j;
|
int i, j;
|
||||||
CHAR DeltaPwr = 0;
|
char DeltaPwr = 0;
|
||||||
BOOLEAN bAutoTxAgc = FALSE;
|
BOOLEAN bAutoTxAgc = FALSE;
|
||||||
UCHAR TssiRef, *pTssiMinusBoundary, *pTssiPlusBoundary, TxAgcStep;
|
u8 TssiRef, *pTssiMinusBoundary, *pTssiPlusBoundary, TxAgcStep;
|
||||||
UCHAR BbpR1 = 0, BbpR49 = 0, idx;
|
u8 BbpR1 = 0, BbpR49 = 0, idx;
|
||||||
PCHAR pTxAgcCompensate;
|
char *pTxAgcCompensate;
|
||||||
ULONG TxPwr[5];
|
unsigned long TxPwr[5];
|
||||||
CHAR Value;
|
char Value;
|
||||||
CHAR Rssi = -127;
|
char Rssi = -127;
|
||||||
|
|
||||||
if (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_DOZE) ||
|
if (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_DOZE) ||
|
||||||
#ifdef RTMP_MAC_PCI
|
#ifdef RTMP_MAC_PCI
|
||||||
@ -1152,10 +1152,10 @@ VOID AsicAdjustTxPower(IN PRTMP_ADAPTER pAd)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
/* The index is the step we should decrease, idx = 0 means there is nothing to compensate */
|
/* The index is the step we should decrease, idx = 0 means there is nothing to compensate */
|
||||||
/* if (R3 > (ULONG) (TxAgcStep * (idx-1))) */
|
/* if (R3 > (unsigned long)(TxAgcStep * (idx-1))) */
|
||||||
*pTxAgcCompensate = -(TxAgcStep * (idx - 1));
|
*pTxAgcCompensate = -(TxAgcStep * (idx - 1));
|
||||||
/* else */
|
/* else */
|
||||||
/* *pTxAgcCompensate = -((UCHAR)R3); */
|
/* *pTxAgcCompensate = -((u8)R3); */
|
||||||
|
|
||||||
DeltaPwr += (*pTxAgcCompensate);
|
DeltaPwr += (*pTxAgcCompensate);
|
||||||
DBGPRINT(RT_DEBUG_TRACE,
|
DBGPRINT(RT_DEBUG_TRACE,
|
||||||
@ -1236,7 +1236,7 @@ VOID AsicAdjustTxPower(IN PRTMP_ADAPTER pAd)
|
|||||||
for (i = 0; i < 5; i++) {
|
for (i = 0; i < 5; i++) {
|
||||||
if (TxPwr[i] != 0xffffffff) {
|
if (TxPwr[i] != 0xffffffff) {
|
||||||
for (j = 0; j < 8; j++) {
|
for (j = 0; j < 8; j++) {
|
||||||
Value = (CHAR) ((TxPwr[i] >> j * 4) & 0x0F); /* 0 ~ 15 */
|
Value = (char)((TxPwr[i] >> j * 4) & 0x0F); /* 0 ~ 15 */
|
||||||
|
|
||||||
if ((Value + DeltaPwr) < 0) {
|
if ((Value + DeltaPwr) < 0) {
|
||||||
Value = 0; /* min */
|
Value = 0; /* min */
|
||||||
@ -1277,8 +1277,8 @@ VOID AsicAdjustTxPower(IN PRTMP_ADAPTER pAd)
|
|||||||
|
|
||||||
==========================================================================
|
==========================================================================
|
||||||
*/
|
*/
|
||||||
VOID AsicSleepThenAutoWakeup(IN PRTMP_ADAPTER pAd,
|
void AsicSleepThenAutoWakeup(IN PRTMP_ADAPTER pAd,
|
||||||
IN USHORT TbttNumToNextWakeUp)
|
u16 TbttNumToNextWakeUp)
|
||||||
{
|
{
|
||||||
RTMP_STA_SLEEP_THEN_AUTO_WAKEUP(pAd, TbttNumToNextWakeUp);
|
RTMP_STA_SLEEP_THEN_AUTO_WAKEUP(pAd, TbttNumToNextWakeUp);
|
||||||
}
|
}
|
||||||
@ -1291,7 +1291,7 @@ VOID AsicSleepThenAutoWakeup(IN PRTMP_ADAPTER pAd,
|
|||||||
in INFRA BSS, we should use AsicSleepThenAutoWakeup() instead.
|
in INFRA BSS, we should use AsicSleepThenAutoWakeup() instead.
|
||||||
==========================================================================
|
==========================================================================
|
||||||
*/
|
*/
|
||||||
VOID AsicForceSleep(IN PRTMP_ADAPTER pAd)
|
void AsicForceSleep(IN PRTMP_ADAPTER pAd)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -1306,7 +1306,7 @@ VOID AsicForceSleep(IN PRTMP_ADAPTER pAd)
|
|||||||
IRQL = DISPATCH_LEVEL
|
IRQL = DISPATCH_LEVEL
|
||||||
==========================================================================
|
==========================================================================
|
||||||
*/
|
*/
|
||||||
VOID AsicForceWakeup(IN PRTMP_ADAPTER pAd, IN BOOLEAN bFromTx)
|
void AsicForceWakeup(IN PRTMP_ADAPTER pAd, IN BOOLEAN bFromTx)
|
||||||
{
|
{
|
||||||
DBGPRINT(RT_DEBUG_INFO, ("--> AsicForceWakeup \n"));
|
DBGPRINT(RT_DEBUG_INFO, ("--> AsicForceWakeup \n"));
|
||||||
RTMP_STA_FORCE_WAKEUP(pAd, bFromTx);
|
RTMP_STA_FORCE_WAKEUP(pAd, bFromTx);
|
||||||
@ -1321,29 +1321,29 @@ VOID AsicForceWakeup(IN PRTMP_ADAPTER pAd, IN BOOLEAN bFromTx)
|
|||||||
|
|
||||||
==========================================================================
|
==========================================================================
|
||||||
*/
|
*/
|
||||||
VOID AsicSetBssid(IN PRTMP_ADAPTER pAd, IN PUCHAR pBssid)
|
void AsicSetBssid(IN PRTMP_ADAPTER pAd, u8 *pBssid)
|
||||||
{
|
{
|
||||||
ULONG Addr4;
|
unsigned long Addr4;
|
||||||
DBGPRINT(RT_DEBUG_TRACE,
|
DBGPRINT(RT_DEBUG_TRACE,
|
||||||
("==============> AsicSetBssid %x:%x:%x:%x:%x:%x\n", pBssid[0],
|
("==============> AsicSetBssid %x:%x:%x:%x:%x:%x\n", pBssid[0],
|
||||||
pBssid[1], pBssid[2], pBssid[3], pBssid[4], pBssid[5]));
|
pBssid[1], pBssid[2], pBssid[3], pBssid[4], pBssid[5]));
|
||||||
|
|
||||||
Addr4 = (ULONG) (pBssid[0]) |
|
Addr4 = (unsigned long)(pBssid[0]) |
|
||||||
(ULONG) (pBssid[1] << 8) |
|
(unsigned long)(pBssid[1] << 8) |
|
||||||
(ULONG) (pBssid[2] << 16) | (ULONG) (pBssid[3] << 24);
|
(unsigned long)(pBssid[2] << 16) | (unsigned long)(pBssid[3] << 24);
|
||||||
RTMP_IO_WRITE32(pAd, MAC_BSSID_DW0, Addr4);
|
RTMP_IO_WRITE32(pAd, MAC_BSSID_DW0, Addr4);
|
||||||
|
|
||||||
Addr4 = 0;
|
Addr4 = 0;
|
||||||
/* always one BSSID in STA mode */
|
/* always one BSSID in STA mode */
|
||||||
Addr4 = (ULONG) (pBssid[4]) | (ULONG) (pBssid[5] << 8);
|
Addr4 = (unsigned long)(pBssid[4]) | (unsigned long)(pBssid[5] << 8);
|
||||||
|
|
||||||
RTMP_IO_WRITE32(pAd, MAC_BSSID_DW1, Addr4);
|
RTMP_IO_WRITE32(pAd, MAC_BSSID_DW1, Addr4);
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID AsicSetMcastWC(IN PRTMP_ADAPTER pAd)
|
void AsicSetMcastWC(IN PRTMP_ADAPTER pAd)
|
||||||
{
|
{
|
||||||
MAC_TABLE_ENTRY *pEntry = &pAd->MacTab.Content[MCAST_WCID];
|
MAC_TABLE_ENTRY *pEntry = &pAd->MacTab.Content[MCAST_WCID];
|
||||||
USHORT offset;
|
u16 offset;
|
||||||
|
|
||||||
pEntry->Sst = SST_ASSOC;
|
pEntry->Sst = SST_ASSOC;
|
||||||
pEntry->Aid = MCAST_WCID; /* Softap supports 1 BSSID and use WCID=0 as multicast Wcid index */
|
pEntry->Aid = MCAST_WCID; /* Softap supports 1 BSSID and use WCID=0 as multicast Wcid index */
|
||||||
@ -1360,10 +1360,10 @@ VOID AsicSetMcastWC(IN PRTMP_ADAPTER pAd)
|
|||||||
|
|
||||||
==========================================================================
|
==========================================================================
|
||||||
*/
|
*/
|
||||||
VOID AsicDelWcidTab(IN PRTMP_ADAPTER pAd, IN UCHAR Wcid)
|
void AsicDelWcidTab(IN PRTMP_ADAPTER pAd, u8 Wcid)
|
||||||
{
|
{
|
||||||
ULONG Addr0 = 0x0, Addr1 = 0x0;
|
unsigned long Addr0 = 0x0, Addr1 = 0x0;
|
||||||
ULONG offset;
|
unsigned long offset;
|
||||||
|
|
||||||
DBGPRINT(RT_DEBUG_TRACE, ("AsicDelWcidTab==>Wcid = 0x%x\n", Wcid));
|
DBGPRINT(RT_DEBUG_TRACE, ("AsicDelWcidTab==>Wcid = 0x%x\n", Wcid));
|
||||||
offset = MAC_WCID_BASE + Wcid * HW_WCID_ENTRY_SIZE;
|
offset = MAC_WCID_BASE + Wcid * HW_WCID_ENTRY_SIZE;
|
||||||
@ -1380,10 +1380,10 @@ VOID AsicDelWcidTab(IN PRTMP_ADAPTER pAd, IN UCHAR Wcid)
|
|||||||
|
|
||||||
==========================================================================
|
==========================================================================
|
||||||
*/
|
*/
|
||||||
VOID AsicEnableRDG(IN PRTMP_ADAPTER pAd)
|
void AsicEnableRDG(IN PRTMP_ADAPTER pAd)
|
||||||
{
|
{
|
||||||
TX_LINK_CFG_STRUC TxLinkCfg;
|
TX_LINK_CFG_STRUC TxLinkCfg;
|
||||||
UINT32 Data = 0;
|
u32 Data = 0;
|
||||||
|
|
||||||
RTMP_IO_READ32(pAd, TX_LINK_CFG, &TxLinkCfg.word);
|
RTMP_IO_READ32(pAd, TX_LINK_CFG, &TxLinkCfg.word);
|
||||||
TxLinkCfg.field.TxRDGEn = 1;
|
TxLinkCfg.field.TxRDGEn = 1;
|
||||||
@ -1405,10 +1405,10 @@ VOID AsicEnableRDG(IN PRTMP_ADAPTER pAd)
|
|||||||
|
|
||||||
==========================================================================
|
==========================================================================
|
||||||
*/
|
*/
|
||||||
VOID AsicDisableRDG(IN PRTMP_ADAPTER pAd)
|
void AsicDisableRDG(IN PRTMP_ADAPTER pAd)
|
||||||
{
|
{
|
||||||
TX_LINK_CFG_STRUC TxLinkCfg;
|
TX_LINK_CFG_STRUC TxLinkCfg;
|
||||||
UINT32 Data = 0;
|
u32 Data = 0;
|
||||||
|
|
||||||
RTMP_IO_READ32(pAd, TX_LINK_CFG, &TxLinkCfg.word);
|
RTMP_IO_READ32(pAd, TX_LINK_CFG, &TxLinkCfg.word);
|
||||||
TxLinkCfg.field.TxRDGEn = 0;
|
TxLinkCfg.field.TxRDGEn = 0;
|
||||||
@ -1441,7 +1441,7 @@ VOID AsicDisableRDG(IN PRTMP_ADAPTER pAd)
|
|||||||
|
|
||||||
==========================================================================
|
==========================================================================
|
||||||
*/
|
*/
|
||||||
VOID AsicDisableSync(IN PRTMP_ADAPTER pAd)
|
void AsicDisableSync(IN PRTMP_ADAPTER pAd)
|
||||||
{
|
{
|
||||||
BCN_TIME_CFG_STRUC csr;
|
BCN_TIME_CFG_STRUC csr;
|
||||||
|
|
||||||
@ -1468,7 +1468,7 @@ VOID AsicDisableSync(IN PRTMP_ADAPTER pAd)
|
|||||||
|
|
||||||
==========================================================================
|
==========================================================================
|
||||||
*/
|
*/
|
||||||
VOID AsicEnableBssSync(IN PRTMP_ADAPTER pAd)
|
void AsicEnableBssSync(IN PRTMP_ADAPTER pAd)
|
||||||
{
|
{
|
||||||
BCN_TIME_CFG_STRUC csr;
|
BCN_TIME_CFG_STRUC csr;
|
||||||
|
|
||||||
@ -1498,11 +1498,11 @@ VOID AsicEnableBssSync(IN PRTMP_ADAPTER pAd)
|
|||||||
|
|
||||||
==========================================================================
|
==========================================================================
|
||||||
*/
|
*/
|
||||||
VOID AsicEnableIbssSync(IN PRTMP_ADAPTER pAd)
|
void AsicEnableIbssSync(IN PRTMP_ADAPTER pAd)
|
||||||
{
|
{
|
||||||
BCN_TIME_CFG_STRUC csr9;
|
BCN_TIME_CFG_STRUC csr9;
|
||||||
PUCHAR ptr;
|
u8 *ptr;
|
||||||
UINT i;
|
u32 i;
|
||||||
|
|
||||||
DBGPRINT(RT_DEBUG_TRACE,
|
DBGPRINT(RT_DEBUG_TRACE,
|
||||||
("--->AsicEnableIbssSync(ADHOC mode. MPDUtotalByteCount = %d)\n",
|
("--->AsicEnableIbssSync(ADHOC mode. MPDUtotalByteCount = %d)\n",
|
||||||
@ -1516,10 +1516,10 @@ VOID AsicEnableIbssSync(IN PRTMP_ADAPTER pAd)
|
|||||||
|
|
||||||
#ifdef RTMP_MAC_PCI
|
#ifdef RTMP_MAC_PCI
|
||||||
/* move BEACON TXD and frame content to on-chip memory */
|
/* move BEACON TXD and frame content to on-chip memory */
|
||||||
ptr = (PUCHAR) & pAd->BeaconTxWI;
|
ptr = (u8 *)& pAd->BeaconTxWI;
|
||||||
for (i = 0; i < TXWI_SIZE; i += 4) /* 16-byte TXWI field */
|
for (i = 0; i < TXWI_SIZE; i += 4) /* 16-byte TXWI field */
|
||||||
{
|
{
|
||||||
UINT32 longptr =
|
u32 longptr =
|
||||||
*ptr + (*(ptr + 1) << 8) + (*(ptr + 2) << 16) +
|
*ptr + (*(ptr + 1) << 8) + (*(ptr + 2) << 16) +
|
||||||
(*(ptr + 3) << 24);
|
(*(ptr + 3) << 24);
|
||||||
RTMP_IO_WRITE32(pAd, HW_BEACON_BASE0 + i, longptr);
|
RTMP_IO_WRITE32(pAd, HW_BEACON_BASE0 + i, longptr);
|
||||||
@ -1529,7 +1529,7 @@ VOID AsicEnableIbssSync(IN PRTMP_ADAPTER pAd)
|
|||||||
/* start right after the 16-byte TXWI field */
|
/* start right after the 16-byte TXWI field */
|
||||||
ptr = pAd->BeaconBuf;
|
ptr = pAd->BeaconBuf;
|
||||||
for (i = 0; i < pAd->BeaconTxWI.MPDUtotalByteCount; i += 4) {
|
for (i = 0; i < pAd->BeaconTxWI.MPDUtotalByteCount; i += 4) {
|
||||||
UINT32 longptr =
|
u32 longptr =
|
||||||
*ptr + (*(ptr + 1) << 8) + (*(ptr + 2) << 16) +
|
*ptr + (*(ptr + 1) << 8) + (*(ptr + 2) << 16) +
|
||||||
(*(ptr + 3) << 24);
|
(*(ptr + 3) << 24);
|
||||||
RTMP_IO_WRITE32(pAd, HW_BEACON_BASE0 + TXWI_SIZE + i, longptr);
|
RTMP_IO_WRITE32(pAd, HW_BEACON_BASE0 + TXWI_SIZE + i, longptr);
|
||||||
@ -1538,10 +1538,10 @@ VOID AsicEnableIbssSync(IN PRTMP_ADAPTER pAd)
|
|||||||
#endif /* RTMP_MAC_PCI // */
|
#endif /* RTMP_MAC_PCI // */
|
||||||
#ifdef RTMP_MAC_USB
|
#ifdef RTMP_MAC_USB
|
||||||
/* move BEACON TXD and frame content to on-chip memory */
|
/* move BEACON TXD and frame content to on-chip memory */
|
||||||
ptr = (PUCHAR) & pAd->BeaconTxWI;
|
ptr = (u8 *)& pAd->BeaconTxWI;
|
||||||
for (i = 0; i < TXWI_SIZE; i += 2) /* 16-byte TXWI field */
|
for (i = 0; i < TXWI_SIZE; i += 2) /* 16-byte TXWI field */
|
||||||
{
|
{
|
||||||
/*UINT32 longptr = *ptr + (*(ptr+1)<<8) + (*(ptr+2)<<16) + (*(ptr+3)<<24); */
|
/*u32 longptr = *ptr + (*(ptr+1)<<8) + (*(ptr+2)<<16) + (*(ptr+3)<<24); */
|
||||||
/*RTMP_IO_WRITE32(pAd, HW_BEACON_BASE0 + i, longptr); */
|
/*RTMP_IO_WRITE32(pAd, HW_BEACON_BASE0 + i, longptr); */
|
||||||
RTUSBMultiWrite(pAd, HW_BEACON_BASE0 + i, ptr, 2);
|
RTUSBMultiWrite(pAd, HW_BEACON_BASE0 + i, ptr, 2);
|
||||||
ptr += 2;
|
ptr += 2;
|
||||||
@ -1550,7 +1550,7 @@ VOID AsicEnableIbssSync(IN PRTMP_ADAPTER pAd)
|
|||||||
/* start right after the 16-byte TXWI field */
|
/* start right after the 16-byte TXWI field */
|
||||||
ptr = pAd->BeaconBuf;
|
ptr = pAd->BeaconBuf;
|
||||||
for (i = 0; i < pAd->BeaconTxWI.MPDUtotalByteCount; i += 2) {
|
for (i = 0; i < pAd->BeaconTxWI.MPDUtotalByteCount; i += 2) {
|
||||||
/*UINT32 longptr = *ptr + (*(ptr+1)<<8) + (*(ptr+2)<<16) + (*(ptr+3)<<24); */
|
/*u32 longptr = *ptr + (*(ptr+1)<<8) + (*(ptr+2)<<16) + (*(ptr+3)<<24); */
|
||||||
/*RTMP_IO_WRITE32(pAd, HW_BEACON_BASE0 + TXWI_SIZE + i, longptr); */
|
/*RTMP_IO_WRITE32(pAd, HW_BEACON_BASE0 + TXWI_SIZE + i, longptr); */
|
||||||
RTUSBMultiWrite(pAd, HW_BEACON_BASE0 + TXWI_SIZE + i, ptr, 2);
|
RTUSBMultiWrite(pAd, HW_BEACON_BASE0 + TXWI_SIZE + i, ptr, 2);
|
||||||
ptr += 2;
|
ptr += 2;
|
||||||
@ -1581,7 +1581,7 @@ VOID AsicEnableIbssSync(IN PRTMP_ADAPTER pAd)
|
|||||||
|
|
||||||
==========================================================================
|
==========================================================================
|
||||||
*/
|
*/
|
||||||
VOID AsicSetEdcaParm(IN PRTMP_ADAPTER pAd, IN PEDCA_PARM pEdcaParm)
|
void AsicSetEdcaParm(IN PRTMP_ADAPTER pAd, IN PEDCA_PARM pEdcaParm)
|
||||||
{
|
{
|
||||||
EDCA_AC_CFG_STRUC Ac0Cfg, Ac1Cfg, Ac2Cfg, Ac3Cfg;
|
EDCA_AC_CFG_STRUC Ac0Cfg, Ac1Cfg, Ac2Cfg, Ac3Cfg;
|
||||||
AC_TXOP_CSR0_STRUC csr0;
|
AC_TXOP_CSR0_STRUC csr0;
|
||||||
@ -1862,10 +1862,10 @@ VOID AsicSetEdcaParm(IN PRTMP_ADAPTER pAd, IN PEDCA_PARM pEdcaParm)
|
|||||||
|
|
||||||
==========================================================================
|
==========================================================================
|
||||||
*/
|
*/
|
||||||
VOID AsicSetSlotTime(IN PRTMP_ADAPTER pAd, IN BOOLEAN bUseShortSlotTime)
|
void AsicSetSlotTime(IN PRTMP_ADAPTER pAd, IN BOOLEAN bUseShortSlotTime)
|
||||||
{
|
{
|
||||||
ULONG SlotTime;
|
unsigned long SlotTime;
|
||||||
UINT32 RegValue = 0;
|
u32 RegValue = 0;
|
||||||
|
|
||||||
if (pAd->CommonCfg.Channel > 14)
|
if (pAd->CommonCfg.Channel > 14)
|
||||||
bUseShortSlotTime = TRUE;
|
bUseShortSlotTime = TRUE;
|
||||||
@ -1930,16 +1930,16 @@ VOID AsicSetSlotTime(IN PRTMP_ADAPTER pAd, IN BOOLEAN bUseShortSlotTime)
|
|||||||
Return:
|
Return:
|
||||||
========================================================================
|
========================================================================
|
||||||
*/
|
*/
|
||||||
VOID AsicAddSharedKeyEntry(IN PRTMP_ADAPTER pAd,
|
void AsicAddSharedKeyEntry(IN PRTMP_ADAPTER pAd,
|
||||||
IN UCHAR BssIndex,
|
u8 BssIndex,
|
||||||
IN UCHAR KeyIdx,
|
u8 KeyIdx,
|
||||||
IN UCHAR CipherAlg,
|
u8 CipherAlg,
|
||||||
IN PUCHAR pKey, IN PUCHAR pTxMic, IN PUCHAR pRxMic)
|
u8 *pKey, u8 *pTxMic, u8 *pRxMic)
|
||||||
{
|
{
|
||||||
ULONG offset; /*, csr0; */
|
unsigned long offset; /*, csr0; */
|
||||||
SHAREDKEY_MODE_STRUC csr1;
|
SHAREDKEY_MODE_STRUC csr1;
|
||||||
#ifdef RTMP_MAC_PCI
|
#ifdef RTMP_MAC_PCI
|
||||||
INT i;
|
int i;
|
||||||
#endif /* RTMP_MAC_PCI // */
|
#endif /* RTMP_MAC_PCI // */
|
||||||
|
|
||||||
DBGPRINT(RT_DEBUG_TRACE,
|
DBGPRINT(RT_DEBUG_TRACE,
|
||||||
@ -2048,10 +2048,10 @@ VOID AsicAddSharedKeyEntry(IN PRTMP_ADAPTER pAd,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* IRQL = DISPATCH_LEVEL */
|
/* IRQL = DISPATCH_LEVEL */
|
||||||
VOID AsicRemoveSharedKeyEntry(IN PRTMP_ADAPTER pAd,
|
void AsicRemoveSharedKeyEntry(IN PRTMP_ADAPTER pAd,
|
||||||
IN UCHAR BssIndex, IN UCHAR KeyIdx)
|
u8 BssIndex, u8 KeyIdx)
|
||||||
{
|
{
|
||||||
/*ULONG SecCsr0; */
|
/*unsigned long SecCsr0; */
|
||||||
SHAREDKEY_MODE_STRUC csr1;
|
SHAREDKEY_MODE_STRUC csr1;
|
||||||
|
|
||||||
DBGPRINT(RT_DEBUG_TRACE,
|
DBGPRINT(RT_DEBUG_TRACE,
|
||||||
@ -2088,13 +2088,13 @@ VOID AsicRemoveSharedKeyEntry(IN PRTMP_ADAPTER pAd,
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID AsicUpdateWCIDAttribute(IN PRTMP_ADAPTER pAd,
|
void AsicUpdateWCIDAttribute(IN PRTMP_ADAPTER pAd,
|
||||||
IN USHORT WCID,
|
u16 WCID,
|
||||||
IN UCHAR BssIndex,
|
u8 BssIndex,
|
||||||
IN UCHAR CipherAlg,
|
u8 CipherAlg,
|
||||||
IN BOOLEAN bUsePairewiseKeyTable)
|
IN BOOLEAN bUsePairewiseKeyTable)
|
||||||
{
|
{
|
||||||
ULONG WCIDAttri = 0, offset;
|
unsigned long WCIDAttri = 0, offset;
|
||||||
|
|
||||||
/* */
|
/* */
|
||||||
/* Update WCID attribute. */
|
/* Update WCID attribute. */
|
||||||
@ -2106,10 +2106,10 @@ VOID AsicUpdateWCIDAttribute(IN PRTMP_ADAPTER pAd,
|
|||||||
RTMP_IO_WRITE32(pAd, offset, WCIDAttri);
|
RTMP_IO_WRITE32(pAd, offset, WCIDAttri);
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID AsicUpdateWCIDIVEIV(IN PRTMP_ADAPTER pAd,
|
void AsicUpdateWCIDIVEIV(IN PRTMP_ADAPTER pAd,
|
||||||
IN USHORT WCID, IN ULONG uIV, IN ULONG uEIV)
|
u16 WCID, unsigned long uIV, unsigned long uEIV)
|
||||||
{
|
{
|
||||||
ULONG offset;
|
unsigned long offset;
|
||||||
|
|
||||||
offset = MAC_IVEIV_TABLE_BASE + (WCID * HW_IVEIV_ENTRY_SIZE);
|
offset = MAC_IVEIV_TABLE_BASE + (WCID * HW_IVEIV_ENTRY_SIZE);
|
||||||
|
|
||||||
@ -2117,11 +2117,11 @@ VOID AsicUpdateWCIDIVEIV(IN PRTMP_ADAPTER pAd,
|
|||||||
RTMP_IO_WRITE32(pAd, offset + 4, uEIV);
|
RTMP_IO_WRITE32(pAd, offset + 4, uEIV);
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID AsicUpdateRxWCIDTable(IN PRTMP_ADAPTER pAd,
|
void AsicUpdateRxWCIDTable(IN PRTMP_ADAPTER pAd,
|
||||||
IN USHORT WCID, IN PUCHAR pAddr)
|
u16 WCID, u8 *pAddr)
|
||||||
{
|
{
|
||||||
ULONG offset;
|
unsigned long offset;
|
||||||
ULONG Addr;
|
unsigned long Addr;
|
||||||
|
|
||||||
offset = MAC_WCID_BASE + (WCID * HW_WCID_ENTRY_SIZE);
|
offset = MAC_WCID_BASE + (WCID * HW_WCID_ENTRY_SIZE);
|
||||||
Addr = pAddr[0] + (pAddr[1] << 8) + (pAddr[2] << 16) + (pAddr[3] << 24);
|
Addr = pAddr[0] + (pAddr[1] << 8) + (pAddr[2] << 16) + (pAddr[3] << 24);
|
||||||
@ -2163,25 +2163,25 @@ VOID AsicUpdateRxWCIDTable(IN PRTMP_ADAPTER pAd,
|
|||||||
For AP mode bTxKey must be always set to TRUE.
|
For AP mode bTxKey must be always set to TRUE.
|
||||||
========================================================================
|
========================================================================
|
||||||
*/
|
*/
|
||||||
VOID AsicAddKeyEntry(IN PRTMP_ADAPTER pAd,
|
void AsicAddKeyEntry(IN PRTMP_ADAPTER pAd,
|
||||||
IN USHORT WCID,
|
u16 WCID,
|
||||||
IN UCHAR BssIndex,
|
u8 BssIndex,
|
||||||
IN UCHAR KeyIdx,
|
u8 KeyIdx,
|
||||||
IN PCIPHER_KEY pCipherKey,
|
IN PCIPHER_KEY pCipherKey,
|
||||||
IN BOOLEAN bUsePairewiseKeyTable, IN BOOLEAN bTxKey)
|
IN BOOLEAN bUsePairewiseKeyTable, IN BOOLEAN bTxKey)
|
||||||
{
|
{
|
||||||
ULONG offset;
|
unsigned long offset;
|
||||||
/* ULONG WCIDAttri = 0; */
|
/* unsigned long WCIDAttri = 0; */
|
||||||
UCHAR IV4 = 0;
|
u8 IV4 = 0;
|
||||||
PUCHAR pKey = pCipherKey->Key;
|
u8 *pKey = pCipherKey->Key;
|
||||||
/* ULONG KeyLen = pCipherKey->KeyLen; */
|
/* unsigned long KeyLen = pCipherKey->KeyLen; */
|
||||||
PUCHAR pTxMic = pCipherKey->TxMic;
|
u8 *pTxMic = pCipherKey->TxMic;
|
||||||
PUCHAR pRxMic = pCipherKey->RxMic;
|
u8 *pRxMic = pCipherKey->RxMic;
|
||||||
PUCHAR pTxtsc = pCipherKey->TxTsc;
|
u8 *pTxtsc = pCipherKey->TxTsc;
|
||||||
UCHAR CipherAlg = pCipherKey->CipherAlg;
|
u8 CipherAlg = pCipherKey->CipherAlg;
|
||||||
SHAREDKEY_MODE_STRUC csr1;
|
SHAREDKEY_MODE_STRUC csr1;
|
||||||
#ifdef RTMP_MAC_PCI
|
#ifdef RTMP_MAC_PCI
|
||||||
UCHAR i;
|
u8 i;
|
||||||
#endif /* RTMP_MAC_PCI // */
|
#endif /* RTMP_MAC_PCI // */
|
||||||
|
|
||||||
/* ASSERT(KeyLen <= MAX_LEN_OF_PEER_KEY); */
|
/* ASSERT(KeyLen <= MAX_LEN_OF_PEER_KEY); */
|
||||||
@ -2271,7 +2271,7 @@ VOID AsicAddKeyEntry(IN PRTMP_ADAPTER pAd,
|
|||||||
}
|
}
|
||||||
#endif /* RTMP_MAC_PCI // */
|
#endif /* RTMP_MAC_PCI // */
|
||||||
#ifdef RTMP_MAC_USB
|
#ifdef RTMP_MAC_USB
|
||||||
UINT32 tmpVal;
|
u32 tmpVal;
|
||||||
|
|
||||||
/* */
|
/* */
|
||||||
/* Write IV */
|
/* Write IV */
|
||||||
@ -2291,7 +2291,7 @@ VOID AsicAddKeyEntry(IN PRTMP_ADAPTER pAd,
|
|||||||
/* Write EIV */
|
/* Write EIV */
|
||||||
/* */
|
/* */
|
||||||
offset += 4;
|
offset += 4;
|
||||||
RTMP_IO_WRITE32(pAd, offset, *(PUINT32) & pCipherKey->TxTsc[2]);
|
RTMP_IO_WRITE32(pAd, offset, *(u32 *)& pCipherKey->TxTsc[2]);
|
||||||
#endif /* RTMP_MAC_USB // */
|
#endif /* RTMP_MAC_USB // */
|
||||||
|
|
||||||
AsicUpdateWCIDAttribute(pAd, WCID, BssIndex, CipherAlg,
|
AsicUpdateWCIDAttribute(pAd, WCID, BssIndex, CipherAlg,
|
||||||
@ -2339,17 +2339,17 @@ VOID AsicAddKeyEntry(IN PRTMP_ADAPTER pAd,
|
|||||||
Return:
|
Return:
|
||||||
========================================================================
|
========================================================================
|
||||||
*/
|
*/
|
||||||
VOID AsicAddPairwiseKeyEntry(IN PRTMP_ADAPTER pAd,
|
void AsicAddPairwiseKeyEntry(IN PRTMP_ADAPTER pAd,
|
||||||
IN PUCHAR pAddr,
|
u8 *pAddr,
|
||||||
IN UCHAR WCID, IN CIPHER_KEY * pCipherKey)
|
u8 WCID, IN CIPHER_KEY * pCipherKey)
|
||||||
{
|
{
|
||||||
INT i;
|
int i;
|
||||||
ULONG offset;
|
unsigned long offset;
|
||||||
PUCHAR pKey = pCipherKey->Key;
|
u8 *pKey = pCipherKey->Key;
|
||||||
PUCHAR pTxMic = pCipherKey->TxMic;
|
u8 *pTxMic = pCipherKey->TxMic;
|
||||||
PUCHAR pRxMic = pCipherKey->RxMic;
|
u8 *pRxMic = pCipherKey->RxMic;
|
||||||
#ifdef DBG
|
#ifdef DBG
|
||||||
UCHAR CipherAlg = pCipherKey->CipherAlg;
|
u8 CipherAlg = pCipherKey->CipherAlg;
|
||||||
#endif /* DBG // */
|
#endif /* DBG // */
|
||||||
|
|
||||||
/* EKEY */
|
/* EKEY */
|
||||||
@ -2363,7 +2363,7 @@ VOID AsicAddPairwiseKeyEntry(IN PRTMP_ADAPTER pAd,
|
|||||||
RTUSBMultiWrite(pAd, offset, &pCipherKey->Key[0], MAX_LEN_OF_PEER_KEY);
|
RTUSBMultiWrite(pAd, offset, &pCipherKey->Key[0], MAX_LEN_OF_PEER_KEY);
|
||||||
#endif /* RTMP_MAC_USB // */
|
#endif /* RTMP_MAC_USB // */
|
||||||
for (i = 0; i < MAX_LEN_OF_PEER_KEY; i += 4) {
|
for (i = 0; i < MAX_LEN_OF_PEER_KEY; i += 4) {
|
||||||
UINT32 Value;
|
u32 Value;
|
||||||
RTMP_IO_READ32(pAd, offset + i, &Value);
|
RTMP_IO_READ32(pAd, offset + i, &Value);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2422,11 +2422,11 @@ VOID AsicAddPairwiseKeyEntry(IN PRTMP_ADAPTER pAd,
|
|||||||
Return:
|
Return:
|
||||||
========================================================================
|
========================================================================
|
||||||
*/
|
*/
|
||||||
VOID AsicRemovePairwiseKeyEntry(IN PRTMP_ADAPTER pAd,
|
void AsicRemovePairwiseKeyEntry(IN PRTMP_ADAPTER pAd,
|
||||||
IN UCHAR BssIdx, IN UCHAR Wcid)
|
u8 BssIdx, u8 Wcid)
|
||||||
{
|
{
|
||||||
ULONG WCIDAttri;
|
unsigned long WCIDAttri;
|
||||||
USHORT offset;
|
u16 offset;
|
||||||
|
|
||||||
/* re-set the entry's WCID attribute as OPEN-NONE. */
|
/* re-set the entry's WCID attribute as OPEN-NONE. */
|
||||||
offset = MAC_WCID_ATTRIBUTE_BASE + (Wcid * HW_WCID_ATTRI_SIZE);
|
offset = MAC_WCID_ATTRIBUTE_BASE + (Wcid * HW_WCID_ATTRI_SIZE);
|
||||||
@ -2435,8 +2435,8 @@ VOID AsicRemovePairwiseKeyEntry(IN PRTMP_ADAPTER pAd,
|
|||||||
}
|
}
|
||||||
|
|
||||||
BOOLEAN AsicSendCommandToMcu(IN PRTMP_ADAPTER pAd,
|
BOOLEAN AsicSendCommandToMcu(IN PRTMP_ADAPTER pAd,
|
||||||
IN UCHAR Command,
|
u8 Command,
|
||||||
IN UCHAR Token, IN UCHAR Arg0, IN UCHAR Arg1)
|
u8 Token, u8 Arg0, u8 Arg1)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (pAd->chipOps.sendCommandToMcu)
|
if (pAd->chipOps.sendCommandToMcu)
|
||||||
@ -2445,7 +2445,7 @@ BOOLEAN AsicSendCommandToMcu(IN PRTMP_ADAPTER pAd,
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID AsicSetRxAnt(IN PRTMP_ADAPTER pAd, IN UCHAR Ant)
|
void AsicSetRxAnt(IN PRTMP_ADAPTER pAd, u8 Ant)
|
||||||
{
|
{
|
||||||
#ifdef RT30xx
|
#ifdef RT30xx
|
||||||
/* RT3572 ATE need not to do this. */
|
/* RT3572 ATE need not to do this. */
|
||||||
@ -2453,14 +2453,14 @@ VOID AsicSetRxAnt(IN PRTMP_ADAPTER pAd, IN UCHAR Ant)
|
|||||||
#endif /* RT30xx // */
|
#endif /* RT30xx // */
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID AsicTurnOffRFClk(IN PRTMP_ADAPTER pAd, IN UCHAR Channel)
|
void AsicTurnOffRFClk(IN PRTMP_ADAPTER pAd, u8 Channel)
|
||||||
{
|
{
|
||||||
if (pAd->chipOps.AsicRfTurnOff) {
|
if (pAd->chipOps.AsicRfTurnOff) {
|
||||||
pAd->chipOps.AsicRfTurnOff(pAd);
|
pAd->chipOps.AsicRfTurnOff(pAd);
|
||||||
} else {
|
} else {
|
||||||
/* RF R2 bit 18 = 0 */
|
/* RF R2 bit 18 = 0 */
|
||||||
UINT32 R1 = 0, R2 = 0, R3 = 0;
|
u32 R1 = 0, R2 = 0, R3 = 0;
|
||||||
UCHAR index;
|
u8 index;
|
||||||
RTMP_RF_REGS *RFRegTable;
|
RTMP_RF_REGS *RFRegTable;
|
||||||
|
|
||||||
RFRegTable = RF2850RegTable;
|
RFRegTable = RF2850RegTable;
|
||||||
@ -2507,11 +2507,11 @@ VOID AsicTurnOffRFClk(IN PRTMP_ADAPTER pAd, IN UCHAR Channel)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID AsicTurnOnRFClk(IN PRTMP_ADAPTER pAd, IN UCHAR Channel)
|
void AsicTurnOnRFClk(IN PRTMP_ADAPTER pAd, u8 Channel)
|
||||||
{
|
{
|
||||||
/* RF R2 bit 18 = 0 */
|
/* RF R2 bit 18 = 0 */
|
||||||
UINT32 R1 = 0, R2 = 0, R3 = 0;
|
u32 R1 = 0, R2 = 0, R3 = 0;
|
||||||
UCHAR index;
|
u8 index;
|
||||||
RTMP_RF_REGS *RFRegTable;
|
RTMP_RF_REGS *RFRegTable;
|
||||||
|
|
||||||
#ifdef PCIE_PS_SUPPORT
|
#ifdef PCIE_PS_SUPPORT
|
||||||
|
@ -80,10 +80,10 @@ char *GetBW(int BW)
|
|||||||
TRUE if all parameters are OK, FALSE otherwise
|
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;
|
long region, regionMax;
|
||||||
UCHAR *pCountryRegion;
|
u8 *pCountryRegion;
|
||||||
|
|
||||||
region = simple_strtol(arg, 0, 10);
|
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)) {
|
if ((region >= 0) && (region <= REGION_MAXIMUM_BG_BAND)) {
|
||||||
*pCountryRegion = (UCHAR) region;
|
*pCountryRegion = (u8)region;
|
||||||
} else if ((region == REGION_31_BG_BAND) && (band == BAND_24G)) {
|
} else if ((region == REGION_31_BG_BAND) && (band == BAND_24G)) {
|
||||||
*pCountryRegion = (UCHAR) region;
|
*pCountryRegion = (u8)region;
|
||||||
} else {
|
} else {
|
||||||
DBGPRINT(RT_DEBUG_ERROR,
|
DBGPRINT(RT_DEBUG_ERROR,
|
||||||
("CfgSetCountryRegion():region(%ld) out of range!\n",
|
("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
|
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;
|
int MaxPhyMode = PHY_11G;
|
||||||
LONG WirelessMode;
|
long WirelessMode;
|
||||||
|
|
||||||
MaxPhyMode = PHY_11N_5G;
|
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);
|
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
|
TRUE if all parameters are OK, FALSE otherwise
|
||||||
==========================================================================
|
==========================================================================
|
||||||
*/
|
*/
|
||||||
INT RT_CfgSetWepKey(IN PRTMP_ADAPTER pAd,
|
int RT_CfgSetWepKey(IN PRTMP_ADAPTER pAd,
|
||||||
IN PSTRING keyString,
|
char *keyString,
|
||||||
IN CIPHER_KEY * pSharedKey, IN INT keyIdx)
|
IN CIPHER_KEY * pSharedKey, int keyIdx)
|
||||||
{
|
{
|
||||||
INT KeyLen;
|
int KeyLen;
|
||||||
INT i;
|
int i;
|
||||||
UCHAR CipherAlg = CIPHER_NONE;
|
u8 CipherAlg = CIPHER_NONE;
|
||||||
BOOLEAN bKeyIsHex = FALSE;
|
BOOLEAN bKeyIsHex = FALSE;
|
||||||
|
|
||||||
/* TODO: Shall we do memset for the original key info?? */
|
/* 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
|
TRUE if all parameters are OK, FALSE otherwise
|
||||||
==========================================================================
|
==========================================================================
|
||||||
*/
|
*/
|
||||||
INT RT_CfgSetWPAPSKKey(IN RTMP_ADAPTER * pAd,
|
int RT_CfgSetWPAPSKKey(IN RTMP_ADAPTER * pAd,
|
||||||
IN PSTRING keyString,
|
char *keyString,
|
||||||
IN UCHAR * pHashStr,
|
u8 * pHashStr,
|
||||||
IN INT hashStrLen, OUT PUCHAR pPMKBuf)
|
int hashStrLen, u8 *pPMKBuf)
|
||||||
{
|
{
|
||||||
int keyLen;
|
int keyLen;
|
||||||
UCHAR keyMaterial[40];
|
u8 keyMaterial[40];
|
||||||
|
|
||||||
keyLen = strlen(keyString);
|
keyLen = strlen(keyString);
|
||||||
if ((keyLen < 8) || (keyLen > 64)) {
|
if ((keyLen < 8) || (keyLen > 64)) {
|
||||||
|
@ -27,39 +27,39 @@
|
|||||||
|
|
||||||
#include "../rt_config.h"
|
#include "../rt_config.h"
|
||||||
|
|
||||||
UCHAR SNAP_802_1H[] = { 0xaa, 0xaa, 0x03, 0x00, 0x00, 0x00 };
|
u8 SNAP_802_1H[] = { 0xaa, 0xaa, 0x03, 0x00, 0x00, 0x00 };
|
||||||
UCHAR SNAP_BRIDGE_TUNNEL[] = { 0xaa, 0xaa, 0x03, 0x00, 0x00, 0xf8 };
|
u8 SNAP_BRIDGE_TUNNEL[] = { 0xaa, 0xaa, 0x03, 0x00, 0x00, 0xf8 };
|
||||||
|
|
||||||
/* Add Cisco Aironet SNAP heade for CCX2 support */
|
/* Add Cisco Aironet SNAP heade for CCX2 support */
|
||||||
UCHAR SNAP_AIRONET[] = { 0xaa, 0xaa, 0x03, 0x00, 0x40, 0x96, 0x00, 0x00 };
|
u8 SNAP_AIRONET[] = { 0xaa, 0xaa, 0x03, 0x00, 0x40, 0x96, 0x00, 0x00 };
|
||||||
UCHAR CKIP_LLC_SNAP[] = { 0xaa, 0xaa, 0x03, 0x00, 0x40, 0x96, 0x00, 0x02 };
|
u8 CKIP_LLC_SNAP[] = { 0xaa, 0xaa, 0x03, 0x00, 0x40, 0x96, 0x00, 0x02 };
|
||||||
UCHAR EAPOL_LLC_SNAP[] = { 0xaa, 0xaa, 0x03, 0x00, 0x00, 0x00, 0x88, 0x8e };
|
u8 EAPOL_LLC_SNAP[] = { 0xaa, 0xaa, 0x03, 0x00, 0x00, 0x00, 0x88, 0x8e };
|
||||||
UCHAR EAPOL[] = { 0x88, 0x8e };
|
u8 EAPOL[] = { 0x88, 0x8e };
|
||||||
UCHAR TPID[] = { 0x81, 0x00 }; /* VLAN related */
|
u8 TPID[] = { 0x81, 0x00 }; /* VLAN related */
|
||||||
|
|
||||||
UCHAR IPX[] = { 0x81, 0x37 };
|
u8 IPX[] = { 0x81, 0x37 };
|
||||||
UCHAR APPLE_TALK[] = { 0x80, 0xf3 };
|
u8 APPLE_TALK[] = { 0x80, 0xf3 };
|
||||||
|
|
||||||
UCHAR RateIdToPlcpSignal[12] = {
|
u8 RateIdToPlcpSignal[12] = {
|
||||||
0, /* RATE_1 */ 1, /* RATE_2 */ 2, /* RATE_5_5 */ 3, /* RATE_11 *//* see BBP spec */
|
0, /* RATE_1 */ 1, /* RATE_2 */ 2, /* RATE_5_5 */ 3, /* RATE_11 *//* see BBP spec */
|
||||||
11, /* RATE_6 */ 15, /* RATE_9 */ 10, /* RATE_12 */ 14, /* RATE_18 *//* see IEEE802.11a-1999 p.14 */
|
11, /* RATE_6 */ 15, /* RATE_9 */ 10, /* RATE_12 */ 14, /* RATE_18 *//* see IEEE802.11a-1999 p.14 */
|
||||||
9, /* RATE_24 */ 13, /* RATE_36 */ 8, /* RATE_48 */ 12 /* RATE_54 */
|
9, /* RATE_24 */ 13, /* RATE_36 */ 8, /* RATE_48 */ 12 /* RATE_54 */
|
||||||
}; /* see IEEE802.11a-1999 p.14 */
|
}; /* see IEEE802.11a-1999 p.14 */
|
||||||
|
|
||||||
UCHAR OfdmSignalToRateId[16] = {
|
u8 OfdmSignalToRateId[16] = {
|
||||||
RATE_54, RATE_54, RATE_54, RATE_54, /* OFDM PLCP Signal = 0, 1, 2, 3 respectively */
|
RATE_54, RATE_54, RATE_54, RATE_54, /* OFDM PLCP Signal = 0, 1, 2, 3 respectively */
|
||||||
RATE_54, RATE_54, RATE_54, RATE_54, /* OFDM PLCP Signal = 4, 5, 6, 7 respectively */
|
RATE_54, RATE_54, RATE_54, RATE_54, /* OFDM PLCP Signal = 4, 5, 6, 7 respectively */
|
||||||
RATE_48, RATE_24, RATE_12, RATE_6, /* OFDM PLCP Signal = 8, 9, 10, 11 respectively */
|
RATE_48, RATE_24, RATE_12, RATE_6, /* OFDM PLCP Signal = 8, 9, 10, 11 respectively */
|
||||||
RATE_54, RATE_36, RATE_18, RATE_9, /* OFDM PLCP Signal = 12, 13, 14, 15 respectively */
|
RATE_54, RATE_36, RATE_18, RATE_9, /* OFDM PLCP Signal = 12, 13, 14, 15 respectively */
|
||||||
};
|
};
|
||||||
|
|
||||||
UCHAR OfdmRateToRxwiMCS[12] = {
|
u8 OfdmRateToRxwiMCS[12] = {
|
||||||
0, 0, 0, 0,
|
0, 0, 0, 0,
|
||||||
0, 1, 2, 3, /* OFDM rate 6,9,12,18 = rxwi mcs 0,1,2,3 */
|
0, 1, 2, 3, /* OFDM rate 6,9,12,18 = rxwi mcs 0,1,2,3 */
|
||||||
4, 5, 6, 7, /* OFDM rate 24,36,48,54 = rxwi mcs 4,5,6,7 */
|
4, 5, 6, 7, /* OFDM rate 24,36,48,54 = rxwi mcs 4,5,6,7 */
|
||||||
};
|
};
|
||||||
|
|
||||||
UCHAR RxwiMCSToOfdmRate[12] = {
|
u8 RxwiMCSToOfdmRate[12] = {
|
||||||
RATE_6, RATE_9, RATE_12, RATE_18,
|
RATE_6, RATE_9, RATE_12, RATE_18,
|
||||||
RATE_24, RATE_36, RATE_48, RATE_54, /* OFDM rate 6,9,12,18 = rxwi mcs 0,1,2,3 */
|
RATE_24, RATE_36, RATE_48, RATE_54, /* OFDM rate 6,9,12,18 = rxwi mcs 0,1,2,3 */
|
||||||
4, 5, 6, 7, /* OFDM rate 24,36,48,54 = rxwi mcs 4,5,6,7 */
|
4, 5, 6, 7, /* OFDM rate 24,36,48,54 = rxwi mcs 4,5,6,7 */
|
||||||
@ -71,12 +71,12 @@ char *MCSToMbps[] =
|
|||||||
"MM-4", "MM-5", "MM-6", "MM-7", "MM-8", "MM-9", "MM-10", "MM-11", "MM-12", "MM-13",
|
"MM-4", "MM-5", "MM-6", "MM-7", "MM-8", "MM-9", "MM-10", "MM-11", "MM-12", "MM-13",
|
||||||
"MM-14", "MM-15", "MM-32", "ee1", "ee2", "ee3" };
|
"MM-14", "MM-15", "MM-32", "ee1", "ee2", "ee3" };
|
||||||
|
|
||||||
UCHAR default_cwmin[] =
|
u8 default_cwmin[] =
|
||||||
{ CW_MIN_IN_BITS, CW_MIN_IN_BITS, CW_MIN_IN_BITS - 1, CW_MIN_IN_BITS - 2 };
|
{ CW_MIN_IN_BITS, CW_MIN_IN_BITS, CW_MIN_IN_BITS - 1, CW_MIN_IN_BITS - 2 };
|
||||||
/*UCHAR default_cwmax[]={CW_MAX_IN_BITS, CW_MAX_IN_BITS, CW_MIN_IN_BITS, CW_MIN_IN_BITS-1}; */
|
/*u8 default_cwmax[]={CW_MAX_IN_BITS, CW_MAX_IN_BITS, CW_MIN_IN_BITS, CW_MIN_IN_BITS-1}; */
|
||||||
UCHAR default_sta_aifsn[] = { 3, 7, 2, 2 };
|
u8 default_sta_aifsn[] = { 3, 7, 2, 2 };
|
||||||
|
|
||||||
UCHAR MapUserPriorityToAccessCategory[8] =
|
u8 MapUserPriorityToAccessCategory[8] =
|
||||||
{ QID_AC_BE, QID_AC_BK, QID_AC_BK, QID_AC_BE, QID_AC_VI, QID_AC_VI,
|
{ QID_AC_BE, QID_AC_BK, QID_AC_BK, QID_AC_BE, QID_AC_VI, QID_AC_VI,
|
||||||
QID_AC_VO, QID_AC_VO };
|
QID_AC_VO, QID_AC_VO };
|
||||||
|
|
||||||
@ -104,16 +104,16 @@ QID_AC_VO, QID_AC_VO };
|
|||||||
|
|
||||||
========================================================================
|
========================================================================
|
||||||
*/
|
*/
|
||||||
NDIS_STATUS MiniportMMRequest(IN PRTMP_ADAPTER pAd,
|
int MiniportMMRequest(IN PRTMP_ADAPTER pAd,
|
||||||
IN UCHAR QueIdx, IN PUCHAR pData, IN UINT Length)
|
u8 QueIdx, u8 *pData, u32 Length)
|
||||||
{
|
{
|
||||||
PNDIS_PACKET pPacket;
|
PNDIS_PACKET pPacket;
|
||||||
NDIS_STATUS Status = NDIS_STATUS_SUCCESS;
|
int Status = NDIS_STATUS_SUCCESS;
|
||||||
ULONG FreeNum;
|
unsigned long FreeNum;
|
||||||
UCHAR rtmpHwHdr[TXINFO_SIZE + TXWI_SIZE]; /*RTMP_HW_HDR_LEN]; */
|
u8 rtmpHwHdr[TXINFO_SIZE + TXWI_SIZE]; /*RTMP_HW_HDR_LEN]; */
|
||||||
#ifdef RTMP_MAC_PCI
|
#ifdef RTMP_MAC_PCI
|
||||||
unsigned long IrqFlags = 0;
|
unsigned long IrqFlags = 0;
|
||||||
UCHAR IrqState;
|
u8 IrqState;
|
||||||
#endif /* RTMP_MAC_PCI // */
|
#endif /* RTMP_MAC_PCI // */
|
||||||
BOOLEAN bUseDataQ = FALSE;
|
BOOLEAN bUseDataQ = FALSE;
|
||||||
int retryCnt = 0;
|
int retryCnt = 0;
|
||||||
@ -164,7 +164,7 @@ NDIS_STATUS MiniportMMRequest(IN PRTMP_ADAPTER pAd,
|
|||||||
NdisZeroMemory(&rtmpHwHdr, (TXINFO_SIZE + TXWI_SIZE));
|
NdisZeroMemory(&rtmpHwHdr, (TXINFO_SIZE + TXWI_SIZE));
|
||||||
Status =
|
Status =
|
||||||
RTMPAllocateNdisPacket(pAd, &pPacket,
|
RTMPAllocateNdisPacket(pAd, &pPacket,
|
||||||
(PUCHAR) & rtmpHwHdr,
|
(u8 *)& rtmpHwHdr,
|
||||||
(TXINFO_SIZE + TXWI_SIZE),
|
(TXINFO_SIZE + TXWI_SIZE),
|
||||||
pData, Length);
|
pData, Length);
|
||||||
if (Status != NDIS_STATUS_SUCCESS) {
|
if (Status != NDIS_STATUS_SUCCESS) {
|
||||||
@ -242,12 +242,12 @@ NDIS_STATUS MiniportMMRequest(IN PRTMP_ADAPTER pAd,
|
|||||||
|
|
||||||
========================================================================
|
========================================================================
|
||||||
*/
|
*/
|
||||||
NDIS_STATUS MlmeHardTransmit(IN PRTMP_ADAPTER pAd,
|
int MlmeHardTransmit(IN PRTMP_ADAPTER pAd,
|
||||||
IN UCHAR QueIdx, IN PNDIS_PACKET pPacket)
|
u8 QueIdx, IN PNDIS_PACKET pPacket)
|
||||||
{
|
{
|
||||||
PACKET_INFO PacketInfo;
|
PACKET_INFO PacketInfo;
|
||||||
PUCHAR pSrcBufVA;
|
u8 *pSrcBufVA;
|
||||||
UINT SrcBufLen;
|
u32 SrcBufLen;
|
||||||
PHEADER_802_11 pHeader_802_11;
|
PHEADER_802_11 pHeader_802_11;
|
||||||
|
|
||||||
if ((pAd->CommonCfg.RadarDetect.RDMode != RD_NORMAL_MODE)
|
if ((pAd->CommonCfg.RadarDetect.RDMode != RD_NORMAL_MODE)
|
||||||
@ -270,18 +270,18 @@ NDIS_STATUS MlmeHardTransmit(IN PRTMP_ADAPTER pAd,
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
NDIS_STATUS MlmeHardTransmitMgmtRing(IN PRTMP_ADAPTER pAd,
|
int MlmeHardTransmitMgmtRing(IN PRTMP_ADAPTER pAd,
|
||||||
IN UCHAR QueIdx, IN PNDIS_PACKET pPacket)
|
u8 QueIdx, IN PNDIS_PACKET pPacket)
|
||||||
{
|
{
|
||||||
PACKET_INFO PacketInfo;
|
PACKET_INFO PacketInfo;
|
||||||
PUCHAR pSrcBufVA;
|
u8 *pSrcBufVA;
|
||||||
UINT SrcBufLen;
|
u32 SrcBufLen;
|
||||||
PHEADER_802_11 pHeader_802_11;
|
PHEADER_802_11 pHeader_802_11;
|
||||||
BOOLEAN bAckRequired, bInsertTimestamp;
|
BOOLEAN bAckRequired, bInsertTimestamp;
|
||||||
UCHAR MlmeRate;
|
u8 MlmeRate;
|
||||||
PTXWI_STRUC pFirstTxWI;
|
PTXWI_STRUC pFirstTxWI;
|
||||||
MAC_TABLE_ENTRY *pMacEntry = NULL;
|
MAC_TABLE_ENTRY *pMacEntry = NULL;
|
||||||
UCHAR PID;
|
u8 PID;
|
||||||
|
|
||||||
RTMP_QueryPacketInfo(pPacket, &PacketInfo, &pSrcBufVA, &SrcBufLen);
|
RTMP_QueryPacketInfo(pPacket, &PacketInfo, &pSrcBufVA, &SrcBufLen);
|
||||||
|
|
||||||
@ -421,7 +421,7 @@ NDIS_STATUS MlmeHardTransmitMgmtRing(IN PRTMP_ADAPTER pAd,
|
|||||||
RTMPWriteTxWI(pAd, pFirstTxWI, FALSE, FALSE, bInsertTimestamp,
|
RTMPWriteTxWI(pAd, pFirstTxWI, FALSE, FALSE, bInsertTimestamp,
|
||||||
FALSE, bAckRequired, FALSE, 0, RESERVED_WCID,
|
FALSE, bAckRequired, FALSE, 0, RESERVED_WCID,
|
||||||
(SrcBufLen - TXINFO_SIZE - TXWI_SIZE), PID, 0,
|
(SrcBufLen - TXINFO_SIZE - TXWI_SIZE), PID, 0,
|
||||||
(UCHAR) pAd->CommonCfg.MlmeTransmit.field.MCS,
|
(u8)pAd->CommonCfg.MlmeTransmit.field.MCS,
|
||||||
IFS_BACKOFF, FALSE, &pAd->CommonCfg.MlmeTransmit);
|
IFS_BACKOFF, FALSE, &pAd->CommonCfg.MlmeTransmit);
|
||||||
} else {
|
} else {
|
||||||
/* dont use low rate to send QoS Null data frame */
|
/* dont use low rate to send QoS Null data frame */
|
||||||
@ -430,7 +430,7 @@ NDIS_STATUS MlmeHardTransmitMgmtRing(IN PRTMP_ADAPTER pAd,
|
|||||||
0, pMacEntry->Aid,
|
0, pMacEntry->Aid,
|
||||||
(SrcBufLen - TXINFO_SIZE - TXWI_SIZE),
|
(SrcBufLen - TXINFO_SIZE - TXWI_SIZE),
|
||||||
pMacEntry->MaxHTPhyMode.field.MCS, 0,
|
pMacEntry->MaxHTPhyMode.field.MCS, 0,
|
||||||
(UCHAR) pMacEntry->MaxHTPhyMode.field.MCS,
|
(u8)pMacEntry->MaxHTPhyMode.field.MCS,
|
||||||
IFS_BACKOFF, FALSE, &pMacEntry->MaxHTPhyMode);
|
IFS_BACKOFF, FALSE, &pMacEntry->MaxHTPhyMode);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -506,10 +506,10 @@ NDIS_STATUS MlmeHardTransmitMgmtRing(IN PRTMP_ADAPTER pAd,
|
|||||||
(2).Normal
|
(2).Normal
|
||||||
========================================================================
|
========================================================================
|
||||||
*/
|
*/
|
||||||
static UCHAR TxPktClassification(IN RTMP_ADAPTER * pAd, IN PNDIS_PACKET pPacket)
|
static u8 TxPktClassification(IN RTMP_ADAPTER * pAd, IN PNDIS_PACKET pPacket)
|
||||||
{
|
{
|
||||||
UCHAR TxFrameType = TX_UNKOWN_FRAME;
|
u8 TxFrameType = TX_UNKOWN_FRAME;
|
||||||
UCHAR Wcid;
|
u8 Wcid;
|
||||||
MAC_TABLE_ENTRY *pMacEntry = NULL;
|
MAC_TABLE_ENTRY *pMacEntry = NULL;
|
||||||
BOOLEAN bHTRate = FALSE;
|
BOOLEAN bHTRate = FALSE;
|
||||||
|
|
||||||
@ -712,16 +712,16 @@ BOOLEAN CanDoAggregateTransmit(IN RTMP_ADAPTER * pAd,
|
|||||||
|
|
||||||
========================================================================
|
========================================================================
|
||||||
*/
|
*/
|
||||||
VOID RTMPDeQueuePacket(IN PRTMP_ADAPTER pAd, IN BOOLEAN bIntContext, IN UCHAR QIdx, /* BulkOutPipeId */
|
void RTMPDeQueuePacket(IN PRTMP_ADAPTER pAd, IN BOOLEAN bIntContext, u8 QIdx, /* BulkOutPipeId */
|
||||||
IN UCHAR Max_Tx_Packets)
|
u8 Max_Tx_Packets)
|
||||||
{
|
{
|
||||||
PQUEUE_ENTRY pEntry = NULL;
|
PQUEUE_ENTRY pEntry = NULL;
|
||||||
PNDIS_PACKET pPacket;
|
PNDIS_PACKET pPacket;
|
||||||
NDIS_STATUS Status = NDIS_STATUS_SUCCESS;
|
int Status = NDIS_STATUS_SUCCESS;
|
||||||
UCHAR Count = 0;
|
u8 Count = 0;
|
||||||
PQUEUE_HEADER pQueue;
|
PQUEUE_HEADER pQueue;
|
||||||
ULONG FreeNumber[NUM_OF_TX_RING];
|
unsigned long FreeNumber[NUM_OF_TX_RING];
|
||||||
UCHAR QueIdx, sQIdx, eQIdx;
|
u8 QueIdx, sQIdx, eQIdx;
|
||||||
unsigned long IrqFlags = 0;
|
unsigned long IrqFlags = 0;
|
||||||
BOOLEAN hasTxDesc = FALSE;
|
BOOLEAN hasTxDesc = FALSE;
|
||||||
TX_BLK TxBlk;
|
TX_BLK TxBlk;
|
||||||
@ -780,7 +780,7 @@ VOID RTMPDeQueuePacket(IN PRTMP_ADAPTER pAd, IN BOOLEAN bIntContext, IN UCHAR QI
|
|||||||
}
|
}
|
||||||
|
|
||||||
pTxBlk = &TxBlk;
|
pTxBlk = &TxBlk;
|
||||||
NdisZeroMemory((PUCHAR) pTxBlk, sizeof(TX_BLK));
|
NdisZeroMemory((u8 *)pTxBlk, sizeof(TX_BLK));
|
||||||
/*InitializeQueueHeader(&pTxBlk->TxPacketList); // Didn't need it because we already memzero it. */
|
/*InitializeQueueHeader(&pTxBlk->TxPacketList); // Didn't need it because we already memzero it. */
|
||||||
pTxBlk->QueIdx = QueIdx;
|
pTxBlk->QueIdx = QueIdx;
|
||||||
|
|
||||||
@ -908,9 +908,9 @@ VOID RTMPDeQueuePacket(IN PRTMP_ADAPTER pAd, IN BOOLEAN bIntContext, IN UCHAR QI
|
|||||||
|
|
||||||
========================================================================
|
========================================================================
|
||||||
*/
|
*/
|
||||||
USHORT RTMPCalcDuration(IN PRTMP_ADAPTER pAd, IN UCHAR Rate, IN ULONG Size)
|
u16 RTMPCalcDuration(IN PRTMP_ADAPTER pAd, u8 Rate, unsigned long Size)
|
||||||
{
|
{
|
||||||
ULONG Duration = 0;
|
unsigned long Duration = 0;
|
||||||
|
|
||||||
if (Rate < RATE_FIRST_OFDM_RATE) /* CCK */
|
if (Rate < RATE_FIRST_OFDM_RATE) /* CCK */
|
||||||
{
|
{
|
||||||
@ -921,14 +921,14 @@ USHORT RTMPCalcDuration(IN PRTMP_ADAPTER pAd, IN UCHAR Rate, IN ULONG Size)
|
|||||||
else
|
else
|
||||||
Duration = 192; /* 144+48 preamble+plcp */
|
Duration = 192; /* 144+48 preamble+plcp */
|
||||||
|
|
||||||
Duration += (USHORT) ((Size << 4) / RateIdTo500Kbps[Rate]);
|
Duration += (u16)((Size << 4) / RateIdTo500Kbps[Rate]);
|
||||||
if ((Size << 4) % RateIdTo500Kbps[Rate])
|
if ((Size << 4) % RateIdTo500Kbps[Rate])
|
||||||
Duration++;
|
Duration++;
|
||||||
} else if (Rate <= RATE_LAST_OFDM_RATE) /* OFDM rates */
|
} else if (Rate <= RATE_LAST_OFDM_RATE) /* OFDM rates */
|
||||||
{
|
{
|
||||||
Duration = 20 + 6; /* 16+4 preamble+plcp + Signal Extension */
|
Duration = 20 + 6; /* 16+4 preamble+plcp + Signal Extension */
|
||||||
Duration +=
|
Duration +=
|
||||||
4 * (USHORT) ((11 + Size * 4) / RateIdTo500Kbps[Rate]);
|
4 * (u16)((11 + Size * 4) / RateIdTo500Kbps[Rate]);
|
||||||
if ((11 + Size * 4) % RateIdTo500Kbps[Rate])
|
if ((11 + Size * 4) % RateIdTo500Kbps[Rate])
|
||||||
Duration += 4;
|
Duration += 4;
|
||||||
} else /*mimo rate */
|
} else /*mimo rate */
|
||||||
@ -936,7 +936,7 @@ USHORT RTMPCalcDuration(IN PRTMP_ADAPTER pAd, IN UCHAR Rate, IN ULONG Size)
|
|||||||
Duration = 20 + 6; /* 16+4 preamble+plcp + Signal Extension */
|
Duration = 20 + 6; /* 16+4 preamble+plcp + Signal Extension */
|
||||||
}
|
}
|
||||||
|
|
||||||
return (USHORT) Duration;
|
return (u16)Duration;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -968,14 +968,14 @@ USHORT RTMPCalcDuration(IN PRTMP_ADAPTER pAd, IN UCHAR Rate, IN ULONG Size)
|
|||||||
|
|
||||||
========================================================================
|
========================================================================
|
||||||
*/
|
*/
|
||||||
VOID RTMPWriteTxWI(IN PRTMP_ADAPTER pAd, IN PTXWI_STRUC pOutTxWI, IN BOOLEAN FRAG, IN BOOLEAN CFACK, IN BOOLEAN InsTimestamp, IN BOOLEAN AMPDU, IN BOOLEAN Ack, IN BOOLEAN NSeq, /* HW new a sequence. */
|
void RTMPWriteTxWI(IN PRTMP_ADAPTER pAd, IN PTXWI_STRUC pOutTxWI, IN BOOLEAN FRAG, IN BOOLEAN CFACK, IN BOOLEAN InsTimestamp, IN BOOLEAN AMPDU, IN BOOLEAN Ack, IN BOOLEAN NSeq, /* HW new a sequence. */
|
||||||
IN UCHAR BASize,
|
u8 BASize,
|
||||||
IN UCHAR WCID,
|
u8 WCID,
|
||||||
IN ULONG Length,
|
unsigned long Length,
|
||||||
IN UCHAR PID,
|
u8 PID,
|
||||||
IN UCHAR TID,
|
u8 TID,
|
||||||
IN UCHAR TxRate,
|
u8 TxRate,
|
||||||
IN UCHAR Txopmode,
|
u8 Txopmode,
|
||||||
IN BOOLEAN CfAck, IN HTTRANSMIT_SETTING * pTransmit)
|
IN BOOLEAN CfAck, IN HTTRANSMIT_SETTING * pTransmit)
|
||||||
{
|
{
|
||||||
PMAC_TABLE_ENTRY pMac = NULL;
|
PMAC_TABLE_ENTRY pMac = NULL;
|
||||||
@ -1056,12 +1056,12 @@ VOID RTMPWriteTxWI(IN PRTMP_ADAPTER pAd, IN PTXWI_STRUC pOutTxWI, IN BOOLEAN FRA
|
|||||||
NdisMoveMemory(pOutTxWI, &TxWI, sizeof(TXWI_STRUC));
|
NdisMoveMemory(pOutTxWI, &TxWI, sizeof(TXWI_STRUC));
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID RTMPWriteTxWI_Data(IN PRTMP_ADAPTER pAd,
|
void RTMPWriteTxWI_Data(IN PRTMP_ADAPTER pAd,
|
||||||
IN OUT PTXWI_STRUC pTxWI, IN TX_BLK * pTxBlk)
|
IN OUT PTXWI_STRUC pTxWI, IN TX_BLK * pTxBlk)
|
||||||
{
|
{
|
||||||
HTTRANSMIT_SETTING *pTransmit;
|
HTTRANSMIT_SETTING *pTransmit;
|
||||||
PMAC_TABLE_ENTRY pMacEntry;
|
PMAC_TABLE_ENTRY pMacEntry;
|
||||||
UCHAR BASize;
|
u8 BASize;
|
||||||
|
|
||||||
ASSERT(pTxWI);
|
ASSERT(pTxWI);
|
||||||
|
|
||||||
@ -1093,7 +1093,7 @@ VOID RTMPWriteTxWI_Data(IN PRTMP_ADAPTER pAd,
|
|||||||
/* John tune the performace with Intel Client in 20 MHz performance */
|
/* John tune the performace with Intel Client in 20 MHz performance */
|
||||||
BASize = pAd->CommonCfg.TxBASize;
|
BASize = pAd->CommonCfg.TxBASize;
|
||||||
if ((pTxBlk->TxFrameType == TX_AMPDU_FRAME) && (pMacEntry)) {
|
if ((pTxBlk->TxFrameType == TX_AMPDU_FRAME) && (pMacEntry)) {
|
||||||
UCHAR RABAOriIdx = 0; /*The RA's BA Originator table index. */
|
u8 RABAOriIdx = 0; /*The RA's BA Originator table index. */
|
||||||
|
|
||||||
RABAOriIdx =
|
RABAOriIdx =
|
||||||
pTxBlk->pMacEntry->BAOriWcidArray[pTxBlk->UserPriority];
|
pTxBlk->pMacEntry->BAOriWcidArray[pTxBlk->UserPriority];
|
||||||
@ -1134,7 +1134,7 @@ VOID RTMPWriteTxWI_Data(IN PRTMP_ADAPTER pAd,
|
|||||||
pTxWI->PacketId = pTxWI->MCS;
|
pTxWI->PacketId = pTxWI->MCS;
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID RTMPWriteTxWI_Cache(IN PRTMP_ADAPTER pAd,
|
void RTMPWriteTxWI_Cache(IN PRTMP_ADAPTER pAd,
|
||||||
IN OUT PTXWI_STRUC pTxWI, IN TX_BLK * pTxBlk)
|
IN OUT PTXWI_STRUC pTxWI, IN TX_BLK * pTxBlk)
|
||||||
{
|
{
|
||||||
PHTTRANSMIT_SETTING /*pTxHTPhyMode, */ pTransmit;
|
PHTTRANSMIT_SETTING /*pTxHTPhyMode, */ pTransmit;
|
||||||
@ -1195,7 +1195,7 @@ VOID RTMPWriteTxWI_Cache(IN PRTMP_ADAPTER pAd,
|
|||||||
/* 3. Fragmentation not in used */
|
/* 3. Fragmentation not in used */
|
||||||
/* 4. either no previous frame (pPrevAddr1=NULL) .OR. previoud frame is aggregatible */
|
/* 4. either no previous frame (pPrevAddr1=NULL) .OR. previoud frame is aggregatible */
|
||||||
BOOLEAN TxFrameIsAggregatible(IN PRTMP_ADAPTER pAd,
|
BOOLEAN TxFrameIsAggregatible(IN PRTMP_ADAPTER pAd,
|
||||||
IN PUCHAR pPrevAddr1, IN PUCHAR p8023hdr)
|
u8 *pPrevAddr1, u8 *p8023hdr)
|
||||||
{
|
{
|
||||||
|
|
||||||
/* can't aggregate EAPOL (802.1x) frame */
|
/* can't aggregate EAPOL (802.1x) frame */
|
||||||
@ -1231,9 +1231,9 @@ BOOLEAN TxFrameIsAggregatible(IN PRTMP_ADAPTER pAd,
|
|||||||
========================================================================
|
========================================================================
|
||||||
*/
|
*/
|
||||||
BOOLEAN PeerIsAggreOn(IN PRTMP_ADAPTER pAd,
|
BOOLEAN PeerIsAggreOn(IN PRTMP_ADAPTER pAd,
|
||||||
IN ULONG TxRate, IN PMAC_TABLE_ENTRY pMacEntry)
|
unsigned long TxRate, IN PMAC_TABLE_ENTRY pMacEntry)
|
||||||
{
|
{
|
||||||
ULONG AFlags =
|
unsigned long AFlags =
|
||||||
(fCLIENT_STATUS_AMSDU_INUSED | fCLIENT_STATUS_AGGREGATION_CAPABLE);
|
(fCLIENT_STATUS_AMSDU_INUSED | fCLIENT_STATUS_AGGREGATION_CAPABLE);
|
||||||
|
|
||||||
if (pMacEntry != NULL && CLIENT_STATUS_TEST_FLAG(pMacEntry, AFlags)) {
|
if (pMacEntry != NULL && CLIENT_STATUS_TEST_FLAG(pMacEntry, AFlags)) {
|
||||||
@ -1269,10 +1269,10 @@ BOOLEAN PeerIsAggreOn(IN PRTMP_ADAPTER pAd,
|
|||||||
|
|
||||||
========================================================================
|
========================================================================
|
||||||
*/
|
*/
|
||||||
PQUEUE_HEADER RTMPCheckTxSwQueue(IN PRTMP_ADAPTER pAd, OUT PUCHAR pQueIdx)
|
PQUEUE_HEADER RTMPCheckTxSwQueue(IN PRTMP_ADAPTER pAd, u8 *pQueIdx)
|
||||||
{
|
{
|
||||||
|
|
||||||
ULONG Number;
|
unsigned long Number;
|
||||||
/* 2004-11-15 to be removed. test aggregation only */
|
/* 2004-11-15 to be removed. test aggregation only */
|
||||||
/* if ((OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_AGGREGATION_INUSED)) && (*pNumber < 2)) */
|
/* if ((OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_AGGREGATION_INUSED)) && (*pNumber < 2)) */
|
||||||
/* return NULL; */
|
/* return NULL; */
|
||||||
@ -1317,7 +1317,7 @@ PQUEUE_HEADER RTMPCheckTxSwQueue(IN PRTMP_ADAPTER pAd, OUT PUCHAR pQueIdx)
|
|||||||
|
|
||||||
========================================================================
|
========================================================================
|
||||||
*/
|
*/
|
||||||
VOID RTMPSuspendMsduTransmission(IN PRTMP_ADAPTER pAd)
|
void RTMPSuspendMsduTransmission(IN PRTMP_ADAPTER pAd)
|
||||||
{
|
{
|
||||||
DBGPRINT(RT_DEBUG_TRACE, ("SCANNING, suspend MSDU transmission ...\n"));
|
DBGPRINT(RT_DEBUG_TRACE, ("SCANNING, suspend MSDU transmission ...\n"));
|
||||||
|
|
||||||
@ -1354,9 +1354,9 @@ VOID RTMPSuspendMsduTransmission(IN PRTMP_ADAPTER pAd)
|
|||||||
|
|
||||||
========================================================================
|
========================================================================
|
||||||
*/
|
*/
|
||||||
VOID RTMPResumeMsduTransmission(IN PRTMP_ADAPTER pAd)
|
void RTMPResumeMsduTransmission(IN PRTMP_ADAPTER pAd)
|
||||||
{
|
{
|
||||||
/* UCHAR IrqState; */
|
/* u8 IrqState; */
|
||||||
|
|
||||||
DBGPRINT(RT_DEBUG_TRACE, ("SCAN done, resume MSDU transmission ...\n"));
|
DBGPRINT(RT_DEBUG_TRACE, ("SCAN done, resume MSDU transmission ...\n"));
|
||||||
|
|
||||||
@ -1379,17 +1379,17 @@ VOID RTMPResumeMsduTransmission(IN PRTMP_ADAPTER pAd)
|
|||||||
RTMPDeQueuePacket(pAd, FALSE, NUM_OF_TX_RING, MAX_TX_PROCESS);
|
RTMPDeQueuePacket(pAd, FALSE, NUM_OF_TX_RING, MAX_TX_PROCESS);
|
||||||
}
|
}
|
||||||
|
|
||||||
UINT deaggregate_AMSDU_announce(IN PRTMP_ADAPTER pAd,
|
u32 deaggregate_AMSDU_announce(IN PRTMP_ADAPTER pAd,
|
||||||
PNDIS_PACKET pPacket,
|
PNDIS_PACKET pPacket,
|
||||||
IN PUCHAR pData, IN ULONG DataSize)
|
u8 *pData, unsigned long DataSize)
|
||||||
{
|
{
|
||||||
USHORT PayloadSize;
|
u16 PayloadSize;
|
||||||
USHORT SubFrameSize;
|
u16 SubFrameSize;
|
||||||
PHEADER_802_3 pAMSDUsubheader;
|
PHEADER_802_3 pAMSDUsubheader;
|
||||||
UINT nMSDU;
|
u32 nMSDU;
|
||||||
UCHAR Header802_3[14];
|
u8 Header802_3[14];
|
||||||
|
|
||||||
PUCHAR pPayload, pDA, pSA, pRemovedLLCSNAP;
|
u8 *pPayload, *pDA, *pSA, *pRemovedLLCSNAP;
|
||||||
PNDIS_PACKET pClonePacket;
|
PNDIS_PACKET pClonePacket;
|
||||||
|
|
||||||
nMSDU = 0;
|
nMSDU = 0;
|
||||||
@ -1479,14 +1479,14 @@ UINT deaggregate_AMSDU_announce(IN PRTMP_ADAPTER pAd,
|
|||||||
return nMSDU;
|
return nMSDU;
|
||||||
}
|
}
|
||||||
|
|
||||||
UINT BA_Reorder_AMSDU_Annnounce(IN PRTMP_ADAPTER pAd, IN PNDIS_PACKET pPacket)
|
u32 BA_Reorder_AMSDU_Annnounce(IN PRTMP_ADAPTER pAd, IN PNDIS_PACKET pPacket)
|
||||||
{
|
{
|
||||||
PUCHAR pData;
|
u8 *pData;
|
||||||
USHORT DataSize;
|
u16 DataSize;
|
||||||
UINT nMSDU = 0;
|
u32 nMSDU = 0;
|
||||||
|
|
||||||
pData = (PUCHAR) GET_OS_PKT_DATAPTR(pPacket);
|
pData = (u8 *)GET_OS_PKT_DATAPTR(pPacket);
|
||||||
DataSize = (USHORT) GET_OS_PKT_LEN(pPacket);
|
DataSize = (u16)GET_OS_PKT_LEN(pPacket);
|
||||||
|
|
||||||
nMSDU = deaggregate_AMSDU_announce(pAd, pPacket, pData, DataSize);
|
nMSDU = deaggregate_AMSDU_announce(pAd, pPacket, pData, DataSize);
|
||||||
|
|
||||||
@ -1501,9 +1501,9 @@ UINT BA_Reorder_AMSDU_Annnounce(IN PRTMP_ADAPTER pAd, IN PNDIS_PACKET pPacket)
|
|||||||
pEntry - pointer to the MAC entry; NULL is not found
|
pEntry - pointer to the MAC entry; NULL is not found
|
||||||
==========================================================================
|
==========================================================================
|
||||||
*/
|
*/
|
||||||
MAC_TABLE_ENTRY *MacTableLookup(IN PRTMP_ADAPTER pAd, PUCHAR pAddr)
|
MAC_TABLE_ENTRY *MacTableLookup(IN PRTMP_ADAPTER pAd, u8 *pAddr)
|
||||||
{
|
{
|
||||||
ULONG HashIdx;
|
unsigned long HashIdx;
|
||||||
MAC_TABLE_ENTRY *pEntry = NULL;
|
MAC_TABLE_ENTRY *pEntry = NULL;
|
||||||
|
|
||||||
HashIdx = MAC_ADDR_HASH_INDEX(pAddr);
|
HashIdx = MAC_ADDR_HASH_INDEX(pAddr);
|
||||||
@ -1522,14 +1522,14 @@ MAC_TABLE_ENTRY *MacTableLookup(IN PRTMP_ADAPTER pAd, PUCHAR pAddr)
|
|||||||
}
|
}
|
||||||
|
|
||||||
MAC_TABLE_ENTRY *MacTableInsertEntry(IN PRTMP_ADAPTER pAd,
|
MAC_TABLE_ENTRY *MacTableInsertEntry(IN PRTMP_ADAPTER pAd,
|
||||||
IN PUCHAR pAddr,
|
u8 *pAddr,
|
||||||
IN UCHAR apidx, IN BOOLEAN CleanAll)
|
u8 apidx, IN BOOLEAN CleanAll)
|
||||||
{
|
{
|
||||||
UCHAR HashIdx;
|
u8 HashIdx;
|
||||||
int i, FirstWcid;
|
int i, FirstWcid;
|
||||||
MAC_TABLE_ENTRY *pEntry = NULL, *pCurrEntry;
|
MAC_TABLE_ENTRY *pEntry = NULL, *pCurrEntry;
|
||||||
/* USHORT offset; */
|
/* u16 offset; */
|
||||||
/* ULONG addr; */
|
/* unsigned long addr; */
|
||||||
|
|
||||||
/* if FULL, return */
|
/* if FULL, return */
|
||||||
if (pAd->MacTab.Size >= MAX_LEN_OF_MAC_TABLE)
|
if (pAd->MacTab.Size >= MAX_LEN_OF_MAC_TABLE)
|
||||||
@ -1601,7 +1601,7 @@ MAC_TABLE_ENTRY *MacTableInsertEntry(IN PRTMP_ADAPTER pAd,
|
|||||||
AsicRemovePairwiseKeyEntry(pAd,
|
AsicRemovePairwiseKeyEntry(pAd,
|
||||||
pEntry->
|
pEntry->
|
||||||
apidx,
|
apidx,
|
||||||
(UCHAR) i);
|
(u8)i);
|
||||||
#endif /* RTMP_MAC_PCI // */
|
#endif /* RTMP_MAC_PCI // */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1615,7 +1615,7 @@ MAC_TABLE_ENTRY *MacTableInsertEntry(IN PRTMP_ADAPTER pAd,
|
|||||||
COPY_MAC_ADDR(pEntry->Addr, pAddr);
|
COPY_MAC_ADDR(pEntry->Addr, pAddr);
|
||||||
pEntry->Sst = SST_NOT_AUTH;
|
pEntry->Sst = SST_NOT_AUTH;
|
||||||
pEntry->AuthState = AS_NOT_AUTH;
|
pEntry->AuthState = AS_NOT_AUTH;
|
||||||
pEntry->Aid = (USHORT) i; /*0; */
|
pEntry->Aid = (u16)i; /*0; */
|
||||||
pEntry->CapabilityInfo = 0;
|
pEntry->CapabilityInfo = 0;
|
||||||
pEntry->PsMode = PWR_ACTIVE;
|
pEntry->PsMode = PWR_ACTIVE;
|
||||||
pEntry->PsQIdleCount = 0;
|
pEntry->PsQIdleCount = 0;
|
||||||
@ -1659,13 +1659,13 @@ MAC_TABLE_ENTRY *MacTableInsertEntry(IN PRTMP_ADAPTER pAd,
|
|||||||
==========================================================================
|
==========================================================================
|
||||||
*/
|
*/
|
||||||
BOOLEAN MacTableDeleteEntry(IN PRTMP_ADAPTER pAd,
|
BOOLEAN MacTableDeleteEntry(IN PRTMP_ADAPTER pAd,
|
||||||
IN USHORT wcid, IN PUCHAR pAddr)
|
u16 wcid, u8 *pAddr)
|
||||||
{
|
{
|
||||||
USHORT HashIdx;
|
u16 HashIdx;
|
||||||
MAC_TABLE_ENTRY *pEntry, *pPrevEntry, *pProbeEntry;
|
MAC_TABLE_ENTRY *pEntry, *pPrevEntry, *pProbeEntry;
|
||||||
BOOLEAN Cancelled;
|
BOOLEAN Cancelled;
|
||||||
/*USHORT offset; // unused variable */
|
/*u16 offset; // unused variable */
|
||||||
/*UCHAR j; // unused variable */
|
/*u8 j; // unused variable */
|
||||||
|
|
||||||
if (wcid >= MAX_LEN_OF_MAC_TABLE)
|
if (wcid >= MAX_LEN_OF_MAC_TABLE)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
@ -1752,7 +1752,7 @@ BOOLEAN MacTableDeleteEntry(IN PRTMP_ADAPTER pAd,
|
|||||||
the power-saving queues are freed here.
|
the power-saving queues are freed here.
|
||||||
==========================================================================
|
==========================================================================
|
||||||
*/
|
*/
|
||||||
VOID MacTableReset(IN PRTMP_ADAPTER pAd)
|
void MacTableReset(IN PRTMP_ADAPTER pAd)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
@ -1790,11 +1790,11 @@ VOID MacTableReset(IN PRTMP_ADAPTER pAd)
|
|||||||
|
|
||||||
==========================================================================
|
==========================================================================
|
||||||
*/
|
*/
|
||||||
VOID AssocParmFill(IN PRTMP_ADAPTER pAd,
|
void AssocParmFill(IN PRTMP_ADAPTER pAd,
|
||||||
IN OUT MLME_ASSOC_REQ_STRUCT * AssocReq,
|
IN OUT MLME_ASSOC_REQ_STRUCT * AssocReq,
|
||||||
IN PUCHAR pAddr,
|
u8 *pAddr,
|
||||||
IN USHORT CapabilityInfo,
|
u16 CapabilityInfo,
|
||||||
IN ULONG Timeout, IN USHORT ListenIntv)
|
unsigned long Timeout, u16 ListenIntv)
|
||||||
{
|
{
|
||||||
COPY_MAC_ADDR(AssocReq->Addr, pAddr);
|
COPY_MAC_ADDR(AssocReq->Addr, pAddr);
|
||||||
/* Add mask to support 802.11b mode only */
|
/* Add mask to support 802.11b mode only */
|
||||||
@ -1811,9 +1811,9 @@ VOID AssocParmFill(IN PRTMP_ADAPTER pAd,
|
|||||||
|
|
||||||
==========================================================================
|
==========================================================================
|
||||||
*/
|
*/
|
||||||
VOID DisassocParmFill(IN PRTMP_ADAPTER pAd,
|
void DisassocParmFill(IN PRTMP_ADAPTER pAd,
|
||||||
IN OUT MLME_DISASSOC_REQ_STRUCT * DisassocReq,
|
IN OUT MLME_DISASSOC_REQ_STRUCT * DisassocReq,
|
||||||
IN PUCHAR pAddr, IN USHORT Reason)
|
u8 *pAddr, u16 Reason)
|
||||||
{
|
{
|
||||||
COPY_MAC_ADDR(DisassocReq->Addr, pAddr);
|
COPY_MAC_ADDR(DisassocReq->Addr, pAddr);
|
||||||
DisassocReq->Reason = Reason;
|
DisassocReq->Reason = Reason;
|
||||||
@ -1856,21 +1856,21 @@ VOID DisassocParmFill(IN PRTMP_ADAPTER pAd,
|
|||||||
BOOLEAN RTMPCheckDHCPFrame(IN PRTMP_ADAPTER pAd, IN PNDIS_PACKET pPacket)
|
BOOLEAN RTMPCheckDHCPFrame(IN PRTMP_ADAPTER pAd, IN PNDIS_PACKET pPacket)
|
||||||
{
|
{
|
||||||
PACKET_INFO PacketInfo;
|
PACKET_INFO PacketInfo;
|
||||||
ULONG NumberOfBytesRead = 0;
|
unsigned long NumberOfBytesRead = 0;
|
||||||
ULONG CurrentOffset = 0;
|
unsigned long CurrentOffset = 0;
|
||||||
PVOID pVirtualAddress = NULL;
|
void *pVirtualAddress = NULL;
|
||||||
UINT NdisBufferLength;
|
u32 NdisBufferLength;
|
||||||
PUCHAR pSrc;
|
u8 *pSrc;
|
||||||
USHORT Protocol;
|
u16 Protocol;
|
||||||
UCHAR ByteOffset36 = 0;
|
u8 ByteOffset36 = 0;
|
||||||
UCHAR ByteOffset38 = 0;
|
u8 ByteOffset38 = 0;
|
||||||
BOOLEAN ReadFirstParm = TRUE;
|
BOOLEAN ReadFirstParm = TRUE;
|
||||||
|
|
||||||
RTMP_QueryPacketInfo(pPacket, &PacketInfo, (PUCHAR *) & pVirtualAddress,
|
RTMP_QueryPacketInfo(pPacket, &PacketInfo, (u8 **) & pVirtualAddress,
|
||||||
&NdisBufferLength);
|
&NdisBufferLength);
|
||||||
|
|
||||||
NumberOfBytesRead += NdisBufferLength;
|
NumberOfBytesRead += NdisBufferLength;
|
||||||
pSrc = (PUCHAR) pVirtualAddress;
|
pSrc = (u8 *)pVirtualAddress;
|
||||||
Protocol = *(pSrc + 12) * 256 + *(pSrc + 13);
|
Protocol = *(pSrc + 12) * 256 + *(pSrc + 13);
|
||||||
|
|
||||||
/* */
|
/* */
|
||||||
@ -1910,11 +1910,11 @@ BOOLEAN RTMPCheckDHCPFrame(IN PRTMP_ADAPTER pAd, IN PNDIS_PACKET pPacket)
|
|||||||
|
|
||||||
BOOLEAN RTMPCheckEtherType(IN PRTMP_ADAPTER pAd, IN PNDIS_PACKET pPacket)
|
BOOLEAN RTMPCheckEtherType(IN PRTMP_ADAPTER pAd, IN PNDIS_PACKET pPacket)
|
||||||
{
|
{
|
||||||
USHORT TypeLen;
|
u16 TypeLen;
|
||||||
UCHAR Byte0, Byte1;
|
u8 Byte0, Byte1;
|
||||||
PUCHAR pSrcBuf;
|
u8 *pSrcBuf;
|
||||||
UINT32 pktLen;
|
u32 pktLen;
|
||||||
UINT16 srcPort, dstPort;
|
u16 srcPort, dstPort;
|
||||||
BOOLEAN status = TRUE;
|
BOOLEAN status = TRUE;
|
||||||
|
|
||||||
pSrcBuf = GET_OS_PKT_DATAPTR(pPacket);
|
pSrcBuf = GET_OS_PKT_DATAPTR(pPacket);
|
||||||
@ -1941,7 +1941,7 @@ BOOLEAN RTMPCheckEtherType(IN PRTMP_ADAPTER pAd, IN PNDIS_PACKET pPacket)
|
|||||||
Sniff2BytesFromNdisBuffer((PNDIS_BUFFER) pSrcBuf, 6,
|
Sniff2BytesFromNdisBuffer((PNDIS_BUFFER) pSrcBuf, 6,
|
||||||
&Byte0, &Byte1);
|
&Byte0, &Byte1);
|
||||||
RTMP_SET_PACKET_LLCSNAP(pPacket, 1);
|
RTMP_SET_PACKET_LLCSNAP(pPacket, 1);
|
||||||
TypeLen = (USHORT) ((Byte0 << 8) + Byte1);
|
TypeLen = (u16)((Byte0 << 8) + Byte1);
|
||||||
pSrcBuf += 8; /* Skip this LLC/SNAP header */
|
pSrcBuf += 8; /* Skip this LLC/SNAP header */
|
||||||
} else {
|
} else {
|
||||||
/*It just has 3-byte LLC header, maybe a legacy ether type frame. we didn't handle it. */
|
/*It just has 3-byte LLC header, maybe a legacy ether type frame. we didn't handle it. */
|
||||||
@ -1963,7 +1963,7 @@ BOOLEAN RTMPCheckEtherType(IN PRTMP_ADAPTER pAd, IN PNDIS_PACKET pPacket)
|
|||||||
RTMP_SET_PACKET_VLAN(pPacket, 1);
|
RTMP_SET_PACKET_VLAN(pPacket, 1);
|
||||||
Sniff2BytesFromNdisBuffer((PNDIS_BUFFER) pSrcBuf, 2, &Byte0,
|
Sniff2BytesFromNdisBuffer((PNDIS_BUFFER) pSrcBuf, 2, &Byte0,
|
||||||
&Byte1);
|
&Byte1);
|
||||||
TypeLen = (USHORT) ((Byte0 << 8) + Byte1);
|
TypeLen = (u16)((Byte0 << 8) + Byte1);
|
||||||
|
|
||||||
pSrcBuf += 4; /* Skip the VLAN Header. */
|
pSrcBuf += 4; /* Skip the VLAN Header. */
|
||||||
}
|
}
|
||||||
@ -1978,10 +1978,10 @@ BOOLEAN RTMPCheckEtherType(IN PRTMP_ADAPTER pAd, IN PNDIS_PACKET pPacket)
|
|||||||
pSrcBuf += 20; /* Skip the IP header */
|
pSrcBuf += 20; /* Skip the IP header */
|
||||||
srcPort =
|
srcPort =
|
||||||
OS_NTOHS(get_unaligned
|
OS_NTOHS(get_unaligned
|
||||||
((PUINT16) (pSrcBuf)));
|
((u16 *)(pSrcBuf)));
|
||||||
dstPort =
|
dstPort =
|
||||||
OS_NTOHS(get_unaligned
|
OS_NTOHS(get_unaligned
|
||||||
((PUINT16) (pSrcBuf + 2)));
|
((u16 *)(pSrcBuf + 2)));
|
||||||
|
|
||||||
if ((srcPort == 0x44 && dstPort == 0x43) || (srcPort == 0x43 && dstPort == 0x44)) { /*It's a BOOTP/DHCP packet */
|
if ((srcPort == 0x44 && dstPort == 0x43) || (srcPort == 0x43 && dstPort == 0x44)) { /*It's a BOOTP/DHCP packet */
|
||||||
RTMP_SET_PACKET_DHCP(pPacket, 1);
|
RTMP_SET_PACKET_DHCP(pPacket, 1);
|
||||||
@ -2010,29 +2010,29 @@ BOOLEAN RTMPCheckEtherType(IN PRTMP_ADAPTER pAd, IN PNDIS_PACKET pPacket)
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID Update_Rssi_Sample(IN PRTMP_ADAPTER pAd,
|
void Update_Rssi_Sample(IN PRTMP_ADAPTER pAd,
|
||||||
IN RSSI_SAMPLE * pRssi, IN PRXWI_STRUC pRxWI)
|
IN RSSI_SAMPLE * pRssi, IN PRXWI_STRUC pRxWI)
|
||||||
{
|
{
|
||||||
CHAR rssi0 = pRxWI->RSSI0;
|
char rssi0 = pRxWI->RSSI0;
|
||||||
CHAR rssi1 = pRxWI->RSSI1;
|
char rssi1 = pRxWI->RSSI1;
|
||||||
CHAR rssi2 = pRxWI->RSSI2;
|
char rssi2 = pRxWI->RSSI2;
|
||||||
|
|
||||||
if (rssi0 != 0) {
|
if (rssi0 != 0) {
|
||||||
pRssi->LastRssi0 = ConvertToRssi(pAd, (CHAR) rssi0, RSSI_0);
|
pRssi->LastRssi0 = ConvertToRssi(pAd, (char)rssi0, RSSI_0);
|
||||||
pRssi->AvgRssi0X8 =
|
pRssi->AvgRssi0X8 =
|
||||||
(pRssi->AvgRssi0X8 - pRssi->AvgRssi0) + pRssi->LastRssi0;
|
(pRssi->AvgRssi0X8 - pRssi->AvgRssi0) + pRssi->LastRssi0;
|
||||||
pRssi->AvgRssi0 = pRssi->AvgRssi0X8 >> 3;
|
pRssi->AvgRssi0 = pRssi->AvgRssi0X8 >> 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (rssi1 != 0) {
|
if (rssi1 != 0) {
|
||||||
pRssi->LastRssi1 = ConvertToRssi(pAd, (CHAR) rssi1, RSSI_1);
|
pRssi->LastRssi1 = ConvertToRssi(pAd, (char)rssi1, RSSI_1);
|
||||||
pRssi->AvgRssi1X8 =
|
pRssi->AvgRssi1X8 =
|
||||||
(pRssi->AvgRssi1X8 - pRssi->AvgRssi1) + pRssi->LastRssi1;
|
(pRssi->AvgRssi1X8 - pRssi->AvgRssi1) + pRssi->LastRssi1;
|
||||||
pRssi->AvgRssi1 = pRssi->AvgRssi1X8 >> 3;
|
pRssi->AvgRssi1 = pRssi->AvgRssi1X8 >> 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (rssi2 != 0) {
|
if (rssi2 != 0) {
|
||||||
pRssi->LastRssi2 = ConvertToRssi(pAd, (CHAR) rssi2, RSSI_2);
|
pRssi->LastRssi2 = ConvertToRssi(pAd, (char)rssi2, RSSI_2);
|
||||||
pRssi->AvgRssi2X8 =
|
pRssi->AvgRssi2X8 =
|
||||||
(pRssi->AvgRssi2X8 - pRssi->AvgRssi2) + pRssi->LastRssi2;
|
(pRssi->AvgRssi2X8 - pRssi->AvgRssi2) + pRssi->LastRssi2;
|
||||||
pRssi->AvgRssi2 = pRssi->AvgRssi2X8 >> 3;
|
pRssi->AvgRssi2 = pRssi->AvgRssi2X8 >> 3;
|
||||||
@ -2040,11 +2040,11 @@ VOID Update_Rssi_Sample(IN PRTMP_ADAPTER pAd,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Normal legacy Rx packet indication */
|
/* Normal legacy Rx packet indication */
|
||||||
VOID Indicate_Legacy_Packet(IN PRTMP_ADAPTER pAd,
|
void Indicate_Legacy_Packet(IN PRTMP_ADAPTER pAd,
|
||||||
IN RX_BLK * pRxBlk, IN UCHAR FromWhichBSSID)
|
IN RX_BLK * pRxBlk, u8 FromWhichBSSID)
|
||||||
{
|
{
|
||||||
PNDIS_PACKET pRxPacket = pRxBlk->pRxPacket;
|
PNDIS_PACKET pRxPacket = pRxBlk->pRxPacket;
|
||||||
UCHAR Header802_3[LENGTH_802_3];
|
u8 Header802_3[LENGTH_802_3];
|
||||||
|
|
||||||
/* 1. get 802.3 Header */
|
/* 1. get 802.3 Header */
|
||||||
/* 2. remove LLC */
|
/* 2. remove LLC */
|
||||||
@ -2064,10 +2064,10 @@ VOID Indicate_Legacy_Packet(IN PRTMP_ADAPTER pAd,
|
|||||||
#ifdef RTMP_MAC_USB
|
#ifdef RTMP_MAC_USB
|
||||||
if (pAd->CommonCfg.bDisableReordering == 0) {
|
if (pAd->CommonCfg.bDisableReordering == 0) {
|
||||||
PBA_REC_ENTRY pBAEntry;
|
PBA_REC_ENTRY pBAEntry;
|
||||||
ULONG Now32;
|
unsigned long Now32;
|
||||||
UCHAR Wcid = pRxBlk->pRxWI->WirelessCliID;
|
u8 Wcid = pRxBlk->pRxWI->WirelessCliID;
|
||||||
UCHAR TID = pRxBlk->pRxWI->TID;
|
u8 TID = pRxBlk->pRxWI->TID;
|
||||||
USHORT Idx;
|
u16 Idx;
|
||||||
|
|
||||||
#define REORDERING_PACKET_TIMEOUT ((100 * OS_HZ)/1000) /* system ticks -- 100 ms */
|
#define REORDERING_PACKET_TIMEOUT ((100 * OS_HZ)/1000) /* system ticks -- 100 ms */
|
||||||
|
|
||||||
@ -2111,8 +2111,8 @@ VOID Indicate_Legacy_Packet(IN PRTMP_ADAPTER pAd,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Normal, AMPDU or AMSDU */
|
/* Normal, AMPDU or AMSDU */
|
||||||
VOID CmmRxnonRalinkFrameIndicate(IN PRTMP_ADAPTER pAd,
|
void CmmRxnonRalinkFrameIndicate(IN PRTMP_ADAPTER pAd,
|
||||||
IN RX_BLK * pRxBlk, IN UCHAR FromWhichBSSID)
|
IN RX_BLK * pRxBlk, u8 FromWhichBSSID)
|
||||||
{
|
{
|
||||||
if (RX_BLK_TEST_FLAG(pRxBlk, fRX_AMPDU)
|
if (RX_BLK_TEST_FLAG(pRxBlk, fRX_AMPDU)
|
||||||
&& (pAd->CommonCfg.bDisableReordering == 0)) {
|
&& (pAd->CommonCfg.bDisableReordering == 0)) {
|
||||||
@ -2127,14 +2127,14 @@ VOID CmmRxnonRalinkFrameIndicate(IN PRTMP_ADAPTER pAd,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID CmmRxRalinkFrameIndicate(IN PRTMP_ADAPTER pAd,
|
void CmmRxRalinkFrameIndicate(IN PRTMP_ADAPTER pAd,
|
||||||
IN MAC_TABLE_ENTRY * pEntry,
|
IN MAC_TABLE_ENTRY * pEntry,
|
||||||
IN RX_BLK * pRxBlk, IN UCHAR FromWhichBSSID)
|
IN RX_BLK * pRxBlk, u8 FromWhichBSSID)
|
||||||
{
|
{
|
||||||
UCHAR Header802_3[LENGTH_802_3];
|
u8 Header802_3[LENGTH_802_3];
|
||||||
UINT16 Msdu2Size;
|
u16 Msdu2Size;
|
||||||
UINT16 Payload1Size, Payload2Size;
|
u16 Payload1Size, Payload2Size;
|
||||||
PUCHAR pData2;
|
u8 *pData2;
|
||||||
PNDIS_PACKET pPacket2 = NULL;
|
PNDIS_PACKET pPacket2 = NULL;
|
||||||
|
|
||||||
Msdu2Size = *(pRxBlk->pData) + (*(pRxBlk->pData + 1) << 8);
|
Msdu2Size = *(pRxBlk->pData) + (*(pRxBlk->pData + 1) << 8);
|
||||||
@ -2196,16 +2196,16 @@ PNDIS_PACKET RTMPDeFragmentDataFrame(IN PRTMP_ADAPTER pAd, IN RX_BLK * pRxBlk)
|
|||||||
{
|
{
|
||||||
PHEADER_802_11 pHeader = pRxBlk->pHeader;
|
PHEADER_802_11 pHeader = pRxBlk->pHeader;
|
||||||
PNDIS_PACKET pRxPacket = pRxBlk->pRxPacket;
|
PNDIS_PACKET pRxPacket = pRxBlk->pRxPacket;
|
||||||
UCHAR *pData = pRxBlk->pData;
|
u8 *pData = pRxBlk->pData;
|
||||||
USHORT DataSize = pRxBlk->DataSize;
|
u16 DataSize = pRxBlk->DataSize;
|
||||||
PNDIS_PACKET pRetPacket = NULL;
|
PNDIS_PACKET pRetPacket = NULL;
|
||||||
UCHAR *pFragBuffer = NULL;
|
u8 *pFragBuffer = NULL;
|
||||||
BOOLEAN bReassDone = FALSE;
|
BOOLEAN bReassDone = FALSE;
|
||||||
UCHAR HeaderRoom = 0;
|
u8 HeaderRoom = 0;
|
||||||
|
|
||||||
ASSERT(pHeader);
|
ASSERT(pHeader);
|
||||||
|
|
||||||
HeaderRoom = pData - (UCHAR *) pHeader;
|
HeaderRoom = pData - (u8 *) pHeader;
|
||||||
|
|
||||||
/* Re-assemble the fragmented packets */
|
/* Re-assemble the fragmented packets */
|
||||||
if (pHeader->Frag == 0) /* Frag. Number is 0 : First frag or only one pkt */
|
if (pHeader->Frag == 0) /* Frag. Number is 0 : First frag or only one pkt */
|
||||||
@ -2284,7 +2284,7 @@ done:
|
|||||||
pAd->FragFrame.pFragPacket = pNewFragPacket;
|
pAd->FragFrame.pFragPacket = pNewFragPacket;
|
||||||
pRxBlk->pHeader =
|
pRxBlk->pHeader =
|
||||||
(PHEADER_802_11) GET_OS_PKT_DATAPTR(pRetPacket);
|
(PHEADER_802_11) GET_OS_PKT_DATAPTR(pRetPacket);
|
||||||
pRxBlk->pData = (UCHAR *) pRxBlk->pHeader + HeaderRoom;
|
pRxBlk->pData = (u8 *) pRxBlk->pHeader + HeaderRoom;
|
||||||
pRxBlk->DataSize = pAd->FragFrame.RxSize - HeaderRoom;
|
pRxBlk->DataSize = pAd->FragFrame.RxSize - HeaderRoom;
|
||||||
pRxBlk->pRxPacket = pRetPacket;
|
pRxBlk->pRxPacket = pRetPacket;
|
||||||
} else {
|
} else {
|
||||||
@ -2295,10 +2295,10 @@ done:
|
|||||||
return pRetPacket;
|
return pRetPacket;
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID Indicate_AMSDU_Packet(IN PRTMP_ADAPTER pAd,
|
void Indicate_AMSDU_Packet(IN PRTMP_ADAPTER pAd,
|
||||||
IN RX_BLK * pRxBlk, IN UCHAR FromWhichBSSID)
|
IN RX_BLK * pRxBlk, u8 FromWhichBSSID)
|
||||||
{
|
{
|
||||||
UINT nMSDU;
|
u32 nMSDU;
|
||||||
|
|
||||||
update_os_packet_info(pAd, pRxBlk, FromWhichBSSID);
|
update_os_packet_info(pAd, pRxBlk, FromWhichBSSID);
|
||||||
RTMP_SET_PACKET_IF(pRxBlk->pRxPacket, FromWhichBSSID);
|
RTMP_SET_PACKET_IF(pRxBlk->pRxPacket, FromWhichBSSID);
|
||||||
@ -2307,8 +2307,8 @@ VOID Indicate_AMSDU_Packet(IN PRTMP_ADAPTER pAd,
|
|||||||
pRxBlk->DataSize);
|
pRxBlk->DataSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID Indicate_EAPOL_Packet(IN PRTMP_ADAPTER pAd,
|
void Indicate_EAPOL_Packet(IN PRTMP_ADAPTER pAd,
|
||||||
IN RX_BLK * pRxBlk, IN UCHAR FromWhichBSSID)
|
IN RX_BLK * pRxBlk, u8 FromWhichBSSID)
|
||||||
{
|
{
|
||||||
MAC_TABLE_ENTRY *pEntry = NULL;
|
MAC_TABLE_ENTRY *pEntry = NULL;
|
||||||
|
|
||||||
@ -2329,10 +2329,10 @@ VOID Indicate_EAPOL_Packet(IN PRTMP_ADAPTER pAd,
|
|||||||
}
|
}
|
||||||
|
|
||||||
#define BCN_TBTT_OFFSET 64 /*defer 64 us */
|
#define BCN_TBTT_OFFSET 64 /*defer 64 us */
|
||||||
VOID ReSyncBeaconTime(IN PRTMP_ADAPTER pAd)
|
void ReSyncBeaconTime(IN PRTMP_ADAPTER pAd)
|
||||||
{
|
{
|
||||||
|
|
||||||
UINT32 Offset;
|
u32 Offset;
|
||||||
|
|
||||||
Offset = (pAd->TbttTickCount) % (BCN_TBTT_OFFSET);
|
Offset = (pAd->TbttTickCount) % (BCN_TBTT_OFFSET);
|
||||||
|
|
||||||
|
@ -32,24 +32,24 @@
|
|||||||
*/
|
*/
|
||||||
#include "../rt_config.h"
|
#include "../rt_config.h"
|
||||||
|
|
||||||
USHORT RtmpPCI_WriteTxResource(IN PRTMP_ADAPTER pAd,
|
u16 RtmpPCI_WriteTxResource(IN PRTMP_ADAPTER pAd,
|
||||||
IN TX_BLK * pTxBlk,
|
IN TX_BLK * pTxBlk,
|
||||||
IN BOOLEAN bIsLast, OUT USHORT * FreeNumber)
|
IN BOOLEAN bIsLast, u16 * FreeNumber)
|
||||||
{
|
{
|
||||||
|
|
||||||
UCHAR *pDMAHeaderBufVA;
|
u8 *pDMAHeaderBufVA;
|
||||||
USHORT TxIdx, RetTxIdx;
|
u16 TxIdx, RetTxIdx;
|
||||||
PTXD_STRUC pTxD;
|
PTXD_STRUC pTxD;
|
||||||
UINT32 BufBasePaLow;
|
u32 BufBasePaLow;
|
||||||
PRTMP_TX_RING pTxRing;
|
PRTMP_TX_RING pTxRing;
|
||||||
USHORT hwHeaderLen;
|
u16 hwHeaderLen;
|
||||||
|
|
||||||
/* */
|
/* */
|
||||||
/* get Tx Ring Resource */
|
/* get Tx Ring Resource */
|
||||||
/* */
|
/* */
|
||||||
pTxRing = &pAd->TxRing[pTxBlk->QueIdx];
|
pTxRing = &pAd->TxRing[pTxBlk->QueIdx];
|
||||||
TxIdx = pAd->TxRing[pTxBlk->QueIdx].TxCpuIdx;
|
TxIdx = pAd->TxRing[pTxBlk->QueIdx].TxCpuIdx;
|
||||||
pDMAHeaderBufVA = (PUCHAR) pTxRing->Cell[TxIdx].DmaBuf.AllocVa;
|
pDMAHeaderBufVA = (u8 *)pTxRing->Cell[TxIdx].DmaBuf.AllocVa;
|
||||||
BufBasePaLow =
|
BufBasePaLow =
|
||||||
RTMP_GetPhysicalAddressLow(pTxRing->Cell[TxIdx].DmaBuf.AllocPa);
|
RTMP_GetPhysicalAddressLow(pTxRing->Cell[TxIdx].DmaBuf.AllocPa);
|
||||||
|
|
||||||
@ -97,25 +97,25 @@ USHORT RtmpPCI_WriteTxResource(IN PRTMP_ADAPTER pAd,
|
|||||||
return RetTxIdx;
|
return RetTxIdx;
|
||||||
}
|
}
|
||||||
|
|
||||||
USHORT RtmpPCI_WriteSingleTxResource(IN PRTMP_ADAPTER pAd,
|
u16 RtmpPCI_WriteSingleTxResource(IN PRTMP_ADAPTER pAd,
|
||||||
IN TX_BLK * pTxBlk,
|
IN TX_BLK * pTxBlk,
|
||||||
IN BOOLEAN bIsLast,
|
IN BOOLEAN bIsLast,
|
||||||
OUT USHORT * FreeNumber)
|
u16 * FreeNumber)
|
||||||
{
|
{
|
||||||
|
|
||||||
UCHAR *pDMAHeaderBufVA;
|
u8 *pDMAHeaderBufVA;
|
||||||
USHORT TxIdx, RetTxIdx;
|
u16 TxIdx, RetTxIdx;
|
||||||
PTXD_STRUC pTxD;
|
PTXD_STRUC pTxD;
|
||||||
UINT32 BufBasePaLow;
|
u32 BufBasePaLow;
|
||||||
PRTMP_TX_RING pTxRing;
|
PRTMP_TX_RING pTxRing;
|
||||||
USHORT hwHeaderLen;
|
u16 hwHeaderLen;
|
||||||
|
|
||||||
/* */
|
/* */
|
||||||
/* get Tx Ring Resource */
|
/* get Tx Ring Resource */
|
||||||
/* */
|
/* */
|
||||||
pTxRing = &pAd->TxRing[pTxBlk->QueIdx];
|
pTxRing = &pAd->TxRing[pTxBlk->QueIdx];
|
||||||
TxIdx = pAd->TxRing[pTxBlk->QueIdx].TxCpuIdx;
|
TxIdx = pAd->TxRing[pTxBlk->QueIdx].TxCpuIdx;
|
||||||
pDMAHeaderBufVA = (PUCHAR) pTxRing->Cell[TxIdx].DmaBuf.AllocVa;
|
pDMAHeaderBufVA = (u8 *)pTxRing->Cell[TxIdx].DmaBuf.AllocVa;
|
||||||
BufBasePaLow =
|
BufBasePaLow =
|
||||||
RTMP_GetPhysicalAddressLow(pTxRing->Cell[TxIdx].DmaBuf.AllocPa);
|
RTMP_GetPhysicalAddressLow(pTxRing->Cell[TxIdx].DmaBuf.AllocPa);
|
||||||
|
|
||||||
@ -156,18 +156,18 @@ USHORT RtmpPCI_WriteSingleTxResource(IN PRTMP_ADAPTER pAd,
|
|||||||
return RetTxIdx;
|
return RetTxIdx;
|
||||||
}
|
}
|
||||||
|
|
||||||
USHORT RtmpPCI_WriteMultiTxResource(IN PRTMP_ADAPTER pAd,
|
u16 RtmpPCI_WriteMultiTxResource(IN PRTMP_ADAPTER pAd,
|
||||||
IN TX_BLK * pTxBlk,
|
IN TX_BLK * pTxBlk,
|
||||||
IN UCHAR frameNum, OUT USHORT * FreeNumber)
|
u8 frameNum, u16 * FreeNumber)
|
||||||
{
|
{
|
||||||
BOOLEAN bIsLast;
|
BOOLEAN bIsLast;
|
||||||
UCHAR *pDMAHeaderBufVA;
|
u8 *pDMAHeaderBufVA;
|
||||||
USHORT TxIdx, RetTxIdx;
|
u16 TxIdx, RetTxIdx;
|
||||||
PTXD_STRUC pTxD;
|
PTXD_STRUC pTxD;
|
||||||
UINT32 BufBasePaLow;
|
u32 BufBasePaLow;
|
||||||
PRTMP_TX_RING pTxRing;
|
PRTMP_TX_RING pTxRing;
|
||||||
USHORT hwHdrLen;
|
u16 hwHdrLen;
|
||||||
UINT32 firstDMALen;
|
u32 firstDMALen;
|
||||||
|
|
||||||
bIsLast = ((frameNum == (pTxBlk->TotalFrameNum - 1)) ? 1 : 0);
|
bIsLast = ((frameNum == (pTxBlk->TotalFrameNum - 1)) ? 1 : 0);
|
||||||
|
|
||||||
@ -176,7 +176,7 @@ USHORT RtmpPCI_WriteMultiTxResource(IN PRTMP_ADAPTER pAd,
|
|||||||
/* */
|
/* */
|
||||||
pTxRing = &pAd->TxRing[pTxBlk->QueIdx];
|
pTxRing = &pAd->TxRing[pTxBlk->QueIdx];
|
||||||
TxIdx = pAd->TxRing[pTxBlk->QueIdx].TxCpuIdx;
|
TxIdx = pAd->TxRing[pTxBlk->QueIdx].TxCpuIdx;
|
||||||
pDMAHeaderBufVA = (PUCHAR) pTxRing->Cell[TxIdx].DmaBuf.AllocVa;
|
pDMAHeaderBufVA = (u8 *)pTxRing->Cell[TxIdx].DmaBuf.AllocVa;
|
||||||
BufBasePaLow =
|
BufBasePaLow =
|
||||||
RTMP_GetPhysicalAddressLow(pTxRing->Cell[TxIdx].DmaBuf.AllocPa);
|
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 TX_BLK * pTxBlk,
|
||||||
IN USHORT totalMPDUSize, IN USHORT FirstTxIdx)
|
u16 totalMPDUSize, u16 FirstTxIdx)
|
||||||
{
|
{
|
||||||
|
|
||||||
PTXWI_STRUC pTxWI;
|
PTXWI_STRUC pTxWI;
|
||||||
@ -252,8 +252,8 @@ VOID RtmpPCI_FinalWriteTxResource(IN PRTMP_ADAPTER pAd,
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID RtmpPCIDataLastTxIdx(IN PRTMP_ADAPTER pAd,
|
void RtmpPCIDataLastTxIdx(IN PRTMP_ADAPTER pAd,
|
||||||
IN UCHAR QueIdx, IN USHORT LastTxIdx)
|
u8 QueIdx, u16 LastTxIdx)
|
||||||
{
|
{
|
||||||
PTXD_STRUC pTxD;
|
PTXD_STRUC pTxD;
|
||||||
PRTMP_TX_RING pTxRing;
|
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 TX_BLK * pTxBlk,
|
||||||
IN UCHAR fragNum, OUT USHORT * FreeNumber)
|
u8 fragNum, u16 * FreeNumber)
|
||||||
{
|
{
|
||||||
UCHAR *pDMAHeaderBufVA;
|
u8 *pDMAHeaderBufVA;
|
||||||
USHORT TxIdx, RetTxIdx;
|
u16 TxIdx, RetTxIdx;
|
||||||
PTXD_STRUC pTxD;
|
PTXD_STRUC pTxD;
|
||||||
UINT32 BufBasePaLow;
|
u32 BufBasePaLow;
|
||||||
PRTMP_TX_RING pTxRing;
|
PRTMP_TX_RING pTxRing;
|
||||||
USHORT hwHeaderLen;
|
u16 hwHeaderLen;
|
||||||
UINT32 firstDMALen;
|
u32 firstDMALen;
|
||||||
|
|
||||||
/* */
|
/* */
|
||||||
/* Get Tx Ring Resource */
|
/* Get Tx Ring Resource */
|
||||||
/* */
|
/* */
|
||||||
pTxRing = &pAd->TxRing[pTxBlk->QueIdx];
|
pTxRing = &pAd->TxRing[pTxBlk->QueIdx];
|
||||||
TxIdx = pAd->TxRing[pTxBlk->QueIdx].TxCpuIdx;
|
TxIdx = pAd->TxRing[pTxBlk->QueIdx].TxCpuIdx;
|
||||||
pDMAHeaderBufVA = (PUCHAR) pTxRing->Cell[TxIdx].DmaBuf.AllocVa;
|
pDMAHeaderBufVA = (u8 *)pTxRing->Cell[TxIdx].DmaBuf.AllocVa;
|
||||||
BufBasePaLow =
|
BufBasePaLow =
|
||||||
RTMP_GetPhysicalAddressLow(pTxRing->Cell[TxIdx].DmaBuf.AllocPa);
|
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.
|
This function handle PCI specific TxDesc and cpu index update and kick the packet out.
|
||||||
*/
|
*/
|
||||||
int RtmpPCIMgmtKickOut(IN RTMP_ADAPTER * pAd,
|
int RtmpPCIMgmtKickOut(IN RTMP_ADAPTER * pAd,
|
||||||
IN UCHAR QueIdx,
|
u8 QueIdx,
|
||||||
IN PNDIS_PACKET pPacket,
|
IN PNDIS_PACKET pPacket,
|
||||||
IN PUCHAR pSrcBufVA, IN UINT SrcBufLen)
|
u8 *pSrcBufVA, u32 SrcBufLen)
|
||||||
{
|
{
|
||||||
PTXD_STRUC pTxD;
|
PTXD_STRUC pTxD;
|
||||||
ULONG SwIdx = pAd->MgmtRing.TxCpuIdx;
|
unsigned long SwIdx = pAd->MgmtRing.TxCpuIdx;
|
||||||
|
|
||||||
pTxD = (PTXD_STRUC) pAd->MgmtRing.Cell[SwIdx].AllocVa;
|
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 PHEADER_802_11 pHeader,
|
||||||
IN PRXWI_STRUC pRxWI, IN PRT28XX_RXD_STRUC pRxD)
|
IN PRXWI_STRUC pRxWI, IN PRT28XX_RXD_STRUC pRxD)
|
||||||
{
|
{
|
||||||
PCIPHER_KEY pWpaKey;
|
PCIPHER_KEY pWpaKey;
|
||||||
INT dBm;
|
int dBm;
|
||||||
|
|
||||||
/* Phy errors & CRC errors */
|
/* Phy errors & CRC errors */
|
||||||
if ( /*(pRxD->PhyErr) || */ (pRxD->Crc)) {
|
if ( /*(pRxD->PhyErr) || */ (pRxD->Crc)) {
|
||||||
/* Check RSSI for Noise Hist statistic collection. */
|
/* Check RSSI for Noise Hist statistic collection. */
|
||||||
dBm = (INT) (pRxWI->RSSI0) - pAd->BbpRssiToDbmDelta;
|
dBm = (int)(pRxWI->RSSI0) - pAd->BbpRssiToDbmDelta;
|
||||||
if (dBm <= -87)
|
if (dBm <= -87)
|
||||||
pAd->StaCfg.RPIDensity[0] += 1;
|
pAd->StaCfg.RPIDensity[0] += 1;
|
||||||
else if (dBm <= -82)
|
else if (dBm <= -82)
|
||||||
@ -516,14 +516,14 @@ NDIS_STATUS RTMPCheckRxError(IN PRTMP_ADAPTER pAd,
|
|||||||
return (NDIS_STATUS_SUCCESS);
|
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;
|
PRTMP_TX_RING pTxRing;
|
||||||
PTXD_STRUC pTxD;
|
PTXD_STRUC pTxD;
|
||||||
PNDIS_PACKET pPacket;
|
PNDIS_PACKET pPacket;
|
||||||
UCHAR FREE = 0;
|
u8 FREE = 0;
|
||||||
TXD_STRUC TxD, *pOriTxD;
|
TXD_STRUC TxD, *pOriTxD;
|
||||||
/*ULONG IrqFlags; */
|
/*unsigned long IrqFlags; */
|
||||||
BOOLEAN bReschedule = FALSE;
|
BOOLEAN bReschedule = FALSE;
|
||||||
|
|
||||||
ASSERT(QueIdx < NUM_OF_TX_RING);
|
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,
|
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;
|
unsigned long IrqFlags;
|
||||||
BOOLEAN bReschedule = FALSE;
|
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;
|
PTXD_STRUC pTxD;
|
||||||
PNDIS_PACKET pPacket;
|
PNDIS_PACKET pPacket;
|
||||||
/* int i; */
|
/* int i; */
|
||||||
UCHAR FREE = 0;
|
u8 FREE = 0;
|
||||||
PRTMP_MGMT_RING pMgmtRing = &pAd->MgmtRing;
|
PRTMP_MGMT_RING pMgmtRing = &pAd->MgmtRing;
|
||||||
|
|
||||||
NdisAcquireSpinLock(&pAd->MgmtRingLock);
|
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)) {
|
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)) {
|
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;
|
WPDMA_GLO_CFG_STRUC GloCfg;
|
||||||
|
|
||||||
@ -776,12 +776,12 @@ VOID RTMPHandleRxCoherentInterrupt(IN PRTMP_ADAPTER pAd)
|
|||||||
PNDIS_PACKET GetPacketFromRxRing(IN PRTMP_ADAPTER pAd,
|
PNDIS_PACKET GetPacketFromRxRing(IN PRTMP_ADAPTER pAd,
|
||||||
OUT PRT28XX_RXD_STRUC pSaveRxD,
|
OUT PRT28XX_RXD_STRUC pSaveRxD,
|
||||||
OUT BOOLEAN * pbReschedule,
|
OUT BOOLEAN * pbReschedule,
|
||||||
IN OUT UINT32 * pRxPending)
|
IN u32 * pRxPending)
|
||||||
{
|
{
|
||||||
PRXD_STRUC pRxD;
|
PRXD_STRUC pRxD;
|
||||||
PNDIS_PACKET pRxPacket = NULL;
|
PNDIS_PACKET pRxPacket = NULL;
|
||||||
PNDIS_PACKET pNewPacket;
|
PNDIS_PACKET pNewPacket;
|
||||||
PVOID AllocVa;
|
void *AllocVa;
|
||||||
NDIS_PHYSICAL_ADDRESS AllocPa;
|
NDIS_PHYSICAL_ADDRESS AllocPa;
|
||||||
BOOLEAN bReschedule = FALSE;
|
BOOLEAN bReschedule = FALSE;
|
||||||
RTMP_DMACB *pRxCell;
|
RTMP_DMACB *pRxCell;
|
||||||
@ -864,23 +864,23 @@ done:
|
|||||||
return pRxPacket;
|
return pRxPacket;
|
||||||
}
|
}
|
||||||
|
|
||||||
NDIS_STATUS MlmeHardTransmitTxRing(IN PRTMP_ADAPTER pAd,
|
int MlmeHardTransmitTxRing(IN PRTMP_ADAPTER pAd,
|
||||||
IN UCHAR QueIdx, IN PNDIS_PACKET pPacket)
|
u8 QueIdx, IN PNDIS_PACKET pPacket)
|
||||||
{
|
{
|
||||||
PACKET_INFO PacketInfo;
|
PACKET_INFO PacketInfo;
|
||||||
PUCHAR pSrcBufVA;
|
u8 *pSrcBufVA;
|
||||||
UINT SrcBufLen;
|
u32 SrcBufLen;
|
||||||
PTXD_STRUC pTxD;
|
PTXD_STRUC pTxD;
|
||||||
PHEADER_802_11 pHeader_802_11;
|
PHEADER_802_11 pHeader_802_11;
|
||||||
BOOLEAN bAckRequired, bInsertTimestamp;
|
BOOLEAN bAckRequired, bInsertTimestamp;
|
||||||
ULONG SrcBufPA;
|
unsigned long SrcBufPA;
|
||||||
/*UCHAR TxBufIdx; */
|
/*u8 TxBufIdx; */
|
||||||
UCHAR MlmeRate;
|
u8 MlmeRate;
|
||||||
ULONG SwIdx = pAd->TxRing[QueIdx].TxCpuIdx;
|
unsigned long SwIdx = pAd->TxRing[QueIdx].TxCpuIdx;
|
||||||
PTXWI_STRUC pFirstTxWI;
|
PTXWI_STRUC pFirstTxWI;
|
||||||
/*ULONG i; */
|
/*unsigned long i; */
|
||||||
/*HTTRANSMIT_SETTING MlmeTransmit; //Rate for this MGMT frame. */
|
/*HTTRANSMIT_SETTING MlmeTransmit; //Rate for this MGMT frame. */
|
||||||
ULONG FreeNum;
|
unsigned long FreeNum;
|
||||||
MAC_TABLE_ENTRY *pMacEntry = NULL;
|
MAC_TABLE_ENTRY *pMacEntry = NULL;
|
||||||
|
|
||||||
RTMP_QueryPacketInfo(pPacket, &PacketInfo, &pSrcBufVA, &SrcBufLen);
|
RTMP_QueryPacketInfo(pPacket, &PacketInfo, &pSrcBufVA, &SrcBufLen);
|
||||||
@ -1000,14 +1000,14 @@ NDIS_STATUS MlmeHardTransmitTxRing(IN PRTMP_ADAPTER pAd,
|
|||||||
RTMPWriteTxWI(pAd, pFirstTxWI, FALSE, FALSE, bInsertTimestamp,
|
RTMPWriteTxWI(pAd, pFirstTxWI, FALSE, FALSE, bInsertTimestamp,
|
||||||
FALSE, bAckRequired, FALSE, 0, RESERVED_WCID,
|
FALSE, bAckRequired, FALSE, 0, RESERVED_WCID,
|
||||||
(SrcBufLen - TXWI_SIZE), PID_MGMT, 0,
|
(SrcBufLen - TXWI_SIZE), PID_MGMT, 0,
|
||||||
(UCHAR) pAd->CommonCfg.MlmeTransmit.field.MCS,
|
(u8)pAd->CommonCfg.MlmeTransmit.field.MCS,
|
||||||
IFS_BACKOFF, FALSE, &pAd->CommonCfg.MlmeTransmit);
|
IFS_BACKOFF, FALSE, &pAd->CommonCfg.MlmeTransmit);
|
||||||
} else {
|
} else {
|
||||||
RTMPWriteTxWI(pAd, pFirstTxWI, FALSE, FALSE,
|
RTMPWriteTxWI(pAd, pFirstTxWI, FALSE, FALSE,
|
||||||
bInsertTimestamp, FALSE, bAckRequired, FALSE,
|
bInsertTimestamp, FALSE, bAckRequired, FALSE,
|
||||||
0, pMacEntry->Aid, (SrcBufLen - TXWI_SIZE),
|
0, pMacEntry->Aid, (SrcBufLen - TXWI_SIZE),
|
||||||
pMacEntry->MaxHTPhyMode.field.MCS, 0,
|
pMacEntry->MaxHTPhyMode.field.MCS, 0,
|
||||||
(UCHAR) pMacEntry->MaxHTPhyMode.field.MCS,
|
(u8)pMacEntry->MaxHTPhyMode.field.MCS,
|
||||||
IFS_BACKOFF, FALSE, &pMacEntry->MaxHTPhyMode);
|
IFS_BACKOFF, FALSE, &pMacEntry->MaxHTPhyMode);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1040,8 +1040,8 @@ NDIS_STATUS MlmeHardTransmitTxRing(IN PRTMP_ADAPTER pAd,
|
|||||||
return NDIS_STATUS_SUCCESS;
|
return NDIS_STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
NDIS_STATUS MlmeDataHardTransmit(IN PRTMP_ADAPTER pAd,
|
int MlmeDataHardTransmit(IN PRTMP_ADAPTER pAd,
|
||||||
IN UCHAR QueIdx, IN PNDIS_PACKET pPacket)
|
u8 QueIdx, IN PNDIS_PACKET pPacket)
|
||||||
{
|
{
|
||||||
if ((pAd->CommonCfg.RadarDetect.RDMode != RD_NORMAL_MODE)
|
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 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. */
|
/* Always use Long preamble before verifiation short preamble functionality works well. */
|
||||||
|
@ -41,11 +41,11 @@
|
|||||||
=>
|
=>
|
||||||
=>
|
=>
|
||||||
*/
|
*/
|
||||||
static inline NDIS_STATUS RtmpUSBCanDoWrite(IN RTMP_ADAPTER * pAd,
|
static inline int RtmpUSBCanDoWrite(IN RTMP_ADAPTER * pAd,
|
||||||
IN UCHAR QueIdx,
|
u8 QueIdx,
|
||||||
IN HT_TX_CONTEXT * pHTTXContext)
|
IN HT_TX_CONTEXT * pHTTXContext)
|
||||||
{
|
{
|
||||||
NDIS_STATUS canWrite = NDIS_STATUS_RESOURCES;
|
int canWrite = NDIS_STATUS_RESOURCES;
|
||||||
|
|
||||||
if (((pHTTXContext->CurWritePosition) <
|
if (((pHTTXContext->CurWritePosition) <
|
||||||
pHTTXContext->NextBulkOutPosition)
|
pHTTXContext->NextBulkOutPosition)
|
||||||
@ -68,9 +68,9 @@ static inline NDIS_STATUS RtmpUSBCanDoWrite(IN RTMP_ADAPTER * pAd,
|
|||||||
return canWrite;
|
return canWrite;
|
||||||
}
|
}
|
||||||
|
|
||||||
USHORT RtmpUSB_WriteSubTxResource(IN PRTMP_ADAPTER pAd,
|
u16 RtmpUSB_WriteSubTxResource(IN PRTMP_ADAPTER pAd,
|
||||||
IN TX_BLK * pTxBlk,
|
IN TX_BLK * pTxBlk,
|
||||||
IN BOOLEAN bIsLast, OUT USHORT * FreeNumber)
|
IN BOOLEAN bIsLast, u16 * FreeNumber)
|
||||||
{
|
{
|
||||||
|
|
||||||
/* Dummy function. Should be removed in the future. */
|
/* Dummy function. Should be removed in the future. */
|
||||||
@ -78,20 +78,20 @@ USHORT RtmpUSB_WriteSubTxResource(IN PRTMP_ADAPTER pAd,
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
USHORT RtmpUSB_WriteFragTxResource(IN PRTMP_ADAPTER pAd,
|
u16 RtmpUSB_WriteFragTxResource(IN PRTMP_ADAPTER pAd,
|
||||||
IN TX_BLK * pTxBlk,
|
IN TX_BLK * pTxBlk,
|
||||||
IN UCHAR fragNum, OUT USHORT * FreeNumber)
|
u8 fragNum, u16 * FreeNumber)
|
||||||
{
|
{
|
||||||
HT_TX_CONTEXT *pHTTXContext;
|
HT_TX_CONTEXT *pHTTXContext;
|
||||||
USHORT hwHdrLen; /* The hwHdrLen consist of 802.11 header length plus the header padding length. */
|
u16 hwHdrLen; /* The hwHdrLen consist of 802.11 header length plus the header padding length. */
|
||||||
UINT32 fillOffset;
|
u32 fillOffset;
|
||||||
TXINFO_STRUC *pTxInfo;
|
TXINFO_STRUC *pTxInfo;
|
||||||
TXWI_STRUC *pTxWI;
|
TXWI_STRUC *pTxWI;
|
||||||
PUCHAR pWirelessPacket = NULL;
|
u8 *pWirelessPacket = NULL;
|
||||||
UCHAR QueIdx;
|
u8 QueIdx;
|
||||||
NDIS_STATUS Status;
|
int Status;
|
||||||
unsigned long IrqFlags;
|
unsigned long IrqFlags;
|
||||||
UINT32 USBDMApktLen = 0, DMAHdrLen, padding;
|
u32 USBDMApktLen = 0, DMAHdrLen, padding;
|
||||||
BOOLEAN TxQLastRound = FALSE;
|
BOOLEAN TxQLastRound = FALSE;
|
||||||
|
|
||||||
/* */
|
/* */
|
||||||
@ -146,7 +146,7 @@ USHORT RtmpUSB_WriteFragTxResource(IN PRTMP_ADAPTER pAd,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
NdisZeroMemory((PUCHAR) (&pTxBlk->HeaderBuf[0]), TXINFO_SIZE);
|
NdisZeroMemory((u8 *)(&pTxBlk->HeaderBuf[0]), TXINFO_SIZE);
|
||||||
pTxInfo = (PTXINFO_STRUC) (&pTxBlk->HeaderBuf[0]);
|
pTxInfo = (PTXINFO_STRUC) (&pTxBlk->HeaderBuf[0]);
|
||||||
pTxWI = (PTXWI_STRUC) (&pTxBlk->HeaderBuf[TXINFO_SIZE]);
|
pTxWI = (PTXWI_STRUC) (&pTxBlk->HeaderBuf[TXINFO_SIZE]);
|
||||||
|
|
||||||
@ -166,7 +166,7 @@ USHORT RtmpUSB_WriteFragTxResource(IN PRTMP_ADAPTER pAd,
|
|||||||
pTxBlk->Priv += (TXINFO_SIZE + USBDMApktLen);
|
pTxBlk->Priv += (TXINFO_SIZE + USBDMApktLen);
|
||||||
|
|
||||||
/* For TxInfo, the length of USBDMApktLen = TXWI_SIZE + 802.11 header + payload */
|
/* For TxInfo, the length of USBDMApktLen = TXWI_SIZE + 802.11 header + payload */
|
||||||
RTMPWriteTxInfo(pAd, pTxInfo, (USHORT) (USBDMApktLen), FALSE, FIFO_EDCA,
|
RTMPWriteTxInfo(pAd, pTxInfo, (u16)(USBDMApktLen), FALSE, FIFO_EDCA,
|
||||||
FALSE /*NextValid */ , FALSE);
|
FALSE /*NextValid */ , FALSE);
|
||||||
|
|
||||||
if (fragNum == pTxBlk->TotalFragNum) {
|
if (fragNum == pTxBlk->TotalFragNum) {
|
||||||
@ -215,21 +215,21 @@ USHORT RtmpUSB_WriteFragTxResource(IN PRTMP_ADAPTER pAd,
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
USHORT RtmpUSB_WriteSingleTxResource(IN PRTMP_ADAPTER pAd,
|
u16 RtmpUSB_WriteSingleTxResource(IN PRTMP_ADAPTER pAd,
|
||||||
IN TX_BLK * pTxBlk,
|
IN TX_BLK * pTxBlk,
|
||||||
IN BOOLEAN bIsLast,
|
IN BOOLEAN bIsLast,
|
||||||
OUT USHORT * FreeNumber)
|
u16 * FreeNumber)
|
||||||
{
|
{
|
||||||
HT_TX_CONTEXT *pHTTXContext;
|
HT_TX_CONTEXT *pHTTXContext;
|
||||||
USHORT hwHdrLen;
|
u16 hwHdrLen;
|
||||||
UINT32 fillOffset;
|
u32 fillOffset;
|
||||||
TXINFO_STRUC *pTxInfo;
|
TXINFO_STRUC *pTxInfo;
|
||||||
TXWI_STRUC *pTxWI;
|
TXWI_STRUC *pTxWI;
|
||||||
PUCHAR pWirelessPacket;
|
u8 *pWirelessPacket;
|
||||||
UCHAR QueIdx;
|
u8 QueIdx;
|
||||||
unsigned long IrqFlags;
|
unsigned long IrqFlags;
|
||||||
NDIS_STATUS Status;
|
int Status;
|
||||||
UINT32 USBDMApktLen = 0, DMAHdrLen, padding;
|
u32 USBDMApktLen = 0, DMAHdrLen, padding;
|
||||||
BOOLEAN bTxQLastRound = FALSE;
|
BOOLEAN bTxQLastRound = FALSE;
|
||||||
|
|
||||||
/* For USB, didn't need PCI_MAP_SINGLE() */
|
/* For USB, didn't need PCI_MAP_SINGLE() */
|
||||||
@ -278,7 +278,7 @@ USHORT RtmpUSB_WriteSingleTxResource(IN PRTMP_ADAPTER pAd,
|
|||||||
pTxBlk->Priv = (TXINFO_SIZE + USBDMApktLen);
|
pTxBlk->Priv = (TXINFO_SIZE + USBDMApktLen);
|
||||||
|
|
||||||
/* For TxInfo, the length of USBDMApktLen = TXWI_SIZE + 802.11 header + payload */
|
/* For TxInfo, the length of USBDMApktLen = TXWI_SIZE + 802.11 header + payload */
|
||||||
RTMPWriteTxInfo(pAd, pTxInfo, (USHORT) (USBDMApktLen), FALSE,
|
RTMPWriteTxInfo(pAd, pTxInfo, (u16)(USBDMApktLen), FALSE,
|
||||||
FIFO_EDCA, FALSE /*NextValid */ , FALSE);
|
FIFO_EDCA, FALSE /*NextValid */ , FALSE);
|
||||||
|
|
||||||
if ((pHTTXContext->CurWritePosition + 3906 + pTxBlk->Priv) >
|
if ((pHTTXContext->CurWritePosition + 3906 + pTxBlk->Priv) >
|
||||||
@ -328,20 +328,20 @@ USHORT RtmpUSB_WriteSingleTxResource(IN PRTMP_ADAPTER pAd,
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
USHORT RtmpUSB_WriteMultiTxResource(IN PRTMP_ADAPTER pAd,
|
u16 RtmpUSB_WriteMultiTxResource(IN PRTMP_ADAPTER pAd,
|
||||||
IN TX_BLK * pTxBlk,
|
IN TX_BLK * pTxBlk,
|
||||||
IN UCHAR frameNum, OUT USHORT * FreeNumber)
|
u8 frameNum, u16 * FreeNumber)
|
||||||
{
|
{
|
||||||
HT_TX_CONTEXT *pHTTXContext;
|
HT_TX_CONTEXT *pHTTXContext;
|
||||||
USHORT hwHdrLen; /* The hwHdrLen consist of 802.11 header length plus the header padding length. */
|
u16 hwHdrLen; /* The hwHdrLen consist of 802.11 header length plus the header padding length. */
|
||||||
UINT32 fillOffset;
|
u32 fillOffset;
|
||||||
TXINFO_STRUC *pTxInfo;
|
TXINFO_STRUC *pTxInfo;
|
||||||
TXWI_STRUC *pTxWI;
|
TXWI_STRUC *pTxWI;
|
||||||
PUCHAR pWirelessPacket = NULL;
|
u8 *pWirelessPacket = NULL;
|
||||||
UCHAR QueIdx;
|
u8 QueIdx;
|
||||||
NDIS_STATUS Status;
|
int Status;
|
||||||
unsigned long IrqFlags;
|
unsigned long IrqFlags;
|
||||||
/*UINT32 USBDMApktLen = 0, DMAHdrLen, padding; */
|
/*u32 USBDMApktLen = 0, DMAHdrLen, padding; */
|
||||||
|
|
||||||
/* */
|
/* */
|
||||||
/* get Tx Ring Resource & Dma Buffer address */
|
/* get Tx Ring Resource & Dma Buffer address */
|
||||||
@ -401,7 +401,7 @@ USHORT RtmpUSB_WriteMultiTxResource(IN PRTMP_ADAPTER pAd,
|
|||||||
pTxBlk->Priv = TXINFO_SIZE + TXWI_SIZE + hwHdrLen;
|
pTxBlk->Priv = TXINFO_SIZE + TXWI_SIZE + hwHdrLen;
|
||||||
|
|
||||||
/* pTxInfo->USBDMApktLen now just a temp value and will to correct latter. */
|
/* pTxInfo->USBDMApktLen now just a temp value and will to correct latter. */
|
||||||
RTMPWriteTxInfo(pAd, pTxInfo, (USHORT) (pTxBlk->Priv),
|
RTMPWriteTxInfo(pAd, pTxInfo, (u16)(pTxBlk->Priv),
|
||||||
FALSE, FIFO_EDCA, FALSE /*NextValid */ ,
|
FALSE, FIFO_EDCA, FALSE /*NextValid */ ,
|
||||||
FALSE);
|
FALSE);
|
||||||
|
|
||||||
@ -467,18 +467,18 @@ done:
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID RtmpUSB_FinalWriteTxResource(IN PRTMP_ADAPTER pAd,
|
void RtmpUSB_FinalWriteTxResource(IN PRTMP_ADAPTER pAd,
|
||||||
IN TX_BLK * pTxBlk,
|
IN TX_BLK * pTxBlk,
|
||||||
IN USHORT totalMPDUSize, IN USHORT TxIdx)
|
u16 totalMPDUSize, u16 TxIdx)
|
||||||
{
|
{
|
||||||
UCHAR QueIdx;
|
u8 QueIdx;
|
||||||
HT_TX_CONTEXT *pHTTXContext;
|
HT_TX_CONTEXT *pHTTXContext;
|
||||||
UINT32 fillOffset;
|
u32 fillOffset;
|
||||||
TXINFO_STRUC *pTxInfo;
|
TXINFO_STRUC *pTxInfo;
|
||||||
TXWI_STRUC *pTxWI;
|
TXWI_STRUC *pTxWI;
|
||||||
UINT32 USBDMApktLen, padding;
|
u32 USBDMApktLen, padding;
|
||||||
unsigned long IrqFlags;
|
unsigned long IrqFlags;
|
||||||
PUCHAR pWirelessPacket;
|
u8 *pWirelessPacket;
|
||||||
|
|
||||||
QueIdx = pTxBlk->QueIdx;
|
QueIdx = pTxBlk->QueIdx;
|
||||||
pHTTXContext = &pAd->TxContext[QueIdx];
|
pHTTXContext = &pAd->TxContext[QueIdx];
|
||||||
@ -492,10 +492,10 @@ VOID RtmpUSB_FinalWriteTxResource(IN PRTMP_ADAPTER pAd,
|
|||||||
|| ((pHTTXContext->ENextBulkOutPosition - 8) ==
|
|| ((pHTTXContext->ENextBulkOutPosition - 8) ==
|
||||||
pHTTXContext->CurWritePosition))
|
pHTTXContext->CurWritePosition))
|
||||||
&& (pHTTXContext->bCopySavePad == TRUE))
|
&& (pHTTXContext->bCopySavePad == TRUE))
|
||||||
pWirelessPacket = (PUCHAR) (&pHTTXContext->SavedPad[0]);
|
pWirelessPacket = (u8 *)(&pHTTXContext->SavedPad[0]);
|
||||||
else
|
else
|
||||||
pWirelessPacket =
|
pWirelessPacket =
|
||||||
(PUCHAR) (&pHTTXContext->TransferBuffer->field.
|
(u8 *)(&pHTTXContext->TransferBuffer->field.
|
||||||
WirelessPacket[fillOffset]);
|
WirelessPacket[fillOffset]);
|
||||||
|
|
||||||
/* */
|
/* */
|
||||||
@ -547,8 +547,8 @@ VOID RtmpUSB_FinalWriteTxResource(IN PRTMP_ADAPTER pAd,
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID RtmpUSBDataLastTxIdx(IN PRTMP_ADAPTER pAd,
|
void RtmpUSBDataLastTxIdx(IN PRTMP_ADAPTER pAd,
|
||||||
IN UCHAR QueIdx, IN USHORT TxIdx)
|
u8 QueIdx, u16 TxIdx)
|
||||||
{
|
{
|
||||||
/* DO nothing for USB. */
|
/* DO nothing for USB. */
|
||||||
}
|
}
|
||||||
@ -561,8 +561,8 @@ VOID RtmpUSBDataLastTxIdx(IN PRTMP_ADAPTER pAd,
|
|||||||
Check if the CurWriting flag is FALSE, if it's FALSE, we can do kick out.
|
Check if the CurWriting flag is FALSE, if it's FALSE, we can do kick out.
|
||||||
|
|
||||||
*/
|
*/
|
||||||
VOID RtmpUSBDataKickOut(IN PRTMP_ADAPTER pAd,
|
void RtmpUSBDataKickOut(IN PRTMP_ADAPTER pAd,
|
||||||
IN TX_BLK * pTxBlk, IN UCHAR QueIdx)
|
IN TX_BLK * pTxBlk, u8 QueIdx)
|
||||||
{
|
{
|
||||||
RTUSB_SET_BULK_FLAG(pAd, (fRTUSB_BULK_OUT_DATA_NORMAL << QueIdx));
|
RTUSB_SET_BULK_FLAG(pAd, (fRTUSB_BULK_OUT_DATA_NORMAL << QueIdx));
|
||||||
RTUSBKickBulkOut(pAd);
|
RTUSBKickBulkOut(pAd);
|
||||||
@ -574,15 +574,15 @@ VOID RtmpUSBDataKickOut(IN PRTMP_ADAPTER pAd,
|
|||||||
This function handle RT2870 specific TxDesc and cpu index update and kick the packet out.
|
This function handle RT2870 specific TxDesc and cpu index update and kick the packet out.
|
||||||
*/
|
*/
|
||||||
int RtmpUSBMgmtKickOut(IN RTMP_ADAPTER * pAd,
|
int RtmpUSBMgmtKickOut(IN RTMP_ADAPTER * pAd,
|
||||||
IN UCHAR QueIdx,
|
u8 QueIdx,
|
||||||
IN PNDIS_PACKET pPacket,
|
IN PNDIS_PACKET pPacket,
|
||||||
IN PUCHAR pSrcBufVA, IN UINT SrcBufLen)
|
u8 *pSrcBufVA, u32 SrcBufLen)
|
||||||
{
|
{
|
||||||
PTXINFO_STRUC pTxInfo;
|
PTXINFO_STRUC pTxInfo;
|
||||||
ULONG BulkOutSize;
|
unsigned long BulkOutSize;
|
||||||
UCHAR padLen;
|
u8 padLen;
|
||||||
PUCHAR pDest;
|
u8 *pDest;
|
||||||
ULONG SwIdx = pAd->MgmtRing.TxCpuIdx;
|
unsigned long SwIdx = pAd->MgmtRing.TxCpuIdx;
|
||||||
PTX_CONTEXT pMLMEContext =
|
PTX_CONTEXT pMLMEContext =
|
||||||
(PTX_CONTEXT) pAd->MgmtRing.Cell[SwIdx].AllocVa;
|
(PTX_CONTEXT) pAd->MgmtRing.Cell[SwIdx].AllocVa;
|
||||||
unsigned long IrqFlags;
|
unsigned long IrqFlags;
|
||||||
@ -592,7 +592,7 @@ int RtmpUSBMgmtKickOut(IN RTMP_ADAPTER * pAd,
|
|||||||
/* Build our URB for USBD */
|
/* Build our URB for USBD */
|
||||||
BulkOutSize = SrcBufLen;
|
BulkOutSize = SrcBufLen;
|
||||||
BulkOutSize = (BulkOutSize + 3) & (~3);
|
BulkOutSize = (BulkOutSize + 3) & (~3);
|
||||||
RTMPWriteTxInfo(pAd, pTxInfo, (USHORT) (BulkOutSize - TXINFO_SIZE),
|
RTMPWriteTxInfo(pAd, pTxInfo, (u16)(BulkOutSize - TXINFO_SIZE),
|
||||||
TRUE, EpToQueue[MGMTPIPEIDX], FALSE, FALSE);
|
TRUE, EpToQueue[MGMTPIPEIDX], FALSE, FALSE);
|
||||||
|
|
||||||
BulkOutSize += 4; /* Always add 4 extra bytes at every packet. */
|
BulkOutSize += 4; /* Always add 4 extra bytes at every packet. */
|
||||||
@ -605,7 +605,7 @@ int RtmpUSBMgmtKickOut(IN RTMP_ADAPTER * pAd,
|
|||||||
ASSERT((padLen <= RTMP_PKT_TAIL_PADDING));
|
ASSERT((padLen <= RTMP_PKT_TAIL_PADDING));
|
||||||
|
|
||||||
/* Now memzero all extra padding bytes. */
|
/* Now memzero all extra padding bytes. */
|
||||||
pDest = (PUCHAR) (pSrcBufVA + SrcBufLen);
|
pDest = (u8 *)(pSrcBufVA + SrcBufLen);
|
||||||
skb_put(GET_OS_PKT_TYPE(pPacket), padLen);
|
skb_put(GET_OS_PKT_TYPE(pPacket), padLen);
|
||||||
NdisZeroMemory(pDest, padLen);
|
NdisZeroMemory(pDest, padLen);
|
||||||
|
|
||||||
@ -642,34 +642,34 @@ int RtmpUSBMgmtKickOut(IN RTMP_ADAPTER * pAd,
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID RtmpUSBNullFrameKickOut(IN RTMP_ADAPTER * pAd,
|
void RtmpUSBNullFrameKickOut(IN RTMP_ADAPTER * pAd,
|
||||||
IN UCHAR QueIdx,
|
u8 QueIdx,
|
||||||
IN UCHAR * pNullFrame, IN UINT32 frameLen)
|
u8 * pNullFrame, u32 frameLen)
|
||||||
{
|
{
|
||||||
if (pAd->NullContext.InUse == FALSE) {
|
if (pAd->NullContext.InUse == FALSE) {
|
||||||
PTX_CONTEXT pNullContext;
|
PTX_CONTEXT pNullContext;
|
||||||
PTXINFO_STRUC pTxInfo;
|
PTXINFO_STRUC pTxInfo;
|
||||||
PTXWI_STRUC pTxWI;
|
PTXWI_STRUC pTxWI;
|
||||||
PUCHAR pWirelessPkt;
|
u8 *pWirelessPkt;
|
||||||
|
|
||||||
pNullContext = &(pAd->NullContext);
|
pNullContext = &(pAd->NullContext);
|
||||||
|
|
||||||
/* Set the in use bit */
|
/* Set the in use bit */
|
||||||
pNullContext->InUse = TRUE;
|
pNullContext->InUse = TRUE;
|
||||||
pWirelessPkt =
|
pWirelessPkt =
|
||||||
(PUCHAR) & pNullContext->TransferBuffer->field.
|
(u8 *)& pNullContext->TransferBuffer->field.
|
||||||
WirelessPacket[0];
|
WirelessPacket[0];
|
||||||
|
|
||||||
RTMPZeroMemory(&pWirelessPkt[0], 100);
|
RTMPZeroMemory(&pWirelessPkt[0], 100);
|
||||||
pTxInfo = (PTXINFO_STRUC) & pWirelessPkt[0];
|
pTxInfo = (PTXINFO_STRUC) & pWirelessPkt[0];
|
||||||
RTMPWriteTxInfo(pAd, pTxInfo,
|
RTMPWriteTxInfo(pAd, pTxInfo,
|
||||||
(USHORT) (sizeof(HEADER_802_11) + TXWI_SIZE),
|
(u16)(sizeof(HEADER_802_11) + TXWI_SIZE),
|
||||||
TRUE, EpToQueue[MGMTPIPEIDX], FALSE, FALSE);
|
TRUE, EpToQueue[MGMTPIPEIDX], FALSE, FALSE);
|
||||||
pTxInfo->QSEL = FIFO_EDCA;
|
pTxInfo->QSEL = FIFO_EDCA;
|
||||||
pTxWI = (PTXWI_STRUC) & pWirelessPkt[TXINFO_SIZE];
|
pTxWI = (PTXWI_STRUC) & pWirelessPkt[TXINFO_SIZE];
|
||||||
RTMPWriteTxWI(pAd, pTxWI, FALSE, FALSE, FALSE, FALSE, TRUE,
|
RTMPWriteTxWI(pAd, pTxWI, FALSE, FALSE, FALSE, FALSE, TRUE,
|
||||||
FALSE, 0, BSSID_WCID, (sizeof(HEADER_802_11)), 0,
|
FALSE, 0, BSSID_WCID, (sizeof(HEADER_802_11)), 0,
|
||||||
0, (UCHAR) pAd->CommonCfg.MlmeTransmit.field.MCS,
|
0, (u8)pAd->CommonCfg.MlmeTransmit.field.MCS,
|
||||||
IFS_HTTXOP, FALSE, &pAd->CommonCfg.MlmeTransmit);
|
IFS_HTTXOP, FALSE, &pAd->CommonCfg.MlmeTransmit);
|
||||||
|
|
||||||
RTMPMoveMemory(&pWirelessPkt[TXWI_SIZE + TXINFO_SIZE],
|
RTMPMoveMemory(&pWirelessPkt[TXWI_SIZE + TXINFO_SIZE],
|
||||||
@ -710,13 +710,13 @@ Note:
|
|||||||
PNDIS_PACKET GetPacketFromRxRing(IN PRTMP_ADAPTER pAd,
|
PNDIS_PACKET GetPacketFromRxRing(IN PRTMP_ADAPTER pAd,
|
||||||
OUT PRT28XX_RXD_STRUC pSaveRxD,
|
OUT PRT28XX_RXD_STRUC pSaveRxD,
|
||||||
OUT BOOLEAN * pbReschedule,
|
OUT BOOLEAN * pbReschedule,
|
||||||
IN OUT UINT32 * pRxPending)
|
IN u32 * pRxPending)
|
||||||
{
|
{
|
||||||
PRX_CONTEXT pRxContext;
|
PRX_CONTEXT pRxContext;
|
||||||
PNDIS_PACKET pSkb;
|
PNDIS_PACKET pSkb;
|
||||||
PUCHAR pData;
|
u8 *pData;
|
||||||
ULONG ThisFrameLen;
|
unsigned long ThisFrameLen;
|
||||||
ULONG RxBufferLength;
|
unsigned long RxBufferLength;
|
||||||
PRXWI_STRUC pRxWI;
|
PRXWI_STRUC pRxWI;
|
||||||
|
|
||||||
pRxContext = &pAd->RxContext[pAd->NextRxBulkInReadIndex];
|
pRxContext = &pAd->RxContext[pAd->NextRxBulkInReadIndex];
|
||||||
@ -812,12 +812,12 @@ label_null:
|
|||||||
|
|
||||||
========================================================================
|
========================================================================
|
||||||
*/
|
*/
|
||||||
NDIS_STATUS RTMPCheckRxError(IN PRTMP_ADAPTER pAd,
|
int RTMPCheckRxError(IN PRTMP_ADAPTER pAd,
|
||||||
IN PHEADER_802_11 pHeader,
|
IN PHEADER_802_11 pHeader,
|
||||||
IN PRXWI_STRUC pRxWI, IN PRT28XX_RXD_STRUC pRxINFO)
|
IN PRXWI_STRUC pRxWI, IN PRT28XX_RXD_STRUC pRxINFO)
|
||||||
{
|
{
|
||||||
PCIPHER_KEY pWpaKey;
|
PCIPHER_KEY pWpaKey;
|
||||||
INT dBm;
|
int dBm;
|
||||||
|
|
||||||
if (pAd->bPromiscuous == TRUE)
|
if (pAd->bPromiscuous == TRUE)
|
||||||
return (NDIS_STATUS_SUCCESS);
|
return (NDIS_STATUS_SUCCESS);
|
||||||
@ -827,7 +827,7 @@ NDIS_STATUS RTMPCheckRxError(IN PRTMP_ADAPTER pAd,
|
|||||||
/* Phy errors & CRC errors */
|
/* Phy errors & CRC errors */
|
||||||
if (pRxINFO->Crc) {
|
if (pRxINFO->Crc) {
|
||||||
/* Check RSSI for Noise Hist statistic collection. */
|
/* Check RSSI for Noise Hist statistic collection. */
|
||||||
dBm = (INT) (pRxWI->RSSI0) - pAd->BbpRssiToDbmDelta;
|
dBm = (int)(pRxWI->RSSI0) - pAd->BbpRssiToDbmDelta;
|
||||||
if (dBm <= -87)
|
if (dBm <= -87)
|
||||||
pAd->StaCfg.RPIDensity[0] += 1;
|
pAd->StaCfg.RPIDensity[0] += 1;
|
||||||
else if (dBm <= -82)
|
else if (dBm <= -82)
|
||||||
@ -904,10 +904,10 @@ NDIS_STATUS RTMPCheckRxError(IN PRTMP_ADAPTER pAd,
|
|||||||
return (NDIS_STATUS_SUCCESS);
|
return (NDIS_STATUS_SUCCESS);
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID RtmpUsbStaAsicForceWakeupTimeout(IN PVOID SystemSpecific1,
|
void RtmpUsbStaAsicForceWakeupTimeout(void *SystemSpecific1,
|
||||||
IN PVOID FunctionContext,
|
void *FunctionContext,
|
||||||
IN PVOID SystemSpecific2,
|
void *SystemSpecific2,
|
||||||
IN PVOID SystemSpecific3)
|
void *SystemSpecific3)
|
||||||
{
|
{
|
||||||
RTMP_ADAPTER *pAd = (RTMP_ADAPTER *) FunctionContext;
|
RTMP_ADAPTER *pAd = (RTMP_ADAPTER *) FunctionContext;
|
||||||
|
|
||||||
@ -919,7 +919,7 @@ VOID RtmpUsbStaAsicForceWakeupTimeout(IN PVOID SystemSpecific1,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID RT28xxUsbStaAsicForceWakeup(IN PRTMP_ADAPTER pAd, IN BOOLEAN bFromTx)
|
void RT28xxUsbStaAsicForceWakeup(IN PRTMP_ADAPTER pAd, IN BOOLEAN bFromTx)
|
||||||
{
|
{
|
||||||
BOOLEAN Canceled;
|
BOOLEAN Canceled;
|
||||||
|
|
||||||
@ -931,8 +931,8 @@ VOID RT28xxUsbStaAsicForceWakeup(IN PRTMP_ADAPTER pAd, IN BOOLEAN bFromTx)
|
|||||||
OPSTATUS_CLEAR_FLAG(pAd, fOP_STATUS_DOZE);
|
OPSTATUS_CLEAR_FLAG(pAd, fOP_STATUS_DOZE);
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID RT28xxUsbStaAsicSleepThenAutoWakeup(IN PRTMP_ADAPTER pAd,
|
void RT28xxUsbStaAsicSleepThenAutoWakeup(IN PRTMP_ADAPTER pAd,
|
||||||
IN USHORT TbttNumToNextWakeUp)
|
u16 TbttNumToNextWakeUp)
|
||||||
{
|
{
|
||||||
|
|
||||||
/* we have decided to SLEEP, so at least do it for a BEACON period. */
|
/* we have decided to SLEEP, so at least do it for a BEACON period. */
|
||||||
|
@ -47,7 +47,7 @@
|
|||||||
|
|
||||||
========================================================================
|
========================================================================
|
||||||
*/
|
*/
|
||||||
VOID RTMPSetDesiredRates(IN PRTMP_ADAPTER pAdapter, IN LONG Rates)
|
void RTMPSetDesiredRates(IN PRTMP_ADAPTER pAdapter, long Rates)
|
||||||
{
|
{
|
||||||
NDIS_802_11_RATES aryRates;
|
NDIS_802_11_RATES aryRates;
|
||||||
|
|
||||||
@ -235,10 +235,10 @@ VOID RTMPSetDesiredRates(IN PRTMP_ADAPTER pAdapter, IN LONG Rates)
|
|||||||
|
|
||||||
========================================================================
|
========================================================================
|
||||||
*/
|
*/
|
||||||
VOID RTMPWPARemoveAllKeys(IN PRTMP_ADAPTER pAd)
|
void RTMPWPARemoveAllKeys(IN PRTMP_ADAPTER pAd)
|
||||||
{
|
{
|
||||||
|
|
||||||
UCHAR i;
|
u8 i;
|
||||||
|
|
||||||
DBGPRINT(RT_DEBUG_TRACE,
|
DBGPRINT(RT_DEBUG_TRACE,
|
||||||
("RTMPWPARemoveAllKeys(AuthMode=%d, WepStatus=%d)\n",
|
("RTMPWPARemoveAllKeys(AuthMode=%d, WepStatus=%d)\n",
|
||||||
@ -307,9 +307,9 @@ VOID RTMPWPARemoveAllKeys(IN PRTMP_ADAPTER pAd)
|
|||||||
|
|
||||||
========================================================================
|
========================================================================
|
||||||
*/
|
*/
|
||||||
VOID RTMPSetPhyMode(IN PRTMP_ADAPTER pAd, IN ULONG phymode)
|
void RTMPSetPhyMode(IN PRTMP_ADAPTER pAd, unsigned long phymode)
|
||||||
{
|
{
|
||||||
INT i;
|
int i;
|
||||||
/* the selected phymode must be supported by the RF IC encoded in E2PROM */
|
/* the selected phymode must be supported by the RF IC encoded in E2PROM */
|
||||||
|
|
||||||
/* if no change, do nothing */
|
/* if no change, do nothing */
|
||||||
@ -317,7 +317,7 @@ VOID RTMPSetPhyMode(IN PRTMP_ADAPTER pAd, IN ULONG phymode)
|
|||||||
if (pAd->CommonCfg.PhyMode == phymode)
|
if (pAd->CommonCfg.PhyMode == phymode)
|
||||||
return;
|
return;
|
||||||
*/
|
*/
|
||||||
pAd->CommonCfg.PhyMode = (UCHAR) phymode;
|
pAd->CommonCfg.PhyMode = (u8)phymode;
|
||||||
|
|
||||||
DBGPRINT(RT_DEBUG_TRACE,
|
DBGPRINT(RT_DEBUG_TRACE,
|
||||||
("RTMPSetPhyMode : PhyMode=%d, channel=%d \n",
|
("RTMPSetPhyMode : PhyMode=%d, channel=%d \n",
|
||||||
@ -435,13 +435,13 @@ VOID RTMPSetPhyMode(IN PRTMP_ADAPTER pAd, IN ULONG phymode)
|
|||||||
|
|
||||||
========================================================================
|
========================================================================
|
||||||
*/
|
*/
|
||||||
VOID RTMPSetHT(IN PRTMP_ADAPTER pAd, IN OID_SET_HT_PHYMODE * pHTPhyMode)
|
void RTMPSetHT(IN PRTMP_ADAPTER pAd, IN OID_SET_HT_PHYMODE * pHTPhyMode)
|
||||||
{
|
{
|
||||||
/*ULONG *pmcs; */
|
/*unsigned long *pmcs; */
|
||||||
UINT32 Value = 0;
|
u32 Value = 0;
|
||||||
UCHAR BBPValue = 0;
|
u8 BBPValue = 0;
|
||||||
UCHAR BBP3Value = 0;
|
u8 BBP3Value = 0;
|
||||||
UCHAR RxStream = pAd->CommonCfg.RxStream;
|
u8 RxStream = pAd->CommonCfg.RxStream;
|
||||||
|
|
||||||
DBGPRINT(RT_DEBUG_TRACE,
|
DBGPRINT(RT_DEBUG_TRACE,
|
||||||
("RTMPSetHT : HT_mode(%d), ExtOffset(%d), MCS(%d), BW(%d), STBC(%d), SHORTGI(%d)\n",
|
("RTMPSetHT : HT_mode(%d), ExtOffset(%d), MCS(%d), BW(%d), STBC(%d), SHORTGI(%d)\n",
|
||||||
@ -475,20 +475,20 @@ VOID RTMPSetHT(IN PRTMP_ADAPTER pAd, IN OID_SET_HT_PHYMODE * pHTPhyMode)
|
|||||||
|
|
||||||
/* Mimo power save, A-MSDU size, */
|
/* Mimo power save, A-MSDU size, */
|
||||||
pAd->CommonCfg.DesiredHtPhy.AmsduEnable =
|
pAd->CommonCfg.DesiredHtPhy.AmsduEnable =
|
||||||
(USHORT) pAd->CommonCfg.BACapability.field.AmsduEnable;
|
(u16)pAd->CommonCfg.BACapability.field.AmsduEnable;
|
||||||
pAd->CommonCfg.DesiredHtPhy.AmsduSize =
|
pAd->CommonCfg.DesiredHtPhy.AmsduSize =
|
||||||
(UCHAR) pAd->CommonCfg.BACapability.field.AmsduSize;
|
(u8)pAd->CommonCfg.BACapability.field.AmsduSize;
|
||||||
pAd->CommonCfg.DesiredHtPhy.MimoPs =
|
pAd->CommonCfg.DesiredHtPhy.MimoPs =
|
||||||
(UCHAR) pAd->CommonCfg.BACapability.field.MMPSmode;
|
(u8)pAd->CommonCfg.BACapability.field.MMPSmode;
|
||||||
pAd->CommonCfg.DesiredHtPhy.MpduDensity =
|
pAd->CommonCfg.DesiredHtPhy.MpduDensity =
|
||||||
(UCHAR) pAd->CommonCfg.BACapability.field.MpduDensity;
|
(u8)pAd->CommonCfg.BACapability.field.MpduDensity;
|
||||||
|
|
||||||
pAd->CommonCfg.HtCapability.HtCapInfo.AMsduSize =
|
pAd->CommonCfg.HtCapability.HtCapInfo.AMsduSize =
|
||||||
(USHORT) pAd->CommonCfg.BACapability.field.AmsduSize;
|
(u16)pAd->CommonCfg.BACapability.field.AmsduSize;
|
||||||
pAd->CommonCfg.HtCapability.HtCapInfo.MimoPs =
|
pAd->CommonCfg.HtCapability.HtCapInfo.MimoPs =
|
||||||
(USHORT) pAd->CommonCfg.BACapability.field.MMPSmode;
|
(u16)pAd->CommonCfg.BACapability.field.MMPSmode;
|
||||||
pAd->CommonCfg.HtCapability.HtCapParm.MpduDensity =
|
pAd->CommonCfg.HtCapability.HtCapParm.MpduDensity =
|
||||||
(UCHAR) pAd->CommonCfg.BACapability.field.MpduDensity;
|
(u8)pAd->CommonCfg.BACapability.field.MpduDensity;
|
||||||
|
|
||||||
DBGPRINT(RT_DEBUG_TRACE,
|
DBGPRINT(RT_DEBUG_TRACE,
|
||||||
("RTMPSetHT : AMsduSize = %d, MimoPs = %d, MpduDensity = %d, MaxRAmpduFactor = %d\n",
|
("RTMPSetHT : AMsduSize = %d, MimoPs = %d, MpduDensity = %d, MaxRAmpduFactor = %d\n",
|
||||||
@ -648,11 +648,11 @@ VOID RTMPSetHT(IN PRTMP_ADAPTER pAd, IN OID_SET_HT_PHYMODE * pHTPhyMode)
|
|||||||
|
|
||||||
========================================================================
|
========================================================================
|
||||||
*/
|
*/
|
||||||
VOID RTMPSetIndividualHT(IN PRTMP_ADAPTER pAd, IN UCHAR apidx)
|
void RTMPSetIndividualHT(IN PRTMP_ADAPTER pAd, u8 apidx)
|
||||||
{
|
{
|
||||||
PRT_HT_PHY_INFO pDesired_ht_phy = NULL;
|
PRT_HT_PHY_INFO pDesired_ht_phy = NULL;
|
||||||
UCHAR TxStream = pAd->CommonCfg.TxStream;
|
u8 TxStream = pAd->CommonCfg.TxStream;
|
||||||
UCHAR DesiredMcs = MCS_AUTO;
|
u8 DesiredMcs = MCS_AUTO;
|
||||||
|
|
||||||
do {
|
do {
|
||||||
{
|
{
|
||||||
@ -708,7 +708,7 @@ VOID RTMPSetIndividualHT(IN PRTMP_ADAPTER pAd, IN UCHAR apidx)
|
|||||||
pDesired_ht_phy->MCSSet[0] = 0xff;
|
pDesired_ht_phy->MCSSet[0] = 0xff;
|
||||||
pDesired_ht_phy->MCSSet[1] = 0xff;
|
pDesired_ht_phy->MCSSet[1] = 0xff;
|
||||||
} else if (DesiredMcs <= MCS_15) {
|
} else if (DesiredMcs <= MCS_15) {
|
||||||
ULONG mode;
|
unsigned long mode;
|
||||||
|
|
||||||
mode = DesiredMcs / 8;
|
mode = DesiredMcs / 8;
|
||||||
if (mode < 2)
|
if (mode < 2)
|
||||||
@ -724,7 +724,7 @@ VOID RTMPSetIndividualHT(IN PRTMP_ADAPTER pAd, IN UCHAR apidx)
|
|||||||
pDesired_ht_phy->MCSSet[1] = 0xff;
|
pDesired_ht_phy->MCSSet[1] = 0xff;
|
||||||
pDesired_ht_phy->MCSSet[2] = 0xff;
|
pDesired_ht_phy->MCSSet[2] = 0xff;
|
||||||
} else if (DesiredMcs <= MCS_23) {
|
} else if (DesiredMcs <= MCS_23) {
|
||||||
ULONG mode;
|
unsigned long mode;
|
||||||
|
|
||||||
mode = DesiredMcs / 8;
|
mode = DesiredMcs / 8;
|
||||||
if (mode < 3)
|
if (mode < 3)
|
||||||
@ -755,8 +755,8 @@ VOID RTMPSetIndividualHT(IN PRTMP_ADAPTER pAd, IN UCHAR apidx)
|
|||||||
|
|
||||||
========================================================================
|
========================================================================
|
||||||
*/
|
*/
|
||||||
VOID RTMPUpdateHTIE(IN RT_HT_CAPABILITY * pRtHt,
|
void RTMPUpdateHTIE(IN RT_HT_CAPABILITY * pRtHt,
|
||||||
IN UCHAR * pMcsSet,
|
u8 * pMcsSet,
|
||||||
OUT HT_CAPABILITY_IE * pHtCapability,
|
OUT HT_CAPABILITY_IE * pHtCapability,
|
||||||
OUT ADD_HT_INFO_IE * pAddHtInfo)
|
OUT ADD_HT_INFO_IE * pAddHtInfo)
|
||||||
{
|
{
|
||||||
@ -790,15 +790,15 @@ VOID RTMPUpdateHTIE(IN RT_HT_CAPABILITY * pRtHt,
|
|||||||
Return:
|
Return:
|
||||||
========================================================================
|
========================================================================
|
||||||
*/
|
*/
|
||||||
VOID RTMPAddWcidAttributeEntry(IN PRTMP_ADAPTER pAd,
|
void RTMPAddWcidAttributeEntry(IN PRTMP_ADAPTER pAd,
|
||||||
IN UCHAR BssIdx,
|
u8 BssIdx,
|
||||||
IN UCHAR KeyIdx,
|
u8 KeyIdx,
|
||||||
IN UCHAR CipherAlg, IN MAC_TABLE_ENTRY * pEntry)
|
u8 CipherAlg, IN MAC_TABLE_ENTRY * pEntry)
|
||||||
{
|
{
|
||||||
UINT32 WCIDAttri = 0;
|
u32 WCIDAttri = 0;
|
||||||
USHORT offset;
|
u16 offset;
|
||||||
UCHAR IVEIV = 0;
|
u8 IVEIV = 0;
|
||||||
USHORT Wcid = 0;
|
u16 Wcid = 0;
|
||||||
|
|
||||||
{
|
{
|
||||||
{
|
{
|
||||||
@ -872,7 +872,7 @@ Arguments:
|
|||||||
Note:
|
Note:
|
||||||
==========================================================================
|
==========================================================================
|
||||||
*/
|
*/
|
||||||
PSTRING GetEncryptType(CHAR enc)
|
char *GetEncryptType(char enc)
|
||||||
{
|
{
|
||||||
if (enc == Ndis802_11WEPDisabled)
|
if (enc == Ndis802_11WEPDisabled)
|
||||||
return "NONE";
|
return "NONE";
|
||||||
@ -888,7 +888,7 @@ PSTRING GetEncryptType(CHAR enc)
|
|||||||
return "UNKNOW";
|
return "UNKNOW";
|
||||||
}
|
}
|
||||||
|
|
||||||
PSTRING GetAuthMode(CHAR auth)
|
char *GetAuthMode(char auth)
|
||||||
{
|
{
|
||||||
if (auth == Ndis802_11AuthModeOpen)
|
if (auth == Ndis802_11AuthModeOpen)
|
||||||
return "OPEN";
|
return "OPEN";
|
||||||
@ -914,7 +914,7 @@ PSTRING GetAuthMode(CHAR auth)
|
|||||||
return "UNKNOW";
|
return "UNKNOW";
|
||||||
}
|
}
|
||||||
|
|
||||||
INT SetCommonHT(IN PRTMP_ADAPTER pAd)
|
int SetCommonHT(IN PRTMP_ADAPTER pAd)
|
||||||
{
|
{
|
||||||
OID_SET_HT_PHYMODE SetHT;
|
OID_SET_HT_PHYMODE SetHT;
|
||||||
|
|
||||||
@ -922,21 +922,21 @@ INT SetCommonHT(IN PRTMP_ADAPTER pAd)
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
SetHT.PhyMode = pAd->CommonCfg.PhyMode;
|
SetHT.PhyMode = pAd->CommonCfg.PhyMode;
|
||||||
SetHT.TransmitNo = ((UCHAR) pAd->Antenna.field.TxPath);
|
SetHT.TransmitNo = ((u8)pAd->Antenna.field.TxPath);
|
||||||
SetHT.HtMode = (UCHAR) pAd->CommonCfg.RegTransmitSetting.field.HTMODE;
|
SetHT.HtMode = (u8)pAd->CommonCfg.RegTransmitSetting.field.HTMODE;
|
||||||
SetHT.ExtOffset =
|
SetHT.ExtOffset =
|
||||||
(UCHAR) pAd->CommonCfg.RegTransmitSetting.field.EXTCHA;
|
(u8)pAd->CommonCfg.RegTransmitSetting.field.EXTCHA;
|
||||||
SetHT.MCS = MCS_AUTO;
|
SetHT.MCS = MCS_AUTO;
|
||||||
SetHT.BW = (UCHAR) pAd->CommonCfg.RegTransmitSetting.field.BW;
|
SetHT.BW = (u8)pAd->CommonCfg.RegTransmitSetting.field.BW;
|
||||||
SetHT.STBC = (UCHAR) pAd->CommonCfg.RegTransmitSetting.field.STBC;
|
SetHT.STBC = (u8)pAd->CommonCfg.RegTransmitSetting.field.STBC;
|
||||||
SetHT.SHORTGI = (UCHAR) pAd->CommonCfg.RegTransmitSetting.field.ShortGI;
|
SetHT.SHORTGI = (u8)pAd->CommonCfg.RegTransmitSetting.field.ShortGI;
|
||||||
|
|
||||||
RTMPSetHT(pAd, &SetHT);
|
RTMPSetHT(pAd, &SetHT);
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
PSTRING RTMPGetRalinkEncryModeStr(IN USHORT encryMode)
|
char *RTMPGetRalinkEncryModeStr(u16 encryMode)
|
||||||
{
|
{
|
||||||
switch (encryMode) {
|
switch (encryMode) {
|
||||||
case Ndis802_11WEPDisabled:
|
case Ndis802_11WEPDisabled:
|
||||||
|
@ -48,16 +48,16 @@
|
|||||||
|
|
||||||
========================================================================
|
========================================================================
|
||||||
*/
|
*/
|
||||||
NDIS_STATUS RTMPAllocTxRxRingMemory(IN PRTMP_ADAPTER pAd)
|
int RTMPAllocTxRxRingMemory(IN PRTMP_ADAPTER pAd)
|
||||||
{
|
{
|
||||||
NDIS_STATUS Status = NDIS_STATUS_SUCCESS;
|
int Status = NDIS_STATUS_SUCCESS;
|
||||||
ULONG RingBasePaHigh;
|
unsigned long RingBasePaHigh;
|
||||||
ULONG RingBasePaLow;
|
unsigned long RingBasePaLow;
|
||||||
PVOID RingBaseVa;
|
void *RingBaseVa;
|
||||||
INT index, num;
|
int index, num;
|
||||||
PTXD_STRUC pTxD;
|
PTXD_STRUC pTxD;
|
||||||
PRXD_STRUC pRxD;
|
PRXD_STRUC pRxD;
|
||||||
ULONG ErrorValue = 0;
|
unsigned long ErrorValue = 0;
|
||||||
PRTMP_TX_RING pTxRing;
|
PRTMP_TX_RING pTxRing;
|
||||||
PRTMP_DMABUF pDmaBuf;
|
PRTMP_DMABUF pDmaBuf;
|
||||||
PNDIS_PACKET pPacket;
|
PNDIS_PACKET pPacket;
|
||||||
@ -71,9 +71,9 @@ NDIS_STATUS RTMPAllocTxRxRingMemory(IN PRTMP_ADAPTER pAd)
|
|||||||
/* issue, I intentional set them all to 64 bytes. */
|
/* issue, I intentional set them all to 64 bytes. */
|
||||||
/* */
|
/* */
|
||||||
for (num = 0; num < NUM_OF_TX_RING; num++) {
|
for (num = 0; num < NUM_OF_TX_RING; num++) {
|
||||||
ULONG BufBasePaHigh;
|
unsigned long BufBasePaHigh;
|
||||||
ULONG BufBasePaLow;
|
unsigned long BufBasePaLow;
|
||||||
PVOID BufBaseVa;
|
void *BufBaseVa;
|
||||||
|
|
||||||
/* */
|
/* */
|
||||||
/* Allocate Tx ring descriptor's memory (5 TX rings = 4 ACs + 1 HCCA) */
|
/* Allocate Tx ring descriptor's memory (5 TX rings = 4 ACs + 1 HCCA) */
|
||||||
@ -171,12 +171,12 @@ NDIS_STATUS RTMPAllocTxRxRingMemory(IN PRTMP_ADAPTER pAd)
|
|||||||
/* advance to next ring descriptor address */
|
/* advance to next ring descriptor address */
|
||||||
pTxD->DMADONE = 1;
|
pTxD->DMADONE = 1;
|
||||||
RingBasePaLow += TXD_SIZE;
|
RingBasePaLow += TXD_SIZE;
|
||||||
RingBaseVa = (PUCHAR) RingBaseVa + TXD_SIZE;
|
RingBaseVa = (u8 *)RingBaseVa + TXD_SIZE;
|
||||||
|
|
||||||
/* advance to next TxBuf address */
|
/* advance to next TxBuf address */
|
||||||
BufBasePaLow += TX_DMA_1ST_BUFFER_SIZE;
|
BufBasePaLow += TX_DMA_1ST_BUFFER_SIZE;
|
||||||
BufBaseVa =
|
BufBaseVa =
|
||||||
(PUCHAR) BufBaseVa + TX_DMA_1ST_BUFFER_SIZE;
|
(u8 *)BufBaseVa + TX_DMA_1ST_BUFFER_SIZE;
|
||||||
}
|
}
|
||||||
DBGPRINT(RT_DEBUG_TRACE,
|
DBGPRINT(RT_DEBUG_TRACE,
|
||||||
("TxRing[%d]: total %d entry allocated\n", num,
|
("TxRing[%d]: total %d entry allocated\n", num,
|
||||||
@ -228,7 +228,7 @@ NDIS_STATUS RTMPAllocTxRxRingMemory(IN PRTMP_ADAPTER pAd)
|
|||||||
|
|
||||||
/* Offset to next ring descriptor address */
|
/* Offset to next ring descriptor address */
|
||||||
RingBasePaLow += TXD_SIZE;
|
RingBasePaLow += TXD_SIZE;
|
||||||
RingBaseVa = (PUCHAR) RingBaseVa + TXD_SIZE;
|
RingBaseVa = (u8 *)RingBaseVa + TXD_SIZE;
|
||||||
|
|
||||||
/* link the pre-allocated TxBuf to TXD */
|
/* link the pre-allocated TxBuf to TXD */
|
||||||
pTxD = (PTXD_STRUC) pAd->MgmtRing.Cell[index].AllocVa;
|
pTxD = (PTXD_STRUC) pAd->MgmtRing.Cell[index].AllocVa;
|
||||||
@ -286,7 +286,7 @@ NDIS_STATUS RTMPAllocTxRxRingMemory(IN PRTMP_ADAPTER pAd)
|
|||||||
|
|
||||||
/* Offset to next ring descriptor address */
|
/* Offset to next ring descriptor address */
|
||||||
RingBasePaLow += RXD_SIZE;
|
RingBasePaLow += RXD_SIZE;
|
||||||
RingBaseVa = (PUCHAR) RingBaseVa + RXD_SIZE;
|
RingBaseVa = (u8 *)RingBaseVa + RXD_SIZE;
|
||||||
|
|
||||||
/* Setup Rx associated Buffer size & allocate share memory */
|
/* Setup Rx associated Buffer size & allocate share memory */
|
||||||
pDmaBuf = &pAd->RxRing.Cell[index].DmaBuf;
|
pDmaBuf = &pAd->RxRing.Cell[index].DmaBuf;
|
||||||
@ -400,7 +400,7 @@ NDIS_STATUS RTMPAllocTxRxRingMemory(IN PRTMP_ADAPTER pAd)
|
|||||||
|
|
||||||
========================================================================
|
========================================================================
|
||||||
*/
|
*/
|
||||||
VOID RTMPRingCleanUp(IN PRTMP_ADAPTER pAd, IN UCHAR RingType)
|
void RTMPRingCleanUp(IN PRTMP_ADAPTER pAd, u8 RingType)
|
||||||
{
|
{
|
||||||
PTXD_STRUC pTxD;
|
PTXD_STRUC pTxD;
|
||||||
PRXD_STRUC pRxD;
|
PRXD_STRUC pRxD;
|
||||||
@ -409,7 +409,7 @@ VOID RTMPRingCleanUp(IN PRTMP_ADAPTER pAd, IN UCHAR RingType)
|
|||||||
int i;
|
int i;
|
||||||
PRTMP_TX_RING pTxRing;
|
PRTMP_TX_RING pTxRing;
|
||||||
unsigned long IrqFlags;
|
unsigned long IrqFlags;
|
||||||
/*UINT32 RxSwReadIdx; */
|
/*u32 RxSwReadIdx; */
|
||||||
|
|
||||||
DBGPRINT(RT_DEBUG_TRACE,
|
DBGPRINT(RT_DEBUG_TRACE,
|
||||||
("RTMPRingCleanUp(RingIdx=%d, Pending-NDIS=%ld)\n", RingType,
|
("RTMPRingCleanUp(RingIdx=%d, Pending-NDIS=%ld)\n", RingType,
|
||||||
@ -533,7 +533,7 @@ VOID RTMPRingCleanUp(IN PRTMP_ADAPTER pAd, IN UCHAR RingType)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID RTMPFreeTxRxRingMemory(IN PRTMP_ADAPTER pAd)
|
void RTMPFreeTxRxRingMemory(IN PRTMP_ADAPTER pAd)
|
||||||
{
|
{
|
||||||
int index, num, j;
|
int index, num, j;
|
||||||
PRTMP_TX_RING pTxRing;
|
PRTMP_TX_RING pTxRing;
|
||||||
@ -667,7 +667,7 @@ Return Value:
|
|||||||
Note:
|
Note:
|
||||||
========================================================================
|
========================================================================
|
||||||
*/
|
*/
|
||||||
VOID RT28XXDMADisable(IN RTMP_ADAPTER * pAd)
|
void RT28XXDMADisable(IN RTMP_ADAPTER * pAd)
|
||||||
{
|
{
|
||||||
WPDMA_GLO_CFG_STRUC GloCfg;
|
WPDMA_GLO_CFG_STRUC GloCfg;
|
||||||
|
|
||||||
@ -691,7 +691,7 @@ Return Value:
|
|||||||
Note:
|
Note:
|
||||||
========================================================================
|
========================================================================
|
||||||
*/
|
*/
|
||||||
VOID RT28XXDMAEnable(IN RTMP_ADAPTER * pAd)
|
void RT28XXDMAEnable(IN RTMP_ADAPTER * pAd)
|
||||||
{
|
{
|
||||||
WPDMA_GLO_CFG_STRUC GloCfg;
|
WPDMA_GLO_CFG_STRUC GloCfg;
|
||||||
int i = 0;
|
int i = 0;
|
||||||
@ -721,10 +721,10 @@ VOID RT28XXDMAEnable(IN RTMP_ADAPTER * pAd)
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOLEAN AsicCheckCommanOk(IN PRTMP_ADAPTER pAd, IN UCHAR Command)
|
BOOLEAN AsicCheckCommanOk(IN PRTMP_ADAPTER pAd, u8 Command)
|
||||||
{
|
{
|
||||||
UINT32 CmdStatus = 0, CID = 0, i;
|
u32 CmdStatus = 0, CID = 0, i;
|
||||||
UINT32 ThisCIDMask = 0;
|
u32 ThisCIDMask = 0;
|
||||||
|
|
||||||
i = 0;
|
i = 0;
|
||||||
do {
|
do {
|
||||||
@ -794,15 +794,15 @@ Return Value:
|
|||||||
Note:
|
Note:
|
||||||
========================================================================
|
========================================================================
|
||||||
*/
|
*/
|
||||||
VOID RT28xx_UpdateBeaconToAsic(IN RTMP_ADAPTER * pAd,
|
void RT28xx_UpdateBeaconToAsic(IN RTMP_ADAPTER * pAd,
|
||||||
IN INT apidx,
|
int apidx,
|
||||||
IN ULONG FrameLen, IN ULONG UpdatePos)
|
unsigned long FrameLen, unsigned long UpdatePos)
|
||||||
{
|
{
|
||||||
ULONG CapInfoPos = 0;
|
unsigned long CapInfoPos = 0;
|
||||||
UCHAR *ptr, *ptr_update, *ptr_capinfo;
|
u8 *ptr, *ptr_update, *ptr_capinfo;
|
||||||
UINT i;
|
u32 i;
|
||||||
BOOLEAN bBcnReq = FALSE;
|
BOOLEAN bBcnReq = FALSE;
|
||||||
UCHAR bcn_idx = 0;
|
u8 bcn_idx = 0;
|
||||||
|
|
||||||
{
|
{
|
||||||
DBGPRINT(RT_DEBUG_ERROR,
|
DBGPRINT(RT_DEBUG_ERROR,
|
||||||
@ -821,10 +821,10 @@ VOID RT28xx_UpdateBeaconToAsic(IN RTMP_ADAPTER * pAd,
|
|||||||
RTMP_IO_WRITE32(pAd, pAd->BeaconOffset[bcn_idx] + i,
|
RTMP_IO_WRITE32(pAd, pAd->BeaconOffset[bcn_idx] + i,
|
||||||
0x00);
|
0x00);
|
||||||
} else {
|
} else {
|
||||||
ptr = (PUCHAR) & pAd->BeaconTxWI;
|
ptr = (u8 *)& pAd->BeaconTxWI;
|
||||||
for (i = 0; i < TXWI_SIZE; i += 4) /* 16-byte TXWI field */
|
for (i = 0; i < TXWI_SIZE; i += 4) /* 16-byte TXWI field */
|
||||||
{
|
{
|
||||||
UINT32 longptr =
|
u32 longptr =
|
||||||
*ptr + (*(ptr + 1) << 8) + (*(ptr + 2) << 16) +
|
*ptr + (*(ptr + 1) << 8) + (*(ptr + 2) << 16) +
|
||||||
(*(ptr + 3) << 24);
|
(*(ptr + 3) << 24);
|
||||||
RTMP_IO_WRITE32(pAd, pAd->BeaconOffset[bcn_idx] + i,
|
RTMP_IO_WRITE32(pAd, pAd->BeaconOffset[bcn_idx] + i,
|
||||||
@ -853,7 +853,7 @@ VOID RT28xx_UpdateBeaconToAsic(IN RTMP_ADAPTER * pAd,
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID RT28xxPciStaAsicForceWakeup(IN PRTMP_ADAPTER pAd, IN BOOLEAN bFromTx)
|
void RT28xxPciStaAsicForceWakeup(IN PRTMP_ADAPTER pAd, IN BOOLEAN bFromTx)
|
||||||
{
|
{
|
||||||
AUTO_WAKEUP_STRUC AutoWakeupCfg;
|
AUTO_WAKEUP_STRUC AutoWakeupCfg;
|
||||||
|
|
||||||
@ -949,8 +949,8 @@ VOID RT28xxPciStaAsicForceWakeup(IN PRTMP_ADAPTER pAd, IN BOOLEAN bFromTx)
|
|||||||
DBGPRINT(RT_DEBUG_TRACE, ("<=======RT28xxPciStaAsicForceWakeup\n"));
|
DBGPRINT(RT_DEBUG_TRACE, ("<=======RT28xxPciStaAsicForceWakeup\n"));
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID RT28xxPciStaAsicSleepThenAutoWakeup(IN PRTMP_ADAPTER pAd,
|
void RT28xxPciStaAsicSleepThenAutoWakeup(IN PRTMP_ADAPTER pAd,
|
||||||
IN USHORT TbttNumToNextWakeUp)
|
u16 TbttNumToNextWakeUp)
|
||||||
{
|
{
|
||||||
BOOLEAN brc;
|
BOOLEAN brc;
|
||||||
|
|
||||||
@ -960,7 +960,7 @@ VOID RT28xxPciStaAsicSleepThenAutoWakeup(IN PRTMP_ADAPTER pAd,
|
|||||||
}
|
}
|
||||||
if (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_PCIE_DEVICE)
|
if (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_PCIE_DEVICE)
|
||||||
&& pAd->StaCfg.PSControl.field.EnableNewPS == TRUE) {
|
&& pAd->StaCfg.PSControl.field.EnableNewPS == TRUE) {
|
||||||
ULONG Now = 0;
|
unsigned long Now = 0;
|
||||||
if (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_WAKEUP_NOW)) {
|
if (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_WAKEUP_NOW)) {
|
||||||
DBGPRINT(RT_DEBUG_TRACE, ("waking up now!\n"));
|
DBGPRINT(RT_DEBUG_TRACE, ("waking up now!\n"));
|
||||||
OPSTATUS_CLEAR_FLAG(pAd, fOP_STATUS_DOZE);
|
OPSTATUS_CLEAR_FLAG(pAd, fOP_STATUS_DOZE);
|
||||||
@ -1016,9 +1016,9 @@ VOID RT28xxPciStaAsicSleepThenAutoWakeup(IN PRTMP_ADAPTER pAd,
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID PsPollWakeExec(IN PVOID SystemSpecific1,
|
void PsPollWakeExec(void *SystemSpecific1,
|
||||||
IN PVOID FunctionContext,
|
void *FunctionContext,
|
||||||
IN PVOID SystemSpecific2, IN PVOID SystemSpecific3)
|
void *SystemSpecific2, void *SystemSpecific3)
|
||||||
{
|
{
|
||||||
RTMP_ADAPTER *pAd = (RTMP_ADAPTER *) FunctionContext;
|
RTMP_ADAPTER *pAd = (RTMP_ADAPTER *) FunctionContext;
|
||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
@ -1044,9 +1044,9 @@ VOID PsPollWakeExec(IN PVOID SystemSpecific1,
|
|||||||
#endif /* PCIE_PS_SUPPORT // */
|
#endif /* PCIE_PS_SUPPORT // */
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID RadioOnExec(IN PVOID SystemSpecific1,
|
void RadioOnExec(void *SystemSpecific1,
|
||||||
IN PVOID FunctionContext,
|
void *FunctionContext,
|
||||||
IN PVOID SystemSpecific2, IN PVOID SystemSpecific3)
|
void *SystemSpecific2, void *SystemSpecific3)
|
||||||
{
|
{
|
||||||
RTMP_ADAPTER *pAd = (RTMP_ADAPTER *) FunctionContext;
|
RTMP_ADAPTER *pAd = (RTMP_ADAPTER *) FunctionContext;
|
||||||
RTMP_CHIP_OP *pChipOps = &pAd->chipOps;
|
RTMP_CHIP_OP *pChipOps = &pAd->chipOps;
|
||||||
@ -1164,11 +1164,11 @@ VOID RadioOnExec(IN PVOID SystemSpecific1,
|
|||||||
|
|
||||||
==========================================================================
|
==========================================================================
|
||||||
*/
|
*/
|
||||||
BOOLEAN RT28xxPciAsicRadioOn(IN PRTMP_ADAPTER pAd, IN UCHAR Level)
|
BOOLEAN RT28xxPciAsicRadioOn(IN PRTMP_ADAPTER pAd, u8 Level)
|
||||||
{
|
{
|
||||||
/*WPDMA_GLO_CFG_STRUC DmaCfg; */
|
/*WPDMA_GLO_CFG_STRUC DmaCfg; */
|
||||||
BOOLEAN Cancelled;
|
BOOLEAN Cancelled;
|
||||||
/*UINT32 MACValue; */
|
/*u32 MACValue; */
|
||||||
|
|
||||||
if (pAd->OpMode == OPMODE_AP && Level == DOT11POWERSAVE)
|
if (pAd->OpMode == OPMODE_AP && Level == DOT11POWERSAVE)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
@ -1287,15 +1287,15 @@ BOOLEAN RT28xxPciAsicRadioOn(IN PRTMP_ADAPTER pAd, IN UCHAR Level)
|
|||||||
==========================================================================
|
==========================================================================
|
||||||
*/
|
*/
|
||||||
BOOLEAN RT28xxPciAsicRadioOff(IN PRTMP_ADAPTER pAd,
|
BOOLEAN RT28xxPciAsicRadioOff(IN PRTMP_ADAPTER pAd,
|
||||||
IN UCHAR Level, IN USHORT TbttNumToNextWakeUp)
|
u8 Level, u16 TbttNumToNextWakeUp)
|
||||||
{
|
{
|
||||||
WPDMA_GLO_CFG_STRUC DmaCfg;
|
WPDMA_GLO_CFG_STRUC DmaCfg;
|
||||||
UCHAR i, tempBBP_R3 = 0;
|
u8 i, tempBBP_R3 = 0;
|
||||||
BOOLEAN brc = FALSE, Cancelled;
|
BOOLEAN brc = FALSE, Cancelled;
|
||||||
UINT32 TbTTTime = 0;
|
u32 TbTTTime = 0;
|
||||||
UINT32 PsPollTime = 0 /*, MACValue */ ;
|
u32 PsPollTime = 0 /*, MACValue */ ;
|
||||||
ULONG BeaconPeriodTime;
|
unsigned long BeaconPeriodTime;
|
||||||
UINT32 RxDmaIdx, RxCpuIdx;
|
u32 RxDmaIdx, RxCpuIdx;
|
||||||
DBGPRINT(RT_DEBUG_TRACE,
|
DBGPRINT(RT_DEBUG_TRACE,
|
||||||
("AsicRadioOff ===> Lv= %d, TxCpuIdx = %d, TxDmaIdx = %d. RxCpuIdx = %d, RxDmaIdx = %d.\n",
|
("AsicRadioOff ===> Lv= %d, TxCpuIdx = %d, TxDmaIdx = %d. RxCpuIdx = %d, RxDmaIdx = %d.\n",
|
||||||
Level, pAd->TxRing[0].TxCpuIdx, pAd->TxRing[0].TxDmaIdx,
|
Level, pAd->TxRing[0].TxCpuIdx, pAd->TxRing[0].TxDmaIdx,
|
||||||
@ -1497,7 +1497,7 @@ BOOLEAN RT28xxPciAsicRadioOff(IN PRTMP_ADAPTER pAd,
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID RT28xxPciMlmeRadioOn(IN PRTMP_ADAPTER pAd)
|
void RT28xxPciMlmeRadioOn(IN PRTMP_ADAPTER pAd)
|
||||||
{
|
{
|
||||||
if (!RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_RADIO_OFF))
|
if (!RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_RADIO_OFF))
|
||||||
return;
|
return;
|
||||||
@ -1546,7 +1546,7 @@ VOID RT28xxPciMlmeRadioOn(IN PRTMP_ADAPTER pAd)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID RT28xxPciMlmeRadioOFF(IN PRTMP_ADAPTER pAd)
|
void RT28xxPciMlmeRadioOFF(IN PRTMP_ADAPTER pAd)
|
||||||
{
|
{
|
||||||
BOOLEAN brc = TRUE;
|
BOOLEAN brc = TRUE;
|
||||||
|
|
||||||
|
@ -48,10 +48,10 @@ Note:
|
|||||||
NDIS packet descriptor.
|
NDIS packet descriptor.
|
||||||
========================================================================
|
========================================================================
|
||||||
*/
|
*/
|
||||||
NDIS_STATUS NICInitRecv(IN PRTMP_ADAPTER pAd)
|
int NICInitRecv(IN PRTMP_ADAPTER pAd)
|
||||||
{
|
{
|
||||||
UCHAR i;
|
u8 i;
|
||||||
NDIS_STATUS Status = NDIS_STATUS_SUCCESS;
|
int Status = NDIS_STATUS_SUCCESS;
|
||||||
POS_COOKIE pObj = (POS_COOKIE) pAd->OS_Cookie;
|
POS_COOKIE pObj = (POS_COOKIE) pAd->OS_Cookie;
|
||||||
|
|
||||||
DBGPRINT(RT_DEBUG_TRACE, ("--> NICInitRecv\n"));
|
DBGPRINT(RT_DEBUG_TRACE, ("--> NICInitRecv\n"));
|
||||||
@ -132,7 +132,7 @@ Return Value:
|
|||||||
Note:
|
Note:
|
||||||
========================================================================
|
========================================================================
|
||||||
*/
|
*/
|
||||||
NDIS_STATUS NICInitTransmit(IN PRTMP_ADAPTER pAd)
|
int NICInitTransmit(IN PRTMP_ADAPTER pAd)
|
||||||
{
|
{
|
||||||
#define LM_USB_ALLOC(pObj, Context, TB_Type, BufferSize, Status, msg1, err1, msg2, err2) \
|
#define LM_USB_ALLOC(pObj, Context, TB_Type, BufferSize, Status, msg1, err1, msg2, err2) \
|
||||||
Context->pUrb = RTUSB_ALLOC_URB(0); \
|
Context->pUrb = RTUSB_ALLOC_URB(0); \
|
||||||
@ -159,15 +159,15 @@ NDIS_STATUS NICInitTransmit(IN PRTMP_ADAPTER pAd)
|
|||||||
Context->data_dma); \
|
Context->data_dma); \
|
||||||
Context->TransferBuffer = NULL; }
|
Context->TransferBuffer = NULL; }
|
||||||
|
|
||||||
UCHAR i, acidx;
|
u8 i, acidx;
|
||||||
NDIS_STATUS Status = NDIS_STATUS_SUCCESS;
|
int Status = NDIS_STATUS_SUCCESS;
|
||||||
PTX_CONTEXT pNullContext = &(pAd->NullContext);
|
PTX_CONTEXT pNullContext = &(pAd->NullContext);
|
||||||
PTX_CONTEXT pPsPollContext = &(pAd->PsPollContext);
|
PTX_CONTEXT pPsPollContext = &(pAd->PsPollContext);
|
||||||
PTX_CONTEXT pRTSContext = &(pAd->RTSContext);
|
PTX_CONTEXT pRTSContext = &(pAd->RTSContext);
|
||||||
PTX_CONTEXT pMLMEContext = NULL;
|
PTX_CONTEXT pMLMEContext = NULL;
|
||||||
/* PHT_TX_CONTEXT pHTTXContext = NULL; */
|
/* PHT_TX_CONTEXT pHTTXContext = NULL; */
|
||||||
POS_COOKIE pObj = (POS_COOKIE) pAd->OS_Cookie;
|
POS_COOKIE pObj = (POS_COOKIE) pAd->OS_Cookie;
|
||||||
PVOID RingBaseVa;
|
void *RingBaseVa;
|
||||||
/* RTMP_TX_RING *pTxRing; */
|
/* RTMP_TX_RING *pTxRing; */
|
||||||
RTMP_MGMT_RING *pMgmtRing;
|
RTMP_MGMT_RING *pMgmtRing;
|
||||||
|
|
||||||
@ -233,7 +233,7 @@ NDIS_STATUS NICInitTransmit(IN PRTMP_ADAPTER pAd)
|
|||||||
/* Allocate MGMT ring descriptor's memory */
|
/* Allocate MGMT ring descriptor's memory */
|
||||||
pAd->MgmtDescRing.AllocSize =
|
pAd->MgmtDescRing.AllocSize =
|
||||||
MGMT_RING_SIZE * sizeof(TX_CONTEXT);
|
MGMT_RING_SIZE * sizeof(TX_CONTEXT);
|
||||||
os_alloc_mem(pAd, (PUCHAR *) (&pAd->MgmtDescRing.AllocVa),
|
os_alloc_mem(pAd, (u8 **) (&pAd->MgmtDescRing.AllocVa),
|
||||||
pAd->MgmtDescRing.AllocSize);
|
pAd->MgmtDescRing.AllocSize);
|
||||||
if (pAd->MgmtDescRing.AllocVa == NULL) {
|
if (pAd->MgmtDescRing.AllocVa == NULL) {
|
||||||
DBGPRINT_ERR(("Failed to allocate a big buffer for MgmtDescRing!\n"));
|
DBGPRINT_ERR(("Failed to allocate a big buffer for MgmtDescRing!\n"));
|
||||||
@ -274,7 +274,7 @@ NDIS_STATUS NICInitTransmit(IN PRTMP_ADAPTER pAd)
|
|||||||
pMLMEContext->SelfIdx = i;
|
pMLMEContext->SelfIdx = i;
|
||||||
|
|
||||||
/* Offset to next ring descriptor address */
|
/* Offset to next ring descriptor address */
|
||||||
RingBaseVa = (PUCHAR) RingBaseVa + sizeof(TX_CONTEXT);
|
RingBaseVa = (u8 *)RingBaseVa + sizeof(TX_CONTEXT);
|
||||||
}
|
}
|
||||||
DBGPRINT(RT_DEBUG_TRACE,
|
DBGPRINT(RT_DEBUG_TRACE,
|
||||||
("MGMT Ring: total %d entry allocated\n", i));
|
("MGMT Ring: total %d entry allocated\n", i));
|
||||||
@ -428,11 +428,11 @@ Return Value:
|
|||||||
Note:
|
Note:
|
||||||
========================================================================
|
========================================================================
|
||||||
*/
|
*/
|
||||||
NDIS_STATUS RTMPAllocTxRxRingMemory(IN PRTMP_ADAPTER pAd)
|
int RTMPAllocTxRxRingMemory(IN PRTMP_ADAPTER pAd)
|
||||||
{
|
{
|
||||||
/* COUNTER_802_11 pCounter = &pAd->WlanCounters; */
|
/* COUNTER_802_11 pCounter = &pAd->WlanCounters; */
|
||||||
NDIS_STATUS Status;
|
int Status;
|
||||||
INT num;
|
int num;
|
||||||
|
|
||||||
DBGPRINT(RT_DEBUG_TRACE, ("--> RTMPAllocTxRxRingMemory\n"));
|
DBGPRINT(RT_DEBUG_TRACE, ("--> RTMPAllocTxRxRingMemory\n"));
|
||||||
|
|
||||||
@ -519,7 +519,7 @@ Return Value:
|
|||||||
Note:
|
Note:
|
||||||
========================================================================
|
========================================================================
|
||||||
*/
|
*/
|
||||||
VOID RTMPFreeTxRxRingMemory(IN PRTMP_ADAPTER pAd)
|
void RTMPFreeTxRxRingMemory(IN PRTMP_ADAPTER pAd)
|
||||||
{
|
{
|
||||||
#define LM_URB_FREE(pObj, Context, BufferSize) \
|
#define LM_URB_FREE(pObj, Context, BufferSize) \
|
||||||
if (NULL != Context->pUrb) { \
|
if (NULL != Context->pUrb) { \
|
||||||
@ -532,7 +532,7 @@ VOID RTMPFreeTxRxRingMemory(IN PRTMP_ADAPTER pAd)
|
|||||||
Context->data_dma); \
|
Context->data_dma); \
|
||||||
Context->TransferBuffer = NULL; }
|
Context->TransferBuffer = NULL; }
|
||||||
|
|
||||||
UINT i, acidx;
|
u32 i, acidx;
|
||||||
PTX_CONTEXT pNullContext = &pAd->NullContext;
|
PTX_CONTEXT pNullContext = &pAd->NullContext;
|
||||||
PTX_CONTEXT pPsPollContext = &pAd->PsPollContext;
|
PTX_CONTEXT pPsPollContext = &pAd->PsPollContext;
|
||||||
PTX_CONTEXT pRTSContext = &pAd->RTSContext;
|
PTX_CONTEXT pRTSContext = &pAd->RTSContext;
|
||||||
@ -636,11 +636,11 @@ Return Value:
|
|||||||
Note:
|
Note:
|
||||||
========================================================================
|
========================================================================
|
||||||
*/
|
*/
|
||||||
NDIS_STATUS RTUSBWriteHWMACAddress(IN PRTMP_ADAPTER pAd)
|
int RTUSBWriteHWMACAddress(IN PRTMP_ADAPTER pAd)
|
||||||
{
|
{
|
||||||
MAC_DW0_STRUC StaMacReg0;
|
MAC_DW0_STRUC StaMacReg0;
|
||||||
MAC_DW1_STRUC StaMacReg1;
|
MAC_DW1_STRUC StaMacReg1;
|
||||||
NDIS_STATUS Status = NDIS_STATUS_SUCCESS;
|
int Status = NDIS_STATUS_SUCCESS;
|
||||||
LARGE_INTEGER NOW;
|
LARGE_INTEGER NOW;
|
||||||
|
|
||||||
/* initialize the random number generator */
|
/* initialize the random number generator */
|
||||||
@ -687,7 +687,7 @@ Return Value:
|
|||||||
Note:
|
Note:
|
||||||
========================================================================
|
========================================================================
|
||||||
*/
|
*/
|
||||||
VOID RT28XXDMADisable(IN RTMP_ADAPTER * pAd)
|
void RT28XXDMADisable(IN RTMP_ADAPTER * pAd)
|
||||||
{
|
{
|
||||||
/* no use */
|
/* no use */
|
||||||
}
|
}
|
||||||
@ -706,7 +706,7 @@ Return Value:
|
|||||||
Note:
|
Note:
|
||||||
========================================================================
|
========================================================================
|
||||||
*/
|
*/
|
||||||
VOID RT28XXDMAEnable(IN RTMP_ADAPTER * pAd)
|
void RT28XXDMAEnable(IN RTMP_ADAPTER * pAd)
|
||||||
{
|
{
|
||||||
WPDMA_GLO_CFG_STRUC GloCfg;
|
WPDMA_GLO_CFG_STRUC GloCfg;
|
||||||
USB_DMA_CFG_STRUC UsbCfg;
|
USB_DMA_CFG_STRUC UsbCfg;
|
||||||
@ -767,18 +767,18 @@ Return Value:
|
|||||||
Note:
|
Note:
|
||||||
========================================================================
|
========================================================================
|
||||||
*/
|
*/
|
||||||
VOID RT28xx_UpdateBeaconToAsic(IN RTMP_ADAPTER * pAd,
|
void RT28xx_UpdateBeaconToAsic(IN RTMP_ADAPTER * pAd,
|
||||||
IN INT apidx,
|
int apidx,
|
||||||
IN ULONG FrameLen, IN ULONG UpdatePos)
|
unsigned long FrameLen, unsigned long UpdatePos)
|
||||||
{
|
{
|
||||||
PUCHAR pBeaconFrame = NULL;
|
u8 *pBeaconFrame = NULL;
|
||||||
UCHAR *ptr;
|
u8 *ptr;
|
||||||
UINT i, padding;
|
u32 i, padding;
|
||||||
BEACON_SYNC_STRUCT *pBeaconSync = pAd->CommonCfg.pBeaconSync;
|
BEACON_SYNC_STRUCT *pBeaconSync = pAd->CommonCfg.pBeaconSync;
|
||||||
UINT32 longValue;
|
u32 longValue;
|
||||||
/* USHORT shortValue; */
|
/* u16 shortValue; */
|
||||||
BOOLEAN bBcnReq = FALSE;
|
BOOLEAN bBcnReq = FALSE;
|
||||||
UCHAR bcn_idx = 0;
|
u8 bcn_idx = 0;
|
||||||
|
|
||||||
if (pBeaconFrame == NULL) {
|
if (pBeaconFrame == NULL) {
|
||||||
DBGPRINT(RT_DEBUG_ERROR, ("pBeaconFrame is NULL!\n"));
|
DBGPRINT(RT_DEBUG_ERROR, ("pBeaconFrame is NULL!\n"));
|
||||||
@ -803,7 +803,7 @@ VOID RT28xx_UpdateBeaconToAsic(IN RTMP_ADAPTER * pAd,
|
|||||||
(~(BEACON_BITMAP_MASK & (1 << bcn_idx)));
|
(~(BEACON_BITMAP_MASK & (1 << bcn_idx)));
|
||||||
NdisZeroMemory(pBeaconSync->BeaconTxWI[bcn_idx], TXWI_SIZE);
|
NdisZeroMemory(pBeaconSync->BeaconTxWI[bcn_idx], TXWI_SIZE);
|
||||||
} else {
|
} else {
|
||||||
ptr = (PUCHAR) & pAd->BeaconTxWI;
|
ptr = (u8 *)& pAd->BeaconTxWI;
|
||||||
if (NdisEqualMemory(pBeaconSync->BeaconTxWI[bcn_idx], &pAd->BeaconTxWI, TXWI_SIZE) == FALSE) { /* If BeaconTxWI changed, we need to rewrite the TxWI for the Beacon frames. */
|
if (NdisEqualMemory(pBeaconSync->BeaconTxWI[bcn_idx], &pAd->BeaconTxWI, TXWI_SIZE) == FALSE) { /* If BeaconTxWI changed, we need to rewrite the TxWI for the Beacon frames. */
|
||||||
pBeaconSync->BeaconBitMap &=
|
pBeaconSync->BeaconBitMap &=
|
||||||
(~(BEACON_BITMAP_MASK & (1 << bcn_idx)));
|
(~(BEACON_BITMAP_MASK & (1 << bcn_idx)));
|
||||||
@ -827,7 +827,7 @@ VOID RT28xx_UpdateBeaconToAsic(IN RTMP_ADAPTER * pAd,
|
|||||||
|
|
||||||
ptr = pBeaconSync->BeaconBuf[bcn_idx];
|
ptr = pBeaconSync->BeaconBuf[bcn_idx];
|
||||||
padding = (FrameLen & 0x01);
|
padding = (FrameLen & 0x01);
|
||||||
NdisZeroMemory((PUCHAR) (pBeaconFrame + FrameLen), padding);
|
NdisZeroMemory((u8 *)(pBeaconFrame + FrameLen), padding);
|
||||||
FrameLen += padding;
|
FrameLen += padding;
|
||||||
for (i = 0; i < FrameLen /*HW_BEACON_OFFSET */ ; i += 2) {
|
for (i = 0; i < FrameLen /*HW_BEACON_OFFSET */ ; i += 2) {
|
||||||
if (NdisEqualMemory(ptr, pBeaconFrame, 2) == FALSE) {
|
if (NdisEqualMemory(ptr, pBeaconFrame, 2) == FALSE) {
|
||||||
@ -849,7 +849,7 @@ VOID RT28xx_UpdateBeaconToAsic(IN RTMP_ADAPTER * pAd,
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID RTUSBBssBeaconStop(IN RTMP_ADAPTER * pAd)
|
void RTUSBBssBeaconStop(IN RTMP_ADAPTER * pAd)
|
||||||
{
|
{
|
||||||
BEACON_SYNC_STRUCT *pBeaconSync;
|
BEACON_SYNC_STRUCT *pBeaconSync;
|
||||||
int i, offset;
|
int i, offset;
|
||||||
@ -857,7 +857,7 @@ VOID RTUSBBssBeaconStop(IN RTMP_ADAPTER * pAd)
|
|||||||
|
|
||||||
pBeaconSync = pAd->CommonCfg.pBeaconSync;
|
pBeaconSync = pAd->CommonCfg.pBeaconSync;
|
||||||
if (pBeaconSync && pBeaconSync->EnableBeacon) {
|
if (pBeaconSync && pBeaconSync->EnableBeacon) {
|
||||||
INT NumOfBcn;
|
int NumOfBcn;
|
||||||
|
|
||||||
{
|
{
|
||||||
NumOfBcn = MAX_MESH_NUM;
|
NumOfBcn = MAX_MESH_NUM;
|
||||||
@ -883,7 +883,7 @@ VOID RTUSBBssBeaconStop(IN RTMP_ADAPTER * pAd)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID RTUSBBssBeaconStart(IN RTMP_ADAPTER * pAd)
|
void RTUSBBssBeaconStart(IN RTMP_ADAPTER * pAd)
|
||||||
{
|
{
|
||||||
int apidx;
|
int apidx;
|
||||||
BEACON_SYNC_STRUCT *pBeaconSync;
|
BEACON_SYNC_STRUCT *pBeaconSync;
|
||||||
@ -891,15 +891,15 @@ VOID RTUSBBssBeaconStart(IN RTMP_ADAPTER * pAd)
|
|||||||
|
|
||||||
pBeaconSync = pAd->CommonCfg.pBeaconSync;
|
pBeaconSync = pAd->CommonCfg.pBeaconSync;
|
||||||
if (pBeaconSync && pBeaconSync->EnableBeacon) {
|
if (pBeaconSync && pBeaconSync->EnableBeacon) {
|
||||||
INT NumOfBcn;
|
int NumOfBcn;
|
||||||
|
|
||||||
{
|
{
|
||||||
NumOfBcn = MAX_MESH_NUM;
|
NumOfBcn = MAX_MESH_NUM;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (apidx = 0; apidx < NumOfBcn; apidx++) {
|
for (apidx = 0; apidx < NumOfBcn; apidx++) {
|
||||||
UCHAR CapabilityInfoLocationInBeacon = 0;
|
u8 CapabilityInfoLocationInBeacon = 0;
|
||||||
UCHAR TimIELocationInBeacon = 0;
|
u8 TimIELocationInBeacon = 0;
|
||||||
|
|
||||||
NdisZeroMemory(pBeaconSync->BeaconBuf[apidx],
|
NdisZeroMemory(pBeaconSync->BeaconBuf[apidx],
|
||||||
HW_BEACON_OFFSET);
|
HW_BEACON_OFFSET);
|
||||||
@ -929,12 +929,12 @@ VOID RTUSBBssBeaconStart(IN RTMP_ADAPTER * pAd)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID RTUSBBssBeaconInit(IN RTMP_ADAPTER * pAd)
|
void RTUSBBssBeaconInit(IN RTMP_ADAPTER * pAd)
|
||||||
{
|
{
|
||||||
BEACON_SYNC_STRUCT *pBeaconSync;
|
BEACON_SYNC_STRUCT *pBeaconSync;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
os_alloc_mem(pAd, (PUCHAR *) (&pAd->CommonCfg.pBeaconSync),
|
os_alloc_mem(pAd, (u8 **) (&pAd->CommonCfg.pBeaconSync),
|
||||||
sizeof(BEACON_SYNC_STRUCT));
|
sizeof(BEACON_SYNC_STRUCT));
|
||||||
/*NdisAllocMemory(pAd->CommonCfg.pBeaconSync, sizeof(BEACON_SYNC_STRUCT), MEM_ALLOC_FLAG); */
|
/*NdisAllocMemory(pAd->CommonCfg.pBeaconSync, sizeof(BEACON_SYNC_STRUCT), MEM_ALLOC_FLAG); */
|
||||||
if (pAd->CommonCfg.pBeaconSync) {
|
if (pAd->CommonCfg.pBeaconSync) {
|
||||||
@ -954,7 +954,7 @@ VOID RTUSBBssBeaconInit(IN RTMP_ADAPTER * pAd)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID RTUSBBssBeaconExit(IN RTMP_ADAPTER * pAd)
|
void RTUSBBssBeaconExit(IN RTMP_ADAPTER * pAd)
|
||||||
{
|
{
|
||||||
BEACON_SYNC_STRUCT *pBeaconSync;
|
BEACON_SYNC_STRUCT *pBeaconSync;
|
||||||
BOOLEAN Cancelled = TRUE;
|
BOOLEAN Cancelled = TRUE;
|
||||||
@ -997,13 +997,13 @@ VOID RTUSBBssBeaconExit(IN RTMP_ADAPTER * pAd)
|
|||||||
|
|
||||||
========================================================================
|
========================================================================
|
||||||
*/
|
*/
|
||||||
VOID BeaconUpdateExec(IN PVOID SystemSpecific1,
|
void BeaconUpdateExec(void *SystemSpecific1,
|
||||||
IN PVOID FunctionContext,
|
void *FunctionContext,
|
||||||
IN PVOID SystemSpecific2, IN PVOID SystemSpecific3)
|
void *SystemSpecific2, void *SystemSpecific3)
|
||||||
{
|
{
|
||||||
PRTMP_ADAPTER pAd = (PRTMP_ADAPTER) FunctionContext;
|
PRTMP_ADAPTER pAd = (PRTMP_ADAPTER) FunctionContext;
|
||||||
LARGE_INTEGER tsfTime_a; /*, tsfTime_b, deltaTime_exp, deltaTime_ab; */
|
LARGE_INTEGER tsfTime_a; /*, tsfTime_b, deltaTime_exp, deltaTime_ab; */
|
||||||
UINT32 delta, delta2MS, period2US, remain, remain_low, remain_high;
|
u32 delta, delta2MS, period2US, remain, remain_low, remain_high;
|
||||||
/* BOOLEAN positive; */
|
/* BOOLEAN positive; */
|
||||||
|
|
||||||
if (pAd->CommonCfg.IsUpdateBeacon == TRUE) {
|
if (pAd->CommonCfg.IsUpdateBeacon == TRUE) {
|
||||||
@ -1038,7 +1038,7 @@ VOID BeaconUpdateExec(IN PVOID SystemSpecific1,
|
|||||||
* 2870 Radio on/off Related functions.
|
* 2870 Radio on/off Related functions.
|
||||||
*
|
*
|
||||||
********************************************************************/
|
********************************************************************/
|
||||||
VOID RT28xxUsbMlmeRadioOn(IN PRTMP_ADAPTER pAd)
|
void RT28xxUsbMlmeRadioOn(IN PRTMP_ADAPTER pAd)
|
||||||
{
|
{
|
||||||
RTMP_CHIP_OP *pChipOps = &pAd->chipOps;
|
RTMP_CHIP_OP *pChipOps = &pAd->chipOps;
|
||||||
|
|
||||||
@ -1068,10 +1068,10 @@ VOID RT28xxUsbMlmeRadioOn(IN PRTMP_ADAPTER pAd)
|
|||||||
RTMPSetLED(pAd, LED_RADIO_ON);
|
RTMPSetLED(pAd, LED_RADIO_ON);
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID RT28xxUsbMlmeRadioOFF(IN PRTMP_ADAPTER pAd)
|
void RT28xxUsbMlmeRadioOFF(IN PRTMP_ADAPTER pAd)
|
||||||
{
|
{
|
||||||
WPDMA_GLO_CFG_STRUC GloCfg;
|
WPDMA_GLO_CFG_STRUC GloCfg;
|
||||||
UINT32 Value, i;
|
u32 Value, i;
|
||||||
|
|
||||||
DBGPRINT(RT_DEBUG_TRACE, ("RT28xxUsbMlmeRadioOFF()\n"));
|
DBGPRINT(RT_DEBUG_TRACE, ("RT28xxUsbMlmeRadioOFF()\n"));
|
||||||
|
|
||||||
|
@ -36,16 +36,16 @@
|
|||||||
*/
|
*/
|
||||||
#include "../rt_config.h"
|
#include "../rt_config.h"
|
||||||
|
|
||||||
extern UCHAR CISCO_OUI[];
|
extern u8 CISCO_OUI[];
|
||||||
|
|
||||||
extern UCHAR WPA_OUI[];
|
extern u8 WPA_OUI[];
|
||||||
extern UCHAR RSN_OUI[];
|
extern u8 RSN_OUI[];
|
||||||
extern UCHAR WME_INFO_ELEM[];
|
extern u8 WME_INFO_ELEM[];
|
||||||
extern UCHAR WME_PARM_ELEM[];
|
extern u8 WME_PARM_ELEM[];
|
||||||
extern UCHAR Ccx2QosInfo[];
|
extern u8 Ccx2QosInfo[];
|
||||||
extern UCHAR RALINK_OUI[];
|
extern u8 RALINK_OUI[];
|
||||||
extern UCHAR BROADCOM_OUI[];
|
extern u8 BROADCOM_OUI[];
|
||||||
extern UCHAR WPS_OUI[];
|
extern u8 WPS_OUI[];
|
||||||
|
|
||||||
/*
|
/*
|
||||||
==========================================================================
|
==========================================================================
|
||||||
@ -59,7 +59,7 @@ extern UCHAR WPS_OUI[];
|
|||||||
==========================================================================
|
==========================================================================
|
||||||
*/
|
*/
|
||||||
BOOLEAN MlmeAddBAReqSanity(IN PRTMP_ADAPTER pAd,
|
BOOLEAN MlmeAddBAReqSanity(IN PRTMP_ADAPTER pAd,
|
||||||
IN VOID * Msg, IN ULONG MsgLen, OUT PUCHAR pAddr2)
|
void * Msg, unsigned long MsgLen, u8 *pAddr2)
|
||||||
{
|
{
|
||||||
PMLME_ADDBA_REQ_STRUCT pInfo;
|
PMLME_ADDBA_REQ_STRUCT pInfo;
|
||||||
|
|
||||||
@ -97,7 +97,7 @@ BOOLEAN MlmeAddBAReqSanity(IN PRTMP_ADAPTER pAd,
|
|||||||
|
|
||||||
==========================================================================
|
==========================================================================
|
||||||
*/
|
*/
|
||||||
BOOLEAN MlmeDelBAReqSanity(IN PRTMP_ADAPTER pAd, IN VOID * Msg, IN ULONG MsgLen)
|
BOOLEAN MlmeDelBAReqSanity(IN PRTMP_ADAPTER pAd, void * Msg, unsigned long MsgLen)
|
||||||
{
|
{
|
||||||
MLME_DELBA_REQ_STRUCT *pInfo;
|
MLME_DELBA_REQ_STRUCT *pInfo;
|
||||||
pInfo = (MLME_DELBA_REQ_STRUCT *) Msg;
|
pInfo = (MLME_DELBA_REQ_STRUCT *) Msg;
|
||||||
@ -132,8 +132,8 @@ BOOLEAN MlmeDelBAReqSanity(IN PRTMP_ADAPTER pAd, IN VOID * Msg, IN ULONG MsgLen)
|
|||||||
}
|
}
|
||||||
|
|
||||||
BOOLEAN PeerAddBAReqActionSanity(IN PRTMP_ADAPTER pAd,
|
BOOLEAN PeerAddBAReqActionSanity(IN PRTMP_ADAPTER pAd,
|
||||||
IN VOID * pMsg,
|
void * pMsg,
|
||||||
IN ULONG MsgLen, OUT PUCHAR pAddr2)
|
unsigned long MsgLen, u8 *pAddr2)
|
||||||
{
|
{
|
||||||
PFRAME_802_11 pFrame = (PFRAME_802_11) pMsg;
|
PFRAME_802_11 pFrame = (PFRAME_802_11) pMsg;
|
||||||
PFRAME_ADDBA_REQ pAddFrame;
|
PFRAME_ADDBA_REQ pAddFrame;
|
||||||
@ -145,8 +145,8 @@ BOOLEAN PeerAddBAReqActionSanity(IN PRTMP_ADAPTER pAd,
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
/* we support immediate BA. */
|
/* we support immediate BA. */
|
||||||
*(USHORT *) (&pAddFrame->BaParm) =
|
*(u16 *) (&pAddFrame->BaParm) =
|
||||||
cpu2le16(*(USHORT *) (&pAddFrame->BaParm));
|
cpu2le16(*(u16 *) (&pAddFrame->BaParm));
|
||||||
pAddFrame->TimeOutValue = cpu2le16(pAddFrame->TimeOutValue);
|
pAddFrame->TimeOutValue = cpu2le16(pAddFrame->TimeOutValue);
|
||||||
pAddFrame->BaStartSeq.word = cpu2le16(pAddFrame->BaStartSeq.word);
|
pAddFrame->BaStartSeq.word = cpu2le16(pAddFrame->BaStartSeq.word);
|
||||||
|
|
||||||
@ -172,7 +172,7 @@ BOOLEAN PeerAddBAReqActionSanity(IN PRTMP_ADAPTER pAd,
|
|||||||
}
|
}
|
||||||
|
|
||||||
BOOLEAN PeerAddBARspActionSanity(IN PRTMP_ADAPTER pAd,
|
BOOLEAN PeerAddBARspActionSanity(IN PRTMP_ADAPTER pAd,
|
||||||
IN VOID * pMsg, IN ULONG MsgLen)
|
void * pMsg, unsigned long MsgLen)
|
||||||
{
|
{
|
||||||
PFRAME_ADDBA_RSP pAddFrame;
|
PFRAME_ADDBA_RSP pAddFrame;
|
||||||
|
|
||||||
@ -184,8 +184,8 @@ BOOLEAN PeerAddBARspActionSanity(IN PRTMP_ADAPTER pAd,
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
/* we support immediate BA. */
|
/* we support immediate BA. */
|
||||||
*(USHORT *) (&pAddFrame->BaParm) =
|
*(u16 *) (&pAddFrame->BaParm) =
|
||||||
cpu2le16(*(USHORT *) (&pAddFrame->BaParm));
|
cpu2le16(*(u16 *) (&pAddFrame->BaParm));
|
||||||
pAddFrame->StatusCode = cpu2le16(pAddFrame->StatusCode);
|
pAddFrame->StatusCode = cpu2le16(pAddFrame->StatusCode);
|
||||||
pAddFrame->TimeOutValue = cpu2le16(pAddFrame->TimeOutValue);
|
pAddFrame->TimeOutValue = cpu2le16(pAddFrame->TimeOutValue);
|
||||||
|
|
||||||
@ -207,7 +207,7 @@ BOOLEAN PeerAddBARspActionSanity(IN PRTMP_ADAPTER pAd,
|
|||||||
}
|
}
|
||||||
|
|
||||||
BOOLEAN PeerDelBAActionSanity(IN PRTMP_ADAPTER pAd,
|
BOOLEAN PeerDelBAActionSanity(IN PRTMP_ADAPTER pAd,
|
||||||
IN UCHAR Wcid, IN VOID * pMsg, IN ULONG MsgLen)
|
u8 Wcid, void * pMsg, unsigned long MsgLen)
|
||||||
{
|
{
|
||||||
/*PFRAME_802_11 pFrame = (PFRAME_802_11)pMsg; */
|
/*PFRAME_802_11 pFrame = (PFRAME_802_11)pMsg; */
|
||||||
PFRAME_DELBA_REQ pDelFrame;
|
PFRAME_DELBA_REQ pDelFrame;
|
||||||
@ -219,8 +219,8 @@ BOOLEAN PeerDelBAActionSanity(IN PRTMP_ADAPTER pAd,
|
|||||||
|
|
||||||
pDelFrame = (PFRAME_DELBA_REQ) (pMsg);
|
pDelFrame = (PFRAME_DELBA_REQ) (pMsg);
|
||||||
|
|
||||||
*(USHORT *) (&pDelFrame->DelbaParm) =
|
*(u16 *) (&pDelFrame->DelbaParm) =
|
||||||
cpu2le16(*(USHORT *) (&pDelFrame->DelbaParm));
|
cpu2le16(*(u16 *) (&pDelFrame->DelbaParm));
|
||||||
pDelFrame->ReasonCode = cpu2le16(pDelFrame->ReasonCode);
|
pDelFrame->ReasonCode = cpu2le16(pDelFrame->ReasonCode);
|
||||||
|
|
||||||
if (pDelFrame->DelbaParm.TID & 0xfff0)
|
if (pDelFrame->DelbaParm.TID & 0xfff0)
|
||||||
@ -240,24 +240,24 @@ BOOLEAN PeerDelBAActionSanity(IN PRTMP_ADAPTER pAd,
|
|||||||
|
|
||||||
==========================================================================
|
==========================================================================
|
||||||
*/
|
*/
|
||||||
BOOLEAN PeerBeaconAndProbeRspSanity(IN PRTMP_ADAPTER pAd, IN VOID * Msg, IN ULONG MsgLen, IN UCHAR MsgChannel, OUT PUCHAR pAddr2, OUT PUCHAR pBssid, OUT CHAR Ssid[], OUT UCHAR * pSsidLen, OUT UCHAR * pBssType, OUT USHORT * pBeaconPeriod, OUT UCHAR * pChannel, OUT UCHAR * pNewChannel, OUT LARGE_INTEGER * pTimestamp, OUT CF_PARM * pCfParm, OUT USHORT * pAtimWin, OUT USHORT * pCapabilityInfo, OUT UCHAR * pErp, OUT UCHAR * pDtimCount, OUT UCHAR * pDtimPeriod, OUT UCHAR * pBcastFlag, OUT UCHAR * pMessageToMe, OUT UCHAR SupRate[], OUT UCHAR * pSupRateLen, OUT UCHAR ExtRate[], OUT UCHAR * pExtRateLen, OUT UCHAR * pCkipFlag, OUT UCHAR * pAironetCellPowerLimit, OUT PEDCA_PARM pEdcaParm, OUT PQBSS_LOAD_PARM pQbssLoad, OUT PQOS_CAPABILITY_PARM pQosCapability, OUT ULONG * pRalinkIe, OUT UCHAR * pHtCapabilityLen, OUT UCHAR * pPreNHtCapabilityLen, OUT HT_CAPABILITY_IE * pHtCapability, OUT UCHAR * AddHtInfoLen, OUT ADD_HT_INFO_IE * AddHtInfo, OUT UCHAR * NewExtChannelOffset, /* Ht extension channel offset(above or below) */
|
BOOLEAN PeerBeaconAndProbeRspSanity(IN PRTMP_ADAPTER pAd, void * Msg, unsigned long MsgLen, u8 MsgChannel, u8 *pAddr2, u8 *pBssid, char Ssid[], u8 * pSsidLen, u8 * pBssType, u16 * pBeaconPeriod, u8 * pChannel, u8 * pNewChannel, OUT LARGE_INTEGER * pTimestamp, OUT CF_PARM * pCfParm, u16 * pAtimWin, u16 * pCapabilityInfo, u8 * pErp, u8 * pDtimCount, u8 * pDtimPeriod, u8 * pBcastFlag, u8 * pMessageToMe, u8 SupRate[], u8 * pSupRateLen, u8 ExtRate[], u8 * pExtRateLen, u8 * pCkipFlag, u8 * pAironetCellPowerLimit, OUT PEDCA_PARM pEdcaParm, OUT PQBSS_LOAD_PARM pQbssLoad, OUT PQOS_CAPABILITY_PARM pQosCapability, unsigned long * pRalinkIe, u8 * pHtCapabilityLen, u8 * pPreNHtCapabilityLen, OUT HT_CAPABILITY_IE * pHtCapability, u8 * AddHtInfoLen, OUT ADD_HT_INFO_IE * AddHtInfo, u8 * NewExtChannelOffset, /* Ht extension channel offset(above or below) */
|
||||||
OUT USHORT * LengthVIE,
|
u16 * LengthVIE,
|
||||||
OUT PNDIS_802_11_VARIABLE_IEs pVIE)
|
OUT PNDIS_802_11_VARIABLE_IEs pVIE)
|
||||||
{
|
{
|
||||||
UCHAR *Ptr;
|
u8 *Ptr;
|
||||||
UCHAR TimLen;
|
u8 TimLen;
|
||||||
PFRAME_802_11 pFrame;
|
PFRAME_802_11 pFrame;
|
||||||
PEID_STRUCT pEid;
|
PEID_STRUCT pEid;
|
||||||
UCHAR SubType;
|
u8 SubType;
|
||||||
UCHAR Sanity;
|
u8 Sanity;
|
||||||
/*UCHAR ECWMin, ECWMax; */
|
/*u8 ECWMin, ECWMax; */
|
||||||
/*MAC_CSR9_STRUC Csr9; */
|
/*MAC_CSR9_STRUC Csr9; */
|
||||||
ULONG Length = 0;
|
unsigned long Length = 0;
|
||||||
|
|
||||||
/* For some 11a AP which didn't have DS_IE, we use two conditions to decide the channel */
|
/* For some 11a AP which didn't have DS_IE, we use two conditions to decide the channel */
|
||||||
/* 1. If the AP is 11n enabled, then check the control channel. */
|
/* 1. If the AP is 11n enabled, then check the control channel. */
|
||||||
/* 2. If the AP didn't have any info about channel, use the channel we received this frame as the channel. (May inaccuracy!!) */
|
/* 2. If the AP didn't have any info about channel, use the channel we received this frame as the channel. (May inaccuracy!!) */
|
||||||
UCHAR CtrlChannel = 0;
|
u8 CtrlChannel = 0;
|
||||||
|
|
||||||
/* Add for 3 necessary EID field check */
|
/* Add for 3 necessary EID field check */
|
||||||
Sanity = 0;
|
Sanity = 0;
|
||||||
@ -287,7 +287,7 @@ BOOLEAN PeerBeaconAndProbeRspSanity(IN PRTMP_ADAPTER pAd, IN VOID * Msg, IN ULON
|
|||||||
pFrame = (PFRAME_802_11) Msg;
|
pFrame = (PFRAME_802_11) Msg;
|
||||||
|
|
||||||
/* get subtype from header */
|
/* get subtype from header */
|
||||||
SubType = (UCHAR) pFrame->Hdr.FC.SubType;
|
SubType = (u8)pFrame->Hdr.FC.SubType;
|
||||||
|
|
||||||
/* get Addr2 and BSSID from header */
|
/* get Addr2 and BSSID from header */
|
||||||
COPY_MAC_ADDR(pAddr2, pFrame->Hdr.Addr2);
|
COPY_MAC_ADDR(pAddr2, pFrame->Hdr.Addr2);
|
||||||
@ -377,17 +377,17 @@ BOOLEAN PeerBeaconAndProbeRspSanity(IN PRTMP_ADAPTER pAd, IN VOID * Msg, IN ULON
|
|||||||
sizeof(HT_CAPABILITY_IE));
|
sizeof(HT_CAPABILITY_IE));
|
||||||
*pHtCapabilityLen = SIZE_HT_CAP_IE; /* Nnow we only support 26 bytes. */
|
*pHtCapabilityLen = SIZE_HT_CAP_IE; /* Nnow we only support 26 bytes. */
|
||||||
|
|
||||||
*(USHORT *) (&pHtCapability->HtCapInfo) =
|
*(u16 *) (&pHtCapability->HtCapInfo) =
|
||||||
cpu2le16(*(USHORT *)
|
cpu2le16(*(u16 *)
|
||||||
(&pHtCapability->HtCapInfo));
|
(&pHtCapability->HtCapInfo));
|
||||||
*(USHORT *) (&pHtCapability->ExtHtCapInfo) =
|
*(u16 *) (&pHtCapability->ExtHtCapInfo) =
|
||||||
cpu2le16(*(USHORT *)
|
cpu2le16(*(u16 *)
|
||||||
(&pHtCapability->ExtHtCapInfo));
|
(&pHtCapability->ExtHtCapInfo));
|
||||||
|
|
||||||
{
|
{
|
||||||
*pPreNHtCapabilityLen = 0; /* Nnow we only support 26 bytes. */
|
*pPreNHtCapabilityLen = 0; /* Nnow we only support 26 bytes. */
|
||||||
|
|
||||||
Ptr = (PUCHAR) pVIE;
|
Ptr = (u8 *)pVIE;
|
||||||
NdisMoveMemory(Ptr + *LengthVIE,
|
NdisMoveMemory(Ptr + *LengthVIE,
|
||||||
&pEid->Eid,
|
&pEid->Eid,
|
||||||
pEid->Len + 2);
|
pEid->Len + 2);
|
||||||
@ -410,15 +410,15 @@ BOOLEAN PeerBeaconAndProbeRspSanity(IN PRTMP_ADAPTER pAd, IN VOID * Msg, IN ULON
|
|||||||
|
|
||||||
CtrlChannel = AddHtInfo->ControlChan;
|
CtrlChannel = AddHtInfo->ControlChan;
|
||||||
|
|
||||||
*(USHORT *) (&AddHtInfo->AddHtInfo2) =
|
*(u16 *) (&AddHtInfo->AddHtInfo2) =
|
||||||
cpu2le16(*(USHORT *)
|
cpu2le16(*(u16 *)
|
||||||
(&AddHtInfo->AddHtInfo2));
|
(&AddHtInfo->AddHtInfo2));
|
||||||
*(USHORT *) (&AddHtInfo->AddHtInfo3) =
|
*(u16 *) (&AddHtInfo->AddHtInfo3) =
|
||||||
cpu2le16(*(USHORT *)
|
cpu2le16(*(u16 *)
|
||||||
(&AddHtInfo->AddHtInfo3));
|
(&AddHtInfo->AddHtInfo3));
|
||||||
|
|
||||||
{
|
{
|
||||||
Ptr = (PUCHAR) pVIE;
|
Ptr = (u8 *)pVIE;
|
||||||
NdisMoveMemory(Ptr + *LengthVIE,
|
NdisMoveMemory(Ptr + *LengthVIE,
|
||||||
&pEid->Eid,
|
&pEid->Eid,
|
||||||
pEid->Len + 2);
|
pEid->Len + 2);
|
||||||
@ -493,7 +493,7 @@ BOOLEAN PeerBeaconAndProbeRspSanity(IN PRTMP_ADAPTER pAd, IN VOID * Msg, IN ULON
|
|||||||
|
|
||||||
case IE_TIM:
|
case IE_TIM:
|
||||||
if (INFRA_ON(pAd) && SubType == SUBTYPE_BEACON) {
|
if (INFRA_ON(pAd) && SubType == SUBTYPE_BEACON) {
|
||||||
GetTimBit((PCHAR) pEid, pAd->StaActive.Aid,
|
GetTimBit((char *)pEid, pAd->StaActive.Aid,
|
||||||
&TimLen, pBcastFlag, pDtimCount,
|
&TimLen, pBcastFlag, pDtimCount,
|
||||||
pDtimPeriod, pMessageToMe);
|
pDtimPeriod, pMessageToMe);
|
||||||
}
|
}
|
||||||
@ -565,14 +565,14 @@ BOOLEAN PeerBeaconAndProbeRspSanity(IN PRTMP_ADAPTER pAd, IN VOID * Msg, IN ULON
|
|||||||
}
|
}
|
||||||
} else if (NdisEqualMemory(pEid->Octet, WPA_OUI, 4)) {
|
} else if (NdisEqualMemory(pEid->Octet, WPA_OUI, 4)) {
|
||||||
/* Copy to pVIE which will report to microsoft bssid list. */
|
/* Copy to pVIE which will report to microsoft bssid list. */
|
||||||
Ptr = (PUCHAR) pVIE;
|
Ptr = (u8 *)pVIE;
|
||||||
NdisMoveMemory(Ptr + *LengthVIE, &pEid->Eid,
|
NdisMoveMemory(Ptr + *LengthVIE, &pEid->Eid,
|
||||||
pEid->Len + 2);
|
pEid->Len + 2);
|
||||||
*LengthVIE += (pEid->Len + 2);
|
*LengthVIE += (pEid->Len + 2);
|
||||||
} else
|
} else
|
||||||
if (NdisEqualMemory(pEid->Octet, WME_PARM_ELEM, 6)
|
if (NdisEqualMemory(pEid->Octet, WME_PARM_ELEM, 6)
|
||||||
&& (pEid->Len == 24)) {
|
&& (pEid->Len == 24)) {
|
||||||
PUCHAR ptr;
|
u8 *ptr;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
/* parsing EDCA parameters */
|
/* parsing EDCA parameters */
|
||||||
@ -586,7 +586,7 @@ BOOLEAN PeerBeaconAndProbeRspSanity(IN PRTMP_ADAPTER pAd, IN VOID * Msg, IN ULON
|
|||||||
(pEid->Octet[6] & 0x80) ? 1 : 0;
|
(pEid->Octet[6] & 0x80) ? 1 : 0;
|
||||||
ptr = &pEid->Octet[8];
|
ptr = &pEid->Octet[8];
|
||||||
for (i = 0; i < 4; i++) {
|
for (i = 0; i < 4; i++) {
|
||||||
UCHAR aci = (*ptr & 0x60) >> 5; /* b5~6 is AC INDEX */
|
u8 aci = (*ptr & 0x60) >> 5; /* b5~6 is AC INDEX */
|
||||||
pEdcaParm->bACM[aci] = (((*ptr) & 0x10) == 0x10); /* b5 is ACM */
|
pEdcaParm->bACM[aci] = (((*ptr) & 0x10) == 0x10); /* b5 is ACM */
|
||||||
pEdcaParm->Aifsn[aci] = (*ptr) & 0x0f; /* b0~3 is AIFSN */
|
pEdcaParm->Aifsn[aci] = (*ptr) & 0x0f; /* b0~3 is AIFSN */
|
||||||
pEdcaParm->Cwmin[aci] = *(ptr + 1) & 0x0f; /* b0~4 is Cwmin */
|
pEdcaParm->Cwmin[aci] = *(ptr + 1) & 0x0f; /* b0~4 is Cwmin */
|
||||||
@ -653,7 +653,7 @@ BOOLEAN PeerBeaconAndProbeRspSanity(IN PRTMP_ADAPTER pAd, IN VOID * Msg, IN ULON
|
|||||||
|
|
||||||
case IE_ERP:
|
case IE_ERP:
|
||||||
if (pEid->Len == 1) {
|
if (pEid->Len == 1) {
|
||||||
*pErp = (UCHAR) pEid->Octet[0];
|
*pErp = (u8)pEid->Octet[0];
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -684,7 +684,7 @@ BOOLEAN PeerBeaconAndProbeRspSanity(IN PRTMP_ADAPTER pAd, IN VOID * Msg, IN ULON
|
|||||||
/* There is no OUI for version anymore, check the group cipher OUI before copying */
|
/* There is no OUI for version anymore, check the group cipher OUI before copying */
|
||||||
if (RTMPEqualMemory(pEid->Octet + 2, RSN_OUI, 3)) {
|
if (RTMPEqualMemory(pEid->Octet + 2, RSN_OUI, 3)) {
|
||||||
/* Copy to pVIE which will report to microsoft bssid list. */
|
/* Copy to pVIE which will report to microsoft bssid list. */
|
||||||
Ptr = (PUCHAR) pVIE;
|
Ptr = (u8 *)pVIE;
|
||||||
NdisMoveMemory(Ptr + *LengthVIE, &pEid->Eid,
|
NdisMoveMemory(Ptr + *LengthVIE, &pEid->Eid,
|
||||||
pEid->Len + 2);
|
pEid->Len + 2);
|
||||||
*LengthVIE += (pEid->Len + 2);
|
*LengthVIE += (pEid->Len + 2);
|
||||||
@ -696,12 +696,12 @@ BOOLEAN PeerBeaconAndProbeRspSanity(IN PRTMP_ADAPTER pAd, IN VOID * Msg, IN ULON
|
|||||||
}
|
}
|
||||||
|
|
||||||
Length = Length + 2 + pEid->Len; /* Eid[1] + Len[1]+ content[Len] */
|
Length = Length + 2 + pEid->Len; /* Eid[1] + Len[1]+ content[Len] */
|
||||||
pEid = (PEID_STRUCT) ((UCHAR *) pEid + 2 + pEid->Len);
|
pEid = (PEID_STRUCT) ((u8 *) pEid + 2 + pEid->Len);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* For some 11a AP. it did not have the channel EID, patch here */
|
/* For some 11a AP. it did not have the channel EID, patch here */
|
||||||
{
|
{
|
||||||
UCHAR LatchRfChannel = MsgChannel;
|
u8 LatchRfChannel = MsgChannel;
|
||||||
if ((pAd->LatchRfRegs.Channel > 14) && ((Sanity & 0x4) == 0)) {
|
if ((pAd->LatchRfRegs.Channel > 14) && ((Sanity & 0x4) == 0)) {
|
||||||
if (CtrlChannel != 0)
|
if (CtrlChannel != 0)
|
||||||
*pChannel = CtrlChannel;
|
*pChannel = CtrlChannel;
|
||||||
@ -731,11 +731,11 @@ BOOLEAN PeerBeaconAndProbeRspSanity(IN PRTMP_ADAPTER pAd, IN VOID * Msg, IN ULON
|
|||||||
==========================================================================
|
==========================================================================
|
||||||
*/
|
*/
|
||||||
BOOLEAN MlmeScanReqSanity(IN PRTMP_ADAPTER pAd,
|
BOOLEAN MlmeScanReqSanity(IN PRTMP_ADAPTER pAd,
|
||||||
IN VOID * Msg,
|
void * Msg,
|
||||||
IN ULONG MsgLen,
|
unsigned long MsgLen,
|
||||||
OUT UCHAR * pBssType,
|
u8 * pBssType,
|
||||||
OUT CHAR Ssid[],
|
char Ssid[],
|
||||||
OUT UCHAR * pSsidLen, OUT UCHAR * pScanType)
|
u8 * pSsidLen, u8 * pScanType)
|
||||||
{
|
{
|
||||||
MLME_SCAN_REQ_STRUCT *Info;
|
MLME_SCAN_REQ_STRUCT *Info;
|
||||||
|
|
||||||
@ -757,7 +757,7 @@ BOOLEAN MlmeScanReqSanity(IN PRTMP_ADAPTER pAd,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* IRQL = DISPATCH_LEVEL */
|
/* IRQL = DISPATCH_LEVEL */
|
||||||
UCHAR ChannelSanity(IN PRTMP_ADAPTER pAd, IN UCHAR channel)
|
u8 ChannelSanity(IN PRTMP_ADAPTER pAd, u8 channel)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
@ -780,9 +780,9 @@ UCHAR ChannelSanity(IN PRTMP_ADAPTER pAd, IN UCHAR channel)
|
|||||||
==========================================================================
|
==========================================================================
|
||||||
*/
|
*/
|
||||||
BOOLEAN PeerDeauthSanity(IN PRTMP_ADAPTER pAd,
|
BOOLEAN PeerDeauthSanity(IN PRTMP_ADAPTER pAd,
|
||||||
IN VOID * Msg,
|
void * Msg,
|
||||||
IN ULONG MsgLen,
|
unsigned long MsgLen,
|
||||||
OUT PUCHAR pAddr2, OUT USHORT * pReason)
|
u8 *pAddr2, u16 * pReason)
|
||||||
{
|
{
|
||||||
PFRAME_802_11 pFrame = (PFRAME_802_11) Msg;
|
PFRAME_802_11 pFrame = (PFRAME_802_11) Msg;
|
||||||
|
|
||||||
@ -804,12 +804,12 @@ BOOLEAN PeerDeauthSanity(IN PRTMP_ADAPTER pAd,
|
|||||||
==========================================================================
|
==========================================================================
|
||||||
*/
|
*/
|
||||||
BOOLEAN PeerAuthSanity(IN PRTMP_ADAPTER pAd,
|
BOOLEAN PeerAuthSanity(IN PRTMP_ADAPTER pAd,
|
||||||
IN VOID * Msg,
|
void * Msg,
|
||||||
IN ULONG MsgLen,
|
unsigned long MsgLen,
|
||||||
OUT PUCHAR pAddr,
|
u8 *pAddr,
|
||||||
OUT USHORT * pAlg,
|
u16 * pAlg,
|
||||||
OUT USHORT * pSeq,
|
u16 * pSeq,
|
||||||
OUT USHORT * pStatus, CHAR * pChlgText)
|
u16 * pStatus, char * pChlgText)
|
||||||
{
|
{
|
||||||
PFRAME_802_11 pFrame = (PFRAME_802_11) Msg;
|
PFRAME_802_11 pFrame = (PFRAME_802_11) Msg;
|
||||||
|
|
||||||
@ -854,10 +854,10 @@ BOOLEAN PeerAuthSanity(IN PRTMP_ADAPTER pAd,
|
|||||||
==========================================================================
|
==========================================================================
|
||||||
*/
|
*/
|
||||||
BOOLEAN MlmeAuthReqSanity(IN PRTMP_ADAPTER pAd,
|
BOOLEAN MlmeAuthReqSanity(IN PRTMP_ADAPTER pAd,
|
||||||
IN VOID * Msg,
|
void * Msg,
|
||||||
IN ULONG MsgLen,
|
unsigned long MsgLen,
|
||||||
OUT PUCHAR pAddr,
|
u8 *pAddr,
|
||||||
OUT ULONG * pTimeout, OUT USHORT * pAlg)
|
unsigned long * pTimeout, u16 * pAlg)
|
||||||
{
|
{
|
||||||
MLME_AUTH_REQ_STRUCT *pInfo;
|
MLME_AUTH_REQ_STRUCT *pInfo;
|
||||||
|
|
||||||
@ -888,11 +888,11 @@ BOOLEAN MlmeAuthReqSanity(IN PRTMP_ADAPTER pAd,
|
|||||||
==========================================================================
|
==========================================================================
|
||||||
*/
|
*/
|
||||||
BOOLEAN MlmeAssocReqSanity(IN PRTMP_ADAPTER pAd,
|
BOOLEAN MlmeAssocReqSanity(IN PRTMP_ADAPTER pAd,
|
||||||
IN VOID * Msg,
|
void * Msg,
|
||||||
IN ULONG MsgLen,
|
unsigned long MsgLen,
|
||||||
OUT PUCHAR pApAddr,
|
u8 *pApAddr,
|
||||||
OUT USHORT * pCapabilityInfo,
|
u16 * pCapabilityInfo,
|
||||||
OUT ULONG * pTimeout, OUT USHORT * pListenIntv)
|
unsigned long * pTimeout, u16 * pListenIntv)
|
||||||
{
|
{
|
||||||
MLME_ASSOC_REQ_STRUCT *pInfo;
|
MLME_ASSOC_REQ_STRUCT *pInfo;
|
||||||
|
|
||||||
@ -917,9 +917,9 @@ BOOLEAN MlmeAssocReqSanity(IN PRTMP_ADAPTER pAd,
|
|||||||
==========================================================================
|
==========================================================================
|
||||||
*/
|
*/
|
||||||
BOOLEAN PeerDisassocSanity(IN PRTMP_ADAPTER pAd,
|
BOOLEAN PeerDisassocSanity(IN PRTMP_ADAPTER pAd,
|
||||||
IN VOID * Msg,
|
void * Msg,
|
||||||
IN ULONG MsgLen,
|
unsigned long MsgLen,
|
||||||
OUT PUCHAR pAddr2, OUT USHORT * pReason)
|
u8 *pAddr2, u16 * pReason)
|
||||||
{
|
{
|
||||||
PFRAME_802_11 pFrame = (PFRAME_802_11) Msg;
|
PFRAME_802_11 pFrame = (PFRAME_802_11) Msg;
|
||||||
|
|
||||||
@ -949,7 +949,7 @@ BOOLEAN PeerDisassocSanity(IN PRTMP_ADAPTER pAd,
|
|||||||
NDIS_802_11_NETWORK_TYPE NetworkTypeInUseSanity(IN PBSS_ENTRY pBss)
|
NDIS_802_11_NETWORK_TYPE NetworkTypeInUseSanity(IN PBSS_ENTRY pBss)
|
||||||
{
|
{
|
||||||
NDIS_802_11_NETWORK_TYPE NetWorkType;
|
NDIS_802_11_NETWORK_TYPE NetWorkType;
|
||||||
UCHAR rate, i;
|
u8 rate, i;
|
||||||
|
|
||||||
NetWorkType = Ndis802_11DS;
|
NetWorkType = Ndis802_11DS;
|
||||||
|
|
||||||
@ -1014,24 +1014,24 @@ NDIS_802_11_NETWORK_TYPE NetworkTypeInUseSanity(IN PBSS_ENTRY pBss)
|
|||||||
*/
|
*/
|
||||||
BOOLEAN PeerWpaMessageSanity(IN PRTMP_ADAPTER pAd,
|
BOOLEAN PeerWpaMessageSanity(IN PRTMP_ADAPTER pAd,
|
||||||
IN PEAPOL_PACKET pMsg,
|
IN PEAPOL_PACKET pMsg,
|
||||||
IN ULONG MsgLen,
|
unsigned long MsgLen,
|
||||||
IN UCHAR MsgType, IN MAC_TABLE_ENTRY * pEntry)
|
u8 MsgType, IN MAC_TABLE_ENTRY * pEntry)
|
||||||
{
|
{
|
||||||
UCHAR mic[LEN_KEY_DESC_MIC], digest[80], KEYDATA[MAX_LEN_OF_RSNIE];
|
u8 mic[LEN_KEY_DESC_MIC], digest[80], KEYDATA[MAX_LEN_OF_RSNIE];
|
||||||
BOOLEAN bReplayDiff = FALSE;
|
BOOLEAN bReplayDiff = FALSE;
|
||||||
BOOLEAN bWPA2 = FALSE;
|
BOOLEAN bWPA2 = FALSE;
|
||||||
KEY_INFO EapolKeyInfo;
|
KEY_INFO EapolKeyInfo;
|
||||||
UCHAR GroupKeyIndex = 0;
|
u8 GroupKeyIndex = 0;
|
||||||
|
|
||||||
NdisZeroMemory(mic, sizeof(mic));
|
NdisZeroMemory(mic, sizeof(mic));
|
||||||
NdisZeroMemory(digest, sizeof(digest));
|
NdisZeroMemory(digest, sizeof(digest));
|
||||||
NdisZeroMemory(KEYDATA, sizeof(KEYDATA));
|
NdisZeroMemory(KEYDATA, sizeof(KEYDATA));
|
||||||
NdisZeroMemory((PUCHAR) & EapolKeyInfo, sizeof(EapolKeyInfo));
|
NdisZeroMemory((u8 *)& EapolKeyInfo, sizeof(EapolKeyInfo));
|
||||||
|
|
||||||
NdisMoveMemory((PUCHAR) & EapolKeyInfo,
|
NdisMoveMemory((u8 *)& EapolKeyInfo,
|
||||||
(PUCHAR) & pMsg->KeyDesc.KeyInfo, sizeof(KEY_INFO));
|
(u8 *)& pMsg->KeyDesc.KeyInfo, sizeof(KEY_INFO));
|
||||||
|
|
||||||
*((USHORT *) & EapolKeyInfo) = cpu2le16(*((USHORT *) & EapolKeyInfo));
|
*((u16 *) & EapolKeyInfo) = cpu2le16(*((u16 *) & EapolKeyInfo));
|
||||||
|
|
||||||
/* Choose WPA2 or not */
|
/* Choose WPA2 or not */
|
||||||
if ((pEntry->AuthMode == Ndis802_11AuthModeWPA2)
|
if ((pEntry->AuthMode == Ndis802_11AuthModeWPA2)
|
||||||
@ -1049,7 +1049,7 @@ BOOLEAN PeerWpaMessageSanity(IN PRTMP_ADAPTER pAd,
|
|||||||
{
|
{
|
||||||
/* First validate replay counter, only accept message with larger replay counter. */
|
/* First validate replay counter, only accept message with larger replay counter. */
|
||||||
/* Let equal pass, some AP start with all zero replay counter */
|
/* Let equal pass, some AP start with all zero replay counter */
|
||||||
UCHAR ZeroReplay[LEN_KEY_DESC_REPLAY];
|
u8 ZeroReplay[LEN_KEY_DESC_REPLAY];
|
||||||
|
|
||||||
NdisZeroMemory(ZeroReplay, LEN_KEY_DESC_REPLAY);
|
NdisZeroMemory(ZeroReplay, LEN_KEY_DESC_REPLAY);
|
||||||
if ((RTMPCompareMemory
|
if ((RTMPCompareMemory
|
||||||
@ -1096,7 +1096,7 @@ BOOLEAN PeerWpaMessageSanity(IN PRTMP_ADAPTER pAd,
|
|||||||
}
|
}
|
||||||
/* 2. Verify MIC except Pairwise Msg1 */
|
/* 2. Verify MIC except Pairwise Msg1 */
|
||||||
if (MsgType != EAPOL_PAIR_MSG_1) {
|
if (MsgType != EAPOL_PAIR_MSG_1) {
|
||||||
UCHAR rcvd_mic[LEN_KEY_DESC_MIC];
|
u8 rcvd_mic[LEN_KEY_DESC_MIC];
|
||||||
|
|
||||||
/* Record the received MIC for check later */
|
/* Record the received MIC for check later */
|
||||||
NdisMoveMemory(rcvd_mic, pMsg->KeyDesc.KeyMic,
|
NdisMoveMemory(rcvd_mic, pMsg->KeyDesc.KeyMic,
|
||||||
@ -1105,11 +1105,11 @@ BOOLEAN PeerWpaMessageSanity(IN PRTMP_ADAPTER pAd,
|
|||||||
|
|
||||||
if (EapolKeyInfo.KeyDescVer == DESC_TYPE_TKIP) /* TKIP */
|
if (EapolKeyInfo.KeyDescVer == DESC_TYPE_TKIP) /* TKIP */
|
||||||
{
|
{
|
||||||
HMAC_MD5(pEntry->PTK, LEN_EAP_MICK, (PUCHAR) pMsg,
|
HMAC_MD5(pEntry->PTK, LEN_EAP_MICK, (u8 *)pMsg,
|
||||||
MsgLen, mic, MD5_DIGEST_SIZE);
|
MsgLen, mic, MD5_DIGEST_SIZE);
|
||||||
} else if (EapolKeyInfo.KeyDescVer == DESC_TYPE_AES) /* AES */
|
} else if (EapolKeyInfo.KeyDescVer == DESC_TYPE_AES) /* AES */
|
||||||
{
|
{
|
||||||
HMAC_SHA1(pEntry->PTK, LEN_EAP_MICK, (PUCHAR) pMsg,
|
HMAC_SHA1(pEntry->PTK, LEN_EAP_MICK, (u8 *)pMsg,
|
||||||
MsgLen, digest, SHA1_DIGEST_SIZE);
|
MsgLen, digest, SHA1_DIGEST_SIZE);
|
||||||
NdisMoveMemory(mic, digest, LEN_KEY_DESC_MIC);
|
NdisMoveMemory(mic, digest, LEN_KEY_DESC_MIC);
|
||||||
}
|
}
|
||||||
@ -1142,20 +1142,20 @@ BOOLEAN PeerWpaMessageSanity(IN PRTMP_ADAPTER pAd,
|
|||||||
/* 2. Extract the context of the Key Data field if it exist. */
|
/* 2. Extract the context of the Key Data field if it exist. */
|
||||||
/* The field in pairwise_msg_2_WPA1(WPA2) & pairwise_msg_3_WPA1 is clear. */
|
/* The field in pairwise_msg_2_WPA1(WPA2) & pairwise_msg_3_WPA1 is clear. */
|
||||||
/* The field in group_msg_1_WPA1(WPA2) & pairwise_msg_3_WPA2 is encrypted. */
|
/* The field in group_msg_1_WPA1(WPA2) & pairwise_msg_3_WPA2 is encrypted. */
|
||||||
if (CONV_ARRARY_TO_UINT16(pMsg->KeyDesc.KeyDataLen) > 0) {
|
if (CONV_ARRARY_TO_u16(pMsg->KeyDesc.KeyDataLen) > 0) {
|
||||||
/* Decrypt this field */
|
/* Decrypt this field */
|
||||||
if ((MsgType == EAPOL_PAIR_MSG_3 && bWPA2)
|
if ((MsgType == EAPOL_PAIR_MSG_3 && bWPA2)
|
||||||
|| (MsgType == EAPOL_GROUP_MSG_1)) {
|
|| (MsgType == EAPOL_GROUP_MSG_1)) {
|
||||||
if ((EapolKeyInfo.KeyDescVer == DESC_TYPE_AES)) {
|
if ((EapolKeyInfo.KeyDescVer == DESC_TYPE_AES)) {
|
||||||
/* AES */
|
/* AES */
|
||||||
AES_GTK_KEY_UNWRAP(&pEntry->PTK[16], KEYDATA,
|
AES_GTK_KEY_UNWRAP(&pEntry->PTK[16], KEYDATA,
|
||||||
CONV_ARRARY_TO_UINT16(pMsg->
|
CONV_ARRARY_TO_u16(pMsg->
|
||||||
KeyDesc.
|
KeyDesc.
|
||||||
KeyDataLen),
|
KeyDataLen),
|
||||||
pMsg->KeyDesc.KeyData);
|
pMsg->KeyDesc.KeyData);
|
||||||
} else {
|
} else {
|
||||||
INT i;
|
int i;
|
||||||
UCHAR Key[32];
|
u8 Key[32];
|
||||||
/* Decrypt TKIP GTK */
|
/* Decrypt TKIP GTK */
|
||||||
/* Construct 32 bytes RC4 Key */
|
/* Construct 32 bytes RC4 Key */
|
||||||
NdisMoveMemory(Key, pMsg->KeyDesc.KeyIv, 16);
|
NdisMoveMemory(Key, pMsg->KeyDesc.KeyIv, 16);
|
||||||
@ -1169,7 +1169,7 @@ BOOLEAN PeerWpaMessageSanity(IN PRTMP_ADAPTER pAd,
|
|||||||
/* Decrypt GTK. Becareful, there is no ICV to check the result is correct or not */
|
/* Decrypt GTK. Becareful, there is no ICV to check the result is correct or not */
|
||||||
ARCFOUR_DECRYPT(&pAd->PrivateInfo.WEPCONTEXT,
|
ARCFOUR_DECRYPT(&pAd->PrivateInfo.WEPCONTEXT,
|
||||||
KEYDATA, pMsg->KeyDesc.KeyData,
|
KEYDATA, pMsg->KeyDesc.KeyData,
|
||||||
CONV_ARRARY_TO_UINT16(pMsg->
|
CONV_ARRARY_TO_u16(pMsg->
|
||||||
KeyDesc.
|
KeyDesc.
|
||||||
KeyDataLen));
|
KeyDataLen));
|
||||||
}
|
}
|
||||||
@ -1180,7 +1180,7 @@ BOOLEAN PeerWpaMessageSanity(IN PRTMP_ADAPTER pAd,
|
|||||||
} else if ((MsgType == EAPOL_PAIR_MSG_2)
|
} else if ((MsgType == EAPOL_PAIR_MSG_2)
|
||||||
|| (MsgType == EAPOL_PAIR_MSG_3 && !bWPA2)) {
|
|| (MsgType == EAPOL_PAIR_MSG_3 && !bWPA2)) {
|
||||||
NdisMoveMemory(KEYDATA, pMsg->KeyDesc.KeyData,
|
NdisMoveMemory(KEYDATA, pMsg->KeyDesc.KeyData,
|
||||||
CONV_ARRARY_TO_UINT16(pMsg->KeyDesc.
|
CONV_ARRARY_TO_u16(pMsg->KeyDesc.
|
||||||
KeyDataLen));
|
KeyDataLen));
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
@ -1192,7 +1192,7 @@ BOOLEAN PeerWpaMessageSanity(IN PRTMP_ADAPTER pAd,
|
|||||||
/* 2. verify KDE format for pairwise_msg_3_WPA2, group_msg_1_WPA2 */
|
/* 2. verify KDE format for pairwise_msg_3_WPA2, group_msg_1_WPA2 */
|
||||||
/* 3. update shared key for pairwise_msg_3_WPA2, group_msg_1_WPA1(WPA2) */
|
/* 3. update shared key for pairwise_msg_3_WPA2, group_msg_1_WPA1(WPA2) */
|
||||||
if (!RTMPParseEapolKeyData(pAd, KEYDATA,
|
if (!RTMPParseEapolKeyData(pAd, KEYDATA,
|
||||||
CONV_ARRARY_TO_UINT16(pMsg->KeyDesc.
|
CONV_ARRARY_TO_u16(pMsg->KeyDesc.
|
||||||
KeyDataLen),
|
KeyDataLen),
|
||||||
GroupKeyIndex, MsgType, bWPA2,
|
GroupKeyIndex, MsgType, bWPA2,
|
||||||
pEntry)) {
|
pEntry)) {
|
||||||
|
@ -57,41 +57,41 @@
|
|||||||
#define BG_BAND_REGION_31_SIZE 14
|
#define BG_BAND_REGION_31_SIZE 14
|
||||||
|
|
||||||
/* 5 Ghz channel plan index in the TxPower arrays. */
|
/* 5 Ghz channel plan index in the TxPower arrays. */
|
||||||
UCHAR A_BAND_REGION_0_CHANNEL_LIST[] =
|
u8 A_BAND_REGION_0_CHANNEL_LIST[] =
|
||||||
{ 36, 40, 44, 48, 52, 56, 60, 64, 149, 153, 157, 161, 165 };
|
{ 36, 40, 44, 48, 52, 56, 60, 64, 149, 153, 157, 161, 165 };
|
||||||
UCHAR A_BAND_REGION_1_CHANNEL_LIST[] =
|
u8 A_BAND_REGION_1_CHANNEL_LIST[] =
|
||||||
{ 36, 40, 44, 48, 52, 56, 60, 64, 100, 104, 108, 112, 116, 120, 124, 128,
|
{ 36, 40, 44, 48, 52, 56, 60, 64, 100, 104, 108, 112, 116, 120, 124, 128,
|
||||||
132, 136, 140 };
|
132, 136, 140 };
|
||||||
UCHAR A_BAND_REGION_2_CHANNEL_LIST[] = { 36, 40, 44, 48, 52, 56, 60, 64 };
|
u8 A_BAND_REGION_2_CHANNEL_LIST[] = { 36, 40, 44, 48, 52, 56, 60, 64 };
|
||||||
UCHAR A_BAND_REGION_3_CHANNEL_LIST[] = { 52, 56, 60, 64, 149, 153, 157, 161 };
|
u8 A_BAND_REGION_3_CHANNEL_LIST[] = { 52, 56, 60, 64, 149, 153, 157, 161 };
|
||||||
UCHAR A_BAND_REGION_4_CHANNEL_LIST[] = { 149, 153, 157, 161, 165 };
|
u8 A_BAND_REGION_4_CHANNEL_LIST[] = { 149, 153, 157, 161, 165 };
|
||||||
UCHAR A_BAND_REGION_5_CHANNEL_LIST[] = { 149, 153, 157, 161 };
|
u8 A_BAND_REGION_5_CHANNEL_LIST[] = { 149, 153, 157, 161 };
|
||||||
UCHAR A_BAND_REGION_6_CHANNEL_LIST[] = { 36, 40, 44, 48 };
|
u8 A_BAND_REGION_6_CHANNEL_LIST[] = { 36, 40, 44, 48 };
|
||||||
UCHAR A_BAND_REGION_7_CHANNEL_LIST[] =
|
u8 A_BAND_REGION_7_CHANNEL_LIST[] =
|
||||||
{ 36, 40, 44, 48, 52, 56, 60, 64, 100, 104, 108, 112, 116, 120, 124, 128,
|
{ 36, 40, 44, 48, 52, 56, 60, 64, 100, 104, 108, 112, 116, 120, 124, 128,
|
||||||
132, 136, 140, 149, 153, 157, 161, 165, 169, 173 };
|
132, 136, 140, 149, 153, 157, 161, 165, 169, 173 };
|
||||||
UCHAR A_BAND_REGION_8_CHANNEL_LIST[] = { 52, 56, 60, 64 };
|
u8 A_BAND_REGION_8_CHANNEL_LIST[] = { 52, 56, 60, 64 };
|
||||||
UCHAR A_BAND_REGION_9_CHANNEL_LIST[] =
|
u8 A_BAND_REGION_9_CHANNEL_LIST[] =
|
||||||
{ 36, 40, 44, 48, 52, 56, 60, 64, 100, 104, 108, 112, 116, 132, 136, 140,
|
{ 36, 40, 44, 48, 52, 56, 60, 64, 100, 104, 108, 112, 116, 132, 136, 140,
|
||||||
149, 153, 157, 161, 165 };
|
149, 153, 157, 161, 165 };
|
||||||
UCHAR A_BAND_REGION_10_CHANNEL_LIST[] =
|
u8 A_BAND_REGION_10_CHANNEL_LIST[] =
|
||||||
{ 36, 40, 44, 48, 149, 153, 157, 161, 165 };
|
{ 36, 40, 44, 48, 149, 153, 157, 161, 165 };
|
||||||
UCHAR A_BAND_REGION_11_CHANNEL_LIST[] =
|
u8 A_BAND_REGION_11_CHANNEL_LIST[] =
|
||||||
{ 36, 40, 44, 48, 52, 56, 60, 64, 100, 104, 108, 112, 116, 120, 149, 153,
|
{ 36, 40, 44, 48, 52, 56, 60, 64, 100, 104, 108, 112, 116, 120, 149, 153,
|
||||||
157, 161 };
|
157, 161 };
|
||||||
UCHAR A_BAND_REGION_12_CHANNEL_LIST[] =
|
u8 A_BAND_REGION_12_CHANNEL_LIST[] =
|
||||||
{ 36, 40, 44, 48, 52, 56, 60, 64, 100, 104, 108, 112, 116, 120, 124, 128,
|
{ 36, 40, 44, 48, 52, 56, 60, 64, 100, 104, 108, 112, 116, 120, 124, 128,
|
||||||
132, 136, 140 };
|
132, 136, 140 };
|
||||||
UCHAR A_BAND_REGION_13_CHANNEL_LIST[] =
|
u8 A_BAND_REGION_13_CHANNEL_LIST[] =
|
||||||
{ 52, 56, 60, 64, 100, 104, 108, 112, 116, 120, 124, 128, 132, 136, 140,
|
{ 52, 56, 60, 64, 100, 104, 108, 112, 116, 120, 124, 128, 132, 136, 140,
|
||||||
149, 153, 157, 161 };
|
149, 153, 157, 161 };
|
||||||
UCHAR A_BAND_REGION_14_CHANNEL_LIST[] =
|
u8 A_BAND_REGION_14_CHANNEL_LIST[] =
|
||||||
{ 36, 40, 44, 48, 52, 56, 60, 64, 100, 104, 108, 112, 116, 136, 140, 149,
|
{ 36, 40, 44, 48, 52, 56, 60, 64, 100, 104, 108, 112, 116, 136, 140, 149,
|
||||||
153, 157, 161, 165 };
|
153, 157, 161, 165 };
|
||||||
UCHAR A_BAND_REGION_15_CHANNEL_LIST[] = { 149, 153, 157, 161, 165, 169, 173 };
|
u8 A_BAND_REGION_15_CHANNEL_LIST[] = { 149, 153, 157, 161, 165, 169, 173 };
|
||||||
|
|
||||||
/*BaSizeArray follows the 802.11n definition as MaxRxFactor. 2^(13+factor) bytes. When factor =0, it's about Ba buffer size =8. */
|
/*BaSizeArray follows the 802.11n definition as MaxRxFactor. 2^(13+factor) bytes. When factor =0, it's about Ba buffer size =8. */
|
||||||
UCHAR BaSizeArray[4] = { 8, 16, 32, 64 };
|
u8 BaSizeArray[4] = { 8, 16, 32, 64 };
|
||||||
|
|
||||||
/*
|
/*
|
||||||
==========================================================================
|
==========================================================================
|
||||||
@ -105,10 +105,10 @@ UCHAR BaSizeArray[4] = { 8, 16, 32, 64 };
|
|||||||
|
|
||||||
==========================================================================
|
==========================================================================
|
||||||
*/
|
*/
|
||||||
VOID BuildChannelList(IN PRTMP_ADAPTER pAd)
|
void BuildChannelList(IN PRTMP_ADAPTER pAd)
|
||||||
{
|
{
|
||||||
UCHAR i, j, index = 0, num = 0;
|
u8 i, j, index = 0, num = 0;
|
||||||
PUCHAR pChannelList = NULL;
|
u8 *pChannelList = NULL;
|
||||||
|
|
||||||
NdisZeroMemory(pAd->ChannelList,
|
NdisZeroMemory(pAd->ChannelList,
|
||||||
MAX_NUM_OF_CHANNELS * sizeof(CHANNEL_TX_POWER));
|
MAX_NUM_OF_CHANNELS * sizeof(CHANNEL_TX_POWER));
|
||||||
@ -200,99 +200,99 @@ VOID BuildChannelList(IN PRTMP_ADAPTER pAd)
|
|||||||
case REGION_0_A_BAND:
|
case REGION_0_A_BAND:
|
||||||
num =
|
num =
|
||||||
sizeof(A_BAND_REGION_0_CHANNEL_LIST) /
|
sizeof(A_BAND_REGION_0_CHANNEL_LIST) /
|
||||||
sizeof(UCHAR);
|
sizeof(u8);
|
||||||
pChannelList = A_BAND_REGION_0_CHANNEL_LIST;
|
pChannelList = A_BAND_REGION_0_CHANNEL_LIST;
|
||||||
break;
|
break;
|
||||||
case REGION_1_A_BAND:
|
case REGION_1_A_BAND:
|
||||||
num =
|
num =
|
||||||
sizeof(A_BAND_REGION_1_CHANNEL_LIST) /
|
sizeof(A_BAND_REGION_1_CHANNEL_LIST) /
|
||||||
sizeof(UCHAR);
|
sizeof(u8);
|
||||||
pChannelList = A_BAND_REGION_1_CHANNEL_LIST;
|
pChannelList = A_BAND_REGION_1_CHANNEL_LIST;
|
||||||
break;
|
break;
|
||||||
case REGION_2_A_BAND:
|
case REGION_2_A_BAND:
|
||||||
num =
|
num =
|
||||||
sizeof(A_BAND_REGION_2_CHANNEL_LIST) /
|
sizeof(A_BAND_REGION_2_CHANNEL_LIST) /
|
||||||
sizeof(UCHAR);
|
sizeof(u8);
|
||||||
pChannelList = A_BAND_REGION_2_CHANNEL_LIST;
|
pChannelList = A_BAND_REGION_2_CHANNEL_LIST;
|
||||||
break;
|
break;
|
||||||
case REGION_3_A_BAND:
|
case REGION_3_A_BAND:
|
||||||
num =
|
num =
|
||||||
sizeof(A_BAND_REGION_3_CHANNEL_LIST) /
|
sizeof(A_BAND_REGION_3_CHANNEL_LIST) /
|
||||||
sizeof(UCHAR);
|
sizeof(u8);
|
||||||
pChannelList = A_BAND_REGION_3_CHANNEL_LIST;
|
pChannelList = A_BAND_REGION_3_CHANNEL_LIST;
|
||||||
break;
|
break;
|
||||||
case REGION_4_A_BAND:
|
case REGION_4_A_BAND:
|
||||||
num =
|
num =
|
||||||
sizeof(A_BAND_REGION_4_CHANNEL_LIST) /
|
sizeof(A_BAND_REGION_4_CHANNEL_LIST) /
|
||||||
sizeof(UCHAR);
|
sizeof(u8);
|
||||||
pChannelList = A_BAND_REGION_4_CHANNEL_LIST;
|
pChannelList = A_BAND_REGION_4_CHANNEL_LIST;
|
||||||
break;
|
break;
|
||||||
case REGION_5_A_BAND:
|
case REGION_5_A_BAND:
|
||||||
num =
|
num =
|
||||||
sizeof(A_BAND_REGION_5_CHANNEL_LIST) /
|
sizeof(A_BAND_REGION_5_CHANNEL_LIST) /
|
||||||
sizeof(UCHAR);
|
sizeof(u8);
|
||||||
pChannelList = A_BAND_REGION_5_CHANNEL_LIST;
|
pChannelList = A_BAND_REGION_5_CHANNEL_LIST;
|
||||||
break;
|
break;
|
||||||
case REGION_6_A_BAND:
|
case REGION_6_A_BAND:
|
||||||
num =
|
num =
|
||||||
sizeof(A_BAND_REGION_6_CHANNEL_LIST) /
|
sizeof(A_BAND_REGION_6_CHANNEL_LIST) /
|
||||||
sizeof(UCHAR);
|
sizeof(u8);
|
||||||
pChannelList = A_BAND_REGION_6_CHANNEL_LIST;
|
pChannelList = A_BAND_REGION_6_CHANNEL_LIST;
|
||||||
break;
|
break;
|
||||||
case REGION_7_A_BAND:
|
case REGION_7_A_BAND:
|
||||||
num =
|
num =
|
||||||
sizeof(A_BAND_REGION_7_CHANNEL_LIST) /
|
sizeof(A_BAND_REGION_7_CHANNEL_LIST) /
|
||||||
sizeof(UCHAR);
|
sizeof(u8);
|
||||||
pChannelList = A_BAND_REGION_7_CHANNEL_LIST;
|
pChannelList = A_BAND_REGION_7_CHANNEL_LIST;
|
||||||
break;
|
break;
|
||||||
case REGION_8_A_BAND:
|
case REGION_8_A_BAND:
|
||||||
num =
|
num =
|
||||||
sizeof(A_BAND_REGION_8_CHANNEL_LIST) /
|
sizeof(A_BAND_REGION_8_CHANNEL_LIST) /
|
||||||
sizeof(UCHAR);
|
sizeof(u8);
|
||||||
pChannelList = A_BAND_REGION_8_CHANNEL_LIST;
|
pChannelList = A_BAND_REGION_8_CHANNEL_LIST;
|
||||||
break;
|
break;
|
||||||
case REGION_9_A_BAND:
|
case REGION_9_A_BAND:
|
||||||
num =
|
num =
|
||||||
sizeof(A_BAND_REGION_9_CHANNEL_LIST) /
|
sizeof(A_BAND_REGION_9_CHANNEL_LIST) /
|
||||||
sizeof(UCHAR);
|
sizeof(u8);
|
||||||
pChannelList = A_BAND_REGION_9_CHANNEL_LIST;
|
pChannelList = A_BAND_REGION_9_CHANNEL_LIST;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case REGION_10_A_BAND:
|
case REGION_10_A_BAND:
|
||||||
num =
|
num =
|
||||||
sizeof(A_BAND_REGION_10_CHANNEL_LIST) /
|
sizeof(A_BAND_REGION_10_CHANNEL_LIST) /
|
||||||
sizeof(UCHAR);
|
sizeof(u8);
|
||||||
pChannelList = A_BAND_REGION_10_CHANNEL_LIST;
|
pChannelList = A_BAND_REGION_10_CHANNEL_LIST;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case REGION_11_A_BAND:
|
case REGION_11_A_BAND:
|
||||||
num =
|
num =
|
||||||
sizeof(A_BAND_REGION_11_CHANNEL_LIST) /
|
sizeof(A_BAND_REGION_11_CHANNEL_LIST) /
|
||||||
sizeof(UCHAR);
|
sizeof(u8);
|
||||||
pChannelList = A_BAND_REGION_11_CHANNEL_LIST;
|
pChannelList = A_BAND_REGION_11_CHANNEL_LIST;
|
||||||
break;
|
break;
|
||||||
case REGION_12_A_BAND:
|
case REGION_12_A_BAND:
|
||||||
num =
|
num =
|
||||||
sizeof(A_BAND_REGION_12_CHANNEL_LIST) /
|
sizeof(A_BAND_REGION_12_CHANNEL_LIST) /
|
||||||
sizeof(UCHAR);
|
sizeof(u8);
|
||||||
pChannelList = A_BAND_REGION_12_CHANNEL_LIST;
|
pChannelList = A_BAND_REGION_12_CHANNEL_LIST;
|
||||||
break;
|
break;
|
||||||
case REGION_13_A_BAND:
|
case REGION_13_A_BAND:
|
||||||
num =
|
num =
|
||||||
sizeof(A_BAND_REGION_13_CHANNEL_LIST) /
|
sizeof(A_BAND_REGION_13_CHANNEL_LIST) /
|
||||||
sizeof(UCHAR);
|
sizeof(u8);
|
||||||
pChannelList = A_BAND_REGION_13_CHANNEL_LIST;
|
pChannelList = A_BAND_REGION_13_CHANNEL_LIST;
|
||||||
break;
|
break;
|
||||||
case REGION_14_A_BAND:
|
case REGION_14_A_BAND:
|
||||||
num =
|
num =
|
||||||
sizeof(A_BAND_REGION_14_CHANNEL_LIST) /
|
sizeof(A_BAND_REGION_14_CHANNEL_LIST) /
|
||||||
sizeof(UCHAR);
|
sizeof(u8);
|
||||||
pChannelList = A_BAND_REGION_14_CHANNEL_LIST;
|
pChannelList = A_BAND_REGION_14_CHANNEL_LIST;
|
||||||
break;
|
break;
|
||||||
case REGION_15_A_BAND:
|
case REGION_15_A_BAND:
|
||||||
num =
|
num =
|
||||||
sizeof(A_BAND_REGION_15_CHANNEL_LIST) /
|
sizeof(A_BAND_REGION_15_CHANNEL_LIST) /
|
||||||
sizeof(UCHAR);
|
sizeof(u8);
|
||||||
pChannelList = A_BAND_REGION_15_CHANNEL_LIST;
|
pChannelList = A_BAND_REGION_15_CHANNEL_LIST;
|
||||||
break;
|
break;
|
||||||
default: /* Error. should never happen */
|
default: /* Error. should never happen */
|
||||||
@ -303,7 +303,7 @@ VOID BuildChannelList(IN PRTMP_ADAPTER pAd)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (num != 0) {
|
if (num != 0) {
|
||||||
UCHAR RadarCh[15] =
|
u8 RadarCh[15] =
|
||||||
{ 52, 56, 60, 64, 100, 104, 108, 112, 116, 120, 124,
|
{ 52, 56, 60, 64, 100, 104, 108, 112, 116, 120, 124,
|
||||||
128, 132, 136, 140 };
|
128, 132, 136, 140 };
|
||||||
for (i = 0; i < num; i++) {
|
for (i = 0; i < num; i++) {
|
||||||
@ -359,7 +359,7 @@ VOID BuildChannelList(IN PRTMP_ADAPTER pAd)
|
|||||||
|
|
||||||
==========================================================================
|
==========================================================================
|
||||||
*/
|
*/
|
||||||
UCHAR FirstChannel(IN PRTMP_ADAPTER pAd)
|
u8 FirstChannel(IN PRTMP_ADAPTER pAd)
|
||||||
{
|
{
|
||||||
return pAd->ChannelList[0].Channel;
|
return pAd->ChannelList[0].Channel;
|
||||||
}
|
}
|
||||||
@ -375,10 +375,10 @@ UCHAR FirstChannel(IN PRTMP_ADAPTER pAd)
|
|||||||
return 0 if no more next channel
|
return 0 if no more next channel
|
||||||
==========================================================================
|
==========================================================================
|
||||||
*/
|
*/
|
||||||
UCHAR NextChannel(IN PRTMP_ADAPTER pAd, IN UCHAR channel)
|
u8 NextChannel(IN PRTMP_ADAPTER pAd, u8 channel)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
UCHAR next_channel = 0;
|
u8 next_channel = 0;
|
||||||
|
|
||||||
for (i = 0; i < (pAd->ChannelListNum - 1); i++)
|
for (i = 0; i < (pAd->ChannelListNum - 1); i++)
|
||||||
if (channel == pAd->ChannelList[i].Channel) {
|
if (channel == pAd->ChannelList[i].Channel) {
|
||||||
@ -408,8 +408,8 @@ UCHAR NextChannel(IN PRTMP_ADAPTER pAd, IN UCHAR channel)
|
|||||||
the minimum value or next lower value.
|
the minimum value or next lower value.
|
||||||
==========================================================================
|
==========================================================================
|
||||||
*/
|
*/
|
||||||
VOID ChangeToCellPowerLimit(IN PRTMP_ADAPTER pAd,
|
void ChangeToCellPowerLimit(IN PRTMP_ADAPTER pAd,
|
||||||
IN UCHAR AironetCellPowerLimit)
|
u8 AironetCellPowerLimit)
|
||||||
{
|
{
|
||||||
/*valud 0xFF means that hasn't found power limit information */
|
/*valud 0xFF means that hasn't found power limit information */
|
||||||
/*from the AP's Beacon/Probe response. */
|
/*from the AP's Beacon/Probe response. */
|
||||||
@ -435,9 +435,9 @@ VOID ChangeToCellPowerLimit(IN PRTMP_ADAPTER pAd,
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
CHAR ConvertToRssi(IN PRTMP_ADAPTER pAd, IN CHAR Rssi, IN UCHAR RssiNumber)
|
char ConvertToRssi(IN PRTMP_ADAPTER pAd, char Rssi, u8 RssiNumber)
|
||||||
{
|
{
|
||||||
UCHAR RssiOffset, LNAGain;
|
u8 RssiOffset, LNAGain;
|
||||||
|
|
||||||
/* Rssi equals to zero should be an invalid value */
|
/* Rssi equals to zero should be an invalid value */
|
||||||
if (Rssi == 0)
|
if (Rssi == 0)
|
||||||
@ -469,16 +469,16 @@ CHAR ConvertToRssi(IN PRTMP_ADAPTER pAd, IN CHAR Rssi, IN UCHAR RssiNumber)
|
|||||||
Scan next channel
|
Scan next channel
|
||||||
==========================================================================
|
==========================================================================
|
||||||
*/
|
*/
|
||||||
VOID ScanNextChannel(IN PRTMP_ADAPTER pAd)
|
void ScanNextChannel(IN PRTMP_ADAPTER pAd)
|
||||||
{
|
{
|
||||||
HEADER_802_11 Hdr80211;
|
HEADER_802_11 Hdr80211;
|
||||||
PUCHAR pOutBuffer = NULL;
|
u8 *pOutBuffer = NULL;
|
||||||
NDIS_STATUS NStatus;
|
int NStatus;
|
||||||
ULONG FrameLen = 0;
|
unsigned long FrameLen = 0;
|
||||||
UCHAR SsidLen = 0, ScanType = pAd->MlmeAux.ScanType, BBPValue = 0;
|
u8 SsidLen = 0, ScanType = pAd->MlmeAux.ScanType, BBPValue = 0;
|
||||||
USHORT Status;
|
u16 Status;
|
||||||
PHEADER_802_11 pHdr80211;
|
PHEADER_802_11 pHdr80211;
|
||||||
UINT ScanTimeIn5gChannel = SHORT_CHANNEL_TIME;
|
u32 ScanTimeIn5gChannel = SHORT_CHANNEL_TIME;
|
||||||
|
|
||||||
{
|
{
|
||||||
if (MONITOR_ON(pAd))
|
if (MONITOR_ON(pAd))
|
||||||
@ -520,7 +520,7 @@ VOID ScanNextChannel(IN PRTMP_ADAPTER pAd)
|
|||||||
&& (INFRA_ON(pAd))) {
|
&& (INFRA_ON(pAd))) {
|
||||||
NStatus =
|
NStatus =
|
||||||
MlmeAllocateMemory(pAd,
|
MlmeAllocateMemory(pAd,
|
||||||
(PVOID) & pOutBuffer);
|
(void *)& pOutBuffer);
|
||||||
if (NStatus == NDIS_STATUS_SUCCESS) {
|
if (NStatus == NDIS_STATUS_SUCCESS) {
|
||||||
pHdr80211 = (PHEADER_802_11) pOutBuffer;
|
pHdr80211 = (PHEADER_802_11) pOutBuffer;
|
||||||
MgtMacHeaderInit(pAd, pHdr80211,
|
MgtMacHeaderInit(pAd, pHdr80211,
|
||||||
@ -650,7 +650,7 @@ VOID ScanNextChannel(IN PRTMP_ADAPTER pAd)
|
|||||||
pAd->CommonCfg.SupRate, END_OF_ARGS);
|
pAd->CommonCfg.SupRate, END_OF_ARGS);
|
||||||
|
|
||||||
if (pAd->CommonCfg.ExtRateLen) {
|
if (pAd->CommonCfg.ExtRateLen) {
|
||||||
ULONG Tmp;
|
unsigned long Tmp;
|
||||||
MakeOutgoingFrame(pOutBuffer + FrameLen, &Tmp,
|
MakeOutgoingFrame(pOutBuffer + FrameLen, &Tmp,
|
||||||
1, &ExtRateIe,
|
1, &ExtRateIe,
|
||||||
1, &pAd->CommonCfg.ExtRateLen,
|
1, &pAd->CommonCfg.ExtRateLen,
|
||||||
@ -661,9 +661,9 @@ VOID ScanNextChannel(IN PRTMP_ADAPTER pAd)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (pAd->CommonCfg.PhyMode >= PHY_11ABGN_MIXED) {
|
if (pAd->CommonCfg.PhyMode >= PHY_11ABGN_MIXED) {
|
||||||
ULONG Tmp;
|
unsigned long Tmp;
|
||||||
UCHAR HtLen;
|
u8 HtLen;
|
||||||
UCHAR BROADCOM[4] = { 0x0, 0x90, 0x4c, 0x33 };
|
u8 BROADCOM[4] = { 0x0, 0x90, 0x4c, 0x33 };
|
||||||
|
|
||||||
if (pAd->bBroadComHT == TRUE) {
|
if (pAd->bBroadComHT == TRUE) {
|
||||||
HtLen =
|
HtLen =
|
||||||
@ -700,10 +700,10 @@ VOID ScanNextChannel(IN PRTMP_ADAPTER pAd)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID MgtProbReqMacHeaderInit(IN PRTMP_ADAPTER pAd,
|
void MgtProbReqMacHeaderInit(IN PRTMP_ADAPTER pAd,
|
||||||
IN OUT PHEADER_802_11 pHdr80211,
|
IN OUT PHEADER_802_11 pHdr80211,
|
||||||
IN UCHAR SubType,
|
u8 SubType,
|
||||||
IN UCHAR ToDs, IN PUCHAR pDA, IN PUCHAR pBssid)
|
u8 ToDs, u8 *pDA, u8 *pBssid)
|
||||||
{
|
{
|
||||||
NdisZeroMemory(pHdr80211, sizeof(HEADER_802_11));
|
NdisZeroMemory(pHdr80211, sizeof(HEADER_802_11));
|
||||||
|
|
||||||
|
@ -42,7 +42,7 @@
|
|||||||
( ((A) << (n)) | ( ((A)>>(32-(n))) & ( (1UL << (n)) - 1 ) ) )
|
( ((A) << (n)) | ( ((A)>>(32-(n))) & ( (1UL << (n)) - 1 ) ) )
|
||||||
#define ROR32( A, n ) ROL32( (A), 32-(n) )
|
#define ROR32( A, n ) ROL32( (A), 32-(n) )
|
||||||
|
|
||||||
UINT Tkip_Sbox_Lower[256] = {
|
u32 Tkip_Sbox_Lower[256] = {
|
||||||
0xA5, 0x84, 0x99, 0x8D, 0x0D, 0xBD, 0xB1, 0x54,
|
0xA5, 0x84, 0x99, 0x8D, 0x0D, 0xBD, 0xB1, 0x54,
|
||||||
0x50, 0x03, 0xA9, 0x7D, 0x19, 0x62, 0xE6, 0x9A,
|
0x50, 0x03, 0xA9, 0x7D, 0x19, 0x62, 0xE6, 0x9A,
|
||||||
0x45, 0x9D, 0x40, 0x87, 0x15, 0xEB, 0xC9, 0x0B,
|
0x45, 0x9D, 0x40, 0x87, 0x15, 0xEB, 0xC9, 0x0B,
|
||||||
@ -77,7 +77,7 @@ UINT Tkip_Sbox_Lower[256] = {
|
|||||||
0xC3, 0xB0, 0x77, 0x11, 0xCB, 0xFC, 0xD6, 0x3A
|
0xC3, 0xB0, 0x77, 0x11, 0xCB, 0xFC, 0xD6, 0x3A
|
||||||
};
|
};
|
||||||
|
|
||||||
UINT Tkip_Sbox_Upper[256] = {
|
u32 Tkip_Sbox_Upper[256] = {
|
||||||
0xC6, 0xF8, 0xEE, 0xF6, 0xFF, 0xD6, 0xDE, 0x91,
|
0xC6, 0xF8, 0xEE, 0xF6, 0xFF, 0xD6, 0xDE, 0x91,
|
||||||
0x60, 0x02, 0xCE, 0x56, 0xE7, 0xB5, 0x4D, 0xEC,
|
0x60, 0x02, 0xCE, 0x56, 0xE7, 0xB5, 0x4D, 0xEC,
|
||||||
0x8F, 0x1F, 0x89, 0xFA, 0xEF, 0xB2, 0x8E, 0xFB,
|
0x8F, 0x1F, 0x89, 0xFA, 0xEF, 0xB2, 0x8E, 0xFB,
|
||||||
@ -118,31 +118,31 @@ UINT Tkip_Sbox_Upper[256] = {
|
|||||||
typedef struct PACKED _IV_CONTROL_ {
|
typedef struct PACKED _IV_CONTROL_ {
|
||||||
union PACKED {
|
union PACKED {
|
||||||
struct PACKED {
|
struct PACKED {
|
||||||
UCHAR rc0;
|
u8 rc0;
|
||||||
UCHAR rc1;
|
u8 rc1;
|
||||||
UCHAR rc2;
|
u8 rc2;
|
||||||
|
|
||||||
union PACKED {
|
union PACKED {
|
||||||
struct PACKED {
|
struct PACKED {
|
||||||
UCHAR Rsvd:5;
|
u8 Rsvd:5;
|
||||||
UCHAR ExtIV:1;
|
u8 ExtIV:1;
|
||||||
UCHAR KeyID:2;
|
u8 KeyID:2;
|
||||||
} field;
|
} field;
|
||||||
UCHAR Byte;
|
u8 Byte;
|
||||||
} CONTROL;
|
} CONTROL;
|
||||||
} field;
|
} field;
|
||||||
|
|
||||||
ULONG word;
|
unsigned long word;
|
||||||
} IV16;
|
} IV16;
|
||||||
|
|
||||||
ULONG IV32;
|
unsigned long IV32;
|
||||||
} TKIP_IV, *PTKIP_IV;
|
} TKIP_IV, *PTKIP_IV;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
========================================================================
|
========================================================================
|
||||||
|
|
||||||
Routine Description:
|
Routine Description:
|
||||||
Convert from UCHAR[] to ULONG in a portable way
|
Convert from u8[] to unsigned long in a portable way
|
||||||
|
|
||||||
Arguments:
|
Arguments:
|
||||||
pMICKey pointer to MIC Key
|
pMICKey pointer to MIC Key
|
||||||
@ -154,10 +154,10 @@ typedef struct PACKED _IV_CONTROL_ {
|
|||||||
|
|
||||||
========================================================================
|
========================================================================
|
||||||
*/
|
*/
|
||||||
ULONG RTMPTkipGetUInt32(IN PUCHAR pMICKey)
|
unsigned long RTMPTkipGetUInt32(u8 *pMICKey)
|
||||||
{
|
{
|
||||||
ULONG res = 0;
|
unsigned long res = 0;
|
||||||
INT i;
|
int i;
|
||||||
|
|
||||||
for (i = 0; i < 4; i++) {
|
for (i = 0; i < 4; i++) {
|
||||||
res |= (*pMICKey++) << (8 * i);
|
res |= (*pMICKey++) << (8 * i);
|
||||||
@ -170,10 +170,10 @@ ULONG RTMPTkipGetUInt32(IN PUCHAR pMICKey)
|
|||||||
========================================================================
|
========================================================================
|
||||||
|
|
||||||
Routine Description:
|
Routine Description:
|
||||||
Convert from ULONG to UCHAR[] in a portable way
|
Convert from unsigned long to u8[] in a portable way
|
||||||
|
|
||||||
Arguments:
|
Arguments:
|
||||||
pDst pointer to destination for convert ULONG to UCHAR[]
|
pDst pointer to destination for convert unsigned long to u8[]
|
||||||
val the value for convert
|
val the value for convert
|
||||||
|
|
||||||
Return Value:
|
Return Value:
|
||||||
@ -185,12 +185,12 @@ ULONG RTMPTkipGetUInt32(IN PUCHAR pMICKey)
|
|||||||
|
|
||||||
========================================================================
|
========================================================================
|
||||||
*/
|
*/
|
||||||
VOID RTMPTkipPutUInt32(IN OUT PUCHAR pDst, IN ULONG val)
|
void RTMPTkipPutUInt32(IN u8 *pDst, unsigned long val)
|
||||||
{
|
{
|
||||||
INT i;
|
int i;
|
||||||
|
|
||||||
for (i = 0; i < 4; i++) {
|
for (i = 0; i < 4; i++) {
|
||||||
*pDst++ = (UCHAR) (val & 0xff);
|
*pDst++ = (u8)(val & 0xff);
|
||||||
val >>= 8;
|
val >>= 8;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -214,7 +214,7 @@ VOID RTMPTkipPutUInt32(IN OUT PUCHAR pDst, IN ULONG val)
|
|||||||
|
|
||||||
========================================================================
|
========================================================================
|
||||||
*/
|
*/
|
||||||
VOID RTMPTkipSetMICKey(IN PTKIP_KEY_INFO pTkip, IN PUCHAR pMICKey)
|
void RTMPTkipSetMICKey(IN PTKIP_KEY_INFO pTkip, u8 *pMICKey)
|
||||||
{
|
{
|
||||||
/* Set the key */
|
/* Set the key */
|
||||||
pTkip->K0 = RTMPTkipGetUInt32(pMICKey);
|
pTkip->K0 = RTMPTkipGetUInt32(pMICKey);
|
||||||
@ -245,7 +245,7 @@ VOID RTMPTkipSetMICKey(IN PTKIP_KEY_INFO pTkip, IN PUCHAR pMICKey)
|
|||||||
|
|
||||||
========================================================================
|
========================================================================
|
||||||
*/
|
*/
|
||||||
VOID RTMPTkipAppendByte(IN PTKIP_KEY_INFO pTkip, IN UCHAR uChar)
|
void RTMPTkipAppendByte(IN PTKIP_KEY_INFO pTkip, u8 uChar)
|
||||||
{
|
{
|
||||||
/* Append the byte to our word-sized buffer */
|
/* Append the byte to our word-sized buffer */
|
||||||
pTkip->M |= (uChar << (8 * pTkip->nBytesInM));
|
pTkip->M |= (uChar << (8 * pTkip->nBytesInM));
|
||||||
@ -289,7 +289,7 @@ VOID RTMPTkipAppendByte(IN PTKIP_KEY_INFO pTkip, IN UCHAR uChar)
|
|||||||
|
|
||||||
========================================================================
|
========================================================================
|
||||||
*/
|
*/
|
||||||
VOID RTMPTkipAppend(IN PTKIP_KEY_INFO pTkip, IN PUCHAR pSrc, IN UINT nBytes)
|
void RTMPTkipAppend(IN PTKIP_KEY_INFO pTkip, u8 *pSrc, u32 nBytes)
|
||||||
{
|
{
|
||||||
/* This is simple */
|
/* This is simple */
|
||||||
while (nBytes > 0) {
|
while (nBytes > 0) {
|
||||||
@ -316,7 +316,7 @@ VOID RTMPTkipAppend(IN PTKIP_KEY_INFO pTkip, IN PUCHAR pSrc, IN UINT nBytes)
|
|||||||
the MIC Value is store in pAd->PrivateInfo.MIC
|
the MIC Value is store in pAd->PrivateInfo.MIC
|
||||||
========================================================================
|
========================================================================
|
||||||
*/
|
*/
|
||||||
VOID RTMPTkipGetMIC(IN PTKIP_KEY_INFO pTkip)
|
void RTMPTkipGetMIC(IN PTKIP_KEY_INFO pTkip)
|
||||||
{
|
{
|
||||||
/* Append the minimum padding */
|
/* Append the minimum padding */
|
||||||
RTMPTkipAppendByte(pTkip, 0x5a);
|
RTMPTkipAppendByte(pTkip, 0x5a);
|
||||||
@ -355,12 +355,12 @@ VOID RTMPTkipGetMIC(IN PTKIP_KEY_INFO pTkip)
|
|||||||
|
|
||||||
========================================================================
|
========================================================================
|
||||||
*/
|
*/
|
||||||
VOID RTMPInitTkipEngine(IN PRTMP_ADAPTER pAd,
|
void RTMPInitTkipEngine(IN PRTMP_ADAPTER pAd,
|
||||||
IN PUCHAR pKey,
|
u8 *pKey,
|
||||||
IN UCHAR KeyId,
|
u8 KeyId,
|
||||||
IN PUCHAR pTA,
|
u8 *pTA,
|
||||||
IN PUCHAR pMICKey,
|
u8 *pMICKey,
|
||||||
IN PUCHAR pTSC, OUT PULONG pIV16, OUT PULONG pIV32)
|
u8 *pTSC, unsigned long *pIV16, unsigned long *pIV32)
|
||||||
{
|
{
|
||||||
TKIP_IV tkipIv;
|
TKIP_IV tkipIv;
|
||||||
|
|
||||||
@ -371,7 +371,7 @@ VOID RTMPInitTkipEngine(IN PRTMP_ADAPTER pAd,
|
|||||||
tkipIv.IV16.field.rc2 = *pTSC;
|
tkipIv.IV16.field.rc2 = *pTSC;
|
||||||
tkipIv.IV16.field.CONTROL.field.ExtIV = 1; /* 0: non-extended IV, 1: an extended IV */
|
tkipIv.IV16.field.CONTROL.field.ExtIV = 1; /* 0: non-extended IV, 1: an extended IV */
|
||||||
tkipIv.IV16.field.CONTROL.field.KeyID = KeyId;
|
tkipIv.IV16.field.CONTROL.field.KeyID = KeyId;
|
||||||
/* tkipIv.IV32 = *(PULONG)(pTSC + 2); */
|
/* tkipIv.IV32 = *(unsigned long *)(pTSC + 2); */
|
||||||
NdisMoveMemory(&tkipIv.IV32, (pTSC + 2), 4); /* Copy IV */
|
NdisMoveMemory(&tkipIv.IV32, (pTSC + 2), 4); /* Copy IV */
|
||||||
|
|
||||||
*pIV16 = tkipIv.IV16.word;
|
*pIV16 = tkipIv.IV16.word;
|
||||||
@ -399,12 +399,12 @@ VOID RTMPInitTkipEngine(IN PRTMP_ADAPTER pAd,
|
|||||||
|
|
||||||
========================================================================
|
========================================================================
|
||||||
*/
|
*/
|
||||||
VOID RTMPInitMICEngine(IN PRTMP_ADAPTER pAd,
|
void RTMPInitMICEngine(IN PRTMP_ADAPTER pAd,
|
||||||
IN PUCHAR pKey,
|
u8 *pKey,
|
||||||
IN PUCHAR pDA,
|
u8 *pDA,
|
||||||
IN PUCHAR pSA, IN UCHAR UserPriority, IN PUCHAR pMICKey)
|
u8 *pSA, u8 UserPriority, u8 *pMICKey)
|
||||||
{
|
{
|
||||||
ULONG Priority = UserPriority;
|
unsigned long Priority = UserPriority;
|
||||||
|
|
||||||
/* Init MIC value calculation */
|
/* Init MIC value calculation */
|
||||||
RTMPTkipSetMICKey(&pAd->PrivateInfo.Tx, pMICKey);
|
RTMPTkipSetMICKey(&pAd->PrivateInfo.Tx, pMICKey);
|
||||||
@ -413,7 +413,7 @@ VOID RTMPInitMICEngine(IN PRTMP_ADAPTER pAd,
|
|||||||
/* SA */
|
/* SA */
|
||||||
RTMPTkipAppend(&pAd->PrivateInfo.Tx, pSA, MAC_ADDR_LEN);
|
RTMPTkipAppend(&pAd->PrivateInfo.Tx, pSA, MAC_ADDR_LEN);
|
||||||
/* Priority + 3 bytes of 0 */
|
/* Priority + 3 bytes of 0 */
|
||||||
RTMPTkipAppend(&pAd->PrivateInfo.Tx, (PUCHAR) & Priority, 4);
|
RTMPTkipAppend(&pAd->PrivateInfo.Tx, (u8 *)& Priority, 4);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -441,14 +441,14 @@ VOID RTMPInitMICEngine(IN PRTMP_ADAPTER pAd,
|
|||||||
========================================================================
|
========================================================================
|
||||||
*/
|
*/
|
||||||
BOOLEAN RTMPTkipCompareMICValue(IN PRTMP_ADAPTER pAd,
|
BOOLEAN RTMPTkipCompareMICValue(IN PRTMP_ADAPTER pAd,
|
||||||
IN PUCHAR pSrc,
|
u8 *pSrc,
|
||||||
IN PUCHAR pDA,
|
u8 *pDA,
|
||||||
IN PUCHAR pSA,
|
u8 *pSA,
|
||||||
IN PUCHAR pMICKey,
|
u8 *pMICKey,
|
||||||
IN UCHAR UserPriority, IN UINT Len)
|
u8 UserPriority, u32 Len)
|
||||||
{
|
{
|
||||||
UCHAR OldMic[8];
|
u8 OldMic[8];
|
||||||
ULONG Priority = UserPriority;
|
unsigned long Priority = UserPriority;
|
||||||
|
|
||||||
/* Init MIC value calculation */
|
/* Init MIC value calculation */
|
||||||
RTMPTkipSetMICKey(&pAd->PrivateInfo.Rx, pMICKey);
|
RTMPTkipSetMICKey(&pAd->PrivateInfo.Rx, pMICKey);
|
||||||
@ -457,7 +457,7 @@ BOOLEAN RTMPTkipCompareMICValue(IN PRTMP_ADAPTER pAd,
|
|||||||
/* SA */
|
/* SA */
|
||||||
RTMPTkipAppend(&pAd->PrivateInfo.Rx, pSA, MAC_ADDR_LEN);
|
RTMPTkipAppend(&pAd->PrivateInfo.Rx, pSA, MAC_ADDR_LEN);
|
||||||
/* Priority + 3 bytes of 0 */
|
/* Priority + 3 bytes of 0 */
|
||||||
RTMPTkipAppend(&pAd->PrivateInfo.Rx, (PUCHAR) & Priority, 4);
|
RTMPTkipAppend(&pAd->PrivateInfo.Rx, (u8 *)& Priority, 4);
|
||||||
|
|
||||||
/* Calculate MIC value from plain text data */
|
/* Calculate MIC value from plain text data */
|
||||||
RTMPTkipAppend(&pAd->PrivateInfo.Rx, pSrc, Len);
|
RTMPTkipAppend(&pAd->PrivateInfo.Rx, pSrc, Len);
|
||||||
@ -500,17 +500,17 @@ BOOLEAN RTMPTkipCompareMICValue(IN PRTMP_ADAPTER pAd,
|
|||||||
|
|
||||||
========================================================================
|
========================================================================
|
||||||
*/
|
*/
|
||||||
VOID RTMPCalculateMICValue(IN PRTMP_ADAPTER pAd,
|
void RTMPCalculateMICValue(IN PRTMP_ADAPTER pAd,
|
||||||
IN PNDIS_PACKET pPacket,
|
IN PNDIS_PACKET pPacket,
|
||||||
IN PUCHAR pEncap,
|
u8 *pEncap,
|
||||||
IN PCIPHER_KEY pKey, IN UCHAR apidx)
|
IN PCIPHER_KEY pKey, u8 apidx)
|
||||||
{
|
{
|
||||||
PACKET_INFO PacketInfo;
|
PACKET_INFO PacketInfo;
|
||||||
PUCHAR pSrcBufVA;
|
u8 *pSrcBufVA;
|
||||||
UINT SrcBufLen;
|
u32 SrcBufLen;
|
||||||
PUCHAR pSrc;
|
u8 *pSrc;
|
||||||
UCHAR UserPriority;
|
u8 UserPriority;
|
||||||
UCHAR vlan_offset = 0;
|
u8 vlan_offset = 0;
|
||||||
|
|
||||||
RTMP_QueryPacketInfo(pPacket, &PacketInfo, &pSrcBufVA, &SrcBufLen);
|
RTMP_QueryPacketInfo(pPacket, &PacketInfo, &pSrcBufVA, &SrcBufLen);
|
||||||
|
|
||||||
@ -555,11 +555,11 @@ VOID RTMPCalculateMICValue(IN PRTMP_ADAPTER pAd,
|
|||||||
/* is synthesized from two 256 entry byte wide tables. */
|
/* is synthesized from two 256 entry byte wide tables. */
|
||||||
/************************************************************/
|
/************************************************************/
|
||||||
|
|
||||||
UINT tkip_sbox(UINT index)
|
u32 tkip_sbox(u32 index)
|
||||||
{
|
{
|
||||||
UINT index_low;
|
u32 index_low;
|
||||||
UINT index_high;
|
u32 index_high;
|
||||||
UINT left, right;
|
u32 left, right;
|
||||||
|
|
||||||
index_low = (index % 256);
|
index_low = (index % 256);
|
||||||
index_high = ((index >> 8) % 256);
|
index_high = ((index >> 8) % 256);
|
||||||
@ -571,7 +571,7 @@ UINT tkip_sbox(UINT index)
|
|||||||
return (left ^ right);
|
return (left ^ right);
|
||||||
}
|
}
|
||||||
|
|
||||||
UINT rotr1(UINT a)
|
u32 rotr1(u32 a)
|
||||||
{
|
{
|
||||||
unsigned int b;
|
unsigned int b;
|
||||||
|
|
||||||
@ -584,24 +584,24 @@ UINT rotr1(UINT a)
|
|||||||
return b;
|
return b;
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID RTMPTkipMixKey(UCHAR * key, UCHAR * ta, ULONG pnl, /* Least significant 16 bits of PN */
|
void RTMPTkipMixKey(u8 * key, u8 * ta, unsigned long pnl, /* Least significant 16 bits of PN */
|
||||||
ULONG pnh, /* Most significant 32 bits of PN */
|
unsigned long pnh, /* Most significant 32 bits of PN */
|
||||||
UCHAR * rc4key, UINT * p1k)
|
u8 * rc4key, u32 * p1k)
|
||||||
{
|
{
|
||||||
|
|
||||||
UINT tsc0;
|
u32 tsc0;
|
||||||
UINT tsc1;
|
u32 tsc1;
|
||||||
UINT tsc2;
|
u32 tsc2;
|
||||||
|
|
||||||
UINT ppk0;
|
u32 ppk0;
|
||||||
UINT ppk1;
|
u32 ppk1;
|
||||||
UINT ppk2;
|
u32 ppk2;
|
||||||
UINT ppk3;
|
u32 ppk3;
|
||||||
UINT ppk4;
|
u32 ppk4;
|
||||||
UINT ppk5;
|
u32 ppk5;
|
||||||
|
|
||||||
INT i;
|
int i;
|
||||||
INT j;
|
int j;
|
||||||
|
|
||||||
tsc0 = (unsigned int)((pnh >> 16) % 65536); /* msb */
|
tsc0 = (unsigned int)((pnh >> 16) % 65536); /* msb */
|
||||||
tsc1 = (unsigned int)(pnh % 65536);
|
tsc1 = (unsigned int)(pnh % 65536);
|
||||||
@ -610,9 +610,9 @@ VOID RTMPTkipMixKey(UCHAR * key, UCHAR * ta, ULONG pnl, /* Least significant 16
|
|||||||
/* Phase 1, step 1 */
|
/* Phase 1, step 1 */
|
||||||
p1k[0] = tsc1;
|
p1k[0] = tsc1;
|
||||||
p1k[1] = tsc0;
|
p1k[1] = tsc0;
|
||||||
p1k[2] = (UINT) (ta[0] + (ta[1] * 256));
|
p1k[2] = (u32)(ta[0] + (ta[1] * 256));
|
||||||
p1k[3] = (UINT) (ta[2] + (ta[3] * 256));
|
p1k[3] = (u32)(ta[2] + (ta[3] * 256));
|
||||||
p1k[4] = (UINT) (ta[4] + (ta[5] * 256));
|
p1k[4] = (u32)(ta[4] + (ta[5] * 256));
|
||||||
|
|
||||||
/* Phase 1, step 2 */
|
/* Phase 1, step 2 */
|
||||||
for (i = 0; i < 8; i++) {
|
for (i = 0; i < 8; i++) {
|
||||||
@ -699,43 +699,43 @@ VOID RTMPTkipMixKey(UCHAR * key, UCHAR * ta, ULONG pnl, /* Least significant 16
|
|||||||
/* FALSE: Decrypt Error! */
|
/* FALSE: Decrypt Error! */
|
||||||
/* */
|
/* */
|
||||||
BOOLEAN RTMPSoftDecryptTKIP(IN PRTMP_ADAPTER pAd,
|
BOOLEAN RTMPSoftDecryptTKIP(IN PRTMP_ADAPTER pAd,
|
||||||
IN PUCHAR pData,
|
u8 *pData,
|
||||||
IN ULONG DataByteCnt,
|
unsigned long DataByteCnt,
|
||||||
IN UCHAR UserPriority, IN PCIPHER_KEY pWpaKey)
|
u8 UserPriority, IN PCIPHER_KEY pWpaKey)
|
||||||
{
|
{
|
||||||
UCHAR KeyID;
|
u8 KeyID;
|
||||||
UINT HeaderLen;
|
u32 HeaderLen;
|
||||||
UCHAR fc0;
|
u8 fc0;
|
||||||
UCHAR fc1;
|
u8 fc1;
|
||||||
USHORT fc;
|
u16 fc;
|
||||||
UINT frame_type;
|
u32 frame_type;
|
||||||
UINT frame_subtype;
|
u32 frame_subtype;
|
||||||
UINT from_ds;
|
u32 from_ds;
|
||||||
UINT to_ds;
|
u32 to_ds;
|
||||||
INT a4_exists;
|
int a4_exists;
|
||||||
INT qc_exists;
|
int qc_exists;
|
||||||
USHORT duration;
|
u16 duration;
|
||||||
USHORT seq_control;
|
u16 seq_control;
|
||||||
USHORT qos_control;
|
u16 qos_control;
|
||||||
UCHAR TA[MAC_ADDR_LEN];
|
u8 TA[MAC_ADDR_LEN];
|
||||||
UCHAR DA[MAC_ADDR_LEN];
|
u8 DA[MAC_ADDR_LEN];
|
||||||
UCHAR SA[MAC_ADDR_LEN];
|
u8 SA[MAC_ADDR_LEN];
|
||||||
UCHAR RC4Key[16];
|
u8 RC4Key[16];
|
||||||
UINT p1k[5]; /*for mix_key; */
|
u32 p1k[5]; /*for mix_key; */
|
||||||
ULONG pnl; /* Least significant 16 bits of PN */
|
unsigned long pnl; /* Least significant 16 bits of PN */
|
||||||
ULONG pnh; /* Most significant 32 bits of PN */
|
unsigned long pnh; /* Most significant 32 bits of PN */
|
||||||
UINT num_blocks;
|
u32 num_blocks;
|
||||||
UINT payload_remainder;
|
u32 payload_remainder;
|
||||||
ARCFOURCONTEXT ArcFourContext;
|
ARCFOURCONTEXT ArcFourContext;
|
||||||
UINT crc32 = 0;
|
u32 crc32 = 0;
|
||||||
UINT trailfcs = 0;
|
u32 trailfcs = 0;
|
||||||
UCHAR MIC[8];
|
u8 MIC[8];
|
||||||
UCHAR TrailMIC[8];
|
u8 TrailMIC[8];
|
||||||
|
|
||||||
fc0 = *pData;
|
fc0 = *pData;
|
||||||
fc1 = *(pData + 1);
|
fc1 = *(pData + 1);
|
||||||
|
|
||||||
fc = *((PUSHORT) pData);
|
fc = *((u16 *)pData);
|
||||||
|
|
||||||
frame_type = ((fc0 >> 2) & 0x03);
|
frame_type = ((fc0 >> 2) & 0x03);
|
||||||
frame_subtype = ((fc0 >> 4) & 0x0f);
|
frame_subtype = ((fc0 >> 4) & 0x0f);
|
||||||
@ -753,7 +753,7 @@ BOOLEAN RTMPSoftDecryptTKIP(IN PRTMP_ADAPTER pAd,
|
|||||||
if (a4_exists)
|
if (a4_exists)
|
||||||
HeaderLen += 6;
|
HeaderLen += 6;
|
||||||
|
|
||||||
KeyID = *((PUCHAR) (pData + HeaderLen + 3));
|
KeyID = *((u8 *)(pData + HeaderLen + 3));
|
||||||
KeyID = KeyID >> 6;
|
KeyID = KeyID >> 6;
|
||||||
|
|
||||||
if (pWpaKey[KeyID].KeyLen == 0) {
|
if (pWpaKey[KeyID].KeyLen == 0) {
|
||||||
@ -763,15 +763,15 @@ BOOLEAN RTMPSoftDecryptTKIP(IN PRTMP_ADAPTER pAd,
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
duration = *((PUSHORT) (pData + 2));
|
duration = *((u16 *)(pData + 2));
|
||||||
|
|
||||||
seq_control = *((PUSHORT) (pData + 22));
|
seq_control = *((u16 *)(pData + 22));
|
||||||
|
|
||||||
if (qc_exists) {
|
if (qc_exists) {
|
||||||
if (a4_exists) {
|
if (a4_exists) {
|
||||||
qos_control = *((PUSHORT) (pData + 30));
|
qos_control = *((u16 *)(pData + 30));
|
||||||
} else {
|
} else {
|
||||||
qos_control = *((PUSHORT) (pData + 24));
|
qos_control = *((u16 *)(pData + 24));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -797,7 +797,7 @@ BOOLEAN RTMPSoftDecryptTKIP(IN PRTMP_ADAPTER pAd,
|
|||||||
payload_remainder = (DataByteCnt - 16) % 16;
|
payload_remainder = (DataByteCnt - 16) % 16;
|
||||||
|
|
||||||
pnl = (*(pData + HeaderLen)) * 256 + *(pData + HeaderLen + 2);
|
pnl = (*(pData + HeaderLen)) * 256 + *(pData + HeaderLen + 2);
|
||||||
pnh = *((PULONG) (pData + HeaderLen + 4));
|
pnh = *((unsigned long *)(pData + HeaderLen + 4));
|
||||||
pnh = cpu2le32(pnh);
|
pnh = cpu2le32(pnh);
|
||||||
RTMPTkipMixKey(pWpaKey[KeyID].Key, TA, pnl, pnh, RC4Key, p1k);
|
RTMPTkipMixKey(pWpaKey[KeyID].Key, TA, pnl, pnh, RC4Key, p1k);
|
||||||
|
|
||||||
|
@ -37,7 +37,7 @@
|
|||||||
|
|
||||||
#include "../rt_config.h"
|
#include "../rt_config.h"
|
||||||
|
|
||||||
UINT FCSTAB_32[256] = {
|
u32 FCSTAB_32[256] = {
|
||||||
0x00000000, 0x77073096, 0xee0e612c, 0x990951ba,
|
0x00000000, 0x77073096, 0xee0e612c, 0x990951ba,
|
||||||
0x076dc419, 0x706af48f, 0xe963a535, 0x9e6495a3,
|
0x076dc419, 0x706af48f, 0xe963a535, 0x9e6495a3,
|
||||||
0x0edb8832, 0x79dcb8a4, 0xe0d5e91e, 0x97d2d988,
|
0x0edb8832, 0x79dcb8a4, 0xe0d5e91e, 0x97d2d988,
|
||||||
@ -105,7 +105,7 @@ UINT FCSTAB_32[256] = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
UCHAR WEPKEY[] = {
|
u8 WEPKEY[] = {
|
||||||
//IV
|
//IV
|
||||||
0x00, 0x11, 0x22,
|
0x00, 0x11, 0x22,
|
||||||
//WEP KEY
|
//WEP KEY
|
||||||
@ -135,12 +135,12 @@ UCHAR WEPKEY[] = {
|
|||||||
|
|
||||||
========================================================================
|
========================================================================
|
||||||
*/
|
*/
|
||||||
VOID RTMPInitWepEngine(IN PRTMP_ADAPTER pAd,
|
void RTMPInitWepEngine(IN PRTMP_ADAPTER pAd,
|
||||||
IN PUCHAR pKey,
|
u8 *pKey,
|
||||||
IN UCHAR KeyId, IN UCHAR KeyLen, IN OUT PUCHAR pDest)
|
u8 KeyId, u8 KeyLen, IN u8 *pDest)
|
||||||
{
|
{
|
||||||
UINT i;
|
u32 i;
|
||||||
UCHAR WEPKEY[] = {
|
u8 WEPKEY[] = {
|
||||||
/*IV */
|
/*IV */
|
||||||
0x00, 0x11, 0x22,
|
0x00, 0x11, 0x22,
|
||||||
/*WEP KEY */
|
/*WEP KEY */
|
||||||
@ -184,8 +184,8 @@ VOID RTMPInitWepEngine(IN PRTMP_ADAPTER pAd,
|
|||||||
|
|
||||||
========================================================================
|
========================================================================
|
||||||
*/
|
*/
|
||||||
VOID RTMPEncryptData(IN PRTMP_ADAPTER pAd,
|
void RTMPEncryptData(IN PRTMP_ADAPTER pAd,
|
||||||
IN PUCHAR pSrc, IN PUCHAR pDest, IN UINT Len)
|
u8 *pSrc, u8 *pDest, u32 Len)
|
||||||
{
|
{
|
||||||
pAd->PrivateInfo.FCSCRC32 =
|
pAd->PrivateInfo.FCSCRC32 =
|
||||||
RTMP_CALC_FCS32(pAd->PrivateInfo.FCSCRC32, pSrc, Len);
|
RTMP_CALC_FCS32(pAd->PrivateInfo.FCSCRC32, pSrc, Len);
|
||||||
@ -212,21 +212,21 @@ VOID RTMPEncryptData(IN PRTMP_ADAPTER pAd,
|
|||||||
========================================================================
|
========================================================================
|
||||||
*/
|
*/
|
||||||
BOOLEAN RTMPSoftDecryptWEP(IN PRTMP_ADAPTER pAd,
|
BOOLEAN RTMPSoftDecryptWEP(IN PRTMP_ADAPTER pAd,
|
||||||
IN PUCHAR pData,
|
u8 *pData,
|
||||||
IN ULONG DataByteCnt, IN PCIPHER_KEY pGroupKey)
|
unsigned long DataByteCnt, IN PCIPHER_KEY pGroupKey)
|
||||||
{
|
{
|
||||||
UINT trailfcs;
|
u32 trailfcs;
|
||||||
UINT crc32;
|
u32 crc32;
|
||||||
UCHAR KeyIdx;
|
u8 KeyIdx;
|
||||||
UCHAR WEPKEY[] = {
|
u8 WEPKEY[] = {
|
||||||
/*IV */
|
/*IV */
|
||||||
0x00, 0x11, 0x22,
|
0x00, 0x11, 0x22,
|
||||||
/*WEP KEY */
|
/*WEP KEY */
|
||||||
0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99,
|
0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99,
|
||||||
0xAA, 0xBB, 0xCC
|
0xAA, 0xBB, 0xCC
|
||||||
};
|
};
|
||||||
UCHAR *pPayload = (UCHAR *) pData + LENGTH_802_11;
|
u8 *pPayload = (u8 *) pData + LENGTH_802_11;
|
||||||
ULONG payload_len = DataByteCnt - LENGTH_802_11;
|
unsigned long payload_len = DataByteCnt - LENGTH_802_11;
|
||||||
|
|
||||||
NdisMoveMemory(WEPKEY, pPayload, 3); /*Get WEP IV */
|
NdisMoveMemory(WEPKEY, pPayload, 3); /*Get WEP IV */
|
||||||
|
|
||||||
@ -271,19 +271,19 @@ BOOLEAN RTMPSoftDecryptWEP(IN PRTMP_ADAPTER pAd,
|
|||||||
|
|
||||||
========================================================================
|
========================================================================
|
||||||
*/
|
*/
|
||||||
VOID ARCFOUR_INIT(IN PARCFOURCONTEXT Ctx, IN PUCHAR pKey, IN UINT KeyLen)
|
void ARCFOUR_INIT(IN PARCFOURCONTEXT Ctx, u8 *pKey, u32 KeyLen)
|
||||||
{
|
{
|
||||||
UCHAR t, u;
|
u8 t, u;
|
||||||
UINT keyindex;
|
u32 keyindex;
|
||||||
UINT stateindex;
|
u32 stateindex;
|
||||||
PUCHAR state;
|
u8 *state;
|
||||||
UINT counter;
|
u32 counter;
|
||||||
|
|
||||||
state = Ctx->STATE;
|
state = Ctx->STATE;
|
||||||
Ctx->X = 0;
|
Ctx->X = 0;
|
||||||
Ctx->Y = 0;
|
Ctx->Y = 0;
|
||||||
for (counter = 0; counter < 256; counter++)
|
for (counter = 0; counter < 256; counter++)
|
||||||
state[counter] = (UCHAR) counter;
|
state[counter] = (u8)counter;
|
||||||
keyindex = 0;
|
keyindex = 0;
|
||||||
stateindex = 0;
|
stateindex = 0;
|
||||||
for (counter = 0; counter < 256; counter++) {
|
for (counter = 0; counter < 256; counter++) {
|
||||||
@ -307,18 +307,18 @@ VOID ARCFOUR_INIT(IN PARCFOURCONTEXT Ctx, IN PUCHAR pKey, IN UINT KeyLen)
|
|||||||
Ctx Pointer to ARCFOUR CONTEXT (SBOX)
|
Ctx Pointer to ARCFOUR CONTEXT (SBOX)
|
||||||
|
|
||||||
Return Value:
|
Return Value:
|
||||||
UCHAR - the value of the ARCFOUR CONTEXT (S-BOX)
|
u8 - the value of the ARCFOUR CONTEXT (S-BOX)
|
||||||
|
|
||||||
Note:
|
Note:
|
||||||
|
|
||||||
========================================================================
|
========================================================================
|
||||||
*/
|
*/
|
||||||
UCHAR ARCFOUR_BYTE(IN PARCFOURCONTEXT Ctx)
|
u8 ARCFOUR_BYTE(IN PARCFOURCONTEXT Ctx)
|
||||||
{
|
{
|
||||||
UINT x;
|
u32 x;
|
||||||
UINT y;
|
u32 y;
|
||||||
UCHAR sx, sy;
|
u8 sx, sy;
|
||||||
PUCHAR state;
|
u8 *state;
|
||||||
|
|
||||||
state = Ctx->STATE;
|
state = Ctx->STATE;
|
||||||
x = (Ctx->X + 1) & 0xff;
|
x = (Ctx->X + 1) & 0xff;
|
||||||
@ -353,10 +353,10 @@ UCHAR ARCFOUR_BYTE(IN PARCFOURCONTEXT Ctx)
|
|||||||
|
|
||||||
========================================================================
|
========================================================================
|
||||||
*/
|
*/
|
||||||
VOID ARCFOUR_DECRYPT(IN PARCFOURCONTEXT Ctx,
|
void ARCFOUR_DECRYPT(IN PARCFOURCONTEXT Ctx,
|
||||||
IN PUCHAR pDest, IN PUCHAR pSrc, IN UINT Len)
|
u8 *pDest, u8 *pSrc, u32 Len)
|
||||||
{
|
{
|
||||||
UINT i;
|
u32 i;
|
||||||
|
|
||||||
for (i = 0; i < Len; i++)
|
for (i = 0; i < Len; i++)
|
||||||
pDest[i] = pSrc[i] ^ ARCFOUR_BYTE(Ctx);
|
pDest[i] = pSrc[i] ^ ARCFOUR_BYTE(Ctx);
|
||||||
@ -383,10 +383,10 @@ VOID ARCFOUR_DECRYPT(IN PARCFOURCONTEXT Ctx,
|
|||||||
|
|
||||||
========================================================================
|
========================================================================
|
||||||
*/
|
*/
|
||||||
VOID ARCFOUR_ENCRYPT(IN PARCFOURCONTEXT Ctx,
|
void ARCFOUR_ENCRYPT(IN PARCFOURCONTEXT Ctx,
|
||||||
IN PUCHAR pDest, IN PUCHAR pSrc, IN UINT Len)
|
u8 *pDest, u8 *pSrc, u32 Len)
|
||||||
{
|
{
|
||||||
UINT i;
|
u32 i;
|
||||||
|
|
||||||
for (i = 0; i < Len; i++)
|
for (i = 0; i < Len; i++)
|
||||||
pDest[i] = pSrc[i] ^ ARCFOUR_BYTE(Ctx);
|
pDest[i] = pSrc[i] ^ ARCFOUR_BYTE(Ctx);
|
||||||
@ -407,10 +407,10 @@ VOID ARCFOUR_ENCRYPT(IN PARCFOURCONTEXT Ctx,
|
|||||||
========================================================================
|
========================================================================
|
||||||
*/
|
*/
|
||||||
|
|
||||||
VOID WPAARCFOUR_ENCRYPT(IN PARCFOURCONTEXT Ctx,
|
void WPAARCFOUR_ENCRYPT(IN PARCFOURCONTEXT Ctx,
|
||||||
IN PUCHAR pDest, IN PUCHAR pSrc, IN UINT Len)
|
u8 *pDest, u8 *pSrc, u32 Len)
|
||||||
{
|
{
|
||||||
UINT i;
|
u32 i;
|
||||||
/*discard first 256 bytes */
|
/*discard first 256 bytes */
|
||||||
for (i = 0; i < 256; i++)
|
for (i = 0; i < 256; i++)
|
||||||
ARCFOUR_BYTE(Ctx);
|
ARCFOUR_BYTE(Ctx);
|
||||||
@ -431,7 +431,7 @@ VOID WPAARCFOUR_ENCRYPT(IN PARCFOURCONTEXT Ctx,
|
|||||||
Len the length of the data
|
Len the length of the data
|
||||||
|
|
||||||
Return Value:
|
Return Value:
|
||||||
UINT - FCS 32 bits
|
u32 - FCS 32 bits
|
||||||
|
|
||||||
IRQL = DISPATCH_LEVEL
|
IRQL = DISPATCH_LEVEL
|
||||||
|
|
||||||
@ -439,7 +439,7 @@ VOID WPAARCFOUR_ENCRYPT(IN PARCFOURCONTEXT Ctx,
|
|||||||
|
|
||||||
========================================================================
|
========================================================================
|
||||||
*/
|
*/
|
||||||
UINT RTMP_CALC_FCS32(IN UINT Fcs, IN PUCHAR Cp, IN INT Len)
|
u32 RTMP_CALC_FCS32(u32 Fcs, u8 *Cp, int Len)
|
||||||
{
|
{
|
||||||
while (Len--)
|
while (Len--)
|
||||||
Fcs = (((Fcs) >> 8) ^ FCSTAB_32[((Fcs) ^ (*Cp++)) & 0xff]);
|
Fcs = (((Fcs) >> 8) ^ FCSTAB_32[((Fcs) ^ (*Cp++)) & 0xff]);
|
||||||
@ -463,11 +463,11 @@ UINT RTMP_CALC_FCS32(IN UINT Fcs, IN PUCHAR Cp, IN INT Len)
|
|||||||
|
|
||||||
========================================================================
|
========================================================================
|
||||||
*/
|
*/
|
||||||
VOID RTMPSetICV(IN PRTMP_ADAPTER pAd, IN PUCHAR pDest)
|
void RTMPSetICV(IN PRTMP_ADAPTER pAd, u8 *pDest)
|
||||||
{
|
{
|
||||||
pAd->PrivateInfo.FCSCRC32 ^= 0xffffffff; /* complement */
|
pAd->PrivateInfo.FCSCRC32 ^= 0xffffffff; /* complement */
|
||||||
pAd->PrivateInfo.FCSCRC32 = cpu2le32(pAd->PrivateInfo.FCSCRC32);
|
pAd->PrivateInfo.FCSCRC32 = cpu2le32(pAd->PrivateInfo.FCSCRC32);
|
||||||
|
|
||||||
ARCFOUR_ENCRYPT(&pAd->PrivateInfo.WEPCONTEXT, pDest,
|
ARCFOUR_ENCRYPT(&pAd->PrivateInfo.WEPCONTEXT, pDest,
|
||||||
(PUCHAR) & pAd->PrivateInfo.FCSCRC32, 4);
|
(u8 *)& pAd->PrivateInfo.FCSCRC32, 4);
|
||||||
}
|
}
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -46,16 +46,16 @@ Note:
|
|||||||
None
|
None
|
||||||
========================================================================
|
========================================================================
|
||||||
*/
|
*/
|
||||||
VOID HMAC_SHA1(IN const UINT8 Key[],
|
void HMAC_SHA1(IN const u8 Key[],
|
||||||
IN UINT KeyLen,
|
u32 KeyLen,
|
||||||
IN const UINT8 Message[],
|
IN const u8 Message[],
|
||||||
IN UINT MessageLen, OUT UINT8 MAC[], IN UINT MACLen)
|
u32 MessageLen, u8 MAC[], u32 MACLen)
|
||||||
{
|
{
|
||||||
SHA1_CTX_STRUC sha_ctx1;
|
SHA1_CTX_STRUC sha_ctx1;
|
||||||
SHA1_CTX_STRUC sha_ctx2;
|
SHA1_CTX_STRUC sha_ctx2;
|
||||||
UINT8 K0[SHA1_BLOCK_SIZE];
|
u8 K0[SHA1_BLOCK_SIZE];
|
||||||
UINT8 Digest[SHA1_DIGEST_SIZE];
|
u8 Digest[SHA1_DIGEST_SIZE];
|
||||||
UINT index;
|
u32 index;
|
||||||
|
|
||||||
NdisZeroMemory(&sha_ctx1, sizeof(SHA1_CTX_STRUC));
|
NdisZeroMemory(&sha_ctx1, sizeof(SHA1_CTX_STRUC));
|
||||||
NdisZeroMemory(&sha_ctx2, sizeof(SHA1_CTX_STRUC));
|
NdisZeroMemory(&sha_ctx2, sizeof(SHA1_CTX_STRUC));
|
||||||
@ -125,16 +125,16 @@ Note:
|
|||||||
None
|
None
|
||||||
========================================================================
|
========================================================================
|
||||||
*/
|
*/
|
||||||
VOID HMAC_MD5(IN const UINT8 Key[],
|
void HMAC_MD5(IN const u8 Key[],
|
||||||
IN UINT KeyLen,
|
u32 KeyLen,
|
||||||
IN const UINT8 Message[],
|
IN const u8 Message[],
|
||||||
IN UINT MessageLen, OUT UINT8 MAC[], IN UINT MACLen)
|
u32 MessageLen, u8 MAC[], u32 MACLen)
|
||||||
{
|
{
|
||||||
MD5_CTX_STRUC md5_ctx1;
|
MD5_CTX_STRUC md5_ctx1;
|
||||||
MD5_CTX_STRUC md5_ctx2;
|
MD5_CTX_STRUC md5_ctx2;
|
||||||
UINT8 K0[MD5_BLOCK_SIZE];
|
u8 K0[MD5_BLOCK_SIZE];
|
||||||
UINT8 Digest[MD5_DIGEST_SIZE];
|
u8 Digest[MD5_DIGEST_SIZE];
|
||||||
UINT index;
|
u32 index;
|
||||||
|
|
||||||
NdisZeroMemory(&md5_ctx1, sizeof(MD5_CTX_STRUC));
|
NdisZeroMemory(&md5_ctx1, sizeof(MD5_CTX_STRUC));
|
||||||
NdisZeroMemory(&md5_ctx2, 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 ROTL32(x,n) ROTL(x,n,32) /* 32 bits word */
|
||||||
|
|
||||||
#define ROUND1(a, b, c, d, x, s, ac) { \
|
#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) = ROTL32((a),(s)); \
|
||||||
(a) += (b); \
|
(a) += (b); \
|
||||||
}
|
}
|
||||||
#define ROUND2(a, b, c, d, x, s, ac) { \
|
#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) = ROTL32((a),(s)); \
|
||||||
(a) += (b); \
|
(a) += (b); \
|
||||||
}
|
}
|
||||||
#define ROUND3(a, b, c, d, x, s, ac) { \
|
#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) = ROTL32((a),(s)); \
|
||||||
(a) += (b); \
|
(a) += (b); \
|
||||||
}
|
}
|
||||||
#define ROUND4(a, b, c, d, x, s, ac) { \
|
#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) = ROTL32((a),(s)); \
|
||||||
(a) += (b); \
|
(a) += (b); \
|
||||||
}
|
}
|
||||||
static const UINT32 MD5_DefaultHashValue[4] = {
|
static const u32 MD5_DefaultHashValue[4] = {
|
||||||
0x67452301UL, 0xefcdab89UL, 0x98badcfeUL, 0x10325476UL
|
0x67452301UL, 0xefcdab89UL, 0x98badcfeUL, 0x10325476UL
|
||||||
};
|
};
|
||||||
#endif /* MD5_SUPPORT */
|
#endif /* MD5_SUPPORT */
|
||||||
@ -79,7 +79,7 @@ Note:
|
|||||||
None
|
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,
|
NdisMoveMemory(pMD5_CTX->HashValue, MD5_DefaultHashValue,
|
||||||
sizeof(MD5_DefaultHashValue));
|
sizeof(MD5_DefaultHashValue));
|
||||||
@ -103,11 +103,11 @@ Note:
|
|||||||
T[i] := floor(abs(sin(i + 1)) * (2 pow 32)), i is number of round
|
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;
|
u32 X_i;
|
||||||
UINT32 X[16];
|
u32 X[16];
|
||||||
UINT32 a, b, c, d;
|
u32 a, b, c, d;
|
||||||
|
|
||||||
/* Prepare the message schedule, {X_i} */
|
/* Prepare the message schedule, {X_i} */
|
||||||
NdisMoveMemory(X, pMD5_CTX->Block, MD5_BLOCK_SIZE);
|
NdisMoveMemory(X, pMD5_CTX->Block, MD5_BLOCK_SIZE);
|
||||||
@ -238,11 +238,11 @@ Note:
|
|||||||
None
|
None
|
||||||
========================================================================
|
========================================================================
|
||||||
*/
|
*/
|
||||||
VOID MD5_Append(IN MD5_CTX_STRUC * pMD5_CTX,
|
void MD5_Append(IN MD5_CTX_STRUC * pMD5_CTX,
|
||||||
IN const UINT8 Message[], IN UINT MessageLen)
|
IN const u8 Message[], u32 MessageLen)
|
||||||
{
|
{
|
||||||
UINT appendLen = 0;
|
u32 appendLen = 0;
|
||||||
UINT diffLen = 0;
|
u32 diffLen = 0;
|
||||||
|
|
||||||
while (appendLen != MessageLen) {
|
while (appendLen != MessageLen) {
|
||||||
diffLen = MessageLen - appendLen;
|
diffLen = MessageLen - appendLen;
|
||||||
@ -280,10 +280,10 @@ Note:
|
|||||||
None
|
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;
|
u32 index;
|
||||||
UINT64 message_length_bits;
|
u64 message_length_bits;
|
||||||
|
|
||||||
/* append 1 bits to end of the message */
|
/* append 1 bits to end of the message */
|
||||||
NdisFillMemory(pMD5_CTX->Block + pMD5_CTX->BlockLen, 1, 0x80);
|
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);
|
NdisMoveMemory(&pMD5_CTX->Block[56], &message_length_bits, 8);
|
||||||
MD5_Hash(pMD5_CTX);
|
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++)
|
for (index = 0; index < 4; index++)
|
||||||
pMD5_CTX->HashValue[index] =
|
pMD5_CTX->HashValue[index] =
|
||||||
cpu2le32(pMD5_CTX->HashValue[index]);
|
cpu2le32(pMD5_CTX->HashValue[index]);
|
||||||
@ -323,8 +323,8 @@ Note:
|
|||||||
None
|
None
|
||||||
========================================================================
|
========================================================================
|
||||||
*/
|
*/
|
||||||
VOID RT_MD5(IN const UINT8 Message[],
|
void RT_MD5(IN const u8 Message[],
|
||||||
IN UINT MessageLen, OUT UINT8 DigestMessage[])
|
u32 MessageLen, u8 DigestMessage[])
|
||||||
{
|
{
|
||||||
MD5_CTX_STRUC md5_ctx;
|
MD5_CTX_STRUC md5_ctx;
|
||||||
|
|
||||||
|
@ -41,11 +41,11 @@
|
|||||||
#ifdef SHA1_SUPPORT
|
#ifdef SHA1_SUPPORT
|
||||||
/* SHA1 constants */
|
/* SHA1 constants */
|
||||||
#define SHA1_MASK 0x0000000f
|
#define SHA1_MASK 0x0000000f
|
||||||
static const UINT32 SHA1_K[4] = {
|
static const u32 SHA1_K[4] = {
|
||||||
0x5a827999UL, 0x6ed9eba1UL, 0x8f1bbcdcUL, 0xca62c1d6UL
|
0x5a827999UL, 0x6ed9eba1UL, 0x8f1bbcdcUL, 0xca62c1d6UL
|
||||||
};
|
};
|
||||||
|
|
||||||
static const UINT32 SHA1_DefaultHashValue[5] = {
|
static const u32 SHA1_DefaultHashValue[5] = {
|
||||||
0x67452301UL, 0xefcdab89UL, 0x98badcfeUL, 0x10325476UL, 0xc3d2e1f0UL
|
0x67452301UL, 0xefcdab89UL, 0x98badcfeUL, 0x10325476UL, 0xc3d2e1f0UL
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -64,7 +64,7 @@ Note:
|
|||||||
None
|
None
|
||||||
========================================================================
|
========================================================================
|
||||||
*/
|
*/
|
||||||
VOID RT_SHA1_Init(IN SHA1_CTX_STRUC * pSHA_CTX)
|
void RT_SHA1_Init(IN SHA1_CTX_STRUC * pSHA_CTX)
|
||||||
{
|
{
|
||||||
NdisMoveMemory(pSHA_CTX->HashValue, SHA1_DefaultHashValue,
|
NdisMoveMemory(pSHA_CTX->HashValue, SHA1_DefaultHashValue,
|
||||||
sizeof(SHA1_DefaultHashValue));
|
sizeof(SHA1_DefaultHashValue));
|
||||||
@ -88,11 +88,11 @@ Note:
|
|||||||
None
|
None
|
||||||
========================================================================
|
========================================================================
|
||||||
*/
|
*/
|
||||||
VOID SHA1_Hash(IN SHA1_CTX_STRUC * pSHA_CTX)
|
void SHA1_Hash(IN SHA1_CTX_STRUC * pSHA_CTX)
|
||||||
{
|
{
|
||||||
UINT32 W_i, t, s;
|
u32 W_i, t, s;
|
||||||
UINT32 W[16];
|
u32 W[16];
|
||||||
UINT32 a, b, c, d, e, T, f_t = 0;
|
u32 a, b, c, d, e, T, f_t = 0;
|
||||||
|
|
||||||
/* Prepare the message schedule, {W_i}, 0 < t < 15 */
|
/* Prepare the message schedule, {W_i}, 0 < t < 15 */
|
||||||
NdisMoveMemory(W, pSHA_CTX->Block, SHA1_BLOCK_SIZE);
|
NdisMoveMemory(W, pSHA_CTX->Block, SHA1_BLOCK_SIZE);
|
||||||
@ -168,11 +168,11 @@ Note:
|
|||||||
None
|
None
|
||||||
========================================================================
|
========================================================================
|
||||||
*/
|
*/
|
||||||
VOID SHA1_Append(IN SHA1_CTX_STRUC * pSHA_CTX,
|
void SHA1_Append(IN SHA1_CTX_STRUC * pSHA_CTX,
|
||||||
IN const UINT8 Message[], IN UINT MessageLen)
|
IN const u8 Message[], u32 MessageLen)
|
||||||
{
|
{
|
||||||
UINT appendLen = 0;
|
u32 appendLen = 0;
|
||||||
UINT diffLen = 0;
|
u32 diffLen = 0;
|
||||||
|
|
||||||
while (appendLen != MessageLen) {
|
while (appendLen != MessageLen) {
|
||||||
diffLen = MessageLen - appendLen;
|
diffLen = MessageLen - appendLen;
|
||||||
@ -210,10 +210,10 @@ Note:
|
|||||||
None
|
None
|
||||||
========================================================================
|
========================================================================
|
||||||
*/
|
*/
|
||||||
VOID SHA1_End(IN SHA1_CTX_STRUC * pSHA_CTX, OUT UINT8 DigestMessage[])
|
void SHA1_End(IN SHA1_CTX_STRUC * pSHA_CTX, u8 DigestMessage[])
|
||||||
{
|
{
|
||||||
UINT index;
|
u32 index;
|
||||||
UINT64 message_length_bits;
|
u64 message_length_bits;
|
||||||
|
|
||||||
/* Append bit 1 to end of the message */
|
/* Append bit 1 to end of the message */
|
||||||
NdisFillMemory(pSHA_CTX->Block + pSHA_CTX->BlockLen, 1, 0x80);
|
NdisFillMemory(pSHA_CTX->Block + pSHA_CTX->BlockLen, 1, 0x80);
|
||||||
@ -229,7 +229,7 @@ VOID SHA1_End(IN SHA1_CTX_STRUC * pSHA_CTX, OUT UINT8 DigestMessage[])
|
|||||||
NdisMoveMemory(&pSHA_CTX->Block[56], &message_length_bits, 8);
|
NdisMoveMemory(&pSHA_CTX->Block[56], &message_length_bits, 8);
|
||||||
SHA1_Hash(pSHA_CTX);
|
SHA1_Hash(pSHA_CTX);
|
||||||
|
|
||||||
/* Return message digest, transform the UINT32 hash value to bytes */
|
/* Return message digest, transform the u32 hash value to bytes */
|
||||||
for (index = 0; index < 5; index++)
|
for (index = 0; index < 5; index++)
|
||||||
pSHA_CTX->HashValue[index] =
|
pSHA_CTX->HashValue[index] =
|
||||||
cpu2be32(pSHA_CTX->HashValue[index]);
|
cpu2be32(pSHA_CTX->HashValue[index]);
|
||||||
@ -253,8 +253,8 @@ Note:
|
|||||||
None
|
None
|
||||||
========================================================================
|
========================================================================
|
||||||
*/
|
*/
|
||||||
VOID RT_SHA1(IN const UINT8 Message[],
|
void RT_SHA1(IN const u8 Message[],
|
||||||
IN UINT MessageLen, OUT UINT8 DigestMessage[])
|
u32 MessageLen, u8 DigestMessage[])
|
||||||
{
|
{
|
||||||
|
|
||||||
SHA1_CTX_STRUC sha_ctx;
|
SHA1_CTX_STRUC sha_ctx;
|
||||||
|
@ -52,9 +52,9 @@
|
|||||||
|
|
||||||
========================================================================
|
========================================================================
|
||||||
*/
|
*/
|
||||||
BOOLEAN RadarChannelCheck(IN PRTMP_ADAPTER pAd, IN UCHAR Ch)
|
BOOLEAN RadarChannelCheck(IN PRTMP_ADAPTER pAd, u8 Ch)
|
||||||
{
|
{
|
||||||
INT i;
|
int i;
|
||||||
BOOLEAN result = FALSE;
|
BOOLEAN result = FALSE;
|
||||||
|
|
||||||
for (i = 0; i < pAd->ChannelListNum; i++) {
|
for (i = 0; i < pAd->ChannelListNum; i++) {
|
||||||
|
@ -48,16 +48,16 @@
|
|||||||
|
|
||||||
typedef union _EFUSE_CTRL_STRUC {
|
typedef union _EFUSE_CTRL_STRUC {
|
||||||
struct {
|
struct {
|
||||||
UINT32 EFSROM_AOUT:6;
|
u32 EFSROM_AOUT:6;
|
||||||
UINT32 EFSROM_MODE:2;
|
u32 EFSROM_MODE:2;
|
||||||
UINT32 EFSROM_LDO_OFF_TIME:6;
|
u32 EFSROM_LDO_OFF_TIME:6;
|
||||||
UINT32 EFSROM_LDO_ON_TIME:2;
|
u32 EFSROM_LDO_ON_TIME:2;
|
||||||
UINT32 EFSROM_AIN:10;
|
u32 EFSROM_AIN:10;
|
||||||
UINT32 RESERVED:4;
|
u32 RESERVED:4;
|
||||||
UINT32 EFSROM_KICK:1;
|
u32 EFSROM_KICK:1;
|
||||||
UINT32 SEL_EFUSE:1;
|
u32 SEL_EFUSE:1;
|
||||||
} field;
|
} field;
|
||||||
UINT32 word;
|
u32 word;
|
||||||
} EFUSE_CTRL_STRUC, *PEFUSE_CTRL_STRUC;
|
} EFUSE_CTRL_STRUC, *PEFUSE_CTRL_STRUC;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -73,13 +73,13 @@ typedef union _EFUSE_CTRL_STRUC {
|
|||||||
|
|
||||||
========================================================================
|
========================================================================
|
||||||
*/
|
*/
|
||||||
UCHAR eFuseReadRegisters(IN PRTMP_ADAPTER pAd,
|
u8 eFuseReadRegisters(IN PRTMP_ADAPTER pAd,
|
||||||
IN USHORT Offset, IN USHORT Length, OUT USHORT * pData)
|
u16 Offset, u16 Length, u16 * pData)
|
||||||
{
|
{
|
||||||
EFUSE_CTRL_STRUC eFuseCtrlStruc;
|
EFUSE_CTRL_STRUC eFuseCtrlStruc;
|
||||||
int i;
|
int i;
|
||||||
USHORT efuseDataOffset;
|
u16 efuseDataOffset;
|
||||||
UINT32 data;
|
u32 data;
|
||||||
|
|
||||||
RTMP_IO_READ32(pAd, EFUSE_CTRL, &eFuseCtrlStruc.word);
|
RTMP_IO_READ32(pAd, EFUSE_CTRL, &eFuseCtrlStruc.word);
|
||||||
|
|
||||||
@ -132,7 +132,7 @@ UCHAR eFuseReadRegisters(IN PRTMP_ADAPTER pAd,
|
|||||||
NdisMoveMemory(pData, &data, Length);
|
NdisMoveMemory(pData, &data, Length);
|
||||||
}
|
}
|
||||||
|
|
||||||
return (UCHAR) eFuseCtrlStruc.field.EFSROM_AOUT;
|
return (u8)eFuseCtrlStruc.field.EFSROM_AOUT;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -149,14 +149,14 @@ UCHAR eFuseReadRegisters(IN PRTMP_ADAPTER pAd,
|
|||||||
|
|
||||||
========================================================================
|
========================================================================
|
||||||
*/
|
*/
|
||||||
VOID eFusePhysicalReadRegisters(IN PRTMP_ADAPTER pAd,
|
void eFusePhysicalReadRegisters(IN PRTMP_ADAPTER pAd,
|
||||||
IN USHORT Offset,
|
u16 Offset,
|
||||||
IN USHORT Length, OUT USHORT * pData)
|
u16 Length, u16 * pData)
|
||||||
{
|
{
|
||||||
EFUSE_CTRL_STRUC eFuseCtrlStruc;
|
EFUSE_CTRL_STRUC eFuseCtrlStruc;
|
||||||
int i;
|
int i;
|
||||||
USHORT efuseDataOffset;
|
u16 efuseDataOffset;
|
||||||
UINT32 data;
|
u32 data;
|
||||||
|
|
||||||
RTMP_IO_READ32(pAd, EFUSE_CTRL, &eFuseCtrlStruc.word);
|
RTMP_IO_READ32(pAd, EFUSE_CTRL, &eFuseCtrlStruc.word);
|
||||||
|
|
||||||
@ -214,16 +214,16 @@ VOID eFusePhysicalReadRegisters(IN PRTMP_ADAPTER pAd,
|
|||||||
|
|
||||||
========================================================================
|
========================================================================
|
||||||
*/
|
*/
|
||||||
static VOID eFuseReadPhysical(IN PRTMP_ADAPTER pAd,
|
static void eFuseReadPhysical(IN PRTMP_ADAPTER pAd,
|
||||||
IN PUSHORT lpInBuffer,
|
u16 *lpInBuffer,
|
||||||
IN ULONG nInBufferSize,
|
unsigned long nInBufferSize,
|
||||||
OUT PUSHORT lpOutBuffer, IN ULONG nOutBufferSize)
|
u16 *lpOutBuffer, unsigned long nOutBufferSize)
|
||||||
{
|
{
|
||||||
USHORT *pInBuf = (USHORT *) lpInBuffer;
|
u16 *pInBuf = (u16 *) lpInBuffer;
|
||||||
USHORT *pOutBuf = (USHORT *) lpOutBuffer;
|
u16 *pOutBuf = (u16 *) lpOutBuffer;
|
||||||
|
|
||||||
USHORT Offset = pInBuf[0]; /*addr */
|
u16 Offset = pInBuf[0]; /*addr */
|
||||||
USHORT Length = pInBuf[1]; /*length */
|
u16 Length = pInBuf[1]; /*length */
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
for (i = 0; i < Length; i += 2) {
|
for (i = 0; i < Length; i += 2) {
|
||||||
@ -244,20 +244,20 @@ static VOID eFuseReadPhysical(IN PRTMP_ADAPTER pAd,
|
|||||||
|
|
||||||
========================================================================
|
========================================================================
|
||||||
*/
|
*/
|
||||||
INT set_eFuseGetFreeBlockCount_Proc(IN PRTMP_ADAPTER pAd, IN PSTRING arg)
|
int set_eFuseGetFreeBlockCount_Proc(IN PRTMP_ADAPTER pAd, char *arg)
|
||||||
{
|
{
|
||||||
USHORT i;
|
u16 i;
|
||||||
USHORT LogicalAddress;
|
u16 LogicalAddress;
|
||||||
USHORT efusefreenum = 0;
|
u16 efusefreenum = 0;
|
||||||
if (!pAd->bUseEfuse)
|
if (!pAd->bUseEfuse)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
for (i = EFUSE_USAGE_MAP_START; i <= EFUSE_USAGE_MAP_END; i += 2) {
|
for (i = EFUSE_USAGE_MAP_START; i <= EFUSE_USAGE_MAP_END; i += 2) {
|
||||||
eFusePhysicalReadRegisters(pAd, i, 2, &LogicalAddress);
|
eFusePhysicalReadRegisters(pAd, i, 2, &LogicalAddress);
|
||||||
if ((LogicalAddress & 0xff) == 0) {
|
if ((LogicalAddress & 0xff) == 0) {
|
||||||
efusefreenum = (UCHAR) (EFUSE_USAGE_MAP_END - i + 1);
|
efusefreenum = (u8)(EFUSE_USAGE_MAP_END - i + 1);
|
||||||
break;
|
break;
|
||||||
} else if (((LogicalAddress >> 8) & 0xff) == 0) {
|
} else if (((LogicalAddress >> 8) & 0xff) == 0) {
|
||||||
efusefreenum = (UCHAR) (EFUSE_USAGE_MAP_END - i);
|
efusefreenum = (u8)(EFUSE_USAGE_MAP_END - i);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -268,10 +268,10 @@ INT set_eFuseGetFreeBlockCount_Proc(IN PRTMP_ADAPTER pAd, IN PSTRING arg)
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
INT set_eFusedump_Proc(IN PRTMP_ADAPTER pAd, IN PSTRING arg)
|
int set_eFusedump_Proc(IN PRTMP_ADAPTER pAd, char *arg)
|
||||||
{
|
{
|
||||||
USHORT InBuf[3];
|
u16 InBuf[3];
|
||||||
INT i = 0;
|
int i = 0;
|
||||||
if (!pAd->bUseEfuse)
|
if (!pAd->bUseEfuse)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
for (i = 0; i < EFUSE_USAGE_MAP_END / 2; i++) {
|
for (i = 0; i < EFUSE_USAGE_MAP_END / 2; i++) {
|
||||||
@ -288,7 +288,7 @@ INT set_eFusedump_Proc(IN PRTMP_ADAPTER pAd, IN PSTRING arg)
|
|||||||
}
|
}
|
||||||
|
|
||||||
int rtmp_ee_efuse_read16(IN RTMP_ADAPTER * pAd,
|
int rtmp_ee_efuse_read16(IN RTMP_ADAPTER * pAd,
|
||||||
IN USHORT Offset, OUT USHORT * pValue)
|
u16 Offset, u16 * pValue)
|
||||||
{
|
{
|
||||||
eFuseReadRegisters(pAd, Offset, 2, pValue);
|
eFuseReadRegisters(pAd, Offset, 2, pValue);
|
||||||
return (*pValue);
|
return (*pValue);
|
||||||
@ -296,7 +296,7 @@ int rtmp_ee_efuse_read16(IN RTMP_ADAPTER * pAd,
|
|||||||
|
|
||||||
int RtmpEfuseSupportCheck(IN RTMP_ADAPTER * pAd)
|
int RtmpEfuseSupportCheck(IN RTMP_ADAPTER * pAd)
|
||||||
{
|
{
|
||||||
USHORT value;
|
u16 value;
|
||||||
|
|
||||||
if (IS_RT30xx(pAd)) {
|
if (IS_RT30xx(pAd)) {
|
||||||
eFusePhysicalReadRegisters(pAd, EFUSE_TAG, 2, &value);
|
eFusePhysicalReadRegisters(pAd, EFUSE_TAG, 2, &value);
|
||||||
@ -305,10 +305,10 @@ int RtmpEfuseSupportCheck(IN RTMP_ADAPTER * pAd)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID eFuseGetFreeBlockCount(IN PRTMP_ADAPTER pAd, PUINT EfuseFreeBlock)
|
void eFuseGetFreeBlockCount(IN PRTMP_ADAPTER pAd, u32 *EfuseFreeBlock)
|
||||||
{
|
{
|
||||||
USHORT i;
|
u16 i;
|
||||||
USHORT LogicalAddress;
|
u16 LogicalAddress;
|
||||||
if (!pAd->bUseEfuse) {
|
if (!pAd->bUseEfuse) {
|
||||||
DBGPRINT(RT_DEBUG_TRACE,
|
DBGPRINT(RT_DEBUG_TRACE,
|
||||||
("eFuseGetFreeBlockCount Only supports efuse Mode\n"));
|
("eFuseGetFreeBlockCount Only supports efuse Mode\n"));
|
||||||
@ -317,10 +317,10 @@ VOID eFuseGetFreeBlockCount(IN PRTMP_ADAPTER pAd, PUINT EfuseFreeBlock)
|
|||||||
for (i = EFUSE_USAGE_MAP_START; i <= EFUSE_USAGE_MAP_END; i += 2) {
|
for (i = EFUSE_USAGE_MAP_START; i <= EFUSE_USAGE_MAP_END; i += 2) {
|
||||||
eFusePhysicalReadRegisters(pAd, i, 2, &LogicalAddress);
|
eFusePhysicalReadRegisters(pAd, i, 2, &LogicalAddress);
|
||||||
if ((LogicalAddress & 0xff) == 0) {
|
if ((LogicalAddress & 0xff) == 0) {
|
||||||
*EfuseFreeBlock = (UCHAR) (EFUSE_USAGE_MAP_END - i + 1);
|
*EfuseFreeBlock = (u8)(EFUSE_USAGE_MAP_END - i + 1);
|
||||||
break;
|
break;
|
||||||
} else if (((LogicalAddress >> 8) & 0xff) == 0) {
|
} else if (((LogicalAddress >> 8) & 0xff) == 0) {
|
||||||
*EfuseFreeBlock = (UCHAR) (EFUSE_USAGE_MAP_END - i);
|
*EfuseFreeBlock = (u8)(EFUSE_USAGE_MAP_END - i);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -331,9 +331,9 @@ VOID eFuseGetFreeBlockCount(IN PRTMP_ADAPTER pAd, PUINT EfuseFreeBlock)
|
|||||||
("eFuseGetFreeBlockCount is 0x%x\n", *EfuseFreeBlock));
|
("eFuseGetFreeBlockCount is 0x%x\n", *EfuseFreeBlock));
|
||||||
}
|
}
|
||||||
|
|
||||||
INT eFuse_init(IN PRTMP_ADAPTER pAd)
|
int eFuse_init(IN PRTMP_ADAPTER pAd)
|
||||||
{
|
{
|
||||||
UINT EfuseFreeBlock = 0;
|
u32 EfuseFreeBlock = 0;
|
||||||
DBGPRINT(RT_DEBUG_ERROR,
|
DBGPRINT(RT_DEBUG_ERROR,
|
||||||
("NVM is Efuse and its size =%x[%x-%x] \n",
|
("NVM is Efuse and its size =%x[%x-%x] \n",
|
||||||
EFUSE_USAGE_MAP_SIZE, EFUSE_USAGE_MAP_START,
|
EFUSE_USAGE_MAP_SIZE, EFUSE_USAGE_MAP_START,
|
||||||
|
@ -38,7 +38,7 @@
|
|||||||
#include "../rt_config.h"
|
#include "../rt_config.h"
|
||||||
|
|
||||||
/* IRQL = PASSIVE_LEVEL */
|
/* IRQL = PASSIVE_LEVEL */
|
||||||
static inline VOID RaiseClock(IN PRTMP_ADAPTER pAd, IN UINT32 * x)
|
static inline void RaiseClock(IN PRTMP_ADAPTER pAd, u32 * x)
|
||||||
{
|
{
|
||||||
*x = *x | EESK;
|
*x = *x | EESK;
|
||||||
RTMP_IO_WRITE32(pAd, E2PROM_CSR, *x);
|
RTMP_IO_WRITE32(pAd, E2PROM_CSR, *x);
|
||||||
@ -46,7 +46,7 @@ static inline VOID RaiseClock(IN PRTMP_ADAPTER pAd, IN UINT32 * x)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* IRQL = PASSIVE_LEVEL */
|
/* IRQL = PASSIVE_LEVEL */
|
||||||
static inline VOID LowerClock(IN PRTMP_ADAPTER pAd, IN UINT32 * x)
|
static inline void LowerClock(IN PRTMP_ADAPTER pAd, u32 * x)
|
||||||
{
|
{
|
||||||
*x = *x & ~EESK;
|
*x = *x & ~EESK;
|
||||||
RTMP_IO_WRITE32(pAd, E2PROM_CSR, *x);
|
RTMP_IO_WRITE32(pAd, E2PROM_CSR, *x);
|
||||||
@ -54,10 +54,10 @@ static inline VOID LowerClock(IN PRTMP_ADAPTER pAd, IN UINT32 * x)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* IRQL = PASSIVE_LEVEL */
|
/* IRQL = PASSIVE_LEVEL */
|
||||||
static inline USHORT ShiftInBits(IN PRTMP_ADAPTER pAd)
|
static inline u16 ShiftInBits(IN PRTMP_ADAPTER pAd)
|
||||||
{
|
{
|
||||||
UINT32 x, i;
|
u32 x, i;
|
||||||
USHORT data = 0;
|
u16 data = 0;
|
||||||
|
|
||||||
RTMP_IO_READ32(pAd, E2PROM_CSR, &x);
|
RTMP_IO_READ32(pAd, E2PROM_CSR, &x);
|
||||||
|
|
||||||
@ -79,10 +79,10 @@ static inline USHORT ShiftInBits(IN PRTMP_ADAPTER pAd)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* IRQL = PASSIVE_LEVEL */
|
/* IRQL = PASSIVE_LEVEL */
|
||||||
static inline VOID ShiftOutBits(IN PRTMP_ADAPTER pAd,
|
static inline void ShiftOutBits(IN PRTMP_ADAPTER pAd,
|
||||||
IN USHORT data, IN USHORT count)
|
u16 data, u16 count)
|
||||||
{
|
{
|
||||||
UINT32 x, mask;
|
u32 x, mask;
|
||||||
|
|
||||||
mask = 0x01 << (count - 1);
|
mask = 0x01 << (count - 1);
|
||||||
RTMP_IO_READ32(pAd, E2PROM_CSR, &x);
|
RTMP_IO_READ32(pAd, E2PROM_CSR, &x);
|
||||||
@ -107,9 +107,9 @@ static inline VOID ShiftOutBits(IN PRTMP_ADAPTER pAd,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* IRQL = PASSIVE_LEVEL */
|
/* IRQL = PASSIVE_LEVEL */
|
||||||
static inline VOID EEpromCleanup(IN PRTMP_ADAPTER pAd)
|
static inline void EEpromCleanup(IN PRTMP_ADAPTER pAd)
|
||||||
{
|
{
|
||||||
UINT32 x;
|
u32 x;
|
||||||
|
|
||||||
RTMP_IO_READ32(pAd, E2PROM_CSR, &x);
|
RTMP_IO_READ32(pAd, E2PROM_CSR, &x);
|
||||||
|
|
||||||
@ -120,9 +120,9 @@ static inline VOID EEpromCleanup(IN PRTMP_ADAPTER pAd)
|
|||||||
LowerClock(pAd, &x);
|
LowerClock(pAd, &x);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline VOID EWEN(IN PRTMP_ADAPTER pAd)
|
static inline void EWEN(IN PRTMP_ADAPTER pAd)
|
||||||
{
|
{
|
||||||
UINT32 x;
|
u32 x;
|
||||||
|
|
||||||
/* reset bits and set EECS */
|
/* reset bits and set EECS */
|
||||||
RTMP_IO_READ32(pAd, E2PROM_CSR, &x);
|
RTMP_IO_READ32(pAd, E2PROM_CSR, &x);
|
||||||
@ -141,9 +141,9 @@ static inline VOID EWEN(IN PRTMP_ADAPTER pAd)
|
|||||||
EEpromCleanup(pAd);
|
EEpromCleanup(pAd);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline VOID EWDS(IN PRTMP_ADAPTER pAd)
|
static inline void EWDS(IN PRTMP_ADAPTER pAd)
|
||||||
{
|
{
|
||||||
UINT32 x;
|
u32 x;
|
||||||
|
|
||||||
/* reset bits and set EECS */
|
/* reset bits and set EECS */
|
||||||
RTMP_IO_READ32(pAd, E2PROM_CSR, &x);
|
RTMP_IO_READ32(pAd, E2PROM_CSR, &x);
|
||||||
@ -164,10 +164,10 @@ static inline VOID EWDS(IN PRTMP_ADAPTER pAd)
|
|||||||
|
|
||||||
/* IRQL = PASSIVE_LEVEL */
|
/* IRQL = PASSIVE_LEVEL */
|
||||||
int rtmp_ee_prom_read16(IN PRTMP_ADAPTER pAd,
|
int rtmp_ee_prom_read16(IN PRTMP_ADAPTER pAd,
|
||||||
IN USHORT Offset, OUT USHORT * pValue)
|
u16 Offset, u16 * pValue)
|
||||||
{
|
{
|
||||||
UINT32 x;
|
u32 x;
|
||||||
USHORT data;
|
u16 data;
|
||||||
|
|
||||||
Offset /= 2;
|
Offset /= 2;
|
||||||
/* reset bits and set EECS */
|
/* reset bits and set EECS */
|
||||||
|
@ -36,12 +36,12 @@
|
|||||||
*/
|
*/
|
||||||
#include "../rt_config.h"
|
#include "../rt_config.h"
|
||||||
|
|
||||||
INT RtmpChipOpsEepromHook(IN RTMP_ADAPTER * pAd, IN INT infType)
|
int RtmpChipOpsEepromHook(IN RTMP_ADAPTER * pAd, int infType)
|
||||||
{
|
{
|
||||||
RTMP_CHIP_OP *pChipOps = &pAd->chipOps;
|
RTMP_CHIP_OP *pChipOps = &pAd->chipOps;
|
||||||
#ifdef RT30xx
|
#ifdef RT30xx
|
||||||
#ifdef RTMP_EFUSE_SUPPORT
|
#ifdef RTMP_EFUSE_SUPPORT
|
||||||
UINT32 eFuseCtrl, MacCsr0;
|
u32 eFuseCtrl, MacCsr0;
|
||||||
int index;
|
int index;
|
||||||
|
|
||||||
index = 0;
|
index = 0;
|
||||||
|
@ -43,7 +43,7 @@
|
|||||||
/* AUTO GEN PLEASE DO NOT MODIFY IT */
|
/* AUTO GEN PLEASE DO NOT MODIFY IT */
|
||||||
|
|
||||||
|
|
||||||
UCHAR FirmwareImage_2860 [] = {
|
u8 FirmwareImage_2860 [] = {
|
||||||
0x02, 0x03, 0x5e, 0x02, 0x02, 0xb1, 0x22, 0x22, 0xff, 0xff, 0xff, 0x02, 0x01, 0x82, 0xff, 0xff,
|
0x02, 0x03, 0x5e, 0x02, 0x02, 0xb1, 0x22, 0x22, 0xff, 0xff, 0xff, 0x02, 0x01, 0x82, 0xff, 0xff,
|
||||||
0xff, 0xff, 0xff, 0x02, 0x00, 0x1e, 0xff, 0xff, 0xff, 0xff, 0xff, 0x02, 0x01, 0x33, 0xc0, 0xe0,
|
0xff, 0xff, 0xff, 0x02, 0x00, 0x1e, 0xff, 0xff, 0xff, 0xff, 0xff, 0x02, 0x01, 0x33, 0xc0, 0xe0,
|
||||||
0xc0, 0xf0, 0xc0, 0x83, 0xc0, 0x82, 0xc0, 0xd0, 0x75, 0xd0, 0x18, 0xc2, 0xaf, 0x30, 0x45, 0x03,
|
0xc0, 0xf0, 0xc0, 0x83, 0xc0, 0x82, 0xc0, 0xd0, 0x75, 0xd0, 0x18, 0xc2, 0xaf, 0x30, 0x45, 0x03,
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
/* AUTO GEN PLEASE DO NOT MODIFY IT */
|
/* AUTO GEN PLEASE DO NOT MODIFY IT */
|
||||||
|
|
||||||
|
|
||||||
UCHAR FirmwareImage_3070 [] = {
|
u8 FirmwareImage_3070 [] = {
|
||||||
0xff, 0xff, 0xff, 0x02, 0x10, 0x28, 0x02, 0x10, 0x32, 0x02, 0x10, 0x78, 0x02, 0x13, 0x1f, 0x02,
|
0xff, 0xff, 0xff, 0x02, 0x10, 0x28, 0x02, 0x10, 0x32, 0x02, 0x10, 0x78, 0x02, 0x13, 0x1f, 0x02,
|
||||||
0x13, 0x20, 0x02, 0x13, 0x3f, 0x02, 0x13, 0x44, 0x12, 0x13, 0x40, 0x22, 0x02, 0x17, 0xae, 0x02,
|
0x13, 0x20, 0x02, 0x13, 0x3f, 0x02, 0x13, 0x44, 0x12, 0x13, 0x40, 0x22, 0x02, 0x17, 0xae, 0x02,
|
||||||
0x18, 0xd2, 0x02, 0x14, 0x3d, 0x02, 0x13, 0x78, 0x30, 0x05, 0x06, 0x20, 0x0d, 0x03, 0x12, 0x19,
|
0x18, 0xd2, 0x02, 0x14, 0x3d, 0x02, 0x13, 0x78, 0x30, 0x05, 0x06, 0x20, 0x0d, 0x03, 0x12, 0x19,
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -144,7 +144,7 @@ CH_FREQ_MAP CH_HZ_ID_MAP[] = {
|
|||||||
, /* Japan, means J16 */
|
, /* Japan, means J16 */
|
||||||
};
|
};
|
||||||
|
|
||||||
INT CH_HZ_ID_MAP_NUM = (sizeof(CH_HZ_ID_MAP) / sizeof(CH_FREQ_MAP));
|
int CH_HZ_ID_MAP_NUM = (sizeof(CH_HZ_ID_MAP) / sizeof(CH_FREQ_MAP));
|
||||||
|
|
||||||
CH_REGION ChRegion[] = {
|
CH_REGION ChRegion[] = {
|
||||||
{ /* Antigua and Berbuda */
|
{ /* Antigua and Berbuda */
|
||||||
@ -1422,14 +1422,14 @@ CH_REGION ChRegion[] = {
|
|||||||
,
|
,
|
||||||
};
|
};
|
||||||
|
|
||||||
static PCH_REGION GetChRegion(IN PUCHAR CntryCode)
|
static PCH_REGION GetChRegion(u8 *CntryCode)
|
||||||
{
|
{
|
||||||
INT loop = 0;
|
int loop = 0;
|
||||||
PCH_REGION pChRegion = NULL;
|
PCH_REGION pChRegion = NULL;
|
||||||
|
|
||||||
while (strcmp((PSTRING) ChRegion[loop].CountReg, "") != 0) {
|
while (strcmp((char *)ChRegion[loop].CountReg, "") != 0) {
|
||||||
if (strncmp
|
if (strncmp
|
||||||
((PSTRING) ChRegion[loop].CountReg, (PSTRING) CntryCode,
|
((char *)ChRegion[loop].CountReg, (char *)CntryCode,
|
||||||
2) == 0) {
|
2) == 0) {
|
||||||
pChRegion = &ChRegion[loop];
|
pChRegion = &ChRegion[loop];
|
||||||
break;
|
break;
|
||||||
@ -1442,7 +1442,7 @@ static PCH_REGION GetChRegion(IN PUCHAR CntryCode)
|
|||||||
return pChRegion;
|
return pChRegion;
|
||||||
}
|
}
|
||||||
|
|
||||||
static VOID ChBandCheck(IN UCHAR PhyMode, OUT PUCHAR pChType)
|
static void ChBandCheck(u8 PhyMode, u8 *pChType)
|
||||||
{
|
{
|
||||||
switch (PhyMode) {
|
switch (PhyMode) {
|
||||||
case PHY_11A:
|
case PHY_11A:
|
||||||
@ -1461,12 +1461,12 @@ static VOID ChBandCheck(IN UCHAR PhyMode, OUT PUCHAR pChType)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static UCHAR FillChList(IN PRTMP_ADAPTER pAd,
|
static u8 FillChList(IN PRTMP_ADAPTER pAd,
|
||||||
IN PCH_DESP pChDesp,
|
IN PCH_DESP pChDesp,
|
||||||
IN UCHAR Offset, IN UCHAR increment)
|
u8 Offset, u8 increment)
|
||||||
{
|
{
|
||||||
INT i, j, l;
|
int i, j, l;
|
||||||
UCHAR channel;
|
u8 channel;
|
||||||
|
|
||||||
j = Offset;
|
j = Offset;
|
||||||
for (i = 0; i < pChDesp->NumOfCh; i++) {
|
for (i = 0; i < pChDesp->NumOfCh; i++) {
|
||||||
@ -1494,14 +1494,14 @@ static UCHAR FillChList(IN PRTMP_ADAPTER pAd,
|
|||||||
return j;
|
return j;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline VOID CreateChList(IN PRTMP_ADAPTER pAd,
|
static inline void CreateChList(IN PRTMP_ADAPTER pAd,
|
||||||
IN PCH_REGION pChRegion, IN UCHAR Geography)
|
IN PCH_REGION pChRegion, u8 Geography)
|
||||||
{
|
{
|
||||||
INT i;
|
int i;
|
||||||
UCHAR offset = 0;
|
u8 offset = 0;
|
||||||
PCH_DESP pChDesp;
|
PCH_DESP pChDesp;
|
||||||
UCHAR ChType;
|
u8 ChType;
|
||||||
UCHAR increment;
|
u8 increment;
|
||||||
|
|
||||||
if (pChRegion == NULL)
|
if (pChRegion == NULL)
|
||||||
return;
|
return;
|
||||||
@ -1532,7 +1532,7 @@ static inline VOID CreateChList(IN PRTMP_ADAPTER pAd,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID BuildChannelListEx(IN PRTMP_ADAPTER pAd)
|
void BuildChannelListEx(IN PRTMP_ADAPTER pAd)
|
||||||
{
|
{
|
||||||
PCH_REGION pChReg;
|
PCH_REGION pChReg;
|
||||||
|
|
||||||
@ -1540,14 +1540,14 @@ VOID BuildChannelListEx(IN PRTMP_ADAPTER pAd)
|
|||||||
CreateChList(pAd, pChReg, pAd->CommonCfg.Geography);
|
CreateChList(pAd, pChReg, pAd->CommonCfg.Geography);
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID BuildBeaconChList(IN PRTMP_ADAPTER pAd,
|
void BuildBeaconChList(IN PRTMP_ADAPTER pAd,
|
||||||
OUT PUCHAR pBuf, OUT PULONG pBufLen)
|
u8 *pBuf, unsigned long *pBufLen)
|
||||||
{
|
{
|
||||||
INT i;
|
int i;
|
||||||
ULONG TmpLen;
|
unsigned long TmpLen;
|
||||||
PCH_REGION pChRegion;
|
PCH_REGION pChRegion;
|
||||||
PCH_DESP pChDesp;
|
PCH_DESP pChDesp;
|
||||||
UCHAR ChType;
|
u8 ChType;
|
||||||
|
|
||||||
pChRegion = GetChRegion(pAd->CommonCfg.CountryCode);
|
pChRegion = GetChRegion(pAd->CommonCfg.CountryCode);
|
||||||
|
|
||||||
@ -1581,9 +1581,9 @@ VOID BuildBeaconChList(IN PRTMP_ADAPTER pAd,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static BOOLEAN IsValidChannel(IN PRTMP_ADAPTER pAd, IN UCHAR channel)
|
static BOOLEAN IsValidChannel(IN PRTMP_ADAPTER pAd, u8 channel)
|
||||||
{
|
{
|
||||||
INT i;
|
int i;
|
||||||
|
|
||||||
for (i = 0; i < pAd->ChannelListNum; i++) {
|
for (i = 0; i < pAd->ChannelListNum; i++) {
|
||||||
if (pAd->ChannelList[i].Channel == channel)
|
if (pAd->ChannelList[i].Channel == channel)
|
||||||
@ -1596,9 +1596,9 @@ static BOOLEAN IsValidChannel(IN PRTMP_ADAPTER pAd, IN UCHAR channel)
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static UCHAR GetExtCh(IN UCHAR Channel, IN UCHAR Direction)
|
static u8 GetExtCh(u8 Channel, u8 Direction)
|
||||||
{
|
{
|
||||||
CHAR ExtCh;
|
char ExtCh;
|
||||||
|
|
||||||
if (Direction == EXTCHA_ABOVE)
|
if (Direction == EXTCHA_ABOVE)
|
||||||
ExtCh = Channel + 4;
|
ExtCh = Channel + 4;
|
||||||
@ -1608,10 +1608,10 @@ static UCHAR GetExtCh(IN UCHAR Channel, IN UCHAR Direction)
|
|||||||
return ExtCh;
|
return ExtCh;
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID N_ChannelCheck(IN PRTMP_ADAPTER pAd)
|
void N_ChannelCheck(IN PRTMP_ADAPTER pAd)
|
||||||
{
|
{
|
||||||
/*UCHAR ChannelNum = pAd->ChannelListNum; */
|
/*u8 ChannelNum = pAd->ChannelListNum; */
|
||||||
UCHAR Channel = pAd->CommonCfg.Channel;
|
u8 Channel = pAd->CommonCfg.Channel;
|
||||||
|
|
||||||
if ((pAd->CommonCfg.PhyMode >= PHY_11ABGN_MIXED)
|
if ((pAd->CommonCfg.PhyMode >= PHY_11ABGN_MIXED)
|
||||||
&& (pAd->CommonCfg.RegTransmitSetting.field.BW == BW_40)) {
|
&& (pAd->CommonCfg.RegTransmitSetting.field.BW == BW_40)) {
|
||||||
@ -1638,8 +1638,8 @@ VOID N_ChannelCheck(IN PRTMP_ADAPTER pAd)
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
do {
|
do {
|
||||||
UCHAR ExtCh;
|
u8 ExtCh;
|
||||||
UCHAR Dir =
|
u8 Dir =
|
||||||
pAd->CommonCfg.RegTransmitSetting.field.
|
pAd->CommonCfg.RegTransmitSetting.field.
|
||||||
EXTCHA;
|
EXTCHA;
|
||||||
ExtCh = GetExtCh(Channel, Dir);
|
ExtCh = GetExtCh(Channel, Dir);
|
||||||
@ -1670,7 +1670,7 @@ VOID N_ChannelCheck(IN PRTMP_ADAPTER pAd)
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID N_SetCenCh(IN PRTMP_ADAPTER pAd)
|
void N_SetCenCh(IN PRTMP_ADAPTER pAd)
|
||||||
{
|
{
|
||||||
if (pAd->CommonCfg.RegTransmitSetting.field.BW == BW_40) {
|
if (pAd->CommonCfg.RegTransmitSetting.field.BW == BW_40) {
|
||||||
if (pAd->CommonCfg.RegTransmitSetting.field.EXTCHA ==
|
if (pAd->CommonCfg.RegTransmitSetting.field.EXTCHA ==
|
||||||
@ -1690,7 +1690,7 @@ VOID N_SetCenCh(IN PRTMP_ADAPTER pAd)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
UINT8 GetCuntryMaxTxPwr(IN PRTMP_ADAPTER pAd, IN UINT8 channel)
|
u8 GetCuntryMaxTxPwr(IN PRTMP_ADAPTER pAd, u8 channel)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
for (i = 0; i < pAd->ChannelListNum; i++) {
|
for (i = 0; i < pAd->ChannelListNum; i++) {
|
||||||
|
@ -53,11 +53,11 @@
|
|||||||
|
|
||||||
========================================================================
|
========================================================================
|
||||||
*/
|
*/
|
||||||
NDIS_STATUS RT30xxWriteRFRegister(IN PRTMP_ADAPTER pAd,
|
int RT30xxWriteRFRegister(IN PRTMP_ADAPTER pAd,
|
||||||
IN UCHAR regID, IN UCHAR value)
|
u8 regID, u8 value)
|
||||||
{
|
{
|
||||||
RF_CSR_CFG_STRUC rfcsr;
|
RF_CSR_CFG_STRUC rfcsr;
|
||||||
UINT i = 0;
|
u32 i = 0;
|
||||||
|
|
||||||
do {
|
do {
|
||||||
RTMP_IO_READ32(pAd, RF_CSR_CFG, &rfcsr.word);
|
RTMP_IO_READ32(pAd, RF_CSR_CFG, &rfcsr.word);
|
||||||
@ -101,11 +101,11 @@ NDIS_STATUS RT30xxWriteRFRegister(IN PRTMP_ADAPTER pAd,
|
|||||||
|
|
||||||
========================================================================
|
========================================================================
|
||||||
*/
|
*/
|
||||||
NDIS_STATUS RT30xxReadRFRegister(IN PRTMP_ADAPTER pAd,
|
int RT30xxReadRFRegister(IN PRTMP_ADAPTER pAd,
|
||||||
IN UCHAR regID, IN PUCHAR pValue)
|
u8 regID, u8 *pValue)
|
||||||
{
|
{
|
||||||
RF_CSR_CFG_STRUC rfcsr;
|
RF_CSR_CFG_STRUC rfcsr;
|
||||||
UINT i = 0, k = 0;
|
u32 i = 0, k = 0;
|
||||||
|
|
||||||
for (i = 0; i < MAX_BUSY_COUNT; i++) {
|
for (i = 0; i < MAX_BUSY_COUNT; i++) {
|
||||||
RTMP_IO_READ32(pAd, RF_CSR_CFG, &rfcsr.word);
|
RTMP_IO_READ32(pAd, RF_CSR_CFG, &rfcsr.word);
|
||||||
@ -126,7 +126,7 @@ NDIS_STATUS RT30xxReadRFRegister(IN PRTMP_ADAPTER pAd,
|
|||||||
}
|
}
|
||||||
if ((rfcsr.field.RF_CSR_KICK == IDLE) &&
|
if ((rfcsr.field.RF_CSR_KICK == IDLE) &&
|
||||||
(rfcsr.field.TESTCSR_RFACC_REGNUM == regID)) {
|
(rfcsr.field.TESTCSR_RFACC_REGNUM == regID)) {
|
||||||
*pValue = (UCHAR) rfcsr.field.RF_CSR_DATA;
|
*pValue = (u8)rfcsr.field.RF_CSR_DATA;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -139,13 +139,13 @@ NDIS_STATUS RT30xxReadRFRegister(IN PRTMP_ADAPTER pAd,
|
|||||||
return STATUS_SUCCESS;
|
return STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID NICInitRFRegisters(IN RTMP_ADAPTER * pAd)
|
void NICInitRFRegisters(IN RTMP_ADAPTER * pAd)
|
||||||
{
|
{
|
||||||
if (pAd->chipOps.AsicRfInit)
|
if (pAd->chipOps.AsicRfInit)
|
||||||
pAd->chipOps.AsicRfInit(pAd);
|
pAd->chipOps.AsicRfInit(pAd);
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID RtmpChipOpsRFHook(IN RTMP_ADAPTER * pAd)
|
void RtmpChipOpsRFHook(IN RTMP_ADAPTER * pAd)
|
||||||
{
|
{
|
||||||
RTMP_CHIP_OP *pChipOps = &pAd->chipOps;
|
RTMP_CHIP_OP *pChipOps = &pAd->chipOps;
|
||||||
|
|
||||||
|
@ -36,7 +36,7 @@
|
|||||||
*/
|
*/
|
||||||
#include "../rt_config.h"
|
#include "../rt_config.h"
|
||||||
|
|
||||||
UCHAR BIT8[] = { 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80 };
|
u8 BIT8[] = { 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80 };
|
||||||
char *CipherName[] =
|
char *CipherName[] =
|
||||||
{ "none", "wep64", "wep128", "TKIP", "AES", "CKIP64", "CKIP128" };
|
{ "none", "wep64", "wep128", "TKIP", "AES", "CKIP64", "CKIP128" };
|
||||||
|
|
||||||
@ -152,13 +152,13 @@ RTMP_REG_PAIR STAMACRegTable[] = {
|
|||||||
|
|
||||||
========================================================================
|
========================================================================
|
||||||
*/
|
*/
|
||||||
NDIS_STATUS RTMPAllocAdapterBlock(IN PVOID handle,
|
int RTMPAllocAdapterBlock(void *handle,
|
||||||
OUT PRTMP_ADAPTER * ppAdapter)
|
OUT PRTMP_ADAPTER * ppAdapter)
|
||||||
{
|
{
|
||||||
PRTMP_ADAPTER pAd;
|
PRTMP_ADAPTER pAd;
|
||||||
NDIS_STATUS Status;
|
int Status;
|
||||||
INT index;
|
int index;
|
||||||
UCHAR *pBeaconBuf = NULL;
|
u8 *pBeaconBuf = NULL;
|
||||||
|
|
||||||
DBGPRINT(RT_DEBUG_TRACE, ("--> RTMPAllocAdapterBlock\n"));
|
DBGPRINT(RT_DEBUG_TRACE, ("--> RTMPAllocAdapterBlock\n"));
|
||||||
|
|
||||||
@ -174,7 +174,7 @@ NDIS_STATUS RTMPAllocAdapterBlock(IN PVOID handle,
|
|||||||
}
|
}
|
||||||
NdisZeroMemory(pBeaconBuf, MAX_BEACON_SIZE);
|
NdisZeroMemory(pBeaconBuf, MAX_BEACON_SIZE);
|
||||||
|
|
||||||
Status = AdapterBlockAllocateMemory(handle, (PVOID *) & pAd);
|
Status = AdapterBlockAllocateMemory(handle, (void **) & pAd);
|
||||||
if (Status != NDIS_STATUS_SUCCESS) {
|
if (Status != NDIS_STATUS_SUCCESS) {
|
||||||
DBGPRINT_ERR(("Failed to allocate memory - ADAPTER\n"));
|
DBGPRINT_ERR(("Failed to allocate memory - ADAPTER\n"));
|
||||||
break;
|
break;
|
||||||
@ -182,7 +182,7 @@ NDIS_STATUS RTMPAllocAdapterBlock(IN PVOID handle,
|
|||||||
pAd->BeaconBuf = pBeaconBuf;
|
pAd->BeaconBuf = pBeaconBuf;
|
||||||
DBGPRINT(RT_DEBUG_OFF,
|
DBGPRINT(RT_DEBUG_OFF,
|
||||||
("\n\n=== pAd = %p, size = %d ===\n\n", pAd,
|
("\n\n=== pAd = %p, size = %d ===\n\n", pAd,
|
||||||
(UINT32) sizeof(RTMP_ADAPTER)));
|
(u32)sizeof(RTMP_ADAPTER)));
|
||||||
|
|
||||||
/* Init spin locks */
|
/* Init spin locks */
|
||||||
NdisAllocateSpinLock(&pAd->MgmtRingLock);
|
NdisAllocateSpinLock(&pAd->MgmtRingLock);
|
||||||
@ -230,12 +230,12 @@ NDIS_STATUS RTMPAllocAdapterBlock(IN PVOID handle,
|
|||||||
|
|
||||||
========================================================================
|
========================================================================
|
||||||
*/
|
*/
|
||||||
VOID RTMPReadTxPwrPerRate(IN PRTMP_ADAPTER pAd)
|
void RTMPReadTxPwrPerRate(IN PRTMP_ADAPTER pAd)
|
||||||
{
|
{
|
||||||
ULONG data, Adata, Gdata;
|
unsigned long data, Adata, Gdata;
|
||||||
USHORT i, value, value2;
|
u16 i, value, value2;
|
||||||
INT Apwrdelta, Gpwrdelta;
|
int Apwrdelta, Gpwrdelta;
|
||||||
UCHAR t1, t2, t3, t4;
|
u8 t1, t2, t3, t4;
|
||||||
BOOLEAN bApwrdeltaMinus = TRUE, bGpwrdeltaMinus = TRUE;
|
BOOLEAN bApwrdeltaMinus = TRUE, bGpwrdeltaMinus = TRUE;
|
||||||
|
|
||||||
/* */
|
/* */
|
||||||
@ -441,9 +441,9 @@ VOID RTMPReadTxPwrPerRate(IN PRTMP_ADAPTER pAd)
|
|||||||
|
|
||||||
========================================================================
|
========================================================================
|
||||||
*/
|
*/
|
||||||
VOID RTMPReadChannelPwr(IN PRTMP_ADAPTER pAd)
|
void RTMPReadChannelPwr(IN PRTMP_ADAPTER pAd)
|
||||||
{
|
{
|
||||||
UCHAR i, choffset;
|
u8 i, choffset;
|
||||||
EEPROM_TX_PWR_STRUC Power;
|
EEPROM_TX_PWR_STRUC Power;
|
||||||
EEPROM_TX_PWR_STRUC Power2;
|
EEPROM_TX_PWR_STRUC Power2;
|
||||||
|
|
||||||
@ -650,10 +650,10 @@ VOID RTMPReadChannelPwr(IN PRTMP_ADAPTER pAd)
|
|||||||
|
|
||||||
========================================================================
|
========================================================================
|
||||||
*/
|
*/
|
||||||
NDIS_STATUS NICReadRegParameters(IN PRTMP_ADAPTER pAd,
|
int NICReadRegParameters(IN PRTMP_ADAPTER pAd,
|
||||||
IN NDIS_HANDLE WrapperConfigurationContext)
|
IN NDIS_HANDLE WrapperConfigurationContext)
|
||||||
{
|
{
|
||||||
NDIS_STATUS Status = NDIS_STATUS_SUCCESS;
|
int Status = NDIS_STATUS_SUCCESS;
|
||||||
DBGPRINT_S(Status, ("<-- NICReadRegParameters, Status=%x\n", Status));
|
DBGPRINT_S(Status, ("<-- NICReadRegParameters, Status=%x\n", Status));
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
@ -676,11 +676,11 @@ NDIS_STATUS NICReadRegParameters(IN PRTMP_ADAPTER pAd,
|
|||||||
|
|
||||||
========================================================================
|
========================================================================
|
||||||
*/
|
*/
|
||||||
VOID NICReadEEPROMParameters(IN PRTMP_ADAPTER pAd, IN PUCHAR mac_addr)
|
void NICReadEEPROMParameters(IN PRTMP_ADAPTER pAd, u8 *mac_addr)
|
||||||
{
|
{
|
||||||
UINT32 data = 0;
|
u32 data = 0;
|
||||||
USHORT i, value, value2;
|
u16 i, value, value2;
|
||||||
UCHAR TmpPhy;
|
u8 TmpPhy;
|
||||||
EEPROM_TX_PWR_STRUC Power;
|
EEPROM_TX_PWR_STRUC Power;
|
||||||
EEPROM_VERSION_STRUC Version;
|
EEPROM_VERSION_STRUC Version;
|
||||||
EEPROM_ANTENNA_STRUC Antenna;
|
EEPROM_ANTENNA_STRUC Antenna;
|
||||||
@ -707,29 +707,29 @@ VOID NICReadEEPROMParameters(IN PRTMP_ADAPTER pAd, IN PUCHAR mac_addr)
|
|||||||
/* RT2860 MAC no longer auto load MAC address from E2PROM. Driver has to intialize */
|
/* RT2860 MAC no longer auto load MAC address from E2PROM. Driver has to intialize */
|
||||||
/* MAC address registers according to E2PROM setting */
|
/* MAC address registers according to E2PROM setting */
|
||||||
if (mac_addr == NULL ||
|
if (mac_addr == NULL ||
|
||||||
strlen((PSTRING) mac_addr) != 17 ||
|
strlen((char *)mac_addr) != 17 ||
|
||||||
mac_addr[2] != ':' || mac_addr[5] != ':' || mac_addr[8] != ':' ||
|
mac_addr[2] != ':' || mac_addr[5] != ':' || mac_addr[8] != ':' ||
|
||||||
mac_addr[11] != ':' || mac_addr[14] != ':') {
|
mac_addr[11] != ':' || mac_addr[14] != ':') {
|
||||||
USHORT Addr01, Addr23, Addr45;
|
u16 Addr01, Addr23, Addr45;
|
||||||
|
|
||||||
RT28xx_EEPROM_READ16(pAd, 0x04, Addr01);
|
RT28xx_EEPROM_READ16(pAd, 0x04, Addr01);
|
||||||
RT28xx_EEPROM_READ16(pAd, 0x06, Addr23);
|
RT28xx_EEPROM_READ16(pAd, 0x06, Addr23);
|
||||||
RT28xx_EEPROM_READ16(pAd, 0x08, Addr45);
|
RT28xx_EEPROM_READ16(pAd, 0x08, Addr45);
|
||||||
|
|
||||||
pAd->PermanentAddress[0] = (UCHAR) (Addr01 & 0xff);
|
pAd->PermanentAddress[0] = (u8)(Addr01 & 0xff);
|
||||||
pAd->PermanentAddress[1] = (UCHAR) (Addr01 >> 8);
|
pAd->PermanentAddress[1] = (u8)(Addr01 >> 8);
|
||||||
pAd->PermanentAddress[2] = (UCHAR) (Addr23 & 0xff);
|
pAd->PermanentAddress[2] = (u8)(Addr23 & 0xff);
|
||||||
pAd->PermanentAddress[3] = (UCHAR) (Addr23 >> 8);
|
pAd->PermanentAddress[3] = (u8)(Addr23 >> 8);
|
||||||
pAd->PermanentAddress[4] = (UCHAR) (Addr45 & 0xff);
|
pAd->PermanentAddress[4] = (u8)(Addr45 & 0xff);
|
||||||
pAd->PermanentAddress[5] = (UCHAR) (Addr45 >> 8);
|
pAd->PermanentAddress[5] = (u8)(Addr45 >> 8);
|
||||||
|
|
||||||
DBGPRINT(RT_DEBUG_TRACE,
|
DBGPRINT(RT_DEBUG_TRACE,
|
||||||
("Initialize MAC Address from E2PROM \n"));
|
("Initialize MAC Address from E2PROM \n"));
|
||||||
} else {
|
} else {
|
||||||
INT j;
|
int j;
|
||||||
PSTRING macptr;
|
char *macptr;
|
||||||
|
|
||||||
macptr = (PSTRING) mac_addr;
|
macptr = (char *)mac_addr;
|
||||||
|
|
||||||
for (j = 0; j < MAC_ADDR_LEN; j++) {
|
for (j = 0; j < MAC_ADDR_LEN; j++) {
|
||||||
AtoH(macptr, &pAd->PermanentAddress[j], 1);
|
AtoH(macptr, &pAd->PermanentAddress[j], 1);
|
||||||
@ -898,15 +898,15 @@ VOID NICReadEEPROMParameters(IN PRTMP_ADAPTER pAd, IN PUCHAR mac_addr)
|
|||||||
pAd->Antenna.word = Antenna.word;
|
pAd->Antenna.word = Antenna.word;
|
||||||
|
|
||||||
/* Set the RfICType here, then we can initialize RFIC related operation callbacks */
|
/* Set the RfICType here, then we can initialize RFIC related operation callbacks */
|
||||||
pAd->Mlme.RealRxPath = (UCHAR) Antenna.field.RxPath;
|
pAd->Mlme.RealRxPath = (u8)Antenna.field.RxPath;
|
||||||
pAd->RfIcType = (UCHAR) Antenna.field.RfIcType;
|
pAd->RfIcType = (u8)Antenna.field.RfIcType;
|
||||||
|
|
||||||
#ifdef RTMP_RF_RW_SUPPORT
|
#ifdef RTMP_RF_RW_SUPPORT
|
||||||
RtmpChipOpsRFHook(pAd);
|
RtmpChipOpsRFHook(pAd);
|
||||||
#endif /* RTMP_RF_RW_SUPPORT // */
|
#endif /* RTMP_RF_RW_SUPPORT // */
|
||||||
|
|
||||||
#ifdef RTMP_MAC_PCI
|
#ifdef RTMP_MAC_PCI
|
||||||
sprintf((PSTRING) pAd->nickname, "RT2860STA");
|
sprintf((char *)pAd->nickname, "RT2860STA");
|
||||||
#endif /* RTMP_MAC_PCI // */
|
#endif /* RTMP_MAC_PCI // */
|
||||||
|
|
||||||
/* */
|
/* */
|
||||||
@ -1005,7 +1005,7 @@ VOID NICReadEEPROMParameters(IN PRTMP_ADAPTER pAd, IN PUCHAR mac_addr)
|
|||||||
/* Read frequency offset setting for RF */
|
/* Read frequency offset setting for RF */
|
||||||
RT28xx_EEPROM_READ16(pAd, EEPROM_FREQ_OFFSET, value);
|
RT28xx_EEPROM_READ16(pAd, EEPROM_FREQ_OFFSET, value);
|
||||||
if ((value & 0x00FF) != 0x00FF)
|
if ((value & 0x00FF) != 0x00FF)
|
||||||
pAd->RfFreqOffset = (ULONG) (value & 0x00FF);
|
pAd->RfFreqOffset = (unsigned long)(value & 0x00FF);
|
||||||
else
|
else
|
||||||
pAd->RfFreqOffset = 0;
|
pAd->RfFreqOffset = 0;
|
||||||
DBGPRINT(RT_DEBUG_TRACE,
|
DBGPRINT(RT_DEBUG_TRACE,
|
||||||
@ -1017,8 +1017,8 @@ VOID NICReadEEPROMParameters(IN PRTMP_ADAPTER pAd, IN PUCHAR mac_addr)
|
|||||||
|
|
||||||
if ((value <= REGION_MAXIMUM_BG_BAND)
|
if ((value <= REGION_MAXIMUM_BG_BAND)
|
||||||
&& (value2 <= REGION_MAXIMUM_A_BAND)) {
|
&& (value2 <= REGION_MAXIMUM_A_BAND)) {
|
||||||
pAd->CommonCfg.CountryRegion = ((UCHAR) value) | 0x80;
|
pAd->CommonCfg.CountryRegion = ((u8)value) | 0x80;
|
||||||
pAd->CommonCfg.CountryRegionForABand = ((UCHAR) value2) | 0x80;
|
pAd->CommonCfg.CountryRegionForABand = ((u8)value2) | 0x80;
|
||||||
TmpPhy = pAd->CommonCfg.PhyMode;
|
TmpPhy = pAd->CommonCfg.PhyMode;
|
||||||
pAd->CommonCfg.PhyMode = 0xff;
|
pAd->CommonCfg.PhyMode = 0xff;
|
||||||
RTMPSetPhyMode(pAd, TmpPhy);
|
RTMPSetPhyMode(pAd, TmpPhy);
|
||||||
@ -1057,9 +1057,9 @@ VOID NICReadEEPROMParameters(IN PRTMP_ADAPTER pAd, IN PUCHAR mac_addr)
|
|||||||
pAd->ARssiOffset2 = value & 0x00ff;
|
pAd->ARssiOffset2 = value & 0x00ff;
|
||||||
pAd->ALNAGain2 = (value >> 8);
|
pAd->ALNAGain2 = (value >> 8);
|
||||||
|
|
||||||
if (((UCHAR) pAd->ALNAGain1 == 0xFF) || (pAd->ALNAGain1 == 0x00))
|
if (((u8)pAd->ALNAGain1 == 0xFF) || (pAd->ALNAGain1 == 0x00))
|
||||||
pAd->ALNAGain1 = pAd->ALNAGain0;
|
pAd->ALNAGain1 = pAd->ALNAGain0;
|
||||||
if (((UCHAR) pAd->ALNAGain2 == 0xFF) || (pAd->ALNAGain2 == 0x00))
|
if (((u8)pAd->ALNAGain2 == 0xFF) || (pAd->ALNAGain2 == 0x00))
|
||||||
pAd->ALNAGain2 = pAd->ALNAGain0;
|
pAd->ALNAGain2 = pAd->ALNAGain0;
|
||||||
|
|
||||||
/* Validate 11a RSSI_0 offset. */
|
/* Validate 11a RSSI_0 offset. */
|
||||||
@ -1087,7 +1087,7 @@ VOID NICReadEEPROMParameters(IN PRTMP_ADAPTER pAd, IN PUCHAR mac_addr)
|
|||||||
value &= 0x00ff;
|
value &= 0x00ff;
|
||||||
if (value != 0xff) {
|
if (value != 0xff) {
|
||||||
value &= 0x07;
|
value &= 0x07;
|
||||||
pAd->TxMixerGain24G = (UCHAR) value;
|
pAd->TxMixerGain24G = (u8)value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif /* RT30xx // */
|
#endif /* RT30xx // */
|
||||||
@ -1133,23 +1133,23 @@ VOID NICReadEEPROMParameters(IN PRTMP_ADAPTER pAd, IN PUCHAR mac_addr)
|
|||||||
|
|
||||||
========================================================================
|
========================================================================
|
||||||
*/
|
*/
|
||||||
VOID NICInitAsicFromEEPROM(IN PRTMP_ADAPTER pAd)
|
void NICInitAsicFromEEPROM(IN PRTMP_ADAPTER pAd)
|
||||||
{
|
{
|
||||||
UINT32 data = 0;
|
u32 data = 0;
|
||||||
UCHAR BBPR1 = 0;
|
u8 BBPR1 = 0;
|
||||||
USHORT i;
|
u16 i;
|
||||||
/* EEPROM_ANTENNA_STRUC Antenna; */
|
/* EEPROM_ANTENNA_STRUC Antenna; */
|
||||||
EEPROM_NIC_CONFIG2_STRUC NicConfig2;
|
EEPROM_NIC_CONFIG2_STRUC NicConfig2;
|
||||||
UCHAR BBPR3 = 0;
|
u8 BBPR3 = 0;
|
||||||
|
|
||||||
DBGPRINT(RT_DEBUG_TRACE, ("--> NICInitAsicFromEEPROM\n"));
|
DBGPRINT(RT_DEBUG_TRACE, ("--> NICInitAsicFromEEPROM\n"));
|
||||||
for (i = 3; i < NUM_EEPROM_BBP_PARMS; i++) {
|
for (i = 3; i < NUM_EEPROM_BBP_PARMS; i++) {
|
||||||
UCHAR BbpRegIdx, BbpValue;
|
u8 BbpRegIdx, BbpValue;
|
||||||
|
|
||||||
if ((pAd->EEPROMDefaultValue[i] != 0xFFFF)
|
if ((pAd->EEPROMDefaultValue[i] != 0xFFFF)
|
||||||
&& (pAd->EEPROMDefaultValue[i] != 0)) {
|
&& (pAd->EEPROMDefaultValue[i] != 0)) {
|
||||||
BbpRegIdx = (UCHAR) (pAd->EEPROMDefaultValue[i] >> 8);
|
BbpRegIdx = (u8)(pAd->EEPROMDefaultValue[i] >> 8);
|
||||||
BbpValue = (UCHAR) (pAd->EEPROMDefaultValue[i] & 0xff);
|
BbpValue = (u8)(pAd->EEPROMDefaultValue[i] & 0xff);
|
||||||
RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BbpRegIdx, BbpValue);
|
RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BbpRegIdx, BbpValue);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1191,12 +1191,12 @@ VOID NICInitAsicFromEEPROM(IN PRTMP_ADAPTER pAd)
|
|||||||
#endif /* RTMP_MAC_USB // */
|
#endif /* RTMP_MAC_USB // */
|
||||||
}
|
}
|
||||||
|
|
||||||
AsicSendCommandToMcu(pAd, 0x52, 0xff, (UCHAR) pAd->Led1,
|
AsicSendCommandToMcu(pAd, 0x52, 0xff, (u8)pAd->Led1,
|
||||||
(UCHAR) (pAd->Led1 >> 8));
|
(u8)(pAd->Led1 >> 8));
|
||||||
AsicSendCommandToMcu(pAd, 0x53, 0xff, (UCHAR) pAd->Led2,
|
AsicSendCommandToMcu(pAd, 0x53, 0xff, (u8)pAd->Led2,
|
||||||
(UCHAR) (pAd->Led2 >> 8));
|
(u8)(pAd->Led2 >> 8));
|
||||||
AsicSendCommandToMcu(pAd, 0x54, 0xff, (UCHAR) pAd->Led3,
|
AsicSendCommandToMcu(pAd, 0x54, 0xff, (u8)pAd->Led3,
|
||||||
(UCHAR) (pAd->Led3 >> 8));
|
(u8)(pAd->Led3 >> 8));
|
||||||
AsicSendCommandToMcu(pAd, 0x51, 0xff, 0, pAd->LedCntl.field.Polarity);
|
AsicSendCommandToMcu(pAd, 0x51, 0xff, 0, pAd->LedCntl.field.Polarity);
|
||||||
|
|
||||||
pAd->LedIndicatorStrength = 0xFF;
|
pAd->LedIndicatorStrength = 0xFF;
|
||||||
@ -1306,16 +1306,16 @@ VOID NICInitAsicFromEEPROM(IN PRTMP_ADAPTER pAd)
|
|||||||
/* update registers from EEPROM for RT3071 or later(3572/3592). */
|
/* update registers from EEPROM for RT3071 or later(3572/3592). */
|
||||||
|
|
||||||
if (IS_RT3090(pAd) || IS_RT3572(pAd) || IS_RT3390(pAd)) {
|
if (IS_RT3090(pAd) || IS_RT3572(pAd) || IS_RT3390(pAd)) {
|
||||||
UCHAR RegIdx, RegValue;
|
u8 RegIdx, RegValue;
|
||||||
USHORT value;
|
u16 value;
|
||||||
|
|
||||||
/* after RT3071, write BBP from EEPROM 0xF0 to 0x102 */
|
/* after RT3071, write BBP from EEPROM 0xF0 to 0x102 */
|
||||||
for (i = 0xF0; i <= 0x102; i = i + 2) {
|
for (i = 0xF0; i <= 0x102; i = i + 2) {
|
||||||
value = 0xFFFF;
|
value = 0xFFFF;
|
||||||
RT28xx_EEPROM_READ16(pAd, i, value);
|
RT28xx_EEPROM_READ16(pAd, i, value);
|
||||||
if ((value != 0xFFFF) && (value != 0)) {
|
if ((value != 0xFFFF) && (value != 0)) {
|
||||||
RegIdx = (UCHAR) (value >> 8);
|
RegIdx = (u8)(value >> 8);
|
||||||
RegValue = (UCHAR) (value & 0xff);
|
RegValue = (u8)(value & 0xff);
|
||||||
RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, RegIdx,
|
RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, RegIdx,
|
||||||
RegValue);
|
RegValue);
|
||||||
DBGPRINT(RT_DEBUG_TRACE,
|
DBGPRINT(RT_DEBUG_TRACE,
|
||||||
@ -1329,8 +1329,8 @@ VOID NICInitAsicFromEEPROM(IN PRTMP_ADAPTER pAd)
|
|||||||
value = 0xFFFF;
|
value = 0xFFFF;
|
||||||
RT28xx_EEPROM_READ16(pAd, i, value);
|
RT28xx_EEPROM_READ16(pAd, i, value);
|
||||||
if ((value != 0xFFFF) && (value != 0)) {
|
if ((value != 0xFFFF) && (value != 0)) {
|
||||||
RegIdx = (UCHAR) (value >> 8);
|
RegIdx = (u8)(value >> 8);
|
||||||
RegValue = (UCHAR) (value & 0xff);
|
RegValue = (u8)(value & 0xff);
|
||||||
RT30xxWriteRFRegister(pAd, RegIdx, RegValue);
|
RT30xxWriteRFRegister(pAd, RegIdx, RegValue);
|
||||||
DBGPRINT(RT_DEBUG_TRACE,
|
DBGPRINT(RT_DEBUG_TRACE,
|
||||||
("Update RF Registers from EEPROM0x%x), BBP(0x%x) = 0x%x\n",
|
("Update RF Registers from EEPROM0x%x), BBP(0x%x) = 0x%x\n",
|
||||||
@ -1366,16 +1366,16 @@ VOID NICInitAsicFromEEPROM(IN PRTMP_ADAPTER pAd)
|
|||||||
|
|
||||||
========================================================================
|
========================================================================
|
||||||
*/
|
*/
|
||||||
NDIS_STATUS NICInitializeAdapter(IN PRTMP_ADAPTER pAd, IN BOOLEAN bHardReset)
|
int NICInitializeAdapter(IN PRTMP_ADAPTER pAd, IN BOOLEAN bHardReset)
|
||||||
{
|
{
|
||||||
NDIS_STATUS Status = NDIS_STATUS_SUCCESS;
|
int Status = NDIS_STATUS_SUCCESS;
|
||||||
WPDMA_GLO_CFG_STRUC GloCfg;
|
WPDMA_GLO_CFG_STRUC GloCfg;
|
||||||
#ifdef RTMP_MAC_PCI
|
#ifdef RTMP_MAC_PCI
|
||||||
UINT32 Value;
|
u32 Value;
|
||||||
DELAY_INT_CFG_STRUC IntCfg;
|
DELAY_INT_CFG_STRUC IntCfg;
|
||||||
#endif /* RTMP_MAC_PCI // */
|
#endif /* RTMP_MAC_PCI // */
|
||||||
/* INT_MASK_CSR_STRUC IntMask; */
|
/* INT_MASK_CSR_STRUC IntMask; */
|
||||||
ULONG i = 0, j = 0;
|
unsigned long i = 0, j = 0;
|
||||||
AC_TXOP_CSR0_STRUC csr0;
|
AC_TXOP_CSR0_STRUC csr0;
|
||||||
|
|
||||||
DBGPRINT(RT_DEBUG_TRACE, ("--> NICInitializeAdapter\n"));
|
DBGPRINT(RT_DEBUG_TRACE, ("--> NICInitializeAdapter\n"));
|
||||||
@ -1562,22 +1562,22 @@ retry:
|
|||||||
|
|
||||||
========================================================================
|
========================================================================
|
||||||
*/
|
*/
|
||||||
NDIS_STATUS NICInitializeAsic(IN PRTMP_ADAPTER pAd, IN BOOLEAN bHardReset)
|
int NICInitializeAsic(IN PRTMP_ADAPTER pAd, IN BOOLEAN bHardReset)
|
||||||
{
|
{
|
||||||
ULONG Index = 0;
|
unsigned long Index = 0;
|
||||||
UCHAR R0 = 0xff;
|
u8 R0 = 0xff;
|
||||||
UINT32 MacCsr12 = 0, Counter = 0;
|
u32 MacCsr12 = 0, Counter = 0;
|
||||||
#ifdef RTMP_MAC_USB
|
#ifdef RTMP_MAC_USB
|
||||||
UINT32 MacCsr0 = 0;
|
u32 MacCsr0 = 0;
|
||||||
NTSTATUS Status;
|
int Status;
|
||||||
UCHAR Value = 0xff;
|
u8 Value = 0xff;
|
||||||
#endif /* RTMP_MAC_USB // */
|
#endif /* RTMP_MAC_USB // */
|
||||||
#ifdef RT30xx
|
#ifdef RT30xx
|
||||||
UCHAR bbpreg = 0;
|
u8 bbpreg = 0;
|
||||||
UCHAR RFValue = 0;
|
u8 RFValue = 0;
|
||||||
#endif /* RT30xx // */
|
#endif /* RT30xx // */
|
||||||
USHORT KeyIdx;
|
u16 KeyIdx;
|
||||||
INT i, apidx;
|
int i, apidx;
|
||||||
|
|
||||||
DBGPRINT(RT_DEBUG_TRACE, ("--> NICInitializeAsic\n"));
|
DBGPRINT(RT_DEBUG_TRACE, ("--> NICInitializeAsic\n"));
|
||||||
|
|
||||||
@ -1642,14 +1642,14 @@ NDIS_STATUS NICInitializeAsic(IN PRTMP_ADAPTER pAd, IN BOOLEAN bHardReset)
|
|||||||
MACRegTable[Index].Value = 0x00000400;
|
MACRegTable[Index].Value = 0x00000400;
|
||||||
}
|
}
|
||||||
#endif /* RT30xx // */
|
#endif /* RT30xx // */
|
||||||
RTMP_IO_WRITE32(pAd, (USHORT) MACRegTable[Index].Register,
|
RTMP_IO_WRITE32(pAd, (u16)MACRegTable[Index].Register,
|
||||||
MACRegTable[Index].Value);
|
MACRegTable[Index].Value);
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
for (Index = 0; Index < NUM_STA_MAC_REG_PARMS; Index++) {
|
for (Index = 0; Index < NUM_STA_MAC_REG_PARMS; Index++) {
|
||||||
RTMP_IO_WRITE32(pAd,
|
RTMP_IO_WRITE32(pAd,
|
||||||
(USHORT) STAMACRegTable[Index].Register,
|
(u16)STAMACRegTable[Index].Register,
|
||||||
STAMACRegTable[Index].Value);
|
STAMACRegTable[Index].Value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1726,8 +1726,8 @@ NDIS_STATUS NICInitializeAsic(IN PRTMP_ADAPTER pAd, IN BOOLEAN bHardReset)
|
|||||||
#ifdef RTMP_MAC_PCI
|
#ifdef RTMP_MAC_PCI
|
||||||
/* TODO: shiang, check MACVersion, currently, rbus-based chip use this. */
|
/* TODO: shiang, check MACVersion, currently, rbus-based chip use this. */
|
||||||
if (pAd->MACVersion == 0x28720200) {
|
if (pAd->MACVersion == 0x28720200) {
|
||||||
/*UCHAR value; */
|
/*u8 value; */
|
||||||
ULONG value2;
|
unsigned long value2;
|
||||||
|
|
||||||
/*disable MLD by Bruce 20080704 */
|
/*disable MLD by Bruce 20080704 */
|
||||||
/*BBP_IO_READ8_BY_REG_ID(pAd, BBP_R105, &value); */
|
/*BBP_IO_READ8_BY_REG_ID(pAd, BBP_R105, &value); */
|
||||||
@ -1816,7 +1816,7 @@ NDIS_STATUS NICInitializeAsic(IN PRTMP_ADAPTER pAd, IN BOOLEAN bHardReset)
|
|||||||
if (pAd->MACVersion >= RALINK_2880E_VERSION && pAd->MACVersion < RALINK_3070_VERSION) /* 3*3 */
|
if (pAd->MACVersion >= RALINK_2880E_VERSION && pAd->MACVersion < RALINK_3070_VERSION) /* 3*3 */
|
||||||
{
|
{
|
||||||
/* enlarge MAX_LEN_CFG */
|
/* enlarge MAX_LEN_CFG */
|
||||||
UINT32 csr;
|
u32 csr;
|
||||||
RTMP_IO_READ32(pAd, MAX_LEN_CFG, &csr);
|
RTMP_IO_READ32(pAd, MAX_LEN_CFG, &csr);
|
||||||
csr &= 0xFFF;
|
csr &= 0xFFF;
|
||||||
csr |= 0x2000;
|
csr |= 0x2000;
|
||||||
@ -1824,14 +1824,14 @@ NDIS_STATUS NICInitializeAsic(IN PRTMP_ADAPTER pAd, IN BOOLEAN bHardReset)
|
|||||||
}
|
}
|
||||||
#ifdef RTMP_MAC_USB
|
#ifdef RTMP_MAC_USB
|
||||||
{
|
{
|
||||||
UCHAR MAC_Value[] =
|
u8 MAC_Value[] =
|
||||||
{ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0, 0 };
|
{ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0, 0 };
|
||||||
|
|
||||||
/*Initialize WCID table */
|
/*Initialize WCID table */
|
||||||
Value = 0xff;
|
Value = 0xff;
|
||||||
for (Index = 0; Index < 254; Index++) {
|
for (Index = 0; Index < 254; Index++) {
|
||||||
RTUSBMultiWrite(pAd,
|
RTUSBMultiWrite(pAd,
|
||||||
(USHORT) (MAC_WCID_BASE + Index * 8),
|
(u16)(MAC_WCID_BASE + Index * 8),
|
||||||
MAC_Value, 8);
|
MAC_Value, 8);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1929,9 +1929,9 @@ NDIS_STATUS NICInitializeAsic(IN PRTMP_ADAPTER pAd, IN BOOLEAN bHardReset)
|
|||||||
|
|
||||||
========================================================================
|
========================================================================
|
||||||
*/
|
*/
|
||||||
VOID NICIssueReset(IN PRTMP_ADAPTER pAd)
|
void NICIssueReset(IN PRTMP_ADAPTER pAd)
|
||||||
{
|
{
|
||||||
UINT32 Value = 0;
|
u32 Value = 0;
|
||||||
DBGPRINT(RT_DEBUG_TRACE, ("--> NICIssueReset\n"));
|
DBGPRINT(RT_DEBUG_TRACE, ("--> NICIssueReset\n"));
|
||||||
|
|
||||||
/* Abort Tx, prevent ASIC from writing to Host memory */
|
/* Abort Tx, prevent ASIC from writing to Host memory */
|
||||||
@ -1970,14 +1970,14 @@ BOOLEAN NICCheckForHang(IN PRTMP_ADAPTER pAd)
|
|||||||
return (FALSE);
|
return (FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID NICUpdateFifoStaCounters(IN PRTMP_ADAPTER pAd)
|
void NICUpdateFifoStaCounters(IN PRTMP_ADAPTER pAd)
|
||||||
{
|
{
|
||||||
TX_STA_FIFO_STRUC StaFifo;
|
TX_STA_FIFO_STRUC StaFifo;
|
||||||
MAC_TABLE_ENTRY *pEntry;
|
MAC_TABLE_ENTRY *pEntry;
|
||||||
UCHAR i = 0;
|
u8 i = 0;
|
||||||
UCHAR pid = 0, wcid = 0;
|
u8 pid = 0, wcid = 0;
|
||||||
CHAR reTry;
|
char reTry;
|
||||||
UCHAR succMCS;
|
u8 succMCS;
|
||||||
|
|
||||||
do {
|
do {
|
||||||
RTMP_IO_READ32(pAd, TX_STA_FIFO, &StaFifo.word);
|
RTMP_IO_READ32(pAd, TX_STA_FIFO, &StaFifo.word);
|
||||||
@ -1985,7 +1985,7 @@ VOID NICUpdateFifoStaCounters(IN PRTMP_ADAPTER pAd)
|
|||||||
if (StaFifo.field.bValid == 0)
|
if (StaFifo.field.bValid == 0)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
wcid = (UCHAR) StaFifo.field.wcid;
|
wcid = (u8)StaFifo.field.wcid;
|
||||||
|
|
||||||
/* ignore NoACK and MGMT frame use 0xFF as WCID */
|
/* ignore NoACK and MGMT frame use 0xFF as WCID */
|
||||||
if ((StaFifo.field.TxAckRequired == 0)
|
if ((StaFifo.field.TxAckRequired == 0)
|
||||||
@ -1995,7 +1995,7 @@ VOID NICUpdateFifoStaCounters(IN PRTMP_ADAPTER pAd)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* PID store Tx MCS Rate */
|
/* PID store Tx MCS Rate */
|
||||||
pid = (UCHAR) StaFifo.field.PidType;
|
pid = (u8)StaFifo.field.PidType;
|
||||||
|
|
||||||
pEntry = &pAd->MacTab.Content[wcid];
|
pEntry = &pAd->MacTab.Content[wcid];
|
||||||
|
|
||||||
@ -2094,11 +2094,11 @@ VOID NICUpdateFifoStaCounters(IN PRTMP_ADAPTER pAd)
|
|||||||
|
|
||||||
========================================================================
|
========================================================================
|
||||||
*/
|
*/
|
||||||
VOID NICUpdateRawCounters(IN PRTMP_ADAPTER pAd)
|
void NICUpdateRawCounters(IN PRTMP_ADAPTER pAd)
|
||||||
{
|
{
|
||||||
UINT32 OldValue; /*, Value2; */
|
u32 OldValue; /*, Value2; */
|
||||||
/*ULONG PageSum, OneSecTransmitCount; */
|
/*unsigned long PageSum, OneSecTransmitCount; */
|
||||||
/*ULONG TxErrorRatio, Retry, Fail; */
|
/*unsigned long TxErrorRatio, Retry, Fail; */
|
||||||
RX_STA_CNT0_STRUC RxStaCnt0;
|
RX_STA_CNT0_STRUC RxStaCnt0;
|
||||||
RX_STA_CNT1_STRUC RxStaCnt1;
|
RX_STA_CNT1_STRUC RxStaCnt1;
|
||||||
RX_STA_CNT2_STRUC RxStaCnt2;
|
RX_STA_CNT2_STRUC RxStaCnt2;
|
||||||
@ -2299,7 +2299,7 @@ VOID NICUpdateRawCounters(IN PRTMP_ADAPTER pAd)
|
|||||||
|
|
||||||
========================================================================
|
========================================================================
|
||||||
*/
|
*/
|
||||||
VOID NICResetFromError(IN PRTMP_ADAPTER pAd)
|
void NICResetFromError(IN PRTMP_ADAPTER pAd)
|
||||||
{
|
{
|
||||||
/* Reset BBP (according to alex, reset ASIC will force reset BBP */
|
/* Reset BBP (according to alex, reset ASIC will force reset BBP */
|
||||||
/* Therefore, skip the reset BBP */
|
/* Therefore, skip the reset BBP */
|
||||||
@ -2317,9 +2317,9 @@ VOID NICResetFromError(IN PRTMP_ADAPTER pAd)
|
|||||||
AsicLockChannel(pAd, pAd->CommonCfg.CentralChannel);
|
AsicLockChannel(pAd, pAd->CommonCfg.CentralChannel);
|
||||||
}
|
}
|
||||||
|
|
||||||
NDIS_STATUS NICLoadFirmware(IN PRTMP_ADAPTER pAd)
|
int NICLoadFirmware(IN PRTMP_ADAPTER pAd)
|
||||||
{
|
{
|
||||||
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
|
int status = NDIS_STATUS_SUCCESS;
|
||||||
if (pAd->chipOps.loadFirmware)
|
if (pAd->chipOps.loadFirmware)
|
||||||
status = pAd->chipOps.loadFirmware(pAd);
|
status = pAd->chipOps.loadFirmware(pAd);
|
||||||
|
|
||||||
@ -2339,7 +2339,7 @@ NDIS_STATUS NICLoadFirmware(IN PRTMP_ADAPTER pAd)
|
|||||||
|
|
||||||
========================================================================
|
========================================================================
|
||||||
*/
|
*/
|
||||||
VOID NICEraseFirmware(IN PRTMP_ADAPTER pAd)
|
void NICEraseFirmware(IN PRTMP_ADAPTER pAd)
|
||||||
{
|
{
|
||||||
if (pAd->chipOps.eraseFirmware)
|
if (pAd->chipOps.eraseFirmware)
|
||||||
pAd->chipOps.eraseFirmware(pAd);
|
pAd->chipOps.eraseFirmware(pAd);
|
||||||
@ -2367,7 +2367,7 @@ VOID NICEraseFirmware(IN PRTMP_ADAPTER pAd)
|
|||||||
|
|
||||||
========================================================================
|
========================================================================
|
||||||
*/
|
*/
|
||||||
NDIS_STATUS NICLoadRateSwitchingParams(IN PRTMP_ADAPTER pAd)
|
int NICLoadRateSwitchingParams(IN PRTMP_ADAPTER pAd)
|
||||||
{
|
{
|
||||||
return NDIS_STATUS_SUCCESS;
|
return NDIS_STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
@ -2393,14 +2393,14 @@ NDIS_STATUS NICLoadRateSwitchingParams(IN PRTMP_ADAPTER pAd)
|
|||||||
|
|
||||||
========================================================================
|
========================================================================
|
||||||
*/
|
*/
|
||||||
ULONG RTMPCompareMemory(IN PVOID pSrc1, IN PVOID pSrc2, IN ULONG Length)
|
unsigned long RTMPCompareMemory(void *pSrc1, void *pSrc2, unsigned long Length)
|
||||||
{
|
{
|
||||||
PUCHAR pMem1;
|
u8 *pMem1;
|
||||||
PUCHAR pMem2;
|
u8 *pMem2;
|
||||||
ULONG Index = 0;
|
unsigned long Index = 0;
|
||||||
|
|
||||||
pMem1 = (PUCHAR) pSrc1;
|
pMem1 = (u8 *)pSrc1;
|
||||||
pMem2 = (PUCHAR) pSrc2;
|
pMem2 = (u8 *)pSrc2;
|
||||||
|
|
||||||
for (Index = 0; Index < Length; Index++) {
|
for (Index = 0; Index < Length; Index++) {
|
||||||
if (pMem1[Index] > pMem2[Index])
|
if (pMem1[Index] > pMem2[Index])
|
||||||
@ -2433,12 +2433,12 @@ ULONG RTMPCompareMemory(IN PVOID pSrc1, IN PVOID pSrc2, IN ULONG Length)
|
|||||||
|
|
||||||
========================================================================
|
========================================================================
|
||||||
*/
|
*/
|
||||||
VOID RTMPZeroMemory(IN PVOID pSrc, IN ULONG Length)
|
void RTMPZeroMemory(void *pSrc, unsigned long Length)
|
||||||
{
|
{
|
||||||
PUCHAR pMem;
|
u8 *pMem;
|
||||||
ULONG Index = 0;
|
unsigned long Index = 0;
|
||||||
|
|
||||||
pMem = (PUCHAR) pSrc;
|
pMem = (u8 *)pSrc;
|
||||||
|
|
||||||
for (Index = 0; Index < Length; Index++) {
|
for (Index = 0; Index < Length; Index++) {
|
||||||
pMem[Index] = 0x00;
|
pMem[Index] = 0x00;
|
||||||
@ -2466,16 +2466,16 @@ VOID RTMPZeroMemory(IN PVOID pSrc, IN ULONG Length)
|
|||||||
|
|
||||||
========================================================================
|
========================================================================
|
||||||
*/
|
*/
|
||||||
VOID RTMPMoveMemory(OUT PVOID pDest, IN PVOID pSrc, IN ULONG Length)
|
void RTMPMoveMemory(void *pDest, void *pSrc, unsigned long Length)
|
||||||
{
|
{
|
||||||
PUCHAR pMem1;
|
u8 *pMem1;
|
||||||
PUCHAR pMem2;
|
u8 *pMem2;
|
||||||
UINT Index;
|
u32 Index;
|
||||||
|
|
||||||
ASSERT((Length == 0) || (pDest && pSrc));
|
ASSERT((Length == 0) || (pDest && pSrc));
|
||||||
|
|
||||||
pMem1 = (PUCHAR) pDest;
|
pMem1 = (u8 *)pDest;
|
||||||
pMem2 = (PUCHAR) pSrc;
|
pMem2 = (u8 *)pSrc;
|
||||||
|
|
||||||
for (Index = 0; Index < Length; Index++) {
|
for (Index = 0; Index < Length; Index++) {
|
||||||
pMem1[Index] = pMem2[Index];
|
pMem1[Index] = pMem2[Index];
|
||||||
@ -2500,9 +2500,9 @@ VOID RTMPMoveMemory(OUT PVOID pDest, IN PVOID pSrc, IN ULONG Length)
|
|||||||
|
|
||||||
========================================================================
|
========================================================================
|
||||||
*/
|
*/
|
||||||
VOID UserCfgInit(IN PRTMP_ADAPTER pAd)
|
void UserCfgInit(IN PRTMP_ADAPTER pAd)
|
||||||
{
|
{
|
||||||
UINT key_index, bss_index;
|
u32 key_index, bss_index;
|
||||||
|
|
||||||
DBGPRINT(RT_DEBUG_TRACE, ("--> UserCfgInit\n"));
|
DBGPRINT(RT_DEBUG_TRACE, ("--> UserCfgInit\n"));
|
||||||
|
|
||||||
@ -2703,7 +2703,7 @@ VOID UserCfgInit(IN PRTMP_ADAPTER pAd)
|
|||||||
|
|
||||||
/* PHY specification */
|
/* PHY specification */
|
||||||
pAd->CommonCfg.PhyMode = PHY_11BG_MIXED; /* default PHY mode */
|
pAd->CommonCfg.PhyMode = PHY_11BG_MIXED; /* default PHY mode */
|
||||||
OPSTATUS_CLEAR_FLAG(pAd, fOP_STATUS_SHORT_PREAMBLE_INUSED); /* CCK use LONG preamble */
|
OPSTATUS_CLEAR_FLAG(pAd, fOP_STATUS_SHORT_PREAMBLE_INUSED); /* CCK use long preamble */
|
||||||
|
|
||||||
{
|
{
|
||||||
/* user desired power mode */
|
/* user desired power mode */
|
||||||
@ -2736,10 +2736,10 @@ VOID UserCfgInit(IN PRTMP_ADAPTER pAd)
|
|||||||
|
|
||||||
NdisZeroMemory(pAd->nickname, IW_ESSID_MAX_SIZE + 1);
|
NdisZeroMemory(pAd->nickname, IW_ESSID_MAX_SIZE + 1);
|
||||||
#ifdef RTMP_MAC_PCI
|
#ifdef RTMP_MAC_PCI
|
||||||
sprintf((PSTRING) pAd->nickname, "RT2860STA");
|
sprintf((char *)pAd->nickname, "RT2860STA");
|
||||||
#endif /* RTMP_MAC_PCI // */
|
#endif /* RTMP_MAC_PCI // */
|
||||||
#ifdef RTMP_MAC_USB
|
#ifdef RTMP_MAC_USB
|
||||||
sprintf((PSTRING) pAd->nickname, "RT2870STA");
|
sprintf((char *)pAd->nickname, "RT2870STA");
|
||||||
#endif /* RTMP_MAC_USB // */
|
#endif /* RTMP_MAC_USB // */
|
||||||
RTMPInitTimer(pAd, &pAd->StaCfg.WpaDisassocAndBlockAssocTimer,
|
RTMPInitTimer(pAd, &pAd->StaCfg.WpaDisassocAndBlockAssocTimer,
|
||||||
GET_TIMER_FUNCTION(WpaDisassocApAndBlockAssoc),
|
GET_TIMER_FUNCTION(WpaDisassocApAndBlockAssoc),
|
||||||
@ -2810,7 +2810,7 @@ VOID UserCfgInit(IN PRTMP_ADAPTER pAd)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* IRQL = PASSIVE_LEVEL */
|
/* IRQL = PASSIVE_LEVEL */
|
||||||
UCHAR BtoH(STRING ch)
|
u8 BtoH(char ch)
|
||||||
{
|
{
|
||||||
if (ch >= '0' && ch <= '9')
|
if (ch >= '0' && ch <= '9')
|
||||||
return (ch - '0'); /* Handle numerals */
|
return (ch - '0'); /* Handle numerals */
|
||||||
@ -2822,7 +2822,7 @@ UCHAR BtoH(STRING ch)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* */
|
/* */
|
||||||
/* FUNCTION: AtoH(char *, UCHAR *, int) */
|
/* FUNCTION: AtoH(char *, u8 *, int) */
|
||||||
/* */
|
/* */
|
||||||
/* PURPOSE: Converts ascii string to network order hex */
|
/* PURPOSE: Converts ascii string to network order hex */
|
||||||
/* */
|
/* */
|
||||||
@ -2838,13 +2838,13 @@ UCHAR BtoH(STRING ch)
|
|||||||
/* */
|
/* */
|
||||||
/* IRQL = PASSIVE_LEVEL */
|
/* IRQL = PASSIVE_LEVEL */
|
||||||
|
|
||||||
void AtoH(PSTRING src, PUCHAR dest, int destlen)
|
void AtoH(char *src, u8 *dest, int destlen)
|
||||||
{
|
{
|
||||||
PSTRING srcptr;
|
char *srcptr;
|
||||||
PUCHAR destTemp;
|
u8 *destTemp;
|
||||||
|
|
||||||
srcptr = src;
|
srcptr = src;
|
||||||
destTemp = (PUCHAR) dest;
|
destTemp = (u8 *)dest;
|
||||||
|
|
||||||
while (destlen--) {
|
while (destlen--) {
|
||||||
*destTemp = BtoH(*srcptr++) << 4; /* Put 1st ascii byte in upper nibble. */
|
*destTemp = BtoH(*srcptr++) << 4; /* Put 1st ascii byte in upper nibble. */
|
||||||
@ -2875,9 +2875,9 @@ void AtoH(PSTRING src, PUCHAR dest, int destlen)
|
|||||||
|
|
||||||
========================================================================
|
========================================================================
|
||||||
*/
|
*/
|
||||||
VOID RTMPInitTimer(IN PRTMP_ADAPTER pAd,
|
void RTMPInitTimer(IN PRTMP_ADAPTER pAd,
|
||||||
IN PRALINK_TIMER_STRUCT pTimer,
|
IN PRALINK_TIMER_STRUCT pTimer,
|
||||||
IN PVOID pTimerFunc, IN PVOID pData, IN BOOLEAN Repeat)
|
void *pTimerFunc, void *pData, IN BOOLEAN Repeat)
|
||||||
{
|
{
|
||||||
/* */
|
/* */
|
||||||
/* Set Valid to TRUE for later used. */
|
/* Set Valid to TRUE for later used. */
|
||||||
@ -2888,13 +2888,13 @@ VOID RTMPInitTimer(IN PRTMP_ADAPTER pAd,
|
|||||||
|
|
||||||
pTimer->PeriodicType = Repeat;
|
pTimer->PeriodicType = Repeat;
|
||||||
pTimer->State = FALSE;
|
pTimer->State = FALSE;
|
||||||
pTimer->cookie = (ULONG) pData;
|
pTimer->cookie = (unsigned long)pData;
|
||||||
|
|
||||||
#ifdef RTMP_TIMER_TASK_SUPPORT
|
#ifdef RTMP_TIMER_TASK_SUPPORT
|
||||||
pTimer->pAd = pAd;
|
pTimer->pAd = pAd;
|
||||||
#endif /* RTMP_TIMER_TASK_SUPPORT // */
|
#endif /* RTMP_TIMER_TASK_SUPPORT // */
|
||||||
|
|
||||||
RTMP_OS_Init_Timer(pAd, &pTimer->TimerObj, pTimerFunc, (PVOID) pTimer);
|
RTMP_OS_Init_Timer(pAd, &pTimer->TimerObj, pTimerFunc, (void *)pTimer);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -2915,7 +2915,7 @@ VOID RTMPInitTimer(IN PRTMP_ADAPTER pAd,
|
|||||||
|
|
||||||
========================================================================
|
========================================================================
|
||||||
*/
|
*/
|
||||||
VOID RTMPSetTimer(IN PRALINK_TIMER_STRUCT pTimer, IN ULONG Value)
|
void RTMPSetTimer(IN PRALINK_TIMER_STRUCT pTimer, unsigned long Value)
|
||||||
{
|
{
|
||||||
if (pTimer->Valid) {
|
if (pTimer->Valid) {
|
||||||
pTimer->TimerValue = Value;
|
pTimer->TimerValue = Value;
|
||||||
@ -2950,7 +2950,7 @@ VOID RTMPSetTimer(IN PRALINK_TIMER_STRUCT pTimer, IN ULONG Value)
|
|||||||
|
|
||||||
========================================================================
|
========================================================================
|
||||||
*/
|
*/
|
||||||
VOID RTMPModTimer(IN PRALINK_TIMER_STRUCT pTimer, IN ULONG Value)
|
void RTMPModTimer(IN PRALINK_TIMER_STRUCT pTimer, unsigned long Value)
|
||||||
{
|
{
|
||||||
BOOLEAN Cancel;
|
BOOLEAN Cancel;
|
||||||
|
|
||||||
@ -2989,7 +2989,7 @@ VOID RTMPModTimer(IN PRALINK_TIMER_STRUCT pTimer, IN ULONG Value)
|
|||||||
|
|
||||||
========================================================================
|
========================================================================
|
||||||
*/
|
*/
|
||||||
VOID RTMPCancelTimer(IN PRALINK_TIMER_STRUCT pTimer, OUT BOOLEAN * pCancelled)
|
void RTMPCancelTimer(IN PRALINK_TIMER_STRUCT pTimer, OUT BOOLEAN * pCancelled)
|
||||||
{
|
{
|
||||||
if (pTimer->Valid) {
|
if (pTimer->Valid) {
|
||||||
if (pTimer->State == FALSE)
|
if (pTimer->State == FALSE)
|
||||||
@ -3030,11 +3030,11 @@ VOID RTMPCancelTimer(IN PRALINK_TIMER_STRUCT pTimer, OUT BOOLEAN * pCancelled)
|
|||||||
|
|
||||||
========================================================================
|
========================================================================
|
||||||
*/
|
*/
|
||||||
VOID RTMPSetLED(IN PRTMP_ADAPTER pAd, IN UCHAR Status)
|
void RTMPSetLED(IN PRTMP_ADAPTER pAd, u8 Status)
|
||||||
{
|
{
|
||||||
/*ULONG data; */
|
/*unsigned long data; */
|
||||||
UCHAR HighByte = 0;
|
u8 HighByte = 0;
|
||||||
UCHAR LowByte;
|
u8 LowByte;
|
||||||
|
|
||||||
LowByte = pAd->LedCntl.field.LedMode & 0x7f;
|
LowByte = pAd->LedCntl.field.LedMode & 0x7f;
|
||||||
switch (Status) {
|
switch (Status) {
|
||||||
@ -3117,9 +3117,9 @@ VOID RTMPSetLED(IN PRTMP_ADAPTER pAd, IN UCHAR Status)
|
|||||||
> -57 Excellent
|
> -57 Excellent
|
||||||
========================================================================
|
========================================================================
|
||||||
*/
|
*/
|
||||||
VOID RTMPSetSignalLED(IN PRTMP_ADAPTER pAd, IN NDIS_802_11_RSSI Dbm)
|
void RTMPSetSignalLED(IN PRTMP_ADAPTER pAd, IN NDIS_802_11_RSSI Dbm)
|
||||||
{
|
{
|
||||||
UCHAR nLed = 0;
|
u8 nLed = 0;
|
||||||
|
|
||||||
if (pAd->LedCntl.field.LedMode == LED_MODE_SIGNAL_STREGTH) {
|
if (pAd->LedCntl.field.LedMode == LED_MODE_SIGNAL_STREGTH) {
|
||||||
if (Dbm <= -90)
|
if (Dbm <= -90)
|
||||||
@ -3164,11 +3164,11 @@ VOID RTMPSetSignalLED(IN PRTMP_ADAPTER pAd, IN NDIS_802_11_RSSI Dbm)
|
|||||||
Before Enable RX, make sure you have enabled Interrupt.
|
Before Enable RX, make sure you have enabled Interrupt.
|
||||||
========================================================================
|
========================================================================
|
||||||
*/
|
*/
|
||||||
VOID RTMPEnableRxTx(IN PRTMP_ADAPTER pAd)
|
void RTMPEnableRxTx(IN PRTMP_ADAPTER pAd)
|
||||||
{
|
{
|
||||||
/* WPDMA_GLO_CFG_STRUC GloCfg; */
|
/* WPDMA_GLO_CFG_STRUC GloCfg; */
|
||||||
/* ULONG i = 0; */
|
/* unsigned long i = 0; */
|
||||||
UINT32 rx_filter_flag;
|
u32 rx_filter_flag;
|
||||||
|
|
||||||
DBGPRINT(RT_DEBUG_TRACE, ("==> RTMPEnableRxTx\n"));
|
DBGPRINT(RT_DEBUG_TRACE, ("==> RTMPEnableRxTx\n"));
|
||||||
|
|
||||||
@ -3199,12 +3199,12 @@ void CfgInitHook(PRTMP_ADAPTER pAd)
|
|||||||
}
|
}
|
||||||
|
|
||||||
int rt28xx_init(IN PRTMP_ADAPTER pAd,
|
int rt28xx_init(IN PRTMP_ADAPTER pAd,
|
||||||
IN PSTRING pDefaultMac, IN PSTRING pHostName)
|
char *pDefaultMac, char *pHostName)
|
||||||
{
|
{
|
||||||
UINT index;
|
u32 index;
|
||||||
UCHAR TmpPhy;
|
u8 TmpPhy;
|
||||||
NDIS_STATUS Status;
|
int Status;
|
||||||
UINT32 MacCsr0 = 0;
|
u32 MacCsr0 = 0;
|
||||||
|
|
||||||
#ifdef RTMP_MAC_PCI
|
#ifdef RTMP_MAC_PCI
|
||||||
{
|
{
|
||||||
@ -3346,20 +3346,20 @@ int rt28xx_init(IN PRTMP_ADAPTER pAd,
|
|||||||
/*Init Ba Capability parameters. */
|
/*Init Ba Capability parameters. */
|
||||||
/* RT28XX_BA_INIT(pAd); */
|
/* RT28XX_BA_INIT(pAd); */
|
||||||
pAd->CommonCfg.DesiredHtPhy.MpduDensity =
|
pAd->CommonCfg.DesiredHtPhy.MpduDensity =
|
||||||
(UCHAR) pAd->CommonCfg.BACapability.field.MpduDensity;
|
(u8)pAd->CommonCfg.BACapability.field.MpduDensity;
|
||||||
pAd->CommonCfg.DesiredHtPhy.AmsduEnable =
|
pAd->CommonCfg.DesiredHtPhy.AmsduEnable =
|
||||||
(USHORT) pAd->CommonCfg.BACapability.field.AmsduEnable;
|
(u16)pAd->CommonCfg.BACapability.field.AmsduEnable;
|
||||||
pAd->CommonCfg.DesiredHtPhy.AmsduSize =
|
pAd->CommonCfg.DesiredHtPhy.AmsduSize =
|
||||||
(USHORT) pAd->CommonCfg.BACapability.field.AmsduSize;
|
(u16)pAd->CommonCfg.BACapability.field.AmsduSize;
|
||||||
pAd->CommonCfg.DesiredHtPhy.MimoPs =
|
pAd->CommonCfg.DesiredHtPhy.MimoPs =
|
||||||
(USHORT) pAd->CommonCfg.BACapability.field.MMPSmode;
|
(u16)pAd->CommonCfg.BACapability.field.MMPSmode;
|
||||||
/* UPdata to HT IE */
|
/* UPdata to HT IE */
|
||||||
pAd->CommonCfg.HtCapability.HtCapInfo.MimoPs =
|
pAd->CommonCfg.HtCapability.HtCapInfo.MimoPs =
|
||||||
(USHORT) pAd->CommonCfg.BACapability.field.MMPSmode;
|
(u16)pAd->CommonCfg.BACapability.field.MMPSmode;
|
||||||
pAd->CommonCfg.HtCapability.HtCapInfo.AMsduSize =
|
pAd->CommonCfg.HtCapability.HtCapInfo.AMsduSize =
|
||||||
(USHORT) pAd->CommonCfg.BACapability.field.AmsduSize;
|
(u16)pAd->CommonCfg.BACapability.field.AmsduSize;
|
||||||
pAd->CommonCfg.HtCapability.HtCapParm.MpduDensity =
|
pAd->CommonCfg.HtCapability.HtCapParm.MpduDensity =
|
||||||
(UCHAR) pAd->CommonCfg.BACapability.field.MpduDensity;
|
(u8)pAd->CommonCfg.BACapability.field.MpduDensity;
|
||||||
|
|
||||||
/* after reading Registry, we now know if in AP mode or STA mode */
|
/* after reading Registry, we now know if in AP mode or STA mode */
|
||||||
|
|
||||||
@ -3371,7 +3371,7 @@ int rt28xx_init(IN PRTMP_ADAPTER pAd,
|
|||||||
DBGPRINT(RT_DEBUG_OFF, ("2. Phy Mode = %d\n", pAd->CommonCfg.PhyMode));
|
DBGPRINT(RT_DEBUG_OFF, ("2. Phy Mode = %d\n", pAd->CommonCfg.PhyMode));
|
||||||
|
|
||||||
/* We should read EEPROM for all cases. rt2860b */
|
/* We should read EEPROM for all cases. rt2860b */
|
||||||
NICReadEEPROMParameters(pAd, (PUCHAR) pDefaultMac);
|
NICReadEEPROMParameters(pAd, (u8 *)pDefaultMac);
|
||||||
|
|
||||||
DBGPRINT(RT_DEBUG_OFF, ("3. Phy Mode = %d\n", pAd->CommonCfg.PhyMode));
|
DBGPRINT(RT_DEBUG_OFF, ("3. Phy Mode = %d\n", pAd->CommonCfg.PhyMode));
|
||||||
|
|
||||||
@ -3476,7 +3476,7 @@ err0:
|
|||||||
|
|
||||||
/*---Add by shiang, move from os/linux/rt_main_dev.c */
|
/*---Add by shiang, move from os/linux/rt_main_dev.c */
|
||||||
|
|
||||||
static INT RtmpChipOpsRegister(IN RTMP_ADAPTER * pAd, IN INT infType)
|
static int RtmpChipOpsRegister(IN RTMP_ADAPTER * pAd, int infType)
|
||||||
{
|
{
|
||||||
RTMP_CHIP_OP *pChipOps = &pAd->chipOps;
|
RTMP_CHIP_OP *pChipOps = &pAd->chipOps;
|
||||||
int status;
|
int status;
|
||||||
@ -3508,9 +3508,9 @@ static INT RtmpChipOpsRegister(IN RTMP_ADAPTER * pAd, IN INT infType)
|
|||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
INT RtmpRaDevCtrlInit(IN RTMP_ADAPTER * pAd, IN RTMP_INF_TYPE infType)
|
int RtmpRaDevCtrlInit(IN RTMP_ADAPTER * pAd, IN RTMP_INF_TYPE infType)
|
||||||
{
|
{
|
||||||
/*VOID *handle; */
|
/*void *handle; */
|
||||||
|
|
||||||
/* Assign the interface type. We need use it when do register/EEPROM access. */
|
/* Assign the interface type. We need use it when do register/EEPROM access. */
|
||||||
pAd->infType = infType;
|
pAd->infType = infType;
|
||||||
@ -3521,7 +3521,7 @@ INT RtmpRaDevCtrlInit(IN RTMP_ADAPTER * pAd, IN RTMP_INF_TYPE infType)
|
|||||||
|
|
||||||
#ifdef RTMP_MAC_USB
|
#ifdef RTMP_MAC_USB
|
||||||
init_MUTEX(&(pAd->UsbVendorReq_semaphore));
|
init_MUTEX(&(pAd->UsbVendorReq_semaphore));
|
||||||
os_alloc_mem(pAd, (PUCHAR *) & pAd->UsbVendorReqBuf,
|
os_alloc_mem(pAd, (u8 **) & pAd->UsbVendorReqBuf,
|
||||||
MAX_PARAM_BUFFER_SIZE - 1);
|
MAX_PARAM_BUFFER_SIZE - 1);
|
||||||
if (pAd->UsbVendorReqBuf == NULL) {
|
if (pAd->UsbVendorReqBuf == NULL) {
|
||||||
DBGPRINT(RT_DEBUG_ERROR,
|
DBGPRINT(RT_DEBUG_ERROR,
|
||||||
@ -3544,7 +3544,7 @@ BOOLEAN RtmpRaDevCtrlExit(IN RTMP_ADAPTER * pAd)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* not yet support MBSS */
|
/* not yet support MBSS */
|
||||||
PNET_DEV get_netdev_from_bssid(IN PRTMP_ADAPTER pAd, IN UCHAR FromWhichBSSID)
|
PNET_DEV get_netdev_from_bssid(IN PRTMP_ADAPTER pAd, u8 FromWhichBSSID)
|
||||||
{
|
{
|
||||||
PNET_DEV dev_p = NULL;
|
PNET_DEV dev_p = NULL;
|
||||||
|
|
||||||
|
@ -57,7 +57,7 @@
|
|||||||
|
|
||||||
/* New 8k byte firmware size for RT3071/RT3072 */
|
/* New 8k byte firmware size for RT3071/RT3072 */
|
||||||
#define FIRMWAREIMAGE_MAX_LENGTH 0x2000
|
#define FIRMWAREIMAGE_MAX_LENGTH 0x2000
|
||||||
#define FIRMWAREIMAGE_LENGTH (sizeof (FirmwareImage) / sizeof(UCHAR))
|
#define FIRMWAREIMAGE_LENGTH (sizeof (FirmwareImage) / sizeof(u8))
|
||||||
#define FIRMWARE_MAJOR_VERSION 0
|
#define FIRMWARE_MAJOR_VERSION 0
|
||||||
|
|
||||||
#define FIRMWAREIMAGEV1_LENGTH 0x1000
|
#define FIRMWAREIMAGEV1_LENGTH 0x1000
|
||||||
@ -80,9 +80,9 @@
|
|||||||
|
|
||||||
========================================================================
|
========================================================================
|
||||||
*/
|
*/
|
||||||
INT RtmpAsicEraseFirmware(IN PRTMP_ADAPTER pAd)
|
int RtmpAsicEraseFirmware(IN PRTMP_ADAPTER pAd)
|
||||||
{
|
{
|
||||||
ULONG i;
|
unsigned long i;
|
||||||
|
|
||||||
for (i = 0; i < MAX_FIRMWARE_IMAGE_SIZE; i += 4)
|
for (i = 0; i < MAX_FIRMWARE_IMAGE_SIZE; i += 4)
|
||||||
RTMP_IO_WRITE32(pAd, FIRMWARE_IMAGE_BASE + i, 0);
|
RTMP_IO_WRITE32(pAd, FIRMWARE_IMAGE_BASE + i, 0);
|
||||||
@ -107,15 +107,15 @@ INT RtmpAsicEraseFirmware(IN PRTMP_ADAPTER pAd)
|
|||||||
|
|
||||||
========================================================================
|
========================================================================
|
||||||
*/
|
*/
|
||||||
NDIS_STATUS RtmpAsicLoadFirmware(IN PRTMP_ADAPTER pAd)
|
int RtmpAsicLoadFirmware(IN PRTMP_ADAPTER pAd)
|
||||||
{
|
{
|
||||||
|
|
||||||
NDIS_STATUS Status = NDIS_STATUS_SUCCESS;
|
int Status = NDIS_STATUS_SUCCESS;
|
||||||
PUCHAR pFirmwareImage = NULL;
|
u8 *pFirmwareImage = NULL;
|
||||||
ULONG FileLength, Index;
|
unsigned long FileLength, Index;
|
||||||
UINT32 MacReg = 0;
|
u32 MacReg = 0;
|
||||||
#ifdef RTMP_MAC_USB
|
#ifdef RTMP_MAC_USB
|
||||||
UINT32 Version = (pAd->MACVersion >> 16);
|
u32 Version = (pAd->MACVersion >> 16);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* New 8k byte firmware size for RT3071/RT3072 */
|
/* New 8k byte firmware size for RT3071/RT3072 */
|
||||||
@ -134,7 +134,7 @@ NDIS_STATUS RtmpAsicLoadFirmware(IN PRTMP_ADAPTER pAd)
|
|||||||
if ((Version != 0x2860) && (Version != 0x2872) && (Version != 0x3070)) { /* use the second part */
|
if ((Version != 0x2860) && (Version != 0x2872) && (Version != 0x3070)) { /* use the second part */
|
||||||
/*printk("KH:Use New Version,part2\n"); */
|
/*printk("KH:Use New Version,part2\n"); */
|
||||||
pFirmwareImage =
|
pFirmwareImage =
|
||||||
(PUCHAR) &
|
(u8 *)&
|
||||||
FirmwareImage_3070[FIRMWAREIMAGEV1_LENGTH];
|
FirmwareImage_3070[FIRMWAREIMAGEV1_LENGTH];
|
||||||
FileLength = FIRMWAREIMAGEV2_LENGTH;
|
FileLength = FIRMWAREIMAGEV2_LENGTH;
|
||||||
} else {
|
} else {
|
||||||
@ -172,13 +172,13 @@ NDIS_STATUS RtmpAsicLoadFirmware(IN PRTMP_ADAPTER pAd)
|
|||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
INT RtmpAsicSendCommandToMcu(IN PRTMP_ADAPTER pAd,
|
int RtmpAsicSendCommandToMcu(IN PRTMP_ADAPTER pAd,
|
||||||
IN UCHAR Command,
|
u8 Command,
|
||||||
IN UCHAR Token, IN UCHAR Arg0, IN UCHAR Arg1)
|
u8 Token, u8 Arg0, u8 Arg1)
|
||||||
{
|
{
|
||||||
HOST_CMD_CSR_STRUC H2MCmd;
|
HOST_CMD_CSR_STRUC H2MCmd;
|
||||||
H2M_MAILBOX_STRUC H2MMailbox;
|
H2M_MAILBOX_STRUC H2MMailbox;
|
||||||
ULONG i = 0;
|
unsigned long i = 0;
|
||||||
|
|
||||||
#ifdef PCIE_PS_SUPPORT
|
#ifdef PCIE_PS_SUPPORT
|
||||||
/* 3090F power solution 3 has hw limitation that needs to ban all mcu command */
|
/* 3090F power solution 3 has hw limitation that needs to ban all mcu command */
|
||||||
|
@ -67,9 +67,9 @@ BUILD_TIMER_FUNCTION(RtmpUsbStaAsicForceWakeupTimeout);
|
|||||||
#endif /* RTMP_MAC_USB // */
|
#endif /* RTMP_MAC_USB // */
|
||||||
|
|
||||||
#if defined(AP_LED) || defined(STA_LED)
|
#if defined(AP_LED) || defined(STA_LED)
|
||||||
extern void LedCtrlMain(IN PVOID SystemSpecific1,
|
extern void LedCtrlMain(void *SystemSpecific1,
|
||||||
IN PVOID FunctionContext,
|
void *FunctionContext,
|
||||||
IN PVOID SystemSpecific2, IN PVOID SystemSpecific3);
|
void *SystemSpecific2, void *SystemSpecific3);
|
||||||
BUILD_TIMER_FUNCTION(LedCtrlMain);
|
BUILD_TIMER_FUNCTION(LedCtrlMain);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -119,7 +119,7 @@ static void RtmpTimerQHandle(RTMP_ADAPTER * pAd)
|
|||||||
if ((pTimer->handle != NULL)
|
if ((pTimer->handle != NULL)
|
||||||
&& (!pAd->PM_FlgSuspend))
|
&& (!pAd->PM_FlgSuspend))
|
||||||
pTimer->handle(NULL,
|
pTimer->handle(NULL,
|
||||||
(PVOID) pTimer->cookie,
|
(void *)pTimer->cookie,
|
||||||
NULL, pTimer);
|
NULL, pTimer);
|
||||||
if ((pTimer->Repeat)
|
if ((pTimer->Repeat)
|
||||||
&& (pTimer->State == FALSE))
|
&& (pTimer->State == FALSE))
|
||||||
@ -138,7 +138,7 @@ static void RtmpTimerQHandle(RTMP_ADAPTER * pAd)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
INT RtmpTimerQThread(IN OUT PVOID Context)
|
int RtmpTimerQThread(IN void *Context)
|
||||||
{
|
{
|
||||||
RTMP_OS_TASK *pTask;
|
RTMP_OS_TASK *pTask;
|
||||||
PRTMP_ADAPTER pAd;
|
PRTMP_ADAPTER pAd;
|
||||||
|
@ -261,23 +261,23 @@ DOT11_REGULATORY_INFORMATION JapanRegulatoryInfo[] = {
|
|||||||
|
|
||||||
#define JP_REGULATORY_INFO_SIZE (sizeof(JapanRegulatoryInfo) / sizeof(DOT11_REGULATORY_INFORMATION))
|
#define JP_REGULATORY_INFO_SIZE (sizeof(JapanRegulatoryInfo) / sizeof(DOT11_REGULATORY_INFORMATION))
|
||||||
|
|
||||||
CHAR RTMP_GetTxPwr(IN PRTMP_ADAPTER pAd, IN HTTRANSMIT_SETTING HTTxMode)
|
char RTMP_GetTxPwr(IN PRTMP_ADAPTER pAd, IN HTTRANSMIT_SETTING HTTxMode)
|
||||||
{
|
{
|
||||||
typedef struct __TX_PWR_CFG {
|
typedef struct __TX_PWR_CFG {
|
||||||
UINT8 Mode;
|
u8 Mode;
|
||||||
UINT8 MCS;
|
u8 MCS;
|
||||||
UINT16 req;
|
u16 req;
|
||||||
UINT8 shift;
|
u8 shift;
|
||||||
UINT32 BitMask;
|
u32 BitMask;
|
||||||
} TX_PWR_CFG;
|
} TX_PWR_CFG;
|
||||||
|
|
||||||
UINT32 Value;
|
u32 Value;
|
||||||
INT Idx;
|
int Idx;
|
||||||
UINT8 PhyMode;
|
u8 PhyMode;
|
||||||
CHAR CurTxPwr;
|
char CurTxPwr;
|
||||||
UINT8 TxPwrRef = 0;
|
u8 TxPwrRef = 0;
|
||||||
CHAR DaltaPwr;
|
char DaltaPwr;
|
||||||
ULONG TxPwr[5];
|
unsigned long TxPwr[5];
|
||||||
|
|
||||||
TX_PWR_CFG TxPwrCfg[] = {
|
TX_PWR_CFG TxPwrCfg[] = {
|
||||||
{MODE_CCK, 0, 0, 4, 0x000000f0},
|
{MODE_CCK, 0, 0, 4, 0x000000f0},
|
||||||
@ -385,7 +385,7 @@ CHAR RTMP_GetTxPwr(IN PRTMP_ADAPTER pAd, IN HTTRANSMIT_SETTING HTTxMode)
|
|||||||
&& (TxPwrCfg[Idx].MCS == HTTxMode.field.MCS)) {
|
&& (TxPwrCfg[Idx].MCS == HTTxMode.field.MCS)) {
|
||||||
Value = TxPwr[TxPwrCfg[Idx].req];
|
Value = TxPwr[TxPwrCfg[Idx].req];
|
||||||
DaltaPwr =
|
DaltaPwr =
|
||||||
TxPwrRef - (CHAR) ((Value & TxPwrCfg[Idx].BitMask)
|
TxPwrRef - (char)((Value & TxPwrCfg[Idx].BitMask)
|
||||||
>> TxPwrCfg[Idx].shift);
|
>> TxPwrCfg[Idx].shift);
|
||||||
CurTxPwr -= DaltaPwr;
|
CurTxPwr -= DaltaPwr;
|
||||||
break;
|
break;
|
||||||
@ -395,7 +395,7 @@ CHAR RTMP_GetTxPwr(IN PRTMP_ADAPTER pAd, IN HTTRANSMIT_SETTING HTTxMode)
|
|||||||
return CurTxPwr;
|
return CurTxPwr;
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID MeasureReqTabInit(IN PRTMP_ADAPTER pAd)
|
void MeasureReqTabInit(IN PRTMP_ADAPTER pAd)
|
||||||
{
|
{
|
||||||
NdisAllocateSpinLock(&pAd->CommonCfg.MeasureReqTabLock);
|
NdisAllocateSpinLock(&pAd->CommonCfg.MeasureReqTabLock);
|
||||||
|
|
||||||
@ -412,7 +412,7 @@ VOID MeasureReqTabInit(IN PRTMP_ADAPTER pAd)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID MeasureReqTabExit(IN PRTMP_ADAPTER pAd)
|
void MeasureReqTabExit(IN PRTMP_ADAPTER pAd)
|
||||||
{
|
{
|
||||||
NdisFreeSpinLock(&pAd->CommonCfg.MeasureReqTabLock);
|
NdisFreeSpinLock(&pAd->CommonCfg.MeasureReqTabLock);
|
||||||
|
|
||||||
@ -423,9 +423,9 @@ VOID MeasureReqTabExit(IN PRTMP_ADAPTER pAd)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
PMEASURE_REQ_ENTRY MeasureReqLookUp(IN PRTMP_ADAPTER pAd, IN UINT8 DialogToken)
|
PMEASURE_REQ_ENTRY MeasureReqLookUp(IN PRTMP_ADAPTER pAd, u8 DialogToken)
|
||||||
{
|
{
|
||||||
UINT HashIdx;
|
u32 HashIdx;
|
||||||
PMEASURE_REQ_TAB pTab = pAd->CommonCfg.pMeasureReqTab;
|
PMEASURE_REQ_TAB pTab = pAd->CommonCfg.pMeasureReqTab;
|
||||||
PMEASURE_REQ_ENTRY pEntry = NULL;
|
PMEASURE_REQ_ENTRY pEntry = NULL;
|
||||||
PMEASURE_REQ_ENTRY pPrevEntry = NULL;
|
PMEASURE_REQ_ENTRY pPrevEntry = NULL;
|
||||||
@ -455,13 +455,13 @@ PMEASURE_REQ_ENTRY MeasureReqLookUp(IN PRTMP_ADAPTER pAd, IN UINT8 DialogToken)
|
|||||||
return pEntry;
|
return pEntry;
|
||||||
}
|
}
|
||||||
|
|
||||||
PMEASURE_REQ_ENTRY MeasureReqInsert(IN PRTMP_ADAPTER pAd, IN UINT8 DialogToken)
|
PMEASURE_REQ_ENTRY MeasureReqInsert(IN PRTMP_ADAPTER pAd, u8 DialogToken)
|
||||||
{
|
{
|
||||||
INT i;
|
int i;
|
||||||
ULONG HashIdx;
|
unsigned long HashIdx;
|
||||||
PMEASURE_REQ_TAB pTab = pAd->CommonCfg.pMeasureReqTab;
|
PMEASURE_REQ_TAB pTab = pAd->CommonCfg.pMeasureReqTab;
|
||||||
PMEASURE_REQ_ENTRY pEntry = NULL, pCurrEntry;
|
PMEASURE_REQ_ENTRY pEntry = NULL, pCurrEntry;
|
||||||
ULONG Now;
|
unsigned long Now;
|
||||||
|
|
||||||
if (pTab == NULL) {
|
if (pTab == NULL) {
|
||||||
DBGPRINT(RT_DEBUG_ERROR,
|
DBGPRINT(RT_DEBUG_ERROR,
|
||||||
@ -483,7 +483,7 @@ PMEASURE_REQ_ENTRY MeasureReqInsert(IN PRTMP_ADAPTER pAd, IN UINT8 DialogToken)
|
|||||||
MQ_REQ_AGE_OUT)))
|
MQ_REQ_AGE_OUT)))
|
||||||
{
|
{
|
||||||
PMEASURE_REQ_ENTRY pPrevEntry = NULL;
|
PMEASURE_REQ_ENTRY pPrevEntry = NULL;
|
||||||
ULONG HashIdx =
|
unsigned long HashIdx =
|
||||||
MQ_DIALOGTOKEN_HASH_INDEX(pEntry->
|
MQ_DIALOGTOKEN_HASH_INDEX(pEntry->
|
||||||
DialogToken);
|
DialogToken);
|
||||||
PMEASURE_REQ_ENTRY pProbeEntry =
|
PMEASURE_REQ_ENTRY pProbeEntry =
|
||||||
@ -548,7 +548,7 @@ PMEASURE_REQ_ENTRY MeasureReqInsert(IN PRTMP_ADAPTER pAd, IN UINT8 DialogToken)
|
|||||||
return pEntry;
|
return pEntry;
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID MeasureReqDelete(IN PRTMP_ADAPTER pAd, IN UINT8 DialogToken)
|
void MeasureReqDelete(IN PRTMP_ADAPTER pAd, u8 DialogToken)
|
||||||
{
|
{
|
||||||
PMEASURE_REQ_TAB pTab = pAd->CommonCfg.pMeasureReqTab;
|
PMEASURE_REQ_TAB pTab = pAd->CommonCfg.pMeasureReqTab;
|
||||||
PMEASURE_REQ_ENTRY pEntry = NULL;
|
PMEASURE_REQ_ENTRY pEntry = NULL;
|
||||||
@ -567,7 +567,7 @@ VOID MeasureReqDelete(IN PRTMP_ADAPTER pAd, IN UINT8 DialogToken)
|
|||||||
pEntry = MeasureReqLookUp(pAd, DialogToken);
|
pEntry = MeasureReqLookUp(pAd, DialogToken);
|
||||||
if (pEntry != NULL) {
|
if (pEntry != NULL) {
|
||||||
PMEASURE_REQ_ENTRY pPrevEntry = NULL;
|
PMEASURE_REQ_ENTRY pPrevEntry = NULL;
|
||||||
ULONG HashIdx = MQ_DIALOGTOKEN_HASH_INDEX(pEntry->DialogToken);
|
unsigned long HashIdx = MQ_DIALOGTOKEN_HASH_INDEX(pEntry->DialogToken);
|
||||||
PMEASURE_REQ_ENTRY pProbeEntry = pTab->Hash[HashIdx];
|
PMEASURE_REQ_ENTRY pProbeEntry = pTab->Hash[HashIdx];
|
||||||
|
|
||||||
RTMP_SEM_LOCK(&pAd->CommonCfg.MeasureReqTabLock);
|
RTMP_SEM_LOCK(&pAd->CommonCfg.MeasureReqTabLock);
|
||||||
@ -595,7 +595,7 @@ VOID MeasureReqDelete(IN PRTMP_ADAPTER pAd, IN UINT8 DialogToken)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID TpcReqTabInit(IN PRTMP_ADAPTER pAd)
|
void TpcReqTabInit(IN PRTMP_ADAPTER pAd)
|
||||||
{
|
{
|
||||||
NdisAllocateSpinLock(&pAd->CommonCfg.TpcReqTabLock);
|
NdisAllocateSpinLock(&pAd->CommonCfg.TpcReqTabLock);
|
||||||
|
|
||||||
@ -610,7 +610,7 @@ VOID TpcReqTabInit(IN PRTMP_ADAPTER pAd)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID TpcReqTabExit(IN PRTMP_ADAPTER pAd)
|
void TpcReqTabExit(IN PRTMP_ADAPTER pAd)
|
||||||
{
|
{
|
||||||
NdisFreeSpinLock(&pAd->CommonCfg.TpcReqTabLock);
|
NdisFreeSpinLock(&pAd->CommonCfg.TpcReqTabLock);
|
||||||
|
|
||||||
@ -621,9 +621,9 @@ VOID TpcReqTabExit(IN PRTMP_ADAPTER pAd)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
static PTPC_REQ_ENTRY TpcReqLookUp(IN PRTMP_ADAPTER pAd, IN UINT8 DialogToken)
|
static PTPC_REQ_ENTRY TpcReqLookUp(IN PRTMP_ADAPTER pAd, u8 DialogToken)
|
||||||
{
|
{
|
||||||
UINT HashIdx;
|
u32 HashIdx;
|
||||||
PTPC_REQ_TAB pTab = pAd->CommonCfg.pTpcReqTab;
|
PTPC_REQ_TAB pTab = pAd->CommonCfg.pTpcReqTab;
|
||||||
PTPC_REQ_ENTRY pEntry = NULL;
|
PTPC_REQ_ENTRY pEntry = NULL;
|
||||||
PTPC_REQ_ENTRY pPrevEntry = NULL;
|
PTPC_REQ_ENTRY pPrevEntry = NULL;
|
||||||
@ -653,13 +653,13 @@ static PTPC_REQ_ENTRY TpcReqLookUp(IN PRTMP_ADAPTER pAd, IN UINT8 DialogToken)
|
|||||||
return pEntry;
|
return pEntry;
|
||||||
}
|
}
|
||||||
|
|
||||||
static PTPC_REQ_ENTRY TpcReqInsert(IN PRTMP_ADAPTER pAd, IN UINT8 DialogToken)
|
static PTPC_REQ_ENTRY TpcReqInsert(IN PRTMP_ADAPTER pAd, u8 DialogToken)
|
||||||
{
|
{
|
||||||
INT i;
|
int i;
|
||||||
ULONG HashIdx;
|
unsigned long HashIdx;
|
||||||
PTPC_REQ_TAB pTab = pAd->CommonCfg.pTpcReqTab;
|
PTPC_REQ_TAB pTab = pAd->CommonCfg.pTpcReqTab;
|
||||||
PTPC_REQ_ENTRY pEntry = NULL, pCurrEntry;
|
PTPC_REQ_ENTRY pEntry = NULL, pCurrEntry;
|
||||||
ULONG Now;
|
unsigned long Now;
|
||||||
|
|
||||||
if (pTab == NULL) {
|
if (pTab == NULL) {
|
||||||
DBGPRINT(RT_DEBUG_ERROR,
|
DBGPRINT(RT_DEBUG_ERROR,
|
||||||
@ -681,7 +681,7 @@ static PTPC_REQ_ENTRY TpcReqInsert(IN PRTMP_ADAPTER pAd, IN UINT8 DialogToken)
|
|||||||
TPC_REQ_AGE_OUT)))
|
TPC_REQ_AGE_OUT)))
|
||||||
{
|
{
|
||||||
PTPC_REQ_ENTRY pPrevEntry = NULL;
|
PTPC_REQ_ENTRY pPrevEntry = NULL;
|
||||||
ULONG HashIdx =
|
unsigned long HashIdx =
|
||||||
TPC_DIALOGTOKEN_HASH_INDEX(pEntry->
|
TPC_DIALOGTOKEN_HASH_INDEX(pEntry->
|
||||||
DialogToken);
|
DialogToken);
|
||||||
PTPC_REQ_ENTRY pProbeEntry =
|
PTPC_REQ_ENTRY pProbeEntry =
|
||||||
@ -745,7 +745,7 @@ static PTPC_REQ_ENTRY TpcReqInsert(IN PRTMP_ADAPTER pAd, IN UINT8 DialogToken)
|
|||||||
return pEntry;
|
return pEntry;
|
||||||
}
|
}
|
||||||
|
|
||||||
static VOID TpcReqDelete(IN PRTMP_ADAPTER pAd, IN UINT8 DialogToken)
|
static void TpcReqDelete(IN PRTMP_ADAPTER pAd, u8 DialogToken)
|
||||||
{
|
{
|
||||||
PTPC_REQ_TAB pTab = pAd->CommonCfg.pTpcReqTab;
|
PTPC_REQ_TAB pTab = pAd->CommonCfg.pTpcReqTab;
|
||||||
PTPC_REQ_ENTRY pEntry = NULL;
|
PTPC_REQ_ENTRY pEntry = NULL;
|
||||||
@ -764,7 +764,7 @@ static VOID TpcReqDelete(IN PRTMP_ADAPTER pAd, IN UINT8 DialogToken)
|
|||||||
pEntry = TpcReqLookUp(pAd, DialogToken);
|
pEntry = TpcReqLookUp(pAd, DialogToken);
|
||||||
if (pEntry != NULL) {
|
if (pEntry != NULL) {
|
||||||
PTPC_REQ_ENTRY pPrevEntry = NULL;
|
PTPC_REQ_ENTRY pPrevEntry = NULL;
|
||||||
ULONG HashIdx = TPC_DIALOGTOKEN_HASH_INDEX(pEntry->DialogToken);
|
unsigned long HashIdx = TPC_DIALOGTOKEN_HASH_INDEX(pEntry->DialogToken);
|
||||||
PTPC_REQ_ENTRY pProbeEntry = pTab->Hash[HashIdx];
|
PTPC_REQ_ENTRY pProbeEntry = pTab->Hash[HashIdx];
|
||||||
|
|
||||||
RTMP_SEM_LOCK(&pAd->CommonCfg.TpcReqTabLock);
|
RTMP_SEM_LOCK(&pAd->CommonCfg.TpcReqTabLock);
|
||||||
@ -802,7 +802,7 @@ static VOID TpcReqDelete(IN PRTMP_ADAPTER pAd, IN UINT8 DialogToken)
|
|||||||
Return : Current Time Stamp.
|
Return : Current Time Stamp.
|
||||||
==========================================================================
|
==========================================================================
|
||||||
*/
|
*/
|
||||||
static UINT64 GetCurrentTimeStamp(IN PRTMP_ADAPTER pAd)
|
static u64 GetCurrentTimeStamp(IN PRTMP_ADAPTER pAd)
|
||||||
{
|
{
|
||||||
/* get current time stamp. */
|
/* get current time stamp. */
|
||||||
return 0;
|
return 0;
|
||||||
@ -818,7 +818,7 @@ static UINT64 GetCurrentTimeStamp(IN PRTMP_ADAPTER pAd)
|
|||||||
Return : Current Time Stamp.
|
Return : Current Time Stamp.
|
||||||
==========================================================================
|
==========================================================================
|
||||||
*/
|
*/
|
||||||
static UINT8 GetCurTxPwr(IN PRTMP_ADAPTER pAd, IN UINT8 Wcid)
|
static u8 GetCurTxPwr(IN PRTMP_ADAPTER pAd, u8 Wcid)
|
||||||
{
|
{
|
||||||
return 16; /* 16 dBm */
|
return 16; /* 16 dBm */
|
||||||
}
|
}
|
||||||
@ -833,15 +833,15 @@ static UINT8 GetCurTxPwr(IN PRTMP_ADAPTER pAd, IN UINT8 Wcid)
|
|||||||
Return : Current Time Stamp.
|
Return : Current Time Stamp.
|
||||||
==========================================================================
|
==========================================================================
|
||||||
*/
|
*/
|
||||||
VOID InsertChannelRepIE(IN PRTMP_ADAPTER pAd,
|
void InsertChannelRepIE(IN PRTMP_ADAPTER pAd,
|
||||||
OUT PUCHAR pFrameBuf,
|
u8 *pFrameBuf,
|
||||||
OUT PULONG pFrameLen,
|
unsigned long *pFrameLen,
|
||||||
IN PSTRING pCountry, IN UINT8 RegulatoryClass)
|
char *pCountry, u8 RegulatoryClass)
|
||||||
{
|
{
|
||||||
ULONG TempLen;
|
unsigned long TempLen;
|
||||||
UINT8 Len;
|
u8 Len;
|
||||||
UINT8 IEId = IE_AP_CHANNEL_REPORT;
|
u8 IEId = IE_AP_CHANNEL_REPORT;
|
||||||
PUCHAR pChListPtr = NULL;
|
u8 *pChListPtr = NULL;
|
||||||
|
|
||||||
Len = 1;
|
Len = 1;
|
||||||
if (strncmp(pCountry, "US", 2) == 0) {
|
if (strncmp(pCountry, "US", 2) == 0) {
|
||||||
@ -900,11 +900,11 @@ VOID InsertChannelRepIE(IN PRTMP_ADAPTER pAd,
|
|||||||
Return : None.
|
Return : None.
|
||||||
==========================================================================
|
==========================================================================
|
||||||
*/
|
*/
|
||||||
VOID InsertDialogToken(IN PRTMP_ADAPTER pAd,
|
void InsertDialogToken(IN PRTMP_ADAPTER pAd,
|
||||||
OUT PUCHAR pFrameBuf,
|
u8 *pFrameBuf,
|
||||||
OUT PULONG pFrameLen, IN UINT8 DialogToken)
|
unsigned long *pFrameLen, u8 DialogToken)
|
||||||
{
|
{
|
||||||
ULONG TempLen;
|
unsigned long TempLen;
|
||||||
MakeOutgoingFrame(pFrameBuf, &TempLen, 1, &DialogToken, END_OF_ARGS);
|
MakeOutgoingFrame(pFrameBuf, &TempLen, 1, &DialogToken, END_OF_ARGS);
|
||||||
|
|
||||||
*pFrameLen = *pFrameLen + TempLen;
|
*pFrameLen = *pFrameLen + TempLen;
|
||||||
@ -924,12 +924,12 @@ VOID InsertDialogToken(IN PRTMP_ADAPTER pAd,
|
|||||||
Return : None.
|
Return : None.
|
||||||
==========================================================================
|
==========================================================================
|
||||||
*/
|
*/
|
||||||
static VOID InsertTpcReqIE(IN PRTMP_ADAPTER pAd,
|
static void InsertTpcReqIE(IN PRTMP_ADAPTER pAd,
|
||||||
OUT PUCHAR pFrameBuf, OUT PULONG pFrameLen)
|
u8 *pFrameBuf, unsigned long *pFrameLen)
|
||||||
{
|
{
|
||||||
ULONG TempLen;
|
unsigned long TempLen;
|
||||||
ULONG Len = 0;
|
unsigned long Len = 0;
|
||||||
UINT8 ElementID = IE_TPC_REQUEST;
|
u8 ElementID = IE_TPC_REQUEST;
|
||||||
|
|
||||||
MakeOutgoingFrame(pFrameBuf, &TempLen,
|
MakeOutgoingFrame(pFrameBuf, &TempLen,
|
||||||
1, &ElementID, 1, &Len, END_OF_ARGS);
|
1, &ElementID, 1, &Len, END_OF_ARGS);
|
||||||
@ -953,14 +953,14 @@ static VOID InsertTpcReqIE(IN PRTMP_ADAPTER pAd,
|
|||||||
Return : None.
|
Return : None.
|
||||||
==========================================================================
|
==========================================================================
|
||||||
*/
|
*/
|
||||||
VOID InsertTpcReportIE(IN PRTMP_ADAPTER pAd,
|
void InsertTpcReportIE(IN PRTMP_ADAPTER pAd,
|
||||||
OUT PUCHAR pFrameBuf,
|
u8 *pFrameBuf,
|
||||||
OUT PULONG pFrameLen,
|
unsigned long *pFrameLen,
|
||||||
IN UINT8 TxPwr, IN UINT8 LinkMargin)
|
u8 TxPwr, u8 LinkMargin)
|
||||||
{
|
{
|
||||||
ULONG TempLen;
|
unsigned long TempLen;
|
||||||
ULONG Len = sizeof(TPC_REPORT_INFO);
|
unsigned long Len = sizeof(TPC_REPORT_INFO);
|
||||||
UINT8 ElementID = IE_TPC_REPORT;
|
u8 ElementID = IE_TPC_REPORT;
|
||||||
TPC_REPORT_INFO TpcReportIE;
|
TPC_REPORT_INFO TpcReportIE;
|
||||||
|
|
||||||
TpcReportIE.TxPwr = TxPwr;
|
TpcReportIE.TxPwr = TxPwr;
|
||||||
@ -990,15 +990,15 @@ VOID InsertTpcReportIE(IN PRTMP_ADAPTER pAd,
|
|||||||
Return : None.
|
Return : None.
|
||||||
==========================================================================
|
==========================================================================
|
||||||
*/
|
*/
|
||||||
static VOID InsertChSwAnnIE(IN PRTMP_ADAPTER pAd,
|
static void InsertChSwAnnIE(IN PRTMP_ADAPTER pAd,
|
||||||
OUT PUCHAR pFrameBuf,
|
u8 *pFrameBuf,
|
||||||
OUT PULONG pFrameLen,
|
unsigned long *pFrameLen,
|
||||||
IN UINT8 ChSwMode,
|
u8 ChSwMode,
|
||||||
IN UINT8 NewChannel, IN UINT8 ChSwCnt)
|
u8 NewChannel, u8 ChSwCnt)
|
||||||
{
|
{
|
||||||
ULONG TempLen;
|
unsigned long TempLen;
|
||||||
ULONG Len = sizeof(CH_SW_ANN_INFO);
|
unsigned long Len = sizeof(CH_SW_ANN_INFO);
|
||||||
UINT8 ElementID = IE_CHANNEL_SWITCH_ANNOUNCEMENT;
|
u8 ElementID = IE_CHANNEL_SWITCH_ANNOUNCEMENT;
|
||||||
CH_SW_ANN_INFO ChSwAnnIE;
|
CH_SW_ANN_INFO ChSwAnnIE;
|
||||||
|
|
||||||
ChSwAnnIE.ChSwMode = ChSwMode;
|
ChSwAnnIE.ChSwMode = ChSwMode;
|
||||||
@ -1031,13 +1031,13 @@ static VOID InsertChSwAnnIE(IN PRTMP_ADAPTER pAd,
|
|||||||
Return : None.
|
Return : None.
|
||||||
==========================================================================
|
==========================================================================
|
||||||
*/
|
*/
|
||||||
static VOID InsertMeasureReqIE(IN PRTMP_ADAPTER pAd,
|
static void InsertMeasureReqIE(IN PRTMP_ADAPTER pAd,
|
||||||
OUT PUCHAR pFrameBuf,
|
u8 *pFrameBuf,
|
||||||
OUT PULONG pFrameLen,
|
unsigned long *pFrameLen,
|
||||||
IN UINT8 Len, IN PMEASURE_REQ_INFO pMeasureReqIE)
|
u8 Len, IN PMEASURE_REQ_INFO pMeasureReqIE)
|
||||||
{
|
{
|
||||||
ULONG TempLen;
|
unsigned long TempLen;
|
||||||
UINT8 ElementID = IE_MEASUREMENT_REQUEST;
|
u8 ElementID = IE_MEASUREMENT_REQUEST;
|
||||||
|
|
||||||
MakeOutgoingFrame(pFrameBuf, &TempLen,
|
MakeOutgoingFrame(pFrameBuf, &TempLen,
|
||||||
1, &ElementID,
|
1, &ElementID,
|
||||||
@ -1066,15 +1066,15 @@ static VOID InsertMeasureReqIE(IN PRTMP_ADAPTER pAd,
|
|||||||
Return : None.
|
Return : None.
|
||||||
==========================================================================
|
==========================================================================
|
||||||
*/
|
*/
|
||||||
static VOID InsertMeasureReportIE(IN PRTMP_ADAPTER pAd,
|
static void InsertMeasureReportIE(IN PRTMP_ADAPTER pAd,
|
||||||
OUT PUCHAR pFrameBuf,
|
u8 *pFrameBuf,
|
||||||
OUT PULONG pFrameLen,
|
unsigned long *pFrameLen,
|
||||||
IN PMEASURE_REPORT_INFO pMeasureReportIE,
|
IN PMEASURE_REPORT_INFO pMeasureReportIE,
|
||||||
IN UINT8 ReportLnfoLen, IN PUINT8 pReportInfo)
|
u8 ReportLnfoLen, u8 *pReportInfo)
|
||||||
{
|
{
|
||||||
ULONG TempLen;
|
unsigned long TempLen;
|
||||||
ULONG Len;
|
unsigned long Len;
|
||||||
UINT8 ElementID = IE_MEASUREMENT_REPORT;
|
u8 ElementID = IE_MEASUREMENT_REPORT;
|
||||||
|
|
||||||
Len = sizeof(MEASURE_REPORT_INFO) + ReportLnfoLen;
|
Len = sizeof(MEASURE_REPORT_INFO) + ReportLnfoLen;
|
||||||
|
|
||||||
@ -1105,17 +1105,17 @@ static VOID InsertMeasureReportIE(IN PRTMP_ADAPTER pAd,
|
|||||||
Return : None.
|
Return : None.
|
||||||
==========================================================================
|
==========================================================================
|
||||||
*/
|
*/
|
||||||
VOID MakeMeasurementReqFrame(IN PRTMP_ADAPTER pAd,
|
void MakeMeasurementReqFrame(IN PRTMP_ADAPTER pAd,
|
||||||
OUT PUCHAR pOutBuffer,
|
u8 *pOutBuffer,
|
||||||
OUT PULONG pFrameLen,
|
unsigned long *pFrameLen,
|
||||||
IN UINT8 TotalLen,
|
u8 TotalLen,
|
||||||
IN UINT8 Category,
|
u8 Category,
|
||||||
IN UINT8 Action,
|
u8 Action,
|
||||||
IN UINT8 MeasureToken,
|
u8 MeasureToken,
|
||||||
IN UINT8 MeasureReqMode,
|
u8 MeasureReqMode,
|
||||||
IN UINT8 MeasureReqType, IN UINT8 NumOfRepetitions)
|
u8 MeasureReqType, u8 NumOfRepetitions)
|
||||||
{
|
{
|
||||||
ULONG TempLen;
|
unsigned long TempLen;
|
||||||
MEASURE_REQ_INFO MeasureReqIE;
|
MEASURE_REQ_INFO MeasureReqIE;
|
||||||
|
|
||||||
InsertActField(pAd, (pOutBuffer + *pFrameLen), pFrameLen, Category,
|
InsertActField(pAd, (pOutBuffer + *pFrameLen), pFrameLen, Category,
|
||||||
@ -1155,17 +1155,17 @@ VOID MakeMeasurementReqFrame(IN PRTMP_ADAPTER pAd,
|
|||||||
Return : None.
|
Return : None.
|
||||||
==========================================================================
|
==========================================================================
|
||||||
*/
|
*/
|
||||||
VOID EnqueueMeasurementRep(IN PRTMP_ADAPTER pAd,
|
void EnqueueMeasurementRep(IN PRTMP_ADAPTER pAd,
|
||||||
IN PUCHAR pDA,
|
u8 *pDA,
|
||||||
IN UINT8 DialogToken,
|
u8 DialogToken,
|
||||||
IN UINT8 MeasureToken,
|
u8 MeasureToken,
|
||||||
IN UINT8 MeasureReqMode,
|
u8 MeasureReqMode,
|
||||||
IN UINT8 MeasureReqType,
|
u8 MeasureReqType,
|
||||||
IN UINT8 ReportInfoLen, IN PUINT8 pReportInfo)
|
u8 ReportInfoLen, u8 *pReportInfo)
|
||||||
{
|
{
|
||||||
PUCHAR pOutBuffer = NULL;
|
u8 *pOutBuffer = NULL;
|
||||||
NDIS_STATUS NStatus;
|
int NStatus;
|
||||||
ULONG FrameLen;
|
unsigned long FrameLen;
|
||||||
HEADER_802_11 ActHdr;
|
HEADER_802_11 ActHdr;
|
||||||
MEASURE_REPORT_INFO MeasureRepIE;
|
MEASURE_REPORT_INFO MeasureRepIE;
|
||||||
|
|
||||||
@ -1173,13 +1173,13 @@ VOID EnqueueMeasurementRep(IN PRTMP_ADAPTER pAd,
|
|||||||
MgtMacHeaderInit(pAd, &ActHdr, SUBTYPE_ACTION, 0, pDA,
|
MgtMacHeaderInit(pAd, &ActHdr, SUBTYPE_ACTION, 0, pDA,
|
||||||
pAd->CurrentAddress);
|
pAd->CurrentAddress);
|
||||||
|
|
||||||
NStatus = MlmeAllocateMemory(pAd, (PVOID) & pOutBuffer); /*Get an unused nonpaged memory */
|
NStatus = MlmeAllocateMemory(pAd, (void *)& pOutBuffer); /*Get an unused nonpaged memory */
|
||||||
if (NStatus != NDIS_STATUS_SUCCESS) {
|
if (NStatus != NDIS_STATUS_SUCCESS) {
|
||||||
DBGPRINT(RT_DEBUG_TRACE,
|
DBGPRINT(RT_DEBUG_TRACE,
|
||||||
("%s() allocate memory failed \n", __func__));
|
("%s() allocate memory failed \n", __func__));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
NdisMoveMemory(pOutBuffer, (PCHAR) & ActHdr, sizeof(HEADER_802_11));
|
NdisMoveMemory(pOutBuffer, (char *)& ActHdr, sizeof(HEADER_802_11));
|
||||||
FrameLen = sizeof(HEADER_802_11);
|
FrameLen = sizeof(HEADER_802_11);
|
||||||
|
|
||||||
InsertActField(pAd, (pOutBuffer + FrameLen), &FrameLen,
|
InsertActField(pAd, (pOutBuffer + FrameLen), &FrameLen,
|
||||||
@ -1214,11 +1214,11 @@ VOID EnqueueMeasurementRep(IN PRTMP_ADAPTER pAd,
|
|||||||
Return : None.
|
Return : None.
|
||||||
==========================================================================
|
==========================================================================
|
||||||
*/
|
*/
|
||||||
VOID EnqueueTPCReq(IN PRTMP_ADAPTER pAd, IN PUCHAR pDA, IN UCHAR DialogToken)
|
void EnqueueTPCReq(IN PRTMP_ADAPTER pAd, u8 *pDA, u8 DialogToken)
|
||||||
{
|
{
|
||||||
PUCHAR pOutBuffer = NULL;
|
u8 *pOutBuffer = NULL;
|
||||||
NDIS_STATUS NStatus;
|
int NStatus;
|
||||||
ULONG FrameLen;
|
unsigned long FrameLen;
|
||||||
|
|
||||||
HEADER_802_11 ActHdr;
|
HEADER_802_11 ActHdr;
|
||||||
|
|
||||||
@ -1226,13 +1226,13 @@ VOID EnqueueTPCReq(IN PRTMP_ADAPTER pAd, IN PUCHAR pDA, IN UCHAR DialogToken)
|
|||||||
MgtMacHeaderInit(pAd, &ActHdr, SUBTYPE_ACTION, 0, pDA,
|
MgtMacHeaderInit(pAd, &ActHdr, SUBTYPE_ACTION, 0, pDA,
|
||||||
pAd->CurrentAddress);
|
pAd->CurrentAddress);
|
||||||
|
|
||||||
NStatus = MlmeAllocateMemory(pAd, (PVOID) & pOutBuffer); /*Get an unused nonpaged memory */
|
NStatus = MlmeAllocateMemory(pAd, (void *)& pOutBuffer); /*Get an unused nonpaged memory */
|
||||||
if (NStatus != NDIS_STATUS_SUCCESS) {
|
if (NStatus != NDIS_STATUS_SUCCESS) {
|
||||||
DBGPRINT(RT_DEBUG_TRACE,
|
DBGPRINT(RT_DEBUG_TRACE,
|
||||||
("%s() allocate memory failed \n", __func__));
|
("%s() allocate memory failed \n", __func__));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
NdisMoveMemory(pOutBuffer, (PCHAR) & ActHdr, sizeof(HEADER_802_11));
|
NdisMoveMemory(pOutBuffer, (char *)& ActHdr, sizeof(HEADER_802_11));
|
||||||
FrameLen = sizeof(HEADER_802_11);
|
FrameLen = sizeof(HEADER_802_11);
|
||||||
|
|
||||||
InsertActField(pAd, (pOutBuffer + FrameLen), &FrameLen,
|
InsertActField(pAd, (pOutBuffer + FrameLen), &FrameLen,
|
||||||
@ -1262,13 +1262,13 @@ VOID EnqueueTPCReq(IN PRTMP_ADAPTER pAd, IN PUCHAR pDA, IN UCHAR DialogToken)
|
|||||||
Return : None.
|
Return : None.
|
||||||
==========================================================================
|
==========================================================================
|
||||||
*/
|
*/
|
||||||
VOID EnqueueTPCRep(IN PRTMP_ADAPTER pAd,
|
void EnqueueTPCRep(IN PRTMP_ADAPTER pAd,
|
||||||
IN PUCHAR pDA,
|
u8 *pDA,
|
||||||
IN UINT8 DialogToken, IN UINT8 TxPwr, IN UINT8 LinkMargin)
|
u8 DialogToken, u8 TxPwr, u8 LinkMargin)
|
||||||
{
|
{
|
||||||
PUCHAR pOutBuffer = NULL;
|
u8 *pOutBuffer = NULL;
|
||||||
NDIS_STATUS NStatus;
|
int NStatus;
|
||||||
ULONG FrameLen;
|
unsigned long FrameLen;
|
||||||
|
|
||||||
HEADER_802_11 ActHdr;
|
HEADER_802_11 ActHdr;
|
||||||
|
|
||||||
@ -1276,13 +1276,13 @@ VOID EnqueueTPCRep(IN PRTMP_ADAPTER pAd,
|
|||||||
MgtMacHeaderInit(pAd, &ActHdr, SUBTYPE_ACTION, 0, pDA,
|
MgtMacHeaderInit(pAd, &ActHdr, SUBTYPE_ACTION, 0, pDA,
|
||||||
pAd->CurrentAddress);
|
pAd->CurrentAddress);
|
||||||
|
|
||||||
NStatus = MlmeAllocateMemory(pAd, (PVOID) & pOutBuffer); /*Get an unused nonpaged memory */
|
NStatus = MlmeAllocateMemory(pAd, (void *)& pOutBuffer); /*Get an unused nonpaged memory */
|
||||||
if (NStatus != NDIS_STATUS_SUCCESS) {
|
if (NStatus != NDIS_STATUS_SUCCESS) {
|
||||||
DBGPRINT(RT_DEBUG_TRACE,
|
DBGPRINT(RT_DEBUG_TRACE,
|
||||||
("%s() allocate memory failed \n", __func__));
|
("%s() allocate memory failed \n", __func__));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
NdisMoveMemory(pOutBuffer, (PCHAR) & ActHdr, sizeof(HEADER_802_11));
|
NdisMoveMemory(pOutBuffer, (char *)& ActHdr, sizeof(HEADER_802_11));
|
||||||
FrameLen = sizeof(HEADER_802_11);
|
FrameLen = sizeof(HEADER_802_11);
|
||||||
|
|
||||||
InsertActField(pAd, (pOutBuffer + FrameLen), &FrameLen,
|
InsertActField(pAd, (pOutBuffer + FrameLen), &FrameLen,
|
||||||
@ -1315,12 +1315,12 @@ VOID EnqueueTPCRep(IN PRTMP_ADAPTER pAd,
|
|||||||
Return : None.
|
Return : None.
|
||||||
==========================================================================
|
==========================================================================
|
||||||
*/
|
*/
|
||||||
VOID EnqueueChSwAnn(IN PRTMP_ADAPTER pAd,
|
void EnqueueChSwAnn(IN PRTMP_ADAPTER pAd,
|
||||||
IN PUCHAR pDA, IN UINT8 ChSwMode, IN UINT8 NewCh)
|
u8 *pDA, u8 ChSwMode, u8 NewCh)
|
||||||
{
|
{
|
||||||
PUCHAR pOutBuffer = NULL;
|
u8 *pOutBuffer = NULL;
|
||||||
NDIS_STATUS NStatus;
|
int NStatus;
|
||||||
ULONG FrameLen;
|
unsigned long FrameLen;
|
||||||
|
|
||||||
HEADER_802_11 ActHdr;
|
HEADER_802_11 ActHdr;
|
||||||
|
|
||||||
@ -1328,13 +1328,13 @@ VOID EnqueueChSwAnn(IN PRTMP_ADAPTER pAd,
|
|||||||
MgtMacHeaderInit(pAd, &ActHdr, SUBTYPE_ACTION, 0, pDA,
|
MgtMacHeaderInit(pAd, &ActHdr, SUBTYPE_ACTION, 0, pDA,
|
||||||
pAd->CurrentAddress);
|
pAd->CurrentAddress);
|
||||||
|
|
||||||
NStatus = MlmeAllocateMemory(pAd, (PVOID) & pOutBuffer); /*Get an unused nonpaged memory */
|
NStatus = MlmeAllocateMemory(pAd, (void *)& pOutBuffer); /*Get an unused nonpaged memory */
|
||||||
if (NStatus != NDIS_STATUS_SUCCESS) {
|
if (NStatus != NDIS_STATUS_SUCCESS) {
|
||||||
DBGPRINT(RT_DEBUG_TRACE,
|
DBGPRINT(RT_DEBUG_TRACE,
|
||||||
("%s() allocate memory failed \n", __func__));
|
("%s() allocate memory failed \n", __func__));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
NdisMoveMemory(pOutBuffer, (PCHAR) & ActHdr, sizeof(HEADER_802_11));
|
NdisMoveMemory(pOutBuffer, (char *)& ActHdr, sizeof(HEADER_802_11));
|
||||||
FrameLen = sizeof(HEADER_802_11);
|
FrameLen = sizeof(HEADER_802_11);
|
||||||
|
|
||||||
InsertActField(pAd, (pOutBuffer + FrameLen), &FrameLen,
|
InsertActField(pAd, (pOutBuffer + FrameLen), &FrameLen,
|
||||||
@ -1349,10 +1349,10 @@ VOID EnqueueChSwAnn(IN PRTMP_ADAPTER pAd,
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
static BOOLEAN DfsRequirementCheck(IN PRTMP_ADAPTER pAd, IN UINT8 Channel)
|
static BOOLEAN DfsRequirementCheck(IN PRTMP_ADAPTER pAd, u8 Channel)
|
||||||
{
|
{
|
||||||
BOOLEAN Result = FALSE;
|
BOOLEAN Result = FALSE;
|
||||||
INT i;
|
int i;
|
||||||
|
|
||||||
do {
|
do {
|
||||||
/* check DFS procedure is running. */
|
/* check DFS procedure is running. */
|
||||||
@ -1376,14 +1376,14 @@ static BOOLEAN DfsRequirementCheck(IN PRTMP_ADAPTER pAd, IN UINT8 Channel)
|
|||||||
return Result;
|
return Result;
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID NotifyChSwAnnToPeerAPs(IN PRTMP_ADAPTER pAd,
|
void NotifyChSwAnnToPeerAPs(IN PRTMP_ADAPTER pAd,
|
||||||
IN PUCHAR pRA,
|
u8 *pRA,
|
||||||
IN PUCHAR pTA, IN UINT8 ChSwMode, IN UINT8 Channel)
|
u8 *pTA, u8 ChSwMode, u8 Channel)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
static VOID StartDFSProcedure(IN PRTMP_ADAPTER pAd,
|
static void StartDFSProcedure(IN PRTMP_ADAPTER pAd,
|
||||||
IN UCHAR Channel, IN UINT8 ChSwMode)
|
u8 Channel, u8 ChSwMode)
|
||||||
{
|
{
|
||||||
/* start DFS procedure */
|
/* start DFS procedure */
|
||||||
pAd->CommonCfg.Channel = Channel;
|
pAd->CommonCfg.Channel = Channel;
|
||||||
@ -1416,12 +1416,12 @@ static VOID StartDFSProcedure(IN PRTMP_ADAPTER pAd,
|
|||||||
1 1 1 1 1
|
1 1 1 1 1
|
||||||
*/
|
*/
|
||||||
static BOOLEAN PeerChSwAnnSanity(IN PRTMP_ADAPTER pAd,
|
static BOOLEAN PeerChSwAnnSanity(IN PRTMP_ADAPTER pAd,
|
||||||
IN VOID * pMsg,
|
void * pMsg,
|
||||||
IN ULONG MsgLen,
|
unsigned long MsgLen,
|
||||||
OUT PCH_SW_ANN_INFO pChSwAnnInfo)
|
OUT PCH_SW_ANN_INFO pChSwAnnInfo)
|
||||||
{
|
{
|
||||||
PFRAME_802_11 Fr = (PFRAME_802_11) pMsg;
|
PFRAME_802_11 Fr = (PFRAME_802_11) pMsg;
|
||||||
PUCHAR pFramePtr = Fr->Octet;
|
u8 *pFramePtr = Fr->Octet;
|
||||||
BOOLEAN result = FALSE;
|
BOOLEAN result = FALSE;
|
||||||
PEID_STRUCT eid_ptr;
|
PEID_STRUCT eid_ptr;
|
||||||
|
|
||||||
@ -1436,8 +1436,8 @@ static BOOLEAN PeerChSwAnnSanity(IN PRTMP_ADAPTER pAd,
|
|||||||
return result;
|
return result;
|
||||||
|
|
||||||
eid_ptr = (PEID_STRUCT) pFramePtr;
|
eid_ptr = (PEID_STRUCT) pFramePtr;
|
||||||
while (((UCHAR *) eid_ptr + eid_ptr->Len + 1) <
|
while (((u8 *) eid_ptr + eid_ptr->Len + 1) <
|
||||||
((PUCHAR) pFramePtr + MsgLen)) {
|
((u8 *)pFramePtr + MsgLen)) {
|
||||||
switch (eid_ptr->Eid) {
|
switch (eid_ptr->Eid) {
|
||||||
case IE_CHANNEL_SWITCH_ANNOUNCEMENT:
|
case IE_CHANNEL_SWITCH_ANNOUNCEMENT:
|
||||||
NdisMoveMemory(&pChSwAnnInfo->ChSwMode, eid_ptr->Octet,
|
NdisMoveMemory(&pChSwAnnInfo->ChSwMode, eid_ptr->Octet,
|
||||||
@ -1453,7 +1453,7 @@ static BOOLEAN PeerChSwAnnSanity(IN PRTMP_ADAPTER pAd,
|
|||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
eid_ptr = (PEID_STRUCT) ((UCHAR *) eid_ptr + 2 + eid_ptr->Len);
|
eid_ptr = (PEID_STRUCT) ((u8 *) eid_ptr + 2 + eid_ptr->Len);
|
||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
@ -1473,19 +1473,19 @@ static BOOLEAN PeerChSwAnnSanity(IN PRTMP_ADAPTER pAd,
|
|||||||
==========================================================================
|
==========================================================================
|
||||||
*/
|
*/
|
||||||
static BOOLEAN PeerMeasureReqSanity(IN PRTMP_ADAPTER pAd,
|
static BOOLEAN PeerMeasureReqSanity(IN PRTMP_ADAPTER pAd,
|
||||||
IN VOID * pMsg,
|
void * pMsg,
|
||||||
IN ULONG MsgLen,
|
unsigned long MsgLen,
|
||||||
OUT PUINT8 pDialogToken,
|
u8 *pDialogToken,
|
||||||
OUT PMEASURE_REQ_INFO pMeasureReqInfo,
|
OUT PMEASURE_REQ_INFO pMeasureReqInfo,
|
||||||
OUT PMEASURE_REQ pMeasureReq)
|
OUT PMEASURE_REQ pMeasureReq)
|
||||||
{
|
{
|
||||||
PFRAME_802_11 Fr = (PFRAME_802_11) pMsg;
|
PFRAME_802_11 Fr = (PFRAME_802_11) pMsg;
|
||||||
PUCHAR pFramePtr = Fr->Octet;
|
u8 *pFramePtr = Fr->Octet;
|
||||||
BOOLEAN result = FALSE;
|
BOOLEAN result = FALSE;
|
||||||
PEID_STRUCT eid_ptr;
|
PEID_STRUCT eid_ptr;
|
||||||
PUCHAR ptr;
|
u8 *ptr;
|
||||||
UINT64 MeasureStartTime;
|
u64 MeasureStartTime;
|
||||||
UINT16 MeasureDuration;
|
u16 MeasureDuration;
|
||||||
|
|
||||||
/* skip 802.11 header. */
|
/* skip 802.11 header. */
|
||||||
MsgLen -= sizeof(HEADER_802_11);
|
MsgLen -= sizeof(HEADER_802_11);
|
||||||
@ -1502,8 +1502,8 @@ static BOOLEAN PeerMeasureReqSanity(IN PRTMP_ADAPTER pAd,
|
|||||||
MsgLen -= 1;
|
MsgLen -= 1;
|
||||||
|
|
||||||
eid_ptr = (PEID_STRUCT) pFramePtr;
|
eid_ptr = (PEID_STRUCT) pFramePtr;
|
||||||
while (((UCHAR *) eid_ptr + eid_ptr->Len + 1) <
|
while (((u8 *) eid_ptr + eid_ptr->Len + 1) <
|
||||||
((PUCHAR) pFramePtr + MsgLen)) {
|
((u8 *)pFramePtr + MsgLen)) {
|
||||||
switch (eid_ptr->Eid) {
|
switch (eid_ptr->Eid) {
|
||||||
case IE_MEASUREMENT_REQUEST:
|
case IE_MEASUREMENT_REQUEST:
|
||||||
NdisMoveMemory(&pMeasureReqInfo->Token, eid_ptr->Octet,
|
NdisMoveMemory(&pMeasureReqInfo->Token, eid_ptr->Octet,
|
||||||
@ -1512,7 +1512,7 @@ static BOOLEAN PeerMeasureReqSanity(IN PRTMP_ADAPTER pAd,
|
|||||||
eid_ptr->Octet + 1, 1);
|
eid_ptr->Octet + 1, 1);
|
||||||
NdisMoveMemory(&pMeasureReqInfo->ReqType,
|
NdisMoveMemory(&pMeasureReqInfo->ReqType,
|
||||||
eid_ptr->Octet + 2, 1);
|
eid_ptr->Octet + 2, 1);
|
||||||
ptr = (PUCHAR) (eid_ptr->Octet + 3);
|
ptr = (u8 *)(eid_ptr->Octet + 3);
|
||||||
NdisMoveMemory(&pMeasureReq->ChNum, ptr, 1);
|
NdisMoveMemory(&pMeasureReq->ChNum, ptr, 1);
|
||||||
NdisMoveMemory(&MeasureStartTime, ptr + 1, 8);
|
NdisMoveMemory(&MeasureStartTime, ptr + 1, 8);
|
||||||
pMeasureReq->MeasureStartTime =
|
pMeasureReq->MeasureStartTime =
|
||||||
@ -1526,7 +1526,7 @@ static BOOLEAN PeerMeasureReqSanity(IN PRTMP_ADAPTER pAd,
|
|||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
eid_ptr = (PEID_STRUCT) ((UCHAR *) eid_ptr + 2 + eid_ptr->Len);
|
eid_ptr = (PEID_STRUCT) ((u8 *) eid_ptr + 2 + eid_ptr->Len);
|
||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
@ -1567,18 +1567,18 @@ static BOOLEAN PeerMeasureReqSanity(IN PRTMP_ADAPTER pAd,
|
|||||||
0 1 2 3 4 5-7
|
0 1 2 3 4 5-7
|
||||||
*/
|
*/
|
||||||
static BOOLEAN PeerMeasureReportSanity(IN PRTMP_ADAPTER pAd,
|
static BOOLEAN PeerMeasureReportSanity(IN PRTMP_ADAPTER pAd,
|
||||||
IN VOID * pMsg,
|
void * pMsg,
|
||||||
IN ULONG MsgLen,
|
unsigned long MsgLen,
|
||||||
OUT PUINT8 pDialogToken,
|
u8 *pDialogToken,
|
||||||
OUT PMEASURE_REPORT_INFO
|
OUT PMEASURE_REPORT_INFO
|
||||||
pMeasureReportInfo,
|
pMeasureReportInfo,
|
||||||
OUT PUINT8 pReportBuf)
|
u8 *pReportBuf)
|
||||||
{
|
{
|
||||||
PFRAME_802_11 Fr = (PFRAME_802_11) pMsg;
|
PFRAME_802_11 Fr = (PFRAME_802_11) pMsg;
|
||||||
PUCHAR pFramePtr = Fr->Octet;
|
u8 *pFramePtr = Fr->Octet;
|
||||||
BOOLEAN result = FALSE;
|
BOOLEAN result = FALSE;
|
||||||
PEID_STRUCT eid_ptr;
|
PEID_STRUCT eid_ptr;
|
||||||
PUCHAR ptr;
|
u8 *ptr;
|
||||||
|
|
||||||
/* skip 802.11 header. */
|
/* skip 802.11 header. */
|
||||||
MsgLen -= sizeof(HEADER_802_11);
|
MsgLen -= sizeof(HEADER_802_11);
|
||||||
@ -1595,8 +1595,8 @@ static BOOLEAN PeerMeasureReportSanity(IN PRTMP_ADAPTER pAd,
|
|||||||
MsgLen -= 1;
|
MsgLen -= 1;
|
||||||
|
|
||||||
eid_ptr = (PEID_STRUCT) pFramePtr;
|
eid_ptr = (PEID_STRUCT) pFramePtr;
|
||||||
while (((UCHAR *) eid_ptr + eid_ptr->Len + 1) <
|
while (((u8 *) eid_ptr + eid_ptr->Len + 1) <
|
||||||
((PUCHAR) pFramePtr + MsgLen)) {
|
((u8 *)pFramePtr + MsgLen)) {
|
||||||
switch (eid_ptr->Eid) {
|
switch (eid_ptr->Eid) {
|
||||||
case IE_MEASUREMENT_REPORT:
|
case IE_MEASUREMENT_REPORT:
|
||||||
NdisMoveMemory(&pMeasureReportInfo->Token,
|
NdisMoveMemory(&pMeasureReportInfo->Token,
|
||||||
@ -1608,7 +1608,7 @@ static BOOLEAN PeerMeasureReportSanity(IN PRTMP_ADAPTER pAd,
|
|||||||
if (pMeasureReportInfo->ReportType == RM_BASIC) {
|
if (pMeasureReportInfo->ReportType == RM_BASIC) {
|
||||||
PMEASURE_BASIC_REPORT pReport =
|
PMEASURE_BASIC_REPORT pReport =
|
||||||
(PMEASURE_BASIC_REPORT) pReportBuf;
|
(PMEASURE_BASIC_REPORT) pReportBuf;
|
||||||
ptr = (PUCHAR) (eid_ptr->Octet + 3);
|
ptr = (u8 *)(eid_ptr->Octet + 3);
|
||||||
NdisMoveMemory(&pReport->ChNum, ptr, 1);
|
NdisMoveMemory(&pReport->ChNum, ptr, 1);
|
||||||
NdisMoveMemory(&pReport->MeasureStartTime,
|
NdisMoveMemory(&pReport->MeasureStartTime,
|
||||||
ptr + 1, 8);
|
ptr + 1, 8);
|
||||||
@ -1619,7 +1619,7 @@ static BOOLEAN PeerMeasureReportSanity(IN PRTMP_ADAPTER pAd,
|
|||||||
} else if (pMeasureReportInfo->ReportType == RM_CCA) {
|
} else if (pMeasureReportInfo->ReportType == RM_CCA) {
|
||||||
PMEASURE_CCA_REPORT pReport =
|
PMEASURE_CCA_REPORT pReport =
|
||||||
(PMEASURE_CCA_REPORT) pReportBuf;
|
(PMEASURE_CCA_REPORT) pReportBuf;
|
||||||
ptr = (PUCHAR) (eid_ptr->Octet + 3);
|
ptr = (u8 *)(eid_ptr->Octet + 3);
|
||||||
NdisMoveMemory(&pReport->ChNum, ptr, 1);
|
NdisMoveMemory(&pReport->ChNum, ptr, 1);
|
||||||
NdisMoveMemory(&pReport->MeasureStartTime,
|
NdisMoveMemory(&pReport->MeasureStartTime,
|
||||||
ptr + 1, 8);
|
ptr + 1, 8);
|
||||||
@ -1632,7 +1632,7 @@ static BOOLEAN PeerMeasureReportSanity(IN PRTMP_ADAPTER pAd,
|
|||||||
RM_RPI_HISTOGRAM) {
|
RM_RPI_HISTOGRAM) {
|
||||||
PMEASURE_RPI_REPORT pReport =
|
PMEASURE_RPI_REPORT pReport =
|
||||||
(PMEASURE_RPI_REPORT) pReportBuf;
|
(PMEASURE_RPI_REPORT) pReportBuf;
|
||||||
ptr = (PUCHAR) (eid_ptr->Octet + 3);
|
ptr = (u8 *)(eid_ptr->Octet + 3);
|
||||||
NdisMoveMemory(&pReport->ChNum, ptr, 1);
|
NdisMoveMemory(&pReport->ChNum, ptr, 1);
|
||||||
NdisMoveMemory(&pReport->MeasureStartTime,
|
NdisMoveMemory(&pReport->MeasureStartTime,
|
||||||
ptr + 1, 8);
|
ptr + 1, 8);
|
||||||
@ -1647,7 +1647,7 @@ static BOOLEAN PeerMeasureReportSanity(IN PRTMP_ADAPTER pAd,
|
|||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
eid_ptr = (PEID_STRUCT) ((UCHAR *) eid_ptr + 2 + eid_ptr->Len);
|
eid_ptr = (PEID_STRUCT) ((u8 *) eid_ptr + 2 + eid_ptr->Len);
|
||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
@ -1667,11 +1667,11 @@ static BOOLEAN PeerMeasureReportSanity(IN PRTMP_ADAPTER pAd,
|
|||||||
==========================================================================
|
==========================================================================
|
||||||
*/
|
*/
|
||||||
static BOOLEAN PeerTpcReqSanity(IN PRTMP_ADAPTER pAd,
|
static BOOLEAN PeerTpcReqSanity(IN PRTMP_ADAPTER pAd,
|
||||||
IN VOID * pMsg,
|
void * pMsg,
|
||||||
IN ULONG MsgLen, OUT PUINT8 pDialogToken)
|
unsigned long MsgLen, u8 *pDialogToken)
|
||||||
{
|
{
|
||||||
PFRAME_802_11 Fr = (PFRAME_802_11) pMsg;
|
PFRAME_802_11 Fr = (PFRAME_802_11) pMsg;
|
||||||
PUCHAR pFramePtr = Fr->Octet;
|
u8 *pFramePtr = Fr->Octet;
|
||||||
BOOLEAN result = FALSE;
|
BOOLEAN result = FALSE;
|
||||||
PEID_STRUCT eid_ptr;
|
PEID_STRUCT eid_ptr;
|
||||||
|
|
||||||
@ -1689,8 +1689,8 @@ static BOOLEAN PeerTpcReqSanity(IN PRTMP_ADAPTER pAd,
|
|||||||
MsgLen -= 1;
|
MsgLen -= 1;
|
||||||
|
|
||||||
eid_ptr = (PEID_STRUCT) pFramePtr;
|
eid_ptr = (PEID_STRUCT) pFramePtr;
|
||||||
while (((UCHAR *) eid_ptr + eid_ptr->Len + 1) <
|
while (((u8 *) eid_ptr + eid_ptr->Len + 1) <
|
||||||
((PUCHAR) pFramePtr + MsgLen)) {
|
((u8 *)pFramePtr + MsgLen)) {
|
||||||
switch (eid_ptr->Eid) {
|
switch (eid_ptr->Eid) {
|
||||||
case IE_TPC_REQUEST:
|
case IE_TPC_REQUEST:
|
||||||
result = TRUE;
|
result = TRUE;
|
||||||
@ -1699,7 +1699,7 @@ static BOOLEAN PeerTpcReqSanity(IN PRTMP_ADAPTER pAd,
|
|||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
eid_ptr = (PEID_STRUCT) ((UCHAR *) eid_ptr + 2 + eid_ptr->Len);
|
eid_ptr = (PEID_STRUCT) ((u8 *) eid_ptr + 2 + eid_ptr->Len);
|
||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
@ -1720,13 +1720,13 @@ static BOOLEAN PeerTpcReqSanity(IN PRTMP_ADAPTER pAd,
|
|||||||
==========================================================================
|
==========================================================================
|
||||||
*/
|
*/
|
||||||
static BOOLEAN PeerTpcRepSanity(IN PRTMP_ADAPTER pAd,
|
static BOOLEAN PeerTpcRepSanity(IN PRTMP_ADAPTER pAd,
|
||||||
IN VOID * pMsg,
|
void * pMsg,
|
||||||
IN ULONG MsgLen,
|
unsigned long MsgLen,
|
||||||
OUT PUINT8 pDialogToken,
|
u8 *pDialogToken,
|
||||||
OUT PTPC_REPORT_INFO pTpcRepInfo)
|
OUT PTPC_REPORT_INFO pTpcRepInfo)
|
||||||
{
|
{
|
||||||
PFRAME_802_11 Fr = (PFRAME_802_11) pMsg;
|
PFRAME_802_11 Fr = (PFRAME_802_11) pMsg;
|
||||||
PUCHAR pFramePtr = Fr->Octet;
|
u8 *pFramePtr = Fr->Octet;
|
||||||
BOOLEAN result = FALSE;
|
BOOLEAN result = FALSE;
|
||||||
PEID_STRUCT eid_ptr;
|
PEID_STRUCT eid_ptr;
|
||||||
|
|
||||||
@ -1744,8 +1744,8 @@ static BOOLEAN PeerTpcRepSanity(IN PRTMP_ADAPTER pAd,
|
|||||||
MsgLen -= 1;
|
MsgLen -= 1;
|
||||||
|
|
||||||
eid_ptr = (PEID_STRUCT) pFramePtr;
|
eid_ptr = (PEID_STRUCT) pFramePtr;
|
||||||
while (((UCHAR *) eid_ptr + eid_ptr->Len + 1) <
|
while (((u8 *) eid_ptr + eid_ptr->Len + 1) <
|
||||||
((PUCHAR) pFramePtr + MsgLen)) {
|
((u8 *)pFramePtr + MsgLen)) {
|
||||||
switch (eid_ptr->Eid) {
|
switch (eid_ptr->Eid) {
|
||||||
case IE_TPC_REPORT:
|
case IE_TPC_REPORT:
|
||||||
NdisMoveMemory(&pTpcRepInfo->TxPwr, eid_ptr->Octet, 1);
|
NdisMoveMemory(&pTpcRepInfo->TxPwr, eid_ptr->Octet, 1);
|
||||||
@ -1757,7 +1757,7 @@ static BOOLEAN PeerTpcRepSanity(IN PRTMP_ADAPTER pAd,
|
|||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
eid_ptr = (PEID_STRUCT) ((UCHAR *) eid_ptr + 2 + eid_ptr->Len);
|
eid_ptr = (PEID_STRUCT) ((u8 *) eid_ptr + 2 + eid_ptr->Len);
|
||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
@ -1774,12 +1774,12 @@ static BOOLEAN PeerTpcRepSanity(IN PRTMP_ADAPTER pAd,
|
|||||||
Return : None.
|
Return : None.
|
||||||
==========================================================================
|
==========================================================================
|
||||||
*/
|
*/
|
||||||
static VOID PeerChSwAnnAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
static void PeerChSwAnnAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
||||||
{
|
{
|
||||||
CH_SW_ANN_INFO ChSwAnnInfo;
|
CH_SW_ANN_INFO ChSwAnnInfo;
|
||||||
PFRAME_802_11 pFr = (PFRAME_802_11) Elem->Msg;
|
PFRAME_802_11 pFr = (PFRAME_802_11) Elem->Msg;
|
||||||
UCHAR index = 0, Channel = 0, NewChannel = 0;
|
u8 index = 0, Channel = 0, NewChannel = 0;
|
||||||
ULONG Bssidx = 0;
|
unsigned long Bssidx = 0;
|
||||||
|
|
||||||
NdisZeroMemory(&ChSwAnnInfo, sizeof(CH_SW_ANN_INFO));
|
NdisZeroMemory(&ChSwAnnInfo, sizeof(CH_SW_ANN_INFO));
|
||||||
if (!PeerChSwAnnSanity(pAd, Elem->Msg, Elem->MsgLen, &ChSwAnnInfo)) {
|
if (!PeerChSwAnnSanity(pAd, Elem->Msg, Elem->MsgLen, &ChSwAnnInfo)) {
|
||||||
@ -1856,11 +1856,11 @@ static VOID PeerChSwAnnAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
|||||||
Return : None.
|
Return : None.
|
||||||
==========================================================================
|
==========================================================================
|
||||||
*/
|
*/
|
||||||
static VOID PeerMeasureReqAction(IN PRTMP_ADAPTER pAd,
|
static void PeerMeasureReqAction(IN PRTMP_ADAPTER pAd,
|
||||||
IN MLME_QUEUE_ELEM * Elem)
|
IN MLME_QUEUE_ELEM * Elem)
|
||||||
{
|
{
|
||||||
PFRAME_802_11 pFr = (PFRAME_802_11) Elem->Msg;
|
PFRAME_802_11 pFr = (PFRAME_802_11) Elem->Msg;
|
||||||
UINT8 DialogToken;
|
u8 DialogToken;
|
||||||
MEASURE_REQ_INFO MeasureReqInfo;
|
MEASURE_REQ_INFO MeasureReqInfo;
|
||||||
MEASURE_REQ MeasureReq;
|
MEASURE_REQ MeasureReq;
|
||||||
MEASURE_REPORT_MODE ReportMode;
|
MEASURE_REPORT_MODE ReportMode;
|
||||||
@ -1889,13 +1889,13 @@ static VOID PeerMeasureReqAction(IN PRTMP_ADAPTER pAd,
|
|||||||
Return : None.
|
Return : None.
|
||||||
==========================================================================
|
==========================================================================
|
||||||
*/
|
*/
|
||||||
static VOID PeerMeasureReportAction(IN PRTMP_ADAPTER pAd,
|
static void PeerMeasureReportAction(IN PRTMP_ADAPTER pAd,
|
||||||
IN MLME_QUEUE_ELEM * Elem)
|
IN MLME_QUEUE_ELEM * Elem)
|
||||||
{
|
{
|
||||||
MEASURE_REPORT_INFO MeasureReportInfo;
|
MEASURE_REPORT_INFO MeasureReportInfo;
|
||||||
PFRAME_802_11 pFr = (PFRAME_802_11) Elem->Msg;
|
PFRAME_802_11 pFr = (PFRAME_802_11) Elem->Msg;
|
||||||
UINT8 DialogToken;
|
u8 DialogToken;
|
||||||
PUINT8 pMeasureReportInfo;
|
u8 *pMeasureReportInfo;
|
||||||
|
|
||||||
/* if (pAd->CommonCfg.bIEEE80211H != TRUE) */
|
/* if (pAd->CommonCfg.bIEEE80211H != TRUE) */
|
||||||
/* return; */
|
/* return; */
|
||||||
@ -1965,14 +1965,14 @@ static VOID PeerMeasureReportAction(IN PRTMP_ADAPTER pAd,
|
|||||||
Return : None.
|
Return : None.
|
||||||
==========================================================================
|
==========================================================================
|
||||||
*/
|
*/
|
||||||
static VOID PeerTpcReqAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
static void PeerTpcReqAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
||||||
{
|
{
|
||||||
PFRAME_802_11 pFr = (PFRAME_802_11) Elem->Msg;
|
PFRAME_802_11 pFr = (PFRAME_802_11) Elem->Msg;
|
||||||
PUCHAR pFramePtr = pFr->Octet;
|
u8 *pFramePtr = pFr->Octet;
|
||||||
UINT8 DialogToken;
|
u8 DialogToken;
|
||||||
UINT8 TxPwr = GetCurTxPwr(pAd, Elem->Wcid);
|
u8 TxPwr = GetCurTxPwr(pAd, Elem->Wcid);
|
||||||
UINT8 LinkMargin = 0;
|
u8 LinkMargin = 0;
|
||||||
CHAR RealRssi;
|
char RealRssi;
|
||||||
|
|
||||||
/* link margin: Ratio of the received signal power to the minimum desired by the station (STA). The */
|
/* link margin: Ratio of the received signal power to the minimum desired by the station (STA). The */
|
||||||
/* STA may incorporate rate information and channel conditions, including interference, into its computation */
|
/* STA may incorporate rate information and channel conditions, including interference, into its computation */
|
||||||
@ -2007,9 +2007,9 @@ static VOID PeerTpcReqAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
|||||||
Return : None.
|
Return : None.
|
||||||
==========================================================================
|
==========================================================================
|
||||||
*/
|
*/
|
||||||
static VOID PeerTpcRepAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
static void PeerTpcRepAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
||||||
{
|
{
|
||||||
UINT8 DialogToken;
|
u8 DialogToken;
|
||||||
TPC_REPORT_INFO TpcRepInfo;
|
TPC_REPORT_INFO TpcRepInfo;
|
||||||
PTPC_REQ_ENTRY pEntry = NULL;
|
PTPC_REQ_ENTRY pEntry = NULL;
|
||||||
|
|
||||||
@ -2040,10 +2040,10 @@ static VOID PeerTpcRepAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
|||||||
Return : None.
|
Return : None.
|
||||||
==========================================================================
|
==========================================================================
|
||||||
*/
|
*/
|
||||||
VOID PeerSpectrumAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
void PeerSpectrumAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
||||||
{
|
{
|
||||||
|
|
||||||
UCHAR Action = Elem->Msg[LENGTH_802_11 + 1];
|
u8 Action = Elem->Msg[LENGTH_802_11 + 1];
|
||||||
|
|
||||||
if (pAd->CommonCfg.bIEEE80211H != TRUE)
|
if (pAd->CommonCfg.bIEEE80211H != TRUE)
|
||||||
return;
|
return;
|
||||||
@ -2085,26 +2085,26 @@ VOID PeerSpectrumAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
|||||||
Return : None.
|
Return : None.
|
||||||
==========================================================================
|
==========================================================================
|
||||||
*/
|
*/
|
||||||
INT Set_MeasureReq_Proc(IN PRTMP_ADAPTER pAd, IN PSTRING arg)
|
int Set_MeasureReq_Proc(IN PRTMP_ADAPTER pAd, char *arg)
|
||||||
{
|
{
|
||||||
UINT Aid = 1;
|
u32 Aid = 1;
|
||||||
UINT ArgIdx;
|
u32 ArgIdx;
|
||||||
PSTRING thisChar;
|
char *thisChar;
|
||||||
|
|
||||||
MEASURE_REQ_MODE MeasureReqMode;
|
MEASURE_REQ_MODE MeasureReqMode;
|
||||||
UINT8 MeasureReqToken = RandomByte(pAd);
|
u8 MeasureReqToken = RandomByte(pAd);
|
||||||
UINT8 MeasureReqType = RM_BASIC;
|
u8 MeasureReqType = RM_BASIC;
|
||||||
UINT8 MeasureCh = 1;
|
u8 MeasureCh = 1;
|
||||||
UINT64 MeasureStartTime = GetCurrentTimeStamp(pAd);
|
u64 MeasureStartTime = GetCurrentTimeStamp(pAd);
|
||||||
MEASURE_REQ MeasureReq;
|
MEASURE_REQ MeasureReq;
|
||||||
UINT8 TotalLen;
|
u8 TotalLen;
|
||||||
|
|
||||||
HEADER_802_11 ActHdr;
|
HEADER_802_11 ActHdr;
|
||||||
PUCHAR pOutBuffer = NULL;
|
u8 *pOutBuffer = NULL;
|
||||||
NDIS_STATUS NStatus;
|
int NStatus;
|
||||||
ULONG FrameLen;
|
unsigned long FrameLen;
|
||||||
|
|
||||||
NStatus = MlmeAllocateMemory(pAd, (PVOID) & pOutBuffer); /*Get an unused nonpaged memory */
|
NStatus = MlmeAllocateMemory(pAd, (void *)& pOutBuffer); /*Get an unused nonpaged memory */
|
||||||
if (NStatus != NDIS_STATUS_SUCCESS) {
|
if (NStatus != NDIS_STATUS_SUCCESS) {
|
||||||
DBGPRINT(RT_DEBUG_TRACE,
|
DBGPRINT(RT_DEBUG_TRACE,
|
||||||
("%s() allocate memory failed \n", __func__));
|
("%s() allocate memory failed \n", __func__));
|
||||||
@ -2115,7 +2115,7 @@ INT Set_MeasureReq_Proc(IN PRTMP_ADAPTER pAd, IN PSTRING arg)
|
|||||||
while ((thisChar = strsep((char **)&arg, "-")) != NULL) {
|
while ((thisChar = strsep((char **)&arg, "-")) != NULL) {
|
||||||
switch (ArgIdx) {
|
switch (ArgIdx) {
|
||||||
case 1: /* Aid. */
|
case 1: /* Aid. */
|
||||||
Aid = (UINT8) simple_strtol(thisChar, 0, 16);
|
Aid = (u8)simple_strtol(thisChar, 0, 16);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 2: /* Measurement Request Type. */
|
case 2: /* Measurement Request Type. */
|
||||||
@ -2129,7 +2129,7 @@ INT Set_MeasureReq_Proc(IN PRTMP_ADAPTER pAd, IN PSTRING arg)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case 3: /* Measurement channel. */
|
case 3: /* Measurement channel. */
|
||||||
MeasureCh = (UINT8) simple_strtol(thisChar, 0, 16);
|
MeasureCh = (u8)simple_strtol(thisChar, 0, 16);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
ArgIdx++;
|
ArgIdx++;
|
||||||
@ -2153,7 +2153,7 @@ INT Set_MeasureReq_Proc(IN PRTMP_ADAPTER pAd, IN PSTRING arg)
|
|||||||
MgtMacHeaderInit(pAd, &ActHdr, SUBTYPE_ACTION, 0,
|
MgtMacHeaderInit(pAd, &ActHdr, SUBTYPE_ACTION, 0,
|
||||||
pAd->MacTab.Content[Aid].Addr, pAd->CurrentAddress);
|
pAd->MacTab.Content[Aid].Addr, pAd->CurrentAddress);
|
||||||
|
|
||||||
NdisMoveMemory(pOutBuffer, (PCHAR) & ActHdr, sizeof(HEADER_802_11));
|
NdisMoveMemory(pOutBuffer, (char *)& ActHdr, sizeof(HEADER_802_11));
|
||||||
FrameLen = sizeof(HEADER_802_11);
|
FrameLen = sizeof(HEADER_802_11);
|
||||||
|
|
||||||
TotalLen = sizeof(MEASURE_REQ_INFO) + sizeof(MEASURE_REQ);
|
TotalLen = sizeof(MEASURE_REQ_INFO) + sizeof(MEASURE_REQ);
|
||||||
@ -2168,14 +2168,14 @@ INT Set_MeasureReq_Proc(IN PRTMP_ADAPTER pAd, IN PSTRING arg)
|
|||||||
MeasureReq.MeasureDuration = cpu2le16(2000);
|
MeasureReq.MeasureDuration = cpu2le16(2000);
|
||||||
|
|
||||||
{
|
{
|
||||||
ULONG TempLen;
|
unsigned long TempLen;
|
||||||
MakeOutgoingFrame(pOutBuffer + FrameLen, &TempLen,
|
MakeOutgoingFrame(pOutBuffer + FrameLen, &TempLen,
|
||||||
sizeof(MEASURE_REQ), &MeasureReq,
|
sizeof(MEASURE_REQ), &MeasureReq,
|
||||||
END_OF_ARGS);
|
END_OF_ARGS);
|
||||||
FrameLen += TempLen;
|
FrameLen += TempLen;
|
||||||
}
|
}
|
||||||
|
|
||||||
MiniportMMRequest(pAd, QID_AC_BE, pOutBuffer, (UINT) FrameLen);
|
MiniportMMRequest(pAd, QID_AC_BE, pOutBuffer, (u32)FrameLen);
|
||||||
|
|
||||||
END_OF_MEASURE_REQ:
|
END_OF_MEASURE_REQ:
|
||||||
MlmeFreeMemory(pAd, pOutBuffer);
|
MlmeFreeMemory(pAd, pOutBuffer);
|
||||||
@ -2183,13 +2183,13 @@ END_OF_MEASURE_REQ:
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
INT Set_TpcReq_Proc(IN PRTMP_ADAPTER pAd, IN PSTRING arg)
|
int Set_TpcReq_Proc(IN PRTMP_ADAPTER pAd, char *arg)
|
||||||
{
|
{
|
||||||
UINT Aid;
|
u32 Aid;
|
||||||
|
|
||||||
UINT8 TpcReqToken = RandomByte(pAd);
|
u8 TpcReqToken = RandomByte(pAd);
|
||||||
|
|
||||||
Aid = (UINT) simple_strtol(arg, 0, 16);
|
Aid = (u32)simple_strtol(arg, 0, 16);
|
||||||
|
|
||||||
DBGPRINT(RT_DEBUG_TRACE, ("%s::Aid = %d\n", __func__, Aid));
|
DBGPRINT(RT_DEBUG_TRACE, ("%s::Aid = %d\n", __func__, Aid));
|
||||||
if (!VALID_WCID(Aid)) {
|
if (!VALID_WCID(Aid)) {
|
||||||
|
@ -48,18 +48,18 @@
|
|||||||
|
|
||||||
#ifdef SHA1_SUPPORT
|
#ifdef SHA1_SUPPORT
|
||||||
#define HMAC_SHA1_SUPPORT
|
#define HMAC_SHA1_SUPPORT
|
||||||
VOID HMAC_SHA1(IN const UINT8 Key[],
|
void HMAC_SHA1(IN const u8 Key[],
|
||||||
IN UINT KeyLen,
|
u32 KeyLen,
|
||||||
IN const UINT8 Message[],
|
IN const u8 Message[],
|
||||||
IN UINT MessageLen, OUT UINT8 MAC[], IN UINT MACLen);
|
u32 MessageLen, u8 MAC[], u32 MACLen);
|
||||||
#endif /* SHA1_SUPPORT */
|
#endif /* SHA1_SUPPORT */
|
||||||
|
|
||||||
#ifdef MD5_SUPPORT
|
#ifdef MD5_SUPPORT
|
||||||
#define HMAC_MD5_SUPPORT
|
#define HMAC_MD5_SUPPORT
|
||||||
VOID HMAC_MD5(IN const UINT8 Key[],
|
void HMAC_MD5(IN const u8 Key[],
|
||||||
IN UINT KeyLen,
|
u32 KeyLen,
|
||||||
IN const UINT8 Message[],
|
IN const u8 Message[],
|
||||||
IN UINT MessageLen, OUT UINT8 MAC[], IN UINT MACLen);
|
u32 MessageLen, u8 MAC[], u32 MACLen);
|
||||||
#endif /* MD5_SUPPORT */
|
#endif /* MD5_SUPPORT */
|
||||||
|
|
||||||
#endif /* __CRYPT_HMAC_H__ */
|
#endif /* __CRYPT_HMAC_H__ */
|
||||||
|
@ -54,19 +54,19 @@
|
|||||||
#define MD5_BLOCK_SIZE 64 /* 512 bits = 64 bytes */
|
#define MD5_BLOCK_SIZE 64 /* 512 bits = 64 bytes */
|
||||||
#define MD5_DIGEST_SIZE 16 /* 128 bits = 16 bytes */
|
#define MD5_DIGEST_SIZE 16 /* 128 bits = 16 bytes */
|
||||||
typedef struct {
|
typedef struct {
|
||||||
UINT32 HashValue[4];
|
u32 HashValue[4];
|
||||||
UINT64 MessageLen;
|
u64 MessageLen;
|
||||||
UINT8 Block[MD5_BLOCK_SIZE];
|
u8 Block[MD5_BLOCK_SIZE];
|
||||||
UINT BlockLen;
|
u32 BlockLen;
|
||||||
} MD5_CTX_STRUC, *PMD5_CTX_STRUC;
|
} MD5_CTX_STRUC, *PMD5_CTX_STRUC;
|
||||||
|
|
||||||
VOID MD5_Init(IN MD5_CTX_STRUC * pMD5_CTX);
|
void MD5_Init(IN MD5_CTX_STRUC * pMD5_CTX);
|
||||||
VOID MD5_Hash(IN MD5_CTX_STRUC * pMD5_CTX);
|
void MD5_Hash(IN MD5_CTX_STRUC * pMD5_CTX);
|
||||||
VOID MD5_Append(IN MD5_CTX_STRUC * pMD5_CTX,
|
void MD5_Append(IN MD5_CTX_STRUC * pMD5_CTX,
|
||||||
IN const UINT8 Message[], IN UINT MessageLen);
|
IN const u8 Message[], u32 MessageLen);
|
||||||
VOID MD5_End(IN MD5_CTX_STRUC * pMD5_CTX, OUT UINT8 DigestMessage[]);
|
void MD5_End(IN MD5_CTX_STRUC * pMD5_CTX, u8 DigestMessage[]);
|
||||||
VOID RT_MD5(IN const UINT8 Message[],
|
void RT_MD5(IN const u8 Message[],
|
||||||
IN UINT MessageLen, OUT UINT8 DigestMessage[]);
|
u32 MessageLen, u8 DigestMessage[]);
|
||||||
#endif /* MD5_SUPPORT */
|
#endif /* MD5_SUPPORT */
|
||||||
|
|
||||||
#endif /* __CRYPT_MD5_H__ */
|
#endif /* __CRYPT_MD5_H__ */
|
||||||
|
@ -55,19 +55,19 @@
|
|||||||
#define SHA1_BLOCK_SIZE 64 /* 512 bits = 64 bytes */
|
#define SHA1_BLOCK_SIZE 64 /* 512 bits = 64 bytes */
|
||||||
#define SHA1_DIGEST_SIZE 20 /* 160 bits = 20 bytes */
|
#define SHA1_DIGEST_SIZE 20 /* 160 bits = 20 bytes */
|
||||||
typedef struct _SHA1_CTX_STRUC {
|
typedef struct _SHA1_CTX_STRUC {
|
||||||
UINT32 HashValue[5]; /* 5 = (SHA1_DIGEST_SIZE / 32) */
|
u32 HashValue[5]; /* 5 = (SHA1_DIGEST_SIZE / 32) */
|
||||||
UINT64 MessageLen; /* total size */
|
u64 MessageLen; /* total size */
|
||||||
UINT8 Block[SHA1_BLOCK_SIZE];
|
u8 Block[SHA1_BLOCK_SIZE];
|
||||||
UINT BlockLen;
|
u32 BlockLen;
|
||||||
} SHA1_CTX_STRUC, *PSHA1_CTX_STRUC;
|
} SHA1_CTX_STRUC, *PSHA1_CTX_STRUC;
|
||||||
|
|
||||||
VOID RT_SHA1_Init(IN SHA1_CTX_STRUC * pSHA_CTX);
|
void RT_SHA1_Init(IN SHA1_CTX_STRUC * pSHA_CTX);
|
||||||
VOID SHA1_Hash(IN SHA1_CTX_STRUC * pSHA_CTX);
|
void SHA1_Hash(IN SHA1_CTX_STRUC * pSHA_CTX);
|
||||||
VOID SHA1_Append(IN SHA1_CTX_STRUC * pSHA_CTX,
|
void SHA1_Append(IN SHA1_CTX_STRUC * pSHA_CTX,
|
||||||
IN const UINT8 Message[], IN UINT MessageLen);
|
IN const u8 Message[], u32 MessageLen);
|
||||||
VOID SHA1_End(IN SHA1_CTX_STRUC * pSHA_CTX, OUT UINT8 DigestMessage[]);
|
void SHA1_End(IN SHA1_CTX_STRUC * pSHA_CTX, u8 DigestMessage[]);
|
||||||
VOID RT_SHA1(IN const UINT8 Message[],
|
void RT_SHA1(IN const u8 Message[],
|
||||||
IN UINT MessageLen, OUT UINT8 DigestMessage[]);
|
u32 MessageLen, u8 DigestMessage[]);
|
||||||
#endif /* SHA1_SUPPORT */
|
#endif /* SHA1_SUPPORT */
|
||||||
|
|
||||||
#endif /* __CRYPT_SHA2_H__ */
|
#endif /* __CRYPT_SHA2_H__ */
|
||||||
|
@ -36,4 +36,4 @@
|
|||||||
Fonchi 03-12-2007 created
|
Fonchi 03-12-2007 created
|
||||||
*/
|
*/
|
||||||
|
|
||||||
BOOLEAN RadarChannelCheck(IN PRTMP_ADAPTER pAd, IN UCHAR Ch);
|
BOOLEAN RadarChannelCheck(IN PRTMP_ADAPTER pAd, u8 Ch);
|
||||||
|
@ -42,26 +42,26 @@
|
|||||||
* Public function declarations for prom-based chipset
|
* Public function declarations for prom-based chipset
|
||||||
************************************************************************/
|
************************************************************************/
|
||||||
int rtmp_ee_prom_read16(IN PRTMP_ADAPTER pAd,
|
int rtmp_ee_prom_read16(IN PRTMP_ADAPTER pAd,
|
||||||
IN USHORT Offset, OUT USHORT * pValue);
|
u16 Offset, u16 * pValue);
|
||||||
#endif /* RTMP_PCI_SUPPORT // */
|
#endif /* RTMP_PCI_SUPPORT // */
|
||||||
#ifdef RTMP_USB_SUPPORT
|
#ifdef RTMP_USB_SUPPORT
|
||||||
/*************************************************************************
|
/*************************************************************************
|
||||||
* Public function declarations for usb-based prom chipset
|
* Public function declarations for usb-based prom chipset
|
||||||
************************************************************************/
|
************************************************************************/
|
||||||
NTSTATUS RTUSBReadEEPROM16(IN PRTMP_ADAPTER pAd,
|
int RTUSBReadEEPROM16(IN PRTMP_ADAPTER pAd,
|
||||||
IN USHORT offset, OUT PUSHORT pData);
|
u16 offset, u16 *pData);
|
||||||
#endif /* RTMP_USB_SUPPORT // */
|
#endif /* RTMP_USB_SUPPORT // */
|
||||||
|
|
||||||
#ifdef RT30xx
|
#ifdef RT30xx
|
||||||
#ifdef RTMP_EFUSE_SUPPORT
|
#ifdef RTMP_EFUSE_SUPPORT
|
||||||
int rtmp_ee_efuse_read16(IN RTMP_ADAPTER * pAd,
|
int rtmp_ee_efuse_read16(IN RTMP_ADAPTER * pAd,
|
||||||
IN USHORT Offset, OUT USHORT * pValue);
|
u16 Offset, u16 * pValue);
|
||||||
#endif /* RTMP_EFUSE_SUPPORT // */
|
#endif /* RTMP_EFUSE_SUPPORT // */
|
||||||
#endif /* RT30xx // */
|
#endif /* RT30xx // */
|
||||||
|
|
||||||
/*************************************************************************
|
/*************************************************************************
|
||||||
* Public function declarations for prom operation callback functions setting
|
* Public function declarations for prom operation callback functions setting
|
||||||
************************************************************************/
|
************************************************************************/
|
||||||
INT RtmpChipOpsEepromHook(IN RTMP_ADAPTER * pAd, IN INT infType);
|
int RtmpChipOpsEepromHook(IN RTMP_ADAPTER * pAd, int infType);
|
||||||
|
|
||||||
#endif /* __EEPROM_H__ // */
|
#endif /* __EEPROM_H__ // */
|
||||||
|
@ -38,7 +38,7 @@ typedef struct urb *purbb_t;
|
|||||||
typedef struct usb_ctrlrequest devctrlrequest;
|
typedef struct usb_ctrlrequest devctrlrequest;
|
||||||
#endif // LINUX //
|
#endif // LINUX //
|
||||||
|
|
||||||
extern UCHAR EpToQueue[6];
|
extern u8 EpToQueue[6];
|
||||||
|
|
||||||
#define RXBULKAGGRE_ZISE 12
|
#define RXBULKAGGRE_ZISE 12
|
||||||
#define MAX_TXBULK_LIMIT (LOCAL_TXBUF_SIZE*(BULKAGGRE_ZISE-1))
|
#define MAX_TXBULK_LIMIT (LOCAL_TXBUF_SIZE*(BULKAGGRE_ZISE-1))
|
||||||
@ -110,8 +110,8 @@ extern void dump_urb(struct urb *purb);
|
|||||||
#define USBD_SHORT_TRANSFER_OK 0
|
#define USBD_SHORT_TRANSFER_OK 0
|
||||||
#define PURB purbb_t
|
#define PURB purbb_t
|
||||||
|
|
||||||
#define PIRP PVOID
|
#define PIRP void *
|
||||||
#define NDIS_OID UINT
|
#define NDIS_OID u32
|
||||||
#ifndef USB_ST_NOERROR
|
#ifndef USB_ST_NOERROR
|
||||||
#define USB_ST_NOERROR 0
|
#define USB_ST_NOERROR 0
|
||||||
#endif
|
#endif
|
||||||
@ -120,12 +120,12 @@ extern void dump_urb(struct urb *purb);
|
|||||||
#define CONTROL_TIMEOUT_JIFFIES ( (100 * OS_HZ) / 1000)
|
#define CONTROL_TIMEOUT_JIFFIES ( (100 * OS_HZ) / 1000)
|
||||||
#define UNLINK_TIMEOUT_MS 3
|
#define UNLINK_TIMEOUT_MS 3
|
||||||
|
|
||||||
VOID RTUSBBulkOutDataPacketComplete(purbb_t purb, struct pt_regs *pt_regs);
|
void RTUSBBulkOutDataPacketComplete(purbb_t purb, struct pt_regs *pt_regs);
|
||||||
VOID RTUSBBulkOutMLMEPacketComplete(purbb_t pUrb, struct pt_regs *pt_regs);
|
void RTUSBBulkOutMLMEPacketComplete(purbb_t pUrb, struct pt_regs *pt_regs);
|
||||||
VOID RTUSBBulkOutNullFrameComplete(purbb_t pUrb, struct pt_regs *pt_regs);
|
void RTUSBBulkOutNullFrameComplete(purbb_t pUrb, struct pt_regs *pt_regs);
|
||||||
VOID RTUSBBulkOutRTSFrameComplete(purbb_t pUrb, struct pt_regs *pt_regs);
|
void RTUSBBulkOutRTSFrameComplete(purbb_t pUrb, struct pt_regs *pt_regs);
|
||||||
VOID RTUSBBulkOutPsPollComplete(purbb_t pUrb, struct pt_regs *pt_regs);
|
void RTUSBBulkOutPsPollComplete(purbb_t pUrb, struct pt_regs *pt_regs);
|
||||||
VOID RTUSBBulkRxComplete(purbb_t pUrb, struct pt_regs *pt_regs);
|
void RTUSBBulkRxComplete(purbb_t pUrb, struct pt_regs *pt_regs);
|
||||||
|
|
||||||
#ifdef KTHREAD_SUPPORT
|
#ifdef KTHREAD_SUPPORT
|
||||||
#define RTUSBMlmeUp(pAd) \
|
#define RTUSBMlmeUp(pAd) \
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -135,7 +135,7 @@ typedef enum _NDIS_802_11_STATUS_TYPE {
|
|||||||
Ndis802_11StatusTypeMax /* not a real type, defined as an upper bound */
|
Ndis802_11StatusTypeMax /* not a real type, defined as an upper bound */
|
||||||
} NDIS_802_11_STATUS_TYPE, *PNDIS_802_11_STATUS_TYPE;
|
} NDIS_802_11_STATUS_TYPE, *PNDIS_802_11_STATUS_TYPE;
|
||||||
|
|
||||||
typedef UCHAR NDIS_802_11_MAC_ADDRESS[6];
|
typedef u8 NDIS_802_11_MAC_ADDRESS[6];
|
||||||
|
|
||||||
typedef struct _NDIS_802_11_STATUS_INDICATION {
|
typedef struct _NDIS_802_11_STATUS_INDICATION {
|
||||||
NDIS_802_11_STATUS_TYPE StatusType;
|
NDIS_802_11_STATUS_TYPE StatusType;
|
||||||
@ -150,20 +150,20 @@ typedef struct _NDIS_802_11_STATUS_INDICATION {
|
|||||||
#define NDIS_802_11_AUTH_REQUEST_GROUP_ERROR 0x0E
|
#define NDIS_802_11_AUTH_REQUEST_GROUP_ERROR 0x0E
|
||||||
|
|
||||||
typedef struct _NDIS_802_11_AUTHENTICATION_REQUEST {
|
typedef struct _NDIS_802_11_AUTHENTICATION_REQUEST {
|
||||||
ULONG Length; /* Length of structure */
|
unsigned long Length; /* Length of structure */
|
||||||
NDIS_802_11_MAC_ADDRESS Bssid;
|
NDIS_802_11_MAC_ADDRESS Bssid;
|
||||||
ULONG Flags;
|
unsigned long Flags;
|
||||||
} NDIS_802_11_AUTHENTICATION_REQUEST, *PNDIS_802_11_AUTHENTICATION_REQUEST;
|
} NDIS_802_11_AUTHENTICATION_REQUEST, *PNDIS_802_11_AUTHENTICATION_REQUEST;
|
||||||
|
|
||||||
/*Added new types for PMKID Candidate lists. */
|
/*Added new types for PMKID Candidate lists. */
|
||||||
typedef struct _PMKID_CANDIDATE {
|
typedef struct _PMKID_CANDIDATE {
|
||||||
NDIS_802_11_MAC_ADDRESS BSSID;
|
NDIS_802_11_MAC_ADDRESS BSSID;
|
||||||
ULONG Flags;
|
unsigned long Flags;
|
||||||
} PMKID_CANDIDATE, *PPMKID_CANDIDATE;
|
} PMKID_CANDIDATE, *PPMKID_CANDIDATE;
|
||||||
|
|
||||||
typedef struct _NDIS_802_11_PMKID_CANDIDATE_LIST {
|
typedef struct _NDIS_802_11_PMKID_CANDIDATE_LIST {
|
||||||
ULONG Version; /* Version of the structure */
|
unsigned long Version; /* Version of the structure */
|
||||||
ULONG NumCandidates; /* No. of pmkid candidates */
|
unsigned long NumCandidates; /* No. of pmkid candidates */
|
||||||
PMKID_CANDIDATE CandidateList[1];
|
PMKID_CANDIDATE CandidateList[1];
|
||||||
} NDIS_802_11_PMKID_CANDIDATE_LIST, *PNDIS_802_11_PMKID_CANDIDATE_LIST;
|
} NDIS_802_11_PMKID_CANDIDATE_LIST, *PNDIS_802_11_PMKID_CANDIDATE_LIST;
|
||||||
|
|
||||||
@ -183,7 +183,7 @@ typedef enum _NDIS_802_11_NETWORK_TYPE {
|
|||||||
} NDIS_802_11_NETWORK_TYPE, *PNDIS_802_11_NETWORK_TYPE;
|
} NDIS_802_11_NETWORK_TYPE, *PNDIS_802_11_NETWORK_TYPE;
|
||||||
|
|
||||||
typedef struct _NDIS_802_11_NETWORK_TYPE_LIST {
|
typedef struct _NDIS_802_11_NETWORK_TYPE_LIST {
|
||||||
UINT NumberOfItems; /* in list below, at least 1 */
|
u32 NumberOfItems; /* in list below, at least 1 */
|
||||||
NDIS_802_11_NETWORK_TYPE NetworkType[1];
|
NDIS_802_11_NETWORK_TYPE NetworkType[1];
|
||||||
} NDIS_802_11_NETWORK_TYPE_LIST, *PNDIS_802_11_NETWORK_TYPE_LIST;
|
} NDIS_802_11_NETWORK_TYPE_LIST, *PNDIS_802_11_NETWORK_TYPE_LIST;
|
||||||
|
|
||||||
@ -195,30 +195,30 @@ typedef enum _NDIS_802_11_POWER_MODE {
|
|||||||
Ndis802_11PowerModeMax /* not a real mode, defined as an upper bound */
|
Ndis802_11PowerModeMax /* not a real mode, defined as an upper bound */
|
||||||
} NDIS_802_11_POWER_MODE, *PNDIS_802_11_POWER_MODE;
|
} NDIS_802_11_POWER_MODE, *PNDIS_802_11_POWER_MODE;
|
||||||
|
|
||||||
typedef ULONG NDIS_802_11_TX_POWER_LEVEL; /* in milliwatts */
|
typedef unsigned long NDIS_802_11_TX_POWER_LEVEL; /* in milliwatts */
|
||||||
|
|
||||||
/* */
|
/* */
|
||||||
/* Received Signal Strength Indication */
|
/* Received Signal Strength Indication */
|
||||||
/* */
|
/* */
|
||||||
typedef LONG NDIS_802_11_RSSI; /* in dBm */
|
typedef long NDIS_802_11_RSSI; /* in dBm */
|
||||||
|
|
||||||
typedef struct _NDIS_802_11_CONFIGURATION_FH {
|
typedef struct _NDIS_802_11_CONFIGURATION_FH {
|
||||||
ULONG Length; /* Length of structure */
|
unsigned long Length; /* Length of structure */
|
||||||
ULONG HopPattern; /* As defined by 802.11, MSB set */
|
unsigned long HopPattern; /* As defined by 802.11, MSB set */
|
||||||
ULONG HopSet; /* to one if non-802.11 */
|
unsigned long HopSet; /* to one if non-802.11 */
|
||||||
ULONG DwellTime; /* units are Kusec */
|
unsigned long DwellTime; /* units are Kusec */
|
||||||
} NDIS_802_11_CONFIGURATION_FH, *PNDIS_802_11_CONFIGURATION_FH;
|
} NDIS_802_11_CONFIGURATION_FH, *PNDIS_802_11_CONFIGURATION_FH;
|
||||||
|
|
||||||
typedef struct _NDIS_802_11_CONFIGURATION {
|
typedef struct _NDIS_802_11_CONFIGURATION {
|
||||||
ULONG Length; /* Length of structure */
|
unsigned long Length; /* Length of structure */
|
||||||
ULONG BeaconPeriod; /* units are Kusec */
|
unsigned long BeaconPeriod; /* units are Kusec */
|
||||||
ULONG ATIMWindow; /* units are Kusec */
|
unsigned long ATIMWindow; /* units are Kusec */
|
||||||
ULONG DSConfig; /* Frequency, units are kHz */
|
unsigned long DSConfig; /* Frequency, units are kHz */
|
||||||
NDIS_802_11_CONFIGURATION_FH FHConfig;
|
NDIS_802_11_CONFIGURATION_FH FHConfig;
|
||||||
} NDIS_802_11_CONFIGURATION, *PNDIS_802_11_CONFIGURATION;
|
} NDIS_802_11_CONFIGURATION, *PNDIS_802_11_CONFIGURATION;
|
||||||
|
|
||||||
typedef struct _NDIS_802_11_STATISTICS {
|
typedef struct _NDIS_802_11_STATISTICS {
|
||||||
ULONG Length; /* Length of structure */
|
unsigned long Length; /* Length of structure */
|
||||||
LARGE_INTEGER TransmittedFragmentCount;
|
LARGE_INTEGER TransmittedFragmentCount;
|
||||||
LARGE_INTEGER MulticastTransmittedFrameCount;
|
LARGE_INTEGER MulticastTransmittedFrameCount;
|
||||||
LARGE_INTEGER FailedCount;
|
LARGE_INTEGER FailedCount;
|
||||||
@ -242,69 +242,69 @@ typedef struct _NDIS_802_11_STATISTICS {
|
|||||||
LARGE_INTEGER FourWayHandshakeFailures;
|
LARGE_INTEGER FourWayHandshakeFailures;
|
||||||
} NDIS_802_11_STATISTICS, *PNDIS_802_11_STATISTICS;
|
} NDIS_802_11_STATISTICS, *PNDIS_802_11_STATISTICS;
|
||||||
|
|
||||||
typedef ULONG NDIS_802_11_KEY_INDEX;
|
typedef unsigned long NDIS_802_11_KEY_INDEX;
|
||||||
typedef ULONGLONG NDIS_802_11_KEY_RSC;
|
typedef unsigned long long NDIS_802_11_KEY_RSC;
|
||||||
|
|
||||||
#define MAX_RADIUS_SRV_NUM 2 /* 802.1x failover number */
|
#define MAX_RADIUS_SRV_NUM 2 /* 802.1x failover number */
|
||||||
|
|
||||||
typedef struct PACKED _RADIUS_SRV_INFO {
|
typedef struct PACKED _RADIUS_SRV_INFO {
|
||||||
UINT32 radius_ip;
|
u32 radius_ip;
|
||||||
UINT32 radius_port;
|
u32 radius_port;
|
||||||
UCHAR radius_key[64];
|
u8 radius_key[64];
|
||||||
UCHAR radius_key_len;
|
u8 radius_key_len;
|
||||||
} RADIUS_SRV_INFO, *PRADIUS_SRV_INFO;
|
} RADIUS_SRV_INFO, *PRADIUS_SRV_INFO;
|
||||||
|
|
||||||
typedef struct PACKED _RADIUS_KEY_INFO {
|
typedef struct PACKED _RADIUS_KEY_INFO {
|
||||||
UCHAR radius_srv_num;
|
u8 radius_srv_num;
|
||||||
RADIUS_SRV_INFO radius_srv_info[MAX_RADIUS_SRV_NUM];
|
RADIUS_SRV_INFO radius_srv_info[MAX_RADIUS_SRV_NUM];
|
||||||
UCHAR ieee8021xWEP; /* dynamic WEP */
|
u8 ieee8021xWEP; /* dynamic WEP */
|
||||||
UCHAR key_index;
|
u8 key_index;
|
||||||
UCHAR key_length; /* length of key in bytes */
|
u8 key_length; /* length of key in bytes */
|
||||||
UCHAR key_material[13];
|
u8 key_material[13];
|
||||||
} RADIUS_KEY_INFO, *PRADIUS_KEY_INFO;
|
} RADIUS_KEY_INFO, *PRADIUS_KEY_INFO;
|
||||||
|
|
||||||
/* It's used by 802.1x daemon to require relative configuration */
|
/* It's used by 802.1x daemon to require relative configuration */
|
||||||
typedef struct PACKED _RADIUS_CONF {
|
typedef struct PACKED _RADIUS_CONF {
|
||||||
UINT32 Length; /* Length of this structure */
|
u32 Length; /* Length of this structure */
|
||||||
UCHAR mbss_num; /* indicate multiple BSS number */
|
u8 mbss_num; /* indicate multiple BSS number */
|
||||||
UINT32 own_ip_addr;
|
u32 own_ip_addr;
|
||||||
UINT32 retry_interval;
|
u32 retry_interval;
|
||||||
UINT32 session_timeout_interval;
|
u32 session_timeout_interval;
|
||||||
UCHAR EAPifname[8][IFNAMSIZ];
|
u8 EAPifname[8][IFNAMSIZ];
|
||||||
UCHAR EAPifname_len[8];
|
u8 EAPifname_len[8];
|
||||||
UCHAR PreAuthifname[8][IFNAMSIZ];
|
u8 PreAuthifname[8][IFNAMSIZ];
|
||||||
UCHAR PreAuthifname_len[8];
|
u8 PreAuthifname_len[8];
|
||||||
RADIUS_KEY_INFO RadiusInfo[8];
|
RADIUS_KEY_INFO RadiusInfo[8];
|
||||||
} RADIUS_CONF, *PRADIUS_CONF;
|
} RADIUS_CONF, *PRADIUS_CONF;
|
||||||
|
|
||||||
/* Key mapping keys require a BSSID */
|
/* Key mapping keys require a BSSID */
|
||||||
typedef struct _NDIS_802_11_KEY {
|
typedef struct _NDIS_802_11_KEY {
|
||||||
UINT Length; /* Length of this structure */
|
u32 Length; /* Length of this structure */
|
||||||
UINT KeyIndex;
|
u32 KeyIndex;
|
||||||
UINT KeyLength; /* length of key in bytes */
|
u32 KeyLength; /* length of key in bytes */
|
||||||
NDIS_802_11_MAC_ADDRESS BSSID;
|
NDIS_802_11_MAC_ADDRESS BSSID;
|
||||||
NDIS_802_11_KEY_RSC KeyRSC;
|
NDIS_802_11_KEY_RSC KeyRSC;
|
||||||
UCHAR KeyMaterial[1]; /* variable length depending on above field */
|
u8 KeyMaterial[1]; /* variable length depending on above field */
|
||||||
} NDIS_802_11_KEY, *PNDIS_802_11_KEY;
|
} NDIS_802_11_KEY, *PNDIS_802_11_KEY;
|
||||||
|
|
||||||
typedef struct _NDIS_802_11_PASSPHRASE {
|
typedef struct _NDIS_802_11_PASSPHRASE {
|
||||||
UINT KeyLength; /* length of key in bytes */
|
u32 KeyLength; /* length of key in bytes */
|
||||||
NDIS_802_11_MAC_ADDRESS BSSID;
|
NDIS_802_11_MAC_ADDRESS BSSID;
|
||||||
UCHAR KeyMaterial[1]; /* variable length depending on above field */
|
u8 KeyMaterial[1]; /* variable length depending on above field */
|
||||||
} NDIS_802_11_PASSPHRASE, *PNDIS_802_11_PASSPHRASE;
|
} NDIS_802_11_PASSPHRASE, *PNDIS_802_11_PASSPHRASE;
|
||||||
|
|
||||||
typedef struct _NDIS_802_11_REMOVE_KEY {
|
typedef struct _NDIS_802_11_REMOVE_KEY {
|
||||||
UINT Length; /* Length of this structure */
|
u32 Length; /* Length of this structure */
|
||||||
UINT KeyIndex;
|
u32 KeyIndex;
|
||||||
NDIS_802_11_MAC_ADDRESS BSSID;
|
NDIS_802_11_MAC_ADDRESS BSSID;
|
||||||
} NDIS_802_11_REMOVE_KEY, *PNDIS_802_11_REMOVE_KEY;
|
} NDIS_802_11_REMOVE_KEY, *PNDIS_802_11_REMOVE_KEY;
|
||||||
|
|
||||||
typedef struct _NDIS_802_11_WEP {
|
typedef struct _NDIS_802_11_WEP {
|
||||||
UINT Length; /* Length of this structure */
|
u32 Length; /* Length of this structure */
|
||||||
UINT KeyIndex; /* 0 is the per-client key, 1-N are the */
|
u32 KeyIndex; /* 0 is the per-client key, 1-N are the */
|
||||||
/* global keys */
|
/* global keys */
|
||||||
UINT KeyLength; /* length of key in bytes */
|
u32 KeyLength; /* length of key in bytes */
|
||||||
UCHAR KeyMaterial[1]; /* variable length depending on above field */
|
u8 KeyMaterial[1]; /* variable length depending on above field */
|
||||||
} NDIS_802_11_WEP, *PNDIS_802_11_WEP;
|
} NDIS_802_11_WEP, *PNDIS_802_11_WEP;
|
||||||
|
|
||||||
typedef enum _NDIS_802_11_NETWORK_INFRASTRUCTURE {
|
typedef enum _NDIS_802_11_NETWORK_INFRASTRUCTURE {
|
||||||
@ -330,21 +330,21 @@ typedef enum _NDIS_802_11_AUTHENTICATION_MODE {
|
|||||||
Ndis802_11AuthModeMax /* Not a real mode, defined as upper bound */
|
Ndis802_11AuthModeMax /* Not a real mode, defined as upper bound */
|
||||||
} NDIS_802_11_AUTHENTICATION_MODE, *PNDIS_802_11_AUTHENTICATION_MODE;
|
} NDIS_802_11_AUTHENTICATION_MODE, *PNDIS_802_11_AUTHENTICATION_MODE;
|
||||||
|
|
||||||
typedef UCHAR NDIS_802_11_RATES[NDIS_802_11_LENGTH_RATES]; /* Set of 8 data rates */
|
typedef u8 NDIS_802_11_RATES[NDIS_802_11_LENGTH_RATES]; /* Set of 8 data rates */
|
||||||
typedef UCHAR NDIS_802_11_RATES_EX[NDIS_802_11_LENGTH_RATES_EX]; /* Set of 16 data rates */
|
typedef u8 NDIS_802_11_RATES_EX[NDIS_802_11_LENGTH_RATES_EX]; /* Set of 16 data rates */
|
||||||
|
|
||||||
typedef struct PACKED _NDIS_802_11_SSID {
|
typedef struct PACKED _NDIS_802_11_SSID {
|
||||||
UINT SsidLength; /* length of SSID field below, in bytes; */
|
u32 SsidLength; /* length of SSID field below, in bytes; */
|
||||||
/* this can be zero. */
|
/* this can be zero. */
|
||||||
UCHAR Ssid[NDIS_802_11_LENGTH_SSID]; /* SSID information field */
|
u8 Ssid[NDIS_802_11_LENGTH_SSID]; /* SSID information field */
|
||||||
} NDIS_802_11_SSID, *PNDIS_802_11_SSID;
|
} NDIS_802_11_SSID, *PNDIS_802_11_SSID;
|
||||||
|
|
||||||
typedef struct PACKED _NDIS_WLAN_BSSID {
|
typedef struct PACKED _NDIS_WLAN_BSSID {
|
||||||
ULONG Length; /* Length of this structure */
|
unsigned long Length; /* Length of this structure */
|
||||||
NDIS_802_11_MAC_ADDRESS MacAddress; /* BSSID */
|
NDIS_802_11_MAC_ADDRESS MacAddress; /* BSSID */
|
||||||
UCHAR Reserved[2];
|
u8 Reserved[2];
|
||||||
NDIS_802_11_SSID Ssid; /* SSID */
|
NDIS_802_11_SSID Ssid; /* SSID */
|
||||||
ULONG Privacy; /* WEP encryption requirement */
|
unsigned long Privacy; /* WEP encryption requirement */
|
||||||
NDIS_802_11_RSSI Rssi; /* receive signal strength in dBm */
|
NDIS_802_11_RSSI Rssi; /* receive signal strength in dBm */
|
||||||
NDIS_802_11_NETWORK_TYPE NetworkTypeInUse;
|
NDIS_802_11_NETWORK_TYPE NetworkTypeInUse;
|
||||||
NDIS_802_11_CONFIGURATION Configuration;
|
NDIS_802_11_CONFIGURATION Configuration;
|
||||||
@ -353,49 +353,49 @@ typedef struct PACKED _NDIS_WLAN_BSSID {
|
|||||||
} NDIS_WLAN_BSSID, *PNDIS_WLAN_BSSID;
|
} NDIS_WLAN_BSSID, *PNDIS_WLAN_BSSID;
|
||||||
|
|
||||||
typedef struct PACKED _NDIS_802_11_BSSID_LIST {
|
typedef struct PACKED _NDIS_802_11_BSSID_LIST {
|
||||||
UINT NumberOfItems; /* in list below, at least 1 */
|
u32 NumberOfItems; /* in list below, at least 1 */
|
||||||
NDIS_WLAN_BSSID Bssid[1];
|
NDIS_WLAN_BSSID Bssid[1];
|
||||||
} NDIS_802_11_BSSID_LIST, *PNDIS_802_11_BSSID_LIST;
|
} NDIS_802_11_BSSID_LIST, *PNDIS_802_11_BSSID_LIST;
|
||||||
|
|
||||||
/* Added Capabilities, IELength and IEs for each BSSID */
|
/* Added Capabilities, IELength and IEs for each BSSID */
|
||||||
typedef struct PACKED _NDIS_WLAN_BSSID_EX {
|
typedef struct PACKED _NDIS_WLAN_BSSID_EX {
|
||||||
ULONG Length; /* Length of this structure */
|
unsigned long Length; /* Length of this structure */
|
||||||
NDIS_802_11_MAC_ADDRESS MacAddress; /* BSSID */
|
NDIS_802_11_MAC_ADDRESS MacAddress; /* BSSID */
|
||||||
UCHAR Reserved[2];
|
u8 Reserved[2];
|
||||||
NDIS_802_11_SSID Ssid; /* SSID */
|
NDIS_802_11_SSID Ssid; /* SSID */
|
||||||
UINT Privacy; /* WEP encryption requirement */
|
u32 Privacy; /* WEP encryption requirement */
|
||||||
NDIS_802_11_RSSI Rssi; /* receive signal */
|
NDIS_802_11_RSSI Rssi; /* receive signal */
|
||||||
/* strength in dBm */
|
/* strength in dBm */
|
||||||
NDIS_802_11_NETWORK_TYPE NetworkTypeInUse;
|
NDIS_802_11_NETWORK_TYPE NetworkTypeInUse;
|
||||||
NDIS_802_11_CONFIGURATION Configuration;
|
NDIS_802_11_CONFIGURATION Configuration;
|
||||||
NDIS_802_11_NETWORK_INFRASTRUCTURE InfrastructureMode;
|
NDIS_802_11_NETWORK_INFRASTRUCTURE InfrastructureMode;
|
||||||
NDIS_802_11_RATES_EX SupportedRates;
|
NDIS_802_11_RATES_EX SupportedRates;
|
||||||
ULONG IELength;
|
unsigned long IELength;
|
||||||
UCHAR IEs[1];
|
u8 IEs[1];
|
||||||
} NDIS_WLAN_BSSID_EX, *PNDIS_WLAN_BSSID_EX;
|
} NDIS_WLAN_BSSID_EX, *PNDIS_WLAN_BSSID_EX;
|
||||||
|
|
||||||
typedef struct PACKED _NDIS_802_11_BSSID_LIST_EX {
|
typedef struct PACKED _NDIS_802_11_BSSID_LIST_EX {
|
||||||
UINT NumberOfItems; /* in list below, at least 1 */
|
u32 NumberOfItems; /* in list below, at least 1 */
|
||||||
NDIS_WLAN_BSSID_EX Bssid[1];
|
NDIS_WLAN_BSSID_EX Bssid[1];
|
||||||
} NDIS_802_11_BSSID_LIST_EX, *PNDIS_802_11_BSSID_LIST_EX;
|
} NDIS_802_11_BSSID_LIST_EX, *PNDIS_802_11_BSSID_LIST_EX;
|
||||||
|
|
||||||
typedef struct PACKED _NDIS_802_11_FIXED_IEs {
|
typedef struct PACKED _NDIS_802_11_FIXED_IEs {
|
||||||
UCHAR Timestamp[8];
|
u8 Timestamp[8];
|
||||||
USHORT BeaconInterval;
|
u16 BeaconInterval;
|
||||||
USHORT Capabilities;
|
u16 Capabilities;
|
||||||
} NDIS_802_11_FIXED_IEs, *PNDIS_802_11_FIXED_IEs;
|
} NDIS_802_11_FIXED_IEs, *PNDIS_802_11_FIXED_IEs;
|
||||||
|
|
||||||
typedef struct _NDIS_802_11_VARIABLE_IEs {
|
typedef struct _NDIS_802_11_VARIABLE_IEs {
|
||||||
UCHAR ElementID;
|
u8 ElementID;
|
||||||
UCHAR Length; /* Number of bytes in data field */
|
u8 Length; /* Number of bytes in data field */
|
||||||
UCHAR data[1];
|
u8 data[1];
|
||||||
} NDIS_802_11_VARIABLE_IEs, *PNDIS_802_11_VARIABLE_IEs;
|
} NDIS_802_11_VARIABLE_IEs, *PNDIS_802_11_VARIABLE_IEs;
|
||||||
|
|
||||||
typedef ULONG NDIS_802_11_FRAGMENTATION_THRESHOLD;
|
typedef unsigned long NDIS_802_11_FRAGMENTATION_THRESHOLD;
|
||||||
|
|
||||||
typedef ULONG NDIS_802_11_RTS_THRESHOLD;
|
typedef unsigned long NDIS_802_11_RTS_THRESHOLD;
|
||||||
|
|
||||||
typedef ULONG NDIS_802_11_ANTENNA;
|
typedef unsigned long NDIS_802_11_ANTENNA;
|
||||||
|
|
||||||
typedef enum _NDIS_802_11_PRIVACY_FILTER {
|
typedef enum _NDIS_802_11_PRIVACY_FILTER {
|
||||||
Ndis802_11PrivFilterAcceptAll,
|
Ndis802_11PrivFilterAcceptAll,
|
||||||
@ -437,27 +437,27 @@ typedef enum _NDIS_802_11_RELOAD_DEFAULTS {
|
|||||||
#define NDIS_802_11_AI_RESFI_ASSOCIATIONID 4
|
#define NDIS_802_11_AI_RESFI_ASSOCIATIONID 4
|
||||||
|
|
||||||
typedef struct _NDIS_802_11_AI_REQFI {
|
typedef struct _NDIS_802_11_AI_REQFI {
|
||||||
USHORT Capabilities;
|
u16 Capabilities;
|
||||||
USHORT ListenInterval;
|
u16 ListenInterval;
|
||||||
NDIS_802_11_MAC_ADDRESS CurrentAPAddress;
|
NDIS_802_11_MAC_ADDRESS CurrentAPAddress;
|
||||||
} NDIS_802_11_AI_REQFI, *PNDIS_802_11_AI_REQFI;
|
} NDIS_802_11_AI_REQFI, *PNDIS_802_11_AI_REQFI;
|
||||||
|
|
||||||
typedef struct _NDIS_802_11_AI_RESFI {
|
typedef struct _NDIS_802_11_AI_RESFI {
|
||||||
USHORT Capabilities;
|
u16 Capabilities;
|
||||||
USHORT StatusCode;
|
u16 StatusCode;
|
||||||
USHORT AssociationId;
|
u16 AssociationId;
|
||||||
} NDIS_802_11_AI_RESFI, *PNDIS_802_11_AI_RESFI;
|
} NDIS_802_11_AI_RESFI, *PNDIS_802_11_AI_RESFI;
|
||||||
|
|
||||||
typedef struct _NDIS_802_11_ASSOCIATION_INFORMATION {
|
typedef struct _NDIS_802_11_ASSOCIATION_INFORMATION {
|
||||||
ULONG Length;
|
unsigned long Length;
|
||||||
USHORT AvailableRequestFixedIEs;
|
u16 AvailableRequestFixedIEs;
|
||||||
NDIS_802_11_AI_REQFI RequestFixedIEs;
|
NDIS_802_11_AI_REQFI RequestFixedIEs;
|
||||||
ULONG RequestIELength;
|
unsigned long RequestIELength;
|
||||||
ULONG OffsetRequestIEs;
|
unsigned long OffsetRequestIEs;
|
||||||
USHORT AvailableResponseFixedIEs;
|
u16 AvailableResponseFixedIEs;
|
||||||
NDIS_802_11_AI_RESFI ResponseFixedIEs;
|
NDIS_802_11_AI_RESFI ResponseFixedIEs;
|
||||||
ULONG ResponseIELength;
|
unsigned long ResponseIELength;
|
||||||
ULONG OffsetResponseIEs;
|
unsigned long OffsetResponseIEs;
|
||||||
} NDIS_802_11_ASSOCIATION_INFORMATION, *PNDIS_802_11_ASSOCIATION_INFORMATION;
|
} NDIS_802_11_ASSOCIATION_INFORMATION, *PNDIS_802_11_ASSOCIATION_INFORMATION;
|
||||||
|
|
||||||
typedef struct _NDIS_802_11_AUTHENTICATION_EVENT {
|
typedef struct _NDIS_802_11_AUTHENTICATION_EVENT {
|
||||||
@ -472,7 +472,7 @@ typedef enum _NDIS_802_11_MEDIA_STREAM_MODE {
|
|||||||
} NDIS_802_11_MEDIA_STREAM_MODE, *PNDIS_802_11_MEDIA_STREAM_MODE;
|
} NDIS_802_11_MEDIA_STREAM_MODE, *PNDIS_802_11_MEDIA_STREAM_MODE;
|
||||||
|
|
||||||
/* PMKID Structures */
|
/* PMKID Structures */
|
||||||
typedef UCHAR NDIS_802_11_PMKID_VALUE[16];
|
typedef u8 NDIS_802_11_PMKID_VALUE[16];
|
||||||
|
|
||||||
typedef struct _BSSID_INFO {
|
typedef struct _BSSID_INFO {
|
||||||
NDIS_802_11_MAC_ADDRESS BSSID;
|
NDIS_802_11_MAC_ADDRESS BSSID;
|
||||||
@ -480,8 +480,8 @@ typedef struct _BSSID_INFO {
|
|||||||
} BSSID_INFO, *PBSSID_INFO;
|
} BSSID_INFO, *PBSSID_INFO;
|
||||||
|
|
||||||
typedef struct _NDIS_802_11_PMKID {
|
typedef struct _NDIS_802_11_PMKID {
|
||||||
UINT Length;
|
u32 Length;
|
||||||
UINT BSSIDInfoCount;
|
u32 BSSIDInfoCount;
|
||||||
BSSID_INFO BSSIDInfo[1];
|
BSSID_INFO BSSIDInfo[1];
|
||||||
} NDIS_802_11_PMKID, *PNDIS_802_11_PMKID;
|
} NDIS_802_11_PMKID, *PNDIS_802_11_PMKID;
|
||||||
|
|
||||||
@ -492,10 +492,10 @@ typedef struct _NDIS_802_11_AUTHENTICATION_ENCRYPTION {
|
|||||||
*PNDIS_802_11_AUTHENTICATION_ENCRYPTION;
|
*PNDIS_802_11_AUTHENTICATION_ENCRYPTION;
|
||||||
|
|
||||||
typedef struct _NDIS_802_11_CAPABILITY {
|
typedef struct _NDIS_802_11_CAPABILITY {
|
||||||
ULONG Length;
|
unsigned long Length;
|
||||||
ULONG Version;
|
unsigned long Version;
|
||||||
ULONG NoOfPMKIDs;
|
unsigned long NoOfPMKIDs;
|
||||||
ULONG NoOfAuthEncryptPairsSupported;
|
unsigned long NoOfAuthEncryptPairsSupported;
|
||||||
NDIS_802_11_AUTHENTICATION_ENCRYPTION
|
NDIS_802_11_AUTHENTICATION_ENCRYPTION
|
||||||
AuthenticationEncryptionSupported[1];
|
AuthenticationEncryptionSupported[1];
|
||||||
} NDIS_802_11_CAPABILITY, *PNDIS_802_11_CAPABILITY;
|
} NDIS_802_11_CAPABILITY, *PNDIS_802_11_CAPABILITY;
|
||||||
@ -561,16 +561,16 @@ enum {
|
|||||||
/* MIMO Tx parameter, ShortGI, MCS, STBC, etc. these are fields in TXWI. Don't change this definition!!! */
|
/* MIMO Tx parameter, ShortGI, MCS, STBC, etc. these are fields in TXWI. Don't change this definition!!! */
|
||||||
typedef union _HTTRANSMIT_SETTING {
|
typedef union _HTTRANSMIT_SETTING {
|
||||||
struct {
|
struct {
|
||||||
USHORT MCS:7; /* MCS */
|
u16 MCS:7; /* MCS */
|
||||||
USHORT BW:1; /*channel bandwidth 20MHz or 40 MHz */
|
u16 BW:1; /*channel bandwidth 20MHz or 40 MHz */
|
||||||
USHORT ShortGI:1;
|
u16 ShortGI:1;
|
||||||
USHORT STBC:2; /*SPACE */
|
u16 STBC:2; /*SPACE */
|
||||||
/* USHORT rsv:3; */
|
/* u16 rsv:3; */
|
||||||
USHORT rsv:2;
|
u16 rsv:2;
|
||||||
USHORT TxBF:1;
|
u16 TxBF:1;
|
||||||
USHORT MODE:2; /* Use definition MODE_xxx. */
|
u16 MODE:2; /* Use definition MODE_xxx. */
|
||||||
} field;
|
} field;
|
||||||
USHORT word;
|
u16 word;
|
||||||
} HTTRANSMIT_SETTING, *PHTTRANSMIT_SETTING;
|
} HTTRANSMIT_SETTING, *PHTTRANSMIT_SETTING;
|
||||||
|
|
||||||
typedef enum _RT_802_11_PREAMBLE {
|
typedef enum _RT_802_11_PREAMBLE {
|
||||||
@ -596,122 +596,122 @@ typedef enum _RT_802_11_PHY_MODE {
|
|||||||
|
|
||||||
/* put all proprietery for-query objects here to reduce # of Query_OID */
|
/* put all proprietery for-query objects here to reduce # of Query_OID */
|
||||||
typedef struct _RT_802_11_LINK_STATUS {
|
typedef struct _RT_802_11_LINK_STATUS {
|
||||||
ULONG CurrTxRate; /* in units of 0.5Mbps */
|
unsigned long CurrTxRate; /* in units of 0.5Mbps */
|
||||||
ULONG ChannelQuality; /* 0..100 % */
|
unsigned long ChannelQuality; /* 0..100 % */
|
||||||
ULONG TxByteCount; /* both ok and fail */
|
unsigned long TxByteCount; /* both ok and fail */
|
||||||
ULONG RxByteCount; /* both ok and fail */
|
unsigned long RxByteCount; /* both ok and fail */
|
||||||
ULONG CentralChannel; /* 40MHz central channel number */
|
unsigned long CentralChannel; /* 40MHz central channel number */
|
||||||
} RT_802_11_LINK_STATUS, *PRT_802_11_LINK_STATUS;
|
} RT_802_11_LINK_STATUS, *PRT_802_11_LINK_STATUS;
|
||||||
|
|
||||||
typedef struct _RT_802_11_EVENT_LOG {
|
typedef struct _RT_802_11_EVENT_LOG {
|
||||||
LARGE_INTEGER SystemTime; /* timestammp via NdisGetCurrentSystemTime() */
|
LARGE_INTEGER SystemTime; /* timestammp via NdisGetCurrentSystemTime() */
|
||||||
UCHAR Addr[MAC_ADDR_LENGTH];
|
u8 Addr[MAC_ADDR_LENGTH];
|
||||||
USHORT Event; /* EVENT_xxx */
|
u16 Event; /* EVENT_xxx */
|
||||||
} RT_802_11_EVENT_LOG, *PRT_802_11_EVENT_LOG;
|
} RT_802_11_EVENT_LOG, *PRT_802_11_EVENT_LOG;
|
||||||
|
|
||||||
typedef struct _RT_802_11_EVENT_TABLE {
|
typedef struct _RT_802_11_EVENT_TABLE {
|
||||||
ULONG Num;
|
unsigned long Num;
|
||||||
ULONG Rsv; /* to align Log[] at LARGE_INEGER boundary */
|
unsigned long Rsv; /* to align Log[] at LARGE_INEGER boundary */
|
||||||
RT_802_11_EVENT_LOG Log[MAX_NUMBER_OF_EVENT];
|
RT_802_11_EVENT_LOG Log[MAX_NUMBER_OF_EVENT];
|
||||||
} RT_802_11_EVENT_TABLE, PRT_802_11_EVENT_TABLE;
|
} RT_802_11_EVENT_TABLE, PRT_802_11_EVENT_TABLE;
|
||||||
|
|
||||||
/* MIMO Tx parameter, ShortGI, MCS, STBC, etc. these are fields in TXWI. Don't change this definition!!! */
|
/* MIMO Tx parameter, ShortGI, MCS, STBC, etc. these are fields in TXWI. Don't change this definition!!! */
|
||||||
typedef union _MACHTTRANSMIT_SETTING {
|
typedef union _MACHTTRANSMIT_SETTING {
|
||||||
struct {
|
struct {
|
||||||
USHORT MCS:7; /* MCS */
|
u16 MCS:7; /* MCS */
|
||||||
USHORT BW:1; /*channel bandwidth 20MHz or 40 MHz */
|
u16 BW:1; /*channel bandwidth 20MHz or 40 MHz */
|
||||||
USHORT ShortGI:1;
|
u16 ShortGI:1;
|
||||||
USHORT STBC:2; /*SPACE */
|
u16 STBC:2; /*SPACE */
|
||||||
USHORT rsv:3;
|
u16 rsv:3;
|
||||||
USHORT MODE:2; /* Use definition MODE_xxx. */
|
u16 MODE:2; /* Use definition MODE_xxx. */
|
||||||
} field;
|
} field;
|
||||||
USHORT word;
|
u16 word;
|
||||||
} MACHTTRANSMIT_SETTING, *PMACHTTRANSMIT_SETTING;
|
} MACHTTRANSMIT_SETTING, *PMACHTTRANSMIT_SETTING;
|
||||||
|
|
||||||
typedef struct _RT_802_11_MAC_ENTRY {
|
typedef struct _RT_802_11_MAC_ENTRY {
|
||||||
UCHAR Addr[MAC_ADDR_LENGTH];
|
u8 Addr[MAC_ADDR_LENGTH];
|
||||||
UCHAR Aid;
|
u8 Aid;
|
||||||
UCHAR Psm; /* 0:PWR_ACTIVE, 1:PWR_SAVE */
|
u8 Psm; /* 0:PWR_ACTIVE, 1:PWR_SAVE */
|
||||||
UCHAR MimoPs; /* 0:MMPS_STATIC, 1:MMPS_DYNAMIC, 3:MMPS_Enabled */
|
u8 MimoPs; /* 0:MMPS_STATIC, 1:MMPS_DYNAMIC, 3:MMPS_Enabled */
|
||||||
CHAR AvgRssi0;
|
char AvgRssi0;
|
||||||
CHAR AvgRssi1;
|
char AvgRssi1;
|
||||||
CHAR AvgRssi2;
|
char AvgRssi2;
|
||||||
UINT32 ConnectedTime;
|
u32 ConnectedTime;
|
||||||
MACHTTRANSMIT_SETTING TxRate;
|
MACHTTRANSMIT_SETTING TxRate;
|
||||||
} RT_802_11_MAC_ENTRY, *PRT_802_11_MAC_ENTRY;
|
} RT_802_11_MAC_ENTRY, *PRT_802_11_MAC_ENTRY;
|
||||||
|
|
||||||
typedef struct _RT_802_11_MAC_TABLE {
|
typedef struct _RT_802_11_MAC_TABLE {
|
||||||
ULONG Num;
|
unsigned long Num;
|
||||||
RT_802_11_MAC_ENTRY Entry[MAX_NUMBER_OF_MAC];
|
RT_802_11_MAC_ENTRY Entry[MAX_NUMBER_OF_MAC];
|
||||||
} RT_802_11_MAC_TABLE, *PRT_802_11_MAC_TABLE;
|
} RT_802_11_MAC_TABLE, *PRT_802_11_MAC_TABLE;
|
||||||
|
|
||||||
/* structure for query/set hardware register - MAC, BBP, RF register */
|
/* structure for query/set hardware register - MAC, BBP, RF register */
|
||||||
typedef struct _RT_802_11_HARDWARE_REGISTER {
|
typedef struct _RT_802_11_HARDWARE_REGISTER {
|
||||||
ULONG HardwareType; /* 0:MAC, 1:BBP, 2:RF register, 3:EEPROM */
|
unsigned long HardwareType; /* 0:MAC, 1:BBP, 2:RF register, 3:EEPROM */
|
||||||
ULONG Offset; /* Q/S register offset addr */
|
unsigned long Offset; /* Q/S register offset addr */
|
||||||
ULONG Data; /* R/W data buffer */
|
unsigned long Data; /* R/W data buffer */
|
||||||
} RT_802_11_HARDWARE_REGISTER, *PRT_802_11_HARDWARE_REGISTER;
|
} RT_802_11_HARDWARE_REGISTER, *PRT_802_11_HARDWARE_REGISTER;
|
||||||
|
|
||||||
typedef struct _RT_802_11_AP_CONFIG {
|
typedef struct _RT_802_11_AP_CONFIG {
|
||||||
ULONG EnableTxBurst; /* 0-disable, 1-enable */
|
unsigned long EnableTxBurst; /* 0-disable, 1-enable */
|
||||||
ULONG EnableTurboRate; /* 0-disable, 1-enable 72/100mbps turbo rate */
|
unsigned long EnableTurboRate; /* 0-disable, 1-enable 72/100mbps turbo rate */
|
||||||
ULONG IsolateInterStaTraffic; /* 0-disable, 1-enable isolation */
|
unsigned long IsolateInterStaTraffic; /* 0-disable, 1-enable isolation */
|
||||||
ULONG HideSsid; /* 0-disable, 1-enable hiding */
|
unsigned long HideSsid; /* 0-disable, 1-enable hiding */
|
||||||
ULONG UseBGProtection; /* 0-AUTO, 1-always ON, 2-always OFF */
|
unsigned long UseBGProtection; /* 0-AUTO, 1-always ON, 2-always OFF */
|
||||||
ULONG UseShortSlotTime; /* 0-no use, 1-use 9-us short slot time */
|
unsigned long UseShortSlotTime; /* 0-no use, 1-use 9-us short slot time */
|
||||||
ULONG Rsv1; /* must be 0 */
|
unsigned long Rsv1; /* must be 0 */
|
||||||
ULONG SystemErrorBitmap; /* ignore upon SET, return system error upon QUERY */
|
unsigned long SystemErrorBitmap; /* ignore upon SET, return system error upon QUERY */
|
||||||
} RT_802_11_AP_CONFIG, *PRT_802_11_AP_CONFIG;
|
} RT_802_11_AP_CONFIG, *PRT_802_11_AP_CONFIG;
|
||||||
|
|
||||||
/* structure to query/set STA_CONFIG */
|
/* structure to query/set STA_CONFIG */
|
||||||
typedef struct _RT_802_11_STA_CONFIG {
|
typedef struct _RT_802_11_STA_CONFIG {
|
||||||
ULONG EnableTxBurst; /* 0-disable, 1-enable */
|
unsigned long EnableTxBurst; /* 0-disable, 1-enable */
|
||||||
ULONG EnableTurboRate; /* 0-disable, 1-enable 72/100mbps turbo rate */
|
unsigned long EnableTurboRate; /* 0-disable, 1-enable 72/100mbps turbo rate */
|
||||||
ULONG UseBGProtection; /* 0-AUTO, 1-always ON, 2-always OFF */
|
unsigned long UseBGProtection; /* 0-AUTO, 1-always ON, 2-always OFF */
|
||||||
ULONG UseShortSlotTime; /* 0-no use, 1-use 9-us short slot time when applicable */
|
unsigned long UseShortSlotTime; /* 0-no use, 1-use 9-us short slot time when applicable */
|
||||||
ULONG AdhocMode; /* 0-11b rates only (WIFI spec), 1 - b/g mixed, 2 - g only */
|
unsigned long AdhocMode; /* 0-11b rates only (WIFI spec), 1 - b/g mixed, 2 - g only */
|
||||||
ULONG HwRadioStatus; /* 0-OFF, 1-ON, default is 1, Read-Only */
|
unsigned long HwRadioStatus; /* 0-OFF, 1-ON, default is 1, Read-Only */
|
||||||
ULONG Rsv1; /* must be 0 */
|
unsigned long Rsv1; /* must be 0 */
|
||||||
ULONG SystemErrorBitmap; /* ignore upon SET, return system error upon QUERY */
|
unsigned long SystemErrorBitmap; /* ignore upon SET, return system error upon QUERY */
|
||||||
} RT_802_11_STA_CONFIG, *PRT_802_11_STA_CONFIG;
|
} RT_802_11_STA_CONFIG, *PRT_802_11_STA_CONFIG;
|
||||||
|
|
||||||
/* */
|
/* */
|
||||||
/* For OID Query or Set about BA structure */
|
/* For OID Query or Set about BA structure */
|
||||||
/* */
|
/* */
|
||||||
typedef struct _OID_BACAP_STRUC {
|
typedef struct _OID_BACAP_STRUC {
|
||||||
UCHAR RxBAWinLimit;
|
u8 RxBAWinLimit;
|
||||||
UCHAR TxBAWinLimit;
|
u8 TxBAWinLimit;
|
||||||
UCHAR Policy; /* 0: DELAY_BA 1:IMMED_BA (//BA Policy subfiled value in ADDBA frame) 2:BA-not use. other value invalid */
|
u8 Policy; /* 0: DELAY_BA 1:IMMED_BA (//BA Policy subfiled value in ADDBA frame) 2:BA-not use. other value invalid */
|
||||||
UCHAR MpduDensity; /* 0: DELAY_BA 1:IMMED_BA (//BA Policy subfiled value in ADDBA frame) 2:BA-not use. other value invalid */
|
u8 MpduDensity; /* 0: DELAY_BA 1:IMMED_BA (//BA Policy subfiled value in ADDBA frame) 2:BA-not use. other value invalid */
|
||||||
UCHAR AmsduEnable; /*Enable AMSDU transmisstion */
|
u8 AmsduEnable; /*Enable AMSDU transmisstion */
|
||||||
UCHAR AmsduSize; /* 0:3839, 1:7935 bytes. UINT MSDUSizeToBytes[] = { 3839, 7935}; */
|
u8 AmsduSize; /* 0:3839, 1:7935 bytes. u32 MSDUSizeToBytes[] = { 3839, 7935}; */
|
||||||
UCHAR MMPSmode; /* MIMO power save more, 0:static, 1:dynamic, 2:rsv, 3:mimo enable */
|
u8 MMPSmode; /* MIMO power save more, 0:static, 1:dynamic, 2:rsv, 3:mimo enable */
|
||||||
BOOLEAN AutoBA; /* Auto BA will automatically */
|
BOOLEAN AutoBA; /* Auto BA will automatically */
|
||||||
} OID_BACAP_STRUC, *POID_BACAP_STRUC;
|
} OID_BACAP_STRUC, *POID_BACAP_STRUC;
|
||||||
|
|
||||||
typedef struct _RT_802_11_ACL_ENTRY {
|
typedef struct _RT_802_11_ACL_ENTRY {
|
||||||
UCHAR Addr[MAC_ADDR_LENGTH];
|
u8 Addr[MAC_ADDR_LENGTH];
|
||||||
USHORT Rsv;
|
u16 Rsv;
|
||||||
} RT_802_11_ACL_ENTRY, *PRT_802_11_ACL_ENTRY;
|
} RT_802_11_ACL_ENTRY, *PRT_802_11_ACL_ENTRY;
|
||||||
|
|
||||||
typedef struct PACKED _RT_802_11_ACL {
|
typedef struct PACKED _RT_802_11_ACL {
|
||||||
ULONG Policy; /* 0-disable, 1-positive list, 2-negative list */
|
unsigned long Policy; /* 0-disable, 1-positive list, 2-negative list */
|
||||||
ULONG Num;
|
unsigned long Num;
|
||||||
RT_802_11_ACL_ENTRY Entry[MAX_NUMBER_OF_ACL];
|
RT_802_11_ACL_ENTRY Entry[MAX_NUMBER_OF_ACL];
|
||||||
} RT_802_11_ACL, *PRT_802_11_ACL;
|
} RT_802_11_ACL, *PRT_802_11_ACL;
|
||||||
|
|
||||||
typedef struct _RT_802_11_WDS {
|
typedef struct _RT_802_11_WDS {
|
||||||
ULONG Num;
|
unsigned long Num;
|
||||||
NDIS_802_11_MAC_ADDRESS Entry[24 /*MAX_NUM_OF_WDS_LINK */ ];
|
NDIS_802_11_MAC_ADDRESS Entry[24 /*MAX_NUM_OF_WDS_LINK */ ];
|
||||||
ULONG KeyLength;
|
unsigned long KeyLength;
|
||||||
UCHAR KeyMaterial[32];
|
u8 KeyMaterial[32];
|
||||||
} RT_802_11_WDS, *PRT_802_11_WDS;
|
} RT_802_11_WDS, *PRT_802_11_WDS;
|
||||||
|
|
||||||
typedef struct _RT_802_11_TX_RATES_ {
|
typedef struct _RT_802_11_TX_RATES_ {
|
||||||
UCHAR SupRateLen;
|
u8 SupRateLen;
|
||||||
UCHAR SupRate[MAX_LENGTH_OF_SUPPORT_RATES];
|
u8 SupRate[MAX_LENGTH_OF_SUPPORT_RATES];
|
||||||
UCHAR ExtRateLen;
|
u8 ExtRateLen;
|
||||||
UCHAR ExtRate[MAX_LENGTH_OF_SUPPORT_RATES];
|
u8 ExtRate[MAX_LENGTH_OF_SUPPORT_RATES];
|
||||||
} RT_802_11_TX_RATES, *PRT_802_11_TX_RATES;
|
} RT_802_11_TX_RATES, *PRT_802_11_TX_RATES;
|
||||||
|
|
||||||
/* Definition of extra information code */
|
/* Definition of extra information code */
|
||||||
@ -734,14 +734,14 @@ typedef struct _RT_802_11_TX_RATES_ {
|
|||||||
/* This is OID setting structure. So only GF or MM as Mode. This is valid when our wirelss mode has 802.11n in use. */
|
/* This is OID setting structure. So only GF or MM as Mode. This is valid when our wirelss mode has 802.11n in use. */
|
||||||
typedef struct {
|
typedef struct {
|
||||||
RT_802_11_PHY_MODE PhyMode; /* */
|
RT_802_11_PHY_MODE PhyMode; /* */
|
||||||
UCHAR TransmitNo;
|
u8 TransmitNo;
|
||||||
UCHAR HtMode; /*HTMODE_GF or HTMODE_MM */
|
u8 HtMode; /*HTMODE_GF or HTMODE_MM */
|
||||||
UCHAR ExtOffset; /*extension channel above or below */
|
u8 ExtOffset; /*extension channel above or below */
|
||||||
UCHAR MCS;
|
u8 MCS;
|
||||||
UCHAR BW;
|
u8 BW;
|
||||||
UCHAR STBC;
|
u8 STBC;
|
||||||
UCHAR SHORTGI;
|
u8 SHORTGI;
|
||||||
UCHAR rsv;
|
u8 rsv;
|
||||||
} OID_SET_HT_PHYMODE, *POID_SET_HT_PHYMODE;
|
} OID_SET_HT_PHYMODE, *POID_SET_HT_PHYMODE;
|
||||||
|
|
||||||
#define MAX_CUSTOM_LEN 128
|
#define MAX_CUSTOM_LEN 128
|
||||||
@ -753,26 +753,26 @@ typedef enum _RT_802_11_D_CLIENT_MODE {
|
|||||||
} RT_802_11_D_CLIENT_MODE, *PRT_802_11_D_CLIENT_MODE;
|
} RT_802_11_D_CLIENT_MODE, *PRT_802_11_D_CLIENT_MODE;
|
||||||
|
|
||||||
typedef struct _RT_CHANNEL_LIST_INFO {
|
typedef struct _RT_CHANNEL_LIST_INFO {
|
||||||
UCHAR ChannelList[MAX_NUM_OF_CHS]; /* list all supported channels for site survey */
|
u8 ChannelList[MAX_NUM_OF_CHS]; /* list all supported channels for site survey */
|
||||||
UCHAR ChannelListNum; /* number of channel in ChannelList[] */
|
u8 ChannelListNum; /* number of channel in ChannelList[] */
|
||||||
} RT_CHANNEL_LIST_INFO, *PRT_CHANNEL_LIST_INFO;
|
} RT_CHANNEL_LIST_INFO, *PRT_CHANNEL_LIST_INFO;
|
||||||
|
|
||||||
/* WSC configured credential */
|
/* WSC configured credential */
|
||||||
typedef struct _WSC_CREDENTIAL {
|
typedef struct _WSC_CREDENTIAL {
|
||||||
NDIS_802_11_SSID SSID; /* mandatory */
|
NDIS_802_11_SSID SSID; /* mandatory */
|
||||||
USHORT AuthType; /* mandatory, 1: open, 2: wpa-psk, 4: shared, 8:wpa, 0x10: wpa2, 0x20: wpa2-psk */
|
u16 AuthType; /* mandatory, 1: open, 2: wpa-psk, 4: shared, 8:wpa, 0x10: wpa2, 0x20: wpa2-psk */
|
||||||
USHORT EncrType; /* mandatory, 1: none, 2: wep, 4: tkip, 8: aes */
|
u16 EncrType; /* mandatory, 1: none, 2: wep, 4: tkip, 8: aes */
|
||||||
UCHAR Key[64]; /* mandatory, Maximum 64 byte */
|
u8 Key[64]; /* mandatory, Maximum 64 byte */
|
||||||
USHORT KeyLength;
|
u16 KeyLength;
|
||||||
UCHAR MacAddr[6]; /* mandatory, AP MAC address */
|
u8 MacAddr[6]; /* mandatory, AP MAC address */
|
||||||
UCHAR KeyIndex; /* optional, default is 1 */
|
u8 KeyIndex; /* optional, default is 1 */
|
||||||
UCHAR Rsvd[3]; /* Make alignment */
|
u8 Rsvd[3]; /* Make alignment */
|
||||||
} WSC_CREDENTIAL, *PWSC_CREDENTIAL;
|
} WSC_CREDENTIAL, *PWSC_CREDENTIAL;
|
||||||
|
|
||||||
/* WSC configured profiles */
|
/* WSC configured profiles */
|
||||||
typedef struct _WSC_PROFILE {
|
typedef struct _WSC_PROFILE {
|
||||||
UINT ProfileCnt;
|
u32 ProfileCnt;
|
||||||
UINT ApplyProfileIdx; /* add by johnli, fix WPS test plan 5.1.1 */
|
u32 ApplyProfileIdx; /* add by johnli, fix WPS test plan 5.1.1 */
|
||||||
WSC_CREDENTIAL Profile[8]; /* Support up to 8 profiles */
|
WSC_CREDENTIAL Profile[8]; /* Support up to 8 profiles */
|
||||||
} WSC_PROFILE, *PWSC_PROFILE;
|
} WSC_PROFILE, *PWSC_PROFILE;
|
||||||
|
|
||||||
|
@ -52,13 +52,13 @@ MODULE_ALIAS("rt3090sta");
|
|||||||
extern int rt28xx_close(IN struct net_device *net_dev);
|
extern int rt28xx_close(IN struct net_device *net_dev);
|
||||||
extern int rt28xx_open(struct net_device *net_dev);
|
extern int rt28xx_open(struct net_device *net_dev);
|
||||||
|
|
||||||
static VOID __devexit rt2860_remove_one(struct pci_dev *pci_dev);
|
static void __devexit rt2860_remove_one(struct pci_dev *pci_dev);
|
||||||
static INT __devinit rt2860_probe(struct pci_dev *pci_dev,
|
static int __devinit rt2860_probe(struct pci_dev *pci_dev,
|
||||||
const struct pci_device_id *ent);
|
const struct pci_device_id *ent);
|
||||||
static void __exit rt2860_cleanup_module(void);
|
static void __exit rt2860_cleanup_module(void);
|
||||||
static int __init rt2860_init_module(void);
|
static int __init rt2860_init_module(void);
|
||||||
|
|
||||||
static VOID RTMPInitPCIeDevice(IN struct pci_dev *pci_dev,
|
static void RTMPInitPCIeDevice(IN struct pci_dev *pci_dev,
|
||||||
IN PRTMP_ADAPTER pAd);
|
IN PRTMP_ADAPTER pAd);
|
||||||
|
|
||||||
#ifdef CONFIG_PM
|
#ifdef CONFIG_PM
|
||||||
@ -123,7 +123,7 @@ resume:rt2860_resume,
|
|||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
#ifdef CONFIG_PM
|
#ifdef CONFIG_PM
|
||||||
|
|
||||||
VOID RT2860RejectPendingPackets(IN PRTMP_ADAPTER pAd)
|
void RT2860RejectPendingPackets(IN PRTMP_ADAPTER pAd)
|
||||||
{
|
{
|
||||||
/* clear PS packets */
|
/* clear PS packets */
|
||||||
/* clear TxSw packets */
|
/* clear TxSw packets */
|
||||||
@ -133,7 +133,7 @@ static int rt2860_suspend(struct pci_dev *pci_dev, pm_message_t state)
|
|||||||
{
|
{
|
||||||
struct net_device *net_dev = pci_get_drvdata(pci_dev);
|
struct net_device *net_dev = pci_get_drvdata(pci_dev);
|
||||||
PRTMP_ADAPTER pAd = (PRTMP_ADAPTER) NULL;
|
PRTMP_ADAPTER pAd = (PRTMP_ADAPTER) NULL;
|
||||||
INT32 retval = 0;
|
int retval = 0;
|
||||||
|
|
||||||
DBGPRINT(RT_DEBUG_TRACE, ("===> rt2860_suspend()\n"));
|
DBGPRINT(RT_DEBUG_TRACE, ("===> rt2860_suspend()\n"));
|
||||||
|
|
||||||
@ -185,7 +185,7 @@ static int rt2860_resume(struct pci_dev *pci_dev)
|
|||||||
{
|
{
|
||||||
struct net_device *net_dev = pci_get_drvdata(pci_dev);
|
struct net_device *net_dev = pci_get_drvdata(pci_dev);
|
||||||
PRTMP_ADAPTER pAd = (PRTMP_ADAPTER) NULL;
|
PRTMP_ADAPTER pAd = (PRTMP_ADAPTER) NULL;
|
||||||
INT32 retval;
|
int retval;
|
||||||
|
|
||||||
/* set the power state of a PCI device */
|
/* set the power state of a PCI device */
|
||||||
/* PCI has 4 power states, DO (normal) ~ D3(less power) */
|
/* PCI has 4 power states, DO (normal) ~ D3(less power) */
|
||||||
@ -246,7 +246,7 @@ static int rt2860_resume(struct pci_dev *pci_dev)
|
|||||||
}
|
}
|
||||||
#endif /* CONFIG_PM // */
|
#endif /* CONFIG_PM // */
|
||||||
|
|
||||||
static INT __init rt2860_init_module(VOID)
|
static int __init rt2860_init_module(void)
|
||||||
{
|
{
|
||||||
return pci_register_driver(&rt2860_driver);
|
return pci_register_driver(&rt2860_driver);
|
||||||
}
|
}
|
||||||
@ -254,7 +254,7 @@ static INT __init rt2860_init_module(VOID)
|
|||||||
/* */
|
/* */
|
||||||
/* Driver module unload function */
|
/* Driver module unload function */
|
||||||
/* */
|
/* */
|
||||||
static VOID __exit rt2860_cleanup_module(VOID)
|
static void __exit rt2860_cleanup_module(void)
|
||||||
{
|
{
|
||||||
pci_unregister_driver(&rt2860_driver);
|
pci_unregister_driver(&rt2860_driver);
|
||||||
}
|
}
|
||||||
@ -265,15 +265,15 @@ module_exit(rt2860_cleanup_module);
|
|||||||
/* */
|
/* */
|
||||||
/* PCI device probe & initialization function */
|
/* PCI device probe & initialization function */
|
||||||
/* */
|
/* */
|
||||||
static INT __devinit rt2860_probe(IN struct pci_dev *pci_dev,
|
static int __devinit rt2860_probe(IN struct pci_dev *pci_dev,
|
||||||
IN const struct pci_device_id *pci_id)
|
IN const struct pci_device_id *pci_id)
|
||||||
{
|
{
|
||||||
PRTMP_ADAPTER pAd = (PRTMP_ADAPTER) NULL;
|
PRTMP_ADAPTER pAd = (PRTMP_ADAPTER) NULL;
|
||||||
struct net_device *net_dev;
|
struct net_device *net_dev;
|
||||||
PVOID handle;
|
void *handle;
|
||||||
PSTRING print_name;
|
char *print_name;
|
||||||
ULONG csr_addr;
|
unsigned long csr_addr;
|
||||||
INT rv = 0;
|
int rv = 0;
|
||||||
RTMP_OS_NETDEV_OP_HOOK netDevHook;
|
RTMP_OS_NETDEV_OP_HOOK netDevHook;
|
||||||
|
|
||||||
DBGPRINT(RT_DEBUG_TRACE, ("===> rt2860_probe\n"));
|
DBGPRINT(RT_DEBUG_TRACE, ("===> rt2860_probe\n"));
|
||||||
@ -286,7 +286,7 @@ static INT __devinit rt2860_probe(IN struct pci_dev *pci_dev,
|
|||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
|
|
||||||
print_name = (PSTRING) pci_name(pci_dev);
|
print_name = (char *)pci_name(pci_dev);
|
||||||
|
|
||||||
if ((rv = pci_request_regions(pci_dev, print_name)) != 0) {
|
if ((rv = pci_request_regions(pci_dev, print_name)) != 0) {
|
||||||
DBGPRINT(RT_DEBUG_ERROR,
|
DBGPRINT(RT_DEBUG_ERROR,
|
||||||
@ -300,14 +300,14 @@ static INT __devinit rt2860_probe(IN struct pci_dev *pci_dev,
|
|||||||
if (!csr_addr) {
|
if (!csr_addr) {
|
||||||
DBGPRINT(RT_DEBUG_ERROR,
|
DBGPRINT(RT_DEBUG_ERROR,
|
||||||
("ioremap failed for device %s, region 0x%lX @ 0x%lX\n",
|
("ioremap failed for device %s, region 0x%lX @ 0x%lX\n",
|
||||||
print_name, (ULONG) pci_resource_len(pci_dev, 0),
|
print_name, (unsigned long)pci_resource_len(pci_dev, 0),
|
||||||
(ULONG) pci_resource_start(pci_dev, 0)));
|
(unsigned long)pci_resource_start(pci_dev, 0)));
|
||||||
goto err_out_free_res;
|
goto err_out_free_res;
|
||||||
} else {
|
} else {
|
||||||
DBGPRINT(RT_DEBUG_TRACE,
|
DBGPRINT(RT_DEBUG_TRACE,
|
||||||
("%s: at 0x%lx, VA 0x%lx, IRQ %d. \n", print_name,
|
("%s: at 0x%lx, VA 0x%lx, IRQ %d. \n", print_name,
|
||||||
(ULONG) pci_resource_start(pci_dev, 0),
|
(unsigned long)pci_resource_start(pci_dev, 0),
|
||||||
(ULONG) csr_addr, pci_dev->irq));
|
(unsigned long)csr_addr, pci_dev->irq));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Set DMA master */
|
/* Set DMA master */
|
||||||
@ -329,10 +329,10 @@ static INT __devinit rt2860_probe(IN struct pci_dev *pci_dev,
|
|||||||
if (rv != NDIS_STATUS_SUCCESS)
|
if (rv != NDIS_STATUS_SUCCESS)
|
||||||
goto err_out_iounmap;
|
goto err_out_iounmap;
|
||||||
/* Here are the RTMP_ADAPTER structure with pci-bus specific parameters. */
|
/* Here are the RTMP_ADAPTER structure with pci-bus specific parameters. */
|
||||||
pAd->CSRBaseAddress = (PUCHAR) csr_addr;
|
pAd->CSRBaseAddress = (u8 *)csr_addr;
|
||||||
DBGPRINT(RT_DEBUG_ERROR,
|
DBGPRINT(RT_DEBUG_ERROR,
|
||||||
("pAd->CSRBaseAddress =0x%lx, csr_addr=0x%lx!\n",
|
("pAd->CSRBaseAddress =0x%lx, csr_addr=0x%lx!\n",
|
||||||
(ULONG) pAd->CSRBaseAddress, csr_addr));
|
(unsigned long)pAd->CSRBaseAddress, csr_addr));
|
||||||
RtmpRaDevCtrlInit(pAd, RTMP_DEV_INF_PCI);
|
RtmpRaDevCtrlInit(pAd, RTMP_DEV_INF_PCI);
|
||||||
|
|
||||||
/*NetDevInit============================================== */
|
/*NetDevInit============================================== */
|
||||||
@ -389,11 +389,11 @@ err_out:
|
|||||||
return -ENODEV; /* probe fail */
|
return -ENODEV; /* probe fail */
|
||||||
}
|
}
|
||||||
|
|
||||||
static VOID __devexit rt2860_remove_one(IN struct pci_dev *pci_dev)
|
static void __devexit rt2860_remove_one(IN struct pci_dev *pci_dev)
|
||||||
{
|
{
|
||||||
PNET_DEV net_dev = pci_get_drvdata(pci_dev);
|
PNET_DEV net_dev = pci_get_drvdata(pci_dev);
|
||||||
RTMP_ADAPTER *pAd = NULL;
|
RTMP_ADAPTER *pAd = NULL;
|
||||||
ULONG csr_addr = net_dev->base_addr; /* pAd->CSRBaseAddress; */
|
unsigned long csr_addr = net_dev->base_addr; /* pAd->CSRBaseAddress; */
|
||||||
|
|
||||||
GET_PAD_FROM_NET_DEV(pAd, net_dev);
|
GET_PAD_FROM_NET_DEV(pAd, net_dev);
|
||||||
|
|
||||||
@ -456,9 +456,9 @@ BOOLEAN RT28XXChipsetCheck(IN void *_dev_p)
|
|||||||
* PCIe device initialization related procedures.
|
* PCIe device initialization related procedures.
|
||||||
*
|
*
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
static VOID RTMPInitPCIeDevice(IN struct pci_dev *pci_dev, IN PRTMP_ADAPTER pAd)
|
static void RTMPInitPCIeDevice(IN struct pci_dev *pci_dev, IN PRTMP_ADAPTER pAd)
|
||||||
{
|
{
|
||||||
USHORT device_id;
|
u16 device_id;
|
||||||
POS_COOKIE pObj;
|
POS_COOKIE pObj;
|
||||||
|
|
||||||
pObj = (POS_COOKIE) pAd->OS_Cookie;
|
pObj = (POS_COOKIE) pAd->OS_Cookie;
|
||||||
@ -477,7 +477,7 @@ static VOID RTMPInitPCIeDevice(IN struct pci_dev *pci_dev, IN PRTMP_ADAPTER pAd)
|
|||||||
(device_id == NIC3092_PCIe_DEVICE_ID) ||
|
(device_id == NIC3092_PCIe_DEVICE_ID) ||
|
||||||
#endif /* RT3090 // */
|
#endif /* RT3090 // */
|
||||||
0) {
|
0) {
|
||||||
UINT32 MacCsr0 = 0, Index = 0;
|
u32 MacCsr0 = 0, Index = 0;
|
||||||
do {
|
do {
|
||||||
RTMP_IO_READ32(pAd, MAC_CSR0, &MacCsr0);
|
RTMP_IO_READ32(pAd, MAC_CSR0, &MacCsr0);
|
||||||
|
|
||||||
@ -495,11 +495,11 @@ static VOID RTMPInitPCIeDevice(IN struct pci_dev *pci_dev, IN PRTMP_ADAPTER pAd)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID RTMPInitPCIeLinkCtrlValue(IN PRTMP_ADAPTER pAd)
|
void RTMPInitPCIeLinkCtrlValue(IN PRTMP_ADAPTER pAd)
|
||||||
{
|
{
|
||||||
INT pos;
|
int pos;
|
||||||
USHORT reg16, data2, PCIePowerSaveLevel, Configuration;
|
u16 reg16, data2, PCIePowerSaveLevel, Configuration;
|
||||||
UINT32 MacValue;
|
u32 MacValue;
|
||||||
BOOLEAN bFindIntel = FALSE;
|
BOOLEAN bFindIntel = FALSE;
|
||||||
POS_COOKIE pObj;
|
POS_COOKIE pObj;
|
||||||
|
|
||||||
@ -536,7 +536,7 @@ VOID RTMPInitPCIeLinkCtrlValue(IN PRTMP_ADAPTER pAd)
|
|||||||
("====> Write 0x83 = 0x%x.\n",
|
("====> Write 0x83 = 0x%x.\n",
|
||||||
PCIePowerSaveLevel));
|
PCIePowerSaveLevel));
|
||||||
AsicSendCommandToMcu(pAd, 0x83, 0xff,
|
AsicSendCommandToMcu(pAd, 0x83, 0xff,
|
||||||
(UCHAR) PCIePowerSaveLevel, 0x00);
|
(u8)PCIePowerSaveLevel, 0x00);
|
||||||
RT28xx_EEPROM_READ16(pAd, 0x22, PCIePowerSaveLevel);
|
RT28xx_EEPROM_READ16(pAd, 0x22, PCIePowerSaveLevel);
|
||||||
PCIePowerSaveLevel &= 0xff;
|
PCIePowerSaveLevel &= 0xff;
|
||||||
PCIePowerSaveLevel = PCIePowerSaveLevel >> 6;
|
PCIePowerSaveLevel = PCIePowerSaveLevel >> 6;
|
||||||
@ -570,7 +570,7 @@ VOID RTMPInitPCIeLinkCtrlValue(IN PRTMP_ADAPTER pAd)
|
|||||||
PCIePowerSaveLevel));
|
PCIePowerSaveLevel));
|
||||||
|
|
||||||
AsicSendCommandToMcu(pAd, 0x83, 0xff,
|
AsicSendCommandToMcu(pAd, 0x83, 0xff,
|
||||||
(UCHAR) PCIePowerSaveLevel,
|
(u8)PCIePowerSaveLevel,
|
||||||
0x00);
|
0x00);
|
||||||
}
|
}
|
||||||
DBGPRINT(RT_DEBUG_TRACE,
|
DBGPRINT(RT_DEBUG_TRACE,
|
||||||
@ -578,7 +578,7 @@ VOID RTMPInitPCIeLinkCtrlValue(IN PRTMP_ADAPTER pAd)
|
|||||||
pAd->LnkCtrlBitMask));
|
pAd->LnkCtrlBitMask));
|
||||||
}
|
}
|
||||||
} else if (IS_RT3090(pAd) || IS_RT3572(pAd) || IS_RT3390(pAd)) {
|
} else if (IS_RT3090(pAd) || IS_RT3572(pAd) || IS_RT3390(pAd)) {
|
||||||
UCHAR LinkCtrlSetting = 0;
|
u8 LinkCtrlSetting = 0;
|
||||||
|
|
||||||
/* Check 3090E special setting chip. */
|
/* Check 3090E special setting chip. */
|
||||||
RT28xx_EEPROM_READ16(pAd, 0x24, data2);
|
RT28xx_EEPROM_READ16(pAd, 0x24, data2);
|
||||||
@ -630,7 +630,7 @@ VOID RTMPInitPCIeLinkCtrlValue(IN PRTMP_ADAPTER pAd)
|
|||||||
/* 1. read setting from inf file. */
|
/* 1. read setting from inf file. */
|
||||||
|
|
||||||
PCIePowerSaveLevel =
|
PCIePowerSaveLevel =
|
||||||
(USHORT) pAd->StaCfg.PSControl.field.rt30xxPowerMode;
|
(u16)pAd->StaCfg.PSControl.field.rt30xxPowerMode;
|
||||||
DBGPRINT(RT_DEBUG_ERROR,
|
DBGPRINT(RT_DEBUG_ERROR,
|
||||||
("====> rt30xx Read PowerLevelMode = 0x%x.\n",
|
("====> rt30xx Read PowerLevelMode = 0x%x.\n",
|
||||||
PCIePowerSaveLevel));
|
PCIePowerSaveLevel));
|
||||||
@ -642,13 +642,13 @@ VOID RTMPInitPCIeLinkCtrlValue(IN PRTMP_ADAPTER pAd)
|
|||||||
&& (pAd->b3090ESpecialChip == FALSE)) {
|
&& (pAd->b3090ESpecialChip == FALSE)) {
|
||||||
/* Chip Version E only allow 1, So force set 1. */
|
/* Chip Version E only allow 1, So force set 1. */
|
||||||
PCIePowerSaveLevel &= 0x1;
|
PCIePowerSaveLevel &= 0x1;
|
||||||
pAd->PCIePowerSaveLevel = (USHORT) PCIePowerSaveLevel;
|
pAd->PCIePowerSaveLevel = (u16)PCIePowerSaveLevel;
|
||||||
DBGPRINT(RT_DEBUG_TRACE,
|
DBGPRINT(RT_DEBUG_TRACE,
|
||||||
("====> rt30xx E Write 0x83 Command = 0x%x.\n",
|
("====> rt30xx E Write 0x83 Command = 0x%x.\n",
|
||||||
PCIePowerSaveLevel));
|
PCIePowerSaveLevel));
|
||||||
|
|
||||||
AsicSendCommandToMcu(pAd, 0x83, 0xff,
|
AsicSendCommandToMcu(pAd, 0x83, 0xff,
|
||||||
(UCHAR) PCIePowerSaveLevel, 0x00);
|
(u8)PCIePowerSaveLevel, 0x00);
|
||||||
} else {
|
} else {
|
||||||
/* Chip Version F and after only allow 1 or 2 or 3. This might be modified after new chip version come out. */
|
/* Chip Version F and after only allow 1 or 2 or 3. This might be modified after new chip version come out. */
|
||||||
if (!
|
if (!
|
||||||
@ -658,7 +658,7 @@ VOID RTMPInitPCIeLinkCtrlValue(IN PRTMP_ADAPTER pAd)
|
|||||||
DBGPRINT(RT_DEBUG_ERROR,
|
DBGPRINT(RT_DEBUG_ERROR,
|
||||||
("====> rt30xx F Write 0x83 Command = 0x%x.\n",
|
("====> rt30xx F Write 0x83 Command = 0x%x.\n",
|
||||||
PCIePowerSaveLevel));
|
PCIePowerSaveLevel));
|
||||||
pAd->PCIePowerSaveLevel = (USHORT) PCIePowerSaveLevel;
|
pAd->PCIePowerSaveLevel = (u16)PCIePowerSaveLevel;
|
||||||
/* for 3090F , we need to add high-byte arg for 0x83 command to indicate the link control setting in */
|
/* for 3090F , we need to add high-byte arg for 0x83 command to indicate the link control setting in */
|
||||||
/* PCI Configuration Space. Because firmware can't read PCI Configuration Space */
|
/* PCI Configuration Space. Because firmware can't read PCI Configuration Space */
|
||||||
if ((pAd->Rt3xxRalinkLinkCtrl & 0x2)
|
if ((pAd->Rt3xxRalinkLinkCtrl & 0x2)
|
||||||
@ -669,7 +669,7 @@ VOID RTMPInitPCIeLinkCtrlValue(IN PRTMP_ADAPTER pAd)
|
|||||||
("====> rt30xxF LinkCtrlSetting = 0x%x.\n",
|
("====> rt30xxF LinkCtrlSetting = 0x%x.\n",
|
||||||
LinkCtrlSetting));
|
LinkCtrlSetting));
|
||||||
AsicSendCommandToMcu(pAd, 0x83, 0xff,
|
AsicSendCommandToMcu(pAd, 0x83, 0xff,
|
||||||
(UCHAR) PCIePowerSaveLevel,
|
(u8)PCIePowerSaveLevel,
|
||||||
LinkCtrlSetting);
|
LinkCtrlSetting);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -702,7 +702,7 @@ VOID RTMPInitPCIeLinkCtrlValue(IN PRTMP_ADAPTER pAd)
|
|||||||
|
|
||||||
RTMPFindHostPCIDev(pAd);
|
RTMPFindHostPCIDev(pAd);
|
||||||
if (pObj->parent_pci_dev) {
|
if (pObj->parent_pci_dev) {
|
||||||
USHORT vendor_id;
|
u16 vendor_id;
|
||||||
|
|
||||||
pci_read_config_word(pObj->parent_pci_dev,
|
pci_read_config_word(pObj->parent_pci_dev,
|
||||||
PCI_VENDOR_ID, &vendor_id);
|
PCI_VENDOR_ID, &vendor_id);
|
||||||
@ -810,11 +810,11 @@ VOID RTMPInitPCIeLinkCtrlValue(IN PRTMP_ADAPTER pAd)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID RTMPFindHostPCIDev(IN PRTMP_ADAPTER pAd)
|
void RTMPFindHostPCIDev(IN PRTMP_ADAPTER pAd)
|
||||||
{
|
{
|
||||||
USHORT reg16;
|
u16 reg16;
|
||||||
UCHAR reg8;
|
u8 reg8;
|
||||||
UINT DevFn;
|
u32 DevFn;
|
||||||
PPCI_DEV pPci_dev;
|
PPCI_DEV pPci_dev;
|
||||||
POS_COOKIE pObj;
|
POS_COOKIE pObj;
|
||||||
|
|
||||||
@ -856,10 +856,10 @@ VOID RTMPFindHostPCIDev(IN PRTMP_ADAPTER pAd)
|
|||||||
|
|
||||||
========================================================================
|
========================================================================
|
||||||
*/
|
*/
|
||||||
VOID RTMPPCIeLinkCtrlValueRestore(IN PRTMP_ADAPTER pAd, IN UCHAR Level)
|
void RTMPPCIeLinkCtrlValueRestore(IN PRTMP_ADAPTER pAd, u8 Level)
|
||||||
{
|
{
|
||||||
USHORT PCIePowerSaveLevel, reg16;
|
u16 PCIePowerSaveLevel, reg16;
|
||||||
USHORT Configuration;
|
u16 Configuration;
|
||||||
POS_COOKIE pObj;
|
POS_COOKIE pObj;
|
||||||
|
|
||||||
pObj = (POS_COOKIE) pAd->OS_Cookie;
|
pObj = (POS_COOKIE) pAd->OS_Cookie;
|
||||||
@ -950,10 +950,10 @@ VOID RTMPPCIeLinkCtrlValueRestore(IN PRTMP_ADAPTER pAd, IN UCHAR Level)
|
|||||||
|
|
||||||
========================================================================
|
========================================================================
|
||||||
*/
|
*/
|
||||||
VOID RTMPPCIeLinkCtrlSetting(IN PRTMP_ADAPTER pAd, IN USHORT Max)
|
void RTMPPCIeLinkCtrlSetting(IN PRTMP_ADAPTER pAd, u16 Max)
|
||||||
{
|
{
|
||||||
USHORT PCIePowerSaveLevel, reg16;
|
u16 PCIePowerSaveLevel, reg16;
|
||||||
USHORT Configuration;
|
u16 Configuration;
|
||||||
POS_COOKIE pObj;
|
POS_COOKIE pObj;
|
||||||
|
|
||||||
pObj = (POS_COOKIE) pAd->OS_Cookie;
|
pObj = (POS_COOKIE) pAd->OS_Cookie;
|
||||||
@ -1076,14 +1076,14 @@ VOID RTMPPCIeLinkCtrlSetting(IN PRTMP_ADAPTER pAd, IN USHORT Max)
|
|||||||
|
|
||||||
========================================================================
|
========================================================================
|
||||||
*/
|
*/
|
||||||
VOID RTMPrt3xSetPCIePowerLinkCtrl(IN PRTMP_ADAPTER pAd)
|
void RTMPrt3xSetPCIePowerLinkCtrl(IN PRTMP_ADAPTER pAd)
|
||||||
{
|
{
|
||||||
|
|
||||||
ULONG HostConfiguration = 0;
|
unsigned long HostConfiguration = 0;
|
||||||
ULONG Configuration;
|
unsigned long Configuration;
|
||||||
POS_COOKIE pObj;
|
POS_COOKIE pObj;
|
||||||
INT pos;
|
int pos;
|
||||||
USHORT reg16;
|
u16 reg16;
|
||||||
|
|
||||||
pObj = (POS_COOKIE) pAd->OS_Cookie;
|
pObj = (POS_COOKIE) pAd->OS_Cookie;
|
||||||
|
|
||||||
|
@ -28,7 +28,7 @@
|
|||||||
#include <linux/sched.h>
|
#include <linux/sched.h>
|
||||||
#include "rt_config.h"
|
#include "rt_config.h"
|
||||||
|
|
||||||
ULONG RTDebugLevel = RT_DEBUG_ERROR;
|
unsigned long RTDebugLevel = RT_DEBUG_ERROR;
|
||||||
|
|
||||||
/* for wireless system event message */
|
/* for wireless system event message */
|
||||||
char const *pWirelessSysEventText[IW_SYS_EVENT_TYPE_NUM] = {
|
char const *pWirelessSysEventText[IW_SYS_EVENT_TYPE_NUM] = {
|
||||||
@ -80,7 +80,7 @@ char const *pWirelessFloodEventText[IW_FLOOD_EVENT_TYPE_NUM] = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
/* timeout -- ms */
|
/* timeout -- ms */
|
||||||
VOID RTMP_SetPeriodicTimer(IN NDIS_MINIPORT_TIMER * pTimer,
|
void RTMP_SetPeriodicTimer(IN NDIS_MINIPORT_TIMER * pTimer,
|
||||||
IN unsigned long timeout)
|
IN unsigned long timeout)
|
||||||
{
|
{
|
||||||
timeout = ((timeout * OS_HZ) / 1000);
|
timeout = ((timeout * OS_HZ) / 1000);
|
||||||
@ -89,16 +89,16 @@ VOID RTMP_SetPeriodicTimer(IN NDIS_MINIPORT_TIMER * pTimer,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* convert NdisMInitializeTimer --> RTMP_OS_Init_Timer */
|
/* convert NdisMInitializeTimer --> RTMP_OS_Init_Timer */
|
||||||
VOID RTMP_OS_Init_Timer(IN PRTMP_ADAPTER pAd,
|
void RTMP_OS_Init_Timer(IN PRTMP_ADAPTER pAd,
|
||||||
IN NDIS_MINIPORT_TIMER * pTimer,
|
IN NDIS_MINIPORT_TIMER * pTimer,
|
||||||
IN TIMER_FUNCTION function, IN PVOID data)
|
IN TIMER_FUNCTION function, void *data)
|
||||||
{
|
{
|
||||||
init_timer(pTimer);
|
init_timer(pTimer);
|
||||||
pTimer->data = (unsigned long)data;
|
pTimer->data = (unsigned long)data;
|
||||||
pTimer->function = function;
|
pTimer->function = function;
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID RTMP_OS_Add_Timer(IN NDIS_MINIPORT_TIMER * pTimer,
|
void RTMP_OS_Add_Timer(IN NDIS_MINIPORT_TIMER * pTimer,
|
||||||
IN unsigned long timeout)
|
IN unsigned long timeout)
|
||||||
{
|
{
|
||||||
if (timer_pending(pTimer))
|
if (timer_pending(pTimer))
|
||||||
@ -109,14 +109,14 @@ VOID RTMP_OS_Add_Timer(IN NDIS_MINIPORT_TIMER * pTimer,
|
|||||||
add_timer(pTimer);
|
add_timer(pTimer);
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID RTMP_OS_Mod_Timer(IN NDIS_MINIPORT_TIMER * pTimer,
|
void RTMP_OS_Mod_Timer(IN NDIS_MINIPORT_TIMER * pTimer,
|
||||||
IN unsigned long timeout)
|
IN unsigned long timeout)
|
||||||
{
|
{
|
||||||
timeout = ((timeout * OS_HZ) / 1000);
|
timeout = ((timeout * OS_HZ) / 1000);
|
||||||
mod_timer(pTimer, jiffies + timeout);
|
mod_timer(pTimer, jiffies + timeout);
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID RTMP_OS_Del_Timer(IN NDIS_MINIPORT_TIMER * pTimer,
|
void RTMP_OS_Del_Timer(IN NDIS_MINIPORT_TIMER * pTimer,
|
||||||
OUT BOOLEAN * pCancelled)
|
OUT BOOLEAN * pCancelled)
|
||||||
{
|
{
|
||||||
if (timer_pending(pTimer)) {
|
if (timer_pending(pTimer)) {
|
||||||
@ -127,15 +127,15 @@ VOID RTMP_OS_Del_Timer(IN NDIS_MINIPORT_TIMER * pTimer,
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID RTMP_OS_Release_Packet(IN PRTMP_ADAPTER pAd, IN PQUEUE_ENTRY pEntry)
|
void RTMP_OS_Release_Packet(IN PRTMP_ADAPTER pAd, IN PQUEUE_ENTRY pEntry)
|
||||||
{
|
{
|
||||||
/*RTMPFreeNdisPacket(pAd, (struct sk_buff *)pEntry); */
|
/*RTMPFreeNdisPacket(pAd, (struct sk_buff *)pEntry); */
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Unify all delay routine by using udelay */
|
/* Unify all delay routine by using udelay */
|
||||||
VOID RTMPusecDelay(IN ULONG usec)
|
void RTMPusecDelay(unsigned long usec)
|
||||||
{
|
{
|
||||||
ULONG i;
|
unsigned long i;
|
||||||
|
|
||||||
for (i = 0; i < (usec / 50); i++)
|
for (i = 0; i < (usec / 50); i++)
|
||||||
udelay(50);
|
udelay(50);
|
||||||
@ -150,9 +150,9 @@ void RTMP_GetCurrentSystemTime(LARGE_INTEGER * time)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* pAd MUST allow to be NULL */
|
/* pAd MUST allow to be NULL */
|
||||||
NDIS_STATUS os_alloc_mem(IN RTMP_ADAPTER * pAd, OUT UCHAR ** mem, IN ULONG size)
|
int os_alloc_mem(IN RTMP_ADAPTER * pAd, u8 ** mem, unsigned long size)
|
||||||
{
|
{
|
||||||
*mem = (PUCHAR) kmalloc(size, GFP_ATOMIC);
|
*mem = (u8 *)kmalloc(size, GFP_ATOMIC);
|
||||||
if (*mem)
|
if (*mem)
|
||||||
return (NDIS_STATUS_SUCCESS);
|
return (NDIS_STATUS_SUCCESS);
|
||||||
else
|
else
|
||||||
@ -160,7 +160,7 @@ NDIS_STATUS os_alloc_mem(IN RTMP_ADAPTER * pAd, OUT UCHAR ** mem, IN ULONG size)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* pAd MUST allow to be NULL */
|
/* pAd MUST allow to be NULL */
|
||||||
NDIS_STATUS os_free_mem(IN PRTMP_ADAPTER pAd, IN PVOID mem)
|
int os_free_mem(IN PRTMP_ADAPTER pAd, void *mem)
|
||||||
{
|
{
|
||||||
|
|
||||||
ASSERT(mem);
|
ASSERT(mem);
|
||||||
@ -178,7 +178,7 @@ PNDIS_PACKET RtmpOSNetPktAlloc(IN RTMP_ADAPTER * pAd, IN int size)
|
|||||||
}
|
}
|
||||||
|
|
||||||
PNDIS_PACKET RTMP_AllocateFragPacketBuffer(IN PRTMP_ADAPTER pAd,
|
PNDIS_PACKET RTMP_AllocateFragPacketBuffer(IN PRTMP_ADAPTER pAd,
|
||||||
IN ULONG Length)
|
unsigned long Length)
|
||||||
{
|
{
|
||||||
struct sk_buff *pkt;
|
struct sk_buff *pkt;
|
||||||
|
|
||||||
@ -197,9 +197,9 @@ PNDIS_PACKET RTMP_AllocateFragPacketBuffer(IN PRTMP_ADAPTER pAd,
|
|||||||
}
|
}
|
||||||
|
|
||||||
PNDIS_PACKET RTMP_AllocateTxPacketBuffer(IN PRTMP_ADAPTER pAd,
|
PNDIS_PACKET RTMP_AllocateTxPacketBuffer(IN PRTMP_ADAPTER pAd,
|
||||||
IN ULONG Length,
|
unsigned long Length,
|
||||||
IN BOOLEAN Cached,
|
IN BOOLEAN Cached,
|
||||||
OUT PVOID * VirtualAddress)
|
void ** VirtualAddress)
|
||||||
{
|
{
|
||||||
struct sk_buff *pkt;
|
struct sk_buff *pkt;
|
||||||
|
|
||||||
@ -212,17 +212,17 @@ PNDIS_PACKET RTMP_AllocateTxPacketBuffer(IN PRTMP_ADAPTER pAd,
|
|||||||
|
|
||||||
if (pkt) {
|
if (pkt) {
|
||||||
RTMP_SET_PACKET_SOURCE(OSPKT_TO_RTPKT(pkt), PKTSRC_NDIS);
|
RTMP_SET_PACKET_SOURCE(OSPKT_TO_RTPKT(pkt), PKTSRC_NDIS);
|
||||||
*VirtualAddress = (PVOID) pkt->data;
|
*VirtualAddress = (void *)pkt->data;
|
||||||
} else {
|
} else {
|
||||||
*VirtualAddress = (PVOID) NULL;
|
*VirtualAddress = (void *)NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
return (PNDIS_PACKET) pkt;
|
return (PNDIS_PACKET) pkt;
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID build_tx_packet(IN PRTMP_ADAPTER pAd,
|
void build_tx_packet(IN PRTMP_ADAPTER pAd,
|
||||||
IN PNDIS_PACKET pPacket,
|
IN PNDIS_PACKET pPacket,
|
||||||
IN PUCHAR pFrame, IN ULONG FrameLen)
|
u8 *pFrame, unsigned long FrameLen)
|
||||||
{
|
{
|
||||||
|
|
||||||
struct sk_buff *pTxPkt;
|
struct sk_buff *pTxPkt;
|
||||||
@ -233,7 +233,7 @@ VOID build_tx_packet(IN PRTMP_ADAPTER pAd,
|
|||||||
NdisMoveMemory(skb_put(pTxPkt, FrameLen), pFrame, FrameLen);
|
NdisMoveMemory(skb_put(pTxPkt, FrameLen), pFrame, FrameLen);
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID RTMPFreeAdapter(IN PRTMP_ADAPTER pAd)
|
void RTMPFreeAdapter(IN PRTMP_ADAPTER pAd)
|
||||||
{
|
{
|
||||||
POS_COOKIE os_cookie;
|
POS_COOKIE os_cookie;
|
||||||
int index;
|
int index;
|
||||||
@ -292,7 +292,7 @@ BOOLEAN OS_Need_Clone_Packet(void)
|
|||||||
|
|
||||||
========================================================================
|
========================================================================
|
||||||
*/
|
*/
|
||||||
NDIS_STATUS RTMPCloneNdisPacket(IN PRTMP_ADAPTER pAd,
|
int RTMPCloneNdisPacket(IN PRTMP_ADAPTER pAd,
|
||||||
IN BOOLEAN pInsAMSDUHdr,
|
IN BOOLEAN pInsAMSDUHdr,
|
||||||
IN PNDIS_PACKET pInPacket,
|
IN PNDIS_PACKET pInPacket,
|
||||||
OUT PNDIS_PACKET * ppOutPacket)
|
OUT PNDIS_PACKET * ppOutPacket)
|
||||||
@ -323,11 +323,11 @@ NDIS_STATUS RTMPCloneNdisPacket(IN PRTMP_ADAPTER pAd,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* the allocated NDIS PACKET must be freed via RTMPFreeNdisPacket() */
|
/* the allocated NDIS PACKET must be freed via RTMPFreeNdisPacket() */
|
||||||
NDIS_STATUS RTMPAllocateNdisPacket(IN PRTMP_ADAPTER pAd,
|
int RTMPAllocateNdisPacket(IN PRTMP_ADAPTER pAd,
|
||||||
OUT PNDIS_PACKET * ppPacket,
|
OUT PNDIS_PACKET * ppPacket,
|
||||||
IN PUCHAR pHeader,
|
u8 *pHeader,
|
||||||
IN UINT HeaderLen,
|
u32 HeaderLen,
|
||||||
IN PUCHAR pData, IN UINT DataLen)
|
u8 *pData, u32 DataLen)
|
||||||
{
|
{
|
||||||
PNDIS_PACKET pPacket;
|
PNDIS_PACKET pPacket;
|
||||||
ASSERT(pData);
|
ASSERT(pData);
|
||||||
@ -367,7 +367,7 @@ NDIS_STATUS RTMPAllocateNdisPacket(IN PRTMP_ADAPTER pAd,
|
|||||||
corresponding NDIS_BUFFER and allocated memory.
|
corresponding NDIS_BUFFER and allocated memory.
|
||||||
========================================================================
|
========================================================================
|
||||||
*/
|
*/
|
||||||
VOID RTMPFreeNdisPacket(IN PRTMP_ADAPTER pAd, IN PNDIS_PACKET pPacket)
|
void RTMPFreeNdisPacket(IN PRTMP_ADAPTER pAd, IN PNDIS_PACKET pPacket)
|
||||||
{
|
{
|
||||||
dev_kfree_skb_any(RTPKT_TO_OSPKT(pPacket));
|
dev_kfree_skb_any(RTPKT_TO_OSPKT(pPacket));
|
||||||
}
|
}
|
||||||
@ -375,19 +375,19 @@ VOID RTMPFreeNdisPacket(IN PRTMP_ADAPTER pAd, IN PNDIS_PACKET pPacket)
|
|||||||
/* IRQL = DISPATCH_LEVEL */
|
/* IRQL = DISPATCH_LEVEL */
|
||||||
/* NOTE: we do have an assumption here, that Byte0 and Byte1 always reasid at the same */
|
/* NOTE: we do have an assumption here, that Byte0 and Byte1 always reasid at the same */
|
||||||
/* scatter gather buffer */
|
/* scatter gather buffer */
|
||||||
NDIS_STATUS Sniff2BytesFromNdisBuffer(IN PNDIS_BUFFER pFirstBuffer,
|
int Sniff2BytesFromNdisBuffer(IN PNDIS_BUFFER pFirstBuffer,
|
||||||
IN UCHAR DesiredOffset,
|
u8 DesiredOffset,
|
||||||
OUT PUCHAR pByte0, OUT PUCHAR pByte1)
|
u8 *pByte0, u8 *pByte1)
|
||||||
{
|
{
|
||||||
*pByte0 = *(PUCHAR) (pFirstBuffer + DesiredOffset);
|
*pByte0 = *(u8 *)(pFirstBuffer + DesiredOffset);
|
||||||
*pByte1 = *(PUCHAR) (pFirstBuffer + DesiredOffset + 1);
|
*pByte1 = *(u8 *)(pFirstBuffer + DesiredOffset + 1);
|
||||||
|
|
||||||
return NDIS_STATUS_SUCCESS;
|
return NDIS_STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
void RTMP_QueryPacketInfo(IN PNDIS_PACKET pPacket,
|
void RTMP_QueryPacketInfo(IN PNDIS_PACKET pPacket,
|
||||||
OUT PACKET_INFO * pPacketInfo,
|
OUT PACKET_INFO * pPacketInfo,
|
||||||
OUT PUCHAR * pSrcBufVA, OUT UINT * pSrcBufLen)
|
u8 ** pSrcBufVA, u32 * pSrcBufLen)
|
||||||
{
|
{
|
||||||
pPacketInfo->BufferCount = 1;
|
pPacketInfo->BufferCount = 1;
|
||||||
pPacketInfo->pFirstBuffer = (PNDIS_BUFFER) GET_OS_PKT_DATAPTR(pPacket);
|
pPacketInfo->pFirstBuffer = (PNDIS_BUFFER) GET_OS_PKT_DATAPTR(pPacket);
|
||||||
@ -400,7 +400,7 @@ void RTMP_QueryPacketInfo(IN PNDIS_PACKET pPacket,
|
|||||||
|
|
||||||
void RTMP_QueryNextPacketInfo(IN PNDIS_PACKET * ppPacket,
|
void RTMP_QueryNextPacketInfo(IN PNDIS_PACKET * ppPacket,
|
||||||
OUT PACKET_INFO * pPacketInfo,
|
OUT PACKET_INFO * pPacketInfo,
|
||||||
OUT PUCHAR * pSrcBufVA, OUT UINT * pSrcBufLen)
|
u8 ** pSrcBufVA, u32 * pSrcBufLen)
|
||||||
{
|
{
|
||||||
PNDIS_PACKET pPacket = NULL;
|
PNDIS_PACKET pPacket = NULL;
|
||||||
|
|
||||||
@ -430,15 +430,15 @@ void RTMP_QueryNextPacketInfo(IN PNDIS_PACKET * ppPacket,
|
|||||||
}
|
}
|
||||||
|
|
||||||
PNDIS_PACKET DuplicatePacket(IN PRTMP_ADAPTER pAd,
|
PNDIS_PACKET DuplicatePacket(IN PRTMP_ADAPTER pAd,
|
||||||
IN PNDIS_PACKET pPacket, IN UCHAR FromWhichBSSID)
|
IN PNDIS_PACKET pPacket, u8 FromWhichBSSID)
|
||||||
{
|
{
|
||||||
struct sk_buff *skb;
|
struct sk_buff *skb;
|
||||||
PNDIS_PACKET pRetPacket = NULL;
|
PNDIS_PACKET pRetPacket = NULL;
|
||||||
USHORT DataSize;
|
u16 DataSize;
|
||||||
UCHAR *pData;
|
u8 *pData;
|
||||||
|
|
||||||
DataSize = (USHORT) GET_OS_PKT_LEN(pPacket);
|
DataSize = (u16)GET_OS_PKT_LEN(pPacket);
|
||||||
pData = (PUCHAR) GET_OS_PKT_DATAPTR(pPacket);
|
pData = (u8 *)GET_OS_PKT_DATAPTR(pPacket);
|
||||||
|
|
||||||
skb = skb_clone(RTPKT_TO_OSPKT(pPacket), MEM_ALLOC_FLAG);
|
skb = skb_clone(RTPKT_TO_OSPKT(pPacket), MEM_ALLOC_FLAG);
|
||||||
if (skb) {
|
if (skb) {
|
||||||
@ -451,10 +451,10 @@ PNDIS_PACKET DuplicatePacket(IN PRTMP_ADAPTER pAd,
|
|||||||
}
|
}
|
||||||
|
|
||||||
PNDIS_PACKET duplicate_pkt(IN PRTMP_ADAPTER pAd,
|
PNDIS_PACKET duplicate_pkt(IN PRTMP_ADAPTER pAd,
|
||||||
IN PUCHAR pHeader802_3,
|
u8 *pHeader802_3,
|
||||||
IN UINT HdrLen,
|
u32 HdrLen,
|
||||||
IN PUCHAR pData,
|
u8 *pData,
|
||||||
IN ULONG DataSize, IN UCHAR FromWhichBSSID)
|
unsigned long DataSize, u8 FromWhichBSSID)
|
||||||
{
|
{
|
||||||
struct sk_buff *skb;
|
struct sk_buff *skb;
|
||||||
PNDIS_PACKET pPacket = NULL;
|
PNDIS_PACKET pPacket = NULL;
|
||||||
@ -499,7 +499,7 @@ PNDIS_PACKET duplicate_pkt_with_TKIP_MIC(IN PRTMP_ADAPTER pAd,
|
|||||||
|
|
||||||
PNDIS_PACKET ClonePacket(IN PRTMP_ADAPTER pAd,
|
PNDIS_PACKET ClonePacket(IN PRTMP_ADAPTER pAd,
|
||||||
IN PNDIS_PACKET pPacket,
|
IN PNDIS_PACKET pPacket,
|
||||||
IN PUCHAR pData, IN ULONG DataSize)
|
u8 *pData, unsigned long DataSize)
|
||||||
{
|
{
|
||||||
struct sk_buff *pRxPkt;
|
struct sk_buff *pRxPkt;
|
||||||
struct sk_buff *pClonedPkt;
|
struct sk_buff *pClonedPkt;
|
||||||
@ -525,7 +525,7 @@ PNDIS_PACKET ClonePacket(IN PRTMP_ADAPTER pAd,
|
|||||||
/* change OS packet DataPtr and DataLen */
|
/* change OS packet DataPtr and DataLen */
|
||||||
/* */
|
/* */
|
||||||
void update_os_packet_info(IN PRTMP_ADAPTER pAd,
|
void update_os_packet_info(IN PRTMP_ADAPTER pAd,
|
||||||
IN RX_BLK * pRxBlk, IN UCHAR FromWhichBSSID)
|
IN RX_BLK * pRxBlk, u8 FromWhichBSSID)
|
||||||
{
|
{
|
||||||
struct sk_buff *pOSPkt;
|
struct sk_buff *pOSPkt;
|
||||||
|
|
||||||
@ -540,8 +540,8 @@ void update_os_packet_info(IN PRTMP_ADAPTER pAd,
|
|||||||
|
|
||||||
void wlan_802_11_to_802_3_packet(IN PRTMP_ADAPTER pAd,
|
void wlan_802_11_to_802_3_packet(IN PRTMP_ADAPTER pAd,
|
||||||
IN RX_BLK * pRxBlk,
|
IN RX_BLK * pRxBlk,
|
||||||
IN PUCHAR pHeader802_3,
|
u8 *pHeader802_3,
|
||||||
IN UCHAR FromWhichBSSID)
|
u8 FromWhichBSSID)
|
||||||
{
|
{
|
||||||
struct sk_buff *pOSPkt;
|
struct sk_buff *pOSPkt;
|
||||||
|
|
||||||
@ -628,15 +628,15 @@ void hex_dump(char *str, unsigned char *pSrcBufVA, unsigned int SrcBufLen)
|
|||||||
|
|
||||||
========================================================================
|
========================================================================
|
||||||
*/
|
*/
|
||||||
VOID RTMPSendWirelessEvent(IN PRTMP_ADAPTER pAd,
|
void RTMPSendWirelessEvent(IN PRTMP_ADAPTER pAd,
|
||||||
IN USHORT Event_flag,
|
u16 Event_flag,
|
||||||
IN PUCHAR pAddr, IN UCHAR BssIdx, IN CHAR Rssi)
|
u8 *pAddr, u8 BssIdx, char Rssi)
|
||||||
{
|
{
|
||||||
|
|
||||||
/*union iwreq_data wrqu; */
|
/*union iwreq_data wrqu; */
|
||||||
PSTRING pBuf = NULL, pBufPtr = NULL;
|
char *pBuf = NULL, *pBufPtr = NULL;
|
||||||
USHORT event, type, BufLen;
|
u16 event, type, BufLen;
|
||||||
UCHAR event_table_len = 0;
|
u8 event_table_len = 0;
|
||||||
|
|
||||||
type = Event_flag & 0xFF00;
|
type = Event_flag & 0xFF00;
|
||||||
event = Event_flag & 0x00FF;
|
event = Event_flag & 0x00FF;
|
||||||
@ -705,7 +705,7 @@ VOID RTMPSendWirelessEvent(IN PRTMP_ADAPTER pAd,
|
|||||||
BufLen = pBufPtr - pBuf;
|
BufLen = pBufPtr - pBuf;
|
||||||
|
|
||||||
RtmpOSWrielessEventSend(pAd, IWEVCUSTOM, Event_flag, NULL,
|
RtmpOSWrielessEventSend(pAd, IWEVCUSTOM, Event_flag, NULL,
|
||||||
(PUCHAR) pBuf, BufLen);
|
(u8 *)pBuf, BufLen);
|
||||||
/*DBGPRINT(RT_DEBUG_TRACE, ("%s : %s\n", __func__, pBuf)); */
|
/*DBGPRINT(RT_DEBUG_TRACE, ("%s : %s\n", __func__, pBuf)); */
|
||||||
|
|
||||||
kfree(pBuf);
|
kfree(pBuf);
|
||||||
@ -720,8 +720,8 @@ void send_monitor_packets(IN PRTMP_ADAPTER pAd, IN RX_BLK * pRxBlk)
|
|||||||
struct sk_buff *pOSPkt;
|
struct sk_buff *pOSPkt;
|
||||||
wlan_ng_prism2_header *ph;
|
wlan_ng_prism2_header *ph;
|
||||||
int rate_index = 0;
|
int rate_index = 0;
|
||||||
USHORT header_len = 0;
|
u16 header_len = 0;
|
||||||
UCHAR temp_header[40] = { 0 };
|
u8 temp_header[40] = { 0 };
|
||||||
|
|
||||||
u_int32_t ralinkrate[256] = { 2, 4, 11, 22, 12, 18, 24, 36, 48, 72, 96, 108, 109, 110, 111, 112, 13, 26, 39, 52, 78, 104, 117, 130, 26, 52, 78, 104, 156, 208, 234, 260, 27, 54, 81, 108, 162, 216, 243, 270, /* Last 38 */
|
u_int32_t ralinkrate[256] = { 2, 4, 11, 22, 12, 18, 24, 36, 48, 72, 96, 108, 109, 110, 111, 112, 13, 26, 39, 52, 78, 104, 117, 130, 26, 52, 78, 104, 156, 208, 234, 260, 27, 54, 81, 108, 162, 216, 243, 270, /* Last 38 */
|
||||||
54, 108, 162, 216, 324, 432, 486, 540, 14, 29, 43, 57, 87, 115,
|
54, 108, 162, 216, 324, 432, 486, 540, 14, 29, 43, 57, 87, 115,
|
||||||
@ -816,7 +816,7 @@ void send_monitor_packets(IN PRTMP_ADAPTER pAd, IN RX_BLK * pRxBlk)
|
|||||||
|
|
||||||
ph->msgcode = DIDmsg_lnxind_wlansniffrm;
|
ph->msgcode = DIDmsg_lnxind_wlansniffrm;
|
||||||
ph->msglen = sizeof(wlan_ng_prism2_header);
|
ph->msglen = sizeof(wlan_ng_prism2_header);
|
||||||
strcpy((PSTRING) ph->devname, (PSTRING) pAd->net_dev->name);
|
strcpy((char *)ph->devname, (char *)pAd->net_dev->name);
|
||||||
|
|
||||||
ph->hosttime.did = DIDmsg_lnxind_wlansniffrm_hosttime;
|
ph->hosttime.did = DIDmsg_lnxind_wlansniffrm_hosttime;
|
||||||
ph->hosttime.status = 0;
|
ph->hosttime.status = 0;
|
||||||
@ -865,13 +865,13 @@ void send_monitor_packets(IN PRTMP_ADAPTER pAd, IN RX_BLK * pRxBlk)
|
|||||||
|
|
||||||
if (pRxBlk->pRxWI->PHYMODE >= MODE_HTMIX) {
|
if (pRxBlk->pRxWI->PHYMODE >= MODE_HTMIX) {
|
||||||
rate_index =
|
rate_index =
|
||||||
16 + ((UCHAR) pRxBlk->pRxWI->BW * 16) +
|
16 + ((u8)pRxBlk->pRxWI->BW * 16) +
|
||||||
((UCHAR) pRxBlk->pRxWI->ShortGI * 32) +
|
((u8)pRxBlk->pRxWI->ShortGI * 32) +
|
||||||
((UCHAR) pRxBlk->pRxWI->MCS);
|
((u8)pRxBlk->pRxWI->MCS);
|
||||||
} else if (pRxBlk->pRxWI->PHYMODE == MODE_OFDM)
|
} else if (pRxBlk->pRxWI->PHYMODE == MODE_OFDM)
|
||||||
rate_index = (UCHAR) (pRxBlk->pRxWI->MCS) + 4;
|
rate_index = (u8)(pRxBlk->pRxWI->MCS) + 4;
|
||||||
else
|
else
|
||||||
rate_index = (UCHAR) (pRxBlk->pRxWI->MCS);
|
rate_index = (u8)(pRxBlk->pRxWI->MCS);
|
||||||
if (rate_index < 0)
|
if (rate_index < 0)
|
||||||
rate_index = 0;
|
rate_index = 0;
|
||||||
if (rate_index > 255)
|
if (rate_index > 255)
|
||||||
@ -1005,7 +1005,7 @@ int RtmpOSFileWrite(RTMP_OS_FD osfd, char *pDataPtr, int writeLen)
|
|||||||
Task create/management/kill related functions.
|
Task create/management/kill related functions.
|
||||||
|
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
NDIS_STATUS RtmpOSTaskKill(IN RTMP_OS_TASK * pTask)
|
int RtmpOSTaskKill(IN RTMP_OS_TASK * pTask)
|
||||||
{
|
{
|
||||||
RTMP_ADAPTER *pAd;
|
RTMP_ADAPTER *pAd;
|
||||||
int ret = NDIS_STATUS_FAILURE;
|
int ret = NDIS_STATUS_FAILURE;
|
||||||
@ -1043,7 +1043,7 @@ NDIS_STATUS RtmpOSTaskKill(IN RTMP_OS_TASK * pTask)
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
INT RtmpOSTaskNotifyToExit(IN RTMP_OS_TASK * pTask)
|
int RtmpOSTaskNotifyToExit(IN RTMP_OS_TASK * pTask)
|
||||||
{
|
{
|
||||||
|
|
||||||
#ifndef KTHREAD_SUPPORT
|
#ifndef KTHREAD_SUPPORT
|
||||||
@ -1058,7 +1058,7 @@ void RtmpOSTaskCustomize(IN RTMP_OS_TASK * pTask)
|
|||||||
|
|
||||||
#ifndef KTHREAD_SUPPORT
|
#ifndef KTHREAD_SUPPORT
|
||||||
|
|
||||||
daemonize((PSTRING) & pTask->taskName[0] /*"%s",pAd->net_dev->name */ );
|
daemonize((char *)& pTask->taskName[0] /*"%s",pAd->net_dev->name */ );
|
||||||
|
|
||||||
allow_signal(SIGTERM);
|
allow_signal(SIGTERM);
|
||||||
allow_signal(SIGKILL);
|
allow_signal(SIGKILL);
|
||||||
@ -1070,10 +1070,10 @@ void RtmpOSTaskCustomize(IN RTMP_OS_TASK * pTask)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
NDIS_STATUS RtmpOSTaskAttach(IN RTMP_OS_TASK * pTask,
|
int RtmpOSTaskAttach(IN RTMP_OS_TASK * pTask,
|
||||||
IN int (*fn) (void *), IN void *arg)
|
IN int (*fn) (void *), IN void *arg)
|
||||||
{
|
{
|
||||||
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
|
int status = NDIS_STATUS_SUCCESS;
|
||||||
|
|
||||||
#ifdef KTHREAD_SUPPORT
|
#ifdef KTHREAD_SUPPORT
|
||||||
pTask->task_killed = 0;
|
pTask->task_killed = 0;
|
||||||
@ -1098,15 +1098,15 @@ NDIS_STATUS RtmpOSTaskAttach(IN RTMP_OS_TASK * pTask,
|
|||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
NDIS_STATUS RtmpOSTaskInit(IN RTMP_OS_TASK * pTask,
|
int RtmpOSTaskInit(IN RTMP_OS_TASK * pTask,
|
||||||
IN PSTRING pTaskName, IN VOID * pPriv)
|
char *pTaskName, void * pPriv)
|
||||||
{
|
{
|
||||||
int len;
|
int len;
|
||||||
|
|
||||||
ASSERT(pTask);
|
ASSERT(pTask);
|
||||||
|
|
||||||
#ifndef KTHREAD_SUPPORT
|
#ifndef KTHREAD_SUPPORT
|
||||||
NdisZeroMemory((PUCHAR) (pTask), sizeof(RTMP_OS_TASK));
|
NdisZeroMemory((u8 *)(pTask), sizeof(RTMP_OS_TASK));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
len = strlen(pTaskName);
|
len = strlen(pTaskName);
|
||||||
@ -1142,10 +1142,10 @@ void RTMP_IndicateMediaState(IN PRTMP_ADAPTER pAd)
|
|||||||
}
|
}
|
||||||
|
|
||||||
int RtmpOSWrielessEventSend(IN RTMP_ADAPTER * pAd,
|
int RtmpOSWrielessEventSend(IN RTMP_ADAPTER * pAd,
|
||||||
IN UINT32 eventType,
|
u32 eventType,
|
||||||
IN INT flags,
|
int flags,
|
||||||
IN PUCHAR pSrcMac,
|
u8 *pSrcMac,
|
||||||
IN PUCHAR pData, IN UINT32 dataLen)
|
u8 *pData, u32 dataLen)
|
||||||
{
|
{
|
||||||
union iwreq_data wrqu;
|
union iwreq_data wrqu;
|
||||||
|
|
||||||
@ -1164,7 +1164,7 @@ int RtmpOSWrielessEventSend(IN RTMP_ADAPTER * pAd,
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int RtmpOSNetDevAddrSet(IN PNET_DEV pNetDev, IN PUCHAR pMacAddr)
|
int RtmpOSNetDevAddrSet(IN PNET_DEV pNetDev, u8 *pMacAddr)
|
||||||
{
|
{
|
||||||
struct net_device *net_dev;
|
struct net_device *net_dev;
|
||||||
RTMP_ADAPTER *pAd;
|
RTMP_ADAPTER *pAd;
|
||||||
@ -1189,11 +1189,11 @@ int RtmpOSNetDevAddrSet(IN PNET_DEV pNetDev, IN PUCHAR pMacAddr)
|
|||||||
*/
|
*/
|
||||||
static int RtmpOSNetDevRequestName(IN RTMP_ADAPTER * pAd,
|
static int RtmpOSNetDevRequestName(IN RTMP_ADAPTER * pAd,
|
||||||
IN PNET_DEV dev,
|
IN PNET_DEV dev,
|
||||||
IN PSTRING pPrefixStr, IN INT devIdx)
|
char *pPrefixStr, int devIdx)
|
||||||
{
|
{
|
||||||
PNET_DEV existNetDev;
|
PNET_DEV existNetDev;
|
||||||
STRING suffixName[IFNAMSIZ];
|
char suffixName[IFNAMSIZ];
|
||||||
STRING desiredName[IFNAMSIZ];
|
char desiredName[IFNAMSIZ];
|
||||||
int ifNameIdx, prefixLen, slotNameLen;
|
int ifNameIdx, prefixLen, slotNameLen;
|
||||||
int Status;
|
int Status;
|
||||||
|
|
||||||
@ -1243,7 +1243,7 @@ void RtmpOSNetDevFree(PNET_DEV pNetDev)
|
|||||||
free_netdev(pNetDev);
|
free_netdev(pNetDev);
|
||||||
}
|
}
|
||||||
|
|
||||||
INT RtmpOSNetDevAlloc(IN PNET_DEV * new_dev_p, IN UINT32 privDataSize)
|
int RtmpOSNetDevAlloc(IN PNET_DEV * new_dev_p, u32 privDataSize)
|
||||||
{
|
{
|
||||||
/* assign it as null first. */
|
/* assign it as null first. */
|
||||||
*new_dev_p = NULL;
|
*new_dev_p = NULL;
|
||||||
@ -1258,7 +1258,7 @@ INT RtmpOSNetDevAlloc(IN PNET_DEV * new_dev_p, IN UINT32 privDataSize)
|
|||||||
return NDIS_STATUS_FAILURE;
|
return NDIS_STATUS_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
PNET_DEV RtmpOSNetDevGetByName(PNET_DEV pNetDev, PSTRING pDevName)
|
PNET_DEV RtmpOSNetDevGetByName(PNET_DEV pNetDev, char *pDevName)
|
||||||
{
|
{
|
||||||
PNET_DEV pTargetNetDev = NULL;
|
PNET_DEV pTargetNetDev = NULL;
|
||||||
|
|
||||||
@ -1278,7 +1278,7 @@ void RtmpOSNetDeviceRefPut(PNET_DEV pNetDev)
|
|||||||
dev_put(pNetDev);
|
dev_put(pNetDev);
|
||||||
}
|
}
|
||||||
|
|
||||||
INT RtmpOSNetDevDestory(IN RTMP_ADAPTER * pAd, IN PNET_DEV pNetDev)
|
int RtmpOSNetDevDestory(IN RTMP_ADAPTER * pAd, IN PNET_DEV pNetDev)
|
||||||
{
|
{
|
||||||
|
|
||||||
/* TODO: Need to fix this */
|
/* TODO: Need to fix this */
|
||||||
@ -1332,9 +1332,9 @@ int RtmpOSNetDevAttach(IN PNET_DEV pNetDev,
|
|||||||
}
|
}
|
||||||
|
|
||||||
PNET_DEV RtmpOSNetDevCreate(IN RTMP_ADAPTER * pAd,
|
PNET_DEV RtmpOSNetDevCreate(IN RTMP_ADAPTER * pAd,
|
||||||
IN INT devType,
|
int devType,
|
||||||
IN INT devNum,
|
int devNum,
|
||||||
IN INT privMemSize, IN PSTRING pNamePrefix)
|
int privMemSize, char *pNamePrefix)
|
||||||
{
|
{
|
||||||
struct net_device *pNetDev = NULL;
|
struct net_device *pNetDev = NULL;
|
||||||
int status;
|
int status;
|
||||||
|
@ -99,7 +99,6 @@ extern const struct iw_handler_def rt28xx_iw_handler_def;
|
|||||||
#define IN
|
#define IN
|
||||||
#define OUT
|
#define OUT
|
||||||
#define INOUT
|
#define INOUT
|
||||||
#define NDIS_STATUS INT
|
|
||||||
|
|
||||||
/***********************************************************************************
|
/***********************************************************************************
|
||||||
* OS Specific definitions and data structures
|
* OS Specific definitions and data structures
|
||||||
@ -390,7 +389,7 @@ typedef void (*TIMER_FUNCTION) (unsigned long);
|
|||||||
|
|
||||||
#define ONE_TICK 1
|
#define ONE_TICK 1
|
||||||
|
|
||||||
static inline void NdisGetSystemUpTime(ULONG * time)
|
static inline void NdisGetSystemUpTime(unsigned long * time)
|
||||||
{
|
{
|
||||||
*time = jiffies;
|
*time = jiffies;
|
||||||
}
|
}
|
||||||
@ -403,7 +402,7 @@ struct os_cookie {
|
|||||||
#ifdef RTMP_MAC_PCI
|
#ifdef RTMP_MAC_PCI
|
||||||
struct pci_dev *pci_dev;
|
struct pci_dev *pci_dev;
|
||||||
struct pci_dev *parent_pci_dev;
|
struct pci_dev *parent_pci_dev;
|
||||||
USHORT DeviceID;
|
u16 DeviceID;
|
||||||
dma_addr_t pAd_pa;
|
dma_addr_t pAd_pa;
|
||||||
#endif /* RTMP_MAC_PCI // */
|
#endif /* RTMP_MAC_PCI // */
|
||||||
#ifdef RTMP_MAC_USB
|
#ifdef RTMP_MAC_USB
|
||||||
@ -427,8 +426,8 @@ struct os_cookie {
|
|||||||
#endif /* RTMP_MAC_USB // */
|
#endif /* RTMP_MAC_USB // */
|
||||||
|
|
||||||
unsigned long apd_pid; /*802.1x daemon pid */
|
unsigned long apd_pid; /*802.1x daemon pid */
|
||||||
INT ioctl_if_type;
|
int ioctl_if_type;
|
||||||
INT ioctl_if;
|
int ioctl_if;
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef struct os_cookie *POS_COOKIE;
|
typedef struct os_cookie *POS_COOKIE;
|
||||||
@ -440,7 +439,7 @@ typedef struct os_cookie *POS_COOKIE;
|
|||||||
addr[0], addr[1], addr[2], addr[3], addr[4], addr[5]
|
addr[0], addr[1], addr[2], addr[3], addr[4], addr[5]
|
||||||
|
|
||||||
#ifdef DBG
|
#ifdef DBG
|
||||||
extern ULONG RTDebugLevel;
|
extern unsigned long RTDebugLevel;
|
||||||
|
|
||||||
#define DBGPRINT_RAW(Level, Fmt) \
|
#define DBGPRINT_RAW(Level, Fmt) \
|
||||||
do{ \
|
do{ \
|
||||||
@ -503,39 +502,39 @@ void linux_pci_unmap_single(void *handle, dma_addr_t dma_addr, size_t size,
|
|||||||
dev_alloc_skb(_length)
|
dev_alloc_skb(_length)
|
||||||
#endif /* RTMP_MAC_PCI // */
|
#endif /* RTMP_MAC_PCI // */
|
||||||
#ifdef RTMP_MAC_USB
|
#ifdef RTMP_MAC_USB
|
||||||
#define PCI_MAP_SINGLE(_handle, _ptr, _size, _dir) (ULONG)0
|
#define PCI_MAP_SINGLE(_handle, _ptr, _size, _dir) (unsigned long)0
|
||||||
|
|
||||||
#define PCI_UNMAP_SINGLE(_handle, _ptr, _size, _dir)
|
#define PCI_UNMAP_SINGLE(_handle, _ptr, _size, _dir)
|
||||||
#endif /* RTMP_MAC_USB // */
|
#endif /* RTMP_MAC_USB // */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* ULONG
|
* unsigned long
|
||||||
* RTMP_GetPhysicalAddressLow(
|
* RTMP_GetPhysicalAddressLow(
|
||||||
* IN NDIS_PHYSICAL_ADDRESS PhysicalAddress);
|
* IN NDIS_PHYSICAL_ADDRESS PhysicalAddress);
|
||||||
*/
|
*/
|
||||||
#define RTMP_GetPhysicalAddressLow(PhysicalAddress) (PhysicalAddress)
|
#define RTMP_GetPhysicalAddressLow(PhysicalAddress) (PhysicalAddress)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* ULONG
|
* unsigned long
|
||||||
* RTMP_GetPhysicalAddressHigh(
|
* RTMP_GetPhysicalAddressHigh(
|
||||||
* IN NDIS_PHYSICAL_ADDRESS PhysicalAddress);
|
* IN NDIS_PHYSICAL_ADDRESS PhysicalAddress);
|
||||||
*/
|
*/
|
||||||
#define RTMP_GetPhysicalAddressHigh(PhysicalAddress) (0)
|
#define RTMP_GetPhysicalAddressHigh(PhysicalAddress) (0)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* VOID
|
* void
|
||||||
* RTMP_SetPhysicalAddressLow(
|
* RTMP_SetPhysicalAddressLow(
|
||||||
* IN NDIS_PHYSICAL_ADDRESS PhysicalAddress,
|
* IN NDIS_PHYSICAL_ADDRESS PhysicalAddress,
|
||||||
* IN ULONG Value);
|
* unsigned long Value);
|
||||||
*/
|
*/
|
||||||
#define RTMP_SetPhysicalAddressLow(PhysicalAddress, Value) \
|
#define RTMP_SetPhysicalAddressLow(PhysicalAddress, Value) \
|
||||||
PhysicalAddress = Value;
|
PhysicalAddress = Value;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* VOID
|
* void
|
||||||
* RTMP_SetPhysicalAddressHigh(
|
* RTMP_SetPhysicalAddressHigh(
|
||||||
* IN NDIS_PHYSICAL_ADDRESS PhysicalAddress,
|
* IN NDIS_PHYSICAL_ADDRESS PhysicalAddress,
|
||||||
* IN ULONG Value);
|
* unsigned long Value);
|
||||||
*/
|
*/
|
||||||
#define RTMP_SetPhysicalAddressHigh(PhysicalAddress, Value)
|
#define RTMP_SetPhysicalAddressHigh(PhysicalAddress, Value)
|
||||||
|
|
||||||
@ -572,7 +571,7 @@ void linux_pci_unmap_single(void *handle, dma_addr_t dma_addr, size_t size,
|
|||||||
{ \
|
{ \
|
||||||
if ((_A)->bPCIclkOff == FALSE) \
|
if ((_A)->bPCIclkOff == FALSE) \
|
||||||
{ \
|
{ \
|
||||||
UINT Val; \
|
u32 Val; \
|
||||||
Val = readl((void *)((_A)->CSRBaseAddress + MAC_CSR0)); \
|
Val = readl((void *)((_A)->CSRBaseAddress + MAC_CSR0)); \
|
||||||
writel((_V), (void *)((_A)->CSRBaseAddress + (_R))); \
|
writel((_V), (void *)((_A)->CSRBaseAddress + (_R))); \
|
||||||
} \
|
} \
|
||||||
@ -580,7 +579,7 @@ void linux_pci_unmap_single(void *handle, dma_addr_t dma_addr, size_t size,
|
|||||||
|
|
||||||
#define RTMP_IO_FORCE_WRITE32(_A, _R, _V) \
|
#define RTMP_IO_FORCE_WRITE32(_A, _R, _V) \
|
||||||
{ \
|
{ \
|
||||||
UINT Val; \
|
u32 Val; \
|
||||||
Val = readl((void *)((_A)->CSRBaseAddress + MAC_CSR0)); \
|
Val = readl((void *)((_A)->CSRBaseAddress + MAC_CSR0)); \
|
||||||
writel(_V, (void *)((_A)->CSRBaseAddress + (_R))); \
|
writel(_V, (void *)((_A)->CSRBaseAddress + (_R))); \
|
||||||
}
|
}
|
||||||
@ -588,51 +587,51 @@ void linux_pci_unmap_single(void *handle, dma_addr_t dma_addr, size_t size,
|
|||||||
#if defined(RALINK_2880) || defined(RALINK_3052)
|
#if defined(RALINK_2880) || defined(RALINK_3052)
|
||||||
#define RTMP_IO_WRITE8(_A, _R, _V) \
|
#define RTMP_IO_WRITE8(_A, _R, _V) \
|
||||||
{ \
|
{ \
|
||||||
ULONG Val; \
|
unsigned long Val; \
|
||||||
UCHAR _i; \
|
u8 _i; \
|
||||||
_i = ((_R) & 0x3); \
|
_i = ((_R) & 0x3); \
|
||||||
Val = readl((void *)((_A)->CSRBaseAddress + ((_R) - _i))); \
|
Val = readl((void *)((_A)->CSRBaseAddress + ((_R) - _i))); \
|
||||||
Val = Val & (~(0x000000ff << ((_i)*8))); \
|
Val = Val & (~(0x000000ff << ((_i)*8))); \
|
||||||
Val = Val | ((ULONG)(_V) << ((_i)*8)); \
|
Val = Val | ((unsigned long)(_V) << ((_i)*8)); \
|
||||||
writel((Val), (void *)((_A)->CSRBaseAddress + ((_R) - _i))); \
|
writel((Val), (void *)((_A)->CSRBaseAddress + ((_R) - _i))); \
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
#define RTMP_IO_WRITE8(_A, _R, _V) \
|
#define RTMP_IO_WRITE8(_A, _R, _V) \
|
||||||
{ \
|
{ \
|
||||||
UINT Val; \
|
u32 Val; \
|
||||||
Val = readl((void *)((_A)->CSRBaseAddress + MAC_CSR0)); \
|
Val = readl((void *)((_A)->CSRBaseAddress + MAC_CSR0)); \
|
||||||
writeb((_V), (PUCHAR)((_A)->CSRBaseAddress + (_R))); \
|
writeb((_V), (u8 *)((_A)->CSRBaseAddress + (_R))); \
|
||||||
}
|
}
|
||||||
#endif /* #if defined(BRCM_6358) || defined(RALINK_2880) // */
|
#endif /* #if defined(BRCM_6358) || defined(RALINK_2880) // */
|
||||||
|
|
||||||
#define RTMP_IO_WRITE16(_A, _R, _V) \
|
#define RTMP_IO_WRITE16(_A, _R, _V) \
|
||||||
{ \
|
{ \
|
||||||
UINT Val; \
|
u32 Val; \
|
||||||
Val = readl((void *)((_A)->CSRBaseAddress + MAC_CSR0)); \
|
Val = readl((void *)((_A)->CSRBaseAddress + MAC_CSR0)); \
|
||||||
writew((_V), (PUSHORT)((_A)->CSRBaseAddress + (_R))); \
|
writew((_V), (u16 *)((_A)->CSRBaseAddress + (_R))); \
|
||||||
}
|
}
|
||||||
#endif /* RTMP_MAC_PCI // */
|
#endif /* RTMP_MAC_PCI // */
|
||||||
#ifdef RTMP_MAC_USB
|
#ifdef RTMP_MAC_USB
|
||||||
/*Patch for ASIC turst read/write bug, needs to remove after metel fix */
|
/*Patch for ASIC turst read/write bug, needs to remove after metel fix */
|
||||||
#define RTMP_IO_READ32(_A, _R, _pV) \
|
#define RTMP_IO_READ32(_A, _R, _pV) \
|
||||||
RTUSBReadMACRegister((_A), (_R), (PUINT32) (_pV))
|
RTUSBReadMACRegister((_A), (_R), (u32 *)(_pV))
|
||||||
|
|
||||||
#define RTMP_IO_READ8(_A, _R, _pV) \
|
#define RTMP_IO_READ8(_A, _R, _pV) \
|
||||||
{ \
|
{ \
|
||||||
}
|
}
|
||||||
|
|
||||||
#define RTMP_IO_WRITE32(_A, _R, _V) \
|
#define RTMP_IO_WRITE32(_A, _R, _V) \
|
||||||
RTUSBWriteMACRegister((_A), (_R), (UINT32) (_V))
|
RTUSBWriteMACRegister((_A), (_R), (u32)(_V))
|
||||||
|
|
||||||
#define RTMP_IO_WRITE8(_A, _R, _V) \
|
#define RTMP_IO_WRITE8(_A, _R, _V) \
|
||||||
{ \
|
{ \
|
||||||
USHORT _Val = _V; \
|
u16 _Val = _V; \
|
||||||
RTUSBSingleWrite((_A), (_R), (USHORT) (_Val)); \
|
RTUSBSingleWrite((_A), (_R), (u16)(_Val)); \
|
||||||
}
|
}
|
||||||
|
|
||||||
#define RTMP_IO_WRITE16(_A, _R, _V) \
|
#define RTMP_IO_WRITE16(_A, _R, _V) \
|
||||||
{ \
|
{ \
|
||||||
RTUSBSingleWrite((_A), (_R), (USHORT) (_V)); \
|
RTUSBSingleWrite((_A), (_R), (u16)(_V)); \
|
||||||
}
|
}
|
||||||
#endif /* RTMP_MAC_USB // */
|
#endif /* RTMP_MAC_USB // */
|
||||||
|
|
||||||
@ -687,7 +686,7 @@ void linux_pci_unmap_single(void *handle, dma_addr_t dma_addr, size_t size,
|
|||||||
#define GET_OS_PKT_DATATAIL(_pkt) \
|
#define GET_OS_PKT_DATATAIL(_pkt) \
|
||||||
(RTPKT_TO_OSPKT(_pkt)->tail)
|
(RTPKT_TO_OSPKT(_pkt)->tail)
|
||||||
#define SET_OS_PKT_DATATAIL(_pkt, _start, _len) \
|
#define SET_OS_PKT_DATATAIL(_pkt, _start, _len) \
|
||||||
((RTPKT_TO_OSPKT(_pkt))->tail) = (PUCHAR)((_start) + (_len))
|
((RTPKT_TO_OSPKT(_pkt))->tail) = (u8 *)((_start) + (_len))
|
||||||
|
|
||||||
#define GET_OS_PKT_HEAD(_pkt) \
|
#define GET_OS_PKT_HEAD(_pkt) \
|
||||||
(RTPKT_TO_OSPKT(_pkt)->head)
|
(RTPKT_TO_OSPKT(_pkt)->head)
|
||||||
@ -731,7 +730,7 @@ void linux_pci_unmap_single(void *handle, dma_addr_t dma_addr, size_t size,
|
|||||||
/*(this value also as MAC(on-chip WCID) table index) */
|
/*(this value also as MAC(on-chip WCID) table index) */
|
||||||
/* 0x80~0xff: TX to a WDS link. b0~6: WDS index */
|
/* 0x80~0xff: TX to a WDS link. b0~6: WDS index */
|
||||||
#define RTMP_SET_PACKET_WCID(_p, _wdsidx) (RTPKT_TO_OSPKT(_p)->cb[CB_OFF+2] = _wdsidx)
|
#define RTMP_SET_PACKET_WCID(_p, _wdsidx) (RTPKT_TO_OSPKT(_p)->cb[CB_OFF+2] = _wdsidx)
|
||||||
#define RTMP_GET_PACKET_WCID(_p) ((UCHAR)(RTPKT_TO_OSPKT(_p)->cb[CB_OFF+2]))
|
#define RTMP_GET_PACKET_WCID(_p) ((u8)(RTPKT_TO_OSPKT(_p)->cb[CB_OFF+2]))
|
||||||
|
|
||||||
/* 0xff: PKTSRC_NDIS, others: local TX buffer index. This value affects how to a packet */
|
/* 0xff: PKTSRC_NDIS, others: local TX buffer index. This value affects how to a packet */
|
||||||
#define RTMP_SET_PACKET_SOURCE(_p, _pktsrc) (RTPKT_TO_OSPKT(_p)->cb[CB_OFF+3] = _pktsrc)
|
#define RTMP_SET_PACKET_SOURCE(_p, _pktsrc) (RTPKT_TO_OSPKT(_p)->cb[CB_OFF+3] = _pktsrc)
|
||||||
@ -862,7 +861,7 @@ int rt28xx_packet_xmit(struct sk_buff *skb);
|
|||||||
IRQ_HANDLE_TYPE rt2860_interrupt(int irq, void *dev_instance);
|
IRQ_HANDLE_TYPE rt2860_interrupt(int irq, void *dev_instance);
|
||||||
#endif /* RTMP_MAC_PCI // */
|
#endif /* RTMP_MAC_PCI // */
|
||||||
|
|
||||||
INT rt28xx_sta_ioctl(IN PNET_DEV net_dev, IN OUT struct ifreq *rq, IN INT cmd);
|
int rt28xx_sta_ioctl(IN PNET_DEV net_dev, IN OUT struct ifreq *rq, int cmd);
|
||||||
|
|
||||||
extern int ra_mtd_write(int num, loff_t to, size_t len, const u_char * buf);
|
extern int ra_mtd_write(int num, loff_t to, size_t len, const u_char * buf);
|
||||||
extern int ra_mtd_read(int num, loff_t from, size_t len, u_char * buf);
|
extern int ra_mtd_read(int num, loff_t from, size_t len, u_char * buf);
|
||||||
|
@ -41,8 +41,8 @@
|
|||||||
/* Private Variables Used */
|
/* Private Variables Used */
|
||||||
/*---------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------*/
|
||||||
|
|
||||||
PSTRING mac = ""; /* default 00:00:00:00:00:00 */
|
char *mac = ""; /* default 00:00:00:00:00:00 */
|
||||||
PSTRING hostname = ""; /* default CMPC */
|
char *hostname = ""; /* default CMPC */
|
||||||
module_param(mac, charp, 0);
|
module_param(mac, charp, 0);
|
||||||
MODULE_PARM_DESC(mac, "rt28xx: wireless mac addr");
|
MODULE_PARM_DESC(mac, "rt28xx: wireless mac addr");
|
||||||
|
|
||||||
@ -55,7 +55,7 @@ int rt28xx_close(IN struct net_device *net_dev);
|
|||||||
int rt28xx_open(struct net_device *net_dev);
|
int rt28xx_open(struct net_device *net_dev);
|
||||||
|
|
||||||
/* private function prototype */
|
/* private function prototype */
|
||||||
static INT rt28xx_send_packets(IN struct sk_buff *skb_p,
|
static int rt28xx_send_packets(IN struct sk_buff *skb_p,
|
||||||
IN struct net_device *net_dev);
|
IN struct net_device *net_dev);
|
||||||
|
|
||||||
static struct net_device_stats *RT28xx_get_ether_stats(IN struct net_device
|
static struct net_device_stats *RT28xx_get_ether_stats(IN struct net_device
|
||||||
@ -213,7 +213,7 @@ int rt28xx_close(IN PNET_DEV dev)
|
|||||||
struct net_device *net_dev = (struct net_device *)dev;
|
struct net_device *net_dev = (struct net_device *)dev;
|
||||||
RTMP_ADAPTER *pAd = NULL;
|
RTMP_ADAPTER *pAd = NULL;
|
||||||
BOOLEAN Cancelled;
|
BOOLEAN Cancelled;
|
||||||
UINT32 i = 0;
|
u32 i = 0;
|
||||||
|
|
||||||
#ifdef RTMP_MAC_USB
|
#ifdef RTMP_MAC_USB
|
||||||
DECLARE_WAIT_QUEUE_HEAD(unlink_wakeup);
|
DECLARE_WAIT_QUEUE_HEAD(unlink_wakeup);
|
||||||
@ -304,7 +304,7 @@ int rt28xx_close(IN PNET_DEV dev)
|
|||||||
#ifdef RTMP_MAC_PCI
|
#ifdef RTMP_MAC_PCI
|
||||||
{
|
{
|
||||||
BOOLEAN brc;
|
BOOLEAN brc;
|
||||||
/* ULONG Value; */
|
/* unsigned long Value; */
|
||||||
|
|
||||||
if (RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_INTERRUPT_ACTIVE)) {
|
if (RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_INTERRUPT_ACTIVE)) {
|
||||||
RTMP_ASIC_INTERRUPT_DISABLE(pAd);
|
RTMP_ASIC_INTERRUPT_DISABLE(pAd);
|
||||||
@ -418,14 +418,14 @@ int rt28xx_open(IN PNET_DEV dev)
|
|||||||
RTMP_SET_FLAG(pAd, fRTMP_ADAPTER_START_UP);
|
RTMP_SET_FLAG(pAd, fRTMP_ADAPTER_START_UP);
|
||||||
|
|
||||||
{
|
{
|
||||||
UINT32 reg = 0;
|
u32 reg = 0;
|
||||||
RTMP_IO_READ32(pAd, 0x1300, ®); /* clear garbage interrupts */
|
RTMP_IO_READ32(pAd, 0x1300, ®); /* clear garbage interrupts */
|
||||||
printk("0x1300 = %08x\n", reg);
|
printk("0x1300 = %08x\n", reg);
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
/* u32 reg; */
|
/* u32 reg; */
|
||||||
/* UINT8 byte; */
|
/* u8 byte; */
|
||||||
/* u16 tmp; */
|
/* u16 tmp; */
|
||||||
|
|
||||||
/* RTMP_IO_READ32(pAd, XIFS_TIME_CFG, ®); */
|
/* RTMP_IO_READ32(pAd, XIFS_TIME_CFG, ®); */
|
||||||
@ -463,7 +463,7 @@ PNET_DEV RtmpPhyNetDevInit(IN RTMP_ADAPTER * pAd,
|
|||||||
IN RTMP_OS_NETDEV_OP_HOOK * pNetDevHook)
|
IN RTMP_OS_NETDEV_OP_HOOK * pNetDevHook)
|
||||||
{
|
{
|
||||||
struct net_device *net_dev = NULL;
|
struct net_device *net_dev = NULL;
|
||||||
/* NDIS_STATUS Status; */
|
/* int Status; */
|
||||||
|
|
||||||
net_dev =
|
net_dev =
|
||||||
RtmpOSNetDevCreate(pAd, INT_MAIN, 0, sizeof(PRTMP_ADAPTER),
|
RtmpOSNetDevCreate(pAd, INT_MAIN, 0, sizeof(PRTMP_ADAPTER),
|
||||||
@ -480,7 +480,7 @@ PNET_DEV RtmpPhyNetDevInit(IN RTMP_ADAPTER * pAd,
|
|||||||
pNetDevHook->priv_flags = INT_MAIN;
|
pNetDevHook->priv_flags = INT_MAIN;
|
||||||
pNetDevHook->needProtcted = FALSE;
|
pNetDevHook->needProtcted = FALSE;
|
||||||
|
|
||||||
net_dev->ml_priv = (PVOID) pAd;
|
net_dev->ml_priv = (void *)pAd;
|
||||||
pAd->net_dev = net_dev;
|
pAd->net_dev = net_dev;
|
||||||
|
|
||||||
netif_stop_queue(net_dev);
|
netif_stop_queue(net_dev);
|
||||||
@ -571,7 +571,7 @@ static int rt28xx_send_packets(IN struct sk_buff *skb_p,
|
|||||||
return NETDEV_TX_OK;
|
return NETDEV_TX_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
NdisZeroMemory((PUCHAR) & skb_p->cb[CB_OFF], 15);
|
NdisZeroMemory((u8 *)& skb_p->cb[CB_OFF], 15);
|
||||||
RTMP_SET_PACKET_NET_DEVICE_MBSSID(skb_p, MAIN_MBSSID);
|
RTMP_SET_PACKET_NET_DEVICE_MBSSID(skb_p, MAIN_MBSSID);
|
||||||
|
|
||||||
return rt28xx_packet_xmit(skb_p);
|
return rt28xx_packet_xmit(skb_p);
|
||||||
@ -721,10 +721,10 @@ Return Value:
|
|||||||
Note:
|
Note:
|
||||||
========================================================================
|
========================================================================
|
||||||
*/
|
*/
|
||||||
NDIS_STATUS AdapterBlockAllocateMemory(IN PVOID handle, OUT PVOID * ppAd)
|
int AdapterBlockAllocateMemory(void *handle, void ** ppAd)
|
||||||
{
|
{
|
||||||
|
|
||||||
*ppAd = (PVOID) vmalloc(sizeof(RTMP_ADAPTER)); /*pci_alloc_consistent(pci_dev, sizeof(RTMP_ADAPTER), phy_addr); */
|
*ppAd = (void *)vmalloc(sizeof(RTMP_ADAPTER)); /*pci_alloc_consistent(pci_dev, sizeof(RTMP_ADAPTER), phy_addr); */
|
||||||
|
|
||||||
if (*ppAd) {
|
if (*ppAd) {
|
||||||
NdisZeroMemory(*ppAd, sizeof(RTMP_ADAPTER));
|
NdisZeroMemory(*ppAd, sizeof(RTMP_ADAPTER));
|
||||||
|
@ -78,54 +78,54 @@ static void fifo_statistic_full_tasklet(unsigned long data);
|
|||||||
**************************************************************************/
|
**************************************************************************/
|
||||||
/* Function for TxDesc Memory allocation. */
|
/* Function for TxDesc Memory allocation. */
|
||||||
void RTMP_AllocateTxDescMemory(IN PRTMP_ADAPTER pAd,
|
void RTMP_AllocateTxDescMemory(IN PRTMP_ADAPTER pAd,
|
||||||
IN UINT Index,
|
u32 Index,
|
||||||
IN ULONG Length,
|
unsigned long Length,
|
||||||
IN BOOLEAN Cached,
|
IN BOOLEAN Cached,
|
||||||
OUT PVOID * VirtualAddress,
|
void ** VirtualAddress,
|
||||||
OUT PNDIS_PHYSICAL_ADDRESS PhysicalAddress)
|
OUT PNDIS_PHYSICAL_ADDRESS PhysicalAddress)
|
||||||
{
|
{
|
||||||
POS_COOKIE pObj = (POS_COOKIE) pAd->OS_Cookie;
|
POS_COOKIE pObj = (POS_COOKIE) pAd->OS_Cookie;
|
||||||
|
|
||||||
*VirtualAddress =
|
*VirtualAddress =
|
||||||
(PVOID) pci_alloc_consistent(pObj->pci_dev, sizeof(char) * Length,
|
(void *)pci_alloc_consistent(pObj->pci_dev, sizeof(char) * Length,
|
||||||
PhysicalAddress);
|
PhysicalAddress);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Function for MgmtDesc Memory allocation. */
|
/* Function for MgmtDesc Memory allocation. */
|
||||||
void RTMP_AllocateMgmtDescMemory(IN PRTMP_ADAPTER pAd,
|
void RTMP_AllocateMgmtDescMemory(IN PRTMP_ADAPTER pAd,
|
||||||
IN ULONG Length,
|
unsigned long Length,
|
||||||
IN BOOLEAN Cached,
|
IN BOOLEAN Cached,
|
||||||
OUT PVOID * VirtualAddress,
|
void ** VirtualAddress,
|
||||||
OUT PNDIS_PHYSICAL_ADDRESS PhysicalAddress)
|
OUT PNDIS_PHYSICAL_ADDRESS PhysicalAddress)
|
||||||
{
|
{
|
||||||
POS_COOKIE pObj = (POS_COOKIE) pAd->OS_Cookie;
|
POS_COOKIE pObj = (POS_COOKIE) pAd->OS_Cookie;
|
||||||
|
|
||||||
*VirtualAddress =
|
*VirtualAddress =
|
||||||
(PVOID) pci_alloc_consistent(pObj->pci_dev, sizeof(char) * Length,
|
(void *)pci_alloc_consistent(pObj->pci_dev, sizeof(char) * Length,
|
||||||
PhysicalAddress);
|
PhysicalAddress);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Function for RxDesc Memory allocation. */
|
/* Function for RxDesc Memory allocation. */
|
||||||
void RTMP_AllocateRxDescMemory(IN PRTMP_ADAPTER pAd,
|
void RTMP_AllocateRxDescMemory(IN PRTMP_ADAPTER pAd,
|
||||||
IN ULONG Length,
|
unsigned long Length,
|
||||||
IN BOOLEAN Cached,
|
IN BOOLEAN Cached,
|
||||||
OUT PVOID * VirtualAddress,
|
void ** VirtualAddress,
|
||||||
OUT PNDIS_PHYSICAL_ADDRESS PhysicalAddress)
|
OUT PNDIS_PHYSICAL_ADDRESS PhysicalAddress)
|
||||||
{
|
{
|
||||||
POS_COOKIE pObj = (POS_COOKIE) pAd->OS_Cookie;
|
POS_COOKIE pObj = (POS_COOKIE) pAd->OS_Cookie;
|
||||||
|
|
||||||
*VirtualAddress =
|
*VirtualAddress =
|
||||||
(PVOID) pci_alloc_consistent(pObj->pci_dev, sizeof(char) * Length,
|
(void *)pci_alloc_consistent(pObj->pci_dev, sizeof(char) * Length,
|
||||||
PhysicalAddress);
|
PhysicalAddress);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Function for free allocated Desc Memory. */
|
/* Function for free allocated Desc Memory. */
|
||||||
void RTMP_FreeDescMemory(IN PRTMP_ADAPTER pAd,
|
void RTMP_FreeDescMemory(IN PRTMP_ADAPTER pAd,
|
||||||
IN ULONG Length,
|
unsigned long Length,
|
||||||
IN PVOID VirtualAddress,
|
void *VirtualAddress,
|
||||||
IN NDIS_PHYSICAL_ADDRESS PhysicalAddress)
|
IN NDIS_PHYSICAL_ADDRESS PhysicalAddress)
|
||||||
{
|
{
|
||||||
POS_COOKIE pObj = (POS_COOKIE) pAd->OS_Cookie;
|
POS_COOKIE pObj = (POS_COOKIE) pAd->OS_Cookie;
|
||||||
@ -136,23 +136,23 @@ void RTMP_FreeDescMemory(IN PRTMP_ADAPTER pAd,
|
|||||||
|
|
||||||
/* Function for TxData DMA Memory allocation. */
|
/* Function for TxData DMA Memory allocation. */
|
||||||
void RTMP_AllocateFirstTxBuffer(IN PRTMP_ADAPTER pAd,
|
void RTMP_AllocateFirstTxBuffer(IN PRTMP_ADAPTER pAd,
|
||||||
IN UINT Index,
|
u32 Index,
|
||||||
IN ULONG Length,
|
unsigned long Length,
|
||||||
IN BOOLEAN Cached,
|
IN BOOLEAN Cached,
|
||||||
OUT PVOID * VirtualAddress,
|
void ** VirtualAddress,
|
||||||
OUT PNDIS_PHYSICAL_ADDRESS PhysicalAddress)
|
OUT PNDIS_PHYSICAL_ADDRESS PhysicalAddress)
|
||||||
{
|
{
|
||||||
POS_COOKIE pObj = (POS_COOKIE) pAd->OS_Cookie;
|
POS_COOKIE pObj = (POS_COOKIE) pAd->OS_Cookie;
|
||||||
|
|
||||||
*VirtualAddress =
|
*VirtualAddress =
|
||||||
(PVOID) pci_alloc_consistent(pObj->pci_dev, sizeof(char) * Length,
|
(void *)pci_alloc_consistent(pObj->pci_dev, sizeof(char) * Length,
|
||||||
PhysicalAddress);
|
PhysicalAddress);
|
||||||
}
|
}
|
||||||
|
|
||||||
void RTMP_FreeFirstTxBuffer(IN PRTMP_ADAPTER pAd,
|
void RTMP_FreeFirstTxBuffer(IN PRTMP_ADAPTER pAd,
|
||||||
IN ULONG Length,
|
unsigned long Length,
|
||||||
IN BOOLEAN Cached,
|
IN BOOLEAN Cached,
|
||||||
IN PVOID VirtualAddress,
|
void *VirtualAddress,
|
||||||
IN NDIS_PHYSICAL_ADDRESS PhysicalAddress)
|
IN NDIS_PHYSICAL_ADDRESS PhysicalAddress)
|
||||||
{
|
{
|
||||||
POS_COOKIE pObj = (POS_COOKIE) pAd->OS_Cookie;
|
POS_COOKIE pObj = (POS_COOKIE) pAd->OS_Cookie;
|
||||||
@ -171,15 +171,15 @@ void RTMP_FreeFirstTxBuffer(IN PRTMP_ADAPTER pAd,
|
|||||||
* PhysicalAddress: Physical address corresponding to virtual address
|
* PhysicalAddress: Physical address corresponding to virtual address
|
||||||
*/
|
*/
|
||||||
void RTMP_AllocateSharedMemory(IN PRTMP_ADAPTER pAd,
|
void RTMP_AllocateSharedMemory(IN PRTMP_ADAPTER pAd,
|
||||||
IN ULONG Length,
|
unsigned long Length,
|
||||||
IN BOOLEAN Cached,
|
IN BOOLEAN Cached,
|
||||||
OUT PVOID * VirtualAddress,
|
void ** VirtualAddress,
|
||||||
OUT PNDIS_PHYSICAL_ADDRESS PhysicalAddress)
|
OUT PNDIS_PHYSICAL_ADDRESS PhysicalAddress)
|
||||||
{
|
{
|
||||||
POS_COOKIE pObj = (POS_COOKIE) pAd->OS_Cookie;
|
POS_COOKIE pObj = (POS_COOKIE) pAd->OS_Cookie;
|
||||||
|
|
||||||
*VirtualAddress =
|
*VirtualAddress =
|
||||||
(PVOID) pci_alloc_consistent(pObj->pci_dev, sizeof(char) * Length,
|
(void *)pci_alloc_consistent(pObj->pci_dev, sizeof(char) * Length,
|
||||||
PhysicalAddress);
|
PhysicalAddress);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -195,9 +195,9 @@ void RTMP_AllocateSharedMemory(IN PRTMP_ADAPTER pAd,
|
|||||||
* Cached is ignored: always cached memory
|
* Cached is ignored: always cached memory
|
||||||
*/
|
*/
|
||||||
PNDIS_PACKET RTMP_AllocateRxPacketBuffer(IN PRTMP_ADAPTER pAd,
|
PNDIS_PACKET RTMP_AllocateRxPacketBuffer(IN PRTMP_ADAPTER pAd,
|
||||||
IN ULONG Length,
|
unsigned long Length,
|
||||||
IN BOOLEAN Cached,
|
IN BOOLEAN Cached,
|
||||||
OUT PVOID * VirtualAddress,
|
void ** VirtualAddress,
|
||||||
OUT PNDIS_PHYSICAL_ADDRESS
|
OUT PNDIS_PHYSICAL_ADDRESS
|
||||||
PhysicalAddress)
|
PhysicalAddress)
|
||||||
{
|
{
|
||||||
@ -212,19 +212,19 @@ PNDIS_PACKET RTMP_AllocateRxPacketBuffer(IN PRTMP_ADAPTER pAd,
|
|||||||
|
|
||||||
if (pkt) {
|
if (pkt) {
|
||||||
RTMP_SET_PACKET_SOURCE(OSPKT_TO_RTPKT(pkt), PKTSRC_NDIS);
|
RTMP_SET_PACKET_SOURCE(OSPKT_TO_RTPKT(pkt), PKTSRC_NDIS);
|
||||||
*VirtualAddress = (PVOID) pkt->data;
|
*VirtualAddress = (void *)pkt->data;
|
||||||
*PhysicalAddress =
|
*PhysicalAddress =
|
||||||
PCI_MAP_SINGLE(pAd, *VirtualAddress, Length, -1,
|
PCI_MAP_SINGLE(pAd, *VirtualAddress, Length, -1,
|
||||||
PCI_DMA_FROMDEVICE);
|
PCI_DMA_FROMDEVICE);
|
||||||
} else {
|
} else {
|
||||||
*VirtualAddress = (PVOID) NULL;
|
*VirtualAddress = (void *)NULL;
|
||||||
*PhysicalAddress = (NDIS_PHYSICAL_ADDRESS) NULL;
|
*PhysicalAddress = (NDIS_PHYSICAL_ADDRESS) NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
return (PNDIS_PACKET) pkt;
|
return (PNDIS_PACKET) pkt;
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID Invalid_Remaining_Packet(IN PRTMP_ADAPTER pAd, IN ULONG VirtualAddress)
|
void Invalid_Remaining_Packet(IN PRTMP_ADAPTER pAd, unsigned long VirtualAddress)
|
||||||
{
|
{
|
||||||
NDIS_PHYSICAL_ADDRESS PhysicalAddress;
|
NDIS_PHYSICAL_ADDRESS PhysicalAddress;
|
||||||
|
|
||||||
@ -233,7 +233,7 @@ VOID Invalid_Remaining_Packet(IN PRTMP_ADAPTER pAd, IN ULONG VirtualAddress)
|
|||||||
RX_BUFFER_NORMSIZE - 1600, -1, PCI_DMA_FROMDEVICE);
|
RX_BUFFER_NORMSIZE - 1600, -1, PCI_DMA_FROMDEVICE);
|
||||||
}
|
}
|
||||||
|
|
||||||
NDIS_STATUS RtmpNetTaskInit(IN RTMP_ADAPTER * pAd)
|
int RtmpNetTaskInit(IN RTMP_ADAPTER * pAd)
|
||||||
{
|
{
|
||||||
POS_COOKIE pObj;
|
POS_COOKIE pObj;
|
||||||
|
|
||||||
@ -273,7 +273,7 @@ void RtmpNetTaskExit(IN RTMP_ADAPTER * pAd)
|
|||||||
tasklet_kill(&pObj->fifo_statistic_full_task);
|
tasklet_kill(&pObj->fifo_statistic_full_task);
|
||||||
}
|
}
|
||||||
|
|
||||||
NDIS_STATUS RtmpMgmtTaskInit(IN RTMP_ADAPTER * pAd)
|
int RtmpMgmtTaskInit(IN RTMP_ADAPTER * pAd)
|
||||||
{
|
{
|
||||||
|
|
||||||
return NDIS_STATUS_SUCCESS;
|
return NDIS_STATUS_SUCCESS;
|
||||||
@ -293,7 +293,7 @@ Return Value:
|
|||||||
Note:
|
Note:
|
||||||
========================================================================
|
========================================================================
|
||||||
*/
|
*/
|
||||||
VOID RtmpMgmtTaskExit(IN RTMP_ADAPTER * pAd)
|
void RtmpMgmtTaskExit(IN RTMP_ADAPTER * pAd)
|
||||||
{
|
{
|
||||||
|
|
||||||
return;
|
return;
|
||||||
@ -401,7 +401,7 @@ static void rx_done_tasklet(unsigned long data)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* enable RxINT again */
|
/* enable Rxint again */
|
||||||
rt2860_int_enable(pAd, INT_RX);
|
rt2860_int_enable(pAd, INT_RX);
|
||||||
RTMP_INT_UNLOCK(&pAd->irq_lock, flags);
|
RTMP_INT_UNLOCK(&pAd->irq_lock, flags);
|
||||||
|
|
||||||
@ -434,7 +434,7 @@ void fifo_statistic_full_tasklet(unsigned long data)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* enable RxINT again */
|
/* enable Rxint again */
|
||||||
|
|
||||||
rt2860_int_enable(pAd, FifoStaFullInt);
|
rt2860_int_enable(pAd, FifoStaFullInt);
|
||||||
RTMP_INT_UNLOCK(&pAd->irq_lock, flags);
|
RTMP_INT_UNLOCK(&pAd->irq_lock, flags);
|
||||||
@ -712,7 +712,7 @@ IRQ_HANDLE_TYPE rt2860_interrupt(int irq, void *dev_instance)
|
|||||||
if (IntSource.word & INT_RX) {
|
if (IntSource.word & INT_RX) {
|
||||||
if ((pAd->int_disable_mask & INT_RX) == 0) {
|
if ((pAd->int_disable_mask & INT_RX) == 0) {
|
||||||
|
|
||||||
/* mask RxINT */
|
/* mask Rxint */
|
||||||
rt2860_int_disable(pAd, INT_RX);
|
rt2860_int_disable(pAd, INT_RX);
|
||||||
tasklet_hi_schedule(&pObj->rx_done_task);
|
tasklet_hi_schedule(&pObj->rx_done_task);
|
||||||
}
|
}
|
||||||
|
@ -77,10 +77,10 @@ Return Value:
|
|||||||
Note:
|
Note:
|
||||||
========================================================================
|
========================================================================
|
||||||
*/
|
*/
|
||||||
NDIS_STATUS RtmpMgmtTaskInit(IN RTMP_ADAPTER * pAd)
|
int RtmpMgmtTaskInit(IN RTMP_ADAPTER * pAd)
|
||||||
{
|
{
|
||||||
RTMP_OS_TASK *pTask;
|
RTMP_OS_TASK *pTask;
|
||||||
NDIS_STATUS status;
|
int status;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Creat TimerQ Thread, We need init timerQ related structure before create the timer thread.
|
Creat TimerQ Thread, We need init timerQ related structure before create the timer thread.
|
||||||
@ -133,9 +133,9 @@ Return Value:
|
|||||||
Note:
|
Note:
|
||||||
========================================================================
|
========================================================================
|
||||||
*/
|
*/
|
||||||
VOID RtmpMgmtTaskExit(IN RTMP_ADAPTER * pAd)
|
void RtmpMgmtTaskExit(IN RTMP_ADAPTER * pAd)
|
||||||
{
|
{
|
||||||
INT ret;
|
int ret;
|
||||||
RTMP_OS_TASK *pTask;
|
RTMP_OS_TASK *pTask;
|
||||||
|
|
||||||
/* Sleep 50 milliseconds so pending io might finish normally */
|
/* Sleep 50 milliseconds so pending io might finish normally */
|
||||||
@ -201,8 +201,8 @@ static void rtusb_dataout_complete(unsigned long data)
|
|||||||
purbb_t pUrb;
|
purbb_t pUrb;
|
||||||
POS_COOKIE pObj;
|
POS_COOKIE pObj;
|
||||||
PHT_TX_CONTEXT pHTTXContext;
|
PHT_TX_CONTEXT pHTTXContext;
|
||||||
UCHAR BulkOutPipeId;
|
u8 BulkOutPipeId;
|
||||||
NTSTATUS Status;
|
int Status;
|
||||||
unsigned long IrqFlags;
|
unsigned long IrqFlags;
|
||||||
|
|
||||||
pUrb = (purbb_t) data;
|
pUrb = (purbb_t) data;
|
||||||
@ -235,7 +235,7 @@ static void rtusb_dataout_complete(unsigned long data)
|
|||||||
|
|
||||||
} else /* STATUS_OTHER */
|
} else /* STATUS_OTHER */
|
||||||
{
|
{
|
||||||
PUCHAR pBuf;
|
u8 *pBuf;
|
||||||
|
|
||||||
pAd->BulkOutCompleteOther++;
|
pAd->BulkOutCompleteOther++;
|
||||||
|
|
||||||
@ -297,7 +297,7 @@ static void rtusb_null_frame_done_tasklet(unsigned long data)
|
|||||||
PRTMP_ADAPTER pAd;
|
PRTMP_ADAPTER pAd;
|
||||||
PTX_CONTEXT pNullContext;
|
PTX_CONTEXT pNullContext;
|
||||||
purbb_t pUrb;
|
purbb_t pUrb;
|
||||||
NTSTATUS Status;
|
int Status;
|
||||||
unsigned long irqFlag;
|
unsigned long irqFlag;
|
||||||
|
|
||||||
pUrb = (purbb_t) data;
|
pUrb = (purbb_t) data;
|
||||||
@ -346,7 +346,7 @@ static void rtusb_rts_frame_done_tasklet(unsigned long data)
|
|||||||
PRTMP_ADAPTER pAd;
|
PRTMP_ADAPTER pAd;
|
||||||
PTX_CONTEXT pRTSContext;
|
PTX_CONTEXT pRTSContext;
|
||||||
purbb_t pUrb;
|
purbb_t pUrb;
|
||||||
NTSTATUS Status;
|
int Status;
|
||||||
unsigned long irqFlag;
|
unsigned long irqFlag;
|
||||||
|
|
||||||
pUrb = (purbb_t) data;
|
pUrb = (purbb_t) data;
|
||||||
@ -396,7 +396,7 @@ static void rtusb_pspoll_frame_done_tasklet(unsigned long data)
|
|||||||
PRTMP_ADAPTER pAd;
|
PRTMP_ADAPTER pAd;
|
||||||
PTX_CONTEXT pPsPollContext;
|
PTX_CONTEXT pPsPollContext;
|
||||||
purbb_t pUrb;
|
purbb_t pUrb;
|
||||||
NTSTATUS Status;
|
int Status;
|
||||||
|
|
||||||
pUrb = (purbb_t) data;
|
pUrb = (purbb_t) data;
|
||||||
pPsPollContext = (PTX_CONTEXT) pUrb->context;
|
pPsPollContext = (PTX_CONTEXT) pUrb->context;
|
||||||
@ -455,7 +455,7 @@ static void rx_done_tasklet(unsigned long data)
|
|||||||
purbb_t pUrb;
|
purbb_t pUrb;
|
||||||
PRX_CONTEXT pRxContext;
|
PRX_CONTEXT pRxContext;
|
||||||
PRTMP_ADAPTER pAd;
|
PRTMP_ADAPTER pAd;
|
||||||
NTSTATUS Status;
|
int Status;
|
||||||
unsigned int IrqFlags;
|
unsigned int IrqFlags;
|
||||||
|
|
||||||
pUrb = (purbb_t) data;
|
pUrb = (purbb_t) data;
|
||||||
@ -519,7 +519,7 @@ static void rtusb_mgmt_dma_done_tasklet(unsigned long data)
|
|||||||
int index;
|
int index;
|
||||||
PNDIS_PACKET pPacket;
|
PNDIS_PACKET pPacket;
|
||||||
purbb_t pUrb;
|
purbb_t pUrb;
|
||||||
NTSTATUS Status;
|
int Status;
|
||||||
unsigned long IrqFlags;
|
unsigned long IrqFlags;
|
||||||
|
|
||||||
pUrb = (purbb_t) data;
|
pUrb = (purbb_t) data;
|
||||||
@ -597,7 +597,7 @@ static void rtusb_ac3_dma_done_tasklet(unsigned long data)
|
|||||||
{
|
{
|
||||||
PRTMP_ADAPTER pAd;
|
PRTMP_ADAPTER pAd;
|
||||||
PHT_TX_CONTEXT pHTTXContext;
|
PHT_TX_CONTEXT pHTTXContext;
|
||||||
UCHAR BulkOutPipeId = 3;
|
u8 BulkOutPipeId = 3;
|
||||||
purbb_t pUrb;
|
purbb_t pUrb;
|
||||||
|
|
||||||
pUrb = (purbb_t) data;
|
pUrb = (purbb_t) data;
|
||||||
@ -637,7 +637,7 @@ static void rtusb_ac2_dma_done_tasklet(unsigned long data)
|
|||||||
{
|
{
|
||||||
PRTMP_ADAPTER pAd;
|
PRTMP_ADAPTER pAd;
|
||||||
PHT_TX_CONTEXT pHTTXContext;
|
PHT_TX_CONTEXT pHTTXContext;
|
||||||
UCHAR BulkOutPipeId = 2;
|
u8 BulkOutPipeId = 2;
|
||||||
purbb_t pUrb;
|
purbb_t pUrb;
|
||||||
|
|
||||||
pUrb = (purbb_t) data;
|
pUrb = (purbb_t) data;
|
||||||
@ -677,7 +677,7 @@ static void rtusb_ac1_dma_done_tasklet(unsigned long data)
|
|||||||
{
|
{
|
||||||
PRTMP_ADAPTER pAd;
|
PRTMP_ADAPTER pAd;
|
||||||
PHT_TX_CONTEXT pHTTXContext;
|
PHT_TX_CONTEXT pHTTXContext;
|
||||||
UCHAR BulkOutPipeId = 1;
|
u8 BulkOutPipeId = 1;
|
||||||
purbb_t pUrb;
|
purbb_t pUrb;
|
||||||
|
|
||||||
pUrb = (purbb_t) data;
|
pUrb = (purbb_t) data;
|
||||||
@ -717,7 +717,7 @@ static void rtusb_ac0_dma_done_tasklet(unsigned long data)
|
|||||||
{
|
{
|
||||||
PRTMP_ADAPTER pAd;
|
PRTMP_ADAPTER pAd;
|
||||||
PHT_TX_CONTEXT pHTTXContext;
|
PHT_TX_CONTEXT pHTTXContext;
|
||||||
UCHAR BulkOutPipeId = 0;
|
u8 BulkOutPipeId = 0;
|
||||||
purbb_t pUrb;
|
purbb_t pUrb;
|
||||||
|
|
||||||
pUrb = (purbb_t) data;
|
pUrb = (purbb_t) data;
|
||||||
@ -753,12 +753,12 @@ static void rtusb_ac0_dma_done_tasklet(unsigned long data)
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
NDIS_STATUS RtmpNetTaskInit(IN RTMP_ADAPTER * pAd)
|
int RtmpNetTaskInit(IN RTMP_ADAPTER * pAd)
|
||||||
{
|
{
|
||||||
POS_COOKIE pObj = (POS_COOKIE) pAd->OS_Cookie;
|
POS_COOKIE pObj = (POS_COOKIE) pAd->OS_Cookie;
|
||||||
|
|
||||||
/* Create receive tasklet */
|
/* Create receive tasklet */
|
||||||
tasklet_init(&pObj->rx_done_task, rx_done_tasklet, (ULONG) pAd);
|
tasklet_init(&pObj->rx_done_task, rx_done_tasklet, (unsigned long)pAd);
|
||||||
tasklet_init(&pObj->mgmt_dma_done_task, rtusb_mgmt_dma_done_tasklet,
|
tasklet_init(&pObj->mgmt_dma_done_task, rtusb_mgmt_dma_done_tasklet,
|
||||||
(unsigned long)pAd);
|
(unsigned long)pAd);
|
||||||
tasklet_init(&pObj->ac0_dma_done_task, rtusb_ac0_dma_done_tasklet,
|
tasklet_init(&pObj->ac0_dma_done_task, rtusb_ac0_dma_done_tasklet,
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -161,7 +161,7 @@
|
|||||||
* EEPROM operation related marcos
|
* EEPROM operation related marcos
|
||||||
*/
|
*/
|
||||||
#define RT28xx_EEPROM_READ16(_pAd, _offset, _value) \
|
#define RT28xx_EEPROM_READ16(_pAd, _offset, _value) \
|
||||||
(_pAd)->chipOps.eeread((RTMP_ADAPTER *)(_pAd), (USHORT)(_offset), (PUSHORT)&(_value))
|
(_pAd)->chipOps.eeread((RTMP_ADAPTER *)(_pAd), (u16)(_offset), (u16 *)&(_value))
|
||||||
|
|
||||||
/* ------------------------------------------------------------------- */
|
/* ------------------------------------------------------------------- */
|
||||||
/* E2PROM data layout */
|
/* E2PROM data layout */
|
||||||
@ -172,10 +172,10 @@
|
|||||||
/* */
|
/* */
|
||||||
typedef union _MCU_LEDCS_STRUC {
|
typedef union _MCU_LEDCS_STRUC {
|
||||||
struct {
|
struct {
|
||||||
UCHAR LedMode:7;
|
u8 LedMode:7;
|
||||||
UCHAR Polarity:1;
|
u8 Polarity:1;
|
||||||
} field;
|
} field;
|
||||||
UCHAR word;
|
u8 word;
|
||||||
} MCU_LEDCS_STRUC, *PMCU_LEDCS_STRUC;
|
} MCU_LEDCS_STRUC, *PMCU_LEDCS_STRUC;
|
||||||
|
|
||||||
/* */
|
/* */
|
||||||
@ -183,32 +183,32 @@ typedef union _MCU_LEDCS_STRUC {
|
|||||||
/* */
|
/* */
|
||||||
typedef union _EEPROM_ANTENNA_STRUC {
|
typedef union _EEPROM_ANTENNA_STRUC {
|
||||||
struct {
|
struct {
|
||||||
USHORT RxPath:4; /* 1: 1R, 2: 2R, 3: 3R */
|
u16 RxPath:4; /* 1: 1R, 2: 2R, 3: 3R */
|
||||||
USHORT TxPath:4; /* 1: 1T, 2: 2T */
|
u16 TxPath:4; /* 1: 1T, 2: 2T */
|
||||||
USHORT RfIcType:4; /* see E2PROM document */
|
u16 RfIcType:4; /* see E2PROM document */
|
||||||
USHORT Rsv:4;
|
u16 Rsv:4;
|
||||||
} field;
|
} field;
|
||||||
USHORT word;
|
u16 word;
|
||||||
} EEPROM_ANTENNA_STRUC, *PEEPROM_ANTENNA_STRUC;
|
} EEPROM_ANTENNA_STRUC, *PEEPROM_ANTENNA_STRUC;
|
||||||
|
|
||||||
typedef union _EEPROM_NIC_CINFIG2_STRUC {
|
typedef union _EEPROM_NIC_CINFIG2_STRUC {
|
||||||
struct {
|
struct {
|
||||||
USHORT HardwareRadioControl:1; /* 1:enable, 0:disable */
|
u16 HardwareRadioControl:1; /* 1:enable, 0:disable */
|
||||||
USHORT DynamicTxAgcControl:1; /* */
|
u16 DynamicTxAgcControl:1; /* */
|
||||||
USHORT ExternalLNAForG:1; /* */
|
u16 ExternalLNAForG:1; /* */
|
||||||
USHORT ExternalLNAForA:1; /* external LNA enable for 2.4G */
|
u16 ExternalLNAForA:1; /* external LNA enable for 2.4G */
|
||||||
USHORT CardbusAcceleration:1; /* !!! NOTE: 0 - enable, 1 - disable */
|
u16 CardbusAcceleration:1; /* !!! NOTE: 0 - enable, 1 - disable */
|
||||||
USHORT BW40MSidebandForG:1;
|
u16 BW40MSidebandForG:1;
|
||||||
USHORT BW40MSidebandForA:1;
|
u16 BW40MSidebandForA:1;
|
||||||
USHORT EnableWPSPBC:1; /* WPS PBC Control bit */
|
u16 EnableWPSPBC:1; /* WPS PBC Control bit */
|
||||||
USHORT BW40MAvailForG:1; /* 0:enable, 1:disable */
|
u16 BW40MAvailForG:1; /* 0:enable, 1:disable */
|
||||||
USHORT BW40MAvailForA:1; /* 0:enable, 1:disable */
|
u16 BW40MAvailForA:1; /* 0:enable, 1:disable */
|
||||||
USHORT Rsv1:1; /* must be 0 */
|
u16 Rsv1:1; /* must be 0 */
|
||||||
USHORT AntDiversity:1; /* Antenna diversity */
|
u16 AntDiversity:1; /* Antenna diversity */
|
||||||
USHORT Rsv2:3; /* must be 0 */
|
u16 Rsv2:3; /* must be 0 */
|
||||||
USHORT DACTestBit:1; /* control if driver should patch the DAC issue */
|
u16 DACTestBit:1; /* control if driver should patch the DAC issue */
|
||||||
} field;
|
} field;
|
||||||
USHORT word;
|
u16 word;
|
||||||
} EEPROM_NIC_CONFIG2_STRUC, *PEEPROM_NIC_CONFIG2_STRUC;
|
} EEPROM_NIC_CONFIG2_STRUC, *PEEPROM_NIC_CONFIG2_STRUC;
|
||||||
|
|
||||||
/* */
|
/* */
|
||||||
@ -216,43 +216,43 @@ typedef union _EEPROM_NIC_CINFIG2_STRUC {
|
|||||||
/* */
|
/* */
|
||||||
typedef union _EEPROM_TX_PWR_STRUC {
|
typedef union _EEPROM_TX_PWR_STRUC {
|
||||||
struct {
|
struct {
|
||||||
CHAR Byte0; /* Low Byte */
|
char Byte0; /* Low Byte */
|
||||||
CHAR Byte1; /* High Byte */
|
char Byte1; /* High Byte */
|
||||||
} field;
|
} field;
|
||||||
USHORT word;
|
u16 word;
|
||||||
} EEPROM_TX_PWR_STRUC, *PEEPROM_TX_PWR_STRUC;
|
} EEPROM_TX_PWR_STRUC, *PEEPROM_TX_PWR_STRUC;
|
||||||
|
|
||||||
typedef union _EEPROM_VERSION_STRUC {
|
typedef union _EEPROM_VERSION_STRUC {
|
||||||
struct {
|
struct {
|
||||||
UCHAR FaeReleaseNumber; /* Low Byte */
|
u8 FaeReleaseNumber; /* Low Byte */
|
||||||
UCHAR Version; /* High Byte */
|
u8 Version; /* High Byte */
|
||||||
} field;
|
} field;
|
||||||
USHORT word;
|
u16 word;
|
||||||
} EEPROM_VERSION_STRUC, *PEEPROM_VERSION_STRUC;
|
} EEPROM_VERSION_STRUC, *PEEPROM_VERSION_STRUC;
|
||||||
|
|
||||||
typedef union _EEPROM_LED_STRUC {
|
typedef union _EEPROM_LED_STRUC {
|
||||||
struct {
|
struct {
|
||||||
USHORT PolarityRDY_G:1; /* Polarity RDY_G setting. */
|
u16 PolarityRDY_G:1; /* Polarity RDY_G setting. */
|
||||||
USHORT PolarityRDY_A:1; /* Polarity RDY_A setting. */
|
u16 PolarityRDY_A:1; /* Polarity RDY_A setting. */
|
||||||
USHORT PolarityACT:1; /* Polarity ACT setting. */
|
u16 PolarityACT:1; /* Polarity ACT setting. */
|
||||||
USHORT PolarityGPIO_0:1; /* Polarity GPIO#0 setting. */
|
u16 PolarityGPIO_0:1; /* Polarity GPIO#0 setting. */
|
||||||
USHORT PolarityGPIO_1:1; /* Polarity GPIO#1 setting. */
|
u16 PolarityGPIO_1:1; /* Polarity GPIO#1 setting. */
|
||||||
USHORT PolarityGPIO_2:1; /* Polarity GPIO#2 setting. */
|
u16 PolarityGPIO_2:1; /* Polarity GPIO#2 setting. */
|
||||||
USHORT PolarityGPIO_3:1; /* Polarity GPIO#3 setting. */
|
u16 PolarityGPIO_3:1; /* Polarity GPIO#3 setting. */
|
||||||
USHORT PolarityGPIO_4:1; /* Polarity GPIO#4 setting. */
|
u16 PolarityGPIO_4:1; /* Polarity GPIO#4 setting. */
|
||||||
USHORT LedMode:5; /* Led mode. */
|
u16 LedMode:5; /* Led mode. */
|
||||||
USHORT Rsvd:3; /* Reserved */
|
u16 Rsvd:3; /* Reserved */
|
||||||
} field;
|
} field;
|
||||||
USHORT word;
|
u16 word;
|
||||||
} EEPROM_LED_STRUC, *PEEPROM_LED_STRUC;
|
} EEPROM_LED_STRUC, *PEEPROM_LED_STRUC;
|
||||||
|
|
||||||
typedef union _EEPROM_TXPOWER_DELTA_STRUC {
|
typedef union _EEPROM_TXPOWER_DELTA_STRUC {
|
||||||
struct {
|
struct {
|
||||||
UCHAR DeltaValue:6; /* Tx Power dalta value (MAX=4) */
|
u8 DeltaValue:6; /* Tx Power dalta value (MAX=4) */
|
||||||
UCHAR Type:1; /* 1: plus the delta value, 0: minus the delta value */
|
u8 Type:1; /* 1: plus the delta value, 0: minus the delta value */
|
||||||
UCHAR TxPowerEnable:1; /* Enable */
|
u8 TxPowerEnable:1; /* Enable */
|
||||||
} field;
|
} field;
|
||||||
UCHAR value;
|
u8 value;
|
||||||
} EEPROM_TXPOWER_DELTA_STRUC, *PEEPROM_TXPOWER_DELTA_STRUC;
|
} EEPROM_TXPOWER_DELTA_STRUC, *PEEPROM_TXPOWER_DELTA_STRUC;
|
||||||
|
|
||||||
#endif /* __RTMP_CHIP_H__ // */
|
#endif /* __RTMP_CHIP_H__ // */
|
||||||
|
@ -39,25 +39,25 @@
|
|||||||
|
|
||||||
typedef struct _MIC_CONTEXT {
|
typedef struct _MIC_CONTEXT {
|
||||||
/* --- MMH context */
|
/* --- MMH context */
|
||||||
UCHAR CK[16]; /* the key */
|
u8 CK[16]; /* the key */
|
||||||
UCHAR coefficient[16]; /* current aes counter mode coefficients */
|
u8 coefficient[16]; /* current aes counter mode coefficients */
|
||||||
ULONGLONG accum; /* accumulated mic, reduced to u32 in final() */
|
unsigned long long accum; /* accumulated mic, reduced to u32 in final() */
|
||||||
UINT position; /* current position (byte offset) in message */
|
u32 position; /* current position (byte offset) in message */
|
||||||
UCHAR part[4]; /* for conversion of message to u32 for mmh */
|
u8 part[4]; /* for conversion of message to u32 for mmh */
|
||||||
} MIC_CONTEXT, *PMIC_CONTEXT;
|
} MIC_CONTEXT, *PMIC_CONTEXT;
|
||||||
|
|
||||||
VOID xor_128(IN PUCHAR a, IN PUCHAR b, OUT PUCHAR out);
|
void xor_128(u8 *a, u8 *b, u8 *out);
|
||||||
|
|
||||||
UCHAR RTMPCkipSbox(IN UCHAR a);
|
u8 RTMPCkipSbox(u8 a);
|
||||||
|
|
||||||
VOID xor_32(IN PUCHAR a, IN PUCHAR b, OUT PUCHAR out);
|
void xor_32(u8 *a, u8 *b, u8 *out);
|
||||||
|
|
||||||
VOID next_key(IN PUCHAR key, IN INT round);
|
void next_key(u8 *key, int round);
|
||||||
|
|
||||||
VOID byte_sub(IN PUCHAR in, OUT PUCHAR out);
|
void byte_sub(u8 *in, u8 *out);
|
||||||
|
|
||||||
VOID shift_row(IN PUCHAR in, OUT PUCHAR out);
|
void shift_row(u8 *in, u8 *out);
|
||||||
|
|
||||||
VOID mix_column(IN PUCHAR in, OUT PUCHAR out);
|
void mix_column(u8 *in, u8 *out);
|
||||||
|
|
||||||
#endif /*__RTMP_CKIPMIC_H__ */
|
#endif /*__RTMP_CKIPMIC_H__ */
|
||||||
|
@ -51,8 +51,8 @@
|
|||||||
#define RT_DEBUG_INFO 4
|
#define RT_DEBUG_INFO 4
|
||||||
#define RT_DEBUG_LOUD 5
|
#define RT_DEBUG_LOUD 5
|
||||||
|
|
||||||
#define NIC_TAG ((ULONG)'0682')
|
#define NIC_TAG ((unsigned long)'0682')
|
||||||
#define NIC_DBG_STRING ("**RT28xx**")
|
#define NIC_DBG_char ("**RT28xx**")
|
||||||
|
|
||||||
#ifdef RTMP_MAC_USB
|
#ifdef RTMP_MAC_USB
|
||||||
#define TX_RING_SIZE 8 /* 1 */
|
#define TX_RING_SIZE 8 /* 1 */
|
||||||
@ -65,9 +65,9 @@
|
|||||||
|
|
||||||
/*#define PACKED */
|
/*#define PACKED */
|
||||||
|
|
||||||
#define RALINK_2883_VERSION ((UINT32)0x28830300)
|
#define RALINK_2883_VERSION ((u32)0x28830300)
|
||||||
#define RALINK_2880E_VERSION ((UINT32)0x28720200)
|
#define RALINK_2880E_VERSION ((u32)0x28720200)
|
||||||
#define RALINK_3070_VERSION ((UINT32)0x30700200)
|
#define RALINK_3070_VERSION ((u32)0x30700200)
|
||||||
|
|
||||||
#define MAX_RX_PKT_LEN 1520
|
#define MAX_RX_PKT_LEN 1520
|
||||||
|
|
||||||
@ -453,7 +453,7 @@
|
|||||||
/* Reason code definitions */
|
/* Reason code definitions */
|
||||||
#define REASON_RESERVED 0
|
#define REASON_RESERVED 0
|
||||||
#define REASON_UNSPECIFY 1
|
#define REASON_UNSPECIFY 1
|
||||||
#define REASON_NO_LONGER_VALID 2
|
#define REASON_NO_longER_VALID 2
|
||||||
#define REASON_DEAUTH_STA_LEAVING 3
|
#define REASON_DEAUTH_STA_LEAVING 3
|
||||||
#define REASON_DISASSOC_INACTIVE 4
|
#define REASON_DISASSOC_INACTIVE 4
|
||||||
#define REASON_DISASSPC_AP_UNABLE 5
|
#define REASON_DISASSPC_AP_UNABLE 5
|
||||||
@ -533,7 +533,7 @@
|
|||||||
#define IE_TCLAS 14 /* 802.11e d9 */
|
#define IE_TCLAS 14 /* 802.11e d9 */
|
||||||
#define IE_SCHEDULE 15 /* 802.11e d9 */
|
#define IE_SCHEDULE 15 /* 802.11e d9 */
|
||||||
#define IE_CHALLENGE_TEXT 16
|
#define IE_CHALLENGE_TEXT 16
|
||||||
#define IE_POWER_CONSTRAINT 32 /* 802.11h d3.3 */
|
#define IE_POWER_CONSTRAint 32 /* 802.11h d3.3 */
|
||||||
#define IE_POWER_CAPABILITY 33 /* 802.11h d3.3 */
|
#define IE_POWER_CAPABILITY 33 /* 802.11h d3.3 */
|
||||||
#define IE_TPC_REQUEST 34 /* 802.11h d3.3 */
|
#define IE_TPC_REQUEST 34 /* 802.11h d3.3 */
|
||||||
#define IE_TPC_REPORT 35 /* 802.11h d3.3 */
|
#define IE_TPC_REPORT 35 /* 802.11h d3.3 */
|
||||||
@ -980,10 +980,10 @@
|
|||||||
#define MODE_HTGREENFIELD 3
|
#define MODE_HTGREENFIELD 3
|
||||||
|
|
||||||
/* MCS for CCK. BW.SGI.STBC are reserved */
|
/* MCS for CCK. BW.SGI.STBC are reserved */
|
||||||
#define MCS_LONGP_RATE_1 0 /* long preamble CCK 1Mbps */
|
#define MCS_longP_RATE_1 0 /* long preamble CCK 1Mbps */
|
||||||
#define MCS_LONGP_RATE_2 1 /* long preamble CCK 1Mbps */
|
#define MCS_longP_RATE_2 1 /* long preamble CCK 1Mbps */
|
||||||
#define MCS_LONGP_RATE_5_5 2
|
#define MCS_longP_RATE_5_5 2
|
||||||
#define MCS_LONGP_RATE_11 3
|
#define MCS_longP_RATE_11 3
|
||||||
#define MCS_SHORTP_RATE_1 4 /* long preamble CCK 1Mbps. short is forbidden in 1Mbps */
|
#define MCS_SHORTP_RATE_1 4 /* long preamble CCK 1Mbps. short is forbidden in 1Mbps */
|
||||||
#define MCS_SHORTP_RATE_2 5 /* short preamble CCK 2Mbps */
|
#define MCS_SHORTP_RATE_2 5 /* short preamble CCK 2Mbps */
|
||||||
#define MCS_SHORTP_RATE_5_5 6
|
#define MCS_SHORTP_RATE_5_5 6
|
||||||
@ -1109,7 +1109,7 @@
|
|||||||
#define IFS_BACKOFF 3
|
#define IFS_BACKOFF 3
|
||||||
|
|
||||||
/* pTxD->RetryMode */
|
/* pTxD->RetryMode */
|
||||||
#define LONG_RETRY 1
|
#define long_RETRY 1
|
||||||
#define SHORT_RETRY 0
|
#define SHORT_RETRY 0
|
||||||
|
|
||||||
/* Country Region definition */
|
/* Country Region definition */
|
||||||
@ -1211,7 +1211,7 @@
|
|||||||
|
|
||||||
/* ========================= AP rtmp_def.h =========================== */
|
/* ========================= AP rtmp_def.h =========================== */
|
||||||
/* value domain for pAd->EventTab.Log[].Event */
|
/* value domain for pAd->EventTab.Log[].Event */
|
||||||
#define EVENT_RESET_ACCESS_POINT 0 /* Log = "hh:mm:ss Restart Access Point" */
|
#define EVENT_RESET_ACCESS_POint 0 /* Log = "hh:mm:ss Restart Access Point" */
|
||||||
#define EVENT_ASSOCIATED 1 /* Log = "hh:mm:ss STA 00:01:02:03:04:05 associated" */
|
#define EVENT_ASSOCIATED 1 /* Log = "hh:mm:ss STA 00:01:02:03:04:05 associated" */
|
||||||
#define EVENT_DISASSOCIATED 2 /* Log = "hh:mm:ss STA 00:01:02:03:04:05 left this BSS" */
|
#define EVENT_DISASSOCIATED 2 /* Log = "hh:mm:ss STA 00:01:02:03:04:05 left this BSS" */
|
||||||
#define EVENT_AGED_OUT 3 /* Log = "hh:mm:ss STA 00:01:02:03:04:05 was aged-out and removed from this BSS" */
|
#define EVENT_AGED_OUT 3 /* Log = "hh:mm:ss STA 00:01:02:03:04:05 was aged-out and removed from this BSS" */
|
||||||
@ -1356,34 +1356,34 @@
|
|||||||
|
|
||||||
/* Endian byte swapping codes */
|
/* Endian byte swapping codes */
|
||||||
#define SWAP16(x) \
|
#define SWAP16(x) \
|
||||||
((UINT16)( \
|
((u16)( \
|
||||||
(((UINT16)(x) & (UINT16) 0x00ffU) << 8) | \
|
(((u16)(x) & (u16)0x00ffU) << 8) | \
|
||||||
(((UINT16)(x) & (UINT16) 0xff00U) >> 8) ))
|
(((u16)(x) & (u16)0xff00U) >> 8) ))
|
||||||
|
|
||||||
#define SWAP32(x) \
|
#define SWAP32(x) \
|
||||||
((UINT32)( \
|
((u32)( \
|
||||||
(((UINT32)(x) & (UINT32) 0x000000ffUL) << 24) | \
|
(((u32)(x) & (u32)0x000000ffUL) << 24) | \
|
||||||
(((UINT32)(x) & (UINT32) 0x0000ff00UL) << 8) | \
|
(((u32)(x) & (u32)0x0000ff00UL) << 8) | \
|
||||||
(((UINT32)(x) & (UINT32) 0x00ff0000UL) >> 8) | \
|
(((u32)(x) & (u32)0x00ff0000UL) >> 8) | \
|
||||||
(((UINT32)(x) & (UINT32) 0xff000000UL) >> 24) ))
|
(((u32)(x) & (u32)0xff000000UL) >> 24) ))
|
||||||
|
|
||||||
#define SWAP64(x) \
|
#define SWAP64(x) \
|
||||||
((UINT64)( \
|
((u64)( \
|
||||||
(UINT64)(((UINT64)(x) & (UINT64) 0x00000000000000ffULL) << 56) | \
|
(u64)(((u64)(x) & (u64)0x00000000000000ffULL) << 56) | \
|
||||||
(UINT64)(((UINT64)(x) & (UINT64) 0x000000000000ff00ULL) << 40) | \
|
(u64)(((u64)(x) & (u64)0x000000000000ff00ULL) << 40) | \
|
||||||
(UINT64)(((UINT64)(x) & (UINT64) 0x0000000000ff0000ULL) << 24) | \
|
(u64)(((u64)(x) & (u64)0x0000000000ff0000ULL) << 24) | \
|
||||||
(UINT64)(((UINT64)(x) & (UINT64) 0x00000000ff000000ULL) << 8) | \
|
(u64)(((u64)(x) & (u64)0x00000000ff000000ULL) << 8) | \
|
||||||
(UINT64)(((UINT64)(x) & (UINT64) 0x000000ff00000000ULL) >> 8) | \
|
(u64)(((u64)(x) & (u64)0x000000ff00000000ULL) >> 8) | \
|
||||||
(UINT64)(((UINT64)(x) & (UINT64) 0x0000ff0000000000ULL) >> 24) | \
|
(u64)(((u64)(x) & (u64)0x0000ff0000000000ULL) >> 24) | \
|
||||||
(UINT64)(((UINT64)(x) & (UINT64) 0x00ff000000000000ULL) >> 40) | \
|
(u64)(((u64)(x) & (u64)0x00ff000000000000ULL) >> 40) | \
|
||||||
(UINT64)(((UINT64)(x) & (UINT64) 0xff00000000000000ULL) >> 56) ))
|
(u64)(((u64)(x) & (u64)0xff00000000000000ULL) >> 56) ))
|
||||||
|
|
||||||
#define cpu2le64(x) ((UINT64)(x))
|
#define cpu2le64(x) ((u64)(x))
|
||||||
#define le2cpu64(x) ((UINT64)(x))
|
#define le2cpu64(x) ((u64)(x))
|
||||||
#define cpu2le32(x) ((UINT32)(x))
|
#define cpu2le32(x) ((u32)(x))
|
||||||
#define le2cpu32(x) ((UINT32)(x))
|
#define le2cpu32(x) ((u32)(x))
|
||||||
#define cpu2le16(x) ((UINT16)(x))
|
#define cpu2le16(x) ((u16)(x))
|
||||||
#define le2cpu16(x) ((UINT16)(x))
|
#define le2cpu16(x) ((u16)(x))
|
||||||
#define cpu2be64(x) SWAP64((x))
|
#define cpu2be64(x) SWAP64((x))
|
||||||
#define be2cpu64(x) SWAP64((x))
|
#define be2cpu64(x) SWAP64((x))
|
||||||
#define cpu2be32(x) SWAP32((x))
|
#define cpu2be32(x) SWAP32((x))
|
||||||
@ -1395,7 +1395,7 @@
|
|||||||
|
|
||||||
#define A2Dec(_X, _p) \
|
#define A2Dec(_X, _p) \
|
||||||
{ \
|
{ \
|
||||||
UCHAR *p; \
|
u8 *p; \
|
||||||
_X = 0; \
|
_X = 0; \
|
||||||
p = _p; \
|
p = _p; \
|
||||||
while (((*p >= '0') && (*p <= '9'))) \
|
while (((*p >= '0') && (*p <= '9'))) \
|
||||||
|
@ -32,69 +32,69 @@
|
|||||||
|
|
||||||
/* 4-byte HTC field. maybe included in any frame except non-QOS data frame. The Order bit must set 1. */
|
/* 4-byte HTC field. maybe included in any frame except non-QOS data frame. The Order bit must set 1. */
|
||||||
typedef struct PACKED {
|
typedef struct PACKED {
|
||||||
UINT32 MA:1; /*management action payload exist in (QoS Null+HTC) */
|
u32 MA:1; /*management action payload exist in (QoS Null+HTC) */
|
||||||
UINT32 TRQ:1; /*sounding request */
|
u32 TRQ:1; /*sounding request */
|
||||||
UINT32 MRQ:1; /*MCS feedback. Request for a MCS feedback */
|
u32 MRQ:1; /*MCS feedback. Request for a MCS feedback */
|
||||||
UINT32 MRSorASI:3; /* MRQ Sequence identifier. unchanged during entire procedure. 0x000-0x110. */
|
u32 MRSorASI:3; /* MRQ Sequence identifier. unchanged during entire procedure. 0x000-0x110. */
|
||||||
UINT32 MFS:3; /*SET to the received value of MRS. 0x111 for unsolicited MFB. */
|
u32 MFS:3; /*SET to the received value of MRS. 0x111 for unsolicited MFB. */
|
||||||
UINT32 MFBorASC:7; /*Link adaptation feedback containing recommended MCS. 0x7f for no feedback or not available */
|
u32 MFBorASC:7; /*Link adaptation feedback containing recommended MCS. 0x7f for no feedback or not available */
|
||||||
UINT32 CalPos:2; /* calibration position */
|
u32 CalPos:2; /* calibration position */
|
||||||
UINT32 CalSeq:2; /*calibration sequence */
|
u32 CalSeq:2; /*calibration sequence */
|
||||||
UINT32 FBKReq:2; /*feedback request */
|
u32 FBKReq:2; /*feedback request */
|
||||||
UINT32 CSISTEERING:2; /*CSI/ STEERING */
|
u32 CSISTEERING:2; /*CSI/ STEERING */
|
||||||
UINT32 ZLFAnnouce:1; /* ZLF announcement */
|
u32 ZLFAnnouce:1; /* ZLF announcement */
|
||||||
UINT32 rsv:5; /*calibration sequence */
|
u32 rsv:5; /*calibration sequence */
|
||||||
UINT32 ACConstraint:1; /*feedback request */
|
u32 ACConstraint:1; /*feedback request */
|
||||||
UINT32 RDG:1; /*RDG / More PPDU */
|
u32 RDG:1; /*RDG / More PPDU */
|
||||||
} HT_CONTROL, *PHT_CONTROL;
|
} HT_CONTROL, *PHT_CONTROL;
|
||||||
|
|
||||||
/* 2-byte QOS CONTROL field */
|
/* 2-byte QOS CONTROL field */
|
||||||
typedef struct PACKED {
|
typedef struct PACKED {
|
||||||
USHORT TID:4;
|
u16 TID:4;
|
||||||
USHORT EOSP:1;
|
u16 EOSP:1;
|
||||||
USHORT AckPolicy:2; /*0: normal ACK 1:No ACK 2:scheduled under MTBA/PSMP 3: BA */
|
u16 AckPolicy:2; /*0: normal ACK 1:No ACK 2:scheduled under MTBA/PSMP 3: BA */
|
||||||
USHORT AMsduPresent:1;
|
u16 AMsduPresent:1;
|
||||||
USHORT Txop_QueueSize:8;
|
u16 Txop_QueueSize:8;
|
||||||
} QOS_CONTROL, *PQOS_CONTROL;
|
} QOS_CONTROL, *PQOS_CONTROL;
|
||||||
|
|
||||||
/* 2-byte Frame control field */
|
/* 2-byte Frame control field */
|
||||||
typedef struct PACKED {
|
typedef struct PACKED {
|
||||||
USHORT Ver:2; /* Protocol version */
|
u16 Ver:2; /* Protocol version */
|
||||||
USHORT Type:2; /* MSDU type */
|
u16 Type:2; /* MSDU type */
|
||||||
USHORT SubType:4; /* MSDU subtype */
|
u16 SubType:4; /* MSDU subtype */
|
||||||
USHORT ToDs:1; /* To DS indication */
|
u16 ToDs:1; /* To DS indication */
|
||||||
USHORT FrDs:1; /* From DS indication */
|
u16 FrDs:1; /* From DS indication */
|
||||||
USHORT MoreFrag:1; /* More fragment bit */
|
u16 MoreFrag:1; /* More fragment bit */
|
||||||
USHORT Retry:1; /* Retry status bit */
|
u16 Retry:1; /* Retry status bit */
|
||||||
USHORT PwrMgmt:1; /* Power management bit */
|
u16 PwrMgmt:1; /* Power management bit */
|
||||||
USHORT MoreData:1; /* More data bit */
|
u16 MoreData:1; /* More data bit */
|
||||||
USHORT Wep:1; /* Wep data */
|
u16 Wep:1; /* Wep data */
|
||||||
USHORT Order:1; /* Strict order expected */
|
u16 Order:1; /* Strict order expected */
|
||||||
} FRAME_CONTROL, *PFRAME_CONTROL;
|
} FRAME_CONTROL, *PFRAME_CONTROL;
|
||||||
|
|
||||||
typedef struct PACKED _HEADER_802_11 {
|
typedef struct PACKED _HEADER_802_11 {
|
||||||
FRAME_CONTROL FC;
|
FRAME_CONTROL FC;
|
||||||
USHORT Duration;
|
u16 Duration;
|
||||||
UCHAR Addr1[MAC_ADDR_LEN];
|
u8 Addr1[MAC_ADDR_LEN];
|
||||||
UCHAR Addr2[MAC_ADDR_LEN];
|
u8 Addr2[MAC_ADDR_LEN];
|
||||||
UCHAR Addr3[MAC_ADDR_LEN];
|
u8 Addr3[MAC_ADDR_LEN];
|
||||||
USHORT Frag:4;
|
u16 Frag:4;
|
||||||
USHORT Sequence:12;
|
u16 Sequence:12;
|
||||||
UCHAR Octet[0];
|
u8 Octet[0];
|
||||||
} HEADER_802_11, *PHEADER_802_11;
|
} HEADER_802_11, *PHEADER_802_11;
|
||||||
|
|
||||||
typedef struct PACKED _PSPOLL_FRAME {
|
typedef struct PACKED _PSPOLL_FRAME {
|
||||||
FRAME_CONTROL FC;
|
FRAME_CONTROL FC;
|
||||||
USHORT Aid;
|
u16 Aid;
|
||||||
UCHAR Bssid[MAC_ADDR_LEN];
|
u8 Bssid[MAC_ADDR_LEN];
|
||||||
UCHAR Ta[MAC_ADDR_LEN];
|
u8 Ta[MAC_ADDR_LEN];
|
||||||
} PSPOLL_FRAME, *PPSPOLL_FRAME;
|
} PSPOLL_FRAME, *PPSPOLL_FRAME;
|
||||||
|
|
||||||
typedef struct PACKED _RTS_FRAME {
|
typedef struct PACKED _RTS_FRAME {
|
||||||
FRAME_CONTROL FC;
|
FRAME_CONTROL FC;
|
||||||
USHORT Duration;
|
u16 Duration;
|
||||||
UCHAR Addr1[MAC_ADDR_LEN];
|
u8 Addr1[MAC_ADDR_LEN];
|
||||||
UCHAR Addr2[MAC_ADDR_LEN];
|
u8 Addr2[MAC_ADDR_LEN];
|
||||||
} RTS_FRAME, *PRTS_FRAME;
|
} RTS_FRAME, *PRTS_FRAME;
|
||||||
|
|
||||||
#endif /* __DOT11_BASE_H__ // */
|
#endif /* __DOT11_BASE_H__ // */
|
||||||
|
@ -50,8 +50,8 @@ typedef struct _INF_PCI_CONFIG_ {
|
|||||||
} INF_PCI_CONFIG;
|
} INF_PCI_CONFIG;
|
||||||
|
|
||||||
typedef struct _INF_USB_CONFIG_ {
|
typedef struct _INF_USB_CONFIG_ {
|
||||||
UINT8 BulkInEpAddr; /* bulk-in endpoint address */
|
u8 BulkInEpAddr; /* bulk-in endpoint address */
|
||||||
UINT8 BulkOutEpAddr[6]; /* bulk-out endpoint address */
|
u8 BulkOutEpAddr[6]; /* bulk-out endpoint address */
|
||||||
} INF_USB_CONFIG;
|
} INF_USB_CONFIG;
|
||||||
|
|
||||||
typedef struct _INF_RBUS_CONFIG_ {
|
typedef struct _INF_RBUS_CONFIG_ {
|
||||||
|
@ -38,12 +38,12 @@
|
|||||||
#ifndef __RTMP_MCU_H__
|
#ifndef __RTMP_MCU_H__
|
||||||
#define __RTMP_MCU_H__
|
#define __RTMP_MCU_H__
|
||||||
|
|
||||||
INT RtmpAsicEraseFirmware(IN PRTMP_ADAPTER pAd);
|
int RtmpAsicEraseFirmware(IN PRTMP_ADAPTER pAd);
|
||||||
|
|
||||||
NDIS_STATUS RtmpAsicLoadFirmware(IN PRTMP_ADAPTER pAd);
|
int RtmpAsicLoadFirmware(IN PRTMP_ADAPTER pAd);
|
||||||
|
|
||||||
INT RtmpAsicSendCommandToMcu(IN PRTMP_ADAPTER pAd,
|
int RtmpAsicSendCommandToMcu(IN PRTMP_ADAPTER pAd,
|
||||||
IN UCHAR Command,
|
u8 Command,
|
||||||
IN UCHAR Token, IN UCHAR Arg0, IN UCHAR Arg1);
|
u8 Token, u8 Arg0, u8 Arg1);
|
||||||
|
|
||||||
#endif /* __RTMP_MCU_H__ // */
|
#endif /* __RTMP_MCU_H__ // */
|
||||||
|
@ -55,10 +55,10 @@
|
|||||||
/* submit to ctrl pipe). So we need a wrapper function to take care it. */
|
/* submit to ctrl pipe). So we need a wrapper function to take care it. */
|
||||||
|
|
||||||
#ifdef RTMP_TIMER_TASK_SUPPORT
|
#ifdef RTMP_TIMER_TASK_SUPPORT
|
||||||
typedef VOID(*RTMP_TIMER_TASK_HANDLE) (IN PVOID SystemSpecific1,
|
typedef void(*RTMP_TIMER_TASK_HANDLE) (void *SystemSpecific1,
|
||||||
IN PVOID FunctionContext,
|
void *FunctionContext,
|
||||||
IN PVOID SystemSpecific2,
|
void *SystemSpecific2,
|
||||||
IN PVOID SystemSpecific3);
|
void *SystemSpecific3);
|
||||||
#endif /* RTMP_TIMER_TASK_SUPPORT // */
|
#endif /* RTMP_TIMER_TASK_SUPPORT // */
|
||||||
|
|
||||||
typedef struct _RALINK_TIMER_STRUCT {
|
typedef struct _RALINK_TIMER_STRUCT {
|
||||||
@ -67,8 +67,8 @@ typedef struct _RALINK_TIMER_STRUCT {
|
|||||||
BOOLEAN State; /* True if timer cancelled */
|
BOOLEAN State; /* True if timer cancelled */
|
||||||
BOOLEAN PeriodicType; /* True if timer is periodic timer */
|
BOOLEAN PeriodicType; /* True if timer is periodic timer */
|
||||||
BOOLEAN Repeat; /* True if periodic timer */
|
BOOLEAN Repeat; /* True if periodic timer */
|
||||||
ULONG TimerValue; /* Timer value in milliseconds */
|
unsigned long TimerValue; /* Timer value in milliseconds */
|
||||||
ULONG cookie; /* os specific object */
|
unsigned long cookie; /* os specific object */
|
||||||
#ifdef RTMP_TIMER_TASK_SUPPORT
|
#ifdef RTMP_TIMER_TASK_SUPPORT
|
||||||
RTMP_TIMER_TASK_HANDLE handle;
|
RTMP_TIMER_TASK_HANDLE handle;
|
||||||
void *pAd;
|
void *pAd;
|
||||||
@ -109,7 +109,7 @@ void rtmp_timer_##_func(unsigned long data) \
|
|||||||
{ \
|
{ \
|
||||||
PRALINK_TIMER_STRUCT pTimer = (PRALINK_TIMER_STRUCT) data; \
|
PRALINK_TIMER_STRUCT pTimer = (PRALINK_TIMER_STRUCT) data; \
|
||||||
\
|
\
|
||||||
_func(NULL, (PVOID) pTimer->cookie, NULL, pTimer); \
|
_func(NULL, (void *)pTimer->cookie, NULL, pTimer); \
|
||||||
if (pTimer->Repeat) \
|
if (pTimer->Repeat) \
|
||||||
RTMP_OS_Add_Timer(&pTimer->TimerObj, pTimer->TimerValue); \
|
RTMP_OS_Add_Timer(&pTimer->TimerObj, pTimer->TimerValue); \
|
||||||
}
|
}
|
||||||
|
@ -38,100 +38,51 @@
|
|||||||
#ifndef __RTMP_TYPE_H__
|
#ifndef __RTMP_TYPE_H__
|
||||||
#define __RTMP_TYPE_H__
|
#define __RTMP_TYPE_H__
|
||||||
|
|
||||||
|
#include <linux/types.h>
|
||||||
|
|
||||||
#define PACKED __attribute__ ((packed))
|
#define PACKED __attribute__ ((packed))
|
||||||
|
|
||||||
#ifdef LINUX
|
|
||||||
/* Put platform dependent declaration here */
|
|
||||||
/* For example, linux type definition */
|
|
||||||
typedef unsigned char UINT8;
|
|
||||||
typedef unsigned short UINT16;
|
|
||||||
typedef unsigned int UINT32;
|
|
||||||
typedef unsigned long long UINT64;
|
|
||||||
typedef int INT32;
|
|
||||||
typedef long long INT64;
|
|
||||||
#endif /* LINUX // */
|
|
||||||
|
|
||||||
typedef unsigned char *PUINT8;
|
|
||||||
typedef unsigned short *PUINT16;
|
|
||||||
typedef unsigned int *PUINT32;
|
|
||||||
typedef unsigned long long *PUINT64;
|
|
||||||
typedef int *PINT32;
|
|
||||||
typedef long long *PINT64;
|
|
||||||
|
|
||||||
/* modified for fixing compile warning on Sigma 8634 platform */
|
|
||||||
typedef char STRING;
|
|
||||||
typedef signed char CHAR;
|
|
||||||
|
|
||||||
typedef signed short SHORT;
|
|
||||||
typedef signed int INT;
|
|
||||||
typedef signed long LONG;
|
|
||||||
typedef signed long long LONGLONG;
|
|
||||||
|
|
||||||
#ifdef LINUX
|
|
||||||
typedef unsigned char UCHAR;
|
|
||||||
typedef unsigned short USHORT;
|
|
||||||
typedef unsigned int UINT;
|
|
||||||
typedef unsigned long ULONG;
|
|
||||||
#endif /* LINUX // */
|
|
||||||
typedef unsigned long long ULONGLONG;
|
|
||||||
|
|
||||||
typedef unsigned char BOOLEAN;
|
typedef unsigned char BOOLEAN;
|
||||||
#ifdef LINUX
|
|
||||||
typedef void VOID;
|
|
||||||
#endif /* LINUX // */
|
|
||||||
|
|
||||||
typedef char *PSTRING;
|
|
||||||
typedef VOID *PVOID;
|
|
||||||
typedef CHAR *PCHAR;
|
|
||||||
typedef UCHAR *PUCHAR;
|
|
||||||
typedef USHORT *PUSHORT;
|
|
||||||
typedef LONG *PLONG;
|
|
||||||
typedef ULONG *PULONG;
|
|
||||||
typedef UINT *PUINT;
|
|
||||||
|
|
||||||
typedef unsigned int NDIS_MEDIA_STATE;
|
|
||||||
|
|
||||||
typedef union _LARGE_INTEGER {
|
typedef union _LARGE_INTEGER {
|
||||||
struct {
|
struct {
|
||||||
UINT LowPart;
|
u32 LowPart;
|
||||||
INT32 HighPart;
|
int HighPart;
|
||||||
} u;
|
} u;
|
||||||
INT64 QuadPart;
|
long long QuadPart;
|
||||||
} LARGE_INTEGER;
|
} LARGE_INTEGER;
|
||||||
|
|
||||||
/* */
|
/* */
|
||||||
/* Register set pair for initialzation register set definition */
|
/* Register set pair for initialzation register set definition */
|
||||||
/* */
|
/* */
|
||||||
typedef struct _RTMP_REG_PAIR {
|
typedef struct _RTMP_REG_PAIR {
|
||||||
ULONG Register;
|
unsigned long Register;
|
||||||
ULONG Value;
|
unsigned long Value;
|
||||||
} RTMP_REG_PAIR, *PRTMP_REG_PAIR;
|
} RTMP_REG_PAIR, *PRTMP_REG_PAIR;
|
||||||
|
|
||||||
typedef struct _REG_PAIR {
|
typedef struct _REG_PAIR {
|
||||||
UCHAR Register;
|
u8 Register;
|
||||||
UCHAR Value;
|
u8 Value;
|
||||||
} REG_PAIR, *PREG_PAIR;
|
} REG_PAIR, *PREG_PAIR;
|
||||||
|
|
||||||
/* */
|
/* */
|
||||||
/* Register set pair for initialzation register set definition */
|
/* Register set pair for initialzation register set definition */
|
||||||
/* */
|
/* */
|
||||||
typedef struct _RTMP_RF_REGS {
|
typedef struct _RTMP_RF_REGS {
|
||||||
UCHAR Channel;
|
u8 Channel;
|
||||||
ULONG R1;
|
unsigned long R1;
|
||||||
ULONG R2;
|
unsigned long R2;
|
||||||
ULONG R3;
|
unsigned long R3;
|
||||||
ULONG R4;
|
unsigned long R4;
|
||||||
} RTMP_RF_REGS, *PRTMP_RF_REGS;
|
} RTMP_RF_REGS, *PRTMP_RF_REGS;
|
||||||
|
|
||||||
typedef struct _FREQUENCY_ITEM {
|
typedef struct _FREQUENCY_ITEM {
|
||||||
UCHAR Channel;
|
u8 Channel;
|
||||||
UCHAR N;
|
u8 N;
|
||||||
UCHAR R;
|
u8 R;
|
||||||
UCHAR K;
|
u8 K;
|
||||||
} FREQUENCY_ITEM, *PFREQUENCY_ITEM;
|
} FREQUENCY_ITEM, *PFREQUENCY_ITEM;
|
||||||
|
|
||||||
typedef int NTSTATUS;
|
|
||||||
|
|
||||||
#define STATUS_SUCCESS 0x00
|
#define STATUS_SUCCESS 0x00
|
||||||
#define STATUS_UNSUCCESSFUL 0x01
|
#define STATUS_UNSUCCESSFUL 0x01
|
||||||
|
|
||||||
|
@ -79,25 +79,25 @@
|
|||||||
/*CMDTHREAD_VENDOR_EEPROM_READ */
|
/*CMDTHREAD_VENDOR_EEPROM_READ */
|
||||||
/*CMDTHREAD_VENDOR_EEPROM_WRITE */
|
/*CMDTHREAD_VENDOR_EEPROM_WRITE */
|
||||||
typedef struct _CMDHandler_TLV {
|
typedef struct _CMDHandler_TLV {
|
||||||
USHORT Offset;
|
u16 Offset;
|
||||||
USHORT Length;
|
u16 Length;
|
||||||
UCHAR DataFirst;
|
u8 DataFirst;
|
||||||
} CMDHandler_TLV, *PCMDHandler_TLV;
|
} CMDHandler_TLV, *PCMDHandler_TLV;
|
||||||
|
|
||||||
typedef struct _CmdQElmt {
|
typedef struct _CmdQElmt {
|
||||||
UINT command;
|
u32 command;
|
||||||
PVOID buffer;
|
void *buffer;
|
||||||
ULONG bufferlength;
|
unsigned long bufferlength;
|
||||||
BOOLEAN CmdFromNdis;
|
BOOLEAN CmdFromNdis;
|
||||||
BOOLEAN SetOperation;
|
BOOLEAN SetOperation;
|
||||||
struct _CmdQElmt *next;
|
struct _CmdQElmt *next;
|
||||||
} CmdQElmt, *PCmdQElmt;
|
} CmdQElmt, *PCmdQElmt;
|
||||||
|
|
||||||
typedef struct _CmdQ {
|
typedef struct _CmdQ {
|
||||||
UINT size;
|
u32 size;
|
||||||
CmdQElmt *head;
|
CmdQElmt *head;
|
||||||
CmdQElmt *tail;
|
CmdQElmt *tail;
|
||||||
UINT32 CmdQState;
|
u32 CmdQState;
|
||||||
} CmdQ, *PCmdQ;
|
} CmdQ, *PCmdQ;
|
||||||
|
|
||||||
#define EnqueueCmd(cmdq, cmdqelmt) \
|
#define EnqueueCmd(cmdq, cmdqelmt) \
|
||||||
|
@ -31,7 +31,7 @@
|
|||||||
#include "rtmp_type.h"
|
#include "rtmp_type.h"
|
||||||
#include "spectrum_def.h"
|
#include "spectrum_def.h"
|
||||||
|
|
||||||
CHAR RTMP_GetTxPwr(IN PRTMP_ADAPTER pAd, IN HTTRANSMIT_SETTING HTTxMode);
|
char RTMP_GetTxPwr(IN PRTMP_ADAPTER pAd, IN HTTRANSMIT_SETTING HTTxMode);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
==========================================================================
|
==========================================================================
|
||||||
@ -45,16 +45,16 @@ CHAR RTMP_GetTxPwr(IN PRTMP_ADAPTER pAd, IN HTTRANSMIT_SETTING HTTxMode);
|
|||||||
Return : None.
|
Return : None.
|
||||||
==========================================================================
|
==========================================================================
|
||||||
*/
|
*/
|
||||||
VOID MakeMeasurementReqFrame(IN PRTMP_ADAPTER pAd,
|
void MakeMeasurementReqFrame(IN PRTMP_ADAPTER pAd,
|
||||||
OUT PUCHAR pOutBuffer,
|
u8 *pOutBuffer,
|
||||||
OUT PULONG pFrameLen,
|
unsigned long *pFrameLen,
|
||||||
IN UINT8 TotalLen,
|
u8 TotalLen,
|
||||||
IN UINT8 Category,
|
u8 Category,
|
||||||
IN UINT8 Action,
|
u8 Action,
|
||||||
IN UINT8 MeasureToken,
|
u8 MeasureToken,
|
||||||
IN UINT8 MeasureReqMode,
|
u8 MeasureReqMode,
|
||||||
IN UINT8 MeasureReqType,
|
u8 MeasureReqType,
|
||||||
IN UINT8 NumOfRepetitions);
|
u8 NumOfRepetitions);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
==========================================================================
|
==========================================================================
|
||||||
@ -68,13 +68,13 @@ VOID MakeMeasurementReqFrame(IN PRTMP_ADAPTER pAd,
|
|||||||
Return : None.
|
Return : None.
|
||||||
==========================================================================
|
==========================================================================
|
||||||
*/
|
*/
|
||||||
VOID EnqueueMeasurementRep(IN PRTMP_ADAPTER pAd,
|
void EnqueueMeasurementRep(IN PRTMP_ADAPTER pAd,
|
||||||
IN PUCHAR pDA,
|
u8 *pDA,
|
||||||
IN UINT8 DialogToken,
|
u8 DialogToken,
|
||||||
IN UINT8 MeasureToken,
|
u8 MeasureToken,
|
||||||
IN UINT8 MeasureReqMode,
|
u8 MeasureReqMode,
|
||||||
IN UINT8 MeasureReqType,
|
u8 MeasureReqType,
|
||||||
IN UINT8 ReportInfoLen, IN PUINT8 pReportInfo);
|
u8 ReportInfoLen, u8 *pReportInfo);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
==========================================================================
|
==========================================================================
|
||||||
@ -88,7 +88,7 @@ VOID EnqueueMeasurementRep(IN PRTMP_ADAPTER pAd,
|
|||||||
Return : None.
|
Return : None.
|
||||||
==========================================================================
|
==========================================================================
|
||||||
*/
|
*/
|
||||||
VOID EnqueueTPCReq(IN PRTMP_ADAPTER pAd, IN PUCHAR pDA, IN UCHAR DialogToken);
|
void EnqueueTPCReq(IN PRTMP_ADAPTER pAd, u8 *pDA, u8 DialogToken);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
==========================================================================
|
==========================================================================
|
||||||
@ -102,9 +102,9 @@ VOID EnqueueTPCReq(IN PRTMP_ADAPTER pAd, IN PUCHAR pDA, IN UCHAR DialogToken);
|
|||||||
Return : None.
|
Return : None.
|
||||||
==========================================================================
|
==========================================================================
|
||||||
*/
|
*/
|
||||||
VOID EnqueueTPCRep(IN PRTMP_ADAPTER pAd,
|
void EnqueueTPCRep(IN PRTMP_ADAPTER pAd,
|
||||||
IN PUCHAR pDA,
|
u8 *pDA,
|
||||||
IN UINT8 DialogToken, IN UINT8 TxPwr, IN UINT8 LinkMargin);
|
u8 DialogToken, u8 TxPwr, u8 LinkMargin);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
==========================================================================
|
==========================================================================
|
||||||
@ -120,8 +120,8 @@ VOID EnqueueTPCRep(IN PRTMP_ADAPTER pAd,
|
|||||||
Return : None.
|
Return : None.
|
||||||
==========================================================================
|
==========================================================================
|
||||||
*/
|
*/
|
||||||
VOID EnqueueChSwAnn(IN PRTMP_ADAPTER pAd,
|
void EnqueueChSwAnn(IN PRTMP_ADAPTER pAd,
|
||||||
IN PUCHAR pDA, IN UINT8 ChSwMode, IN UINT8 NewCh);
|
u8 *pDA, u8 ChSwMode, u8 NewCh);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
==========================================================================
|
==========================================================================
|
||||||
@ -135,7 +135,7 @@ VOID EnqueueChSwAnn(IN PRTMP_ADAPTER pAd,
|
|||||||
Return : None.
|
Return : None.
|
||||||
==========================================================================
|
==========================================================================
|
||||||
*/
|
*/
|
||||||
VOID PeerSpectrumAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem);
|
void PeerSpectrumAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
==========================================================================
|
==========================================================================
|
||||||
@ -146,44 +146,44 @@ VOID PeerSpectrumAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem);
|
|||||||
Return : None.
|
Return : None.
|
||||||
==========================================================================
|
==========================================================================
|
||||||
*/
|
*/
|
||||||
INT Set_MeasureReq_Proc(IN PRTMP_ADAPTER pAd, IN PSTRING arg);
|
int Set_MeasureReq_Proc(IN PRTMP_ADAPTER pAd, char *arg);
|
||||||
|
|
||||||
INT Set_TpcReq_Proc(IN PRTMP_ADAPTER pAd, IN PSTRING arg);
|
int Set_TpcReq_Proc(IN PRTMP_ADAPTER pAd, char *arg);
|
||||||
|
|
||||||
INT Set_PwrConstraint(IN PRTMP_ADAPTER pAd, IN PSTRING arg);
|
int Set_PwrConstraint(IN PRTMP_ADAPTER pAd, char *arg);
|
||||||
|
|
||||||
VOID MeasureReqTabInit(IN PRTMP_ADAPTER pAd);
|
void MeasureReqTabInit(IN PRTMP_ADAPTER pAd);
|
||||||
|
|
||||||
VOID MeasureReqTabExit(IN PRTMP_ADAPTER pAd);
|
void MeasureReqTabExit(IN PRTMP_ADAPTER pAd);
|
||||||
|
|
||||||
PMEASURE_REQ_ENTRY MeasureReqLookUp(IN PRTMP_ADAPTER pAd, IN UINT8 DialogToken);
|
PMEASURE_REQ_ENTRY MeasureReqLookUp(IN PRTMP_ADAPTER pAd, u8 DialogToken);
|
||||||
|
|
||||||
PMEASURE_REQ_ENTRY MeasureReqInsert(IN PRTMP_ADAPTER pAd, IN UINT8 DialogToken);
|
PMEASURE_REQ_ENTRY MeasureReqInsert(IN PRTMP_ADAPTER pAd, u8 DialogToken);
|
||||||
|
|
||||||
VOID MeasureReqDelete(IN PRTMP_ADAPTER pAd, IN UINT8 DialogToken);
|
void MeasureReqDelete(IN PRTMP_ADAPTER pAd, u8 DialogToken);
|
||||||
|
|
||||||
VOID InsertChannelRepIE(IN PRTMP_ADAPTER pAd,
|
void InsertChannelRepIE(IN PRTMP_ADAPTER pAd,
|
||||||
OUT PUCHAR pFrameBuf,
|
u8 *pFrameBuf,
|
||||||
OUT PULONG pFrameLen,
|
unsigned long *pFrameLen,
|
||||||
IN PSTRING pCountry, IN UINT8 RegulatoryClass);
|
char *pCountry, u8 RegulatoryClass);
|
||||||
|
|
||||||
VOID InsertTpcReportIE(IN PRTMP_ADAPTER pAd,
|
void InsertTpcReportIE(IN PRTMP_ADAPTER pAd,
|
||||||
OUT PUCHAR pFrameBuf,
|
u8 *pFrameBuf,
|
||||||
OUT PULONG pFrameLen,
|
unsigned long *pFrameLen,
|
||||||
IN UINT8 TxPwr, IN UINT8 LinkMargin);
|
u8 TxPwr, u8 LinkMargin);
|
||||||
|
|
||||||
VOID InsertDialogToken(IN PRTMP_ADAPTER pAd,
|
void InsertDialogToken(IN PRTMP_ADAPTER pAd,
|
||||||
OUT PUCHAR pFrameBuf,
|
u8 *pFrameBuf,
|
||||||
OUT PULONG pFrameLen, IN UINT8 DialogToken);
|
unsigned long *pFrameLen, u8 DialogToken);
|
||||||
|
|
||||||
VOID TpcReqTabInit(IN PRTMP_ADAPTER pAd);
|
void TpcReqTabInit(IN PRTMP_ADAPTER pAd);
|
||||||
|
|
||||||
VOID TpcReqTabExit(IN PRTMP_ADAPTER pAd);
|
void TpcReqTabExit(IN PRTMP_ADAPTER pAd);
|
||||||
|
|
||||||
VOID NotifyChSwAnnToPeerAPs(IN PRTMP_ADAPTER pAd,
|
void NotifyChSwAnnToPeerAPs(IN PRTMP_ADAPTER pAd,
|
||||||
IN PUCHAR pRA,
|
u8 *pRA,
|
||||||
IN PUCHAR pTA, IN UINT8 ChSwMode, IN UINT8 Channel);
|
u8 *pTA, u8 ChSwMode, u8 Channel);
|
||||||
|
|
||||||
VOID RguClass_BuildBcnChList(IN PRTMP_ADAPTER pAd,
|
void RguClass_BuildBcnChList(IN PRTMP_ADAPTER pAd,
|
||||||
OUT PUCHAR pBuf, OUT PULONG pBufLen);
|
u8 *pBuf, unsigned long *pBufLen);
|
||||||
#endif /* __SPECTRUM_H__ // */
|
#endif /* __SPECTRUM_H__ // */
|
||||||
|
@ -55,40 +55,40 @@
|
|||||||
|
|
||||||
typedef struct _MEASURE_REQ_ENTRY {
|
typedef struct _MEASURE_REQ_ENTRY {
|
||||||
struct _MEASURE_REQ_ENTRY *pNext;
|
struct _MEASURE_REQ_ENTRY *pNext;
|
||||||
ULONG lastTime;
|
unsigned long lastTime;
|
||||||
BOOLEAN Valid;
|
BOOLEAN Valid;
|
||||||
UINT8 DialogToken;
|
u8 DialogToken;
|
||||||
UINT8 MeasureDialogToken[3]; /* 0:basic measure, 1: CCA measure, 2: RPI_Histogram measure. */
|
u8 MeasureDialogToken[3]; /* 0:basic measure, 1: CCA measure, 2: RPI_Histogram measure. */
|
||||||
} MEASURE_REQ_ENTRY, *PMEASURE_REQ_ENTRY;
|
} MEASURE_REQ_ENTRY, *PMEASURE_REQ_ENTRY;
|
||||||
|
|
||||||
typedef struct _MEASURE_REQ_TAB {
|
typedef struct _MEASURE_REQ_TAB {
|
||||||
UCHAR Size;
|
u8 Size;
|
||||||
PMEASURE_REQ_ENTRY Hash[MAX_HASH_MEASURE_REQ_TAB_SIZE];
|
PMEASURE_REQ_ENTRY Hash[MAX_HASH_MEASURE_REQ_TAB_SIZE];
|
||||||
MEASURE_REQ_ENTRY Content[MAX_MEASURE_REQ_TAB_SIZE];
|
MEASURE_REQ_ENTRY Content[MAX_MEASURE_REQ_TAB_SIZE];
|
||||||
} MEASURE_REQ_TAB, *PMEASURE_REQ_TAB;
|
} MEASURE_REQ_TAB, *PMEASURE_REQ_TAB;
|
||||||
|
|
||||||
typedef struct _TPC_REQ_ENTRY {
|
typedef struct _TPC_REQ_ENTRY {
|
||||||
struct _TPC_REQ_ENTRY *pNext;
|
struct _TPC_REQ_ENTRY *pNext;
|
||||||
ULONG lastTime;
|
unsigned long lastTime;
|
||||||
BOOLEAN Valid;
|
BOOLEAN Valid;
|
||||||
UINT8 DialogToken;
|
u8 DialogToken;
|
||||||
} TPC_REQ_ENTRY, *PTPC_REQ_ENTRY;
|
} TPC_REQ_ENTRY, *PTPC_REQ_ENTRY;
|
||||||
|
|
||||||
typedef struct _TPC_REQ_TAB {
|
typedef struct _TPC_REQ_TAB {
|
||||||
UCHAR Size;
|
u8 Size;
|
||||||
PTPC_REQ_ENTRY Hash[MAX_HASH_TPC_REQ_TAB_SIZE];
|
PTPC_REQ_ENTRY Hash[MAX_HASH_TPC_REQ_TAB_SIZE];
|
||||||
TPC_REQ_ENTRY Content[MAX_TPC_REQ_TAB_SIZE];
|
TPC_REQ_ENTRY Content[MAX_TPC_REQ_TAB_SIZE];
|
||||||
} TPC_REQ_TAB, *PTPC_REQ_TAB;
|
} TPC_REQ_TAB, *PTPC_REQ_TAB;
|
||||||
|
|
||||||
/* The regulatory information */
|
/* The regulatory information */
|
||||||
typedef struct _DOT11_CHANNEL_SET {
|
typedef struct _DOT11_CHANNEL_SET {
|
||||||
UCHAR NumberOfChannels;
|
u8 NumberOfChannels;
|
||||||
UINT8 MaxTxPwr;
|
u8 MaxTxPwr;
|
||||||
UCHAR ChannelList[16];
|
u8 ChannelList[16];
|
||||||
} DOT11_CHANNEL_SET, *PDOT11_CHANNEL_SET;
|
} DOT11_CHANNEL_SET, *PDOT11_CHANNEL_SET;
|
||||||
|
|
||||||
typedef struct _DOT11_REGULATORY_INFORMATION {
|
typedef struct _DOT11_REGULATORY_INFORMATION {
|
||||||
UCHAR RegulatoryClass;
|
u8 RegulatoryClass;
|
||||||
DOT11_CHANNEL_SET ChannelSet;
|
DOT11_CHANNEL_SET ChannelSet;
|
||||||
} DOT11_REGULATORY_INFORMATION, *PDOT11_REGULATORY_INFORMATION;
|
} DOT11_REGULATORY_INFORMATION, *PDOT11_REGULATORY_INFORMATION;
|
||||||
|
|
||||||
@ -102,97 +102,97 @@ typedef struct _DOT11_REGULATORY_INFORMATION {
|
|||||||
#define RM_NOISE_HISTOGRAM 4
|
#define RM_NOISE_HISTOGRAM 4
|
||||||
|
|
||||||
typedef struct PACKED _TPC_REPORT_INFO {
|
typedef struct PACKED _TPC_REPORT_INFO {
|
||||||
UINT8 TxPwr;
|
u8 TxPwr;
|
||||||
UINT8 LinkMargin;
|
u8 LinkMargin;
|
||||||
} TPC_REPORT_INFO, *PTPC_REPORT_INFO;
|
} TPC_REPORT_INFO, *PTPC_REPORT_INFO;
|
||||||
|
|
||||||
typedef struct PACKED _CH_SW_ANN_INFO {
|
typedef struct PACKED _CH_SW_ANN_INFO {
|
||||||
UINT8 ChSwMode;
|
u8 ChSwMode;
|
||||||
UINT8 Channel;
|
u8 Channel;
|
||||||
UINT8 ChSwCnt;
|
u8 ChSwCnt;
|
||||||
} CH_SW_ANN_INFO, *PCH_SW_ANN_INFO;
|
} CH_SW_ANN_INFO, *PCH_SW_ANN_INFO;
|
||||||
|
|
||||||
typedef union PACKED _MEASURE_REQ_MODE {
|
typedef union PACKED _MEASURE_REQ_MODE {
|
||||||
struct PACKED {
|
struct PACKED {
|
||||||
UINT8 Parallel:1;
|
u8 Parallel:1;
|
||||||
UINT8 Enable:1;
|
u8 Enable:1;
|
||||||
UINT8 Request:1;
|
u8 Request:1;
|
||||||
UINT8 Report:1;
|
u8 Report:1;
|
||||||
UINT8 DurationMandatory:1;
|
u8 DurationMandatory:1;
|
||||||
UINT8:3;
|
u8:3;
|
||||||
} field;
|
} field;
|
||||||
UINT8 word;
|
u8 word;
|
||||||
} MEASURE_REQ_MODE, *PMEASURE_REQ_MODE;
|
} MEASURE_REQ_MODE, *PMEASURE_REQ_MODE;
|
||||||
|
|
||||||
typedef struct PACKED _MEASURE_REQ {
|
typedef struct PACKED _MEASURE_REQ {
|
||||||
UINT8 ChNum;
|
u8 ChNum;
|
||||||
UINT64 MeasureStartTime;
|
u64 MeasureStartTime;
|
||||||
UINT16 MeasureDuration;
|
u16 MeasureDuration;
|
||||||
} MEASURE_REQ, *PMEASURE_REQ;
|
} MEASURE_REQ, *PMEASURE_REQ;
|
||||||
|
|
||||||
typedef struct PACKED _MEASURE_REQ_INFO {
|
typedef struct PACKED _MEASURE_REQ_INFO {
|
||||||
UINT8 Token;
|
u8 Token;
|
||||||
MEASURE_REQ_MODE ReqMode;
|
MEASURE_REQ_MODE ReqMode;
|
||||||
UINT8 ReqType;
|
u8 ReqType;
|
||||||
UINT8 Oct[0];
|
u8 Oct[0];
|
||||||
} MEASURE_REQ_INFO, *PMEASURE_REQ_INFO;
|
} MEASURE_REQ_INFO, *PMEASURE_REQ_INFO;
|
||||||
|
|
||||||
typedef union PACKED _MEASURE_BASIC_REPORT_MAP {
|
typedef union PACKED _MEASURE_BASIC_REPORT_MAP {
|
||||||
struct PACKED {
|
struct PACKED {
|
||||||
UINT8 BSS:1;
|
u8 BSS:1;
|
||||||
|
|
||||||
UINT8 OfdmPreamble:1;
|
u8 OfdmPreamble:1;
|
||||||
UINT8 UnidentifiedSignal:1;
|
u8 UnidentifiedSignal:1;
|
||||||
UINT8 Radar:1;
|
u8 Radar:1;
|
||||||
UINT8 Unmeasure:1;
|
u8 Unmeasure:1;
|
||||||
UINT8 Rev:3;
|
u8 Rev:3;
|
||||||
} field;
|
} field;
|
||||||
UINT8 word;
|
u8 word;
|
||||||
} MEASURE_BASIC_REPORT_MAP, *PMEASURE_BASIC_REPORT_MAP;
|
} MEASURE_BASIC_REPORT_MAP, *PMEASURE_BASIC_REPORT_MAP;
|
||||||
|
|
||||||
typedef struct PACKED _MEASURE_BASIC_REPORT {
|
typedef struct PACKED _MEASURE_BASIC_REPORT {
|
||||||
UINT8 ChNum;
|
u8 ChNum;
|
||||||
UINT64 MeasureStartTime;
|
u64 MeasureStartTime;
|
||||||
UINT16 MeasureDuration;
|
u16 MeasureDuration;
|
||||||
MEASURE_BASIC_REPORT_MAP Map;
|
MEASURE_BASIC_REPORT_MAP Map;
|
||||||
} MEASURE_BASIC_REPORT, *PMEASURE_BASIC_REPORT;
|
} MEASURE_BASIC_REPORT, *PMEASURE_BASIC_REPORT;
|
||||||
|
|
||||||
typedef struct PACKED _MEASURE_CCA_REPORT {
|
typedef struct PACKED _MEASURE_CCA_REPORT {
|
||||||
UINT8 ChNum;
|
u8 ChNum;
|
||||||
UINT64 MeasureStartTime;
|
u64 MeasureStartTime;
|
||||||
UINT16 MeasureDuration;
|
u16 MeasureDuration;
|
||||||
UINT8 CCA_Busy_Fraction;
|
u8 CCA_Busy_Fraction;
|
||||||
} MEASURE_CCA_REPORT, *PMEASURE_CCA_REPORT;
|
} MEASURE_CCA_REPORT, *PMEASURE_CCA_REPORT;
|
||||||
|
|
||||||
typedef struct PACKED _MEASURE_RPI_REPORT {
|
typedef struct PACKED _MEASURE_RPI_REPORT {
|
||||||
UINT8 ChNum;
|
u8 ChNum;
|
||||||
UINT64 MeasureStartTime;
|
u64 MeasureStartTime;
|
||||||
UINT16 MeasureDuration;
|
u16 MeasureDuration;
|
||||||
UINT8 RPI_Density[8];
|
u8 RPI_Density[8];
|
||||||
} MEASURE_RPI_REPORT, *PMEASURE_RPI_REPORT;
|
} MEASURE_RPI_REPORT, *PMEASURE_RPI_REPORT;
|
||||||
|
|
||||||
typedef union PACKED _MEASURE_REPORT_MODE {
|
typedef union PACKED _MEASURE_REPORT_MODE {
|
||||||
struct PACKED {
|
struct PACKED {
|
||||||
UINT8 Late:1;
|
u8 Late:1;
|
||||||
UINT8 Incapable:1;
|
u8 Incapable:1;
|
||||||
UINT8 Refused:1;
|
u8 Refused:1;
|
||||||
UINT8 Rev:5;
|
u8 Rev:5;
|
||||||
} field;
|
} field;
|
||||||
UINT8 word;
|
u8 word;
|
||||||
} MEASURE_REPORT_MODE, *PMEASURE_REPORT_MODE;
|
} MEASURE_REPORT_MODE, *PMEASURE_REPORT_MODE;
|
||||||
|
|
||||||
typedef struct PACKED _MEASURE_REPORT_INFO {
|
typedef struct PACKED _MEASURE_REPORT_INFO {
|
||||||
UINT8 Token;
|
u8 Token;
|
||||||
UINT8 ReportMode;
|
u8 ReportMode;
|
||||||
UINT8 ReportType;
|
u8 ReportType;
|
||||||
UINT8 Octect[0];
|
u8 Octect[0];
|
||||||
} MEASURE_REPORT_INFO, *PMEASURE_REPORT_INFO;
|
} MEASURE_REPORT_INFO, *PMEASURE_REPORT_INFO;
|
||||||
|
|
||||||
typedef struct PACKED _QUIET_INFO {
|
typedef struct PACKED _QUIET_INFO {
|
||||||
UINT8 QuietCnt;
|
u8 QuietCnt;
|
||||||
UINT8 QuietPeriod;
|
u8 QuietPeriod;
|
||||||
UINT16 QuietDuration;
|
u16 QuietDuration;
|
||||||
UINT16 QuietOffset;
|
u16 QuietOffset;
|
||||||
} QUIET_INFO, *PQUIET_INFO;
|
} QUIET_INFO, *PQUIET_INFO;
|
||||||
|
|
||||||
#endif /* __SPECTRUM_DEF_H__ // */
|
#endif /* __SPECTRUM_DEF_H__ // */
|
||||||
|
@ -36,7 +36,7 @@
|
|||||||
*/
|
*/
|
||||||
#include "../rt_config.h"
|
#include "../rt_config.h"
|
||||||
|
|
||||||
UCHAR CipherWpaTemplate[] = {
|
u8 CipherWpaTemplate[] = {
|
||||||
0xdd, /* WPA IE */
|
0xdd, /* WPA IE */
|
||||||
0x16, /* Length */
|
0x16, /* Length */
|
||||||
0x00, 0x50, 0xf2, 0x01, /* oui */
|
0x00, 0x50, 0xf2, 0x01, /* oui */
|
||||||
@ -48,7 +48,7 @@ UCHAR CipherWpaTemplate[] = {
|
|||||||
0x00, 0x50, 0xf2, 0x01 /* authentication */
|
0x00, 0x50, 0xf2, 0x01 /* authentication */
|
||||||
};
|
};
|
||||||
|
|
||||||
UCHAR CipherWpa2Template[] = {
|
u8 CipherWpa2Template[] = {
|
||||||
0x30, /* RSN IE */
|
0x30, /* RSN IE */
|
||||||
0x14, /* Length */
|
0x14, /* Length */
|
||||||
0x01, 0x00, /* Version */
|
0x01, 0x00, /* Version */
|
||||||
@ -60,7 +60,7 @@ UCHAR CipherWpa2Template[] = {
|
|||||||
0x00, 0x00, /* RSN capability */
|
0x00, 0x00, /* RSN capability */
|
||||||
};
|
};
|
||||||
|
|
||||||
UCHAR Ccx2IeInfo[] = { 0x00, 0x40, 0x96, 0x03, 0x02 };
|
u8 Ccx2IeInfo[] = { 0x00, 0x40, 0x96, 0x03, 0x02 };
|
||||||
|
|
||||||
/*
|
/*
|
||||||
==========================================================================
|
==========================================================================
|
||||||
@ -73,7 +73,7 @@ UCHAR Ccx2IeInfo[] = { 0x00, 0x40, 0x96, 0x03, 0x02 };
|
|||||||
|
|
||||||
==========================================================================
|
==========================================================================
|
||||||
*/
|
*/
|
||||||
VOID AssocStateMachineInit(IN PRTMP_ADAPTER pAd,
|
void AssocStateMachineInit(IN PRTMP_ADAPTER pAd,
|
||||||
IN STATE_MACHINE * S, OUT STATE_MACHINE_FUNC Trans[])
|
IN STATE_MACHINE * S, OUT STATE_MACHINE_FUNC Trans[])
|
||||||
{
|
{
|
||||||
StateMachineInit(S, Trans, MAX_ASSOC_STATE, MAX_ASSOC_MSG,
|
StateMachineInit(S, Trans, MAX_ASSOC_STATE, MAX_ASSOC_MSG,
|
||||||
@ -165,9 +165,9 @@ VOID AssocStateMachineInit(IN PRTMP_ADAPTER pAd,
|
|||||||
|
|
||||||
==========================================================================
|
==========================================================================
|
||||||
*/
|
*/
|
||||||
VOID AssocTimeout(IN PVOID SystemSpecific1,
|
void AssocTimeout(void *SystemSpecific1,
|
||||||
IN PVOID FunctionContext,
|
void *FunctionContext,
|
||||||
IN PVOID SystemSpecific2, IN PVOID SystemSpecific3)
|
void *SystemSpecific2, void *SystemSpecific3)
|
||||||
{
|
{
|
||||||
RTMP_ADAPTER *pAd = (RTMP_ADAPTER *) FunctionContext;
|
RTMP_ADAPTER *pAd = (RTMP_ADAPTER *) FunctionContext;
|
||||||
|
|
||||||
@ -193,9 +193,9 @@ VOID AssocTimeout(IN PVOID SystemSpecific1,
|
|||||||
|
|
||||||
==========================================================================
|
==========================================================================
|
||||||
*/
|
*/
|
||||||
VOID ReassocTimeout(IN PVOID SystemSpecific1,
|
void ReassocTimeout(void *SystemSpecific1,
|
||||||
IN PVOID FunctionContext,
|
void *FunctionContext,
|
||||||
IN PVOID SystemSpecific2, IN PVOID SystemSpecific3)
|
void *SystemSpecific2, void *SystemSpecific3)
|
||||||
{
|
{
|
||||||
RTMP_ADAPTER *pAd = (RTMP_ADAPTER *) FunctionContext;
|
RTMP_ADAPTER *pAd = (RTMP_ADAPTER *) FunctionContext;
|
||||||
|
|
||||||
@ -221,9 +221,9 @@ VOID ReassocTimeout(IN PVOID SystemSpecific1,
|
|||||||
|
|
||||||
==========================================================================
|
==========================================================================
|
||||||
*/
|
*/
|
||||||
VOID DisassocTimeout(IN PVOID SystemSpecific1,
|
void DisassocTimeout(void *SystemSpecific1,
|
||||||
IN PVOID FunctionContext,
|
void *FunctionContext,
|
||||||
IN PVOID SystemSpecific2, IN PVOID SystemSpecific3)
|
void *SystemSpecific2, void *SystemSpecific3)
|
||||||
{
|
{
|
||||||
RTMP_ADAPTER *pAd = (RTMP_ADAPTER *) FunctionContext;
|
RTMP_ADAPTER *pAd = (RTMP_ADAPTER *) FunctionContext;
|
||||||
|
|
||||||
@ -259,23 +259,23 @@ VOID DisassocTimeout(IN PVOID SystemSpecific1,
|
|||||||
|
|
||||||
==========================================================================
|
==========================================================================
|
||||||
*/
|
*/
|
||||||
VOID MlmeAssocReqAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
void MlmeAssocReqAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
||||||
{
|
{
|
||||||
UCHAR ApAddr[6];
|
u8 ApAddr[6];
|
||||||
HEADER_802_11 AssocHdr;
|
HEADER_802_11 AssocHdr;
|
||||||
UCHAR WmeIe[9] =
|
u8 WmeIe[9] =
|
||||||
{ IE_VENDOR_SPECIFIC, 0x07, 0x00, 0x50, 0xf2, 0x02, 0x00, 0x01,
|
{ IE_VENDOR_SPECIFIC, 0x07, 0x00, 0x50, 0xf2, 0x02, 0x00, 0x01,
|
||||||
0x00 };
|
0x00 };
|
||||||
USHORT ListenIntv;
|
u16 ListenIntv;
|
||||||
ULONG Timeout;
|
unsigned long Timeout;
|
||||||
USHORT CapabilityInfo;
|
u16 CapabilityInfo;
|
||||||
BOOLEAN TimerCancelled;
|
BOOLEAN TimerCancelled;
|
||||||
PUCHAR pOutBuffer = NULL;
|
u8 *pOutBuffer = NULL;
|
||||||
NDIS_STATUS NStatus;
|
int NStatus;
|
||||||
ULONG FrameLen = 0;
|
unsigned long FrameLen = 0;
|
||||||
ULONG tmp;
|
unsigned long tmp;
|
||||||
USHORT VarIesOffset;
|
u16 VarIesOffset;
|
||||||
USHORT Status;
|
u16 Status;
|
||||||
|
|
||||||
/* Block all authentication request durning WPA block period */
|
/* Block all authentication request durning WPA block period */
|
||||||
if (pAd->StaCfg.bBlockAssoc == TRUE) {
|
if (pAd->StaCfg.bBlockAssoc == TRUE) {
|
||||||
@ -377,9 +377,9 @@ VOID MlmeAssocReqAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
|||||||
/* HT */
|
/* HT */
|
||||||
if ((pAd->MlmeAux.HtCapabilityLen > 0)
|
if ((pAd->MlmeAux.HtCapabilityLen > 0)
|
||||||
&& (pAd->CommonCfg.PhyMode >= PHY_11ABGN_MIXED)) {
|
&& (pAd->CommonCfg.PhyMode >= PHY_11ABGN_MIXED)) {
|
||||||
ULONG TmpLen;
|
unsigned long TmpLen;
|
||||||
UCHAR HtLen;
|
u8 HtLen;
|
||||||
UCHAR BROADCOM[4] = { 0x0, 0x90, 0x4c, 0x33 };
|
u8 BROADCOM[4] = { 0x0, 0x90, 0x4c, 0x33 };
|
||||||
if (pAd->StaActive.SupportedPhyInfo.bPreNHt == TRUE) {
|
if (pAd->StaActive.SupportedPhyInfo.bPreNHt == TRUE) {
|
||||||
HtLen = SIZE_HT_CAP_IE + 4;
|
HtLen = SIZE_HT_CAP_IE + 4;
|
||||||
MakeOutgoingFrame(pOutBuffer + FrameLen,
|
MakeOutgoingFrame(pOutBuffer + FrameLen,
|
||||||
@ -409,8 +409,8 @@ VOID MlmeAssocReqAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
|||||||
if (pAd->CommonCfg.bAggregationCapable) {
|
if (pAd->CommonCfg.bAggregationCapable) {
|
||||||
if ((pAd->CommonCfg.bPiggyBackCapable)
|
if ((pAd->CommonCfg.bPiggyBackCapable)
|
||||||
&& ((pAd->MlmeAux.APRalinkIe & 0x00000003) == 3)) {
|
&& ((pAd->MlmeAux.APRalinkIe & 0x00000003) == 3)) {
|
||||||
ULONG TmpLen;
|
unsigned long TmpLen;
|
||||||
UCHAR RalinkIe[9] =
|
u8 RalinkIe[9] =
|
||||||
{ IE_VENDOR_SPECIFIC, 7, 0x00, 0x0c, 0x43,
|
{ IE_VENDOR_SPECIFIC, 7, 0x00, 0x0c, 0x43,
|
||||||
0x03, 0x00, 0x00, 0x00 };
|
0x03, 0x00, 0x00, 0x00 };
|
||||||
MakeOutgoingFrame(pOutBuffer + FrameLen,
|
MakeOutgoingFrame(pOutBuffer + FrameLen,
|
||||||
@ -418,8 +418,8 @@ VOID MlmeAssocReqAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
|||||||
END_OF_ARGS);
|
END_OF_ARGS);
|
||||||
FrameLen += TmpLen;
|
FrameLen += TmpLen;
|
||||||
} else if (pAd->MlmeAux.APRalinkIe & 0x00000001) {
|
} else if (pAd->MlmeAux.APRalinkIe & 0x00000001) {
|
||||||
ULONG TmpLen;
|
unsigned long TmpLen;
|
||||||
UCHAR RalinkIe[9] =
|
u8 RalinkIe[9] =
|
||||||
{ IE_VENDOR_SPECIFIC, 7, 0x00, 0x0c, 0x43,
|
{ IE_VENDOR_SPECIFIC, 7, 0x00, 0x0c, 0x43,
|
||||||
0x01, 0x00, 0x00, 0x00 };
|
0x01, 0x00, 0x00, 0x00 };
|
||||||
MakeOutgoingFrame(pOutBuffer + FrameLen,
|
MakeOutgoingFrame(pOutBuffer + FrameLen,
|
||||||
@ -428,8 +428,8 @@ VOID MlmeAssocReqAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
|||||||
FrameLen += TmpLen;
|
FrameLen += TmpLen;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
ULONG TmpLen;
|
unsigned long TmpLen;
|
||||||
UCHAR RalinkIe[9] =
|
u8 RalinkIe[9] =
|
||||||
{ IE_VENDOR_SPECIFIC, 7, 0x00, 0x0c, 0x43, 0x06,
|
{ IE_VENDOR_SPECIFIC, 7, 0x00, 0x0c, 0x43, 0x06,
|
||||||
0x00, 0x00, 0x00 };
|
0x00, 0x00, 0x00 };
|
||||||
MakeOutgoingFrame(pOutBuffer + FrameLen, &TmpLen, 9,
|
MakeOutgoingFrame(pOutBuffer + FrameLen, &TmpLen, 9,
|
||||||
@ -450,7 +450,7 @@ VOID MlmeAssocReqAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
|||||||
QosInfo.UAPSD_AC_VO = pAd->CommonCfg.bAPSDAC_VO;
|
QosInfo.UAPSD_AC_VO = pAd->CommonCfg.bAPSDAC_VO;
|
||||||
QosInfo.MaxSPLength =
|
QosInfo.MaxSPLength =
|
||||||
pAd->CommonCfg.MaxSPLength;
|
pAd->CommonCfg.MaxSPLength;
|
||||||
WmeIe[8] |= *(PUCHAR) & QosInfo;
|
WmeIe[8] |= *(u8 *)& QosInfo;
|
||||||
} else {
|
} else {
|
||||||
/* The Parameter Set Count is set to ¡§0¡¨ in the association request frames */
|
/* The Parameter Set Count is set to ¡§0¡¨ in the association request frames */
|
||||||
/* WmeIe[8] |= (pAd->MlmeAux.APEdcaParm.EdcaUpdateCount & 0x0f); */
|
/* WmeIe[8] |= (pAd->MlmeAux.APEdcaParm.EdcaUpdateCount & 0x0f); */
|
||||||
@ -472,7 +472,7 @@ VOID MlmeAssocReqAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
|||||||
(pAd->StaCfg.AuthMode == Ndis802_11AuthModeWPA2)
|
(pAd->StaCfg.AuthMode == Ndis802_11AuthModeWPA2)
|
||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
UCHAR RSNIe = IE_WPA;
|
u8 RSNIe = IE_WPA;
|
||||||
|
|
||||||
if ((pAd->StaCfg.AuthMode == Ndis802_11AuthModeWPA2PSK)
|
if ((pAd->StaCfg.AuthMode == Ndis802_11AuthModeWPA2PSK)
|
||||||
|| (pAd->StaCfg.AuthMode ==
|
|| (pAd->StaCfg.AuthMode ==
|
||||||
@ -488,7 +488,7 @@ VOID MlmeAssocReqAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
|||||||
|
|
||||||
/* Check for WPA PMK cache list */
|
/* Check for WPA PMK cache list */
|
||||||
if (pAd->StaCfg.AuthMode == Ndis802_11AuthModeWPA2) {
|
if (pAd->StaCfg.AuthMode == Ndis802_11AuthModeWPA2) {
|
||||||
INT idx;
|
int idx;
|
||||||
BOOLEAN FoundPMK = FALSE;
|
BOOLEAN FoundPMK = FALSE;
|
||||||
/* Search chched PMKID, append it if existed */
|
/* Search chched PMKID, append it if existed */
|
||||||
for (idx = 0; idx < PMKID_NO; idx++) {
|
for (idx = 0; idx < PMKID_NO; idx++) {
|
||||||
@ -502,7 +502,7 @@ VOID MlmeAssocReqAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
|||||||
}
|
}
|
||||||
if (FoundPMK) {
|
if (FoundPMK) {
|
||||||
/* Set PMK number */
|
/* Set PMK number */
|
||||||
*(PUSHORT) & pAd->StaCfg.RSN_IE[pAd->
|
*(u16 *)& pAd->StaCfg.RSN_IE[pAd->
|
||||||
StaCfg.
|
StaCfg.
|
||||||
RSNIE_Len]
|
RSNIE_Len]
|
||||||
= 1;
|
= 1;
|
||||||
@ -589,21 +589,21 @@ VOID MlmeAssocReqAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
|||||||
|
|
||||||
==========================================================================
|
==========================================================================
|
||||||
*/
|
*/
|
||||||
VOID MlmeReassocReqAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
void MlmeReassocReqAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
||||||
{
|
{
|
||||||
UCHAR ApAddr[6];
|
u8 ApAddr[6];
|
||||||
HEADER_802_11 ReassocHdr;
|
HEADER_802_11 ReassocHdr;
|
||||||
UCHAR WmeIe[9] =
|
u8 WmeIe[9] =
|
||||||
{ IE_VENDOR_SPECIFIC, 0x07, 0x00, 0x50, 0xf2, 0x02, 0x00, 0x01,
|
{ IE_VENDOR_SPECIFIC, 0x07, 0x00, 0x50, 0xf2, 0x02, 0x00, 0x01,
|
||||||
0x00 };
|
0x00 };
|
||||||
USHORT CapabilityInfo, ListenIntv;
|
u16 CapabilityInfo, ListenIntv;
|
||||||
ULONG Timeout;
|
unsigned long Timeout;
|
||||||
ULONG FrameLen = 0;
|
unsigned long FrameLen = 0;
|
||||||
BOOLEAN TimerCancelled;
|
BOOLEAN TimerCancelled;
|
||||||
NDIS_STATUS NStatus;
|
int NStatus;
|
||||||
ULONG tmp;
|
unsigned long tmp;
|
||||||
PUCHAR pOutBuffer = NULL;
|
u8 *pOutBuffer = NULL;
|
||||||
USHORT Status;
|
u16 Status;
|
||||||
|
|
||||||
/* Block all authentication request durning WPA block period */
|
/* Block all authentication request durning WPA block period */
|
||||||
if (pAd->StaCfg.bBlockAssoc == TRUE) {
|
if (pAd->StaCfg.bBlockAssoc == TRUE) {
|
||||||
@ -669,7 +669,7 @@ VOID MlmeReassocReqAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
|||||||
QosInfo.UAPSD_AC_VO = pAd->CommonCfg.bAPSDAC_VO;
|
QosInfo.UAPSD_AC_VO = pAd->CommonCfg.bAPSDAC_VO;
|
||||||
QosInfo.MaxSPLength =
|
QosInfo.MaxSPLength =
|
||||||
pAd->CommonCfg.MaxSPLength;
|
pAd->CommonCfg.MaxSPLength;
|
||||||
WmeIe[8] |= *(PUCHAR) & QosInfo;
|
WmeIe[8] |= *(u8 *)& QosInfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
MakeOutgoingFrame(pOutBuffer + FrameLen, &tmp,
|
MakeOutgoingFrame(pOutBuffer + FrameLen, &tmp,
|
||||||
@ -679,9 +679,9 @@ VOID MlmeReassocReqAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
|||||||
/* HT */
|
/* HT */
|
||||||
if ((pAd->MlmeAux.HtCapabilityLen > 0)
|
if ((pAd->MlmeAux.HtCapabilityLen > 0)
|
||||||
&& (pAd->CommonCfg.PhyMode >= PHY_11ABGN_MIXED)) {
|
&& (pAd->CommonCfg.PhyMode >= PHY_11ABGN_MIXED)) {
|
||||||
ULONG TmpLen;
|
unsigned long TmpLen;
|
||||||
UCHAR HtLen;
|
u8 HtLen;
|
||||||
UCHAR BROADCOM[4] = { 0x0, 0x90, 0x4c, 0x33 };
|
u8 BROADCOM[4] = { 0x0, 0x90, 0x4c, 0x33 };
|
||||||
if (pAd->StaActive.SupportedPhyInfo.bPreNHt == TRUE) {
|
if (pAd->StaActive.SupportedPhyInfo.bPreNHt == TRUE) {
|
||||||
HtLen = SIZE_HT_CAP_IE + 4;
|
HtLen = SIZE_HT_CAP_IE + 4;
|
||||||
MakeOutgoingFrame(pOutBuffer + FrameLen,
|
MakeOutgoingFrame(pOutBuffer + FrameLen,
|
||||||
@ -711,8 +711,8 @@ VOID MlmeReassocReqAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
|||||||
if (pAd->CommonCfg.bAggregationCapable) {
|
if (pAd->CommonCfg.bAggregationCapable) {
|
||||||
if ((pAd->CommonCfg.bPiggyBackCapable)
|
if ((pAd->CommonCfg.bPiggyBackCapable)
|
||||||
&& ((pAd->MlmeAux.APRalinkIe & 0x00000003) == 3)) {
|
&& ((pAd->MlmeAux.APRalinkIe & 0x00000003) == 3)) {
|
||||||
ULONG TmpLen;
|
unsigned long TmpLen;
|
||||||
UCHAR RalinkIe[9] =
|
u8 RalinkIe[9] =
|
||||||
{ IE_VENDOR_SPECIFIC, 7, 0x00, 0x0c, 0x43,
|
{ IE_VENDOR_SPECIFIC, 7, 0x00, 0x0c, 0x43,
|
||||||
0x03, 0x00, 0x00, 0x00 };
|
0x03, 0x00, 0x00, 0x00 };
|
||||||
MakeOutgoingFrame(pOutBuffer + FrameLen,
|
MakeOutgoingFrame(pOutBuffer + FrameLen,
|
||||||
@ -720,8 +720,8 @@ VOID MlmeReassocReqAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
|||||||
END_OF_ARGS);
|
END_OF_ARGS);
|
||||||
FrameLen += TmpLen;
|
FrameLen += TmpLen;
|
||||||
} else if (pAd->MlmeAux.APRalinkIe & 0x00000001) {
|
} else if (pAd->MlmeAux.APRalinkIe & 0x00000001) {
|
||||||
ULONG TmpLen;
|
unsigned long TmpLen;
|
||||||
UCHAR RalinkIe[9] =
|
u8 RalinkIe[9] =
|
||||||
{ IE_VENDOR_SPECIFIC, 7, 0x00, 0x0c, 0x43,
|
{ IE_VENDOR_SPECIFIC, 7, 0x00, 0x0c, 0x43,
|
||||||
0x01, 0x00, 0x00, 0x00 };
|
0x01, 0x00, 0x00, 0x00 };
|
||||||
MakeOutgoingFrame(pOutBuffer + FrameLen,
|
MakeOutgoingFrame(pOutBuffer + FrameLen,
|
||||||
@ -730,8 +730,8 @@ VOID MlmeReassocReqAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
|||||||
FrameLen += TmpLen;
|
FrameLen += TmpLen;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
ULONG TmpLen;
|
unsigned long TmpLen;
|
||||||
UCHAR RalinkIe[9] =
|
u8 RalinkIe[9] =
|
||||||
{ IE_VENDOR_SPECIFIC, 7, 0x00, 0x0c, 0x43, 0x04,
|
{ IE_VENDOR_SPECIFIC, 7, 0x00, 0x0c, 0x43, 0x04,
|
||||||
0x00, 0x00, 0x00 };
|
0x00, 0x00, 0x00 };
|
||||||
MakeOutgoingFrame(pOutBuffer + FrameLen, &TmpLen, 9,
|
MakeOutgoingFrame(pOutBuffer + FrameLen, &TmpLen, 9,
|
||||||
@ -765,17 +765,17 @@ VOID MlmeReassocReqAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
|||||||
|
|
||||||
==========================================================================
|
==========================================================================
|
||||||
*/
|
*/
|
||||||
VOID MlmeDisassocReqAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
void MlmeDisassocReqAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
||||||
{
|
{
|
||||||
PMLME_DISASSOC_REQ_STRUCT pDisassocReq;
|
PMLME_DISASSOC_REQ_STRUCT pDisassocReq;
|
||||||
HEADER_802_11 DisassocHdr;
|
HEADER_802_11 DisassocHdr;
|
||||||
PHEADER_802_11 pDisassocHdr;
|
PHEADER_802_11 pDisassocHdr;
|
||||||
PUCHAR pOutBuffer = NULL;
|
u8 *pOutBuffer = NULL;
|
||||||
ULONG FrameLen = 0;
|
unsigned long FrameLen = 0;
|
||||||
NDIS_STATUS NStatus;
|
int NStatus;
|
||||||
BOOLEAN TimerCancelled;
|
BOOLEAN TimerCancelled;
|
||||||
ULONG Timeout = 500;
|
unsigned long Timeout = 500;
|
||||||
USHORT Status;
|
u16 Status;
|
||||||
|
|
||||||
/* skip sanity check */
|
/* skip sanity check */
|
||||||
pDisassocReq = (PMLME_DISASSOC_REQ_STRUCT) (Elem->Msg);
|
pDisassocReq = (PMLME_DISASSOC_REQ_STRUCT) (Elem->Msg);
|
||||||
@ -835,20 +835,20 @@ VOID MlmeDisassocReqAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
|||||||
|
|
||||||
==========================================================================
|
==========================================================================
|
||||||
*/
|
*/
|
||||||
VOID PeerAssocRspAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
void PeerAssocRspAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
||||||
{
|
{
|
||||||
USHORT CapabilityInfo, Status, Aid;
|
u16 CapabilityInfo, Status, Aid;
|
||||||
UCHAR SupRate[MAX_LEN_OF_SUPPORTED_RATES], SupRateLen;
|
u8 SupRate[MAX_LEN_OF_SUPPORTED_RATES], SupRateLen;
|
||||||
UCHAR ExtRate[MAX_LEN_OF_SUPPORTED_RATES], ExtRateLen;
|
u8 ExtRate[MAX_LEN_OF_SUPPORTED_RATES], ExtRateLen;
|
||||||
UCHAR Addr2[MAC_ADDR_LEN];
|
u8 Addr2[MAC_ADDR_LEN];
|
||||||
BOOLEAN TimerCancelled;
|
BOOLEAN TimerCancelled;
|
||||||
UCHAR CkipFlag;
|
u8 CkipFlag;
|
||||||
EDCA_PARM EdcaParm;
|
EDCA_PARM EdcaParm;
|
||||||
HT_CAPABILITY_IE HtCapability;
|
HT_CAPABILITY_IE HtCapability;
|
||||||
ADD_HT_INFO_IE AddHtInfo; /* AP might use this additional ht info IE */
|
ADD_HT_INFO_IE AddHtInfo; /* AP might use this additional ht info IE */
|
||||||
UCHAR HtCapabilityLen = 0;
|
u8 HtCapabilityLen = 0;
|
||||||
UCHAR AddHtInfoLen;
|
u8 AddHtInfoLen;
|
||||||
UCHAR NewExtChannelOffset = 0xff;
|
u8 NewExtChannelOffset = 0xff;
|
||||||
|
|
||||||
if (PeerAssocRspSanity
|
if (PeerAssocRspSanity
|
||||||
(pAd, Elem->Msg, Elem->MsgLen, Addr2, &CapabilityInfo, &Status,
|
(pAd, Elem->Msg, Elem->MsgLen, Addr2, &CapabilityInfo, &Status,
|
||||||
@ -870,8 +870,8 @@ VOID PeerAssocRspAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
|||||||
&TimerCancelled);
|
&TimerCancelled);
|
||||||
|
|
||||||
if (Status == MLME_SUCCESS) {
|
if (Status == MLME_SUCCESS) {
|
||||||
UCHAR MaxSupportedRateIn500Kbps = 0;
|
u8 MaxSupportedRateIn500Kbps = 0;
|
||||||
UCHAR idx;
|
u8 idx;
|
||||||
|
|
||||||
/* supported rates array may not be sorted. sort it and find the maximum rate */
|
/* supported rates array may not be sorted. sort it and find the maximum rate */
|
||||||
for (idx = 0; idx < SupRateLen; idx++) {
|
for (idx = 0; idx < SupRateLen; idx++) {
|
||||||
@ -924,22 +924,22 @@ VOID PeerAssocRspAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
|||||||
|
|
||||||
==========================================================================
|
==========================================================================
|
||||||
*/
|
*/
|
||||||
VOID PeerReassocRspAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
void PeerReassocRspAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
||||||
{
|
{
|
||||||
USHORT CapabilityInfo;
|
u16 CapabilityInfo;
|
||||||
USHORT Status;
|
u16 Status;
|
||||||
USHORT Aid;
|
u16 Aid;
|
||||||
UCHAR SupRate[MAX_LEN_OF_SUPPORTED_RATES], SupRateLen;
|
u8 SupRate[MAX_LEN_OF_SUPPORTED_RATES], SupRateLen;
|
||||||
UCHAR ExtRate[MAX_LEN_OF_SUPPORTED_RATES], ExtRateLen;
|
u8 ExtRate[MAX_LEN_OF_SUPPORTED_RATES], ExtRateLen;
|
||||||
UCHAR Addr2[MAC_ADDR_LEN];
|
u8 Addr2[MAC_ADDR_LEN];
|
||||||
UCHAR CkipFlag;
|
u8 CkipFlag;
|
||||||
BOOLEAN TimerCancelled;
|
BOOLEAN TimerCancelled;
|
||||||
EDCA_PARM EdcaParm;
|
EDCA_PARM EdcaParm;
|
||||||
HT_CAPABILITY_IE HtCapability;
|
HT_CAPABILITY_IE HtCapability;
|
||||||
ADD_HT_INFO_IE AddHtInfo; /* AP might use this additional ht info IE */
|
ADD_HT_INFO_IE AddHtInfo; /* AP might use this additional ht info IE */
|
||||||
UCHAR HtCapabilityLen;
|
u8 HtCapabilityLen;
|
||||||
UCHAR AddHtInfoLen;
|
u8 AddHtInfoLen;
|
||||||
UCHAR NewExtChannelOffset = 0xff;
|
u8 NewExtChannelOffset = 0xff;
|
||||||
|
|
||||||
if (PeerAssocRspSanity
|
if (PeerAssocRspSanity
|
||||||
(pAd, Elem->Msg, Elem->MsgLen, Addr2, &CapabilityInfo, &Status,
|
(pAd, Elem->Msg, Elem->MsgLen, Addr2, &CapabilityInfo, &Status,
|
||||||
@ -994,9 +994,9 @@ VOID PeerReassocRspAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
|||||||
|
|
||||||
==========================================================================
|
==========================================================================
|
||||||
*/
|
*/
|
||||||
VOID AssocPostProc(IN PRTMP_ADAPTER pAd, IN PUCHAR pAddr2, IN USHORT CapabilityInfo, IN USHORT Aid, IN UCHAR SupRate[], IN UCHAR SupRateLen, IN UCHAR ExtRate[], IN UCHAR ExtRateLen, IN PEDCA_PARM pEdcaParm, IN HT_CAPABILITY_IE * pHtCapability, IN UCHAR HtCapabilityLen, IN ADD_HT_INFO_IE * pAddHtInfo) /* AP might use this additional ht info IE */
|
void AssocPostProc(IN PRTMP_ADAPTER pAd, u8 *pAddr2, u16 CapabilityInfo, u16 Aid, u8 SupRate[], u8 SupRateLen, u8 ExtRate[], u8 ExtRateLen, IN PEDCA_PARM pEdcaParm, IN HT_CAPABILITY_IE * pHtCapability, u8 HtCapabilityLen, IN ADD_HT_INFO_IE * pAddHtInfo) /* AP might use this additional ht info IE */
|
||||||
{
|
{
|
||||||
ULONG Idx;
|
unsigned long Idx;
|
||||||
|
|
||||||
pAd->MlmeAux.BssType = BSS_INFRA;
|
pAd->MlmeAux.BssType = BSS_INFRA;
|
||||||
COPY_MAC_ADDR(pAd->MlmeAux.Bssid, pAddr2);
|
COPY_MAC_ADDR(pAd->MlmeAux.Bssid, pAddr2);
|
||||||
@ -1067,8 +1067,8 @@ VOID AssocPostProc(IN PRTMP_ADAPTER pAd, IN PUCHAR pAddr2, IN USHORT CapabilityI
|
|||||||
/* Store appropriate RSN_IE for WPA SM negotiation later */
|
/* Store appropriate RSN_IE for WPA SM negotiation later */
|
||||||
if ((pAd->StaCfg.AuthMode >= Ndis802_11AuthModeWPA)
|
if ((pAd->StaCfg.AuthMode >= Ndis802_11AuthModeWPA)
|
||||||
&& (pAd->ScanTab.BssEntry[Idx].VarIELen != 0)) {
|
&& (pAd->ScanTab.BssEntry[Idx].VarIELen != 0)) {
|
||||||
PUCHAR pVIE;
|
u8 *pVIE;
|
||||||
USHORT len;
|
u16 len;
|
||||||
PEID_STRUCT pEid;
|
PEID_STRUCT pEid;
|
||||||
|
|
||||||
pVIE = pAd->ScanTab.BssEntry[Idx].VarIEs;
|
pVIE = pAd->ScanTab.BssEntry[Idx].VarIEs;
|
||||||
@ -1144,10 +1144,10 @@ VOID AssocPostProc(IN PRTMP_ADAPTER pAd, IN PUCHAR pAddr2, IN USHORT CapabilityI
|
|||||||
|
|
||||||
==========================================================================
|
==========================================================================
|
||||||
*/
|
*/
|
||||||
VOID PeerDisassocAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
void PeerDisassocAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
||||||
{
|
{
|
||||||
UCHAR Addr2[MAC_ADDR_LEN];
|
u8 Addr2[MAC_ADDR_LEN];
|
||||||
USHORT Reason;
|
u16 Reason;
|
||||||
|
|
||||||
DBGPRINT(RT_DEBUG_TRACE, ("ASSOC - PeerDisassocAction()\n"));
|
DBGPRINT(RT_DEBUG_TRACE, ("ASSOC - PeerDisassocAction()\n"));
|
||||||
if (PeerDisassocSanity(pAd, Elem->Msg, Elem->MsgLen, Addr2, &Reason)) {
|
if (PeerDisassocSanity(pAd, Elem->Msg, Elem->MsgLen, Addr2, &Reason)) {
|
||||||
@ -1189,9 +1189,9 @@ VOID PeerDisassocAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
|||||||
|
|
||||||
==========================================================================
|
==========================================================================
|
||||||
*/
|
*/
|
||||||
VOID AssocTimeoutAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
void AssocTimeoutAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
||||||
{
|
{
|
||||||
USHORT Status;
|
u16 Status;
|
||||||
DBGPRINT(RT_DEBUG_TRACE, ("ASSOC - AssocTimeoutAction\n"));
|
DBGPRINT(RT_DEBUG_TRACE, ("ASSOC - AssocTimeoutAction\n"));
|
||||||
pAd->Mlme.AssocMachine.CurrState = ASSOC_IDLE;
|
pAd->Mlme.AssocMachine.CurrState = ASSOC_IDLE;
|
||||||
Status = MLME_REJ_TIMEOUT;
|
Status = MLME_REJ_TIMEOUT;
|
||||||
@ -1207,9 +1207,9 @@ VOID AssocTimeoutAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
|||||||
|
|
||||||
==========================================================================
|
==========================================================================
|
||||||
*/
|
*/
|
||||||
VOID ReassocTimeoutAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
void ReassocTimeoutAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
||||||
{
|
{
|
||||||
USHORT Status;
|
u16 Status;
|
||||||
DBGPRINT(RT_DEBUG_TRACE, ("ASSOC - ReassocTimeoutAction\n"));
|
DBGPRINT(RT_DEBUG_TRACE, ("ASSOC - ReassocTimeoutAction\n"));
|
||||||
pAd->Mlme.AssocMachine.CurrState = ASSOC_IDLE;
|
pAd->Mlme.AssocMachine.CurrState = ASSOC_IDLE;
|
||||||
Status = MLME_REJ_TIMEOUT;
|
Status = MLME_REJ_TIMEOUT;
|
||||||
@ -1225,9 +1225,9 @@ VOID ReassocTimeoutAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
|||||||
|
|
||||||
==========================================================================
|
==========================================================================
|
||||||
*/
|
*/
|
||||||
VOID DisassocTimeoutAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
void DisassocTimeoutAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
||||||
{
|
{
|
||||||
USHORT Status;
|
u16 Status;
|
||||||
DBGPRINT(RT_DEBUG_TRACE, ("ASSOC - DisassocTimeoutAction\n"));
|
DBGPRINT(RT_DEBUG_TRACE, ("ASSOC - DisassocTimeoutAction\n"));
|
||||||
pAd->Mlme.AssocMachine.CurrState = ASSOC_IDLE;
|
pAd->Mlme.AssocMachine.CurrState = ASSOC_IDLE;
|
||||||
Status = MLME_SUCCESS;
|
Status = MLME_SUCCESS;
|
||||||
@ -1235,9 +1235,9 @@ VOID DisassocTimeoutAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
|||||||
&Status);
|
&Status);
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID InvalidStateWhenAssoc(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
void InvalidStateWhenAssoc(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
||||||
{
|
{
|
||||||
USHORT Status;
|
u16 Status;
|
||||||
DBGPRINT(RT_DEBUG_TRACE,
|
DBGPRINT(RT_DEBUG_TRACE,
|
||||||
("ASSOC - InvalidStateWhenAssoc(state=%ld), reset ASSOC state machine\n",
|
("ASSOC - InvalidStateWhenAssoc(state=%ld), reset ASSOC state machine\n",
|
||||||
pAd->Mlme.AssocMachine.CurrState));
|
pAd->Mlme.AssocMachine.CurrState));
|
||||||
@ -1246,9 +1246,9 @@ VOID InvalidStateWhenAssoc(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
|||||||
MlmeEnqueue(pAd, MLME_CNTL_STATE_MACHINE, MT2_ASSOC_CONF, 2, &Status);
|
MlmeEnqueue(pAd, MLME_CNTL_STATE_MACHINE, MT2_ASSOC_CONF, 2, &Status);
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID InvalidStateWhenReassoc(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
void InvalidStateWhenReassoc(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
||||||
{
|
{
|
||||||
USHORT Status;
|
u16 Status;
|
||||||
DBGPRINT(RT_DEBUG_TRACE,
|
DBGPRINT(RT_DEBUG_TRACE,
|
||||||
("ASSOC - InvalidStateWhenReassoc(state=%ld), reset ASSOC state machine\n",
|
("ASSOC - InvalidStateWhenReassoc(state=%ld), reset ASSOC state machine\n",
|
||||||
pAd->Mlme.AssocMachine.CurrState));
|
pAd->Mlme.AssocMachine.CurrState));
|
||||||
@ -1257,10 +1257,10 @@ VOID InvalidStateWhenReassoc(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
|||||||
MlmeEnqueue(pAd, MLME_CNTL_STATE_MACHINE, MT2_REASSOC_CONF, 2, &Status);
|
MlmeEnqueue(pAd, MLME_CNTL_STATE_MACHINE, MT2_REASSOC_CONF, 2, &Status);
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID InvalidStateWhenDisassociate(IN PRTMP_ADAPTER pAd,
|
void InvalidStateWhenDisassociate(IN PRTMP_ADAPTER pAd,
|
||||||
IN MLME_QUEUE_ELEM * Elem)
|
IN MLME_QUEUE_ELEM * Elem)
|
||||||
{
|
{
|
||||||
USHORT Status;
|
u16 Status;
|
||||||
DBGPRINT(RT_DEBUG_TRACE,
|
DBGPRINT(RT_DEBUG_TRACE,
|
||||||
("ASSOC - InvalidStateWhenDisassoc(state=%ld), reset ASSOC state machine\n",
|
("ASSOC - InvalidStateWhenDisassoc(state=%ld), reset ASSOC state machine\n",
|
||||||
pAd->Mlme.AssocMachine.CurrState));
|
pAd->Mlme.AssocMachine.CurrState));
|
||||||
@ -1283,14 +1283,14 @@ VOID InvalidStateWhenDisassociate(IN PRTMP_ADAPTER pAd,
|
|||||||
|
|
||||||
==========================================================================
|
==========================================================================
|
||||||
*/
|
*/
|
||||||
VOID Cls3errAction(IN PRTMP_ADAPTER pAd, IN PUCHAR pAddr)
|
void Cls3errAction(IN PRTMP_ADAPTER pAd, u8 *pAddr)
|
||||||
{
|
{
|
||||||
HEADER_802_11 DisassocHdr;
|
HEADER_802_11 DisassocHdr;
|
||||||
PHEADER_802_11 pDisassocHdr;
|
PHEADER_802_11 pDisassocHdr;
|
||||||
PUCHAR pOutBuffer = NULL;
|
u8 *pOutBuffer = NULL;
|
||||||
ULONG FrameLen = 0;
|
unsigned long FrameLen = 0;
|
||||||
NDIS_STATUS NStatus;
|
int NStatus;
|
||||||
USHORT Reason = REASON_CLS3ERR;
|
u16 Reason = REASON_CLS3ERR;
|
||||||
|
|
||||||
NStatus = MlmeAllocateMemory(pAd, &pOutBuffer); /*Get an unused nonpaged memory */
|
NStatus = MlmeAllocateMemory(pAd, &pOutBuffer); /*Get an unused nonpaged memory */
|
||||||
if (NStatus != NDIS_STATUS_SUCCESS)
|
if (NStatus != NDIS_STATUS_SUCCESS)
|
||||||
@ -1336,13 +1336,13 @@ int wext_notify_event_assoc(IN RTMP_ADAPTER * pAd)
|
|||||||
|
|
||||||
BOOLEAN StaAddMacTableEntry(IN PRTMP_ADAPTER pAd,
|
BOOLEAN StaAddMacTableEntry(IN PRTMP_ADAPTER pAd,
|
||||||
IN PMAC_TABLE_ENTRY pEntry,
|
IN PMAC_TABLE_ENTRY pEntry,
|
||||||
IN UCHAR MaxSupportedRateIn500Kbps,
|
u8 MaxSupportedRateIn500Kbps,
|
||||||
IN HT_CAPABILITY_IE * pHtCapability,
|
IN HT_CAPABILITY_IE * pHtCapability,
|
||||||
IN UCHAR HtCapabilityLen,
|
u8 HtCapabilityLen,
|
||||||
IN ADD_HT_INFO_IE * pAddHtInfo,
|
IN ADD_HT_INFO_IE * pAddHtInfo,
|
||||||
IN UCHAR AddHtInfoLen, IN USHORT CapabilityInfo)
|
u8 AddHtInfoLen, u16 CapabilityInfo)
|
||||||
{
|
{
|
||||||
UCHAR MaxSupportedRate = RATE_11;
|
u8 MaxSupportedRate = RATE_11;
|
||||||
|
|
||||||
if (ADHOC_ON(pAd))
|
if (ADHOC_ON(pAd))
|
||||||
CLIENT_STATUS_CLEAR_FLAG(pEntry, fCLIENT_STATUS_WMM_CAPABLE);
|
CLIENT_STATUS_CLEAR_FLAG(pEntry, fCLIENT_STATUS_WMM_CAPABLE);
|
||||||
@ -1448,8 +1448,8 @@ BOOLEAN StaAddMacTableEntry(IN PRTMP_ADAPTER pAd,
|
|||||||
/* If this Entry supports 802.11n, upgrade to HT rate. */
|
/* If this Entry supports 802.11n, upgrade to HT rate. */
|
||||||
if ((HtCapabilityLen != 0)
|
if ((HtCapabilityLen != 0)
|
||||||
&& (pAd->CommonCfg.PhyMode >= PHY_11ABGN_MIXED)) {
|
&& (pAd->CommonCfg.PhyMode >= PHY_11ABGN_MIXED)) {
|
||||||
UCHAR j, bitmask; /*k,bitmask; */
|
u8 j, bitmask; /*k,bitmask; */
|
||||||
CHAR i;
|
char i;
|
||||||
|
|
||||||
if (ADHOC_ON(pAd))
|
if (ADHOC_ON(pAd))
|
||||||
CLIENT_STATUS_SET_FLAG(pEntry,
|
CLIENT_STATUS_SET_FLAG(pEntry,
|
||||||
@ -1526,8 +1526,8 @@ BOOLEAN StaAddMacTableEntry(IN PRTMP_ADAPTER pAd,
|
|||||||
pEntry->MpduDensity = pHtCapability->HtCapParm.MpduDensity;
|
pEntry->MpduDensity = pHtCapability->HtCapParm.MpduDensity;
|
||||||
pEntry->MaxRAmpduFactor =
|
pEntry->MaxRAmpduFactor =
|
||||||
pHtCapability->HtCapParm.MaxRAmpduFactor;
|
pHtCapability->HtCapParm.MaxRAmpduFactor;
|
||||||
pEntry->MmpsMode = (UCHAR) pHtCapability->HtCapInfo.MimoPs;
|
pEntry->MmpsMode = (u8)pHtCapability->HtCapInfo.MimoPs;
|
||||||
pEntry->AMsduSize = (UCHAR) pHtCapability->HtCapInfo.AMsduSize;
|
pEntry->AMsduSize = (u8)pHtCapability->HtCapInfo.AMsduSize;
|
||||||
pEntry->HTPhyMode.word = pEntry->MaxHTPhyMode.word;
|
pEntry->HTPhyMode.word = pEntry->MaxHTPhyMode.word;
|
||||||
|
|
||||||
if (pAd->CommonCfg.DesiredHtPhy.AmsduEnable
|
if (pAd->CommonCfg.DesiredHtPhy.AmsduEnable
|
||||||
@ -1567,8 +1567,8 @@ BOOLEAN StaAddMacTableEntry(IN PRTMP_ADAPTER pAd,
|
|||||||
|
|
||||||
/* Set asic auto fall back */
|
/* Set asic auto fall back */
|
||||||
if (pAd->StaCfg.bAutoTxRateSwitch == TRUE) {
|
if (pAd->StaCfg.bAutoTxRateSwitch == TRUE) {
|
||||||
PUCHAR pTable;
|
u8 *pTable;
|
||||||
UCHAR TableSize = 0;
|
u8 TableSize = 0;
|
||||||
|
|
||||||
MlmeSelectTxRateTable(pAd, pEntry, &pTable, &TableSize,
|
MlmeSelectTxRateTable(pAd, pEntry, &pTable, &TableSize,
|
||||||
&pEntry->CurrTxRateIndex);
|
&pEntry->CurrTxRateIndex);
|
||||||
@ -1579,7 +1579,7 @@ BOOLEAN StaAddMacTableEntry(IN PRTMP_ADAPTER pAd,
|
|||||||
pEntry->bAutoTxRateSwitch = FALSE;
|
pEntry->bAutoTxRateSwitch = FALSE;
|
||||||
|
|
||||||
/* If the legacy mode is set, overwrite the transmit setting of this entry. */
|
/* If the legacy mode is set, overwrite the transmit setting of this entry. */
|
||||||
RTMPUpdateLegacyTxSetting((UCHAR) pAd->StaCfg.
|
RTMPUpdateLegacyTxSetting((u8)pAd->StaCfg.
|
||||||
DesiredTransmitSetting.field.
|
DesiredTransmitSetting.field.
|
||||||
FixedTxMode, pEntry);
|
FixedTxMode, pEntry);
|
||||||
}
|
}
|
||||||
|
@ -95,9 +95,9 @@ void AuthStateMachineInit(IN PRTMP_ADAPTER pAd,
|
|||||||
|
|
||||||
==========================================================================
|
==========================================================================
|
||||||
*/
|
*/
|
||||||
VOID AuthTimeout(IN PVOID SystemSpecific1,
|
void AuthTimeout(void *SystemSpecific1,
|
||||||
IN PVOID FunctionContext,
|
void *FunctionContext,
|
||||||
IN PVOID SystemSpecific2, IN PVOID SystemSpecific3)
|
void *SystemSpecific2, void *SystemSpecific3)
|
||||||
{
|
{
|
||||||
RTMP_ADAPTER *pAd = (RTMP_ADAPTER *) FunctionContext;
|
RTMP_ADAPTER *pAd = (RTMP_ADAPTER *) FunctionContext;
|
||||||
|
|
||||||
@ -125,13 +125,13 @@ VOID AuthTimeout(IN PVOID SystemSpecific1,
|
|||||||
|
|
||||||
==========================================================================
|
==========================================================================
|
||||||
*/
|
*/
|
||||||
VOID MlmeAuthReqAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
void MlmeAuthReqAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
||||||
{
|
{
|
||||||
if (AUTH_ReqSend
|
if (AUTH_ReqSend
|
||||||
(pAd, Elem, &pAd->MlmeAux.AuthTimer, "AUTH", 1, NULL, 0))
|
(pAd, Elem, &pAd->MlmeAux.AuthTimer, "AUTH", 1, NULL, 0))
|
||||||
pAd->Mlme.AuthMachine.CurrState = AUTH_WAIT_SEQ2;
|
pAd->Mlme.AuthMachine.CurrState = AUTH_WAIT_SEQ2;
|
||||||
else {
|
else {
|
||||||
USHORT Status;
|
u16 Status;
|
||||||
|
|
||||||
pAd->Mlme.AuthMachine.CurrState = AUTH_REQ_IDLE;
|
pAd->Mlme.AuthMachine.CurrState = AUTH_REQ_IDLE;
|
||||||
Status = MLME_INVALID_FORMAT;
|
Status = MLME_INVALID_FORMAT;
|
||||||
@ -148,23 +148,23 @@ VOID MlmeAuthReqAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
|||||||
|
|
||||||
==========================================================================
|
==========================================================================
|
||||||
*/
|
*/
|
||||||
VOID PeerAuthRspAtSeq2Action(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
void PeerAuthRspAtSeq2Action(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
||||||
{
|
{
|
||||||
UCHAR Addr2[MAC_ADDR_LEN];
|
u8 Addr2[MAC_ADDR_LEN];
|
||||||
USHORT Seq, Status, RemoteStatus, Alg;
|
u16 Seq, Status, RemoteStatus, Alg;
|
||||||
UCHAR ChlgText[CIPHER_TEXT_LEN];
|
u8 ChlgText[CIPHER_TEXT_LEN];
|
||||||
UCHAR CyperChlgText[CIPHER_TEXT_LEN + 8 + 8];
|
u8 CyperChlgText[CIPHER_TEXT_LEN + 8 + 8];
|
||||||
UCHAR Element[2];
|
u8 Element[2];
|
||||||
HEADER_802_11 AuthHdr;
|
HEADER_802_11 AuthHdr;
|
||||||
BOOLEAN TimerCancelled;
|
BOOLEAN TimerCancelled;
|
||||||
PUCHAR pOutBuffer = NULL;
|
u8 *pOutBuffer = NULL;
|
||||||
NDIS_STATUS NStatus;
|
int NStatus;
|
||||||
ULONG FrameLen = 0;
|
unsigned long FrameLen = 0;
|
||||||
USHORT Status2;
|
u16 Status2;
|
||||||
|
|
||||||
if (PeerAuthSanity
|
if (PeerAuthSanity
|
||||||
(pAd, Elem->Msg, Elem->MsgLen, Addr2, &Alg, &Seq, &Status,
|
(pAd, Elem->Msg, Elem->MsgLen, Addr2, &Alg, &Seq, &Status,
|
||||||
(PCHAR) ChlgText)) {
|
(char *)ChlgText)) {
|
||||||
if (MAC_ADDR_EQUAL(pAd->MlmeAux.Bssid, Addr2) && Seq == 2) {
|
if (MAC_ADDR_EQUAL(pAd->MlmeAux.Bssid, Addr2) && Seq == 2) {
|
||||||
DBGPRINT(RT_DEBUG_TRACE,
|
DBGPRINT(RT_DEBUG_TRACE,
|
||||||
("AUTH - Receive AUTH_RSP seq#2 to me (Alg=%d, Status=%d)\n",
|
("AUTH - Receive AUTH_RSP seq#2 to me (Alg=%d, Status=%d)\n",
|
||||||
@ -224,18 +224,18 @@ VOID PeerAuthRspAtSeq2Action(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
|||||||
KeyLen,
|
KeyLen,
|
||||||
CyperChlgText);
|
CyperChlgText);
|
||||||
|
|
||||||
Alg = cpu2le16(*(USHORT *) & Alg);
|
Alg = cpu2le16(*(u16 *) & Alg);
|
||||||
Seq = cpu2le16(*(USHORT *) & Seq);
|
Seq = cpu2le16(*(u16 *) & Seq);
|
||||||
RemoteStatus =
|
RemoteStatus =
|
||||||
cpu2le16(*(USHORT *) &
|
cpu2le16(*(u16 *) &
|
||||||
RemoteStatus);
|
RemoteStatus);
|
||||||
|
|
||||||
RTMPEncryptData(pAd, (PUCHAR) & Alg,
|
RTMPEncryptData(pAd, (u8 *)& Alg,
|
||||||
CyperChlgText + 4, 2);
|
CyperChlgText + 4, 2);
|
||||||
RTMPEncryptData(pAd, (PUCHAR) & Seq,
|
RTMPEncryptData(pAd, (u8 *)& Seq,
|
||||||
CyperChlgText + 6, 2);
|
CyperChlgText + 6, 2);
|
||||||
RTMPEncryptData(pAd,
|
RTMPEncryptData(pAd,
|
||||||
(PUCHAR) & RemoteStatus,
|
(u8 *)& RemoteStatus,
|
||||||
CyperChlgText + 8, 2);
|
CyperChlgText + 8, 2);
|
||||||
Element[0] = 16;
|
Element[0] = 16;
|
||||||
Element[1] = 128;
|
Element[1] = 128;
|
||||||
@ -282,11 +282,11 @@ VOID PeerAuthRspAtSeq2Action(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
|||||||
|
|
||||||
==========================================================================
|
==========================================================================
|
||||||
*/
|
*/
|
||||||
VOID PeerAuthRspAtSeq4Action(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
void PeerAuthRspAtSeq4Action(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
||||||
{
|
{
|
||||||
UCHAR Addr2[MAC_ADDR_LEN];
|
u8 Addr2[MAC_ADDR_LEN];
|
||||||
USHORT Alg, Seq, Status;
|
u16 Alg, Seq, Status;
|
||||||
CHAR ChlgText[CIPHER_TEXT_LEN];
|
char ChlgText[CIPHER_TEXT_LEN];
|
||||||
BOOLEAN TimerCancelled;
|
BOOLEAN TimerCancelled;
|
||||||
|
|
||||||
if (PeerAuthSanity
|
if (PeerAuthSanity
|
||||||
@ -321,14 +321,14 @@ VOID PeerAuthRspAtSeq4Action(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
|||||||
|
|
||||||
==========================================================================
|
==========================================================================
|
||||||
*/
|
*/
|
||||||
VOID MlmeDeauthReqAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
void MlmeDeauthReqAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
||||||
{
|
{
|
||||||
MLME_DEAUTH_REQ_STRUCT *pInfo;
|
MLME_DEAUTH_REQ_STRUCT *pInfo;
|
||||||
HEADER_802_11 DeauthHdr;
|
HEADER_802_11 DeauthHdr;
|
||||||
PUCHAR pOutBuffer = NULL;
|
u8 *pOutBuffer = NULL;
|
||||||
NDIS_STATUS NStatus;
|
int NStatus;
|
||||||
ULONG FrameLen = 0;
|
unsigned long FrameLen = 0;
|
||||||
USHORT Status;
|
u16 Status;
|
||||||
|
|
||||||
pInfo = (MLME_DEAUTH_REQ_STRUCT *) Elem->Msg;
|
pInfo = (MLME_DEAUTH_REQ_STRUCT *) Elem->Msg;
|
||||||
|
|
||||||
@ -374,9 +374,9 @@ VOID MlmeDeauthReqAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
|||||||
|
|
||||||
==========================================================================
|
==========================================================================
|
||||||
*/
|
*/
|
||||||
VOID AuthTimeoutAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
void AuthTimeoutAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
||||||
{
|
{
|
||||||
USHORT Status;
|
u16 Status;
|
||||||
DBGPRINT(RT_DEBUG_TRACE, ("AUTH - AuthTimeoutAction\n"));
|
DBGPRINT(RT_DEBUG_TRACE, ("AUTH - AuthTimeoutAction\n"));
|
||||||
pAd->Mlme.AuthMachine.CurrState = AUTH_REQ_IDLE;
|
pAd->Mlme.AuthMachine.CurrState = AUTH_REQ_IDLE;
|
||||||
Status = MLME_REJ_TIMEOUT;
|
Status = MLME_REJ_TIMEOUT;
|
||||||
@ -391,9 +391,9 @@ VOID AuthTimeoutAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
|||||||
|
|
||||||
==========================================================================
|
==========================================================================
|
||||||
*/
|
*/
|
||||||
VOID InvalidStateWhenAuth(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
void InvalidStateWhenAuth(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
||||||
{
|
{
|
||||||
USHORT Status;
|
u16 Status;
|
||||||
DBGPRINT(RT_DEBUG_TRACE,
|
DBGPRINT(RT_DEBUG_TRACE,
|
||||||
("AUTH - InvalidStateWhenAuth (state=%ld), reset AUTH state machine\n",
|
("AUTH - InvalidStateWhenAuth (state=%ld), reset AUTH state machine\n",
|
||||||
pAd->Mlme.AuthMachine.CurrState));
|
pAd->Mlme.AuthMachine.CurrState));
|
||||||
@ -414,13 +414,13 @@ VOID InvalidStateWhenAuth(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
|||||||
|
|
||||||
==========================================================================
|
==========================================================================
|
||||||
*/
|
*/
|
||||||
VOID Cls2errAction(IN PRTMP_ADAPTER pAd, IN PUCHAR pAddr)
|
void Cls2errAction(IN PRTMP_ADAPTER pAd, u8 *pAddr)
|
||||||
{
|
{
|
||||||
HEADER_802_11 DeauthHdr;
|
HEADER_802_11 DeauthHdr;
|
||||||
PUCHAR pOutBuffer = NULL;
|
u8 *pOutBuffer = NULL;
|
||||||
NDIS_STATUS NStatus;
|
int NStatus;
|
||||||
ULONG FrameLen = 0;
|
unsigned long FrameLen = 0;
|
||||||
USHORT Reason = REASON_CLS2ERR;
|
u16 Reason = REASON_CLS2ERR;
|
||||||
|
|
||||||
NStatus = MlmeAllocateMemory(pAd, &pOutBuffer); /*Get an unused nonpaged memory */
|
NStatus = MlmeAllocateMemory(pAd, &pOutBuffer); /*Get an unused nonpaged memory */
|
||||||
if (NStatus != NDIS_STATUS_SUCCESS)
|
if (NStatus != NDIS_STATUS_SUCCESS)
|
||||||
@ -442,18 +442,18 @@ VOID Cls2errAction(IN PRTMP_ADAPTER pAd, IN PUCHAR pAddr)
|
|||||||
BOOLEAN AUTH_ReqSend(IN PRTMP_ADAPTER pAd,
|
BOOLEAN AUTH_ReqSend(IN PRTMP_ADAPTER pAd,
|
||||||
IN PMLME_QUEUE_ELEM pElem,
|
IN PMLME_QUEUE_ELEM pElem,
|
||||||
IN PRALINK_TIMER_STRUCT pAuthTimer,
|
IN PRALINK_TIMER_STRUCT pAuthTimer,
|
||||||
IN PSTRING pSMName,
|
char *pSMName,
|
||||||
IN USHORT SeqNo,
|
u16 SeqNo,
|
||||||
IN PUCHAR pNewElement, IN ULONG ElementLen)
|
u8 *pNewElement, unsigned long ElementLen)
|
||||||
{
|
{
|
||||||
USHORT Alg, Seq, Status;
|
u16 Alg, Seq, Status;
|
||||||
UCHAR Addr[6];
|
u8 Addr[6];
|
||||||
ULONG Timeout;
|
unsigned long Timeout;
|
||||||
HEADER_802_11 AuthHdr;
|
HEADER_802_11 AuthHdr;
|
||||||
BOOLEAN TimerCancelled;
|
BOOLEAN TimerCancelled;
|
||||||
NDIS_STATUS NStatus;
|
int NStatus;
|
||||||
PUCHAR pOutBuffer = NULL;
|
u8 *pOutBuffer = NULL;
|
||||||
ULONG FrameLen = 0, tmp = 0;
|
unsigned long FrameLen = 0, tmp = 0;
|
||||||
|
|
||||||
/* Block all authentication request durning WPA block period */
|
/* Block all authentication request durning WPA block period */
|
||||||
if (pAd->StaCfg.bBlockAssoc == TRUE) {
|
if (pAd->StaCfg.bBlockAssoc == TRUE) {
|
||||||
|
@ -47,7 +47,7 @@
|
|||||||
|
|
||||||
==========================================================================
|
==========================================================================
|
||||||
*/
|
*/
|
||||||
VOID AuthRspStateMachineInit(IN PRTMP_ADAPTER pAd,
|
void AuthRspStateMachineInit(IN PRTMP_ADAPTER pAd,
|
||||||
IN PSTATE_MACHINE Sm,
|
IN PSTATE_MACHINE Sm,
|
||||||
IN STATE_MACHINE_FUNC Trans[])
|
IN STATE_MACHINE_FUNC Trans[])
|
||||||
{
|
{
|
||||||
@ -73,16 +73,16 @@ VOID AuthRspStateMachineInit(IN PRTMP_ADAPTER pAd,
|
|||||||
|
|
||||||
==========================================================================
|
==========================================================================
|
||||||
*/
|
*/
|
||||||
VOID PeerAuthSimpleRspGenAndSend(IN PRTMP_ADAPTER pAd,
|
void PeerAuthSimpleRspGenAndSend(IN PRTMP_ADAPTER pAd,
|
||||||
IN PHEADER_802_11 pHdr80211,
|
IN PHEADER_802_11 pHdr80211,
|
||||||
IN USHORT Alg,
|
u16 Alg,
|
||||||
IN USHORT Seq,
|
u16 Seq,
|
||||||
IN USHORT Reason, IN USHORT Status)
|
u16 Reason, u16 Status)
|
||||||
{
|
{
|
||||||
HEADER_802_11 AuthHdr;
|
HEADER_802_11 AuthHdr;
|
||||||
ULONG FrameLen = 0;
|
unsigned long FrameLen = 0;
|
||||||
PUCHAR pOutBuffer = NULL;
|
u8 *pOutBuffer = NULL;
|
||||||
NDIS_STATUS NStatus;
|
int NStatus;
|
||||||
|
|
||||||
if (Reason != MLME_SUCCESS) {
|
if (Reason != MLME_SUCCESS) {
|
||||||
DBGPRINT(RT_DEBUG_TRACE, ("Peer AUTH fail...\n"));
|
DBGPRINT(RT_DEBUG_TRACE, ("Peer AUTH fail...\n"));
|
||||||
@ -110,10 +110,10 @@ VOID PeerAuthSimpleRspGenAndSend(IN PRTMP_ADAPTER pAd,
|
|||||||
|
|
||||||
==========================================================================
|
==========================================================================
|
||||||
*/
|
*/
|
||||||
VOID PeerDeauthAction(IN PRTMP_ADAPTER pAd, IN PMLME_QUEUE_ELEM Elem)
|
void PeerDeauthAction(IN PRTMP_ADAPTER pAd, IN PMLME_QUEUE_ELEM Elem)
|
||||||
{
|
{
|
||||||
UCHAR Addr2[MAC_ADDR_LEN];
|
u8 Addr2[MAC_ADDR_LEN];
|
||||||
USHORT Reason;
|
u16 Reason;
|
||||||
|
|
||||||
if (PeerDeauthSanity(pAd, Elem->Msg, Elem->MsgLen, Addr2, &Reason)) {
|
if (PeerDeauthSanity(pAd, Elem->Msg, Elem->MsgLen, Addr2, &Reason)) {
|
||||||
if (INFRA_ON(pAd)
|
if (INFRA_ON(pAd)
|
||||||
|
@ -36,7 +36,7 @@
|
|||||||
*/
|
*/
|
||||||
#include "../rt_config.h"
|
#include "../rt_config.h"
|
||||||
|
|
||||||
UCHAR CipherSuiteWpaNoneTkip[] = {
|
u8 CipherSuiteWpaNoneTkip[] = {
|
||||||
0x00, 0x50, 0xf2, 0x01, /* oui */
|
0x00, 0x50, 0xf2, 0x01, /* oui */
|
||||||
0x01, 0x00, /* Version */
|
0x01, 0x00, /* Version */
|
||||||
0x00, 0x50, 0xf2, 0x02, /* Multicast */
|
0x00, 0x50, 0xf2, 0x02, /* Multicast */
|
||||||
@ -46,10 +46,10 @@ UCHAR CipherSuiteWpaNoneTkip[] = {
|
|||||||
0x00, 0x50, 0xf2, 0x00 /* authentication */
|
0x00, 0x50, 0xf2, 0x00 /* authentication */
|
||||||
};
|
};
|
||||||
|
|
||||||
UCHAR CipherSuiteWpaNoneTkipLen =
|
u8 CipherSuiteWpaNoneTkipLen =
|
||||||
(sizeof(CipherSuiteWpaNoneTkip) / sizeof(UCHAR));
|
(sizeof(CipherSuiteWpaNoneTkip) / sizeof(u8));
|
||||||
|
|
||||||
UCHAR CipherSuiteWpaNoneAes[] = {
|
u8 CipherSuiteWpaNoneAes[] = {
|
||||||
0x00, 0x50, 0xf2, 0x01, /* oui */
|
0x00, 0x50, 0xf2, 0x01, /* oui */
|
||||||
0x01, 0x00, /* Version */
|
0x01, 0x00, /* Version */
|
||||||
0x00, 0x50, 0xf2, 0x04, /* Multicast */
|
0x00, 0x50, 0xf2, 0x04, /* Multicast */
|
||||||
@ -59,8 +59,8 @@ UCHAR CipherSuiteWpaNoneAes[] = {
|
|||||||
0x00, 0x50, 0xf2, 0x00 /* authentication */
|
0x00, 0x50, 0xf2, 0x00 /* authentication */
|
||||||
};
|
};
|
||||||
|
|
||||||
UCHAR CipherSuiteWpaNoneAesLen =
|
u8 CipherSuiteWpaNoneAesLen =
|
||||||
(sizeof(CipherSuiteWpaNoneAes) / sizeof(UCHAR));
|
(sizeof(CipherSuiteWpaNoneAes) / sizeof(u8));
|
||||||
|
|
||||||
/* The following MACRO is called after 1. starting an new IBSS, 2. succesfully JOIN an IBSS, */
|
/* The following MACRO is called after 1. starting an new IBSS, 2. succesfully JOIN an IBSS, */
|
||||||
/* or 3. succesfully ASSOCIATE to a BSS, 4. successfully RE_ASSOCIATE to a BSS */
|
/* or 3. succesfully ASSOCIATE to a BSS, 4. successfully RE_ASSOCIATE to a BSS */
|
||||||
@ -102,7 +102,7 @@ UCHAR CipherSuiteWpaNoneAesLen =
|
|||||||
|
|
||||||
==========================================================================
|
==========================================================================
|
||||||
*/
|
*/
|
||||||
VOID MlmeCntlInit(IN PRTMP_ADAPTER pAd,
|
void MlmeCntlInit(IN PRTMP_ADAPTER pAd,
|
||||||
IN STATE_MACHINE * S, OUT STATE_MACHINE_FUNC Trans[])
|
IN STATE_MACHINE * S, OUT STATE_MACHINE_FUNC Trans[])
|
||||||
{
|
{
|
||||||
/* Control state machine differs from other state machines, the interface */
|
/* Control state machine differs from other state machines, the interface */
|
||||||
@ -118,7 +118,7 @@ VOID MlmeCntlInit(IN PRTMP_ADAPTER pAd,
|
|||||||
|
|
||||||
==========================================================================
|
==========================================================================
|
||||||
*/
|
*/
|
||||||
VOID MlmeCntlMachinePerformAction(IN PRTMP_ADAPTER pAd,
|
void MlmeCntlMachinePerformAction(IN PRTMP_ADAPTER pAd,
|
||||||
IN STATE_MACHINE * S,
|
IN STATE_MACHINE * S,
|
||||||
IN MLME_QUEUE_ELEM * Elem)
|
IN MLME_QUEUE_ELEM * Elem)
|
||||||
{
|
{
|
||||||
@ -204,7 +204,7 @@ VOID MlmeCntlMachinePerformAction(IN PRTMP_ADAPTER pAd,
|
|||||||
/* Check if we can connect to. */
|
/* Check if we can connect to. */
|
||||||
/* */
|
/* */
|
||||||
BssTableSsidSort(pAd, &pAd->MlmeAux.SsidBssTab,
|
BssTableSsidSort(pAd, &pAd->MlmeAux.SsidBssTab,
|
||||||
(CHAR *) pAd->MlmeAux.
|
(char *) pAd->MlmeAux.
|
||||||
AutoReconnectSsid,
|
AutoReconnectSsid,
|
||||||
pAd->MlmeAux.AutoReconnectSsidLen);
|
pAd->MlmeAux.AutoReconnectSsidLen);
|
||||||
if (pAd->MlmeAux.SsidBssTab.BssNr > 0) {
|
if (pAd->MlmeAux.SsidBssTab.BssNr > 0) {
|
||||||
@ -228,7 +228,7 @@ VOID MlmeCntlMachinePerformAction(IN PRTMP_ADAPTER pAd,
|
|||||||
|
|
||||||
==========================================================================
|
==========================================================================
|
||||||
*/
|
*/
|
||||||
VOID CntlIdleProc(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
void CntlIdleProc(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
||||||
{
|
{
|
||||||
MLME_DISASSOC_REQ_STRUCT DisassocReq;
|
MLME_DISASSOC_REQ_STRUCT DisassocReq;
|
||||||
|
|
||||||
@ -281,10 +281,10 @@ VOID CntlIdleProc(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID CntlOidScanProc(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
void CntlOidScanProc(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
||||||
{
|
{
|
||||||
MLME_SCAN_REQ_STRUCT ScanReq;
|
MLME_SCAN_REQ_STRUCT ScanReq;
|
||||||
ULONG BssIdx = BSS_NOT_FOUND;
|
unsigned long BssIdx = BSS_NOT_FOUND;
|
||||||
BSS_ENTRY CurrBss;
|
BSS_ENTRY CurrBss;
|
||||||
|
|
||||||
/* record current BSS if network is connected. */
|
/* record current BSS if network is connected. */
|
||||||
@ -292,7 +292,7 @@ VOID CntlOidScanProc(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
|||||||
if (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_MEDIA_STATE_CONNECTED)) {
|
if (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_MEDIA_STATE_CONNECTED)) {
|
||||||
BssIdx =
|
BssIdx =
|
||||||
BssSsidTableSearch(&pAd->ScanTab, pAd->CommonCfg.Bssid,
|
BssSsidTableSearch(&pAd->ScanTab, pAd->CommonCfg.Bssid,
|
||||||
(PUCHAR) pAd->CommonCfg.Ssid,
|
(u8 *)pAd->CommonCfg.Ssid,
|
||||||
pAd->CommonCfg.SsidLen,
|
pAd->CommonCfg.SsidLen,
|
||||||
pAd->CommonCfg.Channel);
|
pAd->CommonCfg.Channel);
|
||||||
if (BssIdx != BSS_NOT_FOUND) {
|
if (BssIdx != BSS_NOT_FOUND) {
|
||||||
@ -313,7 +313,7 @@ VOID CntlOidScanProc(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
|||||||
pAd->ScanTab.BssNr = 1;
|
pAd->ScanTab.BssNr = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
ScanParmFill(pAd, &ScanReq, (PSTRING) Elem->Msg, Elem->MsgLen, BSS_ANY,
|
ScanParmFill(pAd, &ScanReq, (char *)Elem->Msg, Elem->MsgLen, BSS_ANY,
|
||||||
SCAN_ACTIVE);
|
SCAN_ACTIVE);
|
||||||
MlmeEnqueue(pAd, SYNC_STATE_MACHINE, MT2_MLME_SCAN_REQ,
|
MlmeEnqueue(pAd, SYNC_STATE_MACHINE, MT2_MLME_SCAN_REQ,
|
||||||
sizeof(MLME_SCAN_REQ_STRUCT), &ScanReq);
|
sizeof(MLME_SCAN_REQ_STRUCT), &ScanReq);
|
||||||
@ -329,16 +329,16 @@ VOID CntlOidScanProc(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
|||||||
|
|
||||||
==========================================================================
|
==========================================================================
|
||||||
*/
|
*/
|
||||||
VOID CntlOidSsidProc(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
void CntlOidSsidProc(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
||||||
{
|
{
|
||||||
PNDIS_802_11_SSID pOidSsid = (NDIS_802_11_SSID *) Elem->Msg;
|
PNDIS_802_11_SSID pOidSsid = (NDIS_802_11_SSID *) Elem->Msg;
|
||||||
MLME_DISASSOC_REQ_STRUCT DisassocReq;
|
MLME_DISASSOC_REQ_STRUCT DisassocReq;
|
||||||
ULONG Now;
|
unsigned long Now;
|
||||||
|
|
||||||
/* Step 1. record the desired user settings to MlmeAux */
|
/* Step 1. record the desired user settings to MlmeAux */
|
||||||
NdisZeroMemory(pAd->MlmeAux.Ssid, MAX_LEN_OF_SSID);
|
NdisZeroMemory(pAd->MlmeAux.Ssid, MAX_LEN_OF_SSID);
|
||||||
NdisMoveMemory(pAd->MlmeAux.Ssid, pOidSsid->Ssid, pOidSsid->SsidLength);
|
NdisMoveMemory(pAd->MlmeAux.Ssid, pOidSsid->Ssid, pOidSsid->SsidLength);
|
||||||
pAd->MlmeAux.SsidLen = (UCHAR) pOidSsid->SsidLength;
|
pAd->MlmeAux.SsidLen = (u8)pOidSsid->SsidLength;
|
||||||
NdisZeroMemory(pAd->MlmeAux.Bssid, MAC_ADDR_LEN);
|
NdisZeroMemory(pAd->MlmeAux.Bssid, MAC_ADDR_LEN);
|
||||||
pAd->MlmeAux.BssType = pAd->StaCfg.BssType;
|
pAd->MlmeAux.BssType = pAd->StaCfg.BssType;
|
||||||
|
|
||||||
@ -355,7 +355,7 @@ VOID CntlOidSsidProc(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
|||||||
/* step 2. find all matching BSS in the lastest SCAN result (inBssTab) */
|
/* step 2. find all matching BSS in the lastest SCAN result (inBssTab) */
|
||||||
/* & log them into MlmeAux.SsidBssTab for later-on iteration. Sort by RSSI order */
|
/* & log them into MlmeAux.SsidBssTab for later-on iteration. Sort by RSSI order */
|
||||||
BssTableSsidSort(pAd, &pAd->MlmeAux.SsidBssTab,
|
BssTableSsidSort(pAd, &pAd->MlmeAux.SsidBssTab,
|
||||||
(PCHAR) pAd->MlmeAux.Ssid, pAd->MlmeAux.SsidLen);
|
(char *)pAd->MlmeAux.Ssid, pAd->MlmeAux.SsidLen);
|
||||||
|
|
||||||
DBGPRINT(RT_DEBUG_TRACE,
|
DBGPRINT(RT_DEBUG_TRACE,
|
||||||
("CntlOidSsidProc():CNTL - %d BSS of %d BSS match the desire (%d)SSID - %s\n",
|
("CntlOidSsidProc():CNTL - %d BSS of %d BSS match the desire (%d)SSID - %s\n",
|
||||||
@ -481,7 +481,7 @@ VOID CntlOidSsidProc(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
|||||||
|
|
||||||
DBGPRINT(RT_DEBUG_TRACE,
|
DBGPRINT(RT_DEBUG_TRACE,
|
||||||
("CntlOidSsidProc():CNTL - No matching BSS, start a new scan\n"));
|
("CntlOidSsidProc():CNTL - No matching BSS, start a new scan\n"));
|
||||||
ScanParmFill(pAd, &ScanReq, (PSTRING) pAd->MlmeAux.Ssid,
|
ScanParmFill(pAd, &ScanReq, (char *)pAd->MlmeAux.Ssid,
|
||||||
pAd->MlmeAux.SsidLen, BSS_ANY,
|
pAd->MlmeAux.SsidLen, BSS_ANY,
|
||||||
SCAN_ACTIVE);
|
SCAN_ACTIVE);
|
||||||
MlmeEnqueue(pAd, SYNC_STATE_MACHINE, MT2_MLME_SCAN_REQ,
|
MlmeEnqueue(pAd, SYNC_STATE_MACHINE, MT2_MLME_SCAN_REQ,
|
||||||
@ -505,10 +505,10 @@ VOID CntlOidSsidProc(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
|||||||
|
|
||||||
==========================================================================
|
==========================================================================
|
||||||
*/
|
*/
|
||||||
VOID CntlOidRTBssidProc(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
void CntlOidRTBssidProc(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
||||||
{
|
{
|
||||||
ULONG BssIdx;
|
unsigned long BssIdx;
|
||||||
PUCHAR pOidBssid = (PUCHAR) Elem->Msg;
|
u8 *pOidBssid = (u8 *)Elem->Msg;
|
||||||
MLME_DISASSOC_REQ_STRUCT DisassocReq;
|
MLME_DISASSOC_REQ_STRUCT DisassocReq;
|
||||||
MLME_JOIN_REQ_STRUCT JoinReq;
|
MLME_JOIN_REQ_STRUCT JoinReq;
|
||||||
|
|
||||||
@ -527,7 +527,7 @@ VOID CntlOidRTBssidProc(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
|||||||
|
|
||||||
DBGPRINT(RT_DEBUG_TRACE,
|
DBGPRINT(RT_DEBUG_TRACE,
|
||||||
("CNTL - BSSID not found. start a new scan\n"));
|
("CNTL - BSSID not found. start a new scan\n"));
|
||||||
ScanParmFill(pAd, &ScanReq, (PSTRING) pAd->MlmeAux.Ssid,
|
ScanParmFill(pAd, &ScanReq, (char *)pAd->MlmeAux.Ssid,
|
||||||
pAd->MlmeAux.SsidLen, BSS_ANY, SCAN_ACTIVE);
|
pAd->MlmeAux.SsidLen, BSS_ANY, SCAN_ACTIVE);
|
||||||
MlmeEnqueue(pAd, SYNC_STATE_MACHINE, MT2_MLME_SCAN_REQ,
|
MlmeEnqueue(pAd, SYNC_STATE_MACHINE, MT2_MLME_SCAN_REQ,
|
||||||
sizeof(MLME_SCAN_REQ_STRUCT), &ScanReq);
|
sizeof(MLME_SCAN_REQ_STRUCT), &ScanReq);
|
||||||
@ -675,9 +675,9 @@ VOID CntlOidRTBssidProc(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
|||||||
/* or been corrupted by other "SET OID"? */
|
/* or been corrupted by other "SET OID"? */
|
||||||
/* */
|
/* */
|
||||||
/* IRQL = DISPATCH_LEVEL */
|
/* IRQL = DISPATCH_LEVEL */
|
||||||
VOID CntlMlmeRoamingProc(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
void CntlMlmeRoamingProc(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
||||||
{
|
{
|
||||||
UCHAR BBPValue = 0;
|
u8 BBPValue = 0;
|
||||||
|
|
||||||
DBGPRINT(RT_DEBUG_TRACE, ("CNTL - Roaming in MlmeAux.RoamTab...\n"));
|
DBGPRINT(RT_DEBUG_TRACE, ("CNTL - Roaming in MlmeAux.RoamTab...\n"));
|
||||||
|
|
||||||
@ -705,7 +705,7 @@ VOID CntlMlmeRoamingProc(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
|||||||
|
|
||||||
==========================================================================
|
==========================================================================
|
||||||
*/
|
*/
|
||||||
VOID CntlWaitDisassocProc(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
void CntlWaitDisassocProc(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
||||||
{
|
{
|
||||||
MLME_START_REQ_STRUCT StartReq;
|
MLME_START_REQ_STRUCT StartReq;
|
||||||
|
|
||||||
@ -726,7 +726,7 @@ VOID CntlWaitDisassocProc(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
|||||||
DBGPRINT(RT_DEBUG_TRACE,
|
DBGPRINT(RT_DEBUG_TRACE,
|
||||||
("CNTL - No matching BSS, start a new ADHOC (Ssid=%s)...\n",
|
("CNTL - No matching BSS, start a new ADHOC (Ssid=%s)...\n",
|
||||||
pAd->MlmeAux.Ssid));
|
pAd->MlmeAux.Ssid));
|
||||||
StartParmFill(pAd, &StartReq, (PCHAR) pAd->MlmeAux.Ssid,
|
StartParmFill(pAd, &StartReq, (char *)pAd->MlmeAux.Ssid,
|
||||||
pAd->MlmeAux.SsidLen);
|
pAd->MlmeAux.SsidLen);
|
||||||
MlmeEnqueue(pAd, SYNC_STATE_MACHINE, MT2_MLME_START_REQ,
|
MlmeEnqueue(pAd, SYNC_STATE_MACHINE, MT2_MLME_START_REQ,
|
||||||
sizeof(MLME_START_REQ_STRUCT), &StartReq);
|
sizeof(MLME_START_REQ_STRUCT), &StartReq);
|
||||||
@ -749,13 +749,13 @@ VOID CntlWaitDisassocProc(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
|||||||
|
|
||||||
==========================================================================
|
==========================================================================
|
||||||
*/
|
*/
|
||||||
VOID CntlWaitJoinProc(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
void CntlWaitJoinProc(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
||||||
{
|
{
|
||||||
USHORT Reason;
|
u16 Reason;
|
||||||
MLME_AUTH_REQ_STRUCT AuthReq;
|
MLME_AUTH_REQ_STRUCT AuthReq;
|
||||||
|
|
||||||
if (Elem->MsgType == MT2_JOIN_CONF) {
|
if (Elem->MsgType == MT2_JOIN_CONF) {
|
||||||
NdisMoveMemory(&Reason, Elem->Msg, sizeof(USHORT));
|
NdisMoveMemory(&Reason, Elem->Msg, sizeof(u16));
|
||||||
if (Reason == MLME_SUCCESS) {
|
if (Reason == MLME_SUCCESS) {
|
||||||
/* 1. joined an IBSS, we are pretty much done here */
|
/* 1. joined an IBSS, we are pretty much done here */
|
||||||
if (pAd->MlmeAux.BssType == BSS_ADHOC) {
|
if (pAd->MlmeAux.BssType == BSS_ADHOC) {
|
||||||
@ -832,12 +832,12 @@ VOID CntlWaitJoinProc(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
|||||||
|
|
||||||
==========================================================================
|
==========================================================================
|
||||||
*/
|
*/
|
||||||
VOID CntlWaitStartProc(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
void CntlWaitStartProc(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
||||||
{
|
{
|
||||||
USHORT Result;
|
u16 Result;
|
||||||
|
|
||||||
if (Elem->MsgType == MT2_START_CONF) {
|
if (Elem->MsgType == MT2_START_CONF) {
|
||||||
NdisMoveMemory(&Result, Elem->Msg, sizeof(USHORT));
|
NdisMoveMemory(&Result, Elem->Msg, sizeof(u16));
|
||||||
if (Result == MLME_SUCCESS) {
|
if (Result == MLME_SUCCESS) {
|
||||||
/* */
|
/* */
|
||||||
/* 5G bands rules of Japan: */
|
/* 5G bands rules of Japan: */
|
||||||
@ -925,14 +925,14 @@ VOID CntlWaitStartProc(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
|||||||
|
|
||||||
==========================================================================
|
==========================================================================
|
||||||
*/
|
*/
|
||||||
VOID CntlWaitAuthProc(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
void CntlWaitAuthProc(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
||||||
{
|
{
|
||||||
USHORT Reason;
|
u16 Reason;
|
||||||
MLME_ASSOC_REQ_STRUCT AssocReq;
|
MLME_ASSOC_REQ_STRUCT AssocReq;
|
||||||
MLME_AUTH_REQ_STRUCT AuthReq;
|
MLME_AUTH_REQ_STRUCT AuthReq;
|
||||||
|
|
||||||
if (Elem->MsgType == MT2_AUTH_CONF) {
|
if (Elem->MsgType == MT2_AUTH_CONF) {
|
||||||
NdisMoveMemory(&Reason, Elem->Msg, sizeof(USHORT));
|
NdisMoveMemory(&Reason, Elem->Msg, sizeof(u16));
|
||||||
if (Reason == MLME_SUCCESS) {
|
if (Reason == MLME_SUCCESS) {
|
||||||
DBGPRINT(RT_DEBUG_TRACE, ("CNTL - AUTH OK\n"));
|
DBGPRINT(RT_DEBUG_TRACE, ("CNTL - AUTH OK\n"));
|
||||||
AssocParmFill(pAd, &AssocReq, pAd->MlmeAux.Bssid,
|
AssocParmFill(pAd, &AssocReq, pAd->MlmeAux.Bssid,
|
||||||
@ -989,14 +989,14 @@ VOID CntlWaitAuthProc(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
|||||||
|
|
||||||
==========================================================================
|
==========================================================================
|
||||||
*/
|
*/
|
||||||
VOID CntlWaitAuthProc2(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
void CntlWaitAuthProc2(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
||||||
{
|
{
|
||||||
USHORT Reason;
|
u16 Reason;
|
||||||
MLME_ASSOC_REQ_STRUCT AssocReq;
|
MLME_ASSOC_REQ_STRUCT AssocReq;
|
||||||
MLME_AUTH_REQ_STRUCT AuthReq;
|
MLME_AUTH_REQ_STRUCT AuthReq;
|
||||||
|
|
||||||
if (Elem->MsgType == MT2_AUTH_CONF) {
|
if (Elem->MsgType == MT2_AUTH_CONF) {
|
||||||
NdisMoveMemory(&Reason, Elem->Msg, sizeof(USHORT));
|
NdisMoveMemory(&Reason, Elem->Msg, sizeof(u16));
|
||||||
if (Reason == MLME_SUCCESS) {
|
if (Reason == MLME_SUCCESS) {
|
||||||
DBGPRINT(RT_DEBUG_TRACE, ("CNTL - AUTH OK\n"));
|
DBGPRINT(RT_DEBUG_TRACE, ("CNTL - AUTH OK\n"));
|
||||||
AssocParmFill(pAd, &AssocReq, pAd->MlmeAux.Bssid,
|
AssocParmFill(pAd, &AssocReq, pAd->MlmeAux.Bssid,
|
||||||
@ -1047,12 +1047,12 @@ VOID CntlWaitAuthProc2(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
|||||||
|
|
||||||
==========================================================================
|
==========================================================================
|
||||||
*/
|
*/
|
||||||
VOID CntlWaitAssocProc(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
void CntlWaitAssocProc(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
||||||
{
|
{
|
||||||
USHORT Reason;
|
u16 Reason;
|
||||||
|
|
||||||
if (Elem->MsgType == MT2_ASSOC_CONF) {
|
if (Elem->MsgType == MT2_ASSOC_CONF) {
|
||||||
NdisMoveMemory(&Reason, Elem->Msg, sizeof(USHORT));
|
NdisMoveMemory(&Reason, Elem->Msg, sizeof(u16));
|
||||||
if (Reason == MLME_SUCCESS) {
|
if (Reason == MLME_SUCCESS) {
|
||||||
if (pAd->CommonCfg.bWirelessEvent) {
|
if (pAd->CommonCfg.bWirelessEvent) {
|
||||||
RTMPSendWirelessEvent(pAd, IW_ASSOC_EVENT_FLAG,
|
RTMPSendWirelessEvent(pAd, IW_ASSOC_EVENT_FLAG,
|
||||||
@ -1085,12 +1085,12 @@ VOID CntlWaitAssocProc(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
|||||||
|
|
||||||
==========================================================================
|
==========================================================================
|
||||||
*/
|
*/
|
||||||
VOID CntlWaitReassocProc(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
void CntlWaitReassocProc(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
||||||
{
|
{
|
||||||
USHORT Result;
|
u16 Result;
|
||||||
|
|
||||||
if (Elem->MsgType == MT2_REASSOC_CONF) {
|
if (Elem->MsgType == MT2_REASSOC_CONF) {
|
||||||
NdisMoveMemory(&Result, Elem->Msg, sizeof(USHORT));
|
NdisMoveMemory(&Result, Elem->Msg, sizeof(u16));
|
||||||
if (Result == MLME_SUCCESS) {
|
if (Result == MLME_SUCCESS) {
|
||||||
/* send wireless event - for association */
|
/* send wireless event - for association */
|
||||||
if (pAd->CommonCfg.bWirelessEvent)
|
if (pAd->CommonCfg.bWirelessEvent)
|
||||||
@ -1121,7 +1121,7 @@ VOID CntlWaitReassocProc(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID AdhocTurnOnQos(IN PRTMP_ADAPTER pAd)
|
void AdhocTurnOnQos(IN PRTMP_ADAPTER pAd)
|
||||||
{
|
{
|
||||||
#define AC0_DEF_TXOP 0
|
#define AC0_DEF_TXOP 0
|
||||||
#define AC1_DEF_TXOP 0
|
#define AC1_DEF_TXOP 0
|
||||||
@ -1162,12 +1162,12 @@ VOID AdhocTurnOnQos(IN PRTMP_ADAPTER pAd)
|
|||||||
|
|
||||||
==========================================================================
|
==========================================================================
|
||||||
*/
|
*/
|
||||||
VOID LinkUp(IN PRTMP_ADAPTER pAd, IN UCHAR BssType)
|
void LinkUp(IN PRTMP_ADAPTER pAd, u8 BssType)
|
||||||
{
|
{
|
||||||
ULONG Now;
|
unsigned long Now;
|
||||||
UINT32 Data;
|
u32 Data;
|
||||||
BOOLEAN Cancelled;
|
BOOLEAN Cancelled;
|
||||||
UCHAR Value = 0, idx = 0, HashIdx = 0;
|
u8 Value = 0, idx = 0, HashIdx = 0;
|
||||||
MAC_TABLE_ENTRY *pEntry = NULL, *pCurrEntry = NULL;
|
MAC_TABLE_ENTRY *pEntry = NULL, *pCurrEntry = NULL;
|
||||||
|
|
||||||
/* Init ChannelQuality to prevent DEAD_CQI at initial LinkUp */
|
/* Init ChannelQuality to prevent DEAD_CQI at initial LinkUp */
|
||||||
@ -1408,8 +1408,8 @@ VOID LinkUp(IN PRTMP_ADAPTER pAd, IN UCHAR BssType)
|
|||||||
/* Fill in Shared Key Table(offset: 0x6c00) and Shared Key Mode(offset: 0x7000) */
|
/* Fill in Shared Key Table(offset: 0x6c00) and Shared Key Mode(offset: 0x7000) */
|
||||||
|
|
||||||
if (pAd->StaCfg.WepStatus == Ndis802_11WEPEnabled) {
|
if (pAd->StaCfg.WepStatus == Ndis802_11WEPEnabled) {
|
||||||
PUCHAR Key;
|
u8 *Key;
|
||||||
UCHAR CipherAlg;
|
u8 CipherAlg;
|
||||||
|
|
||||||
for (idx = 0; idx < SHARE_KEY_NUM; idx++) {
|
for (idx = 0; idx < SHARE_KEY_NUM; idx++) {
|
||||||
CipherAlg = pAd->SharedKey[BSS0][idx].CipherAlg;
|
CipherAlg = pAd->SharedKey[BSS0][idx].CipherAlg;
|
||||||
@ -1511,7 +1511,7 @@ VOID LinkUp(IN PRTMP_ADAPTER pAd, IN UCHAR BssType)
|
|||||||
/* Key will be set after 4-way handshake. */
|
/* Key will be set after 4-way handshake. */
|
||||||
/* */
|
/* */
|
||||||
if (pAd->StaCfg.AuthMode >= Ndis802_11AuthModeWPA) {
|
if (pAd->StaCfg.AuthMode >= Ndis802_11AuthModeWPA) {
|
||||||
ULONG IV;
|
unsigned long IV;
|
||||||
|
|
||||||
/* Remove all WPA keys */
|
/* Remove all WPA keys */
|
||||||
RTMP_CLEAR_PSFLAG(pAd, fRTMP_PS_CAN_GO_SLEEP);
|
RTMP_CLEAR_PSFLAG(pAd, fRTMP_PS_CAN_GO_SLEEP);
|
||||||
@ -1548,8 +1548,8 @@ VOID LinkUp(IN PRTMP_ADAPTER pAd, IN UCHAR BssType)
|
|||||||
(pAd->StaCfg.PortSecured == WPA_802_1X_PORT_SECURED)) ||
|
(pAd->StaCfg.PortSecured == WPA_802_1X_PORT_SECURED)) ||
|
||||||
((pAd->StaCfg.WpaSupplicantUP == WPA_SUPPLICANT_DISABLE) &&
|
((pAd->StaCfg.WpaSupplicantUP == WPA_SUPPLICANT_DISABLE) &&
|
||||||
(pAd->StaCfg.WepStatus == Ndis802_11WEPEnabled))) {
|
(pAd->StaCfg.WepStatus == Ndis802_11WEPEnabled))) {
|
||||||
PUCHAR Key;
|
u8 *Key;
|
||||||
UCHAR CipherAlg;
|
u8 CipherAlg;
|
||||||
|
|
||||||
for (idx = 0; idx < SHARE_KEY_NUM; idx++) {
|
for (idx = 0; idx < SHARE_KEY_NUM; idx++) {
|
||||||
CipherAlg = pAd->SharedKey[BSS0][idx].CipherAlg;
|
CipherAlg = pAd->SharedKey[BSS0][idx].CipherAlg;
|
||||||
@ -1697,8 +1697,8 @@ VOID LinkUp(IN PRTMP_ADAPTER pAd, IN UCHAR BssType)
|
|||||||
|
|
||||||
/* Set asic auto fall back */
|
/* Set asic auto fall back */
|
||||||
{
|
{
|
||||||
PUCHAR pTable;
|
u8 *pTable;
|
||||||
UCHAR TableSize = 0;
|
u8 TableSize = 0;
|
||||||
|
|
||||||
MlmeSelectTxRateTable(pAd, &pAd->MacTab.Content[BSSID_WCID],
|
MlmeSelectTxRateTable(pAd, &pAd->MacTab.Content[BSSID_WCID],
|
||||||
&pTable, &TableSize,
|
&pTable, &TableSize,
|
||||||
@ -1721,7 +1721,7 @@ VOID LinkUp(IN PRTMP_ADAPTER pAd, IN UCHAR BssType)
|
|||||||
|
|
||||||
/* If the legacy mode is set, overwrite the transmit setting of this entry. */
|
/* If the legacy mode is set, overwrite the transmit setting of this entry. */
|
||||||
if (pEntry->HTPhyMode.field.MODE <= MODE_OFDM)
|
if (pEntry->HTPhyMode.field.MODE <= MODE_OFDM)
|
||||||
RTMPUpdateLegacyTxSetting((UCHAR) pAd->StaCfg.
|
RTMPUpdateLegacyTxSetting((u8)pAd->StaCfg.
|
||||||
DesiredTransmitSetting.field.
|
DesiredTransmitSetting.field.
|
||||||
FixedTxMode, pEntry);
|
FixedTxMode, pEntry);
|
||||||
} else
|
} else
|
||||||
@ -1729,7 +1729,7 @@ VOID LinkUp(IN PRTMP_ADAPTER pAd, IN UCHAR BssType)
|
|||||||
NdisReleaseSpinLock(&pAd->MacTabLock);
|
NdisReleaseSpinLock(&pAd->MacTabLock);
|
||||||
|
|
||||||
/* Let Link Status Page display first initial rate. */
|
/* Let Link Status Page display first initial rate. */
|
||||||
pAd->LastTxRate = (USHORT) (pEntry->HTPhyMode.word);
|
pAd->LastTxRate = (u16)(pEntry->HTPhyMode.word);
|
||||||
/* Select DAC according to HT or Legacy */
|
/* Select DAC according to HT or Legacy */
|
||||||
if (pAd->StaActive.SupportedPhyInfo.MCSSet[0] != 0x00) {
|
if (pAd->StaActive.SupportedPhyInfo.MCSSet[0] != 0x00) {
|
||||||
RTMP_BBP_IO_READ8_BY_REG_ID(pAd, BBP_R1, &Value);
|
RTMP_BBP_IO_READ8_BY_REG_ID(pAd, BBP_R1, &Value);
|
||||||
@ -1796,7 +1796,7 @@ VOID LinkUp(IN PRTMP_ADAPTER pAd, IN UCHAR BssType)
|
|||||||
&& ((STA_WEP_ON(pAd)) || (STA_TKIP_ON(pAd)))) {
|
&& ((STA_WEP_ON(pAd)) || (STA_TKIP_ON(pAd)))) {
|
||||||
pAd->CommonCfg.IOTestParm.bNextDisableRxBA = TRUE;
|
pAd->CommonCfg.IOTestParm.bNextDisableRxBA = TRUE;
|
||||||
if (pAd->CommonCfg.bEnableTxBurst) {
|
if (pAd->CommonCfg.bEnableTxBurst) {
|
||||||
UINT32 MACValue = 0;
|
u32 MACValue = 0;
|
||||||
/* Force disable TXOP value in this case. The same action in MLMEUpdateProtect too. */
|
/* Force disable TXOP value in this case. The same action in MLMEUpdateProtect too. */
|
||||||
/* I didn't change PBF_MAX_PCNT setting. */
|
/* I didn't change PBF_MAX_PCNT setting. */
|
||||||
RTMP_IO_READ32(pAd, EDCA_AC0_CFG, &MACValue);
|
RTMP_IO_READ32(pAd, EDCA_AC0_CFG, &MACValue);
|
||||||
@ -1873,9 +1873,9 @@ VOID LinkUp(IN PRTMP_ADAPTER pAd, IN UCHAR BssType)
|
|||||||
|
|
||||||
==========================================================================
|
==========================================================================
|
||||||
*/
|
*/
|
||||||
VOID LinkDown(IN PRTMP_ADAPTER pAd, IN BOOLEAN IsReqFromAP)
|
void LinkDown(IN PRTMP_ADAPTER pAd, IN BOOLEAN IsReqFromAP)
|
||||||
{
|
{
|
||||||
UCHAR i, ByteValue = 0;
|
u8 i, ByteValue = 0;
|
||||||
|
|
||||||
/* Do nothing if monitor mode is on */
|
/* Do nothing if monitor mode is on */
|
||||||
if (MONITOR_ON(pAd))
|
if (MONITOR_ON(pAd))
|
||||||
@ -2122,11 +2122,11 @@ VOID LinkDown(IN PRTMP_ADAPTER pAd, IN BOOLEAN IsReqFromAP)
|
|||||||
|
|
||||||
==========================================================================
|
==========================================================================
|
||||||
*/
|
*/
|
||||||
VOID IterateOnBssTab(IN PRTMP_ADAPTER pAd)
|
void IterateOnBssTab(IN PRTMP_ADAPTER pAd)
|
||||||
{
|
{
|
||||||
MLME_START_REQ_STRUCT StartReq;
|
MLME_START_REQ_STRUCT StartReq;
|
||||||
MLME_JOIN_REQ_STRUCT JoinReq;
|
MLME_JOIN_REQ_STRUCT JoinReq;
|
||||||
ULONG BssIdx;
|
unsigned long BssIdx;
|
||||||
|
|
||||||
/* Change the wepstatus to original wepstatus */
|
/* Change the wepstatus to original wepstatus */
|
||||||
pAd->StaCfg.WepStatus = pAd->StaCfg.OrigWepStatus;
|
pAd->StaCfg.WepStatus = pAd->StaCfg.OrigWepStatus;
|
||||||
@ -2206,7 +2206,7 @@ VOID IterateOnBssTab(IN PRTMP_ADAPTER pAd)
|
|||||||
DBGPRINT(RT_DEBUG_TRACE,
|
DBGPRINT(RT_DEBUG_TRACE,
|
||||||
("CNTL - All BSS fail; start a new ADHOC (Ssid=%s)...\n",
|
("CNTL - All BSS fail; start a new ADHOC (Ssid=%s)...\n",
|
||||||
pAd->MlmeAux.Ssid));
|
pAd->MlmeAux.Ssid));
|
||||||
StartParmFill(pAd, &StartReq, (PCHAR) pAd->MlmeAux.Ssid,
|
StartParmFill(pAd, &StartReq, (char *)pAd->MlmeAux.Ssid,
|
||||||
pAd->MlmeAux.SsidLen);
|
pAd->MlmeAux.SsidLen);
|
||||||
MlmeEnqueue(pAd, SYNC_STATE_MACHINE, MT2_MLME_START_REQ,
|
MlmeEnqueue(pAd, SYNC_STATE_MACHINE, MT2_MLME_START_REQ,
|
||||||
sizeof(MLME_START_REQ_STRUCT), &StartReq);
|
sizeof(MLME_START_REQ_STRUCT), &StartReq);
|
||||||
@ -2228,10 +2228,10 @@ VOID IterateOnBssTab(IN PRTMP_ADAPTER pAd)
|
|||||||
|
|
||||||
/* for re-association only */
|
/* for re-association only */
|
||||||
/* IRQL = DISPATCH_LEVEL */
|
/* IRQL = DISPATCH_LEVEL */
|
||||||
VOID IterateOnBssTab2(IN PRTMP_ADAPTER pAd)
|
void IterateOnBssTab2(IN PRTMP_ADAPTER pAd)
|
||||||
{
|
{
|
||||||
MLME_REASSOC_REQ_STRUCT ReassocReq;
|
MLME_REASSOC_REQ_STRUCT ReassocReq;
|
||||||
ULONG BssIdx;
|
unsigned long BssIdx;
|
||||||
BSS_ENTRY *pBss;
|
BSS_ENTRY *pBss;
|
||||||
|
|
||||||
BssIdx = pAd->MlmeAux.RoamIdx;
|
BssIdx = pAd->MlmeAux.RoamIdx;
|
||||||
@ -2276,8 +2276,8 @@ VOID IterateOnBssTab2(IN PRTMP_ADAPTER pAd)
|
|||||||
|
|
||||||
==========================================================================
|
==========================================================================
|
||||||
*/
|
*/
|
||||||
VOID JoinParmFill(IN PRTMP_ADAPTER pAd,
|
void JoinParmFill(IN PRTMP_ADAPTER pAd,
|
||||||
IN OUT MLME_JOIN_REQ_STRUCT * JoinReq, IN ULONG BssIdx)
|
IN OUT MLME_JOIN_REQ_STRUCT * JoinReq, unsigned long BssIdx)
|
||||||
{
|
{
|
||||||
JoinReq->BssIdx = BssIdx;
|
JoinReq->BssIdx = BssIdx;
|
||||||
}
|
}
|
||||||
@ -2290,10 +2290,10 @@ VOID JoinParmFill(IN PRTMP_ADAPTER pAd,
|
|||||||
|
|
||||||
==========================================================================
|
==========================================================================
|
||||||
*/
|
*/
|
||||||
VOID ScanParmFill(IN PRTMP_ADAPTER pAd,
|
void ScanParmFill(IN PRTMP_ADAPTER pAd,
|
||||||
IN OUT MLME_SCAN_REQ_STRUCT * ScanReq,
|
IN OUT MLME_SCAN_REQ_STRUCT * ScanReq,
|
||||||
IN STRING Ssid[],
|
char Ssid[],
|
||||||
IN UCHAR SsidLen, IN UCHAR BssType, IN UCHAR ScanType)
|
u8 SsidLen, u8 BssType, u8 ScanType)
|
||||||
{
|
{
|
||||||
NdisZeroMemory(ScanReq->Ssid, MAX_LEN_OF_SSID);
|
NdisZeroMemory(ScanReq->Ssid, MAX_LEN_OF_SSID);
|
||||||
ScanReq->SsidLen = SsidLen;
|
ScanReq->SsidLen = SsidLen;
|
||||||
@ -2310,9 +2310,9 @@ VOID ScanParmFill(IN PRTMP_ADAPTER pAd,
|
|||||||
|
|
||||||
==========================================================================
|
==========================================================================
|
||||||
*/
|
*/
|
||||||
VOID StartParmFill(IN PRTMP_ADAPTER pAd,
|
void StartParmFill(IN PRTMP_ADAPTER pAd,
|
||||||
IN OUT MLME_START_REQ_STRUCT * StartReq,
|
IN OUT MLME_START_REQ_STRUCT * StartReq,
|
||||||
IN CHAR Ssid[], IN UCHAR SsidLen)
|
char Ssid[], u8 SsidLen)
|
||||||
{
|
{
|
||||||
ASSERT(SsidLen <= MAX_LEN_OF_SSID);
|
ASSERT(SsidLen <= MAX_LEN_OF_SSID);
|
||||||
NdisMoveMemory(StartReq->Ssid, Ssid, SsidLen);
|
NdisMoveMemory(StartReq->Ssid, Ssid, SsidLen);
|
||||||
@ -2327,9 +2327,9 @@ VOID StartParmFill(IN PRTMP_ADAPTER pAd,
|
|||||||
|
|
||||||
==========================================================================
|
==========================================================================
|
||||||
*/
|
*/
|
||||||
VOID AuthParmFill(IN PRTMP_ADAPTER pAd,
|
void AuthParmFill(IN PRTMP_ADAPTER pAd,
|
||||||
IN OUT MLME_AUTH_REQ_STRUCT * AuthReq,
|
IN OUT MLME_AUTH_REQ_STRUCT * AuthReq,
|
||||||
IN PUCHAR pAddr, IN USHORT Alg)
|
u8 *pAddr, u16 Alg)
|
||||||
{
|
{
|
||||||
COPY_MAC_ADDR(AuthReq->Addr, pAddr);
|
COPY_MAC_ADDR(AuthReq->Addr, pAddr);
|
||||||
AuthReq->Alg = Alg;
|
AuthReq->Alg = Alg;
|
||||||
@ -2345,7 +2345,7 @@ VOID AuthParmFill(IN PRTMP_ADAPTER pAd,
|
|||||||
==========================================================================
|
==========================================================================
|
||||||
*/
|
*/
|
||||||
#ifdef RTMP_MAC_PCI
|
#ifdef RTMP_MAC_PCI
|
||||||
VOID ComposePsPoll(IN PRTMP_ADAPTER pAd)
|
void ComposePsPoll(IN PRTMP_ADAPTER pAd)
|
||||||
{
|
{
|
||||||
NdisZeroMemory(&pAd->PsPollFrame, sizeof(PSPOLL_FRAME));
|
NdisZeroMemory(&pAd->PsPollFrame, sizeof(PSPOLL_FRAME));
|
||||||
pAd->PsPollFrame.FC.Type = BTYPE_CNTL;
|
pAd->PsPollFrame.FC.Type = BTYPE_CNTL;
|
||||||
@ -2356,7 +2356,7 @@ VOID ComposePsPoll(IN PRTMP_ADAPTER pAd)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* IRQL = DISPATCH_LEVEL */
|
/* IRQL = DISPATCH_LEVEL */
|
||||||
VOID ComposeNullFrame(IN PRTMP_ADAPTER pAd)
|
void ComposeNullFrame(IN PRTMP_ADAPTER pAd)
|
||||||
{
|
{
|
||||||
NdisZeroMemory(&pAd->NullFrame, sizeof(HEADER_802_11));
|
NdisZeroMemory(&pAd->NullFrame, sizeof(HEADER_802_11));
|
||||||
pAd->NullFrame.FC.Type = BTYPE_DATA;
|
pAd->NullFrame.FC.Type = BTYPE_DATA;
|
||||||
@ -2368,13 +2368,13 @@ VOID ComposeNullFrame(IN PRTMP_ADAPTER pAd)
|
|||||||
}
|
}
|
||||||
#endif /* RTMP_MAC_PCI // */
|
#endif /* RTMP_MAC_PCI // */
|
||||||
#ifdef RTMP_MAC_USB
|
#ifdef RTMP_MAC_USB
|
||||||
VOID MlmeCntlConfirm(IN PRTMP_ADAPTER pAd, IN ULONG MsgType, IN USHORT Msg)
|
void MlmeCntlConfirm(IN PRTMP_ADAPTER pAd, unsigned long MsgType, u16 Msg)
|
||||||
{
|
{
|
||||||
MlmeEnqueue(pAd, MLME_CNTL_STATE_MACHINE, MsgType, sizeof(USHORT),
|
MlmeEnqueue(pAd, MLME_CNTL_STATE_MACHINE, MsgType, sizeof(u16),
|
||||||
&Msg);
|
&Msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID ComposePsPoll(IN PRTMP_ADAPTER pAd)
|
void ComposePsPoll(IN PRTMP_ADAPTER pAd)
|
||||||
{
|
{
|
||||||
PTXINFO_STRUC pTxInfo;
|
PTXINFO_STRUC pTxInfo;
|
||||||
PTXWI_STRUC pTxWI;
|
PTXWI_STRUC pTxWI;
|
||||||
@ -2395,14 +2395,14 @@ VOID ComposePsPoll(IN PRTMP_ADAPTER pAd)
|
|||||||
(PTXINFO_STRUC) & pAd->PsPollContext.TransferBuffer->field.
|
(PTXINFO_STRUC) & pAd->PsPollContext.TransferBuffer->field.
|
||||||
WirelessPacket[0];
|
WirelessPacket[0];
|
||||||
RTMPWriteTxInfo(pAd, pTxInfo,
|
RTMPWriteTxInfo(pAd, pTxInfo,
|
||||||
(USHORT) (sizeof(PSPOLL_FRAME) + TXWI_SIZE), TRUE,
|
(u16)(sizeof(PSPOLL_FRAME) + TXWI_SIZE), TRUE,
|
||||||
EpToQueue[MGMTPIPEIDX], FALSE, FALSE);
|
EpToQueue[MGMTPIPEIDX], FALSE, FALSE);
|
||||||
pTxWI =
|
pTxWI =
|
||||||
(PTXWI_STRUC) & pAd->PsPollContext.TransferBuffer->field.
|
(PTXWI_STRUC) & pAd->PsPollContext.TransferBuffer->field.
|
||||||
WirelessPacket[TXINFO_SIZE];
|
WirelessPacket[TXINFO_SIZE];
|
||||||
RTMPWriteTxWI(pAd, pTxWI, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, 0,
|
RTMPWriteTxWI(pAd, pTxWI, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, 0,
|
||||||
BSSID_WCID, (sizeof(PSPOLL_FRAME)), 0, 0,
|
BSSID_WCID, (sizeof(PSPOLL_FRAME)), 0, 0,
|
||||||
(UCHAR) pAd->CommonCfg.MlmeTransmit.field.MCS,
|
(u8)pAd->CommonCfg.MlmeTransmit.field.MCS,
|
||||||
IFS_BACKOFF, FALSE, &pAd->CommonCfg.MlmeTransmit);
|
IFS_BACKOFF, FALSE, &pAd->CommonCfg.MlmeTransmit);
|
||||||
RTMPMoveMemory(&pAd->PsPollContext.TransferBuffer->field.
|
RTMPMoveMemory(&pAd->PsPollContext.TransferBuffer->field.
|
||||||
WirelessPacket[TXWI_SIZE + TXINFO_SIZE],
|
WirelessPacket[TXWI_SIZE + TXINFO_SIZE],
|
||||||
@ -2413,7 +2413,7 @@ VOID ComposePsPoll(IN PRTMP_ADAPTER pAd)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* IRQL = DISPATCH_LEVEL */
|
/* IRQL = DISPATCH_LEVEL */
|
||||||
VOID ComposeNullFrame(IN PRTMP_ADAPTER pAd)
|
void ComposeNullFrame(IN PRTMP_ADAPTER pAd)
|
||||||
{
|
{
|
||||||
PTXINFO_STRUC pTxInfo;
|
PTXINFO_STRUC pTxInfo;
|
||||||
PTXWI_STRUC pTxWI;
|
PTXWI_STRUC pTxWI;
|
||||||
@ -2431,14 +2431,14 @@ VOID ComposeNullFrame(IN PRTMP_ADAPTER pAd)
|
|||||||
(PTXINFO_STRUC) & pAd->NullContext.TransferBuffer->field.
|
(PTXINFO_STRUC) & pAd->NullContext.TransferBuffer->field.
|
||||||
WirelessPacket[0];
|
WirelessPacket[0];
|
||||||
RTMPWriteTxInfo(pAd, pTxInfo,
|
RTMPWriteTxInfo(pAd, pTxInfo,
|
||||||
(USHORT) (sizeof(HEADER_802_11) + TXWI_SIZE), TRUE,
|
(u16)(sizeof(HEADER_802_11) + TXWI_SIZE), TRUE,
|
||||||
EpToQueue[MGMTPIPEIDX], FALSE, FALSE);
|
EpToQueue[MGMTPIPEIDX], FALSE, FALSE);
|
||||||
pTxWI =
|
pTxWI =
|
||||||
(PTXWI_STRUC) & pAd->NullContext.TransferBuffer->field.
|
(PTXWI_STRUC) & pAd->NullContext.TransferBuffer->field.
|
||||||
WirelessPacket[TXINFO_SIZE];
|
WirelessPacket[TXINFO_SIZE];
|
||||||
RTMPWriteTxWI(pAd, pTxWI, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, 0,
|
RTMPWriteTxWI(pAd, pTxWI, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, 0,
|
||||||
BSSID_WCID, (sizeof(HEADER_802_11)), 0, 0,
|
BSSID_WCID, (sizeof(HEADER_802_11)), 0, 0,
|
||||||
(UCHAR) pAd->CommonCfg.MlmeTransmit.field.MCS,
|
(u8)pAd->CommonCfg.MlmeTransmit.field.MCS,
|
||||||
IFS_BACKOFF, FALSE, &pAd->CommonCfg.MlmeTransmit);
|
IFS_BACKOFF, FALSE, &pAd->CommonCfg.MlmeTransmit);
|
||||||
RTMPMoveMemory(&pAd->NullContext.TransferBuffer->field.
|
RTMPMoveMemory(&pAd->NullContext.TransferBuffer->field.
|
||||||
WirelessPacket[TXWI_SIZE + TXINFO_SIZE], &pAd->NullFrame,
|
WirelessPacket[TXWI_SIZE + TXINFO_SIZE], &pAd->NullFrame,
|
||||||
@ -2458,22 +2458,22 @@ VOID ComposeNullFrame(IN PRTMP_ADAPTER pAd)
|
|||||||
|
|
||||||
==========================================================================
|
==========================================================================
|
||||||
*/
|
*/
|
||||||
ULONG MakeIbssBeacon(IN PRTMP_ADAPTER pAd)
|
unsigned long MakeIbssBeacon(IN PRTMP_ADAPTER pAd)
|
||||||
{
|
{
|
||||||
UCHAR DsLen = 1, IbssLen = 2;
|
u8 DsLen = 1, IbssLen = 2;
|
||||||
UCHAR LocalErpIe[3] = { IE_ERP, 1, 0x04 };
|
u8 LocalErpIe[3] = { IE_ERP, 1, 0x04 };
|
||||||
HEADER_802_11 BcnHdr;
|
HEADER_802_11 BcnHdr;
|
||||||
USHORT CapabilityInfo;
|
u16 CapabilityInfo;
|
||||||
LARGE_INTEGER FakeTimestamp;
|
LARGE_INTEGER FakeTimestamp;
|
||||||
ULONG FrameLen = 0;
|
unsigned long FrameLen = 0;
|
||||||
PTXWI_STRUC pTxWI = &pAd->BeaconTxWI;
|
PTXWI_STRUC pTxWI = &pAd->BeaconTxWI;
|
||||||
UCHAR *pBeaconFrame = pAd->BeaconBuf;
|
u8 *pBeaconFrame = pAd->BeaconBuf;
|
||||||
BOOLEAN Privacy;
|
BOOLEAN Privacy;
|
||||||
UCHAR SupRate[MAX_LEN_OF_SUPPORTED_RATES];
|
u8 SupRate[MAX_LEN_OF_SUPPORTED_RATES];
|
||||||
UCHAR SupRateLen = 0;
|
u8 SupRateLen = 0;
|
||||||
UCHAR ExtRate[MAX_LEN_OF_SUPPORTED_RATES];
|
u8 ExtRate[MAX_LEN_OF_SUPPORTED_RATES];
|
||||||
UCHAR ExtRateLen = 0;
|
u8 ExtRateLen = 0;
|
||||||
UCHAR RSNIe = IE_WPA;
|
u8 RSNIe = IE_WPA;
|
||||||
|
|
||||||
if ((pAd->CommonCfg.PhyMode == PHY_11B)
|
if ((pAd->CommonCfg.PhyMode == PHY_11B)
|
||||||
&& (pAd->CommonCfg.Channel <= 14)) {
|
&& (pAd->CommonCfg.Channel <= 14)) {
|
||||||
@ -2560,7 +2560,7 @@ ULONG MakeIbssBeacon(IN PRTMP_ADAPTER pAd)
|
|||||||
|
|
||||||
/* add ERP_IE and EXT_RAE IE of in 802.11g */
|
/* add ERP_IE and EXT_RAE IE of in 802.11g */
|
||||||
if (ExtRateLen) {
|
if (ExtRateLen) {
|
||||||
ULONG tmp;
|
unsigned long tmp;
|
||||||
|
|
||||||
MakeOutgoingFrame(pBeaconFrame + FrameLen, &tmp,
|
MakeOutgoingFrame(pBeaconFrame + FrameLen, &tmp,
|
||||||
3, LocalErpIe,
|
3, LocalErpIe,
|
||||||
@ -2571,7 +2571,7 @@ ULONG MakeIbssBeacon(IN PRTMP_ADAPTER pAd)
|
|||||||
}
|
}
|
||||||
/* If adhoc secruity is set for WPA-None, append the cipher suite IE */
|
/* If adhoc secruity is set for WPA-None, append the cipher suite IE */
|
||||||
if (pAd->StaCfg.AuthMode == Ndis802_11AuthModeWPANone) {
|
if (pAd->StaCfg.AuthMode == Ndis802_11AuthModeWPANone) {
|
||||||
ULONG tmp;
|
unsigned long tmp;
|
||||||
RTMPMakeRSNIE(pAd, pAd->StaCfg.AuthMode, pAd->StaCfg.WepStatus,
|
RTMPMakeRSNIE(pAd, pAd->StaCfg.AuthMode, pAd->StaCfg.WepStatus,
|
||||||
BSS0);
|
BSS0);
|
||||||
|
|
||||||
@ -2584,8 +2584,8 @@ ULONG MakeIbssBeacon(IN PRTMP_ADAPTER pAd)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ((pAd->CommonCfg.PhyMode >= PHY_11ABGN_MIXED)) {
|
if ((pAd->CommonCfg.PhyMode >= PHY_11ABGN_MIXED)) {
|
||||||
ULONG TmpLen;
|
unsigned long TmpLen;
|
||||||
UCHAR HtLen, HtLen1;
|
u8 HtLen, HtLen1;
|
||||||
|
|
||||||
/* add HT Capability IE */
|
/* add HT Capability IE */
|
||||||
HtLen = sizeof(pAd->CommonCfg.HtCapability);
|
HtLen = sizeof(pAd->CommonCfg.HtCapability);
|
||||||
|
@ -36,13 +36,13 @@
|
|||||||
*/
|
*/
|
||||||
#include "../rt_config.h"
|
#include "../rt_config.h"
|
||||||
|
|
||||||
VOID STARxEAPOLFrameIndicate(IN PRTMP_ADAPTER pAd,
|
void STARxEAPOLFrameIndicate(IN PRTMP_ADAPTER pAd,
|
||||||
IN MAC_TABLE_ENTRY * pEntry,
|
IN MAC_TABLE_ENTRY * pEntry,
|
||||||
IN RX_BLK * pRxBlk, IN UCHAR FromWhichBSSID)
|
IN RX_BLK * pRxBlk, u8 FromWhichBSSID)
|
||||||
{
|
{
|
||||||
PRT28XX_RXD_STRUC pRxD = &(pRxBlk->RxD);
|
PRT28XX_RXD_STRUC pRxD = &(pRxBlk->RxD);
|
||||||
PRXWI_STRUC pRxWI = pRxBlk->pRxWI;
|
PRXWI_STRUC pRxWI = pRxBlk->pRxWI;
|
||||||
UCHAR *pTmpBuf;
|
u8 *pTmpBuf;
|
||||||
|
|
||||||
if (pAd->StaCfg.WpaSupplicantUP) {
|
if (pAd->StaCfg.WpaSupplicantUP) {
|
||||||
/* All EAPoL frames have to pass to upper layer (ex. WPA_SUPPLICANT daemon) */
|
/* All EAPoL frames have to pass to upper layer (ex. WPA_SUPPLICANT daemon) */
|
||||||
@ -54,8 +54,8 @@ VOID STARxEAPOLFrameIndicate(IN PRTMP_ADAPTER pAd,
|
|||||||
WpaCheckEapCode(pAd, pRxBlk->pData,
|
WpaCheckEapCode(pAd, pRxBlk->pData,
|
||||||
pRxBlk->DataSize,
|
pRxBlk->DataSize,
|
||||||
LENGTH_802_1_H))) {
|
LENGTH_802_1_H))) {
|
||||||
PUCHAR Key;
|
u8 *Key;
|
||||||
UCHAR CipherAlg;
|
u8 CipherAlg;
|
||||||
int idx = 0;
|
int idx = 0;
|
||||||
|
|
||||||
DBGPRINT_RAW(RT_DEBUG_TRACE,
|
DBGPRINT_RAW(RT_DEBUG_TRACE,
|
||||||
@ -138,7 +138,7 @@ VOID STARxEAPOLFrameIndicate(IN PRTMP_ADAPTER pAd,
|
|||||||
WepKey.keyinfo.KeyLength = len;
|
WepKey.keyinfo.KeyLength = len;
|
||||||
pAd->SharedKey[BSS0][idx].
|
pAd->SharedKey[BSS0][idx].
|
||||||
KeyLen =
|
KeyLen =
|
||||||
(UCHAR) (len <= 5 ? 5 : 13);
|
(u8)(len <= 5 ? 5 : 13);
|
||||||
|
|
||||||
pAd->IndicateMediaState =
|
pAd->IndicateMediaState =
|
||||||
NdisMediaStateConnected;
|
NdisMediaStateConnected;
|
||||||
@ -202,9 +202,9 @@ VOID STARxEAPOLFrameIndicate(IN PRTMP_ADAPTER pAd,
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID STARxDataFrameAnnounce(IN PRTMP_ADAPTER pAd,
|
void STARxDataFrameAnnounce(IN PRTMP_ADAPTER pAd,
|
||||||
IN MAC_TABLE_ENTRY * pEntry,
|
IN MAC_TABLE_ENTRY * pEntry,
|
||||||
IN RX_BLK * pRxBlk, IN UCHAR FromWhichBSSID)
|
IN RX_BLK * pRxBlk, u8 FromWhichBSSID)
|
||||||
{
|
{
|
||||||
|
|
||||||
/* non-EAP frame */
|
/* non-EAP frame */
|
||||||
@ -269,11 +269,11 @@ BOOLEAN STACheckTkipMICValue(IN PRTMP_ADAPTER pAd,
|
|||||||
IN MAC_TABLE_ENTRY * pEntry, IN RX_BLK * pRxBlk)
|
IN MAC_TABLE_ENTRY * pEntry, IN RX_BLK * pRxBlk)
|
||||||
{
|
{
|
||||||
PHEADER_802_11 pHeader = pRxBlk->pHeader;
|
PHEADER_802_11 pHeader = pRxBlk->pHeader;
|
||||||
UCHAR *pData = pRxBlk->pData;
|
u8 *pData = pRxBlk->pData;
|
||||||
USHORT DataSize = pRxBlk->DataSize;
|
u16 DataSize = pRxBlk->DataSize;
|
||||||
UCHAR UserPriority = pRxBlk->UserPriority;
|
u8 UserPriority = pRxBlk->UserPriority;
|
||||||
PCIPHER_KEY pWpaKey;
|
PCIPHER_KEY pWpaKey;
|
||||||
UCHAR *pDA, *pSA;
|
u8 *pDA, *pSA;
|
||||||
|
|
||||||
pWpaKey = &pAd->SharedKey[BSS0][pRxBlk->pRxWI->KeyIndex];
|
pWpaKey = &pAd->SharedKey[BSS0][pRxBlk->pRxWI->KeyIndex];
|
||||||
|
|
||||||
@ -318,7 +318,7 @@ BOOLEAN STACheckTkipMICValue(IN PRTMP_ADAPTER pAd,
|
|||||||
/* 3. set payload size including LLC to DataSize */
|
/* 3. set payload size including LLC to DataSize */
|
||||||
/* 4. set some flags with RX_BLK_SET_FLAG() */
|
/* 4. set some flags with RX_BLK_SET_FLAG() */
|
||||||
/* */
|
/* */
|
||||||
VOID STAHandleRxDataFrame(IN PRTMP_ADAPTER pAd, IN RX_BLK * pRxBlk)
|
void STAHandleRxDataFrame(IN PRTMP_ADAPTER pAd, IN RX_BLK * pRxBlk)
|
||||||
{
|
{
|
||||||
PRT28XX_RXD_STRUC pRxD = &(pRxBlk->RxD);
|
PRT28XX_RXD_STRUC pRxD = &(pRxBlk->RxD);
|
||||||
PRXWI_STRUC pRxWI = pRxBlk->pRxWI;
|
PRXWI_STRUC pRxWI = pRxBlk->pRxWI;
|
||||||
@ -326,8 +326,8 @@ VOID STAHandleRxDataFrame(IN PRTMP_ADAPTER pAd, IN RX_BLK * pRxBlk)
|
|||||||
PNDIS_PACKET pRxPacket = pRxBlk->pRxPacket;
|
PNDIS_PACKET pRxPacket = pRxBlk->pRxPacket;
|
||||||
BOOLEAN bFragment = FALSE;
|
BOOLEAN bFragment = FALSE;
|
||||||
MAC_TABLE_ENTRY *pEntry = NULL;
|
MAC_TABLE_ENTRY *pEntry = NULL;
|
||||||
UCHAR FromWhichBSSID = BSS0;
|
u8 FromWhichBSSID = BSS0;
|
||||||
UCHAR UserPriority = 0;
|
u8 UserPriority = 0;
|
||||||
|
|
||||||
{
|
{
|
||||||
/* before LINK UP, all DATA frames are rejected */
|
/* before LINK UP, all DATA frames are rejected */
|
||||||
@ -351,11 +351,11 @@ VOID STAHandleRxDataFrame(IN PRTMP_ADAPTER pAd, IN RX_BLK * pRxBlk)
|
|||||||
if (pAd->CommonCfg.bAPSDCapable
|
if (pAd->CommonCfg.bAPSDCapable
|
||||||
&& pAd->CommonCfg.APEdcaParm.bAPSDCapable
|
&& pAd->CommonCfg.APEdcaParm.bAPSDCapable
|
||||||
&& (pHeader->FC.SubType & 0x08)) {
|
&& (pHeader->FC.SubType & 0x08)) {
|
||||||
UCHAR *pData;
|
u8 *pData;
|
||||||
DBGPRINT(RT_DEBUG_INFO, ("bAPSDCapable\n"));
|
DBGPRINT(RT_DEBUG_INFO, ("bAPSDCapable\n"));
|
||||||
|
|
||||||
/* Qos bit 4 */
|
/* Qos bit 4 */
|
||||||
pData = (PUCHAR) pHeader + LENGTH_802_11;
|
pData = (u8 *)pHeader + LENGTH_802_11;
|
||||||
if ((*pData >> 4) & 0x01) {
|
if ((*pData >> 4) & 0x01) {
|
||||||
DBGPRINT(RT_DEBUG_INFO,
|
DBGPRINT(RT_DEBUG_INFO,
|
||||||
("RxDone- Rcv EOSP frame, driver may fall into sleep\n"));
|
("RxDone- Rcv EOSP frame, driver may fall into sleep\n"));
|
||||||
@ -363,14 +363,14 @@ VOID STAHandleRxDataFrame(IN PRTMP_ADAPTER pAd, IN RX_BLK * pRxBlk)
|
|||||||
|
|
||||||
/* Force driver to fall into sleep mode when rcv EOSP frame */
|
/* Force driver to fall into sleep mode when rcv EOSP frame */
|
||||||
if (!OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_DOZE)) {
|
if (!OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_DOZE)) {
|
||||||
USHORT TbttNumToNextWakeUp;
|
u16 TbttNumToNextWakeUp;
|
||||||
USHORT NextDtim =
|
u16 NextDtim =
|
||||||
pAd->StaCfg.DtimPeriod;
|
pAd->StaCfg.DtimPeriod;
|
||||||
ULONG Now;
|
unsigned long Now;
|
||||||
|
|
||||||
NdisGetSystemUpTime(&Now);
|
NdisGetSystemUpTime(&Now);
|
||||||
NextDtim -=
|
NextDtim -=
|
||||||
(USHORT) (Now -
|
(u16)(Now -
|
||||||
pAd->StaCfg.
|
pAd->StaCfg.
|
||||||
LastBeaconRxTime) /
|
LastBeaconRxTime) /
|
||||||
pAd->CommonCfg.BeaconPeriod;
|
pAd->CommonCfg.BeaconPeriod;
|
||||||
@ -459,7 +459,7 @@ VOID STAHandleRxDataFrame(IN PRTMP_ADAPTER pAd, IN RX_BLK * pRxBlk)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pRxBlk->pData = (UCHAR *) pHeader;
|
pRxBlk->pData = (u8 *) pHeader;
|
||||||
|
|
||||||
/* */
|
/* */
|
||||||
/* update RxBlk->pData, DataSize */
|
/* update RxBlk->pData, DataSize */
|
||||||
@ -553,7 +553,7 @@ VOID STAHandleRxDataFrame(IN PRTMP_ADAPTER pAd, IN RX_BLK * pRxBlk)
|
|||||||
return;
|
return;
|
||||||
} else if (pRxD->U2M) {
|
} else if (pRxD->U2M) {
|
||||||
pAd->LastRxRate =
|
pAd->LastRxRate =
|
||||||
(USHORT) ((pRxWI->MCS) + (pRxWI->BW << 7) +
|
(u16)((pRxWI->MCS) + (pRxWI->BW << 7) +
|
||||||
(pRxWI->ShortGI << 8) + (pRxWI->PHYMODE << 14));
|
(pRxWI->ShortGI << 8) + (pRxWI->PHYMODE << 14));
|
||||||
|
|
||||||
if (ADHOC_ON(pAd)) {
|
if (ADHOC_ON(pAd)) {
|
||||||
@ -565,8 +565,8 @@ VOID STAHandleRxDataFrame(IN PRTMP_ADAPTER pAd, IN RX_BLK * pRxBlk)
|
|||||||
|
|
||||||
Update_Rssi_Sample(pAd, &pAd->StaCfg.RssiSample, pRxWI);
|
Update_Rssi_Sample(pAd, &pAd->StaCfg.RssiSample, pRxWI);
|
||||||
|
|
||||||
pAd->StaCfg.LastSNR0 = (UCHAR) (pRxWI->SNR0);
|
pAd->StaCfg.LastSNR0 = (u8)(pRxWI->SNR0);
|
||||||
pAd->StaCfg.LastSNR1 = (UCHAR) (pRxWI->SNR1);
|
pAd->StaCfg.LastSNR1 = (u8)(pRxWI->SNR1);
|
||||||
|
|
||||||
pAd->RalinkCounters.OneSecRxOkDataCnt++;
|
pAd->RalinkCounters.OneSecRxOkDataCnt++;
|
||||||
|
|
||||||
@ -610,7 +610,7 @@ VOID STAHandleRxDataFrame(IN PRTMP_ADAPTER pAd, IN RX_BLK * pRxBlk)
|
|||||||
RELEASE_NDIS_PACKET(pAd, pRxPacket, NDIS_STATUS_FAILURE);
|
RELEASE_NDIS_PACKET(pAd, pRxPacket, NDIS_STATUS_FAILURE);
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID STAHandleRxMgmtFrame(IN PRTMP_ADAPTER pAd, IN RX_BLK * pRxBlk)
|
void STAHandleRxMgmtFrame(IN PRTMP_ADAPTER pAd, IN RX_BLK * pRxBlk)
|
||||||
{
|
{
|
||||||
PRT28XX_RXD_STRUC pRxD = &(pRxBlk->RxD);
|
PRT28XX_RXD_STRUC pRxD = &(pRxBlk->RxD);
|
||||||
PRXWI_STRUC pRxWI = pRxBlk->pRxWI;
|
PRXWI_STRUC pRxWI = pRxBlk->pRxWI;
|
||||||
@ -637,8 +637,8 @@ VOID STAHandleRxMgmtFrame(IN PRTMP_ADAPTER pAd, IN RX_BLK * pRxBlk)
|
|||||||
&& (pAd->RxAnt.EvaluatePeriod == 0)) {
|
&& (pAd->RxAnt.EvaluatePeriod == 0)) {
|
||||||
Update_Rssi_Sample(pAd, &pAd->StaCfg.RssiSample, pRxWI);
|
Update_Rssi_Sample(pAd, &pAd->StaCfg.RssiSample, pRxWI);
|
||||||
|
|
||||||
pAd->StaCfg.LastSNR0 = (UCHAR) (pRxWI->SNR0);
|
pAd->StaCfg.LastSNR0 = (u8)(pRxWI->SNR0);
|
||||||
pAd->StaCfg.LastSNR1 = (UCHAR) (pRxWI->SNR1);
|
pAd->StaCfg.LastSNR1 = (u8)(pRxWI->SNR1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* First check the size, it MUST not exceed the mlme queue size */
|
/* First check the size, it MUST not exceed the mlme queue size */
|
||||||
@ -656,7 +656,7 @@ VOID STAHandleRxMgmtFrame(IN PRTMP_ADAPTER pAd, IN RX_BLK * pRxBlk)
|
|||||||
RELEASE_NDIS_PACKET(pAd, pRxPacket, NDIS_STATUS_SUCCESS);
|
RELEASE_NDIS_PACKET(pAd, pRxPacket, NDIS_STATUS_SUCCESS);
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID STAHandleRxControlFrame(IN PRTMP_ADAPTER pAd, IN RX_BLK * pRxBlk)
|
void STAHandleRxControlFrame(IN PRTMP_ADAPTER pAd, IN RX_BLK * pRxBlk)
|
||||||
{
|
{
|
||||||
PRXWI_STRUC pRxWI = pRxBlk->pRxWI;
|
PRXWI_STRUC pRxWI = pRxBlk->pRxWI;
|
||||||
PHEADER_802_11 pHeader = pRxBlk->pHeader;
|
PHEADER_802_11 pHeader = pRxBlk->pHeader;
|
||||||
@ -700,11 +700,11 @@ VOID STAHandleRxControlFrame(IN PRTMP_ADAPTER pAd, IN RX_BLK * pRxBlk)
|
|||||||
*/
|
*/
|
||||||
BOOLEAN STARxDoneInterruptHandle(IN PRTMP_ADAPTER pAd, IN BOOLEAN argc)
|
BOOLEAN STARxDoneInterruptHandle(IN PRTMP_ADAPTER pAd, IN BOOLEAN argc)
|
||||||
{
|
{
|
||||||
NDIS_STATUS Status;
|
int Status;
|
||||||
UINT32 RxProcessed, RxPending;
|
u32 RxProcessed, RxPending;
|
||||||
BOOLEAN bReschedule = FALSE;
|
BOOLEAN bReschedule = FALSE;
|
||||||
RT28XX_RXD_STRUC *pRxD;
|
RT28XX_RXD_STRUC *pRxD;
|
||||||
UCHAR *pData;
|
u8 *pData;
|
||||||
PRXWI_STRUC pRxWI;
|
PRXWI_STRUC pRxWI;
|
||||||
PNDIS_PACKET pRxPacket;
|
PNDIS_PACKET pRxPacket;
|
||||||
PHEADER_802_11 pHeader;
|
PHEADER_802_11 pHeader;
|
||||||
@ -757,7 +757,7 @@ BOOLEAN STARxDoneInterruptHandle(IN PRTMP_ADAPTER pAd, IN BOOLEAN argc)
|
|||||||
RxCell.pRxWI = pRxWI;
|
RxCell.pRxWI = pRxWI;
|
||||||
RxCell.pHeader = pHeader;
|
RxCell.pHeader = pHeader;
|
||||||
RxCell.pRxPacket = pRxPacket;
|
RxCell.pRxPacket = pRxPacket;
|
||||||
RxCell.pData = (UCHAR *) pHeader;
|
RxCell.pData = (u8 *) pHeader;
|
||||||
RxCell.DataSize = pRxWI->MPDUtotalByteCount;
|
RxCell.DataSize = pRxWI->MPDUtotalByteCount;
|
||||||
RxCell.Flags = 0;
|
RxCell.Flags = 0;
|
||||||
|
|
||||||
@ -833,7 +833,7 @@ BOOLEAN STARxDoneInterruptHandle(IN PRTMP_ADAPTER pAd, IN BOOLEAN argc)
|
|||||||
|
|
||||||
========================================================================
|
========================================================================
|
||||||
*/
|
*/
|
||||||
VOID RTMPHandleTwakeupInterrupt(IN PRTMP_ADAPTER pAd)
|
void RTMPHandleTwakeupInterrupt(IN PRTMP_ADAPTER pAd)
|
||||||
{
|
{
|
||||||
AsicForceWakeup(pAd, FALSE);
|
AsicForceWakeup(pAd, FALSE);
|
||||||
}
|
}
|
||||||
@ -846,7 +846,7 @@ Routine Description:
|
|||||||
Arguments:
|
Arguments:
|
||||||
NDIS_HANDLE MiniportAdapterContext Pointer refer to the device handle, i.e., the pAd.
|
NDIS_HANDLE MiniportAdapterContext Pointer refer to the device handle, i.e., the pAd.
|
||||||
PPNDIS_PACKET ppPacketArray The packet array need to do transmission.
|
PPNDIS_PACKET ppPacketArray The packet array need to do transmission.
|
||||||
UINT NumberOfPackets Number of packet in packet array.
|
u32 NumberOfPackets Number of packet in packet array.
|
||||||
|
|
||||||
Return Value:
|
Return Value:
|
||||||
NONE
|
NONE
|
||||||
@ -856,10 +856,10 @@ Note:
|
|||||||
You only can put OS-depened & STA related code in here.
|
You only can put OS-depened & STA related code in here.
|
||||||
========================================================================
|
========================================================================
|
||||||
*/
|
*/
|
||||||
VOID STASendPackets(IN NDIS_HANDLE MiniportAdapterContext,
|
void STASendPackets(IN NDIS_HANDLE MiniportAdapterContext,
|
||||||
IN PPNDIS_PACKET ppPacketArray, IN UINT NumberOfPackets)
|
IN PPNDIS_PACKET ppPacketArray, u32 NumberOfPackets)
|
||||||
{
|
{
|
||||||
UINT Index;
|
u32 Index;
|
||||||
PRTMP_ADAPTER pAd = (PRTMP_ADAPTER) MiniportAdapterContext;
|
PRTMP_ADAPTER pAd = (PRTMP_ADAPTER) MiniportAdapterContext;
|
||||||
PNDIS_PACKET pPacket;
|
PNDIS_PACKET pPacket;
|
||||||
BOOLEAN allowToSend = FALSE;
|
BOOLEAN allowToSend = FALSE;
|
||||||
@ -920,19 +920,19 @@ Note:
|
|||||||
You only can put OS-indepened & STA related code in here.
|
You only can put OS-indepened & STA related code in here.
|
||||||
========================================================================
|
========================================================================
|
||||||
*/
|
*/
|
||||||
NDIS_STATUS STASendPacket(IN PRTMP_ADAPTER pAd, IN PNDIS_PACKET pPacket)
|
int STASendPacket(IN PRTMP_ADAPTER pAd, IN PNDIS_PACKET pPacket)
|
||||||
{
|
{
|
||||||
PACKET_INFO PacketInfo;
|
PACKET_INFO PacketInfo;
|
||||||
PUCHAR pSrcBufVA;
|
u8 *pSrcBufVA;
|
||||||
UINT SrcBufLen;
|
u32 SrcBufLen;
|
||||||
UINT AllowFragSize;
|
u32 AllowFragSize;
|
||||||
UCHAR NumberOfFrag;
|
u8 NumberOfFrag;
|
||||||
UCHAR RTSRequired;
|
u8 RTSRequired;
|
||||||
UCHAR QueIdx, UserPriority;
|
u8 QueIdx, UserPriority;
|
||||||
MAC_TABLE_ENTRY *pEntry = NULL;
|
MAC_TABLE_ENTRY *pEntry = NULL;
|
||||||
unsigned int IrqFlags;
|
unsigned int IrqFlags;
|
||||||
UCHAR FlgIsIP = 0;
|
u8 FlgIsIP = 0;
|
||||||
UCHAR Rate;
|
u8 Rate;
|
||||||
|
|
||||||
/* Prepare packet information structure for buffer descriptor */
|
/* Prepare packet information structure for buffer descriptor */
|
||||||
/* chained within a single NDIS packet. */
|
/* chained within a single NDIS packet. */
|
||||||
@ -986,7 +986,7 @@ NDIS_STATUS STASendPacket(IN PRTMP_ADAPTER pAd, IN PNDIS_PACKET pPacket)
|
|||||||
|
|
||||||
if (ADHOC_ON(pAd)
|
if (ADHOC_ON(pAd)
|
||||||
) {
|
) {
|
||||||
RTMP_SET_PACKET_WCID(pPacket, (UCHAR) pEntry->Aid);
|
RTMP_SET_PACKET_WCID(pPacket, (u8)pEntry->Aid);
|
||||||
}
|
}
|
||||||
/* */
|
/* */
|
||||||
/* Check the Ethernet Frame type of this packet, and set the RTMP_SET_PACKET_SPECIFIC flags. */
|
/* Check the Ethernet Frame type of this packet, and set the RTMP_SET_PACKET_SPECIFIC flags. */
|
||||||
@ -1079,12 +1079,12 @@ NDIS_STATUS STASendPacket(IN PRTMP_ADAPTER pAd, IN PNDIS_PACKET pPacket)
|
|||||||
QueIdx = QID_AC_BE;
|
QueIdx = QID_AC_BE;
|
||||||
if (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_WMM_INUSED) &&
|
if (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_WMM_INUSED) &&
|
||||||
CLIENT_STATUS_TEST_FLAG(pEntry, fCLIENT_STATUS_WMM_CAPABLE)) {
|
CLIENT_STATUS_TEST_FLAG(pEntry, fCLIENT_STATUS_WMM_CAPABLE)) {
|
||||||
USHORT Protocol;
|
u16 Protocol;
|
||||||
UCHAR LlcSnapLen = 0, Byte0, Byte1;
|
u8 LlcSnapLen = 0, Byte0, Byte1;
|
||||||
do {
|
do {
|
||||||
/* get Ethernet protocol field */
|
/* get Ethernet protocol field */
|
||||||
Protocol =
|
Protocol =
|
||||||
(USHORT) ((pSrcBufVA[12] << 8) + pSrcBufVA[13]);
|
(u16)((pSrcBufVA[12] << 8) + pSrcBufVA[13]);
|
||||||
if (Protocol <= 1500) {
|
if (Protocol <= 1500) {
|
||||||
/* get Ethernet protocol field from LLC/SNAP */
|
/* get Ethernet protocol field from LLC/SNAP */
|
||||||
if (Sniff2BytesFromNdisBuffer
|
if (Sniff2BytesFromNdisBuffer
|
||||||
@ -1092,7 +1092,7 @@ NDIS_STATUS STASendPacket(IN PRTMP_ADAPTER pAd, IN PNDIS_PACKET pPacket)
|
|||||||
&Byte0, &Byte1) != NDIS_STATUS_SUCCESS)
|
&Byte0, &Byte1) != NDIS_STATUS_SUCCESS)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
Protocol = (USHORT) ((Byte0 << 8) + Byte1);
|
Protocol = (u16)((Byte0 << 8) + Byte1);
|
||||||
LlcSnapLen = 8;
|
LlcSnapLen = 8;
|
||||||
}
|
}
|
||||||
/* always AC_BE for non-IP packet */
|
/* always AC_BE for non-IP packet */
|
||||||
@ -1189,12 +1189,12 @@ NDIS_STATUS STASendPacket(IN PRTMP_ADAPTER pAd, IN PNDIS_PACKET pPacket)
|
|||||||
========================================================================
|
========================================================================
|
||||||
*/
|
*/
|
||||||
#ifdef RTMP_MAC_PCI
|
#ifdef RTMP_MAC_PCI
|
||||||
NDIS_STATUS RTMPFreeTXDRequest(IN PRTMP_ADAPTER pAd,
|
int RTMPFreeTXDRequest(IN PRTMP_ADAPTER pAd,
|
||||||
IN UCHAR QueIdx,
|
u8 QueIdx,
|
||||||
IN UCHAR NumberRequired, IN PUCHAR FreeNumberIs)
|
u8 NumberRequired, u8 *FreeNumberIs)
|
||||||
{
|
{
|
||||||
ULONG FreeNumber = 0;
|
unsigned long FreeNumber = 0;
|
||||||
NDIS_STATUS Status = NDIS_STATUS_FAILURE;
|
int Status = NDIS_STATUS_FAILURE;
|
||||||
|
|
||||||
switch (QueIdx) {
|
switch (QueIdx) {
|
||||||
case QID_AC_BK:
|
case QID_AC_BK:
|
||||||
@ -1234,7 +1234,7 @@ NDIS_STATUS RTMPFreeTXDRequest(IN PRTMP_ADAPTER pAd,
|
|||||||
("RTMPFreeTXDRequest::Invalid QueIdx(=%d)\n", QueIdx));
|
("RTMPFreeTXDRequest::Invalid QueIdx(=%d)\n", QueIdx));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
*FreeNumberIs = (UCHAR) FreeNumber;
|
*FreeNumberIs = (u8)FreeNumber;
|
||||||
|
|
||||||
return (Status);
|
return (Status);
|
||||||
}
|
}
|
||||||
@ -1244,12 +1244,12 @@ NDIS_STATUS RTMPFreeTXDRequest(IN PRTMP_ADAPTER pAd,
|
|||||||
Actually, this function used to check if the TxHardware Queue still has frame need to send.
|
Actually, this function used to check if the TxHardware Queue still has frame need to send.
|
||||||
If no frame need to send, go to sleep, else, still wake up.
|
If no frame need to send, go to sleep, else, still wake up.
|
||||||
*/
|
*/
|
||||||
NDIS_STATUS RTMPFreeTXDRequest(IN PRTMP_ADAPTER pAd,
|
int RTMPFreeTXDRequest(IN PRTMP_ADAPTER pAd,
|
||||||
IN UCHAR QueIdx,
|
u8 QueIdx,
|
||||||
IN UCHAR NumberRequired, IN PUCHAR FreeNumberIs)
|
u8 NumberRequired, u8 *FreeNumberIs)
|
||||||
{
|
{
|
||||||
/*ULONG FreeNumber = 0; */
|
/*unsigned long FreeNumber = 0; */
|
||||||
NDIS_STATUS Status = NDIS_STATUS_FAILURE;
|
int Status = NDIS_STATUS_FAILURE;
|
||||||
unsigned long IrqFlags;
|
unsigned long IrqFlags;
|
||||||
HT_TX_CONTEXT *pHTTXContext;
|
HT_TX_CONTEXT *pHTTXContext;
|
||||||
|
|
||||||
@ -1289,15 +1289,15 @@ NDIS_STATUS RTMPFreeTXDRequest(IN PRTMP_ADAPTER pAd,
|
|||||||
}
|
}
|
||||||
#endif /* RTMP_MAC_USB // */
|
#endif /* RTMP_MAC_USB // */
|
||||||
|
|
||||||
VOID RTMPSendDisassociationFrame(IN PRTMP_ADAPTER pAd)
|
void RTMPSendDisassociationFrame(IN PRTMP_ADAPTER pAd)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID RTMPSendNullFrame(IN PRTMP_ADAPTER pAd,
|
void RTMPSendNullFrame(IN PRTMP_ADAPTER pAd,
|
||||||
IN UCHAR TxRate, IN BOOLEAN bQosNull)
|
u8 TxRate, IN BOOLEAN bQosNull)
|
||||||
{
|
{
|
||||||
UCHAR NullFrame[48];
|
u8 NullFrame[48];
|
||||||
ULONG Length;
|
unsigned long Length;
|
||||||
PHEADER_802_11 pHeader_802_11;
|
PHEADER_802_11 pHeader_802_11;
|
||||||
|
|
||||||
/* WPA 802.1x secured port control */
|
/* WPA 802.1x secured port control */
|
||||||
@ -1349,12 +1349,12 @@ VOID RTMPSendNullFrame(IN PRTMP_ADAPTER pAd,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* IRQL = DISPATCH_LEVEL */
|
/* IRQL = DISPATCH_LEVEL */
|
||||||
VOID RTMPSendRTSFrame(IN PRTMP_ADAPTER pAd,
|
void RTMPSendRTSFrame(IN PRTMP_ADAPTER pAd,
|
||||||
IN PUCHAR pDA,
|
u8 *pDA,
|
||||||
IN unsigned int NextMpduSize,
|
IN unsigned int NextMpduSize,
|
||||||
IN UCHAR TxRate,
|
u8 TxRate,
|
||||||
IN UCHAR RTSRate,
|
u8 RTSRate,
|
||||||
IN USHORT AckDuration, IN UCHAR QueIdx, IN UCHAR FrameGap)
|
u16 AckDuration, u8 QueIdx, u8 FrameGap)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1367,12 +1367,12 @@ VOID RTMPSendRTSFrame(IN PRTMP_ADAPTER pAd,
|
|||||||
/* In Cisco CCX 2.0 Leap Authentication */
|
/* In Cisco CCX 2.0 Leap Authentication */
|
||||||
/* WepStatus is Ndis802_11Encryption1Enabled but the key will use PairwiseKey */
|
/* WepStatus is Ndis802_11Encryption1Enabled but the key will use PairwiseKey */
|
||||||
/* Instead of the SharedKey, SharedKey Length may be Zero. */
|
/* Instead of the SharedKey, SharedKey Length may be Zero. */
|
||||||
VOID STAFindCipherAlgorithm(IN PRTMP_ADAPTER pAd, IN TX_BLK * pTxBlk)
|
void STAFindCipherAlgorithm(IN PRTMP_ADAPTER pAd, IN TX_BLK * pTxBlk)
|
||||||
{
|
{
|
||||||
NDIS_802_11_ENCRYPTION_STATUS Cipher; /* To indicate cipher used for this packet */
|
NDIS_802_11_ENCRYPTION_STATUS Cipher; /* To indicate cipher used for this packet */
|
||||||
UCHAR CipherAlg = CIPHER_NONE; /* cipher alogrithm */
|
u8 CipherAlg = CIPHER_NONE; /* cipher alogrithm */
|
||||||
UCHAR KeyIdx = 0xff;
|
u8 KeyIdx = 0xff;
|
||||||
PUCHAR pSrcBufVA;
|
u8 *pSrcBufVA;
|
||||||
PCIPHER_KEY pKey = NULL;
|
PCIPHER_KEY pKey = NULL;
|
||||||
|
|
||||||
pSrcBufVA = GET_OS_PKT_DATAPTR(pTxBlk->pPacket);
|
pSrcBufVA = GET_OS_PKT_DATAPTR(pTxBlk->pPacket);
|
||||||
@ -1429,7 +1429,7 @@ VOID STAFindCipherAlgorithm(IN PRTMP_ADAPTER pAd, IN TX_BLK * pTxBlk)
|
|||||||
pTxBlk->pKey = pKey;
|
pTxBlk->pKey = pKey;
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID STABuildCommon802_11Header(IN PRTMP_ADAPTER pAd, IN TX_BLK * pTxBlk)
|
void STABuildCommon802_11Header(IN PRTMP_ADAPTER pAd, IN TX_BLK * pTxBlk)
|
||||||
{
|
{
|
||||||
HEADER_802_11 *pHeader_802_11;
|
HEADER_802_11 *pHeader_802_11;
|
||||||
|
|
||||||
@ -1510,8 +1510,8 @@ VOID STABuildCommon802_11Header(IN PRTMP_ADAPTER pAd, IN TX_BLK * pTxBlk)
|
|||||||
pHeader_802_11->FC.PwrMgmt = (pAd->StaCfg.Psm == PWR_SAVE);
|
pHeader_802_11->FC.PwrMgmt = (pAd->StaCfg.Psm == PWR_SAVE);
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID STABuildCache802_11Header(IN RTMP_ADAPTER * pAd,
|
void STABuildCache802_11Header(IN RTMP_ADAPTER * pAd,
|
||||||
IN TX_BLK * pTxBlk, IN UCHAR * pHeader)
|
IN TX_BLK * pTxBlk, u8 * pHeader)
|
||||||
{
|
{
|
||||||
MAC_TABLE_ENTRY *pMacEntry;
|
MAC_TABLE_ENTRY *pMacEntry;
|
||||||
PHEADER_802_11 pHeader80211;
|
PHEADER_802_11 pHeader80211;
|
||||||
@ -1556,13 +1556,13 @@ VOID STABuildCache802_11Header(IN RTMP_ADAPTER * pAd,
|
|||||||
pHeader80211->FC.PwrMgmt = (pAd->StaCfg.Psm == PWR_SAVE);
|
pHeader80211->FC.PwrMgmt = (pAd->StaCfg.Psm == PWR_SAVE);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline PUCHAR STA_Build_ARalink_Frame_Header(IN RTMP_ADAPTER * pAd,
|
static inline u8 *STA_Build_ARalink_Frame_Header(IN RTMP_ADAPTER * pAd,
|
||||||
IN TX_BLK * pTxBlk)
|
IN TX_BLK * pTxBlk)
|
||||||
{
|
{
|
||||||
PUCHAR pHeaderBufPtr;
|
u8 *pHeaderBufPtr;
|
||||||
HEADER_802_11 *pHeader_802_11;
|
HEADER_802_11 *pHeader_802_11;
|
||||||
PNDIS_PACKET pNextPacket;
|
PNDIS_PACKET pNextPacket;
|
||||||
UINT32 nextBufLen;
|
u32 nextBufLen;
|
||||||
PQUEUE_ENTRY pQEntry;
|
PQUEUE_ENTRY pQEntry;
|
||||||
|
|
||||||
STAFindCipherAlgorithm(pAd, pTxBlk);
|
STAFindCipherAlgorithm(pAd, pTxBlk);
|
||||||
@ -1588,9 +1588,9 @@ static inline PUCHAR STA_Build_ARalink_Frame_Header(IN RTMP_ADAPTER * pAd,
|
|||||||
pTxBlk->MpduHeaderLen += 2;
|
pTxBlk->MpduHeaderLen += 2;
|
||||||
}
|
}
|
||||||
/* padding at front of LLC header. LLC header should at 4-bytes aligment. */
|
/* padding at front of LLC header. LLC header should at 4-bytes aligment. */
|
||||||
pTxBlk->HdrPadLen = (ULONG) pHeaderBufPtr;
|
pTxBlk->HdrPadLen = (unsigned long)pHeaderBufPtr;
|
||||||
pHeaderBufPtr = (PUCHAR) ROUND_UP(pHeaderBufPtr, 4);
|
pHeaderBufPtr = (u8 *)ROUND_UP(pHeaderBufPtr, 4);
|
||||||
pTxBlk->HdrPadLen = (ULONG) (pHeaderBufPtr - pTxBlk->HdrPadLen);
|
pTxBlk->HdrPadLen = (unsigned long)(pHeaderBufPtr - pTxBlk->HdrPadLen);
|
||||||
|
|
||||||
/* For RA Aggregation, */
|
/* For RA Aggregation, */
|
||||||
/* put the 2nd MSDU length(extra 2-byte field) after QOS_CONTROL in little endian format */
|
/* put the 2nd MSDU length(extra 2-byte field) after QOS_CONTROL in little endian format */
|
||||||
@ -1600,8 +1600,8 @@ static inline PUCHAR STA_Build_ARalink_Frame_Header(IN RTMP_ADAPTER * pAd,
|
|||||||
if (RTMP_GET_PACKET_VLAN(pNextPacket))
|
if (RTMP_GET_PACKET_VLAN(pNextPacket))
|
||||||
nextBufLen -= LENGTH_802_1Q;
|
nextBufLen -= LENGTH_802_1Q;
|
||||||
|
|
||||||
*pHeaderBufPtr = (UCHAR) nextBufLen & 0xff;
|
*pHeaderBufPtr = (u8)nextBufLen & 0xff;
|
||||||
*(pHeaderBufPtr + 1) = (UCHAR) (nextBufLen >> 8);
|
*(pHeaderBufPtr + 1) = (u8)(nextBufLen >> 8);
|
||||||
|
|
||||||
pHeaderBufPtr += 2;
|
pHeaderBufPtr += 2;
|
||||||
pTxBlk->MpduHeaderLen += 2;
|
pTxBlk->MpduHeaderLen += 2;
|
||||||
@ -1610,10 +1610,10 @@ static inline PUCHAR STA_Build_ARalink_Frame_Header(IN RTMP_ADAPTER * pAd,
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline PUCHAR STA_Build_AMSDU_Frame_Header(IN RTMP_ADAPTER * pAd,
|
static inline u8 *STA_Build_AMSDU_Frame_Header(IN RTMP_ADAPTER * pAd,
|
||||||
IN TX_BLK * pTxBlk)
|
IN TX_BLK * pTxBlk)
|
||||||
{
|
{
|
||||||
PUCHAR pHeaderBufPtr; /*, pSaveBufPtr; */
|
u8 *pHeaderBufPtr; /*, pSaveBufPtr; */
|
||||||
HEADER_802_11 *pHeader_802_11;
|
HEADER_802_11 *pHeader_802_11;
|
||||||
|
|
||||||
STAFindCipherAlgorithm(pAd, pTxBlk);
|
STAFindCipherAlgorithm(pAd, pTxBlk);
|
||||||
@ -1647,19 +1647,19 @@ static inline PUCHAR STA_Build_AMSDU_Frame_Header(IN RTMP_ADAPTER * pAd,
|
|||||||
/* */
|
/* */
|
||||||
/* @@@ MpduHeaderLen excluding padding @@@ */
|
/* @@@ MpduHeaderLen excluding padding @@@ */
|
||||||
/* */
|
/* */
|
||||||
pTxBlk->HdrPadLen = (ULONG) pHeaderBufPtr;
|
pTxBlk->HdrPadLen = (unsigned long)pHeaderBufPtr;
|
||||||
pHeaderBufPtr = (PUCHAR) ROUND_UP(pHeaderBufPtr, 4);
|
pHeaderBufPtr = (u8 *)ROUND_UP(pHeaderBufPtr, 4);
|
||||||
pTxBlk->HdrPadLen = (ULONG) (pHeaderBufPtr - pTxBlk->HdrPadLen);
|
pTxBlk->HdrPadLen = (unsigned long)(pHeaderBufPtr - pTxBlk->HdrPadLen);
|
||||||
|
|
||||||
return pHeaderBufPtr;
|
return pHeaderBufPtr;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID STA_AMPDU_Frame_Tx(IN PRTMP_ADAPTER pAd, IN TX_BLK * pTxBlk)
|
void STA_AMPDU_Frame_Tx(IN PRTMP_ADAPTER pAd, IN TX_BLK * pTxBlk)
|
||||||
{
|
{
|
||||||
HEADER_802_11 *pHeader_802_11;
|
HEADER_802_11 *pHeader_802_11;
|
||||||
PUCHAR pHeaderBufPtr;
|
u8 *pHeaderBufPtr;
|
||||||
USHORT FreeNumber;
|
u16 FreeNumber;
|
||||||
MAC_TABLE_ENTRY *pMacEntry;
|
MAC_TABLE_ENTRY *pMacEntry;
|
||||||
BOOLEAN bVLANPkt;
|
BOOLEAN bVLANPkt;
|
||||||
PQUEUE_ENTRY pQEntry;
|
PQUEUE_ENTRY pQEntry;
|
||||||
@ -1681,12 +1681,12 @@ VOID STA_AMPDU_Frame_Tx(IN PRTMP_ADAPTER pAd, IN TX_BLK * pTxBlk)
|
|||||||
pMacEntry = pTxBlk->pMacEntry;
|
pMacEntry = pTxBlk->pMacEntry;
|
||||||
if (pMacEntry->isCached) {
|
if (pMacEntry->isCached) {
|
||||||
/* NOTE: Please make sure the size of pMacEntry->CachedBuf[] is smaller than pTxBlk->HeaderBuf[]!!!! */
|
/* NOTE: Please make sure the size of pMacEntry->CachedBuf[] is smaller than pTxBlk->HeaderBuf[]!!!! */
|
||||||
NdisMoveMemory((PUCHAR) & pTxBlk->
|
NdisMoveMemory((u8 *)& pTxBlk->
|
||||||
HeaderBuf[TXINFO_SIZE],
|
HeaderBuf[TXINFO_SIZE],
|
||||||
(PUCHAR) & pMacEntry->CachedBuf[0],
|
(u8 *)& pMacEntry->CachedBuf[0],
|
||||||
TXWI_SIZE + sizeof(HEADER_802_11));
|
TXWI_SIZE + sizeof(HEADER_802_11));
|
||||||
pHeaderBufPtr =
|
pHeaderBufPtr =
|
||||||
(PUCHAR) (&pTxBlk->
|
(u8 *)(&pTxBlk->
|
||||||
HeaderBuf[TXINFO_SIZE + TXWI_SIZE]);
|
HeaderBuf[TXINFO_SIZE + TXWI_SIZE]);
|
||||||
STABuildCache802_11Header(pAd, pTxBlk, pHeaderBufPtr);
|
STABuildCache802_11Header(pAd, pTxBlk, pHeaderBufPtr);
|
||||||
} else {
|
} else {
|
||||||
@ -1745,9 +1745,9 @@ VOID STA_AMPDU_Frame_Tx(IN PRTMP_ADAPTER pAd, IN TX_BLK * pTxBlk)
|
|||||||
/* */
|
/* */
|
||||||
/* @@@ MpduHeaderLen excluding padding @@@ */
|
/* @@@ MpduHeaderLen excluding padding @@@ */
|
||||||
/* */
|
/* */
|
||||||
pTxBlk->HdrPadLen = (ULONG) pHeaderBufPtr;
|
pTxBlk->HdrPadLen = (unsigned long)pHeaderBufPtr;
|
||||||
pHeaderBufPtr = (PUCHAR) ROUND_UP(pHeaderBufPtr, 4);
|
pHeaderBufPtr = (u8 *)ROUND_UP(pHeaderBufPtr, 4);
|
||||||
pTxBlk->HdrPadLen = (ULONG) (pHeaderBufPtr - pTxBlk->HdrPadLen);
|
pTxBlk->HdrPadLen = (unsigned long)(pHeaderBufPtr - pTxBlk->HdrPadLen);
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|
||||||
@ -1784,13 +1784,13 @@ VOID STA_AMPDU_Frame_Tx(IN PRTMP_ADAPTER pAd, IN TX_BLK * pTxBlk)
|
|||||||
[TXINFO_SIZE]),
|
[TXINFO_SIZE]),
|
||||||
pTxBlk);
|
pTxBlk);
|
||||||
|
|
||||||
NdisZeroMemory((PUCHAR) (&pMacEntry->CachedBuf[0]),
|
NdisZeroMemory((u8 *)(&pMacEntry->CachedBuf[0]),
|
||||||
sizeof(pMacEntry->CachedBuf));
|
sizeof(pMacEntry->CachedBuf));
|
||||||
NdisMoveMemory((PUCHAR) (&pMacEntry->CachedBuf[0]),
|
NdisMoveMemory((u8 *)(&pMacEntry->CachedBuf[0]),
|
||||||
(PUCHAR) (&pTxBlk->
|
(u8 *)(&pTxBlk->
|
||||||
HeaderBuf[TXINFO_SIZE]),
|
HeaderBuf[TXINFO_SIZE]),
|
||||||
(pHeaderBufPtr -
|
(pHeaderBufPtr -
|
||||||
(PUCHAR) (&pTxBlk->
|
(u8 *)(&pTxBlk->
|
||||||
HeaderBuf[TXINFO_SIZE])));
|
HeaderBuf[TXINFO_SIZE])));
|
||||||
pMacEntry->isCached = TRUE;
|
pMacEntry->isCached = TRUE;
|
||||||
}
|
}
|
||||||
@ -1819,15 +1819,15 @@ VOID STA_AMPDU_Frame_Tx(IN PRTMP_ADAPTER pAd, IN TX_BLK * pTxBlk)
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID STA_AMSDU_Frame_Tx(IN PRTMP_ADAPTER pAd, IN TX_BLK * pTxBlk)
|
void STA_AMSDU_Frame_Tx(IN PRTMP_ADAPTER pAd, IN TX_BLK * pTxBlk)
|
||||||
{
|
{
|
||||||
PUCHAR pHeaderBufPtr;
|
u8 *pHeaderBufPtr;
|
||||||
USHORT FreeNumber;
|
u16 FreeNumber;
|
||||||
USHORT subFramePayloadLen = 0; /* AMSDU Subframe length without AMSDU-Header / Padding. */
|
u16 subFramePayloadLen = 0; /* AMSDU Subframe length without AMSDU-Header / Padding. */
|
||||||
USHORT totalMPDUSize = 0;
|
u16 totalMPDUSize = 0;
|
||||||
UCHAR *subFrameHeader;
|
u8 *subFrameHeader;
|
||||||
UCHAR padding = 0;
|
u8 padding = 0;
|
||||||
USHORT FirstTx = 0, LastTxIdx = 0;
|
u16 FirstTx = 0, LastTxIdx = 0;
|
||||||
BOOLEAN bVLANPkt;
|
BOOLEAN bVLANPkt;
|
||||||
int frameNum = 0;
|
int frameNum = 0;
|
||||||
PQUEUE_ENTRY pQEntry;
|
PQUEUE_ENTRY pQEntry;
|
||||||
@ -1951,11 +1951,11 @@ VOID STA_AMSDU_Frame_Tx(IN PRTMP_ADAPTER pAd, IN TX_BLK * pTxBlk)
|
|||||||
HAL_KickOutTx(pAd, pTxBlk, pTxBlk->QueIdx);
|
HAL_KickOutTx(pAd, pTxBlk, pTxBlk->QueIdx);
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID STA_Legacy_Frame_Tx(IN PRTMP_ADAPTER pAd, IN TX_BLK * pTxBlk)
|
void STA_Legacy_Frame_Tx(IN PRTMP_ADAPTER pAd, IN TX_BLK * pTxBlk)
|
||||||
{
|
{
|
||||||
HEADER_802_11 *pHeader_802_11;
|
HEADER_802_11 *pHeader_802_11;
|
||||||
PUCHAR pHeaderBufPtr;
|
u8 *pHeaderBufPtr;
|
||||||
USHORT FreeNumber;
|
u16 FreeNumber;
|
||||||
BOOLEAN bVLANPkt;
|
BOOLEAN bVLANPkt;
|
||||||
PQUEUE_ENTRY pQEntry;
|
PQUEUE_ENTRY pQEntry;
|
||||||
|
|
||||||
@ -2014,9 +2014,9 @@ VOID STA_Legacy_Frame_Tx(IN PRTMP_ADAPTER pAd, IN TX_BLK * pTxBlk)
|
|||||||
pTxBlk->MpduHeaderLen += 2;
|
pTxBlk->MpduHeaderLen += 2;
|
||||||
}
|
}
|
||||||
/* The remaining content of MPDU header should locate at 4-octets aligment */
|
/* The remaining content of MPDU header should locate at 4-octets aligment */
|
||||||
pTxBlk->HdrPadLen = (ULONG) pHeaderBufPtr;
|
pTxBlk->HdrPadLen = (unsigned long)pHeaderBufPtr;
|
||||||
pHeaderBufPtr = (PUCHAR) ROUND_UP(pHeaderBufPtr, 4);
|
pHeaderBufPtr = (u8 *)ROUND_UP(pHeaderBufPtr, 4);
|
||||||
pTxBlk->HdrPadLen = (ULONG) (pHeaderBufPtr - pTxBlk->HdrPadLen);
|
pTxBlk->HdrPadLen = (unsigned long)(pHeaderBufPtr - pTxBlk->HdrPadLen);
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|
||||||
@ -2030,7 +2030,7 @@ VOID STA_Legacy_Frame_Tx(IN PRTMP_ADAPTER pAd, IN TX_BLK * pTxBlk)
|
|||||||
EXTRA_LLCSNAP_ENCAP_FROM_PKT_START(pTxBlk->pSrcBufHeader,
|
EXTRA_LLCSNAP_ENCAP_FROM_PKT_START(pTxBlk->pSrcBufHeader,
|
||||||
pTxBlk->pExtraLlcSnapEncap);
|
pTxBlk->pExtraLlcSnapEncap);
|
||||||
if (pTxBlk->pExtraLlcSnapEncap) {
|
if (pTxBlk->pExtraLlcSnapEncap) {
|
||||||
UCHAR vlan_size;
|
u8 vlan_size;
|
||||||
|
|
||||||
NdisMoveMemory(pHeaderBufPtr,
|
NdisMoveMemory(pHeaderBufPtr,
|
||||||
pTxBlk->pExtraLlcSnapEncap, 6);
|
pTxBlk->pExtraLlcSnapEncap, 6);
|
||||||
@ -2069,12 +2069,12 @@ VOID STA_Legacy_Frame_Tx(IN PRTMP_ADAPTER pAd, IN TX_BLK * pTxBlk)
|
|||||||
HAL_KickOutTx(pAd, pTxBlk, pTxBlk->QueIdx);
|
HAL_KickOutTx(pAd, pTxBlk, pTxBlk->QueIdx);
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID STA_ARalink_Frame_Tx(IN PRTMP_ADAPTER pAd, IN TX_BLK * pTxBlk)
|
void STA_ARalink_Frame_Tx(IN PRTMP_ADAPTER pAd, IN TX_BLK * pTxBlk)
|
||||||
{
|
{
|
||||||
PUCHAR pHeaderBufPtr;
|
u8 *pHeaderBufPtr;
|
||||||
USHORT FreeNumber;
|
u16 FreeNumber;
|
||||||
USHORT totalMPDUSize = 0;
|
u16 totalMPDUSize = 0;
|
||||||
USHORT FirstTx, LastTxIdx;
|
u16 FirstTx, LastTxIdx;
|
||||||
int frameNum = 0;
|
int frameNum = 0;
|
||||||
BOOLEAN bVLANPkt;
|
BOOLEAN bVLANPkt;
|
||||||
PQUEUE_ENTRY pQEntry;
|
PQUEUE_ENTRY pQEntry;
|
||||||
@ -2186,17 +2186,17 @@ VOID STA_ARalink_Frame_Tx(IN PRTMP_ADAPTER pAd, IN TX_BLK * pTxBlk)
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID STA_Fragment_Frame_Tx(IN RTMP_ADAPTER * pAd, IN TX_BLK * pTxBlk)
|
void STA_Fragment_Frame_Tx(IN RTMP_ADAPTER * pAd, IN TX_BLK * pTxBlk)
|
||||||
{
|
{
|
||||||
HEADER_802_11 *pHeader_802_11;
|
HEADER_802_11 *pHeader_802_11;
|
||||||
PUCHAR pHeaderBufPtr;
|
u8 *pHeaderBufPtr;
|
||||||
USHORT FreeNumber;
|
u16 FreeNumber;
|
||||||
UCHAR fragNum = 0;
|
u8 fragNum = 0;
|
||||||
PACKET_INFO PacketInfo;
|
PACKET_INFO PacketInfo;
|
||||||
USHORT EncryptionOverhead = 0;
|
u16 EncryptionOverhead = 0;
|
||||||
UINT32 FreeMpduSize, SrcRemainingBytes;
|
u32 FreeMpduSize, SrcRemainingBytes;
|
||||||
USHORT AckDuration;
|
u16 AckDuration;
|
||||||
UINT NextMpduSize;
|
u32 NextMpduSize;
|
||||||
BOOLEAN bVLANPkt;
|
BOOLEAN bVLANPkt;
|
||||||
PQUEUE_ENTRY pQEntry;
|
PQUEUE_ENTRY pQEntry;
|
||||||
HTTRANSMIT_SETTING *pTransmit;
|
HTTRANSMIT_SETTING *pTransmit;
|
||||||
@ -2255,9 +2255,9 @@ VOID STA_Fragment_Frame_Tx(IN RTMP_ADAPTER * pAd, IN TX_BLK * pTxBlk)
|
|||||||
/* padding at front of LLC header */
|
/* padding at front of LLC header */
|
||||||
/* LLC header should locate at 4-octets aligment */
|
/* LLC header should locate at 4-octets aligment */
|
||||||
/* */
|
/* */
|
||||||
pTxBlk->HdrPadLen = (ULONG) pHeaderBufPtr;
|
pTxBlk->HdrPadLen = (unsigned long)pHeaderBufPtr;
|
||||||
pHeaderBufPtr = (PUCHAR) ROUND_UP(pHeaderBufPtr, 4);
|
pHeaderBufPtr = (u8 *)ROUND_UP(pHeaderBufPtr, 4);
|
||||||
pTxBlk->HdrPadLen = (ULONG) (pHeaderBufPtr - pTxBlk->HdrPadLen);
|
pTxBlk->HdrPadLen = (unsigned long)(pHeaderBufPtr - pTxBlk->HdrPadLen);
|
||||||
|
|
||||||
/* */
|
/* */
|
||||||
/* Insert LLC-SNAP encapsulation - 8 octets */
|
/* Insert LLC-SNAP encapsulation - 8 octets */
|
||||||
@ -2269,7 +2269,7 @@ VOID STA_Fragment_Frame_Tx(IN RTMP_ADAPTER * pAd, IN TX_BLK * pTxBlk)
|
|||||||
EXTRA_LLCSNAP_ENCAP_FROM_PKT_START(pTxBlk->pSrcBufHeader,
|
EXTRA_LLCSNAP_ENCAP_FROM_PKT_START(pTxBlk->pSrcBufHeader,
|
||||||
pTxBlk->pExtraLlcSnapEncap);
|
pTxBlk->pExtraLlcSnapEncap);
|
||||||
if (pTxBlk->pExtraLlcSnapEncap) {
|
if (pTxBlk->pExtraLlcSnapEncap) {
|
||||||
UCHAR vlan_size;
|
u8 vlan_size;
|
||||||
|
|
||||||
NdisMoveMemory(pHeaderBufPtr, pTxBlk->pExtraLlcSnapEncap, 6);
|
NdisMoveMemory(pHeaderBufPtr, pTxBlk->pExtraLlcSnapEncap, 6);
|
||||||
pHeaderBufPtr += 6;
|
pHeaderBufPtr += 6;
|
||||||
@ -2360,8 +2360,8 @@ VOID STA_Fragment_Frame_Tx(IN RTMP_ADAPTER * pAd, IN TX_BLK * pTxBlk)
|
|||||||
pTxBlk->SrcBufLen = FreeMpduSize;
|
pTxBlk->SrcBufLen = FreeMpduSize;
|
||||||
|
|
||||||
NextMpduSize =
|
NextMpduSize =
|
||||||
min(((UINT) SrcRemainingBytes - pTxBlk->SrcBufLen),
|
min(((u32)SrcRemainingBytes - pTxBlk->SrcBufLen),
|
||||||
((UINT) pAd->CommonCfg.FragmentThreshold));
|
((u32)pAd->CommonCfg.FragmentThreshold));
|
||||||
pHeader_802_11->FC.MoreFrag = 1;
|
pHeader_802_11->FC.MoreFrag = 1;
|
||||||
pHeader_802_11->Duration =
|
pHeader_802_11->Duration =
|
||||||
(3 * pAd->CommonCfg.Dsifs) + (2 * AckDuration) +
|
(3 * pAd->CommonCfg.Dsifs) + (2 * AckDuration) +
|
||||||
@ -2434,8 +2434,8 @@ VOID STA_Fragment_Frame_Tx(IN RTMP_ADAPTER * pAd, IN TX_BLK * pTxBlk)
|
|||||||
|
|
||||||
========================================================================
|
========================================================================
|
||||||
*/
|
*/
|
||||||
NDIS_STATUS STAHardTransmit(IN PRTMP_ADAPTER pAd,
|
int STAHardTransmit(IN PRTMP_ADAPTER pAd,
|
||||||
IN TX_BLK * pTxBlk, IN UCHAR QueIdx)
|
IN TX_BLK * pTxBlk, u8 QueIdx)
|
||||||
{
|
{
|
||||||
NDIS_PACKET *pPacket;
|
NDIS_PACKET *pPacket;
|
||||||
PQUEUE_ENTRY pQEntry;
|
PQUEUE_ENTRY pQEntry;
|
||||||
@ -2523,7 +2523,7 @@ NDIS_STATUS STAHardTransmit(IN PRTMP_ADAPTER pAd,
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ULONG HashBytesPolynomial(UCHAR * value, unsigned int len)
|
unsigned long HashBytesPolynomial(u8 * value, unsigned int len)
|
||||||
{
|
{
|
||||||
unsigned char *word = value;
|
unsigned char *word = value;
|
||||||
unsigned int ret = 0;
|
unsigned int ret = 0;
|
||||||
@ -2537,9 +2537,9 @@ ULONG HashBytesPolynomial(UCHAR * value, unsigned int len)
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID Sta_Announce_or_Forward_802_3_Packet(IN PRTMP_ADAPTER pAd,
|
void Sta_Announce_or_Forward_802_3_Packet(IN PRTMP_ADAPTER pAd,
|
||||||
IN PNDIS_PACKET pPacket,
|
IN PNDIS_PACKET pPacket,
|
||||||
IN UCHAR FromWhichBSSID)
|
u8 FromWhichBSSID)
|
||||||
{
|
{
|
||||||
if (TRUE) {
|
if (TRUE) {
|
||||||
announce_802_3_packet(pAd, pPacket);
|
announce_802_3_packet(pAd, pPacket);
|
||||||
|
@ -36,15 +36,15 @@
|
|||||||
*/
|
*/
|
||||||
#include "../rt_config.h"
|
#include "../rt_config.h"
|
||||||
|
|
||||||
extern UCHAR CISCO_OUI[];
|
extern u8 CISCO_OUI[];
|
||||||
|
|
||||||
extern UCHAR WPA_OUI[];
|
extern u8 WPA_OUI[];
|
||||||
extern UCHAR RSN_OUI[];
|
extern u8 RSN_OUI[];
|
||||||
extern UCHAR WME_INFO_ELEM[];
|
extern u8 WME_INFO_ELEM[];
|
||||||
extern UCHAR WME_PARM_ELEM[];
|
extern u8 WME_PARM_ELEM[];
|
||||||
extern UCHAR Ccx2QosInfo[];
|
extern u8 Ccx2QosInfo[];
|
||||||
extern UCHAR RALINK_OUI[];
|
extern u8 RALINK_OUI[];
|
||||||
extern UCHAR BROADCOM_OUI[];
|
extern u8 BROADCOM_OUI[];
|
||||||
|
|
||||||
/*
|
/*
|
||||||
==========================================================================
|
==========================================================================
|
||||||
@ -55,9 +55,9 @@ extern UCHAR BROADCOM_OUI[];
|
|||||||
==========================================================================
|
==========================================================================
|
||||||
*/
|
*/
|
||||||
BOOLEAN MlmeStartReqSanity(IN PRTMP_ADAPTER pAd,
|
BOOLEAN MlmeStartReqSanity(IN PRTMP_ADAPTER pAd,
|
||||||
IN VOID * Msg,
|
void * Msg,
|
||||||
IN ULONG MsgLen,
|
unsigned long MsgLen,
|
||||||
OUT CHAR Ssid[], OUT UCHAR * pSsidLen)
|
char Ssid[], u8 * pSsidLen)
|
||||||
{
|
{
|
||||||
MLME_START_REQ_STRUCT *Info;
|
MLME_START_REQ_STRUCT *Info;
|
||||||
|
|
||||||
@ -86,22 +86,22 @@ BOOLEAN MlmeStartReqSanity(IN PRTMP_ADAPTER pAd,
|
|||||||
|
|
||||||
==========================================================================
|
==========================================================================
|
||||||
*/
|
*/
|
||||||
BOOLEAN PeerAssocRspSanity(IN PRTMP_ADAPTER pAd, IN VOID * pMsg, IN ULONG MsgLen, OUT PUCHAR pAddr2, OUT USHORT * pCapabilityInfo, OUT USHORT * pStatus, OUT USHORT * pAid, OUT UCHAR SupRate[], OUT UCHAR * pSupRateLen, OUT UCHAR ExtRate[], OUT UCHAR * pExtRateLen, OUT HT_CAPABILITY_IE * pHtCapability, OUT ADD_HT_INFO_IE * pAddHtInfo, /* AP might use this additional ht info IE */
|
BOOLEAN PeerAssocRspSanity(IN PRTMP_ADAPTER pAd, void * pMsg, unsigned long MsgLen, u8 *pAddr2, u16 * pCapabilityInfo, u16 * pStatus, u16 * pAid, u8 SupRate[], u8 * pSupRateLen, u8 ExtRate[], u8 * pExtRateLen, OUT HT_CAPABILITY_IE * pHtCapability, OUT ADD_HT_INFO_IE * pAddHtInfo, /* AP might use this additional ht info IE */
|
||||||
OUT UCHAR * pHtCapabilityLen,
|
u8 * pHtCapabilityLen,
|
||||||
OUT UCHAR * pAddHtInfoLen,
|
u8 * pAddHtInfoLen,
|
||||||
OUT UCHAR * pNewExtChannelOffset,
|
u8 * pNewExtChannelOffset,
|
||||||
OUT PEDCA_PARM pEdcaParm, OUT UCHAR * pCkipFlag)
|
OUT PEDCA_PARM pEdcaParm, u8 * pCkipFlag)
|
||||||
{
|
{
|
||||||
CHAR IeType, *Ptr;
|
char IeType, *Ptr;
|
||||||
PFRAME_802_11 pFrame = (PFRAME_802_11) pMsg;
|
PFRAME_802_11 pFrame = (PFRAME_802_11) pMsg;
|
||||||
PEID_STRUCT pEid;
|
PEID_STRUCT pEid;
|
||||||
ULONG Length = 0;
|
unsigned long Length = 0;
|
||||||
|
|
||||||
*pNewExtChannelOffset = 0xff;
|
*pNewExtChannelOffset = 0xff;
|
||||||
*pHtCapabilityLen = 0;
|
*pHtCapabilityLen = 0;
|
||||||
*pAddHtInfoLen = 0;
|
*pAddHtInfoLen = 0;
|
||||||
COPY_MAC_ADDR(pAddr2, pFrame->Hdr.Addr2);
|
COPY_MAC_ADDR(pAddr2, pFrame->Hdr.Addr2);
|
||||||
Ptr = (PCHAR) pFrame->Octet;
|
Ptr = (char *)pFrame->Octet;
|
||||||
Length += LENGTH_802_11;
|
Length += LENGTH_802_11;
|
||||||
|
|
||||||
NdisMoveMemory(pCapabilityInfo, &pFrame->Octet[0], 2);
|
NdisMoveMemory(pCapabilityInfo, &pFrame->Octet[0], 2);
|
||||||
@ -155,11 +155,11 @@ BOOLEAN PeerAssocRspSanity(IN PRTMP_ADAPTER pAd, IN VOID * pMsg, IN ULONG MsgLen
|
|||||||
NdisMoveMemory(pHtCapability, pEid->Octet,
|
NdisMoveMemory(pHtCapability, pEid->Octet,
|
||||||
SIZE_HT_CAP_IE);
|
SIZE_HT_CAP_IE);
|
||||||
|
|
||||||
*(USHORT *) (&pHtCapability->HtCapInfo) =
|
*(u16 *) (&pHtCapability->HtCapInfo) =
|
||||||
cpu2le16(*(USHORT *)
|
cpu2le16(*(u16 *)
|
||||||
(&pHtCapability->HtCapInfo));
|
(&pHtCapability->HtCapInfo));
|
||||||
*(USHORT *) (&pHtCapability->ExtHtCapInfo) =
|
*(u16 *) (&pHtCapability->ExtHtCapInfo) =
|
||||||
cpu2le16(*(USHORT *)
|
cpu2le16(*(u16 *)
|
||||||
(&pHtCapability->ExtHtCapInfo));
|
(&pHtCapability->ExtHtCapInfo));
|
||||||
|
|
||||||
*pHtCapabilityLen = SIZE_HT_CAP_IE;
|
*pHtCapabilityLen = SIZE_HT_CAP_IE;
|
||||||
@ -177,11 +177,11 @@ BOOLEAN PeerAssocRspSanity(IN PRTMP_ADAPTER pAd, IN VOID * pMsg, IN ULONG MsgLen
|
|||||||
NdisMoveMemory(pAddHtInfo, pEid->Octet,
|
NdisMoveMemory(pAddHtInfo, pEid->Octet,
|
||||||
sizeof(ADD_HT_INFO_IE));
|
sizeof(ADD_HT_INFO_IE));
|
||||||
|
|
||||||
*(USHORT *) (&pAddHtInfo->AddHtInfo2) =
|
*(u16 *) (&pAddHtInfo->AddHtInfo2) =
|
||||||
cpu2le16(*(USHORT *)
|
cpu2le16(*(u16 *)
|
||||||
(&pAddHtInfo->AddHtInfo2));
|
(&pAddHtInfo->AddHtInfo2));
|
||||||
*(USHORT *) (&pAddHtInfo->AddHtInfo3) =
|
*(u16 *) (&pAddHtInfo->AddHtInfo3) =
|
||||||
cpu2le16(*(USHORT *)
|
cpu2le16(*(u16 *)
|
||||||
(&pAddHtInfo->AddHtInfo3));
|
(&pAddHtInfo->AddHtInfo3));
|
||||||
|
|
||||||
*pAddHtInfoLen = SIZE_ADD_HT_INFO_IE;
|
*pAddHtInfoLen = SIZE_ADD_HT_INFO_IE;
|
||||||
@ -204,7 +204,7 @@ BOOLEAN PeerAssocRspSanity(IN PRTMP_ADAPTER pAd, IN VOID * pMsg, IN ULONG MsgLen
|
|||||||
/* handle WME PARAMTER ELEMENT */
|
/* handle WME PARAMTER ELEMENT */
|
||||||
if (NdisEqualMemory(pEid->Octet, WME_PARM_ELEM, 6)
|
if (NdisEqualMemory(pEid->Octet, WME_PARM_ELEM, 6)
|
||||||
&& (pEid->Len == 24)) {
|
&& (pEid->Len == 24)) {
|
||||||
PUCHAR ptr;
|
u8 *ptr;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
/* parsing EDCA parameters */
|
/* parsing EDCA parameters */
|
||||||
@ -217,9 +217,9 @@ BOOLEAN PeerAssocRspSanity(IN PRTMP_ADAPTER pAd, IN VOID * pMsg, IN ULONG MsgLen
|
|||||||
pEid->Octet[6] & 0x0f;
|
pEid->Octet[6] & 0x0f;
|
||||||
pEdcaParm->bAPSDCapable =
|
pEdcaParm->bAPSDCapable =
|
||||||
(pEid->Octet[6] & 0x80) ? 1 : 0;
|
(pEid->Octet[6] & 0x80) ? 1 : 0;
|
||||||
ptr = (PUCHAR) & pEid->Octet[8];
|
ptr = (u8 *)& pEid->Octet[8];
|
||||||
for (i = 0; i < 4; i++) {
|
for (i = 0; i < 4; i++) {
|
||||||
UCHAR aci = (*ptr & 0x60) >> 5; /* b5~6 is AC INDEX */
|
u8 aci = (*ptr & 0x60) >> 5; /* b5~6 is AC INDEX */
|
||||||
pEdcaParm->bACM[aci] = (((*ptr) & 0x10) == 0x10); /* b5 is ACM */
|
pEdcaParm->bACM[aci] = (((*ptr) & 0x10) == 0x10); /* b5 is ACM */
|
||||||
pEdcaParm->Aifsn[aci] = (*ptr) & 0x0f; /* b0~3 is AIFSN */
|
pEdcaParm->Aifsn[aci] = (*ptr) & 0x0f; /* b0~3 is AIFSN */
|
||||||
pEdcaParm->Cwmin[aci] = *(ptr + 1) & 0x0f; /* b0~4 is Cwmin */
|
pEdcaParm->Cwmin[aci] = *(ptr + 1) & 0x0f; /* b0~4 is Cwmin */
|
||||||
@ -237,7 +237,7 @@ BOOLEAN PeerAssocRspSanity(IN PRTMP_ADAPTER pAd, IN VOID * pMsg, IN ULONG MsgLen
|
|||||||
}
|
}
|
||||||
|
|
||||||
Length = Length + 2 + pEid->Len;
|
Length = Length + 2 + pEid->Len;
|
||||||
pEid = (PEID_STRUCT) ((UCHAR *) pEid + 2 + pEid->Len);
|
pEid = (PEID_STRUCT) ((u8 *) pEid + 2 + pEid->Len);
|
||||||
}
|
}
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
@ -255,14 +255,14 @@ BOOLEAN PeerAssocRspSanity(IN PRTMP_ADAPTER pAd, IN VOID * pMsg, IN ULONG MsgLen
|
|||||||
==========================================================================
|
==========================================================================
|
||||||
*/
|
*/
|
||||||
BOOLEAN PeerProbeReqSanity(IN PRTMP_ADAPTER pAd,
|
BOOLEAN PeerProbeReqSanity(IN PRTMP_ADAPTER pAd,
|
||||||
IN VOID * Msg,
|
void * Msg,
|
||||||
IN ULONG MsgLen,
|
unsigned long MsgLen,
|
||||||
OUT PUCHAR pAddr2,
|
u8 *pAddr2,
|
||||||
OUT CHAR Ssid[], OUT UCHAR * pSsidLen)
|
char Ssid[], u8 * pSsidLen)
|
||||||
{
|
{
|
||||||
UCHAR Idx;
|
u8 Idx;
|
||||||
UCHAR RateLen;
|
u8 RateLen;
|
||||||
CHAR IeType;
|
char IeType;
|
||||||
PFRAME_802_11 pFrame = (PFRAME_802_11) Msg;
|
PFRAME_802_11 pFrame = (PFRAME_802_11) Msg;
|
||||||
|
|
||||||
COPY_MAC_ADDR(pAddr2, pFrame->Hdr.Addr2);
|
COPY_MAC_ADDR(pAddr2, pFrame->Hdr.Addr2);
|
||||||
@ -304,15 +304,15 @@ BOOLEAN PeerProbeReqSanity(IN PRTMP_ADAPTER pAd,
|
|||||||
|
|
||||||
==========================================================================
|
==========================================================================
|
||||||
*/
|
*/
|
||||||
BOOLEAN GetTimBit(IN CHAR * Ptr,
|
BOOLEAN GetTimBit(char * Ptr,
|
||||||
IN USHORT Aid,
|
u16 Aid,
|
||||||
OUT UCHAR * TimLen,
|
u8 * TimLen,
|
||||||
OUT UCHAR * BcastFlag,
|
u8 * BcastFlag,
|
||||||
OUT UCHAR * DtimCount,
|
u8 * DtimCount,
|
||||||
OUT UCHAR * DtimPeriod, OUT UCHAR * MessageToMe)
|
u8 * DtimPeriod, u8 * MessageToMe)
|
||||||
{
|
{
|
||||||
UCHAR BitCntl, N1, N2, MyByte, MyBit;
|
u8 BitCntl, N1, N2, MyByte, MyBit;
|
||||||
CHAR *IdxPtr;
|
char *IdxPtr;
|
||||||
|
|
||||||
IdxPtr = Ptr;
|
IdxPtr = Ptr;
|
||||||
|
|
||||||
|
@ -50,7 +50,7 @@
|
|||||||
|
|
||||||
==========================================================================
|
==========================================================================
|
||||||
*/
|
*/
|
||||||
VOID SyncStateMachineInit(IN PRTMP_ADAPTER pAd,
|
void SyncStateMachineInit(IN PRTMP_ADAPTER pAd,
|
||||||
IN STATE_MACHINE * Sm, OUT STATE_MACHINE_FUNC Trans[])
|
IN STATE_MACHINE * Sm, OUT STATE_MACHINE_FUNC Trans[])
|
||||||
{
|
{
|
||||||
StateMachineInit(Sm, Trans, MAX_SYNC_STATE, MAX_SYNC_MSG,
|
StateMachineInit(Sm, Trans, MAX_SYNC_STATE, MAX_SYNC_MSG,
|
||||||
@ -111,9 +111,9 @@ VOID SyncStateMachineInit(IN PRTMP_ADAPTER pAd,
|
|||||||
|
|
||||||
==========================================================================
|
==========================================================================
|
||||||
*/
|
*/
|
||||||
VOID BeaconTimeout(IN PVOID SystemSpecific1,
|
void BeaconTimeout(void *SystemSpecific1,
|
||||||
IN PVOID FunctionContext,
|
void *FunctionContext,
|
||||||
IN PVOID SystemSpecific2, IN PVOID SystemSpecific3)
|
void *SystemSpecific2, void *SystemSpecific3)
|
||||||
{
|
{
|
||||||
RTMP_ADAPTER *pAd = (RTMP_ADAPTER *) FunctionContext;
|
RTMP_ADAPTER *pAd = (RTMP_ADAPTER *) FunctionContext;
|
||||||
|
|
||||||
@ -126,7 +126,7 @@ VOID BeaconTimeout(IN PVOID SystemSpecific1,
|
|||||||
|
|
||||||
if ((pAd->CommonCfg.BBPCurrentBW == BW_40)
|
if ((pAd->CommonCfg.BBPCurrentBW == BW_40)
|
||||||
) {
|
) {
|
||||||
UCHAR BBPValue = 0;
|
u8 BBPValue = 0;
|
||||||
AsicSwitchChannel(pAd, pAd->CommonCfg.CentralChannel, FALSE);
|
AsicSwitchChannel(pAd, pAd->CommonCfg.CentralChannel, FALSE);
|
||||||
AsicLockChannel(pAd, pAd->CommonCfg.CentralChannel);
|
AsicLockChannel(pAd, pAd->CommonCfg.CentralChannel);
|
||||||
RTMP_BBP_IO_READ8_BY_REG_ID(pAd, BBP_R4, &BBPValue);
|
RTMP_BBP_IO_READ8_BY_REG_ID(pAd, BBP_R4, &BBPValue);
|
||||||
@ -151,9 +151,9 @@ VOID BeaconTimeout(IN PVOID SystemSpecific1,
|
|||||||
|
|
||||||
==========================================================================
|
==========================================================================
|
||||||
*/
|
*/
|
||||||
VOID ScanTimeout(IN PVOID SystemSpecific1,
|
void ScanTimeout(void *SystemSpecific1,
|
||||||
IN PVOID FunctionContext,
|
void *FunctionContext,
|
||||||
IN PVOID SystemSpecific2, IN PVOID SystemSpecific3)
|
void *SystemSpecific2, void *SystemSpecific3)
|
||||||
{
|
{
|
||||||
RTMP_ADAPTER *pAd = (RTMP_ADAPTER *) FunctionContext;
|
RTMP_ADAPTER *pAd = (RTMP_ADAPTER *) FunctionContext;
|
||||||
|
|
||||||
@ -183,15 +183,15 @@ VOID ScanTimeout(IN PVOID SystemSpecific1,
|
|||||||
MLME SCAN req state machine procedure
|
MLME SCAN req state machine procedure
|
||||||
==========================================================================
|
==========================================================================
|
||||||
*/
|
*/
|
||||||
VOID MlmeScanReqAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
void MlmeScanReqAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
||||||
{
|
{
|
||||||
UCHAR Ssid[MAX_LEN_OF_SSID], SsidLen, ScanType, BssType, BBPValue = 0;
|
u8 Ssid[MAX_LEN_OF_SSID], SsidLen, ScanType, BssType, BBPValue = 0;
|
||||||
BOOLEAN TimerCancelled;
|
BOOLEAN TimerCancelled;
|
||||||
ULONG Now;
|
unsigned long Now;
|
||||||
USHORT Status;
|
u16 Status;
|
||||||
PHEADER_802_11 pHdr80211;
|
PHEADER_802_11 pHdr80211;
|
||||||
PUCHAR pOutBuffer = NULL;
|
u8 *pOutBuffer = NULL;
|
||||||
NDIS_STATUS NStatus;
|
int NStatus;
|
||||||
|
|
||||||
/* Check the total scan tries for one single OID command */
|
/* Check the total scan tries for one single OID command */
|
||||||
/* If this is the CCX 2.0 Case, skip that! */
|
/* If this is the CCX 2.0 Case, skip that! */
|
||||||
@ -225,7 +225,7 @@ VOID MlmeScanReqAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
|||||||
if (MlmeScanReqSanity(pAd,
|
if (MlmeScanReqSanity(pAd,
|
||||||
Elem->Msg,
|
Elem->Msg,
|
||||||
Elem->MsgLen,
|
Elem->MsgLen,
|
||||||
&BssType, (PCHAR) Ssid, &SsidLen, &ScanType)) {
|
&BssType, (char *)Ssid, &SsidLen, &ScanType)) {
|
||||||
|
|
||||||
/* Check for channel load and noise hist request */
|
/* Check for channel load and noise hist request */
|
||||||
/* Suspend MSDU only at scan request, not the last two mentioned */
|
/* Suspend MSDU only at scan request, not the last two mentioned */
|
||||||
@ -239,7 +239,7 @@ VOID MlmeScanReqAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
|||||||
/* */
|
/* */
|
||||||
if (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_MEDIA_STATE_CONNECTED)
|
if (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_MEDIA_STATE_CONNECTED)
|
||||||
&& (INFRA_ON(pAd))) {
|
&& (INFRA_ON(pAd))) {
|
||||||
NStatus = MlmeAllocateMemory(pAd, (PVOID) & pOutBuffer);
|
NStatus = MlmeAllocateMemory(pAd, (void *)& pOutBuffer);
|
||||||
if (NStatus == NDIS_STATUS_SUCCESS) {
|
if (NStatus == NDIS_STATUS_SUCCESS) {
|
||||||
pHdr80211 = (PHEADER_802_11) pOutBuffer;
|
pHdr80211 = (PHEADER_802_11) pOutBuffer;
|
||||||
MgtMacHeaderInit(pAd, pHdr80211,
|
MgtMacHeaderInit(pAd, pHdr80211,
|
||||||
@ -297,21 +297,21 @@ VOID MlmeScanReqAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
|||||||
MLME JOIN req state machine procedure
|
MLME JOIN req state machine procedure
|
||||||
==========================================================================
|
==========================================================================
|
||||||
*/
|
*/
|
||||||
VOID MlmeJoinReqAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
void MlmeJoinReqAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
||||||
{
|
{
|
||||||
UCHAR BBPValue = 0;
|
u8 BBPValue = 0;
|
||||||
BSS_ENTRY *pBss;
|
BSS_ENTRY *pBss;
|
||||||
BOOLEAN TimerCancelled;
|
BOOLEAN TimerCancelled;
|
||||||
HEADER_802_11 Hdr80211;
|
HEADER_802_11 Hdr80211;
|
||||||
NDIS_STATUS NStatus;
|
int NStatus;
|
||||||
ULONG FrameLen = 0;
|
unsigned long FrameLen = 0;
|
||||||
PUCHAR pOutBuffer = NULL;
|
u8 *pOutBuffer = NULL;
|
||||||
PUCHAR pSupRate = NULL;
|
u8 *pSupRate = NULL;
|
||||||
UCHAR SupRateLen;
|
u8 SupRateLen;
|
||||||
PUCHAR pExtRate = NULL;
|
u8 *pExtRate = NULL;
|
||||||
UCHAR ExtRateLen;
|
u8 ExtRateLen;
|
||||||
UCHAR ASupRate[] = { 0x8C, 0x12, 0x98, 0x24, 0xb0, 0x48, 0x60, 0x6C };
|
u8 ASupRate[] = { 0x8C, 0x12, 0x98, 0x24, 0xb0, 0x48, 0x60, 0x6C };
|
||||||
UCHAR ASupRateLen = sizeof(ASupRate) / sizeof(UCHAR);
|
u8 ASupRateLen = sizeof(ASupRate) / sizeof(u8);
|
||||||
MLME_JOIN_REQ_STRUCT *pInfo = (MLME_JOIN_REQ_STRUCT *) (Elem->Msg);
|
MLME_JOIN_REQ_STRUCT *pInfo = (MLME_JOIN_REQ_STRUCT *) (Elem->Msg);
|
||||||
|
|
||||||
DBGPRINT(RT_DEBUG_TRACE,
|
DBGPRINT(RT_DEBUG_TRACE,
|
||||||
@ -409,7 +409,7 @@ VOID MlmeJoinReqAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
|||||||
END_OF_ARGS);
|
END_OF_ARGS);
|
||||||
|
|
||||||
if (ExtRateLen) {
|
if (ExtRateLen) {
|
||||||
ULONG Tmp;
|
unsigned long Tmp;
|
||||||
MakeOutgoingFrame(pOutBuffer + FrameLen, &Tmp,
|
MakeOutgoingFrame(pOutBuffer + FrameLen, &Tmp,
|
||||||
1, &ExtRateIe,
|
1, &ExtRateIe,
|
||||||
1, &ExtRateLen,
|
1, &ExtRateLen,
|
||||||
@ -437,17 +437,17 @@ VOID MlmeJoinReqAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
|||||||
MLME START Request state machine procedure, starting an IBSS
|
MLME START Request state machine procedure, starting an IBSS
|
||||||
==========================================================================
|
==========================================================================
|
||||||
*/
|
*/
|
||||||
VOID MlmeStartReqAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
void MlmeStartReqAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
||||||
{
|
{
|
||||||
UCHAR Ssid[MAX_LEN_OF_SSID], SsidLen;
|
u8 Ssid[MAX_LEN_OF_SSID], SsidLen;
|
||||||
BOOLEAN TimerCancelled;
|
BOOLEAN TimerCancelled;
|
||||||
|
|
||||||
/* New for WPA security suites */
|
/* New for WPA security suites */
|
||||||
UCHAR VarIE[MAX_VIE_LEN]; /* Total VIE length = MAX_VIE_LEN - -5 */
|
u8 VarIE[MAX_VIE_LEN]; /* Total VIE length = MAX_VIE_LEN - -5 */
|
||||||
NDIS_802_11_VARIABLE_IEs *pVIE = NULL;
|
NDIS_802_11_VARIABLE_IEs *pVIE = NULL;
|
||||||
LARGE_INTEGER TimeStamp;
|
LARGE_INTEGER TimeStamp;
|
||||||
BOOLEAN Privacy;
|
BOOLEAN Privacy;
|
||||||
USHORT Status;
|
u16 Status;
|
||||||
|
|
||||||
/* Init Variable IE structure */
|
/* Init Variable IE structure */
|
||||||
pVIE = (PNDIS_802_11_VARIABLE_IEs) VarIE;
|
pVIE = (PNDIS_802_11_VARIABLE_IEs) VarIE;
|
||||||
@ -456,7 +456,7 @@ VOID MlmeStartReqAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
|||||||
TimeStamp.u.HighPart = 0;
|
TimeStamp.u.HighPart = 0;
|
||||||
|
|
||||||
if (MlmeStartReqSanity
|
if (MlmeStartReqSanity
|
||||||
(pAd, Elem->Msg, Elem->MsgLen, (PCHAR) Ssid, &SsidLen)) {
|
(pAd, Elem->Msg, Elem->MsgLen, (char *)Ssid, &SsidLen)) {
|
||||||
/* reset all the timers */
|
/* reset all the timers */
|
||||||
RTMPCancelTimer(&pAd->MlmeAux.ScanTimer, &TimerCancelled);
|
RTMPCancelTimer(&pAd->MlmeAux.ScanTimer, &TimerCancelled);
|
||||||
RTMPCancelTimer(&pAd->MlmeAux.BeaconTimer, &TimerCancelled);
|
RTMPCancelTimer(&pAd->MlmeAux.BeaconTimer, &TimerCancelled);
|
||||||
@ -550,33 +550,33 @@ VOID MlmeStartReqAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
|||||||
peer sends beacon back when scanning
|
peer sends beacon back when scanning
|
||||||
==========================================================================
|
==========================================================================
|
||||||
*/
|
*/
|
||||||
VOID PeerBeaconAtScanAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
void PeerBeaconAtScanAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
||||||
{
|
{
|
||||||
UCHAR Bssid[MAC_ADDR_LEN], Addr2[MAC_ADDR_LEN];
|
u8 Bssid[MAC_ADDR_LEN], Addr2[MAC_ADDR_LEN];
|
||||||
UCHAR Ssid[MAX_LEN_OF_SSID], BssType, Channel, NewChannel,
|
u8 Ssid[MAX_LEN_OF_SSID], BssType, Channel, NewChannel,
|
||||||
SsidLen, DtimCount, DtimPeriod, BcastFlag, MessageToMe;
|
SsidLen, DtimCount, DtimPeriod, BcastFlag, MessageToMe;
|
||||||
CF_PARM CfParm;
|
CF_PARM CfParm;
|
||||||
USHORT BeaconPeriod, AtimWin, CapabilityInfo;
|
u16 BeaconPeriod, AtimWin, CapabilityInfo;
|
||||||
PFRAME_802_11 pFrame;
|
PFRAME_802_11 pFrame;
|
||||||
LARGE_INTEGER TimeStamp;
|
LARGE_INTEGER TimeStamp;
|
||||||
UCHAR Erp;
|
u8 Erp;
|
||||||
UCHAR SupRate[MAX_LEN_OF_SUPPORTED_RATES],
|
u8 SupRate[MAX_LEN_OF_SUPPORTED_RATES],
|
||||||
ExtRate[MAX_LEN_OF_SUPPORTED_RATES];
|
ExtRate[MAX_LEN_OF_SUPPORTED_RATES];
|
||||||
UCHAR SupRateLen, ExtRateLen;
|
u8 SupRateLen, ExtRateLen;
|
||||||
USHORT LenVIE;
|
u16 LenVIE;
|
||||||
UCHAR CkipFlag;
|
u8 CkipFlag;
|
||||||
UCHAR AironetCellPowerLimit;
|
u8 AironetCellPowerLimit;
|
||||||
EDCA_PARM EdcaParm;
|
EDCA_PARM EdcaParm;
|
||||||
QBSS_LOAD_PARM QbssLoad;
|
QBSS_LOAD_PARM QbssLoad;
|
||||||
QOS_CAPABILITY_PARM QosCapability;
|
QOS_CAPABILITY_PARM QosCapability;
|
||||||
ULONG RalinkIe;
|
unsigned long RalinkIe;
|
||||||
UCHAR VarIE[MAX_VIE_LEN]; /* Total VIE length = MAX_VIE_LEN - -5 */
|
u8 VarIE[MAX_VIE_LEN]; /* Total VIE length = MAX_VIE_LEN - -5 */
|
||||||
NDIS_802_11_VARIABLE_IEs *pVIE = NULL;
|
NDIS_802_11_VARIABLE_IEs *pVIE = NULL;
|
||||||
HT_CAPABILITY_IE HtCapability;
|
HT_CAPABILITY_IE HtCapability;
|
||||||
ADD_HT_INFO_IE AddHtInfo; /* AP might use this additional ht info IE */
|
ADD_HT_INFO_IE AddHtInfo; /* AP might use this additional ht info IE */
|
||||||
UCHAR HtCapabilityLen = 0, PreNHtCapabilityLen = 0;
|
u8 HtCapabilityLen = 0, PreNHtCapabilityLen = 0;
|
||||||
UCHAR AddHtInfoLen;
|
u8 AddHtInfoLen;
|
||||||
UCHAR NewExtChannelOffset = 0xff;
|
u8 NewExtChannelOffset = 0xff;
|
||||||
|
|
||||||
/* NdisFillMemory(Ssid, MAX_LEN_OF_SSID, 0x00); */
|
/* NdisFillMemory(Ssid, MAX_LEN_OF_SSID, 0x00); */
|
||||||
pFrame = (PFRAME_802_11) Elem->Msg;
|
pFrame = (PFRAME_802_11) Elem->Msg;
|
||||||
@ -593,7 +593,7 @@ VOID PeerBeaconAtScanAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
|||||||
Elem->Channel,
|
Elem->Channel,
|
||||||
Addr2,
|
Addr2,
|
||||||
Bssid,
|
Bssid,
|
||||||
(PCHAR) Ssid,
|
(char *)Ssid,
|
||||||
&SsidLen,
|
&SsidLen,
|
||||||
&BssType,
|
&BssType,
|
||||||
&BeaconPeriod,
|
&BeaconPeriod,
|
||||||
@ -624,8 +624,8 @@ VOID PeerBeaconAtScanAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
|||||||
&AddHtInfoLen,
|
&AddHtInfoLen,
|
||||||
&AddHtInfo,
|
&AddHtInfo,
|
||||||
&NewExtChannelOffset, &LenVIE, pVIE)) {
|
&NewExtChannelOffset, &LenVIE, pVIE)) {
|
||||||
ULONG Idx;
|
unsigned long Idx;
|
||||||
CHAR Rssi = 0;
|
char Rssi = 0;
|
||||||
|
|
||||||
Idx = BssTableSearch(&pAd->ScanTab, Bssid, Channel);
|
Idx = BssTableSearch(&pAd->ScanTab, Bssid, Channel);
|
||||||
if (Idx != BSS_NOT_FOUND)
|
if (Idx != BSS_NOT_FOUND)
|
||||||
@ -640,7 +640,7 @@ VOID PeerBeaconAtScanAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
|||||||
HtCapabilityLen = SIZE_HT_CAP_IE;
|
HtCapabilityLen = SIZE_HT_CAP_IE;
|
||||||
|
|
||||||
Idx =
|
Idx =
|
||||||
BssTableSetEntry(pAd, &pAd->ScanTab, Bssid, (PCHAR) Ssid,
|
BssTableSetEntry(pAd, &pAd->ScanTab, Bssid, (char *)Ssid,
|
||||||
SsidLen, BssType, BeaconPeriod, &CfParm,
|
SsidLen, BssType, BeaconPeriod, &CfParm,
|
||||||
AtimWin, CapabilityInfo, SupRate,
|
AtimWin, CapabilityInfo, SupRate,
|
||||||
SupRateLen, ExtRate, ExtRateLen,
|
SupRateLen, ExtRate, ExtRateLen,
|
||||||
@ -668,36 +668,36 @@ VOID PeerBeaconAtScanAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
|||||||
When waiting joining the (I)BSS, beacon received from external
|
When waiting joining the (I)BSS, beacon received from external
|
||||||
==========================================================================
|
==========================================================================
|
||||||
*/
|
*/
|
||||||
VOID PeerBeaconAtJoinAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
void PeerBeaconAtJoinAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
||||||
{
|
{
|
||||||
UCHAR Bssid[MAC_ADDR_LEN], Addr2[MAC_ADDR_LEN];
|
u8 Bssid[MAC_ADDR_LEN], Addr2[MAC_ADDR_LEN];
|
||||||
UCHAR Ssid[MAX_LEN_OF_SSID], SsidLen, BssType, Channel, MessageToMe,
|
u8 Ssid[MAX_LEN_OF_SSID], SsidLen, BssType, Channel, MessageToMe,
|
||||||
DtimCount, DtimPeriod, BcastFlag, NewChannel;
|
DtimCount, DtimPeriod, BcastFlag, NewChannel;
|
||||||
LARGE_INTEGER TimeStamp;
|
LARGE_INTEGER TimeStamp;
|
||||||
USHORT BeaconPeriod, AtimWin, CapabilityInfo;
|
u16 BeaconPeriod, AtimWin, CapabilityInfo;
|
||||||
CF_PARM Cf;
|
CF_PARM Cf;
|
||||||
BOOLEAN TimerCancelled;
|
BOOLEAN TimerCancelled;
|
||||||
UCHAR Erp;
|
u8 Erp;
|
||||||
UCHAR SupRate[MAX_LEN_OF_SUPPORTED_RATES],
|
u8 SupRate[MAX_LEN_OF_SUPPORTED_RATES],
|
||||||
ExtRate[MAX_LEN_OF_SUPPORTED_RATES];
|
ExtRate[MAX_LEN_OF_SUPPORTED_RATES];
|
||||||
UCHAR SupRateLen, ExtRateLen;
|
u8 SupRateLen, ExtRateLen;
|
||||||
UCHAR CkipFlag;
|
u8 CkipFlag;
|
||||||
USHORT LenVIE;
|
u16 LenVIE;
|
||||||
UCHAR AironetCellPowerLimit;
|
u8 AironetCellPowerLimit;
|
||||||
EDCA_PARM EdcaParm;
|
EDCA_PARM EdcaParm;
|
||||||
QBSS_LOAD_PARM QbssLoad;
|
QBSS_LOAD_PARM QbssLoad;
|
||||||
QOS_CAPABILITY_PARM QosCapability;
|
QOS_CAPABILITY_PARM QosCapability;
|
||||||
USHORT Status;
|
u16 Status;
|
||||||
UCHAR VarIE[MAX_VIE_LEN]; /* Total VIE length = MAX_VIE_LEN - -5 */
|
u8 VarIE[MAX_VIE_LEN]; /* Total VIE length = MAX_VIE_LEN - -5 */
|
||||||
NDIS_802_11_VARIABLE_IEs *pVIE = NULL;
|
NDIS_802_11_VARIABLE_IEs *pVIE = NULL;
|
||||||
ULONG RalinkIe;
|
unsigned long RalinkIe;
|
||||||
ULONG Idx;
|
unsigned long Idx;
|
||||||
HT_CAPABILITY_IE HtCapability;
|
HT_CAPABILITY_IE HtCapability;
|
||||||
ADD_HT_INFO_IE AddHtInfo; /* AP might use this additional ht info IE */
|
ADD_HT_INFO_IE AddHtInfo; /* AP might use this additional ht info IE */
|
||||||
UCHAR HtCapabilityLen = 0, PreNHtCapabilityLen = 0;
|
u8 HtCapabilityLen = 0, PreNHtCapabilityLen = 0;
|
||||||
UCHAR AddHtInfoLen;
|
u8 AddHtInfoLen;
|
||||||
UCHAR NewExtChannelOffset = 0xff;
|
u8 NewExtChannelOffset = 0xff;
|
||||||
UCHAR CentralChannel;
|
u8 CentralChannel;
|
||||||
BOOLEAN bAllowNrate = FALSE;
|
BOOLEAN bAllowNrate = FALSE;
|
||||||
|
|
||||||
/* Init Variable IE structure */
|
/* Init Variable IE structure */
|
||||||
@ -712,7 +712,7 @@ VOID PeerBeaconAtJoinAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
|||||||
Elem->Channel,
|
Elem->Channel,
|
||||||
Addr2,
|
Addr2,
|
||||||
Bssid,
|
Bssid,
|
||||||
(PCHAR) Ssid,
|
(char *)Ssid,
|
||||||
&SsidLen,
|
&SsidLen,
|
||||||
&BssType,
|
&BssType,
|
||||||
&BeaconPeriod,
|
&BeaconPeriod,
|
||||||
@ -798,7 +798,7 @@ VOID PeerBeaconAtJoinAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
|||||||
Channel);
|
Channel);
|
||||||
|
|
||||||
if (Idx == BSS_NOT_FOUND) {
|
if (Idx == BSS_NOT_FOUND) {
|
||||||
CHAR Rssi = 0;
|
char Rssi = 0;
|
||||||
Rssi =
|
Rssi =
|
||||||
RTMPMaxRssi(pAd,
|
RTMPMaxRssi(pAd,
|
||||||
ConvertToRssi(pAd,
|
ConvertToRssi(pAd,
|
||||||
@ -816,7 +816,7 @@ VOID PeerBeaconAtJoinAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
|||||||
Idx =
|
Idx =
|
||||||
BssTableSetEntry(pAd, &pAd->ScanTab,
|
BssTableSetEntry(pAd, &pAd->ScanTab,
|
||||||
Bssid,
|
Bssid,
|
||||||
(CHAR *) Ssid,
|
(char *) Ssid,
|
||||||
SsidLen, BssType,
|
SsidLen, BssType,
|
||||||
BeaconPeriod, &Cf,
|
BeaconPeriod, &Cf,
|
||||||
AtimWin,
|
AtimWin,
|
||||||
@ -1041,35 +1041,35 @@ VOID PeerBeaconAtJoinAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
|||||||
|
|
||||||
==========================================================================
|
==========================================================================
|
||||||
*/
|
*/
|
||||||
VOID PeerBeacon(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
void PeerBeacon(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
||||||
{
|
{
|
||||||
UCHAR Bssid[MAC_ADDR_LEN], Addr2[MAC_ADDR_LEN];
|
u8 Bssid[MAC_ADDR_LEN], Addr2[MAC_ADDR_LEN];
|
||||||
CHAR Ssid[MAX_LEN_OF_SSID];
|
char Ssid[MAX_LEN_OF_SSID];
|
||||||
CF_PARM CfParm;
|
CF_PARM CfParm;
|
||||||
UCHAR SsidLen, MessageToMe = 0, BssType, Channel, NewChannel, index = 0;
|
u8 SsidLen, MessageToMe = 0, BssType, Channel, NewChannel, index = 0;
|
||||||
UCHAR DtimCount = 0, DtimPeriod = 0, BcastFlag = 0;
|
u8 DtimCount = 0, DtimPeriod = 0, BcastFlag = 0;
|
||||||
USHORT CapabilityInfo, AtimWin, BeaconPeriod;
|
u16 CapabilityInfo, AtimWin, BeaconPeriod;
|
||||||
LARGE_INTEGER TimeStamp;
|
LARGE_INTEGER TimeStamp;
|
||||||
USHORT TbttNumToNextWakeUp;
|
u16 TbttNumToNextWakeUp;
|
||||||
UCHAR Erp;
|
u8 Erp;
|
||||||
UCHAR SupRate[MAX_LEN_OF_SUPPORTED_RATES],
|
u8 SupRate[MAX_LEN_OF_SUPPORTED_RATES],
|
||||||
ExtRate[MAX_LEN_OF_SUPPORTED_RATES];
|
ExtRate[MAX_LEN_OF_SUPPORTED_RATES];
|
||||||
UCHAR SupRateLen, ExtRateLen;
|
u8 SupRateLen, ExtRateLen;
|
||||||
UCHAR CkipFlag;
|
u8 CkipFlag;
|
||||||
USHORT LenVIE;
|
u16 LenVIE;
|
||||||
UCHAR AironetCellPowerLimit;
|
u8 AironetCellPowerLimit;
|
||||||
EDCA_PARM EdcaParm;
|
EDCA_PARM EdcaParm;
|
||||||
QBSS_LOAD_PARM QbssLoad;
|
QBSS_LOAD_PARM QbssLoad;
|
||||||
QOS_CAPABILITY_PARM QosCapability;
|
QOS_CAPABILITY_PARM QosCapability;
|
||||||
ULONG RalinkIe;
|
unsigned long RalinkIe;
|
||||||
/* New for WPA security suites */
|
/* New for WPA security suites */
|
||||||
UCHAR VarIE[MAX_VIE_LEN]; /* Total VIE length = MAX_VIE_LEN - -5 */
|
u8 VarIE[MAX_VIE_LEN]; /* Total VIE length = MAX_VIE_LEN - -5 */
|
||||||
NDIS_802_11_VARIABLE_IEs *pVIE = NULL;
|
NDIS_802_11_VARIABLE_IEs *pVIE = NULL;
|
||||||
HT_CAPABILITY_IE HtCapability;
|
HT_CAPABILITY_IE HtCapability;
|
||||||
ADD_HT_INFO_IE AddHtInfo; /* AP might use this additional ht info IE */
|
ADD_HT_INFO_IE AddHtInfo; /* AP might use this additional ht info IE */
|
||||||
UCHAR HtCapabilityLen, PreNHtCapabilityLen;
|
u8 HtCapabilityLen, PreNHtCapabilityLen;
|
||||||
UCHAR AddHtInfoLen;
|
u8 AddHtInfoLen;
|
||||||
UCHAR NewExtChannelOffset = 0xff;
|
u8 NewExtChannelOffset = 0xff;
|
||||||
|
|
||||||
if (!(INFRA_ON(pAd) || ADHOC_ON(pAd)
|
if (!(INFRA_ON(pAd) || ADHOC_ON(pAd)
|
||||||
))
|
))
|
||||||
@ -1119,9 +1119,9 @@ VOID PeerBeacon(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
|||||||
&AddHtInfo,
|
&AddHtInfo,
|
||||||
&NewExtChannelOffset, &LenVIE, pVIE)) {
|
&NewExtChannelOffset, &LenVIE, pVIE)) {
|
||||||
BOOLEAN is_my_bssid, is_my_ssid;
|
BOOLEAN is_my_bssid, is_my_ssid;
|
||||||
ULONG Bssidx, Now;
|
unsigned long Bssidx, Now;
|
||||||
BSS_ENTRY *pBss;
|
BSS_ENTRY *pBss;
|
||||||
CHAR RealRssi =
|
char RealRssi =
|
||||||
RTMPMaxRssi(pAd, ConvertToRssi(pAd, Elem->Rssi0, RSSI_0),
|
RTMPMaxRssi(pAd, ConvertToRssi(pAd, Elem->Rssi0, RSSI_0),
|
||||||
ConvertToRssi(pAd, Elem->Rssi1, RSSI_1),
|
ConvertToRssi(pAd, Elem->Rssi1, RSSI_1),
|
||||||
ConvertToRssi(pAd, Elem->Rssi2, RSSI_2));
|
ConvertToRssi(pAd, Elem->Rssi2, RSSI_2));
|
||||||
@ -1214,7 +1214,7 @@ VOID PeerBeacon(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
|||||||
/* if the ssid matched & bssid unmatched, we should select the bssid with large value. */
|
/* if the ssid matched & bssid unmatched, we should select the bssid with large value. */
|
||||||
/* This might happened when two STA start at the same time */
|
/* This might happened when two STA start at the same time */
|
||||||
if ((!is_my_bssid) && ADHOC_ON(pAd)) {
|
if ((!is_my_bssid) && ADHOC_ON(pAd)) {
|
||||||
INT i;
|
int i;
|
||||||
|
|
||||||
/* Add the safeguard against the mismatch of adhoc wep status */
|
/* Add the safeguard against the mismatch of adhoc wep status */
|
||||||
if (pAd->StaCfg.WepStatus !=
|
if (pAd->StaCfg.WepStatus !=
|
||||||
@ -1279,8 +1279,8 @@ VOID PeerBeacon(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (ADHOC_ON(pAd) && (CAP_IS_IBSS_ON(CapabilityInfo))) {
|
if (ADHOC_ON(pAd) && (CAP_IS_IBSS_ON(CapabilityInfo))) {
|
||||||
UCHAR MaxSupportedRateIn500Kbps = 0;
|
u8 MaxSupportedRateIn500Kbps = 0;
|
||||||
UCHAR idx;
|
u8 idx;
|
||||||
MAC_TABLE_ENTRY *pEntry;
|
MAC_TABLE_ENTRY *pEntry;
|
||||||
|
|
||||||
/* supported rates array may not be sorted. sort it and find the maximum rate */
|
/* supported rates array may not be sorted. sort it and find the maximum rate */
|
||||||
@ -1516,7 +1516,7 @@ VOID PeerBeacon(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
|||||||
MlmeSetTxPreamble(pAd,
|
MlmeSetTxPreamble(pAd,
|
||||||
Rt802_11PreambleLong);
|
Rt802_11PreambleLong);
|
||||||
DBGPRINT(RT_DEBUG_TRACE,
|
DBGPRINT(RT_DEBUG_TRACE,
|
||||||
("SYNC - AP forced to use LONG preamble\n"));
|
("SYNC - AP forced to use long preamble\n"));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (OPSTATUS_TEST_FLAG
|
if (OPSTATUS_TEST_FLAG
|
||||||
@ -1543,7 +1543,7 @@ VOID PeerBeacon(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
|||||||
/* only INFRASTRUCTURE mode support power-saving feature */
|
/* only INFRASTRUCTURE mode support power-saving feature */
|
||||||
if ((INFRA_ON(pAd) && (pAd->StaCfg.Psm == PWR_SAVE))
|
if ((INFRA_ON(pAd) && (pAd->StaCfg.Psm == PWR_SAVE))
|
||||||
|| (pAd->CommonCfg.bAPSDForcePowerSave)) {
|
|| (pAd->CommonCfg.bAPSDForcePowerSave)) {
|
||||||
UCHAR FreeNumber;
|
u8 FreeNumber;
|
||||||
/* 1. AP has backlogged unicast-to-me frame, stay AWAKE, send PSPOLL */
|
/* 1. AP has backlogged unicast-to-me frame, stay AWAKE, send PSPOLL */
|
||||||
/* 2. AP has backlogged broadcast/multicast frame and we want those frames, stay AWAKE */
|
/* 2. AP has backlogged broadcast/multicast frame and we want those frames, stay AWAKE */
|
||||||
/* 3. we have outgoing frames in TxRing or MgmtRing, better stay AWAKE */
|
/* 3. we have outgoing frames in TxRing or MgmtRing, better stay AWAKE */
|
||||||
@ -1660,7 +1660,7 @@ VOID PeerBeacon(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
|||||||
due to MaxSPLength.
|
due to MaxSPLength.
|
||||||
*/
|
*/
|
||||||
} else {
|
} else {
|
||||||
USHORT NextDtim = DtimCount;
|
u16 NextDtim = DtimCount;
|
||||||
|
|
||||||
if (NextDtim == 0)
|
if (NextDtim == 0)
|
||||||
NextDtim = DtimPeriod;
|
NextDtim = DtimPeriod;
|
||||||
@ -1703,22 +1703,22 @@ VOID PeerBeacon(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
|||||||
Receive PROBE REQ from remote peer when operating in IBSS mode
|
Receive PROBE REQ from remote peer when operating in IBSS mode
|
||||||
==========================================================================
|
==========================================================================
|
||||||
*/
|
*/
|
||||||
VOID PeerProbeReqAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
void PeerProbeReqAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
||||||
{
|
{
|
||||||
UCHAR Addr2[MAC_ADDR_LEN];
|
u8 Addr2[MAC_ADDR_LEN];
|
||||||
CHAR Ssid[MAX_LEN_OF_SSID];
|
char Ssid[MAX_LEN_OF_SSID];
|
||||||
UCHAR SsidLen;
|
u8 SsidLen;
|
||||||
UCHAR HtLen, AddHtLen, NewExtLen;
|
u8 HtLen, AddHtLen, NewExtLen;
|
||||||
HEADER_802_11 ProbeRspHdr;
|
HEADER_802_11 ProbeRspHdr;
|
||||||
NDIS_STATUS NStatus;
|
int NStatus;
|
||||||
PUCHAR pOutBuffer = NULL;
|
u8 *pOutBuffer = NULL;
|
||||||
ULONG FrameLen = 0;
|
unsigned long FrameLen = 0;
|
||||||
LARGE_INTEGER FakeTimestamp;
|
LARGE_INTEGER FakeTimestamp;
|
||||||
UCHAR DsLen = 1, IbssLen = 2;
|
u8 DsLen = 1, IbssLen = 2;
|
||||||
UCHAR LocalErpIe[3] = { IE_ERP, 1, 0 };
|
u8 LocalErpIe[3] = { IE_ERP, 1, 0 };
|
||||||
BOOLEAN Privacy;
|
BOOLEAN Privacy;
|
||||||
USHORT CapabilityInfo;
|
u16 CapabilityInfo;
|
||||||
UCHAR RSNIe = IE_WPA;
|
u8 RSNIe = IE_WPA;
|
||||||
|
|
||||||
if (!ADHOC_ON(pAd))
|
if (!ADHOC_ON(pAd))
|
||||||
return;
|
return;
|
||||||
@ -1764,7 +1764,7 @@ VOID PeerProbeReqAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
|||||||
&pAd->StaActive.AtimWin, END_OF_ARGS);
|
&pAd->StaActive.AtimWin, END_OF_ARGS);
|
||||||
|
|
||||||
if (pAd->StaActive.ExtRateLen) {
|
if (pAd->StaActive.ExtRateLen) {
|
||||||
ULONG tmp;
|
unsigned long tmp;
|
||||||
MakeOutgoingFrame(pOutBuffer + FrameLen, &tmp,
|
MakeOutgoingFrame(pOutBuffer + FrameLen, &tmp,
|
||||||
3, LocalErpIe,
|
3, LocalErpIe,
|
||||||
1, &ExtRateIe,
|
1, &ExtRateIe,
|
||||||
@ -1776,7 +1776,7 @@ VOID PeerProbeReqAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
|||||||
}
|
}
|
||||||
/* If adhoc secruity is set for WPA-None, append the cipher suite IE */
|
/* If adhoc secruity is set for WPA-None, append the cipher suite IE */
|
||||||
if (pAd->StaCfg.AuthMode == Ndis802_11AuthModeWPANone) {
|
if (pAd->StaCfg.AuthMode == Ndis802_11AuthModeWPANone) {
|
||||||
ULONG tmp;
|
unsigned long tmp;
|
||||||
MakeOutgoingFrame(pOutBuffer + FrameLen, &tmp,
|
MakeOutgoingFrame(pOutBuffer + FrameLen, &tmp,
|
||||||
1, &RSNIe,
|
1, &RSNIe,
|
||||||
1, &pAd->StaCfg.RSNIE_Len,
|
1, &pAd->StaCfg.RSNIE_Len,
|
||||||
@ -1787,8 +1787,8 @@ VOID PeerProbeReqAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (pAd->CommonCfg.PhyMode >= PHY_11ABGN_MIXED) {
|
if (pAd->CommonCfg.PhyMode >= PHY_11ABGN_MIXED) {
|
||||||
ULONG TmpLen;
|
unsigned long TmpLen;
|
||||||
UCHAR BROADCOM[4] = { 0x0, 0x90, 0x4c, 0x33 };
|
u8 BROADCOM[4] = { 0x0, 0x90, 0x4c, 0x33 };
|
||||||
HtLen = sizeof(pAd->CommonCfg.HtCapability);
|
HtLen = sizeof(pAd->CommonCfg.HtCapability);
|
||||||
AddHtLen = sizeof(pAd->CommonCfg.AddHTInfo);
|
AddHtLen = sizeof(pAd->CommonCfg.AddHTInfo);
|
||||||
NewExtLen = 1;
|
NewExtLen = 1;
|
||||||
@ -1833,9 +1833,9 @@ VOID PeerProbeReqAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID BeaconTimeoutAtJoinAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
void BeaconTimeoutAtJoinAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
||||||
{
|
{
|
||||||
USHORT Status;
|
u16 Status;
|
||||||
DBGPRINT(RT_DEBUG_TRACE, ("SYNC - BeaconTimeoutAtJoinAction\n"));
|
DBGPRINT(RT_DEBUG_TRACE, ("SYNC - BeaconTimeoutAtJoinAction\n"));
|
||||||
pAd->Mlme.SyncMachine.CurrState = SYNC_IDLE;
|
pAd->Mlme.SyncMachine.CurrState = SYNC_IDLE;
|
||||||
Status = MLME_REJ_TIMEOUT;
|
Status = MLME_REJ_TIMEOUT;
|
||||||
@ -1848,7 +1848,7 @@ VOID BeaconTimeoutAtJoinAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
|||||||
Scan timeout procedure. basically add channel index by 1 and rescan
|
Scan timeout procedure. basically add channel index by 1 and rescan
|
||||||
==========================================================================
|
==========================================================================
|
||||||
*/
|
*/
|
||||||
VOID ScanTimeoutAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
void ScanTimeoutAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
||||||
{
|
{
|
||||||
pAd->MlmeAux.Channel = NextChannel(pAd, pAd->MlmeAux.Channel);
|
pAd->MlmeAux.Channel = NextChannel(pAd, pAd->MlmeAux.Channel);
|
||||||
|
|
||||||
@ -1868,9 +1868,9 @@ VOID ScanTimeoutAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
|||||||
Description:
|
Description:
|
||||||
==========================================================================
|
==========================================================================
|
||||||
*/
|
*/
|
||||||
VOID InvalidStateWhenScan(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
void InvalidStateWhenScan(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
||||||
{
|
{
|
||||||
USHORT Status;
|
u16 Status;
|
||||||
DBGPRINT(RT_DEBUG_TRACE,
|
DBGPRINT(RT_DEBUG_TRACE,
|
||||||
("AYNC - InvalidStateWhenScan(state=%ld). Reset SYNC machine\n",
|
("AYNC - InvalidStateWhenScan(state=%ld). Reset SYNC machine\n",
|
||||||
pAd->Mlme.SyncMachine.CurrState));
|
pAd->Mlme.SyncMachine.CurrState));
|
||||||
@ -1884,9 +1884,9 @@ VOID InvalidStateWhenScan(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
|||||||
Description:
|
Description:
|
||||||
==========================================================================
|
==========================================================================
|
||||||
*/
|
*/
|
||||||
VOID InvalidStateWhenJoin(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
void InvalidStateWhenJoin(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
||||||
{
|
{
|
||||||
USHORT Status;
|
u16 Status;
|
||||||
DBGPRINT(RT_DEBUG_TRACE,
|
DBGPRINT(RT_DEBUG_TRACE,
|
||||||
("InvalidStateWhenJoin(state=%ld). Reset SYNC machine\n",
|
("InvalidStateWhenJoin(state=%ld). Reset SYNC machine\n",
|
||||||
pAd->Mlme.SyncMachine.CurrState));
|
pAd->Mlme.SyncMachine.CurrState));
|
||||||
@ -1900,9 +1900,9 @@ VOID InvalidStateWhenJoin(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
|||||||
Description:
|
Description:
|
||||||
==========================================================================
|
==========================================================================
|
||||||
*/
|
*/
|
||||||
VOID InvalidStateWhenStart(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
void InvalidStateWhenStart(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
||||||
{
|
{
|
||||||
USHORT Status;
|
u16 Status;
|
||||||
DBGPRINT(RT_DEBUG_TRACE,
|
DBGPRINT(RT_DEBUG_TRACE,
|
||||||
("InvalidStateWhenStart(state=%ld). Reset SYNC machine\n",
|
("InvalidStateWhenStart(state=%ld). Reset SYNC machine\n",
|
||||||
pAd->Mlme.SyncMachine.CurrState));
|
pAd->Mlme.SyncMachine.CurrState));
|
||||||
@ -1919,12 +1919,12 @@ VOID InvalidStateWhenStart(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
|||||||
|
|
||||||
==========================================================================
|
==========================================================================
|
||||||
*/
|
*/
|
||||||
VOID EnqueuePsPoll(IN PRTMP_ADAPTER pAd)
|
void EnqueuePsPoll(IN PRTMP_ADAPTER pAd)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (pAd->StaCfg.WindowsPowerMode == Ndis802_11PowerModeLegacy_PSP)
|
if (pAd->StaCfg.WindowsPowerMode == Ndis802_11PowerModeLegacy_PSP)
|
||||||
pAd->PsPollFrame.FC.PwrMgmt = PWR_SAVE;
|
pAd->PsPollFrame.FC.PwrMgmt = PWR_SAVE;
|
||||||
MiniportMMRequest(pAd, 0, (PUCHAR) & pAd->PsPollFrame,
|
MiniportMMRequest(pAd, 0, (u8 *)& pAd->PsPollFrame,
|
||||||
sizeof(PSPOLL_FRAME));
|
sizeof(PSPOLL_FRAME));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1933,11 +1933,11 @@ VOID EnqueuePsPoll(IN PRTMP_ADAPTER pAd)
|
|||||||
Description:
|
Description:
|
||||||
==========================================================================
|
==========================================================================
|
||||||
*/
|
*/
|
||||||
VOID EnqueueProbeRequest(IN PRTMP_ADAPTER pAd)
|
void EnqueueProbeRequest(IN PRTMP_ADAPTER pAd)
|
||||||
{
|
{
|
||||||
NDIS_STATUS NState;
|
int NState;
|
||||||
PUCHAR pOutBuffer;
|
u8 *pOutBuffer;
|
||||||
ULONG FrameLen = 0;
|
unsigned long FrameLen = 0;
|
||||||
HEADER_802_11 Hdr80211;
|
HEADER_802_11 Hdr80211;
|
||||||
|
|
||||||
DBGPRINT(RT_DEBUG_TRACE, ("force out a ProbeRequest ...\n"));
|
DBGPRINT(RT_DEBUG_TRACE, ("force out a ProbeRequest ...\n"));
|
||||||
|
@ -37,7 +37,7 @@
|
|||||||
*/
|
*/
|
||||||
#include "../rt_config.h"
|
#include "../rt_config.h"
|
||||||
|
|
||||||
void inc_byte_array(UCHAR * counter, int len);
|
void inc_byte_array(u8 * counter, int len);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
========================================================================
|
========================================================================
|
||||||
@ -58,10 +58,10 @@ void inc_byte_array(UCHAR * counter, int len);
|
|||||||
|
|
||||||
========================================================================
|
========================================================================
|
||||||
*/
|
*/
|
||||||
VOID RTMPReportMicError(IN PRTMP_ADAPTER pAd, IN PCIPHER_KEY pWpaKey)
|
void RTMPReportMicError(IN PRTMP_ADAPTER pAd, IN PCIPHER_KEY pWpaKey)
|
||||||
{
|
{
|
||||||
ULONG Now;
|
unsigned long Now;
|
||||||
UCHAR unicastKey = (pWpaKey->Type == PAIRWISE_KEY ? 1 : 0);
|
u8 unicastKey = (pWpaKey->Type == PAIRWISE_KEY ? 1 : 0);
|
||||||
|
|
||||||
/* Record Last MIC error time and count */
|
/* Record Last MIC error time and count */
|
||||||
NdisGetSystemUpTime(&Now);
|
NdisGetSystemUpTime(&Now);
|
||||||
@ -113,12 +113,12 @@ VOID RTMPReportMicError(IN PRTMP_ADAPTER pAd, IN PCIPHER_KEY pWpaKey)
|
|||||||
|
|
||||||
#define LENGTH_EAP_H 4
|
#define LENGTH_EAP_H 4
|
||||||
/* If the received frame is EAP-Packet ,find out its EAP-Code (Request(0x01), Response(0x02), Success(0x03), Failure(0x04)). */
|
/* If the received frame is EAP-Packet ,find out its EAP-Code (Request(0x01), Response(0x02), Success(0x03), Failure(0x04)). */
|
||||||
INT WpaCheckEapCode(IN PRTMP_ADAPTER pAd,
|
int WpaCheckEapCode(IN PRTMP_ADAPTER pAd,
|
||||||
IN PUCHAR pFrame, IN USHORT FrameLen, IN USHORT OffSet)
|
u8 *pFrame, u16 FrameLen, u16 OffSet)
|
||||||
{
|
{
|
||||||
|
|
||||||
PUCHAR pData;
|
u8 *pData;
|
||||||
INT result = 0;
|
int result = 0;
|
||||||
|
|
||||||
if (FrameLen < OffSet + LENGTH_EAPOL_H + LENGTH_EAP_H)
|
if (FrameLen < OffSet + LENGTH_EAPOL_H + LENGTH_EAP_H)
|
||||||
return result;
|
return result;
|
||||||
@ -133,7 +133,7 @@ INT WpaCheckEapCode(IN PRTMP_ADAPTER pAd,
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID WpaSendMicFailureToWpaSupplicant(IN PRTMP_ADAPTER pAd, IN BOOLEAN bUnicast)
|
void WpaSendMicFailureToWpaSupplicant(IN PRTMP_ADAPTER pAd, IN BOOLEAN bUnicast)
|
||||||
{
|
{
|
||||||
char custom[IW_CUSTOM_MAX] = { 0 };
|
char custom[IW_CUSTOM_MAX] = { 0 };
|
||||||
|
|
||||||
@ -141,19 +141,19 @@ VOID WpaSendMicFailureToWpaSupplicant(IN PRTMP_ADAPTER pAd, IN BOOLEAN bUnicast)
|
|||||||
if (bUnicast)
|
if (bUnicast)
|
||||||
sprintf(custom, "%s unicast", custom);
|
sprintf(custom, "%s unicast", custom);
|
||||||
|
|
||||||
RtmpOSWrielessEventSend(pAd, IWEVCUSTOM, -1, NULL, (PUCHAR) custom,
|
RtmpOSWrielessEventSend(pAd, IWEVCUSTOM, -1, NULL, (u8 *)custom,
|
||||||
strlen(custom));
|
strlen(custom));
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID WpaMicFailureReportFrame(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
void WpaMicFailureReportFrame(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
||||||
{
|
{
|
||||||
PUCHAR pOutBuffer = NULL;
|
u8 *pOutBuffer = NULL;
|
||||||
UCHAR Header802_3[14];
|
u8 Header802_3[14];
|
||||||
ULONG FrameLen = 0;
|
unsigned long FrameLen = 0;
|
||||||
EAPOL_PACKET Packet;
|
EAPOL_PACKET Packet;
|
||||||
UCHAR Mic[16];
|
u8 Mic[16];
|
||||||
BOOLEAN bUnicast;
|
BOOLEAN bUnicast;
|
||||||
|
|
||||||
DBGPRINT(RT_DEBUG_TRACE, ("WpaMicFailureReportFrame ----->\n"));
|
DBGPRINT(RT_DEBUG_TRACE, ("WpaMicFailureReportFrame ----->\n"));
|
||||||
@ -190,30 +190,30 @@ VOID WpaMicFailureReportFrame(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
|||||||
Packet.KeyDesc.KeyInfo.Error = 1;
|
Packet.KeyDesc.KeyInfo.Error = 1;
|
||||||
|
|
||||||
/* Update packet length after decide Key data payload */
|
/* Update packet length after decide Key data payload */
|
||||||
SET_UINT16_TO_ARRARY(Packet.Body_Len, LEN_EAPOL_KEY_MSG)
|
SET_u16_TO_ARRARY(Packet.Body_Len, LEN_EAPOL_KEY_MSG)
|
||||||
/* Key Replay Count */
|
/* Key Replay Count */
|
||||||
NdisMoveMemory(Packet.KeyDesc.ReplayCounter,
|
NdisMoveMemory(Packet.KeyDesc.ReplayCounter,
|
||||||
pAd->StaCfg.ReplayCounter, LEN_KEY_DESC_REPLAY);
|
pAd->StaCfg.ReplayCounter, LEN_KEY_DESC_REPLAY);
|
||||||
inc_byte_array(pAd->StaCfg.ReplayCounter, 8);
|
inc_byte_array(pAd->StaCfg.ReplayCounter, 8);
|
||||||
|
|
||||||
/* Convert to little-endian format. */
|
/* Convert to little-endian format. */
|
||||||
*((USHORT *) & Packet.KeyDesc.KeyInfo) =
|
*((u16 *) & Packet.KeyDesc.KeyInfo) =
|
||||||
cpu2le16(*((USHORT *) & Packet.KeyDesc.KeyInfo));
|
cpu2le16(*((u16 *) & Packet.KeyDesc.KeyInfo));
|
||||||
|
|
||||||
MlmeAllocateMemory(pAd, (PUCHAR *) & pOutBuffer); /* allocate memory */
|
MlmeAllocateMemory(pAd, (u8 **) & pOutBuffer); /* allocate memory */
|
||||||
if (pOutBuffer == NULL) {
|
if (pOutBuffer == NULL) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
/* Prepare EAPOL frame for MIC calculation */
|
/* Prepare EAPOL frame for MIC calculation */
|
||||||
/* Be careful, only EAPOL frame is counted for MIC calculation */
|
/* Be careful, only EAPOL frame is counted for MIC calculation */
|
||||||
MakeOutgoingFrame(pOutBuffer, &FrameLen,
|
MakeOutgoingFrame(pOutBuffer, &FrameLen,
|
||||||
CONV_ARRARY_TO_UINT16(Packet.Body_Len) + 4, &Packet,
|
CONV_ARRARY_TO_u16(Packet.Body_Len) + 4, &Packet,
|
||||||
END_OF_ARGS);
|
END_OF_ARGS);
|
||||||
|
|
||||||
/* Prepare and Fill MIC value */
|
/* Prepare and Fill MIC value */
|
||||||
NdisZeroMemory(Mic, sizeof(Mic));
|
NdisZeroMemory(Mic, sizeof(Mic));
|
||||||
if (pAd->StaCfg.WepStatus == Ndis802_11Encryption3Enabled) { /* AES */
|
if (pAd->StaCfg.WepStatus == Ndis802_11Encryption3Enabled) { /* AES */
|
||||||
UCHAR digest[20] = { 0 };
|
u8 digest[20] = { 0 };
|
||||||
HMAC_SHA1(pAd->StaCfg.PTK, LEN_EAP_MICK, pOutBuffer, FrameLen,
|
HMAC_SHA1(pAd->StaCfg.PTK, LEN_EAP_MICK, pOutBuffer, FrameLen,
|
||||||
digest, SHA1_DIGEST_SIZE);
|
digest, SHA1_DIGEST_SIZE);
|
||||||
NdisMoveMemory(Mic, digest, LEN_KEY_DESC_MIC);
|
NdisMoveMemory(Mic, digest, LEN_KEY_DESC_MIC);
|
||||||
@ -226,10 +226,10 @@ VOID WpaMicFailureReportFrame(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
|||||||
/* copy frame to Tx ring and send MIC failure report frame to authenticator */
|
/* copy frame to Tx ring and send MIC failure report frame to authenticator */
|
||||||
RTMPToWirelessSta(pAd, &pAd->MacTab.Content[BSSID_WCID],
|
RTMPToWirelessSta(pAd, &pAd->MacTab.Content[BSSID_WCID],
|
||||||
Header802_3, LENGTH_802_3,
|
Header802_3, LENGTH_802_3,
|
||||||
(PUCHAR) & Packet,
|
(u8 *)& Packet,
|
||||||
CONV_ARRARY_TO_UINT16(Packet.Body_Len) + 4, FALSE);
|
CONV_ARRARY_TO_u16(Packet.Body_Len) + 4, FALSE);
|
||||||
|
|
||||||
MlmeFreeMemory(pAd, (PUCHAR) pOutBuffer);
|
MlmeFreeMemory(pAd, (u8 *)pOutBuffer);
|
||||||
|
|
||||||
DBGPRINT(RT_DEBUG_TRACE, ("WpaMicFailureReportFrame <-----\n"));
|
DBGPRINT(RT_DEBUG_TRACE, ("WpaMicFailureReportFrame <-----\n"));
|
||||||
}
|
}
|
||||||
@ -243,7 +243,7 @@ VOID WpaMicFailureReportFrame(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
|||||||
* rolling over to more significant bytes if the byte was incremented from
|
* rolling over to more significant bytes if the byte was incremented from
|
||||||
* 0xff to 0x00.
|
* 0xff to 0x00.
|
||||||
*/
|
*/
|
||||||
void inc_byte_array(UCHAR * counter, int len)
|
void inc_byte_array(u8 * counter, int len)
|
||||||
{
|
{
|
||||||
int pos = len - 1;
|
int pos = len - 1;
|
||||||
while (pos >= 0) {
|
while (pos >= 0) {
|
||||||
@ -254,10 +254,10 @@ void inc_byte_array(UCHAR * counter, int len)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID WpaDisassocApAndBlockAssoc(IN PVOID SystemSpecific1,
|
void WpaDisassocApAndBlockAssoc(void *SystemSpecific1,
|
||||||
IN PVOID FunctionContext,
|
void *FunctionContext,
|
||||||
IN PVOID SystemSpecific2,
|
void *SystemSpecific2,
|
||||||
IN PVOID SystemSpecific3)
|
void *SystemSpecific3)
|
||||||
{
|
{
|
||||||
RTMP_ADAPTER *pAd = (PRTMP_ADAPTER) FunctionContext;
|
RTMP_ADAPTER *pAd = (PRTMP_ADAPTER) FunctionContext;
|
||||||
MLME_DISASSOC_REQ_STRUCT DisassocReq;
|
MLME_DISASSOC_REQ_STRUCT DisassocReq;
|
||||||
@ -274,7 +274,7 @@ VOID WpaDisassocApAndBlockAssoc(IN PVOID SystemSpecific1,
|
|||||||
pAd->StaCfg.bBlockAssoc = TRUE;
|
pAd->StaCfg.bBlockAssoc = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID WpaStaPairwiseKeySetting(IN PRTMP_ADAPTER pAd)
|
void WpaStaPairwiseKeySetting(IN PRTMP_ADAPTER pAd)
|
||||||
{
|
{
|
||||||
PCIPHER_KEY pSharedKey;
|
PCIPHER_KEY pSharedKey;
|
||||||
PMAC_TABLE_ENTRY pEntry;
|
PMAC_TABLE_ENTRY pEntry;
|
||||||
@ -330,7 +330,7 @@ VOID WpaStaPairwiseKeySetting(IN PRTMP_ADAPTER pAd)
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID WpaStaGroupKeySetting(IN PRTMP_ADAPTER pAd)
|
void WpaStaGroupKeySetting(IN PRTMP_ADAPTER pAd)
|
||||||
{
|
{
|
||||||
PCIPHER_KEY pSharedKey;
|
PCIPHER_KEY pSharedKey;
|
||||||
|
|
||||||
|
@ -40,7 +40,7 @@
|
|||||||
#include "rt_config.h"
|
#include "rt_config.h"
|
||||||
|
|
||||||
#ifdef DBG
|
#ifdef DBG
|
||||||
extern ULONG RTDebugLevel;
|
extern unsigned long RTDebugLevel;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define NR_WEP_KEYS 4
|
#define NR_WEP_KEYS 4
|
||||||
@ -49,16 +49,16 @@ extern ULONG RTDebugLevel;
|
|||||||
|
|
||||||
#define GROUP_KEY_NO 4
|
#define GROUP_KEY_NO 4
|
||||||
|
|
||||||
extern UCHAR CipherWpa2Template[];
|
extern u8 CipherWpa2Template[];
|
||||||
|
|
||||||
typedef struct PACKED _RT_VERSION_INFO {
|
typedef struct PACKED _RT_VERSION_INFO {
|
||||||
UCHAR DriverVersionW;
|
u8 DriverVersionW;
|
||||||
UCHAR DriverVersionX;
|
u8 DriverVersionX;
|
||||||
UCHAR DriverVersionY;
|
u8 DriverVersionY;
|
||||||
UCHAR DriverVersionZ;
|
u8 DriverVersionZ;
|
||||||
UINT DriverBuildYear;
|
u32 DriverBuildYear;
|
||||||
UINT DriverBuildMonth;
|
u32 DriverBuildMonth;
|
||||||
UINT DriverBuildDay;
|
u32 DriverBuildDay;
|
||||||
} RT_VERSION_INFO, *PRT_VERSION_INFO;
|
} RT_VERSION_INFO, *PRT_VERSION_INFO;
|
||||||
|
|
||||||
static __s32 ralinkrate[] = { 2, 4, 11, 22, /* CCK */
|
static __s32 ralinkrate[] = { 2, 4, 11, 22, /* CCK */
|
||||||
@ -73,13 +73,13 @@ static __s32 ralinkrate[] = { 2, 4, 11, 22, /* CCK */
|
|||||||
90, 180, 270, 360, 540, 720, 810, 900
|
90, 180, 270, 360, 540, 720, 810, 900
|
||||||
};
|
};
|
||||||
|
|
||||||
INT Set_SSID_Proc(IN PRTMP_ADAPTER pAdapter, IN PSTRING arg);
|
int Set_SSID_Proc(IN PRTMP_ADAPTER pAdapter, char *arg);
|
||||||
|
|
||||||
INT Set_NetworkType_Proc(IN PRTMP_ADAPTER pAdapter, IN PSTRING arg);
|
int Set_NetworkType_Proc(IN PRTMP_ADAPTER pAdapter, char *arg);
|
||||||
|
|
||||||
VOID RTMPAddKey(IN PRTMP_ADAPTER pAd, IN PNDIS_802_11_KEY pKey)
|
void RTMPAddKey(IN PRTMP_ADAPTER pAd, IN PNDIS_802_11_KEY pKey)
|
||||||
{
|
{
|
||||||
ULONG KeyIdx;
|
unsigned long KeyIdx;
|
||||||
MAC_TABLE_ENTRY *pEntry;
|
MAC_TABLE_ENTRY *pEntry;
|
||||||
|
|
||||||
DBGPRINT(RT_DEBUG_TRACE, ("RTMPAddKey ------>\n"));
|
DBGPRINT(RT_DEBUG_TRACE, ("RTMPAddKey ------>\n"));
|
||||||
@ -260,8 +260,8 @@ VOID RTMPAddKey(IN PRTMP_ADAPTER pAd, IN PNDIS_802_11_KEY pKey)
|
|||||||
}
|
}
|
||||||
} else /* dynamic WEP from wpa_supplicant */
|
} else /* dynamic WEP from wpa_supplicant */
|
||||||
{
|
{
|
||||||
UCHAR CipherAlg;
|
u8 CipherAlg;
|
||||||
PUCHAR Key;
|
u8 *Key;
|
||||||
|
|
||||||
if (pKey->KeyLength == 32)
|
if (pKey->KeyLength == 32)
|
||||||
goto end;
|
goto end;
|
||||||
@ -279,7 +279,7 @@ VOID RTMPAddKey(IN PRTMP_ADAPTER pAd, IN PNDIS_802_11_KEY pKey)
|
|||||||
|
|
||||||
/* set key material and key length */
|
/* set key material and key length */
|
||||||
pEntry->PairwiseKey.KeyLen =
|
pEntry->PairwiseKey.KeyLen =
|
||||||
(UCHAR) pKey->KeyLength;
|
(u8)pKey->KeyLength;
|
||||||
NdisMoveMemory(pEntry->PairwiseKey.Key,
|
NdisMoveMemory(pEntry->PairwiseKey.Key,
|
||||||
&pKey->KeyMaterial,
|
&pKey->KeyMaterial,
|
||||||
pKey->KeyLength);
|
pKey->KeyLength);
|
||||||
@ -295,7 +295,7 @@ VOID RTMPAddKey(IN PRTMP_ADAPTER pAd, IN PNDIS_802_11_KEY pKey)
|
|||||||
/* Add Pair-wise key to Asic */
|
/* Add Pair-wise key to Asic */
|
||||||
AsicAddPairwiseKeyEntry(pAd,
|
AsicAddPairwiseKeyEntry(pAd,
|
||||||
pEntry->Addr,
|
pEntry->Addr,
|
||||||
(UCHAR) pEntry->
|
(u8)pEntry->
|
||||||
Aid,
|
Aid,
|
||||||
&pEntry->
|
&pEntry->
|
||||||
PairwiseKey);
|
PairwiseKey);
|
||||||
@ -310,11 +310,11 @@ VOID RTMPAddKey(IN PRTMP_ADAPTER pAd, IN PNDIS_802_11_KEY pKey)
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
/* Default key for tx (shared key) */
|
/* Default key for tx (shared key) */
|
||||||
pAd->StaCfg.DefaultKeyId = (UCHAR) KeyIdx;
|
pAd->StaCfg.DefaultKeyId = (u8)KeyIdx;
|
||||||
|
|
||||||
/* set key material and key length */
|
/* set key material and key length */
|
||||||
pAd->SharedKey[BSS0][KeyIdx].KeyLen =
|
pAd->SharedKey[BSS0][KeyIdx].KeyLen =
|
||||||
(UCHAR) pKey->KeyLength;
|
(u8)pKey->KeyLength;
|
||||||
NdisMoveMemory(pAd->SharedKey[BSS0][KeyIdx].Key,
|
NdisMoveMemory(pAd->SharedKey[BSS0][KeyIdx].Key,
|
||||||
&pKey->KeyMaterial,
|
&pKey->KeyMaterial,
|
||||||
pKey->KeyLength);
|
pKey->KeyLength);
|
||||||
@ -408,8 +408,8 @@ int rt_ioctl_giwfreq(struct net_device *dev,
|
|||||||
struct iw_freq *freq, char *extra)
|
struct iw_freq *freq, char *extra)
|
||||||
{
|
{
|
||||||
PRTMP_ADAPTER pAdapter = NULL;
|
PRTMP_ADAPTER pAdapter = NULL;
|
||||||
UCHAR ch;
|
u8 ch;
|
||||||
ULONG m = 2412000;
|
unsigned long m = 2412000;
|
||||||
|
|
||||||
GET_PAD_FROM_NET_DEV(pAdapter, dev);
|
GET_PAD_FROM_NET_DEV(pAdapter, dev);
|
||||||
|
|
||||||
@ -613,7 +613,7 @@ int rt_ioctl_siwap(struct net_device *dev,
|
|||||||
MlmeEnqueue(pAdapter,
|
MlmeEnqueue(pAdapter,
|
||||||
MLME_CNTL_STATE_MACHINE,
|
MLME_CNTL_STATE_MACHINE,
|
||||||
OID_802_11_BSSID,
|
OID_802_11_BSSID,
|
||||||
sizeof(NDIS_802_11_MAC_ADDRESS), (VOID *) & Bssid);
|
sizeof(NDIS_802_11_MAC_ADDRESS), (void *) & Bssid);
|
||||||
|
|
||||||
DBGPRINT(RT_DEBUG_TRACE,
|
DBGPRINT(RT_DEBUG_TRACE,
|
||||||
("IOCTL::SIOCSIWAP %02x:%02x:%02x:%02x:%02x:%02x\n", Bssid[0],
|
("IOCTL::SIOCSIWAP %02x:%02x:%02x:%02x:%02x:%02x\n", Bssid[0],
|
||||||
@ -728,7 +728,7 @@ int rt_ioctl_siwscan(struct net_device *dev,
|
|||||||
{
|
{
|
||||||
PRTMP_ADAPTER pAdapter = NULL;
|
PRTMP_ADAPTER pAdapter = NULL;
|
||||||
|
|
||||||
ULONG Now;
|
unsigned long Now;
|
||||||
int Status = NDIS_STATUS_SUCCESS;
|
int Status = NDIS_STATUS_SUCCESS;
|
||||||
|
|
||||||
GET_PAD_FROM_NET_DEV(pAdapter, dev);
|
GET_PAD_FROM_NET_DEV(pAdapter, dev);
|
||||||
@ -804,10 +804,10 @@ int rt_ioctl_giwscan(struct net_device *dev,
|
|||||||
{
|
{
|
||||||
PRTMP_ADAPTER pAdapter = NULL;
|
PRTMP_ADAPTER pAdapter = NULL;
|
||||||
int i = 0;
|
int i = 0;
|
||||||
PSTRING current_ev = extra, previous_ev = extra;
|
char *current_ev = extra, *previous_ev = extra;
|
||||||
PSTRING end_buf;
|
char *end_buf;
|
||||||
PSTRING current_val;
|
char *current_val;
|
||||||
STRING custom[MAX_CUSTOM_LEN] = { 0 };
|
char custom[MAX_CUSTOM_LEN] = { 0 };
|
||||||
struct iw_event iwe;
|
struct iw_event iwe;
|
||||||
|
|
||||||
GET_PAD_FROM_NET_DEV(pAdapter, dev);
|
GET_PAD_FROM_NET_DEV(pAdapter, dev);
|
||||||
@ -945,7 +945,7 @@ int rt_ioctl_giwscan(struct net_device *dev,
|
|||||||
previous_ev = current_ev;
|
previous_ev = current_ev;
|
||||||
current_ev =
|
current_ev =
|
||||||
iwe_stream_add_point(info, current_ev, end_buf, &iwe,
|
iwe_stream_add_point(info, current_ev, end_buf, &iwe,
|
||||||
(PSTRING) pAdapter->ScanTab.
|
(char *)pAdapter->ScanTab.
|
||||||
BssEntry[i].Ssid);
|
BssEntry[i].Ssid);
|
||||||
if (current_ev == previous_ev)
|
if (current_ev == previous_ev)
|
||||||
return -E2BIG;
|
return -E2BIG;
|
||||||
@ -1027,7 +1027,7 @@ int rt_ioctl_giwscan(struct net_device *dev,
|
|||||||
/*Bit Rate */
|
/*Bit Rate */
|
||||||
/*================================ */
|
/*================================ */
|
||||||
if (pAdapter->ScanTab.BssEntry[i].SupRateLen) {
|
if (pAdapter->ScanTab.BssEntry[i].SupRateLen) {
|
||||||
UCHAR tmpRate =
|
u8 tmpRate =
|
||||||
pAdapter->ScanTab.BssEntry[i].SupRate[pAdapter->
|
pAdapter->ScanTab.BssEntry[i].SupRate[pAdapter->
|
||||||
ScanTab.
|
ScanTab.
|
||||||
BssEntry[i].
|
BssEntry[i].
|
||||||
@ -1062,8 +1062,8 @@ int rt_ioctl_giwscan(struct net_device *dev,
|
|||||||
pAdapter->ScanTab.BssEntry[i].HtCapability.
|
pAdapter->ScanTab.BssEntry[i].HtCapability.
|
||||||
MCSSet[1] ? 15 : 7;
|
MCSSet[1] ? 15 : 7;
|
||||||
int rate_index =
|
int rate_index =
|
||||||
12 + ((UCHAR) capInfo.ChannelWidth * 24) +
|
12 + ((u8)capInfo.ChannelWidth * 24) +
|
||||||
((UCHAR) shortGI * 48) + ((UCHAR) maxMCS);
|
((u8)shortGI * 48) + ((u8)maxMCS);
|
||||||
if (rate_index < 0)
|
if (rate_index < 0)
|
||||||
rate_index = 0;
|
rate_index = 0;
|
||||||
if (rate_index > rate_count)
|
if (rate_index > rate_count)
|
||||||
@ -1140,7 +1140,7 @@ int rt_ioctl_siwessid(struct net_device *dev,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (data->flags) {
|
if (data->flags) {
|
||||||
PSTRING pSsidString = NULL;
|
char *pSsidString = NULL;
|
||||||
|
|
||||||
/* Includes null character. */
|
/* Includes null character. */
|
||||||
if (data->length > (IW_ESSID_MAX_SIZE + 1))
|
if (data->length > (IW_ESSID_MAX_SIZE + 1))
|
||||||
@ -1231,8 +1231,8 @@ int rt_ioctl_giwnickn(struct net_device *dev,
|
|||||||
|
|
||||||
GET_PAD_FROM_NET_DEV(pAdapter, dev);
|
GET_PAD_FROM_NET_DEV(pAdapter, dev);
|
||||||
|
|
||||||
if (data->length > strlen((PSTRING) pAdapter->nickname) + 1)
|
if (data->length > strlen((char *)pAdapter->nickname) + 1)
|
||||||
data->length = strlen((PSTRING) pAdapter->nickname) + 1;
|
data->length = strlen((char *)pAdapter->nickname) + 1;
|
||||||
if (data->length > 0) {
|
if (data->length > 0) {
|
||||||
memcpy(nickname, pAdapter->nickname, data->length - 1);
|
memcpy(nickname, pAdapter->nickname, data->length - 1);
|
||||||
nickname[data->length - 1] = '\0';
|
nickname[data->length - 1] = '\0';
|
||||||
@ -1506,9 +1506,9 @@ rt_ioctl_giwencode(struct net_device *dev,
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void getBaInfo(IN PRTMP_ADAPTER pAd, IN PSTRING pOutBuf)
|
void getBaInfo(IN PRTMP_ADAPTER pAd, char *pOutBuf)
|
||||||
{
|
{
|
||||||
INT i, j;
|
int i, j;
|
||||||
BA_ORI_ENTRY *pOriBAEntry;
|
BA_ORI_ENTRY *pOriBAEntry;
|
||||||
BA_REC_ENTRY *pRecBAEntry;
|
BA_REC_ENTRY *pRecBAEntry;
|
||||||
|
|
||||||
@ -1816,8 +1816,8 @@ int rt_ioctl_giwauth(struct net_device *dev,
|
|||||||
}
|
}
|
||||||
|
|
||||||
void fnSetCipherKey(IN PRTMP_ADAPTER pAdapter,
|
void fnSetCipherKey(IN PRTMP_ADAPTER pAdapter,
|
||||||
IN INT keyIdx,
|
int keyIdx,
|
||||||
IN UCHAR CipherAlg,
|
u8 CipherAlg,
|
||||||
IN BOOLEAN bGTK, IN struct iw_encode_ext *ext)
|
IN BOOLEAN bGTK, IN struct iw_encode_ext *ext)
|
||||||
{
|
{
|
||||||
NdisZeroMemory(&pAdapter->SharedKey[BSS0][keyIdx], sizeof(CIPHER_KEY));
|
NdisZeroMemory(&pAdapter->SharedKey[BSS0][keyIdx], sizeof(CIPHER_KEY));
|
||||||
@ -1881,7 +1881,7 @@ int rt_ioctl_siwencodeext(struct net_device *dev,
|
|||||||
AsicRemovePairwiseKeyEntry(pAdapter, BSS0, BSSID_WCID);
|
AsicRemovePairwiseKeyEntry(pAdapter, BSS0, BSSID_WCID);
|
||||||
pAdapter->SharedKey[BSS0][keyIdx].KeyLen = 0;
|
pAdapter->SharedKey[BSS0][keyIdx].KeyLen = 0;
|
||||||
pAdapter->SharedKey[BSS0][keyIdx].CipherAlg = CIPHER_NONE;
|
pAdapter->SharedKey[BSS0][keyIdx].CipherAlg = CIPHER_NONE;
|
||||||
AsicRemoveSharedKeyEntry(pAdapter, 0, (UCHAR) keyIdx);
|
AsicRemoveSharedKeyEntry(pAdapter, 0, (u8)keyIdx);
|
||||||
NdisZeroMemory(&pAdapter->SharedKey[BSS0][keyIdx],
|
NdisZeroMemory(&pAdapter->SharedKey[BSS0][keyIdx],
|
||||||
sizeof(CIPHER_KEY));
|
sizeof(CIPHER_KEY));
|
||||||
DBGPRINT(RT_DEBUG_TRACE,
|
DBGPRINT(RT_DEBUG_TRACE,
|
||||||
@ -2019,7 +2019,7 @@ rt_ioctl_giwencodeext(struct net_device *dev,
|
|||||||
union iwreq_data *wrqu, char *extra)
|
union iwreq_data *wrqu, char *extra)
|
||||||
{
|
{
|
||||||
PRTMP_ADAPTER pAd = NULL;
|
PRTMP_ADAPTER pAd = NULL;
|
||||||
PCHAR pKey = NULL;
|
char *pKey = NULL;
|
||||||
struct iw_point *encoding = &wrqu->encoding;
|
struct iw_point *encoding = &wrqu->encoding;
|
||||||
struct iw_encode_ext *ext = (struct iw_encode_ext *)extra;
|
struct iw_encode_ext *ext = (struct iw_encode_ext *)extra;
|
||||||
int idx, max_key_len;
|
int idx, max_key_len;
|
||||||
@ -2063,7 +2063,7 @@ rt_ioctl_giwencodeext(struct net_device *dev,
|
|||||||
return -E2BIG;
|
return -E2BIG;
|
||||||
else {
|
else {
|
||||||
ext->key_len = pAd->SharedKey[BSS0][idx].KeyLen;
|
ext->key_len = pAd->SharedKey[BSS0][idx].KeyLen;
|
||||||
pKey = (PCHAR) & (pAd->SharedKey[BSS0][idx].Key[0]);
|
pKey = (char *)& (pAd->SharedKey[BSS0][idx].Key[0]);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case Ndis802_11Encryption2Enabled:
|
case Ndis802_11Encryption2Enabled:
|
||||||
@ -2077,7 +2077,7 @@ rt_ioctl_giwencodeext(struct net_device *dev,
|
|||||||
return -E2BIG;
|
return -E2BIG;
|
||||||
else {
|
else {
|
||||||
ext->key_len = 32;
|
ext->key_len = 32;
|
||||||
pKey = (PCHAR) & pAd->StaCfg.PMK[0];
|
pKey = (char *)& pAd->StaCfg.PMK[0];
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@ -2140,7 +2140,7 @@ int rt_ioctl_giwgenie(struct net_device *dev,
|
|||||||
wrqu->data.length = pAd->StaCfg.RSNIE_Len;
|
wrqu->data.length = pAd->StaCfg.RSNIE_Len;
|
||||||
memcpy(extra, &pAd->StaCfg.RSN_IE[0], pAd->StaCfg.RSNIE_Len);
|
memcpy(extra, &pAd->StaCfg.RSN_IE[0], pAd->StaCfg.RSNIE_Len);
|
||||||
} else {
|
} else {
|
||||||
UCHAR RSNIe = IE_WPA;
|
u8 RSNIe = IE_WPA;
|
||||||
|
|
||||||
if (wrqu->data.length < (pAd->StaCfg.RSNIE_Len + 2)) /* ID, Len */
|
if (wrqu->data.length < (pAd->StaCfg.RSNIE_Len + 2)) /* ID, Len */
|
||||||
return -E2BIG;
|
return -E2BIG;
|
||||||
@ -2165,7 +2165,7 @@ int rt_ioctl_siwpmksa(struct net_device *dev,
|
|||||||
{
|
{
|
||||||
PRTMP_ADAPTER pAd = NULL;
|
PRTMP_ADAPTER pAd = NULL;
|
||||||
struct iw_pmksa *pPmksa = (struct iw_pmksa *)wrqu->data.pointer;
|
struct iw_pmksa *pPmksa = (struct iw_pmksa *)wrqu->data.pointer;
|
||||||
INT CachedIdx = 0, idx = 0;
|
int CachedIdx = 0, idx = 0;
|
||||||
|
|
||||||
GET_PAD_FROM_NET_DEV(pAd, dev);
|
GET_PAD_FROM_NET_DEV(pAd, dev);
|
||||||
|
|
||||||
@ -2268,7 +2268,7 @@ int rt_ioctl_siwrate(struct net_device *dev,
|
|||||||
union iwreq_data *wrqu, char *extra)
|
union iwreq_data *wrqu, char *extra)
|
||||||
{
|
{
|
||||||
PRTMP_ADAPTER pAd = NULL;
|
PRTMP_ADAPTER pAd = NULL;
|
||||||
UINT32 rate = wrqu->bitrate.value, fixed = wrqu->bitrate.fixed;
|
u32 rate = wrqu->bitrate.value, fixed = wrqu->bitrate.fixed;
|
||||||
|
|
||||||
GET_PAD_FROM_NET_DEV(pAd, dev);
|
GET_PAD_FROM_NET_DEV(pAd, dev);
|
||||||
|
|
||||||
@ -2359,15 +2359,15 @@ int rt_ioctl_giwrate(struct net_device *dev,
|
|||||||
pAd->MacTab.Content[BSSID_WCID].HTPhyMode.word;
|
pAd->MacTab.Content[BSSID_WCID].HTPhyMode.word;
|
||||||
|
|
||||||
if (ht_setting.field.MODE >= MODE_HTMIX) {
|
if (ht_setting.field.MODE >= MODE_HTMIX) {
|
||||||
/* rate_index = 12 + ((UCHAR)ht_setting.field.BW *16) + ((UCHAR)ht_setting.field.ShortGI *32) + ((UCHAR)ht_setting.field.MCS); */
|
/* rate_index = 12 + ((u8)ht_setting.field.BW *16) + ((u8)ht_setting.field.ShortGI *32) + ((u8)ht_setting.field.MCS); */
|
||||||
rate_index =
|
rate_index =
|
||||||
12 + ((UCHAR) ht_setting.field.BW * 24) +
|
12 + ((u8)ht_setting.field.BW * 24) +
|
||||||
((UCHAR) ht_setting.field.ShortGI * 48) +
|
((u8)ht_setting.field.ShortGI * 48) +
|
||||||
((UCHAR) ht_setting.field.MCS);
|
((u8)ht_setting.field.MCS);
|
||||||
} else if (ht_setting.field.MODE == MODE_OFDM)
|
} else if (ht_setting.field.MODE == MODE_OFDM)
|
||||||
rate_index = (UCHAR) (ht_setting.field.MCS) + 4;
|
rate_index = (u8)(ht_setting.field.MCS) + 4;
|
||||||
else if (ht_setting.field.MODE == MODE_CCK)
|
else if (ht_setting.field.MODE == MODE_CCK)
|
||||||
rate_index = (UCHAR) (ht_setting.field.MCS);
|
rate_index = (u8)(ht_setting.field.MCS);
|
||||||
|
|
||||||
if (rate_index < 0)
|
if (rate_index < 0)
|
||||||
rate_index = 0;
|
rate_index = 0;
|
||||||
@ -2447,14 +2447,14 @@ const struct iw_handler_def rt28xx_iw_handler_def = {
|
|||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
INT rt28xx_sta_ioctl(IN struct net_device *net_dev,
|
int rt28xx_sta_ioctl(IN struct net_device *net_dev,
|
||||||
IN OUT struct ifreq *rq, IN INT cmd)
|
IN OUT struct ifreq *rq, int cmd)
|
||||||
{
|
{
|
||||||
POS_COOKIE pObj;
|
POS_COOKIE pObj;
|
||||||
RTMP_ADAPTER *pAd = NULL;
|
RTMP_ADAPTER *pAd = NULL;
|
||||||
struct iwreq *wrq = (struct iwreq *)rq;
|
struct iwreq *wrq = (struct iwreq *)rq;
|
||||||
BOOLEAN StateMachineTouched = FALSE;
|
BOOLEAN StateMachineTouched = FALSE;
|
||||||
INT Status = NDIS_STATUS_SUCCESS;
|
int Status = NDIS_STATUS_SUCCESS;
|
||||||
|
|
||||||
GET_PAD_FROM_NET_DEV(pAd, net_dev);
|
GET_PAD_FROM_NET_DEV(pAd, net_dev);
|
||||||
|
|
||||||
@ -2522,7 +2522,7 @@ INT rt28xx_sta_ioctl(IN struct net_device *net_dev,
|
|||||||
{
|
{
|
||||||
struct iw_point *erq = NULL;
|
struct iw_point *erq = NULL;
|
||||||
erq = &wrq->u.data;
|
erq = &wrq->u.data;
|
||||||
erq->length = strlen((PSTRING) pAd->nickname);
|
erq->length = strlen((char *)pAd->nickname);
|
||||||
Status =
|
Status =
|
||||||
copy_to_user(erq->pointer, pAd->nickname,
|
copy_to_user(erq->pointer, pAd->nickname,
|
||||||
erq->length);
|
erq->length);
|
||||||
@ -2639,7 +2639,7 @@ INT rt28xx_sta_ioctl(IN struct net_device *net_dev,
|
|||||||
TRUE if all parameters are OK, FALSE otherwise
|
TRUE if all parameters are OK, FALSE otherwise
|
||||||
==========================================================================
|
==========================================================================
|
||||||
*/
|
*/
|
||||||
INT Set_SSID_Proc(IN PRTMP_ADAPTER pAdapter, IN PSTRING arg)
|
int Set_SSID_Proc(IN PRTMP_ADAPTER pAdapter, char *arg)
|
||||||
{
|
{
|
||||||
NDIS_802_11_SSID Ssid, *pSsid = NULL;
|
NDIS_802_11_SSID Ssid, *pSsid = NULL;
|
||||||
BOOLEAN StateMachineTouched = FALSE;
|
BOOLEAN StateMachineTouched = FALSE;
|
||||||
@ -2669,18 +2669,18 @@ INT Set_SSID_Proc(IN PRTMP_ADAPTER pAdapter, IN PSTRING arg)
|
|||||||
|
|
||||||
if ((pAdapter->StaCfg.WpaPassPhraseLen >= 8) &&
|
if ((pAdapter->StaCfg.WpaPassPhraseLen >= 8) &&
|
||||||
(pAdapter->StaCfg.WpaPassPhraseLen <= 64)) {
|
(pAdapter->StaCfg.WpaPassPhraseLen <= 64)) {
|
||||||
STRING passphrase_str[65] = { 0 };
|
char passphrase_str[65] = { 0 };
|
||||||
UCHAR keyMaterial[40];
|
u8 keyMaterial[40];
|
||||||
|
|
||||||
RTMPMoveMemory(passphrase_str,
|
RTMPMoveMemory(passphrase_str,
|
||||||
pAdapter->StaCfg.WpaPassPhrase,
|
pAdapter->StaCfg.WpaPassPhrase,
|
||||||
pAdapter->StaCfg.WpaPassPhraseLen);
|
pAdapter->StaCfg.WpaPassPhraseLen);
|
||||||
RTMPZeroMemory(pAdapter->StaCfg.PMK, 32);
|
RTMPZeroMemory(pAdapter->StaCfg.PMK, 32);
|
||||||
if (pAdapter->StaCfg.WpaPassPhraseLen == 64) {
|
if (pAdapter->StaCfg.WpaPassPhraseLen == 64) {
|
||||||
AtoH((PSTRING) pAdapter->StaCfg.WpaPassPhrase,
|
AtoH((char *)pAdapter->StaCfg.WpaPassPhrase,
|
||||||
pAdapter->StaCfg.PMK, 32);
|
pAdapter->StaCfg.PMK, 32);
|
||||||
} else {
|
} else {
|
||||||
PasswordHash((PSTRING) pAdapter->StaCfg.
|
PasswordHash((char *)pAdapter->StaCfg.
|
||||||
WpaPassPhrase, Ssid.Ssid,
|
WpaPassPhrase, Ssid.Ssid,
|
||||||
Ssid.SsidLength, keyMaterial);
|
Ssid.SsidLength, keyMaterial);
|
||||||
NdisMoveMemory(pAdapter->StaCfg.PMK,
|
NdisMoveMemory(pAdapter->StaCfg.PMK,
|
||||||
@ -2695,7 +2695,7 @@ INT Set_SSID_Proc(IN PRTMP_ADAPTER pAdapter, IN PSTRING arg)
|
|||||||
MlmeEnqueue(pAdapter,
|
MlmeEnqueue(pAdapter,
|
||||||
MLME_CNTL_STATE_MACHINE,
|
MLME_CNTL_STATE_MACHINE,
|
||||||
OID_802_11_SSID,
|
OID_802_11_SSID,
|
||||||
sizeof(NDIS_802_11_SSID), (VOID *) pSsid);
|
sizeof(NDIS_802_11_SSID), (void *) pSsid);
|
||||||
|
|
||||||
StateMachineTouched = TRUE;
|
StateMachineTouched = TRUE;
|
||||||
DBGPRINT(RT_DEBUG_TRACE,
|
DBGPRINT(RT_DEBUG_TRACE,
|
||||||
@ -2718,9 +2718,9 @@ INT Set_SSID_Proc(IN PRTMP_ADAPTER pAdapter, IN PSTRING arg)
|
|||||||
TRUE if all parameters are OK, FALSE otherwise
|
TRUE if all parameters are OK, FALSE otherwise
|
||||||
==========================================================================
|
==========================================================================
|
||||||
*/
|
*/
|
||||||
INT Set_NetworkType_Proc(IN PRTMP_ADAPTER pAdapter, IN PSTRING arg)
|
int Set_NetworkType_Proc(IN PRTMP_ADAPTER pAdapter, char *arg)
|
||||||
{
|
{
|
||||||
UINT32 Value = 0;
|
u32 Value = 0;
|
||||||
|
|
||||||
if (strcmp(arg, "Adhoc") == 0) {
|
if (strcmp(arg, "Adhoc") == 0) {
|
||||||
if (pAdapter->StaCfg.BssType != BSS_ADHOC) {
|
if (pAdapter->StaCfg.BssType != BSS_ADHOC) {
|
||||||
@ -2789,7 +2789,7 @@ INT Set_NetworkType_Proc(IN PRTMP_ADAPTER pAdapter, IN PSTRING arg)
|
|||||||
DBGPRINT(RT_DEBUG_TRACE,
|
DBGPRINT(RT_DEBUG_TRACE,
|
||||||
("===>Set_NetworkType_Proc::(INFRA)\n"));
|
("===>Set_NetworkType_Proc::(INFRA)\n"));
|
||||||
} else if (strcmp(arg, "Monitor") == 0) {
|
} else if (strcmp(arg, "Monitor") == 0) {
|
||||||
UCHAR bbpValue = 0;
|
u8 bbpValue = 0;
|
||||||
BCN_TIME_CFG_STRUC csr;
|
BCN_TIME_CFG_STRUC csr;
|
||||||
OPSTATUS_CLEAR_FLAG(pAdapter, fOP_STATUS_INFRA_ON);
|
OPSTATUS_CLEAR_FLAG(pAdapter, fOP_STATUS_INFRA_ON);
|
||||||
OPSTATUS_CLEAR_FLAG(pAdapter, fOP_STATUS_ADHOC_ON);
|
OPSTATUS_CLEAR_FLAG(pAdapter, fOP_STATUS_ADHOC_ON);
|
||||||
|
@ -143,7 +143,7 @@ struct usb_device_id rtusb_usb_id[] = {
|
|||||||
{} /* Terminating entry */
|
{} /* Terminating entry */
|
||||||
};
|
};
|
||||||
|
|
||||||
INT const rtusb_usb_id_len =
|
int const rtusb_usb_id_len =
|
||||||
sizeof(rtusb_usb_id) / sizeof(struct usb_device_id);
|
sizeof(rtusb_usb_id) / sizeof(struct usb_device_id);
|
||||||
|
|
||||||
MODULE_DEVICE_TABLE(usb, rtusb_usb_id);
|
MODULE_DEVICE_TABLE(usb, rtusb_usb_id);
|
||||||
@ -185,7 +185,7 @@ BOOLEAN RT28XXChipsetCheck(IN void *_dev_p)
|
|||||||
{
|
{
|
||||||
struct usb_interface *intf = (struct usb_interface *)_dev_p;
|
struct usb_interface *intf = (struct usb_interface *)_dev_p;
|
||||||
struct usb_device *dev_p = interface_to_usbdev(intf);
|
struct usb_device *dev_p = interface_to_usbdev(intf);
|
||||||
UINT32 i;
|
u32 i;
|
||||||
|
|
||||||
for (i = 0; i < rtusb_usb_id_len; i++) {
|
for (i = 0; i < rtusb_usb_id_len; i++) {
|
||||||
if (dev_p->descriptor.idVendor == rtusb_usb_id[i].idVendor &&
|
if (dev_p->descriptor.idVendor == rtusb_usb_id[i].idVendor &&
|
||||||
@ -225,8 +225,8 @@ static BOOLEAN USBDevConfigInit(IN struct usb_device *dev,
|
|||||||
IN RTMP_ADAPTER * pAd)
|
IN RTMP_ADAPTER * pAd)
|
||||||
{
|
{
|
||||||
struct usb_host_interface *iface_desc;
|
struct usb_host_interface *iface_desc;
|
||||||
ULONG BulkOutIdx;
|
unsigned long BulkOutIdx;
|
||||||
UINT32 i;
|
u32 i;
|
||||||
|
|
||||||
/* get the active interface descriptor */
|
/* get the active interface descriptor */
|
||||||
iface_desc = intf->cur_altsetting;
|
iface_desc = intf->cur_altsetting;
|
||||||
@ -338,7 +338,7 @@ resume:rt2870_resume,
|
|||||||
|
|
||||||
#ifdef CONFIG_PM
|
#ifdef CONFIG_PM
|
||||||
|
|
||||||
VOID RT2870RejectPendingPackets(IN PRTMP_ADAPTER pAd)
|
void RT2870RejectPendingPackets(IN PRTMP_ADAPTER pAd)
|
||||||
{
|
{
|
||||||
/* clear PS packets */
|
/* clear PS packets */
|
||||||
/* clear TxSw packets */
|
/* clear TxSw packets */
|
||||||
@ -382,14 +382,14 @@ static int rt2870_resume(struct usb_interface *intf)
|
|||||||
#endif /* CONFIG_PM // */
|
#endif /* CONFIG_PM // */
|
||||||
|
|
||||||
/* Init driver module */
|
/* Init driver module */
|
||||||
INT __init rtusb_init(void)
|
int __init rtusb_init(void)
|
||||||
{
|
{
|
||||||
printk("rtusb init --->\n");
|
printk("rtusb init --->\n");
|
||||||
return usb_register(&rtusb_driver);
|
return usb_register(&rtusb_driver);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Deinit driver module */
|
/* Deinit driver module */
|
||||||
VOID __exit rtusb_exit(void)
|
void __exit rtusb_exit(void)
|
||||||
{
|
{
|
||||||
usb_deregister(&rtusb_driver);
|
usb_deregister(&rtusb_driver);
|
||||||
printk("<--- rtusb exit\n");
|
printk("<--- rtusb exit\n");
|
||||||
@ -416,7 +416,7 @@ Return Value:
|
|||||||
Note:
|
Note:
|
||||||
========================================================================
|
========================================================================
|
||||||
*/
|
*/
|
||||||
INT MlmeThread(IN void *Context)
|
int MlmeThread(IN void *Context)
|
||||||
{
|
{
|
||||||
RTMP_ADAPTER *pAd;
|
RTMP_ADAPTER *pAd;
|
||||||
RTMP_OS_TASK *pTask;
|
RTMP_OS_TASK *pTask;
|
||||||
@ -485,7 +485,7 @@ Return Value:
|
|||||||
Note:
|
Note:
|
||||||
========================================================================
|
========================================================================
|
||||||
*/
|
*/
|
||||||
INT RTUSBCmdThread(IN void *Context)
|
int RTUSBCmdThread(IN void *Context)
|
||||||
{
|
{
|
||||||
RTMP_ADAPTER *pAd;
|
RTMP_ADAPTER *pAd;
|
||||||
RTMP_OS_TASK *pTask;
|
RTMP_OS_TASK *pTask;
|
||||||
@ -533,13 +533,13 @@ INT RTUSBCmdThread(IN void *Context)
|
|||||||
if (pCmdQElmt->buffer != NULL)
|
if (pCmdQElmt->buffer != NULL)
|
||||||
os_free_mem(pAd,
|
os_free_mem(pAd,
|
||||||
pCmdQElmt->buffer);
|
pCmdQElmt->buffer);
|
||||||
os_free_mem(pAd, (PUCHAR) pCmdQElmt);
|
os_free_mem(pAd, (u8 *)pCmdQElmt);
|
||||||
} else {
|
} else {
|
||||||
if ((pCmdQElmt->buffer != NULL)
|
if ((pCmdQElmt->buffer != NULL)
|
||||||
&& (pCmdQElmt->bufferlength != 0))
|
&& (pCmdQElmt->bufferlength != 0))
|
||||||
os_free_mem(pAd,
|
os_free_mem(pAd,
|
||||||
pCmdQElmt->buffer);
|
pCmdQElmt->buffer);
|
||||||
os_free_mem(pAd, (PUCHAR) pCmdQElmt);
|
os_free_mem(pAd, (u8 *)pCmdQElmt);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -570,15 +570,15 @@ INT RTUSBCmdThread(IN void *Context)
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID RTUSBWatchDog(IN RTMP_ADAPTER * pAd)
|
void RTUSBWatchDog(IN RTMP_ADAPTER * pAd)
|
||||||
{
|
{
|
||||||
PHT_TX_CONTEXT pHTTXContext;
|
PHT_TX_CONTEXT pHTTXContext;
|
||||||
int idx;
|
int idx;
|
||||||
ULONG irqFlags;
|
unsigned long irqFlags;
|
||||||
PURB pUrb;
|
PURB pUrb;
|
||||||
BOOLEAN needDumpSeq = FALSE;
|
BOOLEAN needDumpSeq = FALSE;
|
||||||
UINT32 MACValue;
|
u32 MACValue;
|
||||||
UINT32 TxRxQ_Pcnt;
|
u32 TxRxQ_Pcnt;
|
||||||
|
|
||||||
idx = 0;
|
idx = 0;
|
||||||
RTMP_IO_READ32(pAd, TXRXQ_PCNT, &MACValue);
|
RTMP_IO_READ32(pAd, TXRXQ_PCNT, &MACValue);
|
||||||
@ -621,7 +621,7 @@ VOID RTUSBWatchDog(IN RTMP_ADAPTER * pAd)
|
|||||||
RTMP_IRQ_LOCK(&pAd->BulkOutLock[idx], irqFlags);
|
RTMP_IRQ_LOCK(&pAd->BulkOutLock[idx], irqFlags);
|
||||||
if ((pAd->BulkOutPending[idx] == TRUE)
|
if ((pAd->BulkOutPending[idx] == TRUE)
|
||||||
&& pAd->watchDogTxPendingCnt) {
|
&& pAd->watchDogTxPendingCnt) {
|
||||||
INT actual_length = 0, transfer_buffer_length = 0;
|
int actual_length = 0, transfer_buffer_length = 0;
|
||||||
BOOLEAN isDataPacket = FALSE;
|
BOOLEAN isDataPacket = FALSE;
|
||||||
pAd->watchDogTxPendingCnt[idx]++;
|
pAd->watchDogTxPendingCnt[idx]++;
|
||||||
|
|
||||||
@ -723,9 +723,9 @@ VOID RTUSBWatchDog(IN RTMP_ADAPTER * pAd)
|
|||||||
|
|
||||||
/* For Sigma debug, dump the ba_reordering sequence. */
|
/* For Sigma debug, dump the ba_reordering sequence. */
|
||||||
if ((needDumpSeq == TRUE) && (pAd->CommonCfg.bDisableReordering == 0)) {
|
if ((needDumpSeq == TRUE) && (pAd->CommonCfg.bDisableReordering == 0)) {
|
||||||
USHORT Idx;
|
u16 Idx;
|
||||||
PBA_REC_ENTRY pBAEntry = NULL;
|
PBA_REC_ENTRY pBAEntry = NULL;
|
||||||
UCHAR count = 0;
|
u8 count = 0;
|
||||||
struct reordering_mpdu *mpdu_blk;
|
struct reordering_mpdu *mpdu_blk;
|
||||||
|
|
||||||
Idx = pAd->MacTab.Content[BSSID_WCID].BARecWcidArray[0];
|
Idx = pAd->MacTab.Content[BSSID_WCID].BARecWcidArray[0];
|
||||||
@ -809,8 +809,8 @@ static int __devinit rt2870_probe(IN struct usb_interface *intf,
|
|||||||
{
|
{
|
||||||
struct net_device *net_dev = NULL;
|
struct net_device *net_dev = NULL;
|
||||||
RTMP_ADAPTER *pAd = (RTMP_ADAPTER *) NULL;
|
RTMP_ADAPTER *pAd = (RTMP_ADAPTER *) NULL;
|
||||||
INT status, rv;
|
int status, rv;
|
||||||
PVOID handle;
|
void *handle;
|
||||||
RTMP_OS_NETDEV_OP_HOOK netDevHook;
|
RTMP_OS_NETDEV_OP_HOOK netDevHook;
|
||||||
|
|
||||||
DBGPRINT(RT_DEBUG_TRACE, ("===>rt2870_probe()!\n"));
|
DBGPRINT(RT_DEBUG_TRACE, ("===>rt2870_probe()!\n"));
|
||||||
|
@ -158,18 +158,18 @@
|
|||||||
|
|
||||||
#ifndef ROUND_UP
|
#ifndef ROUND_UP
|
||||||
#define ROUND_UP(__x, __y) \
|
#define ROUND_UP(__x, __y) \
|
||||||
(((ULONG)((__x)+((__y)-1))) & ((ULONG)~((__y)-1)))
|
(((unsigned long)((__x)+((__y)-1))) & ((unsigned long)~((__y)-1)))
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define SET_UINT16_TO_ARRARY(_V, _LEN) \
|
#define SET_u16_TO_ARRARY(_V, _LEN) \
|
||||||
{ \
|
{ \
|
||||||
_V[0] = (_LEN & 0xFF00) >> 8; \
|
_V[0] = (_LEN & 0xFF00) >> 8; \
|
||||||
_V[1] = (_LEN & 0xFF); \
|
_V[1] = (_LEN & 0xFF); \
|
||||||
}
|
}
|
||||||
|
|
||||||
#define INC_UINT16_TO_ARRARY(_V, _LEN) \
|
#define INC_u16_TO_ARRARY(_V, _LEN) \
|
||||||
{ \
|
{ \
|
||||||
UINT16 var_len; \
|
u16 var_len; \
|
||||||
\
|
\
|
||||||
var_len = (_V[0]<<8) | (_V[1]); \
|
var_len = (_V[0]<<8) | (_V[1]); \
|
||||||
var_len += _LEN; \
|
var_len += _LEN; \
|
||||||
@ -178,11 +178,11 @@
|
|||||||
_V[1] = (var_len & 0xFF); \
|
_V[1] = (var_len & 0xFF); \
|
||||||
}
|
}
|
||||||
|
|
||||||
#define CONV_ARRARY_TO_UINT16(_V) ((_V[0]<<8) | (_V[1]))
|
#define CONV_ARRARY_TO_u16(_V) ((_V[0]<<8) | (_V[1]))
|
||||||
|
|
||||||
#define ADD_ONE_To_64BIT_VAR(_V) \
|
#define ADD_ONE_To_64BIT_VAR(_V) \
|
||||||
{ \
|
{ \
|
||||||
UCHAR cnt = LEN_KEY_DESC_REPLAY; \
|
u8 cnt = LEN_KEY_DESC_REPLAY; \
|
||||||
do \
|
do \
|
||||||
{ \
|
{ \
|
||||||
cnt--; \
|
cnt--; \
|
||||||
@ -196,105 +196,105 @@
|
|||||||
|
|
||||||
/* EAPOL Key Information definition within Key descriptor format */
|
/* EAPOL Key Information definition within Key descriptor format */
|
||||||
typedef struct PACKED _KEY_INFO {
|
typedef struct PACKED _KEY_INFO {
|
||||||
UCHAR KeyMic:1;
|
u8 KeyMic:1;
|
||||||
UCHAR Secure:1;
|
u8 Secure:1;
|
||||||
UCHAR Error:1;
|
u8 Error:1;
|
||||||
UCHAR Request:1;
|
u8 Request:1;
|
||||||
UCHAR EKD_DL:1; /* EKD for AP; DL for STA */
|
u8 EKD_DL:1; /* EKD for AP; DL for STA */
|
||||||
UCHAR Rsvd:3;
|
u8 Rsvd:3;
|
||||||
UCHAR KeyDescVer:3;
|
u8 KeyDescVer:3;
|
||||||
UCHAR KeyType:1;
|
u8 KeyType:1;
|
||||||
UCHAR KeyIndex:2;
|
u8 KeyIndex:2;
|
||||||
UCHAR Install:1;
|
u8 Install:1;
|
||||||
UCHAR KeyAck:1;
|
u8 KeyAck:1;
|
||||||
} KEY_INFO, *PKEY_INFO;
|
} KEY_INFO, *PKEY_INFO;
|
||||||
|
|
||||||
/* EAPOL Key descriptor format */
|
/* EAPOL Key descriptor format */
|
||||||
typedef struct PACKED _KEY_DESCRIPTER {
|
typedef struct PACKED _KEY_DESCRIPTER {
|
||||||
UCHAR Type;
|
u8 Type;
|
||||||
KEY_INFO KeyInfo;
|
KEY_INFO KeyInfo;
|
||||||
UCHAR KeyLength[2];
|
u8 KeyLength[2];
|
||||||
UCHAR ReplayCounter[LEN_KEY_DESC_REPLAY];
|
u8 ReplayCounter[LEN_KEY_DESC_REPLAY];
|
||||||
UCHAR KeyNonce[LEN_KEY_DESC_NONCE];
|
u8 KeyNonce[LEN_KEY_DESC_NONCE];
|
||||||
UCHAR KeyIv[LEN_KEY_DESC_IV];
|
u8 KeyIv[LEN_KEY_DESC_IV];
|
||||||
UCHAR KeyRsc[LEN_KEY_DESC_RSC];
|
u8 KeyRsc[LEN_KEY_DESC_RSC];
|
||||||
UCHAR KeyId[LEN_KEY_DESC_ID];
|
u8 KeyId[LEN_KEY_DESC_ID];
|
||||||
UCHAR KeyMic[LEN_KEY_DESC_MIC];
|
u8 KeyMic[LEN_KEY_DESC_MIC];
|
||||||
UCHAR KeyDataLen[2];
|
u8 KeyDataLen[2];
|
||||||
UCHAR KeyData[MAX_LEN_OF_RSNIE];
|
u8 KeyData[MAX_LEN_OF_RSNIE];
|
||||||
} KEY_DESCRIPTER, *PKEY_DESCRIPTER;
|
} KEY_DESCRIPTER, *PKEY_DESCRIPTER;
|
||||||
|
|
||||||
typedef struct PACKED _EAPOL_PACKET {
|
typedef struct PACKED _EAPOL_PACKET {
|
||||||
UCHAR ProVer;
|
u8 ProVer;
|
||||||
UCHAR ProType;
|
u8 ProType;
|
||||||
UCHAR Body_Len[2];
|
u8 Body_Len[2];
|
||||||
KEY_DESCRIPTER KeyDesc;
|
KEY_DESCRIPTER KeyDesc;
|
||||||
} EAPOL_PACKET, *PEAPOL_PACKET;
|
} EAPOL_PACKET, *PEAPOL_PACKET;
|
||||||
|
|
||||||
/*802.11i D10 page 83 */
|
/*802.11i D10 page 83 */
|
||||||
typedef struct PACKED _GTK_ENCAP {
|
typedef struct PACKED _GTK_ENCAP {
|
||||||
UCHAR Kid:2;
|
u8 Kid:2;
|
||||||
UCHAR tx:1;
|
u8 tx:1;
|
||||||
UCHAR rsv:5;
|
u8 rsv:5;
|
||||||
UCHAR rsv1;
|
u8 rsv1;
|
||||||
UCHAR GTK[TKIP_GTK_LENGTH];
|
u8 GTK[TKIP_GTK_LENGTH];
|
||||||
} GTK_ENCAP, *PGTK_ENCAP;
|
} GTK_ENCAP, *PGTK_ENCAP;
|
||||||
|
|
||||||
typedef struct PACKED _KDE_ENCAP {
|
typedef struct PACKED _KDE_ENCAP {
|
||||||
UCHAR Type;
|
u8 Type;
|
||||||
UCHAR Len;
|
u8 Len;
|
||||||
UCHAR OUI[3];
|
u8 OUI[3];
|
||||||
UCHAR DataType;
|
u8 DataType;
|
||||||
GTK_ENCAP GTKEncap;
|
GTK_ENCAP GTKEncap;
|
||||||
} KDE_ENCAP, *PKDE_ENCAP;
|
} KDE_ENCAP, *PKDE_ENCAP;
|
||||||
|
|
||||||
/* For WPA1 */
|
/* For WPA1 */
|
||||||
typedef struct PACKED _RSNIE {
|
typedef struct PACKED _RSNIE {
|
||||||
UCHAR oui[4];
|
u8 oui[4];
|
||||||
USHORT version;
|
u16 version;
|
||||||
UCHAR mcast[4];
|
u8 mcast[4];
|
||||||
USHORT ucount;
|
u16 ucount;
|
||||||
struct PACKED {
|
struct PACKED {
|
||||||
UCHAR oui[4];
|
u8 oui[4];
|
||||||
} ucast[1];
|
} ucast[1];
|
||||||
} RSNIE, *PRSNIE;
|
} RSNIE, *PRSNIE;
|
||||||
|
|
||||||
/* For WPA2 */
|
/* For WPA2 */
|
||||||
typedef struct PACKED _RSNIE2 {
|
typedef struct PACKED _RSNIE2 {
|
||||||
USHORT version;
|
u16 version;
|
||||||
UCHAR mcast[4];
|
u8 mcast[4];
|
||||||
USHORT ucount;
|
u16 ucount;
|
||||||
struct PACKED {
|
struct PACKED {
|
||||||
UCHAR oui[4];
|
u8 oui[4];
|
||||||
} ucast[1];
|
} ucast[1];
|
||||||
} RSNIE2, *PRSNIE2;
|
} RSNIE2, *PRSNIE2;
|
||||||
|
|
||||||
/* AKM Suite */
|
/* AKM Suite */
|
||||||
typedef struct PACKED _RSNIE_AUTH {
|
typedef struct PACKED _RSNIE_AUTH {
|
||||||
USHORT acount;
|
u16 acount;
|
||||||
struct PACKED {
|
struct PACKED {
|
||||||
UCHAR oui[4];
|
u8 oui[4];
|
||||||
} auth[1];
|
} auth[1];
|
||||||
} RSNIE_AUTH, *PRSNIE_AUTH;
|
} RSNIE_AUTH, *PRSNIE_AUTH;
|
||||||
|
|
||||||
typedef union PACKED _RSN_CAPABILITIES {
|
typedef union PACKED _RSN_CAPABILITIES {
|
||||||
struct PACKED {
|
struct PACKED {
|
||||||
USHORT PreAuth:1;
|
u16 PreAuth:1;
|
||||||
USHORT No_Pairwise:1;
|
u16 No_Pairwise:1;
|
||||||
USHORT PTKSA_R_Counter:2;
|
u16 PTKSA_R_Counter:2;
|
||||||
USHORT GTKSA_R_Counter:2;
|
u16 GTKSA_R_Counter:2;
|
||||||
USHORT Rsvd:10;
|
u16 Rsvd:10;
|
||||||
} field;
|
} field;
|
||||||
USHORT word;
|
u16 word;
|
||||||
} RSN_CAPABILITIES, *PRSN_CAPABILITIES;
|
} RSN_CAPABILITIES, *PRSN_CAPABILITIES;
|
||||||
|
|
||||||
typedef struct PACKED _EAP_HDR {
|
typedef struct PACKED _EAP_HDR {
|
||||||
UCHAR ProVer;
|
u8 ProVer;
|
||||||
UCHAR ProType;
|
u8 ProType;
|
||||||
UCHAR Body_Len[2];
|
u8 Body_Len[2];
|
||||||
UCHAR code;
|
u8 code;
|
||||||
UCHAR identifier;
|
u8 identifier;
|
||||||
UCHAR length[2]; /* including code and identifier, followed by length-2 octets of data */
|
u8 length[2]; /* including code and identifier, followed by length-2 octets of data */
|
||||||
} EAP_HDR, *PEAP_HDR;
|
} EAP_HDR, *PEAP_HDR;
|
||||||
|
|
||||||
/* For supplicant state machine states. 802.11i Draft 4.1, p. 97 */
|
/* For supplicant state machine states. 802.11i Draft 4.1, p. 97 */
|
||||||
@ -339,55 +339,55 @@ typedef enum _WpaMixPairCipher {
|
|||||||
} WPA_MIX_PAIR_CIPHER;
|
} WPA_MIX_PAIR_CIPHER;
|
||||||
|
|
||||||
typedef struct PACKED _RSN_IE_HEADER_STRUCT {
|
typedef struct PACKED _RSN_IE_HEADER_STRUCT {
|
||||||
UCHAR Eid;
|
u8 Eid;
|
||||||
UCHAR Length;
|
u8 Length;
|
||||||
USHORT Version; /* Little endian format */
|
u16 Version; /* Little endian format */
|
||||||
} RSN_IE_HEADER_STRUCT, *PRSN_IE_HEADER_STRUCT;
|
} RSN_IE_HEADER_STRUCT, *PRSN_IE_HEADER_STRUCT;
|
||||||
|
|
||||||
/* Cipher suite selector types */
|
/* Cipher suite selector types */
|
||||||
typedef struct PACKED _CIPHER_SUITE_STRUCT {
|
typedef struct PACKED _CIPHER_SUITE_STRUCT {
|
||||||
UCHAR Oui[3];
|
u8 Oui[3];
|
||||||
UCHAR Type;
|
u8 Type;
|
||||||
} CIPHER_SUITE_STRUCT, *PCIPHER_SUITE_STRUCT;
|
} CIPHER_SUITE_STRUCT, *PCIPHER_SUITE_STRUCT;
|
||||||
|
|
||||||
/* Authentication and Key Management suite selector */
|
/* Authentication and Key Management suite selector */
|
||||||
typedef struct PACKED _AKM_SUITE_STRUCT {
|
typedef struct PACKED _AKM_SUITE_STRUCT {
|
||||||
UCHAR Oui[3];
|
u8 Oui[3];
|
||||||
UCHAR Type;
|
u8 Type;
|
||||||
} AKM_SUITE_STRUCT, *PAKM_SUITE_STRUCT;
|
} AKM_SUITE_STRUCT, *PAKM_SUITE_STRUCT;
|
||||||
|
|
||||||
/* RSN capability */
|
/* RSN capability */
|
||||||
typedef struct PACKED _RSN_CAPABILITY {
|
typedef struct PACKED _RSN_CAPABILITY {
|
||||||
USHORT Rsv:10;
|
u16 Rsv:10;
|
||||||
USHORT GTKSAReplayCnt:2;
|
u16 GTKSAReplayCnt:2;
|
||||||
USHORT PTKSAReplayCnt:2;
|
u16 PTKSAReplayCnt:2;
|
||||||
USHORT NoPairwise:1;
|
u16 NoPairwise:1;
|
||||||
USHORT PreAuth:1;
|
u16 PreAuth:1;
|
||||||
} RSN_CAPABILITY, *PRSN_CAPABILITY;
|
} RSN_CAPABILITY, *PRSN_CAPABILITY;
|
||||||
|
|
||||||
/*========================================
|
/*========================================
|
||||||
The prototype is defined in cmm_wpa.c
|
The prototype is defined in cmm_wpa.c
|
||||||
========================================*/
|
========================================*/
|
||||||
BOOLEAN WpaMsgTypeSubst(IN UCHAR EAPType, OUT INT * MsgType);
|
BOOLEAN WpaMsgTypeSubst(u8 EAPType, int * MsgType);
|
||||||
|
|
||||||
VOID PRF(IN UCHAR * key,
|
void PRF(u8 * key,
|
||||||
IN INT key_len,
|
int key_len,
|
||||||
IN UCHAR * prefix,
|
u8 * prefix,
|
||||||
IN INT prefix_len,
|
int prefix_len,
|
||||||
IN UCHAR * data, IN INT data_len, OUT UCHAR * output, IN INT len);
|
u8 * data, int data_len, u8 * output, int len);
|
||||||
|
|
||||||
int PasswordHash(char *password,
|
int PasswordHash(char *password,
|
||||||
unsigned char *ssid, int ssidlength, unsigned char *output);
|
unsigned char *ssid, int ssidlength, unsigned char *output);
|
||||||
|
|
||||||
PUINT8 GetSuiteFromRSNIE(IN PUINT8 rsnie,
|
u8 *GetSuiteFromRSNIE(u8 *rsnie,
|
||||||
IN UINT rsnie_len, IN UINT8 type, OUT UINT8 * count);
|
u32 rsnie_len, u8 type, u8 * count);
|
||||||
|
|
||||||
VOID WpaShowAllsuite(IN PUINT8 rsnie, IN UINT rsnie_len);
|
void WpaShowAllsuite(u8 *rsnie, u32 rsnie_len);
|
||||||
|
|
||||||
VOID RTMPInsertRSNIE(IN PUCHAR pFrameBuf,
|
void RTMPInsertRSNIE(u8 *pFrameBuf,
|
||||||
OUT PULONG pFrameLen,
|
unsigned long *pFrameLen,
|
||||||
IN PUINT8 rsnie_ptr,
|
u8 *rsnie_ptr,
|
||||||
IN UINT8 rsnie_len,
|
u8 rsnie_len,
|
||||||
IN PUINT8 pmkid_ptr, IN UINT8 pmkid_len);
|
u8 *pmkid_ptr, u8 pmkid_len);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -41,7 +41,7 @@
|
|||||||
|
|
||||||
#include "../rt_config.h"
|
#include "../rt_config.h"
|
||||||
/* Match total 6 bulkout endpoint to corresponding queue. */
|
/* Match total 6 bulkout endpoint to corresponding queue. */
|
||||||
UCHAR EpToQueue[6] =
|
u8 EpToQueue[6] =
|
||||||
{ FIFO_EDCA, FIFO_EDCA, FIFO_EDCA, FIFO_EDCA, FIFO_EDCA, FIFO_MGMT };
|
{ FIFO_EDCA, FIFO_EDCA, FIFO_EDCA, FIFO_EDCA, FIFO_EDCA, FIFO_MGMT };
|
||||||
|
|
||||||
/*static BOOLEAN SingleBulkOut = FALSE; */
|
/*static BOOLEAN SingleBulkOut = FALSE; */
|
||||||
@ -58,12 +58,12 @@ void RTUSB_FILL_BULK_URB(struct urb *pUrb,
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID RTUSBInitTxDesc(IN PRTMP_ADAPTER pAd,
|
void RTUSBInitTxDesc(IN PRTMP_ADAPTER pAd,
|
||||||
IN PTX_CONTEXT pTxContext,
|
IN PTX_CONTEXT pTxContext,
|
||||||
IN UCHAR BulkOutPipeId, IN usb_complete_t Func)
|
u8 BulkOutPipeId, IN usb_complete_t Func)
|
||||||
{
|
{
|
||||||
PURB pUrb;
|
PURB pUrb;
|
||||||
PUCHAR pSrc = NULL;
|
u8 *pSrc = NULL;
|
||||||
POS_COOKIE pObj = (POS_COOKIE) pAd->OS_Cookie;
|
POS_COOKIE pObj = (POS_COOKIE) pAd->OS_Cookie;
|
||||||
|
|
||||||
pUrb = pTxContext->pUrb;
|
pUrb = pTxContext->pUrb;
|
||||||
@ -76,7 +76,7 @@ VOID RTUSBInitTxDesc(IN PRTMP_ADAPTER pAd,
|
|||||||
pSrc = &pTxContext->TransferBuffer->Aggregation[2];
|
pSrc = &pTxContext->TransferBuffer->Aggregation[2];
|
||||||
} else {
|
} else {
|
||||||
pSrc =
|
pSrc =
|
||||||
(PUCHAR) pTxContext->TransferBuffer->field.WirelessPacket;
|
(u8 *)pTxContext->TransferBuffer->field.WirelessPacket;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*Initialize a tx bulk urb */
|
/*Initialize a tx bulk urb */
|
||||||
@ -96,13 +96,13 @@ VOID RTUSBInitTxDesc(IN PRTMP_ADAPTER pAd,
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID RTUSBInitHTTxDesc(IN PRTMP_ADAPTER pAd,
|
void RTUSBInitHTTxDesc(IN PRTMP_ADAPTER pAd,
|
||||||
IN PHT_TX_CONTEXT pTxContext,
|
IN PHT_TX_CONTEXT pTxContext,
|
||||||
IN UCHAR BulkOutPipeId,
|
u8 BulkOutPipeId,
|
||||||
IN ULONG BulkOutSize, IN usb_complete_t Func)
|
unsigned long BulkOutSize, IN usb_complete_t Func)
|
||||||
{
|
{
|
||||||
PURB pUrb;
|
PURB pUrb;
|
||||||
PUCHAR pSrc = NULL;
|
u8 *pSrc = NULL;
|
||||||
POS_COOKIE pObj = (POS_COOKIE) pAd->OS_Cookie;
|
POS_COOKIE pObj = (POS_COOKIE) pAd->OS_Cookie;
|
||||||
|
|
||||||
pUrb = pTxContext->pUrb;
|
pUrb = pTxContext->pUrb;
|
||||||
@ -128,11 +128,11 @@ VOID RTUSBInitHTTxDesc(IN PRTMP_ADAPTER pAd,
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID RTUSBInitRxDesc(IN PRTMP_ADAPTER pAd, IN PRX_CONTEXT pRxContext)
|
void RTUSBInitRxDesc(IN PRTMP_ADAPTER pAd, IN PRX_CONTEXT pRxContext)
|
||||||
{
|
{
|
||||||
PURB pUrb;
|
PURB pUrb;
|
||||||
POS_COOKIE pObj = (POS_COOKIE) pAd->OS_Cookie;
|
POS_COOKIE pObj = (POS_COOKIE) pAd->OS_Cookie;
|
||||||
ULONG RX_bulk_size;
|
unsigned long RX_bulk_size;
|
||||||
|
|
||||||
pUrb = pRxContext->pUrb;
|
pUrb = pRxContext->pUrb;
|
||||||
ASSERT(pUrb);
|
ASSERT(pUrb);
|
||||||
@ -179,8 +179,8 @@ VOID RTUSBInitRxDesc(IN PRTMP_ADAPTER pAd, IN PRX_CONTEXT pRxContext)
|
|||||||
if(1 /*!(in_interrupt() & 0xffff0000)*/) \
|
if(1 /*!(in_interrupt() & 0xffff0000)*/) \
|
||||||
RTMP_IRQ_UNLOCK((pLock), IrqFlags);
|
RTMP_IRQ_UNLOCK((pLock), IrqFlags);
|
||||||
|
|
||||||
VOID RTUSBBulkOutDataPacket(IN PRTMP_ADAPTER pAd,
|
void RTUSBBulkOutDataPacket(IN PRTMP_ADAPTER pAd,
|
||||||
IN UCHAR BulkOutPipeId, IN UCHAR Index)
|
u8 BulkOutPipeId, u8 Index)
|
||||||
{
|
{
|
||||||
|
|
||||||
PHT_TX_CONTEXT pHTTXContext;
|
PHT_TX_CONTEXT pHTTXContext;
|
||||||
@ -188,11 +188,11 @@ VOID RTUSBBulkOutDataPacket(IN PRTMP_ADAPTER pAd,
|
|||||||
int ret = 0;
|
int ret = 0;
|
||||||
PTXINFO_STRUC pTxInfo, pLastTxInfo = NULL;
|
PTXINFO_STRUC pTxInfo, pLastTxInfo = NULL;
|
||||||
PTXWI_STRUC pTxWI;
|
PTXWI_STRUC pTxWI;
|
||||||
ULONG TmpBulkEndPos, ThisBulkSize;
|
unsigned long TmpBulkEndPos, ThisBulkSize;
|
||||||
unsigned long IrqFlags = 0, IrqFlags2 = 0;
|
unsigned long IrqFlags = 0, IrqFlags2 = 0;
|
||||||
PUCHAR pWirelessPkt, pAppendant;
|
u8 *pWirelessPkt, *pAppendant;
|
||||||
BOOLEAN bTxQLastRound = FALSE;
|
BOOLEAN bTxQLastRound = FALSE;
|
||||||
UCHAR allzero[4] = { 0x0, 0x0, 0x0, 0x0 };
|
u8 allzero[4] = { 0x0, 0x0, 0x0, 0x0 };
|
||||||
|
|
||||||
BULK_OUT_LOCK(&pAd->BulkOutLock[BulkOutPipeId], IrqFlags);
|
BULK_OUT_LOCK(&pAd->BulkOutLock[BulkOutPipeId], IrqFlags);
|
||||||
if ((pAd->BulkOutPending[BulkOutPipeId] == TRUE)
|
if ((pAd->BulkOutPending[BulkOutPipeId] == TRUE)
|
||||||
@ -334,7 +334,7 @@ VOID RTUSBBulkOutDataPacket(IN PRTMP_ADAPTER pAd,
|
|||||||
pHTTXContext->ENextBulkOutPosition,
|
pHTTXContext->ENextBulkOutPosition,
|
||||||
pHTTXContext->bCopySavePad));
|
pHTTXContext->bCopySavePad));
|
||||||
hex_dump("Wrong QSel Pkt:",
|
hex_dump("Wrong QSel Pkt:",
|
||||||
(PUCHAR) & pWirelessPkt[TmpBulkEndPos],
|
(u8 *)& pWirelessPkt[TmpBulkEndPos],
|
||||||
(pHTTXContext->CurWritePosition -
|
(pHTTXContext->CurWritePosition -
|
||||||
pHTTXContext->NextBulkOutPosition));
|
pHTTXContext->NextBulkOutPosition));
|
||||||
}
|
}
|
||||||
@ -429,7 +429,7 @@ VOID RTUSBBulkOutDataPacket(IN PRTMP_ADAPTER pAd,
|
|||||||
ENextBulkOutPosition], 8);
|
ENextBulkOutPosition], 8);
|
||||||
pHTTXContext->bCopySavePad = TRUE;
|
pHTTXContext->bCopySavePad = TRUE;
|
||||||
if (RTMPEqualMemory(pHTTXContext->SavedPad, allzero, 4)) {
|
if (RTMPEqualMemory(pHTTXContext->SavedPad, allzero, 4)) {
|
||||||
PUCHAR pBuf = &pHTTXContext->SavedPad[0];
|
u8 *pBuf = &pHTTXContext->SavedPad[0];
|
||||||
DBGPRINT_RAW(RT_DEBUG_ERROR,
|
DBGPRINT_RAW(RT_DEBUG_ERROR,
|
||||||
("WARNING-Zero-3:%02x%02x%02x%02x%02x%02x%02x%02x,CWPos=%ld, CWRPos=%ld, bCW=%d, NBPos=%ld, TBPos=%ld, TBSize=%ld\n",
|
("WARNING-Zero-3:%02x%02x%02x%02x%02x%02x%02x%02x,CWPos=%ld, CWRPos=%ld, bCW=%d, NBPos=%ld, TBPos=%ld, TBSize=%ld\n",
|
||||||
pBuf[0], pBuf[1], pBuf[2], pBuf[3],
|
pBuf[0], pBuf[1], pBuf[2], pBuf[3],
|
||||||
@ -495,12 +495,12 @@ VOID RTUSBBulkOutDataPacket(IN PRTMP_ADAPTER pAd,
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID RTUSBBulkOutDataPacketComplete(purbb_t pUrb, struct pt_regs * pt_regs)
|
void RTUSBBulkOutDataPacketComplete(purbb_t pUrb, struct pt_regs * pt_regs)
|
||||||
{
|
{
|
||||||
PHT_TX_CONTEXT pHTTXContext;
|
PHT_TX_CONTEXT pHTTXContext;
|
||||||
PRTMP_ADAPTER pAd;
|
PRTMP_ADAPTER pAd;
|
||||||
POS_COOKIE pObj;
|
POS_COOKIE pObj;
|
||||||
UCHAR BulkOutPipeId;
|
u8 BulkOutPipeId;
|
||||||
|
|
||||||
pHTTXContext = (PHT_TX_CONTEXT) pUrb->context;
|
pHTTXContext = (PHT_TX_CONTEXT) pUrb->context;
|
||||||
pAd = pHTTXContext->pAd;
|
pAd = pHTTXContext->pAd;
|
||||||
@ -544,7 +544,7 @@ VOID RTUSBBulkOutDataPacketComplete(purbb_t pUrb, struct pt_regs * pt_regs)
|
|||||||
|
|
||||||
========================================================================
|
========================================================================
|
||||||
*/
|
*/
|
||||||
VOID RTUSBBulkOutNullFrame(IN PRTMP_ADAPTER pAd)
|
void RTUSBBulkOutNullFrame(IN PRTMP_ADAPTER pAd)
|
||||||
{
|
{
|
||||||
PTX_CONTEXT pNullContext = &(pAd->NullContext);
|
PTX_CONTEXT pNullContext = &(pAd->NullContext);
|
||||||
PURB pUrb;
|
PURB pUrb;
|
||||||
@ -589,11 +589,11 @@ VOID RTUSBBulkOutNullFrame(IN PRTMP_ADAPTER pAd)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* NULL frame use BulkOutPipeId = 0 */
|
/* NULL frame use BulkOutPipeId = 0 */
|
||||||
VOID RTUSBBulkOutNullFrameComplete(purbb_t pUrb, struct pt_regs * pt_regs)
|
void RTUSBBulkOutNullFrameComplete(purbb_t pUrb, struct pt_regs * pt_regs)
|
||||||
{
|
{
|
||||||
PRTMP_ADAPTER pAd;
|
PRTMP_ADAPTER pAd;
|
||||||
PTX_CONTEXT pNullContext;
|
PTX_CONTEXT pNullContext;
|
||||||
NTSTATUS Status;
|
int Status;
|
||||||
POS_COOKIE pObj;
|
POS_COOKIE pObj;
|
||||||
|
|
||||||
pNullContext = (PTX_CONTEXT) pUrb->context;
|
pNullContext = (PTX_CONTEXT) pUrb->context;
|
||||||
@ -618,7 +618,7 @@ VOID RTUSBBulkOutNullFrameComplete(purbb_t pUrb, struct pt_regs * pt_regs)
|
|||||||
|
|
||||||
========================================================================
|
========================================================================
|
||||||
*/
|
*/
|
||||||
VOID RTUSBBulkOutMLMEPacket(IN PRTMP_ADAPTER pAd, IN UCHAR Index)
|
void RTUSBBulkOutMLMEPacket(IN PRTMP_ADAPTER pAd, u8 Index)
|
||||||
{
|
{
|
||||||
PTX_CONTEXT pMLMEContext;
|
PTX_CONTEXT pMLMEContext;
|
||||||
PURB pUrb;
|
PURB pUrb;
|
||||||
@ -684,11 +684,11 @@ VOID RTUSBBulkOutMLMEPacket(IN PRTMP_ADAPTER pAd, IN UCHAR Index)
|
|||||||
/* printk("<---RTUSBBulkOutMLMEPacket,Cpu=%d!, Dma=%d, SwIdx=%d!\n", pAd->MgmtRing.TxCpuIdx, pAd->MgmtRing.TxDmaIdx, pAd->MgmtRing.TxSwFreeIdx); */
|
/* printk("<---RTUSBBulkOutMLMEPacket,Cpu=%d!, Dma=%d, SwIdx=%d!\n", pAd->MgmtRing.TxCpuIdx, pAd->MgmtRing.TxDmaIdx, pAd->MgmtRing.TxSwFreeIdx); */
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID RTUSBBulkOutMLMEPacketComplete(purbb_t pUrb, struct pt_regs * pt_regs)
|
void RTUSBBulkOutMLMEPacketComplete(purbb_t pUrb, struct pt_regs * pt_regs)
|
||||||
{
|
{
|
||||||
PTX_CONTEXT pMLMEContext;
|
PTX_CONTEXT pMLMEContext;
|
||||||
PRTMP_ADAPTER pAd;
|
PRTMP_ADAPTER pAd;
|
||||||
NTSTATUS Status;
|
int Status;
|
||||||
POS_COOKIE pObj;
|
POS_COOKIE pObj;
|
||||||
int index;
|
int index;
|
||||||
|
|
||||||
@ -716,7 +716,7 @@ VOID RTUSBBulkOutMLMEPacketComplete(purbb_t pUrb, struct pt_regs * pt_regs)
|
|||||||
|
|
||||||
========================================================================
|
========================================================================
|
||||||
*/
|
*/
|
||||||
VOID RTUSBBulkOutPsPoll(IN PRTMP_ADAPTER pAd)
|
void RTUSBBulkOutPsPoll(IN PRTMP_ADAPTER pAd)
|
||||||
{
|
{
|
||||||
PTX_CONTEXT pPsPollContext = &(pAd->PsPollContext);
|
PTX_CONTEXT pPsPollContext = &(pAd->PsPollContext);
|
||||||
PURB pUrb;
|
PURB pUrb;
|
||||||
@ -758,11 +758,11 @@ VOID RTUSBBulkOutPsPoll(IN PRTMP_ADAPTER pAd)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* PS-Poll frame use BulkOutPipeId = 0 */
|
/* PS-Poll frame use BulkOutPipeId = 0 */
|
||||||
VOID RTUSBBulkOutPsPollComplete(purbb_t pUrb, struct pt_regs * pt_regs)
|
void RTUSBBulkOutPsPollComplete(purbb_t pUrb, struct pt_regs * pt_regs)
|
||||||
{
|
{
|
||||||
PRTMP_ADAPTER pAd;
|
PRTMP_ADAPTER pAd;
|
||||||
PTX_CONTEXT pPsPollContext;
|
PTX_CONTEXT pPsPollContext;
|
||||||
NTSTATUS Status;
|
int Status;
|
||||||
POS_COOKIE pObj;
|
POS_COOKIE pObj;
|
||||||
|
|
||||||
pPsPollContext = (PTX_CONTEXT) pUrb->context;
|
pPsPollContext = (PTX_CONTEXT) pUrb->context;
|
||||||
@ -774,7 +774,7 @@ VOID RTUSBBulkOutPsPollComplete(purbb_t pUrb, struct pt_regs * pt_regs)
|
|||||||
tasklet_hi_schedule(&pObj->pspoll_frame_complete_task);
|
tasklet_hi_schedule(&pObj->pspoll_frame_complete_task);
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID DoBulkIn(IN RTMP_ADAPTER * pAd)
|
void DoBulkIn(IN RTMP_ADAPTER * pAd)
|
||||||
{
|
{
|
||||||
PRX_CONTEXT pRxContext;
|
PRX_CONTEXT pRxContext;
|
||||||
PURB pUrb;
|
PURB pUrb;
|
||||||
@ -845,7 +845,7 @@ VOID DoBulkIn(IN RTMP_ADAPTER * pAd)
|
|||||||
fRTMP_ADAPTER_RADIO_OFF | fRTMP_ADAPTER_RESET_IN_PROGRESS | \
|
fRTMP_ADAPTER_RADIO_OFF | fRTMP_ADAPTER_RESET_IN_PROGRESS | \
|
||||||
fRTMP_ADAPTER_REMOVE_IN_PROGRESS)
|
fRTMP_ADAPTER_REMOVE_IN_PROGRESS)
|
||||||
|
|
||||||
VOID RTUSBBulkReceive(IN PRTMP_ADAPTER pAd)
|
void RTUSBBulkReceive(IN PRTMP_ADAPTER pAd)
|
||||||
{
|
{
|
||||||
PRX_CONTEXT pRxContext;
|
PRX_CONTEXT pRxContext;
|
||||||
unsigned long IrqFlags;
|
unsigned long IrqFlags;
|
||||||
@ -912,7 +912,7 @@ VOID RTUSBBulkReceive(IN PRTMP_ADAPTER pAd)
|
|||||||
Always returns STATUS_MORE_PROCESSING_REQUIRED
|
Always returns STATUS_MORE_PROCESSING_REQUIRED
|
||||||
========================================================================
|
========================================================================
|
||||||
*/
|
*/
|
||||||
VOID RTUSBBulkRxComplete(purbb_t pUrb, struct pt_regs *pt_regs)
|
void RTUSBBulkRxComplete(purbb_t pUrb, struct pt_regs *pt_regs)
|
||||||
{
|
{
|
||||||
/* use a receive tasklet to handle received packets; */
|
/* use a receive tasklet to handle received packets; */
|
||||||
/* or sometimes hardware IRQ will be disabled here, so we can not */
|
/* or sometimes hardware IRQ will be disabled here, so we can not */
|
||||||
@ -943,7 +943,7 @@ VOID RTUSBBulkRxComplete(purbb_t pUrb, struct pt_regs *pt_regs)
|
|||||||
|
|
||||||
========================================================================
|
========================================================================
|
||||||
*/
|
*/
|
||||||
VOID RTUSBKickBulkOut(IN PRTMP_ADAPTER pAd)
|
void RTUSBKickBulkOut(IN PRTMP_ADAPTER pAd)
|
||||||
{
|
{
|
||||||
/* BulkIn Reset will reset whole USB PHY. So we need to make sure fRTMP_ADAPTER_BULKIN_RESET not flaged. */
|
/* BulkIn Reset will reset whole USB PHY. So we need to make sure fRTMP_ADAPTER_BULKIN_RESET not flaged. */
|
||||||
if (!RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_NEED_STOP_TX)
|
if (!RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_NEED_STOP_TX)
|
||||||
@ -1033,9 +1033,9 @@ VOID RTUSBKickBulkOut(IN PRTMP_ADAPTER pAd)
|
|||||||
|
|
||||||
========================================================================
|
========================================================================
|
||||||
*/
|
*/
|
||||||
VOID RTUSBCleanUpDataBulkOutQueue(IN PRTMP_ADAPTER pAd)
|
void RTUSBCleanUpDataBulkOutQueue(IN PRTMP_ADAPTER pAd)
|
||||||
{
|
{
|
||||||
UCHAR Idx;
|
u8 Idx;
|
||||||
PHT_TX_CONTEXT pTxContext;
|
PHT_TX_CONTEXT pTxContext;
|
||||||
|
|
||||||
DBGPRINT(RT_DEBUG_TRACE, ("--->CleanUpDataBulkOutQueue\n"));
|
DBGPRINT(RT_DEBUG_TRACE, ("--->CleanUpDataBulkOutQueue\n"));
|
||||||
@ -1066,7 +1066,7 @@ VOID RTUSBCleanUpDataBulkOutQueue(IN PRTMP_ADAPTER pAd)
|
|||||||
|
|
||||||
========================================================================
|
========================================================================
|
||||||
*/
|
*/
|
||||||
VOID RTUSBCleanUpMLMEBulkOutQueue(IN PRTMP_ADAPTER pAd)
|
void RTUSBCleanUpMLMEBulkOutQueue(IN PRTMP_ADAPTER pAd)
|
||||||
{
|
{
|
||||||
DBGPRINT(RT_DEBUG_TRACE, ("--->CleanUpMLMEBulkOutQueue\n"));
|
DBGPRINT(RT_DEBUG_TRACE, ("--->CleanUpMLMEBulkOutQueue\n"));
|
||||||
DBGPRINT(RT_DEBUG_TRACE, ("<---CleanUpMLMEBulkOutQueue\n"));
|
DBGPRINT(RT_DEBUG_TRACE, ("<---CleanUpMLMEBulkOutQueue\n"));
|
||||||
@ -1085,7 +1085,7 @@ VOID RTUSBCleanUpMLMEBulkOutQueue(IN PRTMP_ADAPTER pAd)
|
|||||||
|
|
||||||
========================================================================
|
========================================================================
|
||||||
*/
|
*/
|
||||||
VOID RTUSBCancelPendingIRPs(IN PRTMP_ADAPTER pAd)
|
void RTUSBCancelPendingIRPs(IN PRTMP_ADAPTER pAd)
|
||||||
{
|
{
|
||||||
RTUSBCancelPendingBulkInIRP(pAd);
|
RTUSBCancelPendingBulkInIRP(pAd);
|
||||||
RTUSBCancelPendingBulkOutIRP(pAd);
|
RTUSBCancelPendingBulkOutIRP(pAd);
|
||||||
@ -1104,10 +1104,10 @@ VOID RTUSBCancelPendingIRPs(IN PRTMP_ADAPTER pAd)
|
|||||||
|
|
||||||
========================================================================
|
========================================================================
|
||||||
*/
|
*/
|
||||||
VOID RTUSBCancelPendingBulkInIRP(IN PRTMP_ADAPTER pAd)
|
void RTUSBCancelPendingBulkInIRP(IN PRTMP_ADAPTER pAd)
|
||||||
{
|
{
|
||||||
PRX_CONTEXT pRxContext;
|
PRX_CONTEXT pRxContext;
|
||||||
UINT i;
|
u32 i;
|
||||||
|
|
||||||
DBGPRINT_RAW(RT_DEBUG_TRACE, ("--->RTUSBCancelPendingBulkInIRP\n"));
|
DBGPRINT_RAW(RT_DEBUG_TRACE, ("--->RTUSBCancelPendingBulkInIRP\n"));
|
||||||
for (i = 0; i < (RX_RING_SIZE); i++) {
|
for (i = 0; i < (RX_RING_SIZE); i++) {
|
||||||
@ -1136,7 +1136,7 @@ VOID RTUSBCancelPendingBulkInIRP(IN PRTMP_ADAPTER pAd)
|
|||||||
|
|
||||||
========================================================================
|
========================================================================
|
||||||
*/
|
*/
|
||||||
VOID RTUSBCancelPendingBulkOutIRP(IN PRTMP_ADAPTER pAd)
|
void RTUSBCancelPendingBulkOutIRP(IN PRTMP_ADAPTER pAd)
|
||||||
{
|
{
|
||||||
PHT_TX_CONTEXT pHTTXContext;
|
PHT_TX_CONTEXT pHTTXContext;
|
||||||
PTX_CONTEXT pMLMEContext;
|
PTX_CONTEXT pMLMEContext;
|
||||||
@ -1144,7 +1144,7 @@ VOID RTUSBCancelPendingBulkOutIRP(IN PRTMP_ADAPTER pAd)
|
|||||||
PTX_CONTEXT pNullContext;
|
PTX_CONTEXT pNullContext;
|
||||||
PTX_CONTEXT pPsPollContext;
|
PTX_CONTEXT pPsPollContext;
|
||||||
PTX_CONTEXT pRTSContext;
|
PTX_CONTEXT pRTSContext;
|
||||||
UINT i, Idx;
|
u32 i, Idx;
|
||||||
/* unsigned int IrqFlags; */
|
/* unsigned int IrqFlags; */
|
||||||
/* NDIS_SPIN_LOCK *pLock; */
|
/* NDIS_SPIN_LOCK *pLock; */
|
||||||
/* BOOLEAN *pPending; */
|
/* BOOLEAN *pPending; */
|
||||||
|
@ -41,14 +41,14 @@
|
|||||||
|
|
||||||
#include "../rt_config.h"
|
#include "../rt_config.h"
|
||||||
|
|
||||||
extern UCHAR Phy11BGNextRateUpward[]; /* defined in mlme.c */
|
extern u8 Phy11BGNextRateUpward[]; /* defined in mlme.c */
|
||||||
extern UCHAR EpToQueue[];
|
extern u8 EpToQueue[];
|
||||||
|
|
||||||
VOID REPORT_AMSDU_FRAMES_TO_LLC(IN PRTMP_ADAPTER pAd,
|
void REPORT_AMSDU_FRAMES_TO_LLC(IN PRTMP_ADAPTER pAd,
|
||||||
IN PUCHAR pData, IN ULONG DataSize)
|
u8 *pData, unsigned long DataSize)
|
||||||
{
|
{
|
||||||
PNDIS_PACKET pPacket;
|
PNDIS_PACKET pPacket;
|
||||||
UINT nMSDU;
|
u32 nMSDU;
|
||||||
struct sk_buff *pSkb;
|
struct sk_buff *pSkb;
|
||||||
|
|
||||||
nMSDU = 0;
|
nMSDU = 0;
|
||||||
@ -85,13 +85,13 @@ VOID REPORT_AMSDU_FRAMES_TO_LLC(IN PRTMP_ADAPTER pAd,
|
|||||||
|
|
||||||
========================================================================
|
========================================================================
|
||||||
*/
|
*/
|
||||||
NDIS_STATUS RTUSBFreeDescriptorRequest(IN PRTMP_ADAPTER pAd,
|
int RTUSBFreeDescriptorRequest(IN PRTMP_ADAPTER pAd,
|
||||||
IN UCHAR BulkOutPipeId,
|
u8 BulkOutPipeId,
|
||||||
IN UINT32 NumberRequired)
|
u32 NumberRequired)
|
||||||
{
|
{
|
||||||
/* UCHAR FreeNumber = 0; */
|
/* u8 FreeNumber = 0; */
|
||||||
/* UINT Index; */
|
/* u32 Index; */
|
||||||
NDIS_STATUS Status = NDIS_STATUS_FAILURE;
|
int Status = NDIS_STATUS_FAILURE;
|
||||||
unsigned long IrqFlags;
|
unsigned long IrqFlags;
|
||||||
HT_TX_CONTEXT *pHTTXContext;
|
HT_TX_CONTEXT *pHTTXContext;
|
||||||
|
|
||||||
@ -127,8 +127,8 @@ NDIS_STATUS RTUSBFreeDescriptorRequest(IN PRTMP_ADAPTER pAd,
|
|||||||
return (Status);
|
return (Status);
|
||||||
}
|
}
|
||||||
|
|
||||||
NDIS_STATUS RTUSBFreeDescriptorRelease(IN RTMP_ADAPTER * pAd,
|
int RTUSBFreeDescriptorRelease(IN RTMP_ADAPTER * pAd,
|
||||||
IN UCHAR BulkOutPipeId)
|
u8 BulkOutPipeId)
|
||||||
{
|
{
|
||||||
unsigned long IrqFlags;
|
unsigned long IrqFlags;
|
||||||
HT_TX_CONTEXT *pHTTXContext;
|
HT_TX_CONTEXT *pHTTXContext;
|
||||||
@ -141,7 +141,7 @@ NDIS_STATUS RTUSBFreeDescriptorRelease(IN RTMP_ADAPTER * pAd,
|
|||||||
return (NDIS_STATUS_SUCCESS);
|
return (NDIS_STATUS_SUCCESS);
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOLEAN RTUSBNeedQueueBackForAgg(IN RTMP_ADAPTER * pAd, IN UCHAR BulkOutPipeId)
|
BOOLEAN RTUSBNeedQueueBackForAgg(IN RTMP_ADAPTER * pAd, u8 BulkOutPipeId)
|
||||||
{
|
{
|
||||||
unsigned long IrqFlags;
|
unsigned long IrqFlags;
|
||||||
HT_TX_CONTEXT *pHTTXContext;
|
HT_TX_CONTEXT *pHTTXContext;
|
||||||
@ -191,9 +191,9 @@ BOOLEAN RTUSBNeedQueueBackForAgg(IN RTMP_ADAPTER * pAd, IN UCHAR BulkOutPipeId)
|
|||||||
|
|
||||||
========================================================================
|
========================================================================
|
||||||
*/
|
*/
|
||||||
VOID RTUSBRejectPendingPackets(IN PRTMP_ADAPTER pAd)
|
void RTUSBRejectPendingPackets(IN PRTMP_ADAPTER pAd)
|
||||||
{
|
{
|
||||||
UCHAR Index;
|
u8 Index;
|
||||||
PQUEUE_ENTRY pEntry;
|
PQUEUE_ENTRY pEntry;
|
||||||
PNDIS_PACKET pPacket;
|
PNDIS_PACKET pPacket;
|
||||||
PQUEUE_HEADER pQueue;
|
PQUEUE_HEADER pQueue;
|
||||||
@ -240,11 +240,11 @@ VOID RTUSBRejectPendingPackets(IN PRTMP_ADAPTER pAd)
|
|||||||
========================================================================
|
========================================================================
|
||||||
*/
|
*/
|
||||||
|
|
||||||
VOID RTMPWriteTxInfo(IN PRTMP_ADAPTER pAd,
|
void RTMPWriteTxInfo(IN PRTMP_ADAPTER pAd,
|
||||||
IN PTXINFO_STRUC pTxInfo,
|
IN PTXINFO_STRUC pTxInfo,
|
||||||
IN USHORT USBDMApktLen,
|
u16 USBDMApktLen,
|
||||||
IN BOOLEAN bWiv,
|
IN BOOLEAN bWiv,
|
||||||
IN UCHAR QueueSel, IN UCHAR NextValid, IN UCHAR TxBurst)
|
u8 QueueSel, u8 NextValid, u8 TxBurst)
|
||||||
{
|
{
|
||||||
pTxInfo->USBDMATxPktLen = USBDMApktLen;
|
pTxInfo->USBDMATxPktLen = USBDMApktLen;
|
||||||
pTxInfo->QSEL = QueueSel;
|
pTxInfo->QSEL = QueueSel;
|
||||||
|
@ -56,9 +56,9 @@
|
|||||||
========================================================================
|
========================================================================
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static NTSTATUS RTUSBFirmwareRun(IN PRTMP_ADAPTER pAd)
|
static int RTUSBFirmwareRun(IN PRTMP_ADAPTER pAd)
|
||||||
{
|
{
|
||||||
NTSTATUS Status;
|
int Status;
|
||||||
|
|
||||||
Status = RTUSB_VendorRequest(pAd,
|
Status = RTUSB_VendorRequest(pAd,
|
||||||
USBD_TRANSFER_DIRECTION_OUT,
|
USBD_TRANSFER_DIRECTION_OUT,
|
||||||
@ -83,13 +83,13 @@ static NTSTATUS RTUSBFirmwareRun(IN PRTMP_ADAPTER pAd)
|
|||||||
|
|
||||||
========================================================================
|
========================================================================
|
||||||
*/
|
*/
|
||||||
NTSTATUS RTUSBFirmwareWrite(IN PRTMP_ADAPTER pAd,
|
int RTUSBFirmwareWrite(IN PRTMP_ADAPTER pAd,
|
||||||
IN PUCHAR pFwImage, IN ULONG FwLen)
|
u8 *pFwImage, unsigned long FwLen)
|
||||||
{
|
{
|
||||||
UINT32 MacReg;
|
u32 MacReg;
|
||||||
NTSTATUS Status;
|
int Status;
|
||||||
/* ULONG i; */
|
/* unsigned long i; */
|
||||||
USHORT writeLen;
|
u16 writeLen;
|
||||||
|
|
||||||
Status = RTUSBReadMACRegister(pAd, MAC_CSR0, &MacReg);
|
Status = RTUSBReadMACRegister(pAd, MAC_CSR0, &MacReg);
|
||||||
|
|
||||||
@ -109,9 +109,9 @@ NTSTATUS RTUSBFirmwareWrite(IN PRTMP_ADAPTER pAd,
|
|||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
NTSTATUS RTUSBVenderReset(IN PRTMP_ADAPTER pAd)
|
int RTUSBVenderReset(IN PRTMP_ADAPTER pAd)
|
||||||
{
|
{
|
||||||
NTSTATUS Status;
|
int Status;
|
||||||
DBGPRINT_RAW(RT_DEBUG_ERROR, ("-->RTUSBVenderReset\n"));
|
DBGPRINT_RAW(RT_DEBUG_ERROR, ("-->RTUSBVenderReset\n"));
|
||||||
Status = RTUSB_VendorRequest(pAd,
|
Status = RTUSB_VendorRequest(pAd,
|
||||||
USBD_TRANSFER_DIRECTION_OUT,
|
USBD_TRANSFER_DIRECTION_OUT,
|
||||||
@ -137,10 +137,10 @@ NTSTATUS RTUSBVenderReset(IN PRTMP_ADAPTER pAd)
|
|||||||
|
|
||||||
========================================================================
|
========================================================================
|
||||||
*/
|
*/
|
||||||
NTSTATUS RTUSBMultiRead(IN PRTMP_ADAPTER pAd,
|
int RTUSBMultiRead(IN PRTMP_ADAPTER pAd,
|
||||||
IN USHORT Offset, OUT PUCHAR pData, IN USHORT length)
|
u16 Offset, u8 *pData, u16 length)
|
||||||
{
|
{
|
||||||
NTSTATUS Status;
|
int Status;
|
||||||
|
|
||||||
Status = RTUSB_VendorRequest(pAd,
|
Status = RTUSB_VendorRequest(pAd,
|
||||||
(USBD_TRANSFER_DIRECTION_IN |
|
(USBD_TRANSFER_DIRECTION_IN |
|
||||||
@ -166,10 +166,10 @@ NTSTATUS RTUSBMultiRead(IN PRTMP_ADAPTER pAd,
|
|||||||
|
|
||||||
========================================================================
|
========================================================================
|
||||||
*/
|
*/
|
||||||
NTSTATUS RTUSBMultiWrite_OneByte(IN PRTMP_ADAPTER pAd,
|
int RTUSBMultiWrite_OneByte(IN PRTMP_ADAPTER pAd,
|
||||||
IN USHORT Offset, IN PUCHAR pData)
|
u16 Offset, u8 *pData)
|
||||||
{
|
{
|
||||||
NTSTATUS Status;
|
int Status;
|
||||||
|
|
||||||
/* TODO: In 2870, use this funciton carefully cause it's not stable. */
|
/* TODO: In 2870, use this funciton carefully cause it's not stable. */
|
||||||
Status = RTUSB_VendorRequest(pAd,
|
Status = RTUSB_VendorRequest(pAd,
|
||||||
@ -180,19 +180,19 @@ NTSTATUS RTUSBMultiWrite_OneByte(IN PRTMP_ADAPTER pAd,
|
|||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
NTSTATUS RTUSBMultiWrite(IN PRTMP_ADAPTER pAd,
|
int RTUSBMultiWrite(IN PRTMP_ADAPTER pAd,
|
||||||
IN USHORT Offset, IN PUCHAR pData, IN USHORT length)
|
u16 Offset, u8 *pData, u16 length)
|
||||||
{
|
{
|
||||||
NTSTATUS Status;
|
int Status;
|
||||||
|
|
||||||
USHORT index = 0, Value;
|
u16 index = 0, Value;
|
||||||
PUCHAR pSrc = pData;
|
u8 *pSrc = pData;
|
||||||
USHORT resude = 0;
|
u16 resude = 0;
|
||||||
|
|
||||||
resude = length % 2;
|
resude = length % 2;
|
||||||
length += resude;
|
length += resude;
|
||||||
do {
|
do {
|
||||||
Value = (USHORT) (*pSrc | (*(pSrc + 1) << 8));
|
Value = (u16)(*pSrc | (*(pSrc + 1) << 8));
|
||||||
Status = RTUSBSingleWrite(pAd, Offset + index, Value);
|
Status = RTUSBSingleWrite(pAd, Offset + index, Value);
|
||||||
index += 2;
|
index += 2;
|
||||||
length -= 2;
|
length -= 2;
|
||||||
@ -202,10 +202,10 @@ NTSTATUS RTUSBMultiWrite(IN PRTMP_ADAPTER pAd,
|
|||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
NTSTATUS RTUSBSingleWrite(IN RTMP_ADAPTER * pAd,
|
int RTUSBSingleWrite(IN RTMP_ADAPTER * pAd,
|
||||||
IN USHORT Offset, IN USHORT Value)
|
u16 Offset, u16 Value)
|
||||||
{
|
{
|
||||||
NTSTATUS Status;
|
int Status;
|
||||||
|
|
||||||
Status = RTUSB_VendorRequest(pAd,
|
Status = RTUSB_VendorRequest(pAd,
|
||||||
USBD_TRANSFER_DIRECTION_OUT,
|
USBD_TRANSFER_DIRECTION_OUT,
|
||||||
@ -231,11 +231,11 @@ NTSTATUS RTUSBSingleWrite(IN RTMP_ADAPTER * pAd,
|
|||||||
|
|
||||||
========================================================================
|
========================================================================
|
||||||
*/
|
*/
|
||||||
NTSTATUS RTUSBReadMACRegister(IN PRTMP_ADAPTER pAd,
|
int RTUSBReadMACRegister(IN PRTMP_ADAPTER pAd,
|
||||||
IN USHORT Offset, OUT PUINT32 pValue)
|
u16 Offset, u32 *pValue)
|
||||||
{
|
{
|
||||||
NTSTATUS Status = 0;
|
int Status = 0;
|
||||||
UINT32 localVal;
|
u32 localVal;
|
||||||
|
|
||||||
Status = RTUSB_VendorRequest(pAd,
|
Status = RTUSB_VendorRequest(pAd,
|
||||||
(USBD_TRANSFER_DIRECTION_IN |
|
(USBD_TRANSFER_DIRECTION_IN |
|
||||||
@ -266,18 +266,18 @@ NTSTATUS RTUSBReadMACRegister(IN PRTMP_ADAPTER pAd,
|
|||||||
|
|
||||||
========================================================================
|
========================================================================
|
||||||
*/
|
*/
|
||||||
NTSTATUS RTUSBWriteMACRegister(IN PRTMP_ADAPTER pAd,
|
int RTUSBWriteMACRegister(IN PRTMP_ADAPTER pAd,
|
||||||
IN USHORT Offset, IN UINT32 Value)
|
u16 Offset, u32 Value)
|
||||||
{
|
{
|
||||||
NTSTATUS Status;
|
int Status;
|
||||||
UINT32 localVal;
|
u32 localVal;
|
||||||
|
|
||||||
localVal = Value;
|
localVal = Value;
|
||||||
|
|
||||||
Status = RTUSBSingleWrite(pAd, Offset, (USHORT) (localVal & 0xffff));
|
Status = RTUSBSingleWrite(pAd, Offset, (u16)(localVal & 0xffff));
|
||||||
Status =
|
Status =
|
||||||
RTUSBSingleWrite(pAd, Offset + 2,
|
RTUSBSingleWrite(pAd, Offset + 2,
|
||||||
(USHORT) ((localVal & 0xffff0000) >> 16));
|
(u16)((localVal & 0xffff0000) >> 16));
|
||||||
|
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
@ -297,12 +297,12 @@ NTSTATUS RTUSBWriteMACRegister(IN PRTMP_ADAPTER pAd,
|
|||||||
|
|
||||||
========================================================================
|
========================================================================
|
||||||
*/
|
*/
|
||||||
NTSTATUS RTUSBReadBBPRegister(IN PRTMP_ADAPTER pAd,
|
int RTUSBReadBBPRegister(IN PRTMP_ADAPTER pAd,
|
||||||
IN UCHAR Id, IN PUCHAR pValue)
|
u8 Id, u8 *pValue)
|
||||||
{
|
{
|
||||||
BBP_CSR_CFG_STRUC BbpCsr;
|
BBP_CSR_CFG_STRUC BbpCsr;
|
||||||
UINT i = 0;
|
u32 i = 0;
|
||||||
NTSTATUS status;
|
int status;
|
||||||
|
|
||||||
/* Verify the busy condition */
|
/* Verify the busy condition */
|
||||||
do {
|
do {
|
||||||
@ -342,7 +342,7 @@ NTSTATUS RTUSBReadBBPRegister(IN PRTMP_ADAPTER pAd,
|
|||||||
status = RTUSBReadMACRegister(pAd, BBP_CSR_CFG, &BbpCsr.word);
|
status = RTUSBReadMACRegister(pAd, BBP_CSR_CFG, &BbpCsr.word);
|
||||||
if (status >= 0) {
|
if (status >= 0) {
|
||||||
if (!(BbpCsr.field.Busy == BUSY)) {
|
if (!(BbpCsr.field.Busy == BUSY)) {
|
||||||
*pValue = (UCHAR) BbpCsr.field.Value;
|
*pValue = (u8)BbpCsr.field.Value;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -383,12 +383,12 @@ NTSTATUS RTUSBReadBBPRegister(IN PRTMP_ADAPTER pAd,
|
|||||||
|
|
||||||
========================================================================
|
========================================================================
|
||||||
*/
|
*/
|
||||||
NTSTATUS RTUSBWriteBBPRegister(IN PRTMP_ADAPTER pAd,
|
int RTUSBWriteBBPRegister(IN PRTMP_ADAPTER pAd,
|
||||||
IN UCHAR Id, IN UCHAR Value)
|
u8 Id, u8 Value)
|
||||||
{
|
{
|
||||||
BBP_CSR_CFG_STRUC BbpCsr;
|
BBP_CSR_CFG_STRUC BbpCsr;
|
||||||
UINT i = 0;
|
u32 i = 0;
|
||||||
NTSTATUS status;
|
int status;
|
||||||
/* Verify the busy condition */
|
/* Verify the busy condition */
|
||||||
do {
|
do {
|
||||||
status = RTUSBReadMACRegister(pAd, BBP_CSR_CFG, &BbpCsr.word);
|
status = RTUSBReadMACRegister(pAd, BBP_CSR_CFG, &BbpCsr.word);
|
||||||
@ -438,11 +438,11 @@ NTSTATUS RTUSBWriteBBPRegister(IN PRTMP_ADAPTER pAd,
|
|||||||
|
|
||||||
========================================================================
|
========================================================================
|
||||||
*/
|
*/
|
||||||
NTSTATUS RTUSBWriteRFRegister(IN PRTMP_ADAPTER pAd, IN UINT32 Value)
|
int RTUSBWriteRFRegister(IN PRTMP_ADAPTER pAd, u32 Value)
|
||||||
{
|
{
|
||||||
PHY_CSR4_STRUC PhyCsr4;
|
PHY_CSR4_STRUC PhyCsr4;
|
||||||
UINT i = 0;
|
u32 i = 0;
|
||||||
NTSTATUS status;
|
int status;
|
||||||
|
|
||||||
NdisZeroMemory(&PhyCsr4, sizeof(PHY_CSR4_STRUC));
|
NdisZeroMemory(&PhyCsr4, sizeof(PHY_CSR4_STRUC));
|
||||||
do {
|
do {
|
||||||
@ -486,10 +486,10 @@ NTSTATUS RTUSBWriteRFRegister(IN PRTMP_ADAPTER pAd, IN UINT32 Value)
|
|||||||
|
|
||||||
========================================================================
|
========================================================================
|
||||||
*/
|
*/
|
||||||
NTSTATUS RTUSBReadEEPROM(IN PRTMP_ADAPTER pAd,
|
int RTUSBReadEEPROM(IN PRTMP_ADAPTER pAd,
|
||||||
IN USHORT Offset, OUT PUCHAR pData, IN USHORT length)
|
u16 Offset, u8 *pData, u16 length)
|
||||||
{
|
{
|
||||||
NTSTATUS Status = STATUS_SUCCESS;
|
int Status = STATUS_SUCCESS;
|
||||||
|
|
||||||
Status = RTUSB_VendorRequest(pAd,
|
Status = RTUSB_VendorRequest(pAd,
|
||||||
(USBD_TRANSFER_DIRECTION_IN |
|
(USBD_TRANSFER_DIRECTION_IN |
|
||||||
@ -515,10 +515,10 @@ NTSTATUS RTUSBReadEEPROM(IN PRTMP_ADAPTER pAd,
|
|||||||
|
|
||||||
========================================================================
|
========================================================================
|
||||||
*/
|
*/
|
||||||
NTSTATUS RTUSBWriteEEPROM(IN PRTMP_ADAPTER pAd,
|
int RTUSBWriteEEPROM(IN PRTMP_ADAPTER pAd,
|
||||||
IN USHORT Offset, IN PUCHAR pData, IN USHORT length)
|
u16 Offset, u8 *pData, u16 length)
|
||||||
{
|
{
|
||||||
NTSTATUS Status = STATUS_SUCCESS;
|
int Status = STATUS_SUCCESS;
|
||||||
|
|
||||||
Status = RTUSB_VendorRequest(pAd,
|
Status = RTUSB_VendorRequest(pAd,
|
||||||
USBD_TRANSFER_DIRECTION_OUT,
|
USBD_TRANSFER_DIRECTION_OUT,
|
||||||
@ -528,13 +528,13 @@ NTSTATUS RTUSBWriteEEPROM(IN PRTMP_ADAPTER pAd,
|
|||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
NTSTATUS RTUSBReadEEPROM16(IN PRTMP_ADAPTER pAd,
|
int RTUSBReadEEPROM16(IN PRTMP_ADAPTER pAd,
|
||||||
IN USHORT offset, OUT PUSHORT pData)
|
u16 offset, u16 *pData)
|
||||||
{
|
{
|
||||||
NTSTATUS status;
|
int status;
|
||||||
USHORT localData;
|
u16 localData;
|
||||||
|
|
||||||
status = RTUSBReadEEPROM(pAd, offset, (PUCHAR) (&localData), 2);
|
status = RTUSBReadEEPROM(pAd, offset, (u8 *)(&localData), 2);
|
||||||
if (status == STATUS_SUCCESS)
|
if (status == STATUS_SUCCESS)
|
||||||
*pData = le2cpu16(localData);
|
*pData = le2cpu16(localData);
|
||||||
|
|
||||||
@ -557,9 +557,9 @@ NTSTATUS RTUSBReadEEPROM16(IN PRTMP_ADAPTER pAd,
|
|||||||
|
|
||||||
========================================================================
|
========================================================================
|
||||||
*/
|
*/
|
||||||
VOID RTUSBPutToSleep(IN PRTMP_ADAPTER pAd)
|
void RTUSBPutToSleep(IN PRTMP_ADAPTER pAd)
|
||||||
{
|
{
|
||||||
UINT32 value;
|
u32 value;
|
||||||
|
|
||||||
/* Timeout 0x40 x 50us */
|
/* Timeout 0x40 x 50us */
|
||||||
value = (SLEEPCID << 16) + (OWNERMCU << 24) + (0x40 << 8) + 1;
|
value = (SLEEPCID << 16) + (OWNERMCU << 24) + (0x40 << 8) + 1;
|
||||||
@ -585,9 +585,9 @@ VOID RTUSBPutToSleep(IN PRTMP_ADAPTER pAd)
|
|||||||
|
|
||||||
========================================================================
|
========================================================================
|
||||||
*/
|
*/
|
||||||
NTSTATUS RTUSBWakeUp(IN PRTMP_ADAPTER pAd)
|
int RTUSBWakeUp(IN PRTMP_ADAPTER pAd)
|
||||||
{
|
{
|
||||||
NTSTATUS Status;
|
int Status;
|
||||||
|
|
||||||
Status = RTUSB_VendorRequest(pAd,
|
Status = RTUSB_VendorRequest(pAd,
|
||||||
USBD_TRANSFER_DIRECTION_OUT,
|
USBD_TRANSFER_DIRECTION_OUT,
|
||||||
@ -612,7 +612,7 @@ NTSTATUS RTUSBWakeUp(IN PRTMP_ADAPTER pAd)
|
|||||||
|
|
||||||
========================================================================
|
========================================================================
|
||||||
*/
|
*/
|
||||||
VOID RTUSBInitializeCmdQ(IN PCmdQ cmdq)
|
void RTUSBInitializeCmdQ(IN PCmdQ cmdq)
|
||||||
{
|
{
|
||||||
cmdq->head = NULL;
|
cmdq->head = NULL;
|
||||||
cmdq->tail = NULL;
|
cmdq->tail = NULL;
|
||||||
@ -635,13 +635,13 @@ VOID RTUSBInitializeCmdQ(IN PCmdQ cmdq)
|
|||||||
|
|
||||||
========================================================================
|
========================================================================
|
||||||
*/
|
*/
|
||||||
NDIS_STATUS RTUSBEnqueueCmdFromNdis(IN PRTMP_ADAPTER pAd,
|
int RTUSBEnqueueCmdFromNdis(IN PRTMP_ADAPTER pAd,
|
||||||
IN NDIS_OID Oid,
|
IN NDIS_OID Oid,
|
||||||
IN BOOLEAN SetInformation,
|
IN BOOLEAN SetInformation,
|
||||||
IN PVOID pInformationBuffer,
|
void *pInformationBuffer,
|
||||||
IN UINT32 InformationBufferLength)
|
u32 InformationBufferLength)
|
||||||
{
|
{
|
||||||
NDIS_STATUS status;
|
int status;
|
||||||
PCmdQElmt cmdqelmt = NULL;
|
PCmdQElmt cmdqelmt = NULL;
|
||||||
RTMP_OS_TASK *pTask = &pAd->cmdQTask;
|
RTMP_OS_TASK *pTask = &pAd->cmdQTask;
|
||||||
|
|
||||||
@ -654,14 +654,14 @@ NDIS_STATUS RTUSBEnqueueCmdFromNdis(IN PRTMP_ADAPTER pAd,
|
|||||||
#endif
|
#endif
|
||||||
return (NDIS_STATUS_RESOURCES);
|
return (NDIS_STATUS_RESOURCES);
|
||||||
|
|
||||||
status = os_alloc_mem(pAd, (PUCHAR *) (&cmdqelmt), sizeof(CmdQElmt));
|
status = os_alloc_mem(pAd, (u8 **) (&cmdqelmt), sizeof(CmdQElmt));
|
||||||
if ((status != NDIS_STATUS_SUCCESS) || (cmdqelmt == NULL))
|
if ((status != NDIS_STATUS_SUCCESS) || (cmdqelmt == NULL))
|
||||||
return (NDIS_STATUS_RESOURCES);
|
return (NDIS_STATUS_RESOURCES);
|
||||||
|
|
||||||
cmdqelmt->buffer = NULL;
|
cmdqelmt->buffer = NULL;
|
||||||
if (pInformationBuffer != NULL) {
|
if (pInformationBuffer != NULL) {
|
||||||
status =
|
status =
|
||||||
os_alloc_mem(pAd, (PUCHAR *) & cmdqelmt->buffer,
|
os_alloc_mem(pAd, (u8 **) & cmdqelmt->buffer,
|
||||||
InformationBufferLength);
|
InformationBufferLength);
|
||||||
if ((status != NDIS_STATUS_SUCCESS)
|
if ((status != NDIS_STATUS_SUCCESS)
|
||||||
|| (cmdqelmt->buffer == NULL)) {
|
|| (cmdqelmt->buffer == NULL)) {
|
||||||
@ -716,22 +716,22 @@ NDIS_STATUS RTUSBEnqueueCmdFromNdis(IN PRTMP_ADAPTER pAd,
|
|||||||
|
|
||||||
========================================================================
|
========================================================================
|
||||||
*/
|
*/
|
||||||
NDIS_STATUS RTUSBEnqueueInternalCmd(IN PRTMP_ADAPTER pAd,
|
int RTUSBEnqueueInternalCmd(IN PRTMP_ADAPTER pAd,
|
||||||
IN NDIS_OID Oid,
|
IN NDIS_OID Oid,
|
||||||
IN PVOID pInformationBuffer,
|
void *pInformationBuffer,
|
||||||
IN UINT32 InformationBufferLength)
|
u32 InformationBufferLength)
|
||||||
{
|
{
|
||||||
NDIS_STATUS status;
|
int status;
|
||||||
PCmdQElmt cmdqelmt = NULL;
|
PCmdQElmt cmdqelmt = NULL;
|
||||||
|
|
||||||
status = os_alloc_mem(pAd, (PUCHAR *) & cmdqelmt, sizeof(CmdQElmt));
|
status = os_alloc_mem(pAd, (u8 **) & cmdqelmt, sizeof(CmdQElmt));
|
||||||
if ((status != NDIS_STATUS_SUCCESS) || (cmdqelmt == NULL))
|
if ((status != NDIS_STATUS_SUCCESS) || (cmdqelmt == NULL))
|
||||||
return (NDIS_STATUS_RESOURCES);
|
return (NDIS_STATUS_RESOURCES);
|
||||||
NdisZeroMemory(cmdqelmt, sizeof(CmdQElmt));
|
NdisZeroMemory(cmdqelmt, sizeof(CmdQElmt));
|
||||||
|
|
||||||
if (InformationBufferLength > 0) {
|
if (InformationBufferLength > 0) {
|
||||||
status =
|
status =
|
||||||
os_alloc_mem(pAd, (PUCHAR *) & cmdqelmt->buffer,
|
os_alloc_mem(pAd, (u8 **) & cmdqelmt->buffer,
|
||||||
InformationBufferLength);
|
InformationBufferLength);
|
||||||
if ((status != NDIS_STATUS_SUCCESS)
|
if ((status != NDIS_STATUS_SUCCESS)
|
||||||
|| (cmdqelmt->buffer == NULL)) {
|
|| (cmdqelmt->buffer == NULL)) {
|
||||||
@ -785,7 +785,7 @@ NDIS_STATUS RTUSBEnqueueInternalCmd(IN PRTMP_ADAPTER pAd,
|
|||||||
|
|
||||||
========================================================================
|
========================================================================
|
||||||
*/
|
*/
|
||||||
VOID RTUSBDequeueCmd(IN PCmdQ cmdq, OUT PCmdQElmt * pcmdqelmt)
|
void RTUSBDequeueCmd(IN PCmdQ cmdq, OUT PCmdQElmt * pcmdqelmt)
|
||||||
{
|
{
|
||||||
*pcmdqelmt = cmdq->head;
|
*pcmdqelmt = cmdq->head;
|
||||||
|
|
||||||
@ -833,14 +833,14 @@ VOID RTUSBDequeueCmd(IN PCmdQ cmdq, OUT PCmdQElmt * pcmdqelmt)
|
|||||||
|
|
||||||
========================================================================
|
========================================================================
|
||||||
*/
|
*/
|
||||||
NTSTATUS RTUSB_VendorRequest(IN PRTMP_ADAPTER pAd,
|
int RTUSB_VendorRequest(IN PRTMP_ADAPTER pAd,
|
||||||
IN UINT32 TransferFlags,
|
u32 TransferFlags,
|
||||||
IN UCHAR RequestType,
|
u8 RequestType,
|
||||||
IN UCHAR Request,
|
u8 Request,
|
||||||
IN USHORT Value,
|
u16 Value,
|
||||||
IN USHORT Index,
|
u16 Index,
|
||||||
IN PVOID TransferBuffer,
|
void *TransferBuffer,
|
||||||
IN UINT32 TransferBufferLength)
|
u32 TransferBufferLength)
|
||||||
{
|
{
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
POS_COOKIE pObj = (POS_COOKIE) pAd->OS_Cookie;
|
POS_COOKIE pObj = (POS_COOKIE) pAd->OS_Cookie;
|
||||||
@ -954,22 +954,22 @@ NTSTATUS RTUSB_VendorRequest(IN PRTMP_ADAPTER pAd,
|
|||||||
|
|
||||||
========================================================================
|
========================================================================
|
||||||
*/
|
*/
|
||||||
NTSTATUS RTUSB_ResetDevice(IN PRTMP_ADAPTER pAd)
|
int RTUSB_ResetDevice(IN PRTMP_ADAPTER pAd)
|
||||||
{
|
{
|
||||||
NTSTATUS Status = TRUE;
|
int Status = TRUE;
|
||||||
|
|
||||||
DBGPRINT_RAW(RT_DEBUG_TRACE, ("--->USB_ResetDevice\n"));
|
DBGPRINT_RAW(RT_DEBUG_TRACE, ("--->USB_ResetDevice\n"));
|
||||||
/*RTMP_SET_FLAG(pAd, fRTMP_ADAPTER_RESET_IN_PROGRESS); */
|
/*RTMP_SET_FLAG(pAd, fRTMP_ADAPTER_RESET_IN_PROGRESS); */
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID CMDHandler(IN PRTMP_ADAPTER pAd)
|
void CMDHandler(IN PRTMP_ADAPTER pAd)
|
||||||
{
|
{
|
||||||
PCmdQElmt cmdqelmt;
|
PCmdQElmt cmdqelmt;
|
||||||
PUCHAR pData;
|
u8 *pData;
|
||||||
NDIS_STATUS NdisStatus = NDIS_STATUS_SUCCESS;
|
int NdisStatus = NDIS_STATUS_SUCCESS;
|
||||||
/* ULONG Now = 0; */
|
/* unsigned long Now = 0; */
|
||||||
NTSTATUS ntStatus;
|
int ntStatus;
|
||||||
/* unsigned long IrqFlags; */
|
/* unsigned long IrqFlags; */
|
||||||
|
|
||||||
while (pAd && pAd->CmdQ.size > 0) {
|
while (pAd && pAd->CmdQ.size > 0) {
|
||||||
@ -990,7 +990,7 @@ VOID CMDHandler(IN PRTMP_ADAPTER pAd)
|
|||||||
switch (cmdqelmt->command) {
|
switch (cmdqelmt->command) {
|
||||||
case CMDTHREAD_CHECK_GPIO:
|
case CMDTHREAD_CHECK_GPIO:
|
||||||
{
|
{
|
||||||
UINT32 data;
|
u32 data;
|
||||||
|
|
||||||
{
|
{
|
||||||
/* Read GPIO pin2 as Hardware controlled radio state */
|
/* Read GPIO pin2 as Hardware controlled radio state */
|
||||||
@ -1052,8 +1052,8 @@ VOID CMDHandler(IN PRTMP_ADAPTER pAd)
|
|||||||
|
|
||||||
case CMDTHREAD_RESET_BULK_OUT:
|
case CMDTHREAD_RESET_BULK_OUT:
|
||||||
{
|
{
|
||||||
UINT32 MACValue;
|
u32 MACValue;
|
||||||
UCHAR Index;
|
u8 Index;
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
PHT_TX_CONTEXT pHTTXContext;
|
PHT_TX_CONTEXT pHTTXContext;
|
||||||
/* RTMP_TX_RING *pTxRing; */
|
/* RTMP_TX_RING *pTxRing; */
|
||||||
@ -1273,7 +1273,7 @@ VOID CMDHandler(IN PRTMP_ADAPTER pAd)
|
|||||||
if (pAd->
|
if (pAd->
|
||||||
bulkResetPipeid ==
|
bulkResetPipeid ==
|
||||||
0) {
|
0) {
|
||||||
UCHAR
|
u8
|
||||||
pendingContext
|
pendingContext
|
||||||
= 0;
|
= 0;
|
||||||
PHT_TX_CONTEXT
|
PHT_TX_CONTEXT
|
||||||
@ -1377,7 +1377,7 @@ VOID CMDHandler(IN PRTMP_ADAPTER pAd)
|
|||||||
|
|
||||||
if ((atomic_read(&pAd->PendingRx) == 0) && (!RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_HALT_IN_PROGRESS)))
|
if ((atomic_read(&pAd->PendingRx) == 0) && (!RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_HALT_IN_PROGRESS)))
|
||||||
{
|
{
|
||||||
UCHAR i;
|
u8 i;
|
||||||
RTUSBRxPacket(pAd);
|
RTUSBRxPacket(pAd);
|
||||||
pAd->NextRxBulkInReadIndex = 0; // Next Rx Read index
|
pAd->NextRxBulkInReadIndex = 0; // Next Rx Read index
|
||||||
pAd->NextRxBulkInIndex = 0; // Rx Bulk pointer
|
pAd->NextRxBulkInIndex = 0; // Rx Bulk pointer
|
||||||
@ -1405,7 +1405,7 @@ VOID CMDHandler(IN PRTMP_ADAPTER pAd)
|
|||||||
|
|
||||||
/* All transfers must be aborted or cancelled before attempting to reset the pipe. */
|
/* All transfers must be aborted or cancelled before attempting to reset the pipe. */
|
||||||
{
|
{
|
||||||
UINT32 MACValue;
|
u32 MACValue;
|
||||||
|
|
||||||
{
|
{
|
||||||
/*while ((atomic_read(&pAd->PendingRx) > 0) && (!RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_NIC_NOT_EXIST))) */
|
/*while ((atomic_read(&pAd->PendingRx) > 0) && (!RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_NIC_NOT_EXIST))) */
|
||||||
@ -1440,7 +1440,7 @@ VOID CMDHandler(IN PRTMP_ADAPTER pAd)
|
|||||||
|
|
|
|
||||||
fRTMP_ADAPTER_NIC_NOT_EXIST)))))
|
fRTMP_ADAPTER_NIC_NOT_EXIST)))))
|
||||||
{
|
{
|
||||||
UCHAR i;
|
u8 i;
|
||||||
|
|
||||||
if (RTMP_TEST_FLAG
|
if (RTMP_TEST_FLAG
|
||||||
(pAd,
|
(pAd,
|
||||||
@ -1607,8 +1607,8 @@ VOID CMDHandler(IN PRTMP_ADAPTER pAd)
|
|||||||
case CMDTHREAD_SET_ASIC_WCID:
|
case CMDTHREAD_SET_ASIC_WCID:
|
||||||
{
|
{
|
||||||
RT_SET_ASIC_WCID SetAsicWcid;
|
RT_SET_ASIC_WCID SetAsicWcid;
|
||||||
USHORT offset;
|
u16 offset;
|
||||||
UINT32 MACValue, MACRValue = 0;
|
u32 MACValue, MACRValue = 0;
|
||||||
SetAsicWcid =
|
SetAsicWcid =
|
||||||
*((PRT_SET_ASIC_WCID) (pData));
|
*((PRT_SET_ASIC_WCID) (pData));
|
||||||
|
|
||||||
@ -1618,7 +1618,7 @@ VOID CMDHandler(IN PRTMP_ADAPTER pAd)
|
|||||||
|
|
||||||
offset =
|
offset =
|
||||||
MAC_WCID_BASE +
|
MAC_WCID_BASE +
|
||||||
((UCHAR) SetAsicWcid.WCID) *
|
((u8)SetAsicWcid.WCID) *
|
||||||
HW_WCID_ENTRY_SIZE;
|
HW_WCID_ENTRY_SIZE;
|
||||||
|
|
||||||
DBGPRINT_RAW(RT_DEBUG_TRACE,
|
DBGPRINT_RAW(RT_DEBUG_TRACE,
|
||||||
@ -1673,8 +1673,8 @@ VOID CMDHandler(IN PRTMP_ADAPTER pAd)
|
|||||||
case CMDTHREAD_SET_ASIC_WCID_CIPHER:
|
case CMDTHREAD_SET_ASIC_WCID_CIPHER:
|
||||||
{
|
{
|
||||||
RT_SET_ASIC_WCID_ATTRI SetAsicWcidAttri;
|
RT_SET_ASIC_WCID_ATTRI SetAsicWcidAttri;
|
||||||
USHORT offset;
|
u16 offset;
|
||||||
UINT32 MACRValue = 0;
|
u32 MACRValue = 0;
|
||||||
SHAREDKEY_MODE_STRUC csr1;
|
SHAREDKEY_MODE_STRUC csr1;
|
||||||
SetAsicWcidAttri =
|
SetAsicWcidAttri =
|
||||||
*((PRT_SET_ASIC_WCID_ATTRI)
|
*((PRT_SET_ASIC_WCID_ATTRI)
|
||||||
@ -1686,7 +1686,7 @@ VOID CMDHandler(IN PRTMP_ADAPTER pAd)
|
|||||||
|
|
||||||
offset =
|
offset =
|
||||||
MAC_WCID_ATTRIBUTE_BASE +
|
MAC_WCID_ATTRIBUTE_BASE +
|
||||||
((UCHAR) SetAsicWcidAttri.WCID) *
|
((u8)SetAsicWcidAttri.WCID) *
|
||||||
HW_WCID_ATTRI_SIZE;
|
HW_WCID_ATTRI_SIZE;
|
||||||
|
|
||||||
DBGPRINT_RAW(RT_DEBUG_TRACE,
|
DBGPRINT_RAW(RT_DEBUG_TRACE,
|
||||||
@ -1698,7 +1698,7 @@ VOID CMDHandler(IN PRTMP_ADAPTER pAd)
|
|||||||
&MACRValue);
|
&MACRValue);
|
||||||
MACRValue = 0;
|
MACRValue = 0;
|
||||||
MACRValue |=
|
MACRValue |=
|
||||||
(((UCHAR) SetAsicWcidAttri.
|
(((u8)SetAsicWcidAttri.
|
||||||
Cipher) << 1);
|
Cipher) << 1);
|
||||||
|
|
||||||
RTUSBWriteMACRegister(pAd, offset,
|
RTUSBWriteMACRegister(pAd, offset,
|
||||||
@ -1709,7 +1709,7 @@ VOID CMDHandler(IN PRTMP_ADAPTER pAd)
|
|||||||
|
|
||||||
offset =
|
offset =
|
||||||
PAIRWISE_IVEIV_TABLE_BASE +
|
PAIRWISE_IVEIV_TABLE_BASE +
|
||||||
((UCHAR) SetAsicWcidAttri.WCID) *
|
((u8)SetAsicWcidAttri.WCID) *
|
||||||
HW_IVEIV_ENTRY_SIZE;
|
HW_IVEIV_ENTRY_SIZE;
|
||||||
MACRValue = 0;
|
MACRValue = 0;
|
||||||
if ((SetAsicWcidAttri.Cipher <=
|
if ((SetAsicWcidAttri.Cipher <=
|
||||||
@ -1738,7 +1738,7 @@ VOID CMDHandler(IN PRTMP_ADAPTER pAd)
|
|||||||
&MACRValue);
|
&MACRValue);
|
||||||
MACRValue &= (~0xe);
|
MACRValue &= (~0xe);
|
||||||
MACRValue |=
|
MACRValue |=
|
||||||
(((UCHAR) SetAsicWcidAttri.
|
(((u8)SetAsicWcidAttri.
|
||||||
Cipher) << 1);
|
Cipher) << 1);
|
||||||
|
|
||||||
RTUSBWriteMACRegister(pAd,
|
RTUSBWriteMACRegister(pAd,
|
||||||
@ -1779,7 +1779,7 @@ VOID CMDHandler(IN PRTMP_ADAPTER pAd)
|
|||||||
(pData));
|
(pData));
|
||||||
AsicAddPairwiseKeyEntry(pAd,
|
AsicAddPairwiseKeyEntry(pAd,
|
||||||
KeyInfo.MacAddr,
|
KeyInfo.MacAddr,
|
||||||
(UCHAR) KeyInfo.
|
(u8)KeyInfo.
|
||||||
MacTabMatchWCID,
|
MacTabMatchWCID,
|
||||||
&KeyInfo.
|
&KeyInfo.
|
||||||
CipherKey);
|
CipherKey);
|
||||||
@ -1789,9 +1789,9 @@ VOID CMDHandler(IN PRTMP_ADAPTER pAd)
|
|||||||
case RT_CMD_SET_RX_WCID_TABLE: /*General call for RTMPAddWcidAttributeEntry() */
|
case RT_CMD_SET_RX_WCID_TABLE: /*General call for RTMPAddWcidAttributeEntry() */
|
||||||
{
|
{
|
||||||
PMAC_TABLE_ENTRY pEntry;
|
PMAC_TABLE_ENTRY pEntry;
|
||||||
UCHAR KeyIdx = 0;
|
u8 KeyIdx = 0;
|
||||||
UCHAR CipherAlg = CIPHER_NONE;
|
u8 CipherAlg = CIPHER_NONE;
|
||||||
UCHAR ApIdx = BSS0;
|
u8 ApIdx = BSS0;
|
||||||
|
|
||||||
pEntry = (PMAC_TABLE_ENTRY) (pData);
|
pEntry = (PMAC_TABLE_ENTRY) (pData);
|
||||||
|
|
||||||
@ -1813,7 +1813,7 @@ VOID CMDHandler(IN PRTMP_ADAPTER pAd)
|
|||||||
AsicRemovePairwiseKeyEntry(pAd,
|
AsicRemovePairwiseKeyEntry(pAd,
|
||||||
pEntry->
|
pEntry->
|
||||||
apidx,
|
apidx,
|
||||||
(UCHAR)
|
(u8)
|
||||||
pEntry->
|
pEntry->
|
||||||
Aid);
|
Aid);
|
||||||
if ((pEntry->AuthMode <=
|
if ((pEntry->AuthMode <=
|
||||||
@ -1821,10 +1821,10 @@ VOID CMDHandler(IN PRTMP_ADAPTER pAd)
|
|||||||
&& (pEntry->WepStatus ==
|
&& (pEntry->WepStatus ==
|
||||||
Ndis802_11Encryption1Enabled))
|
Ndis802_11Encryption1Enabled))
|
||||||
{
|
{
|
||||||
UINT32 uIV = 1;
|
u32 uIV = 1;
|
||||||
PUCHAR ptr;
|
u8 *ptr;
|
||||||
|
|
||||||
ptr = (PUCHAR) & uIV;
|
ptr = (u8 *)& uIV;
|
||||||
*(ptr + 3) =
|
*(ptr + 3) =
|
||||||
(pAd->StaCfg.
|
(pAd->StaCfg.
|
||||||
DefaultKeyId << 6);
|
DefaultKeyId << 6);
|
||||||
@ -1844,10 +1844,10 @@ VOID CMDHandler(IN PRTMP_ADAPTER pAd)
|
|||||||
} else if (pEntry->AuthMode ==
|
} else if (pEntry->AuthMode ==
|
||||||
Ndis802_11AuthModeWPANone)
|
Ndis802_11AuthModeWPANone)
|
||||||
{
|
{
|
||||||
UINT32 uIV = 1;
|
u32 uIV = 1;
|
||||||
PUCHAR ptr;
|
u8 *ptr;
|
||||||
|
|
||||||
ptr = (PUCHAR) & uIV;
|
ptr = (u8 *)& uIV;
|
||||||
*(ptr + 3) =
|
*(ptr + 3) =
|
||||||
(pAd->StaCfg.
|
(pAd->StaCfg.
|
||||||
DefaultKeyId << 6);
|
DefaultKeyId << 6);
|
||||||
@ -1869,7 +1869,7 @@ VOID CMDHandler(IN PRTMP_ADAPTER pAd)
|
|||||||
/* Other case, disable engine. */
|
/* Other case, disable engine. */
|
||||||
/* Don't worry WPA key, we will add WPA Key after 4-Way handshaking. */
|
/* Don't worry WPA key, we will add WPA Key after 4-Way handshaking. */
|
||||||
/* */
|
/* */
|
||||||
USHORT offset;
|
u16 offset;
|
||||||
offset =
|
offset =
|
||||||
MAC_WCID_ATTRIBUTE_BASE
|
MAC_WCID_ATTRIBUTE_BASE
|
||||||
+
|
+
|
||||||
@ -1906,8 +1906,8 @@ VOID CMDHandler(IN PRTMP_ADAPTER pAd)
|
|||||||
|
|
||||||
case OID_802_11_ADD_WEP:
|
case OID_802_11_ADD_WEP:
|
||||||
{
|
{
|
||||||
UINT i;
|
u32 i;
|
||||||
UINT32 KeyIdx;
|
u32 KeyIdx;
|
||||||
PNDIS_802_11_WEP pWepKey;
|
PNDIS_802_11_WEP pWepKey;
|
||||||
|
|
||||||
DBGPRINT(RT_DEBUG_TRACE,
|
DBGPRINT(RT_DEBUG_TRACE,
|
||||||
@ -1926,10 +1926,10 @@ VOID CMDHandler(IN PRTMP_ADAPTER pAd)
|
|||||||
DBGPRINT(RT_DEBUG_ERROR,
|
DBGPRINT(RT_DEBUG_ERROR,
|
||||||
("CmdThread::OID_802_11_ADD_WEP, INVALID_DATA!!\n"));
|
("CmdThread::OID_802_11_ADD_WEP, INVALID_DATA!!\n"));
|
||||||
} else {
|
} else {
|
||||||
UCHAR CipherAlg;
|
u8 CipherAlg;
|
||||||
pAd->SharedKey[BSS0][KeyIdx].
|
pAd->SharedKey[BSS0][KeyIdx].
|
||||||
KeyLen =
|
KeyLen =
|
||||||
(UCHAR) pWepKey->KeyLength;
|
(u8)pWepKey->KeyLength;
|
||||||
NdisMoveMemory(pAd->
|
NdisMoveMemory(pAd->
|
||||||
SharedKey[BSS0]
|
SharedKey[BSS0]
|
||||||
[KeyIdx].Key,
|
[KeyIdx].Key,
|
||||||
@ -1969,14 +1969,14 @@ VOID CMDHandler(IN PRTMP_ADAPTER pAd)
|
|||||||
if (pWepKey->
|
if (pWepKey->
|
||||||
KeyIndex & 0x80000000) {
|
KeyIndex & 0x80000000) {
|
||||||
/* Default key for tx (shared key) */
|
/* Default key for tx (shared key) */
|
||||||
UCHAR IVEIV[8];
|
u8 IVEIV[8];
|
||||||
UINT32 WCIDAttri, Value;
|
u32 WCIDAttri, Value;
|
||||||
USHORT offset, offset2;
|
u16 offset, offset2;
|
||||||
NdisZeroMemory(IVEIV,
|
NdisZeroMemory(IVEIV,
|
||||||
8);
|
8);
|
||||||
pAd->StaCfg.
|
pAd->StaCfg.
|
||||||
DefaultKeyId =
|
DefaultKeyId =
|
||||||
(UCHAR) KeyIdx;
|
(u8)KeyIdx;
|
||||||
/* Add BSSID to WCTable. because this is Tx wep key. */
|
/* Add BSSID to WCTable. because this is Tx wep key. */
|
||||||
/* WCID Attribute UDF:3, BSSIdx:3, Alg:3, Keytable:1=PAIRWISE KEY, BSSIdx is 0 */
|
/* WCID Attribute UDF:3, BSSIdx:3, Alg:3, Keytable:1=PAIRWISE KEY, BSSIdx is 0 */
|
||||||
WCIDAttri =
|
WCIDAttri =
|
||||||
@ -1993,7 +1993,7 @@ VOID CMDHandler(IN PRTMP_ADAPTER pAd)
|
|||||||
WCIDAttri);
|
WCIDAttri);
|
||||||
/* 1. IV/EIV */
|
/* 1. IV/EIV */
|
||||||
/* Specify key index to find shared key. */
|
/* Specify key index to find shared key. */
|
||||||
IVEIV[3] = (UCHAR) (KeyIdx << 6); /*WEP Eiv bit off. groupkey index is not 0 */
|
IVEIV[3] = (u8)(KeyIdx << 6); /*WEP Eiv bit off. groupkey index is not 0 */
|
||||||
offset =
|
offset =
|
||||||
PAIRWISE_IVEIV_TABLE_BASE
|
PAIRWISE_IVEIV_TABLE_BASE
|
||||||
+
|
+
|
||||||
@ -2052,7 +2052,7 @@ VOID CMDHandler(IN PRTMP_ADAPTER pAd)
|
|||||||
|
|
||||||
}
|
}
|
||||||
AsicAddSharedKeyEntry(pAd, BSS0,
|
AsicAddSharedKeyEntry(pAd, BSS0,
|
||||||
(UCHAR)
|
(u8)
|
||||||
KeyIdx,
|
KeyIdx,
|
||||||
CipherAlg,
|
CipherAlg,
|
||||||
pWepKey->
|
pWepKey->
|
||||||
@ -2080,7 +2080,7 @@ VOID CMDHandler(IN PRTMP_ADAPTER pAd)
|
|||||||
|
|
||||||
case CMDTHREAD_SET_PSM_BIT:
|
case CMDTHREAD_SET_PSM_BIT:
|
||||||
{
|
{
|
||||||
USHORT *pPsm = (USHORT *) pData;
|
u16 *pPsm = (u16 *) pData;
|
||||||
MlmeSetPsmBit(pAd, *pPsm);
|
MlmeSetPsmBit(pAd, *pPsm);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -43,7 +43,7 @@
|
|||||||
/* AUTO GEN PLEASE DO NOT MODIFY IT */
|
/* AUTO GEN PLEASE DO NOT MODIFY IT */
|
||||||
|
|
||||||
|
|
||||||
UCHAR FirmwareImage_2870 [] = {
|
u8 FirmwareImage_2870 [] = {
|
||||||
0xff, 0xff, 0xff, 0x02, 0x10, 0x28, 0x02, 0x10, 0x32, 0x02, 0x10, 0x78, 0x02, 0x12, 0x67, 0x02,
|
0xff, 0xff, 0xff, 0x02, 0x10, 0x28, 0x02, 0x10, 0x32, 0x02, 0x10, 0x78, 0x02, 0x12, 0x67, 0x02,
|
||||||
0x12, 0x68, 0x02, 0x12, 0x87, 0x02, 0x12, 0x8c, 0x12, 0x12, 0x88, 0x22, 0x02, 0x16, 0x49, 0x02,
|
0x12, 0x68, 0x02, 0x12, 0x87, 0x02, 0x12, 0x8c, 0x12, 0x12, 0x88, 0x22, 0x02, 0x16, 0x49, 0x02,
|
||||||
0x17, 0x1f, 0x02, 0x13, 0x77, 0x02, 0x12, 0x8d, 0x30, 0x05, 0x06, 0x20, 0x0d, 0x03, 0x12, 0x17,
|
0x17, 0x1f, 0x02, 0x13, 0x77, 0x02, 0x12, 0x8d, 0x30, 0x05, 0x06, 0x20, 0x0d, 0x03, 0x12, 0x17,
|
||||||
|
@ -30,13 +30,13 @@
|
|||||||
|
|
||||||
/* MD4 context. */
|
/* MD4 context. */
|
||||||
typedef struct _MD4_CTX_ {
|
typedef struct _MD4_CTX_ {
|
||||||
ULONG state[4]; /* state (ABCD) */
|
unsigned long state[4]; /* state (ABCD) */
|
||||||
ULONG count[2]; /* number of bits, modulo 2^64 (lsb first) */
|
unsigned long count[2]; /* number of bits, modulo 2^64 (lsb first) */
|
||||||
UCHAR buffer[64]; /* input buffer */
|
u8 buffer[64]; /* input buffer */
|
||||||
} MD4_CTX;
|
} MD4_CTX;
|
||||||
|
|
||||||
VOID MD4Init (MD4_CTX *);
|
void MD4Init (MD4_CTX *);
|
||||||
VOID MD4Update (MD4_CTX *, PUCHAR, UINT);
|
void MD4Update (MD4_CTX *, u8 *, UINT);
|
||||||
VOID MD4Final (UCHAR [16], MD4_CTX *);
|
void MD4Final (u8 [16], MD4_CTX *);
|
||||||
|
|
||||||
#endif //__MD4_H__
|
#endif //__MD4_H__
|
@ -2,7 +2,7 @@
|
|||||||
/* AUTO GEN PLEASE DO NOT MODIFY IT */
|
/* AUTO GEN PLEASE DO NOT MODIFY IT */
|
||||||
|
|
||||||
|
|
||||||
UCHAR FirmwareImage_3090 [] = {
|
u8 FirmwareImage_3090 [] = {
|
||||||
0x02, 0x02, 0xf3, 0x02, 0x02, 0xa1, 0x22, 0x22, 0xff, 0xff, 0xff, 0x02, 0x01, 0x27, 0xff, 0xff,
|
0x02, 0x02, 0xf3, 0x02, 0x02, 0xa1, 0x22, 0x22, 0xff, 0xff, 0xff, 0x02, 0x01, 0x27, 0xff, 0xff,
|
||||||
0xff, 0xff, 0xff, 0x02, 0x00, 0x1e, 0xff, 0xff, 0xff, 0xff, 0xff, 0x02, 0x00, 0xd8, 0xc0, 0xe0,
|
0xff, 0xff, 0xff, 0x02, 0x00, 0x1e, 0xff, 0xff, 0xff, 0xff, 0xff, 0x02, 0x00, 0xd8, 0xc0, 0xe0,
|
||||||
0xc0, 0xf0, 0xc0, 0x83, 0xc0, 0x82, 0xc0, 0xd0, 0x75, 0xd0, 0x18, 0xc2, 0xaf, 0x30, 0x45, 0x03,
|
0xc0, 0xf0, 0xc0, 0x83, 0xc0, 0x82, 0xc0, 0xd0, 0x75, 0xd0, 0x18, 0xc2, 0xaf, 0x30, 0x45, 0x03,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user