aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/ata.h
diff options
context:
space:
mode:
authorTejun Heo <htejun@gmail.com>2007-02-21 06:25:08 -0500
committerJeff Garzik <jeff@garzik.org>2007-02-23 05:37:11 -0500
commit32d90911568f67fad3f73623e106667a37c6e7ed (patch)
tree96690244a571855cb89343028a03016279ebf914 /include/linux/ata.h
parentf5ecac2d8e0beb0e4d3eb09833cfd19d8f9f004d (diff)
libata: test major version in ata_id_is_sata()
Test major version in ata_id_is_sata() not separately. Signed-off-by: Tejun Heo <htejun@gmail.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'include/linux/ata.h')
-rw-r--r--include/linux/ata.h8
1 files changed, 6 insertions, 2 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
326static inline int ata_id_is_sata(const u16 *id)
327{
328 return ata_id_major_version(id) >= 5 && id[93] == 0;
329}
330
327static inline int ata_id_current_chs_valid(const u16 *id) 331static 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
351static inline int ata_drive_40wire(const u16 *dev_id) 355static 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 */