Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 3679
b: refs/heads/master
c: 5742b0c
h: refs/heads/master
i:
  3677: 7b80bf9
  3675: 1a875f1
  3671: 16fb0f0
  3663: 8080128
  3647: e2b820f
v: v3
  • Loading branch information
Alan Stern authored and Greg Kroah-Hartman committed Jun 27, 2005
1 parent f748f5e commit f2fc85c
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 65111084c63d7674dc37833e8eb59cfdaa4d0bda
refs/heads/master: 5742b0c95026c817d9c266174ca39a909e8d38ca
30 changes: 28 additions & 2 deletions trunk/drivers/usb/gadget/dummy_hcd.c
Original file line number Diff line number Diff line change
Expand Up @@ -601,8 +601,10 @@ static int dummy_wakeup (struct usb_gadget *_gadget)
struct dummy *dum;

dum = gadget_to_dummy (_gadget);
if ((dum->devstatus & (1 << USB_DEVICE_REMOTE_WAKEUP)) == 0
|| !(dum->port_status & (1 << USB_PORT_FEAT_SUSPEND)))
if (!(dum->port_status & (1 << USB_PORT_FEAT_SUSPEND))
|| !(dum->devstatus &
( (1 << USB_DEVICE_B_HNP_ENABLE)
| (1 << USB_DEVICE_REMOTE_WAKEUP))))
return -EINVAL;

/* hub notices our request, issues downstream resume, etc */
Expand Down Expand Up @@ -713,6 +715,9 @@ usb_gadget_register_driver (struct usb_gadget_driver *driver)
dum->gadget.ops = &dummy_ops;
dum->gadget.is_dualspeed = 1;

/* maybe claim OTG support, though we won't complete HNP */
dum->gadget.is_otg = (dummy_to_hcd(dum)->self.otg_port != 0);

dum->devstatus = 0;
dum->resuming = 0;

Expand Down Expand Up @@ -1215,6 +1220,16 @@ static void dummy_timer (unsigned long _dum)
switch (setup.wValue) {
case USB_DEVICE_REMOTE_WAKEUP:
break;
case USB_DEVICE_B_HNP_ENABLE:
dum->gadget.b_hnp_enable = 1;
break;
case USB_DEVICE_A_HNP_SUPPORT:
dum->gadget.a_hnp_support = 1;
break;
case USB_DEVICE_A_ALT_HNP_SUPPORT:
dum->gadget.a_alt_hnp_support
= 1;
break;
default:
value = -EOPNOTSUPP;
}
Expand Down Expand Up @@ -1533,6 +1548,13 @@ static int dummy_hub_control (
spin_unlock (&dum->lock);
dum->driver->suspend (&dum->gadget);
spin_lock (&dum->lock);
/* HNP would happen here; for now we
* assume b_bus_req is always true.
*/
if (((1 << USB_DEVICE_B_HNP_ENABLE)
& dum->devstatus) != 0)
dev_dbg (dummy_dev(dum),
"no HNP yet!\n");
}
}
break;
Expand Down Expand Up @@ -1648,6 +1670,10 @@ static int dummy_start (struct usb_hcd *hcd)
hcd->power_budget = 8;
hcd->state = HC_STATE_RUNNING;

#ifdef CONFIG_USB_OTG
hcd->self.otg_port = 1;
#endif

/* FIXME 'urbs' should be a per-device thing, maybe in usbcore */
device_create_file (dummy_dev(dum), &dev_attr_urbs);
return 0;
Expand Down

0 comments on commit f2fc85c

Please sign in to comment.