summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAgrawal, Ashish <ashishka@codeaurora.org>2016-11-30 16:19:44 +0530
committerGerrit - the friendly Code Review server <code-review@localhost>2017-01-06 20:54:05 -0800
commitde8ede95bd5c8b85b2ba665a004a5b2323147954 (patch)
tree02410b88bcd13255682565eb6e79ab720076e2eb
parentb94151dacea152e9b3df74f1e0db51034f5e1085 (diff)
qcacld-3.0: Update unsafe channel list for sta based on SAP operating band
qcacld-2.0 to qcacld-3.0 propagation If SAP band is 2.4Ghz, driver will allow 5Ghz unsafe channels in station scan list for connection / roaming. And if SAP band is 5Ghz, We will allow 2.4Ghz unsafe channels in station scan list for connection / roaming. Change-Id: Ia204e5cabb6d8b87def90e42d4192afd5878e6fe CRs-Fixed: 1062202
-rw-r--r--core/hdd/src/wlan_hdd_cfg80211.c43
-rw-r--r--core/hdd/src/wlan_hdd_cfg80211.h8
-rw-r--r--core/sme/inc/csr_api.h2
-rw-r--r--core/sme/inc/sme_api.h4
-rw-r--r--core/sme/src/common/sme_api.c7
-rw-r--r--core/sme/src/csr/csr_api_roam.c10
-rw-r--r--core/sme/src/csr/csr_api_scan.c16
7 files changed, 81 insertions, 9 deletions
diff --git a/core/hdd/src/wlan_hdd_cfg80211.c b/core/hdd/src/wlan_hdd_cfg80211.c
index 38d3cc2aba87..bf33072f6e75 100644
--- a/core/hdd/src/wlan_hdd_cfg80211.c
+++ b/core/hdd/src/wlan_hdd_cfg80211.c
@@ -7236,6 +7236,43 @@ static enum sta_roam_policy_dfs_mode wlan_hdd_get_sta_roam_dfs_mode(
}
}
+/*
+ * hdd_get_sap_operating_band: Get current operating channel
+ * for sap.
+ * @hdd_ctx: hdd context
+ *
+ * Return : Corresponding band for SAP operating channel
+ */
+uint8_t hdd_get_sap_operating_band(hdd_context_t *hdd_ctx)
+{
+ hdd_adapter_list_node_t *adapter_node = NULL, *next = NULL;
+ QDF_STATUS status;
+ hdd_adapter_t *adapter;
+ uint8_t operating_channel = 0;
+ uint8_t sap_operating_band = 0;
+ status = hdd_get_front_adapter(hdd_ctx, &adapter_node);
+ while (NULL != adapter_node && QDF_STATUS_SUCCESS == status) {
+ adapter = adapter_node->pAdapter;
+
+ if (!(adapter && (QDF_SAP_MODE == adapter->device_mode))) {
+ status = hdd_get_next_adapter(hdd_ctx, adapter_node,
+ &next);
+ adapter_node = next;
+ continue;
+ }
+ operating_channel = adapter->sessionCtx.ap.operatingChannel;
+ if (IS_24G_CH(operating_channel))
+ sap_operating_band = eCSR_BAND_24;
+ else if (IS_5G_CH(operating_channel))
+ sap_operating_band = eCSR_BAND_5G;
+ else
+ sap_operating_band = eCSR_BAND_ALL;
+ status = hdd_get_next_adapter(hdd_ctx, adapter_node,
+ &next);
+ }
+ return sap_operating_band;
+}
+
static const struct nla_policy
wlan_hdd_set_sta_roam_config_policy[
QCA_WLAN_VENDOR_ATTR_STA_CONNECT_ROAM_POLICY_MAX + 1] = {
@@ -7274,6 +7311,7 @@ __wlan_hdd_cfg80211_sta_roam_policy(struct wiphy *wiphy,
enum dfs_mode mode = DFS_MODE_NONE;
bool skip_unsafe_channels = false;
QDF_STATUS status;
+ uint8_t sap_operating_band;
ENTER_DEV(dev);
@@ -7303,9 +7341,10 @@ __wlan_hdd_cfg80211_sta_roam_policy(struct wiphy *wiphy,
if (tb[QCA_WLAN_VENDOR_ATTR_STA_SKIP_UNSAFE_CHANNEL])
skip_unsafe_channels = nla_get_u8(
tb[QCA_WLAN_VENDOR_ATTR_STA_SKIP_UNSAFE_CHANNEL]);
-
+ sap_operating_band = hdd_get_sap_operating_band(hdd_ctx);
status = sme_update_sta_roam_policy(hdd_ctx->hHal, sta_roam_dfs_mode,
- skip_unsafe_channels, adapter->sessionId);
+ skip_unsafe_channels, adapter->sessionId,
+ sap_operating_band);
if (!QDF_IS_STATUS_SUCCESS(status)) {
hdd_err("sme_update_sta_roam_policy (err=%d)", status);
diff --git a/core/hdd/src/wlan_hdd_cfg80211.h b/core/hdd/src/wlan_hdd_cfg80211.h
index c40ec297b9a7..79c4b563449b 100644
--- a/core/hdd/src/wlan_hdd_cfg80211.h
+++ b/core/hdd/src/wlan_hdd_cfg80211.h
@@ -3507,4 +3507,12 @@ struct cfg80211_bss *wlan_hdd_cfg80211_inform_bss_frame(hdd_adapter_t *pAdapter,
*/
void hdd_lost_link_info_cb(void *context,
struct sir_lost_link_info *lost_link_info);
+/*
+ * hdd_get_sap_operating_band: Get current operating channel
+ * for sap.
+ * @hdd_ctx: hdd context
+ *
+ * Return : Corresponding band for SAP operating channel
+ */
+uint8_t hdd_get_sap_operating_band(hdd_context_t *hdd_ctx);
#endif
diff --git a/core/sme/inc/csr_api.h b/core/sme/inc/csr_api.h
index e03974bf4c55..4a92291d3a23 100644
--- a/core/sme/inc/csr_api.h
+++ b/core/sme/inc/csr_api.h
@@ -1082,10 +1082,12 @@ enum sta_roam_policy_dfs_mode {
* struct csr_sta_roam_policy_params - sta roam policy params for station
* @dfs_mode: tell is DFS channels needs to be skipped while scanning
* @skip_unsafe_channels: tells if unsafe channels needs to be skip in scanning
+ * @sap_operating_band: Opearting band for SAP
*/
struct csr_sta_roam_policy_params {
enum sta_roam_policy_dfs_mode dfs_mode;
bool skip_unsafe_channels;
+ uint8_t sap_operating_band;
};
typedef struct tagCsrConfigParam {
diff --git a/core/sme/inc/sme_api.h b/core/sme/inc/sme_api.h
index e1a06be45c99..48b0653e06d6 100644
--- a/core/sme/inc/sme_api.h
+++ b/core/sme/inc/sme_api.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.
*
@@ -1258,7 +1258,7 @@ QDF_STATUS sme_update_access_policy_vendor_ie(tHalHandle hal,
QDF_STATUS sme_update_sta_roam_policy(tHalHandle hal,
enum sta_roam_policy_dfs_mode dfs_mode,
bool skip_unsafe_channels,
- uint8_t session_id);
+ uint8_t session_id, uint8_t sap_operating_band);
QDF_STATUS sme_enable_disable_chanavoidind_event(tHalHandle hal,
uint8_t set_value);
QDF_STATUS sme_set_default_scan_ie(tHalHandle hal, uint16_t session_id,
diff --git a/core/sme/src/common/sme_api.c b/core/sme/src/common/sme_api.c
index 8c5568e13feb..fa7d07072cc3 100644
--- a/core/sme/src/common/sme_api.c
+++ b/core/sme/src/common/sme_api.c
@@ -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.
*
@@ -16750,6 +16750,7 @@ void sme_get_vdev_type_nss(tHalHandle hal, enum tQDF_ADAPTER_MODE dev_mode,
* @skip_unsafe_channels: Param to tell if driver needs to
* skip unsafe channels or not.
* @param session_id: sme_session_id
+ * @sap_operating_band: Band on which SAP is operating
*
* sme_update_sta_roam_policy update sta rome policies to csr
* this function will call csrUpdateChannelList as well
@@ -16760,7 +16761,7 @@ void sme_get_vdev_type_nss(tHalHandle hal, enum tQDF_ADAPTER_MODE dev_mode,
QDF_STATUS sme_update_sta_roam_policy(tHalHandle hal_handle,
enum sta_roam_policy_dfs_mode dfs_mode,
bool skip_unsafe_channels,
- uint8_t session_id)
+ uint8_t session_id, uint8_t sap_operating_band)
{
tpAniSirGlobal mac_ctx = PMAC_STRUCT(hal_handle);
QDF_STATUS status = QDF_STATUS_SUCCESS;
@@ -16778,6 +16779,8 @@ QDF_STATUS sme_update_sta_roam_policy(tHalHandle hal_handle,
dfs_mode;
sme_config.csrConfig.sta_roam_policy_params.skip_unsafe_channels =
skip_unsafe_channels;
+ sme_config.csrConfig.sta_roam_policy_params.sap_operating_band =
+ sap_operating_band;
sme_update_config(hal_handle, &sme_config);
diff --git a/core/sme/src/csr/csr_api_roam.c b/core/sme/src/csr/csr_api_roam.c
index f5a0ac8e75bd..ba86a34429cd 100644
--- a/core/sme/src/csr/csr_api_roam.c
+++ b/core/sme/src/csr/csr_api_roam.c
@@ -698,6 +698,8 @@ QDF_STATUS csr_update_channel_list(tpAniSirGlobal pMac)
}
for (i = 0; i < pScan->base_channels.numChannels; i++) {
+ struct csr_sta_roam_policy_params *roam_policy =
+ &pMac->roam.configParam.sta_roam_policy;
/* Scan is not performed on DSRC channels*/
if (pScan->base_channels.channelList[i] >= CDS_MIN_11P_CHANNEL)
continue;
@@ -727,7 +729,13 @@ QDF_STATUS csr_update_channel_list(tpAniSirGlobal pMac)
break;
}
}
- if (is_unsafe_chan) {
+ if ((is_unsafe_chan) &&
+ ((CDS_IS_CHANNEL_24GHZ(channel) &&
+ roam_policy->sap_operating_band ==
+ eCSR_BAND_24) ||
+ (CDS_IS_CHANNEL_5GHZ(channel) &&
+ roam_policy->sap_operating_band ==
+ eCSR_BAND_5G))) {
QDF_TRACE(QDF_MODULE_ID_SME,
QDF_TRACE_LEVEL_INFO,
FL("ignoring unsafe channel %d"),
diff --git a/core/sme/src/csr/csr_api_scan.c b/core/sme/src/csr/csr_api_scan.c
index ea25d3148872..4695a56f667f 100644
--- a/core/sme/src/csr/csr_api_scan.c
+++ b/core/sme/src/csr/csr_api_scan.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011-2016 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2011-2017 The Linux Foundation. All rights reserved.
*
* Previously licensed under the ISC license by Qualcomm Atheros, Inc.
*
@@ -5388,7 +5388,19 @@ static void csr_scan_copy_request_valid_channels_only(tpAniSirGlobal mac_ctx,
break;
}
}
- if (is_unsafe_chan) {
+ if (is_unsafe_chan &&
+ ((CSR_IS_CHANNEL_24GHZ(
+ src_req->ChannelInfo.
+ ChannelList[index]) &&
+ mac_ctx->roam.configParam.
+ sta_roam_policy.sap_operating_band ==
+ eCSR_BAND_24) ||
+ (CDS_IS_CHANNEL_5GHZ(
+ src_req->ChannelInfo.
+ ChannelList[index]) &&
+ mac_ctx->roam.configParam.
+ sta_roam_policy.sap_operating_band ==
+ eCSR_BAND_5G))) {
QDF_TRACE(QDF_MODULE_ID_SME,
QDF_TRACE_LEVEL_INFO,
FL("ignoring unsafe channel %d"),