From a0250c55f1ccc047be36c1ee09776ae5ac5851b8 Mon Sep 17 00:00:00 2001 From: Naveen Rawat Date: Mon, 26 Jan 2015 17:57:28 -0800 Subject: qcacld: enable/disable SAP-MCC channel avoidance from config ini This change provides an option to disable and enable SAP-MCC channel avoidance feature though INI. Change-Id: I71c7771c3925202e95a1450fdcc14794ba60f799 CRs-Fixed: 786945 --- CORE/HDD/inc/wlan_hdd_cfg.h | 10 ++++++++++ CORE/HDD/src/wlan_hdd_cfg.c | 23 +++++++++++++++++++++ CORE/SAP/inc/sapApi.h | 3 +++ CORE/SAP/src/sapChSelect.c | 14 +++++++------ CORE/SAP/src/sapFsm.c | 3 ++- CORE/SERVICES/WMA/wma.c | 42 ++++++++++++++++++++++++++++++++++++--- CORE/SME/inc/sme_Api.h | 3 +++ CORE/SME/src/sme_common/sme_Api.c | 7 +++++++ 8 files changed, 95 insertions(+), 10 deletions(-) diff --git a/CORE/HDD/inc/wlan_hdd_cfg.h b/CORE/HDD/inc/wlan_hdd_cfg.h index 55b54000163b..9de32d109503 100644 --- a/CORE/HDD/inc/wlan_hdd_cfg.h +++ b/CORE/HDD/inc/wlan_hdd_cfg.h @@ -2762,6 +2762,13 @@ enum dot11p_mode { #define CFG_STA_MIRACAST_MCC_REST_TIME_VAL_MAX (500) #define CFG_STA_MIRACAST_MCC_REST_TIME_VAL_DEFAULT (400) +#ifdef FEATURE_AP_MCC_CH_AVOIDANCE +#define CFG_SAP_MCC_CHANNEL_AVOIDANCE_NAME "gSapChannelAvoidance" +#define CFG_SAP_MCC_CHANNEL_AVOIDANCE_MIN ( 0 ) +#define CFG_SAP_MCC_CHANNEL_AVOIDANCE_MAX ( 1 ) +#define CFG_SAP_MCC_CHANNEL_AVOIDANCE_DEFAULT ( 0 ) +#endif /* FEATURE_AP_MCC_CH_AVOIDANCE */ + /*--------------------------------------------------------------------------- Type declarations -------------------------------------------------------------------------*/ @@ -3359,6 +3366,9 @@ typedef struct uint16_t p2p_listen_defer_interval; uint8_t sap_dot11mc; uint32_t sta_miracast_mcc_rest_time_val; +#ifdef FEATURE_AP_MCC_CH_AVOIDANCE + bool sap_channel_avoidance; +#endif /* FEATURE_AP_MCC_CH_AVOIDANCE */ } hdd_config_t; #ifdef WLAN_FEATURE_MBSSID diff --git a/CORE/HDD/src/wlan_hdd_cfg.c b/CORE/HDD/src/wlan_hdd_cfg.c index c56b6973598d..18942087f3ac 100644 --- a/CORE/HDD/src/wlan_hdd_cfg.c +++ b/CORE/HDD/src/wlan_hdd_cfg.c @@ -3565,6 +3565,17 @@ REG_TABLE_ENTRY g_registry_table[] = CFG_STA_MIRACAST_MCC_REST_TIME_VAL_DEFAULT, CFG_STA_MIRACAST_MCC_REST_TIME_VAL_MIN, CFG_STA_MIRACAST_MCC_REST_TIME_VAL_MAX ), + +#ifdef FEATURE_AP_MCC_CH_AVOIDANCE + REG_VARIABLE(CFG_SAP_MCC_CHANNEL_AVOIDANCE_NAME, + WLAN_PARAM_Integer, + hdd_config_t, + sap_channel_avoidance, + VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK, + CFG_SAP_MCC_CHANNEL_AVOIDANCE_DEFAULT, + CFG_SAP_MCC_CHANNEL_AVOIDANCE_MIN, + CFG_SAP_MCC_CHANNEL_AVOIDANCE_MAX ), +#endif /* FEATURE_AP_MCC_CH_AVOIDANCE */ }; #ifdef WLAN_FEATURE_MBSSID @@ -3874,6 +3885,12 @@ void print_hdd_cfg(hdd_context_t *pHddCtx) VOS_TRACE (VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO_HIGH, "Name = [gApProtection] value = [%u]",pHddCtx->cfg_ini->apProtection); VOS_TRACE (VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO_HIGH, "Name = [gEnableApOBSSProt] value = [%u]",pHddCtx->cfg_ini->apOBSSProtEnabled); VOS_TRACE (VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO_HIGH, "Name = [gApAutoChannelSelection] value = [%u]",pHddCtx->cfg_ini->apAutoChannelSelection); +#ifdef FEATURE_AP_MCC_CH_AVOIDANCE + VOS_TRACE (VOS_MODULE_ID_HDD, + VOS_TRACE_LEVEL_INFO_HIGH, + "Name = [sap_channel_avoidance] value = [%u]", + pHddCtx->cfg_ini->sap_channel_avoidance); +#endif /* FEATURE_AP_MCC_CH_AVOIDANCE */ VOS_TRACE (VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO_HIGH, "Name = [gACSAllowedChannels] value = [%s]", pHddCtx->cfg_ini->acsAllowedChnls); VOS_TRACE (VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO_HIGH, "Name = [gACSBandSwitchThreshold] value = [%u]", pHddCtx->cfg_ini->acsBandSwitchThreshold); @@ -5409,6 +5426,7 @@ v_BOOL_t hdd_update_config_dat( hdd_context_t *pHddCtx ) ccmCfgGetInt(pHddCtx->hHal, WNI_CFG_VHT_BASIC_MCS_SET, &temp); temp = (temp & 0xFFFC) | pConfig->vhtRxMCS; + if (pConfig->enable2x2) temp = (temp & 0xFFF3) | (pConfig->vhtRxMCS2x2 << 2); @@ -6039,6 +6057,11 @@ VOS_STATUS hdd_set_sme_config( hdd_context_t *pHddCtx ) smeConfig->f_sta_miracast_mcc_rest_time_val = pHddCtx->cfg_ini->sta_miracast_mcc_rest_time_val; +#ifdef FEATURE_AP_MCC_CH_AVOIDANCE + smeConfig->sap_channel_avoidance = + pHddCtx->cfg_ini->sap_channel_avoidance; +#endif /* FEATURE_AP_MCC_CH_AVOIDANCE */ + halStatus = sme_UpdateConfig( pHddCtx->hHal, smeConfig); if ( !HAL_STATUS_SUCCESS( halStatus ) ) { diff --git a/CORE/SAP/inc/sapApi.h b/CORE/SAP/inc/sapApi.h index 17b79241d80f..c7b5e687ec29 100644 --- a/CORE/SAP/inc/sapApi.h +++ b/CORE/SAP/inc/sapApi.h @@ -637,6 +637,9 @@ typedef struct tagSapStruct //Information Required for SAP DFS Master mode tSapDfsInfo SapDfsInfo; tSapCtxList sapCtxList[SAP_MAX_NUM_SESSION]; +#ifdef FEATURE_AP_MCC_CH_AVOIDANCE + bool sap_channel_avoidance; +#endif /* FEATURE_AP_MCC_CH_AVOIDANCE */ } tSapStruct, *tpSapStruct; #define WPS_PROBRSP_VER_PRESENT 0x00000001 diff --git a/CORE/SAP/src/sapChSelect.c b/CORE/SAP/src/sapChSelect.c index dfd798b91adf..7dbeed27f748 100644 --- a/CORE/SAP/src/sapChSelect.c +++ b/CORE/SAP/src/sapChSelect.c @@ -789,12 +789,14 @@ v_BOOL_t sapChanSelInit(tHalHandle halHandle, chSafe = VOS_TRUE; #ifdef FEATURE_AP_MCC_CH_AVOIDANCE - if(sap_check_in_avoid_ch_list(pSapCtx, *pChans)) { - VOS_TRACE(VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_HIGH, - "Ch %d used by another MDM device with SAP in MCC", - *pChans); - chSafe = VOS_FALSE; - continue; + if(pMac->sap.sap_channel_avoidance) { + if(sap_check_in_avoid_ch_list(pSapCtx, *pChans)) { + VOS_TRACE(VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_HIGH, + "Ch %d used by another MDM device with SAP in MCC", + *pChans); + chSafe = VOS_FALSE; + continue; + } } #endif /* FEATURE_AP_MCC_CH_AVOIDANCE */ diff --git a/CORE/SAP/src/sapFsm.c b/CORE/SAP/src/sapFsm.c index dfcb8d22712b..0792b8841a07 100644 --- a/CORE/SAP/src/sapFsm.c +++ b/CORE/SAP/src/sapFsm.c @@ -1489,7 +1489,8 @@ static v_U8_t sapRandomChannelSel(ptSapContext sapContext) #ifdef FEATURE_AP_MCC_CH_AVOIDANCE /* avoid channels on which another MDM AP in MCC mode is detected. */ - if (sapContext->sap_detected_avoid_ch_ie.present) { + if (pMac->sap.sap_channel_avoidance + && sapContext->sap_detected_avoid_ch_ie.present) { for( j=0; j < sizeof(sapContext->sap_detected_avoid_ch_ie.channels); j++) { diff --git a/CORE/SERVICES/WMA/wma.c b/CORE/SERVICES/WMA/wma.c index 18efc5ba21b5..67dc1df31047 100644 --- a/CORE/SERVICES/WMA/wma.c +++ b/CORE/SERVICES/WMA/wma.c @@ -1008,6 +1008,15 @@ static int wma_vdev_start_rsp_ind(tp_wma_handle wma, u_int8_t *buf) struct wma_target_req *req_msg; struct wma_txrx_node *iface; wmi_vdev_start_response_event_fixed_param *resp_event; +#ifdef FEATURE_AP_MCC_CH_AVOIDANCE + tpAniSirGlobal mac_ctx = (tpAniSirGlobal)vos_get_context( + VOS_MODULE_ID_PE, + wma->vos_context); + if (NULL == mac_ctx) { + WMA_LOGE("%s: Failed to get mac_ctx", __func__); + return -EINVAL; + } +#endif /* FEATURE_AP_MCC_CH_AVOIDANCE */ resp_event = (wmi_vdev_start_response_event_fixed_param *)buf; @@ -1047,7 +1056,8 @@ static int wma_vdev_start_rsp_ind(tp_wma_handle wma, u_int8_t *buf) vos_timer_stop(&req_msg->event_timeout); #ifdef FEATURE_AP_MCC_CH_AVOIDANCE - if (resp_event->status == VOS_STATUS_SUCCESS) + if (resp_event->status == VOS_STATUS_SUCCESS + && mac_ctx->sap.sap_channel_avoidance) wma_find_mcc_ap(wma, resp_event->vdev_id, true); #endif /* FEATURE_AP_MCC_CH_AVOIDANCE */ @@ -1768,6 +1778,15 @@ static int wma_vdev_stop_ind(tp_wma_handle wma, u_int8_t *buf) u_int8_t peer_id; struct wma_txrx_node *iface; int32_t status = 0; +#ifdef FEATURE_AP_MCC_CH_AVOIDANCE + tpAniSirGlobal mac_ctx = (tpAniSirGlobal)vos_get_context( + VOS_MODULE_ID_PE, + wma->vos_context); + if (NULL == mac_ctx) { + WMA_LOGE("%s: Failed to get mac_ctx", __func__); + return -EINVAL; + } +#endif /* FEATURE_AP_MCC_CH_AVOIDANCE */ WMA_LOGI("%s: Enter", __func__); if (!buf) { @@ -1845,7 +1864,10 @@ static int wma_vdev_stop_ind(tp_wma_handle wma, u_int8_t *buf) } else { wma->interfaces[resp_event->vdev_id].vdev_up = FALSE; #ifdef FEATURE_AP_MCC_CH_AVOIDANCE - wma_find_mcc_ap(wma, resp_event->vdev_id, false); + if (mac_ctx->sap.sap_channel_avoidance) + wma_find_mcc_ap(wma, + resp_event->vdev_id, + false); #endif /* FEATURE_AP_MCC_CH_AVOIDANCE */ } ol_txrx_vdev_flush(iface->handle); @@ -9851,6 +9873,9 @@ void wma_vdev_resp_timer(void *data) ol_txrx_pdev_handle pdev; u_int8_t peer_id; struct wma_target_req *msg; +#ifdef FEATURE_AP_MCC_CH_AVOIDANCE + tpAniSirGlobal mac_ctx = NULL; +#endif /* FEATURE_AP_MCC_CH_AVOIDANCE */ wma = (tp_wma_handle) vos_get_context(VOS_MODULE_ID_WDA, vos_context); @@ -9867,6 +9892,16 @@ void wma_vdev_resp_timer(void *data) goto free_tgt_req; } +#ifdef FEATURE_AP_MCC_CH_AVOIDANCE + mac_ctx = (tpAniSirGlobal)vos_get_context(VOS_MODULE_ID_PE, + wma->vos_context); + if (NULL == mac_ctx) { + WMA_LOGE("%s: Failed to get mac_ctx", __func__); + vos_timer_stop(&tgt_req->event_timeout); + goto free_tgt_req; + } +#endif /* FEATURE_AP_MCC_CH_AVOIDANCE */ + WMA_LOGA("%s: request %d is timed out for vdev_id - %d", __func__, tgt_req->msg_type, tgt_req->vdev_id); msg = wma_find_vdev_req(wma, tgt_req->vdev_id, tgt_req->type); @@ -9930,7 +9965,8 @@ void wma_vdev_resp_timer(void *data) } else { wma->interfaces[tgt_req->vdev_id].vdev_up = FALSE; #ifdef FEATURE_AP_MCC_CH_AVOIDANCE - wma_find_mcc_ap(wma, tgt_req->vdev_id, false); + if (mac_ctx->sap.sap_channel_avoidance) + wma_find_mcc_ap(wma, tgt_req->vdev_id, false); #endif /* FEATURE_AP_MCC_CH_AVOIDANCE */ } ol_txrx_vdev_flush(iface->handle); diff --git a/CORE/SME/inc/sme_Api.h b/CORE/SME/inc/sme_Api.h index 4fa5754f60be..2ce58971a33b 100644 --- a/CORE/SME/inc/sme_Api.h +++ b/CORE/SME/inc/sme_Api.h @@ -122,6 +122,9 @@ typedef struct _smeConfigParams bool enable_bus_auto_suspend; #endif uint32_t f_sta_miracast_mcc_rest_time_val; +#ifdef FEATURE_AP_MCC_CH_AVOIDANCE + bool sap_channel_avoidance; +#endif /* FEATURE_AP_MCC_CH_AVOIDANCE */ } tSmeConfigParams, *tpSmeConfigParams; typedef enum diff --git a/CORE/SME/src/sme_common/sme_Api.c b/CORE/SME/src/sme_common/sme_Api.c index 92b996fc6d96..54c580364a62 100644 --- a/CORE/SME/src/sme_common/sme_Api.c +++ b/CORE/SME/src/sme_common/sme_Api.c @@ -1663,6 +1663,10 @@ eHalStatus sme_UpdateConfig(tHalHandle hHal, tpSmeConfigParams pSmeConfigParams) pMac->f_sta_miracast_mcc_rest_time_val = pSmeConfigParams->f_sta_miracast_mcc_rest_time_val; +#ifdef FEATURE_AP_MCC_CH_AVOIDANCE + pMac->sap.sap_channel_avoidance = pSmeConfigParams->sap_channel_avoidance; +#endif /* FEATURE_AP_MCC_CH_AVOIDANCE */ + return status; } @@ -4430,6 +4434,9 @@ eHalStatus sme_GetConfigParam(tHalHandle hHal, tSmeConfigParams *pParam) sme_ReleaseGlobalLock( &pMac->sme ); return status; } +#ifdef FEATURE_AP_MCC_CH_AVOIDANCE + pParam->sap_channel_avoidance = pMac->sap.sap_channel_avoidance; +#endif /* FEATURE_AP_MCC_CH_AVOIDANCE */ pParam->fScanOffload = pMac->fScanOffload; pParam->fP2pListenOffload = pMac->fP2pListenOffload; pParam->max_intf_count = pMac->sme.max_intf_count; -- cgit v1.2.3 From 74c0b152de8a5679a8632ed1805e78d4875091ee Mon Sep 17 00:00:00 2001 From: Krunal Soni Date: Wed, 4 Feb 2015 13:52:41 -0800 Subject: qcacld: Fix to add overlapped channels in 2.4Ghz to blocklist. This fix will add the channels to blocklist which are overlapped to primary channel received in Q2Q ie. CRs-Fixed: 791369 Change-Id: I3d4ef249b2f68605ac556639ba34f35cb98665fd --- CORE/SAP/src/sapChSelect.c | 62 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) diff --git a/CORE/SAP/src/sapChSelect.c b/CORE/SAP/src/sapChSelect.c index 7dbeed27f748..83a7e0f3f5a4 100644 --- a/CORE/SAP/src/sapChSelect.c +++ b/CORE/SAP/src/sapChSelect.c @@ -252,6 +252,66 @@ sap_check_n_add_channel(ptSapContext sap_ctx, return true; } +/** + * sap_check_n_add_overlapped_chnls() - checks & add overlapped channels + * to primary channel in 2.4Ghz band. + * @sap_ctx: sap context. + * @primary_chnl: primary channel to be avoided. + * + * sap_ctx contains sap_avoid_ch_info struct containing the list of channels on + * which MDM device's AP with MCC was detected. This function will add channels + * to that list after checking for duplicates. + * + * Return: true: if channel was added or already present + * else false: if channel list was already full. + */ +static bool +sap_check_n_add_overlapped_chnls(ptSapContext sap_ctx, + uint8_t primary_channel) +{ + uint8_t i = 0, j = 0, upper_chnl = 0, lower_chnl = 0; + struct sap_avoid_channels_info *ie_info = + &sap_ctx->sap_detected_avoid_ch_ie; + /* + * if primary channel less than channel 1 or out of 2g band then + * no further process is required. return true in this case. + */ + if (primary_channel < CHANNEL_1 || primary_channel > CHANNEL_14) + return true; + + /* lower channel is one channel right before primary channel */ + lower_chnl = primary_channel - 1; + /* upper channel is one channel right after primary channel */ + upper_chnl = primary_channel + 1; + + /* lower channel needs to be non-zero, zero is not valid channel */ + if (lower_chnl > (CHANNEL_1 - 1)) { + for (i = 0; i < sizeof(ie_info->channels); i++) { + if (ie_info->channels[i] == lower_chnl) + break; + if (ie_info->channels[i] == 0) { + ie_info->channels[i] = lower_chnl; + break; + } + } + } + /* upper channel needs to be atleast last channel in 2.4Ghz band */ + if (upper_chnl < (CHANNEL_14 + 1)) { + for (j = 0; j < sizeof(ie_info->channels); j++) { + if (ie_info->channels[j] == upper_chnl) + break; + if (ie_info->channels[j] == 0) { + ie_info->channels[j] = upper_chnl; + break; + } + } + } + if (i == sizeof(ie_info->channels) || j == sizeof(ie_info->channels)) + return false; + else + return true; +} + /** * sap_process_avoid_ie() - processes the detected Q2Q IE * context's avoid_channels_info struct @@ -304,6 +364,8 @@ sap_process_avoid_ie(tHalHandle hal, /* add this channel to to_avoid channel list */ sap_check_n_add_channel(sap_ctx, avoid_ch_ie->channel); + sap_check_n_add_overlapped_chnls(sap_ctx, + avoid_ch_ie->channel); } /* if (temp_ptr) */ node = sme_ScanResultGetNext(hal, scan_result); } -- cgit v1.2.3 From a9817e018b4e8865f8a39220d38081975142a0bf Mon Sep 17 00:00:00 2001 From: Ryan Hsu Date: Fri, 30 Jan 2015 17:36:12 -0800 Subject: qcacld: hdd: update the apies before restart the sap When wlan_hdd_restart_sap() happens, the vdev and pSession will be flushed, so that some AP (WPS/OBSS) IES will be flushed. So applied all the AP IES before restarting the SAP. Change-Id: I7380278b449be43869b4fe72497c829e313e2fbb CRs-fixed: 789486 --- CORE/HDD/inc/wlan_hdd_cfg80211.h | 2 + CORE/HDD/inc/wlan_hdd_main.h | 11 +++- CORE/HDD/src/wlan_hdd_cfg80211.c | 106 +++++++++++++++++++++++---------------- CORE/HDD/src/wlan_hdd_main.c | 26 +++++++--- 4 files changed, 93 insertions(+), 52 deletions(-) diff --git a/CORE/HDD/inc/wlan_hdd_cfg80211.h b/CORE/HDD/inc/wlan_hdd_cfg80211.h index 184a1d80d310..db3cb2a41872 100644 --- a/CORE/HDD/inc/wlan_hdd_cfg80211.h +++ b/CORE/HDD/inc/wlan_hdd_cfg80211.h @@ -1129,4 +1129,6 @@ static inline int wlan_hdd_send_roam_auth_event(hdd_context_t *hdd_ctx_ptr, int wlan_hdd_disable_dfs_chan_scan(hdd_context_t *pHddCtx, hdd_adapter_t *pAdapter, u32 no_dfs_flag); + +int wlan_hdd_cfg80211_update_apies(hdd_adapter_t* pHostapdAdapter); #endif diff --git a/CORE/HDD/inc/wlan_hdd_main.h b/CORE/HDD/inc/wlan_hdd_main.h index a3b03a816729..e66924487825 100644 --- a/CORE/HDD/inc/wlan_hdd_main.h +++ b/CORE/HDD/inc/wlan_hdd_main.h @@ -513,8 +513,14 @@ typedef struct hdd_wapi_info_s hdd_wapi_info_t; #endif /* FEATURE_WLAN_WAPI */ typedef struct beacon_data_s { - u8 *head, *tail; - int head_len, tail_len; + u8 *head; + u8 *tail; + u8 *proberesp_ies; + u8 *assocresp_ies; + int head_len; + int tail_len; + int proberesp_ies_len; + int assocresp_ies_len; int dtim_period; } beacon_data_t; @@ -1762,4 +1768,5 @@ int hdd_wlan_set_mcc_p2p_quota(hdd_adapter_t *hostapd_adapter, uint32_t set_value); int hdd_set_mas(hdd_adapter_t *hostapd_adapter, uint8_t filter_type); uint8_t hdd_is_mcc_in_24G(hdd_context_t *hdd_ctx); + #endif // end #if !defined( WLAN_HDD_MAIN_H ) diff --git a/CORE/HDD/src/wlan_hdd_cfg80211.c b/CORE/HDD/src/wlan_hdd_cfg80211.c index df29d8d9e204..a2e1f4f6410a 100644 --- a/CORE/HDD/src/wlan_hdd_cfg80211.c +++ b/CORE/HDD/src/wlan_hdd_cfg80211.c @@ -5878,7 +5878,8 @@ int wlan_hdd_cfg80211_alloc_new_beacon(hdd_adapter_t *pAdapter, int size; beacon_data_t *beacon = NULL; beacon_data_t *old = NULL; - int head_len,tail_len; + int head_len, tail_len, proberesp_ies_len, assocresp_ies_len; + const u8 *head, *tail, *proberesp_ies, *assocresp_ies; ENTER(); if (params->head && !params->head_len) @@ -5898,59 +5899,79 @@ int wlan_hdd_cfg80211_alloc_new_beacon(hdd_adapter_t *pAdapter, return -EINVAL; } - if(params->head) + if (params->head) { head_len = params->head_len; - else + head = params->head; + } else { head_len = old->head_len; + head = old->head; + } - if(params->tail || !old) + if (params->tail || !old) { tail_len = params->tail_len; - else + tail = params->tail; + } else { tail_len = old->tail_len; + tail = old->tail; + } + + if (params->proberesp_ies || !old) { + proberesp_ies_len = params->proberesp_ies_len; + proberesp_ies = params->proberesp_ies; + } else { + proberesp_ies_len = old->proberesp_ies_len; + proberesp_ies = old->proberesp_ies; + } - size = sizeof(beacon_data_t) + head_len + tail_len; + if (params->assocresp_ies || !old) { + assocresp_ies_len = params->assocresp_ies_len; + assocresp_ies = params->assocresp_ies; + } else { + assocresp_ies_len = old->assocresp_ies_len; + assocresp_ies = old->assocresp_ies; + } + + size = sizeof(beacon_data_t) + head_len + tail_len + + proberesp_ies_len + assocresp_ies_len; beacon = kzalloc(size, GFP_KERNEL); - if( beacon == NULL ) - { + if (beacon == NULL) { VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, FL("Mem allocation for beacon failed")); return -ENOMEM; } #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,4,0)) && !defined(WITH_BACKPORTS) - if(params->dtim_period || !old ) + if (params->dtim_period) beacon->dtim_period = params->dtim_period; else beacon->dtim_period = old->dtim_period; #else - if(dtim_period || !old ) + if (dtim_period) beacon->dtim_period = dtim_period; else beacon->dtim_period = old->dtim_period; #endif - beacon->head = ((u8 *) beacon) + sizeof(beacon_data_t); + /* ----------------------------------------------- + * | head | tail | proberesp_ies | assocresp_ies | + * ----------------------------------------------- + */ + beacon->head = ((u8 *)beacon) + sizeof(beacon_data_t); beacon->tail = beacon->head + head_len; + beacon->proberesp_ies = beacon->tail + tail_len; + beacon->assocresp_ies = beacon->proberesp_ies + proberesp_ies_len; + beacon->head_len = head_len; beacon->tail_len = tail_len; + beacon->proberesp_ies_len = proberesp_ies_len; + beacon->assocresp_ies_len= assocresp_ies_len; - if(params->head) { - memcpy (beacon->head,params->head,beacon->head_len); - } - else { - if(old) - memcpy (beacon->head,old->head,beacon->head_len); - } - - if(params->tail) { - memcpy (beacon->tail,params->tail,beacon->tail_len); - } - else { - if(old) - memcpy (beacon->tail,old->tail,beacon->tail_len); - } + memcpy(beacon->head, head, head_len); + memcpy(beacon->tail, tail, tail_len); + memcpy(beacon->proberesp_ies, proberesp_ies, proberesp_ies_len); + memcpy(beacon->assocresp_ies, assocresp_ies, assocresp_ies_len); *ppBeacon = beacon; @@ -6215,21 +6236,17 @@ static void wlan_hdd_add_extra_ie(hdd_adapter_t* pHostapdAdapter, return; } -#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,4,0)) && !defined(WITH_BACKPORTS) -static int wlan_hdd_cfg80211_update_apies(hdd_adapter_t* pHostapdAdapter, - struct beacon_parameters *params) -#else -static int wlan_hdd_cfg80211_update_apies(hdd_adapter_t* pHostapdAdapter, - struct cfg80211_beacon_data *params) -#endif +int wlan_hdd_cfg80211_update_apies(hdd_adapter_t* pHostapdAdapter) { v_U8_t *genie; v_U8_t total_ielen = 0; int ret = 0; tsap_Config_t *pConfig; tSirUpdateIE updateIE; + beacon_data_t *pBeacon = NULL; pConfig = &pHostapdAdapter->sessionCtx.ap.sapConfig; + pBeacon = pHostapdAdapter->sessionCtx.ap.beacon; genie = vos_mem_malloc(MAX_GENIE_LEN); @@ -6314,8 +6331,8 @@ static int wlan_hdd_cfg80211_update_apies(hdd_adapter_t* pHostapdAdapter, /* Added for Probe Response IE */ if (test_bit(SOFTAP_BSS_STARTED, &pHostapdAdapter->event_flags)) { - updateIE.ieBufferlength = params->proberesp_ies_len; - updateIE.pAdditionIEBuffer = (tANI_U8*)params->proberesp_ies; + updateIE.ieBufferlength = pBeacon->proberesp_ies_len; + updateIE.pAdditionIEBuffer = (tANI_U8*)pBeacon->proberesp_ies; updateIE.append = VOS_FALSE; updateIE.notify = VOS_FALSE; if (sme_UpdateAddIE(WLAN_HDD_GET_HAL_CTX(pHostapdAdapter), @@ -6327,15 +6344,15 @@ static int wlan_hdd_cfg80211_update_apies(hdd_adapter_t* pHostapdAdapter, WLANSAP_ResetSapConfigAddIE(pConfig, eUPDATE_IE_PROBE_RESP); } else { WLANSAP_UpdateSapConfigAddIE(pConfig, - params->proberesp_ies, - params->proberesp_ies_len, + pBeacon->proberesp_ies, + pBeacon->proberesp_ies_len, eUPDATE_IE_PROBE_RESP); } /* Assoc resp Add ie Data */ if (test_bit(SOFTAP_BSS_STARTED, &pHostapdAdapter->event_flags)) { - updateIE.ieBufferlength = params->assocresp_ies_len; - updateIE.pAdditionIEBuffer = (tANI_U8*)params->assocresp_ies; + updateIE.ieBufferlength = pBeacon->assocresp_ies_len; + updateIE.pAdditionIEBuffer = (tANI_U8*)pBeacon->assocresp_ies; updateIE.append = VOS_FALSE; updateIE.notify = VOS_FALSE; if (sme_UpdateAddIE(WLAN_HDD_GET_HAL_CTX(pHostapdAdapter), @@ -6347,8 +6364,8 @@ static int wlan_hdd_cfg80211_update_apies(hdd_adapter_t* pHostapdAdapter, WLANSAP_ResetSapConfigAddIE(pConfig, eUPDATE_IE_ASSOC_RESP); } else { WLANSAP_UpdateSapConfigAddIE(pConfig, - params->assocresp_ies, - params->assocresp_ies_len, + pBeacon->assocresp_ies, + pBeacon->assocresp_ies_len, eUPDATE_IE_ASSOC_RESP); } @@ -7269,7 +7286,7 @@ static int wlan_hdd_cfg80211_start_bss(hdd_adapter_t *pHostapdAdapter, // ht_capab is not what the name conveys,this is used for protection bitmap pConfig->ht_capab = iniConfig->apProtection; - if ( 0 != wlan_hdd_cfg80211_update_apies(pHostapdAdapter, params) ) + if (0 != wlan_hdd_cfg80211_update_apies(pHostapdAdapter)) { hddLog(LOGE, FL("SAP Not able to set AP IEs")); WLANSAP_ResetSapConfigAddIE(pConfig, eUPDATE_IE_ALL); @@ -7694,7 +7711,7 @@ static int wlan_hdd_cfg80211_start_ap(struct wiphy *wiphy, MTRACE(vos_trace(VOS_MODULE_ID_HDD, TRACE_CODE_HDD_CFG80211_START_AP, pAdapter->sessionId, - params-> beacon_interval)); + params->beacon_interval)); if (WLAN_HDD_ADAPTER_MAGIC != pAdapter->magic) { VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, @@ -7735,7 +7752,8 @@ static int wlan_hdd_cfg80211_start_ap(struct wiphy *wiphy, if (old) return -EALREADY; - status = wlan_hdd_cfg80211_alloc_new_beacon(pAdapter, &new, ¶ms->beacon, params->dtim_period); + status = wlan_hdd_cfg80211_alloc_new_beacon(pAdapter, &new, + ¶ms->beacon, params->dtim_period); if (status != 0) { diff --git a/CORE/HDD/src/wlan_hdd_main.c b/CORE/HDD/src/wlan_hdd_main.c index 6d8e610c2b02..d79d23b30d30 100755 --- a/CORE/HDD/src/wlan_hdd_main.c +++ b/CORE/HDD/src/wlan_hdd_main.c @@ -963,8 +963,10 @@ static void wlan_hdd_restart_sap(hdd_adapter_t *ap_adapter) #ifdef CFG80211_DEL_STA_V2 struct station_del_parameters delStaParams; #endif + tsap_Config_t *pConfig; pHddApCtx = WLAN_HDD_GET_AP_CTX_PTR(ap_adapter); + pConfig = &ap_adapter->sessionCtx.ap.sapConfig; mutex_lock(&pHddCtx->sap_lock); if (test_bit(SOFTAP_BSS_STARTED, &ap_adapter->event_flags)) { @@ -1001,6 +1003,12 @@ static void wlan_hdd_restart_sap(hdd_adapter_t *ap_adapter) wlan_hdd_decr_active_session(pHddCtx, ap_adapter->device_mode); hddLog(LOGE, FL("SAP Stop Success")); + if (0 != wlan_hdd_cfg80211_update_apies(ap_adapter)) { + hddLog(LOGE, FL("SAP Not able to set AP IEs")); + WLANSAP_ResetSapConfigAddIE(pConfig, eUPDATE_IE_ALL); + goto end; + } + if (WLANSAP_StartBss( #ifdef WLAN_FEATURE_MBSSID pHddApCtx->sapContext, @@ -15053,6 +15061,7 @@ void wlan_hdd_start_sap(hdd_adapter_t *ap_adapter) hdd_hostapd_state_t *hostapd_state; VOS_STATUS vos_status; hdd_context_t *hdd_ctx; + tsap_Config_t *pConfig; if (NULL == ap_adapter) { VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, @@ -15063,6 +15072,7 @@ void wlan_hdd_start_sap(hdd_adapter_t *ap_adapter) hdd_ctx = WLAN_HDD_GET_CTX(ap_adapter); hdd_ap_ctx = WLAN_HDD_GET_AP_CTX_PTR(ap_adapter); hostapd_state = WLAN_HDD_GET_HOSTAP_STATE_PTR(ap_adapter); + pConfig = &ap_adapter->sessionCtx.ap.sapConfig; if (0 != wlan_hdd_validate_context(hdd_ctx)) { @@ -15071,15 +15081,19 @@ void wlan_hdd_start_sap(hdd_adapter_t *ap_adapter) return; } mutex_lock(&hdd_ctx->sap_lock); - if (test_bit(SOFTAP_BSS_STARTED, &ap_adapter->event_flags)) { - return; + if (test_bit(SOFTAP_BSS_STARTED, &ap_adapter->event_flags)) + goto end; + + if (0 != wlan_hdd_cfg80211_update_apies(ap_adapter)) { + hddLog(LOGE, FL("SAP Not able to set AP IEs")); + WLANSAP_ResetSapConfigAddIE(pConfig, eUPDATE_IE_ALL); + goto end; } if (WLANSAP_StartBss(hdd_ap_ctx->sapContext, hdd_hostapd_SAPEventCB, &hdd_ap_ctx->sapConfig, (v_PVOID_t)ap_adapter->dev) != VOS_STATUS_SUCCESS) { - mutex_unlock(&hdd_ctx->sap_lock); - return; + goto end; } VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO_HIGH, @@ -15088,8 +15102,7 @@ void wlan_hdd_start_sap(hdd_adapter_t *ap_adapter) if (!VOS_IS_STATUS_SUCCESS(vos_status)) { VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, FL("SAP Start failed")); - mutex_unlock(&hdd_ctx->sap_lock); - return; + goto end; } VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO_HIGH, FL("SAP Start Success")); @@ -15097,6 +15110,7 @@ void wlan_hdd_start_sap(hdd_adapter_t *ap_adapter) wlan_hdd_incr_active_session(hdd_ctx, ap_adapter->device_mode); hostapd_state->bCommit = TRUE; +end: mutex_unlock(&hdd_ctx->sap_lock); return; } -- cgit v1.2.3 From 09e1d5f7526064c675bb625ca8bedcf90a5da156 Mon Sep 17 00:00:00 2001 From: AnjaneeDevi Kapparapu Date: Thu, 5 Feb 2015 13:43:41 +0530 Subject: Cafstaging Release 4.0.10.28 Cafstaging Release 4.0.10.28 Change-Id: I885dbda97473713c67f8ea255773ed9d07e42621 CRs-Fixed: 688141 --- CORE/MAC/inc/qwlan_version.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CORE/MAC/inc/qwlan_version.h b/CORE/MAC/inc/qwlan_version.h index 0defcb449a6a..6f2f3ff2cbe3 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 10 #define QWLAN_VERSION_EXTRA "" -#define QWLAN_VERSION_BUILD 27 +#define QWLAN_VERSION_BUILD 28 -#define QWLAN_VERSIONSTR "4.0.10.27" +#define QWLAN_VERSIONSTR "4.0.10.28" #define AR6320_REV1_VERSION 0x5000000 -- cgit v1.2.3