summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorMarc Balmer <mbalmer@cvs.openbsd.org>2007-06-04 10:34:05 +0000
committerMarc Balmer <mbalmer@cvs.openbsd.org>2007-06-04 10:34:05 +0000
commite3b8f0e33e350d79d720bc14dc8076e8fc653e13 (patch)
tree25633eb3012d656fb4d1ac2dcec201cb9b4a6175 /sys
parent9de2d85fb9a6ed44d53a03d680c99999da003cfc (diff)
Last part of FreeBSD/NetBSD sepcific code removal.
ok jsg@
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/usb/Makefile4
-rw-r--r--sys/dev/usb/devlist2h.awk20
-rw-r--r--sys/dev/usb/ehci.c12
-rw-r--r--sys/dev/usb/hid.c5
-rw-r--r--sys/dev/usb/if_aue.c31
-rw-r--r--sys/dev/usb/if_auereg.h14
-rw-r--r--sys/dev/usb/if_axereg.h8
-rw-r--r--sys/dev/usb/if_cue.c32
-rw-r--r--sys/dev/usb/if_cuereg.h7
-rw-r--r--sys/dev/usb/if_kue.c33
-rw-r--r--sys/dev/usb/if_kuereg.h7
-rw-r--r--sys/dev/usb/if_udavreg.h10
-rw-r--r--sys/dev/usb/if_url.c24
-rw-r--r--sys/dev/usb/if_urlreg.h10
-rw-r--r--sys/dev/usb/uaudio.c14
-rw-r--r--sys/dev/usb/uhcivar.h5
-rw-r--r--sys/dev/usb/uhid.c21
-rw-r--r--sys/dev/usb/uhidev.c12
-rw-r--r--sys/dev/usb/uhidev.h8
-rw-r--r--sys/dev/usb/ukbd.c6
-rw-r--r--sys/dev/usb/umass_quirks.c7
-rw-r--r--sys/dev/usb/usb.c18
-rw-r--r--sys/dev/usb/usb.h9
-rw-r--r--sys/dev/usb/usb_mem.c8
-rw-r--r--sys/dev/usb/usscanner.c30
25 files changed, 29 insertions, 326 deletions
diff --git a/sys/dev/usb/Makefile b/sys/dev/usb/Makefile
index dfbf8e47882..b8df2c0c272 100644
--- a/sys/dev/usb/Makefile
+++ b/sys/dev/usb/Makefile
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile,v 1.2 2005/05/09 05:08:32 miod Exp $
+# $OpenBSD: Makefile,v 1.3 2007/06/04 10:34:04 mbalmer Exp $
# $NetBSD: Makefile.usbdevs,v 1.2 1999/01/07 22:18:23 augustss Exp $
AWK= awk
@@ -11,7 +11,7 @@ all: usbdevs.h ukbdmap.c
usbdevs.h usbdevs_data.h: usbdevs devlist2h.awk
/bin/rm -f usbdevs.h usbdevs_data.h
- ${AWK} -v os=`${UNAME} -s` -f devlist2h.awk usbdevs
+ ${AWK} -f devlist2h.awk usbdevs
ukbdmap.c: ${MAP} ${PROG}
/bin/rm -f $@
diff --git a/sys/dev/usb/devlist2h.awk b/sys/dev/usb/devlist2h.awk
index 313d883a45e..284eb3f3faa 100644
--- a/sys/dev/usb/devlist2h.awk
+++ b/sys/dev/usb/devlist2h.awk
@@ -1,5 +1,5 @@
#! /usr/bin/awk -f
-# $OpenBSD: devlist2h.awk,v 1.10 2007/02/28 22:51:07 deraadt Exp $
+# $OpenBSD: devlist2h.awk,v 1.11 2007/06/04 10:34:04 mbalmer Exp $
# $NetBSD: devlist2h.awk,v 1.9 2001/01/18 20:28:22 jdolecek Exp $
#
# Copyright (c) 1995, 1996 Christopher G. Demetriou
@@ -39,14 +39,7 @@ NR == 1 {
VERSION = $0
gsub("\\$", "", VERSION)
- if (os == "NetBSD")
- printf("/*\t\$NetBSD\$\t*/\n\n") > dfile
- else if (os == "FreeBSD")
- printf("/*\t\$FreeBSD\$\t*/\n\n") > dfile
- else if (os == "OpenBSD")
- printf("/*\t\$OpenBSD\$\t*/\n\n") > dfile
- else
- printf("/* ??? */\n\n") > dfile
+ printf("/*\t\$OpenBSD\$\t*/\n\n") > dfile
printf("/*\n") > dfile
printf(" * THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.\n") \
> dfile
@@ -55,14 +48,7 @@ NR == 1 {
printf(" *\t%s\n", VERSION) > dfile
printf(" */\n") > dfile
- if (os == "NetBSD")
- printf("/*\t\$NetBSD\$\t*/\n\n") > hfile
- else if (os == "FreeBSD")
- printf("/*\t\$FreeBSD\$\t*/\n\n") > hfile
- else if (os == "OpenBSD")
- printf("/*\t\$OpenBSD\$\t*/\n\n") > hfile
- else
- printf("/* ??? */\n\n") > hfile
+ printf("/*\t\$OpenBSD\$\t*/\n\n") > hfile
printf("/*\n") > hfile
printf(" * THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.\n") \
> hfile
diff --git a/sys/dev/usb/ehci.c b/sys/dev/usb/ehci.c
index 7dea456ec38..d0eb775b314 100644
--- a/sys/dev/usb/ehci.c
+++ b/sys/dev/usb/ehci.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ehci.c,v 1.69 2007/05/21 06:10:43 jsg Exp $ */
+/* $OpenBSD: ehci.c,v 1.70 2007/06/04 10:34:04 mbalmer Exp $ */
/* $NetBSD: ehci.c,v 1.66 2004/06/30 03:11:56 mycroft Exp $ */
/*
@@ -83,11 +83,9 @@
#include <dev/rndvar.h>
-#if defined(__OpenBSD__)
struct cfdriver ehci_cd = {
NULL, "ehci", DV_DULL
};
-#endif
#ifdef USB_DEBUG
#define EHCI_DEBUG
@@ -97,9 +95,7 @@ struct cfdriver ehci_cd = {
#define DPRINTF(x) do { if (ehcidebug) printf x; } while(0)
#define DPRINTFN(n,x) do { if (ehcidebug>(n)) printf x; } while (0)
int ehcidebug = 0;
-#ifndef __NetBSD__
#define bitmask_snprintf(q,f,b,l) snprintf((b), (l), "%b", (q), (f))
-#endif
#else
#define DPRINTF(x)
#define DPRINTFN(n,x)
@@ -1053,12 +1049,6 @@ ehci_power(int why, void *v)
sc->sc_bus.use_polling--;
break;
-#if defined(__NetBSD__)
- case PWR_SOFTSUSPEND:
- case PWR_SOFTSTANDBY:
- case PWR_SOFTRESUME:
- break;
-#endif
}
splx(s);
diff --git a/sys/dev/usb/hid.c b/sys/dev/usb/hid.c
index d4e35e008f6..d2a959f0f5a 100644
--- a/sys/dev/usb/hid.c
+++ b/sys/dev/usb/hid.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: hid.c,v 1.16 2007/05/21 05:40:27 jsg Exp $ */
+/* $OpenBSD: hid.c,v 1.17 2007/06/04 10:34:04 mbalmer Exp $ */
/* $NetBSD: hid.c,v 1.23 2002/07/11 21:14:25 augustss Exp $ */
/* $FreeBSD: src/sys/dev/usb/hid.c,v 1.11 1999/11/17 22:33:39 n_hibma Exp $ */
@@ -41,9 +41,6 @@
#include <sys/param.h>
#include <sys/systm.h>
-#if defined(__NetBSD__)
-#include <sys/kernel.h>
-#endif
#include <sys/malloc.h>
#include <dev/usb/usb.h>
diff --git a/sys/dev/usb/if_aue.c b/sys/dev/usb/if_aue.c
index e8b6ebb501b..4f7a3bde733 100644
--- a/sys/dev/usb/if_aue.c
+++ b/sys/dev/usb/if_aue.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_aue.c,v 1.55 2007/05/27 04:00:24 jsg Exp $ */
+/* $OpenBSD: if_aue.c,v 1.56 2007/06/04 10:34:04 mbalmer Exp $ */
/* $NetBSD: if_aue.c,v 1.82 2003/03/05 17:37:36 shiba Exp $ */
/*
* Copyright (c) 1997, 1998, 1999, 2000
@@ -86,17 +86,12 @@
#include <sys/mbuf.h>
#include <sys/malloc.h>
#include <sys/kernel.h>
-#if defined(__OpenBSD__)
#include <sys/proc.h>
-#endif
#include <sys/socket.h>
#include <sys/device.h>
#include <net/if.h>
-#if defined(__NetBSD__)
-#include <net/if_arp.h>
-#endif
#include <net/if_dl.h>
#include <net/if_media.h>
@@ -104,15 +99,6 @@
#include <net/bpf.h>
#endif
-#if defined(__NetBSD__)
-#include <net/if_ether.h>
-#ifdef INET
-#include <netinet/in.h>
-#include <netinet/if_inarp.h>
-#endif
-#endif /* defined(__NetBSD__) */
-
-#if defined(__OpenBSD__)
#ifdef INET
#include <netinet/in.h>
#include <netinet/in_systm.h>
@@ -120,7 +106,6 @@
#include <netinet/ip.h>
#include <netinet/if_ether.h>
#endif
-#endif /* defined(__OpenBSD__) */
#include <dev/mii/mii.h>
#include <dev/mii/miivar.h>
@@ -611,11 +596,7 @@ allmulti:
aue_csr_write_1(sc, AUE_MAR0 + i, 0);
/* now program new ones */
-#if defined(__NetBSD__)
- ETHER_FIRST_MULTI(step, &sc->aue_ec, enm);
-#else
ETHER_FIRST_MULTI(step, &sc->arpcom, enm);
-#endif
while (enm != NULL) {
if (memcmp(enm->enm_addrlo,
enm->enm_addrhi, ETHER_ADDR_LEN) != 0)
@@ -808,9 +789,7 @@ aue_attach(struct device *parent, struct device *self, void *aux)
printf("%s: address %s\n", USBDEVNAME(sc->aue_dev),
ether_sprintf(eaddr));
-#if defined(__OpenBSD__)
bcopy(eaddr, (char *)&sc->arpcom.ac_enaddr, ETHER_ADDR_LEN);
-#endif
/* Initialize interface info.*/
ifp->if_softc = sc;
@@ -1381,11 +1360,7 @@ aue_init(void *xsc)
*/
aue_reset(sc);
-#if defined(__OpenBSD__)
eaddr = sc->arpcom.ac_enaddr;
-#elif defined(__NetBSD__)
- eaddr = LLADDR(ifp->if_sadl);
-#endif /* defined(__NetBSD__) */
for (i = 0; i < ETHER_ADDR_LEN; i++)
aue_csr_write_1(sc, AUE_PAR0 + i, eaddr[i]);
@@ -1545,11 +1520,7 @@ aue_ioctl(struct ifnet *ifp, u_long command, caddr_t data)
switch (ifa->ifa_addr->sa_family) {
#ifdef INET
case AF_INET:
-#if defined(__NetBSD__)
- arp_ifinit(ifp, ifa);
-#else
arp_ifinit(&sc->arpcom, ifa);
-#endif
break;
#endif /* INET */
}
diff --git a/sys/dev/usb/if_auereg.h b/sys/dev/usb/if_auereg.h
index 83d7bda4b91..2c2760cf8d4 100644
--- a/sys/dev/usb/if_auereg.h
+++ b/sys/dev/usb/if_auereg.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_auereg.h,v 1.10 2007/05/06 04:08:47 krw Exp $ */
+/* $OpenBSD: if_auereg.h,v 1.11 2007/06/04 10:34:04 mbalmer Exp $ */
/* $NetBSD: if_auereg.h,v 1.16 2001/10/10 02:14:17 augustss Exp $ */
/*
* Copyright (c) 1997, 1998, 1999
@@ -227,22 +227,10 @@ struct aue_cdata {
struct aue_softc {
USBBASEDEVICE aue_dev;
-#if defined(__FreeBSD__)
- struct arpcom arpcom;
- device_t aue_miibus;
-#define GET_IFP(sc) (&(sc)->arpcom.ac_if)
-#define GET_MII(sc) (device_get_softc((sc)->aue_miibus))
-#elif defined(__NetBSD__)
- struct ethercom aue_ec;
- struct mii_data aue_mii;
-#define GET_IFP(sc) (&(sc)->aue_ec.ec_if)
-#define GET_MII(sc) (&(sc)->aue_mii)
-#elif defined(__OpenBSD__)
struct arpcom arpcom;
struct mii_data aue_mii;
#define GET_IFP(sc) (&(sc)->arpcom.ac_if)
#define GET_MII(sc) (&(sc)->aue_mii)
-#endif
usb_callout_t aue_stat_ch;
diff --git a/sys/dev/usb/if_axereg.h b/sys/dev/usb/if_axereg.h
index d49156d82d1..ec4b8b6d782 100644
--- a/sys/dev/usb/if_axereg.h
+++ b/sys/dev/usb/if_axereg.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_axereg.h,v 1.15 2007/05/14 00:46:21 jsg Exp $ */
+/* $OpenBSD: if_axereg.h,v 1.16 2007/06/04 10:34:04 mbalmer Exp $ */
/*
* Copyright (c) 1997, 1998, 1999, 2000-2003
@@ -191,13 +191,7 @@ struct axe_sframe_hdr {
struct axe_softc {
USBBASEDEVICE axe_dev;
-#if defined(__FreeBSD__)
-#define GET_MII(sc) (device_get_softc((sc)->axe_mii))
-#elif defined(__NetBSD__)
#define GET_MII(sc) (&(sc)->axe_mii)
-#elif defined(__OpenBSD__)
-#define GET_MII(sc) (&(sc)->axe_mii)
-#endif
struct arpcom arpcom;
#define GET_IFP(sc) (&(sc)->arpcom.ac_if)
struct mii_data axe_mii;
diff --git a/sys/dev/usb/if_cue.c b/sys/dev/usb/if_cue.c
index 561670f7907..585bfb1ec6c 100644
--- a/sys/dev/usb/if_cue.c
+++ b/sys/dev/usb/if_cue.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_cue.c,v 1.35 2007/05/27 04:00:24 jsg Exp $ */
+/* $OpenBSD: if_cue.c,v 1.36 2007/06/04 10:34:04 mbalmer Exp $ */
/* $NetBSD: if_cue.c,v 1.40 2002/07/11 21:14:26 augustss Exp $ */
/*
* Copyright (c) 1997, 1998, 1999, 2000
@@ -60,9 +60,6 @@
#include <sys/param.h>
#include <sys/systm.h>
-#if !defined(__OpenBSD__)
-#include <sys/callout.h>
-#endif
#include <sys/sockio.h>
#include <sys/mbuf.h>
#include <sys/malloc.h>
@@ -72,24 +69,12 @@
#include <sys/device.h>
#include <net/if.h>
-#if defined(__NetBSD__)
-#include <net/if_arp.h>
-#endif
#include <net/if_dl.h>
#if NBPFILTER > 0
#include <net/bpf.h>
#endif
-#if defined(__NetBSD__)
-#include <net/if_ether.h>
-#ifdef INET
-#include <netinet/in.h>
-#include <netinet/if_inarp.h>
-#endif
-#endif /* defined(__NetBSD__) */
-
-#if defined(__OpenBSD__)
#ifdef INET
#include <netinet/in.h>
#include <netinet/in_systm.h>
@@ -97,7 +82,6 @@
#include <netinet/ip.h>
#include <netinet/if_ether.h>
#endif
-#endif /* defined(__OpenBSD__) */
#include <dev/usb/usb.h>
#include <dev/usb/usbdi.h>
@@ -371,11 +355,7 @@ allmulti:
sc->cue_mctab[i] = 0;
/* now program new ones */
-#if defined(__NetBSD__)
- ETHER_FIRST_MULTI(step, &sc->cue_ec, enm);
-#else
ETHER_FIRST_MULTI(step, &sc->arpcom, enm);
-#endif
while (enm != NULL) {
if (memcmp(enm->enm_addrlo,
enm->enm_addrhi, ETHER_ADDR_LEN) != 0)
@@ -531,9 +511,7 @@ cue_attach(struct device *parent, struct device *self, void *aux)
printf("%s: address %s\n", USBDEVNAME(sc->cue_dev),
ether_sprintf(eaddr));
-#if defined(__OpenBSD__)
bcopy(eaddr, (char *)&sc->arpcom.ac_enaddr, ETHER_ADDR_LEN);
-#endif
/* Initialize interface info.*/
ifp = GET_IFP(sc);
@@ -1017,11 +995,7 @@ cue_init(void *xsc)
cue_csr_write_1(sc, CUE_ADVANCED_OPMODES,
CUE_AOP_EMBED_RXLEN | 0x03); /* 1 wait state */
-#if defined(__OpenBSD__)
eaddr = sc->arpcom.ac_enaddr;
-#elif defined(__NetBSD__)
- eaddr = LLADDR(ifp->if_sadl);
-#endif
/* Set MAC address */
for (i = 0; i < ETHER_ADDR_LEN; i++)
cue_csr_write_1(sc, CUE_PAR0 - i, eaddr[i]);
@@ -1135,11 +1109,7 @@ cue_ioctl(struct ifnet *ifp, u_long command, caddr_t data)
switch (ifa->ifa_addr->sa_family) {
#ifdef INET
case AF_INET:
-#if defined(__NetBSD__)
- arp_ifinit(ifp, ifa);
-#else
arp_ifinit(&sc->arpcom, ifa);
-#endif
break;
#endif /* INET */
}
diff --git a/sys/dev/usb/if_cuereg.h b/sys/dev/usb/if_cuereg.h
index b831d78fc6e..730008612bf 100644
--- a/sys/dev/usb/if_cuereg.h
+++ b/sys/dev/usb/if_cuereg.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_cuereg.h,v 1.7 2006/03/07 04:41:19 krw Exp $ */
+/* $OpenBSD: if_cuereg.h,v 1.8 2007/06/04 10:34:04 mbalmer Exp $ */
/* $NetBSD: if_cuereg.h,v 1.14 2001/01/21 22:09:24 augustss Exp $ */
/*
* Copyright (c) 1997, 1998, 1999, 2000
@@ -167,13 +167,8 @@ struct cue_cdata {
struct cue_softc {
USBBASEDEVICE cue_dev;
-#if defined(__FreeBSD__) || defined(__OpenBSD__)
struct arpcom arpcom;
#define GET_IFP(sc) (&(sc)->arpcom.ac_if)
-#elif defined(__NetBSD__)
- struct ethercom cue_ec;
-#define GET_IFP(sc) (&(sc)->cue_ec.ec_if)
-#endif
usb_callout_t cue_stat_ch;
diff --git a/sys/dev/usb/if_kue.c b/sys/dev/usb/if_kue.c
index 451dee9a2cc..eae67543a31 100644
--- a/sys/dev/usb/if_kue.c
+++ b/sys/dev/usb/if_kue.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_kue.c,v 1.48 2007/05/31 00:34:11 maja Exp $ */
+/* $OpenBSD: if_kue.c,v 1.49 2007/06/04 10:34:04 mbalmer Exp $ */
/* $NetBSD: if_kue.c,v 1.50 2002/07/16 22:00:31 augustss Exp $ */
/*
* Copyright (c) 1997, 1998, 1999, 2000
@@ -83,24 +83,12 @@
#include <sys/proc.h>
#include <net/if.h>
-#if defined(__NetBSD__)
-#include <net/if_arp.h>
-#endif
#include <net/if_dl.h>
#if NBPFILTER > 0
#include <net/bpf.h>
#endif
-#if defined(__NetBSD__)
-#include <net/if_ether.h>
-#ifdef INET
-#include <netinet/in.h>
-#include <netinet/if_inarp.h>
-#endif
-#endif /* defined (__NetBSD__) */
-
-#if defined(__OpenBSD__)
#ifdef INET
#include <netinet/in.h>
#include <netinet/in_systm.h>
@@ -108,7 +96,6 @@
#include <netinet/ip.h>
#include <netinet/if_ether.h>
#endif
-#endif /* defined (__OpenBSD__) */
#include <dev/usb/usb.h>
#include <dev/usb/usbdi.h>
@@ -353,11 +340,7 @@ allmulti:
sc->kue_rxfilt &= ~KUE_RXFILT_ALLMULTI;
i = 0;
-#if defined (__NetBSD__)
- ETHER_FIRST_MULTI(step, &sc->kue_ec, enm);
-#else
ETHER_FIRST_MULTI(step, &sc->arpcom, enm);
-#endif
while (enm != NULL) {
if (i == KUE_MCFILTCNT(sc) ||
memcmp(enm->enm_addrlo, enm->enm_addrhi,
@@ -494,10 +477,8 @@ kue_attachhook(void *xsc)
printf("%s: address %s\n", USBDEVNAME(sc->kue_dev),
ether_sprintf(sc->kue_desc.kue_macaddr));
-#if defined(__OpenBSD__)
bcopy(sc->kue_desc.kue_macaddr,
(char *)&sc->arpcom.ac_enaddr, ETHER_ADDR_LEN);
-#endif
/* Initialize interface info.*/
ifp = GET_IFP(sc);
@@ -611,10 +592,6 @@ kue_activate(device_ptr_t self, enum devact act)
break;
case DVACT_DEACTIVATE:
-#if defined(__NetBSD__)
- /* Deactivate the interface. */
- if_deactivate(&sc->kue_ec.ec_if);
-#endif
sc->kue_dying = 1;
break;
}
@@ -967,11 +944,7 @@ kue_init(void *xsc)
s = splnet();
-#if defined(__NetBSD__)
- eaddr = LLADDR(ifp->if_sadl);
-#else
eaddr = sc->arpcom.ac_enaddr;
-#endif /* defined(__NetBSD__) */
/* Set MAC address */
kue_ctl(sc, KUE_CTL_WRITE, KUE_CMD_SET_MAC, 0, eaddr, ETHER_ADDR_LEN);
@@ -1094,11 +1067,7 @@ kue_ioctl(struct ifnet *ifp, u_long command, caddr_t data)
switch (ifa->ifa_addr->sa_family) {
#ifdef INET
case AF_INET:
-#if defined(__NetBSD__)
- arp_ifinit(ifp, ifa);
-#else
arp_ifinit(&sc->arpcom, ifa);
-#endif
break;
#endif /* INET */
}
diff --git a/sys/dev/usb/if_kuereg.h b/sys/dev/usb/if_kuereg.h
index 4daf86b316d..5facfa51162 100644
--- a/sys/dev/usb/if_kuereg.h
+++ b/sys/dev/usb/if_kuereg.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_kuereg.h,v 1.6 2006/03/07 04:41:19 krw Exp $ */
+/* $OpenBSD: if_kuereg.h,v 1.7 2007/06/04 10:34:04 mbalmer Exp $ */
/* $NetBSD: if_kuereg.h,v 1.11 2001/01/21 02:35:31 augustss Exp $ */
/*
* Copyright (c) 1997, 1998, 1999, 2000
@@ -162,13 +162,8 @@ struct kue_cdata {
struct kue_softc {
USBBASEDEVICE kue_dev;
-#if defined(__FreeBSD__) || defined(__OpenBSD__)
struct arpcom arpcom;
#define GET_IFP(sc) (&(sc)->arpcom.ac_if)
-#elif defined(__NetBSD__)
- struct ethercom kue_ec;
-#define GET_IFP(sc) (&(sc)->kue_ec.ec_if)
-#endif
usbd_device_handle kue_udev;
usbd_interface_handle kue_iface;
diff --git a/sys/dev/usb/if_udavreg.h b/sys/dev/usb/if_udavreg.h
index 8daa20cba60..6bf4a7ae0ee 100644
--- a/sys/dev/usb/if_udavreg.h
+++ b/sys/dev/usb/if_udavreg.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_udavreg.h,v 1.5 2007/05/06 04:08:47 krw Exp $ */
+/* $OpenBSD: if_udavreg.h,v 1.6 2007/06/04 10:34:04 mbalmer Exp $ */
/* $NetBSD: if_udavreg.h,v 1.2 2003/09/04 15:17:39 tsutsui Exp $ */
/* $nabe: if_udavreg.h,v 1.2 2003/08/21 16:26:40 nabe Exp $ */
/*
@@ -135,11 +135,7 @@
#define UDAV_GPR_GEPIO1 (1<<1) /* General purpose 1 */
#define UDAV_GPR_GEPIO0 (1<<0) /* General purpose 0 */
-#if defined(__NetBSD__)
-#define GET_IFP(sc) (&(sc)->sc_ec.ec_if)
-#else
#define GET_IFP(sc) (&(sc)->sc_ac.ac_if)
-#endif
#define GET_MII(sc) (&(sc)->sc_mii)
struct udav_chain {
@@ -182,11 +178,7 @@ struct udav_softc {
struct timeval sc_rx_notice;
/* Ethernet */
-#if defined(__NetBSD__)
- struct ethercom sc_ec; /* ethernet common */
-#else
struct arpcom sc_ac; /* ethernet common */
-#endif
struct mii_data sc_mii;
struct rwlock sc_mii_lock;
int sc_link;
diff --git a/sys/dev/usb/if_url.c b/sys/dev/usb/if_url.c
index 24f70d1c298..3b5a9e59887 100644
--- a/sys/dev/usb/if_url.c
+++ b/sys/dev/usb/if_url.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_url.c,v 1.38 2007/05/27 04:00:25 jsg Exp $ */
+/* $OpenBSD: if_url.c,v 1.39 2007/06/04 10:34:04 mbalmer Exp $ */
/* $NetBSD: if_url.c,v 1.6 2002/09/29 10:19:21 martin Exp $ */
/*
* Copyright (c) 2001, 2002
@@ -50,9 +50,7 @@
#include <sys/rwlock.h>
#include <sys/mbuf.h>
#include <sys/kernel.h>
-#if defined(__OpenBSD__)
#include <sys/proc.h>
-#endif
#include <sys/socket.h>
#include <sys/device.h>
@@ -66,15 +64,6 @@
#include <net/bpf.h>
#endif
-#if defined(__NetBSD__)
-#include <net/if_ether.h>
-#ifdef INET
-#include <netinet/in.h>
-#include <netinet/if_inarp.h>
-#endif
-#endif /* defined(__NetBSD__) */
-
-#if defined(__OpenBSD__)
#ifdef INET
#include <netinet/in.h>
#include <netinet/in_systm.h>
@@ -82,7 +71,6 @@
#include <netinet/ip.h>
#include <netinet/if_ether.h>
#endif
-#endif /* defined(__OpenBSD__) */
#include <dev/mii/mii.h>
#include <dev/mii/miivar.h>
@@ -272,9 +260,7 @@ url_attach(struct device *parent, struct device *self, void *aux)
/* Print Ethernet Address */
printf("%s: address %s\n", devname, ether_sprintf(eaddr));
-#if defined(__OpenBSD__)
bcopy(eaddr, (char *)&sc->sc_ac.ac_enaddr, ETHER_ADDR_LEN);
-#endif
/* initialize interface information */
ifp = GET_IFP(sc);
ifp->if_softc = sc;
@@ -283,10 +269,6 @@ url_attach(struct device *parent, struct device *self, void *aux)
ifp->if_start = url_start;
ifp->if_ioctl = url_ioctl;
ifp->if_watchdog = url_watchdog;
-#if defined(__NetBSD__)
- ifp->if_init = url_init;
- ifp->if_stop = url_stop;
-#endif
IFQ_SET_READY(&ifp->if_snd);
@@ -524,11 +506,7 @@ url_init(struct ifnet *ifp)
/* Cancel pending I/O and free all TX/RX buffers */
url_stop(ifp, 1);
-#if defined(__OpenBSD__)
eaddr = sc->sc_ac.ac_enaddr;
-#elif defined(__NetBSD__)
- eaddr = LLADDR(ifp->if_sadl);
-#endif
for (i = 0; i < ETHER_ADDR_LEN; i++)
url_csr_write_1(sc, URL_IDR0 + i, eaddr[i]);
diff --git a/sys/dev/usb/if_urlreg.h b/sys/dev/usb/if_urlreg.h
index b90238834b5..d83c53b74b2 100644
--- a/sys/dev/usb/if_urlreg.h
+++ b/sys/dev/usb/if_urlreg.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_urlreg.h,v 1.8 2007/05/06 04:08:47 krw Exp $ */
+/* $OpenBSD: if_urlreg.h,v 1.9 2007/06/04 10:34:04 mbalmer Exp $ */
/* $NetBSD: if_urlreg.h,v 1.1 2002/03/28 21:09:11 ichiro Exp $ */
/*
* Copyright (c) 2001, 2002
@@ -125,11 +125,7 @@ typedef uWord url_rxhdr_t; /* Recive Header */
#define URL_RXHDR_PHYPKT_MASK (0x4000) /* Physical match packet */
#define URL_RXHDR_MCASTPKT_MASK (0x8000) /* Multicast packet */
-#if defined(__NetBSD__)
-#define GET_IFP(sc) (&(sc)->sc_ec.ec_if)
-#else
#define GET_IFP(sc) (&(sc)->sc_ac.ac_if)
-#endif
#define GET_MII(sc) (&(sc)->sc_mii)
struct url_chain {
@@ -172,11 +168,7 @@ struct url_softc {
struct timeval sc_rx_notice;
/* Ethernet */
-#if defined(__NetBSD__)
- struct ethercom sc_ec; /* ethernet common */
-#else
struct arpcom sc_ac; /* ethernet common */
-#endif
struct mii_data sc_mii;
struct rwlock sc_mii_lock;
int sc_link;
diff --git a/sys/dev/usb/uaudio.c b/sys/dev/usb/uaudio.c
index daaa4ade912..772220d28b4 100644
--- a/sys/dev/usb/uaudio.c
+++ b/sys/dev/usb/uaudio.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uaudio.c,v 1.39 2007/05/27 04:00:25 jsg Exp $ */
+/* $OpenBSD: uaudio.c,v 1.40 2007/06/04 10:34:04 mbalmer Exp $ */
/* $NetBSD: uaudio.c,v 1.90 2004/10/29 17:12:53 kent Exp $ */
/*
@@ -350,9 +350,6 @@ Static struct audio_hw_if uaudio_hw_if = {
uaudio_get_props,
uaudio_trigger_output,
uaudio_trigger_input,
-#if defined(__NetBSD__)
- NULL,
-#endif
};
Static struct audio_device uaudio_device = {
@@ -452,12 +449,7 @@ uaudio_attach(struct device *parent, struct device *self, void *aux)
if (usbd_get_quirks(sc->sc_udev)->uq_flags & UQ_AU_NO_FRAC)
sc->sc_altflags |= UA_NOFRAC;
-#if defined(__NetBSD__) && !defined(UAUDIO_DEBUG)
- if (bootverbose)
-#endif
- printf(", %d mixer controls", sc->sc_nctls);
-
- printf("\n");
+ printf(", %d mixer controls\n", sc->sc_nctls);
usbd_add_drv_event(USB_EVENT_DRIVER_ATTACH, sc->sc_udev,
USBDEV(sc->sc_dev));
@@ -469,12 +461,10 @@ uaudio_attach(struct device *parent, struct device *self, void *aux)
/*
* Macros to help sync OpenBSD to NetBSD
*/
-#if defined(__OpenBSD__)
#define hw_channels channels
#define hw_sample_rate sample_rate
#define hw_precision precision
#define hw_encoding encoding
-#endif
int
uaudio_activate(device_ptr_t self, enum devact act)
diff --git a/sys/dev/usb/uhcivar.h b/sys/dev/usb/uhcivar.h
index 403362b55fd..be584fd4192 100644
--- a/sys/dev/usb/uhcivar.h
+++ b/sys/dev/usb/uhcivar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: uhcivar.h,v 1.15 2003/07/08 13:19:09 nate Exp $ */
+/* $OpenBSD: uhcivar.h,v 1.16 2007/06/04 10:34:04 mbalmer Exp $ */
/* $NetBSD: uhcivar.h,v 1.36 2002/12/31 00:39:11 augustss Exp $ */
/* $FreeBSD: src/sys/dev/usb/uhcivar.h,v 1.14 1999/11/17 22:33:42 n_hibma Exp $ */
@@ -189,8 +189,5 @@ typedef struct uhci_softc {
usbd_status uhci_init(uhci_softc_t *);
usbd_status uhci_run(uhci_softc_t *, int run);
int uhci_intr(void *);
-#if defined(__NetBSD__) || defined(__OpenBSD__)
int uhci_detach(uhci_softc_t *, int);
int uhci_activate(device_ptr_t, enum devact);
-#endif
-
diff --git a/sys/dev/usb/uhid.c b/sys/dev/usb/uhid.c
index 7118c4307ca..e00dd185405 100644
--- a/sys/dev/usb/uhid.c
+++ b/sys/dev/usb/uhid.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uhid.c,v 1.32 2007/05/27 04:00:25 jsg Exp $ */
+/* $OpenBSD: uhid.c,v 1.33 2007/06/04 10:34:04 mbalmer Exp $ */
/* $NetBSD: uhid.c,v 1.57 2003/03/11 16:44:00 augustss Exp $ */
/*
@@ -101,21 +101,6 @@ struct uhid_softc {
#define UHID_CHUNK 128 /* chunk size for read */
#define UHID_BSIZE 1020 /* buffer size */
-#if defined(__NetBSD__)
-dev_type_open(uhidopen);
-dev_type_close(uhidclose);
-dev_type_read(uhidread);
-dev_type_write(uhidwrite);
-dev_type_ioctl(uhidioctl);
-dev_type_poll(uhidpoll);
-dev_type_kqfilter(uhidkqfilter);
-
-const struct cdevsw uhid_cdevsw = {
- uhidopen, uhidclose, uhidread, uhidwrite, uhidioctl,
- nostop, notty, uhidpoll, nommap, uhidkqfilter,
-};
-#endif
-
Static void uhid_intr(struct uhidev *, void *, u_int len);
Static int uhid_do_read(struct uhid_softc *, struct uio *uio, int);
@@ -200,13 +185,9 @@ uhid_detach(struct device *self, int flags)
}
/* locate the major number */
-#if defined(__NetBSD__)
- maj = cdevsw_lookup_major(&uhid_cdevsw);
-#elif defined(__OpenBSD__)
for (maj = 0; maj < nchrdev; maj++)
if (cdevsw[maj].d_open == uhidopen)
break;
-#endif
/* Nuke the vnodes for any open instances (calls close). */
mn = self->dv_unit;
diff --git a/sys/dev/usb/uhidev.c b/sys/dev/usb/uhidev.c
index 2f62fad3e92..27f5df90a0c 100644
--- a/sys/dev/usb/uhidev.c
+++ b/sys/dev/usb/uhidev.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uhidev.c,v 1.21 2007/05/27 04:00:25 jsg Exp $ */
+/* $OpenBSD: uhidev.c,v 1.22 2007/06/04 10:34:04 mbalmer Exp $ */
/* $NetBSD: uhidev.c,v 1.14 2003/03/11 16:44:00 augustss Exp $ */
/*
@@ -78,11 +78,7 @@ Static void uhidev_intr(usbd_xfer_handle, usbd_private_handle, usbd_status);
Static int uhidev_maxrepid(void *buf, int len);
Static int uhidevprint(void *aux, const char *pnp);
-#if defined(__NetBSD__)
-Static int uhidevsubmatch(struct device *parent, struct cfdata *cf, void *aux);
-#else
Static int uhidevsubmatch(struct device *parent, void *cf, void *aux);
-#endif
USB_DECLARE_DRIVER(uhidev);
@@ -328,16 +324,10 @@ uhidevprint(void *aux, const char *pnp)
return (UNCONF);
}
-#if defined(__NetBSD__)
-Static int uhidevsubmatch(struct device *parent, struct cfdata *cf, void *aux)
-#else
Static int uhidevsubmatch(struct device *parent, void *match, void *aux)
-#endif
{
struct uhidev_attach_arg *uha = aux;
-#if defined(__OpenBSD__)
struct cfdata *cf = match;
-#endif
if (cf->uhidevcf_reportid != UHIDEV_UNK_REPORTID &&
cf->uhidevcf_reportid != uha->reportid)
diff --git a/sys/dev/usb/uhidev.h b/sys/dev/usb/uhidev.h
index ce37bd8a26c..0bf9bfdfdfb 100644
--- a/sys/dev/usb/uhidev.h
+++ b/sys/dev/usb/uhidev.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: uhidev.h,v 1.6 2006/08/18 02:54:11 jason Exp $ */
+/* $OpenBSD: uhidev.h,v 1.7 2007/06/04 10:34:04 mbalmer Exp $ */
/* $NetBSD: uhidev.h,v 1.3 2002/10/08 09:56:17 dan Exp $ */
/*
@@ -38,12 +38,6 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#if defined(__NetBSD__)
-#include "locators.h"
-#include "rnd.h"
-
-#endif
-
#define uhidevcf_reportid cf_loc[UHIDBUSCF_REPORTID]
#define UHIDEV_UNK_REPORTID UHIDBUSCF_REPORTID_DEFAULT
diff --git a/sys/dev/usb/ukbd.c b/sys/dev/usb/ukbd.c
index 1da423f23fd..afedb1bb784 100644
--- a/sys/dev/usb/ukbd.c
+++ b/sys/dev/usb/ukbd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ukbd.c,v 1.29 2007/05/27 04:00:25 jsg Exp $ */
+/* $OpenBSD: ukbd.c,v 1.30 2007/06/04 10:34:04 mbalmer Exp $ */
/* $NetBSD: ukbd.c,v 1.85 2003/03/11 16:44:00 augustss Exp $ */
/*
@@ -44,11 +44,7 @@
#include <sys/param.h>
#include <sys/systm.h>
-#if defined(__OpenBSD__)
#include <sys/timeout.h>
-#else
-#include <sys/callout.h>
-#endif
#include <sys/kernel.h>
#include <sys/device.h>
#include <sys/ioctl.h>
diff --git a/sys/dev/usb/umass_quirks.c b/sys/dev/usb/umass_quirks.c
index 4a50fc38de4..c219e5626b5 100644
--- a/sys/dev/usb/umass_quirks.c
+++ b/sys/dev/usb/umass_quirks.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: umass_quirks.c,v 1.25 2007/03/13 06:23:45 steven Exp $ */
+/* $OpenBSD: umass_quirks.c,v 1.26 2007/06/04 10:34:04 mbalmer Exp $ */
/* $NetBSD: umass_quirks.c,v 1.67 2004/06/28 07:49:16 mycroft Exp $ */
/*
@@ -42,13 +42,8 @@
#include <sys/device.h>
#include <sys/buf.h>
-#if defined(__NetBSD__)
-#include <dev/scsipi/scsipi_all.h> /* for scsiconf.h below */
-#include <dev/scsipi/scsiconf.h> /* for quirks defines */
-#elif defined(__OpenBSD__)
#include <scsi/scsi_all.h>
#include <scsi/scsiconf.h>
-#endif
#include <dev/usb/usb.h>
#include <dev/usb/usbdi.h>
diff --git a/sys/dev/usb/usb.c b/sys/dev/usb/usb.c
index 6151962de3a..36abf61bb0c 100644
--- a/sys/dev/usb/usb.c
+++ b/sys/dev/usb/usb.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: usb.c,v 1.40 2007/05/27 04:00:25 jsg Exp $ */
+/* $OpenBSD: usb.c,v 1.41 2007/06/04 10:34:04 mbalmer Exp $ */
/* $NetBSD: usb.c,v 1.77 2003/01/01 00:10:26 thorpej Exp $ */
/*
@@ -105,20 +105,6 @@ struct usb_softc {
TAILQ_HEAD(, usb_task) usb_all_tasks;
-#if defined(__NetBSD__)
-dev_type_open(usbopen);
-dev_type_close(usbclose);
-dev_type_read(usbread);
-dev_type_ioctl(usbioctl);
-dev_type_poll(usbpoll);
-dev_type_kqfilter(usbkqfilter);
-
-const struct cdevsw usb_cdevsw = {
- usbopen, usbclose, usbread, nowrite, usbioctl,
- nostop, notty, usbpoll, nommap, usbkqfilter,
-};
-#endif
-
Static volatile int threads_pending = 0;
Static void usb_discover(void *);
@@ -241,7 +227,6 @@ usb_attach(struct device *parent, struct device *self, void *aux)
kthread_create_deferred(usb_create_event_thread, sc);
}
-#if defined(__NetBSD__) || defined(__OpenBSD__)
void
usb_create_event_thread(void *arg)
{
@@ -386,7 +371,6 @@ usbctlprint(void *aux, const char *pnp)
return (UNCONF);
}
-#endif /* defined(__NetBSD__) || defined(__OpenBSD__) */
int
usbopen(dev_t dev, int flag, int mode, usb_proc_ptr p)
diff --git a/sys/dev/usb/usb.h b/sys/dev/usb/usb.h
index 235c66417e1..5d351b6d949 100644
--- a/sys/dev/usb/usb.h
+++ b/sys/dev/usb/usb.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: usb.h,v 1.25 2006/07/12 18:12:55 miod Exp $ */
+/* $OpenBSD: usb.h,v 1.26 2007/06/04 10:34:04 mbalmer Exp $ */
/* $NetBSD: usb.h,v 1.69 2002/09/22 23:20:50 augustss Exp $ */
/* $FreeBSD: src/sys/dev/usb/usb.h,v 1.14 1999/11/17 22:33:46 n_hibma Exp $ */
@@ -46,14 +46,7 @@
#include <sys/types.h>
#include <sys/time.h>
-#if defined(__NetBSD__) || defined(__OpenBSD__)
#include <sys/ioctl.h>
-#endif
-#if defined(__FreeBSD__)
-/* These two defines are used by usbd to autoload the usb kld */
-#define USB_KLD "usb" /* name of usb module */
-#define USB_UHUB "usb/uhub" /* root hub */
-#endif
#if defined(_KERNEL)
#include <dev/usb/usb_port.h>
diff --git a/sys/dev/usb/usb_mem.c b/sys/dev/usb/usb_mem.c
index f723c526bb7..8b1d9d89c49 100644
--- a/sys/dev/usb/usb_mem.c
+++ b/sys/dev/usb/usb_mem.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: usb_mem.c,v 1.17 2007/05/21 05:40:28 jsg Exp $ */
+/* $OpenBSD: usb_mem.c,v 1.18 2007/06/04 10:34:04 mbalmer Exp $ */
/* $NetBSD: usb_mem.c,v 1.26 2003/02/01 06:23:40 thorpej Exp $ */
/*
@@ -71,12 +71,6 @@ extern int usbdebug;
#define DPRINTFN(n,x)
#endif
-#if defined(__NetBSD__)
-MALLOC_DEFINE(M_USB, "USB", "USB misc. memory");
-MALLOC_DEFINE(M_USBDEV, "USB device", "USB device driver");
-MALLOC_DEFINE(M_USBHC, "USB HC", "USB host controller");
-#endif
-
#define USB_MEM_SMALL 64
#define USB_MEM_CHUNKS 64
#define USB_MEM_BLOCK (USB_MEM_SMALL * USB_MEM_CHUNKS)
diff --git a/sys/dev/usb/usscanner.c b/sys/dev/usb/usscanner.c
index 62789e456b6..6e3e32036ab 100644
--- a/sys/dev/usb/usscanner.c
+++ b/sys/dev/usb/usscanner.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: usscanner.c,v 1.14 2007/05/27 04:00:25 jsg Exp $ */
+/* $OpenBSD: usscanner.c,v 1.15 2007/06/04 10:34:04 mbalmer Exp $ */
/* $NetBSD: usscanner.c,v 1.6 2001/01/23 14:04:14 augustss Exp $ */
/*
@@ -68,17 +68,9 @@
#include <dev/usb/usbdevs.h>
-#if defined(__NetBSD__)
-#include <sys/scsiio.h>
-#include <dev/scsipi/scsi_all.h>
-#include <dev/scsipi/scsipi_all.h>
-#include <dev/scsipi/scsiconf.h>
-#include <dev/scsipi/atapiconf.h>
-#elif defined(__OpenBSD__)
#include <scsi/scsi_all.h>
#include <scsi/scsiconf.h>
#include <machine/bus.h>
-#endif
#ifdef USSCANNER_DEBUG
#define DPRINTF(x) do { if (usscannerdebug) printf x; } while (0)
@@ -158,13 +150,8 @@ struct usscanner_softc {
device_ptr_t sc_child; /* child device, for detach */
struct scsipi_link sc_link;
-#if defined(__NetBSD__)
- struct atapi_adapter sc_atapi_adapter;
-#define sc_adapter sc_atapi_adapter._generic
-#else
struct scsi_adapter sc_atapi_adapter;
#define sc_adapter sc_atapi_adapter
-#endif
int sc_refcnt;
char sc_dying;
@@ -347,25 +334,14 @@ usscanner_attach(struct device *parent, struct device *self, void *aux)
/*
* fill in the prototype scsipi_link.
*/
-#if defined(__NetBSD__)
- sc->sc_link.type = BUS_SCSI;
-#endif
-#if defined(__OpenBSD__)
sc->sc_link.flags &= ~SDEV_ATAPI;
sc->sc_link.adapter_buswidth = 2;
sc->sc_link.adapter_target = USSCANNER_SCSIID_HOST;
-#endif
sc->sc_link.adapter_softc = sc;
sc->sc_link.adapter = &sc->sc_adapter;
sc->sc_link.device = &usscanner_dev;
sc->sc_link.openings = 1;
-#if defined(__NetBSD__)
- sc->sc_link.scsipi_scsi.channel = SCSI_CHANNEL_ONLY_ONE;
- sc->sc_link.scsipi_scsi.adapter_target = USSCANNER_SCSIID_HOST;
- sc->sc_link.scsipi_scsi.max_target = USSCANNER_SCSIID_DEVICE;
- sc->sc_link.scsipi_scsi.max_lun = 0;
-#endif
bzero(&saa, sizeof(saa));
saa.saa_sc_link = &sc->sc_link;
@@ -473,11 +449,7 @@ usscanner_sense(struct usscanner_softc *sc)
/* fetch sense data */
memset(&sense_cmd, 0, sizeof(sense_cmd));
sense_cmd.opcode = REQUEST_SENSE;
-#if defined(__NetBSD__)
- sense_cmd.byte2 = sc_link->scsipi_scsi.lun << SCSI_CMD_LUN_SHIFT;
-#else
sense_cmd.byte2 = sc_link->lun << SCSI_CMD_LUN_SHIFT;
-#endif
sense_cmd.length = sizeof xs->sense;
sc->sc_state = UAS_SENSECMD;