aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTejun Heo <htejun@gmail.com>2007-09-23 00:14:12 -0400
committerJeff Garzik <jeff@garzik.org>2007-10-12 14:55:40 -0400
commite0a7175263db4a226558883a51a88a5d2bc5d9fe (patch)
treef9d23742df7f8a461ff63ad5be190f6a17742dd8
parent854c73a2f1c3bcc4aa88c25e208dc597e8efb795 (diff)
libata-pmp-prep: add PMP related constants, fields, ops and update helpers
Add PMP related constants, fields and ops. Also, update ata_class_enabled/disabled() such that PMP classes are considered. Signed-off-by: Tejun Heo <htejun@gmail.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
-rw-r--r--include/linux/libata.h30
1 files changed, 26 insertions, 4 deletions
diff --git a/include/linux/libata.h b/include/linux/libata.h
index 3ab2196c651a..c3820f105ffa 100644
--- a/include/linux/libata.h
+++ b/include/linux/libata.h
@@ -155,7 +155,11 @@ enum {
155 ATA_DEV_ATA_UNSUP = 2, /* ATA device (unsupported) */ 155 ATA_DEV_ATA_UNSUP = 2, /* ATA device (unsupported) */
156 ATA_DEV_ATAPI = 3, /* ATAPI device */ 156 ATA_DEV_ATAPI = 3, /* ATAPI device */
157 ATA_DEV_ATAPI_UNSUP = 4, /* ATAPI device (unsupported) */ 157 ATA_DEV_ATAPI_UNSUP = 4, /* ATAPI device (unsupported) */
158 ATA_DEV_NONE = 5, /* no device */ 158 ATA_DEV_PMP = 5, /* SATA port multiplier */
159 ATA_DEV_PMP_UNSUP = 6, /* SATA port multiplier (unsupported) */
160 ATA_DEV_SEMB = 7, /* SEMB */
161 ATA_DEV_SEMB_UNSUP = 8, /* SEMB (unsupported) */
162 ATA_DEV_NONE = 9, /* no device */
159 163
160 /* struct ata_link flags */ 164 /* struct ata_link flags */
161 ATA_LFLAG_HRST_TO_RESUME = (1 << 0), /* hardreset to resume link */ 165 ATA_LFLAG_HRST_TO_RESUME = (1 << 0), /* hardreset to resume link */
@@ -181,6 +185,7 @@ enum {
181 ATA_FLAG_NO_IORDY = (1 << 16), /* controller lacks iordy */ 185 ATA_FLAG_NO_IORDY = (1 << 16), /* controller lacks iordy */
182 ATA_FLAG_ACPI_SATA = (1 << 17), /* need native SATA ACPI layout */ 186 ATA_FLAG_ACPI_SATA = (1 << 17), /* need native SATA ACPI layout */
183 ATA_FLAG_AN = (1 << 18), /* controller supports AN */ 187 ATA_FLAG_AN = (1 << 18), /* controller supports AN */
188 ATA_FLAG_PMP = (1 << 19), /* controller supports PMP */
184 189
185 /* The following flag belongs to ap->pflags but is kept in 190 /* The following flag belongs to ap->pflags but is kept in
186 * ap->flags because it's referenced in many LLDs and will be 191 * ap->flags because it's referenced in many LLDs and will be
@@ -299,6 +304,10 @@ enum {
299 /* how hard are we gonna try to probe/recover devices */ 304 /* how hard are we gonna try to probe/recover devices */
300 ATA_PROBE_MAX_TRIES = 3, 305 ATA_PROBE_MAX_TRIES = 3,
301 ATA_EH_DEV_TRIES = 3, 306 ATA_EH_DEV_TRIES = 3,
307 ATA_EH_PMP_TRIES = 5,
308 ATA_EH_PMP_LINK_TRIES = 3,
309
310 SATA_PMP_SCR_TIMEOUT = 250,
302 311
303 /* Horkage types. May be set by libata or controller on drives 312 /* Horkage types. May be set by libata or controller on drives
304 (some horkage may be drive/controller pair dependant */ 313 (some horkage may be drive/controller pair dependant */
@@ -450,7 +459,12 @@ struct ata_device {
450 /* n_sector is used as CLEAR_OFFSET, read comment above CLEAR_OFFSET */ 459 /* n_sector is used as CLEAR_OFFSET, read comment above CLEAR_OFFSET */
451 u64 n_sectors; /* size of device, if ATA */ 460 u64 n_sectors; /* size of device, if ATA */
452 unsigned int class; /* ATA_DEV_xxx */ 461 unsigned int class; /* ATA_DEV_xxx */
453 u16 id[ATA_ID_WORDS]; /* IDENTIFY xxx DEVICE data */ 462
463 union {
464 u16 id[ATA_ID_WORDS]; /* IDENTIFY xxx DEVICE data */
465 u32 gscr[SATA_PMP_GSCR_DWORDS]; /* PMP GSCR block */
466 };
467
454 u8 pio_mode; 468 u8 pio_mode;
455 u8 dma_mode; 469 u8 dma_mode;
456 u8 xfer_mode; 470 u8 xfer_mode;
@@ -628,6 +642,12 @@ struct ata_port_operations {
628 void (*qc_prep) (struct ata_queued_cmd *qc); 642 void (*qc_prep) (struct ata_queued_cmd *qc);
629 unsigned int (*qc_issue) (struct ata_queued_cmd *qc); 643 unsigned int (*qc_issue) (struct ata_queued_cmd *qc);
630 644
645 /* port multiplier */
646 void (*pmp_attach) (struct ata_port *ap);
647 void (*pmp_detach) (struct ata_port *ap);
648 int (*pmp_read) (struct ata_device *dev, int pmp, int reg, u32 *r_val);
649 int (*pmp_write) (struct ata_device *dev, int pmp, int reg, u32 val);
650
631 /* Error handlers. ->error_handler overrides ->eng_timeout and 651 /* Error handlers. ->error_handler overrides ->eng_timeout and
632 * indicates that new-style EH is in place. 652 * indicates that new-style EH is in place.
633 */ 653 */
@@ -1033,12 +1053,14 @@ static inline unsigned int ata_tag_internal(unsigned int tag)
1033 */ 1053 */
1034static inline unsigned int ata_class_enabled(unsigned int class) 1054static inline unsigned int ata_class_enabled(unsigned int class)
1035{ 1055{
1036 return class == ATA_DEV_ATA || class == ATA_DEV_ATAPI; 1056 return class == ATA_DEV_ATA || class == ATA_DEV_ATAPI ||
1057 class == ATA_DEV_PMP || class == ATA_DEV_SEMB;
1037} 1058}
1038 1059
1039static inline unsigned int ata_class_disabled(unsigned int class) 1060static inline unsigned int ata_class_disabled(unsigned int class)
1040{ 1061{
1041 return class == ATA_DEV_ATA_UNSUP || class == ATA_DEV_ATAPI_UNSUP; 1062 return class == ATA_DEV_ATA_UNSUP || class == ATA_DEV_ATAPI_UNSUP ||
1063 class == ATA_DEV_PMP_UNSUP || class == ATA_DEV_SEMB_UNSUP;
1042} 1064}
1043 1065
1044static inline unsigned int ata_class_absent(unsigned int class) 1066static inline unsigned int ata_class_absent(unsigned int class)