aoe.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. /*
  2. * This file is part of the UCB release of Plan 9. It is subject to the license
  3. * terms in the LICENSE file found in the top-level directory of this
  4. * distribution and at http://akaros.cs.berkeley.edu/files/Plan9License. No
  5. * part of the UCB release of Plan 9, including this file, may be copied,
  6. * modified, propagated, or distributed except according to the terms contained
  7. * in the LICENSE file.
  8. */
  9. /*
  10. * ATA-over-Ethernet (AoE) protocol
  11. */
  12. enum {
  13. ACata,
  14. ACconfig,
  15. };
  16. enum {
  17. AQCread,
  18. AQCtest,
  19. AQCprefix,
  20. AQCset,
  21. AQCfset,
  22. };
  23. enum {
  24. AEcmd = 1,
  25. AEarg,
  26. AEdev,
  27. AEcfg,
  28. AEver,
  29. };
  30. enum {
  31. Aoetype = 0x88a2,
  32. Aoesectsz = 512, /* standard sector size */
  33. Aoever = 1,
  34. AFerr = 1<<2,
  35. AFrsp = 1<<3,
  36. AAFwrite= 1,
  37. AAFext = 1<<6,
  38. };
  39. typedef struct {
  40. uint8_t dst[Eaddrlen];
  41. uint8_t src[Eaddrlen];
  42. uint8_t type[2];
  43. uint8_t verflag;
  44. uint8_t error;
  45. uint8_t major[2];
  46. uint8_t minor;
  47. uint8_t cmd;
  48. uint8_t tag[4];
  49. uint8_t payload[];
  50. } Aoehdr;
  51. #define AOEHDRSZ offsetof(Aoehdr, payload[0])
  52. typedef struct {
  53. Aoehdr;
  54. uint8_t aflag;
  55. uint8_t errfeat;
  56. uint8_t scnt;
  57. uint8_t cmdstat;
  58. uint8_t lba[6];
  59. uint8_t res[2];
  60. uint8_t _payload[];
  61. } Aoeata;
  62. #define AOEATASZ offsetof(Aoeata, payload[0])
  63. typedef struct {
  64. Aoehdr;
  65. uint8_t bufcnt[2];
  66. uint8_t fwver[2];
  67. uint8_t scnt;
  68. uint8_t verccmd;
  69. uint8_t cslen[2];
  70. uint8_t payload[];
  71. } Aoeqc;
  72. #define AOEQCSZ offsetof(Aoeqc, payload[0])
  73. extern char Echange[];
  74. extern char Enotup[];