Lines Matching full:cmd

476 int iscsit_queue_rsp(struct iscsit_conn *conn, struct iscsit_cmd *cmd)  in iscsit_queue_rsp()  argument
478 return iscsit_add_cmd_to_response_queue(cmd, cmd->conn, cmd->i_state); in iscsit_queue_rsp()
482 void iscsit_aborted_task(struct iscsit_conn *conn, struct iscsit_cmd *cmd) in iscsit_aborted_task() argument
485 if (!list_empty(&cmd->i_conn_node)) in iscsit_aborted_task()
486 list_del_init(&cmd->i_conn_node); in iscsit_aborted_task()
489 __iscsit_free_cmd(cmd, true); in iscsit_aborted_task()
498 iscsit_xmit_nondatain_pdu(struct iscsit_conn *conn, struct iscsit_cmd *cmd, in iscsit_xmit_nondatain_pdu() argument
501 struct iscsi_hdr *hdr = (struct iscsi_hdr *)cmd->pdu; in iscsit_xmit_nondatain_pdu()
506 iov = &cmd->iov_misc[0]; in iscsit_xmit_nondatain_pdu()
507 iov[niov].iov_base = cmd->pdu; in iscsit_xmit_nondatain_pdu()
511 u32 *header_digest = (u32 *)&cmd->pdu[ISCSI_HDR_LEN]; in iscsit_xmit_nondatain_pdu()
532 iov[niov].iov_base = &cmd->pad_bytes; in iscsit_xmit_nondatain_pdu()
542 padding, &cmd->pad_bytes, in iscsit_xmit_nondatain_pdu()
543 &cmd->data_crc); in iscsit_xmit_nondatain_pdu()
545 iov[niov].iov_base = &cmd->data_crc; in iscsit_xmit_nondatain_pdu()
550 data_buf_len, hdr->opcode, cmd->data_crc); in iscsit_xmit_nondatain_pdu()
554 cmd->iov_misc_count = niov; in iscsit_xmit_nondatain_pdu()
555 cmd->tx_size = tx_size; in iscsit_xmit_nondatain_pdu()
557 ret = iscsit_send_tx_data(cmd, conn, 1); in iscsit_xmit_nondatain_pdu()
566 static int iscsit_map_iovec(struct iscsit_cmd *cmd, struct kvec *iov, int nvec,
572 iscsit_xmit_datain_pdu(struct iscsit_conn *conn, struct iscsit_cmd *cmd, in iscsit_xmit_datain_pdu() argument
579 iov = &cmd->iov_data[0]; in iscsit_xmit_datain_pdu()
580 iov[iov_count].iov_base = cmd->pdu; in iscsit_xmit_datain_pdu()
585 u32 *header_digest = (u32 *)&cmd->pdu[ISCSI_HDR_LEN]; in iscsit_xmit_datain_pdu()
587 iscsit_do_crypto_hash_buf(conn->conn_tx_hash, cmd->pdu, in iscsit_xmit_datain_pdu()
598 iov_ret = iscsit_map_iovec(cmd, &cmd->iov_data[iov_count], in iscsit_xmit_datain_pdu()
599 cmd->orig_iov_data_count - (iov_count + 2), in iscsit_xmit_datain_pdu()
607 cmd->padding = ((-datain->length) & 3); in iscsit_xmit_datain_pdu()
608 if (cmd->padding) { in iscsit_xmit_datain_pdu()
609 iov[iov_count].iov_base = cmd->pad_bytes; in iscsit_xmit_datain_pdu()
610 iov[iov_count++].iov_len = cmd->padding; in iscsit_xmit_datain_pdu()
611 tx_size += cmd->padding; in iscsit_xmit_datain_pdu()
613 pr_debug("Attaching %u padding bytes\n", cmd->padding); in iscsit_xmit_datain_pdu()
617 cmd->data_crc = iscsit_do_crypto_hash_sg(conn->conn_tx_hash, in iscsit_xmit_datain_pdu()
618 cmd, datain->offset, in iscsit_xmit_datain_pdu()
620 cmd->padding, in iscsit_xmit_datain_pdu()
621 cmd->pad_bytes); in iscsit_xmit_datain_pdu()
623 iov[iov_count].iov_base = &cmd->data_crc; in iscsit_xmit_datain_pdu()
628 datain->length + cmd->padding, cmd->data_crc); in iscsit_xmit_datain_pdu()
631 cmd->iov_data_count = iov_count; in iscsit_xmit_datain_pdu()
632 cmd->tx_size = tx_size; in iscsit_xmit_datain_pdu()
634 ret = iscsit_fe_sendpage_sg(cmd, conn); in iscsit_xmit_datain_pdu()
636 iscsit_unmap_iovec(cmd); in iscsit_xmit_datain_pdu()
646 static int iscsit_xmit_pdu(struct iscsit_conn *conn, struct iscsit_cmd *cmd, in iscsit_xmit_pdu() argument
651 return iscsit_xmit_datain_pdu(conn, cmd, buf); in iscsit_xmit_pdu()
653 return iscsit_xmit_nondatain_pdu(conn, cmd, buf, buf_len); in iscsit_xmit_pdu()
802 struct iscsit_cmd *cmd; in iscsit_add_reject() local
804 cmd = iscsit_allocate_cmd(conn, TASK_INTERRUPTIBLE); in iscsit_add_reject()
805 if (!cmd) in iscsit_add_reject()
808 cmd->iscsi_opcode = ISCSI_OP_REJECT; in iscsit_add_reject()
809 cmd->reject_reason = reason; in iscsit_add_reject()
811 cmd->buf_ptr = kmemdup(buf, ISCSI_HDR_LEN, GFP_KERNEL); in iscsit_add_reject()
812 if (!cmd->buf_ptr) { in iscsit_add_reject()
813 pr_err("Unable to allocate memory for cmd->buf_ptr\n"); in iscsit_add_reject()
814 iscsit_free_cmd(cmd, false); in iscsit_add_reject()
819 list_add_tail(&cmd->i_conn_node, &conn->conn_cmd_list); in iscsit_add_reject()
822 cmd->i_state = ISTATE_SEND_REJECT; in iscsit_add_reject()
823 iscsit_add_cmd_to_response_queue(cmd, conn, cmd->i_state); in iscsit_add_reject()
830 struct iscsit_cmd *cmd, in iscsit_add_reject_from_cmd() argument
836 const bool do_put = cmd->se_cmd.se_tfo != NULL; in iscsit_add_reject_from_cmd()
838 if (!cmd->conn) { in iscsit_add_reject_from_cmd()
839 pr_err("cmd->conn is NULL for ITT: 0x%08x\n", in iscsit_add_reject_from_cmd()
840 cmd->init_task_tag); in iscsit_add_reject_from_cmd()
843 conn = cmd->conn; in iscsit_add_reject_from_cmd()
845 cmd->iscsi_opcode = ISCSI_OP_REJECT; in iscsit_add_reject_from_cmd()
846 cmd->reject_reason = reason; in iscsit_add_reject_from_cmd()
848 cmd->buf_ptr = kmemdup(buf, ISCSI_HDR_LEN, GFP_KERNEL); in iscsit_add_reject_from_cmd()
849 if (!cmd->buf_ptr) { in iscsit_add_reject_from_cmd()
850 pr_err("Unable to allocate memory for cmd->buf_ptr\n"); in iscsit_add_reject_from_cmd()
851 iscsit_free_cmd(cmd, false); in iscsit_add_reject_from_cmd()
857 list_add_tail(&cmd->i_conn_node, &conn->conn_cmd_list); in iscsit_add_reject_from_cmd()
861 cmd->i_state = ISTATE_SEND_REJECT; in iscsit_add_reject_from_cmd()
862 iscsit_add_cmd_to_response_queue(cmd, conn, cmd->i_state); in iscsit_add_reject_from_cmd()
869 target_put_sess_cmd(&cmd->se_cmd); in iscsit_add_reject_from_cmd()
874 static int iscsit_add_reject_cmd(struct iscsit_cmd *cmd, u8 reason, in iscsit_add_reject_cmd() argument
877 return iscsit_add_reject_from_cmd(cmd, reason, true, buf); in iscsit_add_reject_cmd()
880 int iscsit_reject_cmd(struct iscsit_cmd *cmd, u8 reason, unsigned char *buf) in iscsit_reject_cmd() argument
882 return iscsit_add_reject_from_cmd(cmd, reason, false, buf); in iscsit_reject_cmd()
890 static int iscsit_map_iovec(struct iscsit_cmd *cmd, struct kvec *iov, int nvec, in iscsit_map_iovec() argument
905 if (ent >= cmd->se_cmd.t_data_nents) { in iscsit_map_iovec()
910 sg = &cmd->se_cmd.t_data_sg[ent]; in iscsit_map_iovec()
913 cmd->first_data_sg = sg; in iscsit_map_iovec()
914 cmd->first_data_sg_off = page_off; in iscsit_map_iovec()
933 cmd->kmapped_nents = i; in iscsit_map_iovec()
940 for_each_sg(cmd->se_cmd.t_data_sg, sg, in iscsit_map_iovec()
941 cmd->se_cmd.t_data_nents, i) { in iscsit_map_iovec()
948 static void iscsit_unmap_iovec(struct iscsit_cmd *cmd) in iscsit_unmap_iovec() argument
953 sg = cmd->first_data_sg; in iscsit_unmap_iovec()
955 for (i = 0; i < cmd->kmapped_nents; i++) in iscsit_unmap_iovec()
962 struct iscsit_cmd *cmd, *cmd_p; in iscsit_ack_from_expstatsn() local
970 list_for_each_entry_safe(cmd, cmd_p, &conn->conn_cmd_list, i_conn_node) { in iscsit_ack_from_expstatsn()
971 spin_lock(&cmd->istate_lock); in iscsit_ack_from_expstatsn()
972 if ((cmd->i_state == ISTATE_SENT_STATUS) && in iscsit_ack_from_expstatsn()
973 iscsi_sna_lt(cmd->stat_sn, exp_statsn)) { in iscsit_ack_from_expstatsn()
974 cmd->i_state = ISTATE_REMOVE; in iscsit_ack_from_expstatsn()
975 spin_unlock(&cmd->istate_lock); in iscsit_ack_from_expstatsn()
976 list_move_tail(&cmd->i_conn_node, &ack_list); in iscsit_ack_from_expstatsn()
979 spin_unlock(&cmd->istate_lock); in iscsit_ack_from_expstatsn()
983 list_for_each_entry_safe(cmd, cmd_p, &ack_list, i_conn_node) { in iscsit_ack_from_expstatsn()
984 list_del_init(&cmd->i_conn_node); in iscsit_ack_from_expstatsn()
985 iscsit_free_cmd(cmd, false); in iscsit_ack_from_expstatsn()
989 static int iscsit_allocate_iovecs(struct iscsit_cmd *cmd) in iscsit_allocate_iovecs() argument
991 u32 iov_count = max(1UL, DIV_ROUND_UP(cmd->se_cmd.data_length, PAGE_SIZE)); in iscsit_allocate_iovecs()
994 cmd->iov_data = kcalloc(iov_count, sizeof(*cmd->iov_data), GFP_KERNEL); in iscsit_allocate_iovecs()
995 if (!cmd->iov_data) in iscsit_allocate_iovecs()
998 cmd->orig_iov_data_count = iov_count; in iscsit_allocate_iovecs()
1002 int iscsit_setup_scsi_cmd(struct iscsit_conn *conn, struct iscsit_cmd *cmd, in iscsit_setup_scsi_cmd() argument
1023 return iscsit_add_reject_cmd(cmd, in iscsit_setup_scsi_cmd()
1052 return iscsit_add_reject_cmd(cmd, in iscsit_setup_scsi_cmd()
1059 return iscsit_add_reject_cmd(cmd, in iscsit_setup_scsi_cmd()
1066 return iscsit_add_reject_cmd(cmd, in iscsit_setup_scsi_cmd()
1073 return iscsit_add_reject_cmd(cmd, in iscsit_setup_scsi_cmd()
1082 return iscsit_add_reject_cmd(cmd, in iscsit_setup_scsi_cmd()
1090 return iscsit_add_reject_cmd(cmd, in iscsit_setup_scsi_cmd()
1098 return iscsit_add_reject_cmd(cmd, in iscsit_setup_scsi_cmd()
1106 return iscsit_add_reject_cmd(cmd, in iscsit_setup_scsi_cmd()
1117 return iscsit_add_reject_cmd(cmd, in iscsit_setup_scsi_cmd()
1124 return iscsit_add_reject_cmd(cmd, in iscsit_setup_scsi_cmd()
1135 cmd->data_direction = data_direction; in iscsit_setup_scsi_cmd()
1155 cmd->iscsi_opcode = ISCSI_OP_SCSI_CMD; in iscsit_setup_scsi_cmd()
1156 cmd->i_state = ISTATE_NEW_CMD; in iscsit_setup_scsi_cmd()
1157 cmd->immediate_cmd = ((hdr->opcode & ISCSI_OP_IMMEDIATE) ? 1 : 0); in iscsit_setup_scsi_cmd()
1158 cmd->immediate_data = (payload_length) ? 1 : 0; in iscsit_setup_scsi_cmd()
1159 cmd->unsolicited_data = ((!(hdr->flags & ISCSI_FLAG_CMD_FINAL) && in iscsit_setup_scsi_cmd()
1161 if (cmd->unsolicited_data) in iscsit_setup_scsi_cmd()
1162 cmd->cmd_flags |= ICF_NON_IMMEDIATE_UNSOLICITED_DATA; in iscsit_setup_scsi_cmd()
1164 conn->sess->init_task_tag = cmd->init_task_tag = hdr->itt; in iscsit_setup_scsi_cmd()
1166 cmd->targ_xfer_tag = session_get_next_ttt(conn->sess); in iscsit_setup_scsi_cmd()
1168 cmd->targ_xfer_tag = 0xFFFFFFFF; in iscsit_setup_scsi_cmd()
1169 cmd->cmd_sn = be32_to_cpu(hdr->cmdsn); in iscsit_setup_scsi_cmd()
1170 cmd->exp_stat_sn = be32_to_cpu(hdr->exp_statsn); in iscsit_setup_scsi_cmd()
1171 cmd->first_burst_len = payload_length; in iscsit_setup_scsi_cmd()
1174 cmd->data_direction == DMA_FROM_DEVICE) { in iscsit_setup_scsi_cmd()
1181 return iscsit_add_reject_cmd(cmd, in iscsit_setup_scsi_cmd()
1185 iscsit_attach_datain_req(cmd, dr); in iscsit_setup_scsi_cmd()
1191 __target_init_cmd(&cmd->se_cmd, &iscsi_ops, in iscsit_setup_scsi_cmd()
1193 cmd->data_direction, sam_task_attr, in iscsit_setup_scsi_cmd()
1194 cmd->sense_buffer + 2, scsilun_to_int(&hdr->lun), in iscsit_setup_scsi_cmd()
1202 target_get_sess_cmd(&cmd->se_cmd, true); in iscsit_setup_scsi_cmd()
1204 cmd->se_cmd.tag = (__force u32)cmd->init_task_tag; in iscsit_setup_scsi_cmd()
1205 cmd->sense_reason = target_cmd_init_cdb(&cmd->se_cmd, cdb, in iscsit_setup_scsi_cmd()
1211 if (cmd->sense_reason) { in iscsit_setup_scsi_cmd()
1212 if (cmd->sense_reason == TCM_OUT_OF_RESOURCES) { in iscsit_setup_scsi_cmd()
1213 return iscsit_add_reject_cmd(cmd, in iscsit_setup_scsi_cmd()
1220 cmd->sense_reason = transport_lookup_cmd_lun(&cmd->se_cmd); in iscsit_setup_scsi_cmd()
1221 if (cmd->sense_reason) in iscsit_setup_scsi_cmd()
1224 cmd->sense_reason = target_cmd_parse_cdb(&cmd->se_cmd); in iscsit_setup_scsi_cmd()
1225 if (cmd->sense_reason) in iscsit_setup_scsi_cmd()
1228 if (iscsit_build_pdu_and_seq_lists(cmd, payload_length) < 0) { in iscsit_setup_scsi_cmd()
1229 return iscsit_add_reject_cmd(cmd, in iscsit_setup_scsi_cmd()
1235 list_add_tail(&cmd->i_conn_node, &conn->conn_cmd_list); in iscsit_setup_scsi_cmd()
1241 void iscsit_set_unsolicited_dataout(struct iscsit_cmd *cmd) in iscsit_set_unsolicited_dataout() argument
1243 iscsit_set_dataout_sequence_values(cmd); in iscsit_set_unsolicited_dataout()
1245 spin_lock_bh(&cmd->dataout_timeout_lock); in iscsit_set_unsolicited_dataout()
1246 iscsit_start_dataout_timer(cmd, cmd->conn); in iscsit_set_unsolicited_dataout()
1247 spin_unlock_bh(&cmd->dataout_timeout_lock); in iscsit_set_unsolicited_dataout()
1251 int iscsit_process_scsi_cmd(struct iscsit_conn *conn, struct iscsit_cmd *cmd, in iscsit_process_scsi_cmd() argument
1265 if (!cmd->immediate_data) { in iscsit_process_scsi_cmd()
1266 cmdsn_ret = iscsit_sequence_cmd(conn, cmd, in iscsit_process_scsi_cmd()
1271 target_put_sess_cmd(&cmd->se_cmd); in iscsit_process_scsi_cmd()
1281 if (!cmd->immediate_data) { in iscsit_process_scsi_cmd()
1282 if (!cmd->sense_reason && cmd->unsolicited_data) in iscsit_process_scsi_cmd()
1283 iscsit_set_unsolicited_dataout(cmd); in iscsit_process_scsi_cmd()
1284 if (!cmd->sense_reason) in iscsit_process_scsi_cmd()
1287 target_put_sess_cmd(&cmd->se_cmd); in iscsit_process_scsi_cmd()
1296 if (cmd->sense_reason) in iscsit_process_scsi_cmd()
1302 cmd->sense_reason = transport_generic_new_cmd(&cmd->se_cmd); in iscsit_process_scsi_cmd()
1303 if (cmd->sense_reason) in iscsit_process_scsi_cmd()
1311 iscsit_get_immediate_data(struct iscsit_cmd *cmd, struct iscsi_scsi_req *hdr, in iscsit_get_immediate_data() argument
1321 u32 length = min(cmd->se_cmd.data_length - cmd->write_data_done, in iscsit_get_immediate_data()
1322 cmd->first_burst_len); in iscsit_get_immediate_data()
1325 cmd->se_cmd.data_length, cmd->write_data_done, in iscsit_get_immediate_data()
1326 cmd->first_burst_len, length); in iscsit_get_immediate_data()
1327 rc = iscsit_dump_data_payload(cmd->conn, length, 1); in iscsit_get_immediate_data()
1332 immed_ret = iscsit_handle_immediate_data(cmd, hdr, in iscsit_get_immediate_data()
1333 cmd->first_burst_len); in iscsit_get_immediate_data()
1342 cmdsn_ret = iscsit_sequence_cmd(cmd->conn, cmd, in iscsit_get_immediate_data()
1347 if (cmd->sense_reason || cmdsn_ret == CMDSN_LOWER_THAN_EXP) { in iscsit_get_immediate_data()
1348 target_put_sess_cmd(&cmd->se_cmd); in iscsit_get_immediate_data()
1351 } else if (cmd->unsolicited_data) in iscsit_get_immediate_data()
1352 iscsit_set_unsolicited_dataout(cmd); in iscsit_get_immediate_data()
1366 cmd->i_state = ISTATE_REMOVE; in iscsit_get_immediate_data()
1367 iscsit_add_cmd_to_immediate_queue(cmd, cmd->conn, cmd->i_state); in iscsit_get_immediate_data()
1375 iscsit_handle_scsi_cmd(struct iscsit_conn *conn, struct iscsit_cmd *cmd, in iscsit_handle_scsi_cmd() argument
1382 rc = iscsit_setup_scsi_cmd(conn, cmd, buf); in iscsit_handle_scsi_cmd()
1389 if (iscsit_allocate_iovecs(cmd) < 0) { in iscsit_handle_scsi_cmd()
1390 return iscsit_reject_cmd(cmd, in iscsit_handle_scsi_cmd()
1393 immed_data = cmd->immediate_data; in iscsit_handle_scsi_cmd()
1395 rc = iscsit_process_scsi_cmd(conn, cmd, hdr); in iscsit_handle_scsi_cmd()
1404 return iscsit_get_immediate_data(cmd, hdr, dump_payload); in iscsit_handle_scsi_cmd()
1409 struct iscsit_cmd *cmd, in iscsit_do_crypto_hash_sg() argument
1421 sg = cmd->first_data_sg; in iscsit_do_crypto_hash_sg()
1422 page_off = cmd->first_data_sg_off; in iscsit_do_crypto_hash_sg()
1482 struct iscsit_cmd *cmd, u32 payload_length, in __iscsit_check_dataout_hdr() argument
1497 if (cmd->cmd_flags & ICF_GOT_LAST_DATAOUT) { in __iscsit_check_dataout_hdr()
1500 cmd->init_task_tag); in __iscsit_check_dataout_hdr()
1504 if (cmd->data_direction != DMA_TO_DEVICE) { in __iscsit_check_dataout_hdr()
1506 " NON-WRITE command.\n", cmd->init_task_tag); in __iscsit_check_dataout_hdr()
1509 se_cmd = &cmd->se_cmd; in __iscsit_check_dataout_hdr()
1510 iscsit_mod_dataout_timer(cmd); in __iscsit_check_dataout_hdr()
1512 if ((be32_to_cpu(hdr->offset) + payload_length) > cmd->se_cmd.data_length) { in __iscsit_check_dataout_hdr()
1515 cmd->se_cmd.data_length); in __iscsit_check_dataout_hdr()
1516 return iscsit_reject_cmd(cmd, ISCSI_REASON_BOOKMARK_INVALID, buf); in __iscsit_check_dataout_hdr()
1519 if (cmd->unsolicited_data) { in __iscsit_check_dataout_hdr()
1525 transport_send_check_condition_and_sense(&cmd->se_cmd, in __iscsit_check_dataout_hdr()
1547 iscsit_stop_dataout_timer(cmd); in __iscsit_check_dataout_hdr()
1564 --cmd->outstanding_r2ts < 1) in __iscsit_check_dataout_hdr()
1565 iscsit_stop_dataout_timer(cmd); in __iscsit_check_dataout_hdr()
1574 rc = iscsit_check_pre_dataout(cmd, buf); in __iscsit_check_dataout_hdr()
1589 struct iscsit_cmd *cmd; in iscsit_check_dataout_hdr() local
1606 cmd = iscsit_find_cmd_from_itt_or_dump(conn, hdr->itt, payload_length); in iscsit_check_dataout_hdr()
1607 if (!cmd) in iscsit_check_dataout_hdr()
1610 rc = __iscsit_check_dataout_hdr(conn, buf, cmd, payload_length, &success); in iscsit_check_dataout_hdr()
1613 *out_cmd = cmd; in iscsit_check_dataout_hdr()
1620 iscsit_get_dataout(struct iscsit_conn *conn, struct iscsit_cmd *cmd, in iscsit_get_dataout() argument
1628 payload_length = min_t(u32, cmd->se_cmd.data_length, in iscsit_get_dataout()
1631 iov = &cmd->iov_data[0]; in iscsit_get_dataout()
1633 iov_ret = iscsit_map_iovec(cmd, iov, cmd->orig_iov_data_count - 2, in iscsit_get_dataout()
1642 iov[iov_count].iov_base = cmd->pad_bytes; in iscsit_get_dataout()
1654 WARN_ON_ONCE(iov_count > cmd->orig_iov_data_count); in iscsit_get_dataout()
1655 rx_got = rx_data(conn, &cmd->iov_data[0], iov_count, rx_size); in iscsit_get_dataout()
1657 iscsit_unmap_iovec(cmd); in iscsit_get_dataout()
1665 data_crc = iscsit_do_crypto_hash_sg(conn->conn_rx_hash, cmd, in iscsit_get_dataout()
1668 cmd->pad_bytes); in iscsit_get_dataout()
1688 iscsit_check_dataout_payload(struct iscsit_cmd *cmd, struct iscsi_data *hdr, in iscsit_check_dataout_payload() argument
1691 struct iscsit_conn *conn = cmd->conn; in iscsit_check_dataout_payload()
1697 rc = iscsit_check_post_dataout(cmd, (unsigned char *)hdr, data_crc_failed); in iscsit_check_dataout_payload()
1701 iscsit_set_dataout_sequence_values(cmd); in iscsit_check_dataout_payload()
1702 conn->conn_transport->iscsit_get_dataout(conn, cmd, false); in iscsit_check_dataout_payload()
1708 spin_lock_bh(&cmd->istate_lock); in iscsit_check_dataout_payload()
1709 ooo_cmdsn = (cmd->cmd_flags & ICF_OOO_CMDSN); in iscsit_check_dataout_payload()
1710 cmd->cmd_flags |= ICF_GOT_LAST_DATAOUT; in iscsit_check_dataout_payload()
1711 cmd->i_state = ISTATE_RECEIVED_LAST_DATAOUT; in iscsit_check_dataout_payload()
1712 spin_unlock_bh(&cmd->istate_lock); in iscsit_check_dataout_payload()
1714 iscsit_stop_dataout_timer(cmd); in iscsit_check_dataout_payload()
1717 target_execute_cmd(&cmd->se_cmd); in iscsit_check_dataout_payload()
1728 struct iscsit_cmd *cmd = NULL; in iscsit_handle_data_out() local
1733 rc = iscsit_check_dataout_hdr(conn, buf, &cmd); in iscsit_handle_data_out()
1736 else if (!cmd) in iscsit_handle_data_out()
1739 rc = iscsit_get_dataout(conn, cmd, hdr); in iscsit_handle_data_out()
1745 return iscsit_check_dataout_payload(cmd, hdr, data_crc_failed); in iscsit_handle_data_out()
1748 int iscsit_setup_nop_out(struct iscsit_conn *conn, struct iscsit_cmd *cmd, in iscsit_setup_nop_out() argument
1755 if (!cmd) in iscsit_setup_nop_out()
1759 return iscsit_reject_cmd(cmd, ISCSI_REASON_PROTOCOL_ERROR, in iscsit_setup_nop_out()
1766 if (!cmd) in iscsit_setup_nop_out()
1770 return iscsit_reject_cmd(cmd, ISCSI_REASON_PROTOCOL_ERROR, in iscsit_setup_nop_out()
1779 if (!cmd) in iscsit_setup_nop_out()
1783 return iscsit_reject_cmd(cmd, ISCSI_REASON_PROTOCOL_ERROR, in iscsit_setup_nop_out()
1800 cmd->iscsi_opcode = ISCSI_OP_NOOP_OUT; in iscsit_setup_nop_out()
1801 cmd->i_state = ISTATE_SEND_NOPIN; in iscsit_setup_nop_out()
1802 cmd->immediate_cmd = ((hdr->opcode & ISCSI_OP_IMMEDIATE) ? in iscsit_setup_nop_out()
1804 conn->sess->init_task_tag = cmd->init_task_tag = hdr->itt; in iscsit_setup_nop_out()
1805 cmd->targ_xfer_tag = 0xFFFFFFFF; in iscsit_setup_nop_out()
1806 cmd->cmd_sn = be32_to_cpu(hdr->cmdsn); in iscsit_setup_nop_out()
1807 cmd->exp_stat_sn = be32_to_cpu(hdr->exp_statsn); in iscsit_setup_nop_out()
1808 cmd->data_direction = DMA_NONE; in iscsit_setup_nop_out()
1815 int iscsit_process_nop_out(struct iscsit_conn *conn, struct iscsit_cmd *cmd, in iscsit_process_nop_out() argument
1824 if (!cmd) in iscsit_process_nop_out()
1829 list_add_tail(&cmd->i_conn_node, &conn->conn_cmd_list); in iscsit_process_nop_out()
1835 iscsit_add_cmd_to_response_queue(cmd, conn, in iscsit_process_nop_out()
1836 cmd->i_state); in iscsit_process_nop_out()
1840 cmdsn_ret = iscsit_sequence_cmd(conn, cmd, in iscsit_process_nop_out()
1870 if (cmd) in iscsit_process_nop_out()
1871 iscsit_free_cmd(cmd, false); in iscsit_process_nop_out()
1877 static int iscsit_handle_nop_out(struct iscsit_conn *conn, struct iscsit_cmd *cmd, in iscsit_handle_nop_out() argument
1886 ret = iscsit_setup_nop_out(conn, cmd, hdr); in iscsit_handle_nop_out()
1902 iov = &cmd->iov_misc[0]; in iscsit_handle_nop_out()
1910 iov[niov].iov_base = &cmd->pad_bytes; in iscsit_handle_nop_out()
1920 WARN_ON_ONCE(niov > ARRAY_SIZE(cmd->iov_misc)); in iscsit_handle_nop_out()
1921 rx_got = rx_data(conn, &cmd->iov_misc[0], niov, rx_size); in iscsit_handle_nop_out()
1930 cmd->pad_bytes, &data_crc); in iscsit_handle_nop_out()
1964 cmd->buf_ptr = ping_data; in iscsit_handle_nop_out()
1965 cmd->buf_ptr_size = payload_length; in iscsit_handle_nop_out()
1972 return iscsit_process_nop_out(conn, cmd, hdr); in iscsit_handle_nop_out()
1974 if (cmd) in iscsit_handle_nop_out()
1975 iscsit_free_cmd(cmd, false); in iscsit_handle_nop_out()
2004 iscsit_handle_task_mgt_cmd(struct iscsit_conn *conn, struct iscsit_cmd *cmd, in iscsit_handle_task_mgt_cmd() argument
2034 return iscsit_add_reject_cmd(cmd, in iscsit_handle_task_mgt_cmd()
2041 cmd->data_direction = DMA_NONE; in iscsit_handle_task_mgt_cmd()
2042 cmd->tmr_req = kzalloc(sizeof(*cmd->tmr_req), GFP_KERNEL); in iscsit_handle_task_mgt_cmd()
2043 if (!cmd->tmr_req) { in iscsit_handle_task_mgt_cmd()
2044 return iscsit_add_reject_cmd(cmd, in iscsit_handle_task_mgt_cmd()
2049 __target_init_cmd(&cmd->se_cmd, &iscsi_ops, in iscsit_handle_task_mgt_cmd()
2051 TCM_SIMPLE_TAG, cmd->sense_buffer + 2, in iscsit_handle_task_mgt_cmd()
2055 target_get_sess_cmd(&cmd->se_cmd, true); in iscsit_handle_task_mgt_cmd()
2066 return iscsit_add_reject_cmd(cmd, in iscsit_handle_task_mgt_cmd()
2070 ret = core_tmr_alloc_req(&cmd->se_cmd, cmd->tmr_req, tcm_function, in iscsit_handle_task_mgt_cmd()
2073 return iscsit_add_reject_cmd(cmd, in iscsit_handle_task_mgt_cmd()
2076 cmd->tmr_req->se_tmr_req = cmd->se_cmd.se_tmr_req; in iscsit_handle_task_mgt_cmd()
2078 cmd->iscsi_opcode = ISCSI_OP_SCSI_TMFUNC; in iscsit_handle_task_mgt_cmd()
2079 cmd->i_state = ISTATE_SEND_TASKMGTRSP; in iscsit_handle_task_mgt_cmd()
2080 cmd->immediate_cmd = ((hdr->opcode & ISCSI_OP_IMMEDIATE) ? 1 : 0); in iscsit_handle_task_mgt_cmd()
2081 cmd->init_task_tag = hdr->itt; in iscsit_handle_task_mgt_cmd()
2082 cmd->targ_xfer_tag = 0xFFFFFFFF; in iscsit_handle_task_mgt_cmd()
2083 cmd->cmd_sn = be32_to_cpu(hdr->cmdsn); in iscsit_handle_task_mgt_cmd()
2084 cmd->exp_stat_sn = be32_to_cpu(hdr->exp_statsn); in iscsit_handle_task_mgt_cmd()
2085 se_tmr = cmd->se_cmd.se_tmr_req; in iscsit_handle_task_mgt_cmd()
2086 tmr_req = cmd->tmr_req; in iscsit_handle_task_mgt_cmd()
2091 ret = transport_lookup_tmr_lun(&cmd->se_cmd); in iscsit_handle_task_mgt_cmd()
2100 se_tmr->response = iscsit_tmr_abort_task(cmd, buf); in iscsit_handle_task_mgt_cmd()
2122 se_tmr->response = iscsit_tmr_task_reassign(cmd, buf); in iscsit_handle_task_mgt_cmd()
2131 return iscsit_add_reject_cmd(cmd, in iscsit_handle_task_mgt_cmd()
2146 list_add_tail(&cmd->i_conn_node, &conn->conn_cmd_list); in iscsit_handle_task_mgt_cmd()
2150 int cmdsn_ret = iscsit_sequence_cmd(conn, cmd, buf, hdr->cmdsn); in iscsit_handle_task_mgt_cmd()
2154 target_put_sess_cmd(&cmd->se_cmd); in iscsit_handle_task_mgt_cmd()
2168 return transport_generic_handle_tmr(&cmd->se_cmd); in iscsit_handle_task_mgt_cmd()
2178 iscsit_add_cmd_to_response_queue(cmd, conn, cmd->i_state); in iscsit_handle_task_mgt_cmd()
2179 target_put_sess_cmd(&cmd->se_cmd); in iscsit_handle_task_mgt_cmd()
2186 iscsit_setup_text_cmd(struct iscsit_conn *conn, struct iscsit_cmd *cmd, in iscsit_setup_text_cmd() argument
2195 return iscsit_reject_cmd(cmd, ISCSI_REASON_PROTOCOL_ERROR, in iscsit_setup_text_cmd()
2202 return iscsit_reject_cmd(cmd, ISCSI_REASON_CMD_NOT_SUPPORTED, in iscsit_setup_text_cmd()
2210 cmd->iscsi_opcode = ISCSI_OP_TEXT; in iscsit_setup_text_cmd()
2211 cmd->i_state = ISTATE_SEND_TEXTRSP; in iscsit_setup_text_cmd()
2212 cmd->immediate_cmd = ((hdr->opcode & ISCSI_OP_IMMEDIATE) ? 1 : 0); in iscsit_setup_text_cmd()
2213 conn->sess->init_task_tag = cmd->init_task_tag = hdr->itt; in iscsit_setup_text_cmd()
2214 cmd->targ_xfer_tag = 0xFFFFFFFF; in iscsit_setup_text_cmd()
2215 cmd->cmd_sn = be32_to_cpu(hdr->cmdsn); in iscsit_setup_text_cmd()
2216 cmd->exp_stat_sn = be32_to_cpu(hdr->exp_statsn); in iscsit_setup_text_cmd()
2217 cmd->data_direction = DMA_NONE; in iscsit_setup_text_cmd()
2218 kfree(cmd->text_in_ptr); in iscsit_setup_text_cmd()
2219 cmd->text_in_ptr = NULL; in iscsit_setup_text_cmd()
2226 iscsit_process_text_cmd(struct iscsit_conn *conn, struct iscsit_cmd *cmd, in iscsit_process_text_cmd() argument
2229 unsigned char *text_in = cmd->text_in_ptr, *text_ptr; in iscsit_process_text_cmd()
2233 cmd->targ_xfer_tag = be32_to_cpu(hdr->ttt); in iscsit_process_text_cmd()
2234 if (cmd->targ_xfer_tag == 0xFFFFFFFF) { in iscsit_process_text_cmd()
2250 cmd->cmd_flags |= ICF_SENDTARGETS_ALL; in iscsit_process_text_cmd()
2253 cmd->cmd_flags |= ICF_SENDTARGETS_SINGLE; in iscsit_process_text_cmd()
2261 list_add_tail(&cmd->i_conn_node, &conn->conn_cmd_list); in iscsit_process_text_cmd()
2268 cmdsn_ret = iscsit_sequence_cmd(conn, cmd, in iscsit_process_text_cmd()
2276 return iscsit_execute_cmd(cmd, 0); in iscsit_process_text_cmd()
2279 return iscsit_reject_cmd(cmd, ISCSI_REASON_PROTOCOL_ERROR, in iscsit_process_text_cmd()
2285 iscsit_handle_text_cmd(struct iscsit_conn *conn, struct iscsit_cmd *cmd, in iscsit_handle_text_cmd() argument
2293 rc = iscsit_setup_text_cmd(conn, cmd, hdr); in iscsit_handle_text_cmd()
2309 cmd->text_in_ptr = text_in; in iscsit_handle_text_cmd()
2366 return iscsit_process_text_cmd(conn, cmd, hdr); in iscsit_handle_text_cmd()
2369 kfree(cmd->text_in_ptr); in iscsit_handle_text_cmd()
2370 cmd->text_in_ptr = NULL; in iscsit_handle_text_cmd()
2371 return iscsit_reject_cmd(cmd, ISCSI_REASON_PROTOCOL_ERROR, buf); in iscsit_handle_text_cmd()
2374 int iscsit_logout_closesession(struct iscsit_cmd *cmd, struct iscsit_conn *conn) in iscsit_logout_closesession() argument
2399 iscsit_add_cmd_to_response_queue(cmd, conn, cmd->i_state); in iscsit_logout_closesession()
2404 int iscsit_logout_closeconnection(struct iscsit_cmd *cmd, struct iscsit_conn *conn) in iscsit_logout_closeconnection() argument
2410 " %hu on CID: %hu.\n", cmd->logout_cid, conn->cid); in iscsit_logout_closeconnection()
2416 if (conn->cid == cmd->logout_cid) { in iscsit_logout_closeconnection()
2436 cmd->logout_cid); in iscsit_logout_closeconnection()
2438 cmd->logout_response = ISCSI_LOGOUT_CID_NOT_FOUND; in iscsit_logout_closeconnection()
2439 iscsit_add_cmd_to_response_queue(cmd, conn, in iscsit_logout_closeconnection()
2440 cmd->i_state); in iscsit_logout_closeconnection()
2447 iscsit_add_cmd_to_response_queue(cmd, conn, cmd->i_state); in iscsit_logout_closeconnection()
2452 int iscsit_logout_removeconnforrecovery(struct iscsit_cmd *cmd, struct iscsit_conn *conn) in iscsit_logout_removeconnforrecovery() argument
2457 " CID: %hu on CID: %hu.\n", cmd->logout_cid, conn->cid); in iscsit_logout_removeconnforrecovery()
2462 cmd->logout_response = ISCSI_LOGOUT_RECOVERY_UNSUPPORTED; in iscsit_logout_removeconnforrecovery()
2463 iscsit_add_cmd_to_response_queue(cmd, conn, cmd->i_state); in iscsit_logout_removeconnforrecovery()
2467 if (conn->cid == cmd->logout_cid) { in iscsit_logout_removeconnforrecovery()
2470 cmd->logout_cid, conn->cid); in iscsit_logout_removeconnforrecovery()
2471 cmd->logout_response = ISCSI_LOGOUT_CLEANUP_FAILED; in iscsit_logout_removeconnforrecovery()
2472 iscsit_add_cmd_to_response_queue(cmd, conn, cmd->i_state); in iscsit_logout_removeconnforrecovery()
2476 iscsit_add_cmd_to_response_queue(cmd, conn, cmd->i_state); in iscsit_logout_removeconnforrecovery()
2482 iscsit_handle_logout_cmd(struct iscsit_conn *conn, struct iscsit_cmd *cmd, in iscsit_handle_logout_cmd() argument
2510 iscsit_free_cmd(cmd, false); in iscsit_handle_logout_cmd()
2514 cmd->iscsi_opcode = ISCSI_OP_LOGOUT; in iscsit_handle_logout_cmd()
2515 cmd->i_state = ISTATE_SEND_LOGOUTRSP; in iscsit_handle_logout_cmd()
2516 cmd->immediate_cmd = ((hdr->opcode & ISCSI_OP_IMMEDIATE) ? 1 : 0); in iscsit_handle_logout_cmd()
2517 conn->sess->init_task_tag = cmd->init_task_tag = hdr->itt; in iscsit_handle_logout_cmd()
2518 cmd->targ_xfer_tag = 0xFFFFFFFF; in iscsit_handle_logout_cmd()
2519 cmd->cmd_sn = be32_to_cpu(hdr->cmdsn); in iscsit_handle_logout_cmd()
2520 cmd->exp_stat_sn = be32_to_cpu(hdr->exp_statsn); in iscsit_handle_logout_cmd()
2521 cmd->logout_cid = be16_to_cpu(hdr->cid); in iscsit_handle_logout_cmd()
2522 cmd->logout_reason = reason_code; in iscsit_handle_logout_cmd()
2523 cmd->data_direction = DMA_NONE; in iscsit_handle_logout_cmd()
2535 list_add_tail(&cmd->i_conn_node, &conn->conn_cmd_list); in iscsit_handle_logout_cmd()
2545 if (cmd->immediate_cmd) { in iscsit_handle_logout_cmd()
2546 int ret = iscsit_execute_cmd(cmd, 0); in iscsit_handle_logout_cmd()
2551 cmdsn_ret = iscsit_sequence_cmd(conn, cmd, buf, hdr->cmdsn); in iscsit_handle_logout_cmd()
2628 struct iscsit_cmd *cmd, in iscsit_handle_immediate_data() argument
2634 struct iscsit_conn *conn = cmd->conn; in iscsit_handle_immediate_data()
2638 BUG_ON(cmd->write_data_done > cmd->se_cmd.data_length); in iscsit_handle_immediate_data()
2639 rx_size = min(cmd->se_cmd.data_length - cmd->write_data_done, length); in iscsit_handle_immediate_data()
2640 iov_ret = iscsit_map_iovec(cmd, cmd->iov_data, in iscsit_handle_immediate_data()
2641 cmd->orig_iov_data_count - 2, in iscsit_handle_immediate_data()
2642 cmd->write_data_done, rx_size); in iscsit_handle_immediate_data()
2647 iov = &cmd->iov_data[0]; in iscsit_handle_immediate_data()
2655 iscsit_unmap_iovec(cmd); in iscsit_handle_immediate_data()
2658 cmd->overflow_buf = overflow_buf; in iscsit_handle_immediate_data()
2667 iov[iov_count].iov_base = cmd->pad_bytes; in iscsit_handle_immediate_data()
2678 WARN_ON_ONCE(iov_count > cmd->orig_iov_data_count); in iscsit_handle_immediate_data()
2679 rx_got = rx_data(conn, &cmd->iov_data[0], iov_count, rx_size); in iscsit_handle_immediate_data()
2681 iscsit_unmap_iovec(cmd); in iscsit_handle_immediate_data()
2691 data_crc = iscsit_do_crypto_hash_sg(conn->conn_rx_hash, cmd, in iscsit_handle_immediate_data()
2692 cmd->write_data_done, length, padding, in iscsit_handle_immediate_data()
2693 cmd->pad_bytes); in iscsit_handle_immediate_data()
2704 iscsit_reject_cmd(cmd, in iscsit_handle_immediate_data()
2709 iscsit_reject_cmd(cmd, in iscsit_handle_immediate_data()
2721 cmd->write_data_done += length; in iscsit_handle_immediate_data()
2723 if (cmd->write_data_done == cmd->se_cmd.data_length) { in iscsit_handle_immediate_data()
2724 spin_lock_bh(&cmd->istate_lock); in iscsit_handle_immediate_data()
2725 cmd->cmd_flags |= ICF_GOT_LAST_DATAOUT; in iscsit_handle_immediate_data()
2726 cmd->i_state = ISTATE_RECEIVED_LAST_DATAOUT; in iscsit_handle_immediate_data()
2727 spin_unlock_bh(&cmd->istate_lock); in iscsit_handle_immediate_data()
2737 struct iscsit_cmd *cmd; in iscsit_build_conn_drop_async_message() local
2758 cmd = iscsit_allocate_cmd(conn_p, TASK_RUNNING); in iscsit_build_conn_drop_async_message()
2759 if (!cmd) { in iscsit_build_conn_drop_async_message()
2764 cmd->logout_cid = conn->cid; in iscsit_build_conn_drop_async_message()
2765 cmd->iscsi_opcode = ISCSI_OP_ASYNC_EVENT; in iscsit_build_conn_drop_async_message()
2766 cmd->i_state = ISTATE_SEND_ASYNCMSG; in iscsit_build_conn_drop_async_message()
2769 list_add_tail(&cmd->i_conn_node, &conn_p->conn_cmd_list); in iscsit_build_conn_drop_async_message()
2772 iscsit_add_cmd_to_response_queue(cmd, conn_p, cmd->i_state); in iscsit_build_conn_drop_async_message()
2777 struct iscsit_cmd *cmd, in iscsit_send_conn_drop_async_message() argument
2782 cmd->iscsi_opcode = ISCSI_OP_ASYNC_EVENT; in iscsit_send_conn_drop_async_message()
2784 hdr = (struct iscsi_async *) cmd->pdu; in iscsit_send_conn_drop_async_message()
2787 cmd->init_task_tag = RESERVED_ITT; in iscsit_send_conn_drop_async_message()
2788 cmd->targ_xfer_tag = 0xFFFFFFFF; in iscsit_send_conn_drop_async_message()
2790 cmd->stat_sn = conn->stat_sn++; in iscsit_send_conn_drop_async_message()
2791 hdr->statsn = cpu_to_be32(cmd->stat_sn); in iscsit_send_conn_drop_async_message()
2795 hdr->param1 = cpu_to_be16(cmd->logout_cid); in iscsit_send_conn_drop_async_message()
2800 " 0x%08x, for CID: %hu on CID: %hu\n", cmd->stat_sn, in iscsit_send_conn_drop_async_message()
2801 cmd->logout_cid, conn->cid); in iscsit_send_conn_drop_async_message()
2803 return conn->conn_transport->iscsit_xmit_pdu(conn, cmd, NULL, NULL, 0); in iscsit_send_conn_drop_async_message()
2817 iscsit_build_datain_pdu(struct iscsit_cmd *cmd, struct iscsit_conn *conn, in iscsit_build_datain_pdu() argument
2824 if (cmd->se_cmd.se_cmd_flags & SCF_OVERFLOW_BIT) { in iscsit_build_datain_pdu()
2826 hdr->residual_count = cpu_to_be32(cmd->se_cmd.residual_count); in iscsit_build_datain_pdu()
2827 } else if (cmd->se_cmd.se_cmd_flags & SCF_UNDERFLOW_BIT) { in iscsit_build_datain_pdu()
2829 hdr->residual_count = cpu_to_be32(cmd->se_cmd.residual_count); in iscsit_build_datain_pdu()
2834 int_to_scsilun(cmd->se_cmd.orig_fe_lun, in iscsit_build_datain_pdu()
2839 hdr->itt = cmd->init_task_tag; in iscsit_build_datain_pdu()
2842 hdr->ttt = cpu_to_be32(cmd->targ_xfer_tag); in iscsit_build_datain_pdu()
2846 hdr->statsn = cpu_to_be32(cmd->stat_sn); in iscsit_build_datain_pdu()
2857 cmd->init_task_tag, ntohl(hdr->statsn), ntohl(hdr->datasn), in iscsit_build_datain_pdu()
2862 static int iscsit_send_datain(struct iscsit_cmd *cmd, struct iscsit_conn *conn) in iscsit_send_datain() argument
2864 struct iscsi_data_rsp *hdr = (struct iscsi_data_rsp *)&cmd->pdu[0]; in iscsit_send_datain()
2871 dr = iscsit_get_datain_values(cmd, &datain); in iscsit_send_datain()
2874 cmd->init_task_tag); in iscsit_send_datain()
2880 if ((datain.offset + datain.length) > cmd->se_cmd.data_length) { in iscsit_send_datain()
2882 " datain.length: %u exceeds cmd->data_length: %u\n", in iscsit_send_datain()
2883 cmd->init_task_tag, datain.offset, datain.length, in iscsit_send_datain()
2884 cmd->se_cmd.data_length); in iscsit_send_datain()
2894 (cmd->se_cmd.se_cmd_flags & SCF_TRANSPORT_TASK_SENSE)) in iscsit_send_datain()
2899 iscsit_increment_maxcmdsn(cmd, conn->sess); in iscsit_send_datain()
2900 cmd->stat_sn = conn->stat_sn++; in iscsit_send_datain()
2907 iscsit_build_datain_pdu(cmd, conn, &datain, hdr, set_statsn); in iscsit_send_datain()
2909 ret = conn->conn_transport->iscsit_xmit_pdu(conn, cmd, dr, &datain, 0); in iscsit_send_datain()
2914 eodr = (cmd->se_cmd.se_cmd_flags & SCF_TRANSPORT_TASK_SENSE) ? in iscsit_send_datain()
2916 iscsit_free_datain_req(cmd, dr); in iscsit_send_datain()
2923 iscsit_build_logout_rsp(struct iscsit_cmd *cmd, struct iscsit_conn *conn, in iscsit_build_logout_rsp() argument
2934 switch (cmd->logout_reason) { in iscsit_build_logout_rsp()
2938 cmd->logout_response = ISCSI_LOGOUT_SUCCESS; in iscsit_build_logout_rsp()
2941 if (cmd->logout_response == ISCSI_LOGOUT_CID_NOT_FOUND) in iscsit_build_logout_rsp()
2951 * on, the connection responding to cmd->logout_cid in iscsit_build_logout_rsp()
2956 " successful.\n", cmd->logout_cid, conn->cid); in iscsit_build_logout_rsp()
2957 cmd->logout_response = ISCSI_LOGOUT_SUCCESS; in iscsit_build_logout_rsp()
2960 if ((cmd->logout_response == ISCSI_LOGOUT_RECOVERY_UNSUPPORTED) || in iscsit_build_logout_rsp()
2961 (cmd->logout_response == ISCSI_LOGOUT_CLEANUP_FAILED)) in iscsit_build_logout_rsp()
2968 cmd->logout_cid); in iscsit_build_logout_rsp()
2975 conn->sess, cmd->logout_cid); in iscsit_build_logout_rsp()
2979 cmd->logout_cid); in iscsit_build_logout_rsp()
2980 cmd->logout_response = ISCSI_LOGOUT_CID_NOT_FOUND; in iscsit_build_logout_rsp()
2984 iscsit_discard_cr_cmds_by_expstatsn(cr, cmd->exp_stat_sn); in iscsit_build_logout_rsp()
2988 cmd->logout_cid, conn->cid); in iscsit_build_logout_rsp()
2989 cmd->logout_response = ISCSI_LOGOUT_SUCCESS; in iscsit_build_logout_rsp()
2992 pr_err("Unknown cmd->logout_reason: 0x%02x\n", in iscsit_build_logout_rsp()
2993 cmd->logout_reason); in iscsit_build_logout_rsp()
2999 hdr->response = cmd->logout_response; in iscsit_build_logout_rsp()
3000 hdr->itt = cmd->init_task_tag; in iscsit_build_logout_rsp()
3001 cmd->stat_sn = conn->stat_sn++; in iscsit_build_logout_rsp()
3002 hdr->statsn = cpu_to_be32(cmd->stat_sn); in iscsit_build_logout_rsp()
3004 iscsit_increment_maxcmdsn(cmd, conn->sess); in iscsit_build_logout_rsp()
3010 cmd->init_task_tag, cmd->stat_sn, hdr->response, in iscsit_build_logout_rsp()
3011 cmd->logout_cid, conn->cid); in iscsit_build_logout_rsp()
3018 iscsit_send_logout(struct iscsit_cmd *cmd, struct iscsit_conn *conn) in iscsit_send_logout() argument
3022 rc = iscsit_build_logout_rsp(cmd, conn, in iscsit_send_logout()
3023 (struct iscsi_logout_rsp *)&cmd->pdu[0]); in iscsit_send_logout()
3027 return conn->conn_transport->iscsit_xmit_pdu(conn, cmd, NULL, NULL, 0); in iscsit_send_logout()
3031 iscsit_build_nopin_rsp(struct iscsit_cmd *cmd, struct iscsit_conn *conn, in iscsit_build_nopin_rsp() argument
3036 hton24(hdr->dlength, cmd->buf_ptr_size); in iscsit_build_nopin_rsp()
3039 hdr->itt = cmd->init_task_tag; in iscsit_build_nopin_rsp()
3040 hdr->ttt = cpu_to_be32(cmd->targ_xfer_tag); in iscsit_build_nopin_rsp()
3041 cmd->stat_sn = (nopout_response) ? conn->stat_sn++ : in iscsit_build_nopin_rsp()
3043 hdr->statsn = cpu_to_be32(cmd->stat_sn); in iscsit_build_nopin_rsp()
3046 iscsit_increment_maxcmdsn(cmd, conn->sess); in iscsit_build_nopin_rsp()
3053 "Solicited" : "Unsolicited", cmd->init_task_tag, in iscsit_build_nopin_rsp()
3054 cmd->targ_xfer_tag, cmd->stat_sn, cmd->buf_ptr_size); in iscsit_build_nopin_rsp()
3062 struct iscsit_cmd *cmd, in iscsit_send_unsolicited_nopin() argument
3066 struct iscsi_nopin *hdr = (struct iscsi_nopin *)&cmd->pdu[0]; in iscsit_send_unsolicited_nopin()
3069 iscsit_build_nopin_rsp(cmd, conn, hdr, false); in iscsit_send_unsolicited_nopin()
3072 " 0x%08x CID: %hu\n", hdr->ttt, cmd->stat_sn, conn->cid); in iscsit_send_unsolicited_nopin()
3074 ret = conn->conn_transport->iscsit_xmit_pdu(conn, cmd, NULL, NULL, 0); in iscsit_send_unsolicited_nopin()
3078 spin_lock_bh(&cmd->istate_lock); in iscsit_send_unsolicited_nopin()
3079 cmd->i_state = want_response ? in iscsit_send_unsolicited_nopin()
3081 spin_unlock_bh(&cmd->istate_lock); in iscsit_send_unsolicited_nopin()
3087 iscsit_send_nopin(struct iscsit_cmd *cmd, struct iscsit_conn *conn) in iscsit_send_nopin() argument
3089 struct iscsi_nopin *hdr = (struct iscsi_nopin *)&cmd->pdu[0]; in iscsit_send_nopin()
3091 iscsit_build_nopin_rsp(cmd, conn, hdr, true); in iscsit_send_nopin()
3097 pr_debug("Echoing back %u bytes of ping data.\n", cmd->buf_ptr_size); in iscsit_send_nopin()
3099 return conn->conn_transport->iscsit_xmit_pdu(conn, cmd, NULL, in iscsit_send_nopin()
3100 cmd->buf_ptr, in iscsit_send_nopin()
3101 cmd->buf_ptr_size); in iscsit_send_nopin()
3105 struct iscsit_cmd *cmd, in iscsit_send_r2t() argument
3112 r2t = iscsit_get_r2t_from_list(cmd); in iscsit_send_r2t()
3116 hdr = (struct iscsi_r2t_rsp *) cmd->pdu; in iscsit_send_r2t()
3120 int_to_scsilun(cmd->se_cmd.orig_fe_lun, in iscsit_send_r2t()
3122 hdr->itt = cmd->init_task_tag; in iscsit_send_r2t()
3124 conn->conn_transport->iscsit_get_r2t_ttt(conn, cmd, r2t); in iscsit_send_r2t()
3137 (!r2t->recovery_r2t) ? "" : "Recovery ", cmd->init_task_tag, in iscsit_send_r2t()
3141 spin_lock_bh(&cmd->r2t_lock); in iscsit_send_r2t()
3143 spin_unlock_bh(&cmd->r2t_lock); in iscsit_send_r2t()
3145 ret = conn->conn_transport->iscsit_xmit_pdu(conn, cmd, NULL, NULL, 0); in iscsit_send_r2t()
3150 spin_lock_bh(&cmd->dataout_timeout_lock); in iscsit_send_r2t()
3151 iscsit_start_dataout_timer(cmd, conn); in iscsit_send_r2t()
3152 spin_unlock_bh(&cmd->dataout_timeout_lock); in iscsit_send_r2t()
3163 struct iscsit_cmd *cmd, in iscsit_build_r2ts_for_cmd() argument
3169 spin_lock_bh(&cmd->r2t_lock); in iscsit_build_r2ts_for_cmd()
3170 if (cmd->cmd_flags & ICF_SENT_LAST_R2T) { in iscsit_build_r2ts_for_cmd()
3171 spin_unlock_bh(&cmd->r2t_lock); in iscsit_build_r2ts_for_cmd()
3177 cmd->r2t_offset = max(cmd->r2t_offset, cmd->write_data_done); in iscsit_build_r2ts_for_cmd()
3179 while (cmd->outstanding_r2ts < conn->sess->sess_ops->MaxOutstandingR2T) { in iscsit_build_r2ts_for_cmd()
3181 offset = cmd->r2t_offset; in iscsit_build_r2ts_for_cmd()
3186 cmd->next_burst_len; in iscsit_build_r2ts_for_cmd()
3188 if (new_data_end > cmd->se_cmd.data_length) in iscsit_build_r2ts_for_cmd()
3189 xfer_len = cmd->se_cmd.data_length - offset; in iscsit_build_r2ts_for_cmd()
3193 cmd->next_burst_len; in iscsit_build_r2ts_for_cmd()
3198 if (new_data_end > cmd->se_cmd.data_length) in iscsit_build_r2ts_for_cmd()
3199 xfer_len = cmd->se_cmd.data_length - offset; in iscsit_build_r2ts_for_cmd()
3205 cmd->cmd_flags |= ICF_SENT_LAST_R2T; in iscsit_build_r2ts_for_cmd()
3209 cmd->r2t_offset += xfer_len; in iscsit_build_r2ts_for_cmd()
3211 if (cmd->r2t_offset == cmd->se_cmd.data_length) in iscsit_build_r2ts_for_cmd()
3212 cmd->cmd_flags |= ICF_SENT_LAST_R2T; in iscsit_build_r2ts_for_cmd()
3216 seq = iscsit_get_seq_holder_for_r2t(cmd); in iscsit_build_r2ts_for_cmd()
3218 spin_unlock_bh(&cmd->r2t_lock); in iscsit_build_r2ts_for_cmd()
3225 if (cmd->seq_send_order == cmd->seq_count) in iscsit_build_r2ts_for_cmd()
3226 cmd->cmd_flags |= ICF_SENT_LAST_R2T; in iscsit_build_r2ts_for_cmd()
3228 cmd->outstanding_r2ts++; in iscsit_build_r2ts_for_cmd()
3231 if (iscsit_add_r2t_to_list(cmd, offset, xfer_len, 0, 0) < 0) { in iscsit_build_r2ts_for_cmd()
3232 spin_unlock_bh(&cmd->r2t_lock); in iscsit_build_r2ts_for_cmd()
3236 if (cmd->cmd_flags & ICF_SENT_LAST_R2T) in iscsit_build_r2ts_for_cmd()
3239 spin_unlock_bh(&cmd->r2t_lock); in iscsit_build_r2ts_for_cmd()
3245 void iscsit_build_rsp_pdu(struct iscsit_cmd *cmd, struct iscsit_conn *conn, in iscsit_build_rsp_pdu() argument
3249 cmd->stat_sn = conn->stat_sn++; in iscsit_build_rsp_pdu()
3256 if (cmd->se_cmd.se_cmd_flags & SCF_OVERFLOW_BIT) { in iscsit_build_rsp_pdu()
3258 hdr->residual_count = cpu_to_be32(cmd->se_cmd.residual_count); in iscsit_build_rsp_pdu()
3259 } else if (cmd->se_cmd.se_cmd_flags & SCF_UNDERFLOW_BIT) { in iscsit_build_rsp_pdu()
3261 hdr->residual_count = cpu_to_be32(cmd->se_cmd.residual_count); in iscsit_build_rsp_pdu()
3263 hdr->response = cmd->iscsi_response; in iscsit_build_rsp_pdu()
3264 hdr->cmd_status = cmd->se_cmd.scsi_status; in iscsit_build_rsp_pdu()
3265 hdr->itt = cmd->init_task_tag; in iscsit_build_rsp_pdu()
3266 hdr->statsn = cpu_to_be32(cmd->stat_sn); in iscsit_build_rsp_pdu()
3268 iscsit_increment_maxcmdsn(cmd, conn->sess); in iscsit_build_rsp_pdu()
3274 cmd->init_task_tag, cmd->stat_sn, cmd->se_cmd.scsi_status, in iscsit_build_rsp_pdu()
3275 cmd->se_cmd.scsi_status, conn->cid); in iscsit_build_rsp_pdu()
3279 static int iscsit_send_response(struct iscsit_cmd *cmd, struct iscsit_conn *conn) in iscsit_send_response() argument
3281 struct iscsi_scsi_rsp *hdr = (struct iscsi_scsi_rsp *)&cmd->pdu[0]; in iscsit_send_response()
3282 bool inc_stat_sn = (cmd->i_state == ISTATE_SEND_STATUS); in iscsit_send_response()
3286 iscsit_build_rsp_pdu(cmd, conn, inc_stat_sn, hdr); in iscsit_send_response()
3291 if (cmd->se_cmd.sense_buffer && in iscsit_send_response()
3292 ((cmd->se_cmd.se_cmd_flags & SCF_TRANSPORT_TASK_SENSE) || in iscsit_send_response()
3293 (cmd->se_cmd.se_cmd_flags & SCF_EMULATED_TASK_SENSE))) { in iscsit_send_response()
3294 put_unaligned_be16(cmd->se_cmd.scsi_sense_length, cmd->sense_buffer); in iscsit_send_response()
3295 cmd->se_cmd.scsi_sense_length += sizeof (__be16); in iscsit_send_response()
3297 padding = -(cmd->se_cmd.scsi_sense_length) & 3; in iscsit_send_response()
3298 hton24(hdr->dlength, (u32)cmd->se_cmd.scsi_sense_length); in iscsit_send_response()
3299 data_buf = cmd->sense_buffer; in iscsit_send_response()
3300 data_buf_len = cmd->se_cmd.scsi_sense_length + padding; in iscsit_send_response()
3303 memset(cmd->sense_buffer + in iscsit_send_response()
3304 cmd->se_cmd.scsi_sense_length, 0, padding); in iscsit_send_response()
3311 cmd->se_cmd.scsi_sense_length); in iscsit_send_response()
3314 return conn->conn_transport->iscsit_xmit_pdu(conn, cmd, NULL, data_buf, in iscsit_send_response()
3336 iscsit_build_task_mgt_rsp(struct iscsit_cmd *cmd, struct iscsit_conn *conn, in iscsit_build_task_mgt_rsp() argument
3339 struct se_tmr_req *se_tmr = cmd->se_cmd.se_tmr_req; in iscsit_build_task_mgt_rsp()
3344 hdr->itt = cmd->init_task_tag; in iscsit_build_task_mgt_rsp()
3345 cmd->stat_sn = conn->stat_sn++; in iscsit_build_task_mgt_rsp()
3346 hdr->statsn = cpu_to_be32(cmd->stat_sn); in iscsit_build_task_mgt_rsp()
3348 iscsit_increment_maxcmdsn(cmd, conn->sess); in iscsit_build_task_mgt_rsp()
3354 cmd->init_task_tag, cmd->stat_sn, hdr->response, conn->cid); in iscsit_build_task_mgt_rsp()
3359 iscsit_send_task_mgt_rsp(struct iscsit_cmd *cmd, struct iscsit_conn *conn) in iscsit_send_task_mgt_rsp() argument
3361 struct iscsi_tm_rsp *hdr = (struct iscsi_tm_rsp *)&cmd->pdu[0]; in iscsit_send_task_mgt_rsp()
3363 iscsit_build_task_mgt_rsp(cmd, conn, hdr); in iscsit_send_task_mgt_rsp()
3365 return conn->conn_transport->iscsit_xmit_pdu(conn, cmd, NULL, NULL, 0); in iscsit_send_task_mgt_rsp()
3371 iscsit_build_sendtargets_response(struct iscsit_cmd *cmd, in iscsit_build_sendtargets_response() argument
3376 struct iscsit_conn *conn = cmd->conn; in iscsit_build_sendtargets_response()
3383 unsigned char *text_in = cmd->text_in_ptr, *text_ptr = NULL; in iscsit_build_sendtargets_response()
3397 if (cmd->cmd_flags & ICF_SENDTARGETS_SINGLE) { in iscsit_build_sendtargets_response()
3413 if ((cmd->cmd_flags & ICF_SENDTARGETS_SINGLE) && in iscsit_build_sendtargets_response()
3431 cmd->conn->sess->sess_ops->InitiatorName))) { in iscsit_build_sendtargets_response()
3510 if (cmd->cmd_flags & ICF_SENDTARGETS_SINGLE) in iscsit_build_sendtargets_response()
3515 cmd->buf_ptr = payload; in iscsit_build_sendtargets_response()
3521 iscsit_build_text_rsp(struct iscsit_cmd *cmd, struct iscsit_conn *conn, in iscsit_build_text_rsp() argument
3528 text_length = iscsit_build_sendtargets_response(cmd, network_transport, in iscsit_build_text_rsp()
3529 cmd->read_data_done, in iscsit_build_text_rsp()
3538 cmd->read_data_done += text_length; in iscsit_build_text_rsp()
3539 if (cmd->targ_xfer_tag == 0xFFFFFFFF) in iscsit_build_text_rsp()
3540 cmd->targ_xfer_tag = session_get_next_ttt(conn->sess); in iscsit_build_text_rsp()
3545 hdr->itt = cmd->init_task_tag; in iscsit_build_text_rsp()
3546 hdr->ttt = cpu_to_be32(cmd->targ_xfer_tag); in iscsit_build_text_rsp()
3547 cmd->stat_sn = conn->stat_sn++; in iscsit_build_text_rsp()
3548 hdr->statsn = cpu_to_be32(cmd->stat_sn); in iscsit_build_text_rsp()
3550 iscsit_increment_maxcmdsn(cmd, conn->sess); in iscsit_build_text_rsp()
3556 cmd->maxcmdsn_inc = 0; in iscsit_build_text_rsp()
3561 " Length: %u, CID: %hu F: %d C: %d\n", cmd->init_task_tag, in iscsit_build_text_rsp()
3562 cmd->targ_xfer_tag, cmd->stat_sn, text_length, conn->cid, in iscsit_build_text_rsp()
3571 struct iscsit_cmd *cmd, in iscsit_send_text_rsp() argument
3574 struct iscsi_text_rsp *hdr = (struct iscsi_text_rsp *)cmd->pdu; in iscsit_send_text_rsp()
3577 text_length = iscsit_build_text_rsp(cmd, conn, hdr, in iscsit_send_text_rsp()
3582 return conn->conn_transport->iscsit_xmit_pdu(conn, cmd, NULL, in iscsit_send_text_rsp()
3583 cmd->buf_ptr, in iscsit_send_text_rsp()
3588 iscsit_build_reject(struct iscsit_cmd *cmd, struct iscsit_conn *conn, in iscsit_build_reject() argument
3592 hdr->reason = cmd->reject_reason; in iscsit_build_reject()
3596 cmd->stat_sn = conn->stat_sn++; in iscsit_build_reject()
3597 hdr->statsn = cpu_to_be32(cmd->stat_sn); in iscsit_build_reject()
3605 struct iscsit_cmd *cmd, in iscsit_send_reject() argument
3608 struct iscsi_reject *hdr = (struct iscsi_reject *)&cmd->pdu[0]; in iscsit_send_reject()
3610 iscsit_build_reject(cmd, conn, hdr); in iscsit_send_reject()
3615 return conn->conn_transport->iscsit_xmit_pdu(conn, cmd, NULL, in iscsit_send_reject()
3616 cmd->buf_ptr, in iscsit_send_reject()
3720 iscsit_immediate_queue(struct iscsit_conn *conn, struct iscsit_cmd *cmd, int state) in iscsit_immediate_queue() argument
3726 ret = iscsit_send_r2t(cmd, conn); in iscsit_immediate_queue()
3732 list_del_init(&cmd->i_conn_node); in iscsit_immediate_queue()
3735 iscsit_free_cmd(cmd, false); in iscsit_immediate_queue()
3739 ret = iscsit_send_unsolicited_nopin(cmd, conn, 1); in iscsit_immediate_queue()
3744 ret = iscsit_send_unsolicited_nopin(cmd, conn, 0); in iscsit_immediate_queue()
3751 cmd->iscsi_opcode, cmd->init_task_tag, state, in iscsit_immediate_queue()
3768 struct iscsit_cmd *cmd; in iscsit_handle_immediate_queue() local
3774 cmd = qr->cmd; in iscsit_handle_immediate_queue()
3778 ret = t->iscsit_immediate_queue(conn, cmd, state); in iscsit_handle_immediate_queue()
3787 iscsit_response_queue(struct iscsit_conn *conn, struct iscsit_cmd *cmd, int state) in iscsit_response_queue() argument
3794 ret = iscsit_send_datain(cmd, conn); in iscsit_response_queue()
3802 spin_lock_bh(&cmd->istate_lock); in iscsit_response_queue()
3803 cmd->i_state = ISTATE_SENT_STATUS; in iscsit_response_queue()
3804 spin_unlock_bh(&cmd->istate_lock); in iscsit_response_queue()
3813 spin_lock_bh(&cmd->istate_lock); in iscsit_response_queue()
3814 cmd->i_state = ISTATE_SEND_STATUS; in iscsit_response_queue()
3815 spin_unlock_bh(&cmd->istate_lock); in iscsit_response_queue()
3823 ret = iscsit_send_response(cmd, conn); in iscsit_response_queue()
3826 ret = iscsit_send_logout(cmd, conn); in iscsit_response_queue()
3830 cmd, conn); in iscsit_response_queue()
3833 ret = iscsit_send_nopin(cmd, conn); in iscsit_response_queue()
3836 ret = iscsit_send_reject(cmd, conn); in iscsit_response_queue()
3839 ret = iscsit_send_task_mgt_rsp(cmd, conn); in iscsit_response_queue()
3842 ret = iscsit_tmr_post_handler(cmd, conn); in iscsit_response_queue()
3847 ret = iscsit_send_text_rsp(cmd, conn); in iscsit_response_queue()
3852 cmd->iscsi_opcode, cmd->init_task_tag, in iscsit_response_queue()
3861 if (!iscsit_logout_post_handler(cmd, conn)) in iscsit_response_queue()
3871 spin_lock_bh(&cmd->istate_lock); in iscsit_response_queue()
3872 cmd->i_state = ISTATE_SENT_STATUS; in iscsit_response_queue()
3873 spin_unlock_bh(&cmd->istate_lock); in iscsit_response_queue()
3878 cmd->iscsi_opcode, cmd->init_task_tag, in iscsit_response_queue()
3879 cmd->i_state, conn->cid); in iscsit_response_queue()
3897 struct iscsit_cmd *cmd; in iscsit_handle_response_queue() local
3902 cmd = qr->cmd; in iscsit_handle_response_queue()
3906 ret = t->iscsit_response_queue(conn, cmd, state); in iscsit_handle_response_queue()
3975 struct iscsit_cmd *cmd; in iscsi_target_rx_opcode() local
3980 cmd = iscsit_allocate_cmd(conn, TASK_INTERRUPTIBLE); in iscsi_target_rx_opcode()
3981 if (!cmd) in iscsi_target_rx_opcode()
3984 ret = iscsit_handle_scsi_cmd(conn, cmd, buf); in iscsi_target_rx_opcode()
3990 cmd = NULL; in iscsi_target_rx_opcode()
3992 cmd = iscsit_allocate_cmd(conn, TASK_INTERRUPTIBLE); in iscsi_target_rx_opcode()
3993 if (!cmd) in iscsi_target_rx_opcode()
3996 ret = iscsit_handle_nop_out(conn, cmd, buf); in iscsi_target_rx_opcode()
3999 cmd = iscsit_allocate_cmd(conn, TASK_INTERRUPTIBLE); in iscsi_target_rx_opcode()
4000 if (!cmd) in iscsi_target_rx_opcode()
4003 ret = iscsit_handle_task_mgt_cmd(conn, cmd, buf); in iscsi_target_rx_opcode()
4007 cmd = iscsit_find_cmd_from_itt(conn, hdr->itt); in iscsi_target_rx_opcode()
4008 if (!cmd) in iscsi_target_rx_opcode()
4011 cmd = iscsit_allocate_cmd(conn, TASK_INTERRUPTIBLE); in iscsi_target_rx_opcode()
4012 if (!cmd) in iscsi_target_rx_opcode()
4016 ret = iscsit_handle_text_cmd(conn, cmd, buf); in iscsi_target_rx_opcode()
4019 cmd = iscsit_allocate_cmd(conn, TASK_INTERRUPTIBLE); in iscsi_target_rx_opcode()
4020 if (!cmd) in iscsi_target_rx_opcode()
4023 ret = iscsit_handle_logout_cmd(conn, cmd, buf); in iscsi_target_rx_opcode()
4203 struct iscsit_cmd *cmd = NULL, *cmd_tmp = NULL; in iscsit_release_commands_from_conn() local
4213 list_for_each_entry_safe(cmd, cmd_tmp, &tmp_list, i_conn_node) { in iscsit_release_commands_from_conn()
4214 struct se_cmd *se_cmd = &cmd->se_cmd; in iscsit_release_commands_from_conn()
4227 list_move_tail(&cmd->i_conn_node, in iscsit_release_commands_from_conn()
4233 if (cmd->se_cmd.t_state == TRANSPORT_WRITE_PENDING) { in iscsit_release_commands_from_conn()
4235 * We never submitted the cmd to LIO core, so we have in iscsit_release_commands_from_conn()
4239 target_complete_cmd(&cmd->se_cmd, SAM_STAT_TASK_ABORTED); in iscsit_release_commands_from_conn()
4246 list_for_each_entry_safe(cmd, cmd_tmp, &tmp_list, i_conn_node) { in iscsit_release_commands_from_conn()
4247 list_del_init(&cmd->i_conn_node); in iscsit_release_commands_from_conn()
4249 iscsit_increment_maxcmdsn(cmd, sess); in iscsit_release_commands_from_conn()
4250 iscsit_free_cmd(cmd, true); in iscsit_release_commands_from_conn()
4268 struct iscsit_cmd *cmd; in iscsit_stop_timers_for_cmds() local
4271 list_for_each_entry(cmd, &conn->conn_cmd_list, i_conn_node) { in iscsit_stop_timers_for_cmds()
4272 if (cmd->data_direction == DMA_TO_DEVICE) in iscsit_stop_timers_for_cmds()
4273 iscsit_stop_dataout_timer(cmd); in iscsit_stop_timers_for_cmds()
4673 struct iscsit_cmd *cmd, in iscsit_logout_post_handler() argument
4678 switch (cmd->logout_reason) { in iscsit_logout_post_handler()
4680 switch (cmd->logout_response) { in iscsit_logout_post_handler()
4689 if (conn->cid == cmd->logout_cid) { in iscsit_logout_post_handler()
4690 switch (cmd->logout_response) { in iscsit_logout_post_handler()
4698 switch (cmd->logout_response) { in iscsit_logout_post_handler()
4701 cmd->logout_cid); in iscsit_logout_post_handler()
4712 switch (cmd->logout_response) { in iscsit_logout_post_handler()