IBM Tape Device Drivers: Programming Reference

[Pages:396]IBM Tape Device Drivers

Programming Reference

IBM

GA32-0566-09

IBM Tape Device Drivers

Programming Reference

IBM

GA32-0566-09

ii IBM Tape Device Drivers: Programming Reference

Contents

Note! . . . . . . . . . . . . . . . . v

Preface . . . . . . . . . . . . . . vii

Chapter 1. Common extended features . 1

Tape drive functions and device driver ioctls . . . 1 Media partitioning . . . . . . . . . . . . 1 Data safe (append-only) mode . . . . . . . . 3 Read Position long/extended form and Locate(16) commands . . . . . . . . . . . . . . . 3 Logical Block Protection . . . . . . . . . . 4 Programmable Early Warning (PEW) . . . . . . 4 Log Sense page and subpage . . . . . . . . . 5 Mode Sense page and subpage . . . . . . . . 5 Verify Tape . . . . . . . . . . . . . . . 5 RAO - Recommended Access Order . . . . . . 5

Chapter 2. AIX tape and medium changer device driver . . . . . . . . . 7

Software interface for tape devices . . . . . . . 7 Software interface for medium changer devices . . . 7 Special files . . . . . . . . . . . . . . . 8

Special files for tape devices . . . . . . . . 8 Special files for medium changer devices . . . . 9 Opening the special file for I/O . . . . . . 10 The extended open operation . . . . . . . 10 Writing to the special file . . . . . . . . . 12 Reading from the special file . . . . . . . 12 Reading with the TAPE_SHORT_READ extended parameter . . . . . . . . . . . . . . 12 Reading with the TAPE_READ_REVERSE extended parameter . . . . . . . . . . 13 Closing the special file. . . . . . . . . . 13 Device and volume information logging . . . . . 14 Log file . . . . . . . . . . . . . . . 14 Persistent reservation support and IOCTL operations . . . . . . . . . . . . . . . 15 ODM attributes and configuring persistent reserve support . . . . . . . . . . . . 15 Default device driver host reservation key . . . 16 Preempting and clearing another host reservation 16 Openx() extended parameters . . . . . . . 16 AIX tape persistent reserve IOCTLs . . . . . 17 Atape persistent reserve IOCTLs . . . . . . 20 General IOCTL operations . . . . . . . . . 24 Overview . . . . . . . . . . . . . . 24 Tape IOCTL operations . . . . . . . . . . 41 Overview . . . . . . . . . . . . . . 41 Medium changer IOCTL operations . . . . . . 81 Overview . . . . . . . . . . . . . . 81 Return codes . . . . . . . . . . . . . . 92 Codes for all operations . . . . . . . . . 92 Open error codes . . . . . . . . . . . 93 Write error codes . . . . . . . . . . . 94 Read error codes . . . . . . . . . . . 94

? Copyright IBM Corp. 1999, 2016

Close error codes . . . . . . . . . . . 94 IOCTL error codes . . . . . . . . . . . 95

Chapter 3. HP-UX tape and medium changer device driver . . . . . . . . 97

HP-UX programming interface . . . . . . . . 97 IOCTL operations . . . . . . . . . . . . 100

General SCSI IOCTL operations . . . . . . 100 SCSI medium changer IOCTL operations . . . 108 SCSI tape drive IOCTL operations . . . . . 118 Base operating system tape drive IOCTL operations . . . . . . . . . . . . . 149 Service aid IOCTL operations . . . . . . . 151

Chapter 4. Linux tape and medium changer device driver . . . . . . . . 159

Software interface . . . . . . . . . . . . 159 Entry points . . . . . . . . . . . . . 159 Medium changer devices . . . . . . . . 161

General IOCTL operations . . . . . . . . . 161 Overview. . . . . . . . . . . . . . 162

Tape drive IOCTL operations . . . . . . . . 173 Overview. . . . . . . . . . . . . . 173

Tape drive compatibility IOCTL operations . . . 208 MTIOCTOP . . . . . . . . . . . . . 208 MTIOCGET . . . . . . . . . . . . . 208 MTIOCPOS . . . . . . . . . . . . . 208

Medium changer IOCTL operations . . . . . . 209 SCSI IOCTL commands . . . . . . . . . 209

Return codes . . . . . . . . . . . . . 217 General error codes . . . . . . . . . . 217 Open error codes . . . . . . . . . . . 217 Close error codes . . . . . . . . . . . 218 Read error codes . . . . . . . . . . . 218 Write error codes . . . . . . . . . . . 218 IOCTL error codes. . . . . . . . . . . 219

Chapter 5. Solaris tape and medium changer device driver . . . . . . . . 221

IOCTL operations . . . . . . . . . . . . 221 General SCSI IOCTL operations . . . . . . 221 SCSI medium changer IOCTL operations . . . 232 SCSI tape drive IOCTL operations . . . . . 242 Base operating system tape drive IOCTL operations . . . . . . . . . . . . . 278 Downward compatibility tape drive IOCTL operations . . . . . . . . . . . . . 281 Service aid IOCTL operations . . . . . . . 287

Return codes . . . . . . . . . . . . . 292 General error codes . . . . . . . . . . 293 Open error codes . . . . . . . . . . . 293 Close error codes . . . . . . . . . . . 294 Read error codes . . . . . . . . . . . 294 Write error codes . . . . . . . . . . . 294

iii

IOCTL error codes. . . . . . . . . . . 295 Opening a special file . . . . . . . . . 295 Writing to a special file . . . . . . . . . 296 Reading from a special file . . . . . . . . 297 Closing a special file . . . . . . . . . . 298 Issuing IOCTL operations to a special file . . . 299

Chapter 6. Windows tape device drivers . . . . . . . . . . . . . . 301

Windows programming interface . . . . . . . 301 User-callable entry points . . . . . . . . 301 Tape Media Changer driver entry points . . . 302 Medium Changer IOCTLs . . . . . . . . 310

| Preempt reservation . . . . . . . . . . 311 Vendor-specific (IBM) device IOCTLs for DeviceIoControl . . . . . . . . . . . 313 Variable and fixed block read/write processing 331

Event log . . . . . . . . . . . . . . . 332

Chapter 7. 3494 Enterprise tape library driver . . . . . . . . . . . . . . . 339

AIX 3494 Enterprise tape library driver . . . . . 339 Opening the Special File for I/O . . . . . . 339 Header definitions and structure . . . . . . 339 Parameters . . . . . . . . . . . . . 339 Reading and writing the Special File . . . . 339 Closing the Special File . . . . . . . . . 339

HP-UX 3494 Enterprise tape library driver. . . . 340 Opening the library device . . . . . . . . 340 Closing the library device . . . . . . . . 340 Issuing the library commands . . . . . . . 340 Building and linking applications with the library subroutines . . . . . . . . . . 341

Linux 3494 Enterprise tape library driver . . . . 341 Opening the library device . . . . . . . . 342 Closing the library device . . . . . . . . 342 Issuing the library commands . . . . . . . 342 Building and linking applications with the library subroutines . . . . . . . . . . 343

SGI IRIX 3494 Enterprise tape library . . . . . 343 Solaris 3494 Enterprise tape library driver . . . . 344

Opening the library device . . . . . . . . 344 Closing the library device . . . . . . . . 344 Issuing the library commands . . . . . . . 344 Building and linking applications with the library subroutines . . . . . . . . . . 345 Windows 3494 Enterprise tape library service . . 345 Opening the library device . . . . . . . . 345 Closing the library device . . . . . . . . 346 Issuing the library commands . . . . . . . 346 Building and linking applications with the library subroutines . . . . . . . . . . 346 3494 Enterprise tape library system calls . . . . 348 Library device number . . . . . . . . . 349 MTIOCLM (Library Mount) . . . . . . . 349 MTIOCLDM (Library Demount) . . . . . . 351 MTIOCLQ (Library Query) . . . . . . . . 353 MTIOCLSVC (Library Set Volume Category) 358 MTIOCLQMID (Library Query Message ID) . . 360 MTIOCLA (Library Audit) . . . . . . . . 361 MTIOCLC (Library Cancel). . . . . . . . 362 MTIOCLSDC (Library Set Device Category) . . 363 MTIOCLRC (Library Release Category). . . . 365 MTIOCLRSC (Library Reserve Category) . . . 366 MTIOCLSCA (Library Set Category Attribute) 368 MTIOCLDEVINFO (Device List) . . . . . . 369 MTIOCLDEVLIST (Expanded Device List). . . 369 MTIOCLADDR (Library Address Information) 371 MTIOCLEW (Library Event Wait) . . . . . 373 Error description for the library I/O control requests . . . . . . . . . . . . . . 376

Notices . . . . . . . . . . . . . . 379

Index . . . . . . . . . . . . . . . 381

iv IBM Tape Device Drivers: Programming Reference

Note!

Before using this information and the product that it supports, be sure to read the general information under "Notices" on page 379.

Ninth Edition (March 2016)

This edition replaces and makes obsolete GC35-0483-06, GC35-0346-10, GA32-0566-00, GA32-0566-01, GA32-0566-02, GA32-0566-03, GA32-0566-04, GA32-0566-05, GA32-0566-06, GA32-0566-07, and GA32-0566-08. Changes or additions are indicated by a vertical line in the left margin.

? Copyright IBM Corp. 1999, 2016

v

vi IBM Tape Device Drivers: Programming Reference

................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download