📄 lpfc_hw.h
字号:
#define ELS_RSP_MASK 0xff#define ELS_CMD_LS_RJT 0x01#define ELS_CMD_ACC 0x02#define ELS_CMD_PLOGI 0x03#define ELS_CMD_FLOGI 0x04#define ELS_CMD_LOGO 0x05#define ELS_CMD_ABTX 0x06#define ELS_CMD_RCS 0x07#define ELS_CMD_RES 0x08#define ELS_CMD_RSS 0x09#define ELS_CMD_RSI 0x0A#define ELS_CMD_ESTS 0x0B#define ELS_CMD_ESTC 0x0C#define ELS_CMD_ADVC 0x0D#define ELS_CMD_RTV 0x0E#define ELS_CMD_RLS 0x0F#define ELS_CMD_ECHO 0x10#define ELS_CMD_TEST 0x11#define ELS_CMD_RRQ 0x12#define ELS_CMD_PRLI 0x14001020#define ELS_CMD_PRLO 0x14001021#define ELS_CMD_PDISC 0x50#define ELS_CMD_FDISC 0x51#define ELS_CMD_ADISC 0x52#define ELS_CMD_FARP 0x54#define ELS_CMD_FARPR 0x55#define ELS_CMD_FAN 0x60#define ELS_CMD_RSCN 0x0461#define ELS_CMD_SCR 0x62#define ELS_CMD_RNID 0x78#endif/* * LS_RJT Payload Definition */struct ls_rjt { /* Structure is in Big Endian format */ union { 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 */ uint8_t lsRjtRsnCodeExp; /* FC Word 0, bit 8:15 */ /* LS_RJT reason explanation */#define LSEXP_NOTHING_MORE 0x00#define LSEXP_SPARM_OPTIONS 0x01#define LSEXP_SPARM_ICTL 0x03#define LSEXP_SPARM_RCTL 0x05#define LSEXP_SPARM_RCV_SIZE 0x07#define LSEXP_SPARM_CONCUR_SEQ 0x09#define LSEXP_SPARM_CREDIT 0x0B#define LSEXP_INVALID_PNAME 0x0D#define LSEXP_INVALID_NNAME 0x0E#define LSEXP_INVALID_CSP 0x0F#define LSEXP_INVALID_ASSOC_HDR 0x11#define LSEXP_ASSOC_HDR_REQ 0x13#define LSEXP_INVALID_O_SID 0x15#define LSEXP_INVALID_OX_RX 0x17#define LSEXP_CMD_IN_PROGRESS 0x19#define LSEXP_INVALID_NPORT_ID 0x1F#define LSEXP_INVALID_SEQ_ID 0x21#define LSEXP_INVALID_XCHG 0x23#define LSEXP_INACTIVE_XCHG 0x25#define LSEXP_RQ_REQUIRED 0x27#define LSEXP_OUT_OF_RESOURCE 0x29#define LSEXP_CANT_GIVE_DATA 0x2A#define LSEXP_REQ_UNSUPPORTED 0x2C uint8_t vendorUnique; /* FC Word 0, bit 0: 7 */ } b; } un;};/* * N_Port Login (FLOGO/PLOGO Request) Payload Definition */typedef struct _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;/* * FCP Login (PRLI Request / ACC) Payload Definition */#define PRLX_PAGE_LEN 0x10#define TPRLO_PAGE_LEN 0x14typedef struct _PRLI { /* Structure is in Big Endian format */ uint8_t prliType; /* FC Parm Word 0, bit 24:31 */#define PRLI_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 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#define PRLI_REQ_EXECUTED 0x1 /* acceptRspCode */#define PRLI_NO_RESOURCES 0x2#define PRLI_INIT_INCOMPLETE 0x3#define PRLI_NO_SUCH_PA 0x4#define PRLI_PREDEF_CONFIG 0x5#define PRLI_PARTIAL_SUCCESS 0x6#define PRLI_INVALID_PAGE_CNT 0x7 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;/* * FCP Logout (PRLO Request / ACC) Payload Definition */typedef struct _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#define PRLO_REQ_EXECUTED 0x1 /* acceptRspCode */#define PRLO_NO_SUCH_IMAGE 0x4#define PRLO_INVALID_PAGE_CNT 0x7 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;typedef struct _ADISC { /* Structure is in Big Endian format */ uint32_t hardAL_PA; struct lpfc_name portName; struct lpfc_name nodeName; uint32_t DID;} ADISC;typedef struct _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;typedef struct _FAN { /* Structure is in Big Endian format */ uint32_t Fdid; struct lpfc_name FportName; struct lpfc_name FnodeName;} FAN;typedef struct _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;typedef struct _RNID_TOP_DISC { struct lpfc_name portName; uint8_t resvd[8]; uint32_t unitType;#define RNID_HBA 0x7#define RNID_HOST 0xa#define RNID_DRIVER 0xd uint32_t physPort; uint32_t attachedNodes; uint16_t ipVersion;#define RNID_IPV4 0x1#define RNID_IPV6 0x2 uint16_t UDPport; uint8_t ipAddr[16]; uint16_t resvd1; uint16_t flags;#define RNID_TD_SUPPORT 0x1#define RNID_LP_VALID 0x2} RNID_TOP_DISC;typedef struct _RNID { /* Structure is in Big Endian format */ uint8_t Format;#define RNID_TOPOLOGY_DISC 0xdf uint8_t CommonLen; uint8_t resvd1; uint8_t SpecificLen; struct lpfc_name portName; struct lpfc_name nodeName; union { RNID_TOP_DISC topologyDisc; /* topology disc (0xdf) */ } un;} RNID;typedef struct _RRQ { /* Structure is in Big Endian format */ uint32_t SID; uint16_t Oxid; uint16_t Rxid; uint8_t resv[32]; /* optional association hdr */} RRQ;/* This is used for RSCN command */typedef struct _D_ID { /* Structure is in Big Endian format */ union { uint32_t word; struct {#ifdef __BIG_ENDIAN_BITFIELD uint8_t resv; uint8_t domain; uint8_t area; uint8_t id;#else /* __LITTLE_ENDIAN_BITFIELD */ uint8_t id; uint8_t area; uint8_t domain; uint8_t resv;#endif } b; } un;} D_ID;/* * Structure to define all ELS Payload types */typedef struct _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 */ RRQ rrq; /* Payload for RRQ */ RNID rnid; /* Payload for RNID */ uint8_t pad[128 - 4]; /* Pad out to payload of 128 bytes */ } un;} ELS_PKT;/* * FDMI * HBA MAnagement Operations Command Codes */#define SLI_MGMT_GRHL 0x100 /* Get registered HBA list */#define SLI_MGMT_GHAT 0x101 /* Get HBA attributes */#define SLI_MGMT_GRPL 0x102 /* Get registered Port list */#define SLI_MGMT_GPAT 0x110 /* Get Port attributes */#define SLI_MGMT_RHBA 0x200 /* Register HBA */#define SLI_MGMT_RHAT 0x201 /* Register HBA atttributes */#define SLI_MGMT_RPRT 0x210 /* Register Port */#define SLI_MGMT_RPA 0x211 /* Register Port attributes */#define SLI_MGMT_DHBA 0x300 /* De-register HBA */#define SLI_MGMT_DPRT 0x310 /* De-register Port *//* * Management Service Subtypes */#define SLI_CT_FDMI_Subtypes 0x10/* * HBA Management Service Reject Code */#define REJECT_CODE 0x9 /* Unable to perform command request *//* * HBA Management Service Reject Reason Code * Please refer to the Reason Codes above *//* * HBA Attribute Types */#define NODE_NAME 0x1#define MANUFACTURER 0x2#define SERIAL_NUMBER 0x3#define MODEL 0x4#define MODEL_DESCRIPTION 0x5#define HARDWARE_VERSION 0x6#define DRIVER_VERSION 0x7#define OPTION_ROM_VERSION 0x8#define FIRMWARE_VERSION 0x9#define OS_NAME_VERSION 0xa#define MAX_CT_PAYLOAD_LEN 0xb/* * Port Attrubute Types */#define SUPPORTED_FC4_TYPES 0x1#define SUPPORTED_SPEED 0x2#define PORT_SPEED 0x3#define MAX_FRAME_SIZE 0x4#define OS_DEVICE_NAME 0x5#define HOST_NAME 0x6union AttributesDef { /* Structure is in Big Endian format */ struct { uint32_t AttrType:16; uint32_t AttrLen:16; } bits; uint32_t word;};/* * HBA Attribute Entry (8 - 260 bytes) */typedef struct { union AttributesDef ad; union { uint32_t VendorSpecific; uint8_t Manufacturer[64]; uint8_t SerialNumber[64]; uint8_t Model[256]; uint8_t ModelDescription[256]; uint8_t HardwareVersion[256]; uint8_t DriverVersion[256]; uint8_t OptionROMVersion[256]; uint8_t FirmwareVersion[256]; struct lpfc_name NodeName; uint8_t SupportFC4Types[32]; uint32_t SupportSpeed; uint32_t PortSpeed; uint32_t MaxFrameSize; uint8_t OsDeviceName[256]; uint8_t OsNameVersion[256]; uint32_t MaxCTPayloadLen; uint8_t HostName[256]; } un;} ATTRIBUTE_ENTRY;/* * HBA Attribute Block */typedef struct { uint32_t EntryCnt; /* Number of HBA attribute entries */ ATTRIBUTE_ENTRY Entry; /* Variable-length array */} ATTRIBUTE_BLOCK;/* * Port Entry */typedef struct { struct lpfc_name PortName;} PORT_ENTRY;/* * HBA Identifier
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -