scsi: remove MSG_*_TAG defines
authorChristoph Hellwig <hch@infradead.org>
Mon, 24 Nov 2014 15:07:25 +0000 (07:07 -0800)
committerChristoph Hellwig <hch@lst.de>
Thu, 4 Dec 2014 08:58:33 +0000 (09:58 +0100)
For SPI drivers use the message definitions from scsi.h, and for target
drivers introduce a new TCM_*_TAG namespace.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com
18 files changed:
drivers/infiniband/ulp/srpt/ib_srpt.c
drivers/scsi/advansys.c
drivers/scsi/qla2xxx/qla_target.c
drivers/scsi/scsi_debug.c
drivers/scsi/scsi_transport_spi.c
drivers/target/iscsi/iscsi_target.c
drivers/target/loopback/tcm_loop.c
drivers/target/sbp/sbp_target.c
drivers/target/target_core_pscsi.c
drivers/target/target_core_sbc.c
drivers/target/target_core_spc.c
drivers/target/target_core_transport.c
drivers/target/tcm_fc/tfc_cmd.c
drivers/usb/gadget/legacy/tcm_usb_gadget.c
drivers/xen/xen-scsiback.c
include/scsi/scsi_tcq.h
include/target/target_core_base.h
include/trace/events/target.h

index 7206547c13ce0dc8dda59458658d843d64520327..3a0ca61b02c824388f313da14bcb170aaebc5da0 100644 (file)
@@ -1708,17 +1708,17 @@ static int srpt_handle_cmd(struct srpt_rdma_ch *ch,
 
        switch (srp_cmd->task_attr) {
        case SRP_CMD_SIMPLE_Q:
-               cmd->sam_task_attr = MSG_SIMPLE_TAG;
+               cmd->sam_task_attr = TCM_SIMPLE_TAG;
                break;
        case SRP_CMD_ORDERED_Q:
        default:
-               cmd->sam_task_attr = MSG_ORDERED_TAG;
+               cmd->sam_task_attr = TCM_ORDERED_TAG;
                break;
        case SRP_CMD_HEAD_OF_Q:
-               cmd->sam_task_attr = MSG_HEAD_TAG;
+               cmd->sam_task_attr = TCM_HEAD_TAG;
                break;
        case SRP_CMD_ACA:
-               cmd->sam_task_attr = MSG_ACA_TAG;
+               cmd->sam_task_attr = TCM_ACA_TAG;
                break;
        }
 
@@ -1733,7 +1733,7 @@ static int srpt_handle_cmd(struct srpt_rdma_ch *ch,
                                       sizeof(srp_cmd->lun));
        rc = target_submit_cmd(cmd, ch->sess, srp_cmd->cdb,
                        &send_ioctx->sense_data[0], unpacked_lun, data_len,
-                       MSG_SIMPLE_TAG, dir, TARGET_SCF_ACK_KREF);
+                       TCM_SIMPLE_TAG, dir, TARGET_SCF_ACK_KREF);
        if (rc != 0) {
                ret = TCM_LOGICAL_UNIT_COMMUNICATION_FAILURE;
                goto send_sense;
index 6719a3390ebd7ad9781a52552616859bf836b2ab..2c5ce48c8f956127e118046aa1a248cc0adc132e 100644 (file)
@@ -7921,9 +7921,9 @@ static int asc_build_req(struct asc_board *boardp, struct scsi_cmnd *scp,
         */
        if ((asc_dvc->cur_dvc_qng[scp->device->id] > 0) &&
            (boardp->reqcnt[scp->device->id] % 255) == 0) {
-               asc_scsi_q->q2.tag_code = MSG_ORDERED_TAG;
+               asc_scsi_q->q2.tag_code = ORDERED_QUEUE_TAG;
        } else {
-               asc_scsi_q->q2.tag_code = MSG_SIMPLE_TAG;
+               asc_scsi_q->q2.tag_code = SIMPLE_QUEUE_TAG;
        }
 
        /* Build ASC_SCSI_Q */
@@ -8351,7 +8351,7 @@ static int AscPutReadyQueue(ASC_DVC_VAR *asc_dvc, ASC_SCSI_Q *scsiq, uchar q_no)
        }
        q_addr = ASC_QNO_TO_QADDR(q_no);
        if ((scsiq->q1.target_id & asc_dvc->use_tagged_qng) == 0) {
-               scsiq->q2.tag_code &= ~MSG_SIMPLE_TAG;
+               scsiq->q2.tag_code &= ~SIMPLE_QUEUE_TAG;
        }
        scsiq->q1.status = QS_FREE;
        AscMemWordCopyPtrToLram(iop_base,
@@ -8669,7 +8669,7 @@ static int AscExeScsiQueue(ASC_DVC_VAR *asc_dvc, ASC_SCSI_Q *scsiq)
                }
        }
        if (disable_syn_offset_one_fix) {
-               scsiq->q2.tag_code &= ~MSG_SIMPLE_TAG;
+               scsiq->q2.tag_code &= ~SIMPLE_QUEUE_TAG;
                scsiq->q2.tag_code |= (ASC_TAG_FLAG_DISABLE_ASYN_USE_SYN_FIX |
                                       ASC_TAG_FLAG_DISABLE_DISCONNECT);
        } else {
index a902fa1db7aff1a0fd3ca8622040b56f6e03cef1..57418258c1017631798b73d78bf73e2367ae8917 100644 (file)
@@ -3218,25 +3218,25 @@ static inline int qlt_get_fcp_task_attr(struct scsi_qla_host *vha,
 
        switch (task_codes) {
        case ATIO_SIMPLE_QUEUE:
-               fcp_task_attr = MSG_SIMPLE_TAG;
+               fcp_task_attr = TCM_SIMPLE_TAG;
                break;
        case ATIO_HEAD_OF_QUEUE:
-               fcp_task_attr = MSG_HEAD_TAG;
+               fcp_task_attr = TCM_HEAD_TAG;
                break;
        case ATIO_ORDERED_QUEUE:
-               fcp_task_attr = MSG_ORDERED_TAG;
+               fcp_task_attr = TCM_ORDERED_TAG;
                break;
        case ATIO_ACA_QUEUE:
-               fcp_task_attr = MSG_ACA_TAG;
+               fcp_task_attr = TCM_ACA_TAG;
                break;
        case ATIO_UNTAGGED:
-               fcp_task_attr = MSG_SIMPLE_TAG;
+               fcp_task_attr = TCM_SIMPLE_TAG;
                break;
        default:
                ql_dbg(ql_dbg_tgt_mgt, vha, 0xf05d,
                    "qla_target: unknown task code %x, use ORDERED instead\n",
                    task_codes);
-               fcp_task_attr = MSG_ORDERED_TAG;
+               fcp_task_attr = TCM_ORDERED_TAG;
                break;
        }
 
index 87b5361d893ba356b7dbbea66d5a6415eb9b536b..d81158b71326f61912f6615af3b8b0802904f08f 100644 (file)
@@ -128,7 +128,6 @@ static const char *scsi_debug_version_date = "20141022";
 #define DEF_REMOVABLE false
 #define DEF_SCSI_LEVEL   6    /* INQUIRY, byte2 [6->SPC-4] */
 #define DEF_SECTOR_SIZE 512
-#define DEF_TAGGED_QUEUING 0 /* 0 | MSG_SIMPLE_TAG | MSG_ORDERED_TAG */
 #define DEF_UNMAP_ALIGNMENT 0
 #define DEF_UNMAP_GRANULARITY 1
 #define DEF_UNMAP_MAX_BLOCKS 0xFFFFFFFF
index fa2aece76cc22094d36d605bc9075def9db9783b..31bbb0da3397f9a4f743b897b5f4c6e5d29dd19d 100644 (file)
@@ -1221,7 +1221,7 @@ EXPORT_SYMBOL_GPL(spi_populate_ppr_msg);
 int spi_populate_tag_msg(unsigned char *msg, struct scsi_cmnd *cmd)
 {
         if (cmd->flags & SCMD_TAGGED) {
-               *msg++ = MSG_SIMPLE_TAG;
+               *msg++ = SIMPLE_QUEUE_TAG;
                *msg++ = cmd->request->tag;
                return 2;
        }
index b19e4329ba00739503215124ec768e8c99d843c3..67802ccfcde98e6fcb2907beae210c59ae33225f 100644 (file)
@@ -943,17 +943,17 @@ int iscsit_setup_scsi_cmd(struct iscsi_conn *conn, struct iscsi_cmd *cmd,
         */
        if ((iscsi_task_attr == ISCSI_ATTR_UNTAGGED) ||
            (iscsi_task_attr == ISCSI_ATTR_SIMPLE))
-               sam_task_attr = MSG_SIMPLE_TAG;
+               sam_task_attr = TCM_SIMPLE_TAG;
        else if (iscsi_task_attr == ISCSI_ATTR_ORDERED)
-               sam_task_attr = MSG_ORDERED_TAG;
+               sam_task_attr = TCM_ORDERED_TAG;
        else if (iscsi_task_attr == ISCSI_ATTR_HEAD_OF_QUEUE)
-               sam_task_attr = MSG_HEAD_TAG;
+               sam_task_attr = TCM_HEAD_TAG;
        else if (iscsi_task_attr == ISCSI_ATTR_ACA)
-               sam_task_attr = MSG_ACA_TAG;
+               sam_task_attr = TCM_ACA_TAG;
        else {
                pr_debug("Unknown iSCSI Task Attribute: 0x%02x, using"
-                       " MSG_SIMPLE_TAG\n", iscsi_task_attr);
-               sam_task_attr = MSG_SIMPLE_TAG;
+                       " TCM_SIMPLE_TAG\n", iscsi_task_attr);
+               sam_task_attr = TCM_SIMPLE_TAG;
        }
 
        cmd->iscsi_opcode       = ISCSI_OP_SCSI_CMD;
@@ -1811,7 +1811,7 @@ iscsit_handle_task_mgt_cmd(struct iscsi_conn *conn, struct iscsi_cmd *cmd,
                transport_init_se_cmd(&cmd->se_cmd,
                                      &lio_target_fabric_configfs->tf_ops,
                                      conn->sess->se_sess, 0, DMA_NONE,
-                                     MSG_SIMPLE_TAG, cmd->sense_buffer + 2);
+                                     TCM_SIMPLE_TAG, cmd->sense_buffer + 2);
 
                target_get_sess_cmd(conn->sess->se_sess, &cmd->se_cmd, true);
                sess_ref = true;
index 24e2c94e429b2fb7d665fe8988cc4f0b561dade3..dda9a08c939f3716ccbc958046ca516a838b6573 100644 (file)
@@ -168,7 +168,7 @@ static void tcm_loop_submission_work(struct work_struct *work)
 
        rc = target_submit_cmd_map_sgls(se_cmd, tl_nexus->se_sess, sc->cmnd,
                        &tl_cmd->tl_sense_buf[0], tl_cmd->sc->device->lun,
-                       transfer_length, MSG_SIMPLE_TAG,
+                       transfer_length, TCM_SIMPLE_TAG,
                        sc->sc_data_direction, 0,
                        scsi_sglist(sc), scsi_sg_count(sc),
                        sgl_bidi, sgl_bidi_count,
@@ -248,7 +248,7 @@ static int tcm_loop_issue_tmr(struct tcm_loop_tpg *tl_tpg,
         * Initialize struct se_cmd descriptor from target_core_mod infrastructure
         */
        transport_init_se_cmd(se_cmd, se_tpg->se_tpg_tfo, se_sess, 0,
-                               DMA_NONE, MSG_SIMPLE_TAG,
+                               DMA_NONE, TCM_SIMPLE_TAG,
                                &tl_cmd->tl_sense_buf[0]);
 
        rc = core_tmr_alloc_req(se_cmd, tl_tmr, tmr, GFP_KERNEL);
index e7e93727553cef8d3503201f381bd64b3f02d6b3..9512af6a811408f169b7a6c5084dda5ce98d8dfa 100644 (file)
@@ -1237,7 +1237,7 @@ static void sbp_handle_command(struct sbp_target_request *req)
 
        if (target_submit_cmd(&req->se_cmd, sess->se_sess, req->cmd_buf,
                              req->sense_buf, unpacked_lun, data_length,
-                             MSG_SIMPLE_TAG, data_dir, 0))
+                             TCM_SIMPLE_TAG, data_dir, 0))
                goto err;
 
        return;
index 7c8291f0bbbce5f519bce28b1c6db8d4269a62bd..caf03d5b3ca2e381c5ceb13aba539f1bf84c4924 100644 (file)
@@ -1094,7 +1094,7 @@ pscsi_execute_cmd(struct se_cmd *cmd)
        req->retries = PS_RETRY;
 
        blk_execute_rq_nowait(pdv->pdv_sd->request_queue, NULL, req,
-                       (cmd->sam_task_attr == MSG_HEAD_TAG),
+                       (cmd->sam_task_attr == TCM_HEAD_TAG),
                        pscsi_req_done);
 
        return 0;
index ebe62afb957dbcf0c113f2315e517051f9fff4dd..d6e06af696ed102d455f64d1e28b31964676ec40 100644 (file)
@@ -485,7 +485,7 @@ static sense_reason_t compare_and_write_callback(struct se_cmd *cmd)
        cmd->t_data_nents_orig = cmd->t_data_nents;
        cmd->t_data_nents = 1;
 
-       cmd->sam_task_attr = MSG_HEAD_TAG;
+       cmd->sam_task_attr = TCM_HEAD_TAG;
        cmd->transport_complete_callback = compare_and_write_post;
        /*
         * Now reset ->execute_cmd() to the normal sbc_execute_rw() handler
index bc286a67af7c4e876e0ac6075e8af8fffe2b9c92..1307600fe7264cb55234b6b8e88d8cc15878c799 100644 (file)
@@ -1357,7 +1357,7 @@ spc_parse_cdb(struct se_cmd *cmd, unsigned int *size)
                 * Do implicit HEAD_OF_QUEUE processing for INQUIRY.
                 * See spc4r17 section 5.3
                 */
-               cmd->sam_task_attr = MSG_HEAD_TAG;
+               cmd->sam_task_attr = TCM_HEAD_TAG;
                cmd->execute_cmd = spc_emulate_inquiry;
                break;
        case SECURITY_PROTOCOL_IN:
@@ -1391,7 +1391,7 @@ spc_parse_cdb(struct se_cmd *cmd, unsigned int *size)
                 * Do implicit HEAD_OF_QUEUE processing for REPORT_LUNS
                 * See spc4r17 section 5.3
                 */
-               cmd->sam_task_attr = MSG_HEAD_TAG;
+               cmd->sam_task_attr = TCM_HEAD_TAG;
                break;
        case TEST_UNIT_READY:
                cmd->execute_cmd = spc_emulate_testunitready;
index 9ea0d5f03f7a566fbbe4191a93ad1312cbcfa5af..d9b5010c3bf73acba7830ae67bb2751992ad03ad 100644 (file)
@@ -1159,7 +1159,7 @@ transport_check_alloc_task_attr(struct se_cmd *cmd)
        if (dev->transport->transport_type == TRANSPORT_PLUGIN_PHBA_PDEV)
                return 0;
 
-       if (cmd->sam_task_attr == MSG_ACA_TAG) {
+       if (cmd->sam_task_attr == TCM_ACA_TAG) {
                pr_debug("SAM Task Attribute ACA"
                        " emulation is not supported\n");
                return TCM_INVALID_CDB_FIELD;
@@ -1531,7 +1531,7 @@ int target_submit_tmr(struct se_cmd *se_cmd, struct se_session *se_sess,
        BUG_ON(!se_tpg);
 
        transport_init_se_cmd(se_cmd, se_tpg->se_tpg_tfo, se_sess,
-                             0, DMA_NONE, MSG_SIMPLE_TAG, sense);
+                             0, DMA_NONE, TCM_SIMPLE_TAG, sense);
        /*
         * FIXME: Currently expect caller to handle se_cmd->se_tmr_req
         * allocation failure.
@@ -1718,12 +1718,12 @@ static bool target_handle_task_attr(struct se_cmd *cmd)
         * to allow the passed struct se_cmd list of tasks to the front of the list.
         */
        switch (cmd->sam_task_attr) {
-       case MSG_HEAD_TAG:
+       case TCM_HEAD_TAG:
                pr_debug("Added HEAD_OF_QUEUE for CDB: 0x%02x, "
                         "se_ordered_id: %u\n",
                         cmd->t_task_cdb[0], cmd->se_ordered_id);
                return false;
-       case MSG_ORDERED_TAG:
+       case TCM_ORDERED_TAG:
                atomic_inc_mb(&dev->dev_ordered_sync);
 
                pr_debug("Added ORDERED for CDB: 0x%02x to ordered list, "
@@ -1828,7 +1828,7 @@ static void target_restart_delayed_cmds(struct se_device *dev)
 
                __target_execute_cmd(cmd);
 
-               if (cmd->sam_task_attr == MSG_ORDERED_TAG)
+               if (cmd->sam_task_attr == TCM_ORDERED_TAG)
                        break;
        }
 }
@@ -1844,18 +1844,18 @@ static void transport_complete_task_attr(struct se_cmd *cmd)
        if (dev->transport->transport_type == TRANSPORT_PLUGIN_PHBA_PDEV)
                return;
 
-       if (cmd->sam_task_attr == MSG_SIMPLE_TAG) {
+       if (cmd->sam_task_attr == TCM_SIMPLE_TAG) {
                atomic_dec_mb(&dev->simple_cmds);
                dev->dev_cur_ordered_id++;
                pr_debug("Incremented dev->dev_cur_ordered_id: %u for"
                        " SIMPLE: %u\n", dev->dev_cur_ordered_id,
                        cmd->se_ordered_id);
-       } else if (cmd->sam_task_attr == MSG_HEAD_TAG) {
+       } else if (cmd->sam_task_attr == TCM_HEAD_TAG) {
                dev->dev_cur_ordered_id++;
                pr_debug("Incremented dev_cur_ordered_id: %u for"
                        " HEAD_OF_QUEUE: %u\n", dev->dev_cur_ordered_id,
                        cmd->se_ordered_id);
-       } else if (cmd->sam_task_attr == MSG_ORDERED_TAG) {
+       } else if (cmd->sam_task_attr == TCM_ORDERED_TAG) {
                atomic_dec_mb(&dev->dev_ordered_sync);
 
                dev->dev_cur_ordered_id++;
index be0c0d08c56a91ff9acc97e8db92868c39c25f0c..edcafa4490c0850bfc01115357ce4e817773ee72 100644 (file)
@@ -554,17 +554,17 @@ static void ft_send_work(struct work_struct *work)
         */
        switch (fcp->fc_pri_ta & FCP_PTA_MASK) {
        case FCP_PTA_HEADQ:
-               task_attr = MSG_HEAD_TAG;
+               task_attr = TCM_HEAD_TAG;
                break;
        case FCP_PTA_ORDERED:
-               task_attr = MSG_ORDERED_TAG;
+               task_attr = TCM_ORDERED_TAG;
                break;
        case FCP_PTA_ACA:
-               task_attr = MSG_ACA_TAG;
+               task_attr = TCM_ACA_TAG;
                break;
        case FCP_PTA_SIMPLE: /* Fallthrough */
        default:
-               task_attr = MSG_SIMPLE_TAG;
+               task_attr = TCM_SIMPLE_TAG;
        }
 
        fc_seq_exch(cmd->seq)->lp->tt.seq_set_resp(cmd->seq, ft_recv_seq, cmd);
index 6cdb7a534f2384d7782f0ba751e6a037dbf44b28..283ee14ca0fdfbd978726f9cd153bdf1cb97d6a9 100644 (file)
@@ -1131,19 +1131,19 @@ static int usbg_submit_command(struct f_uas *fu,
 
        switch (cmd_iu->prio_attr & 0x7) {
        case UAS_HEAD_TAG:
-               cmd->prio_attr = MSG_HEAD_TAG;
+               cmd->prio_attr = TCM_HEAD_TAG;
                break;
        case UAS_ORDERED_TAG:
-               cmd->prio_attr = MSG_ORDERED_TAG;
+               cmd->prio_attr = TCM_ORDERED_TAG;
                break;
        case UAS_ACA:
-               cmd->prio_attr = MSG_ACA_TAG;
+               cmd->prio_attr = TCM_ACA_TAG;
                break;
        default:
                pr_debug_once("Unsupported prio_attr: %02x.\n",
                                cmd_iu->prio_attr);
        case UAS_SIMPLE_TAG:
-               cmd->prio_attr = MSG_SIMPLE_TAG;
+               cmd->prio_attr = TCM_SIMPLE_TAG;
                break;
        }
 
@@ -1240,7 +1240,7 @@ static int bot_submit_command(struct f_uas *fu,
                goto err;
        }
 
-       cmd->prio_attr = MSG_SIMPLE_TAG;
+       cmd->prio_attr = TCM_SIMPLE_TAG;
        se_cmd = &cmd->se_cmd;
        cmd->unpacked_lun = cbw->Lun;
        cmd->is_read = cbw->Flags & US_BULK_FLAG_IN ? 1 : 0;
index 50610a6acf3d313aec4c106fb6ae3837bdd31ca5..e999496eda3efa65c3cda54fcc287212313ee60b 100644 (file)
@@ -606,7 +606,7 @@ static void scsiback_device_action(struct vscsibk_pend *pending_req,
        init_waitqueue_head(&tmr->tmr_wait);
 
        transport_init_se_cmd(se_cmd, tpg->se_tpg.se_tpg_tfo,
-               tpg->tpg_nexus->tvn_se_sess, 0, DMA_NONE, MSG_SIMPLE_TAG,
+               tpg->tpg_nexus->tvn_se_sess, 0, DMA_NONE, TCM_SIMPLE_TAG,
                &pending_req->sense_buffer[0]);
 
        rc = core_tmr_alloc_req(se_cmd, tmr, act, GFP_KERNEL);
index e624acabd7a0e41335116f3d6dcc868923841fe1..9708b28bd2aa1bf1ca53a044eefef563b4a5b8fc 100644 (file)
@@ -6,11 +6,6 @@
 #include <scsi/scsi_device.h>
 #include <scsi/scsi_host.h>
 
-#define MSG_SIMPLE_TAG 0x20
-#define MSG_HEAD_TAG   0x21
-#define MSG_ORDERED_TAG        0x22
-#define MSG_ACA_TAG    0x24    /* unsupported */
-
 #define SCSI_NO_TAG    (-1)    /* identify no tag in use */
 
 
index 23c518a0340c095f46fc94742bf8a033798f07fc..397fb635766a96faa94c5b91788ad24fca0d2a34 100644 (file)
@@ -476,6 +476,12 @@ struct se_dif_v1_tuple {
        __be32                  ref_tag;
 };
 
+/* for sam_task_attr */
+#define TCM_SIMPLE_TAG 0x20
+#define TCM_HEAD_TAG   0x21
+#define TCM_ORDERED_TAG        0x22
+#define TCM_ACA_TAG    0x24
+
 struct se_cmd {
        /* SAM response code being sent to initiator */
        u8                      scsi_status;
index da9cc0f05c93843e713923fc1b5d063e7d444cae..a4566806c1122a8fcbc4b9702809a52171d833c8 100644 (file)
 
 #define show_task_attribute_name(val)                          \
        __print_symbolic(val,                                   \
-               { MSG_SIMPLE_TAG,       "SIMPLE"        },      \
-               { MSG_HEAD_TAG,         "HEAD"          },      \
-               { MSG_ORDERED_TAG,      "ORDERED"       },      \
-               { MSG_ACA_TAG,          "ACA"           } )
+               { TCM_SIMPLE_TAG,       "SIMPLE"        },      \
+               { TCM_HEAD_TAG,         "HEAD"          },      \
+               { TCM_ORDERED_TAG,      "ORDERED"       },      \
+               { TCM_ACA_TAG,          "ACA"           } )
 
 #define show_scsi_status_name(val)                             \
        __print_symbolic(val,                                   \