diff options
| author | Akash Patel <akashp@codeaurora.org> | 2014-08-19 01:30:12 -0700 |
|---|---|---|
| committer | Akash Patel <akashp@codeaurora.org> | 2014-08-19 01:31:33 -0700 |
| commit | 52ae4fbce18f862bfe5b54f098a0ff8770e83b6b (patch) | |
| tree | 3058ac6fd3df912fc6dd3d73a7811aec01448111 | |
| parent | c2ecb9c61095c3ad3218cdf83388f74f45d2bc02 (diff) | |
| parent | 08bf36a482424f857ec8b4c2fde0166d385348d8 (diff) | |
Release 1.0.0.172 QCACLD WLAN Driver
Merge remote-tracking branch 'origin/caf/caf-wlan/master'
* origin/caf/caf-wlan/master:
Cafstaging Release 1.0.0.172
qcacld: Remove obsolete WDI logging support
wlan: hdd: Prevent suspend in DFS channels
qcacld: Add connection mode check before sending nlink msg
wlan: remove redundant code in CLD driver
qcacld: Fix for DUT performing pre-auth with old AP
qcacld: ExtScan: If WiFi Band is specified, driver to fill channel list
qcacld: CL 1059668 - update fw debug log file
qca_cld: Get IBSS adapter in SSR re-init routine
qcacld: Pass Operating class for the Preferred TDLS Offchannel to target
wlan: qcacld: Decrement active sessions while roaming
Change-Id: Ib88bcb7339236c622a3c8df2c6ec75bc7d75eddf
30 files changed, 959 insertions, 1338 deletions
diff --git a/CORE/HDD/inc/wlan_hdd_cfg.h b/CORE/HDD/inc/wlan_hdd_cfg.h index 6e382efb63da..0f9a9b90f37d 100644 --- a/CORE/HDD/inc/wlan_hdd_cfg.h +++ b/CORE/HDD/inc/wlan_hdd_cfg.h @@ -1645,33 +1645,6 @@ typedef enum #define CFG_VOS_TRACE_ENABLE_MAX (0xff) #define CFG_VOS_TRACE_ENABLE_DEFAULT (0xffff) -/* - * WDI Trace Enable Control - * Notes: - * the MIN/MAX/DEFAULT values apply for all modules - * the DEFAULT value is outside the valid range. if the DEFAULT - * value is not overridden, then no change will be made to the - * "built in" default values compiled into the code - * values are a bitmap indicating which log levels are to enabled - * (must match order of wpt_tracelevel enumerations) - * 00000001 FATAL - * 00000010 ERROR - * 00000100 WARN - * 00001000 INFO - * 00010000 INFO HIGH - * 00100000 INFO MED - * 01000000 INFO LOW - * - * hence a value of 0x7F would set all bits (enable all logs) - */ -#define CFG_WDI_TRACE_ENABLE_DAL_NAME "wdiTraceEnableDAL" -#define CFG_WDI_TRACE_ENABLE_CTL_NAME "wdiTraceEnableCTL" -#define CFG_WDI_TRACE_ENABLE_DAT_NAME "wdiTraceEnableDAT" -#define CFG_WDI_TRACE_ENABLE_PAL_NAME "wdiTraceEnablePAL" -#define CFG_WDI_TRACE_ENABLE_MIN (0) -#define CFG_WDI_TRACE_ENABLE_MAX (0x7f) -#define CFG_WDI_TRACE_ENABLE_DEFAULT (0xffffffff) - #define HDD_MCASTBCASTFILTER_FILTER_NONE 0x00 #define HDD_MCASTBCASTFILTER_FILTER_ALL_MULTICAST 0x01 #define HDD_MCASTBCASTFILTER_FILTER_ALL_BROADCAST 0x02 @@ -3040,11 +3013,6 @@ typedef struct v_U16_t vosTraceEnableSAP; v_U16_t vosTraceEnableHDDSAP; - /* WDI Trace Control */ - v_U32_t wdiTraceEnableDAL; - v_U32_t wdiTraceEnableCTL; - v_U32_t wdiTraceEnableDAT; - v_U32_t wdiTraceEnablePAL; v_U16_t nTeleBcnTransListenInterval; v_U16_t nTeleBcnMaxListenInterval; v_U16_t nTeleBcnTransLiNumIdleBeacons; diff --git a/CORE/HDD/inc/wlan_hdd_hostapd.h b/CORE/HDD/inc/wlan_hdd_hostapd.h index f86caeb7f234..4059145139b3 100644 --- a/CORE/HDD/inc/wlan_hdd_hostapd.h +++ b/CORE/HDD/inc/wlan_hdd_hostapd.h @@ -92,6 +92,8 @@ VOS_STATUS hdd_hostapd_SAPEventCB( tpSap_Event pSapEvent, v_PVOID_t usrDataForCa VOS_STATUS hdd_init_ap_mode( hdd_adapter_t *pAdapter ); void hdd_set_ap_ops( struct net_device *pWlanHostapdDev ); int hdd_hostapd_stop (struct net_device *dev); +void hdd_hostapd_channel_wakelock_init(hdd_context_t *pHddCtx); +void hdd_hostapd_channel_wakelock_deinit(hdd_context_t *pHddCtx); #ifdef QCA_HT_2040_COEX VOS_STATUS hdd_set_sap_ht2040_mode(hdd_adapter_t *pHostapdAdapter, tANI_U8 channel_type); diff --git a/CORE/HDD/inc/wlan_hdd_main.h b/CORE/HDD/inc/wlan_hdd_main.h index 45b8dac3988d..9cb1884366c2 100644 --- a/CORE/HDD/inc/wlan_hdd_main.h +++ b/CORE/HDD/inc/wlan_hdd_main.h @@ -1485,6 +1485,9 @@ struct hdd_context_s hdd_green_ap_ctx_t *green_ap_ctx; #endif fw_log_info fw_log_settings; + + vos_wake_lock_t sap_dfs_wakelock; + atomic_t sap_dfs_ref_cnt; }; /*--------------------------------------------------------------------------- diff --git a/CORE/HDD/src/wlan_hdd_assoc.c b/CORE/HDD/src/wlan_hdd_assoc.c index 1bb4c40b5174..44982e6dbeac 100644 --- a/CORE/HDD/src/wlan_hdd_assoc.c +++ b/CORE/HDD/src/wlan_hdd_assoc.c @@ -1288,6 +1288,7 @@ static void hdd_SendReAssocEvent(struct net_device *dev, v_U8_t *rspRsnIe = kmalloc(IW_GENERIC_IE_MAX, GFP_KERNEL); tANI_U32 rspRsnLength = 0; struct ieee80211_channel *chan; + hdd_context_t *pHddCtx = WLAN_HDD_GET_CTX(pAdapter); if (!rspRsnIe) { hddLog(LOGE, FL("Unable to allocate RSN IE")); @@ -1314,6 +1315,15 @@ static void hdd_SendReAssocEvent(struct net_device *dev, hddLog(LOG1, FL("AssocRsp is now at %02x%02x"), (unsigned int)pFTAssocRsp[0], (unsigned int)pFTAssocRsp[1]); + /* Active session count is decremented upon disconnection, but during + * roaming, there is no disconnect indication and hence active session + * count is not decremented. + * After roaming is completed, active session count is incremented + * as a part of connect indication but effectively after roaming the + * active session count should still be the same and hence upon + * successful reassoc decrement the active session count here */ + wlan_hdd_decr_active_session(pHddCtx, pAdapter->device_mode); + /* Send the Assoc Resp, the supplicant needs this for initial Auth */ len = pCsrRoamInfo->nAssocRspLength - FT_ASSOC_RSP_IES_OFFSET; rspRsnLength = len; diff --git a/CORE/HDD/src/wlan_hdd_cfg.c b/CORE/HDD/src/wlan_hdd_cfg.c index 4ee048698860..2d6aca3f95a9 100644 --- a/CORE/HDD/src/wlan_hdd_cfg.c +++ b/CORE/HDD/src/wlan_hdd_cfg.c @@ -2328,36 +2328,6 @@ REG_TABLE_ENTRY g_registry_table[] = CFG_VOS_TRACE_ENABLE_MIN, CFG_VOS_TRACE_ENABLE_MAX ), - /* note that since the default value is out of range we cannot - enable range check, otherwise we get a system log message */ - REG_VARIABLE( CFG_WDI_TRACE_ENABLE_DAL_NAME, WLAN_PARAM_Integer, - hdd_config_t, wdiTraceEnableDAL, - VAR_FLAGS_OPTIONAL, - CFG_WDI_TRACE_ENABLE_DEFAULT, - CFG_WDI_TRACE_ENABLE_MIN, - CFG_WDI_TRACE_ENABLE_MAX ), - - REG_VARIABLE( CFG_WDI_TRACE_ENABLE_CTL_NAME, WLAN_PARAM_Integer, - hdd_config_t, wdiTraceEnableCTL, - VAR_FLAGS_OPTIONAL, - CFG_WDI_TRACE_ENABLE_DEFAULT, - CFG_WDI_TRACE_ENABLE_MIN, - CFG_WDI_TRACE_ENABLE_MAX ), - - REG_VARIABLE( CFG_WDI_TRACE_ENABLE_DAT_NAME, WLAN_PARAM_Integer, - hdd_config_t, wdiTraceEnableDAT, - VAR_FLAGS_OPTIONAL, - CFG_WDI_TRACE_ENABLE_DEFAULT, - CFG_WDI_TRACE_ENABLE_MIN, - CFG_WDI_TRACE_ENABLE_MAX ), - - REG_VARIABLE( CFG_WDI_TRACE_ENABLE_PAL_NAME, WLAN_PARAM_Integer, - hdd_config_t, wdiTraceEnablePAL, - VAR_FLAGS_OPTIONAL, - CFG_WDI_TRACE_ENABLE_DEFAULT, - CFG_WDI_TRACE_ENABLE_MIN, - CFG_WDI_TRACE_ENABLE_MAX ), - REG_VARIABLE( CFG_TELE_BCN_TRANS_LI_NAME, WLAN_PARAM_Integer, hdd_config_t, nTeleBcnTransListenInterval, VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, diff --git a/CORE/HDD/src/wlan_hdd_cfg80211.c b/CORE/HDD/src/wlan_hdd_cfg80211.c index 74fff8cc6c19..c3d0559e1349 100644 --- a/CORE/HDD/src/wlan_hdd_cfg80211.c +++ b/CORE/HDD/src/wlan_hdd_cfg80211.c @@ -86,6 +86,7 @@ #include "wlan_hdd_trace.h" #include "vos_types.h" #include "vos_trace.h" +#include "vos_utils.h" #ifdef WLAN_BTAMP_FEATURE #include "bap_hdd_misc.h" #endif @@ -1653,7 +1654,8 @@ static int wlan_hdd_cfg80211_extscan_start(struct wiphy *wiphy, struct nlattr *channels; int rem1, rem2; eHalStatus status; - tANI_U8 bktIndex, i, j; + tANI_U8 bktIndex, i, j, numChannels; + tANI_U32 chanList[WNI_CFG_VALID_CHANNEL_LIST_LEN] = {0}; ENTER(); @@ -1782,6 +1784,50 @@ static int wlan_hdd_cfg80211_extscan_start(struct wiphy *wiphy, hddLog(VOS_TRACE_LEVEL_INFO, FL("report events (%d)"), pReqMsg->buckets[bktIndex].reportEvents); + /* Framework shall pass the channel list if the input WiFi band is + * WIFI_BAND_UNSPECIFIED. + * If the input WiFi band is specified (any value other than + * WIFI_BAND_UNSPECIFIED) then driver populates the channel list */ + if (pReqMsg->buckets[bktIndex].band != WIFI_BAND_UNSPECIFIED) { + numChannels = 0; + hddLog(LOG1, "WiFi band is specified, driver to fill channel list"); + status = sme_GetValidChannelsByBand(pHddCtx->hHal, + pReqMsg->buckets[bktIndex].band, + chanList, &numChannels); + if (!HAL_STATUS_SUCCESS(status)) { + hddLog(VOS_TRACE_LEVEL_ERROR, + FL("sme_GetValidChannelsByBand failed (err=%d)"), status); + goto fail; + } + + pReqMsg->buckets[bktIndex].numChannels = + VOS_MIN(numChannels, WLAN_EXTSCAN_MAX_CHANNELS); + hddLog(LOG1, FL("Num channels (%d)"), + pReqMsg->buckets[bktIndex].numChannels); + + for (j = 0; j < pReqMsg->buckets[bktIndex].numChannels; j++) { + pReqMsg->buckets[bktIndex].channels[j].channel = chanList[j]; + pReqMsg->buckets[bktIndex].channels[j].chnlClass = 0; + if (CSR_IS_CHANNEL_DFS(vos_freq_to_chan(chanList[j]))) { + pReqMsg->buckets[bktIndex].channels[j].passive = 1; + pReqMsg->buckets[bktIndex].channels[j].dwellTimeMs = + CFG_PASSIVE_MAX_CHANNEL_TIME_DEFAULT; + } else { + pReqMsg->buckets[bktIndex].channels[j].passive = 0; + pReqMsg->buckets[bktIndex].channels[j].dwellTimeMs = + CFG_ACTIVE_MAX_CHANNEL_TIME_DEFAULT; + } + + hddLog(LOG1, + "Channel(%u) Passive(%u) Dwell time(%u ms) Class(%u)", + pReqMsg->buckets[bktIndex].channels[j].channel, + pReqMsg->buckets[bktIndex].channels[j].passive, + pReqMsg->buckets[bktIndex].channels[j].dwellTimeMs, + pReqMsg->buckets[bktIndex].channels[j].chnlClass); + } + continue; + } + /* Parse and fetch number of channels */ if (!bucket[QCA_WLAN_VENDOR_ATTR_EXTSCAN_BUCKET_SPEC_NUM_CHANNEL_SPECS]) { hddLog(VOS_TRACE_LEVEL_ERROR, FL("attr num channels failed")); @@ -13790,7 +13836,7 @@ static void wlan_hdd_cfg80211_extscan_stop_rsp(void *ctx, void *pMsg) FL("cfg80211_vendor_event_alloc failed")); return; } - hddLog(VOS_TRACE_LEVEL_INFO, "Req Id (%u)", pData->requestId); + hddLog(LOG1, "Req Id (%u) Status (%u)", pData->requestId, pData->status); if (nla_put_u32(skb, QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_REQUEST_ID, pData->requestId) || diff --git a/CORE/HDD/src/wlan_hdd_early_suspend.c b/CORE/HDD/src/wlan_hdd_early_suspend.c index 08db44645563..f32bc2b73a54 100644 --- a/CORE/HDD/src/wlan_hdd_early_suspend.c +++ b/CORE/HDD/src/wlan_hdd_early_suspend.c @@ -1951,9 +1951,6 @@ VOS_STATUS hdd_wlan_re_init(void *hif_sc) v_CONTEXT_t pVosContext = NULL; hdd_context_t *pHddCtx = NULL; eHalStatus halStatus; -#ifdef HAVE_WCNSS_CAL_DOWNLOAD - int max_retries = 0; -#endif #ifdef WLAN_BTAMP_FEATURE hdd_config_t *pConfig = NULL; WLANBAP_ConfigType btAmpConfig; @@ -2005,23 +2002,6 @@ VOS_STATUS hdd_wlan_re_init(void *hif_sc) /* The driver should always be initialized in STA mode after SSR */ hdd_set_conparam(0); - - /* Try to get an adapter from mode ID */ - pAdapter = hdd_get_adapter(pHddCtx, WLAN_HDD_INFRA_STATION); - if (!pAdapter) - { - pAdapter = hdd_get_adapter(pHddCtx, WLAN_HDD_SOFTAP); - if (!pAdapter) - { - VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL, - "%s: Failed to get Adapter!", __func__); - goto err_re_init; - } - } - - /* Get WLAN HW/FW version */ - hdd_wlan_get_version(pAdapter, NULL, NULL); - /* Re-open VOSS, it is a re-open b'se control transport was never closed. */ vosStatus = vos_open(&pVosContext, 0); if (!VOS_IS_STATUS_SUCCESS(vosStatus)) @@ -2118,6 +2098,26 @@ VOS_STATUS hdd_wlan_re_init(void *hif_sc) goto err_vosstop; } + /* Try to get an adapter from mode ID */ + pAdapter = hdd_get_adapter(pHddCtx, WLAN_HDD_INFRA_STATION); + if (!pAdapter) { + pAdapter = hdd_get_adapter(pHddCtx, WLAN_HDD_SOFTAP); + if (!pAdapter) { + pAdapter = hdd_get_adapter(pHddCtx, WLAN_HDD_IBSS); + if (!pAdapter) { + hddLog(VOS_TRACE_LEVEL_FATAL, "%s: Failed to get Adapter!", + __func__); + } + } + } + + /* Get WLAN Host/FW/HW version */ + if (pAdapter) + hdd_wlan_get_version(pAdapter, NULL, NULL); + + /* Pass FW version to HIF layer */ + hif_set_fw_info(hif_sc, pHddCtx->target_fw_version); + #ifdef WLAN_BTAMP_FEATURE vosStatus = WLANBAP_Open(pVosContext); if(!VOS_IS_STATUS_SUCCESS(vosStatus)) @@ -2147,47 +2147,49 @@ VOS_STATUS hdd_wlan_re_init(void *hif_sc) /* Restart all adapters */ hdd_start_all_adapters(pHddCtx); - /* reconfigure f/w logs after ssr */ - if (pHddCtx->fw_log_settings.enable != 0) { - process_wma_set_command(pAdapter->sessionId, - WMI_DBGLOG_MODULE_ENABLE, - pHddCtx->fw_log_settings.enable , DBG_CMD); - } else { - process_wma_set_command(pAdapter->sessionId, - WMI_DBGLOG_MODULE_DISABLE, - pHddCtx->fw_log_settings.enable, DBG_CMD); - } - if (pHddCtx->fw_log_settings.dl_report != 0) { - - process_wma_set_command(pAdapter->sessionId, - WMI_DBGLOG_REPORT_ENABLE, - pHddCtx->fw_log_settings.dl_report, DBG_CMD); - - process_wma_set_command(pAdapter->sessionId, - WMI_DBGLOG_TYPE, - pHddCtx->fw_log_settings.dl_type, DBG_CMD); - - process_wma_set_command(pAdapter->sessionId, - WMI_DBGLOG_LOG_LEVEL, - pHddCtx->fw_log_settings.dl_loglevel, DBG_CMD); - - for (i = 0; i < MAX_MOD_LOGLEVEL; i++) { - if (pHddCtx->fw_log_settings.dl_mod_loglevel[i] != 0) { - process_wma_set_command(pAdapter->sessionId, - WMI_DBGLOG_MOD_LOG_LEVEL, - pHddCtx->fw_log_settings.dl_mod_loglevel[i], - DBG_CMD); - } - } + + /* Reconfigure FW logs after SSR */ + if (pAdapter) { + if (pHddCtx->fw_log_settings.enable != 0) { + process_wma_set_command(pAdapter->sessionId, + WMI_DBGLOG_MODULE_ENABLE, + pHddCtx->fw_log_settings.enable , DBG_CMD); + } else { + process_wma_set_command(pAdapter->sessionId, + WMI_DBGLOG_MODULE_DISABLE, + pHddCtx->fw_log_settings.enable, DBG_CMD); + } + + if (pHddCtx->fw_log_settings.dl_report != 0) { + process_wma_set_command(pAdapter->sessionId, + WMI_DBGLOG_REPORT_ENABLE, + pHddCtx->fw_log_settings.dl_report, DBG_CMD); + + process_wma_set_command(pAdapter->sessionId, + WMI_DBGLOG_TYPE, + pHddCtx->fw_log_settings.dl_type, DBG_CMD); + + process_wma_set_command(pAdapter->sessionId, + WMI_DBGLOG_LOG_LEVEL, + pHddCtx->fw_log_settings.dl_loglevel, DBG_CMD); + + for (i = 0; i < MAX_MOD_LOGLEVEL; i++) { + if (pHddCtx->fw_log_settings.dl_mod_loglevel[i] != 0) { + process_wma_set_command(pAdapter->sessionId, + WMI_DBGLOG_MOD_LOG_LEVEL, + pHddCtx->fw_log_settings.dl_mod_loglevel[i], + DBG_CMD); + } + } + } } - /* end of f/w log config after ssr */ + pHddCtx->isLogpInProgress = FALSE; vos_set_logp_in_progress(VOS_MODULE_ID_VOSS, FALSE); pHddCtx->hdd_mcastbcast_filter_set = FALSE; hdd_register_mcast_bcast_filter(pHddCtx); hdd_ssr_timer_del(); - wlan_hdd_send_svc_nlink_msg(WLAN_SVC_FW_CRASHED_IND, NULL, 0); /* Allow the phone to go to sleep */ diff --git a/CORE/HDD/src/wlan_hdd_hostapd.c b/CORE/HDD/src/wlan_hdd_hostapd.c index 3460f3deb294..fd5539428949 100644 --- a/CORE/HDD/src/wlan_hdd_hostapd.c +++ b/CORE/HDD/src/wlan_hdd_hostapd.c @@ -117,6 +117,114 @@ extern int process_wma_set_command(int sessid, int paramid, /*--------------------------------------------------------------------------- * Function definitions *-------------------------------------------------------------------------*/ + +/**--------------------------------------------------------------------------- + + \brief hdd_hostapd_channel_wakelock_init + + \param - Pointer to HDD context + + \return - None + + --------------------------------------------------------------------------*/ +void hdd_hostapd_channel_wakelock_init(hdd_context_t *pHddCtx) +{ + /* Iniitialize the wakelock */ + vos_wake_lock_init(&pHddCtx->sap_dfs_wakelock, "sap_dfs_wakelock"); + atomic_set(&pHddCtx->sap_dfs_ref_cnt, 0); +} + +/**--------------------------------------------------------------------------- + + \brief hdd_hostapd_channel_allow_suspend - Allow suspend in a channel. + + Called when, + 1. BSS stopped + 2. Channel switch + + \param - pAdapter, channel + + \return - None + + --------------------------------------------------------------------------*/ +void hdd_hostapd_channel_allow_suspend(hdd_adapter_t *pAdapter, + u_int8_t channel) +{ + + hdd_context_t *pHddCtx = (hdd_context_t*)(pAdapter->pHddCtx); + hdd_hostapd_state_t *pHostapdState = + WLAN_HDD_GET_HOSTAP_STATE_PTR(pAdapter); + + /* Return if BSS is already stopped */ + if (pHostapdState->bssState == BSS_STOP) + return; + + /* Release wakelock when no more DFS channels are used */ + if (NV_CHANNEL_DFS == vos_nv_getChannelEnabledState(channel)) { + if (atomic_dec_and_test(&pHddCtx->sap_dfs_ref_cnt)) { + hddLog(LOGE, FL("DFS: allowing suspend (chan %d)"), channel); + vos_wake_lock_release(&pHddCtx->sap_dfs_wakelock); + } + } +} + +/**--------------------------------------------------------------------------- + + \brief hdd_hostapd_channel_prevent_suspend - Prevent suspend in a channel. + + Called when, + 1. BSS started + 2. Channel switch + + \param - pAdapter, channel + + \return - None + + --------------------------------------------------------------------------*/ +void hdd_hostapd_channel_prevent_suspend(hdd_adapter_t *pAdapter, + u_int8_t channel) +{ + hdd_context_t *pHddCtx = (hdd_context_t*)(pAdapter->pHddCtx); + hdd_hostapd_state_t *pHostapdState = + WLAN_HDD_GET_HOSTAP_STATE_PTR(pAdapter); + + /* Return if BSS is already started */ + if (pHostapdState->bssState == BSS_START) + return; + + /* Acquire wakelock if we have at least one DFS channel in use */ + if (NV_CHANNEL_DFS == vos_nv_getChannelEnabledState(channel)) { + if (atomic_inc_return(&pHddCtx->sap_dfs_ref_cnt) == 1) { + hddLog(LOGE, FL("DFS: preventing suspend (chan %d)"), channel); + vos_wake_lock_acquire(&pHddCtx->sap_dfs_wakelock); + } + } +} + +/**--------------------------------------------------------------------------- + + \brief hdd_hostapd_channel_wakelock_deinit + + \param - Pointer to HDD context + + \return - None + + --------------------------------------------------------------------------*/ +void hdd_hostapd_channel_wakelock_deinit(hdd_context_t *pHddCtx) +{ + if (atomic_read(&pHddCtx->sap_dfs_ref_cnt)) { + /* Release wakelock */ + vos_wake_lock_release(&pHddCtx->sap_dfs_wakelock); + /* Reset the reference count */ + atomic_set(&pHddCtx->sap_dfs_ref_cnt, 0); + hddLog(LOGE, FL("DFS: allowing suspend")); + } + + /* Destroy lock */ + vos_wake_lock_destroy(&pHddCtx->sap_dfs_wakelock); +} + + /**--------------------------------------------------------------------------- \brief hdd_hostapd_open() - HDD Open function for hostapd interface @@ -743,6 +851,10 @@ VOS_STATUS hdd_hostapd_SAPEventCB( tpSap_Event pSapEvent, v_PVOID_t usrDataForCa wlan_hdd_auto_shutdown_enable(pHddCtx, VOS_TRUE); #endif pHddApCtx->operatingChannel = pSapEvent->sapevt.sapStartBssCompleteEvent.operatingChannel; + + hdd_hostapd_channel_prevent_suspend(pHostapdAdapter, + pHddApCtx->operatingChannel); + pHostapdState->bssState = BSS_START; #ifdef FEATURE_GREEN_AP @@ -847,6 +959,9 @@ VOS_STATUS hdd_hostapd_SAPEventCB( tpSap_Event pSapEvent, v_PVOID_t usrDataForCa hddLog(LOG1, FL("BSS stop status = %s"),pSapEvent->sapevt.sapStopBssCompleteEvent.status ? "eSAP_STATUS_FAILURE" : "eSAP_STATUS_SUCCESS"); + hdd_hostapd_channel_allow_suspend(pHostapdAdapter, + pHddApCtx->operatingChannel); + #ifdef FEATURE_GREEN_AP hdd_wlan_green_ap_mc(pHddCtx, GREEN_AP_PS_STOP_EVENT); #endif @@ -1287,6 +1402,12 @@ VOS_STATUS hdd_hostapd_SAPEventCB( tpSap_Event pSapEvent, v_PVOID_t usrDataForCa case eSAP_CHANNEL_CHANGE_EVENT: hddLog(LOG1, FL("Received eSAP_CHANNEL_CHANGE_EVENT event")); + /* Prevent suspend for new channel */ + hdd_hostapd_channel_prevent_suspend(pHostapdAdapter, + pSapEvent->sapevt.sapChannelChange.operatingChannel); + /* Allow suspend for old channel */ + hdd_hostapd_channel_allow_suspend(pHostapdAdapter, + pHddApCtx->operatingChannel); /* TODO Need to indicate operating channel change to hostapd */ return VOS_STATUS_SUCCESS; diff --git a/CORE/HDD/src/wlan_hdd_main.c b/CORE/HDD/src/wlan_hdd_main.c index 9be40cf2ddcc..427efc364858 100755 --- a/CORE/HDD/src/wlan_hdd_main.c +++ b/CORE/HDD/src/wlan_hdd_main.c @@ -110,7 +110,6 @@ int wlan_hdd_ftm_start(hdd_context_t *pAdapter); #ifdef WLAN_BTAMP_FEATURE #include "bap_hdd_misc.h" #endif -#include "wlan_qct_pal_trace.h" #include "qwlan_version.h" #include "wlan_qct_wda.h" #ifdef FEATURE_WLAN_TDLS @@ -774,7 +773,7 @@ static int curr_con_mode; --------------------------------------------------------------------------*/ static void hdd_vos_trace_enable(VOS_MODULE_ID moduleId, v_U32_t bitmask) { - wpt_tracelevel level; + VOS_TRACE_LEVEL level; /* if the bitmask is the default value, then a bitmask was not specified in cfg.ini, so leave the logging level alone (it @@ -801,47 +800,6 @@ static void hdd_vos_trace_enable(VOS_MODULE_ID moduleId, v_U32_t bitmask) } -/**--------------------------------------------------------------------------- - - \brief hdd_wdi_trace_enable() - Configure initial WDI Trace enable - - Called immediately after the cfg.ini is read in order to configure - the desired trace levels in the WDI. - - \param - moduleId - module whose trace level is being configured - \param - bitmask - bitmask of log levels to be enabled - - \return - void - - --------------------------------------------------------------------------*/ -static void hdd_wdi_trace_enable(wpt_moduleid moduleId, v_U32_t bitmask) -{ - wpt_tracelevel level; - - /* if the bitmask is the default value, then a bitmask was not - specified in cfg.ini, so leave the logging level alone (it - will remain at the "compiled in" default value) */ - if (CFG_WDI_TRACE_ENABLE_DEFAULT == bitmask) - { - return; - } - - /* a mask was specified. start by disabling all logging */ - wpalTraceSetLevel(moduleId, eWLAN_PAL_TRACE_LEVEL_NONE, 0); - - /* now cycle through the bitmask until all "set" bits are serviced */ - level = eWLAN_PAL_TRACE_LEVEL_FATAL; - while (0 != bitmask) - { - if (bitmask & 1) - { - wpalTraceSetLevel(moduleId, level, 1); - } - level++; - bitmask >>= 1; - } -} - /* * FUNCTION: wlan_hdd_validate_context * This function is used to check the HDD context @@ -10373,6 +10331,8 @@ void hdd_wlan_exit(hdd_context_t *pHddCtx) /* Destroy the wake lock */ vos_wake_lock_destroy(&pHddCtx->sap_wake_lock); + hdd_hostapd_channel_wakelock_deinit(pHddCtx); + vosStatus = vos_nv_close(); if (!VOS_IS_STATUS_SUCCESS(vosStatus)) { @@ -11197,16 +11157,6 @@ int hdd_wlan_startup(struct device *dev, v_VOID_t *hif_sc) hdd_vos_trace_enable(VOS_MODULE_ID_HDD_SOFTAP, pHddCtx->cfg_ini->vosTraceEnableHDDSAP); - // Update WDI trace levels based upon the cfg.ini - hdd_wdi_trace_enable(eWLAN_MODULE_DAL, - pHddCtx->cfg_ini->wdiTraceEnableDAL); - hdd_wdi_trace_enable(eWLAN_MODULE_DAL_CTRL, - pHddCtx->cfg_ini->wdiTraceEnableCTL); - hdd_wdi_trace_enable(eWLAN_MODULE_DAL_DATA, - pHddCtx->cfg_ini->wdiTraceEnableDAT); - hdd_wdi_trace_enable(eWLAN_MODULE_PAL, - pHddCtx->cfg_ini->wdiTraceEnablePAL); - print_hdd_cfg(pHddCtx); if (VOS_FTM_MODE == hdd_get_conparam()) @@ -11403,6 +11353,7 @@ int hdd_wlan_startup(struct device *dev, v_VOID_t *hif_sc) } #endif vos_set_load_unload_in_progress(VOS_MODULE_ID_VOSS, FALSE); + pHddCtx->isLoadInProgress = FALSE; hddLog(VOS_TRACE_LEVEL_FATAL,"%s: FTM driver loaded", __func__); complete(&wlan_start_comp); return VOS_STATUS_SUCCESS; @@ -11677,6 +11628,8 @@ int hdd_wlan_startup(struct device *dev, v_VOID_t *hif_sc) vos_wake_lock_init(&pHddCtx->sap_wake_lock, "qcom_sap_wakelock"); + hdd_hostapd_channel_wakelock_init(pHddCtx); + vos_set_load_unload_in_progress(VOS_MODULE_ID_VOSS, FALSE); hdd_allow_suspend(); @@ -11907,13 +11860,7 @@ static int hdd_driver_init( void) { VOS_STATUS status; v_CONTEXT_t pVosContext = NULL; -#if defined (ANI_BUS_TYPE_PCI) - struct device *dev = NULL; -#endif int ret_status = 0; -#ifdef HAVE_WCNSS_CAL_DOWNLOAD - int max_retries = 0; -#endif unsigned long rc; #ifdef WLAN_LOGGING_SOCK_SVC_ENABLE @@ -11929,35 +11876,6 @@ static int hdd_driver_init( void) pr_info("%s: loading driver v%s\n", WLAN_MODULE_NAME, QWLAN_VERSIONSTR TIMER_MANAGER_STR MEMORY_DEBUG_STR); -#ifdef ANI_BUS_TYPE_PCI - - dev = wcnss_wlan_get_device(); - -#endif // ANI_BUS_TYPE_PCI - -#ifdef ANI_BUS_TYPE_PLATFORM - -#ifdef HAVE_WCNSS_CAL_DOWNLOAD - /* wait until WCNSS driver downloads NV */ - while (!wcnss_device_ready() && 5 >= ++max_retries) { - msleep(1000); - } - if (max_retries >= 5) { - hddLog(VOS_TRACE_LEVEL_FATAL,"%s: WCNSS driver not ready", __func__); - vos_wake_lock_destroy(&wlan_wake_lock); - -#ifdef WLAN_LOGGING_SOCK_SVC_ENABLE - wlan_logging_sock_deinit_svc(); -#endif - - return -ENODEV; - } -#endif - - dev = wcnss_wlan_get_device(); -#endif // ANI_BUS_TYPE_PLATFORM - - do { #ifndef MODULE @@ -13272,6 +13190,9 @@ void wlan_hdd_send_status_pkg(hdd_adapter_t *pAdapter, return; #endif + if (VOS_FTM_MODE == hdd_get_conparam()) + return; + memset(&data, 0, sizeof(struct wlan_status_data)); if (is_on) ret = wlan_hdd_gen_wlan_status_pack(&data, pAdapter, pHddStaCtx, @@ -13302,6 +13223,9 @@ void wlan_hdd_send_version_pkg(v_U32_t fw_version, return; #endif + if (VOS_FTM_MODE == hdd_get_conparam()) + return; + memset(&data, 0, sizeof(struct wlan_version_data)); ret = wlan_hdd_gen_wlan_version_pack(&data, fw_version, chip_id, chip_name); if (!ret) diff --git a/CORE/HDD/src/wlan_hdd_wext.c b/CORE/HDD/src/wlan_hdd_wext.c index bce292283101..4295664e5230 100644 --- a/CORE/HDD/src/wlan_hdd_wext.c +++ b/CORE/HDD/src/wlan_hdd_wext.c @@ -91,7 +91,6 @@ #include <linux/wireless.h> #include <net/cfg80211.h> -#include "wlan_qct_pal_trace.h" #include "wlan_qct_tl.h" #include "wlan_hdd_misc.h" @@ -250,7 +249,7 @@ static const hdd_freq_chan_map_t freq_chan_map[] = { {2412, 1}, {2417, 2}, #define WE_GET_WLAN_DBG 4 #define WE_GET_MAX_ASSOC 6 -#define WE_GET_WDI_DBG 7 +/* 7 is unused */ #define WE_GET_SAP_AUTO_CHANNEL_SELECTION 8 #define WE_GET_CONCURRENCY_MODE 9 #define WE_GET_NSS 11 @@ -317,7 +316,7 @@ static const hdd_freq_chan_map_t freq_chan_map[] = { {2412, 1}, {2417, 2}, /* Private ioctls and their sub-ioctls */ #define WLAN_PRIV_SET_THREE_INT_GET_NONE (SIOCIWFIRSTPRIV + 4) #define WE_SET_WLAN_DBG 1 -#define WE_SET_WDI_DBG 2 +/* 2 is unused */ #define WE_SET_SAP_CHANNELS 3 /* Private ioctls and their sub-ioctls */ @@ -539,6 +538,11 @@ static const struct qwlan_hw qwlan_hw_list[] = { .id = AR6320_REV3_VERSION, .subid = 0x8, .name = "QCA6174_REV3", + }, + { + .id = AR6320_REV3_VERSION, + .subid = 0x9, + .name = "QCA6174_REV3_1", } }; @@ -6052,13 +6056,6 @@ static int iw_setnone_getint(struct net_device *dev, struct iw_request_info *inf break; } - case WE_GET_WDI_DBG: - { - wpalTraceDisplay(); - *value = 0; - break; - } - case WE_GET_SAP_AUTO_CHANNEL_SELECTION: { #ifdef WLAN_FEATURE_MBSSID @@ -6545,45 +6542,35 @@ static int iw_setnone_getint(struct net_device *dev, struct iw_request_info *inf } /* set param sub-ioctls */ -int iw_set_three_ints_getnone(struct net_device *dev, struct iw_request_info *info, - union iwreq_data *wrqu, char *extra) +int iw_set_three_ints_getnone(struct net_device *dev, + struct iw_request_info *info, + union iwreq_data *wrqu, char *extra) { hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR(dev); int *value = (int *)extra; int sub_cmd = value[0]; int ret = 0; - if ((WLAN_HDD_GET_CTX(pAdapter))->isLogpInProgress) - { + if ((WLAN_HDD_GET_CTX(pAdapter))->isLogpInProgress) { VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL, "%s:LOGP in Progress. Ignore!!!", __func__); return -EBUSY; } - switch(sub_cmd) - { - case WE_SET_WLAN_DBG: - { - vos_trace_setValue( value[1], value[2], value[3]); - break; - } - case WE_SET_WDI_DBG: - { - wpalTraceSetLevel( value[1], value[2], value[3]); - break; - } - case WE_SET_SAP_CHANNELS: - { - ret = iw_softap_set_channel_range( dev, value[1], value[2], value[3]); - break; - } + switch(sub_cmd) { + case WE_SET_WLAN_DBG: + vos_trace_setValue( value[1], value[2], value[3]); + break; + + case WE_SET_SAP_CHANNELS: + ret = iw_softap_set_channel_range( dev, value[1], value[2], value[3]); + break; + + default: + hddLog(LOGE, "%s: Invalid IOCTL command %d", __func__, sub_cmd ); + break; - default: - { - hddLog(LOGE, "%s: Invalid IOCTL command %d", __func__, sub_cmd ); - break; - } } return ret; } @@ -10075,11 +10062,6 @@ static const struct iw_priv_args we_private_args[] = { IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, "getMaxAssoc" }, - { WE_GET_WDI_DBG, - 0, - IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, - "getwdidbg" }, - { WE_GET_SAP_AUTO_CHANNEL_SELECTION, 0, IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, @@ -10369,11 +10351,6 @@ static const struct iw_priv_args we_private_args[] = { 0, "setwlandbg" }, - { WE_SET_WDI_DBG, - IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 3, - 0, - "setwdidbg" }, - { WE_SET_SAP_CHANNELS, IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 3, 0, diff --git a/CORE/MAC/inc/qwlan_version.h b/CORE/MAC/inc/qwlan_version.h index 4aa6cb4b3d1b..71b527af8a50 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 171 +#define QWLAN_VERSION_BUILD 172 -#define QWLAN_VERSIONSTR "1.0.0.171" +#define QWLAN_VERSIONSTR "1.0.0.172" #ifdef QCA_WIFI_2_0 diff --git a/CORE/MAC/inc/sirApi.h b/CORE/MAC/inc/sirApi.h index a5362b0b13c3..4820e9363248 100644 --- a/CORE/MAC/inc/sirApi.h +++ b/CORE/MAC/inc/sirApi.h @@ -107,7 +107,7 @@ typedef tANI_U8 tSirVersionString[SIR_VERSION_STRING_LEN]; #ifdef FEATURE_WLAN_EXTSCAN -#define WLAN_EXTSCAN_MAX_CHANNELS 16 +#define WLAN_EXTSCAN_MAX_CHANNELS 40 #define WLAN_EXTSCAN_MAX_BUCKETS 16 #define WLAN_EXTSCAN_MAX_HOTLIST_APS 128 #define WLAN_EXTSCAN_MAX_SIGNIFICANT_CHANGE_APS 64 diff --git a/CORE/MAC/src/pe/lim/limProcessTdls.c b/CORE/MAC/src/pe/lim/limProcessTdls.c index fb8058ff464d..25e1c339d7fb 100644 --- a/CORE/MAC/src/pe/lim/limProcessTdls.c +++ b/CORE/MAC/src/pe/lim/limProcessTdls.c @@ -81,6 +81,7 @@ #include "limAssocUtils.h" #include "dphHashTable.h" #include "wlan_qct_wda.h" +#include "regdomain_common.h" /* define NO_PAD_TDLS_MIN_8023_SIZE to NOT padding: See CR#447630 There was IOT issue with cisco 1252 open mode, where it pads @@ -118,79 +119,6 @@ tSirRetStatus limPopulateVhtMcsSet(tpAniSirGlobal pMac, tDot11fIEVHTCaps *pPeerVHTCaps, tpPESession psessionEntry); ePhyChanBondState limGetHTCBState(ePhyChanBondState aniCBMode); -/*only 31 op classes are available, 1 entry for current op class*/ -static tDot11fIESuppOperatingClasses op_classes = {0}; - -op_class_map_t global_op_class[] = { - {81, 25, BW20, {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13}}, - {82, 25, BW20, {14}}, - {83, 40, BW40PLUS, {1, 2, 3, 4, 5, 6, 7, 8, 9}}, - {84, 40, BW40MINUS, {5, 6, 7, 8, 9, 10, 11, 12, 13}}, - {115, 20, BW20, {36, 40, 44, 48}}, - {116, 40, BW40PLUS, {36, 44}}, - {117, 40, BW40MINUS, {40, 48}}, - {118, 20, BW20, {52, 56, 60, 64}}, - {119, 40, BW40PLUS, {52, 60}}, - {120, 40, BW40MINUS, {56, 64}}, - {121, 20, BW20, {100, 104, 108, 112, 116, 120, 124, 128, 132, 136, 140}}, - {122, 40, BW40PLUS, {100, 108, 116, 124, 132}}, - {123, 40, BW40MINUS, {104, 112, 120, 128, 136}}, - {125, 20, BW20, {149, 153, 157, 161, 165, 169}}, - {126, 40, BW40PLUS, {149, 157}}, - {127, 40, BW40MINUS, {153, 161}}, - {0, 0, 0, {0}}, - -};/*end global_op_class*/ - -op_class_map_t us_op_class[] = { - {1, 20, BW20, {36, 40, 44, 48}}, - {2, 20, BW20, {52, 56, 60, 64}}, - {4, 20, BW20, {100, 104, 108, 112, 116, 120, 124, 128, 132, 136, 140}}, - {5, 20, BW20, {149, 153, 157, 161, 165}}, - {22, 40, BW40PLUS, {36, 44}}, - {23, 40, BW40PLUS, {52, 60}}, - {24, 40, BW40PLUS, {100, 108, 116, 124, 132}}, - {26, 40, BW40PLUS, {149, 157}}, - {27, 40, BW40MINUS, {40, 48}}, - {28, 40, BW40MINUS, {56, 64}}, - {29, 40, BW40MINUS, {104, 112, 120, 128, 136}}, - {31, 40, BW40MINUS, {153, 161}}, - {32, 40, BW40PLUS, {1, 2, 3, 4, 5, 6, 7}}, - {33, 40, BW40MINUS, {5, 6, 7, 8, 9, 10, 11}}, - {0, 0, 0, {0}}, -};/*end us_op_class*/ - -op_class_map_t euro_op_class[] = { - {1, 20, BW20, {36, 40, 44, 48}}, - {2, 20, BW20, {52, 56, 60, 64}}, - {3, 20, BW20, {100, 104, 108, 112, 116, 120, 124, 128, 132, 136, 140}}, - {4, 25, BW20, {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13}}, - {5, 40, BW40PLUS, {36, 44}}, - {6, 40, BW40PLUS, {52, 60}}, - {7, 40, BW40PLUS, {100, 108, 116, 124, 132}}, - {8, 40, BW40MINUS, {40, 48}}, - {9, 40, BW40MINUS, {56, 64}}, - {10, 40, BW40MINUS, {104, 112, 120, 128, 136}}, - {11, 40, BW40PLUS, {1, 2, 3, 4, 5, 6, 7, 8, 9}}, - {12, 40, BW40MINUS, {5, 6, 7, 8, 9, 10, 11, 12, 13}}, - {17, 20, BW20, {149, 153, 157, 161, 165, 169}}, - {0, 0, 0, {0}}, -};/*end euro_op_class*/ - -op_class_map_t japan_op_class[] = { - {1, 20, BW20, {36, 40, 44, 48}}, - {30, 25, BW20, {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13}}, - {31, 25, BW20, {14}}, - {32, 20, BW20, {52, 56, 60, 64}}, - {34, 20, BW20, {100, 104, 108, 112, 116, 120, 124, 128, 132, 136, 140}}, - {36, 40, BW40PLUS, {36, 44}}, - {37, 40, BW40PLUS, {52, 60}}, - {39, 40, BW40PLUS, {100, 108, 116, 124, 132}}, - {41, 40, BW40MINUS, {40, 48}}, - {42, 40, BW40MINUS, {56, 64}}, - {44, 40, BW40MINUS, {104, 112, 120, 128, 136}}, - {0, 0, 0, {0}}, -};/*end japan_op_class*/ /* * TDLS data frames will go out/come in as non-qos data. @@ -2460,7 +2388,10 @@ void PopulateDot11fTdlsOffchannelParams(tpAniSirGlobal pMac, tANI_U8 validChan[WNI_CFG_VALID_CHANNEL_LIST_LEN]; tANI_U8 i; tANI_U8 valid_count = 0; + tANI_U8 chanOffset; tANI_U8 op_class; + tANI_U8 numClasses; + tANI_U8 classes[SIR_MAC_MAX_SUPP_OPER_CLASSES]; if (wlan_cfgGetStr(pMac, WNI_CFG_VALID_CHANNEL_LIST, validChan, &numChans) != eSIR_SUCCESS) { @@ -2489,33 +2420,58 @@ void PopulateDot11fTdlsOffchannelParams(tpAniSirGlobal pMac, suppChannels->num_bands = valid_count; suppChannels->present = 1 ; - /*Get present operating class based on current operating channel*/ - op_class = limGetOPClassFromChannel( - pMac->scan.countryCodeCurrent, - psessionEntry->currentOperChannel, - psessionEntry->htSecondaryChannelOffset); + + /* find channel offset and get op class for current operating channel */ + switch (psessionEntry->htSecondaryChannelOffset) + { + case PHY_SINGLE_CHANNEL_CENTERED: + chanOffset = BW20; + break; + + case PHY_DOUBLE_CHANNEL_LOW_PRIMARY: + chanOffset = BW40_LOW_PRIMARY; + break; + + case PHY_DOUBLE_CHANNEL_HIGH_PRIMARY: + chanOffset = BW40_HIGH_PRIMARY; + break; + + default: + chanOffset = BWALL; + break; + + } + + op_class = regdm_get_opclass_from_channel(pMac->scan.countryCodeCurrent, + psessionEntry->currentOperChannel, + chanOffset); if (op_class == 0) { - PELOGE(limLog(pMac, LOGE, FL("Present Operating class is Wrong!!!"));) + PELOGE(limLog(pMac, LOGE, FL("Present Operating class is wrong, countryCodeCurrent: %s, currentOperChannel: %d, htSecondaryChannelOffset: %d, chanOffset: %d"), + pMac->scan.countryCodeCurrent, + psessionEntry->currentOperChannel, + psessionEntry->htSecondaryChannelOffset, + chanOffset);) } else { - PELOGE(limLog(pMac, LOG1, FL("Present Operating channel=%d offset=%d class=%d"), + PELOGE(limLog(pMac, LOG1, FL("Present Operating channel: %d chanOffset: %d, op class=%d"), psessionEntry->currentOperChannel, - psessionEntry->htSecondaryChannelOffset, + chanOffset, op_class);) } suppOperClasses->present = 1; suppOperClasses->classes[0] = op_class; - /*Fill operating classes from static array*/ - suppOperClasses->num_classes = op_classes.num_classes; - for ( i = 0U; i < suppOperClasses->num_classes; i++) - { - suppOperClasses->classes[i+1] = op_classes.classes[i]; + regdm_get_curr_opclasses(&numClasses, &classes[0]); + + for (i = 0; i < numClasses; i++) + { + suppOperClasses->classes[i+1] = classes[i]; } - /*increment for present operating class*/ - suppOperClasses->num_classes++; + /* add one for present operating class, added in the beginning */ + suppOperClasses->num_classes = numClasses + 1; + return ; } /* @@ -3096,165 +3052,4 @@ tSirRetStatus limDeleteTDLSPeers(tpAniSirGlobal pMac, tpPESession psessionEntry) return eSIR_SUCCESS; } - -tANI_U8 limGetOPClassFromChannel(tANI_U8 *country, - tANI_U8 channel, - tANI_U8 offset) -{ - op_class_map_t *class = NULL; - tANI_U16 i = 0; - - if (VOS_TRUE == vos_mem_compare(country,"US", 2)) { - - class = us_op_class; - - } else if (VOS_TRUE == vos_mem_compare(country,"EU", 2)) { - - class = euro_op_class; - - } else if (VOS_TRUE == vos_mem_compare(country,"JP", 2)) { - - class = japan_op_class; - - } else { - - class = global_op_class; - - } - - while (class->op_class) - { - if ((offset == class->offset) || (offset == BWALL)) - { - for (i=0; (i < 15 && class->channels[i]); i++) - { - if (channel == class->channels[i]) - return class->op_class; - } - } - class++; - } - return 0; -} - -tANI_BOOLEAN CheckAndAddOP(tANI_U8 class) -{ - tANI_U8 i; - - for (i=0; i < (SIR_MAC_MAX_SUPP_OPER_CLASSES - 1); i++) - { - /*0 is an invalid class. If class is already present ignore*/ - if (class == op_classes.classes[i]) - return FALSE; - if(op_classes.classes[i] == 0) - { - return TRUE; - } - } - //limLog(pMac, LOGE, FL("No space left for class = %d"), class); - return FALSE; -} - -void limInitOperatingClasses( tHalHandle hHal ) -{ - - tANI_U8 Index = 0; - tANI_U8 class = 0; - tANI_U8 i = 0; - tANI_U8 j = 0; - tANI_U8 swap = 0; - tANI_U8 numChannels = 0; - tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); - limLog(pMac, LOG1, FL("Current Country = %c%c"), - pMac->scan.countryCodeCurrent[0], - pMac->scan.countryCodeCurrent[1]); - - vos_mem_set(op_classes.classes, sizeof(op_classes.classes), 0); - numChannels = pMac->scan.baseChannels.numChannels; - limLog(pMac, LOG1, "Num of base ch =%d", numChannels); - for ( Index = 0; - Index < numChannels && i < (SIR_MAC_MAX_SUPP_OPER_CLASSES - 1); - Index++) - { - class = limGetOPClassFromChannel( - pMac->scan.countryCodeCurrent, - pMac->scan.baseChannels.channelList[ Index ], - BWALL); - limLog(pMac, LOG4, "ch=%d <=> %d=class", - pMac->scan.baseChannels.channelList[ Index ], - class); - if (CheckAndAddOP(class)) - { - op_classes.classes[i]= class; - i++; - } - } - - numChannels = pMac->scan.base20MHzChannels.numChannels; - limLog(pMac, LOG1, "Num of 20MHz ch =%d", numChannels); - for ( Index = 0; - Index < numChannels && i < (SIR_MAC_MAX_SUPP_OPER_CLASSES - 1); - Index++) - { - class = limGetOPClassFromChannel( - pMac->scan.countryCodeCurrent, - pMac->scan.base20MHzChannels.channelList[ Index ], - BWALL); - limLog(pMac, LOG4, "ch=%d <=> %d=class", - pMac->scan.base20MHzChannels.channelList[ Index ], - class); - if (CheckAndAddOP(class)) - { - op_classes.classes[i]= class; - i++; - } - } - - numChannels = pMac->scan.base40MHzChannels.numChannels; - limLog(pMac, LOG1, "Num of 40MHz ch =%d", numChannels); - for ( Index = 0; - Index < numChannels && i < (SIR_MAC_MAX_SUPP_OPER_CLASSES - 1); - Index++) - { - class = limGetOPClassFromChannel( - pMac->scan.countryCodeCurrent, - pMac->scan.base40MHzChannels.channelList[ Index ], - BWALL); - limLog(pMac, LOG4, "ch=%d <=> %d=class", - pMac->scan.base40MHzChannels.channelList[ Index ], - class); - if (CheckAndAddOP(class)) - { - op_classes.classes[i]= class; - i++; - } - } - - op_classes.num_classes = i; - limLog(pMac, LOG1, "Total number of Unique supported classes =%d", - op_classes.num_classes); - /*as per spec the operating classes should be in ascending order*/ - /*Bubble sort is fine as we don't have many classes*/ - for (i = 0 ; i < ( op_classes.num_classes - 1 ); i++) - { - for (j = 0 ; j < op_classes.num_classes - i - 1; j++) - { - /* For decreasing order use < */ - if (op_classes.classes[j] > op_classes.classes[j+1]) - { - swap = op_classes.classes[j]; - op_classes.classes[j] = op_classes.classes[j+1]; - op_classes.classes[j+1] = swap; - } - } - } - for (i=0; i < op_classes.num_classes; i++) - { - - limLog(pMac, LOG1, "supported op_class[%d]=%d", i, - op_classes.classes[i]); - - } -} - #endif diff --git a/CORE/MAC/src/pe/lim/limUtils.h b/CORE/MAC/src/pe/lim/limUtils.h index 660d495914bf..1b88c5fdbfa0 100644 --- a/CORE/MAC/src/pe/lim/limUtils.h +++ b/CORE/MAC/src/pe/lim/limUtils.h @@ -102,19 +102,6 @@ typedef union uPmfSaQueryTimerId } tPmfSaQueryTimerId, *tpPmfSaQueryTimerId; #endif -typedef enum offset { - BW20, - BW40PLUS, - BW40MINUS, - BWALL -} offset_t; - -typedef struct op_class_map { - tANI_U8 op_class; - tANI_U8 ch_spacing; - offset_t offset; - tANI_U8 channels[15]; -}op_class_map_t; // LIM utility functions void limGetBssidFromPkt(tpAniSirGlobal, tANI_U8 *, tANI_U8 *, tANI_U32 *); char * limDot11ReasonStr(tANI_U16 reasonCode); @@ -599,8 +586,4 @@ void limSetProtectedBit(tpAniSirGlobal pMac, tANI_U8* lim_get_ie_ptr(tANI_U8 *pIes, int length, tANI_U8 eid); -void limInitOperatingClasses(tHalHandle hHal); -tANI_U8 limGetOPClassFromChannel(tANI_U8 *country, - tANI_U8 channel, - tANI_U8 offset); #endif /* __LIM_UTILS_H */ diff --git a/CORE/SERVICES/COMMON/dbglog_id.h b/CORE/SERVICES/COMMON/dbglog_id.h index eb5b32d6992d..f450147401ff 100644 --- a/CORE/SERVICES/COMMON/dbglog_id.h +++ b/CORE/SERVICES/COMMON/dbglog_id.h @@ -1375,6 +1375,10 @@ extern "C" { #define EXTSCAN_CONFIG_HOTLIST_TABLE 39 #define EXTSCAN_CONFIG_WLAN_CHANGE_TABLE 40 +/* NLO DBGIDs */ +#define NLO_DBGID_SSID_TO_BE_SCANNED_LIST 0 +#define NLO_DBGID_SSID_TO_BE_SKIPPED_LIST 1 + #ifdef __cplusplus } #endif diff --git a/CORE/SERVICES/WMA/regdomain.c b/CORE/SERVICES/WMA/regdomain.c index 897a5ac11bb3..39bbe313aadb 100644 --- a/CORE/SERVICES/WMA/regdomain.c +++ b/CORE/SERVICES/WMA/regdomain.c @@ -72,6 +72,83 @@ #define N(a) (sizeof(a)/sizeof(a[0])) +static regdm_supp_op_classes regdm_curr_supp_opp_classes = {0}; + +/* Global Operating Classes */ +regdm_op_class_map_t global_op_class[] = { + {81, 25, BW20, {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13}}, + {82, 25, BW20, {14}}, + {83, 40, BW40_LOW_PRIMARY, {1, 2, 3, 4, 5, 6, 7, 8, 9}}, + {84, 40, BW40_HIGH_PRIMARY, {5, 6, 7, 8, 9, 10, 11, 12, 13}}, + {115, 20, BW20, {36, 40, 44, 48}}, + {116, 40, BW40_LOW_PRIMARY, {36, 44}}, + {117, 40, BW40_HIGH_PRIMARY, {40, 48}}, + {118, 20, BW20, {52, 56, 60, 64}}, + {119, 40, BW40_LOW_PRIMARY, {52, 60}}, + {120, 40, BW40_HIGH_PRIMARY, {56, 64}}, + {121, 20, BW20, {100, 104, 108, 112, 116, 120, 124, 128, 132, 136, 140}}, + {122, 40, BW40_LOW_PRIMARY, {100, 108, 116, 124, 132}}, + {123, 40, BW40_HIGH_PRIMARY, {104, 112, 120, 128, 136}}, + {125, 20, BW20, {149, 153, 157, 161, 165, 169}}, + {126, 40, BW40_LOW_PRIMARY, {149, 157}}, + {127, 40, BW40_HIGH_PRIMARY, {153, 161}}, + {0, 0, 0, {0}}, +}; + +/* Operating Classes in US */ +regdm_op_class_map_t us_op_class[] = { + {1, 20, BW20, {36, 40, 44, 48}}, + {2, 20, BW20, {52, 56, 60, 64}}, + {4, 20, BW20, {100, 104, 108, 112, 116, 120, 124, 128, 132, 136, 140}}, + {5, 20, BW20, {149, 153, 157, 161, 165}}, + {12, 25, BW20, {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11}}, + {22, 40, BW40_LOW_PRIMARY, {36, 44}}, + {23, 40, BW40_LOW_PRIMARY, {52, 60}}, + {24, 40, BW40_LOW_PRIMARY, {100, 108, 116, 124, 132}}, + {26, 40, BW40_LOW_PRIMARY, {149, 157}}, + {27, 40, BW40_HIGH_PRIMARY, {40, 48}}, + {28, 40, BW40_HIGH_PRIMARY, {56, 64}}, + {29, 40, BW40_HIGH_PRIMARY, {104, 112, 120, 128, 136}}, + {31, 40, BW40_HIGH_PRIMARY, {153, 161}}, + {32, 40, BW40_LOW_PRIMARY, {1, 2, 3, 4, 5, 6, 7}}, + {33, 40, BW40_HIGH_PRIMARY, {5, 6, 7, 8, 9, 10, 11}}, + {0, 0, 0, {0}}, +}; + +/* Operating Classes in Europe */ +regdm_op_class_map_t euro_op_class[] = { + {1, 20, BW20, {36, 40, 44, 48}}, + {2, 20, BW20, {52, 56, 60, 64}}, + {3, 20, BW20, {100, 104, 108, 112, 116, 120, 124, 128, 132, 136, 140}}, + {4, 25, BW20, {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13}}, + {5, 40, BW40_LOW_PRIMARY, {36, 44}}, + {6, 40, BW40_LOW_PRIMARY, {52, 60}}, + {7, 40, BW40_LOW_PRIMARY, {100, 108, 116, 124, 132}}, + {8, 40, BW40_HIGH_PRIMARY, {40, 48}}, + {9, 40, BW40_HIGH_PRIMARY, {56, 64}}, + {10, 40, BW40_HIGH_PRIMARY, {104, 112, 120, 128, 136}}, + {11, 40, BW40_LOW_PRIMARY, {1, 2, 3, 4, 5, 6, 7, 8, 9}}, + {12, 40, BW40_HIGH_PRIMARY, {5, 6, 7, 8, 9, 10, 11, 12, 13}}, + {17, 20, BW20, {149, 153, 157, 161, 165, 169}}, + {0, 0, 0, {0}}, +}; + +/* Operating Classes in Japan */ +regdm_op_class_map_t japan_op_class[] = { + {1, 20, BW20, {36, 40, 44, 48}}, + {30, 25, BW20, {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13}}, + {31, 25, BW20, {14}}, + {32, 20, BW20, {52, 56, 60, 64}}, + {34, 20, BW20, {100, 104, 108, 112, 116, 120, 124, 128, 132, 136, 140}}, + {36, 40, BW40_LOW_PRIMARY, {36, 44}}, + {37, 40, BW40_LOW_PRIMARY, {52, 60}}, + {39, 40, BW40_LOW_PRIMARY, {100, 108, 116, 124, 132}}, + {41, 40, BW40_HIGH_PRIMARY, {40, 48}}, + {42, 40, BW40_HIGH_PRIMARY, {56, 64}}, + {44, 40, BW40_HIGH_PRIMARY, {104, 112, 120, 128, 136}}, + {0, 0, 0, {0}}, +}; + /* * By default, the regdomain tables reference the common tables * from regdomain_common.h. These default tables can be replaced @@ -524,3 +601,80 @@ u_int16_t get_regdmn_5g(u_int32_t reg_dmn) __func__, reg_dmn); return 0; } + +/* + * Get operating class for a given channel + */ +u_int16_t regdm_get_opclass_from_channel(u_int8_t *country, u_int8_t channel, + u_int8_t offset) +{ + regdm_op_class_map_t *class = NULL; + u_int16_t i = 0; + + if (0 == adf_os_mem_cmp(country,"US", 2)) { + class = us_op_class; + } else if (0 == adf_os_mem_cmp(country,"EU", 2)) { + class = euro_op_class; + } else if (0 == adf_os_mem_cmp(country,"JP", 2)) { + class = japan_op_class; + } else { + class = global_op_class; + } + + while (class->op_class) { + if ((offset == class->offset) || (offset == BWALL)) { + for (i = 0; + (i < MAX_CHANNELS_PER_OPERATING_CLASS && + class->channels[i]); + i++) { + if (channel == class->channels[i]) + return class->op_class; + } + } + class++; + } + return 0; +} + +/* + * Set current operating classes per country, regdomain + */ +u_int16_t regdm_set_curr_opclasses(u_int8_t num_classes, u_int8_t *class) +{ + u_int8_t i; + + if (SIR_MAC_MAX_SUPP_OPER_CLASSES < num_classes) { + adf_os_print(KERN_ERR "%s: Invalid numClasses (%d)\n", + __func__, num_classes); + return -1; + } + + for (i = 0 ; i < num_classes; i++) { + regdm_curr_supp_opp_classes.classes[i] = class[i]; + } + regdm_curr_supp_opp_classes.num_classes = num_classes; + + return 0; +} + +/* + * Get current operating classes + */ +u_int16_t regdm_get_curr_opclasses(u_int8_t *num_classes, u_int8_t *class) +{ + u_int8_t i; + + if (!num_classes || !class) { + adf_os_print(KERN_ERR "%s: Either num_classes or class is null\n", + __func__); + return -1; + } + + for (i = 0 ; i < regdm_curr_supp_opp_classes.num_classes; i++) { + class[i] = regdm_curr_supp_opp_classes.classes[i]; + } + + *num_classes = regdm_curr_supp_opp_classes.num_classes; + + return 0; +} diff --git a/CORE/SERVICES/WMA/regdomain_common.h b/CORE/SERVICES/WMA/regdomain_common.h index c96708eb2747..913799ff3dad 100644 --- a/CORE/SERVICES/WMA/regdomain_common.h +++ b/CORE/SERVICES/WMA/regdomain_common.h @@ -79,6 +79,9 @@ #include "_ieee80211_common.h" #include <a_types.h> #include "wlan_defs.h" + +#define MAX_CHANNELS_PER_OPERATING_CLASS 15 + enum EnumRd { /* * The following regulatory domain definitions are @@ -1832,3 +1835,30 @@ static const struct cmode modes[] = { { REGDMN_MODE_11AC_VHT40_2G, IEEE80211_CHAN_11AC_VHT40_2G}, { REGDMN_MODE_11AC_VHT80_2G, IEEE80211_CHAN_11AC_VHT80_2G}, }; + +typedef enum offset +{ + BW20 = 0, + BW40_LOW_PRIMARY = 1, + BW40_HIGH_PRIMARY = 3, + BWALL +} offset_t; + +typedef struct _regdm_op_class_map +{ + u_int8_t op_class; + u_int8_t ch_spacing; + offset_t offset; + u_int8_t channels[MAX_CHANNELS_PER_OPERATING_CLASS]; +} regdm_op_class_map_t; + +typedef struct _regdm_supp_op_classes { + u_int8_t num_classes; + u_int8_t classes[SIR_MAC_MAX_SUPP_OPER_CLASSES]; +} regdm_supp_op_classes; + +u_int16_t regdm_get_opclass_from_channel(u_int8_t *country, u_int8_t channel, + u_int8_t offset); +u_int16_t regdm_set_curr_opclasses(u_int8_t num_classes, u_int8_t *class); +u_int16_t regdm_get_curr_opclasses(u_int8_t *num_classes, u_int8_t *class); + diff --git a/CORE/SERVICES/WMA/wma.c b/CORE/SERVICES/WMA/wma.c index 1c7909abf48b..fca023e8a41d 100644 --- a/CORE/SERVICES/WMA/wma.c +++ b/CORE/SERVICES/WMA/wma.c @@ -25505,16 +25505,23 @@ static int wma_update_tdls_peer_state(WMA_HANDLE handle, peerStateParams->peerCap.peerOffChanSupport; peer_cap->peer_curr_operclass = peerStateParams->peerCap.peerCurrOperClass; + /* self curr operclass is not being used and so pass op class for + * preferred off chan in it. + */ peer_cap->self_curr_operclass = - peerStateParams->peerCap.selfCurrOperClass; + peerStateParams->peerCap.opClassForPrefOffChan; peer_cap->peer_chan_len = peerStateParams->peerCap.peerChanLen; peer_cap->peer_operclass_len = peerStateParams->peerCap.peerOperClassLen; + WMA_LOGD("%s: peer_operclass_len: %d", + __func__, peer_cap->peer_operclass_len); for (i = 0; i < WMI_TDLS_MAX_SUPP_OPER_CLASSES; i++) { peer_cap->peer_operclass[i] = peerStateParams->peerCap.peerOperClass[i]; + WMA_LOGD("%s: peer_operclass[%d]: %d", + __func__, i, peer_cap->peer_operclass[i]); } peer_cap->is_peer_responder = diff --git a/CORE/SME/inc/csrNeighborRoam.h b/CORE/SME/inc/csrNeighborRoam.h index 3daeb096b054..ae85f1023182 100644 --- a/CORE/SME/inc/csrNeighborRoam.h +++ b/CORE/SME/inc/csrNeighborRoam.h @@ -40,6 +40,8 @@ #ifdef WLAN_FEATURE_NEIGHBOR_ROAMING #include "sme_Api.h" +#define ROAM_AP_AGE_LIMIT_MS 10000 + /* Enumeration of various states in neighbor roam algorithm */ typedef enum { diff --git a/CORE/SME/src/csr/csrApiRoam.c b/CORE/SME/src/csr/csrApiRoam.c index 8300785f5906..5e4c1122e436 100644 --- a/CORE/SME/src/csr/csrApiRoam.c +++ b/CORE/SME/src/csr/csrApiRoam.c @@ -67,6 +67,8 @@ #if defined(FEATURE_WLAN_ESE) && !defined(FEATURE_WLAN_ESE_UPLOAD) #include "csrEse.h" #endif /* FEATURE_WLAN_ESE && !FEATURE_WLAN_ESE_UPLOAD */ +#include "regdomain_common.h" + #define CSR_NUM_IBSS_START_CHANNELS_50 4 #define CSR_NUM_IBSS_START_CHANNELS_24 3 #define CSR_WAIT_FOR_KEY_TIMEOUT_PERIOD ( 5 * VOS_TIMER_TO_SEC_UNIT ) // 5 seconds, for WPA, WPA2, CCKM @@ -258,6 +260,7 @@ extern void SysProcessMmhMsg(tpAniSirGlobal pMac, tSirMsgQ* pMsg); extern void btampEstablishLogLinkHdlr(void* pMsg); static void csrSerDesUnpackDiassocRsp(tANI_U8 *pBuf, tSirSmeDisassocRsp *pRsp); void csrReinitPreauthCmd(tpAniSirGlobal pMac, tSmeCmd *pCommand); +void csrInitOperatingClasses(tHalHandle hHal); //Initialize global variables static void csrRoamInitGlobals(tpAniSirGlobal pMac) @@ -467,7 +470,7 @@ eHalStatus csrUpdateChannelList(tpAniSirGlobal pMac) bufLen = sizeof(tSirUpdateChanList) + (sizeof(tSirUpdateChanParam) * (numChan - 1)); - limInitOperatingClasses((tHalHandle)pMac); + csrInitOperatingClasses((tHalHandle)pMac); pChanList = (tSirUpdateChanList *) vos_mem_malloc(bufLen); if (!pChanList) { @@ -2334,7 +2337,7 @@ eHalStatus csrInitChannelList( tHalHandle hHal ) csrSaveChannelPowerForBand(pMac, eANI_BOOLEAN_TRUE); // Apply the base channel list, power info, and set the Country code... csrApplyChannelPowerCountryInfo( pMac, &pMac->scan.base20MHzChannels, pMac->scan.countryCodeCurrent, eANI_BOOLEAN_TRUE ); - limInitOperatingClasses(hHal); + csrInitOperatingClasses(hHal); return (status); } eHalStatus csrChangeConfigParams(tpAniSirGlobal pMac, @@ -18529,3 +18532,135 @@ err_synch_rsp: pFTRoamOffloadSynchRsp->pbssDescription = NULL; } #endif + +void csrInitOperatingClasses(tHalHandle hHal) +{ + tANI_U8 Index = 0; + tANI_U8 class = 0; + tANI_U8 i = 0; + tANI_U8 j = 0; + tANI_U8 swap = 0; + tANI_U8 numChannels = 0; + tANI_U8 numClasses = 0; + tANI_BOOLEAN found; + tANI_U8 opClasses[SIR_MAC_MAX_SUPP_OPER_CLASSES]; + tpAniSirGlobal pMac = PMAC_STRUCT(hHal); + + smsLog(pMac, LOG1, FL("Current Country = %c%c"), + pMac->scan.countryCodeCurrent[0], + pMac->scan.countryCodeCurrent[1]); + + for (j = 0; j < SIR_MAC_MAX_SUPP_OPER_CLASSES; j++) { + opClasses[j] = 0; + } + + numChannels = pMac->scan.baseChannels.numChannels; + + smsLog(pMac, LOG1, FL("Num of base channels %d"), numChannels); + + for (Index = 0; + Index < numChannels && i < (SIR_MAC_MAX_SUPP_OPER_CLASSES - 1); + Index++) { + class = regdm_get_opclass_from_channel(pMac->scan.countryCodeCurrent, + pMac->scan.baseChannels.channelList[Index], + BWALL); + smsLog(pMac, LOG4, FL("for chan %d, op class: %d"), + pMac->scan.baseChannels.channelList[Index], + class); + + found = FALSE; + for (j = 0 ; j < SIR_MAC_MAX_SUPP_OPER_CLASSES - 1; j++) { + if (opClasses[j] == class) { + found = TRUE; + break; + } + } + if (!found) { + opClasses[i]= class; + i++; + } + } + + numChannels = pMac->scan.base20MHzChannels.numChannels; + + smsLog(pMac, LOG1, FL("Num of 20MHz channels %d"), numChannels); + + for (Index = 0; + Index < numChannels && i < (SIR_MAC_MAX_SUPP_OPER_CLASSES - 1); + Index++) { + class = regdm_get_opclass_from_channel(pMac->scan.countryCodeCurrent, + pMac->scan.base20MHzChannels.channelList[Index], + BWALL); + smsLog(pMac, LOG4, FL("for chan %d, op class: %d"), + pMac->scan.base20MHzChannels.channelList[ Index ], + class); + + found = FALSE; + for (j = 0 ; j < SIR_MAC_MAX_SUPP_OPER_CLASSES - 1; j++) { + if (opClasses[j] == class) { + found = TRUE; + break; + } + } + if (!found) { + opClasses[i]= class; + i++; + } + } + + numChannels = pMac->scan.base40MHzChannels.numChannels; + + smsLog(pMac, LOG1, FL("Num of 40MHz channels %d"), numChannels); + + for (Index = 0; + Index < numChannels && i < (SIR_MAC_MAX_SUPP_OPER_CLASSES - 1); + Index++) { + class = regdm_get_opclass_from_channel(pMac->scan.countryCodeCurrent, + pMac->scan.base40MHzChannels.channelList[Index], + BWALL); + smsLog(pMac, LOG4, FL("for chan %d, op class: %d"), + pMac->scan.base40MHzChannels.channelList[ Index ], + class); + + found = FALSE; + for (j = 0 ; j < SIR_MAC_MAX_SUPP_OPER_CLASSES - 1; j++) { + if (opClasses[j] == class) { + found = TRUE; + break; + } + } + if (!found) { + opClasses[i]= class; + i++; + } + } + + numClasses = i; + + /* As per spec the operating classes should be in ascending order. + * Bubble sort is fine since we don't have many classes + */ + for (i = 0 ; i < (numClasses - 1); i++) { + for (j = 0 ; j < (numClasses - i - 1); j++) { + /* For decreasing order use < */ + if (opClasses[j] > opClasses[j+1]) { + swap = opClasses[j]; + opClasses[j] = opClasses[j+1]; + opClasses[j+1] = swap; + } + } + } + + smsLog(pMac, LOG1, FL("Total number of unique supported op classes %d"), + numClasses); + for (i = 0; i < numClasses; i++) { + smsLog(pMac, LOG1, FL("supported opClasses[%d] = %d"), i, + opClasses[i]); + } + + /* Set the ordered list of op classes in regdomain + * for use by other modules + */ + regdm_set_curr_opclasses(numClasses, &opClasses[0]); +} + diff --git a/CORE/SME/src/csr/csrNeighborRoam.c b/CORE/SME/src/csr/csrNeighborRoam.c index 2af386a039bb..3ef402fea699 100644 --- a/CORE/SME/src/csr/csrNeighborRoam.c +++ b/CORE/SME/src/csr/csrNeighborRoam.c @@ -1938,9 +1938,20 @@ csrNeighborRoamProcessScanResults(tpAniSirGlobal pMac, tANI_U32 CurrAPRssi; tANI_U8 RoamRssiDiff = pMac->roam.configParam.RoamRssiDiff; #if defined (WLAN_FEATURE_VOWIFI_11R) || defined (FEATURE_WLAN_ESE) || defined(FEATURE_WLAN_LFR) - tANI_U8 immediateRoamRssiDiff = pMac->roam.configParam.nImmediateRoamRssiDiff; + tANI_U8 immediateRoamRssiDiff = + pMac->roam.configParam.nImmediateRoamRssiDiff; #endif tANI_BOOLEAN roamNow = eANI_BOOLEAN_FALSE; + tScanResultHandle *pScanResultListSaved = NULL; + tANI_U32 apAgeTicks = 0; + tANI_U32 apAgeLimitTicks = adf_os_msecs_to_ticks(ROAM_AP_AGE_LIMIT_MS); + tANI_U8 numCandidates = 0; + tANI_U8 numAPsDropped = 0; + /* + * first iteration of scan list should consider + * age constraint for candidates + */ + tANI_BOOLEAN ageConstraint = eANI_BOOLEAN_TRUE; /*************************************************************** * Find out the Current AP RSSI and keep it handy to check if @@ -1950,235 +1961,318 @@ csrNeighborRoamProcessScanResults(tpAniSirGlobal pMac, ***************************************************************/ CurrAPRssi = csrGetCurrentAPRssi(pMac, pScanResultList, sessionId); - /* Expecting the scan result already to be in the sorted order based on the RSSI */ - /* Based on the previous state we need to check whether the list should be sorted again taking neighbor score into consideration */ - /* If previous state is CFG_CHAN_LIST_SCAN, there should not be any neighbor score associated with any of the BSS. - If the previous state is REPORT_QUERY, then there will be neighbor score for each of the APs */ - /* For now, let us take the top of the list provided as it is by the CSR Scan result API. This means it is assumed that neighbor score - and rssi score are in the same order. This will be taken care later */ + /* + * Expecting the scan result already to be in the sorted order based on the + * RSSI. Based on the previous state we need to check whether the list + * should be sorted again taking neighbor score into consideration. If + * previous state is CFG_CHAN_LIST_SCAN, there should not be any neighbor + * score associated with any of the BSS. If the previous state is + * REPORT_QUERY, then there will be neighbor score for each of the APs. For + * now, let us take the top of the list provided as it is by the CSR Scan + * result API. This means it is assumed that neighbor score and rssi score + * are in the same order. This will be taken care later + */ - while (NULL != (pScanResult = csrScanResultGetNext(pMac, *pScanResultList))) - { - VOS_TRACE (VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_DEBUG, - FL("Scan result: BSSID "MAC_ADDRESS_STR" (Rssi %ld, Ch:%d)"), - MAC_ADDR_ARRAY(pScanResult->BssDescriptor.bssId), - abs(pScanResult->BssDescriptor.rssi), - pScanResult->BssDescriptor.channelId); - - if ((VOS_TRUE == vos_mem_compare(pScanResult->BssDescriptor.bssId, - pNeighborRoamInfo->currAPbssid, sizeof(tSirMacAddr))) || - ((eSME_ROAM_TRIGGER_SCAN == pNeighborRoamInfo->cfgRoamEn) && - (VOS_TRUE != vos_mem_compare(pScanResult->BssDescriptor.bssId, - pNeighborRoamInfo->cfgRoambssId, sizeof(tSirMacAddr))))) - { - /* currently associated AP. Do not have this in the roamable AP list */ - VOS_TRACE (VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, - "SKIP-currently associated AP"); - continue; - } + do { + /* save the scan result pointer for next iteration */ + pScanResultListSaved = pScanResultList; + while (NULL != (pScanResult = csrScanResultGetNext(pMac, + *pScanResultList))) { + VOS_TRACE (VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_DEBUG, + FL("Scan result: BSSID "MAC_ADDRESS_STR" (Rssi %ld, Ch:%d)"), + MAC_ADDR_ARRAY(pScanResult->BssDescriptor.bssId), + abs(pScanResult->BssDescriptor.rssi), + pScanResult->BssDescriptor.channelId); + + if ((VOS_TRUE == vos_mem_compare(pScanResult->BssDescriptor.bssId, + pNeighborRoamInfo->currAPbssid, sizeof(tSirMacAddr))) || + ((eSME_ROAM_TRIGGER_SCAN == pNeighborRoamInfo->cfgRoamEn) && + (VOS_TRUE != vos_mem_compare(pScanResult->BssDescriptor.bssId, + pNeighborRoamInfo->cfgRoambssId, sizeof(tSirMacAddr))))) { + /* + * currently associated AP. Do not have this in the roamable AP + * list + */ + VOS_TRACE (VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, + "SKIP-currently associated AP"); + continue; + } #ifdef FEATURE_WLAN_LFR #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD - /* In case of reassoc requested by upper layer, look for exact match of bssid & channel; - csr cache might have duplicates*/ - if ((pNeighborRoamInfo->uOsRequestedHandoff) && - ((VOS_FALSE == vos_mem_compare(pScanResult->BssDescriptor.bssId, - pNeighborRoamInfo->handoffReqInfo.bssid, - sizeof(tSirMacAddr)))|| - (pScanResult->BssDescriptor.channelId != pNeighborRoamInfo->handoffReqInfo.channel))) - - { - VOS_TRACE (VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, + /* + * In case of reassoc requested by upper layer, look for exact match + * of bssid & channel. csr cache might have duplicates + */ + if ((pNeighborRoamInfo->uOsRequestedHandoff) && + ((VOS_FALSE == vos_mem_compare(pScanResult->BssDescriptor.bssId, + pNeighborRoamInfo->handoffReqInfo.bssid, + sizeof(tSirMacAddr)))|| + (pScanResult->BssDescriptor.channelId != + pNeighborRoamInfo->handoffReqInfo.channel))) { + VOS_TRACE (VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, "SKIP-not a candidate AP for OS requested roam"); - continue; - } + continue; + } #endif #endif - /* This condition is to ensure to roam to an AP with better RSSI. if the value of RoamRssiDiff is Zero, this feature - * is disabled and we continue to roam without any check*/ - if ((RoamRssiDiff > 0) + /* + * This condition is to ensure to roam to an AP with better RSSI. + * if the value of RoamRssiDiff is Zero, this feature + * is disabled and we continue to roam without any check + */ + if ((RoamRssiDiff > 0) #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD - && !csrRoamIsRoamOffloadScanEnabled(pMac) + && !csrRoamIsRoamOffloadScanEnabled(pMac) #endif - && ((eSME_ROAM_TRIGGER_SCAN != pNeighborRoamInfo->cfgRoamEn) || - (eSME_ROAM_TRIGGER_FAST_ROAM != pNeighborRoamInfo->cfgRoamEn))) - { - /* - * If RSSI is lower than the lookup threshold, then continue. - */ - if (abs(pScanResult->BssDescriptor.rssi) > - pNeighborRoamInfo->currentNeighborLookupThreshold) { - VOS_TRACE (VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, - FL("new ap rssi (%d) lower than lookup threshold (%d)"), - (int)pScanResult->BssDescriptor.rssi * (-1), - (int)pNeighborRoamInfo->currentNeighborLookupThreshold * (-1)); - continue; - } + && ((eSME_ROAM_TRIGGER_SCAN != pNeighborRoamInfo->cfgRoamEn) || + (eSME_ROAM_TRIGGER_FAST_ROAM != pNeighborRoamInfo->cfgRoamEn))) { + /* + * If RSSI is lower than the lookup threshold, then continue. + */ + if (abs(pScanResult->BssDescriptor.rssi) > + pNeighborRoamInfo->currentNeighborLookupThreshold) { + VOS_TRACE (VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, + FL("new ap rssi (%d) lower than lookup threshold (%d)"), + (int)pScanResult->BssDescriptor.rssi * (-1), + (int)pNeighborRoamInfo->currentNeighborLookupThreshold * (-1)); + continue; + } - if (abs(CurrAPRssi) < abs(pScanResult->BssDescriptor.rssi)) - { - /* Do not roam to an AP with worse RSSI than the current */ - VOS_TRACE (VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, - "%s: [INFOLOG]Current AP rssi=%d new ap rssi worse=%d", __func__, - CurrAPRssi, - (int)pScanResult->BssDescriptor.rssi * (-1) ); - continue; - } else { - /*Do not roam to an AP which is having better RSSI than the current AP, but still less than the - * margin that is provided by user from the ini file (RoamRssiDiff)*/ - if (abs(abs(CurrAPRssi) - abs(pScanResult->BssDescriptor.rssi)) < RoamRssiDiff) - { - VOS_TRACE (VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, - "%s: [INFOLOG]Current AP rssi=%d new ap rssi=%d not good enough, roamRssiDiff=%d", __func__, + if (abs(CurrAPRssi) < abs(pScanResult->BssDescriptor.rssi)) { + /* Do not roam to an AP with worse RSSI than the current */ + VOS_TRACE (VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, + "%s: [INFOLOG]Current AP rssi=%d new ap rssi " + "worse=%d", __func__, + CurrAPRssi, + (int)pScanResult->BssDescriptor.rssi * (-1) ); + continue; + } else { + /* + * Do not roam to an AP which is having better RSSI than the + * current AP, but still less than the margin that is + * provided by user from the ini file (RoamRssiDiff) + */ + if (abs(abs(CurrAPRssi) - + abs(pScanResult->BssDescriptor.rssi)) < RoamRssiDiff) { + VOS_TRACE (VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, + "%s: [INFOLOG]Current AP rssi=%d new ap " + "rssi=%d not good enough, roamRssiDiff=%d", + __func__, + CurrAPRssi, + (int)pScanResult->BssDescriptor.rssi * (-1), + RoamRssiDiff); + continue; + } else { + VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, + "%s: [INFOLOG]Current AP rssi=%d new ap " + "rssi better=%d", + __func__, CurrAPRssi, - (int)pScanResult->BssDescriptor.rssi * (-1), - RoamRssiDiff); - continue; - } - else { - VOS_TRACE (VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, - "%s: [INFOLOG]Current AP rssi=%d new ap rssi better=%d", __func__, - CurrAPRssi, - (int)pScanResult->BssDescriptor.rssi * (-1) ); - } - } - } + (int)pScanResult->BssDescriptor.rssi * (-1) ); + } + } + } #ifdef WLAN_FEATURE_VOWIFI_11R - if (pNeighborRoamInfo->is11rAssoc) { - if (!csrNeighborRoamIsPreauthCandidate(pMac, sessionId, - pScanResult->BssDescriptor.bssId)) { - smsLog(pMac, LOGE, FL("BSSID present in pre-auth fail list.. Ignoring")); - continue; - } - } + if (pNeighborRoamInfo->is11rAssoc) { + if (!csrNeighborRoamIsPreauthCandidate(pMac, sessionId, + pScanResult->BssDescriptor.bssId)) { + smsLog(pMac, LOGE, + FL("BSSID present in pre-auth fail list.. Ignoring")); + continue; + } + } #endif /* WLAN_FEATURE_VOWIFI_11R */ #ifdef FEATURE_WLAN_ESE #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD - if (!csrRoamIsRoamOffloadScanEnabled(pMac)) - { -#endif - if (pNeighborRoamInfo->isESEAssoc) - { - if (!csrNeighborRoamIsPreauthCandidate(pMac, sessionId, - pScanResult->BssDescriptor.bssId)) { - smsLog(pMac, LOGE, FL("BSSID present in pre-auth fail list.. Ignoring")); - continue; - } - } - if ((pScanResult->BssDescriptor.QBSSLoad_present) && - (pScanResult->BssDescriptor.QBSSLoad_avail)) - { - if (pNeighborRoamInfo->isVOAdmitted) - { - smsLog(pMac, LOG1, FL("New AP has %x BW available"), (unsigned int)pScanResult->BssDescriptor.QBSSLoad_avail); - smsLog(pMac, LOG1, FL("We need %x BW available"),(unsigned int)pNeighborRoamInfo->MinQBssLoadRequired); - if (pScanResult->BssDescriptor.QBSSLoad_avail < pNeighborRoamInfo->MinQBssLoadRequired) - { - VOS_TRACE (VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, - "[INFOLOG]BSSID : "MAC_ADDRESS_STR" has no bandwidth ignoring..not adding to roam list", + if (!csrRoamIsRoamOffloadScanEnabled(pMac)) { +#endif + if (pNeighborRoamInfo->isESEAssoc) { + if (!csrNeighborRoamIsPreauthCandidate(pMac, sessionId, + pScanResult->BssDescriptor.bssId)) { + smsLog(pMac, LOGE, + FL("BSSID present in pre-auth fail list.. Ignoring")); + continue; + } + } + if ((pScanResult->BssDescriptor.QBSSLoad_present) && + (pScanResult->BssDescriptor.QBSSLoad_avail)) { + if (pNeighborRoamInfo->isVOAdmitted) { + smsLog(pMac, LOG1, FL("New AP has %x BW available"), + (unsigned int)pScanResult->BssDescriptor.QBSSLoad_avail); + smsLog(pMac, LOG1, FL("We need %x BW available"), + (unsigned int)pNeighborRoamInfo->MinQBssLoadRequired); + if (pScanResult->BssDescriptor.QBSSLoad_avail < + pNeighborRoamInfo->MinQBssLoadRequired) { + VOS_TRACE (VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, + "[INFOLOG]BSSID : "MAC_ADDRESS_STR" has no" + " bandwidth ignoring..not adding to roam" + " list", MAC_ADDR_ARRAY(pScanResult->BssDescriptor.bssId)); + continue; + } + } + } else { + smsLog(pMac, LOGE, FL("No QBss %x %x"), + (unsigned int)pScanResult->BssDescriptor.QBSSLoad_avail, + (unsigned int)pScanResult->BssDescriptor.QBSSLoad_present); + if (pNeighborRoamInfo->isVOAdmitted) { + VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, + "[INFOLOG]BSSID : "MAC_ADDRESS_STR" has no " + "QBSSLoad IE, ignoring..not adding to roam list", + MAC_ADDR_ARRAY(pScanResult->BssDescriptor.bssId)); continue; } - } - } - else - { - smsLog(pMac, LOGE, FL("No QBss %x %x"), (unsigned int)pScanResult->BssDescriptor.QBSSLoad_avail, (unsigned int)pScanResult->BssDescriptor.QBSSLoad_present); - if (pNeighborRoamInfo->isVOAdmitted) - { - VOS_TRACE (VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, - "[INFOLOG]BSSID : "MAC_ADDRESS_STR" has no QBSSLoad IE, ignoring..not adding to roam list", - MAC_ADDR_ARRAY(pScanResult->BssDescriptor.bssId)); - continue; - } - } + } #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD - } + } #endif #endif /* FEATURE_WLAN_ESE */ #ifdef FEATURE_WLAN_LFR - // If we are supporting legacy roaming, and - // if the candidate is on the "pre-auth failed" list, ignore it. - if (csrRoamIsFastRoamEnabled(pMac, sessionId)) { - if (!csrNeighborRoamIsPreauthCandidate(pMac, sessionId, - pScanResult->BssDescriptor.bssId)) { - smsLog(pMac, LOGE, FL("BSSID present in pre-auth fail list.. Ignoring")); - continue; + /* + * If we are supporting legacy roaming, and + * if the candidate is on the "pre-auth failed" list, ignore it. + */ + if (csrRoamIsFastRoamEnabled(pMac, sessionId)) { + if (!csrNeighborRoamIsPreauthCandidate(pMac, sessionId, + pScanResult->BssDescriptor.bssId)) { + smsLog(pMac, LOGE, + FL("BSSID present in pre-auth fail list.. Ignoring")); + continue; + } } - } #endif /* FEATURE_WLAN_LFR */ - /* If the received timestamp in BSS description is earlier than the scan request timestamp, skip - * this result */ - if ((pNeighborRoamInfo->scanRequestTimeStamp >= pScanResult->BssDescriptor.nReceivedTime) + /* + * If the received timestamp in BSS description is earlier than the + * scan request timestamp, skip this result + */ + if ((pNeighborRoamInfo->scanRequestTimeStamp >= + pScanResult->BssDescriptor.nReceivedTime) #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD - && !csrRoamIsRoamOffloadScanEnabled(pMac) + && !csrRoamIsRoamOffloadScanEnabled(pMac) #endif - ) - { - smsLog(pMac, LOGE, FL("Ignoring BSS as it is older than the scan request timestamp")); - continue; - } - - pBssInfo = vos_mem_malloc(sizeof(tCsrNeighborRoamBSSInfo)); - if (NULL == pBssInfo) - { - smsLog(pMac, LOGE, FL("Memory allocation for Neighbor Roam BSS Info failed.. Just ignoring")); - continue; - } - - pBssInfo->pBssDescription = vos_mem_malloc(pScanResult->BssDescriptor.length + sizeof(pScanResult->BssDescriptor.length)); - if (pBssInfo->pBssDescription != NULL) - { - vos_mem_copy(pBssInfo->pBssDescription, &pScanResult->BssDescriptor, - pScanResult->BssDescriptor.length + sizeof(pScanResult->BssDescriptor.length)); - } - else - { - smsLog(pMac, LOGE, FL("Memory allocation for Neighbor Roam BSS Descriptor failed.. Just ignoring")); - vos_mem_free(pBssInfo); - continue; - - } - pBssInfo->apPreferenceVal = 10; //some value for now. Need to calculate the actual score based on RSSI and neighbor AP score + ) { + smsLog(pMac, LOGE, + FL("Ignoring BSS as it is older than the scan request " + "timestamp")); + continue; + } - /* Just add to the end of the list as it is already sorted by RSSI */ - csrLLInsertTail(&pNeighborRoamInfo->roamableAPList, &pBssInfo->List, LL_ACCESS_LOCK); + pBssInfo = vos_mem_malloc(sizeof(tCsrNeighborRoamBSSInfo)); + if (NULL == pBssInfo) { + smsLog(pMac, LOGE, + FL("Memory allocation for Neighbor Roam BSS Info " + "failed.. Just ignoring")); + continue; + } + pBssInfo->pBssDescription = + vos_mem_malloc(pScanResult->BssDescriptor.length + + sizeof(pScanResult->BssDescriptor.length)); + if (pBssInfo->pBssDescription != NULL) { + vos_mem_copy(pBssInfo->pBssDescription, + &pScanResult->BssDescriptor, + pScanResult->BssDescriptor.length + + sizeof(pScanResult->BssDescriptor.length)); + } else { + smsLog(pMac, LOGE, + FL("Memory allocation for Neighbor Roam BSS Descriptor " + "failed.. Just ignoring")); + vos_mem_free(pBssInfo); + continue; + } + /* + * some value for now. Need to calculate the actual score based on + * RSSI and neighbor AP score + */ + pBssInfo->apPreferenceVal = 10; + + if (ageConstraint == eANI_BOOLEAN_FALSE) { + /* just add to candidate list, irrespective of age */ + numCandidates++; + csrLLInsertTail(&pNeighborRoamInfo->roamableAPList, + &pBssInfo->List, + LL_ACCESS_LOCK); + } else { + /* check the age of the AP first */ + apAgeTicks = (tANI_TIMESTAMP)palGetTickCount(pMac->hHdd) - + pScanResult->BssDescriptor.nReceivedTime; + if (apAgeTicks < apAgeLimitTicks) { + numCandidates++; + csrLLInsertTail(&pNeighborRoamInfo->roamableAPList, + &pBssInfo->List, + LL_ACCESS_LOCK); + } else { + numAPsDropped++; + VOS_TRACE( VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_WARN, + FL("Skipping because received AP " + "(probe rsp/beacon) is old.")); + continue; + } + } #if defined (WLAN_FEATURE_VOWIFI_11R) || defined (FEATURE_WLAN_ESE) || defined(FEATURE_WLAN_LFR) - if ((eSME_ROAM_TRIGGER_SCAN == pNeighborRoamInfo->cfgRoamEn) || - (eSME_ROAM_TRIGGER_FAST_ROAM == pNeighborRoamInfo->cfgRoamEn)) - { - roamNow = eANI_BOOLEAN_FALSE; - } - else if ((abs(abs(CurrAPRssi) - abs(pScanResult->BssDescriptor.rssi)) >= immediateRoamRssiDiff) + if ((eSME_ROAM_TRIGGER_SCAN == pNeighborRoamInfo->cfgRoamEn) || + (eSME_ROAM_TRIGGER_FAST_ROAM == pNeighborRoamInfo->cfgRoamEn)) { + roamNow = eANI_BOOLEAN_FALSE; + } + else if ((abs(abs(CurrAPRssi) - + abs(pScanResult->BssDescriptor.rssi)) >= + immediateRoamRssiDiff) #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD - && !csrRoamIsRoamOffloadScanEnabled(pMac) + && !csrRoamIsRoamOffloadScanEnabled(pMac) #endif - ) - { - VOS_TRACE (VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, - "%s: [INFOLOG] potential candidate to roam immediately (diff=%ld, expected=%d)", - __func__, abs(abs(CurrAPRssi) - abs(pScanResult->BssDescriptor.rssi)), - immediateRoamRssiDiff); - roamNow = eANI_BOOLEAN_TRUE; - } + ) { + VOS_TRACE (VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, + "%s: [INFOLOG] potential candidate to roam " + "immediately (diff=%ld, expected=%d)", + __func__, + abs(abs(CurrAPRssi) - + abs(pScanResult->BssDescriptor.rssi)), + immediateRoamRssiDiff); + roamNow = eANI_BOOLEAN_TRUE; + } #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD - /* If we are here means, FW already found candidates to roam, so we are - good to go with pre-auth */ - if(csrRoamIsRoamOffloadScanEnabled(pMac)) - { - roamNow = eANI_BOOLEAN_TRUE; - } + /* + * If we are here means, FW already found candidates to roam, + * so we are good to go with pre-auth + */ + if(csrRoamIsRoamOffloadScanEnabled(pMac)) { + roamNow = eANI_BOOLEAN_TRUE; + } #endif #endif - } + } /* end of while (csrScanResultGetNext) */ + /* set the scan results for next iteration */ + pScanResultList = pScanResultListSaved; - /* Now we have all the scan results in our local list. Good time to free up the the list we got as a part of csrGetScanResult */ + /* if some candidates were found, then no need to repeat */ + if (numCandidates) + break; + /* + * if ageConstraint is already false, we have done two + * iterations and no candidate were found */ + if (ageConstraint == eANI_BOOLEAN_FALSE) { + VOS_TRACE (VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, + "%s: No roamable candidates found", __func__); + break; + } + /* + * if all candidates were dropped rescan the scan + * list but this time without age constraint. + */ + ageConstraint = eANI_BOOLEAN_FALSE; + /* if no candidates were dropped no need to repeat */ + } while (numAPsDropped); + + /* + * Now we have all the scan results in our local list. Good time to free + * up the the list we got as a part of csrGetScanResult + */ csrScanResultPurge(pMac, *pScanResultList); return roamNow; diff --git a/CORE/SME/src/sme_common/sme_Api.c b/CORE/SME/src/sme_common/sme_Api.c index ff94cb955692..761fd7dc8af2 100644 --- a/CORE/SME/src/sme_common/sme_Api.c +++ b/CORE/SME/src/sme_common/sme_Api.c @@ -72,6 +72,7 @@ #ifdef WLAN_FEATURE_NAN #include "nan_Api.h" #endif +#include "regdomain_common.h" extern tSirRetStatus uMacPostCtrlMsg(void* pSirGlobal, tSirMbMsg* pMb); @@ -10937,6 +10938,7 @@ eHalStatus sme_UpdateTdlsPeerState(tHalHandle hHal, tANI_U8 num; tANI_U8 chanId; tANI_U8 i; + tANI_U8 preOffChanOffset; if (eHAL_STATUS_SUCCESS == (status = sme_AcquireGlobalLock(&pMac->sme))) { @@ -11033,6 +11035,19 @@ eHalStatus sme_UpdateTdlsPeerState(tHalHandle hHal, pTdlsPeerStateParams->peerCap.prefOffChanBandwidth = peerStateParams->peerCap.prefOffChanBandwidth; + /* Ideally better to get offset from ini or userspace, for now + * in case of 40MHz, assume lower primary + */ + if (pTdlsPeerStateParams->peerCap.prefOffChanBandwidth == 20) + preOffChanOffset = BW20; + else + preOffChanOffset = BW40_LOW_PRIMARY; + + pTdlsPeerStateParams->peerCap.opClassForPrefOffChan = + regdm_get_opclass_from_channel(pMac->scan.countryCodeCurrent, + pTdlsPeerStateParams->peerCap.prefOffChanNum, + preOffChanOffset); + vosMessage.type = WDA_UPDATE_TDLS_PEER_STATE; vosMessage.reserved = 0; vosMessage.bodyptr = pTdlsPeerStateParams; diff --git a/CORE/WDA/inc/legacy/halMsgApi.h b/CORE/WDA/inc/legacy/halMsgApi.h index c692075e1675..063a0649f958 100644 --- a/CORE/WDA/inc/legacy/halMsgApi.h +++ b/CORE/WDA/inc/legacy/halMsgApi.h @@ -1431,6 +1431,7 @@ typedef struct { tANI_U8 peerOperClass[HAL_TDLS_MAX_SUPP_OPER_CLASSES]; tANI_U8 prefOffChanNum; tANI_U8 prefOffChanBandwidth; + tANI_U8 opClassForPrefOffChan; } tTdlsPeerCapParams; typedef struct sTdlsPeerStateParams diff --git a/CORE/WDA/inc/legacy/palTypes.h b/CORE/WDA/inc/legacy/palTypes.h index baf1a4203ed2..c5163e20027a 100644 --- a/CORE/WDA/inc/legacy/palTypes.h +++ b/CORE/WDA/inc/legacy/palTypes.h @@ -51,30 +51,6 @@ #ifndef MK_IMAGE_HDR // -// Validate the Bus type being built.... -// -#if defined(ANI_BUS_TYPE_PCI) - -#if defined( ANI_BUS_TYPE_PCIe ) || defined( ANI_BUS_TYPE_PLATFORM ) -#error "more than one ANI_BUS_TYPE_xxx is defined for this build" -#endif // - -#elif defined( ANI_BUS_TYPE_PCIe ) - -#if defined( ANI_BUS_TYPE_PCI ) || defined( ANI_BUS_TYPE_PLATFORM ) -#error "more than one ANI_BUS_TYPE_xxx is defined for this build" -#endif - -#elif defined( ANI_BUS_TYPE_PLATFORM ) - -#if defined( ANI_BUS_TYPE_PCIe ) || defined(ANI_BUS_TYPE_PCI) -#error "more than one ANI_BUS_TYPE_xxx is defined for this build" -#endif - -#endif - - -// // Validate the OS Type being built... // diff --git a/CORE/WDI/DP/inc/wlan_qct_wdi_ds_i.h b/CORE/WDI/DP/inc/wlan_qct_wdi_ds_i.h index 10dfa2f3a7c2..79d17cfa313b 100644 --- a/CORE/WDI/DP/inc/wlan_qct_wdi_ds_i.h +++ b/CORE/WDI/DP/inc/wlan_qct_wdi_ds_i.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. * @@ -44,7 +44,6 @@ #include "wlan_qct_pal_type.h" #include "wlan_qct_pal_status.h" #include "wlan_qct_pal_packet.h" -#include "wlan_qct_pal_trace.h" #include "wlan_qct_wdi_ds.h" #include "wlan_qct_dxe.h" diff --git a/CORE/WDI/WPAL/inc/wlan_qct_os_trace.h b/CORE/WDI/WPAL/inc/wlan_qct_os_trace.h deleted file mode 100644 index 4ffede5f7599..000000000000 --- a/CORE/WDI/WPAL/inc/wlan_qct_os_trace.h +++ /dev/null @@ -1,114 +0,0 @@ -/* - * Copyright (c) 2014 The Linux Foundation. All rights reserved. - * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all - * copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL - * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE - * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL - * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR - * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER - * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - -#if !defined( __WLAN_QCT_OS_TRACE_H ) -#define __WLAN_QCT_OS_TRACE_H - -#include <vos_trace.h> - -#if !defined(__printf) -#define __printf(a,b) -#endif - -#ifdef WLAN_DEBUG - -/**---------------------------------------------------------------------------- - - \brief WPAL_TRACE() / wpalTrace() - Trace / logging API - - Users wishing to add tracing information to their code should use - WPAL_TRACE. WPAL_TRACE() will compile into a call to wpalTrace() when - tracing is enabled. - - \param module - module identifier. A member of the wpt_moduleid - enumeration that identifies the module issuing the trace message. - - \param level - trace level. A member of the wpt_tracelevel - enumeration indicating the severity of the condition causing the - trace message to be issued. More severe conditions are more - likely to be logged. - - \param strFormat - format string. The message to be logged. This format - string contains printf-like replacement parameters, which follow - this parameter in the variable argument list. - - \return nothing - - --------------------------------------------------------------------------*/ -void __printf(3,4) wpalTrace( wpt_moduleid module, wpt_tracelevel level, - char *strFormat, ... ); - -/**---------------------------------------------------------------------------- - - \brief WPAL_DUMP() / wpalDump() - Trace / logging API - - Users wishing to add tracing memory dumps to their code should use - WPAL_DUMP. WPAL_DUMP() will compile into a call to wpalDump() when - tracing is enabled. - - \param module - module identifier. A member of the wpt_moduleid - enumeration that identifies the module performing the dump - - \param level - trace level. A member of the wpt_tracelevel - enumeration indicating the severity of the condition causing the - memory to be dumped. More severe conditions are more - likely to be logged. - - \param pMemory - memory. A pointer to the memory to be dumped - - \param length - length. How many bytes of memory to be dumped - - \return nothing - - --------------------------------------------------------------------------*/ -void wpalDump( wpt_moduleid module, wpt_tracelevel level, - wpt_uint8 *memory, wpt_uint32 length); - -#define WPAL_ASSERT( _condition ) do { \ - if ( ! ( _condition ) ) \ - { \ - printk(KERN_CRIT "VOS ASSERT in %s Line %d\n", __func__, __LINE__); \ - WARN_ON(1); \ - } \ - } while (0) -#else //WLAN_DEBUG - -static inline void wpalTrace( wpt_moduleid module, wpt_tracelevel level, - char *strFormat, ... ){}; -static inline void wpalDump( wpt_moduleid module, wpt_tracelevel level, - wpt_uint8 *memory, wpt_uint32 length) {}; -static inline void wpalTraceSetLevel( wpt_moduleid module, - wpt_tracelevel level, wpt_boolean on ) {}; -static inline void wpalTraceDisplay(void) {}; -#define WPAL_ASSERT(x) do {} while (0); - -#endif //WLAN_DEBUG - -#define WPAL_TRACE wpalTrace -#define WPAL_DUMP wpalDump - -#endif // __WLAN_QCT_OS_TRACE_H diff --git a/CORE/WDI/WPAL/inc/wlan_qct_pal_device.h b/CORE/WDI/WPAL/inc/wlan_qct_pal_device.h index 04f44a287233..2cab4ee93d9b 100644 --- a/CORE/WDI/WPAL/inc/wlan_qct_pal_device.h +++ b/CORE/WDI/WPAL/inc/wlan_qct_pal_device.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011-2012 The Linux Foundation. All rights reserved. + * Copyright (c) 2011-2012, 2014 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -52,7 +52,6 @@ * ==================================================================================================================*/ #include "wlan_qct_pal_type.h" #include "wlan_qct_pal_status.h" -#include "wlan_qct_pal_trace.h" /* ==================================================================================================================== PREPROCESSORS AND DEFINITIONS diff --git a/CORE/WDI/WPAL/inc/wlan_qct_pal_trace.h b/CORE/WDI/WPAL/inc/wlan_qct_pal_trace.h deleted file mode 100644 index 251030748f70..000000000000 --- a/CORE/WDI/WPAL/inc/wlan_qct_pal_trace.h +++ /dev/null @@ -1,134 +0,0 @@ -/* - * Copyright (c) 2014 The Linux Foundation. All rights reserved. - * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all - * copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL - * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE - * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL - * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR - * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER - * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - -#if !defined( __WLAN_QCT_PAL_TRACE_H ) -#define __WLAN_QCT_PAL_TRACE_H - -/**========================================================================= - - \file wlan_qct_pal_api.h - - \brief define general APIs PAL exports. wpt = (Wlan Pal Type) wpal = (Wlan PAL) - - Definitions for platform independent - - ========================================================================*/ - -#include "wlan_qct_pal_type.h" -#include "wlan_qct_pal_status.h" - -typedef enum -{ - // NONE means NO traces will be logged. This value is in place for the - // vos_trace_setlevel() to allow the user to turn off all traces. - eWLAN_PAL_TRACE_LEVEL_NONE = 0, - - // the following trace levels are the ones that 'callers' of VOS_TRACE() - // can specify in for the VOS_TRACE_LEVEL parameter. Traces are classified - // by severity (FATAL being more serious than INFO for example). - eWLAN_PAL_TRACE_LEVEL_FATAL, - eWLAN_PAL_TRACE_LEVEL_ERROR, - eWLAN_PAL_TRACE_LEVEL_WARN, - eWLAN_PAL_TRACE_LEVEL_INFO, - eWLAN_PAL_TRACE_LEVEL_INFO_HIGH, - eWLAN_PAL_TRACE_LEVEL_INFO_MED, - eWLAN_PAL_TRACE_LEVEL_INFO_LOW, - - // ALL means all trace levels will be active. This value is in place for the - // vos_trace_setlevel() to allow the user to turn ON all traces. - eWLAN_PAL_TRACE_LEVEL_ALL, - - // not a real level. Used to identify the maximum number of - // VOS_TRACE_LEVELs defined. - eWLAN_PAL_TRACE_LEVEL_COUNT -} wpt_tracelevel; - -#include "wlan_qct_os_trace.h" - -/*---------------------------------------------------------------------------- - - \brief wpalTraceSetLevel() - Set the trace level for a particular module - - This is an external API that allows trace levels to be set for each module. - - \param module - id of the module whos trace level is being modified - \param level - trace level. A member of the wpt_tracelevel - enumeration indicating the severity of the condition causing the - trace message to be issued. More severe conditions are more - likely to be logged. - \param on - boolean to indicate if tracing at the given level should be - enabled or disabled. - - \return nothing - - \sa - --------------------------------------------------------------------------*/ -void wpalTraceSetLevel( wpt_moduleid module, wpt_tracelevel level, - wpt_boolean on ); - -/**---------------------------------------------------------------------------- - - \brief wpalTraceCheckLevel() - - This is an external API that returns a boolean value to signify if a - particular trace level is set for the specified module. - - \param level - trace level. A member of the wpt_tracelevel enumeration - indicating the severity of the condition causing the trace - message to be issued. - - Note that individual trace levels are the only valid values - for this API. eWLAN_PAL_TRACE_LEVEL_NONE and eWLAN_PAL_TRACE_LEVEL_ALL - are not valid input and will return FALSE - - \return eWLAN_PAL_FALSE - the specified trace level for the specified module is OFF - - eWLAN_PAL_TRUE - the specified trace level for the specified module is ON - - \sa - --------------------------------------------------------------------------*/ -wpt_boolean wpalTraceCheckLevel( wpt_moduleid module, wpt_tracelevel level ); - - -/*---------------------------------------------------------------------------- - - \brief wpalTraceDisplay() - Display current state of trace level for - all modules - - This is an external API that allows trace levels to be displayed to - an end user - - \param none - - \return nothing - - \sa - --------------------------------------------------------------------------*/ -void wpalTraceDisplay(void); - -#define WPAL_BUG VOS_BUG -#endif // __WLAN_QCT_PAL_TRACE_H diff --git a/CORE/WDI/WPAL/src/wlan_qct_pal_trace.c b/CORE/WDI/WPAL/src/wlan_qct_pal_trace.c deleted file mode 100644 index 35f8b16ecb4b..000000000000 --- a/CORE/WDI/WPAL/src/wlan_qct_pal_trace.c +++ /dev/null @@ -1,342 +0,0 @@ -/* - * Copyright (c) 2014 The Linux Foundation. All rights reserved. - * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all - * copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL - * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE - * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL - * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR - * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER - * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - - - -/**========================================================================= - - \file wlan_qct_pal_trace.c - - \brief Implementation trace/logging APIs PAL exports. wpt = (Wlan Pal Type) wpal = (Wlan PAL) - - Definitions for Linux/Android platform - - ========================================================================*/ - -#include "wlan_qct_pal_trace.h" -#include "i_vos_types.h" - -#ifdef WLAN_DEBUG - - -/*-------------------------------------------------------------------------- - Preprocessor definitions and constants - ------------------------------------------------------------------------*/ - -#define WPAL_TRACE_BUFFER_SIZE ( 512 ) - -// macro to map wpal trace levels into the bitmask -#define WPAL_TRACE_LEVEL_TO_MODULE_BITMASK( _level ) ( ( 1 << (_level) ) ) - -typedef struct -{ - // Trace level for a module, as a bitmask. The bits in this mask - // are ordered by wpt_tracelevel. For example, each bit represents - // one of the bits in wpt_tracelevel that may be turned on to have - // traces at that level logged, i.e. if eWLAN_PAL_TRACE_LEVEL_ERROR is - // == 2, then if bit 2 (low order) is turned ON, then ERROR traces - // will be printed to the trace log. - // - // Note that all bits turned OFF means no traces. - wpt_uint16 moduleTraceLevel; - - // 3 character string name for the module - wpt_uint8 moduleNameStr[ 4 ]; // 3 chars plus the NULL - -} moduleTraceInfo; - - -// Array of static data that contains all of the per module trace -// information. This includes the trace level for the module and -// the 3 character 'name' of the module for marking the trace logs. -moduleTraceInfo gTraceInfo[ eWLAN_MODULE_COUNT ] = -{ - { (1<<eWLAN_PAL_TRACE_LEVEL_FATAL)|(1<<eWLAN_PAL_TRACE_LEVEL_ERROR), "DAL" }, - { (1<<eWLAN_PAL_TRACE_LEVEL_FATAL)|(1<<eWLAN_PAL_TRACE_LEVEL_ERROR), "CTL" }, - { (1<<eWLAN_PAL_TRACE_LEVEL_FATAL)|(1<<eWLAN_PAL_TRACE_LEVEL_ERROR), "DAT" }, - { (1<<eWLAN_PAL_TRACE_LEVEL_FATAL)|(1<<eWLAN_PAL_TRACE_LEVEL_ERROR), "PAL" }, -}; - - -// the trace level strings in an array. these are ordered in the same order -// as the trace levels are defined in the enum (see wpt_tracelevel) so we -// can index into this array with the level and get the right string. The -// trace levels are... -// none, Fatal, Error, Warning, Info, InfoHigh, InfoMed, InfoLow -static const char * TRACE_LEVEL_STR[] = { - " ", "F ", "E ", "W ", "I ", "IH", "IM", "IL" }; - - -/*------------------------------------------------------------------------- - Functions - ------------------------------------------------------------------------*/ -static void wpalOutput(wpt_tracelevel level, char *strBuffer) -{ - switch(level) - { - default: - printk(KERN_CRIT "%s: Unknown trace level passed in!\n", __func__); - // fall thru and use FATAL - - case eWLAN_PAL_TRACE_LEVEL_FATAL: - printk(KERN_CRIT "%s\n", strBuffer); - break; - - case eWLAN_PAL_TRACE_LEVEL_ERROR: - printk(KERN_ERR "%s\n", strBuffer); - break; - - case eWLAN_PAL_TRACE_LEVEL_WARN: - printk(KERN_WARNING "%s\n", strBuffer); - break; - - case eWLAN_PAL_TRACE_LEVEL_INFO: - printk(KERN_INFO "%s\n", strBuffer); - break; - - case eWLAN_PAL_TRACE_LEVEL_INFO_HIGH: - printk(KERN_NOTICE "%s\n", strBuffer); - break; - - case eWLAN_PAL_TRACE_LEVEL_INFO_MED: - printk(KERN_NOTICE "%s\n", strBuffer); - break; - - case eWLAN_PAL_TRACE_LEVEL_INFO_LOW: - printk(KERN_INFO "%s\n", strBuffer); - break; - } -} - -void wpalTraceSetLevel( wpt_moduleid module, wpt_tracelevel level, - wpt_boolean on ) -{ - // Make sure the caller is passing in a valid LEVEL and MODULE. - if ( (eWLAN_PAL_TRACE_LEVEL_COUNT <= level) || - (eWLAN_MODULE_COUNT <= module) ) - { - return; - } - - if ( eWLAN_PAL_TRACE_LEVEL_NONE == level ) - { - // Treat 'none' differently. NONE means we have to turn off all - // the bits in the bit mask so none of the traces appear. - gTraceInfo[ module ].moduleTraceLevel = 0; - } - else if ( eWLAN_PAL_TRACE_LEVEL_ALL == level ) - { - // Treat 'all' differently. ALL means we have to turn on all - // the bits in the bit mask so all of the traces appear. - gTraceInfo[ module ].moduleTraceLevel = 0xFFFF; - } - else - { - // We are turning a particular trace level on or off - if (on) - { - // Set the desired bit in the bit mask for the module trace level. - gTraceInfo[ module ].moduleTraceLevel |= - WPAL_TRACE_LEVEL_TO_MODULE_BITMASK( level ); - } - else - { - // Clear the desired bit in the bit mask for the module trace level. - gTraceInfo[ module ].moduleTraceLevel &= - ~(WPAL_TRACE_LEVEL_TO_MODULE_BITMASK( level )); - } - } -} - -wpt_boolean wpalTraceCheckLevel( wpt_moduleid module, wpt_tracelevel level ) -{ - wpt_boolean traceOn = eWLAN_PAL_FALSE; - - if ( ( eWLAN_PAL_TRACE_LEVEL_NONE == level ) || - ( level >= eWLAN_PAL_TRACE_LEVEL_COUNT )) - { - traceOn = eWLAN_PAL_FALSE; - } - else - { - traceOn = ( level & gTraceInfo[ module ].moduleTraceLevel ) ? eWLAN_PAL_TRUE : eWLAN_PAL_FALSE; - } - - return( traceOn ); -} - -void wpalTraceDisplay(void) -{ - wpt_moduleid moduleId; - - printk(KERN_CRIT - " 1)FATAL 2)ERROR 3)WARN 4)INFO " - "5)INFO_H 6)INFO_M 7)INFO_L\n"); - for (moduleId = 0; moduleId < eWLAN_MODULE_COUNT; ++moduleId) - { - printk(KERN_CRIT - "%2d)%s %s %s %s " - "%s %s %s %s\n", - (int)moduleId, - gTraceInfo[moduleId].moduleNameStr, - (gTraceInfo[moduleId].moduleTraceLevel & - (1 << eWLAN_PAL_TRACE_LEVEL_FATAL)) ? "X":" ", - (gTraceInfo[moduleId].moduleTraceLevel & - (1 << eWLAN_PAL_TRACE_LEVEL_ERROR)) ? "X":" ", - (gTraceInfo[moduleId].moduleTraceLevel & - (1 << eWLAN_PAL_TRACE_LEVEL_WARN)) ? "X":" ", - (gTraceInfo[moduleId].moduleTraceLevel & - (1 << eWLAN_PAL_TRACE_LEVEL_INFO)) ? "X":" ", - (gTraceInfo[moduleId].moduleTraceLevel & - (1 << eWLAN_PAL_TRACE_LEVEL_INFO_HIGH)) ? "X":" ", - (gTraceInfo[moduleId].moduleTraceLevel & - (1 << eWLAN_PAL_TRACE_LEVEL_INFO_MED)) ? "X":" ", - (gTraceInfo[moduleId].moduleTraceLevel & - (1 << eWLAN_PAL_TRACE_LEVEL_INFO_LOW)) ? "X":" " - ); - } - -} - -/*---------------------------------------------------------------------------- - - \brief wpalTrace() - Externally called trace function - - Checks the level of severity and accordingly prints the trace messages - - \param module - module identifier. A member of the wpt_moduleid - enumeration that identifies the module issuing the trace message. - - \param level - trace level. A member of the wpt_tracelevel - enumeration indicating the severity of the condition causing the - trace message to be issued. More severe conditions are more - likely to be logged. - - \param strFormat - format string. The message to be logged. This format - string contains printf-like replacement parameters, which follow - this parameter in the variable argument list. - - \return nothing - - \sa - - --------------------------------------------------------------------------*/ -void wpalTrace( wpt_moduleid module, wpt_tracelevel level, char *strFormat, ... ) -{ - wpt_uint8 strBuffer[ WPAL_TRACE_BUFFER_SIZE ]; - int n; - - // Print the trace message when the desired level bit is set in the module - // tracel level mask. - if ( gTraceInfo[ module ].moduleTraceLevel & WPAL_TRACE_LEVEL_TO_MODULE_BITMASK( level ) ) - { - va_list val; - va_start(val, strFormat); - - // print the prefix string into the string buffer... - n = snprintf(strBuffer, WPAL_TRACE_BUFFER_SIZE, "wlan: [%d:%2s:%3s] ", - in_interrupt() ? 0 : current->pid, - (char *) TRACE_LEVEL_STR[ level ], - (char *) gTraceInfo[ module ].moduleNameStr); - - - // print the formatted log message after the prefix string. - // note we reserve space for the terminating NUL - if ((n >= 0) && (n < WPAL_TRACE_BUFFER_SIZE)) - { - vsnprintf(strBuffer + n, WPAL_TRACE_BUFFER_SIZE - n - 1, strFormat, val); - wpalOutput(level, strBuffer); - } - va_end(val); - } -} - -/**---------------------------------------------------------------------------- - - \brief WPAL_DUMP() / wpalDump() - Trace / logging API - - Users wishing to add tracing memory dumps to their code should use - WPAL_DUMP. WPAL_DUMP() will compile into a call to wpalDump() when - tracing is enabled. - - \param module - module identifier. A member of the wpt_moduleid - enumeration that identifies the module performing the dump - - \param level - trace level. A member of the wpt_tracelevel - enumeration indicating the severity of the condition causing the - memory to be dumped. More severe conditions are more - likely to be logged. - - \param pMemory - memory. A pointer to the memory to be dumped - - \param length - length. How many bytes of memory to be dumped - - \return nothing - - --------------------------------------------------------------------------*/ -// how many bytes do we output per line -#define BYTES_PER_LINE 16 - -// each byte takes 2 characters plus a space, plus need room for NUL -#define CHARS_PER_LINE ((BYTES_PER_LINE * 3) + 1) - -void wpalDump( wpt_moduleid module, wpt_tracelevel level, - wpt_uint8 *pMemory, wpt_uint32 length) -{ - char strBuffer[CHARS_PER_LINE]; - int n, num, offset; - - // Dump the memory when the desired level bit is set in the module - // tracel level mask. - if ( gTraceInfo[ module ].moduleTraceLevel & WPAL_TRACE_LEVEL_TO_MODULE_BITMASK( level ) ) - { - num = 0; - offset = 0; - while (length > 0) - { - n = snprintf(strBuffer + offset, CHARS_PER_LINE - offset - 1, - "%02X ", *pMemory); - offset += n; - num++; - length--; - pMemory++; - if (BYTES_PER_LINE == num) - { - wpalOutput(level, strBuffer); - num = 0; - offset = 0; - } - } - - if (offset > 0) - { - // partial line remains - wpalOutput(level, strBuffer); - } - } -} -#endif //WLAN_DEBUG @@ -794,16 +794,11 @@ WDI_TRP_INC := -I$(WLAN_ROOT)/$(WDI_DIR)/TRP/CTS/inc/ \ WDI_WPAL_INC := -I$(WLAN_ROOT)/$(WDI_DIR)/WPAL/inc -WDI_WPAL_SRC_DIR := $(WDI_DIR)/WPAL/src -WDI_WPAL_OBJS := $(WDI_WPAL_SRC_DIR)/wlan_qct_pal_trace.o - WDI_INC := $(WDI_CP_INC) \ $(WDI_DP_INC) \ $(WDI_TRP_INC) \ $(WDI_WPAL_INC) -WDI_OBJS := $(WDI_WPAL_OBJS) - WCNSS_INC := -I$(WLAN_ROOT)/wcnss/inc LINUX_INC := -Iinclude/linux @@ -856,7 +851,6 @@ OBJS := $(BAP_OBJS) \ $(SYS_OBJS) \ $(VOSS_OBJS) \ $(WDA_OBJS) \ - $(WDI_OBJS) \ $(DFS_OBJS) OBJS += $(WMA_OBJS) \ |
