2 * Common function shared by Linux WEXT, cfg80211 and p2p drivers
4 * $Copyright Open Broadcom Corporation$
6 * $Id: wldev_common.h,v 1.1.4.1.2.14 2011-02-09 01:40:07 $
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 void get_customized_country_code(char *country_iso_code, wl_country_t *cspec);
69 extern void dhd_bus_country_set(struct net_device *dev, wl_country_t *cspec, bool notify);
70 extern void dhd_bus_band_set(struct net_device *dev, uint band);
71 extern int wldev_set_country(struct net_device *dev, char *country_code, bool notify,
73 extern int net_os_wake_lock(struct net_device *dev);
74 extern int net_os_wake_unlock(struct net_device *dev);
75 extern int net_os_wake_lock_timeout(struct net_device *dev);
76 extern int net_os_wake_lock_timeout_enable(struct net_device *dev, int val);
77 extern int net_os_set_dtim_skip(struct net_device *dev, int val);
78 extern int net_os_set_suspend_disable(struct net_device *dev, int val);
79 extern int net_os_set_suspend(struct net_device *dev, int val, int force);
80 extern int wl_iw_parse_ssid_list_tlv(char** list_str, wlc_ssid_t* ssid,
81 int max, int *bytes_left);
83 /* Get the link speed from dongle, speed is in kpbs */
84 int wldev_get_link_speed(struct net_device *dev, int *plink_speed);
86 int wldev_get_rssi(struct net_device *dev, int *prssi);
88 int wldev_get_ssid(struct net_device *dev, wlc_ssid_t *pssid);
90 int wldev_get_band(struct net_device *dev, uint *pband);
92 int wldev_set_band(struct net_device *dev, uint band);
94 #endif /* __WLDEV_COMMON_H__ */