summaryrefslogtreecommitdiff
path: root/firmware
diff options
context:
space:
mode:
authorlaforge <laforge@6dc7ffe9-61d6-0310-9af1-9938baff3ed1>2008-02-17 16:14:00 +0000
committerlaforge <laforge@6dc7ffe9-61d6-0310-9af1-9938baff3ed1>2008-02-17 16:14:00 +0000
commitdde2f8e09c773518c3a538afe6075a53a8fdacf7 (patch)
treeced698d7eb228a5e26dbe91bf3bb4bb7b1cf7dd6 /firmware
parent934b8453e69d64c9b8db34c3fa73583c84fae997 (diff)
allow GETSTATE and GETSTATUS requests in MANIFEST state (compatibility with dfu-util)
git-svn-id: https://svn.openpcd.org:2342/trunk@413 6dc7ffe9-61d6-0310-9af1-9938baff3ed1
Diffstat (limited to 'firmware')
-rw-r--r--firmware/src/dfu/dfu.c22
1 files changed, 19 insertions, 3 deletions
diff --git a/firmware/src/dfu/dfu.c b/firmware/src/dfu/dfu.c
index 07b7401..f740800 100644
--- a/firmware/src/dfu/dfu.c
+++ b/firmware/src/dfu/dfu.c
@@ -474,8 +474,19 @@ int __dfufunc dfu_ep0_handler(u_int8_t req_type, u_int8_t req,
}
break;
case DFU_STATE_dfuMANIFEST:
- dfu_state = DFU_STATE_dfuERROR;
- ret = RET_STALL;
+ switch (req) {
+ case USB_REQ_DFU_GETSTATUS:
+ dfu_state = DFU_STATE_dfuIDLE;
+ handle_getstatus();
+ break;
+ case USB_REQ_DFU_GETSTATE:
+ handle_getstate();
+ break;
+ default:
+ dfu_state = DFU_STATE_dfuERROR;
+ ret = RET_STALL;
+ break;
+ }
break;
case DFU_STATE_dfuMANIFEST_WAIT_RST:
/* we should never go here */
@@ -557,8 +568,13 @@ __dfustruct const struct usb_device_descriptor dfu_dev_descriptor = {
.idVendor = USB_VENDOR_ID,
.idProduct = USB_PRODUCT_ID,
.bcdDevice = 0x0000,
+#ifdef CONFIG_USB_STRING
.iManufacturer = 1,
.iProduct = 2,
+#else
+ .iManufacturer = 0,
+ .iProduct = 0,
+#endif
.iSerialNumber = 0x00,
.bNumConfigurations = 0x01,
};
@@ -876,7 +892,7 @@ void __dfufunc dfu_main(void)
AT91F_DBGU_Init();
AT91F_DBGU_Printk("\n\r\n\rsam7dfu - AT91SAM7 USB DFU bootloader\n\r"
- "(C) 2006 by Harald Welte <hwelte@hmw-consulting.de>\n\r"
+ "(C) 2006-2008 by Harald Welte <hwelte@hmw-consulting.de>\n\r"
"This software is FREE SOFTWARE licensed under GNU GPL\n\r");
AT91F_DBGU_Printk("Version " COMPILE_SVNREV
" compiled " COMPILE_DATE
personal git repositories of Harald Welte. Your mileage may vary