Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/pci/pci.c
Show First 20 Lines • Show All 132 Lines • ▼ Show 20 Lines | static void pci_hint_device_unit(device_t acdev, device_t child, | ||||
const char *name, int *unitp); | const char *name, int *unitp); | ||||
static int pci_reset_post(device_t dev, device_t child); | static int pci_reset_post(device_t dev, device_t child); | ||||
static int pci_reset_prepare(device_t dev, device_t child); | static int pci_reset_prepare(device_t dev, device_t child); | ||||
static int pci_reset_child(device_t dev, device_t child, | static int pci_reset_child(device_t dev, device_t child, | ||||
int flags); | int flags); | ||||
static int pci_get_id_method(device_t dev, device_t child, | static int pci_get_id_method(device_t dev, device_t child, | ||||
enum pci_id_type type, uintptr_t *rid); | enum pci_id_type type, uintptr_t *rid); | ||||
jhb: Would maybe just leave this blank line here to not add noise to the diff? | |||||
static struct pci_devinfo * pci_fill_devinfo(device_t pcib, device_t bus, int d, | static struct pci_devinfo * pci_fill_devinfo(device_t pcib, device_t bus, int d, | ||||
int b, int s, int f, uint16_t vid, uint16_t did); | int b, int s, int f, uint16_t vid, uint16_t did); | ||||
static device_method_t pci_methods[] = { | static device_method_t pci_methods[] = { | ||||
/* Device interface */ | /* Device interface */ | ||||
DEVMETHOD(device_probe, pci_probe), | DEVMETHOD(device_probe, pci_probe), | ||||
DEVMETHOD(device_attach, pci_attach), | DEVMETHOD(device_attach, pci_attach), | ||||
DEVMETHOD(device_detach, pci_detach), | DEVMETHOD(device_detach, pci_detach), | ||||
Show All 22 Lines | static device_method_t pci_methods[] = { | ||||
DEVMETHOD(bus_adjust_resource, bus_generic_adjust_resource), | DEVMETHOD(bus_adjust_resource, bus_generic_adjust_resource), | ||||
DEVMETHOD(bus_release_resource, pci_release_resource), | DEVMETHOD(bus_release_resource, pci_release_resource), | ||||
DEVMETHOD(bus_activate_resource, pci_activate_resource), | DEVMETHOD(bus_activate_resource, pci_activate_resource), | ||||
DEVMETHOD(bus_deactivate_resource, pci_deactivate_resource), | DEVMETHOD(bus_deactivate_resource, pci_deactivate_resource), | ||||
DEVMETHOD(bus_child_deleted, pci_child_deleted), | DEVMETHOD(bus_child_deleted, pci_child_deleted), | ||||
DEVMETHOD(bus_child_detached, pci_child_detached), | DEVMETHOD(bus_child_detached, pci_child_detached), | ||||
DEVMETHOD(bus_child_pnpinfo, pci_child_pnpinfo_method), | DEVMETHOD(bus_child_pnpinfo, pci_child_pnpinfo_method), | ||||
DEVMETHOD(bus_child_location, pci_child_location_method), | DEVMETHOD(bus_child_location, pci_child_location_method), | ||||
DEVMETHOD(bus_get_device_path, pci_get_device_path_method), | |||||
DEVMETHOD(bus_hint_device_unit, pci_hint_device_unit), | DEVMETHOD(bus_hint_device_unit, pci_hint_device_unit), | ||||
DEVMETHOD(bus_remap_intr, pci_remap_intr_method), | DEVMETHOD(bus_remap_intr, pci_remap_intr_method), | ||||
DEVMETHOD(bus_suspend_child, pci_suspend_child), | DEVMETHOD(bus_suspend_child, pci_suspend_child), | ||||
DEVMETHOD(bus_resume_child, pci_resume_child), | DEVMETHOD(bus_resume_child, pci_resume_child), | ||||
DEVMETHOD(bus_rescan, pci_rescan_method), | DEVMETHOD(bus_rescan, pci_rescan_method), | ||||
/* PCI interface */ | /* PCI interface */ | ||||
DEVMETHOD(pci_read_config, pci_read_config_method), | DEVMETHOD(pci_read_config, pci_read_config_method), | ||||
▲ Show 20 Lines • Show All 5,687 Lines • ▼ Show 20 Lines | pci_child_pnpinfo_method(device_t dev, device_t child, struct sbuf *sb) | ||||
dinfo = device_get_ivars(child); | dinfo = device_get_ivars(child); | ||||
cfg = &dinfo->cfg; | cfg = &dinfo->cfg; | ||||
sbuf_printf(sb, "vendor=0x%04x device=0x%04x subvendor=0x%04x " | sbuf_printf(sb, "vendor=0x%04x device=0x%04x subvendor=0x%04x " | ||||
"subdevice=0x%04x class=0x%02x%02x%02x", cfg->vendor, cfg->device, | "subdevice=0x%04x class=0x%02x%02x%02x", cfg->vendor, cfg->device, | ||||
cfg->subvendor, cfg->subdevice, cfg->baseclass, cfg->subclass, | cfg->subvendor, cfg->subdevice, cfg->baseclass, cfg->subclass, | ||||
cfg->progif); | cfg->progif); | ||||
return (0); | return (0); | ||||
} | |||||
int | |||||
pci_get_device_path_method(device_t bus, device_t child, const char *locator, | |||||
struct sbuf *sb) | |||||
{ | |||||
device_t parent = device_get_parent(bus); | |||||
int rv; | |||||
if (strcmp(locator, BUS_LOCATOR_UEFI) == 0) { | |||||
rv = bus_generic_get_device_path(parent, bus, locator, sb); | |||||
if (rv == 0) { | |||||
sbuf_printf(sb, "/Pci(0x%x,0x%x)", pci_get_slot(child), | |||||
pci_get_function(child)); | |||||
} | |||||
return (0); | |||||
} | |||||
return (bus_generic_get_device_path(bus, child, locator, sb)); | |||||
} | } | ||||
int | int | ||||
pci_assign_interrupt_method(device_t dev, device_t child) | pci_assign_interrupt_method(device_t dev, device_t child) | ||||
{ | { | ||||
struct pci_devinfo *dinfo = device_get_ivars(child); | struct pci_devinfo *dinfo = device_get_ivars(child); | ||||
pcicfgregs *cfg = &dinfo->cfg; | pcicfgregs *cfg = &dinfo->cfg; | ||||
▲ Show 20 Lines • Show All 890 Lines • Show Last 20 Lines |
Would maybe just leave this blank line here to not add noise to the diff?