diff options
author | Alan Cox <alan@lxorguk.ukuu.org.uk> | 2007-03-06 05:37:56 -0500 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2007-04-28 14:15:55 -0400 |
commit | be0d18dff5fae83845801929f297977c10ab99ad (patch) | |
tree | 6551bf28f7123e19cee86717db689e6d8d530973 /include/linux/libata.h | |
parent | 5aea408df5ae459cb29b91d45fa0f8bc1bee924e (diff) |
libata: cable detection fixes
2.6.21-rc has horrible problems with libata and PATA cable types (and
thus speeds). This occurs because Tejun fixed a pile of other bugs and
we now do cable detect enforcement for drive side detection properly.
Unfortunately we don't do the process around cable detection right. Tejun
identified the problem and pointed to the right Annex in the spec, this patch
implements the rest of the needed changes.
We add a ->cable_detect() method called after the identify
sequence which allows a host to do host side detection at this point
should it wish, or to modify the results of the drive side identify.
This separate ->cable_detect method also cleans up a lot of code because
many drivers have their own error_handler methods which really just set
the cable type.
If there is no ->cable_detect method the cable type is left alone so a
driver setting it earlier (eg because it has the SATA flags set or
because it uses the old error_handler approach) will still do the right
thing (or at least the same thing) as before.
This patch simply adds the cable_detect method and helpers it doesn't use
them but other follow up patches will (ie Adrian please don't submit
patches to unexport them ;))
Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'include/linux/libata.h')
-rw-r--r-- | include/linux/libata.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/include/linux/libata.h b/include/linux/libata.h index 84787cad860d..3451ef97a931 100644 --- a/include/linux/libata.h +++ b/include/linux/libata.h | |||
@@ -616,6 +616,8 @@ struct ata_port_operations { | |||
616 | 616 | ||
617 | void (*post_set_mode) (struct ata_port *ap); | 617 | void (*post_set_mode) (struct ata_port *ap); |
618 | 618 | ||
619 | int (*cable_detect) (struct ata_port *ap); | ||
620 | |||
619 | int (*check_atapi_dma) (struct ata_queued_cmd *qc); | 621 | int (*check_atapi_dma) (struct ata_queued_cmd *qc); |
620 | 622 | ||
621 | void (*bmdma_setup) (struct ata_queued_cmd *qc); | 623 | void (*bmdma_setup) (struct ata_queued_cmd *qc); |
@@ -834,6 +836,11 @@ extern u8 ata_dummy_irq_on(struct ata_port *ap); | |||
834 | extern u8 ata_irq_ack(struct ata_port *ap, unsigned int chk_drq); | 836 | extern u8 ata_irq_ack(struct ata_port *ap, unsigned int chk_drq); |
835 | extern u8 ata_dummy_irq_ack(struct ata_port *ap, unsigned int chk_drq); | 837 | extern u8 ata_dummy_irq_ack(struct ata_port *ap, unsigned int chk_drq); |
836 | 838 | ||
839 | extern int ata_cable_40wire(struct ata_port *ap); | ||
840 | extern int ata_cable_80wire(struct ata_port *ap); | ||
841 | extern int ata_cable_sata(struct ata_port *ap); | ||
842 | extern int ata_cable_unknown(struct ata_port *ap); | ||
843 | |||
837 | /* | 844 | /* |
838 | * Timing helpers | 845 | * Timing helpers |
839 | */ | 846 | */ |