2 DiskIo driver that layers it's self on every Block IO protocol in the system.
3 DiskIo converts a block oriented device to a byte oriented device.
5 Copyright (c) 2006 - 2007, Intel Corporation
6 All rights reserved. This program and the accompanying materials
7 are licensed and made available under the terms and conditions of the BSD License
8 which accompanies this distribution. The full text of the license may be found at
9 http://opensource.org/licenses/bsd-license.php
11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
17 #include <Protocol/BlockIo.h>
18 #include <Protocol/ComponentName.h>
19 #include <Protocol/DriverBinding.h>
20 #include <Protocol/DiskIo.h>
21 #include <Library/DebugLib.h>
22 #include <Library/UefiDriverEntryPoint.h>
23 #include <Library/UefiLib.h>
24 #include <Library/BaseLib.h>
25 #include <Library/BaseMemoryLib.h>
26 #include <Library/MemoryAllocationLib.h>
27 #include <Library/UefiBootServicesTableLib.h>
30 // Driver Binding Externs
32 extern EFI_DRIVER_BINDING_PROTOCOL gDiskIoDriverBinding
;
33 extern EFI_COMPONENT_NAME_PROTOCOL gDiskIoComponentName
;
37 #define DISK_IO_PRIVATE_DATA_SIGNATURE EFI_SIGNATURE_32 ('d', 's', 'k', 'I')
39 #define DATA_BUFFER_BLOCK_NUM (64)
43 EFI_DISK_IO_PROTOCOL DiskIo
;
44 EFI_BLOCK_IO_PROTOCOL
*BlockIo
;
45 } DISK_IO_PRIVATE_DATA
;
47 #define DISK_IO_PRIVATE_DATA_FROM_THIS(a) CR (a, DISK_IO_PRIVATE_DATA, DiskIo, DISK_IO_PRIVATE_DATA_SIGNATURE)
52 extern EFI_DRIVER_BINDING_PROTOCOL gDiskIoDriverBinding
;
53 extern EFI_COMPONENT_NAME_PROTOCOL gDiskIoComponentName
;
57 // Driver model protocol interface
61 DiskIoDriverBindingSupported (
62 IN EFI_DRIVER_BINDING_PROTOCOL
*This
,
63 IN EFI_HANDLE ControllerHandle
,
64 IN EFI_DEVICE_PATH_PROTOCOL
*RemainingDevicePath
69 DiskIoDriverBindingStart (
70 IN EFI_DRIVER_BINDING_PROTOCOL
*This
,
71 IN EFI_HANDLE ControllerHandle
,
72 IN EFI_DEVICE_PATH_PROTOCOL
*RemainingDevicePath
77 DiskIoDriverBindingStop (
78 IN EFI_DRIVER_BINDING_PROTOCOL
*This
,
79 IN EFI_HANDLE ControllerHandle
,
80 IN UINTN NumberOfChildren
,
81 IN EFI_HANDLE
*ChildHandleBuffer
85 // Disk I/O Protocol Interface
90 IN EFI_DISK_IO_PROTOCOL
*This
,
100 IN EFI_DISK_IO_PROTOCOL
*This
,
108 // EFI Component Name Functions
112 DiskIoComponentNameGetDriverName (
113 IN EFI_COMPONENT_NAME_PROTOCOL
*This
,
115 OUT CHAR16
**DriverName
120 DiskIoComponentNameGetControllerName (
121 IN EFI_COMPONENT_NAME_PROTOCOL
*This
,
122 IN EFI_HANDLE ControllerHandle
,
123 IN EFI_HANDLE ChildHandle OPTIONAL
,
125 OUT CHAR16
**ControllerName