qcacld-3.0: Refactor ol_sc for target_info and ini params

Clean up driver modules to query hif for the handle, instead
of accessing hif context in other modules.

Change-Id: If179255b355916794c9097cf8ff1cbc64ba5df84
CRs-Fixed: 967765
This commit is contained in:
Komal Seelam 2016-01-27 18:57:10 +05:30 • committed by Prakash Dhavali
commit c11bb2226c
11 changed files with 146 additions and 87 deletions

View file

@ -1,5 +1,5 @@
/*
* copyright (c) 2014-2015 The Linux Foundation. All rights reserved.
* copyright (c) 2014-2016 The Linux Foundation. All rights reserved.
*
* Previously licensed under the ISC license by Qualcomm Atheros, Inc.
*
@ -234,8 +234,9 @@ bmi_firmware_download(struct ol_softc *scn)
{
CDF_STATUS status;
struct bmi_target_info targ_info;
cdf_mem_zero(&targ_info, sizeof(targ_info));
struct hif_target_info *tgt_info = hif_get_target_info_handle(scn);
cdf_mem_zero(&targ_info, sizeof(targ_info));
/* Initialize BMI */
status = bmi_init(scn);
if (status != CDF_STATUS_SUCCESS) {
@ -250,8 +251,8 @@ bmi_firmware_download(struct ol_softc *scn)
return status;
}
scn->target_type = targ_info.target_type;
scn->target_version = targ_info.target_ver;
tgt_info->target_type = targ_info.target_type;
tgt_info->target_version = targ_info.target_ver;
/* Configure target */
status = ol_configure_target(scn);

View file

@ -1,5 +1,5 @@
/*
* copyright (c) 2014-2015 The Linux Foundation. All rights reserved.
* copyright (c) 2014-2016 The Linux Foundation. All rights reserved.
*
* Previously licensed under the ISC license by Qualcomm Atheros, Inc.
*
@ -382,6 +382,7 @@ static CDF_STATUS bmi_enable(struct ol_softc *scn)
struct bmi_target_info targ_info;
struct image_desc_info image_desc_info;
CDF_STATUS status;
struct hif_target_info *tgt_info;
if (!scn) {
BMI_ERR("Invalid scn context");
@ -389,6 +390,8 @@ static CDF_STATUS bmi_enable(struct ol_softc *scn)
return CDF_STATUS_NOT_INITIALIZED;
}
tgt_info = hif_get_target_info_handle(scn);
if (scn->bmi_cmd_buff == NULL || scn->bmi_rsp_buff == NULL) {
BMI_ERR("bmi_open failed!");
return CDF_STATUS_NOT_INITIALIZED;
@ -400,8 +403,9 @@ static CDF_STATUS bmi_enable(struct ol_softc *scn)
BMI_DBG("%s: target type 0x%x, target ver 0x%x", __func__,
targ_info.target_type, targ_info.target_ver);
scn->target_type = targ_info.target_type;
scn->target_version = targ_info.target_ver;
tgt_info->target_type = targ_info.target_type;
tgt_info->target_version = targ_info.target_ver;
if (cnss_get_fw_image(&image_desc_info) != 0) {
BMI_ERR("Failed to get fw image");

View file

@ -146,6 +146,8 @@ static int __ol_transfer_bin_file(struct ol_softc *scn, ATH_BIN_FILE file,
int bin_off, bin_len;
SIGN_HEADER_T *sign_header;
#endif
struct hif_target_info *tgt_info = hif_get_target_info_handle(scn);
uint32_t target_type = tgt_info->target_type;
switch (file) {
default:
@ -303,7 +305,7 @@ static int __ol_transfer_bin_file(struct ol_softc *scn, ATH_BIN_FILE file,
cdf_mem_copy(temp_eeprom, (uint8_t *) fw_entry->data,
fw_entry_size);
switch (scn->target_type) {
switch (target_type) {
default:
board_data_size = 0;
board_ext_data_size = 0;
@ -318,7 +320,7 @@ static int __ol_transfer_bin_file(struct ol_softc *scn, ATH_BIN_FILE file,
}
/* Determine where in Target RAM to write Board Data */
bmi_read_memory(HOST_INTEREST_ITEM_ADDRESS(scn->target_type,
bmi_read_memory(HOST_INTEREST_ITEM_ADDRESS(target_type,
hi_board_ext_data),
(uint8_t *) &board_ext_address, 4, scn);
BMI_INFO("Board extended Data download address: 0x%x",
@ -344,7 +346,7 @@ static int __ol_transfer_bin_file(struct ol_softc *scn, ATH_BIN_FILE file,
/* Record extended board Data initialized */
param = (board_ext_data_size << 16) | 1;
bmi_write_memory(
HOST_INTEREST_ITEM_ADDRESS(scn->target_type,
HOST_INTEREST_ITEM_ADDRESS(target_type,
hi_board_ext_data_config),
(uint8_t *)&param, 4, scn);
@ -498,11 +500,15 @@ static void ramdump_work_handler(struct work_struct *ramdump)
int ret;
uint32_t host_interest_address;
uint32_t dram_dump_values[4];
uint32_t target_type;
struct hif_target_info *tgt_info;
if (!ramdump_scn) {
BMI_ERR("%s:Ramdump_scn is null:", __func__);
goto out_fail;
}
tgt_info = hif_get_target_info_handle(ramdump_scn);
target_type = tgt_info->target_type;
#ifdef DEBUG
ret = hif_check_soc_status(ramdump_scn);
if (ret)
@ -515,7 +521,7 @@ static void ramdump_work_handler(struct work_struct *ramdump)
#endif
if (hif_diag_read_mem(ramdump_scn,
hif_hia_item_address(ramdump_scn->target_type,
hif_hia_item_address(target_type,
offsetof(struct host_interest_s, hi_failure_state)),
(uint8_t *)&host_interest_address,
sizeof(uint32_t)) != CDF_STATUS_SUCCESS) {
@ -579,6 +585,7 @@ void ol_target_failure(void *instance, CDF_STATUS status)
{
struct ol_softc *scn = (struct ol_softc *)instance;
tp_wma_handle wma = cds_get_context(CDF_MODULE_ID_WMA);
struct hif_config_info *ini_cfg = hif_get_ini_handle(scn);
int ret;
cdf_event_set(&wma->recovery_event);
@ -604,7 +611,7 @@ void ol_target_failure(void *instance, CDF_STATUS status)
#ifdef CONFIG_CNSS
ret = hif_check_fw_reg(scn);
if (0 == ret) {
if (scn->enable_self_recovery) {
if (ini_cfg->enable_self_recovery) {
ol_schedule_fw_indication_work(scn);
return;
}
@ -617,7 +624,7 @@ void ol_target_failure(void *instance, CDF_STATUS status)
#if defined(CONFIG_CNSS)
/* Collect the RAM dump through a workqueue */
if (scn->enable_ramdump_collection)
if (ini_cfg->enable_ramdump_collection)
ol_schedule_ramdump_work(scn);
else
pr_debug("%s: athdiag read for target reg\n", __func__);
@ -633,11 +640,14 @@ CDF_STATUS ol_configure_target(struct ol_softc *scn)
struct cnss_platform_cap cap;
int ret;
#endif
struct hif_target_info *tgt_info = hif_get_target_info_handle(scn);
struct hif_config_info *ini_cfg = hif_get_ini_handle(scn);
uint32_t target_type = tgt_info->target_type;
/* Tell target which HTC version it is used */
param = HTC_PROTOCOL_VERSION;
if (bmi_write_memory(
hif_hia_item_address(scn->target_type,
hif_hia_item_address(target_type,
offsetof(struct host_interest_s, hi_app_host_interest)),
(uint8_t *) &param, 4, scn) != CDF_STATUS_SUCCESS) {
BMI_ERR("bmi_write_memory for htc version failed");
@ -646,7 +656,7 @@ CDF_STATUS ol_configure_target(struct ol_softc *scn)
/* set the firmware mode to STA/IBSS/AP */
{
if (bmi_read_memory(hif_hia_item_address(scn->target_type,
if (bmi_read_memory(hif_hia_item_address(target_type,
offsetof(struct host_interest_s, hi_option_flag)),
(uint8_t *)&param, 4, scn) != CDF_STATUS_SUCCESS) {
BMI_ERR("bmi_read_memory for setting fwmode failed");
@ -668,7 +678,7 @@ CDF_STATUS ol_configure_target(struct ol_softc *scn)
1, HI_OPTION_FW_MODE_AP, 0, 0);
if (bmi_write_memory(
hif_hia_item_address(scn->target_type,
hif_hia_item_address(target_type,
offsetof(struct host_interest_s, hi_option_flag)),
(uint8_t *)&param, 4, scn) != CDF_STATUS_SUCCESS) {
BMI_ERR("BMI WRITE for setting fwmode failed");
@ -679,7 +689,7 @@ CDF_STATUS ol_configure_target(struct ol_softc *scn)
#if (CONFIG_DISABLE_CDC_MAX_PERF_WAR)
{
/* set the firmware to disable CDC max perf WAR */
if (bmi_read_memory(hif_hia_item_address(scn->target_type,
if (bmi_read_memory(hif_hia_item_address(target_type,
offsetof(struct host_interest_s, hi_option_flag2)),
(uint8_t *) &param, 4, scn) != CDF_STATUS_SUCCESS) {
BMI_ERR("BMI READ for setting cdc max perf failed");
@ -688,7 +698,7 @@ CDF_STATUS ol_configure_target(struct ol_softc *scn)
param |= HI_OPTION_DISABLE_CDC_MAX_PERF_WAR;
if (bmi_write_memory(
hif_hia_item_address(scn->target_type,
hif_hia_item_address(target_type,
offsetof(struct host_interest_s, hi_option_flag2)),
(uint8_t *)&param, 4, scn) != CDF_STATUS_SUCCESS) {
BMI_ERR("setting cdc max perf failed");
@ -704,7 +714,7 @@ CDF_STATUS ol_configure_target(struct ol_softc *scn)
BMI_ERR("platform capability info from CNSS not available");
if (!ret && cap.cap_flag & CNSS_HAS_EXTERNAL_SWREG) {
if (bmi_read_memory(hif_hia_item_address(scn->target_type,
if (bmi_read_memory(hif_hia_item_address(target_type,
offsetof(struct host_interest_s, hi_option_flag2)),
(uint8_t *)&param, 4, scn) != CDF_STATUS_SUCCESS) {
BMI_ERR("bmi_read_memory for setting"
@ -714,7 +724,7 @@ CDF_STATUS ol_configure_target(struct ol_softc *scn)
param |= HI_OPTION_USE_EXT_LDO;
if (bmi_write_memory(
hif_hia_item_address(scn->target_type,
hif_hia_item_address(target_type,
offsetof(struct host_interest_s, hi_option_flag2)),
(uint8_t *)&param, 4, scn) != CDF_STATUS_SUCCESS) {
BMI_ERR("BMI WRITE for setting external SWREG fail");
@ -724,8 +734,8 @@ CDF_STATUS ol_configure_target(struct ol_softc *scn)
#endif
#ifdef WLAN_FEATURE_LPSS
if (scn->enablelpasssupport) {
if (bmi_read_memory(hif_hia_item_address(scn->target_type,
if (ini_cfg->enable_lpass_support) {
if (bmi_read_memory(hif_hia_item_address(target_type,
offsetof(struct host_interest_s, hi_option_flag2)),
(uint8_t *) &param, 4, scn) != CDF_STATUS_SUCCESS) {
BMI_ERR("BMI READ:Setting LPASS Support failed");
@ -734,7 +744,7 @@ CDF_STATUS ol_configure_target(struct ol_softc *scn)
param |= HI_OPTION_DBUART_SUPPORT;
if (bmi_write_memory(
hif_hia_item_address(scn->target_type,
hif_hia_item_address(target_type,
offsetof(struct host_interest_s, hi_option_flag2)),
(uint8_t *)&param, 4, scn) != CDF_STATUS_SUCCESS) {
BMI_ERR("BMI_READ for setting LPASS Support fail");
@ -751,7 +761,7 @@ CDF_STATUS ol_configure_target(struct ol_softc *scn)
param = 0;
#endif
if (bmi_write_memory(
hif_hia_item_address(scn->target_type,
hif_hia_item_address(target_type,
offsetof(struct host_interest_s, hi_be)),
(uint8_t *) &param, 4, scn) != CDF_STATUS_SUCCESS) {
BMI_ERR("setting host CPU BE mode failed");
@ -762,7 +772,7 @@ CDF_STATUS ol_configure_target(struct ol_softc *scn)
/* FW descriptor/Data swap flags */
param = 0;
if (bmi_write_memory(
hif_hia_item_address(scn->target_type,
hif_hia_item_address(target_type,
offsetof(struct host_interest_s, hi_fw_swap)),
(uint8_t *) &param, 4, scn) != CDF_STATUS_SUCCESS) {
BMI_ERR("BMI WRITE failed setting FW data/desc swap flags");
@ -854,8 +864,10 @@ CDF_STATUS ol_patch_pll_switch(struct ol_softc *scn)
uint32_t cmnos_core_clk_div_addr = 0;
uint32_t cmnos_cpu_pll_init_done_addr = 0;
uint32_t cmnos_cpu_speed_addr = 0;
struct hif_target_info *tgt_info = hif_get_target_info_handle(scn);
uint32_t target_version = tgt_info->target_version;
switch (scn->target_version) {
switch (target_version) {
case AR6320_REV1_1_VERSION:
cmnos_core_clk_div_addr = AR6320_CORE_CLK_DIV_ADDR;
cmnos_cpu_pll_init_done_addr = AR6320_CPU_PLL_INIT_DONE_ADDR;
@ -875,7 +887,7 @@ CDF_STATUS ol_patch_pll_switch(struct ol_softc *scn)
break;
default:
BMI_ERR("%s: Unsupported target version %x", __func__,
scn->target_version);
target_version);
goto end;
}
@ -1166,18 +1178,22 @@ CDF_STATUS ol_download_firmware(struct ol_softc *scn)
uint32_t param, address = 0;
int status = !EOK;
CDF_STATUS ret;
struct hif_target_info *tgt_info = hif_get_target_info_handle(scn);
struct hif_config_info *ini_cfg = hif_get_ini_handle(scn);
uint32_t target_type = tgt_info->target_type;
uint32_t target_version = tgt_info->target_version;
#ifdef CONFIG_CNSS
if (0 != cnss_get_fw_files_for_target(&scn->fw_files,
scn->target_type,
scn->target_version)) {
target_type,
target_version)) {
BMI_ERR("%s: No FW files from CNSS driver", __func__);
return CDF_STATUS_E_FAILURE;
}
#endif
/* Transfer Board Data from Target EEPROM to Target RAM */
/* Determine where in Target RAM to write Board Data */
bmi_read_memory(hif_hia_item_address(scn->target_type,
bmi_read_memory(hif_hia_item_address(target_type,
offsetof(struct host_interest_s, hi_board_data)),
(uint8_t *)&address, 4, scn);
@ -1201,7 +1217,7 @@ CDF_STATUS ol_download_firmware(struct ol_softc *scn)
/* Record the fact that Board Data is initialized */
param = 1;
bmi_write_memory(
hif_hia_item_address(scn->target_type,
hif_hia_item_address(target_type,
offsetof(struct host_interest_s,
hi_board_data_initialized)),
(uint8_t *) &param, 4, scn);
@ -1215,7 +1231,7 @@ CDF_STATUS ol_download_firmware(struct ol_softc *scn)
/* Record the fact that Board Data is initialized */
param = 1;
bmi_write_memory(
hif_hia_item_address(scn->target_type,
hif_hia_item_address(target_type,
offsetof(struct host_interest_s,
hi_board_data_initialized)),
(uint8_t *) &param, 4, scn);
@ -1264,15 +1280,15 @@ CDF_STATUS ol_download_firmware(struct ol_softc *scn)
!= EOK) {
return -1;
}
bmi_write_memory(hif_hia_item_address(scn->target_type,
bmi_write_memory(hif_hia_item_address(target_type,
offsetof(struct host_interest_s, hi_dset_list_head)),
(uint8_t *) &address, 4, scn);
}
if (scn->enableuartprint ||
if (ini_cfg->enable_uart_print ||
(WLAN_IS_EPPING_ENABLED(cds_get_conparam()) &&
WLAN_IS_EPPING_FW_UART(cds_get_conparam()))) {
switch (scn->target_version) {
switch (tgt_info->target_version) {
case AR6004_VERSION_REV1_3:
param = 11;
break;
@ -1289,11 +1305,11 @@ CDF_STATUS ol_download_firmware(struct ol_softc *scn)
param = 7;
}
bmi_write_memory(hif_hia_item_address(scn->target_type,
bmi_write_memory(hif_hia_item_address(target_type,
offsetof(struct host_interest_s, hi_dbg_uart_txpin)),
(uint8_t *)&param, 4, scn);
param = 1;
bmi_write_memory(hif_hia_item_address(scn->target_type,
bmi_write_memory(hif_hia_item_address(target_type,
offsetof(struct host_interest_s, hi_serial_enable)),
(uint8_t *)&param, 4, scn);
} else {
@ -1302,18 +1318,18 @@ CDF_STATUS ol_download_firmware(struct ol_softc *scn)
* based on scratch registers.
*/
param = 0;
bmi_write_memory(hif_hia_item_address(scn->target_type,
bmi_write_memory(hif_hia_item_address(target_type,
offsetof(struct host_interest_s, hi_serial_enable)),
(uint8_t *)&param, 4, scn);
}
if (scn->enablefwlog) {
bmi_read_memory(hif_hia_item_address(scn->target_type,
if (ini_cfg->enable_fw_log) {
bmi_read_memory(hif_hia_item_address(target_type,
offsetof(struct host_interest_s, hi_option_flag)),
(uint8_t *)&param, 4, scn);
param &= ~(HI_OPTION_DISABLE_DBGLOG);
bmi_write_memory(hif_hia_item_address(scn->target_type,
bmi_write_memory(hif_hia_item_address(target_type,
offsetof(struct host_interest_s, hi_option_flag)),
(uint8_t *)&param, 4, scn);
} else {
@ -1321,12 +1337,12 @@ CDF_STATUS ol_download_firmware(struct ol_softc *scn)
* Explicitly setting fwlog prints to zero as target turns it on
* based on scratch registers.
*/
bmi_read_memory(hif_hia_item_address(scn->target_type,
bmi_read_memory(hif_hia_item_address(target_type,
offsetof(struct host_interest_s, hi_option_flag)),
(uint8_t *)&param, 4, scn);
param |= HI_OPTION_DISABLE_DBGLOG;
bmi_write_memory(hif_hia_item_address(scn->target_type,
bmi_write_memory(hif_hia_item_address(target_type,
offsetof(struct host_interest_s, hi_option_flag)),
(uint8_t *) &param, 4, scn);
}
@ -1413,8 +1429,10 @@ static int ol_diag_read_reg_loc(struct ol_softc *scn, uint8_t *buffer,
int dump_len, result = 0;
tgt_reg_table reg_table;
tgt_reg_section *curr_sec, *next_sec;
struct hif_target_info *tgt_info = hif_get_target_info_handle(scn);
uint32_t target_version = tgt_info->target_version;
section_len = ol_ath_get_reg_table(scn->target_version, &reg_table);
section_len = ol_ath_get_reg_table(target_version, &reg_table);
if (!reg_table.section || !reg_table.section_size || !section_len) {
BMI_ERR("%s: failed to get reg table", __func__);
@ -1587,21 +1605,19 @@ static int ol_target_coredump(void *inst, void *memory_block,
uint8_t ol_get_number_of_peers_supported(struct ol_softc *scn)
{
uint8_t max_no_of_peers = 0;
struct hif_config_info *ini_cfg = hif_get_ini_handle(scn);
struct hif_target_info *tgt_info = hif_get_target_info_handle(scn);
uint8_t max_no_of_peers = ini_cfg->max_no_of_peers;
switch (scn->target_version) {
switch (tgt_info->target_version) {
case AR6320_REV1_1_VERSION:
if (scn->max_no_of_peers > MAX_SUPPORTED_PEERS_REV1_1)
if (max_no_of_peers > MAX_SUPPORTED_PEERS_REV1_1)
max_no_of_peers = MAX_SUPPORTED_PEERS_REV1_1;
else
max_no_of_peers = scn->max_no_of_peers;
break;
default:
if (scn->max_no_of_peers > MAX_SUPPORTED_PEERS_REV1_3)
if (max_no_of_peers > MAX_SUPPORTED_PEERS_REV1_3)
max_no_of_peers = MAX_SUPPORTED_PEERS_REV1_3;
else
max_no_of_peers = scn->max_no_of_peers;
break;
}

View file

@ -253,15 +253,8 @@ CDF_STATUS cds_open(void)
"%s: scn is null!", __func__);
goto err_sched_close;
}
scn->enableuartprint = pHddCtx->config->enablefwprint;
scn->enablefwlog = pHddCtx->config->enablefwlog;
scn->max_no_of_peers = pHddCtx->config->maxNumberOfPeers;
#ifdef WLAN_FEATURE_LPSS
scn->enablelpasssupport = pHddCtx->config->enablelpasssupport;
#endif
scn->enable_ramdump_collection =
pHddCtx->config->is_ramdump_enabled;
scn->enable_self_recovery = pHddCtx->config->enableSelfRecovery;
hdd_update_hif_config(scn, pHddCtx);
/* Initialize BMI and Download firmware */
cdf_status = bmi_download_firmware(scn);

View file

@ -3242,7 +3242,7 @@ struct hdd_config {
bool enable_ip_tcp_udp_checksum_offload;
bool enablePowersaveOffload;
bool enablefwprint;
bool enablefwlog;
bool enable_fw_log;
#ifdef WLAN_FEATURE_11AC
uint8_t fVhtAmpduLenExponent;
uint32_t vhtMpduLen;
@ -3368,7 +3368,7 @@ struct hdd_config {
bool enableSifsBurst;
#ifdef WLAN_FEATURE_LPSS
bool enablelpasssupport;
bool enable_lpass_support;
#endif
#ifdef WLAN_FEATURE_NAN
bool enable_nan_support;

View file

@ -1525,5 +1525,5 @@ hdd_adapter_t *hdd_get_adapter_by_sme_session_id(hdd_context_t *hdd_ctx,
phy_ch_width hdd_map_nl_chan_width(enum nl80211_chan_width ch_width);
uint8_t wlan_hdd_find_opclass(tHalHandle hal, uint8_t channel,
uint8_t bw_offset);
void hdd_update_hif_config(void *scn, hdd_context_t *hdd_ctx);
#endif /* end #if !defined(WLAN_HDD_MAIN_H) */

View file

@ -2587,7 +2587,7 @@ REG_TABLE_ENTRY g_registry_table[] = {
CFG_ENABLE_FW_UART_PRINT_ENABLE),
REG_VARIABLE(CFG_ENABLE_FW_LOG_NAME, WLAN_PARAM_Integer,
struct hdd_config, enablefwlog,
struct hdd_config, enable_fw_log,
VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
CFG_ENABLE_FW_LOG_DEFAULT,
CFG_ENABLE_FW_LOG_DISABLE,
@ -3209,7 +3209,7 @@ REG_TABLE_ENTRY g_registry_table[] = {
#ifdef WLAN_FEATURE_LPSS
REG_VARIABLE(CFG_ENABLE_LPASS_SUPPORT, WLAN_PARAM_Integer,
struct hdd_config, enablelpasssupport,
struct hdd_config, enable_lpass_support,
VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
CFG_ENABLE_LPASS_SUPPORT_DEFAULT,
CFG_ENABLE_LPASS_SUPPORT_MIN,
@ -5078,7 +5078,7 @@ void hdd_cfg_print(hdd_context_t *pHddCtx)
#ifdef WLAN_FEATURE_LPSS
CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
"Name = [gEnableLpassSupport] Value = [%u] ",
pHddCtx->config->enablelpasssupport);
pHddCtx->config->enable_lpass_support);
#endif
CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,

View file

@ -137,6 +137,18 @@ static void wlan_hdd_ftm_update_tgt_cfg(void *context, void *param)
}
}
#ifdef WLAN_FEATURE_LPSS
static inline void hdd_is_lpass_supported(tMacOpenParameters *mac_openParms,
hdd_context_t *hdd_ctx)
{
mac_openParms->is_lpass_enabled = hdd_ctx->config->enable_lpass_support;
}
#else
static inline void hdd_is_lpass_supported(tMacOpenParameters *mac_openParms,
hdd_context_t *hdd_ctx)
{ }
#endif
/**
* wlan_ftm_cds_open() - Open the CDS Module in FTM mode
* @p_cds_context: pointer to the global CDS context
@ -281,9 +293,7 @@ static CDF_STATUS wlan_ftm_cds_open(v_CONTEXT_t p_cds_context,
mac_openParms.powersaveOffloadEnabled =
hdd_ctx->config->enablePowersaveOffload;
#ifdef WLAN_FEATURE_LPSS
mac_openParms.is_lpass_enabled = hdd_ctx->config->enablelpasssupport;
#endif
hdd_is_lpass_supported(&mac_openParms, hdd_ctx);
vStatus = wma_open(gp_cds_context,
wlan_hdd_ftm_update_tgt_cfg, NULL, &mac_openParms);
@ -296,8 +306,7 @@ static CDF_STATUS wlan_ftm_cds_open(v_CONTEXT_t p_cds_context,
goto err_htc_close;
}
#if defined(QCA_WIFI_FTM)
((struct ol_softc *)pHifContext)->enable_ramdump_collection =
hdd_ctx->config->is_ramdump_enabled;
hdd_update_hif_config(pHifContext, hdd_ctx);
pHtcContext = cds_get_context(CDF_MODULE_ID_HTC);
if (!pHtcContext) {

View file

@ -2591,7 +2591,7 @@ hdd_adapter_t *hdd_open_adapter(hdd_context_t *hdd_ctx, uint8_t session_type,
/* Enable FW logs based on INI configuration */
if ((CDF_GLOBAL_FTM_MODE != cds_get_conparam()) &&
(hdd_ctx->config->enablefwlog)) {
(hdd_ctx->config->enable_fw_log)) {
uint8_t count = 0;
uint32_t value = 0;
uint8_t numEntries = 0;
@ -5076,6 +5076,7 @@ hdd_context_t *hdd_init_context(struct device *dev, void *hif_sc)
int ret = 0;
hdd_context_t *hdd_ctx;
v_CONTEXT_t p_cds_context;
struct hif_target_info *tgt_info = hif_get_target_info_handle(hif_sc);
ENTER();
@ -5133,11 +5134,11 @@ hdd_context_t *hdd_init_context(struct device *dev, void *hif_sc)
hdd_tdls_pre_init(hdd_ctx);
mutex_init(&hdd_ctx->dfs_lock);
hdd_ctx->target_type = ((struct ol_softc *)hif_sc)->target_type;
hdd_ctx->target_type = tgt_info->target_type;
hdd_init_offloaded_packets_ctx(hdd_ctx);
icnss_set_fw_debug_mode(hdd_ctx->config->enablefwlog);
icnss_set_fw_debug_mode(hdd_ctx->config->enable_fw_log);
hdd_ctx->max_intf_count = CSR_ROAM_SESSION_MAX;
@ -5159,7 +5160,7 @@ hdd_context_t *hdd_init_context(struct device *dev, void *hif_sc)
hdd_enable_fastpath(hdd_ctx->config, hif_sc);
/* Uses to enabled logging after SSR */
hdd_ctx->fw_log_settings.enable = hdd_ctx->config->enablefwlog;
hdd_ctx->fw_log_settings.enable = hdd_ctx->config->enable_fw_log;
if (CDF_GLOBAL_FTM_MODE == hdd_get_conparam())
goto skip_multicast_logging;
@ -5612,9 +5613,6 @@ int hdd_wlan_startup(struct device *dev, void *hif_sc)
/* Get the wlan hw/fw version */
hdd_wlan_get_version(adapter, NULL, NULL);
/* pass target_fw_version to HIF layer */
hif_set_fw_info(hif_sc, hdd_ctx->target_fw_version);
ret = hdd_update_country_code(hdd_ctx, adapter);
if (ret)
@ -5975,7 +5973,7 @@ int wlan_hdd_gen_wlan_status_pack(struct wlan_status_data *data,
}
hdd_ctx = WLAN_HDD_GET_CTX(adapter);
if (hdd_ctx->lpss_support && hdd_ctx->config->enablelpasssupport)
if (hdd_ctx->lpss_support && hdd_ctx->config->enable_lpass_support)
data->lpss_support = 1;
else
data->lpss_support = 0;
@ -6978,6 +6976,39 @@ void hdd_set_conparam(uint32_t con_param)
curr_con_mode = con_param;
}
#ifdef WLAN_FEATURE_LPSS
static inline bool hdd_is_lpass_supported(hdd_context_t *hdd_ctx)
{
return hdd_ctx->config->enable_lpass_support;
}
#else
static inline bool hdd_is_lpass_supported(hdd_context_t *hdd_ctx)
{
return false;
}
#endif
/**
* hdd_update_hif_config() - Initialize HIF ini parameters
* @scn: HIF Context
* @hdd_ctx: HDD Context
*
* API is used to initialize all HIF configuration parameters
* Return: void
*/
void hdd_update_hif_config(void *scn, hdd_context_t *hdd_ctx)
{
struct hif_config_info *cfg = hif_get_ini_handle(scn);
cfg->enable_self_recovery = hdd_ctx->config->enableSelfRecovery;
cfg->enable_uart_print = hdd_ctx->config->enablefwprint;
cfg->enable_fw_log = hdd_ctx->config->enable_fw_log;
cfg->max_no_of_peers = hdd_ctx->config->maxNumberOfPeers;
cfg->enable_ramdump_collection =
hdd_ctx->config->is_ramdump_enabled;
cfg->enable_lpass_support = hdd_is_lpass_supported(hdd_ctx);
}
/* Register the module init/exit functions */
module_init(hdd_module_init);
module_exit(hdd_module_exit);

View file

@ -1534,9 +1534,6 @@ CDF_STATUS hdd_wlan_re_init(void *hif_sc)
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);
/* Restart all adapters */
hdd_start_all_adapters(pHddCtx);

View file

@ -181,6 +181,8 @@ int epping_enable(struct device *parent_dev)
HTC_INIT_INFO htcInfo;
struct ol_softc *scn;
tSirMacAddr adapter_macAddr;
struct hif_config_info *cfg;
struct hif_target_info *tgt_info;
EPPING_LOG(CDF_TRACE_LEVEL_INFO_HIGH, "%s: Enter", __func__);
@ -212,10 +214,16 @@ int epping_enable(struct device *parent_dev)
"%s: scn is null!", __func__);
return -1;
}
scn->enableuartprint = 0;
scn->enablefwlog = 0;
cfg = hif_get_ini_handle(scn);
cfg->enable_uart_print = 0;
cfg->enable_fw_log = 0;
tgt_info = hif_get_target_info_handle(scn);
/* store target type and target version info in hdd ctx */
pEpping_ctx->target_type = scn->target_type;
pEpping_ctx->target_type = tgt_info->target_type;
#ifndef FEATURE_BMI_2
/* Initialize BMI and Download firmware */