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