Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/ntb/ntb_transport.c
Show First 20 Lines • Show All 46 Lines • ▼ Show 20 Lines | |||||
#include <sys/ktr.h> | #include <sys/ktr.h> | ||||
#include <sys/limits.h> | #include <sys/limits.h> | ||||
#include <sys/lock.h> | #include <sys/lock.h> | ||||
#include <sys/malloc.h> | #include <sys/malloc.h> | ||||
#include <sys/mbuf.h> | #include <sys/mbuf.h> | ||||
#include <sys/module.h> | #include <sys/module.h> | ||||
#include <sys/mutex.h> | #include <sys/mutex.h> | ||||
#include <sys/queue.h> | #include <sys/queue.h> | ||||
#include <sys/sbuf.h> | |||||
#include <sys/sysctl.h> | #include <sys/sysctl.h> | ||||
#include <sys/taskqueue.h> | #include <sys/taskqueue.h> | ||||
#include <vm/vm.h> | #include <vm/vm.h> | ||||
#include <vm/pmap.h> | #include <vm/pmap.h> | ||||
#include <machine/bus.h> | #include <machine/bus.h> | ||||
▲ Show 20 Lines • Show All 508 Lines • ▼ Show 20 Lines | ntb_transport_print_child(device_t dev, device_t child) | ||||
retval += printf(" at consumer %d", nc->consumer); | retval += printf(" at consumer %d", nc->consumer); | ||||
retval += bus_print_child_domain(dev, child); | retval += bus_print_child_domain(dev, child); | ||||
retval += bus_print_child_footer(dev, child); | retval += bus_print_child_footer(dev, child); | ||||
return (retval); | return (retval); | ||||
} | } | ||||
static int | static int | ||||
ntb_transport_child_location_str(device_t dev, device_t child, char *buf, | ntb_transport_child_location(device_t dev, device_t child, struct sbuf *sb) | ||||
size_t buflen) | |||||
{ | { | ||||
struct ntb_transport_child *nc = device_get_ivars(child); | struct ntb_transport_child *nc = device_get_ivars(child); | ||||
snprintf(buf, buflen, "consumer=%d", nc->consumer); | sbuf_printf(sb, "consumer=%d", nc->consumer); | ||||
return (0); | return (0); | ||||
} | } | ||||
int | int | ||||
ntb_transport_queue_count(device_t dev) | ntb_transport_queue_count(device_t dev) | ||||
{ | { | ||||
struct ntb_transport_child *nc = device_get_ivars(dev); | struct ntb_transport_child *nc = device_get_ivars(dev); | ||||
▲ Show 20 Lines • Show All 1,086 Lines • ▼ Show 20 Lines | |||||
} | } | ||||
static device_method_t ntb_transport_methods[] = { | static device_method_t ntb_transport_methods[] = { | ||||
/* Device interface */ | /* Device interface */ | ||||
DEVMETHOD(device_probe, ntb_transport_probe), | DEVMETHOD(device_probe, ntb_transport_probe), | ||||
DEVMETHOD(device_attach, ntb_transport_attach), | DEVMETHOD(device_attach, ntb_transport_attach), | ||||
DEVMETHOD(device_detach, ntb_transport_detach), | DEVMETHOD(device_detach, ntb_transport_detach), | ||||
/* Bus interface */ | /* Bus interface */ | ||||
DEVMETHOD(bus_child_location_str, ntb_transport_child_location_str), | DEVMETHOD(bus_child_location, ntb_transport_child_location), | ||||
DEVMETHOD(bus_print_child, ntb_transport_print_child), | DEVMETHOD(bus_print_child, ntb_transport_print_child), | ||||
DEVMETHOD_END | DEVMETHOD_END | ||||
}; | }; | ||||
devclass_t ntb_transport_devclass; | devclass_t ntb_transport_devclass; | ||||
static DEFINE_CLASS_0(ntb_transport, ntb_transport_driver, | static DEFINE_CLASS_0(ntb_transport, ntb_transport_driver, | ||||
ntb_transport_methods, sizeof(struct ntb_transport_ctx)); | ntb_transport_methods, sizeof(struct ntb_transport_ctx)); | ||||
DRIVER_MODULE(ntb_transport, ntb_hw, ntb_transport_driver, | DRIVER_MODULE(ntb_transport, ntb_hw, ntb_transport_driver, | ||||
ntb_transport_devclass, NULL, NULL); | ntb_transport_devclass, NULL, NULL); | ||||
MODULE_DEPEND(ntb_transport, ntb, 1, 1, 1); | MODULE_DEPEND(ntb_transport, ntb, 1, 1, 1); | ||||
MODULE_VERSION(ntb_transport, 1); | MODULE_VERSION(ntb_transport, 1); |