scan.h 33 KB

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