there's no need to do it in m_devget(9).
Stop passing an ``ifp'' will help for upcoming interface pointer -> index
conversion.
While here remove unused ``ifp'' argument from m_clget(9) and kill two
birds^W layer violations in one commit.
ok henning@
-/* $OpenBSD: hme.c,v 1.68 2015/04/08 10:07:47 mpi Exp $ */
+/* $OpenBSD: hme.c,v 1.69 2015/04/13 08:45:48 mpi Exp $ */
/*
* Copyright (c) 1998 Jason L. Wright (jason@thought.net)
/* Pull packet off interface. */
m = m_devget(sc->sc_bufs->rx_buf[idx] + HME_RX_OFFSET, len,
- HME_RX_OFFSET, &sc->sc_arpcom.ac_if);
+ HME_RX_OFFSET);
if (m == NULL) {
ifp->if_ierrors++;
return;
-/* $OpenBSD: vnet.c,v 1.43 2015/04/02 09:46:48 kettenis Exp $ */
+/* $OpenBSD: vnet.c,v 1.44 2015/04/13 08:45:48 mpi Exp $ */
/*
* Copyright (c) 2009, 2015 Mark Kettenis
*
}
/* Stupid OBP doesn't align properly. */
- m = m_devget(buf, dm->nbytes, ETHER_ALIGN, ifp);
+ m = m_devget(buf, dm->nbytes, ETHER_ALIGN);
pool_put(&sc->sc_pool, buf);
if (m == NULL) {
ifp->if_ierrors++;
-/* $OpenBSD: dc.c,v 1.139 2015/03/14 03:38:47 jsg Exp $ */
+/* $OpenBSD: dc.c,v 1.140 2015/04/13 08:45:48 mpi Exp $ */
/*
* Copyright (c) 1997, 1998, 1999
/* No errors; receive the packet. */
total_len -= ETHER_CRC_LEN;
- m0 = m_devget(mtod(m, char *), total_len, ETHER_ALIGN, ifp);
+ m0 = m_devget(mtod(m, char *), total_len, ETHER_ALIGN);
dc_newbuf(sc, i, m);
DC_INC(i, DC_RX_LIST_CNT);
if (m0 == NULL) {
-/* $OpenBSD: mtd8xx.c,v 1.25 2015/04/08 12:58:24 mpi Exp $ */
+/* $OpenBSD: mtd8xx.c,v 1.26 2015/04/13 08:45:48 mpi Exp $ */
/*
* Copyright (c) 2003 Oleg Safiullin <form@pdp11.org.ru>
0, sc->mtd_cdata.mtd_rx_chain[i].sd_map->dm_mapsize,
BUS_DMASYNC_POSTREAD);
- m0 = m_devget(mtod(m, char *), total_len, ETHER_ALIGN, ifp);
+ m0 = m_devget(mtod(m, char *), total_len, ETHER_ALIGN);
mtd_newbuf(sc, i, m);
i = (i + 1) % MTD_RX_LIST_CNT;
if (m0 == NULL) {
-/* $OpenBSD: rtl81x9.c,v 1.89 2015/03/30 10:04:11 mpi Exp $ */
+/* $OpenBSD: rtl81x9.c,v 1.90 2015/04/13 08:45:48 mpi Exp $ */
/*
* Copyright (c) 1997, 1998
wrap = (sc->rl_cdata.rl_rx_buf + RL_RXBUFLEN) - rxbufpos;
if (total_len > wrap) {
- m = m_devget(rxbufpos, wrap, ETHER_ALIGN, ifp);
+ m = m_devget(rxbufpos, wrap, ETHER_ALIGN);
if (m != NULL) {
m_copyback(m, wrap, total_len - wrap,
sc->rl_cdata.rl_rx_buf, M_NOWAIT);
}
cur_rx = (total_len - wrap + ETHER_CRC_LEN);
} else {
- m = m_devget(rxbufpos, total_len, ETHER_ALIGN, ifp);
+ m = m_devget(rxbufpos, total_len, ETHER_ALIGN);
cur_rx += total_len + 4 + ETHER_CRC_LEN;
}
-/* $OpenBSD: if_ale.c,v 1.37 2015/03/24 10:09:06 mpi Exp $ */
+/* $OpenBSD: if_ale.c,v 1.38 2015/04/13 08:45:48 mpi Exp $ */
/*-
* Copyright (c) 2008, Pyun YongHyeon <yongari@FreeBSD.org>
* All rights reserved.
* on these low-end consumer ethernet controller.
*/
m = m_devget((char *)(rs + 1), length - ETHER_CRC_LEN,
- ETHER_ALIGN, ifp);
+ ETHER_ALIGN);
if (m == NULL) {
ifp->if_iqdrops++;
ale_rx_update_page(sc, &rx_page, length, &prod);
-/* $OpenBSD: if_bce.c,v 1.44 2015/04/08 10:07:47 mpi Exp $ */
+/* $OpenBSD: if_bce.c,v 1.45 2015/04/13 08:45:48 mpi Exp $ */
/* $NetBSD: if_bce.c,v 1.3 2003/09/29 01:53:02 mrg Exp $ */
/*
len -= ETHER_CRC_LEN;
m = m_devget(sc->bce_data + i * MCLBYTES +
- BCE_PREPKT_HEADER_SIZE, len, ETHER_ALIGN, ifp);
+ BCE_PREPKT_HEADER_SIZE, len, ETHER_ALIGN);
ifp->if_ipackets++;
ml_enqueue(&ml, m);
-/* $OpenBSD: if_cas.c,v 1.39 2015/03/14 03:38:48 jsg Exp $ */
+/* $OpenBSD: if_cas.c,v 1.40 2015/04/13 08:45:48 mpi Exp $ */
/*
*
rxs->rxs_dmamap->dm_mapsize, BUS_DMASYNC_POSTREAD);
cp = rxs->rxs_kva + off * 256 + ETHER_ALIGN;
- m = m_devget(cp, len, ETHER_ALIGN, ifp);
+ m = m_devget(cp, len, ETHER_ALIGN);
if (word[0] & CAS_RC0_RELEASE_HDR)
cas_add_rxbuf(sc, idx);
/* XXX We should not be copying the packet here. */
cp = rxs->rxs_kva + off + ETHER_ALIGN;
- m = m_devget(cp, len, ETHER_ALIGN, ifp);
+ m = m_devget(cp, len, ETHER_ALIGN);
if (word[0] & CAS_RC0_RELEASE_DATA)
cas_add_rxbuf(sc, idx);
-/* $OpenBSD: if_lge.c,v 1.65 2015/04/08 10:07:47 mpi Exp $ */
+/* $OpenBSD: if_lge.c,v 1.66 2015/04/13 08:45:48 mpi Exp $ */
/*
* Copyright (c) 2001 Wind River Systems
* Copyright (c) 1997, 1998, 1999, 2000, 2001
}
if (lge_newbuf(sc, &LGE_RXTAIL(sc), NULL) == ENOBUFS) {
- m0 = m_devget(mtod(m, char *), total_len, ETHER_ALIGN,
- ifp);
+ m0 = m_devget(mtod(m, char *), total_len, ETHER_ALIGN);
lge_newbuf(sc, &LGE_RXTAIL(sc), m);
if (m0 == NULL) {
ifp->if_ierrors++;
-/* $OpenBSD: if_nge.c,v 1.82 2015/04/08 10:07:47 mpi Exp $ */
+/* $OpenBSD: if_nge.c,v 1.83 2015/04/13 08:45:48 mpi Exp $ */
/*
* Copyright (c) 2001 Wind River Systems
* Copyright (c) 1997, 1998, 1999, 2000, 2001
*/
if (nge_newbuf(sc, cur_rx, NULL) == ENOBUFS) {
#endif
- m0 = m_devget(mtod(m, char *), total_len,
- ETHER_ALIGN, ifp);
+ m0 = m_devget(mtod(m, char *), total_len, ETHER_ALIGN);
nge_newbuf(sc, cur_rx, m);
if (m0 == NULL) {
ifp->if_ierrors++;
-/* $OpenBSD: if_sis.c,v 1.125 2015/03/30 10:01:21 mpi Exp $ */
+/* $OpenBSD: if_sis.c,v 1.126 2015/04/13 08:45:48 mpi Exp $ */
/*
* Copyright (c) 1997, 1998, 1999
* Bill Paul <wpaul@ctr.columbia.edu>. All rights reserved.
*/
{
struct mbuf *m0;
- m0 = m_devget(mtod(m, char *), total_len, ETHER_ALIGN,
- ifp);
+ m0 = m_devget(mtod(m, char *), total_len, ETHER_ALIGN);
m_freem(m);
if (m0 == NULL) {
ifp->if_ierrors++;
-/* $OpenBSD: if_vge.c,v 1.61 2015/04/08 10:07:47 mpi Exp $ */
+/* $OpenBSD: if_vge.c,v 1.62 2015/04/13 08:45:48 mpi Exp $ */
/* $FreeBSD: if_vge.c,v 1.3 2004/09/11 22:13:25 wpaul Exp $ */
/*
* Copyright (c) 2004
}
m0 = m_devget(mtod(m, char *),
- total_len - ETHER_CRC_LEN, ETHER_ALIGN, ifp);
+ total_len - ETHER_CRC_LEN, ETHER_ALIGN);
vge_newbuf(sc, i, m);
if (m0 == NULL) {
ifp->if_ierrors++;
-/* $OpenBSD: if_vr.c,v 1.139 2015/03/14 03:38:48 jsg Exp $ */
+/* $OpenBSD: if_vr.c,v 1.140 2015/04/13 08:45:48 mpi Exp $ */
/*
* Copyright (c) 1997, 1998
#ifdef __STRICT_ALIGNMENT
{
struct mbuf *m0;
- m0 = m_devget(mtod(m, caddr_t), total_len,
- ETHER_ALIGN, ifp);
+ m0 = m_devget(mtod(m, caddr_t), total_len, ETHER_ALIGN);
m_freem(m);
if (m0 == NULL) {
ifp->if_ierrors++;
-/* $OpenBSD: if_wb.c,v 1.59 2015/04/08 10:07:47 mpi Exp $ */
+/* $OpenBSD: if_wb.c,v 1.60 2015/04/13 08:45:48 mpi Exp $ */
/*
* Copyright (c) 1997, 1998
total_len -= ETHER_CRC_LEN;
m = m_devget(cur_rx->wb_buf + sizeof(u_int64_t), total_len,
- ETHER_ALIGN, ifp);
+ ETHER_ALIGN);
wb_newbuf(sc, cur_rx);
if (m == NULL) {
ifp->if_ierrors++;
-/* $OpenBSD: if_malo.c,v 1.83 2015/04/08 10:07:47 mpi Exp $ */
+/* $OpenBSD: if_malo.c,v 1.84 2015/04/13 08:45:48 mpi Exp $ */
/*
* Copyright (c) 2007 Marcus Glocker <mglocker@openbsd.org>
/* prepare mbuf */
m = m_devget(sc->sc_data + rxdesc->pkgoffset,
- rxdesc->pkglen, ETHER_ALIGN, ifp);
+ rxdesc->pkglen, ETHER_ALIGN);
if (m == NULL) {
DPRINTF(1, "RX m_devget failed\n");
ifp->if_ierrors++;
-/* $OpenBSD: if_upgt.c,v 1.67 2015/03/14 03:38:49 jsg Exp $ */
+/* $OpenBSD: if_upgt.c,v 1.68 2015/04/13 08:45:48 mpi Exp $ */
/*
* Copyright (c) 2007 Marcus Glocker <mglocker@openbsd.org>
rxdesc = (struct upgt_lmac_rx_desc *)data;
/* create mbuf which is suitable for strict alignment archs */
- m = m_devget(rxdesc->data, pkglen, ETHER_ALIGN, ifp);
+ m = m_devget(rxdesc->data, pkglen, ETHER_ALIGN);
if (m == NULL) {
DPRINTF(1, "%s: could not create RX mbuf!\n", sc->sc_dev.dv_xname);
ifp->if_ierrors++;
-/* $OpenBSD: uipc_mbuf.c,v 1.202 2015/03/14 03:38:51 jsg Exp $ */
+/* $OpenBSD: uipc_mbuf.c,v 1.203 2015/04/13 08:45:48 mpi Exp $ */
/* $NetBSD: uipc_mbuf.c,v 1.15.4.1 1996/06/13 17:11:44 cgd Exp $ */
/*
}
struct mbuf *
-m_clget(struct mbuf *m, int how, struct ifnet *ifp, u_int pktlen)
+m_clget(struct mbuf *m, int how, u_int pktlen)
{
struct mbuf *m0 = NULL;
struct pool *pp;
* Routine to copy from device local memory into mbufs.
*/
struct mbuf *
-m_devget(char *buf, int totlen, int off, struct ifnet *ifp)
+m_devget(char *buf, int totlen, int off)
{
struct mbuf *m;
struct mbuf *top, **mp;
if (m == NULL)
return (NULL);
- m->m_pkthdr.rcvif = ifp;
m->m_pkthdr.len = totlen;
len = MHLEN;
-/* $OpenBSD: pfkeyv2.c,v 1.139 2015/03/26 12:21:37 mikeb Exp $ */
+/* $OpenBSD: pfkeyv2.c,v 1.140 2015/04/13 08:45:48 mpi Exp $ */
/*
* @(#)COPYRIGHT 1.1 (NRL) 17 January 1995
int
pfdatatopacket(void *data, int len, struct mbuf **packet)
{
- if (!(*packet = m_devget(data, len, 0, NULL)))
+ if (!(*packet = m_devget(data, len, 0)))
return (ENOMEM);
/* Make sure, all data gets zeroized on free */
-/* $OpenBSD: mbuf.h,v 1.188 2015/04/10 11:02:12 dlg Exp $ */
+/* $OpenBSD: mbuf.h,v 1.189 2015/04/13 08:45:48 mpi Exp $ */
/* $NetBSD: mbuf.h,v 1.19 1996/02/09 18:25:14 christos Exp $ */
/*
MCLINITREFERENCE(m); \
} while (/* CONSTCOND */ 0)
-#define MCLGET(m, how) (void) m_clget((m), (how), NULL, MCLBYTES)
-#define MCLGETI(m, how, ifp, l) m_clget((m), (how), (ifp), (l))
+#define MCLGET(m, how) (void) m_clget((m), (how), MCLBYTES)
+#define MCLGETI(m, how, ifp, l) m_clget((m), (how), (l))
/*
* MFREE(struct mbuf *m, struct mbuf *n)
struct mbuf *m_getptr(struct mbuf *, int, int *);
int m_leadingspace(struct mbuf *);
int m_trailingspace(struct mbuf *);
-struct mbuf *m_clget(struct mbuf *, int, struct ifnet *, u_int);
+struct mbuf *m_clget(struct mbuf *, int, u_int);
void m_extref(struct mbuf *, struct mbuf *);
void m_extfree_pool(caddr_t, u_int, void *);
void m_adj(struct mbuf *, int);
void m_reclaim(void *, int);
void m_copydata(struct mbuf *, int, int, caddr_t);
void m_cat(struct mbuf *, struct mbuf *);
-struct mbuf *m_devget(char *, int, int, struct ifnet *);
+struct mbuf *m_devget(char *, int, int);
int m_apply(struct mbuf *, int, int,
int (*)(caddr_t, caddr_t, unsigned int), caddr_t);
int m_dup_pkthdr(struct mbuf *, struct mbuf *, int);