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
10FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
11FILE_SECBOOT ( PERMITTED );
12
13#include <stdint.h>
14#include <ipxe/list.h>
15#include <ipxe/if_ether.h>
16#include <ipxe/retry.h>
17#include <ipxe/ata.h>
18#include <ipxe/acpi.h>
19#include <ipxe/netdevice.h>
20#include <ipxe/interface.h>
21
22/** An AoE config command */
23struct aoecfg {
24 /** AoE queue depth */
26 /** ATA target firmware version */
28 /** ATA target sector count */
30 /** AoE config string subcommand */
32 /** AoE config string length */
34 /** AoE config string */
36} __attribute__ (( packed ));
37
38/** An AoE ATA command */
39struct aoeata {
40 /** AoE command flags */
42 /** ATA error/feature register */
44 /** ATA sector count register */
46 /** ATA command/status register */
48 /** Logical block address, in little-endian order */
49 union {
52 } lba;
53 /** Data payload */
55} __attribute__ (( packed ));
56
57#define AOE_FL_EXTENDED 0x40 /**< LBA48 extended addressing */
58#define AOE_FL_DEV_HEAD 0x10 /**< Device/head flag */
59#define AOE_FL_ASYNC 0x02 /**< Asynchronous write */
60#define AOE_FL_WRITE 0x01 /**< Write command */
61
62/** An AoE command */
63union aoecmd {
64 /** Config command */
65 struct aoecfg cfg;
66 /** ATA command */
67 struct aoeata ata;
68};
69
70/** An AoE header */
71struct aoehdr {
72 /** Protocol version number and flags */
74 /** Error code */
76 /** Major device number, in network byte order */
78 /** Minor device number */
80 /** Command number */
82 /** Tag, in network byte order */
84 /** Payload */
85 union aoecmd payload[0];
86} __attribute__ (( packed ));
87
88#define AOE_VERSION 0x10 /**< Version 1 */
89#define AOE_VERSION_MASK 0xf0 /**< Version part of ver_flags field */
90
91#define AOE_FL_RESPONSE 0x08 /**< Message is a response */
92#define AOE_FL_ERROR 0x04 /**< Command generated an error */
93
94#define AOE_MAJOR_BROADCAST 0xffff
95#define AOE_MINOR_BROADCAST 0xff
96
97#define AOE_CMD_ATA 0x00 /**< Issue ATA command */
98#define AOE_CMD_CONFIG 0x01 /**< Query Config Information */
99
100#define AOE_ERR_BAD_COMMAND 1 /**< Unrecognised command code */
101#define AOE_ERR_BAD_PARAMETER 2 /**< Bad argument parameter */
102#define AOE_ERR_UNAVAILABLE 3 /**< Device unavailable */
103#define AOE_ERR_CONFIG_EXISTS 4 /**< Config string present */
104#define AOE_ERR_BAD_VERSION 5 /**< Unsupported version */
105
106#define AOE_STATUS_ERR_MASK 0x0f /**< Error portion of status code */
107#define AOE_STATUS_PENDING 0x80 /**< Command pending */
108
109/** AoE tag magic marker */
110#define AOE_TAG_MAGIC 0x18ae0000
111
112/** Maximum number of sectors per packet */
113#define AOE_MAX_COUNT 2
114
115/** An AoE device */
117 /** Reference counter */
119
120 /** Network device */
122 /** ATA command issuing interface */
124
125 /** Major number */
127 /** Minor number */
129 /** Target MAC address */
131
132 /** Saved timeout value */
133 unsigned long timeout;
134
135 /** Configuration command interface */
137 /** Device is configued */
139
140 /** ACPI descriptor */
142};
143
144/** AoE boot firmware table signature */
145#define ABFT_SIG ACPI_SIGNATURE ( 'a', 'B', 'F', 'T' )
146
147/**
148 * AoE Boot Firmware Table (aBFT)
149 */
151 /** ACPI header */
153 /** AoE shelf */
155 /** AoE slot */
157 /** Reserved */
159 /** MAC address */
161} __attribute__ (( packed ));
162
163#endif /* _IPXE_AOE_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
ATA devices.
uint64_t lba
Starting block number.
Definition int13.h:11
#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 ETH_ALEN
Definition if_ether.h:9
#define __attribute__(x)
Definition compiler.h:10
ACPI data structures.
Object interfaces.
Linked lists.
Network device management.
#define MAX_LL_ADDR_LEN
Maximum length of a link-layer address.
Definition netdevice.h:37
Retry timers.
AoE Boot Firmware Table (aBFT)
Definition aoe.h:150
uint8_t slot
AoE slot.
Definition aoe.h:156
uint8_t mac[ETH_ALEN]
MAC address.
Definition aoe.h:160
uint16_t shelf
AoE shelf.
Definition aoe.h:154
struct acpi_header acpi
ACPI header.
Definition aoe.h:152
uint8_t reserved_a
Reserved.
Definition aoe.h:158
An ACPI descriptor (used to construct ACPI tables)
Definition acpi.h:295
An ACPI description header.
Definition acpi.h:180
An AoE device.
Definition aoe.h:116
struct acpi_descriptor desc
ACPI descriptor.
Definition aoe.h:141
uint8_t minor
Minor number.
Definition aoe.h:128
struct interface ata
ATA command issuing interface.
Definition aoe.h:123
uint8_t target[MAX_LL_ADDR_LEN]
Target MAC address.
Definition aoe.h:130
int configured
Device is configued.
Definition aoe.h:138
struct refcnt refcnt
Reference counter.
Definition aoe.h:118
struct net_device * netdev
Network device.
Definition aoe.h:121
uint16_t major
Major number.
Definition aoe.h:126
struct interface config
Configuration command interface.
Definition aoe.h:136
unsigned long timeout
Saved timeout value.
Definition aoe.h:133
An AoE ATA command.
Definition aoe.h:39
uint8_t cmd_stat
ATA command/status register.
Definition aoe.h:47
uint8_t bytes[6]
Definition aoe.h:51
uint8_t data[0]
Data payload.
Definition aoe.h:54
uint8_t count
ATA sector count register.
Definition aoe.h:45
uint8_t aflags
AoE command flags.
Definition aoe.h:41
uint64_t u64
Definition aoe.h:50
uint8_t err_feat
ATA error/feature register.
Definition aoe.h:43
An AoE config command.
Definition aoe.h:23
uint8_t data[0]
AoE config string.
Definition aoe.h:35
uint8_t aoeccmd
AoE config string subcommand.
Definition aoe.h:31
uint8_t scnt
ATA target sector count.
Definition aoe.h:29
uint16_t cfglen
AoE config string length.
Definition aoe.h:33
uint16_t bufcnt
AoE queue depth.
Definition aoe.h:25
uint16_t fwver
ATA target firmware version.
Definition aoe.h:27
An AoE header.
Definition aoe.h:71
uint16_t major
Major device number, in network byte order.
Definition aoe.h:77
uint8_t command
Command number.
Definition aoe.h:81
union aoecmd payload[0]
Payload.
Definition aoe.h:85
uint32_t tag
Tag, in network byte order.
Definition aoe.h:83
uint8_t ver_flags
Protocol version number and flags.
Definition aoe.h:73
uint8_t minor
Minor device number.
Definition aoe.h:79
uint8_t error
Error code.
Definition aoe.h:75
An object interface.
Definition interface.h:125
A network device.
Definition netdevice.h:353
An AoE command.
Definition aoe.h:63
struct aoeata ata
ATA command.
Definition aoe.h:67
struct aoecfg cfg
Config command.
Definition aoe.h:65