Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2012-2015 The Linux Foundation. All rights reserved. |
| 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 | #if !defined(WLAN_HDD_MAIN_H) |
| 29 | #define WLAN_HDD_MAIN_H |
| 30 | /**=========================================================================== |
| 31 | |
| 32 | \file WLAN_HDD_MAIN_H.h |
| 33 | |
| 34 | \brief Linux HDD Adapter Type |
| 35 | |
| 36 | ==========================================================================*/ |
| 37 | |
| 38 | /*--------------------------------------------------------------------------- |
| 39 | Include files |
| 40 | -------------------------------------------------------------------------*/ |
| 41 | |
| 42 | #include <linux/netdevice.h> |
| 43 | #include <linux/skbuff.h> |
| 44 | #include <net/cfg80211.h> |
| 45 | #include <cdf_list.h> |
| 46 | #include <cdf_types.h> |
| 47 | #include "sir_mac_prot_def.h" |
| 48 | #include "csr_api.h" |
| 49 | #include <wlan_hdd_assoc.h> |
| 50 | #include <wlan_hdd_wmm.h> |
| 51 | #include <wlan_hdd_cfg.h> |
| 52 | #include <linux/spinlock.h> |
| 53 | #if defined(WLAN_OPEN_SOURCE) && defined(CONFIG_HAS_WAKELOCK) |
| 54 | #include <linux/wakelock.h> |
| 55 | #endif |
| 56 | #include <wlan_hdd_ftm.h> |
| 57 | #ifdef FEATURE_WLAN_TDLS |
| 58 | #include "wlan_hdd_tdls.h" |
| 59 | #endif |
| 60 | #include "wlan_hdd_cfg80211.h" |
| 61 | #include <cdf_defer.h> |
| 62 | #ifdef WLAN_FEATURE_MBSSID |
| 63 | #include "sap_api.h" |
| 64 | #endif |
| 65 | #include "ol_txrx_osif_api.h" |
| 66 | #include "ol_txrx_ctrl_api.h" |
| 67 | #include <wlan_hdd_lro.h> |
| 68 | |
| 69 | /*--------------------------------------------------------------------------- |
| 70 | Preprocessor definitions and constants |
| 71 | -------------------------------------------------------------------------*/ |
| 72 | /** Number of Tx Queues */ |
| 73 | #ifdef QCA_LL_TX_FLOW_CONTROL_V2 |
| 74 | #define NUM_TX_QUEUES 5 |
| 75 | #else |
| 76 | #define NUM_TX_QUEUES 4 |
| 77 | #endif |
Mohit Khanna | ee9e80f | 2015-11-10 11:32:49 -0800 | [diff] [blame] | 78 | |
| 79 | /** Length of the TX queue for the netdev */ |
| 80 | #define HDD_NETDEV_TX_QUEUE_LEN (3000) |
| 81 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 82 | /** Bytes to reserve in the headroom */ |
| 83 | #define LIBRA_HW_NEEDED_HEADROOM 128 |
| 84 | /** Hdd Tx Time out value */ |
| 85 | #ifdef LIBRA_LINUX_PC |
| 86 | #define HDD_TX_TIMEOUT (8000) |
| 87 | #else |
| 88 | #define HDD_TX_TIMEOUT msecs_to_jiffies(5000) |
| 89 | #endif |
| 90 | /** Hdd Default MTU */ |
| 91 | #define HDD_DEFAULT_MTU (1500) |
| 92 | |
| 93 | #ifdef QCA_CONFIG_SMP |
| 94 | #define NUM_CPUS NR_CPUS |
| 95 | #else |
| 96 | #define NUM_CPUS 1 |
| 97 | #endif |
| 98 | |
| 99 | /**event flags registered net device*/ |
| 100 | #define NET_DEVICE_REGISTERED (0) |
| 101 | #define SME_SESSION_OPENED (1) |
| 102 | #define INIT_TX_RX_SUCCESS (2) |
| 103 | #define WMM_INIT_DONE (3) |
| 104 | #define SOFTAP_BSS_STARTED (4) |
| 105 | #define DEVICE_IFACE_OPENED (5) |
| 106 | #define TDLS_INIT_DONE (6) |
| 107 | #define ACS_PENDING (7) |
| 108 | |
| 109 | /* HDD global event flags */ |
| 110 | #define ACS_IN_PROGRESS (0) |
| 111 | |
| 112 | /** Maximum time(ms)to wait for disconnect to complete **/ |
| 113 | #ifdef QCA_WIFI_3_0_EMU |
| 114 | #define WLAN_WAIT_TIME_DISCONNECT 3000 |
| 115 | #else |
| 116 | #define WLAN_WAIT_TIME_DISCONNECT 2000 |
| 117 | #endif |
| 118 | #define WLAN_WAIT_TIME_STATS 800 |
| 119 | #define WLAN_WAIT_TIME_POWER 800 |
| 120 | #define WLAN_WAIT_TIME_COUNTRY 1000 |
| 121 | #define WLAN_WAIT_TIME_LINK_STATUS 800 |
| 122 | /* Amount of time to wait for sme close session callback. |
| 123 | This value should be larger than the timeout used by WDI to wait for |
| 124 | a response from WCNSS */ |
| 125 | #define WLAN_WAIT_TIME_SESSIONOPENCLOSE 15000 |
| 126 | #define WLAN_WAIT_TIME_ABORTSCAN 2000 |
| 127 | |
| 128 | /** Maximum time(ms) to wait for mc thread suspend **/ |
| 129 | #define WLAN_WAIT_TIME_MCTHREAD_SUSPEND 1200 |
| 130 | |
| 131 | /** Maximum time(ms) to wait for target to be ready for suspend **/ |
| 132 | #define WLAN_WAIT_TIME_READY_TO_SUSPEND 2000 |
| 133 | |
| 134 | /** Maximum time(ms) to wait for tdls add sta to complete **/ |
| 135 | #define WAIT_TIME_TDLS_ADD_STA 1500 |
| 136 | |
| 137 | /** Maximum time(ms) to wait for tdls del sta to complete **/ |
| 138 | #define WAIT_TIME_TDLS_DEL_STA 1500 |
| 139 | |
| 140 | /** Maximum time(ms) to wait for Link Establish Req to complete **/ |
| 141 | #define WAIT_TIME_TDLS_LINK_ESTABLISH_REQ 1500 |
| 142 | |
| 143 | /** Maximum time(ms) to wait for tdls mgmt to complete **/ |
| 144 | #define WAIT_TIME_TDLS_MGMT 11000 |
| 145 | |
| 146 | /* Scan Req Timeout */ |
| 147 | #define WLAN_WAIT_TIME_SCAN_REQ 100 |
| 148 | |
| 149 | #define MAX_NUMBER_OF_ADAPTERS 4 |
| 150 | |
| 151 | #define MAX_CFG_STRING_LEN 255 |
| 152 | |
| 153 | #define MAC_ADDR_ARRAY(a) (a)[0], (a)[1], (a)[2], (a)[3], (a)[4], (a)[5] |
| 154 | /** Mac Address string **/ |
| 155 | #define MAC_ADDRESS_STR "%02x:%02x:%02x:%02x:%02x:%02x" |
| 156 | #define MAC_ADDRESS_STR_LEN 18 /* Including null terminator */ |
| 157 | #define MAX_GENIE_LEN 255 |
| 158 | |
| 159 | #define WLAN_CHIP_VERSION "WCNSS" |
| 160 | |
| 161 | #define hddLog(level, args ...) CDF_TRACE(CDF_MODULE_ID_HDD, level, ## args) |
| 162 | |
| 163 | #define hdd_log(level, args...) CDF_TRACE(CDF_MODULE_ID_HDD, level, ## args) |
| 164 | #define hdd_logfl(level, format, args...) hdd_log(level, FL(format), ## args) |
| 165 | |
| 166 | #define hdd_alert(format, args...) \ |
| 167 | hdd_logfl(CDF_TRACE_LEVEL_FATAL, format, ## args) |
| 168 | #define hdd_err(format, args...) \ |
| 169 | hdd_logfl(CDF_TRACE_LEVEL_ERROR, format, ## args) |
| 170 | #define hdd_warn(format, args...) \ |
| 171 | hdd_logfl(CDF_TRACE_LEVEL_WARN, format, ## args) |
| 172 | #define hdd_notice(format, args...) \ |
| 173 | hdd_logfl(CDF_TRACE_LEVEL_INFO, format, ## args) |
| 174 | #define hdd_info(format, args...) \ |
| 175 | hdd_logfl(CDF_TRACE_LEVEL_INFO_HIGH, format, ## args) |
| 176 | #define hdd_debug(format, args...) \ |
| 177 | hdd_logfl(CDF_TRACE_LEVEL_DEBUG, format, ## args) |
| 178 | |
| 179 | #define ENTER() hdd_logfl(CDF_TRACE_LEVEL_INFO_LOW, "enter") |
| 180 | #define EXIT() hdd_logfl(CDF_TRACE_LEVEL_INFO_LOW, "exit") |
| 181 | |
| 182 | #define WLAN_HDD_GET_PRIV_PTR(__dev__) (hdd_adapter_t *)(netdev_priv((__dev__))) |
| 183 | |
| 184 | #define MAX_NO_OF_2_4_CHANNELS 14 |
| 185 | |
| 186 | #define WLAN_HDD_PUBLIC_ACTION_FRAME 4 |
| 187 | #define WLAN_HDD_PUBLIC_ACTION_FRAME_OFFSET 24 |
| 188 | #define WLAN_HDD_PUBLIC_ACTION_FRAME_BODY_OFFSET 24 |
| 189 | #define WLAN_HDD_PUBLIC_ACTION_FRAME_TYPE_OFFSET 30 |
| 190 | #define WLAN_HDD_PUBLIC_ACTION_FRAME_CATEGORY_OFFSET 0 |
| 191 | #define WLAN_HDD_PUBLIC_ACTION_FRAME_ACTION_OFFSET 1 |
| 192 | #define WLAN_HDD_PUBLIC_ACTION_FRAME_OUI_OFFSET 2 |
| 193 | #define WLAN_HDD_PUBLIC_ACTION_FRAME_OUI_TYPE_OFFSET 5 |
| 194 | #define WLAN_HDD_VENDOR_SPECIFIC_ACTION 0x09 |
| 195 | #define WLAN_HDD_WFA_OUI 0x506F9A |
| 196 | #define WLAN_HDD_WFA_P2P_OUI_TYPE 0x09 |
| 197 | #define WLAN_HDD_P2P_SOCIAL_CHANNELS 3 |
| 198 | #define WLAN_HDD_P2P_SINGLE_CHANNEL_SCAN 1 |
| 199 | #define WLAN_HDD_PUBLIC_ACTION_FRAME_SUB_TYPE_OFFSET 6 |
| 200 | |
| 201 | #define WLAN_HDD_IS_SOCIAL_CHANNEL(center_freq) \ |
| 202 | (((center_freq) == 2412) || ((center_freq) == 2437) || ((center_freq) == 2462)) |
| 203 | |
| 204 | #define WLAN_HDD_CHANNEL_IN_UNII_1_BAND(center_freq) \ |
| 205 | (((center_freq) == 5180) || ((center_freq) == 5200) \ |
| 206 | || ((center_freq) == 5220) || ((center_freq) == 5240)) |
| 207 | |
| 208 | #ifdef WLAN_FEATURE_11W |
| 209 | #define WLAN_HDD_SA_QUERY_ACTION_FRAME 8 |
| 210 | #endif |
| 211 | |
| 212 | #define WLAN_HDD_PUBLIC_ACTION_TDLS_DISC_RESP 14 |
| 213 | #define WLAN_HDD_TDLS_ACTION_FRAME 12 |
| 214 | #ifdef WLAN_FEATURE_HOLD_RX_WAKELOCK |
| 215 | #define HDD_WAKE_LOCK_DURATION 50 /* in msecs */ |
| 216 | #endif |
| 217 | |
| 218 | #define WLAN_HDD_QOS_ACTION_FRAME 1 |
| 219 | #define WLAN_HDD_QOS_MAP_CONFIGURE 4 |
| 220 | #define HDD_SAP_WAKE_LOCK_DURATION 10000 /* in msecs */ |
| 221 | |
| 222 | #define HDD_MOD_EXIT_SSR_MAX_RETRIES 75 |
| 223 | |
| 224 | #ifdef WLAN_FEATURE_GTK_OFFLOAD |
| 225 | #define GTK_OFFLOAD_ENABLE 0 |
| 226 | #define GTK_OFFLOAD_DISABLE 1 |
| 227 | #endif |
| 228 | |
| 229 | #ifdef FEATURE_WLAN_SCAN_PNO |
| 230 | #define HDD_PNO_SCAN_TIMERS_SET_ONE 1 |
| 231 | /* value should not be greater than PNO_MAX_SCAN_TIMERS */ |
| 232 | #define HDD_PNO_SCAN_TIMERS_SET_MULTIPLE 6 |
| 233 | #endif |
| 234 | |
| 235 | #define MAX_USER_COMMAND_SIZE 4096 |
| 236 | |
| 237 | #define HDD_MIN_TX_POWER (-100) /* minimum tx power */ |
| 238 | #define HDD_MAX_TX_POWER (+100) /* maximum tx power */ |
| 239 | |
| 240 | /* If IPA UC data path is enabled, target should reserve extra tx descriptors |
| 241 | * for IPA data path. |
| 242 | * Then host data path should allow less TX packet pumping in case |
| 243 | * IPA data path enabled |
| 244 | */ |
| 245 | #define WLAN_TFC_IPAUC_TX_DESC_RESERVE 100 |
| 246 | |
| 247 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 14, 0)) |
| 248 | #ifdef CONFIG_CNSS |
| 249 | #define cfg80211_vendor_cmd_reply(skb) cnss_vendor_cmd_reply(skb) |
| 250 | #endif |
| 251 | #endif |
| 252 | |
| 253 | #define BSS_WAIT_TIMEOUT 10000 |
| 254 | |
| 255 | /* |
| 256 | * Generic asynchronous request/response support |
| 257 | * |
| 258 | * Many of the APIs supported by HDD require a call to SME to |
| 259 | * perform an action or to retrieve some data. In most cases SME |
| 260 | * performs the operation asynchronously, and will execute a provided |
| 261 | * callback function when the request has completed. In order to |
| 262 | * synchronize this the HDD API allocates a context which is then |
| 263 | * passed to SME, and which is then, in turn, passed back to the |
| 264 | * callback function when the operation completes. The callback |
| 265 | * function then sets a completion variable inside the context which |
| 266 | * the HDD API is waiting on. In an ideal world the HDD API would |
| 267 | * wait forever (or at least for a long time) for the response to be |
| 268 | * received and for the completion variable to be set. However in |
| 269 | * most cases these HDD APIs are being invoked in the context of a |
| 270 | * user space thread which has invoked either a cfg80211 API or a |
| 271 | * wireless extensions ioctl and which has taken the kernel rtnl_lock. |
| 272 | * Since this lock is used to synchronize many of the kernel tasks, we |
| 273 | * do not want to hold it for a long time. In addition we do not want |
| 274 | * to block user space threads (such as the wpa supplicant's main |
| 275 | * thread) for an extended time. Therefore we only block for a short |
| 276 | * time waiting for the response before we timeout. This means that |
| 277 | * it is possible for the HDD API to timeout, and for the callback to |
| 278 | * be invoked afterwards. In order for the callback function to |
| 279 | * determine if the HDD API is still waiting, a magic value is also |
| 280 | * stored in the shared context. Only if the context has a valid |
| 281 | * magic will the callback routine do any work. In order to further |
| 282 | * synchronize these activities a spinlock is used so that if any HDD |
| 283 | * API timeout coincides with its callback, the operations of the two |
| 284 | * threads will be serialized. |
| 285 | */ |
| 286 | |
| 287 | struct statsContext { |
| 288 | struct completion completion; |
| 289 | hdd_adapter_t *pAdapter; |
| 290 | unsigned int magic; |
| 291 | }; |
| 292 | |
| 293 | struct linkspeedContext { |
| 294 | struct completion completion; |
| 295 | hdd_adapter_t *pAdapter; |
| 296 | unsigned int magic; |
| 297 | }; |
| 298 | |
| 299 | extern spinlock_t hdd_context_lock; |
| 300 | |
| 301 | #define STATS_CONTEXT_MAGIC 0x53544154 /* STAT */ |
| 302 | #define RSSI_CONTEXT_MAGIC 0x52535349 /* RSSI */ |
| 303 | #define POWER_CONTEXT_MAGIC 0x504F5752 /* POWR */ |
| 304 | #define SNR_CONTEXT_MAGIC 0x534E5200 /* SNR */ |
| 305 | #define LINK_CONTEXT_MAGIC 0x4C494E4B /* LINKSPEED */ |
| 306 | #define LINK_STATUS_MAGIC 0x4C4B5354 /* LINKSTATUS(LNST) */ |
| 307 | #define TEMP_CONTEXT_MAGIC 0x74656d70 /* TEMP (temperature) */ |
| 308 | |
| 309 | /* MAX OS Q block time value in msec |
| 310 | * Prevent from permanent stall, resume OS Q if timer expired */ |
| 311 | #define WLAN_HDD_TX_FLOW_CONTROL_OS_Q_BLOCK_TIME 1000 |
| 312 | #define WLAN_SAP_HDD_TX_FLOW_CONTROL_OS_Q_BLOCK_TIME 100 |
| 313 | #define WLAN_HDD_TX_FLOW_CONTROL_MAX_24BAND_CH 14 |
| 314 | |
| 315 | #define HDD_VHT_RX_HIGHEST_SUPPORTED_DATA_RATE_1_1 390 |
| 316 | #define HDD_VHT_TX_HIGHEST_SUPPORTED_DATA_RATE_1_1 390 |
| 317 | #define HDD_VHT_RX_HIGHEST_SUPPORTED_DATA_RATE_2_2 780 |
| 318 | #define HDD_VHT_TX_HIGHEST_SUPPORTED_DATA_RATE_2_2 780 |
| 319 | |
| 320 | |
| 321 | #define NUM_TX_RX_HISTOGRAM 1024 |
| 322 | #define NUM_TX_RX_HISTOGRAM_MASK (NUM_TX_RX_HISTOGRAM - 1) |
| 323 | |
Mohit Khanna | e71e226 | 2015-11-10 09:37:24 -0800 | [diff] [blame] | 324 | /** |
| 325 | * struct hdd_tx_rx_histogram - structure to keep track of tx and rx packets |
| 326 | * received over 100ms intervals |
| 327 | * @interval_rx: # of rx packets received in the last 100ms interval |
| 328 | * @interval_tx: # of tx packets received in the last 100ms interval |
| 329 | * @total_rx: # of total rx packets received on interface |
| 330 | * @total_tx: # of total tx packets received on interface |
| 331 | * @next_vote_level: cnss_bus_width_type voting level (high or low) |
| 332 | * determined on the basis of total tx and rx packets |
| 333 | * received in the last 100ms interval |
| 334 | * @next_rx_level: cnss_bus_width_type voting level (high or low) |
| 335 | * determined on the basis of rx packets received in the |
| 336 | * last 100ms interval |
| 337 | * @next_tx_level: cnss_bus_width_type voting level (high or low) |
| 338 | * determined on the basis of tx packets received in the |
| 339 | * last 100ms interval |
| 340 | * |
| 341 | * The structure keeps track of throughput requirements of wlan driver in 100ms |
| 342 | * intervals for later analysis. |
| 343 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 344 | struct hdd_tx_rx_histogram { |
| 345 | uint64_t interval_rx; |
| 346 | uint64_t interval_tx; |
| 347 | uint64_t total_rx; |
| 348 | uint64_t total_tx; |
| 349 | uint32_t next_vote_level; |
| 350 | uint32_t next_rx_level; |
Mohit Khanna | e71e226 | 2015-11-10 09:37:24 -0800 | [diff] [blame] | 351 | uint32_t next_tx_level; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 352 | }; |
| 353 | |
| 354 | typedef struct hdd_tx_rx_stats_s { |
| 355 | /* start_xmit stats */ |
| 356 | __u32 txXmitCalled; |
| 357 | __u32 txXmitDropped; |
| 358 | __u32 txXmitClassifiedAC[NUM_TX_QUEUES]; |
| 359 | __u32 txXmitDroppedAC[NUM_TX_QUEUES]; |
| 360 | /* complete_cbk_stats */ |
| 361 | __u32 txCompleted; |
| 362 | /* rx stats */ |
| 363 | __u32 rxPackets[NUM_CPUS]; |
| 364 | __u32 rxDropped[NUM_CPUS]; |
| 365 | __u32 rxDelivered[NUM_CPUS]; |
| 366 | __u32 rxRefused[NUM_CPUS]; |
| 367 | |
| 368 | /* txflow stats */ |
| 369 | bool is_txflow_paused; |
| 370 | __u32 txflow_pause_cnt; |
| 371 | __u32 txflow_unpause_cnt; |
| 372 | __u32 txflow_timer_cnt; |
| 373 | } hdd_tx_rx_stats_t; |
| 374 | |
| 375 | #ifdef WLAN_FEATURE_11W |
| 376 | typedef struct hdd_pmf_stats_s { |
| 377 | uint8_t numUnprotDeauthRx; |
| 378 | uint8_t numUnprotDisassocRx; |
| 379 | } hdd_pmf_stats_t; |
| 380 | #endif |
| 381 | |
| 382 | typedef struct hdd_stats_s { |
| 383 | tCsrSummaryStatsInfo summary_stat; |
| 384 | tCsrGlobalClassAStatsInfo ClassA_stat; |
| 385 | tCsrGlobalClassBStatsInfo ClassB_stat; |
| 386 | tCsrGlobalClassCStatsInfo ClassC_stat; |
| 387 | tCsrGlobalClassDStatsInfo ClassD_stat; |
| 388 | tCsrPerStaStatsInfo perStaStats; |
| 389 | hdd_tx_rx_stats_t hddTxRxStats; |
| 390 | #ifdef WLAN_FEATURE_11W |
| 391 | hdd_pmf_stats_t hddPmfStats; |
| 392 | #endif |
| 393 | } hdd_stats_t; |
| 394 | |
| 395 | typedef enum { |
| 396 | HDD_ROAM_STATE_NONE, |
| 397 | |
| 398 | /* Issuing a disconnect due to transition into low power states. */ |
| 399 | HDD_ROAM_STATE_DISCONNECTING_POWER, |
| 400 | |
| 401 | /* move to this state when HDD sets a key with SME/CSR. Note this is */ |
| 402 | /* an important state to get right because we will get calls into our SME */ |
| 403 | /* callback routine for SetKey activity that we did not initiate! */ |
| 404 | HDD_ROAM_STATE_SETTING_KEY, |
| 405 | } HDD_ROAM_STATE; |
| 406 | |
| 407 | typedef struct roaming_info_s { |
| 408 | HDD_ROAM_STATE roamingState; |
| 409 | cdf_event_t roamingEvent; |
| 410 | |
| 411 | tSirMacAddr bssid; |
| 412 | tSirMacAddr peerMac; |
| 413 | uint32_t roamId; |
| 414 | eRoamCmdStatus roamStatus; |
| 415 | bool deferKeyComplete; |
| 416 | |
| 417 | } roaming_info_t; |
| 418 | |
| 419 | #ifdef FEATURE_WLAN_WAPI |
| 420 | /* Define WAPI macros for Length, BKID count etc*/ |
| 421 | #define MAX_WPI_KEY_LENGTH 16 |
| 422 | #define MAX_NUM_PN 16 |
| 423 | #define MAC_ADDR_LEN 6 |
| 424 | #define MAX_ADDR_INDEX 12 |
| 425 | #define MAX_NUM_AKM_SUITES 16 |
| 426 | #define MAX_NUM_UNI_SUITES 16 |
| 427 | #define MAX_NUM_BKIDS 16 |
| 428 | |
| 429 | /** WAPI AUTH mode definition */ |
| 430 | enum _WAPIAuthMode { |
| 431 | WAPI_AUTH_MODE_OPEN = 0, |
| 432 | WAPI_AUTH_MODE_PSK = 1, |
| 433 | WAPI_AUTH_MODE_CERT |
| 434 | } __packed; |
| 435 | typedef enum _WAPIAuthMode WAPIAuthMode; |
| 436 | |
| 437 | /** WAPI Work mode structure definition */ |
| 438 | #define WZC_ORIGINAL 0 |
| 439 | #define WAPI_EXTENTION 1 |
| 440 | |
| 441 | struct _WAPI_FUNCTION_MODE { |
| 442 | unsigned char wapiMode; |
| 443 | } __packed; |
| 444 | |
| 445 | typedef struct _WAPI_FUNCTION_MODE WAPI_FUNCTION_MODE; |
| 446 | |
| 447 | typedef struct _WAPI_BKID { |
| 448 | uint8_t bkid[16]; |
| 449 | } WAPI_BKID, *pWAPI_BKID; |
| 450 | |
| 451 | /** WAPI Association information structure definition */ |
| 452 | struct _WAPI_AssocInfo { |
| 453 | uint8_t elementID; |
| 454 | uint8_t length; |
| 455 | uint16_t version; |
| 456 | uint16_t akmSuiteCount; |
| 457 | uint32_t akmSuite[MAX_NUM_AKM_SUITES]; |
| 458 | uint16_t unicastSuiteCount; |
| 459 | uint32_t unicastSuite[MAX_NUM_UNI_SUITES]; |
| 460 | uint32_t multicastSuite; |
| 461 | uint16_t wapiCability; |
| 462 | uint16_t bkidCount; |
| 463 | WAPI_BKID bkidList[MAX_NUM_BKIDS]; |
| 464 | } __packed; |
| 465 | |
| 466 | typedef struct _WAPI_AssocInfo WAPI_AssocInfo; |
| 467 | typedef struct _WAPI_AssocInfo *pWAPI_IEAssocInfo; |
| 468 | |
| 469 | /** WAPI KEY Type definition */ |
| 470 | enum _WAPIKeyType { |
| 471 | PAIRWISE_KEY, /* 0 */ |
| 472 | GROUP_KEY /* 1 */ |
| 473 | } __packed; |
| 474 | typedef enum _WAPIKeyType WAPIKeyType; |
| 475 | |
| 476 | /** WAPI KEY Direction definition */ |
| 477 | enum _KEY_DIRECTION { |
| 478 | None, |
| 479 | Rx, |
| 480 | Tx, |
| 481 | Rx_Tx |
| 482 | } __packed; |
| 483 | |
| 484 | typedef enum _KEY_DIRECTION WAPI_KEY_DIRECTION; |
| 485 | |
| 486 | /* WAPI KEY structure definition */ |
| 487 | struct WLAN_WAPI_KEY { |
| 488 | WAPIKeyType keyType; |
| 489 | WAPI_KEY_DIRECTION keyDirection; /*reserved for future use */ |
| 490 | uint8_t keyId; |
| 491 | uint8_t addrIndex[MAX_ADDR_INDEX]; /*reserved for future use */ |
| 492 | int wpiekLen; |
| 493 | uint8_t wpiek[MAX_WPI_KEY_LENGTH]; |
| 494 | int wpickLen; |
| 495 | uint8_t wpick[MAX_WPI_KEY_LENGTH]; |
| 496 | uint8_t pn[MAX_NUM_PN]; /*reserved for future use */ |
| 497 | } __packed; |
| 498 | |
| 499 | typedef struct WLAN_WAPI_KEY WLAN_WAPI_KEY; |
| 500 | typedef struct WLAN_WAPI_KEY *pWLAN_WAPI_KEY; |
| 501 | |
| 502 | #define WPA_GET_LE16(a) ((u16) (((a)[1] << 8) | (a)[0])) |
| 503 | #define WPA_GET_BE24(a) ((u32) ((a[0] << 16) | (a[1] << 8) | a[2])) |
| 504 | #define WLAN_EID_WAPI 68 |
| 505 | #define WAPI_PSK_AKM_SUITE 0x02721400 |
| 506 | #define WAPI_CERT_AKM_SUITE 0x01721400 |
| 507 | |
| 508 | /* WAPI BKID List structure definition */ |
| 509 | struct _WLAN_BKID_LIST { |
| 510 | uint32_t length; |
| 511 | uint32_t BKIDCount; |
| 512 | WAPI_BKID BKID[1]; |
| 513 | } __packed; |
| 514 | |
| 515 | typedef struct _WLAN_BKID_LIST WLAN_BKID_LIST; |
| 516 | typedef struct _WLAN_BKID_LIST *pWLAN_BKID_LIST; |
| 517 | |
| 518 | /* WAPI Information structure definition */ |
| 519 | struct hdd_wapi_info_s { |
| 520 | uint32_t nWapiMode; |
| 521 | bool fIsWapiSta; |
| 522 | struct cdf_mac_addr cachedMacAddr; |
| 523 | uint8_t wapiAuthMode; |
| 524 | } __packed; |
| 525 | typedef struct hdd_wapi_info_s hdd_wapi_info_t; |
| 526 | #endif /* FEATURE_WLAN_WAPI */ |
| 527 | |
| 528 | typedef struct beacon_data_s { |
| 529 | u8 *head; |
| 530 | u8 *tail; |
| 531 | u8 *proberesp_ies; |
| 532 | u8 *assocresp_ies; |
| 533 | int head_len; |
| 534 | int tail_len; |
| 535 | int proberesp_ies_len; |
| 536 | int assocresp_ies_len; |
| 537 | int dtim_period; |
| 538 | } beacon_data_t; |
| 539 | |
| 540 | /* MAINTAIN 1 - 1 CORRESPONDENCE WITH tCDF_CON_MODE */ |
| 541 | typedef enum device_mode { |
| 542 | WLAN_HDD_INFRA_STATION, |
| 543 | WLAN_HDD_SOFTAP, |
| 544 | WLAN_HDD_P2P_CLIENT, |
| 545 | WLAN_HDD_P2P_GO, |
| 546 | /* Mode 5 is reserved for FTM */ |
| 547 | WLAN_HDD_FTM = 5, |
| 548 | WLAN_HDD_IBSS, |
| 549 | WLAN_HDD_P2P_DEVICE, |
| 550 | WLAN_HDD_OCB |
| 551 | } device_mode_t; |
| 552 | |
| 553 | typedef enum rem_on_channel_request_type { |
| 554 | REMAIN_ON_CHANNEL_REQUEST, |
| 555 | OFF_CHANNEL_ACTION_TX, |
| 556 | } rem_on_channel_request_type_t; |
| 557 | |
| 558 | typedef struct action_pkt_buffer { |
| 559 | uint8_t *frame_ptr; |
| 560 | uint32_t frame_length; |
| 561 | uint16_t freq; |
| 562 | } action_pkt_buffer_t; |
| 563 | |
| 564 | typedef struct hdd_remain_on_chan_ctx { |
| 565 | struct net_device *dev; |
| 566 | struct ieee80211_channel chan; |
| 567 | enum nl80211_channel_type chan_type; |
| 568 | unsigned int duration; |
| 569 | u64 cookie; |
| 570 | rem_on_channel_request_type_t rem_on_chan_request; |
| 571 | cdf_mc_timer_t hdd_remain_on_chan_timer; |
| 572 | action_pkt_buffer_t action_pkt_buff; |
| 573 | bool hdd_remain_on_chan_cancel_in_progress; |
| 574 | uint32_t scan_id; |
| 575 | } hdd_remain_on_chan_ctx_t; |
| 576 | |
| 577 | /* RoC Request entry */ |
| 578 | typedef struct hdd_roc_req { |
| 579 | cdf_list_node_t node; /* MUST be first element */ |
| 580 | hdd_adapter_t *pAdapter; |
| 581 | hdd_remain_on_chan_ctx_t *pRemainChanCtx; |
| 582 | } hdd_roc_req_t; |
| 583 | |
| 584 | /** |
| 585 | * struct hdd_scan_req - Scan Request entry |
| 586 | * @node : List entry element |
| 587 | * @adapter: Adapter address |
| 588 | * @scan_request: scan request holder |
| 589 | * @scan_id: scan identifier used across host layers which is generated at WMI |
| 590 | * @cookie: scan request identifier sent to userspace |
| 591 | * @source: scan request originator (NL/Vendor scan) |
| 592 | * @timestamp: scan request timestamp |
| 593 | * |
| 594 | * Scan request linked list element |
| 595 | */ |
| 596 | struct hdd_scan_req { |
| 597 | cdf_list_node_t node; |
| 598 | hdd_adapter_t *adapter; |
| 599 | struct cfg80211_scan_request *scan_request; |
| 600 | uint32_t scan_id; |
| 601 | uint8_t source; |
| 602 | uint32_t timestamp; |
| 603 | }; |
| 604 | |
| 605 | typedef enum { |
| 606 | HDD_IDLE, |
| 607 | HDD_PD_REQ_ACK_PENDING, |
| 608 | HDD_GO_NEG_REQ_ACK_PENDING, |
| 609 | HDD_INVALID_STATE, |
| 610 | } eP2PActionFrameState; |
| 611 | |
| 612 | typedef enum { |
| 613 | WLAN_HDD_GO_NEG_REQ, |
| 614 | WLAN_HDD_GO_NEG_RESP, |
| 615 | WLAN_HDD_GO_NEG_CNF, |
| 616 | WLAN_HDD_INVITATION_REQ, |
| 617 | WLAN_HDD_INVITATION_RESP, |
| 618 | WLAN_HDD_DEV_DIS_REQ, |
| 619 | WLAN_HDD_DEV_DIS_RESP, |
| 620 | WLAN_HDD_PROV_DIS_REQ, |
| 621 | WLAN_HDD_PROV_DIS_RESP, |
| 622 | } tActionFrmType; |
| 623 | |
| 624 | typedef struct hdd_cfg80211_state_s { |
| 625 | uint16_t current_freq; |
| 626 | u64 action_cookie; |
| 627 | uint8_t *buf; |
| 628 | size_t len; |
| 629 | hdd_remain_on_chan_ctx_t *remain_on_chan_ctx; |
| 630 | struct mutex remain_on_chan_ctx_lock; |
| 631 | eP2PActionFrameState actionFrmState; |
| 632 | } hdd_cfg80211_state_t; |
| 633 | |
| 634 | typedef enum { |
| 635 | HDD_SSR_NOT_REQUIRED, |
| 636 | HDD_SSR_REQUIRED, |
| 637 | HDD_SSR_DISABLED, |
| 638 | } e_hdd_ssr_required; |
| 639 | |
| 640 | struct hdd_station_ctx { |
| 641 | /** Handle to the Wireless Extension State */ |
| 642 | hdd_wext_state_t WextState; |
| 643 | |
| 644 | #ifdef FEATURE_WLAN_TDLS |
| 645 | tdlsCtx_t *pHddTdlsCtx; |
| 646 | #endif |
| 647 | |
| 648 | /**Connection information*/ |
| 649 | connection_info_t conn_info; |
| 650 | |
| 651 | roaming_info_t roam_info; |
| 652 | |
| 653 | #if defined (WLAN_FEATURE_VOWIFI_11R) || defined (FEATURE_WLAN_ESE) || defined(FEATURE_WLAN_LFR) |
| 654 | int ft_carrier_on; |
| 655 | #endif |
| 656 | |
| 657 | #ifdef WLAN_FEATURE_GTK_OFFLOAD |
| 658 | tSirGtkOffloadParams gtkOffloadReqParams; |
| 659 | #endif |
| 660 | /*Increment whenever ibss New peer joins and departs the network */ |
| 661 | int ibss_sta_generation; |
| 662 | |
| 663 | /* Indication of wep/wpa-none keys installation */ |
| 664 | bool ibss_enc_key_installed; |
| 665 | |
| 666 | /*Save the wep/wpa-none keys */ |
| 667 | tCsrRoamSetKey ibss_enc_key; |
| 668 | |
| 669 | bool hdd_ReassocScenario; |
| 670 | |
| 671 | /* STA ctx debug variables */ |
| 672 | int staDebugState; |
| 673 | }; |
| 674 | |
| 675 | #define BSS_STOP 0 |
| 676 | #define BSS_START 1 |
| 677 | typedef struct hdd_hostapd_state_s { |
| 678 | int bssState; |
| 679 | cdf_event_t cdf_event; |
| 680 | cdf_event_t cdf_stop_bss_event; |
| 681 | CDF_STATUS cdf_status; |
| 682 | bool bCommit; |
| 683 | |
| 684 | } hdd_hostapd_state_t; |
| 685 | |
| 686 | /* |
| 687 | * Per station structure kept in HDD for multiple station support for SoftAP |
| 688 | */ |
| 689 | typedef struct { |
| 690 | /** The station entry is used or not */ |
| 691 | bool isUsed; |
| 692 | |
| 693 | /** Station ID reported back from HAL (through SAP). Broadcast |
| 694 | * uses station ID zero by default in both libra and volans. */ |
| 695 | uint8_t ucSTAId; |
| 696 | |
| 697 | /** MAC address of the station */ |
| 698 | struct cdf_mac_addr macAddrSTA; |
| 699 | |
| 700 | /** Current Station state so HDD knows how to deal with packet |
| 701 | * queue. Most recent states used to change TLSHIM STA state */ |
| 702 | enum ol_txrx_peer_state tlSTAState; |
| 703 | |
| 704 | /** Track QoS status of station */ |
| 705 | bool isQosEnabled; |
| 706 | |
| 707 | /** The station entry for which Deauth is in progress */ |
| 708 | bool isDeauthInProgress; |
| 709 | } hdd_station_info_t; |
| 710 | |
| 711 | struct hdd_ap_ctx_s { |
| 712 | hdd_hostapd_state_t HostapdState; |
| 713 | |
| 714 | /* Memory differentiation mode is enabled */ |
| 715 | /* uint16_t uMemoryDiffThreshold; */ |
| 716 | /* uint8_t uNumActiveAC; */ |
| 717 | /* uint8_t uActiveACMask; */ |
| 718 | |
| 719 | /** Packet Count to update uNumActiveAC and uActiveACMask */ |
| 720 | /* uint16_t uUpdatePktCount; */ |
| 721 | |
| 722 | /** Station ID assigned after BSS starts */ |
| 723 | uint8_t uBCStaId; |
| 724 | |
| 725 | uint8_t uPrivacy; /* The privacy bits of configuration */ |
| 726 | |
| 727 | tSirWPSPBCProbeReq WPSPBCProbeReq; |
| 728 | |
| 729 | tsap_Config_t sapConfig; |
| 730 | |
| 731 | struct semaphore semWpsPBCOverlapInd; |
| 732 | |
| 733 | bool apDisableIntraBssFwd; |
| 734 | |
| 735 | cdf_mc_timer_t hdd_ap_inactivity_timer; |
| 736 | |
| 737 | uint8_t operatingChannel; |
| 738 | |
| 739 | bool uIsAuthenticated; |
| 740 | |
| 741 | eCsrEncryptionType ucEncryptType; |
| 742 | |
| 743 | /* This will point to group key data, if it is received before start bss. */ |
| 744 | tCsrRoamSetKey groupKey; |
| 745 | /* This will have WEP key data, if it is received before start bss */ |
| 746 | tCsrRoamSetKey wepKey[CSR_MAX_NUM_KEY]; |
| 747 | |
| 748 | beacon_data_t *beacon; |
| 749 | |
| 750 | bool bApActive; |
| 751 | #ifdef WLAN_FEATURE_MBSSID |
| 752 | /* SAP Context */ |
| 753 | void *sapContext; |
| 754 | #endif |
| 755 | bool dfs_cac_block_tx; |
| 756 | }; |
| 757 | |
| 758 | typedef struct hdd_scaninfo_s { |
| 759 | /* The scan pending */ |
| 760 | uint32_t mScanPending; |
| 761 | |
| 762 | /* Counter for mScanPending so that the scan pending |
| 763 | error log is not printed for more than 5 times */ |
| 764 | uint32_t mScanPendingCounter; |
| 765 | |
| 766 | /* Additional IE for scan */ |
| 767 | tSirAddie scanAddIE; |
| 768 | |
| 769 | /* Scan mode */ |
| 770 | tSirScanType scan_mode; |
| 771 | |
| 772 | /* completion variable for abortscan */ |
| 773 | struct completion abortscan_event_var; |
| 774 | |
| 775 | } hdd_scaninfo_t; |
| 776 | |
| 777 | #define WLAN_HDD_MAX_MC_ADDR_LIST 10 |
| 778 | |
| 779 | #ifdef WLAN_FEATURE_PACKET_FILTERING |
| 780 | typedef struct multicast_addr_list { |
| 781 | uint8_t isFilterApplied; |
| 782 | uint8_t mc_cnt; |
| 783 | uint8_t addr[WLAN_HDD_MAX_MC_ADDR_LIST][ETH_ALEN]; |
| 784 | } t_multicast_add_list; |
| 785 | #endif |
| 786 | |
| 787 | #define WLAN_HDD_MAX_HISTORY_ENTRY 10 |
| 788 | |
| 789 | /** |
| 790 | * struct hdd_netif_queue_stats - netif queue operation statistics |
| 791 | * @pause_count - pause counter |
| 792 | * @unpause_count - unpause counter |
| 793 | */ |
| 794 | struct hdd_netif_queue_stats { |
| 795 | uint16_t pause_count; |
| 796 | uint16_t unpause_count; |
| 797 | }; |
| 798 | |
| 799 | /** |
| 800 | * struct hdd_netif_queue_history - netif queue operation history |
| 801 | * @time: timestamp |
| 802 | * @netif_action: action type |
| 803 | * @netif_reason: reason type |
| 804 | * @pause_map: pause map |
| 805 | */ |
| 806 | struct hdd_netif_queue_history { |
| 807 | cdf_time_t time; |
| 808 | uint16_t netif_action; |
| 809 | uint16_t netif_reason; |
| 810 | uint32_t pause_map; |
| 811 | }; |
| 812 | |
| 813 | |
| 814 | #define WLAN_HDD_ADAPTER_MAGIC 0x574c414e /* ASCII "WLAN" */ |
| 815 | |
| 816 | |
| 817 | struct hdd_adapter_s { |
| 818 | void *pHddCtx; |
| 819 | |
| 820 | device_mode_t device_mode; |
| 821 | |
| 822 | /** Handle to the network device */ |
| 823 | struct net_device *dev; |
| 824 | |
| 825 | /** IPv4 notifier callback for handling ARP offload on change in IP */ |
| 826 | struct work_struct ipv4NotifierWorkQueue; |
| 827 | #ifdef WLAN_NS_OFFLOAD |
| 828 | /** IPv6 notifier callback for handling NS offload on change in IP */ |
| 829 | struct work_struct ipv6NotifierWorkQueue; |
| 830 | #endif |
| 831 | |
| 832 | /* TODO Move this to sta Ctx */ |
| 833 | struct wireless_dev wdev; |
| 834 | struct cfg80211_scan_request *request; |
| 835 | |
| 836 | /** ops checks if Opportunistic Power Save is Enable or Not |
| 837 | * ctw stores ctWindow value once we receive Opps command from |
| 838 | * wpa_supplicant then using ctWindow value we need to Enable |
| 839 | * Opportunistic Power Save |
| 840 | */ |
| 841 | uint8_t ops; |
| 842 | uint32_t ctw; |
| 843 | |
| 844 | /** Current MAC Address for the adapter */ |
| 845 | struct cdf_mac_addr macAddressCurrent; |
| 846 | |
| 847 | /**Event Flags*/ |
| 848 | unsigned long event_flags; |
| 849 | |
| 850 | /**Device TX/RX statistics*/ |
| 851 | struct net_device_stats stats; |
| 852 | /** HDD statistics*/ |
| 853 | hdd_stats_t hdd_stats; |
| 854 | /** linkspeed statistics */ |
| 855 | tSirLinkSpeedInfo ls_stats; |
| 856 | /**Mib information*/ |
| 857 | sHddMib_t hdd_mib; |
| 858 | |
| 859 | uint8_t sessionId; |
| 860 | |
| 861 | /* Completion variable for session close */ |
| 862 | struct completion session_close_comp_var; |
| 863 | |
| 864 | /* Completion variable for session open */ |
| 865 | struct completion session_open_comp_var; |
| 866 | |
| 867 | /* TODO: move these to sta ctx. These may not be used in AP */ |
| 868 | /** completion variable for disconnect callback */ |
| 869 | struct completion disconnect_comp_var; |
| 870 | |
| 871 | /** Completion of change country code */ |
| 872 | struct completion change_country_code; |
| 873 | |
| 874 | /* completion variable for Linkup Event */ |
| 875 | struct completion linkup_event_var; |
| 876 | |
| 877 | /* completion variable for cancel remain on channel Event */ |
| 878 | struct completion cancel_rem_on_chan_var; |
| 879 | |
| 880 | /* completion variable for off channel remain on channel Event */ |
| 881 | struct completion offchannel_tx_event; |
| 882 | /* Completion variable for action frame */ |
| 883 | struct completion tx_action_cnf_event; |
| 884 | /* Completion variable for remain on channel ready */ |
| 885 | struct completion rem_on_chan_ready_event; |
| 886 | |
| 887 | struct completion sta_authorized_event; |
| 888 | #ifdef FEATURE_WLAN_TDLS |
| 889 | struct completion tdls_add_station_comp; |
| 890 | struct completion tdls_del_station_comp; |
| 891 | struct completion tdls_mgmt_comp; |
| 892 | struct completion tdls_link_establish_req_comp; |
| 893 | CDF_STATUS tdlsAddStaStatus; |
| 894 | #endif |
| 895 | |
| 896 | /* Track whether the linkup handling is needed */ |
| 897 | bool isLinkUpSvcNeeded; |
| 898 | |
| 899 | /* Mgmt Frames TX completion status code */ |
| 900 | uint32_t mgmtTxCompletionStatus; |
| 901 | |
| 902 | /* WMM Status */ |
| 903 | hdd_wmm_status_t hddWmmStatus; |
| 904 | /************************************************************* |
| 905 | */ |
| 906 | /************************************************************* |
| 907 | * TODO - Remove it later |
| 908 | */ |
| 909 | /** Multiple station supports */ |
| 910 | /** Per-station structure */ |
| 911 | spinlock_t staInfo_lock; /* To protect access to station Info */ |
| 912 | hdd_station_info_t aStaInfo[WLAN_MAX_STA_COUNT]; |
| 913 | /* uint8_t uNumActiveStation; */ |
| 914 | |
| 915 | /************************************************************* |
| 916 | */ |
| 917 | |
| 918 | #ifdef FEATURE_WLAN_WAPI |
| 919 | hdd_wapi_info_t wapi_info; |
| 920 | #endif |
| 921 | |
| 922 | int8_t rssi; |
| 923 | #ifdef WLAN_FEATURE_LPSS |
| 924 | bool rssi_send; |
| 925 | #endif |
| 926 | |
| 927 | uint8_t snr; |
| 928 | |
| 929 | struct work_struct monTxWorkQueue; |
| 930 | struct sk_buff *skb_to_tx; |
| 931 | |
| 932 | union { |
| 933 | hdd_station_ctx_t station; |
| 934 | hdd_ap_ctx_t ap; |
| 935 | } sessionCtx; |
| 936 | |
| 937 | hdd_cfg80211_state_t cfg80211State; |
| 938 | |
| 939 | #ifdef WLAN_FEATURE_PACKET_FILTERING |
| 940 | t_multicast_add_list mc_addr_list; |
| 941 | #endif |
| 942 | uint8_t addr_filter_pattern; |
| 943 | |
| 944 | /* Magic cookie for adapter sanity verification */ |
| 945 | uint32_t magic; |
| 946 | bool higherDtimTransition; |
| 947 | bool survey_idx; |
| 948 | |
| 949 | hdd_scaninfo_t scan_info; |
| 950 | #if defined(FEATURE_WLAN_ESE) && defined(FEATURE_WLAN_ESE_UPLOAD) |
| 951 | tAniTrafStrmMetrics tsmStats; |
| 952 | #endif |
| 953 | /* Flag to ensure PSB is configured through framework */ |
| 954 | uint8_t psbChanged; |
| 955 | /* UAPSD psb value configured through framework */ |
| 956 | uint8_t configuredPsb; |
| 957 | #ifdef IPA_OFFLOAD |
| 958 | void *ipa_context; |
| 959 | #endif |
| 960 | /* Use delayed work for Sec AP ACS as Pri AP Startup need to complete |
| 961 | * since CSR (PMAC Struct) Config is same for both AP |
| 962 | */ |
| 963 | struct delayed_work acs_pending_work; |
| 964 | |
| 965 | struct work_struct scan_block_work; |
| 966 | #ifdef MSM_PLATFORM |
| 967 | unsigned long prev_rx_packets; |
| 968 | unsigned long prev_tx_packets; |
| 969 | int connection; |
| 970 | #endif |
| 971 | bool is_roc_inprogress; |
| 972 | |
| 973 | #ifdef QCA_LL_LEGACY_TX_FLOW_CONTROL |
| 974 | cdf_mc_timer_t tx_flow_control_timer; |
| 975 | bool tx_flow_timer_initialized; |
| 976 | unsigned int tx_flow_low_watermark; |
| 977 | unsigned int tx_flow_high_watermark_offset; |
| 978 | #endif /* QCA_LL_LEGACY_TX_FLOW_CONTROL */ |
| 979 | bool offloads_configured; |
| 980 | |
| 981 | /* DSCP to UP QoS Mapping */ |
| 982 | sme_QosWmmUpType hddWmmDscpToUpMap[WLAN_HDD_MAX_DSCP + 1]; |
| 983 | |
| 984 | #ifdef WLAN_FEATURE_LINK_LAYER_STATS |
| 985 | bool isLinkLayerStatsSet; |
| 986 | #endif |
| 987 | uint8_t linkStatus; |
| 988 | |
| 989 | /* variable for temperature in Celsius */ |
| 990 | int temperature; |
| 991 | |
| 992 | /* Time stamp for last completed RoC request */ |
| 993 | v_TIME_t last_roc_ts; |
| 994 | |
| 995 | /* Time stamp for start RoC request */ |
| 996 | v_TIME_t start_roc_ts; |
| 997 | |
| 998 | /* State for synchronous OCB requests to WMI */ |
| 999 | struct sir_ocb_set_config_response ocb_set_config_resp; |
| 1000 | struct sir_ocb_get_tsf_timer_response ocb_get_tsf_timer_resp; |
| 1001 | struct sir_dcc_get_stats_response *dcc_get_stats_resp; |
| 1002 | struct sir_dcc_update_ndl_response dcc_update_ndl_resp; |
| 1003 | |
| 1004 | /* MAC addresses used for OCB interfaces */ |
| 1005 | tSirMacAddr ocb_mac_address[CDF_MAX_CONCURRENCY_PERSONA]; |
| 1006 | int ocb_mac_addr_count; |
| 1007 | |
| 1008 | /* BITMAP indicating pause reason */ |
| 1009 | uint32_t pause_map; |
| 1010 | spinlock_t pause_map_lock; |
| 1011 | |
| 1012 | uint8_t history_index; |
| 1013 | struct hdd_netif_queue_history |
| 1014 | queue_oper_history[WLAN_HDD_MAX_HISTORY_ENTRY]; |
| 1015 | struct hdd_netif_queue_stats queue_oper_stats[WLAN_REASON_TYPE_MAX]; |
| 1016 | struct hdd_lro_s lro_info; |
| 1017 | }; |
| 1018 | |
| 1019 | #define WLAN_HDD_GET_STATION_CTX_PTR(pAdapter) (&(pAdapter)->sessionCtx.station) |
| 1020 | #define WLAN_HDD_GET_AP_CTX_PTR(pAdapter) (&(pAdapter)->sessionCtx.ap) |
| 1021 | #define WLAN_HDD_GET_WEXT_STATE_PTR(pAdapter) (&(pAdapter)->sessionCtx.station.WextState) |
| 1022 | #define WLAN_HDD_GET_CTX(pAdapter) ((hdd_context_t *)pAdapter->pHddCtx) |
| 1023 | #define WLAN_HDD_GET_HAL_CTX(pAdapter) (((hdd_context_t *)(pAdapter->pHddCtx))->hHal) |
| 1024 | #define WLAN_HDD_GET_HOSTAP_STATE_PTR(pAdapter) (&(pAdapter)->sessionCtx.ap.HostapdState) |
| 1025 | #define WLAN_HDD_GET_CFG_STATE_PTR(pAdapter) (&(pAdapter)->cfg80211State) |
| 1026 | #ifdef WLAN_FEATURE_MBSSID |
| 1027 | #define WLAN_HDD_GET_SAP_CTX_PTR(pAdapter) (pAdapter->sessionCtx.ap.sapContext) |
| 1028 | #endif |
| 1029 | #ifdef FEATURE_WLAN_TDLS |
| 1030 | #define WLAN_HDD_IS_TDLS_SUPPORTED_ADAPTER(pAdapter) \ |
| 1031 | (((WLAN_HDD_INFRA_STATION != pAdapter->device_mode) && \ |
| 1032 | (WLAN_HDD_P2P_CLIENT != pAdapter->device_mode)) ? 0 : 1) |
| 1033 | #define WLAN_HDD_GET_TDLS_CTX_PTR(pAdapter) \ |
| 1034 | ((WLAN_HDD_IS_TDLS_SUPPORTED_ADAPTER(pAdapter)) ? \ |
| 1035 | (tdlsCtx_t *)(pAdapter)->sessionCtx.station.pHddTdlsCtx : NULL) |
| 1036 | #endif |
| 1037 | |
| 1038 | /* Set mac address locally administered bit */ |
| 1039 | #define WLAN_HDD_RESET_LOCALLY_ADMINISTERED_BIT(macaddr) (macaddr[0] &= 0xFD) |
| 1040 | |
| 1041 | #define HDD_DEFAULT_MCC_P2P_QUOTA 70 |
| 1042 | #define HDD_RESET_MCC_P2P_QUOTA 50 |
| 1043 | |
| 1044 | typedef struct hdd_adapter_list_node { |
| 1045 | cdf_list_node_t node; /* MUST be first element */ |
| 1046 | hdd_adapter_t *pAdapter; |
| 1047 | } hdd_adapter_list_node_t; |
| 1048 | |
| 1049 | typedef struct hdd_priv_data_s { |
| 1050 | uint8_t *buf; |
| 1051 | int used_len; |
| 1052 | int total_len; |
| 1053 | } hdd_priv_data_t; |
| 1054 | |
| 1055 | #define MAX_MOD_LOGLEVEL 10 |
| 1056 | typedef struct { |
| 1057 | uint8_t enable; |
| 1058 | uint8_t dl_type; |
| 1059 | uint8_t dl_report; |
| 1060 | uint8_t dl_loglevel; |
| 1061 | uint8_t index; |
| 1062 | uint32_t dl_mod_loglevel[MAX_MOD_LOGLEVEL]; |
| 1063 | |
| 1064 | } fw_log_info; |
| 1065 | |
| 1066 | #ifdef WLAN_FEATURE_OFFLOAD_PACKETS |
| 1067 | /** |
| 1068 | * struct hdd_offloaded_packets - request id to pattern id mapping |
| 1069 | * @request_id: request id |
| 1070 | * @pattern_id: pattern id |
| 1071 | * |
| 1072 | */ |
| 1073 | struct hdd_offloaded_packets { |
| 1074 | uint32_t request_id; |
| 1075 | uint8_t pattern_id; |
| 1076 | }; |
| 1077 | |
| 1078 | /** |
| 1079 | * struct hdd_offloaded_packets_ctx - offloaded packets context |
| 1080 | * @op_table: request id to pattern id table |
| 1081 | * @op_lock: mutex lock |
| 1082 | */ |
| 1083 | struct hdd_offloaded_packets_ctx { |
| 1084 | struct hdd_offloaded_packets op_table[MAXNUM_PERIODIC_TX_PTRNS]; |
| 1085 | struct mutex op_lock; |
| 1086 | }; |
| 1087 | #endif |
| 1088 | |
| 1089 | /** Adapter structure definition */ |
| 1090 | |
| 1091 | struct hdd_context_s { |
| 1092 | /** Global CDS context */ |
| 1093 | v_CONTEXT_t pcds_context; |
| 1094 | |
| 1095 | /** HAL handle...*/ |
| 1096 | tHalHandle hHal; |
| 1097 | |
| 1098 | struct wiphy *wiphy; |
| 1099 | /* TODO Remove this from here. */ |
| 1100 | |
| 1101 | cdf_spinlock_t hdd_adapter_lock; |
| 1102 | cdf_list_t hddAdapters; /* List of adapters */ |
| 1103 | |
| 1104 | /* One per STA: 1 for BCMC_STA_ID, 1 for each SAP_SELF_STA_ID, 1 for WDS_STAID */ |
| 1105 | hdd_adapter_t *sta_to_adapter[WLAN_MAX_STA_COUNT + CDF_MAX_NO_OF_SAP_MODE + 2]; /* One per sta. For quick reference. */ |
| 1106 | |
| 1107 | /** Pointer for firmware image data */ |
| 1108 | const struct firmware *fw; |
| 1109 | |
| 1110 | /** Pointer for configuration data */ |
| 1111 | const struct firmware *cfg; |
| 1112 | |
| 1113 | /** Pointer to the parent device */ |
| 1114 | struct device *parent_dev; |
| 1115 | |
| 1116 | /** Config values read from qcom_cfg.ini file */ |
| 1117 | struct hdd_config *config; |
| 1118 | |
| 1119 | struct wlan_hdd_ftm_status ftm; |
| 1120 | |
| 1121 | /* Completion variable to indicate Mc Thread Suspended */ |
| 1122 | struct completion mc_sus_event_var; |
| 1123 | |
| 1124 | struct completion reg_init; |
| 1125 | |
| 1126 | bool isMcThreadSuspended; |
| 1127 | |
| 1128 | #ifdef QCA_CONFIG_SMP |
| 1129 | bool is_ol_rx_thread_suspended; |
| 1130 | #endif |
| 1131 | |
| 1132 | volatile bool isLogpInProgress; |
| 1133 | |
| 1134 | bool isLoadInProgress; |
| 1135 | |
| 1136 | bool isUnloadInProgress; |
| 1137 | |
| 1138 | /* Track whether Mcast/Bcast Filter is enabled. */ |
| 1139 | bool hdd_mcastbcast_filter_set; |
| 1140 | |
| 1141 | bool hdd_wlan_suspended; |
| 1142 | bool suspended; |
| 1143 | |
| 1144 | /* Lock to avoid race condition during start/stop bss */ |
| 1145 | struct mutex sap_lock; |
| 1146 | |
| 1147 | #ifdef WLAN_KD_READY_NOTIFIER |
| 1148 | bool kd_nl_init; |
| 1149 | #endif /* WLAN_KD_READY_NOTIFIER */ |
| 1150 | |
| 1151 | #ifdef FEATURE_OEM_DATA_SUPPORT |
| 1152 | /* OEM App registered or not */ |
| 1153 | bool oem_app_registered; |
| 1154 | |
| 1155 | /* OEM App Process ID */ |
| 1156 | int32_t oem_pid; |
| 1157 | #endif |
| 1158 | |
| 1159 | /** Concurrency Parameters*/ |
| 1160 | uint32_t concurrency_mode; |
| 1161 | |
| 1162 | uint8_t no_of_open_sessions[CDF_MAX_NO_OF_MODE]; |
| 1163 | uint8_t no_of_active_sessions[CDF_MAX_NO_OF_MODE]; |
| 1164 | |
| 1165 | /** P2P Device MAC Address for the adapter */ |
| 1166 | struct cdf_mac_addr p2pDeviceAddress; |
| 1167 | |
| 1168 | #ifdef WLAN_FEATURE_HOLD_RX_WAKELOCK |
| 1169 | cdf_wake_lock_t rx_wake_lock; |
| 1170 | #endif |
| 1171 | |
| 1172 | cdf_wake_lock_t sap_wake_lock; |
| 1173 | |
| 1174 | #ifdef FEATURE_WLAN_TDLS |
| 1175 | eTDLSSupportMode tdls_mode; |
| 1176 | eTDLSSupportMode tdls_mode_last; |
| 1177 | tdlsConnInfo_t tdlsConnInfo[HDD_MAX_NUM_TDLS_STA]; |
| 1178 | /* maximum TDLS station number allowed upon runtime condition */ |
| 1179 | uint16_t max_num_tdls_sta; |
| 1180 | /* TDLS peer connected count */ |
| 1181 | uint16_t connected_peer_count; |
| 1182 | tdls_scan_context_t tdls_scan_ctxt; |
| 1183 | /* Lock to avoid race condition during TDLS operations */ |
| 1184 | struct mutex tdls_lock; |
| 1185 | uint8_t tdls_off_channel; |
| 1186 | uint16_t tdls_channel_offset; |
| 1187 | #endif |
| 1188 | |
| 1189 | #ifdef IPA_OFFLOAD |
| 1190 | void *hdd_ipa; |
| 1191 | /* CE resources */ |
| 1192 | uint32_t ce_sr_base_paddr; |
| 1193 | uint32_t ce_sr_ring_size; |
| 1194 | cdf_dma_addr_t ce_reg_paddr; |
| 1195 | |
| 1196 | /* WLAN TX:IPA->WLAN */ |
| 1197 | uint32_t tx_comp_ring_base_paddr; |
| 1198 | uint32_t tx_comp_ring_size; |
| 1199 | uint32_t tx_num_alloc_buffer; |
| 1200 | |
| 1201 | /* WLAN RX:WLAN->IPA */ |
| 1202 | uint32_t rx_rdy_ring_base_paddr; |
| 1203 | uint32_t rx_rdy_ring_size; |
| 1204 | uint32_t rx_proc_done_idx_paddr; |
| 1205 | |
| 1206 | /* IPA UC doorbell registers paddr */ |
| 1207 | uint32_t tx_comp_doorbell_paddr; |
| 1208 | uint32_t rx_ready_doorbell_paddr; |
| 1209 | #endif /* IPA_OFFLOAD */ |
| 1210 | |
| 1211 | /* MC/BC Filter state variable |
| 1212 | * This always contains the value that is currently |
| 1213 | * configured |
| 1214 | * */ |
| 1215 | uint8_t configuredMcastBcastFilter; |
| 1216 | |
| 1217 | uint8_t sus_res_mcastbcast_filter; |
| 1218 | |
| 1219 | bool sus_res_mcastbcast_filter_valid; |
| 1220 | |
| 1221 | /* debugfs entry */ |
| 1222 | struct dentry *debugfs_phy; |
| 1223 | |
| 1224 | /* Use below lock to protect access to isSchedScanUpdatePending |
| 1225 | * since it will be accessed in two different contexts. |
| 1226 | */ |
| 1227 | spinlock_t schedScan_lock; |
| 1228 | |
| 1229 | /* Flag keeps track of wiphy suspend/resume */ |
| 1230 | bool isWiphySuspended; |
| 1231 | |
| 1232 | /* Indicates about pending sched_scan results */ |
| 1233 | bool isSchedScanUpdatePending; |
| 1234 | |
| 1235 | #ifdef MSM_PLATFORM |
| 1236 | /* DDR bus bandwidth compute timer |
| 1237 | */ |
| 1238 | cdf_mc_timer_t bus_bw_timer; |
| 1239 | int cur_vote_level; |
| 1240 | spinlock_t bus_bw_lock; |
| 1241 | int cur_rx_level; |
| 1242 | uint64_t prev_rx; |
Mohit Khanna | e71e226 | 2015-11-10 09:37:24 -0800 | [diff] [blame] | 1243 | int cur_tx_level; |
| 1244 | uint64_t prev_tx; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1245 | #endif |
| 1246 | /* VHT80 allowed */ |
| 1247 | bool isVHT80Allowed; |
| 1248 | |
| 1249 | struct completion ready_to_suspend; |
| 1250 | /* defining the solution type */ |
| 1251 | uint32_t target_type; |
| 1252 | |
| 1253 | /* defining the firmware version */ |
| 1254 | uint32_t target_fw_version; |
| 1255 | uint32_t dfs_radar_found; |
| 1256 | |
| 1257 | /* defining the chip/rom version */ |
| 1258 | uint32_t target_hw_version; |
| 1259 | /* defining the chip/rom revision */ |
| 1260 | uint32_t target_hw_revision; |
| 1261 | /* chip/rom name */ |
| 1262 | const char *target_hw_name; |
| 1263 | struct regulatory reg; |
| 1264 | #ifdef FEATURE_WLAN_CH_AVOID |
| 1265 | uint16_t unsafe_channel_count; |
| 1266 | uint16_t unsafe_channel_list[NUM_20MHZ_RF_CHANNELS]; |
| 1267 | #endif /* FEATURE_WLAN_CH_AVOID */ |
| 1268 | |
| 1269 | uint8_t max_intf_count; |
| 1270 | uint8_t current_intf_count; |
| 1271 | #ifdef WLAN_FEATURE_LPSS |
| 1272 | uint8_t lpss_support; |
| 1273 | #endif |
| 1274 | uint8_t ap_arpns_support; |
| 1275 | tSirScanType ioctl_scan_mode; |
| 1276 | |
| 1277 | #ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH |
| 1278 | cdf_work_t sta_ap_intf_check_work; |
| 1279 | #endif |
| 1280 | |
| 1281 | struct work_struct sap_start_work; |
| 1282 | bool is_sap_restart_required; |
| 1283 | bool is_sta_connection_pending; |
| 1284 | spinlock_t sap_update_info_lock; |
| 1285 | spinlock_t sta_update_info_lock; |
| 1286 | |
| 1287 | uint8_t dev_dfs_cac_status; |
| 1288 | |
| 1289 | bool btCoexModeSet; |
| 1290 | #ifdef FEATURE_GREEN_AP |
| 1291 | struct hdd_green_ap_ctx *green_ap_ctx; |
| 1292 | #endif |
| 1293 | fw_log_info fw_log_settings; |
| 1294 | #ifdef FEATURE_WLAN_AP_AP_ACS_OPTIMIZE |
| 1295 | cdf_mc_timer_t skip_acs_scan_timer; |
| 1296 | uint8_t skip_acs_scan_status; |
| 1297 | #endif |
| 1298 | |
| 1299 | cdf_wake_lock_t sap_dfs_wakelock; |
| 1300 | atomic_t sap_dfs_ref_cnt; |
| 1301 | |
| 1302 | #ifdef WLAN_FEATURE_EXTWOW_SUPPORT |
| 1303 | bool is_extwow_app_type1_param_set; |
| 1304 | bool is_extwow_app_type2_param_set; |
| 1305 | bool ext_wow_should_suspend; |
| 1306 | struct completion ready_to_extwow; |
| 1307 | #endif |
| 1308 | |
| 1309 | /* Time since boot up to extscan start (in micro seconds) */ |
| 1310 | uint64_t ext_scan_start_since_boot; |
| 1311 | unsigned long g_event_flags; |
| 1312 | /* RoC request queue and work */ |
| 1313 | struct delayed_work roc_req_work; |
| 1314 | cdf_spinlock_t hdd_roc_req_q_lock; |
| 1315 | cdf_list_t hdd_roc_req_q; |
| 1316 | cdf_spinlock_t hdd_scan_req_q_lock; |
| 1317 | cdf_list_t hdd_scan_req_q; |
| 1318 | uint8_t miracast_value; |
| 1319 | #ifdef WLAN_NS_OFFLOAD |
| 1320 | /* IPv6 notifier callback for handling NS offload on change in IP */ |
| 1321 | struct notifier_block ipv6_notifier; |
| 1322 | #endif |
| 1323 | /* IPv4 notifier callback for handling ARP offload on change in IP */ |
| 1324 | struct notifier_block ipv4_notifier; |
| 1325 | |
| 1326 | /* number of rf chains supported by target */ |
| 1327 | uint32_t num_rf_chains; |
| 1328 | /* Is htTxSTBC supported by target */ |
| 1329 | uint8_t ht_tx_stbc_supported; |
| 1330 | #ifdef WLAN_FEATURE_OFFLOAD_PACKETS |
| 1331 | struct hdd_offloaded_packets_ctx op_ctx; |
| 1332 | #endif |
| 1333 | bool mcc_mode; |
| 1334 | #ifdef WLAN_FEATURE_MEMDUMP |
| 1335 | uint8_t *fw_dump_loc; |
| 1336 | uint32_t dump_loc_paddr; |
| 1337 | cdf_mc_timer_t memdump_cleanup_timer; |
| 1338 | struct mutex memdump_lock; |
| 1339 | bool memdump_in_progress; |
| 1340 | #endif /* WLAN_FEATURE_MEMDUMP */ |
| 1341 | |
| 1342 | cdf_mc_timer_t dbs_opportunistic_timer; |
| 1343 | bool connection_in_progress; |
| 1344 | spinlock_t connection_status_lock; |
| 1345 | cdf_mutex_t hdd_conc_list_lock; |
| 1346 | |
| 1347 | uint16_t hdd_txrx_hist_idx; |
| 1348 | struct hdd_tx_rx_histogram hdd_txrx_hist[NUM_TX_RX_HISTOGRAM]; |
Edhar, Mahesh Kumar | 695468e | 2015-10-19 12:06:20 +0530 | [diff] [blame^] | 1349 | /* |
| 1350 | * Dfs lock used to syncronize on sap channel switch during |
| 1351 | * radar found indication and application triggered channel |
| 1352 | * switch. |
| 1353 | */ |
| 1354 | struct mutex dfs_lock; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1355 | }; |
| 1356 | |
| 1357 | /*--------------------------------------------------------------------------- |
| 1358 | Function declarations and documentation |
| 1359 | -------------------------------------------------------------------------*/ |
| 1360 | #ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH |
| 1361 | void wlan_hdd_check_sta_ap_concurrent_ch_intf(void *sta_pAdapter); |
| 1362 | #endif |
| 1363 | |
| 1364 | const char *hdd_device_mode_to_string(uint8_t device_mode); |
| 1365 | |
| 1366 | CDF_STATUS hdd_get_front_adapter(hdd_context_t *pHddCtx, |
| 1367 | hdd_adapter_list_node_t **ppAdapterNode); |
| 1368 | |
| 1369 | CDF_STATUS hdd_get_next_adapter(hdd_context_t *pHddCtx, |
| 1370 | hdd_adapter_list_node_t *pAdapterNode, |
| 1371 | hdd_adapter_list_node_t **pNextAdapterNode); |
| 1372 | |
| 1373 | CDF_STATUS hdd_remove_adapter(hdd_context_t *pHddCtx, |
| 1374 | hdd_adapter_list_node_t *pAdapterNode); |
| 1375 | |
| 1376 | CDF_STATUS hdd_remove_front_adapter(hdd_context_t *pHddCtx, |
| 1377 | hdd_adapter_list_node_t **ppAdapterNode); |
| 1378 | |
| 1379 | CDF_STATUS hdd_add_adapter_back(hdd_context_t *pHddCtx, |
| 1380 | hdd_adapter_list_node_t *pAdapterNode); |
| 1381 | |
| 1382 | CDF_STATUS hdd_add_adapter_front(hdd_context_t *pHddCtx, |
| 1383 | hdd_adapter_list_node_t *pAdapterNode); |
| 1384 | |
| 1385 | hdd_adapter_t *hdd_open_adapter(hdd_context_t *pHddCtx, uint8_t session_type, |
| 1386 | const char *name, tSirMacAddr macAddr, |
| 1387 | uint8_t rtnl_held); |
| 1388 | CDF_STATUS hdd_close_adapter(hdd_context_t *pHddCtx, hdd_adapter_t *pAdapter, |
| 1389 | uint8_t rtnl_held); |
| 1390 | CDF_STATUS hdd_close_all_adapters(hdd_context_t *pHddCtx); |
| 1391 | CDF_STATUS hdd_stop_all_adapters(hdd_context_t *pHddCtx); |
| 1392 | CDF_STATUS hdd_reset_all_adapters(hdd_context_t *pHddCtx); |
| 1393 | CDF_STATUS hdd_start_all_adapters(hdd_context_t *pHddCtx); |
| 1394 | hdd_adapter_t *hdd_get_adapter_by_vdev(hdd_context_t *pHddCtx, |
| 1395 | uint32_t vdev_id); |
| 1396 | hdd_adapter_t *hdd_get_adapter_by_macaddr(hdd_context_t *pHddCtx, |
| 1397 | tSirMacAddr macAddr); |
| 1398 | CDF_STATUS hdd_init_station_mode(hdd_adapter_t *pAdapter); |
| 1399 | hdd_adapter_t *hdd_get_adapter(hdd_context_t *pHddCtx, device_mode_t mode); |
| 1400 | void hdd_deinit_adapter(hdd_context_t *pHddCtx, hdd_adapter_t *pAdapter, |
| 1401 | bool rtnl_held); |
| 1402 | CDF_STATUS hdd_stop_adapter(hdd_context_t *pHddCtx, hdd_adapter_t *pAdapter, |
| 1403 | const bool bCloseSession); |
| 1404 | void hdd_set_station_ops(struct net_device *pWlanDev); |
| 1405 | uint8_t *wlan_hdd_get_intf_addr(hdd_context_t *pHddCtx); |
| 1406 | void wlan_hdd_release_intf_addr(hdd_context_t *pHddCtx, uint8_t *releaseAddr); |
| 1407 | uint8_t hdd_get_operating_channel(hdd_context_t *pHddCtx, device_mode_t mode); |
| 1408 | |
| 1409 | void hdd_set_conparam(uint32_t newParam); |
| 1410 | tCDF_CON_MODE hdd_get_conparam(void); |
| 1411 | |
| 1412 | void hdd_abort_mac_scan(hdd_context_t *pHddCtx, uint8_t sessionId, |
| 1413 | eCsrAbortReason reason); |
| 1414 | void hdd_cleanup_actionframe(hdd_context_t *pHddCtx, hdd_adapter_t *pAdapter); |
| 1415 | |
| 1416 | void crda_regulatory_entry_default(uint8_t *countryCode, int domain_id); |
| 1417 | void wlan_hdd_reset_prob_rspies(hdd_adapter_t *pHostapdAdapter); |
| 1418 | void hdd_prevent_suspend(uint32_t reason); |
| 1419 | void hdd_allow_suspend(uint32_t reason); |
| 1420 | void hdd_prevent_suspend_timeout(uint32_t timeout, uint32_t reason); |
| 1421 | bool hdd_is_ssr_required(void); |
| 1422 | void hdd_set_ssr_required(e_hdd_ssr_required value); |
| 1423 | |
| 1424 | void wlan_hdd_cfg80211_update_wiphy_caps(struct wiphy *wiphy); |
| 1425 | CDF_STATUS hdd_set_ibss_power_save_params(hdd_adapter_t *pAdapter); |
| 1426 | CDF_STATUS wlan_hdd_restart_driver(hdd_context_t *pHddCtx); |
| 1427 | void hdd_exchange_version_and_caps(hdd_context_t *pHddCtx); |
| 1428 | int wlan_hdd_validate_context(hdd_context_t *pHddCtx); |
| 1429 | bool hdd_is_valid_mac_address(const uint8_t *pMacAddr); |
| 1430 | CDF_STATUS hdd_issta_p2p_clientconnected(hdd_context_t *pHddCtx); |
| 1431 | |
| 1432 | void hdd_checkandupdate_phymode(hdd_context_t *pHddCtx); |
| 1433 | |
| 1434 | #ifdef MSM_PLATFORM |
| 1435 | void hdd_start_bus_bw_compute_timer(hdd_adapter_t *pAdapter); |
| 1436 | void hdd_stop_bus_bw_compute_timer(hdd_adapter_t *pAdapter); |
| 1437 | #else |
| 1438 | static inline void hdd_start_bus_bw_compute_timer(hdd_adapter_t *pAdapter) |
| 1439 | { |
| 1440 | return; |
| 1441 | } |
| 1442 | |
| 1443 | static inline void hdd_stop_bus_bw_computer_timer(hdd_adapter_t *pAdapter) |
| 1444 | { |
| 1445 | return; |
| 1446 | } |
| 1447 | #endif |
| 1448 | |
| 1449 | int hdd_wlan_startup(struct device *dev, void *hif_sc); |
| 1450 | void __hdd_wlan_exit(void); |
| 1451 | int hdd_wlan_notify_modem_power_state(int state); |
| 1452 | #ifdef QCA_HT_2040_COEX |
| 1453 | int hdd_wlan_set_ht2040_mode(hdd_adapter_t *pAdapter, uint16_t staId, |
| 1454 | struct cdf_mac_addr macAddrSTA, int width); |
| 1455 | #endif |
| 1456 | |
| 1457 | #ifdef WLAN_FEATURE_LPSS |
| 1458 | void wlan_hdd_send_status_pkg(hdd_adapter_t *pAdapter, |
| 1459 | hdd_station_ctx_t *pHddStaCtx, |
| 1460 | uint8_t is_on, uint8_t is_connected); |
| 1461 | void wlan_hdd_send_version_pkg(uint32_t fw_version, |
| 1462 | uint32_t chip_id, const char *chip_name); |
| 1463 | void wlan_hdd_send_all_scan_intf_info(hdd_context_t *pHddCtx); |
| 1464 | #endif |
| 1465 | void wlan_hdd_send_svc_nlink_msg(int type, void *data, int len); |
| 1466 | #ifdef FEATURE_WLAN_AUTO_SHUTDOWN |
| 1467 | void wlan_hdd_auto_shutdown_enable(hdd_context_t *hdd_ctx, bool enable); |
| 1468 | #endif |
| 1469 | |
| 1470 | hdd_adapter_t *hdd_get_con_sap_adapter(hdd_adapter_t *this_sap_adapter, |
| 1471 | bool check_start_bss); |
| 1472 | |
| 1473 | bool hdd_is_5g_supported(hdd_context_t *pHddCtx); |
| 1474 | |
| 1475 | int wlan_hdd_scan_abort(hdd_adapter_t *pAdapter); |
| 1476 | |
| 1477 | #ifdef WLAN_FEATURE_STATS_EXT |
| 1478 | void wlan_hdd_cfg80211_stats_ext_init(hdd_context_t *pHddCtx); |
| 1479 | #endif |
| 1480 | |
| 1481 | #ifdef WLAN_FEATURE_LINK_LAYER_STATS |
| 1482 | void wlan_hdd_cfg80211_link_layer_stats_init(hdd_context_t *pHddCtx); |
| 1483 | static inline bool hdd_link_layer_stats_supported(void) |
| 1484 | { |
| 1485 | return true; |
| 1486 | } |
| 1487 | #else |
| 1488 | static inline bool hdd_link_layer_stats_supported(void) |
| 1489 | { |
| 1490 | return false; |
| 1491 | } |
| 1492 | #endif /* WLAN_FEATURE_LINK_LAYER_STATS */ |
| 1493 | |
| 1494 | void hdd_get_fw_version(hdd_context_t *hdd_ctx, |
| 1495 | uint32_t *major_spid, uint32_t *minor_spid, |
| 1496 | uint32_t *siid, uint32_t *crmid); |
| 1497 | |
| 1498 | #ifdef WLAN_FEATURE_MEMDUMP |
| 1499 | /** |
| 1500 | * hdd_is_memdump_supported() - to check if memdump feature support |
| 1501 | * |
| 1502 | * This function is used to check if memdump feature is supported in |
| 1503 | * the host driver |
| 1504 | * |
| 1505 | * Return: true if supported and false otherwise |
| 1506 | */ |
| 1507 | static inline bool hdd_is_memdump_supported(void) |
| 1508 | { |
| 1509 | return true; |
| 1510 | } |
| 1511 | #else |
| 1512 | static inline bool hdd_is_memdump_supported(void) |
| 1513 | { |
| 1514 | return false; |
| 1515 | } |
| 1516 | #endif /* WLAN_FEATURE_MEMDUMP */ |
| 1517 | |
| 1518 | void hdd_update_macaddr(struct hdd_config *config, |
| 1519 | struct cdf_mac_addr hw_macaddr); |
| 1520 | #if defined(FEATURE_WLAN_LFR) |
| 1521 | void wlan_hdd_disable_roaming(hdd_adapter_t *pAdapter); |
| 1522 | void wlan_hdd_enable_roaming(hdd_adapter_t *pAdapter); |
| 1523 | #endif |
| 1524 | |
| 1525 | CDF_STATUS hdd_post_cds_enable_config(hdd_context_t *pHddCtx); |
| 1526 | |
| 1527 | CDF_STATUS hdd_abort_mac_scan_all_adapters(hdd_context_t *hdd_ctx); |
| 1528 | |
| 1529 | CDF_STATUS wlan_hdd_check_custom_con_channel_rules(hdd_adapter_t *sta_adapter, |
| 1530 | hdd_adapter_t *ap_adapter, |
| 1531 | tCsrRoamProfile *roam_profile, |
| 1532 | tScanResultHandle *scan_cache, |
| 1533 | bool *concurrent_chnl_same); |
| 1534 | #ifdef WLAN_FEATURE_MBSSID |
| 1535 | void wlan_hdd_stop_sap(hdd_adapter_t *ap_adapter); |
| 1536 | void wlan_hdd_start_sap(hdd_adapter_t *ap_adapter); |
| 1537 | #else |
| 1538 | static inline void wlan_hdd_stop_sap(hdd_adapter_t *ap_adapter) {} |
| 1539 | static inline void wlan_hdd_start_sap(hdd_adapter_t *ap_adapter) {} |
| 1540 | #endif |
| 1541 | cdf_wake_lock_t *hdd_wlan_get_wake_lock_ptr(void); |
| 1542 | |
| 1543 | #ifdef QCA_CONFIG_SMP |
| 1544 | int wlan_hdd_get_cpu(void); |
| 1545 | #else |
| 1546 | static inline int wlan_hdd_get_cpu(void) |
| 1547 | { |
| 1548 | return 0; |
| 1549 | } |
| 1550 | #endif |
| 1551 | |
| 1552 | void wlan_hdd_txrx_pause_cb(uint8_t vdev_id, |
| 1553 | enum netif_action_type action, enum netif_reason_type reason); |
| 1554 | |
| 1555 | void hdd_wlan_dump_stats(hdd_adapter_t *adapter, int value); |
| 1556 | void wlan_hdd_display_tx_rx_histogram(hdd_context_t *pHddCtx); |
| 1557 | void wlan_hdd_clear_tx_rx_histogram(hdd_context_t *pHddCtx); |
| 1558 | void wlan_hdd_display_netif_queue_history(hdd_context_t *hdd_ctx); |
| 1559 | void wlan_hdd_clear_netif_queue_history(hdd_context_t *hdd_ctx); |
| 1560 | const char *hdd_get_fwpath(void); |
| 1561 | |
| 1562 | #endif /* end #if !defined(WLAN_HDD_MAIN_H) */ |