diff options
author | mav <mav@FreeBSD.org> | 2009-02-19 00:32:55 +0000 |
---|---|---|
committer | mav <mav@FreeBSD.org> | 2009-02-19 00:32:55 +0000 |
commit | 049011f572eea1020696967e53537c23d04c613d (patch) | |
tree | d0db707a28184efa663d8a1c183d38fc63966fb2 /sys/dev/ata/ata-pci.c | |
parent | b25019649c73794eeefae1f2ac382ead9d51ebff (diff) | |
download | FreeBSD-src-049011f572eea1020696967e53537c23d04c613d.zip FreeBSD-src-049011f572eea1020696967e53537c23d04c613d.tar.gz |
Quite mechanical ch_detach implementations for all atapci subdrivers.
Some dmainit call fixes for previous commit.
Diffstat (limited to 'sys/dev/ata/ata-pci.c')
-rw-r--r-- | sys/dev/ata/ata-pci.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/sys/dev/ata/ata-pci.c b/sys/dev/ata/ata-pci.c index d05d0b5..ebba094 100644 --- a/sys/dev/ata/ata-pci.c +++ b/sys/dev/ata/ata-pci.c @@ -100,6 +100,7 @@ ata_pci_attach(device_t dev) ctlr->channels = 1; ctlr->ichannels = -1; ctlr->ch_attach = ata_pci_ch_attach; + ctlr->ch_detach = ata_pci_ch_detach; ctlr->dev = dev; /* if needed try to enable busmastering */ @@ -382,6 +383,21 @@ ata_pci_ch_attach(device_t dev) } int +ata_pci_ch_detach(device_t dev) +{ + struct ata_channel *ch = device_get_softc(dev); + + ata_pci_dmafini(dev); + + bus_release_resource(dev, SYS_RES_IOPORT, ATA_CTLADDR_RID, + ch->r_io[ATA_CONTROL].res); + bus_release_resource(dev, SYS_RES_IOPORT, ATA_IOADDR_RID, + ch->r_io[ATA_IDX_ADDR].res); + + return (0); +} + +int ata_pci_status(device_t dev) { struct ata_pci_controller *controller = @@ -477,6 +493,12 @@ ata_pci_dmainit(device_t dev) ch->dma.reset = ata_pci_dmareset; } +void +ata_pci_dmafini(device_t dev) +{ + + ata_dmafini(dev); +} static device_method_t ata_pci_methods[] = { /* device interface */ |