qcacld-3.0: refactor hdd_wlan_get_version to be adapter independent

hdd_wlan_get_version is invoked with adapter as a parameter, internally
in the function it is used to extract the hdd context.

Directly pass the hdd context to hdd_wlan_get_version so that it shall
be adapter agnostic and clean up the local variables for the camelcase
and hungarian notion.

Change-Id: I56a8eea67354f9516b974db74aa42fbad37592a0
CRs-Fixed: 1035792
This commit is contained in:
Arun Khandavalli
2016-05-17 19:15:34 +05:30
committed by Anjaneedevi Kapparapu
parent 2358d52766
commit a96c2c08ec
5 changed files with 22 additions and 27 deletions

View File

@@ -295,7 +295,7 @@ extern int hdd_wlan_get_rts_threshold(hdd_adapter_t *pAdapter,
union iwreq_data *wrqu); union iwreq_data *wrqu);
extern int hdd_wlan_get_frag_threshold(hdd_adapter_t *pAdapter, extern int hdd_wlan_get_frag_threshold(hdd_adapter_t *pAdapter,
union iwreq_data *wrqu); union iwreq_data *wrqu);
extern void hdd_wlan_get_version(hdd_adapter_t *pAdapter, extern void hdd_wlan_get_version(hdd_context_t *hdd_ctx,
union iwreq_data *wrqu, char *extra); union iwreq_data *wrqu, char *extra);
extern void hdd_wlan_get_stats(hdd_adapter_t *pAdapter, uint16_t *length, extern void hdd_wlan_get_stats(hdd_adapter_t *pAdapter, uint16_t *length,

View File

@@ -5145,7 +5145,7 @@ __iw_softap_version(struct net_device *dev,
if (0 != ret) if (0 != ret)
return ret; return ret;
hdd_wlan_get_version(pHostapdAdapter, wrqu, extra); hdd_wlan_get_version(hdd_ctx, wrqu, extra);
EXIT(); EXIT();
return 0; return 0;
} }

View File

@@ -6980,7 +6980,7 @@ int hdd_wlan_startup(struct device *dev, void *hif_sc)
&hdd_ctx->target_hw_name); &hdd_ctx->target_hw_name);
/* Get the wlan hw/fw version */ /* Get the wlan hw/fw version */
hdd_wlan_get_version(adapter, NULL, NULL); hdd_wlan_get_version(hdd_ctx, NULL, NULL);
ret = hdd_update_country_code(hdd_ctx, adapter); ret = hdd_update_country_code(hdd_ctx, adapter);

View File

@@ -1557,9 +1557,7 @@ QDF_STATUS hdd_wlan_re_init(void *hif_sc)
if (hdd_ipa_uc_ssr_reinit()) if (hdd_ipa_uc_ssr_reinit())
hdd_err("HDD IPA UC reinit failed"); hdd_err("HDD IPA UC reinit failed");
/* Get WLAN Host/FW/HW version */ hdd_wlan_get_version(pHddCtx, NULL, NULL);
if (pAdapter)
hdd_wlan_get_version(pAdapter, NULL, NULL);
/* Restart all adapters */ /* Restart all adapters */
hdd_start_all_adapters(pHddCtx); hdd_start_all_adapters(pHddCtx);

View File

@@ -718,7 +718,7 @@ void hdd_wlan_dump_stats(hdd_adapter_t *adapter, int value)
/** /**
* hdd_wlan_get_version() - Get driver version information * hdd_wlan_get_version() - Get driver version information
* @pAdapter: Pointer to the adapter. * @hdd_ctx: Global HDD context
* @wrqu: Pointer to IOCTL REQUEST Data. * @wrqu: Pointer to IOCTL REQUEST Data.
* @extra: Pointer to destination buffer * @extra: Pointer to destination buffer
* *
@@ -729,43 +729,40 @@ void hdd_wlan_dump_stats(hdd_adapter_t *adapter, int value)
* *
* Return: none * Return: none
*/ */
void hdd_wlan_get_version(hdd_adapter_t *pAdapter, union iwreq_data *wrqu, void hdd_wlan_get_version(hdd_context_t *hdd_ctx, union iwreq_data *wrqu,
char *extra) char *extra)
{ {
tSirVersionString wcnss_SW_version; tSirVersionString wcnss_sw_version;
const char *pSWversion; const char *swversion;
const char *pHWversion; const char *hwversion;
uint32_t MSPId = 0, mSPId = 0, SIId = 0, CRMId = 0; uint32_t msp_id = 0, mspid = 0, siid = 0, crmid = 0;
hdd_context_t *pHddContext; if (!hdd_ctx) {
pHddContext = WLAN_HDD_GET_CTX(pAdapter);
if (!pHddContext) {
hdd_err("Invalid context, HDD context is null"); hdd_err("Invalid context, HDD context is null");
goto error; goto error;
} }
snprintf(wcnss_SW_version, sizeof(tSirVersionString), "%08x", snprintf(wcnss_sw_version, sizeof(wcnss_sw_version), "%08x",
pHddContext->target_fw_version); hdd_ctx->target_fw_version);
pSWversion = wcnss_SW_version; swversion = wcnss_sw_version;
MSPId = (pHddContext->target_fw_version & 0xf0000000) >> 28; msp_id = (hdd_ctx->target_fw_version & 0xf0000000) >> 28;
mSPId = (pHddContext->target_fw_version & 0xf000000) >> 24; mspid = (hdd_ctx->target_fw_version & 0xf000000) >> 24;
SIId = (pHddContext->target_fw_version & 0xf00000) >> 20; siid = (hdd_ctx->target_fw_version & 0xf00000) >> 20;
CRMId = pHddContext->target_fw_version & 0x7fff; crmid = hdd_ctx->target_fw_version & 0x7fff;
pHWversion = pHddContext->target_hw_name; hwversion = hdd_ctx->target_hw_name;
if (wrqu && extra) { if (wrqu && extra) {
wrqu->data.length = wrqu->data.length =
scnprintf(extra, WE_MAX_STR_LEN, scnprintf(extra, WE_MAX_STR_LEN,
"Host SW:%s, FW:%d.%d.%d.%d, HW:%s", "Host SW:%s, FW:%d.%d.%d.%d, HW:%s",
QWLAN_VERSIONSTR, QWLAN_VERSIONSTR,
MSPId, mSPId, SIId, CRMId, pHWversion); msp_id, mspid, siid, crmid, hwversion);
} else { } else {
pr_info("Host SW:%s, FW:%d.%d.%d.%d, HW:%s\n", pr_info("Host SW:%s, FW:%d.%d.%d.%d, HW:%s\n",
QWLAN_VERSIONSTR, QWLAN_VERSIONSTR,
MSPId, mSPId, SIId, CRMId, pHWversion); msp_id, mspid, siid, crmid, hwversion);
} }
error: error:
return; return;
@@ -7005,7 +7002,7 @@ static int __iw_get_char_setnone(struct net_device *dev,
switch (sub_cmd) { switch (sub_cmd) {
case WE_WLAN_VERSION: case WE_WLAN_VERSION:
{ {
hdd_wlan_get_version(pAdapter, wrqu, extra); hdd_wlan_get_version(hdd_ctx, wrqu, extra);
break; break;
} }