00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #if WIRELESS_EXT <= 11
00018 #ifndef SIOCDEVPRIVATE
00019 #define SIOCDEVPRIVATE 0x8BE0
00020 #endif
00021 #define SIOCIWFIRSTPRIV SIOCDEVPRIVATE
00022 #endif
00023
00024 #define RT_PRIV_IOCTL (SIOCIWFIRSTPRIV + 0x0E)
00025 #define RTPRIV_IOCTL_SET (SIOCIWFIRSTPRIV + 0x02)
00026
00027
00028
00029
00030 #define OID_GET_SET_TOGGLE 0x8000
00031
00032 #define OID_802_11_ADD_WEP 0x0112
00033 #define OID_802_11_REMOVE_WEP 0x0113
00034 #define OID_802_11_DISASSOCIATE 0x0114
00035 #define OID_802_11_PRIVACY_FILTER 0x0118
00036 #define OID_802_11_ASSOCIATION_INFORMATION 0x011E
00037 #define OID_802_11_BSSID_LIST_SCAN 0x0508
00038 #define OID_802_11_SSID 0x0509
00039 #define OID_802_11_BSSID 0x050A
00040 #define OID_802_11_WEP_STATUS 0x0510
00041 #define OID_802_11_AUTHENTICATION_MODE 0x0511
00042 #define OID_802_11_INFRASTRUCTURE_MODE 0x0512
00043 #define OID_802_11_TX_POWER_LEVEL 0x0517
00044 #define OID_802_11_REMOVE_KEY 0x0519
00045 #define OID_802_11_ADD_KEY 0x0520
00046 #define OID_802_11_DEAUTHENTICATION 0x0526
00047 #define OID_802_11_DROP_UNENCRYPTED 0x0527
00048 #define OID_802_11_BSSID_LIST 0x0609
00049 #define OID_802_3_CURRENT_ADDRESS 0x060A
00050 #define OID_SET_COUNTERMEASURES 0x0616
00051 #define OID_802_11_SET_IEEE8021X 0x0617 // For IEEE8021x mode
00052 #define OID_802_11_SET_IEEE8021X_REQUIRE_KEY 0x0618 // For DynamicWEP in IEEE802.1x mode
00053 #define OID_802_11_PMKID 0x0620
00054 #define RT_OID_WPA_SUPPLICANT_SUPPORT 0x0621 // for trigger driver enable/disable wpa_supplicant support
00055 #define RT_OID_WE_VERSION_COMPILED 0x0622
00056 #define RT_OID_NEW_DRIVER 0x0623
00057 #define RT_OID_WPS_PROBE_REQ_IE 0x0625
00058
00059 #define PACKED __attribute__ ((packed))
00060
00061
00062 #define RT_ASSOC_EVENT_FLAG 0x0101
00063 #define RT_DISASSOC_EVENT_FLAG 0x0102
00064 #define RT_REQIE_EVENT_FLAG 0x0103
00065 #define RT_RESPIE_EVENT_FLAG 0x0104
00066 #define RT_ASSOCINFO_EVENT_FLAG 0x0105
00067 #define RT_PMKIDCAND_FLAG 0x0106
00068 #define RT_INTERFACE_DOWN 0x0107
00069 #define RT_INTERFACE_UP 0x0108
00070
00071
00072
00073
00074
00075
00076 #ifndef ULONG
00077 #define CHAR char
00078 #define INT int
00079 #define SHORT int
00080 #define UINT u32
00081 #undef ULONG
00082
00083 #define ULONG unsigned long
00084 #define USHORT unsigned short
00085 #define UCHAR unsigned char
00086
00087 #define uint32 u32
00088 #define uint8 u8
00089
00090
00091 #define BOOLEAN u8
00092
00093 #define VOID void
00094 #define LONG long
00095 #define LONGLONG s64
00096 #define ULONGLONG u64
00097 typedef VOID *PVOID;
00098 typedef CHAR *PCHAR;
00099 typedef UCHAR *PUCHAR;
00100 typedef USHORT *PUSHORT;
00101 typedef LONG *PLONG;
00102 typedef ULONG *PULONG;
00103
00104 typedef union _LARGE_INTEGER {
00105 struct {
00106 ULONG LowPart;
00107 LONG HighPart;
00108 }vv;
00109 struct {
00110 ULONG LowPart;
00111 LONG HighPart;
00112 } u;
00113 s64 QuadPart;
00114 } LARGE_INTEGER;
00115
00116 #endif
00117
00118 #define NDIS_802_11_LENGTH_SSID 32
00119 #define NDIS_802_11_LENGTH_RATES 8
00120 #define NDIS_802_11_LENGTH_RATES_EX 16
00121 #define MAX_LEN_OF_SSID 32
00122 #define MAC_ADDR_LEN 6
00123
00124 typedef UCHAR NDIS_802_11_MAC_ADDRESS[6];
00125
00126
00127 #define NDIS_802_11_AUTH_REQUEST_AUTH_FIELDS 0x0f
00128
00129 #define NDIS_802_11_AUTH_REQUEST_REAUTH 0x01
00130 #define NDIS_802_11_AUTH_REQUEST_KEYUPDATE 0x02
00131 #define NDIS_802_11_AUTH_REQUEST_PAIRWISE_ERROR 0x06
00132 #define NDIS_802_11_AUTH_REQUEST_GROUP_ERROR 0x0E
00133
00134
00135 typedef enum _NDIS_802_11_NETWORK_TYPE
00136 {
00137 Ndis802_11FH,
00138 Ndis802_11DS,
00139 Ndis802_11OFDM5,
00140 Ndis802_11OFDM24,
00141 Ndis802_11Automode,
00142 Ndis802_11NetworkTypeMax
00143 } NDIS_802_11_NETWORK_TYPE, *PNDIS_802_11_NETWORK_TYPE;
00144
00145
00146
00147
00148 typedef LONG NDIS_802_11_RSSI;
00149
00150 typedef struct _NDIS_802_11_CONFIGURATION_FH
00151 {
00152 ULONG Length;
00153 ULONG HopPattern;
00154 ULONG HopSet;
00155 ULONG DwellTime;
00156 } NDIS_802_11_CONFIGURATION_FH, *PNDIS_802_11_CONFIGURATION_FH;
00157
00158 typedef struct _NDIS_802_11_CONFIGURATION
00159 {
00160 ULONG Length;
00161 ULONG BeaconPeriod;
00162 ULONG ATIMWindow;
00163 ULONG DSConfig;
00164 NDIS_802_11_CONFIGURATION_FH FHConfig;
00165 } NDIS_802_11_CONFIGURATION, *PNDIS_802_11_CONFIGURATION;
00166
00167 typedef ULONG NDIS_802_11_KEY_INDEX;
00168 typedef ULONGLONG NDIS_802_11_KEY_RSC;
00169
00170
00171 typedef struct _NDIS_802_11_KEY
00172 {
00173 UINT Length;
00174 UINT KeyIndex;
00175 UINT KeyLength;
00176 NDIS_802_11_MAC_ADDRESS BSSID;
00177 NDIS_802_11_KEY_RSC KeyRSC;
00178 UCHAR KeyMaterial[1];
00179 } NDIS_802_11_KEY, *PNDIS_802_11_KEY;
00180
00181 typedef struct _NDIS_802_11_REMOVE_KEY
00182 {
00183 UINT Length;
00184 UINT KeyIndex;
00185 NDIS_802_11_MAC_ADDRESS BSSID;
00186 } NDIS_802_11_REMOVE_KEY, *PNDIS_802_11_REMOVE_KEY;
00187
00188 typedef struct PACKED _NDIS_802_11_WEP
00189 {
00190 UINT Length;
00191 UINT KeyIndex;
00192
00193 UINT KeyLength;
00194 UCHAR KeyMaterial[1];
00195 } NDIS_802_11_WEP, *PNDIS_802_11_WEP;
00196
00197
00198 typedef enum _NDIS_802_11_NETWORK_INFRASTRUCTURE
00199 {
00200 Ndis802_11IBSS,
00201 Ndis802_11Infrastructure,
00202 Ndis802_11AutoUnknown,
00203 Ndis802_11InfrastructureMax
00204 } NDIS_802_11_NETWORK_INFRASTRUCTURE, *PNDIS_802_11_NETWORK_INFRASTRUCTURE;
00205
00206
00207 typedef UCHAR NDIS_802_11_PMKID_VALUE[16];
00208
00209 typedef struct _BSSID_INFO
00210 {
00211 NDIS_802_11_MAC_ADDRESS BSSID;
00212 NDIS_802_11_PMKID_VALUE PMKID;
00213 } BSSID_INFO, *PBSSID_INFO;
00214
00215 typedef struct _NDIS_802_11_PMKID
00216 {
00217 ULONG Length;
00218 ULONG BSSIDInfoCount;
00219 BSSID_INFO BSSIDInfo[1];
00220 } NDIS_802_11_PMKID, *PNDIS_802_11_PMKID;
00221
00222
00223 typedef struct _PMKID_CANDIDATE {
00224 NDIS_802_11_MAC_ADDRESS BSSID;
00225 ULONG Flags;
00226 } PMKID_CANDIDATE, *PPMKID_CANDIDATE;
00227
00228 typedef struct _NDIS_802_11_PMKID_CANDIDATE_LIST
00229 {
00230 ULONG Version;
00231 ULONG NumCandidates;
00232 PMKID_CANDIDATE CandidateList[1];
00233 } NDIS_802_11_PMKID_CANDIDATE_LIST, *PNDIS_802_11_PMKID_CANDIDATE_LIST;
00234
00235
00236 #define NDIS_802_11_PMKID_CANDIDATE_PREAUTH_ENABLED 0x01
00237
00238
00239 typedef enum _NDIS_802_11_AUTHENTICATION_MODE
00240 {
00241 Ndis802_11AuthModeOpen,
00242 Ndis802_11AuthModeShared,
00243 Ndis802_11AuthModeAutoSwitch,
00244 Ndis802_11AuthModeWPA,
00245 Ndis802_11AuthModeWPAPSK,
00246 Ndis802_11AuthModeWPANone,
00247 Ndis802_11AuthModeWPA2,
00248 Ndis802_11AuthModeWPA2PSK,
00249 Ndis802_11AuthModeMax
00250 } NDIS_802_11_AUTHENTICATION_MODE, *PNDIS_802_11_AUTHENTICATION_MODE;
00251
00252 typedef UCHAR NDIS_802_11_RATES[NDIS_802_11_LENGTH_RATES];
00253 typedef UCHAR NDIS_802_11_RATES_EX[NDIS_802_11_LENGTH_RATES_EX];
00254
00255 typedef struct PACKED _NDIS_802_11_SSID
00256 {
00257 INT SsidLength;
00258
00259 UCHAR Ssid[NDIS_802_11_LENGTH_SSID];
00260 } NDIS_802_11_SSID, *PNDIS_802_11_SSID;
00261
00262
00263 typedef struct PACKED _NDIS_WLAN_BSSID
00264 {
00265 ULONG Length;
00266 NDIS_802_11_MAC_ADDRESS MacAddress;
00267 UCHAR Reserved[2];
00268 NDIS_802_11_SSID Ssid;
00269 ULONG Privacy;
00270 NDIS_802_11_RSSI Rssi;
00271
00272 NDIS_802_11_NETWORK_TYPE NetworkTypeInUse;
00273 NDIS_802_11_CONFIGURATION Configuration;
00274 NDIS_802_11_NETWORK_INFRASTRUCTURE InfrastructureMode;
00275 NDIS_802_11_RATES SupportedRates;
00276 } NDIS_WLAN_BSSID, *PNDIS_WLAN_BSSID;
00277
00278 typedef struct PACKED _NDIS_802_11_BSSID_LIST
00279 {
00280 UINT NumberOfItems;
00281 NDIS_WLAN_BSSID Bssid[1];
00282 } NDIS_802_11_BSSID_LIST, *PNDIS_802_11_BSSID_LIST;
00283
00284
00285 typedef struct PACKED _NDIS_WLAN_BSSID_EX
00286 {
00287 ULONG Length;
00288 NDIS_802_11_MAC_ADDRESS MacAddress;
00289 UCHAR Reserved[2];
00290 NDIS_802_11_SSID Ssid;
00291 UINT Privacy;
00292 NDIS_802_11_RSSI Rssi;
00293
00294 NDIS_802_11_NETWORK_TYPE NetworkTypeInUse;
00295 NDIS_802_11_CONFIGURATION Configuration;
00296 NDIS_802_11_NETWORK_INFRASTRUCTURE InfrastructureMode;
00297 NDIS_802_11_RATES_EX SupportedRates;
00298 ULONG IELength;
00299 UCHAR IEs[1];
00300 } NDIS_WLAN_BSSID_EX, *PNDIS_WLAN_BSSID_EX;
00301
00302 typedef struct PACKED _NDIS_802_11_BSSID_LIST_EX
00303 {
00304 UINT NumberOfItems;
00305 NDIS_WLAN_BSSID_EX Bssid[1];
00306 } NDIS_802_11_BSSID_LIST_EX, *PNDIS_802_11_BSSID_LIST_EX;
00307
00308 typedef struct PACKED _NDIS_802_11_FIXED_IEs
00309 {
00310 UCHAR Timestamp[8];
00311 USHORT BeaconInterval;
00312 USHORT Capabilities;
00313 } NDIS_802_11_FIXED_IEs, *PNDIS_802_11_FIXED_IEs;
00314
00315
00316
00317 typedef enum _NDIS_802_11_WEP_STATUS
00318 {
00319 Ndis802_11WEPEnabled,
00320 Ndis802_11Encryption1Enabled = Ndis802_11WEPEnabled,
00321 Ndis802_11WEPDisabled,
00322 Ndis802_11EncryptionDisabled = Ndis802_11WEPDisabled,
00323 Ndis802_11WEPKeyAbsent,
00324 Ndis802_11Encryption1KeyAbsent = Ndis802_11WEPKeyAbsent,
00325 Ndis802_11WEPNotSupported,
00326 Ndis802_11EncryptionNotSupported = Ndis802_11WEPNotSupported,
00327 Ndis802_11Encryption2Enabled,
00328 Ndis802_11Encryption2KeyAbsent,
00329 Ndis802_11Encryption3Enabled,
00330 Ndis802_11Encryption3KeyAbsent
00331 } NDIS_802_11_WEP_STATUS, *PNDIS_802_11_WEP_STATUS,
00332 NDIS_802_11_ENCRYPTION_STATUS, *PNDIS_802_11_ENCRYPTION_STATUS;
00333
00334 typedef enum _NDIS_802_11_RELOAD_DEFAULTS
00335 {
00336 Ndis802_11ReloadWEPKeys
00337 } NDIS_802_11_RELOAD_DEFAULTS, *PNDIS_802_11_RELOAD_DEFAULTS;
00338
00339 #define NDIS_802_11_AI_REQFI_CAPABILITIES 1
00340 #define NDIS_802_11_AI_REQFI_LISTENINTERVAL 2
00341 #define NDIS_802_11_AI_REQFI_CURRENTAPADDRESS 4
00342
00343 #define NDIS_802_11_AI_RESFI_CAPABILITIES 1
00344 #define NDIS_802_11_AI_RESFI_STATUSCODE 2
00345 #define NDIS_802_11_AI_RESFI_ASSOCIATIONID 4
00346
00347 typedef struct _NDIS_802_11_AI_REQFI
00348 {
00349 USHORT Capabilities;
00350 USHORT ListenInterval;
00351 NDIS_802_11_MAC_ADDRESS CurrentAPAddress;
00352 } NDIS_802_11_AI_REQFI, *PNDIS_802_11_AI_REQFI;
00353
00354 typedef struct _NDIS_802_11_AI_RESFI
00355 {
00356 USHORT Capabilities;
00357 USHORT StatusCode;
00358 USHORT AssociationId;
00359 } NDIS_802_11_AI_RESFI, *PNDIS_802_11_AI_RESFI;
00360
00361 typedef struct _NDIS_802_11_ASSOCIATION_INFORMATION
00362 {
00363 ULONG Length;
00364 USHORT AvailableRequestFixedIEs;
00365 NDIS_802_11_AI_REQFI RequestFixedIEs;
00366 ULONG RequestIELength;
00367 ULONG OffsetRequestIEs;
00368 USHORT AvailableResponseFixedIEs;
00369 NDIS_802_11_AI_RESFI ResponseFixedIEs;
00370 ULONG ResponseIELength;
00371 ULONG OffsetResponseIEs;
00372 } NDIS_802_11_ASSOCIATION_INFORMATION, *PNDIS_802_11_ASSOCIATION_INFORMATION;
00373
00374 struct ndis_pmkid_entry {
00375 struct ndis_pmkid_entry *next;
00376 u8 bssid[ETH_ALEN];
00377 u8 pmkid[16];
00378 };
00379
00380 typedef struct _MLME_DEAUTH_REQ_STRUCT {
00381 UCHAR Addr[MAC_ADDR_LEN];
00382 USHORT Reason;
00383 } MLME_DEAUTH_REQ_STRUCT, *PMLME_DEAUTH_REQ_STRUCT;