1 #ifndef __WINBOND_MLME_H 2 #define __WINBOND_MLME_H 3 4 #include <linux/types.h> 5 #include <linux/spinlock.h> 6 7 #include "mac_structures.h" 8 #include "mds_s.h" 9 10 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 11 // Mlme.h 12 // Define the related definitions of MLME module 13 // history -- 01/14/03' created 14 // 15 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 16 17 #define AUTH_REJECT_REASON_CHALLENGE_FAIL 1 18 19 //====== the state of MLME module 20 #define INACTIVE 0x0 21 #define IDLE_SCAN 0x1 22 23 //====== the state of MLME/ESS module 24 #define STATE_1 0x2 25 #define AUTH_REQ 0x3 26 #define AUTH_WEP 0x4 27 #define STATE_2 0x5 28 #define ASSOC_REQ 0x6 29 #define STATE_3 0x7 30 31 //====== the state of MLME/IBSS module 32 #define IBSS_JOIN_SYNC 0x8 33 #define IBSS_AUTH_REQ 0x9 34 #define IBSS_AUTH_CHANLGE 0xa 35 #define IBSS_AUTH_WEP 0xb 36 #define IBSS_AUTH_IND 0xc 37 #define IBSS_STATE_2 0xd 38 39 40 41 //========================================= 42 //depend on D5C(MAC timing control 03 register): MaxTxMSDULifeTime default 0x80000us 43 #define AUTH_FAIL_TIMEOUT 550 44 #define ASSOC_FAIL_TIMEOUT 550 45 #define REASSOC_FAIL_TIMEOUT 550 46 47 48 49 // 50 // MLME task global CONSTANTS, STRUCTURE, variables 51 // 52 53 54 ///////////////////////////////////////////////////////////// 55 // enum_ResultCode -- 56 // Result code returned from MLME to SME. 57 // 58 ///////////////////////////////////////////////////////////// 59 // PD43 20030829 Modifiled 60 //#define SUCCESS 0 61 #define MLME_SUCCESS 0 //follow spec. 62 #define INVALID_PARAMETERS 1 //Not following spec. 63 #define NOT_SUPPPORTED 2 64 #define TIMEOUT 3 65 #define TOO_MANY_SIMULTANEOUS_REQUESTS 4 66 #define REFUSED 5 67 #define BSS_ALREADY_STARTED_OR_JOINED 6 68 #define TRANSMIT_FRAME_FAIL 7 69 #define NO_BSS_FOUND 8 70 #define RETRY 9 71 #define GIVE_UP 10 72 73 74 #define OPEN_AUTH 0 75 #define SHARE_AUTH 1 76 #define ANY_AUTH 2 77 #define WPA_AUTH 3 //for WPA 78 #define WPAPSK_AUTH 4 79 #define WPANONE_AUTH 5 80 ///////////////////////////////////////////// added by ws 04/19/04 81 #ifdef _WPA2_ 82 #define WPA2_AUTH 6//for WPA2 83 #define WPA2PSK_AUTH 7 84 #endif //end def _WPA2_ 85 86 ////////////////////////////////////////////////////////////////// 87 //define the msg type of MLME module 88 ////////////////////////////////////////////////////////////////// 89 //-------------------------------------------------------- 90 //from SME 91 92 #define MLMEMSG_AUTH_REQ 0x0b 93 #define MLMEMSG_DEAUTH_REQ 0x0c 94 #define MLMEMSG_ASSOC_REQ 0x0d 95 #define MLMEMSG_REASSOC_REQ 0x0e 96 #define MLMEMSG_DISASSOC_REQ 0x0f 97 #define MLMEMSG_START_IBSS_REQ 0x10 98 #define MLMEMSG_IBSS_NET_CFM 0x11 99 100 //from RX : 101 #define MLMEMSG_RCV_MLMEFRAME 0x20 102 #define MLMEMSG_RCV_ASSOCRSP 0x22 103 #define MLMEMSG_RCV_REASSOCRSP 0x24 104 #define MLMEMSG_RCV_DISASSOC 0x2b 105 #define MLMEMSG_RCV_AUTH 0x2c 106 #define MLMEMSG_RCV_DEAUTH 0x2d 107 108 109 //from TX callback 110 #define MLMEMSG_TX_CALLBACK 0x40 111 #define MLMEMSG_ASSOCREQ_CALLBACK 0x41 112 #define MLMEMSG_REASSOCREQ_CALLBACK 0x43 113 #define MLMEMSG_DISASSOC_CALLBACK 0x4a 114 #define MLMEMSG_AUTH_CALLBACK 0x4c 115 #define MLMEMSG_DEAUTH_CALLBACK 0x4d 116 117 //#define MLMEMSG_JOIN_FAIL 4 118 //#define MLMEMSG_AUTHEN_FAIL 18 119 #define MLMEMSG_TIMEOUT 0x50 120 121 /////////////////////////////////////////////////////////////////////////// 122 //Global data structures 123 #define MAX_NUM_TX_MMPDU 2 124 #define MAX_MMPDU_SIZE 1512 125 #define MAX_NUM_RX_MMPDU 6 126 127 128 /////////////////////////////////////////////////////////////////////////// 129 //MACRO 130 #define boMLME_InactiveState(_AA_) (_AA_->wState==INACTIVE) 131 #define boMLME_IdleScanState(_BB_) (_BB_->wState==IDLE_SCAN) 132 #define boMLME_FoundSTAinfo(_CC_) (_CC_->wState>=IDLE_SCAN) 133 134 typedef struct _MLME_FRAME 135 { 136 //NDIS_PACKET MLME_Packet; 137 s8 * pMMPDU; 138 u16 len; 139 u8 DataType; 140 u8 IsInUsed; 141 142 spinlock_t MLMESpinLock; 143 144 u8 TxMMPDU[MAX_NUM_TX_MMPDU][MAX_MMPDU_SIZE]; 145 u8 TxMMPDUInUse[ (MAX_NUM_TX_MMPDU+3) & ~0x03 ]; 146 147 u16 wNumTxMMPDU; 148 u16 wNumTxMMPDUDiscarded; 149 150 u8 RxMMPDU[MAX_NUM_RX_MMPDU][MAX_MMPDU_SIZE]; 151 u8 SaveRxBufSlotInUse[ (MAX_NUM_RX_MMPDU+3) & ~0x03 ]; 152 153 u16 wNumRxMMPDU; 154 u16 wNumRxMMPDUDiscarded; 155 156 u16 wNumRxMMPDUInMLME; // Number of the Rx MMPDU 157 u16 reserved_1; // in MLME. 158 // excluding the discarded 159 } MLME_FRAME, *psMLME_FRAME; 160 161 typedef struct _AUTHREQ { 162 163 u8 peerMACaddr[MAC_ADDR_LENGTH]; 164 u16 wAuthAlgorithm; 165 166 } MLME_AUTHREQ_PARA, *psMLME_AUTHREQ_PARA; 167 168 struct _Reason_Code { 169 170 u8 peerMACaddr[MAC_ADDR_LENGTH]; 171 u16 wReasonCode; 172 }; 173 typedef struct _Reason_Code MLME_DEAUTHREQ_PARA, *psMLME_DEAUTHREQ_PARA; 174 typedef struct _Reason_Code MLME_DISASSOCREQ_PARA, *psMLME_DISASSOCREQ_PARA; 175 176 typedef struct _ASSOCREQ { 177 u8 PeerSTAAddr[MAC_ADDR_LENGTH]; 178 u16 CapabilityInfo; 179 u16 ListenInterval; 180 181 }__attribute__ ((packed)) MLME_ASSOCREQ_PARA, *psMLME_ASSOCREQ_PARA; 182 183 typedef struct _REASSOCREQ { 184 u8 NewAPAddr[MAC_ADDR_LENGTH]; 185 u16 CapabilityInfo; 186 u16 ListenInterval; 187 188 }__attribute__ ((packed)) MLME_REASSOCREQ_PARA, *psMLME_REASSOCREQ_PARA; 189 190 typedef struct _MLMECALLBACK { 191 192 u8 *psFramePtr; 193 u8 bResult; 194 195 } MLME_TXCALLBACK, *psMLME_TXCALLBACK; 196 197 typedef struct _RXDATA 198 { 199 s32 FrameLength; 200 u8 __attribute__ ((packed)) *pbFramePtr; 201 202 }__attribute__ ((packed)) RXDATA, *psRXDATA; 203 204 #endif 205