diff options
| author | Linux Build Service Account <lnxbuild@localhost> | 2016-11-04 05:55:58 -0600 |
|---|---|---|
| committer | Linux Build Service Account <lnxbuild@localhost> | 2016-11-04 05:55:58 -0600 |
| commit | ddb41d0a10880115b5274fdf63c474ce54aeb2a0 (patch) | |
| tree | ce6093b40d565f20620e8d318986fdfe38187775 | |
| parent | 664473b719e9c2a6c03e1331523c48c43f6ef621 (diff) | |
| parent | 9337a52d1d67a81dc56b3188830c5f433f1de725 (diff) | |
Promotion of wlan-cld3.driver.lnx.1.1-00111.
CRs Change ID Subject
--------------------------------------------------------------------------------------------------------------
962051 Ie1569b22e22716abcf7d215c2e93870b84cf668f qcacld-3.0: Fix ibss vendor regression issue
1085184 I9acc30985735b014464b83c9e3dffea2d1cb4226 qcacld-3.0: Fix incorrect error handling in hdd_module_i
1020078 Ib86c9aacdb52141890b224262d55abbe58b1604d qcacld-3.0: Pass sta_inactivity_timeout to FW
688141 I5923bf2aefcae4a1b4617cc4ab271307f59e4d0a Release 5.1.0.34B
1082596 I256421f54180d1d8f9f6abd549d417e74d62add5 qcacld-3.0: Fix buffer overflow issue in cds_update_with
1020078 Icb45c37358dcfacbea8e3b3f40b93189d62e1be4 qcacld-3.0: Pass short_retry_limit and long_retry_limit
1005077 I95311ca6846796ad67fa09106bccb71ec6394aab qcacld-3.0: Add error logs if ROC timer stop, start or d
688141 I6186731e6f2b75fb5520eea4b479e927ead2309a Release 5.1.0.34N
1083677 Ifcc7d840680b05f4b136722ae204e7a55b66c6cc qcacld-3.0: Fix freed pointer dereference
688141 If17a42909eacbfe238efd2ee25c1c90a36f2a95d Release 5.1.0.34G
985334 I1c954336e14746060fec19f3ad89b3d4882306af qcacld-3.0: Fix SapAllChnlList memory leak
688141 Id3a4e56655868f797e87f7771a263ce971a19d66 Release 5.1.0.34W
1063255 Id37e8b6fc483d41c4e5b48bb78c295acc08a0328 qcacld-3.0: Fix incorrect NULL pointer check for SME
979025 I7a60ef79336c586dbad35308e958563c5205888a qcacld-3.0: Add value check for RF bands attribute of WP
688141 I31e0416ec5295b3f3e033e98f7356a7f2b3d0837 Release 5.1.0.34V
1078139 Iaa8bb455b3b61adac725beca4494ed792ca00fe0 qcacld-3.0: Add support to invoke LFR3 reassoc when RSO
1082131 Ic177382e6922e4c117cb01c78dd9b16437659496 qcacld-3.0: Get self SU and MU beamformee cap from cfg
1081117 I65ba2d5377f7c48d5344c5b4b9782e3c55f6635c qcacld-3.0: Fix ext_caps IE in Probe Request sent due to
1058399 1082704 I972b9354aec5cc6a078056d10c0e76eb841998c3 qcacld-3.0: Restore 11d country correctly
688141 I9f03889b4d4e1332408898af853a6386ebaa5915 Release 5.1.0.34M
688141 Ie1c2d9d3787c796350e1d7af1cabb84c5ad969ce Release 5.1.0.34K
688141 I32ec215d51919d324f0570329d82733f6566ef24 Release 5.1.0.34J
1063255 Ic8b6ce003a918890bae6d9c81f6732472333528e qcacld-3.0: Fix incorrect NULL pointer check for HDD lay
688141 Ib25e60d8566839b078539aa73c62cf07199de5d7 Release 5.1.0.34Q
688141 I245b923a6fe4239196587530d077b6e41e9191e4 Release 5.1.0.34D
1081656 I1f270e6b0ba4666d1640b1bf1d1c8e5dbc51e968 qcacld-3.0: Fix -Wmissing-prototypes in WMA
1082183 I70ae291ded2d2e290408e2f5b177e872f1f3d7e8 qcacld-3.0: Remove obsolete codeswap feature
688141 I838369806b9e459f059c80b417983e1ad63efca7 Release 5.1.0.34F
688141 Ib5974da59fa7a1264fe4cbf7d5f61ed8dfdf9c61 Release 5.1.0.34E
1084701 I92a4f13a611b9e8eb11dac1194e52ddd726dbc41 qcacld-3.0: Fix null pointer dereference
1039904 I59a8b150cf8383bf265c048c9fa1b26646e68dc0 qcacld-3.0: Ensure the fw parameters are restored
1083819 I7dce5ed4debc43ef2f14d429e5651732377fe3e0 qcacld-3.0: Avoid NULL pointer dereference in send_packe
1082183 Icee457715bd26e23c489dfefd35999b278ff68c0 qcacld-3.0: Remove CONFIG_CNSS flag in WMA
1075090 I52137b0a1e85d73f7567772228eb6994f9d16143 qcacld-3.0: Remove obsolete lim_is_scan_requested_ssid()
688141 Ie2dfe1bf38f5edd2be7036d7b5942c11dfca5ca9 Release 5.1.0.34O
1039135 I977ed9109a476a092dfb298386625a707bc98191 qcacld-3.0: Fix skb corruption in fragment RX handling
1082162 I9612ce6e922dd481747253b3b35d74060439c159 qcacld-3.0: Fix buffer overflow in __lim_process_roam_sc
688141 Ie955c31076f4e2c7d6ada0777df8a1d4c945c406 Release 5.1.0.34H
1083225 I4a9cd35ad5109ee2a33cfcafc9b03d5fcd80bb3f qcacld-3.0: Use system time instead of jiffies for BSS r
1080104 I78f244ad1a7ba21b3fad9cee8ec4e633bfe17a28 qcacld-3.0: Add adapter null pointer check when restart
978582 Ifa08b24a06e409fed1bd445574127fef02f21d19 qcacld-3.0: Add presence check for structure tDot11fQosM
1080697 I06014598e56f31b66d645f0380f5188dbe956f4f qcacld-3.0: Validate session-id before processing cfg op
688141 I8dd6561bd7eb895ada8b2ca493ad96d38574080d Release 5.1.0.34Y
945388 I86e6e849e7822f1c82c0f8951a8d91c5baebdcfe qcacld-3.0: Filter all channels that affected by radar s
688141 Ib77e261c00a2626d6fe650de5d1388e30b689a03 Release 5.1.0.34P
688141 I1b584a9334965eaee0c82770807fab75029d6797 Release 5.1.0.34S
992655 I8a3f3dbaf70c666973454e3266e0dabe0df1c9ea qcacld-3.0: Fix station scan AP failed in SAP+STA mode
909694 If22944b216ff10bafb98b5a2d3e4f2f1abe61333 qcacld-3.0: add OBSS scan param IE to probe response
1085099 I0db43ab8e73e20c8cb60a75a521a934967615023 qcacld-3.0: Properly validate the band in vendor scan co
1069298 I395be358f7bf3f23bb9453d1ed6c3dc9025f4aab qcacld-3.0: Add SSID length boundary check while process
688141 Ia4ad7ae1589a710e5bce88b75f9950f92779dc95 Release 5.1.0.34L
1075575 I50832b7e84c75b085173bc24d5827b93afb1e679 qcacld-3.0: Remove obsolete csr_send_mb_scan_result_req(
688141 I706e96ccc0193cf218a5ed3180947bb80c419aa9 Release 5.1.0.34C
1073053 Iae54115051ae037c83b8dd2b639754f941c1d0f5 qcacld-3.0: On demand OBSS scan of SAP
688141 I5f2d1d9f8b50e09edafc7fbfb9ef1b45dba170f6 Release 5.1.0.34I
998557 I0c05f65fd2ab62919272464a3be7cd138f12e2ec qcacld-3.0: Fix pSpectInfoParams memory corruption
1075151 I10d8ee7ef9a97d1eb5283e08c786826005fbd335 qcacld-3.0: Remove ol_txrx_ipa_uc_fw_op_event_handler()
1084104 I134a118b367c46e1b655a4eb21a6b406a3b25c2a Revert "qcacld-3.0: Fix NSS being sent to firmware"
688141 I587d916f08777b277d68943f1a38a5ddacf48978 Release 5.1.0.34X
688141 I03baae7ec66b409d2bb121d301b7eba3733b6adf Release 5.1.0.34R
1080127 Iad92c8acbaad504fd69dab585d1bf40afa6de206 qcacld-3.0: Mark zero length keys as not installed
990726 Ib36e1a9f34eb9054b12f0e8ba54a86ace7d6c8f8 qcacld-3.0: improve mboxping TX t-put for SDIO project
1081443 I1ae0f3a0c92ded2df8e8c710be1faab6fde5cc10 qcacld-3.0: Add PLD API to get QMI support info
688141 If9489bfda2db6e807f43f54d7ee97bd4b57d6539 Release 5.1.0.34U
1083649 Icdd7571214ea5510c0cdbc44c69d6b5060f5892c qcacld-3.0: Do not send WMI commands in ROAM_HO_FAIL han
1031447 I8700621fbef9c9b4867ac698f7f721d4ffb7d967 qcacld-3.0: Initialize vdev_nss in psession when roaming
1020078 I46dc401c26c3eeeb41b345d0fe1b4406394971fb qcacld-3.0: Pass tx_pkt_fail_cnt_threshold to FW
1084151 I35f80af382df4ff118bf426d12dc47ef7bbbc080 qcacld-3.0: Enhance logging in address change notifiers
1045760 Iba2a6d4c04809041489ff8c32aeb17c9dafbc4a5 qcacld-3.0: Vendor attribute for setting TX fail count t
1075575 I3289ea53a634915961d4f904cd806d7aed4202e4 qcacld-3.0: Remove obsolete sme_set_phy_cb_mode24_g()
688141 Idf23505c9bd2de86c1f6224be1eb09ccb34b92a1 Release 5.1.0.34T
1033277 I8e3d171ac47d8be149df98ae3e30c8df391a15b0 qcacld-3.0: Fix SAP restart failure
Change-Id: I8fe4240640b71669da10d12596bf8af7be4062b6
CRs-Fixed: 998557, 962051, 985334, 1020078, 1033277, 1075090, 1081656, 1039135, 1058399, 1083819, 979025, 1045760, 1080104, 1080697, 1084151, 1080127, 978582, 1085184, 909694, 1073053, 1005077, 1081117, 1083677, 688141, 1081443, 1069298, 1082131, 1078139, 1083225, 1039904, 1082596, 992655, 1085099, 1063255, 1084104, 990726, 1075575, 1084701, 945388, 1082704, 1075151, 1083649, 1031447, 1082183, 1082162
78 files changed, 1816 insertions, 744 deletions
@@ -1454,13 +1454,6 @@ CDEFINES += -DWLAN_FEATURE_RX_FULL_REORDER_OL endif endif -#enable Code swap feature -ifeq ($(CONFIG_CNSS), y) -ifeq ($(CONFIG_HIF_PCI), 1) -CDEFINES += -DCONFIG_CODESWAP_FEATURE -endif -endif - #Enable Signed firmware support for split binary format ifeq ($(CONFIG_QCA_SIGNED_SPLIT_BINARY_SUPPORT), 1) CDEFINES += -DQCA_SIGNED_SPLIT_BINARY_SUPPORT diff --git a/core/bmi/src/ol_fw.c b/core/bmi/src/ol_fw.c index 6eb34d64391a..5eeab5c1538d 100644 --- a/core/bmi/src/ol_fw.c +++ b/core/bmi/src/ol_fw.c @@ -1204,31 +1204,6 @@ end: return status; } -/* AXI Start Address */ -#define TARGET_ADDR (0xa0000) - -static void ol_transfer_codeswap_struct(struct ol_context *ol_ctx) -{ - struct pld_codeswap_codeseg_info wlan_codeswap; - QDF_STATUS rv; - qdf_device_t qdf_dev = ol_ctx->qdf_dev; - - if (pld_get_codeswap_struct(qdf_dev->dev, &wlan_codeswap)) { - BMI_ERR("%s: failed to get codeswap structure", __func__); - return; - } - - rv = bmi_write_memory(TARGET_ADDR, - (uint8_t *) &wlan_codeswap, sizeof(wlan_codeswap), - ol_ctx); - - if (rv != QDF_STATUS_SUCCESS) { - BMI_ERR("Failed to Write 0xa0000 to Target"); - return; - } - BMI_INFO("codeswap structure is successfully downloaded"); -} - QDF_STATUS ol_download_firmware(struct ol_context *ol_ctx) { struct hif_opaque_softc *scn = ol_ctx->scn; @@ -1304,8 +1279,6 @@ QDF_STATUS ol_download_firmware(struct ol_context *ol_ctx) BMI_INFO("%s: Using 0x%x for the remainder of init", __func__, address); - ol_transfer_codeswap_struct(ol_ctx); - status = ol_transfer_bin_file(ol_ctx, ATH_OTP_FILE, address, true); /* Execute the OTP code only if entry found and downloaded */ diff --git a/core/cds/src/cds_concurrency.c b/core/cds/src/cds_concurrency.c index b297c09f5873..56904b87cd9f 100644 --- a/core/cds/src/cds_concurrency.c +++ b/core/cds/src/cds_concurrency.c @@ -8353,8 +8353,8 @@ uint8_t cds_get_nondfs_preferred_channel(enum cds_con_mode mode, bool for_existing_conn) { - uint8_t pcl_channels[NUM_CHANNELS]; - uint8_t pcl_weight[NUM_CHANNELS]; + uint8_t pcl_channels[QDF_MAX_NUM_CHAN]; + uint8_t pcl_weight[QDF_MAX_NUM_CHAN]; /* * in worst case if we can't find any channel at all diff --git a/core/dp/htt/htt_t2h.c b/core/dp/htt/htt_t2h.c index 9d044f3e8c0b..de70e0c03367 100644 --- a/core/dp/htt/htt_t2h.c +++ b/core/dp/htt/htt_t2h.c @@ -232,9 +232,43 @@ void htt_t2h_lp_msg_handler(void *context, qdf_nbuf_t htt_t2h_msg, tid = HTT_RX_FRAG_IND_EXT_TID_GET(*msg_word); htt_rx_frag_set_last_msdu(pdev, htt_t2h_msg); + /* If packet len is invalid, will discard this frame. */ + if (pdev->cfg.is_high_latency) { + u_int32_t rx_pkt_len = 0; + + rx_pkt_len = qdf_nbuf_len(htt_t2h_msg); + + if (rx_pkt_len < (HTT_RX_FRAG_IND_BYTES + + sizeof(struct hl_htt_rx_ind_base)+ + sizeof(struct ieee80211_frame))) { + + qdf_print("%s: invalid packet len, %u\n", + __func__, + rx_pkt_len); + /* + * This buf will be freed before + * exiting this function. + */ + break; + } + } + ol_rx_frag_indication_handler(pdev->txrx_pdev, htt_t2h_msg, peer_id, tid); + + if (pdev->cfg.is_high_latency) { + /* + * For high latency solution, + * HTT_T2H_MSG_TYPE_RX_FRAG_IND message and RX packet + * share the same buffer. All buffer will be freed by + * ol_rx_frag_indication_handler or upper layer to + * avoid double free issue. + * + */ + return; + } + break; } case HTT_T2H_MSG_TYPE_RX_ADDBA: diff --git a/core/dp/txrx/ol_rx_defrag.c b/core/dp/txrx/ol_rx_defrag.c index 76cec6117f72..e158bc1a6bcb 100644 --- a/core/dp/txrx/ol_rx_defrag.c +++ b/core/dp/txrx/ol_rx_defrag.c @@ -144,18 +144,6 @@ static void ol_rx_frag_pull_hdr(htt_pdev_handle htt_pdev, } /** - * ol_rx_frag_clone() - clone the rx frag - * @frag: rx fragment to clone from - * - * Return: cloned buffer - */ -static inline qdf_nbuf_t -ol_rx_frag_clone(qdf_nbuf_t frag) -{ - return qdf_nbuf_clone(frag); -} - -/** * ol_rx_frag_desc_adjust() - adjust rx frag descriptor position * @pdev: pointer to txrx handle * @msdu: msdu @@ -271,12 +259,6 @@ static inline void ol_rx_frag_pull_hdr(htt_pdev_handle htt_pdev, qdf_nbuf_pull_head(frag, hdrsize); } -static inline qdf_nbuf_t -ol_rx_frag_clone(qdf_nbuf_t frag) -{ - return NULL; -} - static inline void ol_rx_frag_desc_adjust(ol_txrx_pdev_handle pdev, qdf_nbuf_t msdu, @@ -493,11 +475,8 @@ ol_rx_fraglist_insert(htt_pdev_handle htt_pdev, struct ieee80211_frame *mac_hdr, *cmac_hdr, *next_hdr, *lmac_hdr; uint8_t fragno, cur_fragno, lfragno, next_fragno; uint8_t last_morefrag = 1, count = 0; - qdf_nbuf_t frag_clone; qdf_assert(frag); - frag_clone = ol_rx_frag_clone(frag); - frag = frag_clone ? frag_clone : frag; mac_hdr = (struct ieee80211_frame *) ol_rx_frag_get_mac_hdr(htt_pdev, frag); diff --git a/core/dp/txrx/ol_txrx.c b/core/dp/txrx/ol_txrx.c index 19f4f2958d89..8427741c0a24 100644 --- a/core/dp/txrx/ol_txrx.c +++ b/core/dp/txrx/ol_txrx.c @@ -4119,36 +4119,6 @@ ol_txrx_ipa_uc_set_active(ol_txrx_pdev_handle pdev, bool uc_active, bool is_tx) } /** - * ol_txrx_ipa_uc_fw_op_event_handler() - opcode event handler - * @context: pdev context - * @rxpkt: received packet - * @staid: peer id - * - * Return: None - */ -void ol_txrx_ipa_uc_fw_op_event_handler(void *context, - void *rxpkt, - uint16_t staid) -{ - ol_txrx_pdev_handle pdev = (ol_txrx_pdev_handle)context; - - if (qdf_unlikely(!pdev)) { - QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_ERROR, - "%s: Invalid context", __func__); - qdf_mem_free(rxpkt); - return; - } - - if (pdev->ipa_uc_op_cb) { - pdev->ipa_uc_op_cb(rxpkt, pdev->osif_dev); - } else { - QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_ERROR, - "%s: ipa_uc_op_cb NULL", __func__); - qdf_mem_free(rxpkt); - } -} - -/** * ol_txrx_ipa_uc_op_response() - Handle OP command response from firmware * @pdev: handle to the HTT instance * @op_msg: op response message from firmware diff --git a/core/dp/txrx/ol_txrx_peer_find.c b/core/dp/txrx/ol_txrx_peer_find.c index 12638b04c858..dfd7da2a40a4 100644 --- a/core/dp/txrx/ol_txrx_peer_find.c +++ b/core/dp/txrx/ol_txrx_peer_find.c @@ -402,7 +402,7 @@ static inline void ol_txrx_peer_find_add_id(struct ol_txrx_pdev_t *pdev, qdf_spin_unlock(&pdev->peer_map_unmap_lock); - QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_INFO_HIGH, + QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_ERROR, "%s: peer %p ID %d peer_id[%d] peer_id_ref_cnt %d peer->ref_cnt %d", __func__, peer, peer_id, i, qdf_atomic_read(&pdev-> diff --git a/core/hdd/inc/wlan_hdd_cfg.h b/core/hdd/inc/wlan_hdd_cfg.h index 9ad137ddbba2..db6ec9c88727 100644 --- a/core/hdd/inc/wlan_hdd_cfg.h +++ b/core/hdd/inc/wlan_hdd_cfg.h @@ -3471,6 +3471,21 @@ enum dot11p_mode { #define CFG_TGT_GTX_USR_CFG_DEFAULT (32) /* + * This parameter will avoid updating ap_sta_inactivity from hostapd.conf + * file. If a station does not send anything in ap_max_inactivity seconds, an + * empty data frame is sent to it in order to verify whether it is + * still in range. If this frame is not ACKed, the station will be + * disassociated and then deauthenticated. This feature is used to + * clear station table of old entries when the STAs move out of the + * range. + * Default : Disable + */ +#define CFG_SAP_MAX_INACTIVITY_OVERRIDE_NAME "gSapMaxInactivityOverride" +#define CFG_SAP_MAX_INACTIVITY_OVERRIDE_MIN (0) +#define CFG_SAP_MAX_INACTIVITY_OVERRIDE_MAX (1) +#define CFG_SAP_MAX_INACTIVITY_OVERRIDE_DEFAULT (0) + +/* * This parameter determines that which defered method will be use in rx path * If no bits are set then rx path processing will happen in tasklet context. * Bit 0: rx_thread enable @@ -4245,6 +4260,7 @@ struct hdd_config { uint32_t tx_aggregation_size; uint32_t rx_aggregation_size; bool sta_prefer_80MHz_over_160MHz; + uint8_t sap_max_inactivity_override; }; #define VAR_OFFSET(_Struct, _Var) (offsetof(_Struct, _Var)) diff --git a/core/hdd/inc/wlan_hdd_main.h b/core/hdd/inc/wlan_hdd_main.h index 92bb43634916..2836204c0f4e 100644 --- a/core/hdd/inc/wlan_hdd_main.h +++ b/core/hdd/inc/wlan_hdd_main.h @@ -1070,10 +1070,10 @@ struct hdd_adapter_s { int temperature; /* Time stamp for last completed RoC request */ - unsigned long last_roc_ts; + uint64_t last_roc_ts; /* Time stamp for start RoC request */ - unsigned long start_roc_ts; + uint64_t start_roc_ts; /* State for synchronous OCB requests to WMI */ struct sir_ocb_set_config_response ocb_set_config_resp; @@ -1460,6 +1460,9 @@ struct hdd_context_s { #ifdef FEATURE_WLAN_AP_AP_ACS_OPTIMIZE qdf_mc_timer_t skip_acs_scan_timer; uint8_t skip_acs_scan_status; + uint8_t *last_acs_channel_list; + uint8_t num_of_channels; + qdf_spinlock_t acs_skip_lock; #endif qdf_wake_lock_t sap_dfs_wakelock; @@ -1962,4 +1965,12 @@ hdd_wlan_nla_put_u64(struct sk_buff *skb, int attrtype, u64 value) } #endif +static inline int wlan_hdd_validate_session_id(u8 session_id) +{ + if (session_id != HDD_SESSION_ID_INVALID) + return 0; + + return -EINVAL; +} + #endif /* end #if !defined(WLAN_HDD_MAIN_H) */ diff --git a/core/hdd/src/wlan_hdd_cfg.c b/core/hdd/src/wlan_hdd_cfg.c index b92c3c74e6a5..d2173dc45c66 100644 --- a/core/hdd/src/wlan_hdd_cfg.c +++ b/core/hdd/src/wlan_hdd_cfg.c @@ -4036,6 +4036,12 @@ REG_TABLE_ENTRY g_registry_table[] = { CFG_RX_AGGREGATION_SIZE_DEFAULT, CFG_RX_AGGREGATION_SIZE_MIN, CFG_RX_AGGREGATION_SIZE_MAX), + REG_VARIABLE(CFG_SAP_MAX_INACTIVITY_OVERRIDE_NAME, WLAN_PARAM_Integer, + struct hdd_config, sap_max_inactivity_override, + VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, + CFG_SAP_MAX_INACTIVITY_OVERRIDE_DEFAULT, + CFG_SAP_MAX_INACTIVITY_OVERRIDE_MIN, + CFG_SAP_MAX_INACTIVITY_OVERRIDE_MAX) }; /** @@ -5701,6 +5707,9 @@ void hdd_cfg_print(hdd_context_t *pHddCtx) hdd_info("Name = [%s] Value = [%u]", CFG_TGT_GTX_USR_CFG_NAME, pHddCtx->config->tgt_gtx_usr_cfg); + hdd_info("Name = [%s] Value = [%u]", + CFG_SAP_MAX_INACTIVITY_OVERRIDE_NAME, + pHddCtx->config->sap_max_inactivity_override); hdd_ndp_print_ini_config(pHddCtx); hdd_info("Name = [%s] Value = [%s]", CFG_RM_CAPABILITY_NAME, diff --git a/core/hdd/src/wlan_hdd_cfg80211.c b/core/hdd/src/wlan_hdd_cfg80211.c index c5e11a27ec3c..732351ca7f3e 100644 --- a/core/hdd/src/wlan_hdd_cfg80211.c +++ b/core/hdd/src/wlan_hdd_cfg80211.c @@ -3914,6 +3914,7 @@ wlan_hdd_wifi_config_policy[QCA_WLAN_VENDOR_ATTR_CONFIG_MAX + 1] = { [QCA_WLAN_VENDOR_ATTR_CONFIG_MGMT_RETRY] = {.type = NLA_U8 }, [QCA_WLAN_VENDOR_ATTR_CONFIG_CTRL_RETRY] = {.type = NLA_U8 }, [QCA_WLAN_VENDOR_ATTR_CONFIG_PROPAGATION_DELAY] = {.type = NLA_U8 }, + [QCA_WLAN_VENDOR_ATTR_CONFIG_TX_FAIL_COUNT] = {.type = NLA_U32 }, }; /** @@ -3986,6 +3987,7 @@ __wlan_hdd_cfg80211_wifi_configuration_set(struct wiphy *wiphy, QDF_STATUS qdf_status; uint8_t retry, delay; int param_id; + uint32_t tx_fail_count; ENTER_DEV(dev); @@ -4146,6 +4148,20 @@ __wlan_hdd_cfg80211_wifi_configuration_set(struct wiphy *wiphy, delay, PDEV_CMD); } + if (tb[QCA_WLAN_VENDOR_ATTR_CONFIG_TX_FAIL_COUNT]) { + tx_fail_count = nla_get_u32( + tb[QCA_WLAN_VENDOR_ATTR_CONFIG_TX_FAIL_COUNT]); + if (tx_fail_count) { + status = sme_update_tx_fail_cnt_threshold(hdd_ctx->hHal, + adapter->sessionId, tx_fail_count); + if (QDF_STATUS_SUCCESS != status) { + hdd_info("sme_update_tx_fail_cnt_threshold (err=%d)", + status); + return -EINVAL; + } + } + } + if (vendor_ie_present && access_policy_present) { if (access_policy == QCA_ACCESS_POLICY_DENY_UNLESS_LISTED) { access_policy = @@ -4962,6 +4978,11 @@ __wlan_hdd_cfg80211_monitor_rssi(struct wiphy *wiphy, ENTER_DEV(dev); + if (wlan_hdd_validate_session_id(adapter->sessionId)) { + hdd_err("invalid session id: %d", adapter->sessionId); + return -EINVAL; + } + ret = wlan_hdd_validate_context(hdd_ctx); if (ret) return ret; @@ -8900,7 +8921,7 @@ int wlan_hdd_cfg80211_init(struct device *dev, #ifdef QCA_HT_2040_COEX wiphy->features |= NL80211_FEATURE_AP_MODE_CHAN_WIDTH_CHANGE; #endif - + wiphy->features |= NL80211_FEATURE_INACTIVITY_TIMER; hdd_add_channel_switch_support(&wiphy->flags); EXIT(); @@ -9283,6 +9304,11 @@ static int __wlan_hdd_cfg80211_change_bss(struct wiphy *wiphy, return -EINVAL; } + if (wlan_hdd_validate_session_id(pAdapter->sessionId)) { + hdd_err("invalid session id: %d", pAdapter->sessionId); + return -EINVAL; + } + MTRACE(qdf_trace(QDF_MODULE_ID_HDD, TRACE_CODE_HDD_CFG80211_CHANGE_BSS, pAdapter->sessionId, params->ap_isolate)); @@ -9690,6 +9716,11 @@ static int __wlan_hdd_change_station(struct wiphy *wiphy, TRACE_CODE_HDD_CHANGE_STATION, pAdapter->sessionId, params->listen_interval)); + if (wlan_hdd_validate_session_id(pAdapter->sessionId)) { + hdd_err("invalid session id: %d", pAdapter->sessionId); + return -EINVAL; + } + pHddCtx = WLAN_HDD_GET_CTX(pAdapter); ret = wlan_hdd_validate_context(pHddCtx); if (0 != ret) @@ -9958,6 +9989,11 @@ static int __wlan_hdd_cfg80211_add_key(struct wiphy *wiphy, return -EINVAL; } + if (wlan_hdd_validate_session_id(pAdapter->sessionId)) { + hdd_err("invalid session id: %d", pAdapter->sessionId); + return -EINVAL; + } + MTRACE(qdf_trace(QDF_MODULE_ID_HDD, TRACE_CODE_HDD_CFG80211_ADD_KEY, pAdapter->sessionId, params->key_len)); @@ -10414,6 +10450,11 @@ static int __wlan_hdd_cfg80211_set_default_key(struct wiphy *wiphy, return -EINVAL; } + if (wlan_hdd_validate_session_id(pAdapter->sessionId)) { + hdd_err("invalid session id: %d", pAdapter->sessionId); + return -EINVAL; + } + MTRACE(qdf_trace(QDF_MODULE_ID_HDD, TRACE_CODE_HDD_CFG80211_SET_DEFAULT_KEY, pAdapter->sessionId, key_index)); @@ -10673,8 +10714,14 @@ struct cfg80211_bss *wlan_hdd_cfg80211_inform_bss_frame(hdd_adapter_t *pAdapter, qie_age->oui_2 = QCOM_OUI2; qie_age->oui_3 = QCOM_OUI3; qie_age->type = QCOM_VENDOR_IE_AGE_TYPE; + /* + * Lowi expects the timestamp of bss in units of 1/10 ms. In driver + * all bss related timestamp is in units of ms. Due to this when scan + * results are sent to lowi the scan age is high.To address this, + * send age in units of 1/10 ms. + */ qie_age->age = - qdf_mc_timer_get_system_ticks() - bss_desc->nReceivedTime; + (qdf_mc_timer_get_system_time() - bss_desc->received_time)/10; qie_age->tsf_delta = bss_desc->tsf_delta; memcpy(&qie_age->beacon_tsf, bss_desc->timeStamp, sizeof(qie_age->beacon_tsf)); @@ -10812,6 +10859,11 @@ int wlan_hdd_cfg80211_update_bss(struct wiphy *wiphy, ENTER(); + if (wlan_hdd_validate_session_id(pAdapter->sessionId)) { + hdd_err("invalid session id: %d", pAdapter->sessionId); + return -EINVAL; + } + MTRACE(qdf_trace(QDF_MODULE_ID_HDD, TRACE_CODE_HDD_CFG80211_UPDATE_BSS, NO_SESSION, pAdapter->sessionId)); @@ -10848,7 +10900,7 @@ int wlan_hdd_cfg80211_update_bss(struct wiphy *wiphy, */ if ((scan_time == 0) || (scan_time < - pScanResult->BssDescriptor.nReceivedTime)) { + pScanResult->BssDescriptor.received_time)) { bss_status = wlan_hdd_cfg80211_inform_bss_frame(pAdapter, &pScanResult->BssDescriptor); @@ -12395,6 +12447,11 @@ static int __wlan_hdd_cfg80211_connect(struct wiphy *wiphy, return -EINVAL; } + if (wlan_hdd_validate_session_id(pAdapter->sessionId)) { + hdd_err("invalid session id: %d", pAdapter->sessionId); + return -EINVAL; + } + MTRACE(qdf_trace(QDF_MODULE_ID_HDD, TRACE_CODE_HDD_CFG80211_CONNECT, pAdapter->sessionId, pAdapter->device_mode)); @@ -12657,6 +12714,11 @@ static int __wlan_hdd_cfg80211_disconnect(struct wiphy *wiphy, return -EINVAL; } + if (wlan_hdd_validate_session_id(pAdapter->sessionId)) { + hdd_err("invalid session id: %d", pAdapter->sessionId); + return -EINVAL; + } + MTRACE(qdf_trace(QDF_MODULE_ID_HDD, TRACE_CODE_HDD_CFG80211_DISCONNECT, pAdapter->sessionId, reason)); @@ -12887,6 +12949,11 @@ static int __wlan_hdd_cfg80211_join_ibss(struct wiphy *wiphy, return -EINVAL; } + if (wlan_hdd_validate_session_id(pAdapter->sessionId)) { + hdd_err("invalid session id: %d", pAdapter->sessionId); + return -EINVAL; + } + MTRACE(qdf_trace(QDF_MODULE_ID_HDD, TRACE_CODE_HDD_CFG80211_JOIN_IBSS, pAdapter->sessionId, pAdapter->device_mode)); @@ -13089,6 +13156,11 @@ static int __wlan_hdd_cfg80211_leave_ibss(struct wiphy *wiphy, return -EINVAL; } + if (wlan_hdd_validate_session_id(pAdapter->sessionId)) { + hdd_err("invalid session id: %d", pAdapter->sessionId); + return -EINVAL; + } + MTRACE(qdf_trace(QDF_MODULE_ID_HDD, TRACE_CODE_HDD_CFG80211_LEAVE_IBSS, pAdapter->sessionId, @@ -13407,6 +13479,11 @@ int __wlan_hdd_cfg80211_del_station(struct wiphy *wiphy, return -EINVAL; } + if (wlan_hdd_validate_session_id(pAdapter->sessionId)) { + hdd_err("invalid session id: %d", pAdapter->sessionId); + return -EINVAL; + } + MTRACE(qdf_trace(QDF_MODULE_ID_HDD, TRACE_CODE_HDD_CFG80211_DEL_STA, pAdapter->sessionId, pAdapter->device_mode)); @@ -13645,6 +13722,11 @@ static int __wlan_hdd_cfg80211_add_station(struct wiphy *wiphy, return -EINVAL; } + if (wlan_hdd_validate_session_id(pAdapter->sessionId)) { + hdd_err("invalid session id: %d", pAdapter->sessionId); + return -EINVAL; + } + MTRACE(qdf_trace(QDF_MODULE_ID_HDD, TRACE_CODE_HDD_CFG80211_ADD_STA, pAdapter->sessionId, params->listen_interval)); @@ -13724,6 +13806,11 @@ static int __wlan_hdd_cfg80211_set_pmksa(struct wiphy *wiphy, return -EINVAL; } + if (wlan_hdd_validate_session_id(pAdapter->sessionId)) { + hdd_err("invalid session id: %d", pAdapter->sessionId); + return -EINVAL; + } + if (!pmksa) { hdd_err("pmksa is NULL"); return -EINVAL; @@ -13805,6 +13892,11 @@ static int __wlan_hdd_cfg80211_del_pmksa(struct wiphy *wiphy, return -EINVAL; } + if (wlan_hdd_validate_session_id(pAdapter->sessionId)) { + hdd_err("invalid session id: %d", pAdapter->sessionId); + return -EINVAL; + } + if (!pmksa) { hdd_err("pmksa is NULL"); return -EINVAL; @@ -13885,6 +13977,11 @@ static int __wlan_hdd_cfg80211_flush_pmksa(struct wiphy *wiphy, return -EINVAL; } + if (wlan_hdd_validate_session_id(pAdapter->sessionId)) { + hdd_err("invalid session id: %d", pAdapter->sessionId); + return -EINVAL; + } + hdd_warn("Flushing PMKSA"); pHddCtx = WLAN_HDD_GET_CTX(pAdapter); @@ -13956,6 +14053,11 @@ __wlan_hdd_cfg80211_update_ft_ies(struct wiphy *wiphy, return -EINVAL; } + if (wlan_hdd_validate_session_id(pAdapter->sessionId)) { + hdd_err("invalid session id: %d", pAdapter->sessionId); + return -EINVAL; + } + MTRACE(qdf_trace(QDF_MODULE_ID_HDD, TRACE_CODE_HDD_CFG80211_UPDATE_FT_IES, pAdapter->sessionId, pHddStaCtx->conn_info.connState)); @@ -14087,6 +14189,11 @@ int __wlan_hdd_cfg80211_set_rekey_data(struct wiphy *wiphy, return -EINVAL; } + if (wlan_hdd_validate_session_id(pAdapter->sessionId)) { + hdd_err("invalid session id: %d", pAdapter->sessionId); + return -EINVAL; + } + MTRACE(qdf_trace(QDF_MODULE_ID_HDD, TRACE_CODE_HDD_CFG80211_SET_REKEY_DATA, pAdapter->sessionId, pAdapter->device_mode)); @@ -14578,6 +14685,11 @@ __wlan_hdd_cfg80211_set_ap_channel_width(struct wiphy *wiphy, return -EINVAL; } + if (wlan_hdd_validate_session_id(pAdapter->sessionId)) { + hdd_err("invalid session id: %d", pAdapter->sessionId); + return -EINVAL; + } + pHddCtx = WLAN_HDD_GET_CTX(pAdapter); status = wlan_hdd_validate_context(pHddCtx); if (status) @@ -14685,6 +14797,11 @@ static int __wlan_hdd_cfg80211_channel_switch(struct wiphy *wiphy, hdd_notice("Set Freq %d", csa_params->chandef.chan->center_freq); + if (wlan_hdd_validate_session_id(adapter->sessionId)) { + hdd_err("invalid session id: %d", adapter->sessionId); + return -EINVAL; + } + hdd_ctx = WLAN_HDD_GET_CTX(adapter); ret = wlan_hdd_validate_context(hdd_ctx); diff --git a/core/hdd/src/wlan_hdd_cfg80211.h b/core/hdd/src/wlan_hdd_cfg80211.h index 5cdaad826294..4fc72be584c5 100644 --- a/core/hdd/src/wlan_hdd_cfg80211.h +++ b/core/hdd/src/wlan_hdd_cfg80211.h @@ -2405,6 +2405,9 @@ enum qca_ignore_assoc_disallowed { * power save config to turn off/on qpower * @QCA_WLAN_VENDOR_ATTR_CONFIG_IGNORE_ASSOC_DISALLOWED: Ignore Assoc Disallowed * [MBO] + * @QCA_WLAN_VENDOR_ATTR_CONFIG_TX_FAIL_COUNT: Unsigned 32-bit value to + * configure the number of unicast TX fail packet count. + * The peer is disconnected once this threshold is reached. * @QCA_WLAN_VENDOR_ATTR_CONFIG_LAST: last config * @QCA_WLAN_VENDOR_ATTR_CONFIG_MAX: max config */ @@ -2476,6 +2479,7 @@ enum qca_wlan_vendor_config { /* Unsigned 8-bit, for setting qpower dynamically */ QCA_WLAN_VENDOR_ATTR_CONFIG_QPOWER = 25, QCA_WLAN_VENDOR_ATTR_CONFIG_IGNORE_ASSOC_DISALLOWED = 26, + QCA_WLAN_VENDOR_ATTR_CONFIG_TX_FAIL_COUNT, /* keep last */ QCA_WLAN_VENDOR_ATTR_CONFIG_LAST, QCA_WLAN_VENDOR_ATTR_CONFIG_MAX = diff --git a/core/hdd/src/wlan_hdd_hostapd.c b/core/hdd/src/wlan_hdd_hostapd.c index 8884800e31f3..804b5e47328e 100644 --- a/core/hdd/src/wlan_hdd_hostapd.c +++ b/core/hdd/src/wlan_hdd_hostapd.c @@ -961,6 +961,78 @@ static void wlan_hdd_sap_pre_cac_success(void *data) } } +#ifdef FEATURE_WLAN_AP_AP_ACS_OPTIMIZE +/** + * hdd_handle_acs_scan_event() - handle acs scan event for SAP + * @sap_event: tpSap_Event + * @adapter: hdd_adapter_t for SAP + * + * The function is to handle the eSAP_ACS_SCAN_SUCCESS_EVENT event. + * It will update scan result to cfg80211 and start a timer to flush the + * cached acs scan result. + * + * Return: QDF_STATUS_SUCCESS on success, + * other value on failure + */ +static QDF_STATUS hdd_handle_acs_scan_event(tpSap_Event sap_event, + hdd_adapter_t *adapter) +{ + hdd_context_t *hdd_ctx; + struct sap_acs_scan_complete_event *comp_evt; + QDF_STATUS qdf_status; + int chan_list_size; + + hdd_ctx = (hdd_context_t *)(adapter->pHddCtx); + if (!hdd_ctx) { + hdd_err("HDD context is null"); + return QDF_STATUS_E_FAILURE; + } + comp_evt = &sap_event->sapevt.sap_acs_scan_comp; + hdd_ctx->skip_acs_scan_status = eSAP_SKIP_ACS_SCAN; + qdf_spin_lock(&hdd_ctx->acs_skip_lock); + qdf_mem_free(hdd_ctx->last_acs_channel_list); + hdd_ctx->last_acs_channel_list = NULL; + hdd_ctx->num_of_channels = 0; + /* cache the previous ACS scan channel list . + * If the following OBSS scan chan list is covered by ACS chan list, + * we can skip OBSS Scan to save SAP starting total time. + */ + if (comp_evt->num_of_channels && comp_evt->channellist) { + chan_list_size = comp_evt->num_of_channels * + sizeof(comp_evt->channellist[0]); + hdd_ctx->last_acs_channel_list = qdf_mem_malloc( + chan_list_size); + if (hdd_ctx->last_acs_channel_list) { + qdf_mem_copy(hdd_ctx->last_acs_channel_list, + comp_evt->channellist, + chan_list_size); + hdd_ctx->num_of_channels = comp_evt->num_of_channels; + } + } + qdf_spin_unlock(&hdd_ctx->acs_skip_lock); + /* Update ACS scan result to cfg80211. Then OBSS scan can reuse the + * scan result. + */ + if (wlan_hdd_cfg80211_update_bss(hdd_ctx->wiphy, adapter, 0)) + hdd_info("NO SCAN result"); + + hdd_info("Reusing Last ACS scan result for %d sec", + ACS_SCAN_EXPIRY_TIMEOUT_S); + qdf_mc_timer_stop(&hdd_ctx->skip_acs_scan_timer); + qdf_status = qdf_mc_timer_start(&hdd_ctx->skip_acs_scan_timer, + ACS_SCAN_EXPIRY_TIMEOUT_S * 1000); + if (!QDF_IS_STATUS_SUCCESS(qdf_status)) + hdd_err("Failed to start ACS scan expiry timer"); + return QDF_STATUS_SUCCESS; +} +#else +static QDF_STATUS hdd_handle_acs_scan_event(tpSap_Event sap_event, + hdd_adapter_t *adapter) +{ + return QDF_STATUS_SUCCESS; +} +#endif + QDF_STATUS hdd_hostapd_sap_event_cb(tpSap_Event pSapEvent, void *usrDataForCallback) { @@ -1880,21 +1952,8 @@ QDF_STATUS hdd_hostapd_sap_event_cb(tpSap_Event pSapEvent, return hdd_chan_change_notify(pHostapdAdapter, dev, chan_change); } - -#ifdef FEATURE_WLAN_AP_AP_ACS_OPTIMIZE case eSAP_ACS_SCAN_SUCCESS_EVENT: - pHddCtx->skip_acs_scan_status = eSAP_SKIP_ACS_SCAN; - hdd_notice("Reusing Last ACS scan result for %d sec", - ACS_SCAN_EXPIRY_TIMEOUT_S); - qdf_mc_timer_stop(&pHddCtx->skip_acs_scan_timer); - qdf_status = qdf_mc_timer_start(&pHddCtx->skip_acs_scan_timer, - ACS_SCAN_EXPIRY_TIMEOUT_S * - 1000); - if (!QDF_IS_STATUS_SUCCESS(qdf_status)) - hdd_err("Failed to start ACS scan expiry timer"); - return QDF_STATUS_SUCCESS; -#endif - + return hdd_handle_acs_scan_event(pSapEvent, pHostapdAdapter); case eSAP_DFS_NOL_GET: hdd_notice("Received eSAP_DFS_NOL_GET event"); @@ -6235,7 +6294,7 @@ static void wlan_hdd_check_11gmode(u8 *pIe, u8 *require_ht, u8 *require_vht, * Return: 0 for success non-zero for failure */ static int wlan_hdd_add_ie(hdd_adapter_t *pHostapdAdapter, uint8_t *genie, - uint8_t *total_ielen, uint8_t *oui, + uint16_t *total_ielen, uint8_t *oui, uint8_t oui_size) { uint16_t ielen = 0; @@ -6268,7 +6327,7 @@ static int wlan_hdd_add_ie(hdd_adapter_t *pHostapdAdapter, uint8_t *genie, */ static void wlan_hdd_add_hostapd_conf_vsie(hdd_adapter_t *pHostapdAdapter, uint8_t *genie, - uint8_t *total_ielen) + uint16_t *total_ielen) { beacon_data_t *pBeacon = pHostapdAdapter->sessionCtx.ap.beacon; int left = pBeacon->tail_len; @@ -6341,7 +6400,7 @@ static void wlan_hdd_add_hostapd_conf_vsie(hdd_adapter_t *pHostapdAdapter, * Return: none */ static void wlan_hdd_add_extra_ie(hdd_adapter_t *pHostapdAdapter, - uint8_t *genie, uint8_t *total_ielen, + uint8_t *genie, uint16_t *total_ielen, uint8_t temp_ie_id) { beacon_data_t *pBeacon = pHostapdAdapter->sessionCtx.ap.beacon; @@ -6492,6 +6551,23 @@ wlan_hdd_cfg80211_alloc_new_beacon(hdd_adapter_t *pAdapter, } +#ifdef QCA_HT_2040_COEX +static void wlan_hdd_add_sap_obss_scan_ie( + hdd_adapter_t *hostapd_adapter, uint8_t *ie_buf, uint16_t *ie_len) +{ + if (QDF_SAP_MODE == hostapd_adapter->device_mode) { + if (wlan_hdd_get_sap_obss(hostapd_adapter)) + wlan_hdd_add_extra_ie(hostapd_adapter, ie_buf, ie_len, + WLAN_EID_OVERLAP_BSS_SCAN_PARAM); + } +} +#else +static void wlan_hdd_add_sap_obss_scan_ie( + hdd_adapter_t *hostapd_adapter, uint8_t *ie_buf, uint16_t *ie_len) +{ +} +#endif + /** * wlan_hdd_cfg80211_update_apies() - update ap mode ies * @adapter: Pointer to hostapd adapter @@ -6501,11 +6577,13 @@ wlan_hdd_cfg80211_alloc_new_beacon(hdd_adapter_t *pAdapter, int wlan_hdd_cfg80211_update_apies(hdd_adapter_t *adapter) { uint8_t *genie; - uint8_t total_ielen = 0; + uint16_t total_ielen = 0; int ret = 0; tsap_Config_t *pConfig; tSirUpdateIE updateIE; beacon_data_t *beacon = NULL; + uint16_t proberesp_ies_len; + uint8_t *proberesp_ies = NULL; pConfig = &adapter->sessionCtx.ap.sapConfig; beacon = adapter->sessionCtx.ap.beacon; @@ -6559,18 +6637,8 @@ int wlan_hdd_cfg80211_update_apies(hdd_adapter_t *adapter) goto done; } -#ifdef QCA_HT_2040_COEX - if (QDF_SAP_MODE == adapter->device_mode) { - tSmeConfigParams smeConfig; - qdf_mem_zero(&smeConfig, sizeof(smeConfig)); - sme_get_config_param(WLAN_HDD_GET_HAL_CTX(adapter), - &smeConfig); - if (smeConfig.csrConfig.obssEnabled) - wlan_hdd_add_extra_ie(adapter, genie, - &total_ielen, - WLAN_EID_OVERLAP_BSS_SCAN_PARAM); - } -#endif + wlan_hdd_add_sap_obss_scan_ie(adapter, genie, &total_ielen); + qdf_copy_macaddr(&updateIE.bssid, &adapter->macAddressCurrent); updateIE.smeSessionId = adapter->sessionId; @@ -6596,9 +6664,24 @@ int wlan_hdd_cfg80211_update_apies(hdd_adapter_t *adapter) } /* Added for Probe Response IE */ + proberesp_ies = qdf_mem_malloc(beacon->proberesp_ies_len + + MAX_GENIE_LEN); + if (proberesp_ies == NULL) { + hdd_err("mem alloc failed for probe resp ies %d", + proberesp_ies_len); + ret = -EINVAL; + goto done; + } + qdf_mem_copy(proberesp_ies, beacon->proberesp_ies, + beacon->proberesp_ies_len); + proberesp_ies_len = beacon->proberesp_ies_len; + + wlan_hdd_add_sap_obss_scan_ie(adapter, proberesp_ies, + &proberesp_ies_len); + if (test_bit(SOFTAP_BSS_STARTED, &adapter->event_flags)) { - updateIE.ieBufferlength = beacon->proberesp_ies_len; - updateIE.pAdditionIEBuffer = (uint8_t *) beacon->proberesp_ies; + updateIE.ieBufferlength = proberesp_ies_len; + updateIE.pAdditionIEBuffer = proberesp_ies; updateIE.append = false; updateIE.notify = false; if (sme_update_add_ie(WLAN_HDD_GET_HAL_CTX(adapter), @@ -6612,8 +6695,8 @@ int wlan_hdd_cfg80211_update_apies(hdd_adapter_t *adapter) wlansap_reset_sap_config_add_ie(pConfig, eUPDATE_IE_PROBE_RESP); } else { wlansap_update_sap_config_add_ie(pConfig, - beacon->proberesp_ies, - beacon->proberesp_ies_len, + proberesp_ies, + proberesp_ies_len, eUPDATE_IE_PROBE_RESP); } @@ -6641,6 +6724,7 @@ int wlan_hdd_cfg80211_update_apies(hdd_adapter_t *adapter) done: qdf_mem_free(genie); + qdf_mem_free(proberesp_ies); return ret; } @@ -7610,6 +7694,11 @@ static int __wlan_hdd_cfg80211_stop_ap(struct wiphy *wiphy, return -EINVAL; } + if (wlan_hdd_validate_session_id(pAdapter->sessionId)) { + hdd_err("invalid session id: %d", pAdapter->sessionId); + return -EINVAL; + } + MTRACE(qdf_trace(QDF_MODULE_ID_HDD, TRACE_CODE_HDD_CFG80211_STOP_AP, pAdapter->sessionId, pAdapter->device_mode)); @@ -7825,6 +7914,7 @@ static int __wlan_hdd_cfg80211_start_ap(struct wiphy *wiphy, hdd_context_t *pHddCtx; enum hw_mode_bandwidth channel_width; int status; + struct sme_sta_inactivity_timeout *sta_inactivity_timer; uint8_t channel; ENTER(); @@ -7834,6 +7924,11 @@ static int __wlan_hdd_cfg80211_start_ap(struct wiphy *wiphy, return -EINVAL; } + if (wlan_hdd_validate_session_id(pAdapter->sessionId)) { + hdd_err("invalid session id: %d", pAdapter->sessionId); + return -EINVAL; + } + MTRACE(qdf_trace(QDF_MODULE_ID_HDD, TRACE_CODE_HDD_CFG80211_START_AP, pAdapter->sessionId, params->beacon_interval)); @@ -7988,6 +8083,20 @@ static int __wlan_hdd_cfg80211_start_ap(struct wiphy *wiphy, ¶ms->beacon, params->ssid, params->ssid_len, params->hidden_ssid, true); + + if (pHddCtx->config->sap_max_inactivity_override) { + sta_inactivity_timer = qdf_mem_malloc( + sizeof(*sta_inactivity_timer)); + if (!sta_inactivity_timer) { + hdd_err("Failed to allocate Memory"); + return QDF_STATUS_E_FAILURE; + } + sta_inactivity_timer->session_id = pAdapter->sessionId; + sta_inactivity_timer->sta_inactivity_timeout = + params->inactivity_timeout; + sme_update_sta_inactivity_timeout(WLAN_HDD_GET_HAL_CTX + (pAdapter), sta_inactivity_timer); + } } EXIT(); @@ -8039,6 +8148,11 @@ static int __wlan_hdd_cfg80211_change_beacon(struct wiphy *wiphy, return -EINVAL; } + if (wlan_hdd_validate_session_id(pAdapter->sessionId)) { + hdd_err("invalid session id: %d", pAdapter->sessionId); + return -EINVAL; + } + MTRACE(qdf_trace(QDF_MODULE_ID_HDD, TRACE_CODE_HDD_CFG80211_CHANGE_BEACON, pAdapter->sessionId, pAdapter->device_mode)); diff --git a/core/hdd/src/wlan_hdd_ipa.c b/core/hdd/src/wlan_hdd_ipa.c index 6097b7c99350..7576c5702caa 100644 --- a/core/hdd/src/wlan_hdd_ipa.c +++ b/core/hdd/src/wlan_hdd_ipa.c @@ -362,7 +362,7 @@ static uint8_t vdev_to_iface[CSR_ROAM_SESSION_MAX]; * @rx_destructor_call: IPA Rx packet destructor count */ struct uc_rt_debug_info { - unsigned long time; + uint64_t time; uint64_t ipa_excep_count; uint64_t rx_drop_count; uint64_t net_sent_count; @@ -726,7 +726,7 @@ static void hdd_ipa_uc_rt_debug_host_fill(void *ctext) dump_info = &hdd_ipa->rt_bug_buffer[ hdd_ipa->rt_buf_fill_index % HDD_IPA_UC_RT_DEBUG_BUF_COUNT]; - dump_info->time = qdf_mc_timer_get_system_time(); + dump_info->time = (uint64_t)qdf_mc_timer_get_system_time(); dump_info->ipa_excep_count = hdd_ipa->stats.num_rx_excep; dump_info->rx_drop_count = hdd_ipa->ipa_rx_internel_drop_count; dump_info->net_sent_count = hdd_ipa->ipa_rx_net_send_count; @@ -779,7 +779,7 @@ void hdd_ipa_uc_rt_debug_host_dump(hdd_context_t *hdd_ctx) HDD_IPA_UC_RT_DEBUG_BUF_COUNT; dump_info = &hdd_ipa->rt_bug_buffer[dump_index]; HDD_IPA_LOG(QDF_TRACE_LEVEL_ERROR, - "%12lu:%10llu:%10llu:%10llu:%10llu:%10llu:%10llu:%10llu\n", + "%12llu:%10llu:%10llu:%10llu:%10llu:%10llu:%10llu:%10llu\n", dump_info->time, dump_info->ipa_excep_count, dump_info->rx_drop_count, dump_info->net_sent_count, dump_info->tx_mcbc_count, dump_info->tx_fwd_count, diff --git a/core/hdd/src/wlan_hdd_lpass.c b/core/hdd/src/wlan_hdd_lpass.c index 09cac5689c6f..de80700c7d3e 100644 --- a/core/hdd/src/wlan_hdd_lpass.c +++ b/core/hdd/src/wlan_hdd_lpass.c @@ -77,8 +77,10 @@ static int wlan_hdd_gen_wlan_status_pack(struct wlan_status_data *data, return -EINVAL; } - if (adapter->sessionId == HDD_SESSION_ID_INVALID) + if (wlan_hdd_validate_session_id(adapter->sessionId)) { + hdd_err("invalid session id: %d", adapter->sessionId); return -EINVAL; + } hdd_ctx = WLAN_HDD_GET_CTX(adapter); if (hdd_ctx->lpss_support && hdd_ctx->config->enable_lpass_support) diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index eaa8287ecccd..9ff70811b799 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -4839,6 +4839,11 @@ static void hdd_wlan_exit(hdd_context_t *hdd_ctx) (qdf_mc_timer_destroy(&hdd_ctx->skip_acs_scan_timer))) { hdd_err("Cannot deallocate ACS Skip timer"); } + qdf_spin_lock(&hdd_ctx->acs_skip_lock); + qdf_mem_free(hdd_ctx->last_acs_channel_list); + hdd_ctx->last_acs_channel_list = NULL; + hdd_ctx->num_of_channels = 0; + qdf_spin_unlock(&hdd_ctx->acs_skip_lock); #endif mutex_lock(&hdd_ctx->iface_change_lock); @@ -4945,12 +4950,27 @@ void __hdd_wlan_exit(void) } #ifdef FEATURE_WLAN_AP_AP_ACS_OPTIMIZE +/** + * hdd_skip_acs_scan_timer_handler() - skip ACS scan timer timeout handler + * @data: pointer to hdd_context_t + * + * This function will reset acs_scan_status to eSAP_DO_NEW_ACS_SCAN. + * Then new ACS request will do a fresh scan without reusing the cached + * scan information. + * + * Return: void + */ void hdd_skip_acs_scan_timer_handler(void *data) { hdd_context_t *hdd_ctx = (hdd_context_t *) data; hdd_notice("ACS Scan result expired. Reset ACS scan skip"); hdd_ctx->skip_acs_scan_status = eSAP_DO_NEW_ACS_SCAN; + qdf_spin_lock(&hdd_ctx->acs_skip_lock); + qdf_mem_free(hdd_ctx->last_acs_channel_list); + hdd_ctx->last_acs_channel_list = NULL; + hdd_ctx->num_of_channels = 0; + qdf_spin_unlock(&hdd_ctx->acs_skip_lock); if (!hdd_ctx->hHal) return; @@ -5213,11 +5233,13 @@ QDF_STATUS hdd_set_sme_chan_list(hdd_context_t *hdd_ctx) */ bool hdd_is_5g_supported(hdd_context_t *hdd_ctx) { - /* - * If wcnss_wlan_iris_xo_mode() returns WCNSS_XO_48MHZ(1); - * then hardware support 5Ghz. - */ - return true; + if (!hdd_ctx || !hdd_ctx->config) + return true; + + if (hdd_ctx->config->nBandCapability != eCSR_BAND_24) + return true; + else + return false; } static int hdd_wiphy_init(hdd_context_t *hdd_ctx) @@ -8098,6 +8120,7 @@ int hdd_wlan_startup(struct device *dev) (void *)hdd_ctx); if (!QDF_IS_STATUS_SUCCESS(status)) hdd_err("Failed to init ACS Skip timer"); + qdf_spinlock_create(&hdd_ctx->acs_skip_lock); #endif hdd_bus_bandwidth_init(hdd_ctx); @@ -9230,7 +9253,7 @@ static ssize_t wlan_boot_cb(struct kobject *kobj, * This is creates the syfs entry boot_wlan. Which shall be invoked * when the filesystem is ready. * - * Return: None + * Return: 0 for success, errno on failure */ static int wlan_init_sysfs(void) { @@ -9335,7 +9358,7 @@ static int __init hdd_module_init(void) int ret = -EINVAL; ret = wlan_init_sysfs(); - if (!ret) + if (ret) pr_err("Failed to create sysfs entry for loading wlan"); return ret; diff --git a/core/hdd/src/wlan_hdd_p2p.c b/core/hdd/src/wlan_hdd_p2p.c index da23bada2fe2..ed54273ca7d9 100644 --- a/core/hdd/src/wlan_hdd_p2p.c +++ b/core/hdd/src/wlan_hdd_p2p.c @@ -184,9 +184,12 @@ QDF_STATUS wlan_hdd_remain_on_channel_callback(tHalHandle hHal, void *pCtx, } hdd_notice("Received remain on channel rsp"); - qdf_mc_timer_stop(&pRemainChanCtx->hdd_remain_on_chan_timer); - qdf_mc_timer_destroy(&pRemainChanCtx->hdd_remain_on_chan_timer); - + if (qdf_mc_timer_stop(&pRemainChanCtx->hdd_remain_on_chan_timer) + != QDF_STATUS_SUCCESS) + hdd_err("Failed to stop hdd_remain_on_chan_timer"); + if (qdf_mc_timer_destroy(&pRemainChanCtx->hdd_remain_on_chan_timer) + != QDF_STATUS_SUCCESS) + hdd_err("Failed to destroy hdd_remain_on_chan_timer"); cfgState->remain_on_chan_ctx = NULL; /* * Resetting the roc in progress early ensures that the subsequent @@ -215,7 +218,8 @@ QDF_STATUS wlan_hdd_remain_on_channel_callback(tHalHandle hHal, void *pCtx, cookie, &pRemainChanCtx->chan, GFP_KERNEL); - pAdapter->last_roc_ts = qdf_mc_timer_get_system_time(); + pAdapter->last_roc_ts = + (uint64_t)qdf_mc_timer_get_system_time(); } /* Schedule any pending RoC: Any new roc request during this time @@ -275,13 +279,15 @@ void wlan_hdd_cancel_existing_remain_on_channel(hdd_adapter_t *pAdapter) hdd_err("Cancel Existing Remain on Channel"); if (QDF_TIMER_STATE_RUNNING == qdf_mc_timer_get_current_state( - &cfgState->remain_on_chan_ctx->hdd_remain_on_chan_timer)) - qdf_mc_timer_stop(&cfgState->remain_on_chan_ctx-> - hdd_remain_on_chan_timer); + &cfgState->remain_on_chan_ctx->hdd_remain_on_chan_timer)) { + if (qdf_mc_timer_stop(&cfgState->remain_on_chan_ctx-> + hdd_remain_on_chan_timer) != QDF_STATUS_SUCCESS) + hdd_err("Failed to stop hdd_remain_on_chan_timer"); + } pRemainChanCtx = cfgState->remain_on_chan_ctx; if (pRemainChanCtx->hdd_remain_on_chan_cancel_in_progress == - true) { + true) { mutex_unlock(&cfgState->remain_on_chan_ctx_lock); hdd_err("ROC timer cancellation in progress wait for completion"); rc = wait_for_completion_timeout(&pAdapter-> @@ -425,9 +431,14 @@ wait: roc_ctx = cfg_state->remain_on_chan_ctx; if (roc_ctx != NULL) { cfg_state->remain_on_chan_ctx = NULL; - qdf_mc_timer_stop(&roc_ctx->hdd_remain_on_chan_timer); - qdf_mc_timer_destroy( - &roc_ctx->hdd_remain_on_chan_timer); + if (qdf_mc_timer_stop(&roc_ctx-> + hdd_remain_on_chan_timer) + != QDF_STATUS_SUCCESS) + hdd_err("Failed to stop hdd_remain_on_chan_timer"); + if (qdf_mc_timer_destroy( + &roc_ctx->hdd_remain_on_chan_timer) + != QDF_STATUS_SUCCESS) + hdd_err("Failed to destroy hdd_remain_on_chan_timer"); if (roc_ctx->action_pkt_buff.frame_ptr != NULL && roc_ctx->action_pkt_buff.frame_length != 0) { qdf_mem_free( @@ -598,12 +609,21 @@ static int wlan_hdd_execute_remain_on_channel(hdd_adapter_t *pAdapter, &pRemainChanCtx->scan_id)) { hdd_err("sme_remain_on_channel failed"); mutex_lock(&cfgState->remain_on_chan_ctx_lock); - cfgState->remain_on_chan_ctx = NULL; pAdapter->is_roc_inprogress = false; + pRemainChanCtx = cfgState->remain_on_chan_ctx; + hddLog(LOG1, + FL("Freeing ROC ctx cfgState->remain_on_chan_ctx=%p"), + cfgState->remain_on_chan_ctx); + if (pRemainChanCtx) { + if (qdf_mc_timer_destroy( + &pRemainChanCtx-> + hdd_remain_on_chan_timer) + != QDF_STATUS_SUCCESS) + hdd_err("Failed to destroy hdd_remain_on_chan_timer"); + qdf_mem_free(pRemainChanCtx); + cfgState->remain_on_chan_ctx = NULL; + } mutex_unlock(&cfgState->remain_on_chan_ctx_lock); - qdf_mc_timer_destroy( - &pRemainChanCtx->hdd_remain_on_chan_timer); - qdf_mem_free(pRemainChanCtx); qdf_runtime_pm_allow_suspend(pHddCtx->runtime_context. roc); hdd_allow_suspend(WIFI_POWER_EVENT_WAKELOCK_ROC); @@ -631,12 +651,21 @@ static int wlan_hdd_execute_remain_on_channel(hdd_adapter_t *pAdapter, pAdapter, &pRemainChanCtx->scan_id)) { hdd_err("wlansap_remain_on_channel failed"); mutex_lock(&cfgState->remain_on_chan_ctx_lock); - cfgState->remain_on_chan_ctx = NULL; pAdapter->is_roc_inprogress = false; + pRemainChanCtx = cfgState->remain_on_chan_ctx; + hddLog(LOG1, + FL("Freeing ROC ctx cfgState->remain_on_chan_ctx=%p"), + cfgState->remain_on_chan_ctx); + if (pRemainChanCtx) { + if (qdf_mc_timer_destroy( + &pRemainChanCtx-> + hdd_remain_on_chan_timer) + != QDF_STATUS_SUCCESS) + hdd_err("Failed to destroy hdd_remain_on_chan_timer"); + qdf_mem_free(pRemainChanCtx); + cfgState->remain_on_chan_ctx = NULL; + } mutex_unlock(&cfgState->remain_on_chan_ctx_lock); - qdf_mc_timer_destroy( - &pRemainChanCtx->hdd_remain_on_chan_timer); - qdf_mem_free(pRemainChanCtx); qdf_runtime_pm_allow_suspend(pHddCtx->runtime_context. roc); hdd_allow_suspend(WIFI_POWER_EVENT_WAKELOCK_ROC); @@ -839,7 +868,7 @@ static int wlan_hdd_request_remain_on_channel(struct wiphy *wiphy, hdd_conn_is_connected( WLAN_HDD_GET_STATION_CTX_PTR(sta_adapter))) { if (pAdapter->last_roc_ts != 0 && - ((qdf_mc_timer_get_system_time() - + (((uint64_t)qdf_mc_timer_get_system_time() - pAdapter->last_roc_ts) < pHddCtx->config->p2p_listen_defer_interval)) { if (pRemainChanCtx->duration > HDD_P2P_MAX_ROC_DURATION) @@ -918,6 +947,11 @@ static int __wlan_hdd_cfg80211_remain_on_channel(struct wiphy *wiphy, return -EINVAL; } + if (wlan_hdd_validate_session_id(pAdapter->sessionId)) { + hdd_err("invalid session id: %d", pAdapter->sessionId); + return -EINVAL; + } + MTRACE(qdf_trace(QDF_MODULE_ID_HDD, TRACE_CODE_HDD_REMAIN_ON_CHANNEL, pAdapter->sessionId, REMAIN_ON_CHANNEL_REQUEST)); @@ -960,7 +994,7 @@ void hdd_remain_chan_ready_handler(hdd_adapter_t *pAdapter, cfgState = WLAN_HDD_GET_CFG_STATE_PTR(pAdapter); hdd_notice("Ready on chan ind %d", scan_id); - pAdapter->start_roc_ts = qdf_mc_timer_get_system_time(); + pAdapter->start_roc_ts = (uint64_t)qdf_mc_timer_get_system_time(); mutex_lock(&cfgState->remain_on_chan_ctx_lock); pRemainChanCtx = cfgState->remain_on_chan_ctx; if (pRemainChanCtx != NULL) { @@ -973,8 +1007,10 @@ void hdd_remain_chan_ready_handler(hdd_adapter_t *pAdapter, qdf_mc_timer_get_current_state( &pRemainChanCtx->hdd_remain_on_chan_timer)) { hdd_err("Timer Started before ready event!!!"); - qdf_mc_timer_stop(&pRemainChanCtx-> - hdd_remain_on_chan_timer); + if (qdf_mc_timer_stop(&pRemainChanCtx-> + hdd_remain_on_chan_timer) + != QDF_STATUS_SUCCESS) + hdd_err("Failed to stop hdd_remain_on_chan_timer"); } status = qdf_mc_timer_start(&pRemainChanCtx-> @@ -1060,6 +1096,11 @@ __wlan_hdd_cfg80211_cancel_remain_on_channel(struct wiphy *wiphy, return -EINVAL; } + if (wlan_hdd_validate_session_id(pAdapter->sessionId)) { + hdd_err("invalid session id: %d", pAdapter->sessionId); + return -EINVAL; + } + status = wlan_hdd_validate_context(pHddCtx); if (0 != status) @@ -1093,8 +1134,10 @@ __wlan_hdd_cfg80211_cancel_remain_on_channel(struct wiphy *wiphy, } if (NULL != cfgState->remain_on_chan_ctx) { - qdf_mc_timer_stop(&cfgState->remain_on_chan_ctx-> - hdd_remain_on_chan_timer); + if (qdf_mc_timer_stop(&cfgState->remain_on_chan_ctx-> + hdd_remain_on_chan_timer) + != QDF_STATUS_SUCCESS) + hdd_err("Failed to stop hdd_remain_on_chan_timer"); if (true == pRemainChanCtx->hdd_remain_on_chan_cancel_in_progress) { mutex_unlock(&cfgState->remain_on_chan_ctx_lock); @@ -1212,6 +1255,11 @@ static int __wlan_hdd_mgmt_tx(struct wiphy *wiphy, struct wireless_dev *wdev, return -EINVAL; } + if (wlan_hdd_validate_session_id(pAdapter->sessionId)) { + hdd_err("invalid session id: %d", pAdapter->sessionId); + return -EINVAL; + } + MTRACE(qdf_trace(QDF_MODULE_ID_HDD, TRACE_CODE_HDD_ACTION, pAdapter->sessionId, pAdapter->device_mode)); @@ -1269,7 +1317,8 @@ static int __wlan_hdd_mgmt_tx(struct wiphy *wiphy, struct wireless_dev *wdev, mutex_lock(&cfgState->remain_on_chan_ctx_lock); if (cfgState->remain_on_chan_ctx) { - uint32_t current_time = qdf_mc_timer_get_system_time(); + uint64_t current_time = + (uint64_t)qdf_mc_timer_get_system_time(); int remaining_roc_time = ((int) cfgState->remain_on_chan_ctx->duration - (current_time - pAdapter->start_roc_ts)); @@ -1409,9 +1458,11 @@ static int __wlan_hdd_mgmt_tx(struct wiphy *wiphy, struct wireless_dev *wdev, hddLog(LOG1, FL("Extending the wait time %d for actionFrmType=%d"), wait, actionFrmType); - qdf_mc_timer_stop(&cfgState-> - remain_on_chan_ctx-> - hdd_remain_on_chan_timer); + if (qdf_mc_timer_stop(&cfgState-> + remain_on_chan_ctx-> + hdd_remain_on_chan_timer) + != QDF_STATUS_SUCCESS) + hdd_err("Failed to stop hdd_remain_on_chan_timer"); status = qdf_mc_timer_start(&cfgState-> remain_on_chan_ctx-> @@ -2002,7 +2053,8 @@ struct wireless_dev *__wlan_hdd_add_virtual_intf(struct wiphy *wiphy, wlan_hdd_tdls_disable_offchan_and_teardown_links(pHddCtx); pAdapter = hdd_get_adapter(pHddCtx, QDF_STA_MODE); - if (pAdapter != NULL) { + if ((pAdapter != NULL) && + !(wlan_hdd_validate_session_id(pAdapter->sessionId))) { scan_info = &pAdapter->scan_info; if (scan_info->mScanPending) { hdd_abort_mac_scan(pHddCtx, pAdapter->sessionId, @@ -2140,6 +2192,11 @@ int __wlan_hdd_del_virtual_intf(struct wiphy *wiphy, struct wireless_dev *wdev) return -EINVAL; } + if (wlan_hdd_validate_session_id(pVirtAdapter->sessionId)) { + hdd_err("invalid session id: %d", pVirtAdapter->sessionId); + return -EINVAL; + } + MTRACE(qdf_trace(QDF_MODULE_ID_HDD, TRACE_CODE_HDD_DEL_VIRTUAL_INTF, pVirtAdapter->sessionId, pVirtAdapter->device_mode)); diff --git a/core/hdd/src/wlan_hdd_power.c b/core/hdd/src/wlan_hdd_power.c index bee6a6f01ba4..8da6f6fe5744 100644 --- a/core/hdd/src/wlan_hdd_power.c +++ b/core/hdd/src/wlan_hdd_power.c @@ -233,29 +233,31 @@ static int __wlan_hdd_ipv6_changed(struct notifier_block *nb, struct net_device *ndev = ifa->idev->dev; hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR(ndev); hdd_context_t *pHddCtx; + hdd_station_ctx_t *sta_ctx; int status; - ENTER(); + ENTER_DEV(ndev); if ((pAdapter == NULL) || (WLAN_HDD_ADAPTER_MAGIC != pAdapter->magic)) { hdd_err("Adapter context is invalid %p", pAdapter); - return -EINVAL; + return NOTIFY_DONE; } if ((pAdapter->dev == ndev) && - (pAdapter->device_mode == QDF_STA_MODE || - pAdapter->device_mode == QDF_P2P_CLIENT_MODE || - pAdapter->device_mode == QDF_NDI_MODE)) { + (pAdapter->device_mode == QDF_STA_MODE || + pAdapter->device_mode == QDF_P2P_CLIENT_MODE || + pAdapter->device_mode == QDF_NDI_MODE)) { pHddCtx = WLAN_HDD_GET_CTX(pAdapter); status = wlan_hdd_validate_context(pHddCtx); if (0 != status) return NOTIFY_DONE; + sta_ctx = WLAN_HDD_GET_STATION_CTX_PTR(pAdapter); if (eConnectionState_Associated == - WLAN_HDD_GET_STATION_CTX_PTR( - pAdapter)->conn_info.connState) + sta_ctx->conn_info.connState) { + hdd_info("invoking sme_dhcp_done_ind"); sme_dhcp_done_ind(pHddCtx->hHal, - pAdapter->sessionId); - + pAdapter->sessionId); + } schedule_work(&pAdapter->ipv6NotifierWorkQueue); } EXIT(); @@ -751,30 +753,33 @@ static int __wlan_hdd_ipv4_changed(struct notifier_block *nb, struct net_device *ndev = ifa->ifa_dev->dev; hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR(ndev); hdd_context_t *pHddCtx; + hdd_station_ctx_t *sta_ctx; int status; - ENTER(); + ENTER_DEV(ndev); if ((pAdapter == NULL) || (WLAN_HDD_ADAPTER_MAGIC != pAdapter->magic)) { hdd_err("Adapter context is invalid %p", pAdapter); - return -EINVAL; + return NOTIFY_DONE; } - if ((pAdapter && pAdapter->dev == ndev) && - (pAdapter->device_mode == QDF_STA_MODE || - pAdapter->device_mode == QDF_P2P_CLIENT_MODE || - pAdapter->device_mode == QDF_NDI_MODE)) { + if ((pAdapter->dev == ndev) && + (pAdapter->device_mode == QDF_STA_MODE || + pAdapter->device_mode == QDF_P2P_CLIENT_MODE || + pAdapter->device_mode == QDF_NDI_MODE)) { pHddCtx = WLAN_HDD_GET_CTX(pAdapter); status = wlan_hdd_validate_context(pHddCtx); if (0 != status) return NOTIFY_DONE; + sta_ctx = WLAN_HDD_GET_STATION_CTX_PTR(pAdapter); if (eConnectionState_Associated == - WLAN_HDD_GET_STATION_CTX_PTR( - pAdapter)->conn_info.connState) + sta_ctx->conn_info.connState) { + hdd_info("invoking sme_dhcp_done_ind"); sme_dhcp_done_ind(pHddCtx->hHal, - pAdapter->sessionId); + pAdapter->sessionId); + } if (!pHddCtx->config->fhostArpOffload) { hdd_notice("Offload not enabled ARPOffload=%d", @@ -1897,6 +1902,12 @@ static int __wlan_hdd_cfg80211_suspend_wlan(struct wiphy *wiphy, status = hdd_get_front_adapter(pHddCtx, &pAdapterNode); while (NULL != pAdapterNode && QDF_STATUS_SUCCESS == status) { pAdapter = pAdapterNode->pAdapter; + + if (wlan_hdd_validate_session_id(pAdapter->sessionId)) { + hdd_err("invalid session id: %d", pAdapter->sessionId); + goto next_adapter; + } + if (QDF_SAP_MODE == pAdapter->device_mode) { if (BSS_START == WLAN_HDD_GET_HOSTAP_STATE_PTR(pAdapter)->bssState && @@ -1925,6 +1936,7 @@ static int __wlan_hdd_cfg80211_suspend_wlan(struct wiphy *wiphy, } if (pAdapter->is_roc_inprogress) wlan_hdd_cleanup_remain_on_channel_ctx(pAdapter); +next_adapter: status = hdd_get_next_adapter(pHddCtx, pAdapterNode, &pNext); pAdapterNode = pNext; } @@ -2142,6 +2154,11 @@ static int __wlan_hdd_cfg80211_set_power_mgmt(struct wiphy *wiphy, return -EINVAL; } + if (wlan_hdd_validate_session_id(pAdapter->sessionId)) { + hdd_err("invalid session id: %d", pAdapter->sessionId); + return -EINVAL; + } + MTRACE(qdf_trace(QDF_MODULE_ID_HDD, TRACE_CODE_HDD_CFG80211_SET_POWER_MGMT, pAdapter->sessionId, timeout)); @@ -2327,6 +2344,11 @@ static int __wlan_hdd_cfg80211_get_txpower(struct wiphy *wiphy, return -EINVAL; } + if (wlan_hdd_validate_session_id(adapter->sessionId)) { + hdd_err("invalid session id: %d", adapter->sessionId); + return -EINVAL; + } + status = wlan_hdd_validate_context(pHddCtx); if (0 != status) { *dbm = 0; @@ -2339,8 +2361,8 @@ static int __wlan_hdd_cfg80211_get_txpower(struct wiphy *wiphy, } /* Validate adapter sessionId */ - if (adapter->sessionId == HDD_SESSION_ID_INVALID) { - hdd_err("Adapter Session Invalid!"); + if (wlan_hdd_validate_session_id(adapter->sessionId)) { + hdd_err("invalid session id: %d", adapter->sessionId); return -ENOTSUPP; } diff --git a/core/hdd/src/wlan_hdd_scan.c b/core/hdd/src/wlan_hdd_scan.c index d909dacc2baa..83f1601a87e1 100644 --- a/core/hdd/src/wlan_hdd_scan.c +++ b/core/hdd/src/wlan_hdd_scan.c @@ -482,9 +482,9 @@ static int hdd_indicate_scan_result(hdd_scan_info_t *scanInfo, /* AGE */ event.cmd = IWEVCUSTOM; p = custom; - p += scnprintf(p, MAX_CUSTOM_LEN, " Age: %lu", - qdf_mc_timer_get_system_ticks() - - descriptor->nReceivedTime); + p += scnprintf(p, MAX_CUSTOM_LEN, " Age: %llu", + qdf_mc_timer_get_system_time() - + descriptor->received_time); event.u.data.length = p - custom; current_event = iwe_stream_add_point(scanInfo->info, current_event, end, &event, custom); @@ -855,12 +855,13 @@ static int __iw_set_scan(struct net_device *dev, struct iw_request_info *info, } /* push addIEScan in scanRequset if exist */ - if (pAdapter->scan_info.scanAddIE.addIEdata && - pAdapter->scan_info.scanAddIE.length) { + if (pAdapter->scan_info.scanAddIE.length && + pAdapter->scan_info.scanAddIE.length <= + sizeof(pAdapter->scan_info.scanAddIE.addIEdata)) { scanRequest.uIEFieldLen = pAdapter->scan_info.scanAddIE.length; scanRequest.pIEField = pAdapter->scan_info.scanAddIE.addIEdata; } - scanRequest.timestamp = qdf_mc_timer_get_system_ticks(); + scanRequest.timestamp = qdf_mc_timer_get_system_time(); status = sme_scan_request((WLAN_HDD_GET_CTX(pAdapter))->hHal, pAdapter->sessionId, &scanRequest, &hdd_scan_request_callback, dev); @@ -1293,6 +1294,65 @@ allow_suspend: return 0; } +#ifdef FEATURE_WLAN_AP_AP_ACS_OPTIMIZE +/** + * wlan_hdd_sap_skip_scan_check() - The function will check OBSS + * scan skip or not for SAP. + * @hdd_ctx: pointer to hdd context. + * @request: pointer to scan request. + * + * This function will check the scan request's chan list against the + * previous ACS scan chan list. If all the chan are covered by + * previous ACS scan, we can skip the scan and return scan complete + * to save the SAP starting time. + * + * Return: true to skip the scan, + * false to continue the scan + */ +static bool wlan_hdd_sap_skip_scan_check(hdd_context_t *hdd_ctx, + struct cfg80211_scan_request *request) +{ + int i, j; + bool skip; + + hdd_info("HDD_ACS_SKIP_STATUS = %d", + hdd_ctx->skip_acs_scan_status); + if (hdd_ctx->skip_acs_scan_status != eSAP_SKIP_ACS_SCAN) + return false; + qdf_spin_lock(&hdd_ctx->acs_skip_lock); + if (hdd_ctx->last_acs_channel_list == NULL || + hdd_ctx->num_of_channels == 0 || + request->n_channels == 0) { + qdf_spin_unlock(&hdd_ctx->acs_skip_lock); + return false; + } + skip = true; + for (i = 0; i < request->n_channels ; i++) { + bool find = false; + for (j = 0; j < hdd_ctx->num_of_channels; j++) { + if (hdd_ctx->last_acs_channel_list[j] == + request->channels[i]->hw_value) { + find = true; + break; + } + } + if (!find) { + skip = false; + hdd_info("Chan %d isn't in ACS chan list", + request->channels[i]->hw_value); + break; + } + } + qdf_spin_unlock(&hdd_ctx->acs_skip_lock); + return skip; +} +#else +static bool wlan_hdd_sap_skip_scan_check(hdd_context_t *hdd_ctx, + struct cfg80211_scan_request *request) +{ + return false; +} +#endif /** * wlan_hdd_cfg80211_scan_block_cb() - scan block work handler @@ -1436,6 +1496,11 @@ static int __wlan_hdd_cfg80211_scan(struct wiphy *wiphy, return -EINVAL; } + if (wlan_hdd_validate_session_id(pAdapter->sessionId)) { + hdd_err("invalid session id: %d", pAdapter->sessionId); + return -EINVAL; + } + status = wlan_hdd_validate_context(pHddCtx); if (0 != status) @@ -1477,6 +1542,7 @@ static int __wlan_hdd_cfg80211_scan(struct wiphy *wiphy, * If we return scan failure hostapd fails secondary AP * startup. */ + hdd_err("##In DFS Master mode. Scan aborted"); pAdapter->request = request; INIT_WORK(&pAdapter->scan_block_work, @@ -1530,10 +1596,20 @@ static int __wlan_hdd_cfg80211_scan(struct wiphy *wiphy, hdd_err("Scan not allowed"); return -EBUSY; } + /* Check whether SAP scan can be skipped or not */ + if (pAdapter->device_mode == QDF_SAP_MODE && + wlan_hdd_sap_skip_scan_check(pHddCtx, request)) { + hdd_err("sap scan skipped"); + pAdapter->request = request; + INIT_WORK(&pAdapter->scan_block_work, + wlan_hdd_cfg80211_scan_block_cb); + schedule_work(&pAdapter->scan_block_work); + return 0; + } qdf_mem_zero(&scan_req, sizeof(scan_req)); - scan_req.timestamp = qdf_mc_timer_get_system_ticks(); + scan_req.timestamp = qdf_mc_timer_get_system_time(); /* Even though supplicant doesn't provide any SSIDs, n_ssids is * set to 1. Because of this, driver is assuming that this is not @@ -2012,6 +2088,12 @@ static int __wlan_hdd_cfg80211_vendor_scan(struct wiphy *wiphy, nla_for_each_nested(attr, tb[QCA_WLAN_VENDOR_ATTR_SCAN_SSIDS], tmp) { request->ssids[count].ssid_len = nla_len(attr); + if (request->ssids[count].ssid_len > + SIR_MAC_MAX_SSID_LENGTH) { + hdd_err("SSID Len %d is not correct for network %d", + request->ssids[count].ssid_len, count); + goto error; + } memcpy(request->ssids[count].ssid, nla_data(attr), nla_len(attr)); count++; @@ -2032,14 +2114,17 @@ static int __wlan_hdd_cfg80211_vendor_scan(struct wiphy *wiphy, if (tb[QCA_WLAN_VENDOR_ATTR_SCAN_SUPP_RATES]) { nla_for_each_nested(attr, - tb[QCA_WLAN_VENDOR_ATTR_SCAN_SUPP_RATES], - tmp) { + tb[QCA_WLAN_VENDOR_ATTR_SCAN_SUPP_RATES], + tmp) { band = nla_type(attr); + if (band >= NUM_NL80211_BANDS) + continue; if (!wiphy->bands[band]) continue; - request->rates[band] = wlan_hdd_get_rates(wiphy, - band, nla_data(attr), - nla_len(attr)); + request->rates[band] = + wlan_hdd_get_rates(wiphy, + band, nla_data(attr), + nla_len(attr)); } } @@ -2047,7 +2132,7 @@ static int __wlan_hdd_cfg80211_vendor_scan(struct wiphy *wiphy, request->flags = nla_get_u32(tb[QCA_WLAN_VENDOR_ATTR_SCAN_FLAGS]); if ((request->flags & NL80211_SCAN_FLAG_LOW_PRIORITY) && - !(wiphy->features & NL80211_FEATURE_LOW_PRIORITY_SCAN)) { + !(wiphy->features & NL80211_FEATURE_LOW_PRIORITY_SCAN)) { hdd_err("LOW PRIORITY SCAN not supported"); goto error; } @@ -2235,6 +2320,11 @@ static int __wlan_hdd_cfg80211_sched_scan_start(struct wiphy *wiphy, return -EINVAL; } + if (wlan_hdd_validate_session_id(pAdapter->sessionId)) { + hdd_err("invalid session id: %d", pAdapter->sessionId); + return -EINVAL; + } + pHddCtx = WLAN_HDD_GET_CTX(pAdapter); ret = wlan_hdd_validate_context(pHddCtx); @@ -2517,6 +2607,11 @@ static int __wlan_hdd_cfg80211_sched_scan_stop(struct wiphy *wiphy, return -EINVAL; } + if (wlan_hdd_validate_session_id(pAdapter->sessionId)) { + hdd_err("invalid session id: %d", pAdapter->sessionId); + return -EINVAL; + } + pHddCtx = WLAN_HDD_GET_CTX(pAdapter); if (NULL == pHddCtx) { @@ -2625,6 +2720,11 @@ static void __wlan_hdd_cfg80211_abort_scan(struct wiphy *wiphy, return; } + if (wlan_hdd_validate_session_id(adapter->sessionId)) { + hdd_err("invalid session id: %d", adapter->sessionId); + return; + } + ret = wlan_hdd_validate_context(hdd_ctx); if (!ret) return; diff --git a/core/hdd/src/wlan_hdd_stats.c b/core/hdd/src/wlan_hdd_stats.c index e38f1db5f85a..67f45a364d05 100644 --- a/core/hdd/src/wlan_hdd_stats.c +++ b/core/hdd/src/wlan_hdd_stats.c @@ -1659,6 +1659,11 @@ static int __wlan_hdd_cfg80211_get_station(struct wiphy *wiphy, return -EINVAL; } + if (wlan_hdd_validate_session_id(pAdapter->sessionId)) { + hdd_err("invalid session id: %d", pAdapter->sessionId); + return -EINVAL; + } + if ((eConnectionState_Associated != pHddStaCtx->conn_info.connState) || (0 == ssidlen)) { hdd_notice("Not associated or Invalid ssidlen, %d", diff --git a/core/hdd/src/wlan_hdd_tdls.c b/core/hdd/src/wlan_hdd_tdls.c index 0227bd10d69e..b5ebeefd8f8d 100644 --- a/core/hdd/src/wlan_hdd_tdls.c +++ b/core/hdd/src/wlan_hdd_tdls.c @@ -3090,7 +3090,14 @@ void wlan_hdd_tdls_timer_restart(hdd_adapter_t *pAdapter, qdf_mc_timer_t *timer, uint32_t expirationTime) { - hdd_station_ctx_t *pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(pAdapter); + hdd_station_ctx_t *pHddStaCtx; + + if (NULL == pAdapter || WLAN_HDD_ADAPTER_MAGIC != pAdapter->magic) { + hdd_err("invalid pAdapter: %p", pAdapter); + return; + } + + pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(pAdapter); /* Check whether driver load unload is in progress */ if (cds_is_load_or_unload_in_progress()) { @@ -3932,6 +3939,11 @@ static int __wlan_hdd_cfg80211_tdls_mgmt(struct wiphy *wiphy, return -EINVAL; } + if (wlan_hdd_validate_session_id(pAdapter->sessionId)) { + hdd_err("invalid session id: %d", pAdapter->sessionId); + return -EINVAL; + } + MTRACE(qdf_trace(QDF_MODULE_ID_HDD, TRACE_CODE_HDD_CFG80211_TDLS_MGMT, pAdapter->sessionId, action_code)); @@ -4438,6 +4450,11 @@ static int __wlan_hdd_cfg80211_tdls_oper(struct wiphy *wiphy, return -EINVAL; } + if (wlan_hdd_validate_session_id(pAdapter->sessionId)) { + hdd_err("invalid session id: %d", pAdapter->sessionId); + return -EINVAL; + } + MTRACE(qdf_trace(QDF_MODULE_ID_HDD, TRACE_CODE_HDD_CFG80211_TDLS_OPER, pAdapter->sessionId, oper)); diff --git a/core/hdd/src/wlan_hdd_wext.c b/core/hdd/src/wlan_hdd_wext.c index 52d44b5668cb..e0238e3c58fb 100644 --- a/core/hdd/src/wlan_hdd_wext.c +++ b/core/hdd/src/wlan_hdd_wext.c @@ -1625,7 +1625,6 @@ static void hdd_statistics_cb(void *pStats, void *pContext) */ void hdd_clear_roam_profile_ie(hdd_adapter_t *pAdapter) { - int i = 0; hdd_wext_state_t *pWextState = WLAN_HDD_GET_WEXT_STATE_PTR(pAdapter); ENTER(); @@ -1668,11 +1667,8 @@ void hdd_clear_roam_profile_ie(hdd_adapter_t *pAdapter) pWextState->authKeyMgmt = 0; - for (i = 0; i < CSR_MAX_NUM_KEY; i++) { - if (pWextState->roamProfile.Keys.KeyMaterial[i]) { - pWextState->roamProfile.Keys.KeyLength[i] = 0; - } - } + qdf_mem_zero(pWextState->roamProfile.Keys.KeyLength, CSR_MAX_NUM_KEY); + #ifdef FEATURE_WLAN_WAPI pAdapter->wapi_info.wapiAuthMode = WAPI_AUTH_MODE_OPEN; pAdapter->wapi_info.nWapiMode = 0; @@ -3043,7 +3039,7 @@ static int __iw_get_encode(struct net_device *dev, } for (i = 0; i < MAX_WEP_KEYS; i++) { - if (pRoamProfile->Keys.KeyMaterial[i] == NULL) { + if (pRoamProfile->Keys.KeyLength[i] == 0) { continue; } else { break; @@ -4057,7 +4053,6 @@ static int __iw_set_encode(struct net_device *dev, struct iw_request_info *info, uint8_t key_length; eCsrEncryptionType encryptionType = eCSR_ENCRYPT_TYPE_NONE; bool fKeyPresent = 0; - int i; QDF_STATUS status = QDF_STATUS_SUCCESS; int ret; @@ -4084,13 +4079,8 @@ static int __iw_set_encode(struct net_device *dev, struct iw_request_info *info, if (wrqu->data.flags & IW_ENCODE_DISABLED) { hdd_notice("****iwconfig wlan0 key off*****"); if (!fKeyPresent) { - - for (i = 0; i < CSR_MAX_NUM_KEY; i++) { - - if (pWextState->roamProfile.Keys.KeyMaterial[i]) - pWextState->roamProfile.Keys. - KeyLength[i] = 0; - } + qdf_mem_zero(pWextState->roamProfile.Keys.KeyLength, + CSR_MAX_NUM_KEY); } pHddStaCtx->conn_info.authType = eCSR_AUTH_TYPE_OPEN_SYSTEM; pWextState->wpaVersion = IW_AUTH_WPA_VERSION_DISABLED; @@ -4270,7 +4260,7 @@ static int __iw_get_encodeext(struct net_device *dev, } for (i = 0; i < MAX_WEP_KEYS; i++) { - if (pRoamProfile->Keys.KeyMaterial[i] == NULL) { + if (pRoamProfile->Keys.KeyLength[i] == 0) { continue; } else { break; @@ -4379,7 +4369,7 @@ static int __iw_set_encodeext(struct net_device *dev, return -EINVAL; } else { /*Static wep, update the roam profile with the keys */ - if (ext->key + if (ext->key_len && (ext->key_len <= eCSR_SECURITY_WEP_KEYSIZE_MAX_BYTES) && key_index < CSR_MAX_NUM_KEY) { diff --git a/core/mac/inc/qwlan_version.h b/core/mac/inc/qwlan_version.h index 88237f8aec48..c3b7c02228c7 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 "A" +#define QWLAN_VERSION_EXTRA "Y" #define QWLAN_VERSION_BUILD 34 -#define QWLAN_VERSIONSTR "5.1.0.34A" +#define QWLAN_VERSIONSTR "5.1.0.34Y" #endif /* QWLAN_VERSION_H */ diff --git a/core/mac/inc/sir_api.h b/core/mac/inc/sir_api.h index 3a8c353bde25..362aa55d3b93 100644 --- a/core/mac/inc/sir_api.h +++ b/core/mac/inc/sir_api.h @@ -724,8 +724,8 @@ typedef struct sSirBssDescription { /* used only in scan case. */ uint8_t channelIdSelf; uint8_t sSirBssDescriptionRsvd[3]; - /* base on a tick count. It is a time stamp, not a relative time. */ - uint32_t nReceivedTime; + /* Based on system time, not a relative time. */ + uint64_t received_time; uint32_t parentTSF; uint32_t startTSF[2]; uint8_t mdiePresent; @@ -1390,6 +1390,7 @@ typedef struct sSirSmeDisassocReq { /* This flag tells LIM whether to send the disassoc OTA or not */ /* This will be set in while handing off from one AP to other */ uint8_t doNotSendOverTheAir; + bool process_ho_fail; } qdf_packed tSirSmeDisassocReq, *tpSirSmeDisassocReq; /* / Definition for Tkip countermeasures request */ @@ -6586,4 +6587,46 @@ struct sir_encrypt_decrypt_rsp_params { uint8_t *data; }; +/** + * struct sme_tx_fail_cnt_threshold - tx failure count for disconnect to fw + * @session_id: Session id + * @tx_fail_cnt_threshold: Tx failure count to do disconnect + */ +struct sme_tx_fail_cnt_threshold { + uint8_t session_id; + uint32_t tx_fail_cnt_threshold; +}; + +/** + * struct sme_short_retry_limit - transmission retry limit for short frames. + * @session_id: Session id + * @short_retry_limit: tranmission retry limit for short frame. + * + */ +struct sme_short_retry_limit { + uint8_t session_id; + uint32_t short_retry_limit; +}; + +/** + * struct sme_long_retry_limit - tranmission retry limit for long frames + * @session_id: Session id + * @short_retry_limit: tranmission retry limit for long frames. + * + */ +struct sme_long_retry_limit { + uint8_t session_id; + uint32_t long_retry_limit; +}; + +/** + * struct sme_sta_inactivity_timeout - set sta_inactivity_timeout + * @session_id: session Id. + * @sta_inactivity_timeout: Timeout to disconnect STA after there + * is no activity. + */ +struct sme_sta_inactivity_timeout { + uint8_t session_id; + uint32_t sta_inactivity_timeout; +}; #endif /* __SIR_API_H */ diff --git a/core/mac/src/include/sir_params.h b/core/mac/src/include/sir_params.h index bff7c7b1bc6c..b050354d6501 100644 --- a/core/mac/src/include/sir_params.h +++ b/core/mac/src/include/sir_params.h @@ -253,9 +253,11 @@ typedef struct sSirMbMsgP2p { #define SIR_HAL_TIMER_ADJUST_ADAPTIVE_THRESHOLD_IND \ (SIR_HAL_ITC_MSG_TYPES_BEGIN + 44) #define SIR_HAL_SET_LINK_STATE (SIR_HAL_ITC_MSG_TYPES_BEGIN + 45) +#define SIR_HAL_DELETE_BSS_HO_FAIL_REQ (SIR_HAL_ITC_MSG_TYPES_BEGIN + 46) +#define SIR_HAL_DELETE_BSS_HO_FAIL_RSP (SIR_HAL_ITC_MSG_TYPES_BEGIN + 47) /* - * (SIR_HAL_ITC_MSG_TYPES_BEGIN + 46) to + * (SIR_HAL_ITC_MSG_TYPES_BEGIN + 48) to * (SIR_HAL_ITC_MSG_TYPES_BEGIN + 57) are unused */ @@ -635,7 +637,9 @@ typedef struct sSirMbMsgP2p { #define SIR_HAL_POWER_DBG_CMD (SIR_HAL_ITC_MSG_TYPES_BEGIN + 362) #define SIR_HAL_SET_DTIM_PERIOD (SIR_HAL_ITC_MSG_TYPES_BEGIN + 363) #define SIR_HAL_ENCRYPT_DECRYPT_MSG (SIR_HAL_ITC_MSG_TYPES_BEGIN + 364) - +#define SIR_HAL_SHORT_RETRY_LIMIT_CNT (SIR_HAL_ITC_MSG_TYPES_BEGIN + 365) +#define SIR_HAL_LONG_RETRY_LIMIT_CNT (SIR_HAL_ITC_MSG_TYPES_BEGIN + 366) +#define SIR_HAL_UPDATE_TX_FAIL_CNT_TH (SIR_HAL_ITC_MSG_TYPES_BEGIN + 367) #define SIR_HAL_MSG_TYPES_END (SIR_HAL_MSG_TYPES_BEGIN + 0x1FF) /* CFG message types */ diff --git a/core/mac/src/pe/include/lim_session.h b/core/mac/src/pe/include/lim_session.h index c0d7398e642c..4a3b40add9eb 100644 --- a/core/mac/src/pe/include/lim_session.h +++ b/core/mac/src/pe/include/lim_session.h @@ -485,6 +485,7 @@ typedef struct sPESession /* Added to Support BT-AMP */ uint8_t *access_policy_vendor_ie; uint8_t access_policy; bool ignore_assoc_disallowed; + bool process_ho_fail; } tPESession, *tpPESession; /*------------------------------------------------------------------------- diff --git a/core/mac/src/pe/lim/lim_api.c b/core/mac/src/pe/lim/lim_api.c index 9cdf5d054af7..901c564df9da 100644 --- a/core/mac/src/pe/lim/lim_api.c +++ b/core/mac/src/pe/lim/lim_api.c @@ -1868,8 +1868,8 @@ lim_roam_fill_bss_descr(tpAniSirGlobal pMac, qdf_mem_copy((uint8_t *) &bss_desc_ptr->bssId, (uint8_t *) mac_hdr->bssId, sizeof(tSirMacAddr)); - bss_desc_ptr->nReceivedTime = - (uint32_t)qdf_mc_timer_get_system_ticks(); + bss_desc_ptr->received_time = + (uint64_t)qdf_mc_timer_get_system_time(); if (parsed_frm_ptr->mdiePresent) { bss_desc_ptr->mdiePresent = parsed_frm_ptr->mdiePresent; qdf_mem_copy((uint8_t *)bss_desc_ptr->mdie, diff --git a/core/mac/src/pe/lim/lim_assoc_utils.c b/core/mac/src/pe/lim/lim_assoc_utils.c index b16c83e4e82b..d859282617ed 100644 --- a/core/mac/src/pe/lim/lim_assoc_utils.c +++ b/core/mac/src/pe/lim/lim_assoc_utils.c @@ -3396,7 +3396,12 @@ lim_del_bss(tpAniSirGlobal pMac, tpDphHashNode pStaDs, uint16_t bssIdx, /* we need to defer the message until we get the response back from HAL. */ SET_LIM_PROCESS_DEFD_MESGS(pMac, false); - msgQ.type = WMA_DELETE_BSS_REQ; + lim_log(pMac, LOGW, FL("process_ho_fail = %d"), + psessionEntry->process_ho_fail); + if (psessionEntry->process_ho_fail) + msgQ.type = WMA_DELETE_BSS_HO_FAIL_REQ; + else + msgQ.type = WMA_DELETE_BSS_REQ; msgQ.reserved = 0; msgQ.bodyptr = pDelBssParams; msgQ.bodyval = 0; diff --git a/core/mac/src/pe/lim/lim_ft_preauth.c b/core/mac/src/pe/lim/lim_ft_preauth.c index cca7f81fa040..7a099ecab85f 100644 --- a/core/mac/src/pe/lim/lim_ft_preauth.c +++ b/core/mac/src/pe/lim/lim_ft_preauth.c @@ -469,6 +469,12 @@ void lim_handle_ft_pre_auth_rsp(tpAniSirGlobal pMac, tSirRetStatus status, sizeof(psessionEntry->htConfig)); pftSessionEntry->limSmeState = eLIM_SME_WT_REASSOC_STATE; + if (IS_5G_CH(psessionEntry->ftPEContext.pFTPreAuthReq-> + preAuthchannelNum)) + pftSessionEntry->vdev_nss = pMac->vdev_type_nss_5g.sta; + else + pftSessionEntry->vdev_nss = pMac->vdev_type_nss_2g.sta; + lim_log(pMac, LOG1, FL("created session (%p) with id = %d"), pftSessionEntry, pftSessionEntry->peSessionId); diff --git a/core/mac/src/pe/lim/lim_link_monitoring_algo.c b/core/mac/src/pe/lim/lim_link_monitoring_algo.c index 9d7b9fe9d936..4f678f3d5c45 100644 --- a/core/mac/src/pe/lim/lim_link_monitoring_algo.c +++ b/core/mac/src/pe/lim/lim_link_monitoring_algo.c @@ -434,6 +434,7 @@ void lim_handle_heart_beat_failure(tpAniSirGlobal mac_ctx, tpPESession session) { uint8_t curr_chan; + tpSirAddie scan_ie = NULL; #ifdef FEATURE_WLAN_DIAG_SUPPORT_LIM /* FEATURE_WLAN_DIAG_SUPPORT */ host_log_beacon_update_pkt_type *log_ptr = NULL; @@ -489,9 +490,21 @@ void lim_handle_heart_beat_failure(tpAniSirGlobal mac_ctx, lim_log(mac_ctx, LOGW, FL("HB missed from AP. Sending Probe Req")); /* for searching AP, we don't include any more IE */ - lim_send_probe_req_mgmt_frame(mac_ctx, &session->ssId, - session->bssId, curr_chan, session->selfMacAddr, - session->dot11mode, 0, NULL); + if (session->pLimJoinReq != NULL) { + scan_ie = &session->pLimJoinReq->addIEScan; + lim_send_probe_req_mgmt_frame(mac_ctx, + &session->ssId, + session->bssId, curr_chan, + session->selfMacAddr, + session->dot11mode, + scan_ie->length, scan_ie->addIEdata); + } else { + lim_send_probe_req_mgmt_frame(mac_ctx, + &session->ssId, + session->bssId, curr_chan, + session->selfMacAddr, + session->dot11mode, 0, NULL); + } } else { lim_log(mac_ctx, LOGW, FL("HB missed from AP on DFS chanel moving to passive")); diff --git a/core/mac/src/pe/lim/lim_p2p.c b/core/mac/src/pe/lim/lim_p2p.c index 64a1a54997d4..41098542cfc7 100644 --- a/core/mac/src/pe/lim/lim_p2p.c +++ b/core/mac/src/pe/lim/lim_p2p.c @@ -173,11 +173,11 @@ void lim_process_insert_single_shot_noa_timeout(tpAniSirGlobal pMac) *------------------------------------------------------------------*/ void lim_convert_active_channel_to_passive_channel(tpAniSirGlobal pMac) { - uint32_t currentTime; - uint32_t lastTime = 0; - uint32_t timeDiff; + uint64_t currentTime; + uint64_t lastTime = 0; + uint64_t timeDiff; uint8_t i; - currentTime = qdf_mc_timer_get_system_time(); + currentTime = (uint64_t)qdf_mc_timer_get_system_time(); for (i = 1; i < SIR_MAX_24G_5G_CHANNEL_RANGE; i++) { if ((pMac->lim.dfschannelList.timeStamp[i]) != 0) { lastTime = pMac->lim.dfschannelList.timeStamp[i]; diff --git a/core/mac/src/pe/lim/lim_process_action_frame.c b/core/mac/src/pe/lim/lim_process_action_frame.c index 5a4609ec1b51..d2889095b1b9 100644 --- a/core/mac/src/pe/lim/lim_process_action_frame.c +++ b/core/mac/src/pe/lim/lim_process_action_frame.c @@ -575,8 +575,7 @@ static void __lim_process_operating_mode_action_frame(tpAniSirGlobal mac_ctx, (operating_mode_frm->OperatingMode.rxNSS + 1)) { sta_ptr->vhtSupportedRxNss = operating_mode_frm->OperatingMode.rxNSS + 1; - lim_set_nss_change(mac_ctx, session, - operating_mode_frm->OperatingMode.rxNSS, + lim_set_nss_change(mac_ctx, session, sta_ptr->vhtSupportedRxNss, sta_ptr->staIndex, mac_hdr->sa); } diff --git a/core/mac/src/pe/lim/lim_process_message_queue.c b/core/mac/src/pe/lim/lim_process_message_queue.c index 381e186d5bb8..b3c3f44723ae 100644 --- a/core/mac/src/pe/lim/lim_process_message_queue.c +++ b/core/mac/src/pe/lim/lim_process_message_queue.c @@ -446,6 +446,7 @@ uint8_t static def_msg_decision(tpAniSirGlobal pMac, tpSirMsgQ limMsg) && !pMac->lim.gLimSystemInScanLearnMode) { if ((limMsg->type != WMA_ADD_BSS_RSP) && (limMsg->type != WMA_DELETE_BSS_RSP) + && (limMsg->type != WMA_DELETE_BSS_HO_FAIL_RSP) && (limMsg->type != WMA_ADD_STA_RSP) && (limMsg->type != WMA_DELETE_STA_RSP) && (limMsg->type != WMA_SET_BSSKEY_RSP) @@ -1763,6 +1764,7 @@ static void lim_process_messages(tpAniSirGlobal mac_ctx, tpSirMsgQ msg) lim_process_mlm_del_sta_rsp(mac_ctx, msg); break; case WMA_DELETE_BSS_RSP: + case WMA_DELETE_BSS_HO_FAIL_RSP: lim_handle_delete_bss_rsp(mac_ctx, msg); break; case WMA_CSA_OFFLOAD_EVENT: diff --git a/core/mac/src/pe/lim/lim_process_mlm_rsp_messages.c b/core/mac/src/pe/lim/lim_process_mlm_rsp_messages.c index bd61bb43c4a0..a1162ec979e5 100644 --- a/core/mac/src/pe/lim/lim_process_mlm_rsp_messages.c +++ b/core/mac/src/pe/lim/lim_process_mlm_rsp_messages.c @@ -1305,15 +1305,20 @@ void lim_process_mlm_set_keys_cnf(tpAniSirGlobal pMac, uint32_t *pMsgBuf) * Firmware so we can set the protection bit */ if (eSIR_SME_SUCCESS == pMlmSetKeysCnf->resultCode) { - psessionEntry->is_key_installed = 1; + if (pMlmSetKeysCnf->key_len_nonzero) + psessionEntry->is_key_installed = 1; if (LIM_IS_AP_ROLE(psessionEntry)) { sta_ds = dph_lookup_hash_entry(pMac, pMlmSetKeysCnf->peer_macaddr.bytes, &aid, &psessionEntry->dph.dphHashTable); - if (sta_ds != NULL) + if (sta_ds != NULL && pMlmSetKeysCnf->key_len_nonzero) sta_ds->is_key_installed = 1; } } + lim_log(pMac, LOG1, + FL("is_key_installed = %d"), + psessionEntry->is_key_installed); + lim_send_sme_set_context_rsp(pMac, pMlmSetKeysCnf->peer_macaddr, 1, @@ -1372,6 +1377,8 @@ lim_handle_sme_join_result(tpAniSirGlobal mac_ctx, * to SME */ lim_cleanup_rx_path(mac_ctx, sta_ds, session_entry); + qdf_mem_free(session_entry->pLimJoinReq); + session_entry->pLimJoinReq = NULL; /* Cleanup if add bss failed */ if (session_entry->add_bss_failed) { dph_delete_hash_entry(mac_ctx, @@ -1379,15 +1386,13 @@ lim_handle_sme_join_result(tpAniSirGlobal mac_ctx, &session_entry->dph.dphHashTable); goto error; } - qdf_mem_free(session_entry->pLimJoinReq); - session_entry->pLimJoinReq = NULL; return; } + qdf_mem_free(session_entry->pLimJoinReq); + session_entry->pLimJoinReq = NULL; } error: - qdf_mem_free(session_entry->pLimJoinReq); - session_entry->pLimJoinReq = NULL; - /* Delete teh session if JOIN failure occurred. */ + /* Delete the session if JOIN failure occurred. */ if (result_code != eSIR_SME_SUCCESS) { if (lim_set_link_state (mac_ctx, eSIR_LINK_DOWN_STATE, @@ -2708,6 +2713,8 @@ void lim_process_mlm_set_sta_key_rsp(tpAniSirGlobal mac_ctx, tLimMlmSetKeysCnf mlm_set_key_cnf; uint8_t session_id = 0; tpPESession session_entry; + uint16_t key_len; + uint16_t result_status; SET_LIM_PROCESS_DEFD_MESGS(mac_ctx, true); qdf_mem_set((void *)&mlm_set_key_cnf, sizeof(tLimMlmSetKeysCnf), 0); @@ -2736,6 +2743,15 @@ void lim_process_mlm_set_sta_key_rsp(tpAniSirGlobal mac_ctx, (uint16_t)(((tpSetStaKeyParams) msg->bodyptr)->status); } + result_status = (uint16_t)(((tpSetStaKeyParams) msg->bodyptr)->status); + key_len = ((tpSetStaKeyParams)msg->bodyptr)->key[0].keyLength; + + if (result_status == eSIR_SME_SUCCESS && key_len) + mlm_set_key_cnf.key_len_nonzero = true; + else + mlm_set_key_cnf.key_len_nonzero = false; + + qdf_mem_free(msg->bodyptr); msg->bodyptr = NULL; /* Restore MLME state */ @@ -2781,6 +2797,7 @@ void lim_process_mlm_set_bss_key_rsp(tpAniSirGlobal mac_ctx, uint8_t session_id = 0; tpPESession session_entry; tpLimMlmSetKeysReq set_key_req; + uint16_t key_len; SET_LIM_PROCESS_DEFD_MESGS(mac_ctx, true); qdf_mem_set((void *)&set_key_cnf, sizeof(tLimMlmSetKeysCnf), 0); @@ -2798,16 +2815,24 @@ void lim_process_mlm_set_bss_key_rsp(tpAniSirGlobal mac_ctx, msg->bodyptr = NULL; return; } - if (eLIM_MLM_WT_SET_BSS_KEY_STATE == session_entry->limMlmState) + if (eLIM_MLM_WT_SET_BSS_KEY_STATE == session_entry->limMlmState) { result_status = (uint16_t)(((tpSetBssKeyParams)msg->bodyptr)->status); - else + key_len = ((tpSetBssKeyParams)msg->bodyptr)->key[0].keyLength; + } else { /* * BCAST key also uses tpSetStaKeyParams. * Done this way for readabilty. */ result_status = (uint16_t)(((tpSetStaKeyParams)msg->bodyptr)->status); + key_len = ((tpSetStaKeyParams)msg->bodyptr)->key[0].keyLength; + } + + if (result_status == eSIR_SME_SUCCESS && key_len) + set_key_cnf.key_len_nonzero = true; + else + set_key_cnf.key_len_nonzero = false; /* Validate MLME state */ if (eLIM_MLM_WT_SET_BSS_KEY_STATE != session_entry->limMlmState && diff --git a/core/mac/src/pe/lim/lim_process_sme_req_messages.c b/core/mac/src/pe/lim/lim_process_sme_req_messages.c index 9bf72ec16e1f..1d545e553421 100644 --- a/core/mac/src/pe/lim/lim_process_sme_req_messages.c +++ b/core/mac/src/pe/lim/lim_process_sme_req_messages.c @@ -2450,6 +2450,8 @@ static void __lim_process_sme_disassoc_req(tpAniSirGlobal pMac, uint32_t *pMsgBu psessionEntry->smeSessionId = smesessionId; psessionEntry->transactionId = smetransactionId; + lim_log(pMac, LOGW, FL("ho_fail: %d "), smeDisassocReq.process_ho_fail); + psessionEntry->process_ho_fail = smeDisassocReq.process_ho_fail; switch (GET_LIM_SYSTEM_ROLE(psessionEntry)) { case eLIM_STA_ROLE: @@ -4156,16 +4158,17 @@ static void __lim_process_roam_scan_offload_req(tpAniSirGlobal mac_ctx, local_ie_buf = qdf_mem_malloc(MAX_DEFAULT_SCAN_IE_LEN); if (!local_ie_buf) { - lim_log(mac_ctx, LOGE, FL("Mem Alloc failed for local_ie_buf")); + lim_log(mac_ctx, LOGE, + FL("Mem Alloc failed for local_ie_buf")); return; } local_ie_len = req_buffer->assoc_ie.length; /* Update ext cap IE if present */ if (local_ie_len && - !lim_update_ext_cap_ie(mac_ctx, req_buffer->assoc_ie.addIEdata, - local_ie_buf, &local_ie_len)) { - if (local_ie_len <= + !lim_update_ext_cap_ie(mac_ctx, req_buffer->assoc_ie.addIEdata, + local_ie_buf, &local_ie_len)) { + if (local_ie_len < QDF_ARRAY_SIZE(req_buffer->assoc_ie.addIEdata)) { req_buffer->assoc_ie.length = local_ie_len; qdf_mem_copy(req_buffer->assoc_ie.addIEdata, @@ -5692,8 +5695,11 @@ static bool lim_update_ibss_prop_add_ies(tpAniSirGlobal pMac, uint8_t **pDstData_buff, uint16_t *pDstDataLen, tSirModifyIE *pModifyIE) { - int32_t oui_length; - uint8_t *ibss_ie = NULL; + int32_t oui_length; + uint8_t *ibss_ie = NULL; + uint8_t *vendor_ie; +#define MAC_VENDOR_OUI "\x00\x16\x32" +#define MAC_VENDOR_SIZE 3 ibss_ie = pModifyIE->pIEBuffer; oui_length = pModifyIE->oui_length; @@ -5705,12 +5711,33 @@ lim_update_ibss_prop_add_ies(tpAniSirGlobal pMac, uint8_t **pDstData_buff, return false; } - lim_update_add_ie_buffer(pMac, - pDstData_buff, - pDstDataLen, - pModifyIE->pIEBuffer, - pModifyIE->ieBufferlength); + /* + * Why replace only beacon OUI data here: + * 1. other ie (such as wpa) shall not be overwritten here. + * 2. per spec, beacon oui ie might be set twice and original one + * shall be updated. + */ + vendor_ie = cfg_get_vendor_ie_ptr_from_oui(pMac, MAC_VENDOR_OUI, + MAC_VENDOR_SIZE, *pDstData_buff, *pDstDataLen); + if (vendor_ie) { + QDF_ASSERT((vendor_ie[1] + 2) == pModifyIE->ieBufferlength); + qdf_mem_copy(vendor_ie, pModifyIE->pIEBuffer, + pModifyIE->ieBufferlength); + } else { + uint16_t new_length = pModifyIE->ieBufferlength + *pDstDataLen; + uint8_t *new_ptr = qdf_mem_malloc(new_length); + if (NULL == new_ptr) { + lim_log(pMac, LOGE, FL("Memory allocation failed.")); + return false; + } + qdf_mem_copy(new_ptr, *pDstData_buff, *pDstDataLen); + qdf_mem_copy(&new_ptr[*pDstDataLen], pModifyIE->pIEBuffer, + pModifyIE->ieBufferlength); + qdf_mem_free(*pDstData_buff); + *pDstDataLen = new_length; + *pDstData_buff = new_ptr; + } return true; } diff --git a/core/mac/src/pe/lim/lim_scan_result_utils.c b/core/mac/src/pe/lim/lim_scan_result_utils.c index ea2bb8d1d253..81db887c7e91 100644 --- a/core/mac/src/pe/lim/lim_scan_result_utils.c +++ b/core/mac/src/pe/lim/lim_scan_result_utils.c @@ -177,14 +177,14 @@ lim_collect_bss_description(tpAniSirGlobal pMac, MAC_ADDR_ARRAY(pHdr->bssId), pBssDescr->rssi, pBssDescr->rssi_raw); - pBssDescr->nReceivedTime = (uint32_t) qdf_mc_timer_get_system_ticks(); + pBssDescr->received_time = (uint64_t)qdf_mc_timer_get_system_time(); pBssDescr->tsf_delta = WMA_GET_RX_TSF_DELTA(pRxPacketInfo); pBssDescr->seq_ctrl = pHdr->seqControl; lim_log(pMac, LOG1, - FL("BSSID: "MAC_ADDRESS_STR " tsf_delta = %u ReceivedTime = %u ssid = %s"), + FL("BSSID: "MAC_ADDRESS_STR " tsf_delta = %u ReceivedTime = %llu ssid = %s"), MAC_ADDR_ARRAY(pHdr->bssId), pBssDescr->tsf_delta, - pBssDescr->nReceivedTime, + pBssDescr->received_time, ((pBPR->ssidPresent) ? (char *)pBPR->ssId.ssId : "")); lim_log(pMac, LOG1, FL("Seq Ctrl: Frag Num: %d, Seq Num: LO:%02x HI:%02x"), @@ -233,47 +233,6 @@ lim_collect_bss_description(tpAniSirGlobal pMac, } /*** end lim_collect_bss_description() ***/ /** - * lim_is_scan_requested_ssid() - * - ***FUNCTION: - * This function is called during scan upon receiving - * Beacon/Probe Response frame to check if the received - * SSID is present in the list of requested SSIDs in scan - * - ***LOGIC: - * - ***ASSUMPTIONS: - * NA - * - ***NOTE: - * NA - * - * @param pMac - Pointer to Global MAC structure - * @param ssId - SSID Received in beacons/Probe responses that is compared - * against therequeusted SSID in scan list - * --------------------------------------------- - * - * @return bool - true if SSID is present in requested list, false otherwise - */ - -bool lim_is_scan_requested_ssid(tpAniSirGlobal pMac, tSirMacSSid *ssId) -{ - uint8_t i = 0; - - for (i = 0; i < pMac->lim.gpLimMlmScanReq->numSsid; i++) { - if (!qdf_mem_cmp((uint8_t *) ssId, - (uint8_t *) &pMac->lim. - gpLimMlmScanReq->ssId[i], - (uint8_t) (pMac->lim. - gpLimMlmScanReq->ssId[i]. - length + 1))) { - return true; - } - } - return false; -} - -/** * lim_check_and_add_bss_description() * @mac_ctx: Pointer to Global MAC structure * @bpr: Pointer to parsed Beacon/Probe Response structure diff --git a/core/mac/src/pe/lim/lim_send_sme_rsp_messages.c b/core/mac/src/pe/lim/lim_send_sme_rsp_messages.c index 4eae32115abf..7db0325fd3b9 100644 --- a/core/mac/src/pe/lim/lim_send_sme_rsp_messages.c +++ b/core/mac/src/pe/lim/lim_send_sme_rsp_messages.c @@ -2284,6 +2284,13 @@ void lim_handle_delete_bss_rsp(tpAniSirGlobal pMac, tpSirMsgQ MsgQ) qdf_mem_free(MsgQ->bodyptr); return; } + /* + * During DEL BSS handling, the PE Session will be deleted, but it is + * better to clear this flag if the session is hanging around due + * to some error conditions so that the next DEL_BSS request does + * not take the HO_FAIL path + */ + psessionEntry->process_ho_fail = false; if (LIM_IS_IBSS_ROLE(psessionEntry)) lim_ibss_del_bss_rsp(pMac, MsgQ->bodyptr, psessionEntry); else if (LIM_IS_UNKNOWN_ROLE(psessionEntry)) diff --git a/core/mac/src/pe/lim/lim_types.h b/core/mac/src/pe/lim/lim_types.h index 5b6ec4673827..533beda41cf2 100644 --- a/core/mac/src/pe/lim/lim_types.h +++ b/core/mac/src/pe/lim/lim_types.h @@ -369,11 +369,20 @@ typedef struct sLimMlmPurgeStaInd { uint8_t sessionId; } tLimMlmPurgeStaInd, *tpLimMlmPurgeStaInd; +/** + * struct sLimMlmSetKeysCnf - set key confirmation parameters + * @peer_macaddr: peer mac address + * @resultCode: Result of set key operation + * @aid: association id + * @sessionId: PE session id + * @key_len_nonzero: Keys are non-zero length + */ typedef struct sLimMlmSetKeysCnf { struct qdf_mac_addr peer_macaddr; uint16_t resultCode; uint16_t aid; uint8_t sessionId; + bool key_len_nonzero; } tLimMlmSetKeysCnf, *tpLimMlmSetKeysCnf; typedef struct sLimMlmResetReq { diff --git a/core/mac/src/pe/sch/sch_beacon_process.c b/core/mac/src/pe/sch/sch_beacon_process.c index 47157835a681..4c7e85d89cab 100644 --- a/core/mac/src/pe/sch/sch_beacon_process.c +++ b/core/mac/src/pe/sch/sch_beacon_process.c @@ -497,7 +497,8 @@ static void update_nss(tpAniSirGlobal mac_ctx, tpDphHashNode sta_ds, tpSirMacMgmtHdr mgmt_hdr) { if (sta_ds->vhtSupportedRxNss != (beacon->OperatingMode.rxNSS + 1)) { - sta_ds->vhtSupportedRxNss = beacon->OperatingMode.rxNSS; + sta_ds->vhtSupportedRxNss = + beacon->OperatingMode.rxNSS + 1; lim_set_nss_change(mac_ctx, session_entry, sta_ds->vhtSupportedRxNss, sta_ds->staIndex, mgmt_hdr->sa); diff --git a/core/mac/src/sys/legacy/src/utils/src/mac_trace.c b/core/mac/src/sys/legacy/src/utils/src/mac_trace.c index a76e2b49b6e9..63acd730a64f 100644 --- a/core/mac/src/sys/legacy/src/utils/src/mac_trace.c +++ b/core/mac/src/sys/legacy/src/utils/src/mac_trace.c @@ -394,7 +394,9 @@ uint8_t *mac_trace_get_wma_msg_string(uint16_t wma_msg) CASE_RETURN_STRING(WMA_ADD_BSS_REQ); CASE_RETURN_STRING(WMA_ADD_BSS_RSP); CASE_RETURN_STRING(WMA_DELETE_BSS_REQ); + CASE_RETURN_STRING(WMA_DELETE_BSS_HO_FAIL_REQ); CASE_RETURN_STRING(WMA_DELETE_BSS_RSP); + CASE_RETURN_STRING(WMA_DELETE_BSS_HO_FAIL_RSP); CASE_RETURN_STRING(WMA_SEND_BEACON_REQ); CASE_RETURN_STRING(WMA_SET_BSSKEY_REQ); CASE_RETURN_STRING(WMA_SET_BSSKEY_RSP); 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 3a2751528b0f..4ecc5eb2cdb7 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 @@ -1052,8 +1052,15 @@ populate_dot11f_vht_caps(tpAniSirGlobal pMac, CFG_GET_INT(nStatus, pMac, WNI_CFG_VHT_RXSTBC, nCfgValue); pDot11f->rxSTBC = (nCfgValue & 0x0007); - pDot11f->suBeamformeeCap = 0; - pDot11f->muBeamformeeCap = 0; + nCfgValue = 0; + CFG_GET_INT(nStatus, pMac, + WNI_CFG_VHT_SU_BEAMFORMEE_CAP, nCfgValue); + pDot11f->suBeamformeeCap = (nCfgValue & 0x0001); + + nCfgValue = 0; + CFG_GET_INT(nStatus, pMac, + WNI_CFG_VHT_MU_BEAMFORMEE_CAP, nCfgValue); + pDot11f->muBeamformeeCap = (nCfgValue & 0x0001); nCfgValue = 0; CFG_GET_INT(nStatus, pMac, WNI_CFG_VHT_SU_BEAMFORMER_CAP, @@ -4629,7 +4636,7 @@ sir_convert_qos_map_configure_frame2_struct(tpAniSirGlobal pMac, uint32_t status; status = dot11f_unpack_qos_map_configure(pMac, pFrame, nFrame, &mapConfigure); - if (DOT11F_FAILED(status)) { + if (DOT11F_FAILED(status) || !mapConfigure.QosMapSet.present) { dot11f_log(pMac, LOGE, FL("Failed to parse Qos Map Configure frame (0x%08x, %d bytes):"), status, nFrame); diff --git a/core/pld/inc/pld_common.h b/core/pld/inc/pld_common.h index 5d24f7949753..3a9bd1266c11 100644 --- a/core/pld/inc/pld_common.h +++ b/core/pld/inc/pld_common.h @@ -96,27 +96,6 @@ struct pld_fw_files { char setup_file[PLD_MAX_FILE_NAME]; }; -#define PLD_CODESWAP_MAX_CODESEGS 16 - -/** - * struct pld_codeswap_codeseg_info - code swap segment information - * @codeseg_total_bytes: total bytes of segments - * @num_codesegs: number of code segments - * @codeseg_size: code segment size - * @codeseg_size_log2: log2 of code segment size - * @codeseg_busaddr: array of addresses of each code segment - * - * pld_codeswap_codeseg_info is used to store code swap segment - * information. - */ -struct pld_codeswap_codeseg_info { - u32 codeseg_total_bytes; - u32 num_codesegs; - u32 codeseg_size; - u32 codeseg_size_log2; - void *codeseg_busaddr[PLD_CODESWAP_MAX_CODESEGS]; -}; - /** * enum pld_platform_cap_flag - platform capability flag * @PLD_HAS_EXTERNAL_SWREG: has external regulator @@ -333,8 +312,6 @@ int pld_get_fw_files_for_target(struct device *dev, u32 target_type, u32 target_version); void pld_is_pci_link_down(struct device *dev); int pld_shadow_control(struct device *dev, bool enable); -int pld_get_codeswap_struct(struct device *dev, - struct pld_codeswap_codeseg_info *swap_seg); int pld_set_wlan_unsafe_channel(struct device *dev, u16 *unsafe_ch_list, u16 ch_count); int pld_get_wlan_unsafe_channel(struct device *dev, u16 *unsafe_ch_list, @@ -380,4 +357,6 @@ int pld_smmu_map(struct device *dev, phys_addr_t paddr, uint32_t *iova_addr, size_t size); unsigned int pld_socinfo_get_serial_number(struct device *dev); uint8_t *pld_common_get_wlan_mac_address(struct device *dev, uint32_t *num); +int pld_is_qmi_disable(struct device *dev); + #endif diff --git a/core/pld/src/pld_common.c b/core/pld/src/pld_common.c index da6e7dfabddb..649b00680612 100644 --- a/core/pld/src/pld_common.c +++ b/core/pld/src/pld_common.c @@ -539,39 +539,6 @@ int pld_shadow_control(struct device *dev, bool enable) } /** - * pld_get_codeswap_struct() - Get codeswap structure - * @dev: device - * @swap_seg: buffer to codeswap information - * - * Return codeswap structure information to the buffer. - * - * Return: 0 for success - * Non zero failure code for errors - */ -int pld_get_codeswap_struct(struct device *dev, - struct pld_codeswap_codeseg_info *swap_seg) -{ - int ret = 0; - - switch (pld_get_bus_type(dev)) { - case PLD_BUS_TYPE_PCIE: - ret = pld_pcie_get_codeswap_struct(swap_seg); - break; - case PLD_BUS_TYPE_SNOC: - break; - case PLD_BUS_TYPE_SDIO: - break; - case PLD_BUS_TYPE_USB: - break; - default: - ret = -EINVAL; - break; - } - - return ret; -} - -/** * pld_set_wlan_unsafe_channel() - Set unsafe channel * @dev: device * @unsafe_ch_list: unsafe channel list @@ -1574,3 +1541,34 @@ uint8_t *pld_common_get_wlan_mac_address(struct device *dev, uint32_t *num) *num = 0; return NULL; } + +/** + * pld_is_qmi_disable() - Check QMI support is present or not + * @dev: device + * + * Return: 1 QMI is not supported + * 0 QMI is supported + * Non zero failure code for errors + */ +int pld_is_qmi_disable(struct device *dev) +{ + int ret = 0; + enum pld_bus_type type = pld_get_bus_type(dev); + + switch (type) { + case PLD_BUS_TYPE_SNOC: + ret = pld_snoc_is_qmi_disable(); + break; + case PLD_BUS_TYPE_PCIE: + case PLD_BUS_TYPE_SDIO: + pr_err("Not supported on type %d\n", type); + ret = -EINVAL; + break; + default: + pr_err("Invalid device type %d\n", type); + ret = -EINVAL; + break; + } + + return ret; +} diff --git a/core/pld/src/pld_pcie.c b/core/pld/src/pld_pcie.c index ada4fd1126b5..f481f3ca9930 100644 --- a/core/pld/src/pld_pcie.c +++ b/core/pld/src/pld_pcie.c @@ -458,31 +458,6 @@ int pld_pcie_get_fw_files_for_target(struct pld_fw_files *pfw_files, } /** - * pld_pcie_get_codeswap_struct() - Get codeswap structure - * @swap_seg: buffer to codeswap information - * - * Return codeswap structure information to the buffer. - * - * Return: 0 for success - * Non zero failure code for errors - */ -int pld_pcie_get_codeswap_struct(struct pld_codeswap_codeseg_info *swap_seg) -{ - int ret = 0; - struct codeswap_codeseg_info cnss_swap_seg; - - if (swap_seg == NULL) - return -ENODEV; - - ret = cnss_get_codeswap_struct(&cnss_swap_seg); - if (0 != ret) - return ret; - - memcpy(swap_seg, &cnss_swap_seg, sizeof(*swap_seg)); - return 0; -} - -/** * pld_pcie_get_platform_cap() - Get platform capabilities * @cap: buffer to the capabilities * diff --git a/core/pld/src/pld_pcie.h b/core/pld/src/pld_pcie.h index f14f555d5628..4831120c9e7d 100644 --- a/core/pld/src/pld_pcie.h +++ b/core/pld/src/pld_pcie.h @@ -137,11 +137,6 @@ static inline int pld_pcie_shadow_control(bool enable) return 0; } static inline int -pld_pcie_get_codeswap_struct(struct pld_codeswap_codeseg_info *swap_seg) -{ - return 0; -} -static inline int pld_pcie_set_wlan_unsafe_channel(u16 *unsafe_ch_list, u16 ch_count) { return 0; @@ -230,7 +225,6 @@ static inline uint8_t *pld_pcie_get_wlan_mac_address(struct device *dev, #else int pld_pcie_get_fw_files_for_target(struct pld_fw_files *pfw_files, u32 target_type, u32 target_version); -int pld_pcie_get_codeswap_struct(struct pld_codeswap_codeseg_info *swap_seg); int pld_pcie_get_platform_cap(struct pld_platform_cap *cap); void pld_pcie_set_driver_status(enum pld_driver_status status); diff --git a/core/pld/src/pld_snoc.h b/core/pld/src/pld_snoc.h index 9c8a53b8a889..a57511a9f6f0 100644 --- a/core/pld/src/pld_snoc.h +++ b/core/pld/src/pld_snoc.h @@ -135,6 +135,10 @@ unsigned int pld_snoc_socinfo_get_serial_number(struct device *dev) { return 0; } +static inline int pld_snoc_is_qmi_disable(void) +{ + return 0; +} #else int pld_snoc_register_driver(void); void pld_snoc_unregister_driver(void); @@ -223,5 +227,9 @@ unsigned int pld_snoc_socinfo_get_serial_number(struct device *dev) { return icnss_socinfo_get_serial_number(dev); } +static inline int pld_snoc_is_qmi_disable(void) +{ + return icnss_is_qmi_disable(); +} #endif #endif diff --git a/core/sap/inc/sap_api.h b/core/sap/inc/sap_api.h index 7e251d3c6264..3add3a0f1b8c 100644 --- a/core/sap/inc/sap_api.h +++ b/core/sap/inc/sap_api.h @@ -179,9 +179,7 @@ typedef enum { eSAP_DFS_NOL_SET, /* No ch available after DFS RADAR detect */ eSAP_DFS_NO_AVAILABLE_CHANNEL, -#ifdef FEATURE_WLAN_AP_AP_ACS_OPTIMIZE eSAP_ACS_SCAN_SUCCESS_EVENT, -#endif eSAP_ACS_CHANNEL_SELECTED, eSAP_ECSA_CHANGE_CHAN_IND, } eSapHddEvent; @@ -406,6 +404,18 @@ struct sap_roc_ready_ind_s { }; /** + * struct sap_acs_scan_complete_event - acs scan complete event + * @status: status of acs scan + * @channellist: acs scan channels + * @num_of_channels: number of channels + */ +struct sap_acs_scan_complete_event{ + uint8_t status; + uint8_t *channellist; + uint8_t num_of_channels; +}; + +/** * struct sap_ch_change_ind - channel change indication * @new_chan: channel to change */ @@ -454,6 +464,7 @@ typedef struct sap_Event_s { struct sap_ch_selected_s sap_ch_selected; struct sap_roc_ready_ind_s sap_roc_ind; struct sap_ch_change_ind sap_chan_cng_ind; + struct sap_acs_scan_complete_event sap_acs_scan_comp; } sapevt; } tSap_Event, *tpSap_Event; @@ -485,7 +496,7 @@ struct sap_acs_cfg { #endif uint16_t ch_width; - uint8_t pcl_channels[NUM_CHANNELS]; + uint8_t pcl_channels[QDF_MAX_NUM_CHAN]; uint32_t pcl_ch_count; /* ACS Algo Output */ uint8_t pri_ch; diff --git a/core/sap/src/sap_api_link_cntl.c b/core/sap/src/sap_api_link_cntl.c index 7b249cb746d5..9a62d3413c55 100644 --- a/core/sap/src/sap_api_link_cntl.c +++ b/core/sap/src/sap_api_link_cntl.c @@ -207,6 +207,7 @@ QDF_STATUS wlansap_scan_callback(tHalHandle hal_handle, * the result */ qdf_mem_free(sap_ctx->channelList); sap_ctx->channelList = NULL; + sap_ctx->num_of_channel = 0; } #endif @@ -412,6 +413,7 @@ wlansap_pre_start_bss_acs_scan_callback(tHalHandle hal_handle, void *pcontext, */ qdf_mem_free(sap_ctx->channelList); sap_ctx->channelList = NULL; + sap_ctx->num_of_channel = 0; } #endif QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_INFO_HIGH, diff --git a/core/sap/src/sap_ch_select.c b/core/sap/src/sap_ch_select.c index 9c9683789d4d..3d6643370715 100644 --- a/core/sap/src/sap_ch_select.c +++ b/core/sap/src/sap_ch_select.c @@ -708,6 +708,8 @@ static uint32_t sapweight_rssi_count(int8_t rssi, uint16_t count) * @pSpectCh: Channel Information * @offset: Channel Offset * @sap_24g: Channel is in 2.4G or 5G + * @spectch_start: the start of spect ch array + * @spectch_end: the end of spect ch array * * sap_update_rssi_bsscount updates bss count and rssi effect based * on the channel offset. @@ -716,13 +718,16 @@ static uint32_t sapweight_rssi_count(int8_t rssi, uint16_t count) */ static void sap_update_rssi_bsscount(tSapSpectChInfo *pSpectCh, int32_t offset, - bool sap_24g) + bool sap_24g, tSapSpectChInfo *spectch_start, + tSapSpectChInfo *spectch_end) { tSapSpectChInfo *pExtSpectCh = NULL; int32_t rssi, rsssi_effect; pExtSpectCh = (pSpectCh + offset); - if (pExtSpectCh != NULL) { + if (pExtSpectCh != NULL && + pExtSpectCh >= spectch_start && + pExtSpectCh < spectch_end) { ++pExtSpectCh->bssCount; switch (offset) { case -1: @@ -832,6 +837,8 @@ static void sap_upd_chan_spec_params(tSirProbeRespBeacon *pBeaconStruct, * @spect_ch: Channel Information * @offset: Channel Offset * @num_ch: no.of channels + * @spectch_start: the start of spect ch array + * @spectch_end: the end of spect ch array * * sap_update_rssi_bsscount_vht_5G updates bss count and rssi effect based * on the channel offset. @@ -841,7 +848,9 @@ static void sap_upd_chan_spec_params(tSirProbeRespBeacon *pBeaconStruct, static void sap_update_rssi_bsscount_vht_5G(tSapSpectChInfo *spect_ch, int32_t offset, - uint16_t num_ch) + uint16_t num_ch, + tSapSpectChInfo *spectch_start, + tSapSpectChInfo *spectch_end) { int32_t ch_offset; uint16_t i, cnt; @@ -856,7 +865,8 @@ static void sap_update_rssi_bsscount_vht_5G(tSapSpectChInfo *spect_ch, ch_offset = offset + i; if (ch_offset == 0) continue; - sap_update_rssi_bsscount(spect_ch, ch_offset, false); + sap_update_rssi_bsscount(spect_ch, ch_offset, false, + spectch_start, spectch_end); } } /** @@ -868,6 +878,8 @@ static void sap_update_rssi_bsscount_vht_5G(tSapSpectChInfo *spect_ch, * @sec_chan_offset: Secondary Channel Offset * @center_freq: Central frequency for the given channel. * @channel_id: channel_id + * @spectch_start: the start of spect ch array + * @spectch_end: the end of spect ch array * * sap_interference_rssi_count_5G considers the Adjacent channel rssi * and data count(here number of BSS observed) @@ -880,7 +892,9 @@ static void sap_interference_rssi_count_5G(tSapSpectChInfo *spect_ch, uint16_t sec_chan_offset, uint16_t center_freq, uint16_t center_freq_2, - uint8_t channel_id) + uint8_t channel_id, + tSapSpectChInfo *spectch_start, + tSapSpectChInfo *spectch_end) { uint16_t num_ch; int32_t offset = 0; @@ -906,12 +920,14 @@ static void sap_interference_rssi_count_5G(tSapSpectChInfo *spect_ch, switch (sec_chan_offset) { /* Above the Primary Channel */ case PHY_DOUBLE_CHANNEL_LOW_PRIMARY: - sap_update_rssi_bsscount(spect_ch, 1, false); + sap_update_rssi_bsscount(spect_ch, 1, false, + spectch_start, spectch_end); return; /* Below the Primary channel */ case PHY_DOUBLE_CHANNEL_HIGH_PRIMARY: - sap_update_rssi_bsscount(spect_ch, -1, false); + sap_update_rssi_bsscount(spect_ch, -1, false, + spectch_start, spectch_end); return; } return; @@ -949,7 +965,8 @@ static void sap_interference_rssi_count_5G(tSapSpectChInfo *spect_ch, default: return; } - sap_update_rssi_bsscount_vht_5G(spect_ch, offset, num_ch); + sap_update_rssi_bsscount_vht_5G(spect_ch, offset, num_ch, + spectch_start, spectch_end); } /** @@ -957,6 +974,8 @@ static void sap_interference_rssi_count_5G(tSapSpectChInfo *spect_ch, * considers the Adjacent channel rssi * and data count(here number of BSS observed) * @spect_ch Channel Information + * @spectch_start: the start of spect ch array + * @spectch_end: the end of spect ch array * * sap_interference_rssi_count considers the Adjacent channel rssi * and data count(here number of BSS observed) @@ -964,7 +983,9 @@ static void sap_interference_rssi_count_5G(tSapSpectChInfo *spect_ch, * Return: None. */ -static void sap_interference_rssi_count(tSapSpectChInfo *spect_ch) +static void sap_interference_rssi_count(tSapSpectChInfo *spect_ch, + tSapSpectChInfo *spectch_start, + tSapSpectChInfo *spectch_end) { if (NULL == spect_ch) { QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_ERROR, @@ -974,35 +995,57 @@ static void sap_interference_rssi_count(tSapSpectChInfo *spect_ch) switch (spect_ch->chNum) { case CHANNEL_1: - sap_update_rssi_bsscount(spect_ch, 1, true); - sap_update_rssi_bsscount(spect_ch, 2, true); - sap_update_rssi_bsscount(spect_ch, 3, true); - sap_update_rssi_bsscount(spect_ch, 4, true); + sap_update_rssi_bsscount(spect_ch, 1, true, + spectch_start, spectch_end); + sap_update_rssi_bsscount(spect_ch, 2, true, + spectch_start, spectch_end); + sap_update_rssi_bsscount(spect_ch, 3, true, + spectch_start, spectch_end); + sap_update_rssi_bsscount(spect_ch, 4, true, + spectch_start, spectch_end); break; case CHANNEL_2: - sap_update_rssi_bsscount(spect_ch, -1, true); - sap_update_rssi_bsscount(spect_ch, 1, true); - sap_update_rssi_bsscount(spect_ch, 2, true); - sap_update_rssi_bsscount(spect_ch, 3, true); - sap_update_rssi_bsscount(spect_ch, 4, true); + sap_update_rssi_bsscount(spect_ch, -1, true, + spectch_start, spectch_end); + sap_update_rssi_bsscount(spect_ch, 1, true, + spectch_start, spectch_end); + sap_update_rssi_bsscount(spect_ch, 2, true, + spectch_start, spectch_end); + sap_update_rssi_bsscount(spect_ch, 3, true, + spectch_start, spectch_end); + sap_update_rssi_bsscount(spect_ch, 4, true, + spectch_start, spectch_end); break; case CHANNEL_3: - sap_update_rssi_bsscount(spect_ch, -2, true); - sap_update_rssi_bsscount(spect_ch, -1, true); - sap_update_rssi_bsscount(spect_ch, 1, true); - sap_update_rssi_bsscount(spect_ch, 2, true); - sap_update_rssi_bsscount(spect_ch, 3, true); - sap_update_rssi_bsscount(spect_ch, 4, true); + sap_update_rssi_bsscount(spect_ch, -2, true, + spectch_start, spectch_end); + sap_update_rssi_bsscount(spect_ch, -1, true, + spectch_start, spectch_end); + sap_update_rssi_bsscount(spect_ch, 1, true, + spectch_start, spectch_end); + sap_update_rssi_bsscount(spect_ch, 2, true, + spectch_start, spectch_end); + sap_update_rssi_bsscount(spect_ch, 3, true, + spectch_start, spectch_end); + sap_update_rssi_bsscount(spect_ch, 4, true, + spectch_start, spectch_end); break; case CHANNEL_4: - sap_update_rssi_bsscount(spect_ch, -3, true); - sap_update_rssi_bsscount(spect_ch, -2, true); - sap_update_rssi_bsscount(spect_ch, -1, true); - sap_update_rssi_bsscount(spect_ch, 1, true); - sap_update_rssi_bsscount(spect_ch, 2, true); - sap_update_rssi_bsscount(spect_ch, 3, true); - sap_update_rssi_bsscount(spect_ch, 4, true); + sap_update_rssi_bsscount(spect_ch, -3, true, + spectch_start, spectch_end); + sap_update_rssi_bsscount(spect_ch, -2, true, + spectch_start, spectch_end); + sap_update_rssi_bsscount(spect_ch, -1, true, + spectch_start, spectch_end); + sap_update_rssi_bsscount(spect_ch, 1, true, + spectch_start, spectch_end); + sap_update_rssi_bsscount(spect_ch, 2, true, + spectch_start, spectch_end); + sap_update_rssi_bsscount(spect_ch, 3, true, + spectch_start, spectch_end); + sap_update_rssi_bsscount(spect_ch, 4, true, + spectch_start, spectch_end); break; case CHANNEL_5: @@ -1011,48 +1054,78 @@ static void sap_interference_rssi_count(tSapSpectChInfo *spect_ch) case CHANNEL_8: case CHANNEL_9: case CHANNEL_10: - sap_update_rssi_bsscount(spect_ch, -4, true); - sap_update_rssi_bsscount(spect_ch, -3, true); - sap_update_rssi_bsscount(spect_ch, -2, true); - sap_update_rssi_bsscount(spect_ch, -1, true); - sap_update_rssi_bsscount(spect_ch, 1, true); - sap_update_rssi_bsscount(spect_ch, 2, true); - sap_update_rssi_bsscount(spect_ch, 3, true); - sap_update_rssi_bsscount(spect_ch, 4, true); + sap_update_rssi_bsscount(spect_ch, -4, true, + spectch_start, spectch_end); + sap_update_rssi_bsscount(spect_ch, -3, true, + spectch_start, spectch_end); + sap_update_rssi_bsscount(spect_ch, -2, true, + spectch_start, spectch_end); + sap_update_rssi_bsscount(spect_ch, -1, true, + spectch_start, spectch_end); + sap_update_rssi_bsscount(spect_ch, 1, true, + spectch_start, spectch_end); + sap_update_rssi_bsscount(spect_ch, 2, true, + spectch_start, spectch_end); + sap_update_rssi_bsscount(spect_ch, 3, true, + spectch_start, spectch_end); + sap_update_rssi_bsscount(spect_ch, 4, true, + spectch_start, spectch_end); break; case CHANNEL_11: - sap_update_rssi_bsscount(spect_ch, -4, true); - sap_update_rssi_bsscount(spect_ch, -3, true); - sap_update_rssi_bsscount(spect_ch, -2, true); - sap_update_rssi_bsscount(spect_ch, -1, true); - sap_update_rssi_bsscount(spect_ch, 1, true); - sap_update_rssi_bsscount(spect_ch, 2, true); - sap_update_rssi_bsscount(spect_ch, 3, true); + sap_update_rssi_bsscount(spect_ch, -4, true, + spectch_start, spectch_end); + sap_update_rssi_bsscount(spect_ch, -3, true, + spectch_start, spectch_end); + sap_update_rssi_bsscount(spect_ch, -2, true, + spectch_start, spectch_end); + sap_update_rssi_bsscount(spect_ch, -1, true, + spectch_start, spectch_end); + sap_update_rssi_bsscount(spect_ch, 1, true, + spectch_start, spectch_end); + sap_update_rssi_bsscount(spect_ch, 2, true, + spectch_start, spectch_end); + sap_update_rssi_bsscount(spect_ch, 3, true, + spectch_start, spectch_end); break; case CHANNEL_12: - sap_update_rssi_bsscount(spect_ch, -4, true); - sap_update_rssi_bsscount(spect_ch, -3, true); - sap_update_rssi_bsscount(spect_ch, -2, true); - sap_update_rssi_bsscount(spect_ch, -1, true); - sap_update_rssi_bsscount(spect_ch, 1, true); - sap_update_rssi_bsscount(spect_ch, 2, true); + sap_update_rssi_bsscount(spect_ch, -4, true, + spectch_start, spectch_end); + sap_update_rssi_bsscount(spect_ch, -3, true, + spectch_start, spectch_end); + sap_update_rssi_bsscount(spect_ch, -2, true, + spectch_start, spectch_end); + sap_update_rssi_bsscount(spect_ch, -1, true, + spectch_start, spectch_end); + sap_update_rssi_bsscount(spect_ch, 1, true, + spectch_start, spectch_end); + sap_update_rssi_bsscount(spect_ch, 2, true, + spectch_start, spectch_end); break; case CHANNEL_13: - sap_update_rssi_bsscount(spect_ch, -4, true); - sap_update_rssi_bsscount(spect_ch, -3, true); - sap_update_rssi_bsscount(spect_ch, -2, true); - sap_update_rssi_bsscount(spect_ch, -1, true); - sap_update_rssi_bsscount(spect_ch, 1, true); + sap_update_rssi_bsscount(spect_ch, -4, true, + spectch_start, spectch_end); + sap_update_rssi_bsscount(spect_ch, -3, true, + spectch_start, spectch_end); + sap_update_rssi_bsscount(spect_ch, -2, true, + spectch_start, spectch_end); + sap_update_rssi_bsscount(spect_ch, -1, true, + spectch_start, spectch_end); + sap_update_rssi_bsscount(spect_ch, 1, true, + spectch_start, spectch_end); break; case CHANNEL_14: - sap_update_rssi_bsscount(spect_ch, -4, true); - sap_update_rssi_bsscount(spect_ch, -3, true); - sap_update_rssi_bsscount(spect_ch, -2, true); - sap_update_rssi_bsscount(spect_ch, -1, true); + sap_update_rssi_bsscount(spect_ch, -4, true, + spectch_start, spectch_end); + sap_update_rssi_bsscount(spect_ch, -3, true, + spectch_start, spectch_end); + sap_update_rssi_bsscount(spect_ch, -2, true, + spectch_start, spectch_end); + sap_update_rssi_bsscount(spect_ch, -1, true, + spectch_start, spectch_end); break; default: @@ -1114,6 +1187,9 @@ static void sap_compute_spect_weight(tSapChSelSpectInfo *pSpectInfoParams, uint32_t ieLen = 0; tSirProbeRespBeacon *pBeaconStruct; tpAniSirGlobal pMac = (tpAniSirGlobal) halHandle; + tSapSpectChInfo *spectch_start = pSpectInfoParams->pSpectCh; + tSapSpectChInfo *spectch_end = pSpectInfoParams->pSpectCh + + pSpectInfoParams->numSpectChans; pBeaconStruct = qdf_mem_malloc(sizeof(tSirProbeRespBeacon)); if (NULL == pBeaconStruct) { @@ -1191,11 +1267,14 @@ static void sap_compute_spect_weight(tSapChSelSpectInfo *pSpectInfoParams, secondaryChannelOffset, centerFreq, centerFreq_2, - channel_id); + channel_id, + spectch_start, + spectch_end); break; case eCSR_DOT11_MODE_11g: - sap_interference_rssi_count(pSpectCh); + sap_interference_rssi_count(pSpectCh, + spectch_start, spectch_end); break; case eCSR_DOT11_MODE_abg: @@ -1204,8 +1283,11 @@ static void sap_compute_spect_weight(tSapChSelSpectInfo *pSpectInfoParams, secondaryChannelOffset, centerFreq, centerFreq_2, - channel_id); - sap_interference_rssi_count(pSpectCh); + channel_id, + spectch_start, + spectch_end); + sap_interference_rssi_count(pSpectCh, + spectch_start, spectch_end); break; } diff --git a/core/sap/src/sap_fsm.c b/core/sap/src/sap_fsm.c index c7f263257bfa..9493d91a9c4f 100644 --- a/core/sap/src/sap_fsm.c +++ b/core/sap/src/sap_fsm.c @@ -1062,7 +1062,6 @@ sap_mark_leaking_ch(ptSapContext sap_ctx, FL("sapdfs: channel: %d will have bad leakage due to channel: %d\n"), dfs_nol_channel, temp_ch_lst[j]); temp_ch_lst[j] = 0; - break; } j++; k++; @@ -2215,7 +2214,18 @@ QDF_STATUS sap_goto_channel_sel(ptSapContext sap_context, #endif #ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH if (sap_context->cc_switch_mode != - QDF_MCC_TO_SCC_SWITCH_DISABLE) { + QDF_MCC_TO_SCC_SWITCH_DISABLE && + sap_context->channel) { + /* + * For ACS request ,the sapContext->channel is 0, + * we skip below overlap checking. When the ACS + * finish and SAPBSS start, the sapContext->channel + * will not be 0. Then the overlap checking will be + * reactivated.If we use sapContext->channel = 0 + * to perform the overlap checking, an invalid overlap + * channel con_ch could becreated. That may cause + * SAP start failed. + */ con_ch = sme_check_concurrent_channel_overlap(h_hal, sap_context->channel, sap_context->csr_roamProfile.phyMode, @@ -2245,7 +2255,8 @@ QDF_STATUS sap_goto_channel_sel(ptSapContext sap_context, #endif #ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH if (sap_context->cc_switch_mode != - QDF_MCC_TO_SCC_SWITCH_DISABLE) { + QDF_MCC_TO_SCC_SWITCH_DISABLE && + sap_context->channel) { QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_INFO, FL("check for overlap: chan:%d mode:%d"), sap_context->channel, @@ -2317,7 +2328,7 @@ QDF_STATUS sap_goto_channel_sel(ptSapContext sap_context, eCSR_SCAN_SOFTAP_CHANNEL_RANGE; sap_context->channelList = channel_list; - + sap_context->num_of_channel = num_of_channels; #endif /* Set requestType to Full scan */ @@ -2371,6 +2382,7 @@ QDF_STATUS sap_goto_channel_sel(ptSapContext sap_context, qdf_mem_free(sap_context-> channelList); sap_context->channelList = NULL; + sap_context->num_of_channel = 0; } #endif if (true == sap_do_acs_pre_start_bss) { @@ -2638,9 +2650,21 @@ static QDF_STATUS sap_goto_disconnecting(ptSapContext sapContext) static QDF_STATUS sap_roam_session_close_callback(void *pContext) { ptSapContext sapContext = (ptSapContext) pContext; - return sap_signal_hdd_event(sapContext, NULL, + QDF_STATUS status; + + status = wlansap_context_get(pContext); + if (status != QDF_STATUS_SUCCESS) { + QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_ERROR, + "%s: sap context has already been freed", __func__); + return status; + } + + status = sap_signal_hdd_event(sapContext, NULL, eSAP_STOP_BSS_EVENT, (void *) eSAP_STATUS_SUCCESS); + + wlansap_context_put(pContext); + return status; } /*========================================================================== @@ -2682,6 +2706,34 @@ static QDF_STATUS sap_goto_disconnected(ptSapContext sapContext) return qdf_status; } +#ifdef FEATURE_WLAN_AP_AP_ACS_OPTIMIZE +/** + * sap_handle_acs_scan_event() - handle acs scan event for SAP + * @sap_context: ptSapContext + * @sap_event: tSap_Event + * @status: status of acs scan + * + * The function is to handle the eSAP_ACS_SCAN_SUCCESS_EVENT event. + * + * Return: void + */ +static void sap_handle_acs_scan_event(ptSapContext sap_context, + tSap_Event *sap_event, eSapStatus status) +{ + sap_event->sapHddEventCode = eSAP_ACS_SCAN_SUCCESS_EVENT; + sap_event->sapevt.sap_acs_scan_comp.status = status; + sap_event->sapevt.sap_acs_scan_comp.num_of_channels = + sap_context->num_of_channel; + sap_event->sapevt.sap_acs_scan_comp.channellist = + sap_context->channelList; +} +#else +static void sap_handle_acs_scan_event(ptSapContext sap_context, + tSap_Event *sap_event, eSapStatus status) +{ +} +#endif + /** * sap_signal_hdd_event() - send event notification * @sap_ctx: Sap Context @@ -2785,14 +2837,14 @@ QDF_STATUS sap_signal_hdd_event(ptSapContext sap_ctx, case eSAP_DFS_RADAR_DETECT: case eSAP_DFS_RADAR_DETECT_DURING_PRE_CAC: case eSAP_DFS_NO_AVAILABLE_CHANNEL: -#ifdef FEATURE_WLAN_AP_AP_ACS_OPTIMIZE - case eSAP_ACS_SCAN_SUCCESS_EVENT: -#endif sap_ap_event.sapHddEventCode = sap_hddevent; sap_ap_event.sapevt.sapStopBssCompleteEvent.status = (eSapStatus) context; break; - + case eSAP_ACS_SCAN_SUCCESS_EVENT: + sap_handle_acs_scan_event(sap_ctx, &sap_ap_event, + (eSapStatus)context); + break; case eSAP_ACS_CHANNEL_SELECTED: sap_ap_event.sapHddEventCode = sap_hddevent; acs_selected = &sap_ap_event.sapevt.sap_ch_selected; diff --git a/core/sap/src/sap_internal.h b/core/sap/src/sap_internal.h index 22608eff91cc..1259ebbc7808 100644 --- a/core/sap/src/sap_internal.h +++ b/core/sap/src/sap_internal.h @@ -210,6 +210,7 @@ typedef struct sSapContext { uint32_t nStaAddIeLength; uint8_t pStaAddIE[MAX_ASSOC_IND_IE_LEN]; uint8_t *channelList; + uint8_t num_of_channel; tSapChannelListInfo SapChnlList; uint16_t ch_width_orig; struct ch_params_s ch_params; diff --git a/core/sap/src/sap_module.c b/core/sap/src/sap_module.c index ef5f63c2fdd2..ba469312d551 100644 --- a/core/sap/src/sap_module.c +++ b/core/sap/src/sap_module.c @@ -456,6 +456,8 @@ QDF_STATUS wlansap_close(void *pCtx) QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_INFO_HIGH, "wlansap_close"); + sap_cleanup_channel_list(pCtx); + /* empty queues/lists/pkts if any */ wlansap_clean_cb(pSapCtx, true); diff --git a/core/sme/inc/csr_api.h b/core/sme/inc/csr_api.h index 4cf951f67506..261d0e3de6e9 100644 --- a/core/sme/inc/csr_api.h +++ b/core/sme/inc/csr_api.h @@ -649,6 +649,7 @@ typedef enum { eCSR_DISCONNECT_REASON_IBSS_LEAVE, eCSR_DISCONNECT_REASON_STA_HAS_LEFT, eCSR_DISCONNECT_REASON_NDI_DELETE, + eCSR_DISCONNECT_REASON_ROAM_HO_FAIL, } eCsrRoamDisconnectReason; typedef enum { diff --git a/core/sme/inc/csr_internal.h b/core/sme/inc/csr_internal.h index a9e1896c1641..835d352f5c50 100644 --- a/core/sme/inc/csr_internal.h +++ b/core/sme/inc/csr_internal.h @@ -406,6 +406,7 @@ typedef struct tagRoamCmd { bool fStopWds; tSirMacAddr peerMac; tSirMacReasonCodes reason; + eCsrRoamDisconnectReason disconnect_reason; } tRoamCmd; typedef struct tagSetKeyCmd { @@ -1000,6 +1001,7 @@ typedef struct tagCsrRoamSession { bool supported_nss_1x1; bool disable_hi_rssi; bool dhcp_done; + uint8_t disconnect_reason; } tCsrRoamSession; typedef struct tagCsrRoamStruct { diff --git a/core/sme/inc/sme_api.h b/core/sme/inc/sme_api.h index 3990ebab984b..216d032ae0b6 100644 --- a/core/sme/inc/sme_api.h +++ b/core/sme/inc/sme_api.h @@ -1327,4 +1327,26 @@ QDF_STATUS sme_encrypt_decrypt_msg(tHalHandle hal, QDF_STATUS sme_set_cts2self_for_p2p_go(tHalHandle hal); void sme_set_prefer_80MHz_over_160MHz(tHalHandle hal, bool sta_prefer_80MHz_over_160MHz); +QDF_STATUS sme_update_tx_fail_cnt_threshold(tHalHandle hal_handle, + uint8_t session_id, uint32_t tx_fail_count); +QDF_STATUS sme_update_short_retry_limit_threshold(tHalHandle hal_handle, + struct sme_short_retry_limit *short_retry_limit_th); +QDF_STATUS sme_update_long_retry_limit_threshold(tHalHandle hal_handle, + struct sme_long_retry_limit *long_retry_limit_th); + +/** + * sme_update_sta_inactivity_timeout(): Update sta_inactivity_timeout to FW + * @hal: Handle returned by mac_open + * @sta_inactivity_timer: struct for sta inactivity timer + * + * If a station does not send anything in sta_inactivity_timeout seconds, an + * empty data frame is sent to it in order to verify whether it is + * still in range. If this frame is not ACKed, the station will be + * disassociated and then deauthenticated. + * + * Return: QDF_STATUS_SUCCESS or non-zero on failure. +*/ +QDF_STATUS sme_update_sta_inactivity_timeout(tHalHandle hal_handle, + struct sme_sta_inactivity_timeout *sta_inactivity_timer); + #endif /* #if !defined( __SME_API_H ) */ diff --git a/core/sme/src/common/sme_api.c b/core/sme/src/common/sme_api.c index 6ba4d8a89717..3c756e7278fa 100644 --- a/core/sme/src/common/sme_api.c +++ b/core/sme/src/common/sme_api.c @@ -7837,48 +7837,45 @@ sme_handle_generic_change_country_code(tpAniSirGlobal mac_ctx, { QDF_STATUS status = QDF_STATUS_SUCCESS; v_REGDOMAIN_t reg_domain_id = 0; - bool supplicant_priority = + bool user_ctry_priority = mac_ctx->roam.configParam.fSupplicantCountryCodeHasPriority; tAniGenericChangeCountryCodeReq *msg = pMsgBuf; sms_log(mac_ctx, LOG1, FL(" called")); - /* Set the country code given by userspace when 11dOriginal is false - * when 11doriginal is True,is_11d_country =0 and - * fSupplicantCountryCodeHasPriority = 0, then revert the country code, - * and return failure - */ - if (mac_ctx->roam.configParam.Is11dSupportEnabledOriginal == true - && !mac_ctx->is_11d_hint && !supplicant_priority) { - sms_log(mac_ctx, LOGW, - FL("Incorrect country req, nullify this")); + if (!mac_ctx->is_11d_hint) { + if (user_ctry_priority) + mac_ctx->roam.configParam.Is11dSupportEnabled = false; + else { + if (mac_ctx->roam.configParam.Is11dSupportEnabled && + mac_ctx->scan.countryCode11d[0] != 0) { - /* we have got a request for a country that should not have been - * added since the STA is associated; nullify this request. If - * both countryCode11d[0] and countryCode11d[1] are zero, revert - * it to World domain to avoid from causing cfg80211 call trace. - */ - if ((mac_ctx->scan.countryCode11d[0] == 0) - && (mac_ctx->scan.countryCode11d[1] == 0)) - status = csr_get_regulatory_domain_for_country(mac_ctx, - "00", (v_REGDOMAIN_t *) ®_domain_id, - SOURCE_11D); - else - status = csr_get_regulatory_domain_for_country(mac_ctx, + sms_log(mac_ctx, LOGW, + FL("restore 11d")); + + status = csr_get_regulatory_domain_for_country( + mac_ctx, mac_ctx->scan.countryCode11d, - (v_REGDOMAIN_t *) ®_domain_id, + ®_domain_id, SOURCE_11D); - return QDF_STATUS_E_FAILURE; + return QDF_STATUS_E_FAILURE; + } + } + } else { + /* if kernel gets invalid country code; it + * resets the country code to world + */ + if (('0' != msg->countryCode[0]) || + ('0' != msg->countryCode[1])) + qdf_mem_copy(mac_ctx->scan.countryCode11d, + msg->countryCode, + WNI_CFG_COUNTRY_CODE_LEN); + mac_ctx->is_11d_hint = false; } - /* if Supplicant country code has priority, disable 11d */ - if (supplicant_priority && !mac_ctx->is_11d_hint) - mac_ctx->roam.configParam.Is11dSupportEnabled = false; - - qdf_mem_copy(mac_ctx->scan.countryCode11d, msg->countryCode, - WNI_CFG_COUNTRY_CODE_LEN); - qdf_mem_copy(mac_ctx->scan.countryCodeCurrent, msg->countryCode, + qdf_mem_copy(mac_ctx->scan.countryCodeCurrent, + msg->countryCode, WNI_CFG_COUNTRY_CODE_LEN); /* get the channels based on new cc */ @@ -7888,21 +7885,19 @@ sme_handle_generic_change_country_code(tpAniSirGlobal mac_ctx, sms_log(mac_ctx, LOGE, FL("fail to get Channels")); return status; } + /* reset info based on new cc, and we are done */ csr_apply_channel_power_info_wrapper(mac_ctx); - /* Country code Changed, Purge Only scan result - * which does not have channel number belong to 11d - * channel list - */ csr_scan_filter_results(mac_ctx); - /* Do active scans after the country is set by User hints or + + /* scans after the country is set by User hints or * Country IE */ mac_ctx->scan.curScanType = eSIR_ACTIVE_SCAN; - mac_ctx->is_11d_hint = false; sme_disconnect_connected_sessions(mac_ctx); + sms_log(mac_ctx, LOG1, FL(" returned")); return QDF_STATUS_SUCCESS; } @@ -12034,33 +12029,6 @@ QDF_STATUS sme_set_ht2040_mode(tHalHandle hHal, uint8_t sessionId, return status; } -/* --------------------------------------------------------------------------- - - \fn sme_set_phy_cb_mode24_g - - \brief Changes PHY channel bonding mode - - \param hHal - The handle returned by mac_open. - - \param cbMode new channel bonding mode which is to set - - \return QDF_STATUS SUCCESS. - - -------------------------------------------------------------------------------*/ -QDF_STATUS sme_set_phy_cb_mode24_g(tHalHandle hHal, ePhyChanBondState phyCBMode) -{ - tpAniSirGlobal pMac = PMAC_STRUCT(hHal); - - if (NULL == pMac) { - QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_ERROR, - "%s: invalid context", __func__); - return QDF_STATUS_E_FAILURE; - } - - pMac->roam.configParam.channelBondingMode24GHz = phyCBMode; - - return QDF_STATUS_SUCCESS; -} #endif /* @@ -12261,6 +12229,140 @@ QDF_STATUS sme_update_access_policy_vendor_ie(tHalHandle hal, } /** + * sme_update_short_retry_limit_threshold() - update short frame retry limit TH + * @hal: Handle returned by mac_open + * @session_id: Session ID on which short frame retry limit needs to be + * updated to FW + * @short_limit_count_th: Retry count TH to retry short frame. + * + * This function is used to configure count to retry short frame. + * + * Return: QDF_STATUS + */ +QDF_STATUS sme_update_short_retry_limit_threshold(tHalHandle hal_handle, + struct sme_short_retry_limit *short_retry_limit_th) +{ + tpAniSirGlobal mac_ctx = PMAC_STRUCT(hal_handle); + QDF_STATUS status = QDF_STATUS_SUCCESS; + struct sme_short_retry_limit *srl; + cds_msg_t msg; + + srl = qdf_mem_malloc(sizeof(*srl)); + if (NULL == srl) { + QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_ERROR, + "%s: fail to alloc short retry limit", __func__); + return QDF_STATUS_E_FAILURE; + } + sms_log(mac_ctx, LOG1, FL("session_id %d short retry limit count: %d"), + short_retry_limit_th->session_id, + short_retry_limit_th->short_retry_limit); + + srl->session_id = short_retry_limit_th->session_id; + srl->short_retry_limit = short_retry_limit_th->short_retry_limit; + + qdf_mem_zero(&msg, sizeof(msg)); + msg.type = SIR_HAL_SHORT_RETRY_LIMIT_CNT; + msg.reserved = 0; + msg.bodyptr = srl; + status = cds_mq_post_message(QDF_MODULE_ID_WMA, &msg); + if (status != QDF_STATUS_SUCCESS) { + QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_ERROR, + FL("Not able to post short retry limit count to WDA")); + qdf_mem_free(srl); + return QDF_STATUS_E_FAILURE; + } + + return status; +} + +/** + * sme_update_long_retry_limit_threshold() - update long retry limit TH + * @hal: Handle returned by mac_open + * @session_id: Session ID on which long frames retry TH needs to be updated + * to FW + * @long_limit_count_th: Retry count to retry long frame. + * + * This function is used to configure TH to retry long frame. + * + * Return: QDF_STATUS +*/ +QDF_STATUS sme_update_long_retry_limit_threshold(tHalHandle hal_handle, + struct sme_long_retry_limit *long_retry_limit_th) +{ + tpAniSirGlobal mac_ctx = PMAC_STRUCT(hal_handle); + QDF_STATUS status = QDF_STATUS_SUCCESS; + struct sme_long_retry_limit *lrl; + cds_msg_t msg; + + lrl = qdf_mem_malloc(sizeof(*lrl)); + if (NULL == lrl) { + QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_ERROR, + "%s: fail to alloc long retry limit", __func__); + return QDF_STATUS_E_FAILURE; + } + sms_log(mac_ctx, LOG1, FL("session_id %d long retry limit count: %d"), + long_retry_limit_th->session_id, + long_retry_limit_th->long_retry_limit); + + lrl->session_id = long_retry_limit_th->session_id; + lrl->long_retry_limit = long_retry_limit_th->long_retry_limit; + + qdf_mem_zero(&msg, sizeof(msg)); + msg.type = SIR_HAL_LONG_RETRY_LIMIT_CNT; + msg.reserved = 0; + msg.bodyptr = lrl; + status = cds_mq_post_message(QDF_MODULE_ID_WMA, &msg); + + if (status != QDF_STATUS_SUCCESS) { + QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_ERROR, + FL("Not able to post long retry limit count to WDA")); + qdf_mem_free(lrl); + return QDF_STATUS_E_FAILURE; + } + + return status; +} + +/** + * sme_update_sta_inactivity_timeout(): Update sta_inactivity_timeout to FW + * @hal: Handle returned by mac_open + * @session_id: Session ID on which sta_inactivity_timeout needs + * to be updated to FW + * @sta_inactivity_timeout: sta inactivity timeout. + * + * If a station does not send anything in sta_inactivity_timeout seconds, an + * empty data frame is sent to it in order to verify whether it is + * still in range. If this frame is not ACKed, the station will be + * disassociated and then deauthenticated. + * + * Return: QDF_STATUS_SUCCESS or non-zero on failure. +*/ +QDF_STATUS sme_update_sta_inactivity_timeout(tHalHandle hal_handle, + struct sme_sta_inactivity_timeout *sta_inactivity_timer) +{ + struct sme_sta_inactivity_timeout *inactivity_time; + void *wma_handle; + + wma_handle = cds_get_context(QDF_MODULE_ID_WMA); + inactivity_time = qdf_mem_malloc(sizeof(*inactivity_time)); + if (NULL == inactivity_time) { + QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_ERROR, + "%s: fail to alloc inactivity_time", __func__); + return QDF_STATUS_E_FAILURE; + } + QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_INFO, + FL("sta_inactivity_timeout: %d"), + sta_inactivity_timer->sta_inactivity_timeout); + inactivity_time->session_id = sta_inactivity_timer->session_id; + inactivity_time->sta_inactivity_timeout = + sta_inactivity_timer->sta_inactivity_timeout; + + wma_update_sta_inactivity_timeout(wma_handle, + inactivity_time); + return QDF_STATUS_SUCCESS; +} + +/** * sme_get_reg_info() - To get registration info * @hHal: HAL context * @chanId: channel id @@ -16805,3 +16907,49 @@ QDF_STATUS sme_set_cts2self_for_p2p_go(tHalHandle hal_handle) } return QDF_STATUS_SUCCESS; } +/** + * sme_update_tx_fail_cnt_threshold() - update tx fail count Threshold + * @hal: Handle returned by mac_open + * @session_id: Session ID on which tx fail count needs to be updated to FW + * @tx_fail_count: Count for tx fail threshold after which FW will disconnect + * + * This function is used to set tx fail count threshold to firmware. + * firmware will issue disocnnect with peer device once this threshold is + * reached. + * + * Return: Return QDF_STATUS, otherwise appropriate failure code + */ +QDF_STATUS sme_update_tx_fail_cnt_threshold(tHalHandle hal_handle, + uint8_t session_id, uint32_t tx_fail_count) +{ + tpAniSirGlobal mac_ctx = PMAC_STRUCT(hal_handle); + QDF_STATUS status = QDF_STATUS_E_FAILURE; + struct sme_tx_fail_cnt_threshold *tx_fail_cnt; + cds_msg_t msg; + + tx_fail_cnt = qdf_mem_malloc(sizeof(*tx_fail_cnt)); + if (NULL == tx_fail_cnt) { + QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_ERROR, + "%s: fail to alloc filter_param", __func__); + return QDF_STATUS_E_FAILURE; + } + sms_log(mac_ctx, LOG1, + FL("session_id %d tx_fail_count: %d"), + session_id, tx_fail_count); + tx_fail_cnt->session_id = session_id; + tx_fail_cnt->tx_fail_cnt_threshold = tx_fail_count; + + qdf_mem_zero(&msg, sizeof(cds_msg_t)); + msg.type = SIR_HAL_UPDATE_TX_FAIL_CNT_TH; + msg.reserved = 0; + msg.bodyptr = tx_fail_cnt; + status = cds_mq_post_message(QDF_MODULE_ID_WMA, &msg); + + if (!QDF_IS_STATUS_SUCCESS(status)) { + QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_ERROR, + FL("Not able to post Tx fail count message to WDA")); + qdf_mem_free(tx_fail_cnt); + } + + return status; +} diff --git a/core/sme/src/common/sme_ft_api.c b/core/sme/src/common/sme_ft_api.c index 0ab104f00ea5..e8c5aa87fc94 100644 --- a/core/sme/src/common/sme_ft_api.c +++ b/core/sme/src/common/sme_ft_api.c @@ -301,7 +301,7 @@ QDF_STATUS sme_ft_send_update_key_ind(tHalHandle hal, uint32_t session_id, keymaterial->key[0].paeRole = ftkey_info->paeRole; keymaterial->key[0].keyLength = ftkey_info->keyLength; - if (ftkey_info->keyLength && ftkey_info->Key) { + if (ftkey_info->keyLength) { qdf_mem_copy(&keymaterial->key[0].key, ftkey_info->Key, ftkey_info->keyLength); if (ftkey_info->keyLength == 16) { diff --git a/core/sme/src/csr/csr_api_roam.c b/core/sme/src/csr/csr_api_roam.c index d9bbd0bda24d..51633530ec6e 100644 --- a/core/sme/src/csr/csr_api_roam.c +++ b/core/sme/src/csr/csr_api_roam.c @@ -5670,6 +5670,8 @@ QDF_STATUS csr_roam_process_command(tpAniSirGlobal pMac, tSmeCmd *pCommand) sms_log(pMac, LOG1, FL("Roam Reason : %d, sessionId: %d"), pCommand->u.roamCmd.roamReason, sessionId); + pSession->disconnect_reason = pCommand->u.roamCmd.disconnect_reason; + switch (pCommand->u.roamCmd.roamReason) { case eCsrForcedDisassoc: if (eCSR_ROAMING_STATE_IDLE == pMac->roam.curState[sessionId]) { @@ -5678,7 +5680,6 @@ QDF_STATUS csr_roam_process_command(tpAniSirGlobal pMac, tSmeCmd *pCommand) " %d"), eCSR_ROAMING_STATE_IDLE); return QDF_STATUS_E_FAILURE; } - status = csr_roam_process_disassoc_deauth(pMac, pCommand, true, false); csr_free_roam_profile(pMac, sessionId); @@ -7431,7 +7432,7 @@ QDF_STATUS csr_roam_copy_connected_profile(tpAniSirGlobal pMac, pDstProfile->BSSIDs.numOfBSSIDs = 1; qdf_copy_macaddr(pDstProfile->BSSIDs.bssid, &pSrcProfile->bssid); - if (pSrcProfile->SSID.ssId) { + if (pSrcProfile->SSID.length > 0) { pDstProfile->SSIDs.SSIDList = qdf_mem_malloc(sizeof(tCsrSSIDInfo)); if (NULL == pDstProfile->SSIDs.SSIDList) { @@ -8218,6 +8219,9 @@ QDF_STATUS csr_roam_issue_disassociate_cmd(tpAniSirGlobal pMac, uint32_t session case eCSR_DISCONNECT_REASON_DISASSOC: pCommand->u.roamCmd.roamReason = eCsrForcedDisassoc; break; + case eCSR_DISCONNECT_REASON_ROAM_HO_FAIL: + pCommand->u.roamCmd.roamReason = eCsrForcedDisassoc; + break; case eCSR_DISCONNECT_REASON_IBSS_JOIN_FAILURE: pCommand->u.roamCmd.roamReason = eCsrSmeIssuedIbssJoinFailure; @@ -8239,6 +8243,7 @@ QDF_STATUS csr_roam_issue_disassociate_cmd(tpAniSirGlobal pMac, uint32_t session default: break; } + pCommand->u.roamCmd.disconnect_reason = reason; status = csr_queue_sme_command(pMac, pCommand, true); if (!QDF_IS_STATUS_SUCCESS(status)) { sms_log(pMac, LOGE, @@ -14561,6 +14566,8 @@ QDF_STATUS csr_send_mb_disassoc_req_msg(tpAniSirGlobal pMac, uint32_t sessionId, bssId, QDF_MAC_ADDR_SIZE); } pMsg->reasonCode = reasonCode; + pMsg->process_ho_fail = (pSession->disconnect_reason == + eCSR_DISCONNECT_REASON_ROAM_HO_FAIL) ? true : false; /* * The state will be DISASSOC_HANDOFF only when we are doing * handoff. Here we should not send the disassoc over the air @@ -18877,7 +18884,8 @@ void csr_process_ho_fail_ind(tpAniSirGlobal pMac, void *pMsgBuf) eCSR_REASON_ROAM_HO_FAIL); QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_ERROR, "LFR3:Issue Disconnect on session %d", sessionId); - csr_roam_disconnect(pMac, sessionId, eCSR_DISCONNECT_REASON_UNSPECIFIED); + csr_roam_disconnect(pMac, sessionId, + eCSR_DISCONNECT_REASON_ROAM_HO_FAIL); } #endif /* WLAN_FEATURE_ROAM_OFFLOAD */ diff --git a/core/sme/src/csr/csr_api_scan.c b/core/sme/src/csr/csr_api_scan.c index fa72e875a92e..9d15c3ed54a6 100644 --- a/core/sme/src/csr/csr_api_scan.c +++ b/core/sme/src/csr/csr_api_scan.c @@ -2851,8 +2851,8 @@ static void csr_purge_old_scan_results(tpAniSirGlobal mac_ctx) { tListElem *pentry, *tmp_entry; tCsrScanResult *presult, *oldest_bss = NULL; - uint32_t oldest_entry = 0; - uint32_t curr_time = qdf_mc_timer_get_system_ticks(); + uint64_t oldest_entry = 0; + uint64_t curr_time = (uint64_t)qdf_mc_timer_get_system_time(); csr_ll_unlock(&mac_ctx->scan.scanResultList); pentry = csr_ll_peek_head(&mac_ctx->scan.scanResultList, @@ -2861,10 +2861,10 @@ static void csr_purge_old_scan_results(tpAniSirGlobal mac_ctx) tmp_entry = csr_ll_next(&mac_ctx->scan.scanResultList, pentry, LL_ACCESS_NOLOCK); presult = GET_BASE_ADDR(pentry, tCsrScanResult, Link); - if ((curr_time - presult->Result.BssDescriptor.nReceivedTime) > + if ((curr_time - presult->Result.BssDescriptor.received_time) > oldest_entry) { oldest_entry = curr_time - - presult->Result.BssDescriptor.nReceivedTime; + presult->Result.BssDescriptor.received_time; oldest_bss = presult; } pentry = tmp_entry; @@ -2874,9 +2874,9 @@ static void csr_purge_old_scan_results(tpAniSirGlobal mac_ctx) if (csr_ll_remove_entry(&mac_ctx->scan.scanResultList, &oldest_bss->Link, LL_ACCESS_NOLOCK)) { sms_log(mac_ctx, LOG1, - FL("Current time delta (%d) of BSSID to be removed" MAC_ADDRESS_STR), + FL("Current time delta (%llu) of BSSID to be removed" MAC_ADDRESS_STR), (curr_time - - oldest_bss->Result.BssDescriptor.nReceivedTime), + oldest_bss->Result.BssDescriptor.received_time), MAC_ADDR_ARRAY( oldest_bss->Result.BssDescriptor.bssId)); csr_free_scan_result_entry(mac_ctx, oldest_bss); @@ -2954,8 +2954,9 @@ csr_remove_from_tmp_list(tpAniSirGlobal mac_ctx, * hidden ssid from the profile i.e., forget the SSID * via GUI that SSID shouldn't see in the profile */ - unsigned long time_gap = qdf_mc_timer_get_system_time() - - timer; + uint64_t time_gap = + (uint64_t)qdf_mc_timer_get_system_time() - + timer; if ((0 == bss_dscp->Result.ssId.length) && (time_gap <= HIDDEN_TIMER) && tmpSsid.length) { @@ -3089,7 +3090,7 @@ tCsrScanResult *csr_scan_append_bss_description(tpAniSirGlobal pMac, * hidden ssid from the profile i.e., forget the SSID * via GUI that SSID shouldn't see in the profile */ - if ((qdf_mc_timer_get_system_time() - timer) <= + if (((uint64_t)qdf_mc_timer_get_system_time() - timer) <= HIDDEN_TIMER) { pCsrBssDescription->Result.ssId = tmpSsid; pCsrBssDescription->Result.timer = timer; @@ -3702,9 +3703,13 @@ bool csr_learn_11dcountry_information(tpAniSirGlobal pMac, else pCountryCodeSelected = pMac->scan.countryCodeElected; - if (qdf_mem_cmp(pCountryCodeSelected, pMac->scan.countryCode11d, - CDS_COUNTRY_CODE_LEN) == 0) + if (qdf_mem_cmp(pCountryCodeSelected, pMac->scan.countryCodeCurrent, + CDS_COUNTRY_CODE_LEN) == 0) { + qdf_mem_copy(pMac->scan.countryCode11d, + pMac->scan.countryCodeCurrent, + CDS_COUNTRY_CODE_LEN); goto free_ie; + } pMac->is_11d_hint = true; status = csr_get_regulatory_domain_for_country(pMac, @@ -3715,9 +3720,6 @@ bool csr_learn_11dcountry_information(tpAniSirGlobal pMac, goto free_ie; } - /* updating 11d Country Code with Country code selected. */ - qdf_mem_copy(pMac->scan.countryCode11d, pCountryCodeSelected, - WNI_CFG_COUNTRY_CODE_LEN); fRet = true; free_ie: if (!pIes && pIesLocal) { @@ -4874,8 +4876,8 @@ static bool csr_scan_age_out_bss(tpAniSirGlobal pMac, tCsrScanResult *pResult) FL("Connected BSS, Set Aging Count=%d for BSS " MAC_ADDRESS_STR), pResult->AgingCount, MAC_ADDR_ARRAY(pResult->Result.BssDescriptor.bssId)); - pResult->Result.BssDescriptor.nReceivedTime = - (uint32_t) qdf_mc_timer_get_system_ticks(); + pResult->Result.BssDescriptor.received_time = + (uint64_t)qdf_mc_timer_get_system_time(); return fRet; } /* @@ -5148,37 +5150,6 @@ send_scan_req: return status; } -QDF_STATUS csr_send_mb_scan_result_req(tpAniSirGlobal pMac, - uint32_t sessionId, - tScanReqParam *pScanReqParam) -{ - QDF_STATUS status = QDF_STATUS_SUCCESS; - tSirSmeScanReq *pMsg; - uint16_t msgLen; - - msgLen = (uint16_t) (sizeof(tSirSmeScanReq)); - pMsg = qdf_mem_malloc(msgLen); - if (NULL == pMsg) - return QDF_STATUS_E_NOMEM; - - pMsg->messageType = eWNI_SME_SCAN_REQ; - pMsg->length = msgLen; - pMsg->sessionId = sessionId; - pMsg->transactionId = 0; - pMsg->returnFreshResults = pScanReqParam->freshScan; - /* Always ask for unique result */ - pMsg->returnUniqueResults = pScanReqParam->fUniqueResult; - pMsg->returnAfterFirstMatch = - pScanReqParam->bReturnAfter1stMatch; - status = cds_send_mb_message_to_mac(pMsg); - if (!QDF_IS_STATUS_SUCCESS(status)) { - sms_log(pMac, LOGE, - FL("Failed to send down scan req with status = %d\n"), - status); - } - return status; -} - #ifdef FEATURE_WLAN_DIAG_SUPPORT_CSR static void csr_diag_scan_channels(tpAniSirGlobal pMac, tSmeCmd *pCommand) { @@ -5926,23 +5897,20 @@ static void csr_purge_scan_result_by_age(void *pv) tpAniSirGlobal mac_ctx = PMAC_STRUCT(pv); tListElem *entry, *tmp_entry; tCsrScanResult *result; - unsigned long ageout_time = - mac_ctx->scan.scanResultCfgAgingTime * QDF_TICKS_PER_SECOND/10; - unsigned long cur_time = qdf_mc_timer_get_system_ticks(); + uint64_t ageout_time = + mac_ctx->scan.scanResultCfgAgingTime * SYSTEM_TIME_SEC_TO_MSEC; + uint64_t cur_time = qdf_mc_timer_get_system_time(); uint8_t *bssId; csr_ll_lock(&mac_ctx->scan.scanResultList); entry = csr_ll_peek_head(&mac_ctx->scan.scanResultList, LL_ACCESS_NOLOCK); - sms_log(mac_ctx, LOG1, FL(" Ageout time=%ld"), ageout_time); + sms_log(mac_ctx, LOG1, FL(" Ageout time=%llu"), ageout_time); while (entry) { tmp_entry = csr_ll_next(&mac_ctx->scan.scanResultList, entry, LL_ACCESS_NOLOCK); result = GET_BASE_ADDR(entry, tCsrScanResult, Link); - /* - * qdf_mc_timer_get_system_ticks() returns in 10ms interval. - * so ageout time value also updated to 10ms interval value. - */ - if ((cur_time - result->Result.BssDescriptor.nReceivedTime) > + + if ((cur_time - result->Result.BssDescriptor.received_time) > ageout_time) { bssId = result->Result.BssDescriptor.bssId; sms_log(mac_ctx, LOGW, @@ -7063,7 +7031,7 @@ QDF_STATUS csr_scan_save_preferred_network_found(tpAniSirGlobal pMac, pBssDescr->capabilityInfo = *((uint16_t *)&parsed_frm->capabilityInfo); qdf_mem_copy((uint8_t *) &pBssDescr->bssId, (uint8_t *) macHeader->bssId, sizeof(tSirMacAddr)); - pBssDescr->nReceivedTime = (uint32_t) qdf_mc_timer_get_system_ticks(); + pBssDescr->received_time = (uint64_t)qdf_mc_timer_get_system_time(); sms_log(pMac, LOG2, FL("Bssid= "MAC_ADDRESS_STR" chan= %d, rssi = %d"), MAC_ADDR_ARRAY(pBssDescr->bssId), pBssDescr->channelId, pBssDescr->rssi); diff --git a/core/sme/src/csr/csr_host_scan_roam.c b/core/sme/src/csr/csr_host_scan_roam.c index def107552ff4..cfe5cbc431d8 100644 --- a/core/sme/src/csr/csr_host_scan_roam.c +++ b/core/sme/src/csr/csr_host_scan_roam.c @@ -149,9 +149,7 @@ void csr_neighbor_roam_process_scan_results(tpAniSirGlobal mac_ctx, tpCsrNeighborRoamControlInfo n_roam_info = &mac_ctx->roam.neighborRoamInfo[sessionid]; tpCsrNeighborRoamBSSInfo bss_info; - uint32_t age_ticks = 0; - uint32_t limit_ticks = - qdf_system_msecs_to_ticks(ROAM_AP_AGE_LIMIT_MS); + uint64_t age = 0; uint8_t num_candidates = 0; uint8_t num_dropped = 0; /* @@ -296,9 +294,10 @@ void csr_neighbor_roam_process_scan_results(tpAniSirGlobal mac_ctx, } /* check the age of the AP */ - age_ticks = (uint32_t) qdf_mc_timer_get_system_ticks() - - descr->nReceivedTime; - if (age_constraint == true && age_ticks > limit_ticks) { + age = (uint64_t) qdf_mc_timer_get_system_time() - + descr->received_time; + if (age_constraint == true && + age > ROAM_AP_AGE_LIMIT_MS) { num_dropped++; QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_WARN, diff --git a/core/sme/src/csr/csr_inside_api.h b/core/sme/src/csr/csr_inside_api.h index 03338de19033..47470725407d 100644 --- a/core/sme/src/csr/csr_inside_api.h +++ b/core/sme/src/csr/csr_inside_api.h @@ -66,6 +66,7 @@ #define CSR_MAX_BSS_SUPPORT 512 #define SYSTEM_TIME_MSEC_TO_USEC 1000 +#define SYSTEM_TIME_SEC_TO_MSEC 1000 /* This number minus 1 means the number of times a channel is scanned before a BSS is remvoed from */ /* cache scan result */ diff --git a/core/sme/src/rrm/sme_rrm.c b/core/sme/src/rrm/sme_rrm.c index b73c016176cc..11d3f69cb208 100644 --- a/core/sme/src/rrm/sme_rrm.c +++ b/core/sme/src/rrm/sme_rrm.c @@ -71,7 +71,7 @@ #define RRM_ROAM_SCORE_NEIGHBOR_IAPP_LIST 30 #endif -unsigned long rrm_scan_timer; +uint64_t rrm_scan_timer; /** * rrm_ll_purge_neighbor_cache() -Purges all the entries in the neighbor cache @@ -529,7 +529,7 @@ static QDF_STATUS sme_rrm_send_scan_result(tpAniSirGlobal mac_ctx, while (scan_results) { next_result = sme_scan_result_get_next(mac_ctx, result_handle); - sms_log(mac_ctx, LOG1, "Scan res timer:%lu, rrm scan timer:%lu", + sms_log(mac_ctx, LOG1, "Scan res timer:%lu, rrm scan timer:%llu", scan_results->timer, rrm_scan_timer); if (scan_results->timer >= rrm_scan_timer) { roam_info->pBssDesc = &scan_results->BssDescriptor; @@ -651,7 +651,7 @@ static QDF_STATUS sme_rrm_issue_scan_req(tpAniSirGlobal mac_ctx) tpRrmSMEContext sme_rrm_ctx = &mac_ctx->rrm.rrmSmeContext; uint32_t session_id; tSirScanType scan_type; - unsigned long current_time; + uint64_t current_time; status = csr_roam_get_session_id_from_bssid(mac_ctx, &sme_rrm_ctx->sessionBssId, &session_id); @@ -720,8 +720,8 @@ static QDF_STATUS sme_rrm_issue_scan_req(tpAniSirGlobal mac_ctx) * and hence there is a check to see if the requests are atleast * 1 second apart. */ - current_time = qdf_mc_timer_get_system_time(); - sms_log(mac_ctx, LOG1, "prev scan triggered before %ld ms, totalchannels %d", + current_time = (uint64_t)qdf_mc_timer_get_system_time(); + sms_log(mac_ctx, LOG1, "prev scan triggered before %llu ms, totalchannels %d", current_time - rrm_scan_timer, sme_rrm_ctx->channelList.numOfChannels); if ((abs(current_time - rrm_scan_timer) > 1000) && @@ -731,7 +731,7 @@ static QDF_STATUS sme_rrm_issue_scan_req(tpAniSirGlobal mac_ctx) scan_req.idle_time = 1; } - rrm_scan_timer = qdf_mc_timer_get_system_time(); + rrm_scan_timer = (uint64_t)qdf_mc_timer_get_system_time(); /* set BSSType to default type */ scan_req.BSSType = eCSR_BSS_TYPE_ANY; diff --git a/core/utils/epping/src/epping_tx.c b/core/utils/epping/src/epping_tx.c index c7acddc9320e..5cfe3d1a57de 100644 --- a/core/utils/epping/src/epping_tx.c +++ b/core/utils/epping/src/epping_tx.c @@ -183,6 +183,7 @@ void epping_tx_timer_expire(epping_adapter_t *pAdapter) /* try to flush nodrop queue */ while ((nodrop_skb = qdf_nbuf_queue_remove(&pAdapter->nodrop_queue))) { + htc_set_nodrop_pkt(pAdapter->pEpping_ctx->HTCHandle, true); if (epping_tx_send_int(nodrop_skb, pAdapter)) { EPPING_LOG(QDF_TRACE_LEVEL_FATAL, "%s: nodrop: %p xmit fail in timer\n", @@ -192,6 +193,7 @@ void epping_tx_timer_expire(epping_adapter_t *pAdapter) nodrop_skb); break; } else { + htc_set_nodrop_pkt(pAdapter->pEpping_ctx->HTCHandle, false); EPPING_LOG(QDF_TRACE_LEVEL_INFO, "%s: nodrop: %p xmit ok in timer\n", __func__, nodrop_skb); @@ -253,6 +255,7 @@ int epping_tx_send(qdf_nbuf_t skb, epping_adapter_t *pAdapter) /* check the nodrop queue first */ while ((nodrop_skb = qdf_nbuf_queue_remove(&pAdapter->nodrop_queue))) { + htc_set_nodrop_pkt(pAdapter->pEpping_ctx->HTCHandle, true); if (epping_tx_send_int(nodrop_skb, pAdapter)) { EPPING_LOG(QDF_TRACE_LEVEL_FATAL, "%s: nodrop: %p xmit fail\n", __func__, @@ -263,6 +266,7 @@ int epping_tx_send(qdf_nbuf_t skb, epping_adapter_t *pAdapter) /* no cookie so free the current skb */ goto tx_fail; } else { + htc_set_nodrop_pkt(pAdapter->pEpping_ctx->HTCHandle, false); EPPING_LOG(QDF_TRACE_LEVEL_INFO, "%s: nodrop: %p xmit ok\n", __func__, nodrop_skb); @@ -303,11 +307,11 @@ tx_fail: #ifdef HIF_SDIO HTC_SEND_FULL_ACTION epping_tx_queue_full(void *Context, HTC_PACKET *pPacket) { - epping_context_t *pEpping_ctx = (epping_context_t *) Context; - epping_adapter_t *pAdapter = pEpping_ctx->epping_adapter; - HTC_SEND_FULL_ACTION action = HTC_SEND_FULL_KEEP; - netif_stop_queue(pAdapter->dev); - return action; + /* + * Call netif_stop_queue frequently will impact the mboxping tx t-put. + * Return HTC_SEND_FULL_KEEP directly in epping_tx_queue_full to avoid. + */ + return HTC_SEND_FULL_KEEP; } #endif /* HIF_SDIO */ void epping_tx_complete_multiple(void *ctx, HTC_PACKET_QUEUE *pPacketQueue) diff --git a/core/utils/logging/src/wlan_logging_sock_svc.c b/core/utils/logging/src/wlan_logging_sock_svc.c index cbd8c8f36219..f8886a86a9d2 100644 --- a/core/utils/logging/src/wlan_logging_sock_svc.c +++ b/core/utils/logging/src/wlan_logging_sock_svc.c @@ -1331,6 +1331,8 @@ static void send_packetdump(qdf_nbuf_t netbuf, uint8_t status, return; adapter = hdd_get_adapter_by_vdev(hdd_ctx, vdev_id); + if (!adapter) + return; /* Send packet dump only for STA interface */ if (adapter->device_mode != QDF_STA_MODE) diff --git a/core/wma/inc/wma.h b/core/wma/inc/wma.h index bda463e010c6..a01d33fa55f0 100644 --- a/core/wma/inc/wma.h +++ b/core/wma/inc/wma.h @@ -183,7 +183,6 @@ #define WMA_IPV6_PROTO_GET_MIN_LEN 21 #define WMA_IPV6_PKT_INFO_GET_MIN_LEN 62 #define WMA_ICMPV6_SUBTYPE_GET_MIN_LEN 55 - /** * ds_mode: distribution system mode * @IEEE80211_NO_DS: NO DS at either side @@ -388,6 +387,7 @@ enum ds_mode { #define WMA_NEXT_20MHZ_START_CH_DIFF 4 #define WMA_DEFAULT_HW_MODE_INDEX 0xFFFF +#define TWO_THIRD (2/3) /** * WMA hardware mode list bit-mask definitions. @@ -493,7 +493,7 @@ typedef struct probeTime_dwellTime { static const t_probeTime_dwellTime probe_time_dwell_time_map[WMA_DWELL_TIME_PROBE_TIME_MAP_SIZE] = { - {28, 0}, /* 0 SSID */ + {28, 11}, /* 0 SSID */ {28, 20}, /* 1 SSID */ {28, 20}, /* 2 SSID */ {28, 20}, /* 3 SSID */ @@ -1061,7 +1061,6 @@ struct wma_txrx_node { int8_t max_tx_power; uint32_t nwType; void *staKeyParams; - bool ps_enabled; uint32_t dtim_policy; uint32_t peer_count; bool roam_synch_in_progress; @@ -2196,7 +2195,6 @@ void ieee80211_mark_dfs(struct ieee80211com *ic, struct dfs_ieee80211_channel *ichan); int wma_dfs_indicate_radar(struct ieee80211com *ic, struct dfs_ieee80211_channel *ichan); -uint16_t dfs_usenol(struct ieee80211com *ic); QDF_STATUS wma_trigger_uapsd_params(tp_wma_handle wma_handle, uint32_t vdev_id, tp_wma_trigger_uapsd_params @@ -2335,3 +2333,5 @@ void wma_register_packetdump_callback( tp_wma_packetdump_cb wma_mgmt_tx_packetdump_cb, tp_wma_packetdump_cb wma_mgmt_rx_packetdump_cb); void wma_deregister_packetdump_callback(void); +void wma_update_sta_inactivity_timeout(tp_wma_handle wma, + struct sme_sta_inactivity_timeout *sta_inactivity_timer); diff --git a/core/wma/inc/wma_internal.h b/core/wma/inc/wma_internal.h index a35254ae321b..67579e0b06b8 100644 --- a/core/wma/inc/wma_internal.h +++ b/core/wma/inc/wma_internal.h @@ -597,6 +597,8 @@ int32_t wma_find_vdev_by_type(tp_wma_handle wma, int32_t type); void wma_set_vdev_intrabss_fwd(tp_wma_handle wma_handle, tpDisableIntraBssFwd pdis_intra_fwd); +void wma_delete_bss_ho_fail(tp_wma_handle wma, tpDeleteBssParams params); + /* * wma_mgmt.c functions declarations */ @@ -1169,13 +1171,6 @@ struct dfs_ieee80211_channel *wma_dfs_configure_channel( *req); void wma_set_sap_keepalive(tp_wma_handle wma, uint8_t vdev_id); -#ifdef REMOVE_PKT_LOG -static inline void wma_set_wifi_start_packet_stats(void *wma_handle, - struct sir_wifi_start_log *start_log) -{ - return; -} -#endif int wma_rssi_breached_event_handler(void *handle, u_int8_t *cmd_param_info, u_int32_t len); #ifdef WLAN_FEATURE_MEMDUMP diff --git a/core/wma/inc/wma_types.h b/core/wma/inc/wma_types.h index 4e6309e63172..cfd4d2ffb520 100644 --- a/core/wma/inc/wma_types.h +++ b/core/wma/inc/wma_types.h @@ -145,7 +145,9 @@ #define WMA_ADD_BSS_REQ SIR_HAL_ADD_BSS_REQ #define WMA_ADD_BSS_RSP SIR_HAL_ADD_BSS_RSP #define WMA_DELETE_BSS_REQ SIR_HAL_DELETE_BSS_REQ +#define WMA_DELETE_BSS_HO_FAIL_REQ SIR_HAL_DELETE_BSS_HO_FAIL_REQ #define WMA_DELETE_BSS_RSP SIR_HAL_DELETE_BSS_RSP +#define WMA_DELETE_BSS_HO_FAIL_RSP SIR_HAL_DELETE_BSS_HO_FAIL_RSP #define WMA_SEND_BEACON_REQ SIR_HAL_SEND_BEACON_REQ #define WMA_SEND_PROBE_RSP_TMPL SIR_HAL_SEND_PROBE_RSP_TMPL @@ -475,7 +477,6 @@ #define WMA_UPDATE_WEP_DEFAULT_KEY SIR_HAL_UPDATE_WEP_DEFAULT_KEY #define WMA_SEND_FREQ_RANGE_CONTROL_IND SIR_HAL_SEND_FREQ_RANGE_CONTROL_IND #define WMA_ENCRYPT_DECRYPT_MSG SIR_HAL_ENCRYPT_DECRYPT_MSG - /* Bit 6 will be used to control BD rate for Management frames */ #define HAL_USE_BD_RATE2_FOR_MANAGEMENT_FRAME 0x40 diff --git a/core/wma/src/wlan_qct_wma_legacy.c b/core/wma/src/wlan_qct_wma_legacy.c index c2c81bd25977..d675b9116f56 100644 --- a/core/wma/src/wlan_qct_wma_legacy.c +++ b/core/wma/src/wlan_qct_wma_legacy.c @@ -71,7 +71,7 @@ tSirRetStatus wma_post_ctrl_msg(tpAniSirGlobal pMac, tSirMsgQ *pMsg) * Return: Success or Failure */ -tSirRetStatus wma_post_cfg_msg(tpAniSirGlobal pMac, tSirMsgQ *pMsg) +static tSirRetStatus wma_post_cfg_msg(tpAniSirGlobal pMac, tSirMsgQ *pMsg) { tSirRetStatus rc = eSIR_SUCCESS; diff --git a/core/wma/src/wma_data.c b/core/wma/src/wma_data.c index 84674c38f268..b15cca34e920 100644 --- a/core/wma/src/wma_data.c +++ b/core/wma/src/wma_data.c @@ -77,7 +77,7 @@ #include <cdp_txrx_peer_ops.h> #include <cdp_txrx_cfg.h> #include "cdp_txrx_stats.h" - +#include "ol_ctrl_txrx_api.h" typedef struct { int32_t rate; @@ -1996,7 +1996,7 @@ QDF_STATUS wma_set_thermal_mgmt(tp_wma_handle wma_handle, * * Return: thermal (throttle) level */ -uint8_t wma_thermal_mgmt_get_level(void *handle, uint32_t temp) +static uint8_t wma_thermal_mgmt_get_level(void *handle, uint32_t temp) { tp_wma_handle wma = (tp_wma_handle) handle; int i; diff --git a/core/wma/src/wma_dev_if.c b/core/wma/src/wma_dev_if.c index 55e33bb22839..f5a1fd5368bb 100644 --- a/core/wma/src/wma_dev_if.c +++ b/core/wma/src/wma_dev_if.c @@ -190,7 +190,7 @@ void *wma_find_vdev_by_bssid(tp_wma_handle wma, uint8_t *bssid, * * Return: return operating mode as enum wlan_op_mode type */ -enum wlan_op_mode wma_get_txrx_vdev_type(uint32_t type) +static enum wlan_op_mode wma_get_txrx_vdev_type(uint32_t type) { enum wlan_op_mode vdev_type = wlan_op_mode_unknown; switch (type) { @@ -407,7 +407,7 @@ static struct wma_target_req *wma_find_vdev_req(tp_wma_handle wma, * * Return: none */ -void wma_vdev_detach_callback(void *ctx) +static void wma_vdev_detach_callback(void *ctx) { tp_wma_handle wma; struct wma_txrx_node *iface = (struct wma_txrx_node *)ctx; @@ -1053,7 +1053,7 @@ QDF_STATUS wma_set_peer_param(void *wma_ctx, uint8_t *peer_addr, } /** - * wma_remove_peer() - send remove peer command to fw + * wma_remove_peer() - remove peer information from host driver and fw * @wma: wma handle * @bssid: mac address * @vdev_id: vdev id @@ -1104,7 +1104,7 @@ void wma_remove_peer(tp_wma_handle wma, uint8_t *bssid, param.peer_tid_bitmap = peer_tid_bitmap; param.vdev_id = vdev_id; wmi_unified_peer_flush_tids_send(wma->wmi_handle, bssid, - ¶m); + ¶m); if (wma_is_vdev_in_ibss_mode(wma, vdev_id)) { WMA_LOGD("%s: bssid %pM peer->mac_addr %pM", __func__, @@ -1112,7 +1112,8 @@ void wma_remove_peer(tp_wma_handle wma, uint8_t *bssid, peer_addr = peer_mac_addr; } - wmi_unified_peer_delete_send(wma->wmi_handle, peer_addr, vdev_id); + wmi_unified_peer_delete_send(wma->wmi_handle, peer_addr, + vdev_id); #undef PEER_ALL_TID_BITMASK } @@ -1283,8 +1284,8 @@ static void wma_delete_all_ap_remote_peers(tp_wma_handle wma, A_UINT32 vdev_id) * * Return: none */ -void wma_hidden_ssid_vdev_restart_on_vdev_stop(tp_wma_handle wma_handle, - uint8_t sessionId) +static void wma_hidden_ssid_vdev_restart_on_vdev_stop(tp_wma_handle wma_handle, + uint8_t sessionId) { struct wma_txrx_node *intr = wma_handle->interfaces; struct hidden_ssid_vdev_restart_params params; @@ -4226,6 +4227,109 @@ void wma_delete_sta(tp_wma_handle wma, tpDeleteStaParams del_sta) } /** + * wma_delete_bss_ho_fail() - process delete bss request for handoff failure + * @wma: wma handle + * @params: del bss parameters + * + * Delete BSS in case of ROAM_HO_FAIL processing is handled separately in + * this routine. It needs to be done without sending any commands to firmware + * because firmware has already stopped and deleted peer and vdev is down. + * Relevent logic is aggregated from other routines. It changes the host + * data structures without sending VDEV_STOP, PEER_FLUSH_TIDS, PEER_DELETE + * and VDEV_DOWN commands to firmware. + * + * Return: none + */ +void wma_delete_bss_ho_fail(tp_wma_handle wma, tpDeleteBssParams params) +{ + ol_txrx_pdev_handle pdev; + ol_txrx_peer_handle peer = NULL; + QDF_STATUS status = QDF_STATUS_SUCCESS; + uint8_t peer_id; + ol_txrx_vdev_handle txrx_vdev = NULL; + struct wma_txrx_node *iface; + + pdev = cds_get_context(QDF_MODULE_ID_TXRX); + + if (NULL == pdev) { + WMA_LOGE("%s:Unable to get TXRX context", __func__); + goto fail_del_bss_ho_fail; + } + peer = ol_txrx_find_peer_by_addr(pdev, params->bssid, &peer_id); + + if (!peer) { + WMA_LOGP("%s: Failed to find peer %pM", __func__, + params->bssid); + status = QDF_STATUS_E_FAILURE; + goto fail_del_bss_ho_fail; + } + + iface = &wma->interfaces[params->smesessionId]; + if (!iface || !iface->handle) { + WMA_LOGE("%s vdev id %d is already deleted", + __func__, params->smesessionId); + goto fail_del_bss_ho_fail; + } + qdf_mem_zero(iface->bssid, IEEE80211_ADDR_LEN); + + txrx_vdev = wma_find_vdev_by_id(wma, params->smesessionId); + if (!txrx_vdev) { + WMA_LOGE("%s:Invalid vdev handle", __func__); + status = QDF_STATUS_E_FAILURE; + goto fail_del_bss_ho_fail; + } + + /* Free the allocated stats response buffer for the the session */ + if (iface->stats_rsp) { + qdf_mem_free(iface->stats_rsp); + iface->stats_rsp = NULL; + } + + if (iface->psnr_req) { + qdf_mem_free(iface->psnr_req); + iface->psnr_req = NULL; + } + qdf_mem_zero(&iface->ns_offload_req, + sizeof(iface->ns_offload_req)); + qdf_mem_zero(&iface->arp_offload_req, + sizeof(iface->arp_offload_req)); + + WMA_LOGD("%s, vdev_id: %d, pausing tx_ll_queue for VDEV_STOP (del_bss)", + __func__, params->smesessionId); + ol_txrx_vdev_pause(iface->handle, + OL_TXQ_PAUSE_REASON_VDEV_STOP); + iface->pause_bitmap |= (1 << PAUSE_TYPE_HOST); + + ol_txrx_vdev_flush(iface->handle); + WMA_LOGD("%s, vdev_id: %d, un-pausing tx_ll_queue for VDEV_STOP rsp", + __func__, params->smesessionId); + ol_txrx_vdev_unpause(iface->handle, + OL_TXQ_PAUSE_REASON_VDEV_STOP); + iface->pause_bitmap &= ~(1 << PAUSE_TYPE_HOST); + qdf_atomic_set(&iface->bss_status, WMA_BSS_STATUS_STOPPED); + WMA_LOGD("%s: (type %d subtype %d) BSS is stopped", + __func__, iface->type, iface->sub_type); + iface->vdev_up = false; + params->status = QDF_STATUS_SUCCESS; + if (!iface->peer_count) { + WMA_LOGE("%s: Can't remove peer with peer_addr %pM vdevid %d peer_count %d", + __func__, params->bssid, params->smesessionId, + iface->peer_count); + goto fail_del_bss_ho_fail; + } + + if (peer) + ol_txrx_peer_detach(peer); + iface->peer_count--; + WMA_LOGE("%s: Removed peer %p with peer_addr %pM vdevid %d peer_count %d", + __func__, peer, params->bssid, params->smesessionId, + iface->peer_count); +fail_del_bss_ho_fail: + params->status = status; + wma_send_msg(wma, WMA_DELETE_BSS_HO_FAIL_RSP, (void *)params, 0); +} + +/** * wma_delete_bss() - process delete bss request from upper layer * @wma: wma handle * @params: del bss parameters @@ -4242,6 +4346,7 @@ void wma_delete_bss(tp_wma_handle wma, tpDeleteBssParams params) uint8_t max_wait_iterations = 0; ol_txrx_vdev_handle txrx_vdev = NULL; bool roam_synch_in_progress = false; + struct wma_txrx_node *iface; pdev = cds_get_context(QDF_MODULE_ID_TXRX); @@ -4280,15 +4385,21 @@ void wma_delete_bss(tp_wma_handle wma, tpDeleteBssParams params) goto out; } + iface = &wma->interfaces[params->smesessionId]; + if (!iface || !iface->handle) { + WMA_LOGE("%s vdev id %d is already deleted", + __func__, params->smesessionId); + goto out; + } /*Free the allocated stats response buffer for the the session */ - if (wma->interfaces[params->smesessionId].stats_rsp) { - qdf_mem_free(wma->interfaces[params->smesessionId].stats_rsp); - wma->interfaces[params->smesessionId].stats_rsp = NULL; + if (iface->stats_rsp) { + qdf_mem_free(iface->stats_rsp); + iface->stats_rsp = NULL; } - if (wma->interfaces[params->smesessionId].psnr_req) { - qdf_mem_free(wma->interfaces[params->smesessionId].psnr_req); - wma->interfaces[params->smesessionId].psnr_req = NULL; + if (iface->psnr_req) { + qdf_mem_free(iface->psnr_req); + iface->psnr_req = NULL; } if (wlan_op_mode_ibss == ol_txrx_get_opmode(txrx_vdev)) @@ -4298,7 +4409,7 @@ void wma_delete_bss(tp_wma_handle wma, tpDeleteBssParams params) roam_synch_in_progress = true; WMA_LOGD("LFR3:%s: Setting vdev_up to FALSE for session %d", __func__, params->smesessionId); - wma->interfaces[params->smesessionId].vdev_up = false; + iface->vdev_up = false; goto detach_peer; } msg = wma_fill_vdev_req(wma, params->smesessionId, WMA_DELETE_BSS_REQ, @@ -4332,18 +4443,17 @@ void wma_delete_bss(tp_wma_handle wma, tpDeleteBssParams params) WMA_LOGD("%s, vdev_id: %d, pausing tx_ll_queue for VDEV_STOP (del_bss)", __func__, params->smesessionId); - ol_txrx_vdev_pause(wma->interfaces[params->smesessionId].handle, + ol_txrx_vdev_pause(iface->handle, OL_TXQ_PAUSE_REASON_VDEV_STOP); - wma->interfaces[params->smesessionId].pause_bitmap |= - (1 << PAUSE_TYPE_HOST); + iface->pause_bitmap |= (1 << PAUSE_TYPE_HOST); if (wmi_unified_vdev_stop_send(wma->wmi_handle, params->smesessionId)) { WMA_LOGP("%s: %d Failed to send vdev stop", __func__, __LINE__); wma_remove_vdev_req(wma, params->smesessionId, - WMA_TARGET_REQ_TYPE_VDEV_STOP); + WMA_TARGET_REQ_TYPE_VDEV_STOP); status = QDF_STATUS_E_FAILURE; goto detach_peer; - } + } WMA_LOGD("%s: bssid %pM vdev_id %d", __func__, params->bssid, params->smesessionId); return; diff --git a/core/wma/src/wma_dfs_interface.c b/core/wma/src/wma_dfs_interface.c index be1022d21c8c..4af86ba6e233 100644 --- a/core/wma/src/wma_dfs_interface.c +++ b/core/wma/src/wma_dfs_interface.c @@ -34,6 +34,7 @@ #include "wma.h" #include "ath_dfs_structs.h" #include "wma_dfs_interface.h" +#include "dfs_interface.h" #ifndef ATH_SUPPORT_DFS #define ATH_SUPPORT_DFS 1 diff --git a/core/wma/src/wma_features.c b/core/wma/src/wma_features.c index a2cef423385b..2a4b66fbc10f 100644 --- a/core/wma/src/wma_features.c +++ b/core/wma/src/wma_features.c @@ -523,8 +523,9 @@ error: * * Return: QDF status */ -QDF_STATUS wma_lphb_conf_hbenable(tp_wma_handle wma_handle, - tSirLPHBReq *lphb_conf_req, bool by_user) +static QDF_STATUS wma_lphb_conf_hbenable(tp_wma_handle wma_handle, + tSirLPHBReq *lphb_conf_req, + bool by_user) { QDF_STATUS qdf_status = QDF_STATUS_SUCCESS; int status = 0; @@ -598,8 +599,8 @@ error: * * Return: QDF status */ -QDF_STATUS wma_lphb_conf_tcp_params(tp_wma_handle wma_handle, - tSirLPHBReq *lphb_conf_req) +static QDF_STATUS wma_lphb_conf_tcp_params(tp_wma_handle wma_handle, + tSirLPHBReq *lphb_conf_req) { QDF_STATUS qdf_status = QDF_STATUS_SUCCESS; int status = 0; @@ -655,8 +656,8 @@ error: * * Return: QDF status */ -QDF_STATUS wma_lphb_conf_tcp_pkt_filter(tp_wma_handle wma_handle, - tSirLPHBReq *lphb_conf_req) +static QDF_STATUS wma_lphb_conf_tcp_pkt_filter(tp_wma_handle wma_handle, + tSirLPHBReq *lphb_conf_req) { QDF_STATUS qdf_status = QDF_STATUS_SUCCESS; int status = 0; @@ -705,8 +706,8 @@ error: * * Return: QDF status */ -QDF_STATUS wma_lphb_conf_udp_params(tp_wma_handle wma_handle, - tSirLPHBReq *lphb_conf_req) +static QDF_STATUS wma_lphb_conf_udp_params(tp_wma_handle wma_handle, + tSirLPHBReq *lphb_conf_req) { QDF_STATUS qdf_status = QDF_STATUS_SUCCESS; int status = 0; @@ -761,8 +762,8 @@ error: * * Return: QDF status */ -QDF_STATUS wma_lphb_conf_udp_pkt_filter(tp_wma_handle wma_handle, - tSirLPHBReq *lphb_conf_req) +static QDF_STATUS wma_lphb_conf_udp_pkt_filter(tp_wma_handle wma_handle, + tSirLPHBReq *lphb_conf_req) { QDF_STATUS qdf_status = QDF_STATUS_SUCCESS; int status = 0; @@ -2675,7 +2676,7 @@ static bool tlv_check_required(int32_t reason) * * Return: string for proto subtype for data packet */ -const char * +static const char * wma_pkt_proto_subtype_to_string(enum qdf_proto_subtype proto_subtype) { switch (proto_subtype) { @@ -3841,14 +3842,12 @@ QDF_STATUS wma_enable_wow_in_fw(WMA_HANDLE handle) int wmi_pending_cmds; struct wow_cmd_params param = {0}; -#ifdef CONFIG_CNSS tpAniSirGlobal pMac = cds_get_context(QDF_MODULE_ID_PE); if (NULL == pMac) { WMA_LOGE("%s: Unable to get PE context", __func__); return QDF_STATUS_E_FAILURE; } -#endif /* CONFIG_CNSS */ qdf_event_reset(&wma->target_suspend); wma->wow_nack = false; @@ -3888,15 +3887,11 @@ QDF_STATUS wma_enable_wow_in_fw(WMA_HANDLE handle) wmi_get_pending_cmds(wma->wmi_handle)); wmi_set_target_suspend(wma->wmi_handle, false); if (!cds_is_driver_recovering()) { -#ifdef CONFIG_CNSS if (pMac->sme.enableSelfRecovery) { cds_trigger_recovery(); } else { QDF_BUG(0); } -#else - QDF_BUG(0); -#endif /* CONFIG_CNSS */ } else { WMA_LOGE("%s: LOGP is in progress, ignore!", __func__); } @@ -4433,7 +4428,7 @@ bool static wma_is_nan_enabled(tp_wma_handle wma) * * Return: true if wma needs to configure wow false otherwise. */ -bool wma_is_wow_applicable(tp_wma_handle wma) +static bool wma_is_wow_applicable(tp_wma_handle wma) { int vdev_id; if (wma_support_wow_for_beaconing(wma)) { @@ -4479,7 +4474,7 @@ bool wma_is_wow_applicable(tp_wma_handle wma) * * Return: none */ -void wma_configure_dynamic_wake_events(tp_wma_handle wma) +static void wma_configure_dynamic_wake_events(tp_wma_handle wma) { int vdev_id; int enable_mask; @@ -4593,13 +4588,11 @@ static QDF_STATUS wma_send_host_wakeup_ind_to_fw(tp_wma_handle wma) { QDF_STATUS qdf_status = QDF_STATUS_SUCCESS; int ret; -#ifdef CONFIG_CNSS tpAniSirGlobal pMac = cds_get_context(QDF_MODULE_ID_PE); if (NULL == pMac) { WMA_LOGE("%s: Unable to get PE context", __func__); return QDF_STATUS_E_FAILURE; } -#endif /* CONFIG_CNSS */ qdf_event_reset(&wma->wma_resume_event); @@ -4619,15 +4612,11 @@ static QDF_STATUS wma_send_host_wakeup_ind_to_fw(tp_wma_handle wma) wmi_get_pending_cmds(wma->wmi_handle), wmi_get_host_credits(wma->wmi_handle)); if (!cds_is_driver_recovering()) { -#ifdef CONFIG_CNSS if (pMac->sme.enableSelfRecovery) { cds_trigger_recovery(); } else { QDF_BUG(0); } -#else - QDF_BUG(0); -#endif /* CONFIG_CNSS */ } else { WMA_LOGE("%s: SSR in progress, ignore resume timeout", __func__); @@ -6491,7 +6480,7 @@ int wma_bus_suspend(void) * * Return: os error code. */ -int __wma_bus_resume(WMA_HANDLE handle) +static int __wma_bus_resume(WMA_HANDLE handle) { bool wow_mode = wma_is_wow_mode_selected(handle); tp_wma_handle wma = handle; @@ -6731,13 +6720,11 @@ QDF_STATUS wma_resume_target(WMA_HANDLE handle) { tp_wma_handle wma = (tp_wma_handle) handle; QDF_STATUS qdf_status = QDF_STATUS_SUCCESS; -#ifdef CONFIG_CNSS tpAniSirGlobal pMac = cds_get_context(QDF_MODULE_ID_PE); if (NULL == pMac) { WMA_LOGE("%s: Unable to get PE context", __func__); return QDF_STATUS_E_INVAL; } -#endif /* CONFIG_CNSS */ qdf_event_reset(&wma->wma_resume_event); qdf_status = wmi_unified_resume_send(wma->wmi_handle, @@ -6754,15 +6741,11 @@ QDF_STATUS wma_resume_target(WMA_HANDLE handle) wmi_get_pending_cmds(wma->wmi_handle), wmi_get_host_credits(wma->wmi_handle)); if (!cds_is_driver_recovering()) { -#ifdef CONFIG_CNSS if (pMac->sme.enableSelfRecovery) { cds_trigger_recovery(); } else { QDF_BUG(0); } -#else - QDF_BUG(0); -#endif /* CONFIG_CNSS */ } else { WMA_LOGE("%s: SSR in progress, ignore resume timeout", __func__); @@ -7417,8 +7400,8 @@ void wma_set_dfs_region(tp_wma_handle wma, enum dfs_region dfs_region) * * Return: return number of channels */ -int wma_get_channels(struct dfs_ieee80211_channel *ichan, - struct wma_dfs_radar_channel_list *chan_list) +static int wma_get_channels(struct dfs_ieee80211_channel *ichan, + struct wma_dfs_radar_channel_list *chan_list) { uint8_t center_chan = cds_freq_to_chan(ichan->ic_vhtop_ch_freq_seg1); int count = 0; diff --git a/core/wma/src/wma_main.c b/core/wma/src/wma_main.c index 98eadc66cbb8..bae962e80a3b 100644 --- a/core/wma/src/wma_main.c +++ b/core/wma/src/wma_main.c @@ -766,8 +766,8 @@ static int32_t wma_set_priv_cfg(tp_wma_handle wma_handle, * * Return: none */ -void wma_set_dtim_period(tp_wma_handle wma, - struct set_dtim_params *dtim_params) +static void wma_set_dtim_period(tp_wma_handle wma, + struct set_dtim_params *dtim_params) { QDF_STATUS ret; uint8_t vdev_id = dtim_params->session_id; @@ -4333,7 +4333,7 @@ static int wma_setup_wmi_init_msg(tp_wma_handle wma_handle, * * Return: None */ -void wma_dump_dbs_hw_mode(tp_wma_handle wma_handle) +static void wma_dump_dbs_hw_mode(tp_wma_handle wma_handle) { uint32_t i, param; @@ -4371,9 +4371,9 @@ void wma_dump_dbs_hw_mode(tp_wma_handle wma_handle) * * Return: None */ -void wma_init_scan_fw_mode_config(tp_wma_handle wma_handle, - uint32_t scan_config, - uint32_t fw_config) +static void wma_init_scan_fw_mode_config(tp_wma_handle wma_handle, + uint32_t scan_config, + uint32_t fw_config) { tpAniSirGlobal mac = cds_get_context(QDF_MODULE_ID_PE); @@ -5004,7 +5004,7 @@ static void wma_print_populate_soc_caps(t_wma_handle *wma_handle) * * Return: BW in terms of hw_mode_bandwidth. */ -enum hw_mode_bandwidth wma_map_wmi_channel_width_to_hw_mode_bw( +static enum hw_mode_bandwidth wma_map_wmi_channel_width_to_hw_mode_bw( wmi_channel_width width) { switch (width) { @@ -5654,8 +5654,8 @@ pkt_pwr_save_config: * * Return: QDF_SUCCESS for success otherwise failure */ -QDF_STATUS wma_process_set_mas(tp_wma_handle wma, - uint32_t *mas_val) +static QDF_STATUS wma_process_set_mas(tp_wma_handle wma, + uint32_t *mas_val) { uint32_t val; @@ -5687,7 +5687,8 @@ QDF_STATUS wma_process_set_mas(tp_wma_handle wma, * Return: QDF_SUCCESS for success otherwise failure * */ -QDF_STATUS wma_process_set_miracast(tp_wma_handle wma, uint32_t *miracast_val) +static QDF_STATUS wma_process_set_miracast(tp_wma_handle wma, + uint32_t *miracast_val) { if (NULL == wma || NULL == miracast_val) { WMA_LOGE("%s: Invalid input to store miracast value", __func__); @@ -5780,8 +5781,8 @@ static QDF_STATUS wma_config_guard_time(tp_wma_handle wma, * * Return: None */ -void wma_enable_specific_fw_logs(tp_wma_handle wma_handle, - struct sir_wifi_start_log *start_log) +static void wma_enable_specific_fw_logs(tp_wma_handle wma_handle, + struct sir_wifi_start_log *start_log) { if (!start_log) { @@ -5806,8 +5807,6 @@ void wma_enable_specific_fw_logs(tp_wma_handle wma_handle, return; } -#if !defined(REMOVE_PKT_LOG) - #define MEGABYTE (1024 * 1024) /** * wma_set_wifi_start_packet_stats() - Start/stop packet stats @@ -5820,8 +5819,15 @@ void wma_enable_specific_fw_logs(tp_wma_handle wma_handle, * Return: None * */ -void wma_set_wifi_start_packet_stats(void *wma_handle, - struct sir_wifi_start_log *start_log) +#ifdef REMOVE_PKT_LOG +static void wma_set_wifi_start_packet_stats(void *wma_handle, + struct sir_wifi_start_log *start_log) +{ + return; +} +#else +static void wma_set_wifi_start_packet_stats(void *wma_handle, + struct sir_wifi_start_log *start_log) { struct hif_opaque_softc *scn; uint32_t log_state; @@ -5914,6 +5920,171 @@ static QDF_STATUS wma_update_wep_default_key(tp_wma_handle wma, return QDF_STATUS_SUCCESS; } + +/** + * wma_update_tx_fail_cnt_th() - Set threshold for TX pkt fail + * @wma_handle: WMA handle + * @tx_fail_cnt_th: sme_tx_fail_cnt_threshold parameter + * + * This function is used to set Tx pkt fail count threshold, + * FW will do disconnect with station once this threshold is reached. + * + * Return: VOS_STATUS_SUCCESS on success, error number otherwise + */ +static QDF_STATUS wma_update_tx_fail_cnt_th(tp_wma_handle wma, + struct sme_tx_fail_cnt_threshold *tx_fail_cnt_th) +{ + u_int8_t vdev_id; + u_int32_t tx_fail_disconn_th; + int ret = -EIO; + + if (!wma || !wma->wmi_handle) { + WMA_LOGE(FL("WMA is closed, can not issue Tx pkt fail count threshold")); + return QDF_STATUS_E_INVAL; + } + vdev_id = tx_fail_cnt_th->session_id; + tx_fail_disconn_th = tx_fail_cnt_th->tx_fail_cnt_threshold; + WMA_LOGD("Set TX pkt fail count threshold vdevId %d count %d", + vdev_id, tx_fail_disconn_th); + + + ret = wma_vdev_set_param(wma->wmi_handle, vdev_id, + WMI_VDEV_PARAM_DISCONNECT_TH, + tx_fail_disconn_th); + + if (ret) { + WMA_LOGE(FL("Failed to send TX pkt fail count threshold command")); + return QDF_STATUS_E_FAILURE; + } + + return QDF_STATUS_SUCCESS; +} + +/** + * wma_update_short_retry_limit() - Set retry limit for short frames + * @wma_handle: WMA handle + * @short_retry_limit_th: retry limir count for Short frames. + * + * This function is used to configure the transmission retry limit at which + * short frames needs to be retry. + * + * Return: VOS_STATUS_SUCCESS on success, error number otherwise + */ +static QDF_STATUS wma_update_short_retry_limit(tp_wma_handle wma, + struct sme_short_retry_limit *short_retry_limit_th) +{ + uint8_t vdev_id; + uint32_t short_retry_limit; + int ret; + + if (!wma || !wma->wmi_handle) { + WMA_LOGE("WMA is closed, can not issue short retry limit threshold"); + return QDF_STATUS_E_INVAL; + } + vdev_id = short_retry_limit_th->session_id; + short_retry_limit = short_retry_limit_th->short_retry_limit; + WMA_LOGD("Set short retry limit threshold vdevId %d count %d", + vdev_id, short_retry_limit); + + ret = wma_vdev_set_param(wma->wmi_handle, vdev_id, + WMI_VDEV_PARAM_NON_AGG_SW_RETRY_TH, + short_retry_limit); + + if (ret) { + WMA_LOGE("Failed to send short limit threshold command"); + return QDF_STATUS_E_FAILURE; + } + return QDF_STATUS_SUCCESS; +} + +/** + * wma_update_long_retry_limit() - Set retry limit for long frames + * @wma_handle: WMA handle + * @long_retry_limit_th: retry limir count for long frames + * + * This function is used to configure the transmission retry limit at which + * long frames needs to be retry + * + * Return: VOS_STATUS_SUCCESS on success, error number otherwise + */ +static QDF_STATUS wma_update_long_retry_limit(tp_wma_handle wma, + struct sme_long_retry_limit *long_retry_limit_th) +{ + uint8_t vdev_id; + uint32_t long_retry_limit; + int ret; + + if (!wma || !wma->wmi_handle) { + WMA_LOGE("WMA is closed, can not issue long retry limit threshold"); + return QDF_STATUS_E_INVAL; + } + vdev_id = long_retry_limit_th->session_id; + long_retry_limit = long_retry_limit_th->long_retry_limit; + WMA_LOGD("Set TX pkt fail count threshold vdevId %d count %d", + vdev_id, long_retry_limit); + + ret = wma_vdev_set_param(wma->wmi_handle, vdev_id, + WMI_VDEV_PARAM_AGG_SW_RETRY_TH, + long_retry_limit); + + if (ret) { + WMA_LOGE("Failed to send long limit threshold command"); + return QDF_STATUS_E_FAILURE; + } + + return QDF_STATUS_SUCCESS; +} + +/* + * wma_update_sta_inactivity_timeout() - Set sta_inactivity_timeout to fw + * @wma_handle: WMA handle + * @sta_inactivity_timer: sme_sta_inactivity_timeout + * + * This function is used to set sta_inactivity_timeout. + * If a station does not send anything in sta_inactivity_timeout seconds, an + * empty data frame is sent to it in order to verify whether it is + * still in range. If this frame is not ACKed, the station will be + * disassociated and then deauthenticated. + * + * Return: None + */ +void wma_update_sta_inactivity_timeout(tp_wma_handle wma, + struct sme_sta_inactivity_timeout *sta_inactivity_timer) +{ + uint8_t vdev_id; + uint32_t max_unresponsive_time; + uint32_t min_inactive_time, max_inactive_time; + + if (!wma || !wma->wmi_handle) { + WMA_LOGE("WMA is closed, can not issue sta_inactivity_timeout"); + return; + } + vdev_id = sta_inactivity_timer->session_id; + max_unresponsive_time = sta_inactivity_timer->sta_inactivity_timeout; + max_inactive_time = max_unresponsive_time * TWO_THIRD; + min_inactive_time = max_unresponsive_time - max_inactive_time; + + if (wma_vdev_set_param(wma->wmi_handle, vdev_id, + WMI_VDEV_PARAM_AP_KEEPALIVE_MIN_IDLE_INACTIVE_TIME_SECS, + min_inactive_time)) + WMA_LOGE("Failed to Set AP MIN IDLE INACTIVE TIME"); + + if (wma_vdev_set_param(wma->wmi_handle, vdev_id, + WMI_VDEV_PARAM_AP_KEEPALIVE_MAX_IDLE_INACTIVE_TIME_SECS, + max_inactive_time)) + WMA_LOGE("Failed to Set AP MAX IDLE INACTIVE TIME"); + + if (wma_vdev_set_param(wma->wmi_handle, vdev_id, + WMI_VDEV_PARAM_AP_KEEPALIVE_MAX_UNRESPONSIVE_TIME_SECS, + max_unresponsive_time)) + WMA_LOGE("Failed to Set MAX UNRESPONSIVE TIME"); + + WMA_LOGI("%s:vdev_id:%d min_inactive_time: %u max_inactive_time: %u max_unresponsive_time: %u", + __func__, vdev_id, + min_inactive_time, max_inactive_time, + max_unresponsive_time); +} + /** * wma_mc_process_msg() - process wma messages and call appropriate function. * @cds_context: cds context @@ -6027,6 +6198,10 @@ QDF_STATUS wma_mc_process_msg(void *cds_context, cds_msg_t *msg) case WMA_DELETE_STA_REQ: wma_delete_sta(wma_handle, (tpDeleteStaParams) msg->bodyptr); break; + case WMA_DELETE_BSS_HO_FAIL_REQ: + wma_delete_bss_ho_fail(wma_handle, + (tpDeleteBssParams) msg->bodyptr); + break; case WMA_DELETE_BSS_REQ: wma_delete_bss(wma_handle, (tpDeleteBssParams) msg->bodyptr); break; @@ -6725,6 +6900,18 @@ QDF_STATUS wma_mc_process_msg(void *cds_context, cds_msg_t *msg) wma_encrypt_decrypt_msg(wma_handle, msg->bodyptr); qdf_mem_free(msg->bodyptr); break; + case SIR_HAL_UPDATE_TX_FAIL_CNT_TH: + wma_update_tx_fail_cnt_th(wma_handle, msg->bodyptr); + qdf_mem_free(msg->bodyptr); + break; + case SIR_HAL_LONG_RETRY_LIMIT_CNT: + wma_update_long_retry_limit(wma_handle, msg->bodyptr); + qdf_mem_free(msg->bodyptr); + break; + case SIR_HAL_SHORT_RETRY_LIMIT_CNT: + wma_update_short_retry_limit(wma_handle, msg->bodyptr); + qdf_mem_free(msg->bodyptr); + break; default: WMA_LOGD("unknow msg type %x", msg->type); /* Do Nothing? MSG Body should be freed at here */ diff --git a/core/wma/src/wma_mgmt.c b/core/wma/src/wma_mgmt.c index d5aef6cedc37..1668b4b53bb6 100644 --- a/core/wma/src/wma_mgmt.c +++ b/core/wma/src/wma_mgmt.c @@ -2139,8 +2139,8 @@ static QDF_STATUS wma_unified_bcn_tmpl_send(tp_wma_handle wma, * * Return: QDF status */ -QDF_STATUS wma_store_bcn_tmpl(tp_wma_handle wma, uint8_t vdev_id, - tpSendbeaconParams bcn_info) +static QDF_STATUS wma_store_bcn_tmpl(tp_wma_handle wma, uint8_t vdev_id, + tpSendbeaconParams bcn_info) { struct beacon_info *bcn; uint32_t len; @@ -2472,8 +2472,8 @@ void wma_beacon_miss_handler(tp_wma_handle wma, uint32_t vdev_id) * * Return: 0 for success or error code */ -int wma_process_mgmt_tx_completion(tp_wma_handle wma_handle, - uint32_t desc_id, uint32_t status) +static int wma_process_mgmt_tx_completion(tp_wma_handle wma_handle, + uint32_t desc_id, uint32_t status) { struct wmi_desc_t *wmi_desc; ol_txrx_pdev_handle pdev = cds_get_context(QDF_MODULE_ID_TXRX); diff --git a/core/wma/src/wma_nan_datapath.c b/core/wma/src/wma_nan_datapath.c index 34a1b7affde8..b5ab05a9c031 100644 --- a/core/wma/src/wma_nan_datapath.c +++ b/core/wma/src/wma_nan_datapath.c @@ -362,19 +362,6 @@ send_ndp_end_fail: } /** - * wma_handle_ndp_sched_update_req() - NDP schedule update request handler - * @wma_handle: wma handle - * @req_params: request parameters - * - * Return: QDF_STATUS_SUCCESS on success; error number otherwise - */ -QDF_STATUS wma_handle_ndp_sched_update_req(tp_wma_handle wma_handle, - struct ndp_end_req *req_params) -{ - return QDF_STATUS_SUCCESS; -} - -/** * wma_ndp_indication_event_handler() - NDP indication event handler * @handle: wma handle * @event_info: event handler data diff --git a/core/wma/src/wma_power.c b/core/wma/src/wma_power.c index e5194ae626a7..23a7f6d4b5c5 100644 --- a/core/wma/src/wma_power.c +++ b/core/wma/src/wma_power.c @@ -135,8 +135,6 @@ QDF_STATUS wma_unified_set_sta_ps_param(wmi_unified_t wmi_handle, status = wmi_unified_sta_ps_cmd_send(wmi_handle, &sta_ps_param); if (QDF_IS_STATUS_ERROR(status)) return status; - /* Store the PS Status */ - iface->ps_enabled = value ? true : false; return status; } @@ -489,8 +487,8 @@ end: * * Return: QDF_STATUS_SUCCESS for success or error code */ -QDF_STATUS wmi_unified_set_sta_ps(wmi_unified_t wmi_handle, - uint32_t vdev_id, uint8_t val) +static QDF_STATUS wmi_unified_set_sta_ps(wmi_unified_t wmi_handle, + uint32_t vdev_id, uint8_t val) { QDF_STATUS ret; @@ -1248,7 +1246,7 @@ QDF_STATUS wma_process_tx_power_limits(WMA_HANDLE handle, * * Return: ptr after p2p ie */ -uint8_t *wma_add_p2p_ie(uint8_t *frm) +static uint8_t *wma_add_p2p_ie(uint8_t *frm) { uint8_t wfa_oui[3] = WMA_P2P_WFA_OUI; struct p2p_ie *p2p_ie = (struct p2p_ie *)frm; @@ -1744,7 +1742,6 @@ static void wma_set_vdev_suspend_dtim(tp_wma_handle wma, uint8_t vdev_id) enum powersave_qpower_mode qpower_config = wma_get_qpower_config(wma); if ((iface->type == WMI_VDEV_TYPE_STA) && - (iface->ps_enabled == true) && (iface->dtimPeriod != 0)) { QDF_STATUS ret; uint32_t listen_interval; @@ -1797,8 +1794,6 @@ static void wma_set_vdev_suspend_dtim(tp_wma_handle wma, uint8_t vdev_id) 0); if (QDF_IS_STATUS_ERROR(ret)) WMA_LOGE("Failed to disable Qpower in suspend mode!"); - - iface->ps_enabled = true; } ret = wma_vdev_set_param(wma->wmi_handle, vdev_id, @@ -1850,7 +1845,6 @@ static void wma_set_vdev_resume_dtim(tp_wma_handle wma, uint8_t vdev_id) enum powersave_qpower_mode qpower_config = wma_get_qpower_config(wma); if ((iface->type == WMI_VDEV_TYPE_STA) && - (iface->ps_enabled == true) && (iface->dtim_policy == NORMAL_DTIM)) { QDF_STATUS ret; uint32_t cfg_data_val = 0; diff --git a/core/wma/src/wma_scan_roam.c b/core/wma/src/wma_scan_roam.c index 8d28d4806bca..d46e98ef45f6 100644 --- a/core/wma/src/wma_scan_roam.c +++ b/core/wma/src/wma_scan_roam.c @@ -233,10 +233,6 @@ QDF_STATUS wma_get_buf_start_scan_cmd(tp_wma_handle wma_handle, } else cmd->dwell_time_passive = scan_req->maxChannelTime; - WMA_LOGI("Scan Type %x, Active dwell time %u, Passive dwell time %u", - scan_req->scanType, cmd->dwell_time_active, - cmd->dwell_time_passive); - /* Ensure correct number of probes are sent on active channel */ cmd->repeat_probe_time = cmd->dwell_time_active / WMA_SCAN_NPROBES_DEFAULT; @@ -465,8 +461,19 @@ QDF_STATUS wma_get_buf_start_scan_cmd(tp_wma_handle wma_handle, QDF_MIN(SSID_num, WMA_DWELL_TIME_PROBE_TIME_MAP_SIZE - 1)].probe_time; + cmd->n_probes = (cmd->repeat_probe_time > 0) ? + cmd->dwell_time_active/ + cmd->repeat_probe_time : 0; } } + WMA_LOGI("Scan Type 0x%x, Active dwell time %u, Passive dwell time %u", + scan_req->scanType, cmd->dwell_time_active, + cmd->dwell_time_passive); + WMA_LOGI("Scan repeat_probe_time %u n_probes %u num_ssids %u num_bssid %u", + cmd->repeat_probe_time, + cmd->n_probes, + cmd->num_ssids, + cmd->num_bssid); qdf_mem_copy(cmd->mac_add_bytes, scan_req->bssId.bytes, QDF_MAC_ADDR_SIZE); cmd->ie_len = scan_req->uIEFieldLen; @@ -1547,8 +1554,8 @@ QDF_STATUS wma_roam_scan_offload_ap_profile(tp_wma_handle wma_handle, * Return: Return success upon succesfully passing the * parameters to the firmware, otherwise failure. */ -QDF_STATUS wma_roam_scan_filter(tp_wma_handle wma_handle, - tSirRoamOffloadScanReq *roam_req) +static QDF_STATUS wma_roam_scan_filter(tp_wma_handle wma_handle, + tSirRoamOffloadScanReq *roam_req) { int i; QDF_STATUS status = QDF_STATUS_SUCCESS; @@ -1842,10 +1849,10 @@ QDF_STATUS wma_process_roaming_config(tp_wma_handle wma_handle, wma_roam_scan_fill_scan_params(wma_handle, pMac, NULL, &scan_params); qdf_status = wma_roam_scan_offload_mode(wma_handle, - &scan_params, - NULL, - WMI_ROAM_SCAN_MODE_NONE, - roam_req->sessionId); + &scan_params, NULL, + WMI_ROAM_SCAN_MODE_NONE | + WMI_ROAM_SCAN_MODE_ROAMOFFLOAD, + roam_req->sessionId); } /* * If the STOP command is due to a disconnect, then @@ -2089,9 +2096,9 @@ void wma_process_roam_synch_fail(WMA_HANDLE handle, * * Return: None */ -void wma_fill_roam_synch_buffer(tp_wma_handle wma, - roam_offload_synch_ind *roam_synch_ind_ptr, - WMI_ROAM_SYNCH_EVENTID_param_tlvs *param_buf) +static void wma_fill_roam_synch_buffer(tp_wma_handle wma, + roam_offload_synch_ind *roam_synch_ind_ptr, + WMI_ROAM_SYNCH_EVENTID_param_tlvs *param_buf) { wmi_roam_synch_event_fixed_param *synch_event; uint8_t *bcn_probersp_ptr; @@ -2181,8 +2188,8 @@ void wma_fill_roam_synch_buffer(tp_wma_handle wma, * * Return: None */ -void wma_roam_update_vdev(tp_wma_handle wma, - roam_offload_synch_ind *roam_synch_ind_ptr) +static void wma_roam_update_vdev(tp_wma_handle wma, + roam_offload_synch_ind *roam_synch_ind_ptr) { tDeleteBssParams *del_bss_params; tDeleteStaParams *del_sta_params; @@ -2701,7 +2708,8 @@ void wma_process_roam_synch_complete(WMA_HANDLE handle, uint8_t vdev_id) * * Return: 0 for success, otherwise appropriate error code */ -QDF_STATUS wma_switch_channel(tp_wma_handle wma, struct wma_vdev_start_req *req) +static QDF_STATUS wma_switch_channel(tp_wma_handle wma, + struct wma_vdev_start_req *req) { wmi_buf_t buf; diff --git a/core/wma/src/wma_utils.c b/core/wma/src/wma_utils.c index 6c87a5a19e2f..679b1732c11b 100644 --- a/core/wma/src/wma_utils.c +++ b/core/wma/src/wma_utils.c @@ -1839,7 +1839,7 @@ int32_t wma_txrx_fw_stats_reset(tp_wma_handle wma_handle, #endif #ifdef HELIUMPLUS -bool wma_is_valid_fw_stats_cmd(uint32_t value) +static bool wma_is_valid_fw_stats_cmd(uint32_t value) { if (value > (HTT_DBG_NUM_STATS + 1) || value == (HTT_DBG_STATS_RX_RATE_INFO + 1) || @@ -1851,7 +1851,7 @@ bool wma_is_valid_fw_stats_cmd(uint32_t value) return true; } #else -bool wma_is_valid_fw_stats_cmd(uint32_t value) +static bool wma_is_valid_fw_stats_cmd(uint32_t value) { if (value > (HTT_DBG_NUM_STATS + 1) || value == (HTT_DBG_STATS_RX_RATE_INFO_V2 + 1) || @@ -2158,7 +2158,8 @@ bool wma_is_vdev_up(uint8_t vdev_id) * * Return: 0 for success or error code */ -int wma_utf_rsp(tp_wma_handle wma_handle, uint8_t **payload, uint32_t *len) +static int wma_utf_rsp(tp_wma_handle wma_handle, uint8_t **payload, + uint32_t *len) { int ret = -1; uint32_t payload_len; @@ -2333,7 +2334,8 @@ void wma_utf_attach(tp_wma_handle wma_handle) * * Return: QDF_STATUS_SUCCESS for success or error code */ -QDF_STATUS wma_utf_cmd(tp_wma_handle wma_handle, uint8_t *data, uint16_t len) +static QDF_STATUS wma_utf_cmd(tp_wma_handle wma_handle, uint8_t *data, + uint16_t len) { struct pdev_utf_params param = {0}; @@ -2420,9 +2422,8 @@ QDF_STATUS wma_get_wcnss_software_version(void *p_cds_gctx, * * Return: None */ -void wma_get_tx_rx_ss_from_config(enum hw_mode_ss_config mac_ss, - uint32_t *tx_ss, - uint32_t *rx_ss) +static void wma_get_tx_rx_ss_from_config(enum hw_mode_ss_config mac_ss, + uint32_t *tx_ss, uint32_t *rx_ss) { switch (mac_ss) { case HW_MODE_SS_0x0: |
