6 \brief In this file we define the function prototype used in BSS/IBSS.
8 The file contains the function declarations and defines for used in BSS/IBSS.
11 /*******************************************************************************
12 * Copyright (c) 2010 MediaTek Inc.
14 * All rights reserved. Copying, compilation, modification, distribution
15 * or any other use whatsoever of this material is strictly prohibited
16 * except in accordance with a Software License Agreement with
18 ********************************************************************************
21 /*******************************************************************************
24 * BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND
25 * AGREES THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK
26 * SOFTWARE") RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE
27 * PROVIDED TO BUYER ON AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY
28 * DISCLAIMS ANY AND ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT
29 * LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
30 * PARTICULAR PURPOSE OR NONINFRINGEMENT. NEITHER DOES MEDIATEK PROVIDE
31 * ANY WARRANTY WHATSOEVER WITH RESPECT TO THE SOFTWARE OF ANY THIRD PARTY
32 * WHICH MAY BE USED BY, INCORPORATED IN, OR SUPPLIED WITH THE MEDIATEK
33 * SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH THIRD PARTY FOR ANY
34 * WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE
35 * FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S SPECIFICATION OR TO
36 * CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
38 * BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
39 * LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL
40 * BE, AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT
41 * ISSUE, OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY
42 * BUYER TO MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
44 * THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
45 * WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT
46 * OF LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING
47 * THEREOF AND RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN
48 * FRANCISCO, CA, UNDER THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE
50 ********************************************************************************
56 * 07 17 2012 yuche.tsai
58 * Let netdev bring up.
60 * 07 17 2012 yuche.tsai
62 * Compile no error before trial run.
66 * Sync CFG80211 modification from branch 2,2.
68 * 09 14 2011 yuche.tsai
70 * Add P2P IE in assoc response.
72 * 03 19 2011 yuche.tsai
73 * [WCXRP00000581] [Volunteer Patch][MT6620][Driver] P2P IE in Assoc Req Issue
74 * Make assoc req to append P2P IE if wifi direct is enabled.
77 * [WCXRP00000448] [MT6620 Wi-Fi][Driver] Fixed WSC IE not send out at probe request
78 * Add code to send beacon and probe response WSC IE at Auto GO.
80 * 02 23 2011 eddie.chen
81 * [WCXRP00000463] [MT6620 Wi-Fi][FW/Driver][Hotspot] Cannot update WMM PS STA's partital bitmap
82 * Fix parsing WMM INFO and bmp delivery bitmap definition.
84 * 01 31 2011 george.huang
85 * [WCXRP00000333] [MT5931][FW] support SRAM power control drivers
86 * Extend TIM PVB, from 2 to 3 octets.
89 * [WCXRP00000210] [MT6620 Wi-Fi][Driver][FW] Set RCPI value in STA_REC for initial TX rate selection of auto-rate algorithm
90 * update ucRcpi of STA_RECORD_T for AIS when
91 * 1) Beacons for IBSS merge is received
92 * 2) Associate Response for a connecting peer is received
94 * 09 03 2010 kevin.huang
96 * Refine #include sequence and solve recursive/nested #include issue
98 * 08 12 2010 kevin.huang
100 * Update bssProcessProbeRequest() and bssSendBeaconProbeResponse() declarations
104 * [WPD00003833] [MT6620 and MT5931] Driver migration.
105 * when IBSS is being merged-in, send command packet to PM for connected indication
109 * [WPD00003833] [MT6620 and MT5931] Driver migration - move to new repository.
111 * 06 25 2010 george.huang
112 * [WPD00001556]Basic power managemenet function
113 * Create beacon update path, with expose bssUpdateBeaconContent()
115 * 06 17 2010 yuche.tsai
116 * [WPD00003839][MT6620 5931][P2P] Feature migration
117 * Add CTRL FLAGS for Probe Response.
120 * [WPD00003833][MT6620 and MT5931] Driver migration
121 * add necessary changes to driver data paths.
124 * [WPD00003833][MT6620 and MT5931] Driver migration
125 * add aa_fsm.h, ais_fsm.h, bss.h, mib.h and scan.h.
127 * 06 04 2010 george.huang
128 * [BORA00000678][MT6620]WiFi LP integration
129 * [PM] Support U-APSD for STA mode
131 * 05 28 2010 kevin.huang
132 * [BORA00000794][WIFISYS][New Feature]Power Management Support
133 * Add ClientList handling API - bssClearClientList, bssAddStaRecToClientList
135 * 05 14 2010 kevin.huang
136 * [BORA00000794][WIFISYS][New Feature]Power Management Support
137 * Remove unused typedef.
139 * 05 12 2010 kevin.huang
140 * [BORA00000794][WIFISYS][New Feature]Power Management Support
141 * Fix file merge error
143 * 05 12 2010 kevin.huang
144 * [BORA00000794][WIFISYS][New Feature]Power Management Support
145 * Add Power Management - Legacy PS-POLL support.
147 * 04 19 2010 kevin.huang
148 * [BORA00000714][WIFISYS][New Feature]Beacon Timeout Support
149 * Add Beacon Timeout Support
150 * * * and will send Null frame to diagnose connection
152 * 03 16 2010 kevin.huang
153 * [BORA00000663][WIFISYS][New Feature] AdHoc Mode Support
156 * 02 23 2010 kevin.huang
157 * [BORA00000603][WIFISYS] [New Feature] AAA Module Support
158 * Add DTIM count update while TX Beacon
160 * 02 04 2010 kevin.huang
161 * [BORA00000603][WIFISYS] [New Feature] AAA Module Support
162 * Add AAA Module Support, Revise Net Type to Net Type Index for array lookup
168 /*******************************************************************************
169 * C O M P I L E R F L A G S
170 ********************************************************************************
173 /*******************************************************************************
174 * E X T E R N A L R E F E R E N C E S
175 ********************************************************************************
178 /*******************************************************************************
180 ********************************************************************************
182 //NOTE(Kevin): change define for george
183 //#define MAX_LEN_TIM_PARTIAL_BMP (((MAX_ASSOC_ID + 1) + 7) / 8) /* Required bits = (MAX_ASSOC_ID + 1) */
184 #define MAX_LEN_TIM_PARTIAL_BMP ((CFG_STA_REC_NUM + 7) / 8) /* reserve length greater than maximum size of STA_REC */ //obsoleted: Assume we only use AID:1~15
186 /* CTRL FLAGS for Probe Response */
187 #define BSS_PROBE_RESP_USE_P2P_DEV_ADDR BIT(0)
188 #define BSS_PROBE_RESP_INCLUDE_P2P_IE BIT(1)
190 /*******************************************************************************
192 ********************************************************************************
195 /*******************************************************************************
196 * P U B L I C D A T A
197 ********************************************************************************
200 /*******************************************************************************
201 * P R I V A T E D A T A
202 ********************************************************************************
205 /*******************************************************************************
207 ********************************************************************************
209 #define bssAssignAssocID(_prStaRec) ((_prStaRec)->ucIndex + 1)
211 /*******************************************************************************
212 * F U N C T I O N D E C L A R A T I O N S
213 ********************************************************************************
215 /*----------------------------------------------------------------------------*/
216 /* Routines for all Operation Modes */
217 /*----------------------------------------------------------------------------*/
219 bssCreateStaRecFromBssDesc (
220 IN P_ADAPTER_T prAdapter,
221 IN ENUM_STA_TYPE_T eStaType,
222 IN ENUM_NETWORK_TYPE_INDEX_T eNetTypeIndex,
223 IN P_BSS_DESC_T prBssDesc
227 bssComposeNullFrame (
228 IN P_ADAPTER_T prAdapter,
229 IN PUINT_8 pucBuffer,
230 IN P_STA_RECORD_T prStaRec
234 bssComposeQoSNullFrame (
235 IN P_ADAPTER_T prAdapter,
236 IN PUINT_8 pucBuffer,
237 IN P_STA_RECORD_T prStaRec,
244 IN P_ADAPTER_T prAdapter,
245 IN P_STA_RECORD_T prStaRec,
246 IN PFN_TX_DONE_HANDLER pfTxDoneHandler
250 bssSendQoSNullFrame (
251 IN P_ADAPTER_T prAdapter,
252 IN P_STA_RECORD_T prStaRec,
254 IN PFN_TX_DONE_HANDLER pfTxDoneHandler
258 /*----------------------------------------------------------------------------*/
259 /* Routines for both IBSS(AdHoc) and BSS(AP) */
260 /*----------------------------------------------------------------------------*/
262 bssGenerateExtSuppRate_IE (
263 IN P_ADAPTER_T prAdapter,
264 IN P_MSDU_INFO_T prMsduInfo
268 bssBuildBeaconProbeRespFrameCommonIEs (
269 IN P_MSDU_INFO_T prMsduInfo,
270 IN P_BSS_INFO_T prBssInfo,
271 IN PUINT_8 pucDestAddr
275 bssComposeBeaconProbeRespFrameHeaderAndFF (
276 IN PUINT_8 pucBuffer,
277 IN PUINT_8 pucDestAddr,
278 IN PUINT_8 pucOwnMACAddress,
280 IN UINT_16 u2BeaconInterval,
285 bssSendBeaconProbeResponse (
286 IN P_ADAPTER_T prAdapter,
287 IN ENUM_NETWORK_TYPE_INDEX_T eNetTypeIndex,
288 IN PUINT_8 pucDestAddr,
289 IN UINT_32 u4ControlFlags
293 bssProcessProbeRequest (
294 IN P_ADAPTER_T prAdapter,
295 IN P_SW_RFB_T prSwRfb
300 IN P_ADAPTER_T prAdapter,
301 IN P_BSS_INFO_T prBssInfo
305 bssAddStaRecToClientList (
306 IN P_ADAPTER_T prAdapter,
307 IN P_BSS_INFO_T prBssInfo,
308 IN P_STA_RECORD_T prStaRec
312 bssRemoveStaRecFromClientList (
313 IN P_ADAPTER_T prAdapter,
314 IN P_BSS_INFO_T prBssInfo,
315 IN P_STA_RECORD_T prStaRec
319 /*----------------------------------------------------------------------------*/
320 /* Routines for IBSS(AdHoc) only */
321 /*----------------------------------------------------------------------------*/
323 ibssProcessMatchedBeacon (
324 IN P_ADAPTER_T prAdapter,
325 IN P_BSS_INFO_T prBssInfo,
326 IN P_BSS_DESC_T prBssDesc,
331 ibssCheckCapabilityForAdHocMode (
332 IN P_ADAPTER_T prAdapter,
333 IN P_BSS_DESC_T prBssDesc
338 IN P_ADAPTER_T prAdapter,
339 IN P_BSS_INFO_T prBssInfo
343 bssUpdateBeaconContent (
344 IN P_ADAPTER_T prAdapter,
345 IN ENUM_NETWORK_TYPE_INDEX_T eNetTypeIndex
349 /*----------------------------------------------------------------------------*/
350 /* Routines for BSS(AP) only */
351 /*----------------------------------------------------------------------------*/
354 IN P_ADAPTER_T prAdapter,
355 IN P_BSS_INFO_T prBssInfo,
356 IN BOOLEAN fgIsRateUpdate
361 IN P_ADAPTER_T prAdapter,
362 IN ENUM_NETWORK_TYPE_INDEX_T eNetTypeIndex
367 IN P_ADAPTER_T prAdapter,
368 IN P_BSS_INFO_T prBssInfo,
373 /*link function to p2p module for txBcnIETable*/
375 /* WMM-2.2.2 WMM ACI to AC coding */
376 typedef enum _ENUM_ACI_T {
382 } ENUM_ACI_T, *P_ENUM_ACI_T;
384 typedef enum _ENUM_AC_PRIORITY_T {
389 } ENUM_AC_PRIORITY_T, *P_ENUM_AC_PRIORITY_T;