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