1 /* SPDX-License-Identifier: GPL-2.0-only */ 1 /* SPDX-License-Identifier: GPL-2.0-only */ 2 /* 2 /* 3 * Copyright(c) 2007 Intel Corporation. All ri 3 * Copyright(c) 2007 Intel Corporation. All rights reserved. 4 * 4 * 5 * Maintained at www.Open-FCoE.org 5 * Maintained at www.Open-FCoE.org 6 */ 6 */ 7 7 8 #ifndef _FC_FC2_H_ 8 #ifndef _FC_FC2_H_ 9 #define _FC_FC2_H_ 9 #define _FC_FC2_H_ 10 10 11 /* 11 /* 12 * Fibre Channel Exchanges and Sequences. 12 * Fibre Channel Exchanges and Sequences. 13 */ 13 */ 14 #ifndef PACKED 14 #ifndef PACKED 15 #define PACKED __attribute__ ((__packed__)) 15 #define PACKED __attribute__ ((__packed__)) 16 #endif /* PACKED */ 16 #endif /* PACKED */ 17 17 18 18 19 /* 19 /* 20 * Sequence Status Block. 20 * Sequence Status Block. 21 * This format is set by the FC-FS standard an 21 * This format is set by the FC-FS standard and is sent over the wire. 22 * Note that the fields aren't all naturally a 22 * Note that the fields aren't all naturally aligned. 23 */ 23 */ 24 struct fc_ssb { 24 struct fc_ssb { 25 __u8 ssb_seq_id; /* seq 25 __u8 ssb_seq_id; /* sequence ID */ 26 __u8 _ssb_resvd; 26 __u8 _ssb_resvd; 27 __be16 ssb_low_seq_cnt; /* low 27 __be16 ssb_low_seq_cnt; /* lowest SEQ_CNT */ 28 28 29 __be16 ssb_high_seq_cnt; /* hig 29 __be16 ssb_high_seq_cnt; /* highest SEQ_CNT */ 30 __be16 ssb_s_stat; /* seq 30 __be16 ssb_s_stat; /* sequence status flags */ 31 31 32 __be16 ssb_err_seq_cnt; /* err 32 __be16 ssb_err_seq_cnt; /* error SEQ_CNT */ 33 __u8 ssb_fh_cs_ctl; /* fra 33 __u8 ssb_fh_cs_ctl; /* frame header CS_CTL */ 34 __be16 ssb_fh_ox_id; /* fra 34 __be16 ssb_fh_ox_id; /* frame header OX_ID */ 35 __be16 ssb_rx_id; /* res 35 __be16 ssb_rx_id; /* responder's exchange ID */ 36 __u8 _ssb_resvd2[2]; 36 __u8 _ssb_resvd2[2]; 37 } PACKED; 37 } PACKED; 38 38 39 /* 39 /* 40 * The SSB should be 17 bytes. Since it's lay 40 * The SSB should be 17 bytes. Since it's layout is somewhat strange, 41 * we define the size here so that code can AS 41 * we define the size here so that code can ASSERT that the size comes out 42 * correct. 42 * correct. 43 */ 43 */ 44 #define FC_SSB_SIZE 17 /* len 44 #define FC_SSB_SIZE 17 /* length of fc_ssb for assert */ 45 45 46 /* 46 /* 47 * ssb_s_stat - flags from FC-FS-2 T11/1619-D 47 * ssb_s_stat - flags from FC-FS-2 T11/1619-D Rev 0.90. 48 */ 48 */ 49 #define SSB_ST_RESP (1 << 15) /* seq 49 #define SSB_ST_RESP (1 << 15) /* sequence responder */ 50 #define SSB_ST_ACTIVE (1 << 14) /* seq 50 #define SSB_ST_ACTIVE (1 << 14) /* sequence is active */ 51 #define SSB_ST_ABNORMAL (1 << 12) /* abn 51 #define SSB_ST_ABNORMAL (1 << 12) /* abnormal ending condition */ 52 52 53 #define SSB_ST_REQ_MASK (3 << 10) /* ACK 53 #define SSB_ST_REQ_MASK (3 << 10) /* ACK, abort sequence condition */ 54 #define SSB_ST_REQ_CONT (0 << 10) 54 #define SSB_ST_REQ_CONT (0 << 10) 55 #define SSB_ST_REQ_ABORT (1 << 10) 55 #define SSB_ST_REQ_ABORT (1 << 10) 56 #define SSB_ST_REQ_STOP (2 << 10) 56 #define SSB_ST_REQ_STOP (2 << 10) 57 #define SSB_ST_REQ_RETRANS (3 << 10) 57 #define SSB_ST_REQ_RETRANS (3 << 10) 58 58 59 #define SSB_ST_ABTS (1 << 9) /* ABT 59 #define SSB_ST_ABTS (1 << 9) /* ABTS protocol completed */ 60 #define SSB_ST_RETRANS (1 << 8) /* ret 60 #define SSB_ST_RETRANS (1 << 8) /* retransmission completed */ 61 #define SSB_ST_TIMEOUT (1 << 7) /* seq 61 #define SSB_ST_TIMEOUT (1 << 7) /* sequence timed out by recipient */ 62 #define SSB_ST_P_RJT (1 << 6) /* P_R 62 #define SSB_ST_P_RJT (1 << 6) /* P_RJT transmitted */ 63 63 64 #define SSB_ST_CLASS_BIT 4 /* cla 64 #define SSB_ST_CLASS_BIT 4 /* class of service field LSB */ 65 #define SSB_ST_CLASS_MASK 3 /* cla 65 #define SSB_ST_CLASS_MASK 3 /* class of service mask */ 66 #define SSB_ST_ACK (1 << 3) /* ACK 66 #define SSB_ST_ACK (1 << 3) /* ACK (EOFt or EOFdt) transmitted */ 67 67 68 /* 68 /* 69 * Exchange Status Block. 69 * Exchange Status Block. 70 * This format is set by the FC-FS standard an 70 * This format is set by the FC-FS standard and is sent over the wire. 71 * Note that the fields aren't all naturally a 71 * Note that the fields aren't all naturally aligned. 72 */ 72 */ 73 struct fc_esb { 73 struct fc_esb { 74 __u8 esb_cs_ctl; /* CS_ 74 __u8 esb_cs_ctl; /* CS_CTL for frame header */ 75 __be16 esb_ox_id; /* ori 75 __be16 esb_ox_id; /* originator exchange ID */ 76 __be16 esb_rx_id; /* res 76 __be16 esb_rx_id; /* responder exchange ID */ 77 __be32 esb_orig_fid; /* fab 77 __be32 esb_orig_fid; /* fabric ID of originator */ 78 __be32 esb_resp_fid; /* fab 78 __be32 esb_resp_fid; /* fabric ID of responder */ 79 __be32 esb_e_stat; /* sta 79 __be32 esb_e_stat; /* status */ 80 __u8 _esb_resvd[4]; 80 __u8 _esb_resvd[4]; 81 __u8 esb_service_params[112]; /* TB 81 __u8 esb_service_params[112]; /* TBD */ 82 __u8 esb_seq_status[8]; /* seq 82 __u8 esb_seq_status[8]; /* sequence statuses, 8 bytes each */ 83 } __attribute__((packed)); 83 } __attribute__((packed)); 84 84 85 /* 85 /* 86 * Define expected size for ASSERTs. 86 * Define expected size for ASSERTs. 87 * See comments on FC_SSB_SIZE. 87 * See comments on FC_SSB_SIZE. 88 */ 88 */ 89 #define FC_ESB_SIZE (1 + 5*4 + 112 + 8 89 #define FC_ESB_SIZE (1 + 5*4 + 112 + 8) /* expected size */ 90 90 91 /* 91 /* 92 * esb_e_stat - flags from FC-FS-2 T11/1619-D 92 * esb_e_stat - flags from FC-FS-2 T11/1619-D Rev 0.90. 93 */ 93 */ 94 #define ESB_ST_RESP (1 << 31) /* res 94 #define ESB_ST_RESP (1 << 31) /* responder to exchange */ 95 #define ESB_ST_SEQ_INIT (1 << 30) /* por 95 #define ESB_ST_SEQ_INIT (1 << 30) /* port holds sequence initiative */ 96 #define ESB_ST_COMPLETE (1 << 29) /* exc 96 #define ESB_ST_COMPLETE (1 << 29) /* exchange is complete */ 97 #define ESB_ST_ABNORMAL (1 << 28) /* abn 97 #define ESB_ST_ABNORMAL (1 << 28) /* abnormal ending condition */ 98 #define ESB_ST_REC_QUAL (1 << 26) /* rec 98 #define ESB_ST_REC_QUAL (1 << 26) /* recovery qualifier active */ 99 99 100 #define ESB_ST_ERRP_BIT 24 /* LSB 100 #define ESB_ST_ERRP_BIT 24 /* LSB for error policy */ 101 #define ESB_ST_ERRP_MASK (3 << 24) /* mas 101 #define ESB_ST_ERRP_MASK (3 << 24) /* mask for error policy */ 102 #define ESB_ST_ERRP_MULT (0 << 24) /* abo 102 #define ESB_ST_ERRP_MULT (0 << 24) /* abort, discard multiple sequences */ 103 #define ESB_ST_ERRP_SING (1 << 24) /* abo 103 #define ESB_ST_ERRP_SING (1 << 24) /* abort, discard single sequence */ 104 #define ESB_ST_ERRP_INF (2 << 24) /* pro 104 #define ESB_ST_ERRP_INF (2 << 24) /* process with infinite buffers */ 105 #define ESB_ST_ERRP_IMM (3 << 24) /* dis 105 #define ESB_ST_ERRP_IMM (3 << 24) /* discard mult. with immed. retran. */ 106 106 107 #define ESB_ST_OX_ID_INVL (1 << 23) /* ori 107 #define ESB_ST_OX_ID_INVL (1 << 23) /* originator XID invalid */ 108 #define ESB_ST_RX_ID_INVL (1 << 22) /* res 108 #define ESB_ST_RX_ID_INVL (1 << 22) /* responder XID invalid */ 109 #define ESB_ST_PRI_INUSE (1 << 21) /* pri 109 #define ESB_ST_PRI_INUSE (1 << 21) /* priority / preemption in use */ 110 110 111 #endif /* _FC_FC2_H_ */ 111 #endif /* _FC_FC2_H_ */ 112 112
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.