6 * Enhanced Disk Drive specification
10 FILE_LICENCE ( GPL2_OR_LATER );
13 #include <ipxe/interface.h>
15 /** An EDD host bus type */
16 struct edd_host_bus_type {
19 } __attribute__ (( packed ));
22 #define EDD_BUS_TYPE_FIXED( a, b, c, d, ... ) \
23 ( ( (a) << 0 ) | ( (b) << 8 ) | ( (c) << 16 ) | ( (d) << 24 ) )
24 #define EDD_BUS_TYPE( ... ) \
25 EDD_BUS_TYPE_FIXED ( __VA_ARGS__, ' ', ' ', ' ', ' ' )
26 /** EDD PCI bus type */
27 #define EDD_BUS_TYPE_PCI EDD_BUS_TYPE ( 'P', 'C', 'I' )
28 /** EDD ISA bus type */
29 #define EDD_BUS_TYPE_ISA EDD_BUS_TYPE ( 'I', 'S', 'A' )
30 /** EDD PCI-X bus type */
31 #define EDD_BUS_TYPE_PCIX EDD_BUS_TYPE ( 'P', 'C', 'I', 'X' )
32 /** EDD Infiniband bus type */
33 #define EDD_BUS_TYPE_IBND EDD_BUS_TYPE ( 'I', 'B', 'N', 'D' )
34 /** EDD PCI Express bus type */
35 #define EDD_BUS_TYPE_XPRS EDD_BUS_TYPE ( 'X', 'P', 'R', 'S' )
36 /** EDD HyperTransport bus type */
37 #define EDD_BUS_TYPE_HTPT EDD_BUS_TYPE ( 'H', 'T', 'P', 'T' )
39 /** An EDD interface type */
40 struct edd_interface_type {
43 } __attribute__ (( packed ));
45 /** EDD interface type */
46 #define EDD_INTF_TYPE_FIXED( a, b, c, d, e, f, g, h, ... ) \
47 ( ( ( ( uint64_t ) (a) ) << 0 ) | ( ( ( uint64_t ) (b) ) << 8 ) | \
48 ( ( ( uint64_t ) (c) ) << 16 ) | ( ( ( uint64_t ) (d) ) << 24 ) | \
49 ( ( ( uint64_t ) (e) ) << 32 ) | ( ( ( uint64_t ) (f) ) << 40 ) | \
50 ( ( ( uint64_t ) (g) ) << 48 ) | ( ( ( uint64_t ) (h) ) << 56 ) )
51 #define EDD_INTF_TYPE( ... ) \
52 EDD_INTF_TYPE_FIXED ( __VA_ARGS__, \
53 ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ' )
54 /** EDD ATA interface type */
55 #define EDD_INTF_TYPE_ATA EDD_INTF_TYPE ( 'A', 'T', 'A' )
56 /** EDD ATAPI interface type */
57 #define EDD_INTF_TYPE_ATAPI EDD_INTF_TYPE ( 'A', 'T', 'A', 'P', 'I' )
58 /** EDD SCSI interface type */
59 #define EDD_INTF_TYPE_SCSI EDD_INTF_TYPE ( 'S', 'C', 'S', 'I' )
60 /** EDD USB interface type */
61 #define EDD_INTF_TYPE_USB EDD_INTF_TYPE ( 'U', 'S', 'B' )
62 /** EDD 1394 interface type */
63 #define EDD_INTF_TYPE_1394 EDD_INTF_TYPE ( '1', '3', '9', '4' )
64 /** EDD Fibre Channel interface type */
65 #define EDD_INTF_TYPE_FIBRE EDD_INTF_TYPE ( 'F', 'I', 'B', 'R', 'E' )
66 /** EDD I2O interface type */
67 #define EDD_INTF_TYPE_I2O EDD_INTF_TYPE ( 'I', '2', 'O' )
68 /** EDD RAID interface type */
69 #define EDD_INTF_TYPE_RAID EDD_INTF_TYPE ( 'R', 'A', 'I', 'D' )
70 /** EDD SATA interface type */
71 #define EDD_INTF_TYPE_SATA EDD_INTF_TYPE ( 'S', 'A', 'T', 'A' )
72 /** EDD SAS interface type */
73 #define EDD_INTF_TYPE_SAS EDD_INTF_TYPE ( 'S', 'A', 'S' )
75 /** An EDD interface path */
76 union edd_interface_path {
77 /** Legacy bus type */
81 } __attribute__ (( packed )) legacy;
82 /** PCI, PCI-X, PCI Express, or HyperTransport bus type */
92 } __attribute__ (( packed )) pci;
95 } __attribute__ (( packed ));
97 /** An EDD device path */
98 union edd_device_path {
99 /** ATA interface type */
103 } __attribute__ (( packed )) ata;
104 /** ATAPI interface type */
108 /** Logical Unit Number */
110 } __attribute__ (( packed )) atapi;
111 /** SCSI interface type */
115 /** Logical Unit Number */
117 } __attribute__ (( packed )) scsi;
118 /** USB interface type */
122 } __attribute__ (( packed )) usb;
123 /** IEEE1394 interface type */
127 } __attribute__ (( packed )) ieee1394;
128 /** Fibre Channel interface type */
132 /** Logical Unit Number */
134 } __attribute__ (( packed )) fibre;
135 /** I2O interface type */
139 } __attribute__ (( packed )) i2o;
140 /** RAID interface type */
144 } __attribute__ (( packed )) raid;
145 /** SATA interface type */
149 /** Port multiplier number */
151 } __attribute__ (( packed )) sata;
152 /** SAS interface type */
156 } __attribute__ (( packed )) sas;
159 } __attribute__ (( packed ));
161 /** EDD device path information */
162 struct edd_device_path_information {
165 /** Length of this structure */
168 uint8_t reserved_a[3];
170 struct edd_host_bus_type host_bus_type;
171 /** Interface type */
172 struct edd_interface_type interface_type;
173 /** Interface path */
174 union edd_interface_path interface_path;
176 union edd_device_path device_path;
181 } __attribute__ (( packed ));
183 /** EDD device path information key */
184 #define EDD_DEVICE_PATH_INFO_KEY 0xbedd
186 extern int edd_describe ( struct interface *intf,
187 struct edd_interface_type *type,
188 union edd_device_path *path );
189 #define edd_describe_TYPE( object_type ) \
190 typeof ( int ( object_type, struct edd_interface_type *type, \
191 union edd_device_path *path ) )
193 #endif /* _IPXE_EDD_H */