Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/virtio/virtio.c
Show First 20 Lines • Show All 323 Lines • ▼ Show 20 Lines | |||||
virtio_write_device_config(device_t dev, bus_size_t offset, void *dst, int len) | virtio_write_device_config(device_t dev, bus_size_t offset, void *dst, int len) | ||||
{ | { | ||||
VIRTIO_BUS_WRITE_DEVICE_CONFIG(device_get_parent(dev), | VIRTIO_BUS_WRITE_DEVICE_CONFIG(device_get_parent(dev), | ||||
offset, dst, len); | offset, dst, len); | ||||
} | } | ||||
int | int | ||||
virtio_child_pnpinfo_str(device_t busdev __unused, device_t child, char *buf, | virtio_child_pnpinfo(device_t busdev __unused, device_t child, struct sbuf *sb) | ||||
size_t buflen) | |||||
{ | { | ||||
/* | /* | ||||
* All of these PCI fields will be only 16 bits, but on the vtmmio bus | * All of these PCI fields will be only 16 bits, but on the vtmmio bus | ||||
* the corresponding fields (only "vendor" and "device_type") are 32 | * the corresponding fields (only "vendor" and "device_type") are 32 | ||||
* bits. Many virtio drivers can attach below either bus. | * bits. Many virtio drivers can attach below either bus. | ||||
* Gratuitously expand these two fields to 32-bits to allow sharing PNP | * Gratuitously expand these two fields to 32-bits to allow sharing PNP | ||||
* match table data between the mostly-similar buses. | * match table data between the mostly-similar buses. | ||||
* | * | ||||
* Subdevice and device_type are redundant in both buses, so I don't | * Subdevice and device_type are redundant in both buses, so I don't | ||||
* see a lot of PNP utility in exposing the same value under a | * see a lot of PNP utility in exposing the same value under a | ||||
* different name. | * different name. | ||||
*/ | */ | ||||
snprintf(buf, buflen, "vendor=0x%08x device=0x%04x subvendor=0x%04x " | sbuf_printf(sb, "vendor=0x%08x device=0x%04x subvendor=0x%04x " | ||||
"device_type=0x%08x", (unsigned)virtio_get_vendor(child), | "device_type=0x%08x", (unsigned)virtio_get_vendor(child), | ||||
(unsigned)virtio_get_device(child), | (unsigned)virtio_get_device(child), | ||||
(unsigned)virtio_get_subvendor(child), | (unsigned)virtio_get_subvendor(child), | ||||
(unsigned)virtio_get_device_type(child)); | (unsigned)virtio_get_device_type(child)); | ||||
return (0); | return (0); | ||||
} | } | ||||
static int | static int | ||||
Show All 27 Lines |