1 /* $NetBSD: ata_raidreg.h,v 1.1 2003/01/27 18:21:28 thorpej Exp $ */
2
3 /*-
4 * Copyright (c) 2000,2001,2002 Søren Schmidt <sos@FreeBSD.org>
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
9 * are met:
10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer,
12 * without modification, immediately at the beginning of the file.
13 * 2. Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the
15 * documentation and/or other materials provided with the distribution.
16 * 3. The name of the author may not be used to endorse or promote products
17 * derived from this software without specific prior written permission.
18 *
19 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
20 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
21 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
22 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
23 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
24 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
28 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 */
30
31 #ifndef _DEV_PCI_PCIIDE_PROMISE_RAID_H_
32 #define _DEV_PCI_PCIIDE_PROMISE_RAID_H_
33
34 /*
35 * Macro to compute the LBA of the Promise RAID configuration structure,
36 * using the disk's softc structure.
37 */
38 #define PR_LBA(wd) \
39 ((((wd)->sc_capacity / \
40 ((wd)->sc_params.atap_heads * (wd)->sc_params.atap_sectors)) * \
41 (wd)->sc_params.atap_heads * (wd)->sc_params.atap_sectors) - \
42 (wd)->sc_params.atap_sectors)
43
44 struct promise_raid_conf {
45 char promise_id[24];
46 #define PR_MAGIC "Promise Technology, Inc."
47
48 uint32_t dummy_0;
49
50 uint64_t magic_0;
51 uint16_t magic_1;
52 uint32_t magic_2;
53 uint8_t filler1[470];
54 struct { /* 0x200 */
55 uint32_t integrity;
56 #define PR_I_VALID 0x00000080
57
58 uint8_t flags;
59 #define PR_F_VALID 0x01
60 #define PR_F_ONLINE 0x02
61 #define PR_F_ASSIGNED 0x04
62 #define PR_F_SPARE 0x08
63 #define PR_F_DUPLICATE 0x10
64 #define PR_F_REDIR 0x20
65 #define PR_F_DOWN 0x40
66 #define PR_F_READY 0x80
67
68 uint8_t disk_number;
69 uint8_t channel;
70 uint8_t device;
71 uint64_t magic_0 __attribute__((__packed__));
72 uint32_t disk_offset; /* 0x210 */
73 uint32_t disk_sectors;
74 uint32_t rebuild_lba;
75 uint16_t generation;
76 uint8_t status;
77 #define PR_S_VALID 0x01
78 #define PR_S_ONLINE 0x02
79 #define PR_S_INITED 0x04
80 #define PR_S_READY 0x08
81 #define PR_S_DEGRADED 0x10
82 #define PR_S_MARKED 0x20
83 #define PR_S_FUNCTIONAL 0x80
84
85 uint8_t type;
86 #define PR_T_RAID0 0x00
87 #define PR_T_RAID1 0x01
88 #define PR_T_RAID3 0x02
89 #define PR_T_RAID5 0x04
90 #define PR_T_SPAN 0x08
91
92 uint8_t total_disks; /* 0x220 */
93 uint8_t stripe_shift;
94 uint8_t array_width;
95 uint8_t array_number;
96 uint32_t total_sectors;
97 uint16_t cylinders;
98 uint8_t heads;
99 uint8_t sectors;
100 uint64_t magic_1 __attribute__((__packed__));
101 struct {
102 uint8_t flags;
103 uint8_t dummy_0;
104 uint8_t channel;
105 uint8_t device;
106 uint64_t magic_0 __attribute__((__packed__));
107 } disk[8];
108 } raid;
109 uint32_t filler2[346];
110 uint32_t checksum;
111 } __attribute__((__packed__));
112
113 #endif /* _DEV_PCI_PCIIDE_PROMISE_RAID_H_ */
Cache object: 437826d45e9e7b983f127a9711fbcbbe
|