~psusi/ubuntu/precise/dmraid/fix-gpt

« back to all changes in this revision

Viewing changes to 1.0.0.rc16/lib/format/ataraid/pdc.h

  • Committer: Bazaar Package Importer
  • Author(s): Artur Rona
  • Date: 2010-02-04 21:34:22 UTC
  • mfrom: (1.1.4 upstream) (2.4.3 sid)
  • Revision ID: james.westby@ubuntu.com-20100204213422-tdag8lcxpr7ahmg4
Tags: 1.0.0.rc16-3ubuntu1
* Merge from debian testing. (LP: #503136)  Remaining changes:
  - debian/dmraid-activate: Remove the special-casing of the root
    device which breaks in many situations and leaves the raw devices
    exposed. This was introduced in Debian to accommodate some broken
    configurations which wanted to access "partitions" on the raid
    raw devices. In Ubuntu, broken configurations has not been supported.
  - debian/dmraid.postinst: Comment out "udevadm trigger" call in postinst
    for now as it has severeconsequences when mountall is installed
    (clears /tmp).  If dmraid is installed, then presumably the important
    system devices are up and one canbe bothered with a reboot to take 
    the change into account. Let update-initramfs flag the system
    as needing a reboot.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Copyright (C) 2004,2005  Heinz Mauelshagen, Red Hat GmbH.
 
3
 *                          All rights reserved.
 
4
 *
 
5
 * See file LICENSE at the top of this source tree for license information.
 
6
 */
 
7
 
 
8
#ifndef _PDC_H_
 
9
#define _PDC_H_
 
10
 
 
11
#ifdef  FORMAT_HANDLER
 
12
#undef  FORMAT_HANDLER
 
13
 
 
14
#include <stdint.h>
 
15
 
 
16
#define PDC_CONFIGOFFSETS       63,255,256,16,399,591,675,735,974,991
 
17
#define PDC_DATAOFFSET 0
 
18
 
 
19
/*
 
20
 * Maximum metadata areas checked for and offset of
 
21
 * those relative to PDC_CONFIGOFFSETS value in sectors.
 
22
 */
 
23
#define PDC_MAX_META_AREAS      4
 
24
#define PDC_META_OFFSET         14
 
25
 
 
26
/* Ondisk metadata for Promise Fastrack */
 
27
struct pdc {
 
28
#define PDC_ID_LENGTH   24
 
29
        uint8_t promise_id[PDC_ID_LENGTH];      /* 0x00 - 0x17 */
 
30
#define PDC_MAGIC        "Promise Technology, Inc."
 
31
 
 
32
        uint32_t unknown_0;     /* 0x18 - 0x1B */
 
33
        uint32_t magic_0;       /* 0x1C - 0x1F */
 
34
        uint32_t unknown_1;     /* 0x20 - 0x23 */
 
35
        uint32_t magic_1;       /* 0x24 - 0x27 */
 
36
        uint16_t unknown_2;     /* 0x28 - 0x2B */
 
37
        uint8_t filler1[470];   /* 0x2C - 0x1FF */
 
38
        struct {
 
39
                uint32_t flags; /* 0x200 - 0x203 */
 
40
                uint8_t unknown_0;      /* 0x204 */
 
41
                uint8_t disk_number;    /* 0x205 */
 
42
                uint8_t channel;        /* 0x206 */
 
43
                uint8_t device; /* 0x207 */
 
44
                uint32_t magic_0;       /* 0x208 - 0x20B */
 
45
                uint32_t unknown_1;     /* 0x20C - 0x20F */
 
46
                // uint32_t unknown_2;          /* 0x210 - 0x213 */
 
47
                uint32_t start; /* 0x210 - 0x213 */
 
48
                uint32_t disk_secs;     /* 0x214 - 0x217 */
 
49
                uint32_t unknown_3;     /* 0x218 - 0x21B */
 
50
                uint16_t unknown_4;     /* 0x21C - 0x21D */
 
51
                uint8_t status; /* 0x21E */
 
52
/* FIXME: bit 0x80 doesn't seem to indicate error as previously assumed. */
 
53
// #define      PDC_BROKEN(pdc)         ((pdc)->raid.status &  0x80)
 
54
#define PDC_BROKEN(pdc)         ((pdc)->raid.status &  0x00)
 
55
#define PDC_SET_BROKEN(pdc)     ((pdc)->raid.status |= 0x80)
 
56
                uint8_t type;   /* 0x21F */
 
57
#define PDC_T_RAID0     0x0
 
58
#define PDC_T_RAID1     0x1
 
59
#define PDC_T_SPAN      0x8
 
60
                uint8_t total_disks;    /* 0x220 */
 
61
                uint8_t raid0_shift;    /* 0x221 */
 
62
                uint8_t raid0_disks;    /* 0x222 */
 
63
                uint8_t array_number;   /* 0x223 */
 
64
                uint32_t total_secs;    /* 0x224 - 0x227 */
 
65
                uint16_t cylinders;     /* 0x228 - 0x229 */
 
66
                uint8_t heads;  /* 0x22A */
 
67
                uint8_t sectors;        /* 0x22B */
 
68
                uint32_t magic_1;       /* 0x22C - 0x2EF */
 
69
                uint32_t unknown_5;     /* 0x230 - 0x233 */
 
70
                struct pdc_disk {
 
71
                        uint16_t unknown_0;     /* 0x234 - 0x235 */
 
72
                        uint8_t channel;        /* 0x236 */
 
73
                        uint8_t device; /* 0x237 */
 
74
                        uint32_t magic_0;       /* 0x238 - 0x23B */
 
75
                        uint32_t disk_number;   /* 0x23C - 0x23F */
 
76
                } disk[8];
 
77
        } raid;
 
78
 
 
79
        uint32_t filler2[346];  /* 0x294 - */
 
80
        uint32_t checksum;
 
81
} __attribute__ ((packed));
 
82
 
 
83
#define PDC_MAXDISKS    8
 
84
 
 
85
#endif
 
86
 
 
87
int register_pdc(struct lib_context *lc);
 
88
 
 
89
#endif