aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/lpfc/lpfc_hw.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/lpfc/lpfc_hw.h')
-rw-r--r--drivers/scsi/lpfc/lpfc_hw.h201
1 files changed, 201 insertions, 0 deletions
diff --git a/drivers/scsi/lpfc/lpfc_hw.h b/drivers/scsi/lpfc/lpfc_hw.h
index 37beb9dc1311..892c5257d87c 100644
--- a/drivers/scsi/lpfc/lpfc_hw.h
+++ b/drivers/scsi/lpfc/lpfc_hw.h
@@ -543,6 +543,7 @@ struct fc_vft_header {
543#define ELS_CMD_TEST 0x11000000 543#define ELS_CMD_TEST 0x11000000
544#define ELS_CMD_RRQ 0x12000000 544#define ELS_CMD_RRQ 0x12000000
545#define ELS_CMD_REC 0x13000000 545#define ELS_CMD_REC 0x13000000
546#define ELS_CMD_RDP 0x18000000
546#define ELS_CMD_PRLI 0x20100014 547#define ELS_CMD_PRLI 0x20100014
547#define ELS_CMD_PRLO 0x21100014 548#define ELS_CMD_PRLO 0x21100014
548#define ELS_CMD_PRLO_ACC 0x02100014 549#define ELS_CMD_PRLO_ACC 0x02100014
@@ -558,6 +559,7 @@ struct fc_vft_header {
558#define ELS_CMD_SCR 0x62000000 559#define ELS_CMD_SCR 0x62000000
559#define ELS_CMD_RNID 0x78000000 560#define ELS_CMD_RNID 0x78000000
560#define ELS_CMD_LIRR 0x7A000000 561#define ELS_CMD_LIRR 0x7A000000
562#define ELS_CMD_LCB 0x81000000
561#else /* __LITTLE_ENDIAN_BITFIELD */ 563#else /* __LITTLE_ENDIAN_BITFIELD */
562#define ELS_CMD_MASK 0xffff 564#define ELS_CMD_MASK 0xffff
563#define ELS_RSP_MASK 0xff 565#define ELS_RSP_MASK 0xff
@@ -580,6 +582,7 @@ struct fc_vft_header {
580#define ELS_CMD_TEST 0x11 582#define ELS_CMD_TEST 0x11
581#define ELS_CMD_RRQ 0x12 583#define ELS_CMD_RRQ 0x12
582#define ELS_CMD_REC 0x13 584#define ELS_CMD_REC 0x13
585#define ELS_CMD_RDP 0x18
583#define ELS_CMD_PRLI 0x14001020 586#define ELS_CMD_PRLI 0x14001020
584#define ELS_CMD_PRLO 0x14001021 587#define ELS_CMD_PRLO 0x14001021
585#define ELS_CMD_PRLO_ACC 0x14001002 588#define ELS_CMD_PRLO_ACC 0x14001002
@@ -595,6 +598,7 @@ struct fc_vft_header {
595#define ELS_CMD_SCR 0x62 598#define ELS_CMD_SCR 0x62
596#define ELS_CMD_RNID 0x78 599#define ELS_CMD_RNID 0x78
597#define ELS_CMD_LIRR 0x7A 600#define ELS_CMD_LIRR 0x7A
601#define ELS_CMD_LCB 0x81
598#endif 602#endif
599 603
600/* 604/*
@@ -1010,6 +1014,198 @@ typedef struct _ELS_PKT { /* Structure is in Big Endian format */
1010 } un; 1014 } un;
1011} ELS_PKT; 1015} ELS_PKT;
1012 1016
1017/*
1018 * Link Cable Beacon (LCB) ELS Frame
1019 */
1020
1021struct fc_lcb_request_frame {
1022 uint32_t lcb_command; /* ELS command opcode (0x81) */
1023 uint8_t lcb_sub_command;/* LCB Payload Word 1, bit 24:31 */
1024#define LPFC_LCB_ON 0x1
1025#define LPFC_LCB_OFF 0x2
1026 uint8_t reserved[3];
1027
1028 uint8_t lcb_type; /* LCB Payload Word 2, bit 24:31 */
1029#define LPFC_LCB_GREEN 0x1
1030#define LPFC_LCB_AMBER 0x2
1031 uint8_t lcb_frequency; /* LCB Payload Word 2, bit 16:23 */
1032 uint16_t lcb_duration; /* LCB Payload Word 2, bit 15:0 */
1033};
1034
1035/*
1036 * Link Cable Beacon (LCB) ELS Response Frame
1037 */
1038struct fc_lcb_res_frame {
1039 uint32_t lcb_ls_acc; /* Acceptance of LCB request (0x02) */
1040 uint8_t lcb_sub_command;/* LCB Payload Word 1, bit 24:31 */
1041 uint8_t reserved[3];
1042 uint8_t lcb_type; /* LCB Payload Word 2, bit 24:31 */
1043 uint8_t lcb_frequency; /* LCB Payload Word 2, bit 16:23 */
1044 uint16_t lcb_duration; /* LCB Payload Word 2, bit 15:0 */
1045};
1046
1047/*
1048 * Read Diagnostic Parameters (RDP) ELS frame.
1049 */
1050#define SFF_PG0_IDENT_SFP 0x3
1051
1052#define SFP_FLAG_PT_OPTICAL 0x0
1053#define SFP_FLAG_PT_SWLASER 0x01
1054#define SFP_FLAG_PT_LWLASER_LC1310 0x02
1055#define SFP_FLAG_PT_LWLASER_LL1550 0x03
1056#define SFP_FLAG_PT_MASK 0x0F
1057#define SFP_FLAG_PT_SHIFT 0
1058
1059#define SFP_FLAG_IS_OPTICAL_PORT 0x01
1060#define SFP_FLAG_IS_OPTICAL_MASK 0x010
1061#define SFP_FLAG_IS_OPTICAL_SHIFT 4
1062
1063#define SFP_FLAG_IS_DESC_VALID 0x01
1064#define SFP_FLAG_IS_DESC_VALID_MASK 0x020
1065#define SFP_FLAG_IS_DESC_VALID_SHIFT 5
1066
1067#define SFP_FLAG_CT_UNKNOWN 0x0
1068#define SFP_FLAG_CT_SFP_PLUS 0x01
1069#define SFP_FLAG_CT_MASK 0x3C
1070#define SFP_FLAG_CT_SHIFT 6
1071
1072struct fc_rdp_port_name_info {
1073 uint8_t wwnn[8];
1074 uint8_t wwpn[8];
1075};
1076
1077
1078/*
1079 * Link Error Status Block Structure (FC-FS-3) for RDP
1080 * This similar to RPS ELS
1081 */
1082struct fc_link_status {
1083 uint32_t link_failure_cnt;
1084 uint32_t loss_of_synch_cnt;
1085 uint32_t loss_of_signal_cnt;
1086 uint32_t primitive_seq_proto_err;
1087 uint32_t invalid_trans_word;
1088 uint32_t invalid_crc_cnt;
1089
1090};
1091
1092#define RDP_PORT_NAMES_DESC_TAG 0x00010003
1093struct fc_rdp_port_name_desc {
1094 uint32_t tag; /* 0001 0003h */
1095 uint32_t length; /* set to size of payload struct */
1096 struct fc_rdp_port_name_info port_names;
1097};
1098
1099
1100struct fc_rdp_link_error_status_payload_info {
1101 struct fc_link_status link_status; /* 24 bytes */
1102 uint32_t port_type; /* bits 31-30 only */
1103};
1104
1105#define RDP_LINK_ERROR_STATUS_DESC_TAG 0x00010002
1106struct fc_rdp_link_error_status_desc {
1107 uint32_t tag; /* 0001 0002h */
1108 uint32_t length; /* set to size of payload struct */
1109 struct fc_rdp_link_error_status_payload_info info;
1110};
1111
1112#define VN_PT_PHY_UNKNOWN 0x00
1113#define VN_PT_PHY_PF_PORT 0x01
1114#define VN_PT_PHY_ETH_MAC 0x10
1115#define VN_PT_PHY_SHIFT 30
1116
1117#define RDP_PS_1GB 0x8000
1118#define RDP_PS_2GB 0x4000
1119#define RDP_PS_4GB 0x2000
1120#define RDP_PS_10GB 0x1000
1121#define RDP_PS_8GB 0x0800
1122#define RDP_PS_16GB 0x0400
1123#define RDP_PS_32GB 0x0200
1124
1125#define RDP_CAP_UNKNOWN 0x0001
1126#define RDP_PS_UNKNOWN 0x0002
1127#define RDP_PS_NOT_ESTABLISHED 0x0001
1128
1129struct fc_rdp_port_speed {
1130 uint16_t capabilities;
1131 uint16_t speed;
1132};
1133
1134struct fc_rdp_port_speed_info {
1135 struct fc_rdp_port_speed port_speed;
1136};
1137
1138#define RDP_PORT_SPEED_DESC_TAG 0x00010001
1139struct fc_rdp_port_speed_desc {
1140 uint32_t tag; /* 00010001h */
1141 uint32_t length; /* set to size of payload struct */
1142 struct fc_rdp_port_speed_info info;
1143};
1144
1145#define RDP_NPORT_ID_SIZE 4
1146#define RDP_N_PORT_DESC_TAG 0x00000003
1147struct fc_rdp_nport_desc {
1148 uint32_t tag; /* 0000 0003h, big endian */
1149 uint32_t length; /* size of RDP_N_PORT_ID struct */
1150 uint32_t nport_id : 12;
1151 uint32_t reserved : 8;
1152};
1153
1154
1155struct fc_rdp_link_service_info {
1156 uint32_t els_req; /* Request payload word 0 value.*/
1157};
1158
1159#define RDP_LINK_SERVICE_DESC_TAG 0x00000001
1160struct fc_rdp_link_service_desc {
1161 uint32_t tag; /* Descriptor tag 1 */
1162 uint32_t length; /* set to size of payload struct. */
1163 struct fc_rdp_link_service_info payload;
1164 /* must be ELS req Word 0(0x18) */
1165};
1166
1167struct fc_rdp_sfp_info {
1168 uint16_t temperature;
1169 uint16_t vcc;
1170 uint16_t tx_bias;
1171 uint16_t tx_power;
1172 uint16_t rx_power;
1173 uint16_t flags;
1174};
1175
1176#define RDP_SFP_DESC_TAG 0x00010000
1177struct fc_rdp_sfp_desc {
1178 uint32_t tag;
1179 uint32_t length; /* set to size of sfp_info struct */
1180 struct fc_rdp_sfp_info sfp_info;
1181};
1182
1183struct fc_rdp_req_frame {
1184 uint32_t rdp_command; /* ELS command opcode (0x18)*/
1185 uint32_t rdp_des_length; /* RDP Payload Word 1 */
1186 struct fc_rdp_nport_desc nport_id_desc; /* RDP Payload Word 2 - 4 */
1187};
1188
1189
1190struct fc_rdp_res_frame {
1191 uint32_t reply_sequence; /* FC word0 LS_ACC or LS_RJT */
1192 uint32_t length; /* FC Word 1 */
1193 struct fc_rdp_link_service_desc link_service_desc; /* Word 2 -4 */
1194 struct fc_rdp_sfp_desc sfp_desc; /* Word 5 -9 */
1195 struct fc_rdp_port_speed_desc portspeed_desc; /* Word 10-12 */
1196 struct fc_rdp_link_error_status_desc link_error_desc; /* Word 13-21 */
1197 struct fc_rdp_port_name_desc diag_port_names_desc; /* Word 22-27 */
1198 struct fc_rdp_port_name_desc attached_port_names_desc;/* Word 28-33 */
1199};
1200
1201
1202#define RDP_DESC_PAYLOAD_SIZE (sizeof(struct fc_rdp_link_service_desc) \
1203 + sizeof(struct fc_rdp_sfp_desc) \
1204 + sizeof(struct fc_rdp_port_speed_desc) \
1205 + sizeof(struct fc_rdp_link_error_status_desc) \
1206 + (sizeof(struct fc_rdp_port_name_desc) * 2))
1207
1208
1013/******** FDMI ********/ 1209/******** FDMI ********/
1014 1210
1015/* lpfc_sli_ct_request defines the CT_IU preamble for FDMI commands */ 1211/* lpfc_sli_ct_request defines the CT_IU preamble for FDMI commands */
@@ -1587,6 +1783,11 @@ typedef struct { /* FireFly BIU registers */
1587#define TEMPERATURE_OFFSET 0xB0 /* Slim offset for critical temperature event */ 1783#define TEMPERATURE_OFFSET 0xB0 /* Slim offset for critical temperature event */
1588 1784
1589/* 1785/*
1786 * return code Fail
1787 */
1788#define FAILURE 1
1789
1790/*
1590 * Begin Structure Definitions for Mailbox Commands 1791 * Begin Structure Definitions for Mailbox Commands
1591 */ 1792 */
1592 1793