/drivers/staging/ath6kl/include/wlan_api.h

https://bitbucket.org/wisechild/galaxy-nexus · C++ Header · 128 lines · 85 code · 20 blank · 23 comment · 0 complexity · d4386e80ac52c0299b1b339ffb8378c0 MD5 · raw file

  1. //------------------------------------------------------------------------------
  2. // Copyright (c) 2004-2010 Atheros Corporation. All rights reserved.
  3. //
  4. //
  5. // Permission to use, copy, modify, and/or distribute this software for any
  6. // purpose with or without fee is hereby granted, provided that the above
  7. // copyright notice and this permission notice appear in all copies.
  8. //
  9. // THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
  10. // WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
  11. // MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
  12. // ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
  13. // WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
  14. // ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
  15. // OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  16. //
  17. //
  18. //------------------------------------------------------------------------------
  19. //==============================================================================
  20. // This file contains the API for the host wlan module
  21. //
  22. // Author(s): ="Atheros"
  23. //==============================================================================
  24. #ifndef _HOST_WLAN_API_H_
  25. #define _HOST_WLAN_API_H_
  26. #ifdef __cplusplus
  27. extern "C" {
  28. #endif
  29. #include <a_osapi.h>
  30. struct ieee80211_node_table;
  31. struct ieee80211_frame;
  32. struct ieee80211_common_ie {
  33. u16 ie_chan;
  34. u8 *ie_tstamp;
  35. u8 *ie_ssid;
  36. u8 *ie_rates;
  37. u8 *ie_xrates;
  38. u8 *ie_country;
  39. u8 *ie_wpa;
  40. u8 *ie_rsn;
  41. u8 *ie_wmm;
  42. u8 *ie_ath;
  43. u16 ie_capInfo;
  44. u16 ie_beaconInt;
  45. u8 *ie_tim;
  46. u8 *ie_chswitch;
  47. u8 ie_erp;
  48. u8 *ie_wsc;
  49. u8 *ie_htcap;
  50. u8 *ie_htop;
  51. #ifdef WAPI_ENABLE
  52. u8 *ie_wapi;
  53. #endif
  54. };
  55. typedef struct bss {
  56. u8 ni_macaddr[6];
  57. u8 ni_snr;
  58. s16 ni_rssi;
  59. struct bss *ni_list_next;
  60. struct bss *ni_list_prev;
  61. struct bss *ni_hash_next;
  62. struct bss *ni_hash_prev;
  63. struct ieee80211_common_ie ni_cie;
  64. u8 *ni_buf;
  65. u16 ni_framelen;
  66. struct ieee80211_node_table *ni_table;
  67. u32 ni_refcnt;
  68. int ni_scangen;
  69. u32 ni_tstamp;
  70. u32 ni_actcnt;
  71. #ifdef OS_ROAM_MANAGEMENT
  72. u32 ni_si_gen;
  73. #endif
  74. } bss_t;
  75. typedef void wlan_node_iter_func(void *arg, bss_t *);
  76. bss_t *wlan_node_alloc(struct ieee80211_node_table *nt, int wh_size);
  77. void wlan_node_free(bss_t *ni);
  78. void wlan_setup_node(struct ieee80211_node_table *nt, bss_t *ni,
  79. const u8 *macaddr);
  80. bss_t *wlan_find_node(struct ieee80211_node_table *nt, const u8 *macaddr);
  81. void wlan_node_reclaim(struct ieee80211_node_table *nt, bss_t *ni);
  82. void wlan_free_allnodes(struct ieee80211_node_table *nt);
  83. void wlan_iterate_nodes(struct ieee80211_node_table *nt, wlan_node_iter_func *f,
  84. void *arg);
  85. void wlan_node_table_init(void *wmip, struct ieee80211_node_table *nt);
  86. void wlan_node_table_reset(struct ieee80211_node_table *nt);
  87. void wlan_node_table_cleanup(struct ieee80211_node_table *nt);
  88. int wlan_parse_beacon(u8 *buf, int framelen,
  89. struct ieee80211_common_ie *cie);
  90. u16 wlan_ieee2freq(int chan);
  91. u32 wlan_freq2ieee(u16 freq);
  92. void wlan_set_nodeage(struct ieee80211_node_table *nt, u32 nodeAge);
  93. void
  94. wlan_refresh_inactive_nodes (struct ieee80211_node_table *nt);
  95. bss_t *
  96. wlan_find_Ssidnode (struct ieee80211_node_table *nt, u8 *pSsid,
  97. u32 ssidLength, bool bIsWPA2, bool bMatchSSID);
  98. void
  99. wlan_node_return (struct ieee80211_node_table *nt, bss_t *ni);
  100. bss_t *wlan_node_remove(struct ieee80211_node_table *nt, u8 *bssid);
  101. bss_t *
  102. wlan_find_matching_Ssidnode (struct ieee80211_node_table *nt, u8 *pSsid,
  103. u32 ssidLength, u32 dot11AuthMode, u32 authMode,
  104. u32 pairwiseCryptoType, u32 grpwiseCryptoTyp);
  105. #ifdef __cplusplus
  106. }
  107. #endif
  108. #endif /* _HOST_WLAN_API_H_ */