ReactOS  0.4.13-dev-544-gede3fdd
floppy.h
Go to the documentation of this file.
1 /*
2  * ReactOS Floppy Driver
3  * Copyright (C) 2004, Vizzini (vizzini@plasmic.com)
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 2 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License along
16  * with this program; if not, write to the Free Software Foundation, Inc.,
17  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18  *
19  * PROJECT: ReactOS Floppy Driver
20  * FILE: floppy.h
21  * PURPOSE: Header for Main floppy driver routines
22  * PROGRAMMER: Vizzini (vizzini@plasmic.com)
23  * REVISIONS:
24  * 15-Feb-2004 vizzini - Created
25  */
26 
27 #pragma once
28 
29 #define MAX_DEVICE_NAME 255
30 #define MAX_ARC_PATH_LEN 255
31 #define MAX_DRIVES_PER_CONTROLLER 4
32 #define MAX_CONTROLLERS 4
33 
34 /* MS doesn't prototype this but the w2k kernel exports it */
35 int _cdecl swprintf(const WCHAR *, ...);
36 
37 /* need ioctls in ddk build mode */
38 #include <ntdddisk.h>
39 
40 struct _CONTROLLER_INFO;
41 
42 typedef struct _DRIVE_INFO
43 {
45  UCHAR UnitNumber; /* 0,1,2,3 */
56 
57 typedef struct _CONTROLLER_INFO
58 {
88 
91 
92 VOID NTAPI
94 
97 
99 ResetChangeFlag(PDRIVE_INFO DriveInfo);
100 
101 VOID NTAPI
102 StartMotor(PDRIVE_INFO DriveInfo);
103 
104 VOID NTAPI
105 StopMotor(PCONTROLLER_INFO ControllerInfo);
106 
107 /*
108  * MEDIA TYPES
109  *
110  * This table was found at http://www.nondot.org/sabre/os/files/Disk/FloppyMediaIDs.txt.
111  * Thanks to raster@indirect.com for this information.
112  *
113  * Format Size Cyls Heads Sec/Trk FATs Sec/FAT Sec/Root Media
114  * 160K 5 1/4 40 1 8 2 ? ? FE
115  * 180K 5 1/4 40 1 9 2 ? 4 FC
116  * 320K 5 1/4 40 2 8 2 ? ? FF
117  * 360K 5 1/4 40 2 9 2 4 7 FD
118  * 1.2M 5 1/4 80 2 15 2 14 14 F9
119  * 720K 3 1/2 80 2 9 2 6 7 F9
120  * 1.44M 3 1/2 80 2 18 2 18 14 F0
121  */
122 
123 #define GEOMETRY_144_MEDIATYPE F3_1Pt44_512
124 #define GEOMETRY_144_CYLINDERS 80
125 #define GEOMETRY_144_TRACKSPERCYLINDER 2
126 #define GEOMETRY_144_SECTORSPERTRACK 18
127 #define GEOMETRY_144_BYTESPERSECTOR 512
WCHAR SymLinkBuffer[MAX_DEVICE_NAME]
Definition: floppy.h:51
LARGE_INTEGER MotorStartTime
Definition: floppy.h:46
ULONG DiskChangeCount
Definition: floppy.h:53
INTERFACE_TYPE InterfaceType
Definition: floppy.h:62
enum _INTERFACE_TYPE INTERFACE_TYPE
ULONG ControllerNumber
Definition: floppy.h:61
KIRQL MappedLevel
Definition: floppy.h:65
_In_ PIRP Irp
Definition: csq.h:116
unsigned char * PUCHAR
Definition: retypes.h:3
BOOLEAN Initialized
Definition: floppy.h:54
ULONG BusNumber
Definition: floppy.h:63
LONG NTSTATUS
Definition: precomp.h:26
struct _DRIVE_INFO * PDRIVE_INFO
struct _CONTROLLER_INFO * PCONTROLLER_INFO
VOID NTAPI StartMotor(PDRIVE_INFO DriveInfo)
Definition: floppy.c:96
NTSTATUS NTAPI DriverEntry(PDRIVER_OBJECT DriverObject, PUNICODE_STRING RegistryPath)
Definition: battc.c:16
ULONG Vector
Definition: floppy.h:66
BOOLEAN Master
Definition: floppy.h:73
ULONG MapRegisters
Definition: floppy.h:71
NTSTATUS NTAPI ResetChangeFlag(PDRIVE_INFO DriveInfo)
Definition: floppy.c:291
struct _CONTROLLER_INFO * ControllerInfo
Definition: fdc.h:23
UCHAR NumberOfDrives
Definition: fdc.h:58
BOOLEAN ImpliedSeeks
Definition: floppy.h:79
UCHAR KIRQL
Definition: env_spec_w32.h:591
PDEVICE_OBJECT DeviceObject
Definition: fdc.h:26
PADAPTER_OBJECT AdapterObject
Definition: floppy.h:77
NTSTATUS(* NTAPI)(IN PFILE_FULL_EA_INFORMATION EaBuffer, IN ULONG EaLength, OUT PULONG ErrorOffset)
Definition: IoEaTest.cpp:117
BOOLEAN Populated
Definition: fdc.h:39
PKINTERRUPT InterruptObject
Definition: floppy.h:76
#define MAX_ARC_PATH_LEN
Definition: floppy.h:30
unsigned char BOOLEAN
enum _KINTERRUPT_MODE KINTERRUPT_MODE
static PDRIVER_OBJECT DriverObject
Definition: template.c:42
VOID NTAPI StopMotor(PCONTROLLER_INFO ControllerInfo)
Definition: floppy.c:135
KDPC MotorStopDpc
Definition: floppy.h:85
PDRIVE_INFO CurrentDrive
Definition: floppy.h:81
__wchar_t WCHAR
Definition: xmlstorage.h:180
KEVENT MotorStoppedEvent
Definition: floppy.h:83
unsigned char UCHAR
Definition: xmlstorage.h:181
BOOLEAN Model30
Definition: floppy.h:82
BOOLEAN StopDpcQueued
Definition: floppy.h:86
KINTERRUPT_MODE InterruptMode
Definition: floppy.h:68
CM_FLOPPY_DEVICE_DATA FloppyDeviceData
Definition: fdc.h:27
Definition: ketypes.h:687
#define MAX_DRIVES_PER_CONTROLLER
Definition: floppy.h:31
DISK_GEOMETRY DiskGeometry
Definition: floppy.h:49
int _cdecl swprintf(const WCHAR *,...)
BOOLEAN Initialized
Definition: floppy.h:60
ULONG MappedVector
Definition: floppy.h:67
UCHAR UnitNumber
Definition: fdc.h:24
WCHAR ArcPathBuffer[MAX_ARC_PATH_LEN]
Definition: floppy.h:52
struct _DRIVE_INFO DRIVE_INFO
IN PDEVICE_OBJECT DeviceObject
Definition: fatprocs.h:1560
VOID NTAPI SignalMediaChanged(PDEVICE_OBJECT DeviceObject, PIRP Irp)
Definition: floppy.c:1010
ULONG Level
Definition: floppy.h:64
static ULONG Timeout
Definition: ping.c:61
KEVENT SynchEvent
Definition: floppy.h:74
DRIVE_INFO DriveInfo[MAX_DRIVES_PER_CONTROLLER]
Definition: fdc.h:60
PVOID MapRegisterBase
Definition: floppy.h:72
PUCHAR BaseAddress
Definition: fdc.h:49
NTSTATUS NTAPI WaitForControllerInterrupt(PCONTROLLER_INFO ControllerInfo, PLARGE_INTEGER Timeout)
Definition: floppy.c:163
unsigned int ULONG
Definition: retypes.h:1
_In_ PUNICODE_STRING RegistryPath
Definition: wmip.h:27
#define MAX_DEVICE_NAME
Definition: floppy.h:29
struct _CONTROLLER_INFO CONTROLLER_INFO
UCHAR BytesPerSectorCode
Definition: floppy.h:50
KTIMER MotorTimer
Definition: floppy.h:84