diff options
author | mav <mav@FreeBSD.org> | 2009-02-16 19:10:07 +0000 |
---|---|---|
committer | mav <mav@FreeBSD.org> | 2009-02-16 19:10:07 +0000 |
commit | 2faabf52c8c4a36ab3aa958abb2bead1a9ce8795 (patch) | |
tree | 28b0ab512687fe2f7043055c4277bac197f7df5a /sys/dev/ata/ata-pci.c | |
parent | 73a32c3f96222b8f118fa826a1bb60bf586c4733 (diff) | |
download | FreeBSD-src-2faabf52c8c4a36ab3aa958abb2bead1a9ce8795.zip FreeBSD-src-2faabf52c8c4a36ab3aa958abb2bead1a9ce8795.tar.gz |
Give atapci knowledge about set of implemented AHCI ports. It is possible
to not allocate them after the recent ata channels enumeration changes.
It allows to save some resources, not bother user with unexisting hardware
and not check unimplemented ports status on every interrupt.
Diffstat (limited to 'sys/dev/ata/ata-pci.c')
-rw-r--r-- | sys/dev/ata/ata-pci.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/sys/dev/ata/ata-pci.c b/sys/dev/ata/ata-pci.c index 62d41d0..68c209f 100644 --- a/sys/dev/ata/ata-pci.c +++ b/sys/dev/ata/ata-pci.c @@ -98,6 +98,7 @@ ata_pci_attach(device_t dev) ctlr->channels = 2; else ctlr->channels = 1; + ctlr->ichannels = -1; ctlr->allocate = ata_pci_allocate; ctlr->dmainit = ata_pci_dmainit; ctlr->dev = dev; @@ -122,6 +123,8 @@ ata_pci_attach(device_t dev) /* attach all channels on this controller */ for (unit = 0; unit < ctlr->channels; unit++) { + if ((ctlr->ichannels & (1 << unit)) == 0) + continue; child = device_add_child(dev, "ata", ((unit == 0 || unit == 1) && ctlr->legacy) ? unit : devclass_find_free_unit(ata_devclass, 2)); |