aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
author <jgarzik@pretzel.yyz.us>2005-06-04 01:02:00 -0400
committerJeff Garzik <jgarzik@pobox.com>2005-06-04 01:02:00 -0400
commit70c85233814949184070ee35f8929dde64402dc9 (patch)
tree4a44a9a886be12b9477fd254d693f4fbb0297527
parent31c94a6e987af162ac5ede83cddf49870cd1f2ed (diff)
parent73561695b2e77473e353a5ae63bab81ed5098d8e (diff)
Merge of /spare/repo/libata-dev branch bridge-detect
-rw-r--r--drivers/scsi/libata-core.c35
-rw-r--r--include/linux/ata.h1
-rw-r--r--include/linux/libata.h1
3 files changed, 35 insertions, 2 deletions
diff --git a/drivers/scsi/libata-core.c b/drivers/scsi/libata-core.c
index 21d194c6ace3..84c4770e5bb4 100644
--- a/drivers/scsi/libata-core.c
+++ b/drivers/scsi/libata-core.c
@@ -1295,6 +1295,37 @@ err_out:
1295 DPRINTK("EXIT, err\n"); 1295 DPRINTK("EXIT, err\n");
1296} 1296}
1297 1297
1298
1299static inline u8 ata_dev_knobble(struct ata_port *ap)
1300{
1301 return ((ap->cbl == ATA_CBL_SATA) && (!ata_id_is_sata(ap->device->id)));
1302}
1303
1304/**
1305 * ata_dev_config - Run device specific handlers and check for
1306 * SATA->PATA bridges
1307 * @ap: Bus
1308 * @i: Device
1309 *
1310 * LOCKING:
1311 */
1312
1313void ata_dev_config(struct ata_port *ap, unsigned int i)
1314{
1315 /* limit bridge transfers to udma5, 200 sectors */
1316 if (ata_dev_knobble(ap)) {
1317 printk(KERN_INFO "ata%u(%u): applying bridge limits\n",
1318 ap->id, ap->device->devno);
1319 ap->udma_mask &= ATA_UDMA5;
1320 ap->host->max_sectors = ATA_MAX_SECTORS;
1321 ap->host->hostt->max_sectors = ATA_MAX_SECTORS;
1322 ap->device->flags |= ATA_DFLAG_LOCK_SECTORS;
1323 }
1324
1325 if (ap->ops->dev_config)
1326 ap->ops->dev_config(ap, &ap->device[i]);
1327}
1328
1298/** 1329/**
1299 * ata_bus_probe - Reset and probe ATA bus 1330 * ata_bus_probe - Reset and probe ATA bus
1300 * @ap: Bus to probe 1331 * @ap: Bus to probe
@@ -1322,8 +1353,7 @@ static int ata_bus_probe(struct ata_port *ap)
1322 ata_dev_identify(ap, i); 1353 ata_dev_identify(ap, i);
1323 if (ata_dev_present(&ap->device[i])) { 1354 if (ata_dev_present(&ap->device[i])) {
1324 found = 1; 1355 found = 1;
1325 if (ap->ops->dev_config) 1356 ata_dev_config(ap,i);
1326 ap->ops->dev_config(ap, &ap->device[i]);
1327 } 1357 }
1328 } 1358 }
1329 1359
@@ -4408,6 +4438,7 @@ EXPORT_SYMBOL_GPL(ata_scsi_release);
4408EXPORT_SYMBOL_GPL(ata_host_intr); 4438EXPORT_SYMBOL_GPL(ata_host_intr);
4409EXPORT_SYMBOL_GPL(ata_dev_classify); 4439EXPORT_SYMBOL_GPL(ata_dev_classify);
4410EXPORT_SYMBOL_GPL(ata_dev_id_string); 4440EXPORT_SYMBOL_GPL(ata_dev_id_string);
4441EXPORT_SYMBOL_GPL(ata_dev_config);
4411EXPORT_SYMBOL_GPL(ata_scsi_simulate); 4442EXPORT_SYMBOL_GPL(ata_scsi_simulate);
4412 4443
4413#ifdef CONFIG_PCI 4444#ifdef CONFIG_PCI
diff --git a/include/linux/ata.h b/include/linux/ata.h
index f178894edd04..ca5fcadf9981 100644
--- a/include/linux/ata.h
+++ b/include/linux/ata.h
@@ -224,6 +224,7 @@ struct ata_taskfile {
224}; 224};
225 225
226#define ata_id_is_ata(id) (((id)[0] & (1 << 15)) == 0) 226#define ata_id_is_ata(id) (((id)[0] & (1 << 15)) == 0)
227#define ata_id_is_sata(id) ((id)[93] == 0)
227#define ata_id_rahead_enabled(id) ((id)[85] & (1 << 6)) 228#define ata_id_rahead_enabled(id) ((id)[85] & (1 << 6))
228#define ata_id_wcache_enabled(id) ((id)[85] & (1 << 5)) 229#define ata_id_wcache_enabled(id) ((id)[85] & (1 << 5))
229#define ata_id_has_flush(id) ((id)[83] & (1 << 12)) 230#define ata_id_has_flush(id) ((id)[83] & (1 << 12))
diff --git a/include/linux/libata.h b/include/linux/libata.h
index b009f801e7c5..6cd9ba63563b 100644
--- a/include/linux/libata.h
+++ b/include/linux/libata.h
@@ -421,6 +421,7 @@ extern void ata_sg_init(struct ata_queued_cmd *qc, struct scatterlist *sg,
421extern unsigned int ata_dev_classify(struct ata_taskfile *tf); 421extern unsigned int ata_dev_classify(struct ata_taskfile *tf);
422extern void ata_dev_id_string(u16 *id, unsigned char *s, 422extern void ata_dev_id_string(u16 *id, unsigned char *s,
423 unsigned int ofs, unsigned int len); 423 unsigned int ofs, unsigned int len);
424extern void ata_dev_config(struct ata_port *ap, unsigned int i);
424extern void ata_bmdma_setup (struct ata_queued_cmd *qc); 425extern void ata_bmdma_setup (struct ata_queued_cmd *qc);
425extern void ata_bmdma_start (struct ata_queued_cmd *qc); 426extern void ata_bmdma_start (struct ata_queued_cmd *qc);
426extern void ata_bmdma_stop(struct ata_port *ap); 427extern void ata_bmdma_stop(struct ata_port *ap);