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