summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKrunal Soni <ksoni@codeaurora.org>2017-03-03 23:19:42 -0800
committerSandeep Puligilla <spuligil@codeaurora.org>2017-03-11 01:17:28 -0800
commit93cea9c228962a42661ac9b4d8acc15e28ef26ed (patch)
treebd2899ee09c906815d32239ff313cbf8a6f66eb0
parentb9158ee332a8a95a749e0014f41ab2963cf2883b (diff)
qcacld-3.0: Provide Rx LDPC support for 2G STA
Currently Rx LDPC is disabled for STA(2G) connection due to PHY-B hardware limitation. PHY-A can still support RxLDPC, so make changes such a way that when ever STA is on 2G band and current hardware mode is non-dbs then enable the Rx LDPC and if STA is on 2G band and current hardware mode is dbs then disable the RX LDPC. Change-Id: I9385a294b64e166f2688b83757f3ac1cbc9f76a9 CRs-Fixed: 2018096
-rw-r--r--core/cds/src/cds_concurrency.c73
-rw-r--r--core/hdd/inc/wlan_hdd_cfg.h24
-rw-r--r--core/hdd/src/wlan_hdd_cfg.c9
-rw-r--r--core/hdd/src/wlan_hdd_main.c10
-rw-r--r--core/mac/inc/sir_api.h2
-rw-r--r--core/mac/inc/wni_api.h1
-rw-r--r--core/mac/src/pe/lim/lim_process_sme_req_messages.c4
-rw-r--r--core/mac/src/pe/lim/lim_utils.c27
-rw-r--r--core/mac/src/pe/lim/lim_utils.h3
-rw-r--r--core/sme/inc/csr_api.h1
-rw-r--r--core/sme/inc/csr_internal.h1
-rw-r--r--core/sme/inc/sme_api.h5
-rw-r--r--core/sme/inc/sme_inside.h40
-rw-r--r--core/sme/inc/sme_internal.h1
-rw-r--r--core/sme/src/common/sme_api.c112
-rw-r--r--core/sme/src/csr/csr_api_roam.c128
-rw-r--r--core/sme/src/csr/csr_api_scan.c57
-rw-r--r--core/wma/inc/wma_api.h3
-rw-r--r--core/wma/src/wma_main.c10
-rw-r--r--core/wma/src/wma_scan_roam.c59
20 files changed, 534 insertions, 36 deletions
diff --git a/core/cds/src/cds_concurrency.c b/core/cds/src/cds_concurrency.c
index 06ebf91bced7..4da028c4805d 100644
--- a/core/cds/src/cds_concurrency.c
+++ b/core/cds/src/cds_concurrency.c
@@ -6431,6 +6431,58 @@ static void cds_nss_update_cb(void *context, uint8_t tx_status, uint8_t vdev_id,
}
/**
+ * cds_find_sta_and_update_caps_with_reassociation() - find sta and update
+ * HT/VHT caps and do reassociation with same ap
+ * @is_hw_mode_dbs: DBS or NON-DBS hardware mode to use
+ *
+ * This API will find the 2G STA currently active from policy manager table
+ * and update their HT/VHT caps to firmware and trigger self reassociation
+ * with same AP through LFR3 roaming module.
+ *
+ * Return: QDF_STATUS
+ */
+static QDF_STATUS cds_find_sta_and_update_caps_with_reassociation(
+ uint8_t is_hw_mode_dbs)
+{
+ cds_context_type *cds_ctx;
+ QDF_STATUS status = QDF_STATUS_SUCCESS;
+ uint32_t index, count;
+ uint32_t list[MAX_NUMBER_OF_CONC_CONNECTIONS];
+ uint32_t conn_index = 0;
+ uint32_t vdev_id, channel;
+
+ cds_ctx = cds_get_context(QDF_MODULE_ID_QDF);
+ if (!cds_ctx) {
+ cds_err("Invalid CDS Context");
+ return QDF_STATUS_E_FAILURE;
+ }
+
+ count = cds_mode_specific_connection_count(
+ CDS_STA_MODE, list);
+ for (index = 0; index < count; index++) {
+ qdf_mutex_acquire(&cds_ctx->qdf_conc_list_lock);
+ vdev_id = conc_connection_list[list[index]].vdev_id;
+ channel = conc_connection_list[list[index]].chan;
+ qdf_mutex_release(&cds_ctx->qdf_conc_list_lock);
+ conn_index = cds_get_connection_for_vdev_id(vdev_id);
+ if (MAX_NUMBER_OF_CONC_CONNECTIONS == conn_index) {
+ cds_err("connection not found for vdev %d",
+ vdev_id);
+ continue;
+ }
+ /* do it only for 2.4GHz channels */
+ if (!CDS_IS_CHANNEL_24GHZ(channel))
+ continue;
+ sme_set_vdev_ies_per_band(vdev_id, is_hw_mode_dbs);
+ status = sme_issue_same_ap_reassoc_cmd(vdev_id);
+ if (status == QDF_STATUS_E_FAILURE)
+ cds_err("Self reassoc failed %d", status);
+ }
+
+ return status;
+}
+
+/**
* cds_complete_action() - initiates actions needed on
* current connections once channel has been decided for the new
* connection
@@ -6580,6 +6632,27 @@ QDF_STATUS cds_next_actions(uint32_t session_id,
(hw_mode.dbs_cap) ? "dbs" : "non dbs");
return QDF_STATUS_E_ALREADY;
}
+ /*
+ * just check CDS_DBS action only, no need to check for
+ * CDS_DBS_DOWNGRADE as it will eventually call CDS_DBS. if you check
+ * for CDS_DBS_DOWNGRADE then IE update and self reassoc will happen two
+ * times back to back as this functon is nested which
+ * will not make sense. Same things apply for CDS_SINGLE_MAC_UPGRADE and
+ * CDS_SINGLE_MAC operations.
+ */
+ if ((CDS_DBS == action) && !hw_mode.dbs_cap &&
+ sme_check_enable_rx_ldpc_sta_ini_item()) {
+ cds_info("Going for DBS, disable rx-ldpc for all 2G STAs");
+ cds_find_sta_and_update_caps_with_reassociation(true);
+ } else if ((CDS_SINGLE_MAC == action) && hw_mode.dbs_cap
+ && sme_check_enable_rx_ldpc_sta_ini_item()) {
+ /*
+ * don't use default RX LDPC which isenabled for 5g and
+ * disable for 2g
+ */
+ cds_info("Going for SMM, enable rx-ldpc for all 2G STAs");
+ cds_find_sta_and_update_caps_with_reassociation(false);
+ }
switch (action) {
case CDS_DBS_DOWNGRADE:
diff --git a/core/hdd/inc/wlan_hdd_cfg.h b/core/hdd/inc/wlan_hdd_cfg.h
index 3362a893cc47..a32d3e7f24c6 100644
--- a/core/hdd/inc/wlan_hdd_cfg.h
+++ b/core/hdd/inc/wlan_hdd_cfg.h
@@ -6315,6 +6315,29 @@ typedef enum {
/*
* <ini>
+ * g2GBandRxLdpcSupport - to enable Rx LDPC for 2G STA band
+ * @Min: 0
+ * @Max: 1
+ * @Default: 1
+ *
+ * This ini is used to enable/disable to enable Rx LDPC for 2G STA band
+ * it can very well be enhanced for SAP/P2P/IBSS 2G band in future using
+ * bit mask.
+ *
+ * Related: STA
+ *
+ * Supported Feature: Concurrency/Standalone
+ *
+ * Usage: Internal/External
+ *
+ * </ini>
+ */
+#define CFG_2G_BAND_RX_LDPC_SUPPORT_FEATURE "g2GBandRxLdpcSupport"
+#define CFG_2G_BAND_RX_LDPC_SUPPORT_FEATURE_MIN (0)
+#define CFG_2G_BAND_RX_LDPC_SUPPORT_FEATURE_MAX (1)
+#define CFG_2G_BAND_RX_LDPC_SUPPORT_FEATURE_DEFAULT (0)
+/*
+ * <ini>
* gEnableMCCAdaptiveScheduler - MCC Adaptive Scheduler feature.
* @Min: 0
* @Max: 1
@@ -10350,6 +10373,7 @@ struct hdd_config {
bool enableTxSTBC;
uint8_t enable_tx_ldpc;
uint8_t enable_rx_ldpc;
+ uint8_t rx_ldpc_support_for_2g;
bool enable5gEBT;
#ifdef FEATURE_WLAN_TDLS
bool fEnableTDLSSupport;
diff --git a/core/hdd/src/wlan_hdd_cfg.c b/core/hdd/src/wlan_hdd_cfg.c
index b79419404a01..0ab866230a9c 100644
--- a/core/hdd/src/wlan_hdd_cfg.c
+++ b/core/hdd/src/wlan_hdd_cfg.c
@@ -2451,6 +2451,13 @@ REG_TABLE_ENTRY g_registry_table[] = {
CFG_ENABLE_RX_LDPC_MIN,
CFG_ENABLE_RX_LDPC_MAX),
+ REG_VARIABLE(CFG_2G_BAND_RX_LDPC_SUPPORT_FEATURE, WLAN_PARAM_Integer,
+ struct hdd_config, rx_ldpc_support_for_2g,
+ VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
+ CFG_2G_BAND_RX_LDPC_SUPPORT_FEATURE_DEFAULT,
+ CFG_2G_BAND_RX_LDPC_SUPPORT_FEATURE_MIN,
+ CFG_2G_BAND_RX_LDPC_SUPPORT_FEATURE_MAX),
+
REG_VARIABLE(CFG_ENABLE_MCC_ADATIVE_SCHEDULER_ENABLED_NAME,
WLAN_PARAM_Integer,
struct hdd_config, enableMCCAdaptiveScheduler,
@@ -7321,6 +7328,8 @@ QDF_STATUS hdd_set_sme_config(hdd_context_t *pHddCtx)
smeConfig->csrConfig.enable_tx_ldpc = pConfig->enable_tx_ldpc;
smeConfig->csrConfig.enable_rx_ldpc = pConfig->enable_rx_ldpc;
+ smeConfig->csrConfig.rx_ldpc_support_for_2g =
+ pConfig->rx_ldpc_support_for_2g;
#ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH
smeConfig->csrConfig.cc_switch_mode = pConfig->WlanMccToSccSwitchMode;
#endif
diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c
index 69d33a7d6cb7..c726f88f6ffd 100644
--- a/core/hdd/src/wlan_hdd_main.c
+++ b/core/hdd/src/wlan_hdd_main.c
@@ -2712,8 +2712,14 @@ QDF_STATUS hdd_init_station_mode(hdd_adapter_t *adapter)
status = QDF_STATUS_E_FAILURE;
goto error_sme_open;
}
-
- sme_set_vdev_ies_per_band(hdd_ctx->hHal, adapter->sessionId);
+ if (hdd_ctx->config->rx_ldpc_support_for_2g &&
+ !wma_is_current_hwmode_dbs()) {
+ hdd_notice("send HT/VHT IE per band using nondbs hwmode");
+ sme_set_vdev_ies_per_band(adapter->sessionId, false);
+ } else {
+ hdd_notice("send HT/VHT IE per band using dbs hwmode");
+ sme_set_vdev_ies_per_band(adapter->sessionId, true);
+ }
/* Register wireless extensions */
qdf_ret_status = hdd_register_wext(pWlanDev);
if (QDF_STATUS_SUCCESS != qdf_ret_status) {
diff --git a/core/mac/inc/sir_api.h b/core/mac/inc/sir_api.h
index d46aed0f3801..f414035c8b12 100644
--- a/core/mac/inc/sir_api.h
+++ b/core/mac/inc/sir_api.h
@@ -5017,6 +5017,7 @@ struct sir_ipa_offload_enable_disable {
* @msg_type: message type
* @len: message length
* @vdev_id: vdev id
+ * @rx_ldpc_ini: Rx LDPC ini setting
*
* Message wrapper structure for eWNI_SME_SET_VDEV_IES_PER_BAND.
*/
@@ -5024,6 +5025,7 @@ struct sir_set_vdev_ies_per_band {
uint16_t msg_type;
uint16_t len;
uint32_t vdev_id;
+ uint8_t is_hw_mode_dbs;
};
/**
diff --git a/core/mac/inc/wni_api.h b/core/mac/inc/wni_api.h
index 06f23001ee00..91f75a30e243 100644
--- a/core/mac/inc/wni_api.h
+++ b/core/mac/inc/wni_api.h
@@ -205,6 +205,7 @@ enum eWniMsgTypes {
#endif
#ifdef WLAN_FEATURE_ROAM_OFFLOAD
eWNI_SME_HO_FAIL_IND, /* Hand Off Failure Ind from WMA to SME */
+ eWNI_SME_SAME_AP_REASSOC_IND, /* Self reassociation using LFR3 */
#endif
#ifdef WLAN_FEATURE_NAN
eWNI_SME_NAN_EVENT,
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 24852a6fa5c1..4c653fb26dbb 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
@@ -5038,8 +5038,8 @@ static void lim_process_set_vdev_ies_per_band(tpAniSirGlobal mac_ctx,
lim_log(mac_ctx, LOGD, FL("rcvd set vdev ie per band req vdev_id = %d"),
p_msg->vdev_id);
/* intentionally using NULL here so that self capabilty are sent */
- if (lim_send_ies_per_band(mac_ctx, NULL, p_msg->vdev_id) !=
- QDF_STATUS_SUCCESS)
+ if (lim_send_ies_per_band(mac_ctx, NULL, p_msg->vdev_id,
+ p_msg->is_hw_mode_dbs) != QDF_STATUS_SUCCESS)
lim_log(mac_ctx, LOGE, FL("Unable to send HT/VHT Cap to FW"));
}
diff --git a/core/mac/src/pe/lim/lim_utils.c b/core/mac/src/pe/lim/lim_utils.c
index c08dbd1b2ed6..daa35ae95ef7 100644
--- a/core/mac/src/pe/lim/lim_utils.c
+++ b/core/mac/src/pe/lim/lim_utils.c
@@ -6507,10 +6507,17 @@ static QDF_STATUS lim_send_ie(tpAniSirGlobal mac_ctx, uint32_t sme_session_id,
*
* Return: true if enabled and false otherwise
*/
-static inline bool lim_get_rx_ldpc(tpAniSirGlobal mac_ctx, uint8_t ch)
+static inline bool lim_get_rx_ldpc(tpAniSirGlobal mac_ctx, uint8_t ch,
+ uint8_t is_hw_mode_dbs)
{
+ enum hw_mode_dbs_capab hw_mode_to_use;
+
+ hw_mode_to_use = is_hw_mode_dbs ? HW_MODE_DBS : HW_MODE_DBS_NONE;
+ lim_log(mac_ctx, LOG1, FL("ch[%d] rx_ldpc[%d] hw_mode_to_use[%d]"),
+ ch, is_hw_mode_dbs, hw_mode_to_use);
if (mac_ctx->roam.configParam.rx_ldpc_enable &&
- wma_is_rx_ldpc_supported_for_channel(CDS_CHANNEL_NUM(ch)))
+ wma_is_rx_ldpc_supported_for_channel(
+ CDS_CHANNEL_NUM(ch), hw_mode_to_use))
return true;
else
return false;
@@ -6528,8 +6535,8 @@ static inline bool lim_get_rx_ldpc(tpAniSirGlobal mac_ctx, uint8_t ch)
* Return: status of operation
*/
QDF_STATUS lim_send_ies_per_band(tpAniSirGlobal mac_ctx,
- tpPESession session,
- uint8_t vdev_id)
+ tpPESession session, uint8_t vdev_id,
+ uint8_t is_hw_mode_dbs)
{
uint8_t ht_caps[DOT11F_IE_HTCAPS_MIN_LEN + 2] = {0};
uint8_t vht_caps[DOT11F_IE_VHTCAPS_MAX_LEN + 2] = {0};
@@ -6547,7 +6554,8 @@ QDF_STATUS lim_send_ies_per_band(tpAniSirGlobal mac_ctx,
lim_set_ht_caps(mac_ctx, session, ht_caps,
DOT11F_IE_HTCAPS_MIN_LEN + 2);
/* Get LDPC and over write for 2G */
- p_ht_cap->advCodingCap = lim_get_rx_ldpc(mac_ctx, CHAN_ENUM_6);
+ p_ht_cap->advCodingCap = lim_get_rx_ldpc(mac_ctx, CHAN_ENUM_6,
+ is_hw_mode_dbs);
/* Get self cap for HT40 support in 2G */
if (mac_ctx->roam.configParam.channelBondingMode24GHz) {
p_ht_cap->supportedChannelWidthSet = 1;
@@ -6562,7 +6570,8 @@ QDF_STATUS lim_send_ies_per_band(tpAniSirGlobal mac_ctx,
* Get LDPC and over write for 5G - using channel 64 because it
* is available in all reg domains.
*/
- p_ht_cap->advCodingCap = lim_get_rx_ldpc(mac_ctx, CHAN_ENUM_64);
+ p_ht_cap->advCodingCap = lim_get_rx_ldpc(mac_ctx, CHAN_ENUM_64,
+ is_hw_mode_dbs);
/* Get self cap for HT40 support in 5G */
if (mac_ctx->roam.configParam.channelBondingMode5GHz) {
p_ht_cap->supportedChannelWidthSet = 1;
@@ -6582,13 +6591,15 @@ QDF_STATUS lim_send_ies_per_band(tpAniSirGlobal mac_ctx,
* Get LDPC and over write for 5G - using channel 64 because it
* is available in all reg domains.
*/
- p_vht_cap->ldpcCodingCap = lim_get_rx_ldpc(mac_ctx, CHAN_ENUM_64);
+ p_vht_cap->ldpcCodingCap = lim_get_rx_ldpc(mac_ctx, CHAN_ENUM_64,
+ is_hw_mode_dbs);
/* Self VHT channel width for 5G is already negotiated with FW */
lim_send_ie(mac_ctx, vdev_id, DOT11F_EID_VHTCAPS,
CDS_BAND_5GHZ, &vht_caps[2], DOT11F_IE_VHTCAPS_MIN_LEN);
/* Get LDPC and over write for 2G */
- p_vht_cap->ldpcCodingCap = lim_get_rx_ldpc(mac_ctx, CHAN_ENUM_6);
+ p_vht_cap->ldpcCodingCap = lim_get_rx_ldpc(mac_ctx, CHAN_ENUM_6,
+ is_hw_mode_dbs);
/* Self VHT 80/160/80+80 channel width for 2G is 0 */
p_vht_cap->supportedChannelWidthSet = 0;
p_vht_cap->shortGI80MHz = 0;
diff --git a/core/mac/src/pe/lim/lim_utils.h b/core/mac/src/pe/lim/lim_utils.h
index 09bca083ab25..b8a73645824b 100644
--- a/core/mac/src/pe/lim/lim_utils.h
+++ b/core/mac/src/pe/lim/lim_utils.h
@@ -630,7 +630,8 @@ QDF_STATUS lim_send_ext_cap_ie(tpAniSirGlobal mac_ctx, uint32_t session_id,
tDot11fIEExtCap *extracted_extcap, bool merge);
QDF_STATUS lim_send_ies_per_band(tpAniSirGlobal mac_ctx,
- tpPESession session, uint8_t vdev_id);
+ tpPESession session, uint8_t vdev_id,
+ uint8_t is_hw_mode_dbs);
tSirRetStatus lim_strip_extcap_ie(tpAniSirGlobal mac_ctx, uint8_t *addn_ie,
uint16_t *addn_ielen, uint8_t *extracted_extcap);
diff --git a/core/sme/inc/csr_api.h b/core/sme/inc/csr_api.h
index 0ed8b61f7fd9..788e688b015b 100644
--- a/core/sme/inc/csr_api.h
+++ b/core/sme/inc/csr_api.h
@@ -1242,6 +1242,7 @@ typedef struct tagCsrConfigParam {
uint8_t scanCfgAgingTime;
uint8_t enable_tx_ldpc;
uint8_t enable_rx_ldpc;
+ uint8_t rx_ldpc_support_for_2g;
uint8_t max_amsdu_num;
uint8_t nSelect5GHzMargin;
uint8_t isCoalesingInIBSSAllowed;
diff --git a/core/sme/inc/csr_internal.h b/core/sme/inc/csr_internal.h
index 97cd4a7b8f6a..bd4ed0b7ba7a 100644
--- a/core/sme/inc/csr_internal.h
+++ b/core/sme/inc/csr_internal.h
@@ -607,6 +607,7 @@ typedef struct tagCsrConfig {
bool send_smps_action;
uint8_t tx_ldpc_enable;
uint8_t rx_ldpc_enable;
+ uint8_t rx_ldpc_support_for_2g;
/*
* Enable/Disable heartbeat offload
*/
diff --git a/core/sme/inc/sme_api.h b/core/sme/inc/sme_api.h
index bd6f96417aa9..d272398257ec 100644
--- a/core/sme/inc/sme_api.h
+++ b/core/sme/inc/sme_api.h
@@ -1276,7 +1276,10 @@ QDF_STATUS sme_create_mon_session(tHalHandle hal_handle, uint8_t *bssid);
QDF_STATUS sme_set_adaptive_dwelltime_config(tHalHandle hal,
struct adaptive_dwelltime_params *dwelltime_params);
-void sme_set_vdev_ies_per_band(tHalHandle hal, uint8_t vdev_id);
+void sme_set_vdev_ies_per_band(uint8_t vdev_id,
+ uint8_t is_hw_mode_dbs);
+bool sme_check_enable_rx_ldpc_sta_ini_item(void);
+QDF_STATUS sme_issue_same_ap_reassoc_cmd(uint8_t session_id);
void sme_set_pdev_ht_vht_ies(tHalHandle hHal, bool enable2x2);
void sme_update_vdev_type_nss(tHalHandle hal, uint8_t max_supp_nss,
diff --git a/core/sme/inc/sme_inside.h b/core/sme/inc/sme_inside.h
index fbc63490bd83..ceb0a58b019c 100644
--- a/core/sme/inc/sme_inside.h
+++ b/core/sme/inc/sme_inside.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012-2016 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2012-2017 The Linux Foundation. All rights reserved.
*
* Previously licensed under the ISC license by Qualcomm Atheros, Inc.
*
@@ -205,6 +205,44 @@ void purge_sme_session_cmd_list(tpAniSirGlobal pMac, uint32_t sessionId,
bool sme_command_pending(tpAniSirGlobal pMac);
bool qos_process_command(tpAniSirGlobal pMac, tSmeCmd *pCommand);
void qos_release_command(tpAniSirGlobal pMac, tSmeCmd *pCommand);
+/**
+ * csr_remove_same_ap_reassoc_cmd() - to remove self reassociation command
+ * issued for STA 2G Rx LDPC case
+ * @mac_ctx: pointer to mac context
+ * @sme_cmd: pointer to sme command which needs to be removed, this should be
+ * self reassociation command
+ *
+ * This API will take care of removing self reassociation command which is
+ * queued up in sme queue.
+ *
+ * Return: none
+ */
+void csr_remove_same_ap_reassoc_cmd(tpAniSirGlobal mac_ctx,
+ tSmeCmd *sme_cmd);
+/**
+ * csr_find_self_reassoc_cmd() - to find self reassociation command for given
+ * session_id
+ * @mac_ctx: pointer to mac context
+ * @session_id: current session_id value
+ *
+ * This API will help to find any self reassociation command present in ACTIVE
+ * queue for the given session_id. it won't find command in PENDING queue.
+ *
+ * Return: pointer to sme_cmd
+ */
+tSmeCmd *csr_find_self_reassoc_cmd(tpAniSirGlobal mac_ctx, uint32_t session_id);
+/**
+ * csr_process_same_ap_reassoc_cmd() - to process same ap reassociation command
+ * @mac_ctx: pointer to mac context
+ * @sme_cmd: pointer to sme command
+ *
+ * This API will process the self reassociation command which is currently being
+ * queued up in active sme queue
+ *
+ * Return: QDF_STATUS
+ */
+QDF_STATUS csr_process_same_ap_reassoc_cmd(tpAniSirGlobal mac_ctx,
+ tSmeCmd *sme_cmd);
QDF_STATUS csr_process_scan_command(tpAniSirGlobal pMac, tSmeCmd *pCommand);
QDF_STATUS csr_roam_process_command(tpAniSirGlobal pMac, tSmeCmd *pCommand);
void csr_roam_process_wm_status_change_command(tpAniSirGlobal pMac,
diff --git a/core/sme/inc/sme_internal.h b/core/sme/inc/sme_internal.h
index 02fe14adb5b9..7052d49bb90b 100644
--- a/core/sme/inc/sme_internal.h
+++ b/core/sme/inc/sme_internal.h
@@ -93,6 +93,7 @@ typedef enum eSmeCommandType {
e_sme_command_nss_update,
e_sme_command_set_dual_mac_config,
e_sme_command_set_antenna_mode,
+ e_sme_command_issue_self_reassoc,
eSmeCommandNdpInitiatorRequest,
eSmeCommandNdpResponderRequest,
eSmeCommandNdpDataEndInitiatorRequest,
diff --git a/core/sme/src/common/sme_api.c b/core/sme/src/common/sme_api.c
index 016f0429d457..88c337211272 100644
--- a/core/sme/src/common/sme_api.c
+++ b/core/sme/src/common/sme_api.c
@@ -1052,6 +1052,10 @@ sme_process_cmd:
csr_ll_unlock(&pMac->sme.smeCmdActiveList);
csr_process_set_antenna_mode(pMac, pCommand);
break;
+ case e_sme_command_issue_self_reassoc:
+ csr_ll_unlock(&pMac->sme.smeCmdActiveList);
+ csr_process_same_ap_reassoc_cmd(pMac, pCommand);
+ break;
default:
/* something is wrong */
/* remove it from the active list */
@@ -2542,6 +2546,7 @@ QDF_STATUS sme_process_msg(tHalHandle hHal, cds_msg_t *pMsg)
{
QDF_STATUS status = QDF_STATUS_E_FAILURE;
tpAniSirGlobal pMac = PMAC_STRUCT(hHal);
+ tSmeCmd *sme_cmd = NULL;
if (pMsg == NULL) {
sms_log(pMac, LOGE, "Empty message for SME");
@@ -2569,6 +2574,34 @@ QDF_STATUS sme_process_msg(tHalHandle hHal, cds_msg_t *pMsg)
csr_process_ho_fail_ind(pMac, pMsg->bodyptr);
qdf_mem_free(pMsg->bodyptr);
break;
+
+ case eWNI_SME_SAME_AP_REASSOC_IND:
+ if (pMac->roam.configParam.rx_ldpc_support_for_2g) {
+ QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_INFO,
+ FL("eWNI_SME_SAME_AP_REASSOC_IND cmd to delete"));
+ sme_cmd = csr_find_self_reassoc_cmd(pMac,
+ pMsg->bodyval);
+ if (sme_cmd) {
+ QDF_TRACE(QDF_MODULE_ID_SME,
+ QDF_TRACE_LEVEL_INFO,
+ FL("found eWNI_SME_SAME_AP_REASSOC_IND"));
+ /*
+ * pMsg->bodyval is nothing but
+ * vdev_id/session_id
+ */
+ csr_remove_same_ap_reassoc_cmd(pMac, sme_cmd);
+ csr_release_command(pMac, sme_cmd);
+ /*
+ * no need to free bodyptr as no
+ * malloc happened
+ */
+ } else {
+ QDF_TRACE(QDF_MODULE_ID_SME,
+ QDF_TRACE_LEVEL_INFO,
+ FL("no eWNI_SME_SAME_AP_REASSOC_IND"));
+ }
+ }
+ break;
#endif
case WNI_CFG_SET_CNF:
case WNI_CFG_DNLD_CNF:
@@ -16612,12 +16645,22 @@ QDF_STATUS sme_set_adaptive_dwelltime_config(tHalHandle hal,
*
* Return: None
*/
-void sme_set_vdev_ies_per_band(tHalHandle hal, uint8_t vdev_id)
+void sme_set_vdev_ies_per_band(uint8_t vdev_id, uint8_t is_hw_mode_dbs)
{
- tpAniSirGlobal p_mac = PMAC_STRUCT(hal);
+ tHalHandle hal = cds_get_context(QDF_MODULE_ID_SME);
+ tpAniSirGlobal p_mac;
struct sir_set_vdev_ies_per_band *p_msg;
QDF_STATUS status = QDF_STATUS_E_FAILURE;
+ if (!hal)
+ return;
+
+ p_mac = PMAC_STRUCT(hal);
+ status = sme_acquire_global_lock(&p_mac->sme);
+ if (!QDF_IS_STATUS_SUCCESS(status)) {
+ sms_log(p_mac, LOGE, FL("Failed to acquire lock"));
+ return;
+ }
p_msg = qdf_mem_malloc(sizeof(*p_msg));
if (NULL == p_msg) {
sms_log(p_mac, LOGE, FL("mem alloc failed for sme msg"));
@@ -16625,6 +16668,7 @@ void sme_set_vdev_ies_per_band(tHalHandle hal, uint8_t vdev_id)
}
p_msg->vdev_id = vdev_id;
+ p_msg->is_hw_mode_dbs = is_hw_mode_dbs;
p_msg->msg_type = eWNI_SME_SET_VDEV_IES_PER_BAND;
p_msg->len = sizeof(*p_msg);
sms_log(p_mac, LOGD,
@@ -16633,8 +16677,70 @@ void sme_set_vdev_ies_per_band(tHalHandle hal, uint8_t vdev_id)
status = cds_send_mb_message_to_mac(p_msg);
if (QDF_STATUS_SUCCESS != status)
sms_log(p_mac, LOGE,
- FL("Send eWNI_SME_SET_VDEV_IES_PER_BAND fail"));
+ FL("Send eWNI_SME_SET_VDEV_IES_PER_BAND fail"));
+ sme_release_global_lock(&p_mac->sme);
+}
+
+bool sme_check_enable_rx_ldpc_sta_ini_item(void)
+{
+ tHalHandle hal = cds_get_context(QDF_MODULE_ID_SME);
+ tpAniSirGlobal mac_ctx;
+
+ if (!hal)
+ return false;
+ mac_ctx = PMAC_STRUCT(hal);
+ if (!mac_ctx->roam.configParam.rx_ldpc_support_for_2g) {
+ sms_log(mac_ctx, LOG1,
+ FL("2G STA Rx LDPC is disabled from ini"));
+ return false;
+ }
+ sms_log(mac_ctx, LOG1,
+ FL("2G STA Rx LDPC is enabled from ini"));
+
+ return true;
+}
+
+#ifdef WLAN_FEATURE_ROAM_OFFLOAD
+QDF_STATUS sme_issue_same_ap_reassoc_cmd(uint8_t session_id)
+{
+ QDF_STATUS status = QDF_STATUS_SUCCESS;
+ tSmeCmd *cmd = NULL;
+ tHalHandle hal = cds_get_context(QDF_MODULE_ID_SME);
+ tpAniSirGlobal mac_ctx;
+
+ if (!hal)
+ return false;
+
+ mac_ctx = PMAC_STRUCT(hal);
+ status = sme_acquire_global_lock(&mac_ctx->sme);
+ if (!QDF_IS_STATUS_SUCCESS(status)) {
+ sms_log(mac_ctx, LOGE, FL("Failed to acquire lock"));
+ return QDF_STATUS_E_RESOURCES;
+ }
+
+ cmd = csr_get_command_buffer(mac_ctx);
+ if (!cmd) {
+ sms_log(mac_ctx, LOGE, FL("Get command buffer failed"));
+ sme_release_global_lock(&mac_ctx->sme);
+ return QDF_STATUS_E_NULL_VALUE;
+ }
+
+ cmd->command = e_sme_command_issue_self_reassoc;
+ cmd->sessionId = session_id;
+
+ sms_log(mac_ctx, LOG1, FL("Queuing self reassoc to CSR, session:%d"),
+ cmd->sessionId);
+ csr_queue_sme_command(mac_ctx, cmd, false);
+
+ sme_release_global_lock(&mac_ctx->sme);
+ return QDF_STATUS_SUCCESS;
+}
+#else
+QDF_STATUS sme_issue_same_ap_reassoc_cmd(uint8_t session_id)
+{
+ return QDF_STATUS_SUCCESS;
}
+#endif
/**
* sme_set_pdev_ht_vht_ies() - sends the set pdev IE req
diff --git a/core/sme/src/csr/csr_api_roam.c b/core/sme/src/csr/csr_api_roam.c
index 1338b1dbc482..0763237ae2e6 100644
--- a/core/sme/src/csr/csr_api_roam.c
+++ b/core/sme/src/csr/csr_api_roam.c
@@ -278,6 +278,58 @@ static void csr_ser_des_unpack_diassoc_rsp(uint8_t *pBuf,
tSirSmeDisassocRsp *pRsp);
void csr_init_operating_classes(tHalHandle hHal);
+#ifdef WLAN_FEATURE_ROAM_OFFLOAD
+QDF_STATUS csr_process_same_ap_reassoc_cmd(tpAniSirGlobal mac_ctx,
+ tSmeCmd *sme_cmd)
+{
+ QDF_STATUS status;
+ tCsrRoamSession *session;
+ struct wma_roam_invoke_cmd *fastreassoc;
+ cds_msg_t msg = {0};
+
+ session = CSR_GET_SESSION(mac_ctx, sme_cmd->sessionId);
+ if (!session) {
+ sms_log(mac_ctx, LOGE, FL("Invalid session"));
+ csr_remove_same_ap_reassoc_cmd(mac_ctx, sme_cmd);
+ csr_release_command(mac_ctx, sme_cmd);
+ return QDF_STATUS_E_FAILURE;
+ }
+ fastreassoc = qdf_mem_malloc(sizeof(*fastreassoc));
+ if (NULL == fastreassoc) {
+ sms_log(mac_ctx, LOGE, FL("can't allocate memory"));
+ csr_remove_same_ap_reassoc_cmd(mac_ctx, sme_cmd);
+ csr_release_command(mac_ctx, sme_cmd);
+ return QDF_STATUS_E_FAILURE;
+ }
+ fastreassoc->vdev_id = sme_cmd->sessionId;
+ fastreassoc->channel = session->connectedProfile.operationChannel;
+ fastreassoc->bssid[0] = session->connectedProfile.bssid.bytes[0];
+ fastreassoc->bssid[1] = session->connectedProfile.bssid.bytes[1];
+ fastreassoc->bssid[2] = session->connectedProfile.bssid.bytes[2];
+ fastreassoc->bssid[3] = session->connectedProfile.bssid.bytes[3];
+ fastreassoc->bssid[4] = session->connectedProfile.bssid.bytes[4];
+ fastreassoc->bssid[5] = session->connectedProfile.bssid.bytes[5];
+ sms_log(mac_ctx, LOG1, FL("self reassoc on channe[%d] bssid[%pM]"),
+ fastreassoc->channel, fastreassoc->bssid);
+
+ msg.type = SIR_HAL_ROAM_INVOKE;
+ msg.reserved = 0;
+ msg.bodyptr = fastreassoc;
+ status = cds_mq_post_message(QDF_MODULE_ID_WMA, &msg);
+ if (QDF_STATUS_SUCCESS != status) {
+ sms_log(mac_ctx, LOGE, FL("Not able to post ROAM_INVOKE_CMD"));
+ qdf_mem_free(fastreassoc);
+ }
+ return status;
+}
+#else
+QDF_STATUS csr_process_same_ap_reassoc_cmd(tpAniSirGlobal mac_ctx,
+ tSmeCmd *sme_cmd)
+{
+ return QDF_STATUS_SUCCESS;
+}
+#endif
+
/* Initialize global variables */
static void csr_roam_init_globals(tpAniSirGlobal pMac)
{
@@ -2484,6 +2536,8 @@ QDF_STATUS csr_change_default_config_param(tpAniSirGlobal pMac,
pParam->send_smps_action;
pMac->roam.configParam.tx_ldpc_enable = pParam->enable_tx_ldpc;
pMac->roam.configParam.rx_ldpc_enable = pParam->enable_rx_ldpc;
+ pMac->roam.configParam.rx_ldpc_support_for_2g =
+ pParam->rx_ldpc_support_for_2g;
pMac->roam.configParam.ignore_peer_erp_info =
pParam->ignore_peer_erp_info;
pMac->roam.configParam.max_amsdu_num =
@@ -2743,6 +2797,8 @@ QDF_STATUS csr_get_config_param(tpAniSirGlobal pMac, tCsrConfigParam *pParam)
#endif
pParam->enable_tx_ldpc = cfg_params->tx_ldpc_enable;
pParam->enable_rx_ldpc = cfg_params->rx_ldpc_enable;
+ pParam->rx_ldpc_support_for_2g =
+ cfg_params->rx_ldpc_support_for_2g;
pParam->max_amsdu_num = cfg_params->max_amsdu_num;
pParam->nSelect5GHzMargin = cfg_params->nSelect5GHzMargin;
pParam->isCoalesingInIBSSAllowed = cfg_params->isCoalesingInIBSSAllowed;
@@ -13795,7 +13851,7 @@ static void csr_add_supported_5Ghz_channels(tpAniSirGlobal mac_ctx,
*/
static QDF_STATUS csr_set_ldpc_exception(tpAniSirGlobal mac_ctx,
tCsrRoamSession *session, uint8_t channel,
- bool usr_cfg_rx_ldpc)
+ bool usr_cfg_rx_ldpc, enum hw_mode_dbs_capab hw_mode)
{
if (!mac_ctx) {
QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_ERROR,
@@ -13807,16 +13863,20 @@ static QDF_STATUS csr_set_ldpc_exception(tpAniSirGlobal mac_ctx,
"session is NULL");
return QDF_STATUS_E_FAILURE;
}
- if (usr_cfg_rx_ldpc && wma_is_rx_ldpc_supported_for_channel(channel)) {
+ QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_DEBUG,
+ "using user given hw_mode [%d]", hw_mode);
+ if (usr_cfg_rx_ldpc && wma_is_rx_ldpc_supported_for_channel(channel,
+ hw_mode)) {
session->htConfig.ht_rx_ldpc = 1;
session->vht_config.ldpc_coding = 1;
QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_DEBUG,
- "LDPC enable for chnl[%d]", channel);
+ "LDPC enable for chnl[%d] for hwmode[%d]",
+ channel, hw_mode);
} else {
session->htConfig.ht_rx_ldpc = 0;
session->vht_config.ldpc_coding = 0;
QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_DEBUG,
- "LDPC disable for chnl[%d]", channel);
+ "LDPC disable for chnl[%d]", channel);
}
return QDF_STATUS_SUCCESS;
}
@@ -13857,6 +13917,7 @@ QDF_STATUS csr_send_join_req_msg(tpAniSirGlobal pMac, uint32_t sessionId,
tpCsrNeighborRoamControlInfo neigh_roam_info;
uint32_t value = 0, value1 = 0;
QDF_STATUS packetdump_timer_status;
+ enum hw_mode_dbs_capab hw_mode_to_use;
if (!pSession) {
sms_log(pMac, LOGE, FL(" session %d not found "), sessionId);
@@ -14328,15 +14389,48 @@ QDF_STATUS csr_send_join_req_msg(tpAniSirGlobal pMac, uint32_t sessionId,
csr_apply_power2_current(pMac);
}
/*
- * If RX LDPC has been disabled for 2.4GHz channels and enabled
- * for 5Ghz for STA like persona then here is how to handle
- * those cases (by now channel has been decided).
+ * LDPC exception is called for hardware limitation:
+ * PHY-A can do Rx LPDC and PHY-B can't do Rx LDPC on some
+ * of platforms due to which when-ever we enter in to DBS
+ * and channel is 2.4G then the connection will end up on
+ * PHY-B where Rx LDPC is not supported and when-ever we
+ * enter in to NON-DBS and channel is 2.4G then the connection
+ * will end up on PHY-A where Rx LDPC is supported.
+ * 5G connection always stays on PHY-A.
+ *
+ * if user has configured 2G RX LDPC support enabled then use
+ * current hw mode to configure Rx LDPC properly. if user has
+ * not configured 2G RX LDPC support then use DBS hardware mode
+ * which will give you 5G RxLDPC bit "1" and 2G RxLDPC bit "0".
+ *
*/
if (eSIR_INFRASTRUCTURE_MODE == csr_join_req->bsstype ||
- !wma_is_dbs_enable())
- csr_set_ldpc_exception(pMac, pSession,
+ !wma_is_dbs_enable()) {
+ sms_log(pMac, LOGD,
+ FL("Rx ldpc ini[%d] and 2G RX LDPC[%d]"),
+ pMac->roam.configParam.rx_ldpc_enable,
+ pMac->roam.configParam.rx_ldpc_support_for_2g);
+ if (pMac->roam.configParam.rx_ldpc_support_for_2g) {
+ hw_mode_to_use = wma_is_current_hwmode_dbs() ?
+ HW_MODE_DBS :
+ HW_MODE_DBS_NONE;
+ sms_log(pMac, LOGD,
+ FL("2G RxLDPC & roaming ON: hwmode-%d"),
+ hw_mode_to_use);
+ csr_set_ldpc_exception(pMac, pSession,
pBssDescription->channelId,
- pMac->roam.configParam.rx_ldpc_enable);
+ pMac->roam.configParam.rx_ldpc_enable,
+ hw_mode_to_use);
+ } else {
+ sms_log(pMac, LOGD,
+ FL("2G RxLDPC/roaming OFF: hwmode-%d"),
+ HW_MODE_DBS);
+ csr_set_ldpc_exception(pMac, pSession,
+ pBssDescription->channelId,
+ pMac->roam.configParam.rx_ldpc_enable,
+ HW_MODE_DBS);
+ }
+ }
qdf_mem_copy(&csr_join_req->htConfig,
&pSession->htConfig, sizeof(tSirHTConfig));
qdf_mem_copy(&csr_join_req->vht_config, &pSession->vht_config,
@@ -15049,6 +15143,7 @@ QDF_STATUS csr_send_mb_start_bss_req_msg(tpAniSirGlobal pMac, uint32_t sessionId
tSirSmeStartBssReq *pMsg;
uint16_t wTmp;
uint32_t value = 0;
+
tCsrRoamSession *pSession = CSR_GET_SESSION(pMac, sessionId);
if (!pSession) {
@@ -15148,13 +15243,20 @@ QDF_STATUS csr_send_mb_start_bss_req_msg(tpAniSirGlobal pMac, uint32_t sessionId
sizeof(tSirMacRateSet));
/*
* If RX LDPC has been disabled for 2.4GHz channels and enabled
- * for 5Ghz for STA like persona then here is how to handle
+ * for 5Ghz for STA/IBSS persona then here is how to handle
* those cases (by now channel has been decided).
*/
- if (eSIR_IBSS_MODE == pMsg->bssType || !wma_is_dbs_enable())
+ if (eSIR_IBSS_MODE == pMsg->bssType || !wma_is_dbs_enable()) {
+ /*
+ * faking DBS hardware mode, so IBSS will enable rxLDPC
+ * for 5G and disable rxLDPC
+ */
+ sms_log(pMac, LOGD, FL("Rx LDPC : hwmode-%d"), HW_MODE_DBS);
csr_set_ldpc_exception(pMac, pSession,
pMsg->channelId,
- pMac->roam.configParam.rx_ldpc_enable);
+ pMac->roam.configParam.rx_ldpc_enable,
+ HW_MODE_DBS);
+ }
qdf_mem_copy(&pMsg->vht_config,
&pSession->vht_config,
sizeof(pSession->vht_config));
diff --git a/core/sme/src/csr/csr_api_scan.c b/core/sme/src/csr/csr_api_scan.c
index 3a922ea74925..bb53967edae9 100644
--- a/core/sme/src/csr/csr_api_scan.c
+++ b/core/sme/src/csr/csr_api_scan.c
@@ -6164,6 +6164,63 @@ void csr_release_scan_command(tpAniSirGlobal pMac, tSmeCmd *pCommand,
csr_release_command_scan(pMac, pCommand);
}
+#ifdef WLAN_FEATURE_ROAM_OFFLOAD
+tSmeCmd *csr_find_self_reassoc_cmd(tpAniSirGlobal mac_ctx, uint32_t session_id)
+{
+ tDblLinkList *cmd_list = NULL;
+ tListElem *entry;
+ tSmeCmd *temp_cmd = NULL;
+
+ cmd_list = &mac_ctx->sme.smeCmdActiveList;
+ entry = csr_ll_peek_head(cmd_list, LL_ACCESS_LOCK);
+ if (!entry) {
+ sms_log(mac_ctx, LOGE, FL("Queue empty"));
+ return NULL;
+ }
+ temp_cmd = GET_BASE_ADDR(entry, tSmeCmd, Link);
+ if ((temp_cmd->command != e_sme_command_issue_self_reassoc) ||
+ (temp_cmd->sessionId != session_id)) {
+ sms_log(mac_ctx, LOG1,
+ FL("no self-reassoc cmd active"));
+ return NULL;
+ }
+
+ return temp_cmd;
+}
+
+void csr_remove_same_ap_reassoc_cmd(tpAniSirGlobal mac_ctx, tSmeCmd *sme_cmd)
+{
+ bool status = false;
+ tDblLinkList *cmd_list = NULL;
+
+ cmd_list = &mac_ctx->sme.smeCmdActiveList;
+ sms_log(mac_ctx, LOG1,
+ FL("Remove self reassoc cmd = %d, session_id = %d"),
+ sme_cmd->command, sme_cmd->sessionId);
+ status = csr_ll_remove_entry(cmd_list,
+ &sme_cmd->Link, LL_ACCESS_LOCK);
+ if (!status) {
+ sms_log(mac_ctx, LOGE,
+ FL("can't del self-reassoc cmd %d session %d"),
+ sme_cmd->command, sme_cmd->sessionId);
+ QDF_ASSERT(0);
+ }
+ sme_process_pending_queue(mac_ctx);
+
+ return;
+}
+#else
+tSmeCmd *csr_find_self_reassoc_cmd(tpAniSirGlobal mac_ctx, uint32_t session_id)
+{
+ return NULL;
+}
+
+void csr_remove_same_ap_reassoc_cmd(tpAniSirGlobal mac_ctx,
+ tSmeCmd *sme_cmd, uint32_t session_id)
+{
+}
+#endif
+
QDF_STATUS csr_scan_get_pmkid_candidate_list(tpAniSirGlobal pMac,
uint32_t sessionId,
tPmkidCandidateInfo *pPmkidList,
diff --git a/core/wma/inc/wma_api.h b/core/wma/inc/wma_api.h
index 39853137cb6a..db602c91719c 100644
--- a/core/wma/inc/wma_api.h
+++ b/core/wma/inc/wma_api.h
@@ -259,7 +259,8 @@ bool wma_get_prev_dbs_plus_agile_scan_config(void);
bool wma_get_prev_single_mac_scan_with_dfs_config(void);
QDF_STATUS wma_get_caps_for_phyidx_hwmode(struct wma_caps_per_phy *caps_per_phy,
enum hw_mode_dbs_capab hw_mode, enum cds_band_type band);
-bool wma_is_rx_ldpc_supported_for_channel(uint32_t channel);
+bool wma_is_rx_ldpc_supported_for_channel(uint32_t channel,
+ enum hw_mode_dbs_capab hw_mode);
#define LRO_IPV4_SEED_ARR_SZ 5
#define LRO_IPV6_SEED_ARR_SZ 11
diff --git a/core/wma/src/wma_main.c b/core/wma/src/wma_main.c
index 5e6b3303ff73..cf49754a4eeb 100644
--- a/core/wma/src/wma_main.c
+++ b/core/wma/src/wma_main.c
@@ -4974,12 +4974,14 @@ QDF_STATUS wma_get_caps_for_phyidx_hwmode(struct wma_caps_per_phy *caps_per_phy,
/**
* wma_is_rx_ldpc_supported_for_channel() - to find out if ldpc is supported
*
- * @channel: Channel number for which it needs to check if rx ldpc is enabled
+ * @channel: Channel number for which it needs to check if rx ldpc is supported
+ * @hw_mode: hw mode for which it needs to check if rx ldpc is supported.
*
- * This API takes channel number as argument and takes default hw mode as DBS
+ * This API takes channel number and hw mode as arguments
* to check if rx LDPC support is enabled for that channel or no
*/
-bool wma_is_rx_ldpc_supported_for_channel(uint32_t channel)
+bool wma_is_rx_ldpc_supported_for_channel(uint32_t channel,
+ enum hw_mode_dbs_capab hw_mode)
{
struct wma_caps_per_phy caps_per_phy = {0};
enum cds_band_type band;
@@ -4992,7 +4994,7 @@ bool wma_is_rx_ldpc_supported_for_channel(uint32_t channel)
if (QDF_STATUS_SUCCESS != wma_get_caps_for_phyidx_hwmode(
&caps_per_phy,
- HW_MODE_DBS, band)) {
+ hw_mode, band)) {
return false;
}
if (CDS_IS_CHANNEL_24GHZ(channel))
diff --git a/core/wma/src/wma_scan_roam.c b/core/wma/src/wma_scan_roam.c
index 250f41a943d7..7e6fffe37fab 100644
--- a/core/wma/src/wma_scan_roam.c
+++ b/core/wma/src/wma_scan_roam.c
@@ -2298,6 +2298,43 @@ static void wma_roam_update_vdev(tp_wma_handle wma,
qdf_mem_free(add_sta_params);
}
+
+#ifdef WLAN_FEATURE_ROAM_OFFLOAD
+/**
+ * wma_roam_remove_self_reassoc() - post a message to SME module to indicate
+ * to remove self reassociation command from
+ * sme active queue.
+ * @wma: pointer to wma handle
+ * @vdev_id: vdev id or sme session id which needs to cleaned up
+ *
+ * Post a message to SME module to indicate to remove self reassociation command
+ * from sme active queue, so that next command from sme pending queue can be
+ * processed.
+ *
+ * Return: none
+ */
+static void wma_roam_remove_self_reassoc(tp_wma_handle wma, uint32_t vdev_id)
+{
+ cds_msg_t sme_msg = { 0 };
+ QDF_STATUS qdf_status;
+
+ sme_msg.type = eWNI_SME_SAME_AP_REASSOC_IND;
+ sme_msg.bodyptr = NULL;
+ sme_msg.bodyval = vdev_id;
+
+ qdf_status = cds_mq_post_message(QDF_MODULE_ID_SME, &sme_msg);
+ if (!QDF_IS_STATUS_SUCCESS(qdf_status)) {
+ WMA_LOGE("Fail to post eWNI_SME_SAME_AP_REASSOC_IND to SME");
+ return;
+ }
+ return;
+}
+#else
+static void wma_roam_remove_self_reassoc(tp_wma_handle wma, uint32_t vdev_id)
+{
+}
+#endif
+
/**
* wma_roam_synch_event_handler() - roam synch event handler
* @handle: wma handle
@@ -2421,6 +2458,9 @@ cleanup_label:
if (bss_desc_ptr)
qdf_mem_free(bss_desc_ptr);
wma->interfaces[synch_event->vdev_id].roam_synch_in_progress = false;
+ wma_roam_remove_self_reassoc(wma, synch_event->vdev_id);
+ WMA_LOGD("LFR3: Remove any pending self reassoc cmd for vdev_id: %d",
+ synch_event->vdev_id);
return status;
}
@@ -5803,6 +5843,25 @@ int wma_roam_event_callback(WMA_HANDLE handle, uint8_t *event_buf,
wmi_event->reason, wmi_event->vdev_id);
break;
}
+ /*
+ * LFR3 module will only send ROAM_ABORT, HO_FAILED, or ROAM_SUCCESS up
+ * on ROAM_START indication. ROAM_SUCCESS is handled in seperate
+ * function. WMI_ROAM_REASON_INVOKE_ROAM_FAIL can be send when LFR3
+ * can't find AP on that channel, so it can't start ROAMING
+ */
+ if (((WMI_ROAM_REASON_INVALID == wmi_event->reason) &&
+ (WMI_ROAM_NOTIF_ROAM_ABORT ==
+ wmi_event->notif))
+ || (WMI_ROAM_REASON_HO_FAILED == wmi_event->reason)
+ || (WMI_ROAM_REASON_INVOKE_ROAM_FAIL ==
+ wmi_event->reason)) {
+ WMA_LOGI(FL("SELF-REASSOC: Roam reason-%x notif-%x vdevid-%x"),
+ wmi_event->reason, wmi_event->notif,
+ wmi_event->vdev_id);
+ wma_roam_remove_self_reassoc(wma_handle, wmi_event->vdev_id);
+ cds_restart_opportunistic_timer(false);
+ }
+
return 0;
}