mrd_ready_inport - Enable access to the Inport of a TL820 Windows NT mrd.dll UNIX /usr/lib/libmrd.a OpenVMS MRD$RTL.EXE #include <mrd_common.h> #include <mrd_message.h> int mrd_ready_inport( const char *robot_name, const char *inport, char *log_info) ;
1 – Parameters
o robot_name - The name of the robot device to be opened. On Digital UNIX, if the leading character of the name is not a slash (/), /dev/ will be prepended to the name. o inport - This is the address of the character string containing a zero based address of the port to be readied. o log_info - This is a character array that should be at least MRD_MAX_LOG_STRING in length. If this function fails as the result of a SCSI error, this will be filled with the formatted request sense data. If this function fails as the result of an operating system error, the operating system message particular to the error will be copied into the array.
2 – Description
The TL820 family of libraries uses an Input/Output Device (IOD) to allow putting tapes into the library and taking them out. The inport part of the IOD holds a single cartridge and has a door on top which must be opened before a cartridge can be placed in it. A button on the front of the IOD opens the door, but only after it has been enabled by a Ready IOD command. This is a vendor unique command specific to the TL820 family. The mrd_ready_inport(3mrd) routine allows sending a Ready IOD command to the robot and port specified by the robot_name and inport arguments. For all currently shipping TL820 family libraries there is only one Inport, so the inport argument can always be "0". On a TL820, when the source for a move in the Inport, this routine should be called first and time allowed for the operator to place a tape in the inport. The routine mrd_ move(3mrd) expects the element to be full when it starts.
3 – Example
/* * Send a Ready Inport command to the robot. This is specific * the TL82X family and causes the Inport door to be enabled * for one minute (the period the light is on). A future * version of firmware may allow enableing the button to be * on all the time, making this command obsolete. The command * usage is: * * mrd_ready_inport robot */ #ifndef lint static char SccsId[] = "@(#)mrd_ready_inport.c 1.2 3/5/97" ; #endif #include <stdio.h> #include <stdlib.h> #include <mrd_common.h> #include <mrd_message.h> main(int argc, char *argv[]) { int status ; /* status from mrd_ready_inport(3mrd) */ char *robot ; /* Robot for command */ char log_info[MRD_MAX_LOG_STRING+1] ; /* error text */ /* * Only one argument; the robot name. */ if( argc == 1 ) { printf("usage: %s robot\n", argv[0]) ; exit(1) ; } else robot = argv[1] ; /* * While the interface of Ready Inport allows the specification * of any port address, the Inport of the TL820 is always "0", * and this command is very robot specific. */ status = mrd_ready_inport(robot, "0", log_info) ; if( status != MRD_STATUS_SUCCESS ) printf("Ready Inport failed: %s: %s.\n", mrd_strstatus(status), log_info[0] ? log_info : "none") ; return 0 ; }
4 – Return Values
Upon successful completion, the mrd_ready_inport(3mrd) function returns the value MRD_STATUS_SUCCESS. If mrd_ready_inport(3mrd) fails the returned status value may be set to one of the following values. Other values that correspond to specific SCSI errors may also be possible, but these are the most likely.
4.1 – MRD_STATUS_PARAM
This error is returned if the any of the arguments are NULL pointers.
4.2 – MRD_STATUS_PORT_INVALID
This error is returned when the element address for a port is less than zero or greater than the number of ports.
4.3 – MRD_STATUS_ROBOT_COMM_ERROR
This error code is used when an OpenVMS system service, such as $ASSIGN or $QIO, fails with a status of SS$_DRVERR. Generally SS$_DRVERR indicates a failure in the underlying device and the MRD can get the detailed device failure and return the correct MRD status code instead. This error is also returned when a SCSI Test Unit Ready command fails. The cause of the error can be determined by called mrd_ request_sense(3mrd). This error also occurs as the result of a SCSI command failure, when the ASC is set to one of: o 0x08 - Logical unit communcation errors. o 0x43 - Message error o 0x45 - Select or Reselect failure o 0x47 - SCSI parity error o 0x48 - Initiator detected error message received o 0x49 - Invalid message error o 0x4A - Command phase error o 0x4B - Data phase error o 0x4E - Overlapped commands attempted o 0x54 - SCSI to host system interface failure
5 – Related Functions
Functions: o mrd_move(3mrd) o mrd_load(3mrd) o mrd_unload(3mrd) o mrd_inject(3mrd) o mrd_eject(3mrd)