From owner-freebsd-current@FreeBSD.ORG Tue Apr 3 18:43:08 2007 Return-Path: X-Original-To: freebsd-current@freebsd.org Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3325C16A406 for ; Tue, 3 Apr 2007 18:43:08 +0000 (UTC) (envelope-from ambrisko@ambrisko.com) Received: from mail.ambrisko.com (mail.ambrisko.com [64.174.51.43]) by mx1.freebsd.org (Postfix) with ESMTP id 0347B13C480 for ; Tue, 3 Apr 2007 18:43:07 +0000 (UTC) (envelope-from ambrisko@ambrisko.com) Received: from server2.ambrisko.com (HELO www.ambrisko.com) ([192.168.1.2]) by mail.ambrisko.com with ESMTP; 03 Apr 2007 11:39:09 -0700 Received: from ambrisko.com (localhost [127.0.0.1]) by www.ambrisko.com (8.13.1/8.12.11) with ESMTP id l33Ih7wB067182; Tue, 3 Apr 2007 11:43:07 -0700 (PDT) (envelope-from ambrisko@ambrisko.com) Received: (from ambrisko@localhost) by ambrisko.com (8.13.1/8.13.1/Submit) id l33Ih7l3067181; Tue, 3 Apr 2007 11:43:07 -0700 (PDT) (envelope-from ambrisko) From: Doug Ambrisko Message-Id: <200704031843.l33Ih7l3067181@ambrisko.com> In-Reply-To: <11167f520704031135q3392bbben4f07f17768e0f3b7@mail.gmail.com> To: "Sam Fourman Jr." Date: Tue, 3 Apr 2007 11:43:07 -0700 (PDT) X-Mailer: ELM [version 2.4ME+ PL94b (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII Cc: Vince , freebsd-current@freebsd.org, yal@yal.hopto.org Subject: Re: Intel 3945ABG X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Apr 2007 18:43:08 -0000 Sam Fourman Jr. writes: | do you have a diff that fixes the leaks? Note he is working on a new version that deals with the new firmware that has a different API. ==== //depot/user/benjsc/wpi/sys/dev/wpi/if_wpi.c#16 - /data/home/ambrisko/p4/wpi/sys/dev/wpi/if_wpi.c ==== @@ -107,7 +107,10 @@ #ifdef WPI_DEBUG #define DPRINTF(x) do { if (wpi_debug != 0) printf x; } while (0) #define DPRINTFN(n, x) do { if (wpi_debug & n) printf x; } while (0) +/* int wpi_debug = 0xfffffffe; +*/ +int wpi_debug = 0; SYSCTL_INT(_debug, OID_AUTO, wpi, CTLFLAG_RW, &wpi_debug, 0, "wpi debug level"); enum { @@ -589,14 +592,14 @@ free( sc->sc_boot, M_DEVBUF ); - for (ac = 0; ac < 4; ac++) - wpi_free_tx_ring(sc, &sc->txq[ac]); - wpi_free_tx_ring(sc, &sc->cmdq); - wpi_free_tx_ring(sc, &sc->svcq); - wpi_free_rx_ring(sc, &sc->rxq); - wpi_free_rpool(sc); - wpi_free_shared(sc); } + for (ac = 0; ac < 4; ac++) + wpi_free_tx_ring(sc, &sc->txq[ac]); + wpi_free_tx_ring(sc, &sc->cmdq); + wpi_free_tx_ring(sc, &sc->svcq); + wpi_free_rx_ring(sc, &sc->rxq); + wpi_free_rpool(sc); + wpi_free_shared(sc); bus_teardown_intr(dev, sc->irq, sc->sc_ih); bus_release_resource(dev, SYS_RES_IRQ, sc->irq_rid, sc->irq); @@ -833,7 +836,11 @@ for (i = 0; i < WPI_RX_RING_COUNT; i++) { data = &ring->data[i]; +/* data->m = m_getcl(M_DONTWAIT, MT_DATA, 0); +*/ + data->m = NULL; + MGETHDR(data->m, M_DONTWAIT, MT_DATA); if (data->m == NULL) { device_printf(sc->sc_dev, "could not allocate rx mbuf\n"); @@ -850,8 +857,14 @@ } /* attach RxBuffer to mbuf */ + data->m->m_data = rbuf->vaddr; + data->m->m_len = data->m->m_pkthdr.len = WPI_RBUF_SIZE; +/* MEXTADD(data->m, rbuf->vaddr, WPI_RBUF_SIZE,wpi_free_rbuf, rbuf,EXT_NET_DRV,EXT_EXTREF); +*/ + MEXTADD(data->m, rbuf->vaddr, WPI_RBUF_SIZE, wpi_free_rbuf, + rbuf, 0, EXT_NET_DRV); if ((data->m->m_flags & M_EXT) == 0) { m_freem(data->m); return (ENOBUFS); @@ -1489,7 +1502,7 @@ struct wpi_rbuf *rbuf; struct ieee80211_frame *wh; struct ieee80211_node *ni; - struct mbuf *m, *mnew; + struct mbuf *m, *mnew = NULL; DPRINTFN(WPI_DEBUG_FUNC,("wpi_rx_intr\n")); @@ -1519,7 +1532,10 @@ return; } #endif +/* mnew = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); +*/ + MGETHDR(mnew, M_DONTWAIT, MT_DATA); if (mnew == NULL) { ifp->if_ierrors++; return; @@ -1532,7 +1548,13 @@ } /* attach Rx buffer to mbuf */ +/* MEXTADD(mnew,rbuf->vaddr,WPI_RBUF_SIZE,wpi_free_rbuf,rbuf,EXT_NET_DRV,EXT_EXTREF); +*/ + mnew->m_data = rbuf->vaddr; + mnew->m_len = mnew->m_pkthdr.len = WPI_RBUF_SIZE; + MEXTADD(mnew, rbuf->vaddr, WPI_RBUF_SIZE, wpi_free_rbuf, rbuf, + 0, EXT_NET_DRV); m = data->m; data->m = mnew;