diff options
author | mav <mav@FreeBSD.org> | 2010-05-22 07:32:47 +0000 |
---|---|---|
committer | mav <mav@FreeBSD.org> | 2010-05-22 07:32:47 +0000 |
commit | 810a32455d43efc2de222a2109f0691456aa7645 (patch) | |
tree | fc393fbaa9f0ab9d5b7cfb97523cd0a46611a3a6 /sys/dev/ata | |
parent | d785fc2581eeec9fca9e7dab9ed758fe7af8fed1 (diff) | |
download | FreeBSD-src-810a32455d43efc2de222a2109f0691456aa7645.zip FreeBSD-src-810a32455d43efc2de222a2109f0691456aa7645.tar.gz |
Report ATA/SATA channel number to NewBus at location string.
Diffstat (limited to 'sys/dev/ata')
-rw-r--r-- | sys/dev/ata/ata-pci.c | 11 | ||||
-rw-r--r-- | sys/dev/ata/ata-pci.h | 3 |
2 files changed, 14 insertions, 0 deletions
diff --git a/sys/dev/ata/ata-pci.c b/sys/dev/ata/ata-pci.c index 5271073..fea7c96 100644 --- a/sys/dev/ata/ata-pci.c +++ b/sys/dev/ata/ata-pci.c @@ -544,6 +544,16 @@ ata_pci_dmafini(device_t dev) ata_dmafini(dev); } +int +ata_pci_child_location_str(device_t dev, device_t child, char *buf, + size_t buflen) +{ + + snprintf(buf, buflen, "channel=%d", + (int)(intptr_t)device_get_ivars(child)); + return (0); +} + static device_method_t ata_pci_methods[] = { /* device interface */ DEVMETHOD(device_probe, ata_pci_probe), @@ -564,6 +574,7 @@ static device_method_t ata_pci_methods[] = { DEVMETHOD(bus_teardown_intr, ata_pci_teardown_intr), DEVMETHOD(pci_read_config, ata_pci_read_config), DEVMETHOD(pci_write_config, ata_pci_write_config), + DEVMETHOD(bus_child_location_str, ata_pci_child_location_str), { 0, 0 } }; diff --git a/sys/dev/ata/ata-pci.h b/sys/dev/ata/ata-pci.h index 1378f87..7fa7644 100644 --- a/sys/dev/ata/ata-pci.h +++ b/sys/dev/ata/ata-pci.h @@ -502,6 +502,8 @@ int ata_pci_write_ivar(device_t dev, device_t child, int which, uintptr_t value) uint32_t ata_pci_read_config(device_t dev, device_t child, int reg, int width); void ata_pci_write_config(device_t dev, device_t child, int reg, uint32_t val, int width); +int ata_pci_child_location_str(device_t dev, device_t child, char *buf, + size_t buflen); struct resource * ata_pci_alloc_resource(device_t dev, device_t child, int type, int *rid, u_long start, u_long end, u_long count, u_int flags); int ata_pci_release_resource(device_t dev, device_t child, int type, int rid, struct resource *r); int ata_pci_setup_intr(device_t dev, device_t child, struct resource *irq, int flags, driver_filter_t *filter, driver_intr_t *function, void *argument, void **cookiep); @@ -550,6 +552,7 @@ static device_method_t __CONCAT(dname,_methods)[] = { \ DEVMETHOD(bus_teardown_intr, ata_pci_teardown_intr), \ DEVMETHOD(pci_read_config, ata_pci_read_config), \ DEVMETHOD(pci_write_config, ata_pci_write_config), \ + DEVMETHOD(bus_child_location_str, ata_pci_child_location_str), \ { 0, 0 } \ }; \ static driver_t __CONCAT(dname,_driver) = { \ |