HPUX autochanger[7]

autochanger(7) autochanger(7)
NAME
autochanger - optical autochanger driver
SYNOPSIS
#include <sys/autoch.h>
int ioctl(int fildes, int request, ... /* arg */);
DESCRIPTION
An autochanger is a mass storage device with a very large capacity.
It consists of one or two drives, media, and a mechanical changer.
The mechanical changer allows multiple pieces of media to be shared
among the drives. Each piece of media has two surfaces, but only one
side can be accessed in a drive. The media must be inverted in order
to access data on the reverse side.
The autochanger driver orchestrates swapping of media in and out of
the drives such that it appears to the user as if each piece of media
has its own drive.
Two daemons named xportd and spinupd are automatically started when
the autochanger is first accessed. Each autochanger has its own
unique pair of daemons.
Series 300/400 and Series 700 autochanger media device files are
character special files with a major number of 55 or block special
files with a major number of 10.
Series 800 Major Numbers
Series 800 autochanger media device files are character special files
with a major number of 19 or block special files with a major number
of 12.
Series 300/400 Minor Numbers
The minor number for autochanger media takes the form 0xScAFSr where
ScAFSr is constructed as follows:
Sc Select code of the mechanical changer
A SCSI address of the mechanical changer
F Reserved. The only valid value is zero.
Hewlett-Packard Company - 1 - HP-UX Release 9.0: August 1992
autochanger(7) autochanger(7)
Sr Surface for the specified media, encoded as follows:
tab(;); cB | cB l | cf4. Surface;Value of Sr _
surface1a;01 surface1b;02 surface2a;03 surface2b;04
;. ;. ;. surface32a;3F surface32b;40
The character device file with an Sr value of 00 is used for ioctl()
requests (see ioctl(2)). This device must be opened before any
request can be performed (see EXAMPLES).
Series 700 Minor Numbers
The minor number for autochanger media takes the form 0xVEAFBSr where
VEAFBSr is a 24-bit value constructed as follows:
V VSC slot number (bits 23-21).
E Function exists (bit 20).
A Adapter slot number (bits 16-19).
F Function number (bits 12-15).
B SCSI bus address of the autochanger (bits 09-11). Because
the surface numbers do not end on an even boundry (9 bits
specified) the autochanger SCSI bus address is shifted
one bit to the left (see example below).
Sr Surface for the specified media (bits 00-08 - encoded
same as Series 300 above).
Examples of surface devices for Series 700 systems connected to the
internal SCSI bus with the autochanger SCSI ID at 3:
mknod /dev/rac/1a 55 0x201601 # Cartridge
mknod /dev/rac/1b 55 0x201602 # Cartridge
mknod /dev/rac/2a 55 0x201603 # Cartridge
mknod /dev/rac/2b 55 0x201604 # Cartridge
Series 800 Minor Numbers
The minor number for autochanger media takes the form 0xLuPFSr where
LuPFSr is constructed as follows:
Lu Logical unit number of the mechanical changer.
P Partition (section). See disk(7) for definition.
F Reserved. The only valid value is zero.
Sr Surface for the specified media (bits 00-08 - encoded
same as Series 300 above).
The character device file with an Sr value of 00 is used for ioctl()
requests (see ioctl(2)). This device must be opened before any
request can be performed. (see EXAMPLES).
ioctl commands
The following ioctl() commands (see the header file <sys/autoch.h>)
Hewlett-Packard Company - 2 - HP-UX Release 9.0: August 1992
autochanger(7) autochanger(7)
are valid:
ACIOC_WRITE_Q_CONST
This request alters the constants that control the
queue.
ACIOC_READ_Q_CONST
This request reads the constants that control the
queue.
A pointer to a structure queue_const is passed as the
arg argument to ioctl() for ACIOC_READ_Q_CONST and
ACIOC_WRITE_Q_CONST requests, as defined in header file
<sys/autoch.h>:
struct queue_const {
int wait_time;
int hog_time;
};
where:
wait_time (in seconds) controls how long the
driver waits for another request
for the current surface before
swapping. When the device is first
opened, the default is 1 second.
hog_time How many seconds a surface can be
held in a drive while requests for
another surface are pending. When
the device is first opened, the
default is 20 seconds.
The value of wait_time cannot exceed that of
hog_time.
ACIOC_READ_Q_STATS
This ioctl() reads the vital statistics of the queue.
A pointer to a structure queue_stats is passed as the
arg argument to ioctl() for the ACIOC_READ_Q_STATS
request, as defined in header file <sys/autoch.h>:
struct queue_stats {
long size;
long mix;
};
ACIOC_INITIALIZE_ELEMENT_STATUS
This request instructs the autochanger to reset its
Hewlett-Packard Company - 3 - HP-UX Release 9.0: August 1992
autochanger(7) autochanger(7)
internal media map, and causes the mechanical changer
to look for media in all of the slots. It fails if any
surface is open.
RETURN VALUE
Upon successful completion, ioctl() returns a value of zero. If an
error occurs, a value of -1 is returned and the global variable errno
is set to indicate the error.
OTHER SUPPORTED IOCTLS
These ioctls can be used with surface devices and are not to be used
on the /dev/rac/ioctl device:
DIOC_EXCLUSIVE
DIOC_CAPACITY
DIOC_DESCRIBE
SIOC_INQUIRY
SIOC_XSENSE
ERRORS
In addition to those errors defined in open(2), close(2), read(2),
write(2), and ioctl(2), a driver request can fail if any of the
following conditions are encountered:
[EIO] ioctl() encountered a hardware problem with the
mechanical changer or drive.
[ENXIO] The device file is incorrect, or a surface was
open while ioctl() attempted to execute the
ACIOC_INITIALIZE_ELEMENT_STATUS request.
EXAMPLES
The following code fragment reads the queue constants for an
autochanger device accessed through special file /dev/rac/ioctl (the
special device file with Sr=00):
#include <unistd.h>
#include <fcntl.h>
#include <sys/autoch.h>
int fildes;
struct queue_stats ac_queue_stats;
/* open the special device file for ioctl */
if ((fildes = open("/dev/rac/ioctl", O_RDWR)) < 0)
perror(...);
/* do the ioctl */
if (ioctl(fildes, ACIOC_READ_Q_CONSTS, &ac_queue_stats) < 0)
perror(...);
/* print the results */
(void) printf("Queue size is %d\n", ac_queue_stats.size);
Hewlett-Packard Company - 4 - HP-UX Release 9.0: August 1992
autochanger(7) autochanger(7)
(void) printf("Queue mix is %d\n", ac_queue_stats.mix);
DEPENDENCIES
This driver supports only the C1700 and C1702 Optical Autochangers.
AUTHOR
The autochanger driver was developed by HP.
FILES
/dev/ac/* block special files
/dev/rac/* character special files
SEE ALSO
insf(1M), mkdev(1M), mknod(1M), ioctl(2).
HP-UX System Administrator Manuals.
Hewlett-Packard Company - 5 - HP-UX Release 9.0: August 1992