ReactOS 0.4.16-dev-2633-g8dc9e50
ata_shared.h File Reference
#include <pshpack1.h>
#include <poppack.h>
Include dependency graph for ata_shared.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  _IDE_ACPI_TIMING_MODE_BLOCK
 
struct  _ATA_ACPI_TASK_FILE
 
struct  _IDE_REGISTERS
 
struct  _CHANNEL_DEVICE_CONFIG
 
struct  _ATA_IO_CONTEXT_COMMON
 
struct  _ATA_TASKFILE
 
struct  _ATA_DEVICE_REQUEST
 
struct  _PCIIDEX_LEGACY_CONTROLLER_INTERFACE
 Legacy detection interface with the PCIIDEX driver. More...
 
struct  _PCIIDEX_CHANNEL_INTERFACE
 Channel interface with the PCIIDEX driver. More...
 

Macros

#define PCIIDEX_INTERFACE_VERSION   1
 
#define ATA_MAX_DEVICE   15
 
#define ATA_MIN_SECTOR_SIZE   512
 256 sectors of 512 bytes (128 kB).
 
#define ATA_MAX_SECTORS_PER_IO   0x100
 
#define ATA_MAX_TRANSFER_LENGTH   (ATA_MAX_SECTORS_PER_IO * ATA_MIN_SECTOR_SIZE)
 
#define ATA_MIN_BUFFER_ALIGNMENT   FILE_WORD_ALIGNMENT
 
#define IDE_ACPI_TIMING_MODE_NOT_SUPPORTED   0xFFFFFFFF
 
#define IDE_ACPI_TIMING_MODE_FLAG_UDMA(Drive)   (0x01 << (2 * (Drive)))
 
#define IDE_ACPI_TIMING_MODE_FLAG_IORDY(Drive)   (0x02 << (2 * (Drive)))
 
#define IDE_ACPI_TIMING_MODE_FLAG_INDEPENDENT_TIMINGS   0x10
 
#define DEVICE_NUMBER_MASK   0x0000000F
 
#define DEVICE_IS_ATAPI   0x00000010
 
#define DEVICE_HAS_CDB_INTERRUPT   0x00000020
 
#define DEVICE_NEED_DMA_DIRECTION   0x00000040
 
#define DEVICE_IS_NEC_CDR260   0x00000080
 
#define DEVICE_QUEUE_DEPTH_MASK   0x0000FF00
 
#define DEVICE_QUEUE_DEPTH_SHIFT   8
 
#define REQUEST_STATE_NONE   0
 
#define REQUEST_STATE_NOT_STARTED   1
 
#define REQUEST_STATE_REQUEUE   2
 
#define REQUEST_STATE_FREEZE_QUEUE   3
 
#define REQUEST_FLAG_DMA   0x00000001
 
#define REQUEST_FLAG_PACKET_COMMAND   0x00000002
 
#define REQUEST_FLAG_NCQ   0x00000004
 
#define REQUEST_FLAG_DATA_IN   0x00000040
 
#define REQUEST_FLAG_DATA_OUT   0x00000080
 
#define REQUEST_FLAG_RST_COMMAND   0x00040000
 
#define REQUEST_FLAG_LBA48   0x00000008
 
#define REQUEST_FLAG_READ_WRITE_MULTIPLE   0x00000010
 
#define REQUEST_FLAG_READ_WRITE   0x00000020
 
#define REQUEST_FLAG_FUA   0x00000100
 
#define REQUEST_FLAG_SAVE_TASK_FILE   0x00000200
 
#define REQUEST_FLAG_HAS_TASK_FILE   0x00000400
 
#define REQUEST_FLAG_SET_DEVICE_REGISTER   0x00000800
 
#define REQUEST_FLAG_SET_AUXILIARY_FIELD   0x00001000
 
#define REQUEST_FLAG_SET_ICC_FIELD   0x00002000
 
#define REQUEST_FLAG_EXCLUSIVE   0x00004000
 
#define REQUEST_FLAG_HAS_LOCAL_BUFFER   0x00008000
 
#define REQUEST_FLAG_HAS_SG_LIST   0x00010000
 
#define REQUEST_FLAG_HAS_MDL   0x00020000
 
#define REQUEST_FLAG_HAS_RESERVED_MAPPING   0x00080000
 
#define REQUEST_FLAG_NO_KEEP_AWAKE   0x00100000
 
#define REQUEST_FLAG_PROGRAM_DMA   0x00200000
 
#define REQUEST_FLAG_INTERNAL   0x00400000
 
#define REQUEST_FLAG_PASSTHROUGH   0x00800000
 
#define REQUEST_FLAG_DEVICE_EXCLUSIVE_ACCESS   0x01000000
 
#define REQUEST_FLAG_POLL   0x80000000
 
#define REQUEST_EXCLUSIVE_ACCESS_FLAGS    (REQUEST_FLAG_SAVE_TASK_FILE | REQUEST_FLAG_EXCLUSIVE)
 
#define REQUEST_DMA_FLAGS    (REQUEST_FLAG_DMA | REQUEST_FLAG_PROGRAM_DMA)
 
#define PCIIDEX_GET_CONTROLLER_INTERFACE_SIGNATURE   (0xFFFFFFFF - 0x1000)
 
#define ATA_CHANNEL_FLAG_PIO_VIA_DMA   0x00000001
 
#define ATA_CHANNEL_FLAG_IS_EXTERNAL   0x00000002
 
#define ATA_CHANNEL_FLAG_NCQ   0x00000004
 
#define ATA_CHANNEL_FLAG_IS_AHCI   0x00000008
 
#define ATA_CHANNEL_FLAG_PIO_FOR_LBA48_XFER   0x00000010
 

Typedefs

typedef struct _IDE_ACPI_TIMING_MODE_BLOCK IDE_ACPI_TIMING_MODE_BLOCK
 
typedef struct _IDE_ACPI_TIMING_MODE_BLOCKPIDE_ACPI_TIMING_MODE_BLOCK
 
typedef struct _ATA_ACPI_TASK_FILE ATA_ACPI_TASK_FILE
 
typedef struct _ATA_ACPI_TASK_FILEPATA_ACPI_TASK_FILE
 
typedef struct _ATA_DEVICE_REQUEST ATA_DEVICE_REQUEST
 
typedef struct _ATA_DEVICE_REQUESTPATA_DEVICE_REQUEST
 
typedef enum _PORT_NOTIFICATION_TYPE PORT_NOTIFICATION_TYPE
 
typedef enum _PORT_NOTIFICATION_TYPEPPORT_NOTIFICATION_TYPE
 
typedef enum _ATA_CONNECTION_STATUS ATA_CONNECTION_STATUS
 
typedef struct _IDE_REGISTERS IDE_REGISTERS
 
typedef struct _IDE_REGISTERSPIDE_REGISTERS
 
typedef struct _CHANNEL_DEVICE_CONFIG CHANNEL_DEVICE_CONFIG
 
typedef struct _CHANNEL_DEVICE_CONFIGPCHANNEL_DEVICE_CONFIG
 
typedef ATA_COMPLETION_ACTION() REQUEST_COMPLETION_ROUTINE(_In_ PATA_DEVICE_REQUEST Request)
 
typedef REQUEST_COMPLETION_ROUTINEPREQUEST_COMPLETION_ROUTINE
 
typedef struct _ATA_IO_CONTEXT_COMMON ATA_IO_CONTEXT_COMMON
 
typedef struct _ATA_IO_CONTEXT_COMMONPATA_IO_CONTEXT_COMMON
 
typedef struct _ATA_TASKFILE ATA_TASKFILE
 
typedef struct _ATA_TASKFILEPATA_TASKFILE
 
typedef _In_ PVOID PortContext
 
typedef _In_ PVOID typedef PORT_NOTIFICATION * PPORT_NOTIFICATION
 
typedef NTSTATUS() CONTROLLER_ATTACH_CHANNEL(_In_ PVOID ChannelContext, _In_ BOOLEAN Attach)
 
typedef CONTROLLER_ATTACH_CHANNELPCONTROLLER_ATTACH_CHANNEL
 
typedef VOID() CHANNEL_SET_DEVICE_DATA(_In_ PVOID ChannelContext, _In_ PDEVICE_OBJECT DeviceObject, _In_ PIDENTIFY_DEVICE_DATA IdentifyDeviceData)
 
typedef CHANNEL_SET_DEVICE_DATAPCHANNEL_SET_DEVICE_DATA
 
typedef PVOID() CHANNEL_GET_INIT_TASK_FILE(_In_ PVOID ChannelContext, _In_ PDEVICE_OBJECT DeviceObject)
 
typedef CHANNEL_GET_INIT_TASK_FILEPCHANNEL_GET_INIT_TASK_FILE
 
typedef BOOLEAN() CHANNEL_DOWNGRADE_INTERFACE_SPEED(_In_ PVOID ChannelContext)
 
typedef CHANNEL_DOWNGRADE_INTERFACE_SPEEDPCHANNEL_DOWNGRADE_INTERFACE_SPEED
 
typedef VOID() CHANNEL_ABORT_CHANNEL(_In_ PVOID ChannelContext, _In_ BOOLEAN DisableInterrupts)
 
typedef CHANNEL_ABORT_CHANNELPCHANNEL_ABORT_CHANNEL
 
typedef VOID() CHANNEL_RESET_CHANNEL(_In_ PVOID ChannelContext)
 
typedef CHANNEL_RESET_CHANNELPCHANNEL_RESET_CHANNEL
 
typedef ULONG() CHANNEL_ENUMERATE_CHANNEL(_In_ PVOID ChannelContext)
 
typedef CHANNEL_ENUMERATE_CHANNELPCHANNEL_ENUMERATE_CHANNEL
 
typedef ATA_CONNECTION_STATUS() CHANNEL_IDENTIFY_DEVICE(_In_ PVOID ChannelContext, _In_ ULONG DeviceNumber)
 
typedef CHANNEL_IDENTIFY_DEVICEPCHANNEL_IDENTIFY_DEVICE
 
typedef CHANNEL_SET_MODE * PCHANNEL_SET_MODE
 
typedef CHANNEL_ALLOCATE_SLOT * PCHANNEL_ALLOCATE_SLOT
 
typedef CHANNEL_PREPARE_PRD_TABLE * PCHANNEL_PREPARE_PRD_TABLE
 
typedef CHANNEL_PREPARE_IO * PCHANNEL_PREPARE_IO
 
typedef CHANNEL_START_IO * PCHANNEL_START_IO
 
typedef NTSTATUS() CONTROLLER_PNP_ADD_DEVICE(_In_ PDRIVER_OBJECT DriverObject, _In_ PDEVICE_OBJECT PhysicalDeviceObject, _Out_ PVOID *ControllerContext)
 
typedef CONTROLLER_PNP_ADD_DEVICEPCONTROLLER_PNP_ADD_DEVICE
 
typedef NTSTATUS() CONTROLLER_PNP_START_DEVICE(_In_ PVOID ControllerContext, _In_ PCM_RESOURCE_LIST ResourcesTranslated)
 
typedef CONTROLLER_PNP_START_DEVICEPCONTROLLER_PNP_START_DEVICE
 
typedef VOID() CONTROLLER_PNP_REMOVE_DEVICE(_In_ PVOID ControllerContext)
 
typedef CONTROLLER_PNP_REMOVE_DEVICEPCONTROLLER_PNP_REMOVE_DEVICE
 
typedef struct _PCIIDEX_LEGACY_CONTROLLER_INTERFACE PCIIDEX_LEGACY_CONTROLLER_INTERFACE
 Legacy detection interface with the PCIIDEX driver.
 
typedef struct _PCIIDEX_LEGACY_CONTROLLER_INTERFACEPPCIIDEX_LEGACY_CONTROLLER_INTERFACE
 
typedef struct _PCIIDEX_CHANNEL_INTERFACE PCIIDEX_CHANNEL_INTERFACE
 Channel interface with the PCIIDEX driver.
 
typedef struct _PCIIDEX_CHANNEL_INTERFACEPPCIIDEX_CHANNEL_INTERFACE
 

Enumerations

enum  _PORT_NOTIFICATION_TYPE {
  AtaRequestComplete = 0 , AtaResetDetected , AtaBusChangeDetected , AtaRequestFailed ,
  AtaAsyncNotificationDetected
}
 
enum  _ATA_CONNECTION_STATUS {
  CONN_STATUS_FAILURE , CONN_STATUS_NO_DEVICE , CONN_STATUS_DEV_UNKNOWN , CONN_STATUS_DEV_ATA ,
  CONN_STATUS_DEV_ATAPI
}
 
enum  ATA_COMPLETION_ACTION { COMPLETE_IRP = 0 , COMPLETE_NO_IRP , COMPLETE_START_AGAIN }
 

Functions

typedef VOID (__cdecl PORT_NOTIFICATION)(_In_ PORT_NOTIFICATION_TYPE NotificationType
 
 _IRQL_requires_ (DISPATCH_LEVEL) typedef VOID(CHANNEL_SET_MODE)(_In_ PVOID ChannelContext
 
 _In_reads_ (ATA_MAX_DEVICE) PCHANNEL_DEVICE_CONFIG *DeviceList)
 
 _IRQL_requires_ (HIGH_LEVEL) typedef BOOLEAN(CHANNEL_START_IO)(_In_ PVOID ChannelContext
 
 DEFINE_GUID (GUID_PCIIDE_INTERFACE_ROS, 0xD677FBCF, 0xABED, 0x47C8, 0x80, 0xA3, 0xE4, 0x34, 0x7E, 0xA4, 0x96, 0x47)
 

Variables

_In_ PATA_DEVICE_REQUEST Request
 
_In_ PATA_DEVICE_REQUEST _In_ BOOLEAN Allocate
 
_In_ PATA_DEVICE_REQUEST _In_ SCATTER_GATHER_LIST *__restrict SgList
 

Macro Definition Documentation

◆ ATA_CHANNEL_FLAG_IS_AHCI

#define ATA_CHANNEL_FLAG_IS_AHCI   0x00000008

Definition at line 538 of file ata_shared.h.

◆ ATA_CHANNEL_FLAG_IS_EXTERNAL

#define ATA_CHANNEL_FLAG_IS_EXTERNAL   0x00000002

Definition at line 536 of file ata_shared.h.

◆ ATA_CHANNEL_FLAG_NCQ

#define ATA_CHANNEL_FLAG_NCQ   0x00000004

Definition at line 537 of file ata_shared.h.

◆ ATA_CHANNEL_FLAG_PIO_FOR_LBA48_XFER

#define ATA_CHANNEL_FLAG_PIO_FOR_LBA48_XFER   0x00000010

Definition at line 539 of file ata_shared.h.

◆ ATA_CHANNEL_FLAG_PIO_VIA_DMA

#define ATA_CHANNEL_FLAG_PIO_VIA_DMA   0x00000001

Definition at line 535 of file ata_shared.h.

◆ ATA_MAX_DEVICE

#define ATA_MAX_DEVICE   15

Maximum number of devices (target ID) per channel

Definition at line 15 of file ata_shared.h.

◆ ATA_MAX_SECTORS_PER_IO

#define ATA_MAX_SECTORS_PER_IO   0x100

Definition at line 25 of file ata_shared.h.

◆ ATA_MAX_TRANSFER_LENGTH

#define ATA_MAX_TRANSFER_LENGTH   (ATA_MAX_SECTORS_PER_IO * ATA_MIN_SECTOR_SIZE)

Definition at line 26 of file ata_shared.h.

◆ ATA_MIN_BUFFER_ALIGNMENT

#define ATA_MIN_BUFFER_ALIGNMENT   FILE_WORD_ALIGNMENT

Minimum DMA buffer alignment because of the reserved PRDT byte 0

Definition at line 30 of file ata_shared.h.

◆ ATA_MIN_SECTOR_SIZE

#define ATA_MIN_SECTOR_SIZE   512

256 sectors of 512 bytes (128 kB).

This ensures that the sector count register will not overflow in LBA-28 and CHS modes. In the case of the sector count (0x100) being truncated to 8-bits, 0 still means 256 sectors.

Definition at line 24 of file ata_shared.h.

◆ DEVICE_HAS_CDB_INTERRUPT

#define DEVICE_HAS_CDB_INTERRUPT   0x00000020

Definition at line 166 of file ata_shared.h.

◆ DEVICE_IS_ATAPI

#define DEVICE_IS_ATAPI   0x00000010

Definition at line 165 of file ata_shared.h.

◆ DEVICE_IS_NEC_CDR260

#define DEVICE_IS_NEC_CDR260   0x00000080

Definition at line 168 of file ata_shared.h.

◆ DEVICE_NEED_DMA_DIRECTION

#define DEVICE_NEED_DMA_DIRECTION   0x00000040

Definition at line 167 of file ata_shared.h.

◆ DEVICE_NUMBER_MASK

#define DEVICE_NUMBER_MASK   0x0000000F

Definition at line 164 of file ata_shared.h.

◆ DEVICE_QUEUE_DEPTH_MASK

#define DEVICE_QUEUE_DEPTH_MASK   0x0000FF00

Definition at line 169 of file ata_shared.h.

◆ DEVICE_QUEUE_DEPTH_SHIFT

#define DEVICE_QUEUE_DEPTH_SHIFT   8

Definition at line 171 of file ata_shared.h.

◆ IDE_ACPI_TIMING_MODE_FLAG_INDEPENDENT_TIMINGS

#define IDE_ACPI_TIMING_MODE_FLAG_INDEPENDENT_TIMINGS   0x10

Independent timing available

Definition at line 53 of file ata_shared.h.

◆ IDE_ACPI_TIMING_MODE_FLAG_IORDY

#define IDE_ACPI_TIMING_MODE_FLAG_IORDY (   Drive)    (0x02 << (2 * (Drive)))

Enable the IORDY signal on drive 0/1

Definition at line 50 of file ata_shared.h.

◆ IDE_ACPI_TIMING_MODE_FLAG_UDMA

#define IDE_ACPI_TIMING_MODE_FLAG_UDMA (   Drive)    (0x01 << (2 * (Drive)))

Use the UDMA mode on drive 0/1

Definition at line 47 of file ata_shared.h.

◆ IDE_ACPI_TIMING_MODE_NOT_SUPPORTED

#define IDE_ACPI_TIMING_MODE_NOT_SUPPORTED   0xFFFFFFFF

The mode is not supported

Definition at line 42 of file ata_shared.h.

◆ PCIIDEX_GET_CONTROLLER_INTERFACE_SIGNATURE

#define PCIIDEX_GET_CONTROLLER_INTERFACE_SIGNATURE   (0xFFFFFFFF - 0x1000)

Definition at line 481 of file ata_shared.h.

◆ PCIIDEX_INTERFACE_VERSION

#define PCIIDEX_INTERFACE_VERSION   1
See also
PCIIDE_INTERFACE

Definition at line 12 of file ata_shared.h.

◆ REQUEST_DMA_FLAGS

#define REQUEST_DMA_FLAGS    (REQUEST_FLAG_DMA | REQUEST_FLAG_PROGRAM_DMA)

DMA command translation

Definition at line 369 of file ata_shared.h.

◆ REQUEST_EXCLUSIVE_ACCESS_FLAGS

#define REQUEST_EXCLUSIVE_ACCESS_FLAGS    (REQUEST_FLAG_SAVE_TASK_FILE | REQUEST_FLAG_EXCLUSIVE)

Exclusive port access required.

1) Since there is only one Received FIS structure, it should be necessary to synchronize RFIS reads amongst multiple I/O requests.

2) We also mark all requests that modify the device extension state (IDE_COMMAND_IDENTIFY, IDE_COMMAND_ATAPI_IDENTIFY, IDE_COMMAND_SET_FEATURE, and others) as REQUEST_FLAG_EXCLUSIVE.

Definition at line 365 of file ata_shared.h.

◆ REQUEST_FLAG_DATA_IN

#define REQUEST_FLAG_DATA_IN   0x00000040

Data-In command

Definition at line 287 of file ata_shared.h.

◆ REQUEST_FLAG_DATA_OUT

#define REQUEST_FLAG_DATA_OUT   0x00000080

Data-Out command

Definition at line 290 of file ata_shared.h.

◆ REQUEST_FLAG_DEVICE_EXCLUSIVE_ACCESS

#define REQUEST_FLAG_DEVICE_EXCLUSIVE_ACCESS   0x01000000

Definition at line 350 of file ata_shared.h.

◆ REQUEST_FLAG_DMA

#define REQUEST_FLAG_DMA   0x00000001

ATA protocols DMA ATA command

Definition at line 278 of file ata_shared.h.

◆ REQUEST_FLAG_EXCLUSIVE

#define REQUEST_FLAG_EXCLUSIVE   0x00004000

Exclusive port access required

Definition at line 324 of file ata_shared.h.

◆ REQUEST_FLAG_FUA

#define REQUEST_FLAG_FUA   0x00000100

Forced unit access command

Definition at line 306 of file ata_shared.h.

◆ REQUEST_FLAG_HAS_LOCAL_BUFFER

#define REQUEST_FLAG_HAS_LOCAL_BUFFER   0x00008000

The request owns the local buffer

Definition at line 327 of file ata_shared.h.

◆ REQUEST_FLAG_HAS_MDL

#define REQUEST_FLAG_HAS_MDL   0x00020000

The request owns the MDL and will also release it

Definition at line 333 of file ata_shared.h.

◆ REQUEST_FLAG_HAS_RESERVED_MAPPING

#define REQUEST_FLAG_HAS_RESERVED_MAPPING   0x00080000

The request owns the reserved memory mapping and will also release it

Definition at line 336 of file ata_shared.h.

◆ REQUEST_FLAG_HAS_SG_LIST

#define REQUEST_FLAG_HAS_SG_LIST   0x00010000

The request owns the S/G list and will also release it

Definition at line 330 of file ata_shared.h.

◆ REQUEST_FLAG_HAS_TASK_FILE

#define REQUEST_FLAG_HAS_TASK_FILE   0x00000400

Holds the saved contents of task file registers

Definition at line 312 of file ata_shared.h.

◆ REQUEST_FLAG_INTERNAL

#define REQUEST_FLAG_INTERNAL   0x00400000

Internal command

Definition at line 345 of file ata_shared.h.

◆ REQUEST_FLAG_LBA48

#define REQUEST_FLAG_LBA48   0x00000008

48-bit command

Definition at line 297 of file ata_shared.h.

◆ REQUEST_FLAG_NCQ

#define REQUEST_FLAG_NCQ   0x00000004

DMA Queued command

Definition at line 284 of file ata_shared.h.

◆ REQUEST_FLAG_NO_KEEP_AWAKE

#define REQUEST_FLAG_NO_KEEP_AWAKE   0x00100000

Copy of SRB_FLAGS_NO_KEEP_AWAKE

Definition at line 339 of file ata_shared.h.

◆ REQUEST_FLAG_PACKET_COMMAND

#define REQUEST_FLAG_PACKET_COMMAND   0x00000002

ATAPI PACKET command

Definition at line 281 of file ata_shared.h.

◆ REQUEST_FLAG_PASSTHROUGH

#define REQUEST_FLAG_PASSTHROUGH   0x00800000

ATA or SCSI pass-through command

Definition at line 348 of file ata_shared.h.

◆ REQUEST_FLAG_POLL

#define REQUEST_FLAG_POLL   0x80000000

Polled command

Definition at line 353 of file ata_shared.h.

◆ REQUEST_FLAG_PROGRAM_DMA

#define REQUEST_FLAG_PROGRAM_DMA   0x00200000

Use the DMA engine for the transfer

Definition at line 342 of file ata_shared.h.

◆ REQUEST_FLAG_READ_WRITE

#define REQUEST_FLAG_READ_WRITE   0x00000020

ATA read/write command

Definition at line 303 of file ata_shared.h.

◆ REQUEST_FLAG_READ_WRITE_MULTIPLE

#define REQUEST_FLAG_READ_WRITE_MULTIPLE   0x00000010

Multiple mode command

Definition at line 300 of file ata_shared.h.

◆ REQUEST_FLAG_RST_COMMAND

#define REQUEST_FLAG_RST_COMMAND   0x00040000

Software Reset command (AHCI only)

Definition at line 293 of file ata_shared.h.

◆ REQUEST_FLAG_SAVE_TASK_FILE

#define REQUEST_FLAG_SAVE_TASK_FILE   0x00000200

Return the contents of task file registers to the caller

Definition at line 309 of file ata_shared.h.

◆ REQUEST_FLAG_SET_AUXILIARY_FIELD

#define REQUEST_FLAG_SET_AUXILIARY_FIELD   0x00001000

Has extra bits in the Auxiliary field

Definition at line 318 of file ata_shared.h.

◆ REQUEST_FLAG_SET_DEVICE_REGISTER

#define REQUEST_FLAG_SET_DEVICE_REGISTER   0x00000800

Has extra bits in the device register

Definition at line 315 of file ata_shared.h.

◆ REQUEST_FLAG_SET_ICC_FIELD

#define REQUEST_FLAG_SET_ICC_FIELD   0x00002000

Has extra bits in the Isochronous Command Completion field

Definition at line 321 of file ata_shared.h.

◆ REQUEST_STATE_FREEZE_QUEUE

#define REQUEST_STATE_FREEZE_QUEUE   3

Freeze the device queue upon completion of IRP

Definition at line 273 of file ata_shared.h.

◆ REQUEST_STATE_NONE

#define REQUEST_STATE_NONE   0

Initial state

Definition at line 264 of file ata_shared.h.

◆ REQUEST_STATE_NOT_STARTED

#define REQUEST_STATE_NOT_STARTED   1

SRB not translated into the device request or translaton failed

Definition at line 267 of file ata_shared.h.

◆ REQUEST_STATE_REQUEUE

#define REQUEST_STATE_REQUEUE   2

Requeue the device request

Definition at line 270 of file ata_shared.h.

Typedef Documentation

◆ ATA_ACPI_TASK_FILE

_GTF data buffer

◆ ATA_CONNECTION_STATUS

◆ ATA_DEVICE_REQUEST

ATA device request context

Definition at line 70 of file ata_shared.h.

◆ ATA_IO_CONTEXT_COMMON

◆ ATA_TASKFILE

ATA Task File interface

◆ CHANNEL_ABORT_CHANNEL

typedef VOID() CHANNEL_ABORT_CHANNEL(_In_ PVOID ChannelContext, _In_ BOOLEAN DisableInterrupts)

Definition at line 403 of file ata_shared.h.

◆ CHANNEL_DEVICE_CONFIG

◆ CHANNEL_DOWNGRADE_INTERFACE_SPEED

typedef BOOLEAN() CHANNEL_DOWNGRADE_INTERFACE_SPEED(_In_ PVOID ChannelContext)

Definition at line 398 of file ata_shared.h.

◆ CHANNEL_ENUMERATE_CHANNEL

typedef ULONG() CHANNEL_ENUMERATE_CHANNEL(_In_ PVOID ChannelContext)

Definition at line 414 of file ata_shared.h.

◆ CHANNEL_GET_INIT_TASK_FILE

typedef PVOID() CHANNEL_GET_INIT_TASK_FILE(_In_ PVOID ChannelContext, _In_ PDEVICE_OBJECT DeviceObject)

Definition at line 392 of file ata_shared.h.

◆ CHANNEL_IDENTIFY_DEVICE

typedef ATA_CONNECTION_STATUS() CHANNEL_IDENTIFY_DEVICE(_In_ PVOID ChannelContext, _In_ ULONG DeviceNumber)

Definition at line 419 of file ata_shared.h.

◆ CHANNEL_RESET_CHANNEL

typedef VOID() CHANNEL_RESET_CHANNEL(_In_ PVOID ChannelContext)

Definition at line 409 of file ata_shared.h.

◆ CHANNEL_SET_DEVICE_DATA

typedef VOID() CHANNEL_SET_DEVICE_DATA(_In_ PVOID ChannelContext, _In_ PDEVICE_OBJECT DeviceObject, _In_ PIDENTIFY_DEVICE_DATA IdentifyDeviceData)

Definition at line 385 of file ata_shared.h.

◆ CONTROLLER_ATTACH_CHANNEL

typedef NTSTATUS() CONTROLLER_ATTACH_CHANNEL(_In_ PVOID ChannelContext, _In_ BOOLEAN Attach)

Definition at line 379 of file ata_shared.h.

◆ CONTROLLER_PNP_ADD_DEVICE

typedef NTSTATUS() CONTROLLER_PNP_ADD_DEVICE(_In_ PDRIVER_OBJECT DriverObject, _In_ PDEVICE_OBJECT PhysicalDeviceObject, _Out_ PVOID *ControllerContext)

Definition at line 462 of file ata_shared.h.

◆ CONTROLLER_PNP_REMOVE_DEVICE

typedef VOID() CONTROLLER_PNP_REMOVE_DEVICE(_In_ PVOID ControllerContext)

Definition at line 475 of file ata_shared.h.

◆ CONTROLLER_PNP_START_DEVICE

typedef NTSTATUS() CONTROLLER_PNP_START_DEVICE(_In_ PVOID ControllerContext, _In_ PCM_RESOURCE_LIST ResourcesTranslated)

Definition at line 469 of file ata_shared.h.

◆ IDE_ACPI_TIMING_MODE_BLOCK

IDE channel timing information block

◆ IDE_REGISTERS

◆ PATA_ACPI_TASK_FILE

◆ PATA_DEVICE_REQUEST

Definition at line 70 of file ata_shared.h.

◆ PATA_IO_CONTEXT_COMMON

◆ PATA_TASKFILE

◆ PCHANNEL_ABORT_CHANNEL

Definition at line 407 of file ata_shared.h.

◆ PCHANNEL_ALLOCATE_SLOT

typedef CHANNEL_ALLOCATE_SLOT* PCHANNEL_ALLOCATE_SLOT

Definition at line 438 of file ata_shared.h.

◆ PCHANNEL_DEVICE_CONFIG

◆ PCHANNEL_DOWNGRADE_INTERFACE_SPEED

◆ PCHANNEL_ENUMERATE_CHANNEL

◆ PCHANNEL_GET_INIT_TASK_FILE

◆ PCHANNEL_IDENTIFY_DEVICE

Definition at line 423 of file ata_shared.h.

◆ PCHANNEL_PREPARE_IO

typedef CHANNEL_PREPARE_IO* PCHANNEL_PREPARE_IO

Definition at line 453 of file ata_shared.h.

◆ PCHANNEL_PREPARE_PRD_TABLE

typedef CHANNEL_PREPARE_PRD_TABLE* PCHANNEL_PREPARE_PRD_TABLE

Definition at line 446 of file ata_shared.h.

◆ PCHANNEL_RESET_CHANNEL

Definition at line 412 of file ata_shared.h.

◆ PCHANNEL_SET_DEVICE_DATA

Definition at line 390 of file ata_shared.h.

◆ PCHANNEL_SET_MODE

typedef CHANNEL_SET_MODE* PCHANNEL_SET_MODE

Definition at line 430 of file ata_shared.h.

◆ PCHANNEL_START_IO

typedef CHANNEL_START_IO* PCHANNEL_START_IO

Definition at line 460 of file ata_shared.h.

◆ PCIIDEX_CHANNEL_INTERFACE

Channel interface with the PCIIDEX driver.

This interface is ROS-specific.

◆ PCIIDEX_LEGACY_CONTROLLER_INTERFACE

Legacy detection interface with the PCIIDEX driver.

Note
This interface is ROS-specific.

◆ PCONTROLLER_ATTACH_CHANNEL

◆ PCONTROLLER_PNP_ADD_DEVICE

◆ PCONTROLLER_PNP_REMOVE_DEVICE

◆ PCONTROLLER_PNP_START_DEVICE

◆ PIDE_ACPI_TIMING_MODE_BLOCK

◆ PIDE_REGISTERS

◆ PORT_NOTIFICATION_TYPE

◆ PortContext

Definition at line 375 of file ata_shared.h.

◆ PPCIIDEX_CHANNEL_INTERFACE

◆ PPCIIDEX_LEGACY_CONTROLLER_INTERFACE

◆ PPORT_NOTIFICATION

typedef _In_ PVOID typedef PORT_NOTIFICATION* PPORT_NOTIFICATION

Definition at line 377 of file ata_shared.h.

◆ PPORT_NOTIFICATION_TYPE

◆ PREQUEST_COMPLETION_ROUTINE

◆ REQUEST_COMPLETION_ROUTINE

typedef ATA_COMPLETION_ACTION() REQUEST_COMPLETION_ROUTINE(_In_ PATA_DEVICE_REQUEST Request)

Definition at line 154 of file ata_shared.h.

Enumeration Type Documentation

◆ _ATA_CONNECTION_STATUS

Enumerator
CONN_STATUS_FAILURE 
CONN_STATUS_NO_DEVICE 
CONN_STATUS_DEV_UNKNOWN 
CONN_STATUS_DEV_ATA 
CONN_STATUS_DEV_ATAPI 

Definition at line 81 of file ata_shared.h.

82{
@ CONN_STATUS_FAILURE
Definition: ata_shared.h:83
@ CONN_STATUS_DEV_UNKNOWN
Definition: ata_shared.h:85
@ CONN_STATUS_DEV_ATA
Definition: ata_shared.h:86
@ CONN_STATUS_DEV_ATAPI
Definition: ata_shared.h:87
@ CONN_STATUS_NO_DEVICE
Definition: ata_shared.h:84
enum _ATA_CONNECTION_STATUS ATA_CONNECTION_STATUS

◆ _PORT_NOTIFICATION_TYPE

Enumerator
AtaRequestComplete 
AtaResetDetected 
AtaBusChangeDetected 
AtaRequestFailed 
AtaAsyncNotificationDetected 

Definition at line 72 of file ata_shared.h.

73{
enum _PORT_NOTIFICATION_TYPE PORT_NOTIFICATION_TYPE
enum _PORT_NOTIFICATION_TYPE * PPORT_NOTIFICATION_TYPE
@ AtaRequestFailed
Definition: ata_shared.h:77
@ AtaBusChangeDetected
Definition: ata_shared.h:76
@ AtaAsyncNotificationDetected
Definition: ata_shared.h:78
@ AtaResetDetected
Definition: ata_shared.h:75
@ AtaRequestComplete
Definition: ata_shared.h:74

◆ ATA_COMPLETION_ACTION

Enumerator
COMPLETE_IRP 
COMPLETE_NO_IRP 
COMPLETE_START_AGAIN 

Definition at line 147 of file ata_shared.h.

148{
149 COMPLETE_IRP = 0,
ATA_COMPLETION_ACTION
Definition: ata_shared.h:148
@ COMPLETE_START_AGAIN
Definition: ata_shared.h:151
@ COMPLETE_NO_IRP
Definition: ata_shared.h:150
@ COMPLETE_IRP
Definition: ata_shared.h:149

Function Documentation

◆ _In_reads_()

_In_reads_ ( ATA_MAX_DEVICE  )

◆ _IRQL_requires_() [1/2]

_IRQL_requires_ ( DISPATCH_LEVEL  )

Definition at line 394 of file expool.c.

1465{
1466 SIZE_T OldSize = PoolBigPageTableSize;
1467 SIZE_T NewSize, NewSizeInBytes;
1468 PPOOL_TRACKER_BIG_PAGES NewTable;
1469 PPOOL_TRACKER_BIG_PAGES OldTable;
1470 ULONG i;
1471 ULONG PagesFreed;
1472 ULONG Hash;
1473 ULONG HashMask;
1474
1475 /* Must be holding ExpLargePoolTableLock */
1477
1478 /* Make sure we don't overflow */
1479 if (Shrink)
1480 {
1481 NewSize = OldSize / 2;
1482
1483 /* Make sure we don't shrink too much. */
1485
1487 ASSERT(NewSize <= OldSize);
1488
1489 /* If there is only one page left, then keep it around. Not a failure either. */
1490 if (NewSize == OldSize)
1491 {
1494 return TRUE;
1495 }
1496 }
1497 else
1498 {
1499 if (!NT_SUCCESS(RtlSIZETMult(2, OldSize, &NewSize)))
1500 {
1501 DPRINT1("Overflow expanding big page table. Size=%lu\n", OldSize);
1503 return FALSE;
1504 }
1505
1506 /* Make sure we don't stupidly waste pages */
1508 ASSERT(NewSize > OldSize);
1509 }
1510
1511 if (!NT_SUCCESS(RtlSIZETMult(sizeof(POOL_TRACKER_BIG_PAGES), NewSize, &NewSizeInBytes)))
1512 {
1513 DPRINT1("Overflow while calculating big page table size. Size=%lu\n", OldSize);
1515 return FALSE;
1516 }
1517
1518 NewTable = MiAllocatePoolPages(NonPagedPool, NewSizeInBytes);
1519 if (NewTable == NULL)
1520 {
1521 DPRINT("Could not allocate %lu bytes for new big page table\n", NewSizeInBytes);
1523 return FALSE;
1524 }
1525
1526 DPRINT("%s big pool tracker table to %lu entries\n", Shrink ? "Shrinking" : "Expanding", NewSize);
1527
1528 /* Initialize the new table */
1529 RtlZeroMemory(NewTable, NewSizeInBytes);
1530 for (i = 0; i < NewSize; i++)
1531 {
1532 NewTable[i].Va = (PVOID)POOL_BIG_TABLE_ENTRY_FREE;
1533 }
1534
1535 /* Copy over all items */
1536 OldTable = PoolBigPageTable;
1537 HashMask = NewSize - 1;
1538 for (i = 0; i < OldSize; i++)
1539 {
1540 /* Skip over empty items */
1541 if ((ULONG_PTR)OldTable[i].Va & POOL_BIG_TABLE_ENTRY_FREE)
1542 {
1543 continue;
1544 }
1545
1546 /* Recalculate the hash due to the new table size */
1547 Hash = ExpComputePartialHashForAddress(OldTable[i].Va) % HashMask;
1548
1549 /* Find the location in the new table */
1550 while (!((ULONG_PTR)NewTable[Hash].Va & POOL_BIG_TABLE_ENTRY_FREE))
1551 {
1552 if (++Hash == NewSize)
1553 Hash = 0;
1554 }
1555
1556 /* We must have space */
1558
1559 /* Finally, copy the item */
1560 NewTable[Hash] = OldTable[i];
1561 }
1562
1563 /* Activate the new table */
1564 PoolBigPageTable = NewTable;
1567
1568 /* Release the lock, we're done changing global state */
1570
1571 /* Free the old table and update our tracker */
1572 PagesFreed = MiFreePoolPages(OldTable);
1573 ExpRemovePoolTracker('looP', PagesFreed << PAGE_SHIFT, 0);
1574 ExpInsertPoolTracker('looP', ALIGN_UP_BY(NewSizeInBytes, PAGE_SIZE), 0);
1575
1576 return TRUE;
1577}
#define ALIGN_DOWN_BY(size, align)
#define ALIGN_UP_BY(size, align)
#define DPRINT1
Definition: precomp.h:8
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:33
static int Hash(const char *)
Definition: reader.c:2237
#define KeReleaseSpinLock(sl, irql)
Definition: env_spec_w32.h:627
#define PAGE_SIZE
Definition: env_spec_w32.h:49
#define PAGE_SHIFT
Definition: env_spec_w32.h:45
#define KeGetCurrentIrql()
Definition: env_spec_w32.h:706
#define NonPagedPool
Definition: env_spec_w32.h:307
#define DISPATCH_LEVEL
Definition: env_spec_w32.h:696
ULONG ExpPoolBigEntriesInUse
Definition: expool.c:55
VOID NTAPI ExpRemovePoolTracker(IN ULONG Key, IN SIZE_T NumberOfBytes, IN POOL_TYPE PoolType)
Definition: expool.c:760
SIZE_T PoolBigPageTableSize
Definition: expool.c:47
FORCEINLINE ULONG ExpComputePartialHashForAddress(IN PVOID BaseAddress)
Definition: expool.c:457
PPOOL_TRACKER_BIG_PAGES PoolBigPageTable
Definition: expool.c:50
#define POOL_BIG_TABLE_ENTRY_FREE
Definition: expool.c:23
KSPIN_LOCK ExpLargePoolTableLock
Definition: expool.c:54
VOID NTAPI ExpInsertPoolTracker(IN ULONG Key, IN SIZE_T NumberOfBytes, IN POOL_TYPE PoolType)
Definition: expool.c:851
SIZE_T PoolBigPageTableHash
Definition: expool.c:47
_Must_inspect_result_ _In_ USHORT NewSize
Definition: fltkernel.h:975
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define ASSERT(a)
Definition: mode.c:44
PVOID NTAPI MiAllocatePoolPages(IN POOL_TYPE PoolType, IN SIZE_T SizeInBytes)
Definition: pool.c:422
ULONG NTAPI MiFreePoolPages(IN PVOID StartingAddress)
Definition: pool.c:918
#define DPRINT
Definition: sndvol32.h:73
void * PVOID
Definition: typedefs.h:50
ULONG_PTR SIZE_T
Definition: typedefs.h:80
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262
uint32_t ULONG_PTR
Definition: typedefs.h:65
uint32_t ULONG
Definition: typedefs.h:59
_Requires_lock_held_ Interrupt _Releases_lock_ Interrupt _In_ _IRQL_restores_ KIRQL OldIrql
Definition: kefuncs.h:778

◆ _IRQL_requires_() [2/2]

_IRQL_requires_ ( HIGH_LEVEL  )

◆ DEFINE_GUID()

DEFINE_GUID ( GUID_PCIIDE_INTERFACE_ROS  ,
0xD677FBCF  ,
0xABED  ,
0x47C8  ,
0x80  ,
0xA3  ,
0xE4  ,
0x34  ,
0x7E  ,
0xA4  ,
0x96  ,
0x47   
)

◆ VOID()

typedef VOID ( __cdecl  PORT_NOTIFICATION)

Variable Documentation

◆ Allocate

◆ Request

Definition at line 436 of file ata_shared.h.

◆ SgList

Definition at line 445 of file ata_shared.h.