tcmu_cmd          476 drivers/target/target_core_user.c static void tcmu_cmd_free_data(struct tcmu_cmd *tcmu_cmd, uint32_t len)
tcmu_cmd          478 drivers/target/target_core_user.c 	struct tcmu_dev *udev = tcmu_cmd->tcmu_dev;
tcmu_cmd          482 drivers/target/target_core_user.c 		clear_bit(tcmu_cmd->dbi[i], udev->data_bitmap);
tcmu_cmd          486 drivers/target/target_core_user.c 					struct tcmu_cmd *tcmu_cmd)
tcmu_cmd          515 drivers/target/target_core_user.c 	tcmu_cmd_set_dbi(tcmu_cmd, dbi);
tcmu_cmd          526 drivers/target/target_core_user.c 				  struct tcmu_cmd *tcmu_cmd)
tcmu_cmd          530 drivers/target/target_core_user.c 	for (i = tcmu_cmd->dbi_cur; i < tcmu_cmd->dbi_cnt; i++) {
tcmu_cmd          531 drivers/target/target_core_user.c 		if (!tcmu_get_empty_block(udev, tcmu_cmd))
tcmu_cmd          543 drivers/target/target_core_user.c static inline void tcmu_free_cmd(struct tcmu_cmd *tcmu_cmd)
tcmu_cmd          545 drivers/target/target_core_user.c 	kfree(tcmu_cmd->dbi);
tcmu_cmd          546 drivers/target/target_core_user.c 	kmem_cache_free(tcmu_cmd_cache, tcmu_cmd);
tcmu_cmd          549 drivers/target/target_core_user.c static inline size_t tcmu_cmd_get_data_length(struct tcmu_cmd *tcmu_cmd)
tcmu_cmd          551 drivers/target/target_core_user.c 	struct se_cmd *se_cmd = tcmu_cmd->se_cmd;
tcmu_cmd          563 drivers/target/target_core_user.c static inline uint32_t tcmu_cmd_get_block_cnt(struct tcmu_cmd *tcmu_cmd)
tcmu_cmd          565 drivers/target/target_core_user.c 	size_t data_length = tcmu_cmd_get_data_length(tcmu_cmd);
tcmu_cmd          570 drivers/target/target_core_user.c static struct tcmu_cmd *tcmu_alloc_cmd(struct se_cmd *se_cmd)
tcmu_cmd          574 drivers/target/target_core_user.c 	struct tcmu_cmd *tcmu_cmd;
tcmu_cmd          576 drivers/target/target_core_user.c 	tcmu_cmd = kmem_cache_zalloc(tcmu_cmd_cache, GFP_KERNEL);
tcmu_cmd          577 drivers/target/target_core_user.c 	if (!tcmu_cmd)
tcmu_cmd          580 drivers/target/target_core_user.c 	INIT_LIST_HEAD(&tcmu_cmd->queue_entry);
tcmu_cmd          581 drivers/target/target_core_user.c 	tcmu_cmd->se_cmd = se_cmd;
tcmu_cmd          582 drivers/target/target_core_user.c 	tcmu_cmd->tcmu_dev = udev;
tcmu_cmd          584 drivers/target/target_core_user.c 	tcmu_cmd_reset_dbi_cur(tcmu_cmd);
tcmu_cmd          585 drivers/target/target_core_user.c 	tcmu_cmd->dbi_cnt = tcmu_cmd_get_block_cnt(tcmu_cmd);
tcmu_cmd          586 drivers/target/target_core_user.c 	tcmu_cmd->dbi = kcalloc(tcmu_cmd->dbi_cnt, sizeof(uint32_t),
tcmu_cmd          588 drivers/target/target_core_user.c 	if (!tcmu_cmd->dbi) {
tcmu_cmd          589 drivers/target/target_core_user.c 		kmem_cache_free(tcmu_cmd_cache, tcmu_cmd);
tcmu_cmd          593 drivers/target/target_core_user.c 	return tcmu_cmd;
tcmu_cmd          663 drivers/target/target_core_user.c 	struct tcmu_cmd *tcmu_cmd, struct scatterlist *data_sg,
tcmu_cmd          683 drivers/target/target_core_user.c 				dbi = tcmu_cmd_get_dbi(tcmu_cmd);
tcmu_cmd          738 drivers/target/target_core_user.c static void gather_data_area(struct tcmu_dev *udev, struct tcmu_cmd *cmd,
tcmu_cmd          814 drivers/target/target_core_user.c static bool is_ring_space_avail(struct tcmu_dev *udev, struct tcmu_cmd *cmd,
tcmu_cmd          870 drivers/target/target_core_user.c static inline size_t tcmu_cmd_get_cmd_size(struct tcmu_cmd *tcmu_cmd,
tcmu_cmd          873 drivers/target/target_core_user.c 	struct se_cmd *se_cmd = tcmu_cmd->se_cmd;
tcmu_cmd          885 drivers/target/target_core_user.c static int tcmu_setup_cmd_timer(struct tcmu_cmd *tcmu_cmd, unsigned int tmo,
tcmu_cmd          888 drivers/target/target_core_user.c 	struct tcmu_dev *udev = tcmu_cmd->tcmu_dev;
tcmu_cmd          891 drivers/target/target_core_user.c 	if (tcmu_cmd->cmd_id)
tcmu_cmd          894 drivers/target/target_core_user.c 	cmd_id = idr_alloc(&udev->commands, tcmu_cmd, 1, USHRT_MAX, GFP_NOWAIT);
tcmu_cmd          899 drivers/target/target_core_user.c 	tcmu_cmd->cmd_id = cmd_id;
tcmu_cmd          901 drivers/target/target_core_user.c 	pr_debug("allocated cmd %u for dev %s tmo %lu\n", tcmu_cmd->cmd_id,
tcmu_cmd          908 drivers/target/target_core_user.c 	tcmu_cmd->deadline = round_jiffies_up(jiffies + msecs_to_jiffies(tmo));
tcmu_cmd          910 drivers/target/target_core_user.c 		mod_timer(timer, tcmu_cmd->deadline);
tcmu_cmd          915 drivers/target/target_core_user.c static int add_to_qfull_queue(struct tcmu_cmd *tcmu_cmd)
tcmu_cmd          917 drivers/target/target_core_user.c 	struct tcmu_dev *udev = tcmu_cmd->tcmu_dev;
tcmu_cmd          934 drivers/target/target_core_user.c 	ret = tcmu_setup_cmd_timer(tcmu_cmd, tmo, &udev->qfull_timer);
tcmu_cmd          938 drivers/target/target_core_user.c 	list_add_tail(&tcmu_cmd->queue_entry, &udev->qfull_queue);
tcmu_cmd          940 drivers/target/target_core_user.c 		 tcmu_cmd->cmd_id, udev->name);
tcmu_cmd          954 drivers/target/target_core_user.c static int queue_cmd_ring(struct tcmu_cmd *tcmu_cmd, sense_reason_t *scsi_err)
tcmu_cmd          956 drivers/target/target_core_user.c 	struct tcmu_dev *udev = tcmu_cmd->tcmu_dev;
tcmu_cmd          957 drivers/target/target_core_user.c 	struct se_cmd *se_cmd = tcmu_cmd->se_cmd;
tcmu_cmd          966 drivers/target/target_core_user.c 	size_t data_length = tcmu_cmd_get_data_length(tcmu_cmd);
tcmu_cmd          992 drivers/target/target_core_user.c 	base_command_size = tcmu_cmd_get_base_cmd_size(tcmu_cmd->dbi_cnt);
tcmu_cmd          993 drivers/target/target_core_user.c 	command_size = tcmu_cmd_get_cmd_size(tcmu_cmd, base_command_size);
tcmu_cmd         1009 drivers/target/target_core_user.c 	if (!is_ring_space_avail(udev, tcmu_cmd, command_size, data_length)) {
tcmu_cmd         1014 drivers/target/target_core_user.c 		tcmu_cmd_free_data(tcmu_cmd, tcmu_cmd->dbi_cur);
tcmu_cmd         1015 drivers/target/target_core_user.c 		tcmu_cmd_reset_dbi_cur(tcmu_cmd);
tcmu_cmd         1043 drivers/target/target_core_user.c 	tcmu_cmd_reset_dbi_cur(tcmu_cmd);
tcmu_cmd         1048 drivers/target/target_core_user.c 	scatter_data_area(udev, tcmu_cmd, se_cmd->t_data_sg,
tcmu_cmd         1057 drivers/target/target_core_user.c 		scatter_data_area(udev, tcmu_cmd, se_cmd->t_bidi_data_sg,
tcmu_cmd         1063 drivers/target/target_core_user.c 	ret = tcmu_setup_cmd_timer(tcmu_cmd, udev->cmd_time_out,
tcmu_cmd         1066 drivers/target/target_core_user.c 		tcmu_cmd_free_data(tcmu_cmd, tcmu_cmd->dbi_cnt);
tcmu_cmd         1071 drivers/target/target_core_user.c 	entry->hdr.cmd_id = tcmu_cmd->cmd_id;
tcmu_cmd         1079 drivers/target/target_core_user.c 	command_size = tcmu_cmd_get_cmd_size(tcmu_cmd, base_command_size);
tcmu_cmd         1092 drivers/target/target_core_user.c 	list_add_tail(&tcmu_cmd->queue_entry, &udev->inflight_queue);
tcmu_cmd         1093 drivers/target/target_core_user.c 	set_bit(TCMU_CMD_BIT_INFLIGHT, &tcmu_cmd->flags);
tcmu_cmd         1101 drivers/target/target_core_user.c 	if (add_to_qfull_queue(tcmu_cmd)) {
tcmu_cmd         1114 drivers/target/target_core_user.c 	struct tcmu_cmd *tcmu_cmd;
tcmu_cmd         1118 drivers/target/target_core_user.c 	tcmu_cmd = tcmu_alloc_cmd(se_cmd);
tcmu_cmd         1119 drivers/target/target_core_user.c 	if (!tcmu_cmd)
tcmu_cmd         1123 drivers/target/target_core_user.c 	ret = queue_cmd_ring(tcmu_cmd, &scsi_ret);
tcmu_cmd         1126 drivers/target/target_core_user.c 		tcmu_free_cmd(tcmu_cmd);
tcmu_cmd         1130 drivers/target/target_core_user.c static void tcmu_handle_completion(struct tcmu_cmd *cmd, struct tcmu_cmd_entry *entry)
tcmu_cmd         1201 drivers/target/target_core_user.c 	struct tcmu_cmd *tcmu_cmd, *tmp_cmd;
tcmu_cmd         1204 drivers/target/target_core_user.c 	list_for_each_entry_safe(tcmu_cmd, tmp_cmd, queue, queue_entry) {
tcmu_cmd         1205 drivers/target/target_core_user.c 		if (!time_after(jiffies, tcmu_cmd->deadline)) {
tcmu_cmd         1206 drivers/target/target_core_user.c 			deadline = tcmu_cmd->deadline;
tcmu_cmd         1220 drivers/target/target_core_user.c 	struct tcmu_cmd *cmd;
tcmu_cmd         1284 drivers/target/target_core_user.c 	struct tcmu_cmd *cmd = p;
tcmu_cmd         1412 drivers/target/target_core_user.c 	struct tcmu_cmd *tcmu_cmd, *tmp_cmd;
tcmu_cmd         1425 drivers/target/target_core_user.c 	list_for_each_entry_safe(tcmu_cmd, tmp_cmd, &cmds, queue_entry) {
tcmu_cmd         1426 drivers/target/target_core_user.c 		list_del_init(&tcmu_cmd->queue_entry);
tcmu_cmd         1429 drivers/target/target_core_user.c 		         tcmu_cmd->cmd_id, udev->name);
tcmu_cmd         1432 drivers/target/target_core_user.c 			idr_remove(&udev->commands, tcmu_cmd->cmd_id);
tcmu_cmd         1440 drivers/target/target_core_user.c 			target_complete_cmd(tcmu_cmd->se_cmd, SAM_STAT_BUSY);
tcmu_cmd         1441 drivers/target/target_core_user.c 			tcmu_free_cmd(tcmu_cmd);
tcmu_cmd         1445 drivers/target/target_core_user.c 		ret = queue_cmd_ring(tcmu_cmd, &scsi_ret);
tcmu_cmd         1448 drivers/target/target_core_user.c 			         tcmu_cmd->cmd_id, udev->name, scsi_ret);
tcmu_cmd         1450 drivers/target/target_core_user.c 			idr_remove(&udev->commands, tcmu_cmd->cmd_id);
tcmu_cmd         1455 drivers/target/target_core_user.c 			target_complete_cmd(tcmu_cmd->se_cmd,
tcmu_cmd         1457 drivers/target/target_core_user.c 			tcmu_free_cmd(tcmu_cmd);
tcmu_cmd         1609 drivers/target/target_core_user.c static int tcmu_check_and_free_pending_cmd(struct tcmu_cmd *cmd)
tcmu_cmd         1637 drivers/target/target_core_user.c 	struct tcmu_cmd *cmd;
tcmu_cmd         2034 drivers/target/target_core_user.c 	struct tcmu_cmd *cmd;
tcmu_cmd         2739 drivers/target/target_core_user.c 				sizeof(struct tcmu_cmd),
tcmu_cmd         2740 drivers/target/target_core_user.c 				__alignof__(struct tcmu_cmd),