Commit | Line | Data |
---|---|---|
d6321d6e | 1 | /** @file\r |
2 | Include file for ISA Floppy Driver\r | |
f8cd287b | 3 | \r |
180a5a35 HT |
4 | Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>\r |
5 | This program and the accompanying materials\r | |
f8cd287b | 6 | are licensed and made available under the terms and conditions of the BSD License\r |
7 | which accompanies this distribution. The full text of the license may be found at\r | |
8 | http://opensource.org/licenses/bsd-license.php\r | |
11f43dfd | 9 | \r |
f8cd287b | 10 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r |
11 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
11f43dfd | 12 | \r |
f8cd287b | 13 | **/\r |
11f43dfd | 14 | \r |
d6321d6e | 15 | #ifndef _ISA_FLOPPY_H_\r |
16 | #define _ISA_FLOPPY_H_\r | |
11f43dfd | 17 | \r |
d6321d6e | 18 | #include <Uefi.h>\r |
ed7748fe | 19 | \r |
11f43dfd | 20 | #include <Protocol/BlockIo.h>\r |
21 | #include <Protocol/IsaIo.h>\r | |
22 | #include <Protocol/DevicePath.h>\r | |
d6321d6e | 23 | #include <Guid/StatusCodeDataTypeId.h>\r |
ed7748fe | 24 | \r |
11f43dfd | 25 | #include <Library/TimerLib.h>\r |
26 | #include <Library/DebugLib.h>\r | |
27 | #include <Library/UefiDriverEntryPoint.h>\r | |
28 | #include <Library/BaseLib.h>\r | |
29 | #include <Library/UefiLib.h>\r | |
30 | #include <Library/BaseMemoryLib.h>\r | |
31 | #include <Library/MemoryAllocationLib.h>\r | |
32 | #include <Library/UefiBootServicesTableLib.h>\r | |
33 | #include <Library/ReportStatusCodeLib.h>\r | |
d6321d6e | 34 | #include <Library/PcdLib.h>\r |
35 | \r | |
f3d08ccf | 36 | extern EFI_DRIVER_BINDING_PROTOCOL gFdcControllerDriver;\r |
11f43dfd | 37 | \r |
11f43dfd | 38 | #define STALL_1_SECOND 1000000\r |
39 | #define STALL_1_MSECOND 1000\r | |
40 | \r | |
41 | #define DATA_IN 1\r | |
42 | #define DATA_OUT 0\r | |
43 | #define READ 0\r | |
44 | #define WRITE 1\r | |
45 | \r | |
46 | //\r | |
47 | // Internal Data Structures\r | |
48 | //\r | |
f02bd376 | 49 | #define FDC_BLK_IO_DEV_SIGNATURE SIGNATURE_32 ('F', 'B', 'I', 'O')\r |
50 | #define FLOPPY_CONTROLLER_CONTEXT_SIGNATURE SIGNATURE_32 ('F', 'D', 'C', 'C')\r | |
11f43dfd | 51 | \r |
52 | typedef enum {\r | |
d6321d6e | 53 | FdcDisk0 = 0,\r |
54 | FdcDisk1 = 1,\r | |
55 | FdcMaxDisk = 2\r | |
11f43dfd | 56 | } EFI_FDC_DISK;\r |
57 | \r | |
58 | typedef struct {\r | |
59 | UINT32 Signature;\r | |
d6321d6e | 60 | LIST_ENTRY Link;\r |
11f43dfd | 61 | BOOLEAN FddResetPerformed;\r |
62 | EFI_STATUS FddResetStatus;\r | |
63 | BOOLEAN NeedRecalibrate;\r | |
64 | UINT8 NumberOfDrive;\r | |
65 | UINT16 BaseAddress;\r | |
66 | } FLOPPY_CONTROLLER_CONTEXT;\r | |
67 | \r | |
68 | typedef struct {\r | |
69 | UINTN Signature;\r | |
70 | EFI_HANDLE Handle;\r | |
71 | EFI_BLOCK_IO_PROTOCOL BlkIo;\r | |
72 | EFI_BLOCK_IO_MEDIA BlkMedia;\r | |
73 | \r | |
74 | EFI_ISA_IO_PROTOCOL *IsaIo;\r | |
75 | \r | |
76 | UINT16 BaseAddress;\r | |
77 | \r | |
78 | EFI_FDC_DISK Disk;\r | |
79 | UINT8 PresentCylinderNumber;\r | |
80 | UINT8 *Cache;\r | |
81 | \r | |
82 | EFI_EVENT Event;\r | |
83 | EFI_UNICODE_STRING_TABLE *ControllerNameTable;\r | |
84 | FLOPPY_CONTROLLER_CONTEXT *ControllerState;\r | |
85 | \r | |
86 | EFI_DEVICE_PATH_PROTOCOL *DevicePath;\r | |
87 | } FDC_BLK_IO_DEV;\r | |
88 | \r | |
89 | #include "ComponentName.h"\r | |
90 | \r | |
91 | #define FDD_BLK_IO_FROM_THIS(a) CR (a, FDC_BLK_IO_DEV, BlkIo, FDC_BLK_IO_DEV_SIGNATURE)\r | |
92 | #define FLOPPY_CONTROLLER_FROM_LIST_ENTRY(a) \\r | |
d6321d6e | 93 | CR (a, \\r |
94 | FLOPPY_CONTROLLER_CONTEXT, \\r | |
95 | Link, \\r | |
96 | FLOPPY_CONTROLLER_CONTEXT_SIGNATURE \\r | |
97 | )\r | |
11f43dfd | 98 | \r |
99 | #define DISK_1440K_EOT 0x12\r | |
100 | #define DISK_1440K_GPL 0x1b\r | |
101 | #define DISK_1440K_DTL 0xff\r | |
102 | #define DISK_1440K_NUMBER 0x02\r | |
103 | #define DISK_1440K_MAXTRACKNUM 0x4f\r | |
104 | #define DISK_1440K_BYTEPERSECTOR 512\r | |
105 | \r | |
106 | typedef struct {\r | |
107 | UINT8 CommandCode;\r | |
108 | UINT8 DiskHeadSel;\r | |
109 | UINT8 Cylinder;\r | |
110 | UINT8 Head;\r | |
111 | UINT8 Sector;\r | |
112 | UINT8 Number;\r | |
113 | UINT8 EndOfTrack;\r | |
114 | UINT8 GapLength;\r | |
115 | UINT8 DataLength;\r | |
116 | } FDD_COMMAND_PACKET1;\r | |
117 | \r | |
118 | typedef struct {\r | |
119 | UINT8 CommandCode;\r | |
120 | UINT8 DiskHeadSel;\r | |
121 | } FDD_COMMAND_PACKET2;\r | |
122 | \r | |
123 | typedef struct {\r | |
124 | UINT8 CommandCode;\r | |
125 | UINT8 SrtHut;\r | |
126 | UINT8 HltNd;\r | |
127 | } FDD_SPECIFY_CMD;\r | |
128 | \r | |
129 | typedef struct {\r | |
130 | UINT8 CommandCode;\r | |
131 | UINT8 DiskHeadSel;\r | |
132 | UINT8 NewCylinder;\r | |
133 | } FDD_SEEK_CMD;\r | |
134 | \r | |
135 | typedef struct {\r | |
136 | UINT8 CommandCode;\r | |
137 | UINT8 DiskHeadSel;\r | |
138 | UINT8 Cylinder;\r | |
139 | UINT8 Head;\r | |
140 | UINT8 Sector;\r | |
141 | UINT8 EndOfTrack;\r | |
142 | UINT8 GapLength;\r | |
143 | UINT8 ScanTestPause;\r | |
144 | } FDD_SCAN_CMD;\r | |
145 | \r | |
146 | typedef struct {\r | |
147 | UINT8 Status0;\r | |
148 | UINT8 Status1;\r | |
149 | UINT8 Status2;\r | |
d6321d6e | 150 | UINT8 Cylinder;\r |
151 | UINT8 Head;\r | |
152 | UINT8 Sector;\r | |
11f43dfd | 153 | UINT8 Number;\r |
154 | } FDD_RESULT_PACKET;\r | |
155 | \r | |
156 | //\r | |
157 | // FDC Registers\r | |
158 | //\r | |
159 | //\r | |
d6321d6e | 160 | // Digital Output Register address offset\r |
11f43dfd | 161 | //\r |
162 | #define FDC_REGISTER_DOR 2\r | |
163 | \r | |
164 | //\r | |
d6321d6e | 165 | // Main Status Register address offset\r |
11f43dfd | 166 | //\r |
167 | #define FDC_REGISTER_MSR 4\r | |
168 | \r | |
169 | //\r | |
d6321d6e | 170 | // Data Register address offset\r |
11f43dfd | 171 | //\r |
172 | #define FDC_REGISTER_DTR 5\r | |
173 | \r | |
174 | //\r | |
d6321d6e | 175 | // Configuration Control Register(data rate select) address offset\r |
11f43dfd | 176 | //\r |
177 | #define FDC_REGISTER_CCR 7\r | |
178 | \r | |
179 | //\r | |
d6321d6e | 180 | // Digital Input Register(diskchange) address offset\r |
11f43dfd | 181 | //\r |
182 | #define FDC_REGISTER_DIR 7\r | |
183 | \r | |
184 | \r | |
11f43dfd | 185 | //\r |
186 | // FDC Register Bit Definitions\r | |
187 | //\r | |
188 | //\r | |
189 | // Digital Out Register(WO)\r | |
190 | //\r | |
191 | //\r | |
192 | // Select Drive: 0=A 1=B\r | |
193 | //\r | |
194 | #define SELECT_DRV BIT0\r | |
195 | \r | |
196 | //\r | |
197 | // Reset FDC\r | |
198 | //\r | |
199 | #define RESET_FDC BIT2\r | |
200 | \r | |
201 | //\r | |
202 | // Enable Int & DMA\r | |
203 | //\r | |
204 | #define INT_DMA_ENABLE BIT3\r | |
205 | \r | |
206 | //\r | |
207 | // Turn On Drive A Motor\r | |
208 | //\r | |
209 | #define DRVA_MOTOR_ON BIT4\r | |
210 | \r | |
211 | //\r | |
212 | // Turn On Drive B Motor\r | |
213 | //\r | |
214 | #define DRVB_MOTOR_ON BIT5\r | |
215 | \r | |
216 | //\r | |
217 | // Main Status Register(RO)\r | |
218 | //\r | |
219 | //\r | |
220 | // Drive A Busy\r | |
221 | //\r | |
222 | #define MSR_DAB BIT0\r | |
223 | \r | |
224 | //\r | |
225 | // Drive B Busy\r | |
226 | //\r | |
227 | #define MSR_DBB BIT1\r | |
228 | \r | |
229 | //\r | |
230 | // FDC Busy\r | |
231 | //\r | |
232 | #define MSR_CB BIT4\r | |
233 | \r | |
234 | //\r | |
235 | // Non-DMA Mode\r | |
236 | //\r | |
237 | #define MSR_NDM BIT5\r | |
238 | \r | |
239 | //\r | |
240 | // Data Input/Output\r | |
241 | //\r | |
242 | #define MSR_DIO BIT6\r | |
243 | \r | |
244 | //\r | |
245 | // Request For Master\r | |
246 | //\r | |
247 | #define MSR_RQM BIT7\r | |
248 | \r | |
249 | //\r | |
250 | // Configuration Control Register(WO)\r | |
251 | //\r | |
252 | //\r | |
253 | // Data Rate select\r | |
254 | //\r | |
255 | #define CCR_DRC (BIT0 | BIT1)\r | |
256 | \r | |
257 | //\r | |
258 | // Digital Input Register(RO)\r | |
259 | //\r | |
260 | //\r | |
261 | // Disk change line\r | |
262 | //\r | |
263 | #define DIR_DCL BIT7\r | |
264 | //\r | |
265 | // #define CCR_DCL BIT7 // Diskette change\r | |
266 | //\r | |
267 | // 500K\r | |
268 | //\r | |
269 | #define DRC_500KBS 0x0\r | |
270 | \r | |
271 | //\r | |
272 | // 300K\r | |
273 | //\r | |
274 | #define DRC_300KBS 0x01\r | |
275 | \r | |
276 | //\r | |
277 | // 250K\r | |
278 | //\r | |
279 | #define DRC_250KBS 0x02\r | |
280 | \r | |
281 | //\r | |
282 | // FDC Command Code\r | |
283 | //\r | |
284 | #define READ_DATA_CMD 0x06\r | |
285 | #define WRITE_DATA_CMD 0x05\r | |
286 | #define WRITE_DEL_DATA_CMD 0x09\r | |
287 | #define READ_DEL_DATA_CMD 0x0C\r | |
288 | #define READ_TRACK_CMD 0x02\r | |
289 | #define READ_ID_CMD 0x0A\r | |
290 | #define FORMAT_TRACK_CMD 0x0D\r | |
291 | #define SCAN_EQU_CMD 0x11\r | |
292 | #define SCAN_LOW_EQU_CMD 0x19\r | |
293 | #define SCAN_HIGH_EQU_CMD 0x1D\r | |
294 | #define SEEK_CMD 0x0F\r | |
295 | #define RECALIBRATE_CMD 0x07\r | |
296 | #define SENSE_INT_STATUS_CMD 0x08\r | |
297 | #define SPECIFY_CMD 0x03\r | |
298 | #define SENSE_DRV_STATUS_CMD 0x04\r | |
299 | \r | |
300 | //\r | |
301 | // CMD_MT: Multi_Track Selector\r | |
302 | // when set , this flag selects the multi-track operating mode.\r | |
303 | // In this mode, the FDC treats a complete cylinder under head0 and 1\r | |
304 | // as a single track\r | |
305 | //\r | |
306 | #define CMD_MT BIT7\r | |
307 | \r | |
308 | //\r | |
309 | // CMD_MFM: MFM/FM Mode Selector\r | |
310 | // A one selects the double density(MFM) mode\r | |
311 | // A zero selects single density (FM) mode\r | |
312 | //\r | |
313 | #define CMD_MFM BIT6\r | |
314 | \r | |
315 | //\r | |
316 | // CMD_SK: Skip Flag\r | |
317 | // When set to 1, sectors containing a deleted data address mark will\r | |
318 | // automatically be skipped during the execution of Read Data.\r | |
319 | // When set to 0, the sector is read or written the same as the read and\r | |
320 | // write commands.\r | |
321 | //\r | |
322 | #define CMD_SK BIT5\r | |
323 | \r | |
324 | //\r | |
325 | // FDC Status Register Bit Definitions\r | |
326 | //\r | |
327 | //\r | |
328 | // Status Register 0\r | |
329 | //\r | |
330 | //\r | |
331 | // Interrupt Code\r | |
332 | //\r | |
333 | #define STS0_IC (BIT7 | BIT6)\r | |
334 | \r | |
335 | //\r | |
336 | // Seek End: the FDC completed a seek or recalibrate command\r | |
337 | //\r | |
338 | #define STS0_SE BIT5\r | |
339 | \r | |
340 | //\r | |
341 | // Equipment Check\r | |
342 | //\r | |
343 | #define STS0_EC BIT4\r | |
344 | \r | |
345 | //\r | |
346 | // Not Ready(unused), this bit is always 0\r | |
347 | //\r | |
348 | #define STS0_NR BIT3\r | |
349 | \r | |
350 | //\r | |
351 | // Head Address: the current head address\r | |
352 | //\r | |
353 | #define STS0_HA BIT2\r | |
354 | \r | |
355 | //\r | |
356 | // STS0_US1 & STS0_US0: Drive Select(the current selected drive)\r | |
357 | //\r | |
358 | //\r | |
359 | // Unit Select1\r | |
360 | //\r | |
361 | #define STS0_US1 BIT1\r | |
362 | \r | |
363 | //\r | |
364 | // Unit Select0\r | |
365 | //\r | |
366 | #define STS0_US0 BIT0\r | |
367 | \r | |
368 | //\r | |
369 | // Status Register 1\r | |
370 | //\r | |
371 | //\r | |
372 | // End of Cylinder\r | |
373 | //\r | |
374 | #define STS1_EN BIT7\r | |
375 | \r | |
376 | //\r | |
377 | // BIT6 is unused\r | |
378 | //\r | |
379 | //\r | |
380 | // Data Error: The FDC detected a CRC error in either the ID field or\r | |
381 | // data field of a sector\r | |
382 | //\r | |
383 | #define STS1_DE BIT5\r | |
384 | \r | |
385 | //\r | |
386 | // Overrun/Underrun: Becomes set if FDC does not receive CPU or DMA service\r | |
387 | // within the required time interval\r | |
388 | //\r | |
389 | #define STS1_OR BIT4\r | |
390 | \r | |
391 | //\r | |
392 | // BIT3 is unused\r | |
393 | //\r | |
394 | //\r | |
395 | // No data\r | |
396 | //\r | |
397 | #define STS1_ND BIT2\r | |
398 | \r | |
399 | //\r | |
400 | // Not Writable\r | |
401 | //\r | |
402 | #define STS1_NW BIT1\r | |
403 | \r | |
404 | //\r | |
405 | // Missing Address Mark\r | |
406 | //\r | |
407 | #define STS1_MA BIT0\r | |
408 | \r | |
409 | //\r | |
410 | // Control Mark\r | |
411 | //\r | |
412 | #define STS2_CM BIT6\r | |
413 | \r | |
414 | //\r | |
415 | // Data Error in Data Field: The FDC detected a CRC error in the data field\r | |
416 | //\r | |
417 | #define STS2_DD BIT5\r | |
418 | \r | |
419 | //\r | |
420 | // Wrong Cylinder: The track address from sector ID field is different from\r | |
421 | // the track address maintained inside FDC\r | |
422 | //\r | |
423 | #define STS2_WC BIT4\r | |
424 | \r | |
425 | //\r | |
426 | // Bad Cylinder\r | |
427 | //\r | |
428 | #define STS2_BC BIT1\r | |
429 | \r | |
430 | //\r | |
431 | // Missing Address Mark in Data Field\r | |
432 | //\r | |
433 | #define STS2_MD BIT0\r | |
434 | \r | |
435 | //\r | |
436 | // Write Protected\r | |
437 | //\r | |
438 | #define STS3_WP BIT6\r | |
439 | \r | |
440 | //\r | |
441 | // Track 0\r | |
442 | //\r | |
443 | #define STS3_T0 BIT4\r | |
444 | \r | |
445 | //\r | |
446 | // Head Address\r | |
447 | //\r | |
448 | #define STS3_HD BIT2\r | |
449 | \r | |
450 | //\r | |
451 | // STS3_US1 & STS3_US0 : Drive Select\r | |
452 | //\r | |
453 | #define STS3_US1 BIT1\r | |
454 | #define STS3_US0 BIT0\r | |
455 | \r | |
456 | //\r | |
457 | // Status Register 0 Interrupt Code Description\r | |
458 | //\r | |
459 | //\r | |
460 | // Normal Termination of Command\r | |
461 | //\r | |
462 | #define IC_NT 0x0\r | |
463 | \r | |
464 | //\r | |
465 | // Abnormal Termination of Command\r | |
466 | //\r | |
467 | #define IC_AT 0x40\r | |
468 | \r | |
469 | //\r | |
470 | // Invalid Command\r | |
471 | //\r | |
472 | #define IC_IC 0x80\r | |
473 | \r | |
474 | //\r | |
475 | // Abnormal Termination caused by Polling\r | |
476 | //\r | |
477 | #define IC_ATRC 0xC0\r | |
478 | \r | |
11f43dfd | 479 | //\r |
480 | // EFI Driver Binding Protocol Functions\r | |
481 | //\r | |
d6321d6e | 482 | \r |
bcd70414 | 483 | /**\r |
d6321d6e | 484 | Test controller is a floppy disk drive device\r |
bcd70414 | 485 | \r |
d6321d6e | 486 | @param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance. \r |
487 | @param[in] Controller The handle of the controller to test.\r | |
488 | @param[in] RemainingDevicePath A pointer to the remaining portion of a device path.\r | |
bcd70414 | 489 | \r |
d6321d6e | 490 | @retval EFI_SUCCESS The device is supported by this driver.\r |
491 | @retval EFI_ALREADY_STARTED The device is already being managed by this driver.\r | |
492 | @retval EFI_ACCESS_DENIED The device is already being managed by a different driver \r | |
493 | or an application that requires exclusive access.\r | |
bcd70414 | 494 | **/\r |
11f43dfd | 495 | EFI_STATUS\r |
496 | EFIAPI\r | |
497 | FdcControllerDriverSupported (\r | |
498 | IN EFI_DRIVER_BINDING_PROTOCOL *This,\r | |
499 | IN EFI_HANDLE Controller,\r | |
500 | IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath\r | |
ed66e1bc | 501 | );\r |
11f43dfd | 502 | \r |
bcd70414 | 503 | /**\r |
d6321d6e | 504 | Start this driver on Controller.\r |
505 | \r | |
506 | @param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.\r | |
507 | @param[in] ControllerHandle The handle of the controller to start. This handle \r | |
508 | must support a protocol interface that supplies \r | |
509 | an I/O abstraction to the driver.\r | |
510 | @param[in] RemainingDevicePath A pointer to the remaining portion of a device path. \r | |
511 | This parameter is ignored by device drivers, and is optional for bus drivers.\r | |
512 | \r | |
513 | @retval EFI_SUCCESS The device was started.\r | |
514 | @retval EFI_DEVICE_ERROR The device could not be started due to a device error.\r | |
515 | Currently not implemented.\r | |
516 | @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack of resources.\r | |
517 | @retval Others The driver failded to start the device.\r | |
bcd70414 | 518 | **/\r |
11f43dfd | 519 | EFI_STATUS\r |
520 | EFIAPI\r | |
521 | FdcControllerDriverStart (\r | |
522 | IN EFI_DRIVER_BINDING_PROTOCOL *This,\r | |
523 | IN EFI_HANDLE Controller,\r | |
524 | IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath\r | |
ed66e1bc | 525 | );\r |
11f43dfd | 526 | \r |
bcd70414 | 527 | /**\r |
d6321d6e | 528 | Stop this driver on ControllerHandle.\r |
529 | \r | |
530 | @param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.\r | |
531 | @param[in] ControllerHandle A handle to the device being stopped. The handle must \r | |
532 | support a bus specific I/O protocol for the driver \r | |
533 | to use to stop the device.\r | |
534 | @param[in] NumberOfChildren The number of child device handles in ChildHandleBuffer.\r | |
535 | @param[in] ChildHandleBuffer An array of child handles to be freed. May be NULL \r | |
536 | if NumberOfChildren is 0.\r | |
537 | \r | |
538 | @retval EFI_SUCCESS The device was stopped.\r | |
539 | @retval EFI_DEVICE_ERROR The device could not be stopped due to a device error.\r | |
bcd70414 | 540 | **/\r |
11f43dfd | 541 | EFI_STATUS\r |
542 | EFIAPI\r | |
543 | FdcControllerDriverStop (\r | |
544 | IN EFI_DRIVER_BINDING_PROTOCOL *This,\r | |
545 | IN EFI_HANDLE Controller,\r | |
546 | IN UINTN NumberOfChildren,\r | |
547 | IN EFI_HANDLE *ChildHandleBuffer\r | |
ed66e1bc | 548 | );\r |
11f43dfd | 549 | \r |
550 | //\r | |
551 | // EFI Block I/O Protocol Functions\r | |
552 | //\r | |
d6321d6e | 553 | \r |
bcd70414 | 554 | /**\r |
d6321d6e | 555 | Reset the Floppy Logic Drive, call the FddReset function. \r |
bcd70414 | 556 | \r |
557 | @param This EFI_BLOCK_IO *: A pointer to the Block I/O protocol interface\r | |
558 | @param ExtendedVerification BOOLEAN: Indicate that the driver may perform a more \r | |
559 | exhaustive verification operation of the device during \r | |
560 | reset, now this par is ignored in this driver \r | |
561 | @retval EFI_SUCCESS: The Floppy Logic Drive is reset\r | |
562 | @retval EFI_DEVICE_ERROR: The Floppy Logic Drive is not functioning correctly \r | |
563 | and can not be reset\r | |
564 | \r | |
565 | **/\r | |
11f43dfd | 566 | EFI_STATUS\r |
567 | EFIAPI\r | |
568 | FdcReset (\r | |
569 | IN EFI_BLOCK_IO_PROTOCOL *This,\r | |
570 | IN BOOLEAN ExtendedVerification\r | |
ed66e1bc | 571 | );\r |
11f43dfd | 572 | \r |
bcd70414 | 573 | /**\r |
d6321d6e | 574 | Flush block via fdd controller.\r |
bcd70414 | 575 | \r |
576 | @param This EFI_BLOCK_IO *: A pointer to the Block I/O protocol interface\r | |
577 | @return EFI_SUCCESS\r | |
578 | \r | |
579 | **/\r | |
11f43dfd | 580 | EFI_STATUS\r |
581 | EFIAPI\r | |
582 | FddFlushBlocks (\r | |
583 | IN EFI_BLOCK_IO_PROTOCOL *This\r | |
ed66e1bc | 584 | );\r |
11f43dfd | 585 | \r |
bcd70414 | 586 | /**\r |
d6321d6e | 587 | Read the requested number of blocks from the device. \r |
bcd70414 | 588 | \r |
589 | @param This EFI_BLOCK_IO *: A pointer to the Block I/O protocol interface\r | |
590 | @param MediaId UINT32: The media id that the read request is for \r | |
d6321d6e | 591 | @param Lba EFI_LBA: The starting logic block address to read from on the device\r |
bcd70414 | 592 | @param BufferSize UINTN: The size of the Buffer in bytes\r |
593 | @param Buffer VOID *: A pointer to the destination buffer for the data\r | |
594 | \r | |
595 | @retval EFI_SUCCESS: The data was read correctly from the device\r | |
596 | @retval EFI_DEVICE_ERROR:The device reported an error while attempting to perform\r | |
597 | the read operation\r | |
598 | @retval EFI_NO_MEDIA: There is no media in the device\r | |
599 | @retval EFI_MEDIA_CHANGED: The MediaId is not for the current media\r | |
600 | @retval EFI_BAD_BUFFER_SIZE: The BufferSize parameter is not a multiple of the \r | |
601 | intrinsic block size of the device\r | |
602 | @retval EFI_INVALID_PARAMETER:The read request contains LBAs that are not valid, \r | |
603 | or the buffer is not on proper alignment \r | |
604 | \r | |
605 | **/\r | |
11f43dfd | 606 | EFI_STATUS\r |
607 | EFIAPI\r | |
608 | FddReadBlocks (\r | |
609 | IN EFI_BLOCK_IO_PROTOCOL *This,\r | |
610 | IN UINT32 MediaId,\r | |
d6321d6e | 611 | IN EFI_LBA Lba,\r |
11f43dfd | 612 | IN UINTN BufferSize,\r |
613 | OUT VOID *Buffer\r | |
ed66e1bc | 614 | );\r |
11f43dfd | 615 | \r |
bcd70414 | 616 | /**\r |
d6321d6e | 617 | Write a specified number of blocks to the device. \r |
bcd70414 | 618 | \r |
619 | @param This EFI_BLOCK_IO *: A pointer to the Block I/O protocol interface\r | |
620 | @param MediaId UINT32: The media id that the write request is for \r | |
d6321d6e | 621 | @param Lba EFI_LBA: The starting logic block address to be written\r |
bcd70414 | 622 | @param BufferSize UINTN: The size in bytes in Buffer\r |
623 | @param Buffer VOID *: A pointer to the source buffer for the data\r | |
624 | \r | |
625 | @retval EFI_SUCCESS: The data were written correctly to the device\r | |
626 | @retval EFI_WRITE_PROTECTED: The device can not be written to \r | |
627 | @retval EFI_NO_MEDIA: There is no media in the device\r | |
628 | @retval EFI_MEDIA_CHANGED: The MediaId is not for the current media\r | |
629 | @retval EFI_DEVICE_ERROR: The device reported an error while attempting to perform \r | |
630 | the write operation \r | |
631 | @retval EFI_BAD_BUFFER_SIZE: The BufferSize parameter is not a multiple of the \r | |
632 | intrinsic block size of the device\r | |
633 | @retval EFI_INVALID_PARAMETER:The write request contains LBAs that are not valid, \r | |
634 | or the buffer is not on proper alignment \r | |
635 | **/\r | |
11f43dfd | 636 | EFI_STATUS\r |
637 | EFIAPI\r | |
638 | FddWriteBlocks (\r | |
639 | IN EFI_BLOCK_IO_PROTOCOL *This,\r | |
640 | IN UINT32 MediaId,\r | |
d6321d6e | 641 | IN EFI_LBA Lba,\r |
11f43dfd | 642 | IN UINTN BufferSize,\r |
643 | IN VOID *Buffer\r | |
ed66e1bc | 644 | );\r |
11f43dfd | 645 | \r |
646 | //\r | |
647 | // Prototypes of internal functions\r | |
648 | //\r | |
bcd70414 | 649 | /**\r |
650 | \r | |
d6321d6e | 651 | Detect the floppy drive is presented or not.\r |
bcd70414 | 652 | \r |
653 | @param FdcDev FDC_BLK_IO_DEV * : A pointer to the Data Structure FDC_BLK_IO_DEV\r | |
654 | @retval EFI_SUCCESS Drive is presented\r | |
655 | @retval EFI_NOT_FOUND Drive is not presented\r | |
656 | \r | |
657 | **/\r | |
11f43dfd | 658 | EFI_STATUS\r |
659 | DiscoverFddDevice (\r | |
660 | IN FDC_BLK_IO_DEV *FdcDev\r | |
ed66e1bc | 661 | );\r |
11f43dfd | 662 | \r |
bcd70414 | 663 | /**\r |
11f43dfd | 664 | \r |
d6321d6e | 665 | Do recalibrate and see the drive is presented or not.\r |
666 | Set the media parameters.\r | |
bcd70414 | 667 | \r |
668 | @param FdcDev FDC_BLK_IO_DEV * : A pointer to the Data Structure FDC_BLK_IO_DEV\r | |
669 | @return the drive is presented or not\r | |
11f43dfd | 670 | \r |
bcd70414 | 671 | **/\r |
11f43dfd | 672 | EFI_STATUS\r |
673 | FddIdentify (\r | |
674 | IN FDC_BLK_IO_DEV *FdcDev\r | |
ed66e1bc | 675 | );\r |
11f43dfd | 676 | \r |
bcd70414 | 677 | /**\r |
11f43dfd | 678 | \r |
d6321d6e | 679 | Reset the Floppy Logic Drive.\r |
bcd70414 | 680 | \r |
681 | @param FdcDev FDC_BLK_IO_DEV * : A pointer to the Data Structure FDC_BLK_IO_DEV\r | |
682 | \r | |
683 | @retval EFI_SUCCESS: The Floppy Logic Drive is reset\r | |
684 | @retval EFI_DEVICE_ERROR: The Floppy Logic Drive is not functioning correctly and\r | |
685 | can not be reset\r | |
11f43dfd | 686 | \r |
bcd70414 | 687 | **/\r |
11f43dfd | 688 | EFI_STATUS\r |
689 | FddReset (\r | |
690 | IN FDC_BLK_IO_DEV *FdcDev\r | |
ed66e1bc | 691 | );\r |
11f43dfd | 692 | \r |
bcd70414 | 693 | /**\r |
11f43dfd | 694 | \r |
d6321d6e | 695 | Turn the drive's motor on.\r |
696 | The drive's motor must be on before any command can be executed.\r | |
bcd70414 | 697 | \r |
698 | @param FdcDev FDC_BLK_IO_DEV * : A pointer to the Data Structure FDC_BLK_IO_DEV\r | |
699 | \r | |
700 | @retval EFI_SUCCESS: Turn the drive's motor on successfully\r | |
701 | @retval EFI_DEVICE_ERROR: The drive is busy, so can not turn motor on\r | |
702 | @retval EFI_INVALID_PARAMETER: Fail to Set timer(Cancel timer)\r | |
11f43dfd | 703 | \r |
bcd70414 | 704 | **/\r |
11f43dfd | 705 | EFI_STATUS\r |
706 | MotorOn (\r | |
707 | IN FDC_BLK_IO_DEV *FdcDev\r | |
ed66e1bc | 708 | );\r |
11f43dfd | 709 | \r |
bcd70414 | 710 | /**\r |
11f43dfd | 711 | \r |
d6321d6e | 712 | Set a Timer and when Timer goes off, turn the motor off.\r |
bcd70414 | 713 | \r |
714 | \r | |
715 | @param FdcDev FDC_BLK_IO_DEV * : A pointer to the Data Structure FDC_BLK_IO_DEV\r | |
716 | \r | |
717 | @retval EFI_SUCCESS: Set the Timer successfully\r | |
718 | @retval EFI_INVALID_PARAMETER: Fail to Set the timer\r | |
11f43dfd | 719 | \r |
bcd70414 | 720 | **/\r |
11f43dfd | 721 | EFI_STATUS\r |
722 | MotorOff (\r | |
723 | IN FDC_BLK_IO_DEV *FdcDev\r | |
ed66e1bc | 724 | );\r |
11f43dfd | 725 | \r |
bcd70414 | 726 | /**\r |
d6321d6e | 727 | Detect the disk in the drive is changed or not.\r |
bcd70414 | 728 | \r |
729 | \r | |
730 | @param FdcDev FDC_BLK_IO_DEV *: A pointer to Data Structure FDC_BLK_IO_DEV\r | |
731 | \r | |
732 | @retval EFI_SUCCESS: No disk media change\r | |
733 | @retval EFI_DEVICE_ERROR: Fail to do the recalibrate or seek operation\r | |
734 | @retval EFI_NO_MEDIA: No disk in the drive\r | |
735 | @retval EFI_MEDIA_CHANGED: There is a new disk in the drive\r | |
736 | **/\r | |
11f43dfd | 737 | EFI_STATUS\r |
738 | DisketChanged (\r | |
739 | IN FDC_BLK_IO_DEV *FdcDev\r | |
ed66e1bc | 740 | );\r |
11f43dfd | 741 | \r |
bcd70414 | 742 | /**\r |
743 | Do the Specify command, this command sets DMA operation\r | |
744 | and the initial values for each of the three internal\r | |
d6321d6e | 745 | times: HUT, SRT and HLT.\r |
bcd70414 | 746 | \r |
fdb05fa3 | 747 | @param FdcDev Pointer to instance of FDC_BLK_IO_DEV\r |
bcd70414 | 748 | \r |
749 | @retval EFI_SUCCESS: Execute the Specify command successfully\r | |
750 | @retval EFI_DEVICE_ERROR: Fail to execute the command\r | |
751 | \r | |
752 | **/\r | |
11f43dfd | 753 | EFI_STATUS\r |
754 | Specify (\r | |
755 | IN FDC_BLK_IO_DEV *FdcDev\r | |
ed66e1bc | 756 | );\r |
11f43dfd | 757 | \r |
bcd70414 | 758 | /**\r |
d6321d6e | 759 | Set the head of floppy drive to track 0.\r |
bcd70414 | 760 | \r |
761 | @param FdcDev FDC_BLK_IO_DEV *: A pointer to Data Structure FDC_BLK_IO_DEV\r | |
762 | @retval EFI_SUCCESS: Execute the Recalibrate operation successfully\r | |
763 | @retval EFI_DEVICE_ERROR: Fail to execute the Recalibrate operation\r | |
764 | \r | |
765 | **/\r | |
11f43dfd | 766 | EFI_STATUS\r |
767 | Recalibrate (\r | |
768 | IN FDC_BLK_IO_DEV *FdcDev\r | |
ed66e1bc | 769 | );\r |
11f43dfd | 770 | \r |
bcd70414 | 771 | /**\r |
d6321d6e | 772 | Set the head of floppy drive to the new cylinder.\r |
bcd70414 | 773 | \r |
774 | @param FdcDev FDC_BLK_IO_DEV *: A pointer to Data Structure FDC_BLK_IO_DEV\r | |
775 | @param Lba EFI_LBA : The logic block address want to seek\r | |
776 | \r | |
777 | @retval EFI_SUCCESS: Execute the Seek operation successfully\r | |
778 | @retval EFI_DEVICE_ERROR: Fail to execute the Seek operation\r | |
779 | \r | |
780 | **/\r | |
11f43dfd | 781 | EFI_STATUS\r |
782 | Seek (\r | |
783 | IN FDC_BLK_IO_DEV *FdcDev,\r | |
784 | IN EFI_LBA Lba\r | |
ed66e1bc | 785 | );\r |
11f43dfd | 786 | \r |
bcd70414 | 787 | /**\r |
d6321d6e | 788 | Do the Sense Interrupt Status command, this command resets the interrupt signal.\r |
bcd70414 | 789 | \r |
fdb05fa3 | 790 | @param FdcDev FDC_BLK_IO_DEV *: A pointer to Data Structure FDC_BLK_IO_DEV\r |
bcd70414 | 791 | @param StatusRegister0 UINT8 *: Be used to save Status Register 0 read from FDC\r |
792 | @param PresentCylinderNumber UINT8 *: Be used to save present cylinder number\r | |
793 | read from FDC\r | |
794 | \r | |
795 | @retval EFI_SUCCESS: Execute the Sense Interrupt Status command successfully\r | |
796 | @retval EFI_DEVICE_ERROR: Fail to execute the command\r | |
797 | \r | |
798 | **/\r | |
11f43dfd | 799 | EFI_STATUS\r |
800 | SenseIntStatus (\r | |
801 | IN FDC_BLK_IO_DEV *FdcDev,\r | |
802 | IN OUT UINT8 *StatusRegister0,\r | |
803 | IN OUT UINT8 *PresentCylinderNumber\r | |
ed66e1bc | 804 | );\r |
11f43dfd | 805 | \r |
bcd70414 | 806 | /**\r |
d6321d6e | 807 | Do the Sense Drive Status command.\r |
bcd70414 | 808 | \r |
809 | @param FdcDev FDC_BLK_IO_DEV *: A pointer to Data Structure FDC_BLK_IO_DEV\r | |
810 | @param Lba EFI_LBA : Logic block address\r | |
811 | \r | |
812 | @retval EFI_SUCCESS: Execute the Sense Drive Status command successfully\r | |
813 | @retval EFI_DEVICE_ERROR: Fail to execute the command\r | |
814 | @retval EFI_WRITE_PROTECTED:The disk is write protected\r | |
815 | \r | |
816 | **/\r | |
11f43dfd | 817 | EFI_STATUS\r |
818 | SenseDrvStatus (\r | |
819 | IN FDC_BLK_IO_DEV *FdcDev,\r | |
820 | IN EFI_LBA Lba\r | |
ed66e1bc | 821 | );\r |
11f43dfd | 822 | \r |
bcd70414 | 823 | /**\r |
d6321d6e | 824 | Update the disk media properties and if necessary reinstall Block I/O interface.\r |
bcd70414 | 825 | \r |
826 | @param FdcDev FDC_BLK_IO_DEV *: A pointer to Data Structure FDC_BLK_IO_DEV\r | |
827 | \r | |
828 | @retval EFI_SUCCESS: Do the operation successfully\r | |
829 | @retval EFI_DEVICE_ERROR: Fail to the operation\r | |
830 | \r | |
831 | **/\r | |
11f43dfd | 832 | EFI_STATUS\r |
833 | DetectMedia (\r | |
834 | IN FDC_BLK_IO_DEV *FdcDev\r | |
ed66e1bc | 835 | );\r |
11f43dfd | 836 | \r |
bcd70414 | 837 | /**\r |
d6321d6e | 838 | Set the data rate and so on.\r |
bcd70414 | 839 | \r |
840 | @param FdcDev FDC_BLK_IO_DEV *: A pointer to Data Structure FDC_BLK_IO_DEV\r | |
841 | \r | |
842 | @retval EFI_SUCCESS success to set the data rate\r | |
843 | **/\r | |
11f43dfd | 844 | EFI_STATUS\r |
845 | Setup (\r | |
846 | IN FDC_BLK_IO_DEV *FdcDev\r | |
ed66e1bc | 847 | );\r |
11f43dfd | 848 | \r |
bcd70414 | 849 | /**\r |
d6321d6e | 850 | Read or Write a number of blocks in the same cylinder.\r |
bcd70414 | 851 | \r |
852 | @param FdcDev A pointer to Data Structure FDC_BLK_IO_DEV\r | |
853 | @param HostAddress device address \r | |
854 | @param Lba The starting logic block address to read from on the device\r | |
855 | @param NumberOfBlocks The number of block wanted to be read or write\r | |
856 | @param Read Operation type: read or write\r | |
857 | \r | |
858 | @retval EFI_SUCCESS Success operate\r | |
859 | \r | |
860 | **/\r | |
11f43dfd | 861 | EFI_STATUS\r |
862 | ReadWriteDataSector (\r | |
863 | IN FDC_BLK_IO_DEV *FdcDev,\r | |
864 | IN VOID *HostAddress,\r | |
865 | IN EFI_LBA Lba,\r | |
866 | IN UINTN NumberOfBlocks,\r | |
867 | IN BOOLEAN Read\r | |
ed66e1bc | 868 | );\r |
11f43dfd | 869 | \r |
bcd70414 | 870 | /**\r |
d6321d6e | 871 | Fill in FDD command's parameter.\r |
bcd70414 | 872 | \r |
873 | @param FdcDev Pointer to instance of FDC_BLK_IO_DEV\r | |
874 | @param Lba The starting logic block address to read from on the device\r | |
875 | @param Command FDD command\r | |
876 | \r | |
877 | **/\r | |
11f43dfd | 878 | VOID\r |
879 | FillPara (\r | |
880 | IN FDC_BLK_IO_DEV *FdcDev,\r | |
881 | IN EFI_LBA Lba,\r | |
882 | IN FDD_COMMAND_PACKET1 *Command\r | |
ed66e1bc | 883 | );\r |
11f43dfd | 884 | \r |
bcd70414 | 885 | /**\r |
d6321d6e | 886 | Read result byte from Data Register of FDC.\r |
bcd70414 | 887 | \r |
d6321d6e | 888 | @param FdcDev Pointer to instance of FDC_BLK_IO_DEV\r |
889 | @param Pointer Buffer to store the byte read from FDC\r | |
bcd70414 | 890 | \r |
d6321d6e | 891 | @retval EFI_SUCCESS Read result byte from FDC successfully\r |
892 | @retval EFI_DEVICE_ERROR The FDC is not ready to be read\r | |
bcd70414 | 893 | \r |
894 | **/\r | |
11f43dfd | 895 | EFI_STATUS\r |
896 | DataInByte (\r | |
d6321d6e | 897 | IN FDC_BLK_IO_DEV *FdcDev,\r |
898 | OUT UINT8 *Pointer\r | |
ed66e1bc | 899 | );\r |
11f43dfd | 900 | \r |
bcd70414 | 901 | /**\r |
d6321d6e | 902 | Write command byte to Data Register of FDC.\r |
bcd70414 | 903 | \r |
904 | @param FdcDev Pointer to instance of FDC_BLK_IO_DEV\r | |
905 | @param Pointer Be used to save command byte written to FDC\r | |
906 | \r | |
907 | @retval EFI_SUCCESS: Write command byte to FDC successfully\r | |
908 | @retval EFI_DEVICE_ERROR: The FDC is not ready to be written\r | |
909 | \r | |
910 | **/\r | |
11f43dfd | 911 | EFI_STATUS\r |
912 | DataOutByte (\r | |
913 | IN FDC_BLK_IO_DEV *FdcDev,\r | |
914 | IN UINT8 *Pointer\r | |
ed66e1bc | 915 | );\r |
11f43dfd | 916 | \r |
bcd70414 | 917 | /**\r |
d6321d6e | 918 | Detect the specified floppy logic drive is busy or not within a period of time.\r |
bcd70414 | 919 | \r |
fdb05fa3 | 920 | @param FdcDev Indicate it is drive A or drive B\r |
bcd70414 | 921 | @param TimeoutInSeconds the time period for waiting\r |
922 | \r | |
923 | @retval EFI_SUCCESS: The drive and command are not busy\r | |
924 | @retval EFI_TIMEOUT: The drive or command is still busy after a period time that\r | |
925 | set by TimeoutInSeconds\r | |
926 | \r | |
927 | **/\r | |
11f43dfd | 928 | EFI_STATUS\r |
929 | FddWaitForBSYClear (\r | |
930 | IN FDC_BLK_IO_DEV *FdcDev,\r | |
931 | IN UINTN TimeoutInSeconds\r | |
ed66e1bc | 932 | );\r |
11f43dfd | 933 | \r |
bcd70414 | 934 | /**\r |
d6321d6e | 935 | Determine whether FDC is ready to write or read.\r |
bcd70414 | 936 | \r |
937 | @param FdcDev Pointer to instance of FDC_BLK_IO_DEV\r | |
938 | @param Dio BOOLEAN: Indicate the FDC is waiting to write or read\r | |
939 | @param TimeoutInSeconds UINTN: The time period for waiting\r | |
940 | \r | |
941 | @retval EFI_SUCCESS: FDC is ready to write or read\r | |
942 | @retval EFI_NOT_READY: FDC is not ready within the specified time period\r | |
11f43dfd | 943 | \r |
bcd70414 | 944 | **/\r |
11f43dfd | 945 | EFI_STATUS\r |
946 | FddDRQReady (\r | |
947 | IN FDC_BLK_IO_DEV *FdcDev,\r | |
948 | IN BOOLEAN Dio,\r | |
949 | IN UINTN TimeoutInSeconds\r | |
ed66e1bc | 950 | );\r |
11f43dfd | 951 | \r |
bcd70414 | 952 | /**\r |
d6321d6e | 953 | Set FDC control structure's attribute according to result.\r |
11f43dfd | 954 | \r |
bcd70414 | 955 | @param Result Point to result structure\r |
956 | @param FdcDev FDC control structure\r | |
11f43dfd | 957 | \r |
fdb05fa3 | 958 | @retval EFI_DEVICE_ERROR - GC_TODO: Add description for return value\r |
959 | @retval EFI_DEVICE_ERROR - GC_TODO: Add description for return value\r | |
960 | @retval EFI_DEVICE_ERROR - GC_TODO: Add description for return value\r | |
961 | @retval EFI_SUCCESS - GC_TODO: Add description for return value\r | |
11f43dfd | 962 | \r |
bcd70414 | 963 | **/\r |
11f43dfd | 964 | EFI_STATUS\r |
965 | CheckResult (\r | |
966 | IN FDD_RESULT_PACKET *Result,\r | |
967 | IN OUT FDC_BLK_IO_DEV *FdcDev\r | |
ed66e1bc | 968 | );\r |
11f43dfd | 969 | \r |
bcd70414 | 970 | /**\r |
d6321d6e | 971 | Check the drive status information.\r |
bcd70414 | 972 | \r |
973 | @param StatusRegister3 the value of Status Register 3\r | |
974 | \r | |
975 | @retval EFI_SUCCESS The disk is not write protected\r | |
976 | @retval EFI_WRITE_PROTECTED: The disk is write protected\r | |
977 | \r | |
978 | **/\r | |
11f43dfd | 979 | EFI_STATUS\r |
980 | CheckStatus3 (\r | |
981 | IN UINT8 StatusRegister3\r | |
ed66e1bc | 982 | );\r |
11f43dfd | 983 | \r |
bcd70414 | 984 | /**\r |
d6321d6e | 985 | Calculate the number of block in the same cylinder according to Lba.\r |
bcd70414 | 986 | \r |
987 | @param FdcDev FDC_BLK_IO_DEV *: A pointer to Data Structure FDC_BLK_IO_DEV\r | |
d6321d6e | 988 | @param Lba EFI_LBA: The starting logic block address\r |
bcd70414 | 989 | @param NumberOfBlocks UINTN: The number of blocks\r |
990 | \r | |
991 | @return The number of blocks in the same cylinder which the starting\r | |
d6321d6e | 992 | logic block address is Lba\r |
bcd70414 | 993 | \r |
994 | **/\r | |
11f43dfd | 995 | UINTN\r |
996 | GetTransferBlockCount (\r | |
997 | IN FDC_BLK_IO_DEV *FdcDev,\r | |
d6321d6e | 998 | IN EFI_LBA Lba,\r |
11f43dfd | 999 | IN UINTN NumberOfBlocks\r |
ed66e1bc | 1000 | );\r |
11f43dfd | 1001 | \r |
bcd70414 | 1002 | /**\r |
d6321d6e | 1003 | When the Timer(2s) off, turn the drive's motor off.\r |
bcd70414 | 1004 | \r |
1005 | @param Event EFI_EVENT: Event(the timer) whose notification function is being\r | |
1006 | invoked\r | |
1007 | @param Context VOID *: Pointer to the notification function's context\r | |
1008 | \r | |
1009 | **/\r | |
11f43dfd | 1010 | VOID\r |
1011 | EFIAPI\r | |
1012 | FddTimerProc (\r | |
1013 | IN EFI_EVENT Event,\r | |
1014 | IN VOID *Context\r | |
ed66e1bc | 1015 | );\r |
11f43dfd | 1016 | \r |
bcd70414 | 1017 | /**\r |
d6321d6e | 1018 | Read I/O port for FDC.\r |
bcd70414 | 1019 | \r |
1020 | @param FdcDev FDC_BLK_IO_DEV *: A pointer to Data Structure FDC_BLK_IO_DEV\r | |
1021 | @param Offset The offset address of port\r | |
1022 | \r | |
1023 | **/\r | |
11f43dfd | 1024 | UINT8\r |
1025 | FdcReadPort (\r | |
1026 | IN FDC_BLK_IO_DEV *FdcDev,\r | |
1027 | IN UINT32 Offset\r | |
ed66e1bc | 1028 | );\r |
11f43dfd | 1029 | \r |
bcd70414 | 1030 | /**\r |
d6321d6e | 1031 | Write I/O port for FDC.\r |
bcd70414 | 1032 | \r |
1033 | @param FdcDev FDC_BLK_IO_DEV *: A pointer to Data Structure FDC_BLK_IO_DEV\r | |
1034 | @param Offset The offset address of port\r | |
fdb05fa3 | 1035 | @param Data Value written to port\r |
1036 | \r | |
bcd70414 | 1037 | **/\r |
11f43dfd | 1038 | VOID\r |
1039 | FdcWritePort (\r | |
1040 | IN FDC_BLK_IO_DEV *FdcDev,\r | |
1041 | IN UINT32 Offset,\r | |
1042 | IN UINT8 Data\r | |
ed66e1bc | 1043 | );\r |
11f43dfd | 1044 | \r |
bcd70414 | 1045 | /**\r |
d6321d6e | 1046 | Read or Write a number of blocks to floppy device.\r |
11f43dfd | 1047 | \r |
bcd70414 | 1048 | @param This Pointer to instance of EFI_BLOCK_IO_PROTOCOL\r |
1049 | @param MediaId The media id of read/write request\r | |
d6321d6e | 1050 | @param Lba The starting logic block address to read from on the device\r |
bcd70414 | 1051 | @param BufferSize The size of the Buffer in bytes\r |
1052 | @param Operation - GC_TODO: add argument description\r | |
fdb05fa3 | 1053 | @param Buffer - GC_TODO: add argument description\r |
11f43dfd | 1054 | \r |
bcd70414 | 1055 | @retval EFI_INVALID_PARAMETER - GC_TODO: Add description for return value\r |
1056 | @retval EFI_SUCCESS - GC_TODO: Add description for return value\r | |
1057 | @retval EFI_DEVICE_ERROR - GC_TODO: Add description for return value\r | |
1058 | @retval EFI_DEVICE_ERROR - GC_TODO: Add description for return value\r | |
1059 | @retval EFI_NO_MEDIA - GC_TODO: Add description for return value\r | |
1060 | @retval EFI_MEDIA_CHANGED - GC_TODO: Add description for return value\r | |
1061 | @retval EFI_WRITE_PROTECTED - GC_TODO: Add description for return value\r | |
1062 | @retval EFI_BAD_BUFFER_SIZE - GC_TODO: Add description for return value\r | |
1063 | @retval EFI_INVALID_PARAMETER - GC_TODO: Add description for return value\r | |
1064 | @retval EFI_INVALID_PARAMETER - GC_TODO: Add description for return value\r | |
1065 | @retval EFI_SUCCESS - GC_TODO: Add description for return value\r | |
1066 | @retval EFI_DEVICE_ERROR - GC_TODO: Add description for return value\r | |
1067 | @retval EFI_DEVICE_ERROR - GC_TODO: Add description for return value\r | |
1068 | @retval EFI_SUCCESS - GC_TODO: Add description for return value\r | |
11f43dfd | 1069 | \r |
bcd70414 | 1070 | **/\r |
11f43dfd | 1071 | EFI_STATUS\r |
1072 | FddReadWriteBlocks (\r | |
1073 | IN EFI_BLOCK_IO_PROTOCOL *This,\r | |
1074 | IN UINT32 MediaId,\r | |
d6321d6e | 1075 | IN EFI_LBA Lba,\r |
11f43dfd | 1076 | IN UINTN BufferSize,\r |
1077 | IN BOOLEAN Operation,\r | |
1078 | OUT VOID *Buffer\r | |
ed66e1bc | 1079 | );\r |
11f43dfd | 1080 | \r |
bcd70414 | 1081 | /**\r |
d6321d6e | 1082 | Common interface for free cache. \r |
bcd70414 | 1083 | \r |
fdb05fa3 | 1084 | @param FdcDev Pointer of FDC_BLK_IO_DEV instance\r |
bcd70414 | 1085 | \r |
1086 | **/\r | |
11f43dfd | 1087 | VOID\r |
1088 | FdcFreeCache (\r | |
1089 | IN FDC_BLK_IO_DEV *FdcDev\r | |
ed66e1bc | 1090 | );\r |
11f43dfd | 1091 | \r |
1092 | #endif\r | |
bcd70414 | 1093 | \r |