]> git.ipfire.org Git - thirdparty/mdadm.git/blobdiff - platform-intel.h
FIX: resolve make everything compilation error
[thirdparty/mdadm.git] / platform-intel.h
index 18f1ea21b902d3a09325260ebcc83bd03c47b0c9..99450ba7c744a59a857acd1c8842d5618a245a16 100644 (file)
@@ -79,8 +79,20 @@ struct imsm_orom {
        #define IMSM_OROM_ATTR_2TB (1 << 29)
        #define IMSM_OROM_ATTR_PM (1 << 30)
        #define IMSM_OROM_ATTR_ChecksumVerify (1 << 31)
-       __u32 reserved1;
-       __u32 reserved2;
+       __u32 capabilities;
+       #define IMSM_OROM_CAPABILITIES_Ext_SATA (1 << 0)
+       #define IMSM_OROM_CAPABILITIES_TurboMemory (1 << 1)
+       #define IMSM_OROM_CAPABILITIES_HddPassword (1 << 2)
+       #define IMSM_OROM_CAPABILITIES_DiskCoercion (1 << 3)
+       __u32 driver_features;
+       #define IMSM_OROM_CAPABILITIES_HDDUnlock (1 << 0)
+       #define IMSM_OROM_CAPABILITIES_LEDLoc (1 << 1)
+       #define IMSM_OROM_CAPABILITIES_EnterpriseSystem (1 << 2)
+       #define IMSM_OROM_CAPABILITIES_Zpodd (1 << 3)
+       #define IMSM_OROM_CAPABILITIES_LargeDramCache (1 << 4)
+       #define IMSM_OROM_CAPABILITIES_Rohi (1 << 5)
+       #define IMSM_OROM_CAPABILITIES_ReadPatrol (1 << 6)
+       #define IMSM_OROM_CAPABILITIES_XorHw (1 << 7)
 } __attribute__((packed));
 
 static inline int imsm_orom_has_raid0(const struct imsm_orom *orom)
@@ -112,11 +124,13 @@ 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);
+       int orom_chunk_bit;
 
        if (!fs)
                return 0;
        fs--; /* bit num to bit index */
-       return !!(orom->sss & (1 << (fs - 1)));
+       orom_chunk_bit = (orom->sss & (1 << (fs - 1)));
+       return orom_chunk_bit && 1 << orom_chunk_bit == chunk;
 }
 
 
@@ -155,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,
@@ -177,14 +176,29 @@ enum sys_dev_type {
        SYS_DEV_MAX
 };
 
-
 struct sys_dev {
        enum sys_dev_type type;
        char *path;
        char *pci_id;
+       __u16  dev_id;
        struct sys_dev *next;
 };
 
+struct efi_guid {
+       __u8 b[16];
+};
+
+static inline char *guid_str(char *buf, struct efi_guid guid)
+{
+       sprintf(buf, "%02x%02x%02x%02x-%02x%02x-%02x%02x-"
+                    "%02x%02x-%02x%02x%02x%02x%02x%02x",
+                guid.b[3], guid.b[2], guid.b[1], guid.b[0],
+                guid.b[5], guid.b[4], guid.b[7], guid.b[6],
+                guid.b[8], guid.b[9], guid.b[10], guid.b[11],
+                guid.b[12], guid.b[13], guid.b[14], guid.b[15]);
+       return buf;
+}
+
 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);