/* 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/*14* Fibre Channel Switch - Enhanced Link Services definitions.15* From T11 FC-LS Rev 1.2 June 7, 2005.16*/1718/*19* ELS Command codes - byte 0 of the frame payload20*/21enum fc_els_cmd {22ELS_LS_RJT = 0x01, /* ESL reject */23ELS_LS_ACC = 0x02, /* ESL Accept */24ELS_PLOGI = 0x03, /* N_Port login */25ELS_FLOGI = 0x04, /* F_Port login */26ELS_LOGO = 0x05, /* Logout */27ELS_ABTX = 0x06, /* Abort exchange - obsolete */28ELS_RCS = 0x07, /* read connection status */29ELS_RES = 0x08, /* read exchange status block */30ELS_RSS = 0x09, /* read sequence status block */31ELS_RSI = 0x0a, /* read sequence initiative */32ELS_ESTS = 0x0b, /* establish streaming */33ELS_ESTC = 0x0c, /* estimate credit */34ELS_ADVC = 0x0d, /* advise credit */35ELS_RTV = 0x0e, /* read timeout value */36ELS_RLS = 0x0f, /* read link error status block */37ELS_ECHO = 0x10, /* echo */38ELS_TEST = 0x11, /* test */39ELS_RRQ = 0x12, /* reinstate recovery qualifier */40ELS_REC = 0x13, /* read exchange concise */41ELS_SRR = 0x14, /* sequence retransmission request */42ELS_FPIN = 0x16, /* Fabric Performance Impact Notification */43ELS_EDC = 0x17, /* Exchange Diagnostic Capabilities */44ELS_RDP = 0x18, /* Read Diagnostic Parameters */45ELS_RDF = 0x19, /* Register Diagnostic Functions */46ELS_PRLI = 0x20, /* process login */47ELS_PRLO = 0x21, /* process logout */48ELS_SCN = 0x22, /* state change notification */49ELS_TPLS = 0x23, /* test process login state */50ELS_TPRLO = 0x24, /* third party process logout */51ELS_LCLM = 0x25, /* login control list mgmt (obs) */52ELS_GAID = 0x30, /* get alias_ID */53ELS_FACT = 0x31, /* fabric activate alias_id */54ELS_FDACDT = 0x32, /* fabric deactivate alias_id */55ELS_NACT = 0x33, /* N-port activate alias_id */56ELS_NDACT = 0x34, /* N-port deactivate alias_id */57ELS_QOSR = 0x40, /* quality of service request */58ELS_RVCS = 0x41, /* read virtual circuit status */59ELS_PDISC = 0x50, /* discover N_port service params */60ELS_FDISC = 0x51, /* discover F_port service params */61ELS_ADISC = 0x52, /* discover address */62ELS_RNC = 0x53, /* report node cap (obs) */63ELS_FARP_REQ = 0x54, /* FC ARP request */64ELS_FARP_REPL = 0x55, /* FC ARP reply */65ELS_RPS = 0x56, /* read port status block */66ELS_RPL = 0x57, /* read port list */67ELS_RPBC = 0x58, /* read port buffer condition */68ELS_FAN = 0x60, /* fabric address notification */69ELS_RSCN = 0x61, /* registered state change notification */70ELS_SCR = 0x62, /* state change registration */71ELS_RNFT = 0x63, /* report node FC-4 types */72ELS_CSR = 0x68, /* clock synch. request */73ELS_CSU = 0x69, /* clock synch. update */74ELS_LINIT = 0x70, /* loop initialize */75ELS_LSTS = 0x72, /* loop status */76ELS_RNID = 0x78, /* request node ID data */77ELS_RLIR = 0x79, /* registered link incident report */78ELS_LIRR = 0x7a, /* link incident record registration */79ELS_SRL = 0x7b, /* scan remote loop */80ELS_SBRP = 0x7c, /* set bit-error reporting params */81ELS_RPSC = 0x7d, /* report speed capabilities */82ELS_QSA = 0x7e, /* query security attributes */83ELS_EVFP = 0x7f, /* exchange virt. fabrics params */84ELS_LKA = 0x80, /* link keep-alive */85ELS_AUTH_ELS = 0x90, /* authentication ELS */86};8788/*89* Initializer useful for decoding table.90* Please keep this in sync with the above definitions.91*/92#define FC_ELS_CMDS_INIT { \93[ELS_LS_RJT] = "LS_RJT", \94[ELS_LS_ACC] = "LS_ACC", \95[ELS_PLOGI] = "PLOGI", \96[ELS_FLOGI] = "FLOGI", \97[ELS_LOGO] = "LOGO", \98[ELS_ABTX] = "ABTX", \99[ELS_RCS] = "RCS", \100[ELS_RES] = "RES", \101[ELS_RSS] = "RSS", \102[ELS_RSI] = "RSI", \103[ELS_ESTS] = "ESTS", \104[ELS_ESTC] = "ESTC", \105[ELS_ADVC] = "ADVC", \106[ELS_RTV] = "RTV", \107[ELS_RLS] = "RLS", \108[ELS_ECHO] = "ECHO", \109[ELS_TEST] = "TEST", \110[ELS_RRQ] = "RRQ", \111[ELS_REC] = "REC", \112[ELS_SRR] = "SRR", \113[ELS_FPIN] = "FPIN", \114[ELS_EDC] = "EDC", \115[ELS_RDP] = "RDP", \116[ELS_RDF] = "RDF", \117[ELS_PRLI] = "PRLI", \118[ELS_PRLO] = "PRLO", \119[ELS_SCN] = "SCN", \120[ELS_TPLS] = "TPLS", \121[ELS_TPRLO] = "TPRLO", \122[ELS_LCLM] = "LCLM", \123[ELS_GAID] = "GAID", \124[ELS_FACT] = "FACT", \125[ELS_FDACDT] = "FDACDT", \126[ELS_NACT] = "NACT", \127[ELS_NDACT] = "NDACT", \128[ELS_QOSR] = "QOSR", \129[ELS_RVCS] = "RVCS", \130[ELS_PDISC] = "PDISC", \131[ELS_FDISC] = "FDISC", \132[ELS_ADISC] = "ADISC", \133[ELS_RNC] = "RNC", \134[ELS_FARP_REQ] = "FARP_REQ", \135[ELS_FARP_REPL] = "FARP_REPL", \136[ELS_RPS] = "RPS", \137[ELS_RPL] = "RPL", \138[ELS_RPBC] = "RPBC", \139[ELS_FAN] = "FAN", \140[ELS_RSCN] = "RSCN", \141[ELS_SCR] = "SCR", \142[ELS_RNFT] = "RNFT", \143[ELS_CSR] = "CSR", \144[ELS_CSU] = "CSU", \145[ELS_LINIT] = "LINIT", \146[ELS_LSTS] = "LSTS", \147[ELS_RNID] = "RNID", \148[ELS_RLIR] = "RLIR", \149[ELS_LIRR] = "LIRR", \150[ELS_SRL] = "SRL", \151[ELS_SBRP] = "SBRP", \152[ELS_RPSC] = "RPSC", \153[ELS_QSA] = "QSA", \154[ELS_EVFP] = "EVFP", \155[ELS_LKA] = "LKA", \156[ELS_AUTH_ELS] = "AUTH_ELS", \157}158159/*160* LS_ACC payload.161*/162struct fc_els_ls_acc {163__u8 la_cmd; /* command code ELS_LS_ACC */164__u8 la_resv[3]; /* reserved */165};166167/*168* ELS reject payload.169*/170struct fc_els_ls_rjt {171__u8 er_cmd; /* command code ELS_LS_RJT */172__u8 er_resv[4]; /* reserved must be zero */173__u8 er_reason; /* reason (enum fc_els_rjt_reason below) */174__u8 er_explan; /* explanation (enum fc_els_rjt_explan below) */175__u8 er_vendor; /* vendor specific code */176};177178/*179* ELS reject reason codes (er_reason).180*/181enum fc_els_rjt_reason {182ELS_RJT_NONE = 0, /* no reject - not to be sent */183ELS_RJT_INVAL = 0x01, /* invalid ELS command code */184ELS_RJT_LOGIC = 0x03, /* logical error */185ELS_RJT_BUSY = 0x05, /* logical busy */186ELS_RJT_PROT = 0x07, /* protocol error */187ELS_RJT_UNAB = 0x09, /* unable to perform command request */188ELS_RJT_UNSUP = 0x0b, /* command not supported */189ELS_RJT_INPROG = 0x0e, /* command already in progress */190ELS_RJT_FIP = 0x20, /* FIP error */191ELS_RJT_VENDOR = 0xff, /* vendor specific error */192};193194195/*196* reason code explanation (er_explan).197*/198enum fc_els_rjt_explan {199ELS_EXPL_NONE = 0x00, /* No additional explanation */200ELS_EXPL_SPP_OPT_ERR = 0x01, /* service parameter error - options */201ELS_EXPL_SPP_ICTL_ERR = 0x03, /* service parm error - initiator ctl */202ELS_EXPL_AH = 0x11, /* invalid association header */203ELS_EXPL_AH_REQ = 0x13, /* association_header required */204ELS_EXPL_SID = 0x15, /* invalid originator S_ID */205ELS_EXPL_OXID_RXID = 0x17, /* invalid OX_ID-RX_ID combination */206ELS_EXPL_INPROG = 0x19, /* Request already in progress */207ELS_EXPL_PLOGI_REQD = 0x1e, /* N_Port login required */208ELS_EXPL_INSUF_RES = 0x29, /* insufficient resources */209ELS_EXPL_UNAB_DATA = 0x2a, /* unable to supply requested data */210ELS_EXPL_UNSUPR = 0x2c, /* Request not supported */211ELS_EXPL_INV_LEN = 0x2d, /* Invalid payload length */212ELS_EXPL_NOT_NEIGHBOR = 0x62, /* VN2VN_Port not in neighbor set */213/* TBD - above definitions incomplete */214};215216/*217* Link Service TLV Descriptor Tag Values218*/219enum fc_ls_tlv_dtag {220ELS_DTAG_LS_REQ_INFO = 0x00000001,221/* Link Service Request Information Descriptor */222ELS_DTAG_LNK_FAULT_CAP = 0x0001000D,223/* Link Fault Capability Descriptor */224ELS_DTAG_CG_SIGNAL_CAP = 0x0001000F,225/* Congestion Signaling Capability Descriptor */226ELS_DTAG_LNK_INTEGRITY = 0x00020001,227/* Link Integrity Notification Descriptor */228ELS_DTAG_DELIVERY = 0x00020002,229/* Delivery Notification Descriptor */230ELS_DTAG_PEER_CONGEST = 0x00020003,231/* Peer Congestion Notification Descriptor */232ELS_DTAG_CONGESTION = 0x00020004,233/* Congestion Notification Descriptor */234ELS_DTAG_FPIN_REGISTER = 0x00030001,235/* FPIN Registration Descriptor */236};237238/*239* Initializer useful for decoding table.240* Please keep this in sync with the above definitions.241*/242#define FC_LS_TLV_DTAG_INIT { \243{ ELS_DTAG_LS_REQ_INFO, "Link Service Request Information" }, \244{ ELS_DTAG_LNK_FAULT_CAP, "Link Fault Capability" }, \245{ ELS_DTAG_CG_SIGNAL_CAP, "Congestion Signaling Capability" }, \246{ ELS_DTAG_LNK_INTEGRITY, "Link Integrity Notification" }, \247{ ELS_DTAG_DELIVERY, "Delivery Notification Present" }, \248{ ELS_DTAG_PEER_CONGEST, "Peer Congestion Notification" }, \249{ ELS_DTAG_CONGESTION, "Congestion Notification" }, \250{ ELS_DTAG_FPIN_REGISTER, "FPIN Registration" }, \251}252253254/*255* Generic Link Service TLV Descriptor format256*257* This structure, as it defines no payload, will also be referred to258* as the "tlv header" - which contains the tag and len fields.259*/260struct fc_tlv_desc {261__be32 desc_tag; /* Notification Descriptor Tag */262__be32 desc_len; /* Length of Descriptor (in bytes).263* Size of descriptor excluding264* desc_tag and desc_len fields.265*/266__u8 desc_value[]; /* Descriptor Value */267};268269/* Descriptor tag and len fields are considered the mandatory header270* for a descriptor271*/272#define FC_TLV_DESC_HDR_SZ sizeof(struct fc_tlv_desc)273274/*275* Macro, used when initializing payloads, to return the descriptor length.276* Length is size of descriptor minus the tag and len fields.277*/278#define FC_TLV_DESC_LENGTH_FROM_SZ(desc) \279(sizeof(desc) - FC_TLV_DESC_HDR_SZ)280281/* Macro, used on received payloads, to return the descriptor length */282#define FC_TLV_DESC_SZ_FROM_LENGTH(tlv) \283(__be32_to_cpu((tlv)->desc_len) + FC_TLV_DESC_HDR_SZ)284285/*286* This helper is used to walk descriptors in a descriptor list.287* Given the address of the current descriptor, which minimally contains a288* tag and len field, calculate the address of the next descriptor based289* on the len field.290*/291static inline void *fc_tlv_next_desc(void *desc)292{293struct fc_tlv_desc *tlv = desc;294295return (desc + FC_TLV_DESC_SZ_FROM_LENGTH(tlv));296}297298299/*300* Link Service Request Information Descriptor301*/302struct fc_els_lsri_desc {303__be32 desc_tag; /* descriptor tag (0x0000 0001) */304__be32 desc_len; /* Length of Descriptor (in bytes) (4).305* Size of descriptor excluding306* desc_tag and desc_len fields.307*/308struct {309__u8 cmd; /* ELS cmd byte */310__u8 bytes[3]; /* bytes 1..3 */311} rqst_w0; /* Request word 0 */312};313314315/*316* Common service parameters (N ports).317*/318struct fc_els_csp {319__u8 sp_hi_ver; /* highest version supported (obs.) */320__u8 sp_lo_ver; /* highest version supported (obs.) */321__be16 sp_bb_cred; /* buffer-to-buffer credits */322__be16 sp_features; /* common feature flags */323__be16 sp_bb_data; /* b-b state number and data field sz */324union {325struct {326__be16 _sp_tot_seq; /* total concurrent sequences */327__be16 _sp_rel_off; /* rel. offset by info cat */328} sp_plogi;329struct {330__be32 _sp_r_a_tov; /* resource alloc. timeout msec */331} sp_flogi_acc;332} sp_u;333__be32 sp_e_d_tov; /* error detect timeout value */334};335#define sp_tot_seq sp_u.sp_plogi._sp_tot_seq336#define sp_rel_off sp_u.sp_plogi._sp_rel_off337#define sp_r_a_tov sp_u.sp_flogi_acc._sp_r_a_tov338339#define FC_SP_BB_DATA_MASK 0xfff /* mask for data field size in sp_bb_data */340341/*342* Minimum and maximum values for max data field size in service parameters.343*/344#define FC_SP_MIN_MAX_PAYLOAD FC_MIN_MAX_PAYLOAD345#define FC_SP_MAX_MAX_PAYLOAD FC_MAX_PAYLOAD346347/*348* sp_features349*/350#define FC_SP_FT_NPIV 0x8000 /* multiple N_Port_ID support (FLOGI) */351#define FC_SP_FT_CIRO 0x8000 /* continuously increasing rel off (PLOGI) */352#define FC_SP_FT_CLAD 0x8000 /* clean address (in FLOGI LS_ACC) */353#define FC_SP_FT_RAND 0x4000 /* random relative offset */354#define FC_SP_FT_VAL 0x2000 /* valid vendor version level */355#define FC_SP_FT_NPIV_ACC 0x2000 /* NPIV assignment (FLOGI LS_ACC) */356#define FC_SP_FT_FPORT 0x1000 /* F port (1) vs. N port (0) */357#define FC_SP_FT_ABB 0x0800 /* alternate BB_credit management */358#define FC_SP_FT_EDTR 0x0400 /* E_D_TOV Resolution is nanoseconds */359#define FC_SP_FT_MCAST 0x0200 /* multicast */360#define FC_SP_FT_BCAST 0x0100 /* broadcast */361#define FC_SP_FT_HUNT 0x0080 /* hunt group */362#define FC_SP_FT_SIMP 0x0040 /* dedicated simplex */363#define FC_SP_FT_SEC 0x0020 /* reserved for security */364#define FC_SP_FT_CSYN 0x0010 /* clock synch. supported */365#define FC_SP_FT_RTTOV 0x0008 /* R_T_TOV value 100 uS, else 100 mS */366#define FC_SP_FT_HALF 0x0004 /* dynamic half duplex */367#define FC_SP_FT_SEQC 0x0002 /* SEQ_CNT */368#define FC_SP_FT_PAYL 0x0001 /* FLOGI payload length 256, else 116 */369370/*371* Class-specific service parameters.372*/373struct fc_els_cssp {374__be16 cp_class; /* class flags */375__be16 cp_init; /* initiator flags */376__be16 cp_recip; /* recipient flags */377__be16 cp_rdfs; /* receive data field size */378__be16 cp_con_seq; /* concurrent sequences */379__be16 cp_ee_cred; /* N-port end-to-end credit */380__u8 cp_resv1; /* reserved */381__u8 cp_open_seq; /* open sequences per exchange */382__u8 _cp_resv2[2]; /* reserved */383};384385/*386* cp_class flags.387*/388#define FC_CPC_VALID 0x8000 /* class valid */389#define FC_CPC_IMIX 0x4000 /* intermix mode */390#define FC_CPC_SEQ 0x0800 /* sequential delivery */391#define FC_CPC_CAMP 0x0200 /* camp-on */392#define FC_CPC_PRI 0x0080 /* priority */393394/*395* cp_init flags.396* (TBD: not all flags defined here).397*/398#define FC_CPI_CSYN 0x0010 /* clock synch. capable */399400/*401* cp_recip flags.402*/403#define FC_CPR_CSYN 0x0008 /* clock synch. capable */404405/*406* NFC_ELS_FLOGI: Fabric login request.407* NFC_ELS_PLOGI: Port login request (same format).408*/409struct fc_els_flogi {410__u8 fl_cmd; /* command */411__u8 _fl_resvd[3]; /* must be zero */412struct fc_els_csp fl_csp; /* common service parameters */413__be64 fl_wwpn; /* port name */414__be64 fl_wwnn; /* node name */415struct fc_els_cssp fl_cssp[4]; /* class 1-4 service parameters */416__u8 fl_vend[16]; /* vendor version level */417} __attribute__((__packed__));418419/*420* Process login service parameter page.421*/422struct fc_els_spp {423__u8 spp_type; /* type code or common service params */424__u8 spp_type_ext; /* type code extension */425__u8 spp_flags;426__u8 _spp_resvd;427__be32 spp_orig_pa; /* originator process associator */428__be32 spp_resp_pa; /* responder process associator */429__be32 spp_params; /* service parameters */430};431432/*433* spp_flags.434*/435#define FC_SPP_OPA_VAL 0x80 /* originator proc. assoc. valid */436#define FC_SPP_RPA_VAL 0x40 /* responder proc. assoc. valid */437#define FC_SPP_EST_IMG_PAIR 0x20 /* establish image pair */438#define FC_SPP_RESP_MASK 0x0f /* mask for response code (below) */439440/*441* SPP response code in spp_flags - lower 4 bits.442*/443enum fc_els_spp_resp {444FC_SPP_RESP_ACK = 1, /* request executed */445FC_SPP_RESP_RES = 2, /* unable due to lack of resources */446FC_SPP_RESP_INIT = 3, /* initialization not complete */447FC_SPP_RESP_NO_PA = 4, /* unknown process associator */448FC_SPP_RESP_CONF = 5, /* configuration precludes image pair */449FC_SPP_RESP_COND = 6, /* request completed conditionally */450FC_SPP_RESP_MULT = 7, /* unable to handle multiple SPPs */451FC_SPP_RESP_INVL = 8, /* SPP is invalid */452};453454/*455* ELS_RRQ - Reinstate Recovery Qualifier456*/457struct fc_els_rrq {458__u8 rrq_cmd; /* command (0x12) */459__u8 rrq_zero[3]; /* specified as zero - part of cmd */460__u8 rrq_resvd; /* reserved */461__u8 rrq_s_id[3]; /* originator FID */462__be16 rrq_ox_id; /* originator exchange ID */463__be16 rrq_rx_id; /* responders exchange ID */464};465466/*467* ELS_REC - Read exchange concise.468*/469struct fc_els_rec {470__u8 rec_cmd; /* command (0x13) */471__u8 rec_zero[3]; /* specified as zero - part of cmd */472__u8 rec_resvd; /* reserved */473__u8 rec_s_id[3]; /* originator FID */474__be16 rec_ox_id; /* originator exchange ID */475__be16 rec_rx_id; /* responders exchange ID */476};477478/*479* ELS_REC LS_ACC payload.480*/481struct fc_els_rec_acc {482__u8 reca_cmd; /* accept (0x02) */483__u8 reca_zero[3]; /* specified as zero - part of cmd */484__be16 reca_ox_id; /* originator exchange ID */485__be16 reca_rx_id; /* responders exchange ID */486__u8 reca_resvd1; /* reserved */487__u8 reca_ofid[3]; /* originator FID */488__u8 reca_resvd2; /* reserved */489__u8 reca_rfid[3]; /* responder FID */490__be32 reca_fc4value; /* FC4 value */491__be32 reca_e_stat; /* ESB (exchange status block) status */492};493494/*495* ELS_PRLI - Process login request and response.496*/497struct fc_els_prli {498__u8 prli_cmd; /* command */499__u8 prli_spp_len; /* length of each serv. parm. page */500__be16 prli_len; /* length of entire payload */501/* service parameter pages follow */502};503504/*505* ELS_PRLO - Process logout request and response.506*/507struct fc_els_prlo {508__u8 prlo_cmd; /* command */509__u8 prlo_obs; /* obsolete, but shall be set to 10h */510__be16 prlo_len; /* payload length */511};512513/*514* ELS_ADISC payload515*/516struct fc_els_adisc {517__u8 adisc_cmd;518__u8 adisc_resv[3];519__u8 adisc_resv1;520__u8 adisc_hard_addr[3];521__be64 adisc_wwpn;522__be64 adisc_wwnn;523__u8 adisc_resv2;524__u8 adisc_port_id[3];525} __attribute__((__packed__));526527/*528* ELS_LOGO - process or fabric logout.529*/530struct fc_els_logo {531__u8 fl_cmd; /* command code */532__u8 fl_zero[3]; /* specified as zero - part of cmd */533__u8 fl_resvd; /* reserved */534__u8 fl_n_port_id[3];/* N port ID */535__be64 fl_n_port_wwn; /* port name */536};537538/*539* ELS_RTV - read timeout value.540*/541struct fc_els_rtv {542__u8 rtv_cmd; /* command code 0x0e */543__u8 rtv_zero[3]; /* specified as zero - part of cmd */544};545546/*547* LS_ACC for ELS_RTV - read timeout value.548*/549struct fc_els_rtv_acc {550__u8 rtv_cmd; /* command code 0x02 */551__u8 rtv_zero[3]; /* specified as zero - part of cmd */552__be32 rtv_r_a_tov; /* resource allocation timeout value */553__be32 rtv_e_d_tov; /* error detection timeout value */554__be32 rtv_toq; /* timeout qualifier (see below) */555};556557/*558* rtv_toq bits.559*/560#define FC_ELS_RTV_EDRES (1 << 26) /* E_D_TOV resolution is nS else mS */561#define FC_ELS_RTV_RTTOV (1 << 19) /* R_T_TOV is 100 uS else 100 mS */562563/*564* ELS_SCR - state change registration payload.565*/566struct fc_els_scr {567__u8 scr_cmd; /* command code */568__u8 scr_resv[6]; /* reserved */569__u8 scr_reg_func; /* registration function (see below) */570};571572enum fc_els_scr_func {573ELS_SCRF_FAB = 1, /* fabric-detected registration */574ELS_SCRF_NPORT = 2, /* Nx_Port-detected registration */575ELS_SCRF_FULL = 3, /* full registration */576ELS_SCRF_CLEAR = 255, /* remove any current registrations */577};578579/*580* ELS_RSCN - registered state change notification payload.581*/582struct fc_els_rscn {583__u8 rscn_cmd; /* RSCN opcode (0x61) */584__u8 rscn_page_len; /* page length (4) */585__be16 rscn_plen; /* payload length including this word */586587/* followed by 4-byte generic affected Port_ID pages */588};589590struct fc_els_rscn_page {591__u8 rscn_page_flags; /* event and address format */592__u8 rscn_fid[3]; /* fabric ID */593};594595#define ELS_RSCN_EV_QUAL_BIT 2 /* shift count for event qualifier */596#define ELS_RSCN_EV_QUAL_MASK 0xf /* mask for event qualifier */597#define ELS_RSCN_ADDR_FMT_BIT 0 /* shift count for address format */598#define ELS_RSCN_ADDR_FMT_MASK 0x3 /* mask for address format */599600enum fc_els_rscn_ev_qual {601ELS_EV_QUAL_NONE = 0, /* unspecified */602ELS_EV_QUAL_NS_OBJ = 1, /* changed name server object */603ELS_EV_QUAL_PORT_ATTR = 2, /* changed port attribute */604ELS_EV_QUAL_SERV_OBJ = 3, /* changed service object */605ELS_EV_QUAL_SW_CONFIG = 4, /* changed switch configuration */606ELS_EV_QUAL_REM_OBJ = 5, /* removed object */607};608609enum fc_els_rscn_addr_fmt {610ELS_ADDR_FMT_PORT = 0, /* rscn_fid is a port address */611ELS_ADDR_FMT_AREA = 1, /* rscn_fid is a area address */612ELS_ADDR_FMT_DOM = 2, /* rscn_fid is a domain address */613ELS_ADDR_FMT_FAB = 3, /* anything on fabric may have changed */614};615616/*617* ELS_RNID - request Node ID.618*/619struct fc_els_rnid {620__u8 rnid_cmd; /* RNID opcode (0x78) */621__u8 rnid_resv[3]; /* reserved */622__u8 rnid_fmt; /* data format */623__u8 rnid_resv2[3]; /* reserved */624};625626/*627* Node Identification Data formats (rnid_fmt)628*/629enum fc_els_rnid_fmt {630ELS_RNIDF_NONE = 0, /* no specific identification data */631ELS_RNIDF_GEN = 0xdf, /* general topology discovery format */632};633634/*635* ELS_RNID response.636*/637struct fc_els_rnid_resp {638__u8 rnid_cmd; /* response code (LS_ACC) */639__u8 rnid_resv[3]; /* reserved */640__u8 rnid_fmt; /* data format */641__u8 rnid_cid_len; /* common ID data length */642__u8 rnid_resv2; /* reserved */643__u8 rnid_sid_len; /* specific ID data length */644};645646struct fc_els_rnid_cid {647__be64 rnid_wwpn; /* N port name */648__be64 rnid_wwnn; /* node name */649};650651struct fc_els_rnid_gen {652__u8 rnid_vend_id[16]; /* vendor-unique ID */653__be32 rnid_atype; /* associated type (see below) */654__be32 rnid_phys_port; /* physical port number */655__be32 rnid_att_nodes; /* number of attached nodes */656__u8 rnid_node_mgmt; /* node management (see below) */657__u8 rnid_ip_ver; /* IP version (see below) */658__be16 rnid_prot_port; /* UDP / TCP port number */659__be32 rnid_ip_addr[4]; /* IP address */660__u8 rnid_resvd[2]; /* reserved */661__be16 rnid_vend_spec; /* vendor-specific field */662};663664enum fc_els_rnid_atype {665ELS_RNIDA_UNK = 0x01, /* unknown */666ELS_RNIDA_OTHER = 0x02, /* none of the following */667ELS_RNIDA_HUB = 0x03,668ELS_RNIDA_SWITCH = 0x04,669ELS_RNIDA_GATEWAY = 0x05,670ELS_RNIDA_CONV = 0x06, /* Obsolete, do not use this value */671ELS_RNIDA_HBA = 0x07, /* Obsolete, do not use this value */672ELS_RNIDA_PROXY = 0x08, /* Obsolete, do not use this value */673ELS_RNIDA_STORAGE = 0x09,674ELS_RNIDA_HOST = 0x0a,675ELS_RNIDA_SUBSYS = 0x0b, /* storage subsystem (e.g., RAID) */676ELS_RNIDA_ACCESS = 0x0e, /* access device (e.g. media changer) */677ELS_RNIDA_NAS = 0x11, /* NAS server */678ELS_RNIDA_BRIDGE = 0x12, /* bridge */679ELS_RNIDA_VIRT = 0x13, /* virtualization device */680ELS_RNIDA_MF = 0xff, /* multifunction device (bits below) */681ELS_RNIDA_MF_HUB = 1UL << 31, /* hub */682ELS_RNIDA_MF_SW = 1UL << 30, /* switch */683ELS_RNIDA_MF_GW = 1UL << 29, /* gateway */684ELS_RNIDA_MF_ST = 1UL << 28, /* storage */685ELS_RNIDA_MF_HOST = 1UL << 27, /* host */686ELS_RNIDA_MF_SUB = 1UL << 26, /* storage subsystem */687ELS_RNIDA_MF_ACC = 1UL << 25, /* storage access dev */688ELS_RNIDA_MF_WDM = 1UL << 24, /* wavelength division mux */689ELS_RNIDA_MF_NAS = 1UL << 23, /* NAS server */690ELS_RNIDA_MF_BR = 1UL << 22, /* bridge */691ELS_RNIDA_MF_VIRT = 1UL << 21, /* virtualization device */692};693694enum fc_els_rnid_mgmt {695ELS_RNIDM_SNMP = 0,696ELS_RNIDM_TELNET = 1,697ELS_RNIDM_HTTP = 2,698ELS_RNIDM_HTTPS = 3,699ELS_RNIDM_XML = 4, /* HTTP + XML */700};701702enum fc_els_rnid_ipver {703ELS_RNIDIP_NONE = 0, /* no IP support or node mgmt. */704ELS_RNIDIP_V4 = 1, /* IPv4 */705ELS_RNIDIP_V6 = 2, /* IPv6 */706};707708/*709* ELS RPL - Read Port List.710*/711struct fc_els_rpl {712__u8 rpl_cmd; /* command */713__u8 rpl_resv[5]; /* reserved - must be zero */714__be16 rpl_max_size; /* maximum response size or zero */715__u8 rpl_resv1; /* reserved - must be zero */716__u8 rpl_index[3]; /* starting index */717};718719/*720* Port number block in RPL response.721*/722struct fc_els_pnb {723__be32 pnb_phys_pn; /* physical port number */724__u8 pnb_resv; /* reserved */725__u8 pnb_port_id[3]; /* port ID */726__be64 pnb_wwpn; /* port name */727};728729/*730* RPL LS_ACC response.731*/732struct fc_els_rpl_resp {733__u8 rpl_cmd; /* ELS_LS_ACC */734__u8 rpl_resv1; /* reserved - must be zero */735__be16 rpl_plen; /* payload length */736__u8 rpl_resv2; /* reserved - must be zero */737__u8 rpl_llen[3]; /* list length */738__u8 rpl_resv3; /* reserved - must be zero */739__u8 rpl_index[3]; /* starting index */740struct fc_els_pnb rpl_pnb[1]; /* variable number of PNBs */741};742743/*744* Link Error Status Block.745*/746struct fc_els_lesb {747__be32 lesb_link_fail; /* link failure count */748__be32 lesb_sync_loss; /* loss of synchronization count */749__be32 lesb_sig_loss; /* loss of signal count */750__be32 lesb_prim_err; /* primitive sequence error count */751__be32 lesb_inv_word; /* invalid transmission word count */752__be32 lesb_inv_crc; /* invalid CRC count */753};754755/*756* ELS RPS - Read Port Status Block request.757*/758struct fc_els_rps {759__u8 rps_cmd; /* command */760__u8 rps_resv[2]; /* reserved - must be zero */761__u8 rps_flag; /* flag - see below */762__be64 rps_port_spec; /* port selection */763};764765enum fc_els_rps_flag {766FC_ELS_RPS_DID = 0x00, /* port identified by D_ID of req. */767FC_ELS_RPS_PPN = 0x01, /* port_spec is physical port number */768FC_ELS_RPS_WWPN = 0x02, /* port_spec is port WWN */769};770771/*772* ELS RPS LS_ACC response.773*/774struct fc_els_rps_resp {775__u8 rps_cmd; /* command - LS_ACC */776__u8 rps_resv[2]; /* reserved - must be zero */777__u8 rps_flag; /* flag - see below */778__u8 rps_resv2[2]; /* reserved */779__be16 rps_status; /* port status - see below */780struct fc_els_lesb rps_lesb; /* link error status block */781};782783enum fc_els_rps_resp_flag {784FC_ELS_RPS_LPEV = 0x01, /* L_port extension valid */785};786787enum fc_els_rps_resp_status {788FC_ELS_RPS_PTP = 1 << 5, /* point-to-point connection */789FC_ELS_RPS_LOOP = 1 << 4, /* loop mode */790FC_ELS_RPS_FAB = 1 << 3, /* fabric present */791FC_ELS_RPS_NO_SIG = 1 << 2, /* loss of signal */792FC_ELS_RPS_NO_SYNC = 1 << 1, /* loss of synchronization */793FC_ELS_RPS_RESET = 1 << 0, /* in link reset protocol */794};795796/*797* ELS LIRR - Link Incident Record Registration request.798*/799struct fc_els_lirr {800__u8 lirr_cmd; /* command */801__u8 lirr_resv[3]; /* reserved - must be zero */802__u8 lirr_func; /* registration function */803__u8 lirr_fmt; /* FC-4 type of RLIR requested */804__u8 lirr_resv2[2]; /* reserved - must be zero */805};806807enum fc_els_lirr_func {808ELS_LIRR_SET_COND = 0x01, /* set - conditionally receive */809ELS_LIRR_SET_UNCOND = 0x02, /* set - unconditionally receive */810ELS_LIRR_CLEAR = 0xff /* clear registration */811};812813/*814* ELS SRL - Scan Remote Loop request.815*/816struct fc_els_srl {817__u8 srl_cmd; /* command */818__u8 srl_resv[3]; /* reserved - must be zero */819__u8 srl_flag; /* flag - see below */820__u8 srl_flag_param[3]; /* flag parameter */821};822823enum fc_els_srl_flag {824FC_ELS_SRL_ALL = 0x00, /* scan all FL ports */825FC_ELS_SRL_ONE = 0x01, /* scan specified loop */826FC_ELS_SRL_EN_PER = 0x02, /* enable periodic scanning (param) */827FC_ELS_SRL_DIS_PER = 0x03, /* disable periodic scanning */828};829830/*831* ELS RLS - Read Link Error Status Block request.832*/833struct fc_els_rls {834__u8 rls_cmd; /* command */835__u8 rls_resv[4]; /* reserved - must be zero */836__u8 rls_port_id[3]; /* port ID */837};838839/*840* ELS RLS LS_ACC Response.841*/842struct fc_els_rls_resp {843__u8 rls_cmd; /* ELS_LS_ACC */844__u8 rls_resv[3]; /* reserved - must be zero */845struct fc_els_lesb rls_lesb; /* link error status block */846};847848/*849* ELS RLIR - Registered Link Incident Report.850* This is followed by the CLIR and the CLID, described below.851*/852struct fc_els_rlir {853__u8 rlir_cmd; /* command */854__u8 rlir_resv[3]; /* reserved - must be zero */855__u8 rlir_fmt; /* format (FC4-type if type specific) */856__u8 rlir_clr_len; /* common link incident record length */857__u8 rlir_cld_len; /* common link incident desc. length */858__u8 rlir_slr_len; /* spec. link incident record length */859};860861/*862* CLIR - Common Link Incident Record Data. - Sent via RLIR.863*/864struct fc_els_clir {865__be64 clir_wwpn; /* incident port name */866__be64 clir_wwnn; /* incident port node name */867__u8 clir_port_type; /* incident port type */868__u8 clir_port_id[3]; /* incident port ID */869870__be64 clir_conn_wwpn; /* connected port name */871__be64 clir_conn_wwnn; /* connected node name */872__be64 clir_fab_name; /* fabric name */873__be32 clir_phys_port; /* physical port number */874__be32 clir_trans_id; /* transaction ID */875__u8 clir_resv[3]; /* reserved */876__u8 clir_ts_fmt; /* time stamp format */877__be64 clir_timestamp; /* time stamp */878};879880/*881* CLIR clir_ts_fmt - time stamp format values.882*/883enum fc_els_clir_ts_fmt {884ELS_CLIR_TS_UNKNOWN = 0, /* time stamp field unknown */885ELS_CLIR_TS_SEC_FRAC = 1, /* time in seconds and fractions */886ELS_CLIR_TS_CSU = 2, /* time in clock synch update format */887};888889/*890* Common Link Incident Descriptor - sent via RLIR.891*/892struct fc_els_clid {893__u8 clid_iq; /* incident qualifier flags */894__u8 clid_ic; /* incident code */895__be16 clid_epai; /* domain/area of ISL */896};897898/*899* CLID incident qualifier flags.900*/901enum fc_els_clid_iq {902ELS_CLID_SWITCH = 0x20, /* incident port is a switch node */903ELS_CLID_E_PORT = 0x10, /* incident is an ISL (E) port */904ELS_CLID_SEV_MASK = 0x0c, /* severity 2-bit field mask */905ELS_CLID_SEV_INFO = 0x00, /* report is informational */906ELS_CLID_SEV_INOP = 0x08, /* link not operational */907ELS_CLID_SEV_DEG = 0x04, /* link degraded but operational */908ELS_CLID_LASER = 0x02, /* subassembly is a laser */909ELS_CLID_FRU = 0x01, /* format can identify a FRU */910};911912/*913* CLID incident code.914*/915enum fc_els_clid_ic {916ELS_CLID_IC_IMPL = 1, /* implicit incident */917ELS_CLID_IC_BER = 2, /* bit-error-rate threshold exceeded */918ELS_CLID_IC_LOS = 3, /* loss of synch or signal */919ELS_CLID_IC_NOS = 4, /* non-operational primitive sequence */920ELS_CLID_IC_PST = 5, /* primitive sequence timeout */921ELS_CLID_IC_INVAL = 6, /* invalid primitive sequence */922ELS_CLID_IC_LOOP_TO = 7, /* loop initialization time out */923ELS_CLID_IC_LIP = 8, /* receiving LIP */924};925926/*927* Link Integrity event types928*/929enum fc_fpin_li_event_types {930FPIN_LI_UNKNOWN = 0x0,931FPIN_LI_LINK_FAILURE = 0x1,932FPIN_LI_LOSS_OF_SYNC = 0x2,933FPIN_LI_LOSS_OF_SIG = 0x3,934FPIN_LI_PRIM_SEQ_ERR = 0x4,935FPIN_LI_INVALID_TX_WD = 0x5,936FPIN_LI_INVALID_CRC = 0x6,937FPIN_LI_DEVICE_SPEC = 0xF,938};939940/*941* Initializer useful for decoding table.942* Please keep this in sync with the above definitions.943*/944#define FC_FPIN_LI_EVT_TYPES_INIT { \945{ FPIN_LI_UNKNOWN, "Unknown" }, \946{ FPIN_LI_LINK_FAILURE, "Link Failure" }, \947{ FPIN_LI_LOSS_OF_SYNC, "Loss of Synchronization" }, \948{ FPIN_LI_LOSS_OF_SIG, "Loss of Signal" }, \949{ FPIN_LI_PRIM_SEQ_ERR, "Primitive Sequence Protocol Error" }, \950{ FPIN_LI_INVALID_TX_WD, "Invalid Transmission Word" }, \951{ FPIN_LI_INVALID_CRC, "Invalid CRC" }, \952{ FPIN_LI_DEVICE_SPEC, "Device Specific" }, \953}954955/*956* Delivery event types957*/958enum fc_fpin_deli_event_types {959FPIN_DELI_UNKNOWN = 0x0,960FPIN_DELI_TIMEOUT = 0x1,961FPIN_DELI_UNABLE_TO_ROUTE = 0x2,962FPIN_DELI_DEVICE_SPEC = 0xF,963};964965/*966* Initializer useful for decoding table.967* Please keep this in sync with the above definitions.968*/969#define FC_FPIN_DELI_EVT_TYPES_INIT { \970{ FPIN_DELI_UNKNOWN, "Unknown" }, \971{ FPIN_DELI_TIMEOUT, "Timeout" }, \972{ FPIN_DELI_UNABLE_TO_ROUTE, "Unable to Route" }, \973{ FPIN_DELI_DEVICE_SPEC, "Device Specific" }, \974}975976/*977* Congestion event types978*/979enum fc_fpin_congn_event_types {980FPIN_CONGN_CLEAR = 0x0,981FPIN_CONGN_LOST_CREDIT = 0x1,982FPIN_CONGN_CREDIT_STALL = 0x2,983FPIN_CONGN_OVERSUBSCRIPTION = 0x3,984FPIN_CONGN_DEVICE_SPEC = 0xF,985};986987/*988* Initializer useful for decoding table.989* Please keep this in sync with the above definitions.990*/991#define FC_FPIN_CONGN_EVT_TYPES_INIT { \992{ FPIN_CONGN_CLEAR, "Clear" }, \993{ FPIN_CONGN_LOST_CREDIT, "Lost Credit" }, \994{ FPIN_CONGN_CREDIT_STALL, "Credit Stall" }, \995{ FPIN_CONGN_OVERSUBSCRIPTION, "Oversubscription" }, \996{ FPIN_CONGN_DEVICE_SPEC, "Device Specific" }, \997}998999enum fc_fpin_congn_severity_types {1000FPIN_CONGN_SEVERITY_WARNING = 0xF1,1001FPIN_CONGN_SEVERITY_ERROR = 0xF7,1002};10031004/*1005* Link Integrity Notification Descriptor1006*/1007struct fc_fn_li_desc {1008__be32 desc_tag; /* Descriptor Tag (0x00020001) */1009__be32 desc_len; /* Length of Descriptor (in bytes).1010* Size of descriptor excluding1011* desc_tag and desc_len fields.1012*/1013__be64 detecting_wwpn; /* Port Name that detected event */1014__be64 attached_wwpn; /* Port Name of device attached to1015* detecting Port Name1016*/1017__be16 event_type; /* see enum fc_fpin_li_event_types */1018__be16 event_modifier; /* Implementation specific value1019* describing the event type1020*/1021__be32 event_threshold;/* duration in ms of the link1022* integrity detection cycle1023*/1024__be32 event_count; /* minimum number of event1025* occurrences during the event1026* threshold to caause the LI event1027*/1028__be32 pname_count; /* number of portname_list elements */1029__be64 pname_list[]; /* list of N_Port_Names accessible1030* through the attached port1031*/1032};10331034/*1035* Delivery Notification Descriptor1036*/1037struct fc_fn_deli_desc {1038__be32 desc_tag; /* Descriptor Tag (0x00020002) */1039__be32 desc_len; /* Length of Descriptor (in bytes).1040* Size of descriptor excluding1041* desc_tag and desc_len fields.1042*/1043__be64 detecting_wwpn; /* Port Name that detected event */1044__be64 attached_wwpn; /* Port Name of device attached to1045* detecting Port Name1046*/1047__be32 deli_reason_code;/* see enum fc_fpin_deli_event_types */1048};10491050/*1051* Peer Congestion Notification Descriptor1052*/1053struct fc_fn_peer_congn_desc {1054__be32 desc_tag; /* Descriptor Tag (0x00020003) */1055__be32 desc_len; /* Length of Descriptor (in bytes).1056* Size of descriptor excluding1057* desc_tag and desc_len fields.1058*/1059__be64 detecting_wwpn; /* Port Name that detected event */1060__be64 attached_wwpn; /* Port Name of device attached to1061* detecting Port Name1062*/1063__be16 event_type; /* see enum fc_fpin_congn_event_types */1064__be16 event_modifier; /* Implementation specific value1065* describing the event type1066*/1067__be32 event_period; /* duration (ms) of the detected1068* congestion event1069*/1070__be32 pname_count; /* number of portname_list elements */1071__be64 pname_list[]; /* list of N_Port_Names accessible1072* through the attached port1073*/1074};10751076/*1077* Congestion Notification Descriptor1078*/1079struct fc_fn_congn_desc {1080__be32 desc_tag; /* Descriptor Tag (0x00020004) */1081__be32 desc_len; /* Length of Descriptor (in bytes).1082* Size of descriptor excluding1083* desc_tag and desc_len fields.1084*/1085__be16 event_type; /* see enum fc_fpin_congn_event_types */1086__be16 event_modifier; /* Implementation specific value1087* describing the event type1088*/1089__be32 event_period; /* duration (ms) of the detected1090* congestion event1091*/1092__u8 severity; /* command */1093__u8 resv[3]; /* reserved - must be zero */1094};10951096/*1097* ELS_FPIN - Fabric Performance Impact Notification1098*/1099struct fc_els_fpin {1100__u8 fpin_cmd; /* command (0x16) */1101__u8 fpin_zero[3]; /* specified as zero - part of cmd */1102__be32 desc_len; /* Length of Descriptor List (in bytes).1103* Size of ELS excluding fpin_cmd,1104* fpin_zero and desc_len fields.1105*/1106struct fc_tlv_desc fpin_desc[]; /* Descriptor list */1107};11081109/* Diagnostic Function Descriptor - FPIN Registration */1110struct fc_df_desc_fpin_reg {1111__be32 desc_tag; /* FPIN Registration (0x00030001) */1112__be32 desc_len; /* Length of Descriptor (in bytes).1113* Size of descriptor excluding1114* desc_tag and desc_len fields.1115*/1116__be32 count; /* Number of desc_tags elements */1117__be32 desc_tags[]; /* Array of Descriptor Tags.1118* Each tag indicates a function1119* supported by the N_Port (request)1120* or by the N_Port and Fabric1121* Controller (reply; may be a subset1122* of the request).1123* See ELS_FN_DTAG_xxx for tag values.1124*/1125};11261127/*1128* ELS_RDF - Register Diagnostic Functions1129*/1130struct fc_els_rdf {1131__u8 fpin_cmd; /* command (0x19) */1132__u8 fpin_zero[3]; /* specified as zero - part of cmd */1133__be32 desc_len; /* Length of Descriptor List (in bytes).1134* Size of ELS excluding fpin_cmd,1135* fpin_zero and desc_len fields.1136*/1137struct fc_tlv_desc desc[]; /* Descriptor list */1138};11391140/*1141* ELS RDF LS_ACC Response.1142*/1143struct fc_els_rdf_resp {1144struct fc_els_ls_acc acc_hdr;1145__be32 desc_list_len; /* Length of response (in1146* bytes). Excludes acc_hdr1147* and desc_list_len fields.1148*/1149struct fc_els_lsri_desc lsri;1150struct fc_tlv_desc desc[]; /* Supported Descriptor list */1151};115211531154/*1155* Diagnostic Capability Descriptors for EDC ELS1156*/11571158/*1159* Diagnostic: Link Fault Capability Descriptor1160*/1161struct fc_diag_lnkflt_desc {1162__be32 desc_tag; /* Descriptor Tag (0x0001000D) */1163__be32 desc_len; /* Length of Descriptor (in bytes).1164* Size of descriptor excluding1165* desc_tag and desc_len fields.1166* 12 bytes1167*/1168__be32 degrade_activate_threshold;1169__be32 degrade_deactivate_threshold;1170__be32 fec_degrade_interval;1171};11721173enum fc_edc_cg_signal_cap_types {1174/* Note: Capability: bits 31:4 Rsvd; bits 3:0 are capabilities */1175EDC_CG_SIG_NOTSUPPORTED = 0x00, /* neither supported */1176EDC_CG_SIG_WARN_ONLY = 0x01,1177EDC_CG_SIG_WARN_ALARM = 0x02, /* both supported */1178};11791180/*1181* Initializer useful for decoding table.1182* Please keep this in sync with the above definitions.1183*/1184#define FC_EDC_CG_SIGNAL_CAP_TYPES_INIT { \1185{ EDC_CG_SIG_NOTSUPPORTED, "Signaling Not Supported" }, \1186{ EDC_CG_SIG_WARN_ONLY, "Warning Signal" }, \1187{ EDC_CG_SIG_WARN_ALARM, "Warning and Alarm Signals" }, \1188}11891190enum fc_diag_cg_sig_freq_types {1191EDC_CG_SIGFREQ_CNT_MIN = 1, /* Min Frequency Count */1192EDC_CG_SIGFREQ_CNT_MAX = 999, /* Max Frequency Count */11931194EDC_CG_SIGFREQ_SEC = 0x1, /* Units: seconds */1195EDC_CG_SIGFREQ_MSEC = 0x2, /* Units: milliseconds */1196};11971198struct fc_diag_cg_sig_freq {1199__be16 count; /* Time between signals1200* note: upper 6 bits rsvd1201*/1202__be16 units; /* Time unit for count1203* note: upper 12 bits rsvd1204*/1205};12061207/*1208* Diagnostic: Congestion Signaling Capability Descriptor1209*/1210struct fc_diag_cg_sig_desc {1211__be32 desc_tag; /* Descriptor Tag (0x0001000F) */1212__be32 desc_len; /* Length of Descriptor (in bytes).1213* Size of descriptor excluding1214* desc_tag and desc_len fields.1215* 16 bytes1216*/1217__be32 xmt_signal_capability;1218struct fc_diag_cg_sig_freq xmt_signal_frequency;1219__be32 rcv_signal_capability;1220struct fc_diag_cg_sig_freq rcv_signal_frequency;1221};12221223/*1224* ELS_EDC - Exchange Diagnostic Capabilities1225*/1226struct fc_els_edc {1227__u8 edc_cmd; /* command (0x17) */1228__u8 edc_zero[3]; /* specified as zero - part of cmd */1229__be32 desc_len; /* Length of Descriptor List (in bytes).1230* Size of ELS excluding edc_cmd,1231* edc_zero and desc_len fields.1232*/1233struct fc_tlv_desc desc[];1234/* Diagnostic Descriptor list */1235};12361237/*1238* ELS EDC LS_ACC Response.1239*/1240struct fc_els_edc_resp {1241struct fc_els_ls_acc acc_hdr;1242__be32 desc_list_len; /* Length of response (in1243* bytes). Excludes acc_hdr1244* and desc_list_len fields.1245*/1246struct fc_els_lsri_desc lsri;1247struct fc_tlv_desc desc[];1248/* Supported Diagnostic Descriptor list */1249};125012511252#endif /* _FC_ELS_H_ */125312541255