diff options
| author | Linux Build Service Account <lnxbuild@localhost> | 2016-07-29 17:09:22 -0600 |
|---|---|---|
| committer | Linux Build Service Account <lnxbuild@localhost> | 2016-07-29 17:09:22 -0600 |
| commit | e80d716e1f70eea3f68bd179096606a7ffa8f999 (patch) | |
| tree | 0b2d3120fbdff32a948c705155bb943326df3379 | |
| parent | ae51e089f64c0e413256847a476942742794404e (diff) | |
| parent | 83c2ebaaa2a39445f6cd2f677cd6b27d8122f293 (diff) | |
Promotion of wlan-cld3.driver.lnx.1.1-00064.
CRs Change ID Subject
--------------------------------------------------------------------------------------------------------------
1035792 I56a8eea67354f9516b974db74aa42fbad37592a0 qcacld-3.0: refactor hdd_wlan_get_version to be adapter
1038237 I52c35a44598028115c48aff7827f3fc90bd48cb1 qcacld-3.0: Fix NPD of ies_local in csr_roam_join_handle
1044693 I8797b298e46213ace014557697a449ea4ae560b6 qcacld-3.0: Fix TDLS VHT channel width information
1043189 I9837160b42f72aa53872a0c2814058c0576289d4 qcacld-3.0: Remove duplicate entry of the STA
1044268 I40e7de6dbc093e93053c12d4628b543b32cece6b qcacld-3.0: Check for LFR3 to call appropriate API in hd
688141 I4c0b82d2322e78c844246ea32fc9e327b140e1cd Release 5.1.0.22I
1044706 Ibd6fc4d62799783721acee7c9cc339ac6febd2e5 qcacld-3.0: Fix memory allocation error in TDLS peer_ass
1010596 Idf1a7058009a8d2082bc1742dca1364cf59c405b qcacld-3.0: Use Reassociation during BSS Transition
1010596 1046841 Ib0f894d329146d11fe80995248e3b3c343fb7372 qcacld-3.0: Do not start new connection if cfg80211 requ
1026817 I2da9018ff2fa6188e61e007c896bc13e8fddcb7d qcacld-3.0: Refactor hdd callback (de)registration into
1017332 Ic22aca5b3f8c4e5f3a1e4d8f60bf6f95bbfeee14 qcacld-3.0: Create different functions for the (de)initi
1026817 Iff149cc51ea5eacae4f84d83c51d0ed63834ba50 qcacld-3.0: Create ini config structures for cds
1044864 I69525bc15261cf6bf9ee525fc0517c3661506f44 qcacld-3.0: Add NPD check wma_set_wifi_start_packet_stat
1043757 If78e7d4fb2238c1e83ee4f8f71a9ace2fcaddfd9 qcacld-3.0: Fix the Nss config issues in 160MHz
688141 I3b20fe9b511e9009d2315374b8873e4bedf3936d Release 5.1.0.22H
688141 Ie0106474bc3467a8c22e642d175b6dbf6bde7d35 Release 5.1.0.22G
1046463 I844c19d18e6f71916592c4b35ff5f1a2b6cdbaa0 qcacld-3.0: Fix use of spinlock for pSchedContext->affin
1017335 I1c31e4e2ce17dd296a0555653aec6ff75abf71d0 qcacld-3.0: Create new wrapper function for setting fw p
Change-Id: I9cdb85915d7a29be6d33b572ef409b87fe8ecfd2
CRs-Fixed: 1017335, 1043757, 1044268, 1046463, 1044706, 688141, 1026817, 1043189, 1035792, 1046841, 1044693, 1038237, 1010596, 1044864, 1017332
50 files changed, 1542 insertions, 684 deletions
diff --git a/core/cds/inc/cds_api.h b/core/cds/inc/cds_api.h index 9e9774fe99a1..bb8cf4a58032 100644 --- a/core/cds/inc/cds_api.h +++ b/core/cds/inc/cds_api.h @@ -279,4 +279,8 @@ void cds_tdls_tx_rx_mgmt_event(uint8_t event_id, uint8_t tx_rx, int cds_get_radio_index(void); QDF_STATUS cds_set_radio_index(int radio_index); +void cds_init_ini_config(struct cds_config_info *cds_cfg); +void cds_deinit_ini_config(void); +struct cds_config_info *cds_get_ini_config(void); + #endif /* if !defined __CDS_API_H */ diff --git a/core/cds/inc/cds_concurrency.h b/core/cds/inc/cds_concurrency.h index 558014a49396..a5b643e263d5 100644 --- a/core/cds/inc/cds_concurrency.h +++ b/core/cds/inc/cds_concurrency.h @@ -772,6 +772,7 @@ QDF_STATUS cds_reset_sap_mandatory_channels(void); #ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH QDF_STATUS cds_register_sap_restart_channel_switch_cb( void (*sap_restart_chan_switch_cb)(void *, uint32_t, uint32_t)); +QDF_STATUS cds_deregister_sap_restart_channel_switch_cb(void); #endif QDF_STATUS cds_get_pcl_for_existing_conn(enum cds_con_mode mode, uint8_t *pcl_ch, uint32_t *len, diff --git a/core/cds/inc/cds_config.h b/core/cds/inc/cds_config.h new file mode 100644 index 000000000000..5d2eafb9eb9f --- /dev/null +++ b/core/cds/inc/cds_config.h @@ -0,0 +1,135 @@ +/* + * Copyright (c) 2016 The Linux Foundation. All rights reserved. + * + * Permission to use, copy, modify, and/or distribute this software for + * any purpose with or without fee is hereby granted, provided that the + * above copyright notice and this permission notice appear in all + * copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL + * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE + * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL + * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR + * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER + * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. + */ + +/** + * DOC: cds_config.h + * + * Defines the configuration Information for various modules. Default values + * are read from the INI file and saved into cds_config_info which are passed + * to various modules for the initialization. + */ + +#if !defined(__CDS_CONFIG_H) +#define __CDS_CONFIG_H + +/** + * enum driver_type - Indicate the driver type to the cds, and based on this + * do appropriate initialization. + * + * @DRIVER_TYPE_PRODUCTION: Driver used in the production + * @DRIVER_TYPE_MFG: Driver used in the Factory + * + */ +enum driver_type { + DRIVER_TYPE_PRODUCTION = 0, + DRIVER_TYPE_MFG = 1, +}; + +/** + * struct cds_config_info - Place Holder for cds configuration + * @max_station: Max station supported + * @max_bssid: Max Bssid Supported + * @frame_xln_reqd: frame transmission required + * @powersave_offload_enabled: Indicate if powersave offload is enabled + * @sta_maxlimod_dtim: station max listen interval + * @sta_mod_dtim: station mode DTIM + * @sta_dynamic_dtim: station dynamic DTIM + * @driver_type: Enumeration of Driver Type whether FTM or Mission mode + * @max_wow_filters: Max wow filters to be configured to fw + * @wow_enable: Indicate whether wow is enabled or not + * @ol_ini_info: Status of offload enabled from ini 1st bit for arm,2nd for NS + * currently rest of bits are not used + * @ssdp: Indicate ssdp is enabled or not + * @enable_mc_list : To Check if Multicast list filtering is enabled in FW + * @dfs_phyerr_filter_offload: DFS Phyerror Filtering offload status from ini + * Indicates whether support is enabled or not + * @ap_disable_intrabss_fwd: pass intra-bss-fwd info to txrx module + * @ap_maxoffload_peers: max offload peer + * @ap_maxoffload_reorderbuffs: max offload reorder buffs + * @ra_ratelimit_interval: RA rate limit value + * @is_ra_ratelimit_enabled: Indicate RA rate limit enabled or not + * @reorder_offload: is RX re-ordering offloaded to the fw + * @dfs_pri_multiplier: dfs radar pri multiplier + * @uc_offload_enabled: IPA Micro controller data path offload enable flag + * @uc_txbuf_count: IPA Micro controller data path offload TX buffer count + * @uc_txbuf_size: IPA Micro controller data path offload TX buffer size + * @uc_rxind_ringcount: IPA Micro controller data path offload RX indication + * ring count + * @uc_tx_partition_base: IPA Micro controller datapath offload TX partition + * base + * @enable_rxthread: Rx processing in thread from TXRX + * @ip_tcp_udp_checksum_offload: checksum offload enabled or not + * @ce_classify_enabled: CE based classification enabled + * @max_scan: Maximum number of parallel scans + * @tx_flow_stop_queue_th: Threshold to stop queue in percentage + * @tx_flow_start_queue_offset: Start queue offset in percentage + * @is_lpass_enabled: Indicate whether LPASS is enabled or not + * @is_nan_enabled: Indicate whether NAN is enabled or not + * @tx_chain_mask_cck: Tx chain mask enabled or not + * @self_gen_frm_pwr: Self gen from power + * + * Structure for holding cds ini parameters. + */ + +struct cds_config_info { + uint16_t max_station; + uint16_t max_bssid; + uint32_t frame_xln_reqd; + uint8_t powersave_offload_enabled; + uint8_t sta_maxlimod_dtim; + uint8_t sta_mod_dtim; + uint8_t sta_dynamic_dtim; + enum driver_type driver_type; + uint8_t max_wow_filters; + uint8_t wow_enable; + uint8_t ol_ini_info; + bool ssdp; + bool enable_mc_list; + uint8_t dfs_phyerr_filter_offload; + uint8_t ap_disable_intrabss_fwd; + uint8_t ap_maxoffload_peers; + uint8_t ap_maxoffload_reorderbuffs; +#ifdef FEATURE_WLAN_RA_FILTERING + uint16_t ra_ratelimit_interval; + bool is_ra_ratelimit_enabled; +#endif + uint8_t reorder_offload; + int32_t dfs_pri_multiplier; + uint8_t uc_offload_enabled; + uint32_t uc_txbuf_count; + uint32_t uc_txbuf_size; + uint32_t uc_rxind_ringcount; + uint32_t uc_tx_partition_base; + bool enable_rxthread; + bool ip_tcp_udp_checksum_offload; + bool ce_classify_enabled; + uint8_t max_scan; +#ifdef QCA_LL_TX_FLOW_CONTROL_V2 + uint32_t tx_flow_stop_queue_th; + uint32_t tx_flow_start_queue_offset; +#endif +#ifdef WLAN_FEATURE_LPSS + bool is_lpass_enabled; +#endif +#ifdef WLAN_FEATURE_NAN + bool is_nan_enabled; +#endif + bool tx_chain_mask_cck; + uint16_t self_gen_frm_pwr; +}; +#endif /* !defined( __CDS_CONFIG_H ) */ diff --git a/core/cds/inc/cds_sched.h b/core/cds/inc/cds_sched.h index 6dfc00ded6af..83cf40316412 100644 --- a/core/cds/inc/cds_sched.h +++ b/core/cds/inc/cds_sched.h @@ -49,6 +49,7 @@ #include <qdf_types.h> #include "qdf_lock.h" #include "qdf_mc_timer.h" +#include "cds_config.h" #define TX_POST_EVENT_MASK 0x001 #define TX_SUSPEND_EVENT_MASK 0x002 @@ -202,7 +203,7 @@ typedef struct _cds_sched_context { struct notifier_block *cpu_hot_plug_notifier; /* affinity lock */ - spinlock_t affinity_lock; + struct mutex affinity_lock; /* rx thread affinity cpu */ unsigned long rx_thread_cpu; @@ -317,6 +318,7 @@ typedef struct _cds_context_type { uint32_t sap_mandatory_channels_len; bool do_hw_mode_change; bool enable_fatal_event; + struct cds_config_info *cds_cfg; } cds_context_type, *p_cds_contextType; /*--------------------------------------------------------------------------- diff --git a/core/cds/src/cds_api.c b/core/cds/src/cds_api.c index d50f781aa8a3..4fd6f9a07e20 100644 --- a/core/cds/src/cds_api.c +++ b/core/cds/src/cds_api.c @@ -158,25 +158,6 @@ void cds_tdls_tx_rx_mgmt_event(uint8_t event_id, uint8_t tx_rx, } #endif -#ifdef WLAN_FEATURE_NAN -/** - * cds_set_nan_enable() - set nan enable flag in mac open param - * @wma_handle: Pointer to mac open param - * @hdd_ctx: Pointer to hdd context - * - * Return: none - */ -static void cds_set_nan_enable(tMacOpenParameters *param, - hdd_context_t *hdd_ctx) -{ - param->is_nan_enabled = hdd_ctx->config->enable_nan_support; -} -#else -static void cds_set_nan_enable(tMacOpenParameters *param, - hdd_context_t *pHddCtx) -{ -} -#endif /** * cds_open() - open the CDS Module @@ -197,24 +178,33 @@ QDF_STATUS cds_open(void) QDF_STATUS qdf_status = QDF_STATUS_SUCCESS; int iter = 0; tSirRetStatus sirStatus = eSIR_SUCCESS; - tMacOpenParameters mac_openParms; + struct cds_config_info *cds_cfg; qdf_device_t qdf_ctx; HTC_INIT_INFO htcInfo; struct ol_context *ol_ctx; struct hif_opaque_softc *scn; void *HTCHandle; hdd_context_t *pHddCtx; + cds_context_type *cds_ctx; QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_INFO_HIGH, "%s: Opening CDS", __func__); - if (NULL == gp_cds_context) { + cds_ctx = cds_get_context(QDF_MODULE_ID_QDF); + if (!cds_ctx) { QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_FATAL, "%s: Trying to open CDS without a PreOpen", __func__); QDF_ASSERT(0); return QDF_STATUS_E_FAILURE; } + cds_cfg = cds_get_ini_config(); + if (!cds_cfg) { + cds_err("Cds config is NULL"); + QDF_ASSERT(0); + return QDF_STATUS_E_FAILURE; + } + /* Initialize the timer module */ qdf_timer_module_init(); @@ -282,9 +272,6 @@ QDF_STATUS cds_open(void) "%s: scn is null!", __func__); goto err_sched_close; } - - hdd_update_config(pHddCtx); - ol_ctx = cds_get_context(QDF_MODULE_ID_BMI); /* Initialize BMI and Download firmware */ qdf_status = bmi_download_firmware(ol_ctx); @@ -314,91 +301,11 @@ QDF_STATUS cds_open(void) goto err_htc_close; } - /* - ** Need to open WMA first because it calls WDI_Init, which calls wpalOpen - ** The reason that is needed becasue cds_packet_open need to use PAL APIs - */ - /*Open the WMA module */ - qdf_mem_set(&mac_openParms, sizeof(mac_openParms), 0); - /* UMA is supported in hardware for performing the - ** frame translation 802.11 <-> 802.3 - */ - mac_openParms.frameTransRequired = 1; - mac_openParms.driverType = eDRIVER_TYPE_PRODUCTION; - mac_openParms.powersaveOffloadEnabled = - pHddCtx->config->enablePowersaveOffload; - mac_openParms.staDynamicDtim = pHddCtx->config->enableDynamicDTIM; - mac_openParms.staModDtim = pHddCtx->config->enableModulatedDTIM; - mac_openParms.staMaxLIModDtim = pHddCtx->config->fMaxLIModulatedDTIM; - mac_openParms.wowEnable = pHddCtx->config->wowEnable; - mac_openParms.maxWoWFilters = pHddCtx->config->maxWoWFilters; - /* Here olIniInfo is used to store ini status of arp offload - * ns offload and others. Currently 1st bit is used for arp - * off load and 2nd bit for ns offload currently, rest bits are unused - */ - if (pHddCtx->config->fhostArpOffload) - mac_openParms.olIniInfo = mac_openParms.olIniInfo | 0x1; - if (pHddCtx->config->fhostNSOffload) - mac_openParms.olIniInfo = mac_openParms.olIniInfo | 0x2; - /* - * Copy the DFS Phyerr Filtering Offload status. - * This parameter reflects the value of the - * dfsPhyerrFilterOffload flag as set in the ini. - */ - mac_openParms.dfsPhyerrFilterOffload = - pHddCtx->config->fDfsPhyerrFilterOffload; - if (pHddCtx->config->ssdp) - mac_openParms.ssdp = pHddCtx->config->ssdp; - mac_openParms.enable_mc_list = pHddCtx->config->fEnableMCAddrList; -#ifdef FEATURE_WLAN_RA_FILTERING - mac_openParms.RArateLimitInterval = - pHddCtx->config->RArateLimitInterval; - mac_openParms.IsRArateLimitEnabled = - pHddCtx->config->IsRArateLimitEnabled; -#endif - - mac_openParms.apMaxOffloadPeers = pHddCtx->config->apMaxOffloadPeers; - - mac_openParms.apMaxOffloadReorderBuffs = - pHddCtx->config->apMaxOffloadReorderBuffs; - - mac_openParms.apDisableIntraBssFwd = - pHddCtx->config->apDisableIntraBssFwd; - - mac_openParms.dfsRadarPriMultiplier = - pHddCtx->config->dfsRadarPriMultiplier; - mac_openParms.reorderOffload = pHddCtx->config->reorderOffloadSupport; - - /* IPA micro controller data path offload resource config item */ - mac_openParms.ucOffloadEnabled = hdd_ipa_uc_is_enabled(pHddCtx); - mac_openParms.ucTxBufCount = pHddCtx->config->IpaUcTxBufCount; - mac_openParms.ucTxBufSize = pHddCtx->config->IpaUcTxBufSize; - mac_openParms.ucRxIndRingCount = pHddCtx->config->IpaUcRxIndRingCount; - mac_openParms.ucTxPartitionBase = pHddCtx->config->IpaUcTxPartitionBase; - mac_openParms.max_scan = pHddCtx->config->max_scan_count; - - mac_openParms.ip_tcp_udp_checksum_offload = - pHddCtx->config->enable_ip_tcp_udp_checksum_offload; - mac_openParms.enable_rxthread = pHddCtx->config->enableRxThread; - mac_openParms.ce_classify_enabled = - pHddCtx->config->ce_classify_enabled; - -#ifdef QCA_LL_TX_FLOW_CONTROL_V2 - mac_openParms.tx_flow_stop_queue_th = - pHddCtx->config->TxFlowStopQueueThreshold; - mac_openParms.tx_flow_start_queue_offset = - pHddCtx->config->TxFlowStartQueueOffset; -#endif - cds_set_nan_enable(&mac_openParms, pHddCtx); - - mac_openParms.tx_chain_mask_cck = pHddCtx->config->tx_chain_mask_cck; - mac_openParms.self_gen_frm_pwr = pHddCtx->config->self_gen_frm_pwr; - mac_openParms.maxStation = pHddCtx->config->maxNumberOfPeers; qdf_status = wma_open(gp_cds_context, hdd_update_tgt_cfg, - hdd_dfs_indicate_radar, &mac_openParms); + hdd_dfs_indicate_radar, cds_cfg); if (!QDF_IS_STATUS_SUCCESS(qdf_status)) { /* Critical Error ... Cannot proceed further */ @@ -410,10 +317,10 @@ QDF_STATUS cds_open(void) /* Number of peers limit differs in each chip version. If peer max * limit configured in ini exceeds more than supported, WMA adjusts - * and keeps correct limit in mac_openParms.maxStation. So, make sure + * and keeps correct limit in cds_cfg.max_station. So, make sure * config entry pHddCtx->config->maxNumberOfPeers has adjusted value */ - pHddCtx->config->maxNumberOfPeers = mac_openParms.maxStation; + pHddCtx->config->maxNumberOfPeers = cds_cfg->max_station; HTCHandle = cds_get_context(QDF_MODULE_ID_HTC); if (!HTCHandle) { QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_FATAL, @@ -431,11 +338,9 @@ QDF_STATUS cds_open(void) /* UMA is supported in hardware for performing the * frame translation 802.11 <-> 802.3 */ - mac_openParms.frameTransRequired = 1; - sirStatus = - mac_open(&(gp_cds_context->pMACContext), gp_cds_context->pHDDContext, - &mac_openParms); + mac_open(&(gp_cds_context->pMACContext), + gp_cds_context->pHDDContext, cds_cfg); if (eSIR_SUCCESS != sirStatus) { /* Critical Error ... Cannot proceed further */ @@ -860,6 +765,7 @@ QDF_STATUS cds_close(v_CONTEXT_t cds_context) gp_cds_context->pHDDContext = NULL; + cds_deinit_ini_config(); return QDF_STATUS_SUCCESS; } @@ -2237,3 +2143,62 @@ QDF_STATUS cds_set_radio_index(int radio_index) return QDF_STATUS_SUCCESS; } + +/** + * cds_init_ini_config() - API to initialize CDS configuration parameters + * @cfg: CDS Configuration + * + * Return: void + */ + +void cds_init_ini_config(struct cds_config_info *cfg) +{ + cds_context_type *cds_ctx; + + cds_ctx = cds_get_context(QDF_MODULE_ID_QDF); + if (!cds_ctx) { + cds_err("Invalid CDS Context"); + return; + } + + cds_ctx->cds_cfg = cfg; +} + +/** + * cds_deinit_ini_config() - API to free CDS configuration parameters + * + * Return: void + */ +void cds_deinit_ini_config(void) +{ + cds_context_type *cds_ctx; + + cds_ctx = cds_get_context(QDF_MODULE_ID_QDF); + if (!cds_ctx) { + cds_err("Invalid CDS Context"); + return; + } + + if (!cds_ctx->cds_cfg) + qdf_mem_free(cds_ctx->cds_cfg); + + cds_ctx->cds_cfg = NULL; +} + +/** + * cds_get_ini_config() - API to get CDS configuration parameters + * + * Return: cds config structure + */ +struct cds_config_info *cds_get_ini_config(void) +{ + cds_context_type *cds_ctx; + + cds_ctx = cds_get_context(QDF_MODULE_ID_QDF); + if (!cds_ctx) { + cds_err("Invalid CDS Context"); + return NULL; + } + + return cds_ctx->cds_cfg; +} diff --git a/core/cds/src/cds_concurrency.c b/core/cds/src/cds_concurrency.c index da72c7eb015c..5a2993b45549 100644 --- a/core/cds/src/cds_concurrency.c +++ b/core/cds/src/cds_concurrency.c @@ -8262,6 +8262,29 @@ QDF_STATUS cds_register_sap_restart_channel_switch_cb( cds_ctx->sap_restart_chan_switch_cb = sap_restart_chan_switch_cb; return QDF_STATUS_SUCCESS; } + +/** + * cds_deregister_sap_restart_channel_switch_cb() - De-Register callback for SAP + * channel switch without restart + * + * De Registers callback to perform channel switch + * + * Return: QDF_STATUS Enumeration + */ +QDF_STATUS cds_deregister_sap_restart_channel_switch_cb(void) +{ + p_cds_contextType cds_ctx; + + cds_ctx = cds_get_global_context(); + if (!cds_ctx) { + cds_err("Invalid CDS context"); + return QDF_STATUS_E_FAILURE; + } + + cds_ctx->sap_restart_chan_switch_cb = NULL; + return QDF_STATUS_SUCCESS; +} + #endif diff --git a/core/cds/src/cds_sched.c b/core/cds/src/cds_sched.c index dadfbcdda4d8..d452b7ede1b2 100644 --- a/core/cds/src/cds_sched.c +++ b/core/cds/src/cds_sched.c @@ -270,15 +270,15 @@ int cds_sched_handle_cpu_hot_plug(void) if (cds_is_load_or_unload_in_progress()) return 0; - spin_lock_bh(&pSchedContext->affinity_lock); + mutex_lock(&pSchedContext->affinity_lock); if (cds_sched_find_attach_cpu(pSchedContext, pSchedContext->high_throughput_required)) { QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_ERROR, "%s: handle hot plug fail", __func__); - spin_unlock_bh(&pSchedContext->affinity_lock); + mutex_unlock(&pSchedContext->affinity_lock); return 1; } - spin_unlock_bh(&pSchedContext->affinity_lock); + mutex_unlock(&pSchedContext->affinity_lock); return 0; } @@ -308,15 +308,15 @@ int cds_sched_handle_throughput_req(bool high_tput_required) return 0; } - spin_lock_bh(&pSchedContext->affinity_lock); + mutex_lock(&pSchedContext->affinity_lock); pSchedContext->high_throughput_required = high_tput_required; if (cds_sched_find_attach_cpu(pSchedContext, high_tput_required)) { QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_ERROR, "%s: handle throughput req fail", __func__); - spin_unlock_bh(&pSchedContext->affinity_lock); + mutex_unlock(&pSchedContext->affinity_lock); return 1; } - spin_unlock_bh(&pSchedContext->affinity_lock); + mutex_unlock(&pSchedContext->affinity_lock); return 0; } @@ -510,7 +510,7 @@ QDF_STATUS cds_sched_open(void *p_cds_context, } register_hotcpu_notifier(&cds_cpu_hotplug_notifier); pSchedContext->cpu_hot_plug_notifier = &cds_cpu_hotplug_notifier; - spin_lock_init(&pSchedContext->affinity_lock); + mutex_init(&pSchedContext->affinity_lock); pSchedContext->high_throughput_required = false; #endif gp_cds_sched_context = pSchedContext; diff --git a/core/hdd/inc/wlan_hdd_assoc.h b/core/hdd/inc/wlan_hdd_assoc.h index c71450f3e6e9..89d89cadf2ae 100644 --- a/core/hdd/inc/wlan_hdd_assoc.h +++ b/core/hdd/inc/wlan_hdd_assoc.h @@ -358,4 +358,9 @@ void hdd_delete_peer(hdd_station_ctx_t *sta_ctx, uint8_t sta_id); int hdd_get_peer_idx(hdd_station_ctx_t *sta_ctx, struct qdf_mac_addr *addr); QDF_STATUS hdd_roam_deregister_sta(hdd_adapter_t *adapter, uint8_t sta_id); +#ifdef WLAN_FEATURE_ROAM_OFFLOAD +void hdd_wma_send_fastreassoc_cmd(int session_id, const tSirMacAddr bssid, + int channel); +#endif + #endif diff --git a/core/hdd/inc/wlan_hdd_ftm.h b/core/hdd/inc/wlan_hdd_ftm.h index 9ecccfe2683c..eddce28f6131 100644 --- a/core/hdd/inc/wlan_hdd_ftm.h +++ b/core/hdd/inc/wlan_hdd_ftm.h @@ -57,6 +57,7 @@ struct wlan_hdd_ftm_status { int wlan_hdd_ftm_open(hdd_context_t *hdd_ctx); int wlan_hdd_ftm_close(hdd_context_t *hdd_ctx); +int hdd_update_cds_config_ftm(hdd_context_t *hdd_ctx); #if defined(QCA_WIFI_FTM) QDF_STATUS wlan_hdd_ftm_testmode_cmd(void *data, int len); diff --git a/core/hdd/inc/wlan_hdd_main.h b/core/hdd/inc/wlan_hdd_main.h index bc5dd3d002e9..4179d18ffce6 100644 --- a/core/hdd/inc/wlan_hdd_main.h +++ b/core/hdd/inc/wlan_hdd_main.h @@ -1631,7 +1631,7 @@ hdd_adapter_t *hdd_get_adapter_by_sme_session_id(hdd_context_t *hdd_ctx, enum phy_ch_width hdd_map_nl_chan_width(enum nl80211_chan_width ch_width); uint8_t wlan_hdd_find_opclass(tHalHandle hal, uint8_t channel, uint8_t bw_offset); -void hdd_update_config(hdd_context_t *hdd_ctx); +int hdd_update_config(hdd_context_t *hdd_ctx); QDF_STATUS hdd_chan_change_notify(hdd_adapter_t *adapter, struct net_device *dev, @@ -1737,4 +1737,13 @@ static inline int wlan_hdd_nl_init(hdd_context_t *hdd_ctx) #endif QDF_STATUS hdd_sme_close_session_callback(void *pContext); +int hdd_reassoc(hdd_adapter_t *adapter, const uint8_t *bssid, + const uint8_t channel, const handoff_src src); + +int hdd_register_cb(hdd_context_t *hdd_ctx); +void hdd_deregister_cb(hdd_context_t *hdd_ctx); +int hdd_start_station_adapter(hdd_adapter_t *adapter); +int hdd_start_ap_adapter(hdd_adapter_t *adapter); +int hdd_start_ftm_adapter(hdd_adapter_t *adapter); +int hdd_set_fw_params(hdd_adapter_t *adapter); #endif /* end #if !defined(WLAN_HDD_MAIN_H) */ diff --git a/core/hdd/inc/wlan_hdd_memdump.h b/core/hdd/inc/wlan_hdd_memdump.h index c3fa8391a9ea..2100768ef69b 100644 --- a/core/hdd/inc/wlan_hdd_memdump.h +++ b/core/hdd/inc/wlan_hdd_memdump.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015 The Linux Foundation. All rights reserved. + * Copyright (c) 2015-2016 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -71,6 +71,7 @@ void memdump_deinit(void); int wlan_hdd_cfg80211_get_fw_mem_dump(struct wiphy *wiphy, struct wireless_dev *wdev, const void *data, int data_len); +void wlan_hdd_cfg80211_fw_mem_dump_cb(void *ctx, struct fw_dump_rsp *dump_rsp); #else static inline int memdump_init(void) { @@ -87,6 +88,10 @@ static inline int wlan_hdd_cfg80211_get_fw_mem_dump(struct wiphy *wiphy, { return -ENOTSUPP; } +static inline void wlan_hdd_cfg80211_fw_mem_dump_cb(void *ctx, + struct fw_dump_rsp *dump_rsp) +{ +} #endif #endif /* if !defined(WLAN_HDD_MEMDUMP_H)*/ diff --git a/core/hdd/inc/wlan_hdd_nan.h b/core/hdd/inc/wlan_hdd_nan.h index ac2f62f38be9..02947164e359 100644 --- a/core/hdd/inc/wlan_hdd_nan.h +++ b/core/hdd/inc/wlan_hdd_nan.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015 The Linux Foundation. All rights reserved. + * Copyright (c) 2014-2016 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -46,13 +46,30 @@ int wlan_hdd_cfg80211_nan_request(struct wiphy *wiphy, int data_len); bool wlan_hdd_nan_is_supported(void); -void wlan_hdd_nan_init(struct hdd_context_s *hdd_ctx); +/** + * hdd_nan_populate_cds_config() - Populate NAN cds configuration + * @cds_cfg: CDS Configuration + * @hdd_ctx: Pointer to hdd context + * + * Return: none + */ +static inline void hdd_nan_populate_cds_config(struct cds_config_info *cds_cfg, + hdd_context_t *hdd_ctx) +{ + cds_cfg->is_nan_enabled = hdd_ctx->config->enable_nan_support; +} +void wlan_hdd_cfg80211_nan_callback(void *ctx, tSirNanEvent *msg); #else static inline bool wlan_hdd_nan_is_supported(void) { return false; } -static inline void wlan_hdd_nan_init(struct hdd_context_s *hdd_ctx) +static inline void hdd_nan_populate_cds_config(struct cds_config_info *cds_cfg, + hdd_context_t *hdd_ctx) +{ +} +static inline void wlan_hdd_cfg80211_nan_callback(void *ctx, + tSirNanEvent *msg) { } #endif /* WLAN_FEATURE_NAN */ diff --git a/core/hdd/inc/wlan_hdd_tsf.h b/core/hdd/inc/wlan_hdd_tsf.h index 6d7ba787acee..d53741ef1825 100644 --- a/core/hdd/inc/wlan_hdd_tsf.h +++ b/core/hdd/inc/wlan_hdd_tsf.h @@ -61,13 +61,13 @@ enum hdd_tsf_capture_state { }; #ifdef WLAN_FEATURE_TSF -void wlan_hdd_tsf_init(struct hdd_context_s *hdd_ctx); int hdd_capture_tsf(struct hdd_adapter_s *adapter, uint32_t *buf, int len); int hdd_indicate_tsf(struct hdd_adapter_s *adapter, uint32_t *buf, int len); int wlan_hdd_cfg80211_handle_tsf_cmd(struct wiphy *wiphy, struct wireless_dev *wdev, const void *data, int data_len); +int hdd_get_tsf_cb(void *pcb_cxt, struct stsf *ptsf); #else static inline void wlan_hdd_tsf_init(struct hdd_context_s *hdd_ctx) { @@ -93,6 +93,11 @@ static inline int wlan_hdd_cfg80211_handle_tsf_cmd(struct wiphy *wiphy, { return -ENOTSUPP; } +static inline int hdd_get_tsf_cb(void *pcb_cxt, struct stsf *ptsf) +{ + return -ENOTSUPP; +} + #endif #endif diff --git a/core/hdd/inc/wlan_hdd_wext.h b/core/hdd/inc/wlan_hdd_wext.h index 4ccdc82991c9..b1bad21c4fde 100644 --- a/core/hdd/inc/wlan_hdd_wext.h +++ b/core/hdd/inc/wlan_hdd_wext.h @@ -295,7 +295,7 @@ extern int hdd_wlan_get_rts_threshold(hdd_adapter_t *pAdapter, union iwreq_data *wrqu); extern int hdd_wlan_get_frag_threshold(hdd_adapter_t *pAdapter, union iwreq_data *wrqu); -extern void hdd_wlan_get_version(hdd_adapter_t *pAdapter, +extern void hdd_wlan_get_version(hdd_context_t *hdd_ctx, union iwreq_data *wrqu, char *extra); extern void hdd_wlan_get_stats(hdd_adapter_t *pAdapter, uint16_t *length, diff --git a/core/hdd/src/wlan_hdd_cfg80211.c b/core/hdd/src/wlan_hdd_cfg80211.c index a26d14894d0e..626d8ef8e8e1 100644 --- a/core/hdd/src/wlan_hdd_cfg80211.c +++ b/core/hdd/src/wlan_hdd_cfg80211.c @@ -10410,6 +10410,44 @@ disconnected: } /** + * wlan_hdd_reassoc_bssid_hint() - Start reassociation if bssid is present + * @adapter: Pointer to the HDD adapter + * @req: Pointer to the structure cfg_connect_params receieved from user space + * @status: out variable for status of reassoc request + * + * This function will start reassociation if bssid hint, channel hint and + * previous bssid parameters are present in the connect request + * + * Return: true if connect was for ReAssociation, false otherwise + */ +#ifdef CFG80211_CONNECT_PREV_BSSID +static bool wlan_hdd_reassoc_bssid_hint(hdd_adapter_t *adapter, + struct cfg80211_connect_params *req, + int *status) +{ + bool reassoc = false; + if (req->bssid_hint && req->channel_hint && req->prev_bssid) { + reassoc = true; + hdd_info(FL("REASSOC Attempt on channel %d to "MAC_ADDRESS_STR), + req->channel_hint->hw_value, + MAC_ADDR_ARRAY(req->bssid_hint)); + *status = hdd_reassoc(adapter, req->bssid_hint, + req->channel_hint->hw_value, + CONNECT_CMD_USERSPACE); + hdd_debug("hdd_reassoc: status: %d", *status); + } + return reassoc; +} +#else +static bool wlan_hdd_reassoc_bssid_hint(hdd_adapter_t *adapter, + struct cfg80211_connect_params *req, + int *status) +{ + return false; +} +#endif + +/** * __wlan_hdd_cfg80211_connect() - cfg80211 connect api * @wiphy: Pointer to wiphy * @dev: Pointer to network device @@ -10464,6 +10502,10 @@ static int __wlan_hdd_cfg80211_connect(struct wiphy *wiphy, status = wlan_hdd_validate_context(pHddCtx); if (0 != status) return status; + + if (true == wlan_hdd_reassoc_bssid_hint(pAdapter, req, &status)) + return status; + if (req->channel) { if (!cds_allow_concurrency( cds_convert_device_mode_to_qdf_type( @@ -10480,6 +10522,7 @@ static int __wlan_hdd_cfg80211_connect(struct wiphy *wiphy, return -ECONNREFUSED; } } + wlan_hdd_disable_roaming(pAdapter); /*Try disconnecting if already in connected state */ diff --git a/core/hdd/src/wlan_hdd_ftm.c b/core/hdd/src/wlan_hdd_ftm.c index 94cd241c2bef..97a0cd2754d6 100644 --- a/core/hdd/src/wlan_hdd_ftm.c +++ b/core/hdd/src/wlan_hdd_ftm.c @@ -138,18 +138,49 @@ static void wlan_hdd_ftm_update_tgt_cfg(void *context, void *param) } #ifdef WLAN_FEATURE_LPSS -static inline void hdd_is_lpass_supported(tMacOpenParameters *mac_openParms, +static inline void hdd_is_lpass_supported(struct cds_config_info *cds_cfg, hdd_context_t *hdd_ctx) { - mac_openParms->is_lpass_enabled = hdd_ctx->config->enable_lpass_support; + cds_cfg->is_lpass_enabled = hdd_ctx->config->enable_lpass_support; } #else -static inline void hdd_is_lpass_supported(tMacOpenParameters *mac_openParms, +static inline void hdd_is_lpass_supported(struct cds_config_info *cds_cfg, hdd_context_t *hdd_ctx) { } #endif /** + * hdd_update_cds_config_ftm() - API to update cds configuration parameters + * for FTM mode. + * @hdd_ctx: HDD Context + * + * Return: 0 on success; errno on failure + */ + +int hdd_update_cds_config_ftm(hdd_context_t *hdd_ctx) +{ + struct cds_config_info *cds_cfg; + + cds_cfg = qdf_mem_malloc(sizeof(struct cds_config_info)); + if (!cds_cfg) { + hdd_err("failed to allocate cds config"); + return -ENOMEM; + } + qdf_mem_zero(cds_cfg, sizeof(struct cds_config_info)); + + cds_cfg->driver_type = eDRIVER_TYPE_MFG; + cds_cfg->powersave_offload_enabled = + hdd_ctx->config->enablePowersaveOffload; + hdd_is_lpass_supported(cds_cfg, hdd_ctx); + /* UMA is supported in hardware for performing the + * frame translation 802.11 <-> 802.3 + */ + cds_cfg->frame_xln_reqd = 1; + cds_init_ini_config(cds_cfg); + + return 0; +} +/** * wlan_ftm_cds_open() - Open the CDS Module in FTM mode * @p_cds_context: pointer to the global CDS context * @hddContextSize: Size of the HDD context to allocate. @@ -173,8 +204,8 @@ static QDF_STATUS wlan_ftm_cds_open(v_CONTEXT_t p_cds_context, QDF_STATUS vStatus = QDF_STATUS_SUCCESS; int iter = 0; tSirRetStatus sirStatus = eSIR_SUCCESS; - tMacOpenParameters mac_openParms; p_cds_contextType gp_cds_context = (p_cds_contextType) p_cds_context; + struct cds_config_info *cds_cfg; #if defined(QCA_WIFI_FTM) qdf_device_t qdf_ctx; HTC_INIT_INFO htcInfo; @@ -182,18 +213,22 @@ static QDF_STATUS wlan_ftm_cds_open(v_CONTEXT_t p_cds_context, void *pHtcContext = NULL; struct ol_context *ol_ctx; #endif + cds_context_type *cds_ctx; hdd_context_t *hdd_ctx; QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_INFO_HIGH, "%s: Opening CDS", __func__); - if (NULL == gp_cds_context) { + cds_ctx = cds_get_context(QDF_MODULE_ID_QDF); + if (!cds_ctx) { QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_ERROR, "%s: Trying to open CDS without a PreOpen", __func__); QDF_ASSERT(0); return QDF_STATUS_E_FAILURE; } + cds_cfg = cds_ctx->cds_cfg; + /* Initialize the probe event */ if (qdf_event_create(&gp_cds_context->ProbeEvent) != QDF_STATUS_SUCCESS) { QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_ERROR, @@ -280,10 +315,6 @@ static QDF_STATUS wlan_ftm_cds_open(v_CONTEXT_t p_cds_context, } #endif /* QCA_WIFI_FTM */ - /*Open the WMA module */ - qdf_mem_set(&mac_openParms, sizeof(mac_openParms), 0); - mac_openParms.driverType = eDRIVER_TYPE_MFG; - hdd_ctx = (hdd_context_t *) (gp_cds_context->pHDDContext); if ((NULL == hdd_ctx) || (NULL == hdd_ctx->config)) { /* Critical Error ... Cannot proceed further */ @@ -292,14 +323,8 @@ static QDF_STATUS wlan_ftm_cds_open(v_CONTEXT_t p_cds_context, QDF_ASSERT(0); goto err_htc_close; } - - mac_openParms.powersaveOffloadEnabled = - hdd_ctx->config->enablePowersaveOffload; - - hdd_is_lpass_supported(&mac_openParms, hdd_ctx); - vStatus = wma_open(gp_cds_context, - wlan_hdd_ftm_update_tgt_cfg, NULL, &mac_openParms); + wlan_hdd_ftm_update_tgt_cfg, NULL, cds_cfg); if (!QDF_IS_STATUS_SUCCESS(vStatus)) { /* Critical Error ... Cannot proceed further */ QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_ERROR, @@ -310,7 +335,6 @@ static QDF_STATUS wlan_ftm_cds_open(v_CONTEXT_t p_cds_context, } #if defined(QCA_WIFI_FTM) hdd_update_config(hdd_ctx); - pHtcContext = cds_get_context(QDF_MODULE_ID_HTC); if (!pHtcContext) { QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_FATAL, @@ -325,16 +349,9 @@ static QDF_STATUS wlan_ftm_cds_open(v_CONTEXT_t p_cds_context, #endif /* Now proceed to open the MAC */ - - /* UMA is supported in hardware for performing the - * frame translation 802.11 <-> 802.3 - */ - mac_openParms.frameTransRequired = 1; - sirStatus = mac_open(&(gp_cds_context->pMACContext), - gp_cds_context->pHDDContext, - &mac_openParms); + gp_cds_context->pHDDContext, cds_cfg); if (eSIR_SUCCESS != sirStatus) { /* Critical Error ... Cannot proceed further */ diff --git a/core/hdd/src/wlan_hdd_hostapd.c b/core/hdd/src/wlan_hdd_hostapd.c index bb0ab6110ee0..1a33d7fb1fab 100644 --- a/core/hdd/src/wlan_hdd_hostapd.c +++ b/core/hdd/src/wlan_hdd_hostapd.c @@ -5145,7 +5145,7 @@ __iw_softap_version(struct net_device *dev, if (0 != ret) return ret; - hdd_wlan_get_version(pHostapdAdapter, wrqu, extra); + hdd_wlan_get_version(hdd_ctx, wrqu, extra); EXIT(); return 0; } diff --git a/core/hdd/src/wlan_hdd_ioctl.c b/core/hdd/src/wlan_hdd_ioctl.c index c7bbcda6f172..78318563f79f 100644 --- a/core/hdd/src/wlan_hdd_ioctl.c +++ b/core/hdd/src/wlan_hdd_ioctl.c @@ -837,23 +837,67 @@ static int hdd_parse_reassoc_command_v1_data(const uint8_t *pValue, return 0; } +#ifdef WLAN_FEATURE_ROAM_OFFLOAD +void hdd_wma_send_fastreassoc_cmd(int sessionId, const tSirMacAddr bssid, + int channel) +{ + struct wma_roam_invoke_cmd *fastreassoc; + cds_msg_t msg = {0}; + + fastreassoc = qdf_mem_malloc(sizeof(*fastreassoc)); + if (NULL == fastreassoc) { + hdd_err("qdf_mem_malloc failed for fastreassoc"); + return; + } + fastreassoc->vdev_id = sessionId; + fastreassoc->channel = channel; + fastreassoc->bssid[0] = bssid[0]; + fastreassoc->bssid[1] = bssid[1]; + fastreassoc->bssid[2] = bssid[2]; + fastreassoc->bssid[3] = bssid[3]; + fastreassoc->bssid[4] = bssid[4]; + fastreassoc->bssid[5] = bssid[5]; + + msg.type = SIR_HAL_ROAM_INVOKE; + msg.reserved = 0; + msg.bodyptr = fastreassoc; + if (QDF_STATUS_SUCCESS != cds_mq_post_message(QDF_MODULE_ID_WMA, + &msg)) { + qdf_mem_free(fastreassoc); + hdd_err("Not able to post ROAM_INVOKE_CMD message to WMA"); + } +} +#else +void hdd_wma_send_fastreassoc_cmd(int sessionId, const tSirMacAddr bssid, + int channel) +{ +} + +#endif + /** * hdd_reassoc() - perform a userspace-directed reassoc * @adapter: Adapter upon which the command was received * @bssid: BSSID with which to reassociate * @channel: channel upon which to reassociate + * @src: The source for the trigger of this action * * This function performs a userspace-directed reassoc operation * * Return: 0 for success non-zero for failure */ -static int -hdd_reassoc(hdd_adapter_t *adapter, const uint8_t *bssid, - const uint8_t channel) +int hdd_reassoc(hdd_adapter_t *adapter, const uint8_t *bssid, + const uint8_t channel, const handoff_src src) { hdd_station_ctx_t *pHddStaCtx; + hdd_context_t *hdd_ctx = WLAN_HDD_GET_CTX(adapter); int ret = 0; + if (hdd_ctx == NULL) { + hdd_err("Invalid hdd ctx"); + return -EINVAL; + } + if (QDF_STA_MODE != adapter->device_mode) { hdd_warn("Unsupported in mode %s(%d)", hdd_device_mode_to_string(adapter->device_mode), @@ -890,12 +934,14 @@ hdd_reassoc(hdd_adapter_t *adapter, const uint8_t *bssid, } /* Proceed with reassoc */ - { + if (roaming_offload_enabled(hdd_ctx)) { + hdd_wma_send_fastreassoc_cmd((int)adapter->sessionId, + bssid, (int)channel); + } else { tCsrHandoffRequest handoffInfo; - hdd_context_t *hdd_ctx = WLAN_HDD_GET_CTX(adapter); handoffInfo.channel = channel; - handoffInfo.src = REASSOC; + handoffInfo.src = src; qdf_mem_copy(handoffInfo.bssid.bytes, bssid, QDF_MAC_ADDR_SIZE); sme_handoff_request(hdd_ctx->hHal, adapter->sessionId, &handoffInfo); @@ -931,7 +977,7 @@ static int hdd_parse_reassoc_v1(hdd_adapter_t *adapter, const char *command) if (ret) { hdd_err("Failed to parse reassoc command data"); } else { - ret = hdd_reassoc(adapter, bssid, channel); + ret = hdd_reassoc(adapter, bssid, channel, REASSOC); } return ret; } @@ -961,7 +1007,7 @@ static int hdd_parse_reassoc_v2(hdd_adapter_t *adapter, const char *command) hdd_err("MAC address parsing failed"); ret = -EINVAL; } else { - ret = hdd_reassoc(adapter, bssid, params.channel); + ret = hdd_reassoc(adapter, bssid, params.channel, REASSOC); } return ret; } @@ -4344,41 +4390,6 @@ exit: return ret; } -#ifdef WLAN_FEATURE_ROAM_OFFLOAD -static void hdd_wma_send_fastreassoc_cmd(int sessionId, tSirMacAddr bssid, - int channel) -{ - struct wma_roam_invoke_cmd *fastreassoc; - cds_msg_t msg = {0}; - - fastreassoc = qdf_mem_malloc(sizeof(*fastreassoc)); - if (NULL == fastreassoc) { - hdd_err("qdf_mem_malloc failed for fastreassoc"); - return; - } - fastreassoc->vdev_id = sessionId; - fastreassoc->channel = channel; - fastreassoc->bssid[0] = bssid[0]; - fastreassoc->bssid[1] = bssid[1]; - fastreassoc->bssid[2] = bssid[2]; - fastreassoc->bssid[3] = bssid[3]; - fastreassoc->bssid[4] = bssid[4]; - fastreassoc->bssid[5] = bssid[5]; - - msg.type = SIR_HAL_ROAM_INVOKE; - msg.reserved = 0; - msg.bodyptr = fastreassoc; - if (QDF_STATUS_SUCCESS != cds_mq_post_message(QDF_MODULE_ID_WMA, - &msg)) { - qdf_mem_free(fastreassoc); - hdd_err("Not able to post ROAM_INVOKE_CMD message to WMA"); - } -} -#else -static inline void hdd_wma_send_fastreassoc_cmd(int sessionId, - tSirMacAddr bssid, int channel) -{} -#endif static int drv_cmd_fast_reassoc(hdd_adapter_t *adapter, hdd_context_t *hdd_ctx, uint8_t *command, diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index 50a49085632f..61fb4b396fb4 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -104,6 +104,7 @@ #include <wlan_hdd_regulatory.h> #include "ol_rx_fwd.h" #include "wlan_hdd_lpass.h" +#include "nan_api.h" #ifdef MODULE #define WLAN_MODULE_NAME module_name(THIS_MODULE) @@ -2377,30 +2378,73 @@ void hdd_cleanup_actionframe(hdd_context_t *hdd_ctx, hdd_adapter_t *adapter) return; } +/** + * hdd_station_adapter_deinit() - De-initialize the station adapter + * @hdd_ctx: global hdd context + * @adapter: HDD adapter + * + * This function De-initializes the STA/P2P/OCB adapter. + * + * Return: None. + */ +void hdd_station_adapter_deinit(hdd_context_t *hdd_ctx, + hdd_adapter_t *adapter) +{ + ENTER_DEV(adapter->dev); + + if (test_bit(INIT_TX_RX_SUCCESS, &adapter->event_flags)) { + hdd_deinit_tx_rx(adapter); + clear_bit(INIT_TX_RX_SUCCESS, &adapter->event_flags); + } + + if (test_bit(WMM_INIT_DONE, &adapter->event_flags)) { + hdd_wmm_adapter_close(adapter); + clear_bit(WMM_INIT_DONE, &adapter->event_flags); + } + + hdd_cleanup_actionframe(hdd_ctx, adapter); + wlan_hdd_tdls_exit(adapter); + + EXIT(); +} + +/** + * hdd_ap_adapter_deinit() - De-initialize the ap adapter + * @hdd_ctx: global hdd context + * @adapter: HDD adapter + * @rtnl_held: the rtnl lock hold flag + * This function De-initializes the AP/P2PGo adapter. + * + * Return: None. + */ +void hdd_ap_adapter_deinit(hdd_context_t *hdd_ctx, hdd_adapter_t *adapter, + bool rtnl_held) +{ + ENTER_DEV(adapter->dev); + + if (test_bit(WMM_INIT_DONE, &adapter->event_flags)) { + hdd_wmm_adapter_close(adapter); + clear_bit(WMM_INIT_DONE, &adapter->event_flags); + } + + hdd_cleanup_actionframe(hdd_ctx, adapter); + + hdd_unregister_hostapd(adapter, rtnl_held); + + EXIT(); +} + void hdd_deinit_adapter(hdd_context_t *hdd_ctx, hdd_adapter_t *adapter, bool rtnl_held) { ENTER(); + switch (adapter->device_mode) { case QDF_STA_MODE: case QDF_P2P_CLIENT_MODE: case QDF_P2P_DEVICE_MODE: { - if (test_bit - (INIT_TX_RX_SUCCESS, &adapter->event_flags)) { - hdd_deinit_tx_rx(adapter); - clear_bit(INIT_TX_RX_SUCCESS, - &adapter->event_flags); - } - - if (test_bit(WMM_INIT_DONE, &adapter->event_flags)) { - hdd_wmm_adapter_close(adapter); - clear_bit(WMM_INIT_DONE, - &adapter->event_flags); - } - - hdd_cleanup_actionframe(hdd_ctx, adapter); - wlan_hdd_tdls_exit(adapter); + hdd_station_adapter_deinit(hdd_ctx, adapter); break; } @@ -2408,16 +2452,7 @@ void hdd_deinit_adapter(hdd_context_t *hdd_ctx, hdd_adapter_t *adapter, case QDF_P2P_GO_MODE: { - if (test_bit(WMM_INIT_DONE, &adapter->event_flags)) { - hdd_wmm_adapter_close(adapter); - clear_bit(WMM_INIT_DONE, - &adapter->event_flags); - } - - hdd_cleanup_actionframe(hdd_ctx, adapter); - - hdd_unregister_hostapd(adapter, rtnl_held); - + hdd_ap_adapter_deinit(hdd_ctx, adapter, rtnl_held); break; } @@ -2486,6 +2521,184 @@ QDF_STATUS hdd_check_for_existing_macaddr(hdd_context_t *hdd_ctx, return QDF_STATUS_SUCCESS; } +#ifdef CONFIG_FW_LOGS_BASED_ON_INI +/** + * hdd_set_fw_log_params() - Set log parameters to FW + * @hdd_ctx: HDD Context + * @adapter: HDD Adapter + * + * This function set the FW Debug log level based on the INI. + * + * Return: None + */ +static void hdd_set_fw_log_params(hdd_context_t *hdd_ctx, + hdd_adapter_t *adapter) +{ + uint8_t count = 0, numentries = 0, + moduleloglevel[FW_MODULE_LOG_LEVEL_STRING_LENGTH]; + uint32_t value = 0; + int ret; + + /* Enable FW logs based on INI configuration */ + if ((QDF_GLOBAL_FTM_MODE == cds_get_conparam() || + (!hdd_ctx->config->enable_fw_log))) { + hdd_info("enable_fw_log not enabled in INI or in FTM mode return"); + return; + } + + hdd_ctx->fw_log_settings.dl_type = + hdd_ctx->config->enableFwLogType; + ret = wma_cli_set_command(adapter->sessionId, + WMI_DBGLOG_TYPE, + hdd_ctx->config->enableFwLogType, + DBG_CMD); + if (ret) + hdd_err("Failed to enable FW log type ret %d", ret); + + hdd_ctx->fw_log_settings.dl_loglevel = + hdd_ctx->config->enableFwLogLevel; + ret = wma_cli_set_command(adapter->sessionId, + WMI_DBGLOG_LOG_LEVEL, + hdd_ctx->config->enableFwLogLevel, + DBG_CMD); + if (ret) + hdd_err("Failed to enable FW log level ret %d", ret); + + hdd_string_to_u8_array( + hdd_ctx->config->enableFwModuleLogLevel, + moduleloglevel, + &numentries, + FW_MODULE_LOG_LEVEL_STRING_LENGTH); + + while (count < numentries) { + /* + * FW module log level input string looks like + * below: + * gFwDebugModuleLoglevel=<FW Module ID>, + * <Log Level>,... + * For example: + * gFwDebugModuleLoglevel= + * 1,0,2,1,3,2,4,3,5,4,6,5,7,6 + * Above input string means : + * For FW module ID 1 enable log level 0 + * For FW module ID 2 enable log level 1 + * For FW module ID 3 enable log level 2 + * For FW module ID 4 enable log level 3 + * For FW module ID 5 enable log level 4 + * For FW module ID 6 enable log level 5 + * For FW module ID 7 enable log level 6 + */ + + /* + * FW expects WMI command value = + * Module ID * 10 + Module Log level + */ + value = ((moduleloglevel[count] * 10) + + moduleloglevel[count + 1]); + ret = wma_cli_set_command(adapter->sessionId, + WMI_DBGLOG_MOD_LOG_LEVEL, + value, DBG_CMD); + if (ret) + hdd_err("Failed to enable FW module log level %d ret %d", + value, ret); + + count += 2; + } +} +#else +static void hdd_set_fw_log_params(hdd_context_t *hdd_ctx, + hdd_adapter_t *adapter) +{ +} + +#endif + +/** + * hdd_set_fw_params() - Set parameters to firmware + * @adapter: HDD adapter + * + * This function Sets various parameters to fw once the + * adapter is started. + * + * Return: 0 on success or errno on failure + */ +int hdd_set_fw_params(hdd_adapter_t *adapter) +{ + int ret; + hdd_context_t *hdd_ctx; + + ENTER_DEV(adapter->dev); + + hdd_ctx = cds_get_context(QDF_MODULE_ID_HDD); + if (!hdd_ctx) + return -EINVAL; + + if ((QDF_GLOBAL_FTM_MODE == cds_get_conparam() || + (!hdd_ctx->config->enable2x2))) { + hdd_info("enable2x2 not enabled in INI or in FTM mode return"); + return 0; + } + +#define HDD_DTIM_1CHAIN_RX_ID 0x5 +#define HDD_SMPS_PARAM_VALUE_S 29 + + /* + * Disable DTIM 1 chain Rx when in 1x1, + * we are passing two value + * as param_id << 29 | param_value. + * Below param_value = 0(disable) + */ + ret = wma_cli_set_command(adapter->sessionId, + WMI_STA_SMPS_PARAM_CMDID, + HDD_DTIM_1CHAIN_RX_ID << + HDD_SMPS_PARAM_VALUE_S, + VDEV_CMD); + if (ret) { + hdd_err("DTIM 1 chain set failed %d", ret); + goto error; + } + + ret = wma_cli_set_command(adapter->sessionId, + WMI_PDEV_PARAM_TX_CHAIN_MASK, + hdd_ctx->config->txchainmask1x1, + PDEV_CMD); + if (ret) { + hdd_err("WMI_PDEV_PARAM_TX_CHAIN_MASK set failed %d", + ret); + goto error; + } + + ret = wma_cli_set_command(adapter->sessionId, + WMI_PDEV_PARAM_RX_CHAIN_MASK, + hdd_ctx->config->rxchainmask1x1, + PDEV_CMD); + if (ret) { + hdd_err("WMI_PDEV_PARAM_RX_CHAIN_MASK set failed %d", + ret); + goto error; + } +#undef HDD_DTIM_1CHAIN_RX_ID +#undef HDD_SMPS_PARAM_VALUE_S + + ret = wma_cli_set_command(adapter->sessionId, + WMI_PDEV_PARAM_HYST_EN, + hdd_ctx->config->enableMemDeepSleep, + PDEV_CMD); + + if (ret != 0) { + hdd_err("WMI_PDEV_PARAM_HYST_EN set failed %d", + ret); + goto error; + } + + hdd_set_fw_log_params(hdd_ctx, adapter); + + EXIT(); + return 0; +error: + return -EINVAL; +} + /** * hdd_open_adapter() - open and setup the hdd adatper * @hdd_ctx: global hdd context @@ -2577,13 +2790,15 @@ hdd_adapter_t *hdd_open_adapter(hdd_context_t *hdd_ctx, uint8_t session_type, adapter->device_mode = session_type; - if (QDF_NDI_MODE == session_type) + if (QDF_NDI_MODE == session_type) { status = hdd_init_nan_data_mode(adapter); - else - status = hdd_init_station_mode(adapter); - - if (QDF_STATUS_SUCCESS != status) - goto err_free_netdev; + if (QDF_STATUS_SUCCESS != status) + goto err_free_netdev; + } else { + ret = hdd_start_station_adapter(adapter); + if (ret) + goto err_free_netdev; + } hdd_lro_enable(hdd_ctx, adapter); @@ -2640,8 +2855,8 @@ hdd_adapter_t *hdd_open_adapter(hdd_context_t *hdd_ctx, uint8_t session_type, NL80211_IFTYPE_P2P_GO; adapter->device_mode = session_type; - status = hdd_init_ap_mode(adapter); - if (QDF_STATUS_SUCCESS != status) + ret = hdd_start_ap_adapter(adapter); + if (ret) goto err_free_netdev; status = hdd_register_hostapd(adapter, rtnl_held); @@ -2678,7 +2893,9 @@ hdd_adapter_t *hdd_open_adapter(hdd_context_t *hdd_ctx, uint8_t session_type, adapter->device_mode = session_type; status = hdd_register_interface(adapter, rtnl_held); - hdd_init_tx_rx(adapter); + ret = hdd_start_ftm_adapter(adapter); + if (ret) + goto err_free_netdev; /* Stop the Interface TX queue. */ hddLog(LOG1, FL("Disabling queues")); @@ -2742,137 +2959,11 @@ hdd_adapter_t *hdd_open_adapter(hdd_context_t *hdd_ctx, uint8_t session_type, cds_check_and_restart_sap_with_non_dfs_acs(); } - if ((cds_get_conparam() != QDF_GLOBAL_FTM_MODE) - && (!hdd_ctx->config->enable2x2)) { -#define HDD_DTIM_1CHAIN_RX_ID 0x5 -#define HDD_SMPS_PARAM_VALUE_S 29 - - /* - * Disable DTIM 1 chain Rx when in 1x1, we are passing two value - * as param_id << 29 | param_value. - * Below param_value = 0(disable) - */ - ret = wma_cli_set_command(adapter->sessionId, - WMI_STA_SMPS_PARAM_CMDID, - HDD_DTIM_1CHAIN_RX_ID << - HDD_SMPS_PARAM_VALUE_S, - VDEV_CMD); - - if (ret != 0) { - hddLog(QDF_TRACE_LEVEL_ERROR, - FL("DTIM 1 chain set failed %d"), ret); - goto err_lro_cleanup; - } - - ret = wma_cli_set_command(adapter->sessionId, - WMI_PDEV_PARAM_TX_CHAIN_MASK, - hdd_ctx->config->txchainmask1x1, - PDEV_CMD); - if (ret != 0) { - hddLog(QDF_TRACE_LEVEL_ERROR, - FL("WMI_PDEV_PARAM_TX_CHAIN_MASK set failed %d"), - ret); - goto err_lro_cleanup; - } - ret = wma_cli_set_command(adapter->sessionId, - WMI_PDEV_PARAM_RX_CHAIN_MASK, - hdd_ctx->config->rxchainmask1x1, - PDEV_CMD); - if (ret != 0) { - hddLog(QDF_TRACE_LEVEL_ERROR, - FL("WMI_PDEV_PARAM_RX_CHAIN_MASK set failed %d"), - ret); - goto err_lro_cleanup; - } -#undef HDD_DTIM_1CHAIN_RX_ID -#undef HDD_SMPS_PARAM_VALUE_S - } - - if (QDF_GLOBAL_FTM_MODE != cds_get_conparam()) { - ret = wma_cli_set_command(adapter->sessionId, - WMI_PDEV_PARAM_HYST_EN, - hdd_ctx->config->enableMemDeepSleep, - PDEV_CMD); - - if (ret != 0) { - hddLog(QDF_TRACE_LEVEL_ERROR, - FL("WMI_PDEV_PARAM_HYST_EN set failed %d"), - ret); - goto err_lro_cleanup; - } + if (hdd_set_fw_params(adapter)) { + hdd_err("Failed to set the fw parameters"); + goto err_lro_cleanup; } -#ifdef CONFIG_FW_LOGS_BASED_ON_INI - - /* Enable FW logs based on INI configuration */ - if ((QDF_GLOBAL_FTM_MODE != cds_get_conparam()) && - (hdd_ctx->config->enable_fw_log)) { - uint8_t count = 0; - uint32_t value = 0; - uint8_t numEntries = 0; - uint8_t moduleLoglevel[FW_MODULE_LOG_LEVEL_STRING_LENGTH]; - - hdd_ctx->fw_log_settings.dl_type = - hdd_ctx->config->enableFwLogType; - ret = wma_cli_set_command(adapter->sessionId, - WMI_DBGLOG_TYPE, - hdd_ctx->config->enableFwLogType, - DBG_CMD); - if (ret != 0) { - hddLog(LOGE, FL("Failed to enable FW log type ret %d"), - ret); - } - - hdd_ctx->fw_log_settings.dl_loglevel = - hdd_ctx->config->enableFwLogLevel; - ret = wma_cli_set_command(adapter->sessionId, - WMI_DBGLOG_LOG_LEVEL, - hdd_ctx->config->enableFwLogLevel, - DBG_CMD); - if (ret != 0) { - hddLog(LOGE, FL("Failed to enable FW log level ret %d"), - ret); - } - - hdd_string_to_u8_array(hdd_ctx->config->enableFwModuleLogLevel, - moduleLoglevel, - &numEntries, - FW_MODULE_LOG_LEVEL_STRING_LENGTH); - while (count < numEntries) { - /* - * FW module log level input string looks like below: - * gFwDebugModuleLoglevel=<FW Module ID>,<Log Level>,... - * For example: - * gFwDebugModuleLoglevel=1,0,2,1,3,2,4,3,5,4,6,5,7,6 - * Above input string means : - * For FW module ID 1 enable log level 0 - * For FW module ID 2 enable log level 1 - * For FW module ID 3 enable log level 2 - * For FW module ID 4 enable log level 3 - * For FW module ID 5 enable log level 4 - * For FW module ID 6 enable log level 5 - * For FW module ID 7 enable log level 6 - */ - - /* FW expects WMI command value = - * Module ID * 10 + Module Log level - */ - value = ((moduleLoglevel[count] * 10) + - moduleLoglevel[count + 1]); - ret = wma_cli_set_command(adapter->sessionId, - WMI_DBGLOG_MOD_LOG_LEVEL, - value, DBG_CMD); - if (ret != 0) { - hddLog(LOGE, - FL - ("Failed to enable FW module log level %d ret %d"), - value, ret); - } - - count += 2; - } - } -#endif if (QDF_STATUS_SUCCESS != hdd_debugfs_init(adapter)) hdd_err("Interface %s wow debug_fs init failed", iface_name); @@ -4218,6 +4309,9 @@ void hdd_wlan_exit(hdd_context_t *hdd_ctx) */ hdd_stop_all_adapters(hdd_ctx); + /* De-register the SME callbacks */ + hdd_deregister_cb(hdd_ctx); + /* Stop all the modules */ qdf_status = cds_disable(p_cds_context); if (!QDF_IS_STATUS_SUCCESS(qdf_status)) { @@ -6013,6 +6107,81 @@ static hdd_adapter_t *hdd_open_monitor_interface(hdd_context_t *hdd_ctx, } /** + * hdd_start_station_adapter()- Start the Station Adapter + * @adapter: HDD adapter + * + * This function initializes the adapter for the station mode. + * + * Return: 0 on success or errno on failure. + */ +int hdd_start_station_adapter(hdd_adapter_t *adapter) +{ + QDF_STATUS status; + + ENTER_DEV(adapter->dev); + + status = hdd_init_station_mode(adapter); + + if (QDF_STATUS_SUCCESS != status) { + hdd_err("Error Initializing station mode: %d", status); + return qdf_status_to_os_return(status); + } + + EXIT(); + return 0; +} + +/** + * hdd_start_ap_adapter()- Start AP Adapter + * @adapter: HDD adapter + * + * This function initializes the adapter for the AP mode. + * + * Return: 0 on success errno on failure. + */ +int hdd_start_ap_adapter(hdd_adapter_t *adapter) +{ + QDF_STATUS status; + + ENTER(); + + status = hdd_init_ap_mode(adapter); + + if (QDF_STATUS_SUCCESS != status) { + hdd_err("Error Initializing the AP mode: %d", status); + return qdf_status_to_os_return(status); + } + + EXIT(); + return 0; +} + +/** + * hdd_start_ftm_adapter()- Start FTM adapter + * @adapter: HDD adapter + * + * This function initializes the adapter for the FTM mode. + * + * Return: 0 on success or errno on failure. + */ +int hdd_start_ftm_adapter(hdd_adapter_t *adapter) +{ + QDF_STATUS qdf_status; + + ENTER_DEV(adapter->dev); + + qdf_status = hdd_init_tx_rx(adapter); + + if (QDF_STATUS_SUCCESS != qdf_status) { + hdd_err("Failed to start FTM adapter: %d", qdf_status); + return qdf_status_to_os_return(qdf_status); + } + + return 0; + EXIT(); +} + +/** * hdd_open_interfaces - Open all required interfaces * hdd_ctx: HDD context * rtnl_held: True if RTNL lock is held @@ -6115,6 +6284,145 @@ static int hdd_update_country_code(hdd_context_t *hdd_ctx, return ret; } +#ifdef QCA_LL_TX_FLOW_CONTROL_V2 +/** + * hdd_txrx_populate_cds_config() - Populate txrx cds configuration + * @cds_cfg: CDS Configuration + * @hdd_ctx: Pointer to hdd context + * + * Return: none + */ +static inline void hdd_txrx_populate_cds_config(struct cds_config_info + *cds_cfg, + hdd_context_t *hdd_ctx) +{ + cds_cfg->tx_flow_stop_queue_th = + hdd_ctx->config->TxFlowStopQueueThreshold; + cds_cfg->tx_flow_start_queue_offset = + hdd_ctx->config->TxFlowStartQueueOffset; +} +#else +static inline void hdd_txrx_populate_cds_config(struct cds_config_info + *cds_cfg, + hdd_context_t *hdd_ctx) +{ +} +#endif + +#ifdef FEATURE_WLAN_RA_FILTERING +/** + * hdd_ra_populate_cds_config() - Populate RA filtering cds configuration + * @cds_cfg: CDS Configuration + * @hdd_ctx: Pointer to hdd context + * + * Return: none + */ +inline void hdd_ra_populate_cds_config(struct cds_config_info *cds_cfg, + hdd_context_t *hdd_ctx) +{ + cds_cfg->ra_ratelimit_interval = + hdd_ctx->config->RArateLimitInterval; + cds_cfg->is_ra_ratelimit_enabled = + hdd_ctx->config->IsRArateLimitEnabled; +} +#else +inline void hdd_ra_populate_cds_config(struct cds_config_info *cds_cfg, + hdd_context_t *hdd_ctx) +{ +} +#endif + +/** + * hdd_update_cds_config() - API to update cds configuration parameters + * @hdd_ctx: HDD Context + * + * Return: 0 for Success, errno on failure + */ +int hdd_update_cds_config(hdd_context_t *hdd_ctx) +{ + struct cds_config_info *cds_cfg; + + cds_cfg = (struct cds_config_info *)qdf_mem_malloc(sizeof(*cds_cfg)); + if (!cds_cfg) { + hdd_err("failed to allocate cds config"); + return -ENOMEM; + } + + qdf_mem_zero(cds_cfg, sizeof(*cds_cfg)); + + /* UMA is supported in hardware for performing the + * frame translation 802.11 <-> 802.3 + */ + cds_cfg->frame_xln_reqd = 1; + cds_cfg->driver_type = DRIVER_TYPE_PRODUCTION; + cds_cfg->powersave_offload_enabled = + hdd_ctx->config->enablePowersaveOffload; + cds_cfg->sta_dynamic_dtim = hdd_ctx->config->enableDynamicDTIM; + cds_cfg->sta_mod_dtim = hdd_ctx->config->enableModulatedDTIM; + cds_cfg->sta_maxlimod_dtim = hdd_ctx->config->fMaxLIModulatedDTIM; + cds_cfg->wow_enable = hdd_ctx->config->wowEnable; + cds_cfg->max_wow_filters = hdd_ctx->config->maxWoWFilters; + + /* Here ol_ini_info is used to store ini status of arp offload + * ns offload and others. Currently 1st bit is used for arp + * off load and 2nd bit for ns offload currently, rest bits are unused + */ + if (hdd_ctx->config->fhostArpOffload) + cds_cfg->ol_ini_info = cds_cfg->ol_ini_info | 0x1; + if (hdd_ctx->config->fhostNSOffload) + cds_cfg->ol_ini_info = cds_cfg->ol_ini_info | 0x2; + + /* + * Copy the DFS Phyerr Filtering Offload status. + * This parameter reflects the value of the + * dfs_phyerr_filter_offload flag as set in the ini. + */ + cds_cfg->dfs_phyerr_filter_offload = + hdd_ctx->config->fDfsPhyerrFilterOffload; + if (hdd_ctx->config->ssdp) + cds_cfg->ssdp = hdd_ctx->config->ssdp; + + cds_cfg->enable_mc_list = hdd_ctx->config->fEnableMCAddrList; + cds_cfg->ap_maxoffload_peers = hdd_ctx->config->apMaxOffloadPeers; + + cds_cfg->ap_maxoffload_reorderbuffs = + hdd_ctx->config->apMaxOffloadReorderBuffs; + + cds_cfg->ap_disable_intrabss_fwd = + hdd_ctx->config->apDisableIntraBssFwd; + + cds_cfg->dfs_pri_multiplier = + hdd_ctx->config->dfsRadarPriMultiplier; + cds_cfg->reorder_offload = + hdd_ctx->config->reorderOffloadSupport; + + /* IPA micro controller data path offload resource config item */ + cds_cfg->uc_offload_enabled = hdd_ipa_uc_is_enabled(hdd_ctx); + cds_cfg->uc_txbuf_count = hdd_ctx->config->IpaUcTxBufCount; + cds_cfg->uc_txbuf_size = hdd_ctx->config->IpaUcTxBufSize; + cds_cfg->uc_rxind_ringcount = + hdd_ctx->config->IpaUcRxIndRingCount; + cds_cfg->uc_tx_partition_base = + hdd_ctx->config->IpaUcTxPartitionBase; + cds_cfg->max_scan = hdd_ctx->config->max_scan_count; + + cds_cfg->ip_tcp_udp_checksum_offload = + hdd_ctx->config->enable_ip_tcp_udp_checksum_offload; + cds_cfg->enable_rxthread = hdd_ctx->config->enableRxThread; + cds_cfg->ce_classify_enabled = + hdd_ctx->config->ce_classify_enabled; + cds_cfg->tx_chain_mask_cck = hdd_ctx->config->tx_chain_mask_cck; + cds_cfg->self_gen_frm_pwr = hdd_ctx->config->self_gen_frm_pwr; + cds_cfg->max_station = hdd_ctx->config->maxNumberOfPeers; + + hdd_ra_populate_cds_config(cds_cfg, hdd_ctx); + hdd_txrx_populate_cds_config(cds_cfg, hdd_ctx); + hdd_nan_populate_cds_config(cds_cfg, hdd_ctx); + + cds_init_ini_config(cds_cfg); + return 0; +} + /** * hdd_init_thermal_info - Initialize thermal level * @hdd_ctx: HDD context @@ -6582,6 +6890,10 @@ int hdd_wlan_startup(struct device *dev, void *hif_sc) if (ret) goto err_hdd_free_context; + ret = hdd_update_config(hdd_ctx); + if (ret) + goto err_hdd_free_context; + if (QDF_GLOBAL_FTM_MODE == hdd_get_conparam()) { ret = hdd_enable_ftm(hdd_ctx); if (ret) @@ -6591,7 +6903,6 @@ int hdd_wlan_startup(struct device *dev, void *hif_sc) } hdd_wlan_green_ap_init(hdd_ctx); - status = cds_open(); if (!QDF_IS_STATUS_SUCCESS(status)) { hddLog(QDF_TRACE_LEVEL_FATAL, FL("cds_open failed")); @@ -6669,18 +6980,13 @@ int hdd_wlan_startup(struct device *dev, void *hif_sc) &hdd_ctx->target_hw_name); /* Get the wlan hw/fw version */ - hdd_wlan_get_version(adapter, NULL, NULL); + hdd_wlan_get_version(hdd_ctx, NULL, NULL); ret = hdd_update_country_code(hdd_ctx, adapter); if (ret) goto err_close_adapter; - sme_register11d_scan_done_callback(hdd_ctx->hHal, hdd_11d_scan_done); - - sme_register_oem_data_rsp_callback(hdd_ctx->hHal, - hdd_send_oem_data_rsp_msg); - /* FW capabilities received, Set the Dot11 mode */ sme_setdef_dot11mode(hdd_ctx->hHal); @@ -6717,7 +7023,6 @@ int hdd_wlan_startup(struct device *dev, void *hif_sc) hddLog(LOGE, FL("Failed to init ACS Skip timer")); #endif - wlan_hdd_nan_init(hdd_ctx); sme_cbacks.sme_get_valid_channels = sme_get_cfg_valid_channels; sme_cbacks.sme_get_nss_for_vdev = sme_get_vdev_type_nss; status = cds_init_policy_mgr(&sme_cbacks); @@ -6753,32 +7058,11 @@ int hdd_wlan_startup(struct device *dev, void *hif_sc) hdd_bus_bw_compute_cbk, (void *)hdd_ctx); #endif - wlan_hdd_cfg80211_stats_ext_init(hdd_ctx); - - sme_ext_scan_register_callback(hdd_ctx->hHal, - wlan_hdd_cfg80211_extscan_callback); - - status = hdd_register_for_sap_restart_with_channel_switch(); - if (!QDF_IS_STATUS_SUCCESS(status)) - goto err_exit_nl_srv; - - sme_set_rssi_threshold_breached_cb(hdd_ctx->hHal, - hdd_rssi_threshold_breached); - - status = sme_bpf_offload_register_callback(hdd_ctx->hHal, - hdd_get_bpf_offload_cb); - if (QDF_IS_STATUS_SUCCESS(status)) - hdd_err("set bpf offload callback failed"); - - hdd_cfg80211_link_layer_stats_init(hdd_ctx); - wlan_hdd_tsf_init(hdd_ctx); wlan_hdd_send_all_scan_intf_info(hdd_ctx); wlan_hdd_send_version_pkg(hdd_ctx->target_fw_version, hdd_ctx->target_hw_version, hdd_ctx->target_hw_name); - wlan_hdd_dcc_register_for_dcc_stats_event(hdd_ctx); - if (hdd_ctx->config->dual_mac_feature_disable) { status = wlan_hdd_disable_all_dual_mac_features(hdd_ctx); if (status != QDF_STATUS_SUCCESS) { @@ -6802,6 +7086,12 @@ int hdd_wlan_startup(struct device *dev, void *hif_sc) memdump_init(); + ret = hdd_register_cb(hdd_ctx); + if (ret) { + hdd_err("Failed to register HDD callbacks!"); + goto err_exit_nl_srv; + } + goto success; err_debugfs_exit: @@ -6838,7 +7128,7 @@ err_exit_nl_srv: hdd_err("Failed to deinit policy manager"); /* Proceed and complete the clean up */ } - + cds_deinit_ini_config(); err_hdd_free_context: hdd_context_destroy(hdd_ctx); QDF_BUG(1); @@ -6851,6 +7141,122 @@ success: } /** + * hdd_register_cb() - Register HDD callbacks. + * @hdd_ctx: HDD context + * + * Register the HDD callbacks to CDS/SME. + * + * Return: 0 for success or Error code for failure + */ +int hdd_register_cb(hdd_context_t *hdd_ctx) +{ + QDF_STATUS status; + int ret = 0; + + ENTER(); + + sme_register11d_scan_done_callback(hdd_ctx->hHal, hdd_11d_scan_done); + + sme_register_oem_data_rsp_callback(hdd_ctx->hHal, + hdd_send_oem_data_rsp_msg); + + status = sme_fw_mem_dump_register_cb(hdd_ctx->hHal, + wlan_hdd_cfg80211_fw_mem_dump_cb); + if (!QDF_IS_STATUS_SUCCESS(status)) { + hdd_err("Failed to register memdump callback"); + ret = -EINVAL; + return ret; + } + + sme_set_tsfcb(hdd_ctx->hHal, hdd_get_tsf_cb, hdd_ctx); + sme_nan_register_callback(hdd_ctx->hHal, + wlan_hdd_cfg80211_nan_callback); + sme_stats_ext_register_callback(hdd_ctx->hHal, + wlan_hdd_cfg80211_stats_ext_callback); + + sme_ext_scan_register_callback(hdd_ctx->hHal, + wlan_hdd_cfg80211_extscan_callback); + + status = cds_register_sap_restart_channel_switch_cb( + (void *)hdd_sap_restart_with_channel_switch); + if (!QDF_IS_STATUS_SUCCESS(status)) { + hdd_err("restart cb registration failed"); + ret = -EINVAL; + return ret; + } + + sme_set_rssi_threshold_breached_cb(hdd_ctx->hHal, + hdd_rssi_threshold_breached); + + status = sme_bpf_offload_register_callback(hdd_ctx->hHal, + hdd_get_bpf_offload_cb); + if (!QDF_IS_STATUS_SUCCESS(status)) { + hdd_err("set bpf offload callback failed"); + ret = -EINVAL; + return ret; + } + + sme_set_link_layer_stats_ind_cb(hdd_ctx->hHal, + wlan_hdd_cfg80211_link_layer_stats_callback); + + wlan_hdd_dcc_register_for_dcc_stats_event(hdd_ctx); + + EXIT(); + + return ret; +} + +/** + * hdd_deregister_cb() - De-Register HDD callbacks. + * @hdd_ctx: HDD context + * + * De-Register the HDD callbacks to CDS/SME. + * + * Return: void + */ +void hdd_deregister_cb(hdd_context_t *hdd_ctx) +{ + QDF_STATUS status; + + ENTER(); + + status = sme_deregister_for_dcc_stats_event(hdd_ctx->hHal); + if (!QDF_IS_STATUS_SUCCESS(status)) + hdd_err("De-register of dcc stats callback failed: %d", + status); + + sme_reset_link_layer_stats_ind_cb(hdd_ctx->hHal); + status = sme_bpf_offload_deregister_callback(hdd_ctx->hHal); + if (!QDF_IS_STATUS_SUCCESS(status)) + hdd_err("De-register bpf offload callback failed: %d", + status); + sme_reset_rssi_threshold_breached_cb(hdd_ctx->hHal); + + status = cds_deregister_sap_restart_channel_switch_cb(); + if (!QDF_IS_STATUS_SUCCESS(status)) + hdd_err("De-register restart cb registration failed: %d", + status); + + sme_stats_ext_register_callback(hdd_ctx->hHal, + wlan_hdd_cfg80211_stats_ext_callback); + + sme_nan_deregister_callback(hdd_ctx->hHal); + status = sme_reset_tsfcb(hdd_ctx->hHal); + if (!QDF_IS_STATUS_SUCCESS(status)) + hdd_err("Failed to de-register tsfcb the callback:%d", + status); + status = sme_fw_mem_dump_unregister_cb(hdd_ctx->hHal); + if (!QDF_IS_STATUS_SUCCESS(status)) + hdd_err("Failed to de-register the fw mem dump callback: %d", + status); + + sme_deregister_oem_data_rsp_callback(hdd_ctx->hHal); + sme_deregister11d_scan_done_callback(hdd_ctx->hHal); + + EXIT(); +} + +/** * hdd_softap_sta_deauth() - handle deauth req from HDD * @adapter: Pointer to the HDD * @enable: bool value @@ -7887,12 +8293,20 @@ static void hdd_update_hif_config(hdd_context_t *hdd_ctx) * @hdd_ctx: HDD Context * * API is used to initialize all driver per module configuration parameters - * Return: void + * Return: 0 for success, errno for failure */ -void hdd_update_config(hdd_context_t *hdd_ctx) +int hdd_update_config(hdd_context_t *hdd_ctx) { + int ret; + hdd_update_ol_config(hdd_ctx); hdd_update_hif_config(hdd_ctx); + if (QDF_GLOBAL_FTM_MODE == hdd_get_conparam()) + ret = hdd_update_cds_config_ftm(hdd_ctx); + else + ret = hdd_update_cds_config(hdd_ctx); + + return ret; } /* Register the module init/exit functions */ diff --git a/core/hdd/src/wlan_hdd_memdump.c b/core/hdd/src/wlan_hdd_memdump.c index 0434a69d5608..2e13649614fd 100644 --- a/core/hdd/src/wlan_hdd_memdump.c +++ b/core/hdd/src/wlan_hdd_memdump.c @@ -100,14 +100,14 @@ static void memdump_cleanup_timer_cb(void *data) /** * wlan_hdd_cfg80211_fw_mem_dump_cb() - Callback to receive FW memory dump * @ctx: pointer to HDD context. - * @rsp: pointer to fw dump copy complete response + * @dump_rsp: pointer to fw dump copy complete response * * This is a callback function used to indicate user space about the * availability for firmware memory dump via vendor event. * * Return: None */ -static void wlan_hdd_cfg80211_fw_mem_dump_cb(void *ctx, +void wlan_hdd_cfg80211_fw_mem_dump_cb(void *ctx, struct fw_dump_rsp *dump_rsp) { hdd_context_t *hdd_ctx = ctx; @@ -611,7 +611,6 @@ void memdump_deinit(void) } memdump_procfs_remove(); - sme_fw_mem_dump_unregister_cb(hdd_ctx->hHal); mutex_lock(&hdd_ctx->memdump_lock); if (hdd_ctx->fw_dump_loc) { diff --git a/core/hdd/src/wlan_hdd_nan.c b/core/hdd/src/wlan_hdd_nan.c index cbf3a68d5072..ad01978322e3 100644 --- a/core/hdd/src/wlan_hdd_nan.c +++ b/core/hdd/src/wlan_hdd_nan.c @@ -127,7 +127,7 @@ int wlan_hdd_cfg80211_nan_request(struct wiphy *wiphy, * * Return: nothing */ -static void wlan_hdd_cfg80211_nan_callback(void *ctx, tSirNanEvent *msg) +void wlan_hdd_cfg80211_nan_callback(void *ctx, tSirNanEvent *msg) { hdd_context_t *hdd_ctx = ctx; struct sk_buff *vendor_event; @@ -174,18 +174,3 @@ bool wlan_hdd_nan_is_supported(void) { return sme_is_feature_supported_by_fw(NAN); } - -/** - * wlan_hdd_nan_init() - HDD NAN initialization function - * @hdd_ctx: Global HDD context - * - * This function is called to initialize the HDD NAN feature. Currently - * the only operation required is to register a callback with SME. - * - * Return: void - */ -void wlan_hdd_nan_init(hdd_context_t *hdd_ctx) -{ - sme_nan_register_callback(hdd_ctx->hHal, - wlan_hdd_cfg80211_nan_callback); -} diff --git a/core/hdd/src/wlan_hdd_ocb.c b/core/hdd/src/wlan_hdd_ocb.c index 69e936e7b3a7..9b435ce7dac3 100644 --- a/core/hdd/src/wlan_hdd_ocb.c +++ b/core/hdd/src/wlan_hdd_ocb.c @@ -1988,7 +1988,7 @@ void wlan_hdd_dcc_register_for_dcc_stats_event(hdd_context_t *hdd_ctx) int rc; rc = sme_register_for_dcc_stats_event(hdd_ctx->hHal, hdd_ctx, - wlan_hdd_dcc_stats_event_callback); + wlan_hdd_dcc_stats_event_callback); if (rc) hdd_err("Register callback failed: %d", rc); } diff --git a/core/hdd/src/wlan_hdd_ocb.h b/core/hdd/src/wlan_hdd_ocb.h index 0ca97bf607fb..73f700bdba0b 100644 --- a/core/hdd/src/wlan_hdd_ocb.h +++ b/core/hdd/src/wlan_hdd_ocb.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011-2015 The Linux Foundation. All rights reserved. + * Copyright (c) 2011-2016 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -289,4 +289,7 @@ int wlan_hdd_cfg80211_dcc_update_ndl(struct wiphy *wiphy, void wlan_hdd_dcc_register_for_dcc_stats_event(hdd_context_t *hdd_ctx); +void wlan_hdd_dcc_stats_event(void *context_ptr, void *response_ptr); + + #endif /* __WLAN_HDD_OCB_H */ diff --git a/core/hdd/src/wlan_hdd_power.c b/core/hdd/src/wlan_hdd_power.c index 8eb578c50773..f0472e76d8f9 100644 --- a/core/hdd/src/wlan_hdd_power.c +++ b/core/hdd/src/wlan_hdd_power.c @@ -1326,6 +1326,8 @@ QDF_STATUS hdd_wlan_shutdown(void) hdd_cleanup_scan_queue(pHddCtx); hdd_reset_all_adapters(pHddCtx); + /* De-register the HDD callbacks */ + hdd_deregister_cb(pHddCtx); hdd_ipa_uc_ssr_deinit(); cds_sched_context = get_cds_sched_ctxt(); @@ -1432,7 +1434,7 @@ QDF_STATUS hdd_wlan_re_init(void *hif_sc) hdd_context_t *pHddCtx = NULL; QDF_STATUS qdf_ret_status; hdd_adapter_t *pAdapter; - int i; + int i, ret; hdd_prevent_suspend(WIFI_POWER_EVENT_WAKELOCK_DRIVER_REINIT); @@ -1460,6 +1462,10 @@ QDF_STATUS hdd_wlan_re_init(void *hif_sc) /* The driver should always be initialized in STA mode after SSR */ hdd_set_conparam(0); + ret = hdd_update_config(pHddCtx); + if (ret) + goto err_re_init; + /* Re-open CDS, it is a re-open b'se control transport was never closed. */ qdf_status = cds_open(); if (!QDF_IS_STATUS_SUCCESS(qdf_status)) { @@ -1551,9 +1557,7 @@ QDF_STATUS hdd_wlan_re_init(void *hif_sc) if (hdd_ipa_uc_ssr_reinit()) hdd_err("HDD IPA UC reinit failed"); - /* Get WLAN Host/FW/HW version */ - if (pAdapter) - hdd_wlan_get_version(pAdapter, NULL, NULL); + hdd_wlan_get_version(pHddCtx, NULL, NULL); /* Restart all adapters */ hdd_start_all_adapters(pHddCtx); @@ -1611,15 +1615,11 @@ QDF_STATUS hdd_wlan_re_init(void *hif_sc) /* Allow the phone to go to sleep */ hdd_allow_suspend(WIFI_POWER_EVENT_WAKELOCK_DRIVER_REINIT); - sme_ext_scan_register_callback(pHddCtx->hHal, - wlan_hdd_cfg80211_extscan_callback); - - qdf_status = hdd_register_for_sap_restart_with_channel_switch(); - if (!QDF_IS_STATUS_SUCCESS(qdf_status)) - /* Error already logged */ + ret = hdd_register_cb(pHddCtx); + if (ret) { + hdd_err("Failed to register HDD callbacks!"); goto err_cds_disable; - - sme_set_rssi_threshold_breached_cb(pHddCtx->hHal, hdd_rssi_threshold_breached); + } wlan_hdd_send_all_scan_intf_info(pHddCtx); wlan_hdd_send_version_pkg(pHddCtx->target_fw_version, diff --git a/core/hdd/src/wlan_hdd_stats.c b/core/hdd/src/wlan_hdd_stats.c index c91d516226a2..fce9d96d26b0 100644 --- a/core/hdd/src/wlan_hdd_stats.c +++ b/core/hdd/src/wlan_hdd_stats.c @@ -962,7 +962,7 @@ static void hdd_link_layer_process_radio_stats(hdd_adapter_t *pAdapter, * * Return: None */ -static void wlan_hdd_cfg80211_link_layer_stats_callback(void *ctx, +void wlan_hdd_cfg80211_link_layer_stats_callback(void *ctx, int indType, void *pRsp) { hdd_context_t *pHddCtx = (hdd_context_t *) ctx; @@ -1071,18 +1071,6 @@ static void wlan_hdd_cfg80211_link_layer_stats_callback(void *ctx, return; } -/** - * hdd_cfg80211_link_layer_stats_init() - Initialize link layer stats - * @pHddCtx: Pointer to hdd context - * - * Return: None - */ -void hdd_cfg80211_link_layer_stats_init(hdd_context_t *pHddCtx) -{ - sme_set_link_layer_stats_ind_cb(pHddCtx->hHal, - wlan_hdd_cfg80211_link_layer_stats_callback); -} - const struct nla_policy qca_wlan_vendor_ll_set_policy[QCA_WLAN_VENDOR_ATTR_LL_STATS_SET_MAX + 1] = { @@ -1557,7 +1545,7 @@ int wlan_hdd_cfg80211_stats_ext_request(struct wiphy *wiphy, * * Return: nothing */ -static void wlan_hdd_cfg80211_stats_ext_callback(void *ctx, +void wlan_hdd_cfg80211_stats_ext_callback(void *ctx, tStatsExtEvent *msg) { @@ -1614,18 +1602,6 @@ static void wlan_hdd_cfg80211_stats_ext_callback(void *ctx, cfg80211_vendor_event(vendor_event, GFP_KERNEL); } - -/** - * wlan_hdd_cfg80211_stats_ext_init() - ext stats init - * @ctx: Pointer to HDD context - * - * Return: nothing - */ -void wlan_hdd_cfg80211_stats_ext_init(hdd_context_t *pHddCtx) -{ - sme_stats_ext_register_callback(pHddCtx->hHal, - wlan_hdd_cfg80211_stats_ext_callback); -} #endif /* End of WLAN_FEATURE_STATS_EXT */ /** diff --git a/core/hdd/src/wlan_hdd_stats.h b/core/hdd/src/wlan_hdd_stats.h index 8055f15e56e5..2c2fefc5b31b 100644 --- a/core/hdd/src/wlan_hdd_stats.h +++ b/core/hdd/src/wlan_hdd_stats.h @@ -88,8 +88,6 @@ struct index_data_rate_type { */ #define LL_STATS_EVENT_BUF_SIZE 4096 -void hdd_cfg80211_link_layer_stats_init(hdd_context_t *pHddCtx); - /** * wlan_hdd_cfg80211_ll_stats_set() - set link layer stats * @wiphy: Pointer to wiphy @@ -142,11 +140,6 @@ static inline bool hdd_link_layer_stats_supported(void) #else -static inline void hdd_cfg80211_link_layer_stats_init(hdd_context_t *pHddCtx) -{ - return; -} - static inline void hdd_init_ll_stats_ctx(void) { return; @@ -174,7 +167,6 @@ int wlan_hdd_cfg80211_stats_ext_request(struct wiphy *wiphy, const void *data, int data_len); -void wlan_hdd_cfg80211_stats_ext_init(hdd_context_t *pHddCtx); #else static inline void wlan_hdd_cfg80211_stats_ext_init(hdd_context_t *pHddCtx) {} #endif /* End of WLAN_FEATURE_STATS_EXT */ @@ -207,5 +199,10 @@ int wlan_hdd_cfg80211_dump_survey(struct wiphy *wiphy, void hdd_display_hif_stats(void); void hdd_clear_hif_stats(void); +void wlan_hdd_cfg80211_stats_ext_callback(void *ctx, + tStatsExtEvent *msg); + +void wlan_hdd_cfg80211_link_layer_stats_callback(void *ctx, + int indType, void *pRsp); #endif /* end #if !defined(WLAN_HDD_STATS_H) */ diff --git a/core/hdd/src/wlan_hdd_tsf.c b/core/hdd/src/wlan_hdd_tsf.c index e98759ae22f1..e230925a7cd7 100644 --- a/core/hdd/src/wlan_hdd_tsf.c +++ b/core/hdd/src/wlan_hdd_tsf.c @@ -201,7 +201,7 @@ int hdd_indicate_tsf(struct hdd_adapter_s *adapter, uint32_t *buf, int len) * * Return: 0 for success or non-zero negative failure code */ -static int hdd_get_tsf_cb(void *pcb_cxt, struct stsf *ptsf) +int hdd_get_tsf_cb(void *pcb_cxt, struct stsf *ptsf) { struct hdd_context_s *hddctx; struct hdd_adapter_s *adapter; diff --git a/core/hdd/src/wlan_hdd_wext.c b/core/hdd/src/wlan_hdd_wext.c index 7bfb224c61a6..9023070a1895 100644 --- a/core/hdd/src/wlan_hdd_wext.c +++ b/core/hdd/src/wlan_hdd_wext.c @@ -718,7 +718,7 @@ void hdd_wlan_dump_stats(hdd_adapter_t *adapter, int value) /** * hdd_wlan_get_version() - Get driver version information - * @pAdapter: Pointer to the adapter. + * @hdd_ctx: Global HDD context * @wrqu: Pointer to IOCTL REQUEST Data. * @extra: Pointer to destination buffer * @@ -729,43 +729,40 @@ void hdd_wlan_dump_stats(hdd_adapter_t *adapter, int value) * * Return: none */ -void hdd_wlan_get_version(hdd_adapter_t *pAdapter, union iwreq_data *wrqu, +void hdd_wlan_get_version(hdd_context_t *hdd_ctx, union iwreq_data *wrqu, char *extra) { - tSirVersionString wcnss_SW_version; - const char *pSWversion; - const char *pHWversion; - uint32_t MSPId = 0, mSPId = 0, SIId = 0, CRMId = 0; - - hdd_context_t *pHddContext; + tSirVersionString wcnss_sw_version; + const char *swversion; + const char *hwversion; + uint32_t msp_id = 0, mspid = 0, siid = 0, crmid = 0; - pHddContext = WLAN_HDD_GET_CTX(pAdapter); - if (!pHddContext) { + if (!hdd_ctx) { hdd_err("Invalid context, HDD context is null"); goto error; } - snprintf(wcnss_SW_version, sizeof(tSirVersionString), "%08x", - pHddContext->target_fw_version); + snprintf(wcnss_sw_version, sizeof(wcnss_sw_version), "%08x", + hdd_ctx->target_fw_version); - pSWversion = wcnss_SW_version; - MSPId = (pHddContext->target_fw_version & 0xf0000000) >> 28; - mSPId = (pHddContext->target_fw_version & 0xf000000) >> 24; - SIId = (pHddContext->target_fw_version & 0xf00000) >> 20; - CRMId = pHddContext->target_fw_version & 0x7fff; + swversion = wcnss_sw_version; + msp_id = (hdd_ctx->target_fw_version & 0xf0000000) >> 28; + mspid = (hdd_ctx->target_fw_version & 0xf000000) >> 24; + siid = (hdd_ctx->target_fw_version & 0xf00000) >> 20; + crmid = hdd_ctx->target_fw_version & 0x7fff; - pHWversion = pHddContext->target_hw_name; + hwversion = hdd_ctx->target_hw_name; if (wrqu && extra) { wrqu->data.length = scnprintf(extra, WE_MAX_STR_LEN, "Host SW:%s, FW:%d.%d.%d.%d, HW:%s", QWLAN_VERSIONSTR, - MSPId, mSPId, SIId, CRMId, pHWversion); + msp_id, mspid, siid, crmid, hwversion); } else { pr_info("Host SW:%s, FW:%d.%d.%d.%d, HW:%s\n", QWLAN_VERSIONSTR, - MSPId, mSPId, SIId, CRMId, pHWversion); + msp_id, mspid, siid, crmid, hwversion); } error: return; @@ -7005,7 +7002,7 @@ static int __iw_get_char_setnone(struct net_device *dev, switch (sub_cmd) { case WE_WLAN_VERSION: { - hdd_wlan_get_version(pAdapter, wrqu, extra); + hdd_wlan_get_version(hdd_ctx, wrqu, extra); break; } diff --git a/core/mac/inc/ani_global.h b/core/mac/inc/ani_global.h index cd786eac3f21..c51afa2d247e 100644 --- a/core/mac/inc/ani_global.h +++ b/core/mac/inc/ani_global.h @@ -871,96 +871,6 @@ typedef enum { eDRIVER_TYPE_MFG = 1, } tDriverType; -/** ------------------------------------------------------------------------- * - - \typedef tMacOpenParameters - - \brief Parameters needed for Enumeration of all status codes returned by the higher level - interface functions. - - -------------------------------------------------------------------------- */ - -typedef struct sMacOpenParameters { - uint16_t maxStation; - uint16_t maxBssId; - uint32_t frameTransRequired; - uint8_t powersaveOffloadEnabled; - /* Powersave Parameters */ - uint8_t staMaxLIModDtim; - uint8_t staModDtim; - uint8_t staDynamicDtim; - tDriverType driverType; - uint8_t maxWoWFilters; - uint8_t wowEnable; -/* Here olIniInfo is used to store ini - * status of arp offload, ns offload - * and others. Currently 1st bit is used - * for arp off load and 2nd bit for ns - * offload currently, rest bits are unused - */ - uint8_t olIniInfo; - bool ssdp; - bool enable_mc_list; - /* - * DFS Phyerror Filtering offload status from ini - * 0 indicates offload disabled - * 1 indicates offload enabled - */ - uint8_t dfsPhyerrFilterOffload; -/* pass intra-bss-fwd info to txrx module */ - uint8_t apDisableIntraBssFwd; - - /* max offload peer */ - uint8_t apMaxOffloadPeers; - - /* max offload reorder buffs */ - uint8_t apMaxOffloadReorderBuffs; - -#ifdef FEATURE_WLAN_RA_FILTERING - uint16_t RArateLimitInterval; - bool IsRArateLimitEnabled; -#endif - /* is RX re-ordering offloaded to the fw */ - uint8_t reorderOffload; - - /* dfs radar pri multiplier */ - int32_t dfsRadarPriMultiplier; - - /* IPA Micro controller data path offload enable flag */ - uint8_t ucOffloadEnabled; - /* IPA Micro controller data path offload TX buffer count */ - uint32_t ucTxBufCount; - /* IPA Micro controller data path offload TX buffer size */ - uint32_t ucTxBufSize; - /* IPA Micro controller data path offload RX indication ring count */ - uint32_t ucRxIndRingCount; - /* IPA Micro controller data path offload TX partition base */ - uint32_t ucTxPartitionBase; - bool enable_rxthread; - bool ip_tcp_udp_checksum_offload; - - /* CE based classification enabled */ - bool ce_classify_enabled; - - /* Maximum number of parallel scans */ - uint8_t max_scan; - -#ifdef QCA_LL_TX_FLOW_CONTROL_V2 - /* Threshold to stop queue in percentage */ - uint32_t tx_flow_stop_queue_th; - /* Start queue offset in percentage */ - uint32_t tx_flow_start_queue_offset; -#endif -#ifdef WLAN_FEATURE_LPSS - bool is_lpass_enabled; -#endif -#ifdef WLAN_FEATURE_NAN - bool is_nan_enabled; -#endif - bool tx_chain_mask_cck; - uint16_t self_gen_frm_pwr; -} tMacOpenParameters; - typedef struct sHalMacStartParameters { /* parametes for the Firmware */ tDriverType driverType; diff --git a/core/mac/inc/mac_init_api.h b/core/mac/inc/mac_init_api.h index 195f9e83db86..1a231d43f4e9 100644 --- a/core/mac/inc/mac_init_api.h +++ b/core/mac/inc/mac_init_api.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011-2015 The Linux Foundation. All rights reserved. + * Copyright (c) 2011-2016 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -44,7 +44,7 @@ tSirRetStatus mac_start(tHalHandle hHal, void *pHalMacStartParams); tSirRetStatus mac_stop(tHalHandle hHal, tHalStopType stopType); tSirRetStatus mac_open(tHalHandle *pHalHandle, tHddHandle hHdd, - tMacOpenParameters *pMacOpenParms); + struct cds_config_info *cds_cfg); tSirRetStatus mac_close(tHalHandle hHal); #endif /* __MAC_INIT_API_H */ diff --git a/core/mac/inc/qwlan_version.h b/core/mac/inc/qwlan_version.h index aff4707e7b74..e0f183833b34 100644 --- a/core/mac/inc/qwlan_version.h +++ b/core/mac/inc/qwlan_version.h @@ -41,9 +41,9 @@ #define QWLAN_VERSION_MAJOR 5 #define QWLAN_VERSION_MINOR 1 #define QWLAN_VERSION_PATCH 0 -#define QWLAN_VERSION_EXTRA "F" +#define QWLAN_VERSION_EXTRA "I" #define QWLAN_VERSION_BUILD 22 -#define QWLAN_VERSIONSTR "5.1.0.22F" +#define QWLAN_VERSIONSTR "5.1.0.22I" #endif /* QWLAN_VERSION_H */ diff --git a/core/mac/src/pe/include/lim_api.h b/core/mac/src/pe/include/lim_api.h index 82f9a2cff61a..550babf49c04 100644 --- a/core/mac/src/pe/include/lim_api.h +++ b/core/mac/src/pe/include/lim_api.h @@ -98,7 +98,7 @@ typedef enum eMgmtFrmDropReason { * This called upon LIM thread creation. */ extern tSirRetStatus lim_initialize(tpAniSirGlobal); -tSirRetStatus pe_open(tpAniSirGlobal pMac, tMacOpenParameters *pMacOpenParam); +tSirRetStatus pe_open(tpAniSirGlobal pMac, struct cds_config_info *cds_cfg); tSirRetStatus pe_close(tpAniSirGlobal pMac); void pe_register_tl_handle(tpAniSirGlobal pMac); tSirRetStatus lim_start(tpAniSirGlobal pMac); diff --git a/core/mac/src/pe/lim/lim_api.c b/core/mac/src/pe/lim/lim_api.c index 941a893bf000..f450afb4d8d6 100644 --- a/core/mac/src/pe/lim/lim_api.c +++ b/core/mac/src/pe/lim/lim_api.c @@ -691,15 +691,15 @@ void lim_cleanup(tpAniSirGlobal pMac) \return tSirRetStatus -------------------------------------------------------------*/ -tSirRetStatus pe_open(tpAniSirGlobal pMac, tMacOpenParameters *pMacOpenParam) +tSirRetStatus pe_open(tpAniSirGlobal pMac, struct cds_config_info *cds_cfg) { tSirRetStatus status = eSIR_SUCCESS; - if (eDRIVER_TYPE_MFG == pMacOpenParam->driverType) + if (DRIVER_TYPE_MFG == cds_cfg->driver_type) return eSIR_SUCCESS; - pMac->lim.maxBssId = pMacOpenParam->maxBssId; - pMac->lim.maxStation = pMacOpenParam->maxStation; + pMac->lim.maxBssId = cds_cfg->max_bssid; + pMac->lim.maxStation = cds_cfg->max_station; if ((pMac->lim.maxBssId == 0) || (pMac->lim.maxStation == 0)) { PELOGE(lim_log(pMac, LOGE, diff --git a/core/mac/src/pe/lim/lim_assoc_utils.c b/core/mac/src/pe/lim/lim_assoc_utils.c index d2716344806b..8a3f06c7f6a0 100644 --- a/core/mac/src/pe/lim/lim_assoc_utils.c +++ b/core/mac/src/pe/lim/lim_assoc_utils.c @@ -1419,7 +1419,7 @@ tSirRetStatus lim_populate_vht_mcs_set(tpAniSirGlobal mac_ctx, QDF_MIN(rates->vhtRxHighestDataRate, peer_vht_caps->rxHighSupDataRate); - if (session_entry && session_entry->vdev_nss == NSS_2x2_MODE) { + if (session_entry && session_entry->nss == NSS_2x2_MODE) { if (mac_ctx->lteCoexAntShare && IS_24G_CH(session_entry->currentOperChannel)) { if (IS_2X2_CHAIN(session_entry->chainMask)) @@ -1637,7 +1637,7 @@ lim_populate_own_rate_set(tpAniSirGlobal mac_ctx, return eSIR_FAILURE; } - if (session_entry->vdev_nss == NSS_1x1_MODE) + if (session_entry->nss == NSS_1x1_MODE) rates->supportedMCSSet[1] = 0; /* * if supported MCS Set of the peer is passed in, @@ -1657,7 +1657,7 @@ lim_populate_own_rate_set(tpAniSirGlobal mac_ctx, rates->supportedMCSSet[i]);) } lim_populate_vht_mcs_set(mac_ctx, rates, vht_caps, - session_entry, session_entry->vdev_nss); + session_entry, session_entry->nss); return eSIR_SUCCESS; } @@ -1779,7 +1779,7 @@ lim_populate_peer_rate_set(tpAniSirGlobal pMac, ) return eSIR_FAILURE; } - if (psessionEntry->vdev_nss == NSS_1x1_MODE) + if (psessionEntry->nss == NSS_1x1_MODE) pRates->supportedMCSSet[1] = 0; /* if supported MCS Set of the peer is passed in, then do the @@ -1803,7 +1803,7 @@ lim_populate_peer_rate_set(tpAniSirGlobal pMac, psessionEntry->supported_nss_1x1); } lim_populate_vht_mcs_set(pMac, pRates, pVHTCaps, - psessionEntry, psessionEntry->vdev_nss); + psessionEntry, psessionEntry->nss); return eSIR_SUCCESS; } /*** lim_populate_peer_rate_set() ***/ @@ -2009,7 +2009,7 @@ tSirRetStatus lim_populate_matching_rate_set(tpAniSirGlobal mac_ctx, return eSIR_FAILURE; } - if (session_entry->vdev_nss == NSS_1x1_MODE) + if (session_entry->nss == NSS_1x1_MODE) mcs_set[1] = 0; for (i = 0; i < val; i++) @@ -2025,7 +2025,7 @@ tSirRetStatus lim_populate_matching_rate_set(tpAniSirGlobal mac_ctx, } } lim_populate_vht_mcs_set(mac_ctx, &sta_ds->supportedRates, vht_caps, - session_entry, session_entry->vdev_nss); + session_entry, session_entry->nss); /* * Set the erpEnabled bit if the phy is in G mode and at least * one A rate is supported diff --git a/core/mac/src/pe/lim/lim_process_assoc_req_frame.c b/core/mac/src/pe/lim/lim_process_assoc_req_frame.c index 3df3481d79e5..2aebb6f39e4c 100644 --- a/core/mac/src/pe/lim/lim_process_assoc_req_frame.c +++ b/core/mac/src/pe/lim/lim_process_assoc_req_frame.c @@ -165,14 +165,18 @@ void lim_check_sta_in_pe_entries(tpAniSirGlobal mac_ctx, tpSirMacMgmtHdr hdr) #endif ) { lim_log(mac_ctx, LOGE, - FL("Sending Deauth and Deleting existing STA entry: " + FL("Sending Disassoc and Deleting existing STA entry: " MAC_ADDRESS_STR), MAC_ADDR_ARRAY(session->selfMacAddr)); - lim_send_deauth_mgmt_frame(mac_ctx, + lim_send_disassoc_mgmt_frame(mac_ctx, eSIR_MAC_UNSPEC_FAILURE_REASON, (uint8_t *) hdr->sa, session, false); - lim_trigger_sta_deletion(mac_ctx, sta_ds, - session); + /* + * Cleanup Rx path posts eWNI_SME_DISASSOC_RSP + * msg to SME after delete sta which will update + * the userspace with disconnect + */ + lim_cleanup_rx_path(mac_ctx, sta_ds, session); break; } } diff --git a/core/mac/src/pe/lim/lim_process_tdls.c b/core/mac/src/pe/lim/lim_process_tdls.c index ed5420a4ff1e..6759eb6a939c 100644 --- a/core/mac/src/pe/lim/lim_process_tdls.c +++ b/core/mac/src/pe/lim/lim_process_tdls.c @@ -2388,9 +2388,15 @@ static void lim_tdls_update_hash_node_info(tpAniSirGlobal pMac, * width of the BSS to which the TDLS peer STAs are * associated. */ - pStaDs->vhtSupportedChannelWidthSet = psessionEntry->ch_width; + if (psessionEntry->ch_width) + pStaDs->vhtSupportedChannelWidthSet = + psessionEntry->ch_width - 1; + else + pStaDs->vhtSupportedChannelWidthSet = + psessionEntry->ch_width; + lim_log(pMac, LOG1, FL("vhtSupportedChannelWidthSet = %hu, htSupportedChannelWidthSet %hu"), - pStaDs->htSupportedChannelWidthSet, + pStaDs->vhtSupportedChannelWidthSet, pStaDs->htSupportedChannelWidthSet); pStaDs->vhtLdpcCapable = pVhtCaps->ldpcCodingCap; diff --git a/core/mac/src/sys/legacy/src/system/src/mac_init_api.c b/core/mac/src/sys/legacy/src/system/src/mac_init_api.c index 387685742f88..5e86c7e1f02e 100644 --- a/core/mac/src/sys/legacy/src/system/src/mac_init_api.c +++ b/core/mac/src/sys/legacy/src/system/src/mac_init_api.c @@ -104,7 +104,7 @@ tSirRetStatus mac_stop(tHalHandle hHal, tHalStopType stopType) -------------------------------------------------------------*/ tSirRetStatus mac_open(tHalHandle *pHalHandle, tHddHandle hHdd, - tMacOpenParameters *pMacOpenParms) + struct cds_config_info *cds_cfg) { tpAniSirGlobal p_mac = NULL; tSirRetStatus status = eSIR_SUCCESS; @@ -155,7 +155,7 @@ tSirRetStatus mac_open(tHalHandle *pHalHandle, tHddHandle hHdd, p_mac->mgmtSeqNum = WLAN_HOST_SEQ_NUM_MIN - 1; p_mac->first_scan_done = false; - status = pe_open(p_mac, pMacOpenParms); + status = pe_open(p_mac, cds_cfg); if (eSIR_SUCCESS != status) { sys_log(p_mac, LOGE, FL("mac_open failure\n")); qdf_mem_free(p_mac); diff --git a/core/mac/src/sys/legacy/src/utils/src/parser_api.c b/core/mac/src/sys/legacy/src/utils/src/parser_api.c index 3bbb6dc88bfd..7a41f49692db 100644 --- a/core/mac/src/sys/legacy/src/utils/src/parser_api.c +++ b/core/mac/src/sys/legacy/src/utils/src/parser_api.c @@ -767,7 +767,7 @@ populate_dot11f_ht_caps(tpAniSirGlobal pMac, } } } - if (psessionEntry->vdev_nss == NSS_1x1_MODE) + if (psessionEntry->nss == NSS_1x1_MODE) pDot11f->supportedMCSSet[1] = 0; } @@ -1116,7 +1116,7 @@ populate_dot11f_vht_caps(tpAniSirGlobal pMac, pDot11f->rxMCSMap |= DISABLE_NSS2_MCS; } } - if (psessionEntry->vdev_nss == NSS_1x1_MODE) { + if (psessionEntry->nss == NSS_1x1_MODE) { pDot11f->txMCSMap |= DISABLE_NSS2_MCS; pDot11f->rxMCSMap |= DISABLE_NSS2_MCS; pDot11f->txSupDataRate = diff --git a/core/sme/inc/csr_api.h b/core/sme/inc/csr_api.h index 266e5a0337bf..2c22a81ea407 100644 --- a/core/sme/inc/csr_api.h +++ b/core/sme/inc/csr_api.h @@ -1570,7 +1570,8 @@ typedef void *tScanResultHandle; typedef enum { REASSOC = 0, - FASTREASSOC = 1 + FASTREASSOC = 1, + CONNECT_CMD_USERSPACE = 2, } handoff_src; typedef struct tagCsrHandoffRequest { diff --git a/core/sme/inc/csr_internal.h b/core/sme/inc/csr_internal.h index 8c3a658bebef..9fff2c3dc61e 100644 --- a/core/sme/inc/csr_internal.h +++ b/core/sme/inc/csr_internal.h @@ -1422,4 +1422,9 @@ enum tQDF_ADAPTER_MODE csr_get_session_persona(tpAniSirGlobal pmac, void csr_roam_substate_change(tpAniSirGlobal pMac, eCsrRoamSubState NewSubstate, uint32_t sessionId); +void csr_neighbor_roam_process_scan_results(tpAniSirGlobal mac_ctx, + uint8_t sessionid, tScanResultHandle *scan_results_list); + +void csr_neighbor_roam_trigger_handoff(tpAniSirGlobal mac_ctx, + uint8_t session_id); #endif diff --git a/core/sme/inc/nan_api.h b/core/sme/inc/nan_api.h index 1c0722b2ae94..6552df8aa63e 100644 --- a/core/sme/inc/nan_api.h +++ b/core/sme/inc/nan_api.h @@ -45,6 +45,7 @@ typedef struct sNanRequestReq { typedef void (*NanCallback)(void *, tSirNanEvent *); void sme_nan_register_callback(tHalHandle hHal, NanCallback callback); +void sme_nan_deregister_callback(tHalHandle hHal); QDF_STATUS sme_nan_request(tpNanRequestReq input); #endif /* __NAN_API_H__ */ diff --git a/core/sme/inc/sme_api.h b/core/sme/inc/sme_api.h index 015d1ca1f940..f24d6ec88ad8 100644 --- a/core/sme/inc/sme_api.h +++ b/core/sme/inc/sme_api.h @@ -365,15 +365,23 @@ extern QDF_STATUS sme_set_host_power_save(tHalHandle hHal, bool psMode); void sme_set_dhcp_till_power_active_flag(tHalHandle hHal, uint8_t flag); extern QDF_STATUS sme_register11d_scan_done_callback(tHalHandle hHal, csr_scan_completeCallback); +void sme_deregister11d_scan_done_callback(tHalHandle hHal); + #ifdef FEATURE_OEM_DATA_SUPPORT extern QDF_STATUS sme_register_oem_data_rsp_callback(tHalHandle h_hal, sme_send_oem_data_rsp_msg callback); +void sme_deregister_oem_data_rsp_callback(tHalHandle h_hal); + #else static inline QDF_STATUS sme_register_oem_data_rsp_callback(tHalHandle h_hal, sme_send_oem_data_rsp_msg callback) { return QDF_STATUS_SUCCESS; } +static inline void sme_deregister_oem_data_rsp_callback(tHalHandle h_hal) +{ +} + #endif extern QDF_STATUS sme_wow_add_pattern(tHalHandle hHal, @@ -812,6 +820,7 @@ typedef struct sStatsExtRequestReq { typedef void (*StatsExtCallback)(void *, tStatsExtEvent *); void sme_stats_ext_register_callback(tHalHandle hHal, StatsExtCallback callback); +void sme_stats_ext_deregister_callback(tHalHandle hhal); QDF_STATUS sme_stats_ext_request(uint8_t session_id, tpStatsExtRequestReq input); QDF_STATUS sme_stats_ext_event(tHalHandle hHal, void *pMsg); @@ -878,6 +887,7 @@ QDF_STATUS sme_ll_stats_get_req(tHalHandle hHal, QDF_STATUS sme_set_link_layer_stats_ind_cb(tHalHandle hHal, void (*callbackRoutine)(void *callbackCtx, int indType, void *pRsp)); +QDF_STATUS sme_reset_link_layer_stats_ind_cb(tHalHandle hhal); #endif /* WLAN_FEATURE_LINK_LAYER_STATS */ QDF_STATUS sme_fw_mem_dump(tHalHandle hHal, void *recvd_req); @@ -973,6 +983,7 @@ QDF_STATUS sme_set_rssi_monitoring(tHalHandle hal, struct rssi_monitor_req *input); QDF_STATUS sme_set_rssi_threshold_breached_cb(tHalHandle hal, void (*cb)(void *, struct rssi_breach_event *)); +QDF_STATUS sme_reset_rssi_threshold_breached_cb(tHalHandle hal); QDF_STATUS sme_register_mgmt_frame_ind_callback(tHalHandle hal, sir_mgmt_frame_ind_callback callback); @@ -1050,6 +1061,8 @@ QDF_STATUS sme_dcc_update_ndl(tHalHandle hHal, void *context, QDF_STATUS sme_register_for_dcc_stats_event(tHalHandle hHal, void *context, ocb_callback callback); +QDF_STATUS sme_deregister_for_dcc_stats_event(tHalHandle hHal); + void sme_add_set_thermal_level_callback(tHalHandle hal, sme_set_thermal_level_callback callback); @@ -1096,13 +1109,22 @@ QDF_STATUS sme_ht40_stop_obss_scan(tHalHandle hHal, uint32_t vdev_id); QDF_STATUS sme_set_tsfcb(tHalHandle hHal, int (*cb_fn)(void *cb_ctx, struct stsf *ptsf), void *cb_ctx); +QDF_STATUS sme_reset_tsfcb(tHalHandle h_hal); + #ifdef WLAN_FEATURE_TSF QDF_STATUS sme_set_tsf_gpio(tHalHandle h_hal, uint32_t pinvalue); +QDF_STATUS sme_reset_tsf_gpio(tHalHandle h_hal); + #else static inline QDF_STATUS sme_set_tsf_gpio(tHalHandle h_hal, uint32_t pinvalue) { return QDF_STATUS_E_FAILURE; } +static inline QDF_STATUS sme_reset_tsf_gpio(tHalHandle h_hal) +{ + return QDF_STATUS_E_FAILURE; +} + #endif QDF_STATUS sme_update_mimo_power_save(tHalHandle hHal, @@ -1117,6 +1139,7 @@ QDF_STATUS sme_remove_beacon_filter(tHalHandle hal, uint32_t session_id); QDF_STATUS sme_bpf_offload_register_callback(tHalHandle hal, void (*pbpf_get_offload_cb)(void *, struct sir_bpf_get_offload *)); +QDF_STATUS sme_bpf_offload_deregister_callback(tHalHandle hal); QDF_STATUS sme_get_bpf_offload_capabilities(tHalHandle hal); QDF_STATUS sme_set_bpf_instructions(tHalHandle hal, diff --git a/core/sme/src/common/sme_api.c b/core/sme/src/common/sme_api.c index 3674fb1f62de..aa646355c871 100644 --- a/core/sme/src/common/sme_api.c +++ b/core/sme/src/common/sme_api.c @@ -4728,6 +4728,29 @@ QDF_STATUS sme_register11d_scan_done_callback(tHalHandle hHal, return status; } +/** + * sme_deregister11d_scan_done_callback() - De-register scandone callback + * @h_hal: Handler return by mac_open + * + * This function De-registers the scandone callback to SME + * + * Return: None + */ +void sme_deregister11d_scan_done_callback(tHalHandle h_hal) +{ + tpAniSirGlobal pmac; + + if (!h_hal) { + QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_ERROR, + FL("hHal is not valid")); + return; + } + + pmac = PMAC_STRUCT(h_hal); + pmac->scan.callback11dScanDone = NULL; +} + + #ifdef FEATURE_OEM_DATA_SUPPORT /** * sme_register_oem_data_rsp_callback() - Register a routine of @@ -4752,6 +4775,27 @@ QDF_STATUS sme_register_oem_data_rsp_callback(tHalHandle h_hal, return status; } + +/** + * sme_deregister_oem_data_rsp_callback() - De-register OEM datarsp callback + * @h_hal: Handler return by mac_open + * This function De-registers the OEM data response callback to SME + * + * Return: None + */ +void sme_deregister_oem_data_rsp_callback(tHalHandle h_hal) +{ + tpAniSirGlobal pmac; + + if (!h_hal) { + QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_ERROR, + FL("hHal is not valid")); + return; + } + pmac = PMAC_STRUCT(h_hal); + + pmac->oemData.oem_data_rsp_callback = NULL; +} #endif /** @@ -7330,7 +7374,7 @@ QDF_STATUS sme_preferred_network_found_ind(tHalHandle hHal, void *pMsg) #endif /* FEATURE_WLAN_SCAN_PNO */ -/* +/** * sme_set_tsfcb() - Set callback for TSF capture * @h_hal: Handler return by mac_open * @cb_fn: Callback function pointer @@ -7353,6 +7397,35 @@ QDF_STATUS sme_set_tsfcb(tHalHandle h_hal, return status; } +/** + * sme_reset_tsfcb() - Reset callback for TSF capture + * @h_hal: Handler return by mac_open + * + * This function reset the tsf capture callback to SME + * + * Return: QDF_STATUS + */ +QDF_STATUS sme_reset_tsfcb(tHalHandle h_hal) +{ + tpAniSirGlobal mac; + QDF_STATUS status; + + if (!h_hal) { + QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_ERROR, + FL("h_hal is not valid")); + return QDF_STATUS_E_INVAL; + } + mac = PMAC_STRUCT(h_hal); + + status = sme_acquire_global_lock(&mac->sme); + if (QDF_IS_STATUS_SUCCESS(status)) { + mac->sme.get_tsf_cb = NULL; + mac->sme.get_tsf_cxt = NULL; + sme_release_global_lock(&mac->sme); + } + return status; +} + #ifdef WLAN_FEATURE_TSF /* * sme_set_tsf_gpio() - set gpio pin that be toggled when capture tef @@ -11420,6 +11493,40 @@ QDF_STATUS sme_register_for_dcc_stats_event(tHalHandle hHal, void *context, return 0; } +/** + * sme_deregister_for_dcc_stats_event() - De-Register for the periodic DCC stats + * event + * @h_hal: Hal Handle + * + * This function de-registers the DCC perioc stats callback + * + * Return: QDF_STATUS Enumeration + */ +QDF_STATUS sme_deregister_for_dcc_stats_event(tHalHandle h_hal) +{ + tpAniSirGlobal mac; + QDF_STATUS status; + + if (!h_hal) { + QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_ERROR, + FL("h_hal is not valid")); + return QDF_STATUS_E_INVAL; + } + mac = PMAC_STRUCT(h_hal); + + status = sme_acquire_global_lock(&mac->sme); + if (!QDF_IS_STATUS_SUCCESS(status)) { + QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_ERROR, + FL("Failed to acquire global lock")); + return status; + } + mac->sme.dcc_stats_event_callback = NULL; + mac->sme.dcc_stats_event_context = NULL; + sme_release_global_lock(&mac->sme); + + return status; +} + void sme_get_recovery_stats(tHalHandle hHal) { uint8_t i; @@ -12513,6 +12620,30 @@ void sme_stats_ext_register_callback(tHalHandle hHal, StatsExtCallback callback) pMac->sme.StatsExtCallback = callback; } +/** + * sme_stats_ext_deregister_callback() - De-register ext stats callback + * @h_hal: Hal Handle + * + * This function is called to de initialize the HDD NAN feature. Currently + * the only operation required is to de-register a callback with SME. + * + * Return: None + */ +void sme_stats_ext_deregister_callback(tHalHandle h_hal) +{ + tpAniSirGlobal pmac; + + if (!h_hal) { + QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_ERROR, + FL("hHal is not valid")); + return; + } + + pmac = PMAC_STRUCT(h_hal); + pmac->sme.StatsExtCallback = NULL; +} + + /****************************************************************************** \fn sme_stats_ext_request @@ -13683,6 +13814,41 @@ QDF_STATUS sme_set_link_layer_stats_ind_cb return status; } +/** + * sme_reset_link_layer_stats_ind_cb() - SME API to reset link layer stats + * indication + * @h_hal: Hal Handle + * + * This function reset's the link layer stats indication + * + * Return: QDF_STATUS Enumeration + */ + +QDF_STATUS sme_reset_link_layer_stats_ind_cb(tHalHandle h_hal) +{ + QDF_STATUS status; + tpAniSirGlobal pmac; + + if (!h_hal) { + QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_ERROR, + FL("hHal is not valid")); + return QDF_STATUS_E_INVAL; + } + pmac = PMAC_STRUCT(h_hal); + + status = sme_acquire_global_lock(&pmac->sme); + if (QDF_IS_STATUS_SUCCESS(status)) { + pmac->sme.pLinkLayerStatsIndCallback = NULL; + sme_release_global_lock(&pmac->sme); + } else { + QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_ERROR, "%s: sme_acquire_global_lock error", + __func__); + } + + return status; +} + + #endif /* WLAN_FEATURE_LINK_LAYER_STATS */ /** @@ -14530,17 +14696,50 @@ void sme_update_user_configured_nss(tHalHandle hal, uint8_t nss) /** * sme_set_rssi_threshold_breached_cb() - set rssi threshold breached callback - * @hal: global hal handle + * @h_hal: global hal handle * @cb: callback function pointer * * This function stores the rssi threshold breached callback function. * * Return: QDF_STATUS enumeration. */ -QDF_STATUS sme_set_rssi_threshold_breached_cb(tHalHandle hal, +QDF_STATUS sme_set_rssi_threshold_breached_cb(tHalHandle h_hal, void (*cb)(void *, struct rssi_breach_event *)) { QDF_STATUS status = QDF_STATUS_SUCCESS; + tpAniSirGlobal mac; + + if (!h_hal) { + QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_ERROR, + FL("hHal is not valid")); + return QDF_STATUS_E_INVAL; + } + mac = PMAC_STRUCT(h_hal); + + status = sme_acquire_global_lock(&mac->sme); + if (!QDF_IS_STATUS_SUCCESS(status)) { + QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_ERROR, + FL("sme_acquire_global_lock failed!(status=%d)"), + status); + return status; + } + + mac->sme.rssi_threshold_breached_cb = cb; + sme_release_global_lock(&mac->sme); + return status; +} + +/** + * sme_set_rssi_threshold_breached_cb() - Reset rssi threshold breached callback + * @hal: global hal handle + * + * This function de-registers the rssi threshold breached callback function. + * + * Return: QDF_STATUS enumeration. + */ +QDF_STATUS sme_reset_rssi_threshold_breached_cb(tHalHandle hal) +{ + QDF_STATUS status; tpAniSirGlobal mac = PMAC_STRUCT(hal); status = sme_acquire_global_lock(&mac->sme); @@ -14551,7 +14750,7 @@ QDF_STATUS sme_set_rssi_threshold_breached_cb(tHalHandle hal, return status; } - mac->sme.rssi_threshold_breached_cb = cb; + mac->sme.rssi_threshold_breached_cb = NULL; sme_release_global_lock(&mac->sme); return status; } @@ -15627,6 +15826,41 @@ uint32_t sme_get_wni_dot11_mode(tHalHandle hal) } /** + * sme_bpf_offload_deregister_callback() - Register get bpf offload callbacK + * + * @h_hal - MAC global handle + * @callback_routine - callback routine from HDD + * + * This API is invoked by HDD to de-register its callback in SME + * + * Return: QDF_STATUS Enumeration + */ +QDF_STATUS sme_bpf_offload_deregister_callback(tHalHandle h_hal) +{ + QDF_STATUS status = QDF_STATUS_SUCCESS; + tpAniSirGlobal mac; + + if (!h_hal) { + QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_ERROR, + FL("hHal is not valid")); + return QDF_STATUS_E_INVAL; + } + + mac = PMAC_STRUCT(h_hal); + + status = sme_acquire_global_lock(&mac->sme); + if (QDF_IS_STATUS_SUCCESS(status)) { + mac->sme.pbpf_get_offload_cb = NULL; + sme_release_global_lock(&mac->sme); + } else { + QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_ERROR, + FL("sme_acquire_global_lock failed")); + } + return status; +} + + +/** * sme_create_mon_session() - post message to create PE session for monitormode * operation * @hal_handle: Handle to the HAL diff --git a/core/sme/src/csr/csr_api_roam.c b/core/sme/src/csr/csr_api_roam.c index 6b1628ca7572..02d4a7b44c9b 100644 --- a/core/sme/src/csr/csr_api_roam.c +++ b/core/sme/src/csr/csr_api_roam.c @@ -5073,32 +5073,33 @@ static void csr_roam_join_handle_profile(tpAniSirGlobal mac_ctx, else ies_local = scan_result->Result.pvIes; - if (scan_result && !ies_local && result && - (!QDF_IS_STATUS_SUCCESS( + if (!result) { + sms_log(mac_ctx, LOGE, FL(" cannot parse IEs")); + *roam_state = eCsrStopRoaming; + return; + } else if (scan_result && !ies_local && + (!QDF_IS_STATUS_SUCCESS( csr_get_parsed_bss_description_ies( - mac_ctx, - &result->BssDescriptor, + mac_ctx, &result->BssDescriptor, &ies_local)))) { sms_log(mac_ctx, LOGE, FL(" cannot parse IEs")); *roam_state = eCsrStopRoaming; return; } - if (result) - roam_info_ptr->pBssDesc = &result->BssDescriptor; + roam_info_ptr->pBssDesc = &result->BssDescriptor; cmd->u.roamCmd.pLastRoamBss = roam_info_ptr->pBssDesc; /* dont put uapsd_mask if BSS doesn't support uAPSD */ if (scan_result && cmd->u.roamCmd.roamProfile.uapsd_mask && CSR_IS_QOS_BSS(ies_local) && CSR_IS_UAPSD_BSS(ies_local)) { #ifndef WLAN_MDM_CODE_REDUCTION_OPT - if (result) - acm_mask = sme_qos_get_acm_mask(mac_ctx, + acm_mask = sme_qos_get_acm_mask(mac_ctx, &result->BssDescriptor, ies_local); #endif /* WLAN_MDM_CODE_REDUCTION_OPT */ } else { cmd->u.roamCmd.roamProfile.uapsd_mask = 0; } - if (ies_local && result && !result->pvIes) + if (ies_local && !result->pvIes) qdf_mem_free(ies_local); roam_info_ptr->pProfile = profile; session->bRefAssocStartCnt++; diff --git a/core/sme/src/csr/csr_host_scan_roam.c b/core/sme/src/csr/csr_host_scan_roam.c index 4e8db71aecc4..9f56f7c303fe 100644 --- a/core/sme/src/csr/csr_host_scan_roam.c +++ b/core/sme/src/csr/csr_host_scan_roam.c @@ -142,10 +142,8 @@ QDF_STATUS csr_roam_issue_reassociate_cmd(tpAniSirGlobal pMac, * Return: void */ -static void -csr_neighbor_roam_process_scan_results(tpAniSirGlobal mac_ctx, - uint8_t sessionid, - tScanResultHandle *scan_results_list) +void csr_neighbor_roam_process_scan_results(tpAniSirGlobal mac_ctx, + uint8_t sessionid, tScanResultHandle *scan_results_list) { tCsrScanResultInfo *scan_result; tpCsrNeighborRoamControlInfo n_roam_info = @@ -356,8 +354,8 @@ csr_neighbor_roam_process_scan_results(tpAniSirGlobal mac_ctx, * * Return: None */ -static void csr_neighbor_roam_trigger_handoff(tpAniSirGlobal mac_ctx, - uint8_t session_id) +void csr_neighbor_roam_trigger_handoff(tpAniSirGlobal mac_ctx, + uint8_t session_id) { if (csr_roam_is_fast_roam_enabled(mac_ctx, session_id)) csr_neighbor_roam_issue_preauth_req(mac_ctx, session_id); diff --git a/core/sme/src/csr/csr_neighbor_roam.c b/core/sme/src/csr/csr_neighbor_roam.c index 64914e4577d5..4884cfd2cc4b 100644 --- a/core/sme/src/csr/csr_neighbor_roam.c +++ b/core/sme/src/csr/csr_neighbor_roam.c @@ -371,6 +371,8 @@ csr_neighbor_roam_prepare_scan_profile_filter(tpAniSirGlobal pMac, pScanFilter->scan_filter_for_roam = 1; /* only for HDD requested handoff fill in the BSSID in the filter */ if (nbr_roam_info->uOsRequestedHandoff) { + QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_DEBUG, + FL("OS Requested Handoff")); pScanFilter->BSSIDs.numOfBSSIDs = 1; pScanFilter->BSSIDs.bssid = qdf_mem_malloc(sizeof(tSirMacAddr) * @@ -1494,6 +1496,10 @@ QDF_STATUS csr_neighbor_roam_process_handoff_req( tCsrRoamProfile *profile = NULL; tCsrRoamSession *session = CSR_GET_SESSION(mac_ctx, session_id); uint8_t i = 0; + uint8_t roam_now = 0; + uint8_t roamable_ap_count = 0; + tCsrScanResultFilter scan_filter; + tScanResultHandle scan_result; if (NULL == session) { sms_log(mac_ctx, LOGE, FL("session is NULL ")); @@ -1553,11 +1559,36 @@ QDF_STATUS csr_neighbor_roam_process_handoff_req( profile->ChannelInfo.ChannelList[0] = roam_ctrl_info->handoffReqInfo.channel; - /* do a SSID scan */ - status = - csr_scan_for_ssid(mac_ctx, session_id, profile, roam_id, false); - if (!QDF_IS_STATUS_SUCCESS(status)) { - sms_log(mac_ctx, LOGE, FL("SSID scan failed")); + /* + * For User space connect requests, the scan has already been done. + * So, check if the BSS descriptor exists in the scan cache and + * proceed with the handoff instead of a redundant scan again. + */ + if (roam_ctrl_info->handoffReqInfo.src == CONNECT_CMD_USERSPACE) { + sms_log(mac_ctx, LOG1, + FL("Connect cmd with bssid within same ESS")); + status = csr_neighbor_roam_prepare_scan_profile_filter(mac_ctx, + &scan_filter, + session_id); + sms_log(mac_ctx, LOG1, FL("Filter creation status = %d"), + status); + status = csr_scan_get_result(mac_ctx, &scan_filter, + &scan_result); + csr_neighbor_roam_process_scan_results(mac_ctx, session_id, + &scan_result); + roamable_ap_count = csr_ll_count( + &roam_ctrl_info->roamableAPList); + csr_free_scan_filter(mac_ctx, &scan_filter); + sms_log(mac_ctx, LOG1, FL("roam_now=%d, roamable_ap_count=%d"), + roam_now, roamable_ap_count); + } + if (roam_now && roamable_ap_count) { + csr_neighbor_roam_trigger_handoff(mac_ctx, session_id); + } else { + status = csr_scan_for_ssid(mac_ctx, session_id, profile, + roam_id, false); + if (status != QDF_STATUS_SUCCESS) + sms_log(mac_ctx, LOGE, FL("SSID scan failed")); } end: diff --git a/core/sme/src/nan/nan_api.c b/core/sme/src/nan/nan_api.c index 5398ffa3398c..83d7fe64b103 100644 --- a/core/sme/src/nan/nan_api.c +++ b/core/sme/src/nan/nan_api.c @@ -59,6 +59,28 @@ void sme_nan_register_callback(tHalHandle hHal, NanCallback callback) pMac->sme.nanCallback = callback; } +/** + * sme_nan_deregister_callback() - NAN De-register cb function + * @h_hal: Hal handle + * + * De-register nan rsp callback with sme layer. + * + * Return: void + */ +void sme_nan_deregister_callback(tHalHandle h_hal) +{ + tpAniSirGlobal pmac; + + if (!h_hal) { + QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_ERROR, + FL("hHal is not valid")); + return; + } + pmac = PMAC_STRUCT(h_hal); + pmac->sme.nanCallback = NULL; +} + + /****************************************************************************** * Function: sme_nan_request * diff --git a/core/wma/inc/wma_types.h b/core/wma/inc/wma_types.h index d5ababa095fd..5c2c0c63df65 100644 --- a/core/wma/inc/wma_types.h +++ b/core/wma/inc/wma_types.h @@ -701,7 +701,7 @@ QDF_STATUS wma_tx_packet(void *pWMA, QDF_STATUS wma_open(void *p_cds_context, wma_tgt_cfg_cb pTgtUpdCB, wma_dfs_radar_indication_cb radar_ind_cb, - tMacOpenParameters *pMacParams); + struct cds_config_info *cds_cfg); typedef QDF_STATUS (*wma_mgmt_frame_rx_callback)(void *p_cds_gctx, void *cds_buff); diff --git a/core/wma/src/wma_features.c b/core/wma/src/wma_features.c index 0b75cf602965..e566ce46095f 100644 --- a/core/wma/src/wma_features.c +++ b/core/wma/src/wma_features.c @@ -6624,7 +6624,7 @@ int wma_update_tdls_peer_state(WMA_HANDLE handle, ol_txrx_peer_handle peer; uint8_t *peer_mac_addr; int ret = 0; - uint32_t *ch_mhz; + uint32_t *ch_mhz = NULL; bool restore_last_peer = false; if (!wma_handle || !wma_handle->wmi_handle) { @@ -6639,12 +6639,14 @@ int wma_update_tdls_peer_state(WMA_HANDLE handle, sizeof(tTdlsPeerCapParams)); } - ch_mhz = qdf_mem_malloc(sizeof(uint32_t) * - peerStateParams->peerCap.peerChanLen); - if (ch_mhz == NULL) { - WMA_LOGE("%s: memory allocation failed", __func__); - ret = -ENOMEM; - goto end_tdls_peer_state; + if (peerStateParams->peerCap.peerChanLen) { + ch_mhz = qdf_mem_malloc(sizeof(uint32_t) * + peerStateParams->peerCap.peerChanLen); + if (ch_mhz == NULL) { + WMA_LOGE("%s: memory allocation failed", __func__); + ret = -ENOMEM; + goto end_tdls_peer_state; + } } for (i = 0; i < peerStateParams->peerCap.peerChanLen; ++i) { @@ -6658,12 +6660,10 @@ int wma_update_tdls_peer_state(WMA_HANDLE handle, ch_mhz)) { WMA_LOGE("%s: failed to send tdls peer update state command", __func__); - qdf_mem_free(ch_mhz); ret = -EIO; goto end_tdls_peer_state; } - qdf_mem_free(ch_mhz); /* in case of teardown, remove peer from fw */ if (WMA_TDLS_PEER_STATE_TEARDOWN == peerStateParams->peerState) { pdev = cds_get_context(QDF_MODULE_ID_TXRX); @@ -6696,6 +6696,8 @@ int wma_update_tdls_peer_state(WMA_HANDLE handle, } end_tdls_peer_state: + if (ch_mhz) + qdf_mem_free(ch_mhz); if (peerStateParams) qdf_mem_free(peerStateParams); return ret; diff --git a/core/wma/src/wma_main.c b/core/wma/src/wma_main.c index 95d86df2c2af..191c760afc24 100644 --- a/core/wma/src/wma_main.c +++ b/core/wma/src/wma_main.c @@ -1575,23 +1575,23 @@ int wma_process_fw_event_handler(void *ctx, void *ev, uint8_t rx_ctx) /** * ol_cfg_set_flow_control_parameters() - set flow control parameters * @olCfg: cfg parameters - * @mac_params: mac parameters + * @cds_cfg: CDS Configuration * * Return: none */ static void ol_cfg_set_flow_control_parameters(struct txrx_pdev_cfg_param_t *olCfg, - tMacOpenParameters *mac_params) + struct cds_config_info *cds_cfg) { olCfg->tx_flow_start_queue_offset = - mac_params->tx_flow_start_queue_offset; + cds_cfg->tx_flow_start_queue_offset; olCfg->tx_flow_stop_queue_th = - mac_params->tx_flow_stop_queue_th; + cds_cfg->tx_flow_stop_queue_th; } #else static void ol_cfg_set_flow_control_parameters(struct txrx_pdev_cfg_param_t *olCfg, - tMacOpenParameters *mac_params) + struct cds_config_info *cds_cfg) { return; } @@ -1601,18 +1601,18 @@ void ol_cfg_set_flow_control_parameters(struct txrx_pdev_cfg_param_t *olCfg, /** * wma_set_nan_enable() - set nan enable flag in WMA handle * @wma_handle: Pointer to wma handle - * @mac_param: Pointer to mac_param + * @cds_cfg: Pointer to CDS Configuration * * Return: none */ static void wma_set_nan_enable(tp_wma_handle wma_handle, - tMacOpenParameters *mac_param) + struct cds_config_info *cds_cfg) { - wma_handle->is_nan_enabled = mac_param->is_nan_enabled; + wma_handle->is_nan_enabled = cds_cfg->is_nan_enabled; } #else static void wma_set_nan_enable(tp_wma_handle wma_handle, - tMacOpenParameters *mac_param) + struct cds_config_info *cds_cfg) { } #endif @@ -1642,14 +1642,14 @@ static void wma_init_max_no_of_peers(tp_wma_handle wma_handle, * @cds_context: cds context * @wma_tgt_cfg_cb: tgt config callback fun * @radar_ind_cb: dfs radar indication callback - * @mac_params: mac parameters + * @cds_cfg: mac parameters * * Return: 0 on success, errno on failure */ QDF_STATUS wma_open(void *cds_context, wma_tgt_cfg_cb tgt_cfg_cb, wma_dfs_radar_indication_cb radar_ind_cb, - tMacOpenParameters *mac_params) + struct cds_config_info *cds_cfg) { tp_wma_handle wma_handle; HTC_HANDLE htc_handle; @@ -1724,30 +1724,30 @@ QDF_STATUS wma_open(void *cds_context, wma_handle->htc_handle = htc_handle; wma_handle->cds_context = cds_context; wma_handle->qdf_dev = qdf_dev; - wma_handle->max_scan = mac_params->max_scan; + wma_handle->max_scan = cds_cfg->max_scan; wma_handle->wma_runtime_resume_lock = qdf_runtime_lock_init("wma_runtime_resume"); /* Initialize max_no_of_peers for wma_get_number_of_peers_supported() */ - wma_init_max_no_of_peers(wma_handle, mac_params->maxStation); + wma_init_max_no_of_peers(wma_handle, cds_cfg->max_station); /* Cap maxStation based on the target version */ - mac_params->maxStation = wma_get_number_of_peers_supported(wma_handle); + cds_cfg->max_station = wma_get_number_of_peers_supported(wma_handle); /* Reinitialize max_no_of_peers based on the capped maxStation value */ - wma_init_max_no_of_peers(wma_handle, mac_params->maxStation); + wma_init_max_no_of_peers(wma_handle, cds_cfg->max_station); /* initialize default target config */ wma_set_default_tgt_config(wma_handle); - olCfg.is_uc_offload_enabled = mac_params->ucOffloadEnabled; - olCfg.uc_tx_buffer_count = mac_params->ucTxBufCount; - olCfg.uc_tx_buffer_size = mac_params->ucTxBufSize; - olCfg.uc_rx_indication_ring_count = mac_params->ucRxIndRingCount; - olCfg.uc_tx_partition_base = mac_params->ucTxPartitionBase; + olCfg.is_uc_offload_enabled = cds_cfg->uc_offload_enabled; + olCfg.uc_tx_buffer_count = cds_cfg->uc_txbuf_count; + olCfg.uc_tx_buffer_size = cds_cfg->uc_txbuf_size; + olCfg.uc_rx_indication_ring_count = cds_cfg->uc_rxind_ringcount; + olCfg.uc_tx_partition_base = cds_cfg->uc_tx_partition_base; - wma_handle->tx_chain_mask_cck = mac_params->tx_chain_mask_cck; - wma_handle->self_gen_frm_pwr = mac_params->self_gen_frm_pwr; + wma_handle->tx_chain_mask_cck = cds_cfg->tx_chain_mask_cck; + wma_handle->self_gen_frm_pwr = cds_cfg->self_gen_frm_pwr; /* Allocate cfg handle */ @@ -1756,16 +1756,16 @@ QDF_STATUS wma_open(void *cds_context, * HL also sdould be enabled, schedule TBD */ #ifdef WLAN_FEATURE_RX_FULL_REORDER_OL - olCfg.is_full_reorder_offload = mac_params->reorderOffload; + olCfg.is_full_reorder_offload = cds_cfg->reorder_offload; #else olCfg.is_full_reorder_offload = 0; #endif /* WLAN_FEATURE_RX_FULL_REORDER_OL */ - olCfg.enable_rxthread = mac_params->enable_rxthread; + olCfg.enable_rxthread = cds_cfg->enable_rxthread; olCfg.ip_tcp_udp_checksum_offload = - mac_params->ip_tcp_udp_checksum_offload; - olCfg.ce_classify_enabled = mac_params->ce_classify_enabled; + cds_cfg->ip_tcp_udp_checksum_offload; + olCfg.ce_classify_enabled = cds_cfg->ce_classify_enabled; - ol_cfg_set_flow_control_parameters(&olCfg, mac_params); + ol_cfg_set_flow_control_parameters(&olCfg, cds_cfg); ((p_cds_contextType) cds_context)->cfg_ctx = ol_pdev_cfg_attach(((p_cds_contextType) cds_context)->qdf_ctx, @@ -1779,7 +1779,7 @@ QDF_STATUS wma_open(void *cds_context, /* adjust the cfg_ctx default value based on setting */ ol_set_cfg_rx_fwd_disabled((ol_pdev_handle) ((p_cds_contextType) cds_context)->cfg_ctx, - (uint8_t) mac_params->apDisableIntraBssFwd); + (uint8_t) cds_cfg->ap_disable_intrabss_fwd); /* adjust the packet log enable default value based on CFG INI setting */ ol_set_cfg_packet_log_enabled((ol_pdev_handle) @@ -1797,12 +1797,14 @@ QDF_STATUS wma_open(void *cds_context, if (cds_get_conparam() == QDF_GLOBAL_FTM_MODE) wma_utf_attach(wma_handle); #endif /* QCA_WIFI_FTM */ + wma_init_max_no_of_peers(wma_handle, cds_cfg->max_station); + cds_cfg->max_station = wma_get_number_of_peers_supported(wma_handle); - mac_params->maxBssId = WMA_MAX_SUPPORTED_BSS; - mac_params->frameTransRequired = 0; + cds_cfg->max_bssid = WMA_MAX_SUPPORTED_BSS; + cds_cfg->frame_xln_reqd = 0; wma_handle->wlan_resource_config.num_wow_filters = - mac_params->maxWoWFilters; + cds_cfg->max_wow_filters; wma_handle->wlan_resource_config.num_keep_alive_pattern = WMA_MAXNUM_PERIODIC_TX_PTRNS; @@ -1810,33 +1812,33 @@ QDF_STATUS wma_open(void *cds_context, * offload peers should be (number of vdevs + 1). */ wma_handle->wlan_resource_config.num_offload_peers = - mac_params->apMaxOffloadPeers + 1; + cds_cfg->ap_maxoffload_peers + 1; wma_handle->wlan_resource_config.num_offload_reorder_buffs = - mac_params->apMaxOffloadReorderBuffs + 1; - - wma_handle->ol_ini_info = mac_params->olIniInfo; - wma_handle->max_station = mac_params->maxStation; - wma_handle->max_bssid = mac_params->maxBssId; - wma_handle->frame_xln_reqd = mac_params->frameTransRequired; - wma_handle->driver_type = mac_params->driverType; - wma_handle->ssdp = mac_params->ssdp; - wma_handle->enable_mc_list = mac_params->enable_mc_list; + cds_cfg->ap_maxoffload_reorderbuffs + 1; + + wma_handle->ol_ini_info = cds_cfg->ol_ini_info; + wma_handle->max_station = cds_cfg->max_station; + wma_handle->max_bssid = cds_cfg->max_bssid; + wma_handle->frame_xln_reqd = cds_cfg->frame_xln_reqd; + wma_handle->driver_type = cds_cfg->driver_type; + wma_handle->ssdp = cds_cfg->ssdp; + wma_handle->enable_mc_list = cds_cfg->enable_mc_list; #ifdef FEATURE_WLAN_RA_FILTERING - wma_handle->IsRArateLimitEnabled = mac_params->IsRArateLimitEnabled; - wma_handle->RArateLimitInterval = mac_params->RArateLimitInterval; + wma_handle->IsRArateLimitEnabled = cds_cfg->is_ra_ratelimit_enabled; + wma_handle->RArateLimitInterval = cds_cfg->ra_ratelimit_interval; #endif /* FEATURE_WLAN_RA_FILTERING */ #ifdef WLAN_FEATURE_LPSS - wma_handle->is_lpass_enabled = mac_params->is_lpass_enabled; + wma_handle->is_lpass_enabled = cds_cfg->is_lpass_enabled; #endif - wma_set_nan_enable(wma_handle, mac_params); + wma_set_nan_enable(wma_handle, cds_cfg); /* * Indicates if DFS Phyerr filtering offload * is Enabled/Disabed from ini */ wma_handle->dfs_phyerr_filter_offload = - mac_params->dfsPhyerrFilterOffload; - wma_handle->dfs_pri_multiplier = mac_params->dfsRadarPriMultiplier; + cds_cfg->dfs_phyerr_filter_offload; + wma_handle->dfs_pri_multiplier = cds_cfg->dfs_pri_multiplier; wma_handle->interfaces = qdf_mem_malloc(sizeof(struct wma_txrx_node) * wma_handle->max_bssid); if (!wma_handle->interfaces) { @@ -2035,13 +2037,13 @@ QDF_STATUS wma_open(void *cds_context, * 3 - Legacy Powersave + Deepsleep Enabled * 4 - QPower + Deepsleep Enabled */ - wma_handle->powersave_mode = mac_params->powersaveOffloadEnabled; - wma_handle->staMaxLIModDtim = mac_params->staMaxLIModDtim; - wma_handle->staModDtim = mac_params->staModDtim; - wma_handle->staDynamicDtim = mac_params->staDynamicDtim; + wma_handle->powersave_mode = cds_cfg->powersave_offload_enabled; + wma_handle->staMaxLIModDtim = cds_cfg->sta_maxlimod_dtim; + wma_handle->staModDtim = cds_cfg->sta_mod_dtim; + wma_handle->staDynamicDtim = cds_cfg->sta_dynamic_dtim; /* - * Value of mac_params->wowEnable can be, + * Value of cds_cfg->wow_enable can be, * 0 - Disable both magic pattern match and pattern byte match. * 1 - Enable magic pattern match on all interfaces. * 2 - Enable pattern byte match on all interfaces. @@ -2049,9 +2051,9 @@ QDF_STATUS wma_open(void *cds_context, * all interfaces. */ wma_handle->wow.magic_ptrn_enable = - (mac_params->wowEnable & 0x01) ? true : false; + (cds_cfg->wow_enable & 0x01) ? true : false; wma_handle->ptrn_match_enable_all_vdev = - (mac_params->wowEnable & 0x02) ? true : false; + (cds_cfg->wow_enable & 0x02) ? true : false; #ifdef FEATURE_WLAN_TDLS wmi_unified_register_event_handler(wma_handle->wmi_handle, @@ -5177,6 +5179,10 @@ void wma_set_wifi_start_packet_stats(void *wma_handle, } scn = cds_get_context(QDF_MODULE_ID_HIF); + if (scn == NULL) { + WMA_LOGE("%s: Invalid HIF handle", __func__); + return; + } log_state = ATH_PKTLOG_ANI | ATH_PKTLOG_RCUPDATE | ATH_PKTLOG_RCFIND | ATH_PKTLOG_RX | ATH_PKTLOG_TX | ATH_PKTLOG_TEXT; |
