From bedbef8ad3e75a304af6361af235302bcc61d06b Mon Sep 17 00:00:00 2001
From: hc <hc@nodka.com>
Date: Tue, 14 May 2024 06:39:01 +0000
Subject: [PATCH] 修改内核路径

---
 kernel/drivers/net/wireless/rockchip_wlan/rkwifi/bcmdhd/dhd_static_buf.c |  236 +++++++++++++++++++++++++++++------------------------------
 1 files changed, 116 insertions(+), 120 deletions(-)

diff --git a/kernel/drivers/net/wireless/rockchip_wlan/rkwifi/bcmdhd/dhd_static_buf.c b/kernel/drivers/net/wireless/rockchip_wlan/rkwifi/bcmdhd/dhd_static_buf.c
old mode 100644
new mode 100755
index f1c44f0..cfbf305
--- a/kernel/drivers/net/wireless/rockchip_wlan/rkwifi/bcmdhd/dhd_static_buf.c
+++ b/kernel/drivers/net/wireless/rockchip_wlan/rkwifi/bcmdhd/dhd_static_buf.c
@@ -7,10 +7,10 @@
 #include <linux/err.h>
 #include <linux/skbuff.h>
 
-#define	DHD_STATIC_VERSION_STR		"101.10.361.26 (wlan=r892223-20221011-1)"
-#define STATIC_ERROR_LEVEL	BIT(0)
-#define STATIC_TRACE_LEVEL	BIT(1)
-#define STATIC_MSG_LEVEL	BIT(0)
+#define	DHD_STATIC_VERSION_STR		"101.10.361.18 (wlan=r892223-20220519-1)"
+#define STATIC_ERROR_LEVEL	(1 << 0)
+#define STATIC_TRACE_LEVEL	(1 << 1)
+#define STATIC_MSG_LEVEL	(1 << 0)
 uint static_msg_level = STATIC_ERROR_LEVEL | STATIC_MSG_LEVEL;
 
 #define DHD_STATIC_MSG(x, args...) \
@@ -32,19 +32,12 @@
 		} \
 	} while (0)
 
-#ifdef DHD_STATIC_IN_DRIVER
-#if ANDROID_VERSION > 0
-#define CONFIG_BCMDHD_VTS { : = y}
-#define CONFIG_BCMDHD_DEBUG { : = y}
-#endif
-#else
-#define BCMSDIO
-#define BCMPCIE
-//#define BCMDBUS
-#define CONFIG_BCMDHD_VTS { : = y}
-#define CONFIG_BCMDHD_DEBUG { : = y}
+#define BCMDHD_SDIO
+#define BCMDHD_PCIE
+//#define BCMDHD_USB
+#define CONFIG_BCMDHD_VTS := y
+#define CONFIG_BCMDHD_DEBUG := y
 //#define BCMDHD_UNUSE_MEM
-#endif
 
 #ifndef MAX_NUM_ADAPTERS
 #define MAX_NUM_ADAPTERS	1
@@ -52,28 +45,28 @@
 
 enum dhd_prealloc_index {
 	DHD_PREALLOC_PROT = 0,
-#if defined(BCMSDIO)
+#if defined(BCMDHD_SDIO)
 	DHD_PREALLOC_RXBUF = 1,
 	DHD_PREALLOC_DATABUF = 2,
-#endif /* BCMSDIO */
+#endif /* BCMDHD_SDIO */
 	DHD_PREALLOC_OSL_BUF = 3,
 	DHD_PREALLOC_SKB_BUF = 4,
 	DHD_PREALLOC_WIPHY_ESCAN0 = 5,
 	DHD_PREALLOC_WIPHY_ESCAN1 = 6,
 	DHD_PREALLOC_DHD_INFO = 7,
-#if defined(BCMSDIO) || defined(BCMDBUS)
+#if defined(BCMDHD_SDIO) || defined(BCMDHD_USB)
 	DHD_PREALLOC_DHD_WLFC_INFO = 8,
-#endif /* BCMSDIO | BCMDBUS */
-#ifdef BCMPCIE
+#endif /* BCMDHD_SDIO | BCMDHD_USB */
+#ifdef BCMDHD_PCIE
 	DHD_PREALLOC_IF_FLOW_LKUP = 9,
-#endif /* BCMPCIE */
+#endif /* BCMDHD_PCIE */
 	DHD_PREALLOC_MEMDUMP_BUF = 10,
 #if defined(CONFIG_BCMDHD_VTS) || defined(CONFIG_BCMDHD_DEBUG)
 	DHD_PREALLOC_MEMDUMP_RAM = 11,
 #endif /* CONFIG_BCMDHD_VTS | CONFIG_BCMDHD_DEBUG */
-#if defined(BCMSDIO) || defined(BCMDBUS)
+#if defined(BCMDHD_SDIO) || defined(BCMDHD_USB)
 	DHD_PREALLOC_DHD_WLFC_HANGER = 12,
-#endif /* BCMSDIO | BCMDBUS */
+#endif /* BCMDHD_SDIO | BCMDHD_USB */
 	DHD_PREALLOC_PKTID_MAP = 13,
 	DHD_PREALLOC_PKTID_MAP_IOCTL = 14,
 #if defined(CONFIG_BCMDHD_VTS) || defined(CONFIG_BCMDHD_DEBUG)
@@ -93,11 +86,10 @@
 };
 
 #define STATIC_BUF_MAX_NUM	20
-#define STATIC_BUF_SIZE	(PAGE_SIZE * 2)
+#define STATIC_BUF_SIZE	(PAGE_SIZE*2)
 
 #ifndef CUSTOM_LOG_DUMP_BUFSIZE_MB
-/* DHD_LOG_DUMP_BUF_SIZE 4 MB static memory in kernel */
-#define CUSTOM_LOG_DUMP_BUFSIZE_MB	4
+#define CUSTOM_LOG_DUMP_BUFSIZE_MB	4 /* DHD_LOG_DUMP_BUF_SIZE 4 MB static memory in kernel */
 #endif /* CUSTOM_LOG_DUMP_BUFSIZE_MB */
 
 #define DHD_PREALLOC_PROT_SIZE	(16 * 1024)
@@ -105,7 +97,7 @@
 #define DHD_PREALLOC_DATABUF_SIZE	(64 * 1024)
 #define DHD_PREALLOC_OSL_BUF_SIZE	(STATIC_BUF_MAX_NUM * STATIC_BUF_SIZE)
 #define DHD_PREALLOC_WIPHY_ESCAN0_SIZE	(64 * 1024)
-#define DHD_PREALLOC_DHD_INFO_SIZE	(43 * 1024)
+#define DHD_PREALLOC_DHD_INFO_SIZE	(36 * 1024)
 #if defined(CONFIG_BCMDHD_VTS) || defined(CONFIG_BCMDHD_DEBUG)
 #define DHD_PREALLOC_MEMDUMP_RAM_SIZE	(1290 * 1024)
 #endif /* CONFIG_BCMDHD_VTS | CONFIG_BCMDHD_DEBUG */
@@ -136,87 +128,87 @@
 #endif /* CONFIG_64BIT */
 #define WLAN_DHD_MEMDUMP_SIZE	(800 * 1024)
 
-#define DHD_SKB_1PAGE_BUFSIZE	(PAGE_SIZE * 1)
-#define DHD_SKB_2PAGE_BUFSIZE	(PAGE_SIZE * 2)
-#define DHD_SKB_4PAGE_BUFSIZE	(PAGE_SIZE * 4)
+#define DHD_SKB_1PAGE_BUFSIZE	(PAGE_SIZE*1)
+#define DHD_SKB_2PAGE_BUFSIZE	(PAGE_SIZE*2)
+#define DHD_SKB_4PAGE_BUFSIZE	(PAGE_SIZE*4)
 
-#ifdef BCMPCIE
+#ifdef BCMDHD_PCIE
 #define DHD_SKB_1PAGE_BUF_NUM	0
 #define DHD_SKB_2PAGE_BUF_NUM	192
-#elif defined(BCMSDIO)
+#elif defined(BCMDHD_SDIO)
 #define DHD_SKB_1PAGE_BUF_NUM	8
 #define DHD_SKB_2PAGE_BUF_NUM	8
-#endif /* BCMPCIE */
+#endif /* BCMDHD_PCIE */
 #define DHD_SKB_4PAGE_BUF_NUM	1
 
 /* The number is defined in linux_osl.c
  * WLAN_SKB_1_2PAGE_BUF_NUM => STATIC_PKT_1_2PAGE_NUM
  * WLAN_SKB_BUF_NUM => STATIC_PKT_MAX_NUM
  */
-#if defined(BCMSDIO) || defined(BCMPCIE)
+#if defined(BCMDHD_SDIO) || defined(BCMDHD_PCIE)
 #define WLAN_SKB_1_2PAGE_BUF_NUM ((DHD_SKB_1PAGE_BUF_NUM) + \
 		(DHD_SKB_2PAGE_BUF_NUM))
 #define WLAN_SKB_BUF_NUM ((WLAN_SKB_1_2PAGE_BUF_NUM) + (DHD_SKB_4PAGE_BUF_NUM))
 #endif
 
-void *wlan_static_prot[MAX_NUM_ADAPTERS] = {};
-void *wlan_static_rxbuf[MAX_NUM_ADAPTERS] = {};
-void *wlan_static_databuf[MAX_NUM_ADAPTERS] = {};
-void *wlan_static_osl_buf[MAX_NUM_ADAPTERS] = {};
-void *wlan_static_scan_buf0[MAX_NUM_ADAPTERS] = {};
-void *wlan_static_scan_buf1[MAX_NUM_ADAPTERS] = {};
-void *wlan_static_dhd_info_buf[MAX_NUM_ADAPTERS] = {};
-void *wlan_static_dhd_wlfc_info_buf[MAX_NUM_ADAPTERS] = {};
-void *wlan_static_if_flow_lkup[MAX_NUM_ADAPTERS] = {};
-void *wlan_static_dhd_memdump_ram_buf[MAX_NUM_ADAPTERS] = {};
-void *wlan_static_dhd_wlfc_hanger_buf[MAX_NUM_ADAPTERS] = {};
+void *wlan_static_prot[MAX_NUM_ADAPTERS] = {NULL};
+void *wlan_static_rxbuf [MAX_NUM_ADAPTERS] = {NULL};
+void *wlan_static_databuf[MAX_NUM_ADAPTERS] = {NULL};
+void *wlan_static_osl_buf[MAX_NUM_ADAPTERS] = {NULL};
+void *wlan_static_scan_buf0[MAX_NUM_ADAPTERS] = {NULL};
+void *wlan_static_scan_buf1[MAX_NUM_ADAPTERS] = {NULL};
+void *wlan_static_dhd_info_buf[MAX_NUM_ADAPTERS] = {NULL};
+void *wlan_static_dhd_wlfc_info_buf[MAX_NUM_ADAPTERS] = {NULL};
+void *wlan_static_if_flow_lkup[MAX_NUM_ADAPTERS] = {NULL};
+void *wlan_static_dhd_memdump_ram_buf[MAX_NUM_ADAPTERS] = {NULL};
+void *wlan_static_dhd_wlfc_hanger_buf[MAX_NUM_ADAPTERS] = {NULL};
 #if defined(CONFIG_BCMDHD_VTS) || defined(CONFIG_BCMDHD_DEBUG)
-void *wlan_static_dhd_log_dump_buf[MAX_NUM_ADAPTERS] = {};
-void *wlan_static_dhd_log_dump_buf_ex[MAX_NUM_ADAPTERS] = {};
+void *wlan_static_dhd_log_dump_buf[MAX_NUM_ADAPTERS] = {NULL};
+void *wlan_static_dhd_log_dump_buf_ex[MAX_NUM_ADAPTERS] = {NULL};
 #endif /* CONFIG_BCMDHD_VTS | CONFIG_BCMDHD_DEBUG */
-void *wlan_static_wl_escan_info_buf[MAX_NUM_ADAPTERS] = {};
-void *wlan_static_fw_verbose_ring_buf[MAX_NUM_ADAPTERS] = {};
-void *wlan_static_fw_event_ring_buf[MAX_NUM_ADAPTERS] = {};
-void *wlan_static_dhd_event_ring_buf[MAX_NUM_ADAPTERS] = {};
-void *wlan_static_nan_event_ring_buf[MAX_NUM_ADAPTERS] = {};
+void *wlan_static_wl_escan_info_buf[MAX_NUM_ADAPTERS] = {NULL};
+void *wlan_static_fw_verbose_ring_buf[MAX_NUM_ADAPTERS] = {NULL};
+void *wlan_static_fw_event_ring_buf[MAX_NUM_ADAPTERS] = {NULL};
+void *wlan_static_dhd_event_ring_buf[MAX_NUM_ADAPTERS] = {NULL};
+void *wlan_static_nan_event_ring_buf[MAX_NUM_ADAPTERS] = {NULL};
 
-#if defined(BCMSDIO) || defined(BCMPCIE)
-static struct sk_buff *wlan_static_skb[MAX_NUM_ADAPTERS][WLAN_SKB_BUF_NUM] = {};
-#endif /* BCMSDIO | BCMPCIE */
+#if defined(BCMDHD_SDIO) || defined(BCMDHD_PCIE)
+static struct sk_buff *wlan_static_skb[MAX_NUM_ADAPTERS][WLAN_SKB_BUF_NUM] = {{NULL}};
+#endif /* BCMDHD_SDIO | BCMDHD_PCIE */
 
 void *
 dhd_wlan_mem_prealloc(
-#if defined(BCMDHD_MDRIVER) && !defined(DHD_STATIC_IN_DRIVER)
+#ifdef BCMDHD_MDRIVER
 	uint bus_type, int index,
 #endif
 	int section, unsigned long size)
 {
-#if !defined(BCMDHD_MDRIVER) || defined(DHD_STATIC_IN_DRIVER)
+#ifndef BCMDHD_MDRIVER
 	int index = 0;
 #endif
 
-#if defined(BCMDHD_MDRIVER) && !defined(DHD_STATIC_IN_DRIVER)
-	DHD_STATIC_MSG("bus_type %d, index %d, section %d, size %ld\n",
+#ifdef BCMDHD_MDRIVER
+	DHD_STATIC_MSG("bus_type %d, index %d, sectoin %d, size %ld\n",
 		bus_type, index, section, size);
 #else
-	DHD_STATIC_MSG("section %d, size %ld\n", section, size);
+	DHD_STATIC_MSG("sectoin %d, size %ld\n", section, size);
 #endif
 
 	if (section == DHD_PREALLOC_PROT)
 		return wlan_static_prot[index];
 
-#if defined(BCMSDIO)
+#if defined(BCMDHD_SDIO)
 	if (section == DHD_PREALLOC_RXBUF)
 		return wlan_static_rxbuf[index];
 
 	if (section == DHD_PREALLOC_DATABUF)
 		return wlan_static_databuf[index];
-#endif /* BCMSDIO */
+#endif /* BCMDHD_SDIO */
 
-#if defined(BCMSDIO) || defined(BCMPCIE)
+#if defined(BCMDHD_SDIO) || defined(BCMDHD_PCIE)
 	if (section == DHD_PREALLOC_SKB_BUF)
 		return wlan_static_skb[index];
-#endif /* BCMSDIO | BCMPCIE */
+#endif /* BCMDHD_SDIO | BCMDHD_PCIE */
 
 	if (section == DHD_PREALLOC_WIPHY_ESCAN0)
 		return wlan_static_scan_buf0[index];
@@ -241,7 +233,7 @@
 		}
 		return wlan_static_dhd_info_buf[index];
 	}
-#if defined(BCMSDIO) || defined(BCMDBUS)
+#if defined(BCMDHD_SDIO) || defined(BCMDHD_USB)
 	if (section == DHD_PREALLOC_DHD_WLFC_INFO) {
 		if (size > WLAN_DHD_WLFC_BUF_SIZE) {
 			DHD_STATIC_ERROR("request DHD_WLFC_INFO(%lu) > %d\n",
@@ -250,8 +242,8 @@
 		}
 		return wlan_static_dhd_wlfc_info_buf[index];
 	}
-#endif /* BCMSDIO | BCMDBUS */
-#ifdef BCMPCIE
+#endif /* BCMDHD_SDIO | BCMDHD_USB */
+#ifdef BCMDHD_PCIE
 	if (section == DHD_PREALLOC_IF_FLOW_LKUP)  {
 		if (size > DHD_PREALLOC_IF_FLOW_LKUP_SIZE) {
 			DHD_STATIC_ERROR("request DHD_IF_FLOW_LKUP(%lu) > %d\n",
@@ -260,7 +252,7 @@
 		}
 		return wlan_static_if_flow_lkup[index];
 	}
-#endif /* BCMPCIE */
+#endif /* BCMDHD_PCIE */
 #if defined(CONFIG_BCMDHD_VTS) || defined(CONFIG_BCMDHD_DEBUG)
 	if (section == DHD_PREALLOC_MEMDUMP_RAM) {
 		if (size > DHD_PREALLOC_MEMDUMP_RAM_SIZE) {
@@ -271,7 +263,7 @@
 		return wlan_static_dhd_memdump_ram_buf[index];
 	}
 #endif /* CONFIG_BCMDHD_VTS | CONFIG_BCMDHD_DEBUG */
-#if defined(BCMSDIO) || defined(BCMDBUS)
+#if defined(BCMDHD_SDIO) || defined(BCMDHD_USB)
 	if (section == DHD_PREALLOC_DHD_WLFC_HANGER) {
 		if (size > DHD_PREALLOC_DHD_WLFC_HANGER_SIZE) {
 			DHD_STATIC_ERROR("request DHD_WLFC_HANGER(%lu) > %d\n",
@@ -280,7 +272,7 @@
 		}
 		return wlan_static_dhd_wlfc_hanger_buf[index];
 	}
-#endif /* BCMSDIO | BCMDBUS */
+#endif /* BCMDHD_SDIO | BCMDHD_USB */
 #if defined(CONFIG_BCMDHD_VTS) || defined(CONFIG_BCMDHD_DEBUG)
 	if (section == DHD_PREALLOC_DHD_LOG_DUMP_BUF) {
 		if (size > DHD_PREALLOC_DHD_LOG_DUMP_BUF_SIZE) {
@@ -357,18 +349,18 @@
 static void
 dhd_deinit_wlan_mem(int index)
 {
-#if defined(BCMSDIO) || defined(BCMPCIE)
+#if defined(BCMDHD_SDIO) || defined(BCMDHD_PCIE)
 	int i;
-#endif /* BCMSDIO | BCMPCIE */
+#endif /* BCMDHD_SDIO | BCMDHD_PCIE */
 
 	if (wlan_static_prot[index])
 		kfree(wlan_static_prot[index]);
-#if defined(BCMSDIO)
+#if defined(BCMDHD_SDIO)
 	if (wlan_static_rxbuf[index])
 		kfree(wlan_static_rxbuf[index]);
 	if (wlan_static_databuf[index])
 		kfree(wlan_static_databuf[index]);
-#endif /* BCMSDIO */
+#endif /* BCMDHD_SDIO */
 	if (wlan_static_osl_buf[index])
 		kfree(wlan_static_osl_buf[index]);
 	if (wlan_static_scan_buf0[index])
@@ -377,22 +369,22 @@
 		kfree(wlan_static_scan_buf1[index]);
 	if (wlan_static_dhd_info_buf[index])
 		kfree(wlan_static_dhd_info_buf[index]);
-#if defined(BCMSDIO) || defined(BCMDBUS)
+#if defined(BCMDHD_SDIO) || defined(BCMDHD_USB)
 	if (wlan_static_dhd_wlfc_info_buf[index])
 		kfree(wlan_static_dhd_wlfc_info_buf[index]);
-#endif /* BCMSDIO | BCMDBUS */
-#ifdef BCMPCIE
+#endif /* BCMDHD_SDIO | BCMDHD_USB */
+#ifdef BCMDHD_PCIE
 	if (wlan_static_if_flow_lkup[index])
 		kfree(wlan_static_if_flow_lkup[index]);
-#endif /* BCMPCIE */
+#endif /* BCMDHD_PCIE */
 #if defined(CONFIG_BCMDHD_VTS) || defined(CONFIG_BCMDHD_DEBUG)
 	if (wlan_static_dhd_memdump_ram_buf[index])
 		kfree(wlan_static_dhd_memdump_ram_buf[index]);
 #endif /* CONFIG_BCMDHD_VTS | CONFIG_BCMDHD_DEBUG */
-#if defined(BCMSDIO) || defined(BCMDBUS)
+#if defined(BCMDHD_SDIO) || defined(BCMDHD_USB)
 	if (wlan_static_dhd_wlfc_hanger_buf[index])
 		kfree(wlan_static_dhd_wlfc_hanger_buf[index]);
-#endif /* BCMSDIO | BCMDBUS */
+#endif /* BCMDHD_SDIO | BCMDHD_USB */
 #if defined(CONFIG_BCMDHD_VTS) || defined(CONFIG_BCMDHD_DEBUG)
 	if (wlan_static_dhd_log_dump_buf[index])
 		kfree(wlan_static_dhd_log_dump_buf[index]);
@@ -412,12 +404,12 @@
 		kfree(wlan_static_nan_event_ring_buf[index]);
 #endif /* BCMDHD_UNUSE_MEM */
 
-#if defined(BCMSDIO) || defined(BCMPCIE)
+#if defined(BCMDHD_SDIO) || defined(BCMDHD_PCIE)
 	for (i=0; i<WLAN_SKB_BUF_NUM; i++) {
 		if (wlan_static_skb[index][i])
 			dev_kfree_skb(wlan_static_skb[index][i]);
 	}
-#endif /* BCMSDIO | BCMPCIE */
+#endif /* BCMDHD_SDIO | BCMDHD_PCIE */
 
 	return;
 }
@@ -425,136 +417,139 @@
 static int
 dhd_init_wlan_mem(int index)
 {
-#if defined(BCMSDIO) || defined(BCMPCIE)
+#if defined(BCMDHD_SDIO) || defined(BCMDHD_PCIE)
 	int i;
 #endif
 	unsigned long size = 0;
 
-#if defined(BCMSDIO) || defined(BCMPCIE)
-	for (i = 0; i < WLAN_SKB_BUF_NUM; i++)
+#if defined(BCMDHD_SDIO) || defined(BCMDHD_PCIE)
+	for (i=0; i <WLAN_SKB_BUF_NUM; i++) {
 		wlan_static_skb[index][i] = NULL;
+	}
 
 	for (i = 0; i < DHD_SKB_1PAGE_BUF_NUM; i++) {
 		wlan_static_skb[index][i] = dev_alloc_skb(DHD_SKB_1PAGE_BUFSIZE);
-		if (!wlan_static_skb[index][i])
+		if (!wlan_static_skb[index][i]) {
 			goto err_mem_alloc;
+		}
 		size += DHD_SKB_1PAGE_BUFSIZE;
-		DHD_STATIC_TRACE("section %d skb[%d], size=%ld\n",
+		DHD_STATIC_TRACE("sectoin %d skb[%d], size=%ld\n",
 			DHD_PREALLOC_SKB_BUF, i, DHD_SKB_1PAGE_BUFSIZE);
 	}
 
 	for (i = DHD_SKB_1PAGE_BUF_NUM; i < WLAN_SKB_1_2PAGE_BUF_NUM; i++) {
 		wlan_static_skb[index][i] = dev_alloc_skb(DHD_SKB_2PAGE_BUFSIZE);
-		if (!wlan_static_skb[index][i])
+		if (!wlan_static_skb[index][i]) {
 			goto err_mem_alloc;
+		}
 		size += DHD_SKB_2PAGE_BUFSIZE;
-		DHD_STATIC_TRACE("section %d skb[%d], size=%ld\n",
+		DHD_STATIC_TRACE("sectoin %d skb[%d], size=%ld\n",
 			DHD_PREALLOC_SKB_BUF, i, DHD_SKB_2PAGE_BUFSIZE);
 	}
-#endif /* BCMSDIO | BCMPCIE */
+#endif /* BCMDHD_SDIO | BCMDHD_PCIE */
 
-#if defined(BCMSDIO)
+#if defined(BCMDHD_SDIO)
 	wlan_static_skb[index][i] = dev_alloc_skb(DHD_SKB_4PAGE_BUFSIZE);
 	if (!wlan_static_skb[index][i])
 		goto err_mem_alloc;
 	size += DHD_SKB_4PAGE_BUFSIZE;
-	DHD_STATIC_TRACE("section %d skb[%d], size=%ld\n",
+	DHD_STATIC_TRACE("sectoin %d skb[%d], size=%ld\n",
 		DHD_PREALLOC_SKB_BUF, i, DHD_SKB_4PAGE_BUFSIZE);
-#endif /* BCMSDIO */
+#endif /* BCMDHD_SDIO */
 
 	wlan_static_prot[index] = kmalloc(DHD_PREALLOC_PROT_SIZE, GFP_KERNEL);
 	if (!wlan_static_prot[index])
 		goto err_mem_alloc;
 	size += DHD_PREALLOC_PROT_SIZE;
-	DHD_STATIC_TRACE("section %d, size=%d\n",
+	DHD_STATIC_TRACE("sectoin %d, size=%d\n",
 		DHD_PREALLOC_PROT, DHD_PREALLOC_PROT_SIZE);
 
-#if defined(BCMSDIO)
+#if defined(BCMDHD_SDIO)
 	wlan_static_rxbuf[index] = kmalloc(DHD_PREALLOC_RXBUF_SIZE, GFP_KERNEL);
 	if (!wlan_static_rxbuf[index])
 		goto err_mem_alloc;
 	size += DHD_PREALLOC_RXBUF_SIZE;
-	DHD_STATIC_TRACE("section %d, size=%d\n",
+	DHD_STATIC_TRACE("sectoin %d, size=%d\n",
 		DHD_PREALLOC_RXBUF, DHD_PREALLOC_RXBUF_SIZE);
 
 	wlan_static_databuf[index] = kmalloc(DHD_PREALLOC_DATABUF_SIZE, GFP_KERNEL);
 	if (!wlan_static_databuf[index])
 		goto err_mem_alloc;
 	size += DHD_PREALLOC_DATABUF_SIZE;
-	DHD_STATIC_TRACE("section %d, size=%d\n",
+	DHD_STATIC_TRACE("sectoin %d, size=%d\n",
 		DHD_PREALLOC_DATABUF, DHD_PREALLOC_DATABUF_SIZE);
-#endif /* BCMSDIO */
+#endif /* BCMDHD_SDIO */
 
 	wlan_static_osl_buf[index] = kmalloc(DHD_PREALLOC_OSL_BUF_SIZE, GFP_KERNEL);
 	if (!wlan_static_osl_buf[index])
 		goto err_mem_alloc;
 	size += DHD_PREALLOC_OSL_BUF_SIZE;
-	DHD_STATIC_TRACE("section %d, size=%ld\n",
+	DHD_STATIC_TRACE("sectoin %d, size=%ld\n",
 		DHD_PREALLOC_OSL_BUF, DHD_PREALLOC_OSL_BUF_SIZE);
 
 	wlan_static_scan_buf0[index] = kmalloc(DHD_PREALLOC_WIPHY_ESCAN0_SIZE, GFP_KERNEL);
 	if (!wlan_static_scan_buf0[index])
 		goto err_mem_alloc;
 	size += DHD_PREALLOC_WIPHY_ESCAN0_SIZE;
-	DHD_STATIC_TRACE("section %d, size=%d\n",
+	DHD_STATIC_TRACE("sectoin %d, size=%d\n",
 		DHD_PREALLOC_WIPHY_ESCAN0, DHD_PREALLOC_WIPHY_ESCAN0_SIZE);
 
 	wlan_static_dhd_info_buf[index] = kmalloc(DHD_PREALLOC_DHD_INFO_SIZE, GFP_KERNEL);
 	if (!wlan_static_dhd_info_buf[index])
 		goto err_mem_alloc;
 	size += DHD_PREALLOC_DHD_INFO_SIZE;
-	DHD_STATIC_TRACE("section %d, size=%d\n",
+	DHD_STATIC_TRACE("sectoin %d, size=%d\n",
 		DHD_PREALLOC_DHD_INFO, DHD_PREALLOC_DHD_INFO_SIZE);
 
-#if defined(BCMSDIO) || defined(BCMDBUS)
+#if defined(BCMDHD_SDIO) || defined(BCMDHD_USB)
 	wlan_static_dhd_wlfc_info_buf[index] = kmalloc(WLAN_DHD_WLFC_BUF_SIZE, GFP_KERNEL);
 	if (!wlan_static_dhd_wlfc_info_buf[index])
 		goto err_mem_alloc;
 	size += WLAN_DHD_WLFC_BUF_SIZE;
-	DHD_STATIC_TRACE("section %d, size=%d\n",
+	DHD_STATIC_TRACE("sectoin %d, size=%d\n",
 		DHD_PREALLOC_DHD_WLFC_INFO, WLAN_DHD_WLFC_BUF_SIZE);
-#endif /* BCMSDIO | BCMDBUS */
+#endif /* BCMDHD_SDIO | BCMDHD_USB */
 
-#ifdef BCMPCIE
+#ifdef BCMDHD_PCIE
 	wlan_static_if_flow_lkup[index] = kmalloc(DHD_PREALLOC_IF_FLOW_LKUP_SIZE, GFP_KERNEL);
 	if (!wlan_static_if_flow_lkup[index])
 		goto err_mem_alloc;
 	size += DHD_PREALLOC_IF_FLOW_LKUP_SIZE;
-	DHD_STATIC_TRACE("section %d, size=%d\n",
+	DHD_STATIC_TRACE("sectoin %d, size=%d\n",
 		DHD_PREALLOC_IF_FLOW_LKUP, DHD_PREALLOC_IF_FLOW_LKUP_SIZE);
-#endif /* BCMPCIE */
+#endif /* BCMDHD_PCIE */
 
 #if defined(CONFIG_BCMDHD_VTS) || defined(CONFIG_BCMDHD_DEBUG)
 	wlan_static_dhd_memdump_ram_buf[index] = kmalloc(DHD_PREALLOC_MEMDUMP_RAM_SIZE, GFP_KERNEL);
 	if (!wlan_static_dhd_memdump_ram_buf[index])
 		goto err_mem_alloc;
 	size += DHD_PREALLOC_MEMDUMP_RAM_SIZE;
-	DHD_STATIC_TRACE("section %d, size=%d\n",
+	DHD_STATIC_TRACE("sectoin %d, size=%d\n",
 		DHD_PREALLOC_MEMDUMP_RAM, DHD_PREALLOC_MEMDUMP_RAM_SIZE);
 #endif /* CONFIG_BCMDHD_VTS | CONFIG_BCMDHD_DEBUG */
 
-#if defined(BCMSDIO) || defined(BCMDBUS)
+#if defined(BCMDHD_SDIO) || defined(BCMDHD_USB)
 	wlan_static_dhd_wlfc_hanger_buf[index] = kmalloc(DHD_PREALLOC_DHD_WLFC_HANGER_SIZE, GFP_KERNEL);
 	if (!wlan_static_dhd_wlfc_hanger_buf[index])
 		goto err_mem_alloc;
 	size += DHD_PREALLOC_DHD_WLFC_HANGER_SIZE;
-	DHD_STATIC_TRACE("section %d, size=%d\n",
+	DHD_STATIC_TRACE("sectoin %d, size=%d\n",
 		DHD_PREALLOC_DHD_WLFC_HANGER, DHD_PREALLOC_DHD_WLFC_HANGER_SIZE);
-#endif /* BCMSDIO | BCMDBUS */
+#endif /* BCMDHD_SDIO | BCMDHD_USB */
 
 #if defined(CONFIG_BCMDHD_VTS) || defined(CONFIG_BCMDHD_DEBUG)
 	wlan_static_dhd_log_dump_buf[index] = kmalloc(DHD_PREALLOC_DHD_LOG_DUMP_BUF_SIZE, GFP_KERNEL);
 	if (!wlan_static_dhd_log_dump_buf[index])
 		goto err_mem_alloc;
 	size += DHD_PREALLOC_DHD_LOG_DUMP_BUF_SIZE;
-	DHD_STATIC_TRACE("section %d, size=%d\n",
+	DHD_STATIC_TRACE("sectoin %d, size=%d\n",
 		DHD_PREALLOC_DHD_LOG_DUMP_BUF, DHD_PREALLOC_DHD_LOG_DUMP_BUF_SIZE);
 
 	wlan_static_dhd_log_dump_buf_ex[index] = kmalloc(DHD_PREALLOC_DHD_LOG_DUMP_BUF_EX_SIZE, GFP_KERNEL);
 	if (!wlan_static_dhd_log_dump_buf_ex[index])
 		goto err_mem_alloc;
 	size += DHD_PREALLOC_DHD_LOG_DUMP_BUF_EX_SIZE;
-	DHD_STATIC_TRACE("section %d, size=%d\n",
+	DHD_STATIC_TRACE("sectoin %d, size=%d\n",
 		DHD_PREALLOC_DHD_LOG_DUMP_BUF_EX, DHD_PREALLOC_DHD_LOG_DUMP_BUF_EX_SIZE);
 #endif /* CONFIG_BCMDHD_VTS | CONFIG_BCMDHD_DEBUG */
 
@@ -562,28 +557,28 @@
 	if (!wlan_static_wl_escan_info_buf[index])
 		goto err_mem_alloc;
 	size += DHD_PREALLOC_WL_ESCAN_SIZE;
-	DHD_STATIC_TRACE("section %d, size=%d\n",
+	DHD_STATIC_TRACE("sectoin %d, size=%d\n",
 		DHD_PREALLOC_WL_ESCAN, DHD_PREALLOC_WL_ESCAN_SIZE);
 
 	wlan_static_fw_verbose_ring_buf[index] = kmalloc(FW_VERBOSE_RING_SIZE, GFP_KERNEL);
 	if (!wlan_static_fw_verbose_ring_buf[index])
 		goto err_mem_alloc;
 	size += FW_VERBOSE_RING_SIZE;
-	DHD_STATIC_TRACE("section %d, size=%d\n",
+	DHD_STATIC_TRACE("sectoin %d, size=%d\n",
 		DHD_PREALLOC_FW_VERBOSE_RING, FW_VERBOSE_RING_SIZE);
 
 	wlan_static_fw_event_ring_buf[index] = kmalloc(FW_EVENT_RING_SIZE, GFP_KERNEL);
 	if (!wlan_static_fw_event_ring_buf[index])
 		goto err_mem_alloc;
 	size += FW_EVENT_RING_SIZE;
-	DHD_STATIC_TRACE("section %d, size=%d\n",
+	DHD_STATIC_TRACE("sectoin %d, size=%d\n",
 		DHD_PREALLOC_FW_EVENT_RING, FW_EVENT_RING_SIZE);
 
 	wlan_static_dhd_event_ring_buf[index] = kmalloc(DHD_EVENT_RING_SIZE, GFP_KERNEL);
 	if (!wlan_static_dhd_event_ring_buf[index])
 		goto err_mem_alloc;
 	size += DHD_EVENT_RING_SIZE;
-	DHD_STATIC_TRACE("section %d, size=%d\n",
+	DHD_STATIC_TRACE("sectoin %d, size=%d\n",
 		DHD_PREALLOC_DHD_EVENT_RING, DHD_EVENT_RING_SIZE);
 
 #if defined(BCMDHD_UNUSE_MEM)
@@ -591,11 +586,11 @@
 	if (!wlan_static_nan_event_ring_buf[index])
 		goto err_mem_alloc;
 	size += NAN_EVENT_RING_SIZE;
-	DHD_STATIC_TRACE("section %d, size=%d\n",
+	DHD_STATIC_TRACE("sectoin %d, size=%d\n",
 		DHD_PREALLOC_NAN_EVENT_RING, NAN_EVENT_RING_SIZE);
 #endif /* BCMDHD_UNUSE_MEM */
 
-	DHD_STATIC_MSG("prealloc ok for index %d: %ld(%ldK)\n", index, size, size / 1024);
+	DHD_STATIC_MSG("prealloc ok for index %d: %ld(%ldK)\n", index, size, size/1024);
 	return 0;
 
 err_mem_alloc:
@@ -645,6 +640,7 @@
 }
 
 #ifndef DHD_STATIC_IN_DRIVER
+MODULE_LICENSE("GPL");
 module_init(dhd_static_buf_init);
 module_exit(dhd_static_buf_exit);
 #endif

--
Gitblit v1.6.2