ReactOS 0.4.15-dev-7788-g1ad9096
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 */
35int _cdecl swprintf(const WCHAR *, ...);
36
37/* need ioctls in ddk build mode */
38#include <ntdddisk.h>
39
40struct _CONTROLLER_INFO;
41
42typedef struct _DRIVE_INFO
43{
45 UCHAR UnitNumber; /* 0,1,2,3 */
56
57typedef struct _CONTROLLER_INFO
58{
88
91
94
97
100
102StartMotor(PDRIVE_INFO DriveInfo);
103
105StopMotor(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
unsigned char BOOLEAN
LONG NTSTATUS
Definition: precomp.h:26
_In_ PIRP Irp
Definition: csq.h:116
#define swprintf
Definition: precomp.h:40
DRIVER_INITIALIZE DriverEntry
Definition: condrv.c:21
UCHAR KIRQL
Definition: env_spec_w32.h:591
#define MAX_ARC_PATH_LEN
Definition: floppy.h:30
NTSTATUS NTAPI WaitForControllerInterrupt(PCONTROLLER_INFO ControllerInfo, PLARGE_INTEGER Timeout)
Definition: floppy.c:163
struct _DRIVE_INFO DRIVE_INFO
NTSTATUS NTAPI ResetChangeFlag(PDRIVE_INFO DriveInfo)
Definition: floppy.c:291
#define MAX_DEVICE_NAME
Definition: floppy.h:29
struct _DRIVE_INFO * PDRIVE_INFO
VOID NTAPI SignalMediaChanged(PDEVICE_OBJECT DeviceObject, PIRP Irp)
Definition: floppy.c:1097
struct _CONTROLLER_INFO * PCONTROLLER_INFO
#define MAX_DRIVES_PER_CONTROLLER
Definition: floppy.h:31
struct _CONTROLLER_INFO CONTROLLER_INFO
VOID NTAPI StartMotor(PDRIVE_INFO DriveInfo)
Definition: floppy.c:96
VOID NTAPI StopMotor(PCONTROLLER_INFO ControllerInfo)
Definition: floppy.c:135
enum _INTERFACE_TYPE INTERFACE_TYPE
static ULONG Timeout
Definition: ping.c:61
enum _KINTERRUPT_MODE KINTERRUPT_MODE
BOOLEAN StopDpcQueued
Definition: floppy.h:86
KEVENT SynchEvent
Definition: floppy.h:74
PVOID MapRegisterBase
Definition: floppy.h:72
BOOLEAN Master
Definition: floppy.h:73
BOOLEAN Initialized
Definition: floppy.h:60
ULONG Level
Definition: floppy.h:64
UCHAR NumberOfDrives
Definition: fdc.h:58
KIRQL MappedLevel
Definition: floppy.h:65
BOOLEAN Model30
Definition: floppy.h:82
PADAPTER_OBJECT AdapterObject
Definition: floppy.h:77
KTIMER MotorTimer
Definition: floppy.h:84
ULONG MapRegisters
Definition: floppy.h:71
ULONG MappedVector
Definition: floppy.h:67
KINTERRUPT_MODE InterruptMode
Definition: floppy.h:68
INTERFACE_TYPE InterfaceType
Definition: floppy.h:62
KEVENT MotorStoppedEvent
Definition: floppy.h:83
DRIVE_INFO DriveInfo[MAX_DRIVES_PER_CONTROLLER]
Definition: fdc.h:60
ULONG Vector
Definition: floppy.h:66
ULONG BusNumber
Definition: floppy.h:63
KDPC MotorStopDpc
Definition: floppy.h:85
BOOLEAN ImpliedSeeks
Definition: floppy.h:79
PKINTERRUPT InterruptObject
Definition: floppy.h:76
PUCHAR BaseAddress
Definition: fdc.h:49
PDRIVE_INFO CurrentDrive
Definition: floppy.h:81
BOOLEAN Populated
Definition: fdc.h:39
ULONG ControllerNumber
Definition: floppy.h:61
struct _CONTROLLER_INFO * ControllerInfo
Definition: fdc.h:23
WCHAR ArcPathBuffer[MAX_ARC_PATH_LEN]
Definition: floppy.h:51
PDEVICE_OBJECT DeviceObject
Definition: fdc.h:26
CM_FLOPPY_DEVICE_DATA FloppyDeviceData
Definition: fdc.h:27
ULONG DiskChangeCount
Definition: floppy.h:53
WCHAR DeviceNameBuffer[MAX_DEVICE_NAME]
Definition: floppy.h:52
LARGE_INTEGER MotorStartTime
Definition: floppy.h:46
UCHAR BytesPerSectorCode
Definition: floppy.h:50
BOOLEAN Initialized
Definition: floppy.h:54
DISK_GEOMETRY DiskGeometry
Definition: floppy.h:49
UCHAR UnitNumber
Definition: fdc.h:24
Definition: ketypes.h:699
#define NTAPI
Definition: typedefs.h:36
unsigned char * PUCHAR
Definition: typedefs.h:53
uint32_t ULONG
Definition: typedefs.h:59
_In_ PDEVICE_OBJECT DeviceObject
Definition: wdfdevice.h:2055
_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
unsigned char UCHAR
Definition: xmlstorage.h:181
__wchar_t WCHAR
Definition: xmlstorage.h:180