xref: /netbsd-src/sys/dev/raidframe/rf_driver.h (revision 4472dbe5e3bd91ef2540bada7a7ca7384627ff9b)
1 /*	$NetBSD: rf_driver.h,v 1.4 2000/02/13 04:53:57 oster Exp $	*/
2 /*
3  * rf_driver.h
4  */
5 /*
6  * Copyright (c) 1996 Carnegie-Mellon University.
7  * All rights reserved.
8  *
9  * Author: Jim Zelenka
10  *
11  * Permission to use, copy, modify and distribute this software and
12  * its documentation is hereby granted, provided that both the copyright
13  * notice and this permission notice appear in all copies of the
14  * software, derivative works or modified versions, and any portions
15  * thereof, and that both notices appear in supporting documentation.
16  *
17  * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
18  * CONDITION.  CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND
19  * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
20  *
21  * Carnegie Mellon requests users of this software to return to
22  *
23  *  Software Distribution Coordinator  or  Software.Distribution@CS.CMU.EDU
24  *  School of Computer Science
25  *  Carnegie Mellon University
26  *  Pittsburgh PA 15213-3890
27  *
28  * any improvements or extensions that they make and grant Carnegie the
29  * rights to redistribute these changes.
30  */
31 
32 #ifndef _RF__RF_DRIVER_H_
33 #define _RF__RF_DRIVER_H_
34 
35 #include "rf_threadstuff.h"
36 #include "rf_types.h"
37 #include "rf_netbsd.h"
38 
39 #if _KERNEL
40 RF_DECLARE_EXTERN_MUTEX(rf_printf_mutex)
41 int     rf_BootRaidframe(void);
42 int     rf_UnbootRaidframe(void);
43 int     rf_Shutdown(RF_Raid_t * raidPtr);
44 int     rf_Configure(RF_Raid_t * raidPtr, RF_Config_t * cfgPtr,
45 		     RF_AutoConfig_t *ac);
46 RF_RaidAccessDesc_t *rf_AllocRaidAccDesc(RF_Raid_t * raidPtr, RF_IoType_t type,
47 					 RF_RaidAddr_t raidAddress,
48 					 RF_SectorCount_t numBlocks,
49 					 caddr_t bufPtr,
50 					 void *bp, RF_DagHeader_t ** paramDAG,
51 					 RF_AccessStripeMapHeader_t ** paramASM,
52 					 RF_RaidAccessFlags_t flags,
53 					 void (*cbF) (struct buf *),
54 					 void *cbA,
55 					 RF_AccessState_t * states);
56 void    rf_FreeRaidAccDesc(RF_RaidAccessDesc_t * desc);
57 int     rf_DoAccess(RF_Raid_t * raidPtr, RF_IoType_t type, int async_flag,
58 		    RF_RaidAddr_t raidAddress, RF_SectorCount_t numBlocks,
59 		    caddr_t bufPtr, void *bp_in, RF_DagHeader_t ** paramDAG,
60 		    RF_AccessStripeMapHeader_t ** paramASM,
61 		    RF_RaidAccessFlags_t flags,
62 		    RF_RaidAccessDesc_t ** paramDesc,
63 		    void (*cbF) (struct buf *), void *cbA);
64 int     rf_SetReconfiguredMode(RF_Raid_t * raidPtr, RF_RowCol_t row,
65 			       RF_RowCol_t col);
66 int     rf_FailDisk(RF_Raid_t * raidPtr, RF_RowCol_t frow, RF_RowCol_t fcol,
67 		    int initRecon);
68 void    rf_SignalQuiescenceLock(RF_Raid_t * raidPtr,
69 				RF_RaidReconDesc_t * reconDesc);
70 int     rf_SuspendNewRequestsAndWait(RF_Raid_t * raidPtr);
71 void    rf_ResumeNewRequests(RF_Raid_t * raidPtr);
72 void    rf_StartThroughputStats(RF_Raid_t * raidPtr);
73 void    rf_StartUserStats(RF_Raid_t * raidPtr);
74 void    rf_StopUserStats(RF_Raid_t * raidPtr);
75 void    rf_UpdateUserStats(RF_Raid_t * raidPtr, int rt, int numsect);
76 void    rf_PrintUserStats(RF_Raid_t * raidPtr);
77 #endif /* _KERNEL */
78 #endif				/* !_RF__RF_DRIVER_H_ */
79