diff options
| author | Rajeev Kumar <rajekuma@qca.qualcomm.com> | 2014-04-25 15:46:05 -0700 |
|---|---|---|
| committer | Akash Patel <c_akashp@qca.qualcomm.com> | 2014-04-29 23:02:42 -0700 |
| commit | 4e9c8ed26e86c815537adbded655c30ee0f28472 (patch) | |
| tree | 3cca3e87cc6d2393aaa2d2d6a9116e3d56279ae0 | |
| parent | 8954d2de57801fe3ce1d8eee1bfd2ac4a8ce5629 (diff) | |
qcacld: Add CFG INI support to enable FW logs
Add CFG INI support to enable FW log at driver load time
Change-Id: I07850b44d95227ad4fd487fc0a6019d16fff88db
CRs-Fixed: 654434
| -rw-r--r-- | CORE/HDD/inc/wlan_hdd_cfg.h | 32 | ||||
| -rw-r--r-- | CORE/HDD/src/wlan_hdd_cfg.c | 30 | ||||
| -rw-r--r-- | CORE/HDD/src/wlan_hdd_main.c | 61 |
3 files changed, 120 insertions, 3 deletions
diff --git a/CORE/HDD/inc/wlan_hdd_cfg.h b/CORE/HDD/inc/wlan_hdd_cfg.h index 3300d9d70f8d..903bb59bdfdd 100644 --- a/CORE/HDD/inc/wlan_hdd_cfg.h +++ b/CORE/HDD/inc/wlan_hdd_cfg.h @@ -50,6 +50,10 @@ #include <wlan_hdd_tgt_cfg.h> #endif +#ifdef QCA_WIFI_2_0 +#define FW_MODULE_LOG_LEVEL_STRING_LENGTH (255) +#endif + //Number of items that can be configured #define MAX_CFG_INI_ITEMS 512 @@ -1594,6 +1598,23 @@ typedef enum #define CFG_ENABLE_PACKET_LOG_MAX ( 1 ) #define CFG_ENABLE_PACKET_LOG_DEFAULT ( 0 ) +#ifdef QCA_WIFI_2_0 +#define CFG_ENABLE_FW_LOG_TYPE "gFwDebugLogType" +#define CFG_ENABLE_FW_LOG_TYPE_MIN ( 0 ) +#define CFG_ENABLE_FW_LOG_TYPE_MAX ( 255 ) +#define CFG_ENABLE_FW_LOG_TYPE_DEFAULT ( 0 ) + + +#define CFG_ENABLE_FW_DEBUG_LOG_LEVEL "gFwDebugLogLevel" +#define CFG_ENABLE_FW_DEBUG_LOG_LEVEL_MIN ( 0 ) +#define CFG_ENABLE_FW_DEBUG_LOG_LEVEL_MAX ( 255 ) +#define CFG_ENABLE_FW_DEBUG_LOG_LEVEL_DEFAULT ( 0 ) + + +#define CFG_ENABLE_FW_MODULE_LOG_LEVEL "gFwDebugModuleLoglevel" +#define CFG_ENABLE_FW_MODULE_LOG_DEFAULT "" +#endif + /* * VOS Trace Enable Control @@ -2983,6 +3004,14 @@ typedef struct v_U32_t busBandwidthLowThreshold; v_U32_t busBandwidthComputeInterval; #endif /* MSM_PLATFORM */ + +#ifdef QCA_WIFI_2_0 + /* FW debug log parameters */ + v_U32_t enableFwLogType; + v_U32_t enableFwLogLevel; + v_U8_t enableFwModuleLogLevel[FW_MODULE_LOG_LEVEL_STRING_LENGTH]; +#endif + } hdd_config_t; /*--------------------------------------------------------------------------- Function declarations and documenation @@ -3101,4 +3130,7 @@ void hdd_update_tgt_cfg(void *context, void *param); void hdd_dfs_indicate_radar(void *context, void *param); #endif /* QCA_WIFI_2_0 && !QCA_WIFI_ISOC */ +VOS_STATUS hdd_string_to_u8_array( char *str, tANI_U8 *intArray, tANI_U8 *len, + tANI_U8 intArrayMaxLen ); + #endif diff --git a/CORE/HDD/src/wlan_hdd_cfg.c b/CORE/HDD/src/wlan_hdd_cfg.c index 51f643204c10..61ce17b363d4 100644 --- a/CORE/HDD/src/wlan_hdd_cfg.c +++ b/CORE/HDD/src/wlan_hdd_cfg.c @@ -3423,6 +3423,31 @@ REG_TABLE_ENTRY g_registry_table[] = CFG_BUS_BANDWIDTH_COMPUTE_INTERVAL_MIN, CFG_BUS_BANDWIDTH_COMPUTE_INTERVAL_MAX), #endif + +#ifdef QCA_WIFI_2_0 + + REG_VARIABLE( CFG_ENABLE_FW_LOG_TYPE , WLAN_PARAM_Integer, + hdd_config_t, enableFwLogType, + VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, + CFG_ENABLE_FW_LOG_TYPE_DEFAULT, + CFG_ENABLE_FW_LOG_TYPE_MIN, + CFG_ENABLE_FW_LOG_TYPE_MAX ), + + REG_VARIABLE( CFG_ENABLE_FW_DEBUG_LOG_LEVEL, WLAN_PARAM_Integer, + hdd_config_t, enableFwLogLevel, + VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, + CFG_ENABLE_FW_DEBUG_LOG_LEVEL_DEFAULT, + CFG_ENABLE_FW_DEBUG_LOG_LEVEL_MIN, + CFG_ENABLE_FW_DEBUG_LOG_LEVEL_MAX ), + + REG_VARIABLE_STRING( CFG_ENABLE_FW_MODULE_LOG_LEVEL, WLAN_PARAM_String, + hdd_config_t, enableFwModuleLogLevel, + VAR_FLAGS_OPTIONAL, + (void *) CFG_ENABLE_FW_MODULE_LOG_DEFAULT), + +#endif + + }; /* @@ -4540,8 +4565,8 @@ VOS_STATUS hdd_set_idle_ps_config(hdd_context_t *pHddCtx, v_U32_t val) return status; } -#ifdef WLAN_FEATURE_NEIGHBOR_ROAMING -static VOS_STATUS hdd_string_to_u8_array( char *str, tANI_U8 *intArray, tANI_U8 *len, tANI_U8 intArrayMaxLen ) +VOS_STATUS hdd_string_to_u8_array( char *str, tANI_U8 *intArray, tANI_U8 *len, + tANI_U8 intArrayMaxLen ) { char *s = str; @@ -4569,7 +4594,6 @@ static VOS_STATUS hdd_string_to_u8_array( char *str, tANI_U8 *intArray, tANI_U8 return VOS_STATUS_SUCCESS; } -#endif v_BOOL_t hdd_update_config_dat( hdd_context_t *pHddCtx ) diff --git a/CORE/HDD/src/wlan_hdd_main.c b/CORE/HDD/src/wlan_hdd_main.c index 14462fe4e3c3..b8f427857035 100644 --- a/CORE/HDD/src/wlan_hdd_main.c +++ b/CORE/HDD/src/wlan_hdd_main.c @@ -8417,6 +8417,67 @@ hdd_adapter_t* hdd_open_adapter( hdd_context_t *pHddCtx, tANI_U8 session_type, #endif + /* Enable FW logs based on INI configuration */ + if ((VOS_FTM_MODE != vos_get_conparam()) && + (pHddCtx->cfg_ini->enableFwLogType)) + { + tANI_U8 count = 0; + tANI_U32 value = 0; + tANI_U8 numEntries = 0; + tANI_U8 moduleLoglevel[FW_MODULE_LOG_LEVEL_STRING_LENGTH]; + + ret = process_wma_set_command( (int)pAdapter->sessionId, + (int)WMI_DBGLOG_TYPE, + pHddCtx->cfg_ini->enableFwLogType, DBG_CMD ); + if (ret != 0) + { + hddLog(LOGE, FL("Failed to enable FW log type ret %d"), ret); + } + + ret = process_wma_set_command((int)pAdapter->sessionId, + (int)WMI_DBGLOG_LOG_LEVEL, + pHddCtx->cfg_ini->enableFwLogLevel, DBG_CMD); + if (ret != 0) + { + hddLog(LOGE, FL("Failed to enable FW log level ret %d"), ret); + } + + hdd_string_to_u8_array( pHddCtx->cfg_ini->enableFwModuleLogLevel, + moduleLoglevel, + &numEntries, + FW_MODULE_LOG_LEVEL_STRING_LENGTH ); + while (count < numEntries) + { + /* FW module log level input string looks like below: + gFwDebugModuleLoglevel=<FW Module ID>, <Log Level>, so on.... + For example: + gFwDebugModuleLoglevel=1,0,2,1,3,2,4,3,5,4,6,5,7,6,8,7 + Above input string means : + For FW module ID 1 enable log level 0 + For FW module ID 2 enable log level 1 + For FW module ID 3 enable log level 2 + For FW module ID 4 enable log level 3 + For FW module ID 5 enable log level 4 + For FW module ID 6 enable log level 5 + For FW module ID 7 enable log level 6 + For FW module ID 8 enable log level 7 + */ + /* FW expects WMI command value = Module ID * 10 + Module Log level */ + value = ( (moduleLoglevel[count] * 10) + moduleLoglevel[count + 1] ); + ret = process_wma_set_command((int)pAdapter->sessionId, + (int)WMI_DBGLOG_MOD_LOG_LEVEL, + value, DBG_CMD); + if (ret != 0) + { + hddLog(LOGE, FL("Failed to enable FW module log level %d ret %d"), + value, ret); + } + + count += 2; + } + } + + return pAdapter; err_free_netdev: |
