Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 133531
b: refs/heads/master
c: 6da9c99
h: refs/heads/master
i:
  133529: b27c6f6
  133527: 2a05886
v: v3
  • Loading branch information
David Vrabel authored and Greg Kroah-Hartman committed Mar 24, 2009
1 parent ce2c3b8 commit 11d1610
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 4 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: 4246b06a33ebdd6593dccaab3aa01eb0c9f8c1c8
refs/heads/master: 6da9c99059bf24fb1faae6b9613bae64ea50c05e
3 changes: 2 additions & 1 deletion trunk/drivers/usb/core/devio.c
Original file line number Diff line number Diff line change
Expand Up @@ -525,7 +525,8 @@ static int check_ctrlrecip(struct dev_state *ps, unsigned int requesttype,
{
int ret = 0;

if (ps->dev->state != USB_STATE_ADDRESS
if (ps->dev->state != USB_STATE_UNAUTHENTICATED
&& ps->dev->state != USB_STATE_ADDRESS
&& ps->dev->state != USB_STATE_CONFIGURED)
return -EHOSTUNREACH;
if (USB_TYPE_VENDOR == (USB_TYPE_MASK & requesttype))
Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/usb/core/hub.c
Original file line number Diff line number Diff line change
Expand Up @@ -1305,6 +1305,7 @@ void usb_set_device_state(struct usb_device *udev,
recursively_mark_NOTATTACHED(udev);
spin_unlock_irqrestore(&device_state_lock, flags);
}
EXPORT_SYMBOL_GPL(usb_set_device_state);

/*
* WUSB devices are simple: they have no hubs behind, so the mapping
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/usb/core/urb.c
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ int usb_submit_urb(struct urb *urb, gfp_t mem_flags)
if (!urb || urb->hcpriv || !urb->complete)
return -EINVAL;
dev = urb->dev;
if ((!dev) || (dev->state < USB_STATE_DEFAULT))
if ((!dev) || (dev->state < USB_STATE_UNAUTHENTICATED))
return -ENODEV;

/* For now, get the endpoint from the pipe. Eventually drivers
Expand Down
2 changes: 2 additions & 0 deletions trunk/drivers/usb/wusbcore/devconnect.c
Original file line number Diff line number Diff line change
Expand Up @@ -889,6 +889,8 @@ static void wusb_dev_add_ncb(struct usb_device *usb_dev)
if (usb_dev->wusb == 0 || usb_dev->devnum == 1)
return; /* skip non wusb and wusb RHs */

usb_set_device_state(usb_dev, USB_STATE_UNAUTHENTICATED);

wusbhc = wusbhc_get_by_usb_dev(usb_dev);
if (wusbhc == NULL)
goto error_nodev;
Expand Down
2 changes: 2 additions & 0 deletions trunk/drivers/usb/wusbcore/security.c
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,7 @@ int wusb_dev_update_address(struct wusbhc *wusbhc, struct wusb_dev *wusb_dev)
result = wusb_set_dev_addr(wusbhc, wusb_dev, 0);
if (result < 0)
goto error_addr0;
usb_set_device_state(usb_dev, USB_STATE_DEFAULT);
usb_ep0_reinit(usb_dev);

/* Set new (authenticated) address. */
Expand All @@ -327,6 +328,7 @@ int wusb_dev_update_address(struct wusbhc *wusbhc, struct wusb_dev *wusb_dev)
result = wusb_set_dev_addr(wusbhc, wusb_dev, new_address);
if (result < 0)
goto error_addr;
usb_set_device_state(usb_dev, USB_STATE_ADDRESS);
usb_ep0_reinit(usb_dev);
usb_dev->authenticated = 1;
error_addr:
Expand Down
2 changes: 1 addition & 1 deletion trunk/include/linux/usb/ch9.h
Original file line number Diff line number Diff line change
Expand Up @@ -763,8 +763,8 @@ enum usb_device_state {
/* chapter 9 and authentication (wireless) device states */
USB_STATE_ATTACHED,
USB_STATE_POWERED, /* wired */
USB_STATE_UNAUTHENTICATED, /* auth */
USB_STATE_RECONNECTING, /* auth */
USB_STATE_UNAUTHENTICATED, /* auth */
USB_STATE_DEFAULT, /* limited function */
USB_STATE_ADDRESS,
USB_STATE_CONFIGURED, /* most functions */
Expand Down

0 comments on commit 11d1610

Please sign in to comment.