1 /* $OpenBSD: rf_configure.h,v 1.5 2002/12/16 07:01:03 tdeval Exp $ */ 2 /* $NetBSD: rf_configure.h,v 1.4 1999/03/02 03:18:49 oster Exp $ */ 3 4 /* 5 * Copyright (c) 1995 Carnegie-Mellon University. 6 * All rights reserved. 7 * 8 * Author: Mark Holland 9 * 10 * Permission to use, copy, modify and distribute this software and 11 * its documentation is hereby granted, provided that both the copyright 12 * notice and this permission notice appear in all copies of the 13 * software, derivative works or modified versions, and any portions 14 * thereof, and that both notices appear in supporting documentation. 15 * 16 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" 17 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND 18 * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. 19 * 20 * Carnegie Mellon requests users of this software to return to 21 * 22 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU 23 * School of Computer Science 24 * Carnegie Mellon University 25 * Pittsburgh PA 15213-3890 26 * 27 * any improvements or extensions that they make and grant Carnegie the 28 * rights to redistribute these changes. 29 */ 30 31 /***************************************************************************** 32 * 33 * rf_configure.h 34 * 35 * Header file for RAIDframe configuration in the kernel version only. 36 * Configuration is invoked via ioctl rather than at boot time. 37 * 38 *****************************************************************************/ 39 40 41 #ifndef _RF__RF_CONFIGURE_H_ 42 #define _RF__RF_CONFIGURE_H_ 43 44 #include "rf_archs.h" 45 #include "rf_types.h" 46 47 #include <sys/param.h> 48 #include <sys/proc.h> 49 50 #include <sys/ioctl.h> 51 52 /* 53 * The RAIDframe configuration, passed down through an ioctl. 54 * The driver can be reconfigured (with total loss of data) at any time, 55 * but it must be shut down first. 56 */ 57 struct RF_Config_s { 58 /* Number of rows, columns, and spare disks. */ 59 RF_RowCol_t numRow, numCol, numSpare; 60 61 /* Device numbers for disks comprising array. */ 62 dev_t devs[RF_MAXROW][RF_MAXCOL]; 63 64 /* Device names. */ 65 char devnames[RF_MAXROW][RF_MAXCOL][50]; 66 67 /* Device numbers for spare disks. */ 68 dev_t spare_devs[RF_MAXSPARE]; 69 70 /* Device names. */ 71 char spare_names[RF_MAXSPARE][50]; 72 73 /* Sectors per stripe unit. */ 74 RF_SectorNum_t sectPerSU; 75 76 /* Stripe units per parity unit. */ 77 RF_StripeNum_t SUsPerPU; 78 79 /* Stripe units per reconstruction unit. */ 80 RF_StripeNum_t SUsPerRU; 81 82 /* Identifies the RAID architecture to be used. */ 83 RF_ParityConfig_t parityConfig; 84 85 /* 'f' = fifo, 'c' = cvscan, not used in kernel. */ 86 RF_DiskQueueType_t diskQueueType; 87 88 /* # concurrent reqs to be sent to a disk. Not used in kernel. */ 89 char maxOutstandingDiskReqs; 90 91 /* Space for specifying debug variables & their values. */ 92 char debugVars[RF_MAXDBGV][RF_MAXDBGVLEN]; 93 94 /* Size in bytes of layout-specific info. */ 95 unsigned int layoutSpecificSize; 96 97 /* A pointer to a layout-specific structure to be copied in. */ 98 void *layoutSpecific; 99 100 /* If !0, ignore many fatal configuration conditions. */ 101 int force; 102 /* 103 * "force" is used to override cases where the component labels 104 * would indicate that configuration should not proceed without 105 * user intervention. 106 */ 107 }; 108 109 #ifndef _KERNEL 110 int rf_MakeConfig(char *, RF_Config_t *); 111 int rf_MakeLayoutSpecificNULL(FILE *, RF_Config_t *, void *); 112 int rf_MakeLayoutSpecificDeclustered(FILE *, RF_Config_t *, void *); 113 void *rf_ReadSpareTable(RF_SparetWait_t *, char *); 114 #endif /* !_KERNEL */ 115 116 #endif /* !_RF__RF_CONFIGURE_H_ */