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:18 +0300
committerHerbert Xu <herbert@gondor.apana.org.au>2021-12-24 06:18:24 +0300
commit028042856802c4731c6afebe15d95fed4d39a614 (patch)
treed89ea0592c79d4782efb144042c3a5f7f57c21c1 /drivers/crypto/qat/qat_common/adf_accel_devices.h
parent6ed942ed3c47b3ebb4e8de3ff10e761cdf82ba74 (diff)
downloadlinux-028042856802c4731c6afebe15d95fed4d39a614.tar.xz
crypto: qat - make PFVF send and receive direction agnostic
Currently PF and VF share the same send and receive logic for the PFVF protocol. However, the inner behaviour still depends on the specific direction, requiring a test to determine the if the sender is a PF or a VF. Moreover the vf_nr parameter is only required for PF2VF messages and ignored for the opposite direction. Make the GEN2 send and recv completely direction agnostic, by calculating and determining any direction specific input in the caller instead, and feeding the send and the receive functions with the same arguments for both PF and VF. In order to accommodate for this change, the API of the pfvf_ops send and recv has been modified to remove any reference to vf_nr. 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.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/crypto/qat/qat_common/adf_accel_devices.h b/drivers/crypto/qat/qat_common/adf_accel_devices.h
index cc8b10b23145..d65d8dda8fda 100644
--- a/drivers/crypto/qat/qat_common/adf_accel_devices.h
+++ b/drivers/crypto/qat/qat_common/adf_accel_devices.h
@@ -154,8 +154,9 @@ 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, u8 vf_nr);
- u32 (*recv_msg)(struct adf_accel_dev *accel_dev, u8 vf_nr);
+ int (*send_msg)(struct adf_accel_dev *accel_dev, u32 msg,
+ u32 pfvf_offset, struct mutex *csr_lock);
+ u32 (*recv_msg)(struct adf_accel_dev *accel_dev, u32 pfvf_offset);
};
struct adf_hw_device_data {