svn commit: r256797 - user/andre/mbuf_staging/dev/wb
Andre Oppermann
andre at FreeBSD.org
Sun Oct 20 18:13:06 UTC 2013
Author: andre
Date: Sun Oct 20 18:13:06 2013
New Revision: 256797
URL: http://svnweb.freebsd.org/changeset/base/256797
Log:
Sorta fix the wb(4) driver to allocate complete mbuf+cluster
packets and remove the need for MEXTADD.
I don't believe the driver was in working condition before.
Untested due to lack of hardware.
Modified:
user/andre/mbuf_staging/dev/wb/if_wb.c
Modified: user/andre/mbuf_staging/dev/wb/if_wb.c
==============================================================================
--- user/andre/mbuf_staging/dev/wb/if_wb.c Sun Oct 20 17:47:40 2013 (r256796)
+++ user/andre/mbuf_staging/dev/wb/if_wb.c Sun Oct 20 18:13:06 2013 (r256797)
@@ -142,7 +142,6 @@ static int wb_probe(device_t);
static int wb_attach(device_t);
static int wb_detach(device_t);
-static int wb_bfree(struct mbuf *, void *addr, void *args, int action);
static int wb_newbuf(struct wb_softc *, struct wb_chain_onefrag *,
struct mbuf *);
static int wb_encap(struct wb_softc *, struct wb_chain *, struct mbuf *);
@@ -822,13 +821,6 @@ wb_list_rx_init(sc)
return(0);
}
-static int
-wb_bfree(struct mbuf *m, void *buf, void *args, int action)
-{
-
- return (EXT_FREE_OK);
-}
-
/*
* Initialize an RX descriptor and attach an MBUF cluster.
*/
@@ -841,13 +833,10 @@ wb_newbuf(sc, c, m)
struct mbuf *m_new = NULL;
if (m == NULL) {
- MGETHDR(m_new, M_NOWAIT, MT_DATA);
+ m_new = m_getcl(M_NOWAIT, MT_DATA, 0);
if (m_new == NULL)
return(ENOBUFS);
- m_new->m_data = c->wb_buf;
m_new->m_pkthdr.len = m_new->m_len = WB_BUFBYTES;
- MEXTADD(m_new, c->wb_buf, WB_BUFBYTES, wb_bfree, c->wb_buf,
- NULL, 0, EXT_NET_DRV);
} else {
m_new = m;
m_new->m_len = m_new->m_pkthdr.len = WB_BUFBYTES;
More information about the svn-src-user
mailing list