From 89e7abc377a2057b49bbc542329fbbad100c7404 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Sun, 31 Mar 2019 16:25:54 +0000 Subject: [PATCH] qla2x00t-32gbit: Rework scsi-mq detection code Kernel versions v3.13..v3.16 have block-mq but no scsi-mq. Fix the build for these kernel versions by modifying the scsi-mq detection code. git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8114 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- qla2x00t-32gbit/qla_os.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/qla2x00t-32gbit/qla_os.c b/qla2x00t-32gbit/qla_os.c index b38206730..1e647b332 100644 --- a/qla2x00t-32gbit/qla_os.c +++ b/qla2x00t-32gbit/qla_os.c @@ -28,6 +28,13 @@ #include "qla_target.h" +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0) || \ + defined(RHEL_MAJOR) && RHEL_MAJOR -0 >= 7 +#define HAVE_SCSI_MQ 1 +#else +#define HAVE_SCSI_MQ 0 +#endif + /* * Driver version */ @@ -936,7 +943,7 @@ qla2xxx_queuecommand(struct Scsi_Host *host, struct scsi_cmnd *cmd) goto qc24_fail_command; } -#ifdef BLK_MQ_H +#if HAVE_SCSI_MQ if (ha->mqenable) { uint32_t tag; uint16_t hwq; @@ -3252,7 +3259,7 @@ qla2x00_probe_one(struct pci_dev *pdev, const struct pci_device_id *id) goto probe_failed; } -#ifdef BLK_MQ_H +#if HAVE_SCSI_MQ if (ha->mqenable) { /* number of hardware queues supported by blk/scsi-mq*/ host->nr_hw_queues = ha->max_qpairs;