From 246ddf5ee4fe0d95f056ad00c670a4a851097418 Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Wed, 19 Nov 2008 21:42:33 +0000 Subject: [aoe] Use an AoE config query to identify the target MAC address The AoE spec does not specify that the source MAC address of a received packet actually matches the MAC address of the AoE target. In principle an AoE server can respond to an AoE request on any interface available to it, which may not be an address configured to accept AoE requests. This issue is resolved by implementing AoE device discovery. The purpose of AoE discovery is to find out which addresses an AoE target can use for requests. An AoE configuration command is sent when the AoE attach is attempted. The AoE target must respond to that configuration query from an interface that can accept requests. Based on a patch from Ryan Thomas --- src/include/gpxe/aoe.h | 33 ++++++++++++++++++++++++++++----- 1 file changed, 28 insertions(+), 5 deletions(-) (limited to 'src/include') diff --git a/src/include/gpxe/aoe.h b/src/include/gpxe/aoe.h index 4aab4291c..6de6b9653 100644 --- a/src/include/gpxe/aoe.h +++ b/src/include/gpxe/aoe.h @@ -13,8 +13,24 @@ #include #include +/** An AoE config command */ +struct aoecfg { + /** AoE Queue depth */ + uint16_t bufcnt; + /** ATA target firmware version */ + uint16_t fwver; + /** ATA target sector count */ + uint8_t scnt; + /** AoE config string subcommand */ + uint8_t aoeccmd; + /** AoE config string length */ + uint16_t cfglen; + /** AoE config string */ + uint8_t data[0]; +} __attribute__ (( packed )); + /** An AoE ATA command */ -struct aoecmd { +struct aoeata { /** AoE command flags */ uint8_t aflags; /** ATA error/feature register */ @@ -37,6 +53,14 @@ struct aoecmd { #define AOE_FL_ASYNC 0x02 /**< Asynchronous write */ #define AOE_FL_WRITE 0x01 /**< Write command */ +/** An AoE command */ +union aoecmd { + /** Config command */ + struct aoecfg cfg; + /** ATA command */ + struct aoeata ata; +}; + /** An AoE header */ struct aoehdr { /** Protocol version number and flags */ @@ -52,10 +76,7 @@ struct aoehdr { /** Tag, in network byte order */ uint32_t tag; /** Payload */ - union { - /** ATA command */ - struct aoecmd command[0]; - } arg; + union aoecmd cmd[0]; } __attribute__ (( packed )); #define AOE_VERSION 0x10 /**< Version 1 */ @@ -99,6 +120,8 @@ struct aoe_session { /** Tag for current AoE command */ uint32_t tag; + /** Current AOE command */ + uint8_t aoe_cmd_type; /** Current ATA command */ struct ata_command *command; /** Overall status of current ATA command */ -- cgit v1.2.3-55-g7522