diff options
Diffstat (limited to 'include/linux/ata.h')
-rw-r--r-- | include/linux/ata.h | 28 |
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 | ||
733 | static 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 | |||
748 | static 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 | |||
733 | static inline int ata_id_has_trim(const u16 *id) | 761 | static 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 && |