diff options
-rw-r--r-- | drivers/scsi/qla2xxx/tcm_qla2xxx.c | 1 | ||||
-rw-r--r-- | drivers/target/target_core_transport.c | 44 | ||||
-rw-r--r-- | drivers/usb/gadget/tcm_usb_gadget.c | 14 | ||||
-rw-r--r-- | include/target/target_core_base.h | 1 | ||||
-rw-r--r-- | include/target/target_core_fabric.h | 7 |
5 files changed, 1 insertions, 66 deletions
diff --git a/drivers/scsi/qla2xxx/tcm_qla2xxx.c b/drivers/scsi/qla2xxx/tcm_qla2xxx.c index 977cb8b1e42b..d85a81776a78 100644 --- a/drivers/scsi/qla2xxx/tcm_qla2xxx.c +++ b/drivers/scsi/qla2xxx/tcm_qla2xxx.c | |||
@@ -1678,7 +1678,6 @@ static struct target_core_fabric_ops tcm_qla2xxx_ops = { | |||
1678 | .tpg_alloc_fabric_acl = tcm_qla2xxx_alloc_fabric_acl, | 1678 | .tpg_alloc_fabric_acl = tcm_qla2xxx_alloc_fabric_acl, |
1679 | .tpg_release_fabric_acl = tcm_qla2xxx_release_fabric_acl, | 1679 | .tpg_release_fabric_acl = tcm_qla2xxx_release_fabric_acl, |
1680 | .tpg_get_inst_index = tcm_qla2xxx_tpg_get_inst_index, | 1680 | .tpg_get_inst_index = tcm_qla2xxx_tpg_get_inst_index, |
1681 | .new_cmd_map = NULL, | ||
1682 | .check_stop_free = tcm_qla2xxx_check_stop_free, | 1681 | .check_stop_free = tcm_qla2xxx_check_stop_free, |
1683 | .release_cmd = tcm_qla2xxx_release_cmd, | 1682 | .release_cmd = tcm_qla2xxx_release_cmd, |
1684 | .put_session = tcm_qla2xxx_put_session, | 1683 | .put_session = tcm_qla2xxx_put_session, |
diff --git a/drivers/target/target_core_transport.c b/drivers/target/target_core_transport.c index 68f0c8dbc03b..9b7bbbe70211 100644 --- a/drivers/target/target_core_transport.c +++ b/drivers/target/target_core_transport.c | |||
@@ -1661,25 +1661,6 @@ int target_submit_tmr(struct se_cmd *se_cmd, struct se_session *se_sess, | |||
1661 | } | 1661 | } |
1662 | EXPORT_SYMBOL(target_submit_tmr); | 1662 | EXPORT_SYMBOL(target_submit_tmr); |
1663 | 1663 | ||
1664 | /* | ||
1665 | * Used by fabric module frontends defining a TFO->new_cmd_map() caller | ||
1666 | * to queue up a newly setup se_cmd w/ TRANSPORT_NEW_CMD_MAP in order to | ||
1667 | * complete setup in TCM process context w/ TFO->new_cmd_map(). | ||
1668 | */ | ||
1669 | int transport_generic_handle_cdb_map( | ||
1670 | struct se_cmd *cmd) | ||
1671 | { | ||
1672 | if (!cmd->se_lun) { | ||
1673 | dump_stack(); | ||
1674 | pr_err("cmd->se_lun is NULL\n"); | ||
1675 | return -EINVAL; | ||
1676 | } | ||
1677 | |||
1678 | transport_add_cmd_to_queue(cmd, TRANSPORT_NEW_CMD_MAP, false); | ||
1679 | return 0; | ||
1680 | } | ||
1681 | EXPORT_SYMBOL(transport_generic_handle_cdb_map); | ||
1682 | |||
1683 | /* transport_generic_handle_tmr(): | 1664 | /* transport_generic_handle_tmr(): |
1684 | * | 1665 | * |
1685 | * | 1666 | * |
@@ -1784,13 +1765,7 @@ void transport_generic_request_failure(struct se_cmd *cmd) | |||
1784 | cmd->scsi_sense_reason = TCM_UNSUPPORTED_SCSI_OPCODE; | 1765 | cmd->scsi_sense_reason = TCM_UNSUPPORTED_SCSI_OPCODE; |
1785 | break; | 1766 | break; |
1786 | } | 1767 | } |
1787 | /* | 1768 | |
1788 | * If a fabric does not define a cmd->se_tfo->new_cmd_map caller, | ||
1789 | * make the call to transport_send_check_condition_and_sense() | ||
1790 | * directly. Otherwise expect the fabric to make the call to | ||
1791 | * transport_send_check_condition_and_sense() after handling | ||
1792 | * possible unsoliticied write data payloads. | ||
1793 | */ | ||
1794 | ret = transport_send_check_condition_and_sense(cmd, | 1769 | ret = transport_send_check_condition_and_sense(cmd, |
1795 | cmd->scsi_sense_reason, 0); | 1770 | cmd->scsi_sense_reason, 0); |
1796 | if (ret == -EAGAIN || ret == -ENOMEM) | 1771 | if (ret == -EAGAIN || ret == -ENOMEM) |
@@ -3247,23 +3222,6 @@ get_cmd: | |||
3247 | case TRANSPORT_NEW_CMD: | 3222 | case TRANSPORT_NEW_CMD: |
3248 | BUG(); | 3223 | BUG(); |
3249 | break; | 3224 | break; |
3250 | case TRANSPORT_NEW_CMD_MAP: | ||
3251 | if (!cmd->se_tfo->new_cmd_map) { | ||
3252 | pr_err("cmd->se_tfo->new_cmd_map is" | ||
3253 | " NULL for TRANSPORT_NEW_CMD_MAP\n"); | ||
3254 | BUG(); | ||
3255 | } | ||
3256 | ret = cmd->se_tfo->new_cmd_map(cmd); | ||
3257 | if (ret < 0) { | ||
3258 | transport_generic_request_failure(cmd); | ||
3259 | break; | ||
3260 | } | ||
3261 | ret = transport_generic_new_cmd(cmd); | ||
3262 | if (ret < 0) { | ||
3263 | transport_generic_request_failure(cmd); | ||
3264 | break; | ||
3265 | } | ||
3266 | break; | ||
3267 | case TRANSPORT_PROCESS_TMR: | 3225 | case TRANSPORT_PROCESS_TMR: |
3268 | transport_generic_do_tmr(cmd); | 3226 | transport_generic_do_tmr(cmd); |
3269 | break; | 3227 | break; |
diff --git a/drivers/usb/gadget/tcm_usb_gadget.c b/drivers/usb/gadget/tcm_usb_gadget.c index 031d44e86ec3..02ace18fca0b 100644 --- a/drivers/usb/gadget/tcm_usb_gadget.c +++ b/drivers/usb/gadget/tcm_usb_gadget.c | |||
@@ -1400,19 +1400,6 @@ static u32 usbg_tpg_get_inst_index(struct se_portal_group *se_tpg) | |||
1400 | return 1; | 1400 | return 1; |
1401 | } | 1401 | } |
1402 | 1402 | ||
1403 | static int usbg_new_cmd(struct se_cmd *se_cmd) | ||
1404 | { | ||
1405 | struct usbg_cmd *cmd = container_of(se_cmd, struct usbg_cmd, | ||
1406 | se_cmd); | ||
1407 | int ret; | ||
1408 | |||
1409 | ret = target_setup_cmd_from_cdb(se_cmd, cmd->cmd_buf); | ||
1410 | if (ret) | ||
1411 | return ret; | ||
1412 | |||
1413 | return transport_generic_map_mem_to_cmd(se_cmd, NULL, 0, NULL, 0); | ||
1414 | } | ||
1415 | |||
1416 | static void usbg_cmd_release(struct kref *ref) | 1403 | static void usbg_cmd_release(struct kref *ref) |
1417 | { | 1404 | { |
1418 | struct usbg_cmd *cmd = container_of(ref, struct usbg_cmd, | 1405 | struct usbg_cmd *cmd = container_of(ref, struct usbg_cmd, |
@@ -1902,7 +1889,6 @@ static struct target_core_fabric_ops usbg_ops = { | |||
1902 | .tpg_alloc_fabric_acl = usbg_alloc_fabric_acl, | 1889 | .tpg_alloc_fabric_acl = usbg_alloc_fabric_acl, |
1903 | .tpg_release_fabric_acl = usbg_release_fabric_acl, | 1890 | .tpg_release_fabric_acl = usbg_release_fabric_acl, |
1904 | .tpg_get_inst_index = usbg_tpg_get_inst_index, | 1891 | .tpg_get_inst_index = usbg_tpg_get_inst_index, |
1905 | .new_cmd_map = usbg_new_cmd, | ||
1906 | .release_cmd = usbg_release_cmd, | 1892 | .release_cmd = usbg_release_cmd, |
1907 | .shutdown_session = usbg_shutdown_session, | 1893 | .shutdown_session = usbg_shutdown_session, |
1908 | .close_session = usbg_close_session, | 1894 | .close_session = usbg_close_session, |
diff --git a/include/target/target_core_base.h b/include/target/target_core_base.h index 72a41dda9496..11052b24ee41 100644 --- a/include/target/target_core_base.h +++ b/include/target/target_core_base.h | |||
@@ -149,7 +149,6 @@ enum transport_state_table { | |||
149 | TRANSPORT_COMPLETE = 6, | 149 | TRANSPORT_COMPLETE = 6, |
150 | TRANSPORT_PROCESS_TMR = 9, | 150 | TRANSPORT_PROCESS_TMR = 9, |
151 | TRANSPORT_ISTATE_PROCESSING = 11, | 151 | TRANSPORT_ISTATE_PROCESSING = 11, |
152 | TRANSPORT_NEW_CMD_MAP = 16, | ||
153 | TRANSPORT_COMPLETE_QF_WP = 18, | 152 | TRANSPORT_COMPLETE_QF_WP = 18, |
154 | TRANSPORT_COMPLETE_QF_OK = 19, | 153 | TRANSPORT_COMPLETE_QF_OK = 19, |
155 | }; | 154 | }; |
diff --git a/include/target/target_core_fabric.h b/include/target/target_core_fabric.h index 69321bc87c43..c3ad1eca6ff4 100644 --- a/include/target/target_core_fabric.h +++ b/include/target/target_core_fabric.h | |||
@@ -33,12 +33,6 @@ struct target_core_fabric_ops { | |||
33 | struct se_node_acl *); | 33 | struct se_node_acl *); |
34 | u32 (*tpg_get_inst_index)(struct se_portal_group *); | 34 | u32 (*tpg_get_inst_index)(struct se_portal_group *); |
35 | /* | 35 | /* |
36 | * Optional function pointer for TCM to perform command map | ||
37 | * from TCM processing thread context, for those struct se_cmd | ||
38 | * initially allocated in interrupt context. | ||
39 | */ | ||
40 | int (*new_cmd_map)(struct se_cmd *); | ||
41 | /* | ||
42 | * Optional to release struct se_cmd and fabric dependent allocated | 36 | * Optional to release struct se_cmd and fabric dependent allocated |
43 | * I/O descriptor in transport_cmd_check_stop(). | 37 | * I/O descriptor in transport_cmd_check_stop(). |
44 | * | 38 | * |
@@ -115,7 +109,6 @@ int target_submit_tmr(struct se_cmd *se_cmd, struct se_session *se_sess, | |||
115 | void *fabric_tmr_ptr, unsigned char tm_type, | 109 | void *fabric_tmr_ptr, unsigned char tm_type, |
116 | gfp_t, unsigned int, int); | 110 | gfp_t, unsigned int, int); |
117 | int transport_handle_cdb_direct(struct se_cmd *); | 111 | int transport_handle_cdb_direct(struct se_cmd *); |
118 | int transport_generic_handle_cdb_map(struct se_cmd *); | ||
119 | int transport_generic_map_mem_to_cmd(struct se_cmd *cmd, | 112 | int transport_generic_map_mem_to_cmd(struct se_cmd *cmd, |
120 | struct scatterlist *, u32, struct scatterlist *, u32); | 113 | struct scatterlist *, u32, struct scatterlist *, u32); |
121 | int transport_generic_new_cmd(struct se_cmd *); | 114 | int transport_generic_new_cmd(struct se_cmd *); |