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.
20 struct promise_metadata {
24 #define PDC_CONFIG_OFF 0x1200
25 #define PDC_SIGNATURE "Promise Technology, Inc."
27 static int probe_pdcraid(blkid_probe pr, const struct blkid_idmag *mag)
30 static unsigned int sectors[] = {
31 63, 255, 256, 16, 399, 0
34 if (pr->size < 0x40000)
37 for (i = 0; sectors[i] != 0; i++) {
39 struct promise_metadata *pdc;
41 off = ((pr->size / 0x200) - sectors[i]) * 0x200;
42 pdc = (struct promise_metadata *)
43 blkid_probe_get_buffer(pr,
45 sizeof(struct promise_metadata));
49 if (memcmp(pdc->sig, PDC_SIGNATURE,
50 sizeof(PDC_SIGNATURE) - 1) == 0)
56 const struct blkid_idinfo pdcraid_idinfo = {
57 .name = "promise_fasttrack_raid_member",
58 .usage = BLKID_USAGE_RAID,
59 .probefunc = probe_pdcraid,
60 .magics = BLKID_NONE_MAGIC