[svn-commits] tzafrir: tools/trunk r6054 - /tools/trunk/xpp/fpga_load.c
SVN commits to the Digium repositories
svn-commits at lists.digium.com
Sun Mar 1 08:19:37 CST 2009
Author: tzafrir
Date: Sun Mar 1 08:19:27 2009
New Revision: 6054
URL: http://svn.digium.com/svn-view/dahdi?view=rev&rev=6054
Log:
fpga_load.c: Flush USB device buffer on startup.
Fixes some firmware loading issues.
Modified:
tools/trunk/xpp/fpga_load.c
Modified: tools/trunk/xpp/fpga_load.c
URL: http://svn.digium.com/svn-view/dahdi/tools/trunk/xpp/fpga_load.c?view=diff&rev=6054&r1=6053&r2=6054
==============================================================================
--- tools/trunk/xpp/fpga_load.c (original)
+++ tools/trunk/xpp/fpga_load.c Sun Mar 1 08:19:27 2009
@@ -360,6 +360,23 @@
return ret;
}
+int flush_read(struct my_usb_device *mydev)
+{
+ char tmpbuf[BUFSIZ];
+ int ret;
+
+ memset(tmpbuf, 0, BUFSIZ);
+ ret = recv_usb("flush_read", mydev, tmpbuf, sizeof(tmpbuf), TIMEOUT);
+ if(ret < 0 && ret != -ETIMEDOUT) {
+ ERR("ret=%d\n", ret);
+ return ret;
+ } else if(ret > 0) {
+ DBG("Got %d bytes:\n", ret);
+ dump_packet(__FUNCTION__, tmpbuf, ret);
+ }
+ return 0;
+}
+
#ifdef XORCOM_INTERNAL
int eeprom_set(struct my_usb_device *mydev, const struct myeeprom *eeprom)
{
@@ -636,6 +653,10 @@
}
if(usb_clear_halt(mydev->handle, mydev->my_ep_in) != 0) {
ERR("Clearing input endpoint: %s\n", usb_strerror());
+ return 0;
+ }
+ if(flush_read(mydev) < 0) {
+ ERR("flush_read failed\n");
return 0;
}
return 1;
More information about the svn-commits
mailing list