From 1c30e6ea5571cf53829bcf584aa6e651e1f4df1c Mon Sep 17 00:00:00 2001 From: Rutger Hofman Date: Sun, 3 May 2009 16:26:51 +0000 Subject: [PATCH] %s/cmd_xfer_cx_cmd/cx_cmd/g git-svn-id: https://urjtag.svn.sourceforge.net/svnroot/urjtag/trunk@1555 b68d4a1b-bc3d-0410-92ed-d4ac073336b7 --- urjtag/src/tap/cable/cmd_xfer.c | 65 +++++++++++++++---------------- urjtag/src/tap/cable/cmd_xfer.h | 43 ++++++++++---------- urjtag/src/tap/cable/ft2232.c | 54 ++++++++++++------------- urjtag/src/tap/cable/usbblaster.c | 17 ++++---- 4 files changed, 87 insertions(+), 92 deletions(-) diff --git a/urjtag/src/tap/cable/cmd_xfer.c b/urjtag/src/tap/cable/cmd_xfer.c index af1f80ea..1de6ba72 100644 --- a/urjtag/src/tap/cable/cmd_xfer.c +++ b/urjtag/src/tap/cable/cmd_xfer.c @@ -39,7 +39,7 @@ * Extends the buffer of the given command if a new byte wouldn't fit into * the current buffer size. * - * cmd : pointer to urj_tap_cable_cmd_xfer_cx_cmd_t + * cmd : pointer to urj_tap_cable_cx_cmd_t * * Return value: * 0 : Error occured, not enough memory @@ -47,7 +47,7 @@ * ****************************************************************************/ static int -extend_cmd_buffer (urj_tap_cable_cmd_xfer_cx_cmd_t *cmd) +extend_cmd_buffer (urj_tap_cable_cx_cmd_t *cmd) { /* check size of cmd buffer and increase it if not sufficient */ if (cmd->buf_pos >= cmd->buf_len) @@ -68,7 +68,7 @@ extend_cmd_buffer (urj_tap_cable_cmd_xfer_cx_cmd_t *cmd) * the current last command and max_len. If there are already more bytes * allocated than max_len, this function will return zero. * - * cmd : pointer to urj_tap_cable_cmd_xfer_cx_cmd_t struct + * cmd : pointer to urj_tap_cable_cx_cmd_t struct * max_len : upper limit for the space to allocate * * Return value: @@ -77,11 +77,11 @@ extend_cmd_buffer (urj_tap_cable_cmd_xfer_cx_cmd_t *cmd) * ****************************************************************************/ int -urj_tap_cable_cx_cmd_space (urj_tap_cable_cmd_xfer_cx_cmd_root_t *cmd_root, +urj_tap_cable_cx_cmd_space (urj_tap_cable_cx_cmd_root_t *cmd_root, int max_len) { int n; - urj_tap_cable_cmd_xfer_cx_cmd_t *cmd = cmd_root->last; + urj_tap_cable_cx_cmd_t *cmd = cmd_root->last; if (!cmd) return max_len; @@ -99,7 +99,7 @@ urj_tap_cable_cx_cmd_space (urj_tap_cable_cmd_xfer_cx_cmd_root_t *cmd_root, * * Pushes the byte value d to the buffer of the current last command. * - * cmd_root : pointer to urj_tap_cable_cmd_xfer_cx_cmd_root_t struct + * cmd_root : pointer to urj_tap_cable_cx_cmd_root_t struct * d : new value to be pushed * * Return value: @@ -108,10 +108,9 @@ urj_tap_cable_cx_cmd_space (urj_tap_cable_cmd_xfer_cx_cmd_root_t *cmd_root, * ****************************************************************************/ int -urj_tap_cable_cx_cmd_push (urj_tap_cable_cmd_xfer_cx_cmd_root_t *cmd_root, - uint8_t d) +urj_tap_cable_cx_cmd_push (urj_tap_cable_cx_cmd_root_t *cmd_root, uint8_t d) { - urj_tap_cable_cmd_xfer_cx_cmd_t *cmd = cmd_root->last; + urj_tap_cable_cx_cmd_t *cmd = cmd_root->last; if (!cmd) return 0; @@ -130,17 +129,17 @@ urj_tap_cable_cx_cmd_push (urj_tap_cable_cmd_xfer_cx_cmd_root_t *cmd_root, * * Dequeues the first command. * - * cmd_root : pointer to urj_tap_cable_cmd_xfer_cx_cmd_root_t parameter struct + * cmd_root : pointer to urj_tap_cable_cx_cmd_root_t parameter struct * * Return value: * NULL : Error occured - * <>NULL : All ok, pointer to dequeued urj_tap_cable_cmd_xfer_cx_cmd_t + * <>NULL : All ok, pointer to dequeued urj_tap_cable_cx_cmd_t * ****************************************************************************/ -urj_tap_cable_cmd_xfer_cx_cmd_t * -urj_tap_cable_cx_cmd_dequeue (urj_tap_cable_cmd_xfer_cx_cmd_root_t *cmd_root) +urj_tap_cable_cx_cmd_t * +urj_tap_cable_cx_cmd_dequeue (urj_tap_cable_cx_cmd_root_t *cmd_root) { - urj_tap_cable_cmd_xfer_cx_cmd_t *cmd = cmd_root->first; + urj_tap_cable_cx_cmd_t *cmd = cmd_root->first; if (cmd) { @@ -158,14 +157,14 @@ urj_tap_cable_cx_cmd_dequeue (urj_tap_cable_cmd_xfer_cx_cmd_root_t *cmd_root) * * Frees allocated memory of specified cmd structure. * - * cmd : pointer to urj_tap_cable_cmd_xfer_cx_cmd_t + * cmd : pointer to urj_tap_cable_cx_cmd_t * * Return value: * none * ****************************************************************************/ void -urj_tap_cable_cx_cmd_free (urj_tap_cable_cmd_xfer_cx_cmd_t *cmd) +urj_tap_cable_cx_cmd_free (urj_tap_cable_cx_cmd_t *cmd) { if (cmd) { @@ -179,24 +178,23 @@ urj_tap_cable_cx_cmd_free (urj_tap_cable_cmd_xfer_cx_cmd_t *cmd) /***************************************************************************** * urj_tap_cable_cx_cmd_queue( cmd_root, to_recv ) * - * Allocates a new urj_tap_cable_cmd_xfer_cx_cmd_t and queues it at the end of the command + * Allocates a new urj_tap_cable_cx_cmd_t and queues it at the end of the command * queue. The value of to_recv will be stored in the new cmd element, * set to 0 if this command will not generate receive bytes. * - * cmd_root : pointer to urj_tap_cable_cmd_xfer_cx_cmd_root_t parameter struct + * cmd_root : pointer to urj_tap_cable_cx_cmd_root_t parameter struct * to_recv : number of receive bytes that this command will generate * * Return value: * NULL : Error occured - * <>NULL : All ok, pointer to allocated urj_tap_cable_cmd_xfer_cx_cmd_t + * <>NULL : All ok, pointer to allocated urj_tap_cable_cx_cmd_t * ****************************************************************************/ -urj_tap_cable_cmd_xfer_cx_cmd_t * -urj_tap_cable_cx_cmd_queue (urj_tap_cable_cmd_xfer_cx_cmd_root_t *cmd_root, +urj_tap_cable_cx_cmd_t * +urj_tap_cable_cx_cmd_queue (urj_tap_cable_cx_cmd_root_t *cmd_root, uint32_t to_recv) { - urj_tap_cable_cmd_xfer_cx_cmd_t *cmd = - malloc (sizeof (urj_tap_cable_cmd_xfer_cx_cmd_t)); + urj_tap_cable_cx_cmd_t *cmd = malloc (sizeof (urj_tap_cable_cx_cmd_t)); if (cmd) { @@ -228,14 +226,14 @@ urj_tap_cable_cx_cmd_queue (urj_tap_cable_cmd_xfer_cx_cmd_root_t *cmd_root, * * Initializes the command root structure. * - * cmd_root : pointer to urj_tap_cable_cmd_xfer_cx_cmd_root_t + * cmd_root : pointer to urj_tap_cable_cx_cmd_root_t * * Return value: * none * ****************************************************************************/ void -urj_tap_cable_cx_cmd_init (urj_tap_cable_cmd_xfer_cx_cmd_root_t *cmd_root) +urj_tap_cable_cx_cmd_init (urj_tap_cable_cx_cmd_root_t *cmd_root) { cmd_root->first = NULL; cmd_root->last = NULL; @@ -247,16 +245,16 @@ urj_tap_cable_cx_cmd_init (urj_tap_cable_cmd_xfer_cx_cmd_root_t *cmd_root) * * Deinitialzes and frees all elements from the command root structure. * - * cmd_root : pointer to urj_tap_cable_cmd_xfer_cx_cmd_root_t + * cmd_root : pointer to urj_tap_cable_cx_cmd_root_t * * Return value: * none * ****************************************************************************/ void -urj_tap_cable_cx_cmd_deinit (urj_tap_cable_cmd_xfer_cx_cmd_root_t *cmd_root) +urj_tap_cable_cx_cmd_deinit (urj_tap_cable_cx_cmd_root_t *cmd_root) { - urj_tap_cable_cmd_xfer_cx_cmd_t *cmd; + urj_tap_cable_cx_cmd_t *cmd; while (cmd_root->first) { cmd = urj_tap_cable_cx_cmd_dequeue (cmd_root); @@ -275,8 +273,8 @@ urj_tap_cable_cx_cmd_deinit (urj_tap_cable_cmd_xfer_cx_cmd_root_t *cmd_root) * Flushing of the posted payload bytes is triggered when how_much * requests to do so or if receive bytes are expected. * - * cmd_root : pointer to urj_tap_cable_cmd_xfer_cx_cmd_root_t struct - * out_cmd : pointer to urj_tap_cable_cmd_xfer_cx_cmd_t for an optional command that is appended + * cmd_root : pointer to urj_tap_cable_cx_cmd_root_t struct + * out_cmd : pointer to urj_tap_cable_cx_cmd_t for an optional command that is appended * to send buffer in case commands have been scheduled that * yield return/receive data from the device * cable : current urj_cable_t @@ -287,12 +285,11 @@ urj_tap_cable_cx_cmd_deinit (urj_tap_cable_cmd_xfer_cx_cmd_root_t *cmd_root) * ****************************************************************************/ void -urj_tap_cable_cx_xfer (urj_tap_cable_cmd_xfer_cx_cmd_root_t *cmd_root, - const urj_tap_cable_cmd_xfer_cx_cmd_t *out_cmd, +urj_tap_cable_cx_xfer (urj_tap_cable_cx_cmd_root_t *cmd_root, + const urj_tap_cable_cx_cmd_t *out_cmd, urj_cable_t *cable, urj_cable_flush_amount_t how_much) { - urj_tap_cable_cmd_xfer_cx_cmd_t *cmd = - urj_tap_cable_cx_cmd_dequeue (cmd_root); + urj_tap_cable_cx_cmd_t *cmd = urj_tap_cable_cx_cmd_dequeue (cmd_root); uint32_t bytes_to_recv; bytes_to_recv = 0; diff --git a/urjtag/src/tap/cable/cmd_xfer.h b/urjtag/src/tap/cable/cmd_xfer.h index dbacadbf..5af2e98b 100644 --- a/urjtag/src/tap/cable/cmd_xfer.h +++ b/urjtag/src/tap/cable/cmd_xfer.h @@ -32,41 +32,38 @@ /* description of a command the buffer can contain one or more commands if receive count is zero for all of them */ -typedef struct cx_cmd urj_tap_cable_cmd_xfer_cx_cmd_t; -struct cx_cmd +typedef struct urj_tap_cable_cx_cmd urj_tap_cable_cx_cmd_t; +struct urj_tap_cable_cx_cmd { - urj_tap_cable_cmd_xfer_cx_cmd_t *next; + urj_tap_cable_cx_cmd_t *next; uint32_t buf_len; uint32_t buf_pos; uint8_t *buf; uint32_t to_recv; }; -struct cx_cmd_root +struct urj_tap_cable_cx_cmd_root { - urj_tap_cable_cmd_xfer_cx_cmd_t *first; - urj_tap_cable_cmd_xfer_cx_cmd_t *last; + urj_tap_cable_cx_cmd_t *first; + urj_tap_cable_cx_cmd_t *last; }; -typedef struct cx_cmd_root urj_tap_cable_cmd_xfer_cx_cmd_root_t; +typedef struct urj_tap_cable_cx_cmd_root urj_tap_cable_cx_cmd_root_t; -int urj_tap_cable_cx_cmd_space (urj_tap_cable_cmd_xfer_cx_cmd_root_t - *cmd_root, int max_len); -int urj_tap_cable_cx_cmd_push (urj_tap_cable_cmd_xfer_cx_cmd_root_t *cmd_root, +int urj_tap_cable_cx_cmd_space (urj_tap_cable_cx_cmd_root_t *cmd_root, + int max_len); +int urj_tap_cable_cx_cmd_push (urj_tap_cable_cx_cmd_root_t *cmd_root, uint8_t d); -urj_tap_cable_cmd_xfer_cx_cmd_t - *urj_tap_cable_cx_cmd_dequeue (urj_tap_cable_cmd_xfer_cx_cmd_root_t - *cmd_root); -void urj_tap_cable_cx_cmd_free (urj_tap_cable_cmd_xfer_cx_cmd_t *cmd); -urj_tap_cable_cmd_xfer_cx_cmd_t - *urj_tap_cable_cx_cmd_queue (urj_tap_cable_cmd_xfer_cx_cmd_root_t - *cmd_root, uint32_t to_recv); -void urj_tap_cable_cx_cmd_init (urj_tap_cable_cmd_xfer_cx_cmd_root_t - *cmd_root); -void urj_tap_cable_cx_cmd_deinit (urj_tap_cable_cmd_xfer_cx_cmd_root_t - *cmd_root); +urj_tap_cable_cx_cmd_t + *urj_tap_cable_cx_cmd_dequeue (urj_tap_cable_cx_cmd_root_t *cmd_root); +void urj_tap_cable_cx_cmd_free (urj_tap_cable_cx_cmd_t *cmd); +urj_tap_cable_cx_cmd_t + *urj_tap_cable_cx_cmd_queue (urj_tap_cable_cx_cmd_root_t *cmd_root, + uint32_t to_recv); +void urj_tap_cable_cx_cmd_init (urj_tap_cable_cx_cmd_root_t *cmd_root); +void urj_tap_cable_cx_cmd_deinit (urj_tap_cable_cx_cmd_root_t *cmd_root); -void urj_tap_cable_cx_xfer (urj_tap_cable_cmd_xfer_cx_cmd_root_t *cmd_root, - const urj_tap_cable_cmd_xfer_cx_cmd_t *out_cmd, +void urj_tap_cable_cx_xfer (urj_tap_cable_cx_cmd_root_t *cmd_root, + const urj_tap_cable_cx_cmd_t *out_cmd, urj_cable_t *cable, urj_cable_flush_amount_t how_much); uint8_t urj_tap_cable_cx_xfer_recv (urj_cable_t *cable); diff --git a/urjtag/src/tap/cable/ft2232.c b/urjtag/src/tap/cable/ft2232.c index 8a2871bd..d5ef170d 100644 --- a/urjtag/src/tap/cable/ft2232.c +++ b/urjtag/src/tap/cable/ft2232.c @@ -218,12 +218,12 @@ typedef struct unsigned int last_tdo; int signals; - urj_tap_cable_cmd_xfer_cx_cmd_root_t cmd_root; + urj_tap_cable_cx_cmd_root_t cmd_root; } params_t; static const uint8_t imm_buf[1] = { SEND_IMMEDIATE }; -static const urj_tap_cable_cmd_xfer_cx_cmd_t imm_cmd = +static const urj_tap_cable_cx_cmd_t imm_cmd = { NULL, 1, 1, (uint8_t *) imm_buf, 0 }; @@ -231,7 +231,7 @@ static void ft2232_set_frequency (urj_cable_t *cable, uint32_t new_frequency) { params_t *params = (params_t *) cable->params; - urj_tap_cable_cmd_xfer_cx_cmd_root_t *cmd_root = &(params->cmd_root); + urj_tap_cable_cx_cmd_root_t *cmd_root = &(params->cmd_root); if (!new_frequency || new_frequency > FT2232_MAX_TCK_FREQ) new_frequency = FT2232_MAX_TCK_FREQ; @@ -273,7 +273,7 @@ static int ft2232_generic_init (urj_cable_t *cable) { params_t *params = (params_t *) cable->params; - urj_tap_cable_cmd_xfer_cx_cmd_root_t *cmd_root = &(params->cmd_root); + urj_tap_cable_cx_cmd_root_t *cmd_root = &(params->cmd_root); if (urj_tap_usbconn_open (cable->link.usb)) return -1; @@ -316,7 +316,7 @@ static int ft2232_jtagkey_init (urj_cable_t *cable) { params_t *params = (params_t *) cable->params; - urj_tap_cable_cmd_xfer_cx_cmd_root_t *cmd_root = &(params->cmd_root); + urj_tap_cable_cx_cmd_root_t *cmd_root = &(params->cmd_root); if (urj_tap_usbconn_open (cable->link.usb)) return -1; @@ -371,7 +371,7 @@ static int ft2232_armusbocd_init (urj_cable_t *cable) { params_t *params = (params_t *) cable->params; - urj_tap_cable_cmd_xfer_cx_cmd_root_t *cmd_root = &(params->cmd_root); + urj_tap_cable_cx_cmd_root_t *cmd_root = &(params->cmd_root); if (urj_tap_usbconn_open (cable->link.usb)) return -1; @@ -426,7 +426,7 @@ static int ft2232_gnice_init (urj_cable_t *cable) { params_t *params = (params_t *) cable->params; - urj_tap_cable_cmd_xfer_cx_cmd_root_t *cmd_root = &(params->cmd_root); + urj_tap_cable_cx_cmd_root_t *cmd_root = &(params->cmd_root); if (urj_tap_usbconn_open (cable->link.usb)) return -1; @@ -472,7 +472,7 @@ static int ft2232_oocdlinks_init (urj_cable_t *cable) { params_t *params = (params_t *) cable->params; - urj_tap_cable_cmd_xfer_cx_cmd_root_t *cmd_root = &(params->cmd_root); + urj_tap_cable_cx_cmd_root_t *cmd_root = &(params->cmd_root); if (urj_tap_usbconn_open (cable->link.usb)) return -1; @@ -526,7 +526,7 @@ static int ft2232_turtelizer2_init (urj_cable_t *cable) { params_t *params = (params_t *) cable->params; - urj_tap_cable_cmd_xfer_cx_cmd_root_t *cmd_root = &(params->cmd_root); + urj_tap_cable_cx_cmd_root_t *cmd_root = &(params->cmd_root); if (urj_tap_usbconn_open (cable->link.usb)) return -1; @@ -576,7 +576,7 @@ static int ft2232_usbtojtagif_init (urj_cable_t *cable) { params_t *params = (params_t *) cable->params; - urj_tap_cable_cmd_xfer_cx_cmd_root_t *cmd_root = &(params->cmd_root); + urj_tap_cable_cx_cmd_root_t *cmd_root = &(params->cmd_root); if (urj_tap_usbconn_open (cable->link.usb)) return -1; @@ -630,7 +630,7 @@ static int ft2232_signalyzer_init (urj_cable_t *cable) { params_t *params = (params_t *) cable->params; - urj_tap_cable_cmd_xfer_cx_cmd_root_t *cmd_root = &(params->cmd_root); + urj_tap_cable_cx_cmd_root_t *cmd_root = &(params->cmd_root); if (urj_tap_usbconn_open (cable->link.usb)) return -1; @@ -676,7 +676,7 @@ static int ft2232_flyswatter_init (urj_cable_t *cable) { params_t *params = (params_t *) cable->params; - urj_tap_cable_cmd_xfer_cx_cmd_root_t *cmd_root = &(params->cmd_root); + urj_tap_cable_cx_cmd_root_t *cmd_root = &(params->cmd_root); if (urj_tap_usbconn_open (cable->link.usb)) return -1; @@ -723,7 +723,7 @@ static int ft2232_usbscarab2_init (urj_cable_t *cable) { params_t *params = (params_t *) cable->params; - urj_tap_cable_cmd_xfer_cx_cmd_root_t *cmd_root = &(params->cmd_root); + urj_tap_cable_cx_cmd_root_t *cmd_root = &(params->cmd_root); if (urj_tap_usbconn_open (cable->link.usb)) return -1; @@ -783,7 +783,7 @@ static void ft2232_generic_done (urj_cable_t *cable) { params_t *params = (params_t *) cable->params; - urj_tap_cable_cmd_xfer_cx_cmd_root_t *cmd_root = &(params->cmd_root); + urj_tap_cable_cx_cmd_root_t *cmd_root = &(params->cmd_root); /* Set Data Bits Low Byte set all to input */ @@ -808,7 +808,7 @@ static void ft2232_jtagkey_done (urj_cable_t *cable) { params_t *params = (params_t *) cable->params; - urj_tap_cable_cmd_xfer_cx_cmd_root_t *cmd_root = &(params->cmd_root); + urj_tap_cable_cx_cmd_root_t *cmd_root = &(params->cmd_root); /* Set Data Bits Low Byte disable output drivers */ @@ -857,7 +857,7 @@ static void ft2232_armusbocd_done (urj_cable_t *cable) { params_t *params = (params_t *) cable->params; - urj_tap_cable_cmd_xfer_cx_cmd_root_t *cmd_root = &(params->cmd_root); + urj_tap_cable_cx_cmd_root_t *cmd_root = &(params->cmd_root); /* Set Data Bits Low Byte disable output drivers */ @@ -903,7 +903,7 @@ static void ft2232_gnice_done (urj_cable_t *cable) { params_t *params = (params_t *) cable->params; - urj_tap_cable_cmd_xfer_cx_cmd_root_t *cmd_root = &(params->cmd_root); + urj_tap_cable_cx_cmd_root_t *cmd_root = &(params->cmd_root); /* Set Data Bits Low Byte disable output drivers */ @@ -934,7 +934,7 @@ static void ft2232_oocdlinks_done (urj_cable_t *cable) { params_t *params = (params_t *) cable->params; - urj_tap_cable_cmd_xfer_cx_cmd_root_t *cmd_root = &(params->cmd_root); + urj_tap_cable_cx_cmd_root_t *cmd_root = &(params->cmd_root); /* Set Data Bits Low Byte set all to input */ @@ -977,7 +977,7 @@ static void ft2232_turtelizer2_done (urj_cable_t *cable) { params_t *params = (params_t *) cable->params; - urj_tap_cable_cmd_xfer_cx_cmd_root_t *cmd_root = &(params->cmd_root); + urj_tap_cable_cx_cmd_root_t *cmd_root = &(params->cmd_root); /* Set Data Bits Low Byte disable output drivers */ @@ -1018,7 +1018,7 @@ static void ft2232_usbtojtagif_done (urj_cable_t *cable) { params_t *params = (params_t *) cable->params; - urj_tap_cable_cmd_xfer_cx_cmd_root_t *cmd_root = &(params->cmd_root); + urj_tap_cable_cx_cmd_root_t *cmd_root = &(params->cmd_root); /* Set Data Bits Low Byte set all to input */ @@ -1057,7 +1057,7 @@ static void ft2232_signalyzer_done (urj_cable_t *cable) { params_t *params = (params_t *) cable->params; - urj_tap_cable_cmd_xfer_cx_cmd_root_t *cmd_root = &(params->cmd_root); + urj_tap_cable_cx_cmd_root_t *cmd_root = &(params->cmd_root); /* Set Data Bits Low Byte set all to input */ @@ -1094,7 +1094,7 @@ static void ft2232_flyswatter_done (urj_cable_t *cable) { params_t *params = (params_t *) cable->params; - urj_tap_cable_cmd_xfer_cx_cmd_root_t *cmd_root = &(params->cmd_root); + urj_tap_cable_cx_cmd_root_t *cmd_root = &(params->cmd_root); /* Set Data Bits Low Byte disable output drivers */ @@ -1130,7 +1130,7 @@ static void ft2232_usbscarab2_done (urj_cable_t *cable) { params_t *params = (params_t *) cable->params; - urj_tap_cable_cmd_xfer_cx_cmd_root_t *cmd_root = &(params->cmd_root); + urj_tap_cable_cx_cmd_root_t *cmd_root = &(params->cmd_root); /* Set Data Bits Low Byte set all to input */ @@ -1156,7 +1156,7 @@ static void ft2232_clock_schedule (urj_cable_t *cable, int tms, int tdi, int n) { params_t *params = (params_t *) cable->params; - urj_tap_cable_cmd_xfer_cx_cmd_root_t *cmd_root = &(params->cmd_root); + urj_tap_cable_cx_cmd_root_t *cmd_root = &(params->cmd_root); tms = tms ? 0x7f : 0; tdi = tdi ? 1 << 7 : 0; @@ -1217,7 +1217,7 @@ static void ft2232_get_tdo_schedule (urj_cable_t *cable) { params_t *params = (params_t *) cable->params; - urj_tap_cable_cmd_xfer_cx_cmd_root_t *cmd_root = &(params->cmd_root); + urj_tap_cable_cx_cmd_root_t *cmd_root = &(params->cmd_root); /* Read Data Bits Low Byte */ urj_tap_cable_cx_cmd_queue (cmd_root, 1); @@ -1256,7 +1256,7 @@ static void ft2232_set_signal_schedule (params_t *params, int mask, int val, int set_low, int set_high) { - urj_tap_cable_cmd_xfer_cx_cmd_root_t *cmd_root = &(params->cmd_root); + urj_tap_cable_cx_cmd_root_t *cmd_root = &(params->cmd_root); /* filter for supported signals */ mask &= @@ -1350,7 +1350,7 @@ static void ft2232_transfer_schedule (urj_cable_t *cable, int len, char *in, char *out) { params_t *params = (params_t *) cable->params; - urj_tap_cable_cmd_xfer_cx_cmd_root_t *cmd_root = &(params->cmd_root); + urj_tap_cable_cx_cmd_root_t *cmd_root = &(params->cmd_root); int in_offset = 0; int bitwise_len; int chunkbytes; diff --git a/urjtag/src/tap/cable/usbblaster.c b/urjtag/src/tap/cable/usbblaster.c index cc01bf47..5d1201c3 100644 --- a/urjtag/src/tap/cable/usbblaster.c +++ b/urjtag/src/tap/cable/usbblaster.c @@ -62,7 +62,7 @@ typedef struct { - urj_tap_cable_cmd_xfer_cx_cmd_root_t cmd_root; + urj_tap_cable_cx_cmd_root_t cmd_root; } params_t; static int @@ -112,7 +112,7 @@ usbblaster_init (urj_cable_t *cable) { int i; params_t *params = (params_t *) cable->params; - urj_tap_cable_cmd_xfer_cx_cmd_root_t *cmd_root = &(params->cmd_root); + urj_tap_cable_cx_cmd_root_t *cmd_root = &(params->cmd_root); if (urj_tap_usbconn_open (cable->link.usb)) return -1; @@ -142,7 +142,7 @@ static void usbblaster_clock_schedule (urj_cable_t *cable, int tms, int tdi, int n) { params_t *params = (params_t *) cable->params; - urj_tap_cable_cmd_xfer_cx_cmd_root_t *cmd_root = &(params->cmd_root); + urj_tap_cable_cx_cmd_root_t *cmd_root = &(params->cmd_root); int i, m; tms = tms ? (1 << TMS) : 0; @@ -163,8 +163,9 @@ usbblaster_clock_schedule (urj_cable_t *cable, int tms, int tdi, int n) if (chunkbytes > 63) chunkbytes = 63; - if (urj_tap_cable_cx_cmd_space - (cmd_root, URJ_USBCONN_FTDX_MAXSEND) < chunkbytes + 1) + if (urj_tap_cable_cx_cmd_space (cmd_root, + URJ_USBCONN_FTDX_MAXSEND) + < chunkbytes + 1) { /* no space left for next clocking command transfer queued commands to device and read receive data @@ -210,7 +211,7 @@ static void usbblaster_get_tdo_schedule (urj_cable_t *cable) { params_t *params = (params_t *) cable->params; - urj_tap_cable_cmd_xfer_cx_cmd_root_t *cmd_root = &(params->cmd_root); + urj_tap_cable_cx_cmd_root_t *cmd_root = &(params->cmd_root); urj_tap_cable_cx_cmd_queue (cmd_root, 1); urj_tap_cable_cx_cmd_push (cmd_root, OTHERS); /* TCK low */ @@ -251,7 +252,7 @@ usbblaster_transfer_schedule (urj_cable_t *cable, int len, char *in, char *out) { params_t *params = (params_t *) cable->params; - urj_tap_cable_cmd_xfer_cx_cmd_root_t *cmd_root = &(params->cmd_root); + urj_tap_cable_cx_cmd_root_t *cmd_root = &(params->cmd_root); int in_offset = 0; urj_tap_cable_cx_cmd_queue (cmd_root, 0); @@ -317,7 +318,7 @@ static int usbblaster_transfer_finish (urj_cable_t *cable, int len, char *out) { params_t *params = (params_t *) cable->params; - urj_tap_cable_cmd_xfer_cx_cmd_root_t *cmd_root = &(params->cmd_root); + urj_tap_cable_cx_cmd_root_t *cmd_root = &(params->cmd_root); int out_offset = 0; if (out == NULL)