1*c1f22c88SEric Kohl /* 2*c1f22c88SEric Kohl * PROJECT: ReactOS Floppy Disk Controller Driver 3*c1f22c88SEric Kohl * LICENSE: GNU GPLv2 only as published by the Free Software Foundation 4*c1f22c88SEric Kohl * FILE: drivers/storage/fdc/fdc/fdc.h 5*c1f22c88SEric Kohl * PURPOSE: Common header file 6*c1f22c88SEric Kohl * PROGRAMMERS: Eric Kohl 7*c1f22c88SEric Kohl */ 8*c1f22c88SEric Kohl 9*c1f22c88SEric Kohl #ifndef _FDC_PCH_ 10*c1f22c88SEric Kohl #define _FDC_PCH_ 11*c1f22c88SEric Kohl 12*c1f22c88SEric Kohl #include <ntifs.h> 13*c1f22c88SEric Kohl 14*c1f22c88SEric Kohl #define MAX_DEVICE_NAME 255 15*c1f22c88SEric Kohl #define MAX_ARC_PATH_LEN 255 16*c1f22c88SEric Kohl #define MAX_DRIVES_PER_CONTROLLER 4 17*c1f22c88SEric Kohl #define MAX_CONTROLLERS 4 18*c1f22c88SEric Kohl 19*c1f22c88SEric Kohl struct _CONTROLLER_INFO; 20*c1f22c88SEric Kohl 21*c1f22c88SEric Kohl typedef struct _DRIVE_INFO 22*c1f22c88SEric Kohl { 23*c1f22c88SEric Kohl struct _CONTROLLER_INFO *ControllerInfo; 24*c1f22c88SEric Kohl UCHAR UnitNumber; /* 0,1,2,3 */ 25*c1f22c88SEric Kohl ULONG PeripheralNumber; 26*c1f22c88SEric Kohl PDEVICE_OBJECT DeviceObject; 27*c1f22c88SEric Kohl CM_FLOPPY_DEVICE_DATA FloppyDeviceData; 28*c1f22c88SEric Kohl // LARGE_INTEGER MotorStartTime; 29*c1f22c88SEric Kohl // DISK_GEOMETRY DiskGeometry; 30*c1f22c88SEric Kohl // UCHAR BytesPerSectorCode; 31*c1f22c88SEric Kohl // WCHAR SymLinkBuffer[MAX_DEVICE_NAME]; 32*c1f22c88SEric Kohl // WCHAR ArcPathBuffer[MAX_ARC_PATH_LEN]; 33*c1f22c88SEric Kohl // ULONG DiskChangeCount; 34*c1f22c88SEric Kohl // BOOLEAN Initialized; 35*c1f22c88SEric Kohl } DRIVE_INFO, *PDRIVE_INFO; 36*c1f22c88SEric Kohl 37*c1f22c88SEric Kohl typedef struct _CONTROLLER_INFO 38*c1f22c88SEric Kohl { 39*c1f22c88SEric Kohl BOOLEAN Populated; 40*c1f22c88SEric Kohl // BOOLEAN Initialized; 41*c1f22c88SEric Kohl // ULONG ControllerNumber; 42*c1f22c88SEric Kohl // INTERFACE_TYPE InterfaceType; 43*c1f22c88SEric Kohl // ULONG BusNumber; 44*c1f22c88SEric Kohl // ULONG Level; 45*c1f22c88SEric Kohl // KIRQL MappedLevel; 46*c1f22c88SEric Kohl // ULONG Vector; 47*c1f22c88SEric Kohl // ULONG MappedVector; 48*c1f22c88SEric Kohl // KINTERRUPT_MODE InterruptMode; 49*c1f22c88SEric Kohl PUCHAR BaseAddress; 50*c1f22c88SEric Kohl // ULONG Dma; 51*c1f22c88SEric Kohl // ULONG MapRegisters; 52*c1f22c88SEric Kohl // PVOID MapRegisterBase; 53*c1f22c88SEric Kohl // BOOLEAN Master; 54*c1f22c88SEric Kohl // KEVENT SynchEvent; 55*c1f22c88SEric Kohl // KDPC Dpc; 56*c1f22c88SEric Kohl // PKINTERRUPT InterruptObject; 57*c1f22c88SEric Kohl // PADAPTER_OBJECT AdapterObject; 58*c1f22c88SEric Kohl UCHAR NumberOfDrives; 59*c1f22c88SEric Kohl // BOOLEAN ImpliedSeeks; 60*c1f22c88SEric Kohl DRIVE_INFO DriveInfo[MAX_DRIVES_PER_CONTROLLER]; 61*c1f22c88SEric Kohl // PDRIVE_INFO CurrentDrive; 62*c1f22c88SEric Kohl // BOOLEAN Model30; 63*c1f22c88SEric Kohl // KEVENT MotorStoppedEvent; 64*c1f22c88SEric Kohl // KTIMER MotorTimer; 65*c1f22c88SEric Kohl // KDPC MotorStopDpc; 66*c1f22c88SEric Kohl // BOOLEAN StopDpcQueued; 67*c1f22c88SEric Kohl } CONTROLLER_INFO, *PCONTROLLER_INFO; 68*c1f22c88SEric Kohl 69*c1f22c88SEric Kohl 70*c1f22c88SEric Kohl typedef struct _COMMON_DEVICE_EXTENSION 71*c1f22c88SEric Kohl { 72*c1f22c88SEric Kohl BOOLEAN IsFDO; 73*c1f22c88SEric Kohl PDEVICE_OBJECT DeviceObject; 74*c1f22c88SEric Kohl } COMMON_DEVICE_EXTENSION, *PCOMMON_DEVICE_EXTENSION; 75*c1f22c88SEric Kohl 76*c1f22c88SEric Kohl typedef struct _FDO_DEVICE_EXTENSION 77*c1f22c88SEric Kohl { 78*c1f22c88SEric Kohl COMMON_DEVICE_EXTENSION Common; 79*c1f22c88SEric Kohl 80*c1f22c88SEric Kohl PDEVICE_OBJECT LowerDevice; 81*c1f22c88SEric Kohl PDEVICE_OBJECT Pdo; 82*c1f22c88SEric Kohl 83*c1f22c88SEric Kohl CONTROLLER_INFO ControllerInfo; 84*c1f22c88SEric Kohl 85*c1f22c88SEric Kohl } FDO_DEVICE_EXTENSION, *PFDO_DEVICE_EXTENSION; 86*c1f22c88SEric Kohl 87*c1f22c88SEric Kohl 88*c1f22c88SEric Kohl typedef struct _PDO_DEVICE_EXTENSION 89*c1f22c88SEric Kohl { 90*c1f22c88SEric Kohl COMMON_DEVICE_EXTENSION Common; 91*c1f22c88SEric Kohl 92*c1f22c88SEric Kohl PDEVICE_OBJECT Fdo; 93*c1f22c88SEric Kohl PDRIVE_INFO DriveInfo; 94*c1f22c88SEric Kohl 95*c1f22c88SEric Kohl UNICODE_STRING DeviceDescription; // REG_SZ 96*c1f22c88SEric Kohl UNICODE_STRING DeviceId; // REG_SZ 97*c1f22c88SEric Kohl UNICODE_STRING InstanceId; // REG_SZ 98*c1f22c88SEric Kohl UNICODE_STRING HardwareIds; // REG_MULTI_SZ 99*c1f22c88SEric Kohl UNICODE_STRING CompatibleIds; // REG_MULTI_SZ 100*c1f22c88SEric Kohl } PDO_DEVICE_EXTENSION, *PPDO_DEVICE_EXTENSION; 101*c1f22c88SEric Kohl 102*c1f22c88SEric Kohl #define FDC_TAG 'acdF' 103*c1f22c88SEric Kohl 104*c1f22c88SEric Kohl /* fdo.c */ 105*c1f22c88SEric Kohl 106*c1f22c88SEric Kohl NTSTATUS 107*c1f22c88SEric Kohl NTAPI 108*c1f22c88SEric Kohl FdcFdoPnp( 109*c1f22c88SEric Kohl IN PDEVICE_OBJECT DeviceObject, 110*c1f22c88SEric Kohl IN PIRP Irp); 111*c1f22c88SEric Kohl 112*c1f22c88SEric Kohl /* misc.c */ 113*c1f22c88SEric Kohl 114*c1f22c88SEric Kohl NTSTATUS 115*c1f22c88SEric Kohl DuplicateUnicodeString( 116*c1f22c88SEric Kohl IN ULONG Flags, 117*c1f22c88SEric Kohl IN PCUNICODE_STRING SourceString, 118*c1f22c88SEric Kohl OUT PUNICODE_STRING DestinationString); 119*c1f22c88SEric Kohl 120*c1f22c88SEric Kohl /* pdo.c */ 121*c1f22c88SEric Kohl 122*c1f22c88SEric Kohl NTSTATUS 123*c1f22c88SEric Kohl NTAPI 124*c1f22c88SEric Kohl FdcPdoPnp( 125*c1f22c88SEric Kohl IN PDEVICE_OBJECT DeviceObject, 126*c1f22c88SEric Kohl IN PIRP Irp); 127*c1f22c88SEric Kohl 128*c1f22c88SEric Kohl #endif /* _FDC_PCH_ */ 129