]>
Commit | Line | Data |
---|---|---|
bcecde14 | 1 | /** @file\r |
2 | Include file to suport EDD 3.0.\r | |
3 | This file is coded to T13 D1386 Revision 3\r | |
4 | Availible on http://www.t13.org/#Project drafts\r | |
5 | Currently at ftp://fission.dt.wdc.com/pub/standards/x3t13/project/d1386r3.pdf\r | |
6 | \r | |
7 | Copyright (c) 1999 - 2010, Intel Corporation. All rights reserved.<BR>\r | |
8 | \r | |
9 | This program and the accompanying materials\r | |
10 | are licensed and made available under the terms and conditions\r | |
11 | of the BSD License which accompanies this distribution. The\r | |
12 | full text of the license may be found at\r | |
13 | http://opensource.org/licenses/bsd-license.php\r | |
14 | \r | |
15 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r | |
16 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
17 | \r | |
18 | **/\r | |
19 | \r | |
20 | #ifndef _EDD_H_\r | |
21 | #define _EDD_H_\r | |
22 | \r | |
23 | //\r | |
24 | // packing with no compiler padding, so that the fields\r | |
25 | // of the following architected structures can be\r | |
26 | // properly accessed from C code.\r | |
27 | //\r | |
28 | #pragma pack(1)\r | |
29 | \r | |
30 | typedef struct {\r | |
31 | UINT8 Bus;\r | |
32 | UINT8 Device;\r | |
33 | UINT8 Function;\r | |
34 | UINT8 Controller;\r | |
35 | UINT32 Reserved;\r | |
36 | } EDD_PCI;\r | |
37 | \r | |
38 | typedef struct {\r | |
39 | UINT16 Base;\r | |
40 | UINT16 Reserved;\r | |
41 | UINT32 Reserved2;\r | |
42 | } EDD_LEGACY;\r | |
43 | \r | |
44 | typedef union {\r | |
45 | EDD_PCI Pci;\r | |
46 | EDD_LEGACY Legacy;\r | |
47 | } EDD_INTERFACE_PATH;\r | |
48 | \r | |
49 | typedef struct {\r | |
50 | UINT8 Master;\r | |
51 | UINT8 Reserved[15];\r | |
52 | } EDD_ATA;\r | |
53 | \r | |
54 | typedef struct {\r | |
55 | UINT8 Master;\r | |
56 | UINT8 Lun;\r | |
57 | UINT8 Reserved[14];\r | |
58 | } EDD_ATAPI;\r | |
59 | \r | |
60 | typedef struct {\r | |
61 | UINT16 Pun;\r | |
62 | UINT64 Lun;\r | |
63 | UINT8 Reserved[6];\r | |
64 | } EDD_SCSI;\r | |
65 | \r | |
66 | typedef struct {\r | |
67 | UINT64 SerialNumber;\r | |
68 | UINT64 Reserved;\r | |
69 | } EDD_USB;\r | |
70 | \r | |
71 | typedef struct {\r | |
72 | UINT64 Guid;\r | |
73 | UINT64 Reserved;\r | |
74 | } EDD_1394;\r | |
75 | \r | |
76 | typedef struct {\r | |
77 | UINT64 Wwn;\r | |
78 | UINT64 Lun;\r | |
79 | } EDD_FIBRE;\r | |
80 | \r | |
81 | typedef union {\r | |
82 | EDD_ATA Ata;\r | |
83 | EDD_ATAPI Atapi;\r | |
84 | EDD_SCSI Scsi;\r | |
85 | EDD_USB Usb;\r | |
86 | EDD_1394 FireWire;\r | |
87 | EDD_FIBRE FibreChannel;\r | |
88 | } EDD_DEVICE_PATH;\r | |
89 | \r | |
90 | typedef struct {\r | |
91 | UINT16 StructureSize;\r | |
92 | UINT16 Flags;\r | |
93 | UINT32 MaxCylinders;\r | |
94 | UINT32 MaxHeads;\r | |
95 | UINT32 SectorsPerTrack;\r | |
96 | UINT64 PhysicalSectors;\r | |
97 | UINT16 BytesPerSector;\r | |
98 | UINT32 Fdpt;\r | |
99 | UINT16 Key;\r | |
100 | UINT8 DevicePathLength;\r | |
101 | UINT8 Reserved1;\r | |
102 | UINT16 Reserved2;\r | |
103 | CHAR8 HostBusType[4];\r | |
104 | CHAR8 InterfaceType[8];\r | |
105 | EDD_INTERFACE_PATH InterfacePath;\r | |
106 | EDD_DEVICE_PATH DevicePath;\r | |
107 | UINT8 Reserved3;\r | |
108 | UINT8 Checksum;\r | |
109 | } EDD_DRIVE_PARAMETERS;\r | |
110 | \r | |
111 | //\r | |
112 | // EDD_DRIVE_PARAMETERS.Flags defines\r | |
113 | //\r | |
114 | #define EDD_GEOMETRY_VALID 0x02\r | |
115 | #define EDD_DEVICE_REMOVABLE 0x04\r | |
116 | #define EDD_WRITE_VERIFY_SUPPORTED 0x08\r | |
117 | #define EDD_DEVICE_CHANGE 0x10\r | |
118 | #define EDD_DEVICE_LOCKABLE 0x20\r | |
119 | \r | |
120 | //\r | |
121 | // BUGBUG: This bit does not follow the spec. It tends to be always set\r | |
122 | // to work properly with Win98.\r | |
123 | //\r | |
124 | #define EDD_DEVICE_GEOMETRY_MAX 0x40\r | |
125 | \r | |
126 | typedef struct {\r | |
127 | UINT8 PacketSizeInBytes; // 0x18\r | |
128 | UINT8 Zero;\r | |
129 | UINT8 NumberOfBlocks; // Max 0x7f\r | |
130 | UINT8 Zero2;\r | |
131 | UINT32 SegOffset;\r | |
132 | UINT64 Lba;\r | |
133 | UINT64 TransferBuffer;\r | |
134 | UINT32 ExtendedBlockCount; // Max 0xffffffff\r | |
135 | UINT32 Zero3;\r | |
136 | } EDD_DEVICE_ADDRESS_PACKET;\r | |
137 | \r | |
138 | #define EDD_VERSION_30 0x30\r | |
139 | \r | |
140 | //\r | |
141 | // Int 13 BIOS Errors\r | |
142 | //\r | |
143 | #define BIOS_PASS 0x00\r | |
144 | #define BIOS_WRITE_PROTECTED 0x03\r | |
145 | #define BIOS_SECTOR_NOT_FOUND 0x04\r | |
146 | #define BIOS_RESET_FAILED 0x05\r | |
147 | #define BIOS_DISK_CHANGED 0x06\r | |
148 | #define BIOS_DRIVE_DOES_NOT_EXIST 0x07\r | |
149 | #define BIOS_DMA_ERROR 0x08\r | |
150 | #define BIOS_DATA_BOUNDRY_ERROR 0x09\r | |
151 | #define BIOS_BAD_SECTOR 0x0a\r | |
152 | #define BIOS_BAD_TRACK 0x0b\r | |
153 | #define BIOS_MEADIA_TYPE_NOT_FOUND 0x0c\r | |
154 | #define BIOS_INVALED_FORMAT 0x0d\r | |
155 | #define BIOS_ECC_ERROR 0x10\r | |
156 | #define BIOS_ECC_CORRECTED_ERROR 0x11\r | |
157 | #define BIOS_HARD_DRIVE_FAILURE 0x20\r | |
158 | #define BIOS_SEEK_FAILED 0x40\r | |
159 | #define BIOS_DRIVE_TIMEOUT 0x80\r | |
160 | #define BIOS_DRIVE_NOT_READY 0xaa\r | |
161 | #define BIOS_UNDEFINED_ERROR 0xbb\r | |
162 | #define BIOS_WRITE_FAULT 0xcc\r | |
163 | #define BIOS_SENSE_FAILED 0xff\r | |
164 | \r | |
165 | #define MAX_EDD11_XFER 0xfe00\r | |
166 | \r | |
167 | #pragma pack()\r | |
168 | //\r | |
169 | // Internal Data Structures\r | |
170 | //\r | |
171 | typedef struct {\r | |
172 | CHAR8 Letter;\r | |
173 | UINT8 Number;\r | |
174 | UINT8 EddVersion;\r | |
175 | BOOLEAN ExtendedInt13;\r | |
176 | BOOLEAN DriveLockingAndEjecting;\r | |
177 | BOOLEAN Edd;\r | |
178 | BOOLEAN Extensions64Bit;\r | |
179 | BOOLEAN ParametersValid;\r | |
180 | UINT8 ErrorCode;\r | |
181 | VOID *FdptPointer;\r | |
182 | BOOLEAN Floppy;\r | |
183 | BOOLEAN AtapiFloppy;\r | |
184 | UINT8 MaxHead;\r | |
185 | UINT8 MaxSector;\r | |
186 | UINT16 MaxCylinder;\r | |
187 | UINT16 Pad;\r | |
188 | EDD_DRIVE_PARAMETERS Parameters;\r | |
189 | } BIOS_LEGACY_DRIVE;\r | |
190 | \r | |
191 | #define BIOS_CONSOLE_BLOCK_IO_DEV_SIGNATURE SIGNATURE_32 ('b', 'b', 'i', 'o')\r | |
192 | typedef struct {\r | |
193 | UINTN Signature;\r | |
194 | \r | |
195 | EFI_HANDLE Handle;\r | |
196 | EFI_HANDLE ControllerHandle;\r | |
197 | EFI_BLOCK_IO_PROTOCOL BlockIo;\r | |
198 | EFI_BLOCK_IO_MEDIA BlockMedia;\r | |
199 | EFI_DEVICE_PATH_PROTOCOL *DevicePath;\r | |
200 | EFI_PCI_IO_PROTOCOL *PciIo;\r | |
201 | EFI_LEGACY_BIOS_PROTOCOL *LegacyBios;\r | |
202 | \r | |
203 | BIOS_LEGACY_DRIVE Bios;\r | |
204 | \r | |
205 | } BIOS_BLOCK_IO_DEV;\r | |
206 | \r | |
207 | #define BIOS_BLOCK_IO_FROM_THIS(a) CR (a, BIOS_BLOCK_IO_DEV, BlockIo, BIOS_CONSOLE_BLOCK_IO_DEV_SIGNATURE)\r | |
208 | \r | |
209 | #endif\r |