Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 12 Feb 2009 23:34:58 +0000 (UTC)
From:      Sam Leffler <sam@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r188541 - head/sys/net80211
Message-ID:  <200902122334.n1CNYwBv069933@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: sam
Date: Thu Feb 12 23:34:58 2009
New Revision: 188541
URL: http://svn.freebsd.org/changeset/base/188541

Log:
  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

Modified:
  head/sys/net80211/ieee80211_node.c

Modified: head/sys/net80211/ieee80211_node.c
==============================================================================
--- head/sys/net80211/ieee80211_node.c	Thu Feb 12 23:23:30 2009	(r188540)
+++ head/sys/net80211/ieee80211_node.c	Thu Feb 12 23:34:58 2009	(r188541)
@@ -87,7 +87,6 @@ static void ieee80211_node_table_init(st
 	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_nod
 	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
 }
 
 /*
- * 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.
  */
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200902122334.n1CNYwBv069933>