iPXE
aoe.h
Go to the documentation of this file.
1 #ifndef _IPXE_AOE_H
2 #define _IPXE_AOE_H
3 
4 /** @file
5  *
6  * AoE protocol
7  *
8  */
9 
10 FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
11 
12 #include <stdint.h>
13 #include <ipxe/list.h>
14 #include <ipxe/if_ether.h>
15 #include <ipxe/retry.h>
16 #include <ipxe/ata.h>
17 #include <ipxe/acpi.h>
18 
19 /** An AoE config command */
20 struct aoecfg {
21  /** AoE queue depth */
23  /** ATA target firmware version */
25  /** ATA target sector count */
27  /** AoE config string subcommand */
29  /** AoE config string length */
31  /** AoE config string */
33 } __attribute__ (( packed ));
34 
35 /** An AoE ATA command */
36 struct aoeata {
37  /** AoE command flags */
39  /** ATA error/feature register */
41  /** ATA sector count register */
43  /** ATA command/status register */
45  /** Logical block address, in little-endian order */
46  union {
49  } lba;
50  /** Data payload */
52 } __attribute__ (( packed ));
53 
54 #define AOE_FL_EXTENDED 0x40 /**< LBA48 extended addressing */
55 #define AOE_FL_DEV_HEAD 0x10 /**< Device/head flag */
56 #define AOE_FL_ASYNC 0x02 /**< Asynchronous write */
57 #define AOE_FL_WRITE 0x01 /**< Write command */
58 
59 /** An AoE command */
60 union aoecmd {
61  /** Config command */
62  struct aoecfg cfg;
63  /** ATA command */
64  struct aoeata ata;
65 };
66 
67 /** An AoE header */
68 struct aoehdr {
69  /** Protocol version number and flags */
71  /** Error code */
73  /** Major device number, in network byte order */
75  /** Minor device number */
77  /** Command number */
79  /** Tag, in network byte order */
81  /** Payload */
82  union aoecmd payload[0];
83 } __attribute__ (( packed ));
84 
85 #define AOE_VERSION 0x10 /**< Version 1 */
86 #define AOE_VERSION_MASK 0xf0 /**< Version part of ver_flags field */
87 
88 #define AOE_FL_RESPONSE 0x08 /**< Message is a response */
89 #define AOE_FL_ERROR 0x04 /**< Command generated an error */
90 
91 #define AOE_MAJOR_BROADCAST 0xffff
92 #define AOE_MINOR_BROADCAST 0xff
93 
94 #define AOE_CMD_ATA 0x00 /**< Issue ATA command */
95 #define AOE_CMD_CONFIG 0x01 /**< Query Config Information */
96 
97 #define AOE_ERR_BAD_COMMAND 1 /**< Unrecognised command code */
98 #define AOE_ERR_BAD_PARAMETER 2 /**< Bad argument parameter */
99 #define AOE_ERR_UNAVAILABLE 3 /**< Device unavailable */
100 #define AOE_ERR_CONFIG_EXISTS 4 /**< Config string present */
101 #define AOE_ERR_BAD_VERSION 5 /**< Unsupported version */
102 
103 #define AOE_STATUS_ERR_MASK 0x0f /**< Error portion of status code */
104 #define AOE_STATUS_PENDING 0x80 /**< Command pending */
105 
106 /** AoE tag magic marker */
107 #define AOE_TAG_MAGIC 0x18ae0000
108 
109 /** Maximum number of sectors per packet */
110 #define AOE_MAX_COUNT 2
111 
112 /** AoE boot firmware table signature */
113 #define ABFT_SIG ACPI_SIGNATURE ( 'a', 'B', 'F', 'T' )
114 
115 /**
116  * AoE Boot Firmware Table (aBFT)
117  */
118 struct abft_table {
119  /** ACPI header */
121  /** AoE shelf */
123  /** AoE slot */
125  /** Reserved */
127  /** MAC address */
129 } __attribute__ (( packed ));
130 
131 #endif /* _IPXE_AOE_H */
#define __attribute__(x)
Definition: compiler.h:10
struct aoecfg cfg
Config command.
Definition: aoe.h:62
unsigned short uint16_t
Definition: stdint.h:11
struct acpi_header acpi
ACPI header.
Definition: aoe.h:120
uint8_t err_feat
ATA error/feature register.
Definition: aoe.h:40
An AoE ATA command.
Definition: aoe.h:36
uint8_t bytes[6]
Definition: aoe.h:48
Retry timers.
uint8_t data[0]
AoE config string.
Definition: aoe.h:32
uint8_t data[0]
Data payload.
Definition: aoe.h:51
union aoecmd payload[0]
Payload.
Definition: aoe.h:82
uint16_t major
Major device number, in network byte order.
Definition: aoe.h:74
unsigned long long uint64_t
Definition: stdint.h:13
uint16_t fwver
ATA target firmware version.
Definition: aoe.h:24
uint8_t reserved_a
Reserved.
Definition: aoe.h:126
uint8_t aoeccmd
AoE config string subcommand.
Definition: aoe.h:28
uint8_t cmd_stat
ATA command/status register.
Definition: aoe.h:44
uint8_t command
Command number.
Definition: aoe.h:78
uint8_t mac[ETH_ALEN]
MAC address.
Definition: aoe.h:128
uint8_t minor
Minor device number.
Definition: aoe.h:76
uint8_t slot
AoE slot.
Definition: aoe.h:124
An AoE command.
Definition: aoe.h:60
Linked lists.
ACPI data structures.
An AoE config command.
Definition: aoe.h:20
union aoeata::@430 lba
Logical block address, in little-endian order.
uint32_t tag
Tag, in network byte order.
Definition: aoe.h:80
uint16_t bufcnt
AoE queue depth.
Definition: aoe.h:22
unsigned char uint8_t
Definition: stdint.h:10
uint8_t aflags
AoE command flags.
Definition: aoe.h:38
AoE Boot Firmware Table (aBFT)
Definition: aoe.h:118
ATA devices.
#define ETH_ALEN
Definition: if_ether.h:8
An ACPI description header.
Definition: acpi.h:28
unsigned int uint32_t
Definition: stdint.h:12
uint64_t u64
Definition: aoe.h:47
uint8_t count
ATA sector count register.
Definition: aoe.h:42
FILE_LICENCE(GPL2_OR_LATER_OR_UBDL)
uint8_t error
Error code.
Definition: aoe.h:72
uint8_t ver_flags
Protocol version number and flags.
Definition: aoe.h:70
uint16_t cfglen
AoE config string length.
Definition: aoe.h:30
uint8_t scnt
ATA target sector count.
Definition: aoe.h:26
struct aoeata ata
ATA command.
Definition: aoe.h:64
An AoE header.
Definition: aoe.h:68
uint16_t shelf
AoE shelf.
Definition: aoe.h:122