Merge branch 'x86-platform-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
[pandora-kernel.git] / drivers / staging / ath6kl / include / wlan_api.h
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
27
28 #ifdef __cplusplus
29 extern "C" {
30 #endif
31
32 #include <a_osapi.h>
33
34 struct ieee80211_node_table;
35 struct ieee80211_frame;
36
37 struct ieee80211_common_ie {
38     A_UINT16    ie_chan;
39     A_UINT8     *ie_tstamp;
40     A_UINT8     *ie_ssid;
41     A_UINT8     *ie_rates;
42     A_UINT8     *ie_xrates;
43     A_UINT8     *ie_country;
44     A_UINT8     *ie_wpa;
45     A_UINT8     *ie_rsn;
46     A_UINT8     *ie_wmm;
47     A_UINT8     *ie_ath;
48     A_UINT16    ie_capInfo;
49     A_UINT16    ie_beaconInt;
50     A_UINT8     *ie_tim;
51     A_UINT8     *ie_chswitch;
52     A_UINT8     ie_erp;
53     A_UINT8     *ie_wsc;
54     A_UINT8     *ie_htcap;
55     A_UINT8     *ie_htop;
56 #ifdef WAPI_ENABLE
57     A_UINT8     *ie_wapi;
58 #endif
59 };
60
61 typedef struct bss {
62     A_UINT8                      ni_macaddr[6];
63     A_UINT8                      ni_snr;
64     A_INT16                      ni_rssi;
65     struct bss                   *ni_list_next;
66     struct bss                   *ni_list_prev;
67     struct bss                   *ni_hash_next;
68     struct bss                   *ni_hash_prev;
69     struct ieee80211_common_ie   ni_cie;
70     A_UINT8                     *ni_buf;
71     A_UINT16                     ni_framelen;
72     struct ieee80211_node_table *ni_table;
73     A_UINT32                     ni_refcnt;
74     int                          ni_scangen;
75
76     A_UINT32                     ni_tstamp;
77     A_UINT32                     ni_actcnt;
78 #ifdef OS_ROAM_MANAGEMENT
79     A_UINT32                     ni_si_gen;
80 #endif
81 } bss_t;
82
83 typedef void wlan_node_iter_func(void *arg, bss_t *);
84
85 bss_t *wlan_node_alloc(struct ieee80211_node_table *nt, int wh_size);
86 void wlan_node_free(bss_t *ni);
87 void wlan_setup_node(struct ieee80211_node_table *nt, bss_t *ni,
88                 const A_UINT8 *macaddr);
89 bss_t *wlan_find_node(struct ieee80211_node_table *nt, const A_UINT8 *macaddr);
90 void wlan_node_reclaim(struct ieee80211_node_table *nt, bss_t *ni);
91 void wlan_free_allnodes(struct ieee80211_node_table *nt);
92 void wlan_iterate_nodes(struct ieee80211_node_table *nt, wlan_node_iter_func *f,
93                         void *arg);
94
95 void wlan_node_table_init(void *wmip, struct ieee80211_node_table *nt);
96 void wlan_node_table_reset(struct ieee80211_node_table *nt);
97 void wlan_node_table_cleanup(struct ieee80211_node_table *nt);
98
99 A_STATUS wlan_parse_beacon(A_UINT8 *buf, int framelen,
100                            struct ieee80211_common_ie *cie);
101
102 A_UINT16 wlan_ieee2freq(int chan);
103 A_UINT32 wlan_freq2ieee(A_UINT16 freq);
104
105 void wlan_set_nodeage(struct ieee80211_node_table *nt, A_UINT32 nodeAge);
106
107 void
108 wlan_refresh_inactive_nodes (struct ieee80211_node_table *nt);
109
110 bss_t *
111 wlan_find_Ssidnode (struct ieee80211_node_table *nt, A_UCHAR *pSsid,
112                     A_UINT32 ssidLength, A_BOOL bIsWPA2, A_BOOL bMatchSSID);
113
114 void
115 wlan_node_return (struct ieee80211_node_table *nt, bss_t *ni);
116
117 bss_t *wlan_node_remove(struct ieee80211_node_table *nt, A_UINT8 *bssid);
118
119 bss_t *
120 wlan_find_matching_Ssidnode (struct ieee80211_node_table *nt, A_UCHAR *pSsid,
121                     A_UINT32 ssidLength, A_UINT32 dot11AuthMode, A_UINT32 authMode,
122                    A_UINT32 pairwiseCryptoType, A_UINT32 grpwiseCryptoTyp);
123
124 #ifdef __cplusplus
125 }
126 #endif
127
128 #endif /* _HOST_WLAN_API_H_ */