diff options
| -rw-r--r-- | core/hdd/inc/wlan_hdd_main.h | 2 | ||||
| -rw-r--r-- | core/hdd/src/wlan_hdd_assoc.c | 5 | ||||
| -rw-r--r-- | core/hdd/src/wlan_hdd_cfg80211.c | 27 | ||||
| -rw-r--r-- | core/hdd/src/wlan_hdd_ioctl.c | 16 | ||||
| -rw-r--r-- | core/hdd/src/wlan_hdd_main.c | 7 | ||||
| -rw-r--r-- | core/sme/inc/csr_api.h | 3 | ||||
| -rw-r--r-- | core/sme/inc/csr_internal.h | 14 | ||||
| -rw-r--r-- | core/sme/inc/csr_neighbor_roam.h | 16 | ||||
| -rw-r--r-- | core/sme/inc/sme_api.h | 11 | ||||
| -rw-r--r-- | core/sme/src/common/sme_api.c | 37 | ||||
| -rw-r--r-- | core/sme/src/csr/csr_api_roam.c | 42 | ||||
| -rw-r--r-- | core/sme/src/csr/csr_util.c | 17 | ||||
| -rw-r--r-- | core/wma/src/wma_scan_roam.c | 4 |
13 files changed, 137 insertions, 64 deletions
diff --git a/core/hdd/inc/wlan_hdd_main.h b/core/hdd/inc/wlan_hdd_main.h index a6a238a7cd77..16e3fdb65f98 100644 --- a/core/hdd/inc/wlan_hdd_main.h +++ b/core/hdd/inc/wlan_hdd_main.h @@ -1439,8 +1439,6 @@ struct hdd_adapter_s { struct hdd_connect_pm_context connect_rpm_ctx; struct power_stats_response *chip_power_stats; - bool fast_roaming_allowed; - /* rcpi information */ struct rcpi_info rcpi; /* diff --git a/core/hdd/src/wlan_hdd_assoc.c b/core/hdd/src/wlan_hdd_assoc.c index 08e250467f95..a49b0955eb3e 100644 --- a/core/hdd/src/wlan_hdd_assoc.c +++ b/core/hdd/src/wlan_hdd_assoc.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. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -1727,6 +1727,9 @@ static QDF_STATUS hdd_dis_connect_handler(hdd_adapter_t *pAdapter, hdd_reset_limit_off_chan(pAdapter); hdd_print_bss_info(pHddStaCtx); + + if (cds_mode_specific_connection_count(CDS_STA_MODE, NULL)) + sme_enable_roaming_on_connected_sta(pHddCtx->hHal); return status; } diff --git a/core/hdd/src/wlan_hdd_cfg80211.c b/core/hdd/src/wlan_hdd_cfg80211.c index e72d2fac4185..edf3d6eaa0fd 100644 --- a/core/hdd/src/wlan_hdd_cfg80211.c +++ b/core/hdd/src/wlan_hdd_cfg80211.c @@ -10676,7 +10676,7 @@ static int __wlan_hdd_cfg80211_set_fast_roaming(struct wiphy *wiphy, struct net_device *dev = wdev->netdev; hdd_adapter_t *adapter = WLAN_HDD_GET_PRIV_PTR(dev); struct nlattr *tb[QCA_WLAN_VENDOR_ATTR_MAX + 1]; - uint32_t is_fast_roam_enabled, enable_lfr_fw; + uint32_t is_fast_roam_enabled; int ret; QDF_STATUS qdf_status; unsigned long rc; @@ -10708,26 +10708,18 @@ static int __wlan_hdd_cfg80211_set_fast_roaming(struct wiphy *wiphy, is_fast_roam_enabled = nla_get_u32( tb[QCA_WLAN_VENDOR_ATTR_ROAMING_POLICY]); - hdd_debug("isFastRoamEnabled %d fast_roaming_allowed %d", - is_fast_roam_enabled, adapter->fast_roaming_allowed); - - if (!adapter->fast_roaming_allowed) { - hdd_err("fast roaming not allowed on %s interface", - adapter->dev->name); - return -EINVAL; - } + hdd_debug("isFastRoamEnabled %d", is_fast_roam_enabled); /* Update roaming */ - enable_lfr_fw = (is_fast_roam_enabled && adapter->fast_roaming_allowed); qdf_status = sme_config_fast_roaming(hdd_ctx->hHal, adapter->sessionId, - enable_lfr_fw); + is_fast_roam_enabled); if (qdf_status != QDF_STATUS_SUCCESS) hdd_err("sme_config_fast_roaming failed with status=%d", qdf_status); ret = qdf_status_to_os_return(qdf_status); if (eConnectionState_Associated == hdd_sta_ctx->conn_info.connState && - QDF_IS_STATUS_SUCCESS(qdf_status) && !enable_lfr_fw) { + QDF_IS_STATUS_SUCCESS(qdf_status) && !is_fast_roam_enabled) { INIT_COMPLETION(adapter->lfr_fw_status.disable_lfr_event); /* @@ -15824,10 +15816,7 @@ static int wlan_hdd_cfg80211_connect_start(hdd_adapter_t *pAdapter, qdf_mem_copy((void *)(pRoamProfile->SSIDs.SSIDList->SSID.ssId), ssid, ssid_len); - pRoamProfile->supplicant_disabled_roaming = - !pAdapter->fast_roaming_allowed; - pRoamProfile->roaming_allowed_on_iface = - pAdapter->fast_roaming_allowed; + pRoamProfile->supplicant_disabled_roaming = false; /* cleanup bssid hint */ qdf_mem_zero(pRoamProfile->bssid_hint.bytes, @@ -20223,10 +20212,8 @@ static int __wlan_hdd_cfg80211_update_connect_params( changed, roam_profile->fils_con_info->is_fils_connection, roam_profile->fils_con_info->key_nai_length); - if (!adapter->fast_roaming_allowed || - !hdd_ctx->config->is_fils_roaming_supported) { - hdd_debug("LFR3: %d, FILS support %d", - adapter->fast_roaming_allowed, + if (!hdd_ctx->config->is_fils_roaming_supported) { + hdd_debug("FILS roaming support %d", hdd_ctx->config->is_fils_roaming_supported); return 0; } diff --git a/core/hdd/src/wlan_hdd_ioctl.c b/core/hdd/src/wlan_hdd_ioctl.c index c9c7114b3eab..daf7cd8f4fe5 100644 --- a/core/hdd/src/wlan_hdd_ioctl.c +++ b/core/hdd/src/wlan_hdd_ioctl.c @@ -3310,11 +3310,6 @@ static int drv_cmd_set_roam_mode(hdd_adapter_t *adapter, uint8_t *value = command; uint8_t roamMode = CFG_LFR_FEATURE_ENABLED_DEFAULT; - if (!adapter->fast_roaming_allowed) { - hdd_err("Roaming is always disabled on this interface"); - goto exit; - } - /* Move pointer to ahead of SETROAMMODE<delimiter> */ value = value + SIZE_OF_SETROAMMODE + 1; @@ -4352,11 +4347,6 @@ static int drv_cmd_set_fast_roam(hdd_adapter_t *adapter, uint8_t *value = command; uint8_t lfrMode = CFG_LFR_FEATURE_ENABLED_DEFAULT; - if (!adapter->fast_roaming_allowed) { - hdd_err("Roaming is always disabled on this interface"); - goto exit; - } - /* Move pointer to ahead of SETFASTROAM<delimiter> */ value = value + command_len + 1; @@ -5696,12 +5686,6 @@ static int drv_cmd_set_ccx_mode(hdd_adapter_t *adapter, goto exit; } - if (!adapter->fast_roaming_allowed) { - hdd_warn("Fast roaming is not allowed on this device hence this operation is not permitted!"); - ret = -EPERM; - goto exit; - } - /* Move pointer to ahead of SETCCXMODE<delimiter> */ value = value + command_len + 1; diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index 36eda8fc37af..1313c5ae2959 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -3291,8 +3291,8 @@ QDF_STATUS hdd_init_station_mode(hdd_adapter_t *adapter) sizeof(pHddStaCtx->conn_info.staId), HDD_WLAN_INVALID_STA_ID); /* set fast roaming capability in sme session */ - status = sme_config_fast_roaming(hdd_ctx->hHal, adapter->sessionId, - adapter->fast_roaming_allowed); + status = sme_config_fast_roaming(hdd_ctx->hHal, + adapter->sessionId, true); /* Set the default operation channel */ pHddStaCtx->conn_info.operationChannel = hdd_ctx->config->OperatingChannel; @@ -8632,9 +8632,6 @@ static int hdd_open_interfaces(hdd_context_t *hdd_ctx, bool rtnl_held) if (adapter == NULL) return -ENOSPC; - /* fast roaming is allowed only on first STA, i.e. wlan adapter */ - adapter->fast_roaming_allowed = true; - if (strlen(hdd_ctx->config->enableConcurrentSTA) != 0) { ret = hdd_open_concurrent_interface(hdd_ctx, rtnl_held); if (ret) diff --git a/core/sme/inc/csr_api.h b/core/sme/inc/csr_api.h index dc998b9270da..2cbb3b7582ae 100644 --- a/core/sme/inc/csr_api.h +++ b/core/sme/inc/csr_api.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011-2017 The Linux Foundation. All rights reserved. + * Copyright (c) 2011-2018 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -999,7 +999,6 @@ typedef struct tagCsrRoamProfile { struct qdf_mac_addr bssid_hint; bool force_24ghz_in_ht20; bool supplicant_disabled_roaming; - bool roaming_allowed_on_iface; #ifdef WLAN_FEATURE_FILS_SK bool fils_connection; uint8_t *hlp_ie; diff --git a/core/sme/inc/csr_internal.h b/core/sme/inc/csr_internal.h index 57d00d4b4c57..ce78064f7a42 100644 --- a/core/sme/inc/csr_internal.h +++ b/core/sme/inc/csr_internal.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011-2017 The Linux Foundation. All rights reserved. + * Copyright (c) 2011-2018 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -1268,6 +1268,18 @@ bool csr_is_sta_session_connected(tpAniSirGlobal pMac); bool csr_is_p2p_session_connected(tpAniSirGlobal pMac); bool csr_is_any_session_connected(tpAniSirGlobal pMac); bool csr_is_infra_connected(tpAniSirGlobal pMac); + +/** + * csr_get_connected_infra() - get the session id of the connected infra + * @mac_ctx: pointer to global mac structure + * + * The function check if any infra is present in connected state and if present + * return the session id of the connected infra else if no infra is in connected + * state return CSR_SESSION_ID_INVALID + * + * Return: session id of the connected infra + */ +uint8_t csr_get_connected_infra(tpAniSirGlobal mac_ctx); bool csr_is_concurrent_infra_connected(tpAniSirGlobal pMac); bool csr_is_concurrent_session_running(tpAniSirGlobal pMac); bool csr_is_infra_ap_started(tpAniSirGlobal pMac); diff --git a/core/sme/inc/csr_neighbor_roam.h b/core/sme/inc/csr_neighbor_roam.h index 306d54615cc0..22ef0c3c7834 100644 --- a/core/sme/inc/csr_neighbor_roam.h +++ b/core/sme/inc/csr_neighbor_roam.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011-2017 The Linux Foundation. All rights reserved. + * Copyright (c) 2011-2018 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -344,6 +344,20 @@ static inline QDF_STATUS csr_roam_offload_scan(tpAniSirGlobal pMac, } #endif +/** + * csr_get_roam_enabled_sta_sessionid() - get the session id of the sta on which + * roaming is enabled. + * @mac_ctx: pointer to global mac structure + * + * The function check if any sta is present and has roaming enabled and return + * the session id of the sta with roaming enabled else if roaming is not enabled + * on any STA return CSR_SESSION_ID_INVALID + * + * Return: session id of STA on which roaming is enabled + */ +uint8_t csr_get_roam_enabled_sta_sessionid( + tpAniSirGlobal mac_ctx); + #if defined(WLAN_FEATURE_FILS_SK) /** * csr_update_fils_config - Update FILS config to CSR roam session diff --git a/core/sme/inc/sme_api.h b/core/sme/inc/sme_api.h index a90e2bf7d875..1017890ed6f1 100644 --- a/core/sme/inc/sme_api.h +++ b/core/sme/inc/sme_api.h @@ -2005,4 +2005,15 @@ QDF_STATUS sme_fast_reassoc(tHalHandle hal, tCsrRoamProfile *profile, const tSirMacAddr bssid, int channel, uint8_t vdev_id, const tSirMacAddr connected_bssid); +/** + * sme_enable_roaming_on_connected_sta() - Enable roaming on an connected sta + * @hal: handle returned by mac_open + * + * The function check if any connected STA is present on which roaming is not + * enabled and if present enabled roaming on that STA. + * + * Return: none + */ +void sme_enable_roaming_on_connected_sta(tHalHandle hal); + #endif /* #if !defined( __SME_API_H ) */ diff --git a/core/sme/src/common/sme_api.c b/core/sme/src/common/sme_api.c index de1746279b3c..4113d0d39579 100644 --- a/core/sme/src/common/sme_api.c +++ b/core/sme/src/common/sme_api.c @@ -9201,13 +9201,12 @@ QDF_STATUS sme_stop_roaming(tHalHandle hal, uint8_t session_id, uint8_t reason) } session = CSR_GET_SESSION(mac_ctx, session_id); - if (session->pCurRoamProfile && - !session->pCurRoamProfile->roaming_allowed_on_iface) { - sme_debug("Roaming was never started on session %d", - session_id); + + roam_info = &mac_ctx->roam.neighborRoamInfo[session_id]; + if (!roam_info->b_roam_scan_offload_started) { + sme_debug("Roaming already disabled for session %d", session_id); return QDF_STATUS_SUCCESS; } - roam_info = &mac_ctx->roam.neighborRoamInfo[session_id]; req = qdf_mem_malloc(sizeof(*req)); if (!req) { sme_err("failed to allocated memory"); @@ -19006,3 +19005,31 @@ QDF_STATUS sme_fast_reassoc(tHalHandle hal, tCsrRoamProfile *profile, return status; } +void sme_enable_roaming_on_connected_sta(tHalHandle hal) +{ + uint8_t session_id; + tpAniSirGlobal mac_ctx = PMAC_STRUCT(hal); + QDF_STATUS status; + + session_id = csr_get_roam_enabled_sta_sessionid(mac_ctx); + if (session_id != CSR_SESSION_ID_INVALID) + return; + + session_id = csr_get_connected_infra(mac_ctx); + if (session_id == CSR_SESSION_ID_INVALID) { + sme_debug("No STA in connected state"); + return; + } + + sme_debug("Roaming not enabled on any STA, enable roaming on session %d", + session_id); + status = sme_acquire_global_lock(&mac_ctx->sme); + if (QDF_IS_STATUS_SUCCESS(status)) { + csr_roam_offload_scan(mac_ctx, session_id, + ROAM_SCAN_OFFLOAD_START, + REASON_CTX_INIT); + sme_release_global_lock(&mac_ctx->sme); + } + +} + diff --git a/core/sme/src/csr/csr_api_roam.c b/core/sme/src/csr/csr_api_roam.c index e79c997c6ec8..08aeaca46d75 100644 --- a/core/sme/src/csr/csr_api_roam.c +++ b/core/sme/src/csr/csr_api_roam.c @@ -7976,8 +7976,6 @@ QDF_STATUS csr_roam_copy_profile(tpAniSirGlobal pMac, pDstProfile->sap_dot11mc = pSrcProfile->sap_dot11mc; pDstProfile->supplicant_disabled_roaming = pSrcProfile->supplicant_disabled_roaming; - pDstProfile->roaming_allowed_on_iface = - pSrcProfile->roaming_allowed_on_iface; qdf_mem_copy(&pDstProfile->Keys, &pSrcProfile->Keys, sizeof(pDstProfile->Keys)); #ifdef WLAN_FEATURE_11W @@ -19328,6 +19326,31 @@ static void csr_update_score_params(tpAniSirGlobal mac_ctx, bss_score_params->oce_wan_scoring.score_pcnt15_to_12; } + +uint8_t csr_get_roam_enabled_sta_sessionid( + tpAniSirGlobal mac_ctx) +{ + tCsrRoamSession *session; + tpCsrNeighborRoamControlInfo roam_info; + uint8_t i; + + for (i = 0; i < CSR_ROAM_SESSION_MAX; i++) { + session = CSR_GET_SESSION(mac_ctx, i); + if (!session || !CSR_IS_SESSION_VALID(mac_ctx, i)) + continue; + if (!session->pCurRoamProfile || + session->pCurRoamProfile->csrPersona != QDF_STA_MODE) + continue; + roam_info = &mac_ctx->roam.neighborRoamInfo[i]; + if (roam_info->b_roam_scan_offload_started) { + sme_debug("Roaming enabled on iface, session: %d", i); + return i; + } + } + + return CSR_SESSION_ID_INVALID; +} + /** * csr_roam_offload_scan() - populates roam offload scan request and sends to * WMA @@ -19352,21 +19375,22 @@ csr_roam_offload_scan(tpAniSirGlobal mac_ctx, uint8_t session_id, &mac_ctx->roam.neighborRoamInfo[session_id]; struct roam_ext_params *roam_params_dst; struct roam_ext_params *roam_params_src; - uint8_t i; + uint8_t i, temp_session_id; uint8_t op_channel; - QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_DEBUG, - "RSO Command %d, Session id %d, Reason %d", - command, session_id, reason); + sme_debug("RSO Command %d, Session id %d, Reason %d", command, + session_id, reason); if (NULL == session) { QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_ERROR, "session is null"); return QDF_STATUS_E_FAILURE; } - if ((session->pCurRoamProfile && - session->pCurRoamProfile->roaming_allowed_on_iface == false)) { - sme_debug("Roaming disabled on iface, session: %d", session_id); + temp_session_id = csr_get_roam_enabled_sta_sessionid(mac_ctx); + if ((temp_session_id != CSR_SESSION_ID_INVALID) && + (session_id != temp_session_id)) { + sme_debug("Roam cmd not for session %d on which roaming is enabled", + temp_session_id); return QDF_STATUS_E_FAILURE; } diff --git a/core/sme/src/csr/csr_util.c b/core/sme/src/csr/csr_util.c index 5484298ba638..14ef6a1ff31e 100644 --- a/core/sme/src/csr/csr_util.c +++ b/core/sme/src/csr/csr_util.c @@ -1023,6 +1023,23 @@ bool csr_is_infra_connected(tpAniSirGlobal pMac) return fRc; } +uint8_t csr_get_connected_infra(tpAniSirGlobal mac_ctx) +{ + uint32_t i; + uint8_t connected_session = CSR_SESSION_ID_INVALID; + + for (i = 0; i < CSR_ROAM_SESSION_MAX; i++) { + if (CSR_IS_SESSION_VALID(mac_ctx, i) + && csr_is_conn_state_connected_infra(mac_ctx, i)) { + connected_session = i; + break; + } + } + + return connected_session; +} + + bool csr_is_concurrent_infra_connected(tpAniSirGlobal pMac) { uint32_t i, noOfConnectedInfra = 0; diff --git a/core/wma/src/wma_scan_roam.c b/core/wma/src/wma_scan_roam.c index f275a3163ff7..aa6d51eff41a 100644 --- a/core/wma/src/wma_scan_roam.c +++ b/core/wma/src/wma_scan_roam.c @@ -1934,8 +1934,8 @@ QDF_STATUS wma_process_roaming_config(tp_wma_handle wma_handle, qdf_mem_free(roam_req); return QDF_STATUS_E_PERM; } - WMA_LOGD("%s: RSO Command:%d, reason:%d", - __func__, roam_req->Command, roam_req->reason); + WMA_LOGD("%s: RSO Command:%d, reason:%d session ID %d", __func__, + roam_req->Command, roam_req->reason, roam_req->sessionId); wma_handle->interfaces[roam_req->sessionId].roaming_in_progress = false; switch (roam_req->Command) { case ROAM_SCAN_OFFLOAD_START: |
