r1546 - developers/werner
werner at sita.openmoko.org
werner at sita.openmoko.org
Thu Mar 29 07:18:55 CEST 2007
Author: werner
Date: 2007-03-29 07:18:32 +0200 (Thu, 29 Mar 2007)
New Revision: 1546
Added:
developers/werner/libftdi-c56-strings-dirty-hack.patch
Log:
Partial fix (strings only) for
http://bugzilla.openmoko.org/cgi-bin/bugzilla/show_bug.cgi?id=321
Added: developers/werner/libftdi-c56-strings-dirty-hack.patch
===================================================================
--- developers/werner/libftdi-c56-strings-dirty-hack.patch 2007-03-29 03:55:51 UTC (rev 1545)
+++ developers/werner/libftdi-c56-strings-dirty-hack.patch 2007-03-29 05:18:32 UTC (rev 1546)
@@ -0,0 +1,38 @@
+--- ftdi.c.orig 2006-12-11 12:09:18.000000000 -0300
++++ ftdi.c 2007-03-29 02:07:47.000000000 -0300
+@@ -1185,6 +1185,15 @@ int ftdi_eeprom_build(struct ftdi_eeprom
+ // calculate checksum
+ checksum = 0xAAAA;
+
++#if 1
++ for (i = 0; i < 64; i++) {
++ value = output[i*2];
++ value += output[(i*2)+1] << 8;
++
++ checksum = value^checksum;
++ checksum = (checksum << 1) | (checksum >> 15);
++ }
++#endif
+ for (i = 0; i < 63; i++) {
+ value = output[i*2];
+ value += output[(i*2)+1] << 8;
+@@ -1237,9 +1246,19 @@ int ftdi_write_eeprom(struct ftdi_contex
+ for (i = 0; i < 64; i++) {
+ usb_val = eeprom[i*2];
+ usb_val += eeprom[(i*2)+1] << 8;
++ if (i == 63)
++ usb_val = 0;
+ if (usb_control_msg(ftdi->usb_dev, 0x40, 0x91, usb_val, i, NULL, 0, ftdi->usb_write_timeout) != 0)
+ ftdi_error_return(-1, "unable to write eeprom");
+ }
++#if 1
++ for (i = 0; i < 64; i++) {
++ usb_val = eeprom[i*2];
++ usb_val += eeprom[(i*2)+1] << 8;
++ if (usb_control_msg(ftdi->usb_dev, 0x40, 0x91, usb_val, i+64, NULL, 0, ftdi->usb_write_timeout) != 0)
++ ftdi_error_return(-1, "unable to write eeprom");
++ }
++#endif
+
+ return 0;
+ }
More information about the commitlog
mailing list