diff options
author | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-02-26 17:58:03 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-02-26 17:58:03 -0500 |
commit | 6f366c1c751454df3d1c0f25f15ee0164821112a (patch) | |
tree | a609adb9ead12ec0df5dcadaa11133f92a442466 /include/linux | |
parent | 221dee285ee38099b82437531bcae9fa9cb64cc4 (diff) | |
parent | cb48cab7f363014e0a5dc21f7b4892c15d626d41 (diff) |
Merge branch 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/libata-dev
* 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/libata-dev: (51 commits)
[libata] bump versions
[libata] Trim trailing whitespace.
[libata] sata_mv: Fix 50xx irq mask
[libata] sata_mv: don't touch reserved bits in EDMA config register
libata: Use new id_to_dma_mode function to tidy reporting in more drivers (minimally tested)
pata_pcmcia: Fix oops in 2.6.21-rc1
Add id_to_dma_mode function for printing DMA modes
sata_promise: simplify port setup
sata_promise: fix 20619 new EH merge error
[libata] ACPI: remove needless ->qc_issue hook existence test
sata_vsc: refactor vsc_sata_interrupt and hook up error handling
sata_sil: ignore and clear spurious IRQs while executing commands by polling
sata_mv: fix pci_enable_msi() error handling
pata_amd: fix an obvious bug in cable detection
[libata] ata_piix: remove duplicate PCI IDs
sata_nv: complain on spurious completion notifiers
libata: test major version in ata_id_is_sata()
sata_nv: kill old private BMDMA helper functions
libata: fix remaining ap->id
ahci: consider SDB FIS containing spurious NCQ completions HSM violation (regenerated)
...
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/ata.h | 8 | ||||
-rw-r--r-- | include/linux/libata.h | 27 |
2 files changed, 29 insertions, 6 deletions
diff --git a/include/linux/ata.h b/include/linux/ata.h index 272736e37990..c331da2da5f7 100644 --- a/include/linux/ata.h +++ b/include/linux/ata.h | |||
@@ -282,7 +282,6 @@ struct ata_taskfile { | |||
282 | }; | 282 | }; |
283 | 283 | ||
284 | #define ata_id_is_ata(id) (((id)[0] & (1 << 15)) == 0) | 284 | #define ata_id_is_ata(id) (((id)[0] & (1 << 15)) == 0) |
285 | #define ata_id_is_sata(id) ((id)[93] == 0) | ||
286 | #define ata_id_rahead_enabled(id) ((id)[85] & (1 << 6)) | 285 | #define ata_id_rahead_enabled(id) ((id)[85] & (1 << 6)) |
287 | #define ata_id_wcache_enabled(id) ((id)[85] & (1 << 5)) | 286 | #define ata_id_wcache_enabled(id) ((id)[85] & (1 << 5)) |
288 | #define ata_id_hpa_enabled(id) ((id)[85] & (1 << 10)) | 287 | #define ata_id_hpa_enabled(id) ((id)[85] & (1 << 10)) |
@@ -324,6 +323,11 @@ static inline unsigned int ata_id_major_version(const u16 *id) | |||
324 | return mver; | 323 | return mver; |
325 | } | 324 | } |
326 | 325 | ||
326 | static inline int ata_id_is_sata(const u16 *id) | ||
327 | { | ||
328 | return ata_id_major_version(id) >= 5 && id[93] == 0; | ||
329 | } | ||
330 | |||
327 | static inline int ata_id_current_chs_valid(const u16 *id) | 331 | static inline int ata_id_current_chs_valid(const u16 *id) |
328 | { | 332 | { |
329 | /* For ATA-1 devices, if the INITIALIZE DEVICE PARAMETERS command | 333 | /* For ATA-1 devices, if the INITIALIZE DEVICE PARAMETERS command |
@@ -350,7 +354,7 @@ static inline int ata_id_is_cfa(const u16 *id) | |||
350 | 354 | ||
351 | static inline int ata_drive_40wire(const u16 *dev_id) | 355 | static inline int ata_drive_40wire(const u16 *dev_id) |
352 | { | 356 | { |
353 | if (ata_id_major_version(dev_id) >= 5 && ata_id_is_sata(dev_id)) | 357 | if (ata_id_is_sata(dev_id)) |
354 | return 0; /* SATA */ | 358 | return 0; /* SATA */ |
355 | if ((dev_id[93] & 0xE000) == 0x6000) | 359 | if ((dev_id[93] & 0xE000) == 0x6000) |
356 | return 0; /* 80 wire */ | 360 | return 0; /* 80 wire */ |
diff --git a/include/linux/libata.h b/include/linux/libata.h index 86762a9f52ba..045fb3a72d59 100644 --- a/include/linux/libata.h +++ b/include/linux/libata.h | |||
@@ -495,6 +495,7 @@ struct ata_device { | |||
495 | 495 | ||
496 | /* error history */ | 496 | /* error history */ |
497 | struct ata_ering ering; | 497 | struct ata_ering ering; |
498 | int spdn_cnt; | ||
498 | unsigned int horkage; /* List of broken features */ | 499 | unsigned int horkage; /* List of broken features */ |
499 | #ifdef CONFIG_SATA_ACPI | 500 | #ifdef CONFIG_SATA_ACPI |
500 | /* ACPI objects info */ | 501 | /* ACPI objects info */ |
@@ -535,8 +536,8 @@ struct ata_port { | |||
535 | spinlock_t *lock; | 536 | spinlock_t *lock; |
536 | unsigned long flags; /* ATA_FLAG_xxx */ | 537 | unsigned long flags; /* ATA_FLAG_xxx */ |
537 | unsigned int pflags; /* ATA_PFLAG_xxx */ | 538 | unsigned int pflags; /* ATA_PFLAG_xxx */ |
538 | unsigned int id; /* unique id req'd by scsi midlyr */ | 539 | unsigned int print_id; /* user visible unique port ID */ |
539 | unsigned int port_no; /* unique port #; from zero */ | 540 | unsigned int port_no; /* 0 based port no. inside the host */ |
540 | 541 | ||
541 | struct ata_prd *prd; /* our SG list */ | 542 | struct ata_prd *prd; /* our SG list */ |
542 | dma_addr_t prd_dma; /* and its DMA mapping */ | 543 | dma_addr_t prd_dma; /* and its DMA mapping */ |
@@ -759,6 +760,7 @@ extern void ata_port_queue_task(struct ata_port *ap, work_func_t fn, | |||
759 | extern u32 ata_wait_register(void __iomem *reg, u32 mask, u32 val, | 760 | extern u32 ata_wait_register(void __iomem *reg, u32 mask, u32 val, |
760 | unsigned long interval_msec, | 761 | unsigned long interval_msec, |
761 | unsigned long timeout_msec); | 762 | unsigned long timeout_msec); |
763 | extern unsigned int ata_dev_try_classify(struct ata_port *, unsigned int, u8 *); | ||
762 | 764 | ||
763 | /* | 765 | /* |
764 | * Default driver ops implementations | 766 | * Default driver ops implementations |
@@ -786,10 +788,12 @@ extern void ata_sg_init_one(struct ata_queued_cmd *qc, void *buf, | |||
786 | extern void ata_sg_init(struct ata_queued_cmd *qc, struct scatterlist *sg, | 788 | extern void ata_sg_init(struct ata_queued_cmd *qc, struct scatterlist *sg, |
787 | unsigned int n_elem); | 789 | unsigned int n_elem); |
788 | extern unsigned int ata_dev_classify(const struct ata_taskfile *tf); | 790 | extern unsigned int ata_dev_classify(const struct ata_taskfile *tf); |
791 | extern void ata_dev_disable(struct ata_device *adev); | ||
789 | extern void ata_id_string(const u16 *id, unsigned char *s, | 792 | extern void ata_id_string(const u16 *id, unsigned char *s, |
790 | unsigned int ofs, unsigned int len); | 793 | unsigned int ofs, unsigned int len); |
791 | extern void ata_id_c_string(const u16 *id, unsigned char *s, | 794 | extern void ata_id_c_string(const u16 *id, unsigned char *s, |
792 | unsigned int ofs, unsigned int len); | 795 | unsigned int ofs, unsigned int len); |
796 | extern void ata_id_to_dma_mode(struct ata_device *dev, u8 unknown); | ||
793 | extern unsigned long ata_device_blacklisted(const struct ata_device *dev); | 797 | extern unsigned long ata_device_blacklisted(const struct ata_device *dev); |
794 | extern void ata_bmdma_setup (struct ata_queued_cmd *qc); | 798 | extern void ata_bmdma_setup (struct ata_queued_cmd *qc); |
795 | extern void ata_bmdma_start (struct ata_queued_cmd *qc); | 799 | extern void ata_bmdma_start (struct ata_queued_cmd *qc); |
@@ -890,10 +894,10 @@ extern void ata_do_eh(struct ata_port *ap, ata_prereset_fn_t prereset, | |||
890 | * printk helpers | 894 | * printk helpers |
891 | */ | 895 | */ |
892 | #define ata_port_printk(ap, lv, fmt, args...) \ | 896 | #define ata_port_printk(ap, lv, fmt, args...) \ |
893 | printk(lv"ata%u: "fmt, (ap)->id , ##args) | 897 | printk(lv"ata%u: "fmt, (ap)->print_id , ##args) |
894 | 898 | ||
895 | #define ata_dev_printk(dev, lv, fmt, args...) \ | 899 | #define ata_dev_printk(dev, lv, fmt, args...) \ |
896 | printk(lv"ata%u.%02u: "fmt, (dev)->ap->id, (dev)->devno , ##args) | 900 | printk(lv"ata%u.%02u: "fmt, (dev)->ap->print_id, (dev)->devno , ##args) |
897 | 901 | ||
898 | /* | 902 | /* |
899 | * ata_eh_info helpers | 903 | * ata_eh_info helpers |
@@ -1031,6 +1035,21 @@ static inline u8 ata_chk_status(struct ata_port *ap) | |||
1031 | return ap->ops->check_status(ap); | 1035 | return ap->ops->check_status(ap); |
1032 | } | 1036 | } |
1033 | 1037 | ||
1038 | /** | ||
1039 | * ata_ncq_enabled - Test whether NCQ is enabled | ||
1040 | * @dev: ATA device to test for | ||
1041 | * | ||
1042 | * LOCKING: | ||
1043 | * spin_lock_irqsave(host lock) | ||
1044 | * | ||
1045 | * RETURNS: | ||
1046 | * 1 if NCQ is enabled for @dev, 0 otherwise. | ||
1047 | */ | ||
1048 | static inline int ata_ncq_enabled(struct ata_device *dev) | ||
1049 | { | ||
1050 | return (dev->flags & (ATA_DFLAG_PIO | ATA_DFLAG_NCQ_OFF | | ||
1051 | ATA_DFLAG_NCQ)) == ATA_DFLAG_NCQ; | ||
1052 | } | ||
1034 | 1053 | ||
1035 | /** | 1054 | /** |
1036 | * ata_pause - Flush writes and pause 400 nanoseconds. | 1055 | * ata_pause - Flush writes and pause 400 nanoseconds. |