summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorMichael Knudsen <mk@cvs.openbsd.org>2010-07-14 20:21:56 +0000
committerMichael Knudsen <mk@cvs.openbsd.org>2010-07-14 20:21:56 +0000
commitb0d2ea0deb8d39eb74153551380c56398992cee0 (patch)
tree845dc48916aa9688ff0044c7bc957f05b7ec8f1a /sys
parent0fba604b06f2153cd6694139b7605adbdc9c2119 (diff)
urndis_newbuf() is only called with NULL as it's third argument so just
get rid of it. ok armani
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/usb/if_urndis.c44
1 files changed, 18 insertions, 26 deletions
diff --git a/sys/dev/usb/if_urndis.c b/sys/dev/usb/if_urndis.c
index ec269ac3e3c..42b047acae5 100644
--- a/sys/dev/usb/if_urndis.c
+++ b/sys/dev/usb/if_urndis.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_urndis.c,v 1.21 2010/06/06 17:53:31 miod Exp $ */
+/* $OpenBSD: if_urndis.c,v 1.22 2010/07/14 20:21:55 mk Exp $ */
/*
* Copyright (c) 2010 Jonathan Armani <armani@openbsd.org>
@@ -69,7 +69,7 @@
#define DEVNAME(sc) ((sc)->sc_dev.dv_xname)
-int urndis_newbuf(struct urndis_softc *, struct urndis_chain *, struct mbuf *);
+int urndis_newbuf(struct urndis_softc *, struct urndis_chain *);
int urndis_ioctl(struct ifnet *, u_long, caddr_t);
void urndis_watchdog(struct ifnet *);
@@ -869,7 +869,7 @@ urndis_decap(struct urndis_softc *sc, struct urndis_chain *c, u_int32_t len)
s = splnet();
- if (urndis_newbuf(sc, c, NULL) == ENOBUFS) {
+ if (urndis_newbuf(sc, c) == ENOBUFS) {
ifp->if_ierrors++;
} else {
@@ -889,32 +889,24 @@ urndis_decap(struct urndis_softc *sc, struct urndis_chain *c, u_int32_t len)
}
int
-urndis_newbuf(struct urndis_softc *sc, struct urndis_chain *c, struct mbuf *m)
+urndis_newbuf(struct urndis_softc *sc, struct urndis_chain *c)
{
struct mbuf *m_new = NULL;
- if (m == NULL) {
- MGETHDR(m_new, M_DONTWAIT, MT_DATA);
- if (m_new == NULL) {
- printf("%s: no memory for rx list "
- "-- packet dropped!\n",
- DEVNAME(sc));
- return (ENOBUFS);
- }
- MCLGET(m_new, M_DONTWAIT);
- if (!(m_new->m_flags & M_EXT)) {
- printf("%s: no memory for rx list "
- "-- packet dropped!\n",
- DEVNAME(sc));
- m_freem(m_new);
- return (ENOBUFS);
- }
- m_new->m_len = m_new->m_pkthdr.len = MCLBYTES;
- } else {
- m_new = m;
- m_new->m_len = m_new->m_pkthdr.len = MCLBYTES;
- m_new->m_data = m_new->m_ext.ext_buf;
+ MGETHDR(m_new, M_DONTWAIT, MT_DATA);
+ if (m_new == NULL) {
+ printf("%s: no memory for rx list -- packet dropped!\n",
+ DEVNAME(sc));
+ return (ENOBUFS);
+ }
+ MCLGET(m_new, M_DONTWAIT);
+ if (!(m_new->m_flags & M_EXT)) {
+ printf("%s: no memory for rx list -- packet dropped!\n",
+ DEVNAME(sc));
+ m_freem(m_new);
+ return (ENOBUFS);
}
+ m_new->m_len = m_new->m_pkthdr.len = MCLBYTES;
m_adj(m_new, ETHER_ALIGN);
c->sc_mbuf = m_new;
@@ -934,7 +926,7 @@ urndis_rx_list_init(struct urndis_softc *sc)
c->sc_softc = sc;
c->sc_idx = i;
- if (urndis_newbuf(sc, c, NULL) == ENOBUFS)
+ if (urndis_newbuf(sc, c) == ENOBUFS)
return (ENOBUFS);
if (c->sc_xfer == NULL) {