CDI_Object_Update

Allows the CDM to update device object information.

Thread Context:Blocking

Syntax

    LONG CDI_Object_Update (
       LONG                      cdmOSHandle,
       LONG                      cdiBindHandle,
       struct UpdateInfoStruct  *info,
       LONG                      infoSize,
       LONG                      reasonFlag
       );
    
    

Parameters

cdmOSHandle
(IN) The CDM's handle for using the CDI APIs. The value of cdmOSHandle was assigned during CDI_Register_CDM, and it is used in conjunction with the CDM-generated CDMHandle to uniquely identify a CDM when it interfaces with NWPA through the CDI API set.
cdiBindHandle
(IN) NWPA-generated bind handle that was assigned to the calling CDM when it bound to the target device using CDI_Bind_CDM_To_Object.
info
(IN) Points to an UpdateInfoStruct. This structure contains the information telling NWPA what items will be updated for the target device.
infoSize
(IN) The size of the UpdateInfoStruct pointed at by info.
reasonFlag
(IN) An NWPA code corresponding to the reason why the update is being done. The following is a list of valid codes that may be placed in this field:

Value

Description

0x00000000

RESERVED0

0x00000001

ALERT_DRIVER_UNLOAD

0x00000002

ALERT_DEVICE_FAILURE

0x00000003

ALERT_PROGRAM_CONTROL

0x00000004

ALERT_MEDIA_DISMOUNT

0x00000005

ALERT_MEDIA_EJECT

0x00000006

RESERVED2

0x00000007

RESERVED3

0x00000008

ALERT_MEDIA_LOAD

0x00000009

ALERT_MEDIA_MOUNT

0x0000000A

ALERT_DRIVER_LOAD

0x0000000B

RESERVED4

0x0000000C

RESERVED5

0x0000000D

ALERT_MAGAZINE_LOAD

0x0000000E

ALERT_MAGAZINE_UNLOAD

0x0000000F

ALERT_DEVICE_REMOVED

0x00000010

RESERVED6

0x00000011

ALERT_CONFIGURATION_CHANGE

0x00000012

RESERVED7

0x00000013

RESERVED8

0x00000014

ALERT_LOST_HARDWARE_FAULT_TOLERANCE

0x00000015

RESERVED9

0x00000016

RESERVED10

0x00000017

RESERVED11

0x00000018

ALERT_DEVICE_END_OF_MEDIA

0x00000019

ALERT_MEDIA_INSERTED

0x0000001A

ALERT_UNKNOWN_DEVICE_ALERT

0x0000001B

ALERT_UNKNOWN_ADAPTER_ALERT

0x0000001C

RESERVED14

0x00000020

ALERT_MEDIA_CHANGED

Return Values

The following table lists return values and descriptions.

zero

Successful

nonzero

Unsuccessful

Remarks

CDI_Object_Update is used by a CDM to update device object information with NWPA. Typically, object updating is done when the CDM needs to deactivate a device or put in capacity, unit size, or block size information for a removable device on a mount.

Although it is not a specific NWPA requirement, it is good practice for a CDM to store the device object information for each device it supports into a local structure.

Whenever device information is updated, the update information should also be mirrored into the local storage structure. Doing this allows the CDM to know the current operational information for each device it supports. However, to save NWPA time and overhead in performing the update, the CDM should allocate a reusable UpdateInfoStruct to use exclusively as an input parameter to CDI_Object_Update. Then, when an update is necessary, the CDM should do the following:

  1. Set all of the fields of the reusable UpdateInfoStruct to -1. This is easily accomplished using the OS function CSetB.
  2. Place the new values in the fields that are to be updated, thereby leaving a -1 in all of the fields that are not to be updated. (The -1 indicates a no-change condition to NWPA.)

    NOTE:Updated field values should be mirrored into the corresponding fields of device's local storage structure.

  3. Call CDI_Object_Update to update the device object information with NWPA.