Intel 3945ABG
Doug Ambrisko
ambrisko at ambrisko.com
Tue Apr 3 18:43:08 UTC 2007
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;
More information about the freebsd-current
mailing list