xref: /netbsd/sys/dev/raidframe/rf_pqdeg.h (revision bf9ec67e)
1 /*	$NetBSD: rf_pqdeg.h,v 1.5 2001/10/04 15:58:55 oster Exp $	*/
2 /*
3  * Copyright (c) 1995 Carnegie-Mellon University.
4  * All rights reserved.
5  *
6  * Author: Daniel Stodolsky
7  *
8  * Permission to use, copy, modify and distribute this software and
9  * its documentation is hereby granted, provided that both the copyright
10  * notice and this permission notice appear in all copies of the
11  * software, derivative works or modified versions, and any portions
12  * thereof, and that both notices appear in supporting documentation.
13  *
14  * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
15  * CONDITION.  CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND
16  * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
17  *
18  * Carnegie Mellon requests users of this software to return to
19  *
20  *  Software Distribution Coordinator  or  Software.Distribution@CS.CMU.EDU
21  *  School of Computer Science
22  *  Carnegie Mellon University
23  *  Pittsburgh PA 15213-3890
24  *
25  * any improvements or extensions that they make and grant Carnegie the
26  * rights to redistribute these changes.
27  */
28 
29 #ifndef _RF__RF_PQDEG_H_
30 #define _RF__RF_PQDEG_H_
31 
32 #if (RF_INCLUDE_PQ > 0) || (RF_INCLUDE_RAID6 > 0)
33 
34 #include <dev/raidframe/raidframevar.h>
35 
36 #include "rf_dag.h"
37 
38 /* extern decl's of the failure mode PQ functions.
39  * See pddeg.c for nomenclature discussion.
40  */
41 
42 /* reads, single failure  */
43 RF_CREATE_DAG_FUNC_DECL(rf_PQ_100_CreateReadDAG);
44 /* reads, two failure */
45 RF_CREATE_DAG_FUNC_DECL(rf_PQ_110_CreateReadDAG);
46 RF_CREATE_DAG_FUNC_DECL(rf_PQ_101_CreateReadDAG);
47 RF_CREATE_DAG_FUNC_DECL(rf_PQ_200_CreateReadDAG);
48 
49 /* writes, single failure */
50 RF_CREATE_DAG_FUNC_DECL(rf_PQ_100_CreateWriteDAG);
51 RF_CREATE_DAG_FUNC_DECL(rf_PQ_010_CreateSmallWriteDAG);
52 RF_CREATE_DAG_FUNC_DECL(rf_PQ_010_CreateLargeWriteDAG);
53 RF_CREATE_DAG_FUNC_DECL(rf_PQ_001_CreateSmallWriteDAG);
54 RF_CREATE_DAG_FUNC_DECL(rf_PQ_001_CreateLargeWriteDAG);
55 
56 /* writes, double failure */
57 RF_CREATE_DAG_FUNC_DECL(rf_PQ_011_CreateWriteDAG);
58 RF_CREATE_DAG_FUNC_DECL(rf_PQ_110_CreateWriteDAG);
59 RF_CREATE_DAG_FUNC_DECL(rf_PQ_101_CreateWriteDAG);
60 RF_CREATE_DAG_FUNC_DECL(rf_PQ_200_CreateWriteDAG);
61 
62 typedef RF_uint32 RF_ua32_t[32];
63 typedef RF_uint8 RF_ua1024_t[1024];
64 
65 extern RF_ua32_t rf_rn;
66 extern RF_ua32_t rf_qfor[32];
67 #ifndef _KERNEL			/* we don't support PQ in the kernel yet, so
68 				 * don't link in this monster table */
69 extern RF_ua1024_t rf_qinv[29 * 29];
70 #else				/* !_KERNEL */
71 extern RF_ua1024_t rf_qinv[1];
72 #endif				/* !_KERNEL */
73 
74 #endif /* (RF_INCLUDE_PQ > 0) || (RF_INCLUDE_RAID6 > 0) */
75 
76 #endif				/* !_RF__RF_PQDEG_H_ */
77