Переглянути джерело

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
Arun Khandavalli 9 роки тому
батько
коміт
a96c2c08ec

+ 1 - 1
core/hdd/inc/wlan_hdd_wext.h

@@ -295,7 +295,7 @@ extern int hdd_wlan_get_rts_threshold(hdd_adapter_t *pAdapter,
 				      union iwreq_data *wrqu);
 extern int hdd_wlan_get_frag_threshold(hdd_adapter_t *pAdapter,
 				       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);
 
 extern void hdd_wlan_get_stats(hdd_adapter_t *pAdapter, uint16_t *length,

+ 1 - 1
core/hdd/src/wlan_hdd_hostapd.c

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

+ 1 - 1
core/hdd/src/wlan_hdd_main.c

@@ -6980,7 +6980,7 @@ int hdd_wlan_startup(struct device *dev, void *hif_sc)
 			&hdd_ctx->target_hw_name);
 
 	/* 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);
 

+ 1 - 3
core/hdd/src/wlan_hdd_power.c

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

+ 18 - 21
core/hdd/src/wlan_hdd_wext.c

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