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
18 char *modname = "@(#)" __FILE__
19 ": SCSI support library for the proto scsi interface @(#)";
22 * this routine checks a specified slot to see if it is empty
24 int isempty(int fd, int slot)
27 * ask the robotics, which have knowledge of the storage elements
28 * if the requested slot is empty.
30 * nslot available for use when the number of slots needs to be known
33 return (slot_empty? 1 : 0);
36 int get_clean_state(char *dev)
38 /* Ask the device, if it needs a cleaning */
39 return (needs_cleaning? 1 : 0);
46 void eject_tape(char *tape)
47 /* This function ejects the tape from the drive */
54 * find the first empty slot
56 int find_empty( int fd, int start, int end)
59 * find an empty slot to insert a tape into (if required)
61 * loop through the list of slots, checking see if it is currently
68 * returns one if there is a tape loaded in the drive
70 int drive_loaded(int fd, int drivenum)
73 * check the status of the transport (tape drive).
75 * return 1 if the drive is occupied, 0 otherwise.
77 return (occupied ? 1 : 0);
82 * unloads the drive, putting the tape in the specified slot
84 int unload(int fd, int drive, int slot)
87 * unload the specified drive into the specified slot
95 * moves tape from the specified slot into the drive
97 int load(int fd, int drive, int slot)
100 * load the media from the specified element (slot) into the
101 * specified data transfer unit (drive)
106 int get_slot_count(int fd)
110 * return the number of slots in the robot
114 return number_of_storage_elements;
117 int get_drive_count(int fd)
121 * retreive the number of data-transfer devices
123 return number_of_data-transfer_devices;