Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1 | /* |
Poddar, Siddarth | c01681a | 2016-12-21 18:36:30 +0530 | [diff] [blame] | 2 | * Copyright (c) 2012-2017 The Linux Foundation. All rights reserved. |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3 | * |
| 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 Puligilla | fdd201e | 2017-02-02 18:43:46 -0800 | [diff] [blame] | 37 | #include <wlan_cfg80211_scan.h> |
| 38 | #include <wlan_cfg80211.h> |
Frank Liu | d4b2fa0 | 2017-03-29 11:46:48 +0800 | [diff] [blame] | 39 | #ifdef CONVERGED_TDLS_ENABLE |
| 40 | #include <wlan_cfg80211_tdls.h> |
| 41 | #endif |
Sandeep Puligilla | fdd201e | 2017-02-02 18:43:46 -0800 | [diff] [blame] | 42 | |
Jeff Johnson | 7aeb95b | 2017-08-28 12:06:33 -0700 | [diff] [blame] | 43 | struct hdd_context; |
| 44 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 45 | /* value for initial part of frames and number of bytes to be compared */ |
| 46 | #define GAS_INITIAL_REQ "\x04\x0a" |
| 47 | #define GAS_INITIAL_REQ_SIZE 2 |
| 48 | |
| 49 | #define GAS_INITIAL_RSP "\x04\x0b" |
| 50 | #define GAS_INITIAL_RSP_SIZE 2 |
| 51 | |
| 52 | #define GAS_COMEBACK_REQ "\x04\x0c" |
| 53 | #define GAS_COMEBACK_REQ_SIZE 2 |
| 54 | |
| 55 | #define GAS_COMEBACK_RSP "\x04\x0d" |
| 56 | #define GAS_COMEBACK_RSP_SIZE 2 |
| 57 | |
| 58 | #define P2P_PUBLIC_ACTION_FRAME "\x04\x09\x50\x6f\x9a\x09" |
| 59 | #define P2P_PUBLIC_ACTION_FRAME_SIZE 6 |
| 60 | |
| 61 | #define P2P_ACTION_FRAME "\x7f\x50\x6f\x9a\x09" |
| 62 | #define P2P_ACTION_FRAME_SIZE 5 |
| 63 | |
| 64 | #define SA_QUERY_FRAME_REQ "\x08\x00" |
| 65 | #define SA_QUERY_FRAME_REQ_SIZE 2 |
| 66 | |
| 67 | #define SA_QUERY_FRAME_RSP "\x08\x01" |
| 68 | #define SA_QUERY_FRAME_RSP_SIZE 2 |
| 69 | |
| 70 | #define HDD_P2P_WILDCARD_SSID "DIRECT-" |
| 71 | #define HDD_P2P_WILDCARD_SSID_LEN 7 |
| 72 | |
| 73 | #define WNM_BSS_ACTION_FRAME "\x0a\x07" |
| 74 | #define WNM_BSS_ACTION_FRAME_SIZE 2 |
| 75 | |
| 76 | #define WNM_NOTIFICATION_FRAME "\x0a\x1a" |
| 77 | #define WNM_NOTIFICATION_FRAME_SIZE 2 |
| 78 | |
| 79 | #define WPA_OUI_TYPE "\x00\x50\xf2\x01" |
| 80 | #define BLACKLIST_OUI_TYPE "\x00\x50\x00\x00" |
| 81 | #define WHITELIST_OUI_TYPE "\x00\x50\x00\x01" |
| 82 | #define WPA_OUI_TYPE_SIZE 4 |
| 83 | #define WMM_OUI_TYPE "\x00\x50\xf2\x02\x01" |
| 84 | #define WMM_OUI_TYPE_SIZE 5 |
| 85 | |
Krunal Soni | 364e087 | 2017-05-10 21:24:34 -0700 | [diff] [blame] | 86 | #define VENDOR1_AP_OUI_TYPE "\x00\xE0\x4C" |
| 87 | #define VENDOR1_AP_OUI_TYPE_SIZE 3 |
| 88 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 89 | #define WLAN_BSS_MEMBERSHIP_SELECTOR_VHT_PHY 126 |
| 90 | #define WLAN_BSS_MEMBERSHIP_SELECTOR_HT_PHY 127 |
| 91 | #define BASIC_RATE_MASK 0x80 |
| 92 | #define RATE_MASK 0x7f |
| 93 | |
Sridhar Selvaraj | 8c6f5e8 | 2017-08-21 14:53:46 +0530 | [diff] [blame] | 94 | #ifndef NL80211_AUTHTYPE_FILS_SK |
| 95 | #define NL80211_AUTHTYPE_FILS_SK 5 |
| 96 | #endif |
| 97 | #ifndef NL80211_AUTHTYPE_FILS_SK_PFS |
| 98 | #define NL80211_AUTHTYPE_FILS_SK_PFS 6 |
| 99 | #endif |
| 100 | #ifndef NL80211_AUTHTYPE_FILS_PK |
| 101 | #define NL80211_AUTHTYPE_FILS_PK 7 |
| 102 | #endif |
| 103 | #ifndef WLAN_AKM_SUITE_FILS_SHA256 |
| 104 | #define WLAN_AKM_SUITE_FILS_SHA256 0x000FAC0E |
| 105 | #endif |
| 106 | #ifndef WLAN_AKM_SUITE_FILS_SHA384 |
| 107 | #define WLAN_AKM_SUITE_FILS_SHA384 0x000FAC0F |
| 108 | #endif |
| 109 | #ifndef WLAN_AKM_SUITE_FT_FILS_SHA256 |
| 110 | #define WLAN_AKM_SUITE_FT_FILS_SHA256 0x000FAC10 |
| 111 | #endif |
| 112 | #ifndef WLAN_AKM_SUITE_FT_FILS_SHA384 |
| 113 | #define WLAN_AKM_SUITE_FT_FILS_SHA384 0x000FAC11 |
| 114 | #endif |
| 115 | |
Krishna Kumaar Natarajan | da90922 | 2016-08-04 15:50:38 -0700 | [diff] [blame] | 116 | #ifdef FEATURE_WLAN_TDLS |
| 117 | #define WLAN_IS_TDLS_SETUP_ACTION(action) \ |
| 118 | ((SIR_MAC_TDLS_SETUP_REQ <= action) && \ |
| 119 | (SIR_MAC_TDLS_SETUP_CNF >= action)) |
Srinivas Girigowda | 576b235 | 2017-08-25 14:44:26 -0700 | [diff] [blame] | 120 | #if !defined(TDLS_MGMT_VERSION2) |
Krishna Kumaar Natarajan | da90922 | 2016-08-04 15:50:38 -0700 | [diff] [blame] | 121 | #define TDLS_MGMT_VERSION2 0 |
| 122 | #endif |
Tang Yingying | 43ee7ee | 2017-01-17 23:57:12 +0800 | [diff] [blame] | 123 | |
| 124 | #endif |
| 125 | |
Mahesh A Saptasagar | 6dda202 | 2016-09-03 12:59:09 +0530 | [diff] [blame] | 126 | #ifdef WLAN_FEATURE_LINK_LAYER_STATS |
| 127 | void wlan_hdd_clear_link_layer_stats(hdd_adapter_t *adapter); |
| 128 | #else |
| 129 | static inline void wlan_hdd_clear_link_layer_stats(hdd_adapter_t *adapter) {} |
| 130 | #endif |
| 131 | |
Krishna Kumaar Natarajan | da90922 | 2016-08-04 15:50:38 -0700 | [diff] [blame] | 132 | #define MAX_CHANNEL (NUM_24GHZ_CHANNELS + NUM_5GHZ_CHANNELS) |
| 133 | #define MAX_SCAN_SSID 10 |
| 134 | |
Hanumanth Reddy Pothula | 6310c77 | 2017-01-16 14:19:21 +0530 | [diff] [blame] | 135 | #define IS_CHANNEL_VALID(channel) ((channel >= 0 && channel < 15) \ |
| 136 | || (channel >= 36 && channel <= 184)) |
| 137 | |
Krishna Kumaar Natarajan | da90922 | 2016-08-04 15:50:38 -0700 | [diff] [blame] | 138 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 12, 0)) \ |
| 139 | || defined(BACKPORTED_CHANNEL_SWITCH_PRESENT) |
| 140 | #define CHANNEL_SWITCH_SUPPORTED |
| 141 | #endif |
| 142 | |
| 143 | #if defined(CFG80211_DEL_STA_V2) || (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0)) || defined(WITH_BACKPORTS) |
| 144 | #define USE_CFG80211_DEL_STA_V2 |
| 145 | #endif |
| 146 | |
Nishank Aggarwal | 4dbbc91 | 2017-05-05 14:38:24 +0530 | [diff] [blame] | 147 | #define OL_TXRX_INVALID_TDLS_PEER_ID 0xff |
| 148 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 149 | /** |
| 150 | * enum eDFS_CAC_STATUS: CAC status |
| 151 | * |
| 152 | * @DFS_CAC_NEVER_DONE: CAC never done |
| 153 | * @DFS_CAC_IN_PROGRESS: CAC is in progress |
| 154 | * @DFS_CAC_IN_PROGRESS: CAC already done |
| 155 | */ |
| 156 | typedef enum { |
| 157 | DFS_CAC_NEVER_DONE, |
| 158 | DFS_CAC_IN_PROGRESS, |
| 159 | DFS_CAC_ALREADY_DONE, |
| 160 | } eDFS_CAC_STATUS; |
| 161 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 162 | #define MAX_REQUEST_ID 0xFFFFFFFF |
| 163 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 164 | /* Feature defines */ |
| 165 | #define WIFI_FEATURE_INFRA 0x0001 /* Basic infrastructure mode */ |
| 166 | #define WIFI_FEATURE_INFRA_5G 0x0002 /* Support for 5 GHz Band */ |
| 167 | #define WIFI_FEATURE_HOTSPOT 0x0004 /* Support for GAS/ANQP */ |
| 168 | #define WIFI_FEATURE_P2P 0x0008 /* Wifi-Direct */ |
| 169 | #define WIFI_FEATURE_SOFT_AP 0x0010 /* Soft AP */ |
| 170 | #define WIFI_FEATURE_EXTSCAN 0x0020 /* Extended Scan APIs */ |
| 171 | #define WIFI_FEATURE_NAN 0x0040 /* Neighbor Awareness |
Jeff Johnson | 913c728 | 2017-01-12 09:49:05 -0800 | [diff] [blame] | 172 | * Networking |
| 173 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 174 | #define WIFI_FEATURE_D2D_RTT 0x0080 /* Device-to-device RTT */ |
| 175 | #define WIFI_FEATURE_D2AP_RTT 0x0100 /* Device-to-AP RTT */ |
| 176 | #define WIFI_FEATURE_BATCH_SCAN 0x0200 /* Batched Scan (legacy) */ |
| 177 | #define WIFI_FEATURE_PNO 0x0400 /* Preferred network offload */ |
| 178 | #define WIFI_FEATURE_ADDITIONAL_STA 0x0800 /* Support for two STAs */ |
| 179 | #define WIFI_FEATURE_TDLS 0x1000 /* Tunnel directed link |
Jeff Johnson | 913c728 | 2017-01-12 09:49:05 -0800 | [diff] [blame] | 180 | * setup |
| 181 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 182 | #define WIFI_FEATURE_TDLS_OFFCHANNEL 0x2000 /* Support for TDLS off |
Jeff Johnson | 913c728 | 2017-01-12 09:49:05 -0800 | [diff] [blame] | 183 | * channel |
| 184 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 185 | #define WIFI_FEATURE_EPR 0x4000 /* Enhanced power reporting */ |
| 186 | #define WIFI_FEATURE_AP_STA 0x8000 /* Support for AP STA |
Jeff Johnson | 913c728 | 2017-01-12 09:49:05 -0800 | [diff] [blame] | 187 | * Concurrency |
| 188 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 189 | #define WIFI_FEATURE_LINK_LAYER_STATS 0x10000 /* Link layer stats */ |
| 190 | #define WIFI_FEATURE_LOGGER 0x20000 /* WiFi Logger */ |
| 191 | #define WIFI_FEATURE_HAL_EPNO 0x40000 /* WiFi PNO enhanced */ |
| 192 | #define WIFI_FEATURE_RSSI_MONITOR 0x80000 /* RSSI Monitor */ |
Srinivas Girigowda | a2cad3e | 2016-10-25 14:14:23 -0700 | [diff] [blame] | 193 | #define WIFI_FEATURE_MKEEP_ALIVE 0x100000 /* WiFi mkeep_alive */ |
| 194 | #define WIFI_FEATURE_CONFIG_NDO 0x200000 /* ND offload configure */ |
| 195 | #define WIFI_FEATURE_TX_TRANSMIT_POWER 0x400000 /* Tx transmit power levels */ |
Srinivas Girigowda | 8df27ea | 2017-01-06 12:42:16 -0800 | [diff] [blame] | 196 | #define WIFI_FEATURE_CONTROL_ROAMING 0x800000 /* Enable/Disable roaming */ |
| 197 | #define WIFI_FEATURE_IE_WHITELIST 0x1000000 /* Support Probe IE white listing */ |
| 198 | #define WIFI_FEATURE_SCAN_RAND 0x2000000 /* Support MAC & Probe Sequence Number randomization */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 199 | |
Srinivas Girigowda | 5a1da62 | 2017-07-12 17:07:44 -0700 | [diff] [blame] | 200 | /* Support Tx Power Limit setting */ |
| 201 | #define WIFI_FEATURE_SET_TX_POWER_LIMIT 0x4000000 |
| 202 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 203 | /* Add more features here */ |
| 204 | #define WIFI_TDLS_SUPPORT BIT(0) |
| 205 | #define WIFI_TDLS_EXTERNAL_CONTROL_SUPPORT BIT(1) |
| 206 | #define WIIF_TDLS_OFFCHANNEL_SUPPORT BIT(2) |
| 207 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 208 | #define HDD_MAX_AVOID_FREQ_RANGES 4 |
| 209 | /** |
| 210 | * typedef struct sHddAvoidFreqRange - avoid frequency range |
| 211 | * |
| 212 | * @startFreq: Start frequency range |
| 213 | * @endFreq: End frequency range |
| 214 | */ |
| 215 | typedef struct sHddAvoidFreqRange { |
| 216 | u32 startFreq; |
| 217 | u32 endFreq; |
| 218 | } tHddAvoidFreqRange; |
| 219 | |
| 220 | /** |
| 221 | * typedef struct sHddAvoidFreqList - avoid frequency list |
| 222 | * |
| 223 | * @avoidFreqRangeCount: Avoid frequency range count |
| 224 | * @avoidFreqRange: Avoid frequency list |
| 225 | */ |
| 226 | typedef struct sHddAvoidFreqList { |
| 227 | u32 avoidFreqRangeCount; |
| 228 | tHddAvoidFreqRange avoidFreqRange[HDD_MAX_AVOID_FREQ_RANGES]; |
| 229 | } tHddAvoidFreqList; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 230 | |
Zhang Qian | a3bcbe0 | 2016-08-12 16:20:36 +0800 | [diff] [blame] | 231 | #define CFG_NON_AGG_RETRY_MAX (31) |
| 232 | #define CFG_AGG_RETRY_MAX (31) |
| 233 | #define CFG_MGMT_RETRY_MAX (31) |
| 234 | #define CFG_CTRL_RETRY_MAX (31) |
| 235 | #define CFG_PROPAGATION_DELAY_MAX (63) |
Zhang Qian | e9fd14b | 2017-03-08 11:29:00 +0800 | [diff] [blame] | 236 | #define CFG_PROPAGATION_DELAY_BASE (64) |
Zhang Qian | a3bcbe0 | 2016-08-12 16:20:36 +0800 | [diff] [blame] | 237 | #define CFG_AGG_RETRY_MIN (5) |
| 238 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 239 | struct cfg80211_bss *wlan_hdd_cfg80211_update_bss_db(hdd_adapter_t *pAdapter, |
| 240 | tCsrRoamInfo *pRoamInfo); |
| 241 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 242 | int wlan_hdd_cfg80211_pmksa_candidate_notify(hdd_adapter_t *pAdapter, |
| 243 | tCsrRoamInfo *pRoamInfo, |
| 244 | int index, bool preauth); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 245 | |
| 246 | #ifdef FEATURE_WLAN_LFR_METRICS |
Anurag Chouhan | fb54ab0 | 2016-02-18 18:00:46 +0530 | [diff] [blame] | 247 | QDF_STATUS wlan_hdd_cfg80211_roam_metrics_preauth(hdd_adapter_t *pAdapter, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 248 | tCsrRoamInfo *pRoamInfo); |
| 249 | |
Anurag Chouhan | fb54ab0 | 2016-02-18 18:00:46 +0530 | [diff] [blame] | 250 | QDF_STATUS wlan_hdd_cfg80211_roam_metrics_preauth_status(hdd_adapter_t * |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 251 | pAdapter, |
| 252 | tCsrRoamInfo * |
| 253 | pRoamInfo, |
| 254 | bool preauth_status); |
| 255 | |
Anurag Chouhan | fb54ab0 | 2016-02-18 18:00:46 +0530 | [diff] [blame] | 256 | QDF_STATUS wlan_hdd_cfg80211_roam_metrics_handover(hdd_adapter_t *pAdapter, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 257 | tCsrRoamInfo *pRoamInfo); |
| 258 | #endif |
| 259 | |
| 260 | #ifdef FEATURE_WLAN_WAPI |
| 261 | void wlan_hdd_cfg80211_set_key_wapi(hdd_adapter_t *pAdapter, uint8_t key_index, |
| 262 | const uint8_t *mac_addr, const uint8_t *key, |
| 263 | int key_Len); |
| 264 | #endif |
Jeff Johnson | 7aeb95b | 2017-08-28 12:06:33 -0700 | [diff] [blame] | 265 | struct hdd_context *hdd_cfg80211_wiphy_alloc(int priv_size); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 266 | |
Nitesh Shah | 9ed1a9f | 2017-01-05 18:55:05 +0530 | [diff] [blame] | 267 | int wlan_hdd_cfg80211_tdls_scan(struct wiphy *wiphy, |
| 268 | struct cfg80211_scan_request *request, |
| 269 | uint8_t source); |
| 270 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 271 | int wlan_hdd_cfg80211_scan(struct wiphy *wiphy, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 272 | struct cfg80211_scan_request *request); |
| 273 | |
| 274 | int wlan_hdd_cfg80211_init(struct device *dev, |
| 275 | struct wiphy *wiphy, struct hdd_config *pCfg); |
| 276 | |
Abhishek Singh | f512bf3 | 2016-05-04 16:47:46 +0530 | [diff] [blame] | 277 | void wlan_hdd_cfg80211_deinit(struct wiphy *wiphy); |
| 278 | |
Jeff Johnson | 7aeb95b | 2017-08-28 12:06:33 -0700 | [diff] [blame] | 279 | void wlan_hdd_update_wiphy(struct hdd_context *hdd_ctx); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 280 | |
Yingying Tang | 3ba3dbc | 2016-09-27 16:36:58 +0800 | [diff] [blame] | 281 | void wlan_hdd_update_11n_mode(struct hdd_config *cfg); |
| 282 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 283 | int wlan_hdd_cfg80211_register(struct wiphy *wiphy); |
Ganesh Kondabattini | 0dc1a6e | 2017-07-29 12:59:19 +0530 | [diff] [blame] | 284 | |
| 285 | /** |
| 286 | * wlan_hdd_cfg80211_register_frames() - register frame types and callbacks |
| 287 | * with the PE. |
| 288 | * @pAdapter: pointer to adapter |
| 289 | * |
| 290 | * This function is used by HDD to register frame types which are interested |
| 291 | * by supplicant, callbacks for rx frame indication and ack. |
| 292 | * |
| 293 | * Return: 0 on success and non zero value on failure |
| 294 | */ |
| 295 | int wlan_hdd_cfg80211_register_frames(hdd_adapter_t *pAdapter); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 296 | |
| 297 | void wlan_hdd_cfg80211_deregister_frames(hdd_adapter_t *pAdapter); |
| 298 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 299 | void hdd_reg_notifier(struct wiphy *wiphy, |
| 300 | struct regulatory_request *request); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 301 | |
| 302 | extern void hdd_conn_set_connection_state(hdd_adapter_t *pAdapter, |
| 303 | eConnectionState connState); |
Anurag Chouhan | fb54ab0 | 2016-02-18 18:00:46 +0530 | [diff] [blame] | 304 | QDF_STATUS wlan_hdd_validate_operation_channel(hdd_adapter_t *pAdapter, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 305 | int channel); |
| 306 | #ifdef FEATURE_WLAN_TDLS |
| 307 | int wlan_hdd_cfg80211_send_tdls_discover_req(struct wiphy *wiphy, |
| 308 | struct net_device *dev, u8 *peer); |
| 309 | #endif |
Mukul Sharma | 3d36c39 | 2017-01-18 18:39:12 +0530 | [diff] [blame] | 310 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 311 | void *wlan_hdd_change_country_code_cb(void *pAdapter); |
Naveen Rawat | c77e6e7 | 2016-08-05 15:19:03 -0700 | [diff] [blame] | 312 | void hdd_select_cbmode(hdd_adapter_t *pAdapter, uint8_t operationChannel, |
Amar Singhal | 5cccafe | 2017-02-15 12:42:58 -0800 | [diff] [blame] | 313 | struct ch_params *ch_params); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 314 | |
| 315 | uint8_t *wlan_hdd_cfg80211_get_ie_ptr(const uint8_t *ies_ptr, int length, |
| 316 | uint8_t eid); |
Krunal Soni | 364e087 | 2017-05-10 21:24:34 -0700 | [diff] [blame] | 317 | /** |
| 318 | * wlan_hdd_is_ap_supports_immediate_power_save() - to find certain vendor APs |
| 319 | * which do not support immediate power-save. |
| 320 | * @ies: beacon IE of the AP which STA is connecting/connected to |
| 321 | * @length: beacon IE length only |
| 322 | * |
| 323 | * This API takes the IE of connected/connecting AP and determines that |
| 324 | * whether it has specific vendor OUI. If it finds then it will return false to |
| 325 | * notify that AP doesn't support immediate power-save. |
| 326 | * |
| 327 | * Return: true or false based on findings |
| 328 | */ |
| 329 | bool wlan_hdd_is_ap_supports_immediate_power_save(uint8_t *ies, int length); |
Ryan Hsu | 8ecb0fa | 2016-01-18 15:40:55 -0800 | [diff] [blame] | 330 | void wlan_hdd_del_station(hdd_adapter_t *adapter); |
| 331 | |
| 332 | #if defined(USE_CFG80211_DEL_STA_V2) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 333 | int wlan_hdd_cfg80211_del_station(struct wiphy *wiphy, |
| 334 | struct net_device *dev, |
| 335 | struct station_del_parameters *param); |
| 336 | #else |
| 337 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 16, 0)) |
| 338 | int wlan_hdd_cfg80211_del_station(struct wiphy *wiphy, |
| 339 | struct net_device *dev, |
| 340 | const uint8_t *mac); |
| 341 | #else |
| 342 | int wlan_hdd_cfg80211_del_station(struct wiphy *wiphy, |
| 343 | struct net_device *dev, |
| 344 | uint8_t *mac); |
| 345 | #endif |
Ryan Hsu | 8ecb0fa | 2016-01-18 15:40:55 -0800 | [diff] [blame] | 346 | #endif /* USE_CFG80211_DEL_STA_V2 */ |
| 347 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 348 | |
| 349 | #if defined(QCA_WIFI_FTM) && defined(CONFIG_NL80211_TESTMODE) |
| 350 | void wlan_hdd_testmode_rx_event(void *buf, size_t buf_len); |
| 351 | #endif |
| 352 | |
Jeff Johnson | 7aeb95b | 2017-08-28 12:06:33 -0700 | [diff] [blame] | 353 | int wlan_hdd_send_avoid_freq_event(struct hdd_context *pHddCtx, |
Kiran Kumar Lokere | 4879579 | 2017-07-07 15:34:29 -0700 | [diff] [blame] | 354 | struct ch_avoid_ind_type *avoid_freq_list); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 355 | |
Jeff Johnson | 7aeb95b | 2017-08-28 12:06:33 -0700 | [diff] [blame] | 356 | int wlan_hdd_send_avoid_freq_for_dnbs(struct hdd_context *pHddCtx, uint8_t op_chan); |
Ajit Pal Singh | 5edd698 | 2017-05-10 11:04:13 +0530 | [diff] [blame] | 357 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 358 | #ifdef FEATURE_WLAN_EXTSCAN |
| 359 | void wlan_hdd_cfg80211_extscan_callback(void *ctx, |
| 360 | const uint16_t evType, void *pMsg); |
| 361 | #endif /* FEATURE_WLAN_EXTSCAN */ |
| 362 | |
Sreelakshmi Konamki | 88a2a41 | 2017-04-14 15:11:55 +0530 | [diff] [blame] | 363 | /** |
| 364 | * wlan_hdd_rso_cmd_status_cb() - HDD callback to read RSO command status |
| 365 | * @ctx: void pointer to hdd context |
| 366 | * @rso_status: rso command status |
| 367 | * |
| 368 | * This callback function is invoked by firmware to update |
| 369 | * the RSO(ROAM SCAN OFFLOAD) command status. |
| 370 | * |
| 371 | * Return: None |
| 372 | */ |
| 373 | void wlan_hdd_rso_cmd_status_cb(void *ctx, struct rso_cmd_status *rso_status); |
| 374 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 375 | void hdd_rssi_threshold_breached(void *hddctx, |
| 376 | struct rssi_breach_event *data); |
| 377 | |
| 378 | struct cfg80211_bss *wlan_hdd_cfg80211_update_bss_list(hdd_adapter_t *pAdapter, |
Abhishek Singh | c994160 | 2016-08-09 16:06:22 +0530 | [diff] [blame] | 379 | tSirMacAddr bssid); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 380 | |
| 381 | int wlan_hdd_cfg80211_update_bss(struct wiphy *wiphy, |
| 382 | hdd_adapter_t *pAdapter, |
| 383 | uint32_t scan_timestamp); |
| 384 | |
| 385 | void wlan_hdd_cfg80211_acs_ch_select_evt(hdd_adapter_t *adapter); |
| 386 | |
| 387 | #ifdef WLAN_FEATURE_ROAM_OFFLOAD |
Prakash Dhavali | 989127d | 2016-11-29 14:56:44 +0530 | [diff] [blame] | 388 | int wlan_hdd_send_roam_auth_event(hdd_adapter_t *adapter, uint8_t *bssid, |
Prashanth Bhatta | bfc2529 | 2015-11-05 11:16:21 -0800 | [diff] [blame] | 389 | uint8_t *req_rsn_ie, uint32_t req_rsn_length, uint8_t |
| 390 | *rsp_rsn_ie, uint32_t rsp_rsn_length, tCsrRoamInfo |
| 391 | *roam_info_ptr); |
| 392 | #else |
Prakash Dhavali | 989127d | 2016-11-29 14:56:44 +0530 | [diff] [blame] | 393 | static inline int wlan_hdd_send_roam_auth_event(hdd_adapter_t *adapter, |
Prashanth Bhatta | bfc2529 | 2015-11-05 11:16:21 -0800 | [diff] [blame] | 394 | uint8_t *bssid, uint8_t *req_rsn_ie, uint32_t req_rsn_length, |
| 395 | uint8_t *rsp_rsn_ie, uint32_t rsp_rsn_length, tCsrRoamInfo |
| 396 | *roam_info_ptr) |
| 397 | { |
| 398 | return 0; |
| 399 | } |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 400 | #endif |
| 401 | |
| 402 | int wlan_hdd_cfg80211_update_apies(hdd_adapter_t *adapter); |
Manishekar Chandrasekaran | 9e8c7be | 2016-08-03 14:57:14 +0530 | [diff] [blame] | 403 | int wlan_hdd_request_pre_cac(uint8_t channel); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 404 | int wlan_hdd_sap_cfg_dfs_override(hdd_adapter_t *adapter); |
| 405 | |
Tushnim Bhattacharyya | 8716158 | 2017-03-09 13:03:31 -0800 | [diff] [blame] | 406 | enum policy_mgr_con_mode wlan_hdd_convert_nl_iftype_to_hdd_type( |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 407 | enum nl80211_iftype type); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 408 | |
Jeff Johnson | 7aeb95b | 2017-08-28 12:06:33 -0700 | [diff] [blame] | 409 | int wlan_hdd_enable_dfs_chan_scan(struct hdd_context *hdd_ctx, |
Kiran Kumar Lokere | b1d412e | 2017-04-23 17:19:43 -0700 | [diff] [blame] | 410 | bool enable_dfs_channels); |
Deepak Dhamdhere | 29b3b2f | 2015-01-22 11:09:55 -0800 | [diff] [blame] | 411 | |
Jeff Johnson | 7aeb95b | 2017-08-28 12:06:33 -0700 | [diff] [blame] | 412 | int wlan_hdd_cfg80211_update_band(struct hdd_context *hdd_ctx, struct wiphy *wiphy, |
Amar Singhal | 6842e8f | 2016-02-23 16:30:32 -0800 | [diff] [blame] | 413 | eCsrBand eBand); |
Arun Khandavalli | 2476ef5 | 2016-04-26 20:19:43 +0530 | [diff] [blame] | 414 | |
Krunal Soni | 985b813 | 2017-02-10 18:49:08 -0800 | [diff] [blame] | 415 | /** |
| 416 | * wlan_hdd_try_disconnect() - try disconnnect from previous connection |
| 417 | * @pAdapter: Pointer to adapter |
| 418 | * |
| 419 | * This function is used to disconnect from previous connection |
| 420 | * |
| 421 | * Return: 0 for success, non-zero for failure |
| 422 | */ |
| 423 | int wlan_hdd_try_disconnect(hdd_adapter_t *pAdapter); |
| 424 | |
Mahesh A Saptasagar | c35e8bf | 2016-06-17 20:03:46 +0530 | [diff] [blame] | 425 | #if defined(CFG80211_DISCONNECTED_V2) || \ |
| 426 | (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 2, 0)) |
| 427 | static inline void wlan_hdd_cfg80211_indicate_disconnect(struct net_device *dev, |
| 428 | bool locally_generated, |
| 429 | int reason) |
| 430 | { |
| 431 | cfg80211_disconnected(dev, reason, NULL, 0, |
| 432 | locally_generated, GFP_KERNEL); |
| 433 | } |
| 434 | #else |
| 435 | static inline void wlan_hdd_cfg80211_indicate_disconnect(struct net_device *dev, |
| 436 | bool locally_generated, |
| 437 | int reason) |
| 438 | { |
| 439 | cfg80211_disconnected(dev, reason, NULL, 0, |
| 440 | GFP_KERNEL); |
| 441 | } |
| 442 | #endif |
Selvaraj, Sridhar | fe696d2 | 2016-08-03 21:34:51 +0530 | [diff] [blame] | 443 | struct cfg80211_bss *wlan_hdd_cfg80211_inform_bss_frame(hdd_adapter_t *pAdapter, |
| 444 | tSirBssDescription *bss_desc); |
Dustin Brown | a30892e | 2016-10-12 17:28:36 -0700 | [diff] [blame] | 445 | |
Sreelakshmi Konamki | 58c7243 | 2016-11-09 17:06:44 +0530 | [diff] [blame] | 446 | /** |
Dustin Brown | 32cb479 | 2017-06-15 15:33:42 -0700 | [diff] [blame] | 447 | * hdd_rate_info_bw: an HDD internal rate bandwidth representation |
| 448 | * @HDD_RATE_BW_5: 5MHz |
| 449 | * @HDD_RATE_BW_10: 10MHz |
| 450 | * @HDD_RATE_BW_20: 20MHz |
| 451 | * @HDD_RATE_BW_40: 40MHz |
| 452 | * @HDD_RATE_BW_80: 80MHz |
| 453 | * @HDD_RATE_BW_160: 160 MHz |
| 454 | */ |
| 455 | enum hdd_rate_info_bw { |
| 456 | HDD_RATE_BW_5, |
| 457 | HDD_RATE_BW_10, |
| 458 | HDD_RATE_BW_20, |
| 459 | HDD_RATE_BW_40, |
| 460 | HDD_RATE_BW_80, |
| 461 | HDD_RATE_BW_160, |
| 462 | }; |
| 463 | |
| 464 | /** |
| 465 | * hdd_set_rate_bw(): Set the bandwidth for the given rate_info |
| 466 | * @info: The rate info for which the bandwidth should be set |
| 467 | * @hdd_bw: HDD representation of a rate info bandwidth |
| 468 | */ |
| 469 | void hdd_set_rate_bw(struct rate_info *info, enum hdd_rate_info_bw hdd_bw); |
| 470 | |
| 471 | /** |
Sreelakshmi Konamki | 58c7243 | 2016-11-09 17:06:44 +0530 | [diff] [blame] | 472 | * hdd_lost_link_info_cb() - callback function to get lost link information |
| 473 | * @context: HDD context |
| 474 | * @lost_link_info: lost link information |
| 475 | * |
| 476 | * Return: none |
| 477 | */ |
| 478 | void hdd_lost_link_info_cb(void *context, |
| 479 | struct sir_lost_link_info *lost_link_info); |
Agrawal, Ashish | 9f84c40 | 2016-11-30 16:19:44 +0530 | [diff] [blame] | 480 | /* |
| 481 | * hdd_get_sap_operating_band: Get current operating channel |
| 482 | * for sap. |
| 483 | * @hdd_ctx: hdd context |
| 484 | * |
| 485 | * Return : Corresponding band for SAP operating channel |
| 486 | */ |
Jeff Johnson | 7aeb95b | 2017-08-28 12:06:33 -0700 | [diff] [blame] | 487 | uint8_t hdd_get_sap_operating_band(struct hdd_context *hdd_ctx); |
Agrawal Ashish | 3d000b4 | 2017-02-07 13:44:50 +0530 | [diff] [blame] | 488 | |
| 489 | /** |
| 490 | * wlan_hdd_try_disconnect() - try disconnnect from previous connection |
| 491 | * @adapter: Pointer to adapter |
| 492 | * |
| 493 | * This function is used to disconnect from previous connection |
| 494 | * |
| 495 | * Return: 0 for success, non-zero for failure |
| 496 | */ |
| 497 | int wlan_hdd_try_disconnect(hdd_adapter_t *adapter); |
Varun Reddy Yeturu | a578414 | 2017-03-10 12:11:44 -0800 | [diff] [blame] | 498 | |
| 499 | /** |
| 500 | * hdd_process_defer_disconnect() - Handle the deferred disconnect |
| 501 | * @adapter: HDD Adapter |
| 502 | * |
| 503 | * If roaming is in progress and there is a request to |
| 504 | * disconnect the session, then it is deferred. Once |
| 505 | * roaming is complete/aborted, then this routine is |
| 506 | * used to resume the disconnect that was deferred |
| 507 | * |
| 508 | * Return: None |
| 509 | */ |
| 510 | void hdd_process_defer_disconnect(hdd_adapter_t *adapter); |
| 511 | |
Kabilan Kannan | 1c1c402 | 2017-04-06 22:49:26 -0700 | [diff] [blame] | 512 | #ifndef CONVERGED_TDLS_ENABLE |
| 513 | static inline void |
| 514 | hdd_notify_sta_connect(uint8_t session_id, |
| 515 | bool tdls_chan_swit_prohibited, |
| 516 | bool tdls_prohibited, |
| 517 | struct wlan_objmgr_vdev *vdev) |
| 518 | { |
| 519 | } |
| 520 | |
| 521 | static inline |
| 522 | void hdd_notify_sta_disconnect(uint8_t session_id, |
| 523 | bool lfr_roam, |
| 524 | struct wlan_objmgr_vdev *vdev) |
| 525 | { |
| 526 | |
| 527 | } |
| 528 | |
| 529 | static inline |
| 530 | int wlan_cfg80211_tdls_configure_mode(struct wlan_objmgr_vdev *vdev, |
| 531 | uint32_t trigger_mode) |
| 532 | { |
| 533 | return 0; |
| 534 | } |
| 535 | |
| 536 | static inline |
| 537 | void hdd_notify_teardown_tdls_links(struct wlan_objmgr_vdev *vdev) |
| 538 | { |
| 539 | |
| 540 | } |
| 541 | |
| 542 | static inline |
| 543 | void ucfg_tdls_update_rx_pkt_cnt(struct wlan_objmgr_vdev *vdev, |
| 544 | struct qdf_mac_addr *mac_addr) |
| 545 | { |
| 546 | |
| 547 | } |
| 548 | |
| 549 | static inline |
| 550 | void ucfg_tdls_update_tx_pkt_cnt(struct wlan_objmgr_vdev *vdev, |
| 551 | struct qdf_mac_addr *mac_addr) |
| 552 | { |
| 553 | |
| 554 | } |
| 555 | |
| 556 | static inline |
| 557 | int wlan_cfg80211_tdls_mgmt(struct wlan_objmgr_pdev *pdev, |
| 558 | struct net_device *dev, const uint8_t *peer, |
| 559 | uint8_t action_code, uint8_t dialog_token, |
| 560 | uint16_t status_code, uint32_t peer_capability, |
| 561 | const uint8_t *buf, size_t len) |
| 562 | { |
| 563 | return 0; |
| 564 | } |
| 565 | |
| 566 | #endif |
Padma, Santhosh Kumar | 16dacfb | 2017-03-21 19:05:40 +0530 | [diff] [blame] | 567 | |
| 568 | /** |
| 569 | * hdd_update_cca_info_cb() - stores congestion value in station context |
| 570 | * @context : HDD context |
| 571 | * @congestion : congestion |
| 572 | * @vdev_id : vdev id |
| 573 | * |
| 574 | * Return: None |
| 575 | */ |
| 576 | void hdd_update_cca_info_cb(void *context, uint32_t congestion, |
| 577 | uint32_t vdev_id); |
Ajit Pal Singh | 5edd698 | 2017-05-10 11:04:13 +0530 | [diff] [blame] | 578 | |
| 579 | /** |
| 580 | * wlan_hdd_get_adjacent_chan(): Gets next/previous channel |
| 581 | * to the channel passed. |
| 582 | * @chan: Channel |
| 583 | * @upper: If "true" then next channel is returned or else |
| 584 | * previous channel is returned. |
| 585 | * |
| 586 | * This function returns the next/previous adjacent-channel to |
| 587 | * the channel passed. If "upper = true" then next channel is |
| 588 | * returned else previous is returned. |
| 589 | */ |
| 590 | int wlan_hdd_get_adjacent_chan(uint8_t chan, bool upper); |
| 591 | |
Ajit Pal Singh | 2c7aecd | 2017-05-19 15:09:23 +0530 | [diff] [blame] | 592 | /** |
| 593 | * wlan_hdd_merge_avoid_freqs(): Merge two tHddAvoidFreqList |
| 594 | * @destFreqList: Destination list in which merged frequency |
| 595 | * list will be available. |
| 596 | * @srcFreqList: Source frequency list. |
| 597 | * |
| 598 | * Merges two avoid_frequency lists |
| 599 | */ |
Kiran Kumar Lokere | 4879579 | 2017-07-07 15:34:29 -0700 | [diff] [blame] | 600 | int wlan_hdd_merge_avoid_freqs(struct ch_avoid_ind_type *destFreqList, |
| 601 | struct ch_avoid_ind_type *srcFreqList); |
| 602 | |
Vidyullatha Kanchanapally | be0ebb3 | 2017-03-23 14:36:21 +0530 | [diff] [blame] | 603 | |
| 604 | /** |
| 605 | * hdd_bt_activity_cb() - callback function to receive bt activity |
| 606 | * @context: HDD context |
| 607 | * @bt_activity: specifies the kind of bt activity |
| 608 | * |
| 609 | * Return: none |
| 610 | */ |
| 611 | void hdd_bt_activity_cb(void *context, uint32_t bt_activity); |
Deepak Dhamdhere | 29b3b2f | 2015-01-22 11:09:55 -0800 | [diff] [blame] | 612 | #endif |