/* 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 64 /* min frame len (bytes) (see above) */ #define FC_ENCAPS_MAX_FRAME_LEN (FC_ENCAPS_MIN_FRAME_LEN + FC_MAX_PAYLOAD)
#define FC_ENCAPS_VER 1 /* current version number */
struct fc_encaps_hdr {
__u8 fc_proto; /* protocol number */
__u8 fc_ver; /* version of encapsulation */
__u8 fc_proto_n; /* ones complement of protocol */
__u8 fc_ver_n; /* ones complement of version */
unsignedchar fc_proto_data[8]; /* protocol specific data */
__be16 fc_len_flags; /* 10-bit length/4 w/ 6 flag bits */
__be16 fc_len_flags_n; /* ones complement of length / flags */
/* * Offset 0x10
*/
__be32 fc_time[2]; /* time stamp: seconds and fraction */
__be32 fc_crc; /* CRC */
__be32 fc_sof; /* start of frame (see FC_SOF below) */
/* 0x20 - FC frame content followed by EOF word */
};
#define FCIP_ENCAPS_HDR_LEN 0x20 /* expected length for asserts */
#define FC_SOF_CLASS_MASK 0x06 /* mask for class of service in SOF */
/* * Define classes in terms of the SOF code (initial).
*/ enum fc_class {
FC_CLASS_NONE = 0, /* software value indicating no class */
FC_CLASS_2 = FC_SOF_I2,
FC_CLASS_3 = FC_SOF_I3,
FC_CLASS_4 = FC_SOF_I4,
FC_CLASS_F = FC_SOF_F,
};
/* * Determine whether SOF code indicates the need for a BLS ACK.
*/ staticinlineint fc_sof_needs_ack(enum fc_sof sof)
{ return (~sof) & 0x02; /* true for class 1, 2, 4, 6, or F */
}
/* * Given an fc_class, return the normal (non-initial) SOF value.
*/ staticinlineenum fc_sof fc_sof_normal(enum fc_class class)
{ returnclass + FC_SOF_N3 - FC_SOF_I3; /* diff is always 8 */
}
/* * Compute class from SOF value.
*/ staticinlineenum fc_class fc_sof_class(enum fc_sof sof)
{ return (sof & 0x7) | FC_SOF_F;
}
/* * Determine whether SOF is for the initial frame of a sequence.
*/ staticinlineint fc_sof_is_init(enum fc_sof sof)
{ return sof < 0x30;
}
#endif/* _FC_ENCAPS_H_ */
Messung V0.5
¤ Dauer der Verarbeitung: 0.23 Sekunden
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.