summaryrefslogtreecommitdiff
path: root/sys/dev/ic/ath.c
diff options
context:
space:
mode:
authorReyk Floeter <reyk@cvs.openbsd.org>2005-02-17 18:28:06 +0000
committerReyk Floeter <reyk@cvs.openbsd.org>2005-02-17 18:28:06 +0000
commit86f341e75623affacf377939e31182d754a6a584 (patch)
tree962821474198da2e40b249d6aab3cace0c21233e /sys/dev/ic/ath.c
parent47706ecaf12d67a399225153e56f1d84398bfc5a (diff)
derived from NetBSD:
--- Make the node table into an LRU cache: least-recently used nodes are at the end of the node queue. Change the reference-counting discipline: ni->ni_refcnt indicates how many times net80211 has granted ni to the driver. Every node in the table with ni_refcnt=0 is eligible to be garbage-collected. The mere presence of a node in the table does not any longer indicate its auth/assoc state; nodes have a ni_state variable, now. While I am here, patch ieee80211_find_node_for_beacon to do a "best match" by bssid/ssid/channel, not a "perfect match." This keeps net80211 from caching duplicate nodes in the table. --- ok deraadt@ dlg@, looks good jsg@
Diffstat (limited to 'sys/dev/ic/ath.c')
-rw-r--r--sys/dev/ic/ath.c18
1 files changed, 7 insertions, 11 deletions
diff --git a/sys/dev/ic/ath.c b/sys/dev/ic/ath.c
index d285edd181d..9afb3eb53ef 100644
--- a/sys/dev/ic/ath.c
+++ b/sys/dev/ic/ath.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ath.c,v 1.6 2005/01/03 19:59:18 jsg Exp $ */
+/* $OpenBSD: ath.c,v 1.7 2005/02/17 18:28:05 reyk Exp $ */
/* $NetBSD: ath.c,v 1.37 2004/08/18 21:59:39 dyoung Exp $ */
/*-
@@ -1177,8 +1177,8 @@ ath_start(struct ifnet *ifp)
TAILQ_INSERT_TAIL(&sc->sc_txbuf, bf, bf_list);
splx(s);
ifp->if_oerrors++;
- if (ni != NULL && ni != ic->ic_bss)
- ieee80211_free_node(ic, ni);
+ if (ni != NULL)
+ ieee80211_release_node(ic, ni);
continue;
}
@@ -2444,10 +2444,7 @@ ath_rx_proc(void *arg, int npending)
* reclamation (e.g. in response to a DEAUTH message)
* so use release_node here instead of unref_node.
*/
- if (ni == ic->ic_bss)
- ieee80211_unref_node(&ni);
- else
- ieee80211_free_node(ic, ni);
+ ieee80211_release_node(ic, ni);
rx_next:
TAILQ_INSERT_TAIL(&sc->sc_rxbuf, bf, bf_list);
@@ -2895,8 +2892,7 @@ ath_tx_proc(void *arg, int npending)
* this is a DEAUTH message that was sent and the
* node was timed out due to inactivity.
*/
- if(ni != NULL && ni != ic->ic_bss)
- ieee80211_free_node(ic, ni);
+ ieee80211_release_node(ic, ni);
}
bus_dmamap_sync(sc->sc_dmat, bf->bf_dmamap, 0,
bf->bf_dmamap->dm_mapsize, BUS_DMASYNC_POSTWRITE);
@@ -2962,11 +2958,11 @@ ath_draintxq(struct ath_softc *sc)
ni = bf->bf_node;
bf->bf_node = NULL;
s = splnet();
- if (ni != NULL && ni != ic->ic_bss) {
+ if (ni != NULL) {
/*
* Reclaim node reference.
*/
- ieee80211_free_node(ic, ni);
+ ieee80211_release_node(ic, ni);
}
TAILQ_INSERT_TAIL(&sc->sc_txbuf, bf, bf_list);
splx(s);