From owner-man-jp-reviewer@jp.freebsd.org  Sun Aug 15 19:47:50 1999
Received: (from daemon@localhost)
	by castle.jp.freebsd.org (8.9.3+3.2W/8.7.3) id TAA21037;
	Sun, 15 Aug 1999 19:47:50 +0900 (JST)
	(envelope-from owner-man-jp-reviewer@jp.FreeBSD.org)
Received: from mail.nk.rim.or.jp (root@mail.nk.rim.or.jp [202.247.130.165])
	by castle.jp.freebsd.org (8.9.3+3.2W/8.7.3) with ESMTP id TAA21032
	for <man-jp-reviewer@jp.freebsd.org>; Sun, 15 Aug 1999 19:47:49 +0900 (JST)
	(envelope-from kuma@nk.rim.or.jp)
Received: from laurel.nk.rim.or.jp (JYOcc-02p33.ppp.odn.ad.jp [143.90.98.102])
	by mail.nk.rim.or.jp (8.8.8/3.6W-RIMNET-98-06-09) with ESMTP id TAA02982
	for <man-jp-reviewer@jp.freebsd.org>; Sun, 15 Aug 1999 19:47:44 +0900 (JST)
Received: from oasis.laurel.nk.rim.or.jp by laurel.nk.rim.or.jp (8.9.3/8.9.2oasis990320) with ESMTP id TAA00407
	for <man-jp-reviewer@jp.freebsd.org>; Sun, 15 Aug 1999 19:50:36 +0900 (JST)
Message-Id: <199908151050.TAA00407@laurel.nk.rim.or.jp>
To: man-jp-reviewer@jp.freebsd.org
Date: Sun, 15 Aug 1999 19:50:36 +0900
From: Norihiro Kumagai <kuma@nk.rim.or.jp>
Reply-To: man-jp-reviewer@jp.freebsd.org
Precedence: list
X-Distribute: distribute version 2.1 (Alpha) patchlevel 24e+990727
X-Sequence: man-jp-reviewer 1485
Subject: [man-jp-reviewer 1485] ch.4
Errors-To: owner-man-jp-reviewer@jp.freebsd.org
Sender: owner-man-jp-reviewer@jp.freebsd.org
X-Originator: kuma@nk.rim.or.jp

$B7'C+$G$9!#(B

ch.4 $B$N=iLu$G$9!#(B

.\"X Most storage for them is allocated only when found
.\"X so a large number of configured devices is cheap. (once the first
.\"X has included the driver).
$B%I%i%$%P$N5-21NN0h$N$[$H$s$I$O!"%G%P%$%9$,8+$D$+$C$?;~$K$N$_(B
$B3d$jEv$F$i$l$k$N$G!"$?$/$5$s$N%G%P%$%9$r@_Dj$7$F$b(B
$B9b$/$O$D$-$^$;$s(B ($B$R$H$?$S:G=i$N%G%P%$%9$,%I%i%$%P$rAH$_9~$s$@>l9g(B)$B!#(B

$B$3$3$N$H$3$m$,$I$&$bNI$/$o$+$i$J$$!#(B

--
$B7'C+(B $BE5Bg(B

============================================================
.\"	$Id: ch.4,v 1.12 1998/09/15 10:26:24 gibbs Exp $
.\" jpman %Id: ch.4,v 0.0 1999/02/22 16:13:17 horikawa Stab %
.\" Copyright (c) 1996
.\"	Julian Elischer <julian@freebsd.org>.  All rights reserved.
.\"
.\" 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.
.\"
.Dd May 14, 1998
.Dt CH 4
.Os FreeBSD
.Sh $BL>>N(B
.Nm ch
.Nd SCSI $B%a%G%#%"%A%'%s%8%c(B ($B%8%e!<%/%\%C%/%9(B) $B%I%i%$%P(B
.Sh $B=q<0(B
.Cd device ch
.Cd device ch1 target 4 lun 0
.Sh $B2r@b(B
.\"X The
.Xr ch
.\"X driver provides support for a 
$B%I%i%$%P$O!"(B
.Em SCSI
.\"X media changer. It allows many slots of media to be multiplexed between
.\"X a number of drives.  The changer device may optionally be equipped
.\"X with a bar code reader, which reads label informationen attached to
.\"X the media.
$B%a%G%#%"%A%'%s%8%c$r%5%]!<%H$7$^$9!#$3$N%I%i%$%P$O!"B?$/$N%9%m%C%H$K(B
$BB8:_$9$k%a%G%#%"$rJ#?t$N%I%i%$%V$N4V$GB?=E2=$7$FMxMQ$G$-$k$h$&$K$7$^$9!#(B
$B%A%'%s%8%c%G%P%$%9$K$O!"%*%W%7%g%s$H$7$F%P!<%3!<%I%j!<%@$rHw$(IU$1$k$3$H(B
$B$b$G$-$^$9!#$3$N%j!<%@$r;H$$!"%a%G%#%"$KIU?o$9$k>pJs$rFI$_9~$_$^$9!#(B
.Pp
.\"X A SCSI adapter must also be separately configured into the system
.\"X before a SCSI changer can be configured.
SCSI $B%A%'%s%8%c$r%7%9%F%`$KAH$_9~$`A0$K!"(BSCSI $B%"%@%W%?$rJLESAH$_9~$s$G(B
$B$*$/I,MW$,$"$j$^$9!#(B
.Pp
.\"X As the SCSI adapter is probed during boot, the 
$B%V!<%H;~$K(B SCSI $B%"%@%W%?$r%W%m!<%V$7$F$$$k$H$-$K!"(B
.Em SCSI
.\"X bus is scanned for devices. Any devices found which answer as 'Changer'
.\"X type devices will be 'attached' to the 
$B%P%9$rAv::$7%G%P%$%9$rC5$7$^$9!#(B`Changer' $B%?%$%W$G$"$k$H1~Ez$9$k%G%P%$%9$,(B
$B8+$D$+$k$H!"$=$l$i$O(B
.Nm
.\"X driver.
$B%I%i%$%P$K!V%"%?%C%A!W$5$l$^$9!#(B
.\"X In FreeBSD releases prior to 2.1, the first found will be attached as
2.1 $B$h$jA0$N%j%j!<%9$N(B FreeBSD $B$G$O!":G=i$K8+$D$+$C$?%G%P%$%9$,(B
.Em ch0
$B$K%"%?%C%A$5$l!"0J8e8+$D$+$C$?%G%P%$%9$O=g<!!"(B
.\"X and the next, 
.Em ch1
$B$J$I$K%"%?%C%A$5$l$^$9!#(B
.\"X etc.
.\"X Beginning in 2.1 it is possible to specify what ch unit a device should
.\"X come on line as; refer to
2.1 $B$+$i!"$"$k%G%P%$%9$,$I$N(B ch $B%f%K%C%H$H$7$F@\B3$9$Y$-$+$r;XDj$9$k$3$H$,(B
$B$G$-$k$h$&$K$J$j$^$7$?!#$3$N$?$a$N%+!<%M%k@_Dj$K$D$$$F$O!"(B
.Xr scsi 4
.\"X for details on kernel configuration.
$B$r;2>H$7$F2<$5$$!#(B
.Pp
.\"X 
.Sh $B%+!<%M%k@_Dj(B
.\"X In configuring, if an optional
$B@_Dj$N:]$K!"%*%W%7%g%s$H$7$F(B
.Ar count
.\"X is given in the specification, that number of SCSI media changers
.\"X are configured; Most storage for them is allocated only when found
.\"X so a large number of configured devices is cheap. (once the first
.\"X has included the driver).
$B$G;XDj$7$?>l9g!"$=$N?t$@$1$N(B SCSI $B%a%G%#%"%A%'%s%8%c$,@_Dj$5$l$^$9!#(B
$B%I%i%$%P$N5-21NN0h$N$[$H$s$I$O!"%G%P%$%9$,8+$D$+$C$?;~$K$N$_(B
$B3d$jEv$F$i$l$k$N$G!"$?$/$5$s$N%G%P%$%9$r@_Dj$7$F$b(B
$B9b$/$O$D$-$^$;$s(B ($B$R$H$?$S:G=i$N%G%P%$%9$,%I%i%$%P$rAH$_9~$s$@>l9g(B)$B!#(B
.\"X 
.Pp
.Sh IOCTL
.\"X User mode programs communicate with the changer driver through a
.\"X number of ioctls which are described below.  Changer element addresses
.\"X used in the communcation between the kernel and the changer device are
.\"X mapped to zero-based logical addresses.  Element types are specified
.\"X as follows:
$B%f!<%6%b!<%I%W%m%0%i%`$O!"<!$K<($9(B ioctl $B$r;H$C$F%A%'%s%8%c%I%i%$%P$H(B
$B%G!<%?$N$d$j$H$j$r9T$J$$$^$9!#%+!<%M%k$H%A%'%s%8%c%G%P%$%9$H$N4V$N(B
$B%G!<%?$N$d$j$H$j$G;HMQ$5$l$k!"%A%'%s%8%c%(%l%a%s%H$N%"%I%l%9$O!"(B
$B%<%m$+$i;O$^$kO@M}%"%I%l%9$K3d$jEv$F$i$l$^$9!#%(%l%a%s%H$N%?%$%W$O(B
$B<!$N$h$&$K;XDj$7$^$9!#(B
.Bl -tag -width CHET_MT
.It Dv CHET_MT
.\"X Medium transport element (picker).
$B%a%G%#%"0\F0%(%l%a%s%H(B ($B%T%C%+(B)
.It Dv CHET_ST
.\"X Storage element (slot).
$B%9%H%l!<%8%(%l%a%s%H(B ($B%9%m%C%H(B)
.It Dv CHET_IE
.\"X Import/export element (portal).
$B;}$A9~$_(B/$B;}$A=P$7%(%l%a%s%H(B ($B%]!<%?%k(B)
.It Dv CHET_DT
.\"X Data transfer element (drive).
$B%G!<%?E>Aw%(%l%a%s%H(B ($B%I%i%$%V(B)
.El
.Pp
.\"X The following 
$B<!$K<($9(B
.Xr ioctl 2
.\"X calls apply to the changer. They are defined in
.\"X in the header file
$B8F$S=P$7$,%A%'%s%8%c$KE,MQ$5$l$^$9!#$3$l$i$O%X%C%@%U%!%$%k(B
.Aq Pa sys/chio.h
$B$GDj5A$5$l$^$9!#(B
.Pp
.Bl -tag -width CHIOEXCHANGE
.It Dv CHIOMOVE
.Pq Li "struct changer_move"
.\"X Move a medium from one element to another (\fBMOVE MEDIUM\fR) using
.\"X the current picker.  The source and destination elements are specified
.\"X in a changer_move structure, which includes at least the following
.\"X fields:
$B$3$l$O!"8=:_$N%T%C%+$rMQ$$$F!"%a%G%#%"$r$"$k%(%l%a%s%H$+$iJL$N(B
$B%(%l%a%s%H$K0\F0$5$;$^$9(B (\fBMOVE MEDIUM\fR)$B!#0\F085$H0\F0@h$N(B
$B%(%l%a%s%H$O!"(Bchanger_move $B9=B$BN$NCf$G;XDj$7$^$9!#$3$N9=B$BN$O!"(B
$B>/$J$/$H$b<!$K<($9%U%#!<%k%I$r;}$A$^$9!#(B
.Bd -literal -offset indent
u_int cm_fromtype; /* $B0\F085%(%l%a%s%H$N%?%$%W(B */
u_int cm_fromunit; /* $B0\F085%(%l%a%s%H$NO@M}%f%K%C%H(B */
u_int cm_totype;   /* $B0\F0@h%(%l%a%s%H$N%?%$%W(B */
u_int cm_tounit;   /* $B0\F0@h%(%l%a%s%H$NO@M}%f%K%C%H(B */
u_int cm_flags;	   /* $B$=$NB>%U%i%0(B */

.Ed
.\"X If the \fBCM_INVERT\fR in the \fBcm_flags\fR field is set, the medium
.\"X changer is instructed to flip the medium while moving it.
\fBcm_flags\fR $B%U%#!<%k%I$N(B \fBCM_INVERT\fR $B$,@_Dj$5$l$F$$$k>l9g!"(B
$B%a%G%#%"%A%'%s%8%c$O0\F0Cf$K%a%G%#%"$rH?E>$5$;$k$h$&$K;X<($5$l$^$9!#(B
.It Dv CHIOEXCHANGE
.Pq Li "struct changer_exchange"
.\"X Move the medium located in the source element to the first destination
.\"X element, and move the medium that had been in the first destination
.\"X element to the second destination element.  In case of a simple
.\"X exchange, the source and second destination elements should be the
.\"X same.  The current picker is used to perform the operation.  The
.\"X addresses of the affected elements is specified to the ioctl in a
.\"X changer_exchange structure which includes at least the following
.\"X fields:
$B$3$l$O!"0\F085%(%l%a%s%H$K$"$k%a%G%#%"$r:G=i$N0\F0@h%(%l%a%s%H$K0\F0$5$;!"(B
$B:G=i$N0\F0@h%(%l%a%s%H$K$"$C$?%a%G%#%"$r(B 2 $BHVL\$N0\F0@h%(%l%a%s%H$K(B
$B0\F0$5$;$^$9!#C1=c$J8r49$N>l9g!"0\F085$H(B 2 $BHVL\$N0\F0@h$H$OF1$8$G$"$k(B
$BI,MW$,$"$j$^$9!#$3$NA`:n$N?k9T$K:]$78=:_$N%T%C%+$,MQ$$$i$l$^$9!#1F6A$r(B
$B<u$1$k%(%l%a%s%H$N%"%I%l%9$O!"(Bchanger_exchange $B9=B$BN$K4^$a$F(B
ioctl $B$KBP$7$F;XDj$7$^$9!#$3$N9=B$BN$O>/$J$/$H$b<!$NMWAG$r;}$A$^$9!#(B
.Bd -literal -offset indent
u_int ce_srctype;	 /* $B0\F085%(%l%a%s%H$N%?%$%W(B */
u_int ce_srcunit;	 /* $B0\F085$NO@M}%f%K%C%H(B */
u_int ce_fdsttype; /* $B:G=i$N0\F0@h%(%l%a%s%H$N%?%$%W(B */
u_int ce_fdstunit; /* $B:G=i$N0\F0@h$NO@M}%f%K%C%H(B */
u_int ce_sdsttype; /* 2$BHVL\$N0\F0@h%(%l%a%s%H$N%?%$%W(B */
u_int ce_sdstunit; /* 2$BHVL\$N0\F0@h$NO@M}%f%K%C%H(B */
u_int ce_flags;	 /* $B$=$NB>%U%i%0(B */

.Ed
.\"X In \fBce_flags\fR, \fBCM_INVERT1\fR and/or \fBCM_INVERT2\fR may be set
.\"X to flip the first or second medium during the exchange operation,
.\"X respectively.
\fBce_flags\fR $B$NCf$G!"(B\fBCM_INVERT1\fR $B$d(B \fBCM_INVERT2\fR $B$r@_Dj$9$k(B
$B$3$H$,$G$-!"$3$l$i$O$=$l$>$l!":G=i$N%a%G%#%"$d(B2$BHVL\$N%a%G%#%"$r0\F0Cf$K(B
$BH?E>$5$;$^$9!#(B
.Pp
.\"X \fIThis operation is untested.\fR
\fI$B$3$N5!G=$O%F%9%H$7$F$$$^$;$s!#(B\fR
.It Dv CHIOPOSITION
.Pq Li "struct changer_position"
.\"X Position the current picker in front of the specified element.  The
.\"X element is specified with a changer_position structure, which includes
.\"X at least the following elements:
$B$3$l$O!"8=:_$N%T%C%+$r0\F0$5$;;XDj$7$?%(%l%a%s%H$NA0$KCV$-$^$9!#(B
$B%(%l%a%s%H$O(B changer_position $B9=B$BN$G;XDj$7$^$9!#$3$l$O>/$J$/$H$b(B
$B<!$NMWAG$r;}$A$^$9!#(B
.Bd -literal -offset indent
u_int cp_type;  /* $B%(%l%a%s%H$N%?%$%W(B */
u_int cp_unit;  /* $B%(%l%a%s%H$NO@M}%f%K%C%H(B */
u_int cp_flags; /* $B$=$NB>%U%i%0(B */

.Ed
.\"X The \fBcp_flags\fR field may be set to \fBCP_INVERT\fR to invert the
.\"X picker during the operation.
\fBcp_flags\fR $B%U%#!<%k%I$G(B \fBCP_INVERT\fR $B$r@_Dj$9$k$3$H$,$G$-!"$3$l$O(B
$B0\F0Cf$K%T%C%+$rH?E>$5$;$^$9!#(B
.It Dv CHIOGPICKER
.Pq Li "int"
.\"X Return the logical address of the current picker.
$B$3$l$O!"8=:_$N%T%C%+$NO@M}%"%I%l%9$rJV$7$^$9!#(B
.It Dv CHIOSPICKER
.Pq Li "int"
.\"X Select the picker specified by the given logical address.
$B$3$l$O!"M?$($?O@M}%"%I%l%9$,;X$9%T%C%+$rA*Br$7$^$9!#(B
.It Dv CHIOGPARAMS
.Pq Li "struct changer_params"
.\"X Return the configuration parameters for the media changer.  This ioctl
.\"X fills the changer_params structure passed by the user with at least the
.\"X following fields:
$B$3$l$O!"%a%G%#%"%A%'%s%8%c$N@_Dj%Q%i%a!<%?$rJV$7$^$9!#$3$N(B ioctl $B$O!"(B
$B%f!<%6$,EO$7$?(B changer_params $B9=B$BN$N!"(B
$B>/$J$/$H$b0J2<$N%U%#!<%k%I$rKd$a$^$9!#(B
.Bd -literal -offset indent
u_int cp_npickers; /* $B%T%C%+$N?t(B */
u_int cp_nslots;   /* $B%9%m%C%H$N?t(B */
u_int cp_nportals; /* $B;}$A9~$_(B/$B;}$A=P$7%]!<%?%k$N?t(B */
u_int cp_ndrives;  /* $B%I%i%$%V$N?t(B */

.Ed
.\"X This call can be used by applications to query the dimensions of
.\"X the jukebox before using the \fBCHIGSTATUS\fR
.\"X ioctl to query the jukebox' status.
$B%"%W%j%1!<%7%g%s$,(B \fBCHIGSTATUS\fR ioctl $B$rMQ$$$F%8%e!<%/%\%C%/%9$N(B
$B>uBV$rD4$Y$k$K@h$@$C$F!"%8%e!<%/%\%C%/%9$N=t85$rLd$$9g$o$;$k:]$K!"$3$N(B
$B8F$S=P$7$r;HMQ$9$k$3$H$,$G$-$^$9!#(B
.It Dv CHIOIELEM
.\"X Perform the \fBINITIALIZE ELEMENT STATUS\fR call on the media changer
.\"X device.  This forces the media changer to update it's internal status
.\"X information with respect to loaded media.  It also scans any barcode
.\"X labels provided that it has a label reader.  The 
$B$3$l$O!"%a%G%#%"%A%'%s%8%c%G%P%$%9$KBP$7!"(B\fBINITIALIZE ELEMENT STATUS\fR
$B8F$S=P$7$r9T$J$$$^$9!#$3$l$K$h$j!"%a%G%#%"%A%'%s%8%c$O!"%m!<%I$7$F$$$k(B
$B%a%G%#%"$K4X$9$kFbIt>uBV>pJs$r99?7$5$;$i$l$^$9!#%A%'%s%8%c$,%i%Y%k%j!<%@$r(B
$B;}$D>l9g!"%P!<%3!<%I%i%Y%k$NAv::$b$"$o$;$F9T$J$$$^$9!#$3$N8F$S=P$7$G$O!"(B
.Nm
.\"X driver's status is not affected by this call.
$B%I%i%$%P$N>uBV$O1F6A$r<u$1$^$;$s!#(B
.It Dv CHIOGSTATUS
.Pq Li "struct changer_element_status_request"
.\"X Perform the \fBREAD ELEMENT STATUS\fR call on the media changer
.\"X device.  This call reads the element status information of the media
.\"X changer and converts it to an array of \fBchanger_element_status\fR
.\"X structures.
$B$3$l$O!"%a%G%#%"%A%'%s%8%c%G%P%$%9$KBP$7!"(B\fBREAD ELEMENT STATUS\fR
$B8F$S=P$7$r9T$J$$$^$9!#$3$N8F$S=P$7$O%a%G%#%"%A%'%s%8%c$N(B
$B%(%l%a%s%H>uBV>pJs$rFI$_9~$_!"$=$l$r(B \fBchanger_element_status\fR
$B9=B$BN$NG[Ns$KJQ49$7$^$9!#(B
.Pp
.\"X With each call to
.Dv CHIOGSTATUS
.\"X , the status of one or more elements of one type may be queried.
$B$N8F$S=P$7$4$H$K!"$"$k%?%$%W$N(B 1 $B$D0J>e$N%(%l%a%s%H$N>uBV$,(B
$BLd$$9g$o$5$l$^$9!#(B
.Pp
.\"X The application passes a changer_element_status_request structure to the 
$B%"%W%j%1!<%7%g%s$O(B changer_element_status_request $B9=B$BN$r(B
.Nm
.\"X driver which contains the following fields:
$B%I%i%$%P$KEO$7$^$9!#$3$N9=B$BN$O<!$K<($9%U%#!<%k%I$r;}$A$^$9!#(B
.Bd -literal -offset indent
u_int                          cesr_element_type;
u_int                          cesr_element_base; 
u_int                          cesr_element_count;
u_int                          cesr_flags;
struct changer_element_status *cesr_element_status;

.Ed
.\"X This structure is read by the driver to determine the type, logical
.\"X base address and number of elements for which information is to be
.\"X returned in the array of changer_element_status structures pointed to
.\"X by the cesr_element_status field.  The application must allocate enough
.\"X memory for cesr_element_count status structures (see below).
.\"X The cesr_flags can optionally be set to 
$B%I%i%$%P$O$3$N9=B$BN$rFI$_9~$_!"%?%$%W!"O@M}%Y!<%9%"%I%l%9!"%(%l%a%s%H?t(B
$B$r7hDj$7!"(Bcesr_element_status $B%U%#!<%k%I$,;X$9(B changer_element_status
$B9=B$BN$NG[Ns$K$I$N>pJs$rJV$9$+$rCN$j$^$9!#%"%W%j%1!<%7%g%s$O!"(B
cesr_element_count $B8D$N>uBV9=B$BN(B ($B<!$r8+$F2<$5$$(B) $B$rJ];}$9$k$N$K(B
$B==J,$JBg$-$5$N%a%b%j$r3d$jEv$F$kI,MW$,$"$j$^$9!#(Bcesr_flags $B$K%*%W%7%g%s$G(B
.Dv CESR_VOLTAGS
.\"X to indicate that volume tag (bar code) information is to be read from
.\"X the jukebox and returned.
$B$r@_Dj$7!"%\%j%e!<%`%?%0(B ($B%P!<%3!<%I(B) $B>pJs$r%8%e!<%/%\%C%/%9$+$i(B
$BFI$_9~$_JV$9I,MW$,$"$k$3$H$rDLCN$9$k$3$H$,$G$-$^$9!#(B
.Pp
.\"X The cesr_element_base and cesr_element_count fields must be valid with
.\"X respect to the physical configuration of the changer.  If they are
.\"X not, the
cesr_element_base $B%U%#!<%k%I$H(B cesr_element_count $B%U%#!<%k%I$O!"(B
$B%A%'%s%8%c$NJ*M}E*9=@.$K>H$i$7$F@5Ev$JCM$G$J$1$l$P$J$j$^$;$s!#$b$7(B
$B@5Ev$JCM$G$J$$>l9g!"(B
.Dv CHIOGSTATUS
.\"X ioctl returns the
ioctl $B$O(B
.Er EINVAL
.\"X error code.
$B%(%i!<%3!<%I$rJV$7$^$9!#(B
.Pp
.\"X The information about the elements is returned in an array of
.\"X changer_element_status structures.  This structure include at least
.\"X the following fields:
$B%(%l%a%s%H$K$D$$$F$N>pJs$O!"(Bchanger_element_status $B9=B$BN$NG[Ns$NCf$K(B
$BJV$5$l$^$9!#$3$N9=B$BN$O>/$J$/$H$b<!$K<($9%U%#!<%k%I$r;}$A$^$9!#(B
.Bd -literal -offset indent
u_int            ces_addr;      /* $B%a%G%#%"%A%'%s%8%c$N%(%l%a%s%H%"%I%l%9(B */
u_char           ces_flags;     /* $B0J2<$N(B CESTATUS $B$NDj5A$r;2>H(B */
u_char           ces_sensecode; /* $B%(%l%a%s%H$NDI2C%;%s%9%3!<%I(B */
u_char           ces_sensequal; /* $BDI2C%;%s%9%3!<%I=$>~;R(B */
u_char           ces_invert;    /* $BH?E>%S%C%H(B */
u_char           ces_svalid;    /* $B0\F085%"%I%l%9(B (ces_source) $B$,M-8z(B */
u_short          ces_source;    /* $B%a%G%#%"$N0\F085%"%I%l%9(B */
changer_voltag_t ces_pvoltag;   /* $B%W%i%$%^%j%\%j%e!<%`%?%0(B */
changer_voltag_t ces_avoltag;   /* $BBeBX%\%j%e!<%`%?%0(B */
u_char           ces_idvalid;   /* ces_scsi_id $B$,M-8z(B */
u_char           ces_scsi_id;   /* $B%(%l%a%s%H$N(B SCSI id (ces_idvalid $B$,Hs%<%m$N>l9g(B) */
u_char           ces_lunvalid;  /* ces_scsi_lun $B$,M-8z(B */
u_char           ces_scsi_lun;  /* $B%(%l%a%s%H$N(B SCSI lun (ces_lunvalid $B$,Hs%<%m$N>l9g(B) */

.Ed
.\"X The ces_addr field contains the address of the element in the
.\"X coordinate system of the media changer.  It is not used by the driver,
.\"X and should be used for diagnostic purposes only.
ces_addr $B%U%#!<%k%I$O!"%a%G%#%"%A%'%s%8%c$N:BI87O$GI=$7$?(B
$B%(%l%a%s%H$N%"%I%l%9$rJ];}$7$^$9!#%I%i%$%P$O$3$l$r;HMQ$7$^$;$s!#(B
$B?GCGL\E*$N$_$G;HMQ$7$F2<$5$$!#(B
.Pp
.\"X The following flags are defined for the \fBces_flags\fR field:
\fBces_flags\fR $B%U%#!<%k%I$KBP$7!"<!$K<($9%U%i%0$,Dj5A$5$l$^$9!#(B
.Bl -tag -width CESTATUS_IMPEXP
.It Dv CESTATUS_FULL
.\"X A medium is present.
$B%a%G%#%"$,B8:_$7$^$9!#(B
.It Dv CESTATUS_IMPEXP
.\"X The medium has been deposited by the operator (and not by a picker).
$B%a%G%#%"$rCV$$$?$N$O%*%Z%l!<%?$G$9(B ($B%T%C%+$,CV$$$?$b$N$G$O$J$$(B)$B!#(B
.It Dv CESTATUS_EXCEPT
.\"X The element is in an exceptional state (e.g. invalid barcode label,
.\"X barcode not yet scanned).
$B$=$N%(%l%a%s%H$ONc30E*>uBV(B ($BNc$($P!"%P!<%3!<%I%i%Y%k$,ITEv$JCM!"(B
$B%P!<%3!<%I$,$^$@Av::$5$l$F$$$J$$(B) $B$K$"$j$^$9!#(B
.It Dv CESTATUS_ACCESS
.\"X The element is accessible by the picker.
$B$=$N%(%l%a%s%H$O%T%C%+$K$h$C$F%"%/%;%92DG=$J>uBV$G$9!#(B
.It Dv CESTATUS_EXENAB
.\"X The element supports medium export.
$B$=$N%(%l%a%s%H$O%a%G%#%";}$A=P$7$r%5%]!<%H$7$F$$$^$9!#(B
.It Dv CESTATUS_INENAB
.\"X The element supports medium import.
$B$=$N%(%l%a%s%H$O%a%G%#%";}$A9~$_$r%5%]!<%H$7$F$$$^$9!#(B
.El
.Pp
.\"X Note that not all flags are valid for all element types.
$B$9$Y$F$N%(%l%a%s%H%?%$%W$KBP$7$9$Y$F$N%U%i%0$,M-8z$H$O8B$i$J$$$3$H$K(B
$BCm0U$7$F2<$5$$!#(B
.El
.Sh $BCm<a(B
.\"X This version of the 
$B$3$N%P!<%8%g%s$N(B
.Nm
.\"X driver has been tested with a DEC TZ875 (5 slot, one DLT drive) and a
.\"X and a Breece Hill Q47 (60 slot, four DLT drives, barcode reader).
$B%I%i%$%P$O!"(BDEC TZ875 (5 $B%9%m%C%H!"(B1 DLT $B%I%i%$%V(B) $B$H(B Breece Hill Q47
(60 $B%9%m%C%H!"(B4 DLT $B%I%i%$%V!"%P!<%3!<%I%j!<%@IU$-(B) $B$rMQ$$$F%F%9%H$7$F(B
$B$"$j$^$9!#(B
.Pp
.\"X Many of the features the
$B%F%9%H$KMxMQ$G$-$?%G%P%$%9$,I,MW$J%3%^%s%I$r%5%]!<%H$7$F$$$J$$$H$$$&(B
$B;v<B$K$h$j!"(B
.Nm
.\"X driver supports are not thouroghly tested due to the fact that the
.\"X devices available for testing do not support the necessary commands.
.\"X This is true for alternate volume tags, media flipping, import/export
.\"X element handling, multiple picker operation and other things.
$B%I%i%$%P$,%5%]!<%H$9$k5!G=$NB?$/$O!"40A4$K%F%9%H$G$-$F$$$^$;$s!#$3$l$O!"(B
$BBeBX%\%j%e!<%`%?%0!"%a%G%#%"H?E>!"%(%l%a%s%H$N;}$A9~$_(B/$B;}$A=P$7A`:n!"(B
$BJ#?t%T%C%+A`:n!"$=$NB>$N5!G=$,$"$j$^$9!#(B
.Sh $B:n<T(B
.\"X The
.Nm
.\"X driver was written by 
$B$O!"(B
And Communications, http://www.and.com/ $B$N(B
.An Jason R. Thorpe Aq thorpej@and.com
$B$K$h$C$F=q$+$l$^$7$?!#$3$l$O!"$=$N<j$N%G%P%$%9$r;}$C$F$$$?(B
.\"X It was added to the system by 
.An Stefan Grefen Aq grefen@goofy.zdv.uni-mainz.de
$B$K$h$j%7%9%F%`$KIU$12C$($i$l$^$7$?!#(B
.\"X who apparently had such a device.
.\"X It was ported to CAM by
$B$3$l$r(B CAM $B$K0\?"$7$?$N$O!"(B
.An Kenneth Merry Aq ken@FreeBSD.ORG
$B$G$9!#(B
.\"X It was updated to support volume tags by 
.An Hans Huebner Aq hans@artcom.de
$B$,%\%j%e!<%`%?%0$N%5%]!<%H$r99?7$7$^$7$?!#(B
.Sh $B4XO"%U%!%$%k(B
.Bl -tag -width /dev/ch[0-9] -compact
.It Pa /dev/ch[0-9]
.\"X device entries
$B%G%P%$%9%(%s%H%j(B
.El
.Sh $B?GCG(B
.\"X If the media changer does not support features requested by the
$B%a%G%#%"%A%'%s%8%c$,(B
.Nm
.\"X driver, it will produce both console error messages and failure return
.\"X codes to the ioctls described here.
$B%I%i%$%P$,MW5a$9$k5!G=$r%5%]!<%H$7$F$$$J$$>l9g!"$3$3$G5-=R$7$?(B ioctl $B$K(B
$BBP$7!"%3%s%=!<%k%(%i!<%a%C%;!<%8$H%(%i!<%j%?!<%s%3!<%I$r@8@.$7$^$9!#(B
.Sh $B4XO"9`L\(B
.Xr chio 1 ,
.Xr cd 4 ,
.Xr sd 4 ,
.Xr st 4
.Sh $BNr;K(B
.\"X The
.Nm
.\"X driver appeared in 386BSD 0.1.
$B$O!"(B386BSD 0.1 $B$G8=$l$^$7$?!#(B
