REQUEST_ASYNC_WRITE control code

The REQUEST_ASYNC_WRITE request performs an asynchronous write operation to the device specified.

The relevant members of the IRB for this request are:


typedef struct _IRB {
  ULONG FunctionNumber;
    .
    .
    .
  union {
    struct {
      IO_ADDRESS    DestinationAddress;
      ULONG         nNumberOfBytesToWrite;
      ULONG         nBlockSize;
      ULONG         fulFlags;
      PMDL          Mdl;
      ULONG         ulGeneration;
      UCHAR         chPriority;
      UCHAR         nSpeed;
      UCHAR         tCode;
      ULONG         Reserved;
    } AsyncWrite;
    .
    .
    .
  } u;
} IRB;

IRB Input

FunctionNumber

REQUEST_ASYNC_WRITE

u.AsyncWrite.DestinationAddress

Specifies the 1394 64-bit destination address for this write operation. The driver only must fill in the IA_Destination_Offset member of u.AsyncWrite.DestinationAddress; the bus driver fills in the IA_Destination_ID member. See IO_ADDRESS for the structure description.

u.AsyncWrite.nNumberOfBytesToWrite

Specifies the number of bytes to write to the 1394 node.

u.AsyncWrite.nBlockSize

Specifies the size of each individual block within the data stream that is written as a whole to the node. If this parameter is zero, then the maximum packet size for the speed selected is used in breaking up these write requests, unless raw-mode addressing is used.

If raw-mode addressing is used, the client driver should set the nBlockSize member to the maximum asynchronous payload size that is supported by the device at the connected speed.

For more information on raw-mode addressing, see Sending Asynchronous I/O Request Packets on the IEEE 1394 Bus.

Note  In Windows 7 and later versions of Windows, you can specify new values higher speed and greater sized payloads. For more information, see New Flags for Speed and Payload Size and IEEE 1394 IOCTL Changes in Device Driver Interface (DDI) Changes in Windows 7.

u.AsyncWrite.fulFlags

Specifies any nondefault settings for this operation. The following flags are provided.

FlagDescription

ASYNC_FLAGS_NONINCREMENTING

Do not increment 1394 address during asynchronous operation. This flag is set only in large asynchronous requests (that is, those greater than asynchronous packet size).

ASYNC_FLAGS_NO_STATUS

Always return success from the write operation, whether the write succeeds or fails.

ASYNC_FLAGS_BROADCAST

Broadcast to all nodes on the bus.

 

Use the bitwise operator OR to combine the settings.

u.AsyncWrite.Mdl

Points to an MDL that describes the device driver's buffer, which receives data from the 1394 node.

u.AsyncWrite.ulGeneration

Specifies the bus reset generation as known by the device driver that submitted this asynchronous request. If the generation count specified does not match the actual generation of the bus, this request is returned with a status of STATUS_INVALID_GENERATION.

u.AsyncWrite.chPriority

Reserved.

u.AsyncWrite.nSpeed

Reserved.

u.AsyncWrite.tCode

Reserved.

u.AsyncWrite.Reserved

Reserved.

I/O Status Block

If successful, the bus driver sets Irp->IoStatus.Status to STATUS_SUCCESS. If u.AsyncLock.ulGeneration does not match the current bus reset generation count, the bus driver sets Irp->IoStatus.Status to STATUS_INVALID_GENERATION.

Operation

The REQUEST_ASYNC_WRITE request writes the data buffer into the device's address space, beginning at the u.AsyncWrite.AddressOffset member of u.AsyncWrite.DestinationAddress. The buffer is broken up into blocks, and one block is written for each transaction. If the ASYNC_FLAGS_NONINCREMENTING flag is set, the bus driver writes each block beginning at u.AsyncWrite.DestinationAddress, otherwise it writes the buffer to consecutive addresses in the memory space of the device.

The IEEE 1394-1995 Specification constrains the size of write operations to be ASYNC_PAYLOAD_xxx_RATE, where xxx is the approximate connection speed in megabits per second. (The speeds allowed are 100, 200, and 400 Mb/s.)

Payload RateDescription

ASYNC_PAYLOAD_100_RATE

100 Mb/s

ASYNC_PAYLOAD_200_RATE

200 Mb/s

ASYNC_PAYLOAD_400_RATE

400 Mb/s

 

If the block size exceeds the maximum payload size, the payload size is used as the block size.

The size of packets may also be constrained by the device itself. The device reports the maximum packet size in the MAX_REC field of its configuration ROM. If this value is smaller than requested block size and the maximum payload size, the bus driver uses this as the block size.

The ASYNC_FLAGS_NO_STATUS flag should only be set if the driver has a higher-level error recovery protocol, and should only be used for quadlet-sized writes.

See Also

IOCTL_IEEE1394_API_REQUEST

Requirements

Header

1394.h (include 1394.h)

 

 

Send comments about this topic to Microsoft

Show:
© 2014 Microsoft