diff --git a/core/hdd/inc/wlan_hdd_main.h b/core/hdd/inc/wlan_hdd_main.h index 802f9ebb8208..d407328a5379 100644 --- a/core/hdd/inc/wlan_hdd_main.h +++ b/core/hdd/inc/wlan_hdd_main.h @@ -1899,6 +1899,10 @@ struct hdd_context { bool lte_coex_ant_share; int sscan_pid; uint32_t track_arp_ip; + + /* defining the board related information */ + uint32_t hw_bd_id; + struct board_info hw_bd_info; }; /** diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index 7d1856378925..4fc4a7598b60 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -1952,6 +1952,10 @@ void hdd_update_tgt_cfg(void *context, void *param) hdd_ctx->target_fw_version = cfg->target_fw_version; hdd_ctx->target_fw_vers_ext = cfg->target_fw_vers_ext; + hdd_ctx->hw_bd_id = cfg->hw_bd_id; + qdf_mem_copy(&hdd_ctx->hw_bd_info, &cfg->hw_bd_info, + sizeof(cfg->hw_bd_info)); + hdd_ctx->max_intf_count = cfg->max_intf_count; hdd_lpass_target_config(hdd_ctx, cfg); @@ -2484,10 +2488,15 @@ uint32_t hdd_wlan_get_version(struct hdd_context *hdd_ctx, sub_id = (hdd_ctx->target_fw_vers_ext & 0xf0000000) >> 28; size = scnprintf(version, version_len, - "Host SW:%s, FW:%d.%d.%d.%d.%d, HW:%s", + "Host SW:%s, FW:%d.%d.%d.%d.%d, HW:%s, Board ver: %x Ref design id: %x, Customer id: %x, Project id: %x, Board Data Rev: %x", QWLAN_VERSIONSTR, msp_id, mspid, siid, crmid, sub_id, - hdd_ctx->target_hw_name); + hdd_ctx->target_hw_name, + hdd_ctx->hw_bd_info.bdf_version, + hdd_ctx->hw_bd_info.ref_design_id, + hdd_ctx->hw_bd_info.customer_id, + hdd_ctx->hw_bd_info.project_id, + hdd_ctx->hw_bd_info.board_data_rev); return size; } diff --git a/core/hdd/src/wlan_hdd_sysfs.c b/core/hdd/src/wlan_hdd_sysfs.c index 8c6045664654..7000bc60533f 100644 --- a/core/hdd/src/wlan_hdd_sysfs.c +++ b/core/hdd/src/wlan_hdd_sysfs.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017 The Linux Foundation. All rights reserved. + * Copyright (c) 2017-2018 The Linux Foundation. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -69,7 +69,6 @@ static ssize_t __show_fw_version(struct kobject *kobj, struct kobj_attribute *attr, char *buf) { - const char *hw_version; uint32_t major_spid = 0, minor_spid = 0, siid = 0, crmid = 0; uint32_t sub_id = 0; struct hdd_context *hdd_ctx = cds_get_context(QDF_MODULE_ID_HDD); @@ -85,12 +84,16 @@ static ssize_t __show_fw_version(struct kobject *kobj, hdd_get_fw_version(hdd_ctx, &major_spid, &minor_spid, &siid, &crmid); sub_id = (hdd_ctx->target_fw_vers_ext & 0xf0000000) >> 28; - hw_version = hdd_ctx->target_hw_name; return scnprintf(buf, PAGE_SIZE, - "FW:%d.%d.%d.%d.%d HW:%s", major_spid, - minor_spid, siid, crmid, sub_id, - hw_version); + "FW:%d.%d.%d.%d.%d HW:%s Board version: %x Ref design id: %x Customer id: %x Project id: %x Board Data Rev: %x\n", + major_spid, minor_spid, siid, crmid, sub_id, + hdd_ctx->target_hw_name, + hdd_ctx->hw_bd_info.bdf_version, + hdd_ctx->hw_bd_info.ref_design_id, + hdd_ctx->hw_bd_info.customer_id, + hdd_ctx->hw_bd_info.project_id, + hdd_ctx->hw_bd_info.board_data_rev); } static ssize_t show_fw_version(struct kobject *kobj, diff --git a/core/wma/inc/wma_tgt_cfg.h b/core/wma/inc/wma_tgt_cfg.h index 56543f8a6c2d..ca7852bb3ecc 100644 --- a/core/wma/inc/wma_tgt_cfg.h +++ b/core/wma/inc/wma_tgt_cfg.h @@ -131,6 +131,26 @@ struct wma_dfs_radar_ind { uint32_t dfs_radar_status; }; +/** + * struct board_info - Structure for board related information + * @bdf_version: board file version + * @ref_design_id: reference design id + * @customer_id: customer id + * @project_id: project id + * @board_data_rev: board data revision + * + * This board information will be stored in board file during the + * calibration and customization. + * + */ +struct board_info { + uint32_t bdf_version; + uint32_t ref_design_id; + uint32_t customer_id; + uint32_t project_id; + uint32_t board_data_rev; +}; + /** * struct wma_tgt_cfg - target config * @target_fw_version: target fw version @@ -189,5 +209,7 @@ struct wma_tgt_cfg { bool rcpi_enabled; bool obss_detection_offloaded; bool obss_color_collision_offloaded; + uint32_t hw_bd_id; + struct board_info hw_bd_info; }; #endif /* WMA_TGT_CFG_H */ diff --git a/core/wma/src/wma_main.c b/core/wma/src/wma_main.c index 3a6f0b03272a..ab3b820753e1 100644 --- a/core/wma/src/wma_main.c +++ b/core/wma/src/wma_main.c @@ -5482,6 +5482,15 @@ static void wma_update_hdd_cfg(tp_wma_handle wma_handle) tgt_cfg.target_fw_vers_ext = service_ext_param->fw_build_vers_ext; + tgt_cfg.hw_bd_id = wma_handle->hw_bd_id; + tgt_cfg.hw_bd_info.bdf_version = wma_handle->hw_bd_info[BDF_VERSION]; + tgt_cfg.hw_bd_info.ref_design_id = + wma_handle->hw_bd_info[REF_DESIGN_ID]; + tgt_cfg.hw_bd_info.customer_id = wma_handle->hw_bd_info[CUSTOMER_ID]; + tgt_cfg.hw_bd_info.project_id = wma_handle->hw_bd_info[PROJECT_ID]; + tgt_cfg.hw_bd_info.board_data_rev = + wma_handle->hw_bd_info[BOARD_DATA_REV]; + #ifdef WLAN_FEATURE_LPSS tgt_cfg.lpss_support = wma_handle->lpss_support; #endif /* WLAN_FEATURE_LPSS */ @@ -5723,20 +5732,26 @@ int wma_rx_service_ready_event(void *handle, uint8_t *cmd_param_info, WMA_LOGD("FW fine time meas cap: 0x%x", tgt_cap_info->wmi_fw_sub_feat_caps); - if (ev->hw_bd_id) { - wma_handle->hw_bd_id = ev->hw_bd_id; - qdf_mem_copy(wma_handle->hw_bd_info, - ev->hw_bd_info, sizeof(ev->hw_bd_info)); + wma_handle->hw_bd_id = ev->hw_bd_id; - WMA_LOGI("%s: Board version: %x.%x", - __func__, - wma_handle->hw_bd_info[0], wma_handle->hw_bd_info[1]); - } else { - wma_handle->hw_bd_id = 0; - qdf_mem_zero(wma_handle->hw_bd_info, - sizeof(wma_handle->hw_bd_info)); - WMA_LOGW("%s: Board version is unknown!", __func__); - } + wma_handle->hw_bd_info[BDF_VERSION] = + WMI_GET_BDF_VERSION(ev->hw_bd_info); + wma_handle->hw_bd_info[REF_DESIGN_ID] = + WMI_GET_REF_DESIGN(ev->hw_bd_info); + wma_handle->hw_bd_info[CUSTOMER_ID] = + WMI_GET_CUSTOMER_ID(ev->hw_bd_info); + wma_handle->hw_bd_info[PROJECT_ID] = + WMI_GET_PROJECT_ID(ev->hw_bd_info); + wma_handle->hw_bd_info[BOARD_DATA_REV] = + WMI_GET_BOARD_DATA_REV(ev->hw_bd_info); + + WMA_LOGI("%s: Board id: %x, Board version: %x %x %x %x %x", + __func__, wma_handle->hw_bd_id, + wma_handle->hw_bd_info[BDF_VERSION], + wma_handle->hw_bd_info[REF_DESIGN_ID], + wma_handle->hw_bd_info[CUSTOMER_ID], + wma_handle->hw_bd_info[PROJECT_ID], + wma_handle->hw_bd_info[BOARD_DATA_REV]); /* wmi service is ready */ qdf_mem_copy(wma_handle->wmi_service_bitmap,