diff options
| author | Peter Maydell <peter.maydell@linaro.org> | 2021-01-23 14:40:45 +0000 |
|---|---|---|
| committer | Peter Maydell <peter.maydell@linaro.org> | 2021-01-23 14:40:45 +0000 |
| commit | e93c65a6c64fa18b0c61fb9338d364cbea32b6ef (patch) | |
| tree | 5f1c30bca7461c74fdb80ae941adae550aea8d1b /hw/usb/dev-uas.c | |
| parent | 0e32462630687a18039464511bd0447ada5709c3 (diff) | |
| parent | 2980a316734c420e7398aec026909dcfc8614c1d (diff) | |
| download | focaccia-qemu-e93c65a6c64fa18b0c61fb9338d364cbea32b6ef.tar.gz focaccia-qemu-e93c65a6c64fa18b0c61fb9338d364cbea32b6ef.zip | |
Merge remote-tracking branch 'remotes/kraxel/tags/usb-20210122-pull-request' into staging
usb: cleanups and fixes. usb: add pcap support. # gpg: Signature made Fri 22 Jan 2021 17:48:35 GMT # gpg: using RSA key A0328CFFB93A17A79901FE7D4CB6D8EED3E87138 # gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>" [full] # gpg: aka "Gerd Hoffmann <gerd@kraxel.org>" [full] # gpg: aka "Gerd Hoffmann (private) <kraxel@gmail.com>" [full] # Primary key fingerprint: A032 8CFF B93A 17A7 9901 FE7D 4CB6 D8EE D3E8 7138 * remotes/kraxel/tags/usb-20210122-pull-request: usb-host: map LIBUSB_SPEED_SUPER_PLUS to USB_SPEED_SUPER usb: add pcap support. hw/usb/dev-uas: Report command additional adb length as unsupported scsi/utils: Add INVALID_PARAM_VALUE sense code definition hw/usb/hcd-xhci: Fix extraneous format-truncation error on 32-bit hosts hw/usb: Convert to qdev_realize() hw/usb: Fix bad printf format specifiers hw/usb/host-libusb.c: fix build with kernel < 5.0 Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'hw/usb/dev-uas.c')
| -rw-r--r-- | hw/usb/dev-uas.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/hw/usb/dev-uas.c b/hw/usb/dev-uas.c index cec071d96c..a51402bc0b 100644 --- a/hw/usb/dev-uas.c +++ b/hw/usb/dev-uas.c @@ -16,6 +16,7 @@ #include "qemu/error-report.h" #include "qemu/main-loop.h" #include "qemu/module.h" +#include "qemu/log.h" #include "hw/usb.h" #include "migration/vmstate.h" @@ -70,7 +71,7 @@ typedef struct { uint8_t reserved_2; uint64_t lun; uint8_t cdb[16]; - uint8_t add_cdb[]; + uint8_t add_cdb[1]; /* not supported by QEMU */ } QEMU_PACKED uas_iu_command; typedef struct { @@ -700,6 +701,11 @@ static void usb_uas_command(UASDevice *uas, uas_iu *iu) uint32_t len; uint16_t tag = be16_to_cpu(iu->hdr.tag); + if (iu->command.add_cdb_length > 0) { + qemu_log_mask(LOG_UNIMP, "additional adb length not yet supported\n"); + goto unsupported_len; + } + if (uas_using_streams(uas) && tag > UAS_MAX_STREAMS) { goto invalid_tag; } @@ -735,6 +741,10 @@ static void usb_uas_command(UASDevice *uas, uas_iu *iu) } return; +unsupported_len: + usb_uas_queue_fake_sense(uas, tag, sense_code_INVALID_PARAM_VALUE); + return; + invalid_tag: usb_uas_queue_fake_sense(uas, tag, sense_code_INVALID_TAG); return; |