Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/mvs/mvs_pci.c
Show All 32 Lines | |||||
#include <sys/module.h> | #include <sys/module.h> | ||||
#include <sys/systm.h> | #include <sys/systm.h> | ||||
#include <sys/kernel.h> | #include <sys/kernel.h> | ||||
#include <sys/bus.h> | #include <sys/bus.h> | ||||
#include <sys/endian.h> | #include <sys/endian.h> | ||||
#include <sys/malloc.h> | #include <sys/malloc.h> | ||||
#include <sys/lock.h> | #include <sys/lock.h> | ||||
#include <sys/mutex.h> | #include <sys/mutex.h> | ||||
#include <sys/sbuf.h> | |||||
#include <vm/uma.h> | #include <vm/uma.h> | ||||
#include <machine/stdarg.h> | #include <machine/stdarg.h> | ||||
#include <machine/resource.h> | #include <machine/resource.h> | ||||
#include <machine/bus.h> | #include <machine/bus.h> | ||||
#include <sys/rman.h> | #include <sys/rman.h> | ||||
#include <dev/pci/pcivar.h> | #include <dev/pci/pcivar.h> | ||||
#include <dev/pci/pcireg.h> | #include <dev/pci/pcireg.h> | ||||
#include "mvs.h" | #include "mvs.h" | ||||
▲ Show 20 Lines • Show All 429 Lines • ▼ Show 20 Lines | mvs_print_child(device_t dev, device_t child) | ||||
retval += printf(" at channel %d", | retval += printf(" at channel %d", | ||||
(int)(intptr_t)device_get_ivars(child)); | (int)(intptr_t)device_get_ivars(child)); | ||||
retval += bus_print_child_footer(dev, child); | retval += bus_print_child_footer(dev, child); | ||||
return (retval); | return (retval); | ||||
} | } | ||||
static int | static int | ||||
mvs_child_location_str(device_t dev, device_t child, char *buf, | mvs_child_location(device_t dev, device_t child, struct sbuf *sb) | ||||
size_t buflen) | |||||
{ | { | ||||
snprintf(buf, buflen, "channel=%d", | sbuf_printf(sb, "channel=%d", | ||||
(int)(intptr_t)device_get_ivars(child)); | (int)(intptr_t)device_get_ivars(child)); | ||||
return (0); | return (0); | ||||
} | } | ||||
static bus_dma_tag_t | static bus_dma_tag_t | ||||
mvs_get_dma_tag(device_t bus, device_t child) | mvs_get_dma_tag(device_t bus, device_t child) | ||||
{ | { | ||||
return (bus_get_dma_tag(bus)); | return (bus_get_dma_tag(bus)); | ||||
} | } | ||||
static device_method_t mvs_methods[] = { | static device_method_t mvs_methods[] = { | ||||
DEVMETHOD(device_probe, mvs_probe), | DEVMETHOD(device_probe, mvs_probe), | ||||
DEVMETHOD(device_attach, mvs_attach), | DEVMETHOD(device_attach, mvs_attach), | ||||
DEVMETHOD(device_detach, mvs_detach), | DEVMETHOD(device_detach, mvs_detach), | ||||
DEVMETHOD(device_suspend, mvs_suspend), | DEVMETHOD(device_suspend, mvs_suspend), | ||||
DEVMETHOD(device_resume, mvs_resume), | DEVMETHOD(device_resume, mvs_resume), | ||||
DEVMETHOD(bus_print_child, mvs_print_child), | DEVMETHOD(bus_print_child, mvs_print_child), | ||||
DEVMETHOD(bus_alloc_resource, mvs_alloc_resource), | DEVMETHOD(bus_alloc_resource, mvs_alloc_resource), | ||||
DEVMETHOD(bus_release_resource, mvs_release_resource), | DEVMETHOD(bus_release_resource, mvs_release_resource), | ||||
DEVMETHOD(bus_setup_intr, mvs_setup_intr), | DEVMETHOD(bus_setup_intr, mvs_setup_intr), | ||||
DEVMETHOD(bus_teardown_intr,mvs_teardown_intr), | DEVMETHOD(bus_teardown_intr,mvs_teardown_intr), | ||||
DEVMETHOD(bus_child_location_str, mvs_child_location_str), | DEVMETHOD(bus_child_location, mvs_child_location), | ||||
DEVMETHOD(bus_get_dma_tag, mvs_get_dma_tag), | DEVMETHOD(bus_get_dma_tag, mvs_get_dma_tag), | ||||
DEVMETHOD(mvs_edma, mvs_edma), | DEVMETHOD(mvs_edma, mvs_edma), | ||||
{ 0, 0 } | { 0, 0 } | ||||
}; | }; | ||||
static driver_t mvs_driver = { | static driver_t mvs_driver = { | ||||
"mvs", | "mvs", | ||||
mvs_methods, | mvs_methods, | ||||
sizeof(struct mvs_controller) | sizeof(struct mvs_controller) | ||||
}; | }; | ||||
DRIVER_MODULE(mvs, pci, mvs_driver, mvs_devclass, 0, 0); | DRIVER_MODULE(mvs, pci, mvs_driver, mvs_devclass, 0, 0); | ||||
MODULE_PNP_INFO("W32:vendor/device", pci, mvs, mvs_ids, | MODULE_PNP_INFO("W32:vendor/device", pci, mvs, mvs_ids, | ||||
nitems(mvs_ids) - 1); | nitems(mvs_ids) - 1); | ||||
MODULE_VERSION(mvs, 1); | MODULE_VERSION(mvs, 1); | ||||
MODULE_DEPEND(mvs, cam, 1, 1, 1); | MODULE_DEPEND(mvs, cam, 1, 1, 1); |