summaryrefslogtreecommitdiff
path: root/core/sme
diff options
context:
space:
mode:
authorhsuvictor <hsuvictor@google.com>2020-06-01 22:05:55 +0800
committerVictor Hsu <hsuvictor@google.com>2020-06-01 14:07:00 +0000
commitf84152e4d74e926fb46d7205e6107a20d0fe9ff1 (patch)
treeaf2c97d0b2cc4dac6219d9894864ec3d886b7304 /core/sme
parente38f4988dfa8294adac8efb871e0027ac0bb98d1 (diff)
parent96195f87fc0f7df78d63386e6f3b8a9000774420 (diff)
downloadqcacld-f84152e4d74e926fb46d7205e6107a20d0fe9ff1.tar.gz
Merge remote-tracking branch 'remotes/partner/qcom-msm-4.19-7250-wlan-cld3.driver.lnx.2.0.5.r10' (r2.011) into android-msm-pixel-4.19
Change-Id: I9992b027cf8787aad4a1775c0c0e4a447e088901
Diffstat (limited to 'core/sme')
-rw-r--r--core/sme/inc/csr_internal.h2
-rw-r--r--core/sme/inc/sme_api.h2
-rw-r--r--core/sme/inc/sme_internal.h2
-rw-r--r--core/sme/src/common/sme_api.c4
-rw-r--r--core/sme/src/csr/csr_api_roam.c163
-rw-r--r--core/sme/src/csr/csr_api_scan.c48
-rw-r--r--core/sme/src/csr/csr_inside_api.h4
7 files changed, 129 insertions, 96 deletions
diff --git a/core/sme/inc/csr_internal.h b/core/sme/inc/csr_internal.h
index 612fe7e519..7a2d68ff30 100644
--- a/core/sme/inc/csr_internal.h
+++ b/core/sme/inc/csr_internal.h
@@ -692,7 +692,7 @@ struct csr_roam_session {
bool nss_forced_1x1;
bool disable_hi_rssi;
bool dhcp_done;
- uint8_t disconnect_reason;
+ tSirMacReasonCodes disconnect_reason;
uint8_t uapsd_mask;
struct scan_cmd_info scan_info;
qdf_mc_timer_t roaming_offload_timer;
diff --git a/core/sme/inc/sme_api.h b/core/sme/inc/sme_api.h
index 69f46a7b16..108870c01e 100644
--- a/core/sme/inc/sme_api.h
+++ b/core/sme/inc/sme_api.h
@@ -2203,13 +2203,11 @@ QDF_STATUS sme_set_lost_link_info_cb(mac_handle_t mac_handle,
*/
QDF_STATUS sme_update_new_channel_event(mac_handle_t mac_handle,
uint8_t session_id);
-#ifdef WLAN_POWER_DEBUGFS
QDF_STATUS sme_power_debug_stats_req(
mac_handle_t mac_handle,
void (*callback_fn)(struct power_stats_response *response,
void *context),
void *power_stats_context);
-#endif
#ifdef WLAN_FEATURE_BEACON_RECEPTION_STATS
/**
diff --git a/core/sme/inc/sme_internal.h b/core/sme/inc/sme_internal.h
index 2778a06e59..d160fd891d 100644
--- a/core/sme/inc/sme_internal.h
+++ b/core/sme/inc/sme_internal.h
@@ -307,11 +307,9 @@ struct sme_context {
link_layer_stats_cb link_layer_stats_cb;
void (*link_layer_stats_ext_cb)(hdd_handle_t callback_ctx,
tSirLLStatsResults *rsp);
-#ifdef WLAN_POWER_DEBUGFS
void *power_debug_stats_context;
void (*power_stats_resp_callback)(struct power_stats_response *rsp,
void *callback_context);
-#endif
#ifdef WLAN_FEATURE_BEACON_RECEPTION_STATS
void *beacon_stats_context;
void (*beacon_stats_resp_callback)(struct bcn_reception_stats_rsp *rsp,
diff --git a/core/sme/src/common/sme_api.c b/core/sme/src/common/sme_api.c
index e2164373b3..1b8d1554d4 100644
--- a/core/sme/src/common/sme_api.c
+++ b/core/sme/src/common/sme_api.c
@@ -219,7 +219,7 @@ static QDF_STATUS sme_process_set_hw_mode_resp(struct mac_context *mac, uint8_t
csr_sta_continue_csa(mac, session_id);
}
- if (reason == POLICY_MGR_UPDATE_REASON_CHANNEL_SWITCH) {
+ if (reason == POLICY_MGR_UPDATE_REASON_CHANNEL_SWITCH_SAP) {
sme_info("Continue channel switch for SAP on vdev %d",
session_id);
csr_csa_restart(mac, session_id);
@@ -10983,7 +10983,6 @@ QDF_STATUS sme_ll_stats_set_thresh(mac_handle_t mac_handle,
#endif /* WLAN_FEATURE_LINK_LAYER_STATS */
-#ifdef WLAN_POWER_DEBUGFS
/**
* sme_power_debug_stats_req() - SME API to collect Power debug stats
* @callback_fn: Pointer to the callback function for Power stats event
@@ -11022,7 +11021,6 @@ QDF_STATUS sme_power_debug_stats_req(
}
return status;
}
-#endif
#ifdef WLAN_FEATURE_BEACON_RECEPTION_STATS
QDF_STATUS sme_beacon_debug_stats_req(
diff --git a/core/sme/src/csr/csr_api_roam.c b/core/sme/src/csr/csr_api_roam.c
index b3592d3fda..49fb001274 100644
--- a/core/sme/src/csr/csr_api_roam.c
+++ b/core/sme/src/csr/csr_api_roam.c
@@ -66,6 +66,7 @@
#include "wlan_policy_mgr_i.h"
#include "wlan_scan_utils_api.h"
#include "wlan_p2p_cfg_api.h"
+#include "cfg_nan_api.h"
#include "wlan_pkt_capture_ucfg_api.h"
@@ -7243,6 +7244,17 @@ static void csr_process_fils_join_rsp(struct mac_context *mac_ctx,
}
status = csr_roam_issue_set_context_req_helper(mac_ctx, session_id,
+ profile->negotiatedUCEncryptionType,
+ bss_desc, &(bss_desc->bssId), true,
+ true, eSIR_TX_RX, 0,
+ roam_info->fils_join_rsp->tk_len,
+ roam_info->fils_join_rsp->tk, 0);
+ if (!QDF_IS_STATUS_SUCCESS(status)) {
+ sme_debug("Set context for unicast fail");
+ goto process_fils_join_rsp_fail;
+ }
+
+ status = csr_roam_issue_set_context_req_helper(mac_ctx, session_id,
profile->negotiatedMCEncryptionType,
bss_desc, &bcast_mac, true, false,
eSIR_RX_ONLY, 2,
@@ -7253,16 +7265,6 @@ static void csr_process_fils_join_rsp(struct mac_context *mac_ctx,
goto process_fils_join_rsp_fail;
}
- status = csr_roam_issue_set_context_req_helper(mac_ctx, session_id,
- profile->negotiatedUCEncryptionType,
- bss_desc, &(bss_desc->bssId), true,
- true, eSIR_TX_RX, 0,
- roam_info->fils_join_rsp->tk_len,
- roam_info->fils_join_rsp->tk, 0);
- if (!QDF_IS_STATUS_SUCCESS(status)) {
- sme_debug("Set context for unicast fail");
- goto process_fils_join_rsp_fail;
- }
return;
process_fils_join_rsp_fail:
@@ -7279,6 +7281,21 @@ static inline void csr_process_fils_join_rsp(struct mac_context *mac_ctx,
{}
#endif
+static void csr_update_tx_pwr_to_fw(struct mac_context *mac_ctx,
+ uint8_t vdev_id)
+{
+ struct scheduler_msg msg = {0};
+
+ msg.type = WMA_SEND_MAX_TX_POWER;
+ msg.bodyval = vdev_id;
+ if (QDF_STATUS_SUCCESS != scheduler_post_message(QDF_MODULE_ID_SME,
+ QDF_MODULE_ID_WMA,
+ QDF_MODULE_ID_WMA,
+ &msg)) {
+ sme_err("Failed to post WMA_SEND_MAX_TX_POWER message to WMA");
+ }
+}
+
/**
* csr_roam_process_join_res() - Process the Join results
* @mac_ctx: Global MAC Context
@@ -7689,6 +7706,8 @@ static void csr_roam_process_join_res(struct mac_context *mac_ctx,
#endif
csr_roam_link_up(mac_ctx, conn_profile->bssid);
}
+
+ csr_update_tx_pwr_to_fw(mac_ctx, session_id);
sme_free_join_rsp_fils_params(roam_info);
qdf_mem_free(roam_info);
}
@@ -9160,6 +9179,7 @@ static void csr_roam_join_rsp_processor(struct mac_context *mac,
uint32_t len = 0, roamId = 0, reason_code = 0;
bool is_dis_pending;
bool use_same_bss = false;
+ bool retry_same_bss = false;
if (!pSmeJoinRsp) {
sme_err("Sme Join Response is NULL");
@@ -9252,7 +9272,6 @@ static void csr_roam_join_rsp_processor(struct mac_context *mac,
* AP.
*/
if (reason_code == eSIR_MAC_INVALID_PMKID) {
- struct tag_csrscan_result *scan_result;
pmksa_entry = qdf_mem_malloc(sizeof(*pmksa_entry));
if (!pmksa_entry)
@@ -9266,16 +9285,26 @@ static void csr_roam_join_rsp_processor(struct mac_context *mac,
sme_roam_del_pmkid_from_cache(mac_handle, session_ptr->vdev_id,
pmksa_entry, false);
qdf_mem_free(pmksa_entry);
- if (pCommand && pCommand->u.roamCmd.pRoamBssEntry) {
- scan_result =
- GET_BASE_ADDR(pCommand->u.roamCmd.pRoamBssEntry,
- struct tag_csrscan_result, Link);
- /* Retry with same BSSID without PMKID */
- if (!scan_result->retry_count) {
- sme_info("Retry once again with same BSSID without PMKID");
- scan_result->retry_count = 1;
- use_same_bss = true;
- }
+ retry_same_bss = true;
+ }
+ if (pSmeJoinRsp->messageType == eWNI_SME_JOIN_RSP &&
+ pSmeJoinRsp->status_code == eSIR_SME_ASSOC_TIMEOUT_RESULT_CODE &&
+ mlme_get_reconn_after_assoc_timeout_flag(mac->psoc,
+ pSmeJoinRsp->sessionId))
+ retry_same_bss = true;
+
+ if (retry_same_bss && pCommand && pCommand->u.roamCmd.pRoamBssEntry) {
+ struct tag_csrscan_result *scan_result;
+
+ scan_result =
+ GET_BASE_ADDR(pCommand->u.roamCmd.pRoamBssEntry,
+ struct tag_csrscan_result, Link);
+ /* Retry with same BSSID without PMKID */
+ if (!scan_result->retry_count) {
+ sme_info("Retry once with same BSSID, status %d reason %d",
+ pSmeJoinRsp->status_code, reason_code);
+ scan_result->retry_count = 1;
+ use_same_bss = true;
}
}
@@ -10332,13 +10361,9 @@ void csr_roaming_state_msg_processor(struct mac_context *mac, void *msg_buf)
break;
case eWNI_SME_DEAUTH_RSP:
/* or the Deauthentication response message... */
- if (CSR_IS_ROAM_SUBSTATE_DEAUTH_REQ(mac, pSmeRsp->sessionId)) {
- csr_remove_nonscan_cmd_from_pending_list(mac,
- pSmeRsp->sessionId,
- eSmeCommandWmStatusChange);
+ if (CSR_IS_ROAM_SUBSTATE_DEAUTH_REQ(mac, pSmeRsp->sessionId))
csr_roam_roaming_state_deauth_rsp_processor(mac,
(struct deauth_rsp *) pSmeRsp);
- }
break;
case eWNI_SME_START_BSS_RSP:
/* or the Start BSS response message... */
@@ -15975,6 +16000,7 @@ QDF_STATUS csr_send_join_req_msg(struct mac_context *mac, uint32_t sessionId,
uint8_t ap_nss;
struct wlan_objmgr_vdev *vdev;
bool follow_ap_edca;
+ bool reconn_after_assoc_timeout = false;
if (!pSession) {
sme_err("session %d not found", sessionId);
@@ -16148,6 +16174,14 @@ QDF_STATUS csr_send_join_req_msg(struct mac_context *mac, uint32_t sessionId,
&vendor_ap_search_attr,
ACTION_OUI_DISABLE_AGGRESSIVE_EDCA);
+ if (messageType == eWNI_SME_JOIN_REQ &&
+ ucfg_action_oui_search(mac->psoc, &vendor_ap_search_attr,
+ ACTION_OUI_HOST_RECONN))
+ reconn_after_assoc_timeout = true;
+ mlme_set_reconn_after_assoc_timeout_flag(
+ mac->psoc, sessionId,
+ reconn_after_assoc_timeout);
+
vdev = wlan_objmgr_get_vdev_by_id_from_psoc(mac->psoc,
sessionId,
WLAN_LEGACY_MAC_ID);
@@ -16914,7 +16948,7 @@ QDF_STATUS csr_send_mb_disassoc_req_msg(struct mac_context *mac,
}
pMsg->reasonCode = reasonCode;
pMsg->process_ho_fail = (pSession->disconnect_reason ==
- eCSR_DISCONNECT_REASON_ROAM_HO_FAIL) ? true : false;
+ eSIR_MAC_FW_TRIGGERED_ROAM_FAILURE) ? true : false;
/* Update the disconnect stats */
pSession->disconnect_stats.disconnection_cnt++;
@@ -18796,6 +18830,10 @@ csr_update_roam_scan_offload_request(struct mac_context *mac_ctx,
struct csr_roam_session *session)
{
uint32_t pmkid_modes = mac_ctx->mlme_cfg->sta.pmkid_modes;
+ struct sCsrNeighborRoamControlInfo *neighbor_roam_info;
+
+ neighbor_roam_info =
+ &mac_ctx->roam.neighborRoamInfo[session->vdev_id];
req_buf->roam_offload_enabled = csr_is_roam_offload_enabled(mac_ctx);
if (!req_buf->roam_offload_enabled)
@@ -18838,8 +18876,10 @@ csr_update_roam_scan_offload_request(struct mac_context *mac_ctx,
mac_ctx->mlme_cfg->lfr.min_delay_btw_roam_scans;
req_buf->roam_trigger_reason_bitmask =
mac_ctx->mlme_cfg->lfr.roam_trigger_reason_bitmask;
+ /* Do not force RSSI triggers in case controlled roaming enable */
req_buf->roam_force_rssi_trigger =
- mac_ctx->mlme_cfg->lfr.roam_force_rssi_trigger;
+ (!neighbor_roam_info->roam_control_enable &&
+ mac_ctx->mlme_cfg->lfr.roam_force_rssi_trigger);
csr_update_roam_req_adaptive_11r(session, mac_ctx, req_buf);
/* fill bss load triggered roam related configs */
@@ -19217,6 +19257,43 @@ void csr_rso_command_fill_11w_params(struct mac_context *mac_ctx,
#endif
/**
+ * csr_get_peer_pmf_status() - Get the PMF capability of peer
+ * @mac_ctx: Global mac ctx
+ * @session: roam session
+ *
+ * Return: True if PMF is enabled, false otherwise.
+ */
+static bool csr_get_peer_pmf_status(struct mac_context *mac_ctx,
+ struct csr_roam_session *session)
+{
+ struct wlan_objmgr_peer *peer;
+ bool is_pmf_enabled;
+
+
+ if (!session->pConnectBssDesc) {
+ sme_err("Connected Bss Desc is NULL");
+ return false;
+ }
+
+ peer = wlan_objmgr_get_peer(mac_ctx->psoc,
+ wlan_objmgr_pdev_get_pdev_id(mac_ctx->pdev),
+ session->pConnectBssDesc->bssId,
+ WLAN_LEGACY_SME_ID);
+ if (!peer) {
+ sme_debug("Peer of peer_mac %pM not found",
+ session->pConnectBssDesc->bssId);
+ return false;
+ }
+
+ is_pmf_enabled = mlme_get_peer_pmf_status(peer);
+ wlan_objmgr_peer_release_ref(peer, WLAN_LEGACY_SME_ID);
+ sme_debug("get is_pmf_enabled %d for %pM", is_pmf_enabled,
+ session->pConnectBssDesc->bssId);
+
+ return is_pmf_enabled;
+}
+
+/**
* csr_create_roam_scan_offload_request() - init roam offload scan request
*
* parameters
@@ -19487,8 +19564,11 @@ csr_create_roam_scan_offload_request(struct mac_context *mac_ctx,
req_buf->lca_config_params.num_disallowed_aps =
mac_ctx->mlme_cfg->lfr.lfr3_num_disallowed_aps;
- /* For RSO Stop, we need to notify FW to deinit BTM */
- if (command == ROAM_SCAN_OFFLOAD_STOP)
+ /* For RSO Stop or if peer does not support PMF, Disable BTM offload
+ * to firmware.
+ */
+ if (command == ROAM_SCAN_OFFLOAD_STOP ||
+ !csr_get_peer_pmf_status(mac_ctx, session))
req_buf->btm_offload_config = 0;
else
req_buf->btm_offload_config =
@@ -20620,6 +20700,7 @@ csr_roam_offload_scan(struct mac_context *mac_ctx, uint8_t session_id,
bool prev_roaming_state;
enum csr_akm_type roam_profile_akm = eCSR_AUTH_TYPE_UNKNOWN;
uint32_t fw_akm_bitmap;
+ bool p2p_disable_sta_roaming = 0, nan_disable_sta_roaming = 0;
sme_debug("RSO Command %d, vdev %d, Reason %d", command,
session_id, reason);
@@ -20704,14 +20785,22 @@ csr_roam_offload_scan(struct mac_context *mac_ctx, uint8_t session_id,
}
}
- if (cfg_p2p_is_roam_config_disabled(mac_ctx->psoc) &&
- (command == ROAM_SCAN_OFFLOAD_START ||
- command == ROAM_SCAN_OFFLOAD_UPDATE_CFG) &&
- (policy_mgr_mode_specific_connection_count(mac_ctx->psoc,
+ p2p_disable_sta_roaming =
+ (cfg_p2p_is_roam_config_disabled(mac_ctx->psoc) &&
+ (policy_mgr_mode_specific_connection_count(mac_ctx->psoc,
PM_P2P_CLIENT_MODE, NULL) ||
+ policy_mgr_mode_specific_connection_count(mac_ctx->psoc,
+ PM_P2P_GO_MODE, NULL)));
+ nan_disable_sta_roaming =
+ (cfg_nan_is_roam_config_disabled(mac_ctx->psoc) &&
policy_mgr_mode_specific_connection_count(mac_ctx->psoc,
- PM_P2P_GO_MODE, NULL))) {
- sme_info("roaming not supported for active p2p connection");
+ PM_NDI_MODE, NULL));
+
+ if ((command == ROAM_SCAN_OFFLOAD_START ||
+ command == ROAM_SCAN_OFFLOAD_UPDATE_CFG) &&
+ (p2p_disable_sta_roaming || nan_disable_sta_roaming)) {
+ sme_info("roaming not supported for active %s connection",
+ p2p_disable_sta_roaming ? "p2p" : "ndi");
return QDF_STATUS_E_FAILURE;
}
/*
@@ -22694,7 +22783,7 @@ static QDF_STATUS csr_process_roam_sync_callback(struct mac_context *mac_ctx,
sme_debug("Roaming triggered failed source %d nud behaviour %d",
vdev_roam_params->source, mac_ctx->nud_fail_behaviour);
if (vdev_roam_params->source == USERSPACE_INITIATED ||
- mac_ctx->nud_fail_behaviour == DISCONNECT_AFTER_NUD_FAIL) {
+ mac_ctx->nud_fail_behaviour == DISCONNECT_AFTER_ROAM_FAIL) {
/* Userspace roam req fail, disconnect with AP */
csr_roam_disconnect(mac_ctx, session_id,
eCSR_DISCONNECT_REASON_DEAUTH,
diff --git a/core/sme/src/csr/csr_api_scan.c b/core/sme/src/csr/csr_api_scan.c
index 86aec351b5..27605006b9 100644
--- a/core/sme/src/csr/csr_api_scan.c
+++ b/core/sme/src/csr/csr_api_scan.c
@@ -1688,54 +1688,6 @@ QDF_STATUS csr_scan_abort_mac_scan(struct mac_context *mac_ctx,
return status;
}
-QDF_STATUS csr_remove_nonscan_cmd_from_pending_list(struct mac_context *mac,
- uint8_t sessionId,
- eSmeCommandType commandType)
-{
- tDblLinkList localList;
- tListElem *pEntry;
- tSmeCmd *pCommand;
- tListElem *pEntryToRemove;
- QDF_STATUS status = QDF_STATUS_E_FAILURE;
-
- qdf_mem_zero(&localList, sizeof(tDblLinkList));
- if (!QDF_IS_STATUS_SUCCESS(csr_ll_open(&localList))) {
- sme_err("failed to open list");
- return status;
- }
-
- pEntry = csr_nonscan_pending_ll_peek_head(mac, LL_ACCESS_NOLOCK);
-
- /*
- * Have to make sure we don't loop back to the head of the list,
- * which will happen if the entry is NOT on the list
- */
- while (pEntry) {
- pEntryToRemove = pEntry;
- pEntry = csr_nonscan_pending_ll_next(mac,
- pEntry, LL_ACCESS_NOLOCK);
- pCommand = GET_BASE_ADDR(pEntryToRemove, tSmeCmd, Link);
-
- if ((pCommand->command == commandType) &&
- (pCommand->sessionId == sessionId)) {
- /* Insert to localList and remove later */
- csr_ll_insert_tail(&localList, pEntryToRemove,
- LL_ACCESS_NOLOCK);
- status = QDF_STATUS_SUCCESS;
- }
- }
-
-
- while ((pEntry = csr_ll_remove_head(&localList, LL_ACCESS_NOLOCK))) {
- pCommand = GET_BASE_ADDR(pEntry, tSmeCmd, Link);
- sme_debug("Sending abort for command ID %d",
- sessionId);
- csr_release_command(mac, pCommand);
- }
-
- csr_ll_close(&localList);
- return status;
-}
bool csr_roam_is_valid_channel(struct mac_context *mac, uint8_t channel)
{
diff --git a/core/sme/src/csr/csr_inside_api.h b/core/sme/src/csr/csr_inside_api.h
index 17cedf6895..65813ad381 100644
--- a/core/sme/src/csr/csr_inside_api.h
+++ b/core/sme/src/csr/csr_inside_api.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011-2019 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2011-2020 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
@@ -197,8 +197,6 @@ QDF_STATUS csr_scan_for_ssid(struct mac_context *mac, uint32_t sessionId,
*/
QDF_STATUS csr_scan_abort_mac_scan(struct mac_context *mac, uint32_t vdev_id,
uint32_t scan_id);
-QDF_STATUS csr_remove_nonscan_cmd_from_pending_list(struct mac_context *mac,
- uint8_t sessionId, eSmeCommandType commandType);
/* If fForce is true we will save the new String that is learn't. */
/* Typically it will be true in case of Join or user initiated ioctl */