xref: /netbsd/sys/dev/raidframe/rf_callback.h (revision bf9ec67e)
1 /*	$NetBSD: rf_callback.h,v 1.4 2001/10/04 15:58:51 oster Exp $	*/
2 /*
3  * Copyright (c) 1995 Carnegie-Mellon University.
4  * All rights reserved.
5  *
6  * Author: Mark Holland
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 /*****************************************************************************************
30  *
31  * callback.h -- header file for callback.c
32  *
33  * the reconstruction code must manage concurrent I/Os on multiple drives.
34  * it sometimes needs to suspend operation on a particular drive until some
35  * condition occurs.  we can't block the thread, of course, or we wouldn't
36  * be able to manage our other outstanding I/Os.  Instead we just suspend
37  * new activity on the indicated disk, and create a callback descriptor and
38  * put it someplace where it will get invoked when the condition that's
39  * stalling us has cleared.  When the descriptor is invoked, it will call
40  * a function that will restart operation on the indicated disk.
41  *
42  ****************************************************************************************/
43 
44 #ifndef _RF__RF_CALLBACK_H_
45 #define _RF__RF_CALLBACK_H_
46 
47 #include <dev/raidframe/raidframevar.h>
48 
49 struct RF_CallbackDesc_s {
50 	void    (*callbackFunc) (RF_CBParam_t);	/* function to call */
51 	RF_CBParam_t callbackArg;	/* args to give to function, or just
52 					 * info about this callback  */
53 	RF_CBParam_t callbackArg2;
54 	RF_RowCol_t row;	/* disk row and column IDs to give to the
55 				 * callback func */
56 	RF_RowCol_t col;
57 	RF_CallbackDesc_t *next;/* next entry in list */
58 };
59 
60 int     rf_ConfigureCallback(RF_ShutdownList_t ** listp);
61 RF_CallbackDesc_t *rf_AllocCallbackDesc(void);
62 void    rf_FreeCallbackDesc(RF_CallbackDesc_t * p);
63 
64 #endif				/* !_RF__RF_CALLBACK_H_ */
65