From owner-svn-src-user@FreeBSD.ORG Sun Aug 28 13:24:48 2011 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 98163106564A; Sun, 28 Aug 2011 13:24:48 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6F1A28FC12; Sun, 28 Aug 2011 13:24:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p7SDOm2b053620; Sun, 28 Aug 2011 13:24:48 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p7SDOmEH053617; Sun, 28 Aug 2011 13:24:48 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201108281324.p7SDOmEH053617@svn.freebsd.org> From: Adrian Chadd Date: Sun, 28 Aug 2011 13:24:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225230 - user/adrian/if_ath_tx/sys/dev/ath X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Aug 2011 13:24:48 -0000 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 */