aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/ata.h
diff options
context:
space:
mode:
authorAlan Cox <alan@lxorguk.ukuu.org.uk>2006-10-10 17:28:11 -0400
committerJeff Garzik <jeff@garzik.org>2006-12-01 22:40:25 -0500
commitfc085150b491bfc186efbca90a14cf907a3060a9 (patch)
treeb5bf8b6eb6d0dabd8699e6b41c239619590659e2 /include/linux/ata.h
parent2f27ce03628acdb81ead4abe914c713e04a3229e (diff)
[PATCH] libata: add 40pin "short" cable support, honour drive side speed detection
[deweerdt@free.fr: build fix] Signed-off-by: Alan Cox <alan@redhat.com> Signed-off-by: Frederik Deweerdt <deweerdt@free.fr> Cc: Tejun Heo <htejun@gmail.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'include/linux/ata.h')
-rw-r--r--include/linux/ata.h14
1 files changed, 12 insertions, 2 deletions
diff --git a/include/linux/ata.h b/include/linux/ata.h
index d89441907024..1df941648a57 100644
--- a/include/linux/ata.h
+++ b/include/linux/ata.h
@@ -200,8 +200,9 @@ enum {
200 ATA_CBL_NONE = 0, 200 ATA_CBL_NONE = 0,
201 ATA_CBL_PATA40 = 1, 201 ATA_CBL_PATA40 = 1,
202 ATA_CBL_PATA80 = 2, 202 ATA_CBL_PATA80 = 2,
203 ATA_CBL_PATA_UNK = 3, 203 ATA_CBL_PATA40_SHORT = 3, /* 40 wire cable to high UDMA spec */
204 ATA_CBL_SATA = 4, 204 ATA_CBL_PATA_UNK = 4,
205 ATA_CBL_SATA = 5,
205 206
206 /* SATA Status and Control Registers */ 207 /* SATA Status and Control Registers */
207 SCR_STATUS = 0, 208 SCR_STATUS = 0,
@@ -342,6 +343,15 @@ static inline int ata_id_is_cfa(const u16 *id)
342 return 0; 343 return 0;
343} 344}
344 345
346static inline int ata_drive_40wire(const u16 *dev_id)
347{
348 if (ata_id_major_version(dev_id) >= 5 && ata_id_is_sata(dev_id))
349 return 0; /* SATA */
350 if (dev_id[93] & 0x4000)
351 return 0; /* 80 wire */
352 return 1;
353}
354
345static inline int atapi_cdb_len(const u16 *dev_id) 355static inline int atapi_cdb_len(const u16 *dev_id)
346{ 356{
347 u16 tmp = dev_id[0] & 0x3; 357 u16 tmp = dev_id[0] & 0x3;