summaryrefslogtreecommitdiff
path: root/drivers/crypto/qat/qat_common/adf_accel_devices.h
diff options
context:
space:
mode:
authorMarco Chiappero <marco.chiappero@intel.com>2021-12-16 12:13:20 +0300
committerHerbert Xu <herbert@gondor.apana.org.au>2021-12-24 06:18:25 +0300
commitdb1c034801c402b1f600ef7f753494479950f78e (patch)
tree03902c617f0540d4eb95965d4e888d85bf35a53a /drivers/crypto/qat/qat_common/adf_accel_devices.h
parent0aeda694f1870f50900603c276423ffc05035f90 (diff)
downloadlinux-db1c034801c402b1f600ef7f753494479950f78e.tar.xz
crypto: qat - abstract PFVF messages with struct pfvf_message
This implementation of the PFVF protocol was designed around the GEN2 devices and its CSR format. In order to support future generations, which come with differently sized fields, change the definition of the PFVF message and make it abstract by means of a new pfvf_message struct. Also, introduce some utilities to translate to and from the new message format and the device specific CSR format. Signed-off-by: Marco Chiappero <marco.chiappero@intel.com> Reviewed-by: Giovanni Cabiddu <giovanni.cabiddu@intel.com> Reviewed-by: Fiona Trahe <fiona.trahe@intel.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers/crypto/qat/qat_common/adf_accel_devices.h')
-rw-r--r--drivers/crypto/qat/qat_common/adf_accel_devices.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/crypto/qat/qat_common/adf_accel_devices.h b/drivers/crypto/qat/qat_common/adf_accel_devices.h
index d65d8dda8fda..d5ccefc04153 100644
--- a/drivers/crypto/qat/qat_common/adf_accel_devices.h
+++ b/drivers/crypto/qat/qat_common/adf_accel_devices.h
@@ -8,6 +8,7 @@
#include <linux/io.h>
#include <linux/ratelimit.h>
#include "adf_cfg_common.h"
+#include "adf_pfvf_msg.h"
#define ADF_DH895XCC_DEVICE_NAME "dh895xcc"
#define ADF_DH895XCCVF_DEVICE_NAME "dh895xccvf"
@@ -154,9 +155,10 @@ struct adf_pfvf_ops {
u32 (*get_vf2pf_sources)(void __iomem *pmisc_addr);
void (*enable_vf2pf_interrupts)(void __iomem *pmisc_addr, u32 vf_mask);
void (*disable_vf2pf_interrupts)(void __iomem *pmisc_addr, u32 vf_mask);
- int (*send_msg)(struct adf_accel_dev *accel_dev, u32 msg,
+ int (*send_msg)(struct adf_accel_dev *accel_dev, struct pfvf_message msg,
u32 pfvf_offset, struct mutex *csr_lock);
- u32 (*recv_msg)(struct adf_accel_dev *accel_dev, u32 pfvf_offset);
+ struct pfvf_message (*recv_msg)(struct adf_accel_dev *accel_dev,
+ u32 pfvf_offset);
};
struct adf_hw_device_data {
@@ -275,7 +277,7 @@ struct adf_accel_dev {
struct tasklet_struct pf2vf_bh_tasklet;
struct mutex vf2pf_lock; /* protect CSR access */
struct completion msg_received;
- u32 response; /* temp field holding pf2vf response */
+ struct pfvf_message response; /* temp field holding pf2vf response */
u8 pf_version;
} vf;
};