From 0858eccf86e9b3611d711717ec65a042f5c7ff9f Mon Sep 17 00:00:00 2001 From: Artur Paszkiewicz Date: Wed, 19 Nov 2014 13:53:29 +0100 Subject: imsm: detail-platform improvements Print platform details per OROM, not per controller, differentiate RST(e) platforms from legacy IMSM, print NVMe device paths, adjust port printing to newer sysfs path. Signed-off-by: Artur Paszkiewicz Signed-off-by: Pawel Baldysiak Signed-off-by: NeilBrown --- platform-intel.h | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'platform-intel.h') diff --git a/platform-intel.h b/platform-intel.h index 6b4ebd81..3e85d44b 100644 --- a/platform-intel.h +++ b/platform-intel.h @@ -173,6 +173,17 @@ static inline int fls(int x) return r; } +static inline int imsm_orom_is_enterprise(const struct imsm_orom *orom) +{ + return !!(orom->driver_features & IMSM_OROM_CAPABILITIES_EnterpriseSystem); +} + +static inline int imsm_orom_is_nvme(const struct imsm_orom *orom) +{ + return memcmp(orom->signature, IMSM_NVME_OROM_COMPAT_SIGNATURE, + sizeof(orom->signature)) == 0; +} + enum sys_dev_type { SYS_DEV_UNKNOWN = 0, SYS_DEV_SAS, @@ -194,6 +205,16 @@ struct efi_guid { __u8 b[16]; }; +struct devid_list { + __u16 devid; + struct devid_list *next; +}; + +struct orom_entry { + struct imsm_orom orom; + struct devid_list *devid_list; +}; + static inline char *guid_str(char *buf, struct efi_guid guid) { sprintf(buf, "%02x%02x%02x%02x-%02x%02x-%02x%02x-" @@ -215,4 +236,6 @@ int devt_attached_to_hba(dev_t dev, const char *hba_path); char *devt_to_devpath(dev_t dev); int path_attached_to_hba(const char *disk_path, const char *hba_path); const char *get_sys_dev_type(enum sys_dev_type); +const struct orom_entry * get_oroms(void); const struct imsm_orom *get_orom_by_device_id(__u16 device_id); +struct sys_dev *device_by_id(__u16 device_id); -- cgit v1.2.3