[U-Boot] [REFERENCE DON'T APPLY 1/3] dfu: Add default value for bwPollTimeout
Stefan Schmidt
stefan at datenfreihafen.org
Tue Apr 3 17:04:55 CEST 2012
---
drivers/usb/gadget/dfu.c | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/drivers/usb/gadget/dfu.c b/drivers/usb/gadget/dfu.c
index 535e194..7aed344 100644
--- a/drivers/usb/gadget/dfu.c
+++ b/drivers/usb/gadget/dfu.c
@@ -47,6 +47,10 @@
#include <malloc.h>
#include "dfu.h"
+#ifndef POLL_TIMEOUT_MILLISECONDS
+#define POLL_TIMEOUT_MILLISECONDS 5
+#endif
+
static struct flash_entity *flash_ents;
static int num_flash_ents;
@@ -271,9 +275,14 @@ static void handle_getstatus(struct usb_request *req)
/* send status response */
dstat->bStatus = dev->dfu_status;
- /* FIXME: set dstat->bwPollTimeout */
dstat->bState = dev->dfu_state;
dstat->iString = 0;
+ /* FIXME: Use real values from flash subsystem here instead a hardcoded
+ * value */
+ dstat->bwPollTimeout[0] = POLL_TIMEOUT_MILLISECONDS & 0xff;
+ dstat->bwPollTimeout[1] = (POLL_TIMEOUT_MILLISECONDS >> 8) & 0xff;
+ dstat->bwPollTimeout[2] = (POLL_TIMEOUT_MILLISECONDS >> 16) & 0xff;
+ //req->actual = MIN(sizeof(*dstat), max);
}
static void handle_getstate(struct usb_request *req)
--
1.7.9.5
More information about the U-Boot
mailing list