usb: gadget: add bos descriptor response for rockusb command
Rockchip upgrade tool use bcdUSB (0x0201) field distinguishing maskrom or loader device at present. Unfortunately, it conflict with Windows 8 and beyond which request BOS descriptor in this case that bcdUSB is set to 0x0201. This patch adds the HACK codes to fix it. Change-Id: I6a186139f79ba27f5d9e099493e9e742a29bbe40 Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
This commit is contained in:
parent
ba437c8c98
commit
8ddd5824c5
|
|
@ -271,6 +271,18 @@ static int count_configs(struct usb_composite_dev *cdev, unsigned type)
|
||||||
return count;
|
return count;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int bos_desc(struct usb_composite_dev *cdev)
|
||||||
|
{
|
||||||
|
struct usb_bos_descriptor *bos = cdev->req->buf;
|
||||||
|
|
||||||
|
bos->bLength = USB_DT_BOS_SIZE;
|
||||||
|
bos->bDescriptorType = USB_DT_BOS;
|
||||||
|
bos->wTotalLength = cpu_to_le16(USB_DT_BOS_SIZE);
|
||||||
|
bos->bNumDeviceCaps = 0;
|
||||||
|
|
||||||
|
return le16_to_cpu(bos->wTotalLength);
|
||||||
|
}
|
||||||
|
|
||||||
static void device_qual(struct usb_composite_dev *cdev)
|
static void device_qual(struct usb_composite_dev *cdev)
|
||||||
{
|
{
|
||||||
struct usb_qualifier_descriptor *qual = cdev->req->buf;
|
struct usb_qualifier_descriptor *qual = cdev->req->buf;
|
||||||
|
|
@ -764,6 +776,18 @@ composite_setup(struct usb_gadget *gadget, const struct usb_ctrlrequest *ctrl)
|
||||||
value = min(w_length, (u16) value);
|
value = min(w_length, (u16) value);
|
||||||
break;
|
break;
|
||||||
case USB_DT_BOS:
|
case USB_DT_BOS:
|
||||||
|
/* HACK: only for rockusb command.
|
||||||
|
* Rockchip upgrade tool use bcdUSB (0x0201) field
|
||||||
|
* distinguishing maskrom or loader device at present.
|
||||||
|
* Unfortunately, it conflict with Windows 8 and beyond
|
||||||
|
* which request BOS descriptor in this case that bcdUSB
|
||||||
|
* is set to 0x0201.
|
||||||
|
*/
|
||||||
|
if (!strncmp(cdev->driver->name, "rkusb_ums_dnl", 13)) {
|
||||||
|
value = bos_desc(cdev);
|
||||||
|
value = min(w_length, (u16) value);
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The USB compliance test (USB 2.0 Command Verifier)
|
* The USB compliance test (USB 2.0 Command Verifier)
|
||||||
* issues this request. We should not run into the
|
* issues this request. We should not run into the
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue