summaryrefslogtreecommitdiffstats
path: root/sys/net80211/ieee80211_node.c
diff options
context:
space:
mode:
authorsam <sam@FreeBSD.org>2009-02-12 23:34:58 +0000
committersam <sam@FreeBSD.org>2009-02-12 23:34:58 +0000
commitcf2094a5438adfc95e5c2a976a637cfc86c003c9 (patch)
tree789ecfa0fdb20cf77c7c0fa6b9a61a444a881b37 /sys/net80211/ieee80211_node.c
parenta4557d874cea19c85b904233ff0bc7ec8fc632ee (diff)
downloadFreeBSD-src-cf2094a5438adfc95e5c2a976a637cfc86c003c9.zip
FreeBSD-src-cf2094a5438adfc95e5c2a976a637cfc86c003c9.tar.gz
o replace ieee80211_node_reclaim by individual operations to release the
references to iv_bss and the sta table; this is equivalent and causes direct reclaim of the old bss node when any references in packets inflight are reclaimed (previously the old node would sit in the bss table until the inactivity processing reclaimed it) o remove ieee80211_node_reclaim now that it's only use is gone Reviewed by: avatar, cbzimmer
Diffstat (limited to 'sys/net80211/ieee80211_node.c')
-rw-r--r--sys/net80211/ieee80211_node.c62
1 files changed, 2 insertions, 60 deletions
diff --git a/sys/net80211/ieee80211_node.c b/sys/net80211/ieee80211_node.c
index 23661b1..aa92d8e 100644
--- a/sys/net80211/ieee80211_node.c
+++ b/sys/net80211/ieee80211_node.c
@@ -87,7 +87,6 @@ static void ieee80211_node_table_init(struct ieee80211com *ic,
int inact, int keymaxix);
static void ieee80211_node_table_reset(struct ieee80211_node_table *,
struct ieee80211vap *);
-static void ieee80211_node_reclaim(struct ieee80211_node *);
static void ieee80211_node_table_cleanup(struct ieee80211_node_table *nt);
static void ieee80211_erp_timeout(struct ieee80211com *);
@@ -674,7 +673,8 @@ ieee80211_sta_join1(struct ieee80211_node *selbs)
vap->iv_bss = selbs; /* NB: caller assumed to bump refcnt */
if (obss != NULL) {
copy_bss(selbs, obss);
- ieee80211_node_reclaim(obss);
+ ieee80211_node_decref(obss); /* iv_bss reference */
+ ieee80211_free_node(obss); /* station table reference */
obss = NULL; /* NB: guard against later use */
}
@@ -1739,64 +1739,6 @@ node_reclaim(struct ieee80211_node_table *nt, struct ieee80211_node *ni)
}
/*
- * Reclaim a (bss) node. Decrement the refcnt and reclaim
- * the node if the only other reference to it is in the sta
- * table. This is effectively ieee80211_free_node followed
- * by node_reclaim when the refcnt is 1 (after the free).
- */
-static void
-ieee80211_node_reclaim(struct ieee80211_node *ni)
-{
- struct ieee80211_node_table *nt = ni->ni_table;
-
- KASSERT(nt != NULL, ("reclaim node not in table"));
-
-#ifdef IEEE80211_DEBUG_REFCNT
- IEEE80211_DPRINTF(ni->ni_vap, IEEE80211_MSG_NODE,
- "%s %p<%s> refcnt %d\n", __func__, ni,
- ether_sprintf(ni->ni_macaddr), ieee80211_node_refcnt(ni)-1);
-#endif
- IEEE80211_NODE_LOCK(nt);
- if (ieee80211_node_dectestref(ni)) {
- /*
- * Last reference, reclaim state.
- */
- _ieee80211_free_node(ni);
- nt = NULL;
- } else if (ieee80211_node_refcnt(ni) == 1 && nt->nt_keyixmap != NULL) {
- ieee80211_keyix keyix;
- /*
- * Check for a last reference in the key mapping table.
- */
- keyix = ni->ni_ucastkey.wk_rxkeyix;
- if (keyix < nt->nt_keyixmax &&
- nt->nt_keyixmap[keyix] == ni) {
- IEEE80211_DPRINTF(ni->ni_vap,
- IEEE80211_MSG_NODE,
- "%s: %p<%s> clear key map entry %u", __func__,
- ni, ether_sprintf(ni->ni_macaddr), keyix);
- nt->nt_keyixmap[keyix] = NULL;
- ieee80211_node_decref(ni); /* XXX needed? */
- _ieee80211_free_node(ni);
- nt = NULL;
- }
- }
- if (nt != NULL && ieee80211_node_refcnt(ni) == 1) {
- /*
- * Last reference is in the sta table; complete
- * the reclaim. This handles bss nodes being
- * recycled: the node has two references, one for
- * iv_bss and one for the table. After dropping
- * the iv_bss ref above we need to reclaim the sta
- * table reference.
- */
- ieee80211_node_decref(ni); /* NB: be pendantic */
- _ieee80211_free_node(ni);
- }
- IEEE80211_NODE_UNLOCK(nt);
-}
-
-/*
* Node table support.
*/
OpenPOWER on IntegriCloud