1 --- a/net80211/ieee80211_input.c
2 +++ b/net80211/ieee80211_input.c
3 @@ -568,36 +568,6 @@ ieee80211_input(struct ieee80211vap * va
7 - /* XXX: Useless node mgmt API; make better */
8 - if ((dir == IEEE80211_FC1_DIR_DSTODS) && !vap->iv_wdsnode &&
9 - !ni_wds && !ni->ni_subif) {
10 - struct ieee80211_node_table *nt = &ic->ic_sta;
11 - struct ieee80211_frame_addr4 *wh4;
13 - if (!(vap->iv_flags_ext & IEEE80211_FEXT_WDS)) {
14 - IEEE80211_DISCARD(vap, IEEE80211_MSG_INPUT,
15 - wh, "data", "%s", "4 addr not allowed");
18 - wh4 = (struct ieee80211_frame_addr4 *)skb->data;
19 - ni_wds = ieee80211_find_wds_node(nt, wh4->i_addr4);
20 - /* Last call increments ref count if !NULL */
21 - if ((ni_wds != NULL) && (ni_wds != ni)) {
23 - * node with source address (addr4) moved
24 - * to another WDS capable station. remove the
25 - * reference to the previous station and add
26 - * reference to the new one
28 - (void) ieee80211_remove_wds_addr(nt, wh4->i_addr4);
29 - ieee80211_add_wds_addr(nt, ni, wh4->i_addr4, 0);
32 - ieee80211_add_wds_addr(nt, ni, wh4->i_addr4, 0);
34 - ieee80211_unref_node(&ni_wds);
38 * Check for power save state change.
40 --- a/net80211/ieee80211_node.c
41 +++ b/net80211/ieee80211_node.c
42 @@ -122,7 +122,6 @@ static void ieee80211_node_table_init(st
43 static void ieee80211_node_table_cleanup(struct ieee80211_node_table *);
44 static void ieee80211_node_table_reset(struct ieee80211_node_table *,
45 struct ieee80211vap *);
46 -static void ieee80211_node_wds_ageout(unsigned long);
48 MALLOC_DEFINE(M_80211_NODE, "80211node", "802.11 node state");
50 @@ -785,10 +784,6 @@ ieee80211_node_table_init(struct ieee802
53 nt->nt_inact_init = inact;
54 - init_timer(&nt->nt_wds_aging_timer);
55 - nt->nt_wds_aging_timer.function = ieee80211_node_wds_ageout;
56 - nt->nt_wds_aging_timer.data = (unsigned long) nt;
57 - mod_timer(&nt->nt_wds_aging_timer, jiffies + HZ * WDS_AGING_TIMER_VAL);
61 @@ -1204,142 +1199,6 @@ void ieee80211_wds_addif(struct ieee8021
62 schedule_work(&ni->ni_create);
65 -/* Add wds address to the node table */
67 -#ifdef IEEE80211_DEBUG_REFCNT
68 -ieee80211_add_wds_addr_debug(struct ieee80211_node_table *nt,
69 - struct ieee80211_node *ni, const u_int8_t *macaddr, u_int8_t wds_static,
70 - const char* func, int line)
72 -ieee80211_add_wds_addr(struct ieee80211_node_table *nt,
73 - struct ieee80211_node *ni, const u_int8_t *macaddr, u_int8_t wds_static)
77 - struct ieee80211_wds_addr *wds;
79 - MALLOC(wds, struct ieee80211_wds_addr *, sizeof(struct ieee80211_wds_addr),
80 - M_80211_WDS, M_NOWAIT | M_ZERO);
86 - wds->wds_agingcount = WDS_AGING_STATIC;
88 - wds->wds_agingcount = WDS_AGING_COUNT;
89 - hash = IEEE80211_NODE_HASH(macaddr);
90 - IEEE80211_ADDR_COPY(wds->wds_macaddr, macaddr);
92 - IEEE80211_NODE_TABLE_LOCK_IRQ(nt);
93 -#ifdef IEEE80211_DEBUG_REFCNT
94 - wds->wds_ni = ieee80211_ref_node_debug(ni, func, line);
96 - wds->wds_ni = ieee80211_ref_node(ni);
98 - LIST_INSERT_HEAD(&nt->nt_wds_hash[hash], wds, wds_hash);
99 - IEEE80211_NODE_TABLE_UNLOCK_IRQ(nt);
102 -#ifdef IEEE80211_DEBUG_REFCNT
103 -EXPORT_SYMBOL(ieee80211_add_wds_addr_debug);
105 -EXPORT_SYMBOL(ieee80211_add_wds_addr);
108 -/* remove wds address from the wds hash table */
110 -#ifdef IEEE80211_DEBUG_REFCNT
111 -ieee80211_remove_wds_addr_debug(struct ieee80211_node_table *nt, const u_int8_t *macaddr,
112 - const char* func, int line)
114 -ieee80211_remove_wds_addr(struct ieee80211_node_table *nt, const u_int8_t *macaddr)
118 - struct ieee80211_wds_addr *wds, *twds;
120 - hash = IEEE80211_NODE_HASH(macaddr);
121 - IEEE80211_NODE_TABLE_LOCK_IRQ(nt);
122 - LIST_FOREACH_SAFE(wds, &nt->nt_wds_hash[hash], wds_hash, twds) {
123 - if (IEEE80211_ADDR_EQ(wds->wds_macaddr, macaddr)) {
124 - LIST_REMOVE(wds, wds_hash);
125 -#ifdef IEEE80211_DEBUG_REFCNT
126 - ieee80211_unref_node_debug(&wds->wds_ni, func, line);
128 - ieee80211_unref_node(&wds->wds_ni);
130 - FREE(wds, M_80211_WDS);
134 - IEEE80211_NODE_TABLE_UNLOCK_IRQ(nt);
136 -#ifdef IEEE80211_DEBUG_REFCNT
137 -EXPORT_SYMBOL(ieee80211_remove_wds_addr_debug);
139 -EXPORT_SYMBOL(ieee80211_remove_wds_addr);
142 -/* Remove node references from wds table */
144 -#ifdef IEEE80211_DEBUG_REFCNT
145 -ieee80211_del_wds_node_debug(struct ieee80211_node_table *nt, struct ieee80211_node *ni,
146 - const char* func, int line)
148 -ieee80211_del_wds_node(struct ieee80211_node_table *nt, struct ieee80211_node *ni)
152 - struct ieee80211_wds_addr *wds, *twds;
154 - IEEE80211_NODE_TABLE_LOCK_IRQ(nt);
155 - for (hash = 0; hash < IEEE80211_NODE_HASHSIZE; hash++) {
156 - LIST_FOREACH_SAFE(wds, &nt->nt_wds_hash[hash], wds_hash, twds) {
157 - if (wds->wds_ni == ni) {
158 - LIST_REMOVE(wds, wds_hash);
159 -#ifdef IEEE80211_DEBUG_REFCNT
160 - ieee80211_unref_node_debug(&wds->wds_ni, func, line);
162 - ieee80211_unref_node(&wds->wds_ni);
164 - FREE(wds, M_80211_WDS);
168 - IEEE80211_NODE_TABLE_UNLOCK_IRQ(nt);
170 -#ifdef IEEE80211_DEBUG_REFCNT
171 -EXPORT_SYMBOL(ieee80211_del_wds_node_debug);
173 -EXPORT_SYMBOL(ieee80211_del_wds_node);
177 -ieee80211_node_wds_ageout(unsigned long data)
179 - struct ieee80211_node_table *nt = (struct ieee80211_node_table *)data;
181 - struct ieee80211_wds_addr *wds, *twds;
183 - IEEE80211_NODE_TABLE_LOCK_IRQ(nt);
184 - for (hash = 0; hash < IEEE80211_NODE_HASHSIZE; hash++) {
185 - LIST_FOREACH_SAFE(wds, &nt->nt_wds_hash[hash], wds_hash, twds) {
186 - if (wds->wds_agingcount != WDS_AGING_STATIC) {
187 - if (!wds->wds_agingcount) {
188 - LIST_REMOVE(wds, wds_hash);
189 - ieee80211_unref_node(&wds->wds_ni);
190 - FREE(wds, M_80211_WDS);
192 - wds->wds_agingcount--;
196 - IEEE80211_NODE_TABLE_UNLOCK_IRQ(nt);
197 - mod_timer(&nt->nt_wds_aging_timer, jiffies + HZ * WDS_AGING_TIMER_VAL);
201 /* Add the specified station to the station table.
202 * Allocates a new ieee80211_node* that has a reference count of one
203 * If tmp is 0, it is added to the node table and the reference is used.
204 @@ -1385,34 +1244,6 @@ ieee80211_dup_bss(struct ieee80211vap *v
208 -static struct ieee80211_node *
209 -#ifdef IEEE80211_DEBUG_REFCNT
210 -ieee80211_find_wds_node_locked_debug(struct ieee80211_node_table *nt,
211 - const u_int8_t *macaddr, const char* func, int line)
213 -ieee80211_find_wds_node_locked(struct ieee80211_node_table *nt,
214 - const u_int8_t *macaddr)
217 - struct ieee80211_wds_addr *wds;
219 - IEEE80211_NODE_TABLE_LOCK_ASSERT(nt);
221 - hash = IEEE80211_NODE_HASH(macaddr);
222 - LIST_FOREACH(wds, &nt->nt_wds_hash[hash], wds_hash) {
223 - if (IEEE80211_ADDR_EQ(wds->wds_macaddr, macaddr)) {
224 - if (wds->wds_agingcount != WDS_AGING_STATIC)
225 - wds->wds_agingcount = WDS_AGING_COUNT; /* reset the aging count */
226 -#ifdef IEEE80211_DEBUG_REFCNT
227 - return ieee80211_ref_node_debug(wds->wds_ni, func, line);
229 - return ieee80211_ref_node(wds->wds_ni);
236 /* NB: A node reference is acquired here; the caller MUST release it. */
237 #ifdef IEEE80211_DEBUG_REFCNT
238 #define ieee80211_find_node_locked(nt, mac) \
239 @@ -1430,7 +1261,6 @@ ieee80211_find_node_locked(struct ieee80
241 struct ieee80211_node *ni;
243 - struct ieee80211_wds_addr *wds;
245 IEEE80211_NODE_TABLE_LOCK_ASSERT(nt);
247 @@ -1445,48 +1275,11 @@ ieee80211_find_node_locked(struct ieee80
252 - /* Now, we look for the desired mac address in the 4 address
254 - LIST_FOREACH(wds, &nt->nt_wds_hash[hash], wds_hash) {
255 - if (IEEE80211_ADDR_EQ(wds->wds_macaddr, macaddr)) {
256 -#ifdef IEEE80211_DEBUG_REFCNT
257 - return ieee80211_ref_node_debug(wds->wds_ni, func, line);
259 - return ieee80211_ref_node(wds->wds_ni);
266 struct ieee80211_node *
267 #ifdef IEEE80211_DEBUG_REFCNT
268 -ieee80211_find_wds_node_debug(struct ieee80211_node_table *nt, const u_int8_t *macaddr,
269 - const char* func, int line)
271 -ieee80211_find_wds_node(struct ieee80211_node_table *nt, const u_int8_t *macaddr)
274 - struct ieee80211_node *ni;
276 - IEEE80211_NODE_TABLE_LOCK_IRQ(nt);
277 -#ifdef IEEE80211_DEBUG_REFCNT
278 - ni = ieee80211_find_wds_node_locked_debug(nt, macaddr, func, line);
280 - ni = ieee80211_find_wds_node_locked(nt, macaddr);
282 - IEEE80211_NODE_TABLE_UNLOCK_IRQ(nt);
285 -#ifdef IEEE80211_DEBUG_REFCNT
286 -EXPORT_SYMBOL(ieee80211_find_wds_node_debug);
288 -EXPORT_SYMBOL(ieee80211_find_wds_node);
291 -struct ieee80211_node *
292 -#ifdef IEEE80211_DEBUG_REFCNT
293 ieee80211_find_node_debug(struct ieee80211_node_table *nt,
294 const u_int8_t *macaddr, const char *func, int line)
296 @@ -1838,7 +1631,6 @@ ieee80211_node_table_cleanup(struct ieee
297 ic->ic_node_cleanup(ni);
300 - del_timer(&nt->nt_wds_aging_timer);
301 IEEE80211_SCAN_LOCK_DESTROY(nt);
302 IEEE80211_NODE_TABLE_LOCK_DESTROY(nt);
304 @@ -2404,8 +2196,6 @@ ieee80211_node_leave(struct ieee80211_no
305 * so no more references are generated
308 - ieee80211_remove_wds_addr(nt, ni->ni_macaddr);
309 - ieee80211_del_wds_node(nt, ni);
310 IEEE80211_NODE_TABLE_LOCK_IRQ(nt);
311 node_table_leave_locked(nt, ni);
312 IEEE80211_NODE_TABLE_UNLOCK_IRQ(nt);
313 --- a/net80211/ieee80211_node.h
314 +++ b/net80211/ieee80211_node.h
315 @@ -231,13 +231,6 @@ void ieee80211_sta_leave(struct ieee8021
316 #define WDS_AGING_STATIC 0xffff
317 #define WDS_AGING_TIMER_VAL (WDS_AGING_TIME / 2)
319 -struct ieee80211_wds_addr {
320 - LIST_ENTRY(ieee80211_wds_addr) wds_hash;
321 - u_int8_t wds_macaddr[IEEE80211_ADDR_LEN];
322 - struct ieee80211_node *wds_ni;
323 - u_int16_t wds_agingcount;
327 * Table of ieee80211_node instances. Each ieee80211com
328 * has at least one for holding the scan candidates.
329 @@ -250,11 +243,9 @@ struct ieee80211_node_table {
330 ieee80211_node_table_lock_t nt_nodelock; /* on node table */
331 TAILQ_HEAD(, ieee80211_node) nt_node; /* information of all nodes */
332 ATH_LIST_HEAD(, ieee80211_node) nt_hash[IEEE80211_NODE_HASHSIZE];
333 - ATH_LIST_HEAD(, ieee80211_wds_addr) nt_wds_hash[IEEE80211_NODE_HASHSIZE];
334 ieee80211_scan_lock_t nt_scanlock; /* on nt_scangen */
335 u_int nt_scangen; /* gen# for timeout scan */
336 int nt_inact_init; /* initial node inact setting */
337 - struct timer_list nt_wds_aging_timer; /* timer to age out wds entries */
340 /* Allocates a new ieee80211_node* that has a reference count of one, and
341 @@ -363,47 +354,6 @@ void
342 ieee80211_unref_node(struct ieee80211_node **pni);
343 #endif /* #ifdef IEEE80211_DEBUG_REFCNT */
345 -/* Increments reference count of ieee80211_node *ni */
346 -#ifdef IEEE80211_DEBUG_REFCNT
347 -#define ieee80211_add_wds_addr(_table, _node, _mac, _static) \
348 - ieee80211_add_wds_addr_debug(_table, _node, _mac, _static, __func__, __LINE__)
349 -int ieee80211_add_wds_addr_debug(struct ieee80211_node_table *, struct ieee80211_node *,
350 - const u_int8_t *, u_int8_t, const char* func, int line);
352 -int ieee80211_add_wds_addr(struct ieee80211_node_table *, struct ieee80211_node *,
353 - const u_int8_t *, u_int8_t);
354 -#endif /* #ifdef IEEE80211_DEBUG_REFCNT */
356 -/* Decrements reference count of ieee80211_node *ni */
357 -#ifdef IEEE80211_DEBUG_REFCNT
358 -#define ieee80211_remove_wds_addr(_table, _mac) \
359 - ieee80211_remove_wds_addr_debug(_table, _mac, __func__, __LINE__)
360 -void ieee80211_remove_wds_addr_debug(struct ieee80211_node_table *, const u_int8_t *,
361 - const char* func, int line);
363 -void ieee80211_remove_wds_addr(struct ieee80211_node_table *, const u_int8_t *);
364 -#endif /* #ifdef IEEE80211_DEBUG_REFCNT */
366 -/* Decrements reference count of node, if found */
367 -#ifdef IEEE80211_DEBUG_REFCNT
368 -#define ieee80211_del_wds_node(_table, _node) \
369 - ieee80211_del_wds_node_debug(_table, _node, __func__, __LINE__)
370 -void ieee80211_del_wds_node_debug(struct ieee80211_node_table *, struct ieee80211_node *,
371 - const char* func, int line);
373 -void ieee80211_del_wds_node(struct ieee80211_node_table *, struct ieee80211_node *);
374 -#endif /* #ifdef IEEE80211_DEBUG_REFCNT */
376 -/* Increments reference count of node, if found */
377 -#ifdef IEEE80211_DEBUG_REFCNT
378 -#define ieee80211_find_wds_node(_table, _mac) \
379 - ieee80211_find_wds_node_debug(_table, _mac, __func__, __LINE__)
380 -struct ieee80211_node *ieee80211_find_wds_node_debug(struct ieee80211_node_table *,
381 - const u_int8_t *, const char* func, int line);
383 -struct ieee80211_node *ieee80211_find_wds_node(struct ieee80211_node_table *,
385 -#endif /* #ifdef IEEE80211_DEBUG_REFCNT */
386 typedef void ieee80211_iter_func(void *, struct ieee80211_node *);
387 void ieee80211_iterate_nodes(struct ieee80211_node_table *,
388 ieee80211_iter_func *, void *);