PageRenderTime 56ms CodeModel.GetById 25ms RepoModel.GetById 0ms app.codeStats 0ms

/drivers/net/wireless/bcm4319/wl_iw.h

https://bitbucket.org/androidarmv6/zte-kernel-msm7x27
C Header | 279 lines | 209 code | 43 blank | 27 comment | 1 complexity | ba097c4b47c2d2c7fd76c8f7ae23a9f8 MD5 | raw file
  1. /*
  2. * Linux Wireless Extensions support
  3. *
  4. * Copyright (C) 1999-2010, 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: wl_iw.h,v 1.5.34.1.6.36.4.1 2010/09/10 19:24:30 Exp $
  25. */
  26. #ifndef _wl_iw_h_
  27. #define _wl_iw_h_
  28. #include <linux/wireless.h>
  29. #include <typedefs.h>
  30. #include <proto/ethernet.h>
  31. #include <wlioctl.h>
  32. #define WL_SCAN_PARAMS_SSID_MAX 10
  33. #define GET_SSID "SSID="
  34. #define GET_CHANNEL "CH="
  35. #define GET_NPROBE "NPROBE="
  36. #define GET_ACTIVE_ASSOC_DWELL "ACTIVE="
  37. #define GET_PASSIVE_ASSOC_DWELL "PASSIVE="
  38. #define GET_HOME_DWELL "HOME="
  39. #define GET_SCAN_TYPE "TYPE="
  40. #define BAND_GET_CMD "BANDGET"
  41. #define BAND_SET_CMD "BANDSET"
  42. #define DTIM_SKIP_GET_CMD "DTIMSKIPGET"
  43. #define DTIM_SKIP_SET_CMD "DTIMSKIPSET"
  44. #define SETSUSPEND_CMD "SETSUSPENDOPT"
  45. #define PNOSSIDCLR_SET_CMD "PNOSSIDCLR"
  46. #define PNOSETUP_SET_CMD "PNOSETUP "
  47. #define PNOENABLE_SET_CMD "PNOFORCE"
  48. #define PNODEBUG_SET_CMD "PNODEBUG"
  49. #define MAC2STR(a) (a)[0], (a)[1], (a)[2], (a)[3], (a)[4], (a)[5]
  50. #define MACSTR "%02x:%02x:%02x:%02x:%02x:%02x"
  51. typedef struct wl_iw_extra_params {
  52. int target_channel;
  53. } wl_iw_extra_params_t;
  54. #define SOFTAP 1
  55. #define WL_IW_RSSI_MINVAL -200
  56. #define WL_IW_RSSI_NO_SIGNAL -91
  57. #define WL_IW_RSSI_VERY_LOW -80
  58. #define WL_IW_RSSI_LOW -70
  59. #define WL_IW_RSSI_GOOD -68
  60. #define WL_IW_RSSI_VERY_GOOD -58
  61. #define WL_IW_RSSI_EXCELLENT -57
  62. #define WL_IW_RSSI_INVALID 0
  63. #define MAX_WX_STRING 80
  64. #define isprint(c) bcm_isprint(c)
  65. #define WL_IW_SET_ACTIVE_SCAN (SIOCIWFIRSTPRIV+1)
  66. #define WL_IW_GET_RSSI (SIOCIWFIRSTPRIV+3)
  67. #define WL_IW_SET_PASSIVE_SCAN (SIOCIWFIRSTPRIV+5)
  68. #define WL_IW_GET_LINK_SPEED (SIOCIWFIRSTPRIV+7)
  69. #define WL_IW_GET_CURR_MACADDR (SIOCIWFIRSTPRIV+9)
  70. #define WL_IW_SET_STOP (SIOCIWFIRSTPRIV+11)
  71. #define WL_IW_SET_START (SIOCIWFIRSTPRIV+13)
  72. #define WL_SET_AP_CFG (SIOCIWFIRSTPRIV+15)
  73. #define WL_AP_STA_LIST (SIOCIWFIRSTPRIV+17)
  74. #define WL_AP_MAC_FLTR (SIOCIWFIRSTPRIV+19)
  75. #define WL_AP_BSS_START (SIOCIWFIRSTPRIV+21)
  76. #define AP_LPB_CMD (SIOCIWFIRSTPRIV+23)
  77. #define WL_AP_STOP (SIOCIWFIRSTPRIV+25)
  78. #define WL_FW_RELOAD (SIOCIWFIRSTPRIV+27)
  79. #define WL_COMBO_SCAN (SIOCIWFIRSTPRIV+29)
  80. #define WL_AP_SPARE3 (SIOCIWFIRSTPRIV+31)
  81. #define G_SCAN_RESULTS 8*1024
  82. #define WE_ADD_EVENT_FIX 0x80
  83. #define G_WLAN_SET_ON 0
  84. #define G_WLAN_SET_OFF 1
  85. #define CHECK_EXTRA_FOR_NULL(extra) \
  86. if (!extra) { \
  87. WL_ERROR(("%s: error : extra is null pointer\n", __FUNCTION__)); \
  88. return -EINVAL; \
  89. }
  90. typedef struct wl_iw {
  91. char nickname[IW_ESSID_MAX_SIZE];
  92. struct iw_statistics wstats;
  93. int spy_num;
  94. uint32 pwsec;
  95. uint32 gwsec;
  96. bool privacy_invoked;
  97. struct ether_addr spy_addr[IW_MAX_SPY];
  98. struct iw_quality spy_qual[IW_MAX_SPY];
  99. void *wlinfo;
  100. dhd_pub_t * pub;
  101. } wl_iw_t;
  102. int wl_control_wl_start(struct net_device *dev);
  103. #define WLC_IW_SS_CACHE_MAXLEN 512
  104. #define WLC_IW_SS_CACHE_CTRL_FIELD_MAXLEN 32
  105. #define WLC_IW_BSS_INFO_MAXLEN \
  106. (WLC_IW_SS_CACHE_MAXLEN - WLC_IW_SS_CACHE_CTRL_FIELD_MAXLEN)
  107. typedef struct wl_iw_ss_cache{
  108. uint32 buflen;
  109. uint32 version;
  110. uint32 count;
  111. wl_bss_info_t bss_info[1];
  112. char dummy[WLC_IW_BSS_INFO_MAXLEN - sizeof(wl_bss_info_t)];
  113. int dirty;
  114. struct wl_iw_ss_cache *next;
  115. } wl_iw_ss_cache_t;
  116. typedef struct wl_iw_ss_cache_ctrl {
  117. wl_iw_ss_cache_t *m_cache_head;
  118. int m_link_down;
  119. int m_timer_expired;
  120. char m_active_bssid[ETHER_ADDR_LEN];
  121. uint m_prev_scan_mode;
  122. uint m_cons_br_scan_cnt;
  123. struct timer_list *m_timer;
  124. } wl_iw_ss_cache_ctrl_t;
  125. typedef enum broadcast_first_scan {
  126. BROADCAST_SCAN_FIRST_IDLE = 0,
  127. BROADCAST_SCAN_FIRST_STARTED,
  128. BROADCAST_SCAN_FIRST_RESULT_READY,
  129. BROADCAST_SCAN_FIRST_RESULT_CONSUMED
  130. } broadcast_first_scan_t;
  131. #ifdef SOFTAP
  132. #define SSID_LEN 33
  133. #define SEC_LEN 16
  134. #define KEY_LEN 65
  135. #define PROFILE_OFFSET 32
  136. struct ap_profile {
  137. uint8 ssid[SSID_LEN];
  138. uint8 sec[SEC_LEN];
  139. uint8 key[KEY_LEN];
  140. uint32 channel;
  141. uint32 preamble;
  142. uint32 max_scb;
  143. //pengji 20110701 start
  144. uint32 closednet;
  145. char country_code[WLC_CNTRY_BUF_SZ];
  146. //pengji 20110701 end
  147. };
  148. #define MACLIST_MODE_DISABLED 0
  149. #define MACLIST_MODE_ENABLED 1
  150. #define MACLIST_MODE_ALLOW 2
  151. struct mflist {
  152. uint count;
  153. struct ether_addr ea[16];
  154. };
  155. struct mac_list_set {
  156. uint32 mode;
  157. struct mflist white_list;
  158. struct mflist black_list;
  159. };
  160. #endif
  161. #if WIRELESS_EXT > 12
  162. #include <net/iw_handler.h>
  163. extern const struct iw_handler_def wl_iw_handler_def;
  164. #endif
  165. extern int wl_iw_ioctl(struct net_device *dev, struct ifreq *rq, int cmd);
  166. extern void wl_iw_event(struct net_device *dev, wl_event_msg_t *e, void* data);
  167. extern int wl_iw_get_wireless_stats(struct net_device *dev, struct iw_statistics *wstats);
  168. int wl_iw_attach(struct net_device *dev, void * dhdp);
  169. void wl_iw_detach(void);
  170. extern int net_os_set_suspend_disable(struct net_device *dev, int val);
  171. extern int net_os_set_suspend(struct net_device *dev, int val);
  172. extern int net_os_set_dtim_skip(struct net_device *dev, int val);
  173. extern int net_os_set_packet_filter(struct net_device *dev, int val);
  174. #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27)
  175. #define IWE_STREAM_ADD_EVENT(info, stream, ends, iwe, extra) \
  176. iwe_stream_add_event(info, stream, ends, iwe, extra)
  177. #define IWE_STREAM_ADD_VALUE(info, event, value, ends, iwe, event_len) \
  178. iwe_stream_add_value(info, event, value, ends, iwe, event_len)
  179. #define IWE_STREAM_ADD_POINT(info, stream, ends, iwe, extra) \
  180. iwe_stream_add_point(info, stream, ends, iwe, extra)
  181. #else
  182. #define IWE_STREAM_ADD_EVENT(info, stream, ends, iwe, extra) \
  183. iwe_stream_add_event(stream, ends, iwe, extra)
  184. #define IWE_STREAM_ADD_VALUE(info, event, value, ends, iwe, event_len) \
  185. iwe_stream_add_value(event, value, ends, iwe, event_len)
  186. #define IWE_STREAM_ADD_POINT(info, stream, ends, iwe, extra) \
  187. iwe_stream_add_point(stream, ends, iwe, extra)
  188. #endif
  189. extern int dhd_pno_enable(dhd_pub_t *dhd, int pfn_enabled);
  190. extern int dhd_pno_clean(dhd_pub_t *dhd);
  191. extern int dhd_pno_set(dhd_pub_t *dhd, wlc_ssid_t* ssids_local, int nssid, ushort scan_fr);
  192. extern int dhd_pno_get_status(dhd_pub_t *dhd);
  193. extern int dhd_dev_pno_reset(struct net_device *dev);
  194. extern int dhd_dev_pno_set(struct net_device *dev, wlc_ssid_t* ssids_local, \
  195. int nssid, ushort scan_fr);
  196. extern int dhd_dev_pno_enable(struct net_device *dev, int pfn_enabled);
  197. extern int dhd_dev_get_pno_status(struct net_device *dev);
  198. #define PNO_TLV_PREFIX 'S'
  199. #define PNO_TLV_VERSION 1
  200. #define PNO_TLV_SUBVERSION 1
  201. #define PNO_TLV_RESERVED 0
  202. #define PNO_TLV_TYPE_SSID_IE 'S'
  203. #define PNO_TLV_TYPE_TIME 'T'
  204. #define PNO_EVENT_UP "PNO_EVENT"
  205. typedef struct cmd_tlv {
  206. char prefix;
  207. char version;
  208. char subver;
  209. char reserved;
  210. } cmd_tlv_t;
  211. typedef struct cscan_tlv {
  212. char prefix;
  213. char version;
  214. char subver;
  215. char reserved;
  216. } cscan_tlv_t;
  217. #define CSCAN_COMMAND "CSCAN "
  218. #define CSCAN_TLV_PREFIX 'S'
  219. #define CSCAN_TLV_VERSION 1
  220. #define CSCAN_TLV_SUBVERSION 0
  221. #define CSCAN_TLV_TYPE_SSID_IE 'S'
  222. #define CSCAN_TLV_TYPE_CHANNEL_IE 'C'
  223. #define CSCAN_TLV_TYPE_NPROBE_IE 'N'
  224. #define CSCAN_TLV_TYPE_ACTIVE_IE 'A'
  225. #define CSCAN_TLV_TYPE_PASSIVE_IE 'P'
  226. #define CSCAN_TLV_TYPE_HOME_IE 'H'
  227. #define CSCAN_TLV_TYPE_STYPE_IE 'T'
  228. extern int wl_iw_parse_channel_list_tlv(char** list_str, uint16* channel_list, \
  229. int channel_num, int *bytes_left);
  230. extern int wl_iw_parse_data_tlv(char** list_str, void *dst, int dst_size, \
  231. const char token, int input_size, int *bytes_left);
  232. extern int wl_iw_parse_ssid_list_tlv(char** list_str, wlc_ssid_t* ssid, \
  233. int max, int *bytes_left);
  234. extern int wl_iw_parse_ssid_list(char** list_str, wlc_ssid_t* ssid, int idx, int max);
  235. extern int wl_iw_parse_channel_list(char** list_str, uint16* channel_list, int channel_num);
  236. #endif