UpdateInfoStruct

Used by a CDM when binding to a device or when updating device information.

Used By:CDM

Syntax

    typedef struct UpdateInfoStruct 
    { 
       BYTE   name[64];
       LONG   mediaType;
       LONG   cartridgeType;
       LONG   unitSize;
       LONG   blockSize;
       LONG   capacity;
       LONG   preferredUnitSize;
       LONG   functionMask;
       LONG   controlMask;
       LONG   unfunctionMask;
       LONG   uncontrolMask;
       LONG   mediaSlot;
       BYTE   activateFlag;
       BYTE   removableFlag;
       BYTE   readOnlyFlag;
       BYTE   magazineLoadedFlag;
       BYTE   acceptsMagazinesFlag;
       BYTE   objectInChangerFlag;
       BYTE   objectIsLoadableFlag;
       BYTE   lockFlag;
       LONG   diskGeometry;
       LONG   reserved[7];
       union 
       { 
          struct ChangerInfo 
          { 
             LONG   numberOfSlots;
             LONG   numberOfExchangeSlots;
             LONG   numberOfDevices;
             LONG deviceObjects[n];
          } ci;
       { u1;
    } UpdateInfoDef; 
    

Fields

name
This field is a length-preceded string to contain the manufacturer's name and model number of the device.
mediaType
This is the type of media being used:

Value

Description

0x00000000

disk

0x00000001

tape

0x00000002

printer

0x00000004

WORM

0x00000005

CD

0x00000007

magneto optical

cartridgeType
The type of any cartridge if the device supports one:

Value

Description

0x00000000

fixed media

0x00000001

5.25" floppy

0x00000002

3.5" floppy

0x00000003

5.25" optical

0x00000004

3.5" optical

0x00000005

0.5" tape

0x00000006

0.25" tape

0x00000007

8 mm tape

0x00000008

4 mm tape

0x00000009

Bernoulli disk

0x0000000A

AIT Tape

0x0000000B

Mammoth tape

0x0000000C

Accelis tape

0x0000000D

Ultrium tape

0x0000000E

12" optical

unitSize
The current transfer unit size (bytes per sector) setting of the device. This is the transfer unitSize in which the base-translator CDM will receive requests.

For Disk, CD, and MO devices, this field should contain the unit size native to the media in the device. This is the unit size that either optimizes device performance or is physically imposed on the device by the media, as in the case of CD. If the value in this field is anything other than 512 (NetWare's native unit size), NWPA's sector translation filter gets enabled to ensure that the CDM will receive requests in the unit size specified by this field.

For Tape devices, the CDM should never change the value in this field unless an application tells it to physically change the device's unitSize through its CDM_Set_Attribute routine. Then, and only then, will the CDM place the new unitSize value in this field and update the object using CDI_Object_Update. It is the responsibility of the application using the tape device to issue requests in the unitSize specified by this field.

blockSize
Indicates the maximum number of transfer units that can be specified in a single command (that is, sectors per request). NWPA uses this value to make sure that the CDM does not receive blocks that are too big for it to handle. The CDM should set the block size to the smaller of either the maximum number of transfer units the CDM can handle per request or the maximum block size imposed by the adapter. The CDM is informed that an adapter block size limitation exists if either the Max_Data_Per_Transfer_Flag (0x00000001) or the Max_Units_Per_Transfer_Flag (0x00000200) is set in the attributeFlags field of the device's DeviceInfoStruct. The CDM receives a pointer to the device's DeviceInfoStruct as an input parameter to its CDM_Inquiry routine.

The adapter imposed block size is determined by the following criteria:

  • If the Max_Data_Per_Transfer_Flag is set and the Max_Units_Per_Transfer_Flag is cleared, then the CDM calculates the adapter imposed block size by dividing the value in the maxDataPerTransfer field of the device's DeviceInfoStruct by the value in the unitSize field of this structure [the device's UpdateInfoStruct].
  • If the Max_Units_Per_Transfer_Flag is set and the Max_Data_Per_Transfer_Flag is cleared, then the CDM uses the value in the maxUnitsPerTransfer field of the device's DeviceInfoStruct as the adapter imposed block size.
  • If both flags are set, then the CDM uses the smaller of 1 or 2 above as the adapter imposed block size.
capacity
The capacity of the media in the device in terms of transfer units (that is, total number of sectors). For those types of media, such as tape, where capacity of the media is not readily available, it is preferable that the CDM approximate the capacity. However, if approximating the capacity is too difficult, the CDM should set this field to -2, which indicates capacity unknown.
preferredUnitSize
The transfer unit size (bytes per sector) in which the base-translator CDM would prefer to receive requests.

For Disk, CD-ROM, and MO devices, the value in this field should be equal to the value specified in the unitSize field. This way, NWPA's sector translation filter ensures that the base-translator CDM receives requests in the unitSize it specified in the unitSize field.

For Tape devices, the value in this field is a hint to tape applications of the preferred transfer unitSize. Applications can choose to use this hint or ignore it.

functionMask
A 32-bit mask indicating the I/O functions the CDM supports for this device. The CDM can update this field as needed. The following are I/O function operation code values:

Value

Name

0x00000001

READ_MASK

0x00000002

WRITE_MASK

0x00000004

WRITE_ONCE_MASK

0x00000008

SEQUENTIAL_READ_MASK

0x00000010

SEQUENTIAL_WRITE_MASK

0x00000020

RESET_END_OF_MEDIA_MASK

0x00000040

SINGLE_FILE_MARK_MASK

0x00000080

MULTIPLE_FILE_MARKS_MASK

0x00000100

SINGLE_SET_MARK_MASK

0x00000200

MULTIPLE_SET_MARKS_MASK

0x00000400

SPACE_DATA_BLOCKS_MASK

0x00000800

LOCATE_DATA_BLOCKS_MASK

0x00001000

PARTITION_SUPPORT_MASK

0x00002000

SEQUENTIAL_SUPPORT_MASK

0x00004000

MO_ERASE_MASK

controlMask
A 32-bit mask indicating the control functions the CDM supports for this device. The CDM can update this field as needed. The following are function operation code values:

Value

Name

0x00000001

FORMAT_MEDIA_MASK

0x00000002

TAPE_CONTROL_MASK

0x00000004

MEDIA_DETECT_MASK

0x00000008

ACTIVATE_DEACTIVATE_MASK

0x00000010

MOUNT_DISMOUNT_MASK

0x00000020

SELECT_DESELECT_MASK

0x00000040

LOAD_UNLOAD_MASK

0x00000080

LOCK_UNLOCK_MASK

0x00000100

MOVE_MEDIA_MASK

0x00002000

LOAD_MAGAZINE_MASK

0x00004000

CHANGER_INVENTORY_MASK

0x08000000

RAW_INSERT_MASK

0x10000000

RAW_CHANGER_MASK

0x20000000

RAW_MAGAZINE_MASK

unfunctionMask
This field is used by filter CDMs. Its value is a 32-bit mask that has bits set for each function that is to be removed from the current function mask.
uncontrolMask
This field is used by filter CDMs. Its value is a 32-bit mask that has bits set for each control function that is to be removed from the current control mask.
mediaSlot
This field is reserved by NWPA.
activateFlag

Value

Description

0

Device is inactive.

1

Device is active.

removableFlag

Value

Description

0

Device holds non-removable media (i.e., fixed disks).

1

Device holds removable media.

readOnlyFlag

Value

Description

0

Media in the device is readable and writable.

1

Media in the device is read-only or write-protected media.

magazineLoadedFlag

Value

Description

-1

Device does not support magazines.

0

Device does not have a magazine currently loaded.

1

Device has a magazine currently loaded.

acceptsMagazinesFlag

Value

Description

-1

Device does not support magazines.

1

Device supports magazines.

objectInChangerFlag

Value

Description

0

Device is not inside a changer.

1

Device is located inside a changer.

objectIsLoadableFlag
Should be set if the object can be loaded using the “Human Jukebox” interface. See NDK: Media Manager for NetWare 5.x and 6.x.
lockFlag

Value

Description

–1

Device does not support Prevent/Allow Medium Removal commands.

0

Device has removable media that is not locked in its drive slot.

1

Device has locked the removable media in its drive slot.

diskGeometry
Indicates Fixed Disk, Removable Hard Drive (or any media on which a NetWare partition can be placed.) The disk geometry must be consistent with any partitions already created on media. NetWare Partition Manager sanity checks sectors per track and number of heads to ensure no overlap of partitions.

The value in this field is treated as a LONG (32-bits).

Bits

Meaning

bits (LSB) 0 - 7

Sectors per track.

bits 8 - 15

Number of heads.

bits 16 - 31 (MSB)

Number of cylinders.

Figure 10-2 diskGeometry field

If left at -1, Media Manager uses defaults:

  • Number of Heads = 20H and Sectors per Track = 20H.

If using Logical Block Addressing (LBA) and DOS and/or NetWare partitions exist, get the geometry of the disk from the partition table information:

  • (Number of Heads = the End Head of the Partition + 1, Sectors per Track = the End Sector of the Partition ANDed with 0x3F).
  • To calculate the Number of Cylinders = Total Capacity (in sectors)/[(Number of Heads) (Sectors per Track)].

IMPORTANT:For writable media, sectors per track and number of heads are parameters used by the partition editor to determine partition boundaries. Therefore, the values of each partition must match those of other partitions on the media.

NetWare expects capacity on cylinder boundaries.

reserved
Reserved by NetWare.

ChangerInfo Structure

numberOfSlots
Used to set the number of slots in an autochanger.
numberOfExchangeSlots
Used to set the number of mailboxes in an autochanger.
numberOfDevices
Used to set the number of devices in an autochanger.
deviceObjects
A list of the devices. n is an arbitrary integer chosen by the CDM developer.

Remarks

The CDM uses this structure to register the control and I/O functions it supports for a device with the Media Manager.