diff options
Diffstat (limited to 'drivers/scsi/qla2xxx/qla_target.h')
| -rw-r--r-- | drivers/scsi/qla2xxx/qla_target.h | 72 |
1 files changed, 61 insertions, 11 deletions
diff --git a/drivers/scsi/qla2xxx/qla_target.h b/drivers/scsi/qla2xxx/qla_target.h index 985d76dd706b..bca584ae45b7 100644 --- a/drivers/scsi/qla2xxx/qla_target.h +++ b/drivers/scsi/qla2xxx/qla_target.h | |||
| @@ -167,7 +167,24 @@ struct imm_ntfy_from_isp { | |||
| 167 | uint32_t srr_rel_offs; | 167 | uint32_t srr_rel_offs; |
| 168 | uint16_t srr_ui; | 168 | uint16_t srr_ui; |
| 169 | uint16_t srr_ox_id; | 169 | uint16_t srr_ox_id; |
| 170 | uint8_t reserved_4[19]; | 170 | union { |
| 171 | struct { | ||
| 172 | uint8_t node_name[8]; | ||
| 173 | } plogi; /* PLOGI/ADISC/PDISC */ | ||
| 174 | struct { | ||
| 175 | /* PRLI word 3 bit 0-15 */ | ||
| 176 | uint16_t wd3_lo; | ||
| 177 | uint8_t resv0[6]; | ||
| 178 | } prli; | ||
| 179 | struct { | ||
| 180 | uint8_t port_id[3]; | ||
| 181 | uint8_t resv1; | ||
| 182 | uint16_t nport_handle; | ||
| 183 | uint16_t resv2; | ||
| 184 | } req_els; | ||
| 185 | } u; | ||
| 186 | uint8_t port_name[8]; | ||
| 187 | uint8_t resv3[3]; | ||
| 171 | uint8_t vp_index; | 188 | uint8_t vp_index; |
| 172 | uint32_t reserved_5; | 189 | uint32_t reserved_5; |
| 173 | uint8_t port_id[3]; | 190 | uint8_t port_id[3]; |
| @@ -234,6 +251,7 @@ struct nack_to_isp { | |||
| 234 | uint8_t reserved[2]; | 251 | uint8_t reserved[2]; |
| 235 | uint16_t ox_id; | 252 | uint16_t ox_id; |
| 236 | } __packed; | 253 | } __packed; |
| 254 | #define NOTIFY_ACK_FLAGS_TERMINATE BIT_3 | ||
| 237 | #define NOTIFY_ACK_SRR_FLAGS_ACCEPT 0 | 255 | #define NOTIFY_ACK_SRR_FLAGS_ACCEPT 0 |
| 238 | #define NOTIFY_ACK_SRR_FLAGS_REJECT 1 | 256 | #define NOTIFY_ACK_SRR_FLAGS_REJECT 1 |
| 239 | 257 | ||
| @@ -790,13 +808,6 @@ int qla2x00_wait_for_hba_online(struct scsi_qla_host *); | |||
| 790 | #define FC_TM_REJECT 4 | 808 | #define FC_TM_REJECT 4 |
| 791 | #define FC_TM_FAILED 5 | 809 | #define FC_TM_FAILED 5 |
| 792 | 810 | ||
| 793 | /* | ||
| 794 | * Error code of qlt_pre_xmit_response() meaning that cmd's exchange was | ||
| 795 | * terminated, so no more actions is needed and success should be returned | ||
| 796 | * to target. | ||
| 797 | */ | ||
| 798 | #define QLA_TGT_PRE_XMIT_RESP_CMD_ABORTED 0x1717 | ||
| 799 | |||
| 800 | #if (BITS_PER_LONG > 32) || defined(CONFIG_HIGHMEM64G) | 811 | #if (BITS_PER_LONG > 32) || defined(CONFIG_HIGHMEM64G) |
| 801 | #define pci_dma_lo32(a) (a & 0xffffffff) | 812 | #define pci_dma_lo32(a) (a & 0xffffffff) |
| 802 | #define pci_dma_hi32(a) ((((a) >> 16)>>16) & 0xffffffff) | 813 | #define pci_dma_hi32(a) ((((a) >> 16)>>16) & 0xffffffff) |
| @@ -874,6 +885,15 @@ struct qla_tgt_sess_op { | |||
| 874 | struct scsi_qla_host *vha; | 885 | struct scsi_qla_host *vha; |
| 875 | struct atio_from_isp atio; | 886 | struct atio_from_isp atio; |
| 876 | struct work_struct work; | 887 | struct work_struct work; |
| 888 | struct list_head cmd_list; | ||
| 889 | bool aborted; | ||
| 890 | }; | ||
| 891 | |||
| 892 | enum qla_sess_deletion { | ||
| 893 | QLA_SESS_DELETION_NONE = 0, | ||
| 894 | QLA_SESS_DELETION_PENDING = 1, /* hopefully we can get rid of | ||
| 895 | * this one */ | ||
| 896 | QLA_SESS_DELETION_IN_PROGRESS = 2, | ||
| 877 | }; | 897 | }; |
| 878 | 898 | ||
| 879 | /* | 899 | /* |
| @@ -884,8 +904,15 @@ struct qla_tgt_sess { | |||
| 884 | port_id_t s_id; | 904 | port_id_t s_id; |
| 885 | 905 | ||
| 886 | unsigned int conf_compl_supported:1; | 906 | unsigned int conf_compl_supported:1; |
| 887 | unsigned int deleted:1; | 907 | unsigned int deleted:2; |
| 888 | unsigned int local:1; | 908 | unsigned int local:1; |
| 909 | unsigned int logout_on_delete:1; | ||
| 910 | unsigned int plogi_ack_needed:1; | ||
| 911 | unsigned int keep_nport_handle:1; | ||
| 912 | |||
| 913 | unsigned char logout_completed; | ||
| 914 | |||
| 915 | int generation; | ||
| 889 | 916 | ||
| 890 | struct se_session *se_sess; | 917 | struct se_session *se_sess; |
| 891 | struct scsi_qla_host *vha; | 918 | struct scsi_qla_host *vha; |
| @@ -897,6 +924,10 @@ struct qla_tgt_sess { | |||
| 897 | 924 | ||
| 898 | uint8_t port_name[WWN_SIZE]; | 925 | uint8_t port_name[WWN_SIZE]; |
| 899 | struct work_struct free_work; | 926 | struct work_struct free_work; |
| 927 | |||
| 928 | union { | ||
| 929 | struct imm_ntfy_from_isp tm_iocb; | ||
| 930 | }; | ||
| 900 | }; | 931 | }; |
| 901 | 932 | ||
| 902 | struct qla_tgt_cmd { | 933 | struct qla_tgt_cmd { |
| @@ -912,7 +943,6 @@ struct qla_tgt_cmd { | |||
| 912 | unsigned int conf_compl_supported:1; | 943 | unsigned int conf_compl_supported:1; |
| 913 | unsigned int sg_mapped:1; | 944 | unsigned int sg_mapped:1; |
| 914 | unsigned int free_sg:1; | 945 | unsigned int free_sg:1; |
| 915 | unsigned int aborted:1; /* Needed in case of SRR */ | ||
| 916 | unsigned int write_data_transferred:1; | 946 | unsigned int write_data_transferred:1; |
| 917 | unsigned int ctx_dsd_alloced:1; | 947 | unsigned int ctx_dsd_alloced:1; |
| 918 | unsigned int q_full:1; | 948 | unsigned int q_full:1; |
| @@ -961,6 +991,9 @@ struct qla_tgt_cmd { | |||
| 961 | * BIT_14 - Back end data received/sent. | 991 | * BIT_14 - Back end data received/sent. |
| 962 | * BIT_15 - SRR prepare ctio | 992 | * BIT_15 - SRR prepare ctio |
| 963 | * BIT_16 - complete free | 993 | * BIT_16 - complete free |
| 994 | * BIT_17 - flush - qlt_abort_cmd_on_host_reset | ||
| 995 | * BIT_18 - completion w/abort status | ||
| 996 | * BIT_19 - completion w/unknown status | ||
| 964 | */ | 997 | */ |
| 965 | uint32_t cmd_flags; | 998 | uint32_t cmd_flags; |
| 966 | }; | 999 | }; |
| @@ -1026,6 +1059,10 @@ struct qla_tgt_srr_ctio { | |||
| 1026 | struct qla_tgt_cmd *cmd; | 1059 | struct qla_tgt_cmd *cmd; |
| 1027 | }; | 1060 | }; |
| 1028 | 1061 | ||
| 1062 | /* Check for Switch reserved address */ | ||
| 1063 | #define IS_SW_RESV_ADDR(_s_id) \ | ||
| 1064 | ((_s_id.b.domain == 0xff) && (_s_id.b.area == 0xfc)) | ||
| 1065 | |||
| 1029 | #define QLA_TGT_XMIT_DATA 1 | 1066 | #define QLA_TGT_XMIT_DATA 1 |
| 1030 | #define QLA_TGT_XMIT_STATUS 2 | 1067 | #define QLA_TGT_XMIT_STATUS 2 |
| 1031 | #define QLA_TGT_XMIT_ALL (QLA_TGT_XMIT_STATUS|QLA_TGT_XMIT_DATA) | 1068 | #define QLA_TGT_XMIT_ALL (QLA_TGT_XMIT_STATUS|QLA_TGT_XMIT_DATA) |
| @@ -1043,7 +1080,7 @@ extern int qlt_lport_register(void *, u64, u64, u64, | |||
| 1043 | extern void qlt_lport_deregister(struct scsi_qla_host *); | 1080 | extern void qlt_lport_deregister(struct scsi_qla_host *); |
| 1044 | extern void qlt_unreg_sess(struct qla_tgt_sess *); | 1081 | extern void qlt_unreg_sess(struct qla_tgt_sess *); |
| 1045 | extern void qlt_fc_port_added(struct scsi_qla_host *, fc_port_t *); | 1082 | extern void qlt_fc_port_added(struct scsi_qla_host *, fc_port_t *); |
| 1046 | extern void qlt_fc_port_deleted(struct scsi_qla_host *, fc_port_t *); | 1083 | extern void qlt_fc_port_deleted(struct scsi_qla_host *, fc_port_t *, int); |
| 1047 | extern int __init qlt_init(void); | 1084 | extern int __init qlt_init(void); |
| 1048 | extern void qlt_exit(void); | 1085 | extern void qlt_exit(void); |
| 1049 | extern void qlt_update_vp_map(struct scsi_qla_host *, int); | 1086 | extern void qlt_update_vp_map(struct scsi_qla_host *, int); |
| @@ -1073,12 +1110,23 @@ static inline void qla_reverse_ini_mode(struct scsi_qla_host *ha) | |||
| 1073 | ha->host->active_mode |= MODE_INITIATOR; | 1110 | ha->host->active_mode |= MODE_INITIATOR; |
| 1074 | } | 1111 | } |
| 1075 | 1112 | ||
| 1113 | static inline uint32_t sid_to_key(const uint8_t *s_id) | ||
| 1114 | { | ||
| 1115 | uint32_t key; | ||
| 1116 | |||
| 1117 | key = (((unsigned long)s_id[0] << 16) | | ||
| 1118 | ((unsigned long)s_id[1] << 8) | | ||
| 1119 | (unsigned long)s_id[2]); | ||
| 1120 | return key; | ||
| 1121 | } | ||
| 1122 | |||
| 1076 | /* | 1123 | /* |
| 1077 | * Exported symbols from qla_target.c LLD logic used by qla2xxx code.. | 1124 | * Exported symbols from qla_target.c LLD logic used by qla2xxx code.. |
| 1078 | */ | 1125 | */ |
| 1079 | extern void qlt_response_pkt_all_vps(struct scsi_qla_host *, response_t *); | 1126 | extern void qlt_response_pkt_all_vps(struct scsi_qla_host *, response_t *); |
| 1080 | extern int qlt_rdy_to_xfer(struct qla_tgt_cmd *); | 1127 | extern int qlt_rdy_to_xfer(struct qla_tgt_cmd *); |
| 1081 | extern int qlt_xmit_response(struct qla_tgt_cmd *, int, uint8_t); | 1128 | extern int qlt_xmit_response(struct qla_tgt_cmd *, int, uint8_t); |
| 1129 | extern void qlt_abort_cmd(struct qla_tgt_cmd *); | ||
| 1082 | extern void qlt_xmit_tm_rsp(struct qla_tgt_mgmt_cmd *); | 1130 | extern void qlt_xmit_tm_rsp(struct qla_tgt_mgmt_cmd *); |
| 1083 | extern void qlt_free_mcmd(struct qla_tgt_mgmt_cmd *); | 1131 | extern void qlt_free_mcmd(struct qla_tgt_mgmt_cmd *); |
| 1084 | extern void qlt_free_cmd(struct qla_tgt_cmd *cmd); | 1132 | extern void qlt_free_cmd(struct qla_tgt_cmd *cmd); |
| @@ -1109,5 +1157,7 @@ extern void qlt_stop_phase2(struct qla_tgt *); | |||
| 1109 | extern irqreturn_t qla83xx_msix_atio_q(int, void *); | 1157 | extern irqreturn_t qla83xx_msix_atio_q(int, void *); |
| 1110 | extern void qlt_83xx_iospace_config(struct qla_hw_data *); | 1158 | extern void qlt_83xx_iospace_config(struct qla_hw_data *); |
| 1111 | extern int qlt_free_qfull_cmds(struct scsi_qla_host *); | 1159 | extern int qlt_free_qfull_cmds(struct scsi_qla_host *); |
| 1160 | extern void qlt_logo_completion_handler(fc_port_t *, int); | ||
| 1161 | extern void qlt_do_generation_tick(struct scsi_qla_host *, int *); | ||
| 1112 | 1162 | ||
| 1113 | #endif /* __QLA_TARGET_H */ | 1163 | #endif /* __QLA_TARGET_H */ |
