iPXE
fcoe.h
Go to the documentation of this file.
00001 #ifndef _IPXE_FCOE_H
00002 #define _IPXE_FCOE_H
00003 
00004 /**
00005  * @file
00006  *
00007  * Fibre Channel over Ethernet
00008  *
00009  */
00010 
00011 FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
00012 
00013 #include <stdint.h>
00014 #include <ipxe/fc.h>
00015 #include <ipxe/if_ether.h>
00016 
00017 /** An FCoE name */
00018 union fcoe_name {
00019         /** Fibre Channel name */
00020         struct fc_name fc;
00021         /** FCoE name */
00022         struct {
00023                 /** Naming authority */
00024                 uint16_t authority;
00025                 /** MAC address */
00026                 uint8_t mac[ETH_ALEN];
00027         } __attribute__ (( packed )) fcoe;
00028 };
00029 
00030 /** IEEE 48-bit address */
00031 #define FCOE_AUTHORITY_IEEE 0x1000
00032 
00033 /** IEEE extended */
00034 #define FCOE_AUTHORITY_IEEE_EXTENDED 0x2000
00035 
00036 /** An FCoE MAC address prefix (FC-MAP) */
00037 struct fcoe_map {
00038         uint8_t bytes[3];
00039 } __attribute__ (( packed ));
00040 
00041 /** An FCoE (fabric-assigned) MAC address */
00042 struct fcoe_mac {
00043         /** MAC address prefix */
00044         struct fcoe_map map;
00045         /** Port ID */
00046         struct fc_port_id port_id;
00047 } __attribute__ (( packed ));
00048 
00049 /** An FCoE header */
00050 struct fcoe_header {
00051         /** FCoE frame version */
00052         uint8_t version;
00053         /** Reserved */
00054         uint8_t reserved[12];
00055         /** Start of Frame marker */
00056         uint8_t sof;
00057 } __attribute__ (( packed ));
00058 
00059 /** FCoE frame version */
00060 #define FCOE_FRAME_VER 0x00
00061 
00062 /** Start of Frame marker values */
00063 enum fcoe_sof {
00064         FCOE_SOF_F = 0x28,      /**< Start of Frame Class F */
00065         FCOE_SOF_I2 = 0x2d,     /**< Start of Frame Initiate Class 2 */
00066         FCOE_SOF_N2 = 0x35,     /**< Start of Frame Normal Class 2 */
00067         FCOE_SOF_I3 = 0x2e,     /**< Start of Frame Initiate Class 3 */
00068         FCOE_SOF_N3 = 0x36,     /**< Start of Frame Normal Class 3 */
00069 };
00070 
00071 /** An FCoE footer */
00072 struct fcoe_footer {
00073         /** CRC */
00074         uint32_t crc;
00075         /** End of frame marker */
00076         uint8_t eof;
00077         /** Reserved */
00078         uint8_t reserved[3];
00079 } __attribute__ (( packed ));
00080 
00081 /** End of Frame marker value */
00082 enum fcoe_eof {
00083         FCOE_EOF_N = 0x41,      /**< End of Frame Normal */
00084         FCOE_EOF_T = 0x42,      /**< End of Frame Terminate */
00085         FCOE_EOF_NI = 0x49,     /**< End of Frame Invalid */
00086         FCOE_EOF_A = 0x50,      /**< End of Frame Abort */
00087 };
00088 
00089 /** FCoE VLAN priority */
00090 #define FCOE_VLAN_PRIORITY 3
00091 
00092 #endif /* _IPXE_FCOE_H */