summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authoraugustss <augustss@NetBSD.org>2000-03-30 00:18:17 +0000
committeraugustss <augustss@NetBSD.org>2000-03-30 00:18:17 +0000
commitdd7160dcbae576cdcabe3c932f830fbaa0fcdf6f (patch)
tree34016d4f792784849276138647ea31843a570219 /sys
parentfc4d9ff403d029b00d502427026356f615923e44 (diff)
Afew more OpenBSD portability fixes.
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/usb/if_aue.c9
-rw-r--r--sys/dev/usb/if_cue.c9
-rw-r--r--sys/dev/usb/if_kue.c9
-rw-r--r--sys/dev/usb/usb_port.h9
-rw-r--r--sys/dev/usb/usbdivar.h4
5 files changed, 31 insertions, 9 deletions
diff --git a/sys/dev/usb/if_aue.c b/sys/dev/usb/if_aue.c
index 2a674cf84cb..34a67ef97bb 100644
--- a/sys/dev/usb/if_aue.c
+++ b/sys/dev/usb/if_aue.c
@@ -1,4 +1,4 @@
-/* $NetBSD: if_aue.c,v 1.35 2000/03/29 18:24:52 augustss Exp $ */
+/* $NetBSD: if_aue.c,v 1.36 2000/03/30 00:18:17 augustss Exp $ */
/*
* Copyright (c) 1997, 1998, 1999, 2000
* Bill Paul <wpaul@ee.columbia.edu>. All rights reserved.
@@ -890,6 +890,9 @@ USB_ATTACH(aue)
ifp->if_ioctl = aue_ioctl;
ifp->if_start = aue_start;
ifp->if_watchdog = aue_watchdog;
+#if defined(__OpenBSD__)
+ ifp->if_snd.ifq_maxlen = IFQ_MAXLEN;
+#endif
strncpy(ifp->if_xname, USBDEVNAME(sc->aue_dev), IFNAMSIZ);
/* Initialize MII/media info. */
@@ -1270,9 +1273,9 @@ aue_rxeof(xfer, priv, status)
* address or the interface is in promiscuous mode.
*/
if (ifp->if_bpf) {
+#if defined(__NetBSD__)
struct ether_header *eh = mtod(m, struct ether_header *);
BPF_MTAP(ifp, m);
-#if defined(__NetBSD__)
if ((ifp->if_flags & IFF_PROMISC) &&
memcmp(eh->ether_dhost, LLADDR(ifp->if_sadl),
ETHER_ADDR_LEN) &&
@@ -1280,6 +1283,8 @@ aue_rxeof(xfer, priv, status)
m_freem(m);
goto done1;
}
+#else
+ BPF_MTAP(ifp, m);
#endif
}
#endif
diff --git a/sys/dev/usb/if_cue.c b/sys/dev/usb/if_cue.c
index a7e36389fb8..4c726b56f9c 100644
--- a/sys/dev/usb/if_cue.c
+++ b/sys/dev/usb/if_cue.c
@@ -1,4 +1,4 @@
-/* $NetBSD: if_cue.c,v 1.18 2000/03/29 18:24:52 augustss Exp $ */
+/* $NetBSD: if_cue.c,v 1.19 2000/03/30 00:18:17 augustss Exp $ */
/*
* Copyright (c) 1997, 1998, 1999, 2000
* Bill Paul <wpaul@ee.columbia.edu>. All rights reserved.
@@ -717,6 +717,9 @@ USB_ATTACH(cue)
ifp->if_ioctl = cue_ioctl;
ifp->if_start = cue_start;
ifp->if_watchdog = cue_watchdog;
+#if defined(__OpenBSD__)
+ ifp->if_snd.ifq_maxlen = IFQ_MAXLEN
+#endif
strncpy(ifp->if_xname, USBDEVNAME(sc->cue_dev), IFNAMSIZ);
/* Attach the interface. */
@@ -1030,9 +1033,9 @@ cue_rxeof(xfer, priv, status)
* address or the interface is in promiscuous mode.
*/
if (ifp->if_bpf) {
+#if defined(__NetBSD__)
struct ether_header *eh = mtod(m, struct ether_header *);
BPF_MTAP(ifp, m);
-#if defined(__NetBSD__)
if ((ifp->if_flags & IFF_PROMISC) &&
memcmp(eh->ether_dhost, LLADDR(ifp->if_sadl),
ETHER_ADDR_LEN) &&
@@ -1040,6 +1043,8 @@ cue_rxeof(xfer, priv, status)
m_freem(m);
goto done1;
}
+#else
+ BPF_MTAP(ifp, m);
#endif
}
#endif
diff --git a/sys/dev/usb/if_kue.c b/sys/dev/usb/if_kue.c
index 9c43f540187..45bc3d4d52e 100644
--- a/sys/dev/usb/if_kue.c
+++ b/sys/dev/usb/if_kue.c
@@ -1,4 +1,4 @@
-/* $NetBSD: if_kue.c,v 1.26 2000/03/29 18:24:53 augustss Exp $ */
+/* $NetBSD: if_kue.c,v 1.27 2000/03/30 00:18:17 augustss Exp $ */
/*
* Copyright (c) 1997, 1998, 1999, 2000
* Bill Paul <wpaul@ee.columbia.edu>. All rights reserved.
@@ -673,6 +673,9 @@ USB_ATTACH(kue)
ifp->if_ioctl = kue_ioctl;
ifp->if_start = kue_start;
ifp->if_watchdog = kue_watchdog;
+#if defined(__OpenBSD__)
+ ifp->if_snd.ifq_maxlen = IFQ_MAXLEN;
+#endif
strncpy(ifp->if_xname, USBDEVNAME(sc->kue_dev), IFNAMSIZ);
/* Attach the interface. */
@@ -990,9 +993,9 @@ kue_rxeof(xfer, priv, status)
* address or the interface is in promiscuous mode.
*/
if (ifp->if_bpf) {
+#if defined(__NetBSD__)
struct ether_header *eh = mtod(m, struct ether_header *);
BPF_MTAP(ifp, m);
-#if defined(__NetBSD__)
if ((ifp->if_flags & IFF_PROMISC) &&
memcmp(eh->ether_dhost, LLADDR(ifp->if_sadl),
ETHER_ADDR_LEN) &&
@@ -1000,6 +1003,8 @@ kue_rxeof(xfer, priv, status)
m_freem(m);
goto done1;
}
+#else
+ BPF_MTAP(ifp, m);
#endif
}
#endif
diff --git a/sys/dev/usb/usb_port.h b/sys/dev/usb/usb_port.h
index 6bbb91790c8..dcccd207c8d 100644
--- a/sys/dev/usb/usb_port.h
+++ b/sys/dev/usb/usb_port.h
@@ -1,4 +1,4 @@
-/* $NetBSD: usb_port.h,v 1.26 2000/03/29 18:24:53 augustss Exp $ */
+/* $NetBSD: usb_port.h,v 1.27 2000/03/30 00:18:18 augustss Exp $ */
/* $FreeBSD: src/sys/dev/usb/usb_port.h,v 1.21 1999/11/17 22:33:47 n_hibma Exp $ */
/*
@@ -198,7 +198,10 @@ __CONCAT(dname,_detach)(self, flags) \
#define mii_attach(x1,x2,x3,x4,x5,x6) mii_phy_probe(x1,x2,x3)
#define Ether_ifattach(ifp, eaddr) ether_ifattach(ifp)
#define if_deactivate(x)
-#define IF_INPUT(ifp, m) ether_input((ifp), mtod((m), struct ether_header *), (m))
+#define IF_INPUT(ifp, m) do { \
+ m_adj(m, sizeof(struct ether_header)); \
+ ether_input((ifp), mtod((m), struct ether_header *), (m)); \
+} while (0)
#define usbpoll usbselect
#define uhidpoll uhidselect
@@ -217,6 +220,8 @@ __CONCAT(dname,_detach)(self, flags) \
#define realloc usb_realloc
void *usb_realloc __P((void *, u_int, int, int));
+extern int cold;
+
typedef struct device *device_ptr_t;
#define USBBASEDEVICE struct device
#define USBDEV(bdev) (&(bdev))
diff --git a/sys/dev/usb/usbdivar.h b/sys/dev/usb/usbdivar.h
index 6f6d81901b9..70c3081b18e 100644
--- a/sys/dev/usb/usbdivar.h
+++ b/sys/dev/usb/usbdivar.h
@@ -1,4 +1,4 @@
-/* $NetBSD: usbdivar.h,v 1.54 2000/03/29 03:59:43 simonb Exp $ */
+/* $NetBSD: usbdivar.h,v 1.55 2000/03/30 00:18:18 augustss Exp $ */
/* $FreeBSD: src/sys/dev/usb/usbdivar.h,v 1.11 1999/11/17 22:33:51 n_hibma Exp $ */
/*
@@ -38,7 +38,9 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
+#if defined(__NetBSD__)
#include <sys/callout.h>
+#endif
/* From usb_mem.h */
DECLARE_USB_DMA_T;