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
#include "superblocks.h"
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,
28
const struct blkid_idmag *mag __attribute__((__unused__)))
31
static unsigned int sectors[] = {
32
63, 255, 256, 16, 399, 0
35
if (pr->size < 0x40000)
37
if (!S_ISREG(pr->mode) && !blkid_probe_is_wholedisk(pr))
40
for (i = 0; sectors[i] != 0; i++) {
42
struct promise_metadata *pdc;
44
off = ((pr->size / 0x200) - sectors[i]) * 0x200;
45
pdc = (struct promise_metadata *)
46
blkid_probe_get_buffer(pr,
48
sizeof(struct promise_metadata));
52
if (memcmp(pdc->sig, PDC_SIGNATURE,
53
sizeof(PDC_SIGNATURE) - 1) == 0) {
55
if (blkid_probe_set_magic(pr, off, sizeof(pdc->sig),
56
(unsigned char *) pdc->sig))
64
const struct blkid_idinfo pdcraid_idinfo = {
65
.name = "promise_fasttrack_raid_member",
66
.usage = BLKID_USAGE_RAID,
67
.probefunc = probe_pdcraid,
68
.magics = BLKID_NONE_MAGIC