aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata/libata-core.c
diff options
context:
space:
mode:
authorTejun Heo <htejun@gmail.com>2007-09-23 00:14:11 -0400
committerJeff Garzik <jeff@garzik.org>2007-10-12 14:55:40 -0400
commit854c73a2f1c3bcc4aa88c25e208dc597e8efb795 (patch)
tree210569f3c4fa4f9413ceb0bc3fcf89648a9894b2 /drivers/ata/libata-core.c
parentc78968bb0f7714ceba1cdfa23714454fc98cefdf (diff)
libata: misc updates for AN
Update AN support in preparation of PMP support. * s/ata_id_has_AN/ata_id_has_atapi_AN/ * add AN enabled reporting during configuration * add err_mask to AN configuration failure reporting * update LOCKING comment for ata_scsi_media_change_notify() * check whether ATA dev is attached to SCSI dev ata_scsi_media_change_notify() * set ATA_FLAG_AN in ahci and sata_sil24 Signed-off-by: Tejun Heo <htejun@gmail.com> Cc: Kriten Carlson Accardi <kristen.c.accardi@intel.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/ata/libata-core.c')
-rw-r--r--drivers/ata/libata-core.c24
1 files changed, 14 insertions, 10 deletions
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index 8d425064ce2..1daea1caf3e 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -2010,7 +2010,8 @@ int ata_dev_configure(struct ata_device *dev)
2010 2010
2011 /* ATAPI-specific feature tests */ 2011 /* ATAPI-specific feature tests */
2012 else if (dev->class == ATA_DEV_ATAPI) { 2012 else if (dev->class == ATA_DEV_ATAPI) {
2013 char *cdb_intr_string = ""; 2013 const char *cdb_intr_string = "";
2014 const char *atapi_an_string = "";
2014 2015
2015 rc = atapi_cdb_len(id); 2016 rc = atapi_cdb_len(id);
2016 if ((rc < 12) || (rc > ATAPI_CDB_LEN)) { 2017 if ((rc < 12) || (rc > ATAPI_CDB_LEN)) {
@@ -2026,16 +2027,19 @@ int ata_dev_configure(struct ata_device *dev)
2026 * check to see if this ATAPI device supports 2027 * check to see if this ATAPI device supports
2027 * Asynchronous Notification 2028 * Asynchronous Notification
2028 */ 2029 */
2029 if ((ap->flags & ATA_FLAG_AN) && ata_id_has_AN(id)) { 2030 if ((ap->flags & ATA_FLAG_AN) && ata_id_has_atapi_AN(id)) {
2030 int err; 2031 unsigned int err_mask;
2032
2031 /* issue SET feature command to turn this on */ 2033 /* issue SET feature command to turn this on */
2032 err = ata_dev_set_AN(dev, SETFEATURES_SATA_ENABLE); 2034 err_mask = ata_dev_set_AN(dev, SETFEATURES_SATA_ENABLE);
2033 if (err) 2035 if (err_mask)
2034 ata_dev_printk(dev, KERN_ERR, 2036 ata_dev_printk(dev, KERN_ERR,
2035 "unable to set AN, err %x\n", 2037 "failed to enable ATAPI AN "
2036 err); 2038 "(err_mask=0x%x)\n", err_mask);
2037 else 2039 else {
2038 dev->flags |= ATA_DFLAG_AN; 2040 dev->flags |= ATA_DFLAG_AN;
2041 atapi_an_string = ", ATAPI AN";
2042 }
2039 } 2043 }
2040 2044
2041 if (ata_id_cdb_intr(dev->id)) { 2045 if (ata_id_cdb_intr(dev->id)) {
@@ -2046,10 +2050,10 @@ int ata_dev_configure(struct ata_device *dev)
2046 /* print device info to dmesg */ 2050 /* print device info to dmesg */
2047 if (ata_msg_drv(ap) && print_info) 2051 if (ata_msg_drv(ap) && print_info)
2048 ata_dev_printk(dev, KERN_INFO, 2052 ata_dev_printk(dev, KERN_INFO,
2049 "ATAPI: %s, %s, max %s%s\n", 2053 "ATAPI: %s, %s, max %s%s%s\n",
2050 modelbuf, fwrevbuf, 2054 modelbuf, fwrevbuf,
2051 ata_mode_string(xfer_mask), 2055 ata_mode_string(xfer_mask),
2052 cdb_intr_string); 2056 cdb_intr_string, atapi_an_string);
2053 } 2057 }
2054 2058
2055 /* determine max_sectors */ 2059 /* determine max_sectors */