qemu/hw
Hans de Goede 49cfa2fdc9 uas: Fix response iu struct definition
This patch mirrors a patch to the Linux uas kernel driver which I've just
submitted. It looks like the qemu uas struct definitions were taken from
the Linux kernel driver, and have inherited the same mistake.

Besides fixing the response iu struct, the patch also drops the add_info
parameter from the usb_uas_queue_response() function, it is always 0 anyways,
and expressing 3 zero-bytes as a function argument is a bit hard.

Below is the long explanation for this change taken from the kernel commit:

The response iu struct before this patch has a size of 7 bytes, which is weird
since all other iu-s are explictly padded to a multiple of 4 bytes.

Submitting a 7 byte bulk transfer to the status endpoint of a real uasp device
when expecting a response iu results in an USB babble error, as the device
actually sends 8 bytes.

Up on closer reading of the UAS spec:
http://www.t10.org/cgi-bin/ac.pl?t=f&f=uas2r00.pdf

The reason for this becomes clear, the 2 entries in "Table 17 — RESPONSE IU"
are numbered 4 and 6, looking at other iu definitions in the spec, esp.
multi-byte fields, this indicates that the ADDITIONAL RESPONSE INFORMATION
field is not a 2 byte field as one might assume at a first look, but is
a multi-byte field containing 3 bytes.

This also aligns with the SCSI Architecture Model 4 spec, which UAS is based
on which states in paragraph "7.1 Task management function procedure calls"
that the "Additional Response Information" output argument for a Task
management function procedure call is 3 bytes.

Last but not least I've verified this by sending a logical unit reset task
management call with an invalid lun to an actual uasp device, and received
back a response-iu with byte 6 being 0, and byte 7 being 9, which is the
responce code for an invalid iu, which confirms that the response code is
being reported in byte 7 of the response iu rather then in byte 6.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2013-11-26 09:21:17 +01:00
..
9pfs hw/9pfs: Fix errno value for xattr functions 2013-10-05 13:05:28 +04:00
acpi bswap.h: Remove le16_to_cpupu() 2013-11-05 19:57:46 -08:00
alpha hw/alpha: Fix compiler warning (integer constant is too large) 2013-10-02 22:55:28 +04:00
arm armv7m: Don't enforce use of kernel for qtest 2013-11-05 17:47:29 +01:00
audio pci, pc, acpi fixes, enhancements 2013-10-31 16:58:32 +01:00
block bswap.h: Remove cpu_to_be32wu() 2013-11-05 19:57:47 -08:00
bt Preparation for usb-bt-dongle conditional build 2013-09-10 11:14:41 +02:00
char spapr: add vio-bus devices to categories 2013-11-08 04:33:18 +01:00
core qdev-properties-system.c: Allow vlan or netdev for -device, not both 2013-11-22 09:47:00 +01:00
cpu arm11mpcore: Split off RealView MPCore 2013-11-05 17:47:30 +01:00
cris axis_dev88: Don't enforce use of kernel for qtest 2013-11-05 17:47:29 +01:00
display sun4m: Add FCode ROM for TCX framebuffer 2013-11-21 17:38:52 +01:00
dma qom: Pass available size to object_initialize() 2013-08-30 21:15:44 +02:00
gpio gpio/zaurus: QOM cast cleanup 2013-07-29 21:06:57 +02:00
i2c exynos4210_i2c: QOM cast cleanup 2013-07-29 21:07:02 +02:00
i386 acpi-build: fix support for glib < 2.22 2013-11-25 20:35:08 -08:00
ide bswap.h: Remove cpu_to_be16wu() 2013-11-05 19:57:47 -08:00
input aio / timers: Switch entire codebase to the new timer API 2013-08-22 19:14:24 +02:00
intc realview_gic: Prepare for QOM embedding 2013-11-05 17:47:30 +01:00
isa ich9: APIs for pc guest info 2013-10-14 17:48:52 +03:00
lm32 milkymist: Suppress -kernel/-bios/-drive error for qtest 2013-11-05 17:47:29 +01:00
m68k an5206: Don't enforce use of kernel for qtest 2013-11-05 17:47:29 +01:00
microblaze hw/microblaze: Add support for loading initrd images 2013-10-24 22:56:48 +02:00
mips mips jazz: do not raise data bus exception when accessing invalid addresses 2013-11-21 17:39:22 +01:00
misc vfio-pci: Fix multifunction=on 2013-11-21 17:39:04 +01:00
moxie memory: add owner argument to initialization functions 2013-07-04 17:42:44 +02:00
net Revert "e1000/rtl8139: update HMP NIC when every bit is written" 2013-11-21 16:28:27 +02:00
nvram spapr: add vio-bus devices to categories 2013-11-08 04:33:18 +01:00
openrisc openrisc-timer: Reduce overhead, Separate clock update functions 2013-11-20 21:46:45 +08:00
pci pci: unregister vmstate_pcibus on unplug 2013-11-21 16:25:08 +02:00
pci-bridge hw/pci-bridge: set PCI_INTERRUPT_PIN register before shpc init 2013-10-14 17:11:45 +03:00
pci-host Fix pc migration from qemu <= 1.5 2013-11-10 12:08:37 +02:00
pcmcia pcmcia/pxa2xx: QOM'ify PXA2xxPCMCIAState 2013-11-05 18:06:52 +01:00
ppc PPC: BookE: Make FIT/WDT timers at best millisecond grained 2013-11-25 20:35:12 -08:00
s390x s390x: fix flat file load on 32 bit systems 2013-11-21 07:55:10 -08:00
scsi scsi: Add 2 new sense codes needed by uas 2013-11-26 09:21:17 +01:00
sd sd: Avoid access to NULL BlockDriverState 2013-10-17 10:15:18 +02:00
sh4 shix: Don't require firmware presence for qtest 2013-11-05 17:47:29 +01:00
sparc sun4m: Add FCode ROM for TCX framebuffer 2013-11-21 17:38:52 +01:00
sparc64 pc,pci,virtio fixes and cleanups 2013-09-03 12:31:07 -05:00
ssi xilinx_spi: QOM cast cleanup 2013-07-29 21:07:01 +02:00
timer rtc: remove dead SQW IRQ code 2013-11-05 20:04:03 -08:00
tpm aio / timers: Untangle include files 2013-08-22 19:10:27 +02:00
unicore32 puv3: Turn puv3_load_kernel() into a no-op for qtest without -kernel 2013-11-05 17:47:28 +01:00
usb uas: Fix response iu struct definition 2013-11-26 09:21:17 +01:00
virtio virtio-rng: add check of period 2013-11-21 07:55:26 -08:00
watchdog aio / timers: Switch entire codebase to the new timer API 2013-08-22 19:14:24 +02:00
xen qdev: Drop misleading qdev_free() function 2013-11-05 18:06:38 +01:00
xtensa pc,pci,virtio fixes and cleanups 2013-09-03 12:31:07 -05:00
Makefile.objs pcmcia: QOM'ify PCMCIACardState and MicroDriveState 2013-11-05 18:06:52 +01:00