wlan_api.h 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. //------------------------------------------------------------------------------
  2. // <copyright file="wlan_api.h" company="Atheros">
  3. // Copyright (c) 2004-2008 Atheros Corporation. All rights reserved.
  4. //
  5. // This program is free software; you can redistribute it and/or modify
  6. // it under the terms of the GNU General Public License version 2 as
  7. // published by the Free Software Foundation;
  8. //
  9. // Software distributed under the License is distributed on an "AS
  10. // IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
  11. // implied. See the License for the specific language governing
  12. // rights and limitations under the License.
  13. //
  14. //
  15. //------------------------------------------------------------------------------
  16. //==============================================================================
  17. // This file contains the API for the host wlan module
  18. //
  19. // Author(s): ="Atheros"
  20. //==============================================================================
  21. #ifndef _HOST_WLAN_API_H_
  22. #define _HOST_WLAN_API_H_
  23. #ifdef __cplusplus
  24. extern "C" {
  25. #endif
  26. struct ieee80211_node_table;
  27. struct ieee80211_frame;
  28. struct ieee80211_common_ie {
  29. A_UINT16 ie_chan;
  30. A_UINT8 *ie_tstamp;
  31. A_UINT8 *ie_ssid;
  32. A_UINT8 *ie_rates;
  33. A_UINT8 *ie_xrates;
  34. A_UINT8 *ie_country;
  35. A_UINT8 *ie_wpa;
  36. A_UINT8 *ie_rsn;
  37. A_UINT8 *ie_wmm;
  38. A_UINT8 *ie_ath;
  39. A_UINT16 ie_capInfo;
  40. A_UINT16 ie_beaconInt;
  41. A_UINT8 *ie_tim;
  42. A_UINT8 *ie_chswitch;
  43. A_UINT8 ie_erp;
  44. A_UINT8 *ie_wsc;
  45. #ifdef PYXIS_ADHOC
  46. A_UINT8 *ie_pyxis;
  47. #endif
  48. #ifdef WAPI_ENABLE
  49. A_UINT8 *ie_wapi;
  50. #endif /* WAPI_ENABLE */
  51. };
  52. typedef struct bss {
  53. A_UINT8 ni_macaddr[6];
  54. A_UINT8 ni_snr;
  55. A_INT16 ni_rssi;
  56. struct bss *ni_list_next;
  57. struct bss *ni_list_prev;
  58. struct bss *ni_hash_next;
  59. struct bss *ni_hash_prev;
  60. struct ieee80211_common_ie ni_cie;
  61. A_UINT8 *ni_buf;
  62. struct ieee80211_node_table *ni_table;
  63. A_UINT32 ni_refcnt;
  64. int ni_scangen;
  65. A_UINT32 ni_tstamp;
  66. #ifdef OS_ROAM_MANAGEMENT
  67. A_UINT32 ni_si_gen;
  68. #endif
  69. } bss_t;
  70. typedef void wlan_node_iter_func(void *arg, bss_t *);
  71. bss_t *wlan_node_alloc(struct ieee80211_node_table *nt, int wh_size);
  72. void wlan_node_free(bss_t *ni);
  73. void wlan_setup_node(struct ieee80211_node_table *nt, bss_t *ni,
  74. const A_UINT8 *macaddr);
  75. bss_t *wlan_find_node(struct ieee80211_node_table *nt, const A_UINT8 *macaddr);
  76. void wlan_node_reclaim(struct ieee80211_node_table *nt, bss_t *ni);
  77. void wlan_free_allnodes(struct ieee80211_node_table *nt);
  78. void wlan_iterate_nodes(struct ieee80211_node_table *nt, wlan_node_iter_func *f,
  79. void *arg);
  80. void wlan_node_table_init(void *wmip, struct ieee80211_node_table *nt);
  81. void wlan_node_table_reset(struct ieee80211_node_table *nt);
  82. void wlan_node_table_cleanup(struct ieee80211_node_table *nt);
  83. A_STATUS wlan_parse_beacon(A_UINT8 *buf, int framelen,
  84. struct ieee80211_common_ie *cie);
  85. A_UINT16 wlan_ieee2freq(int chan);
  86. A_UINT32 wlan_freq2ieee(A_UINT16 freq);
  87. void wlan_set_nodeage(struct ieee80211_node_table *nt, A_UINT32 nodeAge);
  88. bss_t *
  89. wlan_find_Ssidnode (struct ieee80211_node_table *nt, A_UCHAR *pSsid,
  90. A_UINT32 ssidLength, A_BOOL bIsWPA2, A_BOOL bMatchSSID);
  91. bss_t *
  92. wlan_find_matching_Ssidnode (struct ieee80211_node_table *nt, A_UCHAR *pSsid,
  93. A_UINT32 ssidLength, A_UINT32 dot11AuthMode, A_UINT32 authMode,
  94. A_UINT32 pairwiseCryptoType, A_UINT32 grpwiseCryptoTyp);
  95. void
  96. wlan_node_return (struct ieee80211_node_table *nt, bss_t *ni);
  97. bss_t *wlan_node_remove(struct ieee80211_node_table *nt, A_UINT8 *bssid);
  98. #ifdef __cplusplus
  99. }
  100. #endif
  101. #endif /* _HOST_WLAN_API_H_ */