diff options
| author | Chandrasekaran, Manishekar <cmshekar@qti.qualcomm.com> | 2014-08-14 15:21:49 +0530 |
|---|---|---|
| committer | Pitani Venkata Rajesh Kumar <c_vpitan@qti.qualcomm.com> | 2014-08-20 13:16:53 +0530 |
| commit | f1448f7d886135c4592d285b9b4e23e9eb4667ee (patch) | |
| tree | 013d99acea281088f0e7a83a3537c4baf94e9e4a | |
| parent | 37b4caab23e17d7c64bfd991a1d73069e7159632 (diff) | |
qcacld: Restart SAP, in case of SCC, in SAP+STA
When STA is started first and SAP is started
next, SAP will follow the STA interface. But,
SAP is started first, the channel on which the
STA interface comes up depends on the AP to
which the STA is connected.
This fix ensures that when when SAP is started
first followed by STA and their channels do not
match, SAP will be restarted by the framework
in the channel of the STA to ensure SCC.
This indication to the framework is enabled
by setting gSapSccChanAvoidance to 1 and
disabled by setting gSapSccChanAvoidance to 0
in the ini file based on customer requirement.
By default this indiacation is disabled.
Change-Id: I5ec2c9cd70162b524f9567a22f779477803a4c37
CRs-Fixed: 709653
| -rw-r--r-- | CORE/HDD/inc/wlan_hdd_cfg.h | 11 | ||||
| -rw-r--r-- | CORE/HDD/inc/wlan_hdd_cfg80211.h | 12 | ||||
| -rw-r--r-- | CORE/HDD/inc/wlan_hdd_hostapd.h | 3 | ||||
| -rw-r--r-- | CORE/HDD/src/wlan_hdd_assoc.c | 26 | ||||
| -rw-r--r-- | CORE/HDD/src/wlan_hdd_cfg.c | 9 | ||||
| -rw-r--r-- | CORE/HDD/src/wlan_hdd_cfg80211.c | 4 | ||||
| -rw-r--r-- | CORE/HDD/src/wlan_hdd_hostapd.c | 27 | ||||
| -rw-r--r-- | CORE/MAC/inc/sirApi.h | 4 | ||||
| -rw-r--r-- | Kbuild | 4 | ||||
| -rwxr-xr-x | firmware_bin/WCNSS_qcom_cfg.ini | 5 |
10 files changed, 93 insertions, 12 deletions
diff --git a/CORE/HDD/inc/wlan_hdd_cfg.h b/CORE/HDD/inc/wlan_hdd_cfg.h index 871446e105ba..c62fb1f079f7 100644 --- a/CORE/HDD/inc/wlan_hdd_cfg.h +++ b/CORE/HDD/inc/wlan_hdd_cfg.h @@ -1607,6 +1607,13 @@ typedef enum #define CFG_ENABLE_GREEN_AP_FEATURE_DEFAULT ( 1 ) #endif +#ifdef FEATURE_WLAN_FORCE_SAP_SCC +#define CFG_SAP_SCC_CHAN_AVOIDANCE "gSapSccChanAvoidance" +#define CFG_SAP_SCC_CHAN_AVOIDANCE_MIN ( 0 ) +#define CFG_SAP_SCC_CHAN_AVOIDANCE_MAX ( 1 ) +#define CFG_SAP_SCC_CHAN_AVOIDANCE_DEFAULT ( 0 ) +#endif /* FEATURE_WLAN_FORCE_SAP_SCC */ + /* * VOS Trace Enable Control * Notes: @@ -3282,6 +3289,10 @@ typedef struct v_BOOL_t enablelpasssupport; #endif v_BOOL_t enableSelfRecovery; + +#ifdef FEATURE_WLAN_FORCE_SAP_SCC + v_U8_t SapSccChanAvoidance; +#endif /* FEATURE_WLAN_FORCE_SAP_SCC */ } hdd_config_t; #ifdef WLAN_FEATURE_MBSSID diff --git a/CORE/HDD/inc/wlan_hdd_cfg80211.h b/CORE/HDD/inc/wlan_hdd_cfg80211.h index 578e50b815c4..2aaa860dc3ef 100644 --- a/CORE/HDD/inc/wlan_hdd_cfg80211.h +++ b/CORE/HDD/inc/wlan_hdd_cfg80211.h @@ -162,9 +162,9 @@ enum qca_nl80211_vendor_subcmds { }; enum qca_nl80211_vendor_subcmds_index { -#ifdef FEATURE_WLAN_CH_AVOID +#if defined(FEATURE_WLAN_CH_AVOID) || defined(FEATURE_WLAN_FORCE_SAP_SCC) QCA_NL80211_VENDOR_SUBCMD_AVOID_FREQUENCY_INDEX = 0, -#endif /* FEATURE_WLAN_CH_AVOID */ +#endif /* FEATURE_WLAN_CH_AVOID || FEATURE_WLAN_FORCE_SAP_SCC */ #ifdef WLAN_FEATURE_NAN QCA_NL80211_VENDOR_SUBCMD_NAN_INDEX, @@ -731,7 +731,7 @@ enum qca_wlan_vendor_attr_ll_stats_results #endif /* WLAN_FEATURE_LINK_LAYER_STATS */ -#ifdef FEATURE_WLAN_CH_AVOID +#if defined(FEATURE_WLAN_CH_AVOID) || defined(FEATURE_WLAN_FORCE_SAP_SCC) #define HDD_MAX_AVOID_FREQ_RANGES 4 typedef struct sHddAvoidFreqRange { @@ -744,7 +744,7 @@ typedef struct sHddAvoidFreqList u32 avoidFreqRangeCount; tHddAvoidFreqRange avoidFreqRange[HDD_MAX_AVOID_FREQ_RANGES]; } tHddAvoidFreqList; -#endif /* FEATURE_WLAN_CH_AVOID */ +#endif /* FEATURE_WLAN_CH_AVOID || FEATURE_WLAN_FORCE_SAP_SCC */ struct cfg80211_bss* wlan_hdd_cfg80211_update_bss_db( hdd_adapter_t *pAdapter, tCsrRoamInfo *pRoamInfo @@ -825,10 +825,10 @@ void hdd_suspend_wlan(void (*callback)(void *callbackContext, boolean suspended) void *callbackContext); void hdd_resume_wlan(void); -#ifdef FEATURE_WLAN_CH_AVOID +#if defined(FEATURE_WLAN_CH_AVOID) || defined(FEATURE_WLAN_FORCE_SAP_SCC) int wlan_hdd_send_avoid_freq_event(hdd_context_t *pHddCtx, tHddAvoidFreqList *pAvoidFreqList); -#endif +#endif /* FEATURE_WLAN_CH_AVOID || FEATURE_WLAN_FORCE_SAP_SCC*/ #ifdef FEATURE_WLAN_EXTSCAN void wlan_hdd_cfg80211_extscan_callback(void *ctx, diff --git a/CORE/HDD/inc/wlan_hdd_hostapd.h b/CORE/HDD/inc/wlan_hdd_hostapd.h index 4059145139b3..4d24a53924ab 100644 --- a/CORE/HDD/inc/wlan_hdd_hostapd.h +++ b/CORE/HDD/inc/wlan_hdd_hostapd.h @@ -94,6 +94,9 @@ void hdd_set_ap_ops( struct net_device *pWlanHostapdDev ); int hdd_hostapd_stop (struct net_device *dev); void hdd_hostapd_channel_wakelock_init(hdd_context_t *pHddCtx); void hdd_hostapd_channel_wakelock_deinit(hdd_context_t *pHddCtx); +#ifdef FEATURE_WLAN_FORCE_SAP_SCC +void hdd_restart_softap (hdd_context_t *pHddCtx, hdd_adapter_t *pAdapter); +#endif /* FEATURE_WLAN_FORCE_SAP_SCC */ #ifdef QCA_HT_2040_COEX VOS_STATUS hdd_set_sap_ht2040_mode(hdd_adapter_t *pHostapdAdapter, tANI_U8 channel_type); diff --git a/CORE/HDD/src/wlan_hdd_assoc.c b/CORE/HDD/src/wlan_hdd_assoc.c index 44982e6dbeac..b839e3b19814 100644 --- a/CORE/HDD/src/wlan_hdd_assoc.c +++ b/CORE/HDD/src/wlan_hdd_assoc.c @@ -63,7 +63,9 @@ #include "wlan_hdd_tdls.h" #endif #include "sme_Api.h" - +#ifdef FEATURE_WLAN_FORCE_SAP_SCC +#include "wlan_hdd_hostapd.h" +#endif /* FEATURE_WLAN_FORCE_SAP_SCC */ #ifdef IPA_OFFLOAD #include <wlan_hdd_ipa.h> #endif @@ -1371,6 +1373,9 @@ static eHalStatus hdd_AssociationCompletionHandler( hdd_adapter_t *pAdapter, tCs struct net_device *dev = pAdapter->dev; hdd_context_t *pHddCtx = WLAN_HDD_GET_CTX(pAdapter); hdd_station_ctx_t *pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(pAdapter); +#ifdef FEATURE_WLAN_FORCE_SAP_SCC + hdd_adapter_t *pHostapdAdapter; +#endif /* FEATURE_WLAN_FORCE_SAP_SCC */ VOS_STATUS vosStatus = VOS_STATUS_E_FAILURE; v_U8_t reqRsnIe[DOT11F_IE_RSN_MAX_LEN]; tANI_U32 reqRsnLength = DOT11F_IE_RSN_MAX_LEN; @@ -1895,6 +1900,25 @@ static eHalStatus hdd_AssociationCompletionHandler( hdd_adapter_t *pAdapter, tCs } +#ifdef FEATURE_WLAN_FORCE_SAP_SCC + if (eCSR_ROAM_RESULT_ASSOCIATED == roamResult && + pHddCtx->cfg_ini->SapSccChanAvoidance) { + pHostapdAdapter = hdd_get_adapter(pHddCtx, WLAN_HDD_SOFTAP); + if (pHostapdAdapter != NULL) { + /* Restart SAP if its operating channel is different + * from AP channel. + */ + if (pHostapdAdapter->sessionCtx.ap.operatingChannel != + pRoamInfo->pBssDesc->channelId) { + hddLog(VOS_TRACE_LEVEL_ERROR, + "Restart Sap as SAP channel is %d and STA channel is %d", + pHostapdAdapter->sessionCtx.ap.operatingChannel, + pRoamInfo->pBssDesc->channelId); + hdd_restart_softap(pHddCtx, pHostapdAdapter); + } + } + } +#endif /* FEATURE_WLAN_FORCE_SAP_SCC */ return eHAL_STATUS_SUCCESS; } diff --git a/CORE/HDD/src/wlan_hdd_cfg.c b/CORE/HDD/src/wlan_hdd_cfg.c index 2d6aca3f95a9..fe1128316cb3 100644 --- a/CORE/HDD/src/wlan_hdd_cfg.c +++ b/CORE/HDD/src/wlan_hdd_cfg.c @@ -3769,6 +3769,15 @@ REG_TABLE_ENTRY g_registry_table[] = CFG_ENABLE_SELF_RECOVERY_DEFAULT, CFG_ENABLE_SELF_RECOVERY_MIN, CFG_ENABLE_SELF_RECOVERY_MAX ), + +#ifdef FEATURE_WLAN_FORCE_SAP_SCC + REG_VARIABLE(CFG_SAP_SCC_CHAN_AVOIDANCE, WLAN_PARAM_Integer, + hdd_config_t, SapSccChanAvoidance, + VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, + CFG_SAP_SCC_CHAN_AVOIDANCE_DEFAULT, + CFG_SAP_SCC_CHAN_AVOIDANCE_MIN, + CFG_SAP_SCC_CHAN_AVOIDANCE_MAX), +#endif /* FEATURE_WLAN_FORCE_SAP_SCC */ }; #ifdef WLAN_FEATURE_MBSSID diff --git a/CORE/HDD/src/wlan_hdd_cfg80211.c b/CORE/HDD/src/wlan_hdd_cfg80211.c index 6922626cfe6a..f075b29c573a 100644 --- a/CORE/HDD/src/wlan_hdd_cfg80211.c +++ b/CORE/HDD/src/wlan_hdd_cfg80211.c @@ -795,7 +795,7 @@ wlan_hdd_extscan_results_policy[QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_MAX + 1] = #endif /* FEATURE_WLAN_EXTSCAN */ -#ifdef FEATURE_WLAN_CH_AVOID +#if defined(FEATURE_WLAN_CH_AVOID) || defined(FEATURE_WLAN_FORCE_SAP_SCC) /* * FUNCTION: wlan_hdd_send_avoid_freq_event * This is called when wlan driver needs to send vendor specific @@ -841,7 +841,7 @@ int wlan_hdd_send_avoid_freq_event(hdd_context_t *pHddCtx, EXIT(); return 0; } -#endif /* FEATURE_WLAN_CH_AVOID */ +#endif /* FEATURE_WLAN_CH_AVOID || FEATURE_WLAN_FORCE_SAP_SCC */ #ifdef WLAN_FEATURE_NAN /* diff --git a/CORE/HDD/src/wlan_hdd_hostapd.c b/CORE/HDD/src/wlan_hdd_hostapd.c index fd5539428949..f4c97819d2d4 100644 --- a/CORE/HDD/src/wlan_hdd_hostapd.c +++ b/CORE/HDD/src/wlan_hdd_hostapd.c @@ -80,7 +80,9 @@ #include "cfgApi.h" #include "wniCfgAp.h" #include "wlan_hdd_misc.h" - +#ifdef FEATURE_WLAN_FORCE_SAP_SCC +#include <vos_utils.h> +#endif /* FEATURE_WLAN_FORCE_SAP_SCC */ #if defined CONFIG_CNSS #include <net/cnss.h> #endif @@ -549,6 +551,29 @@ VOS_STATUS hdd_set_sap_ht2040_mode(hdd_adapter_t *pHostapdAdapter, } #endif +#ifdef FEATURE_WLAN_FORCE_SAP_SCC +/**--------------------------------------------------------------------------- + \brief hdd_restart_softap() - + Restart SAP on STA channel to support + STA + SAP concurrency. + + --------------------------------------------------------------------------*/ +void hdd_restart_softap(hdd_context_t *pHddCtx, + hdd_adapter_t *pHostapdAdapter) +{ + tHddAvoidFreqList hdd_avoid_freq_list; + + /* generate vendor specific event */ + vos_mem_zero((void *)&hdd_avoid_freq_list, sizeof(tHddAvoidFreqList)); + hdd_avoid_freq_list.avoidFreqRange[0].startFreq = + vos_chan_to_freq(pHostapdAdapter->sessionCtx.ap.operatingChannel); + hdd_avoid_freq_list.avoidFreqRange[0].endFreq = + vos_chan_to_freq(pHostapdAdapter->sessionCtx.ap.operatingChannel); + hdd_avoid_freq_list.avoidFreqRangeCount = 1; + wlan_hdd_send_avoid_freq_event(pHddCtx, &hdd_avoid_freq_list); +} +#endif /* FEATURE_WLAN_FORCE_SAP_SCC */ + /**--------------------------------------------------------------------------- \brief hdd_hostapd_set_mac_address() - diff --git a/CORE/MAC/inc/sirApi.h b/CORE/MAC/inc/sirApi.h index a305c57cbdda..d1ecbeb6834e 100644 --- a/CORE/MAC/inc/sirApi.h +++ b/CORE/MAC/inc/sirApi.h @@ -4532,7 +4532,7 @@ typedef struct sSirRateUpdateInd } tSirRateUpdateInd, *tpSirRateUpdateInd; -#ifdef FEATURE_WLAN_CH_AVOID +#if defined(FEATURE_WLAN_CH_AVOID) || defined(FEATURE_WLAN_FORCE_SAP_SCC) #define SIR_CH_AVOID_MAX_RANGE 4 typedef struct sSirChAvoidFreqType @@ -4546,7 +4546,7 @@ typedef struct sSirChAvoidIndType tANI_U32 avoid_range_count; tSirChAvoidFreqType avoid_freq_range[SIR_CH_AVOID_MAX_RANGE]; } tSirChAvoidIndType; -#endif /* FEATURE_WLAN_CH_AVOID */ +#endif /* FEATURE_WLAN_CH_AVOID || FEATURE_WLAN_FORCE_SAP_SCC */ #define SIR_DFS_MAX_20M_SUB_CH 8 @@ -919,6 +919,10 @@ CDEFINES += -DCONFIG_HL_SUPPORT \ -DCONFIG_ATH_PROCFS_DIAG_SUPPORT endif +ifeq ($(CONFIG_QCA_WIFI_SDIO), 1) +CDEFINES += -DFEATURE_WLAN_FORCE_SAP_SCC +endif + ifeq ($(CONFIG_ARCH_MSM), y) CDEFINES += -DMSM_PLATFORM endif diff --git a/firmware_bin/WCNSS_qcom_cfg.ini b/firmware_bin/WCNSS_qcom_cfg.ini index d33bb65c66e0..11d08636418a 100755 --- a/firmware_bin/WCNSS_qcom_cfg.ini +++ b/firmware_bin/WCNSS_qcom_cfg.ini @@ -592,6 +592,11 @@ gEnableSifsBurst=1 # 1=Enable (default), 0=Disable gEnableMuBformee=1 +# Enable/Disable channel avoidance for SAP in SCC scenario +# 0 - disable +# 1 - enable +gSapSccChanAvoidance=0 + END # Note: Configuration parser would not read anything past the END marker |
