aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/ata.h
diff options
context:
space:
mode:
authorJ. Bruce Fields <bfields@citi.umich.edu>2009-06-15 21:08:07 -0400
committerJ. Bruce Fields <bfields@citi.umich.edu>2009-06-15 21:08:07 -0400
commit7eef4091a653c243a87e5375c54504cc03bec4d8 (patch)
treef65b77f830b2c8f7d014512badfef5df0d591ee9 /include/linux/ata.h
parent0a93a47f042c459f0f46942c3a920e3c81878031 (diff)
parent07a2039b8eb0af4ff464efd3dfd95de5c02648c6 (diff)
Merge commit 'v2.6.30' into for-2.6.31
Diffstat (limited to 'include/linux/ata.h')
-rw-r--r--include/linux/ata.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/include/linux/ata.h b/include/linux/ata.h
index cb79b7a208e1..915da43edee1 100644
--- a/include/linux/ata.h
+++ b/include/linux/ata.h
@@ -730,6 +730,34 @@ static inline int ata_id_has_unload(const u16 *id)
730 return 0; 730 return 0;
731} 731}
732 732
733static inline int ata_id_form_factor(const u16 *id)
734{
735 u16 val = id[168];
736
737 if (ata_id_major_version(id) < 7 || val == 0 || val == 0xffff)
738 return 0;
739
740 val &= 0xf;
741
742 if (val > 5)
743 return 0;
744
745 return val;
746}
747
748static inline int ata_id_rotation_rate(const u16 *id)
749{
750 u16 val = id[217];
751
752 if (ata_id_major_version(id) < 7 || val == 0 || val == 0xffff)
753 return 0;
754
755 if (val > 1 && val < 0x401)
756 return 0;
757
758 return val;
759}
760
733static inline int ata_id_has_trim(const u16 *id) 761static inline int ata_id_has_trim(const u16 *id)
734{ 762{
735 if (ata_id_major_version(id) >= 7 && 763 if (ata_id_major_version(id) >= 7 &&