import PULS_20160108
[GitHub/mt8127/android_kernel_alcatel_ttab.git] / drivers / misc / mediatek / connectivity / combo / drv_wlan / mt6628 / wlan / include / mgmt / bss.h
1 /*
2 ** $Id: @(#) bss.h
3 */
4
5 /*! \file "bss.h"
6 \brief In this file we define the function prototype used in BSS/IBSS.
7
8 The file contains the function declarations and defines for used in BSS/IBSS.
9 */
10
11
12
13 /*
14 ** $Log: bss.h $
15 *
16 * 07 17 2012 yuche.tsai
17 * NULL
18 * Let netdev bring up.
19 *
20 * 07 17 2012 yuche.tsai
21 * NULL
22 * Compile no error before trial run.
23 *
24 * 03 02 2012 terry.wu
25 * NULL
26 * Sync CFG80211 modification from branch 2,2.
27 *
28 * 09 14 2011 yuche.tsai
29 * NULL
30 * Add P2P IE in assoc response.
31 *
32 * 03 19 2011 yuche.tsai
33 * [WCXRP00000581] [Volunteer Patch][MT6620][Driver] P2P IE in Assoc Req Issue
34 * Make assoc req to append P2P IE if wifi direct is enabled.
35 *
36 * 03 02 2011 wh.su
37 * [WCXRP00000448] [MT6620 Wi-Fi][Driver] Fixed WSC IE not send out at probe request
38 * Add code to send beacon and probe response WSC IE at Auto GO.
39 *
40 * 02 23 2011 eddie.chen
41 * [WCXRP00000463] [MT6620 Wi-Fi][FW/Driver][Hotspot] Cannot update WMM PS STA's partital bitmap
42 * Fix parsing WMM INFO and bmp delivery bitmap definition.
43 *
44 * 01 31 2011 george.huang
45 * [WCXRP00000333] [MT5931][FW] support SRAM power control drivers
46 * Extend TIM PVB, from 2 to 3 octets.
47 *
48 * 11 29 2010 cp.wu
49 * [WCXRP00000210] [MT6620 Wi-Fi][Driver][FW] Set RCPI value in STA_REC for initial TX rate selection of auto-rate algorithm
50 * update ucRcpi of STA_RECORD_T for AIS when
51 * 1) Beacons for IBSS merge is received
52 * 2) Associate Response for a connecting peer is received
53 *
54 * 09 03 2010 kevin.huang
55 * NULL
56 * Refine #include sequence and solve recursive/nested #include issue
57 *
58 * 08 12 2010 kevin.huang
59 * NULL
60 * Update bssProcessProbeRequest() and bssSendBeaconProbeResponse() declarations
61 *
62 * 07 19 2010 cp.wu
63 *
64 * [WPD00003833] [MT6620 and MT5931] Driver migration.
65 * when IBSS is being merged-in, send command packet to PM for connected indication
66 *
67 * 07 08 2010 cp.wu
68 *
69 * [WPD00003833] [MT6620 and MT5931] Driver migration - move to new repository.
70 *
71 * 06 25 2010 george.huang
72 * [WPD00001556]Basic power managemenet function
73 * Create beacon update path, with expose bssUpdateBeaconContent()
74 *
75 * 06 17 2010 yuche.tsai
76 * [WPD00003839][MT6620 5931][P2P] Feature migration
77 * Add CTRL FLAGS for Probe Response.
78 *
79 * 06 09 2010 cp.wu
80 * [WPD00003833][MT6620 and MT5931] Driver migration
81 * add necessary changes to driver data paths.
82 *
83 * 06 07 2010 cp.wu
84 * [WPD00003833][MT6620 and MT5931] Driver migration
85 * add aa_fsm.h, ais_fsm.h, bss.h, mib.h and scan.h.
86 *
87 * 06 04 2010 george.huang
88 * [BORA00000678][MT6620]WiFi LP integration
89 * [PM] Support U-APSD for STA mode
90 *
91 * 05 28 2010 kevin.huang
92 * [BORA00000794][WIFISYS][New Feature]Power Management Support
93 * Add ClientList handling API - bssClearClientList, bssAddStaRecToClientList
94 *
95 * 05 14 2010 kevin.huang
96 * [BORA00000794][WIFISYS][New Feature]Power Management Support
97 * Remove unused typedef.
98 *
99 * 05 12 2010 kevin.huang
100 * [BORA00000794][WIFISYS][New Feature]Power Management Support
101 * Fix file merge error
102 *
103 * 05 12 2010 kevin.huang
104 * [BORA00000794][WIFISYS][New Feature]Power Management Support
105 * Add Power Management - Legacy PS-POLL support.
106 *
107 * 04 19 2010 kevin.huang
108 * [BORA00000714][WIFISYS][New Feature]Beacon Timeout Support
109 * Add Beacon Timeout Support
110 * * * and will send Null frame to diagnose connection
111 *
112 * 03 16 2010 kevin.huang
113 * [BORA00000663][WIFISYS][New Feature] AdHoc Mode Support
114 * Add AdHoc Mode
115 *
116 * 02 23 2010 kevin.huang
117 * [BORA00000603][WIFISYS] [New Feature] AAA Module Support
118 * Add DTIM count update while TX Beacon
119 *
120 * 02 04 2010 kevin.huang
121 * [BORA00000603][WIFISYS] [New Feature] AAA Module Support
122 * Add AAA Module Support, Revise Net Type to Net Type Index for array lookup
123 */
124
125 #ifndef _BSS_H
126 #define _BSS_H
127
128 /*******************************************************************************
129 * C O M P I L E R F L A G S
130 ********************************************************************************
131 */
132
133 /*******************************************************************************
134 * E X T E R N A L R E F E R E N C E S
135 ********************************************************************************
136 */
137
138 /*******************************************************************************
139 * C O N S T A N T S
140 ********************************************************************************
141 */
142 /* NOTE(Kevin): change define for george */
143 /* #define MAX_LEN_TIM_PARTIAL_BMP (((MAX_ASSOC_ID + 1) + 7) / 8) /* Required bits = (MAX_ASSOC_ID + 1) */ */
144 #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 */
145
146 /* CTRL FLAGS for Probe Response */
147 #define BSS_PROBE_RESP_USE_P2P_DEV_ADDR BIT(0)
148 #define BSS_PROBE_RESP_INCLUDE_P2P_IE BIT(1)
149
150 /*******************************************************************************
151 * D A T A T Y P E S
152 ********************************************************************************
153 */
154
155 /*******************************************************************************
156 * P U B L I C D A T A
157 ********************************************************************************
158 */
159
160 /*******************************************************************************
161 * P R I V A T E D A T A
162 ********************************************************************************
163 */
164
165 /*******************************************************************************
166 * M A C R O S
167 ********************************************************************************
168 */
169 #define bssAssignAssocID(_prStaRec) ((_prStaRec)->ucIndex + 1)
170
171 /*******************************************************************************
172 * F U N C T I O N D E C L A R A T I O N S
173 ********************************************************************************
174 */
175 /*----------------------------------------------------------------------------*/
176 /* Routines for all Operation Modes */
177 /*----------------------------------------------------------------------------*/
178 P_STA_RECORD_T
179 bssCreateStaRecFromBssDesc(IN P_ADAPTER_T prAdapter,
180 IN ENUM_STA_TYPE_T eStaType,
181 IN ENUM_NETWORK_TYPE_INDEX_T eNetTypeIndex, IN P_BSS_DESC_T prBssDesc);
182
183 VOID
184 bssComposeNullFrame(IN P_ADAPTER_T prAdapter, IN PUINT_8 pucBuffer, IN P_STA_RECORD_T prStaRec);
185
186 VOID
187 bssComposeQoSNullFrame(IN P_ADAPTER_T prAdapter,
188 IN PUINT_8 pucBuffer,
189 IN P_STA_RECORD_T prStaRec, IN UINT_8 ucUP, IN BOOLEAN fgSetEOSP);
190
191 WLAN_STATUS
192 bssSendNullFrame(IN P_ADAPTER_T prAdapter,
193 IN P_STA_RECORD_T prStaRec, IN PFN_TX_DONE_HANDLER pfTxDoneHandler);
194
195 WLAN_STATUS
196 bssSendQoSNullFrame(IN P_ADAPTER_T prAdapter,
197 IN P_STA_RECORD_T prStaRec,
198 IN UINT_8 ucUP, IN PFN_TX_DONE_HANDLER pfTxDoneHandler);
199
200
201 /*----------------------------------------------------------------------------*/
202 /* Routines for both IBSS(AdHoc) and BSS(AP) */
203 /*----------------------------------------------------------------------------*/
204 VOID bssGenerateExtSuppRate_IE(IN P_ADAPTER_T prAdapter, IN P_MSDU_INFO_T prMsduInfo);
205
206 VOID
207 bssBuildBeaconProbeRespFrameCommonIEs(IN P_MSDU_INFO_T prMsduInfo,
208 IN P_BSS_INFO_T prBssInfo, IN PUINT_8 pucDestAddr);
209
210 VOID
211 bssComposeBeaconProbeRespFrameHeaderAndFF(IN PUINT_8 pucBuffer,
212 IN PUINT_8 pucDestAddr,
213 IN PUINT_8 pucOwnMACAddress,
214 IN PUINT_8 pucBSSID,
215 IN UINT_16 u2BeaconInterval, IN UINT_16 u2CapInfo);
216
217 WLAN_STATUS
218 bssSendBeaconProbeResponse(IN P_ADAPTER_T prAdapter,
219 IN ENUM_NETWORK_TYPE_INDEX_T eNetTypeIndex,
220 IN PUINT_8 pucDestAddr, IN UINT_32 u4ControlFlags);
221
222 WLAN_STATUS bssProcessProbeRequest(IN P_ADAPTER_T prAdapter, IN P_SW_RFB_T prSwRfb);
223
224 VOID bssClearClientList(IN P_ADAPTER_T prAdapter, IN P_BSS_INFO_T prBssInfo);
225
226 VOID
227 bssAddStaRecToClientList(IN P_ADAPTER_T prAdapter,
228 IN P_BSS_INFO_T prBssInfo, IN P_STA_RECORD_T prStaRec);
229
230 VOID
231 bssRemoveStaRecFromClientList(IN P_ADAPTER_T prAdapter,
232 IN P_BSS_INFO_T prBssInfo, IN P_STA_RECORD_T prStaRec);
233
234
235 /*----------------------------------------------------------------------------*/
236 /* Routines for IBSS(AdHoc) only */
237 /*----------------------------------------------------------------------------*/
238 VOID
239 ibssProcessMatchedBeacon(IN P_ADAPTER_T prAdapter,
240 IN P_BSS_INFO_T prBssInfo, IN P_BSS_DESC_T prBssDesc, IN UINT_8 ucRCPI);
241
242 WLAN_STATUS ibssCheckCapabilityForAdHocMode(IN P_ADAPTER_T prAdapter, IN P_BSS_DESC_T prBssDesc);
243
244 VOID ibssInitForAdHoc(IN P_ADAPTER_T prAdapter, IN P_BSS_INFO_T prBssInfo);
245
246 WLAN_STATUS
247 bssUpdateBeaconContent(IN P_ADAPTER_T prAdapter, IN ENUM_NETWORK_TYPE_INDEX_T eNetTypeIndex);
248
249
250 /*----------------------------------------------------------------------------*/
251 /* Routines for BSS(AP) only */
252 /*----------------------------------------------------------------------------*/
253 VOID bssInitForAP(IN P_ADAPTER_T prAdapter, IN P_BSS_INFO_T prBssInfo, IN BOOLEAN fgIsRateUpdate);
254
255 VOID bssUpdateDTIMCount(IN P_ADAPTER_T prAdapter, IN ENUM_NETWORK_TYPE_INDEX_T eNetTypeIndex);
256
257 VOID bssSetTIMBitmap(IN P_ADAPTER_T prAdapter, IN P_BSS_INFO_T prBssInfo, IN UINT_16 u2AssocId);
258
259
260 /*link function to p2p module for txBcnIETable*/
261
262 /* WMM-2.2.2 WMM ACI to AC coding */
263 typedef enum _ENUM_ACI_T {
264 ACI_BE = 0,
265 ACI_BK = 1,
266 ACI_VI = 2,
267 ACI_VO = 3,
268 ACI_NUM
269 } ENUM_ACI_T, *P_ENUM_ACI_T;
270
271 typedef enum _ENUM_AC_PRIORITY_T {
272 AC_BK_PRIORITY = 0,
273 AC_BE_PRIORITY,
274 AC_VI_PRIORITY,
275 AC_VO_PRIORITY
276 } ENUM_AC_PRIORITY_T, *P_ENUM_AC_PRIORITY_T;
277
278
279 #endif /* _BSS_H */