ReactOS 0.4.15-dev-7942-gd23573b
pciide.c
Go to the documentation of this file.
1/*
2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: PCI IDE bus driver
4 * FILE: drivers/storage/pciide/pciide.c
5 * PURPOSE: Main file
6 * PROGRAMMERS: Hervé Poussineau (hpoussin@reactos.org)
7 */
8
9#include "pciide.h"
10
11#define NDEBUG
12#include <debug.h>
13
16 IN PVOID DeviceExtension,
17 IN ULONG Channel)
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}
49
52 IN PVOID DeviceExtension)
53{
54 DPRINT1("PciIdeSyncAccessRequired %p\n", DeviceExtension);
55
56 return FALSE; /* FIXME */
57}
58
61 IN PVOID DeviceExtension,
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}
73
76 IN PVOID DeviceExtension,
77 IN PUCHAR CdbCommand,
78 IN PUCHAR Slave)
79{
80 DPRINT("PciIdeUseDma(%p %p %p)\n", DeviceExtension, CdbCommand, Slave);
81
82 /* Nothing should prevent us to use DMA */
83 return 1;
84}
85
88 IN PVOID DeviceExtension,
89 OUT PIDE_CONTROLLER_PROPERTIES ControllerProperties)
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}
115
120{
122
127 0);
128
129 return Status;
130}
unsigned char BOOLEAN
LONG NTSTATUS
Definition: precomp.h:26
#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:32
DRIVER_INITIALIZE DriverEntry
Definition: condrv.c:21
Status
Definition: gdiplustypes.h:25
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 SWDMA_MODE2
Definition: ide.h:285
#define MAX_IDE_DEVICE
Definition: ide.h:32
#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
IDE_CHANNEL_STATE
Definition: ide.h:196
@ ChannelDisabled
Definition: ide.h:197
@ ChannelStateUnknown
Definition: ide.h:199
#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
NTSTATUS NTAPI PciIdeGetControllerProperties(IN PVOID DeviceExtension, OUT PIDE_CONTROLLER_PROPERTIES ControllerProperties)
Definition: pciide.c:87
ULONG NTAPI PciIdeUseDma(IN PVOID DeviceExtension, IN PUCHAR CdbCommand, IN PUCHAR Slave)
Definition: pciide.c:75
NTSTATUS NTAPI PciIdeXInitialize(_In_ PDRIVER_OBJECT DriverObject, _In_ PUNICODE_STRING RegistryPath, _In_ PCONTROLLER_PROPERTIES HwGetControllerProperties, _In_ ULONG ExtensionSize)
Definition: pciidex.c:289
#define STATUS_SUCCESS
Definition: shellext.h:65
#define DPRINT
Definition: sndvol32.h:71
NTSTATUS NTAPI PciIdeXGetBusData(_In_ PVOID DeviceExtension, _Out_writes_bytes_all_(BufferLength) PVOID Buffer, _In_ ULONG ConfigDataOffset, _In_ ULONG BufferLength)
Definition: miniport.c:92
#define NTAPI
Definition: typedefs.h:36
#define IN
Definition: typedefs.h:39
unsigned char * PUCHAR
Definition: typedefs.h:53
uint32_t ULONG
Definition: typedefs.h:59
#define OUT
Definition: typedefs.h:40
_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
#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