From e64977fe9c9eecb8b89f07eb0326c821b25a7104 Mon Sep 17 00:00:00 2001 From: Amar Singhal Date: Tue, 10 Jun 2014 07:40:56 -0700 Subject: qcacld: Initialize 5G band with correct bandwidth Initialize 5G band with correct bandwidth values. Change-Id: I6afb4e2ccbee6545ebb6582c587f51756a10df38 CRs-Fixed: 677591 --- CORE/VOSS/src/vos_nvitem.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CORE/VOSS/src/vos_nvitem.c b/CORE/VOSS/src/vos_nvitem.c index ac8b7b7ee810..0a1a538bc26a 100644 --- a/CORE/VOSS/src/vos_nvitem.c +++ b/CORE/VOSS/src/vos_nvitem.c @@ -113,11 +113,11 @@ static v_BOOL_t crda_regulatory_run_time_entry_valid = VOS_FALSE; NL80211_RRF_PASSIVE_SCAN | NL80211_RRF_NO_OFDM) /* We allow IBSS on these on a case by case basis by regulatory domain */ -#define REG_RULE_5GHZ_5150_5350 REG_RULE(5150-10, 5350+10, 40, 0, 30,\ +#define REG_RULE_5GHZ_5150_5350 REG_RULE(5150-10, 5350+10, 80, 0, 30,\ NL80211_RRF_PASSIVE_SCAN | NL80211_RRF_NO_IBSS) -#define REG_RULE_5GHZ_5470_5850 REG_RULE(5470-10, 5850+10, 40, 0, 30,\ +#define REG_RULE_5GHZ_5470_5850 REG_RULE(5470-10, 5850+10, 80, 0, 30,\ NL80211_RRF_PASSIVE_SCAN | NL80211_RRF_NO_IBSS) -#define REG_RULE_5GHZ_5725_5850 REG_RULE(5725-10, 5850+10, 40, 0, 30,\ +#define REG_RULE_5GHZ_5725_5850 REG_RULE(5725-10, 5850+10, 80, 0, 30,\ NL80211_RRF_PASSIVE_SCAN | NL80211_RRF_NO_IBSS) #define REG_RULE_2GHZ_ALL REG_RULE_2GHZ_CH01_11, \ -- cgit v1.2.3 From f91d8a5cc2b8fbccd9c61cb1d0c97cd7a397757d Mon Sep 17 00:00:00 2001 From: Prashanth Bhatta Date: Tue, 10 Jun 2014 12:15:06 -0700 Subject: qcacld: ipa: Handle duplicate WLAN_AP_CONNECT event As part of DFS testing, when a RADAR pulses are detected, SAP module would trigger eSAP_START_BSS_EVENT events with updated channel. While handling this event in HDD, WLAN_AP_CONNECT would be called multiple times for the same interface. Now added fix to handle the multiple indications gracefully. Also along with this change, added a fix in TX path where in, in CAC period all the packets needs to be dropped as during CAC period, AP shouldn't try to send any packet over the air. Change-Id: I6ef2a43468d023d826fe3ea55eba326f1051a96b CRs-fixed: 677686 --- CORE/HDD/src/wlan_hdd_ipa.c | 87 ++++++++++++++++++++++++++++----------------- 1 file changed, 54 insertions(+), 33 deletions(-) diff --git a/CORE/HDD/src/wlan_hdd_ipa.c b/CORE/HDD/src/wlan_hdd_ipa.c index 6241785f2733..8ab721415eec 100644 --- a/CORE/HDD/src/wlan_hdd_ipa.c +++ b/CORE/HDD/src/wlan_hdd_ipa.c @@ -1077,50 +1077,63 @@ static void hdd_ipa_i2w_cb(void *priv, enum ipa_dp_evt_type evt, struct hdd_ipa_iface_context *iface_context; adf_nbuf_t skb; v_U8_t interface_id; + hdd_adapter_t *adapter = NULL; - if (evt == IPA_RECEIVE) { - - iface_context = (struct hdd_ipa_iface_context *) priv; - ipa_tx_desc = (struct ipa_rx_data *)data; - skb = ipa_tx_desc->skb; + if (evt != IPA_RECEIVE) { + skb = (adf_nbuf_t) data; + dev_kfree_skb_any(skb); + return; + } - hdd_ipa = iface_context->hdd_ipa; + iface_context = (struct hdd_ipa_iface_context *) priv; + ipa_tx_desc = (struct ipa_rx_data *)data; + skb = ipa_tx_desc->skb; - adf_os_mem_set(skb->cb, 0, sizeof(skb->cb)); - NBUF_OWNER_ID(skb) = IPA_NBUF_OWNER_ID; - NBUF_CALLBACK_FN(skb) = hdd_ipa_nbuf_cb; - NBUF_MAPPED_PADDR_LO(skb) = ipa_tx_desc->dma_addr; + hdd_ipa = iface_context->hdd_ipa; - NBUF_OWNER_PRIV_DATA(skb) = data; + adf_os_mem_set(skb->cb, 0, sizeof(skb->cb)); + NBUF_OWNER_ID(skb) = IPA_NBUF_OWNER_ID; + NBUF_CALLBACK_FN(skb) = hdd_ipa_nbuf_cb; + NBUF_MAPPED_PADDR_LO(skb) = ipa_tx_desc->dma_addr; - HDD_IPA_DBG_DUMP(VOS_TRACE_LEVEL_DEBUG, "i2w", skb->data, 8); + NBUF_OWNER_PRIV_DATA(skb) = data; - hdd_ipa->stats.tx_ipa_recv++; + HDD_IPA_DBG_DUMP(VOS_TRACE_LEVEL_DEBUG, "i2w", skb->data, 8); - adf_os_spin_lock_bh(&iface_context->interface_lock); - if (!iface_context->adapter) { - HDD_IPA_LOG(VOS_TRACE_LEVEL_WARN, "Interface Down"); - ipa_free_skb(ipa_tx_desc); - adf_os_spin_unlock_bh(&iface_context->interface_lock); - return; - } + hdd_ipa->stats.tx_ipa_recv++; - interface_id = iface_context->adapter->sessionId; - ++iface_context->adapter->stats.tx_packets; - iface_context->adapter->stats.tx_bytes += ipa_tx_desc->skb->len; + adf_os_spin_lock_bh(&iface_context->interface_lock); + adapter = iface_context->adapter; + if (!adapter) { + HDD_IPA_LOG(VOS_TRACE_LEVEL_WARN, "Interface Down"); + ipa_free_skb(ipa_tx_desc); + adf_os_spin_unlock_bh(&iface_context->interface_lock); + return; + } + /* + * During CAC period, data packets shouldn't be sent over the air so + * drop all the packets here + */ + if (WLAN_HDD_GET_AP_CTX_PTR(adapter)->dfs_cac_block_tx) { + ipa_free_skb(ipa_tx_desc); adf_os_spin_unlock_bh(&iface_context->interface_lock); + return; + } - skb = WLANTL_SendIPA_DataFrame(hdd_ipa->hdd_ctx->pvosContext, - iface_context->tl_context, ipa_tx_desc->skb, interface_id); - if (skb) { - HDD_IPA_LOG(VOS_TRACE_LEVEL_DEBUG, "TLSHIM tx fail"); - ipa_free_skb(ipa_tx_desc); - return; - } - } else { - skb = (adf_nbuf_t) data; - dev_kfree_skb_any(skb); + interface_id = adapter->sessionId; + ++adapter->stats.tx_packets; + adapter->stats.tx_bytes += ipa_tx_desc->skb->len; + + adf_os_spin_unlock_bh(&iface_context->interface_lock); + + skb = WLANTL_SendIPA_DataFrame(hdd_ipa->hdd_ctx->pvosContext, + iface_context->tl_context, ipa_tx_desc->skb, + interface_id); + if (skb) { + HDD_IPA_LOG(VOS_TRACE_LEVEL_DEBUG, "TLSHIM tx fail"); + ipa_free_skb(ipa_tx_desc); + return; } } @@ -1492,6 +1505,14 @@ static int hdd_ipa_setup_iface(struct hdd_ipa_priv *hdd_ipa, void *tl_context = NULL; int i, ret = 0; + /* Lower layer may send multiple START_BSS_EVENT in DFS mode or during + * channel change indication. Since these indications are sent by lower + * layer as SAP updates and IPA doesn't have to do anything for these + * updates so ignoring! + */ + if (WLAN_HDD_SOFTAP == adapter->device_mode && adapter->ipa_context) + return 0; + for (i = 0; i < HDD_IPA_MAX_IFACE; i++) { if (hdd_ipa->iface_context[i].adapter == NULL) { iface_context = &(hdd_ipa->iface_context[i]); -- cgit v1.2.3 From 5de4f6b12fa778349a351080895c2de91de37e22 Mon Sep 17 00:00:00 2001 From: "Edhar, Mahesh Kumar" Date: Tue, 10 Jun 2014 20:21:43 +0530 Subject: qcacld: Fix passing vdev id as pe session id. currently we are passing vdev id as pe session id on posting WDA_CSA_OFFLOAD_EVENT from WMA to LIM. changes are made to pass bssid from WMA and to extract pe session context based on bssid in LIM. Change-Id: I1c4cbff234895cdb8d5fd6c959b896d9b18e8146 CRs-Fixed: 678112 --- CORE/MAC/src/pe/lim/limSendSmeRspMessages.c | 3 ++- CORE/SERVICES/WMA/wma.c | 6 ++++-- CORE/WDA/inc/legacy/halMsgApi.h | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/CORE/MAC/src/pe/lim/limSendSmeRspMessages.c b/CORE/MAC/src/pe/lim/limSendSmeRspMessages.c index 7ea3c291f6e2..b917d0243872 100644 --- a/CORE/MAC/src/pe/lim/limSendSmeRspMessages.c +++ b/CORE/MAC/src/pe/lim/limSendSmeRspMessages.c @@ -2878,6 +2878,7 @@ void limHandleCSAoffloadMsg(tpAniSirGlobal pMac,tpSirMsgQ MsgQ) tpCSAOffloadParams csa_params = (tpCSAOffloadParams)(MsgQ->bodyptr); tpSmeCsaOffloadInd pCsaOffloadInd; tpDphHashNode pStaDs = NULL ; + tANI_U8 sessionId; tANI_U16 aid = 0 ; if(!csa_params) @@ -2886,7 +2887,7 @@ void limHandleCSAoffloadMsg(tpAniSirGlobal pMac,tpSirMsgQ MsgQ) return; } - psessionEntry = peFindSessionBySessionId(pMac, csa_params->sessionId); + psessionEntry = peFindSessionByBssid(pMac, csa_params->bssId, &sessionId); if(!psessionEntry) { limLog(pMac, LOGP, FL("Session does not exist for given sessionID")); diff --git a/CORE/SERVICES/WMA/wma.c b/CORE/SERVICES/WMA/wma.c index 726b61d0128c..adeea99f403d 100644 --- a/CORE/SERVICES/WMA/wma.c +++ b/CORE/SERVICES/WMA/wma.c @@ -2145,7 +2145,7 @@ static int wma_csa_offload_handler(void *handle, u_int8_t *event, u_int32_t len) } vos_mem_zero(csa_offload_event, sizeof(*csa_offload_event)); - csa_offload_event->sessionId = vdev_id; + vos_mem_copy(csa_offload_event->bssId, &bssid, ETH_ALEN); if (csa_event->ies_present_flag & WMI_CSA_IE_PRESENT) { csa_ie = (struct ieee80211_channelswitch_ie *)(&csa_event->csa_ie[0]); @@ -2170,7 +2170,9 @@ static int wma_csa_offload_handler(void *handle, u_int8_t *event, u_int32_t len) csa_offload_event->ies_present_flag = csa_event->ies_present_flag; - WMA_LOGD("CSA: New Channel = %d", csa_offload_event->channel); + WMA_LOGD("CSA: New Channel = %d BSSID:%pM", + csa_offload_event->channel, + csa_offload_event->bssId); wma->interfaces[vdev_id].is_channel_switch = VOS_TRUE; wma_send_msg(wma, WDA_CSA_OFFLOAD_EVENT, (void *)csa_offload_event, 0); return 0; diff --git a/CORE/WDA/inc/legacy/halMsgApi.h b/CORE/WDA/inc/legacy/halMsgApi.h index 898351a4d4b3..17d0ab977a02 100644 --- a/CORE/WDA/inc/legacy/halMsgApi.h +++ b/CORE/WDA/inc/legacy/halMsgApi.h @@ -1015,7 +1015,6 @@ typedef struct }tSwitchChannelParams, *tpSwitchChannelParams; typedef struct CSAOffloadParams { - tANI_U8 sessionId; tANI_U8 channel; tANI_U8 switchmode; tANI_U8 sec_chan_offset; @@ -1023,6 +1022,7 @@ typedef struct CSAOffloadParams { tANI_U8 new_ch_freq_seg1; /* Channel Center frequency 1 */ tANI_U8 new_ch_freq_seg2; /* Channel Center frequency 2 */ tANI_U32 ies_present_flag; /* WMI_CSA_EVENT_IES_PRESENT_FLAG */ + tSirMacAddr bssId; }*tpCSAOffloadParams, tCSAOffloadParams; typedef void (*tpSetLinkStateCallback)(tpAniSirGlobal pMac, void *msgParam ); -- cgit v1.2.3 From 9d2eac0836b8c94c2a9197a19e501fb2cd9a7d13 Mon Sep 17 00:00:00 2001 From: Prashanth Bhatta Date: Fri, 6 Jun 2014 13:13:32 -0700 Subject: qcacld: dfs: add secondary channels to NOL If SAP operating in DFS channel in HT40 or VHT80 mode and RADAR is detected on the DFS channel then after 60 seconds SAP starts beaconing in secondary channel. Current logic only adds HT20 sub channel to NOL resulting in random channel selection logic sometimes selecting secondary channel. Now added logic to add the secondary channels as well to NOL so that ACS or Random channel selection algorithm doesn't consider channels which are already added to NOL. Change-Id: I1e110af72b66ea17c1f92be42243a27a5e2e1500 CRs-fixed: 676266 --- CORE/MAC/inc/sirApi.h | 18 +++-- CORE/SAP/src/sapFsm.c | 44 +++++++----- CORE/SERVICES/WMA/wma.c | 143 +++++++++++++++++++++++--------------- CORE/SERVICES/WMA/wma.h | 30 ++++---- CORE/SME/src/sme_common/sme_Api.c | 11 ++- 5 files changed, 152 insertions(+), 94 deletions(-) diff --git a/CORE/MAC/inc/sirApi.h b/CORE/MAC/inc/sirApi.h index f348c283c6a3..689de475b3e1 100644 --- a/CORE/MAC/inc/sirApi.h +++ b/CORE/MAC/inc/sirApi.h @@ -4842,13 +4842,21 @@ typedef struct sSirChAvoidIndType } tSirChAvoidIndType; #endif /* FEATURE_WLAN_CH_AVOID */ +#define SIR_DFS_MAX_20M_SUB_CH 8 + +typedef struct sSirSmeDfsChannelList +{ + tANI_U32 nchannels; + /*Channel number including bonded channels on which the RADAR is present */ + tANI_U8 channels[SIR_DFS_MAX_20M_SUB_CH]; +}tSirSmeDfsChannelList, *tpSirSmeDfsChannelList; + typedef struct sSirSmeDfsEventInd { - tANI_U32 sessionId; - tANI_U8 ieee_chan_number; - tANI_U32 chan_freq; - tANI_U32 dfs_radar_status; - int use_nol; + tANI_U32 sessionId; + tSirSmeDfsChannelList chan_list; + tANI_U32 dfs_radar_status; + int use_nol; }tSirSmeDfsEventInd, *tpSirSmeDfsEventInd; typedef struct sSirChanChangeRequest diff --git a/CORE/SAP/src/sapFsm.c b/CORE/SAP/src/sapFsm.c index ba9f118dd763..6811f6eb5262 100644 --- a/CORE/SAP/src/sapFsm.c +++ b/CORE/SAP/src/sapFsm.c @@ -215,7 +215,7 @@ static v_U8_t sapRandomChannelSel(ptSapContext sapContext) } total_num_channels = sapContext->SapAllChnlList.numChannel; - for (i = 0, available_chan_count = 0; i< total_num_channels; i++) + for (i = 0, available_chan_count = 0; i < total_num_channels; i++) { /* * Now Check if the channel is DFS and if @@ -2190,10 +2190,12 @@ static VOS_STATUS sapGet5GHzChannelList(ptSapContext sapContext) * dfs_event - Dfs information from DFS * return - channel to which AP wishes to switch */ -v_U8_t sapIndicateRadar(ptSapContext sapContext,tSirSmeDfsEventInd *dfs_event) +v_U8_t sapIndicateRadar(ptSapContext sapContext, tSirSmeDfsEventInd *dfs_event) { v_U8_t target_channel = 0; - int i; + int i, j; + tSapDfsNolInfo *psapDfsChannelNolList = NULL; + v_U8_t nRegDomainDfsChannels; if (NULL == sapContext || NULL == dfs_event) { @@ -2228,22 +2230,28 @@ v_U8_t sapIndicateRadar(ptSapContext sapContext,tSirSmeDfsEventInd *dfs_event) * in the NOL list as eSAP_DFS_CHANNEL_UNAVAILABLE. */ - for (i = 0; i<= sapContext->SapDfsInfo.numCurrentRegDomainDfsChannels; i++) - { - if (sapContext->SapDfsInfo.sapDfsChannelNolList[i] - .dfs_channel_number == - dfs_event->ieee_chan_number) + psapDfsChannelNolList = sapContext->SapDfsInfo.sapDfsChannelNolList; + nRegDomainDfsChannels = sapContext->SapDfsInfo.numCurrentRegDomainDfsChannels; + for (i = 0; i < dfs_event->chan_list.nchannels; i++) { + for (j = 0; j <= nRegDomainDfsChannels; j++) { - // Capture the Radar Found timestamp on the Current Channel in ms. - sapContext->SapDfsInfo.sapDfsChannelNolList[i] - .radar_found_timestamp = vos_timer_get_system_time(); - // Mark the Channel to be UNAVAILABLE for next 30 mins. - sapContext->SapDfsInfo.sapDfsChannelNolList[i] - .radar_status_flag = eSAP_DFS_CHANNEL_UNAVAILABLE; - - VOS_TRACE(VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_HIGH, - "%s[%d]: Channel = %d Added to NOL LIST", - __func__, __LINE__, dfs_event->ieee_chan_number); + if (psapDfsChannelNolList[j].dfs_channel_number == + dfs_event->chan_list.channels[i]) + { + /* + * Capture the Radar Found timestamp on the Current Channel in + * ms. + */ + psapDfsChannelNolList[j].radar_found_timestamp = + vos_timer_get_system_time(); + /* Mark the Channel to be UNAVAILABLE for next 30 mins */ + psapDfsChannelNolList[j].radar_status_flag = + eSAP_DFS_CHANNEL_UNAVAILABLE; + + VOS_TRACE(VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_HIGH, + FL("Channel = %d Added to NOL LIST"), + dfs_event->chan_list.channels[i]); + } } } diff --git a/CORE/SERVICES/WMA/wma.c b/CORE/SERVICES/WMA/wma.c index adeea99f403d..ff5281cde427 100644 --- a/CORE/SERVICES/WMA/wma.c +++ b/CORE/SERVICES/WMA/wma.c @@ -21200,8 +21200,7 @@ struct ieee80211com* wma_dfs_attach(struct ieee80211com *dfs_ic) * change.This Configuration enables to program * the DFS pattern matching module. */ -void -wma_dfs_configure(struct ieee80211com *ic) +void wma_dfs_configure(struct ieee80211com *ic) { struct ath_dfs_radar_tab_info rinfo; int dfsdomain; @@ -21349,8 +21348,7 @@ wma_dfs_configure_channel(struct ieee80211com *dfs_ic, /* * Configure the regulatory domain for DFS radar filter initialization */ -void -wma_set_dfs_regdomain(tp_wma_handle wma) +void wma_set_dfs_regdomain(tp_wma_handle wma) { u_int8_t ctl; u_int32_t regdmn = wma->reg_cap.eeprom_rd; @@ -21399,67 +21397,98 @@ wma_set_dfs_regdomain(tp_wma_handle wma) wma->dfs_ic->current_dfs_regdomain); } +int wma_get_channels(struct ieee80211_channel *ichan, + struct wma_dfs_radar_channel_list *chan_list) +{ + uint8_t center_chan = vos_freq_to_chan(ichan->ic_vhtop_ch_freq_seg1); + + chan_list->nchannels = 0; + + if (IEEE80211_IS_CHAN_11AC_VHT80(ichan)) + { + chan_list->nchannels= 4; + chan_list->channels[0] = center_chan - 6; + chan_list->channels[1] = center_chan - 2; + chan_list->channels[2] = center_chan + 2; + chan_list->channels[3] = center_chan + 6; + } + else if(IEEE80211_IS_CHAN_11N_HT40(ichan) || + IEEE80211_IS_CHAN_11AC_VHT40(ichan)) + { + chan_list->nchannels = 2; + chan_list->channels[0] = center_chan - 2; + chan_list->channels[1] = center_chan + 2; + } + else + { + chan_list->nchannels = 1; + chan_list->channels[0] = center_chan; + } + + return chan_list->nchannels; +} + + /* * Indicate Radar to SAP/HDD */ -int -wma_dfs_indicate_radar(struct ieee80211com *ic, - struct ieee80211_channel *ichan) +int wma_dfs_indicate_radar(struct ieee80211com *ic, + struct ieee80211_channel *ichan) { - tp_wma_handle wma; - void *hdd_ctx; - struct wma_dfs_radar_indication *radar_event; - struct hdd_dfs_radar_ind hdd_radar_event; - void *vos_context = vos_get_global_context(VOS_MODULE_ID_WDA, NULL); + tp_wma_handle wma; + void *hdd_ctx; + struct wma_dfs_radar_indication *radar_event; + struct hdd_dfs_radar_ind hdd_radar_event; + void *vos_context = vos_get_global_context(VOS_MODULE_ID_WDA, NULL); - wma = (tp_wma_handle) vos_get_context(VOS_MODULE_ID_WDA, vos_context); + wma = (tp_wma_handle) vos_get_context(VOS_MODULE_ID_WDA, vos_context); - if (wma == NULL) - { - WMA_LOGE("%s: DFS- Invalid wma", __func__); - return (0); - } + if (wma == NULL) + { + WMA_LOGE("%s: DFS- Invalid wma", __func__); + return (0); + } - hdd_ctx = vos_get_context(VOS_MODULE_ID_HDD,wma->vos_context); - if (wma->dfs_ic != ic) - { - WMA_LOGE("%s:DFS- Invalid WMA handle",__func__); - return (0); - } - radar_event = (struct wma_dfs_radar_indication *) - vos_mem_malloc(sizeof(struct wma_dfs_radar_indication)); - if (radar_event == NULL) - { - WMA_LOGE("%s:DFS- Invalid radar_event",__func__); - return (0); - } + hdd_ctx = vos_get_context(VOS_MODULE_ID_HDD,wma->vos_context); + if (wma->dfs_ic != ic) + { + WMA_LOGE("%s:DFS- Invalid WMA handle",__func__); + return (0); + } + radar_event = (struct wma_dfs_radar_indication *) + vos_mem_malloc(sizeof(struct wma_dfs_radar_indication)); + if (radar_event == NULL) + { + WMA_LOGE("%s:DFS- Invalid radar_event",__func__); + return (0); + } - /* - * Do not post multiple Radar events on the same channel. - */ - if ( ichan->ic_ieee != (wma->dfs_ic->last_radar_found_chan) ) - { - wma->dfs_ic->last_radar_found_chan = ichan->ic_ieee; - /* Indicate the radar event to HDD to stop the netif Tx queues*/ - hdd_radar_event.ieee_chan_number = ichan->ic_ieee; - hdd_radar_event.chan_freq = ichan->ic_freq; - hdd_radar_event.dfs_radar_status = WMA_DFS_RADAR_FOUND; - wma->dfs_radar_indication_cb(hdd_ctx,&hdd_radar_event); - WMA_LOGE("%s:DFS- RADAR INDICATED TO HDD",__func__); - - /* - * Indicate to the radar event to SAP to - * select a new channel and set CSA IE - */ - radar_event->vdev_id = ic->vdev_id; - radar_event->ieee_chan_number = ichan->ic_ieee; - radar_event->chan_freq = ichan->ic_freq; - radar_event->dfs_radar_status = WMA_DFS_RADAR_FOUND; - radar_event->use_nol = ic->ic_dfs_usenol(ic); - wma_send_msg(wma, WDA_DFS_RADAR_IND, (void *)radar_event, 0); - WMA_LOGE("%s:DFS- WDA_DFS_RADAR_IND Message Posted",__func__); - } - return 1; + /* + * Do not post multiple Radar events on the same channel. + */ + if ( ichan->ic_ieee != (wma->dfs_ic->last_radar_found_chan) ) + { + wma->dfs_ic->last_radar_found_chan = ichan->ic_ieee; + /* Indicate the radar event to HDD to stop the netif Tx queues*/ + hdd_radar_event.ieee_chan_number = ichan->ic_ieee; + hdd_radar_event.chan_freq = ichan->ic_freq; + hdd_radar_event.dfs_radar_status = WMA_DFS_RADAR_FOUND; + wma->dfs_radar_indication_cb(hdd_ctx,&hdd_radar_event); + WMA_LOGE("%s:DFS- RADAR INDICATED TO HDD",__func__); + + /* + * Indicate to the radar event to SAP to + * select a new channel and set CSA IE + */ + radar_event->vdev_id = ic->vdev_id; + wma_get_channels(ichan, &radar_event->chan_list); + radar_event->dfs_radar_status = WMA_DFS_RADAR_FOUND; + radar_event->use_nol = ic->ic_dfs_usenol(ic); + wma_send_msg(wma, WDA_DFS_RADAR_IND, (void *)radar_event, 0); + WMA_LOGE("%s:DFS- WDA_DFS_RADAR_IND Message Posted",__func__); + } + + return 1; } static eHalStatus wma_set_smps_params(tp_wma_handle wma, tANI_U8 vdev_id, int value) diff --git a/CORE/SERVICES/WMA/wma.h b/CORE/SERVICES/WMA/wma.h index 5ff4e651d67c..1c8c876d914d 100644 --- a/CORE/SERVICES/WMA/wma.h +++ b/CORE/SERVICES/WMA/wma.h @@ -1499,23 +1499,29 @@ typedef struct { #endif /* FEATURE_WLAN_TDLS */ +#define WMA_DFS_MAX_20M_SUB_CH 8 + +struct wma_dfs_radar_channel_list { + A_UINT32 nchannels; + /*Channel number including bonded channels on which the RADAR is present */ + u_int8_t channels[WMA_DFS_MAX_20M_SUB_CH]; +}; + /* * Structure to indicate RADAR */ struct wma_dfs_radar_indication { - /* unique id identifying the VDEV */ - A_UINT32 vdev_id; - /*Channel number on which the RADAR is present */ - u_int8_t ieee_chan_number; - /* Channel Frequency*/ - A_UINT32 chan_freq; - /* Flag to Indicate RADAR presence on the - * current operating channel - */ - u_int32_t dfs_radar_status; - /* Flag to indicate use NOL */ - int use_nol; + /* unique id identifying the VDEV */ + A_UINT32 vdev_id; + /* Channel list on which RADAR is detected */ + struct wma_dfs_radar_channel_list chan_list; + /* Flag to Indicate RADAR presence on the + * current operating channel + */ + u_int32_t dfs_radar_status; + /* Flag to indicate use NOL */ + int use_nol; }; /* diff --git a/CORE/SME/src/sme_common/sme_Api.c b/CORE/SME/src/sme_common/sme_Api.c index 52939f6f6038..f417fc2b425e 100644 --- a/CORE/SME/src/sme_common/sme_Api.c +++ b/CORE/SME/src/sme_common/sme_Api.c @@ -2032,6 +2032,7 @@ eHalStatus dfsMsgProcessor(tpAniSirGlobal pMac, v_U16_t msgType, void *pMsgBuf) tANI_U32 sessionId = 0; eRoamCmdStatus roamStatus; eCsrRoamResult roamResult; + int i; switch (msgType) { @@ -2048,8 +2049,14 @@ eHalStatus dfsMsgProcessor(tpAniSirGlobal pMac, v_U16_t msgType, void *pMsgBuf) } sessionId = dfs_event->sessionId; roamInfo.dfs_event.sessionId = sessionId; - roamInfo.dfs_event.ieee_chan_number = dfs_event->ieee_chan_number; - roamInfo.dfs_event.chan_freq = dfs_event->chan_freq; + roamInfo.dfs_event.chan_list.nchannels = + dfs_event->chan_list.nchannels; + for (i = 0; i < dfs_event->chan_list.nchannels; i++) + { + roamInfo.dfs_event.chan_list.channels[i] = + dfs_event->chan_list.channels[i]; + } + roamInfo.dfs_event.dfs_radar_status = dfs_event->dfs_radar_status; roamInfo.dfs_event.use_nol = dfs_event->use_nol; -- cgit v1.2.3 From 4d4cf917be792132c196b7117e68cf3e9a1ad0bc Mon Sep 17 00:00:00 2001 From: Prashanth Bhatta Date: Fri, 6 Jun 2014 18:26:37 -0700 Subject: qcacld: ipa: Fix crash when IPA is disabled When IPA is disabled in ini and SoftAP is brougt-up, crash is noticed in hdd_ipa_set_perf_level. Crash is because hdd_ipa context is not initialized and it is NULL. Fixed it by adding a check for ipa enabled. Change-Id: I18811fbf64e9a72d20a7d97eb655b448a2364c9a CRs-fixed: 677007 --- CORE/HDD/src/wlan_hdd_ipa.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CORE/HDD/src/wlan_hdd_ipa.c b/CORE/HDD/src/wlan_hdd_ipa.c index 8ab721415eec..74c971aed003 100644 --- a/CORE/HDD/src/wlan_hdd_ipa.c +++ b/CORE/HDD/src/wlan_hdd_ipa.c @@ -432,7 +432,8 @@ int hdd_ipa_set_perf_level(hdd_context_t *hdd_ctx, uint64_t tx_packets, struct ipa_rm_perf_profile profile; int ret; - if (!hdd_ipa_is_clk_scaling_enabled(hdd_ipa)) + if (!hdd_ipa_is_enabled(hdd_ctx) || + !hdd_ipa_is_clk_scaling_enabled(hdd_ipa)) return 0; memset(&profile, 0, sizeof(profile)); -- cgit v1.2.3 From 63da329749af9666a61330269480ceca9b1ae1e1 Mon Sep 17 00:00:00 2001 From: Dhanashri Atre Date: Tue, 10 Jun 2014 15:47:09 -0700 Subject: wlan: qca_cld: Fix for issues reported by static analysis tool Add sanity check to avoid NULL pointer dereference. Change-Id: I45245cbc54bffa207ba8ee27b326c688c43b41b3 CRs-Fixed: 675529 --- CORE/SERVICES/WMA/wma.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CORE/SERVICES/WMA/wma.c b/CORE/SERVICES/WMA/wma.c index ff5281cde427..488a79fbe929 100644 --- a/CORE/SERVICES/WMA/wma.c +++ b/CORE/SERVICES/WMA/wma.c @@ -4652,6 +4652,11 @@ VOS_STATUS wma_get_buf_start_scan_cmd(tp_wma_handle wma_handle, tpAniSirGlobal pMac = (tpAniSirGlobal )vos_get_context(VOS_MODULE_ID_PE, wma_handle->vos_context); + if (!pMac) { + WMA_LOGP("%s: pMac is NULL!", __func__); + return VOS_STATUS_E_FAILURE; + } + len += WMI_TLV_HDR_SIZE; /* Length TLV placeholder for array of uint32 */ /* calculate the length of buffer required */ if (scan_req->channelList.numChannels) -- cgit v1.2.3 From e111c465c2269ce03fc997d47b897bee87dd3412 Mon Sep 17 00:00:00 2001 From: Ganesh Kondabattini Date: Mon, 9 Jun 2014 19:17:47 +0530 Subject: qcacld: Improve the logging to debug vdev related issues. Improve WMA Logs, so that we will get enough logs whenever there is timeout due to vdev delete sequence. CRs-Fixed: 677393 Change-Id: I2cc6477e639e0236edb11a7fc846ee36c10e0461 --- CORE/SERVICES/WMA/wma.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/CORE/SERVICES/WMA/wma.c b/CORE/SERVICES/WMA/wma.c index 488a79fbe929..c779ff5df01a 100644 --- a/CORE/SERVICES/WMA/wma.c +++ b/CORE/SERVICES/WMA/wma.c @@ -1414,14 +1414,16 @@ static int wma_vdev_stop_ind(tp_wma_handle wma, u_int8_t *buf) if (params->status == eHAL_STATUS_FW_MSG_TIMEDOUT){ vos_mem_free(params); WMA_LOGE("%s: DEL BSS from ADD BSS timeout do not send " - "resp to UMAC", __func__); + "resp to UMAC (vdev id %x)", + __func__, resp_event->vdev_id); } else { params->status = VOS_STATUS_SUCCESS; wma_send_msg(wma, WDA_DELETE_BSS_RSP, (void *)params, 0); } if (iface->del_staself_req) { - WMA_LOGD("%s: scheduling defered deletion", __func__); + WMA_LOGA("scheduling defered deletion (vdev id %x)", + resp_event->vdev_id); wma_vdev_detach(wma, iface->del_staself_req, 1); } } @@ -3715,7 +3717,8 @@ static VOS_STATUS wma_vdev_detach(tp_wma_handle wma_handle, vdev_id, peer); } if (adf_os_atomic_read(&iface->bss_status) == WMA_BSS_STATUS_STARTED) { - WMA_LOGA("BSS is not yet stopped. Defering vdev deletion"); + WMA_LOGA("BSS is not yet stopped. Defering vdev(vdev id %x) deletion", + vdev_id); iface->del_staself_req = pdel_sta_self_req_param; return status; } @@ -7030,7 +7033,8 @@ void wma_vdev_resp_timer(void *data) WMA_LOGA("%s: WDA_DELETE_BSS_REQ timedout", __func__); wma_send_msg(wma, WDA_DELETE_BSS_RSP, (void *)params, 0); if (iface->del_staself_req) { - WMA_LOGD("%s: scheduling defered deletion", __func__); + WMA_LOGA("scheduling defered deletion(vdev id %x)", + tgt_req->vdev_id); wma_vdev_detach(wma, iface->del_staself_req, 1); } } else if (tgt_req->msg_type == WDA_DEL_STA_SELF_REQ) { -- cgit v1.2.3 From f40c371849c07e299141420d7274757eebe1e62e Mon Sep 17 00:00:00 2001 From: Sachin Ahuja Date: Mon, 2 Jun 2014 18:18:08 +0530 Subject: qcacld: Avoid double remove peer when AddBss is timedOut Currently, when AddBss is timedOut, the vdev stop is sent to FW and peer is removed.In vdev Stop resp event, the peer is removed again. Because of this wma peer count is deremented beyond 0 and becomes 0xFFFFFFFF.After this the peer is not created and this leads to FW crash when STA try to connect to AP. Changes are done to remove the peer only once when AddBSS timeOut happens. Change-Id: Iac4244d9c3a4ed441973efb78e8e4a847389f889 CRs-Fixed: 672165 --- CORE/SERVICES/WMA/wma.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/CORE/SERVICES/WMA/wma.c b/CORE/SERVICES/WMA/wma.c index c779ff5df01a..2f5a3dd47f38 100644 --- a/CORE/SERVICES/WMA/wma.c +++ b/CORE/SERVICES/WMA/wma.c @@ -861,7 +861,12 @@ static void wma_remove_peer(tp_wma_handle wma, u_int8_t *bssid, #define PEER_ALL_TID_BITMASK 0xffffffff u_int32_t peer_tid_bitmap = PEER_ALL_TID_BITMASK; u_int8_t *peer_addr = bssid; - + if (!wma->peer_count) + { + WMA_LOGE("%s: Can't remove peer with peer_addr %pM vdevid %d peer_count %d", + __func__, bssid, vdev_id, wma->peer_count); + return; + } if (peer) ol_txrx_peer_detach(peer); @@ -7092,6 +7097,8 @@ void wma_vdev_resp_timer(void *data) } WMA_LOGI("%s: bssid %pM vdev_id %d", __func__, params->bssId, tgt_req->vdev_id); + wma_send_msg(wma, WDA_ADD_BSS_RSP, (void *)params, 0); + goto free_tgt_req; error0: if (peer) wma_remove_peer(wma, params->bssId, -- cgit v1.2.3 From ae3ad413d279155016f5c93f0e7dcdb55b09198c Mon Sep 17 00:00:00 2001 From: "Kanchanapally, Vidyullatha" Date: Wed, 28 May 2014 16:54:15 +0530 Subject: qcacld: Configure proper max tx power to firmware When processing beacon in the case of VoWiFi RRM, the max Tx power calculation is not taking the host Min/Max Power macros into consideration, because of which host is configuring a power which is beyond the max Power macro. The necessary changes to fix this have been made in this gerrit. Also, in WMA the max tx power is not updated in all the cases, made changes necessary for the same. Change-Id: I9749cf779bc8921da477d3d087989133f857c8e0 CRs-Fixed: 671823 --- CORE/MAC/src/pe/lim/limProcessSmeReqMessages.c | 11 +---- CORE/MAC/src/pe/rrm/rrmApi.c | 64 +++++++------------------- CORE/MAC/src/pe/sch/schBeaconProcess.c | 11 +++-- CORE/SERVICES/WMA/wma.c | 2 + CORE/SME/src/csr/csrApiRoam.c | 4 +- CORE/WDA/inc/legacy/halTypes.h | 9 ++-- 6 files changed, 33 insertions(+), 68 deletions(-) diff --git a/CORE/MAC/src/pe/lim/limProcessSmeReqMessages.c b/CORE/MAC/src/pe/lim/limProcessSmeReqMessages.c index 4fd234c56288..8d4ab4e003e0 100644 --- a/CORE/MAC/src/pe/lim/limProcessSmeReqMessages.c +++ b/CORE/MAC/src/pe/lim/limProcessSmeReqMessages.c @@ -71,15 +71,6 @@ #include #endif -#ifdef FEATURE_WLAN_ESE -/* These are the min/max tx power (non virtual rates) range - * supported by prima/rome hardware - */ -#define MIN_TX_PWR_CAP 8 -#define MAX_TX_PWR_CAP 22 - -#endif - /* This overhead is time for sending NOA start to host in case of GO/sending NULL data & receiving ACK * in case of P2P Client and starting actual scanning with init scan req/rsp plus in case of concurrency, * taking care of sending null data and receiving ACK to/from AP/Also SetChannel with calibration is taking @@ -2143,7 +2134,7 @@ end: } /*** end __limProcessSmeJoinReq() ***/ -#ifdef FEATURE_WLAN_ESE +#if defined FEATURE_WLAN_ESE || defined WLAN_FEATURE_VOWIFI tANI_U8 limGetMaxTxPower(tPowerdBm regMax, tPowerdBm apTxPower, tANI_U8 iniTxPower) { tANI_U8 maxTxPower = 0; diff --git a/CORE/MAC/src/pe/rrm/rrmApi.c b/CORE/MAC/src/pe/rrm/rrmApi.c index 4023bf6d1944..38398b321cc2 100644 --- a/CORE/MAC/src/pe/rrm/rrmApi.c +++ b/CORE/MAC/src/pe/rrm/rrmApi.c @@ -281,58 +281,26 @@ rrmProcessLinkMeasurementRequest( tpAniSirGlobal pMac, return eSIR_FAILURE; } pHdr = WDA_GET_RX_MAC_HEADER( pRxPacketInfo ); - if( (uint8)(pSessionEntry->maxTxPower) != pLinkReq->MaxTxPower.maxTxPower ) - { - PELOGW(limLog( pMac, - LOGW, - FL(" maxTx power in link request is not same as local... " - " Local = %d LinkReq = %d"), - pSessionEntry->maxTxPower, - pLinkReq->MaxTxPower.maxTxPower );) - if( (MIN_STA_PWR_CAP_DBM <= pLinkReq->MaxTxPower.maxTxPower) && - (MAX_STA_PWR_CAP_DBM >= pLinkReq->MaxTxPower.maxTxPower) ) - { - LinkReport.txPower = pLinkReq->MaxTxPower.maxTxPower; - } - else if( MIN_STA_PWR_CAP_DBM > pLinkReq->MaxTxPower.maxTxPower ) - { - LinkReport.txPower = MIN_STA_PWR_CAP_DBM; - } - else if( MAX_STA_PWR_CAP_DBM < pLinkReq->MaxTxPower.maxTxPower ) - { - LinkReport.txPower = MAX_STA_PWR_CAP_DBM; - } - if( (LinkReport.txPower != (uint8)(pSessionEntry->maxTxPower)) && - (eSIR_SUCCESS == rrmSendSetMaxTxPowerReq ( pMac, - (tPowerdBm)(LinkReport.txPower), - pSessionEntry)) ) - { - pSessionEntry->maxTxPower = (tPowerdBm)(LinkReport.txPower); - } - } - else + LinkReport.txPower = limGetMaxTxPower (pLinkReq->MaxTxPower.maxTxPower, + pLinkReq->MaxTxPower.maxTxPower, + pMac->roam.configParam.nTxPowerCap); + + if ((LinkReport.txPower != (uint8)(pSessionEntry->maxTxPower)) && + (eSIR_SUCCESS == rrmSendSetMaxTxPowerReq (pMac, + (tPowerdBm)(LinkReport.txPower), + pSessionEntry))) { - if( (MIN_STA_PWR_CAP_DBM <= (uint8)(pSessionEntry->maxTxPower)) && - (MAX_STA_PWR_CAP_DBM >= (uint8)(pSessionEntry->maxTxPower)) ) - { - LinkReport.txPower = (uint8)(pSessionEntry->maxTxPower); - } - else if( MIN_STA_PWR_CAP_DBM > (uint8)(pSessionEntry->maxTxPower) ) - { - LinkReport.txPower = MIN_STA_PWR_CAP_DBM; - } - else if( MAX_STA_PWR_CAP_DBM < (uint8)(pSessionEntry->maxTxPower) ) - { - LinkReport.txPower = MAX_STA_PWR_CAP_DBM; - } - } - PELOGW(limLog( pMac, + PELOGW (limLog (pMac, LOGW, - FL(" maxTx power in link request is not same as local... " - " Local = %d Link Report TxPower = %d"), + FL(" maxTx power in link report is not same as local..." + " Local = %d Link Request TxPower = %d" + " Link Report TxPower = %d"), pSessionEntry->maxTxPower, - LinkReport.txPower );) + LinkReport.txPower, + pLinkReq->MaxTxPower.maxTxPower);) + pSessionEntry->maxTxPower = (tPowerdBm)(LinkReport.txPower); + } LinkReport.dialogToken = pLinkReq->DialogToken.token; LinkReport.rxAntenna = 0; diff --git a/CORE/MAC/src/pe/sch/schBeaconProcess.c b/CORE/MAC/src/pe/sch/schBeaconProcess.c index 000270f6ae23..e2df6180af61 100644 --- a/CORE/MAC/src/pe/sch/schBeaconProcess.c +++ b/CORE/MAC/src/pe/sch/schBeaconProcess.c @@ -340,7 +340,7 @@ static void __schBeaconProcessForSession( tpAniSirGlobal pMac, tANI_U8 operMode; tANI_U8 chWidth = 0; #endif -#if defined FEATURE_WLAN_ESE || defined FEATURE_WLAN_VOWIFI +#if defined FEATURE_WLAN_ESE || defined WLAN_FEATURE_VOWIFI tPowerdBm regMax = 0,maxTxPower = 0; #endif @@ -590,12 +590,12 @@ static void __schBeaconProcessForSession( tpAniSirGlobal pMac, } #endif -#if defined (FEATURE_WLAN_ESE) || defined (FEATURE_WLAN_VOWIFI) +#if defined (FEATURE_WLAN_ESE) || defined (WLAN_FEATURE_VOWIFI) /* Obtain the Max Tx power for the current regulatory */ regMax = cfgGetRegulatoryMaxTransmitPower( pMac, psessionEntry->currentOperChannel ); #endif -#if defined FEATURE_WLAN_VOWIFI +#if defined WLAN_FEATURE_VOWIFI { tPowerdBm localRRMConstraint = 0; if ( pMac->rrm.rrmPEContext.rrmEnable && pBeacon->powerConstraintPresent ) @@ -606,7 +606,8 @@ static void __schBeaconProcessForSession( tpAniSirGlobal pMac, { localRRMConstraint = 0; } - maxTxPower = VOS_MIN(regMax,(regMax - localRRMConstraint)); + maxTxPower = limGetMaxTxPower(regMax, regMax - localRRMConstraint, + pMac->roam.configParam.nTxPowerCap); } #elif defined FEATURE_WLAN_ESE maxTxPower = regMax; @@ -625,7 +626,7 @@ static void __schBeaconProcessForSession( tpAniSirGlobal pMac, } #endif -#if defined (FEATURE_WLAN_ESE) || defined (FEATURE_WLAN_VOWIFI) +#if defined (FEATURE_WLAN_ESE) || defined (WLAN_FEATURE_VOWIFI) { //If maxTxPower is increased or decreased if( maxTxPower != psessionEntry->maxTxPower ) diff --git a/CORE/SERVICES/WMA/wma.c b/CORE/SERVICES/WMA/wma.c index 2f5a3dd47f38..6cd95e79de8a 100644 --- a/CORE/SERVICES/WMA/wma.c +++ b/CORE/SERVICES/WMA/wma.c @@ -9238,6 +9238,8 @@ wma_vdev_set_bss_params(tp_wma_handle wma, int vdev_id, maxTxPower); if (ret) WMA_LOGE("failed to set WMI_VDEV_PARAM_TX_PWRLIMIT"); + else + intr[vdev_id].max_tx_power = maxTxPower; /* Slot time */ if (shortSlotTimeSupported) diff --git a/CORE/SME/src/csr/csrApiRoam.c b/CORE/SME/src/csr/csrApiRoam.c index 522e554fe417..58b5856e33c3 100644 --- a/CORE/SME/src/csr/csrApiRoam.c +++ b/CORE/SME/src/csr/csrApiRoam.c @@ -12684,7 +12684,7 @@ static void csrPrepareJoinReassocReqBuffer( tpAniSirGlobal pMac, // corresponds to --- pMsg->spectrumMgtIndicator = ON; vos_mem_copy(pBuf, (tANI_U8 *)&fTmp, sizeof(tAniBool)); pBuf += sizeof(tAniBool); - *pBuf++ = MIN_STA_PWR_CAP_DBM; // it is for pMsg->powerCap.minTxPower = 0; + *pBuf++ = MIN_TX_PWR_CAP; // it is for pMsg->powerCap.minTxPower = 0; found = csrSearchChannelListForTxPower(pMac, pBssDescription, &channelGroup); // This is required for 11k test VoWiFi Ent: Test 2. // We need the power capabilities for Assoc Req. @@ -12697,7 +12697,7 @@ static void csrPrepareJoinReassocReqBuffer( tpAniSirGlobal pMac, } else { - *pBuf++ = MAX_STA_PWR_CAP_DBM; + *pBuf++ = MAX_TX_PWR_CAP; } size = sizeof(pMac->roam.validChannelList); if(HAL_STATUS_SUCCESS(csrGetCfgValidChannels(pMac, (tANI_U8 *)pMac->roam.validChannelList, &size))) diff --git a/CORE/WDA/inc/legacy/halTypes.h b/CORE/WDA/inc/legacy/halTypes.h index f8878d3a3d18..60864646752e 100644 --- a/CORE/WDA/inc/legacy/halTypes.h +++ b/CORE/WDA/inc/legacy/halTypes.h @@ -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. * @@ -344,8 +344,11 @@ typedef enum #define HAL_MAX_TXPOWER_INVALID 127 -#define MIN_STA_PWR_CAP_DBM 13 -#define MAX_STA_PWR_CAP_DBM 19 +/* These are the min/max tx power (non virtual rates) range + * supported by rome/prima hardware + */ +#define MIN_TX_PWR_CAP 8 +#define MAX_TX_PWR_CAP 22 /* Moving the miscellaneous defination required by UMAC are moved here from * volansdefs.h */ -- cgit v1.2.3 From ca74728f45e1e618a637b0657cd5ec0e90e083ec Mon Sep 17 00:00:00 2001 From: Ganesh Kondabattini Date: Fri, 6 Jun 2014 16:02:37 +0530 Subject: qcacld: set the value gScanResultAgeCount to 1 set the value gScanResultAgeCount to 1 so that the stale entries will be removed quickly from the scan results. Change-Id: I97b5f405680295435c9432c059ab72c642d9c8a0 CRs-Fixed: 675281 --- firmware_bin/WCNSS_qcom_cfg.ini | 3 +++ 1 file changed, 3 insertions(+) diff --git a/firmware_bin/WCNSS_qcom_cfg.ini b/firmware_bin/WCNSS_qcom_cfg.ini index 32630cf7f0a4..13490c3c53d2 100755 --- a/firmware_bin/WCNSS_qcom_cfg.ini +++ b/firmware_bin/WCNSS_qcom_cfg.ini @@ -423,6 +423,9 @@ gEnableActiveModeOffload=1 #If Set to 0 it will not enable the feature gScanAgingTime=0 +#Enable Scan Results Aging based on number of scans +gScanResultAgeCount=1 + #Enable Power saving mechanism Based on Android Framework #If set to 0 Driver internally control the Power saving mechanism #If set to 1 Android Framwrok control the Power saving mechanism -- cgit v1.2.3 From 664196ce8abcc162cbda5023535d5d960d7c1189 Mon Sep 17 00:00:00 2001 From: Kalikinkar dhara Date: Thu, 5 Jun 2014 21:05:38 -0700 Subject: qcacld: HDD: Sessionized Probe Rsp update for AP+AP For AP+AP, additional IE coming from HDD were passed through a common wlan_cfg buffer. This will cause wrong values to be read by consuming modules for multiple session case (AP+AP). To fix this, additional IE are passed to consumer modules via sessionized buffer thus avoiding any conflict. Change-Id: I5a865e920d1bc0c31e9a7d38946653f5d998a82d CRs-fixed: 649786 --- CORE/HDD/src/wlan_hdd_cfg80211.c | 221 ++++++--------------------------------- CORE/HDD/src/wlan_hdd_main.c | 52 +++++---- 2 files changed, 63 insertions(+), 210 deletions(-) diff --git a/CORE/HDD/src/wlan_hdd_cfg80211.c b/CORE/HDD/src/wlan_hdd_cfg80211.c index 538eef5e8b75..8c0a47bd06b5 100644 --- a/CORE/HDD/src/wlan_hdd_cfg80211.c +++ b/CORE/HDD/src/wlan_hdd_cfg80211.c @@ -1714,8 +1714,10 @@ static int wlan_hdd_cfg80211_update_apies(hdd_adapter_t* pHostapdAdapter, { v_U8_t *genie; v_U8_t total_ielen = 0; - v_U8_t addIE[1] = {0}; int ret = 0; + tsap_Config_t *pConfig; + + pConfig = &pHostapdAdapter->sessionCtx.ap.sapConfig; genie = vos_mem_malloc(MAX_GENIE_LEN); @@ -1778,124 +1780,27 @@ static int wlan_hdd_cfg80211_update_apies(hdd_adapter_t* pHostapdAdapter, } // Added for ProResp IE - if ( (params->proberesp_ies != NULL) && (params->proberesp_ies_len != 0) ) - { - u16 rem_probe_resp_ie_len = params->proberesp_ies_len; - u8 probe_rsp_ie_len[3] = {0}; - u8 counter = 0; - /* Check Probe Resp Length if it is greater then 255 then Store - Probe Resp IEs into WNI_CFG_PROBE_RSP_ADDNIE_DATA1 & - WNI_CFG_PROBE_RSP_ADDNIE_DATA2 CFG Variable As We are not able - Store More then 255 bytes into One Variable. - */ - while ((rem_probe_resp_ie_len > 0) && (counter < 3)) - { - if (rem_probe_resp_ie_len > MAX_CFG_STRING_LEN) - { - probe_rsp_ie_len[counter++] = MAX_CFG_STRING_LEN; - rem_probe_resp_ie_len -= MAX_CFG_STRING_LEN; - } - else - { - probe_rsp_ie_len[counter++] = rem_probe_resp_ie_len; - rem_probe_resp_ie_len = 0; - } - } - - rem_probe_resp_ie_len = 0; - - if (probe_rsp_ie_len[0] > 0) - { - if (ccmCfgSetStr((WLAN_HDD_GET_CTX(pHostapdAdapter))->hHal, - WNI_CFG_PROBE_RSP_ADDNIE_DATA1, - (tANI_U8*)¶ms->proberesp_ies[rem_probe_resp_ie_len], - probe_rsp_ie_len[0], NULL, - eANI_BOOLEAN_FALSE) == eHAL_STATUS_FAILURE) - { - hddLog(LOGE, - "Could not pass on WNI_CFG_PROBE_RSP_ADDNIE_DATA1 to CCM"); - ret = -EINVAL; - goto done; - } - rem_probe_resp_ie_len += probe_rsp_ie_len[0]; - } - - if (probe_rsp_ie_len[1] > 0) - { - if (ccmCfgSetStr((WLAN_HDD_GET_CTX(pHostapdAdapter))->hHal, - WNI_CFG_PROBE_RSP_ADDNIE_DATA2, - (tANI_U8*)¶ms->proberesp_ies[rem_probe_resp_ie_len], - probe_rsp_ie_len[1], NULL, - eANI_BOOLEAN_FALSE) == eHAL_STATUS_FAILURE) - { - hddLog(LOGE, - "Could not pass on WNI_CFG_PROBE_RSP_ADDNIE_DATA2 to CCM"); - ret = -EINVAL; - goto done; - } - rem_probe_resp_ie_len += probe_rsp_ie_len[1]; - } - - if (probe_rsp_ie_len[2] > 0) - { - if (ccmCfgSetStr((WLAN_HDD_GET_CTX(pHostapdAdapter))->hHal, - WNI_CFG_PROBE_RSP_ADDNIE_DATA3, - (tANI_U8*)¶ms->proberesp_ies[rem_probe_resp_ie_len], - probe_rsp_ie_len[2], NULL, - eANI_BOOLEAN_FALSE) == eHAL_STATUS_FAILURE) - { - hddLog(LOGE, - "Could not pass on WNI_CFG_PROBE_RSP_ADDNIE_DATA3 to CCM"); - ret = -EINVAL; - goto done; - } - rem_probe_resp_ie_len += probe_rsp_ie_len[2]; - } - - if (probe_rsp_ie_len[1] == 0 ) - { - if ( eHAL_STATUS_FAILURE == ccmCfgSetStr((WLAN_HDD_GET_CTX(pHostapdAdapter))->hHal, - WNI_CFG_PROBE_RSP_ADDNIE_DATA2, (tANI_U8*)addIE, 0, NULL, - eANI_BOOLEAN_FALSE) ) - { - hddLog(LOGE, - "Could not pass on WNI_CFG_PROBE_RSP_ADDNIE_DATA2 to CCM"); - } - } - - if (probe_rsp_ie_len[2] == 0 ) - { - if ( eHAL_STATUS_FAILURE == ccmCfgSetStr((WLAN_HDD_GET_CTX(pHostapdAdapter))->hHal, - WNI_CFG_PROBE_RSP_ADDNIE_DATA3, (tANI_U8*)addIE, 0, NULL, - eANI_BOOLEAN_FALSE) ) - { - hddLog(LOGE, - "Could not pass on WNI_CFG_PROBE_RSP_ADDNIE_DATA3 to CCM"); - } - } - - if (ccmCfgSetInt((WLAN_HDD_GET_CTX(pHostapdAdapter))->hHal, - WNI_CFG_PROBE_RSP_ADDNIE_FLAG, 1,NULL, - test_bit(SOFTAP_BSS_STARTED, &pHostapdAdapter->event_flags) ? - eANI_BOOLEAN_TRUE : eANI_BOOLEAN_FALSE) - == eHAL_STATUS_FAILURE) + if (test_bit(SOFTAP_BSS_STARTED, &pHostapdAdapter->event_flags)) + { + if (sme_UpdateAddIE(WLAN_HDD_GET_HAL_CTX(pHostapdAdapter), + pHostapdAdapter->sessionId, + pHostapdAdapter->macAddressCurrent.bytes, + (tANI_U8*)params->proberesp_ies, + params->proberesp_ies_len, + VOS_FALSE) == eHAL_STATUS_FAILURE) { - hddLog(LOGE, - "Could not pass on WNI_CFG_PROBE_RSP_ADDNIE_FLAG to CCM"); - ret = -EINVAL; - goto done; + hddLog(LOGE, FL("Could not pass on Probe Resp Add Ie")); + ret = -EINVAL; + goto done; } + WLANSAP_ResetSapConfigAddIE(pConfig); } else { - // Reset WNI_CFG_PROBE_RSP Flags - wlan_hdd_reset_prob_rspies(pHostapdAdapter); - - hddLog(VOS_TRACE_LEVEL_INFO, - "%s: No Probe Response IE received in set beacon", - __func__); + WLANSAP_UpdateSapConfigAddIE(pConfig, + params->proberesp_ies, + params->proberesp_ies_len); } - // Added for AssocResp IE if ( (params->assocresp_ies != NULL) && (params->assocresp_ies_len != 0) ) { @@ -2654,6 +2559,7 @@ static int wlan_hdd_cfg80211_start_bss(hdd_adapter_t *pHostapdAdapter, if ( 0 != wlan_hdd_cfg80211_update_apies(pHostapdAdapter, params) ) { hddLog(LOGE, FL("SAP Not able to set AP IEs")); + WLANSAP_ResetSapConfigAddIE(pConfig); return -EINVAL; } @@ -2686,6 +2592,7 @@ static int wlan_hdd_cfg80211_start_bss(hdd_adapter_t *pHostapdAdapter, if(test_bit(SOFTAP_BSS_STARTED, &pHostapdAdapter->event_flags)) { + WLANSAP_ResetSapConfigAddIE(pConfig); //Bss already started. just return. //TODO Probably it should update some beacon params. hddLog( LOGE, "Bss Already started...Ignore the request"); @@ -2735,6 +2642,7 @@ static int wlan_hdd_cfg80211_start_bss(hdd_adapter_t *pHostapdAdapter, pSapEventCallback, pConfig, (v_PVOID_t)pHostapdAdapter->dev); if (!VOS_IS_STATUS_SUCCESS(status)) { + WLANSAP_ResetSapConfigAddIE(pConfig); hddLog(LOGE,FL("SAP Start Bss fail")); return -EINVAL; } @@ -2744,6 +2652,8 @@ static int wlan_hdd_cfg80211_start_bss(hdd_adapter_t *pHostapdAdapter, status = vos_wait_single_event(&pHostapdState->vosEvent, 10000); + WLANSAP_ResetSapConfigAddIE(pConfig); + if (!VOS_IS_STATUS_SUCCESS(status)) { VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, @@ -6644,86 +6554,15 @@ int wlan_hdd_cfg80211_set_ie( hdd_adapter_t *pAdapter, if ( (NULL != (genie - 2)) && (0 != eLen + 2) ) { u16 rem_probe_resp_ie_len = eLen + 2; - u8 probe_rsp_ie_len[3] = {0}; - u8 counter = 0; - - /* Check Probe Resp Length if it is greater then 255 then - Store Probe Rsp IEs into WNI_CFG_PROBE_RSP_ADDNIE_DATA1 - & WNI_CFG_PROBE_RSP_ADDNIE_DATA2 CFG Variable As We are - not able Store More then 255 bytes into One Variable */ - - while ((rem_probe_resp_ie_len > 0) && (counter < 3)) - { - if (rem_probe_resp_ie_len > MAX_CFG_STRING_LEN) - { - probe_rsp_ie_len[counter++] = MAX_CFG_STRING_LEN; - rem_probe_resp_ie_len -= MAX_CFG_STRING_LEN; - } - else - { - probe_rsp_ie_len[counter++] = rem_probe_resp_ie_len; - rem_probe_resp_ie_len = 0; - } - } - - rem_probe_resp_ie_len = 0; - - if (probe_rsp_ie_len[0] > 0) - { - if (ccmCfgSetStr(WLAN_HDD_GET_HAL_CTX(pAdapter), - WNI_CFG_PROBE_RSP_ADDNIE_DATA1, - (tANI_U8*)(genie - 2), - probe_rsp_ie_len[0], NULL, - eANI_BOOLEAN_FALSE) - == eHAL_STATUS_FAILURE) - { - hddLog(LOGE, - "Could not pass" - "on WNI_CFG_PROBE_RSP_ADDNIE_DATA1 to CCM"); - } - rem_probe_resp_ie_len += probe_rsp_ie_len[0]; - } - - if (probe_rsp_ie_len[1] > 0) + if (sme_UpdateAddIE(WLAN_HDD_GET_HAL_CTX(pAdapter), + pAdapter->sessionId, + pAdapter->macAddressCurrent.bytes, + (tANI_U8*)(genie - 2), + rem_probe_resp_ie_len, + VOS_TRUE) == eHAL_STATUS_FAILURE) { - if (ccmCfgSetStr(WLAN_HDD_GET_HAL_CTX(pAdapter), - WNI_CFG_PROBE_RSP_ADDNIE_DATA2, - (tANI_U8*)(genie - (2 + rem_probe_resp_ie_len)), - probe_rsp_ie_len[1], NULL, - eANI_BOOLEAN_FALSE) - == eHAL_STATUS_FAILURE) - { - hddLog(LOGE, - "Could not pass" - "on WNI_CFG_PROBE_RSP_ADDNIE_DATA2 to CCM"); - } - rem_probe_resp_ie_len += probe_rsp_ie_len[1]; + hddLog(LOGE, "Could not pass ADDNIE data to PE"); } - - if (probe_rsp_ie_len[2] > 0) - { - if (ccmCfgSetStr(WLAN_HDD_GET_HAL_CTX(pAdapter), - WNI_CFG_PROBE_RSP_ADDNIE_DATA3, - (tANI_U8*)(genie - (2 + rem_probe_resp_ie_len)), - probe_rsp_ie_len[2], NULL, - eANI_BOOLEAN_FALSE) - == eHAL_STATUS_FAILURE) - { - hddLog(LOGE, - "Could not pass" - "on WNI_CFG_PROBE_RSP_ADDNIE_DATA3 to CCM"); - } - rem_probe_resp_ie_len += probe_rsp_ie_len[2]; - } - - if (ccmCfgSetInt(WLAN_HDD_GET_HAL_CTX(pAdapter), - WNI_CFG_PROBE_RSP_ADDNIE_FLAG, 1,NULL, - eANI_BOOLEAN_FALSE) == eHAL_STATUS_FAILURE) - { - hddLog(LOGE, - "Could not pass" - "on WNI_CFG_PROBE_RSP_ADDNIE_FLAG to CCM"); - } } else { diff --git a/CORE/HDD/src/wlan_hdd_main.c b/CORE/HDD/src/wlan_hdd_main.c index ef7392956183..ddebd777538d 100755 --- a/CORE/HDD/src/wlan_hdd_main.c +++ b/CORE/HDD/src/wlan_hdd_main.c @@ -8782,30 +8782,44 @@ VOS_STATUS hdd_close_all_adapters( hdd_context_t *pHddCtx ) void wlan_hdd_reset_prob_rspies(hdd_adapter_t* pHostapdAdapter) { - v_U8_t addIE[1] = {0}; - - if ( eHAL_STATUS_FAILURE == ccmCfgSetStr((WLAN_HDD_GET_CTX(pHostapdAdapter))->hHal, - WNI_CFG_PROBE_RSP_ADDNIE_DATA1,(tANI_U8*)addIE, 0, NULL, - eANI_BOOLEAN_FALSE) ) + tANI_U8 *bssid = NULL; + switch (pHostapdAdapter->device_mode) + { + case WLAN_HDD_INFRA_STATION: + case WLAN_HDD_P2P_CLIENT: { - hddLog(LOGE, - "Could not pass on WNI_CFG_PROBE_RSP_ADDNIE_DATA1 to CCM"); + hdd_station_ctx_t * pHddStaCtx = + WLAN_HDD_GET_STATION_CTX_PTR(pHostapdAdapter); + bssid = (tANI_U8*)&pHddStaCtx->conn_info.bssId; + break; } - - if ( eHAL_STATUS_FAILURE == ccmCfgSetStr((WLAN_HDD_GET_CTX(pHostapdAdapter))->hHal, - WNI_CFG_PROBE_RSP_ADDNIE_DATA2, (tANI_U8*)addIE, 0, NULL, - eANI_BOOLEAN_FALSE) ) + case WLAN_HDD_SOFTAP: + case WLAN_HDD_P2P_GO: + case WLAN_HDD_IBSS: { - hddLog(LOGE, - "Could not pass on WNI_CFG_PROBE_RSP_ADDNIE_DATA2 to CCM"); + bssid = pHostapdAdapter->macAddressCurrent.bytes; + break; } - - if ( eHAL_STATUS_FAILURE == ccmCfgSetStr((WLAN_HDD_GET_CTX(pHostapdAdapter))->hHal, - WNI_CFG_PROBE_RSP_ADDNIE_DATA3, (tANI_U8*)addIE, 0, NULL, - eANI_BOOLEAN_FALSE) ) + case WLAN_HDD_MONITOR: + case WLAN_HDD_FTM: + case WLAN_HDD_P2P_DEVICE: + default: + /* + * wlan_hdd_reset_prob_rspies should not have been called + * for these kind of devices + */ + hddLog(LOGE, FL("Unexpected request for the current device type %d"), + pHostapdAdapter->device_mode); + return; + } + if (sme_UpdateAddIE(WLAN_HDD_GET_HAL_CTX(pHostapdAdapter), + pHostapdAdapter->sessionId, + bssid, + NULL, + 0, + VOS_TRUE) == eHAL_STATUS_FAILURE) { - hddLog(LOGE, - "Could not pass on WNI_CFG_PROBE_RSP_ADDNIE_DATA3 to CCM"); + hddLog(LOGE, "Could not pass on Additional IE data to PE"); } } -- cgit v1.2.3 From 1aefffd5f3b70600981750f10b5fb302c5bf9272 Mon Sep 17 00:00:00 2001 From: Kalikinkar dhara Date: Thu, 29 May 2014 20:40:03 -0700 Subject: qcacld: Sessionized Probe Rsp update for AP+AP For AP+AP, additional IE coming from HDD were passed through a common wlan_cfg buffer. This will cause wrong values to be read by consuming modules for multiple session case (AP+AP). To fix this, additional IE are passed to consumer modules via sessionized buffer thus avoiding any conflict. CRs-fixed: 649786 Change-Id: I88ce027d50f6da7825667e735b1f159fd94e2dc1 --- CORE/MAC/inc/sirApi.h | 19 ++++ CORE/MAC/inc/wniApi.h | 1 + CORE/MAC/src/pe/include/limSession.h | 2 + CORE/MAC/src/pe/lim/limProcessMessageQueue.c | 5 + CORE/MAC/src/pe/lim/limProcessSmeReqMessages.c | 134 +++++++++++++++++++++++++ CORE/MAC/src/pe/lim/limSendManagementFrames.c | 94 ++--------------- CORE/MAC/src/pe/lim/limSerDesUtils.c | 5 + CORE/MAC/src/pe/sch/schApi.c | 34 ++----- CORE/SAP/inc/sapApi.h | 61 +++++++++++ CORE/SAP/src/sapFsm.c | 11 ++ CORE/SAP/src/sapModule.c | 46 +++++++++ CORE/SME/inc/csrApi.h | 2 + CORE/SME/inc/csrInternal.h | 23 +++++ CORE/SME/inc/sme_Api.h | 19 ++++ CORE/SME/src/csr/csrApiRoam.c | 81 ++++++++++++++- CORE/SME/src/sme_common/sme_Api.c | 34 +++++++ 16 files changed, 455 insertions(+), 116 deletions(-) diff --git a/CORE/MAC/inc/sirApi.h b/CORE/MAC/inc/sirApi.h index 689de475b3e1..ef6df7325c99 100644 --- a/CORE/MAC/inc/sirApi.h +++ b/CORE/MAC/inc/sirApi.h @@ -614,6 +614,11 @@ typedef __ani_attr_pre_packed struct sSirHtConfig tANI_U32 unused:27; } __ani_attr_packed tSirHTConfig, *tpSirHTConfig; +typedef __ani_attr_pre_packed struct sSirAddIeParams{ + tANI_U16 dataLen; + tANI_U8 *data_buff; +} tSirAddIeParams, *tpSirAddIeParams; + /// Definition for kick starting BSS /// ---> MAC /** @@ -676,6 +681,7 @@ typedef struct sSirSmeStartBssReq tANI_BOOLEAN pmfRequired; #endif + tSirAddIeParams addIeParams; } tSirSmeStartBssReq, *tpSirSmeStartBssReq; #define GET_IE_LEN_IN_BSS(lenInBss) ( lenInBss + sizeof(lenInBss) - \ @@ -4884,6 +4890,19 @@ typedef struct sSirStartBeaconIndication tANI_U8 bssid[VOS_MAC_ADDR_SIZE]; }tSirStartBeaconIndication, *tpSirStartBeaconIndication; + +/* Message format for Update IE message sent to PE */ +typedef struct sUpdateAIEs +{ + tANI_U16 msgType; + tANI_U16 msgLen; + tSirMacAddr bssid; + tANI_U16 smeSessionId; + tANI_U8 *pAdditionIEBuffer; + tANI_U16 length; + boolean append; +}tUpdateAIEs, *tpUpdateAIEs; + /* Message format for requesting channel switch announcement to lower layers */ typedef struct sSirDfsCsaIeRequest { diff --git a/CORE/MAC/inc/wniApi.h b/CORE/MAC/inc/wniApi.h index a7cfb60577b1..79a7fae0335b 100644 --- a/CORE/MAC/inc/wniApi.h +++ b/CORE/MAC/inc/wniApi.h @@ -395,6 +395,7 @@ enum eWniMsgTypes eWNI_SME_STATS_EXT_EVENT, 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 eWNI_SME_MSG_TYPES_END }; diff --git a/CORE/MAC/src/pe/include/limSession.h b/CORE/MAC/src/pe/include/limSession.h index affda82c8004..649fcf7bb0b6 100644 --- a/CORE/MAC/src/pe/include/limSession.h +++ b/CORE/MAC/src/pe/include/limSession.h @@ -423,6 +423,8 @@ typedef struct sPESession // Added to Support BT-AMP #endif tANI_BOOLEAN isCiscoVendorAP; + + tSirAddIeParams addIeParams; }tPESession, *tpPESession; #define LIM_MAX_ACTIVE_SESSIONS 4 diff --git a/CORE/MAC/src/pe/lim/limProcessMessageQueue.c b/CORE/MAC/src/pe/lim/limProcessMessageQueue.c index 077945eef11e..8cb1e9e85dfd 100644 --- a/CORE/MAC/src/pe/lim/limProcessMessageQueue.c +++ b/CORE/MAC/src/pe/lim/limProcessMessageQueue.c @@ -2176,6 +2176,11 @@ limProcessMessages(tpAniSirGlobal pMac, tpSirMsgQ limMsg) limMsg->bodyptr = NULL; break; + case eWNI_SME_UPDATE_ADDITIONAL_IES: + limProcessSmeReqMessages(pMac, limMsg); + vos_mem_free((v_VOID_t*)limMsg->bodyptr); + limMsg->bodyptr = NULL; + break; 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 8d4ab4e003e0..c72038e77ae9 100644 --- a/CORE/MAC/src/pe/lim/limProcessSmeReqMessages.c +++ b/CORE/MAC/src/pe/lim/limProcessSmeReqMessages.c @@ -101,6 +101,8 @@ static void limProcessSmeStartBeaconReq(tpAniSirGlobal pMac, tANI_U32 *pMsg); static void limProcessSmeDfsCsaIeRequest(tpAniSirGlobal pMac, tANI_U32 *pMsg); +static void limProcessUpdateAddIEs(tpAniSirGlobal pMac, tANI_U32 *pMsg); + void __limProcessSmeAssocCnfNew(tpAniSirGlobal, tANI_U32, tANI_U32 *); extern void peRegisterTLHandle(tpAniSirGlobal pMac); @@ -575,7 +577,28 @@ __limHandleSmeStartBssRequest(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) retCode = eSIR_SME_RESOURCES_UNAVAILABLE; goto free; } + } + + if (pSmeStartBssReq->addIeParams.dataLen > 0 && + pSmeStartBssReq->addIeParams.data_buff != NULL) + { + psessionEntry->addIeParams.dataLen = + pSmeStartBssReq->addIeParams.dataLen; + + psessionEntry->addIeParams.data_buff = + vos_mem_malloc(psessionEntry->addIeParams.dataLen); + if ( NULL == psessionEntry->addIeParams.data_buff ) + { + PELOGE(limLog(pMac, LOGE, FL("AllocateMemory failed for " + "psessionEntry->addIeParams.data_buff "));) + // Send failure response to host + retCode = eSIR_SME_RESOURCES_UNAVAILABLE; + goto end; + } + vos_mem_copy(psessionEntry->addIeParams.data_buff, + pSmeStartBssReq->addIeParams.data_buff, + psessionEntry->addIeParams.dataLen); } /* Store the session related parameters in newly created session */ @@ -3726,6 +3749,11 @@ __limHandleSmeStopBssRequest(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) limSendDisassocMgmtFrame(pMac, eSIR_MAC_DEAUTH_LEAVING_BSS_REASON, bcAddr, psessionEntry, FALSE); } + /* Free the buffer allocated in START_BSS_REQ */ + vos_mem_free(psessionEntry->addIeParams.data_buff); + psessionEntry->addIeParams.dataLen = 0; + psessionEntry->addIeParams.data_buff = NULL; + //limDelBss is also called as part of coalescing, when we send DEL BSS followed by Add Bss msg. pMac->lim.gLimIbssCoalescingHappened = false; @@ -5942,6 +5970,10 @@ limProcessSmeReqMessages(tpAniSirGlobal pMac, tpSirMsgQ pMsg) limProcessSmeDfsCsaIeRequest(pMac, pMsgBuf); break; + case eWNI_SME_UPDATE_ADDITIONAL_IES: + limProcessUpdateAddIEs(pMac, pMsgBuf); + break; + default: vos_mem_free((v_VOID_t*)pMsg->bodyptr); pMsg->bodyptr = NULL; @@ -6142,6 +6174,108 @@ limProcessSmeChannelChangeRequest(tpAniSirGlobal pMac, tANI_U32 *pMsg) } } +/****************************************************************************** + * limProcessUpdateAddIEs() + * + *FUNCTION: + * This function is called by limProcessMessageQueue(). This + * function update the PE buffers for additional IEs. + * + *LOGIC: + * + *ASSUMPTIONS: + * + *NOTE: + * + * @param pMac Pointer to Global MAC structure + * @param *pMsgBuf A pointer to the SME message buffer +******************************************************************************/ +static void +limProcessUpdateAddIEs(tpAniSirGlobal pMac, tANI_U32 *pMsg) +{ + tpUpdateAIEs pUpdateAIEs = (tpUpdateAIEs)pMsg; + tANI_U8 sessionId; + /* incoming message has smeSession, use BSSID to find PE session*/ + tpPESession psessionEntry = peFindSessionByBssid(pMac, + pUpdateAIEs->bssid, + &sessionId); + + if (NULL != psessionEntry) { + /* if len is 0, upper layer requested freeing of buffer */ + if (0 == pUpdateAIEs->length) { + /* free old buffer */ + vos_mem_free(psessionEntry->addIeParams.data_buff); + psessionEntry->addIeParams.data_buff = NULL; + psessionEntry->addIeParams.dataLen = 0; + return; + } + + if (pUpdateAIEs->append) { + /* In case of append, allocate new memory with combined length */ + tANI_U16 new_length = pUpdateAIEs->length + + psessionEntry->addIeParams.dataLen; + tANI_U8 *new_ptr = vos_mem_malloc(new_length); + if (NULL == new_ptr) { + limLog(pMac, LOGE, FL("Memory allocation failed.")); + /* free incoming buffer in message */ + vos_mem_free(pUpdateAIEs->pAdditionIEBuffer); + return; + } + /* append buffer to end of local buffers */ + vos_mem_copy(new_ptr, + psessionEntry->addIeParams.data_buff, + psessionEntry->addIeParams.dataLen); + vos_mem_copy(&new_ptr[psessionEntry->addIeParams.dataLen], + pUpdateAIEs->pAdditionIEBuffer, + pUpdateAIEs->length); + /* free old memory*/ + vos_mem_free(psessionEntry->addIeParams.data_buff); + /* adjust length accordingly */ + psessionEntry->addIeParams.dataLen = new_length; + /* save refernece of local buffer in PE session */ + psessionEntry->addIeParams.data_buff = new_ptr; + /* free incoming buffer in message */ + vos_mem_free(pUpdateAIEs->pAdditionIEBuffer); + return; + } + + if (pUpdateAIEs->length > psessionEntry->addIeParams.dataLen) { + psessionEntry->addIeParams.dataLen = pUpdateAIEs->length; + /* free old buffer */ + vos_mem_free(psessionEntry->addIeParams.data_buff); + /* allocate a new */ + psessionEntry->addIeParams.data_buff = + vos_mem_malloc(psessionEntry->addIeParams.dataLen); + + if (NULL == psessionEntry->addIeParams.data_buff) { + limLog(pMac, LOGE, FL("Memory allocation failed.")); + /* free incoming buffer in message */ + vos_mem_free(pUpdateAIEs->pAdditionIEBuffer); + psessionEntry->addIeParams.dataLen = 0; + return; + } + } + + /* + * copy the content of addition IE buffer in local buffer in + * PE session + */ + psessionEntry->addIeParams.dataLen = pUpdateAIEs->length; + vos_mem_copy(psessionEntry->addIeParams.data_buff, + pUpdateAIEs->pAdditionIEBuffer, + psessionEntry->addIeParams.dataLen); + /* free incoming buffer in message */ + vos_mem_free(pUpdateAIEs->pAdditionIEBuffer); + } + else + { + /* free incoming buffer in message */ + vos_mem_free(pUpdateAIEs->pAdditionIEBuffer); + pUpdateAIEs->pAdditionIEBuffer = NULL; + limLog(pMac, LOGE, FL("Session not found for given bssid.")); + } +} + /** * limProcessSmeDfsCsaIeRequest() * diff --git a/CORE/MAC/src/pe/lim/limSendManagementFrames.c b/CORE/MAC/src/pe/lim/limSendManagementFrames.c index 82c0966d9a50..1cb226e42a3c 100644 --- a/CORE/MAC/src/pe/lim/limSendManagementFrames.c +++ b/CORE/MAC/src/pe/lim/limSendManagementFrames.c @@ -740,10 +740,8 @@ limSendProbeRspMgmtFrame(tpAniSirGlobal pMac, tANI_U8 *pFrame; void *pPacket; eHalStatus halstatus; - tANI_U32 addnIEPresent; - tANI_U32 addnIE1Len=0; - tANI_U32 addnIE2Len=0; - tANI_U32 addnIE3Len=0; + tANI_U32 addnIEPresent = VOS_FALSE; + tANI_U16 totalAddnIeLen = 0; tANI_U32 wpsApEnable=0, tmp; tANI_U8 txFlag = 0; @@ -912,7 +910,6 @@ limSendProbeRspMgmtFrame(tpAniSirGlobal pMac, nBytes = nPayload + sizeof( tSirMacMgmtHdr ); - addnIEPresent = false; if( pMac->lim.gpLimRemainOnChanReq ) { @@ -922,20 +919,13 @@ limSendProbeRspMgmtFrame(tpAniSirGlobal pMac, //In listening mode, probe rsp IEs is passed in the message from SME to PE else { - - if (wlan_cfgGetInt(pMac, WNI_CFG_PROBE_RSP_ADDNIE_FLAG, - &addnIEPresent) != eSIR_SUCCESS) - { - limLog(pMac, LOGP, FL("Unable to get WNI_CFG_PROBE_RSP_ADDNIE_FLAG")); - vos_mem_free(pFrm); - return; - } + addnIEPresent = (psessionEntry->addIeParams.dataLen != 0); } if (addnIEPresent) { - addIE = vos_mem_malloc(WNI_CFG_PROBE_RSP_ADDNIE_DATA1_LEN*3); + addIE = vos_mem_malloc(psessionEntry->addIeParams.dataLen); if ( NULL == addIE ) { PELOGE(limLog(pMac, LOGE, @@ -944,79 +934,9 @@ limSendProbeRspMgmtFrame(tpAniSirGlobal pMac, return; } - //Probe rsp IE available - if ( eSIR_SUCCESS != wlan_cfgGetStrLen(pMac, - WNI_CFG_PROBE_RSP_ADDNIE_DATA1, &addnIE1Len) ) - { - limLog(pMac, LOGP, FL("Unable to get WNI_CFG_PROBE_RSP_ADDNIE_DATA1 length")); - vos_mem_free(addIE); - vos_mem_free(pFrm); - return; - } - if (addnIE1Len <= WNI_CFG_PROBE_RSP_ADDNIE_DATA1_LEN && addnIE1Len && - (nBytes + addnIE1Len) <= SIR_MAX_PACKET_SIZE) - { - if ( eSIR_SUCCESS != wlan_cfgGetStr(pMac, - WNI_CFG_PROBE_RSP_ADDNIE_DATA1, &addIE[0], - &addnIE1Len) ) - { - limLog(pMac, LOGP, - FL("Unable to get WNI_CFG_PROBE_RSP_ADDNIE_DATA1 String")); - vos_mem_free(addIE); - vos_mem_free(pFrm); - return; - } - } - - //Probe rsp IE available - if ( eSIR_SUCCESS != wlan_cfgGetStrLen(pMac, - WNI_CFG_PROBE_RSP_ADDNIE_DATA2, &addnIE2Len) ) - { - limLog(pMac, LOGP, FL("Unable to get WNI_CFG_PROBE_RSP_ADDNIE_DATA2 length")); - vos_mem_free(addIE); - vos_mem_free(pFrm); - return; - } - if (addnIE2Len <= WNI_CFG_PROBE_RSP_ADDNIE_DATA2_LEN && addnIE2Len && - (nBytes + addnIE2Len) <= SIR_MAX_PACKET_SIZE) - { - if ( eSIR_SUCCESS != wlan_cfgGetStr(pMac, - WNI_CFG_PROBE_RSP_ADDNIE_DATA2, &addIE[addnIE1Len], - &addnIE2Len) ) - { - limLog(pMac, LOGP, - FL("Unable to get WNI_CFG_PROBE_RSP_ADDNIE_DATA2 String")); - vos_mem_free(addIE); - vos_mem_free(pFrm); - return; - } - } - - //Probe rsp IE available - if ( eSIR_SUCCESS != wlan_cfgGetStrLen(pMac, - WNI_CFG_PROBE_RSP_ADDNIE_DATA3, &addnIE3Len) ) - { - limLog(pMac, LOGP, FL("Unable to get WNI_CFG_PROBE_RSP_ADDNIE_DATA3 length")); - vos_mem_free(addIE); - vos_mem_free(pFrm); - return; - } - if (addnIE3Len <= WNI_CFG_PROBE_RSP_ADDNIE_DATA3_LEN && addnIE3Len && - (nBytes + addnIE3Len) <= SIR_MAX_PACKET_SIZE) - { - if ( eSIR_SUCCESS != wlan_cfgGetStr(pMac, - WNI_CFG_PROBE_RSP_ADDNIE_DATA3, - &addIE[addnIE1Len + addnIE2Len], - &addnIE3Len) ) - { - limLog(pMac, LOGP, - FL("Unable to get WNI_CFG_PROBE_RSP_ADDNIE_DATA3 String")); - vos_mem_free(addIE); - vos_mem_free(pFrm); - return; - } - } - totalAddnIeLen = addnIE1Len + addnIE2Len + addnIE3Len; + vos_mem_copy(addIE, psessionEntry->addIeParams.data_buff, + psessionEntry->addIeParams.dataLen); + totalAddnIeLen = psessionEntry->addIeParams.dataLen; if(eSIR_SUCCESS != limGetAddnIeForProbeResp(pMac, addIE, &totalAddnIeLen, probeReqP2pIe)) { diff --git a/CORE/MAC/src/pe/lim/limSerDesUtils.c b/CORE/MAC/src/pe/lim/limSerDesUtils.c index 1490f76ef796..40d2b83b0eb7 100644 --- a/CORE/MAC/src/pe/lim/limSerDesUtils.c +++ b/CORE/MAC/src/pe/lim/limSerDesUtils.c @@ -757,6 +757,11 @@ limStartBssReqSerDes(tpAniSirGlobal pMac, tpSirSmeStartBssReq pStartBssReq, tANI sizeof(tSirHTConfig)); len -= sizeof(tSirHTConfig); pBuf += sizeof(tSirHTConfig); + + vos_mem_copy(&(pStartBssReq->addIeParams), pBuf, sizeof(tSirAddIeParams)); + len -= sizeof(tSirAddIeParams); + pBuf += sizeof(tSirAddIeParams); + if (len) { limLog(pMac, LOGW, FL("Extra bytes left in SME_START_BSS_REQ, len=%d"), len); diff --git a/CORE/MAC/src/pe/sch/schApi.c b/CORE/MAC/src/pe/sch/schApi.c index c0fe657e3a91..481463ec5b07 100644 --- a/CORE/MAC/src/pe/sch/schApi.c +++ b/CORE/MAC/src/pe/sch/schApi.c @@ -406,46 +406,28 @@ tANI_U32 limSendProbeRspTemplateToHal(tpAniSirGlobal pMac,tpPESession psessionEn nBytes = nPayload + sizeof( tSirMacMgmtHdr ); //Check if probe response IE is present or not - if (wlan_cfgGetInt(pMac, WNI_CFG_PROBE_RSP_ADDNIE_FLAG, &addnIEPresent) != eSIR_SUCCESS) - { - schLog(pMac, LOGE, FL("Unable to get WNI_CFG_PROBE_RSP_ADDNIE_FLAG")); - return retCode; - } - + addnIEPresent = (psessionEntry->addIeParams.dataLen != 0); if (addnIEPresent) { //Probe rsp IE available - addIE = vos_mem_malloc(WNI_CFG_PROBE_RSP_ADDNIE_DATA1_LEN); + /*need to check the data length*/ + addIE = vos_mem_malloc(psessionEntry->addIeParams.dataLen); if ( NULL == addIE ) { schLog(pMac, LOGE, FL("Unable to get WNI_CFG_PROBE_RSP_ADDNIE_DATA1 length")); return retCode; } + addnIELen = psessionEntry->addIeParams.dataLen; - if (wlan_cfgGetStrLen(pMac, WNI_CFG_PROBE_RSP_ADDNIE_DATA1, - &addnIELen) != eSIR_SUCCESS) - { - schLog(pMac, LOGE, - FL("Unable to get WNI_CFG_PROBE_RSP_ADDNIE_DATA1 length")); - - vos_mem_free(addIE); - return retCode; - } if (addnIELen <= WNI_CFG_PROBE_RSP_ADDNIE_DATA1_LEN && addnIELen && (nBytes + addnIELen) <= SIR_MAX_PACKET_SIZE) { - if ( eSIR_SUCCESS != wlan_cfgGetStr(pMac, - WNI_CFG_PROBE_RSP_ADDNIE_DATA1, &addIE[0], - &addnIELen) ) - { - schLog(pMac, LOGE, - FL("Unable to get WNI_CFG_PROBE_RSP_ADDNIE_DATA1 String")); - - vos_mem_free(addIE); - return retCode; - } + + + vos_mem_copy(addIE, psessionEntry->addIeParams.data_buff, + psessionEntry->addIeParams.dataLen); } } diff --git a/CORE/SAP/inc/sapApi.h b/CORE/SAP/inc/sapApi.h index a9e5d108e4a1..5542e3fd5bfd 100644 --- a/CORE/SAP/inc/sapApi.h +++ b/CORE/SAP/inc/sapApi.h @@ -488,6 +488,8 @@ typedef struct sap_Config { #ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH v_U8_t cc_switch_mode; #endif + v_U16_t addnIEsBufferLen; + v_PVOID_t addnIEsBuffer; /* buffer for addn ies comes from hostapd*/ } tsap_Config_t; typedef enum { @@ -1784,6 +1786,65 @@ WLANSAP_DfsSendCSAIeRequest(v_PVOID_t pSapCtx); VOS_STATUS WLANSAP_Set_Dfs_Ignore_CAC(v_PVOID_t pvosGCtx, v_U8_t ignore_cac); + + +/*========================================================================== + FUNCTION WLANSAP_UpdateSapConfigAddIE + + DESCRIPTION + This API is used to set sap config parameter. + + DEPENDENCIES + NA. + + PARAMETERS + IN OUT + pConfig: Pointer to sap config + + PARAMETERS + IN + additionIEBuffer - buffer containing addition IE from hostapd + + PARAMETERS + IN + additionIELength - length of buffer + + RETURN VALUE + The VOS_STATUS code associated with performing the operation + + VOS_STATUS_SUCCESS: Success + + SIDE EFFECTS +============================================================================*/ + +VOS_STATUS WLANSAP_UpdateSapConfigAddIE(tsap_Config_t *pConfig, + const tANI_U8 *additionIEBuffer, + tANI_U16 additionIELength); + +/*========================================================================== + FUNCTION WLANSAP_ResetSapConfigAddIE + + DESCRIPTION + This API is used to reset and clear the buffer in sap config. + + DEPENDENCIES + NA. + + PARAMETERS + IN OUT + pConfig: Pointer to sap config + + RETURN VALUE + The VOS_STATUS code associated with performing the operation + + VOS_STATUS_SUCCESS: Success + + SIDE EFFECTS +============================================================================*/ + +VOS_STATUS WLANSAP_ResetSapConfigAddIE(tsap_Config_t *pConfig ); + + /*========================================================================== FUNCTION sapConvertSapPhyModeToCsrPhyMode diff --git a/CORE/SAP/src/sapFsm.c b/CORE/SAP/src/sapFsm.c index 6811f6eb5262..105a8bececd9 100644 --- a/CORE/SAP/src/sapFsm.c +++ b/CORE/SAP/src/sapFsm.c @@ -1692,6 +1692,17 @@ sapconvertToCsrProfile(tsap_Config_t *pconfig_params, eCsrRoamBssType bssType, t profile->MFPRequired = pconfig_params->mfpRequired ? 1 : 0; #endif + if (pconfig_params->addnIEsBufferLen > 0 && + pconfig_params->addnIEsBuffer != NULL) + { + profile->addIeParams.dataLen = pconfig_params->addnIEsBufferLen; + profile->addIeParams.data_buff = pconfig_params->addnIEsBuffer; + } + else + { + profile->addIeParams.dataLen = 0; + profile->addIeParams.data_buff = NULL; + } return eSAP_STATUS_SUCCESS; /* Success. */ } diff --git a/CORE/SAP/src/sapModule.c b/CORE/SAP/src/sapModule.c index 50bcb2591c8d..a48e1e92ac32 100644 --- a/CORE/SAP/src/sapModule.c +++ b/CORE/SAP/src/sapModule.c @@ -2770,6 +2770,52 @@ VOS_STATUS WLANSAP_Set_Dfs_Ignore_CAC(v_PVOID_t pvosGCtx, v_U8_t ignore_cac) return VOS_STATUS_SUCCESS; } +VOS_STATUS WLANSAP_UpdateSapConfigAddIE(tsap_Config_t *pConfig, + const tANI_U8 *pAdditionIEBuffer, + tANI_U16 additionIELength) +{ + VOS_STATUS status = VOS_STATUS_SUCCESS; + + if (NULL == pConfig) { + return VOS_STATUS_E_FAULT; + } + if ( (pAdditionIEBuffer != NULL) && (additionIELength != 0) ) { + /* initialize the buffer pointer so that pe can copy*/ + if (additionIELength > 0) { + pConfig->addnIEsBufferLen = additionIELength; + pConfig->addnIEsBuffer = vos_mem_malloc(additionIELength); + if (NULL == pConfig->addnIEsBuffer) { + VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, + "%s: Could not copy PROBE_RSP_ADDNIE", __func__); + return VOS_STATUS_E_NOMEM; + } + vos_mem_copy(pConfig->addnIEsBuffer, + pAdditionIEBuffer, additionIELength); + } + } else { + vos_mem_free(pConfig->addnIEsBuffer); + pConfig->addnIEsBufferLen = 0; + pConfig->addnIEsBuffer = NULL; + + VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, + "%s: No Probe Response IE received in set beacon", __func__); + } + + return (status); +} + + +VOS_STATUS WLANSAP_ResetSapConfigAddIE(tsap_Config_t *pConfig ) +{ + if (NULL == pConfig) { + return VOS_STATUS_E_FAULT; + } + vos_mem_free( pConfig->addnIEsBuffer); + pConfig->addnIEsBufferLen = 0; + pConfig->addnIEsBuffer = NULL; + return VOS_STATUS_SUCCESS; +} + /*========================================================================== FUNCTION WLANSAP_Get_DfsNol diff --git a/CORE/SME/inc/csrApi.h b/CORE/SME/inc/csrApi.h index 2e7f4d8fffde..a3d5fadbedb9 100644 --- a/CORE/SME/inc/csrApi.h +++ b/CORE/SME/inc/csrApi.h @@ -927,6 +927,8 @@ typedef struct tagCsrRoamProfile tVOS_CON_MODE csrPersona; tANI_U8 disableDFSChSwitch; + /* addIe params */ + tSirAddIeParams addIeParams; }tCsrRoamProfile; diff --git a/CORE/SME/inc/csrInternal.h b/CORE/SME/inc/csrInternal.h index f9cf44085ee4..eb053729ac69 100644 --- a/CORE/SME/inc/csrInternal.h +++ b/CORE/SME/inc/csrInternal.h @@ -386,6 +386,9 @@ typedef struct tagCsrRoamStartBssParams tANI_BOOLEAN mfpCapable; tANI_BOOLEAN mfpRequired; #endif + + tSirAddIeParams addIeParams; + }tCsrRoamStartBssParams; @@ -1488,4 +1491,24 @@ eHalStatus csrRoamStartBeaconReq( tpAniSirGlobal pMac, eHalStatus csrRoamSendChanSwIERequest(tpAniSirGlobal pMac, tCsrBssid bssid, tANI_U8 targetChannel, tANI_U8 csaIeReqd); + +/*---------------------------------------------------------------------------- + \fn csrRoamUpdateAddIEs + \brief This function sends msg to updates the additional IE buffers in PE + \param pMac - pMac global structure + \param sessionId - SME session id + \param bssid - BSSID + \param additionIEBuffer - buffer containing addition IE from hostapd + \param length - length of buffer + \param append - append or replace completely + \- return Success or failure +-----------------------------------------------------------------------------*/ +eHalStatus +csrRoamUpdateAddIEs(tpAniSirGlobal pMac, + tANI_U8 sessionId, + tSirMacAddr bssid, + tANI_U8 *additionIEBuffer, + tANI_U16 length, + boolean append); + #endif diff --git a/CORE/SME/inc/sme_Api.h b/CORE/SME/inc/sme_Api.h index c0852e9db205..ebc6f933c298 100644 --- a/CORE/SME/inc/sme_Api.h +++ b/CORE/SME/inc/sme_Api.h @@ -3577,6 +3577,25 @@ eHalStatus sme_TxpowerLimit( tHalHandle hHal, tSirTxPowerLimit *psmetx); eHalStatus sme_GetLinkSpeed(tHalHandle hHal,tSirLinkSpeedInfo *lsReq,void *plsContext, void (*pCallbackfn)(tSirLinkSpeedInfo *indParam, void *pContext) ); #endif + +/*---------------------------------------------------------------------------- + \fn sme_UpdateAddIE + \brief This function sends msg to updates the additional IE buffers in PE + \param hHal - global structure + \param sessionId - SME session id + \param bssid - BSSID + \param additionIEBuffer - buffer containing addition IE from hostapd + \param length - length of buffer + \param append - append or replace completely + \- return Success or failure +-----------------------------------------------------------------------------*/ +eHalStatus sme_UpdateAddIE(tHalHandle hHal, + tANI_U8 sessionId, + tSirMacAddr bssid, + tANI_U8 *additionIEBuffer, + tANI_U16 length, + boolean append); + eHalStatus sme_UpdateConnectDebug(tHalHandle hHal, tANI_U32 set_value); eHalStatus sme_ApDisableIntraBssFwd(tHalHandle hHal, tANI_U8 sessionId, tANI_BOOLEAN disablefwd); diff --git a/CORE/SME/src/csr/csrApiRoam.c b/CORE/SME/src/csr/csrApiRoam.c index 58b5856e33c3..6d8a9b9ff4ef 100644 --- a/CORE/SME/src/csr/csrApiRoam.c +++ b/CORE/SME/src/csr/csrApiRoam.c @@ -6378,6 +6378,9 @@ eHalStatus csrRoamCopyProfile(tpAniSirGlobal pMac, tCsrRoamProfile *pDstProfile, pDstProfile->MDID.mobilityDomain = pSrcProfile->MDID.mobilityDomain; } #endif + vos_mem_copy(&pDstProfile->addIeParams, + &pSrcProfile->addIeParams, + sizeof(tSirAddIeParams)); }while(0); if(!HAL_STATUS_SUCCESS(status)) @@ -6388,6 +6391,7 @@ eHalStatus csrRoamCopyProfile(tpAniSirGlobal pMac, tCsrRoamProfile *pDstProfile, return (status); } + eHalStatus csrRoamCopyConnectedProfile(tpAniSirGlobal pMac, tANI_U32 sessionId, tCsrRoamProfile *pDstProfile ) { eHalStatus status = eHAL_STATUS_SUCCESS; @@ -11976,6 +11980,9 @@ eHalStatus csrRoamIssueStartBss( tpAniSirGlobal pMac, tANI_U32 sessionId, tCsrRo pParam->mfpRequired = (0 != pProfile->MFPRequired); #endif + pParam->addIeParams.dataLen = pProfile->addIeParams.dataLen; + pParam->addIeParams.data_buff = pProfile->addIeParams.data_buff; + // When starting an IBSS, start on the channel from the Profile. status = csrSendMBStartBssReqMsg( pMac, sessionId, pProfile->BSSType, pParam, pBssDesc ); return (status); @@ -14216,9 +14223,13 @@ eHalStatus csrSendMBStartBssReqMsg( tpAniSirGlobal pMac, tANI_U32 sessionId, eCs } //HT Config - vos_mem_copy(pBuf, &pSession->htConfig, - sizeof(tSirHTConfig)); - pBuf += sizeof(tSirHTConfig); + vos_mem_copy(pBuf, &pSession->htConfig, + sizeof(tSirHTConfig)); + pBuf += sizeof(tSirHTConfig); + + vos_mem_copy(pBuf, &pParam->addIeParams, sizeof( pParam->addIeParams )); + pBuf += sizeof(pParam->addIeParams); + msgLen = (tANI_U16)(sizeof(tANI_U32 ) + (pBuf - wTmpBuf)); //msg_header + msg pMsg->length = pal_cpu_to_be16(msgLen); @@ -17832,6 +17843,70 @@ eHalStatus csrRoamStartBeaconReq( tpAniSirGlobal pMac, tCsrBssid bssid, return ( status ); } + +/*---------------------------------------------------------------------------- + \fn csrRoamUpdateAddIEs + \brief This function sends msg to updates the additional IE buffers in PE + \param pMac - pMac global structure + \param sessionId - SME session id + \param bssid - BSSID + \param additionIEBuffer - buffer containing addition IE from hostapd + \param length - length of buffer + \param append - append or replace completely + \- return Success or failure +-----------------------------------------------------------------------------*/ +eHalStatus +csrRoamUpdateAddIEs(tpAniSirGlobal pMac, + tANI_U8 sessionId, + tSirMacAddr bssid, + tANI_U8 *additionIEBuffer, + tANI_U16 length, + boolean append) +{ + tpUpdateAIEs pUpdateAIEs = NULL; + tANI_U8 *pLocalBuffer = NULL; + eHalStatus status; + /* following buffer will be freed by consumer (PE) */ + pLocalBuffer = vos_mem_malloc(length); + + if (NULL == pLocalBuffer) + { + smsLog(pMac, LOGE, FL("Memory Allocation Failure!!!")); + return eHAL_STATUS_FAILED_ALLOC; + } + + pUpdateAIEs = vos_mem_malloc(sizeof(tUpdateAIEs)); + if (NULL == pUpdateAIEs) + { + smsLog(pMac, LOGE, FL("Memory Allocation Failure!!!")); + vos_mem_free(pLocalBuffer); + return eHAL_STATUS_FAILED_ALLOC; + } + + vos_mem_copy(pLocalBuffer, additionIEBuffer, length); + vos_mem_zero(pUpdateAIEs, sizeof(tUpdateAIEs)); + + pUpdateAIEs->msgType = + pal_cpu_to_be16((tANI_U16)eWNI_SME_UPDATE_ADDITIONAL_IES); + pUpdateAIEs->msgLen = sizeof(tUpdateAIEs); + vos_mem_copy(pUpdateAIEs->bssid, bssid, sizeof(tSirMacAddr)); + pUpdateAIEs->smeSessionId = sessionId; + pUpdateAIEs->pAdditionIEBuffer = pLocalBuffer; + pUpdateAIEs->length = length; + pUpdateAIEs->append = append; + status = palSendMBMessage(pMac->hHdd, pUpdateAIEs); + if (!HAL_STATUS_SUCCESS(status)) + { + smsLog(pMac, LOGE, + FL("Failed to send eWNI_SME_UPDATE_ADDTIONAL_IES msg" + "!!! status %d"), status); + vos_mem_free(pLocalBuffer); + vos_mem_free(pUpdateAIEs); + } + return status; +} + + /*---------------------------------------------------------------------------- \fn csrRoamSendChanSwIERequest \brief This function sends request to transmit channel switch announcement diff --git a/CORE/SME/src/sme_common/sme_Api.c b/CORE/SME/src/sme_common/sme_Api.c index f417fc2b425e..0eb89e086666 100644 --- a/CORE/SME/src/sme_common/sme_Api.c +++ b/CORE/SME/src/sme_common/sme_Api.c @@ -12387,6 +12387,7 @@ eHalStatus sme_StatsExtEvent(tHalHandle hHal, void* pMsg) } #endif + /* --------------------------------------------------------------------------- \fn sme_UpdateDFSScanMode \brief Update DFS roam Mode @@ -12427,6 +12428,7 @@ eHalStatus sme_UpdateDFSScanMode(tHalHandle hHal, v_BOOL_t isAllowDFSChannelRoam return status ; } + /*-------------------------------------------------------------------------- \brief sme_GetWESMode() - get WES Mode This is a synchronous call @@ -12439,3 +12441,35 @@ v_BOOL_t sme_GetDFSScanMode(tHalHandle hHal) tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); return pMac->roam.configParam.allowDFSChannelRoam; } + +/*---------------------------------------------------------------------------- + \fn sme_UpdateAIE + \brief This function sends msg to updates the additional IE buffers in PE + \param hHal - global structure + \param sessionId - SME session id + \param bssid - BSSID + \param additionIEBuffer - buffer containing addition IE from hostapd + \param length - length of buffer + \param append - append or replace completely + \- return Success or failure +-----------------------------------------------------------------------------*/ +eHalStatus sme_UpdateAddIE(tHalHandle hHal, + tANI_U8 sessionId, + tSirMacAddr bssid, + tANI_U8 *additionIEBuffer, + tANI_U16 length, + boolean append) +{ + eHalStatus status = eHAL_STATUS_FAILURE; + tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); + status = sme_AcquireGlobalLock( &pMac->sme ); + + if ( HAL_STATUS_SUCCESS( status ) ) + { + status = csrRoamUpdateAddIEs(pMac, sessionId, bssid, additionIEBuffer, + length, append); + sme_ReleaseGlobalLock( &pMac->sme ); + } + return (status); +} + -- cgit v1.2.3 From 3b86ad742fcd011c121e5f9251284651614c70f9 Mon Sep 17 00:00:00 2001 From: Mahesh Kumar Kalikot Veetil Date: Tue, 3 Jun 2014 21:52:41 -0700 Subject: qcacld: Changing the priority of Stop BSS msg to SME. Driver unload was taking a large time for 32 clients connected since, when hostapd is killed, it send del_sta for each station connected. All these messaged have to be processed by SME serially in addtion to new probe req, auth request. As a result the stop_bss message was not getting processed resulting in a large unload time. Change the priority of the stop_bss message to critical and change the reason code of deauth_sta to 2 (instead of 3 for AP mode). Change-Id: I56e482071af032667e2ff13182a9f021db574e3a CRs-fixed: 669066 --- CORE/SME/src/sme_common/sme_Api.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CORE/SME/src/sme_common/sme_Api.c b/CORE/SME/src/sme_common/sme_Api.c index 0eb89e086666..a8cf64f3b450 100644 --- a/CORE/SME/src/sme_common/sme_Api.c +++ b/CORE/SME/src/sme_common/sme_Api.c @@ -3557,7 +3557,7 @@ eHalStatus sme_RoamStopBss(tHalHandle hHal, tANI_U8 sessionId) { if( CSR_IS_SESSION_VALID( pMac, sessionId ) ) { - status = csrRoamIssueStopBssCmd( pMac, sessionId, eANI_BOOLEAN_FALSE ); + status = csrRoamIssueStopBssCmd( pMac, sessionId, eANI_BOOLEAN_TRUE ); } else { @@ -3633,7 +3633,7 @@ eHalStatus sme_RoamDeauthSta(tHalHandle hHal, tANI_U8 sessionId, if( CSR_IS_SESSION_VALID( pMac, sessionId ) ) { status = csrRoamIssueDeauthStaCmd( pMac, sessionId, pPeerMacAddr, - eSIR_MAC_DEAUTH_LEAVING_BSS_REASON); + eSIR_MAC_PREV_AUTH_NOT_VALID_REASON); } else { -- cgit v1.2.3 From 3f7c877a8474433838b1a526a6be23d422d9ff91 Mon Sep 17 00:00:00 2001 From: Amar Singhal Date: Mon, 19 May 2014 13:02:24 -0700 Subject: qcacld: Add the interface index for the stats ext message Currently the vendor event messsge sent to userspace does not contain the interface index for the network device the statistics are for. Add this index. Change-Id: I6191f21f7744a5f5288f7095c473f1ea4a5b4098 CRs-Fixed: 668374 --- CORE/HDD/inc/wlan_hdd_cfg80211.h | 1 + CORE/HDD/inc/wlan_hdd_main.h | 2 ++ CORE/HDD/src/wlan_hdd_cfg80211.c | 28 ++++++++++++++++++++++++++-- CORE/HDD/src/wlan_hdd_main.c | 28 ++++++++++++++++++++++++++++ CORE/MAC/inc/sirApi.h | 1 + CORE/SERVICES/WMA/wma.c | 2 ++ CORE/SME/inc/smeInternal.h | 1 + 7 files changed, 61 insertions(+), 2 deletions(-) diff --git a/CORE/HDD/inc/wlan_hdd_cfg80211.h b/CORE/HDD/inc/wlan_hdd_cfg80211.h index c66daecd6fcb..4e82246309aa 100644 --- a/CORE/HDD/inc/wlan_hdd_cfg80211.h +++ b/CORE/HDD/inc/wlan_hdd_cfg80211.h @@ -132,6 +132,7 @@ enum qca_wlan_vendor_attr QCA_WLAN_VENDOR_ATTR_NAN = 2, /* used by QCA_NL80211_VENDOR_SUBCMD_STATS_EXT */ QCA_WLAN_VENDOR_ATTR_STATS_EXT = 3, + QCA_WLAN_VENDOR_ATTR_IFINDEX = 4, /* keep last */ QCA_WLAN_VENDOR_ATTR_AFTER_LAST, QCA_WLAN_VENDOR_ATTR_MAX = QCA_WLAN_VENDOR_ATTR_AFTER_LAST - 1, diff --git a/CORE/HDD/inc/wlan_hdd_main.h b/CORE/HDD/inc/wlan_hdd_main.h index 4b7084fd05cc..ae51a1887393 100644 --- a/CORE/HDD/inc/wlan_hdd_main.h +++ b/CORE/HDD/inc/wlan_hdd_main.h @@ -1512,6 +1512,8 @@ VOS_STATUS hdd_start_all_adapters( hdd_context_t *pHddCtx ); VOS_STATUS hdd_reconnect_all_adapters( hdd_context_t *pHddCtx ); void hdd_dump_concurrency_info(hdd_context_t *pHddCtx); hdd_adapter_t * hdd_get_adapter_by_name( hdd_context_t *pHddCtx, tANI_U8 *name ); +hdd_adapter_t * hdd_get_adapter_by_vdev( hdd_context_t *pHddCtx, + tANI_U32 vdev_id ); hdd_adapter_t * hdd_get_adapter_by_macaddr( hdd_context_t *pHddCtx, tSirMacAddr macAddr ); hdd_adapter_t * hdd_get_mon_adapter( hdd_context_t *pHddCtx ); VOS_STATUS hdd_init_station_mode( hdd_adapter_t *pAdapter ); diff --git a/CORE/HDD/src/wlan_hdd_cfg80211.c b/CORE/HDD/src/wlan_hdd_cfg80211.c index 8c0a47bd06b5..9fa9b1aceac7 100644 --- a/CORE/HDD/src/wlan_hdd_cfg80211.c +++ b/CORE/HDD/src/wlan_hdd_cfg80211.c @@ -799,6 +799,7 @@ static void wlan_hdd_cfg80211_stats_ext_callback(void* ctx, tStatsExtEvent* msg) int status; int ret_val; tStatsExtEvent *data = msg; + hdd_adapter_t *pAdapter = NULL; status = wlan_hdd_validate_context(pHddCtx); @@ -809,10 +810,21 @@ static void wlan_hdd_cfg80211_stats_ext_callback(void* ctx, tStatsExtEvent* msg) return; } + pAdapter = hdd_get_adapter_by_vdev( pHddCtx, data->vdev_id); + + if (NULL == pAdapter) + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: vdev_id %d does not exist with host", + __func__, data->vdev_id); + return; + } + vendor_event = cfg80211_vendor_event_alloc(pHddCtx->wiphy, data->event_data_len + - NLMSG_HDRLEN, + sizeof(tANI_U32) + + NLMSG_HDRLEN + NLMSG_HDRLEN, QCA_NL80211_VENDOR_SUBCMD_STATS_EXT_INDEX, GFP_KERNEL); @@ -823,13 +835,25 @@ static void wlan_hdd_cfg80211_stats_ext_callback(void* ctx, tStatsExtEvent* msg) return; } + ret_val = nla_put_u32(vendor_event, QCA_WLAN_VENDOR_ATTR_IFINDEX, + pAdapter->dev->ifindex); + if (ret_val) + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: QCA_WLAN_VENDOR_ATTR_IFINDEX put fail", __func__); + kfree_skb(vendor_event); + + return; + } + + ret_val = nla_put(vendor_event, QCA_WLAN_VENDOR_ATTR_STATS_EXT, data->event_data_len, data->event_data); if (ret_val) { VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, - "%s: QCA_WLAN_VENDOR_ATTR_NAN put fail", __func__); + "%s: QCA_WLAN_VENDOR_ATTR_STATS_EXT put fail", __func__); kfree_skb(vendor_event); return; diff --git a/CORE/HDD/src/wlan_hdd_main.c b/CORE/HDD/src/wlan_hdd_main.c index ddebd777538d..06c5a6ad0d0f 100755 --- a/CORE/HDD/src/wlan_hdd_main.c +++ b/CORE/HDD/src/wlan_hdd_main.c @@ -9658,6 +9658,34 @@ hdd_adapter_t * hdd_get_adapter_by_name( hdd_context_t *pHddCtx, tANI_U8 *name ) } +hdd_adapter_t *hdd_get_adapter_by_vdev( hdd_context_t *pHddCtx, + tANI_U32 vdev_id ) +{ + hdd_adapter_list_node_t *pAdapterNode = NULL, *pNext = NULL; + hdd_adapter_t *pAdapter; + VOS_STATUS vos_status; + + + vos_status = hdd_get_front_adapter( pHddCtx, &pAdapterNode); + + while ((NULL != pAdapterNode) && (VOS_STATUS_SUCCESS == vos_status)) + { + pAdapter = pAdapterNode->pAdapter; + + if (pAdapter->sessionId == vdev_id) + return pAdapter; + + vos_status = hdd_get_next_adapter(pHddCtx, pAdapterNode, &pNext); + pAdapterNode = pNext; + } + + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: vdev_id %d does not exist with host", + __func__, vdev_id); + + return NULL; +} + hdd_adapter_t * hdd_get_adapter( hdd_context_t *pHddCtx, device_mode_t mode ) { hdd_adapter_list_node_t *pAdapterNode = NULL, *pNext = NULL; diff --git a/CORE/MAC/inc/sirApi.h b/CORE/MAC/inc/sirApi.h index ef6df7325c99..bad0f8e52465 100644 --- a/CORE/MAC/inc/sirApi.h +++ b/CORE/MAC/inc/sirApi.h @@ -4969,6 +4969,7 @@ typedef struct #ifdef WLAN_FEATURE_STATS_EXT typedef struct { + tANI_U32 vdev_id; tANI_U32 event_data_len; u_int8_t event_data[]; } tSirStatsExtEvent, *tpSirStatsExtEvent; diff --git a/CORE/SERVICES/WMA/wma.c b/CORE/SERVICES/WMA/wma.c index 6cd95e79de8a..ffeb89a8bc32 100644 --- a/CORE/SERVICES/WMA/wma.c +++ b/CORE/SERVICES/WMA/wma.c @@ -3101,6 +3101,8 @@ static int wma_stats_ext_event_handler(void *handle, u_int8_t *event_buf, } buf_ptr += sizeof(wmi_stats_ext_event_fixed_param) + WMI_TLV_HDR_SIZE ; + + stats_ext_event->vdev_id = stats_ext_info->vdev_id; stats_ext_event->event_data_len = stats_ext_info->data_len; vos_mem_copy(stats_ext_event->event_data, buf_ptr, diff --git a/CORE/SME/inc/smeInternal.h b/CORE/SME/inc/smeInternal.h index b2c94e782500..7044351d8ea9 100644 --- a/CORE/SME/inc/smeInternal.h +++ b/CORE/SME/inc/smeInternal.h @@ -119,6 +119,7 @@ typedef enum eSmeState #define SME_IS_READY(pMac) (SME_STATE_READY == (pMac)->sme.state) typedef struct sStatsExtEvent { + tANI_U32 vdev_id; tANI_U32 event_data_len; tANI_U8 event_data[]; } tStatsExtEvent, *tpStatsExtEvent; -- cgit v1.2.3 From 15630f1ab7a05ab75130be2a3621f4dfae5733db Mon Sep 17 00:00:00 2001 From: Pitani Venkata Rajesh Kumar Date: Wed, 11 Jun 2014 13:32:55 +0530 Subject: Cafstaging Release 1.0.0.124 Cafstaging Release 1.0.0.124 Change-Id: Ie2e98e03b3b3490a119726421ba32a767374e107 CRs-Fixed: 678589 --- 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 b2f26c95dba7..cf042dd9e7f0 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 123 +#define QWLAN_VERSION_BUILD 124 -#define QWLAN_VERSIONSTR "1.0.0.123" +#define QWLAN_VERSIONSTR "1.0.0.124" #ifdef QCA_WIFI_2_0 -- cgit v1.2.3 From e43679e89e8243ee64968eec498e7c7c6c98b6e7 Mon Sep 17 00:00:00 2001 From: Rajeev Kumar Date: Thu, 5 Jun 2014 12:13:38 -0700 Subject: qcacld: Optimize WLAN resume time in disconnected case Optimize WLAN resume time in disconnected case Change-Id: I4de46f4d935717600402816040744932d98bd058 CRs-Fixed: 676163 --- CORE/SERVICES/WMA/wma.c | 2 +- CORE/SERVICES/WMA/wma.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CORE/SERVICES/WMA/wma.c b/CORE/SERVICES/WMA/wma.c index ffeb89a8bc32..dd40b0441de8 100644 --- a/CORE/SERVICES/WMA/wma.c +++ b/CORE/SERVICES/WMA/wma.c @@ -20210,7 +20210,7 @@ int wma_resume_target(WMA_HANDLE handle) } wmi_pending_cmds = wmi_get_pending_cmds(wma_handle->wmi_handle); while (wmi_pending_cmds && timeout++ < WMA_MAX_RESUME_RETRY) { - msleep(100); + msleep(1); wmi_pending_cmds = wmi_get_pending_cmds(wma_handle->wmi_handle); } diff --git a/CORE/SERVICES/WMA/wma.h b/CORE/SERVICES/WMA/wma.h index 1c8c876d914d..1fdbc50a296c 100644 --- a/CORE/SERVICES/WMA/wma.h +++ b/CORE/SERVICES/WMA/wma.h @@ -79,7 +79,7 @@ #define WMA_READY_EVENTID_TIMEOUT 2000 #define WMA_TGT_SUSPEND_COMPLETE_TIMEOUT 1000 #define WMA_WAKE_LOCK_TIMEOUT 1000 -#define WMA_MAX_RESUME_RETRY 10 +#define WMA_MAX_RESUME_RETRY 1000 #define WMA_RESUME_TIMEOUT 3000 #define MAX_MEM_CHUNKS 32 /* -- cgit v1.2.3 From cd579a0e723b984e8fe765b8b5dcb1b87e87d19a Mon Sep 17 00:00:00 2001 From: Manjunathappa Prakash Date: Thu, 5 Jun 2014 20:12:51 -0700 Subject: qcacld: update driver loading/unloading state for FTM mode Patch updates the driver loading/unloading state to false when FTM driver is loaded successfully. Without this driver ignores any target assertions and does not provide a register dump. Change-Id: I15493550e4591a2b943e5c6e8f867012f1447dc2 CRs-Fixed: 674291 --- CORE/HDD/src/wlan_hdd_main.c | 1 + 1 file changed, 1 insertion(+) diff --git a/CORE/HDD/src/wlan_hdd_main.c b/CORE/HDD/src/wlan_hdd_main.c index 06c5a6ad0d0f..7d08a3b87485 100755 --- a/CORE/HDD/src/wlan_hdd_main.c +++ b/CORE/HDD/src/wlan_hdd_main.c @@ -11501,6 +11501,7 @@ int hdd_wlan_startup(struct device *dev, v_VOID_t *hif_sc) goto err_free_ftm_open; } #endif + vos_set_load_unload_in_progress(VOS_MODULE_ID_VOSS, FALSE); hddLog(VOS_TRACE_LEVEL_FATAL,"%s: FTM driver loaded", __func__); #if defined(QCA_WIFI_2_0) && !defined(QCA_WIFI_ISOC) complete(&wlan_start_comp); -- cgit v1.2.3 From 4b55f6c88260b2128f6101168d977d2c70773a5f Mon Sep 17 00:00:00 2001 From: Rajeev Kumar Date: Tue, 10 Jun 2014 12:42:54 -0700 Subject: qcacld: Handle spurious PCIe interrupts before WLAN resume Handle spurious PCIe interrupts before WLAN resume Change-Id: Iefbdadb170b91ff1ece5cb5f971cac928d1103df CRs-Fixed: 677730 --- CORE/SERVICES/HIF/PCIe/if_pci.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/CORE/SERVICES/HIF/PCIe/if_pci.c b/CORE/SERVICES/HIF/PCIe/if_pci.c index 2192c2fb7e84..bca1b83139c9 100644 --- a/CORE/SERVICES/HIF/PCIe/if_pci.c +++ b/CORE/SERVICES/HIF/PCIe/if_pci.c @@ -121,9 +121,6 @@ hif_pci_interrupt_handler(int irq, void *arg) adf_os_spin_lock_irqsave(&hif_state->suspend_lock); } - if (adf_os_atomic_read(&sc->pci_link_suspended)) - goto irq_handled; - if (LEGACY_INTERRUPTS(sc)) { if (sc->hif_init_done == TRUE) { @@ -182,7 +179,6 @@ hif_pci_interrupt_handler(int irq, void *arg) adf_os_atomic_set(&sc->tasklet_from_intr, 1); tasklet_schedule(&sc->intr_tq); -irq_handled: if (sc->hif_init_done == TRUE) { adf_os_spin_unlock_irqrestore(&hif_state->suspend_lock); } @@ -1750,7 +1746,7 @@ hif_pci_suspend(struct pci_dev *pdev, pm_message_t state) goto out; } - printk("\n%s: wow mode %d event %d\n", __func__, + printk("%s: wow mode %d event %d\n", __func__, wma_is_wow_mode_selected(temp_module), state.event); if (wma_is_wow_mode_selected(temp_module)) { @@ -1903,7 +1899,7 @@ hif_pci_resume(struct pci_dev *pdev) goto out; } - printk("\n%s: wow mode %d val %d\n", __func__, + printk("%s: wow mode %d val %d\n", __func__, wma_is_wow_mode_selected(temp_module), val); adf_os_atomic_set(&sc->wow_done, 0); -- cgit v1.2.3 From 18608d82582e2b75c11ebc2fee0a903c2b5f3a85 Mon Sep 17 00:00:00 2001 From: syeh Date: Wed, 11 Jun 2014 14:21:12 +0800 Subject: qcacld: Enable gRegulatoryChangeCountry in usb ini config file Enable gRegulatoryChangeCountry in usb qcom_cfg.ini to fix the issue that we could not enable SAP/P2P on 5G channels. Change-Id: I7cd7546a63cd16e3ab890e5ac5fe8175d9ef3e57 CRs-Fixed: 677999 --- firmware_bin/WCNSS_qcom_cfg.usb.ini | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/firmware_bin/WCNSS_qcom_cfg.usb.ini b/firmware_bin/WCNSS_qcom_cfg.usb.ini index 4aa41d02740a..1e8909b31ed7 100644 --- a/firmware_bin/WCNSS_qcom_cfg.usb.ini +++ b/firmware_bin/WCNSS_qcom_cfg.usb.ini @@ -500,6 +500,10 @@ gPNOScanSupport=0 #Enable TDLS gEnableTDLSSupport=1 + +# Regulatory Setting; 0=STRICT; 1=CUSTOM +gRegulatoryChangeCountry=1 + END # Note: Configuration parser would not read anything past the END marker -- cgit v1.2.3 From a204dd472a11163783d34b6e8faafa861c671682 Mon Sep 17 00:00:00 2001 From: Randy Chiu Date: Wed, 11 Jun 2014 18:49:52 +0800 Subject: qcacld:[HIF] Enable lpm for USB3.0 lpm feature is mandatory for USB3.0. Turn on this feature for ROME USB. Change-Id: If6eb94d04d5ab5d37ed98509655eb5991477172f Crs-Fixed: 678658 --- CORE/SERVICES/HIF/USB/if_usb.c | 1 - 1 file changed, 1 deletion(-) diff --git a/CORE/SERVICES/HIF/USB/if_usb.c b/CORE/SERVICES/HIF/USB/if_usb.c index a0522484f670..579fe1c6f011 100644 --- a/CORE/SERVICES/HIF/USB/if_usb.c +++ b/CORE/SERVICES/HIF/USB/if_usb.c @@ -107,7 +107,6 @@ hif_usb_probe(struct usb_interface *interface, const struct usb_device_id *id) int vendor_id, product_id; pr_info("hif_usb_probe\n"); - usb_disable_lpm(pdev); usb_get_dev(pdev); vendor_id = le16_to_cpu(pdev->descriptor.idVendor); product_id = le16_to_cpu(pdev->descriptor.idProduct); -- cgit v1.2.3 From fbc6275595424b731c493322d55ce38a7a9c349e Mon Sep 17 00:00:00 2001 From: "Kanchanapally, Vidyullatha" Date: Mon, 2 Jun 2014 09:42:17 +0530 Subject: qcacld: Configure PTK to FW during Roaming in all cases Sometimes during roaming because of a race by the time PTK comes to LIM for adding in ADD_BSS Req, the driver would have already processed the ADD_BSS request and hence it skips configuring PTK to the FW. Changes have now been made to do this properly in all cases. Change-Id: I67785b50ace2d744a1a42aa466f1769a450c754c CRs-Fixed: 656812 --- CORE/MAC/src/pe/include/limFTDefs.h | 4 +- CORE/MAC/src/pe/lim/limFT.c | 120 ++++++++++++++++--------- CORE/MAC/src/pe/lim/limProcessMlmReqMessages.c | 2 +- CORE/MAC/src/pe/lim/limProcessMlmRspMessages.c | 15 +++- CORE/MAC/src/pe/lim/limSecurityUtils.c | 32 ++++--- CORE/MAC/src/pe/lim/limSecurityUtils.h | 2 +- CORE/MAC/src/pe/lim/limTypes.h | 11 --- CORE/SERVICES/WMA/wma.c | 15 ++-- CORE/WDA/inc/legacy/halMsgApi.h | 12 +++ 9 files changed, 134 insertions(+), 79 deletions(-) diff --git a/CORE/MAC/src/pe/include/limFTDefs.h b/CORE/MAC/src/pe/include/limFTDefs.h index 717b10174914..ffea5815e7bd 100644 --- a/CORE/MAC/src/pe/include/limFTDefs.h +++ b/CORE/MAC/src/pe/include/limFTDefs.h @@ -100,7 +100,7 @@ typedef struct sSirFTUpdateKeyInfo typedef struct sSirFTPreAuthKeyInfo { tANI_U8 extSetStaKeyParamValid; //Ext Bss Config Msg if set - tSetStaKeyParams extSetStaKeyParam; //SetStaKeyParams for ext bss msg + tLimMlmSetKeysReq extSetStaKeyParam; //SetStaKeyParams for ext bss msg } tSirFTPreAuthKeyInfo, *tpSirFTPreAuthKeyInfo; /*------------------------------------------------------------------------- @@ -113,7 +113,7 @@ typedef struct sFTPEContext tSirRetStatus ftPreAuthStatus; tANI_U16 saved_auth_rsp_length; tANI_U8 saved_auth_rsp[MAX_FTIE_SIZE]; - tSirFTPreAuthKeyInfo *pPreAuthKeyInfo; + tSirFTPreAuthKeyInfo PreAuthKeyInfo; // Items created for the new FT, session void *pftSessionEntry; // Saved session created for pre-auth void *pAddBssReq; // Save add bss req. diff --git a/CORE/MAC/src/pe/lim/limFT.c b/CORE/MAC/src/pe/lim/limFT.c index 02f210982ad8..10366222dd6e 100644 --- a/CORE/MAC/src/pe/lim/limFT.c +++ b/CORE/MAC/src/pe/lim/limFT.c @@ -54,6 +54,13 @@ #define LIM_FT_RIC_DESCRIPTOR_RESOURCE_TYPE_BA 1 #define LIM_FT_RIC_DESCRIPTOR_MAX_VAR_DATA_LEN 255 +extern void limSendSetStaKeyReq( tpAniSirGlobal pMac, + tLimMlmSetKeysReq *pMlmSetKeysReq, + tANI_U16 staIdx, + tANI_U8 defWEPIdx, + tpPESession sessionEntry, + tANI_BOOLEAN sendRsp); + /*-------------------------------------------------------------------------- Initialize the FT variables. ------------------------------------------------------------------------*/ @@ -1456,61 +1463,86 @@ tANI_BOOLEAN limProcessFTUpdateKey(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf ) { return TRUE; } + if(pMac->ft.ftPEContext.pAddBssReq == NULL) { - limLog( pMac, LOGE, - FL( "pAddBssReq is NULL" )); - return TRUE; - } + // AddBss Req is NULL, save the keys to configure them later. + tpLimMlmSetKeysReq pMlmSetKeysReq = &pMac->ft.ftPEContext.PreAuthKeyInfo.extSetStaKeyParam; + tpPESession psessionEntry = (tPESession *)pMac->ft.ftPEContext.pftSessionEntry; - pAddBssParams = pMac->ft.ftPEContext.pAddBssReq; - pKeyInfo = (tSirFTUpdateKeyInfo *)pMsgBuf; + pKeyInfo = (tSirFTUpdateKeyInfo *)pMsgBuf; + vos_mem_zero(pMlmSetKeysReq, sizeof(tLimMlmSetKeysReq)); + vos_mem_copy(pMlmSetKeysReq->peerMacAddr, pKeyInfo->bssId, sizeof(tSirMacAddr)); + pMlmSetKeysReq->sessionId = psessionEntry->peSessionId; + pMlmSetKeysReq->smesessionId = psessionEntry->smeSessionId; + pMlmSetKeysReq->edType = pKeyInfo->keyMaterial.edType; + pMlmSetKeysReq->numKeys = pKeyInfo->keyMaterial.numKeys; + vos_mem_copy((tANI_U8 *) &pMlmSetKeysReq->key, + (tANI_U8 *) &pKeyInfo->keyMaterial.key, sizeof(tSirKeys)); - /* Store the key information in the ADD BSS parameters */ - pAddBssParams->extSetStaKeyParamValid = 1; - pAddBssParams->extSetStaKeyParam.encType = pKeyInfo->keyMaterial.edType; - vos_mem_copy((tANI_U8 *) &pAddBssParams->extSetStaKeyParam.key, - (tANI_U8 *) &pKeyInfo->keyMaterial.key, sizeof(tSirKeys)); - if(eSIR_SUCCESS != wlan_cfgGetInt(pMac, WNI_CFG_SINGLE_TID_RC, &val)) - { - limLog( pMac, LOGP, FL( "Unable to read WNI_CFG_SINGLE_TID_RC" )); - } + pMac->ft.ftPEContext.PreAuthKeyInfo.extSetStaKeyParamValid = TRUE; - pAddBssParams->extSetStaKeyParam.singleTidRc = val; - PELOG1(limLog(pMac, LOG1, FL("Key valid %d"), - pAddBssParams->extSetStaKeyParamValid, - pAddBssParams->extSetStaKeyParam.key[0].keyLength);) + limLog( pMac, LOGE, FL( "pAddBssReq is NULL" )); - pAddBssParams->extSetStaKeyParam.staIdx = 0; + if (pMac->ft.ftPEContext.pAddStaReq == NULL) + { + limLog( pMac, LOGE, FL( "pAddStaReq is NULL" )); + limSendSetStaKeyReq(pMac, pMlmSetKeysReq, 0, 0, psessionEntry, FALSE); + pMac->ft.ftPEContext.PreAuthKeyInfo.extSetStaKeyParamValid = FALSE; + } + } + else + { + pAddBssParams = pMac->ft.ftPEContext.pAddBssReq; + pKeyInfo = (tSirFTUpdateKeyInfo *)pMsgBuf; - PELOG1(limLog(pMac, LOG1, - FL("BSSID = "MAC_ADDRESS_STR), MAC_ADDR_ARRAY(pKeyInfo->bssId));) + /* Store the key information in the ADD BSS parameters */ + pAddBssParams->extSetStaKeyParamValid = 1; + pAddBssParams->extSetStaKeyParam.encType = pKeyInfo->keyMaterial.edType; + vos_mem_copy((tANI_U8 *) &pAddBssParams->extSetStaKeyParam.key, + (tANI_U8 *) &pKeyInfo->keyMaterial.key, sizeof(tSirKeys)); + if(eSIR_SUCCESS != wlan_cfgGetInt(pMac, WNI_CFG_SINGLE_TID_RC, &val)) + { + limLog( pMac, LOGP, FL( "Unable to read WNI_CFG_SINGLE_TID_RC" )); + } - sirCopyMacAddr(pAddBssParams->extSetStaKeyParam.peerMacAddr, pKeyInfo->bssId); + pAddBssParams->extSetStaKeyParam.singleTidRc = val; + PELOG1(limLog(pMac, LOG1, FL("Key valid %d"), + pAddBssParams->extSetStaKeyParamValid, + pAddBssParams->extSetStaKeyParam.key[0].keyLength);) + + pAddBssParams->extSetStaKeyParam.staIdx = 0; - if(pAddBssParams->extSetStaKeyParam.key[0].keyLength == 16) - { PELOG1(limLog(pMac, LOG1, - FL("BSS key = %02X-%02X-%02X-%02X-%02X-%02X-%02X- " - "%02X-%02X-%02X-%02X-%02X-%02X-%02X-%02X-%02X"), - pAddBssParams->extSetStaKeyParam.key[0].key[0], - pAddBssParams->extSetStaKeyParam.key[0].key[1], - pAddBssParams->extSetStaKeyParam.key[0].key[2], - pAddBssParams->extSetStaKeyParam.key[0].key[3], - pAddBssParams->extSetStaKeyParam.key[0].key[4], - pAddBssParams->extSetStaKeyParam.key[0].key[5], - pAddBssParams->extSetStaKeyParam.key[0].key[6], - pAddBssParams->extSetStaKeyParam.key[0].key[7], - pAddBssParams->extSetStaKeyParam.key[0].key[8], - pAddBssParams->extSetStaKeyParam.key[0].key[9], - pAddBssParams->extSetStaKeyParam.key[0].key[10], - pAddBssParams->extSetStaKeyParam.key[0].key[11], - pAddBssParams->extSetStaKeyParam.key[0].key[12], - pAddBssParams->extSetStaKeyParam.key[0].key[13], - pAddBssParams->extSetStaKeyParam.key[0].key[14], - pAddBssParams->extSetStaKeyParam.key[0].key[15]);) - } + FL("BSSID = "MAC_ADDRESS_STR), MAC_ADDR_ARRAY(pKeyInfo->bssId));) + sirCopyMacAddr(pAddBssParams->extSetStaKeyParam.peerMacAddr, pKeyInfo->bssId); + + pAddBssParams->extSetStaKeyParam.sendRsp = FALSE; + + if(pAddBssParams->extSetStaKeyParam.key[0].keyLength == 16) + { + PELOG1(limLog(pMac, LOG1, + FL("BSS key = %02X-%02X-%02X-%02X-%02X-%02X-%02X- " + "%02X-%02X-%02X-%02X-%02X-%02X-%02X-%02X-%02X"), + pAddBssParams->extSetStaKeyParam.key[0].key[0], + pAddBssParams->extSetStaKeyParam.key[0].key[1], + pAddBssParams->extSetStaKeyParam.key[0].key[2], + pAddBssParams->extSetStaKeyParam.key[0].key[3], + pAddBssParams->extSetStaKeyParam.key[0].key[4], + pAddBssParams->extSetStaKeyParam.key[0].key[5], + pAddBssParams->extSetStaKeyParam.key[0].key[6], + pAddBssParams->extSetStaKeyParam.key[0].key[7], + pAddBssParams->extSetStaKeyParam.key[0].key[8], + pAddBssParams->extSetStaKeyParam.key[0].key[9], + pAddBssParams->extSetStaKeyParam.key[0].key[10], + pAddBssParams->extSetStaKeyParam.key[0].key[11], + pAddBssParams->extSetStaKeyParam.key[0].key[12], + pAddBssParams->extSetStaKeyParam.key[0].key[13], + pAddBssParams->extSetStaKeyParam.key[0].key[14], + pAddBssParams->extSetStaKeyParam.key[0].key[15]);) + } + } return TRUE; } diff --git a/CORE/MAC/src/pe/lim/limProcessMlmReqMessages.c b/CORE/MAC/src/pe/lim/limProcessMlmReqMessages.c index 48710190fa99..4e319fbce53c 100644 --- a/CORE/MAC/src/pe/lim/limProcessMlmReqMessages.c +++ b/CORE/MAC/src/pe/lim/limProcessMlmReqMessages.c @@ -3589,7 +3589,7 @@ tpPESession psessionEntry; return; }else { // Package WDA_SET_STAKEY_REQ / WDA_SET_STA_BCASTKEY_REQ message parameters - limSendSetStaKeyReq(pMac, pMlmSetKeysReq, staIdx, (tANI_U8) defaultKeyId,psessionEntry); + limSendSetStaKeyReq(pMac, pMlmSetKeysReq, staIdx, (tANI_U8) defaultKeyId,psessionEntry, TRUE); return; } diff --git a/CORE/MAC/src/pe/lim/limProcessMlmRspMessages.c b/CORE/MAC/src/pe/lim/limProcessMlmRspMessages.c index 708cd3f19165..fe9995da3331 100644 --- a/CORE/MAC/src/pe/lim/limProcessMlmRspMessages.c +++ b/CORE/MAC/src/pe/lim/limProcessMlmRspMessages.c @@ -1907,7 +1907,20 @@ void limProcessStaMlmAddStaRsp( tpAniSirGlobal pMac, tpSirMsgQ limMsgQ ,tpPESess goto end; } if (psessionEntry->limSmeState == eLIM_SME_WT_REASSOC_STATE) - mesgType = LIM_MLM_REASSOC_CNF; + { +#ifdef WLAN_FEATURE_VOWIFI_11R + // Check if we have keys (PTK) to install in case of 11r + tpftPEContext pftPECntxt = &pMac->ft.ftPEContext; + if (pftPECntxt->pftSessionEntry != NULL && + pftPECntxt->PreAuthKeyInfo.extSetStaKeyParamValid == TRUE) + { + tpLimMlmSetKeysReq pMlmStaKeys = &pftPECntxt->PreAuthKeyInfo.extSetStaKeyParam; + limSendSetStaKeyReq(pMac, pMlmStaKeys, 0, 0, pftPECntxt->pftSessionEntry, FALSE); + pftPECntxt->PreAuthKeyInfo.extSetStaKeyParamValid = FALSE; + } +#endif + mesgType = LIM_MLM_REASSOC_CNF; + } // // Update the DPH Hash Entry for this STA // with proper state info diff --git a/CORE/MAC/src/pe/lim/limSecurityUtils.c b/CORE/MAC/src/pe/lim/limSecurityUtils.c index 8195bfb7e448..fe8f15f7072c 100644 --- a/CORE/MAC/src/pe/lim/limSecurityUtils.c +++ b/CORE/MAC/src/pe/lim/limSecurityUtils.c @@ -977,13 +977,14 @@ void limSendSetStaKeyReq( tpAniSirGlobal pMac, tLimMlmSetKeysReq *pMlmSetKeysReq, tANI_U16 staIdx, tANI_U8 defWEPIdx, - tpPESession sessionEntry) + tpPESession sessionEntry, + tANI_BOOLEAN sendRsp) { -tSirMsgQ msgQ; -tpSetStaKeyParams pSetStaKeyParams = NULL; -tLimMlmSetKeysCnf mlmSetKeysCnf; -tSirRetStatus retCode; -tANI_U32 val = 0; + tSirMsgQ msgQ; + tpSetStaKeyParams pSetStaKeyParams = NULL; + tLimMlmSetKeysCnf mlmSetKeysCnf; + tSirRetStatus retCode; + tANI_U32 val = 0; // Package WDA_SET_STAKEY_REQ message parameters pSetStaKeyParams = vos_mem_malloc(sizeof( tSetStaKeyParams )); @@ -1024,15 +1025,20 @@ tANI_U32 val = 0; vos_mem_copy(pSetStaKeyParams->peerMacAddr, pMlmSetKeysReq->peerMacAddr, sizeof(tSirMacAddr)); - /** Store the Previous MlmState*/ - sessionEntry->limPrevMlmState = sessionEntry->limMlmState; - SET_LIM_PROCESS_DEFD_MESGS(pMac, false); + if(sendRsp == eANI_BOOLEAN_TRUE) + { + /** Store the Previous MlmState*/ + sessionEntry->limPrevMlmState = sessionEntry->limMlmState; + SET_LIM_PROCESS_DEFD_MESGS(pMac, false); + } if(sessionEntry->limSystemRole == eLIM_STA_IN_IBSS_ROLE && !pMlmSetKeysReq->key[0].unicast) { - sessionEntry->limMlmState = eLIM_MLM_WT_SET_STA_BCASTKEY_STATE; + if (sendRsp == eANI_BOOLEAN_TRUE) + sessionEntry->limMlmState = eLIM_MLM_WT_SET_STA_BCASTKEY_STATE; msgQ.type = WDA_SET_STA_BCASTKEY_REQ; }else { - sessionEntry->limMlmState = eLIM_MLM_WT_SET_STA_KEY_STATE; + if (sendRsp == eANI_BOOLEAN_TRUE) + sessionEntry->limMlmState = eLIM_MLM_WT_SET_STA_KEY_STATE; msgQ.type = WDA_SET_STAKEY_REQ; } MTRACE(macTrace(pMac, TRACE_CODE_MLM_STATE, sessionEntry->peSessionId, sessionEntry->limMlmState)); @@ -1086,6 +1092,7 @@ tANI_U32 val = 0; break; } + pSetStaKeyParams->sendRsp = sendRsp; // // FIXME_GEN4 @@ -1105,7 +1112,8 @@ tANI_U32 val = 0; }else return; // Continue after WDA_SET_STAKEY_RSP... - limPostSmeSetKeysCnf( pMac, pMlmSetKeysReq, &mlmSetKeysCnf ); + if(sendRsp == eANI_BOOLEAN_TRUE) + limPostSmeSetKeysCnf( pMac, pMlmSetKeysReq, &mlmSetKeysCnf ); } /** diff --git a/CORE/MAC/src/pe/lim/limSecurityUtils.h b/CORE/MAC/src/pe/lim/limSecurityUtils.h index 75050965cc6f..51bf714268fc 100644 --- a/CORE/MAC/src/pe/lim/limSecurityUtils.h +++ b/CORE/MAC/src/pe/lim/limSecurityUtils.h @@ -64,7 +64,7 @@ void limEncryptAuthFrame(tpAniSirGlobal, tANI_U8, tANI_U8 *, tANI_ tANI_U8 limDecryptAuthFrame(tpAniSirGlobal, tANI_U8 *, tANI_U8 *, tANI_U8 *, tANI_U32, tANI_U16); void limSendSetBssKeyReq( tpAniSirGlobal, tLimMlmSetKeysReq *,tpPESession ); -void limSendSetStaKeyReq( tpAniSirGlobal, tLimMlmSetKeysReq *, tANI_U16, tANI_U8,tpPESession); +void limSendSetStaKeyReq( tpAniSirGlobal, tLimMlmSetKeysReq *, tANI_U16, tANI_U8,tpPESession, tANI_BOOLEAN sendRsp); void limPostSmeSetKeysCnf( tpAniSirGlobal, tLimMlmSetKeysReq *, tLimMlmSetKeysCnf * ); void limSendRemoveBssKeyReq(tpAniSirGlobal pMac, tLimMlmRemoveKeyReq * pMlmRemoveKeyReq,tpPESession); diff --git a/CORE/MAC/src/pe/lim/limTypes.h b/CORE/MAC/src/pe/lim/limTypes.h index 9401bf6e8efe..7ccb6f5790a0 100644 --- a/CORE/MAC/src/pe/lim/limTypes.h +++ b/CORE/MAC/src/pe/lim/limTypes.h @@ -389,17 +389,6 @@ typedef struct sLimMlmPurgeStaInd tANI_U8 sessionId; } tLimMlmPurgeStaInd, *tpLimMlmPurgeStaInd; -typedef struct sLimMlmSetKeysReq -{ - tSirMacAddr peerMacAddr; - tANI_U8 sessionId; //Added For BT-AMP Support - tANI_U8 smesessionId; // Added for drivers based on wmi interface - tANI_U16 aid; - tAniEdType edType; // Encryption/Decryption type - tANI_U8 numKeys; - tSirKeys key[SIR_MAC_MAX_NUM_OF_DEFAULT_KEYS]; -} tLimMlmSetKeysReq, *tpLimMlmSetKeysReq; - typedef struct sLimMlmSetKeysCnf { tSirMacAddr peerMacAddr; diff --git a/CORE/SERVICES/WMA/wma.c b/CORE/SERVICES/WMA/wma.c index dd40b0441de8..4e8d01e86763 100644 --- a/CORE/SERVICES/WMA/wma.c +++ b/CORE/SERVICES/WMA/wma.c @@ -233,8 +233,7 @@ void wma_set_dfs_regdomain(tp_wma_handle wma); static VOS_STATUS wma_set_thermal_mgmt(tp_wma_handle wma_handle, t_thermal_cmd_params thermal_info); -static void wma_set_stakey(tp_wma_handle wma_handle, tpSetStaKeyParams key_info, - v_BOOL_t sendResp); +static void wma_set_stakey(tp_wma_handle wma_handle, tpSetStaKeyParams key_info); static void wma_beacon_miss_handler(tp_wma_handle wma, u_int32_t vdev_id); @@ -3855,7 +3854,9 @@ static VOS_STATUS wma_create_peer(tp_wma_handle wma, ol_txrx_pdev_handle pdev, vos_mem_set(&key_info, sizeof(key_info), 0); key_info.smesessionId= vdev_id; vos_mem_copy(key_info.peerMacAddr, peer_addr, ETH_ALEN); - wma_set_stakey(wma, &key_info, FALSE); + key_info.sendRsp = FALSE; + + wma_set_stakey(wma, &key_info); } #endif @@ -10512,7 +10513,7 @@ static void wma_add_sta_req_sta_mode(tp_wma_handle wma, tpAddStaParams params) * Set the PTK in 11r mode because we already have it. */ if (iface->staKeyParams) { - wma_set_stakey(wma, (tpSetStaKeyParams) iface->staKeyParams, FALSE); + wma_set_stakey(wma, (tpSetStaKeyParams) iface->staKeyParams); } #endif } @@ -11020,7 +11021,7 @@ static void wma_set_ibsskey_helper(tp_wma_handle wma_handle, tpSetBssKeyParams k } } -static void wma_set_stakey(tp_wma_handle wma_handle, tpSetStaKeyParams key_info, v_BOOL_t sendResp) +static void wma_set_stakey(tp_wma_handle wma_handle, tpSetStaKeyParams key_info) { wmi_buf_t buf; int32_t status, i; @@ -11136,7 +11137,7 @@ static void wma_set_stakey(tp_wma_handle wma_handle, tpSetStaKeyParams key_info, /* TODO: Should we wait till we get HTT_T2H_MSG_TYPE_SEC_IND? */ key_info->status = eHAL_STATUS_SUCCESS; out: - if (sendResp) + if (key_info->sendRsp) wma_send_msg(wma_handle, WDA_SET_STAKEY_RSP, (void *) key_info, 0); } @@ -17055,7 +17056,7 @@ VOS_STATUS wma_mc_process_msg(v_VOID_t *vos_context, vos_msg_t *msg) break; case WDA_SET_STAKEY_REQ: wma_set_stakey(wma_handle, - (tpSetStaKeyParams)msg->bodyptr, TRUE); + (tpSetStaKeyParams)msg->bodyptr); break; case WDA_DELETE_STA_REQ: wma_delete_sta(wma_handle, diff --git a/CORE/WDA/inc/legacy/halMsgApi.h b/CORE/WDA/inc/legacy/halMsgApi.h index 17d0ab977a02..0c680ae7a322 100644 --- a/CORE/WDA/inc/legacy/halMsgApi.h +++ b/CORE/WDA/inc/legacy/halMsgApi.h @@ -372,8 +372,20 @@ typedef struct // PE session id now added to all HAL<->PE transacations // HAL sends back response with no modification + tANI_U8 sendRsp; } tSetStaKeyParams, *tpSetStaKeyParams; +typedef struct sLimMlmSetKeysReq +{ + tSirMacAddr peerMacAddr; + tANI_U8 sessionId; //Added For BT-AMP Support + tANI_U8 smesessionId; // Added for drivers based on wmi interface + tANI_U16 aid; + tAniEdType edType; // Encryption/Decryption type + tANI_U8 numKeys; + tSirKeys key[SIR_MAC_MAX_NUM_OF_DEFAULT_KEYS]; +} tLimMlmSetKeysReq, *tpLimMlmSetKeysReq; + // // Mesg header is used from tSirMsgQ // Mesg Type = SIR_HAL_ADD_BSS_REQ -- cgit v1.2.3 From 15c88174ff58c4c22ccf9713845e1eb35c168743 Mon Sep 17 00:00:00 2001 From: Ganesh Babu Kumaravel Date: Tue, 10 Jun 2014 19:52:19 +0530 Subject: qcacld: Clear pending interrupts before pci suspend Both hif_pci_suspend() and hif_pci_interrupt_handler() are synchronized already. The scenario where if there are pending interrupts and hif_pci_suspend() has taken the lock then we fail to clear the pending interrupts. So fix it by clearing the pending interrupts if any along with disabling it. Change-Id: I09e7c30d8f5329c4d457bb2cf0252d4f33896e8d CRs-Fixed: 678098 --- CORE/SERVICES/HIF/PCIe/if_pci.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CORE/SERVICES/HIF/PCIe/if_pci.c b/CORE/SERVICES/HIF/PCIe/if_pci.c index bca1b83139c9..7795f158c69d 100644 --- a/CORE/SERVICES/HIF/PCIe/if_pci.c +++ b/CORE/SERVICES/HIF/PCIe/if_pci.c @@ -1789,6 +1789,8 @@ hif_pci_suspend(struct pci_dev *pdev, pm_message_t state) } A_PCI_WRITE32(sc->mem+(SOC_CORE_BASE_ADDRESS | PCIE_INTR_ENABLE_ADDRESS), 0); + A_PCI_WRITE32(sc->mem+(SOC_CORE_BASE_ADDRESS | PCIE_INTR_CLR_ADDRESS), + PCIE_INTR_FIRMWARE_MASK | PCIE_INTR_CE_MASK_ALL); /* IMPORTANT: this extra read transaction is required to flush the posted write buffer */ tmp = A_PCI_READ32(sc->mem+(SOC_CORE_BASE_ADDRESS | PCIE_INTR_ENABLE_ADDRESS)); if (tmp == 0xffffffff) { -- cgit v1.2.3 From 8c06542530aff92a1c0972746ea0943817ec1fc3 Mon Sep 17 00:00:00 2001 From: Rajeev Kumar Date: Tue, 10 Jun 2014 18:05:39 -0700 Subject: qcacld: send correct rssi value while sending batch scan results. Add correct data-type for rssi variable, to provide correct rssi value to upper layer, while populating btach scan results Change-Id: If77cfec02da3b55662c7dea810585f67aa39895b CRs-fixed: 678422 --- CORE/HDD/inc/wlan_hdd_main.h | 2 +- CORE/MAC/inc/sirApi.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CORE/HDD/inc/wlan_hdd_main.h b/CORE/HDD/inc/wlan_hdd_main.h index ae51a1887393..a1e74a3bf030 100644 --- a/CORE/HDD/inc/wlan_hdd_main.h +++ b/CORE/HDD/inc/wlan_hdd_main.h @@ -868,7 +868,7 @@ typedef struct /*Channel*/ tANI_U8 ch; /*RSSI or Level*/ - tANI_U8 rssi; + tANI_S8 rssi; /*Age*/ tANI_U32 age; }tHDDbatchScanRspApInfo; diff --git a/CORE/MAC/inc/sirApi.h b/CORE/MAC/inc/sirApi.h index bad0f8e52465..f478bdc4b0d0 100644 --- a/CORE/MAC/inc/sirApi.h +++ b/CORE/MAC/inc/sirApi.h @@ -4753,7 +4753,7 @@ typedef PACKED_PRE struct PACKED_POST tANI_U8 bssid[6]; /* BSSID */ tANI_U8 ssid[33]; /* SSID */ tANI_U8 ch; /* Channel */ - tANI_U8 rssi; /* RSSI or Level */ + tANI_S8 rssi; /* RSSI or Level */ /*Timestamp when Network was found. Used to calculate age based on timestamp in GET_RSP msg header */ tANI_U32 timestamp; -- cgit v1.2.3 From 7c77e2474fddedeb20dd8583d6aa6f0b9efd9f95 Mon Sep 17 00:00:00 2001 From: Krishna Kumaar Natarajan Date: Tue, 10 Jun 2014 14:58:39 -0700 Subject: qcacld: Updating the misplaced null check on hHal in sapFSM Null check for hHal is placed within the feature flag FEATURE_WLAN_MCC_TO_SCC_SWITCH which can be either ON/OFF whereas hHal will be available always and hence moving the null check on hHal outside the feature flag. Change-Id: Id8e946eb59805485c3d4962b7f42ed4af7b5121b CRs-Fixed: 678160 --- CORE/SAP/src/sapFsm.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/CORE/SAP/src/sapFsm.c b/CORE/SAP/src/sapFsm.c index 105a8bececd9..553ba85aa59f 100644 --- a/CORE/SAP/src/sapFsm.c +++ b/CORE/SAP/src/sapFsm.c @@ -1189,11 +1189,17 @@ sapFsm if (msg == eSAP_MAC_SCAN_COMPLETE) { tHalHandle hHal = VOS_GET_HAL_CB(sapContext->pvosGCtx); + if (NULL == hHal) + { + VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR, + "In %s, NULL hHal in state %s, msg %d ", __func__, + "eSAP_CH_SELECT", msg); + return VOS_STATUS_E_FAULT; + } #ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH - v_U16_t cc_ch; - if (NULL != hHal && - sapContext->cc_switch_mode != VOS_MCC_TO_SCC_SWITCH_DISABLE) + if (sapContext->cc_switch_mode != VOS_MCC_TO_SCC_SWITCH_DISABLE) { + v_U16_t cc_ch; cc_ch = sme_CheckConcurrentChannelOverlap(hHal, sapContext->channel, sapConvertSapPhyModeToCsrPhyMode( -- cgit v1.2.3 From fd2705612b19fc237927b2b25b8360872a4aeed0 Mon Sep 17 00:00:00 2001 From: Sameer Thalappil Date: Fri, 6 Jun 2014 17:27:42 -0700 Subject: qcacld: Unlock SSR protect when target is down Target access abstraction APIs return directly, so invoke the main APIs to process the return value, then unlock the SSR protection. Change-Id: I3273d22c2293b788a5bbdeb92f13bec01d51c2ca CRs-Fixed: 676984 --- CORE/SERVICES/HIF/PCIe/if_pci.c | 39 ++++++++++++++++++++++++--------------- 1 file changed, 24 insertions(+), 15 deletions(-) diff --git a/CORE/SERVICES/HIF/PCIe/if_pci.c b/CORE/SERVICES/HIF/PCIe/if_pci.c index 7795f158c69d..d2b43ce51b61 100644 --- a/CORE/SERVICES/HIF/PCIe/if_pci.c +++ b/CORE/SERVICES/HIF/PCIe/if_pci.c @@ -1713,9 +1713,13 @@ hif_pci_suspend(struct pci_dev *pdev, pm_message_t state) vos_ssr_protect(__func__); - A_TARGET_ACCESS_BEGIN_RET(targid); + if (HIFTargetSleepStateAdjust(targid, FALSE, TRUE) < 0) + goto out; + A_PCI_WRITE32(sc->mem + FW_INDICATOR_ADDRESS, (state.event << 16)); - A_TARGET_ACCESS_END_RET(targid); + + if (HIFTargetSleepStateAdjust(targid, TRUE, FALSE) < 0) + goto out; if (!txrx_pdev) { printk("%s: txrx_pdev is NULL\n", __func__); @@ -1762,9 +1766,11 @@ hif_pci_suspend(struct pci_dev *pdev, pm_message_t state) printk("%s: CE still not done with access: \n", __func__); adf_os_atomic_set(&sc->wow_done, 0); - A_TARGET_ACCESS_BEGIN_RET(targid); + if (HIFTargetSleepStateAdjust(targid, FALSE, TRUE) < 0) + goto out; val = A_PCI_READ32(sc->mem + FW_INDICATOR_ADDRESS) >> 16; - A_TARGET_ACCESS_END_RET(targid); + if (HIFTargetSleepStateAdjust(targid, TRUE, FALSE) < 0) + goto out; if (!wma_is_wow_mode_selected(temp_module) && (val == PM_EVENT_HIBERNATE || val == PM_EVENT_SUSPEND)) { @@ -1783,11 +1789,10 @@ hif_pci_suspend(struct pci_dev *pdev, pm_message_t state) adf_os_spin_lock_irqsave(&hif_state->suspend_lock); /*Disable PCIe interrupts*/ - if (Q_TARGET_ACCESS_BEGIN(targid) < 0) { - adf_os_spin_unlock_irqrestore( &hif_state->suspend_lock); - return -1; + if (HIFTargetSleepStateAdjust(targid, FALSE, TRUE) < 0) { + adf_os_spin_unlock_irqrestore(&hif_state->suspend_lock); + goto out; } - A_PCI_WRITE32(sc->mem+(SOC_CORE_BASE_ADDRESS | PCIE_INTR_ENABLE_ADDRESS), 0); A_PCI_WRITE32(sc->mem+(SOC_CORE_BASE_ADDRESS | PCIE_INTR_CLR_ADDRESS), PCIE_INTR_FIRMWARE_MASK | PCIE_INTR_CE_MASK_ALL); @@ -1798,9 +1803,9 @@ hif_pci_suspend(struct pci_dev *pdev, pm_message_t state) VOS_ASSERT(0); } - if (Q_TARGET_ACCESS_END(targid) < 0) { - adf_os_spin_unlock_irqrestore( &hif_state->suspend_lock); - return -1; + if (HIFTargetSleepStateAdjust(targid, TRUE, FALSE) < 0) { + adf_os_spin_unlock_irqrestore(&hif_state->suspend_lock); + goto out; } /* Stop the HIF Sleep Timer */ @@ -1846,7 +1851,8 @@ hif_pci_resume(struct pci_dev *pdev) adf_os_atomic_set(&sc->pci_link_suspended, 0); /* Enable Legacy PCI line interrupts */ - A_TARGET_ACCESS_BEGIN_RET(targid); + if (HIFTargetSleepStateAdjust(targid, FALSE, TRUE) < 0) + goto out; A_PCI_WRITE32(sc->mem+(SOC_CORE_BASE_ADDRESS | PCIE_INTR_ENABLE_ADDRESS), PCIE_INTR_FIRMWARE_MASK | PCIE_INTR_CE_MASK_ALL); /* IMPORTANT: this extra read transaction is required to flush the posted write buffer */ @@ -1855,7 +1861,8 @@ hif_pci_resume(struct pci_dev *pdev) printk(KERN_ERR "%s: PCIe link is down\n", __func__); VOS_ASSERT(0); } - A_TARGET_ACCESS_END_RET(targid); + if (HIFTargetSleepStateAdjust(targid, TRUE, FALSE) < 0) + goto out; err = pci_enable_device(pdev); @@ -1890,9 +1897,11 @@ hif_pci_resume(struct pci_dev *pdev) pci_write_config_dword(pdev, 0x188, (val & ~0x0000000f)); #endif - A_TARGET_ACCESS_BEGIN_RET(targid); + if (HIFTargetSleepStateAdjust(targid, FALSE, TRUE) < 0) + goto out; val = A_PCI_READ32(sc->mem + FW_INDICATOR_ADDRESS) >> 16; - A_TARGET_ACCESS_END_RET(targid); + if (HIFTargetSleepStateAdjust(targid, TRUE, FALSE) < 0) + goto out; /* No need to send WMI_PDEV_RESUME_CMDID to FW if WOW is enabled */ temp_module = vos_get_context(VOS_MODULE_ID_WDA, vos_context); -- cgit v1.2.3 From dfbad60cf4506b967c076816d97825248a206468 Mon Sep 17 00:00:00 2001 From: Ji-Huang Date: Fri, 30 May 2014 11:10:54 +0800 Subject: qcacld-new: Add build flag & INI support to enable FW log In HL USB case, add a build flag & CFG INI to disable the FW log mechanism by default. Change-Id: I37cc2f896c611c3cbc0c7f35625d403b8dd0accf CRs-fixed: 671769 --- Kbuild | 1 + firmware_bin/WCNSS_qcom_cfg.usb.ini | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/Kbuild b/Kbuild index 19d19daeab60..96778ab927cc 100644 --- a/Kbuild +++ b/Kbuild @@ -1181,6 +1181,7 @@ endif ifeq ($(CONFIG_HIF_USB), 1) CDEFINES += -DHIF_USB CDEFINES += -DCONFIG_HL_SUPPORT +CDEFINES += -DCONFIG_FW_LOGS_BASED_ON_INI endif #Enable pci read/write config functions diff --git a/firmware_bin/WCNSS_qcom_cfg.usb.ini b/firmware_bin/WCNSS_qcom_cfg.usb.ini index 1e8909b31ed7..47e77ce4d409 100644 --- a/firmware_bin/WCNSS_qcom_cfg.usb.ini +++ b/firmware_bin/WCNSS_qcom_cfg.usb.ini @@ -504,6 +504,10 @@ gEnableTDLSSupport=1 # Regulatory Setting; 0=STRICT; 1=CUSTOM gRegulatoryChangeCountry=1 +# Disable FW log function by default +gFwDebugLogType=0 +gFwDebugModuleLoglevel=0,0 + END # Note: Configuration parser would not read anything past the END marker -- cgit v1.2.3 From ba455e00548831a5686dc36b840fd2f7d85a91ff Mon Sep 17 00:00:00 2001 From: OwenLiu Date: Fri, 6 Jun 2014 20:47:43 +0800 Subject: qcacld: Correct wrong usage of memcmp In memory comparison of "WPA.unicast_ciphers" and "\x00\x0f\xac\x02": if the beacon received carries WPA ie with AES cipher, then this may cause wrong channel bandwidth to be set. Change-Id: I1fc640a1b509bf77ca74806958f58c1570ead30d CRs-Fixed: 674575 --- CORE/SME/src/csr/csrApiRoam.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CORE/SME/src/csr/csrApiRoam.c b/CORE/SME/src/csr/csrApiRoam.c index 6d8a9b9ff4ef..c2ade716c149 100644 --- a/CORE/SME/src/csr/csrApiRoam.c +++ b/CORE/SME/src/csr/csrApiRoam.c @@ -11418,7 +11418,7 @@ tANI_BOOLEAN csrRoamIsValid40MhzChannel(tpAniSirGlobal pMac, tANI_U8 channel) || (((NULL != &(pIes->WPA)) && (pIes->WPA.unicast_cipher_count == 1)) && ((NULL != &(pIes->WPA.unicast_ciphers[0])) - && memcmp(&(pIes->WPA.unicast_ciphers[0]), + && !memcmp(&(pIes->WPA.unicast_ciphers[0]), "\x00\x0f\xac\x02", 4)))) { smsLog(pMac, LOGW, " No channel bonding in TKIP mode "); -- cgit v1.2.3 From 0d2e8ea2ce0bcce148c26daf4e763a11f5bad989 Mon Sep 17 00:00:00 2001 From: Krishna Kumaar Natarajan Date: Thu, 5 Jun 2014 19:40:31 -0700 Subject: qcacld: CL 976213 - update fw common interface files This commit adds WMI command for host to get channel avoidance info update. Change-Id: If1928191aac3c5f49811464e183426a67cac09a2 CRs-Fixed: 676389 --- CORE/SERVICES/COMMON/wmi_tlv_defs.h | 8 +++++++- CORE/SERVICES/COMMON/wmi_unified.h | 20 ++++++++++++++++++++ CORE/SERVICES/COMMON/wmi_version.h | 2 +- CORE/SERVICES/WMI/wmi_unified.c | 1 + 4 files changed, 29 insertions(+), 2 deletions(-) diff --git a/CORE/SERVICES/COMMON/wmi_tlv_defs.h b/CORE/SERVICES/COMMON/wmi_tlv_defs.h index 6e5984a3f533..e0d7073a9185 100644 --- a/CORE/SERVICES/COMMON/wmi_tlv_defs.h +++ b/CORE/SERVICES/COMMON/wmi_tlv_defs.h @@ -437,6 +437,7 @@ typedef enum { WMITLV_TAG_STRUC_wmi_host_auto_shutdown_cfg_cmd_fixed_param, WMITLV_TAG_STRUC_wmi_host_auto_shutdown_event_fixed_param, WMITLV_TAG_STRUC_wmi_update_whal_mib_stats_event_fixed_param, + WMITLV_TAG_STRUC_wmi_chan_avoid_update_cmd_param, } WMITLV_TAG_ID; /* @@ -595,7 +596,8 @@ typedef enum { OP(WMI_OBSS_SCAN_ENABLE_CMDID) \ OP(WMI_OBSS_SCAN_DISABLE_CMDID)\ OP(WMI_PDEV_SET_LED_CONFIG_CMDID)\ - OP(WMI_HOST_AUTO_SHUTDOWN_CFG_CMDID) + OP(WMI_HOST_AUTO_SHUTDOWN_CFG_CMDID) \ + OP(WMI_CHAN_AVOID_UPDATE_CMDID) /* * IMPORTANT: Please add _ALL_ WMI Events Here. @@ -1600,6 +1602,10 @@ WMITLV_CREATE_PARAM_STRUC(WMI_PDEV_SET_LED_CONFIG_CMDID); WMITLV_ELEM(id,op,buf,len, WMITLV_TAG_STRUC_wmi_host_auto_shutdown_cfg_cmd_fixed_param, wmi_host_auto_shutdown_cfg_cmd_fixed_param, fixed_param, WMITLV_SIZE_FIX) WMITLV_CREATE_PARAM_STRUC(WMI_HOST_AUTO_SHUTDOWN_CFG_CMDID); +/* Ch avoidance update cmd */ +#define WMITLV_TABLE_WMI_CHAN_AVOID_UPDATE_CMDID(id,op,buf,len) \ + WMITLV_ELEM(id,op,buf,len, WMITLV_TAG_STRUC_wmi_chan_avoid_update_cmd_param, wmi_chan_avoid_update_cmd_param, fixed_param, WMITLV_SIZE_FIX) +WMITLV_CREATE_PARAM_STRUC(WMI_CHAN_AVOID_UPDATE_CMDID); /************************** TLV definitions of WMI events *******************************/ diff --git a/CORE/SERVICES/COMMON/wmi_unified.h b/CORE/SERVICES/COMMON/wmi_unified.h index 974bfbaab241..41572968c73c 100644 --- a/CORE/SERVICES/COMMON/wmi_unified.h +++ b/CORE/SERVICES/COMMON/wmi_unified.h @@ -607,6 +607,8 @@ typedef enum { /** Modem power state command */ WMI_MODEM_POWER_STATE_CMDID=WMI_CMD_GRP_START_ID(WMI_GRP_COEX), + WMI_CHAN_AVOID_UPDATE_CMDID, + /** * OBSS scan offload enable/disable commands * OBSS scan enable CMD will send to FW after VDEV UP, if these conditions are true: @@ -6879,6 +6881,24 @@ typedef enum { WMI_FRAME_TX_FILTERED, /* frame filtered by hardware */ } WMI_FRAME_TX_STATUS; +/** + * This command is sent from WLAN host driver to firmware to + * request firmware to send the latest channel avoidance range + * to host. + * + * This command is only applicable for APQ platform which has + * modem on the platform. If firmware doesn't support MWS Coex, + * this command can be dropped by firmware. + * + * Host would send this command to firmware to request a channel + * avoidance information update. + */ +typedef struct { + /** TLV tag and len; tag equals + * WMITLV_TAG_STRUC_wmi_chan_avoid_update_cmd_param */ + A_UINT32 tlv_header; +} wmi_chan_avoid_update_cmd_param; + #ifdef __cplusplus } #endif diff --git a/CORE/SERVICES/COMMON/wmi_version.h b/CORE/SERVICES/COMMON/wmi_version.h index 07a6c80045c7..9b2b37de7b9f 100644 --- a/CORE/SERVICES/COMMON/wmi_version.h +++ b/CORE/SERVICES/COMMON/wmi_version.h @@ -36,7 +36,7 @@ #define __WMI_VER_MINOR_ 0 /** WMI revision number has to be incremented when there is a * change that may or may not break compatibility. */ -#define __WMI_REVISION_ 48 +#define __WMI_REVISION_ 49 /** The Version Namespace should not be normally changed. Only * host and firmware of the same WMI namespace will work diff --git a/CORE/SERVICES/WMI/wmi_unified.c b/CORE/SERVICES/WMI/wmi_unified.c index 35f8c8a07dee..1481c3b9525c 100644 --- a/CORE/SERVICES/WMI/wmi_unified.c +++ b/CORE/SERVICES/WMI/wmi_unified.c @@ -529,6 +529,7 @@ static u_int8_t* get_wmi_cmd_string(WMI_CMD_ID wmi_command) CASE_RETURN_STRING(WMI_ROAM_SCAN_CMD); CASE_RETURN_STRING(WMI_PDEV_SET_LED_CONFIG_CMDID); CASE_RETURN_STRING(WMI_HOST_AUTO_SHUTDOWN_CFG_CMDID); + CASE_RETURN_STRING(WMI_CHAN_AVOID_UPDATE_CMDID); } return "Invalid WMI cmd"; } -- cgit v1.2.3 From f991c3bf7d5cd7d91d9c207f89fa0d9afed4c788 Mon Sep 17 00:00:00 2001 From: Krishna Kumaar Natarajan Date: Thu, 5 Jun 2014 22:57:39 -0700 Subject: qcacld: CL 976852 - update fw common interface files This commit adds ioac feature related wmi commands. Change-Id: I9a4a3044c6354ff5f6ee5e2f31e5c5b2afc3d548 CRs-Fixed: 676442 --- CORE/SERVICES/COMMON/wmi_tlv_defs.h | 38 ++++++++++++++++- CORE/SERVICES/COMMON/wmi_unified.h | 85 +++++++++++++++++++++++++++++++++++++ CORE/SERVICES/COMMON/wmi_version.h | 2 +- CORE/SERVICES/WMI/wmi_unified.c | 4 ++ 4 files changed, 127 insertions(+), 2 deletions(-) diff --git a/CORE/SERVICES/COMMON/wmi_tlv_defs.h b/CORE/SERVICES/COMMON/wmi_tlv_defs.h index e0d7073a9185..b511ac82a2a7 100644 --- a/CORE/SERVICES/COMMON/wmi_tlv_defs.h +++ b/CORE/SERVICES/COMMON/wmi_tlv_defs.h @@ -438,6 +438,13 @@ typedef enum { WMITLV_TAG_STRUC_wmi_host_auto_shutdown_event_fixed_param, WMITLV_TAG_STRUC_wmi_update_whal_mib_stats_event_fixed_param, WMITLV_TAG_STRUC_wmi_chan_avoid_update_cmd_param, + WMITLV_TAG_STRUC_WOW_ACER_IOAC_PKT_PATTERN_T, + WMITLV_TAG_STRUC_WOW_ACER_IOAC_TMR_PATTERN_T, + WMITLV_TAG_STRUC_WMI_WOW_IOAC_ADD_KEEPALIVE_CMD_fixed_param, + WMITLV_TAG_STRUC_WMI_WOW_IOAC_DEL_KEEPALIVE_CMD_fixed_param, + WMITLV_TAG_STRUC_WOW_IOAC_KEEPALIVE_T, + WMITLV_TAG_STRUC_WMI_WOW_ACER_IOAC_ADD_PATTERN_CMD_fixed_param, + WMITLV_TAG_STRUC_WMI_WOW_ACER_IOAC_DEL_PATTERN_CMD_fixed_param, } WMITLV_TAG_ID; /* @@ -597,7 +604,11 @@ typedef enum { OP(WMI_OBSS_SCAN_DISABLE_CMDID)\ OP(WMI_PDEV_SET_LED_CONFIG_CMDID)\ OP(WMI_HOST_AUTO_SHUTDOWN_CFG_CMDID) \ - OP(WMI_CHAN_AVOID_UPDATE_CMDID) + OP(WMI_CHAN_AVOID_UPDATE_CMDID) \ + OP(WMI_WOW_ACER_IOAC_ADD_KEEPALIVE_CMDID) \ + OP(WMI_WOW_ACER_IOAC_DEL_KEEPALIVE_CMDID) \ + OP(WMI_WOW_ACER_IOAC_ADD_WAKE_PATTERN_CMDID) \ + OP(WMI_WOW_ACER_IOAC_DEL_WAKE_PATTERN_CMDID) /* * IMPORTANT: Please add _ALL_ WMI Events Here. @@ -1278,7 +1289,32 @@ WMITLV_CREATE_PARAM_STRUC(WMI_DFS_PHYERR_FILTER_DIS_CMDID); WMITLV_CREATE_PARAM_STRUC(WMI_WOW_ADD_WAKE_PATTERN_CMDID); +/* Acer IOAC add keep alive cmd. */ +#define WMITLV_TABLE_WMI_WOW_ACER_IOAC_ADD_KEEPALIVE_CMDID(id,op,buf,len) \ + WMITLV_ELEM(id,op,buf,len, WMITLV_TAG_STRUC_WMI_WOW_IOAC_ADD_KEEPALIVE_CMD_fixed_param, WMI_WOW_IOAC_ADD_KEEPALIVE_CMD_fixed_param, fixed_param, WMITLV_SIZE_FIX) \ + WMITLV_ELEM(id,op,buf,len, WMITLV_TAG_ARRAY_STRUC, WOW_IOAC_KEEPALIVE_T, keepalive_set, WMITLV_SIZE_VAR) +WMITLV_CREATE_PARAM_STRUC(WMI_WOW_ACER_IOAC_ADD_KEEPALIVE_CMDID); + +/* Acer IOAC del keep alive cmd. */ +#define WMITLV_TABLE_WMI_WOW_ACER_IOAC_DEL_KEEPALIVE_CMDID(id,op,buf,len) \ + WMITLV_ELEM(id,op,buf,len, WMITLV_TAG_STRUC_WMI_WOW_IOAC_DEL_KEEPALIVE_CMD_fixed_param, WMI_WOW_IOAC_DEL_KEEPALIVE_CMD_fixed_param, fixed_param, WMITLV_SIZE_FIX) + +WMITLV_CREATE_PARAM_STRUC(WMI_WOW_ACER_IOAC_DEL_KEEPALIVE_CMDID); + +/* WOW ACER IOAC Add Wake Pattern Cmd */ +#define WMITLV_TABLE_WMI_WOW_ACER_IOAC_ADD_WAKE_PATTERN_CMDID(id,op,buf,len) \ + WMITLV_ELEM(id,op,buf,len, WMITLV_TAG_STRUC_WMI_WOW_ACER_IOAC_ADD_PATTERN_CMD_fixed_param, WMI_WOW_ACER_IOAC_ADD_PATTERN_CMD_fixed_param, fixed_param, WMITLV_SIZE_FIX) \ + WMITLV_ELEM(id,op,buf,len, WMITLV_TAG_ARRAY_STRUC, WOW_ACER_IOAC_PKT_PATTERN_T, pattern_info_acer_pkt, WMITLV_SIZE_VAR) \ + WMITLV_ELEM(id,op,buf,len, WMITLV_TAG_ARRAY_STRUC, WOW_ACER_IOAC_TMR_PATTERN_T, pattern_info_acer_tmr, WMITLV_SIZE_VAR) + +WMITLV_CREATE_PARAM_STRUC(WMI_WOW_ACER_IOAC_ADD_WAKE_PATTERN_CMDID); + +/* WOW ACER IOAC Delete Wake Pattern Cmd */ +#define WMITLV_TABLE_WMI_WOW_ACER_IOAC_DEL_WAKE_PATTERN_CMDID(id,op,buf,len) \ + WMITLV_ELEM(id,op,buf,len, WMITLV_TAG_STRUC_WMI_WOW_ACER_IOAC_DEL_PATTERN_CMD_fixed_param, WMI_WOW_ACER_IOAC_DEL_PATTERN_CMD_fixed_param, fixed_param, WMITLV_SIZE_FIX) + +WMITLV_CREATE_PARAM_STRUC(WMI_WOW_ACER_IOAC_DEL_WAKE_PATTERN_CMDID); /* Stop scan Cmd */ #define WMITLV_TABLE_WMI_STOP_SCAN_CMDID(id,op,buf,len) \ diff --git a/CORE/SERVICES/COMMON/wmi_unified.h b/CORE/SERVICES/COMMON/wmi_unified.h index 41572968c73c..83ee2bcd45c5 100644 --- a/CORE/SERVICES/COMMON/wmi_unified.h +++ b/CORE/SERVICES/COMMON/wmi_unified.h @@ -432,6 +432,14 @@ typedef enum { WMI_WOW_ENABLE_CMDID, /** host woke up from sleep event to FW. Generated in response to WOW Hardware event */ WMI_WOW_HOSTWAKEUP_FROM_SLEEP_CMDID, + /* Acer IOAC add keep alive cmd. */ + WMI_WOW_ACER_IOAC_ADD_KEEPALIVE_CMDID, + /* Acer IOAC del keep alive cmd. */ + WMI_WOW_ACER_IOAC_DEL_KEEPALIVE_CMDID, + /* Acer IOAC add pattern for awake */ + WMI_WOW_ACER_IOAC_ADD_WAKE_PATTERN_CMDID, + /* Acer IOAC deleta a wake pattern */ + WMI_WOW_ACER_IOAC_DEL_WAKE_PATTERN_CMDID, /* RTT measurement related cmd */ /** reques to make an RTT measurement */ @@ -4812,8 +4820,17 @@ when comparing wifi header.*/ #define WOW_DEFAULT_BITMASK_SIZE_DWORD 37 #define WOW_MAX_BITMAP_FILTERS 32 #define WOW_DEFAULT_MAGIG_PATTERN_MATCH_CNT 16 +#define WOW_ACER_EXTEND_PATTERN_MATCH_CNT 16 +#define WOW_ACER_SHORT_PATTERN_MATCH_CNT 8 #define WOW_DEFAULT_EVT_BUF_SIZE 148 /* Maximum 148 bytes of the data is copied starting from header incase if the match is found. The 148 comes from (128 - 14 ) payload size + 8bytes LLC + 26bytes MAC header*/ +#define WOW_DEFAULT_ACER_IOAC_PATTERN_SIZE 6 +#define WOW_DEFAULT_ACER_IOAC_PATTERN_SIZE_DWORD 2 +#define WOW_DEFAULT_ACER_IOAC_RANDOM_SIZE 6 +#define WOW_DEFAULT_ACER_IOAC_RANDOM_SIZE_DWORD 2 +#define WOW_DEFAULT_ACER_IOAC_KEEP_ALIVE_PKT_SIZE 120 +#define WOW_DEFAULT_ACER_IOAC_KEEP_ALIVE_PKT_SIZE_DWORD 30 + typedef enum pattern_type_e { WOW_PATTERN_MIN = 0, WOW_BITMAP_PATTERN = WOW_PATTERN_MIN, @@ -4823,6 +4840,8 @@ typedef enum pattern_type_e { WOW_TIMER_PATTERN, WOW_MAGIC_PATTERN, WOW_IPV6_RA_PATTERN, + WOW_ACER_IOAC_PKT_PATTERN, + WOW_ACER_IOAC_TMR_PATTERN, WOW_PATTERN_MAX }WOW_PATTERN_TYPE; @@ -4844,6 +4863,10 @@ typedef enum event_type_e { WOW_HTT_EVENT, WOW_RA_MATCH_EVENT, WOW_HOST_AUTO_SHUTDOWN_EVENT, + WOW_ACER_IOAC_MAGIC_EVENT, + WOW_ACER_IOAC_SHORT_EVENT, + WOW_ACER_IOAC_EXTEND_EVENT, + WOW_ACER_IOAC_TIMER_EVENT, }WOW_WAKE_EVENT_TYPE; typedef enum wake_reason_e { @@ -4868,6 +4891,10 @@ typedef enum wake_reason_e { WOW_REASON_HTT_EVENT, WOW_REASON_RA_MATCH, WOW_REASON_HOST_AUTO_SHUTDOWN, + WOW_REASON_ACER_IOAC_MAGIC_EVENT, + WOW_REASON_ACER_IOAC_SHORT_EVENT, + WOW_REASON_ACER_IOAC_EXTEND_EVENT, + WOW_REASON_ACER_IOAC_TIMER_EVENT, WOW_REASON_DEBUG_TEST = 0xFF, }WOW_WAKE_REASON_TYPE; @@ -4914,6 +4941,64 @@ typedef struct WOW_MAGIC_PATTERN_CMD wmi_mac_addr macaddr; }WOW_MAGIC_PATTERN_CMD; +typedef enum wow_ioac_pattern_type { + WOW_IOAC_MAGIC_PATTERN = 1, + WOW_IOAC_SHORT_PATTERN, + WOW_IOAC_EXTEND_PATTERN, +} WOW_IOAC_PATTERN_TYPE; + +typedef struct acer_ioac_pkt_pattern_s { + A_UINT32 tlv_header; /** TLV tag and len; tag equals WMITLV_TAG_STRUC_WOW_ACER_IOAC_PKT_PATTERN_T */ + A_UINT32 pattern_type; + A_UINT32 pattern[WOW_DEFAULT_ACER_IOAC_PATTERN_SIZE_DWORD]; + A_UINT32 random[WOW_DEFAULT_ACER_IOAC_RANDOM_SIZE_DWORD]; + A_UINT32 pattern_len; + A_UINT32 random_len; +} WOW_ACER_IOAC_PKT_PATTERN_T; + +typedef struct acer_ioac_tmr_pattern_s { + A_UINT32 tlv_header; /** TLV tag and len; tag equals WMITLV_TAG_STRUC_WOW_ACER_IOAC_TMR_PATTERN_T */ + A_UINT32 wake_in_s; + A_UINT32 vdev_id; +} WOW_ACER_IOAC_TMR_PATTERN_T; + +typedef struct { + A_UINT32 tlv_header; /** TLV tag and len; tag equals WMITLV_TAG_STRUC_WMI_WOW_IOAC_ADD_KEEPALIVE_CMD_fixed_param */ + A_UINT32 nID; +} WMI_WOW_IOAC_ADD_KEEPALIVE_CMD_fixed_param; + +typedef struct { + A_UINT32 tlv_header; /** TLV tag and len; tag equals WMITLV_TAG_STRUC_WMI_WOW_IOAC_DEL_KEEPALIVE_CMD_fixed_param */ + A_UINT32 nID; +} WMI_WOW_IOAC_DEL_KEEPALIVE_CMD_fixed_param; + +typedef struct acer_ioac_keepalive_s { + A_UINT32 tlv_header; /** TLV tag and len; tag equals WMITLV_TAG_STRUC_WOW_IOAC_KEEPALIVE_T */ + A_UINT32 keepalive_pkt_buf[WOW_DEFAULT_ACER_IOAC_KEEP_ALIVE_PKT_SIZE_DWORD]; + A_UINT32 keepalive_pkt_len; + A_UINT32 period_in_ms; + A_UINT32 vdev_id; +} WOW_IOAC_KEEPALIVE_T; + +typedef struct { + A_UINT32 tlv_header; /** TLV tag and len; tag equals WMITLV_TAG_STRUC_WMI_WOW_ACER_IOAC_ADD_PATTERN_CMD_fixed_param */ + A_UINT32 vdev_id; + A_UINT32 pattern_type; +/* + * Following this struct are these TLVs. Note that they are all array of structures + * but can have at most one element. Which TLV is empty or has one element depends + * on the field pattern_type. This is to emulate an union. + * WOW_ACER_IOAC_PKT_PATTERN_T pattern_info_acer_pkt[]; + * WOW_ACER_IOAC_TMR_PATTERN_T pattern_info_acer_tmr[]; + */ +} WMI_WOW_ACER_IOAC_ADD_PATTERN_CMD_fixed_param; + +typedef struct { + A_UINT32 tlv_header; /** TLV tag and len; tag equals WMITLV_TAG_STRUC_WMI_WOW_ACER_IOAC_DEL_PATTERN_CMD_fixed_param */ + A_UINT32 vdev_id; + A_UINT32 pattern_type; +} WMI_WOW_ACER_IOAC_DEL_PATTERN_CMD_fixed_param; + typedef struct { A_UINT32 tlv_header; /** TLV tag and len; tag equals WMITLV_TAG_STRUC_WMI_WOW_ADD_PATTERN_CMD_fixed_param */ A_UINT32 vdev_id; diff --git a/CORE/SERVICES/COMMON/wmi_version.h b/CORE/SERVICES/COMMON/wmi_version.h index 9b2b37de7b9f..4e0f20f6b2b7 100644 --- a/CORE/SERVICES/COMMON/wmi_version.h +++ b/CORE/SERVICES/COMMON/wmi_version.h @@ -36,7 +36,7 @@ #define __WMI_VER_MINOR_ 0 /** WMI revision number has to be incremented when there is a * change that may or may not break compatibility. */ -#define __WMI_REVISION_ 49 +#define __WMI_REVISION_ 50 /** The Version Namespace should not be normally changed. Only * host and firmware of the same WMI namespace will work diff --git a/CORE/SERVICES/WMI/wmi_unified.c b/CORE/SERVICES/WMI/wmi_unified.c index 1481c3b9525c..20101b600d01 100644 --- a/CORE/SERVICES/WMI/wmi_unified.c +++ b/CORE/SERVICES/WMI/wmi_unified.c @@ -530,6 +530,10 @@ static u_int8_t* get_wmi_cmd_string(WMI_CMD_ID wmi_command) CASE_RETURN_STRING(WMI_PDEV_SET_LED_CONFIG_CMDID); CASE_RETURN_STRING(WMI_HOST_AUTO_SHUTDOWN_CFG_CMDID); CASE_RETURN_STRING(WMI_CHAN_AVOID_UPDATE_CMDID); + CASE_RETURN_STRING(WMI_WOW_ACER_IOAC_ADD_KEEPALIVE_CMDID); + CASE_RETURN_STRING(WMI_WOW_ACER_IOAC_DEL_KEEPALIVE_CMDID); + CASE_RETURN_STRING(WMI_WOW_ACER_IOAC_ADD_WAKE_PATTERN_CMDID); + CASE_RETURN_STRING(WMI_WOW_ACER_IOAC_DEL_WAKE_PATTERN_CMDID); } return "Invalid WMI cmd"; } -- cgit v1.2.3 From 9a16e488b5bd4aab1bc0921dea2524b906f08221 Mon Sep 17 00:00:00 2001 From: Randy Chiu Date: Fri, 30 May 2014 10:16:31 +0800 Subject: qca_cld: [cfg.ini]Optimising ini parameter for ROME USB 1.CCX already change ESE now. 2.No need AP OBSS protection 3.Disable RX thread Change-Id: I0e2c3068ffea4f7a7e10e715ef0f1fe7801b3db7 CRs-fixed: 672977 --- firmware_bin/WCNSS_qcom_cfg.usb.ini | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/firmware_bin/WCNSS_qcom_cfg.usb.ini b/firmware_bin/WCNSS_qcom_cfg.usb.ini index 47e77ce4d409..12ca0e6c173c 100644 --- a/firmware_bin/WCNSS_qcom_cfg.usb.ini +++ b/firmware_bin/WCNSS_qcom_cfg.usb.ini @@ -115,9 +115,9 @@ gAPMacAddr=000AF589dcab gEnableApProt=1 -#Enable OBSS protection +#Disable OBSS protection -gEnableApOBSSProt=1 +gEnableApOBSSProt=0 #Enable/Disable UAPSD for SoftAP @@ -163,9 +163,8 @@ g11dSupportEnabled=1 g11hSupportEnabled=1 -# CCX Support and fast transition -CcxEnabled=0 -FastTransitionEnabled=1 +# ESE Support and fast transition +EseEnabled=0 ImplicitQosIsEnabled=0 gNeighborScanTimerPeriod=200 @@ -176,7 +175,7 @@ gNeighborScanChannelMinTime=20 gNeighborScanChannelMaxTime=30 gMaxNeighborReqTries=3 -# Legacy (non-CCX, non-802.11r) Fast Roaming Support +# Legacy (non-ESE, non-802.11r) Fast Roaming Support # To enable, set FastRoamEnabled=1 # To disable, set FastRoamEnabled=0 FastRoamEnabled=1 @@ -508,6 +507,9 @@ gRegulatoryChangeCountry=1 gFwDebugLogType=0 gFwDebugModuleLoglevel=0,0 +# Enable or Disable Rx thread +# 1=Enable (default), 0=Disable +gEnableRxThread=0 END # Note: Configuration parser would not read anything past the END marker -- cgit v1.2.3 From 0907c94f8b915f93a9ff99fe139cd93624eefa20 Mon Sep 17 00:00:00 2001 From: Krishna Kumaar Natarajan Date: Fri, 6 Jun 2014 10:49:20 -0700 Subject: qcacld: CL 976981 - update fw common interface files This commit updates WMI commands for Link Layer Stats. Change-Id: Iaa5f429b6149416385f63373dcc0f72d4a1bddf4 CRs-Fixed: 676732 --- CORE/SERVICES/COMMON/wmi_tlv_defs.h | 64 ++++++- CORE/SERVICES/COMMON/wmi_unified.h | 332 ++++++++++++++++++++++++++++++++++++ CORE/SERVICES/COMMON/wmi_version.h | 2 +- CORE/SERVICES/WMI/wmi_unified.c | 3 + 4 files changed, 398 insertions(+), 3 deletions(-) diff --git a/CORE/SERVICES/COMMON/wmi_tlv_defs.h b/CORE/SERVICES/COMMON/wmi_tlv_defs.h index b511ac82a2a7..4feaa72e83ce 100644 --- a/CORE/SERVICES/COMMON/wmi_tlv_defs.h +++ b/CORE/SERVICES/COMMON/wmi_tlv_defs.h @@ -445,6 +445,18 @@ typedef enum { WMITLV_TAG_STRUC_WOW_IOAC_KEEPALIVE_T, WMITLV_TAG_STRUC_WMI_WOW_ACER_IOAC_ADD_PATTERN_CMD_fixed_param, WMITLV_TAG_STRUC_WMI_WOW_ACER_IOAC_DEL_PATTERN_CMD_fixed_param, + WMITLV_TAG_STRUC_wmi_start_link_stats_cmd_fixed_param, + WMITLV_TAG_STRUC_wmi_clear_link_stats_cmd_fixed_param, + WMITLV_TAG_STRUC_wmi_request_link_stats_cmd_fixed_param, + WMITLV_TAG_STRUC_wmi_iface_link_stats_event_fixed_param, + WMITLV_TAG_STRUC_wmi_radio_link_stats_event_fixed_param, + WMITLV_TAG_STRUC_wmi_peer_stats_event_fixed_param, + WMITLV_TAG_STRUC_wmi_channel_stats, + WMITLV_TAG_STRUC_wmi_radio_link_stats, + WMITLV_TAG_STRUC_wmi_rate_stats, + WMITLV_TAG_STRUC_wmi_peer_link_stats, + WMITLV_TAG_STRUC_wmi_wmm_ac_stats, + WMITLV_TAG_STRUC_wmi_iface_link_stats, } WMITLV_TAG_ID; /* @@ -608,7 +620,10 @@ typedef enum { OP(WMI_WOW_ACER_IOAC_ADD_KEEPALIVE_CMDID) \ OP(WMI_WOW_ACER_IOAC_DEL_KEEPALIVE_CMDID) \ OP(WMI_WOW_ACER_IOAC_ADD_WAKE_PATTERN_CMDID) \ - OP(WMI_WOW_ACER_IOAC_DEL_WAKE_PATTERN_CMDID) + OP(WMI_WOW_ACER_IOAC_DEL_WAKE_PATTERN_CMDID) \ + OP(WMI_REQUEST_LINK_STATS_CMDID) \ + OP(WMI_START_LINK_STATS_CMDID) \ + OP(WMI_CLEAR_LINK_STATS_CMDID) /* * IMPORTANT: Please add _ALL_ WMI Events Here. @@ -678,7 +693,10 @@ typedef enum { OP(WMI_STATS_EXT_EVENTID) \ OP(WMI_OFFLOAD_PROB_RESP_TX_STATUS_EVENTID) \ OP(WMI_HOST_AUTO_SHUTDOWN_EVENTID) \ - OP(WMI_UPDATE_WHAL_MIB_STATS_EVENTID) + OP(WMI_UPDATE_WHAL_MIB_STATS_EVENTID) \ + OP(WMI_IFACE_LINK_STATS_EVENTID) \ + OP(WMI_PEER_LINK_STATS_EVENTID) \ + OP(WMI_RADIO_LINK_STATS_EVENTID) /* TLV definitions of WMI commands */ @@ -1048,6 +1066,24 @@ WMITLV_CREATE_PARAM_STRUC(WMI_VDEV_SPECTRAL_SCAN_ENABLE_CMDID); WMITLV_CREATE_PARAM_STRUC(WMI_REQUEST_STATS_CMDID); +/* Set config params */ +#define WMITLV_TABLE_WMI_START_LINK_STATS_CMDID(id,op,buf,len) \ + WMITLV_ELEM(id,op,buf,len, WMITLV_TAG_STRUC_wmi_start_link_stats_cmd_fixed_param, wmi_start_link_stats_cmd_fixed_param, fixed_param, WMITLV_SIZE_FIX) + +WMITLV_CREATE_PARAM_STRUC(WMI_START_LINK_STATS_CMDID); + +/* Request to clear link stats */ +#define WMITLV_TABLE_WMI_CLEAR_LINK_STATS_CMDID(id,op,buf,len) \ + WMITLV_ELEM(id,op,buf,len, WMITLV_TAG_STRUC_wmi_clear_link_stats_cmd_fixed_param, wmi_clear_link_stats_cmd_fixed_param, fixed_param, WMITLV_SIZE_FIX) + +WMITLV_CREATE_PARAM_STRUC(WMI_CLEAR_LINK_STATS_CMDID); + +/* Request Link stats Cmd */ +#define WMITLV_TABLE_WMI_REQUEST_LINK_STATS_CMDID(id,op,buf,len) \ + WMITLV_ELEM(id,op,buf,len, WMITLV_TAG_STRUC_wmi_request_link_stats_cmd_fixed_param, wmi_request_link_stats_cmd_fixed_param, fixed_param, WMITLV_SIZE_FIX) + +WMITLV_CREATE_PARAM_STRUC(WMI_REQUEST_LINK_STATS_CMDID); + /* Netwrok list offload config Cmd */ #define WMITLV_TABLE_WMI_NETWORK_LIST_OFFLOAD_CONFIG_CMDID(id,op,buf,len) \ WMITLV_ELEM(id,op,buf,len, WMITLV_TAG_STRUC_wmi_nlo_config_cmd_fixed_param, wmi_nlo_config_cmd_fixed_param, fixed_param, WMITLV_SIZE_FIX) \ @@ -1864,6 +1900,30 @@ WMITLV_CREATE_PARAM_STRUC(WMI_HOST_SWBA_EVENTID); WMITLV_ELEM(id,op,buf,len, WMITLV_TAG_ARRAY_BYTE, A_UINT8, data, WMITLV_SIZE_VAR) WMITLV_CREATE_PARAM_STRUC(WMI_UPDATE_STATS_EVENTID); +/* Update iface link stats Event */ +#define WMITLV_TABLE_WMI_IFACE_LINK_STATS_EVENTID(id,op,buf,len)\ + WMITLV_ELEM(id,op,buf,len, WMITLV_TAG_STRUC_wmi_iface_link_stats_event_fixed_param, wmi_iface_link_stats_event_fixed_param, fixed_param, WMITLV_SIZE_FIX) \ + WMITLV_ELEM(id,op,buf,len, WMITLV_TAG_ARRAY_STRUC, wmi_iface_link_stats, iface_link_stats, WMITLV_SIZE_VAR) \ + WMITLV_ELEM(id,op,buf,len, WMITLV_TAG_ARRAY_STRUC, wmi_wmm_ac_stats, ac, WMITLV_SIZE_VAR) + +WMITLV_CREATE_PARAM_STRUC(WMI_IFACE_LINK_STATS_EVENTID); + +/* Update Peer link stats Event */ +#define WMITLV_TABLE_WMI_PEER_LINK_STATS_EVENTID(id,op,buf,len)\ + WMITLV_ELEM(id,op,buf,len, WMITLV_TAG_STRUC_wmi_peer_stats_event_fixed_param, wmi_peer_stats_event_fixed_param, fixed_param, WMITLV_SIZE_FIX) \ + WMITLV_ELEM(id,op,buf,len, WMITLV_TAG_ARRAY_STRUC, wmi_peer_link_stats, peer_stats, WMITLV_SIZE_VAR) \ + WMITLV_ELEM(id,op,buf,len, WMITLV_TAG_ARRAY_STRUC, wmi_rate_stats, peer_rate_stats, WMITLV_SIZE_VAR) + +WMITLV_CREATE_PARAM_STRUC(WMI_PEER_LINK_STATS_EVENTID); + +/* Update radio stats Event */ +#define WMITLV_TABLE_WMI_RADIO_LINK_STATS_EVENTID(id,op,buf,len)\ + WMITLV_ELEM(id,op,buf,len, WMITLV_TAG_STRUC_wmi_radio_link_stats_event_fixed_param, wmi_radio_link_stats_event_fixed_param, fixed_param, WMITLV_SIZE_FIX) \ + WMITLV_ELEM(id,op,buf,len, WMITLV_TAG_ARRAY_STRUC, wmi_radio_link_stats, radio_stats, WMITLV_SIZE_VAR)\ + WMITLV_ELEM(id,op,buf,len, WMITLV_TAG_ARRAY_STRUC, wmi_channel_stats, channel_stats, WMITLV_SIZE_VAR) + +WMITLV_CREATE_PARAM_STRUC(WMI_RADIO_LINK_STATS_EVENTID); + /* PDEV QVIT Event */ #define WMITLV_TABLE_WMI_PDEV_QVIT_EVENTID(id,op,buf,len)\ WMITLV_ELEM(id,op,buf,len, WMITLV_TAG_ARRAY_BYTE, A_UINT8, data, WMITLV_SIZE_VAR) diff --git a/CORE/SERVICES/COMMON/wmi_unified.h b/CORE/SERVICES/COMMON/wmi_unified.h index 83ee2bcd45c5..bd5496b00d4b 100644 --- a/CORE/SERVICES/COMMON/wmi_unified.h +++ b/CORE/SERVICES/COMMON/wmi_unified.h @@ -461,6 +461,14 @@ typedef enum { /** one time request for txrx stats */ WMI_REQUEST_STATS_EXT_CMDID, + /* Link Layer stats */ + /** Request for link layer stats */ + WMI_REQUEST_LINK_STATS_CMDID, + /** Request for setting params to link layer stats */ + WMI_START_LINK_STATS_CMDID, + /** Request to clear stats*/ + WMI_CLEAR_LINK_STATS_CMDID, + /** ARP OFFLOAD REQUEST*/ WMI_SET_ARP_NS_OFFLOAD_CMDID=WMI_CMD_GRP_START_ID(WMI_GRP_ARP_NS_OFL), @@ -747,6 +755,12 @@ typedef enum { /*STATS specific events*/ /** txrx stats event requested by host */ WMI_STATS_EXT_EVENTID = WMI_EVT_GRP_START_ID(WMI_GRP_STATS), + /** FW iface link stats Event */ + WMI_IFACE_LINK_STATS_EVENTID, + /** FW iface peer link stats Event */ + WMI_PEER_LINK_STATS_EVENTID, + /** FW Update radio stats Event */ + WMI_RADIO_LINK_STATS_EVENTID, /*NLO specific events*/ /** NLO match event after the first match */ @@ -2586,6 +2600,324 @@ typedef struct { wmi_mac_addr peer_macaddr; } wmi_request_stats_cmd_fixed_param; +/* stats type bitmap */ +#define WMI_LINK_STATS_RADIO 0x00000001 +#define WMI_LINK_STATS_IFACE 0x00000002 +#define WMI_LINK_STATS_ALL_PEER 0x00000004 +#define WMI_LINK_STATS_PER_PEER 0x00000008 + + +/* wifi clear statistics bitmap */ +#define WIFI_STATS_RADIO 0x00000001 /** all radio statistics */ +#define WIFI_STATS_RADIO_CCA 0x00000002 /** cca_busy_time (within radio statistics) */ +#define WIFI_STATS_RADIO_CHANNELS 0x00000004 /** all channel statistics (within radio statistics) */ +#define WIFI_STATS_RADIO_SCAN 0x00000008 /** all scan statistics (within radio statistics) */ +#define WIFI_STATS_IFACE 0x00000010 /** all interface statistics */ +#define WIFI_STATS_IFACE_TXRATE 0x00000020 /** all tx rate statistics (within interface statistics) */ +#define WIFI_STATS_IFACE_AC 0x00000040 /** all ac statistics (within interface statistics) */ +#define WIFI_STATS_IFACE_CONTENTION 0x00000080 /** all contention (min, max, avg) statistics (within ac statisctics) */ +#define WMI_STATS_IFACE_ALL_PEER 0x00000100 /** All peer stats on this interface */ +#define WMI_STATS_IFACE_PER_PEER 0x00000200 /** Clear particular peer stats depending on the peer_mac */ + +/** Default value for stats if the stats collection has not started */ +#define WMI_STATS_VALUE_INVALID 0xffffffff + +typedef enum { + WMI_ROAMING_IDLE = 0, + WMI_ROAMING_ACTIVE = 1, +} wmi_roam_state; + +/* access categories */ +typedef enum { + WMI_AC_VO = 0, + WMI_AC_VI = 1, + WMI_AC_BE = 2, + WMI_AC_BK = 3, + WMI_AC_MAX = 4, +} wmi_traffic_ac; + +typedef enum { + WMI_STA_STATS = 0, + WMI_SOFTAP_STATS = 1, + WMI_IBSS_STATS = 2, + WMI_P2P_CLIENT_STATS = 3, + WMI_P2P_GO_STATS = 4, + WMI_NAN_STATS = 5, + WMI_MESH_STATS = 6, +} wmi_link_iface_type; + +/* channel operating width */ +typedef enum { + WMI_CHAN_WIDTH_20 = 0, + WMI_CHAN_WIDTH_40 = 1, + WMI_CHAN_WIDTH_80 = 2, + WMI_CHAN_WIDTH_160 = 3, + WMI_CHAN_WIDTH_80P80 = 4, + WMI_CHAN_WIDTH_5 = 5, + WMI_CHAN_WIDTH_10 = 6, +} wmi_channel_width; + +/* wifi peer type */ +typedef enum { + WMI_PEER_STA, + WMI_PEER_AP, + WMI_PEER_P2P_GO, + WMI_PEER_P2P_CLIENT, + WMI_PEER_NAN, + WMI_PEER_TDLS, + WMI_PEER_INVALID, +} wmi_peer_type; + +/*Clear stats*/ +typedef struct { + A_UINT32 tlv_header; /** TLV tag and len; tag equals WMITLV_TAG_STRUC_wmi_clear_link_stats_cmd_fixed_param */ + /** unique id identifying the VDEV, generated by the caller */ + A_UINT32 vdev_id; + /** stop_stats_collection_req = 1 will imply stop the statistics collection */ + A_UINT32 stop_stats_collection_req; + /** identifies what stats to be cleared */ + A_UINT32 stats_clear_req_mask; + /** identifies which peer stats to be cleared. Valid only while clearing PER_REER */ + wmi_mac_addr peer_macaddr; +} wmi_clear_link_stats_cmd_fixed_param; + +/* Link Stats configuration params. Trigger the link layer statistics collection*/ +typedef struct { + A_UINT32 tlv_header; /** TLV tag and len; tag equals WMITLV_TAG_STRUC_wmi_start_link_stats_cmd_fixed_param */ + /** threshold to classify the pkts as short or long */ + A_UINT32 mpdu_size_threshold; + /** set for field debug mode. Driver should collect all statistics regardless of performance impact.*/ + A_UINT32 aggressive_statistics_gathering; +} wmi_start_link_stats_cmd_fixed_param; + +typedef struct { + A_UINT32 tlv_header; /** TLV tag and len; tag equals WMITLV_TAG_STRUC_wmi_request_link_stats_cmd_fixed_param */ + /** Type of stats required. This is a bitmask WMI_LINK_STATS_RADIO, WMI_LINK_STATS_IFACE */ + A_UINT32 stats_type; + /** unique id identifying the VDEV, generated by the caller */ + A_UINT32 vdev_id; + /** unique id identifying the request, generated by the caller */ + A_UINT32 request_id; + /** peer MAC address */ + wmi_mac_addr peer_macaddr; +} wmi_request_link_stats_cmd_fixed_param; + +/* channel statistics */ +typedef struct { + A_UINT32 tlv_header; /** TLV tag and len; tag equals WMITLV_TAG_STRUC_wmi_channel_stats */ + /** Channel width (20, 40, 80, 80+80, 160) enum wmi_channel_width*/ + A_UINT32 channel_width; + /** Primary 20 MHz channel */ + A_UINT32 center_freq; + /** center frequency (MHz) first segment */ + A_UINT32 center_freq0; + /** center frequency (MHz) second segment */ + A_UINT32 center_freq1; + /** msecs the radio is awake (32 bits number accruing over time) */ + A_UINT32 radio_awake_time; + /** msecs the CCA register is busy (32 bits number accruing over time) */ + A_UINT32 cca_busy_time; +} wmi_channel_stats; + +/* radio statistics */ +typedef struct { + A_UINT32 tlv_header; /** TLV tag and len; tag equals WMITLV_TAG_STRUC_wmi_radio_link_stats */ + /** Wifi radio (if multiple radio supported) */ + A_UINT32 radio_id; + /** msecs the radio is awake (32 bits number accruing over time) */ + A_UINT32 on_time; + /** msecs the radio is transmitting (32 bits number accruing over time) */ + A_UINT32 tx_time; + /** msecs the radio is in active receive (32 bits number accruing over time) */ + A_UINT32 rx_time; + /** msecs the radio is awake due to all scan (32 bits number accruing over time) */ + A_UINT32 on_time_scan; + /** msecs the radio is awake due to NAN (32 bits number accruing over time) */ + A_UINT32 on_time_nbd; + /** msecs the radio is awake due to G?scan (32 bits number accruing over time) */ + A_UINT32 on_time_gscan; + /** msecs the radio is awake due to roam?scan (32 bits number accruing over time) */ + A_UINT32 on_time_roam_scan; + /** msecs the radio is awake due to PNO scan (32 bits number accruing over time) */ + A_UINT32 on_time_pno_scan; + /** msecs the radio is awake due to HS2.0 scans and GAS exchange (32 bits number accruing over time) */ + A_UINT32 on_time_hs20; + /** number of channels */ + A_UINT32 num_channels; +} wmi_radio_link_stats; + +/** Radio statistics (once started) do not stop or get reset unless wifi_clear_link_stats is invoked */ +typedef struct { + A_UINT32 tlv_header; /* TLV tag and len; tag equals WMITLV_TAG_STRUC_wmi_stats_event_fixed_param */ + /** unique id identifying the request, given in the request stats command */ + A_UINT32 request_id; + /** Number of radios*/ + A_UINT32 num_radio; + /** more_data will be set depending on the number of radios */ + A_UINT32 more_radio_events; +/* + * This TLV is followed by another TLV of array of bytes + * size of(struct wmi_radio_link_stats); + * + * This TLV is followed by another TLV of array of bytes + * num_channels * size of(struct wmi_channel_stats) + */ + +} wmi_radio_link_stats_event_fixed_param; + +/* per rate statistics */ +typedef struct { + A_UINT32 tlv_header; /* TLV tag and len; tag equals WMITLV_TAG_STRUC_wmi_rate_stats */ + /** rate information + * The rate-code is a 1-byte field in which:for given rate, nss and preamble + * b'7-b-6 indicate the preamble (0 OFDM, 1 CCK, 2, HT, 3 VHT) + * b'5-b'4 indicate the NSS (0 - 1x1, 1 - 2x2, 2 - 3x3) + * b'3-b'0 indicate the rate, which is indicated as follows: + * OFDM : 0: OFDM 48 Mbps + * 1: OFDM 24 Mbps + * 2: OFDM 12 Mbps + * 3: OFDM 6 Mbps + * 4: OFDM 54 Mbps + * 5: OFDM 36 Mbps + * 6: OFDM 18 Mbps + * 7: OFDM 9 Mbps + * CCK (pream == 1) + * 0: CCK 11 Mbps Long + * 1: CCK 5.5 Mbps Long + * 2: CCK 2 Mbps Long + * 3: CCK 1 Mbps Long + * 4: CCK 11 Mbps Short + * 5: CCK 5.5 Mbps Short + * 6: CCK 2 Mbps Short + * HT/VHT (pream == 2/3) + * 0..7: MCS0..MCS7 (HT) + * 0..9: MCS0..MCS9 (VHT) + */ + A_UINT32 rate; + /** units of 100 Kbps */ + A_UINT32 bitrate; + /** number of successfully transmitted data pkts (ACK rcvd) */ + A_UINT32 tx_mpdu; + /** number of received data pkts */ + A_UINT32 rx_mpdu; + /** number of data packet losses (no ACK) */ + A_UINT32 mpdu_lost; + /** total number of data pkt retries */ + A_UINT32 retries; + /** number of short data pkt retries */ + A_UINT32 retries_short; + /** number of long data pkt retries */ + A_UINT32 retries_long; +} wmi_rate_stats; + +typedef struct { + A_UINT32 tlv_header; /* TLV tag and len; tag equals WMITLV_TAG_STRUC_wmi_peer_link_stats */ + /** peer type (AP, TDLS, GO etc.) enum wmi_peer_type*/ + A_UINT32 peer_type; + /** mac address */ + wmi_mac_addr peer_mac_address; + /** peer wmi_CAPABILITY_XXX */ + A_UINT32 capabilities; + /** number of rates */ + A_UINT32 num_rates; +} wmi_peer_link_stats; + +/** PEER statistics (once started) reset and start afresh after each connection */ +typedef struct { + A_UINT32 tlv_header; /* TLV tag and len; tag equals WMITLV_TAG_STRUC_wmi_peer_stats_event_fixed_param */ + /** unique id identifying the request, given in the request stats command */ + A_UINT32 request_id; + /** number of peers accomidated in this particular event */ + A_UINT32 num_peers; + /** Indicates the fragment number */ + A_UINT32 peer_event_number; + /** Indicates if there are more peers which will be sent as seperate peer_stats event */ + A_UINT32 more_data; + +/** + * This TLV is followed by another TLV + * num_peers * size of(struct wmi_peer_stats) + * num_rates * size of(struct wmi_rate_stats). num_rates is the sum of the rates of all the peers. + */ +} wmi_peer_stats_event_fixed_param; + +/* per access category statistics */ +typedef struct { + A_UINT32 tlv_header; /* TLV tag and len; tag equals WMITLV_TAG_STRUC_wmi_wmm_ac_stats */ + /** access category (VI, VO, BE, BK) enum wmi_traffic_ac*/ + A_UINT32 ac_type; + /** number of successfully transmitted unicast data pkts (ACK rcvd) */ + A_UINT32 tx_mpdu; + /** number of received unicast mpdus */ + A_UINT32 rx_mpdu; + /** number of succesfully transmitted multicast data packets */ + /** STA case: implies ACK received from AP for the unicast packet in which mcast pkt was sent */ + A_UINT32 tx_mcast; + /** number of received multicast data packets */ + A_UINT32 rx_mcast; + /** number of received unicast a-mpdus */ + A_UINT32 rx_ampdu; + /** number of transmitted unicast a-mpdus */ + A_UINT32 tx_ampdu; + /** number of data pkt losses (no ACK) */ + A_UINT32 mpdu_lost; + /** total number of data pkt retries */ + A_UINT32 retries; + /** number of short data pkt retries */ + A_UINT32 retries_short; + /** number of long data pkt retries */ + A_UINT32 retries_long; + /** data pkt min contention time (usecs) */ + A_UINT32 contention_time_min; + /** data pkt max contention time (usecs) */ + A_UINT32 contention_time_max; + /** data pkt avg contention time (usecs) */ + A_UINT32 contention_time_avg; + /** num of data pkts used for contention statistics */ + A_UINT32 contention_num_samples; +} wmi_wmm_ac_stats; + +/* interface statistics */ +typedef struct { + A_UINT32 tlv_header; /* TLV tag and len; tag equals WMITLV_TAG_STRUC_wmi_iface_link_stats */ + /** access point beacon received count from connected AP */ + A_UINT32 beacon_rx; + /** access point mgmt frames received count from connected AP (including Beacon) */ + A_UINT32 mgmt_rx; + /** action frames received count */ + A_UINT32 mgmt_action_rx; + /** action frames transmit count */ + A_UINT32 mgmt_action_tx; + /** access Point Beacon and Management frames RSSI (averaged) */ + A_UINT32 rssi_mgmt; + /** access Point Data Frames RSSI (averaged) from connected AP */ + A_UINT32 rssi_data; + /** access Point ACK RSSI (averaged) from connected AP */ + A_UINT32 rssi_ack; + /** number of peers */ + A_UINT32 num_peers; + /** Indicates how many peer_stats events will be sent depending on the num_peers. */ + A_UINT32 num_peer_events; + /** number of ac */ + A_UINT32 num_ac; + /** Roaming Stat */ + A_UINT32 roam_state; +} wmi_iface_link_stats; + +/** Interface statistics (once started) reset and start afresh after each connection */ +typedef struct { + A_UINT32 tlv_header; /* TLV tag and len; tag equals WMITLV_TAG_STRUC_wmi_iface_link_stats_event_fixed_param */ + /** unique id identifying the request, given in the request stats command */ + A_UINT32 request_id; + /** unique id identifying the VDEV, generated by the caller */ + A_UINT32 vdev_id; +/* + * This TLV is followed by another TLV + * wmi_iface_link_stats iface_link_stats; + * num_ac * size of(struct wmi_wmm_ac_stats) + */ +} wmi_iface_link_stats_event_fixed_param; + /** Suspend option */ enum { WMI_PDEV_SUSPEND, /* suspend */ diff --git a/CORE/SERVICES/COMMON/wmi_version.h b/CORE/SERVICES/COMMON/wmi_version.h index 4e0f20f6b2b7..4f1dda5052ad 100644 --- a/CORE/SERVICES/COMMON/wmi_version.h +++ b/CORE/SERVICES/COMMON/wmi_version.h @@ -36,7 +36,7 @@ #define __WMI_VER_MINOR_ 0 /** WMI revision number has to be incremented when there is a * change that may or may not break compatibility. */ -#define __WMI_REVISION_ 50 +#define __WMI_REVISION_ 51 /** The Version Namespace should not be normally changed. Only * host and firmware of the same WMI namespace will work diff --git a/CORE/SERVICES/WMI/wmi_unified.c b/CORE/SERVICES/WMI/wmi_unified.c index 20101b600d01..9ba48a9edc47 100644 --- a/CORE/SERVICES/WMI/wmi_unified.c +++ b/CORE/SERVICES/WMI/wmi_unified.c @@ -534,6 +534,9 @@ static u_int8_t* get_wmi_cmd_string(WMI_CMD_ID wmi_command) CASE_RETURN_STRING(WMI_WOW_ACER_IOAC_DEL_KEEPALIVE_CMDID); CASE_RETURN_STRING(WMI_WOW_ACER_IOAC_ADD_WAKE_PATTERN_CMDID); CASE_RETURN_STRING(WMI_WOW_ACER_IOAC_DEL_WAKE_PATTERN_CMDID); + CASE_RETURN_STRING(WMI_REQUEST_LINK_STATS_CMDID); + CASE_RETURN_STRING(WMI_START_LINK_STATS_CMDID); + CASE_RETURN_STRING(WMI_CLEAR_LINK_STATS_CMDID); } return "Invalid WMI cmd"; } -- cgit v1.2.3 From f4878f137bddc23bff4a0a747fcfffd41a989312 Mon Sep 17 00:00:00 2001 From: "Chandrasekaran, Manishekar" Date: Tue, 10 Jun 2014 11:13:20 +0530 Subject: qcacld: Logging improvement for p2p action frames Currently, only the sending and receiving of action frames are available in the default prints. But they do not indicate the peer's address. This fix adds the peers MAC address in the default prints. This will help to debug if the action frames are sent to and received from the right peer. Change-Id: Ia09092c3cccd52bd1a761a13ceecd3bb757ffcd0 CRs-Fixed: 677883 --- CORE/HDD/src/wlan_hdd_p2p.c | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/CORE/HDD/src/wlan_hdd_p2p.c b/CORE/HDD/src/wlan_hdd_p2p.c index 063e5a210da3..91dd27ce3a68 100644 --- a/CORE/HDD/src/wlan_hdd_p2p.c +++ b/CORE/HDD/src/wlan_hdd_p2p.c @@ -1007,13 +1007,15 @@ int wlan_hdd_mgmt_tx( struct wiphy *wiphy, struct net_device *dev, actionFrmType = buf[WLAN_HDD_PUBLIC_ACTION_FRAME_TYPE_OFFSET]; if(actionFrmType >= MAX_P2P_ACTION_FRAME_TYPE) { - hddLog(VOS_TRACE_LEVEL_ERROR,"[P2P] unknown[%d] ---> OTA", - actionFrmType); + hddLog(VOS_TRACE_LEVEL_ERROR,"[P2P] unknown[%d] ---> OTA to " + MAC_ADDRESS_STR, actionFrmType, + MAC_ADDR_ARRAY(&buf[WLAN_HDD_80211_FRM_DA_OFFSET])); } else { - hddLog(VOS_TRACE_LEVEL_ERROR,"[P2P] %s ---> OTA", - p2p_action_frame_type[actionFrmType]); + hddLog(VOS_TRACE_LEVEL_ERROR,"[P2P] %s ---> OTA to " + MAC_ADDRESS_STR, p2p_action_frame_type[actionFrmType], + MAC_ADDR_ARRAY(&buf[WLAN_HDD_80211_FRM_DA_OFFSET])); if( (actionFrmType == WLAN_HDD_PROV_DIS_REQ) && (globalP2PConnectionStatus == P2P_NOT_ACTIVE) ) { @@ -1952,18 +1954,22 @@ void hdd_indicateMgmtFrame( hdd_adapter_t *pAdapter, vos_mem_compare(&pbFrames[WLAN_HDD_PUBLIC_ACTION_FRAME_OFFSET+2], SIR_MAC_P2P_OUI, SIR_MAC_P2P_OUI_SIZE)) // P2P action frames { + u8 *macFrom = &pbFrames[WLAN_HDD_80211_FRM_DA_OFFSET+6]; actionFrmType = pbFrames[WLAN_HDD_PUBLIC_ACTION_FRAME_TYPE_OFFSET]; hddLog(LOG1, "Rx Action Frame %u", actionFrmType); #ifdef WLAN_FEATURE_P2P_DEBUG if(actionFrmType >= MAX_P2P_ACTION_FRAME_TYPE) { - hddLog(VOS_TRACE_LEVEL_ERROR,"[P2P] unknown[%d] <--- OTA", - actionFrmType); + hddLog(VOS_TRACE_LEVEL_ERROR,"[P2P] unknown[%d] <--- OTA" + " from " MAC_ADDRESS_STR, actionFrmType, + MAC_ADDR_ARRAY(macFrom)); } else { - hddLog(VOS_TRACE_LEVEL_ERROR,"[P2P] %s <--- OTA", - p2p_action_frame_type[actionFrmType]); + hddLog(VOS_TRACE_LEVEL_ERROR,"[P2P] %s <--- OTA" + " from " MAC_ADDRESS_STR, + p2p_action_frame_type[actionFrmType], + MAC_ADDR_ARRAY(macFrom)); if( (actionFrmType == WLAN_HDD_PROV_DIS_REQ) && (globalP2PConnectionStatus == P2P_NOT_ACTIVE) ) { -- cgit v1.2.3 From 382d1ead4bcad4b90ab179259ee5feabbfca8a75 Mon Sep 17 00:00:00 2001 From: Mahesh A Saptasagar Date: Mon, 2 Jun 2014 21:46:23 +0530 Subject: wlan: Protect suspend and resume cfg80211 ops functions from SSR Protect wlan_suspend and wlan_resume cfg80211 ops functions from accessing deallocated/unitialized data structures while SSR is in progress. Change-Id: If607798b8bc058185bccf2f9e7ef27c883deb36d CRs-Fixed: 675456 --- CORE/HDD/src/wlan_hdd_cfg80211.c | 30 ++++++++++++++++++++++++++---- 1 file changed, 26 insertions(+), 4 deletions(-) diff --git a/CORE/HDD/src/wlan_hdd_cfg80211.c b/CORE/HDD/src/wlan_hdd_cfg80211.c index 9fa9b1aceac7..baa54d8b019a 100644 --- a/CORE/HDD/src/wlan_hdd_cfg80211.c +++ b/CORE/HDD/src/wlan_hdd_cfg80211.c @@ -10664,11 +10664,11 @@ static int wlan_hdd_cfg80211_dump_survey(struct wiphy *wiphy, } /* - * FUNCTION: wlan_hdd_cfg80211_resume_wlan + * FUNCTION: __wlan_hdd_cfg80211_resume_wlan * this is called when cfg80211 driver resume * driver updates latest sched_scan scan result(if any) to cfg80211 database */ -int wlan_hdd_cfg80211_resume_wlan(struct wiphy *wiphy) +int __wlan_hdd_cfg80211_resume_wlan(struct wiphy *wiphy) { hdd_context_t *pHddCtx = wiphy_priv(wiphy); hdd_adapter_t *pAdapter; @@ -10775,11 +10775,22 @@ void wlan_hdd_cfg80211_ready_to_suspend(void *callbackContext, boolean suspended } #endif +int wlan_hdd_cfg80211_resume_wlan(struct wiphy *wiphy) +{ + int ret; + + vos_ssr_protect(__func__); + ret = __wlan_hdd_cfg80211_resume_wlan(wiphy); + vos_ssr_unprotect(__func__); + + return ret; +} + /* - * FUNCTION: wlan_hdd_cfg80211_suspend_wlan + * FUNCTION: __wlan_hdd_cfg80211_suspend_wlan * this is called when cfg80211 driver suspends */ -int wlan_hdd_cfg80211_suspend_wlan(struct wiphy *wiphy, +int __wlan_hdd_cfg80211_suspend_wlan(struct wiphy *wiphy, struct cfg80211_wowlan *wow) { #ifdef QCA_CONFIG_SMP @@ -10921,6 +10932,17 @@ resume_tx: } +int wlan_hdd_cfg80211_suspend_wlan(struct wiphy *wiphy, + struct cfg80211_wowlan *wow) +{ + int ret; + + vos_ssr_protect(__func__); + ret = __wlan_hdd_cfg80211_suspend_wlan(wiphy, wow); + vos_ssr_unprotect(__func__); + + return ret; +} /* cfg80211_ops */ static struct cfg80211_ops wlan_hdd_cfg80211_ops = { -- cgit v1.2.3 From a84fbcc1205cc5c5ac83f5c6f3955caad906decd Mon Sep 17 00:00:00 2001 From: Naveen Rawat Date: Thu, 5 Jun 2014 14:33:52 -0700 Subject: qcacld: Fix for scan list getting empty Roaming scan being high priority will preempt low priority scan issued from GUI. Current implementation of host will abort the scan when it receives PREEMPT event from firmware. Firmware is capable of restarting the suspended low priority scan, so following changes are done: 1) Host should ignore both scan PREEMPT and scan RESTART events. 2) But in case better AP event has come from firmware, that needs to be processed with prority, so cancel the existing scan on reception of better AP event. 3) Also whatever the status of scan returned from firmware, host should always send success status so that existing resutls in LIM cache can be returned to host side. CRs-Fixed: 676924 Change-Id: I1cd8e775d994a904c22ec96266c13233bfa9a1a0 --- CORE/SERVICES/WMA/wma.c | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/CORE/SERVICES/WMA/wma.c b/CORE/SERVICES/WMA/wma.c index 4e8d01e86763..a070d55ad145 100644 --- a/CORE/SERVICES/WMA/wma.c +++ b/CORE/SERVICES/WMA/wma.c @@ -17485,6 +17485,12 @@ static int wma_scan_event_callback(WMA_HANDLE handle, u_int8_t *data, switch (wmi_event->event) { case WMI_SCAN_EVENT_COMPLETED: + /* + * return success always so that SME can pick whatever scan + * results is available in scan cache(due to partial or + * aborted scan) + */ + scan_event->reasonCode = eSIR_SME_SUCCESS; if (wmi_event->scan_id == scan_id) wma_reset_scan_info(wma_handle, vdev_id); else @@ -17495,14 +17501,10 @@ static int wma_scan_event_callback(WMA_HANDLE handle, u_int8_t *data, scan_event->reasonCode = eSIR_SME_SCAN_FAILED; break; case WMI_SCAN_EVENT_PREEMPTED: - { - tAbortScanParams abortScan; - abortScan.SessionId = vdev_id; - wma_stop_scan(wma_handle, &abortScan); + WMA_LOGW("%s: Unhandled Scan Event WMI_SCAN_EVENT_PREEMPTED", __func__); break; - } case WMI_SCAN_EVENT_RESTARTED: - WMA_LOGW("%s: Unexpected Scan Event %u", __func__, wmi_event->event); + WMA_LOGW("%s: Unhandled Scan Event WMI_SCAN_EVENT_RESTARTED", __func__); break; } @@ -17730,6 +17732,12 @@ static VOS_STATUS wma_tx_detach(tp_wma_handle wma_handle) static void wma_roam_better_ap_handler(tp_wma_handle wma, u_int32_t vdev_id) { VOS_STATUS ret; + /* abort existing scan if any */ + if (wma->interfaces[vdev_id].scan_info.scan_id != 0) { + tAbortScanParams abortScan; + abortScan.SessionId = vdev_id; + wma_stop_scan(wma, &abortScan); + } ret = tlshim_mgmt_roam_event_ind(wma->vos_context, vdev_id); } -- cgit v1.2.3 From 9845815edf25461020f0ec53eae8a7d0e8ac7d62 Mon Sep 17 00:00:00 2001 From: Randy Chiu Date: Wed, 11 Jun 2014 19:16:36 +0800 Subject: qcacld:[HIF] U1/U2 setting fail with lpm enable U1/U2 setting fail is due to that target is not ready after warm reset. It needs to wait about 200ms for target ready and host can set U1/U2 successfully after that. Change-Id: Ia615c4f9e2ef419ac5b2c6a6f65aec17f853c745 Crs-Fixed: 678669 --- CORE/SERVICES/HIF/USB/if_usb.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CORE/SERVICES/HIF/USB/if_usb.c b/CORE/SERVICES/HIF/USB/if_usb.c index 579fe1c6f011..4cd2c193e591 100644 --- a/CORE/SERVICES/HIF/USB/if_usb.c +++ b/CORE/SERVICES/HIF/USB/if_usb.c @@ -52,6 +52,7 @@ #define VENDOR_ATHR 0x0CF3 #define AR9888_DEVICE_ID (0x003c) #define AR6320_DEVICE_ID (0x003e) +#define DELAY_FOR_TARGET_READY 200 /* 200ms */ unsigned int msienable; module_param(msienable, int, 0644); @@ -229,6 +230,10 @@ static void hif_usb_remove(struct usb_interface *interface) return; HIFDiagWriteWARMRESET(interface, 0, 0); + /* wait for target jump to boot code and finish the initialization */ + set_current_state(TASK_INTERRUPTIBLE); + schedule_timeout(msecs_to_jiffies(DELAY_FOR_TARGET_READY)); + set_current_state(TASK_RUNNING); if (usb_sc->local_state.event != 0) { hif_usb_resume(usb_sc->interface); usb_sc->local_state.event = 0; -- cgit v1.2.3 From 39ed04f6865c397d938246d119bf701f21d3bd8d Mon Sep 17 00:00:00 2001 From: Pitani Venkata Rajesh Kumar Date: Thu, 12 Jun 2014 13:16:20 +0530 Subject: Cafstaging Release 1.0.0.125 Cafstaging Release 1.0.0.125 Change-Id: I983e6396581aae57ee6a6726271b5936162d5e11 CRs-Fixed: 679230 --- 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 cf042dd9e7f0..0280db93914b 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 124 +#define QWLAN_VERSION_BUILD 125 -#define QWLAN_VERSIONSTR "1.0.0.124" +#define QWLAN_VERSIONSTR "1.0.0.125" #ifdef QCA_WIFI_2_0 -- cgit v1.2.3