summaryrefslogtreecommitdiffstats
path: root/sys/dev/ata/chipsets/ata-ahci.c
diff options
context:
space:
mode:
authormav <mav@FreeBSD.org>2009-02-18 22:17:48 +0000
committermav <mav@FreeBSD.org>2009-02-18 22:17:48 +0000
commitf10246717a6419e9755a0fbdd0a21da8b769c8f9 (patch)
treec51d12167c13be63889b1950e54f936d14b2ba41 /sys/dev/ata/chipsets/ata-ahci.c
parentbf75b4612ae760eeef7dbe0b2544c2532419caac (diff)
downloadFreeBSD-src-f10246717a6419e9755a0fbdd0a21da8b769c8f9.zip
FreeBSD-src-f10246717a6419e9755a0fbdd0a21da8b769c8f9.tar.gz
As soon as they called in only same one place (ata_pcichannel_attach()),
join allocate() and dmainit() atapci subdriver's channel initialization methods into single ch_attach() method. As opposite to ch_attach() add new ch_detach() method to deallocate/disable channel.
Diffstat (limited to 'sys/dev/ata/chipsets/ata-ahci.c')
-rw-r--r--sys/dev/ata/chipsets/ata-ahci.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/dev/ata/chipsets/ata-ahci.c b/sys/dev/ata/chipsets/ata-ahci.c
index 6e14db1d..1221151 100644
--- a/sys/dev/ata/chipsets/ata-ahci.c
+++ b/sys/dev/ata/chipsets/ata-ahci.c
@@ -128,8 +128,7 @@ ata_ahci_chipinit(device_t dev)
(ATA_INL(ctlr->r_res2, ATA_AHCI_CAP) & ATA_AHCI_NPMASK) + 1);
ctlr->reset = ata_ahci_reset;
- ctlr->dmainit = ata_ahci_dmainit;
- ctlr->allocate = ata_ahci_allocate;
+ ctlr->ch_attach = ata_ahci_ch_attach;
ctlr->setmode = ata_sata_setmode;
ctlr->suspend = ata_ahci_suspend;
ctlr->resume = ata_ahci_ctlr_reset;
@@ -197,12 +196,14 @@ ata_ahci_suspend(device_t dev)
int
-ata_ahci_allocate(device_t dev)
+ata_ahci_ch_attach(device_t dev)
{
struct ata_pci_controller *ctlr = device_get_softc(device_get_parent(dev));
struct ata_channel *ch = device_get_softc(dev);
int offset = ch->unit << 7;
+ ata_ahci_dmainit(dev);
+
/* set the SATA resources */
ch->r_io[ATA_SSTATUS].res = ctlr->r_res2;
ch->r_io[ATA_SSTATUS].offset = ATA_AHCI_P_SSTS + offset;
OpenPOWER on IntegriCloud