aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/libata.h
diff options
context:
space:
mode:
authorTejun Heo <htejun@gmail.com>2006-05-15 07:57:46 -0400
committerTejun Heo <htejun@gmail.com>2006-05-15 07:57:46 -0400
commit34bf21704c848fe00c516d1c8f163db08b70b137 (patch)
tree8482de3ddf6ff1b02ff9ddfd027d2478c7ecd7ac /include/linux/libata.h
parent838df6284c54447efae956fb9c243d8ba4ab0f47 (diff)
[PATCH] libata: implement new SCR handling and port on/offline functions
Implement ata_scr_{valid|read|write|write_flush}() and ata_port_{online|offline}(). These functions replace scr_{read|write}() and sata_dev_present(). Major difference between between the new SCR functions and the old ones is that the new ones have a way to signal error to the caller. This makes handling SCR-available and SCR-unavailable cases in the same path easier. Also, it eases later PM implementation where SCR access can fail due to various reasons. ata_port_{online|offline}() functions return 1 only when they are affirmitive of the condition. e.g. if SCR is unaccessible or presence cannot be determined for other reasons, these functions return 0. So, ata_port_online() != !ata_port_offline(). This distinction is useful in many exception handling cases. Signed-off-by: Tejun Heo <htejun@gmail.com>
Diffstat (limited to 'include/linux/libata.h')
-rw-r--r--include/linux/libata.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/linux/libata.h b/include/linux/libata.h
index a4b8a419caad..47b97157995d 100644
--- a/include/linux/libata.h
+++ b/include/linux/libata.h
@@ -536,6 +536,12 @@ extern int ata_scsi_ioctl(struct scsi_device *dev, int cmd, void __user *arg);
536extern int ata_scsi_queuecmd(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)); 536extern int ata_scsi_queuecmd(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *));
537extern int ata_scsi_release(struct Scsi_Host *host); 537extern int ata_scsi_release(struct Scsi_Host *host);
538extern unsigned int ata_host_intr(struct ata_port *ap, struct ata_queued_cmd *qc); 538extern unsigned int ata_host_intr(struct ata_port *ap, struct ata_queued_cmd *qc);
539extern int sata_scr_valid(struct ata_port *ap);
540extern int sata_scr_read(struct ata_port *ap, int reg, u32 *val);
541extern int sata_scr_write(struct ata_port *ap, int reg, u32 val);
542extern int sata_scr_write_flush(struct ata_port *ap, int reg, u32 val);
543extern int ata_port_online(struct ata_port *ap);
544extern int ata_port_offline(struct ata_port *ap);
539extern int ata_scsi_device_resume(struct scsi_device *); 545extern int ata_scsi_device_resume(struct scsi_device *);
540extern int ata_scsi_device_suspend(struct scsi_device *, pm_message_t state); 546extern int ata_scsi_device_suspend(struct scsi_device *, pm_message_t state);
541extern int ata_device_resume(struct ata_port *, struct ata_device *); 547extern int ata_device_resume(struct ata_port *, struct ata_device *);