@@ -405,22 +388,20 @@ static inline int fnic_queue_wq_copy_desc(struct fnic *fnic,
* Routine to send a scsi cdb
* Called with host_lock held and interrupts disabled.
*/
-static int fnic_queuecommand_lck(struct scsi_cmnd *sc)
+static int fnic_queuecommand_lck(struct scsi_cmnd *sc, uint32_t mqtag, uint16_t hwq)
-DEF_SCSI_QCMD(fnic_queuecommand)
+int fnic_queuecommand(struct Scsi_Host *shost, struct scsi_cmnd *sc)
+{
+ struct request *const rq = scsi_cmd_to_rq(sc);
+ int rc;
+ struct fc_lport *lp = shost_priv(sc->device->host);
+ struct fnic *fnic = lport_priv(lp);
+ uint32_t mqtag = 0;
+ int tag = 0;
+ uint16_t hwq = 0;
+
+ mqtag = blk_mq_unique_tag(rq);
+ hwq = blk_mq_unique_tag_to_hwq(mqtag);
+ tag = blk_mq_unique_tag_to_tag(mqtag);
+
+ if (tag >= fnic->fnic_max_tag_id) {
+ FNIC_SCSI_DBG(KERN_ERR, fnic->lport->host,
+ "fnic<%d>: %s: Out of range tag: 0x%x\n",
+ fnic->fnic_num, __func__, tag);
+ sc->result = DID_ERROR << 16;
+ scsi_done(sc);
+ return 0;
+ }
+
+ rc = fnic_queuecommand_lck(sc, mqtag, hwq);
+ return rc;
+}