1999-08-28 00:22:10 +00:00
|
|
|
.\" $FreeBSD$
|
1996-10-18 20:22:31 +00:00
|
|
|
.\" Copyright (c) 1996
|
2000-10-26 15:30:44 +00:00
|
|
|
.\" Julian Elischer <julian@FreeBSD.org>. All rights reserved.
|
1996-10-18 20:22:31 +00:00
|
|
|
.\"
|
|
|
|
.\" Redistribution and use in source and binary forms, with or without
|
|
|
|
.\" modification, are permitted provided that the following conditions
|
|
|
|
.\" are met:
|
|
|
|
.\" 1. Redistributions of source code must retain the above copyright
|
|
|
|
.\" notice, this list of conditions and the following disclaimer.
|
|
|
|
.\"
|
|
|
|
.\" 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
.\" notice, this list of conditions and the following disclaimer in the
|
|
|
|
.\" documentation and/or other materials provided with the distribution.
|
|
|
|
.\"
|
|
|
|
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
|
|
|
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
|
|
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
|
|
.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
|
|
|
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
|
|
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
|
|
|
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
|
|
|
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
|
|
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
|
|
|
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
|
|
|
.\" SUCH DAMAGE.
|
|
|
|
.\"
|
1998-09-15 10:26:24 +00:00
|
|
|
.Dd May 14, 1998
|
1995-01-25 09:18:56 +00:00
|
|
|
.Dt CH 4
|
2001-07-10 15:31:11 +00:00
|
|
|
.Os
|
1995-01-25 09:18:56 +00:00
|
|
|
.Sh NAME
|
|
|
|
.Nm ch
|
1998-09-15 10:26:24 +00:00
|
|
|
.Nd SCSI media-changer (juke box) driver
|
1995-01-25 09:18:56 +00:00
|
|
|
.Sh SYNOPSIS
|
1997-02-05 15:07:37 +00:00
|
|
|
.Cd device ch
|
1995-01-25 09:18:56 +00:00
|
|
|
.Sh DESCRIPTION
|
|
|
|
The
|
2005-01-21 20:51:09 +00:00
|
|
|
.Nm
|
2001-07-14 19:41:16 +00:00
|
|
|
driver provides support for a
|
1998-09-15 10:26:24 +00:00
|
|
|
.Em SCSI
|
2000-03-01 14:50:24 +00:00
|
|
|
media changer.
|
|
|
|
It allows many slots of media to be multiplexed between
|
2003-06-28 23:53:39 +00:00
|
|
|
a number of drives.
|
|
|
|
The changer device may optionally be equipped
|
2002-01-21 12:09:13 +00:00
|
|
|
with a bar code reader, which reads label information attached to
|
1998-09-15 10:26:24 +00:00
|
|
|
the media.
|
1995-01-25 09:18:56 +00:00
|
|
|
.Pp
|
1998-09-15 10:26:24 +00:00
|
|
|
A SCSI adapter must also be separately configured into the system
|
|
|
|
before a SCSI changer can be configured.
|
1995-01-25 09:18:56 +00:00
|
|
|
.Pp
|
2001-07-14 19:41:16 +00:00
|
|
|
As the SCSI adapter is probed during boot, the
|
1995-01-25 09:18:56 +00:00
|
|
|
.Em SCSI
|
2000-03-01 14:50:24 +00:00
|
|
|
bus is scanned for devices.
|
|
|
|
Any devices found which answer as 'Changer'
|
2001-07-14 19:41:16 +00:00
|
|
|
type devices will be 'attached' to the
|
1995-01-25 09:18:56 +00:00
|
|
|
.Nm
|
1995-03-01 22:32:38 +00:00
|
|
|
driver.
|
2000-11-14 11:20:58 +00:00
|
|
|
In
|
|
|
|
.Fx
|
|
|
|
releases prior to 2.1, the first found will be attached as
|
1995-01-25 09:18:56 +00:00
|
|
|
.Em ch0
|
2001-07-14 19:41:16 +00:00
|
|
|
and the next,
|
1995-01-25 09:18:56 +00:00
|
|
|
.Em ch1
|
|
|
|
etc.
|
1995-03-01 22:32:38 +00:00
|
|
|
Beginning in 2.1 it is possible to specify what ch unit a device should
|
|
|
|
come on line as; refer to
|
|
|
|
.Xr scsi 4
|
|
|
|
for details on kernel configuration.
|
1995-01-25 09:18:56 +00:00
|
|
|
.Sh KERNEL CONFIGURATION
|
2009-06-01 06:52:03 +00:00
|
|
|
It is only necessary to explicitly configure one
|
|
|
|
.Nm
|
|
|
|
device; data structures are dynamically allocated as media changes are found
|
|
|
|
on the
|
|
|
|
.Tn SCSI
|
|
|
|
bus.
|
1995-01-25 09:18:56 +00:00
|
|
|
.Sh IOCTLS
|
1998-09-15 10:26:24 +00:00
|
|
|
User mode programs communicate with the changer driver through a
|
2003-06-28 23:53:39 +00:00
|
|
|
number of ioctls which are described below.
|
|
|
|
Changer element addresses
|
2002-01-21 12:09:13 +00:00
|
|
|
used in the communication between the kernel and the changer device are
|
2003-06-28 23:53:39 +00:00
|
|
|
mapped to zero-based logical addresses.
|
|
|
|
Element types are specified as follows:
|
1998-09-15 10:26:24 +00:00
|
|
|
.Bl -tag -width CHET_MT
|
|
|
|
.It Dv CHET_MT
|
|
|
|
Medium transport element (picker).
|
|
|
|
.It Dv CHET_ST
|
|
|
|
Storage element (slot).
|
|
|
|
.It Dv CHET_IE
|
|
|
|
Import/export element (portal).
|
|
|
|
.It Dv CHET_DT
|
|
|
|
Data transfer element (drive).
|
|
|
|
.El
|
|
|
|
.Pp
|
2001-07-14 19:41:16 +00:00
|
|
|
The following
|
1995-01-25 09:18:56 +00:00
|
|
|
.Xr ioctl 2
|
2000-03-01 14:50:24 +00:00
|
|
|
calls apply to the changer.
|
|
|
|
They are defined
|
1995-01-25 09:18:56 +00:00
|
|
|
in the header file
|
2003-09-08 19:57:22 +00:00
|
|
|
.In sys/chio.h .
|
1998-09-15 10:26:24 +00:00
|
|
|
.Pp
|
|
|
|
.Bl -tag -width CHIOEXCHANGE
|
|
|
|
.It Dv CHIOMOVE
|
2003-06-28 23:53:39 +00:00
|
|
|
.Pq Vt "struct changer_move"
|
|
|
|
Move a medium from one element to another
|
|
|
|
.Pq Sy "MOVE MEDIUM"
|
|
|
|
using the current picker.
|
|
|
|
The source and destination elements are specified
|
1998-09-15 10:26:24 +00:00
|
|
|
in a changer_move structure, which includes at least the following
|
|
|
|
fields:
|
|
|
|
.Bd -literal -offset indent
|
|
|
|
u_int cm_fromtype; /* element type to move from */
|
|
|
|
u_int cm_fromunit; /* logical unit of from element */
|
|
|
|
u_int cm_totype; /* element type to move to */
|
|
|
|
u_int cm_tounit; /* logical unit of to element */
|
|
|
|
u_int cm_flags; /* misc. flags */
|
|
|
|
.Ed
|
2003-06-28 23:53:39 +00:00
|
|
|
If the
|
|
|
|
.Dv CM_INVERT
|
|
|
|
in the
|
|
|
|
.Va cm_flags
|
|
|
|
field is set, the medium
|
1998-09-15 10:26:24 +00:00
|
|
|
changer is instructed to flip the medium while moving it.
|
|
|
|
.It Dv CHIOEXCHANGE
|
2003-06-28 23:53:39 +00:00
|
|
|
.Pq Vt "struct changer_exchange"
|
1998-09-15 10:26:24 +00:00
|
|
|
Move the medium located in the source element to the first destination
|
|
|
|
element, and move the medium that had been in the first destination
|
2003-06-28 23:53:39 +00:00
|
|
|
element to the second destination element.
|
|
|
|
In case of a simple
|
1998-09-15 10:26:24 +00:00
|
|
|
exchange, the source and second destination elements should be the
|
2003-06-28 23:53:39 +00:00
|
|
|
same.
|
|
|
|
The current picker is used to perform the operation.
|
|
|
|
The addresses of the affected elements is specified to the ioctl in a
|
|
|
|
.Vt changer_exchange
|
|
|
|
structure which includes at least the following
|
1998-09-15 10:26:24 +00:00
|
|
|
fields:
|
|
|
|
.Bd -literal -offset indent
|
|
|
|
u_int ce_srctype; /* element type of source */
|
|
|
|
u_int ce_srcunit; /* logical unit of source */
|
|
|
|
u_int ce_fdsttype; /* element type of first destination */
|
|
|
|
u_int ce_fdstunit; /* logical unit of first destination */
|
|
|
|
u_int ce_sdsttype; /* element type of second destination */
|
|
|
|
u_int ce_sdstunit; /* logical unit of second destination */
|
|
|
|
u_int ce_flags; /* misc. flags */
|
|
|
|
.Ed
|
2003-06-28 23:53:39 +00:00
|
|
|
In
|
|
|
|
.Va ce_flags ,
|
|
|
|
.Dv CM_INVERT1
|
|
|
|
and/or
|
|
|
|
.Dv CM_INVERT2
|
|
|
|
may be set
|
1998-09-15 10:26:24 +00:00
|
|
|
to flip the first or second medium during the exchange operation,
|
|
|
|
respectively.
|
|
|
|
.Pp
|
2003-06-28 23:53:39 +00:00
|
|
|
.Em This operation is untested .
|
1998-09-15 10:26:24 +00:00
|
|
|
.It Dv CHIOPOSITION
|
2003-06-28 23:53:39 +00:00
|
|
|
.Pq Vt "struct changer_position"
|
|
|
|
Position the current picker in front of the specified element.
|
|
|
|
The element is specified with a changer_position structure, which includes
|
1998-09-15 10:26:24 +00:00
|
|
|
at least the following elements:
|
|
|
|
.Bd -literal -offset indent
|
|
|
|
u_int cp_type; /* element type */
|
|
|
|
u_int cp_unit; /* logical unit of element */
|
|
|
|
u_int cp_flags; /* misc. flags */
|
|
|
|
.Ed
|
2003-06-28 23:53:39 +00:00
|
|
|
The
|
|
|
|
.Va cp_flags
|
|
|
|
field may be set to
|
|
|
|
.Dv CP_INVERT
|
|
|
|
to invert the picker during the operation.
|
1998-09-15 10:26:24 +00:00
|
|
|
.It Dv CHIOGPICKER
|
2003-06-28 23:53:39 +00:00
|
|
|
.Pq Vt int
|
1998-09-15 10:26:24 +00:00
|
|
|
Return the logical address of the current picker.
|
|
|
|
.It Dv CHIOSPICKER
|
2003-06-28 23:53:39 +00:00
|
|
|
.Pq Vt int
|
1998-09-15 10:26:24 +00:00
|
|
|
Select the picker specified by the given logical address.
|
|
|
|
.It Dv CHIOGPARAMS
|
2003-06-28 23:53:39 +00:00
|
|
|
.Pq Vt "struct changer_params"
|
|
|
|
Return the configuration parameters for the media changer.
|
|
|
|
This ioctl
|
1998-09-15 10:26:24 +00:00
|
|
|
fills the changer_params structure passed by the user with at least the
|
|
|
|
following fields:
|
|
|
|
.Bd -literal -offset indent
|
|
|
|
u_int cp_npickers; /* number of pickers */
|
|
|
|
u_int cp_nslots; /* number of slots */
|
|
|
|
u_int cp_nportals; /* number of import/export portals */
|
|
|
|
u_int cp_ndrives; /* number of drives */
|
|
|
|
.Ed
|
2000-11-14 11:20:58 +00:00
|
|
|
.Pp
|
1998-09-15 10:26:24 +00:00
|
|
|
This call can be used by applications to query the dimensions of
|
2003-06-28 23:53:39 +00:00
|
|
|
the jukebox before using the
|
|
|
|
.Dv CHIGSTATUS
|
1998-09-15 10:26:24 +00:00
|
|
|
ioctl to query the jukebox' status.
|
|
|
|
.It Dv CHIOIELEM
|
2003-06-28 23:53:39 +00:00
|
|
|
Perform the
|
|
|
|
.Sy INITIALIZE ELEMENT STATUS
|
|
|
|
call on the media changer device.
|
|
|
|
This forces the media changer to update its internal status
|
|
|
|
information with respect to loaded media.
|
|
|
|
It also scans any barcode labels provided that it has a label reader.
|
|
|
|
The
|
1998-09-15 10:26:24 +00:00
|
|
|
.Nm
|
|
|
|
driver's status is not affected by this call.
|
|
|
|
.It Dv CHIOGSTATUS
|
2003-06-28 23:53:39 +00:00
|
|
|
.Pq Vt "struct changer_element_status_request"
|
|
|
|
Perform the
|
|
|
|
.Sy READ ELEMENT STATUS
|
|
|
|
call on the media changer device.
|
|
|
|
This call reads the element status information of the media
|
|
|
|
changer and converts it to an array of
|
|
|
|
.Vt changer_element_status
|
1998-09-15 10:26:24 +00:00
|
|
|
structures.
|
|
|
|
.Pp
|
|
|
|
With each call to
|
2001-08-10 17:35:21 +00:00
|
|
|
.Dv CHIOGSTATUS ,
|
|
|
|
the status of one or more elements of one type may be queried.
|
1998-09-15 10:26:24 +00:00
|
|
|
.Pp
|
2003-06-28 23:53:39 +00:00
|
|
|
The application passes a
|
|
|
|
.Vt changer_element_status_request
|
|
|
|
structure to the
|
1998-09-15 10:26:24 +00:00
|
|
|
.Nm
|
|
|
|
driver which contains the following fields:
|
|
|
|
.Bd -literal -offset indent
|
|
|
|
u_int cesr_element_type;
|
2001-07-14 19:41:16 +00:00
|
|
|
u_int cesr_element_base;
|
1998-09-15 10:26:24 +00:00
|
|
|
u_int cesr_element_count;
|
|
|
|
u_int cesr_flags;
|
|
|
|
struct changer_element_status *cesr_element_status;
|
|
|
|
.Ed
|
2000-11-14 11:20:58 +00:00
|
|
|
.Pp
|
1998-09-15 10:26:24 +00:00
|
|
|
This structure is read by the driver to determine the type, logical
|
|
|
|
base address and number of elements for which information is to be
|
2003-06-28 23:53:39 +00:00
|
|
|
returned in the array of
|
|
|
|
.Vt changer_element_status
|
|
|
|
structures pointed to by the
|
|
|
|
.Va cesr_element_status field .
|
|
|
|
The application must allocate enough
|
|
|
|
memory for
|
|
|
|
.Va cesr_element_count
|
|
|
|
status structures (see below).
|
|
|
|
The
|
|
|
|
.Va cesr_flags
|
|
|
|
can optionally be set to
|
1998-09-15 10:26:24 +00:00
|
|
|
.Dv CESR_VOLTAGS
|
|
|
|
to indicate that volume tag (bar code) information is to be read from
|
|
|
|
the jukebox and returned.
|
|
|
|
.Pp
|
2003-06-28 23:53:39 +00:00
|
|
|
The
|
|
|
|
.Va cesr_element_base
|
|
|
|
and
|
|
|
|
.Va cesr_element_count
|
|
|
|
fields must be valid with respect to the physical configuration of the changer.
|
|
|
|
If they are not, the
|
1998-09-15 10:26:24 +00:00
|
|
|
.Dv CHIOGSTATUS
|
|
|
|
ioctl returns the
|
|
|
|
.Er EINVAL
|
|
|
|
error code.
|
|
|
|
.Pp
|
|
|
|
The information about the elements is returned in an array of
|
2003-06-28 23:53:39 +00:00
|
|
|
.Vt changer_element_status
|
|
|
|
structures.
|
|
|
|
This structure include at least the following fields:
|
1998-09-15 10:26:24 +00:00
|
|
|
.Bd -literal -offset indent
|
|
|
|
u_int ces_addr; /* element address in media changer */
|
|
|
|
u_char ces_flags; /* see CESTATUS definitions below */
|
|
|
|
u_char ces_sensecode; /* additional sense code for element */
|
|
|
|
u_char ces_sensequal; /* additional sense code qualifier */
|
|
|
|
u_char ces_invert; /* invert bit */
|
|
|
|
u_char ces_svalid; /* source address (ces_source) valid */
|
|
|
|
u_short ces_source; /* source address of medium */
|
|
|
|
changer_voltag_t ces_pvoltag; /* primary volume tag */
|
|
|
|
changer_voltag_t ces_avoltag; /* alternate volume tag */
|
|
|
|
u_char ces_idvalid; /* ces_scsi_id is valid */
|
|
|
|
u_char ces_scsi_id; /* SCSI id of element (if ces_idvalid is nonzero) */
|
|
|
|
u_char ces_lunvalid; /* ces_scsi_lun is valid */
|
2002-01-21 12:09:13 +00:00
|
|
|
u_char ces_scsi_lun; /* SCSI lun of element (if ces_lunvalid is nonzero) */
|
1998-09-15 10:26:24 +00:00
|
|
|
.Ed
|
2000-11-14 11:20:58 +00:00
|
|
|
.Pp
|
2003-06-28 23:53:39 +00:00
|
|
|
The
|
|
|
|
.Va ces_addr
|
|
|
|
field contains the address of the element in the
|
|
|
|
coordinate system of the media changer.
|
|
|
|
It is not used by the driver,
|
1998-09-15 10:26:24 +00:00
|
|
|
and should be used for diagnostic purposes only.
|
|
|
|
.Pp
|
2003-06-28 23:53:39 +00:00
|
|
|
The following flags are defined for the
|
|
|
|
.Va ces_flags
|
|
|
|
field:
|
1998-09-15 10:26:24 +00:00
|
|
|
.Bl -tag -width CESTATUS_IMPEXP
|
|
|
|
.It Dv CESTATUS_FULL
|
|
|
|
A medium is present.
|
|
|
|
.It Dv CESTATUS_IMPEXP
|
|
|
|
The medium has been deposited by the operator (and not by a picker).
|
|
|
|
.It Dv CESTATUS_EXCEPT
|
2004-07-03 18:29:24 +00:00
|
|
|
The element is in an exceptional state (e.g.\& invalid barcode label,
|
1998-09-15 10:26:24 +00:00
|
|
|
barcode not yet scanned).
|
|
|
|
.It Dv CESTATUS_ACCESS
|
|
|
|
The element is accessible by the picker.
|
|
|
|
.It Dv CESTATUS_EXENAB
|
|
|
|
The element supports medium export.
|
|
|
|
.It Dv CESTATUS_INENAB
|
|
|
|
The element supports medium import.
|
|
|
|
.El
|
|
|
|
.Pp
|
|
|
|
Note that not all flags are valid for all element types.
|
1995-01-25 09:18:56 +00:00
|
|
|
.El
|
|
|
|
.Sh NOTES
|
2001-07-14 19:41:16 +00:00
|
|
|
This version of the
|
1995-01-25 09:18:56 +00:00
|
|
|
.Nm
|
2004-05-10 20:12:02 +00:00
|
|
|
driver has been tested with a DEC TZ875 (5 slot, one DLT drive)
|
1998-09-15 10:26:24 +00:00
|
|
|
and a Breece Hill Q47 (60 slot, four DLT drives, barcode reader).
|
|
|
|
.Pp
|
|
|
|
Many of the features the
|
|
|
|
.Nm
|
2004-05-10 20:12:02 +00:00
|
|
|
driver supports are not thoroughly tested due to the fact that the
|
1998-09-15 10:26:24 +00:00
|
|
|
devices available for testing do not support the necessary commands.
|
|
|
|
This is true for alternate volume tags, media flipping, import/export
|
|
|
|
element handling, multiple picker operation and other things.
|
1995-01-25 09:18:56 +00:00
|
|
|
.Sh FILES
|
|
|
|
.Bl -tag -width /dev/ch[0-9] -compact
|
|
|
|
.It Pa /dev/ch[0-9]
|
|
|
|
device entries
|
|
|
|
.El
|
|
|
|
.Sh DIAGNOSTICS
|
1998-09-15 10:26:24 +00:00
|
|
|
If the media changer does not support features requested by the
|
|
|
|
.Nm
|
|
|
|
driver, it will produce both console error messages and failure return
|
|
|
|
codes to the ioctls described here.
|
1995-01-25 09:18:56 +00:00
|
|
|
.Sh SEE ALSO
|
1997-06-02 21:01:00 +00:00
|
|
|
.Xr chio 1 ,
|
1996-12-26 16:16:37 +00:00
|
|
|
.Xr cd 4 ,
|
2000-07-12 15:19:39 +00:00
|
|
|
.Xr da 4 ,
|
|
|
|
.Xr sa 4
|
1995-01-25 09:18:56 +00:00
|
|
|
.Sh HISTORY
|
|
|
|
The
|
|
|
|
.Nm
|
2001-08-14 10:01:54 +00:00
|
|
|
driver appeared in
|
|
|
|
.Bx 386 0.1 .
|
2005-01-21 08:36:40 +00:00
|
|
|
.Sh AUTHORS
|
|
|
|
.An -nosplit
|
|
|
|
The
|
|
|
|
.Nm
|
|
|
|
driver was written by
|
|
|
|
.An Jason R. Thorpe Aq thorpej@and.com
|
|
|
|
for And Communications,
|
|
|
|
.Pa http://www.and.com/ .
|
|
|
|
It was added to the system by
|
|
|
|
.An Stefan Grefen Aq grefen@goofy.zdv.uni-mainz.de
|
|
|
|
who apparently had such a device.
|
|
|
|
It was ported to CAM by
|
|
|
|
.An Kenneth Merry Aq ken@FreeBSD.org .
|
|
|
|
It was updated to support volume tags by
|
|
|
|
.An Hans Huebner Aq hans@artcom.de .
|