summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinux Build Service Account <lnxbuild@localhost>2014-11-14 14:23:42 -0800
committerGerrit - the friendly Code Review server <code-review@localhost>2014-11-14 14:23:42 -0800
commit4594e538cd1ef97193f449a6c3400285b17f2cdf (patch)
tree1bf0056120344fb1b3bb54219398c29371b5a9be
parentb10c41f6ca90e72b7164d61aba4a7723cf36ab86 (diff)
parent40781fe517451d31cb84355f4a3434e8dc8ac11a (diff)
Merge "Release 1.0.0.235 QCACLD WLAN Driver"
-rw-r--r--CORE/HDD/inc/wlan_hdd_cfg.h17
-rw-r--r--CORE/HDD/inc/wlan_hdd_main.h15
-rw-r--r--CORE/HDD/src/wlan_hdd_assoc.c101
-rw-r--r--CORE/HDD/src/wlan_hdd_cfg.c18
-rw-r--r--CORE/HDD/src/wlan_hdd_cfg80211.c89
-rwxr-xr-xCORE/HDD/src/wlan_hdd_main.c193
-rw-r--r--CORE/MAC/inc/qwlan_version.h4
-rw-r--r--CORE/SME/inc/csrApi.h2
-rw-r--r--CORE/SME/inc/csrInternal.h2
-rw-r--r--CORE/SME/inc/sme_Api.h4
-rw-r--r--CORE/SME/src/csr/csrApiRoam.c89
-rw-r--r--CORE/SME/src/csr/csrApiScan.c41
-rw-r--r--CORE/SME/src/csr/csrInsideApi.h3
-rw-r--r--CORE/SME/src/csr/csrUtil.c214
-rw-r--r--CORE/SME/src/sme_common/sme_Api.c107
-rwxr-xr-xfirmware_bin/WCNSS_qcom_cfg.ini26
16 files changed, 808 insertions, 117 deletions
diff --git a/CORE/HDD/inc/wlan_hdd_cfg.h b/CORE/HDD/inc/wlan_hdd_cfg.h
index 4206549eb7f8..ed69e208afad 100644
--- a/CORE/HDD/inc/wlan_hdd_cfg.h
+++ b/CORE/HDD/inc/wlan_hdd_cfg.h
@@ -2593,6 +2593,21 @@ This feature requires the dependent cfg.ini "gRoamPrefer5GHz" set to 1 */
#define CFG_ENABLE_MAC_ADDR_SPOOFING_MAX (1)
#define CFG_ENABLE_MAC_ADDR_SPOOFING_DEFAULT (1)
+/*
+ * Custom concurrency rule1:
+ * If SAP comes up first and STA comes up later then SAP
+ * needs to follow STA's channel.
+ */
+#define CFG_ENABLE_CUSTOM_CONC_RULE1_NAME "gEnableCustomConcRule1"
+#define CFG_ENABLE_CUSTOM_CONC_RULE1_NAME_MIN ( 0 )
+#define CFG_ENABLE_CUSTOM_CONC_RULE1_NAME_MAX ( 1 )
+#define CFG_ENABLE_CUSTOM_CONC_RULE1_NAME_DEFAULT ( 0 )
+
+#define CFG_ENABLE_STA_CONNECTION_IN_5GHZ "gEnableStaConnectionIn5Ghz"
+#define CFG_ENABLE_STA_CONNECTION_IN_5GHZ_MIN ( 0 )
+#define CFG_ENABLE_STA_CONNECTION_IN_5GHZ_MAX ( 1 )
+#define CFG_ENABLE_STA_CONNECTION_IN_5GHZ_DEFAULT ( 1 )
+
/*---------------------------------------------------------------------------
Type declarations
-------------------------------------------------------------------------*/
@@ -3154,6 +3169,8 @@ typedef struct
#ifdef IPA_UC_STA_OFFLOAD
bool ipa_uc_sta_offload;
#endif
+ uint8_t conc_custom_rule1;
+ uint8_t is_sta_connection_in_5gz_enabled;
} hdd_config_t;
#ifdef WLAN_FEATURE_MBSSID
diff --git a/CORE/HDD/inc/wlan_hdd_main.h b/CORE/HDD/inc/wlan_hdd_main.h
index 954edaaa818d..6318fe48b617 100644
--- a/CORE/HDD/inc/wlan_hdd_main.h
+++ b/CORE/HDD/inc/wlan_hdd_main.h
@@ -1478,6 +1478,10 @@ struct hdd_context_s
adf_os_work_t sta_ap_intf_check_work;
#endif
+ struct work_struct sap_start_work;
+ bool is_sap_restart_required;
+ spinlock_t sap_update_info_lock;
+
v_U8_t dev_dfs_cac_status;
v_BOOL_t btCoexModeSet;
@@ -1722,4 +1726,15 @@ void wlan_hdd_disable_roaming(hdd_adapter_t *pAdapter);
void wlan_hdd_enable_roaming(hdd_adapter_t *pAdapter);
#endif
int hdd_set_miracast_mode(hdd_adapter_t *pAdapter, tANI_U8 *command);
+VOS_STATUS wlan_hdd_check_con_channel_sap_and_sta(hdd_adapter_t *sta_adapter,
+ hdd_adapter_t *ap_adapter,
+ tCsrRoamProfile *roam_profile,
+ bool *concurrent_chnl_same);
+#ifdef WLAN_FEATURE_MBSSID
+void wlan_hdd_stop_sap(hdd_adapter_t *ap_adapter);
+void wlan_hdd_start_sap(hdd_adapter_t *ap_adapter);
+#else
+static inline void wlan_hdd_stop_sap(hdd_adapter_t *ap_adapter) {}
+static inline void wlan_hdd_start_sap(hdd_adapter_t *ap_adapter) {}
+#endif
#endif // end #if !defined( WLAN_HDD_MAIN_H )
diff --git a/CORE/HDD/src/wlan_hdd_assoc.c b/CORE/HDD/src/wlan_hdd_assoc.c
index a6dfa88b6b2d..56de7a08d571 100644
--- a/CORE/HDD/src/wlan_hdd_assoc.c
+++ b/CORE/HDD/src/wlan_hdd_assoc.c
@@ -69,6 +69,8 @@
#ifdef IPA_OFFLOAD
#include <wlan_hdd_ipa.h>
#endif
+#include <vos_sched.h>
+
v_BOOL_t mibIsDot11DesiredBssTypeInfrastructure( hdd_adapter_t *pAdapter );
struct ether_addr
@@ -1361,6 +1363,44 @@ void hdd_PerformRoamSetKeyComplete(hdd_adapter_t *pAdapter)
pHddStaCtx->roam_info.deferKeyComplete = FALSE;
}
+/**
+ * hdd_sap_restart_handle() - to handle restarting of SAP
+ * @work: name of the work
+ *
+ * Purpose of this function is to trigger sap start. this function
+ * will be called from workqueue.
+ *
+ * Return: void.
+ */
+static void hdd_sap_restart_handle(struct work_struct *work)
+{
+ hdd_adapter_t *sap_adapter;
+ hdd_context_t *hdd_ctx = container_of(work,
+ hdd_context_t,
+ sap_start_work);
+ vos_ssr_protect(__func__);
+ if (0 != wlan_hdd_validate_context(hdd_ctx)) {
+ VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR,
+ "%s: HDD context is not valid", __func__);
+ vos_ssr_unprotect(__func__);
+ return;
+ }
+ sap_adapter = hdd_get_adapter(hdd_ctx,
+ WLAN_HDD_SOFTAP);
+ if (sap_adapter == NULL) {
+ VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR,
+ FL("sap_adapter is NULL"));
+ vos_ssr_unprotect(__func__);
+ return;
+ }
+ wlan_hdd_start_sap(sap_adapter);
+
+ spin_lock(&hdd_ctx->sap_update_info_lock);
+ hdd_ctx->is_sap_restart_required = false;
+ spin_unlock(&hdd_ctx->sap_update_info_lock);
+ vos_ssr_unprotect(__func__);
+}
+
static eHalStatus hdd_AssociationCompletionHandler( hdd_adapter_t *pAdapter, tCsrRoamInfo *pRoamInfo,
tANI_U32 roamId, eRoamCmdStatus roamStatus,
eCsrRoamResult roamResult )
@@ -1379,6 +1419,9 @@ static eHalStatus hdd_AssociationCompletionHandler( hdd_adapter_t *pAdapter, tCs
#endif
v_BOOL_t hddDisconInProgress = FALSE;
unsigned long rc;
+ hdd_adapter_t *sap_adapter;
+ hdd_ap_ctx_t *hdd_ap_ctx;
+ uint8_t default_sap_channel = 6;
#ifdef WLAN_FEATURE_ROAM_OFFLOAD
if (pRoamInfo && pRoamInfo->roamSynchInProgress) {
/* change logging before release */
@@ -1481,8 +1524,9 @@ static eHalStatus hdd_AssociationCompletionHandler( hdd_adapter_t *pAdapter, tCs
#endif
#ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH
- if (pHddCtx->cfg_ini->WlanMccToSccSwitchMode
- != VOS_MCC_TO_SCC_SWITCH_DISABLE
+ if ((pHddCtx->cfg_ini->WlanMccToSccSwitchMode
+ != VOS_MCC_TO_SCC_SWITCH_DISABLE) &&
+ (0 == pHddCtx->cfg_ini->conc_custom_rule1)
#ifdef FEATURE_WLAN_STA_AP_MODE_DFS_DISABLE
&& !VOS_IS_DFS_CH(pHddStaCtx->conn_info.operationChannel)
#endif
@@ -1899,6 +1943,59 @@ static eHalStatus hdd_AssociationCompletionHandler( hdd_adapter_t *pAdapter, tCs
}
+ if (pHddCtx->cfg_ini->conc_custom_rule1 &&
+ (true == pHddCtx->is_sap_restart_required)) {
+ sap_adapter = hdd_get_adapter(pHddCtx, WLAN_HDD_SOFTAP);
+ if (sap_adapter == NULL) {
+ VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR,
+ FL("sap_adapter is NULL"));
+ return eHAL_STATUS_FAILURE;
+ }
+
+ if (test_bit(SOFTAP_BSS_STARTED, &sap_adapter->event_flags)) {
+ VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR,
+ FL("Oops SAP is already in started state"));
+ return eHAL_STATUS_FAILURE;
+ }
+
+ hdd_ap_ctx = WLAN_HDD_GET_AP_CTX_PTR(sap_adapter);
+ if ((eCSR_ROAM_RESULT_ASSOCIATED == roamResult) &&
+ pHddStaCtx->conn_info.operationChannel < SIR_11A_CHANNEL_BEGIN) {
+ VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR,
+ FL("Starting SAP on channel [%d] after STA assoc complete"),
+ pHddStaCtx->conn_info.operationChannel);
+ hdd_ap_ctx->sapConfig.channel =
+ pHddStaCtx->conn_info.operationChannel;
+ } else {
+ /* start on default SAP channel */
+ hdd_ap_ctx->sapConfig.channel =
+ default_sap_channel;
+ VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR,
+ FL("Starting SAP on channel [%d] after STA assoc failed"),
+ default_sap_channel);
+ }
+ sme_SelectCBMode(WLAN_HDD_GET_HAL_CTX(sap_adapter),
+ sapConvertSapPhyModeToCsrPhyMode(hdd_ap_ctx->sapConfig.SapHw_mode),
+ hdd_ap_ctx->sapConfig.channel,
+ pHddCtx->cfg_ini->vhtChannelWidth);
+ /*
+ * Create a workqueue and let the workqueue handle the restarting
+ * sap task. if we directly call sap restart function without
+ * creating workqueue then our main thread might go to sleep which
+ * is not acceptable.
+ */
+#ifdef CONFIG_CNSS
+ cnss_init_work(&pHddCtx->sap_start_work,
+ hdd_sap_restart_handle);
+#else
+ INIT_WORK(&pHddCtx->sap_start_work,
+ hdd_sap_restart_handle);
+#endif
+ schedule_work(&pHddCtx->sap_start_work);
+
+
+ }
+
#ifdef FEATURE_WLAN_FORCE_SAP_SCC
if (eCSR_ROAM_RESULT_ASSOCIATED == roamResult &&
pHddCtx->cfg_ini->SapSccChanAvoidance) {
diff --git a/CORE/HDD/src/wlan_hdd_cfg.c b/CORE/HDD/src/wlan_hdd_cfg.c
index 7187440ca078..4914f81ee59a 100644
--- a/CORE/HDD/src/wlan_hdd_cfg.c
+++ b/CORE/HDD/src/wlan_hdd_cfg.c
@@ -3398,6 +3398,20 @@ REG_TABLE_ENTRY g_registry_table[] =
CFG_IPA_UC_STA_OFFLOAD_MIN,
CFG_IPA_UC_STA_OFFLOAD_MAX ),
#endif
+
+ REG_VARIABLE( CFG_ENABLE_CUSTOM_CONC_RULE1_NAME, WLAN_PARAM_Integer,
+ hdd_config_t, conc_custom_rule1,
+ VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK,
+ CFG_ENABLE_CUSTOM_CONC_RULE1_NAME_DEFAULT,
+ CFG_ENABLE_CUSTOM_CONC_RULE1_NAME_MIN,
+ CFG_ENABLE_CUSTOM_CONC_RULE1_NAME_MAX),
+
+ REG_VARIABLE( CFG_ENABLE_STA_CONNECTION_IN_5GHZ, WLAN_PARAM_Integer,
+ hdd_config_t, is_sta_connection_in_5gz_enabled,
+ VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK,
+ CFG_ENABLE_STA_CONNECTION_IN_5GHZ_DEFAULT,
+ CFG_ENABLE_STA_CONNECTION_IN_5GHZ_MIN,
+ CFG_ENABLE_STA_CONNECTION_IN_5GHZ_MAX),
};
#ifdef WLAN_FEATURE_MBSSID
@@ -5746,6 +5760,10 @@ VOS_STATUS hdd_set_sme_config( hdd_context_t *pHddCtx )
smeConfig->csrConfig.isRoamOffloadEnabled =
pHddCtx->cfg_ini->isRoamOffloadEnabled;
#endif
+ smeConfig->csrConfig.conc_custom_rule1 =
+ pHddCtx->cfg_ini->conc_custom_rule1;
+ smeConfig->csrConfig.is_sta_connection_in_5gz_enabled =
+ pHddCtx->cfg_ini->is_sta_connection_in_5gz_enabled;
halStatus = sme_UpdateConfig( pHddCtx->hHal, smeConfig);
if ( !HAL_STATUS_SUCCESS( halStatus ) )
diff --git a/CORE/HDD/src/wlan_hdd_cfg80211.c b/CORE/HDD/src/wlan_hdd_cfg80211.c
index 11e9d51fdc4b..b16287fa0603 100644
--- a/CORE/HDD/src/wlan_hdd_cfg80211.c
+++ b/CORE/HDD/src/wlan_hdd_cfg80211.c
@@ -538,6 +538,24 @@ wlan_hdd_sta_p2p_iface_limit[] = {
},
};
+/* STA + AP + P2PGO combination */
+static const struct ieee80211_iface_limit
+wlan_hdd_sta_ap_p2pgo_iface_limit[] = {
+ /* Support for AP+P2PGO interfaces */
+ {
+ .max = 2,
+ .types = BIT(NL80211_IFTYPE_STATION)
+ },
+ {
+ .max = 1,
+ .types = BIT(NL80211_IFTYPE_P2P_GO)
+ },
+ {
+ .max = 1,
+ .types = BIT(NL80211_IFTYPE_AP)
+ }
+};
+
static struct ieee80211_iface_combination
wlan_hdd_iface_combination[] = {
/* STA */
@@ -587,6 +605,18 @@ wlan_hdd_iface_combination[] = {
.n_limits = ARRAY_SIZE(wlan_hdd_sta_p2p_iface_limit),
.beacon_int_infra_match = true,
},
+ /* STA + P2P GO + SAP */
+ {
+ .limits = wlan_hdd_sta_ap_p2pgo_iface_limit,
+ /* we can allow 3 channels for three different persona
+ * but due to firmware limitation, allow max 2 concurrent channels.
+ */
+ .num_different_channels = 2,
+ /* one interface reserved for P2PDEV dedicated usage */
+ .max_interfaces = 4,
+ .n_limits = ARRAY_SIZE(wlan_hdd_sta_ap_p2pgo_iface_limit),
+ .beacon_int_infra_match = true,
+ },
};
#endif //(LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0))
@@ -6225,6 +6255,15 @@ static int wlan_hdd_cfg80211_start_bss(hdd_adapter_t *pHostapdAdapter,
pConfig->num_accept_mac = 0;
pConfig->num_deny_mac = 0;
#ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH
+ /*
+ * We don't want P2PGO to follow STA's channel
+ * so lets limit the logic for SAP only.
+ * Later if we decide to make p2pgo follow STA's
+ * channel then remove this check.
+ */
+ if ((0 == pHddCtx->cfg_ini->conc_custom_rule1) ||
+ (pHddCtx->cfg_ini->conc_custom_rule1 &&
+ WLAN_HDD_SOFTAP == pHostapdAdapter->device_mode))
pConfig->cc_switch_mode =
(WLAN_HDD_GET_CTX(pHostapdAdapter))->cfg_ini->WlanMccToSccSwitchMode;
#endif
@@ -6773,6 +6812,20 @@ static int wlan_hdd_cfg80211_stop_ap (struct wiphy *wiphy,
status = hdd_get_next_adapter(pHddCtx, pAdapterNode, &pNext);
pAdapterNode = pNext;
}
+ /*
+ * When ever stop ap adapter gets called, we need to check
+ * whether any restart AP work is pending. If any restart is pending
+ * then lets finish it and go ahead from there.
+ */
+ if (pHddCtx->cfg_ini->conc_custom_rule1 &&
+ (WLAN_HDD_SOFTAP == pAdapter->device_mode)) {
+ vos_flush_work(&pHddCtx->sap_start_work);
+ VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_WARN,
+ FL("Canceled the pending restart work"));
+ spin_lock(&pHddCtx->sap_update_info_lock);
+ pHddCtx->is_sap_restart_required = false;
+ spin_unlock(&pHddCtx->sap_update_info_lock);
+ }
hdd_hostapd_stop(dev);
@@ -9869,6 +9922,8 @@ int wlan_hdd_cfg80211_connect_start( hdd_adapter_t *pAdapter,
v_U32_t roamId;
tCsrRoamProfile *pRoamProfile;
eCsrAuthType RSNAuthType;
+ hdd_adapter_t *ap_adapter = NULL;
+ bool are_cc_channels_same = 0;
ENTER();
@@ -10050,7 +10105,39 @@ int wlan_hdd_cfg80211_connect_start( hdd_adapter_t *pAdapter,
pRoamProfile->pAddIEScan = &pAdapter->scan_info.scanAddIE.addIEdata[0];
pRoamProfile->nAddIEScanLength = pAdapter->scan_info.scanAddIE.length;
}
-
+ if (pHddCtx->cfg_ini->conc_custom_rule1 &&
+ (WLAN_HDD_INFRA_STATION == pAdapter->device_mode)) {
+ ap_adapter = hdd_get_adapter(pHddCtx, WLAN_HDD_SOFTAP);
+
+ if ((ap_adapter != NULL) &&
+ test_bit(SOFTAP_BSS_STARTED, &ap_adapter->event_flags)) {
+ status =
+ wlan_hdd_check_con_channel_sap_and_sta(pAdapter, ap_adapter,
+ pRoamProfile,
+ &are_cc_channels_same);
+ /*
+ * are_cc_channels_same will be false incase if SAP and STA
+ * channel is different or STA channel is zero.
+ * incase if STA channel is zero then lets stop the AP and
+ * restart flag set, so later whenever STA channel is defined
+ * we can restart our SAP in that channel.
+ */
+ if (FALSE == are_cc_channels_same) {
+ VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO_HIGH,
+ FL("Stop AP due to mismatch with STA channel"));
+ wlan_hdd_stop_sap(ap_adapter);
+ spin_lock(&pHddCtx->sap_update_info_lock);
+ pHddCtx->is_sap_restart_required = true;
+ spin_unlock(&pHddCtx->sap_update_info_lock);
+ } else {
+ VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO_HIGH,
+ FL("channels are same"));
+ }
+ } else {
+ VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO_LOW,
+ FL("extracted ap adapter is null"));
+ }
+ }
status = sme_RoamConnect( WLAN_HDD_GET_HAL_CTX(pAdapter),
pAdapter->sessionId, pRoamProfile, &roamId);
diff --git a/CORE/HDD/src/wlan_hdd_main.c b/CORE/HDD/src/wlan_hdd_main.c
index 92095c15d689..7cbd5bb8d19d 100755
--- a/CORE/HDD/src/wlan_hdd_main.c
+++ b/CORE/HDD/src/wlan_hdd_main.c
@@ -7601,7 +7601,7 @@ static int hdd_parse_reassoc_command_v1_data(const tANI_U8 *pValue,
v = kstrtos32(tempBuf, 10, &tempInt);
if ((v < 0) ||
- (tempInt <= 0) ||
+ (tempInt < 0) ||
(tempInt > WNI_CFG_CURRENT_CHANNEL_STAMAX))
{
return -EINVAL;
@@ -9622,6 +9622,19 @@ VOS_STATUS hdd_stop_adapter( hdd_context_t *pHddCtx, hdd_adapter_t *pAdapter,
case WLAN_HDD_SOFTAP:
case WLAN_HDD_P2P_GO:
+ if (pHddCtx->cfg_ini->conc_custom_rule1 &&
+ (WLAN_HDD_SOFTAP == pAdapter->device_mode)) {
+ /*
+ * Before stopping the sap adapter, lets make sure there is
+ * no sap restart work pending.
+ */
+ vos_flush_work(&pHddCtx->sap_start_work);
+ VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO_HIGH,
+ FL("Canceled the pending SAP restart work"));
+ spin_lock(&pHddCtx->sap_update_info_lock);
+ pHddCtx->is_sap_restart_required = false;
+ spin_unlock(&pHddCtx->sap_update_info_lock);
+ }
//Any softap specific cleanup here...
if (pAdapter->device_mode == WLAN_HDD_P2P_GO) {
wlan_hdd_cleanup_remain_on_channel_ctx(pAdapter);
@@ -14269,7 +14282,185 @@ void wlan_hdd_check_sta_ap_concurrent_ch_intf(void *data)
pHddCtx->cfg_ini->vhtChannelWidth);
wlan_hdd_restart_sap(ap_adapter);
}
+#endif
+
+/**
+ * wlan_hdd_check_con_channel_sap_and_sta() - This function checks the sap's
+ * and sta's operating channel.
+ * @sta_adapter: Describe the first argument to foobar.
+ * @ap_adapter: Describe the second argument to foobar.
+ * @roam_profile: Roam profile of AP to which STA wants to connect.
+ * @concurrent_chnl_same: If both SAP and STA channels are same then
+ * set this flag to true else false.
+ *
+ * This function checks the sap's operating channel and sta's operating channel.
+ * if both are same then it will return false else it will restart the sap in
+ * sta's channel and return true.
+ *
+ *
+ * Return: VOS_STATUS_SUCCESS or VOS_STATUS_E_FAILURE.
+ */
+VOS_STATUS wlan_hdd_check_con_channel_sap_and_sta(hdd_adapter_t *sta_adapter,
+ hdd_adapter_t *ap_adapter,
+ tCsrRoamProfile *roam_profile,
+ bool *concurrent_chnl_same)
+{
+ hdd_ap_ctx_t *hdd_ap_ctx;
+ uint8_t channel_id;
+ VOS_STATUS status;
+
+ hdd_ap_ctx = WLAN_HDD_GET_AP_CTX_PTR(ap_adapter);
+ status =
+ sme_get_ap_channel_from_scan_cache(WLAN_HDD_GET_HAL_CTX(sta_adapter),
+ roam_profile,
+ &channel_id);
+ if ((VOS_STATUS_SUCCESS == status)) {
+ if (channel_id < SIR_11A_CHANNEL_BEGIN) {
+ if (hdd_ap_ctx->sapConfig.channel != channel_id) {
+ *concurrent_chnl_same = FALSE;
+ VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO_MED,
+ FL("channels are different"));
+ }
+ } else {
+ *concurrent_chnl_same = TRUE;
+ VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO_MED,
+ FL("selected ap's channel in 5Ghz"));
+ }
+ } else {
+ /*
+ * Lets handle worst case scenario here, Scan cache lookup is failed
+ * so we have to stop the SAP to avoid any channel discrepancy between
+ * SAP's channel and STA's channel. Return the status as failure so
+ * caller function could know that scan look up is failed.
+ */
+ *concurrent_chnl_same = FALSE;
+ VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR,
+ FL("Finding AP from scan cache failed"));
+ return VOS_STATUS_E_FAILURE;
+ }
+ return VOS_STATUS_SUCCESS;
+}
+#ifdef WLAN_FEATURE_MBSSID
+/**
+ * wlan_hdd_stop_sap() - This function stops bss of SAP.
+ * @ap_adapter: SAP adapter
+ *
+ * This function will process the stopping of sap adapter.
+ *
+ * Return: void.
+ */
+void wlan_hdd_stop_sap(hdd_adapter_t *ap_adapter)
+{
+ hdd_ap_ctx_t *hdd_ap_ctx;
+ hdd_hostapd_state_t *hostapd_state;
+ VOS_STATUS vos_status;
+ hdd_context_t *hdd_ctx;
+
+ if (NULL == ap_adapter) {
+ VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR,
+ FL("ap_adapter is NULL here"));
+ return;
+ }
+
+ hdd_ap_ctx = WLAN_HDD_GET_AP_CTX_PTR(ap_adapter);
+ hdd_ctx = WLAN_HDD_GET_CTX(ap_adapter);
+ if (0 != wlan_hdd_validate_context(hdd_ctx))
+ {
+ VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR,
+ "%s: HDD context is not valid", __func__);
+ return;
+ }
+ mutex_lock(&hdd_ctx->sap_lock);
+ if (test_bit(SOFTAP_BSS_STARTED, &ap_adapter->event_flags)) {
+ wlan_hdd_cfg80211_del_station(ap_adapter->wdev.wiphy, ap_adapter->dev,
+ NULL);
+ hdd_cleanup_actionframe(hdd_ctx, ap_adapter);
+ hostapd_state = WLAN_HDD_GET_HOSTAP_STATE_PTR(ap_adapter);
+ VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO_HIGH,
+ FL("Now doing SAP STOPBSS"));
+ if (VOS_STATUS_SUCCESS == WLANSAP_StopBss(hdd_ap_ctx->sapContext)) {
+ vos_status = vos_wait_single_event(&hostapd_state->vosEvent, 10000);
+ if (!VOS_IS_STATUS_SUCCESS(vos_status)) {
+ VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR,
+ FL("SAP Stop Failed"));
+ mutex_unlock(&hdd_ctx->sap_lock);
+ return;
+ }
+ }
+ clear_bit(SOFTAP_BSS_STARTED, &ap_adapter->event_flags);
+ wlan_hdd_decr_active_session(hdd_ctx, ap_adapter->device_mode);
+ VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO_HIGH,
+ FL("SAP Stop Success"));
+ } else {
+ VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR,
+ FL("Can't stop ap because its not started"));
+ }
+ mutex_unlock(&hdd_ctx->sap_lock);
+ return;
+}
+
+/**
+ * wlan_hdd_start_sap() - This function starts bss of SAP.
+ * @ap_adapter: SAP adapter
+ *
+ * This function will process the starting of sap adapter.
+ *
+ * Return: void.
+ */
+void wlan_hdd_start_sap(hdd_adapter_t *ap_adapter)
+{
+ hdd_ap_ctx_t *hdd_ap_ctx;
+ hdd_hostapd_state_t *hostapd_state;
+ VOS_STATUS vos_status;
+ hdd_context_t *hdd_ctx;
+
+ if (NULL == ap_adapter) {
+ VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR,
+ FL("ap_adapter is NULL here"));
+ return;
+ }
+
+ hdd_ctx = WLAN_HDD_GET_CTX(ap_adapter);
+ hdd_ap_ctx = WLAN_HDD_GET_AP_CTX_PTR(ap_adapter);
+ hostapd_state = WLAN_HDD_GET_HOSTAP_STATE_PTR(ap_adapter);
+
+ if (0 != wlan_hdd_validate_context(hdd_ctx))
+ {
+ VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR,
+ "%s: HDD context is not valid", __func__);
+ return;
+ }
+ mutex_lock(&hdd_ctx->sap_lock);
+ if (test_bit(SOFTAP_BSS_STARTED, &ap_adapter->event_flags)) {
+ return;
+ }
+
+ if (WLANSAP_StartBss(hdd_ap_ctx->sapContext, hdd_hostapd_SAPEventCB,
+ &hdd_ap_ctx->sapConfig, (v_PVOID_t)ap_adapter->dev)
+ != VOS_STATUS_SUCCESS) {
+ mutex_unlock(&hdd_ctx->sap_lock);
+ return;
+ }
+
+ VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO_HIGH,
+ FL("Waiting for SAP to start"));
+ vos_status = vos_wait_single_event(&hostapd_state->vosEvent, 10000);
+ if (!VOS_IS_STATUS_SUCCESS(vos_status)) {
+ VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR,
+ FL("SAP Start failed"));
+ mutex_unlock(&hdd_ctx->sap_lock);
+ return;
+ }
+ VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO_HIGH,
+ FL("SAP Start Success"));
+ set_bit(SOFTAP_BSS_STARTED, &ap_adapter->event_flags);
+ wlan_hdd_incr_active_session(hdd_ctx, ap_adapter->device_mode);
+ hostapd_state->bCommit = TRUE;
+
+ mutex_unlock(&hdd_ctx->sap_lock);
+ return;
+}
#endif
diff --git a/CORE/MAC/inc/qwlan_version.h b/CORE/MAC/inc/qwlan_version.h
index 895991059c01..8b3b41ddf553 100644
--- a/CORE/MAC/inc/qwlan_version.h
+++ b/CORE/MAC/inc/qwlan_version.h
@@ -42,9 +42,9 @@ BRIEF DESCRIPTION:
#define QWLAN_VERSION_MINOR 0
#define QWLAN_VERSION_PATCH 0
#define QWLAN_VERSION_EXTRA ""
-#define QWLAN_VERSION_BUILD 234
+#define QWLAN_VERSION_BUILD 235
-#define QWLAN_VERSIONSTR "1.0.0.234"
+#define QWLAN_VERSIONSTR "1.0.0.235"
#define AR6320_REV1_VERSION 0x5000000
diff --git a/CORE/SME/inc/csrApi.h b/CORE/SME/inc/csrApi.h
index e839a5d8ee4b..9aa6dc91027d 100644
--- a/CORE/SME/inc/csrApi.h
+++ b/CORE/SME/inc/csrApi.h
@@ -1235,6 +1235,8 @@ typedef struct tagCsrConfigParam
#endif
tANI_BOOLEAN obssEnabled;
+ v_U8_t conc_custom_rule1;
+ v_U8_t is_sta_connection_in_5gz_enabled;
}tCsrConfigParam;
diff --git a/CORE/SME/inc/csrInternal.h b/CORE/SME/inc/csrInternal.h
index a23cd1c45287..d1f9de4559d4 100644
--- a/CORE/SME/inc/csrInternal.h
+++ b/CORE/SME/inc/csrInternal.h
@@ -669,6 +669,8 @@ typedef struct tagCsrConfig
tANI_BOOLEAN isRoamOffloadEnabled;
#endif
tANI_BOOLEAN obssEnabled;
+ v_U8_t conc_custom_rule1;
+ v_U8_t is_sta_connection_in_5gz_enabled;
}tCsrConfig;
typedef struct tagCsrChannelPowerInfo
diff --git a/CORE/SME/inc/sme_Api.h b/CORE/SME/inc/sme_Api.h
index 7f15ee1a62e8..530f7270ff7d 100644
--- a/CORE/SME/inc/sme_Api.h
+++ b/CORE/SME/inc/sme_Api.h
@@ -568,7 +568,9 @@ eHalStatus sme_ScanSetBGScanparams(tHalHandle hHal, tANI_U8 sessionId, tCsrBGSca
eHalStatus sme_ScanGetResult(tHalHandle hHal, tANI_U8 sessionId, tCsrScanResultFilter *pFilter,
tScanResultHandle *phResult);
-
+VOS_STATUS sme_get_ap_channel_from_scan_cache(tHalHandle hHal,
+ tCsrRoamProfile *profile,
+ tANI_U8 *ap_chnl_id);
/* ---------------------------------------------------------------------------
\fn sme_ScanFlushResult
\brief a wrapper function to request CSR to clear scan results.
diff --git a/CORE/SME/src/csr/csrApiRoam.c b/CORE/SME/src/csr/csrApiRoam.c
index 9df36b49ac52..33fe79912f1c 100644
--- a/CORE/SME/src/csr/csrApiRoam.c
+++ b/CORE/SME/src/csr/csrApiRoam.c
@@ -247,6 +247,7 @@ void csrRoamRemoveEntryFromPeStatsReqList(tpAniSirGlobal pMac, tCsrPeStatsReqInf
tListElem * csrRoamFindInPeStatsReqList(tpAniSirGlobal pMac, tANI_U32 statsMask);
eHalStatus csrRoamDeregStatisticsReq(tpAniSirGlobal pMac);
static tANI_U32 csrFindIbssSession( tpAniSirGlobal pMac );
+static tANI_U32 csr_find_sap_session(tpAniSirGlobal pMac);
static eHalStatus csrRoamStartWds( tpAniSirGlobal pMac, tANI_U32 sessionId, tCsrRoamProfile *pProfile, tSirBssDescription *pBssDesc );
static void csrInitSession( tpAniSirGlobal pMac, tANI_U32 sessionId );
static eHalStatus csrRoamIssueSetKeyCommand( tpAniSirGlobal pMac, tANI_U32 sessionId,
@@ -1902,8 +1903,12 @@ eHalStatus csrChangeDefaultConfigParam(tpAniSirGlobal pMac, tCsrConfigParam *pPa
pParam->isRoamOffloadEnabled;
#endif
pMac->roam.configParam.obssEnabled = pParam->obssEnabled;
- }
+ pMac->roam.configParam.conc_custom_rule1 =
+ pParam->conc_custom_rule1;
+ pMac->roam.configParam.is_sta_connection_in_5gz_enabled =
+ pParam->is_sta_connection_in_5gz_enabled;
+ }
return status;
}
@@ -2053,6 +2058,10 @@ eHalStatus csrGetConfigParam(tpAniSirGlobal pMac, tCsrConfigParam *pParam)
pParam->obssEnabled = pMac->roam.configParam.obssEnabled;
+ pParam->conc_custom_rule1 =
+ pMac->roam.configParam.conc_custom_rule1;
+ pParam->is_sta_connection_in_5gz_enabled =
+ pMac->roam.configParam.is_sta_connection_in_5gz_enabled;
status = eHAL_STATUS_SUCCESS;
}
return (status);
@@ -13109,6 +13118,8 @@ eHalStatus csrSendJoinReqMsg( tpAniSirGlobal pMac, tANI_U32 sessionId, tSirBssDe
tANI_U8 wpaRsnIE[DOT11F_IE_RSN_MAX_LEN]; //RSN MAX is bigger than WPA MAX
tANI_U32 ucDot11Mode = 0;
tANI_U8 txBFCsnValue = 0;
+ tANI_U32 sap_sessionId;
+ tCsrRoamSession *sap_session;
if(!pSession)
{
@@ -13761,9 +13772,53 @@ eHalStatus csrSendJoinReqMsg( tpAniSirGlobal pMac, tANI_U32 sessionId, tSirBssDe
csrPrepareJoinReassocReqBuffer( pMac, pBssDescription, pBuf,
(tANI_U8)pProfile->uapsd_mask);
+ /*
+ * conc_custom_rule1:
+ * If SAP comes up first and STA comes up later then SAP
+ * need to follow STA's channel. In following if condition
+ * we are adding sanity check, just to make sure that if this rule
+ * is enabled then don't allow STA to connect on 5gz channel and also
+ * by this time SAP's channel should be the same as STA's channel.
+ */
+ if (pMac->roam.configParam.conc_custom_rule1) {
+ if ((0 == pMac->roam.configParam.is_sta_connection_in_5gz_enabled)
+ && CSR_IS_CHANNEL_5GHZ(pBssDescription->channelId)) {
+ VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR,
+ FL("STA connection on 5G band is not allowed"));
+ status = eHAL_STATUS_FAILURE;
+ break;
+ }
+ if (!CSR_IS_CHANNEL_5GHZ(pBssDescription->channelId)) {
+ sap_sessionId = csr_find_sap_session(pMac);
+ if (CSR_SESSION_ID_INVALID != sap_sessionId) {
+ sap_session = CSR_GET_SESSION( pMac, sessionId );
+ if(!sap_session) {
+ VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR,
+ FL("session %d not found"), sap_sessionId);
+ status = eHAL_STATUS_FAILURE;
+ break;
+ }
+ if ((0 != sap_session->pCurRoamProfile->operationChannel) &&
+ (sap_session->pCurRoamProfile->operationChannel !=
+ pBssDescription->channelId)) {
+
+ VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR,
+ FL("Can't allow STA to connect, channels not same"));
+
+ status = eHAL_STATUS_FAILURE;
+ break;
+ }
+ }
+ }
+ }
status = palSendMBMessage(pMac->hHdd, pMsg );
if(!HAL_STATUS_SUCCESS(status))
{
+ /*
+ * palSendMBMessage would've released the memory allocated by pMsg.
+ * Let's make it defensive by assigning NULL to the pointer.
+ */
+ pMsg = NULL;
break;
}
else
@@ -13785,6 +13840,11 @@ eHalStatus csrSendJoinReqMsg( tpAniSirGlobal pMac, tANI_U32 sessionId, tSirBssDe
#endif
}
} while( 0 );
+
+ /* Clean up the memory in case of any failure */
+ if (!HAL_STATUS_SUCCESS(status) && (NULL != pMsg)) {
+ vos_mem_free(pMsg);
+ }
return( status );
}
@@ -18694,3 +18754,30 @@ void csrInitOperatingClasses(tHalHandle hHal)
regdm_set_curr_opclasses(numClasses, &opClasses[0]);
}
+/**
+ * csr_find_sap_session() - This function will find the AP sessions from all
+ * sessions.
+ * @mac_ctx: pointer to mac context.
+ *
+ * This function is written to find the sap session id.
+ *
+ * Return: sap session id.
+ */
+static tANI_U32 csr_find_sap_session(tpAniSirGlobal mac_ctx)
+{
+ tANI_U32 i, session_id = CSR_SESSION_ID_INVALID;
+ tCsrRoamSession *session_ptr;
+ for (i = 0; i < CSR_ROAM_SESSION_MAX; i++) {
+ if (CSR_IS_SESSION_VALID( mac_ctx, i)){
+ session_ptr = CSR_GET_SESSION(mac_ctx, i);
+ if (session_ptr->pCurRoamProfile &&
+ (eCSR_BSS_TYPE_INFRA_AP ==
+ session_ptr->connectedProfile.BSSType)) {
+ /* Found it */
+ session_id = i;
+ break;
+ }
+ }
+ }
+ return session_id;
+}
diff --git a/CORE/SME/src/csr/csrApiScan.c b/CORE/SME/src/csr/csrApiScan.c
index 2609cacf57d8..fd8021d09ce5 100644
--- a/CORE/SME/src/csr/csrApiScan.c
+++ b/CORE/SME/src/csr/csrApiScan.c
@@ -8687,3 +8687,44 @@ eHalStatus csrScanSaveRoamOffloadApToScanCache(tpAniSirGlobal pMac,
return eHAL_STATUS_SUCCESS;
}
#endif
+
+/**
+ * csr_get_bssdescr_from_scan_handle() - This function to extract
+ * first bss description from scan handle
+ * @result_handle: an object for the result.
+ *
+ * This function is written to extract first bss from scan handle.
+ *
+ * Return: first bss descriptor from the scan handle.
+ */
+tSirBssDescription*
+csr_get_bssdescr_from_scan_handle(tScanResultHandle *result_handle,
+ tSirBssDescription *bss_descr)
+{
+ tListElem *first_element = NULL;
+ tCsrScanResult *scan_result = NULL;
+ tScanResultList *bss_list = (tScanResultList *)*result_handle;
+
+ if (NULL == bss_list) {
+ VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR,
+ FL("Empty bss_list"));
+ return NULL;
+ }
+ if (csrLLIsListEmpty(&bss_list->List, LL_ACCESS_NOLOCK)) {
+ VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR,
+ FL("bss_list->List is empty"));
+ vos_mem_free(bss_list);
+ return NULL;
+ }
+ first_element = csrLLPeekHead(&bss_list->List, LL_ACCESS_NOLOCK);
+ if (first_element) {
+ scan_result = GET_BASE_ADDR(first_element,
+ tCsrScanResult,
+ Link);
+ vos_mem_copy(bss_descr,
+ &scan_result->Result.BssDescriptor,
+ sizeof(tSirBssDescription));
+ }
+ vos_mem_free(bss_list);
+ return bss_descr;
+}
diff --git a/CORE/SME/src/csr/csrInsideApi.h b/CORE/SME/src/csr/csrInsideApi.h
index 26967d1965c7..ec4a4a9179b0 100644
--- a/CORE/SME/src/csr/csrInsideApi.h
+++ b/CORE/SME/src/csr/csrInsideApi.h
@@ -1059,3 +1059,6 @@ void csrClearVotesForCountryInfo(tpAniSirGlobal pMac);
eHalStatus csrSetHT2040Mode(tpAniSirGlobal pMac, tANI_U32 sessionId,
ePhyChanBondState cbMode, tANI_BOOLEAN obssEnabled);
#endif
+tSirBssDescription*
+csr_get_bssdescr_from_scan_handle(tScanResultHandle *result_handle,
+ tSirBssDescription *bss_descr);
diff --git a/CORE/SME/src/csr/csrUtil.c b/CORE/SME/src/csr/csrUtil.c
index f9db12acd2ef..1a4b22bd2d14 100644
--- a/CORE/SME/src/csr/csrUtil.c
+++ b/CORE/SME/src/csr/csrUtil.c
@@ -835,17 +835,32 @@ v_U16_t csrCheckConcurrentChannelOverlap(tpAniSirGlobal pMac, v_U16_t sap_ch,
VOS_STA_SAP_MODE)) &&
(pSession->connectState !=
eCSR_ASSOC_STATE_TYPE_NOT_CONNECTED)) {
- if (sap_ch == 0) {
- sap_ch = pSession->connectedProfile.operationChannel;
- csrGetChFromHTProfile(pMac,
- &pSession->connectedProfile.HTProfile, sap_ch,
- &sap_cfreq, &sap_hbw);
- } else if (sap_ch !=
+ /*
+ * if conc_custom_rule1 is defined then we don't want p2pgo to
+ * follow SAP's channel or SAP to follow P2PGO's channel.
+ */
+ if (0 == pMac->roam.configParam.conc_custom_rule1) {
+ if (sap_ch == 0) {
+ sap_ch = pSession->connectedProfile.operationChannel;
+ csrGetChFromHTProfile(pMac,
+ &pSession->connectedProfile.HTProfile, sap_ch,
+ &sap_cfreq, &sap_hbw);
+ } else if (sap_ch !=
pSession->connectedProfile.operationChannel) {
- intf_ch = pSession->connectedProfile.operationChannel;
- csrGetChFromHTProfile(pMac,
- &pSession->connectedProfile.HTProfile, intf_ch,
- &intf_cfreq, &intf_hbw);
+ intf_ch = pSession->connectedProfile.operationChannel;
+ csrGetChFromHTProfile(pMac,
+ &pSession->connectedProfile.HTProfile, intf_ch,
+ &intf_cfreq, &intf_hbw);
+ }
+ } else {
+ if (sap_ch == 0 &&
+ (pSession->pCurRoamProfile->csrPersona ==
+ VOS_STA_SAP_MODE)) {
+ sap_ch = pSession->connectedProfile.operationChannel;
+ csrGetChFromHTProfile(pMac,
+ &pSession->connectedProfile.HTProfile, sap_ch,
+ &sap_cfreq, &sap_hbw);
+ }
}
}
}
@@ -2062,97 +2077,95 @@ csrIsconcurrentsessionValid(tpAniSirGlobal pMac,tANI_U32 cursessionId,
tVOS_CON_MODE currBssPersona)
{
tANI_U32 sessionId = 0;
-
- for (sessionId = 0; sessionId < CSR_ROAM_SESSION_MAX; sessionId++ )
- {
- if (cursessionId != sessionId )
- {
- if (!CSR_IS_SESSION_VALID( pMac, sessionId ))
- {
- continue;
- }
-
- switch (currBssPersona)
- {
- case VOS_STA_MODE:
- smsLog(pMac, LOG1, FL(" **** STA session ****"));
- return eHAL_STATUS_SUCCESS;
-
- case VOS_STA_SAP_MODE:
+ tANI_U8 automotive_support_enable =
+ pMac->roam.configParam.conc_custom_rule1;
+ tVOS_CON_MODE bss_persona;
+ eCsrConnectState connect_state;
+
+ for (sessionId = 0; sessionId < CSR_ROAM_SESSION_MAX; sessionId++) {
+ if (cursessionId != sessionId ) {
+ if (!CSR_IS_SESSION_VALID( pMac, sessionId )) {
+ continue;
+ }
+ bss_persona =
+ pMac->roam.roamSession[sessionId].bssParams.bssPersona;
+ connect_state =
+ pMac->roam.roamSession[sessionId].connectState;
+
+ switch (currBssPersona) {
+
+ case VOS_STA_MODE:
+ VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO,
+ FL("** STA session **"));
+ return eHAL_STATUS_SUCCESS;
+
+ case VOS_STA_SAP_MODE:
#ifndef WLAN_FEATURE_MBSSID
- if((pMac->roam.roamSession[sessionId].bssParams.bssPersona
- == VOS_STA_SAP_MODE)&&
- (pMac->roam.roamSession[sessionId].connectState
- != eCSR_ASSOC_STATE_TYPE_NOT_CONNECTED))
- {
- smsLog(pMac, LOGE, FL(" ****SoftAP mode already exists ****"));
- return eHAL_STATUS_FAILURE;
- }
- else
+ if ((bss_persona == VOS_STA_SAP_MODE) &&
+ (connect_state !=
+ eCSR_ASSOC_STATE_TYPE_NOT_CONNECTED)) {
+ VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR,
+ FL("**SoftAP mode already exists **"));
+ return eHAL_STATUS_FAILURE;
+ }
+ else
#endif
- if( (pMac->roam.roamSession[sessionId].bssParams.bssPersona
- == VOS_P2P_GO_MODE &&
- pMac->roam.roamSession[sessionId].connectState
- != eCSR_ASSOC_STATE_TYPE_NOT_CONNECTED) ||
- (pMac->roam.roamSession[sessionId].bssParams.bssPersona
- == VOS_IBSS_MODE &&
- pMac->roam.roamSession[sessionId].connectState
- != eCSR_ASSOC_STATE_TYPE_IBSS_DISCONNECTED))
- {
- smsLog(pMac, LOGE, FL(" ****Cannot start Multiple Beaconing Role ****"));
- return eHAL_STATUS_FAILURE;
- }
- break;
-
- case VOS_P2P_GO_MODE:
- if((pMac->roam.roamSession[sessionId].bssParams.bssPersona
- == VOS_P2P_GO_MODE) &&
- (pMac->roam.roamSession[sessionId].connectState
- != eCSR_ASSOC_STATE_TYPE_NOT_CONNECTED))
- {
- smsLog(pMac, LOGE, FL(" ****P2P GO mode already exists ****"));
- return eHAL_STATUS_FAILURE;
- }
- else if( (pMac->roam.roamSession[sessionId].bssParams.bssPersona
- == VOS_STA_SAP_MODE &&
- pMac->roam.roamSession[sessionId].connectState
- != eCSR_ASSOC_STATE_TYPE_NOT_CONNECTED) ||
- (pMac->roam.roamSession[sessionId].bssParams.bssPersona
- == VOS_IBSS_MODE &&
- pMac->roam.roamSession[sessionId].connectState
- != eCSR_ASSOC_STATE_TYPE_IBSS_DISCONNECTED) )
- {
- smsLog(pMac, LOGE, FL(" ****Cannot start Multiple Beaconing Role ****"));
- return eHAL_STATUS_FAILURE;
- }
- break;
- case VOS_IBSS_MODE:
- if((pMac->roam.roamSession[sessionId].bssParams.bssPersona
- == VOS_IBSS_MODE) &&
- (pMac->roam.roamSession[sessionId].connectState
- != eCSR_ASSOC_STATE_TYPE_IBSS_CONNECTED))
- {
- smsLog(pMac, LOGE, FL(" ****IBSS mode already exists ****"));
- return eHAL_STATUS_FAILURE;
- }
- else if( (pMac->roam.roamSession[sessionId].bssParams.bssPersona
- == VOS_P2P_GO_MODE ||
- pMac->roam.roamSession[sessionId].bssParams.bssPersona
- == VOS_STA_SAP_MODE) &&
- pMac->roam.roamSession[sessionId].connectState
- != eCSR_ASSOC_STATE_TYPE_NOT_CONNECTED)
- {
- smsLog(pMac, LOGE, FL(" ****Cannot start Multiple Beaconing Role ****"));
- return eHAL_STATUS_FAILURE;
- }
- break;
- case VOS_P2P_CLIENT_MODE:
- smsLog(pMac, LOG1, FL(" **** P2P-Client session ****"));
- return eHAL_STATUS_SUCCESS;
- default :
- smsLog(pMac, LOGE, FL("***Persona not handled = %d*****"),currBssPersona);
- break;
- }
+ if (((bss_persona == VOS_P2P_GO_MODE) && (connect_state !=
+ eCSR_ASSOC_STATE_TYPE_NOT_CONNECTED) &&
+ (0 == automotive_support_enable)) ||
+ ((bss_persona == VOS_IBSS_MODE) && (connect_state !=
+ eCSR_ASSOC_STATE_TYPE_IBSS_DISCONNECTED))) {
+ VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR,
+ FL("Can't start multiple beaconing role"));
+ return eHAL_STATUS_FAILURE;
+ }
+ break;
+
+ case VOS_P2P_GO_MODE:
+ if ((bss_persona == VOS_P2P_GO_MODE) && (connect_state !=
+ eCSR_ASSOC_STATE_TYPE_NOT_CONNECTED)) {
+ VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR,
+ FL(" ****P2P GO mode already exists ****"));
+ return eHAL_STATUS_FAILURE;
+
+ } else if (((bss_persona == VOS_STA_SAP_MODE) &&
+ (connect_state !=
+ eCSR_ASSOC_STATE_TYPE_NOT_CONNECTED) &&
+ (0 == automotive_support_enable)) ||
+ ((bss_persona == VOS_IBSS_MODE) &&
+ (connect_state !=
+ eCSR_ASSOC_STATE_TYPE_IBSS_DISCONNECTED))) {
+ VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR,
+ FL("Can't start multiple beaconing role"));
+ return eHAL_STATUS_FAILURE;
+ }
+ break;
+ case VOS_IBSS_MODE:
+ if ((bss_persona == VOS_IBSS_MODE) &&
+ (connect_state !=
+ eCSR_ASSOC_STATE_TYPE_IBSS_CONNECTED)) {
+ VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR,
+ FL(" ****IBSS mode already exists ****"));
+ return eHAL_STATUS_FAILURE;
+ } else if (((bss_persona == VOS_P2P_GO_MODE) ||
+ (bss_persona == VOS_STA_SAP_MODE)) &&
+ (connect_state
+ != eCSR_ASSOC_STATE_TYPE_NOT_CONNECTED)) {
+ VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR,
+ FL("**Cannot start Multiple Beaconing Role**"));
+ return eHAL_STATUS_FAILURE;
+ }
+ break;
+ case VOS_P2P_CLIENT_MODE:
+ VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO,
+ FL("**P2P-Client session**"));
+ return eHAL_STATUS_SUCCESS;
+ default :
+ VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR,
+ FL("**Persona not handled = %d**"),
+ currBssPersona);
+ break;
+ }
}
}
return eHAL_STATUS_SUCCESS;
@@ -2381,6 +2394,9 @@ eHalStatus csrValidateMCCBeaconInterval(tpAniSirGlobal pMac, tANI_U8 channelId,
}
break;
+ case VOS_STA_SAP_MODE :
+ break;
+
case VOS_P2P_GO_MODE :
{
if (pMac->roam.roamSession[sessionId].pCurRoamProfile &&
diff --git a/CORE/SME/src/sme_common/sme_Api.c b/CORE/SME/src/sme_common/sme_Api.c
index 4bd6ecb51f3f..590f8231ef99 100644
--- a/CORE/SME/src/sme_common/sme_Api.c
+++ b/CORE/SME/src/sme_common/sme_Api.c
@@ -3151,6 +3151,113 @@ eHalStatus sme_ScanGetResult(tHalHandle hHal, tANI_U8 sessionId, tCsrScanResultF
return (status);
}
+/**
+ * sme_get_ap_channel_from_scan_cache() - a wrapper function to get AP's
+ * channel id from CSR by filtering the
+ * result which matches our roam profile.
+ * @profile: SAP adapter
+ * @ap_chnl_id: pointer to channel id of SAP. Fill the value after finding the
+ * best ap from scan cache.
+ *
+ * This function is written to get AP's channel id from CSR by filtering
+ * the result which matches our roam profile. This is a synchronous call.
+ *
+ * Return: VOS_STATUS.
+ */
+VOS_STATUS sme_get_ap_channel_from_scan_cache(tHalHandle hHal,
+ tCsrRoamProfile *profile,
+ tANI_U8 *ap_chnl_id)
+{
+ eHalStatus status = eHAL_STATUS_FAILURE;
+ tpAniSirGlobal pMac = PMAC_STRUCT( hHal );
+ tCsrScanResultFilter *scan_filter = NULL;
+ tScanResultHandle *filtered_scan_result = NULL;
+ tSirBssDescription first_ap_profile;
+
+ if (NULL == pMac) {
+ VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR,
+ FL("pMac is NULL"));
+ return VOS_STATUS_E_FAILURE;
+ }
+ filtered_scan_result = vos_mem_malloc(sizeof(tScanResultHandle));
+ if (NULL == filtered_scan_result) {
+ VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR,
+ FL("filtered_scan_result mem alloc failed"));
+ return VOS_STATUS_E_FAILURE;
+ }
+ scan_filter = vos_mem_malloc(sizeof(tCsrScanResultFilter));
+ if (NULL == scan_filter) {
+ VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR,
+ FL("scan_filter mem alloc failed"));
+ vos_mem_free(filtered_scan_result);
+ return VOS_STATUS_E_FAILURE;
+ } else {
+ vos_mem_set(filtered_scan_result, sizeof(tScanResultHandle), 0);
+ vos_mem_set(scan_filter, sizeof(tCsrScanResultFilter), 0);
+ vos_mem_set(&first_ap_profile, sizeof(tSirBssDescription), 0);
+
+ if (NULL == profile) {
+ scan_filter->EncryptionType.numEntries = 1;
+ scan_filter->EncryptionType.encryptionType[0]
+ = eCSR_ENCRYPT_TYPE_NONE;
+ } else {
+ /* Here is the profile we need to connect to */
+ status = csrRoamPrepareFilterFromProfile(pMac, profile, scan_filter);
+ }
+
+ if (HAL_STATUS_SUCCESS(status)) {
+ /* Save the WPS info */
+ if(NULL != profile) {
+ scan_filter->bWPSAssociation = profile->bWPSAssociation;
+ scan_filter->bOSENAssociation = profile->bOSENAssociation;
+ } else {
+ scan_filter->bWPSAssociation = 0;
+ scan_filter->bOSENAssociation = 0;
+ }
+ } else {
+ VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR,
+ FL("Preparing the profile filter failed"));
+ vos_mem_free(filtered_scan_result);
+ vos_mem_free(scan_filter);
+ return VOS_STATUS_E_FAILURE;
+ }
+ }
+ status = sme_AcquireGlobalLock( &pMac->sme );
+ if (eHAL_STATUS_SUCCESS == status) {
+ status = csrScanGetResult(hHal, scan_filter, filtered_scan_result);
+ if (eHAL_STATUS_SUCCESS == status) {
+ csr_get_bssdescr_from_scan_handle(filtered_scan_result,
+ &first_ap_profile);
+ if (0 != first_ap_profile.channelId) {
+ *ap_chnl_id = first_ap_profile.channelId;
+ VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR,
+ FL("Found best AP and it is on channel[%d]"),
+ first_ap_profile.channelId);
+ } else {
+ /*
+ * This means scan result is empty
+ * so set the channel to zero, caller should
+ * take of zero channel id case.
+ */
+ *ap_chnl_id = 0;
+ VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR,
+ FL("Scan result is empty, setting channel to 0"));
+ }
+ } else {
+ VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR,
+ FL("Failed to get scan get result"));
+ }
+ sme_ReleaseGlobalLock( &pMac->sme );
+ } else {
+ VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR,
+ FL("Aquiring lock failed"));
+ }
+
+ vos_mem_free(filtered_scan_result);
+ vos_mem_free(scan_filter);
+
+ return VOS_STATUS_SUCCESS;
+}
/* ---------------------------------------------------------------------------
\fn sme_ScanFlushResult
diff --git a/firmware_bin/WCNSS_qcom_cfg.ini b/firmware_bin/WCNSS_qcom_cfg.ini
index bb53e17e5600..b2bd255d7eda 100755
--- a/firmware_bin/WCNSS_qcom_cfg.ini
+++ b/firmware_bin/WCNSS_qcom_cfg.ini
@@ -157,7 +157,7 @@ WmmIsEnabled=0
# 802.11d support
-g11dSupportEnabled=1
+g11dSupportEnabled=0
# 802.11h support
@@ -167,7 +167,7 @@ g11hSupportEnabled=1
gEnableDFSMasterCap=1
# ESE Support and fast transition
-EseEnabled=0
+EseEnabled=1
ImplicitQosIsEnabled=0
gNeighborScanTimerPeriod=200
@@ -324,17 +324,17 @@ gStaKeepAlivePeriod = 30
#gGoLinkMonitorPeriod/ gApLinkMonitorPeriod is period where link is idle and it is period
#where we send NULL frame.
-#gApLinkMonitorPeriod = 10
+gApLinkMonitorPeriod = 30
-#gGoLinkMonitorPeriod = 10
+gGoLinkMonitorPeriod = 10
#gGoKeepAlivePeriod/gApKeepAlivePeriod is time to spend to check whether frame are succeed to send or not.
#Hence total effective detection time is gGoLinkMonitorPeriod+ gGoKeepAlivePeriod/gApLinkMonitorPeriod+ gApKeepAlivePeriod.
-gGoKeepAlivePeriod = 20
+gGoKeepAlivePeriod = 3
-gApKeepAlivePeriod = 20
+gApKeepAlivePeriod = 10
#If set will start with active scan after driver load, otherwise will start with
@@ -390,8 +390,8 @@ gSetRxChainmask1x1=1
# Scan Timing Parameters
# gPassiveMaxChannelTime=110
# gPassiveMinChannelTime=60
-# gActiveMaxChannelTime=40
-# gActiveMinChannelTime=20
+gActiveMaxChannelTime=80
+gActiveMinChannelTime=40
#If set to 0, MCC is not allowed.
gEnableMCCMode=1
@@ -501,7 +501,7 @@ gVhtMpduLen=2
gEnableMCCAdaptiveScheduler=1
#Enable or Disable p2p device address administered
-isP2pDeviceAddrAdministrated=0
+isP2pDeviceAddrAdministrated=1
#Enable Rx thread
gEnableRxThread=1
@@ -563,7 +563,7 @@ gEnableGreenAp=1
# Radar PRI multiplier
gDFSradarMappingPriMultiplier=4
-gPNOScanSupport=1
+gPNOScanSupport=0
# Enable/Disable RX full reorder offload
gReorderOffloadSupported=1
@@ -629,6 +629,12 @@ gEnableTDLSOffChannel=1
IpaUcOffloadEnabled=1
gIpaUcStaOffload=1
+gEnableSelfRecovery=1
+
+# Enable or Disable Random MAC (Spoofing)
+# 1=Enable, 0=Disable (default)
+gEnableMacAddrSpoof=0
+
END
# Note: Configuration parser would not read anything past the END marker