1/* $NetBSD: raidframeio.h,v 1.9 2018/01/20 01:32:45 mrg Exp $ */
2/*-
3 * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
4 * All rights reserved.
5 *
6 * This code is derived from software contributed to The NetBSD Foundation
7 * by Greg Oster
8 *
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions
11 * are met:
12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright
15 * notice, this list of conditions and the following disclaimer in the
16 * documentation and/or other materials provided with the distribution.
17 *
18 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
19 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
20 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
21 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
22 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
23 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
26 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28 * POSSIBILITY OF SUCH DAMAGE.
29 */
30
31/*
32 * Copyright (c) 1995 Carnegie-Mellon University.
33 * All rights reserved.
34 *
35 * Author: Mark Holland
36 *
37 * Permission to use, copy, modify and distribute this software and
38 * its documentation is hereby granted, provided that both the copyright
39 * notice and this permission notice appear in all copies of the
40 * software, derivative works or modified versions, and any portions
41 * thereof, and that both notices appear in supporting documentation.
42 *
43 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
44 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND
45 * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
46 *
47 * Carnegie Mellon requests users of this software to return to
48 *
49 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
50 * School of Computer Science
51 * Carnegie Mellon University
52 * Pittsburgh PA 15213-3890
53 *
54 * any improvements or extensions that they make and grant Carnegie the
55 * rights to redistribute these changes.
56 */
57
58/*****************************************************
59 *
60 * raidframeio.h
61 *
62 * IOCTL's used by RAIDframe.
63 *
64 *****************************************************/
65
66
67#ifndef _RF_RAIDFRAMEIO_H_
68#define _RF_RAIDFRAMEIO_H_
69
70#include "raidframevar.h"
71
72/* 1 was RAIDFRAME_CONFIGURE */
73#define RAIDFRAME_SHUTDOWN _IO ('r', 2) /* shutdown the driver */
74#define RAIDFRAME_TUR _IOW ('r', 3, dev_t) /* debug only: test unit
75 * ready */
76#define RAIDFRAME_FAIL_DISK _IOW ('r', 5, struct rf_recon_req) /* fail a disk &
77 * optionally start
78 * recon */
79#define RAIDFRAME_CHECK_RECON_STATUS _IOWR('r', 6, int) /* get reconstruction %
80 * complete on indicated
81 * row */
82#define RAIDFRAME_REWRITEPARITY _IO ('r', 7) /* rewrite (initialize)
83 * all parity */
84#define RAIDFRAME_COPYBACK _IO ('r', 8) /* copy reconstructed
85 * data back to replaced
86 * disk */
87#define RAIDFRAME_SPARET_WAIT _IOR ('r', 9, RF_SparetWait_t) /* does not return until
88 * kernel needs a spare
89 * table */
90#define RAIDFRAME_SEND_SPARET _IOW ('r', 10, void *) /* used to send a spare
91 * table down into the
92 * kernel */
93#define RAIDFRAME_ABORT_SPARET_WAIT _IO ('r', 11) /* used to wake up the
94 * sparemap daemon &
95 * tell it to exit */
96#define RAIDFRAME_START_ATRACE _IO ('r', 12) /* start tracing
97 * accesses */
98#define RAIDFRAME_STOP_ATRACE _IO ('r', 13) /* stop tracing accesses */
99#define RAIDFRAME_GET_SIZE _IOR ('r', 14, int) /* get size (# sectors)
100 * in raid device */
101/* 15 was RAIDFRAME_GET_INFO */
102#define RAIDFRAME_RESET_ACCTOTALS _IO ('r', 16) /* reset AccTotals for
103 * device */
104#define RAIDFRAME_GET_ACCTOTALS _IOR ('r', 17, RF_AccTotals_t) /* retrieve AccTotals
105 * for device */
106#define RAIDFRAME_KEEP_ACCTOTALS _IOW ('r', 18, int) /* turn AccTotals on or
107 * off for device */
108#define RAIDFRAME_GET_COMPONENT_LABEL _IOWR ('r', 19, RF_ComponentLabel_t)
109#define RAIDFRAME_SET_COMPONENT_LABEL _IOW ('r', 20, RF_ComponentLabel_t)
110
111#define RAIDFRAME_INIT_LABELS _IOW ('r', 21, RF_ComponentLabel_t)
112#define RAIDFRAME_ADD_HOT_SPARE _IOW ('r', 22, RF_SingleComponent_t)
113#define RAIDFRAME_REMOVE_HOT_SPARE _IOW ('r', 23, RF_SingleComponent_t)
114#define RAIDFRAME_REBUILD_IN_PLACE _IOW ('r', 24, RF_SingleComponent_t)
115#define RAIDFRAME_CHECK_PARITY _IOWR ('r', 25, int)
116#define RAIDFRAME_CHECK_PARITYREWRITE_STATUS _IOWR ('r', 26, int)
117#define RAIDFRAME_CHECK_COPYBACK_STATUS _IOWR ('r', 27, int)
118#define RAIDFRAME_SET_AUTOCONFIG _IOWR ('r', 28, int)
119#define RAIDFRAME_SET_ROOT _IOWR ('r', 29, int)
120#define RAIDFRAME_DELETE_COMPONENT _IOW ('r', 30, RF_SingleComponent_t)
121#define RAIDFRAME_INCORPORATE_HOT_SPARE _IOW ('r', 31, RF_SingleComponent_t)
122/* 'Extended' status versions */
123#define RAIDFRAME_CHECK_RECON_STATUS_EXT _IOWR('r', 32, RF_ProgressInfo_t)
124#define RAIDFRAME_CHECK_PARITYREWRITE_STATUS_EXT _IOWR ('r', 33, RF_ProgressInfo_t)
125#define RAIDFRAME_CHECK_COPYBACK_STATUS_EXT _IOWR ('r', 34, RF_ProgressInfo_t)
126/* 35 was RAIDFRAME_CONFIGURE */
127/* 36 was RAIDFRAME_GET_INFO */
128
129#define RAIDFRAME_PARITYMAP_STATUS _IOR('r', 37, struct rf_pmstat)
130#define RAIDFRAME_PARITYMAP_GET_DISABLE _IOR('r', 38, int)
131#define RAIDFRAME_PARITYMAP_SET_DISABLE _IOW('r', 39, int)
132#define RAIDFRAME_PARITYMAP_SET_PARAMS _IOW('r', 40, struct rf_pmparams)
133#define RAIDFRAME_SET_LAST_UNIT _IOW('r', 41, int)
134#define RAIDFRAME_GET_INFO _IOWR('r', 42, RF_DeviceConfig_t *) /* get configuration */
135#define RAIDFRAME_CONFIGURE _IOW ('r', 43, void *) /* configure the driver */
136
137#endif /* !_RF_RAIDFRAMEIO_H_ */
138