summaryrefslogtreecommitdiffstats
path: root/sys/dev
diff options
context:
space:
mode:
authorandre <andre@FreeBSD.org>2013-08-25 10:57:09 +0000
committerandre <andre@FreeBSD.org>2013-08-25 10:57:09 +0000
commit6c0efad132654ea9bfc4e58975d1d58ce8d4b424 (patch)
treec06b97898de2cde2e64243afc1672aebf11ef915 /sys/dev
parent8e41c705d027e43af7d37c3bc669b20ac317fd2b (diff)
downloadFreeBSD-src-6c0efad132654ea9bfc4e58975d1d58ce8d4b424.zip
FreeBSD-src-6c0efad132654ea9bfc4e58975d1d58ce8d4b424.tar.gz
Give (*ext_free) an int return value allowing for very sophisticated
external mbuf buffer management capabilities in the future. For now only EXT_FREE_OK is defined with current legacy behavior. Sponsored by: The FreeBSD Foundation
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/cas/if_cas.c7
-rw-r--r--sys/dev/hatm/if_hatm_intr.c10
-rw-r--r--sys/dev/if_ndis/if_ndis.c4
-rw-r--r--sys/dev/iscsi_initiator/isc_soc.c3
-rw-r--r--sys/dev/lge/if_lge.c6
-rw-r--r--sys/dev/mwl/if_mwl.c3
-rw-r--r--sys/dev/wb/if_wb.c9
7 files changed, 23 insertions, 19 deletions
diff --git a/sys/dev/cas/if_cas.c b/sys/dev/cas/if_cas.c
index f9f28ca..4f38a25 100644
--- a/sys/dev/cas/if_cas.c
+++ b/sys/dev/cas/if_cas.c
@@ -132,7 +132,7 @@ static void cas_detach(struct cas_softc *sc);
static int cas_disable_rx(struct cas_softc *sc);
static int cas_disable_tx(struct cas_softc *sc);
static void cas_eint(struct cas_softc *sc, u_int status);
-static void cas_free(struct mbuf *m, void *arg1, void* arg2);
+static int cas_free(struct mbuf *m, void *arg1, void* arg2);
static void cas_init(void *xsc);
static void cas_init_locked(struct cas_softc *sc);
static void cas_init_regs(struct cas_softc *sc);
@@ -1887,7 +1887,7 @@ cas_rint(struct cas_softc *sc)
#endif
}
-static void
+static int
cas_free(struct mbuf *m, void *arg1, void *arg2)
{
struct cas_rxdsoft *rxds;
@@ -1904,7 +1904,7 @@ cas_free(struct mbuf *m, void *arg1, void *arg2)
rxds = &sc->sc_rxdsoft[idx];
#endif
if (refcount_release(&rxds->rxds_refcount) == 0)
- return;
+ return (EXT_FREE_OK);
/*
* NB: this function can be called via m_freem(9) within
@@ -1915,6 +1915,7 @@ cas_free(struct mbuf *m, void *arg1, void *arg2)
cas_add_rxdesc(sc, idx);
if (locked == 0)
CAS_UNLOCK(sc);
+ return (EXT_FREE_OK);
}
static inline void
diff --git a/sys/dev/hatm/if_hatm_intr.c b/sys/dev/hatm/if_hatm_intr.c
index d23f119..697dd2b 100644
--- a/sys/dev/hatm/if_hatm_intr.c
+++ b/sys/dev/hatm/if_hatm_intr.c
@@ -260,7 +260,7 @@ hatm_mbuf_page_alloc(struct hatm_softc *sc, u_int group)
/*
* Free an mbuf and put it onto the free list.
*/
-static void
+static int
hatm_mbuf0_free(struct mbuf *m, void *buf, void *args)
{
struct hatm_softc *sc = args;
@@ -270,8 +270,9 @@ hatm_mbuf0_free(struct mbuf *m, void *buf, void *args)
("freeing unused mbuf %x", c->hdr.flags));
c->hdr.flags &= ~MBUF_USED;
hatm_ext_free(&sc->mbuf_list[0], (struct mbufx_free *)c);
+ return (EXT_FREE_OK);
}
-static void
+static int
hatm_mbuf1_free(struct mbuf *m, void *buf, void *args)
{
struct hatm_softc *sc = args;
@@ -281,6 +282,7 @@ hatm_mbuf1_free(struct mbuf *m, void *buf, void *args)
("freeing unused mbuf %x", c->hdr.flags));
c->hdr.flags &= ~MBUF_USED;
hatm_ext_free(&sc->mbuf_list[1], (struct mbufx_free *)c);
+ return (EXT_FREE_OK);
}
static void
@@ -461,7 +463,7 @@ hatm_rx_buffer(struct hatm_softc *sc, u_int group, u_int handle)
hatm_mbuf0_free, c0, sc, M_PKTHDR, EXT_EXTREF);
m->m_data += MBUF0_OFFSET;
} else
- hatm_mbuf0_free(NULL, c0, sc);
+ (void)hatm_mbuf0_free(NULL, c0, sc);
} else {
struct mbuf1_chunk *c1;
@@ -485,7 +487,7 @@ hatm_rx_buffer(struct hatm_softc *sc, u_int group, u_int handle)
hatm_mbuf1_free, c1, sc, M_PKTHDR, EXT_EXTREF);
m->m_data += MBUF1_OFFSET;
} else
- hatm_mbuf1_free(NULL, c1, sc);
+ (void)hatm_mbuf1_free(NULL, c1, sc);
}
return (m);
diff --git a/sys/dev/if_ndis/if_ndis.c b/sys/dev/if_ndis/if_ndis.c
index a62b913..01388c9 100644
--- a/sys/dev/if_ndis/if_ndis.c
+++ b/sys/dev/if_ndis/if_ndis.c
@@ -1401,7 +1401,7 @@ ndis_rxeof(adapter, packets, pktcnt)
p = packets[i];
if (p->np_oob.npo_status == NDIS_STATUS_SUCCESS) {
p->np_refcnt++;
- ndis_return_packet(p, block);
+ (void)ndis_return_packet(NULL ,p, block);
}
}
return;
@@ -1414,7 +1414,7 @@ ndis_rxeof(adapter, packets, pktcnt)
if (ndis_ptom(&m0, p)) {
device_printf(sc->ndis_dev, "ptom failed\n");
if (p->np_oob.npo_status == NDIS_STATUS_SUCCESS)
- ndis_return_packet(p, block);
+ (void)ndis_return_packet(NULL, p, block);
} else {
#ifdef notdef
if (p->np_oob.npo_status == NDIS_STATUS_RESOURCES) {
diff --git a/sys/dev/iscsi_initiator/isc_soc.c b/sys/dev/iscsi_initiator/isc_soc.c
index 6507236..a08ecfa 100644
--- a/sys/dev/iscsi_initiator/isc_soc.c
+++ b/sys/dev/iscsi_initiator/isc_soc.c
@@ -68,7 +68,7 @@ static int ou_refcnt = 0;
/*
| function for freeing external storage for mbuf
*/
-static void
+static int
ext_free(struct mbuf *m, void *a, void *b)
{
pduq_t *pq = b;
@@ -78,6 +78,7 @@ ext_free(struct mbuf *m, void *a, void *b)
free(pq->buf, M_ISCSIBUF);
pq->buf = NULL;
}
+ return (EXT_FREE_OK);
}
int
diff --git a/sys/dev/lge/if_lge.c b/sys/dev/lge/if_lge.c
index e57bbfb..5fc763d 100644
--- a/sys/dev/lge/if_lge.c
+++ b/sys/dev/lge/if_lge.c
@@ -122,7 +122,7 @@ static int lge_detach(device_t);
static int lge_alloc_jumbo_mem(struct lge_softc *);
static void lge_free_jumbo_mem(struct lge_softc *);
static void *lge_jalloc(struct lge_softc *);
-static void lge_jfree(struct mbuf *, void *, void *);
+static int lge_jfree(struct mbuf *, void *, void *);
static int lge_newbuf(struct lge_softc *, struct lge_rx_desc *, struct mbuf *);
static int lge_encap(struct lge_softc *, struct mbuf *, u_int32_t *);
@@ -846,7 +846,7 @@ lge_jalloc(sc)
/*
* Release a jumbo buffer.
*/
-static void
+static int
lge_jfree(struct mbuf *m, void *buf, void *args)
{
struct lge_softc *sc;
@@ -873,7 +873,7 @@ lge_jfree(struct mbuf *m, void *buf, void *args)
SLIST_REMOVE_HEAD(&sc->lge_jinuse_listhead, jpool_entries);
SLIST_INSERT_HEAD(&sc->lge_jfree_listhead, entry, jpool_entries);
- return;
+ return (EXT_FREE_OK);
}
/*
diff --git a/sys/dev/mwl/if_mwl.c b/sys/dev/mwl/if_mwl.c
index ecc74a5..bf66962 100644
--- a/sys/dev/mwl/if_mwl.c
+++ b/sys/dev/mwl/if_mwl.c
@@ -2621,7 +2621,7 @@ mwl_rxbuf_init(struct mwl_softc *sc, struct mwl_rxbuf *bf)
return 0;
}
-static void
+static int
mwl_ext_free(struct mbuf *m, void *data, void *arg)
{
struct mwl_softc *sc = arg;
@@ -2637,6 +2637,7 @@ mwl_ext_free(struct mbuf *m, void *data, void *arg)
sc->sc_rxblocked = 0;
mwl_hal_intrset(sc->sc_mh, sc->sc_imask);
}
+ return (EXT_FREE_OK);
}
struct mwl_frame_bar {
diff --git a/sys/dev/wb/if_wb.c b/sys/dev/wb/if_wb.c
index 8bc28ea..f96441c 100644
--- a/sys/dev/wb/if_wb.c
+++ b/sys/dev/wb/if_wb.c
@@ -142,7 +142,7 @@ static int wb_probe(device_t);
static int wb_attach(device_t);
static int wb_detach(device_t);
-static void wb_bfree(void *addr, void *args);
+static int wb_bfree(struct mbuf *, void *addr, void *args);
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,12 +822,11 @@ wb_list_rx_init(sc)
return(0);
}
-static void
-wb_bfree(buf, args)
- void *buf;
- void *args;
+static int
+wb_bfree(struct mbuf *m, void *buf, void *args)
{
+ return (EXT_FREE_OK);
}
/*
OpenPOWER on IntegriCloud