diff options
| author | Linux Build Service Account <lnxbuild@localhost> | 2014-04-24 06:11:20 -0700 |
|---|---|---|
| committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2014-04-24 06:11:20 -0700 |
| commit | 89aa83e57a7998e30199a2b6c45057d5ddf4d015 (patch) | |
| tree | 76762e91468d91ac0cf96135d5f9d78a86a05bad | |
| parent | d12bdf22113b954d7632f14f4b404062af863af4 (diff) | |
| parent | 097c31d5ab4e9cca2589f0890d6c311b0e6fc71c (diff) | |
Merge "Release 1.0.0.98 QCACLD WLAN Driver"
| -rw-r--r-- | CORE/HDD/inc/wlan_hdd_ftm.h | 1 | ||||
| -rw-r--r-- | CORE/HDD/src/wlan_hdd_cfg.c | 1 | ||||
| -rw-r--r-- | CORE/HDD/src/wlan_hdd_cfg80211.c | 179 | ||||
| -rw-r--r-- | CORE/HDD/src/wlan_hdd_dev_pwr.c | 19 | ||||
| -rw-r--r-- | CORE/HDD/src/wlan_hdd_ftm.c | 172 | ||||
| -rw-r--r-- | CORE/HDD/src/wlan_hdd_main.c | 172 | ||||
| -rw-r--r-- | CORE/HDD/src/wlan_hdd_oemdata.c | 46 | ||||
| -rw-r--r-- | CORE/MAC/inc/qwlan_version.h | 4 | ||||
| -rw-r--r-- | CORE/MAC/src/pe/lim/limAssocUtils.c | 1 | ||||
| -rw-r--r-- | CORE/MAC/src/pe/lim/limProcessTdls.c | 16 | ||||
| -rw-r--r-- | CORE/SERVICES/COMMON/hif.h | 8 | ||||
| -rw-r--r-- | CORE/SERVICES/HIF/PCIe/copy_engine.c | 15 | ||||
| -rw-r--r-- | CORE/SERVICES/HIF/USB/if_usb.c | 2 | ||||
| -rw-r--r-- | CORE/SERVICES/WMA/wma.c | 15 | ||||
| -rw-r--r-- | CORE/SME/src/sme_common/sme_Api.c | 24 | ||||
| -rw-r--r-- | CORE/VOSS/src/vos_trace.c | 2 | ||||
| -rwxr-xr-x | firmware_bin/WCNSS_qcom_cfg.ini | 2 |
17 files changed, 533 insertions, 146 deletions
diff --git a/CORE/HDD/inc/wlan_hdd_ftm.h b/CORE/HDD/inc/wlan_hdd_ftm.h index 44b16eccbdf2..b1758be7e28a 100644 --- a/CORE/HDD/inc/wlan_hdd_ftm.h +++ b/CORE/HDD/inc/wlan_hdd_ftm.h @@ -215,6 +215,7 @@ int wlan_hdd_ftm_close(hdd_context_t *pHddCtx); #if defined(QCA_WIFI_2_0) && defined(QCA_WIFI_FTM) \ && !defined(QCA_WIFI_ISOC) VOS_STATUS wlan_hdd_ftm_testmode_cmd(void *data, int len); +int wlan_hdd_qcmbr_unified_ioctl(hdd_adapter_t *pAdapter, struct ifreq *ifr); #endif #endif diff --git a/CORE/HDD/src/wlan_hdd_cfg.c b/CORE/HDD/src/wlan_hdd_cfg.c index 639b7b2e5135..0ab776dfc898 100644 --- a/CORE/HDD/src/wlan_hdd_cfg.c +++ b/CORE/HDD/src/wlan_hdd_cfg.c @@ -5544,6 +5544,7 @@ VOS_STATUS hdd_set_sme_config( hdd_context_t *pHddCtx ) if ( !HAL_STATUS_SUCCESS( halStatus ) ) { status = VOS_STATUS_E_FAILURE; + hddLog(LOGE, "sme_UpdateConfig() return failure %d", halStatus); } vos_mem_free(smeConfig); diff --git a/CORE/HDD/src/wlan_hdd_cfg80211.c b/CORE/HDD/src/wlan_hdd_cfg80211.c index 09cddaa8c434..a7adeecabc40 100644 --- a/CORE/HDD/src/wlan_hdd_cfg80211.c +++ b/CORE/HDD/src/wlan_hdd_cfg80211.c @@ -64,6 +64,7 @@ #include <wlan_hdd_includes.h> #include <net/arp.h> #include <net/cfg80211.h> +#include <vos_trace.h> #ifdef CONFIG_CNSS #include <net/cnss.h> #endif @@ -1315,17 +1316,37 @@ int wlan_hdd_cfg80211_alloc_new_beacon(hdd_adapter_t *pAdapter, ENTER(); if (params->head && !params->head_len) + { + VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + FL("head_len is NULL")); return -EINVAL; + } old = pAdapter->sessionCtx.ap.beacon; if (!params->head && !old) + { + VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + FL("session(%d) old and new heads points to NULL"), + pAdapter->sessionId); + return -EINVAL; + } + + if (params->tail && !params->tail_len) + { + VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + FL("tail_len is zero but tail is not NULL")); return -EINVAL; + } #if (LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,38)) /* Kernel 3.0 is not updating dtim_period for set beacon */ if (!params->dtim_period) + { + VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + FL("dtim period is 0")); return -EINVAL; + } #endif if(params->head) @@ -1343,7 +1364,11 @@ int wlan_hdd_cfg80211_alloc_new_beacon(hdd_adapter_t *pAdapter, beacon = kzalloc(size, GFP_KERNEL); if( beacon == NULL ) - return -ENOMEM; + { + VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + FL("Mem allocation for beacon failed")); + return -ENOMEM; + } #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,4,0)) if(params->dtim_period || !old ) @@ -1615,6 +1640,7 @@ static int wlan_hdd_cfg80211_update_apies(hdd_adapter_t* pHostapdAdapter, if (0 != wlan_hdd_add_ie(pHostapdAdapter, genie, &total_ielen, WPS_OUI_TYPE, WPS_OUI_TYPE_SIZE)) { + hddLog(LOGE, FL("Adding WPS IE failed")); ret = -EINVAL; goto done; } @@ -1623,6 +1649,7 @@ static int wlan_hdd_cfg80211_update_apies(hdd_adapter_t* pHostapdAdapter, if (0 != wlan_hdd_add_ie(pHostapdAdapter, genie, &total_ielen, WFD_OUI_TYPE, WFD_OUI_TYPE_SIZE)) { + hddLog(LOGE, FL("Adding WFD IE failed")); ret = -EINVAL; goto done; } @@ -1631,6 +1658,7 @@ static int wlan_hdd_cfg80211_update_apies(hdd_adapter_t* pHostapdAdapter, if (0 != wlan_hdd_add_ie(pHostapdAdapter, genie, &total_ielen, P2P_OUI_TYPE, P2P_OUI_TYPE_SIZE)) { + hddLog(LOGE, FL("Adding P2P IE failed")); ret = -EINVAL; goto done; } @@ -2619,7 +2647,12 @@ static int wlan_hdd_cfg80211_add_beacon(struct wiphy *wiphy, old = pAdapter->sessionCtx.ap.beacon; if (old) + { + hddLog(VOS_TRACE_LEVEL_WARN, + FL("already beacon info added to session(%d)"), + pAdapter->sessionId); return -EALREADY; + } status = wlan_hdd_cfg80211_alloc_new_beacon(pAdapter,&new,params); @@ -2680,7 +2713,12 @@ static int wlan_hdd_cfg80211_set_beacon(struct wiphy *wiphy, old = pAdapter->sessionCtx.ap.beacon; if (!old) + { + VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + FL("session(%d) old and new heads points to NULL"), + pAdapter->sessionId); return -ENOENT; + } status = wlan_hdd_cfg80211_alloc_new_beacon(pAdapter,&new,params); @@ -2756,25 +2794,19 @@ static int wlan_hdd_cfg80211_stop_ap (struct wiphy *wiphy, if ((pScanInfo != NULL) && pScanInfo->mScanPending && staAdapter) { + long ret; + INIT_COMPLETION(pScanInfo->abortscan_event_var); hdd_abort_mac_scan(staAdapter->pHddCtx, pAdapter->sessionId, eCSR_SCAN_ABORT_DEFAULT); - status = wait_for_completion_interruptible_timeout( + ret = wait_for_completion_interruptible_timeout( &pScanInfo->abortscan_event_var, msecs_to_jiffies(WLAN_WAIT_TIME_ABORTSCAN)); - if (!status) + if (0 >= ret) { VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, - "%s: Timeout occurred while waiting for abortscan" , - __func__); - - if (pHddCtx->isLogpInProgress) - { - VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, - "%s: LOGP in Progress. Ignore!!!", __func__); - return -EAGAIN; - } - + FL("Timeout occurred while waiting for abortscan %ld"), + ret); VOS_ASSERT(pScanInfo->mScanPending); } } @@ -2790,7 +2822,12 @@ static int wlan_hdd_cfg80211_stop_ap (struct wiphy *wiphy, old = pAdapter->sessionCtx.ap.beacon; if (!old) + { + VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + FL("session(%d) beacon data points to NULL"), + pAdapter->sessionId); return -ENOENT; + } hdd_cleanup_actionframe(pHddCtx, pAdapter); @@ -2996,7 +3033,12 @@ static int wlan_hdd_cfg80211_change_beacon(struct wiphy *wiphy, old = pAdapter->sessionCtx.ap.beacon; if (!old) + { + VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + FL("session(%d) beacon data points to NULL"), + pAdapter->sessionId); return -ENOENT; + } status = wlan_hdd_cfg80211_alloc_new_beacon(pAdapter, &new, params, 0); @@ -3138,7 +3180,10 @@ static int __wlan_hdd_cfg80211_change_iface(struct wiphy *wiphy, eCsrRoamBssType LastBSSType; hdd_config_t *pConfig = NULL; eMib_dot11DesiredBssType connectedBssType; - VOS_STATUS status; + long ret; + VOS_STATUS vstatus; + eHalStatus hstatus; + int status; ENTER(); @@ -3146,22 +3191,11 @@ static int __wlan_hdd_cfg80211_change_iface(struct wiphy *wiphy, { VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, "%s: Adapter context is null", __func__); - return VOS_STATUS_E_FAILURE; + return -ENODEV; } pHddCtx = WLAN_HDD_GET_CTX( pAdapter ); - if (!pHddCtx) - { - VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, - "%s: HDD context is null", __func__); - return VOS_STATUS_E_FAILURE; - } - - MTRACE(vos_trace(VOS_MODULE_ID_HDD, - TRACE_CODE_HDD_CFG80211_CHANGE_IFACE, - pAdapter->sessionId, type)); status = wlan_hdd_validate_context(pHddCtx); - if (0 != status) { VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, @@ -3169,6 +3203,10 @@ static int __wlan_hdd_cfg80211_change_iface(struct wiphy *wiphy, return status; } + MTRACE(vos_trace(VOS_MODULE_ID_HDD, + TRACE_CODE_HDD_CFG80211_CHANGE_IFACE, + pAdapter->sessionId, type)); + hddLog(VOS_TRACE_LEVEL_INFO, "%s: device_mode = %d, IFTYPE = 0x%x", __func__, pAdapter->device_mode, type); @@ -3183,8 +3221,8 @@ static int __wlan_hdd_cfg80211_change_iface(struct wiphy *wiphy, { pHddCtx->isAmpAllowed = VOS_FALSE; // stop AMP traffic - status = WLANBAP_StopAmp(); - if(VOS_STATUS_SUCCESS != status ) + vstatus = WLANBAP_StopAmp(); + if (VOS_STATUS_SUCCESS != vstatus ) { pHddCtx->isAmpAllowed = VOS_TRUE; hddLog(VOS_TRACE_LEVEL_FATAL, @@ -3206,7 +3244,7 @@ static int __wlan_hdd_cfg80211_change_iface(struct wiphy *wiphy, { VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, "%s: pWextState is null", __func__); - return VOS_STATUS_E_FAILURE; + return -EINVAL; } pRoamProfile = &pWextState->roamProfile; LastBSSType = pRoamProfile->BSSType; @@ -3251,17 +3289,19 @@ static int __wlan_hdd_cfg80211_change_iface(struct wiphy *wiphy, { if (0 != wlan_hdd_tdls_init (pAdapter)) { + hddLog(VOS_TRACE_LEVEL_ERROR, + "%s: tdls initialization failed", __func__); return -EINVAL; } } - break; #endif + break; #else - status = wlan_hdd_change_iface_to_sta_mode(ndev, type); - if (status != VOS_STATUS_SUCCESS) - return status; + vstatus = wlan_hdd_change_iface_to_sta_mode(ndev, type); + if (vstatus != VOS_STATUS_SUCCESS) + return -EINVAL; #ifdef QCA_LL_TX_FLOW_CT if (NL80211_IFTYPE_P2P_CLIENT == type) @@ -3321,6 +3361,7 @@ static int __wlan_hdd_cfg80211_change_iface(struct wiphy *wiphy, hdd_close_adapter(pHddCtx, pP2pAdapter, VOS_TRUE); } } + hdd_stop_adapter( pHddCtx, pAdapter ); #ifdef FEATURE_WLAN_TDLS /* A Mutex Lock is introduced while changing the mode to @@ -3330,7 +3371,6 @@ static int __wlan_hdd_cfg80211_change_iface(struct wiphy *wiphy, mutex_lock(&pHddCtx->tdls_lock); #endif //De-init the adapter. - hdd_stop_adapter( pHddCtx, pAdapter ); hdd_deinit_adapter( pHddCtx, pAdapter ); memset(&pAdapter->sessionCtx, 0, sizeof(pAdapter->sessionCtx)); pAdapter->device_mode = (type == NL80211_IFTYPE_AP) ? @@ -3384,35 +3424,27 @@ static int __wlan_hdd_cfg80211_change_iface(struct wiphy *wiphy, if((NL80211_IFTYPE_AP == type) && (memcmp(pConfig->apCntryCode, CFG_AP_COUNTRY_CODE_DEFAULT, 3) != 0)) { - int status = 0; VOS_TRACE(VOS_MODULE_ID_HDD,VOS_TRACE_LEVEL_INFO, "%s: setting country code from INI ", __func__); init_completion(&pAdapter->change_country_code); - status = (int)sme_ChangeCountryCode(pHddCtx->hHal, + hstatus = sme_ChangeCountryCode(pHddCtx->hHal, (void *)(tSmeChangeCountryCallback) wlan_hdd_change_country_code_cb, pConfig->apCntryCode, pAdapter, pHddCtx->pvosContext, eSIR_FALSE, eSIR_TRUE); - if (eHAL_STATUS_SUCCESS == status) + if (eHAL_STATUS_SUCCESS == hstatus) { /* Wait for completion */ - status = wait_for_completion_interruptible_timeout( + ret = wait_for_completion_interruptible_timeout( &pAdapter->change_country_code, msecs_to_jiffies(WLAN_WAIT_TIME_COUNTRY)); - if (status <= 0) + if (ret <= 0) { VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, - "%s: SME Timed out while setting country code ", - __func__); - - if (pHddCtx->isLogpInProgress) - { - VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, - "%s: LOGP in Progress. Ignore!!!", __func__); - return -EAGAIN; - } + FL("SME Timed out while setting country code %ld"), + ret); } } else @@ -3422,8 +3454,8 @@ static int __wlan_hdd_cfg80211_change_iface(struct wiphy *wiphy, return -EINVAL; } } - status = hdd_init_ap_mode(pAdapter); - if(status != VOS_STATUS_SUCCESS) + vstatus = hdd_init_ap_mode(pAdapter); + if (vstatus != VOS_STATUS_SUCCESS) { hddLog(VOS_TRACE_LEVEL_FATAL, "%s: Error initializing the ap mode", __func__); @@ -3528,6 +3560,8 @@ static int __wlan_hdd_cfg80211_change_iface(struct wiphy *wiphy, } else { + hddLog(VOS_TRACE_LEVEL_ERROR,"%s: unsupported device mode(%d)", + __func__, pAdapter->device_mode); return -EOPNOTSUPP; } @@ -3552,9 +3586,15 @@ static int __wlan_hdd_cfg80211_change_iface(struct wiphy *wiphy, pAdapter->sessionId, eCSR_DISCONNECT_REASON_UNSPECIFIED ) ) { - wait_for_completion_interruptible_timeout( - &pAdapter->disconnect_comp_var, - msecs_to_jiffies(WLAN_WAIT_TIME_DISCONNECT)); + ret = wait_for_completion_interruptible_timeout( + &pAdapter->disconnect_comp_var, + msecs_to_jiffies(WLAN_WAIT_TIME_DISCONNECT)); + if (ret <= 0) + { + hddLog(VOS_TRACE_LEVEL_ERROR, + FL("wait on disconnect_comp_var failed %ld"), ret); + } + } } } @@ -3612,6 +3652,7 @@ static int wlan_hdd_tdls_add_station(struct wiphy *wiphy, VOS_STATUS status; hddTdlsPeer_t *pTdlsPeer; tANI_U16 numCurrTdlsPeers; + long ret; ENTER(); @@ -3764,16 +3805,17 @@ static int wlan_hdd_tdls_add_station(struct wiphy *wiphy, pAdapter->sessionId, mac, StaParams); } - status = wait_for_completion_interruptible_timeout(&pAdapter->tdls_add_station_comp, + ret = wait_for_completion_interruptible_timeout(&pAdapter->tdls_add_station_comp, msecs_to_jiffies(WAIT_TIME_TDLS_ADD_STA)); - if (!status) + if (ret <= 0) { VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, - "%s: timeout waiting for tdls add station indication", - __func__); + "%s: timeout waiting for tdls add station indication %ld", + __func__, ret); return -EPERM; } + if ( eHAL_STATUS_SUCCESS != pAdapter->tdlsAddStaStatus) { VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, @@ -4383,6 +4425,7 @@ static int wlan_hdd_cfg80211_get_key( if (CSR_MAX_NUM_KEY <= key_index) { + hddLog(VOS_TRACE_LEVEL_ERROR, FL("invalid key index %d"), key_index); return -EINVAL; } @@ -4890,8 +4933,8 @@ wlan_hdd_cfg80211_inform_bss_frame( hdd_adapter_t *pAdapter, } else { - hddLog(VOS_TRACE_LEVEL_ERROR, "%s Invalid chan_no:%d", - __func__, chan_no); + VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: invalid chan_no %d", __func__, chan_no); kfree(mgmt); return NULL; } @@ -5274,6 +5317,7 @@ static eHalStatus hdd_cfg80211_scan_done_callback(tHalHandle halHandle, struct cfg80211_scan_request *req = NULL; bool aborted = false; int ret = 0; + long waitRet = 0; ENTER(); @@ -5285,11 +5329,13 @@ static eHalStatus hdd_cfg80211_scan_done_callback(tHalHandle halHandle, pScanInfo->mScanPendingCounter = 0; //Block on scan req completion variable. Can't wait forever though. - ret = wait_for_completion_interruptible_timeout( + waitRet = wait_for_completion_interruptible_timeout( &pScanInfo->scan_req_completion_event, msecs_to_jiffies(WLAN_WAIT_TIME_SCAN_REQ)); - if (!ret) + if (waitRet <= 0) { + hddLog(VOS_TRACE_LEVEL_ERROR, + "%s wait on scan_req_completion_event failed %ld",__func__, waitRet); VOS_ASSERT(pScanInfo->mScanPending); goto allow_suspend; } @@ -5714,7 +5760,7 @@ int wlan_hdd_cfg80211_scan( struct wiphy *wiphy, if (NULL == channelList) { hddLog(VOS_TRACE_LEVEL_ERROR, - "%s: memory alloc failed channelList", __func__); + "channelList memory alloc failed channelList"); status = -ENOMEM; goto free_mem; } @@ -8354,6 +8400,8 @@ static int wlan_hdd_cfg80211_set_power_mgmt(struct wiphy *wiphy, EXIT(); if (VOS_STATUS_E_FAILURE == vos_status) { + VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: failed to enter bmps mode", __func__); return -EINVAL; } return 0; @@ -9578,6 +9626,7 @@ static int wlan_hdd_cfg80211_tdls_oper(struct wiphy *wiphy, struct net_device *d case NL80211_TDLS_ENABLE_LINK: { VOS_STATUS status; + long ret; tCsrTdlsLinkEstablishParams tdlsLinkEstablishParams; pTdlsPeer = wlan_hdd_tdls_find_peer(pAdapter, peer, TRUE); @@ -9607,7 +9656,6 @@ static int wlan_hdd_cfg80211_tdls_oper(struct wiphy *wiphy, struct net_device *d if (eTDLS_LINK_CONNECTED != pTdlsPeer->link_status) { - long ret; if (IS_ADVANCE_TDLS_ENABLE) { if (0 != wlan_hdd_tdls_get_link_establish_params( @@ -9834,8 +9882,13 @@ static int wlan_hdd_cfg80211_tdls_oper(struct wiphy *wiphy, struct net_device *d } case NL80211_TDLS_DISCOVERY_REQ: /* We don't support in-driver setup/teardown/discovery */ + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_WARN, + "%s: We don't support in-driver setup/teardown/discovery " + ,__func__); return -ENOTSUPP; default: + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: unsupported event",__func__); return -ENOTSUPP; } return 0; diff --git a/CORE/HDD/src/wlan_hdd_dev_pwr.c b/CORE/HDD/src/wlan_hdd_dev_pwr.c index 30b01fc2b84e..6fb228603f14 100644 --- a/CORE/HDD/src/wlan_hdd_dev_pwr.c +++ b/CORE/HDD/src/wlan_hdd_dev_pwr.c @@ -102,7 +102,7 @@ static bool suspend_notify_sent; ----------------------------------------------------------------------------*/ static int wlan_suspend(hdd_context_t* pHddCtx) { - int rc = 0; + long rc = 0; pVosSchedContext vosSchedContext = NULL; @@ -135,9 +135,11 @@ static int wlan_suspend(hdd_context_t* pHddCtx) /* Wait for Suspend Confirmation from Tx Thread */ rc = wait_for_completion_interruptible_timeout(&pHddCtx->tx_sus_event_var, msecs_to_jiffies(200)); - if(!rc) + if (rc <= 0) { - VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL, "%s: Not able to suspend TX thread timeout happened", __func__); + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL, + "%s: Not able to suspend TX thread timeout happened %ld", + __func__, rc); clear_bit(TX_SUSPEND_EVENT_MASK, &vosSchedContext->txEventFlag); return -ETIME; @@ -155,9 +157,10 @@ static int wlan_suspend(hdd_context_t* pHddCtx) /* Wait for Suspend Confirmation from Rx Thread */ rc = wait_for_completion_interruptible_timeout(&pHddCtx->rx_sus_event_var, msecs_to_jiffies(200)); - if(!rc) + if (rc <= 0) { - VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL, "%s: Not able to suspend Rx thread timeout happened", __func__); + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL, + "%s: Not able to suspend Rx thread timeout happened %ld", __func__, rc); clear_bit(RX_SUSPEND_EVENT_MASK, &vosSchedContext->rxEventFlag); @@ -183,9 +186,11 @@ static int wlan_suspend(hdd_context_t* pHddCtx) /* Wait for Suspend Confirmation from MC Thread */ rc = wait_for_completion_interruptible_timeout(&pHddCtx->mc_sus_event_var, msecs_to_jiffies(200)); - if(!rc) + if(rc <= 0) { - VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL, "%s: Not able to suspend MC thread timeout happened", __func__); + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL, + "%s: Not able to suspend MC thread timeout happened %ld", + __func__, rc); clear_bit(MC_SUSPEND_EVENT_MASK, &vosSchedContext->mcEventFlag); diff --git a/CORE/HDD/src/wlan_hdd_ftm.c b/CORE/HDD/src/wlan_hdd_ftm.c index 95b809da1774..9c49f1558a50 100644 --- a/CORE/HDD/src/wlan_hdd_ftm.c +++ b/CORE/HDD/src/wlan_hdd_ftm.c @@ -84,6 +84,7 @@ #include "if_pci.h" #elif defined(HIF_USB) #include "if_usb.h" +#include <linux/compat.h> #elif defined(HIF_SDIO) #include "if_ath_sdio.h" #endif @@ -519,6 +520,26 @@ static FTM_STATUS ftm_status; //tpAniSirGlobal pMac; static tPttMsgbuffer *pMsgBuf; +#if defined(QCA_WIFI_2_0) && !defined(QCA_WIFI_ISOC) && defined(QCA_WIFI_FTM) +#if defined(HIF_USB) +#define ATH_XIOCTL_UNIFIED_UTF_CMD 0x1000 +#define ATH_XIOCTL_UNIFIED_UTF_RSP 0x1001 +#define MAX_UTF_LENGTH 1024 +typedef struct qcmbr_data_s { + unsigned int cmd; + unsigned int length; + unsigned char buf[MAX_UTF_LENGTH + 4]; + unsigned int copy_to_user; +} qcmbr_data_t; +typedef struct qcmbr_queue_s { + unsigned char utf_buf[MAX_UTF_LENGTH + 4]; + struct list_head list; +} qcmbr_queue_t; +LIST_HEAD(qcmbr_queue_head); +DEFINE_SPINLOCK(qcmbr_queue_lock); +#endif +#endif + static void _ftm_status_init(void) { tANI_U8 addr1[ANI_MAC_ADDR_SIZE] = { 0x00, 0x11, 0x11, 0x11, 0x11, 0x11 }; //dest @@ -1645,6 +1666,18 @@ int wlan_hdd_ftm_close(hdd_context_t *pHddCtx) kfree(pHddCtx->cfg_ini); pHddCtx->cfg_ini= NULL; +#if defined(QCA_WIFI_FTM) && defined(HIF_USB) + spin_lock_bh(&qcmbr_queue_lock); + if (!list_empty(&qcmbr_queue_head)) { + qcmbr_queue_t *msg_buf, *tmp_buf; + list_for_each_entry_safe(msg_buf, tmp_buf, &qcmbr_queue_head, list) { + list_del(&msg_buf->list); + kfree(msg_buf); + } + } + spin_unlock_bh(&qcmbr_queue_lock); +#endif + return 0; } @@ -5481,6 +5514,141 @@ static int wlan_ftm_register_wext(hdd_adapter_t *pAdapter) } #if defined(QCA_WIFI_2_0) && !defined(QCA_WIFI_ISOC) && defined(QCA_WIFI_FTM) +#if defined(HIF_USB) +int wlan_hdd_qcmbr_command(hdd_adapter_t *pAdapter, qcmbr_data_t *pqcmbr_data) +{ + int ret = 0; + qcmbr_queue_t *qcmbr_buf = NULL; + + switch (pqcmbr_data->cmd) { + case ATH_XIOCTL_UNIFIED_UTF_CMD: { + pqcmbr_data->copy_to_user = 0; + if (pqcmbr_data->length) { + if (wlan_hdd_ftm_testmode_cmd(pqcmbr_data->buf, + pqcmbr_data->length) + != VOS_STATUS_SUCCESS) { + ret = -EBUSY; + } else { + ret = 0; + } + } + } + break; + case ATH_XIOCTL_UNIFIED_UTF_RSP: { + pqcmbr_data->copy_to_user = 1; + if (!list_empty(&qcmbr_queue_head)) { + spin_lock_bh(&qcmbr_queue_lock); + qcmbr_buf = list_first_entry(&qcmbr_queue_head, + qcmbr_queue_t, list); + list_del(&qcmbr_buf->list); + spin_unlock_bh(&qcmbr_queue_lock); + ret = 0; + } else { + ret = -1; + } + + if (!ret) { + memcpy(pqcmbr_data->buf, qcmbr_buf->utf_buf, + (MAX_UTF_LENGTH + 4)); + kfree(qcmbr_buf); + } else { + ret = -EAGAIN; + } + } + break; + } + + return ret; +} + +#ifdef CONFIG_COMPAT +static int wlan_hdd_qcmbr_compat_ioctl(hdd_adapter_t *pAdapter, + struct ifreq *ifr) +{ + qcmbr_data_t *qcmbr_data; + int ret = 0; + + qcmbr_data = kzalloc(sizeof(qcmbr_data_t), GFP_KERNEL); + if (qcmbr_data == NULL) + return -ENOMEM; + + if (copy_from_user(qcmbr_data, ifr->ifr_data, sizeof(*qcmbr_data))) { + ret = -EFAULT; + goto exit; + } + + ret = wlan_hdd_qcmbr_command(pAdapter, qcmbr_data); + if (qcmbr_data->copy_to_user) { + ret = copy_to_user(ifr->ifr_data, qcmbr_data->buf, + (MAX_UTF_LENGTH + 4)); + } + +exit: + kfree(qcmbr_data); + return ret; +} +#else /* CONFIG_COMPAT */ +static int wlan_hdd_qcmbr_compat_ioctl(hdd_adapter_t *pAdapter, + struct ifreq *ifr) +{ + return 0; +} +#endif /* CONFIG_COMPAT */ + +static int wlan_hdd_qcmbr_ioctl(hdd_adapter_t *pAdapter, struct ifreq *ifr) +{ + qcmbr_data_t *qcmbr_data; + int ret = 0; + + qcmbr_data = kzalloc(sizeof(qcmbr_data_t), GFP_KERNEL); + if (qcmbr_data == NULL) + return -ENOMEM; + + if (copy_from_user(qcmbr_data, ifr->ifr_data, sizeof(*qcmbr_data))) { + ret = -EFAULT; + goto exit; + } + + ret = wlan_hdd_qcmbr_command(pAdapter, qcmbr_data); + if (qcmbr_data->copy_to_user) { + ret = copy_to_user(ifr->ifr_data, qcmbr_data->buf, + (MAX_UTF_LENGTH + 4)); + } + +exit: + kfree(qcmbr_data); + return ret; +} + +int wlan_hdd_qcmbr_unified_ioctl(hdd_adapter_t *pAdapter, struct ifreq *ifr) +{ + int ret = 0; + + if (is_compat_task()) { + ret = wlan_hdd_qcmbr_compat_ioctl(pAdapter, ifr); + } else { + ret = wlan_hdd_qcmbr_ioctl(pAdapter, ifr); + } + + return ret; +} + +void WLANQCMBR_McProcessMsg(v_VOID_t *message) +{ + qcmbr_queue_t *qcmbr_buf = NULL; + u_int32_t data_len; + + data_len = *((u_int32_t *)message) + sizeof(u_int32_t); + qcmbr_buf = kzalloc(sizeof(qcmbr_queue_t), GFP_KERNEL); + if (qcmbr_buf != NULL) { + memcpy(qcmbr_buf->utf_buf, message, data_len); + spin_lock_bh(&qcmbr_queue_lock); + list_add_tail(&(qcmbr_buf->list), &qcmbr_queue_head); + spin_unlock_bh(&qcmbr_queue_lock); + } +} +#endif + VOS_STATUS WLANFTM_McProcessMsg (v_VOID_t *message) { void *data; @@ -5492,9 +5660,13 @@ VOS_STATUS WLANFTM_McProcessMsg (v_VOID_t *message) data_len = *((u_int32_t *)message); data = (u_int32_t *)message + 1; +#if defined(HIF_USB) + WLANQCMBR_McProcessMsg(message); +#else #ifdef CONFIG_NL80211_TESTMODE wlan_hdd_testmode_rx_event(data, (size_t)data_len); #endif +#endif vos_mem_free(message); diff --git a/CORE/HDD/src/wlan_hdd_main.c b/CORE/HDD/src/wlan_hdd_main.c index e6795ce85789..6cdd865e11c7 100644 --- a/CORE/HDD/src/wlan_hdd_main.c +++ b/CORE/HDD/src/wlan_hdd_main.c @@ -131,6 +131,7 @@ void hdd_ch_avoid_cb(void *hdd_context,void *indi_param); #include "if_pci.h" #elif defined(HIF_USB) #include "if_usb.h" +#define SIOCIOCTLTX99 (SIOCDEVPRIVATE+13) #elif defined(HIF_SDIO) #include "if_ath_sdio.h" #endif @@ -611,18 +612,18 @@ static int hdd_netdev_notifier_call(struct notifier_block * nb, case NETDEV_GOING_DOWN: if( pAdapter->scan_info.mScanPending != FALSE ) { - int result; + long result; INIT_COMPLETION(pAdapter->scan_info.abortscan_event_var); hdd_abort_mac_scan(pAdapter->pHddCtx, pAdapter->sessionId, eCSR_SCAN_ABORT_DEFAULT); result = wait_for_completion_interruptible_timeout( &pAdapter->scan_info.abortscan_event_var, msecs_to_jiffies(WLAN_WAIT_TIME_ABORTSCAN)); - if(!result) + if (result <= 0) { VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, - "%s: Timeout occurred while waiting for abortscan" , - __func__); + "%s: Timeout occurred while waiting for abortscan %ld", + __func__, result); } } else @@ -868,9 +869,15 @@ void hdd_checkandupdate_phymode( hdd_context_t *pHddCtx) eCSR_DISCONNECT_REASON_UNSPECIFIED ); if (VOS_STATUS_SUCCESS == vosStatus) - wait_for_completion_interruptible_timeout(&pAdapter->disconnect_comp_var, - msecs_to_jiffies(WLAN_WAIT_TIME_DISCONNECT)); + { + long ret; + ret = wait_for_completion_interruptible_timeout(&pAdapter->disconnect_comp_var, + msecs_to_jiffies(WLAN_WAIT_TIME_DISCONNECT)); + if (0 >= ret) + hddLog(LOGE, FL("failure waiting for disconnect_comp_var %ld"), + ret); + } } } #else @@ -880,6 +887,7 @@ void hdd_checkandupdate_phymode( hdd_adapter_t *pAdapter, char *country_code) hdd_context_t *pHddCtx = WLAN_HDD_GET_CTX(pAdapter); hdd_config_t *cfg_param; eCsrPhyMode phyMode; + long ret; if (NULL == pHddCtx) { @@ -931,9 +939,15 @@ void hdd_checkandupdate_phymode( hdd_adapter_t *pAdapter, char *country_code) eCSR_DISCONNECT_REASON_UNSPECIFIED ); if (VOS_STATUS_SUCCESS == vosStatus) - wait_for_completion_interruptible_timeout(&pAdapter->disconnect_comp_var, + { + ret = wait_for_completion_interruptible_timeout(&pAdapter->disconnect_comp_var, msecs_to_jiffies(WLAN_WAIT_TIME_DISCONNECT)); - + if (ret <= 0) + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "wait on disconnect_comp_var is failed %ld", ret); + } + } } } #endif //CONFIG_ENABLE_LINUX_REG @@ -5313,7 +5327,7 @@ int hdd_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) { hdd_adapter_t *pAdapter; hdd_context_t *pHddCtx; - int ret; + long ret = 0; pAdapter = WLAN_HDD_GET_PRIV_PTR(dev); if (NULL == pAdapter) { @@ -5329,11 +5343,23 @@ int hdd_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) goto exit; } - if ((!ifr) || (!ifr->ifr_data)) { + if ((!ifr) || (!ifr->ifr_data)) + { + VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: invalid data", __func__); ret = -EINVAL; goto exit; } +#if defined(QCA_WIFI_2_0) && !defined(QCA_WIFI_ISOC) && defined(QCA_WIFI_FTM) && defined(HIF_USB) + if (VOS_FTM_MODE == hdd_get_conparam()) { + if (SIOCIOCTLTX99 == cmd) { + ret = wlan_hdd_qcmbr_unified_ioctl(pAdapter, ifr); + goto exit; + } + } +#endif + pHddCtx = WLAN_HDD_GET_CTX(pAdapter); ret = wlan_hdd_validate_context(pHddCtx); if (ret) { @@ -6914,6 +6940,8 @@ int hdd_stop (struct net_device *dev) ) { /* SoftAP mode, so return from here */ + VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, + "%s: In SAP MODE", __func__); EXIT(); return 0; } @@ -7287,6 +7315,12 @@ static int hdd_set_mac_address(struct net_device *dev, void *addr) (v_U8_t *)&pAdapter->macAddressCurrent, sizeof( pAdapter->macAddressCurrent ), hdd_set_mac_addr_cb, VOS_FALSE ); + if( eHAL_STATUS_SUCCESS != halStatus) + { + VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: failed to set MAC address in CFG", __func__); + } + #endif memcpy(dev->dev_addr, psta_mac_addr->sa_data, ETH_ALEN); @@ -7557,7 +7591,7 @@ VOS_STATUS hdd_init_station_mode( hdd_adapter_t *pAdapter ) eHalStatus halStatus = eHAL_STATUS_SUCCESS; VOS_STATUS status = VOS_STATUS_E_FAILURE; tANI_U32 type, subType; - int rc = 0; + long rc = 0; INIT_COMPLETION(pAdapter->session_open_comp_var); sme_SetCurrDeviceMode(pHddCtx->hHal, pAdapter->device_mode); @@ -7584,10 +7618,10 @@ VOS_STATUS hdd_init_station_mode( hdd_adapter_t *pAdapter ) rc = wait_for_completion_interruptible_timeout( &pAdapter->session_open_comp_var, msecs_to_jiffies(WLAN_WAIT_TIME_SESSIONOPENCLOSE)); - if (!rc) + if (rc <= 0) { hddLog(VOS_TRACE_LEVEL_FATAL, - "Session is not opened within timeout period code %08d", rc ); + "Session is not opened within timeout period code %ld", rc ); status = VOS_STATUS_E_FAILURE; goto error_sme_open; } @@ -7667,10 +7701,16 @@ error_register_wext: pAdapter->sessionId, hdd_smeCloseSessionCallback, pAdapter)) { + unsigned long rc; + //Block on a completion variable. Can't wait forever though. - wait_for_completion_timeout( + rc = wait_for_completion_timeout( &pAdapter->session_close_comp_var, msecs_to_jiffies(WLAN_WAIT_TIME_SESSIONOPENCLOSE)); + if (rc <= 0) + hddLog(VOS_TRACE_LEVEL_ERROR, + FL("Session is not opened within timeout period code %ld"), + rc); } } error_sme_open: @@ -7685,15 +7725,16 @@ void hdd_cleanup_actionframe( hdd_context_t *pHddCtx, hdd_adapter_t *pAdapter ) if( NULL != cfgState->buf ) { - int rc; + long rc; INIT_COMPLETION(pAdapter->tx_action_cnf_event); rc = wait_for_completion_interruptible_timeout( &pAdapter->tx_action_cnf_event, msecs_to_jiffies(ACTION_FRAME_TX_TIMEOUT)); - if(!rc) + if (rc <= 0) { VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, - ("ERROR: HDD Wait for Action Confirmation Failed!!")); + "%s ERROR: HDD Wait for Action Confirmation Failed!! %ld" + , __func__, rc); } } return; @@ -8014,9 +8055,17 @@ VOS_STATUS hdd_disable_bmps_imps(hdd_context_t *pHddCtx, tANI_U8 session_type) { if(halStatus == eHAL_STATUS_PMC_PENDING) { + long ret; //Block on a completion variable. Can't wait forever though - wait_for_completion_interruptible_timeout( - &pHddCtx->full_pwr_comp_var, msecs_to_jiffies(1000)); + ret = wait_for_completion_interruptible_timeout( + &pHddCtx->full_pwr_comp_var, + msecs_to_jiffies(1000)); + if (ret <= 0) + { + hddLog(VOS_TRACE_LEVEL_ERROR, + "%s: wait on full_pwr_comp_var failed %ld", + __func__, ret); +} } else { @@ -8080,6 +8129,7 @@ hdd_adapter_t* hdd_open_adapter( hdd_context_t *pHddCtx, tANI_U8 session_type, if(VOS_STATUS_E_FAILURE == exitbmpsStatus) { //Fail to Exit BMPS + hddLog(VOS_TRACE_LEVEL_ERROR,"%s: Fail to Exit BMPS", __func__); VOS_ASSERT(0); return NULL; } @@ -8094,7 +8144,11 @@ hdd_adapter_t* hdd_open_adapter( hdd_context_t *pHddCtx, tANI_U8 session_type, pAdapter = hdd_alloc_station_adapter( pHddCtx, macAddr, iface_name ); if( NULL == pAdapter ) + { + hddLog(VOS_TRACE_LEVEL_FATAL, + FL("failed to allocate adapter for session %d"), session_type); return NULL; + } pAdapter->wdev.iftype = (session_type == WLAN_HDD_P2P_CLIENT) ? NL80211_IFTYPE_P2P_CLIENT: @@ -8147,7 +8201,11 @@ hdd_adapter_t* hdd_open_adapter( hdd_context_t *pHddCtx, tANI_U8 session_type, { pAdapter = hdd_wlan_create_ap_dev( pHddCtx, macAddr, (tANI_U8 *)iface_name ); if( NULL == pAdapter ) + { + hddLog(VOS_TRACE_LEVEL_FATAL, + FL("failed to allocate adapter for session %d"), session_type); return NULL; + } pAdapter->wdev.iftype = (session_type == WLAN_HDD_SOFTAP) ? NL80211_IFTYPE_AP: @@ -8188,7 +8246,11 @@ hdd_adapter_t* hdd_open_adapter( hdd_context_t *pHddCtx, tANI_U8 session_type, { pAdapter = hdd_alloc_station_adapter( pHddCtx, macAddr, iface_name ); if( NULL == pAdapter ) + { + hddLog(VOS_TRACE_LEVEL_FATAL, + FL("failed to allocate adapter for session %d"), session_type); return NULL; + } pAdapter->wdev.iftype = NL80211_IFTYPE_MONITOR; pAdapter->device_mode = session_type; @@ -8225,7 +8287,12 @@ hdd_adapter_t* hdd_open_adapter( hdd_context_t *pHddCtx, tANI_U8 session_type, pAdapter = hdd_alloc_station_adapter( pHddCtx, macAddr, iface_name ); if( NULL == pAdapter ) + { + hddLog(VOS_TRACE_LEVEL_FATAL, + FL("failed to allocate adapter for session %d"), session_type); return NULL; + } + /* Assign NL80211_IFTYPE_STATION as interface type to resolve Kernel Warning * message while loading driver in FTM mode. */ pAdapter->wdev.iftype = NL80211_IFTYPE_STATION; @@ -8241,6 +8308,8 @@ hdd_adapter_t* hdd_open_adapter( hdd_context_t *pHddCtx, tANI_U8 session_type, break; default: { + hddLog(VOS_TRACE_LEVEL_FATAL,"%s Invalid session type %d", + __func__, session_type); VOS_ASSERT(0); return NULL; } @@ -8390,7 +8459,11 @@ VOS_STATUS hdd_close_adapter( hdd_context_t *pHddCtx, hdd_adapter_t *pAdapter, status = hdd_get_front_adapter ( pHddCtx, &pCurrent ); if( VOS_STATUS_SUCCESS != status ) + { + hddLog(VOS_TRACE_LEVEL_WARN,"%s: adapter list empty %d", + __func__, status); return status; + } while ( pCurrent->pAdapter != pAdapter ) { @@ -8509,9 +8582,12 @@ VOS_STATUS hdd_stop_adapter( hdd_context_t *pHddCtx, hdd_adapter_t *pAdapter ) hdd_wext_state_t *pWextState = WLAN_HDD_GET_WEXT_STATE_PTR(pAdapter); union iwreq_data wrqu; v_U8_t retry = 0; + long ret; ENTER(); + netif_tx_disable(pAdapter->dev); + netif_carrier_off(pAdapter->dev); switch(pAdapter->device_mode) { case WLAN_HDD_INFRA_STATION: @@ -8530,8 +8606,20 @@ VOS_STATUS hdd_stop_adapter( hdd_context_t *pHddCtx, hdd_adapter_t *pAdapter ) //success implies disconnect command got queued up successfully if(halStatus == eHAL_STATUS_SUCCESS) { - wait_for_completion_interruptible_timeout(&pAdapter->disconnect_comp_var, - msecs_to_jiffies(WLAN_WAIT_TIME_DISCONNECT)); + ret = wait_for_completion_interruptible_timeout( + &pAdapter->disconnect_comp_var, + msecs_to_jiffies(WLAN_WAIT_TIME_DISCONNECT)); + if (ret <= 0) + { + hddLog(VOS_TRACE_LEVEL_ERROR, + "%s: wait on disconnect_comp_var failed %ld", + __func__, ret); + } + } + else + { + hddLog(LOGE, "%s: failed to post disconnect event to SME", + __func__); } memset(&wrqu, '\0', sizeof(wrqu)); wrqu.ap_addr.sa_family = ARPHRD_ETHER; @@ -8600,9 +8688,14 @@ VOS_STATUS hdd_stop_adapter( hdd_context_t *pHddCtx, hdd_adapter_t *pAdapter ) hdd_smeCloseSessionCallback, pAdapter)) { //Block on a completion variable. Can't wait forever though. - wait_for_completion_timeout( + ret = wait_for_completion_timeout( &pAdapter->session_close_comp_var, msecs_to_jiffies(WLAN_WAIT_TIME_SESSIONOPENCLOSE)); + if (0 >= ret) + { + hddLog(LOGE, "%s: failure waiting for session_close_comp_var %ld", + __func__, ret); + } } } break; @@ -8660,8 +8753,8 @@ VOS_STATUS hdd_stop_adapter( hdd_context_t *pHddCtx, hdd_adapter_t *pAdapter ) if (!VOS_IS_STATUS_SUCCESS(status)) { - hddLog(LOGE, "%s: failure waiting for WLANSAP_StopBss", - __func__); + hddLog(LOGE, "%s: failure waiting for WLANSAP_StopBss %d", + __func__, status); } } else @@ -8722,11 +8815,7 @@ VOS_STATUS hdd_stop_all_adapters( hdd_context_t *pHddCtx ) while ( NULL != pAdapterNode && VOS_STATUS_SUCCESS == status ) { pAdapter = pAdapterNode->pAdapter; - netif_tx_disable(pAdapter->dev); - netif_carrier_off(pAdapter->dev); - hdd_stop_adapter( pHddCtx, pAdapter ); - status = hdd_get_next_adapter ( pHddCtx, pAdapterNode, &pNext ); pAdapterNode = pNext; } @@ -8918,6 +9007,7 @@ VOS_STATUS hdd_reconnect_all_adapters( hdd_context_t *pHddCtx ) hdd_adapter_t *pAdapter; VOS_STATUS status; v_U32_t roamId; + long ret; ENTER(); @@ -8938,10 +9028,12 @@ VOS_STATUS hdd_reconnect_all_adapters( hdd_context_t *pHddCtx ) sme_RoamDisconnect(pHddCtx->hHal, pAdapter->sessionId, eCSR_DISCONNECT_REASON_UNSPECIFIED); - wait_for_completion_interruptible_timeout( - &pAdapter->disconnect_comp_var, - msecs_to_jiffies(WLAN_WAIT_TIME_DISCONNECT)); - + ret = wait_for_completion_interruptible_timeout( + &pAdapter->disconnect_comp_var, + msecs_to_jiffies(WLAN_WAIT_TIME_DISCONNECT)); + if (0 >= ret) + hddLog(LOGE, "%s: failure waiting for disconnect_comp_var %ld", + __func__, ret); pWextState->roamProfile.csrPersona = pAdapter->device_mode; pHddCtx->isAmpAllowed = VOS_FALSE; sme_RoamConnect(pHddCtx->hHal, @@ -9717,6 +9809,7 @@ void hdd_wlan_exit(hdd_context_t *pHddCtx) if (VOS_FTM_MODE == hdd_get_conparam()) { + hddLog(VOS_TRACE_LEVEL_INFO,"%s: FTM MODE",__func__); #if defined(QCA_WIFI_2_0) && !defined(QCA_WIFI_ISOC) && defined(QCA_WIFI_FTM) if (hdd_ftm_stop(pHddCtx)) { @@ -9733,6 +9826,7 @@ void hdd_wlan_exit(hdd_context_t *pHddCtx) if (VOS_STA_SAP_MODE == hdd_get_conparam()) { + hddLog(VOS_TRACE_LEVEL_INFO,"%s: SAP MODE",__func__); pAdapter = hdd_get_adapter(pHddCtx, WLAN_HDD_SOFTAP); } @@ -9740,6 +9834,7 @@ void hdd_wlan_exit(hdd_context_t *pHddCtx) { if (VOS_FTM_MODE != hdd_get_conparam()) { + hddLog(VOS_TRACE_LEVEL_INFO,"%s: STA MODE",__func__); pAdapter = hdd_get_adapter(pHddCtx, WLAN_HDD_INFRA_STATION); if (pAdapter == NULL) @@ -9747,6 +9842,12 @@ void hdd_wlan_exit(hdd_context_t *pHddCtx) } } + if (NULL == pAdapter) + { + hddLog(VOS_TRACE_LEVEL_FATAL, "%s: pAdapter is NULL", __func__); + goto free_hdd_ctx; + } + /* DeRegister with platform driver as client for Suspend/Resume */ vosStatus = hddDeregisterPmOps(pHddCtx); if ( !VOS_IS_STATUS_SUCCESS( vosStatus ) ) @@ -10135,7 +10236,8 @@ static VOS_STATUS hdd_update_config_from_nv(hdd_context_t* pHddCtx) { if(vos_is_macaddr_zero(&macFromNV[macLoop])) { - printk(KERN_ERR "not valid MAC from NV for %d", macLoop); + hddLog(VOS_TRACE_LEVEL_ERROR, + "not valid MAC from NV for %d", macLoop); /* This MAC is not valid, skip it * This MAC will be got from ini file */ } @@ -12277,10 +12379,10 @@ static void wlan_hdd_restart_deinit(hdd_context_t* pHddCtx) /* Cleanup */ vos_status = vos_timer_stop( &pHddCtx->hdd_restart_timer ); if (!VOS_IS_STATUS_SUCCESS(vos_status)) - hddLog(LOGW, FL("Failed to stop HDD restart timer")); + hddLog(LOGE, FL("Failed to stop HDD restart timer")); vos_status = vos_timer_destroy(&pHddCtx->hdd_restart_timer); if (!VOS_IS_STATUS_SUCCESS(vos_status)) - hddLog(LOGW, FL("Failed to destroy HDD restart timer")); + hddLog(LOGE, FL("Failed to destroy HDD restart timer")); } diff --git a/CORE/HDD/src/wlan_hdd_oemdata.c b/CORE/HDD/src/wlan_hdd_oemdata.c index 4a8e94743d63..e52eb1dd85a6 100644 --- a/CORE/HDD/src/wlan_hdd_oemdata.c +++ b/CORE/HDD/src/wlan_hdd_oemdata.c @@ -56,7 +56,7 @@ static struct hdd_context_s *pHddCtx; This function also reports the results to the user space - \return - 0 for success, non zero for failure + \return - eHalStatus enumeration -----------------------------------------------------------------------------------------------*/ static eHalStatus hdd_OemDataReqCallback(tHalHandle hHal, @@ -121,7 +121,8 @@ int iw_get_oem_data_rsp( union iwreq_data *wrqu, char *extra) { - eHalStatus status = eHAL_STATUS_SUCCESS; + int rc = 0; + eHalStatus status; struct iw_oem_data_rsp* pHddOemDataRsp; tOemDataRsp* pSmeOemDataRsp; @@ -138,14 +139,15 @@ int iw_get_oem_data_rsp( { //get the oem data response from sme status = sme_getOemDataRsp(WLAN_HDD_GET_HAL_CTX(pAdapter), &pSmeOemDataRsp); - if(status != eHAL_STATUS_SUCCESS) + if (status != eHAL_STATUS_SUCCESS) { hddLog(LOGE, "%s: failed in sme_getOemDataRsp", __func__); + rc = -EIO; break; } else { - if(pSmeOemDataRsp != NULL) + if (pSmeOemDataRsp != NULL) { pHddOemDataRsp = (struct iw_oem_data_rsp*)(extra); vos_mem_copy(pHddOemDataRsp->oemDataRsp, pSmeOemDataRsp->oemDataRsp, OEM_DATA_RSP_SIZE); @@ -153,13 +155,13 @@ int iw_get_oem_data_rsp( else { hddLog(LOGE, "%s: pSmeOemDataRsp = NULL", __func__); - status = eHAL_STATUS_FAILURE; + rc = -EIO; break; } } } while(0); - return eHAL_STATUS_SUCCESS; + return rc; } /**--------------------------------------------------------------------------- @@ -184,6 +186,7 @@ int iw_set_oem_data_req( union iwreq_data *wrqu, char *extra) { + int rc = 0; eHalStatus status = eHAL_STATUS_SUCCESS; struct iw_oem_data_req *pOemDataReq = NULL; tOemDataReqConfig oemDataReqConfig; @@ -202,15 +205,15 @@ int iw_set_oem_data_req( do { - if(NULL != wrqu->data.pointer) + if (NULL != wrqu->data.pointer) { pOemDataReq = (struct iw_oem_data_req *)wrqu->data.pointer; } - if(pOemDataReq == NULL) + if (pOemDataReq == NULL) { hddLog(LOGE, "in %s oemDataReq == NULL", __func__); - status = eHAL_STATUS_FAILURE; + rc = -EIO; break; } @@ -221,7 +224,8 @@ int iw_set_oem_data_req( { VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL, "%s: copy_from_user() failed!", __func__); - return -EFAULT; + rc = -EFAULT; + break; } status = sme_OemDataReq(WLAN_HDD_GET_HAL_CTX(pAdapter), @@ -230,13 +234,19 @@ int iw_set_oem_data_req( &oemDataReqID, &hdd_OemDataReqCallback, dev); - + if (status != eHAL_STATUS_SUCCESS) + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: sme_OemDataReq status %d", __func__, status); + rc = -EFAULT; + break; + } pwextBuf->oemDataReqID = oemDataReqID; pwextBuf->oemDataReqInProgress = TRUE; - } while(0); + } while (0); - return status; + return rc; } #ifdef QCA_WIFI_2_0 @@ -265,7 +275,7 @@ int iw_get_oem_data_cap( union iwreq_data *wrqu, char *extra) { - eHalStatus status = eHAL_STATUS_SUCCESS; + eHalStatus status; t_iw_oem_data_cap oemDataCap; t_iw_oem_data_cap *pHddOemDataCap; hdd_adapter_t *pAdapter = (netdev_priv(dev)); @@ -357,10 +367,10 @@ int iw_get_oem_data_cap( pHddOemDataCap = (t_iw_oem_data_cap *)(extra); vos_mem_copy(pHddOemDataCap, &oemDataCap, sizeof(*pHddOemDataCap)); - } while(0); + } while (0); EXIT(); - return status; + return 0; } /**--------------------------------------------------------------------------- @@ -587,10 +597,10 @@ void send_oem_data_rsp_msg(int length, tANI_U8 *oemDataRsp) - oemDataLen - Length to OEM Data buffer - oemData - Pointer to OEM Data buffer - \return - 0 for success, non zero for failure + \return - eHalStatus enumeration --------------------------------------------------------------------------*/ -int oem_process_data_req_msg(int oemDataLen, char *oemData) +eHalStatus oem_process_data_req_msg(int oemDataLen, char *oemData) { hdd_adapter_t *pAdapter = NULL; tOemDataReqConfig oemDataReqConfig; diff --git a/CORE/MAC/inc/qwlan_version.h b/CORE/MAC/inc/qwlan_version.h index 84812795a2b8..6601f91f8426 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 97 +#define QWLAN_VERSION_BUILD 98 -#define QWLAN_VERSIONSTR "1.0.0.97" +#define QWLAN_VERSIONSTR "1.0.0.98" #ifdef QCA_WIFI_2_0 diff --git a/CORE/MAC/src/pe/lim/limAssocUtils.c b/CORE/MAC/src/pe/lim/limAssocUtils.c index b2f9bd1c3381..c370a5341435 100644 --- a/CORE/MAC/src/pe/lim/limAssocUtils.c +++ b/CORE/MAC/src/pe/lim/limAssocUtils.c @@ -3933,6 +3933,7 @@ tSirRetStatus limStaSendAddBss( tpAniSirGlobal pMac, tpSirAssocRsp pAssocRsp, PELOGE(limLog(pMac, LOGE, FL("Couldn't get assoc id for " "MAC ADDR: " MAC_ADDRESS_STR), MAC_ADDR_ARRAY(pAddBssParams->staContext.staMac));) + return eSIR_FAILURE; } if(!pMac->psOffloadEnabled) diff --git a/CORE/MAC/src/pe/lim/limProcessTdls.c b/CORE/MAC/src/pe/lim/limProcessTdls.c index 8a2cfcffe730..3923d4e47bfa 100644 --- a/CORE/MAC/src/pe/lim/limProcessTdls.c +++ b/CORE/MAC/src/pe/lim/limProcessTdls.c @@ -5530,7 +5530,6 @@ tSirRetStatus limProcesSmeTdlsLinkEstablishReq(tpAniSirGlobal pMac, pMsgTdlsLinkEstablishReq->isBufsta = pTdlsLinkEstablishReq->isBufSta; pMsgTdlsLinkEstablishReq->isOffChannelSupported = pTdlsLinkEstablishReq->isOffChannelSupported; - pMsgTdlsLinkEstablishReq->isOffChannelSupported = 1; if ( 0 != pTdlsLinkEstablishReq->supportedChannelsLen) { @@ -5546,6 +5545,21 @@ tSirRetStatus limProcesSmeTdlsLinkEstablishReq(tpAniSirGlobal pMac, limLog(pMac, LOGP, FL("could not retrieve Valid channel list")); } + + if (selfNumChans > WNI_CFG_VALID_CHANNEL_LIST_LEN) { + limLog(pMac, LOGE, + FL("Channel List more than Valid Channel list")); + selfNumChans = WNI_CFG_VALID_CHANNEL_LIST_LEN; + } + + if (pTdlsLinkEstablishReq->supportedChannelsLen + > SIR_MAC_MAX_SUPP_CHANNELS ) { + limLog(pMac, LOGE, + FL("Channel List is more than the supported Channel list")); + pTdlsLinkEstablishReq->supportedChannelsLen + = SIR_MAC_MAX_SUPP_CHANNELS; + } + limTdlsGetIntersection(selfSupportedChannels, selfNumChans, pTdlsLinkEstablishReq->supportedChannels, pTdlsLinkEstablishReq->supportedChannelsLen, diff --git a/CORE/SERVICES/COMMON/hif.h b/CORE/SERVICES/COMMON/hif.h index 9b7a556c878e..eddbbb4a9f1d 100644 --- a/CORE/SERVICES/COMMON/hif.h +++ b/CORE/SERVICES/COMMON/hif.h @@ -675,6 +675,10 @@ void WAR_PCI_WRITE32(char *addr, u32 offset, u32 value); void WAR_PCI_WRITE32(char *addr, u32 offset, u32 value); +#define A_TARGET_ACCESS_BEGIN_RET_EXT(targid, val) \ + if (Q_TARGET_ACCESS_BEGIN(targid) < 0 ) \ + val = -1; + #define A_TARGET_ACCESS_BEGIN_RET(targid) \ if (Q_TARGET_ACCESS_BEGIN(targid) < 0) \ return -1; @@ -694,6 +698,10 @@ void WAR_PCI_WRITE32(char *addr, u32 offset, u32 value); if (Q_TARGET_ACCESS_END(targid) < 0) \ return -1; +#define A_TARGET_ACCESS_END_RET_EXT(targid, val) \ + if (Q_TARGET_ACCESS_END(targid) < 0) \ + val = -1; + #define A_TARGET_ACCESS_END_RET_PTR(targid) \ if (Q_TARGET_ACCESS_END(targid) < 0) \ return NULL; diff --git a/CORE/SERVICES/HIF/PCIe/copy_engine.c b/CORE/SERVICES/HIF/PCIe/copy_engine.c index b4121fb99457..24dcfe8a1e0e 100644 --- a/CORE/SERVICES/HIF/PCIe/copy_engine.c +++ b/CORE/SERVICES/HIF/PCIe/copy_engine.c @@ -321,12 +321,18 @@ CE_recv_buf_enqueue(struct CE_handle *copyeng, unsigned int nentries_mask = dest_ring->nentries_mask; unsigned int write_index ; unsigned int sw_index; + int val = 0; adf_os_spin_lock_bh(&sc->target_lock); write_index = dest_ring->write_index; sw_index = dest_ring->sw_index; - A_TARGET_ACCESS_BEGIN_RET(targid); + A_TARGET_ACCESS_BEGIN_RET_EXT(targid, val); + if (val == -1) { + adf_os_spin_unlock_bh(&sc->target_lock); + return val; + } + if (CE_RING_DELTA(nentries_mask, write_index, sw_index-1) > 0) { struct CE_dest_desc *dest_ring_base = (struct CE_dest_desc *)dest_ring->base_addr_owner_space; struct CE_dest_desc *dest_desc = CE_DEST_RING_TO_DESC(dest_ring_base, write_index); @@ -347,7 +353,12 @@ CE_recv_buf_enqueue(struct CE_handle *copyeng, } else { status = A_ERROR; } - A_TARGET_ACCESS_END_RET(targid); + A_TARGET_ACCESS_END_RET_EXT(targid, val); + if (val == -1) { + adf_os_spin_unlock_bh(&sc->target_lock); + return val; + } + adf_os_spin_unlock_bh(&sc->target_lock); return status; diff --git a/CORE/SERVICES/HIF/USB/if_usb.c b/CORE/SERVICES/HIF/USB/if_usb.c index b0a0c0608747..6786558db4fd 100644 --- a/CORE/SERVICES/HIF/USB/if_usb.c +++ b/CORE/SERVICES/HIF/USB/if_usb.c @@ -155,7 +155,7 @@ hif_usb_probe(struct usb_interface *interface, const struct usb_device_id *id) ol_sc->enableuartprint = 1; ol_sc->enablefwlog = 0; - ol_sc->enablesinglebinary = TRUE; + ol_sc->enablesinglebinary = FALSE; init_waitqueue_head(&ol_sc->sc_osdev->event_queue); diff --git a/CORE/SERVICES/WMA/wma.c b/CORE/SERVICES/WMA/wma.c index 506dfe8de829..10ee0faa3ed2 100644 --- a/CORE/SERVICES/WMA/wma.c +++ b/CORE/SERVICES/WMA/wma.c @@ -4978,7 +4978,6 @@ VOS_STATUS wma_roam_scan_offload_chan_list(tp_wma_handle wma_handle, roam_chan_list_array[i] = vos_chan_to_freq(chan_list[i]); WMA_LOGI("%d,",roam_chan_list_array[i]); } - WMA_LOGI("\n"); status = wmi_unified_cmd_send(wma_handle->wmi_handle, buf, len, WMI_ROAM_CHAN_LIST); @@ -6821,7 +6820,8 @@ static int32_t wmi_unified_send_peer_assoc(tp_wma_handle wma, u_int32_t num_peer_ht_rates; u_int32_t num_peer_11b_rates=0; u_int32_t num_peer_11a_rates=0; - u_int32_t phymode; + u_int32_t phymode; + u_int32_t peer_nss=1; struct wma_txrx_node *intr = &wma->interfaces[params->smesessionId]; @@ -6876,6 +6876,10 @@ static int32_t wmi_unified_send_peer_assoc(tp_wma_handle wma, if (params->supportedRates.supportedMCSSet[i / 8] & (1 << (i % 8))) { rate_pos[peer_ht_rates.num_rates++] = i; + if (i >= 8) { + /* MCS8 or higher rate is present, must be 2x2 */ + peer_nss = 2; + } } if (peer_ht_rates.num_rates == max_rates) break; @@ -7078,7 +7082,7 @@ static int32_t wmi_unified_send_peer_assoc(tp_wma_handle wma, WMITLV_SET_HDR(buf_ptr, WMITLV_TAG_STRUC_wmi_vht_rate_set, WMITLV_GET_STRUCT_TLVLEN(wmi_vht_rate_set)); - cmd->peer_nss = MAX((peer_ht_rates.num_rates + 7) / 8, 1); + cmd->peer_nss = peer_nss; WMA_LOGD("peer_nss %d peer_ht_rates.num_rates %d ", cmd->peer_nss, peer_ht_rates.num_rates); @@ -7104,12 +7108,13 @@ static int32_t wmi_unified_send_peer_assoc(tp_wma_handle wma, WMA_LOGD("%s: vdev_id %d associd %d peer_flags %x rate_caps %x " "peer_caps %x listen_intval %d ht_caps %x max_mpdu %d " - "nss %d phymode %d peer_mpdu_density %d", __func__, + "nss %d phymode %d peer_mpdu_density %d" + "cmd->peer_vht_caps %x", __func__, cmd->vdev_id, cmd->peer_associd, cmd->peer_flags, cmd->peer_rate_caps, cmd->peer_caps, cmd->peer_listen_intval, cmd->peer_ht_caps, cmd->peer_max_mpdu, cmd->peer_nss, cmd->peer_phymode, - cmd->peer_mpdu_density); + cmd->peer_mpdu_density, cmd->peer_vht_caps); ret = wmi_unified_cmd_send(wma->wmi_handle, buf, len, WMI_PEER_ASSOC_CMDID); diff --git a/CORE/SME/src/sme_common/sme_Api.c b/CORE/SME/src/sme_common/sme_Api.c index 0fec71b4e83a..138addb2f1b9 100644 --- a/CORE/SME/src/sme_common/sme_Api.c +++ b/CORE/SME/src/sme_common/sme_Api.c @@ -5422,7 +5422,7 @@ eHalStatus sme_ChangeCountryCode( tHalHandle hHal, { smsLog(pMac, LOG1, FL(" called")); - if ((csrGetInfraSessionId(pMac) != -1) && + if ((pMac->roam.configParam.Is11dSupportEnabledOriginal == true) && (!pMac->roam.configParam.fSupplicantCountryCodeHasPriority)) { @@ -7890,22 +7890,28 @@ eHalStatus sme_HandleChangeCountryCodeByUser(tpAniSirGlobal pMac, is11dCountry = VOS_TRUE; } - if ((!is11dCountry) && (!pMac->roam.configParam.fSupplicantCountryCodeHasPriority) && - (csrGetInfraSessionId(pMac) != -1 )) + /* Set the country code given by userspace when 11dOriginal is FALSE + * when 11doriginal is True,is11dCountry =0 and + * fSupplicantCountryCodeHasPriority = 0, then revert the country code, + * and return failure + */ + if(pMac->roam.configParam.Is11dSupportEnabledOriginal == true) { + if ((!is11dCountry) && (!pMac->roam.configParam.fSupplicantCountryCodeHasPriority)) + { - smsLog( pMac, LOGW, FL(" incorrect country being set, nullify this request")); + smsLog( pMac, LOGW, FL(" incorrect country being set, nullify this request")); - /* we have got a request for a country that should not have been added since the - STA is associated; nullify this request */ - status = csrGetRegulatoryDomainForCountry(pMac, + /* we have got a request for a country that should not have been added since the + STA is associated; nullify this request */ + status = csrGetRegulatoryDomainForCountry(pMac, pMac->scan.countryCode11d, (v_REGDOMAIN_t *) ®_domain_id, COUNTRY_IE); - return eHAL_STATUS_FAILURE; + return eHAL_STATUS_FAILURE; + } } - /* if Supplicant country code has priority, disable 11d */ if (!is11dCountry && pMac->roam.configParam.fSupplicantCountryCodeHasPriority) { diff --git a/CORE/VOSS/src/vos_trace.c b/CORE/VOSS/src/vos_trace.c index e965d69640fa..3cfc97c72d2e 100644 --- a/CORE/VOSS/src/vos_trace.c +++ b/CORE/VOSS/src/vos_trace.c @@ -438,8 +438,6 @@ void vos_trace_hex_dump( VOS_MODULE_ID module, VOS_TRACE_LEVEL level, for (; i < buf_len; i++) { vos_trace_msg( module, level, "%02x ", buf[i]); - if ((i+1) == buf_len) - vos_trace_msg( module, level, "\n"); } } diff --git a/firmware_bin/WCNSS_qcom_cfg.ini b/firmware_bin/WCNSS_qcom_cfg.ini index 4515a893cd7f..0bb8b2c53fa4 100755 --- a/firmware_bin/WCNSS_qcom_cfg.ini +++ b/firmware_bin/WCNSS_qcom_cfg.ini @@ -234,7 +234,7 @@ gWlanAutoShutdown = 0 # 1 = enable auto channel selection, channel provided by supplicant will be ignored -gApAutoChannelSelection=1 +gApAutoChannelSelection=0 # Listen Energy Detect Mode Configuration |
