rtw_mlme_ext.h 34 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996
  1. /******************************************************************************
  2. *
  3. * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
  4. *
  5. * This program is free software; you can redistribute it and/or modify it
  6. * under the terms of version 2 of the GNU General Public License as
  7. * published by the Free Software Foundation.
  8. *
  9. * This program is distributed in the hope that it will be useful, but WITHOUT
  10. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11. * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
  12. * more details.
  13. *
  14. * You should have received a copy of the GNU General Public License along with
  15. * this program; if not, write to the Free Software Foundation, Inc.,
  16. * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
  17. *
  18. *
  19. ******************************************************************************/
  20. #ifndef __RTW_MLME_EXT_H_
  21. #define __RTW_MLME_EXT_H_
  22. // Commented by Albert 20101105
  23. // Increase the SURVEY_TO value from 100 to 150 ( 100ms to 150ms )
  24. // The Realtek 8188CE SoftAP will spend around 100ms to send the probe response after receiving the probe request.
  25. // So, this driver tried to extend the dwell time for each scanning channel.
  26. // This will increase the chance to receive the probe response from SoftAP.
  27. #define SURVEY_TO (100)
  28. #define REAUTH_TO (300) //(50)
  29. #define REASSOC_TO (300) //(50)
  30. //#define DISCONNECT_TO (3000)
  31. #define ADDBA_TO (2000)
  32. #define LINKED_TO (1) //unit:2 sec, 1x2=2 sec
  33. #define REAUTH_LIMIT (4)
  34. #define REASSOC_LIMIT (4)
  35. #define READDBA_LIMIT (2)
  36. #ifdef CONFIG_GSPI_HCI
  37. #define ROAMING_LIMIT 5
  38. #else
  39. #define ROAMING_LIMIT 8
  40. #endif
  41. //#define IOCMD_REG0 0x10250370
  42. //#define IOCMD_REG1 0x10250374
  43. //#define IOCMD_REG2 0x10250378
  44. //#define FW_DYNAMIC_FUN_SWITCH 0x10250364
  45. //#define WRITE_BB_CMD 0xF0000001
  46. //#define SET_CHANNEL_CMD 0xF3000000
  47. //#define UPDATE_RA_CMD 0xFD0000A2
  48. #define DYNAMIC_FUNC_DISABLE (0x0)
  49. // ====== ODM_ABILITY_E ========
  50. // BB ODM section BIT 0-15
  51. #define DYNAMIC_BB_DIG BIT(0)
  52. #define DYNAMIC_BB_RA_MASK BIT(1)
  53. #define DYNAMIC_BB_DYNAMIC_TXPWR BIT(2)
  54. #define DYNAMIC_BB_BB_FA_CNT BIT(3)
  55. #define DYNAMIC_BB_RSSI_MONITOR BIT(4)
  56. #define DYNAMIC_BB_CCK_PD BIT(5)
  57. #define DYNAMIC_BB_ANT_DIV BIT(6)
  58. #define DYNAMIC_BB_PWR_SAVE BIT(7)
  59. #define DYNAMIC_BB_PWR_TRAIN BIT(8)
  60. #define DYNAMIC_BB_RATE_ADAPTIVE BIT(9)
  61. #define DYNAMIC_BB_PATH_DIV BIT(10)
  62. #define DYNAMIC_BB_PSD BIT(11)
  63. // MAC DM section BIT 16-23
  64. #define DYNAMIC_MAC_EDCA_TURBO BIT(16)
  65. #define DYNAMIC_MAC_EARLY_MODE BIT(17)
  66. // RF ODM section BIT 24-31
  67. #define DYNAMIC_RF_TX_PWR_TRACK BIT(24)
  68. #define DYNAMIC_RF_RX_GAIN_TRACK BIT(25)
  69. #define DYNAMIC_RF_CALIBRATION BIT(26)
  70. #define DYNAMIC_ALL_FUNC_ENABLE 0xFFFFFFF
  71. #define _HW_STATE_NOLINK_ 0x00
  72. #define _HW_STATE_ADHOC_ 0x01
  73. #define _HW_STATE_STATION_ 0x02
  74. #define _HW_STATE_AP_ 0x03
  75. #define _1M_RATE_ 0
  76. #define _2M_RATE_ 1
  77. #define _5M_RATE_ 2
  78. #define _11M_RATE_ 3
  79. #define _6M_RATE_ 4
  80. #define _9M_RATE_ 5
  81. #define _12M_RATE_ 6
  82. #define _18M_RATE_ 7
  83. #define _24M_RATE_ 8
  84. #define _36M_RATE_ 9
  85. #define _48M_RATE_ 10
  86. #define _54M_RATE_ 11
  87. extern unsigned char RTW_WPA_OUI[];
  88. extern unsigned char WMM_OUI[];
  89. extern unsigned char WPS_OUI[];
  90. extern unsigned char WFD_OUI[];
  91. extern unsigned char P2P_OUI[];
  92. extern unsigned char WMM_INFO_OUI[];
  93. extern unsigned char WMM_PARA_OUI[];
  94. //
  95. // Channel Plan Type.
  96. // Note:
  97. // We just add new channel plan when the new channel plan is different from any of the following
  98. // channel plan.
  99. // If you just wnat to customize the acitions(scan period or join actions) about one of the channel plan,
  100. // customize them in RT_CHANNEL_INFO in the RT_CHANNEL_LIST.
  101. //
  102. typedef enum _RT_CHANNEL_DOMAIN
  103. {
  104. //===== old channel plan mapping =====//
  105. RT_CHANNEL_DOMAIN_FCC = 0x00,
  106. RT_CHANNEL_DOMAIN_IC = 0x01,
  107. RT_CHANNEL_DOMAIN_ETSI = 0x02,
  108. RT_CHANNEL_DOMAIN_SPAIN = 0x03,
  109. RT_CHANNEL_DOMAIN_FRANCE = 0x04,
  110. RT_CHANNEL_DOMAIN_MKK = 0x05,
  111. RT_CHANNEL_DOMAIN_MKK1 = 0x06,
  112. RT_CHANNEL_DOMAIN_ISRAEL = 0x07,
  113. RT_CHANNEL_DOMAIN_TELEC = 0x08,
  114. RT_CHANNEL_DOMAIN_GLOBAL_DOAMIN = 0x09,
  115. RT_CHANNEL_DOMAIN_WORLD_WIDE_13 = 0x0A,
  116. RT_CHANNEL_DOMAIN_TAIWAN = 0x0B,
  117. RT_CHANNEL_DOMAIN_CHINA = 0x0C,
  118. RT_CHANNEL_DOMAIN_SINGAPORE_INDIA_MEXICO = 0x0D,
  119. RT_CHANNEL_DOMAIN_KOREA = 0x0E,
  120. RT_CHANNEL_DOMAIN_TURKEY = 0x0F,
  121. RT_CHANNEL_DOMAIN_JAPAN = 0x10,
  122. RT_CHANNEL_DOMAIN_FCC_NO_DFS = 0x11,
  123. RT_CHANNEL_DOMAIN_JAPAN_NO_DFS = 0x12,
  124. RT_CHANNEL_DOMAIN_WORLD_WIDE_5G = 0x13,
  125. RT_CHANNEL_DOMAIN_TAIWAN_NO_DFS = 0x14,
  126. //===== new channel plan mapping, (2GDOMAIN_5GDOMAIN) =====//
  127. RT_CHANNEL_DOMAIN_WORLD_NULL = 0x20,
  128. RT_CHANNEL_DOMAIN_ETSI1_NULL = 0x21,
  129. RT_CHANNEL_DOMAIN_FCC1_NULL = 0x22,
  130. RT_CHANNEL_DOMAIN_MKK1_NULL = 0x23,
  131. RT_CHANNEL_DOMAIN_ETSI2_NULL = 0x24,
  132. RT_CHANNEL_DOMAIN_FCC1_FCC1 = 0x25,
  133. RT_CHANNEL_DOMAIN_WORLD_ETSI1 = 0x26,
  134. RT_CHANNEL_DOMAIN_MKK1_MKK1 = 0x27,
  135. RT_CHANNEL_DOMAIN_WORLD_KCC1 = 0x28,
  136. RT_CHANNEL_DOMAIN_WORLD_FCC2 = 0x29,
  137. RT_CHANNEL_DOMAIN_WORLD_FCC3 = 0x30,
  138. RT_CHANNEL_DOMAIN_WORLD_FCC4 = 0x31,
  139. RT_CHANNEL_DOMAIN_WORLD_FCC5 = 0x32,
  140. RT_CHANNEL_DOMAIN_WORLD_FCC6 = 0x33,
  141. RT_CHANNEL_DOMAIN_FCC1_FCC7 = 0x34,
  142. RT_CHANNEL_DOMAIN_WORLD_ETSI2 = 0x35,
  143. RT_CHANNEL_DOMAIN_WORLD_ETSI3 = 0x36,
  144. RT_CHANNEL_DOMAIN_MKK1_MKK2 = 0x37,
  145. RT_CHANNEL_DOMAIN_MKK1_MKK3 = 0x38,
  146. RT_CHANNEL_DOMAIN_FCC1_NCC1 = 0x39,
  147. RT_CHANNEL_DOMAIN_FCC1_NCC2 = 0x40,
  148. RT_CHANNEL_DOMAIN_GLOBAL_DOAMIN_2G = 0x41,
  149. //===== Add new channel plan above this line===============//
  150. RT_CHANNEL_DOMAIN_MAX,
  151. RT_CHANNEL_DOMAIN_REALTEK_DEFINE = 0x7F,
  152. }RT_CHANNEL_DOMAIN, *PRT_CHANNEL_DOMAIN;
  153. typedef enum _RT_CHANNEL_DOMAIN_2G
  154. {
  155. RT_CHANNEL_DOMAIN_2G_WORLD = 0x00, //Worldwird 13
  156. RT_CHANNEL_DOMAIN_2G_ETSI1 = 0x01, //Europe
  157. RT_CHANNEL_DOMAIN_2G_FCC1 = 0x02, //US
  158. RT_CHANNEL_DOMAIN_2G_MKK1 = 0x03, //Japan
  159. RT_CHANNEL_DOMAIN_2G_ETSI2 = 0x04, //France
  160. RT_CHANNEL_DOMAIN_2G_NULL = 0x05,
  161. //===== Add new channel plan above this line===============//
  162. RT_CHANNEL_DOMAIN_2G_MAX,
  163. }RT_CHANNEL_DOMAIN_2G, *PRT_CHANNEL_DOMAIN_2G;
  164. typedef enum _RT_CHANNEL_DOMAIN_5G
  165. {
  166. RT_CHANNEL_DOMAIN_5G_NULL = 0x00,
  167. RT_CHANNEL_DOMAIN_5G_ETSI1 = 0x01, //Europe
  168. RT_CHANNEL_DOMAIN_5G_ETSI2 = 0x02, //Australia, New Zealand
  169. RT_CHANNEL_DOMAIN_5G_ETSI3 = 0x03, //Russia
  170. RT_CHANNEL_DOMAIN_5G_FCC1 = 0x04, //US
  171. RT_CHANNEL_DOMAIN_5G_FCC2 = 0x05, //FCC o/w DFS Channels
  172. RT_CHANNEL_DOMAIN_5G_FCC3 = 0x06, //India, Mexico
  173. RT_CHANNEL_DOMAIN_5G_FCC4 = 0x07, //Venezuela
  174. RT_CHANNEL_DOMAIN_5G_FCC5 = 0x08, //China
  175. RT_CHANNEL_DOMAIN_5G_FCC6 = 0x09, //Israel
  176. RT_CHANNEL_DOMAIN_5G_FCC7_IC1 = 0x0A, //US, Canada
  177. RT_CHANNEL_DOMAIN_5G_KCC1 = 0x0B, //Korea
  178. RT_CHANNEL_DOMAIN_5G_MKK1 = 0x0C, //Japan
  179. RT_CHANNEL_DOMAIN_5G_MKK2 = 0x0D, //Japan (W52, W53)
  180. RT_CHANNEL_DOMAIN_5G_MKK3 = 0x0E, //Japan (W56)
  181. RT_CHANNEL_DOMAIN_5G_NCC1 = 0x0F, //Taiwan
  182. RT_CHANNEL_DOMAIN_5G_NCC2 = 0x10, //Taiwan o/w DFS
  183. //===== Add new channel plan above this line===============//
  184. //===== Driver Self Defined =====//
  185. RT_CHANNEL_DOMAIN_5G_FCC = 0x11,
  186. RT_CHANNEL_DOMAIN_5G_JAPAN_NO_DFS = 0x12,
  187. RT_CHANNEL_DOMAIN_5G_FCC4_NO_DFS = 0x13,
  188. RT_CHANNEL_DOMAIN_5G_MAX,
  189. }RT_CHANNEL_DOMAIN_5G, *PRT_CHANNEL_DOMAIN_5G;
  190. #define rtw_is_channel_plan_valid(chplan) (chplan<RT_CHANNEL_DOMAIN_MAX || chplan == RT_CHANNEL_DOMAIN_REALTEK_DEFINE)
  191. typedef struct _RT_CHANNEL_PLAN
  192. {
  193. unsigned char Channel[MAX_CHANNEL_NUM];
  194. unsigned char Len;
  195. }RT_CHANNEL_PLAN, *PRT_CHANNEL_PLAN;
  196. typedef struct _RT_CHANNEL_PLAN_2G
  197. {
  198. unsigned char Channel[MAX_CHANNEL_NUM_2G];
  199. unsigned char Len;
  200. }RT_CHANNEL_PLAN_2G, *PRT_CHANNEL_PLAN_2G;
  201. typedef struct _RT_CHANNEL_PLAN_5G
  202. {
  203. unsigned char Channel[MAX_CHANNEL_NUM_5G];
  204. unsigned char Len;
  205. }RT_CHANNEL_PLAN_5G, *PRT_CHANNEL_PLAN_5G;
  206. typedef struct _RT_CHANNEL_PLAN_MAP
  207. {
  208. unsigned char Index2G;
  209. unsigned char Index5G;
  210. }RT_CHANNEL_PLAN_MAP, *PRT_CHANNEL_PLAN_MAP;
  211. enum Associated_AP
  212. {
  213. atherosAP = 0,
  214. broadcomAP = 1,
  215. ciscoAP = 2,
  216. marvellAP = 3,
  217. ralinkAP = 4,
  218. realtekAP = 5,
  219. airgocapAP = 6,
  220. unknownAP = 7,
  221. maxAP,
  222. };
  223. typedef enum _HT_IOT_PEER
  224. {
  225. HT_IOT_PEER_UNKNOWN = 0,
  226. HT_IOT_PEER_REALTEK = 1,
  227. HT_IOT_PEER_REALTEK_92SE = 2,
  228. HT_IOT_PEER_BROADCOM = 3,
  229. HT_IOT_PEER_RALINK = 4,
  230. HT_IOT_PEER_ATHEROS = 5,
  231. HT_IOT_PEER_CISCO = 6,
  232. HT_IOT_PEER_MERU = 7,
  233. HT_IOT_PEER_MARVELL = 8,
  234. HT_IOT_PEER_REALTEK_SOFTAP = 9,// peer is RealTek SOFT_AP, by Bohn, 2009.12.17
  235. HT_IOT_PEER_SELF_SOFTAP = 10, // Self is SoftAP
  236. HT_IOT_PEER_AIRGO = 11,
  237. HT_IOT_PEER_INTEL = 12,
  238. HT_IOT_PEER_RTK_APCLIENT = 13,
  239. HT_IOT_PEER_REALTEK_81XX = 14,
  240. HT_IOT_PEER_REALTEK_WOW = 15,
  241. HT_IOT_PEER_REALTEK_JAGUAR_BCUTAP = 16,
  242. HT_IOT_PEER_REALTEK_JAGUAR_CCUTAP = 17,
  243. HT_IOT_PEER_MAX = 18
  244. }HT_IOT_PEER_E, *PHTIOT_PEER_E;
  245. enum SCAN_STATE
  246. {
  247. SCAN_DISABLE = 0,
  248. SCAN_START = 1,
  249. SCAN_TXNULL = 2,
  250. SCAN_PROCESS = 3,
  251. SCAN_COMPLETE = 4,
  252. SCAN_STATE_MAX,
  253. };
  254. struct mlme_handler {
  255. unsigned int num;
  256. char* str;
  257. unsigned int (*func)(_adapter *padapter, union recv_frame *precv_frame);
  258. };
  259. struct action_handler {
  260. unsigned int num;
  261. char* str;
  262. unsigned int (*func)(_adapter *padapter, union recv_frame *precv_frame);
  263. };
  264. struct ss_res
  265. {
  266. int state;
  267. int bss_cnt;
  268. int channel_idx;
  269. int scan_mode;
  270. u8 ssid_num;
  271. u8 ch_num;
  272. NDIS_802_11_SSID ssid[RTW_SSID_SCAN_AMOUNT];
  273. struct rtw_ieee80211_channel ch[RTW_CHANNEL_SCAN_AMOUNT];
  274. };
  275. //#define AP_MODE 0x0C
  276. //#define STATION_MODE 0x08
  277. //#define AD_HOC_MODE 0x04
  278. //#define NO_LINK_MODE 0x00
  279. #define WIFI_FW_NULL_STATE _HW_STATE_NOLINK_
  280. #define WIFI_FW_STATION_STATE _HW_STATE_STATION_
  281. #define WIFI_FW_AP_STATE _HW_STATE_AP_
  282. #define WIFI_FW_ADHOC_STATE _HW_STATE_ADHOC_
  283. #define WIFI_FW_AUTH_NULL 0x00000100
  284. #define WIFI_FW_AUTH_STATE 0x00000200
  285. #define WIFI_FW_AUTH_SUCCESS 0x00000400
  286. #define WIFI_FW_ASSOC_STATE 0x00002000
  287. #define WIFI_FW_ASSOC_SUCCESS 0x00004000
  288. #define WIFI_FW_LINKING_STATE (WIFI_FW_AUTH_NULL | WIFI_FW_AUTH_STATE | WIFI_FW_AUTH_SUCCESS |WIFI_FW_ASSOC_STATE)
  289. #ifdef CONFIG_TDLS
  290. // 1: Write RCR DATA BIT
  291. // 2: Issue peer traffic indication
  292. // 3: Go back to the channel linked with AP, terminating channel switch procedure
  293. // 4: Init channel sensing, receive all data and mgnt frame
  294. // 5: Channel sensing and report candidate channel
  295. // 6: First time set channel to off channel
  296. // 7: Go back tp the channel linked with AP when set base channel as target channel
  297. // 8: Set channel back to base channel
  298. // 9: Set channel back to off channel
  299. // 10: Restore RCR DATA BIT
  300. // 11: Check alive
  301. // 12: Check alive
  302. // 13: Free TDLS sta
  303. enum TDLS_option
  304. {
  305. TDLS_WRCR = 1,
  306. TDLS_SD_PTI = 2,
  307. TDLS_CS_OFF = 3,
  308. TDLS_INIT_CH_SEN = 4,
  309. TDLS_DONE_CH_SEN = 5,
  310. TDLS_OFF_CH = 6,
  311. TDLS_BASE_CH = 7,
  312. TDLS_P_OFF_CH = 8,
  313. TDLS_P_BASE_CH = 9,
  314. TDLS_RS_RCR = 10,
  315. TDLS_CKALV_PH1 = 11,
  316. TDLS_CKALV_PH2 = 12,
  317. TDLS_FREE_STA = 13,
  318. maxTDLS,
  319. };
  320. #endif //CONFIG_TDLS
  321. struct FW_Sta_Info
  322. {
  323. struct sta_info *psta;
  324. u32 status;
  325. u32 rx_pkt;
  326. u32 retry;
  327. NDIS_802_11_RATES_EX SupportedRates;
  328. };
  329. /*
  330. * Usage:
  331. * When one iface acted as AP mode and the other iface is STA mode and scanning,
  332. * it should switch back to AP's operating channel periodically.
  333. * Parameters info:
  334. * When the driver scanned RTW_SCAN_NUM_OF_CH channels, it would switch back to AP's operating channel for
  335. * RTW_STAY_AP_CH_MILLISECOND * SURVEY_TO milliseconds.
  336. * Example:
  337. * For chip supports 2.4G + 5GHz and AP mode is operating in channel 1,
  338. * RTW_SCAN_NUM_OF_CH is 8, RTW_STAY_AP_CH_MILLISECOND is 3 and SURVEY_TO is 100.
  339. * When it's STA mode gets set_scan command,
  340. * it would
  341. * 1. Doing the scan on channel 1.2.3.4.5.6.7.8
  342. * 2. Back to channel 1 for 300 milliseconds
  343. * 3. Go through doing site survey on channel 9.10.11.36.40.44.48.52
  344. * 4. Back to channel 1 for 300 milliseconds
  345. * 5. ... and so on, till survey done.
  346. */
  347. #if defined CONFIG_STA_MODE_SCAN_UNDER_AP_MODE && defined CONFIG_CONCURRENT_MODE
  348. #define RTW_SCAN_NUM_OF_CH 8
  349. #define RTW_STAY_AP_CH_MILLISECOND 3 // this value is a multiplier,for example, when this value is 3, it would stay AP's op ch for
  350. // 3 * SURVEY_TO millisecond.
  351. #endif //defined CONFIG_STA_MODE_SCAN_UNDER_AP_MODE && defined CONFIG_CONCURRENT_MODE
  352. struct mlme_ext_info
  353. {
  354. u32 state;
  355. u32 reauth_count;
  356. u32 reassoc_count;
  357. u32 link_count;
  358. u32 auth_seq;
  359. u32 auth_algo; // 802.11 auth, could be open, shared, auto
  360. u32 authModeToggle;
  361. u32 enc_algo;//encrypt algorithm;
  362. u32 key_index; // this is only valid for legendary wep, 0~3 for key id.
  363. u32 iv;
  364. u8 chg_txt[128];
  365. u16 aid;
  366. u16 bcn_interval;
  367. u16 capability;
  368. u8 assoc_AP_vendor;
  369. u8 slotTime;
  370. u8 preamble_mode;
  371. u8 WMM_enable;
  372. u8 ERP_enable;
  373. u8 ERP_IE;
  374. u8 HT_enable;
  375. u8 HT_caps_enable;
  376. u8 HT_info_enable;
  377. u8 HT_protection;
  378. u8 turboMode_cts2self;
  379. u8 turboMode_rtsen;
  380. u8 SM_PS;
  381. u8 agg_enable_bitmap;
  382. u8 ADDBA_retry_count;
  383. u8 candidate_tid_bitmap;
  384. u8 dialogToken;
  385. // Accept ADDBA Request
  386. BOOLEAN bAcceptAddbaReq;
  387. u8 bwmode_updated;
  388. u8 hidden_ssid_mode;
  389. u8 VHT_enable;
  390. struct ADDBA_request ADDBA_req;
  391. struct WMM_para_element WMM_param;
  392. struct HT_caps_element HT_caps;
  393. struct HT_info_element HT_info;
  394. WLAN_BSSID_EX network;//join network or bss_network, if in ap mode, it is the same to cur_network.network
  395. struct FW_Sta_Info FW_sta_info[NUM_STA];
  396. #ifdef CONFIG_STA_MODE_SCAN_UNDER_AP_MODE
  397. u8 scan_cnt;
  398. #endif //CONFIG_STA_MODE_SCAN_UNDER_AP_MODE
  399. };
  400. // The channel information about this channel including joining, scanning, and power constraints.
  401. typedef struct _RT_CHANNEL_INFO
  402. {
  403. u8 ChannelNum; // The channel number.
  404. RT_SCAN_TYPE ScanType; // Scan type such as passive or active scan.
  405. //u16 ScanPeriod; // Listen time in millisecond in this channel.
  406. //s32 MaxTxPwrDbm; // Max allowed tx power.
  407. //u32 ExInfo; // Extended Information for this channel.
  408. #ifdef CONFIG_FIND_BEST_CHANNEL
  409. u32 rx_count;
  410. #endif
  411. }RT_CHANNEL_INFO, *PRT_CHANNEL_INFO;
  412. int rtw_ch_set_search_ch(RT_CHANNEL_INFO *ch_set, const u32 ch);
  413. // P2P_MAX_REG_CLASSES - Maximum number of regulatory classes
  414. #define P2P_MAX_REG_CLASSES 10
  415. // P2P_MAX_REG_CLASS_CHANNELS - Maximum number of channels per regulatory class
  416. #define P2P_MAX_REG_CLASS_CHANNELS 20
  417. // struct p2p_channels - List of supported channels
  418. struct p2p_channels {
  419. // struct p2p_reg_class - Supported regulatory class
  420. struct p2p_reg_class {
  421. // reg_class - Regulatory class (IEEE 802.11-2007, Annex J)
  422. u8 reg_class;
  423. // channel - Supported channels
  424. u8 channel[P2P_MAX_REG_CLASS_CHANNELS];
  425. // channels - Number of channel entries in use
  426. size_t channels;
  427. } reg_class[P2P_MAX_REG_CLASSES];
  428. // reg_classes - Number of reg_class entries in use
  429. size_t reg_classes;
  430. };
  431. struct p2p_oper_class_map {
  432. enum hw_mode {IEEE80211G,IEEE80211A} mode;
  433. u8 op_class;
  434. u8 min_chan;
  435. u8 max_chan;
  436. u8 inc;
  437. enum { BW20, BW40PLUS, BW40MINUS } bw;
  438. };
  439. struct mlme_ext_priv
  440. {
  441. _adapter *padapter;
  442. u8 mlmeext_init;
  443. ATOMIC_T event_seq;
  444. u16 mgnt_seq;
  445. //struct fw_priv fwpriv;
  446. unsigned char cur_channel;
  447. unsigned char cur_bwmode;
  448. unsigned char cur_ch_offset;//PRIME_CHNL_OFFSET
  449. unsigned char cur_wireless_mode; // NETWORK_TYPE
  450. unsigned char max_chan_nums;
  451. RT_CHANNEL_INFO channel_set[MAX_CHANNEL_NUM];
  452. struct p2p_channels channel_list;
  453. unsigned char basicrate[NumRates];
  454. unsigned char datarate[NumRates];
  455. struct ss_res sitesurvey_res;
  456. struct mlme_ext_info mlmext_info;//for sta/adhoc mode, including current scanning/connecting/connected related info.
  457. //for ap mode, network includes ap's cap_info
  458. _timer survey_timer;
  459. _timer link_timer;
  460. //_timer ADDBA_timer;
  461. u16 chan_scan_time;
  462. u8 scan_abort;
  463. u8 tx_rate; // TXRATE when USERATE is set.
  464. u32 retry; //retry for issue probereq
  465. u64 TSFValue;
  466. #ifdef CONFIG_AP_MODE
  467. unsigned char bstart_bss;
  468. #endif
  469. #ifdef CONFIG_80211D
  470. u8 update_channel_plan_by_ap_done;
  471. #endif
  472. //recv_decache check for Action_public frame
  473. u8 action_public_dialog_token;
  474. u16 action_public_rxseq;
  475. #ifdef CONFIG_ACTIVE_KEEP_ALIVE_CHECK
  476. u8 active_keep_alive_check;
  477. #endif
  478. #ifdef DBG_FIXED_CHAN
  479. u8 fixed_chan;
  480. #endif
  481. };
  482. int init_mlme_ext_priv(_adapter* padapter);
  483. int init_hw_mlme_ext(_adapter *padapter);
  484. void free_mlme_ext_priv (struct mlme_ext_priv *pmlmeext);
  485. extern void init_mlme_ext_timer(_adapter *padapter);
  486. extern void init_addba_retry_timer(_adapter *padapter, struct sta_info *psta);
  487. extern struct xmit_frame *alloc_mgtxmitframe(struct xmit_priv *pxmitpriv);
  488. struct xmit_frame *alloc_mgtxmitframe_once(struct xmit_priv *pxmitpriv);
  489. //void fill_fwpriv(_adapter * padapter, struct fw_priv *pfwpriv);
  490. unsigned char networktype_to_raid(_adapter *adapter,unsigned char network_type);
  491. unsigned char networktype_to_raid_ex(_adapter *adapter,unsigned char network_type);
  492. u8 judge_network_type(_adapter *padapter, unsigned char *rate, int ratelen);
  493. void get_rate_set(_adapter *padapter, unsigned char *pbssrate, int *bssrate_len);
  494. void UpdateBrateTbl(_adapter *padapter,u8 *mBratesOS);
  495. void UpdateBrateTblForSoftAP(u8 *bssrateset, u32 bssratelen);
  496. void change_band_update_ie(_adapter *padapter, WLAN_BSSID_EX *pnetwork);
  497. void Save_DM_Func_Flag(_adapter *padapter);
  498. void Restore_DM_Func_Flag(_adapter *padapter);
  499. void Switch_DM_Func(_adapter *padapter, u32 mode, u8 enable);
  500. //void Set_NETYPE1_MSR(_adapter *padapter, u8 type);
  501. //void Set_NETYPE0_MSR(_adapter *padapter, u8 type);
  502. void Set_MSR(_adapter *padapter, u8 type);
  503. u8 rtw_get_oper_ch(_adapter *adapter);
  504. void rtw_set_oper_ch(_adapter *adapter, u8 ch);
  505. u8 rtw_get_oper_bw(_adapter *adapter);
  506. void rtw_set_oper_bw(_adapter *adapter, u8 bw);
  507. u8 rtw_get_oper_choffset(_adapter *adapter);
  508. void rtw_set_oper_choffset(_adapter *adapter, u8 offset);
  509. u8 rtw_get_center_ch(u8 channel, u8 chnl_bw, u8 chnl_offset);
  510. void set_channel_bwmode(_adapter *padapter, unsigned char channel, unsigned char channel_offset, unsigned short bwmode);
  511. void SelectChannel(_adapter *padapter, unsigned char channel);
  512. void SetBWMode(_adapter *padapter, unsigned short bwmode, unsigned char channel_offset);
  513. unsigned int decide_wait_for_beacon_timeout(unsigned int bcn_interval);
  514. void write_cam(_adapter *padapter, u8 entry, u16 ctrl, u8 *mac, u8 *key);
  515. void clear_cam_entry(_adapter *padapter, u8 entry);
  516. void invalidate_cam_all(_adapter *padapter);
  517. void CAM_empty_entry(PADAPTER Adapter, u8 ucIndex);
  518. int allocate_fw_sta_entry(_adapter *padapter);
  519. void flush_all_cam_entry(_adapter *padapter);
  520. BOOLEAN IsLegal5GChannel(PADAPTER Adapter, u8 channel);
  521. void site_survey(_adapter *padapter);
  522. u8 collect_bss_info(_adapter *padapter, union recv_frame *precv_frame, WLAN_BSSID_EX *bssid);
  523. void update_network(WLAN_BSSID_EX *dst, WLAN_BSSID_EX *src, _adapter * padapter, bool update_ie);
  524. int get_bsstype(unsigned short capability);
  525. u8* get_my_bssid(WLAN_BSSID_EX *pnetwork);
  526. u16 get_beacon_interval(WLAN_BSSID_EX *bss);
  527. int is_client_associated_to_ap(_adapter *padapter);
  528. int is_client_associated_to_ibss(_adapter *padapter);
  529. int is_IBSS_empty(_adapter *padapter);
  530. unsigned char check_assoc_AP(u8 *pframe, uint len);
  531. int WMM_param_handler(_adapter *padapter, PNDIS_802_11_VARIABLE_IEs pIE);
  532. #ifdef CONFIG_WFD
  533. int WFD_info_handler(_adapter *padapter, PNDIS_802_11_VARIABLE_IEs pIE);
  534. #endif
  535. void WMMOnAssocRsp(_adapter *padapter);
  536. void HT_caps_handler(_adapter *padapter, PNDIS_802_11_VARIABLE_IEs pIE);
  537. void HT_info_handler(_adapter *padapter, PNDIS_802_11_VARIABLE_IEs pIE);
  538. void HTOnAssocRsp(_adapter *padapter);
  539. void ERP_IE_handler(_adapter *padapter, PNDIS_802_11_VARIABLE_IEs pIE);
  540. void VCS_update(_adapter *padapter, struct sta_info *psta);
  541. void update_beacon_info(_adapter *padapter, u8 *pframe, uint len, struct sta_info *psta);
  542. int rtw_check_bcn_info(ADAPTER *Adapter, u8 *pframe, u32 packet_len);
  543. #ifdef CONFIG_DFS
  544. void process_csa_ie(_adapter *padapter, u8 *pframe, uint len);
  545. #endif //CONFIG_DFS
  546. void update_IOT_info(_adapter *padapter);
  547. void update_capinfo(PADAPTER Adapter, u16 updateCap);
  548. void update_wireless_mode(_adapter * padapter);
  549. void update_tx_basic_rate(_adapter *padapter, u8 modulation);
  550. void update_bmc_sta_support_rate(_adapter *padapter, u32 mac_id);
  551. int update_sta_support_rate(_adapter *padapter, u8* pvar_ie, uint var_ie_len, int cam_idx);
  552. //for sta/adhoc mode
  553. void update_sta_info(_adapter *padapter, struct sta_info *psta);
  554. unsigned int update_basic_rate(unsigned char *ptn, unsigned int ptn_sz);
  555. unsigned int update_supported_rate(unsigned char *ptn, unsigned int ptn_sz);
  556. unsigned int update_MCS_rate(struct HT_caps_element *pHT_caps);
  557. void Update_RA_Entry(_adapter *padapter, struct sta_info *psta);
  558. void set_sta_rate(_adapter *padapter, struct sta_info *psta);
  559. unsigned int receive_disconnect(_adapter *padapter, unsigned char *MacAddr, unsigned short reason);
  560. unsigned char get_highest_rate_idx(u32 mask);
  561. int support_short_GI(_adapter *padapter, struct HT_caps_element *pHT_caps);
  562. unsigned int is_ap_in_tkip(_adapter *padapter);
  563. unsigned int is_ap_in_wep(_adapter *padapter);
  564. unsigned int should_forbid_n_rate(_adapter * padapter);
  565. extern uint rtw_get_camid(uint macid);
  566. extern void rtw_alloc_macid(_adapter *padapter, struct sta_info *psta);
  567. extern void rtw_release_macid(_adapter *padapter, struct sta_info *psta);
  568. void report_join_res(_adapter *padapter, int res);
  569. void report_survey_event(_adapter *padapter, union recv_frame *precv_frame);
  570. void report_surveydone_event(_adapter *padapter);
  571. void report_del_sta_event(_adapter *padapter, unsigned char* MacAddr, unsigned short reason);
  572. void report_add_sta_event(_adapter *padapter, unsigned char* MacAddr, int cam_idx);
  573. void beacon_timing_control(_adapter *padapter);
  574. extern u8 set_tx_beacon_cmd(_adapter*padapter);
  575. unsigned int setup_beacon_frame(_adapter *padapter, unsigned char *beacon_frame);
  576. void update_mgnt_tx_rate(_adapter *padapter, u8 rate);
  577. void update_mgntframe_attrib(_adapter *padapter, struct pkt_attrib *pattrib);
  578. void update_mgntframe_attrib_addr(_adapter *padapter, struct xmit_frame *pmgntframe);
  579. void dump_mgntframe(_adapter *padapter, struct xmit_frame *pmgntframe);
  580. s32 dump_mgntframe_and_wait(_adapter *padapter, struct xmit_frame *pmgntframe, int timeout_ms);
  581. s32 dump_mgntframe_and_wait_ack(_adapter *padapter, struct xmit_frame *pmgntframe);
  582. #ifdef CONFIG_P2P
  583. void issue_probersp_p2p(_adapter *padapter, unsigned char *da);
  584. void issue_p2p_provision_request( _adapter *padapter, u8* pssid, u8 ussidlen, u8* pdev_raddr);
  585. void issue_p2p_GO_request(_adapter *padapter, u8* raddr);
  586. void issue_probereq_p2p(_adapter *padapter, u8 *da);
  587. int issue_probereq_p2p_ex(_adapter *adapter, u8 *da, int try_cnt, int wait_ms);
  588. void issue_p2p_invitation_response(_adapter *padapter, u8* raddr, u8 dialogToken, u8 success);
  589. void issue_p2p_invitation_request(_adapter *padapter, u8* raddr );
  590. #endif //CONFIG_P2P
  591. void issue_beacon(_adapter *padapter, int timeout_ms);
  592. void issue_probersp(_adapter *padapter, unsigned char *da, u8 is_valid_p2p_probereq);
  593. void issue_assocreq(_adapter *padapter);
  594. void issue_asocrsp(_adapter *padapter, unsigned short status, struct sta_info *pstat, int pkt_type);
  595. void issue_auth(_adapter *padapter, struct sta_info *psta, unsigned short status);
  596. void issue_probereq(_adapter *padapter, NDIS_802_11_SSID *pssid, u8 *da);
  597. s32 issue_probereq_ex(_adapter *padapter, NDIS_802_11_SSID *pssid, u8* da, int try_cnt, int wait_ms);
  598. int issue_nulldata(_adapter *padapter, unsigned char *da, unsigned int power_mode, int try_cnt, int wait_ms);
  599. int issue_qos_nulldata(_adapter *padapter, unsigned char *da, u16 tid, int try_cnt, int wait_ms);
  600. int issue_deauth(_adapter *padapter, unsigned char *da, unsigned short reason);
  601. int issue_deauth_ex(_adapter *padapter, u8 *da, unsigned short reason, int try_cnt, int wait_ms);
  602. void issue_action_spct_ch_switch(_adapter *padapter, u8 *ra, u8 new_ch, u8 ch_offset);
  603. void issue_action_BA(_adapter *padapter, unsigned char *raddr, unsigned char action, unsigned short status);
  604. unsigned int send_delba(_adapter *padapter, u8 initiator, u8 *addr);
  605. unsigned int send_beacon(_adapter *padapter);
  606. void start_clnt_assoc(_adapter *padapter);
  607. void start_clnt_auth(_adapter* padapter);
  608. void start_clnt_join(_adapter* padapter);
  609. void start_create_ibss(_adapter* padapter);
  610. unsigned int OnAssocReq(_adapter *padapter, union recv_frame *precv_frame);
  611. unsigned int OnAssocRsp(_adapter *padapter, union recv_frame *precv_frame);
  612. unsigned int OnProbeReq(_adapter *padapter, union recv_frame *precv_frame);
  613. unsigned int OnProbeRsp(_adapter *padapter, union recv_frame *precv_frame);
  614. unsigned int DoReserved(_adapter *padapter, union recv_frame *precv_frame);
  615. unsigned int OnBeacon(_adapter *padapter, union recv_frame *precv_frame);
  616. unsigned int OnAtim(_adapter *padapter, union recv_frame *precv_frame);
  617. unsigned int OnDisassoc(_adapter *padapter, union recv_frame *precv_frame);
  618. unsigned int OnAuth(_adapter *padapter, union recv_frame *precv_frame);
  619. unsigned int OnAuthClient(_adapter *padapter, union recv_frame *precv_frame);
  620. unsigned int OnDeAuth(_adapter *padapter, union recv_frame *precv_frame);
  621. unsigned int OnAction(_adapter *padapter, union recv_frame *precv_frame);
  622. unsigned int on_action_spct(_adapter *padapter, union recv_frame *precv_frame);
  623. unsigned int OnAction_qos(_adapter *padapter, union recv_frame *precv_frame);
  624. unsigned int OnAction_dls(_adapter *padapter, union recv_frame *precv_frame);
  625. unsigned int OnAction_back(_adapter *padapter, union recv_frame *precv_frame);
  626. unsigned int on_action_public(_adapter *padapter, union recv_frame *precv_frame);
  627. unsigned int OnAction_ht(_adapter *padapter, union recv_frame *precv_frame);
  628. unsigned int OnAction_wmm(_adapter *padapter, union recv_frame *precv_frame);
  629. unsigned int OnAction_p2p(_adapter *padapter, union recv_frame *precv_frame);
  630. void mlmeext_joinbss_event_callback(_adapter *padapter, int join_res);
  631. void mlmeext_sta_del_event_callback(_adapter *padapter);
  632. void mlmeext_sta_add_event_callback(_adapter *padapter, struct sta_info *psta);
  633. void linked_status_chk(_adapter *padapter);
  634. void survey_timer_hdl (_adapter *padapter);
  635. void link_timer_hdl (_adapter *padapter);
  636. void addba_timer_hdl(struct sta_info *psta);
  637. //void reauth_timer_hdl(_adapter *padapter);
  638. //void reassoc_timer_hdl(_adapter *padapter);
  639. #define set_survey_timer(mlmeext, ms) \
  640. do { \
  641. /*DBG_871X("%s set_survey_timer(%p, %d)\n", __FUNCTION__, (mlmeext), (ms));*/ \
  642. _set_timer(&(mlmeext)->survey_timer, (ms)); \
  643. } while(0)
  644. #define set_link_timer(mlmeext, ms) \
  645. do { \
  646. /*DBG_871X("%s set_link_timer(%p, %d)\n", __FUNCTION__, (mlmeext), (ms));*/ \
  647. _set_timer(&(mlmeext)->link_timer, (ms)); \
  648. } while(0)
  649. extern int cckrates_included(unsigned char *rate, int ratelen);
  650. extern int cckratesonly_included(unsigned char *rate, int ratelen);
  651. extern void process_addba_req(_adapter *padapter, u8 *paddba_req, u8 *addr);
  652. extern void update_TSF(struct mlme_ext_priv *pmlmeext, u8 *pframe, uint len);
  653. extern void correct_TSF(_adapter *padapter, struct mlme_ext_priv *pmlmeext);
  654. #ifdef CONFIG_CONCURRENT_MODE
  655. sint check_buddy_mlmeinfo_state(_adapter *padapter, u32 state);
  656. int concurrent_chk_start_clnt_join(_adapter *padapter);
  657. void concurrent_chk_joinbss_done(_adapter *padapter, int join_res);
  658. #endif //CONFIG_CONCURRENT_MODE
  659. #ifdef CONFIG_DUALMAC_CONCURRENT
  660. void dc_SelectChannel(_adapter *padapter, unsigned char channel);
  661. void dc_SetBWMode(_adapter *padapter, unsigned short bwmode, unsigned char channel_offset);
  662. void dc_set_channel_bwmode_disconnect(_adapter *padapter);
  663. u8 dc_handle_join_request(_adapter *padapter);
  664. void dc_handle_join_done(_adapter *padapter, u8 join_res);
  665. sint dc_check_fwstate(_adapter *padapter, sint fw_state);
  666. u8 dc_handle_site_survey(_adapter *padapter);
  667. void dc_report_survey_event(_adapter *padapter, union recv_frame *precv_frame);
  668. void dc_set_channel_bwmode_survey_done(_adapter *padapter);
  669. void dc_set_ap_channel_bandwidth(_adapter *padapter, u8 channel, u8 channel_offset, u8 bwmode);
  670. void dc_resume_xmit(_adapter *padapter);
  671. u8 dc_check_xmit(_adapter *padapter);
  672. #endif
  673. struct cmd_hdl {
  674. uint parmsize;
  675. u8 (*h2cfuns)(struct _ADAPTER *padapter, u8 *pbuf);
  676. };
  677. u8 read_macreg_hdl(_adapter *padapter, u8 *pbuf);
  678. u8 write_macreg_hdl(_adapter *padapter, u8 *pbuf);
  679. u8 read_bbreg_hdl(_adapter *padapter, u8 *pbuf);
  680. u8 write_bbreg_hdl(_adapter *padapter, u8 *pbuf);
  681. u8 read_rfreg_hdl(_adapter *padapter, u8 *pbuf);
  682. u8 write_rfreg_hdl(_adapter *padapter, u8 *pbuf);
  683. u8 NULL_hdl(_adapter *padapter, u8 *pbuf);
  684. u8 join_cmd_hdl(_adapter *padapter, u8 *pbuf);
  685. u8 disconnect_hdl(_adapter *padapter, u8 *pbuf);
  686. u8 createbss_hdl(_adapter *padapter, u8 *pbuf);
  687. u8 setopmode_hdl(_adapter *padapter, u8 *pbuf);
  688. u8 sitesurvey_cmd_hdl(_adapter *padapter, u8 *pbuf);
  689. u8 setauth_hdl(_adapter *padapter, u8 *pbuf);
  690. u8 setkey_hdl(_adapter *padapter, u8 *pbuf);
  691. u8 set_stakey_hdl(_adapter *padapter, u8 *pbuf);
  692. u8 set_assocsta_hdl(_adapter *padapter, u8 *pbuf);
  693. u8 del_assocsta_hdl(_adapter *padapter, u8 *pbuf);
  694. u8 add_ba_hdl(_adapter *padapter, unsigned char *pbuf);
  695. u8 mlme_evt_hdl(_adapter *padapter, unsigned char *pbuf);
  696. u8 h2c_msg_hdl(_adapter *padapter, unsigned char *pbuf);
  697. u8 tx_beacon_hdl(_adapter *padapter, unsigned char *pbuf);
  698. u8 set_ch_hdl(_adapter *padapter, u8 *pbuf);
  699. u8 set_chplan_hdl(_adapter *padapter, unsigned char *pbuf);
  700. u8 led_blink_hdl(_adapter *padapter, unsigned char *pbuf);
  701. u8 set_csa_hdl(_adapter *padapter, unsigned char *pbuf); //Kurt: Handling DFS channel switch announcement ie.
  702. u8 tdls_hdl(_adapter *padapter, unsigned char *pbuf);
  703. #define GEN_DRV_CMD_HANDLER(size, cmd) {size, &cmd ## _hdl},
  704. #define GEN_MLME_EXT_HANDLER(size, cmd) {size, cmd},
  705. #ifdef _RTW_CMD_C_
  706. struct cmd_hdl wlancmds[] =
  707. {
  708. GEN_DRV_CMD_HANDLER(0, NULL) /*0*/
  709. GEN_DRV_CMD_HANDLER(0, NULL)
  710. GEN_DRV_CMD_HANDLER(0, NULL)
  711. GEN_DRV_CMD_HANDLER(0, NULL)
  712. GEN_DRV_CMD_HANDLER(0, NULL)
  713. GEN_DRV_CMD_HANDLER(0, NULL)
  714. GEN_MLME_EXT_HANDLER(0, NULL)
  715. GEN_MLME_EXT_HANDLER(0, NULL)
  716. GEN_MLME_EXT_HANDLER(0, NULL)
  717. GEN_MLME_EXT_HANDLER(0, NULL)
  718. GEN_MLME_EXT_HANDLER(0, NULL) /*10*/
  719. GEN_MLME_EXT_HANDLER(0, NULL)
  720. GEN_MLME_EXT_HANDLER(0, NULL)
  721. GEN_MLME_EXT_HANDLER(0, NULL)
  722. GEN_MLME_EXT_HANDLER(sizeof (struct joinbss_parm), join_cmd_hdl) /*14*/
  723. GEN_MLME_EXT_HANDLER(sizeof (struct disconnect_parm), disconnect_hdl)
  724. GEN_MLME_EXT_HANDLER(sizeof (struct createbss_parm), createbss_hdl)
  725. GEN_MLME_EXT_HANDLER(sizeof (struct setopmode_parm), setopmode_hdl)
  726. GEN_MLME_EXT_HANDLER(sizeof (struct sitesurvey_parm), sitesurvey_cmd_hdl) /*18*/
  727. GEN_MLME_EXT_HANDLER(sizeof (struct setauth_parm), setauth_hdl)
  728. GEN_MLME_EXT_HANDLER(sizeof (struct setkey_parm), setkey_hdl) /*20*/
  729. GEN_MLME_EXT_HANDLER(sizeof (struct set_stakey_parm), set_stakey_hdl)
  730. GEN_MLME_EXT_HANDLER(sizeof (struct set_assocsta_parm), NULL)
  731. GEN_MLME_EXT_HANDLER(sizeof (struct del_assocsta_parm), NULL)
  732. GEN_MLME_EXT_HANDLER(sizeof (struct setstapwrstate_parm), NULL)
  733. GEN_MLME_EXT_HANDLER(sizeof (struct setbasicrate_parm), NULL)
  734. GEN_MLME_EXT_HANDLER(sizeof (struct getbasicrate_parm), NULL)
  735. GEN_MLME_EXT_HANDLER(sizeof (struct setdatarate_parm), NULL)
  736. GEN_MLME_EXT_HANDLER(sizeof (struct getdatarate_parm), NULL)
  737. GEN_MLME_EXT_HANDLER(sizeof (struct setphyinfo_parm), NULL)
  738. GEN_MLME_EXT_HANDLER(sizeof (struct getphyinfo_parm), NULL) /*30*/
  739. GEN_MLME_EXT_HANDLER(sizeof (struct setphy_parm), NULL)
  740. GEN_MLME_EXT_HANDLER(sizeof (struct getphy_parm), NULL)
  741. GEN_MLME_EXT_HANDLER(0, NULL)
  742. GEN_MLME_EXT_HANDLER(0, NULL)
  743. GEN_MLME_EXT_HANDLER(0, NULL)
  744. GEN_MLME_EXT_HANDLER(0, NULL)
  745. GEN_MLME_EXT_HANDLER(0, NULL)
  746. GEN_MLME_EXT_HANDLER(0, NULL)
  747. GEN_MLME_EXT_HANDLER(0, NULL)
  748. GEN_MLME_EXT_HANDLER(0, NULL) /*40*/
  749. GEN_MLME_EXT_HANDLER(0, NULL)
  750. GEN_MLME_EXT_HANDLER(0, NULL)
  751. GEN_MLME_EXT_HANDLER(0, NULL)
  752. GEN_MLME_EXT_HANDLER(0, NULL)
  753. GEN_MLME_EXT_HANDLER(sizeof(struct addBaReq_parm), add_ba_hdl)
  754. GEN_MLME_EXT_HANDLER(sizeof(struct set_ch_parm), set_ch_hdl) /* 46 */
  755. GEN_MLME_EXT_HANDLER(0, NULL)
  756. GEN_MLME_EXT_HANDLER(0, NULL)
  757. GEN_MLME_EXT_HANDLER(0, NULL)
  758. GEN_MLME_EXT_HANDLER(0, NULL) /*50*/
  759. GEN_MLME_EXT_HANDLER(0, NULL)
  760. GEN_MLME_EXT_HANDLER(0, NULL)
  761. GEN_MLME_EXT_HANDLER(0, NULL)
  762. GEN_MLME_EXT_HANDLER(0, NULL)
  763. GEN_MLME_EXT_HANDLER(sizeof(struct Tx_Beacon_param), tx_beacon_hdl) /*55*/
  764. GEN_MLME_EXT_HANDLER(0, mlme_evt_hdl) /*56*/
  765. GEN_MLME_EXT_HANDLER(0, rtw_drvextra_cmd_hdl) /*57*/
  766. GEN_MLME_EXT_HANDLER(0, h2c_msg_hdl) /*58*/
  767. GEN_MLME_EXT_HANDLER(sizeof(struct SetChannelPlan_param), set_chplan_hdl) /*59*/
  768. GEN_MLME_EXT_HANDLER(sizeof(struct LedBlink_param), led_blink_hdl) /*60*/
  769. GEN_MLME_EXT_HANDLER(sizeof(struct SetChannelSwitch_param), set_csa_hdl) /*61*/
  770. GEN_MLME_EXT_HANDLER(sizeof(struct TDLSoption_param), tdls_hdl) /*62*/
  771. };
  772. #endif
  773. struct C2HEvent_Header
  774. {
  775. #ifdef CONFIG_LITTLE_ENDIAN
  776. unsigned int len:16;
  777. unsigned int ID:8;
  778. unsigned int seq:8;
  779. #elif defined(CONFIG_BIG_ENDIAN)
  780. unsigned int seq:8;
  781. unsigned int ID:8;
  782. unsigned int len:16;
  783. #else
  784. # error "Must be LITTLE or BIG Endian"
  785. #endif
  786. unsigned int rsvd;
  787. };
  788. void rtw_dummy_event_callback(_adapter *adapter , u8 *pbuf);
  789. void rtw_fwdbg_event_callback(_adapter *adapter , u8 *pbuf);
  790. enum rtw_c2h_event
  791. {
  792. GEN_EVT_CODE(_Read_MACREG)=0, /*0*/
  793. GEN_EVT_CODE(_Read_BBREG),
  794. GEN_EVT_CODE(_Read_RFREG),
  795. GEN_EVT_CODE(_Read_EEPROM),
  796. GEN_EVT_CODE(_Read_EFUSE),
  797. GEN_EVT_CODE(_Read_CAM), /*5*/
  798. GEN_EVT_CODE(_Get_BasicRate),
  799. GEN_EVT_CODE(_Get_DataRate),
  800. GEN_EVT_CODE(_Survey), /*8*/
  801. GEN_EVT_CODE(_SurveyDone), /*9*/
  802. GEN_EVT_CODE(_JoinBss) , /*10*/
  803. GEN_EVT_CODE(_AddSTA),
  804. GEN_EVT_CODE(_DelSTA),
  805. GEN_EVT_CODE(_AtimDone) ,
  806. GEN_EVT_CODE(_TX_Report),
  807. GEN_EVT_CODE(_CCX_Report), /*15*/
  808. GEN_EVT_CODE(_DTM_Report),
  809. GEN_EVT_CODE(_TX_Rate_Statistics),
  810. GEN_EVT_CODE(_C2HLBK),
  811. GEN_EVT_CODE(_FWDBG),
  812. GEN_EVT_CODE(_C2HFEEDBACK), /*20*/
  813. GEN_EVT_CODE(_ADDBA),
  814. GEN_EVT_CODE(_C2HBCN),
  815. GEN_EVT_CODE(_ReportPwrState), //filen: only for PCIE, USB
  816. GEN_EVT_CODE(_CloseRF), //filen: only for PCIE, work around ASPM
  817. MAX_C2HEVT
  818. };
  819. #ifdef _RTW_MLME_EXT_C_
  820. static struct fwevent wlanevents[] =
  821. {
  822. {0, rtw_dummy_event_callback}, /*0*/
  823. {0, NULL},
  824. {0, NULL},
  825. {0, NULL},
  826. {0, NULL},
  827. {0, NULL},
  828. {0, NULL},
  829. {0, NULL},
  830. {0, &rtw_survey_event_callback}, /*8*/
  831. {sizeof (struct surveydone_event), &rtw_surveydone_event_callback}, /*9*/
  832. {0, &rtw_joinbss_event_callback}, /*10*/
  833. {sizeof(struct stassoc_event), &rtw_stassoc_event_callback},
  834. {sizeof(struct stadel_event), &rtw_stadel_event_callback},
  835. {0, &rtw_atimdone_event_callback},
  836. {0, rtw_dummy_event_callback},
  837. {0, NULL}, /*15*/
  838. {0, NULL},
  839. {0, NULL},
  840. {0, NULL},
  841. {0, rtw_fwdbg_event_callback},
  842. {0, NULL}, /*20*/
  843. {0, NULL},
  844. {0, NULL},
  845. {0, &rtw_cpwm_event_callback},
  846. };
  847. #endif//_RTL8192C_CMD_C_
  848. #endif