Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

733 lines
23 KiB

  1. /*++
  2. Copyright (C) Microsoft Corporation, 1991 - 1999
  3. Module Name:
  4. flo_data.h
  5. Abstract:
  6. This file includes data and hardware declarations for the NEC PD765
  7. (aka AT, ISA, and ix86) and Intel 82077 (aka MIPS) floppy driver for
  8. NT.
  9. Author:
  10. Environment:
  11. Kernel mode only.
  12. Notes:
  13. --*/
  14. #if DBG
  15. //
  16. // For checked kernels, define a macro to print out informational
  17. // messages.
  18. //
  19. // FloppyDebug is normally 0. At compile-time or at run-time, it can be
  20. // set to some bit patter for increasingly detailed messages.
  21. //
  22. // Big, nasty errors are noted with DBGP. Errors that might be
  23. // recoverable are handled by the WARN bit. More information on
  24. // unusual but possibly normal happenings are handled by the INFO bit.
  25. // And finally, boring details such as routines entered and register
  26. // dumps are handled by the SHOW bit.
  27. //
  28. #define FLOPDBGP ((ULONG)0x00000001)
  29. #define FLOPWARN ((ULONG)0x00000002)
  30. #define FLOPINFO ((ULONG)0x00000004)
  31. #define FLOPSHOW ((ULONG)0x00000008)
  32. #define FLOPIRPPATH ((ULONG)0x00000010)
  33. #define FLOPFORMAT ((ULONG)0x00000020)
  34. #define FLOPSTATUS ((ULONG)0x00000040)
  35. #define FLOPPNP ((ULONG)0x00000080)
  36. extern ULONG FloppyDebugLevel;
  37. #define FloppyDump(LEVEL,STRING) \
  38. if (FloppyDebugLevel & (LEVEL)) { \
  39. DbgPrint STRING; \
  40. }
  41. #else
  42. #define FloppyDump(LEVEL,STRING)
  43. #endif
  44. //
  45. // Define macros for driver paging
  46. //
  47. #define FloppyPageEntireDriver() \
  48. { \
  49. ExAcquireFastMutex(PagingMutex); \
  50. if (--PagingReferenceCount == 0) { \
  51. MmPageEntireDriver(DriverEntry); \
  52. } \
  53. ExReleaseFastMutex(PagingMutex); \
  54. }
  55. #define FloppyResetDriverPaging() \
  56. { \
  57. ExAcquireFastMutex(PagingMutex); \
  58. if (++PagingReferenceCount == 1) { \
  59. MmResetDriverPaging(DriverEntry); \
  60. } \
  61. ExReleaseFastMutex(PagingMutex); \
  62. }
  63. //
  64. // If we don't get enough map registers to handle the maximum track size,
  65. // we will allocate a contiguous buffer and do I/O to/from that.
  66. //
  67. // On MIPS, we should always have enough map registers. On the ix86 we
  68. // might not, and when we allocate the contiguous buffer we have to make
  69. // sure that it's in the first 16Mb of RAM to make sure the DMA chip can
  70. // address it.
  71. //
  72. #define MAXIMUM_DMA_ADDRESS 0xFFFFFF
  73. //
  74. // The byte in the boot sector that specifies the type of media, and
  75. // the values that it can assume. We can often tell what type of media
  76. // is in the drive by seeing which controller parameters allow us to read
  77. // the diskette, but some different densities are readable with the same
  78. // parameters so we use this byte to decide the media type.
  79. //
  80. typedef struct _BOOT_SECTOR_INFO {
  81. UCHAR JumpByte[1];
  82. UCHAR Ignore1[2];
  83. UCHAR OemData[8];
  84. UCHAR BytesPerSector[2];
  85. UCHAR Ignore2[6];
  86. UCHAR NumberOfSectors[2];
  87. UCHAR MediaByte[1];
  88. UCHAR Ignore3[2];
  89. UCHAR SectorsPerTrack[2];
  90. UCHAR NumberOfHeads[2];
  91. } BOOT_SECTOR_INFO, *PBOOT_SECTOR_INFO;
  92. //
  93. // Retry counts -
  94. //
  95. // When attempting I/O, we may run into many different errors. The
  96. // hardware retries things 8 times invisibly. If the hardware reports
  97. // any type of error, we will recalibrate and retry the operation
  98. // up to RECALIBRATE_RETRY_COUNT times. When this expires, we check to
  99. // see if there's an overrun - if so, the DMA is probably being hogged
  100. // by a higher priority device, so we repeat the earlier loop up to
  101. // OVERRUN_RETRY_COUNT times.
  102. //
  103. // Any packet that is about to be returned with an error caused by an
  104. // unexpected hardware error or state will be restarted from the very
  105. // beginning after resetting the hardware HARDWARE_RESET_RETRY_COUNT
  106. // times.
  107. //
  108. #define RECALIBRATE_RETRY_COUNT 3
  109. #define OVERRUN_RETRY_COUNT 1
  110. #define HARDWARE_RESET_RETRY_COUNT 2
  111. //
  112. // The I/O system calls our timer routine once every second. If the timer
  113. // counter is -1, the timer is "off" and the timer routine will just return.
  114. // By setting the counter to 3, the timer routine will decrement the
  115. // counter every second, so the timer will expire in 2 to 3 seconds. At
  116. // that time the drive motor will be turned off.
  117. //
  118. #define TIMER_CANCEL -1
  119. #define TIMER_EXPIRED 0
  120. #define FDC_TIMEOUT 4
  121. //
  122. // Define drive types. Numbers are read from CMOS, translated to these
  123. // numbers, and then used as an index into the DRIVE_MEDIA_LIMITS table.
  124. //
  125. #define DRIVE_TYPE_0360 0
  126. #define DRIVE_TYPE_1200 1
  127. #define DRIVE_TYPE_0720 2
  128. #define DRIVE_TYPE_1440 3
  129. #define DRIVE_TYPE_2880 4
  130. #define NUMBER_OF_DRIVE_TYPES 5
  131. #define DRIVE_TYPE_NONE NUMBER_OF_DRIVE_TYPES
  132. #define DRIVE_TYPE_INVALID DRIVE_TYPE_NONE + 1
  133. #define BOOT_SECTOR_SIZE 512
  134. //
  135. // Media types are defined in ntdddisk.h, but we'll add one type here.
  136. // This keeps us from wasting time trying to determine the media type
  137. // over and over when, for example, a fresh floppy is about to be
  138. // formatted.
  139. //
  140. #define Undetermined -1
  141. //
  142. // Define all possible drive/media combinations, given drives listed above
  143. // and media types in ntdddisk.h.
  144. //
  145. // These values are used to index the DriveMediaConstants table.
  146. //
  147. #define NUMBER_OF_DRIVE_MEDIA_COMBINATIONS 17
  148. typedef enum _DRIVE_MEDIA_TYPE {
  149. Drive360Media160, // 5.25" 360k drive; 160k media
  150. Drive360Media180, // 5.25" 360k drive; 180k media
  151. Drive360Media320, // 5.25" 360k drive; 320k media
  152. Drive360Media32X, // 5.25" 360k drive; 320k 1k secs
  153. Drive360Media360, // 5.25" 360k drive; 360k media
  154. Drive720Media720, // 3.5" 720k drive; 720k media
  155. Drive120Media160, // 5.25" 1.2Mb drive; 160k media
  156. Drive120Media180, // 5.25" 1.2Mb drive; 180k media
  157. Drive120Media320, // 5.25" 1.2Mb drive; 320k media
  158. Drive120Media32X, // 5.25" 1.2Mb drive; 320k 1k secs
  159. Drive120Media360, // 5.25" 1.2Mb drive; 360k media
  160. Drive120Media120, // 5.25" 1.2Mb drive; 1.2Mb media
  161. Drive144Media720, // 3.5" 1.44Mb drive; 720k media
  162. Drive144Media144, // 3.5" 1.44Mb drive; 1.44Mb media
  163. Drive288Media720, // 3.5" 2.88Mb drive; 720k media
  164. Drive288Media144, // 3.5" 2.88Mb drive; 1.44Mb media
  165. Drive288Media288 // 3.5" 2.88Mb drive; 2.88Mb media
  166. } DRIVE_MEDIA_TYPE;
  167. //
  168. // When we want to determine the media type in a drive, we will first
  169. // guess that the media with highest possible density is in the drive,
  170. // and keep trying lower densities until we can successfully read from
  171. // the drive.
  172. //
  173. // These values are used to select a DRIVE_MEDIA_TYPE value.
  174. //
  175. // The following table defines ranges that apply to the DRIVE_MEDIA_TYPE
  176. // enumerated values when trying media types for a particular drive type.
  177. // Note that for this to work, the DRIVE_MEDIA_TYPE values must be sorted
  178. // by ascending densities within drive types. Also, for maximum track
  179. // size to be determined properly, the drive types must be in ascending
  180. // order.
  181. //
  182. typedef struct _DRIVE_MEDIA_LIMITS {
  183. DRIVE_MEDIA_TYPE HighestDriveMediaType;
  184. DRIVE_MEDIA_TYPE LowestDriveMediaType;
  185. } DRIVE_MEDIA_LIMITS, *PDRIVE_MEDIA_LIMITS;
  186. DRIVE_MEDIA_LIMITS _DriveMediaLimits[NUMBER_OF_DRIVE_TYPES] = {
  187. { Drive360Media360, Drive360Media160 }, // DRIVE_TYPE_0360
  188. { Drive120Media120, Drive120Media160 }, // DRIVE_TYPE_1200
  189. { Drive720Media720, Drive720Media720 }, // DRIVE_TYPE_0720
  190. { Drive144Media144, Drive144Media720 }, // DRIVE_TYPE_1440
  191. { Drive288Media288, Drive288Media720 } // DRIVE_TYPE_2880
  192. };
  193. PDRIVE_MEDIA_LIMITS DriveMediaLimits;
  194. //
  195. // For each drive/media combination, define important constants.
  196. //
  197. typedef struct _DRIVE_MEDIA_CONSTANTS {
  198. MEDIA_TYPE MediaType;
  199. UCHAR StepRateHeadUnloadTime;
  200. UCHAR HeadLoadTime;
  201. UCHAR MotorOffTime;
  202. UCHAR SectorLengthCode;
  203. USHORT BytesPerSector;
  204. UCHAR SectorsPerTrack;
  205. UCHAR ReadWriteGapLength;
  206. UCHAR FormatGapLength;
  207. UCHAR FormatFillCharacter;
  208. UCHAR HeadSettleTime;
  209. USHORT MotorSettleTimeRead;
  210. USHORT MotorSettleTimeWrite;
  211. UCHAR MaximumTrack;
  212. UCHAR CylinderShift;
  213. UCHAR DataTransferRate;
  214. UCHAR NumberOfHeads;
  215. UCHAR DataLength;
  216. UCHAR MediaByte;
  217. UCHAR SkewDelta;
  218. } DRIVE_MEDIA_CONSTANTS, *PDRIVE_MEDIA_CONSTANTS;
  219. //
  220. // Magic value to add to the SectorLengthCode to use it as a shift value
  221. // to determine the sector size.
  222. //
  223. #define SECTORLENGTHCODE_TO_BYTESHIFT 7
  224. //
  225. // The following values were gleaned from many different sources, which
  226. // often disagreed with each other. Where numbers were in conflict, I
  227. // chose the more conservative or most-often-selected value.
  228. //
  229. DRIVE_MEDIA_CONSTANTS _DriveMediaConstants[NUMBER_OF_DRIVE_MEDIA_COMBINATIONS] =
  230. {
  231. { F5_160_512, 0xdf, 0x2, 0x25, 0x2, 0x200, 0x08, 0x2a, 0x50, 0xf6, 0xf, 1000, 1000, 0x27, 0, 0x2, 0x1, 0xff, 0xfe, 0 },
  232. { F5_180_512, 0xdf, 0x2, 0x25, 0x2, 0x200, 0x09, 0x2a, 0x50, 0xf6, 0xf, 1000, 1000, 0x27, 0, 0x2, 0x1, 0xff, 0xfc, 0 },
  233. { F5_320_512, 0xdf, 0x2, 0x25, 0x2, 0x200, 0x08, 0x2a, 0x50, 0xf6, 0xf, 1000, 1000, 0x27, 0, 0x2, 0x2, 0xff, 0xff, 0 },
  234. { F5_320_1024, 0xdf, 0x2, 0x25, 0x3, 0x400, 0x04, 0x80, 0xf0, 0xf6, 0xf, 1000, 1000, 0x27, 0, 0x2, 0x2, 0xff, 0xff, 0 },
  235. { F5_360_512, 0xdf, 0x2, 0x25, 0x2, 0x200, 0x09, 0x2a, 0x50, 0xf6, 0xf, 250, 1000, 0x27, 0, 0x2, 0x2, 0xff, 0xfd, 0 },
  236. { F3_720_512, 0xdf, 0x2, 0x25, 0x2, 0x200, 0x09, 0x2a, 0x50, 0xf6, 0xf, 500, 1000, 0x4f, 0, 0x2, 0x2, 0xff, 0xf9, 2 },
  237. { F5_160_512, 0xdf, 0x2, 0x25, 0x2, 0x200, 0x08, 0x2a, 0x50, 0xf6, 0xf, 1000, 1000, 0x27, 1, 0x1, 0x1, 0xff, 0xfe, 0 },
  238. { F5_180_512, 0xdf, 0x2, 0x25, 0x2, 0x200, 0x09, 0x2a, 0x50, 0xf6, 0xf, 1000, 1000, 0x27, 1, 0x1, 0x1, 0xff, 0xfc, 0 },
  239. { F5_320_512, 0xdf, 0x2, 0x25, 0x2, 0x200, 0x08, 0x2a, 0x50, 0xf6, 0xf, 1000, 1000, 0x27, 1, 0x1, 0x2, 0xff, 0xff, 0 },
  240. { F5_320_1024, 0xdf, 0x2, 0x25, 0x3, 0x400, 0x04, 0x80, 0xf0, 0xf6, 0xf, 1000, 1000, 0x27, 1, 0x1, 0x2, 0xff, 0xff, 0 },
  241. { F5_360_512, 0xdf, 0x2, 0x25, 0x2, 0x200, 0x09, 0x2a, 0x50, 0xf6, 0xf, 625, 1000, 0x27, 1, 0x1, 0x2, 0xff, 0xfd, 0 },
  242. { F5_1Pt2_512, 0xdf, 0x2, 0x25, 0x2, 0x200, 0x0f, 0x1b, 0x54, 0xf6, 0xf, 625, 1000, 0x4f, 0, 0x0, 0x2, 0xff, 0xf9, 0 },
  243. { F3_720_512, 0xdf, 0x2, 0x25, 0x2, 0x200, 0x09, 0x2a, 0x50, 0xf6, 0xf, 500, 1000, 0x4f, 0, 0x2, 0x2, 0xff, 0xf9, 2 },
  244. { F3_1Pt44_512, 0xaf, 0x2, 0x25, 0x2, 0x200, 0x12, 0x1b, 0x65, 0xf6, 0xf, 500, 1000, 0x4f, 0, 0x0, 0x2, 0xff, 0xf0, 3 },
  245. { F3_720_512, 0xe1, 0x2, 0x25, 0x2, 0x200, 0x09, 0x2a, 0x50, 0xf6, 0xf, 500, 1000, 0x4f, 0, 0x2, 0x2, 0xff, 0xf9, 2 },
  246. { F3_1Pt44_512, 0xd1, 0x2, 0x25, 0x2, 0x200, 0x12, 0x1b, 0x65, 0xf6, 0xf, 500, 1000, 0x4f, 0, 0x0, 0x2, 0xff, 0xf0, 3 },
  247. { F3_2Pt88_512, 0xa1, 0x2, 0x25, 0x2, 0x200, 0x24, 0x38, 0x53, 0xf6, 0xf, 500, 1000, 0x4f, 0, 0x3, 0x2, 0xff, 0xf0, 6 }
  248. };
  249. PDRIVE_MEDIA_CONSTANTS DriveMediaConstants;
  250. //
  251. // Parameter fields passed to the CONFIGURE command.
  252. //
  253. #define COMMND_CONFIGURE_IMPLIED_SEEKS 0x40
  254. #define COMMND_CONFIGURE_FIFO_THRESHOLD 0x0F
  255. #define COMMND_CONFIGURE_DISABLE_FIFO 0x20
  256. #define COMMND_CONFIGURE_DISABLE_POLLING 0x10
  257. //
  258. // Write Enable bit for PERPENDICULAR MODE command.
  259. //
  260. #define COMMND_PERPENDICULAR_MODE_OW 0x80
  261. //
  262. // Bits in the DRIVE_CONTROL register.
  263. //
  264. #define DRVCTL_RESET 0x00
  265. #define DRVCTL_ENABLE_CONTROLLER 0x04
  266. #define DRVCTL_ENABLE_DMA_AND_INTERRUPTS 0x08
  267. #define DRVCTL_DRIVE_0 0x10
  268. #define DRVCTL_DRIVE_1 0x21
  269. #define DRVCTL_DRIVE_2 0x42
  270. #define DRVCTL_DRIVE_3 0x83
  271. #define DRVCTL_DRIVE_MASK 0x03
  272. #define DRVCTL_MOTOR_MASK 0xf0
  273. //
  274. // Bits in the STATUS register.
  275. //
  276. #define STATUS_DRIVE_0_BUSY 0x01
  277. #define STATUS_DRIVE_1_BUSY 0x02
  278. #define STATUS_DRIVE_2_BUSY 0x04
  279. #define STATUS_DRIVE_3_BUSY 0x08
  280. #define STATUS_CONTROLLER_BUSY 0x10
  281. #define STATUS_DMA_UNUSED 0x20
  282. #define STATUS_DIRECTION_READ 0x40
  283. #define STATUS_DATA_REQUEST 0x80
  284. #define STATUS_IO_READY_MASK 0xc0
  285. #define STATUS_READ_READY 0xc0
  286. #define STATUS_WRITE_READY 0x80
  287. //
  288. // Bits in the DATA_RATE register.
  289. //
  290. #define DATART_0125 0x03
  291. #define DATART_0250 0x02
  292. #define DATART_0300 0x01
  293. #define DATART_0500 0x00
  294. #define DATART_1000 0x03
  295. #define DATART_RESERVED 0xfc
  296. //
  297. // Bits in the DISK_CHANGE register.
  298. //
  299. #define DSKCHG_RESERVED 0x7f
  300. #define DSKCHG_DISKETTE_REMOVED 0x80
  301. //
  302. // Bits in status register 0.
  303. //
  304. #define STREG0_DRIVE_0 0x00
  305. #define STREG0_DRIVE_1 0x01
  306. #define STREG0_DRIVE_2 0x02
  307. #define STREG0_DRIVE_3 0x03
  308. #define STREG0_HEAD 0x04
  309. #define STREG0_DRIVE_NOT_READY 0x08
  310. #define STREG0_DRIVE_FAULT 0x10
  311. #define STREG0_SEEK_COMPLETE 0x20
  312. #define STREG0_END_NORMAL 0x00
  313. #define STREG0_END_ERROR 0x40
  314. #define STREG0_END_INVALID_COMMAND 0x80
  315. #define STREG0_END_DRIVE_NOT_READY 0xC0
  316. #define STREG0_END_MASK 0xC0
  317. //
  318. // Bits in status register 1.
  319. //
  320. #define STREG1_ID_NOT_FOUND 0x01
  321. #define STREG1_WRITE_PROTECTED 0x02
  322. #define STREG1_SECTOR_NOT_FOUND 0x04
  323. #define STREG1_RESERVED1 0x08
  324. #define STREG1_DATA_OVERRUN 0x10
  325. #define STREG1_CRC_ERROR 0x20
  326. #define STREG1_RESERVED2 0x40
  327. #define STREG1_END_OF_DISKETTE 0x80
  328. //
  329. // Bits in status register 2.
  330. //
  331. #define STREG2_SUCCESS 0x00
  332. #define STREG2_DATA_NOT_FOUND 0x01
  333. #define STREG2_BAD_CYLINDER 0x02
  334. #define STREG2_SCAN_FAIL 0x04
  335. #define STREG2_SCAN_EQUAL 0x08
  336. #define STREG2_WRONG_CYLINDER 0x10
  337. #define STREG2_CRC_ERROR 0x20
  338. #define STREG2_DELETED_DATA 0x40
  339. #define STREG2_RESERVED 0x80
  340. //
  341. // Bits in status register 3.
  342. //
  343. #define STREG3_DRIVE_0 0x00
  344. #define STREG3_DRIVE_1 0x01
  345. #define STREG3_DRIVE_2 0x02
  346. #define STREG3_DRIVE_3 0x03
  347. #define STREG3_HEAD 0x04
  348. #define STREG3_TWO_SIDED 0x08
  349. #define STREG3_TRACK_0 0x10
  350. #define STREG3_DRIVE_READY 0x20
  351. #define STREG3_WRITE_PROTECTED 0x40
  352. #define STREG3_DRIVE_FAULT 0x80
  353. //
  354. // Runtime device structures
  355. //
  356. //
  357. // There is one DISKETTE_EXTENSION attached to the device object of each
  358. // floppy drive. Only data directly related to that drive (and the media
  359. // in it) is stored here; common data is in CONTROLLER_DATA. So the
  360. // DISKETTE_EXTENSION has a pointer to the CONTROLLER_DATA.
  361. //
  362. typedef struct _DISKETTE_EXTENSION {
  363. KSPIN_LOCK FlCancelSpinLock;
  364. PDEVICE_OBJECT UnderlyingPDO;
  365. PDEVICE_OBJECT TargetObject;
  366. BOOLEAN IsStarted;
  367. BOOLEAN IsRemoved;
  368. BOOLEAN HoldNewRequests;
  369. LIST_ENTRY NewRequestQueue;
  370. KSPIN_LOCK NewRequestQueueSpinLock;
  371. PDEVICE_OBJECT DeviceObject;
  372. KSEMAPHORE RequestSemaphore;
  373. KSPIN_LOCK ListSpinLock;
  374. FAST_MUTEX ThreadReferenceMutex;
  375. LONG ThreadReferenceCount;
  376. PKTHREAD FloppyThread;
  377. LIST_ENTRY ListEntry;
  378. BOOLEAN HardwareFailed;
  379. UCHAR HardwareFailCount;
  380. ULONG MaxTransferSize;
  381. UCHAR FifoBuffer[10];
  382. PUCHAR IoBuffer;
  383. PMDL IoBufferMdl;
  384. ULONG IoBufferSize;
  385. PDRIVER_OBJECT DriverObject;
  386. DRIVE_MEDIA_TYPE LastDriveMediaType;
  387. BOOLEAN FloppyControllerAllocated;
  388. BOOLEAN ACPI_BIOS;
  389. UCHAR DriveType;
  390. ULONG BytesPerSector;
  391. ULONG ByteCapacity;
  392. MEDIA_TYPE MediaType;
  393. DRIVE_MEDIA_TYPE DriveMediaType;
  394. UCHAR DeviceUnit;
  395. UCHAR DriveOnValue;
  396. BOOLEAN IsReadOnly;
  397. DRIVE_MEDIA_CONSTANTS BiosDriveMediaConstants;
  398. DRIVE_MEDIA_CONSTANTS DriveMediaConstants;
  399. UCHAR PerpendicularMode;
  400. BOOLEAN ControllerConfigurable;
  401. UNICODE_STRING DeviceName;
  402. UNICODE_STRING InterfaceString;
  403. UNICODE_STRING FloppyInterfaceString;
  404. UNICODE_STRING ArcName;
  405. BOOLEAN ReleaseFdcWithMotorRunning;
  406. //
  407. // For power management
  408. //
  409. KEVENT QueryPowerEvent;
  410. BOOLEAN PoweringDown;
  411. BOOLEAN ReceivedQueryPower;
  412. FAST_MUTEX PowerDownMutex;
  413. FAST_MUTEX HoldNewReqMutex;
  414. } DISKETTE_EXTENSION;
  415. typedef DISKETTE_EXTENSION *PDISKETTE_EXTENSION;
  416. //
  417. // Prototypes of driver routines.
  418. //
  419. NTSTATUS
  420. DriverEntry(
  421. IN PDRIVER_OBJECT DriverObject,
  422. IN PUNICODE_STRING RegistryPath
  423. );
  424. VOID
  425. FloppyUnload(
  426. IN PDRIVER_OBJECT DriverObject
  427. );
  428. NTSTATUS
  429. FlConfigCallBack(
  430. IN PVOID Context,
  431. IN PUNICODE_STRING PathName,
  432. IN INTERFACE_TYPE BusType,
  433. IN ULONG BusNumber,
  434. IN PKEY_VALUE_FULL_INFORMATION *BusInformation,
  435. IN CONFIGURATION_TYPE ControllerType,
  436. IN ULONG ControllerNumber,
  437. IN PKEY_VALUE_FULL_INFORMATION *ControllerInformation,
  438. IN CONFIGURATION_TYPE PeripheralType,
  439. IN ULONG PeripheralNumber,
  440. IN PKEY_VALUE_FULL_INFORMATION *PeripheralInformation
  441. );
  442. NTSTATUS
  443. FlInitializeControllerHardware(
  444. IN PDISKETTE_EXTENSION disketteExtension
  445. );
  446. NTSTATUS
  447. FloppyCreateClose(
  448. IN PDEVICE_OBJECT DeviceObject,
  449. IN PIRP Irp
  450. );
  451. NTSTATUS
  452. FloppyDeviceControl(
  453. IN PDEVICE_OBJECT DeviceObject,
  454. IN PIRP Irp
  455. );
  456. NTSTATUS
  457. FloppyReadWrite(
  458. IN PDEVICE_OBJECT DeviceObject,
  459. IN PIRP Irp
  460. );
  461. NTSTATUS
  462. FlRecalibrateDrive(
  463. IN PDISKETTE_EXTENSION DisketteExtension
  464. );
  465. NTSTATUS
  466. FlDatarateSpecifyConfigure(
  467. IN PDISKETTE_EXTENSION DisketteExtension
  468. );
  469. NTSTATUS
  470. FlStartDrive(
  471. IN OUT PDISKETTE_EXTENSION DisketteExtension,
  472. IN PIRP Irp,
  473. IN BOOLEAN WriteOperation,
  474. IN BOOLEAN SetUpMedia,
  475. IN BOOLEAN IgnoreChange
  476. );
  477. VOID
  478. FlFinishOperation(
  479. IN OUT PIRP Irp,
  480. IN PDISKETTE_EXTENSION DisketteExtension
  481. );
  482. NTSTATUS
  483. FlDetermineMediaType(
  484. IN OUT PDISKETTE_EXTENSION DisketteExtension
  485. );
  486. VOID
  487. FloppyThread(
  488. IN PVOID Context
  489. );
  490. NTSTATUS
  491. FlReadWrite(
  492. IN OUT PDISKETTE_EXTENSION DisketteExtension,
  493. IN OUT PIRP Irp,
  494. IN BOOLEAN DriveStarted
  495. );
  496. NTSTATUS
  497. FlFormat(
  498. IN PDISKETTE_EXTENSION DisketteExtension,
  499. IN PIRP Irp
  500. );
  501. NTSTATUS
  502. FlIssueCommand(
  503. IN OUT PDISKETTE_EXTENSION DisketteExtension,
  504. IN PUCHAR FifoInBuffer,
  505. OUT PUCHAR FifoOutBuffer,
  506. IN PMDL IoMdl,
  507. IN OUT ULONG IoBuffer,
  508. IN ULONG TransferBytes
  509. );
  510. BOOLEAN
  511. FlCheckFormatParameters(
  512. IN PDISKETTE_EXTENSION DisketteExtension,
  513. IN PFORMAT_PARAMETERS Fp
  514. );
  515. VOID
  516. FlLogErrorDpc(
  517. IN PKDPC Dpc,
  518. IN PVOID DeferredContext,
  519. IN PVOID SystemContext1,
  520. IN PVOID SystemContext2
  521. );
  522. NTSTATUS
  523. FlQueueIrpToThread(
  524. IN OUT PIRP Irp,
  525. IN OUT PDISKETTE_EXTENSION DisketteExtension
  526. );
  527. NTSTATUS
  528. FlInterpretError(
  529. IN UCHAR StatusRegister1,
  530. IN UCHAR StatusRegister2
  531. );
  532. VOID
  533. FlAllocateIoBuffer(
  534. IN OUT PDISKETTE_EXTENSION DisketteExtension,
  535. IN ULONG BufferSize
  536. );
  537. VOID
  538. FlFreeIoBuffer(
  539. IN OUT PDISKETTE_EXTENSION DisketteExtension
  540. );
  541. VOID
  542. FlConsolidateMediaTypeWithBootSector(
  543. IN OUT PDISKETTE_EXTENSION DisketteExtension,
  544. IN PBOOT_SECTOR_INFO BootSector
  545. );
  546. VOID
  547. FlCheckBootSector(
  548. IN OUT PDISKETTE_EXTENSION DisketteExtension
  549. );
  550. NTSTATUS
  551. FlReadWriteTrack(
  552. IN OUT PDISKETTE_EXTENSION DisketteExtension,
  553. IN OUT PMDL IoMdl,
  554. IN OUT ULONG IoOffset,
  555. IN BOOLEAN WriteOperation,
  556. IN UCHAR Cylinder,
  557. IN UCHAR Head,
  558. IN UCHAR Sector,
  559. IN UCHAR NumberOfSectors,
  560. IN BOOLEAN NeedSeek
  561. );
  562. NTSTATUS
  563. FlFdcDeviceIo(
  564. IN PDEVICE_OBJECT DeviceObject,
  565. IN ULONG Ioctl,
  566. IN OUT PVOID Data
  567. );
  568. VOID
  569. FlTerminateFloppyThread(
  570. PDISKETTE_EXTENSION DisketteExtension
  571. );
  572. NTSTATUS
  573. FloppyAddDevice(
  574. IN PDRIVER_OBJECT DriverObject,
  575. IN OUT PDEVICE_OBJECT PhysicalDeviceObject
  576. );
  577. NTSTATUS
  578. FloppyPnp(
  579. IN PDEVICE_OBJECT DeviceObject,
  580. IN PIRP Irp
  581. );
  582. NTSTATUS
  583. FloppyPower(
  584. IN PDEVICE_OBJECT DeviceObject,
  585. IN PIRP Irp
  586. );
  587. NTSTATUS
  588. FloppyPnpComplete (
  589. IN PDEVICE_OBJECT DeviceObject,
  590. IN PIRP Irp,
  591. IN PVOID Context
  592. );
  593. NTSTATUS
  594. FloppyQueueRequest (
  595. IN OUT PDISKETTE_EXTENSION DisketteExtension,
  596. IN PIRP Irp
  597. );
  598. NTSTATUS
  599. FloppyStartDevice(
  600. IN PDEVICE_OBJECT DeviceObject,
  601. IN PIRP Irp
  602. );
  603. VOID
  604. FloppyProcessQueuedRequests (
  605. IN OUT PDISKETTE_EXTENSION DisketteExtension
  606. );
  607. VOID
  608. FloppyCancelQueuedRequest (
  609. IN PDEVICE_OBJECT DeviceObject,
  610. IN PIRP Irp
  611. );
  612. NTSTATUS
  613. FlAcpiConfigureFloppy(
  614. PDISKETTE_EXTENSION DisketteExtension,
  615. PFDC_INFO FdcInfo
  616. );
  617. NTSTATUS
  618. FloppySystemControl(
  619. IN PDEVICE_OBJECT DeviceObject,
  620. IN PIRP Irp
  621. );