usb: class specific interface requests

Mass Storage Reset and Get Max LUN are class specific requests, but
they were not marked as such in hw/usb-msd.c, moved therefore
ClassInterfaceRequest and ClassInterfaceOutRequest from hw/usb-net.c
to hw/usb.h.
Furthermore there was a problem in hw/usb-ohci.c when using DEBUG
concerning systems where size_t is a 32 bit integer (printf resulted
in a segmentation fault).

Signed-off-by: Max Reitz <max@tyndur.org>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
This commit is contained in:
Max Reitz 2010-03-14 12:19:03 +01:00 committed by Anthony Liguori
parent 1c47cb1651
commit f3571b1a5b
4 changed files with 7 additions and 10 deletions

View file

@ -327,14 +327,12 @@ static int usb_msd_handle_control(USBDevice *dev, int request, int value,
ret = 0;
break;
/* Class specific requests. */
case (((USB_DIR_OUT | USB_TYPE_CLASS | USB_RECIP_INTERFACE) << 8) | MassStorageReset):
case MassStorageReset:
case ClassInterfaceOutRequest | MassStorageReset:
/* Reset state ready for the next CBW. */
s->mode = USB_MSDM_CBW;
ret = 0;
break;
case (((USB_DIR_IN | USB_TYPE_CLASS | USB_RECIP_INTERFACE) << 8) | GetMaxLun):
case GetMaxLun:
case ClassInterfaceRequest | GetMaxLun:
data[0] = 0;
ret = 1;
break;