ReactOS 0.4.16-dev-297-gc569aee
pciide.c File Reference
#include "pciide.h"
#include <debug.h>
Include dependency graph for pciide.c:

Go to the source code of this file.

Macros

#define NDEBUG
 

Functions

IDE_CHANNEL_STATE NTAPI PciIdeChannelEnabled (IN PVOID DeviceExtension, IN ULONG Channel)
 
BOOLEAN NTAPI PciIdeSyncAccessRequired (IN PVOID DeviceExtension)
 
NTSTATUS NTAPI PciIdeTransferModeSelect (IN PVOID DeviceExtension, IN PPCIIDE_TRANSFER_MODE_SELECT XferMode)
 
ULONG NTAPI PciIdeUseDma (IN PVOID DeviceExtension, IN PUCHAR CdbCommand, IN PUCHAR Slave)
 
NTSTATUS NTAPI PciIdeGetControllerProperties (IN PVOID DeviceExtension, OUT PIDE_CONTROLLER_PROPERTIES ControllerProperties)
 
NTSTATUS NTAPI DriverEntry (IN PDRIVER_OBJECT DriverObject, IN PUNICODE_STRING RegistryPath)
 

Macro Definition Documentation

◆ NDEBUG

#define NDEBUG

Definition at line 11 of file pciide.c.

Function Documentation

◆ DriverEntry()

NTSTATUS NTAPI DriverEntry ( IN PDRIVER_OBJECT  DriverObject,
IN PUNICODE_STRING  RegistryPath 
)

Definition at line 117 of file pciide.c.

120{
122
127 0);
128
129 return Status;
130}
LONG NTSTATUS
Definition: precomp.h:26
Status
Definition: gdiplustypes.h:25
NTSTATUS NTAPI PciIdeGetControllerProperties(IN PVOID DeviceExtension, OUT PIDE_CONTROLLER_PROPERTIES ControllerProperties)
Definition: pciide.c:87
NTSTATUS NTAPI PciIdeXInitialize(_In_ PDRIVER_OBJECT DriverObject, _In_ PUNICODE_STRING RegistryPath, _In_ PCONTROLLER_PROPERTIES HwGetControllerProperties, _In_ ULONG ExtensionSize)
Definition: pciidex.c:289
_Must_inspect_result_ _In_ PDRIVER_OBJECT _In_ PCUNICODE_STRING RegistryPath
Definition: wdfdriver.h:215
_Must_inspect_result_ _In_ PDRIVER_OBJECT DriverObject
Definition: wdfdriver.h:213

◆ PciIdeChannelEnabled()

IDE_CHANNEL_STATE NTAPI PciIdeChannelEnabled ( IN PVOID  DeviceExtension,
IN ULONG  Channel 
)

Definition at line 15 of file pciide.c.

18{
19 PCI_COMMON_CONFIG PciConfig;
21
22 DPRINT("PciIdeChannelEnabled(%p, %lu)\n", DeviceExtension, Channel);
23
25 DeviceExtension,
26 &PciConfig,
27 0,
29 if (!NT_SUCCESS(Status))
30 {
31 DPRINT("PciIdeXGetBusData() failed with status 0x%08lx\n", Status);
33 }
34
35 if (PCI_CONFIGURATION_TYPE(&PciConfig) != PCI_DEVICE_TYPE)
36 {
37 DPRINT("Wrong PCI card type. Disabling IDE channel #%lu\n", Channel);
38 return ChannelDisabled;
39 }
40
41 if (PciConfig.BaseClass != PCI_CLASS_MASS_STORAGE_CTLR || PciConfig.SubClass != PCI_SUBCLASS_MSC_IDE_CTLR)
42 {
43 DPRINT("Wrong PCI card base class/sub class. Disabling IDE channel #%lu\n", Channel);
44 return ChannelDisabled;
45 }
46
48}
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:33
@ ChannelDisabled
Definition: ide.h:197
@ ChannelStateUnknown
Definition: ide.h:199
#define DPRINT
Definition: sndvol32.h:73
NTSTATUS NTAPI PciIdeXGetBusData(_In_ PVOID DeviceExtension, _Out_writes_bytes_all_(BufferLength) PVOID Buffer, _In_ ULONG ConfigDataOffset, _In_ ULONG BufferLength)
Definition: miniport.c:92
#define PCI_CLASS_MASS_STORAGE_CTLR
Definition: iotypes.h:4104
#define PCI_CONFIGURATION_TYPE(PciData)
Definition: iotypes.h:3609
#define PCI_SUBCLASS_MSC_IDE_CTLR
Definition: iotypes.h:4129
#define PCI_COMMON_HDR_LENGTH
Definition: iotypes.h:3594
#define PCI_DEVICE_TYPE
Definition: iotypes.h:3605

Referenced by PciIdeGetControllerProperties().

◆ PciIdeGetControllerProperties()

NTSTATUS NTAPI PciIdeGetControllerProperties ( IN PVOID  DeviceExtension,
OUT PIDE_CONTROLLER_PROPERTIES  ControllerProperties 
)

Definition at line 87 of file pciide.c.

90{
91 if (ControllerProperties->Size != sizeof(IDE_CONTROLLER_PROPERTIES))
93
94 ControllerProperties->PciIdeChannelEnabled = PciIdeChannelEnabled;
95 ControllerProperties->PciIdeSyncAccessRequired = PciIdeSyncAccessRequired;
96 ControllerProperties->PciIdeTransferModeSelect = PciIdeTransferModeSelect;
97 ControllerProperties->IgnoreActiveBitForAtaDevice = FALSE;
98 ControllerProperties->AlwaysClearBusMasterInterrupt = TRUE;
99 ControllerProperties->PciIdeUseDma = PciIdeUseDma;
100 ControllerProperties->AlignmentRequirement = 1;
101 ControllerProperties->DefaultPIO = 0; /* FIXME */
102 ControllerProperties->PciIdeUdmaModesSupported = NULL; /* optional */
103
104 ControllerProperties->SupportedTransferMode[0][0] =
105 ControllerProperties->SupportedTransferMode[0][1] =
106 ControllerProperties->SupportedTransferMode[1][0] =
107 ControllerProperties->SupportedTransferMode[1][1] =
112
113 return STATUS_SUCCESS;
114}
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define SWDMA_MODE2
Definition: ide.h:285
#define UDMA_MODE0
Definition: ide.h:291
#define UDMA_MODE2
Definition: ide.h:293
#define PIO_MODE4
Definition: ide.h:281
#define MWDMA_MODE0
Definition: ide.h:287
#define PIO_MODE0
Definition: ide.h:277
#define UDMA_MODE4
Definition: ide.h:295
#define PIO_MODE2
Definition: ide.h:279
#define UDMA_MODE1
Definition: ide.h:292
#define PIO_MODE3
Definition: ide.h:280
#define SWDMA_MODE1
Definition: ide.h:284
#define PIO_MODE1
Definition: ide.h:278
#define SWDMA_MODE0
Definition: ide.h:283
#define MWDMA_MODE1
Definition: ide.h:288
#define MWDMA_MODE2
Definition: ide.h:289
#define UDMA_MODE3
Definition: ide.h:294
#define STATUS_REVISION_MISMATCH
Definition: ntstatus.h:325
BOOLEAN NTAPI PciIdeSyncAccessRequired(IN PVOID DeviceExtension)
Definition: pciide.c:51
NTSTATUS NTAPI PciIdeTransferModeSelect(IN PVOID DeviceExtension, IN PPCIIDE_TRANSFER_MODE_SELECT XferMode)
Definition: pciide.c:60
IDE_CHANNEL_STATE NTAPI PciIdeChannelEnabled(IN PVOID DeviceExtension, IN ULONG Channel)
Definition: pciide.c:15
ULONG NTAPI PciIdeUseDma(IN PVOID DeviceExtension, IN PUCHAR CdbCommand, IN PUCHAR Slave)
Definition: pciide.c:75
#define STATUS_SUCCESS
Definition: shellext.h:65

Referenced by DriverEntry().

◆ PciIdeSyncAccessRequired()

BOOLEAN NTAPI PciIdeSyncAccessRequired ( IN PVOID  DeviceExtension)

Definition at line 51 of file pciide.c.

53{
54 DPRINT1("PciIdeSyncAccessRequired %p\n", DeviceExtension);
55
56 return FALSE; /* FIXME */
57}
#define DPRINT1
Definition: precomp.h:8

Referenced by PciIdeGetControllerProperties().

◆ PciIdeTransferModeSelect()

NTSTATUS NTAPI PciIdeTransferModeSelect ( IN PVOID  DeviceExtension,
IN PPCIIDE_TRANSFER_MODE_SELECT  XferMode 
)

Definition at line 60 of file pciide.c.

63{
64 ULONG i;
65
66 DPRINT1("PciIdeTransferModeSelect(%p %p)\n", DeviceExtension, XferMode);
67
68 for (i = 0; i < MAX_IDE_DEVICE; i++)
69 XferMode->DevicePresent[i] = FALSE; /* FIXME */
70
71 return STATUS_SUCCESS;
72}
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 MAX_IDE_DEVICE
Definition: ide.h:32
uint32_t ULONG
Definition: typedefs.h:59

Referenced by PciIdeGetControllerProperties().

◆ PciIdeUseDma()

ULONG NTAPI PciIdeUseDma ( IN PVOID  DeviceExtension,
IN PUCHAR  CdbCommand,
IN PUCHAR  Slave 
)

Definition at line 75 of file pciide.c.

79{
80 DPRINT("PciIdeUseDma(%p %p %p)\n", DeviceExtension, CdbCommand, Slave);
81
82 /* Nothing should prevent us to use DMA */
83 return 1;
84}

Referenced by PciIdeGetControllerProperties().