Skip to contentSkip to conversation

usbcore: fix check_ctrlrecip to allow control transfers in state ADDRESS

PATCH New Horst Schirmeier 1 participant 1 message Mar 11, 2006 USB

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 usbcore: fix check_ctrlrecip to allow control transfers in state ADDRESS

check_ctrlrecip() disallows any control transfers if the device is deconfigured (in configuration 0, ie. state ADDRESS). This for example makes it impossible to read the device descriptors without configuring the device, although most standard device requests are allowed in this state by the spec. This patch allows control transfers for the ADDRESS state, too.

---

drivers/usb/core/devio.c +2 -1
index 2b68998..3461476 100644
@@ -498,7 +498,8 @@ static int check_ctrlrecip(struct dev_st
 {
 	int ret = 0;
 
-	if (ps->dev->state != USB_STATE_CONFIGURED)
+	if (ps->dev->state != USB_STATE_ADDRESS
+	 && ps->dev->state != USB_STATE_CONFIGURED)
 		return -EHOSTUNREACH;
 	if (USB_TYPE_VENDOR == (USB_TYPE_MASK & requesttype))
 		return 0;