summaryrefslogtreecommitdiffstats
path: root/sys/dev/ata/ata-pci.c
diff options
context:
space:
mode:
authormav <mav@FreeBSD.org>2009-03-30 22:18:38 +0000
committermav <mav@FreeBSD.org>2009-03-30 22:18:38 +0000
commitd4ed9d6887a6828e3bc3925a80a1c36e526275a2 (patch)
tree8b14f8d516ed7f249e9c59ba2ec27c475ea3a397 /sys/dev/ata/ata-pci.c
parentab91849b30614e59f7ed6899853f1a1335930965 (diff)
downloadFreeBSD-src-d4ed9d6887a6828e3bc3925a80a1c36e526275a2.zip
FreeBSD-src-d4ed9d6887a6828e3bc3925a80a1c36e526275a2.tar.gz
Integrate user/mav/ata branch:
Add ch_suspend/ch_resume methods for PCI controllers and implement them for AHCI. Refactor AHCI channel initialization according to it. Fix Port Multipliers operation. It is far from perfect yet, but works now. Tested with JMicron JMB363 AHCI + SiI 3726 PMP pair. Previous version was also tested with SiI 4726 PMP. Hardware sponsored by: Vitsch Electronics / VEHosting.nl
Diffstat (limited to 'sys/dev/ata/ata-pci.c')
-rw-r--r--sys/dev/ata/ata-pci.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/sys/dev/ata/ata-pci.c b/sys/dev/ata/ata-pci.c
index 97261d2..5fe26a8 100644
--- a/sys/dev/ata/ata-pci.c
+++ b/sys/dev/ata/ata-pci.c
@@ -584,22 +584,35 @@ ata_pcichannel_detach(device_t dev)
static int
ata_pcichannel_suspend(device_t dev)
{
+ struct ata_pci_controller *ctlr = device_get_softc(device_get_parent(dev));
struct ata_channel *ch = device_get_softc(dev);
+ int error;
if (!ch->attached)
return (0);
- return ata_suspend(dev);
+ if ((error = ata_suspend(dev)))
+ return (error);
+
+ if (ctlr->ch_suspend != NULL && (error = ctlr->ch_suspend(dev)))
+ return (error);
+
+ return (0);
}
static int
ata_pcichannel_resume(device_t dev)
{
+ struct ata_pci_controller *ctlr = device_get_softc(device_get_parent(dev));
struct ata_channel *ch = device_get_softc(dev);
+ int error;
if (!ch->attached)
return (0);
+ if (ctlr->ch_resume != NULL && (error = ctlr->ch_resume(dev)))
+ return (error);
+
return ata_resume(dev);
}
OpenPOWER on IntegriCloud