Home | History | Annotate | Line # | Download | only in raidframe
rf_driver.h revision 1.1
      1 /*	$NetBSD: rf_driver.h,v 1.1 1998/11/13 04:20:29 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 (at) 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  * :
     33  * Log: rf_driver.h,v
     34  * Revision 1.11  1996/07/11 19:08:00  jimz
     35  * generalize reconstruction mechanism
     36  * allow raid1 reconstructs via copyback (done with array
     37  * quiesced, not online, therefore not disk-directed)
     38  *
     39  * Revision 1.10  1996/06/10  14:18:58  jimz
     40  * move user, throughput stats into per-array structure
     41  *
     42  * Revision 1.9  1996/06/07  21:33:04  jimz
     43  * begin using consistent types for sector numbers,
     44  * stripe numbers, row+col numbers, recon unit numbers
     45  *
     46  * Revision 1.8  1996/06/05  18:06:02  jimz
     47  * Major code cleanup. The Great Renaming is now done.
     48  * Better modularity. Better typing. Fixed a bunch of
     49  * synchronization bugs. Made a lot of global stuff
     50  * per-desc or per-array. Removed dead code.
     51  *
     52  * Revision 1.7  1996/05/30  11:29:41  jimz
     53  * Numerous bug fixes. Stripe lock release code disagreed with the taking code
     54  * about when stripes should be locked (I made it consistent: no parity, no lock)
     55  * There was a lot of extra serialization of I/Os which I've removed- a lot of
     56  * it was to calculate values for the cache code, which is no longer with us.
     57  * More types, function, macro cleanup. Added code to properly quiesce the array
     58  * on shutdown. Made a lot of stuff array-specific which was (bogusly) general
     59  * before. Fixed memory allocation, freeing bugs.
     60  *
     61  * Revision 1.6  1996/05/27  18:56:37  jimz
     62  * more code cleanup
     63  * better typing
     64  * compiles in all 3 environments
     65  *
     66  * Revision 1.5  1996/05/24  22:17:04  jimz
     67  * continue code + namespace cleanup
     68  * typed a bunch of flags
     69  *
     70  * Revision 1.4  1996/05/24  04:28:55  jimz
     71  * release cleanup ckpt
     72  *
     73  * Revision 1.3  1996/05/24  01:59:45  jimz
     74  * another checkpoint in code cleanup for release
     75  * time to sync kernel tree
     76  *
     77  * Revision 1.2  1996/05/23  21:46:35  jimz
     78  * checkpoint in code cleanup (release prep)
     79  * lots of types, function names have been fixed
     80  *
     81  * Revision 1.1  1996/05/18  19:56:10  jimz
     82  * Initial revision
     83  *
     84  */
     85 
     86 #ifndef _RF__RF_DRIVER_H_
     87 #define _RF__RF_DRIVER_H_
     88 
     89 #include "rf_threadstuff.h"
     90 #include "rf_types.h"
     91 
     92 RF_DECLARE_EXTERN_MUTEX(rf_printf_mutex)
     93 
     94 int rf_BootRaidframe(void);
     95 int rf_UnbootRaidframe(void);
     96 int rf_Shutdown(RF_Raid_t *raidPtr);
     97 int rf_Configure(RF_Raid_t *raidPtr, RF_Config_t *cfgPtr);
     98 RF_RaidAccessDesc_t *rf_AllocRaidAccDesc(RF_Raid_t *raidPtr, RF_IoType_t type,
     99 	RF_RaidAddr_t raidAddress, RF_SectorCount_t numBlocks, caddr_t bufPtr,
    100 	void *bp, RF_DagHeader_t **paramDAG, RF_AccessStripeMapHeader_t **paramASM,
    101 	RF_RaidAccessFlags_t flags, void (*cbF)(struct buf *), void *cbA,
    102 	RF_AccessState_t *states);
    103 void rf_FreeRaidAccDesc(RF_RaidAccessDesc_t *desc);
    104 int rf_DoAccess(RF_Raid_t *raidPtr, RF_IoType_t type, int async_flag,
    105 	RF_RaidAddr_t raidAddress, RF_SectorCount_t numBlocks, caddr_t bufPtr,
    106 	void *bp_in, RF_DagHeader_t **paramDAG,
    107 	RF_AccessStripeMapHeader_t **paramASM, RF_RaidAccessFlags_t flags,
    108 	RF_RaidAccessDesc_t **paramDesc, void (*cbF)(struct buf *), void *cbA);
    109 int rf_SetReconfiguredMode(RF_Raid_t *raidPtr, RF_RowCol_t row,
    110 	RF_RowCol_t col);
    111 int rf_FailDisk(RF_Raid_t *raidPtr, RF_RowCol_t frow, RF_RowCol_t fcol,
    112 	int initRecon);
    113 #ifdef SIMULATE
    114 void rf_ScheduleContinueReconstructFailedDisk(RF_RaidReconDesc_t *reconDesc);
    115 #endif /* SIMULATE */
    116 void rf_SignalQuiescenceLock(RF_Raid_t *raidPtr, RF_RaidReconDesc_t *reconDesc);
    117 int  rf_SuspendNewRequestsAndWait(RF_Raid_t *raidPtr);
    118 void rf_ResumeNewRequests(RF_Raid_t *raidPtr);
    119 void rf_StartThroughputStats(RF_Raid_t *raidPtr);
    120 void rf_StartUserStats(RF_Raid_t *raidPtr);
    121 void rf_StopUserStats(RF_Raid_t *raidPtr);
    122 void rf_UpdateUserStats(RF_Raid_t *raidPtr, int rt, int numsect);
    123 void rf_PrintUserStats(RF_Raid_t *raidPtr);
    124 
    125 #endif /* !_RF__RF_DRIVER_H_ */
    126