/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
/*
* Copyright(c) 2007 Intel Corporation. All rights reserved.
*
* Maintained at www.Open-FCoE.org
*/
#ifndef _FC_ELS_H_
#define _FC_ELS_H_
#include <linux/types.h>
#include <asm/byteorder.h>
/*
* Fibre Channel Switch - Enhanced Link Services definitions.
* From T11 FC-LS Rev 1.2 June 7, 2005.
*/
/*
* ELS Command codes - byte 0 of the frame payload
*/
enum fc_els_cmd {
ELS_LS_RJT = 0x01, /* ESL reject */
ELS_LS_ACC = 0x02, /* ESL Accept */
ELS_PLOGI = 0x03, /* N_Port login */
ELS_FLOGI = 0x04, /* F_Port login */
ELS_LOGO = 0x05, /* Logout */
ELS_ABTX = 0x06, /* Abort exchange - obsolete */
ELS_RCS = 0x07, /* read connection status */
ELS_RES = 0x08, /* read exchange status block */
ELS_RSS = 0x09, /* read sequence status block */
ELS_RSI = 0x0a, /* read sequence initiative */
ELS_ESTS = 0x0b, /* establish streaming */
ELS_ESTC = 0x0c, /* estimate credit */
ELS_ADVC = 0x0d, /* advise credit */
ELS_RTV = 0x0e, /* read timeout value */
ELS_RLS = 0x0f, /* read link error status block */
ELS_ECHO = 0x10, /* echo */
ELS_TEST = 0x11, /* test */
ELS_RRQ = 0x12, /* reinstate recovery qualifier */
ELS_REC = 0x13, /* read exchange concise */
ELS_SRR = 0x14, /* sequence retransmission request */
ELS_FPIN = 0x16, /* Fabric Performance Impact Notification */
ELS_RDP = 0x18, /* Read Diagnostic Parameters */
ELS_RDF = 0x19, /* Register Diagnostic Functions */
ELS_PRLI = 0x20, /* process login */
ELS_PRLO = 0x21, /* process logout */
ELS_SCN = 0x22, /* state change notification */
ELS_TPLS = 0x23, /* test process login state */
ELS_TPRLO = 0x24, /* third party process logout */
ELS_LCLM = 0x25, /* login control list mgmt (obs) */
ELS_GAID = 0x30, /* get alias_ID */
ELS_FACT = 0x31, /* fabric activate alias_id */
ELS_FDACDT = 0x32, /* fabric deactivate alias_id */
ELS_NACT = 0x33, /* N-port activate alias_id */
ELS_NDACT = 0x34, /* N-port deactivate alias_id */
ELS_QOSR = 0x40, /* quality of service request */
ELS_RVCS = 0x41, /* read virtual circuit status */
ELS_PDISC = 0x50, /* discover N_port service params */
ELS_FDISC = 0x51, /* discover F_port service params */
ELS_ADISC = 0x52, /* discover address */
ELS_RNC = 0x53, /* report node cap (obs) */
ELS_FARP_REQ = 0x54, /* FC ARP request */
ELS_FARP_REPL = 0x55, /* FC ARP reply */
ELS_RPS = 0x56, /* read port status block */
ELS_RPL = 0x57, /* read port list */
ELS_RPBC = 0x58, /* read port buffer condition */
ELS_FAN = 0x60, /* fabric address notification */
ELS_RSCN = 0x61, /* registered state change notification */
ELS_SCR = 0x62, /* state change registration */
ELS_RNFT = 0x63, /* report node FC-4 types */
ELS_CSR = 0x68, /* clock synch. request */
ELS_CSU = 0x69, /* clock synch. update */
ELS_LINIT = 0x70, /* loop initialize */
ELS_LSTS = 0x72, /* loop status */
ELS_RNID = 0x78, /* request node ID data */
ELS_RLIR = 0x79, /* registered link incident report */
ELS_LIRR = 0x7a, /* link incident record registration */
ELS_SRL = 0x7b, /* scan remote loop */
ELS_SBRP = 0x7c, /* set bit-error reporting params */
ELS_RPSC = 0x7d, /* report speed capabilities */
ELS_QSA = 0x7e, /* query security attributes */
ELS_EVFP = 0x7f, /* exchange virt. fabrics params */
ELS_LKA = 0x80, /* link keep-alive */
ELS_AUTH_ELS = 0x90, /* authentication ELS */
};
/*
* Initializer useful for decoding table.
* Please keep this in sync with the above definitions.
*/
#define FC_ELS_CMDS_INIT { \
[ELS_LS_RJT] = "LS_RJT", \
[ELS_LS_ACC] = "LS_ACC", \
[ELS_PLOGI] = "PLOGI", \
[ELS_FLOGI] = "FLOGI", \
[ELS_LOGO] = "LOGO", \
[ELS_ABTX] = "ABTX", \
[ELS_RCS] = "RCS", \
[ELS_RES] = "RES", \
[ELS_RSS] = "RSS", \
[ELS_RSI] = "RSI", \
[ELS_ESTS] = "ESTS", \
[ELS_ESTC] = "ESTC", \
[ELS_ADVC] = "ADVC", \
[ELS_RTV] = "RTV", \
[ELS_RLS] = "RLS", \
[ELS_ECHO] = "ECHO", \
[ELS_TEST] = "TEST", \
[ELS_RRQ] = "RRQ", \
[ELS_REC] = "REC", \
[ELS_SRR] = "SRR", \
[ELS_FPIN] = "FPIN", \
[ELS_RDP] = "RDP", \
[ELS_RDF] = "RDF", \
[ELS_PRLI] = "PRLI", \
[ELS_PRLO] = "PRLO", \
[ELS_SCN] = "SCN", \
[ELS_TPLS] = "TPLS", \
[ELS_TPRLO] = "TPRLO", \
[ELS_LCLM] = "LCLM", \
[ELS_GAID] = "GAID", \
[ELS_FACT] = "FACT", \
[ELS_FDACDT] = "FDACDT", \
[ELS_NACT] = "NACT", \
[ELS_NDACT] = "NDACT", \
[ELS_QOSR] = "QOSR", \
[ELS_RVCS] = "RVCS", \
[ELS_PDISC] = "PDISC", \
[ELS_FDISC] = "FDISC", \
[ELS_ADISC] = "ADISC", \
[ELS_RNC] = "RNC", \
[ELS_FARP_REQ] = "FARP_REQ", \
[ELS_FARP_REPL] = "FARP_REPL", \
[ELS_RPS] = "RPS", \
[ELS_RPL] = "RPL", \
[ELS_RPBC] = "RPBC", \
[ELS_FAN] = "FAN", \
[ELS_RSCN] = "RSCN", \
[ELS_SCR] = "SCR", \
[ELS_RNFT] = "RNFT", \
[ELS_CSR] = "CSR", \
[ELS_CSU] = "CSU", \
[ELS_LINIT] = "LINIT", \
[ELS_LSTS] = "LSTS", \
[ELS_RNID] = "RNID", \
[ELS_RLIR] = "RLIR", \
[ELS_LIRR] = "LIRR", \
[ELS_SRL] = "SRL", \
[ELS_SBRP] = "SBRP", \
[ELS_RPSC] = "RPSC", \
[ELS_QSA] = "QSA", \
[ELS_EVFP] = "EVFP", \
[ELS_LKA] = "LKA", \
[ELS_AUTH_ELS] = "AUTH_ELS", \
}
/*
* LS_ACC payload.
*/
struct fc_els_ls_acc {