usbip_protocol: add more trace logs

This commit is contained in:
h7x4 2023-12-26 16:22:50 +01:00
parent f9246c0f5e
commit e14e34eae7
No known key found for this signature in database
GPG key ID: 9F2F7D8250F35146

View file

@ -6,6 +6,7 @@
//!
//! They are based on the [Linux kernel documentation](https://docs.kernel.org/usb/usbip_protocol.html).
use log::trace;
use std::io::Result;
use tokio::io::{AsyncReadExt, AsyncWriteExt};
@ -143,6 +144,18 @@ impl UsbIpCommand {
));
}
trace!(
"Received command: {:#04X} ({}), parsing...",
command,
match command {
OP_REQ_DEVLIST => "OP_REQ_DEVLIST",
OP_REQ_IMPORT => "OP_REQ_IMPORT",
USBIP_CMD_SUBMIT => "USBIP_CMD_SUBMIT",
USBIP_CMD_UNLINK => "USBIP_CMD_UNLINK",
_ => "Unknown",
}
);
match command {
OP_REQ_DEVLIST => {
let status = socket.read_u32().await?;