diff options
| author | Søren Schmidt <sos@FreeBSD.org> | 2006-01-18 10:02:23 +0000 |
|---|---|---|
| committer | Søren Schmidt <sos@FreeBSD.org> | 2006-01-18 10:02:23 +0000 |
| commit | ac1731fb20948a4ee9714a78eb4674e9f2ed8cec (patch) | |
| tree | d7f819ae96a3a1333d10415f2ad8a05071aa9be1 /sys/dev/ata/ata-chipset.c | |
| parent | d0b8e0391490c7927c98c80c021a5fce61459b6c (diff) | |
Notes
Diffstat (limited to 'sys/dev/ata/ata-chipset.c')
| -rw-r--r-- | sys/dev/ata/ata-chipset.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/sys/dev/ata/ata-chipset.c b/sys/dev/ata/ata-chipset.c index 2570c6b11d8c..a5979c82c36f 100644 --- a/sys/dev/ata/ata-chipset.c +++ b/sys/dev/ata/ata-chipset.c @@ -338,9 +338,18 @@ ata_sata_setmode(device_t dev, int mode) */ if (atadev->param.satacapabilities != 0x0000 && atadev->param.satacapabilities != 0xffff) { - if (!ata_controlcmd(dev, ATA_SETFEATURES, ATA_SF_SETXFER, 0, - ata_limit_mode(dev, mode, ATA_UDMA6))) - /* XXX SOS we should query SATA STATUS for the speed */ + struct ata_channel *ch = device_get_softc(device_get_parent(dev)); + int status; + + /* on some drives we need to set the transfer mode */ + ata_controlcmd(dev, ATA_SETFEATURES, ATA_SF_SETXFER, 0, + ata_limit_mode(dev, mode, ATA_UDMA6)); + + /* query SATA STATUS for the speed */ + status = ATA_IDX_INL(ch, ATA_SSTATUS); + if ((status & ATA_SS_CONWELL_MASK) == ATA_SS_CONWELL_GEN2) + atadev->mode = ATA_SA300; + else atadev->mode = ATA_SA150; } else { |
