From owner-p4-projects@FreeBSD.ORG Wed Aug 10 22:47:23 2005 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 3136016A42B; Wed, 10 Aug 2005 22:46:59 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0104816A444 for ; Wed, 10 Aug 2005 22:46:50 +0000 (GMT) (envelope-from sam@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3FAE44402B for ; Wed, 10 Aug 2005 22:41:06 +0000 (GMT) (envelope-from sam@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id j7AMf6Wd070760 for ; Wed, 10 Aug 2005 22:41:06 GMT (envelope-from sam@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id j7AMf56l070757 for perforce@freebsd.org; Wed, 10 Aug 2005 22:41:05 GMT (envelope-from sam@freebsd.org) Date: Wed, 10 Aug 2005 22:41:05 GMT Message-Id: <200508102241.j7AMf56l070757@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to sam@freebsd.org using -f From: Sam Leffler To: Perforce Change Reviews Cc: Subject: PERFORCE change 81810 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Aug 2005 22:47:23 -0000 http://perforce.freebsd.org/chv.cgi?CH=81810 Change 81810 by sam@sam_ebb on 2005/08/10 22:40:35 o clear m_nextpkt in ath_tx_start to be safe o add comments about how frags are handled Affected files ... .. //depot/projects/wifi/sys/dev/ath/if_ath.c#101 edit Differences ... ==== //depot/projects/wifi/sys/dev/ath/if_ath.c#101 (text+ko) ==== @@ -1595,6 +1595,18 @@ } nextfrag: + /* + * Pass the frame to the h/w for transmission. + * Fragmented frames have each frag chained together + * with m_nextpkt. We know there are sufficient ath_buf's + * to send all the frags because of work done by + * ath_txfrag_setup. We leave m_nextpkt set while + * calling ath_tx_start so it can use it to extend the + * the tx duration to cover the subsequent frag and + * so it can reclaim all the mbufs in case of an error; + * ath_tx_start clears m_nextpkt once it commits to + * handing the frame to the hardware. + */ next = m->m_nextpkt; if (ath_tx_start(sc, ni, bf, m)) { bad: @@ -3598,6 +3610,10 @@ return 0; /* NB: lowest rate */ } +/* + * Reclaim mbuf resources. For fragmented frames we + * need to claim each frag chained with m_nextpkt. + */ static void ath_freetx(struct mbuf *m) { @@ -3990,6 +4006,13 @@ } else ctsrate = 0; + /* + * At this point we are committed to sending the frame + * and we don't need to look at m_nextpkt; clear it in + * case this frame is part of frag chain. + */ + m0->m_nextpkt = NULL; + if (IFF_DUMPPKTS(sc, ATH_DEBUG_XMIT)) ieee80211_dump_pkt(ic, mtod(m0, caddr_t), m0->m_len, sc->sc_hwmap[txrate].ieeerate, -1);