rlink: fix indentation errors

Indentation was inconsistent and some lines not indented at all. Quickfix
using Eclipse's auto-indentation.

Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
This commit is contained in:
Andreas Fritiofson 2011-07-16 14:03:39 +02:00 committed by Øyvind Harboe
parent 827057f560
commit 068c9f266e
1 changed files with 362 additions and 362 deletions

View File

@ -135,14 +135,14 @@ ep1_generic_commandl(
usb_buffer_p,
0,
sizeof(usb_buffer) - (usb_buffer_p - usb_buffer)
);
);
usb_ret = usb_bulk_write(
pHDev_param,
USB_EP1OUT_ADDR,
(char *)usb_buffer, sizeof(usb_buffer),
USB_TIMEOUT_MS
);
);
return(usb_ret);
}
@ -168,7 +168,7 @@ ep1_memory_read(
usb_buffer + 4,
0,
sizeof(usb_buffer) - 4
);
);
remain = length;
count = 0;
@ -188,7 +188,7 @@ ep1_memory_read(
pHDev, USB_EP1OUT_ADDR,
usb_buffer, sizeof(usb_buffer),
USB_TIMEOUT_MS
);
);
if (usb_ret < sizeof(usb_buffer)) {
break;
@ -198,7 +198,7 @@ ep1_memory_read(
pHDev, USB_EP1IN_ADDR,
buffer, length,
USB_TIMEOUT_MS
);
);
if (usb_ret < length) {
break;
@ -248,18 +248,18 @@ ep1_memory_write(
usb_buffer + 4,
buffer,
length
);
);
memset(
usb_buffer + 4 + length,
0,
sizeof(usb_buffer) - 4 - length
);
);
usb_ret = usb_bulk_write(
pHDev_param, USB_EP1OUT_ADDR,
(char *)usb_buffer, sizeof(usb_buffer),
USB_TIMEOUT_MS
);
);
if ((size_t)usb_ret < sizeof(usb_buffer)) {
break;
@ -343,7 +343,7 @@ dtc_load_from_buffer(
usb_err = ep1_generic_commandl(
pHDev_param, 1,
EP1_CMD_DTC_STOP
);
);
if (usb_err < 0) return(usb_err);
while (length) {
@ -378,7 +378,7 @@ dtc_load_from_buffer(
pHDev_param,
DTC_LOAD_BUFFER,
header->length + 1, buffer
);
);
if (usb_err < 0) return(usb_err);
/* Load it into the DTC. */
@ -387,7 +387,7 @@ dtc_load_from_buffer(
EP1_CMD_DTC_LOAD,
(DTC_LOAD_BUFFER >> 8),
DTC_LOAD_BUFFER
);
);
if (usb_err < 0) return(usb_err);
break;
@ -398,7 +398,7 @@ dtc_load_from_buffer(
EP1_CMD_DTC_CALL,
buffer[0],
EP1_CMD_DTC_WAIT
);
);
if (usb_err < 0) return(usb_err);
break;
@ -412,7 +412,7 @@ dtc_load_from_buffer(
pHDev_param,
ST7_USB_BUF_EP0OUT + lut_start,
header->length + 1, buffer
);
);
if (usb_err < 0) return(usb_err);
break;
@ -450,7 +450,7 @@ dtc_start_download(void) {
ST7_EP2TXR >> 8,
ST7_EP2TXR,
1
);
);
if (usb_err < 0) return(usb_err);
/* read back ep2txr */
@ -458,7 +458,7 @@ dtc_start_download(void) {
pHDev, USB_EP1IN_ADDR,
(char *)&ep2txr, 1,
USB_TIMEOUT_MS
);
);
if (usb_err < 0) return(usb_err);
usb_err = ep1_generic_commandl(
@ -477,7 +477,7 @@ dtc_start_download(void) {
EP1_CMD_DTC_CALL, /* start running the DTC */
dtc_entry_download,
EP1_CMD_DTC_GET_CACHED_STATUS
);
);
if (usb_err < 0) return(usb_err);
/* wait for completion */
@ -485,7 +485,7 @@ dtc_start_download(void) {
pHDev, USB_EP1IN_ADDR,
(char *)&ep2txr, 1,
USB_TIMEOUT_MS
);
);
return(usb_err);
}
@ -511,7 +511,7 @@ dtc_run_download(
USB_EP2OUT_ADDR,
(char *)command_buffer, USB_EP2BANK_SIZE,
USB_TIMEOUT_MS
);
);
if (usb_err < 0) return(usb_err);
@ -524,7 +524,7 @@ dtc_run_download(
DTC_STATUS_POLL_BYTE >> 8,
DTC_STATUS_POLL_BYTE,
1
);
);
if (usb_err < 0) return(usb_err);
usb_err = usb_bulk_read(
@ -532,7 +532,7 @@ dtc_run_download(
USB_EP1IN_ADDR,
(char *)ep2_buffer, 1,
USB_TIMEOUT_MS
);
);
if (usb_err < 0) return(usb_err);
if (ep2_buffer[0] & 0x01) break;
@ -540,7 +540,7 @@ dtc_run_download(
if (!--i) {
LOG_ERROR("%s, %d: too many retries waiting for DTC status",
__FILE__, __LINE__
);
);
return(-ETIMEDOUT);
}
}
@ -553,12 +553,12 @@ dtc_run_download(
USB_EP2IN_ADDR,
(char *)ep2_buffer, sizeof(ep2_buffer),
USB_TIMEOUT_MS
);
);
if (usb_err < (int)sizeof(ep2_buffer)) {
LOG_ERROR("%s, %d: Read of endpoint 2 returned %d",
__FILE__, __LINE__, usb_err
);
);
return(usb_err);
}
@ -664,7 +664,7 @@ dtc_queue_enqueue_reply(
/*
* Running the queue means that any pending command buffer is run and any reply data dealt with. The command buffer is then cleared for subsequent processing.
* The queue is automatically run by append when it is necessary to get space for the append.
*/
*/
static
int
@ -689,7 +689,7 @@ dtc_queue_run(void) {
usb_err = dtc_run_download(pHDev,
dtc_queue.cmd_buffer, dtc_queue.cmd_index,
NULL, 0
);
);
if (usb_err < 0) {
LOG_ERROR("dtc_run_download: %s", usb_strerror());
exit(1);
@ -698,7 +698,7 @@ dtc_queue_run(void) {
usb_err = dtc_run_download(pHDev,
dtc_queue.cmd_buffer, dtc_queue.cmd_index,
reply_buffer, dtc_queue.reply_index
);
);
if (usb_err < 0) {
LOG_ERROR("dtc_run_download: %s", usb_strerror());
exit(1);
@ -712,7 +712,7 @@ dtc_queue_run(void) {
rq_p = dtc_queue.rq_head;
rq_p != NULL;
rq_p = rq_next
) {
) {
tdo_p = rq_p->scan.buffer + (rq_p->scan.offset / 8);
tdo_mask = 1 << (rq_p->scan.offset % 8);
@ -727,7 +727,7 @@ dtc_queue_run(void) {
;
bit_cnt;
bit_cnt--
) {
) {
if (*dtc_p & dtc_mask) {
*tdo_p |= tdo_mask;
} else {
@ -752,9 +752,9 @@ dtc_queue_run(void) {
x = *dtc_p++;
if ((
rq_p->scan.type == SCAN_IN
) && (
) && (
rq_p->scan.offset != rq_p->scan.size - 1
)) {
)) {
/* extra bits were sent as a full byte with padding on the end */
dtc_mask = 1 << (8 - 1);
} else {
@ -765,7 +765,7 @@ dtc_queue_run(void) {
;
bit_cnt;
bit_cnt--
) {
) {
if (x & dtc_mask) {
*tdo_p |= tdo_mask;
} else {
@ -1001,7 +1001,7 @@ void rlink_reset(int trst, int srst)
ST7_PADR >> 8,
ST7_PADR,
1
);
);
if (usb_err < 0) {
LOG_ERROR("%s", usb_strerror());
exit(1);
@ -1011,7 +1011,7 @@ void rlink_reset(int trst, int srst)
pHDev, USB_EP1IN_ADDR,
(char *)&bitmap, 1,
USB_TIMEOUT_MS
);
);
if (usb_err < 1) {
LOG_ERROR("%s", usb_strerror());
exit(1);
@ -1036,7 +1036,7 @@ void rlink_reset(int trst, int srst)
ST7_PBDDR >> 8,
ST7_PBDDR,
1
);
);
if (usb_err < 0) {
LOG_ERROR("%s", usb_strerror());
exit(1);
@ -1046,7 +1046,7 @@ void rlink_reset(int trst, int srst)
pHDev, USB_EP1IN_ADDR,
(char *)&bitmap, 1,
USB_TIMEOUT_MS
);
);
if (usb_err < 1) {
LOG_ERROR("%s", usb_strerror());
exit(1);
@ -1067,7 +1067,7 @@ void rlink_reset(int trst, int srst)
1,
bitmap,
EP1_CMD_DTC_GET_CACHED_STATUS
);
);
if (usb_err < 0) {
LOG_ERROR("%s", usb_strerror());
exit(1);
@ -1077,7 +1077,7 @@ void rlink_reset(int trst, int srst)
pHDev, USB_EP1IN_ADDR,
(char *)&bitmap, 1,
USB_TIMEOUT_MS
);
);
if (usb_err < 1) {
LOG_ERROR("%s", usb_strerror());
exit(1);
@ -1117,7 +1117,7 @@ rlink_scan(
(!ir_scan && (tap_get_state() == TAP_DRSHIFT))
||
(ir_scan && (tap_get_state() == TAP_IRSHIFT))
)) {
)) {
saved_end_state = tap_get_end_state();
rlink_end_state(ir_scan ? TAP_IRSHIFT : TAP_DRSHIFT);
rlink_state_move();
@ -1159,7 +1159,7 @@ rlink_scan(
/* make sure there's room for stop, byte op, and one byte */
if (
(dtc_queue.cmd_index >= sizeof(dtc_queue.cmd_buffer) - (1 + 1 + 1))
) {
) {
dtc_queue_run();
}
@ -1229,7 +1229,7 @@ rlink_scan(
type, buffer, scan_size, tdi_bit_offset,
chunk_bits,
cmd
) == NULL) {
) == NULL) {
LOG_ERROR("enqueuing DTC reply entry: %s", strerror(errno));
exit(1);
}
@ -1286,7 +1286,7 @@ rlink_scan(
(dtc_queue.cmd_index >= sizeof(dtc_queue.cmd_buffer) - (1 + 1 + 1))
||
(dtc_queue.reply_index >= USB_EP2IN_SIZE - (1))
) {
) {
dtc_queue_run();
}
@ -1294,7 +1294,7 @@ rlink_scan(
type, buffer, scan_size, tdi_bit_offset,
extra_bits,
cmd
) == NULL) {
) == NULL) {
LOG_ERROR("enqueuing DTC reply entry: %s", strerror(errno));
exit(1);
}
@ -1339,7 +1339,7 @@ rlink_scan(
(dtc_queue.cmd_index >= sizeof(dtc_queue.cmd_buffer) - (1 + 1))
||
(dtc_queue.reply_index >= USB_EP2IN_SIZE - (1))
) {
) {
dtc_queue_run();
}
@ -1352,7 +1352,7 @@ rlink_scan(
type, buffer, scan_size, tdi_bit_offset,
1,
cmd
) == NULL) {
) == NULL) {
LOG_ERROR("enqueuing DTC reply entry: %s", strerror(errno));
exit(1);
}
@ -1390,7 +1390,7 @@ int rlink_execute_queue(void)
ep1_generic_commandl(pHDev, 2,
EP1_CMD_SET_PORTD_LEDS,
~(ST7_PD_NBUSY_LED)
);
);
#endif
while (cmd)
@ -1481,7 +1481,7 @@ int rlink_execute_queue(void)
ep1_generic_commandl(pHDev, 2,
EP1_CMD_SET_PORTD_LEDS,
~0
);
);
#endif
return retval;
@ -1511,7 +1511,7 @@ int rlink_speed(int speed)
LOG_ERROR("%s, %d: starting DTC: %s",
__FILE__, __LINE__,
usb_strerror()
);
);
exit(1);
}
@ -1641,7 +1641,7 @@ int rlink_init(void)
j = ep1_generic_commandl(
pHDev, 1,
EP1_CMD_GET_FWREV
);
);
if (j < USB_EP1OUT_SIZE) {
LOG_ERROR("USB write error: %s", usb_strerror());
return(ERROR_FAIL);
@ -1650,7 +1650,7 @@ int rlink_init(void)
pHDev, USB_EP1IN_ADDR,
(char *)reply_buffer, sizeof(reply_buffer),
200
);
);
if (j != -ETIMEDOUT) break;
}
@ -1683,13 +1683,13 @@ int rlink_init(void)
ST7_PEDR,
1,
ST7_PE_ADAPTER_SENSE_OUT
);
);
usb_bulk_read(
pHDev, USB_EP1IN_ADDR,
(char *)reply_buffer, 1,
USB_TIMEOUT_MS
);
);
if ((reply_buffer[0] & ST7_PE_ADAPTER_SENSE_IN) != 0) {
LOG_WARNING("target detection problem");
@ -1708,13 +1708,13 @@ int rlink_init(void)
0x00, /* DR */
0x00, /* DDR */
0x00 /* OR */
);
);
usb_bulk_read(
pHDev, USB_EP1IN_ADDR,
(char *)reply_buffer, 1,
USB_TIMEOUT_MS
);
);
if ((reply_buffer[0] & ST7_PE_ADAPTER_SENSE_IN) == 0) {
@ -1735,7 +1735,7 @@ int rlink_init(void)
ST7_PBDDR,
1,
0x00
);
);
/* make sure DTC is stopped, set VPP control, set up ports A and B */
ep1_generic_commandl(
@ -1755,7 +1755,7 @@ int rlink_init(void)
ST7_PBDR,
1,
0x00
);
);
/* set LED updating mode and make sure they're unlit */
ep1_generic_commandl(
@ -1767,7 +1767,7 @@ int rlink_init(void)
#endif
EP1_CMD_SET_PORTD_LEDS,
~0
);
);
tap_state_queue_init();
dtc_queue_init();
@ -1789,7 +1789,7 @@ int rlink_quit(void)
~0,
EP1_CMD_SET_PORTD_VPP,
~0
);
);
usb_release_interface(pHDev,0);
usb_close(pHDev);