Windows Driver Kit: Storage Devices
ATA_PASS_THROUGH_DIRECT

The ATA_PASS_THROUGH_DIRECT structure is used in conjunction with an IOCTL_ATA_PASS_THROUGH_DIRECT request to instruct the port driver to send an embedded ATA command to the target device.

typedef struct _ATA_PASS_THROUGH_DIRECT {
  USHORT  Length;
  USHORT  AtaFlags;
  UCHAR  PathId;
  UCHAR  TargetId;
  UCHAR  Lun;
  UCHAR  ReservedAsUchar;
  ULONG  DataTransferLength;
  ULONG  TimeOutValue;
  ULONG  ReservedAsUlong;
  PVOID  DataBuffer;
  UCHAR  PreviousTaskFile[8];
  UCHAR  CurrentTaskFile[8];
} ATA_PASS_THROUGH_DIRECT, *PATA_PASS_THROUGH_DIRECT;

Members

Length
Specifies the length in bytes of the ATA_PASS_THROUGH_DIRECT structure.
AtaFlags
Indicates the direction of data transfer and specifies the kind of operation to be performed. The value of this member must be some combination of the flags in the following table.

ATA flagsMeaning
ATA_FLAGS_DRDY_REQUIREDWait for DRDY status from the device before sending the command to the device.
ATA_FLAGS_DATA_INRead data from the device.
ATA_FLAGS_DATA_OUTWrite data to the device.
ATA_FLAGS_48BIT_COMMANDThe ATA command to be sent uses the 48-bit logical block address (LBA) feature set. When this flag is set, the contents of the PreviousTaskFile member in the ATA_PASS_THROUGH_DIRECT structure should be valid.
ATA_FLAGS_USE_DMASet the transfer mode to DMA.
ATA_FLAGS_NO_MULTIPLERead single sector only.

PathId
Contains an integer that indicates the IDE port or bus for the request. This value is set by the port driver.
TargetId
Contains an integer that indicates the target device on the bus. This value is set by the port driver.
Lun
Indicates the logical unit number of the device. This value is set by the port driver.
ReservedAsUchar
Reserved for future use.
DataTransferLength
Indicates the size, in bytes, of the data buffer. If an underrun occurs, the miniport driver must update this member to the number of bytes actually transferred.
TimeOutValue
Indicates the number of seconds that are allowed for the request to execute before the OS-specific port driver determines that the request has timed out.
ReservedAsUlong
Reserved for future use.
DataBuffer
Pointer to the data buffer.
PreviousTaskFile
Specifies the contents of the input task file register prior to the current pass-through command. This member is not used when the ATA_FLAGS_48BIT_COMMAND flag is not set.
CurrentTaskFile
Specifies the content of the task file register on both input and output. On input, the array values in CurrentTaskFile map to the input registers in the following manner.

ByteInput Register
0Features Register
1Sector Count Register
2Sector Number Register
3Cylinder Low Register
4Cylinder High Register
5Device/Head Register
6Command Register
7Reserved

When IOCTL_ATA_PASS_THROUGH_DIRECT completes, the port driver updates CurrentTaskFile with the values that are present in the device's output registers at the completion of the embedded command. The array values in CurrentTaskFile correspond to the following task file output registers.

ByteOutput Register
0Error Register
1Sector Count Register
2Sector Number Register
3Cylinder Low Register
4Cylinder High Register
5Device/Head Register
6Status Register
7Reserved

Comments

The ATA_PASS_THROUGH_DIRECT structure is used with IOCTL_ATA_PASS_THROUGH_DIRECT. With this request, the system locks down the buffer in user memory and the device accesses this memory directly. For a double-buffered equivalent of this device control request, see IOCTL_ATA_PASS_THROUGH and ATA_PASS_THROUGH_EX.

Requirements

Headers: Declared in ntddscsi.h. Include ntddscsi.h.

See Also

IOCTL_ATA_PASS_THROUGH_DIRECT, IOCTL_ATA_PASS_THROUGH, ATA_PASS_THROUGH_EX


Send feedback on this topic
Built on November 19, 2009
Page view tracker