diff options
author | <jgarzik@pretzel.yyz.us> | 2005-06-04 01:02:00 -0400 |
---|---|---|
committer | Jeff Garzik <jgarzik@pobox.com> | 2005-06-04 01:02:00 -0400 |
commit | 70c85233814949184070ee35f8929dde64402dc9 (patch) | |
tree | 4a44a9a886be12b9477fd254d693f4fbb0297527 /drivers | |
parent | 31c94a6e987af162ac5ede83cddf49870cd1f2ed (diff) | |
parent | 73561695b2e77473e353a5ae63bab81ed5098d8e (diff) | |
download | op-kernel-dev-70c85233814949184070ee35f8929dde64402dc9.zip op-kernel-dev-70c85233814949184070ee35f8929dde64402dc9.tar.gz |
Merge of /spare/repo/libata-dev branch bridge-detect
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/scsi/libata-core.c | 35 |
1 files changed, 33 insertions, 2 deletions
diff --git a/drivers/scsi/libata-core.c b/drivers/scsi/libata-core.c index 21d194c..84c4770 100644 --- a/drivers/scsi/libata-core.c +++ b/drivers/scsi/libata-core.c @@ -1295,6 +1295,37 @@ err_out: DPRINTK("EXIT, err\n"); } + +static inline u8 ata_dev_knobble(struct ata_port *ap) +{ + return ((ap->cbl == ATA_CBL_SATA) && (!ata_id_is_sata(ap->device->id))); +} + +/** + * ata_dev_config - Run device specific handlers and check for + * SATA->PATA bridges + * @ap: Bus + * @i: Device + * + * LOCKING: + */ + +void ata_dev_config(struct ata_port *ap, unsigned int i) +{ + /* limit bridge transfers to udma5, 200 sectors */ + if (ata_dev_knobble(ap)) { + printk(KERN_INFO "ata%u(%u): applying bridge limits\n", + ap->id, ap->device->devno); + ap->udma_mask &= ATA_UDMA5; + ap->host->max_sectors = ATA_MAX_SECTORS; + ap->host->hostt->max_sectors = ATA_MAX_SECTORS; + ap->device->flags |= ATA_DFLAG_LOCK_SECTORS; + } + + if (ap->ops->dev_config) + ap->ops->dev_config(ap, &ap->device[i]); +} + /** * ata_bus_probe - Reset and probe ATA bus * @ap: Bus to probe @@ -1322,8 +1353,7 @@ static int ata_bus_probe(struct ata_port *ap) ata_dev_identify(ap, i); if (ata_dev_present(&ap->device[i])) { found = 1; - if (ap->ops->dev_config) - ap->ops->dev_config(ap, &ap->device[i]); + ata_dev_config(ap,i); } } @@ -4408,6 +4438,7 @@ EXPORT_SYMBOL_GPL(ata_scsi_release); EXPORT_SYMBOL_GPL(ata_host_intr); EXPORT_SYMBOL_GPL(ata_dev_classify); EXPORT_SYMBOL_GPL(ata_dev_id_string); +EXPORT_SYMBOL_GPL(ata_dev_config); EXPORT_SYMBOL_GPL(ata_scsi_simulate); #ifdef CONFIG_PCI |