Home | History | Annotate | Line # | Download | only in scsipi
scsi_changer.h revision 1.2
      1  1.1  cgd /*
      2  1.2  cgd  * SCSI changer interface description
      3  1.1  cgd  *
      4  1.1  cgd  * Written by Stefan Grefen   (grefen (at) goofy.zdv.uni-mainz.de soon grefen (at) convex.com)
      5  1.1  cgd  * based on the SCSI System by written Julian Elischer (julian (at) tfs.com)
      6  1.1  cgd  * for TRW Financial Systems.
      7  1.1  cgd  *
      8  1.1  cgd  * TRW Financial Systems, in accordance with their agreement with Carnegie
      9  1.1  cgd  * Mellon University, makes this software available to CMU to distribute
     10  1.1  cgd  * or use in any manner that they see fit as long as this message is kept with
     11  1.1  cgd  * the software. For this reason TFS also grants any other persons or
     12  1.1  cgd  * organisations permission to use or modify this software.
     13  1.1  cgd  *
     14  1.1  cgd  * TFS supplies this software to be publicly redistributed
     15  1.1  cgd  * on the understanding that TFS is not responsible for the correct
     16  1.1  cgd  * functioning of this software in any circumstances.
     17  1.1  cgd  *
     18  1.2  cgd  *	$Id: scsi_changer.h,v 1.2 1993/05/20 03:46:30 cgd Exp $
     19  1.1  cgd  */
     20  1.1  cgd 
     21  1.1  cgd /*
     22  1.1  cgd  * Ported to run under 386BSD by Julian Elischer (julian (at) tfs.com) Sept 1992
     23  1.1  cgd  */
     24  1.1  cgd 
     25  1.1  cgd /*
     26  1.1  cgd  * SCSI command format
     27  1.1  cgd  */
     28  1.1  cgd struct scsi_read_element_status
     29  1.1  cgd {
     30  1.1  cgd         u_char  op_code;
     31  1.1  cgd 	u_char	element_type_code:4;
     32  1.1  cgd 	u_char  voltag:1;
     33  1.1  cgd         u_char  lun:3;
     34  1.1  cgd 	u_char	starting_element_addr[2];
     35  1.1  cgd 	u_char	number_of_elements[2];
     36  1.1  cgd 	u_char	resv1;
     37  1.1  cgd 	u_char	allocation_length[3];
     38  1.1  cgd 	u_char	resv2;
     39  1.1  cgd         u_char  link:1;
     40  1.1  cgd         u_char  flag:1;
     41  1.1  cgd         u_char  :6;
     42  1.1  cgd };
     43  1.1  cgd #define RE_ALL_ELEMENTS			0
     44  1.1  cgd #define RE_MEDIUM_TRANSPORT_ELEMENT	1
     45  1.1  cgd #define RE_STORAGE_ELEMENT		2
     46  1.1  cgd #define RE_IMPORT_EXPORT		3
     47  1.1  cgd #define RE_DATA_TRANSFER_ELEMENT	4
     48  1.1  cgd 
     49  1.1  cgd struct scsi_move_medium
     50  1.1  cgd {
     51  1.1  cgd 	u_char  op_code;
     52  1.1  cgd 	u_char	:5;
     53  1.1  cgd 	u_char	lun:3;
     54  1.1  cgd 	u_char  transport_element_address[2];
     55  1.1  cgd 	u_char  source_address[2];
     56  1.1  cgd 	u_char  destination_address[2];
     57  1.1  cgd 	u_char  rsvd[2];
     58  1.1  cgd 	u_char  invert:1;
     59  1.1  cgd 	u_char	:7;
     60  1.1  cgd         u_char  link:1;
     61  1.1  cgd         u_char  flag:1;
     62  1.1  cgd         u_char  :6;
     63  1.1  cgd };
     64  1.1  cgd 
     65  1.1  cgd struct scsi_position_to_element
     66  1.1  cgd {
     67  1.1  cgd 	u_char  op_code;
     68  1.1  cgd 	u_char	:5;
     69  1.1  cgd 	u_char	lun:3;
     70  1.1  cgd 	u_char  transport_element_address[2];
     71  1.1  cgd 	u_char  source_address[2];
     72  1.1  cgd 	u_char  rsvd[2];
     73  1.1  cgd 	u_char  invert:1;
     74  1.1  cgd 	u_char	:7;
     75  1.1  cgd         u_char  link:1;
     76  1.1  cgd         u_char  flag:1;
     77  1.1  cgd         u_char  :6;
     78  1.1  cgd };
     79  1.1  cgd 
     80  1.1  cgd /*
     81  1.1  cgd  * Opcodes
     82  1.1  cgd  */
     83  1.1  cgd #define POSITION_TO_ELEMENT     0x2b
     84  1.1  cgd #define MOVE_MEDIUM             0xa5
     85  1.1  cgd #define READ_ELEMENT_STATUS     0xb8
     86  1.1  cgd 
     87  1.1  cgd struct scsi_element_status_data
     88  1.1  cgd {
     89  1.1  cgd 	u_char	first_element_reported[2];
     90  1.1  cgd 	u_char	number_of_elements_reported[2];
     91  1.1  cgd 	u_char  rsvd;
     92  1.1  cgd 	u_char	byte_count_of_report[3];
     93  1.1  cgd };
     94  1.1  cgd 
     95  1.1  cgd struct element_status_page
     96  1.1  cgd {
     97  1.1  cgd 	u_char	element_type_code;
     98  1.1  cgd 	u_char	:5;
     99  1.1  cgd 	u_char avoltag:1;
    100  1.1  cgd 	u_char pvoltag:1;
    101  1.1  cgd 	u_char element_descriptor_length[2];
    102  1.1  cgd 	u_char rsvd;
    103  1.1  cgd 	u_char byte_count_of_descriptor_data[3];
    104  1.1  cgd };
    105  1.1  cgd 
    106