diff options
| author | Tejun Heo <tj@kernel.org> | 2010-09-01 11:50:04 -0400 |
|---|---|---|
| committer | Jeff Garzik <jgarzik@redhat.com> | 2010-10-21 20:21:04 -0400 |
| commit | c93b263e0d4fa8ce5fec0142a98196d1a127e845 (patch) | |
| tree | 6495053b65f7a79d1e5c11aaea77dd25e4082a84 /include/linux/libata.h | |
| parent | c43d559f0423816bb2918d892131d21c51816c3d (diff) | |
libata: clean up lpm related symbols and sysfs show/store functions
Link power management related symbols are in confusing state w/ mixed
usages of lpm, ipm and pm. This patch cleans up lpm related symbols
and sysfs show/store functions as follows.
* lpm states - NOT_AVAILABLE, MIN_POWER, MAX_PERFORMANCE and
MEDIUM_POWER are renamed to ATA_LPM_UNKNOWN and
ATA_LPM_{MIN|MAX|MED}_POWER.
* Pre/postfixes are unified to lpm.
* sysfs show/store functions for link_power_management_policy were
curiously named get/put and unnecessarily complex. Renamed to
show/store and simplified.
Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Diffstat (limited to 'include/linux/libata.h')
| -rw-r--r-- | include/linux/libata.h | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/include/linux/libata.h b/include/linux/libata.h index c50f66d4382c..c5bdc90fd319 100644 --- a/include/linux/libata.h +++ b/include/linux/libata.h | |||
| @@ -196,7 +196,7 @@ enum { | |||
| 196 | ATA_FLAG_ACPI_SATA = (1 << 17), /* need native SATA ACPI layout */ | 196 | ATA_FLAG_ACPI_SATA = (1 << 17), /* need native SATA ACPI layout */ |
| 197 | ATA_FLAG_AN = (1 << 18), /* controller supports AN */ | 197 | ATA_FLAG_AN = (1 << 18), /* controller supports AN */ |
| 198 | ATA_FLAG_PMP = (1 << 19), /* controller supports PMP */ | 198 | ATA_FLAG_PMP = (1 << 19), /* controller supports PMP */ |
| 199 | ATA_FLAG_IPM = (1 << 20), /* driver can handle IPM */ | 199 | ATA_FLAG_LPM = (1 << 20), /* driver can handle LPM */ |
| 200 | ATA_FLAG_EM = (1 << 21), /* driver supports enclosure | 200 | ATA_FLAG_EM = (1 << 21), /* driver supports enclosure |
| 201 | * management */ | 201 | * management */ |
| 202 | ATA_FLAG_SW_ACTIVITY = (1 << 22), /* driver supports sw activity | 202 | ATA_FLAG_SW_ACTIVITY = (1 << 22), /* driver supports sw activity |
| @@ -377,7 +377,7 @@ enum { | |||
| 377 | ATA_HORKAGE_BROKEN_HPA = (1 << 4), /* Broken HPA */ | 377 | ATA_HORKAGE_BROKEN_HPA = (1 << 4), /* Broken HPA */ |
| 378 | ATA_HORKAGE_DISABLE = (1 << 5), /* Disable it */ | 378 | ATA_HORKAGE_DISABLE = (1 << 5), /* Disable it */ |
| 379 | ATA_HORKAGE_HPA_SIZE = (1 << 6), /* native size off by one */ | 379 | ATA_HORKAGE_HPA_SIZE = (1 << 6), /* native size off by one */ |
| 380 | ATA_HORKAGE_IPM = (1 << 7), /* Link PM problems */ | 380 | ATA_HORKAGE_LPM = (1 << 7), /* Link PM problems */ |
| 381 | ATA_HORKAGE_IVB = (1 << 8), /* cbl det validity bit bugs */ | 381 | ATA_HORKAGE_IVB = (1 << 8), /* cbl det validity bit bugs */ |
| 382 | ATA_HORKAGE_STUCK_ERR = (1 << 9), /* stuck ERR on next PACKET */ | 382 | ATA_HORKAGE_STUCK_ERR = (1 << 9), /* stuck ERR on next PACKET */ |
| 383 | ATA_HORKAGE_BRIDGE_OK = (1 << 10), /* no bridge limits */ | 383 | ATA_HORKAGE_BRIDGE_OK = (1 << 10), /* no bridge limits */ |
| @@ -464,6 +464,17 @@ enum ata_completion_errors { | |||
| 464 | AC_ERR_NCQ = (1 << 10), /* marker for offending NCQ qc */ | 464 | AC_ERR_NCQ = (1 << 10), /* marker for offending NCQ qc */ |
| 465 | }; | 465 | }; |
| 466 | 466 | ||
| 467 | /* | ||
| 468 | * Link power management policy: If you alter this, you also need to | ||
| 469 | * alter libata-scsi.c (for the ascii descriptions) | ||
| 470 | */ | ||
| 471 | enum ata_lpm_policy { | ||
| 472 | ATA_LPM_UNKNOWN, | ||
| 473 | ATA_LPM_MAX_POWER, | ||
| 474 | ATA_LPM_MED_POWER, | ||
| 475 | ATA_LPM_MIN_POWER, | ||
| 476 | }; | ||
| 477 | |||
| 467 | /* forward declarations */ | 478 | /* forward declarations */ |
| 468 | struct scsi_device; | 479 | struct scsi_device; |
| 469 | struct ata_port_operations; | 480 | struct ata_port_operations; |
| @@ -478,16 +489,6 @@ typedef int (*ata_reset_fn_t)(struct ata_link *link, unsigned int *classes, | |||
| 478 | unsigned long deadline); | 489 | unsigned long deadline); |
| 479 | typedef void (*ata_postreset_fn_t)(struct ata_link *link, unsigned int *classes); | 490 | typedef void (*ata_postreset_fn_t)(struct ata_link *link, unsigned int *classes); |
| 480 | 491 | ||
| 481 | /* | ||
| 482 | * host pm policy: If you alter this, you also need to alter libata-scsi.c | ||
| 483 | * (for the ascii descriptions) | ||
| 484 | */ | ||
| 485 | enum link_pm { | ||
| 486 | NOT_AVAILABLE, | ||
| 487 | MIN_POWER, | ||
| 488 | MAX_PERFORMANCE, | ||
| 489 | MEDIUM_POWER, | ||
| 490 | }; | ||
| 491 | extern struct device_attribute dev_attr_link_power_management_policy; | 492 | extern struct device_attribute dev_attr_link_power_management_policy; |
| 492 | extern struct device_attribute dev_attr_unload_heads; | 493 | extern struct device_attribute dev_attr_unload_heads; |
| 493 | extern struct device_attribute dev_attr_em_message_type; | 494 | extern struct device_attribute dev_attr_em_message_type; |
| @@ -772,7 +773,7 @@ struct ata_port { | |||
| 772 | 773 | ||
| 773 | pm_message_t pm_mesg; | 774 | pm_message_t pm_mesg; |
| 774 | int *pm_result; | 775 | int *pm_result; |
| 775 | enum link_pm pm_policy; | 776 | enum ata_lpm_policy lpm_policy; |
| 776 | 777 | ||
| 777 | struct timer_list fastdrain_timer; | 778 | struct timer_list fastdrain_timer; |
| 778 | unsigned long fastdrain_cnt; | 779 | unsigned long fastdrain_cnt; |
| @@ -838,7 +839,7 @@ struct ata_port_operations { | |||
| 838 | int (*scr_write)(struct ata_link *link, unsigned int sc_reg, u32 val); | 839 | int (*scr_write)(struct ata_link *link, unsigned int sc_reg, u32 val); |
| 839 | void (*pmp_attach)(struct ata_port *ap); | 840 | void (*pmp_attach)(struct ata_port *ap); |
| 840 | void (*pmp_detach)(struct ata_port *ap); | 841 | void (*pmp_detach)(struct ata_port *ap); |
| 841 | int (*enable_pm)(struct ata_port *ap, enum link_pm policy); | 842 | int (*enable_pm)(struct ata_port *ap, enum ata_lpm_policy policy); |
| 842 | void (*disable_pm)(struct ata_port *ap); | 843 | void (*disable_pm)(struct ata_port *ap); |
| 843 | 844 | ||
| 844 | /* | 845 | /* |
