[Intel-gfx] [RFC-v9 22/23] mei: pxp: add vtag parameter to mei_pxp_send/receive interface
Huang, Sean Z
sean.z.huang at intel.com
Tue Dec 15 01:07:25 UTC 2020
From: Tomas Winkler <tomas.winkler at intel.com>
Added vtag parameter to mei_pxp_send_message and
mei_pxp_receive_message functions.
Signed-off-by: Vitaly Lubart <vitaly.lubart at intel.com>
Signed-off-by: Tomas Winkler <tomas.winkler at intel.com>
---
drivers/gpu/drm/i915/pxp/intel_pxp_tee.c | 4 ++--
drivers/misc/mei/pxp/mei_pxp.c | 10 ++++++----
include/drm/i915_pxp_tee_interface.h | 4 ++--
3 files changed, 10 insertions(+), 8 deletions(-)
diff --git a/drivers/gpu/drm/i915/pxp/intel_pxp_tee.c b/drivers/gpu/drm/i915/pxp/intel_pxp_tee.c
index e0815b2ee9ab..002275ff9c71 100644
--- a/drivers/gpu/drm/i915/pxp/intel_pxp_tee.c
+++ b/drivers/gpu/drm/i915/pxp/intel_pxp_tee.c
@@ -31,13 +31,13 @@ static int intel_pxp_tee_io_message(struct intel_pxp *pxp,
print_hex_dump(KERN_DEBUG, "TEE input message binaries:",
DUMP_PREFIX_OFFSET, 4, 4, msg_in, msg_in_size, true);
- ret = pxp_tee_master->ops->send(pxp_tee_master->tee_dev, msg_in, msg_in_size);
+ ret = pxp_tee_master->ops->send(pxp_tee_master->tee_dev, msg_in, msg_in_size, 1);
if (ret) {
drm_err(&i915->drm, "Failed to send TEE message\n");
return -EFAULT;
}
- ret = pxp_tee_master->ops->receive(pxp_tee_master->tee_dev, msg_out, msg_out_buf_size);
+ ret = pxp_tee_master->ops->receive(pxp_tee_master->tee_dev, msg_out, msg_out_buf_size, 1);
if (ret < 0) {
drm_err(&i915->drm, "Failed to receive TEE message\n");
return -EFAULT;
diff --git a/drivers/misc/mei/pxp/mei_pxp.c b/drivers/misc/mei/pxp/mei_pxp.c
index 5bd61fe445e3..55d4cb772367 100644
--- a/drivers/misc/mei/pxp/mei_pxp.c
+++ b/drivers/misc/mei/pxp/mei_pxp.c
@@ -27,10 +27,11 @@
* @dev: device corresponding to the mei_cl_device
* @message: a message buffer to send
* @size: size of the message
+ * @vtag: the vtag of the connection (use 0 for default)
* Return: 0 on Success, <0 on Failure
*/
static int
-mei_pxp_send_message(struct device *dev, const void *message, size_t size)
+mei_pxp_send_message(struct device *dev, const void *message, size_t size, u8 vtag)
{
struct mei_cl_device *cldev;
ssize_t byte;
@@ -41,7 +42,7 @@ mei_pxp_send_message(struct device *dev, const void *message, size_t size)
cldev = to_mei_cl_device(dev);
/* temporary drop const qualifier till the API is fixed */
- byte = mei_cldev_send(cldev, (u8 *)message, size);
+ byte = mei_cldev_send_vtag(cldev, (u8 *)message, size, vtag);
if (byte < 0) {
dev_dbg(dev, "mei_cldev_send failed. %zd\n", byte);
return byte;
@@ -55,10 +56,11 @@ mei_pxp_send_message(struct device *dev, const void *message, size_t size)
* @dev: device corresponding to the mei_cl_device
* @buffer: a message buffer to contain the received message
* @size: size of the buffer
+ * @vtag: the vtag of the connection (use 0 for default)
* Return: bytes sent on Success, <0 on Failure
*/
static int
-mei_pxp_receive_message(struct device *dev, void *buffer, size_t size)
+mei_pxp_receive_message(struct device *dev, void *buffer, size_t size, u8 vtag)
{
struct mei_cl_device *cldev;
ssize_t byte;
@@ -68,7 +70,7 @@ mei_pxp_receive_message(struct device *dev, void *buffer, size_t size)
cldev = to_mei_cl_device(dev);
- byte = mei_cldev_recv(cldev, buffer, size);
+ byte = mei_cldev_recv_vtag(cldev, buffer, size, &vtag);
if (byte < 0) {
dev_dbg(dev, "mei_cldev_recv failed. %zd\n", byte);
return byte;
diff --git a/include/drm/i915_pxp_tee_interface.h b/include/drm/i915_pxp_tee_interface.h
index 3999e255e145..cacde01058fc 100644
--- a/include/drm/i915_pxp_tee_interface.h
+++ b/include/drm/i915_pxp_tee_interface.h
@@ -24,8 +24,8 @@ struct i915_pxp_component_ops {
*/
struct module *owner;
- int (*send)(struct device *dev, const void *message, size_t size);
- int (*receive)(struct device *dev, void *buffer, size_t size);
+ int (*send)(struct device *dev, const void *message, size_t size, u8 vtag);
+ int (*receive)(struct device *dev, void *buffer, size_t size, u8 vtag);
};
/**
--
2.17.1
More information about the Intel-gfx
mailing list