X-Git-Url: http://git.ipfire.org/?a=blobdiff_plain;f=platform-intel.h;h=de433bd6b20a68682ea5b8067d919aecc1dd822c;hb=3dc821b091a757e12e8433d4153ee8a0aa0d1055;hp=e24ae37928b3b422664e41faed530e979de05708;hpb=88b496c2697ed531ffecf2f8ced76f437297e5fe;p=thirdparty%2Fmdadm.git diff --git a/platform-intel.h b/platform-intel.h index e24ae379..de433bd6 100644 --- a/platform-intel.h +++ b/platform-intel.h @@ -76,6 +76,7 @@ struct imsm_orom { #define IMSM_OROM_ATTR_RAID1E IMSM_OROM_RLC_RAID1E #define IMSM_OROM_ATTR_RAID5 IMSM_OROM_RLC_RAID5 #define IMSM_OROM_ATTR_RAID_CNG IMSM_OROM_RLC_RAID_CNG + #define IMSM_OROM_ATTR_2TB_DISK (1 << 26) #define IMSM_OROM_ATTR_2TB (1 << 29) #define IMSM_OROM_ATTR_PM (1 << 30) #define IMSM_OROM_ATTR_ChecksumVerify (1 << 31) @@ -124,10 +125,11 @@ static inline int imsm_orom_has_raid5(const struct imsm_orom *orom) static inline int imsm_orom_has_chunk(const struct imsm_orom *orom, int chunk) { int fs = ffs(chunk); - if (!fs) return 0; fs--; /* bit num to bit index */ + if (chunk & (chunk-1)) + return 0; /* not a power of 2 */ return !!(orom->sss & (1 << (fs - 1))); } @@ -167,21 +169,6 @@ static inline int fls(int x) return r; } -/** - * imsm_orom_default_chunk - return the largest chunk size supported via orom - * @orom: orom pointer from find_imsm_orom - */ -static inline int imsm_orom_default_chunk(const struct imsm_orom *orom) -{ - int fs = fls(orom->sss); - - if (!fs) - return 0; - - return min(512, (1 << fs)); -} - - enum sys_dev_type { SYS_DEV_UNKNOWN = 0, SYS_DEV_SAS, @@ -189,7 +176,6 @@ enum sys_dev_type { SYS_DEV_MAX }; - struct sys_dev { enum sys_dev_type type; char *path; @@ -216,7 +202,6 @@ static inline char *guid_str(char *buf, struct efi_guid guid) char *diskfd_to_devpath(int fd); struct sys_dev *find_driver_devices(const char *bus, const char *driver); struct sys_dev *find_intel_devices(void); -void free_sys_dev(struct sys_dev **list); const struct imsm_orom *find_imsm_capability(enum sys_dev_type hba_id); const struct imsm_orom *find_imsm_orom(void); int disk_attached_to_hba(int fd, const char *hba_path);