From owner-svn-src-user@FreeBSD.ORG Fri Feb 6 21:22:36 2009 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 571471065673; Fri, 6 Feb 2009 21:22:36 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2B7C18FC1A; Fri, 6 Feb 2009 21:22:36 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n16LMaW7071775; Fri, 6 Feb 2009 21:22:36 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n16LMaAu071774; Fri, 6 Feb 2009 21:22:36 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200902062122.n16LMaAu071774@svn.freebsd.org> From: Andrew Thompson Date: Fri, 6 Feb 2009 21:22:36 +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: r188248 - user/thompsa/usb/sys/dev/usb2/wlan 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: Fri, 06 Feb 2009 21:22:36 -0000 Author: thompsa Date: Fri Feb 6 21:22:35 2009 New Revision: 188248 URL: http://svn.freebsd.org/changeset/base/188248 Log: Avoid freeing the tx data if its already been reaped. Modified: user/thompsa/usb/sys/dev/usb2/wlan/if_zyd2.c Modified: user/thompsa/usb/sys/dev/usb2/wlan/if_zyd2.c ============================================================================== --- user/thompsa/usb/sys/dev/usb2/wlan/if_zyd2.c Fri Feb 6 20:57:10 2009 (r188247) +++ user/thompsa/usb/sys/dev/usb2/wlan/if_zyd2.c Fri Feb 6 21:22:35 2009 (r188248) @@ -124,7 +124,7 @@ static void zyd_update_mcast(struct ifne static int zyd_set_rxfilter(struct zyd_softc *); static void zyd_set_chan(struct zyd_softc *, struct ieee80211_channel *); static int zyd_set_beacon_interval(struct zyd_softc *, int); -static void zyd_rx_data(struct usb2_xfer *, int, int, uint16_t); +static void zyd_rx_data(struct usb2_xfer *, int, uint16_t); static int zyd_tx_mgt(struct zyd_softc *, struct mbuf *, struct ieee80211_node *); static int zyd_tx_data(struct zyd_softc *, struct mbuf *, @@ -2219,7 +2219,7 @@ fail: } static void -zyd_rx_data(struct usb2_xfer *xfer, int idx, int offset, uint16_t len) +zyd_rx_data(struct usb2_xfer *xfer, int offset, uint16_t len) { struct zyd_softc *sc = xfer->priv_sc; struct ifnet *ifp = sc->sc_ifp; @@ -2290,8 +2290,8 @@ zyd_rx_data(struct usb2_xfer *xfer, int } rssi = (stat.rssi > 63) ? 127 : 2 * stat.rssi; - sc->sc_rx_data[idx].rssi = rssi; - sc->sc_rx_data[idx].m = m; + sc->sc_rx_data[sc->sc_rx_count].rssi = rssi; + sc->sc_rx_data[sc->sc_rx_count].m = m; sc->sc_rx_count++; } @@ -2326,7 +2326,7 @@ zyd_bulk_read_callback(struct usb2_xfer if (len16 == 0 || len16 > xfer->actlen) break; - zyd_rx_data(xfer, i, offset, len16); + zyd_rx_data(xfer, offset, len16); /* next frame is aligned on a 32-bit boundary */ len16 = (len16 + 3) & ~3; @@ -2339,7 +2339,7 @@ zyd_bulk_read_callback(struct usb2_xfer DPRINTF(sc, ZYD_DEBUG_RECV, "%s: received single-frame transfer\n", __func__); - zyd_rx_data(xfer, 0, 0, xfer->actlen); + zyd_rx_data(xfer, 0, xfer->actlen); } /* FALLTHROUGH */ case USB_ST_SETUP: @@ -2623,10 +2623,9 @@ zyd_bulk_write_callback(struct usb2_xfer ifp->if_oerrors++; data = xfer->priv_fifo; - if (data != NULL) { + xfer->priv_fifo = NULL; + if (data != NULL && ifp->if_drv_flags & IFF_DRV_RUNNING) zyd_tx_free(data, xfer->error); - xfer->priv_fifo = NULL; - } break; } }