Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 322712
b: refs/heads/master
c: 3b9c1c5
h: refs/heads/master
v: v3
  • Loading branch information
Sebastian Andrzej Siewior authored and Felipe Balbi committed Sep 6, 2012
1 parent 5933281 commit b92b435
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 1b68a4ca2d038addb7314211d122fb6d7002b38b
refs/heads/master: 3b9c1c5ba7a95caae8440ea47308496b14f7301a
33 changes: 33 additions & 0 deletions trunk/drivers/usb/gadget/dummy_hcd.c
Original file line number Diff line number Diff line change
Expand Up @@ -1916,6 +1916,27 @@ static int dummy_hub_status(struct usb_hcd *hcd, char *buf)
return retval;
}

/* usb 3.0 root hub device descriptor */
struct {
struct usb_bos_descriptor bos;
struct usb_ss_cap_descriptor ss_cap;
} __packed usb3_bos_desc = {

.bos = {
.bLength = USB_DT_BOS_SIZE,
.bDescriptorType = USB_DT_BOS,
.wTotalLength = cpu_to_le16(sizeof(usb3_bos_desc)),
.bNumDeviceCaps = 1,
},
.ss_cap = {
.bLength = USB_DT_USB_SS_CAP_SIZE,
.bDescriptorType = USB_DT_DEVICE_CAPABILITY,
.bDevCapabilityType = USB_SS_CAP_TYPE,
.wSpeedSupported = cpu_to_le16(USB_5GBPS_OPERATION),
.bFunctionalitySupport = ilog2(USB_5GBPS_OPERATION),
},
};

static inline void
ss_hub_descriptor(struct usb_hub_descriptor *desc)
{
Expand Down Expand Up @@ -2006,6 +2027,18 @@ static int dummy_hub_control(
else
hub_descriptor((struct usb_hub_descriptor *) buf);
break;

case DeviceRequest | USB_REQ_GET_DESCRIPTOR:
if (hcd->speed != HCD_USB3)
goto error;

if ((wValue >> 8) != USB_DT_BOS)
goto error;

memcpy(buf, &usb3_bos_desc, sizeof(usb3_bos_desc));
retval = sizeof(usb3_bos_desc);
break;

case GetHubStatus:
*(__le32 *) buf = cpu_to_le32(0);
break;
Expand Down

0 comments on commit b92b435

Please sign in to comment.