From d16e0e3b77e01af7aa6dd25eb69d162bb74788fb Mon Sep 17 00:00:00 2001 From: gibbs Date: Tue, 15 Sep 1998 10:07:26 +0000 Subject: system.h: Add definition for at_shutdown(9)'s SHUTDOWN_FINAL. ccdvar.h: chio.h: mtio.h: Add CAM support. --- sys/sys/ccdvar.h | 5 +- sys/sys/chio.h | 144 +++++++++++++++++++++++++++++++++++++++++-------------- sys/sys/mtio.h | 17 ++++--- sys/sys/systm.h | 3 +- 4 files changed, 121 insertions(+), 48 deletions(-) diff --git a/sys/sys/ccdvar.h b/sys/sys/ccdvar.h index cc6a95e..370e165 100644 --- a/sys/sys/ccdvar.h +++ b/sys/sys/ccdvar.h @@ -1,4 +1,4 @@ -/* $Id$ */ +/* $Id: ccdvar.h,v 1.6 1997/02/22 09:44:51 peter Exp $ */ /* $NetBSD: ccdvar.h,v 1.7.2.1 1995/10/12 21:30:18 thorpej Exp $ */ @@ -186,8 +186,7 @@ struct ccd_softc { int sc_nccdisks; /* number of components */ struct ccdcinfo *sc_cinfo; /* component info */ struct ccdiinfo *sc_itable; /* interleave table */ - int sc_nactive; /* number of requests active */ - int sc_dk; /* disk index */ + struct devstat device_stats; /* device statistics */ struct ccdgeom sc_geom; /* pseudo geometry info */ struct dkdevice sc_dkdev; /* generic disk device info */ }; diff --git a/sys/sys/chio.h b/sys/sys/chio.h index abf9ae7..97c80e0 100644 --- a/sys/sys/chio.h +++ b/sys/sys/chio.h @@ -29,7 +29,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: chio.h,v 1.10 1997/03/06 15:36:45 joerg Exp $ + * $Id: chio.h,v 1.11 1997/03/11 19:38:02 joerg Exp $ */ #ifndef _SYS_CHIO_H_ @@ -54,14 +54,19 @@ #define CHET_DT 3 /* data transfer (drive) */ /* + * Maximum length of a volume identification string + */ +#define CH_VOLTAG_MAXLEN 32 + +/* * Structure used to execute a MOVE MEDIUM command. */ struct changer_move { - int cm_fromtype; /* element type to move from */ - int cm_fromunit; /* logical unit of from element */ - int cm_totype; /* element type to move to */ - int cm_tounit; /* logical unit of to element */ - int cm_flags; /* misc. flags */ + u_int16_t cm_fromtype; /* element type to move from */ + u_int16_t cm_fromunit; /* logical unit of from element */ + u_int16_t cm_totype; /* element type to move to */ + u_int16_t cm_tounit; /* logical unit of to element */ + u_int16_t cm_flags; /* misc. flags */ }; /* cm_flags */ @@ -81,13 +86,13 @@ struct changer_move { * are the same. */ struct changer_exchange { - int ce_srctype; /* element type of source */ - int ce_srcunit; /* logical unit of source */ - int ce_fdsttype; /* element type of first destination */ - int ce_fdstunit; /* logical unit of first destination */ - int ce_sdsttype; /* element type of second destination */ - int ce_sdstunit; /* logical unit of second destination */ - int ce_flags; /* misc. flags */ + u_int16_t ce_srctype; /* element type of source */ + u_int16_t ce_srcunit; /* logical unit of source */ + u_int16_t ce_fdsttype; /* element type of first destination */ + u_int16_t ce_fdstunit; /* logical unit of first destination */ + u_int16_t ce_sdsttype; /* element type of second destination */ + u_int16_t ce_sdstunit; /* logical unit of second destination */ + u_int16_t ce_flags; /* misc. flags */ }; /* ce_flags */ @@ -99,9 +104,9 @@ struct changer_exchange { * moves the current picker in front of the specified element. */ struct changer_position { - int cp_type; /* element type */ - int cp_unit; /* logical unit of element */ - int cp_flags; /* misc. flags */ + u_int16_t cp_type; /* element type */ + u_int16_t cp_unit; /* logical unit of element */ + u_int16_t cp_flags; /* misc. flags */ }; /* cp_flags */ @@ -111,36 +116,99 @@ struct changer_position { * Data returned by CHIOGPARAMS. */ struct changer_params { - int cp_curpicker; /* current picker */ - int cp_npickers; /* number of pickers */ - int cp_nslots; /* number of slots */ - int cp_nportals; /* number of import/export portals */ - int cp_ndrives; /* number of drives */ + u_int16_t cp_npickers; /* number of pickers */ + u_int16_t cp_nslots; /* number of slots */ + u_int16_t cp_nportals; /* number of import/export portals */ + u_int16_t cp_ndrives; /* number of drives */ }; /* * Command used to get element status. */ -struct changer_element_status { - int ces_type; /* element type */ - u_int8_t *ces_data; /* pre-allocated data storage */ + +struct changer_voltag { + u_char cv_volid[CH_VOLTAG_MAXLEN+1]; + u_int16_t cv_serial; }; +typedef struct changer_voltag changer_voltag_t; + /* - * Data returned by CHIOGSTATUS is an array of flags bytes. + * Flags definitions for ces_status * Not all flags have meaning for all element types. */ -#define CESTATUS_FULL 0x01 /* element is full */ -#define CESTATUS_IMPEXP 0x02 /* media deposited by operator */ -#define CESTATUS_EXCEPT 0x04 /* element in abnormal state */ -#define CESTATUS_ACCESS 0x08 /* media accessible by picker */ -#define CESTATUS_EXENAB 0x10 /* element supports exporting */ -#define CESTATUS_INENAB 0x20 /* element supports importing */ - -#define CESTATUS_PICKER_MASK 0x05 /* flags valid for pickers */ -#define CESTATUS_SLOT_MASK 0x0c /* flags valid for slots */ -#define CESTATUS_PORTAL_MASK 0x3f /* flags valid for portals */ -#define CESTATUS_DRIVE_MASK 0x0c /* flags valid for drives */ +typedef enum { + CES_STATUS_FULL = 0x001, /* element is full */ + CES_STATUS_IMPEXP = 0x002, /* media deposited by operator */ + CES_STATUS_EXCEPT = 0x004, /* element in abnormal state */ + CES_PICKER_MASK = 0x005, /* flags valid for pickers */ + CES_STATUS_ACCESS = 0x008, /* media accessible by picker */ + CES_SLOT_MASK = 0x00c, /* flags valid for slots */ + CES_DRIVE_MASK = 0x00c, /* flags valid for drives */ + CES_STATUS_EXENAB = 0x010, /* element supports exporting */ + CES_STATUS_INENAB = 0x020, /* element supports importing */ + CES_PORTAL_MASK = 0x03f, /* flags valid for portals */ + CES_INVERT = 0x040, /* invert bit */ + CES_SOURCE_VALID = 0x080, /* source address (ces_source) valid */ + CES_SCSIID_VALID = 0x100, /* ces_scsi_id is valid */ + CES_LUN_VALID = 0x200, /* ces_scsi_lun is valid */ +} ces_status_flags; + +struct changer_element_status { + u_int8_t ces_type; /* element type */ + u_int16_t ces_addr; /* logical element address */ + u_int16_t ces_int_addr; /* changer element address */ + ces_status_flags ces_flags; /* + * see CESTATUS definitions + * below + */ + u_int8_t ces_sensecode; /* + * additional sense + * code for element */ + u_int8_t ces_sensequal; /* + * additional sense + * code qualifier + */ + u_int8_t ces_source_type; /* + * element type of + * source address + */ + u_int16_t ces_source_addr; /* + * source address of medium + */ + changer_voltag_t ces_pvoltag; /* primary volume tag */ + changer_voltag_t ces_avoltag; /* alternate volume tag */ + u_int8_t ces_scsi_id; /* SCSI id of element */ + u_int8_t ces_scsi_lun; /* SCSI lun of element */ +}; + +struct changer_element_status_request { + u_int16_t cesr_element_type; + u_int16_t cesr_element_base; + u_int16_t cesr_element_count; + + u_int16_t cesr_flags; +#define CESR_VOLTAGS 0x01 + + struct changer_element_status *cesr_element_status; +}; + + +struct changer_set_voltag_request { + u_int16_t csvr_type; + u_int16_t csvr_addr; + + u_int16_t csvr_flags; +#define CSVR_MODE_MASK 0x0f /* mode mask, acceptable modes below: */ +#define CSVR_MODE_SET 0x00 /* set volume tag if not set */ +#define CSVR_MODE_REPLACE 0x01 /* unconditionally replace volume tag */ +#define CSVR_MODE_CLEAR 0x02 /* clear volume tag */ + +#define CSVR_ALTERNATE 0x10 /* set to work with alternate voltag */ + + changer_voltag_t csvr_voltag; +}; + #define CESTATUS_BITS \ "\20\6INEAB\5EXENAB\4ACCESS\3EXCEPT\2IMPEXP\1FULL" @@ -151,6 +219,8 @@ struct changer_element_status { #define CHIOGPICKER _IOR('c', 0x04, int) #define CHIOSPICKER _IOW('c', 0x05, int) #define CHIOGPARAMS _IOR('c', 0x06, struct changer_params) -#define CHIOGSTATUS _IOW('c', 0x08, struct changer_element_status) +#define CHIOIELEM _IOW('c', 0x07, u_int32_t) +#define CHIOGSTATUS _IOW('c', 0x08, struct changer_element_status_request) +#define CHIOSETVOLTAG _IOW('c', 0x09, struct changer_set_voltag_request) #endif /* !_SYS_CHIO_H_ */ diff --git a/sys/sys/mtio.h b/sys/sys/mtio.h index 3ce0e69..d6aaf27 100644 --- a/sys/sys/mtio.h +++ b/sys/sys/mtio.h @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)mtio.h 8.1 (Berkeley) 6/2/93 - * $Id$ + * $Id: mtio.h,v 1.10 1997/02/22 09:45:37 peter Exp $ */ #ifndef _SYS_MTIO_H_ @@ -83,6 +83,9 @@ struct mtop { #define MTCOMP 14 /* select compression mode 0=off, 1=def */ #define MTRETENS 15 /* re-tension tape */ +#define MT_COMP_ENABLE 0xffffffff +#define MT_COMP_DISABLED 0xfffffffe +#define MT_COMP_UNSUPP 0xfffffffd #endif /* structure for MTIOCGET - mag tape get status command */ @@ -97,7 +100,7 @@ struct mtget { #if defined (__FreeBSD__) daddr_t mt_blksiz; /* presently operating blocksize */ daddr_t mt_density; /* presently operating density */ - daddr_t mt_comp; /* presently operating compression */ + u_int32_t mt_comp; /* presently operating compression */ daddr_t mt_blksiz0; /* blocksize for mode 0 */ daddr_t mt_blksiz1; /* blocksize for mode 1 */ daddr_t mt_blksiz2; /* blocksize for mode 2 */ @@ -107,10 +110,10 @@ struct mtget { daddr_t mt_density2; /* density for mode 2 */ daddr_t mt_density3; /* density for mode 3 */ /* the following are not yet implemented */ - u_char mt_comp0; /* compression type for mode 0 */ - u_char mt_comp1; /* compression type for mode 1 */ - u_char mt_comp2; /* compression type for mode 2 */ - u_char mt_comp3; /* compression type for mode 3 */ + u_int32_t mt_comp0; /* compression type for mode 0 */ + u_int32_t mt_comp1; /* compression type for mode 1 */ + u_int32_t mt_comp2; /* compression type for mode 2 */ + u_int32_t mt_comp3; /* compression type for mode 3 */ #endif daddr_t mt_fileno; /* file number of current position */ daddr_t mt_blkno; /* block number of current position */ @@ -149,7 +152,7 @@ struct mtget { #define MTIOCEEOT _IO('m', 4) /* enable EOT error */ #ifndef KERNEL -#define DEFTAPE "/dev/nrst0" +#define DEFTAPE "/dev/nrsa0" #endif #ifdef KERNEL diff --git a/sys/sys/systm.h b/sys/sys/systm.h index 9a93478..07ad6a5 100644 --- a/sys/sys/systm.h +++ b/sys/sys/systm.h @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)systm.h 8.7 (Berkeley) 3/29/95 - * $Id: systm.h,v 1.74 1998/08/05 18:18:06 bde Exp $ + * $Id: systm.h,v 1.75 1998/09/06 06:25:18 ache Exp $ */ #ifndef _SYS_SYSTM_H_ @@ -263,6 +263,7 @@ int rm_at_fork __P((forklist_fn function)); /* Shutdown callout list definitions and declarations. */ #define SHUTDOWN_PRE_SYNC 0 #define SHUTDOWN_POST_SYNC 1 +#define SHUTDOWN_FINAL 2 typedef void (*bootlist_fn) __P((int, void *)); -- cgit v1.1