|
| FILE_LICENCE (GPL2_OR_LATER_OR_UBDL) |
|
| FEATURE (FEATURE_PROTOCOL, "AoE", DHCP_EB_FEATURE_AOE, 1) |
|
static | LIST_HEAD (aoe_devices) |
| List of all AoE devices. More...
|
|
static | LIST_HEAD (aoe_commands) |
| List of active AoE commands. More...
|
|
static struct aoe_device * | aoedev_get (struct aoe_device *aoedev) |
| Get reference to AoE device. More...
|
|
static void | aoedev_put (struct aoe_device *aoedev) |
| Drop reference to AoE device. More...
|
|
static struct aoe_command * | aoecmd_get (struct aoe_command *aoecmd) |
| Get reference to AoE command. More...
|
|
static void | aoecmd_put (struct aoe_command *aoecmd) |
| Drop reference to AoE command. More...
|
|
static const char * | aoedev_name (struct aoe_device *aoedev) |
| Name AoE device. More...
|
|
static void | aoecmd_free (struct refcnt *refcnt) |
| Free AoE command. More...
|
|
static void | aoecmd_close (struct aoe_command *aoecmd, int rc) |
| Close AoE command. More...
|
|
static int | aoecmd_tx (struct aoe_command *aoecmd) |
| Transmit AoE command request. More...
|
|
static int | aoecmd_rx (struct aoe_command *aoecmd, struct io_buffer *iobuf, const void *ll_source) |
| Receive AoE command response. More...
|
|
static void | aoecmd_expired (struct retry_timer *timer, int fail) |
| Handle AoE retry timer expiry. More...
|
|
static size_t | aoecmd_ata_cmd_len (struct aoe_command *aoecmd) |
| Calculate length of AoE ATA command IU. More...
|
|
static void | aoecmd_ata_cmd (struct aoe_command *aoecmd, void *data, size_t len) |
| Build AoE ATA command IU. More...
|
|
static int | aoecmd_ata_rsp (struct aoe_command *aoecmd, const void *data, size_t len, const void *ll_source __unused) |
| Handle AoE ATA response IU. More...
|
|
static size_t | aoecmd_cfg_cmd_len (struct aoe_command *aoecmd __unused) |
| Calculate length of AoE configuration command IU. More...
|
|
static void | aoecmd_cfg_cmd (struct aoe_command *aoecmd, void *data, size_t len) |
| Build AoE configuration command IU. More...
|
|
static int | aoecmd_cfg_rsp (struct aoe_command *aoecmd, const void *data, size_t len, const void *ll_source) |
| Handle AoE configuration response IU. More...
|
|
static struct aoe_command * | aoecmd_find_tag (uint32_t tag) |
| Identify AoE command by tag. More...
|
|
static int | aoecmd_new_tag (void) |
| Choose an AoE command tag. More...
|
|
static struct aoe_command * | aoecmd_create (struct aoe_device *aoedev, struct aoe_command_type *type) |
| Create AoE command. More...
|
|
static int | aoedev_ata_command (struct aoe_device *aoedev, struct interface *parent, struct ata_cmd *command) |
| Issue AoE ATA command. More...
|
|
static int | aoedev_cfg_command (struct aoe_device *aoedev, struct interface *parent) |
| Issue AoE configuration command. More...
|
|
static void | aoedev_free (struct refcnt *refcnt) |
| Free AoE device. More...
|
|
static void | aoedev_close (struct aoe_device *aoedev, int rc) |
| Close AoE device. More...
|
|
static size_t | aoedev_window (struct aoe_device *aoedev) |
| Check AoE device flow-control window. More...
|
|
static void | aoedev_config_done (struct aoe_device *aoedev, int rc) |
| Handle AoE device configuration completion. More...
|
|
static struct device * | aoedev_identify_device (struct aoe_device *aoedev) |
| Identify device underlying AoE device. More...
|
|
static struct acpi_descriptor * | aoedev_describe (struct aoe_device *aoedev) |
| Get AoE ACPI descriptor. More...
|
|
static int | aoedev_open (struct interface *parent, struct net_device *netdev, unsigned int major, unsigned int minor) |
| Open AoE device. More...
|
|
static int | aoe_rx (struct io_buffer *iobuf, struct net_device *netdev __unused, const void *ll_dest __unused, const void *ll_source, unsigned int flags __unused) |
| Process incoming AoE packets. More...
|
|
static int | aoe_parse_uri (struct uri *uri, unsigned int *major, unsigned int *minor) |
| Parse AoE URI. More...
|
|
static int | aoe_open (struct interface *parent, struct uri *uri) |
| Open AoE URI. More...
|
|
static int | abft_complete (struct acpi_descriptor *desc __unused) |
| Check if AoE boot firmware table descriptor is complete. More...
|
|
static int | abft_install (int(*install)(struct acpi_header *acpi)) |
| Install AoE boot firmware table(s) More...
|
|
AoE protocol.
Definition in file aoe.c.
Transmit AoE command request.
- Parameters
-
- Return values
-
Definition at line 231 of file aoe.c.
268 DBGC ( aoedev,
"AoE %s/%08x could not transmit: %s\n",
struct arbelprm_rc_send_wqe rc
#define iob_put(iobuf, len)
uint16_t major
Major number.
uint16_t major
Major device number, in network byte order.
struct io_buffer * alloc_iob(size_t len)
Allocate I/O buffer.
#define ENOMEM
Not enough space.
assert((readw(&hdr->flags) &(GTF_reading|GTF_writing))==0)
#define AOE_VERSION
Version 1.
static struct net_device * netdev
#define MAX_LL_HEADER_LEN
Maximum length of a link-layer header.
uint8_t minor
Minor device number.
uint8_t target[MAX_LL_ADDR_LEN]
Target MAC address.
char * strerror(int errno)
Retrieve string representation of error number.
static size_t iob_len(struct io_buffer *iobuf)
Calculate length of data in an I/O buffer.
uint32_t tag
Tag, in network byte order.
void start_timer(struct retry_timer *timer)
Start timer.
#define iob_reserve(iobuf, len)
int net_tx(struct io_buffer *iobuf, struct net_device *netdev, struct net_protocol *net_protocol, const void *ll_dest, const void *ll_source)
Transmit network-layer packet.
void * data
Start of data.
uint8_t minor
Minor number.
struct net_device * netdev
Network device.
uint8_t ver_flags
Protocol version number and flags.
uint8_t ll_addr[MAX_LL_ADDR_LEN]
Link-layer address.
#define NULL
NULL pointer (VOID *)
void * memset(void *dest, int character, size_t len) __nonnull
static const char * aoedev_name(struct aoe_device *aoedev)
Name AoE device.
References alloc_iob(), AOE_VERSION, aoedev_name(), assert(), io_buffer::data, DBGC, ENOMEM, htonl, htons, iob_len(), iob_put, iob_reserve, net_device::ll_addr, aoehdr::major, aoe_device::major, MAX_LL_HEADER_LEN, memset(), aoehdr::minor, aoe_device::minor, net_tx(), netdev, aoe_device::netdev, NULL, rc, start_timer(), strerror(), aoehdr::tag, aoe_device::target, and aoehdr::ver_flags.
Referenced by aoecmd_expired(), aoedev_ata_command(), and aoedev_cfg_command().
Build AoE ATA command IU.
- Parameters
-
aoecmd | AoE command |
data | Command IU |
len | Length of command IU |
Definition at line 369 of file aoe.c.
397 DBGC2 ( aoedev,
"AoE %s/%08x ATA cmd %02x:%02x:%02x:%02x:%08llx",
405 DBGC2 ( aoedev,
"\n" );
uint8_t err_feat
ATA error/feature register.
static __always_inline void copy_from_user(void *dest, userptr_t src, off_t src_off, size_t len)
Copy data from user buffer.
uint8_t data[0]
Data payload.
union aoecmd payload[0]
Payload.
#define cpu_to_le64(value)
#define static_assert(x)
Assert a condition at build time.
uint8_t cmd_stat
ATA command/status register.
uint8_t command
Command number.
#define AOE_FL_WRITE
Write command.
assert((readw(&hdr->flags) &(GTF_reading|GTF_writing))==0)
union aoeata::@445 lba
Logical block address, in little-endian order.
An ATA command information unit.
uint8_t aflags
AoE command flags.
uint8_t count
ATA sector count register.
uint8_t data[48]
Additional event data.
struct aoeata ata
ATA command.
#define AOE_CMD_ATA
Issue ATA command.
#define AOE_FL_EXTENDED
LBA48 extended addressing.
#define ATA_DEV_SLAVE
Slave ("device 1") flag in the ATA device register.
#define ATA_DEV_MASK
Mask of non-LBA portion of device register.
#define AOE_FL_DEV_HEAD
Device/head flag.
void * memset(void *dest, int character, size_t len) __nonnull
static const char * aoedev_name(struct aoe_device *aoedev)
Name AoE device.
References aoeata::aflags, AOE_CMD_ATA, AOE_FL_DEV_HEAD, AOE_FL_EXTENDED, AOE_FL_WRITE, aoedev_name(), assert(), aoecmd::ata, ATA_DEV_MASK, ATA_DEV_SLAVE, aoeata::bytes, aoeata::cmd_stat, aoehdr::command, copy_from_user(), aoeata::count, cpu_to_le64, data, aoeata::data, DBGC2, aoeata::err_feat, aoeata::lba, len, memset(), aoehdr::payload, static_assert, and aoeata::u64.
static int aoedev_open |
( |
struct interface * |
parent, |
|
|
struct net_device * |
netdev, |
|
|
unsigned int |
major, |
|
|
unsigned int |
minor |
|
) |
| |
|
static |
Open AoE device.
- Parameters
-
parent | Parent interface |
netdev | Network device |
major | Device major number |
minor | Device minor number |
- Return values
-
Definition at line 811 of file aoe.c.
817 aoedev =
zalloc (
sizeof ( *aoedev ) );
834 DBGC ( aoedev,
"AoE %s could not initiate configuration: %s\n",
842 DBGC ( aoedev,
"AoE %s could not create ATA device: %s\n",
struct arbelprm_rc_send_wqe rc
uint8_t ll_addr_len
Link-layer address length.
static struct interface_descriptor aoedev_config_desc
AoE device configuration interface descriptor.
#define AOE_MAX_COUNT
Maximum number of sectors per packet.
#define ref_init(refcnt, free)
Initialise a reference counter.
uint16_t major
Major number.
const uint8_t * ll_broadcast
Link-layer broadcast address.
#define ENOMEM
Not enough space.
void * memcpy(void *dest, const void *src, size_t len) __nonnull
uint32_t major
Major version.
uint32_t minor
Minor version.
#define ATA_DEV_MASTER
Master ("device 0") flag in the ATA device register.
static struct net_device * netdev
struct acpi_descriptor desc
ACPI descriptor.
static int aoedev_cfg_command(struct aoe_device *aoedev, struct interface *parent)
Issue AoE configuration command.
struct interface ata
ATA command issuing interface.
uint8_t target[MAX_LL_ADDR_LEN]
Target MAC address.
char * strerror(int errno)
Retrieve string representation of error number.
static void aoedev_close(struct aoe_device *aoedev, int rc)
Close AoE device.
void * zalloc(size_t size)
Allocate cleared memory.
struct refcnt refcnt
Reference counter.
struct interface config
Configuration command interface.
static struct net_device * netdev_get(struct net_device *netdev)
Get reference to network device.
uint8_t minor
Minor number.
struct net_device * netdev
Network device.
static void aoedev_free(struct refcnt *refcnt)
Free AoE device.
int ata_open(struct interface *block, struct interface *ata, unsigned int device, unsigned int max_count)
Open ATA device.
static struct interface_descriptor aoedev_ata_desc
AoE device ATA interface descriptor.
static void intf_init(struct interface *intf, struct interface_descriptor *desc, struct refcnt *refcnt)
Initialise an object interface.
struct ll_protocol * ll_protocol
Link-layer protocol.
#define ref_put(refcnt)
Drop reference to object.
static void acpi_init(struct acpi_descriptor *desc, struct acpi_model *model, struct refcnt *refcnt)
Initialise ACPI descriptor.
static const char * aoedev_name(struct aoe_device *aoedev)
Name AoE device.
References acpi_init(), AOE_MAX_COUNT, aoedev_ata_desc, aoedev_cfg_command(), aoedev_close(), aoedev_config_desc, aoedev_free(), aoedev_name(), aoe_device::ata, ATA_DEV_MASTER, ata_open(), aoe_device::config, DBGC, aoe_device::desc, ENOMEM, intf_init(), ll_protocol::ll_addr_len, net_device::ll_broadcast, net_device::ll_protocol, major, aoe_device::major, memcpy(), minor, aoe_device::minor, netdev, aoe_device::netdev, netdev_get(), rc, ref_init, ref_put, aoe_device::refcnt, strerror(), aoe_device::target, and zalloc().
Referenced by aoe_open().
static int aoe_rx |
( |
struct io_buffer * |
iobuf, |
|
|
struct net_device *netdev |
__unused, |
|
|
const void *ll_dest |
__unused, |
|
|
const void * |
ll_source, |
|
|
unsigned int flags |
__unused |
|
) |
| |
|
static |
Process incoming AoE packets.
- Parameters
-
iobuf | I/O buffer |
netdev | Network device |
ll_dest | Link-layer destination address |
ll_source | Link-layer source address |
flags | Packet flags |
- Return values
-
Definition at line 876 of file aoe.c.
887 DBG (
"AoE received underlength packet (%zd bytes)\n",
893 DBG (
"AoE received packet for unsupported protocol version " 899 DBG (
"AoE received request packet\n" );
907 DBG (
"AoE received packet for unused tag %08x\n",
#define EINVAL
Invalid argument.
struct arbelprm_rc_send_wqe rc
static struct aoe_command * aoecmd_find_tag(uint32_t tag)
Identify AoE command by tag.
void free_iob(struct io_buffer *iobuf)
Free I/O buffer.
#define AOE_VERSION_MASK
Version part of ver_flags field.
#define ENOENT
No such file or directory.
#define iob_disown(iobuf)
Disown an I/O buffer.
#define AOE_VERSION
Version 1.
static size_t iob_len(struct io_buffer *iobuf)
Calculate length of data in an I/O buffer.
uint32_t tag
Tag, in network byte order.
#define EOPNOTSUPP
Operation not supported on socket.
static int aoecmd_rx(struct aoe_command *aoecmd, struct io_buffer *iobuf, const void *ll_source)
Receive AoE command response.
#define EPROTONOSUPPORT
Protocol not supported.
void * data
Start of data.
static void aoecmd_put(struct aoe_command *aoecmd)
Drop reference to AoE command.
uint8_t ver_flags
Protocol version number and flags.
#define AOE_FL_RESPONSE
Message is a response.
#define DBG(...)
Print a debugging message.
static struct aoe_command * aoecmd_get(struct aoe_command *aoecmd)
Get reference to AoE command.
References AOE_FL_RESPONSE, AOE_VERSION, AOE_VERSION_MASK, aoecmd_find_tag(), aoecmd_get(), aoecmd_put(), aoecmd_rx(), io_buffer::data, DBG, EINVAL, ENOENT, EOPNOTSUPP, EPROTONOSUPPORT, free_iob(), iob_disown, iob_len(), ntohl, rc, aoehdr::tag, and aoehdr::ver_flags.
Install AoE boot firmware table(s)
- Parameters
-
install | Installation method |
- Return values
-
Definition at line 1045 of file aoe.c.
1053 memset ( &abft, 0,
sizeof ( abft ) );
1055 abft.acpi.length =
cpu_to_le32 (
sizeof ( abft ) );
1056 abft.acpi.revision = 1;
1058 abft.slot = aoedev->
minor;
1060 sizeof ( abft.mac ) );
1063 if ( (
rc = install ( &abft.acpi ) ) != 0 ) {
1064 DBGC ( aoedev,
"AoE %s could not install aBFT: %s\n",
struct arbelprm_rc_send_wqe rc
uint16_t major
Major number.
uint64_t desc
Microcode descriptor list physical address.
void * memcpy(void *dest, const void *src, size_t len) __nonnull
#define list_for_each_entry(pos, head, member)
Iterate over entries in a list.
#define cpu_to_le32(value)
char * strerror(int errno)
Retrieve string representation of error number.
AoE Boot Firmware Table (aBFT)
#define ABFT_SIG
AoE boot firmware table signature.
#define cpu_to_le16(value)
uint8_t minor
Minor number.
struct net_device * netdev
Network device.
uint8_t ll_addr[MAX_LL_ADDR_LEN]
Link-layer address.
void * memset(void *dest, int character, size_t len) __nonnull
static const char * aoedev_name(struct aoe_device *aoedev)
Name AoE device.
References ABFT_SIG, abft_table::acpi, aoedev_name(), cpu_to_le16, cpu_to_le32, DBGC, desc, acpi_header::length, list_for_each_entry, net_device::ll_addr, abft_table::mac, aoe_device::major, memcpy(), memset(), aoe_device::minor, aoe_device::netdev, rc, acpi_header::revision, abft_table::shelf, acpi_header::signature, abft_table::slot, and strerror().