Unpdate for kernels 4.12+

git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7256 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
Vladislav Bolkhovitin
2017-10-14 02:18:56 +00:00
parent 7b5dcab494
commit b65d646a2f
2 changed files with 33 additions and 1 deletions
+14 -1
View File
@@ -2196,7 +2196,11 @@ qla24xx_bsg_timeout(struct bsg_job *bsg_job)
ql_log(ql_log_warn, vha, 0x7089,
"mbx abort_command "
"failed.\n");
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0)
scsi_req(bsg_job->req)->result =
#else
bsg_job->req->errors =
#endif
#ifndef NEW_LIBFC_API
bsg_job->reply->result = -EIO;
#else
@@ -2206,7 +2210,11 @@ qla24xx_bsg_timeout(struct bsg_job *bsg_job)
ql_dbg(ql_dbg_user, vha, 0x708a,
"mbx abort_command "
"success.\n");
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0)
scsi_req(bsg_job->req)->result =
#else
bsg_job->req->errors =
#endif
#ifndef NEW_LIBFC_API
bsg_job->reply->result = 0;
#else
@@ -2224,7 +2232,12 @@ qla24xx_bsg_timeout(struct bsg_job *bsg_job)
#ifndef NEW_LIBFC_API
bsg_job->req->errors = bsg_job->reply->result = -ENXIO;
#else
bsg_job->req->errors = bsg_reply->result = -ENXIO;
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0)
scsi_req(bsg_job->req)->result =
#else
bsg_job->req->errors =
#endif
bsg_reply->result = -ENXIO;
#endif
return 0;
+19
View File
@@ -2705,6 +2705,7 @@ qla24xx_enable_msix(struct qla_hw_data *ha, struct rsp_que *rsp)
for (i = 0; i < ha->msix_count; i++)
entries[i].entry = i;
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 11, 0)
ret = pci_enable_msix(ha->pdev, entries, ha->msix_count);
if (ret) {
if (ret < MIN_MSIX_COUNT)
@@ -2726,6 +2727,24 @@ msix_failed:
}
ha->max_rsp_queues = ha->msix_count - 1;
}
#else
ret = pci_enable_msix_range(ha->pdev,
entries, MIN_MSIX_COUNT, ha->msix_count);
if (ret < 0) {
ql_log(ql_log_fatal, vha, 0x00c7,
"MSI-X: Failed to enable support, "
"giving up -- %d/%d.\n",
ha->msix_count, ret);
goto msix_out;
} else if (ret < ha->msix_count) {
ql_log(ql_log_warn, vha, 0x00c6,
"MSI-X: Failed to enable support "
"with %d vectors, using %d vectors.\n",
ha->msix_count, ret);
ha->msix_count = ret;
ha->max_rsp_queues = ha->msix_count - 1;
}
#endif
ha->msix_entries = kcalloc(ha->msix_count,
sizeof(struct qla_msix_entry), GFP_KERNEL);
if (!ha->msix_entries) {