2
* Copyright (C) 2008 Karel Zak <kzak@redhat.com>
4
* Inspired by libvolume_id by
5
* Kay Sievers <kay.sievers@vrfy.org>
7
* This file may be redistributed under the terms of the
8
* GNU Lesser General Public License.
18
struct adaptec_metadata {
45
uint16_t svBlockStorageTid;
55
uint16_t maxErrorCount;
64
uint32_t fwTestSeqNum;
72
#define AD_SIGNATURE "DPTM"
73
#define AD_MAGIC 0x37FC4D1E
75
static int probe_adraid(blkid_probe pr, const struct blkid_idmag *mag)
78
struct adaptec_metadata *ad;
80
if (pr->size < 0x10000)
83
off = ((pr->size / 0x200)-1) * 0x200;
84
ad = (struct adaptec_metadata *)
85
blkid_probe_get_buffer(pr,
87
sizeof(struct adaptec_metadata));
90
if (memcmp(ad->smagic, AD_SIGNATURE, sizeof(AD_SIGNATURE)) != 0)
92
if (ad->b0idcode != be32_to_cpu(AD_MAGIC))
94
if (blkid_probe_sprintf_version(pr, "%u", ad->resver) != 0)
100
const struct blkid_idinfo adraid_idinfo = {
101
.name = "adaptec_raid_member",
102
.usage = BLKID_USAGE_RAID,
103
.probefunc = probe_adraid,
104
.magics = BLKID_NONE_MAGIC