Clear up to remove the duplicate driver binding externs in the same header file when...
[mirror_edk2.git] / MdeModulePkg / Universal / Disk / DiskIo / Dxe / DiskIo.h
CommitLineData
b9575d60
A
1/** @file\r
2 DiskIo driver that layers it's self on every Block IO protocol in the system.\r
3 DiskIo converts a block oriented device to a byte oriented device.\r
4\r
5 Copyright (c) 2006 - 2007, Intel Corporation \r
6 All rights reserved. This program and the accompanying materials \r
7 are licensed and made available under the terms and conditions of the BSD License \r
8 which accompanies this distribution. The full text of the license may be found at \r
9 http://opensource.org/licenses/bsd-license.php \r
10\r
11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
13\r
14**/\r
15\r
16#include <Uefi.h>\r
17#include <Protocol/BlockIo.h>\r
18#include <Protocol/ComponentName.h>\r
19#include <Protocol/DriverBinding.h>\r
20#include <Protocol/DiskIo.h>\r
21#include <Library/DebugLib.h>\r
22#include <Library/UefiDriverEntryPoint.h>\r
23#include <Library/UefiLib.h>\r
24#include <Library/BaseLib.h>\r
25#include <Library/BaseMemoryLib.h>\r
26#include <Library/MemoryAllocationLib.h>\r
27#include <Library/UefiBootServicesTableLib.h>\r
79840ee1 28\r
79840ee1 29\r
30#define DISK_IO_PRIVATE_DATA_SIGNATURE EFI_SIGNATURE_32 ('d', 's', 'k', 'I')\r
31\r
32#define DATA_BUFFER_BLOCK_NUM (64)\r
33\r
34typedef struct {\r
35 UINTN Signature;\r
36 EFI_DISK_IO_PROTOCOL DiskIo;\r
37 EFI_BLOCK_IO_PROTOCOL *BlockIo;\r
38} DISK_IO_PRIVATE_DATA;\r
39\r
40#define DISK_IO_PRIVATE_DATA_FROM_THIS(a) CR (a, DISK_IO_PRIVATE_DATA, DiskIo, DISK_IO_PRIVATE_DATA_SIGNATURE)\r
41\r
42//\r
43// Global Variables\r
44//\r
45extern EFI_DRIVER_BINDING_PROTOCOL gDiskIoDriverBinding;\r
46extern EFI_COMPONENT_NAME_PROTOCOL gDiskIoComponentName;\r
47\r
48//\r
49// Prototypes\r
50// Driver model protocol interface\r
51//\r
52EFI_STATUS\r
53EFIAPI\r
54DiskIoDriverBindingSupported (\r
55 IN EFI_DRIVER_BINDING_PROTOCOL *This,\r
56 IN EFI_HANDLE ControllerHandle,\r
57 IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath\r
58 );\r
59\r
60EFI_STATUS\r
61EFIAPI\r
62DiskIoDriverBindingStart (\r
63 IN EFI_DRIVER_BINDING_PROTOCOL *This,\r
64 IN EFI_HANDLE ControllerHandle,\r
65 IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath\r
66 );\r
67\r
68EFI_STATUS\r
69EFIAPI\r
70DiskIoDriverBindingStop (\r
71 IN EFI_DRIVER_BINDING_PROTOCOL *This,\r
72 IN EFI_HANDLE ControllerHandle,\r
73 IN UINTN NumberOfChildren,\r
74 IN EFI_HANDLE *ChildHandleBuffer\r
75 );\r
76\r
77//\r
78// Disk I/O Protocol Interface\r
79//\r
80EFI_STATUS\r
81EFIAPI\r
82DiskIoReadDisk (\r
83 IN EFI_DISK_IO_PROTOCOL *This,\r
84 IN UINT32 MediaId,\r
85 IN UINT64 Offset,\r
86 IN UINTN BufferSize,\r
87 OUT VOID *Buffer\r
88 );\r
89\r
90EFI_STATUS\r
91EFIAPI\r
92DiskIoWriteDisk (\r
93 IN EFI_DISK_IO_PROTOCOL *This,\r
94 IN UINT32 MediaId,\r
95 IN UINT64 Offset,\r
96 IN UINTN BufferSize,\r
97 IN VOID *Buffer\r
98 );\r
99\r
100//\r
101// EFI Component Name Functions\r
102//\r
103EFI_STATUS\r
104EFIAPI\r
105DiskIoComponentNameGetDriverName (\r
106 IN EFI_COMPONENT_NAME_PROTOCOL *This,\r
107 IN CHAR8 *Language,\r
108 OUT CHAR16 **DriverName\r
109 );\r
110\r
111EFI_STATUS\r
112EFIAPI\r
113DiskIoComponentNameGetControllerName (\r
114 IN EFI_COMPONENT_NAME_PROTOCOL *This,\r
115 IN EFI_HANDLE ControllerHandle,\r
116 IN EFI_HANDLE ChildHandle OPTIONAL,\r
117 IN CHAR8 *Language,\r
118 OUT CHAR16 **ControllerName\r
119 );\r
120\r