10 /*******************************************************************************
11 * Copyright (c) 2009 MediaTek Inc.
13 * All rights reserved. Copying, compilation, modification, distribution
14 * or any other use whatsoever of this material is strictly prohibited
15 * except in accordance with a Software License Agreement with
17 ********************************************************************************
20 /*******************************************************************************
23 * BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND
24 * AGREES THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK
25 * SOFTWARE") RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE
26 * PROVIDED TO BUYER ON AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY
27 * DISCLAIMS ANY AND ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT
28 * LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
29 * PARTICULAR PURPOSE OR NONINFRINGEMENT. NEITHER DOES MEDIATEK PROVIDE
30 * ANY WARRANTY WHATSOEVER WITH RESPECT TO THE SOFTWARE OF ANY THIRD PARTY
31 * WHICH MAY BE USED BY, INCORPORATED IN, OR SUPPLIED WITH THE MEDIATEK
32 * SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH THIRD PARTY FOR ANY
33 * WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE
34 * FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S SPECIFICATION OR TO
35 * CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
37 * BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
38 * LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL
39 * BE, AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT
40 * ISSUE, OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY
41 * BUYER TO MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
43 * THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
44 * WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT
45 * OF LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING
46 * THEREOF AND RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN
47 * FRANCISCO, CA, UNDER THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE
49 ********************************************************************************
56 * [MT6620 Wi-Fi][Driver] API and behavior modification for preferred band configuration with corresponding network configuration
57 * add wlanSetPreferBandByNetwork() for glue layer to invoke for setting preferred band configuration corresponding to network type.
60 * [WCXRP00000830] [MT6620 Wi-Fi][Firmware] Use MDRDY counter to detect empty channel for shortening scan time
61 * sparse channel detection:
62 * driver: collect sparse channel information with scan-done event
66 * [WCXRP00000858] [MT5931][Driver][Firmware] Add support for scan to search for more than one SSID in a single scanning request
67 * add framework in driver domain for supporting new SCAN_REQ_V2 for more than 1 SSID support as well as uProbeDelay in NDIS 6.x driver model
70 * [WCXRP00000815] [MT6620 Wi-Fi][Driver] allow single BSSID with multiple SSID settings to work around some tricky AP which use space character as hidden SSID
71 * allow to have a single BSSID with multiple SSID to be presented in scanning result
74 * [WCXRP00000660] [MT6620 Wi-Fi][Driver] Remove flag CFG_WIFI_DIRECT_MOVED
75 * Remove flag CFG_WIFI_DIRECT_MOVED.
78 * [WCXRP00000433] [MT6620 Wi-Fi][Driver] Remove WAPI structure define for avoid P2P module with structure miss-align pointer issue
79 * always pre-allio WAPI related structure for align p2p module.
81 * 01 14 2011 yuche.tsai
82 * [WCXRP00000352] [Volunteer Patch][MT6620][Driver] P2P Statsion Record Client List Issue
87 * use static memory pool for storing IEs of scanning result.
89 * 09 03 2010 kevin.huang
91 * Refine #include sequence and solve recursive/nested #include issue
93 * 08 31 2010 kevin.huang
95 * Use LINK LIST operation to process SCAN result
99 * eliminate klockwork errors
103 * add interface for RLM to trigger OBSS-SCAN.
105 * 08 12 2010 yuche.tsai
107 * Add a functio prototype to find p2p descriptor of a bss descriptor directly.
109 * 08 11 2010 yuche.tsai
111 * Add function prototype for return channel.
112 * modify data structure for scan specific device ID or TYPE. (Move from P2P Connection Settings to Scan Param)
114 * 08 05 2010 yuche.tsai
116 * Check-in P2P Device Discovery Feature.
118 * 08 02 2010 yuche.tsai
120 * P2P Group Negotiation Code Check in.
122 * 07 26 2010 yuche.tsai
124 * Add a option for channel time extention in scan abort command.
126 * 07 21 2010 yuche.tsai
128 * Add for P2P Scan Result Parsing & Saving.
130 * 07 19 2010 yuche.tsai
132 * Scan status "FIND" is used for P2P FSM find state.
136 * [WPD00003833] [MT6620 and MT5931] Driver migration.
137 * SCN module is now able to handle multiple concurrent scanning requests
141 * [WPD00003833] [MT6620 and MT5931] Driver migration.
142 * pass band with channel number information as scan parameter
146 * [WPD00003833] [MT6620 and MT5931] Driver migration.
147 * remove timer in DRV-SCN.
151 * 1) separate AIS_FSM state for two kinds of scanning. (OID triggered scan, and scan-for-connection)
152 * 2) eliminate PRE_BSS_DESC_T, Beacon/PrebResp is now parsed in single pass
153 * 3) implment DRV-SCN module, currently only accepts single scan request, other request will be directly dropped by returning BUSY
157 * [WPD00003833] [MT6620 and MT5931] Driver migration - move to new repository.
160 * [WPD00003833][MT6620 and MT5931] Driver migration
161 * add scan uninitialization procedure
164 * [WPD00003833][MT6620 and MT5931] Driver migration
165 * implementation of DRV-SCN and related mailbox message handling.
168 * [WPD00003833][MT6620 and MT5931] Driver migration
169 * modify Beacon/ProbeResp to complete parsing,
170 * because host software has looser memory usage restriction
172 * 06 17 2010 yuche.tsai
173 * [WPD00003839][MT6620 5931][P2P] Feature migration
174 * Add P2P related field in SCAN_PARAM_T.
177 * [WPD00003833][MT6620 and MT5931] Driver migration
178 * saa_fsm.c is migrated.
181 * [WPD00003833][MT6620 and MT5931] Driver migration
182 * add management dispatching function table.
185 * [WPD00003833][MT6620 and MT5931] Driver migration
186 * restore utility function invoking via hem_mbox to direct calls
189 * [WPD00003833][MT6620 and MT5931] Driver migration
190 * auth.c is migrated.
193 * [WPD00003833][MT6620 and MT5931] Driver migration
194 * add buildable & linkable ais_fsm.c
196 * related reference are still waiting to be resolved
199 * [WPD00003833][MT6620 and MT5931] Driver migration
200 * add aa_fsm.h, ais_fsm.h, bss.h, mib.h and scan.h.
202 * 05 12 2010 kevin.huang
203 * [BORA00000794][WIFISYS][New Feature]Power Management Support
204 * Add Power Management - Legacy PS-POLL support.
206 * 04 13 2010 kevin.huang
207 * [BORA00000663][WIFISYS][New Feature] AdHoc Mode Support
209 * Add new HW CH macro support
211 * 03 16 2010 kevin.huang
212 * [BORA00000663][WIFISYS][New Feature] AdHoc Mode Support
215 * 03 10 2010 kevin.huang
216 * [BORA00000654][WIFISYS][New Feature] CNM Module - Ch Manager Support
218 * * * * * * Add Channel Manager for arbitration of JOIN and SCAN Req
220 * 02 26 2010 kevin.huang
221 * [BORA00000603][WIFISYS] [New Feature] AAA Module Support
222 * Modify scanBuildProbeReqFrameCommonIEs() to support P2P SCAN
225 * [BORA00000592][MT6620 Wi-Fi] Adding the security related code for driver
226 * refine the scan procedure, reduce the WPA and WAPI IE parsing, and move the parsing to the time for join.
228 * 02 23 2010 kevin.huang
229 * [BORA00000603][WIFISYS] [New Feature] AAA Module Support
230 * Add support scan channel 1~14 and update scan result's frequency infou1rwduu`wvpghlqg|n`slk+mpdkb
232 * 02 04 2010 kevin.huang
233 * [BORA00000603][WIFISYS] [New Feature] AAA Module Support
234 * Add AAA Module Support, Revise Net Type to Net Type Index for array lookup
237 * [BORA00000476][Wi-Fi][firmware] Add the security module initialize code
238 * add and fixed some security function.
240 * 01 07 2010 kevin.huang
241 * [BORA00000018]Integrate WIFI part into BORA for the 1st time
242 * [BORA00000018] Integrate WIFI part into BORA for the 1st time
244 * Simplify the process of Beacon during SCAN and remove redundant variable in PRE_BSS_DESC_T
246 * Dec 7 2009 mtk01088
247 * [BORA00000476] [Wi-Fi][firmware] Add the security module initialize code
248 * adding variable for wapi ap
250 * Dec 4 2009 mtk01088
251 * [BORA00000476] [Wi-Fi][firmware] Add the security module initialize code
252 * remove non-used secuirty variavle
254 * Dec 3 2009 mtk01461
255 * [BORA00000018] Integrate WIFI part into BORA for the 1st time
256 * Refine data structure of BSS_DESC_T and PRE_BSS_DESC_T
258 * Nov 24 2009 mtk01461
259 * [BORA00000018] Integrate WIFI part into BORA for the 1st time
260 * Add eNetType to rScanParam and revise MGMT Handler with Retain Status
262 * Nov 23 2009 mtk01461
263 * [BORA00000018] Integrate WIFI part into BORA for the 1st time
264 * Add ucAvailablePhyTypeSet to BSS_DESC_T
266 * Nov 20 2009 mtk01461
267 * [BORA00000018] Integrate WIFI part into BORA for the 1st time
268 * Add aucSrcAddress to SCAN_PARAM_T for P2P's Device Address
270 * Nov 19 2009 mtk01088
271 * [BORA00000476] [Wi-Fi][firmware] Add the security module initialize code
272 * adding the security related variable
274 * Nov 18 2009 mtk01088
275 * [BORA00000476] [Wi-Fi][firmware] Add the security module initialize code
276 * adding the security ie filed for scan parsing
278 * Nov 16 2009 mtk01461
279 * [BORA00000018] Integrate WIFI part into BORA for the 1st time
280 * Add scanSearchBssDescByPolicy()
282 * Nov 5 2009 mtk01461
283 * [BORA00000018] Integrate WIFI part into BORA for the 1st time
284 * Add function declarations of scan_fsm.c
286 * Oct 30 2009 mtk01461
287 * [BORA00000018] Integrate WIFI part into BORA for the 1st time
288 * Add scan.h to source control
295 /*******************************************************************************
296 * C O M P I L E R F L A G S
297 ********************************************************************************
300 /*******************************************************************************
301 * E X T E R N A L R E F E R E N C E S
302 ********************************************************************************
305 /*******************************************************************************
307 ********************************************************************************
309 /*! Maximum buffer size of SCAN list */
310 #define SCN_MAX_BUFFER_SIZE (CFG_MAX_NUM_BSS_LIST * ALIGN_4(sizeof(BSS_DESC_T)))
312 #define SCN_RM_POLICY_EXCLUDE_CONNECTED BIT(0) // Remove SCAN result except the connected one.
313 #define SCN_RM_POLICY_TIMEOUT BIT(1) // Remove the timeout one
314 #define SCN_RM_POLICY_OLDEST_HIDDEN BIT(2) // Remove the oldest one with hidden ssid
315 #define SCN_RM_POLICY_SMART_WEAKEST BIT(3) /* If there are more than half BSS which has the
316 * same ssid as connection setting, remove the weakest one from them
317 * Else remove the weakest one.
319 #define SCN_RM_POLICY_ENTIRE BIT(4) // Remove entire SCAN result
321 #define SCN_BSS_DESC_SAME_SSID_THRESHOLD 3 /* This is used by POLICY SMART WEAKEST,
322 * If exceed this value, remove weakest BSS_DESC_T
323 * with same SSID first in large network.
326 #define SCN_BSS_DESC_REMOVE_TIMEOUT_SEC 5 // Second.
327 /* This is used by POLICY TIMEOUT,
328 * If exceed this value, remove timeout BSS_DESC_T.
334 #define SCN_PROBE_DELAY_MSEC 0
336 #define SCN_ADHOC_BSS_DESC_TIMEOUT_SEC 5 // Second.
338 /*----------------------------------------------------------------------------*/
339 /* MSG_SCN_SCAN_REQ */
340 /*----------------------------------------------------------------------------*/
341 #define SCAN_REQ_SSID_WILDCARD BIT(0)
342 #define SCAN_REQ_SSID_P2P_WILDCARD BIT(1)
343 #define SCAN_REQ_SSID_SPECIFIED BIT(2)
346 /*----------------------------------------------------------------------------*/
347 /* Support Multiple SSID SCAN */
348 /*----------------------------------------------------------------------------*/
349 #define SCN_SSID_MAX_NUM 4
352 /*******************************************************************************
354 ********************************************************************************
356 typedef enum _ENUM_SCAN_TYPE_T {
357 SCAN_TYPE_PASSIVE_SCAN = 0,
358 SCAN_TYPE_ACTIVE_SCAN,
360 } ENUM_SCAN_TYPE_T, *P_ENUM_SCAN_TYPE_T;
362 typedef enum _ENUM_SCAN_STATE_T {
368 typedef enum _ENUM_SCAN_CHANNEL_T {
369 SCAN_CHANNEL_FULL = 0,
372 SCAN_CHANNEL_P2P_SOCIAL,
373 SCAN_CHANNEL_SPECIFIED,
375 } ENUM_SCAN_CHANNEL, *P_ENUM_SCAN_CHANNEL;
377 typedef struct _MSG_SCN_FSM_T {
378 MSG_HDR_T rMsgHdr; /* Must be the first member */
380 } MSG_SCN_FSM_T, *P_MSG_SCN_FSM_T;
384 /*----------------------------------------------------------------------------*/
385 /* BSS Descriptors */
386 /*----------------------------------------------------------------------------*/
388 LINK_ENTRY_T rLinkEntry;
390 UINT_8 aucBSSID[MAC_ADDR_LEN];
391 UINT_8 aucSrcAddr[MAC_ADDR_LEN]; /* For IBSS, the SrcAddr is different from BSSID */
393 BOOLEAN fgIsConnecting; /* If we are going to connect to this BSS
394 * (JOIN or ROAMING to another BSS), don't
395 * remove this record from BSS List.
397 BOOLEAN fgIsConnected; /* If we have connected to this BSS (NORMAL_TR),
398 * don't removed this record from BSS list.
401 BOOLEAN fgIsHiddenSSID; /* When this flag is TRUE, means the SSID
402 * of this BSS is not known yet.
405 UINT_8 aucSSID[ELEM_MAX_LEN_SSID];
407 OS_SYSTIME rUpdateTime;
409 ENUM_BSS_TYPE_T eBSSType;
413 UINT_16 u2BeaconInterval;
414 UINT_16 u2ATIMWindow;
416 UINT_16 u2OperationalRateSet;
417 UINT_16 u2BSSBasicRateSet;
418 BOOLEAN fgIsUnknownBssBasicRate;
420 BOOLEAN fgIsERPPresent;
421 BOOLEAN fgIsHTPresent;
423 UINT_8 ucPhyTypeSet; /* Available PHY Type Set of this BSS */
427 ENUM_CHNL_EXT_T eSco; /* Record bandwidth for association process
428 Some AP will send association resp by 40MHz BW */
433 BOOLEAN fgIsLargerTSF; /* This BSS's TimeStamp is larger than us(TCL == 1 in RX_STATUS_T) */
436 #if CFG_SUPPORT_RSSI_SMOOTH
437 //------------------------------- jbx add 0508-------------------------------------------------
438 UINT_8 ucRCPI_pre_real;
440 UINT_8 ucRCPI_pre_fake;
441 //------------------------------- jbx add 0508-------------------------------------------------
443 UINT_8 ucWmmFlag; /* A flag to indicate this BSS's WMM capability */
445 /*! \brief The srbiter Search State will matched the scan result,
446 and saved the selected cipher and akm, and report the score,
447 for arbiter join state, join module will carry this target BSS
448 to rsn generate ie function, for gen wpa/rsn ie */
449 UINT_32 u4RsnSelectedGroupCipher;
450 UINT_32 u4RsnSelectedPairwiseCipher;
451 UINT_32 u4RsnSelectedAKMSuite;
457 #if 1//CFG_SUPPORT_WAPI
464 /*! \brief RSN parameters selected for connection */
465 /*! \brief The Select score for final AP selection,
466 0, no sec, 1,2,3 group cipher is WEP, TKIP, CCMP */
469 #if CFG_ENABLE_WIFI_DIRECT
470 BOOLEAN fgIsP2PPresent;
471 P_P2P_DEVICE_DESC_T prP2pDesc;
473 UINT_8 aucIntendIfAddr[MAC_ADDR_LEN]; /* For IBSS, the SrcAddr is different from BSSID */
474 // UINT_8 ucDevCapabilityBitmap; /* Device Capability Attribute. (P2P_DEV_CAPABILITY_XXXX) */
475 // UINT_8 ucGroupCapabilityBitmap; /* Group Capability Attribute. (P2P_GROUP_CAPABILITY_XXXX) */
477 LINK_T rP2pDeviceList;
479 // P_LINK_T prP2pDeviceList;
483 * 2. P2P Device ID. ( in aucSrcAddr[] )
485 * 4. Extend Listen Timing. (Probe Rsp) (TODO:)
486 * 5. P2P Device Info. (Probe Rsp)
487 * 6. P2P Group Info. (Probe Rsp)
491 BOOLEAN fgIsIEOverflow; /* The received IE length exceed the maximum IE buffer size */
492 UINT_16 u2IELength; /* The byte count of aucIEBuf[] */
494 ULARGE_INTEGER u8TimeStamp; /* Place u8TimeStamp before aucIEBuf[1] to force DW align */
496 UINT_8 aucIEBuf[CFG_IE_BUFFER_SIZE];
500 typedef struct _SCAN_PARAM_T { /* Used by SCAN FSM */
501 /* Active or Passive */
502 ENUM_SCAN_TYPE_T eScanType;
505 ENUM_NETWORK_TYPE_INDEX_T eNetTypeIndex;
507 /* Specified SSID Type */
511 /* Length of Specified SSID */
512 UINT_8 ucSpecifiedSSIDLen[SCN_SSID_MAX_NUM];
515 UINT_8 aucSpecifiedSSID[SCN_SSID_MAX_NUM][ELEM_MAX_LEN_SSID];
517 #if CFG_ENABLE_WIFI_DIRECT
518 BOOLEAN fgFindSpecificDev; /* P2P: Discovery Protocol */
519 UINT_8 aucDiscoverDevAddr[MAC_ADDR_LEN];
521 P2P_DEVICE_TYPE_T rDiscoverDevType;
523 UINT_16 u2PassiveListenInterval;
524 // TODO: Find Specific Device Type.
525 #endif /* CFG_SUPPORT_P2P */
527 BOOLEAN fgIsObssScan;
531 UINT_16 u2ProbeDelayTime;
533 /* channel information */
534 ENUM_SCAN_CHANNEL eScanChannel;
535 UINT_8 ucChannelListNum;
536 RF_CHANNEL_INFO_T arChnlInfoList[MAXIMUM_OPERATION_CHANNEL_LIST];
538 /* Feedback information */
541 /* Information Element */
543 UINT_8 aucIE[MAX_IE_LENGTH];
545 } SCAN_PARAM_T, *P_SCAN_PARAM_T;
547 typedef struct _SCAN_INFO_T {
548 ENUM_SCAN_STATE_T eCurrentState; /* Store the STATE variable of SCAN FSM */
550 OS_SYSTIME rLastScanCompletedTime;
552 SCAN_PARAM_T rScanParam;
554 UINT_32 u4NumOfBssDesc;
556 UINT_8 aucScanBuffer[SCN_MAX_BUFFER_SIZE];
560 LINK_T rFreeBSSDescList;
562 LINK_T rPendingMsgList;
564 /* Sparse Channel Detection */
565 BOOLEAN fgIsSparseChannelValid;
566 RF_CHANNEL_INFO_T rSparseChannel;
568 } SCAN_INFO_T, *P_SCAN_INFO_T;
571 /* Incoming Mailbox Messages */
572 typedef struct _MSG_SCN_SCAN_REQ_T {
573 MSG_HDR_T rMsgHdr; /* Must be the first member */
575 UINT_8 ucNetTypeIndex;
576 ENUM_SCAN_TYPE_T eScanType;
577 UINT_8 ucSSIDType; /* BIT(0) wildcard / BIT(1) P2P-wildcard / BIT(2) specific */
579 UINT_8 aucSSID[PARAM_MAX_LEN_SSID];
580 #if CFG_ENABLE_WIFI_DIRECT
581 UINT_16 u2ChannelDwellTime; /* In TU. 1024us. */
583 ENUM_SCAN_CHANNEL eScanChannel;
584 UINT_8 ucChannelListNum;
585 RF_CHANNEL_INFO_T arChnlInfoList[MAXIMUM_OPERATION_CHANNEL_LIST];
587 UINT_8 aucIE[MAX_IE_LENGTH];
588 } MSG_SCN_SCAN_REQ, *P_MSG_SCN_SCAN_REQ;
590 typedef struct _MSG_SCN_SCAN_REQ_V2_T {
591 MSG_HDR_T rMsgHdr; /* Must be the first member */
593 UINT_8 ucNetTypeIndex;
594 ENUM_SCAN_TYPE_T eScanType;
595 UINT_8 ucSSIDType; /* BIT(0) wildcard / BIT(1) P2P-wildcard / BIT(2) specific */
597 P_PARAM_SSID_T prSsid;
598 UINT_16 u2ProbeDelay;
599 UINT_16 u2ChannelDwellTime; /* In TU. 1024us. */
600 ENUM_SCAN_CHANNEL eScanChannel;
601 UINT_8 ucChannelListNum;
602 RF_CHANNEL_INFO_T arChnlInfoList[MAXIMUM_OPERATION_CHANNEL_LIST];
604 UINT_8 aucIE[MAX_IE_LENGTH];
605 } MSG_SCN_SCAN_REQ_V2, *P_MSG_SCN_SCAN_REQ_V2;
608 typedef struct _MSG_SCN_SCAN_CANCEL_T {
609 MSG_HDR_T rMsgHdr; /* Must be the first member */
611 UINT_8 ucNetTypeIndex;
612 #if CFG_ENABLE_WIFI_DIRECT
613 BOOLEAN fgIsChannelExt;
615 } MSG_SCN_SCAN_CANCEL, *P_MSG_SCN_SCAN_CANCEL;
617 /* Outgoing Mailbox Messages */
618 typedef enum _ENUM_SCAN_STATUS_T {
619 SCAN_STATUS_DONE = 0,
620 SCAN_STATUS_CANCELLED,
624 } ENUM_SCAN_STATUS, *P_ENUM_SCAN_STATUS;
626 typedef struct _MSG_SCN_SCAN_DONE_T {
627 MSG_HDR_T rMsgHdr; /* Must be the first member */
629 UINT_8 ucNetTypeIndex;
630 ENUM_SCAN_STATUS eScanStatus;
631 } MSG_SCN_SCAN_DONE, *P_MSG_SCN_SCAN_DONE;
633 /*******************************************************************************
634 * P U B L I C D A T A
635 ********************************************************************************
638 /*******************************************************************************
639 * P R I V A T E D A T A
640 ********************************************************************************
643 /*******************************************************************************
645 ********************************************************************************
648 /*******************************************************************************
649 * F U N C T I O N D E C L A R A T I O N S
650 ********************************************************************************
652 /*----------------------------------------------------------------------------*/
653 /* Routines in scan.c */
654 /*----------------------------------------------------------------------------*/
657 IN P_ADAPTER_T prAdapter
662 IN P_ADAPTER_T prAdapter
665 /* BSS-DESC Search */
667 scanSearchBssDescByBssid (
668 IN P_ADAPTER_T prAdapter,
673 scanSearchBssDescByBssidAndSsid (
674 IN P_ADAPTER_T prAdapter,
675 IN UINT_8 aucBSSID[],
676 IN BOOLEAN fgCheckSsid,
677 IN P_PARAM_SSID_T prSsid
681 scanSearchBssDescByTA (
682 IN P_ADAPTER_T prAdapter,
683 IN UINT_8 aucSrcAddr[]
687 scanSearchBssDescByTAAndSsid (
688 IN P_ADAPTER_T prAdapter,
689 IN UINT_8 aucSrcAddr[],
690 IN BOOLEAN fgCheckSsid,
691 IN P_PARAM_SSID_T prSsid
695 /* BSS-DESC Search - Alternative */
697 scanSearchExistingBssDesc (
698 IN P_ADAPTER_T prAdapter,
699 IN ENUM_BSS_TYPE_T eBSSType,
700 IN UINT_8 aucBSSID[],
701 IN UINT_8 aucSrcAddr[]
705 scanSearchExistingBssDescWithSsid (
706 IN P_ADAPTER_T prAdapter,
707 IN ENUM_BSS_TYPE_T eBSSType,
708 IN UINT_8 aucBSSID[],
709 IN UINT_8 aucSrcAddr[],
710 IN BOOLEAN fgCheckSsid,
711 IN P_PARAM_SSID_T prSsid
715 /* BSS-DESC Allocation */
717 scanAllocateBssDesc (
718 IN P_ADAPTER_T prAdapter
721 /* BSS-DESC Removal */
723 scanRemoveBssDescsByPolicy (
724 IN P_ADAPTER_T prAdapter,
725 IN UINT_32 u4RemovePolicy
729 scanRemoveBssDescByBssid (
730 IN P_ADAPTER_T prAdapter,
735 scanRemoveBssDescByBandAndNetwork (
736 IN P_ADAPTER_T prAdapter,
737 IN ENUM_BAND_T eBand,
738 IN ENUM_NETWORK_TYPE_INDEX_T eNetTypeIndex
741 /* BSS-DESC State Change */
743 scanRemoveConnFlagOfBssDescByBssid (
744 IN P_ADAPTER_T prAdapter,
749 /* BSS-DESC Insertion */
751 scanAddToInternalScanResult (
752 IN P_ADAPTER_T prAdapter,
753 IN P_SW_RFB_T prSWRfb,
754 IN P_BSS_DESC_T prBssDesc
758 /* BSS-DESC Insertion - ALTERNATIVE */
761 IN P_ADAPTER_T prAdapter,
762 IN P_SW_RFB_T prSwRfb
766 scanProcessBeaconAndProbeResp (
767 IN P_ADAPTER_T prAdapter,
768 IN P_SW_RFB_T prSWRfb
772 scanBuildProbeReqFrameCommonIEs (
773 IN P_MSDU_INFO_T prMsduInfo,
774 IN PUINT_8 pucDesiredSsid,
775 IN UINT_32 u4DesiredSsidLen,
776 IN UINT_16 u2SupportedRateSet
780 scanSendProbeReqFrames (
781 IN P_ADAPTER_T prAdapter,
782 IN P_SCAN_PARAM_T prScanParam
786 scanUpdateBssDescForSearch (
787 IN P_ADAPTER_T prAdapter,
788 IN P_BSS_DESC_T prBssDesc
792 scanSearchBssDescByPolicy (
793 IN P_ADAPTER_T prAdapter,
794 IN ENUM_NETWORK_TYPE_INDEX_T eNetTypeIndex
799 IN P_ADAPTER_T prAdapter,
800 IN P_BSS_DESC_T prBssDesc,
801 IN P_SW_RFB_T prSwRfb
804 /*----------------------------------------------------------------------------*/
805 /* Routines in scan_fsm.c */
806 /*----------------------------------------------------------------------------*/
809 IN P_ADAPTER_T prAdapter,
810 IN ENUM_SCAN_STATE_T eNextState
813 /*----------------------------------------------------------------------------*/
814 /* Command Routines */
815 /*----------------------------------------------------------------------------*/
818 IN P_ADAPTER_T prAdapter
823 IN P_ADAPTER_T prAdapter
826 /*----------------------------------------------------------------------------*/
827 /* RX Event Handling */
828 /*----------------------------------------------------------------------------*/
831 IN P_ADAPTER_T prAdapter,
832 IN P_EVENT_SCAN_DONE prScanDone
835 /*----------------------------------------------------------------------------*/
836 /* Mailbox Message Handling */
837 /*----------------------------------------------------------------------------*/
840 IN P_ADAPTER_T prAdapter,
841 IN P_MSG_HDR_T prMsgHdr
846 IN P_ADAPTER_T prAdapter,
847 IN P_MSG_HDR_T prMsgHdr
851 scnFsmHandleScanMsg (
852 IN P_ADAPTER_T prAdapter,
853 IN P_MSG_SCN_SCAN_REQ prScanReqMsg
857 scnFsmHandleScanMsgV2 (
858 IN P_ADAPTER_T prAdapter,
859 IN P_MSG_SCN_SCAN_REQ_V2 prScanReqMsg
863 scnFsmRemovePendingMsg (
864 IN P_ADAPTER_T prAdapter,
866 IN UINT_8 ucNetTypeIndex
869 /*----------------------------------------------------------------------------*/
870 /* Mailbox Message Generation */
871 /*----------------------------------------------------------------------------*/
873 scnFsmGenerateScanDoneMsg (
874 IN P_ADAPTER_T prAdapter,
876 IN UINT_8 ucNetTypeIndex,
877 IN ENUM_SCAN_STATUS eScanStatus
880 /*----------------------------------------------------------------------------*/
881 /* Query for sparse channel */
882 /*----------------------------------------------------------------------------*/
884 scnQuerySparseChannel (
885 IN P_ADAPTER_T prAdapter,
886 P_ENUM_BAND_T prSparseBand,
887 PUINT_8 pucSparseChannel