INTERNAL(3)

NAME
jukebox routines

SYNOPSIS
#include "hdr.h"

int j_shelf_to_drive(int sh, Side side, int dr, char *err)

int j_drive_to_shelf(int dr, int sh, Side side, char *err)

int j_empty_drive(int tlim, char *buf)

void j_rdshelves(char *buf)

int j_getstatus(char *buf)

int j_scsiio(struct scsi_cmd *cmd, int ncmd,
struct scsi_return *ret, int nret, char *err)

int j_shelfof(char *vol_id)

int j_volid(int dr, char *err)

extern char *j_shelf[NSHELF];

extern void pperror(char *buf, char *mesg);

DESCRIPTION
J_shelf_to_drive places the disk in shelf sh in logical drive dr. It returns 0 on success; otherwise an error message is placed in err .

J_drive_to_shelf places the disk in logical drive dr in shelf sh. If sh is negative, the disk is returned to its home shelf. It returns 0 on success; otherwise an error message is placed in err.

J_rdshelves initializes each element of j_shelf to the volid of the disk on that shelf. A zero pointer means there is no disk; a name of UNALLOCATED means the disk has not been allocated a name yet. It returns 0 on success; otherwise an error message is placed in err.

J_getstatus initializes j_status which include the following fields:
    	struct Lunstatus lun[NLUN]; /* disk status */
    	uchar shelf[NSHELF];	/* shelf status */
    	uchar iounit;		/* I/O unit status */
    	uchar carrier;		/* carrier status */
    	uchar udrive;		/* upper drive status */
    	uchar ldrive;		/* lower drive status */
A return value of 0 implies success; otherwise -1 is returned and an error message is placed in err.

J_scsiio performs a SCSI transaction. It sends the command in cmd and ncmd data bytes and stores the return status in ret. A return value of 0 implies success; otherwise -1 is returned and an error message is placed in err.

J_shelfof returns the shelf number of the disk labelled vol_id. If there is no such disk, -1 is returned.

J_volid returns the volid of the disk on drive dr in err. A return value of 0 implies success; otherwise -1 is returned and an error message is placed in err.

Pperror returns an error message that is contained in buf.

SEE ALSO

DIAGNOSTICS