Date: Sun, 28 Aug 2011 13:24:48 +0000 (UTC) From: Adrian Chadd <adrian@FreeBSD.org> To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r225230 - user/adrian/if_ath_tx/sys/dev/ath Message-ID: <201108281324.p7SDOmEH053617@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: adrian Date: Sun Aug 28 13:24:48 2011 New Revision: 225230 URL: http://svn.freebsd.org/changeset/base/225230 Log: Push the cleanup stuff into ic_node_cleanup rather than destroy, which ends up having some recursive badness happening leading to panics. Modified: user/adrian/if_ath_tx/sys/dev/ath/if_ath.c user/adrian/if_ath_tx/sys/dev/ath/if_athvar.h Modified: user/adrian/if_ath_tx/sys/dev/ath/if_ath.c ============================================================================== --- user/adrian/if_ath_tx/sys/dev/ath/if_ath.c Sun Aug 28 11:49:53 2011 (r225229) +++ user/adrian/if_ath_tx/sys/dev/ath/if_ath.c Sun Aug 28 13:24:48 2011 (r225230) @@ -158,6 +158,7 @@ static int ath_desc_alloc(struct ath_sof 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 *); @@ -725,6 +726,8 @@ ath_attach(u_int16_t devid, struct ath_s 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; @@ -3310,17 +3313,24 @@ ath_node_alloc(struct ieee80211vap *vap, } static void -ath_node_free(struct ieee80211_node *ni) +ath_node_cleanup(struct ieee80211_node *ni) { struct ieee80211com *ic = ni->ni_ic; struct ath_softc *sc = ic->ic_ifp->if_softc; - DPRINTF(sc, ATH_DEBUG_NODE, "%s: ni %p\n", __func__, ni); - /* Cleanup ath_tid, free unused bufs, unlink bufs in TXQ */ ath_tx_tid_cleanup(sc, ATH_NODE(ni)); - 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; + + DPRINTF(sc, ATH_DEBUG_NODE, "%s: ni %p\n", __func__, ni); mtx_destroy(&ATH_NODE(ni)->an_mtx); sc->sc_node_free(ni); } Modified: user/adrian/if_ath_tx/sys/dev/ath/if_athvar.h ============================================================================== --- user/adrian/if_ath_tx/sys/dev/ath/if_athvar.h Sun Aug 28 11:49:53 2011 (r225229) +++ user/adrian/if_ath_tx/sys/dev/ath/if_athvar.h Sun Aug 28 13:24:48 2011 (r225230) @@ -340,6 +340,7 @@ struct ath_softc { u_int8_t sc_nbssid0; /* # vap's using base mac */ uint32_t sc_bssidmask; /* bssid mask */ + void (*sc_node_cleanup)(struct ieee80211_node *); void (*sc_node_free)(struct ieee80211_node *); device_t sc_dev; HAL_BUS_TAG sc_st; /* bus space tag */
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201108281324.p7SDOmEH053617>