chio.h revision 785
14Srgrimes/* 24Srgrimes * 16 Feb 93 Julian Elischer ADDED for SCSI system 3624Srgrimes * 4785Srgrimes * $Id: chio.h,v 1.3 1993/10/16 17:16:27 rgrimes Exp $ 54Srgrimes */ 64Srgrimes 74Srgrimes/* This is a "convertet" mtio.h from 386BSD 84Srgrimes Stefan Grefen grefen@goofy.zdv.uni-mainz.de 94Srgrimes */ 104Srgrimes 114Srgrimes/* 124Srgrimes * Structures and definitions for changer io control commands 134Srgrimes */ 14785Srgrimes#ifndef _SYS_CHIO_H_ 15785Srgrimes#define _SYS_CHIO_H_ 164Srgrimes 174Srgrimes#define CH_INVERT 0x10000 184Srgrimes#define CH_ADDR_MASK 0xffff 194Srgrimesstruct chop { 204Srgrimes short ch_op; /* operations defined below */ 214Srgrimes short result; /* The result */ 224Srgrimes union { 234Srgrimes struct { 244Srgrimes int chm; /* Transport element */ 254Srgrimes int from; 264Srgrimes int to; 274Srgrimes } move; 284Srgrimes struct { 294Srgrimes int chm; /* Transport element */ 304Srgrimes int to; 314Srgrimes } position; 324Srgrimes struct { 334Srgrimes short chmo; /* Offset of first CHM */ 344Srgrimes short chms; /* No. of CHM */ 354Srgrimes short slots; /* No. of Storage Elements */ 364Srgrimes short sloto; /* Offset of first SE */ 374Srgrimes short imexs; /* No. of Import/Export Slots */ 384Srgrimes short imexo; /* Offset of first IM/EX */ 394Srgrimes short drives; /* No. of CTS */ 404Srgrimes short driveo; /* Offset of first CTS */ 414Srgrimes short rot; /* CHM can rotate */ 424Srgrimes } getparam; 434Srgrimes struct { 444Srgrimes int type; 454Srgrimes#define CH_CHM 1 464Srgrimes#define CH_STOR 2 474Srgrimes#define CH_IMEX 3 484Srgrimes#define CH_CTS 4 494Srgrimes int from; 504Srgrimes struct { 514Srgrimes u_char elema_1; 524Srgrimes u_char elema_0; 534Srgrimes u_char full:1; 544Srgrimes u_char rsvd:1; 554Srgrimes u_char except:1; 564Srgrimes u_char :5; 574Srgrimes u_char rsvd2; 584Srgrimes union { 594Srgrimes struct { 604Srgrimes u_char add_sense_code; 614Srgrimes u_char add_sense_code_qualifier; 624Srgrimes } specs; 634Srgrimes short add_sense; 644Srgrimes/* WARINING LSB only */ 654Srgrimes#define CH_CHOLDER 0x0290 /* Cartridge holder is missing */ 664Srgrimes#define CH_STATUSQ 0x0390 /* Status is questionable */ 674Srgrimes#define CH_CTS_CLOSED 0x0490 /* CTS door is closed */ 684Srgrimes 694Srgrimes } ch_add_sense; 704Srgrimes u_char rsvd3[3]; 714Srgrimes u_char :6; 724Srgrimes u_char invert:1; 734Srgrimes u_char svalid:1; 744Srgrimes u_char source_1; 754Srgrimes u_char source_0; 764Srgrimes u_char rsvd4[4]; 774Srgrimes } elem_data; 784Srgrimes } get_elem_stat; 794Srgrimes } u; 804Srgrimes}; 814Srgrimes 824Srgrimes/* operations */ 834Srgrimes#define CHMOVE 1 844Srgrimes#define CHPOSITION 2 854Srgrimes#define CHGETPARAM 3 864Srgrimes#define CHGETELEM 4 874Srgrimes 884Srgrimes 894Srgrimes/* Changer IO control command */ 904Srgrimes#define CHIOOP _IOWR('c', 1, struct chop) /* do a mag tape op */ 91785Srgrimes 92785Srgrimes#endif /*_SYS_CHIO_H*/ 93