hc
2024-10-12 a5969cabbb4660eab42b6ef0412cbbd1200cf14d
kernel/drivers/net/wireless/rockchip_wlan/rkwifi/bcmdhd/dhd_static_buf.c
old mode 100644new mode 100755
....@@ -7,10 +7,10 @@
77 #include <linux/err.h>
88 #include <linux/skbuff.h>
99
10
-#define DHD_STATIC_VERSION_STR "101.10.361.26 (wlan=r892223-20221011-1)"
11
-#define STATIC_ERROR_LEVEL BIT(0)
12
-#define STATIC_TRACE_LEVEL BIT(1)
13
-#define STATIC_MSG_LEVEL BIT(0)
10
+#define DHD_STATIC_VERSION_STR "101.10.361.18 (wlan=r892223-20220519-1)"
11
+#define STATIC_ERROR_LEVEL (1 << 0)
12
+#define STATIC_TRACE_LEVEL (1 << 1)
13
+#define STATIC_MSG_LEVEL (1 << 0)
1414 uint static_msg_level = STATIC_ERROR_LEVEL | STATIC_MSG_LEVEL;
1515
1616 #define DHD_STATIC_MSG(x, args...) \
....@@ -32,19 +32,12 @@
3232 } \
3333 } while (0)
3434
35
-#ifdef DHD_STATIC_IN_DRIVER
36
-#if ANDROID_VERSION > 0
37
-#define CONFIG_BCMDHD_VTS { : = y}
38
-#define CONFIG_BCMDHD_DEBUG { : = y}
39
-#endif
40
-#else
41
-#define BCMSDIO
42
-#define BCMPCIE
43
-//#define BCMDBUS
44
-#define CONFIG_BCMDHD_VTS { : = y}
45
-#define CONFIG_BCMDHD_DEBUG { : = y}
35
+#define BCMDHD_SDIO
36
+#define BCMDHD_PCIE
37
+//#define BCMDHD_USB
38
+#define CONFIG_BCMDHD_VTS := y
39
+#define CONFIG_BCMDHD_DEBUG := y
4640 //#define BCMDHD_UNUSE_MEM
47
-#endif
4841
4942 #ifndef MAX_NUM_ADAPTERS
5043 #define MAX_NUM_ADAPTERS 1
....@@ -52,28 +45,28 @@
5245
5346 enum dhd_prealloc_index {
5447 DHD_PREALLOC_PROT = 0,
55
-#if defined(BCMSDIO)
48
+#if defined(BCMDHD_SDIO)
5649 DHD_PREALLOC_RXBUF = 1,
5750 DHD_PREALLOC_DATABUF = 2,
58
-#endif /* BCMSDIO */
51
+#endif /* BCMDHD_SDIO */
5952 DHD_PREALLOC_OSL_BUF = 3,
6053 DHD_PREALLOC_SKB_BUF = 4,
6154 DHD_PREALLOC_WIPHY_ESCAN0 = 5,
6255 DHD_PREALLOC_WIPHY_ESCAN1 = 6,
6356 DHD_PREALLOC_DHD_INFO = 7,
64
-#if defined(BCMSDIO) || defined(BCMDBUS)
57
+#if defined(BCMDHD_SDIO) || defined(BCMDHD_USB)
6558 DHD_PREALLOC_DHD_WLFC_INFO = 8,
66
-#endif /* BCMSDIO | BCMDBUS */
67
-#ifdef BCMPCIE
59
+#endif /* BCMDHD_SDIO | BCMDHD_USB */
60
+#ifdef BCMDHD_PCIE
6861 DHD_PREALLOC_IF_FLOW_LKUP = 9,
69
-#endif /* BCMPCIE */
62
+#endif /* BCMDHD_PCIE */
7063 DHD_PREALLOC_MEMDUMP_BUF = 10,
7164 #if defined(CONFIG_BCMDHD_VTS) || defined(CONFIG_BCMDHD_DEBUG)
7265 DHD_PREALLOC_MEMDUMP_RAM = 11,
7366 #endif /* CONFIG_BCMDHD_VTS | CONFIG_BCMDHD_DEBUG */
74
-#if defined(BCMSDIO) || defined(BCMDBUS)
67
+#if defined(BCMDHD_SDIO) || defined(BCMDHD_USB)
7568 DHD_PREALLOC_DHD_WLFC_HANGER = 12,
76
-#endif /* BCMSDIO | BCMDBUS */
69
+#endif /* BCMDHD_SDIO | BCMDHD_USB */
7770 DHD_PREALLOC_PKTID_MAP = 13,
7871 DHD_PREALLOC_PKTID_MAP_IOCTL = 14,
7972 #if defined(CONFIG_BCMDHD_VTS) || defined(CONFIG_BCMDHD_DEBUG)
....@@ -93,11 +86,10 @@
9386 };
9487
9588 #define STATIC_BUF_MAX_NUM 20
96
-#define STATIC_BUF_SIZE (PAGE_SIZE * 2)
89
+#define STATIC_BUF_SIZE (PAGE_SIZE*2)
9790
9891 #ifndef CUSTOM_LOG_DUMP_BUFSIZE_MB
99
-/* DHD_LOG_DUMP_BUF_SIZE 4 MB static memory in kernel */
100
-#define CUSTOM_LOG_DUMP_BUFSIZE_MB 4
92
+#define CUSTOM_LOG_DUMP_BUFSIZE_MB 4 /* DHD_LOG_DUMP_BUF_SIZE 4 MB static memory in kernel */
10193 #endif /* CUSTOM_LOG_DUMP_BUFSIZE_MB */
10294
10395 #define DHD_PREALLOC_PROT_SIZE (16 * 1024)
....@@ -105,7 +97,7 @@
10597 #define DHD_PREALLOC_DATABUF_SIZE (64 * 1024)
10698 #define DHD_PREALLOC_OSL_BUF_SIZE (STATIC_BUF_MAX_NUM * STATIC_BUF_SIZE)
10799 #define DHD_PREALLOC_WIPHY_ESCAN0_SIZE (64 * 1024)
108
-#define DHD_PREALLOC_DHD_INFO_SIZE (43 * 1024)
100
+#define DHD_PREALLOC_DHD_INFO_SIZE (36 * 1024)
109101 #if defined(CONFIG_BCMDHD_VTS) || defined(CONFIG_BCMDHD_DEBUG)
110102 #define DHD_PREALLOC_MEMDUMP_RAM_SIZE (1290 * 1024)
111103 #endif /* CONFIG_BCMDHD_VTS | CONFIG_BCMDHD_DEBUG */
....@@ -136,87 +128,87 @@
136128 #endif /* CONFIG_64BIT */
137129 #define WLAN_DHD_MEMDUMP_SIZE (800 * 1024)
138130
139
-#define DHD_SKB_1PAGE_BUFSIZE (PAGE_SIZE * 1)
140
-#define DHD_SKB_2PAGE_BUFSIZE (PAGE_SIZE * 2)
141
-#define DHD_SKB_4PAGE_BUFSIZE (PAGE_SIZE * 4)
131
+#define DHD_SKB_1PAGE_BUFSIZE (PAGE_SIZE*1)
132
+#define DHD_SKB_2PAGE_BUFSIZE (PAGE_SIZE*2)
133
+#define DHD_SKB_4PAGE_BUFSIZE (PAGE_SIZE*4)
142134
143
-#ifdef BCMPCIE
135
+#ifdef BCMDHD_PCIE
144136 #define DHD_SKB_1PAGE_BUF_NUM 0
145137 #define DHD_SKB_2PAGE_BUF_NUM 192
146
-#elif defined(BCMSDIO)
138
+#elif defined(BCMDHD_SDIO)
147139 #define DHD_SKB_1PAGE_BUF_NUM 8
148140 #define DHD_SKB_2PAGE_BUF_NUM 8
149
-#endif /* BCMPCIE */
141
+#endif /* BCMDHD_PCIE */
150142 #define DHD_SKB_4PAGE_BUF_NUM 1
151143
152144 /* The number is defined in linux_osl.c
153145 * WLAN_SKB_1_2PAGE_BUF_NUM => STATIC_PKT_1_2PAGE_NUM
154146 * WLAN_SKB_BUF_NUM => STATIC_PKT_MAX_NUM
155147 */
156
-#if defined(BCMSDIO) || defined(BCMPCIE)
148
+#if defined(BCMDHD_SDIO) || defined(BCMDHD_PCIE)
157149 #define WLAN_SKB_1_2PAGE_BUF_NUM ((DHD_SKB_1PAGE_BUF_NUM) + \
158150 (DHD_SKB_2PAGE_BUF_NUM))
159151 #define WLAN_SKB_BUF_NUM ((WLAN_SKB_1_2PAGE_BUF_NUM) + (DHD_SKB_4PAGE_BUF_NUM))
160152 #endif
161153
162
-void *wlan_static_prot[MAX_NUM_ADAPTERS] = {};
163
-void *wlan_static_rxbuf[MAX_NUM_ADAPTERS] = {};
164
-void *wlan_static_databuf[MAX_NUM_ADAPTERS] = {};
165
-void *wlan_static_osl_buf[MAX_NUM_ADAPTERS] = {};
166
-void *wlan_static_scan_buf0[MAX_NUM_ADAPTERS] = {};
167
-void *wlan_static_scan_buf1[MAX_NUM_ADAPTERS] = {};
168
-void *wlan_static_dhd_info_buf[MAX_NUM_ADAPTERS] = {};
169
-void *wlan_static_dhd_wlfc_info_buf[MAX_NUM_ADAPTERS] = {};
170
-void *wlan_static_if_flow_lkup[MAX_NUM_ADAPTERS] = {};
171
-void *wlan_static_dhd_memdump_ram_buf[MAX_NUM_ADAPTERS] = {};
172
-void *wlan_static_dhd_wlfc_hanger_buf[MAX_NUM_ADAPTERS] = {};
154
+void *wlan_static_prot[MAX_NUM_ADAPTERS] = {NULL};
155
+void *wlan_static_rxbuf [MAX_NUM_ADAPTERS] = {NULL};
156
+void *wlan_static_databuf[MAX_NUM_ADAPTERS] = {NULL};
157
+void *wlan_static_osl_buf[MAX_NUM_ADAPTERS] = {NULL};
158
+void *wlan_static_scan_buf0[MAX_NUM_ADAPTERS] = {NULL};
159
+void *wlan_static_scan_buf1[MAX_NUM_ADAPTERS] = {NULL};
160
+void *wlan_static_dhd_info_buf[MAX_NUM_ADAPTERS] = {NULL};
161
+void *wlan_static_dhd_wlfc_info_buf[MAX_NUM_ADAPTERS] = {NULL};
162
+void *wlan_static_if_flow_lkup[MAX_NUM_ADAPTERS] = {NULL};
163
+void *wlan_static_dhd_memdump_ram_buf[MAX_NUM_ADAPTERS] = {NULL};
164
+void *wlan_static_dhd_wlfc_hanger_buf[MAX_NUM_ADAPTERS] = {NULL};
173165 #if defined(CONFIG_BCMDHD_VTS) || defined(CONFIG_BCMDHD_DEBUG)
174
-void *wlan_static_dhd_log_dump_buf[MAX_NUM_ADAPTERS] = {};
175
-void *wlan_static_dhd_log_dump_buf_ex[MAX_NUM_ADAPTERS] = {};
166
+void *wlan_static_dhd_log_dump_buf[MAX_NUM_ADAPTERS] = {NULL};
167
+void *wlan_static_dhd_log_dump_buf_ex[MAX_NUM_ADAPTERS] = {NULL};
176168 #endif /* CONFIG_BCMDHD_VTS | CONFIG_BCMDHD_DEBUG */
177
-void *wlan_static_wl_escan_info_buf[MAX_NUM_ADAPTERS] = {};
178
-void *wlan_static_fw_verbose_ring_buf[MAX_NUM_ADAPTERS] = {};
179
-void *wlan_static_fw_event_ring_buf[MAX_NUM_ADAPTERS] = {};
180
-void *wlan_static_dhd_event_ring_buf[MAX_NUM_ADAPTERS] = {};
181
-void *wlan_static_nan_event_ring_buf[MAX_NUM_ADAPTERS] = {};
169
+void *wlan_static_wl_escan_info_buf[MAX_NUM_ADAPTERS] = {NULL};
170
+void *wlan_static_fw_verbose_ring_buf[MAX_NUM_ADAPTERS] = {NULL};
171
+void *wlan_static_fw_event_ring_buf[MAX_NUM_ADAPTERS] = {NULL};
172
+void *wlan_static_dhd_event_ring_buf[MAX_NUM_ADAPTERS] = {NULL};
173
+void *wlan_static_nan_event_ring_buf[MAX_NUM_ADAPTERS] = {NULL};
182174
183
-#if defined(BCMSDIO) || defined(BCMPCIE)
184
-static struct sk_buff *wlan_static_skb[MAX_NUM_ADAPTERS][WLAN_SKB_BUF_NUM] = {};
185
-#endif /* BCMSDIO | BCMPCIE */
175
+#if defined(BCMDHD_SDIO) || defined(BCMDHD_PCIE)
176
+static struct sk_buff *wlan_static_skb[MAX_NUM_ADAPTERS][WLAN_SKB_BUF_NUM] = {{NULL}};
177
+#endif /* BCMDHD_SDIO | BCMDHD_PCIE */
186178
187179 void *
188180 dhd_wlan_mem_prealloc(
189
-#if defined(BCMDHD_MDRIVER) && !defined(DHD_STATIC_IN_DRIVER)
181
+#ifdef BCMDHD_MDRIVER
190182 uint bus_type, int index,
191183 #endif
192184 int section, unsigned long size)
193185 {
194
-#if !defined(BCMDHD_MDRIVER) || defined(DHD_STATIC_IN_DRIVER)
186
+#ifndef BCMDHD_MDRIVER
195187 int index = 0;
196188 #endif
197189
198
-#if defined(BCMDHD_MDRIVER) && !defined(DHD_STATIC_IN_DRIVER)
199
- DHD_STATIC_MSG("bus_type %d, index %d, section %d, size %ld\n",
190
+#ifdef BCMDHD_MDRIVER
191
+ DHD_STATIC_MSG("bus_type %d, index %d, sectoin %d, size %ld\n",
200192 bus_type, index, section, size);
201193 #else
202
- DHD_STATIC_MSG("section %d, size %ld\n", section, size);
194
+ DHD_STATIC_MSG("sectoin %d, size %ld\n", section, size);
203195 #endif
204196
205197 if (section == DHD_PREALLOC_PROT)
206198 return wlan_static_prot[index];
207199
208
-#if defined(BCMSDIO)
200
+#if defined(BCMDHD_SDIO)
209201 if (section == DHD_PREALLOC_RXBUF)
210202 return wlan_static_rxbuf[index];
211203
212204 if (section == DHD_PREALLOC_DATABUF)
213205 return wlan_static_databuf[index];
214
-#endif /* BCMSDIO */
206
+#endif /* BCMDHD_SDIO */
215207
216
-#if defined(BCMSDIO) || defined(BCMPCIE)
208
+#if defined(BCMDHD_SDIO) || defined(BCMDHD_PCIE)
217209 if (section == DHD_PREALLOC_SKB_BUF)
218210 return wlan_static_skb[index];
219
-#endif /* BCMSDIO | BCMPCIE */
211
+#endif /* BCMDHD_SDIO | BCMDHD_PCIE */
220212
221213 if (section == DHD_PREALLOC_WIPHY_ESCAN0)
222214 return wlan_static_scan_buf0[index];
....@@ -241,7 +233,7 @@
241233 }
242234 return wlan_static_dhd_info_buf[index];
243235 }
244
-#if defined(BCMSDIO) || defined(BCMDBUS)
236
+#if defined(BCMDHD_SDIO) || defined(BCMDHD_USB)
245237 if (section == DHD_PREALLOC_DHD_WLFC_INFO) {
246238 if (size > WLAN_DHD_WLFC_BUF_SIZE) {
247239 DHD_STATIC_ERROR("request DHD_WLFC_INFO(%lu) > %d\n",
....@@ -250,8 +242,8 @@
250242 }
251243 return wlan_static_dhd_wlfc_info_buf[index];
252244 }
253
-#endif /* BCMSDIO | BCMDBUS */
254
-#ifdef BCMPCIE
245
+#endif /* BCMDHD_SDIO | BCMDHD_USB */
246
+#ifdef BCMDHD_PCIE
255247 if (section == DHD_PREALLOC_IF_FLOW_LKUP) {
256248 if (size > DHD_PREALLOC_IF_FLOW_LKUP_SIZE) {
257249 DHD_STATIC_ERROR("request DHD_IF_FLOW_LKUP(%lu) > %d\n",
....@@ -260,7 +252,7 @@
260252 }
261253 return wlan_static_if_flow_lkup[index];
262254 }
263
-#endif /* BCMPCIE */
255
+#endif /* BCMDHD_PCIE */
264256 #if defined(CONFIG_BCMDHD_VTS) || defined(CONFIG_BCMDHD_DEBUG)
265257 if (section == DHD_PREALLOC_MEMDUMP_RAM) {
266258 if (size > DHD_PREALLOC_MEMDUMP_RAM_SIZE) {
....@@ -271,7 +263,7 @@
271263 return wlan_static_dhd_memdump_ram_buf[index];
272264 }
273265 #endif /* CONFIG_BCMDHD_VTS | CONFIG_BCMDHD_DEBUG */
274
-#if defined(BCMSDIO) || defined(BCMDBUS)
266
+#if defined(BCMDHD_SDIO) || defined(BCMDHD_USB)
275267 if (section == DHD_PREALLOC_DHD_WLFC_HANGER) {
276268 if (size > DHD_PREALLOC_DHD_WLFC_HANGER_SIZE) {
277269 DHD_STATIC_ERROR("request DHD_WLFC_HANGER(%lu) > %d\n",
....@@ -280,7 +272,7 @@
280272 }
281273 return wlan_static_dhd_wlfc_hanger_buf[index];
282274 }
283
-#endif /* BCMSDIO | BCMDBUS */
275
+#endif /* BCMDHD_SDIO | BCMDHD_USB */
284276 #if defined(CONFIG_BCMDHD_VTS) || defined(CONFIG_BCMDHD_DEBUG)
285277 if (section == DHD_PREALLOC_DHD_LOG_DUMP_BUF) {
286278 if (size > DHD_PREALLOC_DHD_LOG_DUMP_BUF_SIZE) {
....@@ -357,18 +349,18 @@
357349 static void
358350 dhd_deinit_wlan_mem(int index)
359351 {
360
-#if defined(BCMSDIO) || defined(BCMPCIE)
352
+#if defined(BCMDHD_SDIO) || defined(BCMDHD_PCIE)
361353 int i;
362
-#endif /* BCMSDIO | BCMPCIE */
354
+#endif /* BCMDHD_SDIO | BCMDHD_PCIE */
363355
364356 if (wlan_static_prot[index])
365357 kfree(wlan_static_prot[index]);
366
-#if defined(BCMSDIO)
358
+#if defined(BCMDHD_SDIO)
367359 if (wlan_static_rxbuf[index])
368360 kfree(wlan_static_rxbuf[index]);
369361 if (wlan_static_databuf[index])
370362 kfree(wlan_static_databuf[index]);
371
-#endif /* BCMSDIO */
363
+#endif /* BCMDHD_SDIO */
372364 if (wlan_static_osl_buf[index])
373365 kfree(wlan_static_osl_buf[index]);
374366 if (wlan_static_scan_buf0[index])
....@@ -377,22 +369,22 @@
377369 kfree(wlan_static_scan_buf1[index]);
378370 if (wlan_static_dhd_info_buf[index])
379371 kfree(wlan_static_dhd_info_buf[index]);
380
-#if defined(BCMSDIO) || defined(BCMDBUS)
372
+#if defined(BCMDHD_SDIO) || defined(BCMDHD_USB)
381373 if (wlan_static_dhd_wlfc_info_buf[index])
382374 kfree(wlan_static_dhd_wlfc_info_buf[index]);
383
-#endif /* BCMSDIO | BCMDBUS */
384
-#ifdef BCMPCIE
375
+#endif /* BCMDHD_SDIO | BCMDHD_USB */
376
+#ifdef BCMDHD_PCIE
385377 if (wlan_static_if_flow_lkup[index])
386378 kfree(wlan_static_if_flow_lkup[index]);
387
-#endif /* BCMPCIE */
379
+#endif /* BCMDHD_PCIE */
388380 #if defined(CONFIG_BCMDHD_VTS) || defined(CONFIG_BCMDHD_DEBUG)
389381 if (wlan_static_dhd_memdump_ram_buf[index])
390382 kfree(wlan_static_dhd_memdump_ram_buf[index]);
391383 #endif /* CONFIG_BCMDHD_VTS | CONFIG_BCMDHD_DEBUG */
392
-#if defined(BCMSDIO) || defined(BCMDBUS)
384
+#if defined(BCMDHD_SDIO) || defined(BCMDHD_USB)
393385 if (wlan_static_dhd_wlfc_hanger_buf[index])
394386 kfree(wlan_static_dhd_wlfc_hanger_buf[index]);
395
-#endif /* BCMSDIO | BCMDBUS */
387
+#endif /* BCMDHD_SDIO | BCMDHD_USB */
396388 #if defined(CONFIG_BCMDHD_VTS) || defined(CONFIG_BCMDHD_DEBUG)
397389 if (wlan_static_dhd_log_dump_buf[index])
398390 kfree(wlan_static_dhd_log_dump_buf[index]);
....@@ -412,12 +404,12 @@
412404 kfree(wlan_static_nan_event_ring_buf[index]);
413405 #endif /* BCMDHD_UNUSE_MEM */
414406
415
-#if defined(BCMSDIO) || defined(BCMPCIE)
407
+#if defined(BCMDHD_SDIO) || defined(BCMDHD_PCIE)
416408 for (i=0; i<WLAN_SKB_BUF_NUM; i++) {
417409 if (wlan_static_skb[index][i])
418410 dev_kfree_skb(wlan_static_skb[index][i]);
419411 }
420
-#endif /* BCMSDIO | BCMPCIE */
412
+#endif /* BCMDHD_SDIO | BCMDHD_PCIE */
421413
422414 return;
423415 }
....@@ -425,136 +417,139 @@
425417 static int
426418 dhd_init_wlan_mem(int index)
427419 {
428
-#if defined(BCMSDIO) || defined(BCMPCIE)
420
+#if defined(BCMDHD_SDIO) || defined(BCMDHD_PCIE)
429421 int i;
430422 #endif
431423 unsigned long size = 0;
432424
433
-#if defined(BCMSDIO) || defined(BCMPCIE)
434
- for (i = 0; i < WLAN_SKB_BUF_NUM; i++)
425
+#if defined(BCMDHD_SDIO) || defined(BCMDHD_PCIE)
426
+ for (i=0; i <WLAN_SKB_BUF_NUM; i++) {
435427 wlan_static_skb[index][i] = NULL;
428
+ }
436429
437430 for (i = 0; i < DHD_SKB_1PAGE_BUF_NUM; i++) {
438431 wlan_static_skb[index][i] = dev_alloc_skb(DHD_SKB_1PAGE_BUFSIZE);
439
- if (!wlan_static_skb[index][i])
432
+ if (!wlan_static_skb[index][i]) {
440433 goto err_mem_alloc;
434
+ }
441435 size += DHD_SKB_1PAGE_BUFSIZE;
442
- DHD_STATIC_TRACE("section %d skb[%d], size=%ld\n",
436
+ DHD_STATIC_TRACE("sectoin %d skb[%d], size=%ld\n",
443437 DHD_PREALLOC_SKB_BUF, i, DHD_SKB_1PAGE_BUFSIZE);
444438 }
445439
446440 for (i = DHD_SKB_1PAGE_BUF_NUM; i < WLAN_SKB_1_2PAGE_BUF_NUM; i++) {
447441 wlan_static_skb[index][i] = dev_alloc_skb(DHD_SKB_2PAGE_BUFSIZE);
448
- if (!wlan_static_skb[index][i])
442
+ if (!wlan_static_skb[index][i]) {
449443 goto err_mem_alloc;
444
+ }
450445 size += DHD_SKB_2PAGE_BUFSIZE;
451
- DHD_STATIC_TRACE("section %d skb[%d], size=%ld\n",
446
+ DHD_STATIC_TRACE("sectoin %d skb[%d], size=%ld\n",
452447 DHD_PREALLOC_SKB_BUF, i, DHD_SKB_2PAGE_BUFSIZE);
453448 }
454
-#endif /* BCMSDIO | BCMPCIE */
449
+#endif /* BCMDHD_SDIO | BCMDHD_PCIE */
455450
456
-#if defined(BCMSDIO)
451
+#if defined(BCMDHD_SDIO)
457452 wlan_static_skb[index][i] = dev_alloc_skb(DHD_SKB_4PAGE_BUFSIZE);
458453 if (!wlan_static_skb[index][i])
459454 goto err_mem_alloc;
460455 size += DHD_SKB_4PAGE_BUFSIZE;
461
- DHD_STATIC_TRACE("section %d skb[%d], size=%ld\n",
456
+ DHD_STATIC_TRACE("sectoin %d skb[%d], size=%ld\n",
462457 DHD_PREALLOC_SKB_BUF, i, DHD_SKB_4PAGE_BUFSIZE);
463
-#endif /* BCMSDIO */
458
+#endif /* BCMDHD_SDIO */
464459
465460 wlan_static_prot[index] = kmalloc(DHD_PREALLOC_PROT_SIZE, GFP_KERNEL);
466461 if (!wlan_static_prot[index])
467462 goto err_mem_alloc;
468463 size += DHD_PREALLOC_PROT_SIZE;
469
- DHD_STATIC_TRACE("section %d, size=%d\n",
464
+ DHD_STATIC_TRACE("sectoin %d, size=%d\n",
470465 DHD_PREALLOC_PROT, DHD_PREALLOC_PROT_SIZE);
471466
472
-#if defined(BCMSDIO)
467
+#if defined(BCMDHD_SDIO)
473468 wlan_static_rxbuf[index] = kmalloc(DHD_PREALLOC_RXBUF_SIZE, GFP_KERNEL);
474469 if (!wlan_static_rxbuf[index])
475470 goto err_mem_alloc;
476471 size += DHD_PREALLOC_RXBUF_SIZE;
477
- DHD_STATIC_TRACE("section %d, size=%d\n",
472
+ DHD_STATIC_TRACE("sectoin %d, size=%d\n",
478473 DHD_PREALLOC_RXBUF, DHD_PREALLOC_RXBUF_SIZE);
479474
480475 wlan_static_databuf[index] = kmalloc(DHD_PREALLOC_DATABUF_SIZE, GFP_KERNEL);
481476 if (!wlan_static_databuf[index])
482477 goto err_mem_alloc;
483478 size += DHD_PREALLOC_DATABUF_SIZE;
484
- DHD_STATIC_TRACE("section %d, size=%d\n",
479
+ DHD_STATIC_TRACE("sectoin %d, size=%d\n",
485480 DHD_PREALLOC_DATABUF, DHD_PREALLOC_DATABUF_SIZE);
486
-#endif /* BCMSDIO */
481
+#endif /* BCMDHD_SDIO */
487482
488483 wlan_static_osl_buf[index] = kmalloc(DHD_PREALLOC_OSL_BUF_SIZE, GFP_KERNEL);
489484 if (!wlan_static_osl_buf[index])
490485 goto err_mem_alloc;
491486 size += DHD_PREALLOC_OSL_BUF_SIZE;
492
- DHD_STATIC_TRACE("section %d, size=%ld\n",
487
+ DHD_STATIC_TRACE("sectoin %d, size=%ld\n",
493488 DHD_PREALLOC_OSL_BUF, DHD_PREALLOC_OSL_BUF_SIZE);
494489
495490 wlan_static_scan_buf0[index] = kmalloc(DHD_PREALLOC_WIPHY_ESCAN0_SIZE, GFP_KERNEL);
496491 if (!wlan_static_scan_buf0[index])
497492 goto err_mem_alloc;
498493 size += DHD_PREALLOC_WIPHY_ESCAN0_SIZE;
499
- DHD_STATIC_TRACE("section %d, size=%d\n",
494
+ DHD_STATIC_TRACE("sectoin %d, size=%d\n",
500495 DHD_PREALLOC_WIPHY_ESCAN0, DHD_PREALLOC_WIPHY_ESCAN0_SIZE);
501496
502497 wlan_static_dhd_info_buf[index] = kmalloc(DHD_PREALLOC_DHD_INFO_SIZE, GFP_KERNEL);
503498 if (!wlan_static_dhd_info_buf[index])
504499 goto err_mem_alloc;
505500 size += DHD_PREALLOC_DHD_INFO_SIZE;
506
- DHD_STATIC_TRACE("section %d, size=%d\n",
501
+ DHD_STATIC_TRACE("sectoin %d, size=%d\n",
507502 DHD_PREALLOC_DHD_INFO, DHD_PREALLOC_DHD_INFO_SIZE);
508503
509
-#if defined(BCMSDIO) || defined(BCMDBUS)
504
+#if defined(BCMDHD_SDIO) || defined(BCMDHD_USB)
510505 wlan_static_dhd_wlfc_info_buf[index] = kmalloc(WLAN_DHD_WLFC_BUF_SIZE, GFP_KERNEL);
511506 if (!wlan_static_dhd_wlfc_info_buf[index])
512507 goto err_mem_alloc;
513508 size += WLAN_DHD_WLFC_BUF_SIZE;
514
- DHD_STATIC_TRACE("section %d, size=%d\n",
509
+ DHD_STATIC_TRACE("sectoin %d, size=%d\n",
515510 DHD_PREALLOC_DHD_WLFC_INFO, WLAN_DHD_WLFC_BUF_SIZE);
516
-#endif /* BCMSDIO | BCMDBUS */
511
+#endif /* BCMDHD_SDIO | BCMDHD_USB */
517512
518
-#ifdef BCMPCIE
513
+#ifdef BCMDHD_PCIE
519514 wlan_static_if_flow_lkup[index] = kmalloc(DHD_PREALLOC_IF_FLOW_LKUP_SIZE, GFP_KERNEL);
520515 if (!wlan_static_if_flow_lkup[index])
521516 goto err_mem_alloc;
522517 size += DHD_PREALLOC_IF_FLOW_LKUP_SIZE;
523
- DHD_STATIC_TRACE("section %d, size=%d\n",
518
+ DHD_STATIC_TRACE("sectoin %d, size=%d\n",
524519 DHD_PREALLOC_IF_FLOW_LKUP, DHD_PREALLOC_IF_FLOW_LKUP_SIZE);
525
-#endif /* BCMPCIE */
520
+#endif /* BCMDHD_PCIE */
526521
527522 #if defined(CONFIG_BCMDHD_VTS) || defined(CONFIG_BCMDHD_DEBUG)
528523 wlan_static_dhd_memdump_ram_buf[index] = kmalloc(DHD_PREALLOC_MEMDUMP_RAM_SIZE, GFP_KERNEL);
529524 if (!wlan_static_dhd_memdump_ram_buf[index])
530525 goto err_mem_alloc;
531526 size += DHD_PREALLOC_MEMDUMP_RAM_SIZE;
532
- DHD_STATIC_TRACE("section %d, size=%d\n",
527
+ DHD_STATIC_TRACE("sectoin %d, size=%d\n",
533528 DHD_PREALLOC_MEMDUMP_RAM, DHD_PREALLOC_MEMDUMP_RAM_SIZE);
534529 #endif /* CONFIG_BCMDHD_VTS | CONFIG_BCMDHD_DEBUG */
535530
536
-#if defined(BCMSDIO) || defined(BCMDBUS)
531
+#if defined(BCMDHD_SDIO) || defined(BCMDHD_USB)
537532 wlan_static_dhd_wlfc_hanger_buf[index] = kmalloc(DHD_PREALLOC_DHD_WLFC_HANGER_SIZE, GFP_KERNEL);
538533 if (!wlan_static_dhd_wlfc_hanger_buf[index])
539534 goto err_mem_alloc;
540535 size += DHD_PREALLOC_DHD_WLFC_HANGER_SIZE;
541
- DHD_STATIC_TRACE("section %d, size=%d\n",
536
+ DHD_STATIC_TRACE("sectoin %d, size=%d\n",
542537 DHD_PREALLOC_DHD_WLFC_HANGER, DHD_PREALLOC_DHD_WLFC_HANGER_SIZE);
543
-#endif /* BCMSDIO | BCMDBUS */
538
+#endif /* BCMDHD_SDIO | BCMDHD_USB */
544539
545540 #if defined(CONFIG_BCMDHD_VTS) || defined(CONFIG_BCMDHD_DEBUG)
546541 wlan_static_dhd_log_dump_buf[index] = kmalloc(DHD_PREALLOC_DHD_LOG_DUMP_BUF_SIZE, GFP_KERNEL);
547542 if (!wlan_static_dhd_log_dump_buf[index])
548543 goto err_mem_alloc;
549544 size += DHD_PREALLOC_DHD_LOG_DUMP_BUF_SIZE;
550
- DHD_STATIC_TRACE("section %d, size=%d\n",
545
+ DHD_STATIC_TRACE("sectoin %d, size=%d\n",
551546 DHD_PREALLOC_DHD_LOG_DUMP_BUF, DHD_PREALLOC_DHD_LOG_DUMP_BUF_SIZE);
552547
553548 wlan_static_dhd_log_dump_buf_ex[index] = kmalloc(DHD_PREALLOC_DHD_LOG_DUMP_BUF_EX_SIZE, GFP_KERNEL);
554549 if (!wlan_static_dhd_log_dump_buf_ex[index])
555550 goto err_mem_alloc;
556551 size += DHD_PREALLOC_DHD_LOG_DUMP_BUF_EX_SIZE;
557
- DHD_STATIC_TRACE("section %d, size=%d\n",
552
+ DHD_STATIC_TRACE("sectoin %d, size=%d\n",
558553 DHD_PREALLOC_DHD_LOG_DUMP_BUF_EX, DHD_PREALLOC_DHD_LOG_DUMP_BUF_EX_SIZE);
559554 #endif /* CONFIG_BCMDHD_VTS | CONFIG_BCMDHD_DEBUG */
560555
....@@ -562,28 +557,28 @@
562557 if (!wlan_static_wl_escan_info_buf[index])
563558 goto err_mem_alloc;
564559 size += DHD_PREALLOC_WL_ESCAN_SIZE;
565
- DHD_STATIC_TRACE("section %d, size=%d\n",
560
+ DHD_STATIC_TRACE("sectoin %d, size=%d\n",
566561 DHD_PREALLOC_WL_ESCAN, DHD_PREALLOC_WL_ESCAN_SIZE);
567562
568563 wlan_static_fw_verbose_ring_buf[index] = kmalloc(FW_VERBOSE_RING_SIZE, GFP_KERNEL);
569564 if (!wlan_static_fw_verbose_ring_buf[index])
570565 goto err_mem_alloc;
571566 size += FW_VERBOSE_RING_SIZE;
572
- DHD_STATIC_TRACE("section %d, size=%d\n",
567
+ DHD_STATIC_TRACE("sectoin %d, size=%d\n",
573568 DHD_PREALLOC_FW_VERBOSE_RING, FW_VERBOSE_RING_SIZE);
574569
575570 wlan_static_fw_event_ring_buf[index] = kmalloc(FW_EVENT_RING_SIZE, GFP_KERNEL);
576571 if (!wlan_static_fw_event_ring_buf[index])
577572 goto err_mem_alloc;
578573 size += FW_EVENT_RING_SIZE;
579
- DHD_STATIC_TRACE("section %d, size=%d\n",
574
+ DHD_STATIC_TRACE("sectoin %d, size=%d\n",
580575 DHD_PREALLOC_FW_EVENT_RING, FW_EVENT_RING_SIZE);
581576
582577 wlan_static_dhd_event_ring_buf[index] = kmalloc(DHD_EVENT_RING_SIZE, GFP_KERNEL);
583578 if (!wlan_static_dhd_event_ring_buf[index])
584579 goto err_mem_alloc;
585580 size += DHD_EVENT_RING_SIZE;
586
- DHD_STATIC_TRACE("section %d, size=%d\n",
581
+ DHD_STATIC_TRACE("sectoin %d, size=%d\n",
587582 DHD_PREALLOC_DHD_EVENT_RING, DHD_EVENT_RING_SIZE);
588583
589584 #if defined(BCMDHD_UNUSE_MEM)
....@@ -591,11 +586,11 @@
591586 if (!wlan_static_nan_event_ring_buf[index])
592587 goto err_mem_alloc;
593588 size += NAN_EVENT_RING_SIZE;
594
- DHD_STATIC_TRACE("section %d, size=%d\n",
589
+ DHD_STATIC_TRACE("sectoin %d, size=%d\n",
595590 DHD_PREALLOC_NAN_EVENT_RING, NAN_EVENT_RING_SIZE);
596591 #endif /* BCMDHD_UNUSE_MEM */
597592
598
- DHD_STATIC_MSG("prealloc ok for index %d: %ld(%ldK)\n", index, size, size / 1024);
593
+ DHD_STATIC_MSG("prealloc ok for index %d: %ld(%ldK)\n", index, size, size/1024);
599594 return 0;
600595
601596 err_mem_alloc:
....@@ -645,6 +640,7 @@
645640 }
646641
647642 #ifndef DHD_STATIC_IN_DRIVER
643
+MODULE_LICENSE("GPL");
648644 module_init(dhd_static_buf_init);
649645 module_exit(dhd_static_buf_exit);
650646 #endif