iPXE
edd.h
Go to the documentation of this file.
1#ifndef _IPXE_EDD_H
2#define _IPXE_EDD_H
4/** @file
5 *
6 * Enhanced Disk Drive specification
7 *
8 */
10FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
11FILE_SECBOOT ( PERMITTED );
12
13#include <stdint.h>
14#include <ipxe/interface.h>
16/** An EDD host bus type */
18 /** Type */
20} __attribute__ (( packed ));
21
22/** EDD bus type */
23#define EDD_BUS_TYPE_FIXED( a, b, c, d, ... ) \
24 ( ( (a) << 0 ) | ( (b) << 8 ) | ( (c) << 16 ) | ( (d) << 24 ) )
25#define EDD_BUS_TYPE( ... ) \
26 EDD_BUS_TYPE_FIXED ( __VA_ARGS__, ' ', ' ', ' ', ' ' )
27/** EDD PCI bus type */
28#define EDD_BUS_TYPE_PCI EDD_BUS_TYPE ( 'P', 'C', 'I' )
29/** EDD ISA bus type */
30#define EDD_BUS_TYPE_ISA EDD_BUS_TYPE ( 'I', 'S', 'A' )
31/** EDD PCI-X bus type */
32#define EDD_BUS_TYPE_PCIX EDD_BUS_TYPE ( 'P', 'C', 'I', 'X' )
33/** EDD Infiniband bus type */
34#define EDD_BUS_TYPE_IBND EDD_BUS_TYPE ( 'I', 'B', 'N', 'D' )
35/** EDD PCI Express bus type */
36#define EDD_BUS_TYPE_XPRS EDD_BUS_TYPE ( 'X', 'P', 'R', 'S' )
37/** EDD HyperTransport bus type */
38#define EDD_BUS_TYPE_HTPT EDD_BUS_TYPE ( 'H', 'T', 'P', 'T' )
39
40/** An EDD interface type */
42 /** Type */
44} __attribute__ (( packed ));
45
46/** EDD interface type */
47#define EDD_INTF_TYPE_FIXED( a, b, c, d, e, f, g, h, ... ) \
48 ( ( ( ( uint64_t ) (a) ) << 0 ) | ( ( ( uint64_t ) (b) ) << 8 ) | \
49 ( ( ( uint64_t ) (c) ) << 16 ) | ( ( ( uint64_t ) (d) ) << 24 ) | \
50 ( ( ( uint64_t ) (e) ) << 32 ) | ( ( ( uint64_t ) (f) ) << 40 ) | \
51 ( ( ( uint64_t ) (g) ) << 48 ) | ( ( ( uint64_t ) (h) ) << 56 ) )
52#define EDD_INTF_TYPE( ... ) \
53 EDD_INTF_TYPE_FIXED ( __VA_ARGS__, \
54 ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ' )
55/** EDD ATA interface type */
56#define EDD_INTF_TYPE_ATA EDD_INTF_TYPE ( 'A', 'T', 'A' )
57/** EDD ATAPI interface type */
58#define EDD_INTF_TYPE_ATAPI EDD_INTF_TYPE ( 'A', 'T', 'A', 'P', 'I' )
59/** EDD SCSI interface type */
60#define EDD_INTF_TYPE_SCSI EDD_INTF_TYPE ( 'S', 'C', 'S', 'I' )
61/** EDD USB interface type */
62#define EDD_INTF_TYPE_USB EDD_INTF_TYPE ( 'U', 'S', 'B' )
63/** EDD 1394 interface type */
64#define EDD_INTF_TYPE_1394 EDD_INTF_TYPE ( '1', '3', '9', '4' )
65/** EDD Fibre Channel interface type */
66#define EDD_INTF_TYPE_FIBRE EDD_INTF_TYPE ( 'F', 'I', 'B', 'R', 'E' )
67/** EDD I2O interface type */
68#define EDD_INTF_TYPE_I2O EDD_INTF_TYPE ( 'I', '2', 'O' )
69/** EDD RAID interface type */
70#define EDD_INTF_TYPE_RAID EDD_INTF_TYPE ( 'R', 'A', 'I', 'D' )
71/** EDD SATA interface type */
72#define EDD_INTF_TYPE_SATA EDD_INTF_TYPE ( 'S', 'A', 'T', 'A' )
73/** EDD SAS interface type */
74#define EDD_INTF_TYPE_SAS EDD_INTF_TYPE ( 'S', 'A', 'S' )
75
76/** An EDD interface path */
78 /** Legacy bus type */
79 struct {
80 /** Base address */
82 } __attribute__ (( packed )) legacy;
83 /** PCI, PCI-X, PCI Express, or HyperTransport bus type */
84 struct {
85 /** Bus */
87 /** Slot */
89 /** Function */
91 /** Channel number */
93 } __attribute__ (( packed )) pci;
94 /** Padding */
96} __attribute__ (( packed ));
97
98/** An EDD device path */
100 /** ATA interface type */
101 struct {
102 /** Slave */
104 } __attribute__ (( packed )) ata;
105 /** ATAPI interface type */
106 struct {
107 /** Slave */
109 /** Logical Unit Number */
111 } __attribute__ (( packed )) atapi;
112 /** SCSI interface type */
113 struct {
114 /** SCSI ID */
116 /** Logical Unit Number */
118 } __attribute__ (( packed )) scsi;
119 /** USB interface type */
120 struct {
121 /** Serial number */
123 } __attribute__ (( packed )) usb;
124 /** IEEE1394 interface type */
125 struct {
126 /** GUID */
128 } __attribute__ (( packed )) ieee1394;
129 /** Fibre Channel interface type */
130 struct {
131 /** WWN */
133 /** Logical Unit Number */
135 } __attribute__ (( packed )) fibre;
136 /** I2O interface type */
137 struct {
138 /** Identity tag */
140 } __attribute__ (( packed )) i2o;
141 /** RAID interface type */
142 struct {
143 /** Array number */
145 } __attribute__ (( packed )) raid;
146 /** SATA interface type */
147 struct {
148 /** Port number */
150 /** Port multiplier number */
152 } __attribute__ (( packed )) sata;
153 /** SAS interface type */
154 struct {
155 /** Address */
157 } __attribute__ (( packed )) sas;
158 /** Padding */
160} __attribute__ (( packed ));
161
162/** EDD device path information */
164 /** Key */
166 /** Length of this structure */
168 /** Reserved */
170 /** Host bus type */
172 /** Interface type */
174 /** Interface path */
176 /** Device path */
178 /** Reserved */
180 /** Checksum */
182} __attribute__ (( packed ));
183
184/** EDD device path information key */
185#define EDD_DEVICE_PATH_INFO_KEY 0xbedd
186
187extern int edd_describe ( struct interface *intf,
188 struct edd_interface_type *type,
189 union edd_device_path *path );
190#define edd_describe_TYPE( object_type ) \
191 typeof ( int ( object_type, struct edd_interface_type *type, \
192 union edd_device_path *path ) )
193
194#endif /* _IPXE_EDD_H */
unsigned short uint16_t
Definition stdint.h:11
unsigned int uint32_t
Definition stdint.h:12
unsigned long long uint64_t
Definition stdint.h:13
unsigned char uint8_t
Definition stdint.h:10
int edd_describe(struct interface *intf, struct edd_interface_type *type, union edd_device_path *path)
Describe a disk device using EDD.
Definition edd.c:45
uint8_t slave
Slave.
Definition edd.h:1
uint32_t type
Operating system type.
Definition ena.h:1
#define FILE_LICENCE(_licence)
Declare a particular licence as applying to a file.
Definition compiler.h:896
#define FILE_SECBOOT(_status)
Declare a file's UEFI Secure Boot permission status.
Definition compiler.h:926
#define __attribute__(x)
Definition compiler.h:10
Object interfaces.
EDD device path information.
Definition edd.h:163
struct edd_interface_type interface_type
Interface type.
Definition edd.h:173
union edd_device_path device_path
Device path.
Definition edd.h:177
uint8_t reserved_b
Reserved.
Definition edd.h:179
union edd_interface_path interface_path
Interface path.
Definition edd.h:175
uint8_t checksum
Checksum.
Definition edd.h:181
uint8_t len
Length of this structure.
Definition edd.h:167
uint8_t reserved_a[3]
Reserved.
Definition edd.h:169
struct edd_host_bus_type host_bus_type
Host bus type.
Definition edd.h:171
An EDD host bus type.
Definition edd.h:17
uint32_t type
Type.
Definition edd.h:19
An EDD interface type.
Definition edd.h:41
uint64_t type
Type.
Definition edd.h:43
An object interface.
Definition interface.h:125
An EDD device path.
Definition edd.h:99
uint8_t lun
Logical Unit Number.
Definition edd.h:110
uint8_t slave
Slave.
Definition edd.h:103
uint8_t pad[16]
Padding.
Definition edd.h:159
uint64_t wwn
WWN.
Definition edd.h:132
uint64_t guid
GUID.
Definition edd.h:127
uint32_t array
Array number.
Definition edd.h:144
uint64_t tag
Identity tag.
Definition edd.h:139
uint64_t address
Address.
Definition edd.h:156
uint8_t port
Port number.
Definition edd.h:149
uint8_t multiplier
Port multiplier number.
Definition edd.h:151
uint16_t id
SCSI ID.
Definition edd.h:115
uint64_t serial
Serial number.
Definition edd.h:122
An EDD interface path.
Definition edd.h:77
uint8_t channel
Channel number.
Definition edd.h:92
uint8_t slot
Slot.
Definition edd.h:88
uint8_t function
Function.
Definition edd.h:90
uint8_t pad[8]
Padding.
Definition edd.h:95
uint16_t base
Base address.
Definition edd.h:81
uint8_t bus
Bus.
Definition edd.h:86