ReactOS  0.4.15-dev-439-g292f67a
ide.h File Reference
#include "ideuser.h"
Include dependency graph for ide.h:

Go to the source code of this file.

Classes

struct  _IDENTIFY_DATA
 
struct  _PCIIDE_TRANSFER_MODE_SELECT
 
struct  _IDE_CONTROLLER_PROPERTIES
 
struct  _PCIIDE_CONFIG_HEADER
 

Macros

#define MAX_IDE_DEVICE   2
 
#define MAX_IDE_LINE   2
 
#define MAX_IDE_CHANNEL   2
 
#define IDENTIFY_DATA_SIZE   sizeof(IDENTIFY_DATA)
 
#define PciIdeXDebugPrint(x)
 

Typedefs

typedef struct _IDENTIFY_DATA IDENTIFY_DATA
 
typedef struct _IDENTIFY_DATAPIDENTIFY_DATA
 
typedef struct _PCIIDE_TRANSFER_MODE_SELECT PCIIDE_TRANSFER_MODE_SELECT
 
typedef struct _PCIIDE_TRANSFER_MODE_SELECTPPCIIDE_TRANSFER_MODE_SELECT
 
typedef IDE_CHANNEL_STATE(* PCIIDE_CHANNEL_ENABLED) (IN PVOID DeviceExtension, IN ULONG Channel)
 
typedef BOOLEAN(* PCIIDE_SYNC_ACCESS_REQUIRED) (IN PVOID DeviceExtension)
 
typedef NTSTATUS(* PCIIDE_TRANSFER_MODE_SELECT_FUNC) (IN PVOID DeviceExtension, IN OUT PPCIIDE_TRANSFER_MODE_SELECT TransferModeSelect)
 
typedef ULONG(* PCIIDE_USEDMA_FUNC) (IN PVOID deviceExtension, IN PVOID cdbCmd, IN UCHAR targetID)
 
typedef NTSTATUS(* PCIIDE_UDMA_MODES_SUPPORTED) (IDENTIFY_DATA IdentifyData, PULONG BestXferMode, PULONG CurrentMode)
 
typedef struct _IDE_CONTROLLER_PROPERTIES IDE_CONTROLLER_PROPERTIES
 
typedef struct _IDE_CONTROLLER_PROPERTIESPIDE_CONTROLLER_PROPERTIES
 
typedef NTSTATUS(* PCONTROLLER_PROPERTIES) (IN PVOID DeviceExtension, IN PIDE_CONTROLLER_PROPERTIES ControllerProperties)
 
typedef struct _PCIIDE_CONFIG_HEADER PCIIDE_CONFIG_HEADER
 
typedef struct _PCIIDE_CONFIG_HEADERPPCIIDE_CONFIG_HEADER
 

Enumerations

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

Functions

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

Macro Definition Documentation

◆ IDENTIFY_DATA_SIZE

#define IDENTIFY_DATA_SIZE   sizeof(IDENTIFY_DATA)

Definition at line 165 of file ide.h.

◆ MAX_IDE_CHANNEL

#define MAX_IDE_CHANNEL   2

Definition at line 26 of file ide.h.

◆ MAX_IDE_DEVICE

#define MAX_IDE_DEVICE   2

Definition at line 24 of file ide.h.

◆ MAX_IDE_LINE

#define MAX_IDE_LINE   2

Definition at line 25 of file ide.h.

◆ PciIdeXDebugPrint

#define PciIdeXDebugPrint (   x)

Definition at line 490 of file ide.h.

Typedef Documentation

◆ IDE_CONTROLLER_PROPERTIES

◆ IDENTIFY_DATA

◆ PCIIDE_CHANNEL_ENABLED

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

Definition at line 271 of file ide.h.

◆ PCIIDE_CONFIG_HEADER

◆ PCIIDE_SYNC_ACCESS_REQUIRED

typedef BOOLEAN(* PCIIDE_SYNC_ACCESS_REQUIRED) (IN PVOID DeviceExtension)

Definition at line 277 of file ide.h.

◆ PCIIDE_TRANSFER_MODE_SELECT

◆ PCIIDE_TRANSFER_MODE_SELECT_FUNC

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

Definition at line 282 of file ide.h.

◆ PCIIDE_UDMA_MODES_SUPPORTED

typedef NTSTATUS(* PCIIDE_UDMA_MODES_SUPPORTED) (IDENTIFY_DATA IdentifyData, PULONG BestXferMode, PULONG CurrentMode)

Definition at line 295 of file ide.h.

◆ PCIIDE_USEDMA_FUNC

typedef ULONG(* PCIIDE_USEDMA_FUNC) (IN PVOID deviceExtension, IN PVOID cdbCmd, IN UCHAR targetID)

Definition at line 288 of file ide.h.

◆ PCONTROLLER_PROPERTIES

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

Definition at line 377 of file ide.h.

◆ PIDE_CONTROLLER_PROPERTIES

◆ PIDENTIFY_DATA

◆ PPCIIDE_CONFIG_HEADER

◆ PPCIIDE_TRANSFER_MODE_SELECT

Enumeration Type Documentation

◆ IDE_CHANNEL_STATE

Enumerator
ChannelDisabled 
ChannelEnabled 
ChannelStateUnknown 
ChannelDisabled 
ChannelEnabled 
ChannelStateUnknown 

Definition at line 259 of file ide.h.

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

Function Documentation

◆ PciIdeXGetBusData()

NTSTATUS 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:3014
_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

◆ PciIdeXInitialize()

NTSTATUS PciIdeXInitialize ( IN PDRIVER_OBJECT  DriverObject,
IN PUNICODE_STRING  RegistryPath,
IN PCONTROLLER_PROPERTIES  PciIdeGetControllerProperties,
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:3014

◆ PciIdeXSetBusData()

NTSTATUS 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 }
static ACPI_BUFFER CurrentBuffer
_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
unsigned int ULONG
Definition: retypes.h:1
char * cleanup(char *str)
Definition: wpickclick.c:99
return STATUS_SUCCESS
Definition: btrfs.c:3014
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