summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNitesh Shah <niteshs@codeaurora.org>2016-10-13 18:53:25 +0530
committerqcabuildsw <qcabuildsw@localhost>2016-10-18 12:40:25 -0700
commit044fd675f531d68b33be03efb380f99cefd11a63 (patch)
tree353d84ed13d7c4e1031ac17446b7d7439ad6802d
parent11d7cb6b8be1d5079b56a88426f1e4940a165114 (diff)
qcacld-3.0: Set SMM if all new/existing conns are in same band
When the device is in DBS mode, and STA session gets disconnected, then the dbs_opportunistic_timer is started to wait for 10s and then sets back to SMM (Single MAC mode) after timeout if DBS mode is not required. The enhancement is to check the if the device is in DBS mode and the STA session disconnects and new STA session starts in the band in which existing connection are there, then stop the dbs_opportunistic_timer and set hw_mode to SMM. Change-Id: I16bfbb5135e36f2ab87bd09244d5eb6932846c72 CRs-Fixed: 1077488
-rw-r--r--core/cds/inc/cds_concurrency.h1
-rw-r--r--core/cds/src/cds_concurrency.c39
-rw-r--r--core/hdd/src/wlan_hdd_cfg80211.c17
3 files changed, 57 insertions, 0 deletions
diff --git a/core/cds/inc/cds_concurrency.h b/core/cds/inc/cds_concurrency.h
index 951abffa6b0b..2378e8aa4f51 100644
--- a/core/cds/inc/cds_concurrency.h
+++ b/core/cds/inc/cds_concurrency.h
@@ -852,6 +852,7 @@ QDF_STATUS cds_get_valid_chan_weights(struct sir_pcl_chan_weights *weight);
QDF_STATUS cds_set_hw_mode_on_channel_switch(uint8_t session_id);
void cds_set_do_hw_mode_change_flag(bool flag);
bool cds_is_hw_mode_change_after_vdev_up(void);
+void cds_checkn_update_hw_mode_single_mac_mode(uint8_t channel);
void cds_dump_connection_status_info(void);
uint32_t cds_mode_specific_connection_count(enum cds_con_mode mode,
uint32_t *list);
diff --git a/core/cds/src/cds_concurrency.c b/core/cds/src/cds_concurrency.c
index b6f8364b2143..e5519c4727c2 100644
--- a/core/cds/src/cds_concurrency.c
+++ b/core/cds/src/cds_concurrency.c
@@ -9117,6 +9117,45 @@ uint8_t cds_get_mcc_operating_channel(uint8_t session_id)
}
/**
+ * cds_checkn_update_hw_mode_single_mac_mode() - Set hw_mode to SMM
+ * if required
+ * @channel: channel number for the new STA connection
+ *
+ * After the STA disconnection, if the hw_mode is in DBS and the new STA
+ * connection is coming in the band in which existing connections are
+ * present, then this function stops the dbs opportunistic timer and sets
+ * the hw_mode to Single MAC mode (SMM).
+ *
+ * Return: None
+ */
+void cds_checkn_update_hw_mode_single_mac_mode(uint8_t channel)
+{
+ uint8_t i;
+ cds_context_type *cds_ctx;
+
+ cds_ctx = cds_get_context(QDF_MODULE_ID_QDF);
+ if (!cds_ctx) {
+ cds_err("Invalid CDS Context");
+ return;
+ }
+
+ for (i = 0; i < MAX_NUMBER_OF_CONC_CONNECTIONS; i++) {
+ if (conc_connection_list[i].in_use)
+ if (!CDS_IS_SAME_BAND_CHANNELS(channel,
+ conc_connection_list[i].chan)) {
+ cds_info("DBS required");
+ return;
+ }
+ }
+
+ if (QDF_TIMER_STATE_RUNNING ==
+ cds_ctx->dbs_opportunistic_timer.state)
+ qdf_mc_timer_stop(&cds_ctx->dbs_opportunistic_timer);
+
+ cds_dbs_opportunistic_timer_handler((void *)cds_ctx);
+}
+
+/**
* cds_set_do_hw_mode_change_flag() - Set flag to indicate hw mode change
* @flag: Indicate if hw mode change is required or not
*
diff --git a/core/hdd/src/wlan_hdd_cfg80211.c b/core/hdd/src/wlan_hdd_cfg80211.c
index 36a8a46a71f5..926d4f077678 100644
--- a/core/hdd/src/wlan_hdd_cfg80211.c
+++ b/core/hdd/src/wlan_hdd_cfg80211.c
@@ -11166,6 +11166,8 @@ static int wlan_hdd_cfg80211_connect_start(hdd_adapter_t *pAdapter,
tCsrRoamProfile *pRoamProfile;
eCsrAuthType RSNAuthType;
tSmeConfigParams *sme_config;
+ uint8_t channel = 0;
+ struct sir_hw_mode_params hw_mode;
ENTER();
@@ -11458,6 +11460,21 @@ static int wlan_hdd_cfg80211_connect_start(hdd_adapter_t *pAdapter,
pRoamProfile->ChannelInfo.ChannelList = NULL;
pRoamProfile->ChannelInfo.numOfChannels = 0;
+ if (!QDF_IS_STATUS_SUCCESS(
+ wma_get_current_hw_mode(&hw_mode))) {
+ hdd_err("wma_get_current_hw_mode failed");
+ return status;
+ }
+
+ if ((QDF_STA_MODE == pAdapter->device_mode)
+ && hw_mode.dbs_cap) {
+ cds_get_channel_from_scan_result(pAdapter,
+ pRoamProfile, &channel);
+ if (channel)
+ cds_checkn_update_hw_mode_single_mac_mode
+ (channel);
+ }
+
} else {
hdd_err("No valid Roam profile");
return -EINVAL;