OLD | NEW |
(Empty) | |
| 1 //------------------------------------------------------------------------------ |
| 2 // <copyright file="ieee80211_node.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 // Author(s): ="Atheros" |
| 18 //============================================================================== |
| 19 #ifndef _IEEE80211_NODE_H_ |
| 20 #define _IEEE80211_NODE_H_ |
| 21 |
| 22 /* |
| 23 * Node locking definitions. |
| 24 */ |
| 25 #define IEEE80211_NODE_LOCK_INIT(_nt) A_MUTEX_INIT(&(_nt)->nt_nodelock) |
| 26 #define IEEE80211_NODE_LOCK_DESTROY(_nt) if (A_IS_MUTEX_VALID(&(_nt)->nt_nodeloc
k)) { \ |
| 27 A_MUTEX_DELETE(&(_nt)->nt_nodeloc
k); } |
| 28 |
| 29 #define IEEE80211_NODE_LOCK(_nt) A_MUTEX_LOCK(&(_nt)->nt_nodelock) |
| 30 #define IEEE80211_NODE_UNLOCK(_nt) A_MUTEX_UNLOCK(&(_nt)->nt_nodelock) |
| 31 #define IEEE80211_NODE_LOCK_BH(_nt) A_MUTEX_LOCK(&(_nt)->nt_nodelock) |
| 32 #define IEEE80211_NODE_UNLOCK_BH(_nt) A_MUTEX_UNLOCK(&(_nt)->nt_nodelock) |
| 33 #define IEEE80211_NODE_LOCK_ASSERT(_nt) |
| 34 |
| 35 /* |
| 36 * Node reference counting definitions. |
| 37 * |
| 38 * ieee80211_node_initref initialize the reference count to 1 |
| 39 * ieee80211_node_incref add a reference |
| 40 * ieee80211_node_decref remove a reference |
| 41 * ieee80211_node_dectestref remove a reference and return 1 if this |
| 42 * is the last reference, otherwise 0 |
| 43 * ieee80211_node_refcnt reference count for printing (only) |
| 44 */ |
| 45 #define ieee80211_node_initref(_ni) ((_ni)->ni_refcnt = 1) |
| 46 #define ieee80211_node_incref(_ni) ((_ni)->ni_refcnt++) |
| 47 #define ieee80211_node_decref(_ni) ((_ni)->ni_refcnt--) |
| 48 #define ieee80211_node_dectestref(_ni) (((_ni)->ni_refcnt--) == 1) |
| 49 #define ieee80211_node_refcnt(_ni) ((_ni)->ni_refcnt) |
| 50 |
| 51 #define IEEE80211_NODE_HASHSIZE 32 |
| 52 /* simple hash is enough for variation of macaddr */ |
| 53 #define IEEE80211_NODE_HASH(addr) \ |
| 54 (((const A_UINT8 *)(addr))[IEEE80211_ADDR_LEN - 1] % \ |
| 55 IEEE80211_NODE_HASHSIZE) |
| 56 |
| 57 /* |
| 58 * Table of ieee80211_node instances. Each ieee80211com |
| 59 * has at least one for holding the scan candidates. |
| 60 * When operating as an access point or in ibss mode there |
| 61 * is a second table for associated stations or neighbors. |
| 62 */ |
| 63 struct ieee80211_node_table { |
| 64 void *nt_wmip; /* back reference */ |
| 65 A_MUTEX_T nt_nodelock; /* on node table */ |
| 66 struct bss *nt_node_first; /* information of all nodes */ |
| 67 struct bss *nt_node_last; /* information of all nodes */ |
| 68 struct bss *nt_hash[IEEE80211_NODE_HASHSIZE]; |
| 69 const char *nt_name; /* for debugging */ |
| 70 A_UINT32 nt_scangen; /* gen# for timeout scan */ |
| 71 A_TIMER nt_inact_timer; |
| 72 A_UINT8 isTimerArmed; /* is the node timer armed */ |
| 73 A_UINT32 nt_nodeAge; /* node aging time */ |
| 74 #ifdef OS_ROAM_MANAGEMENT |
| 75 A_UINT32 nt_si_gen; /* gen# for scan indication*/ |
| 76 #endif |
| 77 }; |
| 78 |
| 79 #define WLAN_NODE_INACT_TIMEOUT_MSEC 120000 |
| 80 |
| 81 #endif /* _IEEE80211_NODE_H_ */ |
OLD | NEW |