diff options
author | Marco Chiappero <marco.chiappero@intel.com> | 2021-12-16 09:13:17 +0000 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2021-12-24 14:18:24 +1100 |
commit | 6ed942ed3c47b3ebb4e8de3ff10e761cdf82ba74 (patch) | |
tree | 3cfd6458322ff26422850ea2748312682d32828d /drivers/crypto/qat/qat_common/adf_pfvf_vf_proto.c | |
parent | crypto: qat - add the adf_get_pmisc_base() helper function (diff) | |
download | linux-dev-6ed942ed3c47b3ebb4e8de3ff10e761cdf82ba74.tar.xz linux-dev-6ed942ed3c47b3ebb4e8de3ff10e761cdf82ba74.zip |
crypto: qat - make PFVF message construction direction agnostic
Currently PFVF messages are created upfront in the CSR format, that is
PF2VF messages starting from bit 0 and VF2PF from bit 16, and passed
along unmodified to the PFVF send function.
Refactor the code to allow the VF2PF messages to be built starting from
bit 0, as for the PF2VF messages. Shift the VF to PF messages just
before sending them, and refactor the send logic to handle messages
properly depending on the direction.
As a result all the messages are composed the same way regardless of
the direction.
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 '')
-rw-r--r-- | drivers/crypto/qat/qat_common/adf_pfvf_vf_proto.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/crypto/qat/qat_common/adf_pfvf_vf_proto.c b/drivers/crypto/qat/qat_common/adf_pfvf_vf_proto.c index 9c7489ed122c..f8d1c7d0ec4e 100644 --- a/drivers/crypto/qat/qat_common/adf_pfvf_vf_proto.c +++ b/drivers/crypto/qat/qat_common/adf_pfvf_vf_proto.c @@ -88,7 +88,7 @@ int adf_send_vf2pf_req(struct adf_accel_dev *accel_dev, u32 msg, u32 *resp) static bool adf_handle_pf2vf_msg(struct adf_accel_dev *accel_dev, u32 msg) { - switch ((msg & ADF_PF2VF_MSGTYPE_MASK) >> ADF_PF2VF_MSGTYPE_SHIFT) { + switch ((msg >> ADF_PFVF_MSGTYPE_SHIFT) & ADF_PFVF_MSGTYPE_MASK) { case ADF_PF2VF_MSGTYPE_RESTARTING: dev_dbg(&GET_DEV(accel_dev), "Restarting message received from PF\n"); |