/drivers/staging/ath6kl/include/wlan_api.h
C++ Header | 128 lines | 85 code | 20 blank | 23 comment | 0 complexity | d4386e80ac52c0299b1b339ffb8378c0 MD5 | raw file
Possible License(s): GPL-2.0, LGPL-2.0, AGPL-1.0
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
29extern "C" {
30#endif
31
32#include <a_osapi.h>
33
34struct ieee80211_node_table;
35struct ieee80211_frame;
36
37struct ieee80211_common_ie {
38 u16 ie_chan;
39 u8 *ie_tstamp;
40 u8 *ie_ssid;
41 u8 *ie_rates;
42 u8 *ie_xrates;
43 u8 *ie_country;
44 u8 *ie_wpa;
45 u8 *ie_rsn;
46 u8 *ie_wmm;
47 u8 *ie_ath;
48 u16 ie_capInfo;
49 u16 ie_beaconInt;
50 u8 *ie_tim;
51 u8 *ie_chswitch;
52 u8 ie_erp;
53 u8 *ie_wsc;
54 u8 *ie_htcap;
55 u8 *ie_htop;
56#ifdef WAPI_ENABLE
57 u8 *ie_wapi;
58#endif
59};
60
61typedef struct bss {
62 u8 ni_macaddr[6];
63 u8 ni_snr;
64 s16 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 u8 *ni_buf;
71 u16 ni_framelen;
72 struct ieee80211_node_table *ni_table;
73 u32 ni_refcnt;
74 int ni_scangen;
75
76 u32 ni_tstamp;
77 u32 ni_actcnt;
78#ifdef OS_ROAM_MANAGEMENT
79 u32 ni_si_gen;
80#endif
81} bss_t;
82
83typedef void wlan_node_iter_func(void *arg, bss_t *);
84
85bss_t *wlan_node_alloc(struct ieee80211_node_table *nt, int wh_size);
86void wlan_node_free(bss_t *ni);
87void wlan_setup_node(struct ieee80211_node_table *nt, bss_t *ni,
88 const u8 *macaddr);
89bss_t *wlan_find_node(struct ieee80211_node_table *nt, const u8 *macaddr);
90void wlan_node_reclaim(struct ieee80211_node_table *nt, bss_t *ni);
91void wlan_free_allnodes(struct ieee80211_node_table *nt);
92void wlan_iterate_nodes(struct ieee80211_node_table *nt, wlan_node_iter_func *f,
93 void *arg);
94
95void wlan_node_table_init(void *wmip, struct ieee80211_node_table *nt);
96void wlan_node_table_reset(struct ieee80211_node_table *nt);
97void wlan_node_table_cleanup(struct ieee80211_node_table *nt);
98
99int wlan_parse_beacon(u8 *buf, int framelen,
100 struct ieee80211_common_ie *cie);
101
102u16 wlan_ieee2freq(int chan);
103u32 wlan_freq2ieee(u16 freq);
104
105void wlan_set_nodeage(struct ieee80211_node_table *nt, u32 nodeAge);
106
107void
108wlan_refresh_inactive_nodes (struct ieee80211_node_table *nt);
109
110bss_t *
111wlan_find_Ssidnode (struct ieee80211_node_table *nt, u8 *pSsid,
112 u32 ssidLength, bool bIsWPA2, bool bMatchSSID);
113
114void
115wlan_node_return (struct ieee80211_node_table *nt, bss_t *ni);
116
117bss_t *wlan_node_remove(struct ieee80211_node_table *nt, u8 *bssid);
118
119bss_t *
120wlan_find_matching_Ssidnode (struct ieee80211_node_table *nt, u8 *pSsid,
121 u32 ssidLength, u32 dot11AuthMode, u32 authMode,
122 u32 pairwiseCryptoType, u32 grpwiseCryptoTyp);
123
124#ifdef __cplusplus
125}
126#endif
127
128#endif /* _HOST_WLAN_API_H_ */