ReactOS  0.4.14-dev-1233-gf5658fd
ide.h File Reference
#include <pshpack1.h>
#include <poppack.h>
Include dependency graph for ide.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  _IDENTIFY_DATA
 
struct  _EXTENDED_IDENTIFY_DATA
 
struct  _PCIIDE_TRANSFER_MODE_SELECT
 
struct  _IDE_CONTROLLER_PROPERTIES
 

Macros

#define MAX_IDE_CHANNEL   2
 
#define MAX_IDE_LINE   2
 
#define MAX_IDE_DEVICE   2
 
#define PIO_MODE0   (1 << 0)
 
#define PIO_MODE1   (1 << 1)
 
#define PIO_MODE2   (1 << 2)
 
#define PIO_MODE3   (1 << 3)
 
#define PIO_MODE4   (1 << 4)
 
#define SWDMA_MODE0   (1 << 5)
 
#define SWDMA_MODE1   (1 << 6)
 
#define SWDMA_MODE2   (1 << 7)
 
#define MWDMA_MODE0   (1 << 8)
 
#define MWDMA_MODE1   (1 << 9)
 
#define MWDMA_MODE2   (1 << 10)
 
#define UDMA_MODE0   (1 << 11)
 
#define UDMA_MODE1   (1 << 12)
 
#define UDMA_MODE2   (1 << 13)
 
#define UDMA_MODE3   (1 << 14)
 
#define UDMA_MODE4   (1 << 15)
 
#define UDMA_MODE5   (1 << 16)
 

Typedefs

typedef struct _IDENTIFY_DATA IDENTIFY_DATA
 
typedef struct _IDENTIFY_DATAPIDENTIFY_DATA
 
typedef struct _EXTENDED_IDENTIFY_DATA EXTENDED_IDENTIFY_DATA
 
typedef struct _EXTENDED_IDENTIFY_DATAPEXTENDED_IDENTIFY_DATA
 
typedef struct _PCIIDE_TRANSFER_MODE_SELECT PCIIDE_TRANSFER_MODE_SELECT
 
typedef struct _PCIIDE_TRANSFER_MODE_SELECTPPCIIDE_TRANSFER_MODE_SELECT
 
typedef IDE_CHANNEL_STATE(NTAPIPCIIDE_CHANNEL_ENABLED) (IN PVOID DeviceExtension, IN ULONG Channel)
 
typedef BOOLEAN(NTAPIPCIIDE_SYNC_ACCESS_REQUIRED) (IN PVOID DeviceExtension)
 
typedef NTSTATUS(NTAPIPCIIDE_TRANSFER_MODE_SELECT_FUNC) (IN PVOID DeviceExtension, IN OUT PPCIIDE_TRANSFER_MODE_SELECT XferMode)
 
typedef ULONG(NTAPIPCIIDE_USEDMA_FUNC) (IN PVOID DeviceExtension, IN PUCHAR CdbCommand, IN PUCHAR Slave)
 
typedef NTSTATUS(NTAPIPCIIDE_UDMA_MODES_SUPPORTED) (IN IDENTIFY_DATA IdentifyData, OUT PULONG BestXferMode, OUT PULONG CurrentXferMode)
 
typedef struct _IDE_CONTROLLER_PROPERTIES IDE_CONTROLLER_PROPERTIES
 
typedef struct _IDE_CONTROLLER_PROPERTIESPIDE_CONTROLLER_PROPERTIES
 
typedef NTSTATUS(NTAPIPCONTROLLER_PROPERTIES) (IN PVOID DeviceExtension, IN PIDE_CONTROLLER_PROPERTIES ControllerProperties)
 

Enumerations

enum  IDE_CHANNEL_STATE {
  ChannelDisabled = 0, ChannelEnabled, ChannelStateUnknown, ChannelDisabled = 0,
  ChannelEnabled, ChannelStateUnknown
}
 

Functions

NTSTATUS NTAPI PciIdeXInitialize (IN PDRIVER_OBJECT DriverObject, IN PUNICODE_STRING RegistryPath, IN PCONTROLLER_PROPERTIES HwGetControllerProperties, IN ULONG ExtensionSize)
 
NTSTATUS NTAPI PciIdeXGetBusData (IN PVOID DeviceExtension, IN PVOID Buffer, IN ULONG ConfigDataOffset, IN ULONG BufferLength)
 
NTSTATUS NTAPI PciIdeXSetBusData (IN PVOID DeviceExtension, IN PVOID Buffer, IN PVOID DataMask, IN ULONG ConfigDataOffset, IN ULONG BufferLength)
 

Macro Definition Documentation

◆ MAX_IDE_CHANNEL

#define MAX_IDE_CHANNEL   2

Definition at line 30 of file ide.h.

◆ MAX_IDE_DEVICE

#define MAX_IDE_DEVICE   2

Definition at line 32 of file ide.h.

◆ MAX_IDE_LINE

#define MAX_IDE_LINE   2

Definition at line 31 of file ide.h.

◆ MWDMA_MODE0

#define MWDMA_MODE0   (1 << 8)

Definition at line 286 of file ide.h.

◆ MWDMA_MODE1

#define MWDMA_MODE1   (1 << 9)

Definition at line 287 of file ide.h.

◆ MWDMA_MODE2

#define MWDMA_MODE2   (1 << 10)

Definition at line 288 of file ide.h.

◆ PIO_MODE0

#define PIO_MODE0   (1 << 0)

Definition at line 276 of file ide.h.

◆ PIO_MODE1

#define PIO_MODE1   (1 << 1)

Definition at line 277 of file ide.h.

◆ PIO_MODE2

#define PIO_MODE2   (1 << 2)

Definition at line 278 of file ide.h.

◆ PIO_MODE3

#define PIO_MODE3   (1 << 3)

Definition at line 279 of file ide.h.

◆ PIO_MODE4

#define PIO_MODE4   (1 << 4)

Definition at line 280 of file ide.h.

◆ SWDMA_MODE0

#define SWDMA_MODE0   (1 << 5)

Definition at line 282 of file ide.h.

◆ SWDMA_MODE1

#define SWDMA_MODE1   (1 << 6)

Definition at line 283 of file ide.h.

◆ SWDMA_MODE2

#define SWDMA_MODE2   (1 << 7)

Definition at line 284 of file ide.h.

◆ UDMA_MODE0

#define UDMA_MODE0   (1 << 11)

Definition at line 290 of file ide.h.

◆ UDMA_MODE1

#define UDMA_MODE1   (1 << 12)

Definition at line 291 of file ide.h.

◆ UDMA_MODE2

#define UDMA_MODE2   (1 << 13)

Definition at line 292 of file ide.h.

◆ UDMA_MODE3

#define UDMA_MODE3   (1 << 14)

Definition at line 293 of file ide.h.

◆ UDMA_MODE4

#define UDMA_MODE4   (1 << 15)

Definition at line 294 of file ide.h.

◆ UDMA_MODE5

#define UDMA_MODE5   (1 << 16)

Definition at line 295 of file ide.h.

Typedef Documentation

◆ EXTENDED_IDENTIFY_DATA

◆ IDE_CONTROLLER_PROPERTIES

◆ IDENTIFY_DATA

◆ PCIIDE_CHANNEL_ENABLED

typedef IDE_CHANNEL_STATE(NTAPI * PCIIDE_CHANNEL_ENABLED) (IN PVOID DeviceExtension, IN ULONG Channel)

Definition at line 203 of file ide.h.

◆ PCIIDE_SYNC_ACCESS_REQUIRED

typedef BOOLEAN(NTAPI * PCIIDE_SYNC_ACCESS_REQUIRED) (IN PVOID DeviceExtension)

Definition at line 208 of file ide.h.

◆ PCIIDE_TRANSFER_MODE_SELECT

◆ PCIIDE_TRANSFER_MODE_SELECT_FUNC

typedef NTSTATUS(NTAPI * PCIIDE_TRANSFER_MODE_SELECT_FUNC) (IN PVOID DeviceExtension, IN OUT PPCIIDE_TRANSFER_MODE_SELECT XferMode)

Definition at line 212 of file ide.h.

◆ PCIIDE_UDMA_MODES_SUPPORTED

typedef NTSTATUS(NTAPI * PCIIDE_UDMA_MODES_SUPPORTED) (IN IDENTIFY_DATA IdentifyData, OUT PULONG BestXferMode, OUT PULONG CurrentXferMode)

Definition at line 223 of file ide.h.

◆ PCIIDE_USEDMA_FUNC

typedef ULONG(NTAPI * PCIIDE_USEDMA_FUNC) (IN PVOID DeviceExtension, IN PUCHAR CdbCommand, IN PUCHAR Slave)

Definition at line 217 of file ide.h.

◆ PCONTROLLER_PROPERTIES

typedef NTSTATUS(NTAPI * PCONTROLLER_PROPERTIES) (IN PVOID DeviceExtension, IN PIDE_CONTROLLER_PROPERTIES ControllerProperties)

Definition at line 245 of file ide.h.

◆ PEXTENDED_IDENTIFY_DATA

◆ PIDE_CONTROLLER_PROPERTIES

◆ PIDENTIFY_DATA

◆ PPCIIDE_TRANSFER_MODE_SELECT

Enumeration Type Documentation

◆ IDE_CHANNEL_STATE

Enumerator
ChannelDisabled 
ChannelEnabled 
ChannelStateUnknown 
ChannelDisabled 
ChannelEnabled 
ChannelStateUnknown 

Definition at line 195 of file ide.h.

196 {
197  ChannelDisabled = 0,
IDE_CHANNEL_STATE
Definition: ide.h:259

Function Documentation

◆ PciIdeXGetBusData()

NTSTATUS NTAPI PciIdeXGetBusData ( IN PVOID  DeviceExtension,
IN PVOID  Buffer,
IN ULONG  ConfigDataOffset,
IN ULONG  BufferLength 
)

Definition at line 130 of file miniport.c.

135 {
136  PFDO_DEVICE_EXTENSION FdoDeviceExtension;
139 
140  DPRINT("PciIdeXGetBusData(%p %p 0x%lx 0x%lx)\n",
141  DeviceExtension, Buffer, ConfigDataOffset, BufferLength);
142 
143  FdoDeviceExtension = CONTAINING_RECORD(DeviceExtension, FDO_DEVICE_EXTENSION, MiniControllerExtension);
144  if (FdoDeviceExtension->BusInterface)
145  {
146  BytesRead = (*FdoDeviceExtension->BusInterface->GetBusData)(
147  FdoDeviceExtension->BusInterface->Context,
149  Buffer,
150  ConfigDataOffset,
151  BufferLength);
152  if (BytesRead == BufferLength)
154  }
155 
156  return Status;
157 }
PBUS_INTERFACE_STANDARD BusInterface
Definition: pciidex.h:23
LONG NTSTATUS
Definition: precomp.h:26
_In_ ULONG BufferLength
Definition: usbdlib.h:225
void DPRINT(...)
Definition: polytest.cpp:61
Definition: bufpool.h:45
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
PGET_SET_DEVICE_DATA GetBusData
Definition: iotypes.h:884
#define PCI_WHICHSPACE_CONFIG
Definition: iotypes.h:3288
#define STATUS_UNSUCCESSFUL
Definition: udferr_usr.h:132
Status
Definition: gdiplustypes.h:24
unsigned int ULONG
Definition: retypes.h:1
return STATUS_SUCCESS
Definition: btrfs.c:2938
_Must_inspect_result_ _In_ PFILE_OBJECT _In_opt_ PLARGE_INTEGER _In_ ULONG _In_ FLT_IO_OPERATION_FLAGS _Out_opt_ PULONG BytesRead
Definition: fltkernel.h:1255

Referenced by PciIdeChannelEnabled(), and PciIdeXSetBusData().

◆ PciIdeXInitialize()

NTSTATUS NTAPI PciIdeXInitialize ( IN PDRIVER_OBJECT  DriverObject,
IN PUNICODE_STRING  RegistryPath,
IN PCONTROLLER_PROPERTIES  HwGetControllerProperties,
IN ULONG  ExtensionSize 
)

Definition at line 94 of file miniport.c.

99 {
100  ULONG i;
103 
104  DPRINT("PciIdeXInitialize(%p '%wZ' %p 0x%lx)\n",
105  DriverObject, RegistryPath, HwGetControllerProperties, ExtensionSize);
106 
108  DriverObject,
109  DriverObject,
110  sizeof(PCIIDEX_DRIVER_EXTENSION),
112  if (!NT_SUCCESS(Status))
113  return Status;
115  DriverExtension->MiniControllerExtensionSize = ExtensionSize;
116  DriverExtension->HwGetControllerProperties = HwGetControllerProperties;
117 
119 
120  for (i = 0; i <= IRP_MJ_MAXIMUM_FUNCTION; i++)
122  DriverObject->MajorFunction[IRP_MJ_POWER] = PciIdeXPowerDispatch;
123  DriverObject->MajorFunction[IRP_MJ_PNP] = PciIdeXPnpDispatch;
124 
125  return STATUS_SUCCESS;
126 }
NTSTATUS NTAPI IoAllocateDriverObjectExtension(IN PDRIVER_OBJECT DriverObject, IN PVOID ClientIdentificationAddress, IN ULONG DriverObjectExtensionSize, OUT PVOID *DriverObjectExtension)
Definition: driver.c:1779
#define IRP_MJ_PNP
Definition: cdrw_usr.h:52
#define IRP_MJ_MAXIMUM_FUNCTION
LONG NTSTATUS
Definition: precomp.h:26
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
PDRIVER_EXTENSION DriverExtension
Definition: iotypes.h:2174
DRIVER_ADD_DEVICE PciIdeXAddDevice
Definition: pciidex.h:43
static PDRIVER_OBJECT DriverObject
Definition: template.c:42
void DPRINT(...)
Definition: polytest.cpp:61
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#define IRP_MJ_POWER
PPCI_DRIVER_EXTENSION DriverExtension
Definition: pci.c:41
Status
Definition: gdiplustypes.h:24
PDRIVER_ADD_DEVICE AddDevice
Definition: iotypes.h:2112
PDRIVER_DISPATCH MajorFunction[IRP_MJ_MAXIMUM_FUNCTION+1]
Definition: iotypes.h:2181
unsigned int ULONG
Definition: retypes.h:1
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:261
_In_ PUNICODE_STRING RegistryPath
Definition: wmip.h:28
static DRIVER_DISPATCH PciIdeXForwardOrIgnore
Definition: miniport.c:14
return STATUS_SUCCESS
Definition: btrfs.c:2938

Referenced by DriverEntry().

◆ PciIdeXSetBusData()

NTSTATUS NTAPI PciIdeXSetBusData ( IN PVOID  DeviceExtension,
IN PVOID  Buffer,
IN PVOID  DataMask,
IN ULONG  ConfigDataOffset,
IN ULONG  BufferLength 
)

Definition at line 161 of file miniport.c.

167 {
168  PFDO_DEVICE_EXTENSION FdoDeviceExtension;
172 
173  DPRINT("PciIdeXSetBusData(%p %p %p 0x%lx 0x%lx)\n",
174  DeviceExtension, Buffer, DataMask, ConfigDataOffset, BufferLength);
175 
177  if (!CurrentBuffer)
178  {
180  return Status;
181  }
182 
183  Status = PciIdeXGetBusData(DeviceExtension, Buffer, ConfigDataOffset, BufferLength);
184  if (!NT_SUCCESS(Status))
185  goto cleanup;
186 
187  for (i = 0; i < BufferLength; i++)
188  CurrentBuffer[i] = (CurrentBuffer[i] & ~((PUCHAR)DataMask)[i]) | (((PUCHAR)DataMask)[i] & ((PUCHAR)Buffer)[i]);
189 
190  FdoDeviceExtension = CONTAINING_RECORD(DeviceExtension, FDO_DEVICE_EXTENSION, MiniControllerExtension);
191  if (!FdoDeviceExtension->BusInterface)
192  {
194  goto cleanup;
195  }
196 
197  BytesWritten = (*FdoDeviceExtension->BusInterface->SetBusData)(
198  FdoDeviceExtension->BusInterface->Context,
201  ConfigDataOffset,
202  BufferLength);
203  if (BytesWritten == BufferLength)
205  else
207 
208 cleanup:
210  return Status;
211 }
_Must_inspect_result_ _In_ PFILE_OBJECT _In_opt_ PLARGE_INTEGER _In_ ULONG _In_ FLT_IO_OPERATION_FLAGS _Out_opt_ PULONG BytesWritten
Definition: fltkernel.h:1293
#define STATUS_INSUFFICIENT_RESOURCES
Definition: udferr_usr.h:158
PBUS_INTERFACE_STANDARD BusInterface
Definition: pciidex.h:23
unsigned char * PUCHAR
Definition: retypes.h:3
LONG NTSTATUS
Definition: precomp.h:26
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
_In_ ULONG BufferLength
Definition: usbdlib.h:225
smooth NULL
Definition: ftsmooth.c:416
void DPRINT(...)
Definition: polytest.cpp:61
Definition: bufpool.h:45
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#define PCI_WHICHSPACE_CONFIG
Definition: iotypes.h:3288
#define STATUS_UNSUCCESSFUL
Definition: udferr_usr.h:132
#define ExAllocatePool(type, size)
Definition: fbtusb.h:44
PGET_SET_DEVICE_DATA SetBusData
Definition: iotypes.h:883
Status
Definition: gdiplustypes.h:24
static PVOID CurrentBuffer
unsigned int ULONG
Definition: retypes.h:1
char * cleanup(char *str)
Definition: wpickclick.c:99
return STATUS_SUCCESS
Definition: btrfs.c:2938
NTSTATUS NTAPI PciIdeXGetBusData(IN PVOID DeviceExtension, IN PVOID Buffer, IN ULONG ConfigDataOffset, IN ULONG BufferLength)
Definition: miniport.c:130
#define ExFreePool(addr)
Definition: env_spec_w32.h:352