Some OpenBSD portability fixes.

This commit is contained in:
augustss 2000-03-29 18:24:52 +00:00
parent 356d681927
commit a25e27e1eb
13 changed files with 160 additions and 53 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: if_aue.c,v 1.34 2000/03/27 12:33:53 augustss Exp $ */
/* $NetBSD: if_aue.c,v 1.35 2000/03/29 18:24:52 augustss Exp $ */
/*
* Copyright (c) 1997, 1998, 1999, 2000
* Bill Paul <wpaul@ee.columbia.edu>. All rights reserved.
@ -76,12 +76,14 @@
* proper cleanup on errors
*/
#if defined(__NetBSD__) || defined(__OpenBSD__)
#if defined(__NetBSD__)
#include "opt_inet.h"
#include "opt_ns.h"
#include "bpfilter.h"
#include "rnd.h"
#endif /* defined(__NetBSD__) || defined(__OpenBSD__) */
#elif defined(__OpenBSD__)
#include "bpfilter.h"
#endif /* defined(__OpenBSD__) */
#include <sys/param.h>
#include <sys/systm.h>
@ -109,12 +111,13 @@
#endif /* defined(__NetBSD__) || defined(__OpenBSD__) */
#include <net/if.h>
#if defined(__NetBSD__) || defined(__FreeBSD__)
#include <net/if_arp.h>
#endif
#include <net/if_dl.h>
#include <net/if_media.h>
#if defined(__NetBSD__) || defined(__OpenBSD__)
#include <net/if_ether.h>
#define BPF_MTAP(ifp, m) bpf_mtap((ifp)->if_bpf, (m))
#else
#define BPF_MTAP(ifp, m) bpf_mtap((ifp), (m))
@ -124,12 +127,25 @@
#include <net/bpf.h>
#endif
#if defined(__NetBSD__) || defined(__OpenBSD__)
#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>
#include <netinet/in_var.h>
#include <netinet/ip.h>
#include <netinet/if_ether.h>
#endif
#endif /* defined(__OpenBSD__) */
#if defined(__NetBSD__) || defined(__OpenBSD__)
#ifdef NS
#include <netns/ns.h>
#include <netns/ns_if.h>
@ -635,7 +651,11 @@ aue_setmulti(sc)
AUE_SETBIT(sc, AUE_MAR + (h >> 3), 1 << (h & 0xF));
}
#elif defined(__NetBSD__) || defined(__OpenBSD__)
#if defined(__NetBSD__)
ETHER_FIRST_MULTI(step, &sc->aue_ec, enm);
#else
ETHER_FIRST_MULTI(step, &sc->arpcom, enm);
#endif
while (enm != NULL) {
#if 1
if (memcmp(enm->enm_addrlo,
@ -807,13 +827,13 @@ USB_ATTACH(aue)
/*
* A Pegasus chip was detected. Inform the world.
*/
ifp = GET_IFP(sc);
#if defined(__FreeBSD__)
printf("%s: Ethernet address: %6D\n", USBDEVNAME(sc->aue_dev),
eaddr, ":");
bcopy(eaddr, (char *)&sc->arpcom.ac_enaddr, ETHER_ADDR_LEN);
ifp = &sc->arpcom.ac_if;
ifp->if_softc = sc;
ifp->if_unit = sc->aue_unit;
ifp->if_name = "aue";
@ -864,7 +884,6 @@ USB_ATTACH(aue)
ether_sprintf(eaddr));
/* Initialize interface info.*/
ifp = &sc->aue_ec.ec_if;
ifp->if_softc = sc;
ifp->if_mtu = ETHERMTU;
ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST;
@ -889,7 +908,7 @@ USB_ATTACH(aue)
/* Attach the interface. */
if_attach(ifp);
ether_ifattach(ifp, eaddr);
Ether_ifattach(ifp, eaddr);
#if NBPFILTER > 0
bpfattach(&ifp->if_bpf, ifp, DLT_EN10MB,
@ -1253,6 +1272,7 @@ aue_rxeof(xfer, priv, status)
if (ifp->if_bpf) {
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) &&
@ -1260,12 +1280,13 @@ aue_rxeof(xfer, priv, status)
m_freem(m);
goto done1;
}
#endif
}
#endif
DPRINTFN(10,("%s: %s: deliver %d\n", USBDEVNAME(sc->aue_dev),
__FUNCTION__, m->m_len));
(*ifp->if_input)(ifp, m);
IF_INPUT(ifp, m);
done1:
splx(s);
#endif /* defined(__NetBSD__) || defined(__OpenBSD__) */
@ -1503,11 +1524,11 @@ aue_init(xsc)
*/
aue_reset(sc);
#if defined(__FreeBSD__)
#if defined(__FreeBSD__) || defined(__OpenBSD__)
eaddr = sc->arpcom.ac_enaddr;
#elif defined(__NetBSD__) || defined(__OpenBSD__)
#elif defined(__NetBSD__)
eaddr = LLADDR(ifp->if_sadl);
#endif /* defined(__NetBSD__) || defined(__OpenBSD__) */
#endif /* defined(__NetBSD__) */
for (i = 0; i < ETHER_ADDR_LEN; i++)
aue_csr_write_1(sc, AUE_PAR0 + i, eaddr[i]);
@ -1683,7 +1704,11 @@ aue_ioctl(ifp, command, 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 */
#ifdef NS

View File

@ -1,4 +1,4 @@
/* $NetBSD: if_auereg.h,v 1.9 2000/03/24 22:13:23 augustss Exp $ */
/* $NetBSD: if_auereg.h,v 1.10 2000/03/29 18:24:52 augustss Exp $ */
/*
* Copyright (c) 1997, 1998, 1999
* Bill Paul <wpaul@ee.columbia.edu>. All rights reserved.
@ -241,6 +241,13 @@ struct aue_softc {
#endif
#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;
#if NRND > 0
rndsource_element_t rnd_source;
#endif
#define GET_IFP(sc) (&(sc)->arpcom.ac_if)
#endif
usb_callout_t aue_stat_ch;

View File

@ -1,4 +1,4 @@
/* $NetBSD: if_cue.c,v 1.17 2000/03/27 12:33:53 augustss Exp $ */
/* $NetBSD: if_cue.c,v 1.18 2000/03/29 18:24:52 augustss Exp $ */
/*
* Copyright (c) 1997, 1998, 1999, 2000
* Bill Paul <wpaul@ee.columbia.edu>. All rights reserved.
@ -59,16 +59,20 @@
* TODO:
* proper cleanup on errors
*/
#if defined(__NetBSD__) || defined(__OpenBSD__)
#if defined(__NetBSD__)
#include "opt_inet.h"
#include "opt_ns.h"
#include "bpfilter.h"
#include "rnd.h"
#endif
#elif defined(__OpenBSD__)
#include "bpfilter.h"
#endif /* defined(__OpenBSD__) */
#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>
@ -91,11 +95,12 @@
#endif
#include <net/if.h>
#if defined(__NetBSD__) || defined(__FreeBSD__)
#include <net/if_arp.h>
#endif
#include <net/if_dl.h>
#if defined(__NetBSD__) || defined(__OpenBSD__)
#include <net/if_ether.h>
#define BPF_MTAP(ifp, m) bpf_mtap((ifp)->if_bpf, (m))
#else
#define BPF_MTAP(ifp, m) bpf_mtap((ifp), (m))
@ -105,12 +110,25 @@
#include <net/bpf.h>
#endif
#if defined(__NetBSD__) || defined(__OpenBSD__)
#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>
#include <netinet/in_var.h>
#include <netinet/ip.h>
#include <netinet/if_ether.h>
#endif
#endif /* defined(__OpenBSD__) */
#if defined(__NetBSD__) || defined(__OpenBSD__)
#ifdef NS
#include <netns/ns.h>
#include <netns/ns_if.h>
@ -493,7 +511,11 @@ cue_setmulti(sc)
sc->cue_mctab[h >> 3] |= 1 << (h & 0x7);
}
#elif defined(__NetBSD__) || defined(__OpenBSD__)
#if defined(__NetBSD__)
ETHER_FIRST_MULTI(step, &sc->cue_ec, enm);
#else
ETHER_FIRST_MULTI(step, &sc->arpcom, enm);
#endif
while (enm != NULL) {
#if 0
if (memcmp(enm->enm_addrlo,
@ -699,7 +721,7 @@ USB_ATTACH(cue)
/* Attach the interface. */
if_attach(ifp);
ether_ifattach(ifp, eaddr);
Ether_ifattach(ifp, eaddr);
#if NBPFILTER > 0
bpfattach(&ifp->if_bpf, ifp, DLT_EN10MB,
@ -1010,6 +1032,7 @@ cue_rxeof(xfer, priv, status)
if (ifp->if_bpf) {
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) &&
@ -1017,12 +1040,13 @@ cue_rxeof(xfer, priv, status)
m_freem(m);
goto done1;
}
#endif
}
#endif
DPRINTFN(10,("%s: %s: deliver %d\n", USBDEVNAME(sc->cue_dev),
__FUNCTION__, m->m_len));
(*ifp->if_input)(ifp, m);
IF_INPUT(ifp, m);
done1:
splx(s);
#endif /* defined(__NetBSD__) || defined(__OpenBSD__) */
@ -1243,9 +1267,9 @@ cue_init(xsc)
cue_csr_write_1(sc, CUE_ADVANCED_OPMODES,
CUE_AOP_EMBED_RXLEN | 0x03); /* 1 wait state */
#if defined(__FreeBSD__)
#if defined(__FreeBSD__) || defined(__OpenBSD__)
eaddr = sc->arpcom.ac_enaddr;
#elif defined(__NetBSD__) || defined(__OpenBSD__)
#elif defined(__NetBSD__)
eaddr = LLADDR(ifp->if_sadl);
#endif /* defined(__NetBSD__) || defined(__OpenBSD__) */
/* Set MAC address */
@ -1374,7 +1398,11 @@ cue_ioctl(ifp, command, 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 */
#ifdef NS

View File

@ -1,4 +1,4 @@
/* $NetBSD: if_cuereg.h,v 1.9 2000/03/24 22:13:24 augustss Exp $ */
/* $NetBSD: if_cuereg.h,v 1.10 2000/03/29 18:24:52 augustss Exp $ */
/*
* Copyright (c) 1997, 1998, 1999, 2000
* Bill Paul <wpaul@ee.columbia.edu>. All rights reserved.
@ -167,7 +167,7 @@ struct cue_cdata {
struct cue_softc {
USBBASEDEVICE cue_dev;
#if defined(__FreeBSD__)
#if defined(__FreeBSD__) || defined(__OpenBSD__)
struct arpcom arpcom;
#define GET_IFP(sc) (&(sc)->arpcom.ac_if)
#elif defined(__NetBSD__)

View File

@ -1,4 +1,4 @@
/* $NetBSD: if_kue.c,v 1.25 2000/03/27 22:44:01 augustss Exp $ */
/* $NetBSD: if_kue.c,v 1.26 2000/03/29 18:24:53 augustss Exp $ */
/*
* Copyright (c) 1997, 1998, 1999, 2000
* Bill Paul <wpaul@ee.columbia.edu>. All rights reserved.
@ -75,11 +75,13 @@
* more DPRINTF
* proper cleanup on errors
*/
#if defined(__NetBSD__) || defined(__OpenBSD__)
#if defined(__NetBSD__)
#include "opt_inet.h"
#include "opt_ns.h"
#include "bpfilter.h"
#include "rnd.h"
#elif defined(__OpenBSD__)
#include "bpfilter.h"
#endif
#include <sys/param.h>
@ -106,11 +108,12 @@
#endif
#include <net/if.h>
#if defined(__NetBSD__) || defined(__FreeBSD__)
#include <net/if_arp.h>
#endif
#include <net/if_dl.h>
#if defined(__NetBSD__) || defined(__OpenBSD__)
#include <net/if_ether.h>
#define BPF_MTAP(ifp, m) bpf_mtap((ifp)->if_bpf, (m))
#else
#define BPF_MTAP(ifp, m) bpf_mtap((ifp), (m))
@ -120,12 +123,25 @@
#include <net/bpf.h>
#endif
#if defined(__NetBSD__) || defined(__OpenBSD__)
#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>
#include <netinet/in_var.h>
#include <netinet/ip.h>
#include <netinet/if_ether.h>
#endif
#endif /* defined (__OpenBSD__) */
#if defined(__NetBSD__) || defined(__OpenBSD__)
#ifdef NS
#include <netns/ns.h>
#include <netns/ns_if.h>
@ -437,7 +453,11 @@ kue_setmulti(sc)
i++;
}
#elif defined(__NetBSD__) || defined(__OpenBSD__)
#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))
break;
@ -657,7 +677,7 @@ USB_ATTACH(kue)
/* Attach the interface. */
if_attach(ifp);
ether_ifattach(ifp, sc->kue_desc.kue_macaddr);
Ether_ifattach(ifp, sc->kue_desc.kue_macaddr);
#if NBPFILTER > 0
bpfattach(&ifp->if_bpf, ifp, DLT_EN10MB,
@ -742,8 +762,10 @@ kue_activate(self, act)
break;
case DVACT_DEACTIVATE:
#if defined(__NetBSD__)
/* Deactivate the interface. */
if_deactivate(&sc->kue_ec.ec_if);
#endif
sc->kue_dying = 1;
break;
}
@ -970,6 +992,7 @@ kue_rxeof(xfer, priv, status)
if (ifp->if_bpf) {
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) &&
@ -977,12 +1000,13 @@ kue_rxeof(xfer, priv, status)
m_freem(m);
goto done1;
}
#endif
}
#endif
DPRINTFN(10,("%s: %s: deliver %d\n", USBDEVNAME(sc->kue_dev),
__FUNCTION__, m->m_len));
(*ifp->if_input)(ifp, m);
IF_INPUT(ifp, m);
done1:
splx(s);
#endif /* defined(__NetBSD__) || defined(__OpenBSD__) */
@ -1161,11 +1185,11 @@ kue_init(xsc)
s = splimp();
#if defined(__FreeBSD__)
#if defined(__FreeBSD__) || defined(__OpenBSD__)
eaddr = sc->arpcom.ac_enaddr;
#elif defined(__NetBSD__) || defined(__OpenBSD__)
#elif defined(__NetBSD__)
eaddr = LLADDR(ifp->if_sadl);
#endif /* defined(__NetBSD__) || defined(__OpenBSD__) */
#endif /* defined(__NetBSD__) */
/* Set MAC address */
kue_ctl(sc, KUE_CTL_WRITE, KUE_CMD_SET_MAC, 0, eaddr, ETHER_ADDR_LEN);
@ -1294,7 +1318,11 @@ kue_ioctl(ifp, command, 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 */
#ifdef NS

View File

@ -1,4 +1,4 @@
/* $NetBSD: if_kuereg.h,v 1.9 2000/03/24 22:13:24 augustss Exp $ */
/* $NetBSD: if_kuereg.h,v 1.10 2000/03/29 18:24:53 augustss Exp $ */
/*
* Copyright (c) 1997, 1998, 1999, 2000
* Bill Paul <wpaul@ee.columbia.edu>. All rights reserved.
@ -160,7 +160,7 @@ struct kue_cdata {
struct kue_softc {
USBBASEDEVICE kue_dev;
#if defined(__FreeBSD__)
#if defined(__FreeBSD__) || defined(__OpenBSD__)
struct arpcom arpcom;
#define GET_IFP(sc) (&(sc)->arpcom.ac_if)
#elif defined(__NetBSD__)

View File

@ -1,4 +1,4 @@
/* $NetBSD: ohci.c,v 1.83 2000/03/29 01:46:26 augustss Exp $ */
/* $NetBSD: ohci.c,v 1.84 2000/03/29 18:24:53 augustss Exp $ */
/* $FreeBSD: src/sys/dev/usb/ohci.c,v 1.22 1999/11/17 22:33:40 n_hibma Exp $ */
/*
@ -101,7 +101,7 @@ int ohcidebug = 0;
* The OHCI controller is little endian, so on big endian machines
* the data strored in memory needs to be swapped.
*/
#if defined(__FreeBSD__)
#if defined(__FreeBSD__) || defined(__OpenBSD__)
#if BYTE_ORDER == BIG_ENDIAN
#define htole32(x) (bswap32(x))
#define le32toh(x) (bswap32(x))

View File

@ -1,4 +1,4 @@
/* $NetBSD: uaudio.c,v 1.22 2000/03/29 01:47:25 augustss Exp $ */
/* $NetBSD: uaudio.c,v 1.23 2000/03/29 18:24:53 augustss Exp $ */
/*
* Copyright (c) 1999 The NetBSD Foundation, Inc.
@ -387,7 +387,11 @@ USB_ATTACH(uaudio)
sc->sc_chan.sc = sc;
DPRINTF(("uaudio_attach: doing audio_attach_mi\n"));
#if defined(__OpenBSD__)
audio_attach_mi(&uaudio_hw_if, sc, &sc->sc_dev);
#else
sc->sc_audiodev = audio_attach_mi(&uaudio_hw_if, sc, &sc->sc_dev);
#endif
usbd_add_drv_event(USB_EVENT_DRIVER_ATTACH, sc->sc_udev,
USBDEV(sc->sc_dev));

View File

@ -1,4 +1,4 @@
/* $NetBSD: uhci.c,v 1.106 2000/03/29 01:49:13 augustss Exp $ */
/* $NetBSD: uhci.c,v 1.107 2000/03/29 18:24:53 augustss Exp $ */
/* $FreeBSD: src/sys/dev/usb/uhci.c,v 1.33 1999/11/17 22:33:41 n_hibma Exp $ */
/*
@ -106,7 +106,7 @@ int uhcidebug = 0;
* The UHCI controller is little endian, so on big endian machines
* the data strored in memory needs to be swapped.
*/
#if defined(__FreeBSD__)
#if defined(__FreeBSD__) || defined(__OpenBSD__)
#if BYTE_ORDER == BIG_ENDIAN
#define htole32(x) (bswap32(x))
#define le32toh(x) (bswap32(x))

View File

@ -1,4 +1,4 @@
/* $NetBSD: ulpt.c,v 1.34 2000/03/27 12:33:57 augustss Exp $ */
/* $NetBSD: ulpt.c,v 1.35 2000/03/29 18:24:53 augustss Exp $ */
/* $FreeBSD: src/sys/dev/usb/ulpt.c,v 1.24 1999/11/17 22:33:44 n_hibma Exp $ */
/*
@ -46,7 +46,7 @@
#include <sys/systm.h>
#include <sys/proc.h>
#include <sys/kernel.h>
#if defined(__NetBSD__)
#if defined(__NetBSD__) || defined(__OpenBSD__)
#include <sys/device.h>
#include <sys/ioctl.h>
#elif defined(__FreeBSD__)

View File

@ -1,4 +1,4 @@
/* $NetBSD: usb.c,v 1.42 2000/03/27 12:33:57 augustss Exp $ */
/* $NetBSD: usb.c,v 1.43 2000/03/29 18:24:53 augustss Exp $ */
/* $FreeBSD: src/sys/dev/usb/usb.c,v 1.20 1999/11/17 22:33:46 n_hibma Exp $ */
/*
@ -249,7 +249,7 @@ USB_ATTACH(usb)
sc->sc_bus->use_polling--;
config_pending_incr();
kthread_create(usb_create_event_thread, sc);
usb_kthread_create(usb_create_event_thread, sc);
#if defined(__FreeBSD__)
make_dev(&usb_cdevsw, device_get_unit(self), UID_ROOT, GID_OPERATOR,
@ -266,7 +266,7 @@ usb_create_event_thread(arg)
{
struct usb_softc *sc = arg;
if (kthread_create1(usb_event_thread, sc, &sc->sc_event_thread,
if (usb_kthread_create1(usb_event_thread, sc, &sc->sc_event_thread,
"%s", sc->sc_dev.dv_xname)) {
printf("%s: unable to create event thread for\n",
sc->sc_dev.dv_xname);

View File

@ -1,4 +1,4 @@
/* $NetBSD: usb_port.h,v 1.25 2000/03/27 22:40:48 augustss Exp $ */
/* $NetBSD: usb_port.h,v 1.26 2000/03/29 18:24:53 augustss Exp $ */
/* $FreeBSD: src/sys/dev/usb/usb_port.h,v 1.21 1999/11/17 22:33:47 n_hibma Exp $ */
/*
@ -89,6 +89,12 @@ typedef struct callout usb_callout_t;
#define usb_callout(h, t, f, d) callout_reset(&(h), (t), (f), (d))
#define usb_uncallout(h, f, d) callout_stop(&(h))
#define usb_kthread_create1 kthread_create1
#define usb_kthread_create kthread_create
#define Ether_ifattach ether_ifattach
#define IF_INPUT(ifp, m) (*(ifp)->if_input)((ifp), (m))
#define logprintf printf
#define USB_DECLARE_DRIVER(dname) \
@ -183,8 +189,16 @@ __CONCAT(dname,_detach)(self, flags) \
#define memcpy(d, s, l) bcopy((s),(d),(l))
#define memset(d, v, l) bzero((d),(l))
#define bswap32(x) swap32(x)
#define kthread_create1 kthread_create
#define kthread_create kthread_create_deferred
#define usb_kthread_create1 kthread_create
#define usb_kthread_create kthread_create_deferred
#define config_pending_incr()
#define config_pending_decr()
#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 usbpoll usbselect
#define uhidpoll uhidselect
@ -203,7 +217,7 @@ __CONCAT(dname,_detach)(self, flags) \
#define realloc usb_realloc
void *usb_realloc __P((void *, u_int, int, int));
typedef struct device device_ptr_t;
typedef struct device *device_ptr_t;
#define USBBASEDEVICE struct device
#define USBDEV(bdev) (&(bdev))
#define USBDEVNAME(bdev) ((bdev).dv_xname)
@ -318,9 +332,9 @@ __CONCAT(dname,_detach)(self, flags) \
#define memcpy(d, s, l) bcopy((s),(d),(l))
#define memset(d, v, l) bzero((d),(l))
#define bswap32(x) swap32(x)
#define kthread_create1(function, sc, priv, string, name)
#define kthread_create(create_function, sc)
#define kthread_exit(err)
#define usb_kthread_create1(function, sc, priv, string, name)
#define usb_kthread_create(create_function, sc)
#define usb_kthread_exit(err)
typedef struct callout_handle usb_callout_t;
#define usb_callout_init(h) callout_handle_init(&(h))

View File

@ -1,4 +1,4 @@
/* $NetBSD: usb_subr.c,v 1.70 2000/03/29 01:45:20 augustss Exp $ */
/* $NetBSD: usb_subr.c,v 1.71 2000/03/29 18:24:53 augustss Exp $ */
/* $FreeBSD: src/sys/dev/usb/usb_subr.c,v 1.18 1999/11/17 22:33:47 n_hibma Exp $ */
/*
@ -82,6 +82,7 @@ Static int usbd_getnewaddr __P((usbd_bus_handle bus));
Static int usbd_print __P((void *aux, const char *pnp));
Static int usbd_submatch __P((device_ptr_t, struct cfdata *cf, void *));
#elif defined(__OpenBSD__)
Static int usbd_print __P((void *aux, const char *pnp));
Static int usbd_submatch __P((device_ptr_t, void *, void *));
#endif
Static void usbd_free_iface_data __P((usbd_device_handle dev, int ifcno));