summaryrefslogtreecommitdiffstats
path: root/sys/dev/ath/if_ath.c
diff options
context:
space:
mode:
authoradrian <adrian@FreeBSD.org>2011-11-08 18:48:26 +0000
committeradrian <adrian@FreeBSD.org>2011-11-08 18:48:26 +0000
commit5b3fc4fe6ecb66d337f9b4f33c0724b5c8bf0877 (patch)
treedd980d87f33747f1ee6f57c90999d26c941a18e9 /sys/dev/ath/if_ath.c
parent3f66d2db4fc4fd31b100c64b638a0c11e7a97ab9 (diff)
downloadFreeBSD-src-5b3fc4fe6ecb66d337f9b4f33c0724b5c8bf0877.zip
FreeBSD-src-5b3fc4fe6ecb66d337f9b4f33c0724b5c8bf0877.tar.gz
Break out the node cleanup and node free path, in preparation for
doing software TX queue management. The software queued TX frames will be freed by the new cleanup function. Sponsored by: Hobnob, Inc.
Diffstat (limited to 'sys/dev/ath/if_ath.c')
-rw-r--r--sys/dev/ath/if_ath.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/sys/dev/ath/if_ath.c b/sys/dev/ath/if_ath.c
index 8eda6c4..37adfa6 100644
--- a/sys/dev/ath/if_ath.c
+++ b/sys/dev/ath/if_ath.c
@@ -163,6 +163,7 @@ static int ath_desc_alloc(struct ath_softc *);
static void ath_desc_free(struct ath_softc *);
static struct ieee80211_node *ath_node_alloc(struct ieee80211vap *,
const uint8_t [IEEE80211_ADDR_LEN]);
+static void ath_node_cleanup(struct ieee80211_node *);
static void ath_node_free(struct ieee80211_node *);
static void ath_node_getsignal(const struct ieee80211_node *,
int8_t *, int8_t *);
@@ -713,6 +714,8 @@ ath_attach(u_int16_t devid, struct ath_softc *sc)
ic->ic_node_alloc = ath_node_alloc;
sc->sc_node_free = ic->ic_node_free;
ic->ic_node_free = ath_node_free;
+ sc->sc_node_cleanup = ic->ic_node_cleanup;
+ ic->ic_node_cleanup = ath_node_cleanup;
ic->ic_node_getsignal = ath_node_getsignal;
ic->ic_scan_start = ath_scan_start;
ic->ic_scan_end = ath_scan_end;
@@ -3219,14 +3222,24 @@ ath_node_alloc(struct ieee80211vap *vap, const uint8_t mac[IEEE80211_ADDR_LEN])
}
static void
+ath_node_cleanup(struct ieee80211_node *ni)
+{
+ struct ieee80211com *ic = ni->ni_ic;
+ struct ath_softc *sc = ic->ic_ifp->if_softc;
+
+ /* Cleanup ath_tid, free unused bufs, unlink bufs in TXQ */
+ ath_rate_node_cleanup(sc, ATH_NODE(ni));
+ sc->sc_node_cleanup(ni);
+}
+
+static void
ath_node_free(struct ieee80211_node *ni)
{
struct ieee80211com *ic = ni->ni_ic;
- struct ath_softc *sc = ic->ic_ifp->if_softc;
+ struct ath_softc *sc = ic->ic_ifp->if_softc;
DPRINTF(sc, ATH_DEBUG_NODE, "%s: ni %p\n", __func__, ni);
mtx_destroy(&ATH_NODE(ni)->an_mtx);
- ath_rate_node_cleanup(sc, ATH_NODE(ni));
sc->sc_node_free(ni);
}
OpenPOWER on IntegriCloud