summaryrefslogtreecommitdiffstats
path: root/platform-intel.c
diff options
context:
space:
mode:
authorLabun, Marcin <Marcin.Labun@intel.com>2011-03-10 01:41:46 +0100
committerNeilBrown <neilb@suse.de>2011-03-10 01:41:46 +0100
commit3c8bfb5ddd08c929caf9bd6eb36e5c97d1e74dd1 (patch)
tree23586b09a8cfcd5896422fbc17193c9237bd86fb /platform-intel.c
parentimsm : FIX: Assemble dirty array when reshape is in progress (diff)
downloadmdadm-3c8bfb5ddd08c929caf9bd6eb36e5c97d1e74dd1.tar.xz
mdadm-3c8bfb5ddd08c929caf9bd6eb36e5c97d1e74dd1.zip
probe_roms: allow to probe expansion ROMs using vendor and device id.
Adds data offset to PCI expansion ROM Data Structure in resource describing Expansion ROMs. This allows AHCI OROM scanning function to identify AHCI OROM by device id 0x2822 and vendor id 0x8086. Signed-off-by: Marcin Labun <marcin.labun@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'platform-intel.c')
-rw-r--r--platform-intel.c21
1 files changed, 19 insertions, 2 deletions
diff --git a/platform-intel.c b/platform-intel.c
index 3516a1b6..a4f0f491 100644
--- a/platform-intel.c
+++ b/platform-intel.c
@@ -166,12 +166,30 @@ static int platform_has_intel_devices(void)
return 0;
}
+/*
+ * PCI Expansion ROM Data Structure Format
+ */
+struct pciExpDataStructFormat {
+ __u8 ver[4];
+ __u16 vendorID;
+ __u16 deviceID;
+} __attribute__ ((packed));
+
static struct imsm_orom imsm_orom;
-static int scan(const void *start, const void *end)
+static int scan(const void *start, const void *end, const void *data)
{
int offset;
const struct imsm_orom *imsm_mem;
int len = (end - start);
+ struct pciExpDataStructFormat *ptr= (struct pciExpDataStructFormat *)data;
+
+ dprintf("ptr->vendorID: %lx __le16_to_cpu(ptr->deviceID): %lx \n",
+ (ulong) __le16_to_cpu(ptr->vendorID),
+ (ulong) __le16_to_cpu(ptr->deviceID));
+
+ if (!((__le16_to_cpu(ptr->vendorID) == 0x8086) &&
+ (__le16_to_cpu(ptr->deviceID) == 0x2822)))
+ return 0;
for (offset = 0; offset < len; offset += 4) {
imsm_mem = start + offset;
@@ -180,7 +198,6 @@ static int scan(const void *start, const void *end)
return 1;
}
}
-
return 0;
}