diff options
| author | Jaroslav Kysela <perex@suse.cz> | 2006-03-22 11:02:08 +0100 |
|---|---|---|
| committer | Jaroslav Kysela <perex@suse.cz> | 2006-03-22 11:02:08 +0100 |
| commit | 5501972e0b5857bc8354770d900ceb9b40c7f6b7 (patch) | |
| tree | ff239422827c4cd54d2998f8851304255de31b38 /include/linux/ata.h | |
| parent | 9d2f928ddf64ca0361562e30faf584cd33055c60 (diff) | |
| parent | e952f31bce6e9f64db01f607abc46529ba57ac9e (diff) | |
Merge with rsync://rsync.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git
Diffstat (limited to 'include/linux/ata.h')
| -rw-r--r-- | include/linux/ata.h | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/include/linux/ata.h b/include/linux/ata.h index 94f77cce27fa..b02a16c435e7 100644 --- a/include/linux/ata.h +++ b/include/linux/ata.h @@ -267,6 +267,16 @@ struct ata_taskfile { ((u64) (id)[(n) + 1] << 16) | \ ((u64) (id)[(n) + 0]) ) +static inline unsigned int ata_id_major_version(const u16 *id) +{ + unsigned int mver; + + for (mver = 14; mver >= 1; mver--) + if (id[ATA_ID_MAJOR_VER] & (1 << mver)) + break; + return mver; +} + static inline int ata_id_current_chs_valid(const u16 *id) { /* For ATA-1 devices, if the INITIALIZE DEVICE PARAMETERS command @@ -302,4 +312,16 @@ static inline int ata_ok(u8 status) == ATA_DRDY); } +static inline int lba_28_ok(u64 block, u32 n_block) +{ + /* check the ending block number */ + return ((block + n_block - 1) < ((u64)1 << 28)) && (n_block <= 256); +} + +static inline int lba_48_ok(u64 block, u32 n_block) +{ + /* check the ending block number */ + return ((block + n_block - 1) < ((u64)1 << 48)) && (n_block <= 65536); +} + #endif /* __LINUX_ATA_H__ */ |
