Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/virtio/pci/virtio_pci_modern.c
| Show All 27 Lines | |||||
| /* Driver for the modern VirtIO PCI interface. */ | /* Driver for the modern VirtIO PCI interface. */ | ||||
| #include <sys/param.h> | #include <sys/param.h> | ||||
| #include <sys/systm.h> | #include <sys/systm.h> | ||||
| #include <sys/bus.h> | #include <sys/bus.h> | ||||
| #include <sys/lock.h> | #include <sys/lock.h> | ||||
| #include <sys/kernel.h> | #include <sys/kernel.h> | ||||
| #include <sys/sysctl.h> | |||||
| #include <sys/module.h> | #include <sys/module.h> | ||||
| #include <machine/bus.h> | #include <machine/bus.h> | ||||
| #include <machine/cpu.h> | #include <machine/cpu.h> | ||||
| #include <machine/resource.h> | #include <machine/resource.h> | ||||
| #include <sys/bus.h> | #include <sys/bus.h> | ||||
| #include <sys/rman.h> | #include <sys/rman.h> | ||||
| ▲ Show 20 Lines • Show All 139 Lines • ▼ Show 20 Lines | |||||
| static void vtpci_modern_write_device_2(struct vtpci_modern_softc *, | static void vtpci_modern_write_device_2(struct vtpci_modern_softc *, | ||||
| bus_size_t, uint16_t); | bus_size_t, uint16_t); | ||||
| static void vtpci_modern_write_device_4(struct vtpci_modern_softc *, | static void vtpci_modern_write_device_4(struct vtpci_modern_softc *, | ||||
| bus_size_t, uint32_t); | bus_size_t, uint32_t); | ||||
| static void vtpci_modern_write_device_8(struct vtpci_modern_softc *, | static void vtpci_modern_write_device_8(struct vtpci_modern_softc *, | ||||
| bus_size_t, uint64_t); | bus_size_t, uint64_t); | ||||
| /* Tunables. */ | /* Tunables. */ | ||||
| SYSCTL_DECL(_hw_virtio_pci); | |||||
| static int vtpci_modern_transitional = 0; | static int vtpci_modern_transitional = 0; | ||||
| TUNABLE_INT("hw.virtio.pci.transitional", &vtpci_modern_transitional); | SYSCTL_INT(_hw_virtio_pci, OID_AUTO, transitional, CTLFLAG_RDTUN, | ||||
| &vtpci_modern_transitional, 0, | |||||
| "If 0, a transitional VirtIO device is used in legacy mode; otherwise, in modern mode."); | |||||
tuexen: Can this be shorter? Maybe:
```
If zero or non-zero, transitional VirtIO devices negotiate… | |||||
Done Inline ActionsSure. How about this one? timo.voelker_fh-muenster.de: Sure. How about this one? | |||||
Done Inline ActionsI like it. tuexen: I like it. | |||||
| static device_method_t vtpci_modern_methods[] = { | static device_method_t vtpci_modern_methods[] = { | ||||
| /* Device interface. */ | /* Device interface. */ | ||||
| DEVMETHOD(device_probe, vtpci_modern_probe), | DEVMETHOD(device_probe, vtpci_modern_probe), | ||||
| DEVMETHOD(device_attach, vtpci_modern_attach), | DEVMETHOD(device_attach, vtpci_modern_attach), | ||||
| DEVMETHOD(device_detach, vtpci_modern_detach), | DEVMETHOD(device_detach, vtpci_modern_detach), | ||||
| DEVMETHOD(device_suspend, vtpci_modern_suspend), | DEVMETHOD(device_suspend, vtpci_modern_suspend), | ||||
| DEVMETHOD(device_resume, vtpci_modern_resume), | DEVMETHOD(device_resume, vtpci_modern_resume), | ||||
| DEVMETHOD(device_shutdown, vtpci_modern_shutdown), | DEVMETHOD(device_shutdown, vtpci_modern_shutdown), | ||||
| ▲ Show 20 Lines • Show All 1,241 Lines • Show Last 20 Lines | |||||
Can this be shorter? Maybe: