2 * Common function shared by Linux WEXT, cfg80211 and p2p drivers
4 * $Copyright Open Broadcom Corporation$
6 * $Id: wldev_common.h 504503 2014-09-24 11:28:56Z $
8 #ifndef __WLDEV_COMMON_H__
9 #define __WLDEV_COMMON_H__
13 /* wl_dev_ioctl - get/set IOCTLs, will call net_device's do_ioctl (or
14 * netdev_ops->ndo_do_ioctl in new kernels)
15 * @dev: the net_device handle
18 struct net_device *dev, u32 cmd, void *arg, u32 len, u32 set);
20 /** Retrieve named IOVARs, this function calls wl_dev_ioctl with
21 * WLC_GET_VAR IOCTL code
23 s32 wldev_iovar_getbuf(
24 struct net_device *dev, s8 *iovar_name,
25 void *param, s32 paramlen, void *buf, s32 buflen, struct mutex* buf_sync);
27 /** Set named IOVARs, this function calls wl_dev_ioctl with
28 * WLC_SET_VAR IOCTL code
30 s32 wldev_iovar_setbuf(
31 struct net_device *dev, s8 *iovar_name,
32 void *param, s32 paramlen, void *buf, s32 buflen, struct mutex* buf_sync);
34 s32 wldev_iovar_setint(
35 struct net_device *dev, s8 *iovar, s32 val);
37 s32 wldev_iovar_getint(
38 struct net_device *dev, s8 *iovar, s32 *pval);
40 /** The following function can be implemented if there is a need for bsscfg
44 s32 wldev_mkiovar_bsscfg(
45 const s8 *iovar_name, s8 *param, s32 paramlen,
46 s8 *iovar_buf, s32 buflen, s32 bssidx);
48 /** Retrieve named and bsscfg indexed IOVARs, this function calls wl_dev_ioctl with
49 * WLC_GET_VAR IOCTL code
51 s32 wldev_iovar_getbuf_bsscfg(
52 struct net_device *dev, s8 *iovar_name, void *param, s32 paramlen,
53 void *buf, s32 buflen, s32 bsscfg_idx, struct mutex* buf_sync);
55 /** Set named and bsscfg indexed IOVARs, this function calls wl_dev_ioctl with
56 * WLC_SET_VAR IOCTL code
58 s32 wldev_iovar_setbuf_bsscfg(
59 struct net_device *dev, s8 *iovar_name, void *param, s32 paramlen,
60 void *buf, s32 buflen, s32 bsscfg_idx, struct mutex* buf_sync);
62 s32 wldev_iovar_getint_bsscfg(
63 struct net_device *dev, s8 *iovar, s32 *pval, s32 bssidx);
65 s32 wldev_iovar_setint_bsscfg(
66 struct net_device *dev, s8 *iovar, s32 val, s32 bssidx);
68 extern int dhd_net_set_fw_path(struct net_device *dev, char *fw);
69 extern int dhd_net_bus_suspend(struct net_device *dev);
70 extern int dhd_net_bus_resume(struct net_device *dev, uint8 stage);
71 extern int dhd_net_wifi_platform_set_power(struct net_device *dev, bool on,
72 unsigned long delay_msec);
73 extern void dhd_get_customized_country_code(struct net_device *dev, char *country_iso_code,
75 extern void dhd_bus_country_set(struct net_device *dev, wl_country_t *cspec, bool notify);
76 extern void dhd_bus_band_set(struct net_device *dev, uint band);
77 extern int wldev_set_country(struct net_device *dev, char *country_code, bool notify,
79 extern int net_os_wake_lock(struct net_device *dev);
80 extern int net_os_wake_unlock(struct net_device *dev);
81 extern int net_os_wake_lock_timeout(struct net_device *dev);
82 extern int net_os_wake_lock_timeout_enable(struct net_device *dev, int val);
83 extern int net_os_set_dtim_skip(struct net_device *dev, int val);
84 extern int net_os_set_suspend_disable(struct net_device *dev, int val);
85 extern int net_os_set_suspend(struct net_device *dev, int val, int force);
86 extern int wl_iw_parse_ssid_list_tlv(char** list_str, wlc_ssid_t* ssid,
87 int max, int *bytes_left);
89 /* Get the link speed from dongle, speed is in kpbs */
90 int wldev_get_link_speed(struct net_device *dev, int *plink_speed);
92 int wldev_get_rssi(struct net_device *dev, int *prssi);
94 int wldev_get_ssid(struct net_device *dev, wlc_ssid_t *pssid);
96 int wldev_get_band(struct net_device *dev, uint *pband);
98 int wldev_set_band(struct net_device *dev, uint band);
100 #if defined(CUSTOM_PLATFORM_NV_TEGRA)
101 int wldev_miracast_tuning(struct net_device *dev, char *command, int total_len);
102 int wldev_get_assoc_resp_ie(struct net_device *dev, char *command, int total_len);
103 int wldev_get_rx_rate_stats(struct net_device *dev, char *command, int total_len);
104 #endif /* defined(CUSTOM_PLATFORM_NV_TEGRA) */
106 #endif /* __WLDEV_COMMON_H__ */