]> www.infradead.org Git - users/borneoa/openocd-next.git/commitdiff
adapter: drop command 'adapter transports'
authorAntonio Borneo <borneo.antonio@gmail.com>
Sun, 22 Dec 2024 16:13:59 +0000 (17:13 +0100)
committerAntonio Borneo <borneo.antonio@gmail.com>
Sat, 15 Mar 2025 10:20:32 +0000 (10:20 +0000)
The commit 93f2afa45f4c ("initial "transport" framework") that
added the transport framework in 2010 was overly optimistic on the
possibility to dynamically add, at runtime, a new adapter and to
specify with the command 'adapter transports' the list of the
transports supported by the new adapter.

Such feature has never become part of OpenOCD, and the command
above has never become useful nor ever been used.

Drop the command 'adapter transports' and its documentation.
Drop the helper 'transport_list_parse', now unused.

Change-Id: Ie3d71c74d068fba802839b116bb9bc9af77cc83d
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8671
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
Tested-by: jenkins
doc/openocd.texi
src/jtag/adapter.c
src/transport/transport.c
src/transport/transport.h

index 140d0f8c77ec2f9c4e19cc61da4d73165ecdc837..9ff524b749430296bceffd51f4ca817bcb263a29 100644 (file)
@@ -2415,12 +2415,6 @@ target.
 List the debug adapter drivers that have been built into
 the running copy of OpenOCD.
 @end deffn
-@deffn {Config Command} {adapter transports} transport_name+
-Specifies the transports supported by this debug adapter.
-The adapter driver builds-in similar knowledge; use this only
-when external configuration (such as jumpering) changes what
-the hardware can support.
-@end deffn
 
 @anchor{adapter gpio}
 @deffn {Config Command} {adapter gpio [ @
index 04942f753b8f86ec5aeb03bdeda2564aa521fc91..db3d3b0fe8b15845e6e86774ccc298520f910a4f 100644 (file)
@@ -392,25 +392,6 @@ COMMAND_HANDLER(handle_adapter_name)
        return ERROR_OK;
 }
 
-COMMAND_HANDLER(adapter_transports_command)
-{
-       char **transports;
-       int retval;
-
-       retval = CALL_COMMAND_HANDLER(transport_list_parse, &transports);
-       if (retval != ERROR_OK)
-               return retval;
-
-       retval = allow_transports(CMD_CTX, (const char **)transports);
-
-       if (retval != ERROR_OK) {
-               for (unsigned int i = 0; transports[i]; i++)
-                       free(transports[i]);
-               free(transports);
-       }
-       return retval;
-}
-
 COMMAND_HANDLER(handle_adapter_list_command)
 {
        if (strcmp(CMD_NAME, "list") == 0 && CMD_ARGC > 0)
@@ -1137,13 +1118,6 @@ static const struct command_registration adapter_command_handlers[] = {
                .usage = "",
                .chain = adapter_srst_command_handlers,
        },
-       {
-               .name = "transports",
-               .handler = adapter_transports_command,
-               .mode = COMMAND_CONFIG,
-               .help = "Declare transports the adapter supports.",
-               .usage = "transport ...",
-       },
        {
                .name = "usb",
                .mode = COMMAND_ANY,
index c7293e7fdaee4cdcd63d4941e308457acc72cd65..0af1360369561d1348a92e7e6e3ceb1f2a8892b2 100644 (file)
@@ -166,54 +166,6 @@ struct transport *get_current_transport(void)
  * Infrastructure for Tcl interface to transports.
  */
 
-/**
- * Makes and stores a copy of a set of transports passed as
- * parameters to a command.
- *
- * @param vector where the resulting copy is stored, as an argv-style
- *     NULL-terminated vector.
- */
-COMMAND_HELPER(transport_list_parse, char ***vector)
-{
-       char **argv;
-       unsigned int n = CMD_ARGC;
-       unsigned int j = 0;
-
-       *vector = NULL;
-
-       if (n < 1)
-               return ERROR_COMMAND_SYNTAX_ERROR;
-
-       /* our return vector must be NULL terminated */
-       argv = calloc(n + 1, sizeof(char *));
-       if (!argv)
-               return ERROR_FAIL;
-
-       for (unsigned int i = 0; i < n; i++) {
-               struct transport *t;
-
-               for (t = transport_list; t; t = t->next) {
-                       if (strcmp(t->name, CMD_ARGV[i]) != 0)
-                               continue;
-                       argv[j++] = strdup(CMD_ARGV[i]);
-                       break;
-               }
-               if (!t) {
-                       LOG_ERROR("no such transport '%s'", CMD_ARGV[i]);
-                       goto fail;
-               }
-       }
-
-       *vector = argv;
-       return ERROR_OK;
-
-fail:
-       for (unsigned int i = 0; i < n; i++)
-               free(argv[i]);
-       free(argv);
-       return ERROR_FAIL;
-}
-
 COMMAND_HANDLER(handle_transport_init)
 {
        LOG_DEBUG("%s", __func__);
index 00d8b07e1174ac21eeb5a660feb2b9aa059c7add..2e3dcc61aaa1b20bc612e2259dac68c7bb6b6888 100644 (file)
@@ -77,8 +77,6 @@ struct transport *get_current_transport(void);
 
 int transport_register_commands(struct command_context *ctx);
 
-COMMAND_HELPER(transport_list_parse, char ***vector);
-
 int allow_transports(struct command_context *ctx, const char * const *vector);
 
 bool transport_is_jtag(void);