[FDC]
[reactos.git] / reactos / drivers / storage / fdc / fdc / fdc.h
1 /*
2 * PROJECT: ReactOS Floppy Disk Controller Driver
3 * LICENSE: GNU GPLv2 only as published by the Free Software Foundation
4 * FILE: drivers/storage/fdc/fdc/fdc.h
5 * PURPOSE: Common header file
6 * PROGRAMMERS: Eric Kohl
7 */
8
9 #include <ntddk.h>
10 #include <debug.h>
11
12 #define MAX_DEVICE_NAME 255
13 #define MAX_ARC_PATH_LEN 255
14 #define MAX_DRIVES_PER_CONTROLLER 4
15 #define MAX_CONTROLLERS 4
16
17 struct _CONTROLLER_INFO;
18
19 typedef struct _DRIVE_INFO
20 {
21 struct _CONTROLLER_INFO *ControllerInfo;
22 UCHAR UnitNumber; /* 0,1,2,3 */
23 LARGE_INTEGER MotorStartTime;
24 PDEVICE_OBJECT DeviceObject;
25 CM_FLOPPY_DEVICE_DATA FloppyDeviceData;
26 // DISK_GEOMETRY DiskGeometry;
27 UCHAR BytesPerSectorCode;
28 WCHAR SymLinkBuffer[MAX_DEVICE_NAME];
29 WCHAR ArcPathBuffer[MAX_ARC_PATH_LEN];
30 ULONG DiskChangeCount;
31 BOOLEAN Initialized;
32 } DRIVE_INFO, *PDRIVE_INFO;
33
34 typedef struct _CONTROLLER_INFO
35 {
36 BOOLEAN Populated;
37 BOOLEAN Initialized;
38 ULONG ControllerNumber;
39 INTERFACE_TYPE InterfaceType;
40 ULONG BusNumber;
41 ULONG Level;
42 KIRQL MappedLevel;
43 ULONG Vector;
44 ULONG MappedVector;
45 KINTERRUPT_MODE InterruptMode;
46 PUCHAR BaseAddress;
47 ULONG Dma;
48 ULONG MapRegisters;
49 PVOID MapRegisterBase;
50 BOOLEAN Master;
51 KEVENT SynchEvent;
52 KDPC Dpc;
53 PKINTERRUPT InterruptObject;
54 PADAPTER_OBJECT AdapterObject;
55 UCHAR NumberOfDrives;
56 BOOLEAN ImpliedSeeks;
57 DRIVE_INFO DriveInfo[MAX_DRIVES_PER_CONTROLLER];
58 PDRIVE_INFO CurrentDrive;
59 BOOLEAN Model30;
60 KEVENT MotorStoppedEvent;
61 KTIMER MotorTimer;
62 KDPC MotorStopDpc;
63 BOOLEAN StopDpcQueued;
64 } CONTROLLER_INFO, *PCONTROLLER_INFO;
65
66
67 typedef struct _COMMON_DEVICE_EXTENSION
68 {
69 BOOLEAN IsFDO;
70 } COMMON_DEVICE_EXTENSION, *PCOMMON_DEVICE_EXTENSION;
71
72 typedef struct _FDO_DEVICE_EXTENSION
73 {
74 COMMON_DEVICE_EXTENSION Common;
75
76 PDEVICE_OBJECT LowerDevice;
77 PDEVICE_OBJECT Fdo;
78 PDEVICE_OBJECT Pdo;
79
80 CONTROLLER_INFO ControllerInfo;
81
82 } FDO_DEVICE_EXTENSION, *PFDO_DEVICE_EXTENSION;
83
84
85 /* fdo.c */
86
87 NTSTATUS
88 NTAPI
89 FdcAddDevice(IN PDRIVER_OBJECT DriverObject,
90 IN PDEVICE_OBJECT Pdo);
91
92 NTSTATUS
93 NTAPI
94 FdcFdoPnp(IN PDEVICE_OBJECT DeviceObject,
95 IN PIRP Irp);
96
97 /* pdo.c */
98
99 NTSTATUS
100 NTAPI
101 FdcPdoPnp(IN PDEVICE_OBJECT DeviceObject,
102 IN PIRP Irp);
103
104
105 /* EOF */