aoe.h File Reference

AoE protocol. More...

#include <stdint.h>
#include <gpxe/list.h>
#include <gpxe/if_ether.h>
#include <gpxe/retry.h>
#include <gpxe/ata.h>

Go to the source code of this file.

Data Structures

struct  aoecfg
 An AoE config command. More...
struct  aoeata
 An AoE ATA command. More...
union  aoecmd
 An AoE command. More...
struct  aoehdr
 An AoE header. More...
struct  aoe_session
 An AoE session. More...

Defines

#define AOE_FL_EXTENDED   0x40
 LBA48 extended addressing.
#define AOE_FL_DEV_HEAD   0x10
 Device/head flag.
#define AOE_FL_ASYNC   0x02
 Asynchronous write.
#define AOE_FL_WRITE   0x01
 Write command.
#define AOE_VERSION   0x10
 Version 1.
#define AOE_VERSION_MASK   0xf0
 Version part of ver_flags field.
#define AOE_FL_RESPONSE   0x08
 Message is a response.
#define AOE_FL_ERROR   0x04
 Command generated an error.
#define AOE_MAJOR_BROADCAST   0xffff
#define AOE_MINOR_BROADCAST   0xff
#define AOE_CMD_ATA   0x00
 Issue ATA command.
#define AOE_CMD_CONFIG   0x01
 Query Config Information.
#define AOE_TAG_MAGIC   0xebeb0000
#define AOE_ERR_BAD_COMMAND   1
 Unrecognised command code.
#define AOE_ERR_BAD_PARAMETER   2
 Bad argument parameter.
#define AOE_ERR_UNAVAILABLE   3
 Device unavailable.
#define AOE_ERR_CONFIG_EXISTS   4
 Config string present.
#define AOE_ERR_BAD_VERSION   5
 Unsupported version.
#define AOE_STATUS_ERR_MASK   0x0f
 Error portion of status code.
#define AOE_STATUS_PENDING   0x80
 Command pending.
#define AOE_MAX_COUNT   2
 Maximum number of sectors per packet.

Functions

 FILE_LICENCE (GPL2_OR_LATER)
void aoe_detach (struct ata_device *ata)
int aoe_attach (struct ata_device *ata, struct net_device *netdev, const char *root_path)

Variables

struct aoecfg packed
 An AoE config command.


Detailed Description

AoE protocol.

Definition in file aoe.h.


Define Documentation

#define AOE_FL_EXTENDED   0x40

LBA48 extended addressing.

Definition at line 53 of file aoe.h.

Referenced by aoe_send_command().

#define AOE_FL_DEV_HEAD   0x10

Device/head flag.

Definition at line 54 of file aoe.h.

Referenced by aoe_send_command().

#define AOE_FL_ASYNC   0x02

Asynchronous write.

Definition at line 55 of file aoe.h.

#define AOE_FL_WRITE   0x01

Write command.

Definition at line 56 of file aoe.h.

Referenced by aoe_send_command().

#define AOE_VERSION   0x10

Version 1.

Definition at line 84 of file aoe.h.

Referenced by aoe_rx(), and aoe_send_command().

#define AOE_VERSION_MASK   0xf0

Version part of ver_flags field.

Definition at line 85 of file aoe.h.

Referenced by aoe_rx().

#define AOE_FL_RESPONSE   0x08

Message is a response.

Definition at line 87 of file aoe.h.

Referenced by aoe_rx().

#define AOE_FL_ERROR   0x04

Command generated an error.

Definition at line 88 of file aoe.h.

Referenced by aoe_rx().

#define AOE_MAJOR_BROADCAST   0xffff

Definition at line 90 of file aoe.h.

#define AOE_MINOR_BROADCAST   0xff

Definition at line 91 of file aoe.h.

#define AOE_CMD_ATA   0x00

Issue ATA command.

Definition at line 93 of file aoe.h.

Referenced by aoe_command(), aoe_rx(), and aoe_send_command().

#define AOE_CMD_CONFIG   0x01

Query Config Information.

Definition at line 94 of file aoe.h.

Referenced by aoe_discover(), aoe_rx(), and aoe_send_command().

#define AOE_TAG_MAGIC   0xebeb0000

Definition at line 96 of file aoe.h.

Referenced by aoe_attach().

#define AOE_ERR_BAD_COMMAND   1

Unrecognised command code.

Definition at line 98 of file aoe.h.

#define AOE_ERR_BAD_PARAMETER   2

Bad argument parameter.

Definition at line 99 of file aoe.h.

#define AOE_ERR_UNAVAILABLE   3

Device unavailable.

Definition at line 100 of file aoe.h.

#define AOE_ERR_CONFIG_EXISTS   4

Config string present.

Definition at line 101 of file aoe.h.

#define AOE_ERR_BAD_VERSION   5

Unsupported version.

Definition at line 102 of file aoe.h.

#define AOE_STATUS_ERR_MASK   0x0f

Error portion of status code.

Definition at line 140 of file aoe.h.

#define AOE_STATUS_PENDING   0x80

Command pending.

Definition at line 141 of file aoe.h.

#define AOE_MAX_COUNT   2

Maximum number of sectors per packet.

Definition at line 144 of file aoe.h.

Referenced by aoe_rx_ata(), and aoe_send_command().


Function Documentation

FILE_LICENCE ( GPL2_OR_LATER   ) 

void aoe_detach ( struct ata_device ata  ) 

Definition at line 399 of file aoe.c.

References aoe_detached_command(), ata_device::backend, ata_device::command, container_of, aoe_session::list, list_del, NULL, ref_put(), stop_timer(), and aoe_session::timer.

Referenced by aoeboot().

00399                                            {
00400         struct aoe_session *aoe =
00401                 container_of ( ata->backend, struct aoe_session, refcnt );
00402 
00403         stop_timer ( &aoe->timer );
00404         ata->command = aoe_detached_command;
00405         list_del ( &aoe->list );
00406         ref_put ( ata->backend );
00407         ata->backend = NULL;
00408 }

int aoe_attach ( struct ata_device ata,
struct net_device netdev,
const char *  root_path 
)

Definition at line 432 of file aoe.c.

References aoe_command(), aoe_discover(), aoe_free(), aoe_parse_root_path(), AOE_TAG_MAGIC, aoe_timer_expired(), ata_device::backend, ata_device::command, ENOMEM, retry_timer::expired, refcnt::free, aoe_session::list, list_add, net_device::ll_broadcast, memcpy, aoe_session::netdev, netdev_get(), aoe_session::rc, ref_get(), ref_put(), aoe_session::refcnt, aoe_session::tag, aoe_session::target, aoe_session::timer, and zalloc().

Referenced by aoeboot().

00433                                          {
00434         struct aoe_session *aoe;
00435         int rc;
00436 
00437         /* Allocate and initialise structure */
00438         aoe = zalloc ( sizeof ( *aoe ) );
00439         if ( ! aoe )
00440                 return -ENOMEM;
00441         aoe->refcnt.free = aoe_free;
00442         aoe->netdev = netdev_get ( netdev );
00443         memcpy ( aoe->target, netdev->ll_broadcast, sizeof ( aoe->target ) );
00444         aoe->tag = AOE_TAG_MAGIC;
00445         aoe->timer.expired = aoe_timer_expired;
00446 
00447         /* Parse root path */
00448         if ( ( rc = aoe_parse_root_path ( aoe, root_path ) ) != 0 )
00449                 goto err;
00450 
00451         /* Attach parent interface, transfer reference to connection
00452          * list, and return
00453          */
00454         ata->backend = ref_get ( &aoe->refcnt );
00455         ata->command = aoe_command;
00456         list_add ( &aoe->list, &aoe_sessions );
00457 
00458         /* Send discovery packet to find the target MAC address.
00459          * Ideally, this ought to be done asynchronously, but the
00460          * block device interface does not yet support asynchronous
00461          * operation.
00462          */
00463         if ( ( rc = aoe_discover( aoe ) ) != 0 )
00464                goto err;
00465 
00466         return 0;
00467 
00468  err:
00469         ref_put ( &aoe->refcnt );
00470         return rc;
00471 }


Variable Documentation

struct aoehdr packed

An AoE config command.

An AoE header.

An AoE ATA command.


Generated on Tue Apr 6 20:01:48 2010 for gPXE by  doxygen 1.5.7.1