summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArchana Ramachandran <archanar@codeaurora.org>2016-04-25 14:29:25 -0700
committerNandini Suresh <snandini@codeaurora.org>2016-06-29 18:41:25 -0700
commit5041b2579e04421f14be04424f85436a217b6edf (patch)
tree7f06c5eff3360027802461e5e2080d9513be8f15
parent2ad7de2b2d76c191f7bb02dd24fc8677c81b0461 (diff)
qcacld-3.0: Support NSS configuration for TDLS from user space
qcacld-2.0 to qcacld-3.0 propagation TDLS NSS can be changed dynamically by the user, if that happens the newer NSS value needs to be recorded in the MAC context and should be used to form TDLS management frames. Update driver to keep the user configured NSS value in the MAC context and uses the NSS value in the tdls protocol engine to construct management frames. Change-Id: I4098e3c5e3a03c4de6ae40c837a5616613623979 CRs-Fixed: 968106
-rw-r--r--core/hdd/src/wlan_hdd_ioctl.c13
-rw-r--r--core/mac/inc/ani_global.h1
-rw-r--r--core/mac/src/pe/lim/lim_process_tdls.c4
-rw-r--r--core/sme/inc/sme_api.h1
-rw-r--r--core/sme/src/common/sme_api.c14
5 files changed, 31 insertions, 2 deletions
diff --git a/core/hdd/src/wlan_hdd_ioctl.c b/core/hdd/src/wlan_hdd_ioctl.c
index 0fdd147dc38b..1f0fcc54c67f 100644
--- a/core/hdd/src/wlan_hdd_ioctl.c
+++ b/core/hdd/src/wlan_hdd_ioctl.c
@@ -6665,10 +6665,19 @@ static int drv_cmd_set_antenna_mode(hdd_adapter_t *adapter,
goto exit;
}
- hdd_info("Successfully switched to mode: %d x %d", mode, mode);
- ret = 0;
hdd_ctx->current_antenna_mode = mode;
+ /* Update the user requested nss in the mac context.
+ * This will be used in tdls protocol engine to form tdls
+ * Management frames.
+ */
+ sme_update_user_configured_nss(
+ hdd_ctx->hHal,
+ hdd_ctx->current_antenna_mode);
+ hdd_info("Successfully switched to mode: %d x %d",
+ hdd_ctx->current_antenna_mode,
+ hdd_ctx->current_antenna_mode);
+ ret = 0;
exit:
hdd_info("Set antenna status: %d current mode: %d",
ret, hdd_ctx->current_antenna_mode);
diff --git a/core/mac/inc/ani_global.h b/core/mac/inc/ani_global.h
index ec52065e6b7d..71d374198679 100644
--- a/core/mac/inc/ani_global.h
+++ b/core/mac/inc/ani_global.h
@@ -1084,6 +1084,7 @@ typedef struct sAniSirGlobal {
bool first_scan_done;
int8_t first_scan_bucket_threshold;
enum auth_tx_ack_status auth_ack_status;
+ uint8_t user_configured_nss;
} tAniSirGlobal;
typedef enum {
diff --git a/core/mac/src/pe/lim/lim_process_tdls.c b/core/mac/src/pe/lim/lim_process_tdls.c
index 95651285d9f1..30c679faac14 100644
--- a/core/mac/src/pe/lim/lim_process_tdls.c
+++ b/core/mac/src/pe/lim/lim_process_tdls.c
@@ -548,6 +548,7 @@ static void populate_dot11f_tdls_ht_vht_cap(tpAniSirGlobal pMac,
else
nss = pMac->vdev_type_nss_2g.tdls;
+ nss = QDF_MIN(nss, pMac->user_configured_nss);
if (IS_DOT11_MODE_HT(selfDot11Mode)) {
/* Include HT Capability IE */
populate_dot11f_ht_caps(pMac, NULL, htCap);
@@ -2266,6 +2267,9 @@ lim_tdls_populate_matching_rate_set(tpAniSirGlobal mac_ctx, tpDphHashNode stads,
nss = mac_ctx->vdev_type_nss_5g.tdls;
else
nss = mac_ctx->vdev_type_nss_2g.tdls;
+
+ nss = QDF_MIN(nss, mac_ctx->user_configured_nss);
+
/* compute the matching MCS rate set, if peer is 11n capable and self mode is 11n */
#ifdef FEATURE_WLAN_TDLS
if (stads->mlmStaContext.htCapability)
diff --git a/core/sme/inc/sme_api.h b/core/sme/inc/sme_api.h
index 11557c7b237f..8656fe540dee 100644
--- a/core/sme/inc/sme_api.h
+++ b/core/sme/inc/sme_api.h
@@ -978,6 +978,7 @@ QDF_STATUS sme_register_mgmt_frame_ind_callback(tHalHandle hal,
sir_mgmt_frame_ind_callback callback);
QDF_STATUS sme_update_nss(tHalHandle h_hal, uint8_t nss);
+void sme_update_user_configured_nss(tHalHandle hal, uint8_t nss);
bool sme_is_any_session_in_connected_state(tHalHandle h_hal);
diff --git a/core/sme/src/common/sme_api.c b/core/sme/src/common/sme_api.c
index e7c29daae95f..4495067bd178 100644
--- a/core/sme/src/common/sme_api.c
+++ b/core/sme/src/common/sme_api.c
@@ -14460,6 +14460,20 @@ QDF_STATUS sme_update_nss(tHalHandle h_hal, uint8_t nss)
}
/**
+ * sme_update_user_configured_nss() - sets the nss based on user request
+ * @hal: Pointer to HAL
+ * @nss: number of streams
+ *
+ * Return: None
+ */
+void sme_update_user_configured_nss(tHalHandle hal, uint8_t nss)
+{
+ tpAniSirGlobal mac_ctx = PMAC_STRUCT(hal);
+
+ mac_ctx->user_configured_nss = nss;
+}
+
+/**
* sme_set_rssi_threshold_breached_cb() - set rssi threshold breached callback
* @hal: global hal handle
* @cb: callback function pointer