From e14e34eae7e4946a04bb4b154bde4dc3563916e6 Mon Sep 17 00:00:00 2001 From: h7x4 Date: Tue, 26 Dec 2023 16:22:50 +0100 Subject: [PATCH] usbip_protocol: add more trace logs --- src/usbip_protocol.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/usbip_protocol.rs b/src/usbip_protocol.rs index 3670fee..87a11ac 100644 --- a/src/usbip_protocol.rs +++ b/src/usbip_protocol.rs @@ -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?;