You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

fcoe.h 2.0KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. #ifndef _IPXE_FCOE_H
  2. #define _IPXE_FCOE_H
  3. /**
  4. * @file
  5. *
  6. * Fibre Channel over Ethernet
  7. *
  8. */
  9. FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
  10. #include <stdint.h>
  11. #include <ipxe/fc.h>
  12. #include <ipxe/if_ether.h>
  13. /** An FCoE name */
  14. union fcoe_name {
  15. /** Fibre Channel name */
  16. struct fc_name fc;
  17. /** FCoE name */
  18. struct {
  19. /** Naming authority */
  20. uint16_t authority;
  21. /** MAC address */
  22. uint8_t mac[ETH_ALEN];
  23. } __attribute__ (( packed )) fcoe;
  24. };
  25. /** IEEE 48-bit address */
  26. #define FCOE_AUTHORITY_IEEE 0x1000
  27. /** IEEE extended */
  28. #define FCOE_AUTHORITY_IEEE_EXTENDED 0x2000
  29. /** An FCoE MAC address prefix (FC-MAP) */
  30. struct fcoe_map {
  31. uint8_t bytes[3];
  32. } __attribute__ (( packed ));
  33. /** An FCoE (fabric-assigned) MAC address */
  34. struct fcoe_mac {
  35. /** MAC address prefix */
  36. struct fcoe_map map;
  37. /** Port ID */
  38. struct fc_port_id port_id;
  39. } __attribute__ (( packed ));
  40. /** An FCoE header */
  41. struct fcoe_header {
  42. /** FCoE frame version */
  43. uint8_t version;
  44. /** Reserved */
  45. uint8_t reserved[12];
  46. /** Start of Frame marker */
  47. uint8_t sof;
  48. } __attribute__ (( packed ));
  49. /** FCoE frame version */
  50. #define FCOE_FRAME_VER 0x00
  51. /** Start of Frame marker values */
  52. enum fcoe_sof {
  53. FCOE_SOF_F = 0x28, /**< Start of Frame Class F */
  54. FCOE_SOF_I2 = 0x2d, /**< Start of Frame Initiate Class 2 */
  55. FCOE_SOF_N2 = 0x35, /**< Start of Frame Normal Class 2 */
  56. FCOE_SOF_I3 = 0x2e, /**< Start of Frame Initiate Class 3 */
  57. FCOE_SOF_N3 = 0x36, /**< Start of Frame Normal Class 3 */
  58. };
  59. /** An FCoE footer */
  60. struct fcoe_footer {
  61. /** CRC */
  62. uint32_t crc;
  63. /** End of frame marker */
  64. uint8_t eof;
  65. /** Reserved */
  66. uint8_t reserved[3];
  67. } __attribute__ (( packed ));
  68. /** End of Frame marker value */
  69. enum fcoe_eof {
  70. FCOE_EOF_N = 0x41, /**< End of Frame Normal */
  71. FCOE_EOF_T = 0x42, /**< End of Frame Terminate */
  72. FCOE_EOF_NI = 0x49, /**< End of Frame Invalid */
  73. FCOE_EOF_A = 0x50, /**< End of Frame Abort */
  74. };
  75. /** FCoE VLAN priority */
  76. #define FCOE_VLAN_PRIORITY 3
  77. #endif /* _IPXE_FCOE_H */