0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023 #include <asm/byteorder.h>
0024
0025 struct lpfc_hba;
0026 #define LPFC_FCP_CDB_LEN 16
0027
0028 #define list_remove_head(list, entry, type, member) \
0029 do { \
0030 entry = NULL; \
0031 if (!list_empty(list)) { \
0032 entry = list_entry((list)->next, type, member); \
0033 list_del_init(&entry->member); \
0034 } \
0035 } while(0)
0036
0037 #define list_get_first(list, type, member) \
0038 (list_empty(list)) ? NULL : \
0039 list_entry((list)->next, type, member)
0040
0041
0042 struct lpfc_rport_data {
0043 struct lpfc_nodelist *pnode;
0044 };
0045
0046 struct lpfc_device_id {
0047 struct lpfc_name vport_wwpn;
0048 struct lpfc_name target_wwpn;
0049 uint64_t lun;
0050 };
0051
0052 struct lpfc_device_data {
0053 struct list_head listentry;
0054 struct lpfc_rport_data *rport_data;
0055 struct lpfc_device_id device_id;
0056 uint8_t priority;
0057 bool oas_enabled;
0058 bool available;
0059 };
0060
0061 struct fcp_rsp {
0062 uint32_t rspRsvd1;
0063 uint32_t rspRsvd2;
0064
0065 uint8_t rspStatus0;
0066 uint8_t rspStatus1;
0067 uint8_t rspStatus2;
0068 #define RSP_LEN_VALID 0x01
0069 #define SNS_LEN_VALID 0x02
0070 #define RESID_OVER 0x04
0071 #define RESID_UNDER 0x08
0072 uint8_t rspStatus3;
0073
0074 uint32_t rspResId;
0075
0076
0077 uint32_t rspSnsLen;
0078
0079 uint32_t rspRspLen;
0080
0081
0082 uint8_t rspInfo0;
0083 uint8_t rspInfo1;
0084 uint8_t rspInfo2;
0085 uint8_t rspInfo3;
0086
0087 #define RSP_NO_FAILURE 0x00
0088 #define RSP_DATA_BURST_ERR 0x01
0089 #define RSP_CMD_FIELD_ERR 0x02
0090 #define RSP_RO_MISMATCH_ERR 0x03
0091 #define RSP_TM_NOT_SUPPORTED 0x04
0092 #define RSP_TM_NOT_COMPLETED 0x05
0093 #define RSP_TM_INVALID_LU 0x09
0094
0095 uint32_t rspInfoRsvd;
0096
0097 uint8_t rspSnsInfo[128];
0098 #define SNS_ILLEGAL_REQ 0x05
0099 #define SNSCOD_BADCMD 0x20
0100 };
0101
0102 struct fcp_cmnd {
0103 struct scsi_lun fcp_lun;
0104
0105 uint8_t fcpCntl0;
0106 uint8_t fcpCntl1;
0107 #define SIMPLE_Q 0x00
0108 #define HEAD_OF_Q 0x01
0109 #define ORDERED_Q 0x02
0110 #define ACA_Q 0x04
0111 #define UNTAGGED 0x05
0112 uint8_t fcpCntl2;
0113 #define FCP_ABORT_TASK_SET 0x02
0114 #define FCP_CLEAR_TASK_SET 0x04
0115 #define FCP_BUS_RESET 0x08
0116 #define FCP_LUN_RESET 0x10
0117 #define FCP_TARGET_RESET 0x20
0118 #define FCP_CLEAR_ACA 0x40
0119 #define FCP_TERMINATE_TASK 0x80
0120 uint8_t fcpCntl3;
0121 #define WRITE_DATA 0x01
0122 #define READ_DATA 0x02
0123
0124 uint8_t fcpCdb[LPFC_FCP_CDB_LEN];
0125 uint32_t fcpDl;
0126
0127 };
0128
0129 struct lpfc_scsicmd_bkt {
0130 uint32_t cmd_count;
0131 };
0132
0133 #define LPFC_SCSI_DMA_EXT_SIZE 264
0134 #define LPFC_BPL_SIZE 1024
0135 #define MDAC_DIRECT_CMD 0x22
0136
0137 #define FIND_FIRST_OAS_LUN 0
0138 #define NO_MORE_OAS_LUN -1
0139 #define NOT_OAS_ENABLED_LUN NO_MORE_OAS_LUN
0140
0141 #ifndef FC_PORTSPEED_128GBIT
0142 #define FC_PORTSPEED_128GBIT 0x2000
0143 #endif
0144
0145 #ifndef FC_PORTSPEED_256GBIT
0146 #define FC_PORTSPEED_256GBIT 0x4000
0147 #endif
0148
0149 #define TXRDY_PAYLOAD_LEN 12
0150
0151
0152 #define LPFC_MAX_SCSI_INFO_TMP_LEN 79
0153