1 /* SPDX-License-Identifier: GPL-2.0 WITH Linux 1 /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ 2 /* 2 /* 3 * ioctl interface for the scsi media changer 3 * ioctl interface for the scsi media changer driver 4 */ 4 */ 5 5 6 #ifndef _UAPI_LINUX_CHIO_H << 7 #define _UAPI_LINUX_CHIO_H << 8 << 9 /* changer element types */ 6 /* changer element types */ 10 #define CHET_MT 0 /* media transport ele 7 #define CHET_MT 0 /* media transport element (robot) */ 11 #define CHET_ST 1 /* storage element (me 8 #define CHET_ST 1 /* storage element (media slots) */ 12 #define CHET_IE 2 /* import/export eleme 9 #define CHET_IE 2 /* import/export element */ 13 #define CHET_DT 3 /* data transfer eleme 10 #define CHET_DT 3 /* data transfer element (tape/cdrom/whatever) */ 14 #define CHET_V1 4 /* vendor specific #1 11 #define CHET_V1 4 /* vendor specific #1 */ 15 #define CHET_V2 5 /* vendor specific #2 12 #define CHET_V2 5 /* vendor specific #2 */ 16 #define CHET_V3 6 /* vendor specific #3 13 #define CHET_V3 6 /* vendor specific #3 */ 17 #define CHET_V4 7 /* vendor specific #4 14 #define CHET_V4 7 /* vendor specific #4 */ 18 15 19 16 20 /* 17 /* 21 * CHIOGPARAMS 18 * CHIOGPARAMS 22 * query changer properties 19 * query changer properties 23 * 20 * 24 * CHIOVGPARAMS 21 * CHIOVGPARAMS 25 * query vendor-specific element types 22 * query vendor-specific element types 26 * 23 * 27 * accessing elements works by specifing ty 24 * accessing elements works by specifing type and unit of the element. 28 * for example, storage elements are addres 25 * for example, storage elements are addressed with type = CHET_ST and 29 * unit = 0 .. cp_nslots-1 26 * unit = 0 .. cp_nslots-1 30 * 27 * 31 */ 28 */ 32 struct changer_params { 29 struct changer_params { 33 int cp_curpicker; /* current transpor 30 int cp_curpicker; /* current transport element */ 34 int cp_npickers; /* number of transp 31 int cp_npickers; /* number of transport elements (CHET_MT) */ 35 int cp_nslots; /* number of storag 32 int cp_nslots; /* number of storage elements (CHET_ST) */ 36 int cp_nportals; /* number of import 33 int cp_nportals; /* number of import/export elements (CHET_IE) */ 37 int cp_ndrives; /* number of data t 34 int cp_ndrives; /* number of data transfer elements (CHET_DT) */ 38 }; 35 }; 39 struct changer_vendor_params { 36 struct changer_vendor_params { 40 int cvp_n1; /* number of vendor 37 int cvp_n1; /* number of vendor specific elems (CHET_V1) */ 41 char cvp_label1[16]; 38 char cvp_label1[16]; 42 int cvp_n2; /* number of vendor 39 int cvp_n2; /* number of vendor specific elems (CHET_V2) */ 43 char cvp_label2[16]; 40 char cvp_label2[16]; 44 int cvp_n3; /* number of vendor 41 int cvp_n3; /* number of vendor specific elems (CHET_V3) */ 45 char cvp_label3[16]; 42 char cvp_label3[16]; 46 int cvp_n4; /* number of vendor 43 int cvp_n4; /* number of vendor specific elems (CHET_V4) */ 47 char cvp_label4[16]; 44 char cvp_label4[16]; 48 int reserved[8]; 45 int reserved[8]; 49 }; 46 }; 50 47 51 48 52 /* 49 /* 53 * CHIOMOVE 50 * CHIOMOVE 54 * move a medium from one element to anothe 51 * move a medium from one element to another 55 */ 52 */ 56 struct changer_move { 53 struct changer_move { 57 int cm_fromtype; /* type/unit o 54 int cm_fromtype; /* type/unit of source element */ 58 int cm_fromunit; 55 int cm_fromunit; 59 int cm_totype; /* type/unit of destin 56 int cm_totype; /* type/unit of destination element */ 60 int cm_tounit; 57 int cm_tounit; 61 int cm_flags; 58 int cm_flags; 62 }; 59 }; 63 #define CM_INVERT 1 /* flag: rotate media 60 #define CM_INVERT 1 /* flag: rotate media (for double-sided like MOD) */ 64 61 65 62 66 /* 63 /* 67 * CHIOEXCHANGE 64 * CHIOEXCHANGE 68 * move one medium from element #1 to eleme 65 * move one medium from element #1 to element #2, 69 * and another one from element #2 to eleme 66 * and another one from element #2 to element #3. 70 * element #1 and #3 are allowed to be iden 67 * element #1 and #3 are allowed to be identical. 71 */ 68 */ 72 struct changer_exchange { 69 struct changer_exchange { 73 int ce_srctype; /* type/unit of el 70 int ce_srctype; /* type/unit of element #1 */ 74 int ce_srcunit; 71 int ce_srcunit; 75 int ce_fdsttype; /* type/unit of el 72 int ce_fdsttype; /* type/unit of element #2 */ 76 int ce_fdstunit; 73 int ce_fdstunit; 77 int ce_sdsttype; /* type/unit of el 74 int ce_sdsttype; /* type/unit of element #3 */ 78 int ce_sdstunit; 75 int ce_sdstunit; 79 int ce_flags; 76 int ce_flags; 80 }; 77 }; 81 #define CE_INVERT1 1 78 #define CE_INVERT1 1 82 #define CE_INVERT2 2 79 #define CE_INVERT2 2 83 80 84 81 85 /* 82 /* 86 * CHIOPOSITION 83 * CHIOPOSITION 87 * move the transport element (robot arm) t 84 * move the transport element (robot arm) to a specific element. 88 */ 85 */ 89 struct changer_position { 86 struct changer_position { 90 int cp_type; 87 int cp_type; 91 int cp_unit; 88 int cp_unit; 92 int cp_flags; 89 int cp_flags; 93 }; 90 }; 94 #define CP_INVERT 1 91 #define CP_INVERT 1 95 92 96 93 97 /* 94 /* 98 * CHIOGSTATUS 95 * CHIOGSTATUS 99 * get element status for all elements of a 96 * get element status for all elements of a specific type 100 */ 97 */ 101 struct changer_element_status { 98 struct changer_element_status { 102 int ces_type; 99 int ces_type; 103 unsigned char __user *ces_data; 100 unsigned char __user *ces_data; 104 }; 101 }; 105 #define CESTATUS_FULL 0x01 /* full */ 102 #define CESTATUS_FULL 0x01 /* full */ 106 #define CESTATUS_IMPEXP 0x02 /* media was i 103 #define CESTATUS_IMPEXP 0x02 /* media was imported (inserted by sysop) */ 107 #define CESTATUS_EXCEPT 0x04 /* error condi 104 #define CESTATUS_EXCEPT 0x04 /* error condition */ 108 #define CESTATUS_ACCESS 0x08 /* access allo 105 #define CESTATUS_ACCESS 0x08 /* access allowed */ 109 #define CESTATUS_EXENAB 0x10 /* element can 106 #define CESTATUS_EXENAB 0x10 /* element can export media */ 110 #define CESTATUS_INENAB 0x20 /* element can 107 #define CESTATUS_INENAB 0x20 /* element can import media */ 111 108 112 109 113 /* 110 /* 114 * CHIOGELEM 111 * CHIOGELEM 115 * get more detailed status information for 112 * get more detailed status information for a single element 116 */ 113 */ 117 struct changer_get_element { 114 struct changer_get_element { 118 int cge_type; /* type/unit 115 int cge_type; /* type/unit */ 119 int cge_unit; 116 int cge_unit; 120 int cge_status; /* status */ 117 int cge_status; /* status */ 121 int cge_errno; /* errno */ 118 int cge_errno; /* errno */ 122 int cge_srctype; /* source ele 119 int cge_srctype; /* source element of the last move/exchange */ 123 int cge_srcunit; 120 int cge_srcunit; 124 int cge_id; /* scsi id ( 121 int cge_id; /* scsi id (for data transfer elements) */ 125 int cge_lun; /* scsi lun ( 122 int cge_lun; /* scsi lun (for data transfer elements) */ 126 char cge_pvoltag[36]; /* primary vo 123 char cge_pvoltag[36]; /* primary volume tag */ 127 char cge_avoltag[36]; /* alternate 124 char cge_avoltag[36]; /* alternate volume tag */ 128 int cge_flags; 125 int cge_flags; 129 }; 126 }; 130 /* flags */ 127 /* flags */ 131 #define CGE_ERRNO 0x01 /* errno avai 128 #define CGE_ERRNO 0x01 /* errno available */ 132 #define CGE_INVERT 0x02 /* media inve 129 #define CGE_INVERT 0x02 /* media inverted */ 133 #define CGE_SRC 0x04 /* media src 130 #define CGE_SRC 0x04 /* media src available */ 134 #define CGE_IDLUN 0x08 /* ID+LUN ava 131 #define CGE_IDLUN 0x08 /* ID+LUN available */ 135 #define CGE_PVOLTAG 0x10 /* primary vo 132 #define CGE_PVOLTAG 0x10 /* primary volume tag available */ 136 #define CGE_AVOLTAG 0x20 /* alternate 133 #define CGE_AVOLTAG 0x20 /* alternate volume tag available */ 137 134 138 135 139 /* 136 /* 140 * CHIOSVOLTAG 137 * CHIOSVOLTAG 141 * set volume tag 138 * set volume tag 142 */ 139 */ 143 struct changer_set_voltag { 140 struct changer_set_voltag { 144 int csv_type; /* type/unit 141 int csv_type; /* type/unit */ 145 int csv_unit; 142 int csv_unit; 146 char csv_voltag[36]; /* volume tag 143 char csv_voltag[36]; /* volume tag */ 147 int csv_flags; 144 int csv_flags; 148 }; 145 }; 149 #define CSV_PVOLTAG 0x01 /* primary vo 146 #define CSV_PVOLTAG 0x01 /* primary volume tag */ 150 #define CSV_AVOLTAG 0x02 /* alternate 147 #define CSV_AVOLTAG 0x02 /* alternate volume tag */ 151 #define CSV_CLEARTAG 0x04 /* clear volu 148 #define CSV_CLEARTAG 0x04 /* clear volume tag */ 152 149 153 /* ioctls */ 150 /* ioctls */ 154 #define CHIOMOVE _IOW('c', 1,struct chan 151 #define CHIOMOVE _IOW('c', 1,struct changer_move) 155 #define CHIOEXCHANGE _IOW('c', 2,struct chan 152 #define CHIOEXCHANGE _IOW('c', 2,struct changer_exchange) 156 #define CHIOPOSITION _IOW('c', 3,struct chan 153 #define CHIOPOSITION _IOW('c', 3,struct changer_position) 157 #define CHIOGPICKER _IOR('c', 4,int) 154 #define CHIOGPICKER _IOR('c', 4,int) /* not impl. */ 158 #define CHIOSPICKER _IOW('c', 5,int) 155 #define CHIOSPICKER _IOW('c', 5,int) /* not impl. */ 159 #define CHIOGPARAMS _IOR('c', 6,struct chan 156 #define CHIOGPARAMS _IOR('c', 6,struct changer_params) 160 #define CHIOGSTATUS _IOW('c', 8,struct chan 157 #define CHIOGSTATUS _IOW('c', 8,struct changer_element_status) 161 #define CHIOGELEM _IOW('c',16,struct chan 158 #define CHIOGELEM _IOW('c',16,struct changer_get_element) 162 #define CHIOINITELEM _IO('c',17) 159 #define CHIOINITELEM _IO('c',17) 163 #define CHIOSVOLTAG _IOW('c',18,struct chan 160 #define CHIOSVOLTAG _IOW('c',18,struct changer_set_voltag) 164 #define CHIOGVPARAMS _IOR('c',19,struct chan 161 #define CHIOGVPARAMS _IOR('c',19,struct changer_vendor_params) 165 162 166 #endif /* _UAPI_LINUX_CHIO_H */ !! 163 /* ---------------------------------------------------------------------- */ >> 164 >> 165 /* >> 166 * Local variables: >> 167 * c-basic-offset: 8 >> 168 * End: >> 169 */ 167 170
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.