/* SPDX-License-Identifier: GPL-2.0-only */ /* * Copyright(c) 2007 Intel Corporation. All rights reserved. * * Maintained at www.Open-FCoE.org */ #ifndef _FC_ENCAPS_H_ #define _FC_ENCAPS_H_ /* * Protocol definitions from RFC 3643 - Fibre Channel Frame Encapsulation. * * Note: The frame length field is the number of 32-bit words in * the encapsulation including the fcip_encaps_header, CRC and EOF words. * The minimum frame length value in bytes is (32 + 24 + 4 + 4) * 4 = 64. * The maximum frame length value in bytes is (32 + 24 + 2112 + 4 + 4) = 2172. */ #define FC_ENCAPS_MIN_FRAME_LEN … #define FC_ENCAPS_MAX_FRAME_LEN … #define FC_ENCAPS_VER … struct fc_encaps_hdr { … }; #define FCIP_ENCAPS_HDR_LEN … /* * Macro's for making redundant copies of EOF and SOF. */ #define FC_XY(x, y) … #define FC_XYXY(x, y) … #define FC_XYNN(x, y) … #define FC_SOF_ENCODE(n) … #define FC_EOF_ENCODE(n) … /* * SOF / EOF bytes. */ enum fc_sof { … } __attribute__((packed)); enum fc_eof { … } __attribute__((packed)); #define FC_SOF_CLASS_MASK … /* * Define classes in terms of the SOF code (initial). */ enum fc_class { … }; /* * Determine whether SOF code indicates the need for a BLS ACK. */ static inline int fc_sof_needs_ack(enum fc_sof sof) { … } /* * Given an fc_class, return the normal (non-initial) SOF value. */ static inline enum fc_sof fc_sof_normal(enum fc_class class) { … } /* * Compute class from SOF value. */ static inline enum fc_class fc_sof_class(enum fc_sof sof) { … } /* * Determine whether SOF is for the initial frame of a sequence. */ static inline int fc_sof_is_init(enum fc_sof sof) { … } #endif /* _FC_ENCAPS_H_ */