This source file includes following definitions.
- cfg_to_wiphy
- wiphy_to_cfg
- wdev_to_cfg
- wdev_to_vif
- cfg_to_ndev
- ndev_to_cfg
- ndev_to_prof
- ndev_to_vif
- cfg_to_conn
1
2
3
4
5
6 #ifndef BRCMFMAC_CFG80211_H
7 #define BRCMFMAC_CFG80211_H
8
9
10 #include <brcmu_d11.h>
11
12 #include "core.h"
13 #include "fwil_types.h"
14 #include "p2p.h"
15
16 #define BRCMF_SCAN_IE_LEN_MAX 2048
17
18 #define WL_NUM_SCAN_MAX 10
19 #define WL_TLV_INFO_MAX 1024
20 #define WL_BSS_INFO_MAX 2048
21 #define WL_ASSOC_INFO_MAX 512
22 #define WL_EXTRA_BUF_MAX 2048
23 #define WL_ROAM_TRIGGER_LEVEL -75
24 #define WL_ROAM_DELTA 20
25
26
27
28
29 #define BRCMF_ESCAN_BUF_SIZE 65000
30 #define BRCMF_ESCAN_TIMER_INTERVAL_MS 10000
31
32 #define WL_ESCAN_ACTION_START 1
33 #define WL_ESCAN_ACTION_CONTINUE 2
34 #define WL_ESCAN_ACTION_ABORT 3
35
36 #define WL_AUTH_SHARED_KEY 1
37 #define IE_MAX_LEN 512
38
39
40 #define TLV_LEN_OFF 1
41 #define TLV_HDR_LEN 2
42 #define TLV_BODY_OFF 2
43 #define TLV_OUI_LEN 3
44
45
46 #define BRCMF_VNDR_IE_BEACON_FLAG 0x1
47 #define BRCMF_VNDR_IE_PRBRSP_FLAG 0x2
48 #define BRCMF_VNDR_IE_ASSOCRSP_FLAG 0x4
49 #define BRCMF_VNDR_IE_AUTHRSP_FLAG 0x8
50 #define BRCMF_VNDR_IE_PRBREQ_FLAG 0x10
51 #define BRCMF_VNDR_IE_ASSOCREQ_FLAG 0x20
52
53 #define BRCMF_VNDR_IE_IWAPID_FLAG 0x40
54
55 #define BRCMF_VNDR_IE_CUSTOM_FLAG 0x100
56
57
58 #define BRCMF_VNDR_IE_GONREQ_FLAG 0x001000
59 #define BRCMF_VNDR_IE_GONRSP_FLAG 0x002000
60 #define BRCMF_VNDR_IE_GONCFM_FLAG 0x004000
61 #define BRCMF_VNDR_IE_INVREQ_FLAG 0x008000
62 #define BRCMF_VNDR_IE_INVRSP_FLAG 0x010000
63 #define BRCMF_VNDR_IE_DISREQ_FLAG 0x020000
64 #define BRCMF_VNDR_IE_DISRSP_FLAG 0x040000
65 #define BRCMF_VNDR_IE_PRDREQ_FLAG 0x080000
66 #define BRCMF_VNDR_IE_PRDRSP_FLAG 0x100000
67
68 #define BRCMF_VNDR_IE_P2PAF_SHIFT 12
69
70 #define BRCMF_MAX_DEFAULT_KEYS 6
71
72
73 #define BRCMF_DEFAULT_BCN_TIMEOUT_ROAM_ON 2
74 #define BRCMF_DEFAULT_BCN_TIMEOUT_ROAM_OFF 4
75
76 #define BRCMF_VIF_EVENT_TIMEOUT msecs_to_jiffies(1500)
77
78
79
80
81
82
83
84
85 enum brcmf_scan_status {
86 BRCMF_SCAN_STATUS_BUSY,
87 BRCMF_SCAN_STATUS_ABORT,
88 BRCMF_SCAN_STATUS_SUPPRESS,
89 };
90
91
92 struct brcmf_cfg80211_conf {
93 u32 frag_threshold;
94 u32 rts_threshold;
95 u32 retry_short;
96 u32 retry_long;
97 };
98
99
100 struct brcmf_cfg80211_security {
101 u32 wpa_versions;
102 u32 auth_type;
103 u32 cipher_pairwise;
104 u32 cipher_group;
105 };
106
107 enum brcmf_profile_fwsup {
108 BRCMF_PROFILE_FWSUP_NONE,
109 BRCMF_PROFILE_FWSUP_PSK,
110 BRCMF_PROFILE_FWSUP_1X
111 };
112
113
114
115
116
117
118
119
120 struct brcmf_cfg80211_profile {
121 u8 bssid[ETH_ALEN];
122 struct brcmf_cfg80211_security sec;
123 struct brcmf_wsec_key key[BRCMF_MAX_DEFAULT_KEYS];
124 enum brcmf_profile_fwsup use_fwsup;
125 };
126
127
128
129
130
131
132
133
134
135
136
137
138 enum brcmf_vif_status {
139 BRCMF_VIF_STATUS_READY,
140 BRCMF_VIF_STATUS_CONNECTING,
141 BRCMF_VIF_STATUS_CONNECTED,
142 BRCMF_VIF_STATUS_DISCONNECTING,
143 BRCMF_VIF_STATUS_AP_CREATED,
144 BRCMF_VIF_STATUS_EAP_SUCCESS,
145 BRCMF_VIF_STATUS_ASSOC_SUCCESS,
146 };
147
148
149
150
151
152
153
154
155
156
157
158 struct vif_saved_ie {
159 u8 probe_req_ie[IE_MAX_LEN];
160 u8 probe_res_ie[IE_MAX_LEN];
161 u8 beacon_ie[IE_MAX_LEN];
162 u8 assoc_req_ie[IE_MAX_LEN];
163 u32 probe_req_ie_len;
164 u32 probe_res_ie_len;
165 u32 beacon_ie_len;
166 u32 assoc_req_ie_len;
167 };
168
169
170
171
172
173
174
175
176
177
178
179
180 struct brcmf_cfg80211_vif {
181 struct brcmf_if *ifp;
182 struct wireless_dev wdev;
183 struct brcmf_cfg80211_profile profile;
184 unsigned long sme_state;
185 struct vif_saved_ie saved_ie;
186 struct list_head list;
187 u16 mgmt_rx_reg;
188 bool mbss;
189 int is_11d;
190 };
191
192
193 struct brcmf_cfg80211_connect_info {
194 u8 *req_ie;
195 s32 req_ie_len;
196 u8 *resp_ie;
197 s32 resp_ie_len;
198 };
199
200
201 struct brcmf_cfg80211_assoc_ielen_le {
202 __le32 req_len;
203 __le32 resp_len;
204 };
205
206
207 enum wl_escan_state {
208 WL_ESCAN_STATE_IDLE,
209 WL_ESCAN_STATE_SCANNING
210 };
211
212 struct escan_info {
213 u32 escan_state;
214 u8 *escan_buf;
215 struct wiphy *wiphy;
216 struct brcmf_if *ifp;
217 s32 (*run)(struct brcmf_cfg80211_info *cfg, struct brcmf_if *ifp,
218 struct cfg80211_scan_request *request);
219 };
220
221
222
223
224
225
226
227
228
229
230 struct brcmf_cfg80211_vif_event {
231 wait_queue_head_t vif_wq;
232 spinlock_t vif_event_lock;
233 u8 action;
234 struct brcmf_cfg80211_vif *vif;
235 };
236
237
238
239
240
241
242
243
244
245
246
247
248 struct brcmf_cfg80211_wowl {
249 bool active;
250 u32 pre_pmmode;
251 struct cfg80211_wowlan_nd_match *nd;
252 struct cfg80211_wowlan_nd_info *nd_info;
253 wait_queue_head_t nd_data_wait;
254 bool nd_data_completed;
255 bool nd_enabled;
256 };
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293 struct brcmf_cfg80211_info {
294 struct wiphy *wiphy;
295 struct brcmf_cfg80211_conf *conf;
296 struct brcmf_p2p_info p2p;
297 struct brcmf_btcoex_info *btcoex;
298 struct cfg80211_scan_request *scan_request;
299 struct mutex usr_sync;
300 struct wl_cfg80211_bss_info *bss_info;
301 struct brcmf_cfg80211_connect_info conn_info;
302 struct brcmf_pmk_list_le pmk_list;
303 unsigned long scan_status;
304 struct brcmf_pub *pub;
305 u32 channel;
306 u32 int_escan_map;
307 bool ibss_starter;
308 bool pwr_save;
309 bool dongle_up;
310 bool scan_tried;
311 u8 *dcmd_buf;
312 u8 *extra_buf;
313 struct dentry *debugfsdir;
314 struct escan_info escan_info;
315 struct timer_list escan_timeout;
316 struct work_struct escan_timeout_work;
317 struct list_head vif_list;
318 struct brcmf_cfg80211_vif_event vif_event;
319 struct completion vif_disabled;
320 struct brcmu_d11inf d11inf;
321 struct brcmf_assoclist_le assoclist;
322 struct brcmf_cfg80211_wowl wowl;
323 struct brcmf_pno_info *pno;
324 };
325
326
327
328
329
330
331
332
333 struct brcmf_tlv {
334 u8 id;
335 u8 len;
336 u8 data[1];
337 };
338
339 static inline struct wiphy *cfg_to_wiphy(struct brcmf_cfg80211_info *cfg)
340 {
341 return cfg->wiphy;
342 }
343
344 static inline struct brcmf_cfg80211_info *wiphy_to_cfg(struct wiphy *w)
345 {
346 struct brcmf_pub *drvr = wiphy_priv(w);
347 return drvr->config;
348 }
349
350 static inline struct brcmf_cfg80211_info *wdev_to_cfg(struct wireless_dev *wd)
351 {
352 return wiphy_to_cfg(wd->wiphy);
353 }
354
355 static inline struct brcmf_cfg80211_vif *wdev_to_vif(struct wireless_dev *wdev)
356 {
357 return container_of(wdev, struct brcmf_cfg80211_vif, wdev);
358 }
359
360 static inline
361 struct net_device *cfg_to_ndev(struct brcmf_cfg80211_info *cfg)
362 {
363 return brcmf_get_ifp(cfg->pub, 0)->ndev;
364 }
365
366 static inline struct brcmf_cfg80211_info *ndev_to_cfg(struct net_device *ndev)
367 {
368 return wdev_to_cfg(ndev->ieee80211_ptr);
369 }
370
371 static inline struct brcmf_cfg80211_profile *ndev_to_prof(struct net_device *nd)
372 {
373 struct brcmf_if *ifp = netdev_priv(nd);
374 return &ifp->vif->profile;
375 }
376
377 static inline struct brcmf_cfg80211_vif *ndev_to_vif(struct net_device *ndev)
378 {
379 struct brcmf_if *ifp = netdev_priv(ndev);
380 return ifp->vif;
381 }
382
383 static inline struct
384 brcmf_cfg80211_connect_info *cfg_to_conn(struct brcmf_cfg80211_info *cfg)
385 {
386 return &cfg->conn_info;
387 }
388
389 struct brcmf_cfg80211_info *brcmf_cfg80211_attach(struct brcmf_pub *drvr,
390 struct cfg80211_ops *ops,
391 bool p2pdev_forced);
392 void brcmf_cfg80211_detach(struct brcmf_cfg80211_info *cfg);
393 s32 brcmf_cfg80211_up(struct net_device *ndev);
394 s32 brcmf_cfg80211_down(struct net_device *ndev);
395 struct cfg80211_ops *brcmf_cfg80211_get_ops(struct brcmf_mp_device *settings);
396 enum nl80211_iftype brcmf_cfg80211_get_iftype(struct brcmf_if *ifp);
397
398 struct brcmf_cfg80211_vif *brcmf_alloc_vif(struct brcmf_cfg80211_info *cfg,
399 enum nl80211_iftype type);
400 void brcmf_free_vif(struct brcmf_cfg80211_vif *vif);
401
402 s32 brcmf_vif_set_mgmt_ie(struct brcmf_cfg80211_vif *vif, s32 pktflag,
403 const u8 *vndr_ie_buf, u32 vndr_ie_len);
404 s32 brcmf_vif_clear_mgmt_ies(struct brcmf_cfg80211_vif *vif);
405 u16 channel_to_chanspec(struct brcmu_d11inf *d11inf,
406 struct ieee80211_channel *ch);
407 bool brcmf_get_vif_state_any(struct brcmf_cfg80211_info *cfg,
408 unsigned long state);
409 void brcmf_cfg80211_arm_vif_event(struct brcmf_cfg80211_info *cfg,
410 struct brcmf_cfg80211_vif *vif);
411 bool brcmf_cfg80211_vif_event_armed(struct brcmf_cfg80211_info *cfg);
412 int brcmf_cfg80211_wait_vif_event(struct brcmf_cfg80211_info *cfg,
413 u8 action, ulong timeout);
414 s32 brcmf_notify_escan_complete(struct brcmf_cfg80211_info *cfg,
415 struct brcmf_if *ifp, bool aborted,
416 bool fw_abort);
417 void brcmf_set_mpc(struct brcmf_if *ndev, int mpc);
418 void brcmf_abort_scanning(struct brcmf_cfg80211_info *cfg);
419 void brcmf_cfg80211_free_netdev(struct net_device *ndev);
420
421 #endif