2 * $Id: scsi-proto.c,v 1.4 2006/05/25 01:47:10 johnfranks Exp $
4 * scsi-proto.c -- library routines to handle the changer
5 * Prototype file for customization
7 * Author: Eric Schnoebelen, eric@cirr.com
8 * interface based on work by: Larry Pyeatt, pyeatt@cs.colostate.edu
9 * Copyright: 1997, 1998 Eric Schnoebelen
11 * Michael C. Povel 03.06.98 added dummy for eject_tape
20 char *modname = "@(#)" __FILE__
21 ": SCSI support library for the proto scsi interface @(#)";
24 * this routine checks a specified slot to see if it is empty
26 int isempty(int fd, int slot)
29 * ask the robotics, which have knowledge of the storage elements
30 * if the requested slot is empty.
32 * nslot available for use when the number of slots needs to be known
35 return (slot_empty? 1 : 0);
38 int get_clean_state(char *dev)
40 /* Ask the device, if it needs a cleaning */
41 return (needs_cleaning? 1 : 0);
48 void eject_tape(char *tape)
49 /* This function ejects the tape from the drive */
56 * find the first empty slot
58 int find_empty( int fd, int start, int end)
61 * find an empty slot to insert a tape into (if required)
63 * loop through the list of slots, checking see if it is currently
70 * returns one if there is a tape loaded in the drive
72 int drive_loaded(int fd, int drivenum)
75 * check the status of the transport (tape drive).
77 * return 1 if the drive is occupied, 0 otherwise.
79 return (occupied ? 1 : 0);
84 * unloads the drive, putting the tape in the specified slot
86 int unload(int fd, int drive, int slot)
89 * unload the specified drive into the specified slot
97 * moves tape from the specified slot into the drive
99 int load(int fd, int drive, int slot)
102 * load the media from the specified element (slot) into the
103 * specified data transfer unit (drive)
108 int get_slot_count(int fd)
112 * return the number of slots in the robot
116 return number_of_storage_elements;
119 int get_drive_count(int fd)
123 * retreive the number of data-transfer devices
125 return number_of_data-transfer_devices;