1 1.5 mycroft /* $NetBSD: scsi_changer.h,v 1.5 1994/12/28 19:42:59 mycroft 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.5 mycroft struct scsi_read_element_status { 31 1.5 mycroft u_char opcode; 32 1.3 mycroft u_char byte2; 33 1.3 mycroft #define SRES_ELEM_TYPE_CODE 0x0F 34 1.3 mycroft #define SRES_ELEM_VOLTAG 0x10 35 1.1 cgd u_char starting_element_addr[2]; 36 1.1 cgd u_char number_of_elements[2]; 37 1.1 cgd u_char resv1; 38 1.1 cgd u_char allocation_length[3]; 39 1.1 cgd u_char resv2; 40 1.3 mycroft u_char control; 41 1.1 cgd }; 42 1.1 cgd #define RE_ALL_ELEMENTS 0 43 1.1 cgd #define RE_MEDIUM_TRANSPORT_ELEMENT 1 44 1.1 cgd #define RE_STORAGE_ELEMENT 2 45 1.1 cgd #define RE_IMPORT_EXPORT 3 46 1.1 cgd #define RE_DATA_TRANSFER_ELEMENT 4 47 1.1 cgd 48 1.5 mycroft struct scsi_move_medium { 49 1.5 mycroft u_char opcode; 50 1.3 mycroft u_char byte2; 51 1.1 cgd u_char transport_element_address[2]; 52 1.1 cgd u_char source_address[2]; 53 1.1 cgd u_char destination_address[2]; 54 1.1 cgd u_char rsvd[2]; 55 1.3 mycroft u_char invert; 56 1.3 mycroft u_char control; 57 1.1 cgd }; 58 1.1 cgd 59 1.5 mycroft struct scsi_position_to_element { 60 1.5 mycroft u_char opcode; 61 1.3 mycroft u_char byte2; 62 1.1 cgd u_char transport_element_address[2]; 63 1.1 cgd u_char source_address[2]; 64 1.1 cgd u_char rsvd[2]; 65 1.3 mycroft u_char invert; 66 1.3 mycroft u_char control; 67 1.1 cgd }; 68 1.1 cgd 69 1.1 cgd /* 70 1.1 cgd * Opcodes 71 1.1 cgd */ 72 1.1 cgd #define POSITION_TO_ELEMENT 0x2b 73 1.1 cgd #define MOVE_MEDIUM 0xa5 74 1.1 cgd #define READ_ELEMENT_STATUS 0xb8 75 1.1 cgd 76 1.5 mycroft struct scsi_element_status_data { 77 1.1 cgd u_char first_element_reported[2]; 78 1.1 cgd u_char number_of_elements_reported[2]; 79 1.1 cgd u_char rsvd; 80 1.1 cgd u_char byte_count_of_report[3]; 81 1.1 cgd }; 82 1.1 cgd 83 1.5 mycroft struct element_status_page { 84 1.1 cgd u_char element_type_code; 85 1.3 mycroft u_char flags; 86 1.3 mycroft #define ESP_AVOLTAG 0x40 87 1.3 mycroft #define ESP_PVOLTAG 0x80 88 1.1 cgd u_char element_descriptor_length[2]; 89 1.1 cgd u_char rsvd; 90 1.1 cgd u_char byte_count_of_descriptor_data[3]; 91 1.1 cgd }; 92 1.5 mycroft 93 1.5 mycroft #endif /* _SCSI_SCSI_CHANGER_H */ 94 1.1 cgd 95