summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRyan Hsu <ryanhsu@qca.qualcomm.com>2014-01-04 15:18:47 +0800
committerPrakash Dhavali <pdhavali@qca.qualcomm.com>2014-01-31 17:28:10 -0800
commit9b0c8b8041f1746fdb9b3daad2ab5ed0c0695be7 (patch)
tree530df0ddfc64f26393b61c6310223b783d9be406
parentdaa8129634373e43b868ed69e4518041d09f683c (diff)
qcacld: misc: add the qca wlan device version dump
- separate the version dump for wcn/qca device - introduce the new knob for qwlan_hw for future support, that way we can differentiate chip version specific info - example of the output - iwpriv wlan0 version Host SW:3.2.0.71, FW:2013.12.2, HW:AR6320_REV1_1 - cleanup - remove invalid comment - add version for 1.1/1.3/2.1 Change-Id: Ifd52d3195a5e56f74322adb1aa6c476889ebee8a CRs-fixed: 589633
-rw-r--r--CORE/HDD/inc/wlan_hdd_main.h6
-rw-r--r--CORE/HDD/src/wlan_hdd_early_suspend.c13
-rw-r--r--CORE/HDD/src/wlan_hdd_main.c19
-rw-r--r--CORE/HDD/src/wlan_hdd_wext.c75
-rw-r--r--CORE/MAC/inc/qwlan_version.h14
5 files changed, 113 insertions, 14 deletions
diff --git a/CORE/HDD/inc/wlan_hdd_main.h b/CORE/HDD/inc/wlan_hdd_main.h
index f726493e2a60..274917d3d73a 100644
--- a/CORE/HDD/inc/wlan_hdd_main.h
+++ b/CORE/HDD/inc/wlan_hdd_main.h
@@ -1261,9 +1261,15 @@ struct hdd_context_s
struct completion ready_to_suspend;
#ifdef QCA_WIFI_2_0
+ /* defining the solution type */
v_U32_t target_type;
+
+ /* defining the firmware version */
v_U32_t target_fw_version;
v_U32_t dfs_radar_found;
+
+ /* defining the chip/rom version */
+ v_U32_t target_hw_version;
#endif
struct regulatory reg;
#ifdef FEATURE_WLAN_CH_AVOID
diff --git a/CORE/HDD/src/wlan_hdd_early_suspend.c b/CORE/HDD/src/wlan_hdd_early_suspend.c
index 20a179d3f9da..d4ba45286df4 100644
--- a/CORE/HDD/src/wlan_hdd_early_suspend.c
+++ b/CORE/HDD/src/wlan_hdd_early_suspend.c
@@ -1661,6 +1661,7 @@ VOS_STATUS hdd_wlan_re_init(void *hif_sc)
#if defined(QCA_WIFI_2_0) && !defined(QCA_WIFI_ISOC)
adf_os_device_t adf_ctx;
+ hdd_adapter_t *pAdapter;
#endif
#ifdef QCA_WIFI_ISOC
@@ -1828,9 +1829,21 @@ VOS_STATUS hdd_wlan_re_init(void *hif_sc)
hddLog(VOS_TRACE_LEVEL_FATAL,"%s: vos_start failed",__func__);
goto err_vosclose;
}
+#if defined(QCA_WIFI_2_0) && !defined(QCA_WIFI_ISOC)
+ pAdapter = WLAN_HDD_GET_PRIV_PTR((struct net_device *)pHddCtx->parent_dev);
+ if ((NULL == pAdapter))
+ {
+ VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL,
+ "invalid adapter ");
+ goto err_vosclose;
+ }
+ /* Get the wlan hw/fw version */
+ hdd_wlan_get_version(pAdapter, NULL, NULL);
+#else
/* Exchange capability info between Host and FW and also get versioning info from FW */
hdd_exchange_version_and_caps(pHddCtx);
+#endif
vosStatus = hdd_post_voss_start_config( pHddCtx );
if ( !VOS_IS_STATUS_SUCCESS( vosStatus ) )
diff --git a/CORE/HDD/src/wlan_hdd_main.c b/CORE/HDD/src/wlan_hdd_main.c
index 4c40030bf52e..d9d794c1b3e5 100644
--- a/CORE/HDD/src/wlan_hdd_main.c
+++ b/CORE/HDD/src/wlan_hdd_main.c
@@ -9311,8 +9311,7 @@ int hdd_wlan_startup(struct device *dev, v_VOID_t *hif_sc)
}
}
- /*Start VOSS which starts up the SME/MAC/HAL modules and everything else
- Note: Firmware image will be read and downloaded inside vos_start API */
+ /*Start VOSS which starts up the SME/MAC/HAL modules and everything else */
status = vos_start( pHddCtx->pvosContext );
if ( !VOS_IS_STATUS_SUCCESS( status ) )
{
@@ -9329,9 +9328,6 @@ int hdd_wlan_startup(struct device *dev, v_VOID_t *hif_sc)
hdd_ch_avoid_cb);
#endif /* FEATURE_WLAN_CH_AVOID */
- /* Exchange capability info between Host and FW and also get versioning info from FW */
- hdd_exchange_version_and_caps(pHddCtx);
-
status = hdd_post_voss_start_config( pHddCtx );
if ( !VOS_IS_STATUS_SUCCESS( status ) )
{
@@ -9444,6 +9440,19 @@ int hdd_wlan_startup(struct device *dev, v_VOID_t *hif_sc)
goto err_close_adapter;
}
+#ifdef QCA_WIFI_2_0
+
+ /* target hw version would only be retrieved after firmware donwload */
+ pHddCtx->target_hw_version =
+ ((struct ol_softc *)hif_sc)->target_version;
+
+ /* Get the wlan hw/fw version */
+ hdd_wlan_get_version(pAdapter, NULL, NULL);
+#else
+ /* Exchange capability info between Host and FW and also get versioning info from FW */
+ hdd_exchange_version_and_caps(pHddCtx);
+#endif
+
if (country_code)
{
eHalStatus ret;
diff --git a/CORE/HDD/src/wlan_hdd_wext.c b/CORE/HDD/src/wlan_hdd_wext.c
index 58f607046a05..9f0c57adecf9 100644
--- a/CORE/HDD/src/wlan_hdd_wext.c
+++ b/CORE/HDD/src/wlan_hdd_wext.c
@@ -496,6 +496,25 @@ enum {
MCC_TOO_CLOSE_MARGIN_CFG_PARAM,
};
+static const struct qwlan_hw qwlan_hw_list[] = {
+ {
+ .id = AR6320_REV1_VERSION,
+ .name = "AR6320_REV1",
+ },
+ {
+ .id = AR6320_REV1_1_VERSION,
+ .name = "AR6320_REV1_1",
+ },
+ {
+ .id = AR6320_REV1_3_VERSION,
+ .name = "AR6320_REV1_3",
+ },
+ {
+ .id = AR6320_REV2_1_VERSION,
+ .name = "AR6320_REV2_1",
+ }
+};
+
int hdd_validate_mcc_config(hdd_adapter_t *pAdapter, v_UINT_t staId,
v_UINT_t arg1, v_UINT_t arg2, v_UINT_t arg3);
@@ -571,13 +590,43 @@ static void *mem_alloc_copy_from_user_helper(const void *wrqu_data, size_t len)
void hdd_wlan_get_version(hdd_adapter_t *pAdapter, union iwreq_data *wrqu,
char *extra)
{
- VOS_STATUS status;
tSirVersionString wcnss_SW_version;
+ const char *pSWversion;
+ const char *pHWversion;
+#ifndef QCA_WIFI_2_0
+ VOS_STATUS status;
tSirVersionString wcnss_HW_version;
- char *pSWversion;
- char *pHWversion;
tHalHandle hHal = WLAN_HDD_GET_HAL_CTX(pAdapter);
+#endif
+
+#ifdef QCA_WIFI_2_0
+ hdd_context_t *pHddContext;
+ int i = 0;
+ pHddContext = WLAN_HDD_GET_CTX(pAdapter);
+ if (!pHddContext) {
+ VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR,
+ "%s:Invalid context, HDD context is null", __func__);
+ goto error;
+ }
+
+ snprintf(wcnss_SW_version, sizeof(tSirVersionString), "20%x.%x.%x",
+ (pHddContext->target_fw_version&0xff0000)>>16,
+ (pHddContext->target_fw_version&0xff00)>>8,
+ (pHddContext->target_fw_version&0xff)>>0);
+
+ pSWversion = wcnss_SW_version;
+
+ for (i = 0; i < ARRAY_SIZE(qwlan_hw_list); i++) {
+ if (pHddContext->target_hw_version == qwlan_hw_list[i].id) {
+ pHWversion = qwlan_hw_list[i].name;
+ break;
+ }
+ }
+
+ if (i == ARRAY_SIZE(qwlan_hw_list))
+ pHWversion = "Unknown";
+#else
status = sme_GetWcnssSoftwareVersion(hHal, wcnss_SW_version,
sizeof(wcnss_SW_version));
if (VOS_IS_STATUS_SUCCESS(status))
@@ -599,13 +648,21 @@ void hdd_wlan_get_version(hdd_adapter_t *pAdapter, union iwreq_data *wrqu,
{
pHWversion = "Unknown";
}
+#endif
- wrqu->data.length = scnprintf(extra, WE_MAX_STR_LEN,
- "Host SW:%s, FW:%s, HW:%s",
- QWLAN_VERSIONSTR,
- pSWversion,
- pHWversion);
-
+ if (wrqu) {
+ wrqu->data.length = scnprintf(extra, WE_MAX_STR_LEN,
+ "Host SW:%s, FW:%s, HW:%s",
+ QWLAN_VERSIONSTR,
+ pSWversion,
+ pHWversion);
+ } else {
+ pr_info("Host SW:%s, FW:%s, HW:%s\n",
+ QWLAN_VERSIONSTR,
+ pSWversion,
+ pHWversion);
+ }
+error:
return;
}
diff --git a/CORE/MAC/inc/qwlan_version.h b/CORE/MAC/inc/qwlan_version.h
index 21e2dd92e5d8..c0051d815011 100644
--- a/CORE/MAC/inc/qwlan_version.h
+++ b/CORE/MAC/inc/qwlan_version.h
@@ -46,4 +46,18 @@ BRIEF DESCRIPTION:
#define QWLAN_VERSIONSTR "1.0.0.24"
+#ifdef QCA_WIFI_2_0
+
+#define AR6320_REV1_VERSION 0x5000000
+#define AR6320_REV1_1_VERSION 0x5000001
+#define AR6320_REV1_3_VERSION 0x5000003
+#define AR6320_REV2_1_VERSION 0x5010000
+
+struct qwlan_hw {
+ unsigned long id;
+ const char *name;
+};
+
+#endif
+
#endif /* QWLAN_VERSION_H */