Cleanup the storing and printing of the device transfermode for SATA.

This commit is contained in:
Søren Schmidt 2004-09-01 12:15:44 +00:00
parent e6e1974ba5
commit 8ea3547a15
2 changed files with 12 additions and 14 deletions

View File

@ -188,13 +188,16 @@ ata_sata_setmode(struct ata_device *atadev, int mode)
* Marvell 88SX8030 SATA->PATA converters and UDMA6/ATA133.
*/
if (atadev->param->satacapabilities != 0x0000 &&
atadev->param->satacapabilities != 0xffff)
mode = ata_limit_mode(atadev, mode, ATA_UDMA6);
else
atadev->param->satacapabilities != 0xffff) {
if (!ata_controlcmd(atadev, ATA_SETFEATURES, ATA_SF_SETXFER, 0,
ata_limit_mode(atadev, mode, ATA_UDMA6)))
atadev->mode = ATA_SA150;
}
else {
mode = ata_limit_mode(atadev, mode, ATA_UDMA5);
if (!ata_controlcmd(atadev, ATA_SETFEATURES, ATA_SF_SETXFER, 0, mode))
atadev->mode = mode;
if (!ata_controlcmd(atadev, ATA_SETFEATURES, ATA_SF_SETXFER, 0, mode))
atadev->mode = mode;
}
}
/*

View File

@ -393,7 +393,7 @@ ad_print(struct ad_softc *adp)
}
else {
ata_prtdev(adp->device,
"%lluMB <%.40s/%.8s> [%lld/%d/%d] at ata%d-%s %s",
"%lluMB <%.40s/%.8s> [%lld/%d/%d] at ata%d-%s %s%s\n",
(unsigned long long)(adp->total_secs /
((1024L * 1024L) / DEV_BSIZE)),
adp->device->param->model, adp->device->param->revision,
@ -402,13 +402,8 @@ ad_print(struct ad_softc *adp)
adp->heads, adp->sectors,
device_get_unit(adp->device->channel->dev),
(adp->device->unit == ATA_MASTER) ? "master" : "slave",
(adp->flags & AD_F_TAG_ENABLED) ? "tagged " : "");
if (adp->device->param->satacapabilities != 0x0000 &&
adp->device->param->satacapabilities != 0xffff)
printf("SATA150\n");
else
printf("%s\n", ata_mode2str(adp->device->mode));
(adp->flags & AD_F_TAG_ENABLED) ? "tagged " : "",
ata_mode2str(adp->device->mode));
}
}