wldev_common.h 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. /*
  2. * Common function shared by Linux WEXT, cfg80211 and p2p drivers
  3. *
  4. * Copyright (C) 1999-2015, Broadcom Corporation
  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. * Notwithstanding the above, under no circumstances may you combine this
  21. * software in any way with any other Broadcom software provided under a license
  22. * other than the GPL, without Broadcom's express prior written consent.
  23. *
  24. * $Id: wldev_common.h 434085 2013-11-05 06:09:49Z $
  25. */
  26. #ifndef __WLDEV_COMMON_H__
  27. #define __WLDEV_COMMON_H__
  28. #include <wlioctl.h>
  29. /* wl_dev_ioctl - get/set IOCTLs, will call net_device's do_ioctl (or
  30. * netdev_ops->ndo_do_ioctl in new kernels)
  31. * @dev: the net_device handle
  32. */
  33. s32 wldev_ioctl(
  34. struct net_device *dev, u32 cmd, void *arg, u32 len, u32 set);
  35. /** Retrieve named IOVARs, this function calls wl_dev_ioctl with
  36. * WLC_GET_VAR IOCTL code
  37. */
  38. s32 wldev_iovar_getbuf(
  39. struct net_device *dev, s8 *iovar_name,
  40. void *param, s32 paramlen, void *buf, s32 buflen, struct mutex* buf_sync);
  41. /** Set named IOVARs, this function calls wl_dev_ioctl with
  42. * WLC_SET_VAR IOCTL code
  43. */
  44. s32 wldev_iovar_setbuf(
  45. struct net_device *dev, s8 *iovar_name,
  46. void *param, s32 paramlen, void *buf, s32 buflen, struct mutex* buf_sync);
  47. s32 wldev_iovar_setint(
  48. struct net_device *dev, s8 *iovar, s32 val);
  49. s32 wldev_iovar_getint(
  50. struct net_device *dev, s8 *iovar, s32 *pval);
  51. /** The following function can be implemented if there is a need for bsscfg
  52. * indexed IOVARs
  53. */
  54. s32 wldev_mkiovar_bsscfg(
  55. const s8 *iovar_name, s8 *param, s32 paramlen,
  56. s8 *iovar_buf, s32 buflen, s32 bssidx);
  57. /** Retrieve named and bsscfg indexed IOVARs, this function calls wl_dev_ioctl with
  58. * WLC_GET_VAR IOCTL code
  59. */
  60. s32 wldev_iovar_getbuf_bsscfg(
  61. struct net_device *dev, s8 *iovar_name, void *param, s32 paramlen,
  62. void *buf, s32 buflen, s32 bsscfg_idx, struct mutex* buf_sync);
  63. /** Set named and bsscfg indexed IOVARs, this function calls wl_dev_ioctl with
  64. * WLC_SET_VAR IOCTL code
  65. */
  66. s32 wldev_iovar_setbuf_bsscfg(
  67. struct net_device *dev, s8 *iovar_name, void *param, s32 paramlen,
  68. void *buf, s32 buflen, s32 bsscfg_idx, struct mutex* buf_sync);
  69. s32 wldev_iovar_getint_bsscfg(
  70. struct net_device *dev, s8 *iovar, s32 *pval, s32 bssidx);
  71. s32 wldev_iovar_setint_bsscfg(
  72. struct net_device *dev, s8 *iovar, s32 val, s32 bssidx);
  73. extern int dhd_net_set_fw_path(struct net_device *dev, char *fw);
  74. extern int dhd_net_bus_suspend(struct net_device *dev);
  75. extern int dhd_net_bus_resume(struct net_device *dev, uint8 stage);
  76. extern int dhd_net_wifi_platform_set_power(struct net_device *dev, bool on,
  77. unsigned long delay_msec);
  78. extern void dhd_get_customized_country_code(struct net_device *dev, char *country_iso_code,
  79. wl_country_t *cspec);
  80. extern void dhd_bus_country_set(struct net_device *dev, wl_country_t *cspec, bool notify);
  81. extern void dhd_bus_band_set(struct net_device *dev, uint band);
  82. extern int wldev_set_country(struct net_device *dev, char *country_code, bool notify,
  83. bool user_enforced);
  84. extern int net_os_wake_lock(struct net_device *dev);
  85. extern int net_os_wake_unlock(struct net_device *dev);
  86. extern int net_os_wake_lock_timeout(struct net_device *dev);
  87. extern int net_os_wake_lock_timeout_enable(struct net_device *dev, int val);
  88. extern int net_os_set_dtim_skip(struct net_device *dev, int val);
  89. extern int net_os_set_suspend_disable(struct net_device *dev, int val);
  90. extern int net_os_set_suspend(struct net_device *dev, int val, int force);
  91. extern int wl_iw_parse_ssid_list_tlv(char** list_str, wlc_ssid_t* ssid,
  92. int max, int *bytes_left);
  93. /* Get the link speed from dongle, speed is in kpbs */
  94. int wldev_get_link_speed(struct net_device *dev, int *plink_speed);
  95. int wldev_get_rssi(struct net_device *dev, int *prssi);
  96. int wldev_get_ssid(struct net_device *dev, wlc_ssid_t *pssid);
  97. int wldev_get_band(struct net_device *dev, uint *pband);
  98. int wldev_set_band(struct net_device *dev, uint band);
  99. #endif /* __WLDEV_COMMON_H__ */