On Tue, 28 Jun 2011, Márton Miklós wrote:

Hello all,

I have just noticed that the parallel port cable support is broken.

Error: chain.c:107 urj_tap_chain_connect() syntax: parallel cable
requires >= 3 parameters

The attached patch fixes the parallel cable parameter handling.
I've tested it with:
        cable DLC5 parallel 0x378
        cable DLC5 ppdev /dev/parport0
and I'm able to read the ID from a xilinx part on an eval board with a
dlc5-compatible interface.


I don't see any code path that calls the per-cable help display routines, but fixing that is a task for another day.


There is a checking for the argument count in the chain.c, which only
allows to use cables with 3 arguments.
This is a problem, because the command above should work.
After removing this check the cable initialization works, but the help
does not, and I have not found any sophisticated way how to patch it,
because the cable is constructed only after the argument checking, and
until then I cannot call the help method.

Regards,
Miklós

------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security
threats, fraudulent activity, and more. Splunk takes this data and makes
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
_______________________________________________
UrJTAG-development mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/urjtag-development
From a5a33900cc170001b7ac2cc43c1e846a2aec0400 Mon Sep 17 00:00:00 2001
From: Steve Tell <[email protected]>
Date: Wed, 29 Jun 2011 23:50:43 -0400
Subject: [PATCH] fixed parameters handling for parallel cables, tested with DLC5

---
 urjtag/src/tap/chain.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/urjtag/src/tap/chain.c b/urjtag/src/tap/chain.c
index ef55ddd..9ae1f59 100644
--- a/urjtag/src/tap/chain.c
+++ b/urjtag/src/tap/chain.c
@@ -101,10 +101,10 @@ urj_tap_chain_connect (urj_chain_t *chain, const char 
*drivername, char *params[
 
     if (driver->device_type == URJ_CABLE_DEVICE_PARPORT)
     {
-        if (paramc < 3)
+        if (paramc < 1)
         {
             urj_error_set (URJ_ERROR_SYNTAX,
-                           "parallel cable requires >= 3 parameters");
+                           "parallel cable requires >= 2 parameters, got %d", 
paramc);
             return URJ_STATUS_FAIL;
         }
         for (j = 0; j < URJ_CABLE_PARPORT_N_DEVS; j++)
-- 
1.7.4

------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security 
threats, fraudulent activity, and more. Splunk takes this data and makes 
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
_______________________________________________
UrJTAG-development mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/urjtag-development

Reply via email to