stlink: reduce use of hla specific enum hl_transports
authorAntonio Borneo <borneo.antonio@gmail.com>
Wed, 18 Mar 2020 21:35:26 +0000 (22:35 +0100)
committerAntonio Borneo <borneo.antonio@gmail.com>
Sun, 24 May 2020 20:27:34 +0000 (21:27 +0100)
commit94dfa68647062ce71322f293a468bf5cdccf82be
treeb506a970ca1a556948376dd689023053a3a5fc54
parent17789d3762aff931bc4bffd2c129100d952ccc84
stlink: reduce use of hla specific enum hl_transports

In the driver's code it's widely used the enum hl_transports for
any check concerning the current transport, even for the non-hla
transport dapdirect.
The driver already provides a stlink specific enum stlink_mode
that can be used in place of the hla one.

Replace the hla enum with the stlink one allover the code.
Introduce a hla specific wrapper stlink_usb_hl_open() to cope with
the only API that requires the hla specific enum.

The overall behaviour is not changed, with exception for a debug
message in stlink_usb_open() than now prints the numeric value of
stlink enum in place of the numeric value of the corresponding hla
one.

This change prepares the road for moving SWIM transport out of hla
by removing any reference to the macro HL_TRANSPORT_SWIM from the
stlink driver.

Change-Id: Ieeea34f312245a94bfc1333087afdb8eb9f77139
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/5526
Tested-by: jenkins
src/jtag/drivers/stlink_usb.c