Ensure all lines that should be omitted from public includes are marked
[AROS.git] / arch / all-pc / boot / grub2-aros / include / grub / raid.h
blobd5853639d53edda619f8829fe5ac8b0afa727335
1 /* raid.h - On disk structures for RAID. */
2 /*
3 * GRUB -- GRand Unified Bootloader
4 * Copyright (C) 2006,2007,2008,2010 Free Software Foundation, Inc.
6 * GRUB is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
11 * GRUB is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with GRUB. If not, see <http://www.gnu.org/licenses/>.
20 #ifndef GRUB_RAID_H
21 #define GRUB_RAID_H 1
23 #include <grub/types.h>
25 #define GRUB_RAID_LAYOUT_LEFT_ASYMMETRIC 0
26 #define GRUB_RAID_LAYOUT_RIGHT_ASYMMETRIC 1
27 #define GRUB_RAID_LAYOUT_LEFT_SYMMETRIC 2
28 #define GRUB_RAID_LAYOUT_RIGHT_SYMMETRIC 3
30 #define GRUB_RAID_LAYOUT_RIGHT_MASK 1
31 #define GRUB_RAID_LAYOUT_SYMMETRIC_MASK 2
33 struct grub_raid_member
35 grub_disk_t device; /* Array of total_devs devices. */
36 grub_disk_addr_t start_sector;
37 /* Start of each device, in 512 byte sectors. */
40 struct grub_raid_array
42 int number; /* The device number, taken from md_minor so we
43 are consistent with the device name in
44 Linux. */
45 int level; /* RAID levels, only 0, 1 or 5 at the moment. */
46 int layout; /* Layout for RAID 5/6. */
47 unsigned int total_devs; /* Total number of devices in the array. */
48 grub_size_t chunk_size; /* The size of a chunk, in 512 byte sectors. */
49 grub_uint64_t disk_size; /* Size of an individual disk, in 512 byte
50 sectors. */
51 unsigned int index; /* Index of current device. */
52 int uuid_len; /* The length of uuid. */
53 char *uuid; /* The UUID of the device. */
55 /* The following field is setup by the caller. */
56 char *name; /* That will be "md<number>". */
57 unsigned int nr_devs; /* The number of devices we've found so far. */
58 unsigned int allocated_devs;
59 struct grub_raid_member *members;
60 struct grub_raid_array *next;
62 #ifdef GRUB_UTIL
63 struct grub_raid *driver;
64 #endif
67 struct grub_raid
69 const char *name;
71 grub_err_t (*detect) (grub_disk_t disk, struct grub_raid_array *array,
72 grub_disk_addr_t *start_sector);
74 struct grub_raid *next;
76 typedef struct grub_raid *grub_raid_t;
78 void grub_raid_register (grub_raid_t raid);
79 void grub_raid_unregister (grub_raid_t raid);
81 void grub_raid_block_xor (char *buf1, const char *buf2, int size);
83 typedef grub_err_t (*grub_raid5_recover_func_t) (struct grub_raid_array *array,
84 int disknr, char *buf,
85 grub_disk_addr_t sector,
86 int size);
88 typedef grub_err_t (*grub_raid6_recover_func_t) (struct grub_raid_array *array,
89 int disknr, int p, char *buf,
90 grub_disk_addr_t sector,
91 int size);
93 extern grub_raid5_recover_func_t grub_raid5_recover_func;
94 extern grub_raid6_recover_func_t grub_raid6_recover_func;
96 #endif /* ! GRUB_RAID_H */