From 2e8f72acb0e948566c129d3e819cd77b9a8789ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Date: Wed, 20 Jan 2021 16:35:21 +0100 Subject: scsi/utils: Add INVALID_PARAM_VALUE sense code definition MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reviewed-by: Eric Blake Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20210120153522.1173897-3-philmd@redhat.com> Signed-off-by: Gerd Hoffmann --- include/scsi/utils.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') diff --git a/include/scsi/utils.h b/include/scsi/utils.h index fbc5588..096489c 100644 --- a/include/scsi/utils.h +++ b/include/scsi/utils.h @@ -57,6 +57,8 @@ extern const struct SCSISense sense_code_LBA_OUT_OF_RANGE; extern const struct SCSISense sense_code_INVALID_FIELD; /* Illegal request, Invalid field in parameter list */ extern const struct SCSISense sense_code_INVALID_PARAM; +/* Illegal request, Invalid value in parameter list */ +extern const struct SCSISense sense_code_INVALID_PARAM_VALUE; /* Illegal request, Parameter list length error */ extern const struct SCSISense sense_code_INVALID_PARAM_LEN; /* Illegal request, LUN not supported */ -- cgit v1.1 From 0f6dba145a4be998e0e5e4ccd94d9df8609eb327 Mon Sep 17 00:00:00 2001 From: Gerd Hoffmann Date: Tue, 19 Jan 2021 20:44:51 +0100 Subject: usb: add pcap support. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Log all traffic of a specific usb device to a pcap file for later inspection. File format is compatible with linux usb monitor. Usage: qemu -device usb-${somedevice},pcap=file.pcap wireshark file.pcap Signed-off-by: Gerd Hoffmann Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20210119194452.2148048-1-kraxel@redhat.com> Signed-off-by: Gerd Hoffmann --- include/hw/usb.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'include') diff --git a/include/hw/usb.h b/include/hw/usb.h index a70a72e..abfbfc5 100644 --- a/include/hw/usb.h +++ b/include/hw/usb.h @@ -231,6 +231,9 @@ struct USBDevice { void *opaque; uint32_t flags; + char *pcap_filename; + FILE *pcap; + /* Actual connected speed */ int speed; /* Supported speeds, not in info because it may be variable (hostdevs) */ @@ -570,4 +573,9 @@ int usb_get_quirks(uint16_t vendor_id, uint16_t product_id, uint8_t interface_class, uint8_t interface_subclass, uint8_t interface_protocol); +/* pcap.c */ +void usb_pcap_init(FILE *fp); +void usb_pcap_ctrl(USBPacket *p, bool setup); +void usb_pcap_data(USBPacket *p, bool setup); + #endif -- cgit v1.1