1 1.4 cgd /* $NetBSD: scsi_changer.h,v 1.4 1994/06/29 06:43:02 cgd Exp $ */ 2 1.4 cgd 3 1.1 cgd /* 4 1.2 cgd * SCSI changer interface description 5 1.3 mycroft */ 6 1.3 mycroft 7 1.3 mycroft /* 8 1.1 cgd * Written by Stefan Grefen (grefen (at) goofy.zdv.uni-mainz.de soon grefen (at) convex.com) 9 1.1 cgd * based on the SCSI System by written Julian Elischer (julian (at) tfs.com) 10 1.1 cgd * for TRW Financial Systems. 11 1.1 cgd * 12 1.1 cgd * TRW Financial Systems, in accordance with their agreement with Carnegie 13 1.1 cgd * Mellon University, makes this software available to CMU to distribute 14 1.1 cgd * or use in any manner that they see fit as long as this message is kept with 15 1.1 cgd * the software. For this reason TFS also grants any other persons or 16 1.1 cgd * organisations permission to use or modify this software. 17 1.1 cgd * 18 1.1 cgd * TFS supplies this software to be publicly redistributed 19 1.1 cgd * on the understanding that TFS is not responsible for the correct 20 1.1 cgd * functioning of this software in any circumstances. 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.3 mycroft #ifndef _SCSI_SCSI_CHANGER_H 25 1.3 mycroft #define _SCSI_SCSI_CHANGER_H 1 26 1.1 cgd 27 1.1 cgd /* 28 1.1 cgd * SCSI command format 29 1.1 cgd */ 30 1.1 cgd struct scsi_read_element_status 31 1.1 cgd { 32 1.1 cgd u_char op_code; 33 1.3 mycroft u_char byte2; 34 1.3 mycroft #define SRES_ELEM_TYPE_CODE 0x0F 35 1.3 mycroft #define SRES_ELEM_VOLTAG 0x10 36 1.1 cgd u_char starting_element_addr[2]; 37 1.1 cgd u_char number_of_elements[2]; 38 1.1 cgd u_char resv1; 39 1.1 cgd u_char allocation_length[3]; 40 1.1 cgd u_char resv2; 41 1.3 mycroft u_char control; 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.3 mycroft u_char byte2; 53 1.1 cgd u_char transport_element_address[2]; 54 1.1 cgd u_char source_address[2]; 55 1.1 cgd u_char destination_address[2]; 56 1.1 cgd u_char rsvd[2]; 57 1.3 mycroft u_char invert; 58 1.3 mycroft u_char control; 59 1.1 cgd }; 60 1.1 cgd 61 1.1 cgd struct scsi_position_to_element 62 1.1 cgd { 63 1.1 cgd u_char op_code; 64 1.3 mycroft u_char byte2; 65 1.1 cgd u_char transport_element_address[2]; 66 1.1 cgd u_char source_address[2]; 67 1.1 cgd u_char rsvd[2]; 68 1.3 mycroft u_char invert; 69 1.3 mycroft u_char control; 70 1.1 cgd }; 71 1.1 cgd 72 1.1 cgd /* 73 1.1 cgd * Opcodes 74 1.1 cgd */ 75 1.1 cgd #define POSITION_TO_ELEMENT 0x2b 76 1.1 cgd #define MOVE_MEDIUM 0xa5 77 1.1 cgd #define READ_ELEMENT_STATUS 0xb8 78 1.1 cgd 79 1.1 cgd struct scsi_element_status_data 80 1.1 cgd { 81 1.1 cgd u_char first_element_reported[2]; 82 1.1 cgd u_char number_of_elements_reported[2]; 83 1.1 cgd u_char rsvd; 84 1.1 cgd u_char byte_count_of_report[3]; 85 1.1 cgd }; 86 1.1 cgd 87 1.1 cgd struct element_status_page 88 1.1 cgd { 89 1.1 cgd u_char element_type_code; 90 1.3 mycroft u_char flags; 91 1.3 mycroft #define ESP_AVOLTAG 0x40 92 1.3 mycroft #define ESP_PVOLTAG 0x80 93 1.1 cgd u_char element_descriptor_length[2]; 94 1.1 cgd u_char rsvd; 95 1.1 cgd u_char byte_count_of_descriptor_data[3]; 96 1.1 cgd }; 97 1.3 mycroft #endif /*_SCSI_SCSI_CHANGER_H*/ 98 1.1 cgd 99