Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ autochanger(7) — HP-UX 7.01

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

mkdev(1M)

mknod(1M)

ioctl(2)

AUTOCHANGER(7)  —  Series 300 Only

NAME

autochanger − optical autochanger driver

SYNOPSIS

#include <sys/ioctl.h>
#include <sys/ac.h>

ioctl (fildes, ACIOC_WRITE_QUEUE_CONST, ac_queue_const)
int fildes;
struct queue_const *ac_queue_const;

ioctl (fildes, ACIOC_READ_QUEUE_CONST, ac_queue_const)
int fildes;
struct queue_const *ac_queue_const;

ioctl (fildes, ACIOC_READ_QUEUE_STATS, ac_queue_stats)
int fildes;
struct queue_stats *ac_queue_stats;

ioctl (fildes, ACIOC_INITIALIZE_ELEMENT_STATUS)
int fildes;

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. 

The autochanger driver orchestrates the swapping of media in and out of the drives so that it appears to the user as if each piece of media has its own drive. 

The device files for autochanger media are character special files with a major number of 55 or block special files with a major number of 10. 

Minor Numbers

The minor number for autochanger media takes the form 0xScAFSr, with the following designations:

Sc Select code of the mechanical changer

A SCSI address of the mechanical changer

F Reserved for future features (The only valid value is zero.) 

Sr Surface for the specified media, encoded as follows:

surface1a Sr=01
surface1b Sr=02
surface2a Sr=03
surface2b Sr=04
. .
. .
. .
surface32a Sr=3F
surface32b Sr=40

The character device file with Sr=00 is used for ioctl(2). This device is opened before any ioctl can be done (see EXAMPLES). 

Ioctl Commands

The following ioctl commands (see the header file <sys/ac.h>) are valid:

ACIOC_WRITE_QUEUE_CONST
This ioctl allows the constants that control the queue to be altered. 

ACIOC_READ_QUEUE_CONST
This ioctl allows the constants that control the queue to be read. 

The following structure is passed to ioctl for the ACIOC_READ_QUEUE_CONST and ACIOC_WRITE_QUEUE_CONST requests, as defined in header file <sys/ac.h>:

struct queue_const {
int wait_time;
int hog_time;
};

The wait_time (value in seconds) controls how long the driver waits for another request for the current surface before swapping.  The default is 1 second. 

The hog_time (value in seconds) controls how long a surface can be held in a drive while requests for another surface are pending.  The default is 20 seconds. 

The wait_time cannot exceed the hog_time. 

ACIOC_READ_QUEUE_STATS
This ioctl allows the vital statistics of the queue to be read. 

The following structure is passed to ioctl for the ACIOC_READ_QUEUE_STATS request, as defined in header file <sys/ac.h>:

struct queue_stats {
long size;
long mix;
};

The size is the number of requests in the queue. 

The mix is the number of different surfaces in the queue. 

ACIOC_INITIALIZE_ELEMENT_STATUS
This ioctl instructs the autochanger to reset its internal medium map.  This ioctl causes the mechanical changer to look for media in all 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. 

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 is true:

­[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. 

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 <sys/ac.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)"
error (...);

/∗ do the ioctl ∗/
if (ioctl (fildes, ACIOC_READ_QUEUE_CONSTS, & ac_queue_stats) < 0)
error (...);

/∗ print the results ∗/
printf ("Queue size is %d\n", ac_queue_stats.size);
printf ("Queue mix is %d\n", ac_queue_stats.mix);

DEPENDENCIES

This driver only supports the C1700A Optical Autochanger. 

AUTHOR

The optical autochanger driver was developed by HP. 

FILES

/dev/ac/* block special files

/dev/rac/* character special files

SEE ALSO

mkdev(1M), mknod(1M), ioctl(2). 
HP-UX System Administrator Manual.

Hewlett-Packard Company  —  HP-UX Release 7.0: Sept 1989

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026