ais_fsm.h 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580
  1. /*
  2. ** Id: //Department/DaVinci/BRANCHES/MT6620_WIFI_DRIVER_V2_3/include/mgmt/ais_fsm.h#1
  3. */
  4. /*! \file ais_fsm.h
  5. \brief Declaration of functions and finite state machine for AIS Module.
  6. Declaration of functions and finite state machine for AIS Module.
  7. */
  8. /*
  9. ** Log: ais_fsm.h
  10. *
  11. * 11 22 2011 cp.wu
  12. * [WCXRP00001120] [MT6620 Wi-Fi][Driver] Modify roaming to AIS state transition
  13. * from synchronous to asynchronous approach to avoid incomplete state termination
  14. * 1. change RDD related compile option brace position.
  15. * 2. when roaming is triggered, ask AIS to transit immediately only when AIS
  16. * is in Normal TR state without join timeout timer ticking
  17. * 3. otherwise, insert AIS_REQUEST into pending request queue
  18. *
  19. * 04 25 2011 cp.wu
  20. * [WCXRP00000676] [MT6620 Wi-Fi][Driver] AIS to reduce request channel period from 5 seconds to 2 seconds
  21. * channel interval for joining is shortened to 2 seconds to avoid interruption of concurrent operating network.
  22. *
  23. * 02 26 2011 tsaiyuan.hsu
  24. * [WCXRP00000391] [MT6620 Wi-Fi][FW] Add Roaming Support
  25. * not send disassoc or deauth to leaving AP so as to improve performace of roaming.
  26. *
  27. * 02 22 2011 cp.wu
  28. * [WCXRP00000487] [MT6620 Wi-Fi][Driver][AIS] Serve scan and connect request with
  29. * a queue-based approach to improve response time for scanning request
  30. * handle SCAN and RECONNECT with a FIFO approach.
  31. *
  32. * 01 27 2011 tsaiyuan.hsu
  33. * [WCXRP00000392] [MT6620 Wi-Fi][Driver] Add Roaming Support
  34. * add roaming fsm
  35. * 1. not support 11r, only use strength of signal to determine roaming.
  36. * 2. not enable CFG_SUPPORT_ROAMING until completion of full test.
  37. * 3. in 6620, adopt work-around to avoid sign extension problem of cck of hw
  38. * 4. assume that change of link quality in smooth way.
  39. *
  40. * 01 14 2011 cp.wu
  41. * [WCXRP00000359] [MT6620 Wi-Fi][Driver] add an extra state to ensure DEAUTH frame is always sent
  42. * Add an extra state to guarantee DEAUTH frame is sent then connect to new BSS.
  43. * This change is due to WAPI AP needs DEAUTH frame as a necessary step in handshaking protocol.
  44. *
  45. * 11 25 2010 cp.wu
  46. * [WCXRP00000208] [MT6620 Wi-Fi][Driver] Add scanning with specified SSID to AIS FSM
  47. * add scanning with specified SSID facility to AIS-FSM
  48. *
  49. * 11 01 2010 cp.wu
  50. * [WCXRP00000056] [MT6620 Wi-Fi][Driver] NVRAM implementation with Version Check
  51. * [WCXRP00000150] [MT6620 Wi-Fi][Driver] Add implementation for querying current TX rate from firmware auto rate module
  52. * 1) Query link speed (TX rate) from firmware directly with buffering mechanism to reduce overhead
  53. * 2) Remove CNM CH-RECOVER event handling
  54. * 3) cfg read/write API renamed with kal prefix for unified naming rules.
  55. *
  56. * 09 06 2010 cp.wu
  57. * NULL
  58. * 1) initialize for correct parameter even for disassociation.
  59. * 2) AIS-FSM should have a limit on trials to build connection
  60. *
  61. * 09 03 2010 kevin.huang
  62. * NULL
  63. * Refine #include sequence and solve recursive/nested #include issue
  64. *
  65. * 08 25 2010 cp.wu
  66. * NULL
  67. * [AIS-FSM] IBSS no longer needs to acquire channel for beaconing, RLM/CNM will handle
  68. * the channel switching when BSS information is updated
  69. *
  70. * 08 12 2010 kevin.huang
  71. * NULL
  72. * Refine bssProcessProbeRequest() and bssSendBeaconProbeResponse()
  73. *
  74. * 08 12 2010 cp.wu
  75. * NULL
  76. * [AIS-FSM] honor registry setting for adhoc running mode. (A/B/G)
  77. *
  78. * 08 03 2010 cp.wu
  79. * NULL
  80. * surpress compilation warning.
  81. *
  82. * 07 30 2010 cp.wu
  83. * NULL
  84. * 1) BoW wrapper: use definitions instead of hard-coded constant for error code
  85. * 2) AIS-FSM: eliminate use of desired RF parameters, use prTargetBssDesc instead
  86. * 3) add handling for RX_PKT_DESTINATION_HOST_WITH_FORWARD for GO-broadcast frames
  87. *
  88. * 07 26 2010 cp.wu
  89. *
  90. * AIS-FSM: when scan request is coming in the 1st 5 seconds of channel privilege period,
  91. * just pend it til 5-sec. period finishes
  92. *
  93. * 07 26 2010 cp.wu
  94. *
  95. * AIS-FSM FIX: return channel privilege even when the privilege is not granted yet
  96. * QM: qmGetFrameAction() won't assert when corresponding STA-REC index is not found
  97. *
  98. * 07 23 2010 cp.wu
  99. *
  100. * add AIS-FSM handling for beacon timeout event.
  101. *
  102. * 07 21 2010 cp.wu
  103. *
  104. * separate AIS-FSM states into different cases of channel request.
  105. *
  106. * 07 21 2010 cp.wu
  107. *
  108. * 1) change BG_SCAN to ONLINE_SCAN for consistent term
  109. * 2) only clear scanning result when scan is permitted to do
  110. *
  111. * 07 19 2010 cp.wu
  112. *
  113. * [WPD00003833] [MT6620 and MT5931] Driver migration.
  114. * Add Ad-Hoc support to AIS-FSM
  115. *
  116. * 07 14 2010 cp.wu
  117. *
  118. * [WPD00003833] [MT6620 and MT5931] Driver migration.
  119. * Refine AIS-FSM by divided into more states
  120. *
  121. * 07 09 2010 cp.wu
  122. *
  123. * 1) separate AIS_FSM state for two kinds of scanning. (OID triggered scan, and scan-for-connection)
  124. * 2) eliminate PRE_BSS_DESC_T, Beacon/PrebResp is now parsed in single pass
  125. * 3) implment DRV-SCN module, currently only accepts single scan request,
  126. * other request will be directly dropped by returning BUSY
  127. *
  128. * 07 08 2010 cp.wu
  129. *
  130. * [WPD00003833] [MT6620 and MT5931] Driver migration - move to new repository.
  131. *
  132. * 07 01 2010 cp.wu
  133. * [WPD00003833][MT6620 and MT5931] Driver migration
  134. * AIS-FSM integration with CNM channel request messages
  135. *
  136. * 07 01 2010 cp.wu
  137. * [WPD00003833][MT6620 and MT5931] Driver migration
  138. * implementation of DRV-SCN and related mailbox message handling.
  139. *
  140. * 06 10 2010 cp.wu
  141. * [WPD00003833][MT6620 and MT5931] Driver migration
  142. * add buildable & linkable ais_fsm.c
  143. *
  144. * related reference are still waiting to be resolved
  145. *
  146. * 06 09 2010 cp.wu
  147. * [WPD00003833][MT6620 and MT5931] Driver migration
  148. * add definitions for module migration.
  149. *
  150. * 06 07 2010 cp.wu
  151. * [WPD00003833][MT6620 and MT5931] Driver migration
  152. * add aa_fsm.h, ais_fsm.h, bss.h, mib.h and scan.h.
  153. *
  154. * 05 12 2010 kevin.huang
  155. * [BORA00000794][WIFISYS][New Feature]Power Management Support
  156. * Add Power Management - Legacy PS-POLL support.
  157. *
  158. * 04 23 2010 wh.su
  159. * [BORA00000605][WIFISYS] Phase3 Integration
  160. * reduce the background ssid idle time min and max value
  161. *
  162. * 04 19 2010 kevin.huang
  163. * [BORA00000714][WIFISYS][New Feature]Beacon Timeout Support
  164. * Add Beacon Timeout Support
  165. * * and will send Null frame to diagnose connection
  166. *
  167. * 03 16 2010 kevin.huang
  168. * [BORA00000663][WIFISYS][New Feature] AdHoc Mode Support
  169. * Add AdHoc Mode
  170. *
  171. * 03 10 2010 kevin.huang
  172. * [BORA00000654][WIFISYS][New Feature] CNM Module - Ch Manager Support
  173. *
  174. * * Add Channel Manager for arbitration of JOIN and SCAN Req
  175. *
  176. * 02 26 2010 kevin.huang
  177. * [BORA00000603][WIFISYS] [New Feature] AAA Module Support
  178. * Remove CFG_TEST_VIRTUAL_CMD and add support of Driver STA_RECORD_T activation
  179. *
  180. * 02 23 2010 kevin.huang
  181. * [BORA00000603][WIFISYS] [New Feature] AAA Module Support
  182. * Support dynamic channel selection
  183. *
  184. * 02 04 2010 kevin.huang
  185. * [BORA00000603][WIFISYS] [New Feature] AAA Module Support
  186. * Add AAA Module Support, Revise Net Type to Net Type Index for array lookup
  187. *
  188. * 01 11 2010 kevin.huang
  189. * [BORA00000018]Integrate WIFI part into BORA for the 1st time
  190. * Add Deauth and Disassoc Handler
  191. *
  192. * 01 07 2010 kevin.huang
  193. * [BORA00000018]Integrate WIFI part into BORA for the 1st time
  194. * [BORA00000018] Integrate WIFI part into BORA for the 1st time
  195. * Add Media disconnect indication and related postpone functions
  196. *
  197. * Dec 3 2009 mtk01461
  198. * [BORA00000018] Integrate WIFI part into BORA for the 1st time
  199. * Add aisFsmRunEventJoinComplete()
  200. *
  201. * Nov 25 2009 mtk01461
  202. * [BORA00000018] Integrate WIFI part into BORA for the 1st time
  203. * Add Virtual CMD & RESP for testing CMD PATH
  204. *
  205. * Nov 23 2009 mtk01461
  206. * [BORA00000018] Integrate WIFI part into BORA for the 1st time
  207. * add aisFsmInitializeConnectionSettings()
  208. *
  209. * Nov 20 2009 mtk01461
  210. * [BORA00000018] Integrate WIFI part into BORA for the 1st time
  211. * Add CFG_TEST_MGMT_FSM for aisFsmTest()
  212. *
  213. * Nov 18 2009 mtk01104
  214. * [BORA00000018] Integrate WIFI part into BORA for the 1st time
  215. * Add function prototype of aisFsmInit()
  216. *
  217. * Nov 16 2009 mtk01461
  218. * [BORA00000018] Integrate WIFI part into BORA for the 1st time
  219. *
  220. */
  221. #ifndef _AIS_FSM_H
  222. #define _AIS_FSM_H
  223. /*******************************************************************************
  224. * C O M P I L E R F L A G S
  225. ********************************************************************************
  226. */
  227. /*******************************************************************************
  228. * E X T E R N A L R E F E R E N C E S
  229. ********************************************************************************
  230. */
  231. /*******************************************************************************
  232. * C O N S T A N T S
  233. ********************************************************************************
  234. */
  235. #define AIS_BG_SCAN_INTERVAL_MIN_SEC 2 /* 30 // exponential to 960 */
  236. #define AIS_BG_SCAN_INTERVAL_MAX_SEC 2 /* 960 // 16min */
  237. #define AIS_DELAY_TIME_OF_DISC_SEC_ONLY_2G4 2 /* 2.4G scan need about 0.5s, so delay 2s to reconnect is enough */
  238. #define AIS_DELAY_TIME_OF_DISC_SEC_DUALBAND 5 /* 2.4G scan need about 3.3s, so delay 5s to reconnect is enough */
  239. #define AIS_IBSS_ALONE_TIMEOUT_SEC 20 /* seconds */
  240. #define AIS_BEACON_TIMEOUT_COUNT_ADHOC 30
  241. #define AIS_BEACON_TIMEOUT_COUNT_INFRA 10
  242. #define AIS_BEACON_TIMEOUT_GUARD_TIME_SEC 1 /* Second */
  243. #define AIS_BEACON_MAX_TIMEOUT_TU 100
  244. #define AIS_BEACON_MIN_TIMEOUT_TU 5
  245. #define AIS_BEACON_MAX_TIMEOUT_VALID TRUE
  246. #define AIS_BEACON_MIN_TIMEOUT_VALID TRUE
  247. #define AIS_BMC_MAX_TIMEOUT_TU 100
  248. #define AIS_BMC_MIN_TIMEOUT_TU 5
  249. #define AIS_BMC_MAX_TIMEOUT_VALID TRUE
  250. #define AIS_BMC_MIN_TIMEOUT_VALID TRUE
  251. #define AIS_JOIN_CH_GRANT_THRESHOLD 10
  252. #define AIS_JOIN_CH_REQUEST_INTERVAL 3000
  253. #define AIS_SCN_DONE_TIMEOUT_SEC 30 /* 15 for 2.4G + 5G */ /* 5 */
  254. /*******************************************************************************
  255. * D A T A T Y P E S
  256. ********************************************************************************
  257. */
  258. typedef enum _ENUM_AIS_STATE_T {
  259. AIS_STATE_IDLE = 0,
  260. AIS_STATE_SEARCH,
  261. AIS_STATE_SCAN,
  262. AIS_STATE_ONLINE_SCAN,
  263. AIS_STATE_LOOKING_FOR,
  264. AIS_STATE_WAIT_FOR_NEXT_SCAN,
  265. AIS_STATE_REQ_CHANNEL_JOIN,
  266. AIS_STATE_JOIN,
  267. AIS_STATE_IBSS_ALONE,
  268. AIS_STATE_IBSS_MERGE,
  269. AIS_STATE_NORMAL_TR,
  270. AIS_STATE_DISCONNECTING,
  271. AIS_STATE_REQ_REMAIN_ON_CHANNEL,
  272. AIS_STATE_REMAIN_ON_CHANNEL,
  273. AIS_STATE_NUM
  274. } ENUM_AIS_STATE_T;
  275. /* reconnect level for determining if we should reconnect */
  276. typedef enum _ENUM_RECONNECT_LEVEL_T {
  277. RECONNECT_LEVEL_MIN = 0,
  278. RECONNECT_LEVEL_ROAMING_FAIL, /* roaming failed */
  279. RECONNECT_LEVEL_BEACON_TIMEOUT, /* driver beacon timeout */
  280. RECONNECT_LEVEL_USER_SET, /* user set connect or disassociate */
  281. RECONNECT_LEVEL_MAX
  282. } ENUM_RECONNECT_LEVEL_T;
  283. typedef struct _MSG_AIS_ABORT_T {
  284. MSG_HDR_T rMsgHdr; /* Must be the first member */
  285. UINT_8 ucReasonOfDisconnect;
  286. BOOLEAN fgDelayIndication;
  287. } MSG_AIS_ABORT_T, *P_MSG_AIS_ABORT_T;
  288. typedef struct _MSG_AIS_IBSS_PEER_FOUND_T {
  289. MSG_HDR_T rMsgHdr; /* Must be the first member */
  290. UINT_8 ucNetTypeIndex;
  291. BOOLEAN fgIsMergeIn; /* TRUE: Merge In, FALSE: Merge Out */
  292. P_STA_RECORD_T prStaRec;
  293. } MSG_AIS_IBSS_PEER_FOUND_T, *P_MSG_AIS_IBSS_PEER_FOUND_T;
  294. typedef enum _ENUM_AIS_REQUEST_TYPE_T {
  295. AIS_REQUEST_SCAN,
  296. AIS_REQUEST_RECONNECT,
  297. AIS_REQUEST_ROAMING_SEARCH,
  298. AIS_REQUEST_ROAMING_CONNECT,
  299. AIS_REQUEST_REMAIN_ON_CHANNEL,
  300. AIS_REQUEST_NUM
  301. } ENUM_AIS_REQUEST_TYPE_T;
  302. typedef struct _AIS_REQ_HDR_T {
  303. LINK_ENTRY_T rLinkEntry;
  304. ENUM_AIS_REQUEST_TYPE_T eReqType;
  305. } AIS_REQ_HDR_T, *P_AIS_REQ_HDR_T;
  306. typedef struct _AIS_REQ_CHNL_INFO {
  307. ENUM_BAND_T eBand;
  308. ENUM_CHNL_EXT_T eSco;
  309. UINT_8 ucChannelNum;
  310. UINT_32 u4DurationMs;
  311. UINT_64 u8Cookie;
  312. } AIS_REQ_CHNL_INFO, *P_AIS_REQ_CHNL_INFO;
  313. typedef struct _AIS_MGMT_TX_REQ_INFO_T {
  314. BOOLEAN fgIsMgmtTxRequested;
  315. P_MSDU_INFO_T prMgmtTxMsdu;
  316. UINT_64 u8Cookie;
  317. } AIS_MGMT_TX_REQ_INFO_T, *P_AIS_MGMT_TX_REQ_INFO_T;
  318. typedef struct _AIS_FSM_INFO_T {
  319. ENUM_AIS_STATE_T ePreviousState;
  320. ENUM_AIS_STATE_T eCurrentState;
  321. BOOLEAN fgTryScan;
  322. BOOLEAN fgIsInfraChannelFinished;
  323. BOOLEAN fgIsChannelRequested;
  324. BOOLEAN fgIsChannelGranted;
  325. #if CFG_SUPPORT_ROAMING
  326. BOOLEAN fgIsRoamingScanPending;
  327. #endif /* CFG_SUPPORT_ROAMING */
  328. UINT_8 ucAvailableAuthTypes; /* Used for AUTH_MODE_AUTO_SWITCH */
  329. P_BSS_DESC_T prTargetBssDesc; /* For destination */
  330. P_STA_RECORD_T prTargetStaRec; /* For JOIN Abort */
  331. UINT_32 u4SleepInterval;
  332. TIMER_T rBGScanTimer;
  333. TIMER_T rIbssAloneTimer;
  334. UINT_32 u4PostponeIndStartTime;
  335. TIMER_T rJoinTimeoutTimer;
  336. TIMER_T rChannelTimeoutTimer;
  337. TIMER_T rScanDoneTimer;
  338. TIMER_T rDeauthDoneTimer;
  339. UINT_8 ucSeqNumOfReqMsg;
  340. UINT_8 ucSeqNumOfChReq;
  341. UINT_8 ucSeqNumOfScanReq;
  342. UINT_32 u4ChGrantedInterval;
  343. UINT_8 ucConnTrialCount;
  344. UINT_8 ucScanSSIDLen;
  345. UINT_8 aucScanSSID[ELEM_MAX_LEN_SSID];
  346. UINT_32 u4ScanIELength;
  347. UINT_8 aucScanIEBuf[MAX_IE_LENGTH];
  348. /* Pending Request List */
  349. LINK_T rPendingReqList;
  350. /* Join Request Timestamp */
  351. OS_SYSTIME rJoinReqTime;
  352. /* for cfg80211 REMAIN_ON_CHANNEL support */
  353. AIS_REQ_CHNL_INFO rChReqInfo;
  354. /* Mgmt tx related. */
  355. AIS_MGMT_TX_REQ_INFO_T rMgmtTxInfo;
  356. /* Packet filter for AIS module. */
  357. UINT_32 u4AisPacketFilter;
  358. } AIS_FSM_INFO_T, *P_AIS_FSM_INFO_T;
  359. /*******************************************************************************
  360. * P U B L I C D A T A
  361. ********************************************************************************
  362. */
  363. /*******************************************************************************
  364. * P R I V A T E D A T A
  365. ********************************************************************************
  366. */
  367. /*******************************************************************************
  368. * M A C R O S
  369. ********************************************************************************
  370. */
  371. #define aisChangeMediaState(_prAdapter, _eNewMediaState) \
  372. (_prAdapter->rWifiVar.arBssInfo[NETWORK_TYPE_AIS_INDEX].eConnectionState = (_eNewMediaState))
  373. /*******************************************************************************
  374. * F U N C T I O N D E C L A R A T I O N S
  375. ********************************************************************************
  376. */
  377. VOID aisInitializeConnectionSettings(IN P_ADAPTER_T prAdapter, IN P_REG_INFO_T prRegInfo);
  378. VOID aisFsmInit(IN P_ADAPTER_T prAdapter);
  379. VOID aisFsmUninit(IN P_ADAPTER_T prAdapter);
  380. VOID aisFsmStateInit_JOIN(IN P_ADAPTER_T prAdapter, P_BSS_DESC_T prBssDesc);
  381. BOOLEAN aisFsmStateInit_RetryJOIN(IN P_ADAPTER_T prAdapter, IN P_STA_RECORD_T prStaRec);
  382. VOID aisFsmStateInit_IBSS_ALONE(IN P_ADAPTER_T prAdapter);
  383. VOID aisFsmStateInit_IBSS_MERGE(IN P_ADAPTER_T prAdapter, P_BSS_DESC_T prBssDesc);
  384. VOID aisFsmStateAbort(IN P_ADAPTER_T prAdapter, UINT_8 ucReasonOfDisconnect, BOOLEAN fgDelayIndication);
  385. VOID aisFsmStateAbort_JOIN(IN P_ADAPTER_T prAdapter);
  386. VOID aisFsmStateAbort_SCAN(IN P_ADAPTER_T prAdapter);
  387. VOID aisFsmStateAbort_NORMAL_TR(IN P_ADAPTER_T prAdapter);
  388. VOID aisFsmStateAbort_IBSS(IN P_ADAPTER_T prAdapter);
  389. VOID aisFsmSteps(IN P_ADAPTER_T prAdapter, ENUM_AIS_STATE_T eNextState);
  390. /*----------------------------------------------------------------------------*/
  391. /* Mailbox Message Handling */
  392. /*----------------------------------------------------------------------------*/
  393. VOID aisFsmRunEventScanDone(IN P_ADAPTER_T prAdapter, IN P_MSG_HDR_T prMsgHdr);
  394. VOID aisFsmRunEventAbort(IN P_ADAPTER_T prAdapter, IN P_MSG_HDR_T prMsgHdr);
  395. VOID aisFsmRunEventJoinComplete(IN P_ADAPTER_T prAdapter, IN P_MSG_HDR_T prMsgHdr);
  396. VOID aisFsmRunEventFoundIBSSPeer(IN P_ADAPTER_T prAdapter, IN P_MSG_HDR_T prMsgHdr);
  397. VOID aisFsmRunEventRemainOnChannel(IN P_ADAPTER_T prAdapter, IN P_MSG_HDR_T prMsgHdr);
  398. VOID aisFsmRunEventCancelRemainOnChannel(IN P_ADAPTER_T prAdapter, IN P_MSG_HDR_T prMsgHdr);
  399. /*----------------------------------------------------------------------------*/
  400. /* Handling for Ad-Hoc Network */
  401. /*----------------------------------------------------------------------------*/
  402. VOID aisFsmCreateIBSS(IN P_ADAPTER_T prAdapter);
  403. VOID aisFsmMergeIBSS(IN P_ADAPTER_T prAdapter, IN P_STA_RECORD_T prStaRec);
  404. /*----------------------------------------------------------------------------*/
  405. /* Handling of Incoming Mailbox Message from CNM */
  406. /*----------------------------------------------------------------------------*/
  407. VOID aisFsmRunEventChGrant(IN P_ADAPTER_T prAdapter, IN P_MSG_HDR_T prMsgHdr);
  408. /*----------------------------------------------------------------------------*/
  409. /* Generating Outgoing Mailbox Message to CNM */
  410. /*----------------------------------------------------------------------------*/
  411. VOID aisFsmReleaseCh(IN P_ADAPTER_T prAdapter);
  412. /*----------------------------------------------------------------------------*/
  413. /* Event Indication */
  414. /*----------------------------------------------------------------------------*/
  415. VOID
  416. aisIndicationOfMediaStateToHost(IN P_ADAPTER_T prAdapter,
  417. ENUM_PARAM_MEDIA_STATE_T eConnectionState, BOOLEAN fgDelayIndication);
  418. VOID aisPostponedEventOfDisconnTimeout(IN P_ADAPTER_T prAdapter, P_AIS_FSM_INFO_T prAisFsmInfo);
  419. VOID aisUpdateBssInfoForJOIN(IN P_ADAPTER_T prAdapter, P_STA_RECORD_T prStaRec, P_SW_RFB_T prAssocRspSwRfb);
  420. VOID aisUpdateBssInfoForCreateIBSS(IN P_ADAPTER_T prAdapter);
  421. VOID aisUpdateBssInfoForMergeIBSS(IN P_ADAPTER_T prAdapter, IN P_STA_RECORD_T prStaRec);
  422. BOOLEAN aisValidateProbeReq(IN P_ADAPTER_T prAdapter, IN P_SW_RFB_T prSwRfb, OUT PUINT_32 pu4ControlFlags);
  423. WLAN_STATUS
  424. aisFsmRunEventMgmtFrameTxDone(IN P_ADAPTER_T prAdapter,
  425. IN P_MSDU_INFO_T prMsduInfo, IN ENUM_TX_RESULT_CODE_T rTxDoneStatus);
  426. /*----------------------------------------------------------------------------*/
  427. /* Disconnection Handling */
  428. /*----------------------------------------------------------------------------*/
  429. VOID aisFsmDisconnect(IN P_ADAPTER_T prAdapter, IN BOOLEAN fgDelayIndication);
  430. /*----------------------------------------------------------------------------*/
  431. /* Event Handling */
  432. /*----------------------------------------------------------------------------*/
  433. VOID aisBssBeaconTimeout(IN P_ADAPTER_T prAdapter);
  434. VOID aisBssSecurityChanged(IN P_ADAPTER_T prAdapter);
  435. WLAN_STATUS
  436. aisDeauthXmitComplete(IN P_ADAPTER_T prAdapter, IN P_MSDU_INFO_T prMsduInfo, IN ENUM_TX_RESULT_CODE_T rTxDoneStatus);
  437. #if CFG_SUPPORT_ROAMING
  438. VOID aisFsmRunEventRoamingDiscovery(IN P_ADAPTER_T prAdapter, UINT_32 u4ReqScan);
  439. ENUM_AIS_STATE_T aisFsmRoamingScanResultsUpdate(IN P_ADAPTER_T prAdapter);
  440. VOID aisFsmRoamingDisconnectPrevAP(IN P_ADAPTER_T prAdapter, IN P_STA_RECORD_T prTargetStaRec);
  441. VOID aisUpdateBssInfoForRoamingAP(IN P_ADAPTER_T prAdapter, IN P_STA_RECORD_T prStaRec, IN P_SW_RFB_T prAssocRspSwRfb);
  442. #endif /*CFG_SUPPORT_ROAMING */
  443. /*----------------------------------------------------------------------------*/
  444. /* Timeout Handling */
  445. /*----------------------------------------------------------------------------*/
  446. VOID aisFsmRunEventBGSleepTimeOut(IN P_ADAPTER_T prAdapter, ULONG ulParam);
  447. VOID aisFsmRunEventIbssAloneTimeOut(IN P_ADAPTER_T prAdapter, ULONG ulParam);
  448. VOID aisFsmRunEventJoinTimeout(IN P_ADAPTER_T prAdapter, ULONG ulParam);
  449. VOID aisFsmRunEventChannelTimeout(IN P_ADAPTER_T prAdapter, ULONG ulParam);
  450. VOID aisFsmRunEventScanDoneTimeOut(IN P_ADAPTER_T prAdapter, ULONG ulParam);
  451. VOID aisFsmRunEventDeauthTimeout(IN P_ADAPTER_T prAdapter, ULONG ulParam);
  452. /*----------------------------------------------------------------------------*/
  453. /* OID/IOCTL Handling */
  454. /*----------------------------------------------------------------------------*/
  455. VOID aisFsmScanRequest(IN P_ADAPTER_T prAdapter, IN P_PARAM_SSID_T prSsid, IN PUINT_8 pucIe, IN UINT_32 u4IeLength);
  456. /*----------------------------------------------------------------------------*/
  457. /* Internal State Checking */
  458. /*----------------------------------------------------------------------------*/
  459. BOOLEAN aisFsmIsRequestPending(IN P_ADAPTER_T prAdapter, IN ENUM_AIS_REQUEST_TYPE_T eReqType, IN BOOLEAN bRemove);
  460. P_AIS_REQ_HDR_T aisFsmGetNextRequest(IN P_ADAPTER_T prAdapter);
  461. BOOLEAN aisFsmInsertRequest(IN P_ADAPTER_T prAdapter, IN ENUM_AIS_REQUEST_TYPE_T eReqType);
  462. VOID aisFsmFlushRequest(IN P_ADAPTER_T prAdapter);
  463. WLAN_STATUS
  464. aisFuncTxMgmtFrame(IN P_ADAPTER_T prAdapter,
  465. IN P_AIS_MGMT_TX_REQ_INFO_T prMgmtTxReqInfo, IN P_MSDU_INFO_T prMgmtTxMsdu, IN UINT_64 u8Cookie);
  466. VOID aisFsmRunEventMgmtFrameTx(IN P_ADAPTER_T prAdapter, IN P_MSG_HDR_T prMsgHdr);
  467. VOID aisFuncValidateRxActionFrame(IN P_ADAPTER_T prAdapter, IN P_SW_RFB_T prSwRfb);
  468. #if defined(CFG_TEST_MGMT_FSM) && (CFG_TEST_MGMT_FSM != 0)
  469. VOID aisTest(VOID);
  470. #endif /* CFG_TEST_MGMT_FSM */
  471. /*******************************************************************************
  472. * F U N C T I O N S
  473. ********************************************************************************
  474. */
  475. #endif /* _AIS_FSM_H */