Add back the #ifndef XXX #define XXX for header file.
[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
39da6730 16#ifndef _DISK_IO_H_\r
17#define _DISK_IO_H_\r
18\r
b9575d60
A
19#include <Uefi.h>\r
20#include <Protocol/BlockIo.h>\r
21#include <Protocol/ComponentName.h>\r
22#include <Protocol/DriverBinding.h>\r
23#include <Protocol/DiskIo.h>\r
24#include <Library/DebugLib.h>\r
25#include <Library/UefiDriverEntryPoint.h>\r
26#include <Library/UefiLib.h>\r
27#include <Library/BaseLib.h>\r
28#include <Library/BaseMemoryLib.h>\r
29#include <Library/MemoryAllocationLib.h>\r
30#include <Library/UefiBootServicesTableLib.h>\r
79840ee1 31\r
79840ee1 32\r
33#define DISK_IO_PRIVATE_DATA_SIGNATURE EFI_SIGNATURE_32 ('d', 's', 'k', 'I')\r
34\r
35#define DATA_BUFFER_BLOCK_NUM (64)\r
36\r
37typedef struct {\r
38 UINTN Signature;\r
39 EFI_DISK_IO_PROTOCOL DiskIo;\r
40 EFI_BLOCK_IO_PROTOCOL *BlockIo;\r
41} DISK_IO_PRIVATE_DATA;\r
42\r
43#define DISK_IO_PRIVATE_DATA_FROM_THIS(a) CR (a, DISK_IO_PRIVATE_DATA, DiskIo, DISK_IO_PRIVATE_DATA_SIGNATURE)\r
44\r
45//\r
46// Global Variables\r
47//\r
48extern EFI_DRIVER_BINDING_PROTOCOL gDiskIoDriverBinding;\r
49extern EFI_COMPONENT_NAME_PROTOCOL gDiskIoComponentName;\r
50\r
51//\r
52// Prototypes\r
53// Driver model protocol interface\r
54//\r
55EFI_STATUS\r
56EFIAPI\r
57DiskIoDriverBindingSupported (\r
58 IN EFI_DRIVER_BINDING_PROTOCOL *This,\r
59 IN EFI_HANDLE ControllerHandle,\r
60 IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath\r
61 );\r
62\r
63EFI_STATUS\r
64EFIAPI\r
65DiskIoDriverBindingStart (\r
66 IN EFI_DRIVER_BINDING_PROTOCOL *This,\r
67 IN EFI_HANDLE ControllerHandle,\r
68 IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath\r
69 );\r
70\r
71EFI_STATUS\r
72EFIAPI\r
73DiskIoDriverBindingStop (\r
74 IN EFI_DRIVER_BINDING_PROTOCOL *This,\r
75 IN EFI_HANDLE ControllerHandle,\r
76 IN UINTN NumberOfChildren,\r
77 IN EFI_HANDLE *ChildHandleBuffer\r
78 );\r
79\r
80//\r
81// Disk I/O Protocol Interface\r
82//\r
83EFI_STATUS\r
84EFIAPI\r
85DiskIoReadDisk (\r
86 IN EFI_DISK_IO_PROTOCOL *This,\r
87 IN UINT32 MediaId,\r
88 IN UINT64 Offset,\r
89 IN UINTN BufferSize,\r
90 OUT VOID *Buffer\r
91 );\r
92\r
93EFI_STATUS\r
94EFIAPI\r
95DiskIoWriteDisk (\r
96 IN EFI_DISK_IO_PROTOCOL *This,\r
97 IN UINT32 MediaId,\r
98 IN UINT64 Offset,\r
99 IN UINTN BufferSize,\r
100 IN VOID *Buffer\r
101 );\r
102\r
103//\r
104// EFI Component Name Functions\r
105//\r
106EFI_STATUS\r
107EFIAPI\r
108DiskIoComponentNameGetDriverName (\r
109 IN EFI_COMPONENT_NAME_PROTOCOL *This,\r
110 IN CHAR8 *Language,\r
111 OUT CHAR16 **DriverName\r
112 );\r
113\r
114EFI_STATUS\r
115EFIAPI\r
116DiskIoComponentNameGetControllerName (\r
117 IN EFI_COMPONENT_NAME_PROTOCOL *This,\r
118 IN EFI_HANDLE ControllerHandle,\r
119 IN EFI_HANDLE ChildHandle OPTIONAL,\r
120 IN CHAR8 *Language,\r
121 OUT CHAR16 **ControllerName\r
122 );\r
123\r
39da6730 124#endif\r