diff options
| author | Søren Schmidt <sos@FreeBSD.org> | 2006-03-31 08:09:05 +0000 |
|---|---|---|
| committer | Søren Schmidt <sos@FreeBSD.org> | 2006-03-31 08:09:05 +0000 |
| commit | cd8a592bb327c93f8536eb8b63c8be1b8a3ddc74 (patch) | |
| tree | 7c4941b618af6a1a0f056695a87cb959f3542b3c /sys/dev/ata/ata-disk.c | |
| parent | 3bbd6d8ae6b131abe508cdec69e09315b7788af5 (diff) | |
Notes
Diffstat (limited to 'sys/dev/ata/ata-disk.c')
| -rw-r--r-- | sys/dev/ata/ata-disk.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/sys/dev/ata/ata-disk.c b/sys/dev/ata/ata-disk.c index fb8942e11708..6d90b409ba0b 100644 --- a/sys/dev/ata/ata-disk.c +++ b/sys/dev/ata/ata-disk.c @@ -71,7 +71,8 @@ ad_probe(device_t dev) struct ata_device *atadev = device_get_softc(dev); if (!(atadev->param.config & ATA_PROTO_ATAPI) || - (atadev->param.config == ATA_CFA_MAGIC)) + (atadev->param.config == ATA_CFA_MAGIC1) || + (atadev->param.config == ATA_CFA_MAGIC2)) return 0; else return ENXIO; @@ -295,8 +296,14 @@ ad_dump(void *arg, void *virtual, vm_offset_t physical, struct bio bp; /* length zero is special and really means flush buffers to media */ - if (!length) - return ata_controlcmd(dp->d_drv1, ATA_FLUSHCACHE, 0, 0, 0); + if (!length) { + struct ata_device *atadev = device_get_softc(dp->d_drv1); + int error = 0; + + if (atadev->param.support.command2 & ATA_SUPPORT_FLUSHCACHE) + error = ata_controlcmd(dp->d_drv1, ATA_FLUSHCACHE, 0, 0, 0); + return error; + } bzero(&bp, sizeof(struct bio)); bp.bio_disk = dp; |
