CH (4)
BSD Kernel Interfaces Manual
CH (4)
NAME
ch — SCSI media-changer (juke box) driver
SYNOPSIS
device ch
DESCRIPTION
The ch driver provides support for a SCSI media changer. It allows many slots of media to be multiplexed
between a number of drives. The changer device may optionally be equipped with a bar code reader, which
reads label information attached to the media.
A SCSI adapter must also be separately configured into the system before a SCSI changer can be configured.
As the SCSI adapter is probed during boot, the SCSI bus is scanned for devices. Any devices found which
answer as ’Changer’ type devices will be ’attached’ to the ch driver. In FreeBSD releases prior to 2.1, the
first found will be attached as ch0 and the next, ch1 etc. Beginning in 2.1 it is possible to specify what ch
unit a device should come on line as; refer to scsi(4) for details on kernel configuration.
KERNEL CONFIGURATION
It is only necessary to explicitly configure one ch device; data structures are dynamically allocated as media
changes are found on the SCSI bus.
IOCTLS
User mode programs communicate with the changer driver through a number of ioctls which are described
below. Changer element addresses used in the communication between the kernel and the changer device are
mapped to zero-based logical addresses. Element types are specified as follows:
CHET_MT Medium transport element (picker).
CHET_ST Storage element (slot).
CHET_IE Import/export element (portal).
CHET_DT Data transfer element (drive).
The following ioctl(2) calls apply to the changer. They are defined in the header file <sys/chio.h>.
CHIOMOVE
(struct changer_move ) Move a medium from one element to another ( MOVE
MEDIUM ) using the current picker. The source and destination elements are specified
in a changer_move structure, which includes at least the following fields:
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