On Friday, January 14, 2011 06:20:58 ian wrote:
> Here's an updated patch, also pasted here in case of spacing issues:
> http://pastie.org/1459568

the patch in the e-mail is still corrupted.  since you're clearly using git, i
dont know why you dont just use `git send-email` to post the patches.  that
takes care of everything for you.

the one at this url shows that there are a lot of tab/space issues too.
please remember that we only use spaces for indenting, and there should never
be trailing whitespace.

and you should be using the unified diff format.  not context or whatever that
is in.  unified is a lot easier to read/review.

ive cleaned that all up locally; see the patch below.  i noticed in this
latest version you no longer call ftdi_set_interface yourself ... i guess you
dont need to since the ftdi layers take care of it via your template setup ?

> its not picking up the libs, and we have to manually add them to the
> jtag makefile and also the bsdl2jtag makefile

start a new thread and post actual configure / compile output

also, please refrain from top posting in your replies.
-mike

--- include/urjtag/usbconn.h    (revision 1869)
+++ include/urjtag/usbconn.h    (working copy)
@@ -38,6 +38,7 @@ typedef struct
     const char *driver;
     int32_t vid;
     int32_t pid;
+    int32_t interface;
 }
 urj_usbconn_cable_t;
 
--- include/urjtag/cable.h      (revision 1869)
+++ include/urjtag/cable.h      (working copy)
@@ -63,6 +63,7 @@ typedef enum URJ_CABLE_PARAM_KEY
     URJ_CABLE_PARAM_KEY_TDO,            /* lu           gpio used as TDO */
     URJ_CABLE_PARAM_KEY_TMS,            /* lu           gpio used as TMS */
     URJ_CABLE_PARAM_KEY_TCK,            /* lu           gpio used as TCK */
+    URJ_CABLE_PARAM_KEY_INTERFACE,      /* lu           ftdi */
 }
 urj_cable_param_key_t;
 
--- src/tap/cable.c     (revision 1869)
+++ src/tap/cable.c     (working copy)
@@ -672,6 +672,7 @@ static const urj_param_descr_t cable_par
     { URJ_CABLE_PARAM_KEY_TDO,          URJ_PARAM_TYPE_LU,      "tdo", },
     { URJ_CABLE_PARAM_KEY_TMS,          URJ_PARAM_TYPE_LU,      "tms", },
     { URJ_CABLE_PARAM_KEY_TCK,          URJ_PARAM_TYPE_LU,      "tck", },
+    { URJ_CABLE_PARAM_KEY_INTERFACE,    URJ_PARAM_TYPE_LU,      "interface", },
 };
 
 const urj_param_list_t urj_cable_param_list =
--- src/tap/cable/generic_usbconn.c     (revision 1869)
+++ src/tap/cable/generic_usbconn.c     (working copy)
@@ -51,6 +51,7 @@ urj_tap_cable_generic_usbconn_connect (u
         NULL,                   /* no specific driver */
         -1,                     /* no VID */
         -1,                     /* no PID */
+        0,                      /* default interface */
     };
 
     urj_tap_cable_generic_params_t *cable_params;
@@ -80,6 +81,9 @@ urj_tap_cable_generic_usbconn_connect (u
             case URJ_CABLE_PARAM_KEY_DRIVER:
                 user_specified.driver = params[i]->value.string;
                 break;
+            case URJ_CABLE_PARAM_KEY_INTERFACE:
+                user_specified.interface = params[i]->value.lu;
+                break;
             default:
                 // hand these to the driver connect()
                 break;
@@ -114,6 +118,8 @@ urj_tap_cable_generic_usbconn_connect (u
                             cable_try.pid = user_specified.pid;
                         if (user_specified.desc != 0)
                             cable_try.desc = user_specified.desc;
+                        if (user_specified.interface != 0)
+                            cable_try.interface = user_specified.interface;
 
                         conn = urj_tap_usbconn_drivers[i]->connect (&cable_try,
                                                                     params);
--- src/tap/usbconn/libftd2xx.c (revision 1869)
+++ src/tap/usbconn/libftd2xx.c (working copy)
@@ -36,6 +36,7 @@
 #include <urjtag/error.h>
 #include <urjtag/log.h>
 #include <urjtag/usbconn.h>
+#include <urjtag/cable.h>
 #include "libftdx.h"
 #include "../usbconn.h"
 
@@ -50,6 +51,7 @@ typedef struct
     unsigned int pid;
     FT_HANDLE fc;
     char *serial;
+    unsigned int interface;
     /* send and receive buffer handling */
     uint32_t send_buf_len;
     uint32_t send_buffered;
@@ -331,6 +333,7 @@ usbconn_ftd2xx_connect (urj_usbconn_cabl
     p->fc = NULL;
     p->pid = template->pid;
     p->vid = template->vid;
+    p->interface = template->interface;
     /* @@@@ RFHH check strdup result */
     p->serial = template->desc ? strdup (template->desc) : NULL;
 
@@ -395,7 +398,7 @@ usbconn_ftd2xx_common_open (urj_usbconn_
     }
     else
         /* give it a plain try */
-        status = FT_Open (0, &p->fc);
+        status = FT_Open (p->interface, &p->fc);
 
     if (status != FT_OK)
     {
--- src/tap/usbconn/libftdi.c   (revision 1869)
+++ src/tap/usbconn/libftdi.c   (working copy)
@@ -36,6 +36,7 @@
 #include <urjtag/error.h>
 #include <urjtag/log.h>
 #include <urjtag/usbconn.h>
+#include <urjtag/cable.h>
 #include "libftdx.h"
 #include "../usbconn.h"
 
@@ -46,6 +47,8 @@ typedef struct
     unsigned int pid;
     struct ftdi_context *fc;
     char *serial;
+    /* ftdi interface selection */
+    unsigned int interface;
     /* send and receive buffer handling */
     uint32_t send_buf_len;
     uint32_t send_buffered;
@@ -310,6 +313,7 @@ usbconn_ftdi_connect (urj_usbconn_cable_
     p->fc = fc;
     p->pid = template->pid;
     p->vid = template->vid;
+    p->interface = template->interface;
     /* @@@@ RFHH check strdup result */
     p->serial = template->desc ? strdup (template->desc) : NULL;
 
--- sysdep.h    (revision 1869)
+++ sysdep.h    (working copy)
@@ -56,6 +56,11 @@
 #define mkdir(path, mode) mkdir(path)
 #endif
 
+/* Some Windows code likes to define this, so undo it here */
+#ifdef interface
+#undef interface
+#endif
+
 #ifndef HAVE_GETEUID
 #define geteuid() 0
 #endif

Attachment: signature.asc
Description: This is a digitally signed message part.

------------------------------------------------------------------------------
Protect Your Site and Customers from Malware Attacks
Learn about various malware tactics and how to avoid them. Understand 
malware threats, the impact they can have on your business, and how you 
can protect your company and customers by using code signing.
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
UrJTAG-development mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/urjtag-development

Reply via email to