host controller because autoconf(9) already does it.
-/* $OpenBSD: ehci_cardbus.c,v 1.17 2013/04/15 09:23:00 mglocker Exp $ */
+/* $OpenBSD: ehci_cardbus.c,v 1.18 2014/05/16 18:17:03 mpi Exp $ */
/* $NetBSD: ehci_cardbus.c,v 1.6.6.3 2004/09/21 13:27:25 skrll Exp $ */
/*
}
/* Attach usb device. */
- sc->sc.sc_child = config_found((void *)sc, &sc->sc.sc_bus,
- usbctlprint);
+ config_found(self, &sc->sc.sc_bus, usbctlprint);
}
int
struct cardbus_devfunc *ct = sc->sc_ct;
int rv;
- rv = ehci_detach(&sc->sc, flags);
+ rv = ehci_detach(self, flags);
if (rv)
return (rv);
if (sc->sc_ih != NULL) {
-/* $OpenBSD: ohci_cardbus.c,v 1.18 2013/04/15 09:23:00 mglocker Exp $ */
+/* $OpenBSD: ohci_cardbus.c,v 1.19 2014/05/16 18:17:03 mpi Exp $ */
/* $NetBSD: ohci_cardbus.c,v 1.19 2004/08/02 19:14:28 mycroft Exp $ */
/*
}
/* Attach usb device. */
- sc->sc.sc_child = config_found((void *)sc, &sc->sc.sc_bus,
- usbctlprint);
+ config_found(self, &sc->sc.sc_bus, usbctlprint);
}
int
struct cardbus_devfunc *ct = sc->sc_ct;
int rv;
- rv = ohci_detach(&sc->sc, flags);
+ rv = ohci_detach(self, flags);
if (rv)
return (rv);
-/* $OpenBSD: uhci_cardbus.c,v 1.12 2013/04/15 09:23:01 mglocker Exp $ */
+/* $OpenBSD: uhci_cardbus.c,v 1.13 2014/05/16 18:17:03 mpi Exp $ */
/*
* Copyright (c) 1998 The NetBSD Foundation, Inc.
}
/* Attach usb device. */
- sc->sc.sc_child = config_found((void *)sc, &sc->sc.sc_bus,
- usbctlprint);
+ config_found(self, &sc->sc.sc_bus, usbctlprint);
}
int
struct cardbus_devfunc *ct = sc->sc_ct;
int rv;
- rv = uhci_detach(&sc->sc, flags);
+ rv = uhci_detach(self, flags);
if (rv)
return (rv);
-/* $OpenBSD: ehci_pci.c,v 1.26 2013/04/15 09:23:01 mglocker Exp $ */
+/* $OpenBSD: ehci_pci.c,v 1.27 2014/05/16 18:17:03 mpi Exp $ */
/* $NetBSD: ehci_pci.c,v 1.15 2004/04/23 21:13:06 itojun Exp $ */
/*
splx(s);
/* Attach usb device. */
- sc->sc.sc_child = config_found((void *)sc, &sc->sc.sc_bus,
- usbctlprint);
-
+ config_found(self, &sc->sc.sc_bus, usbctlprint);
return;
disestablish_ret:
struct ehci_pci_softc *sc = (struct ehci_pci_softc *)self;
int rv;
- /* ehci_pci_attach previously failed in some way */
- if (sc->sc.sc_child == NULL)
- return (0);
-
switch (act) {
case DVACT_RESUME:
ehci_pci_takecontroller(sc, 1);
struct ehci_pci_softc *sc = (struct ehci_pci_softc *)self;
int rv;
- rv = ehci_detach(&sc->sc, flags);
+ rv = ehci_detach(self, flags);
if (rv)
return (rv);
if (sc->sc_ih != NULL) {
-/* $OpenBSD: ohci_pci.c,v 1.39 2013/04/15 09:23:01 mglocker Exp $ */
+/* $OpenBSD: ohci_pci.c,v 1.40 2014/05/16 18:17:03 mpi Exp $ */
/* $NetBSD: ohci_pci.c,v 1.23 2002/10/02 16:51:47 thorpej Exp $ */
/*
splx(s);
/* Attach usb device. */
- sc->sc.sc_child = config_found((void *)sc, &sc->sc.sc_bus,
- usbctlprint);
+ config_found(self, &sc->sc.sc_bus, usbctlprint);
}
int
struct ohci_pci_softc *sc = (struct ohci_pci_softc *)self;
int rv;
- rv = ohci_detach(&sc->sc, flags);
+ rv = ohci_detach(self, flags);
if (rv)
return (rv);
-/* $OpenBSD: uhci_pci.c,v 1.32 2013/04/15 09:23:01 mglocker Exp $ */
+/* $OpenBSD: uhci_pci.c,v 1.33 2014/05/16 18:17:03 mpi Exp $ */
/* $NetBSD: uhci_pci.c,v 1.24 2002/10/02 16:51:58 thorpej Exp $ */
/*
splx(s);
/* Attach usb device. */
- sc->sc.sc_child = config_found((void *)sc, &sc->sc.sc_bus,
- usbctlprint);
-
+ config_found(self, &sc->sc.sc_bus, usbctlprint);
return;
unmap_ret:
struct uhci_pci_softc *sc = (struct uhci_pci_softc *)self;
int rv;
- rv = uhci_detach(&sc->sc, flags);
+ rv = uhci_detach(self, flags);
if (rv)
return (rv);
if (sc->sc_ih != NULL) {
-/* $OpenBSD: ehci.c,v 1.153 2014/05/09 11:01:06 mpi Exp $ */
+/* $OpenBSD: ehci.c,v 1.154 2014/05/16 18:17:03 mpi Exp $ */
/* $NetBSD: ehci.c,v 1.66 2004/06/30 03:11:56 mycroft Exp $ */
/*
}
int
-ehci_detach(struct ehci_softc *sc, int flags)
+ehci_detach(struct device *self, int flags)
{
- int rv = 0;
-
- if (sc->sc_child != NULL)
- rv = config_detach(sc->sc_child, flags);
+ struct ehci_softc *sc = (struct ehci_softc *)self;
+ int rv;
+ rv = config_detach_children(self, flags);
if (rv != 0)
return (rv);
rv = config_activate_children(self, act);
break;
case DVACT_DEACTIVATE:
- if (sc->sc_child != NULL)
- rv = config_deactivate(sc->sc_child);
+ rv = config_activate_children(self, act);
sc->sc_bus.dying = 1;
break;
case DVACT_POWERDOWN:
-/* $OpenBSD: ehcivar.h,v 1.31 2014/04/29 12:45:29 mpi Exp $ */
+/* $OpenBSD: ehcivar.h,v 1.32 2014/05/16 18:17:03 mpi Exp $ */
/* $NetBSD: ehcivar.h,v 1.19 2005/04/29 15:04:29 augustss Exp $ */
/*
struct rwlock sc_doorbell_lock;
struct timeout sc_tmo_intrlist;
-
- struct device *sc_child; /* /dev/usb# device */
};
#define EREAD1(sc, a) bus_space_read_1((sc)->iot, (sc)->ioh, (a))
usbd_status ehci_init(struct ehci_softc *);
int ehci_intr(void *);
-int ehci_detach(struct ehci_softc *, int);
+int ehci_detach(struct device *, int);
int ehci_activate(struct device *, int);
usbd_status ehci_reset(struct ehci_softc *);
-/* $OpenBSD: ohci.c,v 1.129 2014/05/09 11:01:06 mpi Exp $ */
+/* $OpenBSD: ohci.c,v 1.130 2014/05/16 18:17:03 mpi Exp $ */
/* $NetBSD: ohci.c,v 1.139 2003/02/22 05:24:16 tsutsui Exp $ */
/* $FreeBSD: src/sys/dev/usb/ohci.c,v 1.22 1999/11/17 22:33:40 n_hibma Exp $ */
rv = config_activate_children(self, act);
break;
case DVACT_DEACTIVATE:
- if (sc->sc_child != NULL)
- rv = config_deactivate(sc->sc_child);
+ rv = config_activate_children(self, act);
sc->sc_bus.dying = 1;
break;
case DVACT_POWERDOWN:
}
int
-ohci_detach(struct ohci_softc *sc, int flags)
+ohci_detach(struct device *self, int flags)
{
- int rv = 0;
-
- if (sc->sc_child != NULL)
- rv = config_detach(sc->sc_child, flags);
+ struct ohci_softc *sc = (struct ohci_softc *)self;
+ int rv;
+ rv = config_detach_children(self, flags);
if (rv != 0)
return (rv);
-/* $OpenBSD: ohcivar.h,v 1.36 2014/04/29 21:51:18 mpi Exp $ */
+/* $OpenBSD: ohcivar.h,v 1.37 2014/05/16 18:17:03 mpi Exp $ */
/* $NetBSD: ohcivar.h,v 1.32 2003/02/22 05:24:17 tsutsui Exp $ */
/* $FreeBSD: src/sys/dev/usb/ohcivar.h,v 1.13 1999/11/17 22:33:41 n_hibma Exp $ */
struct timeval sc_overrun_ntc;
struct timeout sc_tmo_rhsc;
-
- struct device *sc_child;
};
struct ohci_xfer {
usbd_status ohci_handover(struct ohci_softc *);
usbd_status ohci_init(struct ohci_softc *);
int ohci_intr(void *);
-int ohci_detach(struct ohci_softc *, int);
+int ohci_detach(struct device *, int);
int ohci_activate(struct device *, int);
-/* $OpenBSD: uhci.c,v 1.116 2014/05/09 11:01:06 mpi Exp $ */
+/* $OpenBSD: uhci.c,v 1.117 2014/05/16 18:17:03 mpi Exp $ */
/* $NetBSD: uhci.c,v 1.172 2003/02/23 04:19:26 simonb Exp $ */
/* $FreeBSD: src/sys/dev/usb/uhci.c,v 1.33 1999/11/17 22:33:41 n_hibma Exp $ */
rv = config_activate_children(self, act);
break;
case DVACT_DEACTIVATE:
- if (sc->sc_child != NULL)
- rv = config_deactivate(sc->sc_child);
+ rv = config_activate_children(self, act);
sc->sc_bus.dying = 1;
break;
}
}
int
-uhci_detach(struct uhci_softc *sc, int flags)
+uhci_detach(struct device *self, int flags)
{
- int rv = 0;
-
- if (sc->sc_child != NULL)
- rv = config_detach(sc->sc_child, flags);
+ struct uhci_softc *sc = (struct uhci_softc *)self;
+ int rv;
+ rv = config_detach_children(self, flags);
if (rv != 0)
return (rv);
-/* $OpenBSD: uhcivar.h,v 1.31 2014/04/29 21:51:18 mpi Exp $ */
+/* $OpenBSD: uhcivar.h,v 1.32 2014/05/16 18:17:03 mpi 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 $ */
char sc_vendor[32]; /* vendor string for root hub */
int sc_id_vendor; /* vendor ID for root hub */
-
- struct device *sc_child; /* /dev/usb# device */
};
usbd_status uhci_init(struct uhci_softc *);
usbd_status uhci_run(struct uhci_softc *, int run);
int uhci_intr(void *);
-int uhci_detach(struct uhci_softc *, int);
+int uhci_detach(struct device *, int);
int uhci_activate(struct device *, int);