The following ioctl(2) calls apply to the changer. They are defined in the header file .In sys/chio.h .

CHIOMOVE

(Vt "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 element */
u_int cm_flags; /* misc. flags */

If the CM_INVERT in the cm_flags field is set, the medium changer is instructed to flip the medium while moving it.

CHIOEXCHANGE

(Vt "struct changer_exchange") Move the medium located in the source element to the first destination element, and move the medium that had been in the first destination element to the second destination element. In case of a simple exchange, the source and second destination elements should be the 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 fields:
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 */

In ce_flags, CM_INVERT1 and/or CM_INVERT2 may be set to flip the first or second medium during the exchange operation, respectively.

This operation is untested.

CHIOPOSITION

(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 at least the following elements:
u_int cp_type; /* element type */
u_int cp_unit; /* logical unit of element */
u_int cp_flags; /* misc. flags */

The cp_flags field may be set to CP_INVERT to invert the picker during the operation.

CHIOGPICKER

(Vt int) Return the logical address of the current picker.

CHIOSPICKER

(Vt int) Select the picker specified by the given logical address.

CHIOGPARAMS

(Vt "struct changer_params") Return the configuration parameters for the media changer. This ioctl fills the changer_params structure passed by the user with at least the following fields:
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 */

This call can be used by applications to query the dimensions of the jukebox before using the CHIGSTATUS ioctl to query the jukebox status.

CHIOIELEM

Perform the 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 ch drivers status is not affected by this call.

CHIOGSTATUS

(Vt "struct changer_element_status_request") Perform the 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 structures.

With each call to CHIOGSTATUS, the status of one or more elements of one type may be queried.

This structure is read by the driver to determine the type, logical base address and number of elements for which information is to be returned in the array of .Vt changer_element_status structures pointed to by the cesr_element_status field. The application must allocate enough memory for cesr_element_count status structures (see below). The cesr_flags can optionally be set to CESR_VOLTAGS to indicate that volume tag (bar code) information is to be read from the jukebox and returned.

The cesr_element_base and cesr_element_count fields must be valid with respect to the physical configuration of the changer. If they are not, the CHIOGSTATUS ioctl returns the EINVAL error code.