transport: use a bitmask for the transport

Move the transport's names in a local array in the transport
framework.

Replace the string struct transport::name, that identifies the
transport, with a bitmask where each bit corresponds to one of the
available transports.

Change-Id: I6bdf7264d5979c355299f63fcf80bf54dcd95cee
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8674
Tested-by: jenkins
Reviewed-by: zapb <dev@zapb.de>
This commit is contained in:
Antonio Borneo
2024-12-22 17:06:12 +01:00
parent 9a5de74423
commit 236208a5ff
7 changed files with 102 additions and 31 deletions

View File

@@ -207,13 +207,13 @@ static int dapdirect_init(struct command_context *ctx)
}
static struct transport dapdirect_jtag_transport = {
.name = "dapdirect_jtag",
.id = TRANSPORT_DAPDIRECT_JTAG,
.select = dapdirect_jtag_select,
.init = dapdirect_init,
};
static struct transport dapdirect_swd_transport = {
.name = "dapdirect_swd",
.id = TRANSPORT_DAPDIRECT_SWD,
.select = dapdirect_swd_select,
.init = dapdirect_init,
};

View File

@@ -756,7 +756,7 @@ static int swd_init(struct command_context *ctx)
}
static struct transport swd_transport = {
.name = "swd",
.id = TRANSPORT_SWD,
.select = swd_select,
.init = swd_init,
};