summaryrefslogtreecommitdiff
path: root/sys/dev/pci/if_iwi.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/pci/if_iwi.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/pci/if_iwi.c')
-rw-r--r--sys/dev/pci/if_iwi.c17
1 files changed, 6 insertions, 11 deletions
diff --git a/sys/dev/pci/if_iwi.c b/sys/dev/pci/if_iwi.c
index 7e133400056..437f8e675f6 100644
--- a/sys/dev/pci/if_iwi.c
+++ b/sys/dev/pci/if_iwi.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_iwi.c,v 1.24 2005/01/09 16:47:50 damien Exp $ */
+/* $OpenBSD: if_iwi.c,v 1.25 2005/02/17 18:28:05 reyk Exp $ */
/*-
* Copyright (c) 2004, 2005
@@ -795,10 +795,7 @@ iwi_frame_intr(struct iwi_softc *sc, struct iwi_rx_buf *buf, int i,
/* Send the frame to the upper layer */
ieee80211_input(ifp, m, ni, IWI_RSSIDBM2RAW(frame->rssi_dbm), 0);
- if (ni == ic->ic_bss)
- ieee80211_unref_node(&ni);
- else
- ieee80211_free_node(ic, ni);
+ ieee80211_release_node(ic, ni);
MGETHDR(buf->m, M_DONTWAIT, MT_DATA);
if (buf->m == NULL) {
@@ -971,8 +968,7 @@ iwi_tx_intr(struct iwi_softc *sc)
bus_dmamap_unload(sc->sc_dmat, buf->map);
m_freem(buf->m);
buf->m = NULL;
- if (buf->ni != ic->ic_bss)
- ieee80211_free_node(ic, buf->ni);
+ ieee80211_release_node(ic, buf->ni);
buf->ni = NULL;
sc->tx_queued--;
@@ -1221,8 +1217,8 @@ iwi_start(struct ifnet *ifp)
#endif
if (iwi_tx_start(ifp, m0, ni) != 0) {
- if (ni != NULL && ni != ic->ic_bss)
- ieee80211_free_node(ic, ni);
+ if (ni != NULL)
+ ieee80211_release_node(ic, ni);
break;
}
@@ -2003,8 +1999,7 @@ iwi_stop(struct ifnet *ifp, int disable)
buf->m = NULL;
if (buf->ni != NULL) {
- if (buf->ni != ic->ic_bss)
- ieee80211_free_node(ic, buf->ni);
+ ieee80211_release_node(ic, buf->ni);
buf->ni = NULL;
}
}