/drivers/staging/brcm80211/brcmfmac/wl_iw.h

https://bitbucket.org/wisechild/galaxy-nexus · C++ Header · 142 lines · 108 code · 19 blank · 15 comment · 1 complexity · 554ee52bb597de5c5ae0d4ccc0d8dbe2 MD5 · raw file

  1. /*
  2. * Copyright (c) 2010 Broadcom Corporation
  3. *
  4. * Permission to use, copy, modify, and/or distribute this software for any
  5. * purpose with or without fee is hereby granted, provided that the above
  6. * copyright notice and this permission notice appear in all copies.
  7. *
  8. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
  9. * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
  10. * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
  11. * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
  12. * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
  13. * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
  14. * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  15. */
  16. #ifndef _wl_iw_h_
  17. #define _wl_iw_h_
  18. #include <linux/wireless.h>
  19. #include <wlioctl.h>
  20. #define WL_SCAN_PARAMS_SSID_MAX 10
  21. #define GET_SSID "SSID="
  22. #define GET_CHANNEL "CH="
  23. #define GET_NPROBE "NPROBE="
  24. #define GET_ACTIVE_ASSOC_DWELL "ACTIVE="
  25. #define GET_PASSIVE_ASSOC_DWELL "PASSIVE="
  26. #define GET_HOME_DWELL "HOME="
  27. #define GET_SCAN_TYPE "TYPE="
  28. #define BAND_GET_CMD "BANDGET"
  29. #define BAND_SET_CMD "BANDSET"
  30. #define DTIM_SKIP_GET_CMD "DTIMSKIPGET"
  31. #define DTIM_SKIP_SET_CMD "DTIMSKIPSET"
  32. #define SETSUSPEND_CMD "SETSUSPENDOPT"
  33. #define PNOSSIDCLR_SET_CMD "PNOSSIDCLR"
  34. #define PNOSETUP_SET_CMD "PNOSETUP"
  35. #define PNOENABLE_SET_CMD "PNOFORCE"
  36. #define PNODEBUG_SET_CMD "PNODEBUG"
  37. typedef struct wl_iw_extra_params {
  38. int target_channel;
  39. } wl_iw_extra_params_t;
  40. #define WL_IW_RSSI_MINVAL -200
  41. #define WL_IW_RSSI_NO_SIGNAL -91
  42. #define WL_IW_RSSI_VERY_LOW -80
  43. #define WL_IW_RSSI_LOW -70
  44. #define WL_IW_RSSI_GOOD -68
  45. #define WL_IW_RSSI_VERY_GOOD -58
  46. #define WL_IW_RSSI_EXCELLENT -57
  47. #define WL_IW_RSSI_INVALID 0
  48. #define MAX_WX_STRING 80
  49. #define WL_IW_SET_ACTIVE_SCAN (SIOCIWFIRSTPRIV+1)
  50. #define WL_IW_GET_RSSI (SIOCIWFIRSTPRIV+3)
  51. #define WL_IW_SET_PASSIVE_SCAN (SIOCIWFIRSTPRIV+5)
  52. #define WL_IW_GET_LINK_SPEED (SIOCIWFIRSTPRIV+7)
  53. #define WL_IW_GET_CURR_MACADDR (SIOCIWFIRSTPRIV+9)
  54. #define WL_IW_SET_STOP (SIOCIWFIRSTPRIV+11)
  55. #define WL_IW_SET_START (SIOCIWFIRSTPRIV+13)
  56. #define WL_SET_AP_CFG (SIOCIWFIRSTPRIV+15)
  57. #define WL_AP_STA_LIST (SIOCIWFIRSTPRIV+17)
  58. #define WL_AP_MAC_FLTR (SIOCIWFIRSTPRIV+19)
  59. #define WL_AP_BSS_START (SIOCIWFIRSTPRIV+21)
  60. #define AP_LPB_CMD (SIOCIWFIRSTPRIV+23)
  61. #define WL_AP_STOP (SIOCIWFIRSTPRIV+25)
  62. #define WL_FW_RELOAD (SIOCIWFIRSTPRIV+27)
  63. #define WL_COMBO_SCAN (SIOCIWFIRSTPRIV+29)
  64. #define WL_AP_SPARE3 (SIOCIWFIRSTPRIV+31)
  65. #define G_SCAN_RESULTS (8*1024)
  66. #define WE_ADD_EVENT_FIX 0x80
  67. #define G_WLAN_SET_ON 0
  68. #define G_WLAN_SET_OFF 1
  69. #define CHECK_EXTRA_FOR_NULL(extra) \
  70. if (!extra) { \
  71. WL_ERROR("%s: error : extra is null pointer\n", __func__); \
  72. return -EINVAL; \
  73. }
  74. typedef struct wl_iw {
  75. char nickname[IW_ESSID_MAX_SIZE];
  76. struct iw_statistics wstats;
  77. int spy_num;
  78. u32 pwsec;
  79. u32 gwsec;
  80. bool privacy_invoked;
  81. u8 spy_addr[IW_MAX_SPY][ETH_ALEN];
  82. struct iw_quality spy_qual[IW_MAX_SPY];
  83. void *wlinfo;
  84. dhd_pub_t *pub;
  85. } wl_iw_t;
  86. #if WIRELESS_EXT > 12
  87. #include <net/iw_handler.h>
  88. extern const struct iw_handler_def wl_iw_handler_def;
  89. #endif
  90. extern int wl_iw_ioctl(struct net_device *dev, struct ifreq *rq, int cmd);
  91. extern void wl_iw_event(struct net_device *dev, wl_event_msg_t *e, void *data);
  92. extern int wl_iw_get_wireless_stats(struct net_device *dev,
  93. struct iw_statistics *wstats);
  94. int wl_iw_attach(struct net_device *dev, void *dhdp);
  95. void wl_iw_detach(void);
  96. extern int net_os_set_suspend_disable(struct net_device *dev, int val);
  97. extern int net_os_set_suspend(struct net_device *dev, int val);
  98. extern int net_os_set_dtim_skip(struct net_device *dev, int val);
  99. extern int net_os_set_packet_filter(struct net_device *dev, int val);
  100. #define IWE_STREAM_ADD_EVENT(info, stream, ends, iwe, extra) \
  101. iwe_stream_add_event(info, stream, ends, iwe, extra)
  102. #define IWE_STREAM_ADD_VALUE(info, event, value, ends, iwe, event_len) \
  103. iwe_stream_add_value(info, event, value, ends, iwe, event_len)
  104. #define IWE_STREAM_ADD_POINT(info, stream, ends, iwe, extra) \
  105. iwe_stream_add_point(info, stream, ends, iwe, extra)
  106. extern int dhd_pno_enable(dhd_pub_t *dhd, int pfn_enabled);
  107. extern int dhd_pno_clean(dhd_pub_t *dhd);
  108. extern int dhd_pno_set(dhd_pub_t *dhd, wlc_ssid_t *ssids_local, int nssid,
  109. unsigned char scan_fr);
  110. extern int dhd_pno_get_status(dhd_pub_t *dhd);
  111. extern int dhd_dev_pno_reset(struct net_device *dev);
  112. extern int dhd_dev_pno_set(struct net_device *dev, wlc_ssid_t *ssids_local,
  113. int nssid, unsigned char scan_fr);
  114. extern int dhd_dev_pno_enable(struct net_device *dev, int pfn_enabled);
  115. extern int dhd_dev_get_pno_status(struct net_device *dev);
  116. #define PNO_TLV_PREFIX 'S'
  117. #define PNO_TLV_VERSION 1
  118. #define PNO_TLV_SUBVERSION 0
  119. #define PNO_TLV_RESERVED 0
  120. #define PNO_TLV_TYPE_SSID_IE 'S'
  121. #define PNO_TLV_TYPE_TIME 'T'
  122. #define PNO_EVENT_UP "PNO_EVENT"
  123. #endif /* _wl_iw_h_ */