X-Git-Url: https://review.openocd.org/gitweb?a=blobdiff_plain;f=src%2Fjtag%2Farm-jtag-ew.c;h=18b353acf34a0a35a4f6efa20d2d9346bd6e8536;hb=a94748ec6da9bdc6e25a7f73bbea723b8b55fa33;hp=3863e431b0363243985e12d7322621308584402d;hpb=e1c26950c03b09efe42b8a25dd83f1e50e22a507;p=openocd.git diff --git a/src/jtag/arm-jtag-ew.c b/src/jtag/arm-jtag-ew.c index 3863e431b0..18b353acf3 100644 --- a/src/jtag/arm-jtag-ew.c +++ b/src/jtag/arm-jtag-ew.c @@ -59,19 +59,16 @@ static uint8_t usb_out_buffer[ARMJTAGEW_OUT_BUFFER_SIZE]; static int armjtagew_execute_queue(void); static int armjtagew_speed(int speed); static int armjtagew_khz(int khz, int *jtag_speed); -static int armjtagew_register_commands(struct command_context_s *cmd_ctx); +static int armjtagew_register_commands(struct command_context *cmd_ctx); static int armjtagew_init(void); static int armjtagew_quit(void); -/* CLI command handler functions */ -static int armjtagew_handle_armjtagew_info_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc); - /* Queue command functions */ static void armjtagew_end_state(tap_state_t state); static void armjtagew_state_move(void); static void armjtagew_path_move(int num_states, tap_state_t *path); static void armjtagew_runtest(int num_cycles); -static void armjtagew_scan(bool ir_scan, enum scan_type type, uint8_t *buffer, int scan_size, scan_command_t *command); +static void armjtagew_scan(bool ir_scan, enum scan_type type, uint8_t *buffer, int scan_size, struct scan_command *command); static void armjtagew_reset(int trst, int srst); //static void armjtagew_simple_command(uint8_t command); static int armjtagew_get_status(void); @@ -81,7 +78,7 @@ static void armjtagew_tap_init(void); static int armjtagew_tap_execute(void); static void armjtagew_tap_ensure_space(int scans, int bits); static void armjtagew_tap_append_step(int tms, int tdi); -static void armjtagew_tap_append_scan(int length, uint8_t *buffer, scan_command_t *command); +static void armjtagew_tap_append_scan(int length, uint8_t *buffer, struct scan_command *command); /* ARM-JTAG-EW lowlevel functions */ struct armjtagew { @@ -122,7 +119,7 @@ struct jtag_interface armjtagew_interface = static int armjtagew_execute_queue(void) { - jtag_command_t *cmd = jtag_command_queue; + struct jtag_command *cmd = jtag_command_queue; int scan_size; enum scan_type type; uint8_t *buffer; @@ -240,13 +237,6 @@ static int armjtagew_khz(int khz, int *jtag_speed) return ERROR_OK; } -static int armjtagew_register_commands(struct command_context_s *cmd_ctx) -{ - register_command(cmd_ctx, NULL, "armjtagew_info", armjtagew_handle_armjtagew_info_command, COMMAND_EXEC, - "query armjtagew info"); - return ERROR_OK; -} - static int armjtagew_init(void) { int check_cnt; @@ -382,7 +372,7 @@ static void armjtagew_runtest(int num_cycles) } } -static void armjtagew_scan(bool ir_scan, enum scan_type type, uint8_t *buffer, int scan_size, scan_command_t *command) +static void armjtagew_scan(bool ir_scan, enum scan_type type, uint8_t *buffer, int scan_size, struct scan_command *command) { tap_state_t saved_end_state; @@ -520,7 +510,7 @@ static int armjtagew_get_version_info(void) return ERROR_OK; } -static int armjtagew_handle_armjtagew_info_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc) +COMMAND_HANDLER(armjtagew_handle_armjtagew_info_command) { if (armjtagew_get_version_info() == ERROR_OK) { @@ -531,6 +521,14 @@ static int armjtagew_handle_armjtagew_info_command(struct command_context_s *cmd return ERROR_OK; } +static int armjtagew_register_commands(struct command_context *cmd_ctx) +{ + register_command(cmd_ctx, NULL, "armjtagew_info", + &armjtagew_handle_armjtagew_info_command, COMMAND_EXEC, + "query armjtagew info"); + return ERROR_OK; +} + /***************************************************************************/ /* ARM-JTAG-EW tap functions */ @@ -545,7 +543,7 @@ static uint8_t tdo_buffer[ARMJTAGEW_TAP_BUFFER_SIZE]; struct pending_scan_result { int first; /* First bit position in tdo_buffer to read */ int length; /* Number of bits to read */ - scan_command_t *command; /* Corresponding scan command */ + struct scan_command *command; /* Corresponding scan command */ uint8_t *buffer; }; @@ -609,7 +607,7 @@ static void armjtagew_tap_append_step(int tms, int tdi) } } -void armjtagew_tap_append_scan(int length, uint8_t *buffer, scan_command_t *command) +void armjtagew_tap_append_scan(int length, uint8_t *buffer, struct scan_command *command) { struct pending_scan_result *pending_scan_result = &pending_scan_results_buffer[pending_scan_results_length]; int i; @@ -686,7 +684,7 @@ static int armjtagew_tap_execute(void) uint8_t *buffer = pending_scan_result->buffer; int length = pending_scan_result->length; int first = pending_scan_result->first; - scan_command_t *command = pending_scan_result->command; + struct scan_command *command = pending_scan_result->command; /* Copy to buffer */ buf_set_buf(tdo_buffer, first, buffer, 0, length);