Copyright © 2000-2004 IBM Corporation Last update: 2/07/04 Tapedrv is a tape device firmware utility program whose primary function is to automatically update certain supported tape devices with the latest firmware. "Tape devices" means both tape drives and medium changers. Medium changers are also called loaders, libraries, and robots. Tapedrv runs on Microsoft DOS and Windows and Linux based platforms. See Supported Tape Devices. Contents -------- History Files Usage autoupdate Command autoupdate Screen Examples autock Command autosim Command list Command listsim Command status Command statussim Command Device Firmware States inquiry Command inick Command msgck Command updatealg_list Command updatealg_attr Command tapedrv.ini Syntax tapedrv.ini [tapedrv] Section tapedrv.ini [autoupdate] Section tapedrv.ini [] Sections tapedrv.ini Example tapedrv.msg Syntax tapedrv.msg Special Messages tapedrv.msg Runtime Error Checking tapedrv Executable Exit Codes Tapedrv Errors DOS Notes Windows Notes Linux Notes Supported Tape Devices History 1.08.19 - Add interactive device selection during autoupdate. - Add autock, list, listsim commands, and -t, and -s options. - Add " to repaint screen" on Linux. - Fix 4-bus SCSI adapter enumeration. 1.8L - Treat "Check Condition: No Sense" as "Good" status rather than error. - Recompiled for glibc-2.2.4 (rather than glibc-2.3) 1.8k - Add exabyte_vxa algorithm 1.8j - Reset hp_ultrium final Write Buffer Offset to 0 - Increase hp_ultrium transfer segment size from 4K to 32K - Change default hp_ultrium UpdatePrepare to "Unload" only. - Add ReferenceName parameter - Add updatealg_list, updatealg_attr commands - Fix 1.8i's premature program exit on Windows XP/2003 1.8i - Add support for IBM firmware in DDS1,DDS2,DDS3 tape drives 1.8h - Add support for ReplaceVersion parameter 1.8g - Reduce ibm_library transfer segment size from 64K to 32K 1.8f - Add ibm_library algorithm 1.8e - Add support for .ini WriteBufferID parameter 1.8d - Change Write Buffer ID from 0 to 1 for hp_ultrium 1.8c - Clear data direction flags for all zero length SCSI CDB transfers 1.8b - Fix failure to update TR7 under Windows NT,2000,XP,2003 - Add Linux DDS1/DDS2 with 256K EEPROM, and TR4,TR5,TR7, update support - Add "tapedrv" script to run Linux architecture specific executables 1.8 - Add Linux support - Convert InquiryStd full string be ASCII pattern - Add ASCII pattern capability to InquiryCFR_OEM - Add DOS/Windows recognition of '-' (as well as '/') for options. 1.7 - Add redirection of firmware to LUN 0 via UpdateFlags = "Z" - Add Vendor specific ASCII Inquiry recognition via InquiryStdAscii - Add VPD recognition via VpdAscii and VpdHex - Add "tapedrv inquiry" command to dump all tape device Inquiry data. - Update pattern matching and SCSI enumeration - Change pattern escape character from caret (^) to grave accent (`) - Enable CDB logging in 32-bit (not 16-bit) mode - Optimize loading of tapedrv.ini (for floppy performance). 1.6 - 1.5 - Revised menu 1.4 - Updated firmware revisions added menu and support tools 1.3 - Fix by disabling non-zero LUN scan when LUN0 returns error 1.2 - Fix failure to update Seagate STT3401A TR7 in DOS mode 1.1 - Add non-zero LUN support (Use new /z option if LUN0 only is needed); - Add "seagate_tr7" UpdateAlgorithm (for STT3401A) - Add "quantum_dlt_8k" UpdateAlgorithm (for DLT4000) - Add UpdateFlags = "" control 1.0 - Debug version (partial non-zero LUN support) 0.9 - Fix 'tapedrv status -o' broken in v0.8; 5K DOS memory reduction 0.8a - Fix 'tapedrv status -r' broken in v0.8 0.8 - Fix for HP half-high and Win9x 3600 Library w/ 126I firmware 0.7 - Add support for device access via NT port driver 0.6 - Fixes for 3502 and 3600 Libraries and the IBM Ultrium-1 0.5 - Fix "Invalid device request reading drive c" errors during DOS mode program initialization. 0.4 - Reduce maximum DOS mode memory requirement an additional 15K. 0.3 - Reduce maximum DOS mode memory requirement by about 12K. 0.2 - Add DOS mode memory usage logging - Hide cursor after status and prompt line update - Fix command line option character case insensitivity 0.1 - Second pass 0.0 - Initial pass Files tapedrv.exe executes under Microsoft DOS and Windows 95, 98, Me, NT 3.51, NT 4.0, 2000, XP, and Server 2003. tapedrv is a shell script that selects and runs one of the Linux architecture specific executables below. tapedrv.linux.i386 executes on Linux 32-bit platforms. tapedrv.linux.ia64 executes on Linux 64-bit platforms. tapedrv.msg contains program text messages and must reside in the same directory as the tapedrv executable. tapedrv.ini contains program configuration information and normally resides in the same directory as the tapedrv executable. Configuration information includes a list of tape device to firmware file correspondence specifications and other data. is a directory that contains firmware file images, used to update various tape device models. Usage tapedrv -- IBM Tape Device Firmware Update Utility - v1.08.19 usage: tapedrv command [ options ] Commands: autoupdate Automatically updates tape device firmware autock Simulates autoupdate for CD-ROM testing autosim Simulates autoupdate for interactive testing list Lists tape device Tape unit and Serial numbers listsim Simulates list status Reports firmware version status statussim Simulates status inquiry Shows Inquiry and VPD data for tape devices inick Checks tapedrv.ini and firmware files msgck Checks tapedrv.msg message numbers updatealg_list Prints a list of update algorithms updatealg_attr Prints a list of update algorithms and attributes ver Prints tapedrv version Note: Because of memory restrictions, inquiry, inick, msgck, updatealg_list, and updatealg_attr are unavailable in 16-bit DOS mode. Options: -g Prints additional debug information to log -i Specifies an .ini file to override the default tapedrv.ini. -l [+] Logs messages to file. If a + precedes the file is opened for appending. -o [+] Directs output to a file for non-interactive commands. If a + precedes the file is opened for appending. -p Specifies the directory in which firmware files are stored (for autoupdate, autosim, inick). is used as prefix for filename strings given by AutoFileName parameters in tapedrv.ini. -r Prints additional program recognizable output (for status). -s Selects a device with a Serial number that matches the case sensitive string, . may contain the wild-card characters * and ?. A list of Serial numbers is displayed by the command: tapedrv list. Examples: tapedrv autoupdate -s US0MA00325 tapedrv autoupdate -s "*325" -t Selects a device by Tape Unit number . A list of Tape Unit numbers is displayed by the command: tapedrv list. Example: tapedrv autoupdate -t 1 -z Restrict device search to LUN0 only. Under Windows and DOS, a / may be used instead of a - (e.g., /z or -z). Commands and options are case insensitive. Directory separators may be either forward or back slashes (e.g., /drivemic or \drivemic). Under Linux, - is used to identify options. Commands are case insensitive. Options are case sensitive. autoupdate Command autoupdate automatically updates supported tape devices with the latest firmware. By way of example, the following command might be used to update tape drives attached to a given computer: tapedrv autoupdate -p Q:/DRIVEMIC In this example, Q:/DRIVEMIC is the directory in which firmware files are stored. During runtime, 'autoupdate' presents a character graphics display that shows a list of tape devices found on the system. Those tape devices that are marked "Out of date" and "Waiting" will be updated. A device marked in any other way is skipped. See autoupdate Screen Examples Beginning from the top of the displayed device list, and working downward, autoupdate highlights the next device to be updated and starts a count down timer: Update pending. Update will start in in 25 seconds. During the count down, you may choose to either quit the program by pressing , or select a different starting device by pressing the arrow keys followed by . Once you select a device, the count down is restarted. When the count down expires and the highlighted device is marked "Out of date" and "Waiting", the latest firmware is transferred from a file to the device. A device marked in any other way is skipped. After processing the final device in the list, autoupdate displays status for a short period then exits. In more detail, if no updatable devices are found, the initial device screen has one of the following messages in the second and third lines: Tape device in use by another program. Will end in 10 seconds. Tape device needs DOS only mode update. Will end in 10 seconds. Tape device needs alternate method update. Will end in 10 seconds. Tape device inaccessible. Will end in 10 seconds. Tape device(s) already up to date. Will end in 10 seconds. No updatable device found. Will end in 10 seconds. Press any key to end immediately. -- Tape Device List -- Otherwise if one or more devices need updating, then every screen displayed before device update provides you with an opportunity to quit before updating commences. The following prompts are shown: Update pending. Update will start in in 25 seconds. Press to immediately update device, or to quit. -- Tape Device List -- To quit program, press . To select a different starting device, use arrow keys, then press . If is pressed, the program exits without updating the tape device. If is pressed, the program immediately proceeds to update the highlighted device. If any other key is pressed, then the timer is stopped. You may use the up or down arrow keys to select a different (or the same) starting device to update, then either press to restart the autoupdate process, or press to quit the program. Otherwise when the dynamic seconds field decrements to zero, update commences. Once the update process starts, the device list is redrawn to reflect the activity. You are shown the following message in the second and third lines: Update in progress for the highlighted device... This will take approximately 2 minutes. Do NOT power down! % -- Tape Device List -- The %, in the above message, is a dynamic spinner that indicates activity. After the final update, the screen is again redrawn to show the final status. You are shown one of following messages in the second and third lines: Tape device in use by another program. Will end in 10 seconds. Tape device needs DOS only mode update. Will end in 10 seconds. Tape device needs alternate method update. Will end in 10 seconds. Tape device inaccessible. Will end in 10 seconds. Update successful. Will end in 10 seconds. Tape device(s) already up to date. Will end in 10 seconds. Update failed. Will end in 10 seconds. Press any key to end immediately. -- Tape Device List -- Information that controls tape device recognition and firmware file correspondence resides in the mandatory initialization file, tapedrv.ini. For details, see tapedrv.ini Syntax. autoupdate Screen Examples Screen 1 Screen 1 gives an example of a system before update commences. Update pending. Update will start in in 25 seconds. Press to immediately update device, or to quit. Device Address: Controller_Number/SCSI_Device_ID.Logical_Unit_Number Current Update Tape Device Ver- Version Unit Address Device Inquiry sion State Old,New Status ---- ------- ------------------------ ---------------- ----------------- >>0 0/1.0 Seagate STT8000A 5.48 Out-of-date 5.48,5.51 Waiting 1 1/0.0 IBM ULTRIUM-TD1 09A1 Out-of-date 09A1,0BN1 Waiting 2 1/1.0 IBM ULTRIUM-TD1 0BN1 Up-to-date 3 1/13.0 SEAGATE AIT 04j9 Unrecognized device To quit program, press . To select a different starting device, use arrow keys, then press . In Screens 1, 2, and 3, ">>..." means "reverse video bar" and the % is a spinning indicator. Screen 2 When update commences Screen 2 might look like this: Update in progress for the highlighted device... This will take approximately 2 minutes. Do NOT power down! % Device Address: Controller_Number/SCSI_Device_ID.Logical_Unit_Number Current Update Tape Device Ver- Version Unit Address Device Inquiry sion State Old,New Status ---- ------- ------------------------ ---------------- ----------------- >>0 0/1.0 Seagate STT8000A 5.48 Out of date 5.48,5.51 Updating 1 1/0.0 IBM ULTRIUM-TD1 09A1 Out of date 09A1,0BN1 Waiting 2 1/1.0 IBM ULTRIUM-TD1 0BN1 Up to date 3 1/13.0 SEAGATE AIT 04j9 Unrecognized device Screen 3 Screen 3 depicts the update of the second device. Update in progress for the highlighted device... This will take approximately 2 minutes. Do NOT power down! % Device Address: Controller_Number/SCSI_Device_ID.Logical_Unit_Number Current Update Tape Device Ver- Version Unit Address Device Inquiry sion State Old,New Status ---- ------- ------------------------ ---------------- ----------------- 0 0/1.0 Seagate STT8000A 5.51 Up to date 5.48,5.51 Success >>1 1/0.0 IBM ULTRIUM-TD1 09A1 Out of date 09A1,0BN1 Updating 2 1/1.0 IBM ULTRIUM-TD1 0BN1 Up to date 3 1/13.0 SEAGATE AIT 04j9 Unrecognized device Screen 4 Screen 4 shows a successful completion. Update successful. Will end in 10 seconds. Press any key to end immediately. Device Address: Controller_Number/SCSI_Device_ID.Logical_Unit_Number Current Update Tape Device Ver- Version Unit Address Device Inquiry sion State Old,New Status ---- ------- ------------------------ ---------------- ----------------- 0 0/1.0 Seagate STT8000A 5.51 Up to date 5.48,5.51 Success 1 1/0.0 IBM ULTRIUM-TD1 0BN1 Up to date 09A1,0BN1 Success 2 1/1.0 IBM ULTRIUM-TD1 0BN1 Up to date 3 1/13.0 SEAGATE AIT 04j9 Unrecognized device Update completed successfully. Screen 5 Screen 5 depicts an abnormal completion. Update failed. Will end in 10 seconds. Press any key to end immediately. Device Address: Controller_Number/SCSI_Device_ID.Logical_Unit_Number Current Update Tape Device Ver- Version Unit Address Device Inquiry sion State Old,New Status ---- ------- ------------------------ ---------------- ----------------- 0 0/1.0 Seagate STT8000A 5.51 Up to date 5.48,5.51 Success >>1 1/0.0 IBM ULTRIUM-TD1 09A1 Out of date 09A1,0BN1 FAIL 2 1/1.0 IBM ULTRIUM-TD1 0BN1 Up to date 3 1/13.0 SEAGATE AIT 04j9 Unrecognized device TAPEDRV8580 error: An inquiry error occurred after Flashing firmware. Firmware update status unknown. autock Command autosim Command The autock and autosim commands provide a means of testing both the character graphics interface and firmware file handling using simulated tape devices. A simulated tape device list is generated from [] data in tapedrv.ini. Both commands are similar to autoupdate in that inquiry strings are validated, and firmware file integrity is verified. If a log file is specified (using the -l [+] option), then WriteBuffer commands that would be used transfer firmware to tape devices are recorded in the log file. autock is meant for use in verification of firmware update CD-ROMs. To speed the verification, a 2 second delay is used between simulated device updates rather than the normal delay specified by [autoupdate] UpdateDelay. So that all firmware files can be tested, simulated DOS mode only updates are performed under Windows. autosim is meant for interactive testing of the user interface. autosim does not use the special conditions used by autock. autock and autosim accept all autoupdate options. Example: tapedrv autosim -p /drivemic list Command tapedrv list shows a list of tape unit and serial numbers. By way of example, tapedrv list might display the following output. Tape Device Unit Address [Vendor Product Revs] Type Serial Number ---- ------- -------------------------------- ---- ------------- 0 1.0/0.0 [Seagate STT3401A 310A] Tape TPT1090050 OEM Number: 000 1 2.0/1.0 [IBM ULTRIUM-TD1 12U2] Tape 6811050111 2 2.0/0.0 [HP C7200 140I] Changer US0MA00325 Tape Unit is a number assigned by tapedrv each time the program is run. Different invocations of tapedrv may have different Tape Unit values depending on changes in SCSI configuration. SCSI Address has the form: [.]/. Unit Serial Number gives the device's serial number as returned in Vital Product Data (VPD) page 0x80. OEM Number is a one to three digit value Seagate specific value that is used to identify firmware configurations. Tape Unit and Serial numbers may be used in the -t and/or -s options as tape drive selection criteria for the autoupdate, list, status, or inquiry commands. For example: tapedrv inquiry -t 1 Example: tapedrv list > list.txt listsim Command tapedrv listsim simulates the tapedrv list command without actually accessing a tape device. listsim generates a tape device list from device section data in tapedrv.ini. Serial numbers are device section names. listsim accepts all list options. status Command tapedrv status reports firmware status. It is useful for determining which devices are "Out of date". Only those devices that indicate Out of date in the Device Firmware State field would be updated by a tapedrv autoupdate command. Example output for tapedrv status: tapedrv -- IBM Tape Device Firmware Utility - v1.08.19 Copyright (c) 2000-2004 IBM Corporation Device Address: Controller_Number/SCSI_Device_ID.Logical_Unit_Number Tape Device Device Update Unit Address Device Inquiry Version Version Device Firmware State ---- ------- ------------------------ ------- ------- --------------------- 1 0/5.0 SEAGATE DAT 04106-XXX 7270 7550 Out of date More easily parsed information may be obtained using the -r option. For example, tapedrv status -r, might print the following. ##Tapedrv_status=1 tapedrv -- IBM Tape Device Firmware Utility - v1.08.19 Copyright (c) 2000-2004 IBM Corporation Device Address: Controller_Number/SCSI_Device_ID.Logical_Unit_Number Tape Device Device Update Unit Address Device Inquiry Version Version Device Firmware State ---- ------- ------------------------ ------- ------- --------------------- 0 0/5.0 SEAGATE DAT 04106-XXX 7270 7550 Out of date ##Device=0/5.0,Tape,SEAGATE DAT 04106-XXX,7270,7270,7550,9,Out of date ##FwStateUnrecognized=0 ##FwStateInaccessible=0 ##FwStateInUse=0 ##FwStateIgnored=0 ##FwStateCurrent=0 ##FwStateNewer=0 ##FwStateNeedsDOS=0 ##FwStateNeedsAlternate=0 ##FwStateOutOfDate=1 -r causes additional ## prefixed records to be added to the output stream. Each record is described below. ##Tapedrv_status= This is a signature record and is always the first ## prefixed record in the output. is a positive integer indicating the formatting version for the following ## entries. is currently 1 and may incremented if a subsequent change in format makes it necessary. ##Device=,, ,, ,, , Device records are only present if tape devices are found. Each device record represents a device and has the following comma separated fields: has the SCSI device address. is either Tape or Changer. always contains 24 characters which is the Inquiry data bytes 8 through 31 returned by the device. This includes the Vendor Identification field in the first 8 characters, and the Product Identification in the remaining 16 characters. always contains 4 characters which is the Inquiry data bytes 32 through 35, or Product Revision Level returned by the device. is variable in length and contains 0 through 4 characters giving the current device version. is variable in length and contains 0 through 4 characters giving the update version. That is, the version to which the device will be updated if out of date. Of these two fields, the first contains a positive integer value and the second the corresponding text describing the state of the device firmware. See Device Firmware States for a description of all possible values. ##FwStateUnrecognized= ##FwStateInaccessible= ##FwStateInUse= ##FwStateIgnored= ##FwStateCurrent= ##FwStateNewer= ##FwStateNeedsDOS= ##FwStateNeedsAlternate= ##FwStateOutOfDate= These counter records are always present and follow all ##Device= records, if any. They summarize the number of devices found in each possible state. Each record corresponds to one of the states in Device Firmware States. statussim Command tapedrv statussim simulates the tapedrv status command without actually accessing a tape device. statussim generates a tape device list from device section data in tapedrv.ini. An attempt is made to simulate each possible value for Device Firmware State field, statussim accepts all status options. Device Firmware States The table below defines Device Firmware States. tapedrv autoupdate will update only tape devices in the State 9: "Out of date". Device Firmware States State Description tapedrv status Counter 1 Unrecognized device ##FwStateUnrecognized= An "unrecognized device" is a device that is unsupported. That is, a tape or changer device for which there is no matching device section in tapedrv.ini. 2 Inaccessible device ##FwStateInaccessible= An "inaccessible device" is one that is recognized as being both present and supported, but cannot be accessed by the program. Under Windows NT/2000/XP/2003, an inaccessible device results when a tape or changer device device cannot be opened, using the CreateFile() system call, for a reason *other than* the "device is in use" (see state 3 Device in use), or the device can be opened, but an attempt to retrieved a vital parameter fails. 3 Device in use ##FwStateInUse= A "device in use" is one that is recognized as being both present and supported, but cannot be accessed by the program because another program is using the device. An attempt to open the device returns one the following system errors. Under Windows NT/2000/XP/2003 either: 32 (ERROR_SHARING_VIOLATION) The process cannot access the file because it is being used by another process, or 170 (ERROR_BUSY) The requested resource is in use. Under Linux: EBUSY Device busy 4 Ignored device ##FwStateIgnored= An "ignored device" state indicates the device is recognized but a determination cannot be made as to whether the device is up to date. That is, the device matches a device section in tapedrv.ini but the section has either a missing or empty AutoFileVersion parameter. 5 Up to date ##FwStateCurrent= An "up to date" device state indicates no firmware update is necessary. The device both matches a device section, in tapedrv.ini, and matches the AutoFileVersion parameter within the section. 6 Newer firmware ##FwStateNewer= A "newer firmware" device state means the device has firmware even more recent than the firmware required to be up to date. The command tapedrv autoupdate will not update the device. That is, the device matches a device section in tapedrv.ini but has firmware that is newer than the version specified by AutoFileVersion parameter within the section. 7 Needs DOS mode update ##FwStateNeedsDOS= A "Needs DOS mode update" state indicates a device is "out of date" but cannot be updated in the current operating system environment because the maximum SCSI Write Buffer data transfer size is of insufficient capacity to meet the requirements of the device. Write buffer data transfer capacity may be limited by the operating system, device driver, host bus adapter, or a combination of these elements. This state is possible under Windows 95/98/Me/NT/2000/XP/2003. Typically both DOS and Linux do not report this state. Currently this state is possible when the associated UpdateAlgorithm parameter, in tapedrv.ini is set to "seagate_dds1", "seagate_dds2_256k", or "seagate_travan". As a practical matter this applies only to: Seagate Travan TR-4 and TR-5 (not TR-7) tape drives. Seagate DDS-1/DDS-2 with either a .HEX or 256K .BIN firmware file. If possible, boot this machine under DOS (or Windows 95/98/Me in DOS command prompt only mode), or Linux, and run tapedrv autoupdate to update firmware. 8 Needs alternate update method ##FwStateNeedsAlternate= The "Needs alternate update method" state indicates the device cannot be updated by tapedrv autoupdate, but rather needs updating by an alternate method. Examples of alternate method update are 1) physical return of the device to a service center for "factory update" (perhaps ROM replacement), 2) update by a program other than tapedrv. As a practical matter, this state is not seen for all previous and the current (v1.08.19) versions of tapedrv. The "Needs alternate update method" state is defined in case recognition is subsequently added for a device that cannot be updated by tapedrv autoupdate. In order for a drive to be recognized as being in the "Needs alternate update method" state, the device must match a device section in tapedrv.ini and have a firmware version that is out of date when compared to the AutoFileVersion parameter within the device section, and have an empty or missing AutoFileName parameter. 9 Out of date ##FwStateOutOfDate= An "out of date" device state indicates that tapedrv autoupdate would update the device. That is, the device matches a device section in tapedrv.ini, has firmware that is out of date when compared to the AutoFileVersion parameter within the section, and has a non-empty AutoFileName parameter. inquiry Command inquiry prints a hexdump style display of both Inquiry data and Vital Product Data, for all detected tape devices. This command is useful for examining data used to construct the InquiryStdAscii, InquiryStdHex, VpdAscii, and VpdHex parameters in tapedrv.ini. Because of memory restrictions, inquiry is unavailable in 16-bit DOS mode. Example: tapedrv inquiry > inquiry.txt inick Command inick checks certain parameters within tapedrv.ini []s for validity. Errors are printed to the standard output. Because of memory restrictions, inick is unavailable in 16-bit DOS mode. Using inick reduces the likelihood of failure in the the field because of a syntax error in tapedrv.ini. For each [] listed in the [tapedrv] device list, the following parameters are checked; InquiryStd pattern is checked to see whether it represents a 28 character "VENDOR PRODUCT-NAME REVS" inquiry string. InquiryStdAscii, InquiryStdHex, VpdAscii, and VpdHex, if present, are checked for validity. UpdateAlgorithm is verified to contain a recognized algorithm. AutoFileName is checked to see if the firmware file is present. If the firmware file is present, it is further checked, against the UpdateAlgorithm's image checking constraints, if any. For example, many UpdateAlgorithms have firmware image size and content constraints. Example: tapedrv inick -p \drivemic > error.txt msgck Command msgck checks tapedrv.msg message numbers for duplicates and sequence. Because of memory restrictions, msgck is unavailable in 16-bit DOS mode. This utility command examines tapedrv.msg. Duplicate, out of sequence, excessively long messages, and messages for which there is no comparable number in an alternate language are reported. msgck errors are formatted as follows: .../tapedrv.msg(): : Where is one of the following: Excessive length Message is too long (approaching 2K in length). Duplicate Message number duplicates a previous number. Message numbers must be unique. Sequence Message number is less than previous message number. Message numbers should be in sequence. Warning: entry message number save buffer full The buffer tapedrv msgck uses for saving numbers for number checking is full. tapedrv.c needs to be modified. updatealg_list Command updatealg_list prints a list of update algorithms. Example: tapedrv updatealg_list updatealg_attr Command updatealg_attr prints a list of update algorithms and their attributes. Example: tapedrv updatealg_attr > upattr.txt tapedrv.ini Syntax tapedrv.ini is a mandatory file that contains initialization information and other data. A primary function of tapedrv.ini is to specify parameters used for tape device recognition and firmware file correspondence. At initial program load, tapedrv attempts to open and read tapedrv.ini from the following places in order given: First in the current directory, then the -p option, if given, and finally the directory from which tapedrv was loaded. tapedrv.ini may be modified with any text editor. There are three types of lines in tapedrv.ini: comment, section, and parameter. Comment lines begin with a semicolon (;). Example: ; this is a comment line Section lines mark the beginning of a group of parameters and are enclosed in brackets ([]). For example, the following marks the start of the tapedrv global initialization section: [tapedrv] Parameter lines are of the form =. By way of example, the following parameter shows where a firmware file may be found: AutoFileName = v8???000.bin Section and parameter names are case insensitive. Parameter Values Parameter values in the .ini are generally treated as lists of comma separated strings. For example string1,"string2" , string3 For most parameters, only the first string in a list is significant. Thus, for most parameters, strings beyond the first are ignored. Each string in a list, may be an unquoted, quoted, or a combination. For unquoted strings, leading and trailing white space is stripped. White space and commas within matching quotes are preserved. Unquoted and quoted strings, between commas, are concatenated. For example, the input string text string "a", b, " c,d" e "fg", "z",, is the same as the six comma separated string list "a", "b", " c,defg", "z", "", "" In order for a string to contain a literal comma (one that is not a string list separator), the comma must either appear between matching double quotes ("xx,yy") , or be escaped using a grave accent (xx`,yy). A literal double quote is represented using a grave accent (`"). A double grave accent (``) represents a literal grave accent. For example the input a b`, c is taken as the single string "ab,c" ASCII Patterns String values for InquiryStd and AutoFileName are patterns. Patterns are matched with actual strings returned by the SCSI Inquiry command or by system file directory services. A pattern is an ASCII string that may contain the control characters: ` [ ? * { A pattern containing control characters may be capable of matching more than one actual string. Filename patterns are case insensitive. Other patterns are case sensitive. Control characters are described in order precedence, highest first: ` Escape, (a grave accent) disables the special meaning (if any) of the character following (if any) so that it can be matched literally rather than being taken as a pattern control. Use a double grave accent (``) to match a single grave (`). The notation "`?" says match "?" literally. [characters] Matches a single character with any in list of characters enclosed by brackets. A pair of characters separated by a "-" additionally matches any of the characters lexically between the two. Empty brackets ([]) and any unbalanced brackets are taken literally. The notation [ac-e] matches a c d or e. The notation [-ac-e{}?*`;``] matches - a c d e { } ? * ; or ` ? Matches any single character. * Matches any string including an empty string. The notation a*?[bd-x]z says match a string beginning with a, followed by zero or more undefined characters, and ending with three characters, the first being any single character, the second being either b, or d through x, and the final being z. {pat1,pat2} Braces enclosing at least one comma, specifies a comma separated list of patterns. Braces may be nested. A final unbalanced {, or any unbalanced }, is taken literally. The notation {a,bc} is shorthand for a, or bc. The notation a{,b{c,de},{f}}g is shorthand for ag, abcg, abdeg, or a{f}g. When directory separators are used in filename patterns, the forward slash, /, is preferred for compatibility with both Windows and Linux. Wild cards are disallowed for logical drive names (e.g., X:), and directory separators. tapedrv.ini [tapedrv] Section The [tapedrv] section contains global initializations for tapedrv. magic= magic is used for file format verification. ide_search_length= This parameter controls the number of IDE adapters to search starting with ide0_*. ide_search_length is only meaningful in 16-bit DOS mode. When ide_search_length=2, then ide0_* (the Primary IDE adapter) is searched first, ide1_* (the Secondary IDE adapter) is searched second, and ide2_* and ide3_* are ignored. ide[0-3]_port= ide[0-3]_irq= These parameters configure the IDE host adapter's I/O port address and IRQ. They are only meaningful in 16-bit DOS mode. devices= device parameters, where is 00 through 99, lists the names of each [] that follows. Any device section name not present within this list is ignored. During program initialization, all devices are read in in order from devices00 through devices99. The special name, EndOfDevices, may be used to terminate the device section names list and improve initialization tapedrv.ini [autoupdate] Section An [autoupdate] section has parameters used during execution of the autoupdate command: UpdateDelay = gives the count down delay before device update. SkipDelay = gives the count down delay before an unupdatable device is skipped. FinalDelay = gives the count down delay after the final status display and before program exit. tapedrv.ini [] Sections Each supported tape device has its own [] In order to be used, a given [] must be mentioned as a devices = entry in the [tapedrv] section. A [] has the following parameters: Description = "" Description is optional. It has information that is printed by the scan command when a tape device is recognized. Example: Description = "IBM Hornet-8 SCSI TR-4" ReferenceName = "" ReferenceName is optional. If present, it gives a product reference name that may be used in building lists such as a supported tape devices list. Example: Description = "120/240GB SP DDS4 Autoloader" InquiryStd = ":" InquiryStd gives a string used to detect the make and model of the device associated with the device section. It consists of two strings separated by a ":". has a string indicating which peripheral device type to match. The peripheral device type is a 5-bit binary field at Inquiry data byte 0, bits 4..0. Recognized ASCII values and binary mappings for are: ASCII Binary Tape 1 Changer 8 is an ASCII Pattern string that is compared against the ASCII field of standard Inquiry data returned by the device. Where the ASCII field is 28 character contiguous field beginning at byte 8 and includes the Vendor Identification, Product Identification, and Product Revision Level fields. s are case sensitive. Examples: InquiryStd = "Tape:CONNER CTT8000-S 3???" InquiryStd = "Changer:HP C7145 ????" InquiryStd = "Tape:{SEAGATE DAT ,ARCHIVE Python} 04106-XXX[73]???" InquiryStdAscii = ":" InquiryStdHex = ":" InquiryStdAscii and InquiryStdHex may optionally be used to extend the matching of standard Inquiry data into the vendor specific data area (beyond byte 36). These parameters are used only after Inquiry data matches the InquiryStd parameter in the same []. InquiryStdHex is useful for identifying a Firmware Personality byte often kept in byte 41 of Inquiry data. When the InquiryStdHex parameter is specified, all available standard Inquiry data (up to 255 bytes) is retrieved from the device. Then, the actual number data bytes read is converted into an ASCII hexadecimal string. This hex string is then used as the target of InquiryStdHex pattern matching. InquiryStdAscii and InquiryStdHex values consists of an integer and a string separated by a ":". is an integer value, in the range 0 through 254, giving the byte offset in the Inquiry data at which to begin or matching. For example, 41 if we are interested in data starting at byte offset 41 of Inquiry data. This number may be expressed as decimal, hexadecimal (with an 0x prefix), or octal (with a 0 prefix). An empty is erroneous. is an ASCII Pattern string that is compared against the ASCII Inquiry data returned by the device. The final character in should be a '*' when the remainder of Inquiry is not of interest. Pattern matching is case sensitive. is an ASCII Pattern string using characters from the set *?[-]{}0123456789ABCDEFabcdef. A is compared against Inquiry data after the data is converted from binary to a hexadecimal ASCII string called the target string. Pattern matching begins at in the target string. Often the final character in is an '*' when the remainder of the data is not of interest. Pattern matching is case insensitive. For example, if a device returns the following 56 bytes of Inquiry data: 0: 01 80 02 02 33 00 00 38 51 55 41 4e 54 55 4d 20 ....3..8QUANTUM 16: 44 4c 54 37 30 30 30 20 20 20 20 20 20 20 20 20 DLT7000 32: 32 35 36 30 71 60 00 07 32 0f 01 00 00 3f 00 00 2560q`..2....?.. 48: 00 00 00 02 41 30 30 33 ....A003 The the data is converted to the following 112 character ASCII hexadecimal string (in actuality, all on one line): "01800202330000385155414e54554d20 444c5437303030202020202020202020 3235363071600007320f0100003f0000 0000000241303033" Using the parameter InquiryStdHex = "41:0f*" specifies that Inquiry byte 41 must be a 0f hexadecimal. Using InquiryStdHex = "41:[0-4]???{05,3c,99}*" specifies that byte 41 must be in the range 00 through 4f, and byte 43 must be either 05, 3c, or 99. InquiryStdHex Examples: InquiryStdHex = "41:04*" For Quantum OEM personality InquiryStdHex = "41:0f*" For Quantum OML personality InquiryStdHex = "41:12*" For Quantum OMX personality VpdAscii = "::" VpdHex = "::" VpdAscii and VpdHex specify Vital Product Data (VPD) to match. VpdAscii is useful for matching ASCII data, and VpdHex is useful for matching binary data. These parameters are optional. When one or both are present, they further qualify a device whose standard Inquiry data matches the InquiryStd parameter in the same []. When these parameters are given, they cause the entire VPD page (upto 255 bytes) to be retrieved for the given VPD page number. VpdAscii and VpdHex parameter values consists of three fields separated by colons (":"). is an integer value, in the range 0 through 255, giving the Inquiry Vital Product page number whose data is to be matched against the pattern data. This number may be expressed as decimal, hexadecimal (with an 0x prefix), or octal (with a 0 prefix). For example 193, 0xc1, and 0301 specify the same page. An empty field is erroneous. is an integer value, in the range 0 through 254, giving the byte offset in the VPD data at which to begin or matching. For example, 41 if we are interested in data starting at byte offset 41 of VPD data. This number may be expressed as decimal, hexadecimal (with an '0x' prefix), or octal (with a '0' prefix). An empty is erroneous. is an ASCII Pattern string that is compared against the ASCII VPD returned by the device. The final character in should be a * when the remainder of VPD is not of interest. Pattern matching is case sensitive. is an ASCII Pattern string using characters from the set *?[-]{}0123456789ABCDEFabcdef. A is compared against VPD after the data is converted from binary to a hexadecimal ASCII string called the target string. Pattern matching begins at in the target string. Often the final character in is an '*' when the remainder of the data is not of interest. Pattern matching is case insensitive. VpdAscii Example: VpdAscii = "3:12:PIE[0-2]*" says for VPD page 3, byte offset 12, match any ASCII string that begins with PIE0, PIE1, or PIE2. VpdHex Example: VpdHex = "0xc0:10:2f*" says for VPD page 0xc0, byte offset 10, match the binary byte value 2f. InquiryCFR_OEM = "<1 to 3 digit oem number>" This optional parameter is needed for certain Seagate DAT drives. It further qualifies a device whose standard Inquiry data matches the InquiryStd parameter in the same []. When InquiryCFR_OEM is specified, then the Seagate Controller Firmware Revision (CFR) VPD Inquiry page (0xc0) is retrieved from the drive. The 1 to 3 digit OEM field (skipping the - prefix), contained within the CFR page is compared with an ASCII Pattern given by the parameter value. Examples: InquiryCFR_OEM = "0" InquiryCFR_OEM = "547" InquiryCFR_OEM = "{000,400}" AutoFileName = "" AutoFileName gives name of the firmware file with which to update an out-of-date device. If a -p is specified on the command line, then is prefixed to . is an ASCII Pattern. The pattern must represent a unique filename. If AutoFileName is empty or missing from a device section, and and a device is found to be "out of date" (when compared with AutoFileVersion), then Tapedrv reports the device state as "Needs alternate update method". That is, the device needs to be updated by a method other than using tapedrv autoupdate. Examples: AutoFileName = "1234.img" AutoFileName = "ti4s?3??.fls" AutoFileVersion = "<4-character version>" AutoFileVersion gives the version (or Product Revision Level) that would be returned by the device, in the 4-bytes, beginning at byte 32 of SCSI Inquiry data, after the firmware file, given by AutoFileName, is transferred and saved in the device's EEPROM. When any of the 4 characters has the special character "?", it is substituted with the corresponding version character currently present in the device. If AutoFileVersion is missing or has an empty string, than the drive is displayed as Ignored device. Any non-empty <4-character version> having less than 4-characters is right padded with ? to 4 characters. To assure correct New version display, "?" must be used when both these conditions occur: 1) the character will not change as a result of the update, and 2) the character is not "fixed" based on the make and model. For example for a Quantum DLT4000, the first and second characters indicate the "servo code level". The servo code level is neither altered by firmware update, nor fixed for the make and model. The third and fourth characters indicate the "firmware code level" and are altered by firmware update. Thus, for the DLT4000, if AutoFileName represents version 45 firmware, then set AutoFileVersion to the string, "??45". Examples: AutoFileVersion = "??10" AutoFileVersion = "1.AB" CompareControl = "" CompareControl controls the comparison of the device version (or 4-character Product Revision Level) with that of the file version given by the AutoFileVersion parameter. is a 1 to 4 digit string with each digit being a unique selection from the list 0 1 2 or 3. Characters other than 0 1 2 or 3 are ignored. specifies both the byte offsets of, and significance of version character comparison. That is, the value of each digit is a byte offset in the 4-digit version, while the order of the digits gives the significance of the compared version digits, with the left most digit being the most significant. Version comparisons are case insensitive. For example if is "3210", all 4 characters of the version are compared in reverse order from right to left. If is "23", than only the final 2 characters of the version are compared from left to right. The string "??23" is identical to "23" because "??" is ignored. If CompareControl is missing or has an empty string, or contains no valid characters then the default value, "0123", is used. ReplaceVersion = <4-character firmware version> ReplaceVersion allows downgrading to older firmware. ReplaceVersion expresses one or more 4-character device reported firmware versions as a case sensitive ASCII Pattern. When a given device reports a firmware version that matches that specified by ReplaceVersion, then that device is considered "Out of date". As a result. autoupdate transfers the firmware specified by AutoFileName regardless of firmware file's version given by AutoFileVersion. Examples: ReplaceVersion = "24L5" ReplaceVersion = "{24L[5-9],24M?}" UpdateAlgorithm = "" UpdateAlgorithm selects the used to update the tape device firmware and must be one of the following: "" Tape Device "standard" Standard tape or changer "exabyte_mammoth" Exabyte Mammoth "exabyte_vxa" Exabyte VXA-2 "seagate_travan" Seagate Travan TR-4, TR-5 "seagate_tr7" Seagate Travan TR-7 "seagate_dds1" Seagate Piranha, Perigrine DDS-1, DDS2-2 "seagate_dds2_256k" Seagate Scorpion DDS-1, DDS-2 w/ 256K EEPROM "seagate_dds2_512k" Seagate Scorpion DDS-1, DDS-2 w/ 512K EEPROM "seagate_dds3" Seagate DDS-3 "seagate_dds4" Seagate DDS-4, DAT-72 "quantum_dlt" Quantum/Benchmark DLT (w/ 4KB fw transfers) "quantum_dlt_8k" Quantum/Benchmark DLT (w/ 8KB fw transfers) "ibm_ultrium" IBM Ultrium "ibm_library" IBM Library "hp_ultrium" HP Ultrium "hp_library" HP Library/Autoloader A list of update algorithm attributes is displayed by the command. tapedrv updatealg_attr. UpdateFlags = "" is a string of case significant flags that control firmware update behavior for an associated device. Meaning c Skip post firmware update inquiry verification if supported Changer is detected. Z Write firmware to LUN 0 of same SCSI Device ID. Example: UpdateFlags = "cZ" UpdatePrepare = "" [ , "" ... ] A list of preparation commands is sent to a tape device before commencing firmware update. Some tape devices do not permit firmware update while media is loaded. Often, tape devices are prepared by ejecting media first. UpdatePrepare gives a preparation command list that overrides the default list. The default list is UpdateAlgorithm dependent. To be effective, an UpdatePrepare parameter must specify one or more valid preparation commands. Each command is executed in the order given. To disable sending any preparation commands, use UpdatePrepare = "NoOp" Description Device type Rewind Rewinds tape Tape Unload Unloads tape Tape InitElementStatus Scans tape slots Changer NoOp No operation All Note: InitElementStatus may also be sent to the Tape device on certain integrated autoloaders (e.g., Seagate DAT). Example: UpdatePrepare = "NoOp" UpdatePrepare = "Rewind", "Unload" UpdateSeconds = gives a maximum number of seconds required to update firmware. If is too small, a firmware update error may be erroneously reported. The default value is 120. Note that, on the display, the operator sees a message similar to Update will take up to minutes where is derived by rounding up the nearest minute. The minimum displayed value for is 2. Example: UpdateSeconds = 45 WriteBufferID = WriteBufferID overrides the default Buffer ID byte (the third byte -- CDB[2]) value of SCSI Write Buffer commands used to transfer firmware. is an integer, in the range 0 through 255 (0x00 through 0xff). Example: WriteBufferID = 0x01 tapedrv.ini Example ; tapedrv.ini -- tapedrv initialization ; ; ide_search_length= ; This parameter controls the number of IDE adapters to search ; starting with ide0_*. ; When ide_search_length=2, ide0_* (the Primary IDE adapter) is ; searched first, ide1_* (the Secondary IDE adapter) is searched ; second, and ide2_* and ide3_ are ignored. ; ide[0-3]_port= ; ide[0-3]_irq= ; [tapedrv] magic = 0x5400 ide_search_length=2 ide0_port=0x1f0 ide0_irq=14 ide1_port=0x170 ide1_irq=15 ide2_port=0x1e8 ide2_irq=11 ide3_port=0x168 ide3_irq=10 devices00 = IBM_Ultrium-TD1_SCSI devices01 = Seagate_Scorpion-40 devices02 = EndOfDevices [autoupdate] UpdateDelay = 25 SkipDelay = 5 FinalDelay = 25 [IBM_Ultrium-TD1_SCSI] Description = "IBM Ultruim-1" InquiryStd = "Tape:IBM ULTRIUM-TD1 ????" AutoFileName = "0BN1.fmr" AutoFileVersion = "0BN1" UpdateAlgorithm = "ibm_ultrium" UpdateSeconds = 121 [Seagate_Scorpion-40] ; Switch 7 On=SEAGATE..., Off=ARCHIVE... ; Scorpion-40 and Scorpion-240 use same file Description = "Seagate Scorpion-40 DDS-4: STDx401LW" InquiryStd = "Tape:{SEAGATE DAT ,ARCHIVE Python} 06240-XXX8???" AutoFileName = "v8???000.bin" AutoFileVersion = "8160" CompareControl = "?123" UpdateAlgorithm = "seagate_dds4" UpdateSeconds = 60 tapedrv.msg Syntax tapedrv.msg contains messages used by the tapedrv program. The message file is a text file which has message entries and comments. Each message entry consists of a message number and a message string. Message numbers are positive hexadecimal integers. Message strings are similar to strings in the C programming language. Each message string is double quoted. Multiple quoted strings are concatenated. That is, "string1" "string2" is the same as "string1string2". With in a message string, certain escape sequences are recognized. Escape sequences begin with a Backslash (\). Escape Sequence Meaning \a Alert (bell) \b Backspace \f Form feed \n Newline \r Carriage return \t Tab \v Vertical tab \\ Backslash (\) \" Double quote (") \ is a one through three digit octal number in the range 0 (or 000) through 377 octal (equivalent to 255 decimal) representing an ASCII code. For example, \101 is the same as the A character, and \40 or \040 is the same as the SPACE ( ) character. Two types of comments are recognized, the double slash (//) and the traditional C language style slash-star star-slash (/**/). A double slash (//) opens a comment which continues until end of line. For example: // This is a double slash comment A slash-star star-slash (/**/) comment is opened by a slash-star (/*) and continues, possibly for several lines, until closed by a star-slash (*/). For example: /* This is a slash-star star-slash comment */ tapedrv.msg Special Messages 0020 "" must agree with the version stored in the tapedrv executable. For example, 0020 "1.08.19" tapedrv.msg Runtime Error Checking Each time tapedrv is invoked, it performs certain checks on the message file. The syntax of the tapedrv.msg is checked. If there is an error in syntax, one of following errors are shown: .../tapedrv.msg(): Message file syntax error: Message number to large Unexpected end-of-file in c-string Unexpected end-of-file in comment begun on line '': Unquoted character tapedrv also checks tapedrv.msg for a special version message, message number 20, and may show one of these errors: ".../tapedrv.msg": Version message (20) not found ".../tapedrv.msg": Incorrect message file version For most messages, when tapedrv cannot locate a given message number, one of these errors is shown: ".../tapedrv.msg": : Message not found See also msgck Command. tapedrv Executable For DOS/Windows, tapedrv.exe contains two program images -- a 16-bit DOS program called tapedrv16, and a 32-bit Win32 Intel platform program called tapedrv32. One of the two images is selected by the OS loader at runtime. tapedrv16 executes in MS-DOS, or Windows 95/98/Me when booted in MS-DOS Only mode. The Video BIOS (int 10) API is used for screen updates. tapedrv32 executes in Windows 95/98/Me in Graphics (normal) mode, or Windows NT 3.51/NT 4.0/2000/XP/2003. The Win32 Console I/O API is used for screen updates. For Linux, a platform specific executable, tapedrv.linux.. is the name of a platform architecture. For example, i386 or ia64. The curses library is used for screen updates. Early during program initialization, a device enumeration phase is executed. The enumeration phase constructs a list of tape devices. When the 'autoupdate' command is given, a second phase steps through the list of tape devices and updates each 'Out of date' device with firmware from files specified in tapedrv.ini. Interfaces Used for Accessing Tape Devices tapedrv16, accesses SCSI tape devices via the DOS ASPI driver. The ASPI driver must have been loaded from CONFIG.SYS during boot. For ATAPI Travan drives, tapedrv16 finds and accesses the drives using a built-in ATAPI/IDE ASPI driver (no DOS ASPI driver is required for ATAPI Travan drives). Note: Tapedrv cannot access Travan ATAPI tape drives while running Windows 3.1x (you must exit from Windows 3.1x to DOS.) tapedrv32, when running in Windows 95/98/Me in Graphics mode, finds and accesses both SCSI and ATAPI tape drives via \system\WNASPI32.DLL. WNASPI32.DLL provides a 32-bit ASPI interface and should be present in all Windows 95/98/Me installations. tapedrv32, when running in Windows NT 3.51/NT 4.0/2000/XP/2003, access both ATAPI and SCSI tape device by the OS provided SCSI Pass Through Interface (SPTI). Tape devices may be either "Claimed", by a Tape/Changer Class driver, or "Unclaimed". For all unclaimed tape devices the SPTI is via a SCSI Port driver. For each claimed tape device, SPTI is via its associated Tape/Changer Class driver. tapedrv.linux finds devices using information from /proc/scsi/scsi and updates firmware using services of the SCSI Generic interface provided by scsi generic /dev/sg* devices. Finding Tape Drives via ASPI 16/32 When using the ASPI 16 or 32-bit interfaces, tapedrv16/32 constructs a list of tape devices by first requesting ASPI to return the number of host adapters present. Then for each possible SCSI target ID (device address) on each host adapter, Tapedrv sends a SCSI Inquiry command via ASPI. For each successful Inquiry command, Tapedrv passes control to an enumeration algorithm. If the enumeration algorithm examines the device, and if it qualifies, it is added to a tape device list. Finding Tape Drives In Windows NT/2000/XP/2003 tapedrv32, when running on Windows NT/2000/XP/2003, finds ATAPI and SCSI tape devices by opening and querying each SCSI Port driver for a list of SCSI devices attached to the port (a.k.a. host adapter). SCSI port drivers are found by searching the registry for each key -- My Computer\HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\Scsi Port . For each key found, the 'DeviceName=' entry (e.g., DeviceName="Scsi0:") is read and used to construct a filename (e.g., "\\.\Scsi0:") and the Port driver is opened (e.g., CreateFile("\\.\Scsi0:",,,,,)). Once the port driver is opened, DeviceIoControl(,IOCTL_SCSI_GET_INQUIRY_DATA,,,,,) is used to read a list SCSI bus entries. where each bus entry contains a list of SCSI devices. Each device entry contains a DeviceClaimed flag, TargetId, Lun, and SCSI InquiryData. In a device entry, the first byte of InquiryData (the Peripheral Device Type) tells whether its a Tape device. If the DeviceClaimed flag is clear, then the Port driver can be used to access the device using the SPTI. Otherwise, when DeviceClaimed is set, then the "claiming" Tape or Changer Class driver needs to be used. The Class driver's filename (for example "Tape1") is found by using the in information collected above to build a registry path to the Logical Unit key in order to locate the "DeviceName" entry. This key has the form -- My Computer\HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\ Scsi Port \Scsi Bus \Target Id \Logical Unit Id When the Logical Unit key is found, then 'DeviceName=' entry (e.g., DeviceName="Tape0:") is read and used to construct a filename (e.g., "\\.\Tape0") and the Tape Class driver is opened (e.g., CreateFile("\\.\Tape0:",,,,,)). Once the Tape driver is opened, SCSI commands are sent to the tape device via the SPTI DeviceIoControl(,IOCTL_SCSI_PASS_THROUGH_DIRECT,,,,); Finding Tape Drives under Linux tapedrv.linux opens and parses /proc/scsi/scsi for tape devices. Each device that has the type "Sequential-Access", or "Medium Changer" is added to a tape device list. An example /proc/scsi/scsi: Attached devices: Host: scsi0 Channel: 00 Id: 01 Lun: 00 Vendor: ARCHIVE Model: Python 06240-XXX Rev: A00U Type: Sequential-Access ANSI SCSI revision: 03 Device Enumeration During enumeration, device Inquiry data is examined for each ATAPI and SCSI device. The device's standard Inquiry data, (meaning the Peripheral Device Type in byte 0 and the 28-character inquiry string at byte 8) are compared with each []'s InquiryStd parameter. For example: InquiryStd = "Tape:SEAGATE DAT 02779-XXX6???". If there is an InquiryStd match, then all other qualification parameters -- InquiryStdAscii, InquiryStdHex, VpdAscii, VpdHex, and InquiryCFR_OEM -- if present in the same [] are compared with values returned by the device. Exit Codes On exit, tapedrv autoupdate returns one of the following codes: Exit Code Description 0 Tape device successfully updated One or more supported tape drives and/or medium changers was identified, and one or more of these devices required a firmware update. All devices requiring so were successfully updated. 1 Tape device update failure One or more supported tape drives and/or medium changers was identified, and one or more of these devices required a firmware update. However, at least one device failed to be updated. 2 No supported tape devices found No supported tape drive nor supported medium changer was identified. However an unsupported tape drive may be present. 3 Tape device already up to date One or more supported tape drives and/or medium changers was identified. None of these devices required a firmware update. 4 Unrecoverable error unrelated to the tape device These errors include - Invalid or corrupt firmware file - Insufficient memory 5 Operator canceled automatic update 6 Tape device needs update by an alternate method One or more tape drives and/or medium changers was found to have out-of-date firmware. However, this program is incapable of updating the device. An alternate method of update is required. Alternate methods may include update using a different program, replacement of an EEPROM, or factory update. 7 Tape device needs update in DOS only mode A tape drive or medium changer was found to have out-of-date firmware. However, this program can only update the firmware while booted in DOS only mode. Firmware cannot be updated from either Windows 95/98/Me in graphics mode or from Windows NT/2000/XP. 8 Tape device in use by another program A tape drive or medium changer was either partially or fully recognized from Windows NT/2000/XP registry. However, the device cannot be opened because it is in use by another program. 9 Tape device is inaccessible A tape drive or medium changer was either partially or fully recognized from Windows NT/2000/XP registry. However, the device is inaccessible. Typical causes for inaccessibility are either a device driver is not installed or is disabled. This exit code is also reported if a device failed to open for a reason other than "device in use". tapedrv autoupdate exit code priority from highest to lowest 1, 4, 5 1:Tape device update failure 4:Unrecoverable error unrelated to the tape device 5:Operator canceled automatic update 8 8:Tape device in use by another program 7 7:Tape device needs update in DOS only mode 6 6:Tape device needs update by an alternate method 9 9:Tape device is inaccessible 0, 2, 3 0:Tape device successfully updated 2:No supported tape devices found 3:Tape device already up to date On exit, tapedrv status returns one of the following codes: Exit Code Description 0 Tape status successfully reported 4 Unrecoverable error making it impossible to report status Tapedrv Errors The following lists tapedrv errors with additional commentary. TAPEDRV8010 error: "": Out of memory Comment: There is likely a programming error in tapedrv. Contact technical support. TAPEDRV8110: No IDE adapter found. TAPEDRV8111: The DOS ASPI Manager was not found. TAPEDRV8112: No IDE adapter found, and the DOS ASPI Manager was not found. Comment: If you have an ATAPI/IDE tape device and the message says "No IDE adapter found", verify that the appropriate IDE channel is enabled in the BIOS setup. If you have a SCSI tape device and the message says DOS ASPI Manager was not found", and you are booting from floppy or hard disk, you may need to install a a DOS ASPI driver for the host adapter. A line similar to the following should appear in the CONFIG.SYS that resides on the floppy or hard disk from which DOS boots: DEVICE= An ASPI driver is usually supplied by the manufacturer of the SCSI host adapter (controller). Consult your SCSI host adapter manual for information on the ASPI driver. The Windows 98/Me Startup Diskette is pre-configured with ASPI drivers that support popular SCSI host adapters. TAPEDRV8113: The Windows 95/98/Me ASPI Manager was not found. Comment: Normally all Windows 95/98/Me installations include an ASPI Manager, thus the Windows installation may be corrupt. Try rebooting in DOS only mode. If you have a SCSI tape device, you will need to have a DOS ASPI manager driver configured. See TAPEDRV8111 comment. TAPEDRV8115: No [ATAPI/IDE or SCSI/FC] host adapters found. Comment: You may need to install an ATAPI/IDE or SCSI/FibreChannel driver for the host adapter (also called a controller) to which the tape device is attached. For NT 4.0, click Start -> Settings -> Control Panel -> SCSI -> Drivers If you see that an adapter driver is installed but not started, then the driver is, likely, not recognizing the tape device. In this case, check the hardware installation (see comment after TAPEDRV8530). For Windows 95/98/Me/2000/XP/2003, check for the existence of an ATAPI/IDE or SCSI/FibreChannel controller in the Device Manager by right clicking on My Computer -> Properties then selecting the Device Manager tab, or the Hardware tab and Device Manager button. If the controller, to which the tape device is connected, is not present, use Start -> Settings -> Control Panel -> Add/Remove Hardware to detect and install a driver for the controller. TAPEDRV8116 error: "/proc/scsi/scsi": Proc file open error: Comment: You may need to install a SCSI driver. TAPEDRV8130 error: []: "": File find error: Pattern syntax: Missing ] Pattern syntax: Missing } Insufficient stack memory File not found Filename not unique Comment: These errors indicate a failure to match or locate a file during an autoupdate operation. Typical causes of these errors include: An incorrect AutoFileName = in the named device section of tapedrv.ini. Multiple filenames match the . An invalid value for the -p option on the command line. The firmware file is missing. TAPEDRV8140 error: "": Firmware file open error: TAPEDRV8142 error: "": Firmware file read error: Comment: Possible causes for these errors include: The file is missing. Another process has opened the file for exclusive access. The file does not have read permission. The file or filesystem is corrupt. TAPEDRV8150 error: (): Hexfile record error: TAPEDRV8160 error: (): Hexfile syntax error: TAPEDRV8170 error: "": Firmware signature invalid TAPEDRV8180 error: "": Firmware image size = bytes: Invalid image size Comment: The firmware file may be corrupt. Obtain a new copy of the firmware file intended for your tape device model then try again. TAPEDRV8190 error: "": Firmware image size ( bytes) does not match device requirement ( bytes) Comment: The firmware file image is either to small or too large for the EEPROM. The file may be misnamed or corrupt. Obtain a new copy of the firmware file intended for your tape drive model then try again. TAPEDRV8200 error: Insufficient memory for K transfer buffer TAPEDRV8201 error: Insufficient memory for K transfer buffer (additional K needed) Comment: If using MS-DOS, Windows 3.1x or, Windows 95/98/Me in MS-DOS only mode, you may need to remove (or comment out) unnecessary drivers and/or "terminate-and-stay-resident" (TSR) programs from CONFIG.SYS and AUTOEXEC.BAT to increase available memory for tapedrv. TAPEDRV8210 error: Cannot update this device's firmware in Windows 95/98/Me Graphics mode (Within a DOS Box). Reboot your system into MS-DOS only mode. TAPEDRV8220 error: Cannot update this device's firmware from Windows NT/2000/XP/2003. Use MS-DOS or Windows 95/98/Me in MS-DOS Only mode. Comment: Tape device update require a Write Buffer data transfer with transfer size that exceeds the capability of Windows. Tape device update should be successful when the system is booted in DOS mode. TAPEDRV8270 error: Tape device inaccessible: Device cannot be accessed via either a class driver or a SCSI port driver. A class driver cannot be accessed as there is no 'DeviceName' in the registry. Possible causes: Tape or changer device driver not installed, device service disabled, or device driver failed to load. Comment: For a given tape device, that was found to be attached to a SCSI port, and marked as "claimed by a Windows class driver", the DeviceName, by which the class driver is accessed, can not located through an examination of the registry. To recover, use Device Manager to remove the tape device, then use Device Manager's "Scan for hardware changes" rescan for the tape device. Then try firmware update again. TAPEDRV8272 error: Tape device inaccessible: Can't open device "": Comment: Some other process may be using the tape device. This includes a backup application, diagnostic, agent, service, another instance of the firmware update program, or some other process. The process must be located and terminated to make the tape device accessible. On Windows 2000/XP/2003, for a Library, Removable Storage Manager (RSM) may be using the Medium Changer component of the Library. One way to stop (or start) RSM is by way of the Service Control Manager: Right click "My Computer", then select Manage. In Management Console, open the tree Services and Applications -> Services. In Services, locate and right click "Removable Storage Manager", then select Start, Stop, or Restart as appropriate. Another way to stop or start the RSM service is by way of command prompt using the NET.EXE command. For example: C:\> net stop ntmssvc C:\> net start ntmssvc On Windows you may be able to locate the process using to open the task manager and examining the task list or running processes list. On Linux, you may be able to locate the process that has the device open using the command: # ps -efl | fgrep Setting the run level to single user mode by # telinit 1 might close any backup agent or other process that is using the tape device. TAPEDRV8274 error: Tape device inaccessible: "": Get parameters: TAPEDRV8276 error: Tape device inaccessible: "": SCSI Input/Output: Comment: There is likely a programming error in TAPEDRV. Contact technical support. TAPEDRV8310 error: Tape drive re-select failure: TAPEDRV8320 error: Tape drive re-inquire failure: Current inquiry data: [] Expected inquiry data: [] TAPEDRV8330 error: Tape device is not responding: Firmware update not started. TAPEDRV8340 error: Device communication error: Too many Unit Attentions: Firmware update not started. TAPEDRV8350 error: Device communication error: Unexpected sense key: Firmware update not started. Comment: Verify that tape drive cables are securely connected. See TAPEDRV8530 comment. TAPEDRV8360 error: Timeout waiting device to become stable: Firmware update not started. Comment: When updating a medium changer, try inserting a tape in the first storage slot before running update procedure. Verify that tape drive cables are securely connected. See TAPEDRV8530 comment. TAPEDRV8410 error: []: UpdateAlgorithm "": Unrecognized or missing Comment: The UpdateAlgorithm parameter, for the named device section in tapedrv.ini, needs to be edited. TAPEDRV8510: A [ATAPI/IDE, SCSI/FC] tape device was NOT found. TAPEDRV8520 error: A [ATAPI/IDE, SCSI/FC] tape drive was NOT found. Make sure tape drive power is turned on, and cables are securely connected. TAPEDRV8530 error: The specified [ATAPI/IDE, SCSI/FC] tape drive was NOT found. Comment: Verify that tape drive cables are securely connected. If an ATAPI/IDE tape drive is being used with another device (for example, CD-ROM) on the same IDE cable, make sure that one is configured as master and the other as slave. If a SCSI tape drive is being used, verify that the SCSI bus is properly terminated. Make sure the tape drive's SCSI ID does not conflict with another device on the SCSI bus. Shutdown and turn power off. Examine cables and connections. Power up and reboot the system. Try again. If you specified a particular tape device using -t and/or -s command line options, then enter the command tapedrv list without options then examine the output to verify whether the and/or parameters are correct. TAPEDRV8540 error: The tape drive's model is not recognized, and therefore, cannot be updated by TAPEDRV in the normal mode. Comment: TAPEDRV cannot update firmware in all tape drive models. A newer version of TAPEDRV may be available. Your drive may contain a special engineering firmware release which is not recognized by TAPEDRV. Contact technical support. TAPEDRV8563 error: [.bus]/.: Can't locate LUN0 with same SCSI ID Firmware update failed. Comment: The firmware for this device, at some non-zero Logical Unit Number (LUN) must be loaded through LUN 0, at the same SCSI target ID, However, LUN 0 cannot be located. TAPEDRV8565 error: "", image offset 0x: WriteBuffer(mode=, adrs=0x length=): The tape device rejected the firmware. Try selecting a different firmware file. TAPEDRV8570 error: "", image offset 0x: WriteBuffer(mode=, adrs=0x length=): An error occurred while downloading firmware. Firmware update failed. Comment: The tape device have rejected the new firmware. The new firmware may be incorrect for the tape device. TAPEDRV8580 error: An inquiry error occurred after updating firmware: Firmware update status unknown. -- Please shutdown, power cycle all devices, then reboot and determine whether firmware was updated from "" to "" Comment: The tape device may have rejected the new firmware. Power cycle and reboot your system, then check whether the tape device is present in the list shown by the command tapedrv scan. If not, contact technical support. TAPEDRV8590 error: Old version "": Current version "": Expected new version "": The version did not change to the expected. -- Please shutdown, power cycle all devices, then reboot and determine whether firmware was updated. Comment: Possible causes include: The tape device rejected the new firmware (if Old version is the same as Current version). The device may need a power cycle for the new version to take effect. The Expected new version may be incorrect because the firmware filename does not contain the correct version of the firmware. The expected new version (kept in an AutoFileVersion parameter in tapedrv.ini) may be incorrect. DOS Notes TAPEDRV8570 error under DOS using an IPSRASPI.SYS Driver When using the IPSRASPI.SYS DOS mode ASPI raid driver on an IBM Netfinity server, the following error was observed during firmware update of a Seagate Scorpion-24: TAPEDRV8570 error: WriteBuffer(mode=7, adrs=0x00180000 length=0) error. Host adapter status 0x11 This error is reported when the IPSRASPI.SYS driver times out a firmware update (WriteBuffer) request before firmware update is actually completed. The firmware update actually completes successfully after the message appears. This error is circumvented by increasing the timeout used by the IPSRASPI.SYS driver. IPSRASPI.SYS supports the following CONFIG.SYS line parameters. /t: Timeout in ticks (18.2 ticks/second) /F Load even if no device is seen SCSI scan For example, the following CONFIG.SYS line gives about a 6.4 minute timeout which is sufficient (5 minutes + 1.4 minute safety margin) for updating firmware in a Scorpion-240 loader. DEVICE=IPSRASPI.SYS /t:7000 /F Currently, the Seagate Scorpion-240 loader needs the longest timeout (about 5 minutes) of any supported tape drive. Most ASPI drivers have an infinite timeout. Windows Notes Windows 2000/XP/2003 -- Before Firmware Update If the system contains a library (also called medium changers, robots, automation units, etc.) that is managed by Removable Storage Manager (RSM). Then RSM must be stopped to permit access to the library so that out-of-date firmware may be updated. To determine whether the library is managed by RSM, Right click 'My Computer' and select 'Manage'. In 'Computer Management', follow the tree - Computer Management (local) - Storage - Removable Storage - Physical Locations [Windows 2000] - Libraries [Windows XP/2003] Examine the icons under Physical Locations or Libraries. If an icon resembles two books (one red, the other yellow) on top of cable, then it represents a library. RSM should be stopped. To Stop RSM: Right click "My Computer", then select Manage. In Management Console, open the tree Services and Applications -> Services. In Services, locate and right click "Removable Storage Manager", then select Start, Stop, or Restart as appropriate. Another way to stop (or start) the RSM service is by way of command prompt using the NET.EXE command. For example: C:\> net stop ntmssvc C:\> net start ntmssvc Windows 2000/XP/2003 -- After Firmware Update For Windows 2000/XP/2003 it is recommended that the system be restarted in order to resolve any driver re-installation issues that may occur after firmware update. After firmware update, the following system dialogs may appear: "Unsafe Removal of Device" on Windows 2000. "Files Needed" on Windows 2000/XP/2003. If an "Unsafe Removal of Device" dialog appears, then close the dialog and either Restart Windows (recommended), or use Device Manager's "Scan for hardware changes" command to reinstall the device. If a "Files Needed" dialog appears that asks you to supply the path to the tape device driver (.sys) file, then the currently installed tape driver can be used by entering the path to the Windows driver directory as shown: Files Needed ... Copy files from: [ C:\Winnt\System32\Drivers ] for Windows 2000 [ C:\Windows\System32\Drivers ] for Windows XP/2003 then click 'OK'. Note: On some systems, Windows may be installed in a folder other than C:\Winnt or C:\Windows. You can find the Windows directory by opening a Command prompt and typing in the command: C:\> set | findstr SystemRoot Windows 2000/XP/2003 Additional Information Windows 2000/XP/2003 considers any tape device, with an updated firmware version, to be a "new" device. As a result, Windows eventually both removes the old device and installs a new device. Device reinstallation may be triggered: After you issue Device Manager "Scan for hardware changes", If you rerun the firmware update program, or When Windows is restarted. It is recommended that you Restart Windows to reinstall the tape driver. However as an alternative, Device Manager's "Scan for hardware changes" may be used to reinstall the driver. If you choose "Scan for hardware changes", then you may need to issue "Scan for hardware changes" twice. Once to remove the tape driver, and once to reinstall the driver. Right click "My Computer", then select Manage. In Device Manager, right click "My Computer", then select "Scan for hardware changes". If an "Unsafe Removal of Device" dialog appears, Device Manager has removed the tape device as it no longer "sees" the tape device as being present (because it no longer sees the old firmware version). To recover from this condition, either Restart Windows (recommended), or use Device Manager's "Scan for hardware changes" command to reinstall the device. For Windows 2000/XP/2003, a "Files Needed" dialog may appear when Windows is reinstalling the tape driver. Typically, "Files Needed" appears only when an add-on tape driver was installed from removable media such as CD-ROM or floppy, (rather than an installation directory on the hard disc). To avoid "Files Needed", in the future, copy driver installation files to the hard disc, then update the driver using the files from the installation folder. Linux Notes Tapedrv relies on the SCSI generic (sg) driver to communicate with all tape devices. If an ATAPI tape drive is not detected, type the following sequence of commands, from a Linux console, to make ATAPI tapes visible to the sg driver, and thus tapedrv. # rmmod ide-tape # rmmod ide-scsi # modprobe ide-scsi You can verify the presence of tape (and other SCSI) devices using the command # more /proc/scsi/scsi Some Linux kernels have a known driver bug that causes SCSI error messages to be displayed during tape device detection. Normally, this does not affect the firmware update operation and can be ignored. If firmware update shows a failed status and the console shows 'parity errors', this is usually a result of a failure to renegotiate SCSI Synchronous Data Transfer, immediately after the update completes, by either the host adapter or SCSI driver. The firmware update is not affected. Supported Tape Devices Description 60/120GB 8mm Mammoth 2 20/40GB 8mm Mammoth 1 4/8GB TR4 CTT 4/8GB TR4 STT 4/8GB TR4 Hornet 8 CTT 4/8GB TR4 IDE 10/20GB NS20 10/20GB IDE TR5 12/24GB DDS/3 4mm 20/40GB DDS/4 4mm 120/240GB DDS/4 Autoloader 20/40GB DLT4000 35/70GB DLT7000 40/80GB DLT8000 3502-108 3502-314, 3502-R14 3502-XXX Sled drive 40/80GB DLTVS 100/200GB IBM LTO Ultrium (full hight) DDS/2 512K Archive 100/200GB HH LTO 110/220GB SDLT 3600 Library picker/robot 3600 Autoloader picker/robot 20/40GB DDS/4 LC 20/40GB TR7 3607-16X 4560-SLX Appendix A: Package Specific Installation Instruction This update is packaged as a self-extracting PackageForTheWeb (PFTW) executable file. To unpack, this update requires that your TEMP environment variable be set to a path with read/write access. You must be logged in as an administrator. The package update log, ux.log, is created on the system drive. To locate the log file go to: %SystemDrive%\uxlog\ux.log The command-line syntax for PackageForTheWeb firmware update package is: Package.exe [-s] [-a [-s] | [-r] | [-c] | [-x directory] | [-xd] | [-w] | [-?] ] [-s] This command installs the Package-For-The-Web software silently and does not prompt if files are to be over-written in the %temp% directory. [-a] This command passes all subsequent commands to the PFTW software to install the update package. [-s] This command runs a silent and unattended update. For firmware updates, the update is scheduled to run on the next reboot. An immediate reboot can be forced with the -r option. [-r] This command schedules the update and reboot immediately. It can be used with or without the -s command. [-c] This command cancels any scheduled firmware update and records results of this operation in the log file. Only one firmware package can be scheduled at a time, if a firmware update needs to be applied instead of the currently scheduled firmware update package, cancel the current (run with the -c option on any firmware package) package. Then, run the applicable firmware package. [-x directory] This command is used with firmware updates to extract the update to the directory named directory. The PackageForTheWeb executable extracts itself to a subdirectory in the %TEMP% directory, a relative directory will be relative to that location. You must specify an absolute directory if you do not want to use the default directory. [-xd] This command is used with firmware updates to extract to a floppy diskette. The floppy diskette can then be used to boot from and apply the update. This option is not available for all firmware updates, such as tape drive and hard-disk drive updates. [-w] PowerQuest Virtual Boot Environment requires that there are 2 free sectors on the first track before it can schedule a firmware update. Use this option only if scheduling an update failed because 2 free sectors were not available on the first track. This option clears the non-boot and the non-partition information sectors on the first track. Typically, these sectors are not used. Before clearing the sectors a copy of the complete first track is saved in the %temp% directory from which the update runs. [-?] This command displays information about the command line switches. The command line switches -s, -r -c and -e are unnattended. Other command line options such as display help (-?) might require that you hit any key to continue. If Windows packages are run without any command line options, a GUI is displayed. This GUI offers all of the options that are available using the command line.