xref: /OK3568_Linux_fs/kernel/drivers/net/wireless/rockchip_wlan/rkwifi/bcmdhd/dhd_linux.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1 /*
2  * DHD Linux header file (dhd_linux exports for cfg80211 and other components)
3  *
4  * Copyright (C) 2020, Broadcom.
5  *
6  *      Unless you and Broadcom execute a separate written software license
7  * agreement governing use of this software, this software is licensed to you
8  * under the terms of the GNU General Public License version 2 (the "GPL"),
9  * available at http://www.broadcom.com/licenses/GPLv2.php, with the
10  * following added to such license:
11  *
12  *      As a special exception, the copyright holders of this software give you
13  * permission to link this software with independent modules, and to copy and
14  * distribute the resulting executable under terms of your choice, provided that
15  * you also meet, for each linked independent module, the terms and conditions of
16  * the license of that module.  An independent module is a module which is not
17  * derived from this software.  The special exception does not apply to any
18  * modifications of the software.
19  *
20  *
21  * <<Broadcom-WL-IPTag/Open:>>
22  *
23  * $Id$
24  */
25 
26 /* wifi platform functions for power, interrupt and pre-alloc, either
27  * from Android-like platform device data, or Broadcom wifi platform
28  * device data.
29  *
30  */
31 #ifndef __DHD_LINUX_H__
32 #define __DHD_LINUX_H__
33 
34 #include <linux/kernel.h>
35 #include <linux/init.h>
36 #include <linux/fs.h>
37 #include <dngl_stats.h>
38 #include <dhd.h>
39 #ifdef DHD_WMF
40 #include <dhd_wmf_linux.h>
41 #endif
42 /* Linux wireless extension support */
43 #if defined(WL_WIRELESS_EXT)
44 #include <wl_iw.h>
45 #endif /* defined(WL_WIRELESS_EXT) */
46 #if defined(CONFIG_HAS_EARLYSUSPEND) && defined(DHD_USE_EARLYSUSPEND)
47 #include <linux/earlysuspend.h>
48 #endif /* defined(CONFIG_HAS_EARLYSUSPEND) && defined(DHD_USE_EARLYSUSPEND) */
49 
50 #ifdef BCMPCIE
51 #include <bcmmsgbuf.h>
52 #endif /* BCMPCIE */
53 
54 #ifdef PCIE_FULL_DONGLE
55 #include <etd.h>
56 #endif /* PCIE_FULL_DONGLE */
57 
58 #ifdef WL_MONITOR
59 #ifdef HOST_RADIOTAP_CONV
60 #include <bcmwifi_monitor.h>
61 #else
62 #define MAX_RADIOTAP_SIZE      256 /* Maximum size to hold HE Radiotap header format */
63 #define MAX_MON_PKT_SIZE       (4096 + MAX_RADIOTAP_SIZE)
64 #endif /* HOST_RADIOTAP_CONV */
65 #endif /* WL_MONITOR */
66 
67 /* dongle status */
68 enum wifi_adapter_status {
69 	WIFI_STATUS_POWER_ON = 0,
70 	WIFI_STATUS_ATTACH,
71 	WIFI_STATUS_FW_READY,
72 	WIFI_STATUS_DETTACH
73 };
74 #define wifi_chk_adapter_status(adapter, stat) (test_bit(stat, &(adapter)->status))
75 #define wifi_get_adapter_status(adapter, stat) (test_bit(stat, &(adapter)->status))
76 #define wifi_set_adapter_status(adapter, stat) (set_bit(stat, &(adapter)->status))
77 #define wifi_clr_adapter_status(adapter, stat) (clear_bit(stat, &(adapter)->status))
78 #define wifi_chg_adapter_status(adapter, stat) (change_bit(stat, &(adapter)->status))
79 
80 #define DHD_REGISTRATION_TIMEOUT  12000  /* msec : allowed time to finished dhd registration */
81 #define DHD_FW_READY_TIMEOUT  5000  /* msec : allowed time to finished fw download */
82 
83 typedef struct wifi_adapter_info {
84 	const char	*name;
85 	uint		irq_num;
86 	uint		intr_flags;
87 	const char	*fw_path;
88 	const char	*nv_path;
89 	const char	*clm_path;
90 	const char	*conf_path;
91 	void		*wifi_plat_data;	/* wifi ctrl func, for backward compatibility */
92 	uint		bus_type;
93 	uint		bus_num;
94 	uint		slot_num;
95 	int			index;
96 	int 		gpio_wl_reg_on;
97 #ifdef CUSTOMER_OOB
98 	int 		gpio_wl_host_wake;
99 #endif
100 	wait_queue_head_t status_event;
101 	unsigned long status;
102 #if defined (BT_OVER_SDIO)
103 	const char	*btfw_path;
104 #endif /* defined (BT_OVER_SDIO) */
105 #if defined(BCMSDIO)
106 	struct sdio_func *sdio_func;
107 #endif /* BCMSDIO */
108 #if defined(BCMPCIE)
109 	struct pci_dev *pci_dev;
110 	struct pci_saved_state *pci_saved_state;
111 #endif /* BCMPCIE */
112 } wifi_adapter_info_t;
113 
114 #if defined(CONFIG_WIFI_CONTROL_FUNC) || defined(CUSTOMER_HW4)
115 #include <linux/wlan_plat.h>
116 #else
117 #include <dhd_plat.h>
118 #endif /* CONFIG_WIFI_CONTROL_FUNC */
119 
120 typedef struct bcmdhd_wifi_platdata {
121 	uint				num_adapters;
122 	wifi_adapter_info_t	*adapters;
123 } bcmdhd_wifi_platdata_t;
124 
125 /** Per STA params. A list of dhd_sta objects are managed in dhd_if */
126 typedef struct dhd_sta {
127 	cumm_ctr_t cumm_ctr;    /* cummulative queue length of child flowrings */
128 	uint16 flowid[NUMPRIO]; /* allocated flow ring ids (by priority) */
129 	void * ifp;             /* associated dhd_if */
130 	struct ether_addr ea;   /* stations ethernet mac address */
131 	struct list_head list;  /* link into dhd_if::sta_list */
132 	int idx;                /* index of self in dhd_pub::sta_pool[] */
133 	int ifidx;              /* index of interface in dhd */
134 #ifdef DHD_WMF
135 	struct dhd_sta *psta_prim; /* primary index of psta interface */
136 #endif /* DHD_WMF */
137 } dhd_sta_t;
138 typedef dhd_sta_t dhd_sta_pool_t;
139 
140 #ifdef DHD_4WAYM4_FAIL_DISCONNECT
141 typedef enum {
142 	NONE_4WAY,
143 	M1_4WAY,
144 	M2_4WAY,
145 	M3_4WAY,
146 	M4_4WAY
147 } msg_4way_t;
148 typedef enum {
149 	M3_RXED,
150 	M4_TXFAILED
151 } msg_4way_state_t;
152 #define MAX_4WAY_TIMEOUT_MS 2000
153 #endif /* DHD_4WAYM4_FAIL_DISCONNECT */
154 
155 #if defined(DHD_LB)
156 /* Dynamic CPU selection for load balancing. */
157 #include <linux/cpu.h>
158 #include <linux/cpumask.h>
159 #include <linux/notifier.h>
160 #include <linux/workqueue.h>
161 #include <asm/atomic.h>
162 
163 /* FIXME: Make this a module param or a sysfs. */
164 #if !defined(DHD_LB_PRIMARY_CPUS)
165 #define DHD_LB_PRIMARY_CPUS     0x0 /* Big CPU coreids mask */
166 #endif
167 #if !defined(DHD_LB_SECONDARY_CPUS)
168 #define DHD_LB_SECONDARY_CPUS   0xFE /* Little CPU coreids mask */
169 #endif
170 
171 #define HIST_BIN_SIZE	9
172 
173 #if defined(DHD_LB_TXP)
174 /* Pkttag not compatible with PROP_TXSTATUS or WLFC */
175 typedef struct dhd_tx_lb_pkttag_fr {
176 	struct net_device *net;
177 	int ifidx;
178 } dhd_tx_lb_pkttag_fr_t;
179 
180 #define DHD_LB_TX_PKTTAG_SET_NETDEV(tag, netdevp)	((tag)->net = netdevp)
181 #define DHD_LB_TX_PKTTAG_NETDEV(tag)			((tag)->net)
182 
183 #define DHD_LB_TX_PKTTAG_SET_IFIDX(tag, ifidx)	((tag)->ifidx = ifidx)
184 #define DHD_LB_TX_PKTTAG_IFIDX(tag)		((tag)->ifidx)
185 #endif /* DHD_LB_TXP */
186 #endif /* DHD_LB */
187 
188 #define FILE_DUMP_MAX_WAIT_TIME 4000
189 
190 #ifdef IL_BIGENDIAN
191 #include <bcmendian.h>
192 #define htod32(i) (bcmswap32(i))
193 #define htod16(i) (bcmswap16(i))
194 #define dtoh32(i) (bcmswap32(i))
195 #define dtoh16(i) (bcmswap16(i))
196 #define htodchanspec(i) htod16(i)
197 #define dtohchanspec(i) dtoh16(i)
198 #else
199 #define htod32(i) (i)
200 #define htod16(i) (i)
201 #define dtoh32(i) (i)
202 #define dtoh16(i) (i)
203 #define htodchanspec(i) (i)
204 #define dtohchanspec(i) (i)
205 #endif /* IL_BIGENDINA */
206 
207 #if defined(DHD_TCP_WINSIZE_ADJUST)
208 #define MIN_TCP_WIN_SIZE 18000
209 #define WIN_SIZE_SCALE_FACTOR 2
210 #define MAX_TARGET_PORTS 5
211 #endif /* DHD_TCP_WINSIZE_ADJUST */
212 
213 #ifdef BLOCK_IPV6_PACKET
214 #define HEX_PREF_STR	"0x"
215 #define UNI_FILTER_STR	"010000000000"
216 #define ZERO_ADDR_STR	"000000000000"
217 #define ETHER_TYPE_STR	"0000"
218 #define IPV6_FILTER_STR	"20"
219 #define ZERO_TYPE_STR	"00"
220 #endif /* BLOCK_IPV6_PACKET */
221 
222 #if defined(OEM_ANDROID) && defined(SOFTAP)
223 extern bool ap_cfg_running;
224 extern bool ap_fw_loaded;
225 #endif
226 
227 #if defined(OEM_ANDROID) && defined(BCMPCIE)
228 extern int dhd_get_suspend_bcn_li_dtim(dhd_pub_t *dhd, int *dtim_period, int *bcn_interval);
229 #else
230 extern int dhd_get_suspend_bcn_li_dtim(dhd_pub_t *dhd);
231 #endif /* OEM_ANDROID && BCMPCIE */
232 
233 #ifdef CUSTOMER_HW4
234 #ifdef MIMO_ANT_SETTING
235 #ifdef DHD_EXPORT_CNTL_FILE
236 extern unsigned long antsel;
237 #endif /* DHD_EXPORT_CNTL_FILE */
238 extern int dhd_sel_ant_from_file(dhd_pub_t *dhd);
239 #endif /* MIMO_ANT_SETTING */
240 #ifdef WRITE_WLANINFO
241 #define MAX_VERSION_LEN		512
242 #ifdef DHD_EXPORT_CNTL_FILE
243 extern char version_info[MAX_VERSION_LEN];
244 #endif /* DHD_EXPORT_CNTL_FILE */
245 extern uint32 sec_save_wlinfo(char *firm_ver, char *dhd_ver, char *nvram_p, char *clm_ver);
246 #endif /* WRITE_WLANINFO */
247 #ifdef LOGTRACE_FROM_FILE
248 extern int dhd_logtrace_from_file(dhd_pub_t *dhd);
249 #ifdef DHD_EXPORT_CNTL_FILE
250 extern unsigned long logtrace_val;
251 #endif /* DHD_EXPORT_CNTL_FILE */
252 #endif /* LOGTRACE_FROM_FILE */
253 #ifdef GEN_SOFTAP_INFO_FILE
254 #define SOFTAP_INFO_BUF_SZ 512
255 #ifdef DHD_EXPORT_CNTL_FILE
256 extern char softapinfostr[SOFTAP_INFO_BUF_SZ];
257 #endif /* DHD_EXPORT_CNTL_FILE */
258 extern uint32 sec_save_softap_info(void);
259 #endif /* GEN_SOFTAP_INFO_FILE */
260 #endif /* CUSTOMER_HW4 */
261 
262 #ifdef DHD_SEND_HANG_PRIVCMD_ERRORS
263 extern uint32 report_hang_privcmd_err;
264 #endif /* DHD_SEND_HANG_PRIVCMD_ERRORS */
265 
266 #if defined(SOFTAP_TPUT_ENHANCE)
267 extern void dhd_bus_setidletime(dhd_pub_t *dhdp, int idle_time);
268 extern void dhd_bus_getidletime(dhd_pub_t *dhdp, int* idle_time);
269 #endif /* SOFTAP_TPUT_ENHANCE */
270 
271 #if defined(BCM_ROUTER_DHD)
272 void traffic_mgmt_pkt_set_prio(dhd_pub_t *dhdp, void * pktbuf);
273 #endif /* BCM_ROUTER_DHD */
274 
275 #ifdef DHD_LOG_DUMP
276 /* 0: DLD_BUF_TYPE_GENERAL, 1: DLD_BUF_TYPE_PRESERVE
277 * 2: DLD_BUF_TYPE_SPECIAL
278 */
279 #define DLD_BUFFER_NUM 3
280 
281 #ifndef CUSTOM_LOG_DUMP_BUFSIZE_MB
282 #define CUSTOM_LOG_DUMP_BUFSIZE_MB	4 /* DHD_LOG_DUMP_BUF_SIZE 4 MB static memory in kernel */
283 #endif /* CUSTOM_LOG_DUMP_BUFSIZE_MB */
284 
285 #define LOG_DUMP_TOTAL_BUFSIZE (1024 * 1024 * CUSTOM_LOG_DUMP_BUFSIZE_MB)
286 
287 /*
288  * Below are different sections that use the prealloced buffer
289  * and sum of the sizes of these should not cross LOG_DUMP_TOTAL_BUFSIZE
290  */
291 #ifdef EWP_BCM_TRACE
292 #define LOG_DUMP_GENERAL_MAX_BUFSIZE (192 * 1024 * CUSTOM_LOG_DUMP_BUFSIZE_MB)
293 #define LOG_DUMP_BCM_TRACE_MAX_BUFSIZE (64 * 1024 * CUSTOM_LOG_DUMP_BUFSIZE_MB)
294 #else
295 #define LOG_DUMP_GENERAL_MAX_BUFSIZE (256 * 1024 * CUSTOM_LOG_DUMP_BUFSIZE_MB)
296 #define LOG_DUMP_BCM_TRACE_MAX_BUFSIZE 0
297 #endif /* EWP_BCM_TRACE */
298 #define LOG_DUMP_PRESERVE_MAX_BUFSIZE (128 * 1024 * CUSTOM_LOG_DUMP_BUFSIZE_MB)
299 #define LOG_DUMP_ECNTRS_MAX_BUFSIZE (256 * 1024 * CUSTOM_LOG_DUMP_BUFSIZE_MB)
300 #define LOG_DUMP_RTT_MAX_BUFSIZE (256 * 1024 * CUSTOM_LOG_DUMP_BUFSIZE_MB)
301 #define LOG_DUMP_FILTER_MAX_BUFSIZE (128 * 1024 * CUSTOM_LOG_DUMP_BUFSIZE_MB)
302 
303 #if LOG_DUMP_TOTAL_BUFSIZE < \
304 	(LOG_DUMP_GENERAL_MAX_BUFSIZE + LOG_DUMP_PRESERVE_MAX_BUFSIZE + \
305 	LOG_DUMP_ECNTRS_MAX_BUFSIZE + LOG_DUMP_RTT_MAX_BUFSIZE + \
306 	LOG_DUMP_BCM_TRACE_MAX_BUFSIZE + LOG_DUMP_FILTER_MAX_BUFSIZE)
307 #error "LOG_DUMP_TOTAL_BUFSIZE is lesser than sum of all rings"
308 #endif
309 
310 /* Special buffer is allocated as separately in prealloc */
311 #define LOG_DUMP_SPECIAL_MAX_BUFSIZE (8 * 1024)
312 
313 #define LOG_DUMP_MAX_FILESIZE (8 *1024 * 1024) /* 8 MB default */
314 
315 #ifdef CONFIG_LOG_BUF_SHIFT
316 /* 15% of kernel log buf size, if for example klog buf size is 512KB
317 * 15% of 512KB ~= 80KB
318 */
319 #define LOG_DUMP_KERNEL_TAIL_FLUSH_SIZE \
320 	(15 * ((1 << CONFIG_LOG_BUF_SHIFT)/100))
321 #endif /* CONFIG_LOG_BUF_SHIFT */
322 
323 #define LOG_DUMP_COOKIE_BUFSIZE	1024u
324 typedef struct {
325 	char *hdr_str;
326 	log_dump_section_type_t sec_type;
327 } dld_hdr_t;
328 
329 #define DHD_PRINT_BUF_NAME_LEN 30
330 void dhd_get_debug_dump_len(void *handle, struct sk_buff *skb, void *event_info, u8 event);
331 void cfgvendor_log_dump_len(dhd_pub_t *dhdp, log_dump_type_t *type, struct sk_buff *skb);
332 #endif /* DHD_LOG_DUMP */
333 
334 typedef struct dhd_if_event {
335 	struct list_head	list;
336 	wl_event_data_if_t	event;
337 	char			name[IFNAMSIZ+1];
338 	uint8			mac[ETHER_ADDR_LEN];
339 } dhd_if_event_t;
340 
341 /* Interface control information */
342 typedef struct dhd_if {
343 	struct dhd_info *info;			/* back pointer to dhd_info */
344 	/* OS/stack specifics */
345 	struct net_device *net;
346 	int				idx;			/* iface idx in dongle */
347 	uint			subunit;		/* subunit */
348 	uint8			mac_addr[ETHER_ADDR_LEN];	/* assigned MAC address */
349 	bool			set_macaddress;
350 	bool			set_multicast;
351 	uint8			bssidx;			/* bsscfg index for the interface */
352 	bool			attached;		/* Delayed attachment when unset */
353 	bool			txflowcontrol;	/* Per interface flow control indicator */
354 	char			name[IFNAMSIZ+1]; /* linux interface name */
355 	char			dngl_name[IFNAMSIZ+1]; /* corresponding dongle interface name */
356 	struct net_device_stats stats;
357 #ifdef DHD_WMF
358 	dhd_wmf_t		wmf;		/* per bsscfg wmf setting */
359 	bool	wmf_psta_disable;		/* enable/disable MC pkt to each mac
360 						 * of MC group behind PSTA
361 						 */
362 #endif /* DHD_WMF */
363 #ifdef PCIE_FULL_DONGLE
364 	struct list_head sta_list;		/* sll of associated stations */
365 	spinlock_t	sta_list_lock;		/* lock for manipulating sll */
366 #endif /* PCIE_FULL_DONGLE */
367 	uint32  ap_isolate;			/* ap-isolation settings */
368 #ifdef DHD_L2_FILTER
369 	bool parp_enable;
370 	bool parp_discard;
371 	bool parp_allnode;
372 	arp_table_t *phnd_arp_table;
373 	/* for Per BSS modification */
374 	bool dhcp_unicast;
375 	bool block_ping;
376 	bool grat_arp;
377 	bool block_tdls;
378 #endif /* DHD_L2_FILTER */
379 #if (defined(BCM_ROUTER_DHD) && defined(QOS_MAP_SET))
380 	uint8	 *qosmap_up_table;		/* user priority table, size is UP_TABLE_MAX */
381 	bool qosmap_up_table_enable;	/* flag set only when app want to set additional UP */
382 #endif /* BCM_ROUTER_DHD && QOS_MAP_SET */
383 #ifdef DHD_MCAST_REGEN
384 	bool mcast_regen_bss_enable;
385 #endif
386 	bool rx_pkt_chainable;		/* set all rx packet to chainable config by default */
387 	cumm_ctr_t cumm_ctr;		/* cummulative queue length of child flowrings */
388 #ifdef BCM_ROUTER_DHD
389 	bool	primsta_dwds;		/* DWDS status of primary sta interface */
390 #endif /* BCM_ROUTER_DHD */
391 	uint8 tx_paths_active;
392 	bool del_in_progress;
393 	bool static_if;			/* used to avoid some operations on static_if */
394 #ifdef DHD_4WAYM4_FAIL_DISCONNECT
395 	struct delayed_work m4state_work;
396 	atomic_t m4state;
397 #endif /* DHD_4WAYM4_FAIL_DISCONNECT */
398 #ifdef DHDTCPSYNC_FLOOD_BLK
399 	uint32 tsync_rcvd;
400 	uint32 tsyncack_txed;
401 	u64 last_sync;
402 	struct work_struct  blk_tsfl_work;
403 	uint32 tsync_per_sec;
404 	bool disconnect_tsync_flood;
405 #endif /* DHDTCPSYNC_FLOOD_BLK */
406 #ifdef DHD_POST_EAPOL_M1_AFTER_ROAM_EVT
407 	bool recv_reassoc_evt;
408 	bool post_roam_evt;
409 #endif /* DHD_POST_EAPOL_M1_AFTER_ROAM_EVT */
410 #ifdef WLDWDS
411 	bool dwds;	/* DWDS interface */
412 #endif /* WLDWDS */
413 #ifdef WLEASYMESH
414 	uint8 _1905_al_ucast[ETHER_ADDR_LEN];
415 	uint8 _1905_al_mcast[ETHER_ADDR_LEN];
416 #endif /* WLEASYMESH */
417 } dhd_if_t;
418 
419 struct ipv6_work_info_t {
420 	uint8			if_idx;
421 	char			ipv6_addr[IPV6_ADDR_LEN];
422 	unsigned long		event;
423 };
424 
425 typedef struct dhd_dump {
426 	uint8 *buf;
427 	int bufsize;
428 	uint8 *hscb_buf;
429 	int hscb_bufsize;
430 } dhd_dump_t;
431 #ifdef DNGL_AXI_ERROR_LOGGING
432 typedef struct dhd_axi_error_dump {
433 	ulong fault_address;
434 	uint32 axid;
435 	struct hnd_ext_trap_axi_error_v1 etd_axi_error_v1;
436 } dhd_axi_error_dump_t;
437 #endif /* DNGL_AXI_ERROR_LOGGING */
438 #ifdef BCM_ROUTER_DHD
439 typedef struct dhd_write_file {
440 	char file_path[64];
441 	uint32 file_flags;
442 	uint8 *buf;
443 	int bufsize;
444 } dhd_write_file_t;
445 #endif
446 
447 #ifdef DHD_PCIE_NATIVE_RUNTIMEPM
448 struct dhd_rx_tx_work {
449 	struct work_struct work;
450 	struct sk_buff *skb;
451 	struct net_device *net;
452 	struct dhd_pub *pub;
453 };
454 #endif /* DHD_PCIE_NATIVE_RUNTIMEPM */
455 
456 #ifdef FILTER_IE
457 #define FILTER_IE_PATH "/vendor/etc/wifi/filter_ie"
458 #define FILTER_IE_BUFSZ 1024 /* ioc buffsize for FILTER_IE */
459 #define FILE_BLOCK_READ_SIZE 256
460 #define WL_FILTER_IE_IOV_HDR_SIZE OFFSETOF(wl_filter_ie_iov_v1_t, tlvs)
461 #endif /* FILTER_IE */
462 
463 #define NULL_CHECK(p, s, err)  \
464 			do { \
465 				if (!(p)) { \
466 					printk("NULL POINTER (%s) : %s\n", __FUNCTION__, (s)); \
467 					err = BCME_ERROR; \
468 					return err; \
469 				} \
470 			} while (0)
471 
472 int dhd_wifi_platform_register_drv(void);
473 void dhd_wifi_platform_unregister_drv(void);
474 wifi_adapter_info_t* dhd_wifi_platform_attach_adapter(uint32 bus_type,
475 	uint32 bus_num, uint32 slot_num, unsigned long status);
476 wifi_adapter_info_t* dhd_wifi_platform_get_adapter(uint32 bus_type, uint32 bus_num,
477 	uint32 slot_num);
478 int wifi_platform_set_power(wifi_adapter_info_t *adapter, bool on, unsigned long msec);
479 int wifi_platform_bus_enumerate(wifi_adapter_info_t *adapter, bool device_present);
480 int wifi_platform_get_irq_number(wifi_adapter_info_t *adapter, unsigned long *irq_flags_ptr);
481 int wifi_platform_get_mac_addr(wifi_adapter_info_t *adapter, unsigned char *buf, int ifidx);
482 #ifdef DHD_COREDUMP
483 int wifi_platform_set_coredump(wifi_adapter_info_t *adapter, const char *buf, int buf_len,
484 	const char *info);
485 #endif /* DHD_COREDUMP */
486 #ifdef CUSTOM_COUNTRY_CODE
487 void *wifi_platform_get_country_code(wifi_adapter_info_t *adapter, char *ccode,
488 	u32 flags);
489 #else
490 void *wifi_platform_get_country_code(wifi_adapter_info_t *adapter, char *ccode);
491 #endif /* CUSTOM_COUNTRY_CODE */
492 void* wifi_platform_prealloc(wifi_adapter_info_t *adapter, int section, unsigned long size);
493 void* wifi_platform_get_prealloc_func_ptr(wifi_adapter_info_t *adapter);
494 
495 int dhd_get_fw_mode(struct dhd_info *dhdinfo);
496 bool dhd_update_fw_nv_path(struct dhd_info *dhdinfo);
497 #ifdef BCM_ROUTER_DHD
498 void dhd_update_dpsta_interface_for_sta(dhd_pub_t* dhdp, int ifidx, void* event_data);
499 #endif /* BCM_ROUTER_DHD */
500 #ifdef DHD_WMF
501 dhd_wmf_t* dhd_wmf_conf(dhd_pub_t *dhdp, uint32 idx);
502 int dhd_get_wmf_psta_disable(dhd_pub_t *dhdp, uint32 idx);
503 int dhd_set_wmf_psta_disable(dhd_pub_t *dhdp, uint32 idx, int val);
504 void dhd_update_psta_interface_for_sta(dhd_pub_t *dhdp, char* ifname,
505 		void* mac_addr, void* event_data);
506 #endif /* DHD_WMF */
507 
508 #if defined (BT_OVER_SDIO)
509 int dhd_net_bus_get(struct net_device *dev);
510 int dhd_net_bus_put(struct net_device *dev);
511 #endif /* BT_OVER_SDIO */
512 #if defined(WLADPS) || defined(WLADPS_PRIVATE_CMD)
513 #define ADPS_ENABLE	1
514 #define ADPS_DISABLE	0
515 
516 int dhd_enable_adps(dhd_pub_t *dhd, uint8 on);
517 #endif /* WLADPS || WLADPS_PRIVATE_CMD */
518 #ifdef DHDTCPSYNC_FLOOD_BLK
519 extern void dhd_reset_tcpsync_info_by_ifp(dhd_if_t *ifp);
520 extern void dhd_reset_tcpsync_info_by_dev(struct net_device *dev);
521 #endif /* DHDTCPSYNC_FLOOD_BLK */
522 #ifdef PCIE_FULL_DONGLE
523 extern void dhd_net_del_flowrings_sta(dhd_pub_t * dhd, struct net_device * ndev);
524 #endif /* PCIE_FULL_DONGLE */
525 int dhd_get_fw_capabilities(dhd_pub_t * dhd);
526 #endif /* __DHD_LINUX_H__ */
527