aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/lpfc/lpfc_hw.h
diff options
context:
space:
mode:
authorJames Smart <james.smart@emulex.com>2015-04-07 15:07:19 -0400
committerJames Bottomley <JBottomley@Odin.com>2015-04-10 10:48:57 -0400
commit76b2c34aeb947a649e52e0f03f5b930ef936e506 (patch)
tree20839e989304d204a320e92ed31dda8c269e584b /drivers/scsi/lpfc/lpfc_hw.h
parentf0bf5f91908f7c8819d4111c7bd793178021aa3f (diff)
lpfc: Fix FDMI Fabric support in driver for Brocade
Signed-off-by: Dick Kennedy <dick.kennedy@emulex.com> Signed-off-by: James Smart <james.smart@emulex.com> Reviewed-by: Hannes Reinecke <hare@suse.de> Signed-off-by: James Bottomley <JBottomley@Odin.com>
Diffstat (limited to 'drivers/scsi/lpfc/lpfc_hw.h')
-rw-r--r--drivers/scsi/lpfc/lpfc_hw.h206
1 files changed, 97 insertions, 109 deletions
diff --git a/drivers/scsi/lpfc/lpfc_hw.h b/drivers/scsi/lpfc/lpfc_hw.h
index 236259252379..a74bbf0029ac 100644
--- a/drivers/scsi/lpfc/lpfc_hw.h
+++ b/drivers/scsi/lpfc/lpfc_hw.h
@@ -107,6 +107,7 @@ struct lpfc_sli_ct_request {
107 uint8_t ReasonCode; 107 uint8_t ReasonCode;
108 uint8_t Explanation; 108 uint8_t Explanation;
109 uint8_t VendorUnique; 109 uint8_t VendorUnique;
110#define LPFC_CT_PREAMBLE 20 /* Size of CTReq + 4 up to here */
110 111
111 union { 112 union {
112 uint32_t PortID; 113 uint32_t PortID;
@@ -170,6 +171,8 @@ struct lpfc_sli_ct_request {
170 } un; 171 } un;
171}; 172};
172 173
174#define LPFC_MAX_CT_SIZE (60 * 4096)
175
173#define SLI_CT_REVISION 1 176#define SLI_CT_REVISION 1
174#define GID_REQUEST_SZ (offsetof(struct lpfc_sli_ct_request, un) + \ 177#define GID_REQUEST_SZ (offsetof(struct lpfc_sli_ct_request, un) + \
175 sizeof(struct gid)) 178 sizeof(struct gid))
@@ -1007,78 +1010,45 @@ typedef struct _ELS_PKT { /* Structure is in Big Endian format */
1007 } un; 1010 } un;
1008} ELS_PKT; 1011} ELS_PKT;
1009 1012
1010/* 1013/******** FDMI ********/
1011 * FDMI
1012 * HBA MAnagement Operations Command Codes
1013 */
1014#define SLI_MGMT_GRHL 0x100 /* Get registered HBA list */
1015#define SLI_MGMT_GHAT 0x101 /* Get HBA attributes */
1016#define SLI_MGMT_GRPL 0x102 /* Get registered Port list */
1017#define SLI_MGMT_GPAT 0x110 /* Get Port attributes */
1018#define SLI_MGMT_RHBA 0x200 /* Register HBA */
1019#define SLI_MGMT_RHAT 0x201 /* Register HBA attributes */
1020#define SLI_MGMT_RPRT 0x210 /* Register Port */
1021#define SLI_MGMT_RPA 0x211 /* Register Port attributes */
1022#define SLI_MGMT_DHBA 0x300 /* De-register HBA */
1023#define SLI_MGMT_DPRT 0x310 /* De-register Port */
1024 1014
1025/* 1015/* lpfc_sli_ct_request defines the CT_IU preamble for FDMI commands */
1026 * Management Service Subtypes 1016#define SLI_CT_FDMI_Subtypes 0x10 /* Management Service Subtype */
1027 */
1028#define SLI_CT_FDMI_Subtypes 0x10
1029 1017
1030/* 1018/*
1031 * HBA Management Service Reject Code 1019 * Registered Port List Format
1032 */ 1020 */
1033#define REJECT_CODE 0x9 /* Unable to perform command request */ 1021struct lpfc_fdmi_reg_port_list {
1022 uint32_t EntryCnt;
1023 uint32_t pe; /* Variable-length array */
1024};
1034 1025
1035/*
1036 * HBA Management Service Reject Reason Code
1037 * Please refer to the Reason Codes above
1038 */
1039 1026
1040/* 1027/* Definitions for HBA / Port attribute entries */
1041 * HBA Attribute Types
1042 */
1043#define NODE_NAME 0x1
1044#define MANUFACTURER 0x2
1045#define SERIAL_NUMBER 0x3
1046#define MODEL 0x4
1047#define MODEL_DESCRIPTION 0x5
1048#define HARDWARE_VERSION 0x6
1049#define DRIVER_VERSION 0x7
1050#define OPTION_ROM_VERSION 0x8
1051#define FIRMWARE_VERSION 0x9
1052#define OS_NAME_VERSION 0xa
1053#define MAX_CT_PAYLOAD_LEN 0xb
1054 1028
1055/* 1029struct lpfc_fdmi_attr_def { /* Defined in TLV format */
1056 * Port Attrubute Types
1057 */
1058#define SUPPORTED_FC4_TYPES 0x1
1059#define SUPPORTED_SPEED 0x2
1060#define PORT_SPEED 0x3
1061#define MAX_FRAME_SIZE 0x4
1062#define OS_DEVICE_NAME 0x5
1063#define HOST_NAME 0x6
1064
1065union AttributesDef {
1066 /* Structure is in Big Endian format */ 1030 /* Structure is in Big Endian format */
1067 struct { 1031 uint32_t AttrType:16;
1068 uint32_t AttrType:16; 1032 uint32_t AttrLen:16;
1069 uint32_t AttrLen:16; 1033 uint32_t AttrValue; /* Marks start of Value (ATTRIBUTE_ENTRY) */
1070 } bits;
1071 uint32_t word;
1072}; 1034};
1073 1035
1074 1036
1075/* 1037/* Attribute Entry */
1076 * HBA Attribute Entry (8 - 260 bytes) 1038struct lpfc_fdmi_attr_entry {
1077 */
1078typedef struct {
1079 union AttributesDef ad;
1080 union { 1039 union {
1081 uint32_t VendorSpecific; 1040 uint32_t VendorSpecific;
1041 uint32_t SupportClass;
1042 uint32_t SupportSpeed;
1043 uint32_t PortSpeed;
1044 uint32_t MaxFrameSize;
1045 uint32_t MaxCTPayloadLen;
1046 uint32_t PortState;
1047 uint32_t PortId;
1048 struct lpfc_name NodeName;
1049 struct lpfc_name PortName;
1050 struct lpfc_name FabricName;
1051 uint8_t FC4Types[32];
1082 uint8_t Manufacturer[64]; 1052 uint8_t Manufacturer[64];
1083 uint8_t SerialNumber[64]; 1053 uint8_t SerialNumber[64];
1084 uint8_t Model[256]; 1054 uint8_t Model[256];
@@ -1087,97 +1057,115 @@ typedef struct {
1087 uint8_t DriverVersion[256]; 1057 uint8_t DriverVersion[256];
1088 uint8_t OptionROMVersion[256]; 1058 uint8_t OptionROMVersion[256];
1089 uint8_t FirmwareVersion[256]; 1059 uint8_t FirmwareVersion[256];
1090 struct lpfc_name NodeName; 1060 uint8_t OsHostName[256];
1091 uint8_t SupportFC4Types[32]; 1061 uint8_t NodeSymName[256];
1092 uint32_t SupportSpeed;
1093 uint32_t PortSpeed;
1094 uint32_t MaxFrameSize;
1095 uint8_t OsDeviceName[256]; 1062 uint8_t OsDeviceName[256];
1096 uint8_t OsNameVersion[256]; 1063 uint8_t OsNameVersion[256];
1097 uint32_t MaxCTPayloadLen;
1098 uint8_t HostName[256]; 1064 uint8_t HostName[256];
1099 } un; 1065 } un;
1100} ATTRIBUTE_ENTRY; 1066};
1067
1068#define LPFC_FDMI_MAX_AE_SIZE sizeof(struct lpfc_fdmi_attr_entry)
1101 1069
1102/* 1070/*
1103 * HBA Attribute Block 1071 * HBA Attribute Block
1104 */ 1072 */
1105typedef struct { 1073struct lpfc_fdmi_attr_block {
1106 uint32_t EntryCnt; /* Number of HBA attribute entries */ 1074 uint32_t EntryCnt; /* Number of HBA attribute entries */
1107 ATTRIBUTE_ENTRY Entry; /* Variable-length array */ 1075 struct lpfc_fdmi_attr_entry Entry; /* Variable-length array */
1108} ATTRIBUTE_BLOCK; 1076};
1109 1077
1110/* 1078/*
1111 * Port Entry 1079 * Port Entry
1112 */ 1080 */
1113typedef struct { 1081struct lpfc_fdmi_port_entry {
1114 struct lpfc_name PortName; 1082 struct lpfc_name PortName;
1115} PORT_ENTRY; 1083};
1116 1084
1117/* 1085/*
1118 * HBA Identifier 1086 * HBA Identifier
1119 */ 1087 */
1120typedef struct { 1088struct lpfc_fdmi_hba_ident {
1121 struct lpfc_name PortName; 1089 struct lpfc_name PortName;
1122} HBA_IDENTIFIER; 1090};
1123
1124/*
1125 * Registered Port List Format
1126 */
1127typedef struct {
1128 uint32_t EntryCnt;
1129 PORT_ENTRY pe; /* Variable-length array */
1130} REG_PORT_LIST;
1131 1091
1132/* 1092/*
1133 * Register HBA(RHBA) 1093 * Register HBA(RHBA)
1134 */ 1094 */
1135typedef struct { 1095struct lpfc_fdmi_reg_hba {
1136 HBA_IDENTIFIER hi; 1096 struct lpfc_fdmi_hba_ident hi;
1137 REG_PORT_LIST rpl; /* variable-length array */ 1097 struct lpfc_fdmi_reg_port_list rpl; /* variable-length array */
1138/* ATTRIBUTE_BLOCK ab; */ 1098/* struct lpfc_fdmi_attr_block ab; */
1139} REG_HBA; 1099};
1140 1100
1141/* 1101/*
1142 * Register HBA Attributes (RHAT) 1102 * Register HBA Attributes (RHAT)
1143 */ 1103 */
1144typedef struct { 1104struct lpfc_fdmi_reg_hbaattr {
1145 struct lpfc_name HBA_PortName; 1105 struct lpfc_name HBA_PortName;
1146 ATTRIBUTE_BLOCK ab; 1106 struct lpfc_fdmi_attr_block ab;
1147} REG_HBA_ATTRIBUTE; 1107};
1148 1108
1149/* 1109/*
1150 * Register Port Attributes (RPA) 1110 * Register Port Attributes (RPA)
1151 */ 1111 */
1152typedef struct { 1112struct lpfc_fdmi_reg_portattr {
1153 struct lpfc_name PortName; 1113 struct lpfc_name PortName;
1154 ATTRIBUTE_BLOCK ab; 1114 struct lpfc_fdmi_attr_block ab;
1155} REG_PORT_ATTRIBUTE; 1115};
1156 1116
1157/* 1117/*
1158 * Get Registered HBA List (GRHL) Accept Payload Format 1118 * HBA MAnagement Operations Command Codes
1159 */ 1119 */
1160typedef struct { 1120#define SLI_MGMT_GRHL 0x100 /* Get registered HBA list */
1161 uint32_t HBA__Entry_Cnt; /* Number of Registered HBA Identifiers */ 1121#define SLI_MGMT_GHAT 0x101 /* Get HBA attributes */
1162 struct lpfc_name HBA_PortName; /* Variable-length array */ 1122#define SLI_MGMT_GRPL 0x102 /* Get registered Port list */
1163} GRHL_ACC_PAYLOAD; 1123#define SLI_MGMT_GPAT 0x110 /* Get Port attributes */
1124#define SLI_MGMT_GPAS 0x120 /* Get Port Statistics */
1125#define SLI_MGMT_RHBA 0x200 /* Register HBA */
1126#define SLI_MGMT_RHAT 0x201 /* Register HBA attributes */
1127#define SLI_MGMT_RPRT 0x210 /* Register Port */
1128#define SLI_MGMT_RPA 0x211 /* Register Port attributes */
1129#define SLI_MGMT_DHBA 0x300 /* De-register HBA */
1130#define SLI_MGMT_DHAT 0x301 /* De-register HBA attributes */
1131#define SLI_MGMT_DPRT 0x310 /* De-register Port */
1132#define SLI_MGMT_DPA 0x311 /* De-register Port attributes */
1164 1133
1165/* 1134/*
1166 * Get Registered Port List (GRPL) Accept Payload Format 1135 * HBA Attribute Types
1167 */ 1136 */
1168typedef struct { 1137#define RHBA_NODENAME 0x1 /* 8 byte WWNN */
1169 uint32_t RPL_Entry_Cnt; /* Number of Registered Port Entries */ 1138#define RHBA_MANUFACTURER 0x2 /* 4 to 64 byte ASCII string */
1170 PORT_ENTRY Reg_Port_Entry[1]; /* Variable-length array */ 1139#define RHBA_SERIAL_NUMBER 0x3 /* 4 to 64 byte ASCII string */
1171} GRPL_ACC_PAYLOAD; 1140#define RHBA_MODEL 0x4 /* 4 to 256 byte ASCII string */
1141#define RHBA_MODEL_DESCRIPTION 0x5 /* 4 to 256 byte ASCII string */
1142#define RHBA_HARDWARE_VERSION 0x6 /* 4 to 256 byte ASCII string */
1143#define RHBA_DRIVER_VERSION 0x7 /* 4 to 256 byte ASCII string */
1144#define RHBA_OPTION_ROM_VERSION 0x8 /* 4 to 256 byte ASCII string */
1145#define RHBA_FIRMWARE_VERSION 0x9 /* 4 to 256 byte ASCII string */
1146#define RHBA_OS_NAME_VERSION 0xa /* 4 to 256 byte ASCII string */
1147#define RHBA_MAX_CT_PAYLOAD_LEN 0xb /* 32-bit unsigned int */
1148#define RHBA_SYM_NODENAME 0xc /* 4 to 256 byte ASCII string */
1172 1149
1173/* 1150/*
1174 * Get Port Attributes (GPAT) Accept Payload Format 1151 * Port Attrubute Types
1175 */ 1152 */
1176 1153#define RPRT_SUPPORTED_FC4_TYPES 0x1 /* 32 byte binary array */
1177typedef struct { 1154#define RPRT_SUPPORTED_SPEED 0x2 /* 32-bit unsigned int */
1178 ATTRIBUTE_BLOCK pab; 1155#define RPRT_PORT_SPEED 0x3 /* 32-bit unsigned int */
1179} GPAT_ACC_PAYLOAD; 1156#define RPRT_MAX_FRAME_SIZE 0x4 /* 32-bit unsigned int */
1180 1157#define RPRT_OS_DEVICE_NAME 0x5 /* 4 to 256 byte ASCII string */
1158#define RPRT_HOST_NAME 0x6 /* 4 to 256 byte ASCII string */
1159#define RPRT_NODENAME 0x7 /* 8 byte WWNN */
1160#define RPRT_PORTNAME 0x8 /* 8 byte WWNN */
1161#define RPRT_SYM_PORTNAME 0x9 /* 4 to 256 byte ASCII string */
1162#define RPRT_PORT_TYPE 0xa /* 32-bit unsigned int */
1163#define RPRT_SUPPORTED_CLASS 0xb /* 32-bit unsigned int */
1164#define RPRT_FABRICNAME 0xc /* 8 byte Fabric WWNN */
1165#define RPRT_ACTIVE_FC4_TYPES 0xd /* 32 byte binary array */
1166#define RPRT_PORT_STATE 0x101 /* 32-bit unsigned int */
1167#define RPRT_DISC_PORT 0x102 /* 32-bit unsigned int */
1168#define RPRT_PORT_ID 0x103 /* 32-bit unsigned int */
1181 1169
1182/* 1170/*
1183 * Begin HBA configuration parameters. 1171 * Begin HBA configuration parameters.