crypto: qat - replace device ids defines
authorGiovanni Cabiddu <giovanni.cabiddu@intel.com>
Wed, 9 Sep 2020 10:59:39 +0000 (11:59 +0100)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 18 Sep 2020 07:20:10 +0000 (17:20 +1000)
Replace device ids defined in the QAT drivers with the ones in
include/linux/pci_ids.h.

Signed-off-by: Giovanni Cabiddu <giovanni.cabiddu@intel.com>
Reviewed-by: Fiona Trahe <fiona.trahe@intel.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/qat/qat_c3xxx/adf_drv.c
drivers/crypto/qat/qat_c3xxxvf/adf_drv.c
drivers/crypto/qat/qat_c62x/adf_drv.c
drivers/crypto/qat/qat_c62xvf/adf_drv.c
drivers/crypto/qat/qat_common/adf_accel_devices.h
drivers/crypto/qat/qat_common/qat_hal.c
drivers/crypto/qat/qat_common/qat_uclo.c
drivers/crypto/qat/qat_dh895xcc/adf_drv.c
drivers/crypto/qat/qat_dh895xccvf/adf_drv.c

index 8a85484dca5b5c3641c4202680edeff521777735..281f5bc13c278980d6ef61a4332d7e5410782c98 100644 (file)
@@ -22,7 +22,7 @@
        {PCI_DEVICE(PCI_VENDOR_ID_INTEL, device_id)}
 
 static const struct pci_device_id adf_pci_tbl[] = {
-       ADF_SYSTEM_DEVICE(ADF_C3XXX_PCI_DEVICE_ID),
+       ADF_SYSTEM_DEVICE(PCI_DEVICE_ID_INTEL_QAT_C3XXX),
        {0,}
 };
 MODULE_DEVICE_TABLE(pci, adf_pci_tbl);
@@ -58,7 +58,7 @@ static void adf_cleanup_accel(struct adf_accel_dev *accel_dev)
 
        if (accel_dev->hw_device) {
                switch (accel_pci_dev->pci_dev->device) {
-               case ADF_C3XXX_PCI_DEVICE_ID:
+               case PCI_DEVICE_ID_INTEL_QAT_C3XXX:
                        adf_clean_hw_data_c3xxx(accel_dev->hw_device);
                        break;
                default:
@@ -83,7 +83,7 @@ static int adf_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
        int ret;
 
        switch (ent->device) {
-       case ADF_C3XXX_PCI_DEVICE_ID:
+       case PCI_DEVICE_ID_INTEL_QAT_C3XXX:
                break;
        default:
                dev_err(&pdev->dev, "Invalid device 0x%x.\n", ent->device);
index 71cf58f96292485cd4dd53b9d38b2fd9afee9248..b3d4212538c4f5e021967fa88ee7f5a1e460116b 100644 (file)
@@ -22,7 +22,7 @@
        {PCI_DEVICE(PCI_VENDOR_ID_INTEL, device_id)}
 
 static const struct pci_device_id adf_pci_tbl[] = {
-       ADF_SYSTEM_DEVICE(ADF_C3XXXIOV_PCI_DEVICE_ID),
+       ADF_SYSTEM_DEVICE(PCI_DEVICE_ID_INTEL_QAT_C3XXX_VF),
        {0,}
 };
 MODULE_DEVICE_TABLE(pci, adf_pci_tbl);
@@ -58,7 +58,7 @@ static void adf_cleanup_accel(struct adf_accel_dev *accel_dev)
 
        if (accel_dev->hw_device) {
                switch (accel_pci_dev->pci_dev->device) {
-               case ADF_C3XXXIOV_PCI_DEVICE_ID:
+               case PCI_DEVICE_ID_INTEL_QAT_C3XXX_VF:
                        adf_clean_hw_data_c3xxxiov(accel_dev->hw_device);
                        break;
                default:
@@ -85,7 +85,7 @@ static int adf_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
        int ret;
 
        switch (ent->device) {
-       case ADF_C3XXXIOV_PCI_DEVICE_ID:
+       case PCI_DEVICE_ID_INTEL_QAT_C3XXX_VF:
                break;
        default:
                dev_err(&pdev->dev, "Invalid device 0x%x.\n", ent->device);
index e8afbf5f7dd21a42f183c032f89aa186d9eb0533..f9e8f7c262c64178f9954612ec449c4105fa369d 100644 (file)
@@ -22,7 +22,7 @@
        {PCI_DEVICE(PCI_VENDOR_ID_INTEL, device_id)}
 
 static const struct pci_device_id adf_pci_tbl[] = {
-       ADF_SYSTEM_DEVICE(ADF_C62X_PCI_DEVICE_ID),
+       ADF_SYSTEM_DEVICE(PCI_DEVICE_ID_INTEL_QAT_C62X),
        {0,}
 };
 MODULE_DEVICE_TABLE(pci, adf_pci_tbl);
@@ -58,7 +58,7 @@ static void adf_cleanup_accel(struct adf_accel_dev *accel_dev)
 
        if (accel_dev->hw_device) {
                switch (accel_pci_dev->pci_dev->device) {
-               case ADF_C62X_PCI_DEVICE_ID:
+               case PCI_DEVICE_ID_INTEL_QAT_C62X:
                        adf_clean_hw_data_c62x(accel_dev->hw_device);
                        break;
                default:
@@ -83,7 +83,7 @@ static int adf_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
        int ret;
 
        switch (ent->device) {
-       case ADF_C62X_PCI_DEVICE_ID:
+       case PCI_DEVICE_ID_INTEL_QAT_C62X:
                break;
        default:
                dev_err(&pdev->dev, "Invalid device 0x%x.\n", ent->device);
index 7e65362462385041ca5e4667e024edcfe47c5d36..e9dce86cf1d506b12e16d80df43dad26bfe67cb0 100644 (file)
@@ -22,7 +22,7 @@
        {PCI_DEVICE(PCI_VENDOR_ID_INTEL, device_id)}
 
 static const struct pci_device_id adf_pci_tbl[] = {
-       ADF_SYSTEM_DEVICE(ADF_C62XIOV_PCI_DEVICE_ID),
+       ADF_SYSTEM_DEVICE(PCI_DEVICE_ID_INTEL_QAT_C62X_VF),
        {0,}
 };
 MODULE_DEVICE_TABLE(pci, adf_pci_tbl);
@@ -58,7 +58,7 @@ static void adf_cleanup_accel(struct adf_accel_dev *accel_dev)
 
        if (accel_dev->hw_device) {
                switch (accel_pci_dev->pci_dev->device) {
-               case ADF_C62XIOV_PCI_DEVICE_ID:
+               case PCI_DEVICE_ID_INTEL_QAT_C62X_VF:
                        adf_clean_hw_data_c62xiov(accel_dev->hw_device);
                        break;
                default:
@@ -85,7 +85,7 @@ static int adf_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
        int ret;
 
        switch (ent->device) {
-       case ADF_C62XIOV_PCI_DEVICE_ID:
+       case PCI_DEVICE_ID_INTEL_QAT_C62X_VF:
                break;
        default:
                dev_err(&pdev->dev, "Invalid device 0x%x.\n", ent->device);
index c1db8c26afb60c58f14fe6287eb417b188b640d9..06952ece53d9130d17c7c0a6c53cf508c40cfc28 100644 (file)
 #define ADF_C62XVF_DEVICE_NAME "c6xxvf"
 #define ADF_C3XXX_DEVICE_NAME "c3xxx"
 #define ADF_C3XXXVF_DEVICE_NAME "c3xxxvf"
-#define ADF_DH895XCC_PCI_DEVICE_ID 0x435
-#define ADF_DH895XCCIOV_PCI_DEVICE_ID 0x443
-#define ADF_C62X_PCI_DEVICE_ID 0x37c8
-#define ADF_C62XIOV_PCI_DEVICE_ID 0x37c9
-#define ADF_C3XXX_PCI_DEVICE_ID 0x19e2
-#define ADF_C3XXXIOV_PCI_DEVICE_ID 0x19e3
 #define ADF_ERRSOU3 (0x3A000 + 0x0C)
 #define ADF_ERRSOU5 (0x3A000 + 0xD8)
 #define ADF_DEVICE_FUSECTL_OFFSET 0x40
index fa467e0f8285376ee69e0acfc925e3b357702274..6b9d47682d04de385040ae1f4a17d0eb3639633d 100644 (file)
@@ -2,6 +2,7 @@
 /* Copyright(c) 2014 - 2020 Intel Corporation */
 #include <linux/slab.h>
 #include <linux/delay.h>
+#include <linux/pci_ids.h>
 
 #include "adf_accel_devices.h"
 #include "adf_common_drv.h"
@@ -412,7 +413,7 @@ static int qat_hal_init_esram(struct icp_qat_fw_loader_handle *handle)
        unsigned int csr_val;
        int times = 30;
 
-       if (handle->pci_dev->device != ADF_DH895XCC_PCI_DEVICE_ID)
+       if (handle->pci_dev->device != PCI_DEVICE_ID_INTEL_QAT_DH895XCC)
                return 0;
 
        csr_val = ADF_CSR_RD(csr_addr, 0);
@@ -672,13 +673,13 @@ int qat_hal_init(struct adf_accel_dev *accel_dev)
                (void __iomem *)((uintptr_t)handle->hal_cap_ae_xfer_csr_addr_v +
                                 LOCAL_TO_XFER_REG_OFFSET);
        handle->pci_dev = pci_info->pci_dev;
-       if (handle->pci_dev->device == ADF_DH895XCC_PCI_DEVICE_ID) {
+       if (handle->pci_dev->device == PCI_DEVICE_ID_INTEL_QAT_DH895XCC) {
                sram_bar =
                        &pci_info->pci_bars[hw_data->get_sram_bar_id(hw_data)];
                handle->hal_sram_addr_v = sram_bar->virt_addr;
        }
        handle->fw_auth = (handle->pci_dev->device ==
-                          ADF_DH895XCC_PCI_DEVICE_ID) ? false : true;
+                          PCI_DEVICE_ID_INTEL_QAT_DH895XCC) ? false : true;
        handle->hal_handle = kzalloc(sizeof(*handle->hal_handle), GFP_KERNEL);
        if (!handle->hal_handle)
                goto out_hal_handle;
index bff759e2f8112965661707f336777cea4a5f1fc5..978d1fce0e7476dd733aaf98f4ff6101152aa05e 100644 (file)
@@ -4,6 +4,7 @@
 #include <linux/ctype.h>
 #include <linux/kernel.h>
 #include <linux/delay.h>
+#include <linux/pci_ids.h>
 #include "adf_accel_devices.h"
 #include "adf_common_drv.h"
 #include "icp_qat_uclo.h"
@@ -711,11 +712,11 @@ static unsigned int
 qat_uclo_get_dev_type(struct icp_qat_fw_loader_handle *handle)
 {
        switch (handle->pci_dev->device) {
-       case ADF_DH895XCC_PCI_DEVICE_ID:
+       case PCI_DEVICE_ID_INTEL_QAT_DH895XCC:
                return ICP_QAT_AC_895XCC_DEV_TYPE;
-       case ADF_C62X_PCI_DEVICE_ID:
+       case PCI_DEVICE_ID_INTEL_QAT_C62X:
                return ICP_QAT_AC_C62X_DEV_TYPE;
-       case ADF_C3XXX_PCI_DEVICE_ID:
+       case PCI_DEVICE_ID_INTEL_QAT_C3XXX:
                return ICP_QAT_AC_C3XXX_DEV_TYPE;
        default:
                pr_err("QAT: unsupported device 0x%x\n",
@@ -1391,7 +1392,7 @@ int qat_uclo_wr_mimage(struct icp_qat_fw_loader_handle *handle,
                        status = qat_uclo_auth_fw(handle, desc);
                qat_uclo_ummap_auth_fw(handle, &desc);
        } else {
-               if (handle->pci_dev->device == ADF_C3XXX_PCI_DEVICE_ID) {
+               if (handle->pci_dev->device == PCI_DEVICE_ID_INTEL_QAT_C3XXX) {
                        pr_err("QAT: C3XXX doesn't support unsigned MMP\n");
                        return -EINVAL;
                }
index bce10f1722efbe7d3a61ca452cb7b01eef1d00fa..b7aa9e1d6888a10fc3048c81443afd77ae725b19 100644 (file)
@@ -22,7 +22,7 @@
        {PCI_DEVICE(PCI_VENDOR_ID_INTEL, device_id)}
 
 static const struct pci_device_id adf_pci_tbl[] = {
-       ADF_SYSTEM_DEVICE(ADF_DH895XCC_PCI_DEVICE_ID),
+       ADF_SYSTEM_DEVICE(PCI_DEVICE_ID_INTEL_QAT_DH895XCC),
        {0,}
 };
 MODULE_DEVICE_TABLE(pci, adf_pci_tbl);
@@ -58,7 +58,7 @@ static void adf_cleanup_accel(struct adf_accel_dev *accel_dev)
 
        if (accel_dev->hw_device) {
                switch (accel_pci_dev->pci_dev->device) {
-               case ADF_DH895XCC_PCI_DEVICE_ID:
+               case PCI_DEVICE_ID_INTEL_QAT_DH895XCC:
                        adf_clean_hw_data_dh895xcc(accel_dev->hw_device);
                        break;
                default:
@@ -83,7 +83,7 @@ static int adf_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
        int ret;
 
        switch (ent->device) {
-       case ADF_DH895XCC_PCI_DEVICE_ID:
+       case PCI_DEVICE_ID_INTEL_QAT_DH895XCC:
                break;
        default:
                dev_err(&pdev->dev, "Invalid device 0x%x.\n", ent->device);
index 83cd51f2a8524496c4aac39bf4c1c05050498aa1..69ddacf8e41555a8a65408cbed1e8b49978b9406 100644 (file)
@@ -22,7 +22,7 @@
        {PCI_DEVICE(PCI_VENDOR_ID_INTEL, device_id)}
 
 static const struct pci_device_id adf_pci_tbl[] = {
-       ADF_SYSTEM_DEVICE(ADF_DH895XCCIOV_PCI_DEVICE_ID),
+       ADF_SYSTEM_DEVICE(PCI_DEVICE_ID_INTEL_QAT_DH895XCC_VF),
        {0,}
 };
 MODULE_DEVICE_TABLE(pci, adf_pci_tbl);
@@ -58,7 +58,7 @@ static void adf_cleanup_accel(struct adf_accel_dev *accel_dev)
 
        if (accel_dev->hw_device) {
                switch (accel_pci_dev->pci_dev->device) {
-               case ADF_DH895XCCIOV_PCI_DEVICE_ID:
+               case PCI_DEVICE_ID_INTEL_QAT_DH895XCC_VF:
                        adf_clean_hw_data_dh895xcciov(accel_dev->hw_device);
                        break;
                default:
@@ -85,7 +85,7 @@ static int adf_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
        int ret;
 
        switch (ent->device) {
-       case ADF_DH895XCCIOV_PCI_DEVICE_ID:
+       case PCI_DEVICE_ID_INTEL_QAT_DH895XCC_VF:
                break;
        default:
                dev_err(&pdev->dev, "Invalid device 0x%x.\n", ent->device);