Lines Matching refs: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()
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()
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()
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 core_alua_check_nonop_delay(&cmd->se_cmd); in iscsit_setup_scsi_cmd()
1247 void iscsit_set_unsolicited_dataout(struct iscsit_cmd *cmd) in iscsit_set_unsolicited_dataout() argument
1249 iscsit_set_dataout_sequence_values(cmd); in iscsit_set_unsolicited_dataout()
1251 spin_lock_bh(&cmd->dataout_timeout_lock); in iscsit_set_unsolicited_dataout()
1252 iscsit_start_dataout_timer(cmd, cmd->conn); in iscsit_set_unsolicited_dataout()
1253 spin_unlock_bh(&cmd->dataout_timeout_lock); in iscsit_set_unsolicited_dataout()
1257 int iscsit_process_scsi_cmd(struct iscsit_conn *conn, struct iscsit_cmd *cmd, in iscsit_process_scsi_cmd() argument
1271 if (!cmd->immediate_data) { in iscsit_process_scsi_cmd()
1272 cmdsn_ret = iscsit_sequence_cmd(conn, cmd, in iscsit_process_scsi_cmd()
1277 target_put_sess_cmd(&cmd->se_cmd); in iscsit_process_scsi_cmd()
1287 if (!cmd->immediate_data) { in iscsit_process_scsi_cmd()
1288 if (!cmd->sense_reason && cmd->unsolicited_data) in iscsit_process_scsi_cmd()
1289 iscsit_set_unsolicited_dataout(cmd); in iscsit_process_scsi_cmd()
1290 if (!cmd->sense_reason) in iscsit_process_scsi_cmd()
1293 target_put_sess_cmd(&cmd->se_cmd); in iscsit_process_scsi_cmd()
1302 if (cmd->sense_reason) in iscsit_process_scsi_cmd()
1308 cmd->sense_reason = transport_generic_new_cmd(&cmd->se_cmd); in iscsit_process_scsi_cmd()
1309 if (cmd->sense_reason) in iscsit_process_scsi_cmd()
1317 iscsit_get_immediate_data(struct iscsit_cmd *cmd, struct iscsi_scsi_req *hdr, in iscsit_get_immediate_data() argument
1327 u32 length = min(cmd->se_cmd.data_length - cmd->write_data_done, in iscsit_get_immediate_data()
1328 cmd->first_burst_len); in iscsit_get_immediate_data()
1331 cmd->se_cmd.data_length, cmd->write_data_done, in iscsit_get_immediate_data()
1332 cmd->first_burst_len, length); in iscsit_get_immediate_data()
1333 rc = iscsit_dump_data_payload(cmd->conn, length, 1); in iscsit_get_immediate_data()
1338 immed_ret = iscsit_handle_immediate_data(cmd, hdr, in iscsit_get_immediate_data()
1339 cmd->first_burst_len); in iscsit_get_immediate_data()
1348 cmdsn_ret = iscsit_sequence_cmd(cmd->conn, cmd, in iscsit_get_immediate_data()
1353 if (cmd->sense_reason || cmdsn_ret == CMDSN_LOWER_THAN_EXP) { in iscsit_get_immediate_data()
1354 target_put_sess_cmd(&cmd->se_cmd); in iscsit_get_immediate_data()
1357 } else if (cmd->unsolicited_data) in iscsit_get_immediate_data()
1358 iscsit_set_unsolicited_dataout(cmd); in iscsit_get_immediate_data()
1372 cmd->i_state = ISTATE_REMOVE; in iscsit_get_immediate_data()
1373 iscsit_add_cmd_to_immediate_queue(cmd, cmd->conn, cmd->i_state); in iscsit_get_immediate_data()
1381 iscsit_handle_scsi_cmd(struct iscsit_conn *conn, struct iscsit_cmd *cmd, in iscsit_handle_scsi_cmd() argument
1388 rc = iscsit_setup_scsi_cmd(conn, cmd, buf); in iscsit_handle_scsi_cmd()
1395 if (iscsit_allocate_iovecs(cmd) < 0) { in iscsit_handle_scsi_cmd()
1396 return iscsit_reject_cmd(cmd, in iscsit_handle_scsi_cmd()
1399 immed_data = cmd->immediate_data; in iscsit_handle_scsi_cmd()
1401 rc = iscsit_process_scsi_cmd(conn, cmd, hdr); in iscsit_handle_scsi_cmd()
1410 return iscsit_get_immediate_data(cmd, hdr, dump_payload); in iscsit_handle_scsi_cmd()
1415 struct iscsit_cmd *cmd, in iscsit_do_crypto_hash_sg() argument
1427 sg = cmd->first_data_sg; in iscsit_do_crypto_hash_sg()
1428 page_off = cmd->first_data_sg_off; in iscsit_do_crypto_hash_sg()
1488 struct iscsit_cmd *cmd, u32 payload_length, in __iscsit_check_dataout_hdr() argument
1503 if (cmd->cmd_flags & ICF_GOT_LAST_DATAOUT) { in __iscsit_check_dataout_hdr()
1506 cmd->init_task_tag); in __iscsit_check_dataout_hdr()
1510 if (cmd->data_direction != DMA_TO_DEVICE) { in __iscsit_check_dataout_hdr()
1512 " NON-WRITE command.\n", cmd->init_task_tag); in __iscsit_check_dataout_hdr()
1515 se_cmd = &cmd->se_cmd; in __iscsit_check_dataout_hdr()
1516 iscsit_mod_dataout_timer(cmd); in __iscsit_check_dataout_hdr()
1518 if ((be32_to_cpu(hdr->offset) + payload_length) > cmd->se_cmd.data_length) { in __iscsit_check_dataout_hdr()
1521 cmd->se_cmd.data_length); in __iscsit_check_dataout_hdr()
1522 return iscsit_reject_cmd(cmd, ISCSI_REASON_BOOKMARK_INVALID, buf); in __iscsit_check_dataout_hdr()
1525 if (cmd->unsolicited_data) { in __iscsit_check_dataout_hdr()
1531 transport_send_check_condition_and_sense(&cmd->se_cmd, in __iscsit_check_dataout_hdr()
1553 iscsit_stop_dataout_timer(cmd); in __iscsit_check_dataout_hdr()
1570 --cmd->outstanding_r2ts < 1) in __iscsit_check_dataout_hdr()
1571 iscsit_stop_dataout_timer(cmd); in __iscsit_check_dataout_hdr()
1580 rc = iscsit_check_pre_dataout(cmd, buf); in __iscsit_check_dataout_hdr()
1595 struct iscsit_cmd *cmd; in iscsit_check_dataout_hdr() local
1612 cmd = iscsit_find_cmd_from_itt_or_dump(conn, hdr->itt, payload_length); in iscsit_check_dataout_hdr()
1613 if (!cmd) in iscsit_check_dataout_hdr()
1616 rc = __iscsit_check_dataout_hdr(conn, buf, cmd, payload_length, &success); in iscsit_check_dataout_hdr()
1619 *out_cmd = cmd; in iscsit_check_dataout_hdr()
1626 iscsit_get_dataout(struct iscsit_conn *conn, struct iscsit_cmd *cmd, in iscsit_get_dataout() argument
1634 payload_length = min_t(u32, cmd->se_cmd.data_length, in iscsit_get_dataout()
1637 iov = &cmd->iov_data[0]; in iscsit_get_dataout()
1639 iov_ret = iscsit_map_iovec(cmd, iov, cmd->orig_iov_data_count - 2, in iscsit_get_dataout()
1648 iov[iov_count].iov_base = cmd->pad_bytes; in iscsit_get_dataout()
1660 WARN_ON_ONCE(iov_count > cmd->orig_iov_data_count); in iscsit_get_dataout()
1661 rx_got = rx_data(conn, &cmd->iov_data[0], iov_count, rx_size); in iscsit_get_dataout()
1663 iscsit_unmap_iovec(cmd); in iscsit_get_dataout()
1671 data_crc = iscsit_do_crypto_hash_sg(conn->conn_rx_hash, cmd, in iscsit_get_dataout()
1674 cmd->pad_bytes); in iscsit_get_dataout()
1694 iscsit_check_dataout_payload(struct iscsit_cmd *cmd, struct iscsi_data *hdr, in iscsit_check_dataout_payload() argument
1697 struct iscsit_conn *conn = cmd->conn; in iscsit_check_dataout_payload()
1703 rc = iscsit_check_post_dataout(cmd, (unsigned char *)hdr, data_crc_failed); in iscsit_check_dataout_payload()
1707 iscsit_set_dataout_sequence_values(cmd); in iscsit_check_dataout_payload()
1708 conn->conn_transport->iscsit_get_dataout(conn, cmd, false); in iscsit_check_dataout_payload()
1714 spin_lock_bh(&cmd->istate_lock); in iscsit_check_dataout_payload()
1715 ooo_cmdsn = (cmd->cmd_flags & ICF_OOO_CMDSN); in iscsit_check_dataout_payload()
1716 cmd->cmd_flags |= ICF_GOT_LAST_DATAOUT; in iscsit_check_dataout_payload()
1717 cmd->i_state = ISTATE_RECEIVED_LAST_DATAOUT; in iscsit_check_dataout_payload()
1718 spin_unlock_bh(&cmd->istate_lock); in iscsit_check_dataout_payload()
1720 iscsit_stop_dataout_timer(cmd); in iscsit_check_dataout_payload()
1723 target_execute_cmd(&cmd->se_cmd); in iscsit_check_dataout_payload()
1734 struct iscsit_cmd *cmd = NULL; in iscsit_handle_data_out() local
1739 rc = iscsit_check_dataout_hdr(conn, buf, &cmd); in iscsit_handle_data_out()
1742 else if (!cmd) in iscsit_handle_data_out()
1745 rc = iscsit_get_dataout(conn, cmd, hdr); in iscsit_handle_data_out()
1751 return iscsit_check_dataout_payload(cmd, hdr, data_crc_failed); in iscsit_handle_data_out()
1754 int iscsit_setup_nop_out(struct iscsit_conn *conn, struct iscsit_cmd *cmd, in iscsit_setup_nop_out() argument
1761 if (!cmd) in iscsit_setup_nop_out()
1765 return iscsit_reject_cmd(cmd, ISCSI_REASON_PROTOCOL_ERROR, in iscsit_setup_nop_out()
1772 if (!cmd) in iscsit_setup_nop_out()
1776 return iscsit_reject_cmd(cmd, ISCSI_REASON_PROTOCOL_ERROR, in iscsit_setup_nop_out()
1785 if (!cmd) in iscsit_setup_nop_out()
1789 return iscsit_reject_cmd(cmd, ISCSI_REASON_PROTOCOL_ERROR, in iscsit_setup_nop_out()
1806 cmd->iscsi_opcode = ISCSI_OP_NOOP_OUT; in iscsit_setup_nop_out()
1807 cmd->i_state = ISTATE_SEND_NOPIN; in iscsit_setup_nop_out()
1808 cmd->immediate_cmd = ((hdr->opcode & ISCSI_OP_IMMEDIATE) ? in iscsit_setup_nop_out()
1810 conn->sess->init_task_tag = cmd->init_task_tag = hdr->itt; in iscsit_setup_nop_out()
1811 cmd->targ_xfer_tag = 0xFFFFFFFF; in iscsit_setup_nop_out()
1812 cmd->cmd_sn = be32_to_cpu(hdr->cmdsn); in iscsit_setup_nop_out()
1813 cmd->exp_stat_sn = be32_to_cpu(hdr->exp_statsn); in iscsit_setup_nop_out()
1814 cmd->data_direction = DMA_NONE; in iscsit_setup_nop_out()
1821 int iscsit_process_nop_out(struct iscsit_conn *conn, struct iscsit_cmd *cmd, in iscsit_process_nop_out() argument
1830 if (!cmd) in iscsit_process_nop_out()
1835 list_add_tail(&cmd->i_conn_node, &conn->conn_cmd_list); in iscsit_process_nop_out()
1841 iscsit_add_cmd_to_response_queue(cmd, conn, in iscsit_process_nop_out()
1842 cmd->i_state); in iscsit_process_nop_out()
1846 cmdsn_ret = iscsit_sequence_cmd(conn, cmd, in iscsit_process_nop_out()
1876 if (cmd) in iscsit_process_nop_out()
1877 iscsit_free_cmd(cmd, false); in iscsit_process_nop_out()
1883 static int iscsit_handle_nop_out(struct iscsit_conn *conn, struct iscsit_cmd *cmd, in iscsit_handle_nop_out() argument
1892 ret = iscsit_setup_nop_out(conn, cmd, hdr); in iscsit_handle_nop_out()
1908 iov = &cmd->iov_misc[0]; in iscsit_handle_nop_out()
1916 iov[niov].iov_base = &cmd->pad_bytes; in iscsit_handle_nop_out()
1926 WARN_ON_ONCE(niov > ARRAY_SIZE(cmd->iov_misc)); in iscsit_handle_nop_out()
1927 rx_got = rx_data(conn, &cmd->iov_misc[0], niov, rx_size); in iscsit_handle_nop_out()
1936 cmd->pad_bytes, &data_crc); in iscsit_handle_nop_out()
1970 cmd->buf_ptr = ping_data; in iscsit_handle_nop_out()
1971 cmd->buf_ptr_size = payload_length; in iscsit_handle_nop_out()
1978 return iscsit_process_nop_out(conn, cmd, hdr); in iscsit_handle_nop_out()
1980 if (cmd) in iscsit_handle_nop_out()
1981 iscsit_free_cmd(cmd, false); in iscsit_handle_nop_out()
2010 iscsit_handle_task_mgt_cmd(struct iscsit_conn *conn, struct iscsit_cmd *cmd, in iscsit_handle_task_mgt_cmd() argument
2040 return iscsit_add_reject_cmd(cmd, in iscsit_handle_task_mgt_cmd()
2047 cmd->data_direction = DMA_NONE; in iscsit_handle_task_mgt_cmd()
2048 cmd->tmr_req = kzalloc(sizeof(*cmd->tmr_req), GFP_KERNEL); in iscsit_handle_task_mgt_cmd()
2049 if (!cmd->tmr_req) { in iscsit_handle_task_mgt_cmd()
2050 return iscsit_add_reject_cmd(cmd, in iscsit_handle_task_mgt_cmd()
2055 __target_init_cmd(&cmd->se_cmd, &iscsi_ops, in iscsit_handle_task_mgt_cmd()
2057 TCM_SIMPLE_TAG, cmd->sense_buffer + 2, in iscsit_handle_task_mgt_cmd()
2061 target_get_sess_cmd(&cmd->se_cmd, true); in iscsit_handle_task_mgt_cmd()
2072 return iscsit_add_reject_cmd(cmd, in iscsit_handle_task_mgt_cmd()
2076 ret = core_tmr_alloc_req(&cmd->se_cmd, cmd->tmr_req, tcm_function, in iscsit_handle_task_mgt_cmd()
2079 return iscsit_add_reject_cmd(cmd, in iscsit_handle_task_mgt_cmd()
2082 cmd->tmr_req->se_tmr_req = cmd->se_cmd.se_tmr_req; in iscsit_handle_task_mgt_cmd()
2084 cmd->iscsi_opcode = ISCSI_OP_SCSI_TMFUNC; in iscsit_handle_task_mgt_cmd()
2085 cmd->i_state = ISTATE_SEND_TASKMGTRSP; in iscsit_handle_task_mgt_cmd()
2086 cmd->immediate_cmd = ((hdr->opcode & ISCSI_OP_IMMEDIATE) ? 1 : 0); in iscsit_handle_task_mgt_cmd()
2087 cmd->init_task_tag = hdr->itt; in iscsit_handle_task_mgt_cmd()
2088 cmd->targ_xfer_tag = 0xFFFFFFFF; in iscsit_handle_task_mgt_cmd()
2089 cmd->cmd_sn = be32_to_cpu(hdr->cmdsn); in iscsit_handle_task_mgt_cmd()
2090 cmd->exp_stat_sn = be32_to_cpu(hdr->exp_statsn); in iscsit_handle_task_mgt_cmd()
2091 se_tmr = cmd->se_cmd.se_tmr_req; in iscsit_handle_task_mgt_cmd()
2092 tmr_req = cmd->tmr_req; in iscsit_handle_task_mgt_cmd()
2097 ret = transport_lookup_tmr_lun(&cmd->se_cmd); in iscsit_handle_task_mgt_cmd()
2106 se_tmr->response = iscsit_tmr_abort_task(cmd, buf); in iscsit_handle_task_mgt_cmd()
2128 se_tmr->response = iscsit_tmr_task_reassign(cmd, buf); in iscsit_handle_task_mgt_cmd()
2137 return iscsit_add_reject_cmd(cmd, in iscsit_handle_task_mgt_cmd()
2152 list_add_tail(&cmd->i_conn_node, &conn->conn_cmd_list); in iscsit_handle_task_mgt_cmd()
2156 int cmdsn_ret = iscsit_sequence_cmd(conn, cmd, buf, hdr->cmdsn); in iscsit_handle_task_mgt_cmd()
2160 target_put_sess_cmd(&cmd->se_cmd); in iscsit_handle_task_mgt_cmd()
2174 return transport_generic_handle_tmr(&cmd->se_cmd); in iscsit_handle_task_mgt_cmd()
2184 iscsit_add_cmd_to_response_queue(cmd, conn, cmd->i_state); in iscsit_handle_task_mgt_cmd()
2185 target_put_sess_cmd(&cmd->se_cmd); in iscsit_handle_task_mgt_cmd()
2192 iscsit_setup_text_cmd(struct iscsit_conn *conn, struct iscsit_cmd *cmd, in iscsit_setup_text_cmd() argument
2201 return iscsit_reject_cmd(cmd, ISCSI_REASON_PROTOCOL_ERROR, in iscsit_setup_text_cmd()
2208 return iscsit_reject_cmd(cmd, ISCSI_REASON_CMD_NOT_SUPPORTED, in iscsit_setup_text_cmd()
2216 cmd->iscsi_opcode = ISCSI_OP_TEXT; in iscsit_setup_text_cmd()
2217 cmd->i_state = ISTATE_SEND_TEXTRSP; in iscsit_setup_text_cmd()
2218 cmd->immediate_cmd = ((hdr->opcode & ISCSI_OP_IMMEDIATE) ? 1 : 0); in iscsit_setup_text_cmd()
2219 conn->sess->init_task_tag = cmd->init_task_tag = hdr->itt; in iscsit_setup_text_cmd()
2220 cmd->targ_xfer_tag = 0xFFFFFFFF; in iscsit_setup_text_cmd()
2221 cmd->cmd_sn = be32_to_cpu(hdr->cmdsn); in iscsit_setup_text_cmd()
2222 cmd->exp_stat_sn = be32_to_cpu(hdr->exp_statsn); in iscsit_setup_text_cmd()
2223 cmd->data_direction = DMA_NONE; in iscsit_setup_text_cmd()
2224 kfree(cmd->text_in_ptr); in iscsit_setup_text_cmd()
2225 cmd->text_in_ptr = NULL; in iscsit_setup_text_cmd()
2232 iscsit_process_text_cmd(struct iscsit_conn *conn, struct iscsit_cmd *cmd, in iscsit_process_text_cmd() argument
2235 unsigned char *text_in = cmd->text_in_ptr, *text_ptr; in iscsit_process_text_cmd()
2239 cmd->targ_xfer_tag = be32_to_cpu(hdr->ttt); in iscsit_process_text_cmd()
2240 if (cmd->targ_xfer_tag == 0xFFFFFFFF) { in iscsit_process_text_cmd()
2256 cmd->cmd_flags |= ICF_SENDTARGETS_ALL; in iscsit_process_text_cmd()
2259 cmd->cmd_flags |= ICF_SENDTARGETS_SINGLE; in iscsit_process_text_cmd()
2267 list_add_tail(&cmd->i_conn_node, &conn->conn_cmd_list); in iscsit_process_text_cmd()
2274 cmdsn_ret = iscsit_sequence_cmd(conn, cmd, in iscsit_process_text_cmd()
2282 return iscsit_execute_cmd(cmd, 0); in iscsit_process_text_cmd()
2285 return iscsit_reject_cmd(cmd, ISCSI_REASON_PROTOCOL_ERROR, in iscsit_process_text_cmd()
2291 iscsit_handle_text_cmd(struct iscsit_conn *conn, struct iscsit_cmd *cmd, in iscsit_handle_text_cmd() argument
2299 rc = iscsit_setup_text_cmd(conn, cmd, hdr); in iscsit_handle_text_cmd()
2315 cmd->text_in_ptr = text_in; in iscsit_handle_text_cmd()
2372 return iscsit_process_text_cmd(conn, cmd, hdr); in iscsit_handle_text_cmd()
2375 kfree(cmd->text_in_ptr); in iscsit_handle_text_cmd()
2376 cmd->text_in_ptr = NULL; in iscsit_handle_text_cmd()
2377 return iscsit_reject_cmd(cmd, ISCSI_REASON_PROTOCOL_ERROR, buf); in iscsit_handle_text_cmd()
2380 int iscsit_logout_closesession(struct iscsit_cmd *cmd, struct iscsit_conn *conn) in iscsit_logout_closesession() argument
2405 iscsit_add_cmd_to_response_queue(cmd, conn, cmd->i_state); in iscsit_logout_closesession()
2410 int iscsit_logout_closeconnection(struct iscsit_cmd *cmd, struct iscsit_conn *conn) in iscsit_logout_closeconnection() argument
2416 " %hu on CID: %hu.\n", cmd->logout_cid, conn->cid); in iscsit_logout_closeconnection()
2422 if (conn->cid == cmd->logout_cid) { in iscsit_logout_closeconnection()
2442 cmd->logout_cid); in iscsit_logout_closeconnection()
2444 cmd->logout_response = ISCSI_LOGOUT_CID_NOT_FOUND; in iscsit_logout_closeconnection()
2445 iscsit_add_cmd_to_response_queue(cmd, conn, in iscsit_logout_closeconnection()
2446 cmd->i_state); in iscsit_logout_closeconnection()
2453 iscsit_add_cmd_to_response_queue(cmd, conn, cmd->i_state); in iscsit_logout_closeconnection()
2458 int iscsit_logout_removeconnforrecovery(struct iscsit_cmd *cmd, struct iscsit_conn *conn) in iscsit_logout_removeconnforrecovery() argument
2463 " CID: %hu on CID: %hu.\n", cmd->logout_cid, conn->cid); in iscsit_logout_removeconnforrecovery()
2468 cmd->logout_response = ISCSI_LOGOUT_RECOVERY_UNSUPPORTED; in iscsit_logout_removeconnforrecovery()
2469 iscsit_add_cmd_to_response_queue(cmd, conn, cmd->i_state); in iscsit_logout_removeconnforrecovery()
2473 if (conn->cid == cmd->logout_cid) { in iscsit_logout_removeconnforrecovery()
2476 cmd->logout_cid, conn->cid); in iscsit_logout_removeconnforrecovery()
2477 cmd->logout_response = ISCSI_LOGOUT_CLEANUP_FAILED; in iscsit_logout_removeconnforrecovery()
2478 iscsit_add_cmd_to_response_queue(cmd, conn, cmd->i_state); in iscsit_logout_removeconnforrecovery()
2482 iscsit_add_cmd_to_response_queue(cmd, conn, cmd->i_state); in iscsit_logout_removeconnforrecovery()
2488 iscsit_handle_logout_cmd(struct iscsit_conn *conn, struct iscsit_cmd *cmd, in iscsit_handle_logout_cmd() argument
2516 iscsit_free_cmd(cmd, false); in iscsit_handle_logout_cmd()
2520 cmd->iscsi_opcode = ISCSI_OP_LOGOUT; in iscsit_handle_logout_cmd()
2521 cmd->i_state = ISTATE_SEND_LOGOUTRSP; in iscsit_handle_logout_cmd()
2522 cmd->immediate_cmd = ((hdr->opcode & ISCSI_OP_IMMEDIATE) ? 1 : 0); in iscsit_handle_logout_cmd()
2523 conn->sess->init_task_tag = cmd->init_task_tag = hdr->itt; in iscsit_handle_logout_cmd()
2524 cmd->targ_xfer_tag = 0xFFFFFFFF; in iscsit_handle_logout_cmd()
2525 cmd->cmd_sn = be32_to_cpu(hdr->cmdsn); in iscsit_handle_logout_cmd()
2526 cmd->exp_stat_sn = be32_to_cpu(hdr->exp_statsn); in iscsit_handle_logout_cmd()
2527 cmd->logout_cid = be16_to_cpu(hdr->cid); in iscsit_handle_logout_cmd()
2528 cmd->logout_reason = reason_code; in iscsit_handle_logout_cmd()
2529 cmd->data_direction = DMA_NONE; in iscsit_handle_logout_cmd()
2541 list_add_tail(&cmd->i_conn_node, &conn->conn_cmd_list); in iscsit_handle_logout_cmd()
2551 if (cmd->immediate_cmd) { in iscsit_handle_logout_cmd()
2552 int ret = iscsit_execute_cmd(cmd, 0); in iscsit_handle_logout_cmd()
2557 cmdsn_ret = iscsit_sequence_cmd(conn, cmd, buf, hdr->cmdsn); in iscsit_handle_logout_cmd()
2634 struct iscsit_cmd *cmd, in iscsit_handle_immediate_data() argument
2640 struct iscsit_conn *conn = cmd->conn; in iscsit_handle_immediate_data()
2644 BUG_ON(cmd->write_data_done > cmd->se_cmd.data_length); in iscsit_handle_immediate_data()
2645 rx_size = min(cmd->se_cmd.data_length - cmd->write_data_done, length); in iscsit_handle_immediate_data()
2646 iov_ret = iscsit_map_iovec(cmd, cmd->iov_data, in iscsit_handle_immediate_data()
2647 cmd->orig_iov_data_count - 2, in iscsit_handle_immediate_data()
2648 cmd->write_data_done, rx_size); in iscsit_handle_immediate_data()
2653 iov = &cmd->iov_data[0]; in iscsit_handle_immediate_data()
2661 iscsit_unmap_iovec(cmd); in iscsit_handle_immediate_data()
2664 cmd->overflow_buf = overflow_buf; in iscsit_handle_immediate_data()
2673 iov[iov_count].iov_base = cmd->pad_bytes; in iscsit_handle_immediate_data()
2684 WARN_ON_ONCE(iov_count > cmd->orig_iov_data_count); in iscsit_handle_immediate_data()
2685 rx_got = rx_data(conn, &cmd->iov_data[0], iov_count, rx_size); in iscsit_handle_immediate_data()
2687 iscsit_unmap_iovec(cmd); in iscsit_handle_immediate_data()
2697 data_crc = iscsit_do_crypto_hash_sg(conn->conn_rx_hash, cmd, in iscsit_handle_immediate_data()
2698 cmd->write_data_done, length, padding, in iscsit_handle_immediate_data()
2699 cmd->pad_bytes); in iscsit_handle_immediate_data()
2710 iscsit_reject_cmd(cmd, in iscsit_handle_immediate_data()
2715 iscsit_reject_cmd(cmd, in iscsit_handle_immediate_data()
2727 cmd->write_data_done += length; in iscsit_handle_immediate_data()
2729 if (cmd->write_data_done == cmd->se_cmd.data_length) { in iscsit_handle_immediate_data()
2730 spin_lock_bh(&cmd->istate_lock); in iscsit_handle_immediate_data()
2731 cmd->cmd_flags |= ICF_GOT_LAST_DATAOUT; in iscsit_handle_immediate_data()
2732 cmd->i_state = ISTATE_RECEIVED_LAST_DATAOUT; in iscsit_handle_immediate_data()
2733 spin_unlock_bh(&cmd->istate_lock); in iscsit_handle_immediate_data()
2743 struct iscsit_cmd *cmd; in iscsit_build_conn_drop_async_message() local
2764 cmd = iscsit_allocate_cmd(conn_p, TASK_RUNNING); in iscsit_build_conn_drop_async_message()
2765 if (!cmd) { in iscsit_build_conn_drop_async_message()
2770 cmd->logout_cid = conn->cid; in iscsit_build_conn_drop_async_message()
2771 cmd->iscsi_opcode = ISCSI_OP_ASYNC_EVENT; in iscsit_build_conn_drop_async_message()
2772 cmd->i_state = ISTATE_SEND_ASYNCMSG; in iscsit_build_conn_drop_async_message()
2775 list_add_tail(&cmd->i_conn_node, &conn_p->conn_cmd_list); in iscsit_build_conn_drop_async_message()
2778 iscsit_add_cmd_to_response_queue(cmd, conn_p, cmd->i_state); in iscsit_build_conn_drop_async_message()
2783 struct iscsit_cmd *cmd, in iscsit_send_conn_drop_async_message() argument
2788 cmd->iscsi_opcode = ISCSI_OP_ASYNC_EVENT; in iscsit_send_conn_drop_async_message()
2790 hdr = (struct iscsi_async *) cmd->pdu; in iscsit_send_conn_drop_async_message()
2793 cmd->init_task_tag = RESERVED_ITT; in iscsit_send_conn_drop_async_message()
2794 cmd->targ_xfer_tag = 0xFFFFFFFF; in iscsit_send_conn_drop_async_message()
2796 cmd->stat_sn = conn->stat_sn++; in iscsit_send_conn_drop_async_message()
2797 hdr->statsn = cpu_to_be32(cmd->stat_sn); in iscsit_send_conn_drop_async_message()
2801 hdr->param1 = cpu_to_be16(cmd->logout_cid); in iscsit_send_conn_drop_async_message()
2806 " 0x%08x, for CID: %hu on CID: %hu\n", cmd->stat_sn, in iscsit_send_conn_drop_async_message()
2807 cmd->logout_cid, conn->cid); in iscsit_send_conn_drop_async_message()
2809 return conn->conn_transport->iscsit_xmit_pdu(conn, cmd, NULL, NULL, 0); in iscsit_send_conn_drop_async_message()
2823 iscsit_build_datain_pdu(struct iscsit_cmd *cmd, struct iscsit_conn *conn, in iscsit_build_datain_pdu() argument
2830 if (cmd->se_cmd.se_cmd_flags & SCF_OVERFLOW_BIT) { in iscsit_build_datain_pdu()
2832 hdr->residual_count = cpu_to_be32(cmd->se_cmd.residual_count); in iscsit_build_datain_pdu()
2833 } else if (cmd->se_cmd.se_cmd_flags & SCF_UNDERFLOW_BIT) { in iscsit_build_datain_pdu()
2835 hdr->residual_count = cpu_to_be32(cmd->se_cmd.residual_count); in iscsit_build_datain_pdu()
2840 int_to_scsilun(cmd->se_cmd.orig_fe_lun, in iscsit_build_datain_pdu()
2845 hdr->itt = cmd->init_task_tag; in iscsit_build_datain_pdu()
2848 hdr->ttt = cpu_to_be32(cmd->targ_xfer_tag); in iscsit_build_datain_pdu()
2852 hdr->statsn = cpu_to_be32(cmd->stat_sn); in iscsit_build_datain_pdu()
2863 cmd->init_task_tag, ntohl(hdr->statsn), ntohl(hdr->datasn), in iscsit_build_datain_pdu()
2868 static int iscsit_send_datain(struct iscsit_cmd *cmd, struct iscsit_conn *conn) in iscsit_send_datain() argument
2870 struct iscsi_data_rsp *hdr = (struct iscsi_data_rsp *)&cmd->pdu[0]; in iscsit_send_datain()
2877 dr = iscsit_get_datain_values(cmd, &datain); in iscsit_send_datain()
2880 cmd->init_task_tag); in iscsit_send_datain()
2886 if ((datain.offset + datain.length) > cmd->se_cmd.data_length) { in iscsit_send_datain()
2889 cmd->init_task_tag, datain.offset, datain.length, in iscsit_send_datain()
2890 cmd->se_cmd.data_length); in iscsit_send_datain()
2900 (cmd->se_cmd.se_cmd_flags & SCF_TRANSPORT_TASK_SENSE)) in iscsit_send_datain()
2905 iscsit_increment_maxcmdsn(cmd, conn->sess); in iscsit_send_datain()
2906 cmd->stat_sn = conn->stat_sn++; in iscsit_send_datain()
2913 iscsit_build_datain_pdu(cmd, conn, &datain, hdr, set_statsn); in iscsit_send_datain()
2915 ret = conn->conn_transport->iscsit_xmit_pdu(conn, cmd, dr, &datain, 0); in iscsit_send_datain()
2920 eodr = (cmd->se_cmd.se_cmd_flags & SCF_TRANSPORT_TASK_SENSE) ? in iscsit_send_datain()
2922 iscsit_free_datain_req(cmd, dr); in iscsit_send_datain()
2929 iscsit_build_logout_rsp(struct iscsit_cmd *cmd, struct iscsit_conn *conn, in iscsit_build_logout_rsp() argument
2940 switch (cmd->logout_reason) { in iscsit_build_logout_rsp()
2944 cmd->logout_response = ISCSI_LOGOUT_SUCCESS; in iscsit_build_logout_rsp()
2947 if (cmd->logout_response == ISCSI_LOGOUT_CID_NOT_FOUND) in iscsit_build_logout_rsp()
2962 " successful.\n", cmd->logout_cid, conn->cid); in iscsit_build_logout_rsp()
2963 cmd->logout_response = ISCSI_LOGOUT_SUCCESS; in iscsit_build_logout_rsp()
2966 if ((cmd->logout_response == ISCSI_LOGOUT_RECOVERY_UNSUPPORTED) || in iscsit_build_logout_rsp()
2967 (cmd->logout_response == ISCSI_LOGOUT_CLEANUP_FAILED)) in iscsit_build_logout_rsp()
2974 cmd->logout_cid); in iscsit_build_logout_rsp()
2981 conn->sess, cmd->logout_cid); in iscsit_build_logout_rsp()
2985 cmd->logout_cid); in iscsit_build_logout_rsp()
2986 cmd->logout_response = ISCSI_LOGOUT_CID_NOT_FOUND; in iscsit_build_logout_rsp()
2990 iscsit_discard_cr_cmds_by_expstatsn(cr, cmd->exp_stat_sn); in iscsit_build_logout_rsp()
2994 cmd->logout_cid, conn->cid); in iscsit_build_logout_rsp()
2995 cmd->logout_response = ISCSI_LOGOUT_SUCCESS; in iscsit_build_logout_rsp()
2999 cmd->logout_reason); in iscsit_build_logout_rsp()
3005 hdr->response = cmd->logout_response; in iscsit_build_logout_rsp()
3006 hdr->itt = cmd->init_task_tag; in iscsit_build_logout_rsp()
3007 cmd->stat_sn = conn->stat_sn++; in iscsit_build_logout_rsp()
3008 hdr->statsn = cpu_to_be32(cmd->stat_sn); in iscsit_build_logout_rsp()
3010 iscsit_increment_maxcmdsn(cmd, conn->sess); in iscsit_build_logout_rsp()
3016 cmd->init_task_tag, cmd->stat_sn, hdr->response, in iscsit_build_logout_rsp()
3017 cmd->logout_cid, conn->cid); in iscsit_build_logout_rsp()
3024 iscsit_send_logout(struct iscsit_cmd *cmd, struct iscsit_conn *conn) in iscsit_send_logout() argument
3028 rc = iscsit_build_logout_rsp(cmd, conn, in iscsit_send_logout()
3029 (struct iscsi_logout_rsp *)&cmd->pdu[0]); in iscsit_send_logout()
3033 return conn->conn_transport->iscsit_xmit_pdu(conn, cmd, NULL, NULL, 0); in iscsit_send_logout()
3037 iscsit_build_nopin_rsp(struct iscsit_cmd *cmd, struct iscsit_conn *conn, in iscsit_build_nopin_rsp() argument
3042 hton24(hdr->dlength, cmd->buf_ptr_size); in iscsit_build_nopin_rsp()
3045 hdr->itt = cmd->init_task_tag; in iscsit_build_nopin_rsp()
3046 hdr->ttt = cpu_to_be32(cmd->targ_xfer_tag); in iscsit_build_nopin_rsp()
3047 cmd->stat_sn = (nopout_response) ? conn->stat_sn++ : in iscsit_build_nopin_rsp()
3049 hdr->statsn = cpu_to_be32(cmd->stat_sn); in iscsit_build_nopin_rsp()
3052 iscsit_increment_maxcmdsn(cmd, conn->sess); in iscsit_build_nopin_rsp()
3059 "Solicited" : "Unsolicited", cmd->init_task_tag, in iscsit_build_nopin_rsp()
3060 cmd->targ_xfer_tag, cmd->stat_sn, cmd->buf_ptr_size); in iscsit_build_nopin_rsp()
3068 struct iscsit_cmd *cmd, in iscsit_send_unsolicited_nopin() argument
3072 struct iscsi_nopin *hdr = (struct iscsi_nopin *)&cmd->pdu[0]; in iscsit_send_unsolicited_nopin()
3075 iscsit_build_nopin_rsp(cmd, conn, hdr, false); in iscsit_send_unsolicited_nopin()
3078 " 0x%08x CID: %hu\n", hdr->ttt, cmd->stat_sn, conn->cid); in iscsit_send_unsolicited_nopin()
3080 ret = conn->conn_transport->iscsit_xmit_pdu(conn, cmd, NULL, NULL, 0); in iscsit_send_unsolicited_nopin()
3084 spin_lock_bh(&cmd->istate_lock); in iscsit_send_unsolicited_nopin()
3085 cmd->i_state = want_response ? in iscsit_send_unsolicited_nopin()
3087 spin_unlock_bh(&cmd->istate_lock); in iscsit_send_unsolicited_nopin()
3093 iscsit_send_nopin(struct iscsit_cmd *cmd, struct iscsit_conn *conn) in iscsit_send_nopin() argument
3095 struct iscsi_nopin *hdr = (struct iscsi_nopin *)&cmd->pdu[0]; in iscsit_send_nopin()
3097 iscsit_build_nopin_rsp(cmd, conn, hdr, true); in iscsit_send_nopin()
3103 pr_debug("Echoing back %u bytes of ping data.\n", cmd->buf_ptr_size); in iscsit_send_nopin()
3105 return conn->conn_transport->iscsit_xmit_pdu(conn, cmd, NULL, in iscsit_send_nopin()
3106 cmd->buf_ptr, in iscsit_send_nopin()
3107 cmd->buf_ptr_size); in iscsit_send_nopin()
3111 struct iscsit_cmd *cmd, in iscsit_send_r2t() argument
3118 r2t = iscsit_get_r2t_from_list(cmd); in iscsit_send_r2t()
3122 hdr = (struct iscsi_r2t_rsp *) cmd->pdu; in iscsit_send_r2t()
3126 int_to_scsilun(cmd->se_cmd.orig_fe_lun, in iscsit_send_r2t()
3128 hdr->itt = cmd->init_task_tag; in iscsit_send_r2t()
3130 conn->conn_transport->iscsit_get_r2t_ttt(conn, cmd, r2t); in iscsit_send_r2t()
3143 (!r2t->recovery_r2t) ? "" : "Recovery ", cmd->init_task_tag, in iscsit_send_r2t()
3147 spin_lock_bh(&cmd->r2t_lock); in iscsit_send_r2t()
3149 spin_unlock_bh(&cmd->r2t_lock); in iscsit_send_r2t()
3151 ret = conn->conn_transport->iscsit_xmit_pdu(conn, cmd, NULL, NULL, 0); in iscsit_send_r2t()
3156 spin_lock_bh(&cmd->dataout_timeout_lock); in iscsit_send_r2t()
3157 iscsit_start_dataout_timer(cmd, conn); in iscsit_send_r2t()
3158 spin_unlock_bh(&cmd->dataout_timeout_lock); in iscsit_send_r2t()
3169 struct iscsit_cmd *cmd, in iscsit_build_r2ts_for_cmd() argument
3175 spin_lock_bh(&cmd->r2t_lock); in iscsit_build_r2ts_for_cmd()
3176 if (cmd->cmd_flags & ICF_SENT_LAST_R2T) { in iscsit_build_r2ts_for_cmd()
3177 spin_unlock_bh(&cmd->r2t_lock); in iscsit_build_r2ts_for_cmd()
3183 cmd->r2t_offset = max(cmd->r2t_offset, cmd->write_data_done); in iscsit_build_r2ts_for_cmd()
3185 while (cmd->outstanding_r2ts < conn->sess->sess_ops->MaxOutstandingR2T) { in iscsit_build_r2ts_for_cmd()
3187 offset = cmd->r2t_offset; in iscsit_build_r2ts_for_cmd()
3192 cmd->next_burst_len; in iscsit_build_r2ts_for_cmd()
3194 if (new_data_end > cmd->se_cmd.data_length) in iscsit_build_r2ts_for_cmd()
3195 xfer_len = cmd->se_cmd.data_length - offset; in iscsit_build_r2ts_for_cmd()
3199 cmd->next_burst_len; in iscsit_build_r2ts_for_cmd()
3204 if (new_data_end > cmd->se_cmd.data_length) in iscsit_build_r2ts_for_cmd()
3205 xfer_len = cmd->se_cmd.data_length - offset; in iscsit_build_r2ts_for_cmd()
3211 cmd->cmd_flags |= ICF_SENT_LAST_R2T; in iscsit_build_r2ts_for_cmd()
3215 cmd->r2t_offset += xfer_len; in iscsit_build_r2ts_for_cmd()
3217 if (cmd->r2t_offset == cmd->se_cmd.data_length) in iscsit_build_r2ts_for_cmd()
3218 cmd->cmd_flags |= ICF_SENT_LAST_R2T; in iscsit_build_r2ts_for_cmd()
3222 seq = iscsit_get_seq_holder_for_r2t(cmd); in iscsit_build_r2ts_for_cmd()
3224 spin_unlock_bh(&cmd->r2t_lock); in iscsit_build_r2ts_for_cmd()
3231 if (cmd->seq_send_order == cmd->seq_count) in iscsit_build_r2ts_for_cmd()
3232 cmd->cmd_flags |= ICF_SENT_LAST_R2T; in iscsit_build_r2ts_for_cmd()
3234 cmd->outstanding_r2ts++; in iscsit_build_r2ts_for_cmd()
3237 if (iscsit_add_r2t_to_list(cmd, offset, xfer_len, 0, 0) < 0) { in iscsit_build_r2ts_for_cmd()
3238 spin_unlock_bh(&cmd->r2t_lock); in iscsit_build_r2ts_for_cmd()
3242 if (cmd->cmd_flags & ICF_SENT_LAST_R2T) in iscsit_build_r2ts_for_cmd()
3245 spin_unlock_bh(&cmd->r2t_lock); in iscsit_build_r2ts_for_cmd()
3251 void iscsit_build_rsp_pdu(struct iscsit_cmd *cmd, struct iscsit_conn *conn, in iscsit_build_rsp_pdu() argument
3255 cmd->stat_sn = conn->stat_sn++; in iscsit_build_rsp_pdu()
3262 if (cmd->se_cmd.se_cmd_flags & SCF_OVERFLOW_BIT) { in iscsit_build_rsp_pdu()
3264 hdr->residual_count = cpu_to_be32(cmd->se_cmd.residual_count); in iscsit_build_rsp_pdu()
3265 } else if (cmd->se_cmd.se_cmd_flags & SCF_UNDERFLOW_BIT) { in iscsit_build_rsp_pdu()
3267 hdr->residual_count = cpu_to_be32(cmd->se_cmd.residual_count); in iscsit_build_rsp_pdu()
3269 hdr->response = cmd->iscsi_response; in iscsit_build_rsp_pdu()
3270 hdr->cmd_status = cmd->se_cmd.scsi_status; in iscsit_build_rsp_pdu()
3271 hdr->itt = cmd->init_task_tag; in iscsit_build_rsp_pdu()
3272 hdr->statsn = cpu_to_be32(cmd->stat_sn); in iscsit_build_rsp_pdu()
3274 iscsit_increment_maxcmdsn(cmd, conn->sess); in iscsit_build_rsp_pdu()
3280 cmd->init_task_tag, cmd->stat_sn, cmd->se_cmd.scsi_status, in iscsit_build_rsp_pdu()
3281 cmd->se_cmd.scsi_status, conn->cid); in iscsit_build_rsp_pdu()
3285 static int iscsit_send_response(struct iscsit_cmd *cmd, struct iscsit_conn *conn) in iscsit_send_response() argument
3287 struct iscsi_scsi_rsp *hdr = (struct iscsi_scsi_rsp *)&cmd->pdu[0]; in iscsit_send_response()
3288 bool inc_stat_sn = (cmd->i_state == ISTATE_SEND_STATUS); in iscsit_send_response()
3292 iscsit_build_rsp_pdu(cmd, conn, inc_stat_sn, hdr); in iscsit_send_response()
3297 if (cmd->se_cmd.sense_buffer && in iscsit_send_response()
3298 ((cmd->se_cmd.se_cmd_flags & SCF_TRANSPORT_TASK_SENSE) || in iscsit_send_response()
3299 (cmd->se_cmd.se_cmd_flags & SCF_EMULATED_TASK_SENSE))) { in iscsit_send_response()
3300 put_unaligned_be16(cmd->se_cmd.scsi_sense_length, cmd->sense_buffer); in iscsit_send_response()
3301 cmd->se_cmd.scsi_sense_length += sizeof (__be16); in iscsit_send_response()
3303 padding = -(cmd->se_cmd.scsi_sense_length) & 3; in iscsit_send_response()
3304 hton24(hdr->dlength, (u32)cmd->se_cmd.scsi_sense_length); in iscsit_send_response()
3305 data_buf = cmd->sense_buffer; in iscsit_send_response()
3306 data_buf_len = cmd->se_cmd.scsi_sense_length + padding; in iscsit_send_response()
3309 memset(cmd->sense_buffer + in iscsit_send_response()
3310 cmd->se_cmd.scsi_sense_length, 0, padding); in iscsit_send_response()
3317 cmd->se_cmd.scsi_sense_length); in iscsit_send_response()
3320 return conn->conn_transport->iscsit_xmit_pdu(conn, cmd, NULL, data_buf, in iscsit_send_response()
3342 iscsit_build_task_mgt_rsp(struct iscsit_cmd *cmd, struct iscsit_conn *conn, in iscsit_build_task_mgt_rsp() argument
3345 struct se_tmr_req *se_tmr = cmd->se_cmd.se_tmr_req; in iscsit_build_task_mgt_rsp()
3350 hdr->itt = cmd->init_task_tag; in iscsit_build_task_mgt_rsp()
3351 cmd->stat_sn = conn->stat_sn++; in iscsit_build_task_mgt_rsp()
3352 hdr->statsn = cpu_to_be32(cmd->stat_sn); in iscsit_build_task_mgt_rsp()
3354 iscsit_increment_maxcmdsn(cmd, conn->sess); in iscsit_build_task_mgt_rsp()
3360 cmd->init_task_tag, cmd->stat_sn, hdr->response, conn->cid); in iscsit_build_task_mgt_rsp()
3365 iscsit_send_task_mgt_rsp(struct iscsit_cmd *cmd, struct iscsit_conn *conn) in iscsit_send_task_mgt_rsp() argument
3367 struct iscsi_tm_rsp *hdr = (struct iscsi_tm_rsp *)&cmd->pdu[0]; in iscsit_send_task_mgt_rsp()
3369 iscsit_build_task_mgt_rsp(cmd, conn, hdr); in iscsit_send_task_mgt_rsp()
3371 return conn->conn_transport->iscsit_xmit_pdu(conn, cmd, NULL, NULL, 0); in iscsit_send_task_mgt_rsp()
3377 iscsit_build_sendtargets_response(struct iscsit_cmd *cmd, in iscsit_build_sendtargets_response() argument
3382 struct iscsit_conn *conn = cmd->conn; in iscsit_build_sendtargets_response()
3389 unsigned char *text_in = cmd->text_in_ptr, *text_ptr = NULL; in iscsit_build_sendtargets_response()
3403 if (cmd->cmd_flags & ICF_SENDTARGETS_SINGLE) { in iscsit_build_sendtargets_response()
3419 if ((cmd->cmd_flags & ICF_SENDTARGETS_SINGLE) && in iscsit_build_sendtargets_response()
3437 cmd->conn->sess->sess_ops->InitiatorName))) { in iscsit_build_sendtargets_response()
3516 if (cmd->cmd_flags & ICF_SENDTARGETS_SINGLE) in iscsit_build_sendtargets_response()
3521 cmd->buf_ptr = payload; in iscsit_build_sendtargets_response()
3527 iscsit_build_text_rsp(struct iscsit_cmd *cmd, struct iscsit_conn *conn, in iscsit_build_text_rsp() argument
3534 text_length = iscsit_build_sendtargets_response(cmd, network_transport, in iscsit_build_text_rsp()
3535 cmd->read_data_done, in iscsit_build_text_rsp()
3544 cmd->read_data_done += text_length; in iscsit_build_text_rsp()
3545 if (cmd->targ_xfer_tag == 0xFFFFFFFF) in iscsit_build_text_rsp()
3546 cmd->targ_xfer_tag = session_get_next_ttt(conn->sess); in iscsit_build_text_rsp()
3551 hdr->itt = cmd->init_task_tag; in iscsit_build_text_rsp()
3552 hdr->ttt = cpu_to_be32(cmd->targ_xfer_tag); in iscsit_build_text_rsp()
3553 cmd->stat_sn = conn->stat_sn++; in iscsit_build_text_rsp()
3554 hdr->statsn = cpu_to_be32(cmd->stat_sn); in iscsit_build_text_rsp()
3556 iscsit_increment_maxcmdsn(cmd, conn->sess); in iscsit_build_text_rsp()
3562 cmd->maxcmdsn_inc = 0; in iscsit_build_text_rsp()
3567 " Length: %u, CID: %hu F: %d C: %d\n", cmd->init_task_tag, in iscsit_build_text_rsp()
3568 cmd->targ_xfer_tag, cmd->stat_sn, text_length, conn->cid, in iscsit_build_text_rsp()
3577 struct iscsit_cmd *cmd, in iscsit_send_text_rsp() argument
3580 struct iscsi_text_rsp *hdr = (struct iscsi_text_rsp *)cmd->pdu; in iscsit_send_text_rsp()
3583 text_length = iscsit_build_text_rsp(cmd, conn, hdr, in iscsit_send_text_rsp()
3588 return conn->conn_transport->iscsit_xmit_pdu(conn, cmd, NULL, in iscsit_send_text_rsp()
3589 cmd->buf_ptr, in iscsit_send_text_rsp()
3594 iscsit_build_reject(struct iscsit_cmd *cmd, struct iscsit_conn *conn, in iscsit_build_reject() argument
3598 hdr->reason = cmd->reject_reason; in iscsit_build_reject()
3602 cmd->stat_sn = conn->stat_sn++; in iscsit_build_reject()
3603 hdr->statsn = cpu_to_be32(cmd->stat_sn); in iscsit_build_reject()
3611 struct iscsit_cmd *cmd, in iscsit_send_reject() argument
3614 struct iscsi_reject *hdr = (struct iscsi_reject *)&cmd->pdu[0]; in iscsit_send_reject()
3616 iscsit_build_reject(cmd, conn, hdr); in iscsit_send_reject()
3621 return conn->conn_transport->iscsit_xmit_pdu(conn, cmd, NULL, in iscsit_send_reject()
3622 cmd->buf_ptr, in iscsit_send_reject()
3726 iscsit_immediate_queue(struct iscsit_conn *conn, struct iscsit_cmd *cmd, int state) in iscsit_immediate_queue() argument
3732 ret = iscsit_send_r2t(cmd, conn); in iscsit_immediate_queue()
3738 list_del_init(&cmd->i_conn_node); in iscsit_immediate_queue()
3741 iscsit_free_cmd(cmd, false); in iscsit_immediate_queue()
3745 ret = iscsit_send_unsolicited_nopin(cmd, conn, 1); in iscsit_immediate_queue()
3750 ret = iscsit_send_unsolicited_nopin(cmd, conn, 0); in iscsit_immediate_queue()
3757 cmd->iscsi_opcode, cmd->init_task_tag, state, in iscsit_immediate_queue()
3774 struct iscsit_cmd *cmd; in iscsit_handle_immediate_queue() local
3780 cmd = qr->cmd; in iscsit_handle_immediate_queue()
3784 ret = t->iscsit_immediate_queue(conn, cmd, state); in iscsit_handle_immediate_queue()
3793 iscsit_response_queue(struct iscsit_conn *conn, struct iscsit_cmd *cmd, int state) in iscsit_response_queue() argument
3800 ret = iscsit_send_datain(cmd, conn); in iscsit_response_queue()
3808 spin_lock_bh(&cmd->istate_lock); in iscsit_response_queue()
3809 cmd->i_state = ISTATE_SENT_STATUS; in iscsit_response_queue()
3810 spin_unlock_bh(&cmd->istate_lock); in iscsit_response_queue()
3819 spin_lock_bh(&cmd->istate_lock); in iscsit_response_queue()
3820 cmd->i_state = ISTATE_SEND_STATUS; in iscsit_response_queue()
3821 spin_unlock_bh(&cmd->istate_lock); in iscsit_response_queue()
3829 ret = iscsit_send_response(cmd, conn); in iscsit_response_queue()
3832 ret = iscsit_send_logout(cmd, conn); in iscsit_response_queue()
3836 cmd, conn); in iscsit_response_queue()
3839 ret = iscsit_send_nopin(cmd, conn); in iscsit_response_queue()
3842 ret = iscsit_send_reject(cmd, conn); in iscsit_response_queue()
3845 ret = iscsit_send_task_mgt_rsp(cmd, conn); in iscsit_response_queue()
3848 ret = iscsit_tmr_post_handler(cmd, conn); in iscsit_response_queue()
3853 ret = iscsit_send_text_rsp(cmd, conn); in iscsit_response_queue()
3858 cmd->iscsi_opcode, cmd->init_task_tag, in iscsit_response_queue()
3867 if (!iscsit_logout_post_handler(cmd, conn)) in iscsit_response_queue()
3877 spin_lock_bh(&cmd->istate_lock); in iscsit_response_queue()
3878 cmd->i_state = ISTATE_SENT_STATUS; in iscsit_response_queue()
3879 spin_unlock_bh(&cmd->istate_lock); in iscsit_response_queue()
3884 cmd->iscsi_opcode, cmd->init_task_tag, in iscsit_response_queue()
3885 cmd->i_state, conn->cid); in iscsit_response_queue()
3903 struct iscsit_cmd *cmd; in iscsit_handle_response_queue() local
3908 cmd = qr->cmd; in iscsit_handle_response_queue()
3912 ret = t->iscsit_response_queue(conn, cmd, state); in iscsit_handle_response_queue()
3981 struct iscsit_cmd *cmd; in iscsi_target_rx_opcode() local
3986 cmd = iscsit_allocate_cmd(conn, TASK_INTERRUPTIBLE); in iscsi_target_rx_opcode()
3987 if (!cmd) in iscsi_target_rx_opcode()
3990 ret = iscsit_handle_scsi_cmd(conn, cmd, buf); in iscsi_target_rx_opcode()
3996 cmd = NULL; in iscsi_target_rx_opcode()
3998 cmd = iscsit_allocate_cmd(conn, TASK_INTERRUPTIBLE); in iscsi_target_rx_opcode()
3999 if (!cmd) in iscsi_target_rx_opcode()
4002 ret = iscsit_handle_nop_out(conn, cmd, buf); in iscsi_target_rx_opcode()
4005 cmd = iscsit_allocate_cmd(conn, TASK_INTERRUPTIBLE); in iscsi_target_rx_opcode()
4006 if (!cmd) in iscsi_target_rx_opcode()
4009 ret = iscsit_handle_task_mgt_cmd(conn, cmd, buf); in iscsi_target_rx_opcode()
4013 cmd = iscsit_find_cmd_from_itt(conn, hdr->itt); in iscsi_target_rx_opcode()
4014 if (!cmd) in iscsi_target_rx_opcode()
4017 cmd = iscsit_allocate_cmd(conn, TASK_INTERRUPTIBLE); in iscsi_target_rx_opcode()
4018 if (!cmd) in iscsi_target_rx_opcode()
4022 ret = iscsit_handle_text_cmd(conn, cmd, buf); in iscsi_target_rx_opcode()
4025 cmd = iscsit_allocate_cmd(conn, TASK_INTERRUPTIBLE); in iscsi_target_rx_opcode()
4026 if (!cmd) in iscsi_target_rx_opcode()
4029 ret = iscsit_handle_logout_cmd(conn, cmd, buf); in iscsi_target_rx_opcode()
4209 struct iscsit_cmd *cmd = NULL, *cmd_tmp = NULL; in iscsit_release_commands_from_conn() local
4219 list_for_each_entry_safe(cmd, cmd_tmp, &tmp_list, i_conn_node) { in iscsit_release_commands_from_conn()
4220 struct se_cmd *se_cmd = &cmd->se_cmd; in iscsit_release_commands_from_conn()
4233 list_move_tail(&cmd->i_conn_node, in iscsit_release_commands_from_conn()
4239 if (cmd->se_cmd.t_state == TRANSPORT_WRITE_PENDING) { in iscsit_release_commands_from_conn()
4245 target_complete_cmd(&cmd->se_cmd, SAM_STAT_TASK_ABORTED); in iscsit_release_commands_from_conn()
4252 list_for_each_entry_safe(cmd, cmd_tmp, &tmp_list, i_conn_node) { in iscsit_release_commands_from_conn()
4253 list_del_init(&cmd->i_conn_node); in iscsit_release_commands_from_conn()
4255 iscsit_increment_maxcmdsn(cmd, sess); in iscsit_release_commands_from_conn()
4256 iscsit_free_cmd(cmd, true); in iscsit_release_commands_from_conn()
4274 struct iscsit_cmd *cmd; in iscsit_stop_timers_for_cmds() local
4277 list_for_each_entry(cmd, &conn->conn_cmd_list, i_conn_node) { in iscsit_stop_timers_for_cmds()
4278 if (cmd->data_direction == DMA_TO_DEVICE) in iscsit_stop_timers_for_cmds()
4279 iscsit_stop_dataout_timer(cmd); in iscsit_stop_timers_for_cmds()
4679 struct iscsit_cmd *cmd, in iscsit_logout_post_handler() argument
4684 switch (cmd->logout_reason) { in iscsit_logout_post_handler()
4686 switch (cmd->logout_response) { in iscsit_logout_post_handler()
4695 if (conn->cid == cmd->logout_cid) { in iscsit_logout_post_handler()
4696 switch (cmd->logout_response) { in iscsit_logout_post_handler()
4704 switch (cmd->logout_response) { in iscsit_logout_post_handler()
4707 cmd->logout_cid); in iscsit_logout_post_handler()
4718 switch (cmd->logout_response) { in iscsit_logout_post_handler()