@@ -41,6 +41,7 @@ enum fc_els_cmd {
4141 ELS_REC = 0x13 , /* read exchange concise */
4242 ELS_SRR = 0x14 , /* sequence retransmission request */
4343 ELS_FPIN = 0x16 , /* Fabric Performance Impact Notification */
44+ ELS_EDC = 0x17 , /* Exchange Diagnostic Capabilities */
4445 ELS_RDP = 0x18 , /* Read Diagnostic Parameters */
4546 ELS_RDF = 0x19 , /* Register Diagnostic Functions */
4647 ELS_PRLI = 0x20 , /* process login */
@@ -111,6 +112,7 @@ enum fc_els_cmd {
111112 [ELS_REC] = "REC", \
112113 [ELS_SRR] = "SRR", \
113114 [ELS_FPIN] = "FPIN", \
115+ [ELS_EDC] = "EDC", \
114116 [ELS_RDP] = "RDP", \
115117 [ELS_RDF] = "RDF", \
116118 [ELS_PRLI] = "PRLI", \
@@ -218,6 +220,10 @@ enum fc_els_rjt_explan {
218220enum fc_ls_tlv_dtag {
219221 ELS_DTAG_LS_REQ_INFO = 0x00000001 ,
220222 /* Link Service Request Information Descriptor */
223+ ELS_DTAG_LNK_FAULT_CAP = 0x0001000D ,
224+ /* Link Fault Capability Descriptor */
225+ ELS_DTAG_CG_SIGNAL_CAP = 0x0001000F ,
226+ /* Congestion Signaling Capability Descriptor */
221227 ELS_DTAG_LNK_INTEGRITY = 0x00020001 ,
222228 /* Link Integrity Notification Descriptor */
223229 ELS_DTAG_DELIVERY = 0x00020002 ,
@@ -236,6 +242,8 @@ enum fc_ls_tlv_dtag {
236242 */
237243#define FC_LS_TLV_DTAG_INIT { \
238244 { ELS_DTAG_LS_REQ_INFO, "Link Service Request Information" }, \
245+ { ELS_DTAG_LNK_FAULT_CAP, "Link Fault Capability" }, \
246+ { ELS_DTAG_CG_SIGNAL_CAP, "Congestion Signaling Capability" }, \
239247 { ELS_DTAG_LNK_INTEGRITY, "Link Integrity Notification" }, \
240248 { ELS_DTAG_DELIVERY, "Delivery Notification Present" }, \
241249 { ELS_DTAG_PEER_CONGEST, "Peer Congestion Notification" }, \
@@ -1144,4 +1152,102 @@ struct fc_els_rdf_resp {
11441152};
11451153
11461154
1155+ /*
1156+ * Diagnostic Capability Descriptors for EDC ELS
1157+ */
1158+
1159+ /*
1160+ * Diagnostic: Link Fault Capability Descriptor
1161+ */
1162+ struct fc_diag_lnkflt_desc {
1163+ __be32 desc_tag ; /* Descriptor Tag (0x0001000D) */
1164+ __be32 desc_len ; /* Length of Descriptor (in bytes).
1165+ * Size of descriptor excluding
1166+ * desc_tag and desc_len fields.
1167+ * 12 bytes
1168+ */
1169+ __be32 degrade_activate_threshold ;
1170+ __be32 degrade_deactivate_threshold ;
1171+ __be32 fec_degrade_interval ;
1172+ };
1173+
1174+ enum fc_edc_cg_signal_cap_types {
1175+ /* Note: Capability: bits 31:4 Rsvd; bits 3:0 are capabilities */
1176+ EDC_CG_SIG_NOTSUPPORTED = 0x00 , /* neither supported */
1177+ EDC_CG_SIG_WARN_ONLY = 0x01 ,
1178+ EDC_CG_SIG_WARN_ALARM = 0x02 , /* both supported */
1179+ };
1180+
1181+ /*
1182+ * Initializer useful for decoding table.
1183+ * Please keep this in sync with the above definitions.
1184+ */
1185+ #define FC_EDC_CG_SIGNAL_CAP_TYPES_INIT { \
1186+ { EDC_CG_SIG_NOTSUPPORTED, "Signaling Not Supported" }, \
1187+ { EDC_CG_SIG_WARN_ONLY, "Warning Signal" }, \
1188+ { EDC_CG_SIG_WARN_ALARM, "Warning and Alarm Signals" }, \
1189+ }
1190+
1191+ enum fc_diag_cg_sig_freq_types {
1192+ EDC_CG_SIGFREQ_CNT_MIN = 1 , /* Min Frequency Count */
1193+ EDC_CG_SIGFREQ_CNT_MAX = 999 , /* Max Frequency Count */
1194+
1195+ EDC_CG_SIGFREQ_SEC = 0x1 , /* Units: seconds */
1196+ EDC_CG_SIGFREQ_MSEC = 0x2 , /* Units: milliseconds */
1197+ };
1198+
1199+ struct fc_diag_cg_sig_freq {
1200+ __be16 count ; /* Time between signals
1201+ * note: upper 6 bits rsvd
1202+ */
1203+ __be16 units ; /* Time unit for count
1204+ * note: upper 12 bits rsvd
1205+ */
1206+ };
1207+
1208+ /*
1209+ * Diagnostic: Congestion Signaling Capability Descriptor
1210+ */
1211+ struct fc_diag_cg_sig_desc {
1212+ __be32 desc_tag ; /* Descriptor Tag (0x0001000F) */
1213+ __be32 desc_len ; /* Length of Descriptor (in bytes).
1214+ * Size of descriptor excluding
1215+ * desc_tag and desc_len fields.
1216+ * 16 bytes
1217+ */
1218+ __be32 xmt_signal_capability ;
1219+ struct fc_diag_cg_sig_freq xmt_signal_frequency ;
1220+ __be32 rcv_signal_capability ;
1221+ struct fc_diag_cg_sig_freq rcv_signal_frequency ;
1222+ };
1223+
1224+ /*
1225+ * ELS_EDC - Exchange Diagnostic Capabilities
1226+ */
1227+ struct fc_els_edc {
1228+ __u8 edc_cmd ; /* command (0x17) */
1229+ __u8 edc_zero [3 ]; /* specified as zero - part of cmd */
1230+ __be32 desc_len ; /* Length of Descriptor List (in bytes).
1231+ * Size of ELS excluding edc_cmd,
1232+ * edc_zero and desc_len fields.
1233+ */
1234+ struct fc_tlv_desc desc [0 ];
1235+ /* Diagnostic Descriptor list */
1236+ };
1237+
1238+ /*
1239+ * ELS EDC LS_ACC Response.
1240+ */
1241+ struct fc_els_edc_resp {
1242+ struct fc_els_ls_acc acc_hdr ;
1243+ __be32 desc_list_len ; /* Length of response (in
1244+ * bytes). Excludes acc_hdr
1245+ * and desc_list_len fields.
1246+ */
1247+ struct fc_els_lsri_desc lsri ;
1248+ struct fc_tlv_desc desc [0 ];
1249+ /* Supported Diagnostic Descriptor list */
1250+ };
1251+
1252+
11471253#endif /* _FC_ELS_H_ */
0 commit comments