ftdi: use "adapter usb location" instead of ftdi_location command
[openocd.git] / src / jtag / drivers / ftdi.c
index 1afedd1af5adf617da2bdf97ee85b95b89c936d9..b709d28daaa678ffb1fd1c153ef49e0367e98579 100644 (file)
@@ -69,6 +69,7 @@
 #endif
 
 /* project specific includes */
+#include <jtag/drivers/jtag_usb_common.h>
 #include <jtag/interface.h>
 #include <jtag/swd.h>
 #include <transport/transport.h>
@@ -89,7 +90,6 @@
 
 static char *ftdi_device_desc;
 static char *ftdi_serial;
-static char *ftdi_location;
 static uint8_t ftdi_channel;
 static uint8_t ftdi_jtag_mode = JTAG_MODE;
 
@@ -658,7 +658,7 @@ static int ftdi_initialize(void)
 
        for (int i = 0; ftdi_vid[i] || ftdi_pid[i]; i++) {
                mpsse_ctx = mpsse_open(&ftdi_vid[i], &ftdi_pid[i], ftdi_device_desc,
-                               ftdi_serial, ftdi_location, ftdi_channel);
+                               ftdi_serial, jtag_usb_get_location(), ftdi_channel);
                if (mpsse_ctx)
                        break;
        }
@@ -704,7 +704,6 @@ static int ftdi_quit(void)
 
        free(ftdi_device_desc);
        free(ftdi_serial);
-       free(ftdi_location);
 
        free(swd_cmd_queue);
 
@@ -737,21 +736,6 @@ COMMAND_HANDLER(ftdi_handle_serial_command)
        return ERROR_OK;
 }
 
-#ifdef HAVE_LIBUSB_GET_PORT_NUMBERS
-COMMAND_HANDLER(ftdi_handle_location_command)
-{
-       if (CMD_ARGC == 1) {
-               if (ftdi_location)
-                       free(ftdi_location);
-               ftdi_location = strdup(CMD_ARGV[0]);
-       } else {
-               return ERROR_COMMAND_SYNTAX_ERROR;
-       }
-
-       return ERROR_OK;
-}
-#endif
-
 COMMAND_HANDLER(ftdi_handle_channel_command)
 {
        if (CMD_ARGC == 1)
@@ -966,15 +950,6 @@ static const struct command_registration ftdi_command_handlers[] = {
                .help = "set the serial number of the FTDI device",
                .usage = "serial_string",
        },
-#ifdef HAVE_LIBUSB_GET_PORT_NUMBERS
-       {
-               .name = "ftdi_location",
-               .handler = &ftdi_handle_location_command,
-               .mode = COMMAND_CONFIG,
-               .help = "set the USB bus location of the FTDI device",
-               .usage = "<bus>:port[,port]...",
-       },
-#endif
        {
                .name = "ftdi_channel",
                .handler = &ftdi_handle_channel_command,

Linking to existing account procedure

If you already have an account and want to add another login method you MUST first sign in with your existing account and then change URL to read https://review.openocd.org/login/?link to get to this page again but this time it'll work for linking. Thank you.

SSH host keys fingerprints

1024 SHA256:YKx8b7u5ZWdcbp7/4AeXNaqElP49m6QrwfXaqQGJAOk gerrit-code-review@openocd.zylin.com (DSA)
384 SHA256:jHIbSQa4REvwCFG4cq5LBlBLxmxSqelQPem/EXIrxjk gerrit-code-review@openocd.org (ECDSA)
521 SHA256:UAOPYkU9Fjtcao0Ul/Rrlnj/OsQvt+pgdYSZ4jOYdgs gerrit-code-review@openocd.org (ECDSA)
256 SHA256:A13M5QlnozFOvTllybRZH6vm7iSt0XLxbA48yfc2yfY gerrit-code-review@openocd.org (ECDSA)
256 SHA256:spYMBqEYoAOtK7yZBrcwE8ZpYt6b68Cfh9yEVetvbXg gerrit-code-review@openocd.org (ED25519)
+--[ED25519 256]--+
|=..              |
|+o..   .         |
|*.o   . .        |
|+B . . .         |
|Bo. = o S        |
|Oo.+ + =         |
|oB=.* = . o      |
| =+=.+   + E     |
|. .=o   . o      |
+----[SHA256]-----+
2048 SHA256:0Onrb7/PHjpo6iVZ7xQX2riKN83FJ3KGU0TvI0TaFG4 gerrit-code-review@openocd.zylin.com (RSA)