diff options
author | Jules Maselbas <jmaselbas@kalray.eu> | 2020-03-26 19:33:04 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2020-03-31 07:12:46 +0200 |
commit | 2d466d2f7380ee036e3e49a1a0229b6097ca620c (patch) | |
tree | 1d2b7aa7785c8be59dd023d3941aee5e56333380 /drivers/usb/gadget/dfu.c | |
parent | 368b2c6b069e2775a1fbe39afbad3ac44f24c5b3 (diff) | |
download | barebox-2d466d2f7380ee036e3e49a1a0229b6097ca620c.tar.gz barebox-2d466d2f7380ee036e3e49a1a0229b6097ca620c.tar.xz |
usb: gadget: dfu: Fix DFU mode interface descriptor
The gadget driver set the bInterfaceProtocol value to 1 in the DFU
interface descriptor. However this value is used to indicate that the
gadget is in run-time mode and not ready for DFU. When ready for DFU
operation the bInterfaceProtocol value must be set to 2 (DFU mode).
From the DFU 1.1 specification, the value of bInterfaceProtocol select:
- 1: Runtime protocol (see Table 4.1)
- 2: DFU mode protocol (see Table 4.4)
This patch change the bInterfaceProtocol value from 1 to 2. As this
DFU gadget driver is always ready for DFU operation (DFU mode) and
doesn't require a USB reset.
Signed-off-by: Jules Maselbas <jmaselbas@kalray.eu>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers/usb/gadget/dfu.c')
-rw-r--r-- | drivers/usb/gadget/dfu.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/usb/gadget/dfu.c b/drivers/usb/gadget/dfu.c index 225c6e3c6e..9117a5b063 100644 --- a/drivers/usb/gadget/dfu.c +++ b/drivers/usb/gadget/dfu.c @@ -239,7 +239,7 @@ dfu_bind(struct usb_configuration *c, struct usb_function *f) desc[i].bNumEndpoints = 0; desc[i].bInterfaceClass = 0xfe; desc[i].bInterfaceSubClass = 1; - desc[i].bInterfaceProtocol = 1; + desc[i].bInterfaceProtocol = 2; desc[i].bAlternateSetting = i; desc[i].iInterface = us[i + 1].id; header[i] = (struct usb_descriptor_header *)&desc[i]; |