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.
16
#include "superblocks.h"
18
struct adaptec_metadata {
46
uint16_t svBlockStorageTid;
56
uint16_t maxErrorCount;
65
uint32_t fwTestSeqNum;
71
} __attribute__((packed));
73
#define AD_SIGNATURE 0x4450544D /* "DPTM" */
74
#define AD_MAGIC 0x37FC4D1E
76
static int probe_adraid(blkid_probe pr, const struct blkid_idmag *mag)
79
struct adaptec_metadata *ad;
81
if (pr->size < 0x10000)
84
if (!S_ISREG(pr->mode) && !blkid_probe_is_wholedisk(pr))
87
off = ((pr->size / 0x200)-1) * 0x200;
88
ad = (struct adaptec_metadata *)
89
blkid_probe_get_buffer(pr,
91
sizeof(struct adaptec_metadata));
94
if (ad->smagic != be32_to_cpu(AD_SIGNATURE))
96
if (ad->b0idcode != be32_to_cpu(AD_MAGIC))
98
if (blkid_probe_sprintf_version(pr, "%u", ad->resver) != 0)
100
if (blkid_probe_set_magic(pr, off, sizeof(ad->b0idcode),
101
(unsigned char *) &ad->b0idcode))
106
const struct blkid_idinfo adraid_idinfo = {
107
.name = "adaptec_raid_member",
108
.usage = BLKID_USAGE_RAID,
109
.probefunc = probe_adraid,
110
.magics = BLKID_NONE_MAGIC