blob: 6acd89c473732ad2d12c8623ce354b3a4e271378 [file] [log] [blame]
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001/*
Padma, Santhosh Kumare587a5c2017-12-21 12:44:46 +05302 * Copyright (c) 2012-2018 The Linux Foundation. All rights reserved.
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003 *
4 * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
5 *
6 *
7 * Permission to use, copy, modify, and/or distribute this software for
8 * any purpose with or without fee is hereby granted, provided that the
9 * above copyright notice and this permission notice appear in all
10 * copies.
11 *
12 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
13 * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
14 * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
15 * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
16 * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
17 * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
18 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
19 * PERFORMANCE OF THIS SOFTWARE.
20 */
21
22/*
23 * This file was originally distributed by Qualcomm Atheros, Inc.
24 * under proprietary terms before Copyright ownership was assigned
25 * to the Linux Foundation.
26 */
27
28/**
29 * DOC: wlan_hdd_cfg80211.h
30 *
31 * WLAN host device driver cfg80211 functions declaration
32 */
33
34#if !defined(HDD_CFG80211_H__)
35#define HDD_CFG80211_H__
36
Sandeep Puligillafdd201e2017-02-02 18:43:46 -080037#include <wlan_cfg80211_scan.h>
38#include <wlan_cfg80211.h>
Frank Liud4b2fa02017-03-29 11:46:48 +080039#include <wlan_cfg80211_tdls.h>
Sandeep Puligillafdd201e2017-02-02 18:43:46 -080040
Jeff Johnson7aeb95b2017-08-28 12:06:33 -070041struct hdd_context;
42
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080043/* value for initial part of frames and number of bytes to be compared */
44#define GAS_INITIAL_REQ "\x04\x0a"
45#define GAS_INITIAL_REQ_SIZE 2
46
47#define GAS_INITIAL_RSP "\x04\x0b"
48#define GAS_INITIAL_RSP_SIZE 2
49
50#define GAS_COMEBACK_REQ "\x04\x0c"
51#define GAS_COMEBACK_REQ_SIZE 2
52
53#define GAS_COMEBACK_RSP "\x04\x0d"
54#define GAS_COMEBACK_RSP_SIZE 2
55
56#define P2P_PUBLIC_ACTION_FRAME "\x04\x09\x50\x6f\x9a\x09"
57#define P2P_PUBLIC_ACTION_FRAME_SIZE 6
58
59#define P2P_ACTION_FRAME "\x7f\x50\x6f\x9a\x09"
60#define P2P_ACTION_FRAME_SIZE 5
61
62#define SA_QUERY_FRAME_REQ "\x08\x00"
63#define SA_QUERY_FRAME_REQ_SIZE 2
64
65#define SA_QUERY_FRAME_RSP "\x08\x01"
66#define SA_QUERY_FRAME_RSP_SIZE 2
67
68#define HDD_P2P_WILDCARD_SSID "DIRECT-"
69#define HDD_P2P_WILDCARD_SSID_LEN 7
70
71#define WNM_BSS_ACTION_FRAME "\x0a\x07"
72#define WNM_BSS_ACTION_FRAME_SIZE 2
73
74#define WNM_NOTIFICATION_FRAME "\x0a\x1a"
75#define WNM_NOTIFICATION_FRAME_SIZE 2
76
77#define WPA_OUI_TYPE "\x00\x50\xf2\x01"
78#define BLACKLIST_OUI_TYPE "\x00\x50\x00\x00"
79#define WHITELIST_OUI_TYPE "\x00\x50\x00\x01"
80#define WPA_OUI_TYPE_SIZE 4
81#define WMM_OUI_TYPE "\x00\x50\xf2\x02\x01"
82#define WMM_OUI_TYPE_SIZE 5
83
Krunal Soni364e0872017-05-10 21:24:34 -070084#define VENDOR1_AP_OUI_TYPE "\x00\xE0\x4C"
85#define VENDOR1_AP_OUI_TYPE_SIZE 3
86
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080087#define WLAN_BSS_MEMBERSHIP_SELECTOR_VHT_PHY 126
88#define WLAN_BSS_MEMBERSHIP_SELECTOR_HT_PHY 127
89#define BASIC_RATE_MASK 0x80
90#define RATE_MASK 0x7f
91
Sridhar Selvaraj8c6f5e82017-08-21 14:53:46 +053092#ifndef NL80211_AUTHTYPE_FILS_SK
93#define NL80211_AUTHTYPE_FILS_SK 5
94#endif
95#ifndef NL80211_AUTHTYPE_FILS_SK_PFS
96#define NL80211_AUTHTYPE_FILS_SK_PFS 6
97#endif
98#ifndef NL80211_AUTHTYPE_FILS_PK
99#define NL80211_AUTHTYPE_FILS_PK 7
100#endif
101#ifndef WLAN_AKM_SUITE_FILS_SHA256
102#define WLAN_AKM_SUITE_FILS_SHA256 0x000FAC0E
103#endif
104#ifndef WLAN_AKM_SUITE_FILS_SHA384
105#define WLAN_AKM_SUITE_FILS_SHA384 0x000FAC0F
106#endif
107#ifndef WLAN_AKM_SUITE_FT_FILS_SHA256
108#define WLAN_AKM_SUITE_FT_FILS_SHA256 0x000FAC10
109#endif
110#ifndef WLAN_AKM_SUITE_FT_FILS_SHA384
111#define WLAN_AKM_SUITE_FT_FILS_SHA384 0x000FAC11
112#endif
Abhishek Singh02cb9e02017-08-30 17:39:50 +0530113#ifndef WLAN_AKM_SUITE_DPP_RSN
114#define WLAN_AKM_SUITE_DPP_RSN 0x506f9a02
115#endif
Sridhar Selvaraj8c6f5e82017-08-21 14:53:46 +0530116
Padma, Santhosh Kumarc69ce072017-11-06 18:21:05 +0530117#define WLAN_AKM_SUITE_OWE 0x000FAC12
Padma, Santhosh Kumare587a5c2017-12-21 12:44:46 +0530118#define WLAN_AKM_SUITE_EAP_SHA256 0x000FAC0B
119#define WLAN_AKM_SUITE_EAP_SHA384 0x000FAC0C
120
Padma, Santhosh Kumarc69ce072017-11-06 18:21:05 +0530121
Padma, Santhosh Kumar07eb80b2017-07-05 16:10:06 +0530122#ifndef WLAN_AKM_SUITE_SAE
123#define WLAN_AKM_SUITE_SAE 0x000FAC08
124#endif
125
Krishna Kumaar Natarajanda909222016-08-04 15:50:38 -0700126#ifdef FEATURE_WLAN_TDLS
127#define WLAN_IS_TDLS_SETUP_ACTION(action) \
128 ((SIR_MAC_TDLS_SETUP_REQ <= action) && \
129 (SIR_MAC_TDLS_SETUP_CNF >= action))
Srinivas Girigowda576b2352017-08-25 14:44:26 -0700130#if !defined(TDLS_MGMT_VERSION2)
Krishna Kumaar Natarajanda909222016-08-04 15:50:38 -0700131#define TDLS_MGMT_VERSION2 0
132#endif
Tang Yingying43ee7ee2017-01-17 23:57:12 +0800133
134#endif
135
Mahesh A Saptasagar6dda2022016-09-03 12:59:09 +0530136#ifdef WLAN_FEATURE_LINK_LAYER_STATS
Jeff Johnsone5006672017-08-29 14:39:02 -0700137void wlan_hdd_clear_link_layer_stats(struct hdd_adapter *adapter);
Mahesh A Saptasagar6dda2022016-09-03 12:59:09 +0530138#else
Jeff Johnsone5006672017-08-29 14:39:02 -0700139static inline void wlan_hdd_clear_link_layer_stats(struct hdd_adapter *adapter) {}
Mahesh A Saptasagar6dda2022016-09-03 12:59:09 +0530140#endif
141
Krishna Kumaar Natarajanda909222016-08-04 15:50:38 -0700142#define MAX_CHANNEL (NUM_24GHZ_CHANNELS + NUM_5GHZ_CHANNELS)
143#define MAX_SCAN_SSID 10
144
Hanumanth Reddy Pothula6310c772017-01-16 14:19:21 +0530145#define IS_CHANNEL_VALID(channel) ((channel >= 0 && channel < 15) \
146 || (channel >= 36 && channel <= 184))
147
Krishna Kumaar Natarajanda909222016-08-04 15:50:38 -0700148#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 12, 0)) \
149 || defined(BACKPORTED_CHANNEL_SWITCH_PRESENT)
150#define CHANNEL_SWITCH_SUPPORTED
151#endif
152
153#if defined(CFG80211_DEL_STA_V2) || (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0)) || defined(WITH_BACKPORTS)
154#define USE_CFG80211_DEL_STA_V2
155#endif
156
Nishank Aggarwal4dbbc912017-05-05 14:38:24 +0530157#define OL_TXRX_INVALID_TDLS_PEER_ID 0xff
158
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800159/**
160 * enum eDFS_CAC_STATUS: CAC status
161 *
162 * @DFS_CAC_NEVER_DONE: CAC never done
163 * @DFS_CAC_IN_PROGRESS: CAC is in progress
164 * @DFS_CAC_IN_PROGRESS: CAC already done
165 */
166typedef enum {
167 DFS_CAC_NEVER_DONE,
168 DFS_CAC_IN_PROGRESS,
169 DFS_CAC_ALREADY_DONE,
170} eDFS_CAC_STATUS;
171
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800172#define MAX_REQUEST_ID 0xFFFFFFFF
173
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800174/* Feature defines */
175#define WIFI_FEATURE_INFRA 0x0001 /* Basic infrastructure mode */
176#define WIFI_FEATURE_INFRA_5G 0x0002 /* Support for 5 GHz Band */
177#define WIFI_FEATURE_HOTSPOT 0x0004 /* Support for GAS/ANQP */
178#define WIFI_FEATURE_P2P 0x0008 /* Wifi-Direct */
179#define WIFI_FEATURE_SOFT_AP 0x0010 /* Soft AP */
180#define WIFI_FEATURE_EXTSCAN 0x0020 /* Extended Scan APIs */
181#define WIFI_FEATURE_NAN 0x0040 /* Neighbor Awareness
Jeff Johnson913c7282017-01-12 09:49:05 -0800182 * Networking
183 */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800184#define WIFI_FEATURE_D2D_RTT 0x0080 /* Device-to-device RTT */
185#define WIFI_FEATURE_D2AP_RTT 0x0100 /* Device-to-AP RTT */
186#define WIFI_FEATURE_BATCH_SCAN 0x0200 /* Batched Scan (legacy) */
187#define WIFI_FEATURE_PNO 0x0400 /* Preferred network offload */
188#define WIFI_FEATURE_ADDITIONAL_STA 0x0800 /* Support for two STAs */
189#define WIFI_FEATURE_TDLS 0x1000 /* Tunnel directed link
Jeff Johnson913c7282017-01-12 09:49:05 -0800190 * setup
191 */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800192#define WIFI_FEATURE_TDLS_OFFCHANNEL 0x2000 /* Support for TDLS off
Jeff Johnson913c7282017-01-12 09:49:05 -0800193 * channel
194 */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800195#define WIFI_FEATURE_EPR 0x4000 /* Enhanced power reporting */
196#define WIFI_FEATURE_AP_STA 0x8000 /* Support for AP STA
Jeff Johnson913c7282017-01-12 09:49:05 -0800197 * Concurrency
198 */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800199#define WIFI_FEATURE_LINK_LAYER_STATS 0x10000 /* Link layer stats */
200#define WIFI_FEATURE_LOGGER 0x20000 /* WiFi Logger */
201#define WIFI_FEATURE_HAL_EPNO 0x40000 /* WiFi PNO enhanced */
202#define WIFI_FEATURE_RSSI_MONITOR 0x80000 /* RSSI Monitor */
Srinivas Girigowdaa2cad3e2016-10-25 14:14:23 -0700203#define WIFI_FEATURE_MKEEP_ALIVE 0x100000 /* WiFi mkeep_alive */
204#define WIFI_FEATURE_CONFIG_NDO 0x200000 /* ND offload configure */
205#define WIFI_FEATURE_TX_TRANSMIT_POWER 0x400000 /* Tx transmit power levels */
Srinivas Girigowda8df27ea2017-01-06 12:42:16 -0800206#define WIFI_FEATURE_CONTROL_ROAMING 0x800000 /* Enable/Disable roaming */
207#define WIFI_FEATURE_IE_WHITELIST 0x1000000 /* Support Probe IE white listing */
208#define WIFI_FEATURE_SCAN_RAND 0x2000000 /* Support MAC & Probe Sequence Number randomization */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800209
Srinivas Girigowda5a1da622017-07-12 17:07:44 -0700210/* Support Tx Power Limit setting */
211#define WIFI_FEATURE_SET_TX_POWER_LIMIT 0x4000000
212
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800213/* Add more features here */
214#define WIFI_TDLS_SUPPORT BIT(0)
215#define WIFI_TDLS_EXTERNAL_CONTROL_SUPPORT BIT(1)
216#define WIIF_TDLS_OFFCHANNEL_SUPPORT BIT(2)
217
Zhang Qiana3bcbe02016-08-12 16:20:36 +0800218#define CFG_NON_AGG_RETRY_MAX (31)
219#define CFG_AGG_RETRY_MAX (31)
220#define CFG_MGMT_RETRY_MAX (31)
221#define CFG_CTRL_RETRY_MAX (31)
222#define CFG_PROPAGATION_DELAY_MAX (63)
Zhang Qiane9fd14b2017-03-08 11:29:00 +0800223#define CFG_PROPAGATION_DELAY_BASE (64)
Zhang Qiana3bcbe02016-08-12 16:20:36 +0800224#define CFG_AGG_RETRY_MIN (5)
225
Jeff Johnson172237b2017-11-07 15:32:59 -0800226struct cfg80211_bss *
227wlan_hdd_cfg80211_update_bss_db(struct hdd_adapter *adapter,
228 struct csr_roam_info *roam_info);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800229
Jeff Johnsonce2ba702017-10-02 13:30:24 -0700230int wlan_hdd_cfg80211_pmksa_candidate_notify(struct hdd_adapter *adapter,
Jeff Johnson172237b2017-11-07 15:32:59 -0800231 struct csr_roam_info *roam_info,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800232 int index, bool preauth);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800233
234#ifdef FEATURE_WLAN_LFR_METRICS
Jeff Johnson172237b2017-11-07 15:32:59 -0800235QDF_STATUS
236wlan_hdd_cfg80211_roam_metrics_preauth(struct hdd_adapter *adapter,
237 struct csr_roam_info *roam_info);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800238
Jeff Johnson172237b2017-11-07 15:32:59 -0800239QDF_STATUS
240wlan_hdd_cfg80211_roam_metrics_preauth_status(struct hdd_adapter *adapter,
241 struct csr_roam_info *roam_info,
242 bool preauth_status);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800243
Jeff Johnson172237b2017-11-07 15:32:59 -0800244QDF_STATUS
245wlan_hdd_cfg80211_roam_metrics_handover(struct hdd_adapter *adapter,
246 struct csr_roam_info *roam_info);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800247#endif
248
249#ifdef FEATURE_WLAN_WAPI
Jeff Johnson172237b2017-11-07 15:32:59 -0800250void wlan_hdd_cfg80211_set_key_wapi(struct hdd_adapter *adapter,
251 uint8_t key_index,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800252 const uint8_t *mac_addr, const uint8_t *key,
253 int key_Len);
254#endif
Jeff Johnson7aeb95b2017-08-28 12:06:33 -0700255struct hdd_context *hdd_cfg80211_wiphy_alloc(int priv_size);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800256
Nitesh Shah9ed1a9f2017-01-05 18:55:05 +0530257int wlan_hdd_cfg80211_tdls_scan(struct wiphy *wiphy,
258 struct cfg80211_scan_request *request,
259 uint8_t source);
260
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800261int wlan_hdd_cfg80211_scan(struct wiphy *wiphy,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800262 struct cfg80211_scan_request *request);
263
264int wlan_hdd_cfg80211_init(struct device *dev,
265 struct wiphy *wiphy, struct hdd_config *pCfg);
266
Abhishek Singhf512bf32016-05-04 16:47:46 +0530267void wlan_hdd_cfg80211_deinit(struct wiphy *wiphy);
268
Jeff Johnson7aeb95b2017-08-28 12:06:33 -0700269void wlan_hdd_update_wiphy(struct hdd_context *hdd_ctx);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800270
Yingying Tang3ba3dbc2016-09-27 16:36:58 +0800271void wlan_hdd_update_11n_mode(struct hdd_config *cfg);
272
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800273int wlan_hdd_cfg80211_register(struct wiphy *wiphy);
Ganesh Kondabattini0dc1a6e2017-07-29 12:59:19 +0530274
275/**
276 * wlan_hdd_cfg80211_register_frames() - register frame types and callbacks
277 * with the PE.
Jeff Johnsonce2ba702017-10-02 13:30:24 -0700278 * @adapter: pointer to adapter
Ganesh Kondabattini0dc1a6e2017-07-29 12:59:19 +0530279 *
280 * This function is used by HDD to register frame types which are interested
281 * by supplicant, callbacks for rx frame indication and ack.
282 *
283 * Return: 0 on success and non zero value on failure
284 */
Jeff Johnsonce2ba702017-10-02 13:30:24 -0700285int wlan_hdd_cfg80211_register_frames(struct hdd_adapter *adapter);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800286
Jeff Johnsonce2ba702017-10-02 13:30:24 -0700287void wlan_hdd_cfg80211_deregister_frames(struct hdd_adapter *adapter);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800288
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800289void hdd_reg_notifier(struct wiphy *wiphy,
290 struct regulatory_request *request);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800291
Jeff Johnsonce2ba702017-10-02 13:30:24 -0700292extern void hdd_conn_set_connection_state(struct hdd_adapter *adapter,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800293 eConnectionState connState);
Jeff Johnsonce2ba702017-10-02 13:30:24 -0700294QDF_STATUS wlan_hdd_validate_operation_channel(struct hdd_adapter *adapter,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800295 int channel);
296#ifdef FEATURE_WLAN_TDLS
297int wlan_hdd_cfg80211_send_tdls_discover_req(struct wiphy *wiphy,
298 struct net_device *dev, u8 *peer);
299#endif
Mukul Sharma3d36c392017-01-18 18:39:12 +0530300
Jeff Johnsonce2ba702017-10-02 13:30:24 -0700301void *wlan_hdd_change_country_code_cb(void *adapter);
302void hdd_select_cbmode(struct hdd_adapter *adapter, uint8_t operationChannel,
Amar Singhal5cccafe2017-02-15 12:42:58 -0800303 struct ch_params *ch_params);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800304
Krunal Soni364e0872017-05-10 21:24:34 -0700305/**
306 * wlan_hdd_is_ap_supports_immediate_power_save() - to find certain vendor APs
307 * which do not support immediate power-save.
308 * @ies: beacon IE of the AP which STA is connecting/connected to
309 * @length: beacon IE length only
310 *
311 * This API takes the IE of connected/connecting AP and determines that
312 * whether it has specific vendor OUI. If it finds then it will return false to
313 * notify that AP doesn't support immediate power-save.
314 *
315 * Return: true or false based on findings
316 */
317bool wlan_hdd_is_ap_supports_immediate_power_save(uint8_t *ies, int length);
Jeff Johnsone5006672017-08-29 14:39:02 -0700318void wlan_hdd_del_station(struct hdd_adapter *adapter);
Ryan Hsu8ecb0fa2016-01-18 15:40:55 -0800319
320#if defined(USE_CFG80211_DEL_STA_V2)
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800321int wlan_hdd_cfg80211_del_station(struct wiphy *wiphy,
322 struct net_device *dev,
323 struct station_del_parameters *param);
324#else
325#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 16, 0))
326int wlan_hdd_cfg80211_del_station(struct wiphy *wiphy,
327 struct net_device *dev,
328 const uint8_t *mac);
329#else
330int wlan_hdd_cfg80211_del_station(struct wiphy *wiphy,
331 struct net_device *dev,
332 uint8_t *mac);
333#endif
Ryan Hsu8ecb0fa2016-01-18 15:40:55 -0800334#endif /* USE_CFG80211_DEL_STA_V2 */
335
Jeff Johnsonb8944722017-09-03 09:03:19 -0700336int wlan_hdd_send_avoid_freq_event(struct hdd_context *hdd_ctx,
Kiran Kumar Lokere48795792017-07-07 15:34:29 -0700337 struct ch_avoid_ind_type *avoid_freq_list);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800338
Anurag Chouhan4085ff72017-10-05 18:09:56 +0530339/**
340 * wlan_hdd_send_hang_reason_event() - Send hang reason to the userspace
341 * @hdd_ctx: Pointer to hdd context
342 * @reason: cds recovery reason
343 *
344 * Return: 0 on success or failure reason
345 */
Jeff Johnson172237b2017-11-07 15:32:59 -0800346int wlan_hdd_send_hang_reason_event(struct hdd_context *hdd_ctx,
347 uint32_t reason);
Anurag Chouhan4085ff72017-10-05 18:09:56 +0530348
Jeff Johnson172237b2017-11-07 15:32:59 -0800349int wlan_hdd_send_avoid_freq_for_dnbs(struct hdd_context *hdd_ctx,
350 uint8_t op_chan);
Ajit Pal Singh5edd6982017-05-10 11:04:13 +0530351
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800352#ifdef FEATURE_WLAN_EXTSCAN
353void wlan_hdd_cfg80211_extscan_callback(void *ctx,
354 const uint16_t evType, void *pMsg);
355#endif /* FEATURE_WLAN_EXTSCAN */
356
Sreelakshmi Konamki88a2a412017-04-14 15:11:55 +0530357/**
358 * wlan_hdd_rso_cmd_status_cb() - HDD callback to read RSO command status
359 * @ctx: void pointer to hdd context
360 * @rso_status: rso command status
361 *
362 * This callback function is invoked by firmware to update
363 * the RSO(ROAM SCAN OFFLOAD) command status.
364 *
365 * Return: None
366 */
367void wlan_hdd_rso_cmd_status_cb(void *ctx, struct rso_cmd_status *rso_status);
368
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800369void hdd_rssi_threshold_breached(void *hddctx,
370 struct rssi_breach_event *data);
371
Jeff Johnson172237b2017-11-07 15:32:59 -0800372struct cfg80211_bss *
373wlan_hdd_cfg80211_update_bss_list(struct hdd_adapter *adapter,
374 tSirMacAddr bssid);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800375
376int wlan_hdd_cfg80211_update_bss(struct wiphy *wiphy,
Jeff Johnson172237b2017-11-07 15:32:59 -0800377 struct hdd_adapter *adapter,
378 uint32_t scan_timestamp);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800379
Jeff Johnsone5006672017-08-29 14:39:02 -0700380void wlan_hdd_cfg80211_acs_ch_select_evt(struct hdd_adapter *adapter);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800381
382#ifdef WLAN_FEATURE_ROAM_OFFLOAD
Jeff Johnsone5006672017-08-29 14:39:02 -0700383int wlan_hdd_send_roam_auth_event(struct hdd_adapter *adapter, uint8_t *bssid,
Prashanth Bhattabfc25292015-11-05 11:16:21 -0800384 uint8_t *req_rsn_ie, uint32_t req_rsn_length, uint8_t
Jeff Johnson172237b2017-11-07 15:32:59 -0800385 *rsp_rsn_ie, uint32_t rsp_rsn_length, struct csr_roam_info
Prashanth Bhattabfc25292015-11-05 11:16:21 -0800386 *roam_info_ptr);
387#else
Jeff Johnsone5006672017-08-29 14:39:02 -0700388static inline int wlan_hdd_send_roam_auth_event(struct hdd_adapter *adapter,
Prashanth Bhattabfc25292015-11-05 11:16:21 -0800389 uint8_t *bssid, uint8_t *req_rsn_ie, uint32_t req_rsn_length,
Jeff Johnson172237b2017-11-07 15:32:59 -0800390 uint8_t *rsp_rsn_ie, uint32_t rsp_rsn_length,
391 struct csr_roam_info *roam_info_ptr)
Prashanth Bhattabfc25292015-11-05 11:16:21 -0800392{
393 return 0;
394}
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800395#endif
396
Jeff Johnsone5006672017-08-29 14:39:02 -0700397int wlan_hdd_cfg80211_update_apies(struct hdd_adapter *adapter);
Manishekar Chandrasekaran9e8c7be2016-08-03 14:57:14 +0530398int wlan_hdd_request_pre_cac(uint8_t channel);
Jeff Johnsone5006672017-08-29 14:39:02 -0700399int wlan_hdd_sap_cfg_dfs_override(struct hdd_adapter *adapter);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800400
Tushnim Bhattacharyya87161582017-03-09 13:03:31 -0800401enum policy_mgr_con_mode wlan_hdd_convert_nl_iftype_to_hdd_type(
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800402 enum nl80211_iftype type);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800403
Jeff Johnson7aeb95b2017-08-28 12:06:33 -0700404int wlan_hdd_enable_dfs_chan_scan(struct hdd_context *hdd_ctx,
Kiran Kumar Lokereb1d412e2017-04-23 17:19:43 -0700405 bool enable_dfs_channels);
Deepak Dhamdhere29b3b2f2015-01-22 11:09:55 -0800406
Jeff Johnson172237b2017-11-07 15:32:59 -0800407int wlan_hdd_cfg80211_update_band(struct hdd_context *hdd_ctx,
408 struct wiphy *wiphy,
Varun Reddy Yeturua48bc412017-11-17 15:33:35 -0800409 enum band_info eBand);
Arun Khandavalli2476ef52016-04-26 20:19:43 +0530410
Krunal Soni985b8132017-02-10 18:49:08 -0800411/**
412 * wlan_hdd_try_disconnect() - try disconnnect from previous connection
Jeff Johnsonce2ba702017-10-02 13:30:24 -0700413 * @adapter: Pointer to adapter
Krunal Soni985b8132017-02-10 18:49:08 -0800414 *
415 * This function is used to disconnect from previous connection
416 *
417 * Return: 0 for success, non-zero for failure
418 */
Jeff Johnsonce2ba702017-10-02 13:30:24 -0700419int wlan_hdd_try_disconnect(struct hdd_adapter *adapter);
Krunal Soni985b8132017-02-10 18:49:08 -0800420
Mahesh A Saptasagarc35e8bf2016-06-17 20:03:46 +0530421#if defined(CFG80211_DISCONNECTED_V2) || \
422(LINUX_VERSION_CODE >= KERNEL_VERSION(4, 2, 0))
423static inline void wlan_hdd_cfg80211_indicate_disconnect(struct net_device *dev,
424 bool locally_generated,
425 int reason)
426{
427 cfg80211_disconnected(dev, reason, NULL, 0,
428 locally_generated, GFP_KERNEL);
429}
430#else
431static inline void wlan_hdd_cfg80211_indicate_disconnect(struct net_device *dev,
432 bool locally_generated,
433 int reason)
434{
435 cfg80211_disconnected(dev, reason, NULL, 0,
436 GFP_KERNEL);
437}
438#endif
Jeff Johnson4ba73cb2017-10-06 11:12:33 -0700439struct cfg80211_bss *
440wlan_hdd_cfg80211_inform_bss_frame(struct hdd_adapter *adapter,
441 struct bss_description *bss_desc);
Dustin Browna30892e2016-10-12 17:28:36 -0700442
Sreelakshmi Konamki58c72432016-11-09 17:06:44 +0530443/**
Krunal Sonied3bc8e2018-01-26 12:13:34 -0800444 * wlan_hdd_change_hw_mode_for_given_chnl() - change HW mode for given channel
445 * @adapter: pointer to adapter
446 * @channel: given channel number
447 * @reason: reason for HW mode change is needed
448 *
449 * This API decides and sets hardware mode to DBS based on given channel.
450 * For example, some of the platforms require DBS hardware mode to operate
451 * in 2.4G channel
452 *
453 * Return: 0 for success and non-zero for failure
454 */
455int wlan_hdd_change_hw_mode_for_given_chnl(struct hdd_adapter *adapter,
456 uint8_t channel,
457 enum policy_mgr_conn_update_reason reason);
458
459/**
Dustin Brown32cb4792017-06-15 15:33:42 -0700460 * hdd_rate_info_bw: an HDD internal rate bandwidth representation
461 * @HDD_RATE_BW_5: 5MHz
462 * @HDD_RATE_BW_10: 10MHz
463 * @HDD_RATE_BW_20: 20MHz
464 * @HDD_RATE_BW_40: 40MHz
465 * @HDD_RATE_BW_80: 80MHz
466 * @HDD_RATE_BW_160: 160 MHz
467 */
468enum hdd_rate_info_bw {
469 HDD_RATE_BW_5,
470 HDD_RATE_BW_10,
471 HDD_RATE_BW_20,
472 HDD_RATE_BW_40,
473 HDD_RATE_BW_80,
474 HDD_RATE_BW_160,
475};
476
477/**
478 * hdd_set_rate_bw(): Set the bandwidth for the given rate_info
479 * @info: The rate info for which the bandwidth should be set
480 * @hdd_bw: HDD representation of a rate info bandwidth
481 */
482void hdd_set_rate_bw(struct rate_info *info, enum hdd_rate_info_bw hdd_bw);
483
484/**
Sreelakshmi Konamki58c72432016-11-09 17:06:44 +0530485 * hdd_lost_link_info_cb() - callback function to get lost link information
486 * @context: HDD context
487 * @lost_link_info: lost link information
488 *
489 * Return: none
490 */
491void hdd_lost_link_info_cb(void *context,
492 struct sir_lost_link_info *lost_link_info);
Agrawal, Ashish9f84c402016-11-30 16:19:44 +0530493/*
494 * hdd_get_sap_operating_band: Get current operating channel
495 * for sap.
496 * @hdd_ctx: hdd context
497 *
498 * Return : Corresponding band for SAP operating channel
499 */
Jeff Johnson7aeb95b2017-08-28 12:06:33 -0700500uint8_t hdd_get_sap_operating_band(struct hdd_context *hdd_ctx);
Agrawal Ashish3d000b42017-02-07 13:44:50 +0530501
502/**
503 * wlan_hdd_try_disconnect() - try disconnnect from previous connection
504 * @adapter: Pointer to adapter
505 *
506 * This function is used to disconnect from previous connection
507 *
508 * Return: 0 for success, non-zero for failure
509 */
Jeff Johnsone5006672017-08-29 14:39:02 -0700510int wlan_hdd_try_disconnect(struct hdd_adapter *adapter);
Varun Reddy Yeturua5784142017-03-10 12:11:44 -0800511
Padma, Santhosh Kumar16dacfb2017-03-21 19:05:40 +0530512/**
Himanshu Agarwal6c3607a2018-01-12 12:04:19 +0530513 * wlan_hdd_disconnect() - hdd disconnect api
514 * @adapter: Pointer to adapter
515 * @reason: Disconnect reason code
516 *
517 * This function is used to issue a disconnect request to SME
518 *
519 * Return: 0 for success, non-zero for failure
520 */
521int wlan_hdd_disconnect(struct hdd_adapter *adapter, u16 reason);
522
523/**
Padma, Santhosh Kumar16dacfb2017-03-21 19:05:40 +0530524 * hdd_update_cca_info_cb() - stores congestion value in station context
525 * @context : HDD context
526 * @congestion : congestion
527 * @vdev_id : vdev id
528 *
529 * Return: None
530 */
531void hdd_update_cca_info_cb(void *context, uint32_t congestion,
532 uint32_t vdev_id);
Ajit Pal Singh5edd6982017-05-10 11:04:13 +0530533
534/**
535 * wlan_hdd_get_adjacent_chan(): Gets next/previous channel
536 * to the channel passed.
537 * @chan: Channel
538 * @upper: If "true" then next channel is returned or else
539 * previous channel is returned.
540 *
541 * This function returns the next/previous adjacent-channel to
542 * the channel passed. If "upper = true" then next channel is
543 * returned else previous is returned.
544 */
545int wlan_hdd_get_adjacent_chan(uint8_t chan, bool upper);
546
Ajit Pal Singh2c7aecd2017-05-19 15:09:23 +0530547/**
548 * wlan_hdd_merge_avoid_freqs(): Merge two tHddAvoidFreqList
549 * @destFreqList: Destination list in which merged frequency
550 * list will be available.
551 * @srcFreqList: Source frequency list.
552 *
553 * Merges two avoid_frequency lists
554 */
Kiran Kumar Lokere48795792017-07-07 15:34:29 -0700555int wlan_hdd_merge_avoid_freqs(struct ch_avoid_ind_type *destFreqList,
556 struct ch_avoid_ind_type *srcFreqList);
557
Vidyullatha Kanchanapallybe0ebb32017-03-23 14:36:21 +0530558
559/**
560 * hdd_bt_activity_cb() - callback function to receive bt activity
561 * @context: HDD context
562 * @bt_activity: specifies the kind of bt activity
563 *
564 * Return: none
565 */
566void hdd_bt_activity_cb(void *context, uint32_t bt_activity);
Vignesh Viswanathanc6d1e1c2017-09-18 12:32:49 +0530567
568/**
569 * wlan_hdd_save_gtk_offload_params() - Save gtk offload parameters in STA
570 * context for offload operations.
571 * @adapter: Adapter context
572 * @kck_ptr: KCK buffer pointer
573 * @kek_ptr: KEK buffer pointer
574 * @kek_len: KEK length
575 * @replay_ctr: Pointer to 64 bit long replay counter
576 * @big_endian: true if replay_ctr is in big endian format
577 *
578 * Return: None
579 */
580void wlan_hdd_save_gtk_offload_params(struct hdd_adapter *adapter,
581 uint8_t *kck_ptr,
582 uint8_t *kek_ptr,
583 uint32_t kek_len,
584 uint8_t *replay_ctr,
585 bool big_endian);
Deepak Dhamdhere29b3b2f2015-01-22 11:09:55 -0800586#endif