adapter: switch from struct jtag_interface to adapter_driver
To reorganize the adapters code, introduce an adapter_driver struct that contains all the adapter generic part, while keeping in two separate struct the specific API jtag_ops and swd_ops. Move the allocation of *adapter_driver from the JTAG-specific file core.c to the more adapter-specific file adapter.c While splitting the old jtag_interface for every driver, put the fields in the same order as in the struct declaration so we keep a consistent code across all the drivers. While other transport specific API could/would be added as separate ops, nothing is done here for HLA. Change-Id: I2d60f97ac514c0dd2d93a6ec9be66fd9d388dad5 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: http://openocd.zylin.com/4900 Tested-by: jenkins Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
This commit is contained in:
committed by
Tomas Vanek
parent
7268ff22c3
commit
efd1d64222
@@ -346,10 +346,11 @@ static const struct command_registration hl_interface_command_handlers[] = {
|
||||
COMMAND_REGISTRATION_DONE
|
||||
};
|
||||
|
||||
struct jtag_interface hl_interface = {
|
||||
struct adapter_driver hl_adapter_driver = {
|
||||
.name = "hla",
|
||||
.commands = hl_interface_command_handlers,
|
||||
.transports = hl_transports,
|
||||
.commands = hl_interface_command_handlers,
|
||||
|
||||
.init = hl_interface_init,
|
||||
.quit = hl_interface_quit,
|
||||
.reset = hl_interface_reset,
|
||||
@@ -358,4 +359,6 @@ struct jtag_interface hl_interface = {
|
||||
.speed_div = &hl_interface_speed_div,
|
||||
.config_trace = &hl_interface_config_trace,
|
||||
.poll_trace = &hl_interface_poll_trace,
|
||||
|
||||
/* no ops for HLA, targets hla_target and stm8 intercept them all */
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user