diff options
| author | Pitani Venkata Rajesh Kumar <vpitan@codeaurora.org> | 2014-06-18 18:26:11 +0530 |
|---|---|---|
| committer | Pitani Venkata Rajesh Kumar <vpitan@codeaurora.org> | 2014-06-18 18:28:45 +0530 |
| commit | 53d43e7e8b4586c82ae993ef297cf661b6d069c2 (patch) | |
| tree | 6b60c0efcb7d243234ac6f9e53b0645627eb9d20 | |
| parent | b000e4b5b5897f18bbcfda2530901f69965db222 (diff) | |
| parent | a97d642b74e7aa966ee6386a3041d8eb7c0ce8ba (diff) | |
Release 1.0.0.127 QCACLD WLAN Driver
Merge remote-tracking branch 'origin/caf/caf-wlan/master'
* origin/caf/caf-wlan/master:
Cafstaging Release 1.0.0.127
qcacld-new: Indicate WoW capacity to cfg80211 layer.
qcacld-new: create soft link for firmware binaries
qcacld:Changes to Load firmware files based on target version.
qcacld/wma: Dump header of Rx packet waking up host
qca-cld:sap ACS did not sort weightage for HT40 2.4G
qcacld: Downgrade athdiag proc entry permission
qcacld:hdd: Support OBSS & HT20/40 coexistence
qca-cld:sme: Support setting HT20/40 mode for SAP
qca-cld:lim: Add new message type for setting HT20/40 mode.
wlan: Dont send deauth for PMF sta,if auth received in connected state
qcacld: Fix hybrid session case for linkspeed estimation.
wlan: Protect add del and flush pmksa functions from SSR
qcacld: MAC: RA filtering in wow mode
qcacld: SME: Change API vos_concurrent_sessions_running naming
qcacld: HDD: RA filtering in wow mode
qcacld: WMA: RA filtering in wow mode
qcacld: TL: Change API vos_concurrent_sessions_running naming
qcacld: HDD_VOSS: Restrict creation of multi-port concurrency
wlan: Protect cfg80211 ops functions functions from SSR
Change-Id: Ie031a7fcf7ca1dfc5a167cea3220ed81485f8e2e
36 files changed, 1208 insertions, 142 deletions
diff --git a/Android.mk b/Android.mk index 1c9c8d01e7c8..d44ca6d5d208 100644 --- a/Android.mk +++ b/Android.mk @@ -85,6 +85,16 @@ $(shell ln -sf /firmware/image/bdwlan20.bin $(TARGET_OUT_ETC)/firmware/fakeboar. $(shell ln -sf /firmware/image/otp20.bin $(TARGET_OUT_ETC)/firmware/otp.bin) $(shell ln -sf /firmware/image/utf20.bin $(TARGET_OUT_ETC)/firmware/utf.bin) $(shell ln -sf /firmware/image/qwlan20.bin $(TARGET_OUT_ETC)/firmware/athwlan.bin) + +$(shell ln -sf /firmware/image/bdwlan20.bin $(TARGET_OUT_ETC)/firmware/bdwlan20.bin) +$(shell ln -sf /firmware/image/otp20.bin $(TARGET_OUT_ETC)/firmware/otp20.bin) +$(shell ln -sf /firmware/image/utf20.bin $(TARGET_OUT_ETC)/firmware/utf20.bin) +$(shell ln -sf /firmware/image/qwlan20.bin $(TARGET_OUT_ETC)/firmware/qwlan20.bin) + +$(shell ln -sf /firmware/image/bdwlan30.bin $(TARGET_OUT_ETC)/firmware/bdwlan30.bin) +$(shell ln -sf /firmware/image/otp30.bin $(TARGET_OUT_ETC)/firmware/otp30.bin) +$(shell ln -sf /firmware/image/utf30.bin $(TARGET_OUT_ETC)/firmware/utf30.bin) +$(shell ln -sf /firmware/image/qwlan30.bin $(TARGET_OUT_ETC)/firmware/qwlan30.bin) endif endif # DLKM check diff --git a/CORE/HDD/inc/wlan_hdd_cfg.h b/CORE/HDD/inc/wlan_hdd_cfg.h index 62f1cbb45c5d..e1b509e2ae07 100644 --- a/CORE/HDD/inc/wlan_hdd_cfg.h +++ b/CORE/HDD/inc/wlan_hdd_cfg.h @@ -2525,6 +2525,18 @@ This feature requires the dependent cfg.ini "gRoamPrefer5GHz" set to 1 */ #define CFG_SAP_MAX_OFFLOAD_REORDER_BUFFS_DEFAULT (2) #endif +#ifdef FEATURE_WLAN_RA_FILTERING +#define CFG_RA_FILTER_ENABLE_NAME "gRAFilterEnable" +#define CFG_RA_FILTER_ENABLE_MIN (0) +#define CFG_RA_FILTER_ENABLE_MAX (1) +#define CFG_RA_FILTER_ENABLE_DEFAULT (0) + +#define CFG_RA_RATE_LIMIT_INTERVAL_NAME "gRArateLimitInterval" +#define CFG_RA_RATE_LIMIT_INTERVAL_MIN (60) +#define CFG_RA_RATE_LIMIT_INTERVAL_MAX (300) +#define CFG_RA_RATE_LIMIT_INTERVAL_DEFAULT (60)/*60 SEC*/ +#endif + //Enable Memory Debug #ifdef MEMORY_DEBUG #define CFG_ENABLE_MEMORY_DEBUG_NAME "gEnableMemoryDebug" @@ -2580,6 +2592,18 @@ This feature requires the dependent cfg.ini "gRoamPrefer5GHz" set to 1 */ #define CFG_PMF_SA_QUERY_RETRY_INTERVAL_MAX ( 2000 ) #endif +#define CFG_MAX_CONCURRENT_CONNECTIONS_NAME "gMaxConcurrentActiveSessions" +#define CFG_MAX_CONCURRENT_CONNECTIONS_DEFAULT ( 2 ) +#define CFG_MAX_CONCURRENT_CONNECTIONS_MIN ( 1 ) +#define CFG_MAX_CONCURRENT_CONNECTIONS_MAX ( 4 ) + +#ifdef QCA_HT_2040_COEX +#define CFG_ENABLE_HT_2040_COEX "gHT2040CoexEnabled" +#define CFG_ENABLE_HT_2040_COEX_MIN ( 0 ) +#define CFG_ENABLE_HT_2040_COEX_MAX ( 1 ) +#define CFG_ENABLE_HT_2040_COEX_DEFAULT ( 0 ) +#endif + /*--------------------------------------------------------------------------- Type declarations -------------------------------------------------------------------------*/ @@ -2848,6 +2872,10 @@ typedef struct v_U8_t mcastBcastFilterSetting; v_BOOL_t fhostArpOffload; v_BOOL_t ssdp; +#ifdef FEATURE_WLAN_RA_FILTERING + v_BOOL_t IsRArateLimitEnabled; + v_U16_t RArateLimitInterval; +#endif #ifdef FEATURE_WLAN_SCAN_PNO v_BOOL_t PnoOffload; #endif @@ -3127,6 +3155,12 @@ typedef struct v_U32_t pmfSaQueryMaxRetries; v_U32_t pmfSaQueryRetryInterval; #endif + + v_U8_t gMaxConcurrentActiveSessions; + +#ifdef QCA_HT_2040_COEX + v_BOOL_t ht2040CoexEnabled; +#endif } hdd_config_t; #ifdef WLAN_FEATURE_MBSSID diff --git a/CORE/HDD/inc/wlan_hdd_hostapd.h b/CORE/HDD/inc/wlan_hdd_hostapd.h index f48ab2406448..f86caeb7f234 100644 --- a/CORE/HDD/inc/wlan_hdd_hostapd.h +++ b/CORE/HDD/inc/wlan_hdd_hostapd.h @@ -92,4 +92,8 @@ VOS_STATUS hdd_hostapd_SAPEventCB( tpSap_Event pSapEvent, v_PVOID_t usrDataForCa VOS_STATUS hdd_init_ap_mode( hdd_adapter_t *pAdapter ); void hdd_set_ap_ops( struct net_device *pWlanHostapdDev ); int hdd_hostapd_stop (struct net_device *dev); +#ifdef QCA_HT_2040_COEX +VOS_STATUS hdd_set_sap_ht2040_mode(hdd_adapter_t *pHostapdAdapter, + tANI_U8 channel_type); +#endif #endif // end #if !defined( WLAN_HDD_HOSTAPD_H ) diff --git a/CORE/HDD/inc/wlan_hdd_main.h b/CORE/HDD/inc/wlan_hdd_main.h index b261980e33fb..a7fca37173cc 100644 --- a/CORE/HDD/inc/wlan_hdd_main.h +++ b/CORE/HDD/inc/wlan_hdd_main.h @@ -1339,7 +1339,8 @@ struct hdd_context_s /** Concurrency Parameters*/ tVOS_CONCURRENCY_MODE concurrency_mode; - v_U16_t no_of_sessions[VOS_MAX_NO_OF_MODE + 1]; + v_U8_t no_of_open_sessions[VOS_MAX_NO_OF_MODE]; + v_U8_t no_of_active_sessions[VOS_MAX_NO_OF_MODE]; hdd_chip_reset_stats_t hddChipResetStats; /* Number of times riva restarted */ @@ -1543,8 +1544,14 @@ void wlan_hdd_set_monitor_tx_adapter( hdd_context_t *pHddCtx, hdd_adapter_t *pAd void hdd_cleanup_actionframe( hdd_context_t *pHddCtx, hdd_adapter_t *pAdapter ); void crda_regulatory_entry_default(v_U8_t *countryCode, int domain_id); -void wlan_hdd_set_concurrency_mode(hdd_context_t *pHddCtx, tVOS_CON_MODE mode); -void wlan_hdd_clear_concurrency_mode(hdd_context_t *pHddCtx, tVOS_CON_MODE mode); +void wlan_hdd_set_concurrency_mode(hdd_context_t *pHddCtx, + tVOS_CON_MODE mode); +void wlan_hdd_clear_concurrency_mode(hdd_context_t *pHddCtx, + tVOS_CON_MODE mode); +void wlan_hdd_incr_active_session(hdd_context_t *pHddCtx, + tVOS_CON_MODE mode); +void wlan_hdd_decr_active_session(hdd_context_t *pHddCtx, + tVOS_CON_MODE mode); void wlan_hdd_reset_prob_rspies(hdd_adapter_t* pHostapdAdapter); void hdd_prevent_suspend(void); void hdd_allow_suspend(void); @@ -1602,6 +1609,10 @@ static inline void hdd_stop_bus_bw_computer_timer(hdd_adapter_t *pAdapter) int hdd_wlan_startup(struct device *dev, void *hif_sc); void __hdd_wlan_exit(void); int hdd_wlan_notify_modem_power_state(int state); +#ifdef QCA_HT_2040_COEX +int hdd_wlan_set_ht2040_mode(hdd_adapter_t *pAdapter, v_U16_t staId, + v_MACADDR_t macAddrSTA, int width); +#endif #ifdef FEATURE_WLAN_BATCH_SCAN /**--------------------------------------------------------------------------- diff --git a/CORE/HDD/src/wlan_hdd_assoc.c b/CORE/HDD/src/wlan_hdd_assoc.c index e35c4e5a049e..644a9d1e54dc 100644 --- a/CORE/HDD/src/wlan_hdd_assoc.c +++ b/CORE/HDD/src/wlan_hdd_assoc.c @@ -654,6 +654,7 @@ static void hdd_SendAssociationEvent(struct net_device *dev,tCsrRoamInfo *pCsrRo return; } + wlan_hdd_incr_active_session(pHddCtx, pAdapter->device_mode); memcpy(wrqu.ap_addr.sa_data, pCsrRoamInfo->pBssDesc->bssId, sizeof(pCsrRoamInfo->pBssDesc->bssId)); type = WLAN_STA_ASSOC_DONE_IND; @@ -728,6 +729,7 @@ static void hdd_SendAssociationEvent(struct net_device *dev,tCsrRoamInfo *pCsrRo } else if (eConnectionState_IbssConnected == pHddStaCtx->conn_info.connState) // IBss Associated { + wlan_hdd_incr_active_session(pHddCtx, pAdapter->device_mode); memcpy(wrqu.ap_addr.sa_data, pHddStaCtx->conn_info.bssId, ETH_ALEN); type = WLAN_STA_ASSOC_DONE_IND; pr_info("wlan: new IBSS connection to " MAC_ADDRESS_STR"\n", @@ -902,11 +904,13 @@ static eHalStatus hdd_DisConnectHandler( hdd_adapter_t *pAdapter, tCsrRoamInfo * } /* If only STA mode is on */ - if((pHddCtx->concurrency_mode <= 1) && (pHddCtx->no_of_sessions[WLAN_HDD_INFRA_STATION] <=1)) + if((pHddCtx->concurrency_mode <= 1) && + (pHddCtx->no_of_open_sessions[WLAN_HDD_INFRA_STATION] <=1)) { pHddCtx->isAmpAllowed = VOS_TRUE; } hdd_clearRoamProfileIe( pAdapter ); + wlan_hdd_decr_active_session(pHddCtx, pAdapter->device_mode); // indicate 'disconnect' status to wpa_supplicant... hdd_SendAssociationEvent(dev,pRoamInfo); @@ -971,8 +975,8 @@ static eHalStatus hdd_DisConnectHandler( hdd_adapter_t *pAdapter, tCsrRoamInfo * if(NULL != pHddCtx) { //Only P2P Client is there Enable Bmps back - if((0 == pHddCtx->no_of_sessions[VOS_STA_SAP_MODE]) && - (0 == pHddCtx->no_of_sessions[VOS_P2P_GO_MODE])) + if((0 == pHddCtx->no_of_open_sessions[VOS_STA_SAP_MODE]) && + (0 == pHddCtx->no_of_open_sessions[VOS_P2P_GO_MODE])) { if (pHddCtx->hdd_wlan_suspended) { @@ -1233,24 +1237,22 @@ static void hdd_SendReAssocEvent(struct net_device *dev, hdd_adapter_t *pAdapter { unsigned int len = 0; u8 *pFTAssocRsp = NULL; + hdd_context_t *pHddCtx = WLAN_HDD_GET_CTX(pAdapter); v_U8_t *rspRsnIe = kmalloc(IW_GENERIC_IE_MAX, GFP_KERNEL); tANI_U32 rspRsnLength = 0; struct ieee80211_channel *chan; - if (!rspRsnIe) - { + if (!rspRsnIe) { hddLog(LOGE, "%s: Unable to allocate RSN IE", __func__); return; } - if (pCsrRoamInfo == NULL) - { + if (pCsrRoamInfo == NULL) { hddLog(LOGE, "%s: Invalid CSR roam info", __func__); goto done; } - if (pCsrRoamInfo->nAssocRspLength == 0) - { + if (pCsrRoamInfo->nAssocRspLength == 0) { hddLog(LOGE, "%s: Invalid assoc response length", __func__); goto done; } @@ -1266,6 +1268,15 @@ static void hdd_SendReAssocEvent(struct net_device *dev, hdd_adapter_t *pAdapter (unsigned int)pFTAssocRsp[0], (unsigned int)pFTAssocRsp[1]); + /* Active session count is decremented upon disconnection, but during + * roaming, there is no disconnect indication and hence active session + * count is not decremented. + * After roaming is completed, active session count is incremented + * as a part of connect indication but effectively after roaming the + * active session count should still be the same and hence upon + * successful reassoc decrement the active session count here */ + wlan_hdd_decr_active_session(pHddCtx, pAdapter->device_mode); + // Send the Assoc Resp, the supplicant needs this for initial Auth. len = pCsrRoamInfo->nAssocRspLength - FT_ASSOC_RSP_IES_OFFSET; rspRsnLength = len; @@ -1342,7 +1353,6 @@ static eHalStatus hdd_AssociationCompletionHandler( hdd_adapter_t *pAdapter, tCs // indicate 'connect' status to userspace hdd_SendAssociationEvent(dev,pRoamInfo); - // Initialize the Linkup event completion variable INIT_COMPLETION(pAdapter->linkup_event_var); @@ -1647,7 +1657,8 @@ static eHalStatus hdd_AssociationCompletionHandler( hdd_adapter_t *pAdapter, tCs /*Handle all failure conditions*/ hdd_connSetConnectionState( pHddStaCtx, eConnectionState_NotConnected); - if((pHddCtx->concurrency_mode <= 1) && (pHddCtx->no_of_sessions[WLAN_HDD_INFRA_STATION] <=1)) + if((pHddCtx->concurrency_mode <= 1) && + (pHddCtx->no_of_open_sessions[WLAN_HDD_INFRA_STATION] <=1)) { pHddCtx->isAmpAllowed = VOS_TRUE; } @@ -1661,7 +1672,7 @@ static eHalStatus hdd_AssociationCompletionHandler( hdd_adapter_t *pAdapter, tCs // If ps offload is enabled, fw will take care in case of concurrency. if(((WLAN_HDD_INFRA_STATION == pAdapter->device_mode) || (WLAN_HDD_P2P_CLIENT == pAdapter->device_mode)) && - (vos_concurrent_sessions_running()) && + (vos_concurrent_open_sessions_running()) && !pHddCtx->cfg_ini->enablePowersaveOffload) { //Enable BMPS only of other Session is P2P Client @@ -1675,8 +1686,8 @@ static eHalStatus hdd_AssociationCompletionHandler( hdd_adapter_t *pAdapter, tCs if(NULL != pHddCtx) { //Only P2P Client is there Enable Bmps back - if((0 == pHddCtx->no_of_sessions[VOS_STA_SAP_MODE]) && - (0 == pHddCtx->no_of_sessions[VOS_P2P_GO_MODE])) + if((0 == pHddCtx->no_of_open_sessions[VOS_STA_SAP_MODE]) && + (0 == pHddCtx->no_of_open_sessions[VOS_P2P_GO_MODE])) { if (pHddCtx->hdd_wlan_suspended) { diff --git a/CORE/HDD/src/wlan_hdd_cfg.c b/CORE/HDD/src/wlan_hdd_cfg.c index 42426031484d..3dafdf323ed3 100644 --- a/CORE/HDD/src/wlan_hdd_cfg.c +++ b/CORE/HDD/src/wlan_hdd_cfg.c @@ -2061,6 +2061,22 @@ REG_TABLE_ENTRY g_registry_table[] = CFG_ENABLE_HOST_ARPOFFLOAD_MIN, CFG_ENABLE_HOST_ARPOFFLOAD_MAX ), +#ifdef FEATURE_WLAN_RA_FILTERING + REG_VARIABLE( CFG_RA_FILTER_ENABLE_NAME, WLAN_PARAM_Integer, + hdd_config_t, IsRArateLimitEnabled, + VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, + CFG_RA_FILTER_ENABLE_DEFAULT, + CFG_RA_FILTER_ENABLE_MIN, + CFG_RA_FILTER_ENABLE_MAX ), + + REG_VARIABLE( CFG_RA_RATE_LIMIT_INTERVAL_NAME, WLAN_PARAM_Integer, + hdd_config_t, RArateLimitInterval, + VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, + CFG_RA_RATE_LIMIT_INTERVAL_DEFAULT, + CFG_RA_RATE_LIMIT_INTERVAL_MIN, + CFG_RA_RATE_LIMIT_INTERVAL_MAX ), +#endif + REG_VARIABLE( CFG_ENABLE_HOST_SSDP_NAME, WLAN_PARAM_Integer, hdd_config_t, ssdp, VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, @@ -3568,6 +3584,21 @@ REG_TABLE_ENTRY g_registry_table[] = CFG_PMF_SA_QUERY_RETRY_INTERVAL_MIN, CFG_PMF_SA_QUERY_RETRY_INTERVAL_MAX ), #endif + REG_VARIABLE(CFG_MAX_CONCURRENT_CONNECTIONS_NAME, WLAN_PARAM_Integer, + hdd_config_t, gMaxConcurrentActiveSessions, + VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, + CFG_MAX_CONCURRENT_CONNECTIONS_DEFAULT, + CFG_MAX_CONCURRENT_CONNECTIONS_MIN, + CFG_MAX_CONCURRENT_CONNECTIONS_MAX ), + +#ifdef QCA_HT_2040_COEX + REG_VARIABLE(CFG_ENABLE_HT_2040_COEX, WLAN_PARAM_Integer, + hdd_config_t, ht2040CoexEnabled, + VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, + CFG_ENABLE_HT_2040_COEX_DEFAULT, + CFG_ENABLE_HT_2040_COEX_MIN, + CFG_ENABLE_HT_2040_COEX_MAX ), +#endif }; #ifdef WLAN_FEATURE_MBSSID @@ -3947,6 +3978,10 @@ static void print_hdd_cfg(hdd_context_t *pHddCtx) VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO_HIGH, "Name = [mcastBcastFilterSetting] Value = [%u] ",pHddCtx->cfg_ini->mcastBcastFilterSetting); VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO_HIGH, "Name = [fhostArpOffload] Value = [%u] ",pHddCtx->cfg_ini->fhostArpOffload); VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO_HIGH, "Name = [ssdp] Value = [%u] ", pHddCtx->cfg_ini->ssdp); +#ifdef FEATURE_WLAN_RA_FILTERING + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO_HIGH, "Name = [RArateLimitInterval] Value = [%u] ", pHddCtx->cfg_ini->RArateLimitInterval); + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO_HIGH, "Name = [IsRArateLimitEnabled] Value = [%u] ", pHddCtx->cfg_ini->IsRArateLimitEnabled); +#endif #ifdef WLAN_FEATURE_VOWIFI_11R VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO_HIGH, "Name = [fFTResourceReqSupported] Value = [%u] ",pHddCtx->cfg_ini->fFTResourceReqSupported); #endif @@ -4050,6 +4085,7 @@ static void print_hdd_cfg(hdd_context_t *pHddCtx) VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO_HIGH, "Name = [gMaxOffloadReorderBuffs] value = [%u] ",pHddCtx->cfg_ini->apMaxOffloadReorderBuffs); VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO_HIGH, "Name = [overrideCountryCode] Value = [%s] ",pHddCtx->cfg_ini->overrideCountryCode); VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO_HIGH, "Name = [gAllowDFSChannelRoam] Value = [%u] ",pHddCtx->cfg_ini->allowDFSChannelRoam); + hddLog(VOS_TRACE_LEVEL_INFO_HIGH, "Name = [gMaxConcurrentActiveSessions] Value = [%u] ", pHddCtx->cfg_ini->gMaxConcurrentActiveSessions); #ifdef MSM_PLATFORM VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO_HIGH, @@ -4065,6 +4101,12 @@ static void print_hdd_cfg(hdd_context_t *pHddCtx) "Name = [gbusBandwidthComputeInterval] Value = [%u] ", pHddCtx->cfg_ini->busBandwidthComputeInterval); #endif + +#ifdef QCA_HT_2040_COEX + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO_HIGH, + "Name = [gHT2040CoexEnabled] Value = [%u]", + pHddCtx->cfg_ini->ht2040CoexEnabled); +#endif } diff --git a/CORE/HDD/src/wlan_hdd_cfg80211.c b/CORE/HDD/src/wlan_hdd_cfg80211.c index ab063e59c4d1..a880933e62c9 100644 --- a/CORE/HDD/src/wlan_hdd_cfg80211.c +++ b/CORE/HDD/src/wlan_hdd_cfg80211.c @@ -1186,6 +1186,11 @@ int wlan_hdd_cfg80211_init(struct device *dev, wiphy->max_ap_assoc_sta = pCfg->maxNumberOfPeers; +#ifdef QCA_HT_2040_COEX + if (pCfg->ht2040CoexEnabled) + wiphy->features |= NL80211_FEATURE_AP_MODE_CHAN_WIDTH_CHANGE; +#endif + EXIT(); return 0; } @@ -2079,6 +2084,33 @@ static int wlan_hdd_cfg80211_set_channel( struct wiphy *wiphy, struct net_device } (WLAN_HDD_GET_AP_CTX_PTR(pAdapter))->sapConfig.channel = channel; } + + /* set channel bonding mode for 2.4G */ + if ( channel <= 14 ) + { + tSmeConfigParams smeConfig; + sme_GetConfigParam(pHddCtx->hHal, &smeConfig); + + switch (channel_type) + { + case NL80211_CHAN_HT20: + smeConfig.csrConfig.channelBondingMode24GHz = 0; + sme_UpdateConfig(pHddCtx->hHal, &smeConfig); + break; + + case NL80211_CHAN_HT40MINUS: + case NL80211_CHAN_HT40PLUS: + smeConfig.csrConfig.channelBondingMode24GHz = 1; + sme_UpdateConfig(pHddCtx->hHal, &smeConfig); + break; + + default: + hddLog(VOS_TRACE_LEVEL_ERROR, + "%s:Error!!! Invalid HT20/40 mode !", + __func__); + return -EINVAL; + } + } } } else @@ -2624,6 +2656,11 @@ static int wlan_hdd_cfg80211_start_bss(hdd_adapter_t *pHostapdAdapter, return 0; } + if (vos_max_concurrent_connections_reached()) { + hddLog(VOS_TRACE_LEVEL_DEBUG, FL("Reached max concurrent connections")); + return -EINVAL; + } + pConfig->persona = pHostapdAdapter->device_mode; psmeConfig = (tSmeConfigParams*) vos_mem_malloc(sizeof(tSmeConfigParams)); @@ -2689,6 +2726,7 @@ static int wlan_hdd_cfg80211_start_bss(hdd_adapter_t *pHostapdAdapter, //Succesfully started Bss update the state bit. set_bit(SOFTAP_BSS_STARTED, &pHostapdAdapter->event_flags); + wlan_hdd_incr_active_session(pHddCtx, pHostapdAdapter->device_mode); #ifdef WLAN_FEATURE_P2P_DEBUG if (pHostapdAdapter->device_mode == WLAN_HDD_P2P_GO) @@ -2740,6 +2778,11 @@ static int wlan_hdd_cfg80211_add_beacon(struct wiphy *wiphy, return status; } + if (vos_max_concurrent_connections_reached()) { + hddLog(VOS_TRACE_LEVEL_DEBUG, FL("Reached max concurrent connections")); + return -EINVAL; + } + if ( (pAdapter->device_mode == WLAN_HDD_SOFTAP) || (pAdapter->device_mode == WLAN_HDD_P2P_GO) ) @@ -2955,6 +2998,8 @@ static int wlan_hdd_cfg80211_stop_ap (struct wiphy *wiphy, } } clear_bit(SOFTAP_BSS_STARTED, &pAdapter->event_flags); + /* BSS stopped, clear the active sessions for this device mode */ + wlan_hdd_decr_active_session(pHddCtx, pAdapter->device_mode); } mutex_unlock(&pHddCtx->sap_lock); @@ -3050,6 +3095,11 @@ static int wlan_hdd_cfg80211_start_ap(struct wiphy *wiphy, hddLog(VOS_TRACE_LEVEL_INFO_HIGH, "%s: pAdapter = %p, device mode = %d", __func__, pAdapter, pAdapter->device_mode); + if (vos_max_concurrent_connections_reached()) { + hddLog(VOS_TRACE_LEVEL_DEBUG, FL("Reached max concurrent connections")); + return -EINVAL; + } + if ((pAdapter->device_mode == WLAN_HDD_SOFTAP) || (pAdapter->device_mode == WLAN_HDD_P2P_GO) ) @@ -3161,7 +3211,7 @@ static int wlan_hdd_cfg80211_change_beacon(struct wiphy *wiphy, #endif //(LINUX_VERSION_CODE > KERNEL_VERSION(3,3,0)) -static int wlan_hdd_cfg80211_change_bss (struct wiphy *wiphy, +static int __wlan_hdd_cfg80211_change_bss (struct wiphy *wiphy, struct net_device *dev, struct bss_parameters *params) { @@ -3246,6 +3296,18 @@ static int wlan_hdd_change_iface_to_sta_mode(struct net_device *ndev, return status; } +static int wlan_hdd_cfg80211_change_bss (struct wiphy *wiphy, + struct net_device *dev, + struct bss_parameters *params) +{ + int ret; + + vos_ssr_protect(__func__); + ret = __wlan_hdd_cfg80211_change_bss(wiphy, dev, params); + vos_ssr_unprotect(__func__); + + return ret; +} /* FUNCTION: wlan_hdd_change_country_code_cd * to wait for contry code completion */ @@ -3308,6 +3370,11 @@ static int __wlan_hdd_cfg80211_change_iface(struct wiphy *wiphy, hddLog(VOS_TRACE_LEVEL_INFO, "%s: device_mode = %d, IFTYPE = 0x%x", __func__, pAdapter->device_mode, type); + if (vos_max_concurrent_connections_reached()) { + hddLog(VOS_TRACE_LEVEL_DEBUG, FL("Reached max concurrent connections")); + return -EINVAL; + } + pConfig = pHddCtx->cfg_ini; wdev = ndev->ieee80211_ptr; @@ -3701,7 +3768,7 @@ done: #ifdef WLAN_BTAMP_FEATURE if((NL80211_IFTYPE_STATION == type) && (pHddCtx->concurrency_mode <= 1) && - (pHddCtx->no_of_sessions[WLAN_HDD_INFRA_STATION] <=1)) + (pHddCtx->no_of_open_sessions[WLAN_HDD_INFRA_STATION] <=1)) { //we are ok to do AMP pHddCtx->isAmpAllowed = VOS_TRUE; @@ -6935,9 +7002,8 @@ static int wlan_hdd_try_disconnect( hdd_adapter_t *pAdapter ) } /* - * FUNCTION: __wlan_hdd_cfg80211_set_privacy - * This function is used to initialize the security - * parameters during connect operation. + * FUNCTION: __wlan_hdd_cfg80211_connect + * This function is used to start the association process */ static int __wlan_hdd_cfg80211_connect( struct wiphy *wiphy, struct net_device *ndev, @@ -6951,11 +7017,10 @@ static int __wlan_hdd_cfg80211_connect( struct wiphy *wiphy, ENTER(); - if (!pAdapter) - { + if (!pAdapter) { VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, "%s: Adapter context is null", __func__); - return VOS_STATUS_E_FAILURE; + return -EINVAL; } MTRACE(vos_trace(VOS_MODULE_ID_HDD, @@ -6965,25 +7030,27 @@ static int __wlan_hdd_cfg80211_connect( struct wiphy *wiphy, "%s: device_mode = %d",__func__,pAdapter->device_mode); pHddCtx = WLAN_HDD_GET_CTX(pAdapter); - if (!pHddCtx) - { + if (!pHddCtx) { VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, "%s: HDD context is null", __func__); - return VOS_STATUS_E_FAILURE; + return -EINVAL; } status = wlan_hdd_validate_context(pHddCtx); - if (0 != status) - { + if (0 != status) { VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, "%s: HDD context is not valid", __func__); return status; } + if (vos_max_concurrent_connections_reached()) { + hddLog(VOS_TRACE_LEVEL_DEBUG, FL("Reached max concurrent connections")); + return -ECONNREFUSED; + } + #ifdef WLAN_BTAMP_FEATURE //Infra connect not supported when AMP traffic is on. - if( VOS_TRUE == WLANBAP_AmpSessionOn() ) - { + if (VOS_TRUE == WLANBAP_AmpSessionOn()) { hddLog(VOS_TRACE_LEVEL_ERROR, "%s: No connection when AMP is on", __func__); return -ECONNREFUSED; @@ -6994,15 +7061,14 @@ static int __wlan_hdd_cfg80211_connect( struct wiphy *wiphy, //P2P Mode will be taken care in Open/close adapter if (!pHddCtx->cfg_ini->enablePowersaveOffload && (WLAN_HDD_INFRA_STATION == pAdapter->device_mode) && - (vos_concurrent_sessions_running())) - { - exitbmpsStatus = hdd_disable_bmps_imps(pHddCtx, WLAN_HDD_INFRA_STATION); + (vos_concurrent_open_sessions_running())) { + exitbmpsStatus = hdd_disable_bmps_imps(pHddCtx, + WLAN_HDD_INFRA_STATION); } /*Try disconnecting if already in connected state*/ status = wlan_hdd_try_disconnect(pAdapter); - if ( 0 > status) - { + if ( 0 > status) { hddLog(VOS_TRACE_LEVEL_ERROR, FL("Failed to disconnect the existing" " connection")); return -EALREADY; @@ -7011,42 +7077,35 @@ static int __wlan_hdd_cfg80211_connect( struct wiphy *wiphy, /*initialise security parameters*/ status = wlan_hdd_cfg80211_set_privacy(pAdapter, req); - if ( 0 > status) - { + if (0 > status) { hddLog(VOS_TRACE_LEVEL_ERROR, "%s: failed to set security params", __func__); return status; } - if ( req->channel ) - { + if (req->channel) { status = wlan_hdd_cfg80211_connect_start(pAdapter, req->ssid, req->ssid_len, req->bssid, req->channel->hw_value); - } - else - { + } else { status = wlan_hdd_cfg80211_connect_start(pAdapter, req->ssid, req->ssid_len, req->bssid, 0); } - if (0 > status) - { + if (0 > status) { //ReEnable BMPS if disabled // If PS offload is enabled, fw will take care of // ps in cae of concurrency. if((VOS_STATUS_SUCCESS == exitbmpsStatus) && - (NULL != pHddCtx) && !pHddCtx->cfg_ini->enablePowersaveOffload) - { - if (pHddCtx->hdd_wlan_suspended) - { + (NULL != pHddCtx) && !pHddCtx->cfg_ini->enablePowersaveOffload) { + if (pHddCtx->hdd_wlan_suspended) { hdd_set_pwrparams(pHddCtx); } //ReEnable Bmps and Imps back hdd_enable_bmps_imps(pHddCtx); } - hddLog(VOS_TRACE_LEVEL_ERROR, "%s: connect failed", __func__); + hddLog(VOS_TRACE_LEVEL_ERROR, FL("connect failed")); return status; } pHddCtx->isAmpAllowed = VOS_FALSE; @@ -7392,6 +7451,11 @@ static int wlan_hdd_cfg80211_join_ibss( struct wiphy *wiphy, return -EIO; } + if (vos_max_concurrent_connections_reached()) { + hddLog(VOS_TRACE_LEVEL_DEBUG, FL("Reached max concurrent connections")); + return -ECONNREFUSED; + } + /*Try disconnecting if already in connected state*/ status = wlan_hdd_try_disconnect(pAdapter); if ( 0 > status) @@ -7603,11 +7667,11 @@ static int wlan_hdd_cfg80211_leave_ibss( struct wiphy *wiphy, } /* - * FUNCTION: wlan_hdd_cfg80211_set_wiphy_params + * FUNCTION: __wlan_hdd_cfg80211_set_wiphy_params * This function is used to set the phy parameters * (RTS Threshold/FRAG Threshold/Retry Count etc ...) */ -static int wlan_hdd_cfg80211_set_wiphy_params(struct wiphy *wiphy, +static int __wlan_hdd_cfg80211_set_wiphy_params(struct wiphy *wiphy, u32 changed) { hdd_context_t *pHddCtx = wiphy_priv(wiphy); @@ -7730,14 +7794,27 @@ static int wlan_hdd_cfg80211_set_wiphy_params(struct wiphy *wiphy, } } + return 0; } +static int wlan_hdd_cfg80211_set_wiphy_params(struct wiphy *wiphy, + u32 changed) +{ + int ret; + + vos_ssr_protect(__func__); + ret = __wlan_hdd_cfg80211_set_wiphy_params(wiphy, changed); + vos_ssr_unprotect(__func__); + + return ret; +} + /* - * FUNCTION: wlan_hdd_cfg80211_set_txpower + * FUNCTION: __wlan_hdd_cfg80211_set_txpower * This function is used to set the txpower */ -static int wlan_hdd_cfg80211_set_txpower(struct wiphy *wiphy, +static int __wlan_hdd_cfg80211_set_txpower(struct wiphy *wiphy, #if LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0) struct wireless_dev *wdev, #endif @@ -7803,6 +7880,34 @@ static int wlan_hdd_cfg80211_set_txpower(struct wiphy *wiphy, return 0; } +static int wlan_hdd_cfg80211_set_txpower(struct wiphy *wiphy, +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0) + struct wireless_dev *wdev, +#endif +#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,35) + enum tx_power_setting type, +#else + enum nl80211_tx_power_setting type, +#endif + int dbm) +{ + int ret; + vos_ssr_protect(__func__); + ret = __wlan_hdd_cfg80211_set_txpower(wiphy, +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0) + wdev, +#endif +#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,35) + type, +#else + type, +#endif + dbm); + vos_ssr_unprotect(__func__); + + return ret; +} + /* * FUNCTION: wlan_hdd_cfg80211_get_txpower * This function is used to read the txpower @@ -8625,7 +8730,7 @@ static int wlan_hdd_cfg80211_add_station(struct wiphy *wiphy, #ifdef FEATURE_WLAN_LFR -static int wlan_hdd_cfg80211_set_pmksa(struct wiphy *wiphy, struct net_device *dev, +static int __wlan_hdd_cfg80211_set_pmksa(struct wiphy *wiphy, struct net_device *dev, struct cfg80211_pmksa *pmksa) { tANI_U32 j=0; @@ -8719,9 +8824,20 @@ static int wlan_hdd_cfg80211_set_pmksa(struct wiphy *wiphy, struct net_device *d return HAL_STATUS_SUCCESS(result) ? 0 : -EINVAL; } +static int wlan_hdd_cfg80211_set_pmksa(struct wiphy *wiphy, struct net_device *dev, + struct cfg80211_pmksa *pmksa) +{ + int ret; + vos_ssr_protect(__func__); + ret = __wlan_hdd_cfg80211_set_pmksa(wiphy, dev, pmksa); + vos_ssr_unprotect(__func__); -static int wlan_hdd_cfg80211_del_pmksa(struct wiphy *wiphy, struct net_device *dev, + return ret; +} + + +static int __wlan_hdd_cfg80211_del_pmksa(struct wiphy *wiphy, struct net_device *dev, struct cfg80211_pmksa *pmksa) { tANI_U32 j=0; @@ -8825,8 +8941,20 @@ static int wlan_hdd_cfg80211_del_pmksa(struct wiphy *wiphy, struct net_device *d } +static int wlan_hdd_cfg80211_del_pmksa(struct wiphy *wiphy, struct net_device *dev, + struct cfg80211_pmksa *pmksa) +{ + int ret; + + vos_ssr_protect(__func__); + ret = __wlan_hdd_cfg80211_del_pmksa(wiphy, dev, pmksa); + vos_ssr_unprotect(__func__); -static int wlan_hdd_cfg80211_flush_pmksa(struct wiphy *wiphy, struct net_device *dev) + return ret; + +} + +static int __wlan_hdd_cfg80211_flush_pmksa(struct wiphy *wiphy, struct net_device *dev) { tANI_U32 j=0; hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR(dev); @@ -8890,6 +9018,17 @@ static int wlan_hdd_cfg80211_flush_pmksa(struct wiphy *wiphy, struct net_device return status; } + +static int wlan_hdd_cfg80211_flush_pmksa(struct wiphy *wiphy, struct net_device *dev) +{ + int ret; + + vos_ssr_protect(__func__); + ret = __wlan_hdd_cfg80211_flush_pmksa(wiphy, dev); + vos_ssr_unprotect(__func__); + + return ret; +} #endif #if defined(WLAN_FEATURE_VOWIFI_11R) && defined(KERNEL_SUPPORT_11R_CFG80211) @@ -10967,6 +11106,108 @@ int wlan_hdd_cfg80211_suspend_wlan(struct wiphy *wiphy, return ret; } + +#ifdef QCA_HT_2040_COEX +int wlan_hdd_cfg80211_set_ap_channel_width(struct wiphy *wiphy, + struct net_device *dev, + struct cfg80211_chan_def *chandef) +{ + hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR(dev); + hdd_context_t *pHddCtx; + VOS_STATUS status; + tSmeConfigParams smeConfig; + int i; + bool cbModeChange; + + if (NULL == pAdapter) { + VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL, + "%s: HDD adapter is Null", __func__); + return -ENODEV; + } + + if (NULL == wiphy) { + VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL, + "%s: wiphy is Null", __func__); + return -ENODEV; + } + + pHddCtx = WLAN_HDD_GET_CTX(pAdapter); + status = wlan_hdd_validate_context(pHddCtx); + + if (0 != status) { + VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: HDD context is not valid", __func__); + return status; + } + + if (!pHddCtx->cfg_ini->ht2040CoexEnabled) + return -EOPNOTSUPP; + + vos_mem_zero(&smeConfig, sizeof (tSmeConfigParams)); + sme_GetConfigParam(pHddCtx->hHal, &smeConfig); + switch (chandef->width) { + case NL80211_CHAN_WIDTH_20: + if (smeConfig.csrConfig.channelBondingMode24GHz != 0) { + smeConfig.csrConfig.channelBondingMode24GHz = 0; + sme_UpdateConfig(pHddCtx->hHal, &smeConfig); + cbModeChange = TRUE; + } + break; + + case NL80211_CHAN_WIDTH_40: + if (smeConfig.csrConfig.channelBondingMode24GHz != 1) { + smeConfig.csrConfig.channelBondingMode24GHz = 1; + sme_UpdateConfig(pHddCtx->hHal, &smeConfig); + cbModeChange = TRUE; + } + break; + + default: + hddLog(VOS_TRACE_LEVEL_ERROR, + "%s:Error!!! Invalid HT20/40 mode !", + __func__); + return -EINVAL; + } + + if (!cbModeChange) + return 0; + + if (WLAN_HDD_SOFTAP != pAdapter->device_mode) + return 0; + + hddLog(VOS_TRACE_LEVEL_INFO, "%s: channel bonding changed to %d", + __func__, smeConfig.csrConfig.channelBondingMode24GHz); + + /* change SAP ht2040 mode */ + status = hdd_set_sap_ht2040_mode(pAdapter, + cfg80211_get_chandef_type(chandef)); + if (status != VOS_STATUS_SUCCESS) { + hddLog(VOS_TRACE_LEVEL_ERROR, + "%s:Error!!! Cannot set SAP HT20/40 mode!", + __func__); + return -EINVAL; + } + + for (i = 0; i < WLAN_MAX_STA_COUNT; i++) { + if (!pAdapter->aStaInfo[i].isUsed) + continue; + + status = hdd_wlan_set_ht2040_mode(pAdapter, + pAdapter->aStaInfo[i].ucSTAId, + pAdapter->aStaInfo[i].macAddrSTA, + cfg80211_get_chandef_type(chandef)); + if (status != VOS_STATUS_SUCCESS) { + hddLog(VOS_TRACE_LEVEL_ERROR, + "%s:Error!!! Cannot set HT20/40 mode for STA %d!", + __func__, pAdapter->aStaInfo[i].ucSTAId); + return -EINVAL; + } + } + + return 0; +} +#endif + /* cfg80211_ops */ static struct cfg80211_ops wlan_hdd_cfg80211_ops = { @@ -11034,5 +11275,8 @@ static struct cfg80211_ops wlan_hdd_cfg80211_ops = #ifdef WLAN_NL80211_TESTMODE .testmode_cmd = wlan_hdd_cfg80211_testmode, #endif +#ifdef QCA_HT_2040_COEX + .set_ap_chanwidth = wlan_hdd_cfg80211_set_ap_channel_width, +#endif .dump_survey = wlan_hdd_cfg80211_dump_survey, }; diff --git a/CORE/HDD/src/wlan_hdd_hostapd.c b/CORE/HDD/src/wlan_hdd_hostapd.c index abd494877848..caa16d848e04 100644 --- a/CORE/HDD/src/wlan_hdd_hostapd.c +++ b/CORE/HDD/src/wlan_hdd_hostapd.c @@ -421,6 +421,35 @@ static int hdd_hostapd_ioctl(struct net_device *dev, return ret; } +#ifdef QCA_HT_2040_COEX +VOS_STATUS hdd_set_sap_ht2040_mode(hdd_adapter_t *pHostapdAdapter, + tANI_U8 channel_type) +{ + eHalStatus halStatus = eHAL_STATUS_FAILURE; + v_PVOID_t hHal = NULL; + + VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_HIGH, + "%s: change HT20/40 mode", __func__); + + if (WLAN_HDD_SOFTAP == pHostapdAdapter->device_mode) { + hHal = WLAN_HDD_GET_HAL_CTX(pHostapdAdapter); + if ( NULL == hHal ) { + VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR, + "%s: Hal ctx is null", __func__); + return VOS_STATUS_E_FAULT; + } + halStatus = sme_SetHT2040Mode(hHal, pHostapdAdapter->sessionId, + channel_type); + if (halStatus == eHAL_STATUS_FAILURE ) { + VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR, + "%s: Failed to change HT20/40 mode", __func__); + return VOS_STATUS_E_FAILURE; + } + } + return VOS_STATUS_SUCCESS; +} +#endif + /**--------------------------------------------------------------------------- \brief hdd_hostapd_set_mac_address() - @@ -460,7 +489,7 @@ void hdd_hostapd_inactivity_timer_cb(v_PVOID_t usrDataForCallback) ENTER(); #ifdef DISABLE_CONCURRENCY_AUTOSAVE - if (vos_concurrent_sessions_running()) + if (vos_concurrent_open_sessions_running()) { /* This timer routine is going to be called only when AP @@ -542,9 +571,19 @@ void hdd_clear_all_sta(hdd_adapter_t *pHostapdAdapter, v_PVOID_t usrDataForCallb static int hdd_stop_p2p_link(hdd_adapter_t *pHostapdAdapter,v_PVOID_t usrDataForCallback) { struct net_device *dev; + hdd_context_t *pHddCtx = NULL; VOS_STATUS status = VOS_STATUS_SUCCESS; dev = (struct net_device *)usrDataForCallback; ENTER(); + + pHddCtx = WLAN_HDD_GET_CTX(pHostapdAdapter); + status = wlan_hdd_validate_context(pHddCtx); + + if (0 != status) { + hddLog(VOS_TRACE_LEVEL_ERROR, FL("HDD context is not valid")); + return status; + } + if(test_bit(SOFTAP_BSS_STARTED, &pHostapdAdapter->event_flags)) { #ifdef WLAN_FEATURE_MBSSID @@ -557,6 +596,7 @@ static int hdd_stop_p2p_link(hdd_adapter_t *pHostapdAdapter,v_PVOID_t usrDataFor VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, FL("Deleting P2P link!!!!!!")); } clear_bit(SOFTAP_BSS_STARTED, &pHostapdAdapter->event_flags); + wlan_hdd_decr_active_session(pHddCtx, pHostapdAdapter->device_mode); } EXIT(); return (status == VOS_STATUS_SUCCESS) ? 0 : -EBUSY; @@ -2977,7 +3017,19 @@ static iw_softap_commit(struct net_device *dev, } else { + hdd_context_t *pHddCtx = NULL; + VOS_STATUS status = VOS_STATUS_SUCCESS; + + pHddCtx = WLAN_HDD_GET_CTX(pHostapdAdapter); + status = wlan_hdd_validate_context(pHddCtx); + + if (0 != status) { + hddLog(VOS_TRACE_LEVEL_ERROR, FL("HDD context is not valid")); + return status; + } + set_bit(SOFTAP_BSS_STARTED, &pHostapdAdapter->event_flags); + wlan_hdd_incr_active_session(pHddCtx, pHostapdAdapter->device_mode); #ifdef WLAN_FEATURE_MBSSID WLANSAP_Update_WpsIe ( WLAN_HDD_GET_SAP_CTX_PTR(pHostapdAdapter) ); #else @@ -3943,7 +3995,18 @@ static int iw_softap_stopbss(struct net_device *dev, { hdd_adapter_t *pHostapdAdapter = (netdev_priv(dev)); VOS_STATUS status = VOS_STATUS_SUCCESS; + hdd_context_t *pHddCtx = NULL; + ENTER(); + + pHddCtx = WLAN_HDD_GET_CTX(pHostapdAdapter); + status = wlan_hdd_validate_context(pHddCtx); + + if (0 != status) { + hddLog(VOS_TRACE_LEVEL_ERROR, FL("HDD context is not valid")); + return status; + } + if(test_bit(SOFTAP_BSS_STARTED, &pHostapdAdapter->event_flags)) { #ifdef WLAN_FEATURE_MBSSID @@ -3965,6 +4028,7 @@ static int iw_softap_stopbss(struct net_device *dev, } } clear_bit(SOFTAP_BSS_STARTED, &pHostapdAdapter->event_flags); + wlan_hdd_decr_active_session(pHddCtx, pHostapdAdapter->device_mode); } EXIT(); return (status == VOS_STATUS_SUCCESS) ? 0 : -EBUSY; @@ -4227,7 +4291,7 @@ int iw_get_softap_linkspeed(struct net_device *dev, int len = sizeof(v_U32_t)+1; tSirMacAddr macAddress; VOS_STATUS status = VOS_STATUS_E_FAILURE; - int rc, valid; + int rc, valid, i; pHddCtx = WLAN_HDD_GET_CTX(pHostapdAdapter); valid = wlan_hdd_validate_context(pHddCtx); @@ -4264,13 +4328,22 @@ int iw_get_softap_linkspeed(struct net_device *dev, hddLog(VOS_TRACE_LEVEL_ERROR, FL("String to Hex conversion Failed")); } } - /* If no mac address is passed and/or its length is less than 17, - * return error + * link speed for first connected client will be returned. */ - if (wrqu->data.length < 17 || !VOS_IS_STATUS_SUCCESS(status )) - { - hddLog(VOS_TRACE_LEVEL_ERROR,FL("Invalid peer macaddress")); + if (wrqu->data.length < 17 || !VOS_IS_STATUS_SUCCESS(status )) { + for (i = 0; i < WLAN_MAX_STA_COUNT; i++) { + if (pHostapdAdapter->aStaInfo[i].isUsed && + (!vos_is_macaddr_broadcast(&pHostapdAdapter->aStaInfo[i].macAddrSTA))) { + vos_copy_macaddr((v_MACADDR_t *)macAddress, + &pHostapdAdapter->aStaInfo[i].macAddrSTA); + status = VOS_STATUS_SUCCESS; + break; + } + } + } + if (!VOS_IS_STATUS_SUCCESS(status )) { + hddLog(VOS_TRACE_LEVEL_ERROR, FL("Invalid peer macaddress")); return -EINVAL; } status = wlan_hdd_get_linkspeed_for_peermac(pHostapdAdapter, diff --git a/CORE/HDD/src/wlan_hdd_main.c b/CORE/HDD/src/wlan_hdd_main.c index 082e2cc872c0..055e2c09caa1 100755 --- a/CORE/HDD/src/wlan_hdd_main.c +++ b/CORE/HDD/src/wlan_hdd_main.c @@ -8748,9 +8748,9 @@ VOS_STATUS hdd_close_adapter( hdd_context_t *pHddCtx, hdd_adapter_t *pAdapter, return VOS_STATUS_SUCCESS; /* If there is a single session of STA/P2P client, re-enable BMPS */ - if ((!vos_concurrent_sessions_running()) && - ((pHddCtx->no_of_sessions[VOS_STA_MODE] >= 1) || - (pHddCtx->no_of_sessions[VOS_P2P_CLIENT_MODE] >= 1))) + if ((!vos_concurrent_open_sessions_running()) && + ((pHddCtx->no_of_open_sessions[VOS_STA_MODE] >= 1) || + (pHddCtx->no_of_open_sessions[VOS_P2P_CLIENT_MODE] >= 1))) { if (pHddCtx->hdd_wlan_suspended) { @@ -8992,6 +8992,7 @@ VOS_STATUS hdd_stop_adapter( hdd_context_t *pHddCtx, hdd_adapter_t *pAdapter, hddLog(LOGE, "%s: failure in WLANSAP_StopBss", __func__); } clear_bit(SOFTAP_BSS_STARTED, &pAdapter->event_flags); + wlan_hdd_decr_active_session(pHddCtx, pAdapter->device_mode); if (eHAL_STATUS_FAILURE == ccmCfgSetInt(pHddCtx->hHal, WNI_CFG_PROBE_RSP_BCN_ADDNIE_FLAG, @@ -10432,6 +10433,42 @@ void __hdd_wlan_exit(void) } #endif /* QCA_WIFI_2_0 && !QCA_WIFI_ISOC */ +#ifdef QCA_HT_2040_COEX +/**-------------------------------------------------------------------------- + + \brief notify FW with HT20/HT40 mode + + -------------------------------------------------------------------------*/ +int hdd_wlan_set_ht2040_mode(hdd_adapter_t *pAdapter, v_U16_t staId, + v_MACADDR_t macAddrSTA, int channel_type) +{ + int status; + VOS_STATUS vosStatus; + hdd_context_t *pHddCtx = NULL; + + pHddCtx = WLAN_HDD_GET_CTX(pAdapter); + + status = wlan_hdd_validate_context(pHddCtx); + if (0 != status) + { + VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: HDD context is not valid", __func__); + return -1; + } + if (!pHddCtx->hHal) + return -1; + + vosStatus = sme_notify_ht2040_mode(pHddCtx->hHal, staId, macAddrSTA, + pAdapter->sessionId, channel_type); + if (VOS_STATUS_SUCCESS != vosStatus) { + hddLog(LOGE, "Fail to send notification with ht2040 mode\n"); + return -1; + } + + return 0; +} +#endif + /**-------------------------------------------------------------------------- \brief notify FW with modem power status @@ -10775,6 +10812,13 @@ boolean hdd_is_5g_supported(hdd_context_t * pHddCtx) } #ifdef CONFIG_ENABLE_LINUX_REG +#ifdef QCA_WIFI_2_0 +#define WOW_MAX_FILTER_LISTS 1 +#define WOW_MAX_FILTERS_PER_LIST 4 +#define WOW_MIN_PATTERN_SIZE 6 +#define WOW_MAX_PATTERN_SIZE 64 +#endif + static VOS_STATUS wlan_hdd_reg_init(hdd_context_t *hdd_ctx) { struct wiphy *wiphy; @@ -10798,6 +10842,22 @@ static VOS_STATUS wlan_hdd_reg_init(hdd_context_t *hdd_ctx) } #endif +#ifdef QCA_WIFI_2_0 + wiphy->wowlan.flags = WIPHY_WOWLAN_ANY | + WIPHY_WOWLAN_MAGIC_PKT | + WIPHY_WOWLAN_DISCONNECT | + WIPHY_WOWLAN_SUPPORTS_GTK_REKEY | + WIPHY_WOWLAN_GTK_REKEY_FAILURE | + WIPHY_WOWLAN_EAP_IDENTITY_REQ | + WIPHY_WOWLAN_4WAY_HANDSHAKE | + WIPHY_WOWLAN_RFKILL_RELEASE; + + wiphy->wowlan.n_patterns = (WOW_MAX_FILTER_LISTS * + WOW_MAX_FILTERS_PER_LIST); + wiphy->wowlan.pattern_min_len = WOW_MIN_PATTERN_SIZE; + wiphy->wowlan.pattern_max_len = WOW_MAX_PATTERN_SIZE; +#endif + /* registration of wiphy dev with cfg80211 */ if (0 > wlan_hdd_cfg80211_register(wiphy)) { @@ -12620,45 +12680,110 @@ v_BOOL_t hdd_is_suspend_notify_allowed(hdd_context_t* pHddCtx) void wlan_hdd_set_concurrency_mode(hdd_context_t *pHddCtx, tVOS_CON_MODE mode) { - switch(mode) - { + switch (mode) { case VOS_STA_MODE: case VOS_P2P_CLIENT_MODE: case VOS_P2P_GO_MODE: case VOS_STA_SAP_MODE: pHddCtx->concurrency_mode |= (1 << mode); - pHddCtx->no_of_sessions[mode]++; + pHddCtx->no_of_open_sessions[mode]++; break; default: break; - } - VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, "%s: concurrency_mode = 0x%x NumberofSessions for mode %d = %d", - __func__,pHddCtx->concurrency_mode,mode,pHddCtx->no_of_sessions[mode]); + hddLog(VOS_TRACE_LEVEL_INFO, FL("concurrency_mode = 0x%x " + "Number of open sessions for mode %d = %d"), + pHddCtx->concurrency_mode, mode, + pHddCtx->no_of_open_sessions[mode]); } void wlan_hdd_clear_concurrency_mode(hdd_context_t *pHddCtx, tVOS_CON_MODE mode) -{ - switch(mode) { + switch (mode) { case VOS_STA_MODE: case VOS_P2P_CLIENT_MODE: case VOS_P2P_GO_MODE: case VOS_STA_SAP_MODE: - pHddCtx->no_of_sessions[mode]--; - if (!(pHddCtx->no_of_sessions[mode])) - pHddCtx->concurrency_mode &= (~(1 << mode)); + pHddCtx->no_of_open_sessions[mode]--; + if (!(pHddCtx->no_of_open_sessions[mode])) + pHddCtx->concurrency_mode &= (~(1 << mode)); break; default: break; } - VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, "%s: concurrency_mode = 0x%x NumberofSessions for mode %d = %d", - __func__,pHddCtx->concurrency_mode,mode,pHddCtx->no_of_sessions[mode]); + hddLog(VOS_TRACE_LEVEL_INFO, FL("concurrency_mode = 0x%x " + "Number of open sessions for mode %d = %d"), + pHddCtx->concurrency_mode, mode, pHddCtx->no_of_open_sessions[mode]); + } + +/**--------------------------------------------------------------------------- + * + * \brief wlan_hdd_incr_active_session() + * + * This function increments the number of active sessions + * maintained per device mode + * Incase of STA/P2P CLI/IBSS upon connection indication it is incremented + * Incase of SAP/P2P GO upon bss start it is incremented + * + * \param pHddCtx - HDD Context + * \param mode - device mode + * + * \return - None + * + * --------------------------------------------------------------------------*/ +void wlan_hdd_incr_active_session(hdd_context_t *pHddCtx, tVOS_CON_MODE mode) +{ + switch (mode) { + case VOS_STA_MODE: + case VOS_P2P_CLIENT_MODE: + case VOS_P2P_GO_MODE: + case VOS_STA_SAP_MODE: + pHddCtx->no_of_active_sessions[mode]++; + break; + default: + break; + } + hddLog(VOS_TRACE_LEVEL_INFO, FL("No.# of active sessions for mode %d = %d"), + mode, + pHddCtx->no_of_active_sessions[mode]); } /**--------------------------------------------------------------------------- * + * \brief wlan_hdd_decr_active_session() + * + * This function decrements the number of active sessions + * maintained per device mode + * Incase of STA/P2P CLI/IBSS upon disconnection it is decremented + * Incase of SAP/P2P GO upon bss stop it is decremented + * + * \param pHddCtx - HDD Context + * \param mode - device mode + * + * \return - None + * + * --------------------------------------------------------------------------*/ +void wlan_hdd_decr_active_session(hdd_context_t *pHddCtx, tVOS_CON_MODE mode) +{ + switch (mode) { + case VOS_STA_MODE: + case VOS_P2P_CLIENT_MODE: + case VOS_P2P_GO_MODE: + case VOS_STA_SAP_MODE: + pHddCtx->no_of_active_sessions[mode]--; + break; + default: + break; + } + hddLog(VOS_TRACE_LEVEL_INFO, FL("No.# of active sessions for mode %d = %d"), + mode, + pHddCtx->no_of_active_sessions[mode]); +} + + +/**--------------------------------------------------------------------------- + * * \brief wlan_hdd_restart_init * * This function initalizes restart timer/flag. An internal function. @@ -13262,7 +13387,7 @@ void wlan_hdd_auto_shutdown_enable(hdd_context_t *hdd_ctx, v_BOOL_t enable) } /* To enable shutdown timer check conncurrency */ - if (vos_concurrent_sessions_running()) { + if (vos_concurrent_open_sessions_running()) { status = hdd_get_front_adapter ( hdd_ctx, &pAdapterNode ); while ( NULL != pAdapterNode && VOS_STATUS_SUCCESS == status ) { @@ -13332,7 +13457,7 @@ void hdd_stop_bus_bw_compute_timer(hdd_adapter_t *pAdapter) return; } - if (vos_concurrent_sessions_running()) { + if (vos_concurrent_open_sessions_running()) { status = hdd_get_front_adapter ( pHddCtx, &pAdapterNode ); while ( NULL != pAdapterNode && VOS_STATUS_SUCCESS == status ) { @@ -13394,6 +13519,7 @@ void wlan_hdd_restart_sap(hdd_adapter_t *ap_pAdapter) } } clear_bit(SOFTAP_BSS_STARTED, &ap_pAdapter->event_flags); + wlan_hdd_decr_active_session(pHddCtx, pHostapdAdapter->device_mode); hddLog(LOGE,FL("%s: SAP Stop Success"), __func__); if (WLANSAP_StartBss( @@ -13416,6 +13542,7 @@ void wlan_hdd_restart_sap(hdd_adapter_t *ap_pAdapter) } hddLog(LOGE,FL("%s: SAP Start Success"), __func__); set_bit(SOFTAP_BSS_STARTED, &ap_pAdapter->event_flags); + wlan_hdd_incr_active_session(pHddCtx, ap_pAdapter-->device_mode); pHostapdState->bCommit = TRUE; } end: @@ -13432,7 +13559,7 @@ void wlan_hdd_check_sta_ap_concurrent_ch_intf(void *data) v_U16_t intf_ch = 0; if ((pHddCtx->cfg_ini->WlanMccToSccSwitchMode == VOS_MCC_TO_SCC_SWITCH_DISABLE) - || !(vos_concurrent_sessions_running() + || !(vos_concurrent_open_sessions_running() || !(vos_get_concurrency_mode() == VOS_STA_SAP))) return; diff --git a/CORE/MAC/inc/aniGlobal.h b/CORE/MAC/inc/aniGlobal.h index bd16663b19c6..f3a91cfaeddb 100644 --- a/CORE/MAC/inc/aniGlobal.h +++ b/CORE/MAC/inc/aniGlobal.h @@ -1020,6 +1020,11 @@ typedef struct sMacOpenParameters /* max offload reorder buffs */ tANI_U8 apMaxOffloadReorderBuffs; +#ifdef FEATURE_WLAN_RA_FILTERING + tANI_U16 RArateLimitInterval; + v_BOOL_t IsRArateLimitEnabled; +#endif + } tMacOpenParameters; typedef struct sHalMacStartParameters diff --git a/CORE/MAC/inc/qwlan_version.h b/CORE/MAC/inc/qwlan_version.h index 9dea5b92ef26..9ba0b45b125e 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 126 +#define QWLAN_VERSION_BUILD 127 -#define QWLAN_VERSIONSTR "1.0.0.126A" +#define QWLAN_VERSIONSTR "1.0.0.127" #ifdef QCA_WIFI_2_0 diff --git a/CORE/MAC/inc/sirApi.h b/CORE/MAC/inc/sirApi.h index f478bdc4b0d0..4c38f2e35424 100644 --- a/CORE/MAC/inc/sirApi.h +++ b/CORE/MAC/inc/sirApi.h @@ -3510,6 +3510,17 @@ typedef struct sSirChangeBIParams tANI_U8 sessionId; // Session ID } tSirChangeBIParams, *tpSirChangeBIParams; +#ifdef QCA_HT_2040_COEX +typedef struct sSirSetHT2040Mode +{ + tANI_U16 messageType; + tANI_U16 length; + tANI_U8 cbMode; + tSirMacAddr bssId; + tANI_U8 sessionId; // Session ID +} tSirSetHT2040Mode, *tpSirSetHT2040Mode; +#endif + #define SIR_WPS_UUID_LEN 16 #define SIR_WPS_PBC_WALK_TIME 120 // 120 Second diff --git a/CORE/MAC/inc/sirMacProtDef.h b/CORE/MAC/inc/sirMacProtDef.h index 2dc55f862a53..d0e316b76f71 100644 --- a/CORE/MAC/inc/sirMacProtDef.h +++ b/CORE/MAC/inc/sirMacProtDef.h @@ -1845,6 +1845,14 @@ typedef enum eSirMacHTChannelWidth eHT_MAX_CHANNEL_WIDTH } tSirMacHTChannelWidth; +typedef enum eSirMacHTChannelType +{ + eHT_CHAN_NO_HT = 0, + eHT_CHAN_HT20 = 1, + eHT_CHAN_HT40MINUS = 2, + eHT_CHAN_HT40PLUS = 3 +} tSirMacHTChannelType; + //Packet struct for HT capability typedef __ani_attr_pre_packed struct sHtCaps { tANI_U16 advCodingCap: 1; diff --git a/CORE/MAC/inc/wniApi.h b/CORE/MAC/inc/wniApi.h index 79a7fae0335b..4f420b7d48eb 100644 --- a/CORE/MAC/inc/wniApi.h +++ b/CORE/MAC/inc/wniApi.h @@ -396,6 +396,10 @@ enum eWniMsgTypes eWNI_SME_LINK_SPEED_IND,//Indicate linkspeed response from WMA eWNI_SME_CSA_OFFLOAD_EVENT, eWNI_SME_UPDATE_ADDITIONAL_IES, // indicates Additional IE from hdd to PE +#ifdef QCA_HT_2040_COEX + eWNI_SME_SET_HT_2040_MODE, +#endif + eWNI_SME_MSG_TYPES_END }; diff --git a/CORE/MAC/src/pe/lim/limProcessAuthFrame.c b/CORE/MAC/src/pe/lim/limProcessAuthFrame.c index c0209fb05ed3..3fd85ded66d9 100644 --- a/CORE/MAC/src/pe/lim/limProcessAuthFrame.c +++ b/CORE/MAC/src/pe/lim/limProcessAuthFrame.c @@ -590,10 +590,19 @@ limProcessAuthFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo, tpPESession pse /* pStaDS != NULL and isConnected = 1 means the STA is already * connected, But SAP received the Auth from that station. - * So dont accept this auth frame and send Deauth frame. - * STA will retry to connect back. + * For non PMF connection send Deauth frame as STA will retry + * to connect back. + * + * For PMF connection the AP should not tear down or otherwise + * modify the state of the existing association until the + * SA-Query procedure determines that the original SA is + * invalid. */ - if (isConnected) + if (isConnected +#ifdef WLAN_FEATURE_11W + && !pStaDs->rmfEnabled +#endif + ) { limLog(pMac, LOGE, FL("STA is already connected but received auth frame" diff --git a/CORE/MAC/src/pe/lim/limProcessMessageQueue.c b/CORE/MAC/src/pe/lim/limProcessMessageQueue.c index 8cb1e9e85dfd..35c7dd094238 100644 --- a/CORE/MAC/src/pe/lim/limProcessMessageQueue.c +++ b/CORE/MAC/src/pe/lim/limProcessMessageQueue.c @@ -2181,6 +2181,15 @@ limProcessMessages(tpAniSirGlobal pMac, tpSirMsgQ limMsg) vos_mem_free((v_VOID_t*)limMsg->bodyptr); limMsg->bodyptr = NULL; break; + +#ifdef QCA_HT_2040_COEX + case eWNI_SME_SET_HT_2040_MODE: + limProcessSmeReqMessages(pMac, limMsg); + vos_mem_free((v_VOID_t*)limMsg->bodyptr); + limMsg->bodyptr = NULL; + break; +#endif + default: vos_mem_free((v_VOID_t*)limMsg->bodyptr); limMsg->bodyptr = NULL; diff --git a/CORE/MAC/src/pe/lim/limProcessSmeReqMessages.c b/CORE/MAC/src/pe/lim/limProcessSmeReqMessages.c index c72038e77ae9..8561b31c6d42 100644 --- a/CORE/MAC/src/pe/lim/limProcessSmeReqMessages.c +++ b/CORE/MAC/src/pe/lim/limProcessSmeReqMessages.c @@ -57,6 +57,7 @@ #include "limSendMessages.h" #include "limApi.h" #include "wmmApsd.h" +#include "sirMacProtDef.h" #include "sapApi.h" @@ -4732,7 +4733,62 @@ __limProcessSmeChangeBI(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) return; } /*** end __limProcessSmeChangeBI(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) ***/ +#ifdef QCA_HT_2040_COEX +static void __limProcessSmeSetHT2040Mode(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) +{ + tpSirSetHT2040Mode pSetHT2040Mode; + tpPESession psessionEntry; + tANI_U8 sessionId = 0; + + PELOG1(limLog(pMac, LOG1, + FL("received Set HT 20/40 mode message"));); + if(pMsgBuf == NULL) + { + limLog(pMac, LOGE,FL("Buffer is Pointing to NULL")); + return; + } + pSetHT2040Mode = (tpSirSetHT2040Mode)pMsgBuf; + + if((psessionEntry = peFindSessionByBssid(pMac, pSetHT2040Mode->bssId, + &sessionId)) == NULL) + { + limLog(pMac, LOG1, FL("Session does not exist for given BSSID ")); + limPrintMacAddr(pMac, pSetHT2040Mode->bssId, LOG1); + return; + } + + limLog(pMac, LOG1, FL("Update session entry for cbMod=%d"), + pSetHT2040Mode->cbMode); + /*Update sessionEntry HT related fields*/ + switch(pSetHT2040Mode->cbMode) + { + case PHY_SINGLE_CHANNEL_CENTERED: + psessionEntry->htSupportedChannelWidthSet = eHT_CHANNEL_WIDTH_20MHZ; + psessionEntry->htSecondaryChannelOffset = PHY_SINGLE_CHANNEL_CENTERED; + psessionEntry->htRecommendedTxWidthSet = eHT_CHANNEL_WIDTH_20MHZ; + break; + case PHY_DOUBLE_CHANNEL_LOW_PRIMARY: + psessionEntry->htSupportedChannelWidthSet = eHT_CHANNEL_WIDTH_40MHZ; + psessionEntry->htSecondaryChannelOffset = PHY_DOUBLE_CHANNEL_LOW_PRIMARY; + psessionEntry->htRecommendedTxWidthSet = eHT_CHANNEL_WIDTH_40MHZ; + break; + case PHY_DOUBLE_CHANNEL_HIGH_PRIMARY: + psessionEntry->htSupportedChannelWidthSet = eHT_CHANNEL_WIDTH_40MHZ; + psessionEntry->htSecondaryChannelOffset = PHY_DOUBLE_CHANNEL_HIGH_PRIMARY; + psessionEntry->htRecommendedTxWidthSet = eHT_CHANNEL_WIDTH_40MHZ; + break; + default: + limLog(pMac, LOGE,FL("Invalid cbMode")); + return; + } + + /* Update beacon */ + schSetFixedBeaconFields(pMac, psessionEntry); + limSendBeaconInd(pMac, psessionEntry); + return; +} +#endif /** ------------------------------------------------------------- \fn limProcessSmeDelBaPeerInd @@ -5889,6 +5945,12 @@ limProcessSmeReqMessages(tpAniSirGlobal pMac, tpSirMsgQ pMsg) __limProcessSmeChangeBI(pMac, pMsgBuf ); break; +#ifdef QCA_HT_2040_COEX + case eWNI_SME_SET_HT_2040_MODE: + __limProcessSmeSetHT2040Mode(pMac, pMsgBuf); + break; +#endif + #if defined WLAN_FEATURE_VOWIFI case eWNI_SME_NEIGHBOR_REPORT_REQ_IND: case eWNI_SME_BEACON_REPORT_RESP_XMIT_IND: diff --git a/CORE/SAP/src/sapChSelect.c b/CORE/SAP/src/sapChSelect.c index afe98fade9a9..6a9b0f23c5c0 100644 --- a/CORE/SAP/src/sapChSelect.c +++ b/CORE/SAP/src/sapChSelect.c @@ -2097,6 +2097,8 @@ void sapSortChlWeightHT40_24G(tSapChSelSpectInfo *pSpectInfoParams) else pSpectInfo[j].weight = ACS_WEIGHT_MAX; } + + sapSortChlWeight(pSpectInfoParams); } diff --git a/CORE/SERVICES/BMI/ol_fw.c b/CORE/SERVICES/BMI/ol_fw.c index 6d395ef6169d..d7b5d53d3a7c 100644 --- a/CORE/SERVICES/BMI/ol_fw.c +++ b/CORE/SERVICES/BMI/ol_fw.c @@ -68,8 +68,49 @@ static u_int32_t refclk_speed_to_hz[] = { #endif #ifdef HIF_SDIO +static struct ol_fw_files FW_FILES_QCA6174_FW_1_1 = { +"qwlan11.bin", "bdwlan11.bin", "otp11.bin", "utf11.bin", "utfbd11.bin"}; +static struct ol_fw_files FW_FILES_QCA6174_FW_2_0 = { +"qwlan20.bin", "bdwlan20.bin", "otp20.bin", "utf20.bin", "utfbd20.bin"}; +static struct ol_fw_files FW_FILES_QCA6174_FW_1_3 = { +"qwlan13.bin", "bdwlan13.bin", "otp13.bin", "utf13.bin", "utfbd13.bin"}; +static struct ol_fw_files FW_FILES_QCA6174_FW_3_0 = { +"qwlan30.bin", "bdwlan30.bin", "otp30.bin", "utf30.bin", "utfbd30.bin"}; +static struct ol_fw_files FW_FILES_DEFAULT = { +"qwlan.bin", "bdwlan.bin", "otp.bin", "utf.bin", "utfbd.bin"}; + static A_STATUS ol_sdio_extra_initialization(struct ol_softc *scn); + +static int ol_get_fw_files_for_target(struct ol_fw_files *pfw_files, + u32 target_version) +{ + if (!pfw_files) + return -ENODEV; + + switch (target_version) { + case AR6320_REV1_VERSION: + case AR6320_REV1_1_VERSION: + memcpy(pfw_files, &FW_FILES_QCA6174_FW_1_1, sizeof(*pfw_files)); + break; + case AR6320_REV1_3_VERSION: + memcpy(pfw_files, &FW_FILES_QCA6174_FW_1_3, sizeof(*pfw_files)); + break; + case AR6320_REV2_1_VERSION: + memcpy(pfw_files, &FW_FILES_QCA6174_FW_2_0, sizeof(*pfw_files)); + break; + case AR6320_REV3_VERSION: + memcpy(pfw_files, &FW_FILES_QCA6174_FW_3_0, sizeof(*pfw_files)); + break; + default: + memcpy(pfw_files, &FW_FILES_DEFAULT, sizeof(*pfw_files)); + pr_err("%s version mismatch 0x%X ", + __func__, target_version); + break; + } + return 0; +} #endif + extern int dbglog_parse_debug_logs(ol_scn_t scn, u_int8_t *datap, u_int32_t len); @@ -346,7 +387,7 @@ static int ol_transfer_bin_file(struct ol_softc *scn, ATH_BIN_FILE file, printk("%s: Unknown file type\n", __func__); return -1; case ATH_OTP_FILE: -#ifdef CONFIG_CNSS +#if defined(CONFIG_CNSS) || defined(HIF_SDIO) filename = scn->fw_files.otp_data; #else filename = QCA_OTP_FILE; @@ -358,7 +399,7 @@ static int ol_transfer_bin_file(struct ol_softc *scn, ATH_BIN_FILE file, case ATH_FIRMWARE_FILE: #ifdef QCA_WIFI_FTM if (vos_get_conparam() == VOS_FTM_MODE) { -#ifdef CONFIG_CNSS +#if defined(CONFIG_CNSS) || defined(HIF_SDIO) filename = scn->fw_files.utf_file; #else filename = QCA_UTF_FIRMWARE_FILE; @@ -371,7 +412,7 @@ static int ol_transfer_bin_file(struct ol_softc *scn, ATH_BIN_FILE file, break; } #endif -#ifdef CONFIG_CNSS +#if defined(CONFIG_CNSS) || defined(HIF_SDIO) filename = scn->fw_files.image_file; #else filename = QCA_FIRMWARE_FILE; @@ -386,7 +427,7 @@ static int ol_transfer_bin_file(struct ol_softc *scn, ATH_BIN_FILE file, case ATH_BOARD_DATA_FILE: #ifdef QCA_WIFI_FTM if (vos_get_conparam() == VOS_FTM_MODE) { -#ifdef CONFIG_CNSS +#if defined(CONFIG_CNSS) || defined(HIF_SDIO) filename = scn->fw_files.utf_board_data; #else filename = QCA_BOARD_DATA_FILE; @@ -399,7 +440,7 @@ static int ol_transfer_bin_file(struct ol_softc *scn, ATH_BIN_FILE file, break; } #endif /* QCA_WIFI_FTM */ -#ifdef CONFIG_CNSS +#if defined(CONFIG_CNSS) || defined(HIF_SDIO) filename = scn->fw_files.board_data; #else filename = QCA_BOARD_DATA_FILE; @@ -417,7 +458,7 @@ static int ol_transfer_bin_file(struct ol_softc *scn, ATH_BIN_FILE file, if (file == ATH_OTP_FILE) return -ENOENT; -#if defined(QCA_WIFI_FTM) && defined(CONFIG_CNSS) +#if defined(QCA_WIFI_FTM) && defined(CONFIG_CNSS) && defined(HIF_SDIO) /* Try default board data file if FTM specific * board data file is not present. */ if (filename == scn->fw_files.utf_board_data) { @@ -1472,6 +1513,12 @@ int ol_download_firmware(struct ol_softc *scn) printk("%s: No FW files from CNSS driver\n", __func__); return -1; } +#elif defined(HIF_SDIO) + if (0 != ol_get_fw_files_for_target(&scn->fw_files, + scn->target_version)) { + printk("%s: No FW files from driver\n", __func__); + return -1; + } #endif /* Transfer Board Data from Target EEPROM to Target RAM */ /* Determine where in Target RAM to write Board Data */ diff --git a/CORE/SERVICES/COMMON/ol_if_athvar.h b/CORE/SERVICES/COMMON/ol_if_athvar.h index 782abb664ad5..58f46a7c8501 100644 --- a/CORE/SERVICES/COMMON/ol_if_athvar.h +++ b/CORE/SERVICES/COMMON/ol_if_athvar.h @@ -90,6 +90,17 @@ enum ol_ath_tx_ecodes { RX_RCV_MSG_TYPE_TEST } ; +#ifdef HIF_SDIO +#define MAX_FILE_NAME 20 +struct ol_fw_files { + char image_file[MAX_FILE_NAME]; + char board_data[MAX_FILE_NAME]; + char otp_data[MAX_FILE_NAME]; + char utf_file[MAX_FILE_NAME]; + char utf_board_data[MAX_FILE_NAME]; +}; +#endif + #ifndef ATH_CAP_DCS_CWIM #define ATH_CAP_DCS_CWIM 0x1 #define ATH_CAP_DCS_WLANIM 0x2 @@ -221,6 +232,8 @@ struct ol_softc { bool crash_shutdown; #ifdef CONFIG_CNSS struct cnss_fw_files fw_files; +#elif defined(HIF_SDIO) + struct ol_fw_files fw_files; #endif }; diff --git a/CORE/SERVICES/HIF/ath_procfs.c b/CORE/SERVICES/HIF/ath_procfs.c index 837f95e1c1e0..bad2474dc7da 100644 --- a/CORE/SERVICES/HIF/ath_procfs.c +++ b/CORE/SERVICES/HIF/ath_procfs.c @@ -178,7 +178,7 @@ int athdiag_procfs_init(void *scn) } proc_file = proc_create_data(PROCFS_NAME, - S_IALLUGO, proc_dir, + S_IRUSR | S_IWUSR, proc_dir, &athdiag_fops, (void *)scn); if (proc_file == NULL) { remove_proc_entry(PROCFS_NAME, proc_dir); diff --git a/CORE/SERVICES/WMA/wma.c b/CORE/SERVICES/WMA/wma.c index 66a9a7fe61c7..5cf851e2d444 100644 --- a/CORE/SERVICES/WMA/wma.c +++ b/CORE/SERVICES/WMA/wma.c @@ -3249,7 +3249,10 @@ VOS_STATUS WDA_open(v_VOID_t *vos_context, v_VOID_t *os_ctx, wma_handle->frame_xln_reqd = mac_params->frameTransRequired; wma_handle->driver_type = mac_params->driverType; wma_handle->ssdp = mac_params->ssdp; - +#ifdef FEATURE_WLAN_RA_FILTERING + wma_handle->IsRArateLimitEnabled = mac_params->IsRArateLimitEnabled; + wma_handle->RArateLimitInterval = mac_params->RArateLimitInterval; +#endif /* * Indicates if DFS Phyerr filtering offload * is Enabled/Disabed from ini @@ -13335,6 +13338,10 @@ static const u8 *wma_wow_wake_reason_str(A_INT32 wake_reason) return "ASSOC_REQ_RECV"; case WOW_REASON_HTT_EVENT: return "WOW_REASON_HTT_EVENT"; +#ifdef FEATURE_WLAN_RA_FILTERING + case WOW_REASON_RA_MATCH: + return "WOW_REASON_RA_MATCH"; +#endif } return "unknown"; } @@ -13416,6 +13423,7 @@ static int wma_wow_wakeup_host_event(void *handle, u_int8_t *event, struct wma_txrx_node *node; #endif u_int32_t wake_lock_duration = 0; + u_int32_t wow_buf_pkt_len = 0; param_buf = (WMI_WOW_WAKEUP_HOST_EVENTID_param_tlvs *) event; if (!param_buf) { @@ -13453,7 +13461,11 @@ static int wma_wow_wakeup_host_event(void *handle, u_int8_t *event, wake_info->vdev_id); wma_beacon_miss_handler(wma, wake_info->vdev_id); break; - +#ifdef FEATURE_WLAN_RA_FILTERING + case WOW_REASON_RA_MATCH: + wake_lock_duration = WMA_RA_MATCH_RECV_WAKE_LOCK_DURATION; + break; +#endif #ifdef FEATURE_WLAN_SCAN_PNO case WOW_REASON_NLOD: wake_lock_duration = WMA_PNO_WAKE_LOCK_TIMEOUT; @@ -13486,6 +13498,15 @@ static int wma_wow_wakeup_host_event(void *handle, u_int8_t *event, case WOW_REASON_HTT_EVENT: break; + case WOW_REASON_PATTERN_MATCH_FOUND: + WMA_LOGD("Wake up for Rx packet, dump starting from ethernet hdr"); + /* First 4-bytes of wow_packet_buffer is the length */ + vos_mem_copy((u_int8_t *) &wow_buf_pkt_len, + param_buf->wow_packet_buffer, 4); + vos_trace_hex_dump(VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_DEBUG, + param_buf->wow_packet_buffer + 4, + wow_buf_pkt_len); + break; default: break; @@ -13902,6 +13923,92 @@ static VOS_STATUS wma_wow_ap(tp_wma_handle wma, u_int8_t vdev_id, return ret; } +#ifdef FEATURE_WLAN_RA_FILTERING +static VOS_STATUS wma_wow_sta_ra_filter(tp_wma_handle wma, u_int8_t vdev_id) +{ + + WMI_WOW_ADD_PATTERN_CMD_fixed_param *cmd; + wmi_buf_t buf; + u_int8_t *buf_ptr; + int32_t len; + int ret; + + len = sizeof(WMI_WOW_ADD_PATTERN_CMD_fixed_param) + + WMI_TLV_HDR_SIZE + + 0 * sizeof(WOW_BITMAP_PATTERN_T) + + WMI_TLV_HDR_SIZE + + 0 * sizeof(WOW_IPV4_SYNC_PATTERN_T) + + WMI_TLV_HDR_SIZE + + 0 * sizeof(WOW_IPV6_SYNC_PATTERN_T) + + WMI_TLV_HDR_SIZE + + 0 * sizeof(WOW_MAGIC_PATTERN_CMD) + + WMI_TLV_HDR_SIZE + + 0 * sizeof(A_UINT32) + + WMI_TLV_HDR_SIZE + + 1 * sizeof(A_UINT32); + + buf = wmi_buf_alloc(wma->wmi_handle, len); + if (!buf) { + WMA_LOGE("%s: Failed allocate wmi buffer", __func__); + return VOS_STATUS_E_NOMEM; + } + + cmd = (WMI_WOW_ADD_PATTERN_CMD_fixed_param *)wmi_buf_data(buf); + buf_ptr = (u_int8_t *)cmd; + + WMITLV_SET_HDR(&cmd->tlv_header, + WMITLV_TAG_STRUC_WMI_WOW_ADD_PATTERN_CMD_fixed_param, + WMITLV_GET_STRUCT_TLVLEN( + WMI_WOW_ADD_PATTERN_CMD_fixed_param)); + cmd->vdev_id = vdev_id; + cmd->pattern_id = 0; + cmd->pattern_type = WOW_IPV6_RA_PATTERN; + buf_ptr += sizeof(WMI_WOW_ADD_PATTERN_CMD_fixed_param); + + /* Fill TLV for WMITLV_TAG_STRUC_WOW_BITMAP_PATTERN_T but no data. */ + WMITLV_SET_HDR(buf_ptr, WMITLV_TAG_ARRAY_STRUC, 0); + buf_ptr += WMI_TLV_HDR_SIZE; + + /* Fill TLV for WMITLV_TAG_STRUC_WOW_IPV4_SYNC_PATTERN_T but no data. */ + WMITLV_SET_HDR(buf_ptr, WMITLV_TAG_ARRAY_STRUC, 0); + buf_ptr += WMI_TLV_HDR_SIZE; + + /* Fill TLV for WMITLV_TAG_STRUC_WOW_IPV6_SYNC_PATTERN_T but no data. */ + WMITLV_SET_HDR(buf_ptr, WMITLV_TAG_ARRAY_STRUC, 0); + buf_ptr += WMI_TLV_HDR_SIZE; + + /* Fill TLV for WMITLV_TAG_STRUC_WOW_MAGIC_PATTERN_CMD but no data. */ + WMITLV_SET_HDR(buf_ptr, WMITLV_TAG_ARRAY_STRUC, 0); + buf_ptr += WMI_TLV_HDR_SIZE; + + /* Fill TLV for pattern_info_timeout but no data. */ + WMITLV_SET_HDR(buf_ptr, WMITLV_TAG_ARRAY_UINT32, 0); + buf_ptr += WMI_TLV_HDR_SIZE; + + /* Fill TLV for ra_ratelimit_interval. */ + WMITLV_SET_HDR(buf_ptr, WMITLV_TAG_ARRAY_UINT32, sizeof(A_UINT32)); + buf_ptr += WMI_TLV_HDR_SIZE; + + + *((A_UINT32 *)buf_ptr) = wma->RArateLimitInterval; + + WMA_LOGD("%s: send RA rate limit [%d] to fw vdev = %d", __func__, + wma->RArateLimitInterval, vdev_id); + + ret = wmi_unified_cmd_send(wma->wmi_handle, buf, len, + WMI_WOW_ADD_WAKE_PATTERN_CMDID); + if (ret) { + WMA_LOGE("%s: Failed to send RA rate limit to fw", __func__); + wmi_buf_free(buf); + return VOS_STATUS_E_FAILURE; + } + + return VOS_STATUS_SUCCESS; + +} +#endif /* FEATURE_WLAN_RA_FILTERING */ + + /* Configures default WOW pattern for the given vdev_id which is in STA mode. */ static VOS_STATUS wma_wow_sta(tp_wma_handle wma, u_int8_t vdev_id, u_int8_t *enable_ptrn_match) @@ -14142,6 +14249,14 @@ static VOS_STATUS wma_feed_wow_config_to_fw(tp_wma_handle wma, ret = wma_wow_sta(wma, vdev_id, &enable_ptrn_match); } +#ifdef FEATURE_WLAN_RA_FILTERING + if ((ap_vdev_available == FALSE) && (wma->IsRArateLimitEnabled)) + { + ret = wma_wow_sta_ra_filter(wma, vdev_id); + + } + +#endif if (ret != VOS_STATUS_SUCCESS) goto end; } @@ -14283,6 +14398,20 @@ static VOS_STATUS wma_feed_wow_config_to_fw(tp_wma_handle wma, } else WMA_LOGD("Successfully Configured WOW_HTT_EVENT to FW"); +#ifdef FEATURE_WLAN_RA_FILTERING + /* Configure RA filter wakeup */ + if (wma->IsRArateLimitEnabled) { + ret = wma_add_wow_wakeup_event(wma, WOW_RA_MATCH_EVENT, TRUE); + + if (ret != VOS_STATUS_SUCCESS) { + WMA_LOGE("Failed to Configure WOW_RA_MATCH_EVENT to FW"); + goto end; + } else + WMA_LOGD("Successfully Configured WOW_RA_MATCH_EVENT to FW"); + } else + WMA_LOGD("gRAFilterEnable is not set, RA filterning is disabled"); +#endif + /* WOW is enabled in pcie suspend callback */ wma->wow.wow_enable = TRUE; wma->wow.wow_enable_cmd_sent = FALSE; diff --git a/CORE/SERVICES/WMA/wma.h b/CORE/SERVICES/WMA/wma.h index 07a4b47dcdcf..42686c7b4427 100644 --- a/CORE/SERVICES/WMA/wma.h +++ b/CORE/SERVICES/WMA/wma.h @@ -658,6 +658,10 @@ typedef struct { /* IBSS Power Save config Parameters */ ibss_power_save_params wma_ibss_power_save_params; +#ifdef FEATURE_WLAN_RA_FILTERING + v_BOOL_t IsRArateLimitEnabled; + u_int16_t RArateLimitInterval; +#endif }t_wma_handle, *tp_wma_handle; @@ -1324,7 +1328,9 @@ VOS_STATUS wma_send_snr_request(tp_wma_handle wma_handle, void *pGetRssiReq, #define WMA_ASSOC_REQ_RECV_WAKE_LOCK_DURATION (30 * 1000) /* in msec */ #define WMA_DEAUTH_RECV_WAKE_LOCK_DURATION (30 * 1000) /* in msec */ #define WMA_DISASSOC_RECV_WAKE_LOCK_DURATION (30 * 1000) /* in msec */ - +#ifdef FEATURE_WLAN_RA_FILTERING +#define WMA_RA_MATCH_RECV_WAKE_LOCK_DURATION (5 * 1000) /* in msec */ +#endif /* U-APSD maximum service period of peer station */ enum uapsd_peer_param_max_sp { diff --git a/CORE/SME/inc/sme_Api.h b/CORE/SME/inc/sme_Api.h index ebc6f933c298..8fcc005ceb50 100644 --- a/CORE/SME/inc/sme_Api.h +++ b/CORE/SME/inc/sme_Api.h @@ -3496,6 +3496,13 @@ ePhyChanBondState sme_GetCBPhyStateFromCBIniValue(tANI_U32 cb_ini_value); int sme_UpdateHTConfig(tHalHandle hHal, tANI_U8 sessionId, tANI_U16 htCapab, int value); tANI_S16 sme_GetHTConfig(tHalHandle hHal, tANI_U8 session_id, tANI_U16 ht_capab); + +#ifdef QCA_HT_2040_COEX +VOS_STATUS sme_notify_ht2040_mode(tHalHandle hHal, tANI_U16 staId, + v_MACADDR_t macAddrSTA, v_U8_t sessionId, tANI_U8 channel_type); +eHalStatus sme_SetHT2040Mode(tHalHandle hHal, tANI_U8 sessionId, tANI_U8 channel_type); +#endif + #ifdef QCA_WIFI_2_0 eHalStatus sme_getChannelInfo(tHalHandle hHal, tANI_U8 chanId, tSmeChannelInfo *chanInfo); diff --git a/CORE/SME/src/csr/csrApiRoam.c b/CORE/SME/src/csr/csrApiRoam.c index c2ade716c149..06e60f017c00 100644 --- a/CORE/SME/src/csr/csrApiRoam.c +++ b/CORE/SME/src/csr/csrApiRoam.c @@ -4320,8 +4320,9 @@ static eCsrJoinState csrRoamJoinNextBss( tpAniSirGlobal pMac, tSmeCmd *pCommand, pScanResult = GET_BASE_ADDR(pCommand->u.roamCmd.pRoamBssEntry, tCsrScanResult, Link); /*If concurrency enabled take the concurrent connected channel first. */ /* Valid multichannel concurrent sessions exempted */ - if (vos_concurrent_sessions_running() && - !csrIsValidMcConcurrentSession(pMac, sessionId, &pScanResult->Result.BssDescriptor)) + if (vos_concurrent_open_sessions_running() && + !csrIsValidMcConcurrentSession(pMac, sessionId, + &pScanResult->Result.BssDescriptor)) { concurrentChannel = csrGetConcurrentOperationChannel(pMac); @@ -6731,8 +6732,10 @@ eHalStatus csrRoamConnect(tpAniSirGlobal pMac, tANI_U32 sessionId, tCsrRoamProfi csrScanCancelIdleScan(pMac); //Only abort the scan if it is not used for other roam/connect purpose csrScanAbortMacScan(pMac, sessionId, eCSR_SCAN_ABORT_DEFAULT); - if (!vos_concurrent_sessions_running() && (VOS_STA_SAP_MODE == pProfile->csrPersona))//In case of AP mode we do not want idle mode scan + if (!vos_concurrent_open_sessions_running() && + (VOS_STA_SAP_MODE == pProfile->csrPersona)) { + /* In case of AP mode we do not want idle mode scan */ csrScanDisable(pMac); } csrRoamRemoveDuplicateCommand(pMac, sessionId, NULL, eCsrHddIssued); @@ -13672,6 +13675,47 @@ csrSendChngMCCBeaconInterval(tpAniSirGlobal pMac, tANI_U32 sessionId) return status; } +#ifdef QCA_HT_2040_COEX +eHalStatus csrSetHT2040Mode(tpAniSirGlobal pMac, tANI_U32 sessionId, ePhyChanBondState cbMode) +{ + tpSirSetHT2040Mode pMsg; + tANI_U16 len = 0; + eHalStatus status = eHAL_STATUS_SUCCESS; + tCsrRoamSession *pSession = CSR_GET_SESSION( pMac, sessionId ); + + if(!pSession) + { + smsLog(pMac, LOGE, FL(" session %d not found "), sessionId); + return eHAL_STATUS_FAILURE; + } + + /* Create the message and send to lim */ + len = sizeof(tSirSetHT2040Mode); + pMsg = vos_mem_malloc(len); + if ( NULL == pMsg ) + status = eHAL_STATUS_FAILURE; + else + status = eHAL_STATUS_SUCCESS; + if(HAL_STATUS_SUCCESS(status)) + { + vos_mem_set(pMsg, sizeof(tSirSetHT2040Mode), 0); + pMsg->messageType = eWNI_SME_SET_HT_2040_MODE; + pMsg->length = len; + + // bssId + vos_mem_copy((tSirMacAddr *)pMsg->bssId, &pSession->selfMacAddr, + sizeof(tSirMacAddr)); + smsLog( pMac, LOG1, FL("CSR Attempting to set HT20/40 mode for Bssid= "MAC_ADDRESS_STR), + MAC_ADDR_ARRAY(pMsg->bssId)); + pMsg->sessionId = sessionId; + smsLog(pMac, LOG1, FL(" session %d HT20/40 mode %d"), sessionId, cbMode); + pMsg->cbMode = cbMode; + status = palSendMBMessage(pMac->hHdd, pMsg); + } + return status; +} +#endif + eHalStatus csrSendMBDeauthReqMsg( tpAniSirGlobal pMac, tANI_U32 sessionId, tSirMacAddr bssId, tANI_U16 reasonCode ) { eHalStatus status = eHAL_STATUS_SUCCESS; diff --git a/CORE/SME/src/csr/csrApiScan.c b/CORE/SME/src/csr/csrApiScan.c index 16c45fcaacef..193cfa8e85e0 100644 --- a/CORE/SME/src/csr/csrApiScan.c +++ b/CORE/SME/src/csr/csrApiScan.c @@ -6877,7 +6877,8 @@ eHalStatus csrScanTriggerIdleScan(tpAniSirGlobal pMac, tANI_U32 *pTimeInterval) eHalStatus status = eHAL_STATUS_CSR_WRONG_STATE; //Do not trigger IMPS in case of concurrency - if (vos_concurrent_sessions_running() && csrIsAnySessionInConnectState(pMac)) + if (vos_concurrent_open_sessions_running() && + csrIsAnySessionInConnectState(pMac)) { smsLog( pMac, LOG1, FL("Cannot request IMPS because Concurrent Sessions Running") ); return (status); @@ -7017,7 +7018,7 @@ void csrScanCancelIdleScan(tpAniSirGlobal pMac) if(eANI_BOOLEAN_FALSE == pMac->scan.fCancelIdleScan) { - if (vos_concurrent_sessions_running()) { + if (vos_concurrent_open_sessions_running()) { return; } smsLog(pMac, LOG1, " csrScanCancelIdleScan"); diff --git a/CORE/SME/src/csr/csrInsideApi.h b/CORE/SME/src/csr/csrInsideApi.h index 2db987d33d1a..f283a82b29f9 100644 --- a/CORE/SME/src/csr/csrInsideApi.h +++ b/CORE/SME/src/csr/csrInsideApi.h @@ -992,3 +992,7 @@ eHalStatus csrUpdateChannelList(tpAniSirGlobal pMac); eHalStatus csrRoamDelPMKIDfromCache( tpAniSirGlobal pMac, tANI_U32 sessionId, tANI_U8 *pBSSId ); #endif + +#ifdef QCA_HT_2040_COEX +eHalStatus csrSetHT2040Mode(tpAniSirGlobal pMac, tANI_U32 sessionId, ePhyChanBondState cbMode); +#endif diff --git a/CORE/SME/src/pmc/pmc.c b/CORE/SME/src/pmc/pmc.c index 60e4e7e22020..768cc8053ee9 100644 --- a/CORE/SME/src/pmc/pmc.c +++ b/CORE/SME/src/pmc/pmc.c @@ -2538,7 +2538,7 @@ tANI_BOOLEAN pmcShouldBmpsTimerRun( tpAniSirGlobal pMac ) return eANI_BOOLEAN_FALSE; } - if ((vos_concurrent_sessions_running()) && + if ((vos_concurrent_open_sessions_running()) && ((csrIsConcurrentInfraConnected( pMac ) || (vos_get_concurrency_mode()& VOS_SAP) || (vos_get_concurrency_mode()& VOS_P2P_GO)))) diff --git a/CORE/SME/src/pmc/pmcApi.c b/CORE/SME/src/pmc/pmcApi.c index fddb5a37affd..194a99c5b722 100644 --- a/CORE/SME/src/pmc/pmcApi.c +++ b/CORE/SME/src/pmc/pmcApi.c @@ -1653,7 +1653,7 @@ tANI_BOOLEAN pmcValidateConnectState( tHalHandle hHal ) pmcLog(pMac, LOGW, "PMC: BT-AMP exists. BMPS cannot be entered"); return eANI_BOOLEAN_FALSE; } - if ((vos_concurrent_sessions_running()) && + if ((vos_concurrent_open_sessions_running()) && (csrIsConcurrentInfraConnected( pMac ) || (vos_get_concurrency_mode()& VOS_SAP) || (vos_get_concurrency_mode()& VOS_P2P_GO))) diff --git a/CORE/SME/src/sme_common/sme_Api.c b/CORE/SME/src/sme_common/sme_Api.c index a8cf64f3b450..f47a7760f627 100644 --- a/CORE/SME/src/sme_common/sme_Api.c +++ b/CORE/SME/src/sme_common/sme_Api.c @@ -11629,6 +11629,121 @@ VOS_STATUS sme_notify_modem_power_state(tHalHandle hHal, tANI_U32 value) return VOS_STATUS_SUCCESS; } +#ifdef QCA_HT_2040_COEX +VOS_STATUS sme_notify_ht2040_mode(tHalHandle hHal, tANI_U16 staId, + v_MACADDR_t macAddrSTA, v_U8_t sessionId, tANI_U8 channel_type) +{ + vos_msg_t msg; + tUpdateVHTOpMode *pHtOpMode = NULL; + tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); + + if (NULL == pMac) + { + return VOS_STATUS_E_FAILURE; + } + + pHtOpMode = vos_mem_malloc(sizeof(tUpdateVHTOpMode)); + if ( NULL == pHtOpMode ) + { + VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, + "%s: Not able to allocate memory for setting OP mode", + __func__); + return VOS_STATUS_E_FAILURE; + } + + switch (channel_type) + { + case eHT_CHAN_HT20: + pHtOpMode->opMode = eHT_CHANNEL_WIDTH_20MHZ; + break; + + case eHT_CHAN_HT40MINUS: + case eHT_CHAN_HT40PLUS: + pHtOpMode->opMode = eHT_CHANNEL_WIDTH_40MHZ; + break; + + default: + VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, + "%s: Invalid OP mode", + __func__); + return VOS_STATUS_E_FAILURE; + } + + pHtOpMode->staId = staId, + vos_mem_copy(pHtOpMode->peer_mac, macAddrSTA.bytes, + sizeof(tSirMacAddr)); + pHtOpMode->smesessionId = sessionId; + + msg.type = WDA_UPDATE_OP_MODE; + msg.reserved = 0; + msg.bodyptr = pHtOpMode; + if (!VOS_IS_STATUS_SUCCESS(vos_mq_post_message(VOS_MODULE_ID_WDA, &msg))) + { + VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, + "%s: Not able to post WDA_UPDATE_OP_MODE message" + " to WDA", __func__); + vos_mem_free(pHtOpMode); + return VOS_STATUS_E_FAILURE; + } + + VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, + "%s: Notifed FW about OP mode: %d for staId=%d", + __func__, pHtOpMode->opMode, staId); + + + return VOS_STATUS_SUCCESS; +} + +/* --------------------------------------------------------------------------- + + \fn sme_SetHT2040Mode + + \brief To update HT Operation beacon IE. + + \param + + \return eHalStatus SUCCESS + FAILURE or RESOURCES + The API finished and failed. + + -------------------------------------------------------------------------------*/ +eHalStatus sme_SetHT2040Mode(tHalHandle hHal, tANI_U8 sessionId, tANI_U8 channel_type) +{ + eHalStatus status = eHAL_STATUS_FAILURE; + tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); + ePhyChanBondState cbMode; + + VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, + "%s: Update HT operation beacon IE, channel_type=%d", + __func__, channel_type); + + switch (channel_type) + { + case eHT_CHAN_HT20: + cbMode = PHY_SINGLE_CHANNEL_CENTERED; + break; + case eHT_CHAN_HT40MINUS: + cbMode = PHY_DOUBLE_CHANNEL_HIGH_PRIMARY; + break; + case eHT_CHAN_HT40PLUS: + cbMode = PHY_DOUBLE_CHANNEL_LOW_PRIMARY; + break; + default: + VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, + "%s:Error!!! Invalid HT20/40 mode !", + __func__); + return VOS_STATUS_E_FAILURE; + } + status = sme_AcquireGlobalLock(&pMac->sme); + if (HAL_STATUS_SUCCESS(status)) + { + status = csrSetHT2040Mode(pMac, sessionId, cbMode); + sme_ReleaseGlobalLock(&pMac->sme ); + } + return (status); +} +#endif + /* * SME API to enable/disable idle mode powersave * This should be called only if powersave offload diff --git a/CORE/TL/src/wlan_qct_tl.c b/CORE/TL/src/wlan_qct_tl.c index eea191c7d443..281517dda52d 100644 --- a/CORE/TL/src/wlan_qct_tl.c +++ b/CORE/TL/src/wlan_qct_tl.c @@ -2000,12 +2000,12 @@ WLANTL_STAPktPending -----------------------------------------------------------------------*/ #ifdef FETURE_WLAN_TDLS if ((WLAN_STA_SOFTAP != pClientSTA->wSTADesc.wSTAType) && - !(vos_concurrent_sessions_running()) && + !(vos_concurrent_open_sessions_running()) && !pTLCb->ucTdlsPeerCount) { #else if ((WLAN_STA_SOFTAP != pClientSTA->wSTADesc.wSTAType) && - !(vos_concurrent_sessions_running())) + !(vos_concurrent_open_sessions_running())) { #endif @@ -6731,12 +6731,12 @@ WLANTL_STATxConn ------------------------------------------------------------------------*/ #ifdef FEATURE_WLAN_TDLS if ((WLAN_STA_SOFTAP != pClientSTA->wSTADesc.wSTAType) && - (!vos_concurrent_sessions_running()) && + (!vos_concurrent_open_sessions_running()) && !pTLCb->ucTdlsPeerCount) { #else if ((WLAN_STA_SOFTAP != pClientSTA->wSTADesc.wSTAType) && - (!vos_concurrent_sessions_running())) + (!vos_concurrent_open_sessions_running())) { #endif ucAC = pClientSTA->ucCurrentAC; @@ -6792,29 +6792,6 @@ WLANTL_STATxConn /*------------------------------------------------------------------------ Fetch tx packet from HDD ------------------------------------------------------------------------*/ -//LTI -#if 0 - if (WLAN_STA_SOFTAP != pTLCb->atlSTAClients[ucSTAId].wSTADesc.wSTAType && - (!vos_concurrent_sessions_running())) - { - // don't set 0. - //vos_atomic_set_U8( &pTLCb->atlSTAClients[ucSTAId].ucPktPending, 0); - vosStatus = pTLCb->atlSTAClients[ucSTAId].pfnSTAFetchPkt( pvosGCtx, - &ucSTAId, - pTLCb->atlSTAClients[ucSTAId].ucCurrentAC, - &vosDataBuff, &tlMetaInfo ); - } - else - { - //softap case - WLANTL_ACEnumType ucAC = pTLCb->uCurServedAC; - vosStatus = pTLCb->atlSTAClients[ucSTAId].pfnSTAFetchPkt( pvosGCtx, - &ucSTAId, - ucAC, - &vosDataBuff, &tlMetaInfo ); - } -#endif - vosStatus = pClientSTA->pfnSTAFetchPkt( pvosGCtx, &ucSTAId, ucAC, @@ -7105,12 +7082,12 @@ WLANTL_STATxAuth ------------------------------------------------------------------------*/ #ifdef FEATURE_WLAN_TDLS if ((WLAN_STA_SOFTAP != pStaClient->wSTADesc.wSTAType) && - (!vos_concurrent_sessions_running()) && + (!vos_concurrent_open_sessions_running()) && !pTLCb->ucTdlsPeerCount) { #else if ((WLAN_STA_SOFTAP != pStaClient->wSTADesc.wSTAType) && - (!vos_concurrent_sessions_running())) + (!vos_concurrent_open_sessions_running())) { #endif ucAC = pStaClient->ucCurrentAC; @@ -10381,9 +10358,11 @@ WLAN_TLGetNextTxIds } #ifdef FEATURE_WLAN_TDLS - if ((eSYSTEM_AP_ROLE == systemRole) || (vos_concurrent_sessions_running()) || pTLCb->ucTdlsPeerCount) + if ((eSYSTEM_AP_ROLE == systemRole) || + (vos_concurrent_open_sessions_running()) || pTLCb->ucTdlsPeerCount) #else - if ((eSYSTEM_AP_ROLE == systemRole) || (vos_concurrent_sessions_running())) + if ((eSYSTEM_AP_ROLE == systemRole) || + (vos_concurrent_open_sessions_running())) #endif { return WLAN_TLAPGetNextTxIds(pvosGCtx,pucSTAId); diff --git a/CORE/VOSS/inc/vos_getBin.h b/CORE/VOSS/inc/vos_getBin.h index 15c4508d9c2a..e5c96a35be04 100644 --- a/CORE/VOSS/inc/vos_getBin.h +++ b/CORE/VOSS/inc/vos_getBin.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013 The Linux Foundation. All rights reserved. + * Copyright (c) 2013-2014 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -137,6 +137,7 @@ VOS_STATUS vos_get_binary_blob( VOS_BINARY_ID binaryId, -----------------------------------------------------------------------------*/ tVOS_CON_MODE vos_get_conparam( void ); tVOS_CONCURRENCY_MODE vos_get_concurrency_mode( void ); -v_BOOL_t vos_concurrent_sessions_running(void); +v_BOOL_t vos_concurrent_open_sessions_running(void); +v_BOOL_t vos_max_concurrent_connections_reached(void); #endif // !defined __VOS_GETBIN_H diff --git a/CORE/VOSS/src/vos_api.c b/CORE/VOSS/src/vos_api.c index 8771762c1b9e..0c608260b4fa 100644 --- a/CORE/VOSS/src/vos_api.c +++ b/CORE/VOSS/src/vos_api.c @@ -434,6 +434,10 @@ VOS_STATUS vos_open( v_CONTEXT_t *pVosContext, v_SIZE_t hddContextSize ) if (pHddCtx->cfg_ini->ssdp) macOpenParms.ssdp = pHddCtx->cfg_ini->ssdp; #endif +#ifdef FEATURE_WLAN_RA_FILTERING + macOpenParms.RArateLimitInterval = pHddCtx->cfg_ini->RArateLimitInterval; + macOpenParms.IsRArateLimitEnabled = pHddCtx->cfg_ini->IsRArateLimitEnabled; +#endif macOpenParms.apMaxOffloadPeers = pHddCtx->cfg_ini->apMaxOffloadPeers; diff --git a/CORE/VOSS/src/vos_getBin.c b/CORE/VOSS/src/vos_getBin.c index f38a1a834b2f..2d10d66f5d05 100644 --- a/CORE/VOSS/src/vos_getBin.c +++ b/CORE/VOSS/src/vos_getBin.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2013 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2014 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -141,7 +141,7 @@ tVOS_CONCURRENCY_MODE vos_get_concurrency_mode( void ) return con_mode; } -v_BOOL_t vos_concurrent_sessions_running(void) +v_BOOL_t vos_concurrent_open_sessions_running(void) { v_U8_t i=0; v_U8_t j=0; @@ -155,10 +155,48 @@ v_BOOL_t vos_concurrent_sessions_running(void) { for (i=0; i < VOS_MAX_NO_OF_MODE; i++) { - j += pHddCtx->no_of_sessions[i]; + j += pHddCtx->no_of_open_sessions[i]; } } } return (j>1); } + +/**--------------------------------------------------------------------------- + * + * \brief vos_max_concurrent_connections_reached() + * + * This function checks for presence of concurrency where more than + * one connection exists and it returns TRUE if the max concurrency is + * reached. + * + * Example: + * STA + STA (wlan0 and wlan1 are connected) - returns TRUE + * STA + STA (wlan0 connected and wlan1 disconnected) - returns FALSE + * DUT with P2P-GO + P2P-CLIENT connection) - returns TRUE + * + * \param - None + * + * \return - VOS_TRUE or VOS_FALSE + * + * --------------------------------------------------------------------------*/ +v_BOOL_t vos_max_concurrent_connections_reached (void) +{ + v_U8_t i = 0, j = 0; + hdd_context_t *pHddCtx; + v_CONTEXT_t pVosContext = vos_get_global_context(VOS_MODULE_ID_HDD, NULL); + + if (NULL != pVosContext) { + pHddCtx = vos_get_context(VOS_MODULE_ID_HDD, pVosContext); + if (NULL != pHddCtx) { + for (i = 0; i < VOS_MAX_NO_OF_MODE; i++) + j += pHddCtx->no_of_active_sessions[i]; + + return (j > (pHddCtx->cfg_ini->gMaxConcurrentActiveSessions - 1)); + } + } + + return VOS_FALSE; +} + @@ -981,6 +981,7 @@ CDEFINES := -DANI_LITTLE_BYTE_ENDIAN \ -DWLAN_FEATURE_ROAM_SCAN_OFFLOAD \ -DWLAN_FEATURE_GTK_OFFLOAD \ -DWLAN_WAKEUP_EVENTS \ + -DFEATURE_WLAN_RA_FILTERING\ -DWLAN_KD_READY_NOTIFIER \ -DWLAN_NL80211_TESTMODE \ -DFEATURE_WLAN_BATCH_SCAN \ @@ -1287,6 +1288,9 @@ CDEFINES += -DFEATURE_GREEN_AP #Enable 4address scheme for mdm9630 CDEFINES += -DFEATURE_WLAN_STA_4ADDR_SCHEME +#Enable OBSS feature for mdm9630 +CDEFINES += -DQCA_HT_2040_COEX + else #Open P2P device interface only for non-MDM9630 platform diff --git a/firmware_bin/WCNSS_qcom_cfg.ini b/firmware_bin/WCNSS_qcom_cfg.ini index 13490c3c53d2..f8ab0f6108c7 100755 --- a/firmware_bin/WCNSS_qcom_cfg.ini +++ b/firmware_bin/WCNSS_qcom_cfg.ini @@ -559,6 +559,14 @@ gBusBandwidthComputeInterval=3000 # Regulatory Setting; 0=STRICT; 1=CUSTOM gRegulatoryChangeCountry=1 +# RA filtering rate limit param, the current value would not +# help if the lifetime in RA is less than 3*60=3min. Then +# we need to change it, though it is uncommon. +# gRAFilterEnable=0 +gRArateLimitInterval=60 + +# Maximum number of concurrent connections +gMaxConcurrentActiveSessions=2 END |
