ReactOS  0.4.15-dev-1384-g878186b
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 159 of file miniport.c.

164 {
165  PFDO_DEVICE_EXTENSION FdoDeviceExtension;
168 
169  DPRINT("PciIdeXGetBusData(%p %p 0x%lx 0x%lx)\n",
170  DeviceExtension, Buffer, ConfigDataOffset, BufferLength);
171 
172  FdoDeviceExtension = CONTAINING_RECORD(DeviceExtension, FDO_DEVICE_EXTENSION, MiniControllerExtension);
173  if (FdoDeviceExtension->BusInterface)
174  {
175  BytesRead = (*FdoDeviceExtension->BusInterface->GetBusData)(
176  FdoDeviceExtension->BusInterface->Context,
178  Buffer,
179  ConfigDataOffset,
180  BufferLength);
181  if (BytesRead == BufferLength)
183  }
184 
185  return Status;
186 }
_Must_inspect_result_ _In_ WDFDEVICE _In_ DEVICE_REGISTRY_PROPERTY _In_ ULONG BufferLength
Definition: wdfdevice.h:3767
PBUS_INTERFACE_STANDARD BusInterface
Definition: pciidex.h:23
LONG NTSTATUS
Definition: precomp.h:26
_Must_inspect_result_ _In_ WDFIOTARGET _In_opt_ WDFREQUEST _In_opt_ PWDF_MEMORY_DESCRIPTOR _In_opt_ PLONGLONG _In_opt_ PWDF_REQUEST_SEND_OPTIONS _Out_opt_ PULONG_PTR BytesRead
Definition: wdfiotarget.h:859
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
Status
Definition: gdiplustypes.h:24
PGET_SET_DEVICE_DATA GetBusData
Definition: iotypes.h:899
#define PCI_WHICHSPACE_CONFIG
Definition: iotypes.h:3623
#define STATUS_UNSUCCESSFUL
Definition: udferr_usr.h:132
unsigned int ULONG
Definition: retypes.h:1
#define STATUS_SUCCESS
Definition: shellext.h:65

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 123 of file miniport.c.

128 {
129  ULONG i;
132 
133  DPRINT("PciIdeXInitialize(%p '%wZ' %p 0x%lx)\n",
134  DriverObject, RegistryPath, HwGetControllerProperties, ExtensionSize);
135 
137  DriverObject,
138  DriverObject,
139  sizeof(PCIIDEX_DRIVER_EXTENSION),
141  if (!NT_SUCCESS(Status))
142  return Status;
144  DriverExtension->MiniControllerExtensionSize = ExtensionSize;
145  DriverExtension->HwGetControllerProperties = HwGetControllerProperties;
146 
147  DriverObject->DriverExtension->AddDevice = PciIdeXAddDevice;
148 
149  for (i = 0; i <= IRP_MJ_MAXIMUM_FUNCTION; i++)
150  DriverObject->MajorFunction[i] = PciIdeXForwardOrIgnore;
151  DriverObject->MajorFunction[IRP_MJ_POWER] = PciIdeXPowerDispatch;
152  DriverObject->MajorFunction[IRP_MJ_PNP] = PciIdeXPnpDispatch;
153 
154  return STATUS_SUCCESS;
155 }
NTSTATUS NTAPI IoAllocateDriverObjectExtension(IN PDRIVER_OBJECT DriverObject, IN PVOID ClientIdentificationAddress, IN ULONG DriverObjectExtensionSize, OUT PVOID *DriverObjectExtension)
Definition: driver.c:1794
#define IRP_MJ_PNP
Definition: cdrw_usr.h:52
#define IRP_MJ_MAXIMUM_FUNCTION
LONG NTSTATUS
Definition: precomp.h:26
_Must_inspect_result_ _In_ PDRIVER_OBJECT _In_ PCUNICODE_STRING RegistryPath
Definition: wdfdriver.h:213
DRIVER_ADD_DEVICE PciIdeXAddDevice
Definition: pciidex.h:43
void DPRINT(...)
Definition: polytest.cpp:61
_Must_inspect_result_ _In_ PDRIVER_OBJECT DriverObject
Definition: wdfdriver.h:213
Status
Definition: gdiplustypes.h:24
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#define IRP_MJ_POWER
PPCI_DRIVER_EXTENSION DriverExtension
Definition: pci.c:41
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
unsigned int ULONG
Definition: retypes.h:1
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262
static DRIVER_DISPATCH PciIdeXForwardOrIgnore
Definition: miniport.c:17
#define STATUS_SUCCESS
Definition: shellext.h:65

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 190 of file miniport.c.

196 {
197  PFDO_DEVICE_EXTENSION FdoDeviceExtension;
201 
202  DPRINT("PciIdeXSetBusData(%p %p %p 0x%lx 0x%lx)\n",
203  DeviceExtension, Buffer, DataMask, ConfigDataOffset, BufferLength);
204 
206  if (!CurrentBuffer)
207  {
209  return Status;
210  }
211 
212  Status = PciIdeXGetBusData(DeviceExtension, Buffer, ConfigDataOffset, BufferLength);
213  if (!NT_SUCCESS(Status))
214  goto cleanup;
215 
216  for (i = 0; i < BufferLength; i++)
217  CurrentBuffer[i] = (CurrentBuffer[i] & ~((PUCHAR)DataMask)[i]) | (((PUCHAR)DataMask)[i] & ((PUCHAR)Buffer)[i]);
218 
219  FdoDeviceExtension = CONTAINING_RECORD(DeviceExtension, FDO_DEVICE_EXTENSION, MiniControllerExtension);
220  if (!FdoDeviceExtension->BusInterface)
221  {
223  goto cleanup;
224  }
225 
226  BytesWritten = (*FdoDeviceExtension->BusInterface->SetBusData)(
227  FdoDeviceExtension->BusInterface->Context,
230  ConfigDataOffset,
231  BufferLength);
232  if (BytesWritten == BufferLength)
234  else
236 
237 cleanup:
239  return Status;
240 }
static ACPI_BUFFER CurrentBuffer
_Must_inspect_result_ _In_ WDFIOTARGET _In_opt_ WDFREQUEST _In_opt_ PWDF_MEMORY_DESCRIPTOR _In_opt_ PLONGLONG _In_opt_ PWDF_REQUEST_SEND_OPTIONS _Out_opt_ PULONG_PTR BytesWritten
Definition: wdfiotarget.h:949
_Must_inspect_result_ _In_ WDFDEVICE _In_ DEVICE_REGISTRY_PROPERTY _In_ ULONG BufferLength
Definition: wdfdevice.h:3767
#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
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
Status
Definition: gdiplustypes.h:24
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#define PCI_WHICHSPACE_CONFIG
Definition: iotypes.h:3623
#define STATUS_UNSUCCESSFUL
Definition: udferr_usr.h:132
#define ExAllocatePool(type, size)
Definition: fbtusb.h:44
PGET_SET_DEVICE_DATA SetBusData
Definition: iotypes.h:898
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 NULL
Definition: types.h:112
unsigned int ULONG
Definition: retypes.h:1
char * cleanup(char *str)
Definition: wpickclick.c:99
#define STATUS_SUCCESS
Definition: shellext.h:65
NTSTATUS NTAPI PciIdeXGetBusData(IN PVOID DeviceExtension, IN PVOID Buffer, IN ULONG ConfigDataOffset, IN ULONG BufferLength)
Definition: miniport.c:159
#define ExFreePool(addr)
Definition: env_spec_w32.h:352