diff options
author | Marco Chiappero <marco.chiappero@intel.com> | 2021-12-16 12:13:20 +0300 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2021-12-24 06:18:25 +0300 |
commit | db1c034801c402b1f600ef7f753494479950f78e (patch) | |
tree | 03902c617f0540d4eb95965d4e888d85bf35a53a /drivers/crypto/qat/qat_common/adf_pfvf_msg.h | |
parent | 0aeda694f1870f50900603c276423ffc05035f90 (diff) | |
download | linux-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_pfvf_msg.h')
-rw-r--r-- | drivers/crypto/qat/qat_common/adf_pfvf_msg.h | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/drivers/crypto/qat/qat_common/adf_pfvf_msg.h b/drivers/crypto/qat/qat_common/adf_pfvf_msg.h index 3ba88bcd0726..26eb27853e83 100644 --- a/drivers/crypto/qat/qat_common/adf_pfvf_msg.h +++ b/drivers/crypto/qat/qat_common/adf_pfvf_msg.h @@ -56,8 +56,14 @@ /* PFVF message common bits */ #define ADF_PFVF_INT BIT(0) #define ADF_PFVF_MSGORIGIN_SYSTEM BIT(1) -#define ADF_PFVF_MSGTYPE_SHIFT 2 -#define ADF_PFVF_MSGTYPE_MASK 0x0F + +/* Different generations have different CSR layouts, use this struct + * to abstract these differences away + */ +struct pfvf_message { + u8 type; + u32 data; +}; /* PF->VF messages */ enum pf2vf_msgtype { @@ -80,11 +86,9 @@ enum pfvf_compatibility_version { }; /* PF->VF Version Response */ -#define ADF_PF2VF_MINORVERSION_SHIFT 6 -#define ADF_PF2VF_MAJORVERSION_SHIFT 10 -#define ADF_PF2VF_VERSION_RESP_VERS_SHIFT 6 +#define ADF_PF2VF_VERSION_RESP_VERS_SHIFT 0 #define ADF_PF2VF_VERSION_RESP_VERS_MASK 0xFF -#define ADF_PF2VF_VERSION_RESP_RESULT_SHIFT 14 +#define ADF_PF2VF_VERSION_RESP_RESULT_SHIFT 8 #define ADF_PF2VF_VERSION_RESP_RESULT_MASK 0x03 enum pf2vf_compat_response { @@ -93,7 +97,4 @@ enum pf2vf_compat_response { ADF_PF2VF_VF_COMPAT_UNKNOWN = 0x03, }; -/* VF->PF Compatible Version Request */ -#define ADF_VF2PF_COMPAT_VER_REQ_SHIFT 6 - #endif /* ADF_PFVF_MSG_H */ |