/******************************************************************* * This file is part of the Emulex Linux Device Driver for * * Fibre Channel Host Bus Adapters. * * Copyright (C) 2017-2024 Broadcom. All Rights Reserved. The term * * “Broadcom” refers to Broadcom Inc. and/or its subsidiaries. * * Copyright (C) 2004-2016 Emulex. All rights reserved. * * EMULEX and SLI are trademarks of Emulex. * * www.broadcom.com * * * * This program is free software; you can redistribute it and/or * * modify it under the terms of version 2 of the GNU General * * Public License as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful. * * ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND * * WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, * * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT, ARE * * DISCLAIMED, EXCEPT TO THE EXTENT THAT SUCH DISCLAIMERS ARE HELD * * TO BE LEGALLY INVALID. See the GNU General Public License for * * more details, a copy of which can be found in the file COPYING * * included with this package. *
*******************************************************************/
#define LPFC_BUF_RING0 64 /* Number of buffers to post to RING
0 */
#define FCELSSIZE 1024 /* maximum ELS transfer size */
#define LPFC_FCP_RING 0 /* ring 0 for FCP initiator commands */ #define LPFC_EXTRA_RING 1 /* ring 1 for other protocols */ #define LPFC_ELS_RING 2 /* ring 2 for ELS commands */
#define SLI2_IOCB_CMD_R0_ENTRIES 172 /* SLI-2 FCP command ring entries */ #define SLI2_IOCB_RSP_R0_ENTRIES 134 /* SLI-2 FCP response ring entries */ #define SLI2_IOCB_CMD_R1_ENTRIES 4 /* SLI-2 extra command ring entries */ #define SLI2_IOCB_RSP_R1_ENTRIES 4 /* SLI-2 extra response ring entries */ #define SLI2_IOCB_CMD_R1XTRA_ENTRIES 36 /* SLI-2 extra FCP cmd ring entries */ #define SLI2_IOCB_RSP_R1XTRA_ENTRIES 52 /* SLI-2 extra FCP rsp ring entries */ #define SLI2_IOCB_CMD_R2_ENTRIES 20 /* SLI-2 ELS command ring entries */ #define SLI2_IOCB_RSP_R2_ENTRIES 20 /* SLI-2 ELS response ring entries */ #define SLI2_IOCB_CMD_R3_ENTRIES 0 #define SLI2_IOCB_RSP_R3_ENTRIES 0 #define SLI2_IOCB_CMD_R3XTRA_ENTRIES 24 #define SLI2_IOCB_RSP_R3XTRA_ENTRIES 32
struct lpfc_sli_ct_request { /* Structure is in Big Endian format */ union CtRevisionId RevisionId;
uint8_t FsType;
uint8_t FsSubType;
uint8_t Options;
uint8_t Rsrvd1; union CtCommandResponse CommandResponse;
uint8_t Rsrvd2;
uint8_t ReasonCode;
uint8_t Explanation;
uint8_t VendorUnique; #define LPFC_CT_PREAMBLE 20 /* Size of CTReq + 4 up to here */
#define FC_PH_4_0 6 /* FC-PH version 4.0 */ #define FC_PH_4_1 7 /* FC-PH version 4.1 */ #define FC_PH_4_2 8 /* FC-PH version 4.2 */ #define FC_PH_4_3 9 /* FC-PH version 4.3 */
#define FC_PH_LOW 8 /* Lowest supported FC-PH version */ #define FC_PH_HIGH 9 /* Highest supported FC-PH version */ #define FC_PH3 0x20 /* FC-PH-3 version */
#define FF_FRAME_SIZE 2048
struct lpfc_name { union { struct { #ifdef __BIG_ENDIAN_BITFIELD
uint8_t nameType:4; /* FC Word 0, bit 28:31 */
uint8_t IEEEextMsn:4; /* FC Word 0, bit 24:27, bit
8:11 of IEEE ext */ #else/* __LITTLE_ENDIAN_BITFIELD */
uint8_t IEEEextMsn:4; /* FC Word 0, bit 24:27, bit
8:11 of IEEE ext */
uint8_t nameType:4; /* FC Word 0, bit 28:31 */ #endif
#define NAME_IEEE 0x1 /* IEEE name - nameType */ #define NAME_IEEE_EXT 0x2 /* IEEE extended name */ #define NAME_FC_TYPE 0x3 /* FC native name type */ #define NAME_IP_TYPE 0x4 /* IP address */ #define NAME_CCITT_TYPE 0xC #define NAME_CCITT_GR_TYPE 0xE
uint8_t IEEEextLsb; /* FC Word 0, bit 16:23, IEEE
extended Lsb */
uint8_t IEEE[6]; /* FC IEEE address */
} s;
uint8_t wwn[8];
uint64_t name __packed __aligned(4);
} u;
};
struct csp {
uint8_t fcphHigh; /* FC Word 0, byte 0 */
uint8_t fcphLow;
uint8_t bbCreditMsb;
uint8_t bbCreditLsb; /* FC Word 0, byte 3 */
/* * Word 1 Bit 31 in common service parameter is overloaded. * Word 1 Bit 31 in FLOGI request is multiple NPort request * Word 1 Bit 31 in FLOGI response is clean address bit
*/ #define clean_address_bit request_multiple_Nport /* Word 1, bit 31 */ /* * Word 1 Bit 30 in common service parameter is overloaded. * Word 1 Bit 30 in FLOGI request is Virtual Fabrics * Word 1 Bit 30 in PLOGI request is random offset
*/ #define virtual_fabric_support randomOffset /* Word 1, bit 30 */ /* * Word 1 Bit 29 in common service parameter is overloaded. * Word 1 Bit 29 in FLOGI response is multiple NPort assignment * Word 1 Bit 29 in FLOGI/PLOGI request is Valid Vendor Version Level
*/ #define valid_vendor_ver_level response_multiple_NPort /* Word 1, bit 29 */ #ifdef __BIG_ENDIAN_BITFIELD
uint16_t request_multiple_Nport:1; /* FC Word 1, bit 31 */
uint16_t randomOffset:1; /* FC Word 1, bit 30 */
uint16_t response_multiple_NPort:1; /* FC Word 1, bit 29 */
uint16_t fPort:1; /* FC Word 1, bit 28 */
uint16_t altBbCredit:1; /* FC Word 1, bit 27 */
uint16_t edtovResolution:1; /* FC Word 1, bit 26 */
uint16_t multicast:1; /* FC Word 1, bit 25 */
uint16_t app_hdr_support:1; /* FC Word 1, bit 24 */
uint16_t priority_tagging:1; /* FC Word 1, bit 23 */
uint16_t simplex:1; /* FC Word 1, bit 22 */
uint16_t word1Reserved1:3; /* FC Word 1, bit 21:19 */
uint16_t dhd:1; /* FC Word 1, bit 18 */
uint16_t contIncSeqCnt:1; /* FC Word 1, bit 17 */
uint16_t payloadlength:1; /* FC Word 1, bit 16 */ #else/* __LITTLE_ENDIAN_BITFIELD */
uint16_t app_hdr_support:1; /* FC Word 1, bit 24 */
uint16_t multicast:1; /* FC Word 1, bit 25 */
uint16_t edtovResolution:1; /* FC Word 1, bit 26 */
uint16_t altBbCredit:1; /* FC Word 1, bit 27 */
uint16_t fPort:1; /* FC Word 1, bit 28 */
uint16_t response_multiple_NPort:1; /* FC Word 1, bit 29 */
uint16_t randomOffset:1; /* FC Word 1, bit 30 */
uint16_t request_multiple_Nport:1; /* FC Word 1, bit 31 */
uint16_t payloadlength:1; /* FC Word 1, bit 16 */
uint16_t contIncSeqCnt:1; /* FC Word 1, bit 17 */
uint16_t dhd:1; /* FC Word 1, bit 18 */
uint16_t word1Reserved1:3; /* FC Word 1, bit 21:19 */
uint16_t simplex:1; /* FC Word 1, bit 22 */
uint16_t priority_tagging:1; /* FC Word 1, bit 23 */ #endif
uint8_t bbRcvSizeMsb; /* Upper nibble is reserved */
uint8_t bbRcvSizeLsb; /* FC Word 1, byte 3 */ union { struct {
uint8_t word2Reserved1; /* FC Word 2 byte 0 */
uint8_t totalConcurrSeq; /* FC Word 2 byte 1 */
uint8_t roByCategoryMsb; /* FC Word 2 byte 2 */
uint8_t roByCategoryLsb; /* FC Word 2 byte 3 */
} nPort;
uint32_t r_a_tov; /* R_A_TOV must be in B.E. format */
} w2;
uint32_t e_d_tov; /* E_D_TOV must be in B.E. format */
};
struct class_parms { #ifdef __BIG_ENDIAN_BITFIELD
uint8_t classValid:1; /* FC Word 0, bit 31 */
uint8_t intermix:1; /* FC Word 0, bit 30 */
uint8_t stackedXparent:1; /* FC Word 0, bit 29 */
uint8_t stackedLockDown:1; /* FC Word 0, bit 28 */
uint8_t seqDelivery:1; /* FC Word 0, bit 27 */
uint8_t word0Reserved1:3; /* FC Word 0, bit 24:26 */ #else/* __LITTLE_ENDIAN_BITFIELD */
uint8_t word0Reserved1:3; /* FC Word 0, bit 24:26 */
uint8_t seqDelivery:1; /* FC Word 0, bit 27 */
uint8_t stackedLockDown:1; /* FC Word 0, bit 28 */
uint8_t stackedXparent:1; /* FC Word 0, bit 29 */
uint8_t intermix:1; /* FC Word 0, bit 30 */
uint8_t classValid:1; /* FC Word 0, bit 31 */
#endif
uint8_t word0Reserved2; /* FC Word 0, bit 16:23 */
#ifdef __BIG_ENDIAN_BITFIELD
uint8_t iCtlXidReAssgn:2; /* FC Word 0, Bit 14:15 */
uint8_t iCtlInitialPa:2; /* FC Word 0, bit 12:13 */
uint8_t iCtlAck0capable:1; /* FC Word 0, bit 11 */
uint8_t iCtlAckNcapable:1; /* FC Word 0, bit 10 */
uint8_t word0Reserved3:2; /* FC Word 0, bit 8: 9 */ #else/* __LITTLE_ENDIAN_BITFIELD */
uint8_t word0Reserved3:2; /* FC Word 0, bit 8: 9 */
uint8_t iCtlAckNcapable:1; /* FC Word 0, bit 10 */
uint8_t iCtlAck0capable:1; /* FC Word 0, bit 11 */
uint8_t iCtlInitialPa:2; /* FC Word 0, bit 12:13 */
uint8_t iCtlXidReAssgn:2; /* FC Word 0, Bit 14:15 */ #endif
uint8_t word0Reserved4; /* FC Word 0, bit 0: 7 */
#ifdef __BIG_ENDIAN_BITFIELD
uint8_t rCtlAck0capable:1; /* FC Word 1, bit 31 */
uint8_t rCtlAckNcapable:1; /* FC Word 1, bit 30 */
uint8_t rCtlXidInterlck:1; /* FC Word 1, bit 29 */
uint8_t rCtlErrorPolicy:2; /* FC Word 1, bit 27:28 */
uint8_t word1Reserved1:1; /* FC Word 1, bit 26 */
uint8_t rCtlCatPerSeq:2; /* FC Word 1, bit 24:25 */ #else/* __LITTLE_ENDIAN_BITFIELD */
uint8_t rCtlCatPerSeq:2; /* FC Word 1, bit 24:25 */
uint8_t word1Reserved1:1; /* FC Word 1, bit 26 */
uint8_t rCtlErrorPolicy:2; /* FC Word 1, bit 27:28 */
uint8_t rCtlXidInterlck:1; /* FC Word 1, bit 29 */
uint8_t rCtlAckNcapable:1; /* FC Word 1, bit 30 */
uint8_t rCtlAck0capable:1; /* FC Word 1, bit 31 */ #endif
uint8_t word1Reserved2; /* FC Word 1, bit 16:23 */
uint8_t rcvDataSizeMsb; /* FC Word 1, bit 8:15 */
uint8_t rcvDataSizeLsb; /* FC Word 1, bit 0: 7 */
uint8_t concurrentSeqMsb; /* FC Word 2, bit 24:31 */
uint8_t concurrentSeqLsb; /* FC Word 2, bit 16:23 */
uint8_t EeCreditSeqMsb; /* FC Word 2, bit 8:15 */
uint8_t EeCreditSeqLsb; /* FC Word 2, bit 0: 7 */
uint8_t openSeqPerXchgMsb; /* FC Word 3, bit 24:31 */
uint8_t openSeqPerXchgLsb; /* FC Word 3, bit 16:23 */
uint8_t word3Reserved1; /* Fc Word 3, bit 8:15 */
uint8_t word3Reserved2; /* Fc Word 3, bit 0: 7 */
};
struct ls_rjt { /* Structure is in Big Endian format */ union {
__be32 ls_rjt_error_be;
uint32_t lsRjtError; struct {
uint8_t lsRjtRsvd0; /* FC Word 0, bit 24:31 */
uint8_t lsRjtRsnCode; /* FC Word 0, bit 16:23 */ /* LS_RJT reason codes */ #define LSRJT_INVALID_CMD 0x01 #define LSRJT_LOGICAL_ERR 0x03 #define LSRJT_LOGICAL_BSY 0x05 #define LSRJT_PROTOCOL_ERR 0x07 #define LSRJT_UNABLE_TPC 0x09 /* Unable to perform command */ #define LSRJT_CMD_UNSUPPORTED 0x0B #define LSRJT_VENDOR_UNIQUE 0xFF /* See Byte 3 */
typedefstruct _LOGO { /* Structure is in Big Endian format */ union {
uint32_t nPortId32; /* Access nPortId as a word */ struct {
uint8_t word1Reserved1; /* FC Word 1, bit 31:24 */
uint8_t nPortIdByte0; /* N_port ID bit 16:23 */
uint8_t nPortIdByte1; /* N_port ID bit 8:15 */
uint8_t nPortIdByte2; /* N_port ID bit 0: 7 */
} b;
} un; struct lpfc_name portName; /* N_port name field */
} LOGO;
typedefstruct _PRLI { /* Structure is in Big Endian format */
uint8_t prliType; /* FC Parm Word 0, bit 24:31 */
#define PRLI_FCP_TYPE 0x08 #define PRLI_NVME_TYPE 0x28
uint8_t word0Reserved1; /* FC Parm Word 0, bit 16:23 */
#ifdef __BIG_ENDIAN_BITFIELD
uint8_t origProcAssocV:1; /* FC Parm Word 0, bit 15 */
uint8_t respProcAssocV:1; /* FC Parm Word 0, bit 14 */
uint8_t estabImagePair:1; /* FC Parm Word 0, bit 13 */
/* ACC = imagePairEstablished */
uint8_t word0Reserved2:1; /* FC Parm Word 0, bit 12 */
uint8_t acceptRspCode:4; /* FC Parm Word 0, bit 8:11, ACC ONLY */ #else/* __LITTLE_ENDIAN_BITFIELD */
uint8_t acceptRspCode:4; /* FC Parm Word 0, bit 8:11, ACC ONLY */
uint8_t word0Reserved2:1; /* FC Parm Word 0, bit 12 */
uint8_t estabImagePair:1; /* FC Parm Word 0, bit 13 */
uint8_t respProcAssocV:1; /* FC Parm Word 0, bit 14 */
uint8_t origProcAssocV:1; /* FC Parm Word 0, bit 15 */ /* ACC = imagePairEstablished */ #endif
uint8_t word0Reserved3; /* FC Parm Word 0, bit 0:7 */
uint32_t origProcAssoc; /* FC Parm Word 1, bit 0:31 */
uint32_t respProcAssoc; /* FC Parm Word 2, bit 0:31 */
uint8_t word3Reserved1; /* FC Parm Word 3, bit 24:31 */
uint8_t word3Reserved2; /* FC Parm Word 3, bit 16:23 */
#ifdef __BIG_ENDIAN_BITFIELD
uint16_t Word3bit15Resved:1; /* FC Parm Word 3, bit 15 */
uint16_t Word3bit14Resved:1; /* FC Parm Word 3, bit 14 */
uint16_t Word3bit13Resved:1; /* FC Parm Word 3, bit 13 */
uint16_t Word3bit12Resved:1; /* FC Parm Word 3, bit 12 */
uint16_t Word3bit11Resved:1; /* FC Parm Word 3, bit 11 */
uint16_t Word3bit10Resved:1; /* FC Parm Word 3, bit 10 */
uint16_t TaskRetryIdReq:1; /* FC Parm Word 3, bit 9 */
uint16_t Retry:1; /* FC Parm Word 3, bit 8 */
uint16_t ConfmComplAllowed:1; /* FC Parm Word 3, bit 7 */
uint16_t dataOverLay:1; /* FC Parm Word 3, bit 6 */
uint16_t initiatorFunc:1; /* FC Parm Word 3, bit 5 */
uint16_t targetFunc:1; /* FC Parm Word 3, bit 4 */
uint16_t cmdDataMixEna:1; /* FC Parm Word 3, bit 3 */
uint16_t dataRspMixEna:1; /* FC Parm Word 3, bit 2 */
uint16_t readXferRdyDis:1; /* FC Parm Word 3, bit 1 */
uint16_t writeXferRdyDis:1; /* FC Parm Word 3, bit 0 */ #else/* __LITTLE_ENDIAN_BITFIELD */
uint16_t Retry:1; /* FC Parm Word 3, bit 8 */
uint16_t TaskRetryIdReq:1; /* FC Parm Word 3, bit 9 */
uint16_t Word3bit10Resved:1; /* FC Parm Word 3, bit 10 */
uint16_t Word3bit11Resved:1; /* FC Parm Word 3, bit 11 */
uint16_t Word3bit12Resved:1; /* FC Parm Word 3, bit 12 */
uint16_t Word3bit13Resved:1; /* FC Parm Word 3, bit 13 */
uint16_t Word3bit14Resved:1; /* FC Parm Word 3, bit 14 */
uint16_t Word3bit15Resved:1; /* FC Parm Word 3, bit 15 */
uint16_t writeXferRdyDis:1; /* FC Parm Word 3, bit 0 */
uint16_t readXferRdyDis:1; /* FC Parm Word 3, bit 1 */
uint16_t dataRspMixEna:1; /* FC Parm Word 3, bit 2 */
uint16_t cmdDataMixEna:1; /* FC Parm Word 3, bit 3 */
uint16_t targetFunc:1; /* FC Parm Word 3, bit 4 */
uint16_t initiatorFunc:1; /* FC Parm Word 3, bit 5 */
uint16_t dataOverLay:1; /* FC Parm Word 3, bit 6 */
uint16_t ConfmComplAllowed:1; /* FC Parm Word 3, bit 7 */ #endif
} PRLI;
typedefstruct _PRLO { /* Structure is in Big Endian format */
uint8_t prloType; /* FC Parm Word 0, bit 24:31 */
#define PRLO_FCP_TYPE 0x08
uint8_t word0Reserved1; /* FC Parm Word 0, bit 16:23 */
#ifdef __BIG_ENDIAN_BITFIELD
uint8_t origProcAssocV:1; /* FC Parm Word 0, bit 15 */
uint8_t respProcAssocV:1; /* FC Parm Word 0, bit 14 */
uint8_t word0Reserved2:2; /* FC Parm Word 0, bit 12:13 */
uint8_t acceptRspCode:4; /* FC Parm Word 0, bit 8:11, ACC ONLY */ #else/* __LITTLE_ENDIAN_BITFIELD */
uint8_t acceptRspCode:4; /* FC Parm Word 0, bit 8:11, ACC ONLY */
uint8_t word0Reserved2:2; /* FC Parm Word 0, bit 12:13 */
uint8_t respProcAssocV:1; /* FC Parm Word 0, bit 14 */
uint8_t origProcAssocV:1; /* FC Parm Word 0, bit 15 */ #endif
uint8_t word0Reserved3; /* FC Parm Word 0, bit 0:7 */
uint32_t origProcAssoc; /* FC Parm Word 1, bit 0:31 */
uint32_t respProcAssoc; /* FC Parm Word 2, bit 0:31 */
uint32_t word3Reserved1; /* FC Parm Word 3, bit 0:31 */
} PRLO;
typedefstruct _ADISC { /* Structure is in Big Endian format */
uint32_t hardAL_PA; struct lpfc_name portName; struct lpfc_name nodeName;
uint32_t DID;
} ADISC;
typedefstruct _FARP { /* Structure is in Big Endian format */
uint32_t Mflags:8;
uint32_t Odid:24; #define FARP_NO_ACTION 0 /* FARP information enclosed, no
action */ #define FARP_MATCH_PORT 0x1 /* Match on Responder Port Name */ #define FARP_MATCH_NODE 0x2 /* Match on Responder Node Name */ #define FARP_MATCH_IP 0x4 /* Match on IP address, not supported */ #define FARP_MATCH_IPV4 0x5 /* Match on IPV4 address, not
supported */ #define FARP_MATCH_IPV6 0x6 /* Match on IPV6 address, not
supported */
uint32_t Rflags:8;
uint32_t Rdid:24; #define FARP_REQUEST_PLOGI 0x1 /* Request for PLOGI */ #define FARP_REQUEST_FARPR 0x2 /* Request for FARP Response */ struct lpfc_name OportName; struct lpfc_name OnodeName; struct lpfc_name RportName; struct lpfc_name RnodeName;
uint8_t Oipaddr[16];
uint8_t Ripaddr[16];
} FARP;
typedefstruct _FAN { /* Structure is in Big Endian format */
uint32_t Fdid; struct lpfc_name FportName; struct lpfc_name FnodeName;
} FAN;
typedefstruct _SCR { /* Structure is in Big Endian format */
uint8_t resvd1;
uint8_t resvd2;
uint8_t resvd3;
uint8_t Function; #define SCR_FUNC_FABRIC 0x01 #define SCR_FUNC_NPORT 0x02 #define SCR_FUNC_FULL 0x03 #define SCR_CLEAR 0xff
} SCR;
typedefstruct _ELS_PKT { /* Structure is in Big Endian format */
uint8_t elsCode; /* FC Word 0, bit 24:31 */
uint8_t elsByte1;
uint8_t elsByte2;
uint8_t elsByte3; union { struct ls_rjt lsRjt; /* Payload for LS_RJT ELS response */ struct serv_parm logi; /* Payload for PLOGI/FLOGI/PDISC/ACC */
LOGO logo; /* Payload for PLOGO/FLOGO/ACC */
PRLI prli; /* Payload for PRLI/ACC */
PRLO prlo; /* Payload for PRLO/ACC */
ADISC adisc; /* Payload for ADISC/ACC */
FARP farp; /* Payload for FARP/ACC */
FAN fan; /* Payload for FAN */
SCR scr; /* Payload for SCR/ACC */
RNID rnid; /* Payload for RNID */
uint8_t pad[128 - 4]; /* Pad out to payload of 128 bytes */
} un;
} ELS_PKT;
/* * Link Cable Beacon (LCB) ELS Frame
*/
struct fc_lcb_request_frame {
uint32_t lcb_command; /* ELS command opcode (0x81) */
uint8_t lcb_sub_command;/* LCB Payload Word 1, bit 24:31 */ #define LPFC_LCB_ON 0x1 #define LPFC_LCB_OFF 0x2
uint8_t reserved[2];
uint8_t capability; /* LCB Payload Word 1, bit 0:7 */
uint8_t lcb_type; /* LCB Payload Word 2, bit 24:31 */ #define LPFC_LCB_GREEN 0x1 #define LPFC_LCB_AMBER 0x2
uint8_t lcb_frequency; /* LCB Payload Word 2, bit 16:23 */ #define LCB_CAPABILITY_DURATION 1 #define BEACON_VERSION_V1 1 #define BEACON_VERSION_V0 0
uint16_t lcb_duration; /* LCB Payload Word 2, bit 15:0 */
};
/* * Link Cable Beacon (LCB) ELS Response Frame
*/ struct fc_lcb_res_frame {
uint32_t lcb_ls_acc; /* Acceptance of LCB request (0x02) */
uint8_t lcb_sub_command;/* LCB Payload Word 1, bit 24:31 */
uint8_t reserved[2];
uint8_t capability; /* LCB Payload Word 1, bit 0:7 */
uint8_t lcb_type; /* LCB Payload Word 2, bit 24:31 */
uint8_t lcb_frequency; /* LCB Payload Word 2, bit 16:23 */
uint16_t lcb_duration; /* LCB Payload Word 2, bit 15:0 */
};
/* * Link Error Status Block Structure (FC-FS-3) for RDP * This similar to RPS ELS
*/ struct fc_link_status {
uint32_t link_failure_cnt;
uint32_t loss_of_synch_cnt;
uint32_t loss_of_signal_cnt;
uint32_t primitive_seq_proto_err;
uint32_t invalid_trans_word;
uint32_t invalid_crc_cnt;
};
#define RDP_PORT_NAMES_DESC_TAG 0x00010003 struct fc_rdp_port_name_desc {
uint32_t tag; /* 0001 0003h */
uint32_t length; /* set to size of payload struct */ struct fc_rdp_port_name_info port_names;
};
#define RDP_LINK_SERVICE_DESC_TAG 0x00000001 struct fc_rdp_link_service_desc {
uint32_t tag; /* Descriptor tag 1 */
uint32_t length; /* set to size of payload struct. */ struct fc_rdp_link_service_info payload; /* must be ELS req Word 0(0x18) */
};
struct fc_rdp_req_frame {
uint32_t rdp_command; /* ELS command opcode (0x18)*/
uint32_t rdp_des_length; /* RDP Payload Word 1 */ struct fc_rdp_nport_desc nport_id_desc; /* RDP Payload Word 2 - 4 */
};
struct fc_rdp_res_frame {
uint32_t reply_sequence; /* FC word0 LS_ACC or LS_RJT */
uint32_t length; /* FC Word 1 */ struct fc_rdp_link_service_desc link_service_desc; /* Word 2 -4 */ struct fc_rdp_sfp_desc sfp_desc; /* Word 5 -9 */ struct fc_rdp_port_speed_desc portspeed_desc; /* Word 10 -12 */ struct fc_rdp_link_error_status_desc link_error_desc; /* Word 13 -21 */ struct fc_rdp_port_name_desc diag_port_names_desc; /* Word 22 -27 */ struct fc_rdp_port_name_desc attached_port_names_desc;/* Word 28 -33 */ struct fc_fec_rdp_desc fec_desc; /* FC word 34-37*/ struct fc_rdp_bbc_desc bbc_desc; /* FC Word 38-42*/ struct fc_rdp_oed_sfp_desc oed_temp_desc; /* FC Word 43-47*/ struct fc_rdp_oed_sfp_desc oed_voltage_desc; /* FC word 48-52*/ struct fc_rdp_oed_sfp_desc oed_txbias_desc; /* FC word 53-57*/ struct fc_rdp_oed_sfp_desc oed_txpower_desc; /* FC word 58-62*/ struct fc_rdp_oed_sfp_desc oed_rxpower_desc; /* FC word 63-67*/ struct fc_rdp_opd_sfp_desc opd_desc; /* FC word 68-84*/
};
typedefstruct { /* FireFly BIU registers */
uint32_t hostAtt; /* See definitions for Host Attention
register */
uint32_t chipAtt; /* See definitions for Chip Attention
register */
uint32_t hostStatus; /* See definitions for Host Status register */
uint32_t hostControl; /* See definitions for Host Control register */
uint32_t buiConfig; /* See definitions for BIU configuration
register */
} FF_REGS;
/* IO Register size in bytes */ #define FF_REG_AREA_SIZE 256
/* Host Attention Register */
#define HA_REG_OFFSET 0 /* Byte offset from register base address */
#define HA_R0RE_REQ 0x00000001 /* Bit 0 */ #define HA_R0CE_RSP 0x00000002 /* Bit 1 */ #define HA_R0ATT 0x00000008 /* Bit 3 */ #define HA_R1RE_REQ 0x00000010 /* Bit 4 */ #define HA_R1CE_RSP 0x00000020 /* Bit 5 */ #define HA_R1ATT 0x00000080 /* Bit 7 */ #define HA_R2RE_REQ 0x00000100 /* Bit 8 */ #define HA_R2CE_RSP 0x00000200 /* Bit 9 */ #define HA_R2ATT 0x00000800 /* Bit 11 */ #define HA_R3RE_REQ 0x00001000 /* Bit 12 */ #define HA_R3CE_RSP 0x00002000 /* Bit 13 */ #define HA_R3ATT 0x00008000 /* Bit 15 */ #define HA_LATT 0x20000000 /* Bit 29 */ #define HA_MBATT 0x40000000 /* Bit 30 */ #define HA_ERATT 0x80000000 /* Bit 31 */
#define HA_RXRE_REQ 0x00000001 /* Bit 0 */ #define HA_RXCE_RSP 0x00000002 /* Bit 1 */ #define HA_RXATT 0x00000008 /* Bit 3 */ #define HA_RXMASK 0x0000000f
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.