Date: Fri, 2 Jun 2006 06:29:49 GMT From: Warner Losh <imp@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 98310 for review Message-ID: <200606020629.k526Tngw044325@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=98310 Change 98310 by imp@imp_lighthouse on 2006/06/02 06:29:15 Stub in the needed routines to make this a bus. Affected files ... .. //depot/projects/arm/src/sys/dev/sdhc/sdhc_pci.c#3 edit Differences ... ==== //depot/projects/arm/src/sys/dev/sdhc/sdhc_pci.c#3 (text+ko) ==== @@ -89,11 +89,97 @@ return (sdhc_attach(dev)); } +static int +sdhc_read_ivar(device_t brdev, device_t child, int which, uintptr_t *result) +{ + return (ENOENT); +} + +static int +sdhc_write_ivar(device_t brdev, device_t child, int which, uintptr_t value) +{ + return (ENOENT); +} + +static struct resource * +sdhc_alloc_resource(device_t brdev, device_t child, int type, int *rid, + u_long start, u_long end, u_long count, u_int flags) +{ + return (0); +} + +static int +sdhc_release_resource(device_t brdev, device_t child, int type, int rid, + struct resource *r) +{ + return (EIO); +} + +static int +sdhc_activate_resource(device_t brdev, device_t child, int type, int rid, + struct resource *r) +{ + return (EIO); +} + +static int +sdhc_deactivate_resource(device_t brdev, device_t child, int type, + int rid, struct resource *r) +{ + return (EIO); +} + +static void +sdhc_driver_added(device_t dev, driver_t *driver) +{ +// struct sdhc_softc *sc = device_get_softc(dev); + device_t *devlist; + device_t kiddev; + int tmp; + int numdevs; + int wake = 0; + + DEVICE_IDENTIFY(driver, dev); + device_get_children(dev, &devlist, &numdevs); + for (tmp = 0; tmp < numdevs; tmp++) { + kiddev = devlist[tmp]; + if (device_get_state(kiddev) == DS_NOTPRESENT && + device_probe_and_attach(kiddev) == 0) + wake++; + } + free(devlist, M_TEMP); +#if 0 + if (wake > 0) { + mtx_lock(&sc->mtx); + cv_signal(&sc->cv); + mtx_unlock(&sc->mtx); + } +#endif +} + +static void +sdhc_child_detached(device_t dev, device_t child) +{ +} + static device_method_t sdhc_pci_methods[] = { /* Device interface */ - DEVMETHOD(device_probe, sdhc_pci_probe), - DEVMETHOD(device_attach, sdhc_pci_attach), - DEVMETHOD(device_detach, sdhc_detach), + DEVMETHOD(device_probe, sdhc_pci_probe), + DEVMETHOD(device_attach, sdhc_pci_attach), + DEVMETHOD(device_detach, sdhc_detach), + + /* bus methods */ + DEVMETHOD(bus_print_child, bus_generic_print_child), + DEVMETHOD(bus_read_ivar, sdhc_read_ivar), + DEVMETHOD(bus_write_ivar, sdhc_write_ivar), + DEVMETHOD(bus_alloc_resource, sdhc_alloc_resource), + DEVMETHOD(bus_release_resource, sdhc_release_resource), + DEVMETHOD(bus_activate_resource, sdhc_activate_resource), + DEVMETHOD(bus_deactivate_resource, sdhc_deactivate_resource), + DEVMETHOD(bus_driver_added, sdhc_driver_added), + DEVMETHOD(bus_child_detached, sdhc_child_detached), +// DEVMETHOD(bus_setup_intr, sdhc_setup_intr), +// DEVMETHOD(bus_teardown_intr, sdhc_teardown_intr), { 0, 0 } };
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200606020629.k526Tngw044325>