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:
- cartridgeType
- The type of any cartridge if the device supports
one:
- 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:
- 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:
- 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
-
- removableFlag
-
- readOnlyFlag
-
- magazineLoadedFlag
-
- acceptsMagazinesFlag
-
- objectInChangerFlag
-
- 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
-
- 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).
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.