diff options
author | Reyk Floeter <reyk@cvs.openbsd.org> | 2005-02-17 18:28:06 +0000 |
---|---|---|
committer | Reyk Floeter <reyk@cvs.openbsd.org> | 2005-02-17 18:28:06 +0000 |
commit | 86f341e75623affacf377939e31182d754a6a584 (patch) | |
tree | 962821474198da2e40b249d6aab3cace0c21233e /sys/dev/pci/if_ipw.c | |
parent | 47706ecaf12d67a399225153e56f1d84398bfc5a (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/pci/if_ipw.c')
-rw-r--r-- | sys/dev/pci/if_ipw.c | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/sys/dev/pci/if_ipw.c b/sys/dev/pci/if_ipw.c index bc8d3bbb5d4..a15981c12ae 100644 --- a/sys/dev/pci/if_ipw.c +++ b/sys/dev/pci/if_ipw.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_ipw.c,v 1.39 2005/01/13 20:52:13 damien Exp $ */ +/* $OpenBSD: if_ipw.c,v 1.40 2005/02/17 18:28:05 reyk Exp $ */ /*- * Copyright (c) 2004, 2005 @@ -939,10 +939,7 @@ ipw_data_intr(struct ipw_softc *sc, struct ipw_status *status, /* Send the frame to the upper layer */ ieee80211_input(ifp, m, ni, status->rssi, 0); - if (ni == ic->ic_bss) - ieee80211_unref_node(&ni); - else - ieee80211_free_node(ic, ni); + ieee80211_release_node(ic, ni); MGETHDR(m, M_DONTWAIT, MT_DATA); if (m == NULL) { @@ -1060,8 +1057,8 @@ ipw_release_sbd(struct ipw_softc *sc, struct ipw_soft_bd *sbd) m_freem(sbuf->m); - if (sbuf->ni != NULL && sbuf->ni != ic->ic_bss) - ieee80211_free_node(ic, sbuf->ni); + if (sbuf->ni != NULL) + ieee80211_release_node(ic, sbuf->ni); /* kill watchdog timer */ sc->sc_tx_timer = 0; @@ -1385,8 +1382,8 @@ ipw_start(struct ifnet *ifp) #endif if (ipw_tx_start(ifp, m, ni) != 0) { - if (ni != NULL && ni != ic->ic_bss) - ieee80211_free_node(ic, ni); + if (ni != NULL) + ieee80211_release_node(ic, ni); break; } |