Annotation of researchv10no/cmd/worm/oscsi/juke.3, revision 1.1.1.1

1.1       root        1: .TH INTERNAL 3
                      2: .CT 2 file_io
                      3: .SH NAME
                      4: jukebox routines
                      5: .tr %"
                      6: .SH SYNOPSIS
                      7: .B "#include %hdr.h%"
                      8: .PP
                      9: .tr %%
                     10: .B "int j_shelf_to_drive(int sh, Side side, int dr, char *err)"
                     11: .PP
                     12: .B "int j_drive_to_shelf(int dr, int sh, Side side, char *err)"
                     13: .PP
                     14: .B "int j_empty_drive(int tlim, char *buf)"
                     15: .PP
                     16: .B "void j_rdshelves(char *buf)"
                     17: .PP
                     18: .B "int j_getstatus(char *buf)"
                     19: .PP
                     20: .B "int j_scsiio(struct scsi_cmd *cmd, int ncmd,"
                     21: .br
                     22: .B "\ \ \ \ \ \ struct scsi_return *ret, int nret, char *err)"
                     23: .PP
                     24: .B "int j_shelfof(char *vol_id)"
                     25: .PP
                     26: .B "int j_volid(int dr, char *err)"
                     27: .PP
                     28: .B "extern char *j_shelf[NSHELF];"
                     29: .PP
                     30: .B "extern void pperror(char *buf, char *mesg);
                     31: .SH DESCRIPTION
                     32: .I J_shelf_to_drive
                     33: places the disk in shelf
                     34: .I sh
                     35: in logical drive
                     36: .IR dr .
                     37: It returns 0 on success;
                     38: otherwise an error message is placed in
                     39: .I err .
                     40: .PP
                     41: .I J_drive_to_shelf
                     42: places the disk
                     43: in logical drive
                     44: .IR dr
                     45: in shelf
                     46: .IR sh .
                     47: If
                     48: .I sh
                     49: is negative,
                     50: the disk is returned to its home shelf.
                     51: It returns 0 on success;
                     52: otherwise an error message is placed in
                     53: .IR err .
                     54: .PP
                     55: .I J_rdshelves
                     56: initializes each element of
                     57: .I j_shelf
                     58: to the volid of the disk on that shelf.
                     59: A zero pointer means there is no disk;
                     60: a name of
                     61: .B UNALLOCATED
                     62: means the disk has not been allocated a name yet.
                     63: It returns 0 on success;
                     64: otherwise an error message is placed in
                     65: .IR err .
                     66: .PP
                     67: .I J_getstatus
                     68: initializes
                     69: .B j_status
                     70: which include the following fields:
                     71: .EX
                     72:        struct Lunstatus lun[NLUN]; /* disk status */
                     73:        uchar shelf[NSHELF];    /* shelf status */
                     74:        uchar iounit;           /* I/O unit status */
                     75:        uchar carrier;          /* carrier status */
                     76:        uchar udrive;           /* upper drive status */
                     77:        uchar ldrive;           /* lower drive status */
                     78: .EE
                     79: A return value of 0 implies success;
                     80: otherwise \-1 is returned and an error message is placed in
                     81: .IR err .
                     82: .PP
                     83: .I J_scsiio
                     84: performs a SCSI transaction.
                     85: It sends the command in
                     86: .I cmd
                     87: and
                     88: .I ncmd
                     89: data bytes and stores the return status in
                     90: .IR ret .
                     91: A return value of 0 implies success;
                     92: otherwise \-1 is returned and an error message is placed in
                     93: .IR err .
                     94: .PP
                     95: .I J_shelfof
                     96: returns the shelf number of the disk labelled
                     97: .IR vol_id .
                     98: If there is no such disk,
                     99: \-1 is returned.
                    100: .PP
                    101: .I J_volid
                    102: returns the volid of the disk on drive
                    103: .I dr
                    104: in
                    105: .IR err .
                    106: A return value of 0 implies success;
                    107: otherwise \-1 is returned and an error message is placed in
                    108: .IR err .
                    109: .PP
                    110: .I Pperror 
                    111: returns an error message that is contained in 
                    112: .IR buf.
                    113: .PP
                    114: .SH "SEE ALSO"
                    115: .SH DIAGNOSTICS

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.