From 802a949e535f479b694ee04d49c071900314ce91 Mon Sep 17 00:00:00 2001 From: Uwe Bonnes Date: Tue, 14 Sep 2010 15:49:55 +0200 Subject: [PATCH] Use the PNP flag as seen with FTD2XX --- src/ftdi.c | 10 +++++++++- src/ftdi.h | 2 ++ 2 files changed, 11 insertions(+), 1 deletions(-) diff --git a/src/ftdi.c b/src/ftdi.c index 3daea74..5ffad8f 100644 --- a/src/ftdi.c +++ b/src/ftdi.c @@ -2327,7 +2327,7 @@ int ftdi_eeprom_build(struct ftdi_context *ftdi) size_check -= serial_size*2; /* Space for the string type and pointer bytes */ - size_check -= -6; + size_check -= -9; // eeprom size exceeded? if (size_check < 0) @@ -2461,6 +2461,13 @@ int ftdi_eeprom_build(struct ftdi_context *ftdi) output[i & k] = eeprom->serial[j], i++; output[i & k] = 0x00, i++; } + output[i & k] = 0x02; /* as seen when written with FTD2XX */ + i++; + output[i & k] = 0x03; /* as seen when written with FTD2XX */ + i++; + output[i & k] = eeprom->is_not_pnp; /* as seen when written with FTD2XX */ + i++; + output[0x13] = serial_size*2 + 2; /* Fixme: ftd2xx seems to append 0x02, 0x03 and 0x01 for PnP = 0 or 0x00 else */ @@ -2894,6 +2901,7 @@ int ftdi_eeprom_decode(struct ftdi_context *ftdi, int verbose) fprintf(stdout, "Pull IO pins low during suspend\n"); if(eeprom->remote_wakeup) fprintf(stdout, "Enable Remote Wake Up\n"); + fprintf(stdout, "PNP: %d\n",(eeprom->is_not_pnp)?0:1); if (ftdi->type >= TYPE_2232C) fprintf(stdout,"Channel A has Mode %s%s%s\n", channel_mode[eeprom->channel_a_type], diff --git a/src/ftdi.h b/src/ftdi.h index 94d16dc..4132d8a 100644 --- a/src/ftdi.h +++ b/src/ftdi.h @@ -183,6 +183,8 @@ struct ftdi_eeprom /** remote wakeup */ int remote_wakeup; + int is_not_pnp; + /* Suspend on DBUS7 Low */ int suspend_dbus7; -- 1.7.1