diff options
author | cinap_lenrek <cinap_lenrek@localhost> | 2011-07-10 14:14:23 +0200 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@localhost> | 2011-07-10 14:14:23 +0200 |
commit | c2fc2fad133d51bc7dc86af015a20aed11a1817f (patch) | |
tree | 8366e17787c48975b1ce1401c731d80763c94629 /sys/src/9/port/aoe.h | |
parent | ae00ac74659e69a1aee9dc3e3ab20d5ec70b8126 (diff) |
merge sd changes from 9atom
Diffstat (limited to 'sys/src/9/port/aoe.h')
-rw-r--r-- | sys/src/9/port/aoe.h | 91 |
1 files changed, 65 insertions, 26 deletions
diff --git a/sys/src/9/port/aoe.h b/sys/src/9/port/aoe.h index 6a8895ccc..3b2723a08 100644 --- a/sys/src/9/port/aoe.h +++ b/sys/src/9/port/aoe.h @@ -1,9 +1,8 @@ -/* - * ATA-over-Ethernet (AoE) protocol - */ enum { ACata, ACconfig, + ACmask, + ACres, }; enum { @@ -15,23 +14,55 @@ enum { }; enum { - AEcmd = 1, - AEarg, - AEdev, - AEcfg, - AEver, + AEunk, + AEcmd, /* bad command */ + AEarg, /* bad argument */ + AEoff, /* device offline */ + AEcfg, /* config string already set */ + AEver, /* unsupported version */ + AEres, /* target reserved */ }; enum { - Aoetype = 0x88a2, - Aoesectsz = 512, /* standard sector size */ - Aoever = 1, + /* mask commands */ + Mread = 0, + Medit, - AFerr = 1<<2, - AFrsp = 1<<3, + /* mask directives */ + MDnop = 0, + MDadd, + MDdel, - AAFwrite= 1, - AAFext = 1<<6, + /* mask errors */ + MEunk = 1, + MEbad, + MEfull, + + /* reserve / release */ + Rrread = 0, + Rrset, + Rrforce, +}; + +enum { + Aoetype = 0x88a2, + Aoesectsz = 512, + Aoemaxcfg = 1024, + + Aoehsz = 24, + Aoeatasz = 12, + Aoecfgsz = 8, + Aoerrsz = 2, + Aoemsz = 4, + Aoemdsz = 8, + + Aoever = 1, + + AFerr = 1<<2, + AFrsp = 1<<3, + + AAFwrite = 1, + AAFext = 1<<6, }; typedef struct { @@ -44,35 +75,43 @@ typedef struct { uchar minor; uchar cmd; uchar tag[4]; - uchar payload[]; } Aoehdr; -#define AOEHDRSZ offsetof(Aoehdr, payload[0]) - typedef struct { - Aoehdr; uchar aflag; uchar errfeat; uchar scnt; uchar cmdstat; uchar lba[6]; uchar res[2]; - uchar payload[]; } Aoeata; -#define AOEATASZ offsetof(Aoeata, payload[0]) - typedef struct { - Aoehdr; uchar bufcnt[2]; uchar fwver[2]; uchar scnt; uchar verccmd; uchar cslen[2]; - uchar payload[]; -} Aoeqc; +} Aoecfg; + +typedef struct { + uchar dres; + uchar dcmd; + uchar ea[Eaddrlen]; +} Aoemd; -#define AOEQCSZ offsetof(Aoeqc, payload[0]) +typedef struct { + uchar mres; + uchar mcmd; + uchar merr; + uchar mcnt; +} Aoem; + +typedef struct { + uchar rcmd; + uchar nea; + uchar ea0[]; +} Aoerr; extern char Echange[]; extern char Enotup[]; |