/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */1/*2* Copyright(c) 2007 Intel Corporation. All rights reserved.3*4* Maintained at www.Open-FCoE.org5*/67#ifndef _FC_ELS_H_8#define _FC_ELS_H_910#include <linux/types.h>11#include <asm/byteorder.h>1213#ifdef __KERNEL__14#include <linux/stddef.h> /* for offsetof */15#else16#include <stddef.h> /* for offsetof */17#endif1819/*20* Fibre Channel Switch - Enhanced Link Services definitions.21* From T11 FC-LS Rev 1.2 June 7, 2005.22*/2324/*25* ELS Command codes - byte 0 of the frame payload26*/27enum fc_els_cmd {28ELS_LS_RJT = 0x01, /* ESL reject */29ELS_LS_ACC = 0x02, /* ESL Accept */30ELS_PLOGI = 0x03, /* N_Port login */31ELS_FLOGI = 0x04, /* F_Port login */32ELS_LOGO = 0x05, /* Logout */33ELS_ABTX = 0x06, /* Abort exchange - obsolete */34ELS_RCS = 0x07, /* read connection status */35ELS_RES = 0x08, /* read exchange status block */36ELS_RSS = 0x09, /* read sequence status block */37ELS_RSI = 0x0a, /* read sequence initiative */38ELS_ESTS = 0x0b, /* establish streaming */39ELS_ESTC = 0x0c, /* estimate credit */40ELS_ADVC = 0x0d, /* advise credit */41ELS_RTV = 0x0e, /* read timeout value */42ELS_RLS = 0x0f, /* read link error status block */43ELS_ECHO = 0x10, /* echo */44ELS_TEST = 0x11, /* test */45ELS_RRQ = 0x12, /* reinstate recovery qualifier */46ELS_REC = 0x13, /* read exchange concise */47ELS_SRR = 0x14, /* sequence retransmission request */48ELS_FPIN = 0x16, /* Fabric Performance Impact Notification */49ELS_EDC = 0x17, /* Exchange Diagnostic Capabilities */50ELS_RDP = 0x18, /* Read Diagnostic Parameters */51ELS_RDF = 0x19, /* Register Diagnostic Functions */52ELS_PRLI = 0x20, /* process login */53ELS_PRLO = 0x21, /* process logout */54ELS_SCN = 0x22, /* state change notification */55ELS_TPLS = 0x23, /* test process login state */56ELS_TPRLO = 0x24, /* third party process logout */57ELS_LCLM = 0x25, /* login control list mgmt (obs) */58ELS_GAID = 0x30, /* get alias_ID */59ELS_FACT = 0x31, /* fabric activate alias_id */60ELS_FDACDT = 0x32, /* fabric deactivate alias_id */61ELS_NACT = 0x33, /* N-port activate alias_id */62ELS_NDACT = 0x34, /* N-port deactivate alias_id */63ELS_QOSR = 0x40, /* quality of service request */64ELS_RVCS = 0x41, /* read virtual circuit status */65ELS_PDISC = 0x50, /* discover N_port service params */66ELS_FDISC = 0x51, /* discover F_port service params */67ELS_ADISC = 0x52, /* discover address */68ELS_RNC = 0x53, /* report node cap (obs) */69ELS_FARP_REQ = 0x54, /* FC ARP request */70ELS_FARP_REPL = 0x55, /* FC ARP reply */71ELS_RPS = 0x56, /* read port status block */72ELS_RPL = 0x57, /* read port list */73ELS_RPBC = 0x58, /* read port buffer condition */74ELS_FAN = 0x60, /* fabric address notification */75ELS_RSCN = 0x61, /* registered state change notification */76ELS_SCR = 0x62, /* state change registration */77ELS_RNFT = 0x63, /* report node FC-4 types */78ELS_CSR = 0x68, /* clock synch. request */79ELS_CSU = 0x69, /* clock synch. update */80ELS_LINIT = 0x70, /* loop initialize */81ELS_LSTS = 0x72, /* loop status */82ELS_RNID = 0x78, /* request node ID data */83ELS_RLIR = 0x79, /* registered link incident report */84ELS_LIRR = 0x7a, /* link incident record registration */85ELS_SRL = 0x7b, /* scan remote loop */86ELS_SBRP = 0x7c, /* set bit-error reporting params */87ELS_RPSC = 0x7d, /* report speed capabilities */88ELS_QSA = 0x7e, /* query security attributes */89ELS_EVFP = 0x7f, /* exchange virt. fabrics params */90ELS_LKA = 0x80, /* link keep-alive */91ELS_AUTH_ELS = 0x90, /* authentication ELS */92};9394/*95* Initializer useful for decoding table.96* Please keep this in sync with the above definitions.97*/98#define FC_ELS_CMDS_INIT { \99[ELS_LS_RJT] = "LS_RJT", \100[ELS_LS_ACC] = "LS_ACC", \101[ELS_PLOGI] = "PLOGI", \102[ELS_FLOGI] = "FLOGI", \103[ELS_LOGO] = "LOGO", \104[ELS_ABTX] = "ABTX", \105[ELS_RCS] = "RCS", \106[ELS_RES] = "RES", \107[ELS_RSS] = "RSS", \108[ELS_RSI] = "RSI", \109[ELS_ESTS] = "ESTS", \110[ELS_ESTC] = "ESTC", \111[ELS_ADVC] = "ADVC", \112[ELS_RTV] = "RTV", \113[ELS_RLS] = "RLS", \114[ELS_ECHO] = "ECHO", \115[ELS_TEST] = "TEST", \116[ELS_RRQ] = "RRQ", \117[ELS_REC] = "REC", \118[ELS_SRR] = "SRR", \119[ELS_FPIN] = "FPIN", \120[ELS_EDC] = "EDC", \121[ELS_RDP] = "RDP", \122[ELS_RDF] = "RDF", \123[ELS_PRLI] = "PRLI", \124[ELS_PRLO] = "PRLO", \125[ELS_SCN] = "SCN", \126[ELS_TPLS] = "TPLS", \127[ELS_TPRLO] = "TPRLO", \128[ELS_LCLM] = "LCLM", \129[ELS_GAID] = "GAID", \130[ELS_FACT] = "FACT", \131[ELS_FDACDT] = "FDACDT", \132[ELS_NACT] = "NACT", \133[ELS_NDACT] = "NDACT", \134[ELS_QOSR] = "QOSR", \135[ELS_RVCS] = "RVCS", \136[ELS_PDISC] = "PDISC", \137[ELS_FDISC] = "FDISC", \138[ELS_ADISC] = "ADISC", \139[ELS_RNC] = "RNC", \140[ELS_FARP_REQ] = "FARP_REQ", \141[ELS_FARP_REPL] = "FARP_REPL", \142[ELS_RPS] = "RPS", \143[ELS_RPL] = "RPL", \144[ELS_RPBC] = "RPBC", \145[ELS_FAN] = "FAN", \146[ELS_RSCN] = "RSCN", \147[ELS_SCR] = "SCR", \148[ELS_RNFT] = "RNFT", \149[ELS_CSR] = "CSR", \150[ELS_CSU] = "CSU", \151[ELS_LINIT] = "LINIT", \152[ELS_LSTS] = "LSTS", \153[ELS_RNID] = "RNID", \154[ELS_RLIR] = "RLIR", \155[ELS_LIRR] = "LIRR", \156[ELS_SRL] = "SRL", \157[ELS_SBRP] = "SBRP", \158[ELS_RPSC] = "RPSC", \159[ELS_QSA] = "QSA", \160[ELS_EVFP] = "EVFP", \161[ELS_LKA] = "LKA", \162[ELS_AUTH_ELS] = "AUTH_ELS", \163}164165/*166* LS_ACC payload.167*/168struct fc_els_ls_acc {169__u8 la_cmd; /* command code ELS_LS_ACC */170__u8 la_resv[3]; /* reserved */171};172173/*174* ELS reject payload.175*/176struct fc_els_ls_rjt {177__u8 er_cmd; /* command code ELS_LS_RJT */178__u8 er_resv[4]; /* reserved must be zero */179__u8 er_reason; /* reason (enum fc_els_rjt_reason below) */180__u8 er_explan; /* explanation (enum fc_els_rjt_explan below) */181__u8 er_vendor; /* vendor specific code */182};183184/*185* ELS reject reason codes (er_reason).186*/187enum fc_els_rjt_reason {188ELS_RJT_NONE = 0, /* no reject - not to be sent */189ELS_RJT_INVAL = 0x01, /* invalid ELS command code */190ELS_RJT_LOGIC = 0x03, /* logical error */191ELS_RJT_BUSY = 0x05, /* logical busy */192ELS_RJT_PROT = 0x07, /* protocol error */193ELS_RJT_UNAB = 0x09, /* unable to perform command request */194ELS_RJT_UNSUP = 0x0b, /* command not supported */195ELS_RJT_INPROG = 0x0e, /* command already in progress */196ELS_RJT_FIP = 0x20, /* FIP error */197ELS_RJT_VENDOR = 0xff, /* vendor specific error */198};199200201/*202* reason code explanation (er_explan).203*/204enum fc_els_rjt_explan {205ELS_EXPL_NONE = 0x00, /* No additional explanation */206ELS_EXPL_SPP_OPT_ERR = 0x01, /* service parameter error - options */207ELS_EXPL_SPP_ICTL_ERR = 0x03, /* service parm error - initiator ctl */208ELS_EXPL_AH = 0x11, /* invalid association header */209ELS_EXPL_AH_REQ = 0x13, /* association_header required */210ELS_EXPL_SID = 0x15, /* invalid originator S_ID */211ELS_EXPL_OXID_RXID = 0x17, /* invalid OX_ID-RX_ID combination */212ELS_EXPL_INPROG = 0x19, /* Request already in progress */213ELS_EXPL_PLOGI_REQD = 0x1e, /* N_Port login required */214ELS_EXPL_INSUF_RES = 0x29, /* insufficient resources */215ELS_EXPL_UNAB_DATA = 0x2a, /* unable to supply requested data */216ELS_EXPL_UNSUPR = 0x2c, /* Request not supported */217ELS_EXPL_INV_LEN = 0x2d, /* Invalid payload length */218ELS_EXPL_NOT_NEIGHBOR = 0x62, /* VN2VN_Port not in neighbor set */219/* TBD - above definitions incomplete */220};221222/*223* Link Service TLV Descriptor Tag Values224*/225enum fc_ls_tlv_dtag {226ELS_DTAG_LS_REQ_INFO = 0x00000001,227/* Link Service Request Information Descriptor */228ELS_DTAG_LNK_FAULT_CAP = 0x0001000D,229/* Link Fault Capability Descriptor */230ELS_DTAG_CG_SIGNAL_CAP = 0x0001000F,231/* Congestion Signaling Capability Descriptor */232ELS_DTAG_LNK_INTEGRITY = 0x00020001,233/* Link Integrity Notification Descriptor */234ELS_DTAG_DELIVERY = 0x00020002,235/* Delivery Notification Descriptor */236ELS_DTAG_PEER_CONGEST = 0x00020003,237/* Peer Congestion Notification Descriptor */238ELS_DTAG_CONGESTION = 0x00020004,239/* Congestion Notification Descriptor */240ELS_DTAG_FPIN_REGISTER = 0x00030001,241/* FPIN Registration Descriptor */242};243244/*245* Initializer useful for decoding table.246* Please keep this in sync with the above definitions.247*/248#define FC_LS_TLV_DTAG_INIT { \249{ ELS_DTAG_LS_REQ_INFO, "Link Service Request Information" }, \250{ ELS_DTAG_LNK_FAULT_CAP, "Link Fault Capability" }, \251{ ELS_DTAG_CG_SIGNAL_CAP, "Congestion Signaling Capability" }, \252{ ELS_DTAG_LNK_INTEGRITY, "Link Integrity Notification" }, \253{ ELS_DTAG_DELIVERY, "Delivery Notification Present" }, \254{ ELS_DTAG_PEER_CONGEST, "Peer Congestion Notification" }, \255{ ELS_DTAG_CONGESTION, "Congestion Notification" }, \256{ ELS_DTAG_FPIN_REGISTER, "FPIN Registration" }, \257}258259260/*261* Generic Link Service TLV Descriptor format262*263* This structure, as it defines no payload, will also be referred to264* as the "tlv header" - which contains the tag and len fields.265*/266struct fc_tlv_desc {267__be32 desc_tag; /* Notification Descriptor Tag */268__be32 desc_len; /* Length of Descriptor (in bytes).269* Size of descriptor excluding270* desc_tag and desc_len fields.271*/272__u8 desc_value[]; /* Descriptor Value */273};274275/* Descriptor tag and len fields are considered the mandatory header276* for a descriptor277*/278#define FC_TLV_DESC_HDR_SZ sizeof(struct fc_tlv_desc)279280/*281* Macro, used when initializing payloads, to return the descriptor length.282* Length is size of descriptor minus the tag and len fields.283*/284#define FC_TLV_DESC_LENGTH_FROM_SZ(desc) \285(sizeof(desc) - FC_TLV_DESC_HDR_SZ)286287/* Macro, used on received payloads, to return the descriptor length */288#define FC_TLV_DESC_SZ_FROM_LENGTH(tlv) \289(__be32_to_cpu((tlv)->desc_len) + FC_TLV_DESC_HDR_SZ)290291/*292* This helper is used to walk descriptors in a descriptor list.293* Given the address of the current descriptor, which minimally contains a294* tag and len field, calculate the address of the next descriptor based295* on the len field.296*/297static inline void *fc_tlv_next_desc(void *desc)298{299struct fc_tlv_desc *tlv = desc;300301return (desc + FC_TLV_DESC_SZ_FROM_LENGTH(tlv));302}303304305/*306* Link Service Request Information Descriptor307*/308struct fc_els_lsri_desc {309__be32 desc_tag; /* descriptor tag (0x0000 0001) */310__be32 desc_len; /* Length of Descriptor (in bytes) (4).311* Size of descriptor excluding312* desc_tag and desc_len fields.313*/314struct {315__u8 cmd; /* ELS cmd byte */316__u8 bytes[3]; /* bytes 1..3 */317} rqst_w0; /* Request word 0 */318};319320321/*322* Common service parameters (N ports).323*/324struct fc_els_csp {325__u8 sp_hi_ver; /* highest version supported (obs.) */326__u8 sp_lo_ver; /* highest version supported (obs.) */327__be16 sp_bb_cred; /* buffer-to-buffer credits */328__be16 sp_features; /* common feature flags */329__be16 sp_bb_data; /* b-b state number and data field sz */330union {331struct {332__be16 _sp_tot_seq; /* total concurrent sequences */333__be16 _sp_rel_off; /* rel. offset by info cat */334} sp_plogi;335struct {336__be32 _sp_r_a_tov; /* resource alloc. timeout msec */337} sp_flogi_acc;338} sp_u;339__be32 sp_e_d_tov; /* error detect timeout value */340};341#define sp_tot_seq sp_u.sp_plogi._sp_tot_seq342#define sp_rel_off sp_u.sp_plogi._sp_rel_off343#define sp_r_a_tov sp_u.sp_flogi_acc._sp_r_a_tov344345#define FC_SP_BB_DATA_MASK 0xfff /* mask for data field size in sp_bb_data */346347/*348* Minimum and maximum values for max data field size in service parameters.349*/350#define FC_SP_MIN_MAX_PAYLOAD FC_MIN_MAX_PAYLOAD351#define FC_SP_MAX_MAX_PAYLOAD FC_MAX_PAYLOAD352353/*354* sp_features355*/356#define FC_SP_FT_NPIV 0x8000 /* multiple N_Port_ID support (FLOGI) */357#define FC_SP_FT_CIRO 0x8000 /* continuously increasing rel off (PLOGI) */358#define FC_SP_FT_CLAD 0x8000 /* clean address (in FLOGI LS_ACC) */359#define FC_SP_FT_RAND 0x4000 /* random relative offset */360#define FC_SP_FT_VAL 0x2000 /* valid vendor version level */361#define FC_SP_FT_NPIV_ACC 0x2000 /* NPIV assignment (FLOGI LS_ACC) */362#define FC_SP_FT_FPORT 0x1000 /* F port (1) vs. N port (0) */363#define FC_SP_FT_ABB 0x0800 /* alternate BB_credit management */364#define FC_SP_FT_EDTR 0x0400 /* E_D_TOV Resolution is nanoseconds */365#define FC_SP_FT_MCAST 0x0200 /* multicast */366#define FC_SP_FT_BCAST 0x0100 /* broadcast */367#define FC_SP_FT_HUNT 0x0080 /* hunt group */368#define FC_SP_FT_SIMP 0x0040 /* dedicated simplex */369#define FC_SP_FT_SEC 0x0020 /* reserved for security */370#define FC_SP_FT_CSYN 0x0010 /* clock synch. supported */371#define FC_SP_FT_RTTOV 0x0008 /* R_T_TOV value 100 uS, else 100 mS */372#define FC_SP_FT_HALF 0x0004 /* dynamic half duplex */373#define FC_SP_FT_SEQC 0x0002 /* SEQ_CNT */374#define FC_SP_FT_PAYL 0x0001 /* FLOGI payload length 256, else 116 */375376/*377* Class-specific service parameters.378*/379struct fc_els_cssp {380__be16 cp_class; /* class flags */381__be16 cp_init; /* initiator flags */382__be16 cp_recip; /* recipient flags */383__be16 cp_rdfs; /* receive data field size */384__be16 cp_con_seq; /* concurrent sequences */385__be16 cp_ee_cred; /* N-port end-to-end credit */386__u8 cp_resv1; /* reserved */387__u8 cp_open_seq; /* open sequences per exchange */388__u8 _cp_resv2[2]; /* reserved */389};390391/*392* cp_class flags.393*/394#define FC_CPC_VALID 0x8000 /* class valid */395#define FC_CPC_IMIX 0x4000 /* intermix mode */396#define FC_CPC_SEQ 0x0800 /* sequential delivery */397#define FC_CPC_CAMP 0x0200 /* camp-on */398#define FC_CPC_PRI 0x0080 /* priority */399400/*401* cp_init flags.402* (TBD: not all flags defined here).403*/404#define FC_CPI_CSYN 0x0010 /* clock synch. capable */405406/*407* cp_recip flags.408*/409#define FC_CPR_CSYN 0x0008 /* clock synch. capable */410411/*412* NFC_ELS_FLOGI: Fabric login request.413* NFC_ELS_PLOGI: Port login request (same format).414*/415struct fc_els_flogi {416__u8 fl_cmd; /* command */417__u8 _fl_resvd[3]; /* must be zero */418struct fc_els_csp fl_csp; /* common service parameters */419__be64 fl_wwpn; /* port name */420__be64 fl_wwnn; /* node name */421struct fc_els_cssp fl_cssp[4]; /* class 1-4 service parameters */422__u8 fl_vend[16]; /* vendor version level */423} __attribute__((__packed__));424425/*426* Process login service parameter page.427*/428struct fc_els_spp {429__u8 spp_type; /* type code or common service params */430__u8 spp_type_ext; /* type code extension */431__u8 spp_flags;432__u8 _spp_resvd;433__be32 spp_orig_pa; /* originator process associator */434__be32 spp_resp_pa; /* responder process associator */435__be32 spp_params; /* service parameters */436};437438/*439* spp_flags.440*/441#define FC_SPP_OPA_VAL 0x80 /* originator proc. assoc. valid */442#define FC_SPP_RPA_VAL 0x40 /* responder proc. assoc. valid */443#define FC_SPP_EST_IMG_PAIR 0x20 /* establish image pair */444#define FC_SPP_RESP_MASK 0x0f /* mask for response code (below) */445446/*447* SPP response code in spp_flags - lower 4 bits.448*/449enum fc_els_spp_resp {450FC_SPP_RESP_ACK = 1, /* request executed */451FC_SPP_RESP_RES = 2, /* unable due to lack of resources */452FC_SPP_RESP_INIT = 3, /* initialization not complete */453FC_SPP_RESP_NO_PA = 4, /* unknown process associator */454FC_SPP_RESP_CONF = 5, /* configuration precludes image pair */455FC_SPP_RESP_COND = 6, /* request completed conditionally */456FC_SPP_RESP_MULT = 7, /* unable to handle multiple SPPs */457FC_SPP_RESP_INVL = 8, /* SPP is invalid */458};459460/*461* ELS_RRQ - Reinstate Recovery Qualifier462*/463struct fc_els_rrq {464__u8 rrq_cmd; /* command (0x12) */465__u8 rrq_zero[3]; /* specified as zero - part of cmd */466__u8 rrq_resvd; /* reserved */467__u8 rrq_s_id[3]; /* originator FID */468__be16 rrq_ox_id; /* originator exchange ID */469__be16 rrq_rx_id; /* responders exchange ID */470};471472/*473* ELS_REC - Read exchange concise.474*/475struct fc_els_rec {476__u8 rec_cmd; /* command (0x13) */477__u8 rec_zero[3]; /* specified as zero - part of cmd */478__u8 rec_resvd; /* reserved */479__u8 rec_s_id[3]; /* originator FID */480__be16 rec_ox_id; /* originator exchange ID */481__be16 rec_rx_id; /* responders exchange ID */482};483484/*485* ELS_REC LS_ACC payload.486*/487struct fc_els_rec_acc {488__u8 reca_cmd; /* accept (0x02) */489__u8 reca_zero[3]; /* specified as zero - part of cmd */490__be16 reca_ox_id; /* originator exchange ID */491__be16 reca_rx_id; /* responders exchange ID */492__u8 reca_resvd1; /* reserved */493__u8 reca_ofid[3]; /* originator FID */494__u8 reca_resvd2; /* reserved */495__u8 reca_rfid[3]; /* responder FID */496__be32 reca_fc4value; /* FC4 value */497__be32 reca_e_stat; /* ESB (exchange status block) status */498};499500/*501* ELS_PRLI - Process login request and response.502*/503struct fc_els_prli {504__u8 prli_cmd; /* command */505__u8 prli_spp_len; /* length of each serv. parm. page */506__be16 prli_len; /* length of entire payload */507/* service parameter pages follow */508};509510/*511* ELS_PRLO - Process logout request and response.512*/513struct fc_els_prlo {514__u8 prlo_cmd; /* command */515__u8 prlo_obs; /* obsolete, but shall be set to 10h */516__be16 prlo_len; /* payload length */517};518519/*520* ELS_ADISC payload521*/522struct fc_els_adisc {523__u8 adisc_cmd;524__u8 adisc_resv[3];525__u8 adisc_resv1;526__u8 adisc_hard_addr[3];527__be64 adisc_wwpn;528__be64 adisc_wwnn;529__u8 adisc_resv2;530__u8 adisc_port_id[3];531} __attribute__((__packed__));532533/*534* ELS_LOGO - process or fabric logout.535*/536struct fc_els_logo {537__u8 fl_cmd; /* command code */538__u8 fl_zero[3]; /* specified as zero - part of cmd */539__u8 fl_resvd; /* reserved */540__u8 fl_n_port_id[3];/* N port ID */541__be64 fl_n_port_wwn; /* port name */542};543544/*545* ELS_RTV - read timeout value.546*/547struct fc_els_rtv {548__u8 rtv_cmd; /* command code 0x0e */549__u8 rtv_zero[3]; /* specified as zero - part of cmd */550};551552/*553* LS_ACC for ELS_RTV - read timeout value.554*/555struct fc_els_rtv_acc {556__u8 rtv_cmd; /* command code 0x02 */557__u8 rtv_zero[3]; /* specified as zero - part of cmd */558__be32 rtv_r_a_tov; /* resource allocation timeout value */559__be32 rtv_e_d_tov; /* error detection timeout value */560__be32 rtv_toq; /* timeout qualifier (see below) */561};562563/*564* rtv_toq bits.565*/566#define FC_ELS_RTV_EDRES (1 << 26) /* E_D_TOV resolution is nS else mS */567#define FC_ELS_RTV_RTTOV (1 << 19) /* R_T_TOV is 100 uS else 100 mS */568569/*570* ELS_SCR - state change registration payload.571*/572struct fc_els_scr {573__u8 scr_cmd; /* command code */574__u8 scr_resv[6]; /* reserved */575__u8 scr_reg_func; /* registration function (see below) */576};577578enum fc_els_scr_func {579ELS_SCRF_FAB = 1, /* fabric-detected registration */580ELS_SCRF_NPORT = 2, /* Nx_Port-detected registration */581ELS_SCRF_FULL = 3, /* full registration */582ELS_SCRF_CLEAR = 255, /* remove any current registrations */583};584585/*586* ELS_RSCN - registered state change notification payload.587*/588struct fc_els_rscn {589__u8 rscn_cmd; /* RSCN opcode (0x61) */590__u8 rscn_page_len; /* page length (4) */591__be16 rscn_plen; /* payload length including this word */592593/* followed by 4-byte generic affected Port_ID pages */594};595596struct fc_els_rscn_page {597__u8 rscn_page_flags; /* event and address format */598__u8 rscn_fid[3]; /* fabric ID */599};600601#define ELS_RSCN_EV_QUAL_BIT 2 /* shift count for event qualifier */602#define ELS_RSCN_EV_QUAL_MASK 0xf /* mask for event qualifier */603#define ELS_RSCN_ADDR_FMT_BIT 0 /* shift count for address format */604#define ELS_RSCN_ADDR_FMT_MASK 0x3 /* mask for address format */605606enum fc_els_rscn_ev_qual {607ELS_EV_QUAL_NONE = 0, /* unspecified */608ELS_EV_QUAL_NS_OBJ = 1, /* changed name server object */609ELS_EV_QUAL_PORT_ATTR = 2, /* changed port attribute */610ELS_EV_QUAL_SERV_OBJ = 3, /* changed service object */611ELS_EV_QUAL_SW_CONFIG = 4, /* changed switch configuration */612ELS_EV_QUAL_REM_OBJ = 5, /* removed object */613};614615enum fc_els_rscn_addr_fmt {616ELS_ADDR_FMT_PORT = 0, /* rscn_fid is a port address */617ELS_ADDR_FMT_AREA = 1, /* rscn_fid is a area address */618ELS_ADDR_FMT_DOM = 2, /* rscn_fid is a domain address */619ELS_ADDR_FMT_FAB = 3, /* anything on fabric may have changed */620};621622/*623* ELS_RNID - request Node ID.624*/625struct fc_els_rnid {626__u8 rnid_cmd; /* RNID opcode (0x78) */627__u8 rnid_resv[3]; /* reserved */628__u8 rnid_fmt; /* data format */629__u8 rnid_resv2[3]; /* reserved */630};631632/*633* Node Identification Data formats (rnid_fmt)634*/635enum fc_els_rnid_fmt {636ELS_RNIDF_NONE = 0, /* no specific identification data */637ELS_RNIDF_GEN = 0xdf, /* general topology discovery format */638};639640/*641* ELS_RNID response.642*/643struct fc_els_rnid_resp {644__u8 rnid_cmd; /* response code (LS_ACC) */645__u8 rnid_resv[3]; /* reserved */646__u8 rnid_fmt; /* data format */647__u8 rnid_cid_len; /* common ID data length */648__u8 rnid_resv2; /* reserved */649__u8 rnid_sid_len; /* specific ID data length */650};651652struct fc_els_rnid_cid {653__be64 rnid_wwpn; /* N port name */654__be64 rnid_wwnn; /* node name */655};656657struct fc_els_rnid_gen {658__u8 rnid_vend_id[16]; /* vendor-unique ID */659__be32 rnid_atype; /* associated type (see below) */660__be32 rnid_phys_port; /* physical port number */661__be32 rnid_att_nodes; /* number of attached nodes */662__u8 rnid_node_mgmt; /* node management (see below) */663__u8 rnid_ip_ver; /* IP version (see below) */664__be16 rnid_prot_port; /* UDP / TCP port number */665__be32 rnid_ip_addr[4]; /* IP address */666__u8 rnid_resvd[2]; /* reserved */667__be16 rnid_vend_spec; /* vendor-specific field */668};669670enum fc_els_rnid_atype {671ELS_RNIDA_UNK = 0x01, /* unknown */672ELS_RNIDA_OTHER = 0x02, /* none of the following */673ELS_RNIDA_HUB = 0x03,674ELS_RNIDA_SWITCH = 0x04,675ELS_RNIDA_GATEWAY = 0x05,676ELS_RNIDA_CONV = 0x06, /* Obsolete, do not use this value */677ELS_RNIDA_HBA = 0x07, /* Obsolete, do not use this value */678ELS_RNIDA_PROXY = 0x08, /* Obsolete, do not use this value */679ELS_RNIDA_STORAGE = 0x09,680ELS_RNIDA_HOST = 0x0a,681ELS_RNIDA_SUBSYS = 0x0b, /* storage subsystem (e.g., RAID) */682ELS_RNIDA_ACCESS = 0x0e, /* access device (e.g. media changer) */683ELS_RNIDA_NAS = 0x11, /* NAS server */684ELS_RNIDA_BRIDGE = 0x12, /* bridge */685ELS_RNIDA_VIRT = 0x13, /* virtualization device */686ELS_RNIDA_MF = 0xff, /* multifunction device (bits below) */687ELS_RNIDA_MF_HUB = 1UL << 31, /* hub */688ELS_RNIDA_MF_SW = 1UL << 30, /* switch */689ELS_RNIDA_MF_GW = 1UL << 29, /* gateway */690ELS_RNIDA_MF_ST = 1UL << 28, /* storage */691ELS_RNIDA_MF_HOST = 1UL << 27, /* host */692ELS_RNIDA_MF_SUB = 1UL << 26, /* storage subsystem */693ELS_RNIDA_MF_ACC = 1UL << 25, /* storage access dev */694ELS_RNIDA_MF_WDM = 1UL << 24, /* wavelength division mux */695ELS_RNIDA_MF_NAS = 1UL << 23, /* NAS server */696ELS_RNIDA_MF_BR = 1UL << 22, /* bridge */697ELS_RNIDA_MF_VIRT = 1UL << 21, /* virtualization device */698};699700enum fc_els_rnid_mgmt {701ELS_RNIDM_SNMP = 0,702ELS_RNIDM_TELNET = 1,703ELS_RNIDM_HTTP = 2,704ELS_RNIDM_HTTPS = 3,705ELS_RNIDM_XML = 4, /* HTTP + XML */706};707708enum fc_els_rnid_ipver {709ELS_RNIDIP_NONE = 0, /* no IP support or node mgmt. */710ELS_RNIDIP_V4 = 1, /* IPv4 */711ELS_RNIDIP_V6 = 2, /* IPv6 */712};713714/*715* ELS RPL - Read Port List.716*/717struct fc_els_rpl {718__u8 rpl_cmd; /* command */719__u8 rpl_resv[5]; /* reserved - must be zero */720__be16 rpl_max_size; /* maximum response size or zero */721__u8 rpl_resv1; /* reserved - must be zero */722__u8 rpl_index[3]; /* starting index */723};724725/*726* Port number block in RPL response.727*/728struct fc_els_pnb {729__be32 pnb_phys_pn; /* physical port number */730__u8 pnb_resv; /* reserved */731__u8 pnb_port_id[3]; /* port ID */732__be64 pnb_wwpn; /* port name */733};734735/*736* RPL LS_ACC response.737*/738struct fc_els_rpl_resp {739__u8 rpl_cmd; /* ELS_LS_ACC */740__u8 rpl_resv1; /* reserved - must be zero */741__be16 rpl_plen; /* payload length */742__u8 rpl_resv2; /* reserved - must be zero */743__u8 rpl_llen[3]; /* list length */744__u8 rpl_resv3; /* reserved - must be zero */745__u8 rpl_index[3]; /* starting index */746struct fc_els_pnb rpl_pnb[1]; /* variable number of PNBs */747};748749/*750* Link Error Status Block.751*/752struct fc_els_lesb {753__be32 lesb_link_fail; /* link failure count */754__be32 lesb_sync_loss; /* loss of synchronization count */755__be32 lesb_sig_loss; /* loss of signal count */756__be32 lesb_prim_err; /* primitive sequence error count */757__be32 lesb_inv_word; /* invalid transmission word count */758__be32 lesb_inv_crc; /* invalid CRC count */759};760761/*762* ELS RPS - Read Port Status Block request.763*/764struct fc_els_rps {765__u8 rps_cmd; /* command */766__u8 rps_resv[2]; /* reserved - must be zero */767__u8 rps_flag; /* flag - see below */768__be64 rps_port_spec; /* port selection */769};770771enum fc_els_rps_flag {772FC_ELS_RPS_DID = 0x00, /* port identified by D_ID of req. */773FC_ELS_RPS_PPN = 0x01, /* port_spec is physical port number */774FC_ELS_RPS_WWPN = 0x02, /* port_spec is port WWN */775};776777/*778* ELS RPS LS_ACC response.779*/780struct fc_els_rps_resp {781__u8 rps_cmd; /* command - LS_ACC */782__u8 rps_resv[2]; /* reserved - must be zero */783__u8 rps_flag; /* flag - see below */784__u8 rps_resv2[2]; /* reserved */785__be16 rps_status; /* port status - see below */786struct fc_els_lesb rps_lesb; /* link error status block */787};788789enum fc_els_rps_resp_flag {790FC_ELS_RPS_LPEV = 0x01, /* L_port extension valid */791};792793enum fc_els_rps_resp_status {794FC_ELS_RPS_PTP = 1 << 5, /* point-to-point connection */795FC_ELS_RPS_LOOP = 1 << 4, /* loop mode */796FC_ELS_RPS_FAB = 1 << 3, /* fabric present */797FC_ELS_RPS_NO_SIG = 1 << 2, /* loss of signal */798FC_ELS_RPS_NO_SYNC = 1 << 1, /* loss of synchronization */799FC_ELS_RPS_RESET = 1 << 0, /* in link reset protocol */800};801802/*803* ELS LIRR - Link Incident Record Registration request.804*/805struct fc_els_lirr {806__u8 lirr_cmd; /* command */807__u8 lirr_resv[3]; /* reserved - must be zero */808__u8 lirr_func; /* registration function */809__u8 lirr_fmt; /* FC-4 type of RLIR requested */810__u8 lirr_resv2[2]; /* reserved - must be zero */811};812813enum fc_els_lirr_func {814ELS_LIRR_SET_COND = 0x01, /* set - conditionally receive */815ELS_LIRR_SET_UNCOND = 0x02, /* set - unconditionally receive */816ELS_LIRR_CLEAR = 0xff /* clear registration */817};818819/*820* ELS SRL - Scan Remote Loop request.821*/822struct fc_els_srl {823__u8 srl_cmd; /* command */824__u8 srl_resv[3]; /* reserved - must be zero */825__u8 srl_flag; /* flag - see below */826__u8 srl_flag_param[3]; /* flag parameter */827};828829enum fc_els_srl_flag {830FC_ELS_SRL_ALL = 0x00, /* scan all FL ports */831FC_ELS_SRL_ONE = 0x01, /* scan specified loop */832FC_ELS_SRL_EN_PER = 0x02, /* enable periodic scanning (param) */833FC_ELS_SRL_DIS_PER = 0x03, /* disable periodic scanning */834};835836/*837* ELS RLS - Read Link Error Status Block request.838*/839struct fc_els_rls {840__u8 rls_cmd; /* command */841__u8 rls_resv[4]; /* reserved - must be zero */842__u8 rls_port_id[3]; /* port ID */843};844845/*846* ELS RLS LS_ACC Response.847*/848struct fc_els_rls_resp {849__u8 rls_cmd; /* ELS_LS_ACC */850__u8 rls_resv[3]; /* reserved - must be zero */851struct fc_els_lesb rls_lesb; /* link error status block */852};853854/*855* ELS RLIR - Registered Link Incident Report.856* This is followed by the CLIR and the CLID, described below.857*/858struct fc_els_rlir {859__u8 rlir_cmd; /* command */860__u8 rlir_resv[3]; /* reserved - must be zero */861__u8 rlir_fmt; /* format (FC4-type if type specific) */862__u8 rlir_clr_len; /* common link incident record length */863__u8 rlir_cld_len; /* common link incident desc. length */864__u8 rlir_slr_len; /* spec. link incident record length */865};866867/*868* CLIR - Common Link Incident Record Data. - Sent via RLIR.869*/870struct fc_els_clir {871__be64 clir_wwpn; /* incident port name */872__be64 clir_wwnn; /* incident port node name */873__u8 clir_port_type; /* incident port type */874__u8 clir_port_id[3]; /* incident port ID */875876__be64 clir_conn_wwpn; /* connected port name */877__be64 clir_conn_wwnn; /* connected node name */878__be64 clir_fab_name; /* fabric name */879__be32 clir_phys_port; /* physical port number */880__be32 clir_trans_id; /* transaction ID */881__u8 clir_resv[3]; /* reserved */882__u8 clir_ts_fmt; /* time stamp format */883__be64 clir_timestamp; /* time stamp */884};885886/*887* CLIR clir_ts_fmt - time stamp format values.888*/889enum fc_els_clir_ts_fmt {890ELS_CLIR_TS_UNKNOWN = 0, /* time stamp field unknown */891ELS_CLIR_TS_SEC_FRAC = 1, /* time in seconds and fractions */892ELS_CLIR_TS_CSU = 2, /* time in clock synch update format */893};894895/*896* Common Link Incident Descriptor - sent via RLIR.897*/898struct fc_els_clid {899__u8 clid_iq; /* incident qualifier flags */900__u8 clid_ic; /* incident code */901__be16 clid_epai; /* domain/area of ISL */902};903904/*905* CLID incident qualifier flags.906*/907enum fc_els_clid_iq {908ELS_CLID_SWITCH = 0x20, /* incident port is a switch node */909ELS_CLID_E_PORT = 0x10, /* incident is an ISL (E) port */910ELS_CLID_SEV_MASK = 0x0c, /* severity 2-bit field mask */911ELS_CLID_SEV_INFO = 0x00, /* report is informational */912ELS_CLID_SEV_INOP = 0x08, /* link not operational */913ELS_CLID_SEV_DEG = 0x04, /* link degraded but operational */914ELS_CLID_LASER = 0x02, /* subassembly is a laser */915ELS_CLID_FRU = 0x01, /* format can identify a FRU */916};917918/*919* CLID incident code.920*/921enum fc_els_clid_ic {922ELS_CLID_IC_IMPL = 1, /* implicit incident */923ELS_CLID_IC_BER = 2, /* bit-error-rate threshold exceeded */924ELS_CLID_IC_LOS = 3, /* loss of synch or signal */925ELS_CLID_IC_NOS = 4, /* non-operational primitive sequence */926ELS_CLID_IC_PST = 5, /* primitive sequence timeout */927ELS_CLID_IC_INVAL = 6, /* invalid primitive sequence */928ELS_CLID_IC_LOOP_TO = 7, /* loop initialization time out */929ELS_CLID_IC_LIP = 8, /* receiving LIP */930};931932/*933* Link Integrity event types934*/935enum fc_fpin_li_event_types {936FPIN_LI_UNKNOWN = 0x0,937FPIN_LI_LINK_FAILURE = 0x1,938FPIN_LI_LOSS_OF_SYNC = 0x2,939FPIN_LI_LOSS_OF_SIG = 0x3,940FPIN_LI_PRIM_SEQ_ERR = 0x4,941FPIN_LI_INVALID_TX_WD = 0x5,942FPIN_LI_INVALID_CRC = 0x6,943FPIN_LI_DEVICE_SPEC = 0xF,944};945946/*947* Initializer useful for decoding table.948* Please keep this in sync with the above definitions.949*/950#define FC_FPIN_LI_EVT_TYPES_INIT { \951{ FPIN_LI_UNKNOWN, "Unknown" }, \952{ FPIN_LI_LINK_FAILURE, "Link Failure" }, \953{ FPIN_LI_LOSS_OF_SYNC, "Loss of Synchronization" }, \954{ FPIN_LI_LOSS_OF_SIG, "Loss of Signal" }, \955{ FPIN_LI_PRIM_SEQ_ERR, "Primitive Sequence Protocol Error" }, \956{ FPIN_LI_INVALID_TX_WD, "Invalid Transmission Word" }, \957{ FPIN_LI_INVALID_CRC, "Invalid CRC" }, \958{ FPIN_LI_DEVICE_SPEC, "Device Specific" }, \959}960961/*962* Delivery event types963*/964enum fc_fpin_deli_event_types {965FPIN_DELI_UNKNOWN = 0x0,966FPIN_DELI_TIMEOUT = 0x1,967FPIN_DELI_UNABLE_TO_ROUTE = 0x2,968FPIN_DELI_DEVICE_SPEC = 0xF,969};970971/*972* Initializer useful for decoding table.973* Please keep this in sync with the above definitions.974*/975#define FC_FPIN_DELI_EVT_TYPES_INIT { \976{ FPIN_DELI_UNKNOWN, "Unknown" }, \977{ FPIN_DELI_TIMEOUT, "Timeout" }, \978{ FPIN_DELI_UNABLE_TO_ROUTE, "Unable to Route" }, \979{ FPIN_DELI_DEVICE_SPEC, "Device Specific" }, \980}981982/*983* Congestion event types984*/985enum fc_fpin_congn_event_types {986FPIN_CONGN_CLEAR = 0x0,987FPIN_CONGN_LOST_CREDIT = 0x1,988FPIN_CONGN_CREDIT_STALL = 0x2,989FPIN_CONGN_OVERSUBSCRIPTION = 0x3,990FPIN_CONGN_DEVICE_SPEC = 0xF,991};992993/*994* Initializer useful for decoding table.995* Please keep this in sync with the above definitions.996*/997#define FC_FPIN_CONGN_EVT_TYPES_INIT { \998{ FPIN_CONGN_CLEAR, "Clear" }, \999{ FPIN_CONGN_LOST_CREDIT, "Lost Credit" }, \1000{ FPIN_CONGN_CREDIT_STALL, "Credit Stall" }, \1001{ FPIN_CONGN_OVERSUBSCRIPTION, "Oversubscription" }, \1002{ FPIN_CONGN_DEVICE_SPEC, "Device Specific" }, \1003}10041005enum fc_fpin_congn_severity_types {1006FPIN_CONGN_SEVERITY_WARNING = 0xF1,1007FPIN_CONGN_SEVERITY_ERROR = 0xF7,1008};10091010/*1011* Link Integrity Notification Descriptor1012*/1013struct fc_fn_li_desc {1014__be32 desc_tag; /* Descriptor Tag (0x00020001) */1015__be32 desc_len; /* Length of Descriptor (in bytes).1016* Size of descriptor excluding1017* desc_tag and desc_len fields.1018*/1019__be64 detecting_wwpn; /* Port Name that detected event */1020__be64 attached_wwpn; /* Port Name of device attached to1021* detecting Port Name1022*/1023__be16 event_type; /* see enum fc_fpin_li_event_types */1024__be16 event_modifier; /* Implementation specific value1025* describing the event type1026*/1027__be32 event_threshold;/* duration in ms of the link1028* integrity detection cycle1029*/1030__be32 event_count; /* minimum number of event1031* occurrences during the event1032* threshold to caause the LI event1033*/1034__be32 pname_count; /* number of portname_list elements */1035__be64 pname_list[]; /* list of N_Port_Names accessible1036* through the attached port1037*/1038};10391040/*1041* Delivery Notification Descriptor1042*/1043struct fc_fn_deli_desc {1044__be32 desc_tag; /* Descriptor Tag (0x00020002) */1045__be32 desc_len; /* Length of Descriptor (in bytes).1046* Size of descriptor excluding1047* desc_tag and desc_len fields.1048*/1049__be64 detecting_wwpn; /* Port Name that detected event */1050__be64 attached_wwpn; /* Port Name of device attached to1051* detecting Port Name1052*/1053__be32 deli_reason_code;/* see enum fc_fpin_deli_event_types */1054};10551056/*1057* Peer Congestion Notification Descriptor1058*/1059struct fc_fn_peer_congn_desc {1060__be32 desc_tag; /* Descriptor Tag (0x00020003) */1061__be32 desc_len; /* Length of Descriptor (in bytes).1062* Size of descriptor excluding1063* desc_tag and desc_len fields.1064*/1065__be64 detecting_wwpn; /* Port Name that detected event */1066__be64 attached_wwpn; /* Port Name of device attached to1067* detecting Port Name1068*/1069__be16 event_type; /* see enum fc_fpin_congn_event_types */1070__be16 event_modifier; /* Implementation specific value1071* describing the event type1072*/1073__be32 event_period; /* duration (ms) of the detected1074* congestion event1075*/1076__be32 pname_count; /* number of portname_list elements */1077__be64 pname_list[]; /* list of N_Port_Names accessible1078* through the attached port1079*/1080};10811082/*1083* Congestion Notification Descriptor1084*/1085struct fc_fn_congn_desc {1086__be32 desc_tag; /* Descriptor Tag (0x00020004) */1087__be32 desc_len; /* Length of Descriptor (in bytes).1088* Size of descriptor excluding1089* desc_tag and desc_len fields.1090*/1091__be16 event_type; /* see enum fc_fpin_congn_event_types */1092__be16 event_modifier; /* Implementation specific value1093* describing the event type1094*/1095__be32 event_period; /* duration (ms) of the detected1096* congestion event1097*/1098__u8 severity; /* command */1099__u8 resv[3]; /* reserved - must be zero */1100};11011102/*1103* ELS_FPIN - Fabric Performance Impact Notification1104*/1105struct fc_els_fpin {1106__u8 fpin_cmd; /* command (0x16) */1107__u8 fpin_zero[3]; /* specified as zero - part of cmd */1108__be32 desc_len; /* Length of Descriptor List (in bytes).1109* Size of ELS excluding fpin_cmd,1110* fpin_zero and desc_len fields.1111*/1112struct fc_tlv_desc fpin_desc[]; /* Descriptor list */1113};11141115/* Diagnostic Function Descriptor - FPIN Registration */1116struct fc_df_desc_fpin_reg {1117/* New members MUST be added within the __struct_group() macro below. */1118__struct_group(fc_df_desc_fpin_reg_hdr, __hdr, /* no attrs */,1119__be32 desc_tag; /* FPIN Registration (0x00030001) */1120__be32 desc_len; /* Length of Descriptor (in bytes).1121* Size of descriptor excluding1122* desc_tag and desc_len fields.1123*/1124__be32 count; /* Number of desc_tags elements */1125);1126__be32 desc_tags[]; /* Array of Descriptor Tags.1127* Each tag indicates a function1128* supported by the N_Port (request)1129* or by the N_Port and Fabric1130* Controller (reply; may be a subset1131* of the request).1132* See ELS_FN_DTAG_xxx for tag values.1133*/1134};1135_Static_assert(offsetof(struct fc_df_desc_fpin_reg, desc_tags) == sizeof(struct fc_df_desc_fpin_reg_hdr),1136"struct member likely outside of __struct_group()");11371138/*1139* ELS_RDF - Register Diagnostic Functions1140*/1141struct fc_els_rdf {1142/* New members MUST be added within the __struct_group() macro below. */1143__struct_group(fc_els_rdf_hdr, __hdr, /* no attrs */,1144__u8 fpin_cmd; /* command (0x19) */1145__u8 fpin_zero[3]; /* specified as zero - part of cmd */1146__be32 desc_len; /* Length of Descriptor List (in bytes).1147* Size of ELS excluding fpin_cmd,1148* fpin_zero and desc_len fields.1149*/1150);1151struct fc_tlv_desc desc[]; /* Descriptor list */1152};1153_Static_assert(offsetof(struct fc_els_rdf, desc) == sizeof(struct fc_els_rdf_hdr),1154"struct member likely outside of __struct_group()");11551156/*1157* ELS RDF LS_ACC Response.1158*/1159struct fc_els_rdf_resp {1160/* New members MUST be added within the __struct_group() macro below. */1161__struct_group(fc_els_rdf_resp_hdr, __hdr, /* no attrs */,1162struct fc_els_ls_acc acc_hdr;1163__be32 desc_list_len; /* Length of response (in1164* bytes). Excludes acc_hdr1165* and desc_list_len fields.1166*/1167struct fc_els_lsri_desc lsri;1168);1169struct fc_tlv_desc desc[]; /* Supported Descriptor list */1170};1171_Static_assert(offsetof(struct fc_els_rdf_resp, desc) == sizeof(struct fc_els_rdf_resp_hdr),1172"struct member likely outside of __struct_group()");11731174/*1175* Diagnostic Capability Descriptors for EDC ELS1176*/11771178/*1179* Diagnostic: Link Fault Capability Descriptor1180*/1181struct fc_diag_lnkflt_desc {1182__be32 desc_tag; /* Descriptor Tag (0x0001000D) */1183__be32 desc_len; /* Length of Descriptor (in bytes).1184* Size of descriptor excluding1185* desc_tag and desc_len fields.1186* 12 bytes1187*/1188__be32 degrade_activate_threshold;1189__be32 degrade_deactivate_threshold;1190__be32 fec_degrade_interval;1191};11921193enum fc_edc_cg_signal_cap_types {1194/* Note: Capability: bits 31:4 Rsvd; bits 3:0 are capabilities */1195EDC_CG_SIG_NOTSUPPORTED = 0x00, /* neither supported */1196EDC_CG_SIG_WARN_ONLY = 0x01,1197EDC_CG_SIG_WARN_ALARM = 0x02, /* both supported */1198};11991200/*1201* Initializer useful for decoding table.1202* Please keep this in sync with the above definitions.1203*/1204#define FC_EDC_CG_SIGNAL_CAP_TYPES_INIT { \1205{ EDC_CG_SIG_NOTSUPPORTED, "Signaling Not Supported" }, \1206{ EDC_CG_SIG_WARN_ONLY, "Warning Signal" }, \1207{ EDC_CG_SIG_WARN_ALARM, "Warning and Alarm Signals" }, \1208}12091210enum fc_diag_cg_sig_freq_types {1211EDC_CG_SIGFREQ_CNT_MIN = 1, /* Min Frequency Count */1212EDC_CG_SIGFREQ_CNT_MAX = 999, /* Max Frequency Count */12131214EDC_CG_SIGFREQ_SEC = 0x1, /* Units: seconds */1215EDC_CG_SIGFREQ_MSEC = 0x2, /* Units: milliseconds */1216};12171218struct fc_diag_cg_sig_freq {1219__be16 count; /* Time between signals1220* note: upper 6 bits rsvd1221*/1222__be16 units; /* Time unit for count1223* note: upper 12 bits rsvd1224*/1225};12261227/*1228* Diagnostic: Congestion Signaling Capability Descriptor1229*/1230struct fc_diag_cg_sig_desc {1231__be32 desc_tag; /* Descriptor Tag (0x0001000F) */1232__be32 desc_len; /* Length of Descriptor (in bytes).1233* Size of descriptor excluding1234* desc_tag and desc_len fields.1235* 16 bytes1236*/1237__be32 xmt_signal_capability;1238struct fc_diag_cg_sig_freq xmt_signal_frequency;1239__be32 rcv_signal_capability;1240struct fc_diag_cg_sig_freq rcv_signal_frequency;1241};12421243/*1244* ELS_EDC - Exchange Diagnostic Capabilities1245*/1246struct fc_els_edc {1247__u8 edc_cmd; /* command (0x17) */1248__u8 edc_zero[3]; /* specified as zero - part of cmd */1249__be32 desc_len; /* Length of Descriptor List (in bytes).1250* Size of ELS excluding edc_cmd,1251* edc_zero and desc_len fields.1252*/1253struct fc_tlv_desc desc[];1254/* Diagnostic Descriptor list */1255};12561257/*1258* ELS EDC LS_ACC Response.1259*/1260struct fc_els_edc_resp {1261struct fc_els_ls_acc acc_hdr;1262__be32 desc_list_len; /* Length of response (in1263* bytes). Excludes acc_hdr1264* and desc_list_len fields.1265*/1266struct fc_els_lsri_desc lsri;1267struct fc_tlv_desc desc[];1268/* Supported Diagnostic Descriptor list */1269};127012711272#endif /* _FC_ELS_H_ */127312741275