summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinux Build Service Account <lnxbuild@localhost>2019-01-30 01:11:42 -0800
committerLinux Build Service Account <lnxbuild@localhost>2019-01-30 01:11:42 -0800
commit335b1befc30e34007c920b2e088b84d4a1975c1e (patch)
tree4e3f9334e29fd21c51292aa6fb3c3d1dbb9c206f
parented87abad72cd588aa05e7215d39caf77f775d018 (diff)
parentd5549e051c21b59d8b355b6512a839a9d189006c (diff)
Merge d5549e051c21b59d8b355b6512a839a9d189006c on remote branch
Change-Id: I53854e5fc3ae3aa443d53a1b569cf558c431377f
-rw-r--r--core/hdd/inc/wlan_hdd_cfg.h15
-rw-r--r--core/hdd/src/wlan_hdd_cfg.c7
-rw-r--r--core/hdd/src/wlan_hdd_cfg80211.c5
-rw-r--r--core/hdd/src/wlan_hdd_driver_ops.c21
-rw-r--r--core/hdd/src/wlan_hdd_main.c89
-rw-r--r--core/hdd/src/wlan_hdd_tdls.c5
-rw-r--r--core/mac/inc/qwlan_version.h4
-rw-r--r--core/mac/inc/sir_api.h32
-rw-r--r--core/mac/src/include/sir_params.h2
-rw-r--r--core/mac/src/pe/include/sch_api.h28
-rw-r--r--core/mac/src/pe/lim/lim_ibss_peer_mgmt.c4
-rw-r--r--core/mac/src/pe/lim/lim_process_message_queue.c8
-rw-r--r--core/mac/src/pe/lim/lim_process_mlm_rsp_messages.c19
-rw-r--r--core/mac/src/pe/lim/lim_process_sme_req_messages.c90
-rw-r--r--core/mac/src/pe/lim/lim_send_messages.c56
-rw-r--r--core/mac/src/pe/lim/lim_send_messages.h4
-rw-r--r--core/mac/src/pe/lim/lim_send_sme_rsp_messages.c29
-rw-r--r--core/mac/src/pe/lim/lim_session.c1
-rw-r--r--core/mac/src/pe/lim/lim_types.h28
-rw-r--r--core/mac/src/pe/lim/lim_utils.c9
-rw-r--r--core/mac/src/pe/sch/sch_api.c25
-rw-r--r--core/mac/src/pe/sch/sch_beacon_gen.c86
-rw-r--r--core/mac/src/pe/sch/sch_beacon_process.c6
-rw-r--r--core/mac/src/sys/legacy/src/utils/src/mac_trace.c1
-rw-r--r--core/sme/src/common/sme_api.c12
-rw-r--r--core/sme/src/csr/csr_api_roam.c14
-rw-r--r--core/wma/inc/wma_api.h12
-rw-r--r--core/wma/inc/wma_if.h23
-rw-r--r--core/wma/inc/wma_types.h2
-rw-r--r--core/wma/src/wma_dev_if.c94
-rw-r--r--core/wma/src/wma_main.c1
-rw-r--r--core/wma/src/wma_mgmt.c17
-rw-r--r--core/wma/src/wma_utils.c65
33 files changed, 452 insertions, 362 deletions
diff --git a/core/hdd/inc/wlan_hdd_cfg.h b/core/hdd/inc/wlan_hdd_cfg.h
index 7d8cfcc4d4a1..1d3c9f2430e3 100644
--- a/core/hdd/inc/wlan_hdd_cfg.h
+++ b/core/hdd/inc/wlan_hdd_cfg.h
@@ -3609,6 +3609,20 @@ enum hdd_dot11_mode {
#define CFG_FW_RSSI_MONITORING_DEFAULT (1)
/*
+ * gEnableRTTsupport
+ *
+ * @Min: 0 - Disabled
+ * @Max: 1 - Enabled
+ * @Default: 1 - Enabled
+ *
+ * The param is used to enable/disable support for RTT
+ */
+#define CFG_ENABLE_RTT_SUPPORT "gEnableRTTSupport"
+#define CFG_ENABLE_RTT_SUPPORT_DEFAULT (1)
+#define CFG_ENABLE_RTT_SUPPORT_MIN (0)
+#define CFG_ENABLE_RTT_SUPPORT_MAX (1)
+
+/*
* <ini>
* gFWMccRtsCtsProtection - RTS-CTS protection in MCC.
* @Min: 0
@@ -16136,6 +16150,7 @@ struct hdd_config {
bool roam_force_rssi_trigger;
uint32_t roam_preauth_retry_count;
uint32_t roam_preauth_no_ack_timeout;
+ uint32_t enable_rtt_support;
};
#define VAR_OFFSET(_Struct, _Var) (offsetof(_Struct, _Var))
diff --git a/core/hdd/src/wlan_hdd_cfg.c b/core/hdd/src/wlan_hdd_cfg.c
index d2ebcaf18a61..32878f57fe6e 100644
--- a/core/hdd/src/wlan_hdd_cfg.c
+++ b/core/hdd/src/wlan_hdd_cfg.c
@@ -3618,6 +3618,13 @@ struct reg_table_entry g_registry_table[] = {
CFG_ENABLE_NON_DFS_CHAN_ON_RADAR_MIN,
CFG_ENABLE_NON_DFS_CHAN_ON_RADAR_MAX),
+ REG_VARIABLE(CFG_ENABLE_RTT_SUPPORT, WLAN_PARAM_Integer,
+ struct hdd_config, enable_rtt_support,
+ VAR_FLAGS_OPTIONAL,
+ CFG_ENABLE_RTT_SUPPORT_DEFAULT,
+ CFG_ENABLE_RTT_SUPPORT_MIN,
+ CFG_ENABLE_RTT_SUPPORT_MAX ),
+
REG_VARIABLE(CFG_P2P_LISTEN_DEFER_INTERVAL_NAME, WLAN_PARAM_Integer,
struct hdd_config, p2p_listen_defer_interval,
VAR_FLAGS_OPTIONAL |
diff --git a/core/hdd/src/wlan_hdd_cfg80211.c b/core/hdd/src/wlan_hdd_cfg80211.c
index 51688c5373cd..a4cadd4b5fd9 100644
--- a/core/hdd/src/wlan_hdd_cfg80211.c
+++ b/core/hdd/src/wlan_hdd_cfg80211.c
@@ -2145,8 +2145,9 @@ __wlan_hdd_cfg80211_get_supported_features(struct wiphy *wiphy,
hdd_debug("NAN is supported by firmware");
fset |= WIFI_FEATURE_NAN;
}
- if (sme_is_feature_supported_by_fw(RTT)) {
- hdd_debug("RTT is supported by firmware");
+ if (sme_is_feature_supported_by_fw(RTT) &&
+ pHddCtx->config->enable_rtt_support) {
+ hdd_debug("RTT is supported by firmware and framework");
fset |= WIFI_FEATURE_D2D_RTT;
fset |= WIFI_FEATURE_D2AP_RTT;
}
diff --git a/core/hdd/src/wlan_hdd_driver_ops.c b/core/hdd/src/wlan_hdd_driver_ops.c
index ffa23a1b8c54..5ea6188a20ab 100644
--- a/core/hdd/src/wlan_hdd_driver_ops.c
+++ b/core/hdd/src/wlan_hdd_driver_ops.c
@@ -403,10 +403,14 @@ static int wlan_hdd_probe(struct device *dev, void *bdev, const struct hif_bus_i
if (ret)
goto err_hdd_deinit;
-
- if (reinit) {
- cds_set_recovery_in_progress(false);
- } else {
+ /*
+ * Recovery in progress flag will be set if SSR triggered.
+ * If SSR is triggered during Load time, this flag will be set
+ * so reset of this flag should be done in both the cases,
+ * during load time and during re-init
+ */
+ cds_set_recovery_in_progress(false);
+ if (!reinit) {
cds_set_load_in_progress(false);
cds_set_driver_loaded(true);
hdd_start_complete(0);
@@ -429,10 +433,10 @@ err_hdd_deinit:
re_init_fail_cnt >= SSR_MAX_FAIL_CNT)
QDF_BUG(0);
- if (reinit) {
+ cds_set_recovery_in_progress(false);
+ if (reinit)
cds_set_driver_in_bad_state(true);
- cds_set_recovery_in_progress(false);
- } else
+ else
cds_set_load_in_progress(false);
err_init_qdf_ctx:
@@ -1388,7 +1392,8 @@ static void wlan_hdd_set_the_pld_uevent(struct pld_uevent_data *uevent)
case PLD_FW_DOWN:
case PLD_RECOVERY:
cds_set_target_ready(false);
- cds_set_recovery_in_progress(true);
+ if (!cds_is_driver_loading())
+ cds_set_recovery_in_progress(true);
break;
default:
return;
diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c
index 8c4989301e23..3c989d4f9ffb 100644
--- a/core/hdd/src/wlan_hdd_main.c
+++ b/core/hdd/src/wlan_hdd_main.c
@@ -2020,51 +2020,62 @@ static int hdd_mon_open(struct net_device *dev)
static QDF_STATUS
wlan_hdd_update_dbs_scan_and_fw_mode_config(void)
{
- struct sir_dual_mac_config cfg = {0};
- QDF_STATUS status;
- uint32_t channel_select_logic_conc;
- hdd_context_t *hdd_ctx;
-
- hdd_ctx = cds_get_context(QDF_MODULE_ID_HDD);
- if (!hdd_ctx) {
- hdd_err("HDD context is NULL");
- return QDF_STATUS_E_FAILURE;
- }
- if (!wma_is_hw_dbs_capable())
- return QDF_STATUS_SUCCESS;
+ struct sir_dual_mac_config cfg = {0};
+ QDF_STATUS status;
+ uint32_t chnl_sel_logic_conc = 0, dbs_disable;
+ hdd_context_t *hdd_ctx;
- cfg.scan_config = 0;
- cfg.fw_mode_config = 0;
- cfg.set_dual_mac_cb = cds_soc_set_dual_mac_cfg_cb;
+ hdd_ctx = cds_get_context(QDF_MODULE_ID_HDD);
+ if (!hdd_ctx) {
+ hdd_err("HDD context is NULL");
+ return QDF_STATUS_E_FAILURE;
+ }
- channel_select_logic_conc = hdd_ctx->config->
- channel_select_logic_conc;
+ /*
+ * ROME platform doesn't support any DBS related commands in FW,
+ * so if driver sends wmi command with dual_mac_config with all set to
+ * 0 then FW wouldn't respond back and driver would timeout on waiting
+ * for response. Check if FW supports DBS to eliminate ROME vs
+ * NON-ROME platform.
+ */
+ if (!wma_find_if_fw_supports_dbs())
+ return QDF_STATUS_SUCCESS;
- if (hdd_ctx->config->dual_mac_feature_disable !=
- DISABLE_DBS_CXN_AND_SCAN) {
- status = wma_get_updated_scan_and_fw_mode_config(
- &cfg.scan_config, &cfg.fw_mode_config,
- hdd_ctx->config->dual_mac_feature_disable,
- channel_select_logic_conc);
+ cfg.scan_config = 0;
+ cfg.fw_mode_config = 0;
+ cfg.set_dual_mac_cb = cds_soc_set_dual_mac_cfg_cb;
- if (status != QDF_STATUS_SUCCESS) {
- hdd_err("wma_get_updated_scan_and_fw_mode_config failed %d",
- status);
- return status;
- }
- }
+ if (wma_is_hw_dbs_capable())
+ chnl_sel_logic_conc =
+ hdd_ctx->config->channel_select_logic_conc;
- hdd_debug("send scan_cfg: 0x%x fw_mode_cfg: 0x%x to fw",
- cfg.scan_config, cfg.fw_mode_config);
+ dbs_disable = hdd_ctx->config->dual_mac_feature_disable;
+ if (hdd_ctx->config->dual_mac_feature_disable !=
+ DISABLE_DBS_CXN_AND_SCAN) {
+ status =
+ wma_get_updated_scan_and_fw_mode_config(&cfg.scan_config,
+ &cfg.fw_mode_config,
+ dbs_disable,
+ chnl_sel_logic_conc);
- status = sme_soc_set_dual_mac_config(hdd_ctx->hHal, cfg);
if (status != QDF_STATUS_SUCCESS) {
- hdd_err("sme_soc_set_dual_mac_config failed %d",
+ hdd_err("can't get updated scan and fw cfg status:%d",
status);
return status;
}
+ }
- return QDF_STATUS_SUCCESS;
+ hdd_debug("send scan_cfg: 0x%x fw_mode_cfg: 0x%x to fw",
+ cfg.scan_config, cfg.fw_mode_config);
+
+ status = sme_soc_set_dual_mac_config(hdd_ctx->hHal, cfg);
+ if (status != QDF_STATUS_SUCCESS) {
+ hdd_err("sme_soc_set_dual_mac_config failed %d",
+ status);
+ return status;
+ }
+
+ return QDF_STATUS_SUCCESS;
}
/**
* hdd_start_adapter() - Wrapper function for device specific adapter
@@ -7405,6 +7416,7 @@ static void hdd_bus_bw_compute_cbk(void *priv)
{
hdd_context_t *hdd_ctx = (hdd_context_t *)priv;
hdd_adapter_t *adapter = NULL;
+ hdd_adapter_t *sap_adapter = NULL;
uint64_t tx_packets = 0, rx_packets = 0;
uint64_t fwd_tx_packets = 0, fwd_rx_packets = 0;
uint64_t fwd_tx_packets_diff = 0, fwd_rx_packets_diff = 0;
@@ -7448,6 +7460,9 @@ static void hdd_bus_bw_compute_cbk(void *priv)
continue;
}
+ if (adapter->device_mode == QDF_SAP_MODE)
+ sap_adapter = adapter;
+
tx_packets += HDD_BW_GET_DIFF(adapter->stats.tx_packets,
adapter->prev_tx_packets);
rx_packets += HDD_BW_GET_DIFF(adapter->stats.rx_packets,
@@ -7497,8 +7512,10 @@ static void hdd_bus_bw_compute_cbk(void *priv)
tx_packets += (uint64_t)ipa_tx_packets;
rx_packets += (uint64_t)ipa_rx_packets;
- adapter->stats.tx_packets += ipa_tx_packets;
- adapter->stats.rx_packets += ipa_rx_packets;
+ if (sap_adapter) {
+ sap_adapter->stats.tx_packets += ipa_tx_packets;
+ sap_adapter->stats.rx_packets += ipa_rx_packets;
+ }
hdd_ipa_set_perf_level(hdd_ctx, tx_packets, rx_packets);
hdd_ipa_uc_stat_request(hdd_ctx, 2);
diff --git a/core/hdd/src/wlan_hdd_tdls.c b/core/hdd/src/wlan_hdd_tdls.c
index 0011b3b461db..cd18e945b50b 100644
--- a/core/hdd/src/wlan_hdd_tdls.c
+++ b/core/hdd/src/wlan_hdd_tdls.c
@@ -4222,8 +4222,9 @@ static int __wlan_hdd_cfg80211_tdls_mgmt(struct wiphy *wiphy,
}
/* if tdls_mode is disabled, then decline the peer's request */
if (eTDLS_SUPPORT_DISABLED == pHddCtx->tdls_mode) {
- hdd_debug(MAC_ADDRESS_STR " TDLS mode is disabled. action %d declined.",
- MAC_ADDR_ARRAY(peer), action_code);
+ hdd_debug(MAC_ADDRESS_STR " TDLS mode is disabled. action %d declined. source bitmap:%lu",
+ MAC_ADDR_ARRAY(peer), action_code,
+ pHddCtx->tdls_source_bitmap);
return -ENOTSUPP;
}
if (pHddCtx->tdls_nss_switch_in_progress) {
diff --git a/core/mac/inc/qwlan_version.h b/core/mac/inc/qwlan_version.h
index 184e05bbfe9e..9b4cd388cd5b 100644
--- a/core/mac/inc/qwlan_version.h
+++ b/core/mac/inc/qwlan_version.h
@@ -32,9 +32,9 @@
#define QWLAN_VERSION_MAJOR 5
#define QWLAN_VERSION_MINOR 1
#define QWLAN_VERSION_PATCH 1
-#define QWLAN_VERSION_EXTRA "P"
+#define QWLAN_VERSION_EXTRA "Z"
#define QWLAN_VERSION_BUILD 69
-#define QWLAN_VERSIONSTR "5.1.1.69P"
+#define QWLAN_VERSIONSTR "5.1.1.69Z"
#endif /* QWLAN_VERSION_H */
diff --git a/core/mac/inc/sir_api.h b/core/mac/inc/sir_api.h
index c4795c1f745f..e31fbd8ea88c 100644
--- a/core/mac/inc/sir_api.h
+++ b/core/mac/inc/sir_api.h
@@ -6807,14 +6807,34 @@ struct sir_nss_update_request {
};
/**
- * struct sir_beacon_tx_complete_rsp
+ * enum sir_bcn_update_reason: bcn update reason
+ * @REASON_DEFAULT: reason default
+ * @REASON_NSS_UPDATE: If NSS is updated
+ * @REASON_CONFIG_UPDATE: Config update
+ * @REASON_SET_HT2040: HT2040 update
+ * @REASON_COLOR_CHANGE: Color change
+ * @REASON_CHANNEL_SWITCH: channel switch
+ */
+enum sir_bcn_update_reason {
+ REASON_DEFAULT = 0,
+ REASON_NSS_UPDATE = 1,
+ REASON_CONFIG_UPDATE = 2,
+ REASON_SET_HT2040 = 3,
+ REASON_COLOR_CHANGE = 4,
+ REASON_CHANNEL_SWITCH = 5,
+};
+
+/**
+ * struct sir_bcn_update_rsp
*
- * @session_id: session for which beacon update happened
- * @tx_status: status of the beacon tx from FW
+ * @vdev_id: session for which bcn was updated
+ * @reason: bcn update reason
+ * @status: status of the beacon sent to FW
*/
-struct sir_beacon_tx_complete_rsp {
- uint8_t session_id;
- uint8_t tx_status;
+struct sir_bcn_update_rsp {
+ uint8_t vdev_id;
+ enum sir_bcn_update_reason reason;
+ QDF_STATUS status;
};
typedef void (*nss_update_cb)(void *context, uint8_t tx_status, uint8_t vdev_id,
diff --git a/core/mac/src/include/sir_params.h b/core/mac/src/include/sir_params.h
index 6c6a3f8c5677..e6845a39b9a9 100644
--- a/core/mac/src/include/sir_params.h
+++ b/core/mac/src/include/sir_params.h
@@ -258,7 +258,6 @@ struct sir_mgmt_msg {
#define SIR_HAL_UPDATE_EDCA_PROFILE_IND (SIR_HAL_ITC_MSG_TYPES_BEGIN + 22)
#define SIR_HAL_UPDATE_BEACON_IND (SIR_HAL_ITC_MSG_TYPES_BEGIN + 23)
-#define SIR_HAL_UPDATE_CF_IND (SIR_HAL_ITC_MSG_TYPES_BEGIN + 24)
#define SIR_HAL_CHNL_SWITCH_REQ (SIR_HAL_ITC_MSG_TYPES_BEGIN + 25)
#define SIR_HAL_ADD_TS_REQ (SIR_HAL_ITC_MSG_TYPES_BEGIN + 26)
#define SIR_HAL_DEL_TS_REQ (SIR_HAL_ITC_MSG_TYPES_BEGIN + 27)
@@ -705,6 +704,7 @@ struct sir_mgmt_msg {
#define SIR_HAL_INVOKE_NEIGHBOR_REPORT (SIR_HAL_ITC_MSG_TYPES_BEGIN + 391)
#define SIR_HAL_NDP_SCH_UPDATE_IND (SIR_HAL_ITC_MSG_TYPES_BEGIN + 392)
#define SIR_HAL_GET_ROAM_SCAN_STATS (SIR_HAL_ITC_MSG_TYPES_BEGIN + 393)
+#define SIR_HAL_SEND_BCN_RSP (SIR_HAL_ITC_MSG_TYPES_BEGIN + 394)
#define SIR_HAL_MSG_TYPES_END (SIR_HAL_MSG_TYPES_BEGIN + 0x1FF)
/* CFG message types */
diff --git a/core/mac/src/pe/include/sch_api.h b/core/mac/src/pe/include/sch_api.h
index e23b49c91a3b..8923a471238f 100644
--- a/core/mac/src/pe/include/sch_api.h
+++ b/core/mac/src/pe/include/sch_api.h
@@ -68,8 +68,17 @@ extern void sch_initializeCfEndTemplate(tpAniSirGlobal pMac);
/* / Process the scheduler messages */
extern void sch_process_message(tpAniSirGlobal pMac, tpSirMsgQ pSchMsg);
-/* / The beacon Indication handler function */
-extern void sch_process_pre_beacon_ind(tpAniSirGlobal pMac, tpSirMsgQ limMsg);
+/**
+ * sch_process_pre_beacon_ind() - Process the PreBeacon Indication from the Lim
+ * @pMac: pointer to mac structure
+ * @limMsg: Lim Msg
+ * @reason: beaon update reason
+ *
+ * return: success: QDF_STATUS_SUCCESS failure: QDF_STATUS_E_FAILURE
+ */
+extern QDF_STATUS sch_process_pre_beacon_ind(tpAniSirGlobal pMac,
+ tpSirMsgQ limMsg,
+ enum sir_bcn_update_reason reason);
/* / Post a message to the scheduler message queue */
extern tSirRetStatus sch_post_message(tpAniSirGlobal pMac, tpSirMsgQ pMsg);
@@ -85,8 +94,19 @@ void sch_generate_tim(tpAniSirGlobal, uint8_t **, uint16_t *, uint8_t);
void sch_set_beacon_interval(tpAniSirGlobal pMac, tpPESession psessionEntry);
-tSirRetStatus sch_send_beacon_req(tpAniSirGlobal, uint8_t *, uint16_t,
- tpPESession psessionEntry);
+/**
+ * sch_send_beacon_req() - send beacon update req to wma
+ * @mac_ctx: pointer to mac structure
+ * @bcn_payload: beacon payload
+ * @size: beacon size
+ * @session:pe session
+ * @reason: beaon update reason
+ *
+ * return: success: QDF_STATUS_SUCCESS failure: QDF_STATUS_E_FAILURE
+ */
+QDF_STATUS sch_send_beacon_req(tpAniSirGlobal mac_ctx, uint8_t *bcn_payload,
+ uint16_t size, tpPESession session,
+ enum sir_bcn_update_reason reason);
tSirRetStatus lim_update_probe_rsp_template_ie_bitmap_beacon1(tpAniSirGlobal,
tDot11fBeacon1 *,
diff --git a/core/mac/src/pe/lim/lim_ibss_peer_mgmt.c b/core/mac/src/pe/lim/lim_ibss_peer_mgmt.c
index 4f2de438aa69..c5f797c15556 100644
--- a/core/mac/src/pe/lim/lim_ibss_peer_mgmt.c
+++ b/core/mac/src/pe/lim/lim_ibss_peer_mgmt.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012-2017 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2012-2018 The Linux Foundation. All rights reserved.
*
* Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the
@@ -1277,7 +1277,7 @@ void lim_ibss_add_bss_rsp_when_coalescing(tpAniSirGlobal pMac, void *msg,
infoLen, pSessionEntry->smeSessionId);
{
/* Configure beacon and send beacons to HAL */
- lim_send_beacon_ind(pMac, pSessionEntry);
+ lim_send_beacon_ind(pMac, pSessionEntry, REASON_DEFAULT);
}
end:
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 789906a30ba8..09aba231e74e 100644
--- a/core/mac/src/pe/lim/lim_process_message_queue.c
+++ b/core/mac/src/pe/lim/lim_process_message_queue.c
@@ -1699,7 +1699,8 @@ static void lim_process_messages(tpAniSirGlobal mac_ctx, tpSirMsgQ msg)
break;
case SIR_LIM_BEACON_GEN_IND:
if (mac_ctx->lim.gLimSystemRole != eLIM_AP_ROLE)
- sch_process_pre_beacon_ind(mac_ctx, msg);
+ sch_process_pre_beacon_ind(mac_ctx,
+ msg, REASON_DEFAULT);
break;
case SIR_LIM_DELETE_STA_CONTEXT_IND:
lim_delete_sta_context(mac_ctx, msg);
@@ -2040,6 +2041,11 @@ static void lim_process_messages(tpAniSirGlobal mac_ctx, tpSirMsgQ msg)
qdf_mem_free((void *)msg->bodyptr);
msg->bodyptr = NULL;
break;
+ case WMA_SEND_BCN_RSP:
+ lim_send_bcn_rsp(mac_ctx, (tpSendbeaconParams)msg->bodyptr);
+ qdf_mem_free((void *)msg->bodyptr);
+ msg->bodyptr = NULL;
+ break;
default:
qdf_mem_free((void *)msg->bodyptr);
msg->bodyptr = NULL;
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 dc457fa318a8..4a2e54ae2aa0 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
@@ -244,7 +244,8 @@ void lim_process_mlm_start_cnf(tpAniSirGlobal pMac, uint32_t *pMsgBuf)
FL("Start Beacon with ssid %s Ch %d"),
psessionEntry->ssId.ssId,
psessionEntry->currentOperChannel);
- lim_send_beacon_ind(pMac, psessionEntry);
+ lim_send_beacon_ind(pMac, psessionEntry,
+ REASON_DEFAULT);
}
}
}
@@ -2658,7 +2659,7 @@ void lim_process_mlm_update_hidden_ssid_rsp(tpAniSirGlobal mac_ctx,
}
/* Update beacon */
sch_set_fixed_beacon_fields(mac_ctx, session_entry);
- lim_send_beacon_ind(mac_ctx, session_entry);
+ lim_send_beacon_ind(mac_ctx, session_entry, REASON_CONFIG_UPDATE);
free_req:
if (NULL != hidden_ssid_vdev_restart) {
@@ -3190,25 +3191,25 @@ free:
qdf_mem_free(body);
}
-void lim_send_beacon_ind(tpAniSirGlobal pMac, tpPESession psessionEntry)
+QDF_STATUS lim_send_beacon_ind(tpAniSirGlobal pMac, tpPESession psessionEntry,
+ enum sir_bcn_update_reason reason)
{
tBeaconGenParams *pBeaconGenParams = NULL;
tSirMsgQ limMsg;
/** Allocate the Memory for Beacon Pre Message and for Stations in PoweSave*/
- if (psessionEntry == NULL) {
+ if (!psessionEntry) {
pe_err("Error:Unable to get the PESessionEntry");
- return;
+ return QDF_STATUS_E_INVAL;
}
pBeaconGenParams = qdf_mem_malloc(sizeof(*pBeaconGenParams));
- if (NULL == pBeaconGenParams) {
+ if (!pBeaconGenParams) {
pe_err("Unable to allocate memory during sending beaconPreMessage");
- return;
+ return QDF_STATUS_E_NOMEM;
}
qdf_mem_copy((void *)pBeaconGenParams->bssId,
(void *)psessionEntry->bssId, QDF_MAC_ADDR_SIZE);
limMsg.bodyptr = pBeaconGenParams;
- sch_process_pre_beacon_ind(pMac, &limMsg);
- return;
+ return sch_process_pre_beacon_ind(pMac, &limMsg, reason);
}
#ifdef FEATURE_WLAN_SCAN_PNO
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 0a984d5edaff..23cb94ad3491 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
@@ -4029,7 +4029,7 @@ __lim_process_sme_update_apwpsi_es(tpAniSirGlobal pMac, uint32_t *pMsgBuf)
sizeof(tSirAPWPSIEs));
sch_set_fixed_beacon_fields(pMac, psessionEntry);
- lim_send_beacon_ind(pMac, psessionEntry);
+ lim_send_beacon_ind(pMac, psessionEntry, REASON_CONFIG_UPDATE);
end:
qdf_mem_free(pUpdateAPWPSIEsReq);
@@ -4074,7 +4074,7 @@ static void lim_process_sme_update_config(tpAniSirGlobal mac_ctx,
if (LIM_IS_AP_ROLE(pe_session)) {
sch_set_fixed_beacon_fields(mac_ctx, pe_session);
- lim_send_beacon_ind(mac_ctx, pe_session);
+ lim_send_beacon_ind(mac_ctx, pe_session, REASON_CONFIG_UPDATE);
}
}
@@ -4278,7 +4278,7 @@ static void __lim_process_sme_set_wparsni_es(tpAniSirGlobal pMac, uint32_t *pMsg
psessionEntry->privacy = 1;
sch_set_fixed_beacon_fields(pMac, psessionEntry);
- lim_send_beacon_ind(pMac, psessionEntry);
+ lim_send_beacon_ind(pMac, psessionEntry, REASON_CONFIG_UPDATE);
end:
qdf_mem_free(pUpdateAPWPARSNIEsReq);
@@ -4407,7 +4407,7 @@ static void __lim_process_sme_set_ht2040_mode(tpAniSirGlobal pMac,
/* Update beacon */
sch_set_fixed_beacon_fields(pMac, psessionEntry);
- lim_send_beacon_ind(pMac, psessionEntry);
+ lim_send_beacon_ind(pMac, psessionEntry, REASON_SET_HT2040);
/* update OP Mode for each associated peer */
for (staId = 0; staId < psessionEntry->dph.dphHashTable.size; staId++) {
@@ -5448,7 +5448,7 @@ static void lim_process_sme_start_beacon_req(tpAniSirGlobal pMac, uint32_t *pMsg
FL("Start Beacon with ssid %s Ch %d"),
psessionEntry->ssId.ssId,
psessionEntry->currentOperChannel);
- lim_send_beacon_ind(pMac, psessionEntry);
+ lim_send_beacon_ind(pMac, psessionEntry, REASON_DEFAULT);
} else {
pe_err("Invalid Beacon Start Indication");
return;
@@ -6185,6 +6185,55 @@ static void lim_process_ext_change_channel(tpAniSirGlobal mac_ctx,
}
/**
+ * lim_nss_update_rsp() - send NSS update response to SME
+ * @mac_ctx Pointer to Global MAC structure
+ * @vdev_id: vdev id
+ * @status: nss update status
+ *
+ * Return: None
+ */
+static void lim_nss_update_rsp(tpAniSirGlobal mac_ctx,
+ uint8_t vdev_id, QDF_STATUS status)
+{
+ cds_msg_t msg = {0};
+ struct sir_bcn_update_rsp *nss_rsp;
+ QDF_STATUS qdf_status;
+
+ nss_rsp = qdf_mem_malloc(sizeof(*nss_rsp));
+ if (!nss_rsp) {
+ pe_err("AllocateMemory failed for nss_rsp");
+ return;
+ }
+
+ nss_rsp->vdev_id = vdev_id;
+ nss_rsp->status = status;
+ nss_rsp->reason = REASON_NSS_UPDATE;
+
+ msg.type = eWNI_SME_NSS_UPDATE_RSP;
+ msg.bodyptr = nss_rsp;
+ msg.bodyval = 0;
+ qdf_status = cds_mq_post_message(QDF_MODULE_ID_SME, &msg);
+ if (QDF_IS_STATUS_ERROR(qdf_status)) {
+ pe_err("Failed to post eWNI_SME_NSS_UPDATE_RSP");
+ qdf_mem_free(nss_rsp);
+ }
+}
+
+void lim_send_bcn_rsp(tpAniSirGlobal mac_ctx, tpSendbeaconParams rsp)
+{
+ if (!rsp) {
+ pe_err("rsp is NULL");
+ return;
+ }
+
+ pe_debug("Send beacon resp status %d for reason %d",
+ rsp->status, rsp->reason);
+
+ if (rsp->reason == REASON_NSS_UPDATE)
+ lim_nss_update_rsp(mac_ctx, rsp->vdev_id, rsp->status);
+}
+
+/**
* lim_process_nss_update_request() - process sme nss update req
*
* @mac_ctx: Pointer to Global MAC structure
@@ -6200,25 +6249,28 @@ static void lim_process_nss_update_request(tpAniSirGlobal mac_ctx,
{
struct sir_nss_update_request *nss_update_req_ptr;
tpPESession session_entry = NULL;
+ QDF_STATUS status = QDF_STATUS_E_FAILURE;
+ uint8_t vdev_id;
- if (msg_buf == NULL) {
+ if (!msg_buf) {
pe_err("Buffer is Pointing to NULL");
return;
}
nss_update_req_ptr = (struct sir_nss_update_request *)msg_buf;
+ vdev_id = nss_update_req_ptr->vdev_id;
session_entry = pe_find_session_by_sme_session_id(mac_ctx,
nss_update_req_ptr->vdev_id);
- if (session_entry == NULL) {
+ if (!session_entry) {
pe_err("Session not found for given session_id %d",
nss_update_req_ptr->vdev_id);
- return;
+ goto end;
}
if (session_entry->valid && !LIM_IS_AP_ROLE(session_entry)) {
pe_err("Invalid SystemRole %d",
GET_LIM_SYSTEM_ROLE(session_entry));
- return;
+ goto end;
}
/* populate nss field in the beacon */
@@ -6230,16 +6282,28 @@ static void lim_process_nss_update_request(tpAniSirGlobal mac_ctx,
(session_entry->ch_width > CH_WIDTH_80MHZ))
session_entry->gLimOperatingMode.chanWidth = CH_WIDTH_80MHZ;
- pe_debug("ch width %hu", session_entry->gLimOperatingMode.chanWidth);
+ pe_debug("ch width %d Rx NSS %d",
+ session_entry->gLimOperatingMode.chanWidth,
+ session_entry->gLimOperatingMode.rxNSS);
/* Send nss update request from here */
if (sch_set_fixed_beacon_fields(mac_ctx, session_entry) !=
- eSIR_SUCCESS) {
+ eSIR_SUCCESS) {
pe_err("Unable to set op mode IE in beacon");
- return;
+ goto end;
}
- lim_send_beacon_ind(mac_ctx, session_entry);
+ status = lim_send_beacon_ind(mac_ctx, session_entry, REASON_NSS_UPDATE);
+ if (QDF_IS_STATUS_SUCCESS(status))
+ return;
+
+ pe_err("Unable to send beacon");
+end:
+ /*
+ * send resp only in case of failure,
+ * success case response will be from wma.
+ */
+ lim_nss_update_rsp(mac_ctx, vdev_id, status);
}
/**
diff --git a/core/mac/src/pe/lim/lim_send_messages.c b/core/mac/src/pe/lim/lim_send_messages.c
index 621e55a23590..665a30a72c76 100644
--- a/core/mac/src/pe/lim/lim_send_messages.c
+++ b/core/mac/src/pe/lim/lim_send_messages.c
@@ -62,60 +62,6 @@ static tBeaconFilterIe beacon_filter_table[] = {
};
/**
- * lim_send_cf_params()
- *
- ***FUNCTION:
- * This function is called to send CFP Parameters to WMA, when they are changed.
- *
- ***LOGIC:
- *
- ***ASSUMPTIONS:
- * NA
- *
- ***NOTE:
- * NA
- *
- * @param pMac pointer to Global Mac structure.
- * @param bssIdx Bss Index of the BSS to which STA is associated.
- * @param cfpCount CFP Count, if that is changed.
- * @param cfpPeriod CFP Period if that is changed.
- *
- * @return success if message send is ok, else false.
- */
-tSirRetStatus lim_send_cf_params(tpAniSirGlobal pMac, uint8_t bssIdx,
- uint8_t cfpCount, uint8_t cfpPeriod)
-{
- tpUpdateCFParams pCFParams = NULL;
- tSirRetStatus retCode = eSIR_SUCCESS;
- tSirMsgQ msgQ;
-
- pCFParams = qdf_mem_malloc(sizeof(tUpdateCFParams));
- if (NULL == pCFParams) {
- pe_err("Unable to allocate memory during Update CF Params");
- retCode = eSIR_MEM_ALLOC_FAILED;
- goto returnFailure;
- }
- pCFParams->cfpCount = cfpCount;
- pCFParams->cfpPeriod = cfpPeriod;
- pCFParams->bssIdx = bssIdx;
-
- msgQ.type = WMA_UPDATE_CF_IND;
- msgQ.reserved = 0;
- msgQ.bodyptr = pCFParams;
- msgQ.bodyval = 0;
- pe_debug("Sending WMA_UPDATE_CF_IND");
- MTRACE(mac_trace_msg_tx(pMac, NO_SESSION, msgQ.type));
- retCode = wma_post_ctrl_msg(pMac, &msgQ);
- if (eSIR_SUCCESS != retCode) {
- qdf_mem_free(pCFParams);
- pe_err("Posting WMA_UPDATE_CF_IND failed, reason=%X",
- retCode);
- }
-returnFailure:
- return retCode;
-}
-
-/**
* lim_send_beacon_params() - updates bcn params to WMA
*
* @pMac : pointer to Global Mac structure.
@@ -164,7 +110,7 @@ tSirRetStatus lim_send_beacon_params(tpAniSirGlobal pMac,
pe_err("Posting WMA_UPDATE_BEACON_IND, reason=%X",
retCode);
}
- lim_send_beacon_ind(pMac, psessionEntry);
+ lim_send_beacon_ind(pMac, psessionEntry, REASON_DEFAULT);
return retCode;
}
diff --git a/core/mac/src/pe/lim/lim_send_messages.h b/core/mac/src/pe/lim/lim_send_messages.h
index 883ff216da64..fd1e661d55d8 100644
--- a/core/mac/src/pe/lim/lim_send_messages.h
+++ b/core/mac/src/pe/lim/lim_send_messages.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011-2016 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2011-2016 2018 The Linux Foundation. All rights reserved.
*
* Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the
@@ -34,8 +34,6 @@
#include "lim_types.h"
#include "wma_if.h"
#include "sir_params.h"
-tSirRetStatus lim_send_cf_params(tpAniSirGlobal pMac, uint8_t bssIdx,
- uint8_t cfpCount, uint8_t cfpPeriod);
tSirRetStatus lim_send_beacon_params(tpAniSirGlobal pMac,
tpUpdateBeaconParams pUpdatedBcnParams,
tpPESession psessionEntry);
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 f359621f24dd..915db70b4be6 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
@@ -2568,7 +2568,8 @@ lim_send_sme_ap_channel_switch_resp(tpAniSirGlobal pMac,
if (!is_ch_dfs) {
if (channelId == psessionEntry->currentOperChannel) {
lim_apply_configuration(pMac, psessionEntry);
- lim_send_beacon_ind(pMac, psessionEntry);
+ lim_send_beacon_ind(pMac, psessionEntry,
+ REASON_CONFIG_UPDATE);
} else {
pe_debug("Failed to Transmit Beacons on channel: %d after AP channel change response",
psessionEntry->bcnLen);
@@ -2581,11 +2582,8 @@ void lim_process_beacon_tx_success_ind(tpAniSirGlobal mac_ctx,
uint16_t msg_type, void *event)
{
tpPESession session;
- cds_msg_t msg = {0};
- struct sir_beacon_tx_complete_rsp *bcn_tx_comp_rsp;
tpSirFirstBeaconTxCompleteInd bcn_ind =
(tSirFirstBeaconTxCompleteInd *) event;
- QDF_STATUS status;
session = pe_find_session_by_bss_idx(mac_ctx, bcn_ind->bssIdx);
if (session == NULL) {
@@ -2607,24 +2605,9 @@ void lim_process_beacon_tx_success_ind(tpAniSirGlobal mac_ctx,
mac_ctx->sap.SapDfsInfo.sap_ch_switch_beacon_cnt))
lim_process_ap_ecsa_timeout(session);
- if (session->gLimOperatingMode.present) {
- /* Done with nss update, send response back to SME */
+ if (session->gLimOperatingMode.present)
+ /* Done with nss update */
session->gLimOperatingMode.present = 0;
- bcn_tx_comp_rsp = (struct sir_beacon_tx_complete_rsp *)
- qdf_mem_malloc(sizeof(*bcn_tx_comp_rsp));
- if (NULL == bcn_tx_comp_rsp) {
- pe_err("AllocateMemory failed for bcn_tx_comp_rsp");
- return;
- }
- bcn_tx_comp_rsp->session_id = session->smeSessionId;
- bcn_tx_comp_rsp->tx_status = QDF_STATUS_SUCCESS;
- msg.type = eWNI_SME_NSS_UPDATE_RSP;
- msg.bodyptr = bcn_tx_comp_rsp;
-
- status = cds_mq_post_message(QDF_MODULE_ID_SME, &msg);
- if (QDF_IS_STATUS_ERROR(status)) {
- sme_err("Failed to post eWNI_SME_NSS_UPDATE_RSP");
- qdf_mem_free(bcn_tx_comp_rsp);
- }
- }
+
+ return;
}
diff --git a/core/mac/src/pe/lim/lim_session.c b/core/mac/src/pe/lim/lim_session.c
index c3a961124ed7..ed961de3f132 100644
--- a/core/mac/src/pe/lim/lim_session.c
+++ b/core/mac/src/pe/lim/lim_session.c
@@ -714,6 +714,7 @@ void pe_delete_session(tpAniSirGlobal mac_ctx, tpPESession session)
if (LIM_IS_AP_ROLE(session)) {
qdf_mc_timer_stop(&session->protection_fields_reset_timer);
qdf_mc_timer_destroy(&session->protection_fields_reset_timer);
+ session->dfsIncludeChanSwIe = 0;
qdf_mc_timer_stop(&session->ap_ecsa_timer);
qdf_mc_timer_destroy(&session->ap_ecsa_timer);
lim_del_pmf_sa_query_timer(mac_ctx, session);
diff --git a/core/mac/src/pe/lim/lim_types.h b/core/mac/src/pe/lim/lim_types.h
index 63d03060b192..688a10d5613f 100644
--- a/core/mac/src/pe/lim/lim_types.h
+++ b/core/mac/src/pe/lim/lim_types.h
@@ -876,20 +876,15 @@ lim_get_ielen_from_bss_description(tpSirBssDescription pBssDescr)
} /*** end lim_get_ielen_from_bss_description() ***/
/**
- * lim_send_beacon_ind()
+ * lim_send_beacon_ind() - send the beacon indication
+ * @mac_ctx: pointer to mac structure
+ * @session: pe session
+ * @reason: beacon update reason
*
- ***FUNCTION:
- * This function is called to send the beacon indication
- * number being scanned.
- *
- ***PARAMS:
- *
- ***LOGIC:
- *
- ***ASSUMPTIONS:
+ * return: success: QDF_STATUS_SUCCESS failure: QDF_STATUS_E_FAILURE
*/
-
-void lim_send_beacon_ind(tpAniSirGlobal pMac, tpPESession psessionEntry);
+QDF_STATUS lim_send_beacon_ind(tpAniSirGlobal mac_ctx, tpPESession session,
+ enum sir_bcn_update_reason reason);
void
lim_send_vdev_restart(tpAniSirGlobal pMac, tpPESession psessionEntry,
@@ -954,6 +949,15 @@ tSirRetStatus lim_process_sme_del_all_tdls_peers(tpAniSirGlobal p_mac,
#endif
/**
+ * lim_send_bcn_rsp() - handle beacon send response
+ * @mac_ctx Pointer to Global MAC structure
+ * @rsp: beacon send response
+ *
+ * Return: None
+ */
+void lim_send_bcn_rsp(tpAniSirGlobal mac_ctx, tpSendbeaconParams rsp);
+
+/**
* lim_process_rx_channel_status_event() - processes
* event WDA_RX_CHN_STATUS_EVENT
* @mac_ctx Pointer to Global MAC structure
diff --git a/core/mac/src/pe/lim/lim_utils.c b/core/mac/src/pe/lim/lim_utils.c
index 2ebe600848ee..b981f7b54f27 100644
--- a/core/mac/src/pe/lim/lim_utils.c
+++ b/core/mac/src/pe/lim/lim_utils.c
@@ -5513,7 +5513,8 @@ void lim_update_beacon(tpAniSirGlobal mac_ctx)
if (false == mac_ctx->sap.SapDfsInfo.
is_dfs_cac_timer_running)
lim_send_beacon_ind(mac_ctx,
- &mac_ctx->lim.gpSession[i]);
+ &mac_ctx->lim.gpSession[i],
+ REASON_DEFAULT);
}
}
}
@@ -7472,7 +7473,7 @@ lim_send_dfs_chan_sw_ie_update(tpAniSirGlobal mac_ctx, tpPESession session)
}
/* Send update beacon template message */
- lim_send_beacon_ind(mac_ctx, session);
+ lim_send_beacon_ind(mac_ctx, session, REASON_CHANNEL_SWITCH);
pe_debug("Updated CSA IE, IE COUNT: %d",
session->gLimChannelSwitch.switchCount);
}
@@ -7484,8 +7485,8 @@ void lim_process_ap_ecsa_timeout(void *data)
uint8_t bcn_int, ch, ch_width;
QDF_STATUS status;
- if (!session) {
- pe_err("Session is NULL");
+ if (!session || !session->valid) {
+ pe_err("Session is not valid");
return;
}
diff --git a/core/mac/src/pe/sch/sch_api.c b/core/mac/src/pe/sch/sch_api.c
index e82d6d9d32a7..cbc8c3414d53 100644
--- a/core/mac/src/pe/sch/sch_api.c
+++ b/core/mac/src/pe/sch/sch_api.c
@@ -178,12 +178,14 @@ void sch_send_start_scan_rsp(tpAniSirGlobal pMac)
*
* @return QDF_STATUS
*/
-tSirRetStatus sch_send_beacon_req(tpAniSirGlobal pMac, uint8_t *beaconPayload,
- uint16_t size, tpPESession psessionEntry)
+QDF_STATUS sch_send_beacon_req(tpAniSirGlobal pMac, uint8_t *beaconPayload,
+ uint16_t size, tpPESession psessionEntry,
+ enum sir_bcn_update_reason reason)
{
tSirMsgQ msgQ;
tpSendbeaconParams beaconParams = NULL;
tSirRetStatus retCode;
+ QDF_STATUS status = QDF_STATUS_SUCCESS;
if (LIM_IS_AP_ROLE(psessionEntry) &&
(pMac->sch.schObject.fBeaconChanged)) {
@@ -199,7 +201,7 @@ tSirRetStatus sch_send_beacon_req(tpAniSirGlobal pMac, uint8_t *beaconPayload,
}
beaconParams = qdf_mem_malloc(sizeof(tSendbeaconParams));
if (NULL == beaconParams)
- return eSIR_MEM_ALLOC_FAILED;
+ return QDF_STATUS_E_NOMEM;
msgQ.type = WMA_SEND_BEACON_REQ;
@@ -225,6 +227,9 @@ tSirRetStatus sch_send_beacon_req(tpAniSirGlobal pMac, uint8_t *beaconPayload,
}
}
+ beaconParams->vdev_id = psessionEntry->smeSessionId;
+ beaconParams->reason = reason;
+
/* p2pIeOffset should be atleast greater than timIeOffset */
if ((pMac->sch.schObject.p2pIeOffset != 0) &&
(pMac->sch.schObject.p2pIeOffset <
@@ -233,7 +238,7 @@ tSirRetStatus sch_send_beacon_req(tpAniSirGlobal pMac, uint8_t *beaconPayload,
pMac->sch.schObject.p2pIeOffset);
QDF_ASSERT(0);
qdf_mem_free(beaconParams);
- return eSIR_FAILURE;
+ return QDF_STATUS_E_FAILURE;
}
beaconParams->p2pIeOffset = pMac->sch.schObject.p2pIeOffset;
#ifdef WLAN_SOFTAP_FW_BEACON_TX_PRNT_LOG
@@ -243,9 +248,9 @@ tSirRetStatus sch_send_beacon_req(tpAniSirGlobal pMac, uint8_t *beaconPayload,
if (size >= SIR_MAX_BEACON_SIZE) {
pe_err("beacon size (%d) exceed host limit %d",
size, SIR_MAX_BEACON_SIZE);
- QDF_ASSERT(0);
- qdf_mem_free(beaconParams);
- return eSIR_FAILURE;
+ QDF_ASSERT(0);
+ qdf_mem_free(beaconParams);
+ return QDF_STATUS_E_FAILURE;
}
qdf_mem_copy(beaconParams->beacon, beaconPayload, size);
@@ -271,11 +276,13 @@ tSirRetStatus sch_send_beacon_req(tpAniSirGlobal pMac, uint8_t *beaconPayload,
MTRACE(mac_trace_msg_tx(pMac, psessionEntry->peSessionId, msgQ.type));
retCode = wma_post_ctrl_msg(pMac, &msgQ);
- if (eSIR_SUCCESS != retCode)
+ if (eSIR_SUCCESS != retCode) {
+ status = QDF_STATUS_E_FAILURE;
pe_err("Posting SEND_BEACON_REQ to HAL failed, reason=%X",
retCode);
+ }
- return retCode;
+ return status;
}
static uint32_t lim_remove_p2p_ie_from_add_ie(tpAniSirGlobal pMac,
diff --git a/core/mac/src/pe/sch/sch_beacon_gen.c b/core/mac/src/pe/sch/sch_beacon_gen.c
index 4d96187c839d..f4ea26b5d5de 100644
--- a/core/mac/src/pe/sch/sch_beacon_gen.c
+++ b/core/mac/src/pe/sch/sch_beacon_gen.c
@@ -861,29 +861,24 @@ void set_probe_rsp_ie_bitmap(uint32_t *IeBitmap, uint32_t pos)
IeBitmap[index] = temp;
}
-/* -------------------------------------------------------------------- */
/**
- * write_beacon_to_memory
+ * write_beacon_to_memory() - send the beacon to the wma
+ * @pMac: pointer to mac structure
+ * @size: Size of the beacon to write to memory
+ * @length: Length field of the beacon to write to memory
+ * @psessionEntry: pe session
+ * @reason: beacon update reason
*
- * FUNCTION:
- *
- * LOGIC:
- *
- * ASSUMPTIONS:
- *
- * NOTE:
- *
- * @param None
- * @param size Size of the beacon to write to memory
- * @param length Length field of the beacon to write to memory
- * @return None
+ * return: success: QDF_STATUS_SUCCESS failure: QDF_STATUS_E_FAILURE
*/
-
-static void write_beacon_to_memory(tpAniSirGlobal pMac, uint16_t size,
- uint16_t length, tpPESession psessionEntry)
+static QDF_STATUS write_beacon_to_memory(tpAniSirGlobal pMac, uint16_t size,
+ uint16_t length,
+ tpPESession psessionEntry,
+ enum sir_bcn_update_reason reason)
{
uint16_t i;
tpAniBeaconStruct pBeacon;
+ QDF_STATUS status = QDF_STATUS_SUCCESS;
/* copy end of beacon only if length > 0 */
if (length > 0) {
@@ -902,7 +897,7 @@ static void write_beacon_to_memory(tpAniSirGlobal pMac, uint16_t size,
pBeacon->beaconLength = (uint32_t) size - sizeof(uint32_t);
if (!pMac->sch.schObject.fBeaconChanged)
- return;
+ return QDF_STATUS_E_FAILURE;
pMac->sch.gSchGenBeacon = 1;
if (pMac->sch.gSchGenBeacon) {
@@ -914,16 +909,20 @@ static void write_beacon_to_memory(tpAniSirGlobal pMac, uint16_t size,
/* */
size = (size + 3) & (~3);
- if (eSIR_SUCCESS !=
+ if (QDF_STATUS_SUCCESS !=
sch_send_beacon_req(pMac, psessionEntry->pSchBeaconFrameBegin,
- size, psessionEntry))
+ size, psessionEntry, reason)) {
+ status = QDF_STATUS_E_FAILURE;
pe_err("sch_send_beacon_req() returned an error (zsize %d)",
size);
- else {
- pMac->sch.gSchBeaconsWritten++;
- }
+ } else {
+ pMac->sch.gSchBeaconsWritten++;
+ }
}
+
pMac->sch.schObject.fBeaconChanged = 0;
+
+ return status;
}
/**
@@ -979,30 +978,18 @@ void sch_generate_tim(tpAniSirGlobal pMac, uint8_t **pPtr, uint16_t *timLength,
*pPtr = ptr;
}
-/* -------------------------------------------------------------------- */
-/**
- * @function: SchProcessPreBeaconInd
- *
- * @brief : Process the PreBeacon Indication from the Lim
- *
- * ASSUMPTIONS:
- *
- * NOTE:
- *
- * @param : pMac - tpAniSirGlobal
- *
- * @return None
- */
-void sch_process_pre_beacon_ind(tpAniSirGlobal pMac, tpSirMsgQ limMsg)
+QDF_STATUS sch_process_pre_beacon_ind(tpAniSirGlobal pMac, tpSirMsgQ limMsg,
+ enum sir_bcn_update_reason reason)
{
tpBeaconGenParams pMsg = (tpBeaconGenParams) limMsg->bodyptr;
uint32_t beaconSize;
tpPESession psessionEntry;
uint8_t sessionId;
+ QDF_STATUS status = QDF_STATUS_E_FAILURE;
psessionEntry = pe_find_session_by_bssid(pMac, pMsg->bssId, &sessionId);
- if (psessionEntry == NULL) {
+ if (!psessionEntry) {
pe_err("session lookup fails");
goto end;
}
@@ -1021,12 +1008,13 @@ void sch_process_pre_beacon_ind(tpAniSirGlobal pMac, tpSirMsgQ limMsg)
case eLIM_STA_IN_IBSS_ROLE:
/* generate IBSS parameter set */
if (psessionEntry->statypeForBss == STA_ENTRY_SELF)
- write_beacon_to_memory(pMac, (uint16_t) beaconSize,
- (uint16_t) beaconSize,
- psessionEntry);
+ status =
+ write_beacon_to_memory(pMac, (uint16_t) beaconSize,
+ (uint16_t) beaconSize,
+ psessionEntry, reason);
else
pe_err("can not send beacon for PEER session entry");
- break;
+ break;
case eLIM_AP_ROLE: {
uint8_t *ptr =
@@ -1038,9 +1026,10 @@ void sch_process_pre_beacon_ind(tpAniSirGlobal pMac, tpSirMsgQ limMsg)
sch_generate_tim(pMac, &ptr, &timLength,
psessionEntry->dtimPeriod);
beaconSize += 2 + timLength;
- write_beacon_to_memory(pMac, (uint16_t) beaconSize,
- (uint16_t) beaconSize,
- psessionEntry);
+ status =
+ write_beacon_to_memory(pMac, (uint16_t) beaconSize,
+ (uint16_t) beaconSize,
+ psessionEntry, reason);
} else
pe_err("can not send beacon for PEER session entry");
}
@@ -1052,6 +1041,7 @@ void sch_process_pre_beacon_ind(tpAniSirGlobal pMac, tpSirMsgQ limMsg)
}
end:
- qdf_mem_free(pMsg);
+ qdf_mem_free(pMsg);
- }
+ return status;
+}
diff --git a/core/mac/src/pe/sch/sch_beacon_process.c b/core/mac/src/pe/sch/sch_beacon_process.c
index e0ccf28dbbc2..ba12a507375a 100644
--- a/core/mac/src/pe/sch/sch_beacon_process.c
+++ b/core/mac/src/pe/sch/sch_beacon_process.c
@@ -408,13 +408,9 @@ sch_bcn_process_sta(tpAniSirGlobal mac_ctx,
beaconParams->beaconInterval = (uint16_t) bi;
}
- if (bcn->cfPresent) {
+ if (bcn->cfPresent)
cfg_set_int(mac_ctx, WNI_CFG_CFP_PERIOD,
bcn->cfParamSet.cfpPeriod);
- lim_send_cf_params(mac_ctx, *bssIdx,
- bcn->cfParamSet.cfpCount,
- bcn->cfParamSet.cfpPeriod);
- }
/* No need to send DTIM Period and Count to HAL/SMAC */
/* SMAC already parses TIM bit. */
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 c2ec4b77982a..e32b7d5dbaaf 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
@@ -455,7 +455,6 @@ uint8_t *mac_trace_get_wma_msg_string(uint16_t wma_msg)
CASE_RETURN_STRING(WMA_UPDATE_EDCA_PROFILE_IND);
CASE_RETURN_STRING(WMA_UPDATE_BEACON_IND);
- CASE_RETURN_STRING(WMA_UPDATE_CF_IND);
CASE_RETURN_STRING(WMA_CHNL_SWITCH_REQ);
CASE_RETURN_STRING(WMA_ADD_TS_REQ);
CASE_RETURN_STRING(WMA_DEL_TS_REQ);
diff --git a/core/sme/src/common/sme_api.c b/core/sme/src/common/sme_api.c
index bbbdcda092b9..b3c52f578262 100644
--- a/core/sme/src/common/sme_api.c
+++ b/core/sme/src/common/sme_api.c
@@ -3089,15 +3089,19 @@ static QDF_STATUS sme_process_nss_update_resp(tpAniSirGlobal mac, uint8_t *msg)
tSmeCmd *command = NULL;
bool found;
nss_update_cb callback = NULL;
- struct sir_beacon_tx_complete_rsp *param;
+ struct sir_bcn_update_rsp *param;
- param = (struct sir_beacon_tx_complete_rsp *)msg;
+ param = (struct sir_bcn_update_rsp *)msg;
if (!param)
sme_err("nss update resp param is NULL");
/* Not returning. Need to check if active command list
* needs to be freed
*/
+ if (param && param->reason != REASON_NSS_UPDATE) {
+ sme_err("reason not NSS update");
+ return QDF_STATUS_E_INVAL;
+ }
entry = csr_ll_peek_head(&mac->sme.smeCmdActiveList,
LL_ACCESS_LOCK);
if (!entry) {
@@ -3122,8 +3126,8 @@ static QDF_STATUS sme_process_nss_update_resp(tpAniSirGlobal mac, uint8_t *msg)
sme_err("Callback failed since nss update params is NULL");
else
callback(command->u.nss_update_cmd.context,
- param->tx_status,
- param->session_id,
+ param->status,
+ param->vdev_id,
command->u.nss_update_cmd.next_action,
command->u.nss_update_cmd.reason);
} else
diff --git a/core/sme/src/csr/csr_api_roam.c b/core/sme/src/csr/csr_api_roam.c
index 175d4ae9b3ad..c738adf5e6bd 100644
--- a/core/sme/src/csr/csr_api_roam.c
+++ b/core/sme/src/csr/csr_api_roam.c
@@ -22534,7 +22534,7 @@ void csr_process_nss_update_req(tpAniSirGlobal mac, tSmeCmd *command)
struct sir_nss_update_request *msg;
QDF_STATUS status;
tSirMsgQ msg_return;
- struct sir_beacon_tx_complete_rsp *param;
+ struct sir_bcn_update_rsp *param;
tCsrRoamSession *session;
@@ -22563,11 +22563,10 @@ void csr_process_nss_update_req(tpAniSirGlobal mac, tSmeCmd *command)
sme_debug("Posting eWNI_SME_NSS_UPDATE_REQ to PE");
status = cds_send_mb_message_to_mac(msg);
- if (QDF_STATUS_SUCCESS != status) {
- sme_err("Posting to PE failed");
+ if (QDF_IS_STATUS_SUCCESS(status))
return;
- }
- return;
+
+ sme_err("Posting to PE failed");
fail:
param = qdf_mem_malloc(sizeof(*param));
if (!param) {
@@ -22576,8 +22575,9 @@ fail:
return;
}
sme_err("Sending nss update fail response to SME");
- param->tx_status = QDF_STATUS_E_FAILURE;
- param->session_id = command->u.nss_update_cmd.session_id;
+ param->status = QDF_STATUS_E_FAILURE;
+ param->vdev_id = command->u.nss_update_cmd.session_id;
+ param->reason = REASON_NSS_UPDATE;
msg_return.type = eWNI_SME_NSS_UPDATE_RSP;
msg_return.bodyptr = param;
msg_return.bodyval = 0;
diff --git a/core/wma/inc/wma_api.h b/core/wma/inc/wma_api.h
index 172c332de9b2..e8567492c40d 100644
--- a/core/wma/inc/wma_api.h
+++ b/core/wma/inc/wma_api.h
@@ -368,6 +368,18 @@ static inline QDF_STATUS wma_encrypt_decrypt_msg(WMA_HANDLE wma,
#endif
/**
+ * wma_find_if_fw_supports_dbs() - to check if FW supports DBS
+ *
+ * Firmware sends supported HW mode as part of service ready and
+ * service ready extension WMI message. This API checks through
+ * those HW mode list and figures out if DBS is supported by
+ * FW/HW.
+ *
+ * Return: True if FW/HW supports DBS else returns false.
+ */
+bool wma_find_if_fw_supports_dbs(void);
+
+/**
* wma_set_cts2self_for_p2p_go() - set CTS2SELF command for P2P GO.
* @wma_handle: pointer to wma handle.
* @cts2self_for_p2p_go: value needs to set to firmware.
diff --git a/core/wma/inc/wma_if.h b/core/wma/inc/wma_if.h
index 156f84636c90..81b75f0e59d9 100644
--- a/core/wma/inc/wma_if.h
+++ b/core/wma/inc/wma_if.h
@@ -709,6 +709,7 @@ typedef struct sBeaconGenParams {
/**
* struct tSendbeaconParams - send beacon parameters
+ * vdev_id: vdev id
* @bssId: BSSID mac address
* @beacon: beacon data
* @beaconLength: beacon length of template
@@ -716,8 +717,11 @@ typedef struct sBeaconGenParams {
* @p2pIeOffset: P2P IE offset
* @csa_count_offset: Offset of Switch count field in CSA IE
* @ecsa_count_offset: Offset of Switch count field in ECSA IE
+ * @reason: bcn update reason
+ * @status: beacon send status
*/
typedef struct {
+ uint8_t vdev_id;
tSirMacAddr bssId;
uint8_t beacon[SIR_MAX_BEACON_SIZE];
uint32_t beaconLength;
@@ -725,6 +729,8 @@ typedef struct {
uint16_t p2pIeOffset;
uint32_t csa_count_offset;
uint32_t ecsa_count_offset;
+ enum sir_bcn_update_reason reason;
+ QDF_STATUS status;
} tSendbeaconParams, *tpSendbeaconParams;
/**
@@ -852,23 +858,6 @@ typedef struct {
} tUpdateUserPos, *tpUpdateUserPos;
/**
- * struct tUpdateCFParams -CF parameters
- * @bssIdx: BSSID index
- * @cfpCount: CFP count
- * @cfpPeriod: the number of DTIM intervals between the start of CFPs
- */
-typedef struct {
- uint8_t bssIdx;
- /*
- * cfpCount indicates how many DTIMs (including the current frame)
- * appear before the next CFP start. A CFPCount of 0 indicates that
- * the current DTIM marks the start of the CFP.
- */
- uint8_t cfpCount;
- uint8_t cfpPeriod;
-} tUpdateCFParams, *tpUpdateCFParams;
-
-/**
* struct tSwitchChannelParams - switch channel request parameter
* @channelNumber: channel number
* @localPowerConstraint: local power constraint
diff --git a/core/wma/inc/wma_types.h b/core/wma/inc/wma_types.h
index 508f9a590407..745d1adafc08 100644
--- a/core/wma/inc/wma_types.h
+++ b/core/wma/inc/wma_types.h
@@ -151,6 +151,7 @@
#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_BCN_RSP SIR_HAL_SEND_BCN_RSP
#define WMA_SEND_PROBE_RSP_TMPL SIR_HAL_SEND_PROBE_RSP_TMPL
#define WMA_SET_BSSKEY_REQ SIR_HAL_SET_BSSKEY_REQ
@@ -160,7 +161,6 @@
#define WMA_UPDATE_EDCA_PROFILE_IND SIR_HAL_UPDATE_EDCA_PROFILE_IND
#define WMA_UPDATE_BEACON_IND SIR_HAL_UPDATE_BEACON_IND
-#define WMA_UPDATE_CF_IND SIR_HAL_UPDATE_CF_IND
#define WMA_CHNL_SWITCH_REQ SIR_HAL_CHNL_SWITCH_REQ
#define WMA_ADD_TS_REQ SIR_HAL_ADD_TS_REQ
#define WMA_DEL_TS_REQ SIR_HAL_DEL_TS_REQ
diff --git a/core/wma/src/wma_dev_if.c b/core/wma/src/wma_dev_if.c
index 3f56f0813443..27414b79c734 100644
--- a/core/wma/src/wma_dev_if.c
+++ b/core/wma/src/wma_dev_if.c
@@ -3050,13 +3050,11 @@ void wma_hold_req_timer(void *data)
WMA_LOGA(FL("WMA_ADD_STA_REQ timed out"));
WMA_LOGD(FL("Sending add sta rsp to umac (mac:%pM, status:%d)"),
params->staMac, params->status);
- if (wma_crash_on_fw_timeout(wma->fw_timeout_crash) == true) {
+ if (wma_crash_on_fw_timeout(wma->fw_timeout_crash))
wma_trigger_recovery_assert_on_fw_timeout(
WMA_ADD_STA_REQ);
- } else {
- wma_send_msg_high_priority(wma,
- WMA_ADD_STA_RSP, (void *)params, 0);
- }
+ wma_send_msg_high_priority(wma, WMA_ADD_STA_RSP,
+ (void *)params, 0);
} else if (tgt_req->msg_type == WMA_ADD_BSS_REQ) {
tpAddBssParams params = (tpAddBssParams) tgt_req->user_data;
@@ -3064,13 +3062,11 @@ void wma_hold_req_timer(void *data)
WMA_LOGA(FL("WMA_ADD_BSS_REQ timed out"));
WMA_LOGD(FL("Sending add bss rsp to umac (mac:%pM, status:%d)"),
params->selfMacAddr, params->status);
- if (wma_crash_on_fw_timeout(wma->fw_timeout_crash) == true) {
+ if (wma_crash_on_fw_timeout(wma->fw_timeout_crash))
wma_trigger_recovery_assert_on_fw_timeout(
WMA_ADD_BSS_REQ);
- } else {
- wma_send_msg_high_priority(wma,
- WMA_ADD_BSS_RSP, (void *)params, 0);
- }
+ wma_send_msg_high_priority(wma, WMA_ADD_BSS_RSP,
+ (void *)params, 0);
} else if ((tgt_req->msg_type == WMA_DELETE_STA_REQ) &&
(tgt_req->type == WMA_DELETE_STA_RSP_START)) {
tpDeleteStaParams params =
@@ -3080,18 +3076,11 @@ void wma_hold_req_timer(void *data)
WMA_LOGE(FL("Sending del sta rsp to umac (mac:%pM, status:%d)"),
params->staMac, params->status);
- if (wma_crash_on_fw_timeout(wma->fw_timeout_crash) == true) {
+ if (wma_crash_on_fw_timeout(wma->fw_timeout_crash))
wma_trigger_recovery_assert_on_fw_timeout(
WMA_DELETE_STA_REQ);
- } else {
- /*
- * Assert in development build only.
- * Send response in production builds.
- */
- QDF_ASSERT(0);
- wma_send_msg_high_priority(wma, WMA_DELETE_STA_RSP,
- (void *)params, 0);
- }
+ wma_send_msg_high_priority(wma, WMA_DELETE_STA_RSP,
+ (void *)params, 0);
} else if ((tgt_req->msg_type == WMA_DELETE_STA_REQ) &&
(tgt_req->type == WMA_DEL_P2P_SELF_STA_RSP_START)) {
struct del_sta_self_rsp_params *del_sta;
@@ -3100,14 +3089,11 @@ void wma_hold_req_timer(void *data)
del_sta->self_sta_param->status = QDF_STATUS_E_TIMEOUT;
WMA_LOGA(FL("wma delete sta p2p request timed out"));
- if (wma_crash_on_fw_timeout(wma->fw_timeout_crash)) {
+ if (wma_crash_on_fw_timeout(wma->fw_timeout_crash))
wma_trigger_recovery_assert_on_fw_timeout(
WMA_DELETE_STA_REQ);
- } else {
- if (del_sta->generate_rsp)
- wma_send_del_sta_self_resp(
- del_sta->self_sta_param);
- }
+ if (del_sta->generate_rsp)
+ wma_send_del_sta_self_resp(del_sta->self_sta_param);
qdf_mem_free(tgt_req->user_data);
} else if ((tgt_req->msg_type == WMA_DELETE_STA_REQ) &&
(tgt_req->type == WMA_SET_LINK_PEER_RSP)) {
@@ -3116,13 +3102,10 @@ void wma_hold_req_timer(void *data)
params->status = false;
WMA_LOGA(FL("wma delete peer for set link timed out"));
- if (wma_crash_on_fw_timeout(wma->fw_timeout_crash) == true) {
+ if (wma_crash_on_fw_timeout(wma->fw_timeout_crash))
wma_trigger_recovery_assert_on_fw_timeout(
WMA_DELETE_STA_REQ);
- } else {
- wma_send_msg(wma, WMA_SET_LINK_STATE_RSP,
- params, 0);
- }
+ wma_send_msg(wma, WMA_SET_LINK_STATE_RSP, params, 0);
} else if ((tgt_req->msg_type == WMA_DELETE_STA_REQ) &&
(tgt_req->type == WMA_DELETE_PEER_RSP)) {
tpDeleteBssParams params =
@@ -3130,13 +3113,10 @@ void wma_hold_req_timer(void *data)
params->status = QDF_STATUS_E_TIMEOUT;
WMA_LOGE(FL("wma delete peer for del bss req timed out"));
- if (wma_crash_on_fw_timeout(wma->fw_timeout_crash) == true) {
+ if (wma_crash_on_fw_timeout(wma->fw_timeout_crash))
wma_trigger_recovery_assert_on_fw_timeout(
WMA_DELETE_STA_REQ);
- } else {
- wma_send_msg_high_priority(wma,
- WMA_DELETE_BSS_RSP, params, 0);
- }
+ wma_send_msg_high_priority(wma, WMA_DELETE_BSS_RSP, params, 0);
} else {
WMA_LOGE(FL("Unhandled timeout for msg_type:%d and type:%d"),
tgt_req->msg_type, tgt_req->type);
@@ -3289,13 +3269,11 @@ void wma_vdev_resp_timer(void *data)
* Trigger host crash if the flag is set or if the timeout
* is not due to fw down
*/
- if (wma_crash_on_fw_timeout(wma->fw_timeout_crash) == true) {
+ if (wma_crash_on_fw_timeout(wma->fw_timeout_crash) == true)
wma_trigger_recovery_assert_on_fw_timeout(
WMA_CHNL_SWITCH_REQ);
- } else {
- wma_send_msg_high_priority(wma, WMA_SWITCH_CHANNEL_RSP,
- (void *)params, 0);
- }
+ wma_send_msg_high_priority(wma, WMA_SWITCH_CHANNEL_RSP,
+ (void *)params, 0);
if (wma->interfaces[tgt_req->vdev_id].is_channel_switch) {
wma->interfaces[tgt_req->vdev_id].is_channel_switch =
false;
@@ -3426,27 +3404,25 @@ void wma_vdev_resp_timer(void *data)
WMA_LOGA("%s: WMA_ADD_BSS_REQ timedout", __func__);
WMA_LOGD("%s: bssid %pM vdev_id %d", __func__, params->bssId,
tgt_req->vdev_id);
- if (wma_crash_on_fw_timeout(wma->fw_timeout_crash) == true) {
+ if (wma_crash_on_fw_timeout(wma->fw_timeout_crash) == true)
wma_trigger_recovery_assert_on_fw_timeout(
- WMA_ADD_BSS_REQ);
- } else {
- /* Send vdev stop to the FW */
- if (wma_send_vdev_stop_to_fw(wma, tgt_req->vdev_id))
- WMA_LOGE("%s: Failed to send vdev stop to fw",
- __func__);
+ WMA_ADD_BSS_REQ);
+ /* Send vdev stop to the FW */
+ if (wma_send_vdev_stop_to_fw(wma, tgt_req->vdev_id))
+ WMA_LOGE("%s: Failed to send vdev stop to fw",
+ __func__);
- peer = ol_txrx_find_peer_by_addr(pdev, params->bssId,
- &peer_id);
- if (peer)
- wma_remove_peer(wma, params->bssId,
- tgt_req->vdev_id, peer, false);
- else
- WMA_LOGE("%s: Failed to find peer", __func__);
+ peer = ol_txrx_find_peer_by_addr(pdev, params->bssId,
+ &peer_id);
+ if (peer)
+ wma_remove_peer(wma, params->bssId,
+ tgt_req->vdev_id, peer, false);
+ else
+ WMA_LOGE("%s: Failed to find peer", __func__);
- wma_send_msg_high_priority(wma,
- WMA_ADD_BSS_RSP, (void *)params, 0);
- QDF_ASSERT(0);
- }
+ wma_send_msg_high_priority(wma, WMA_ADD_BSS_RSP,
+ (void *)params, 0);
+ QDF_ASSERT(0);
goto free_tgt_req;
} else if (tgt_req->msg_type == WMA_OCB_SET_CONFIG_CMD) {
diff --git a/core/wma/src/wma_main.c b/core/wma/src/wma_main.c
index 5b20a609c21e..f15e175e59d1 100644
--- a/core/wma/src/wma_main.c
+++ b/core/wma/src/wma_main.c
@@ -7541,7 +7541,6 @@ QDF_STATUS wma_mc_process_msg(void *cds_context, cds_msg_t *msg)
break;
case WMA_SEND_BEACON_REQ:
wma_send_beacon(wma_handle, (tpSendbeaconParams) msg->bodyptr);
- qdf_mem_free(msg->bodyptr);
break;
case WMA_SEND_PROBE_RSP_TMPL:
wma_send_probe_rsp_tmpl(wma_handle,
diff --git a/core/wma/src/wma_mgmt.c b/core/wma/src/wma_mgmt.c
index 8888794e78a9..1dafa8ed0b2c 100644
--- a/core/wma/src/wma_mgmt.c
+++ b/core/wma/src/wma_mgmt.c
@@ -2634,11 +2634,13 @@ void wma_send_beacon(tp_wma_handle wma, tpSendbeaconParams bcn_info)
struct sAniBeaconStruct *beacon;
struct vdev_up_params param = {0};
+ WMA_LOGD("Beacon update reason %d", bcn_info->reason);
beacon = (struct sAniBeaconStruct *) (bcn_info->beacon);
vdev = wma_find_vdev_by_addr(wma, beacon->macHdr.sa, &vdev_id);
if (!vdev) {
WMA_LOGE("%s : failed to get vdev handle", __func__);
- return;
+ status = QDF_STATUS_E_INVAL;
+ goto send_rsp;
}
if (WMI_SERVICE_IS_ENABLED(wma->wmi_service_bitmap,
@@ -2648,7 +2650,7 @@ void wma_send_beacon(tp_wma_handle wma, tpSendbeaconParams bcn_info)
if (QDF_IS_STATUS_ERROR(status)) {
WMA_LOGE("%s : wmi_unified_bcn_tmpl_send Failed ",
__func__);
- return;
+ goto send_rsp;
}
if (bcn_info->p2pIeOffset) {
@@ -2659,14 +2661,15 @@ void wma_send_beacon(tp_wma_handle wma, tpSendbeaconParams bcn_info)
p2p_ie) < 0) {
WMA_LOGE("%s : wmi_unified_bcn_tmpl_send Failed ",
__func__);
- return;
+ status = QDF_STATUS_E_INVAL;
+ goto send_rsp;
}
}
}
status = wma_store_bcn_tmpl(wma, vdev_id, bcn_info);
if (status != QDF_STATUS_SUCCESS) {
WMA_LOGE("%s : wma_store_bcn_tmpl Failed", __func__);
- return;
+ goto send_rsp;
}
if (!((qdf_atomic_read(
&wma->interfaces[vdev_id].vdev_restart_params.
@@ -2680,7 +2683,7 @@ void wma_send_beacon(tp_wma_handle wma, tpSendbeaconParams bcn_info)
if (QDF_IS_STATUS_ERROR(status)) {
WMA_LOGE(FL("failed to send vdev up"));
cds_set_do_hw_mode_change_flag(false);
- return;
+ goto send_rsp;
}
wma->interfaces[vdev_id].vdev_up = true;
WMA_LOGD(FL("Setting vdev_up flag to true"));
@@ -2688,6 +2691,10 @@ void wma_send_beacon(tp_wma_handle wma, tpSendbeaconParams bcn_info)
wma_set_vdev_mgmt_rate(wma, vdev_id);
}
}
+
+send_rsp:
+ bcn_info->status = status;
+ wma_send_msg(wma, WMA_SEND_BCN_RSP, (void *)bcn_info, 0);
}
/**
diff --git a/core/wma/src/wma_utils.c b/core/wma/src/wma_utils.c
index 1aeb9dae5ea5..d7d5f7f0698a 100644
--- a/core/wma/src/wma_utils.c
+++ b/core/wma/src/wma_utils.c
@@ -4771,41 +4771,41 @@ int8_t wma_get_num_dbs_hw_modes(void)
return wma->num_dbs_hw_modes;
}
-/**
- * wma_is_hw_dbs_capable() - Check if HW is DBS capable
- *
- * Checks if the HW is DBS capable
- *
- * Return: true if the HW is DBS capable
- */
-bool wma_is_hw_dbs_capable(void)
+bool wma_find_if_fw_supports_dbs(void)
{
tp_wma_handle wma;
- uint32_t param, i, found = 0;
+ bool dbs_support;
wma = cds_get_context(QDF_MODULE_ID_WMA);
if (!wma) {
WMA_LOGE("%s: Invalid WMA handle", __func__);
return false;
}
-
- if (!wma_is_dbs_enable()) {
- WMA_LOGD("%s: DBS is disabled", __func__);
- return false;
- }
-
- WMA_LOGD("%s: DBS service bit map: %d", __func__,
- WMI_SERVICE_IS_ENABLED(wma->wmi_service_bitmap,
- WMI_SERVICE_DUAL_BAND_SIMULTANEOUS_SUPPORT));
-
+ dbs_support =
+ WMI_SERVICE_IS_ENABLED(wma->wmi_service_bitmap,
+ WMI_SERVICE_DUAL_BAND_SIMULTANEOUS_SUPPORT);
+ WMA_LOGD("%s: is DBS supported by FW/HW: %s", __func__,
+ dbs_support ? "yes" : "no");
/* The agreement with FW is that: To know if the target is DBS
* capable, DBS needs to be supported both in the HW mode list
* and in the service ready event
*/
- if (!(WMI_SERVICE_IS_ENABLED(wma->wmi_service_bitmap,
- WMI_SERVICE_DUAL_BAND_SIMULTANEOUS_SUPPORT)))
+ if (!dbs_support)
return false;
+ return true;
+}
+
+static bool wma_find_if_hwlist_has_dbs(void)
+{
+ tp_wma_handle wma;
+ uint32_t param, i, found = 0;
+
+ wma = cds_get_context(QDF_MODULE_ID_WMA);
+ if (!wma) {
+ WMA_LOGE("%s: Invalid WMA handle", __func__);
+ return false;
+ }
for (i = 0; i < wma->num_dbs_hw_modes; i++) {
param = wma->hw_mode.hw_mode_list[i];
WMA_LOGD("%s: HW param: %x", __func__, param);
@@ -4815,7 +4815,6 @@ bool wma_is_hw_dbs_capable(void)
break;
}
}
-
if (found)
return true;
@@ -4823,6 +4822,28 @@ bool wma_is_hw_dbs_capable(void)
}
/**
+ * wma_is_hw_dbs_capable() - Check if HW is DBS capable
+ *
+ * Checks if the HW is DBS capable
+ *
+ * Return: true if the HW is DBS capable
+ */
+bool wma_is_hw_dbs_capable(void)
+{
+ if (!wma_is_dbs_enable()) {
+ WMA_LOGD("%s: DBS is disabled", __func__);
+ return false;
+ }
+
+ if (!wma_find_if_fw_supports_dbs()) {
+ WMA_LOGD("%s: HW mode list has no dbs", __func__);
+ return false;
+ }
+
+ return wma_find_if_hwlist_has_dbs();
+}
+
+/**
* wma_get_cds_hw_mode_change_from_hw_mode_index - Returns value in terms of
* cds_hw_mode_change enums derived from hw_mode_index.
*