aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/libata-core.c
diff options
context:
space:
mode:
authorTejun Heo <htejun@gmail.com>2006-03-01 02:09:36 -0500
committerJeff Garzik <jeff@garzik.org>2006-03-03 17:31:04 -0500
commit4b2f3ededc035525038a7a9247074243dac6b351 (patch)
treebec580eaa78fc8383773b8378e9736551ff955a1 /drivers/scsi/libata-core.c
parentffeae418c12a304f6a9b6468043954d4e67a2b1e (diff)
[PATCH] libata: fold ata_dev_config() into ata_dev_configure()
ata_dev_config() needs to be done everytime a device is configured. Fold it into ata_dev_configure(). Signed-off-by: Tejun Heo <htejun@gmail.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/scsi/libata-core.c')
-rw-r--r--drivers/scsi/libata-core.c48
1 files changed, 17 insertions, 31 deletions
diff --git a/drivers/scsi/libata-core.c b/drivers/scsi/libata-core.c
index ba26c66cc11b..10803f72c57d 100644
--- a/drivers/scsi/libata-core.c
+++ b/drivers/scsi/libata-core.c
@@ -1053,6 +1053,12 @@ static int ata_dev_read_id(struct ata_port *ap, struct ata_device *dev,
1053 return rc; 1053 return rc;
1054} 1054}
1055 1055
1056static inline u8 ata_dev_knobble(const struct ata_port *ap,
1057 struct ata_device *dev)
1058{
1059 return ((ap->cbl == ATA_CBL_SATA) && (!ata_id_is_sata(dev->id)));
1060}
1061
1056/** 1062/**
1057 * ata_dev_configure - Configure the specified ATA/ATAPI device 1063 * ata_dev_configure - Configure the specified ATA/ATAPI device
1058 * @ap: Port on which target device resides 1064 * @ap: Port on which target device resides
@@ -1167,6 +1173,17 @@ static int ata_dev_configure(struct ata_port *ap, struct ata_device *dev)
1167 ap->host->max_cmd_len, 1173 ap->host->max_cmd_len,
1168 ap->device[i].cdb_len); 1174 ap->device[i].cdb_len);
1169 1175
1176 /* limit bridge transfers to udma5, 200 sectors */
1177 if (ata_dev_knobble(ap, dev)) {
1178 printk(KERN_INFO "ata%u(%u): applying bridge limits\n",
1179 ap->id, dev->devno);
1180 ap->udma_mask &= ATA_UDMA5;
1181 dev->max_sectors = ATA_MAX_SECTORS;
1182 }
1183
1184 if (ap->ops->dev_config)
1185 ap->ops->dev_config(ap, dev);
1186
1170 DPRINTK("EXIT, drv_stat = 0x%x\n", ata_chk_status(ap)); 1187 DPRINTK("EXIT, drv_stat = 0x%x\n", ata_chk_status(ap));
1171 return 0; 1188 return 0;
1172 1189
@@ -1177,35 +1194,6 @@ err_out_nosup:
1177 return rc; 1194 return rc;
1178} 1195}
1179 1196
1180
1181static inline u8 ata_dev_knobble(const struct ata_port *ap,
1182 struct ata_device *dev)
1183{
1184 return ((ap->cbl == ATA_CBL_SATA) && (!ata_id_is_sata(dev->id)));
1185}
1186
1187/**
1188 * ata_dev_config - Run device specific handlers & check for SATA->PATA bridges
1189 * @ap: Bus
1190 * @i: Device
1191 *
1192 * LOCKING:
1193 */
1194
1195void ata_dev_config(struct ata_port *ap, unsigned int i)
1196{
1197 /* limit bridge transfers to udma5, 200 sectors */
1198 if (ata_dev_knobble(ap, &ap->device[i])) {
1199 printk(KERN_INFO "ata%u(%u): applying bridge limits\n",
1200 ap->id, i);
1201 ap->udma_mask &= ATA_UDMA5;
1202 ap->device[i].max_sectors = ATA_MAX_SECTORS;
1203 }
1204
1205 if (ap->ops->dev_config)
1206 ap->ops->dev_config(ap, &ap->device[i]);
1207}
1208
1209/** 1197/**
1210 * ata_bus_probe - Reset and probe ATA bus 1198 * ata_bus_probe - Reset and probe ATA bus
1211 * @ap: Bus to probe 1199 * @ap: Bus to probe
@@ -1266,7 +1254,6 @@ static int ata_bus_probe(struct ata_port *ap)
1266 continue; 1254 continue;
1267 } 1255 }
1268 1256
1269 ata_dev_config(ap, i);
1270 found = 1; 1257 found = 1;
1271 } 1258 }
1272 1259
@@ -4967,7 +4954,6 @@ EXPORT_SYMBOL_GPL(ata_host_intr);
4967EXPORT_SYMBOL_GPL(ata_dev_classify); 4954EXPORT_SYMBOL_GPL(ata_dev_classify);
4968EXPORT_SYMBOL_GPL(ata_id_string); 4955EXPORT_SYMBOL_GPL(ata_id_string);
4969EXPORT_SYMBOL_GPL(ata_id_c_string); 4956EXPORT_SYMBOL_GPL(ata_id_c_string);
4970EXPORT_SYMBOL_GPL(ata_dev_config);
4971EXPORT_SYMBOL_GPL(ata_scsi_simulate); 4957EXPORT_SYMBOL_GPL(ata_scsi_simulate);
4972EXPORT_SYMBOL_GPL(ata_eh_qc_complete); 4958EXPORT_SYMBOL_GPL(ata_eh_qc_complete);
4973EXPORT_SYMBOL_GPL(ata_eh_qc_retry); 4959EXPORT_SYMBOL_GPL(ata_eh_qc_retry);