mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2025-01-13 01:26:32 +07:00
greybus: loopback: add response len to loopback protocol
This patch adds a len field to the loopback protocol. This field is validated in gb_loopback_transfer() and stuffed in gb_loopback_request_recv(). Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org> Reviewed-by: Patrick Titiano <ptitiano@baylibre.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
This commit is contained in:
parent
f2cfa70439
commit
4a655ad4c2
@ -917,6 +917,7 @@ struct gb_loopback_transfer_request {
|
||||
} __packed;
|
||||
|
||||
struct gb_loopback_transfer_response {
|
||||
__le32 len;
|
||||
__u8 data[0];
|
||||
} __packed;
|
||||
|
||||
|
@ -524,6 +524,7 @@ static int gb_loopback_request_recv(u8 type, struct gb_operation *operation)
|
||||
return -ENOMEM;
|
||||
}
|
||||
response = operation->response->payload;
|
||||
response->len = cpu_to_le32(len);
|
||||
memcpy(response->data, request->data, len);
|
||||
}
|
||||
return 0;
|
||||
|
Loading…
Reference in New Issue
Block a user