scan.h 33 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004
  1. /*
  2. ** Id: @(#)
  3. */
  4. /*! \file "scan.h"
  5. \brief
  6. */
  7. /*
  8. ** Log: scan.h
  9. **
  10. ** 04 21 2014 eason.tsai
  11. ** [ALPS01511962] [WFD][Case Fail]Device can't connect to another AP successfully after connect to WFD.
  12. ** BSS descipt timeout set 10s , or it would always trigger full channel scan before connection and
  13. ** and connection fail
  14. **
  15. ** 03 12 2014 eason.tsai
  16. ** [ALPS01070904] [Need Patch] [Volunteer Patch][MT6630][Driver]MT6630 Wi-Fi Patch
  17. ** revise for cfg80211 disconnect because of timeout
  18. **
  19. ** 08 15 2013 cp.wu
  20. ** [BORA00002253] [MT6630 Wi-Fi][Driver][Firmware] Add NLO and timeout mechanism to SCN module
  21. ** enlarge match_ssid_num to 16 for PNO support
  22. **
  23. ** 08 09 2013 cp.wu
  24. ** [BORA00002253] [MT6630 Wi-Fi][Driver][Firmware] Add NLO and timeout mechanism to SCN module
  25. ** 1. integrate scheduled scan functionality
  26. ** 2. condition compilation for linux-3.4 & linux-3.8 compatibility
  27. ** 3. correct CMD queue access to reduce lock scope
  28. **
  29. ** 04 30 2013 eason.tsai
  30. ** [BORA00002255] [MT6630 Wi-Fi][Driver] develop
  31. ** update 11ac channel setting
  32. **
  33. ** 01 22 2013 cp.wu
  34. ** [BORA00002253] [MT6630 Wi-Fi][Driver][Firmware] Add NLO and timeout mechanism to SCN module
  35. ** .add driver side NLO state machine
  36. **
  37. ** 01 22 2013 cp.wu
  38. ** [BORA00002253] [MT6630 Wi-Fi][Driver][Firmware] Add NLO and timeout mechanism to SCN module
  39. ** modification for ucBssIndex migration
  40. **
  41. ** 01 17 2013 cm.chang
  42. ** [BORA00002149] [MT6630 Wi-Fi] Initial software development
  43. ** Use ucBssIndex to replace eNetworkTypeIndex
  44. **
  45. ** 01 03 2013 cp.wu
  46. ** [BORA00002253] [MT6630 Wi-Fi][Driver][Firmware] Add NLO and timeout mechanism to SCN module
  47. ** carry timeout value and channel dwell time value to scan module
  48. **
  49. ** 09 17 2012 cm.chang
  50. ** [BORA00002149] [MT6630 Wi-Fi] Initial software development
  51. ** Duplicate source from MT6620 v2.3 driver branch
  52. ** (Davinci label: MT6620_WIFI_Driver_V2_3_120913_1942_As_MT6630_Base)
  53. *
  54. * 01 16 2012 cp.wu
  55. * [MT6620 Wi-Fi][Driver] API and behavior modification for preferred band configuration
  56. * with corresponding network configuration
  57. * add wlanSetPreferBandByNetwork() for glue layer to invoke for setting
  58. * preferred band configuration corresponding to network type.
  59. *
  60. * 08 11 2011 cp.wu
  61. * [WCXRP00000830] [MT6620 Wi-Fi][Firmware] Use MDRDY counter to detect empty channel for shortening scan time
  62. * sparse channel detection:
  63. * driver: collect sparse channel information with scan-done event
  64. *
  65. * 07 18 2011 cp.wu
  66. * [WCXRP00000858] [MT5931][Driver][Firmware] Add support for scan to search for more than one SSID
  67. * in a single scanning request
  68. * add framework in driver domain for supporting new SCAN_REQ_V2 for more than 1 SSID
  69. * support as well as uProbeDelay in NDIS 6.x driver model
  70. *
  71. * 06 27 2011 cp.wu
  72. * [WCXRP00000815] [MT6620 Wi-Fi][Driver] allow single BSSID with multiple SSID settings
  73. * to work around some tricky AP which use space character as hidden SSID
  74. * allow to have a single BSSID with multiple SSID to be presented in scanning result
  75. *
  76. * 04 18 2011 terry.wu
  77. * [WCXRP00000660] [MT6620 Wi-Fi][Driver] Remove flag CFG_WIFI_DIRECT_MOVED
  78. * Remove flag CFG_WIFI_DIRECT_MOVED.
  79. *
  80. * 02 09 2011 wh.su
  81. * [WCXRP00000433] [MT6620 Wi-Fi][Driver] Remove WAPI structure define for avoid P2P module
  82. * with structure miss-align pointer issue
  83. * always pre-allio WAPI related structure for align p2p module.
  84. *
  85. * 01 14 2011 yuche.tsai
  86. * [WCXRP00000352] [Volunteer Patch][MT6620][Driver] P2P Statsion Record Client List Issue
  87. * Fix compile error.
  88. *
  89. * 09 08 2010 cp.wu
  90. * NULL
  91. * use static memory pool for storing IEs of scanning result.
  92. *
  93. * 09 03 2010 kevin.huang
  94. * NULL
  95. * Refine #include sequence and solve recursive/nested #include issue
  96. *
  97. * 08 31 2010 kevin.huang
  98. * NULL
  99. * Use LINK LIST operation to process SCAN result
  100. *
  101. * 08 30 2010 cp.wu
  102. * NULL
  103. * eliminate klockwork errors
  104. *
  105. * 08 16 2010 cp.wu
  106. * NULL
  107. * add interface for RLM to trigger OBSS-SCAN.
  108. *
  109. * 08 12 2010 yuche.tsai
  110. * NULL
  111. * Add a functio prototype to find p2p descriptor of a bss descriptor directly.
  112. *
  113. * 08 11 2010 yuche.tsai
  114. * NULL
  115. * Add function prototype for return channel.
  116. * modify data structure for scan specific device ID or TYPE. (Move from P2P Connection Settings to Scan Param)
  117. *
  118. * 08 05 2010 yuche.tsai
  119. * NULL
  120. * Check-in P2P Device Discovery Feature.
  121. *
  122. * 08 02 2010 yuche.tsai
  123. * NULL
  124. * P2P Group Negotiation Code Check in.
  125. *
  126. * 07 26 2010 yuche.tsai
  127. *
  128. * Add a option for channel time extension in scan abort command.
  129. *
  130. * 07 21 2010 yuche.tsai
  131. *
  132. * Add for P2P Scan Result Parsing & Saving.
  133. *
  134. * 07 19 2010 yuche.tsai
  135. *
  136. * Scan status "FIND" is used for P2P FSM find state.
  137. *
  138. * 07 19 2010 cp.wu
  139. *
  140. * [WPD00003833] [MT6620 and MT5931] Driver migration.
  141. * SCN module is now able to handle multiple concurrent scanning requests
  142. *
  143. * 07 14 2010 cp.wu
  144. *
  145. * [WPD00003833] [MT6620 and MT5931] Driver migration.
  146. * pass band with channel number information as scan parameter
  147. *
  148. * 07 14 2010 cp.wu
  149. *
  150. * [WPD00003833] [MT6620 and MT5931] Driver migration.
  151. * remove timer in DRV-SCN.
  152. *
  153. * 07 09 2010 cp.wu
  154. *
  155. * 1) separate AIS_FSM state for two kinds of scanning. (OID triggered scan, and scan-for-connection)
  156. * 2) eliminate PRE_BSS_DESC_T, Beacon/PrebResp is now parsed in single pass
  157. * 3) implment DRV-SCN module, currently only accepts single scan request, other request
  158. * will be directly dropped by returning BUSY
  159. *
  160. * 07 08 2010 cp.wu
  161. *
  162. * [WPD00003833] [MT6620 and MT5931] Driver migration - move to new repository.
  163. *
  164. * 07 01 2010 cp.wu
  165. * [WPD00003833][MT6620 and MT5931] Driver migration
  166. * add scan uninitialization procedure
  167. *
  168. * 07 01 2010 cp.wu
  169. * [WPD00003833][MT6620 and MT5931] Driver migration
  170. * implementation of DRV-SCN and related mailbox message handling.
  171. *
  172. * 06 25 2010 cp.wu
  173. * [WPD00003833][MT6620 and MT5931] Driver migration
  174. * modify Beacon/ProbeResp to complete parsing,
  175. * because host software has looser memory usage restriction
  176. *
  177. * 06 17 2010 yuche.tsai
  178. * [WPD00003839][MT6620 5931][P2P] Feature migration
  179. * Add P2P related field in SCAN_PARAM_T.
  180. *
  181. * 06 14 2010 cp.wu
  182. * [WPD00003833][MT6620 and MT5931] Driver migration
  183. * saa_fsm.c is migrated.
  184. *
  185. * 06 14 2010 cp.wu
  186. * [WPD00003833][MT6620 and MT5931] Driver migration
  187. * add management dispatching function table.
  188. *
  189. * 06 14 2010 cp.wu
  190. * [WPD00003833][MT6620 and MT5931] Driver migration
  191. * restore utility function invoking via hem_mbox to direct calls
  192. *
  193. * 06 11 2010 cp.wu
  194. * [WPD00003833][MT6620 and MT5931] Driver migration
  195. * auth.c is migrated.
  196. *
  197. * 06 10 2010 cp.wu
  198. * [WPD00003833][MT6620 and MT5931] Driver migration
  199. * add buildable & linkable ais_fsm.c
  200. *
  201. * related reference are still waiting to be resolved
  202. *
  203. * 06 07 2010 cp.wu
  204. * [WPD00003833][MT6620 and MT5931] Driver migration
  205. * add aa_fsm.h, ais_fsm.h, bss.h, mib.h and scan.h.
  206. *
  207. * 05 12 2010 kevin.huang
  208. * [BORA00000794][WIFISYS][New Feature]Power Management Support
  209. * Add Power Management - Legacy PS-POLL support.
  210. *
  211. * 04 13 2010 kevin.huang
  212. * [BORA00000663][WIFISYS][New Feature] AdHoc Mode Support
  213. *
  214. * Add new HW CH macro support
  215. *
  216. * 03 16 2010 kevin.huang
  217. * [BORA00000663][WIFISYS][New Feature] AdHoc Mode Support
  218. * Add AdHoc Mode
  219. *
  220. * 03 10 2010 kevin.huang
  221. * [BORA00000654][WIFISYS][New Feature] CNM Module - Ch Manager Support
  222. *
  223. * * * * * * Add Channel Manager for arbitration of JOIN and SCAN Req
  224. *
  225. * 02 26 2010 kevin.huang
  226. * [BORA00000603][WIFISYS] [New Feature] AAA Module Support
  227. * Modify scanBuildProbeReqFrameCommonIEs() to support P2P SCAN
  228. *
  229. * 02 23 2010 wh.su
  230. * [BORA00000592][MT6620 Wi-Fi] Adding the security related code for driver
  231. * refine the scan procedure, reduce the WPA and WAPI IE parsing, and move the parsing to the time for join.
  232. *
  233. * 02 23 2010 kevin.huang
  234. * [BORA00000603][WIFISYS] [New Feature] AAA Module Support
  235. * Add support scan channel 1~14 and update scan result's frequency infou1rwduu`wvpghlqg|n`slk+mpdkb
  236. *
  237. * 02 04 2010 kevin.huang
  238. * [BORA00000603][WIFISYS] [New Feature] AAA Module Support
  239. * Add AAA Module Support, Revise Net Type to Net Type Index for array lookup
  240. *
  241. * 01 27 2010 wh.su
  242. * [BORA00000476][Wi-Fi][firmware] Add the security module initialize code
  243. * add and fixed some security function.
  244. *
  245. * 01 07 2010 kevin.huang
  246. * [BORA00000018]Integrate WIFI part into BORA for the 1st time
  247. * [BORA00000018] Integrate WIFI part into BORA for the 1st time
  248. *
  249. * Simplify the process of Beacon during SCAN and remove redundant variable in PRE_BSS_DESC_T
  250. *
  251. * Dec 7 2009 mtk01088
  252. * [BORA00000476] [Wi-Fi][firmware] Add the security module initialize code
  253. * adding variable for wapi ap
  254. *
  255. * Dec 4 2009 mtk01088
  256. * [BORA00000476] [Wi-Fi][firmware] Add the security module initialize code
  257. * remove non-used secuirty variavle
  258. *
  259. * Dec 3 2009 mtk01461
  260. * [BORA00000018] Integrate WIFI part into BORA for the 1st time
  261. * Refine data structure of BSS_DESC_T and PRE_BSS_DESC_T
  262. *
  263. * Nov 24 2009 mtk01461
  264. * [BORA00000018] Integrate WIFI part into BORA for the 1st time
  265. * Add eNetType to rScanParam and revise MGMT Handler with Retain Status
  266. *
  267. * Nov 23 2009 mtk01461
  268. * [BORA00000018] Integrate WIFI part into BORA for the 1st time
  269. * Add ucAvailablePhyTypeSet to BSS_DESC_T
  270. *
  271. * Nov 20 2009 mtk01461
  272. * [BORA00000018] Integrate WIFI part into BORA for the 1st time
  273. * Add aucSrcAddress to SCAN_PARAM_T for P2P's Device Address
  274. *
  275. * Nov 19 2009 mtk01088
  276. * [BORA00000476] [Wi-Fi][firmware] Add the security module initialize code
  277. * adding the security related variable
  278. *
  279. * Nov 18 2009 mtk01088
  280. * [BORA00000476] [Wi-Fi][firmware] Add the security module initialize code
  281. * adding the security ie filed for scan parsing
  282. *
  283. * Nov 16 2009 mtk01461
  284. * [BORA00000018] Integrate WIFI part into BORA for the 1st time
  285. * Add scanSearchBssDescByPolicy()
  286. *
  287. * Nov 5 2009 mtk01461
  288. * [BORA00000018] Integrate WIFI part into BORA for the 1st time
  289. * Add function declarations of scan_fsm.c
  290. *
  291. * Oct 30 2009 mtk01461
  292. * [BORA00000018] Integrate WIFI part into BORA for the 1st time
  293. * Add scan.h to source control
  294. **
  295. */
  296. #ifndef _SCAN_H
  297. #define _SCAN_H
  298. /*******************************************************************************
  299. * C O M P I L E R F L A G S
  300. ********************************************************************************
  301. */
  302. /*******************************************************************************
  303. * E X T E R N A L R E F E R E N C E S
  304. ********************************************************************************
  305. */
  306. #include "gl_vendor.h"
  307. #include "cnm_timer.h"
  308. /*******************************************************************************
  309. * C O N S T A N T S
  310. ********************************************************************************
  311. */
  312. /*! Maximum buffer size of SCAN list */
  313. #define SCN_MAX_BUFFER_SIZE (CFG_MAX_NUM_BSS_LIST * ALIGN_4(sizeof(BSS_DESC_T)))
  314. #define SCN_RM_POLICY_EXCLUDE_CONNECTED BIT(0) /* Remove SCAN result except the connected one. */
  315. #define SCN_RM_POLICY_TIMEOUT BIT(1) /* Remove the timeout one */
  316. #define SCN_RM_POLICY_OLDEST_HIDDEN BIT(2) /* Remove the oldest one with hidden ssid */
  317. #define SCN_RM_POLICY_SMART_WEAKEST BIT(3) /* If there are more than half BSS which has the
  318. * same ssid as connection setting, remove the
  319. * weakest one from them
  320. * Else remove the weakest one.
  321. */
  322. #define SCN_RM_POLICY_ENTIRE BIT(4) /* Remove entire SCAN result */
  323. #define SCN_BSS_DESC_SAME_SSID_THRESHOLD 3 /* This is used by POLICY SMART WEAKEST,
  324. * If exceed this value, remove weakest BSS_DESC_T
  325. * with same SSID first in large network.
  326. */
  327. #if 1
  328. #define SCN_BSS_DESC_REMOVE_TIMEOUT_SEC 30
  329. #define SCN_BSS_DESC_STALE_SEC 10 /* 2.4G + 5G need 8.1s */
  330. #else
  331. #define SCN_BSS_DESC_REMOVE_TIMEOUT_SEC 5 /* Second. */
  332. /* This is used by POLICY TIMEOUT,
  333. * If exceed this value, remove timeout BSS_DESC_T.
  334. */
  335. #endif
  336. #define SCN_PROBE_DELAY_MSEC 0
  337. #define SCN_ADHOC_BSS_DESC_TIMEOUT_SEC 5 /* Second. */
  338. #define SCN_NLO_NETWORK_CHANNEL_NUM (4)
  339. #define SCAN_DONE_DIFFERENCE 3
  340. #define SCAN_DONE_TIMEOUT_THRESHOLD 3
  341. /*----------------------------------------------------------------------------*/
  342. /* MSG_SCN_SCAN_REQ */
  343. /*----------------------------------------------------------------------------*/
  344. #define SCAN_REQ_SSID_WILDCARD BIT(0)
  345. #define SCAN_REQ_SSID_P2P_WILDCARD BIT(1)
  346. #define SCAN_REQ_SSID_SPECIFIED BIT(2)
  347. /*----------------------------------------------------------------------------*/
  348. /* Support Multiple SSID SCAN */
  349. /*----------------------------------------------------------------------------*/
  350. #define SCN_SSID_MAX_NUM CFG_SCAN_SSID_MAX_NUM
  351. #define SCN_SSID_MATCH_MAX_NUM CFG_SCAN_SSID_MATCH_MAX_NUM
  352. #if CFG_SUPPORT_AGPS_ASSIST
  353. #define SCN_AGPS_AP_LIST_MAX_NUM 32
  354. #endif
  355. #define SCN_BSS_JOIN_FAIL_THRESOLD 4
  356. #define SCN_BSS_JOIN_FAIL_CNT_RESET_SEC 15
  357. #define SCN_BSS_JOIN_FAIL_RESET_STEP 2
  358. #if CFG_SUPPORT_BATCH_SCAN
  359. /*----------------------------------------------------------------------------*/
  360. /* SCAN_BATCH_REQ */
  361. /*----------------------------------------------------------------------------*/
  362. #define SCAN_BATCH_REQ_START BIT(0)
  363. #define SCAN_BATCH_REQ_STOP BIT(1)
  364. #define SCAN_BATCH_REQ_RESULT BIT(2)
  365. #endif
  366. #define SCAN_NLO_CHECK_SSID_ONLY 0x00000001
  367. #define SCAN_NLO_DEFAULT_INTERVAL 30000
  368. #define SWC_NUM_BSSID_THRESHOLD_DEFAULT 8
  369. #define SWC_RSSI_WINDSIZE_DEFAULT 8
  370. #define LOST_AP_WINDOW 16
  371. #define MAX_CHANNEL_NUM_PER_BUCKETS 8
  372. /*******************************************************************************
  373. * D A T A T Y P E S
  374. ********************************************************************************
  375. */
  376. typedef enum _ENUM_SCAN_TYPE_T {
  377. SCAN_TYPE_PASSIVE_SCAN = 0,
  378. SCAN_TYPE_ACTIVE_SCAN,
  379. SCAN_TYPE_NUM
  380. } ENUM_SCAN_TYPE_T, *P_ENUM_SCAN_TYPE_T;
  381. typedef enum _ENUM_SCAN_STATE_T {
  382. SCAN_STATE_IDLE = 0,
  383. SCAN_STATE_SCANNING,
  384. SCAN_STATE_NUM
  385. } ENUM_SCAN_STATE_T;
  386. typedef enum _ENUM_FW_SCAN_STATE_T {
  387. FW_SCAN_STATE_IDLE = 0, /* 0 */
  388. FW_SCAN_STATE_SCAN_START, /* 1 */
  389. FW_SCAN_STATE_REQ_CHANNEL, /* 2 */
  390. FW_SCAN_STATE_SET_CHANNEL, /* 3 */
  391. FW_SCAN_STATE_DELAYED_ACTIVE_PROB_REQ, /* 4 */
  392. FW_SCAN_STATE_ACTIVE_PROB_REQ, /* 5 */
  393. FW_SCAN_STATE_LISTEN, /* 6 */
  394. FW_SCAN_STATE_SCAN_DONE, /* 7 */
  395. FW_SCAN_STATE_NLO_START, /* 8 */
  396. FW_SCAN_STATE_NLO_HIT_CHECK, /* 9 */
  397. FW_SCAN_STATE_NLO_STOP, /* 10 */
  398. FW_SCAN_STATE_BATCH_START, /* 11 */
  399. FW_SCAN_STATE_BATCH_CHECK, /* 12 */
  400. FW_SCAN_STATE_BATCH_STOP, /* 13 */
  401. FW_SCAN_STATE_NUM /* 14 */
  402. } ENUM_FW_SCAN_STATE_T;
  403. typedef enum _ENUM_SCAN_CHANNEL_T {
  404. SCAN_CHANNEL_FULL = 0,
  405. SCAN_CHANNEL_2G4,
  406. SCAN_CHANNEL_5G,
  407. SCAN_CHANNEL_P2P_SOCIAL,
  408. SCAN_CHANNEL_SPECIFIED,
  409. SCAN_CHANNEL_NUM
  410. } ENUM_SCAN_CHANNEL, *P_ENUM_SCAN_CHANNEL;
  411. typedef struct _MSG_SCN_FSM_T {
  412. MSG_HDR_T rMsgHdr; /* Must be the first member */
  413. UINT_32 u4Dummy;
  414. } MSG_SCN_FSM_T, *P_MSG_SCN_FSM_T;
  415. typedef enum _ENUM_PSCAN_STATE_T {
  416. PSCN_IDLE = 1,
  417. PSCN_SCANNING,
  418. PSCN_RESET,
  419. PSCAN_STATE_T_NUM
  420. } ENUM_PSCAN_STATE_T;
  421. /*----------------------------------------------------------------------------*/
  422. /* BSS Descriptors */
  423. /*----------------------------------------------------------------------------*/
  424. struct _BSS_DESC_T {
  425. LINK_ENTRY_T rLinkEntry;
  426. UINT_8 aucBSSID[MAC_ADDR_LEN];
  427. UINT_8 aucSrcAddr[MAC_ADDR_LEN]; /* For IBSS, the SrcAddr is different from BSSID */
  428. BOOLEAN fgIsConnecting; /* If we are going to connect to this BSS
  429. * (JOIN or ROAMING to another BSS), don't
  430. * remove this record from BSS List.
  431. */
  432. BOOLEAN fgIsConnected; /* If we have connected to this BSS (NORMAL_TR),
  433. * don't removed this record from BSS list.
  434. */
  435. BOOLEAN fgIsHiddenSSID; /* When this flag is TRUE, means the SSID
  436. * of this BSS is not known yet.
  437. */
  438. UINT_8 ucSSIDLen;
  439. UINT_8 aucSSID[ELEM_MAX_LEN_SSID];
  440. OS_SYSTIME rUpdateTime;
  441. ENUM_BSS_TYPE_T eBSSType;
  442. UINT_16 u2CapInfo;
  443. UINT_16 u2BeaconInterval;
  444. UINT_16 u2ATIMWindow;
  445. UINT_16 u2OperationalRateSet;
  446. UINT_16 u2BSSBasicRateSet;
  447. BOOLEAN fgIsUnknownBssBasicRate;
  448. BOOLEAN fgIsERPPresent;
  449. BOOLEAN fgIsHTPresent;
  450. BOOLEAN fgIsVHTPresent;
  451. UINT_8 ucPhyTypeSet; /* Available PHY Type Set of this BSS */
  452. UINT_8 ucChannelNum;
  453. ENUM_CHNL_EXT_T eSco; /* Record bandwidth for association process
  454. Some AP will send association resp by 40MHz BW */
  455. ENUM_CHANNEL_WIDTH_T eChannelWidth; /*VHT operation ie */
  456. UINT_8 ucCenterFreqS1;
  457. UINT_8 ucCenterFreqS2;
  458. ENUM_BAND_T eBand;
  459. UINT_8 ucDTIMPeriod;
  460. BOOLEAN fgIsLargerTSF; /* This BSS's TimeStamp is larger than us(TCL == 1 in RX_STATUS_T) */
  461. UINT_8 ucRCPI;
  462. UINT_8 ucWmmFlag; /* A flag to indicate this BSS's WMM capability */
  463. /*! \brief The srbiter Search State will matched the scan result,
  464. and saved the selected cipher and akm, and report the score,
  465. for arbiter join state, join module will carry this target BSS
  466. to rsn generate ie function, for gen wpa/rsn ie */
  467. UINT_32 u4RsnSelectedGroupCipher;
  468. UINT_32 u4RsnSelectedPairwiseCipher;
  469. UINT_32 u4RsnSelectedAKMSuite;
  470. UINT_16 u2RsnCap;
  471. RSN_INFO_T rRSNInfo;
  472. RSN_INFO_T rWPAInfo;
  473. #if 1 /* CFG_SUPPORT_WAPI */
  474. WAPI_INFO_T rIEWAPI;
  475. BOOL fgIEWAPI;
  476. #endif
  477. BOOL fgIERSN;
  478. BOOL fgIEWPA;
  479. /*! \brief RSN parameters selected for connection */
  480. /*! \brief The Select score for final AP selection,
  481. 0, no sec, 1,2,3 group cipher is WEP, TKIP, CCMP */
  482. UINT_8 ucEncLevel;
  483. #if CFG_ENABLE_WIFI_DIRECT
  484. BOOLEAN fgIsP2PPresent;
  485. BOOLEAN fgIsP2PReport; /* TRUE: report to upper layer */
  486. P_P2P_DEVICE_DESC_T prP2pDesc;
  487. UINT_8 aucIntendIfAddr[MAC_ADDR_LEN]; /* For IBSS, the SrcAddr is different from BSSID */
  488. /* UINT_8 ucDevCapabilityBitmap; *//* Device Capability Attribute. (P2P_DEV_CAPABILITY_XXXX) */
  489. /* UINT_8 ucGroupCapabilityBitmap; *//* Group Capability Attribute. (P2P_GROUP_CAPABILITY_XXXX) */
  490. LINK_T rP2pDeviceList;
  491. /* P_LINK_T prP2pDeviceList; */
  492. /* For
  493. * 1. P2P Capability.
  494. * 2. P2P Device ID. ( in aucSrcAddr[] )
  495. * 3. NOA (TODO:)
  496. * 4. Extend Listen Timing. (Probe Rsp) (TODO:)
  497. * 5. P2P Device Info. (Probe Rsp)
  498. * 6. P2P Group Info. (Probe Rsp)
  499. */
  500. #endif
  501. BOOLEAN fgIsIEOverflow; /* The received IE length exceed the maximum IE buffer size */
  502. UINT_16 u2RawLength; /* The byte count of aucRawBuf[] */
  503. UINT_16 u2IELength; /* The byte count of aucIEBuf[] */
  504. ULARGE_INTEGER u8TimeStamp; /* Place u8TimeStamp before aucIEBuf[1] to force DW align */
  505. UINT_8 aucRawBuf[CFG_RAW_BUFFER_SIZE];
  506. UINT_8 aucIEBuf[CFG_IE_BUFFER_SIZE];
  507. UINT_8 ucJoinFailureCount;
  508. OS_SYSTIME rJoinFailTime;
  509. };
  510. typedef struct _SCAN_PARAM_T { /* Used by SCAN FSM */
  511. /* Active or Passive */
  512. ENUM_SCAN_TYPE_T eScanType;
  513. /* Network Type */
  514. UINT_8 ucBssIndex;
  515. /* Specified SSID Type */
  516. UINT_8 ucSSIDType;
  517. UINT_8 ucSSIDNum;
  518. /* Length of Specified SSID */
  519. UINT_8 ucSpecifiedSSIDLen[SCN_SSID_MAX_NUM];
  520. /* Specified SSID */
  521. UINT_8 aucSpecifiedSSID[SCN_SSID_MAX_NUM][ELEM_MAX_LEN_SSID];
  522. #if CFG_ENABLE_WIFI_DIRECT
  523. BOOLEAN fgFindSpecificDev; /* P2P: Discovery Protocol */
  524. UINT_8 aucDiscoverDevAddr[MAC_ADDR_LEN];
  525. BOOLEAN fgIsDevType;
  526. P2P_DEVICE_TYPE_T rDiscoverDevType;
  527. /* TODO: Find Specific Device Type. */
  528. #endif /* CFG_SUPPORT_P2P */
  529. UINT_16 u2ChannelDwellTime;
  530. UINT_16 u2TimeoutValue;
  531. BOOLEAN fgIsObssScan;
  532. BOOLEAN fgIsScanV2;
  533. /* Run time flags */
  534. UINT_16 u2ProbeDelayTime;
  535. /* channel information */
  536. ENUM_SCAN_CHANNEL eScanChannel;
  537. UINT_8 ucChannelListNum;
  538. RF_CHANNEL_INFO_T arChnlInfoList[MAXIMUM_OPERATION_CHANNEL_LIST];
  539. /* Feedback information */
  540. UINT_8 ucSeqNum;
  541. /* Information Element */
  542. UINT_16 u2IELen;
  543. UINT_8 aucIE[MAX_IE_LENGTH];
  544. } SCAN_PARAM_T, *P_SCAN_PARAM_T;
  545. typedef struct _NLO_PARAM_T { /* Used by SCAN FSM */
  546. SCAN_PARAM_T rScanParam;
  547. /* NLO */
  548. BOOLEAN fgStopAfterIndication;
  549. UINT_8 ucFastScanIteration;
  550. UINT_16 u2FastScanPeriod;
  551. UINT_16 u2SlowScanPeriod;
  552. /* Match SSID */
  553. UINT_8 ucMatchSSIDNum;
  554. UINT_8 ucMatchSSIDLen[SCN_SSID_MATCH_MAX_NUM];
  555. UINT_8 aucMatchSSID[SCN_SSID_MATCH_MAX_NUM][ELEM_MAX_LEN_SSID];
  556. UINT_8 aucCipherAlgo[SCN_SSID_MATCH_MAX_NUM];
  557. UINT_16 au2AuthAlgo[SCN_SSID_MATCH_MAX_NUM];
  558. UINT_8 aucChannelHint[SCN_SSID_MATCH_MAX_NUM][SCN_NLO_NETWORK_CHANNEL_NUM];
  559. } NLO_PARAM_T, *P_NLO_PARAM_T;
  560. typedef struct _PSCN_PARAM_T {
  561. UINT_8 ucVersion;
  562. CMD_NLO_REQ rCurrentCmdNloReq;
  563. CMD_BATCH_REQ_T rCurrentCmdBatchReq;
  564. CMD_GSCN_REQ_T rCurrentCmdGscnReq;
  565. BOOLEAN fgNLOScnEnable;
  566. BOOLEAN fgBatchScnEnable;
  567. BOOLEAN fgGScnEnable;
  568. UINT_32 u4BasePeriod; /*GSCAN_ATTRIBUTE_BASE_PERIOD */
  569. } PSCN_PARAM_T, *P_PSCN_PARAM_T;
  570. typedef struct _SCAN_INFO_T {
  571. ENUM_SCAN_STATE_T eCurrentState; /* Store the STATE variable of SCAN FSM */
  572. OS_SYSTIME rLastScanCompletedTime;
  573. SCAN_PARAM_T rScanParam;
  574. NLO_PARAM_T rNloParam;
  575. UINT_32 u4NumOfBssDesc;
  576. UINT_8 aucScanBuffer[SCN_MAX_BUFFER_SIZE];
  577. LINK_T rBSSDescList;
  578. LINK_T rFreeBSSDescList;
  579. LINK_T rPendingMsgList;
  580. /* Sparse Channel Detection */
  581. BOOLEAN fgIsSparseChannelValid;
  582. RF_CHANNEL_INFO_T rSparseChannel;
  583. /* NLO scanning state tracking */
  584. BOOLEAN fgNloScanning;
  585. #if CFG_SUPPORT_SCN_PSCN
  586. BOOLEAN fgPscnOnnning;
  587. BOOLEAN fgGScnConfigSet;
  588. BOOLEAN fgGScnParamSet;
  589. P_PSCN_PARAM_T prPscnParam;
  590. ENUM_PSCAN_STATE_T eCurrentPSCNState;
  591. TIMER_T rWaitForGscanResutsTimer;
  592. BOOLEAN fgGscnGetResWaiting;
  593. #endif
  594. TIMER_T rScanDoneTimer;
  595. UINT_8 ucScanDoneTimeoutCnt;
  596. } SCAN_INFO_T, *P_SCAN_INFO_T;
  597. /* Incoming Mailbox Messages */
  598. typedef struct _MSG_SCN_SCAN_REQ_T {
  599. MSG_HDR_T rMsgHdr; /* Must be the first member */
  600. UINT_8 ucSeqNum;
  601. UINT_8 ucBssIndex;
  602. ENUM_SCAN_TYPE_T eScanType;
  603. UINT_8 ucSSIDType; /* BIT(0) wildcard / BIT(1) P2P-wildcard / BIT(2) specific */
  604. UINT_8 ucSSIDLength;
  605. UINT_8 aucSSID[PARAM_MAX_LEN_SSID];
  606. UINT_16 u2ChannelDwellTime; /* ms unit */
  607. UINT_16 u2TimeoutValue; /* ms unit */
  608. ENUM_SCAN_CHANNEL eScanChannel;
  609. UINT_8 ucChannelListNum;
  610. RF_CHANNEL_INFO_T arChnlInfoList[MAXIMUM_OPERATION_CHANNEL_LIST];
  611. UINT_16 u2IELen;
  612. UINT_8 aucIE[MAX_IE_LENGTH];
  613. } MSG_SCN_SCAN_REQ, *P_MSG_SCN_SCAN_REQ;
  614. typedef struct _MSG_SCN_SCAN_REQ_V2_T {
  615. MSG_HDR_T rMsgHdr; /* Must be the first member */
  616. UINT_8 ucSeqNum;
  617. UINT_8 ucBssIndex;
  618. ENUM_SCAN_TYPE_T eScanType;
  619. UINT_8 ucSSIDType; /* BIT(0) wildcard / BIT(1) P2P-wildcard / BIT(2) specific */
  620. UINT_8 ucSSIDNum;
  621. P_PARAM_SSID_T prSsid;
  622. UINT_16 u2ProbeDelay;
  623. UINT_16 u2ChannelDwellTime; /* In TU. 1024us. */
  624. UINT_16 u2TimeoutValue; /* ms unit */
  625. ENUM_SCAN_CHANNEL eScanChannel;
  626. UINT_8 ucChannelListNum;
  627. RF_CHANNEL_INFO_T arChnlInfoList[MAXIMUM_OPERATION_CHANNEL_LIST];
  628. UINT_16 u2IELen;
  629. UINT_8 aucIE[MAX_IE_LENGTH];
  630. } MSG_SCN_SCAN_REQ_V2, *P_MSG_SCN_SCAN_REQ_V2;
  631. typedef struct _MSG_SCN_SCAN_CANCEL_T {
  632. MSG_HDR_T rMsgHdr; /* Must be the first member */
  633. UINT_8 ucSeqNum;
  634. UINT_8 ucBssIndex;
  635. BOOLEAN fgIsChannelExt;
  636. } MSG_SCN_SCAN_CANCEL, *P_MSG_SCN_SCAN_CANCEL;
  637. typedef struct _tagOFFLOAD_NETWORK {
  638. UINT_8 aucSsid[ELEM_MAX_LEN_SSID];
  639. UINT_8 ucSsidLen;
  640. UINT_8 ucUnicastCipher; /* ENUM_NLO_CIPHER_ALGORITHM */
  641. UINT_16 u2AuthAlgo; /* ENUM_NLO_AUTH_ALGORITHM */
  642. UINT_8 aucChannelList[SCN_NLO_NETWORK_CHANNEL_NUM];
  643. } OFFLOAD_NETWORK, *P_OFFLOAD_NETWORK;
  644. typedef struct _MSG_SCN_NLO_REQ_T {
  645. MSG_HDR_T rMsgHdr; /* Must be the first member */
  646. BOOLEAN fgStopAfterIndication;
  647. UINT_8 ucSeqNum;
  648. UINT_8 ucBssIndex;
  649. UINT_32 u4FastScanPeriod;
  650. UINT_32 u4FastScanIterations;
  651. UINT_32 u4SlowScanPeriod;
  652. UINT_32 u4NumOfEntries;
  653. OFFLOAD_NETWORK arNetwork[CFG_SCAN_SSID_MAX_NUM];
  654. } MSG_SCN_NLO_REQ, *P_MSG_SCN_NLO_REQ;
  655. typedef struct _MSG_SCN_NLO_CANCEL_T {
  656. MSG_HDR_T rMsgHdr; /* Must be the first member */
  657. UINT_8 ucSeqNum;
  658. UINT_8 ucBssIndex;
  659. } MSG_SCN_NLO_CANCEL, *P_MSG_SCN_NLO_CANCEL;
  660. /* Outgoing Mailbox Messages */
  661. typedef enum _ENUM_SCAN_STATUS_T {
  662. SCAN_STATUS_DONE = 0,
  663. SCAN_STATUS_CANCELLED,
  664. SCAN_STATUS_FAIL,
  665. SCAN_STATUS_BUSY,
  666. SCAN_STATUS_NUM
  667. } ENUM_SCAN_STATUS, *P_ENUM_SCAN_STATUS;
  668. typedef struct _MSG_SCN_SCAN_DONE_T {
  669. MSG_HDR_T rMsgHdr; /* Must be the first member */
  670. UINT_8 ucSeqNum;
  671. UINT_8 ucBssIndex;
  672. ENUM_SCAN_STATUS eScanStatus;
  673. } MSG_SCN_SCAN_DONE, *P_MSG_SCN_SCAN_DONE;
  674. #if CFG_SUPPORT_AGPS_ASSIST
  675. typedef enum {
  676. AGPS_PHY_A,
  677. AGPS_PHY_B,
  678. AGPS_PHY_G,
  679. } AP_PHY_TYPE;
  680. typedef struct _AGPS_AP_INFO_T {
  681. UINT_8 aucBSSID[MAC_ADDR_LEN];
  682. INT_16 i2ApRssi; /* -127..128 */
  683. UINT_16 u2Channel; /* 0..256 */
  684. AP_PHY_TYPE ePhyType;
  685. } AGPS_AP_INFO_T, *P_AGPS_AP_INFO_T;
  686. typedef struct _AGPS_AP_LIST_T {
  687. UINT_8 ucNum;
  688. AGPS_AP_INFO_T arApInfo[SCN_AGPS_AP_LIST_MAX_NUM];
  689. } AGPS_AP_LIST_T, *P_AGPS_AP_LIST_T;
  690. #endif
  691. typedef enum _ENUM_NLO_STATUS_T {
  692. NLO_STATUS_FOUND = 0,
  693. NLO_STATUS_CANCELLED,
  694. NLO_STATUS_FAIL,
  695. NLO_STATUS_BUSY,
  696. NLO_STATUS_NUM
  697. } ENUM_NLO_STATUS, *P_ENUM_NLO_STATUS;
  698. typedef struct _MSG_SCN_NLO_DONE_T {
  699. MSG_HDR_T rMsgHdr; /* Must be the first member */
  700. UINT_8 ucSeqNum;
  701. UINT_8 ucBssIndex;
  702. ENUM_NLO_STATUS eNloStatus;
  703. } MSG_SCN_NLO_DONE, *P_MSG_SCN_NLO_DONE;
  704. /*******************************************************************************
  705. * P U B L I C D A T A
  706. ********************************************************************************
  707. */
  708. /*******************************************************************************
  709. * P R I V A T E D A T A
  710. ********************************************************************************
  711. */
  712. /*******************************************************************************
  713. * M A C R O S
  714. ********************************************************************************
  715. */
  716. /*******************************************************************************
  717. * F U N C T I O N D E C L A R A T I O N S
  718. ********************************************************************************
  719. */
  720. /*----------------------------------------------------------------------------*/
  721. /* Routines in scan.c */
  722. /*----------------------------------------------------------------------------*/
  723. VOID scnInit(IN P_ADAPTER_T prAdapter);
  724. VOID scnUninit(IN P_ADAPTER_T prAdapter);
  725. /* BSS-DESC Search */
  726. P_BSS_DESC_T scanSearchBssDescByBssid(IN P_ADAPTER_T prAdapter, IN UINT_8 aucBSSID[]);
  727. P_BSS_DESC_T
  728. scanSearchBssDescByBssidAndSsid(IN P_ADAPTER_T prAdapter,
  729. IN UINT_8 aucBSSID[], IN BOOLEAN fgCheckSsid, IN P_PARAM_SSID_T prSsid);
  730. P_BSS_DESC_T scanSearchBssDescByTA(IN P_ADAPTER_T prAdapter, IN UINT_8 aucSrcAddr[]);
  731. P_BSS_DESC_T
  732. scanSearchBssDescByTAAndSsid(IN P_ADAPTER_T prAdapter,
  733. IN UINT_8 aucSrcAddr[], IN BOOLEAN fgCheckSsid, IN P_PARAM_SSID_T prSsid);
  734. /* BSS-DESC Search - Alternative */
  735. P_BSS_DESC_T
  736. scanSearchExistingBssDesc(IN P_ADAPTER_T prAdapter,
  737. IN ENUM_BSS_TYPE_T eBSSType, IN UINT_8 aucBSSID[], IN UINT_8 aucSrcAddr[]);
  738. P_BSS_DESC_T
  739. scanSearchExistingBssDescWithSsid(IN P_ADAPTER_T prAdapter,
  740. IN ENUM_BSS_TYPE_T eBSSType,
  741. IN UINT_8 aucBSSID[],
  742. IN UINT_8 aucSrcAddr[], IN BOOLEAN fgCheckSsid, IN P_PARAM_SSID_T prSsid);
  743. /* BSS-DESC Allocation */
  744. P_BSS_DESC_T scanAllocateBssDesc(IN P_ADAPTER_T prAdapter);
  745. /* BSS-DESC Removal */
  746. VOID scanRemoveBssDescsByPolicy(IN P_ADAPTER_T prAdapter, IN UINT_32 u4RemovePolicy);
  747. VOID scanRemoveBssDescByBssid(IN P_ADAPTER_T prAdapter, IN UINT_8 aucBSSID[]);
  748. VOID scanRemoveBssDescByBandAndNetwork(IN P_ADAPTER_T prAdapter, IN ENUM_BAND_T eBand, IN UINT_8 ucBssIndex);
  749. /* BSS-DESC State Change */
  750. VOID scanRemoveConnFlagOfBssDescByBssid(IN P_ADAPTER_T prAdapter, IN UINT_8 aucBSSID[]);
  751. /* BSS-DESC Insertion - ALTERNATIVE */
  752. P_BSS_DESC_T scanAddToBssDesc(IN P_ADAPTER_T prAdapter, IN P_SW_RFB_T prSwRfb);
  753. WLAN_STATUS scanProcessBeaconAndProbeResp(IN P_ADAPTER_T prAdapter, IN P_SW_RFB_T prSWRfb);
  754. VOID
  755. scanBuildProbeReqFrameCommonIEs(IN P_MSDU_INFO_T prMsduInfo,
  756. IN PUINT_8 pucDesiredSsid, IN UINT_32 u4DesiredSsidLen, IN UINT_16 u2SupportedRateSet);
  757. WLAN_STATUS scanSendProbeReqFrames(IN P_ADAPTER_T prAdapter, IN P_SCAN_PARAM_T prScanParam);
  758. VOID scanUpdateBssDescForSearch(IN P_ADAPTER_T prAdapter, IN P_BSS_DESC_T prBssDesc);
  759. P_BSS_DESC_T scanSearchBssDescByPolicy(IN P_ADAPTER_T prAdapter, IN UINT_8 ucBssIndex);
  760. WLAN_STATUS scanAddScanResult(IN P_ADAPTER_T prAdapter, IN P_BSS_DESC_T prBssDesc, IN P_SW_RFB_T prSwRfb);
  761. VOID scanReportBss2Cfg80211(IN P_ADAPTER_T prAdapter, IN ENUM_BSS_TYPE_T eBSSType, IN P_BSS_DESC_T SpecificprBssDesc);
  762. /*----------------------------------------------------------------------------*/
  763. /* Routines in scan_fsm.c */
  764. /*----------------------------------------------------------------------------*/
  765. VOID scnFsmSteps(IN P_ADAPTER_T prAdapter, IN ENUM_SCAN_STATE_T eNextState);
  766. /*----------------------------------------------------------------------------*/
  767. /* Command Routines */
  768. /*----------------------------------------------------------------------------*/
  769. VOID scnSendScanReq(IN P_ADAPTER_T prAdapter);
  770. VOID scnSendScanReqV2(IN P_ADAPTER_T prAdapter);
  771. /*----------------------------------------------------------------------------*/
  772. /* RX Event Handling */
  773. /*----------------------------------------------------------------------------*/
  774. VOID scnEventScanDone(IN P_ADAPTER_T prAdapter, IN P_EVENT_SCAN_DONE prScanDone, BOOLEAN fgIsNewVersion);
  775. VOID scnEventNloDone(IN P_ADAPTER_T prAdapter, IN P_EVENT_NLO_DONE_T prNloDone);
  776. /*----------------------------------------------------------------------------*/
  777. /* Mailbox Message Handling */
  778. /*----------------------------------------------------------------------------*/
  779. VOID scnFsmMsgStart(IN P_ADAPTER_T prAdapter, IN P_MSG_HDR_T prMsgHdr);
  780. VOID scnFsmMsgAbort(IN P_ADAPTER_T prAdapter, IN P_MSG_HDR_T prMsgHdr);
  781. VOID scnFsmHandleScanMsg(IN P_ADAPTER_T prAdapter, IN P_MSG_SCN_SCAN_REQ prScanReqMsg);
  782. VOID scnFsmHandleScanMsgV2(IN P_ADAPTER_T prAdapter, IN P_MSG_SCN_SCAN_REQ_V2 prScanReqMsg);
  783. VOID scnFsmRemovePendingMsg(IN P_ADAPTER_T prAdapter, IN UINT_8 ucSeqNum, IN UINT_8 ucBssIndex);
  784. VOID scnFsmNloMsgStart(IN P_ADAPTER_T prAdapter, IN P_MSG_HDR_T prMsgHdr);
  785. VOID scnFsmNloMsgAbort(IN P_ADAPTER_T prAdapter, IN P_MSG_HDR_T prMsgHdr);
  786. VOID scnFsmHandleNloMsg(IN P_ADAPTER_T prAdapter, IN P_MSG_SCN_NLO_REQ prNloReqMsg);
  787. /*----------------------------------------------------------------------------*/
  788. /* Mailbox Message Generation */
  789. /*----------------------------------------------------------------------------*/
  790. VOID
  791. scnFsmGenerateScanDoneMsg(IN P_ADAPTER_T prAdapter,
  792. IN UINT_8 ucSeqNum, IN UINT_8 ucBssIndex, IN ENUM_SCAN_STATUS eScanStatus);
  793. /*----------------------------------------------------------------------------*/
  794. /* Query for sparse channel */
  795. /*----------------------------------------------------------------------------*/
  796. BOOLEAN scnQuerySparseChannel(IN P_ADAPTER_T prAdapter, P_ENUM_BAND_T prSparseBand, PUINT_8 pucSparseChannel);
  797. /*----------------------------------------------------------------------------*/
  798. /* OID/IOCTL Handling */
  799. /*----------------------------------------------------------------------------*/
  800. BOOLEAN
  801. scnFsmSchedScanRequest(IN P_ADAPTER_T prAdapter,
  802. IN UINT_8 ucSsidNum,
  803. IN P_PARAM_SSID_T prSsid, IN UINT_32 u4IeLength, IN PUINT_8 pucIe, IN UINT_16 u2Interval);
  804. BOOLEAN scnFsmSchedScanStopRequest(IN P_ADAPTER_T prAdapter);
  805. #if CFG_SUPPORT_PASSPOINT
  806. P_BSS_DESC_T scanSearchBssDescByBssidAndLatestUpdateTime(IN P_ADAPTER_T prAdapter, IN UINT_8 aucBSSID[]);
  807. #endif /* CFG_SUPPORT_PASSPOINT */
  808. #if CFG_SUPPORT_AGPS_ASSIST
  809. VOID scanReportScanResultToAgps(P_ADAPTER_T prAdapter);
  810. #endif
  811. BOOLEAN scnFsmPSCNAction(IN P_ADAPTER_T prAdapter, IN UINT_8 ucPscanAct);
  812. BOOLEAN scnFsmPSCNSetParam(IN P_ADAPTER_T prAdapter, IN P_CMD_SET_PSCAN_PARAM prCmdPscnParam);
  813. BOOLEAN scnFsmGSCNSetHotlist(IN P_ADAPTER_T prAdapter, IN P_CMD_SET_PSCAN_PARAM prCmdPscnParam);
  814. #if 0
  815. BOOLEAN scnFsmGSCNSetRssiSignificatn(IN P_ADAPTER_T prAdapter, IN P_CMD_SET_PSCAN_PARAM prCmdPscnParam);
  816. #endif
  817. BOOLEAN scnFsmPSCNAddSWCBssId(IN P_ADAPTER_T prAdapter, IN P_CMD_SET_PSCAN_ADD_SWC_BSSID prCmdPscnAddSWCBssId);
  818. BOOLEAN scnFsmPSCNSetMacAddr(IN P_ADAPTER_T prAdapter, IN P_CMD_SET_PSCAN_MAC_ADDR prCmdPscnSetMacAddr);
  819. #if 1
  820. BOOLEAN scnSetGSCNParam(IN P_ADAPTER_T prAdapter, IN P_PARAM_WIFI_GSCAN_CMD_PARAMS prCmdGscnParam);
  821. #else
  822. BOOLEAN scnSetGSCNParam(IN P_ADAPTER_T prAdapter, IN P_CMD_GSCN_REQ_T prCmdGscnParam);
  823. #endif
  824. BOOLEAN
  825. scnCombineParamsIntoPSCN(IN P_ADAPTER_T prAdapter,
  826. IN P_CMD_NLO_REQ prCmdNloReq,
  827. IN P_CMD_BATCH_REQ_T prCmdBatchReq,
  828. IN P_CMD_GSCN_REQ_T prCmdGscnReq,
  829. IN P_CMD_GSCN_SCN_COFIG_T prNewCmdGscnConfig,
  830. IN BOOLEAN fgRemoveNLOfromPSCN,
  831. IN BOOLEAN fgRemoveBatchSCNfromPSCN, IN BOOLEAN fgRemoveGSCNfromPSCN);
  832. BOOLEAN scnFsmSetGSCNConfig(IN P_ADAPTER_T prAdapter, IN P_CMD_GSCN_SCN_COFIG_T prCmdGscnScnConfig);
  833. BOOLEAN scnFsmGetGSCNResult(IN P_ADAPTER_T prAdapter, IN P_CMD_GET_GSCAN_RESULT_T prGetGscnScnResultCmd);
  834. BOOLEAN
  835. scnPSCNFsm(IN P_ADAPTER_T prAdapter,
  836. ENUM_PSCAN_STATE_T eNextPSCNState,
  837. IN P_CMD_NLO_REQ prCmdNloReq,
  838. IN P_CMD_BATCH_REQ_T prCmdBatchReq,
  839. IN P_CMD_GSCN_REQ_T prCmdGscnReq,
  840. IN P_CMD_GSCN_SCN_COFIG_T prNewCmdGscnConfig,
  841. IN BOOLEAN fgRemoveNLOfromPSCN,
  842. IN BOOLEAN fgRemoveBatchSCNfromPSCN, IN BOOLEAN fgRemoveGSCNfromPSCN, IN BOOLEAN fgEnableGSCN);
  843. VOID scnGscnGetResultReplyCheck(IN P_ADAPTER_T prAdapter);
  844. VOID scnGscnGetResultReplyCheckTimeout(IN P_ADAPTER_T prAdapter, ULONG ulParamPtr);
  845. VOID scnScanDoneTimeout(IN P_ADAPTER_T prAdapter, ULONG ulParamPtr);
  846. #endif /* _SCAN_H */