aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/ata.h
diff options
context:
space:
mode:
authorTejun Heo <htejun@gmail.com>2006-02-12 08:47:04 -0500
committerJeff Garzik <jgarzik@pobox.com>2006-02-12 14:24:41 -0500
commit3d2ca91095f8ab6dc0cb925374eec62fa5336764 (patch)
tree4320fb9649dfbd389ea07d299288732b767534d7 /include/linux/ata.h
parent2940740bcaa5948967d261dfceec04f40b2d2fa1 (diff)
[PATCH] libata: separate out ata_id_major_version()
Separate out ATA major version calculation from ata_dev_identify() into ata_id_major_version(). It's preparation for splitting ata_dev_identify(). Signed-off-by: Tejun Heo <htejun@gmail.com> Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
Diffstat (limited to 'include/linux/ata.h')
-rw-r--r--include/linux/ata.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/linux/ata.h b/include/linux/ata.h
index a8155ca4947f..b02a16c435e7 100644
--- a/include/linux/ata.h
+++ b/include/linux/ata.h
@@ -267,6 +267,16 @@ struct ata_taskfile {
267 ((u64) (id)[(n) + 1] << 16) | \ 267 ((u64) (id)[(n) + 1] << 16) | \
268 ((u64) (id)[(n) + 0]) ) 268 ((u64) (id)[(n) + 0]) )
269 269
270static inline unsigned int ata_id_major_version(const u16 *id)
271{
272 unsigned int mver;
273
274 for (mver = 14; mver >= 1; mver--)
275 if (id[ATA_ID_MAJOR_VER] & (1 << mver))
276 break;
277 return mver;
278}
279
270static inline int ata_id_current_chs_valid(const u16 *id) 280static inline int ata_id_current_chs_valid(const u16 *id)
271{ 281{
272 /* For ATA-1 devices, if the INITIALIZE DEVICE PARAMETERS command 282 /* For ATA-1 devices, if the INITIALIZE DEVICE PARAMETERS command