3 .\" Julian Elischer <julian@FreeBSD.org>. All rights reserved.
5 .\" Redistribution and use in source and binary forms, with or without
6 .\" modification, are permitted provided that the following conditions
8 .\" 1. Redistributions of source code must retain the above copyright
9 .\" notice, this list of conditions and the following disclaimer.
11 .\" 2. Redistributions in binary form must reproduce the above copyright
12 .\" notice, this list of conditions and the following disclaimer in the
13 .\" documentation and/or other materials provided with the distribution.
15 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
16 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
19 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32 .Nd SCSI media-changer (juke box) driver
35 .Cd device ch1 target 4 unit 0
39 driver provides support for a
42 It allows many slots of media to be multiplexed between
44 The changer device may optionally be equipped
45 with a bar code reader, which reads label information attached to
48 A SCSI adapter must also be separately configured into the system
49 before a SCSI changer can be configured.
51 As the SCSI adapter is probed during boot, the
53 bus is scanned for devices.
54 Any devices found which answer as 'Changer'
55 type devices will be 'attached' to the
60 releases prior to 2.1, the first found will be attached as
65 Beginning in 2.1 it is possible to specify what ch unit a device should
66 come on line as; refer to
68 for details on kernel configuration.
69 .Sh KERNEL CONFIGURATION
70 In configuring, if an optional
72 is given in the specification, that number of SCSI media changers
73 are configured; Most storage for them is allocated only when found
74 so a large number of configured devices is cheap.
76 has included the driver).
78 User mode programs communicate with the changer driver through a
79 number of ioctls which are described below.
80 Changer element addresses
81 used in the communication between the kernel and the changer device are
82 mapped to zero-based logical addresses.
83 Element types are specified as follows:
84 .Bl -tag -width CHET_MT
86 Medium transport element (picker).
88 Storage element (slot).
90 Import/export element (portal).
92 Data transfer element (drive).
97 calls apply to the changer.
102 .Bl -tag -width CHIOEXCHANGE
104 .Pq Vt "struct changer_move"
105 Move a medium from one element to another
107 using the current picker.
108 The source and destination elements are specified
109 in a changer_move structure, which includes at least the following
111 .Bd -literal -offset indent
112 u_int cm_fromtype; /* element type to move from */
113 u_int cm_fromunit; /* logical unit of from element */
114 u_int cm_totype; /* element type to move to */
115 u_int cm_tounit; /* logical unit of to element */
116 u_int cm_flags; /* misc. flags */
122 field is set, the medium
123 changer is instructed to flip the medium while moving it.
125 .Pq Vt "struct changer_exchange"
126 Move the medium located in the source element to the first destination
127 element, and move the medium that had been in the first destination
128 element to the second destination element.
130 exchange, the source and second destination elements should be the
132 The current picker is used to perform the operation.
133 The addresses of the affected elements is specified to the ioctl in a
135 structure which includes at least the following
137 .Bd -literal -offset indent
138 u_int ce_srctype; /* element type of source */
139 u_int ce_srcunit; /* logical unit of source */
140 u_int ce_fdsttype; /* element type of first destination */
141 u_int ce_fdstunit; /* logical unit of first destination */
142 u_int ce_sdsttype; /* element type of second destination */
143 u_int ce_sdstunit; /* logical unit of second destination */
144 u_int ce_flags; /* misc. flags */
152 to flip the first or second medium during the exchange operation,
155 .Em This operation is untested .
157 .Pq Vt "struct changer_position"
158 Position the current picker in front of the specified element.
159 The element is specified with a changer_position structure, which includes
160 at least the following elements:
161 .Bd -literal -offset indent
162 u_int cp_type; /* element type */
163 u_int cp_unit; /* logical unit of element */
164 u_int cp_flags; /* misc. flags */
170 to invert the picker during the operation.
173 Return the logical address of the current picker.
176 Select the picker specified by the given logical address.
178 .Pq Vt "struct changer_params"
179 Return the configuration parameters for the media changer.
181 fills the changer_params structure passed by the user with at least the
183 .Bd -literal -offset indent
184 u_int cp_npickers; /* number of pickers */
185 u_int cp_nslots; /* number of slots */
186 u_int cp_nportals; /* number of import/export portals */
187 u_int cp_ndrives; /* number of drives */
190 This call can be used by applications to query the dimensions of
191 the jukebox before using the
193 ioctl to query the jukebox' status.
196 .Sy INITIALIZE ELEMENT STATUS
197 call on the media changer device.
198 This forces the media changer to update its internal status
199 information with respect to loaded media.
200 It also scans any barcode labels provided that it has a label reader.
203 driver's status is not affected by this call.
205 .Pq Vt "struct changer_element_status_request"
207 .Sy READ ELEMENT STATUS
208 call on the media changer device.
209 This call reads the element status information of the media
210 changer and converts it to an array of
211 .Vt changer_element_status
216 the status of one or more elements of one type may be queried.
218 The application passes a
219 .Vt changer_element_status_request
222 driver which contains the following fields:
223 .Bd -literal -offset indent
224 u_int cesr_element_type;
225 u_int cesr_element_base;
226 u_int cesr_element_count;
228 struct changer_element_status *cesr_element_status;
231 This structure is read by the driver to determine the type, logical
232 base address and number of elements for which information is to be
233 returned in the array of
234 .Vt changer_element_status
235 structures pointed to by the
236 .Va cesr_element_status field .
237 The application must allocate enough
239 .Va cesr_element_count
240 status structures (see below).
243 can optionally be set to
245 to indicate that volume tag (bar code) information is to be read from
246 the jukebox and returned.
249 .Va cesr_element_base
251 .Va cesr_element_count
252 fields must be valid with respect to the physical configuration of the changer.
259 The information about the elements is returned in an array of
260 .Vt changer_element_status
262 This structure include at least the following fields:
263 .Bd -literal -offset indent
264 u_int ces_addr; /* element address in media changer */
265 u_char ces_flags; /* see CESTATUS definitions below */
266 u_char ces_sensecode; /* additional sense code for element */
267 u_char ces_sensequal; /* additional sense code qualifier */
268 u_char ces_invert; /* invert bit */
269 u_char ces_svalid; /* source address (ces_source) valid */
270 u_short ces_source; /* source address of medium */
271 changer_voltag_t ces_pvoltag; /* primary volume tag */
272 changer_voltag_t ces_avoltag; /* alternate volume tag */
273 u_char ces_idvalid; /* ces_scsi_id is valid */
274 u_char ces_scsi_id; /* SCSI id of element (if ces_idvalid is nonzero) */
275 u_char ces_lunvalid; /* ces_scsi_lun is valid */
276 u_char ces_scsi_lun; /* SCSI lun of element (if ces_lunvalid is nonzero) */
281 field contains the address of the element in the
282 coordinate system of the media changer.
283 It is not used by the driver,
284 and should be used for diagnostic purposes only.
286 The following flags are defined for the
289 .Bl -tag -width CESTATUS_IMPEXP
292 .It Dv CESTATUS_IMPEXP
293 The medium has been deposited by the operator (and not by a picker).
294 .It Dv CESTATUS_EXCEPT
295 The element is in an exceptional state (e.g.\& invalid barcode label,
296 barcode not yet scanned).
297 .It Dv CESTATUS_ACCESS
298 The element is accessible by the picker.
299 .It Dv CESTATUS_EXENAB
300 The element supports medium export.
301 .It Dv CESTATUS_INENAB
302 The element supports medium import.
305 Note that not all flags are valid for all element types.
310 driver has been tested with a DEC TZ875 (5 slot, one DLT drive)
311 and a Breece Hill Q47 (60 slot, four DLT drives, barcode reader).
313 Many of the features the
315 driver supports are not thoroughly tested due to the fact that the
316 devices available for testing do not support the necessary commands.
317 This is true for alternate volume tags, media flipping, import/export
318 element handling, multiple picker operation and other things.
320 .Bl -tag -width /dev/ch[0-9] -compact
325 If the media changer does not support features requested by the
327 driver, it will produce both console error messages and failure return
328 codes to the ioctls described here.
343 driver was written by
344 .An Jason R. Thorpe Aq thorpej@and.com
345 for And Communications,
346 .Pa http://www.and.com/ .
347 It was added to the system by
348 .An Stefan Grefen Aq grefen@goofy.zdv.uni-mainz.de
349 who apparently had such a device.
350 It was ported to CAM by
351 .An Kenneth Merry Aq ken@FreeBSD.org .
352 It was updated to support volume tags by
353 .An Hans Huebner Aq hans@artcom.de .