constify the cable drivers

git-svn-id: https://urjtag.svn.sourceforge.net/svnroot/urjtag/trunk@1714 b68d4a1b-bc3d-0410-92ed-d4ac073336b7
master
Mike Frysinger 15 years ago
parent 5798f29cc3
commit cd5bb2da68

@ -39,6 +39,17 @@
* src/tap/cable.h, src/tap/cable_list.h, src/tap/cable.c: Unify the list of
cable drivers in one place.
* include/urjtag/cable.h, src/cmd/cmd_cable.c, src/tap/cable.c,
src/tap/cable.h, src/tap/cable/arcom.c, src/tap/cable/byteblaster.c,
src/tap/cable/dlc5.c, src/tap/cable/ea253.c, src/tap/cable/ei012.c,
src/tap/cable/ft2232.c, src/tap/cable/generic.h, src/tap/cable/jim.c,
src/tap/cable/jlink.c, src/tap/cable/keithkoep.c, src/tap/cable/lattice.c,
src/tap/cable/minimal.c, src/tap/cable/mpcbdm.c, src/tap/cable/triton.c,
src/tap/cable/ts7800.c, src/tap/cable/usbblaster.c,
src/tap/cable/vision_ep9307.c, src/tap/cable/wiggler2.c,
src/tap/cable/wiggler.c, src/tap/cable/xpc.c:
Constify the cable drivers.
2010-01-22 Mike Frysinger <vapier@gentoo.org>
* src/cmd/cmd_bit.c (cmd_bit_print_params): Fix strncat length handling.

@ -149,7 +149,7 @@ struct URJ_CABLE_QUEUE_INFO
struct URJ_CABLE
{
urj_cable_driver_t *driver;
const urj_cable_driver_t *driver;
union
{
urj_usbconn_t *usb;
@ -214,7 +214,7 @@ int urj_tap_cable_get_queue_item (urj_cable_t *cable,
* @return URJ_STATUS_OK on success; URJ_STATUS_FAIL on failure
*/
urj_cable_t *urj_tap_cable_parport_connect (urj_chain_t *chain,
urj_cable_driver_t *driver,
const urj_cable_driver_t *driver,
urj_cable_parport_devtype_t devtype,
const char *devname,
const urj_param_t *params[]);
@ -224,7 +224,7 @@ urj_cable_t *urj_tap_cable_parport_connect (urj_chain_t *chain,
* @return URJ_STATUS_OK on success; URJ_STATUS_FAIL on failure
*/
urj_cable_t *urj_tap_cable_usb_connect (urj_chain_t *chain,
urj_cable_driver_t *driver,
const urj_cable_driver_t *driver,
const urj_param_t *params[]);
/**
* API function to connect to a type-other cable
@ -232,10 +232,10 @@ urj_cable_t *urj_tap_cable_usb_connect (urj_chain_t *chain,
* @return URJ_STATUS_OK on success; URJ_STATUS_FAIL on failure
*/
urj_cable_t *urj_tap_cable_other_connect (urj_chain_t *chain,
urj_cable_driver_t *driver,
const urj_cable_driver_t *driver,
const urj_param_t *params[]);
extern urj_cable_driver_t *urj_tap_cable_drivers[];
extern const urj_cable_driver_t *urj_tap_cable_drivers[];
/** The list of recognized parameters */
extern const urj_param_list_t urj_cable_param_list;

@ -50,7 +50,7 @@ cmd_cable_run (urj_chain_t *chain, char *params[])
urj_cable_parport_devtype_t devtype = -1;
const char *devname = NULL;
int param_start = 2;
urj_cable_driver_t *driver;
const urj_cable_driver_t *driver;
/* we need at least one parameter for 'cable' command */
if (paramc < 2)

@ -45,7 +45,7 @@
#include "cable.h"
urj_cable_driver_t *urj_tap_cable_drivers[] = {
const urj_cable_driver_t *urj_tap_cable_drivers[] = {
#define _URJ_CABLE(cable) &urj_tap_cable_##cable##_driver,
#include "cable_list.h"
NULL /* last must be NULL */
@ -534,7 +534,7 @@ urj_tap_cable_wait (urj_cable_t *cable)
}
static urj_cable_t *
urj_tap_cable_create (urj_chain_t *chain, urj_cable_driver_t *driver)
urj_tap_cable_create (urj_chain_t *chain, const urj_cable_driver_t *driver)
{
urj_cable_t *cable;
@ -578,7 +578,7 @@ urj_tap_cable_start (urj_chain_t *chain, urj_cable_t *cable)
}
urj_cable_t *
urj_tap_cable_parport_connect (urj_chain_t *chain, urj_cable_driver_t *driver,
urj_tap_cable_parport_connect (urj_chain_t *chain, const urj_cable_driver_t *driver,
urj_cable_parport_devtype_t devtype,
const char *devname, const urj_param_t *params[])
{
@ -609,7 +609,7 @@ urj_tap_cable_parport_connect (urj_chain_t *chain, urj_cable_driver_t *driver,
}
urj_cable_t *
urj_tap_cable_usb_connect (urj_chain_t *chain, urj_cable_driver_t *driver,
urj_tap_cable_usb_connect (urj_chain_t *chain, const urj_cable_driver_t *driver,
const urj_param_t *params[])
{
urj_cable_t *cable;
@ -637,7 +637,7 @@ urj_tap_cable_usb_connect (urj_chain_t *chain, urj_cable_driver_t *driver,
}
urj_cable_t *
urj_tap_cable_other_connect (urj_chain_t *chain, urj_cable_driver_t *driver,
urj_tap_cable_other_connect (urj_chain_t *chain, const urj_cable_driver_t *driver,
const urj_param_t *params[])
{
urj_cable_t *cable;

@ -25,7 +25,7 @@
#ifndef URJ_CABLE_CABLE_H
#define URJ_CABLE_CABLE_H
#define _URJ_CABLE(cable) extern urj_cable_driver_t urj_tap_cable_##cable##_driver;
#define _URJ_CABLE(cable) extern const urj_cable_driver_t urj_tap_cable_##cable##_driver;
#include "cable_list.h"
#endif /* URJ_CABLE_CABLE_H */

@ -138,7 +138,7 @@ arcom_set_signal (urj_cable_t *cable, int mask, int val)
return prev_sigs;
}
urj_cable_driver_t urj_tap_cable_arcom_driver = {
const urj_cable_driver_t urj_tap_cable_arcom_driver = {
"ARCOM",
N_("Arcom JTAG Cable"),
URJ_CABLE_DEVICE_PARPORT,

@ -177,7 +177,7 @@ byteblaster_set_signal (urj_cable_t *cable, int mask, int val)
return prev_sigs;
}
urj_cable_driver_t urj_tap_cable_byteblaster_driver = {
const const urj_cable_driver_t urj_tap_cable_byteblaster_driver = {
"ByteBlaster",
N_("Altera ByteBlaster/ByteBlaster II/ByteBlasterMV Parallel Port Download Cable"),
URJ_CABLE_DEVICE_PARPORT,

@ -132,7 +132,7 @@ dlc5_set_signal (urj_cable_t *cable, int mask, int val)
return prev_sigs;
}
urj_cable_driver_t urj_tap_cable_dlc5_driver = {
const urj_cable_driver_t urj_tap_cable_dlc5_driver = {
"DLC5",
N_("Xilinx DLC5 JTAG Parallel Cable III"),
URJ_CABLE_DEVICE_PARPORT,

@ -138,7 +138,7 @@ ea253_set_signal (urj_cable_t *cable, int mask, int val)
return prev_sigs;
}
urj_cable_driver_t urj_tap_cable_ea253_driver = {
const urj_cable_driver_t urj_tap_cable_ea253_driver = {
"EA253",
N_("ETC EA253 JTAG Cable"),
URJ_CABLE_DEVICE_PARPORT,

@ -140,7 +140,7 @@ ei012_set_signal (urj_cable_t *cable, int mask, int val)
return prev_sigs;
}
urj_cable_driver_t urj_tap_cable_ei012_driver = {
const urj_cable_driver_t urj_tap_cable_ei012_driver = {
"EI012",
N_("ETC EI012 JTAG Cable"),
URJ_CABLE_DEVICE_PARPORT,

@ -1881,7 +1881,7 @@ ft2232_usbcable_help (urj_log_level_t ll, const char *cablename)
}
urj_cable_driver_t urj_tap_cable_ft2232_driver = {
const urj_cable_driver_t urj_tap_cable_ft2232_driver = {
"FT2232",
N_("Generic FTDI FT2232 Cable"),
URJ_CABLE_DEVICE_USB,
@ -1914,7 +1914,7 @@ urj_usbconn_cable_t urj_tap_cable_usbconn_ft2232_ftd2xx = {
0x0000 /* PID */
};
urj_cable_driver_t urj_tap_cable_ft2232_armusbocd_driver = {
const urj_cable_driver_t urj_tap_cable_ft2232_armusbocd_driver = {
"ARM-USB-OCD",
N_("Olimex ARM-USB-OCD[-TINY] (FT2232) Cable"),
URJ_CABLE_DEVICE_USB,
@ -1961,7 +1961,7 @@ urj_usbconn_cable_t urj_tap_cable_usbconn_armusbocdtiny_ftd2xx = {
0x0004 /* PID */
};
urj_cable_driver_t urj_tap_cable_ft2232_armusbtiny_h_driver = {
const urj_cable_driver_t urj_tap_cable_ft2232_armusbtiny_h_driver = {
"ARM-USB-OCD-H",
N_("Olimex ARM-USB-TINY-H (FT2232H) Cable"),
URJ_CABLE_DEVICE_USB,
@ -1994,7 +1994,7 @@ urj_usbconn_cable_t urj_tap_cable_usbconn_armusbtiny_h_ftd2xx = {
0x002A /* PID */
};
urj_cable_driver_t urj_tap_cable_ft2232_gnice_driver = {
const urj_cable_driver_t urj_tap_cable_ft2232_gnice_driver = {
"gnICE",
N_("Analog Devices Blackfin gnICE (FT2232) Cable (EXPERIMENTAL)"),
URJ_CABLE_DEVICE_USB,
@ -2028,7 +2028,7 @@ urj_usbconn_cable_t urj_tap_cable_usbconn_gnice_ftd2xx = {
0xF000 /* PID */
};
urj_cable_driver_t urj_tap_cable_ft2232_gniceplus_driver = {
const urj_cable_driver_t urj_tap_cable_ft2232_gniceplus_driver = {
"gnICE+",
N_("Analog Devices Blackfin gnICE+ (FT2232H) Cable (EXPERIMENTAL)"),
URJ_CABLE_DEVICE_USB,
@ -2062,7 +2062,7 @@ urj_usbconn_cable_t urj_tap_cable_usbconn_gniceplus_ftd2xx = {
0xF001 /* PID */
};
urj_cable_driver_t urj_tap_cable_ft2232_jtagkey_driver = {
const urj_cable_driver_t urj_tap_cable_ft2232_jtagkey_driver = {
"JTAGkey",
N_("Amontec JTAGkey (FT2232) Cable"),
URJ_CABLE_DEVICE_USB,
@ -2095,7 +2095,7 @@ urj_usbconn_cable_t urj_tap_cable_usbconn_jtagkey_ftd2xx = {
0xCFF8 /* PID */
};
urj_cable_driver_t urj_tap_cable_ft2232_oocdlinks_driver = {
const urj_cable_driver_t urj_tap_cable_ft2232_oocdlinks_driver = {
"OOCDLink-s",
N_("OOCDLink-s (FT2232) Cable (EXPERIMENTAL)"),
URJ_CABLE_DEVICE_USB,
@ -2128,7 +2128,7 @@ urj_usbconn_cable_t urj_tap_cable_usbconn_oocdlinks_ftd2xx = {
0xbaf8 /* PID */
};
urj_cable_driver_t urj_tap_cable_ft2232_turtelizer2_driver = {
const urj_cable_driver_t urj_tap_cable_ft2232_turtelizer2_driver = {
"Turtelizer2",
N_("Turtelizer 2 Rev. B (FT2232) Cable (EXPERIMENTAL)"),
URJ_CABLE_DEVICE_USB,
@ -2161,7 +2161,7 @@ urj_usbconn_cable_t urj_tap_cable_usbconn_turtelizer2_ftd2xx = {
0xBDC8 /* PID */
};
urj_cable_driver_t urj_tap_cable_ft2232_usbtojtagif_driver = {
const urj_cable_driver_t urj_tap_cable_ft2232_usbtojtagif_driver = {
"USB-to-JTAG-IF",
N_("USB to JTAG Interface (FT2232) Cable (EXPERIMENTAL)"),
URJ_CABLE_DEVICE_USB,
@ -2194,7 +2194,7 @@ urj_usbconn_cable_t urj_tap_cable_usbconn_usbtojtagif_ftd2xx = {
0x0000 /* PID */
};
urj_cable_driver_t urj_tap_cable_ft2232_signalyzer_driver = {
const urj_cable_driver_t urj_tap_cable_ft2232_signalyzer_driver = {
"Signalyzer",
N_("Xverve DT-USB-ST Signalyzer Tool (FT2232) Cable (EXPERIMENTAL)"),
URJ_CABLE_DEVICE_USB,
@ -2227,7 +2227,7 @@ urj_usbconn_cable_t urj_tap_cable_usbconn_signalyzer_ftd2xx = {
0xbca1 /* PID */
};
urj_cable_driver_t urj_tap_cable_ft2232_flyswatter_driver = {
const urj_cable_driver_t urj_tap_cable_ft2232_flyswatter_driver = {
"Flyswatter",
N_("TinCanTools Flyswatter (FT2232) Cable"),
URJ_CABLE_DEVICE_USB,
@ -2260,7 +2260,7 @@ urj_usbconn_cable_t urj_tap_cable_usbconn_flyswatter_ftd2xx = {
0x6010 /* PID */
};
urj_cable_driver_t urj_tap_cable_ft2232_usbscarab2_driver = {
const urj_cable_driver_t urj_tap_cable_ft2232_usbscarab2_driver = {
"usbScarab2",
N_("KrisTech usbScarabeus2 (FT2232) Cable"),
URJ_CABLE_DEVICE_USB,

@ -28,6 +28,8 @@
#include <urjtag/cable.h>
#include <urjtag/parport.h>
#include "../cable.h"
typedef struct
{
int signals;

@ -154,7 +154,7 @@ jim_cable_help (urj_log_level_t ll, const char *cablename)
urj_log (ll, _("Usage: cable %s\n"), cablename);
}
urj_cable_driver_t urj_tap_cable_jim_driver = {
const urj_cable_driver_t urj_tap_cable_jim_driver = {
"JIM",
N_("JTAG target simulator JIM"),
jim_cable_connect,

@ -588,7 +588,7 @@ jlink_set_signal (urj_cable_t *cable, int mask, int val)
return 1;
}
urj_cable_driver_t urj_tap_cable_jlink_driver = {
const urj_cable_driver_t urj_tap_cable_jlink_driver = {
"jlink",
N_("Segger/IAR J-Link, Atmel SAM-ICE and others."),
URJ_CABLE_DEVICE_USB,

@ -148,7 +148,7 @@ keithkoep_set_signal (urj_cable_t *cable, int mask, int val)
return prev_sigs;
}
urj_cable_driver_t urj_tap_cable_keithkoep_driver = {
const urj_cable_driver_t urj_tap_cable_keithkoep_driver = {
"KeithKoep",
N_("Keith & Koep JTAG cable"),
URJ_CABLE_DEVICE_PARPORT,

@ -140,7 +140,7 @@ lattice_set_signal (urj_cable_t *cable, int mask, int val)
return prev_sigs;
}
urj_cable_driver_t urj_tap_cable_lattice_driver = {
const urj_cable_driver_t urj_tap_cable_lattice_driver = {
"Lattice",
N_("Lattice Parallel Port JTAG Cable"),
URJ_CABLE_DEVICE_PARPORT,

@ -148,7 +148,7 @@ minimal_set_signal (urj_cable_t *cable, int mask, int val)
return prev_sigs;
}
urj_cable_driver_t urj_tap_cable_minimal_driver = {
const urj_cable_driver_t urj_tap_cable_minimal_driver = {
"Minimal",
N_("Minimal Parallel Port JTAG Cable"),
URJ_CABLE_DEVICE_PARPORT,

@ -147,7 +147,7 @@ mpcbdm_set_signal (urj_cable_t *cable, int mask, int val)
return prev_sigs;
}
urj_cable_driver_t urj_tap_cable_mpcbdm_driver = {
const urj_cable_driver_t urj_tap_cable_mpcbdm_driver = {
"MPCBDM",
N_("Mpcbdm JTAG cable"),
URJ_CABLE_DEVICE_PARPORT,

@ -150,7 +150,7 @@ triton_set_signal (urj_cable_t *cable, int mask, int val)
return prev_sigs;
}
urj_cable_driver_t urj_tap_cable_triton_driver = {
const urj_cable_driver_t urj_tap_cable_triton_driver = {
"TRITON",
N_("Ka-Ro TRITON Starterkit II (PXA255/250) JTAG Cable"),
URJ_CABLE_DEVICE_PARPORT,

@ -292,7 +292,7 @@ ts7800_help (urj_log_level_t ll, const char *cablename)
_("Usage: cable %s\n" "\n"), cablename);
}
urj_cable_driver_t urj_tap_cable_ts7800_driver = {
const urj_cable_driver_t urj_tap_cable_ts7800_driver = {
"ts7800",
N_("TS-7800 Built-in JTAG Chain"),
URJ_CABLE_DEVICE_OTHER,

@ -509,7 +509,7 @@ usbblaster_help (urj_log_level_t ll, const char *cablename)
DEFAULT_DRIVER);
}
urj_cable_driver_t urj_tap_cable_usbblaster_driver = {
const urj_cable_driver_t urj_tap_cable_usbblaster_driver = {
"UsbBlaster",
N_("Altera USB-Blaster Cable"),
URJ_CABLE_DEVICE_USB,

@ -342,7 +342,7 @@ ep9307_help (urj_log_level_t ll, const char *cablename)
urj_log (ll, _("Usage: cable %s\n" "\n"), cablename);
}
urj_cable_driver_t urj_tap_cable_ep9307_driver = {
const urj_cable_driver_t urj_tap_cable_ep9307_driver = {
"EP9307",
N_("Vision EP9307 SoM GPIO JTAG Cable"),
URJ_CABLE_DEVICE_OTHER,

@ -415,7 +415,7 @@ wiggler_help (urj_log_level_t ll, const char *cablename)
cablename, std_wgl_map);
}
urj_cable_driver_t urj_tap_cable_wiggler_driver = {
const urj_cable_driver_t urj_tap_cable_wiggler_driver = {
"WIGGLER",
N_("Macraigor Wiggler JTAG Cable"),
URJ_CABLE_DEVICE_PARPORT,
@ -434,7 +434,7 @@ urj_cable_driver_t urj_tap_cable_wiggler_driver = {
wiggler_help
};
urj_cable_driver_t urj_tap_cable_igloo_driver = {
const urj_cable_driver_t urj_tap_cable_igloo_driver = {
"IGLOO",
N_("Excelpoint IGLOO JTAG Cable"),
URJ_CABLE_DEVICE_PARPORT,

@ -159,7 +159,7 @@ wiggler2_set_signal (urj_cable_t *cable, int mask, int val)
return prev_sigs;
}
urj_cable_driver_t urj_tap_cable_wiggler2_driver = {
const urj_cable_driver_t urj_tap_cable_wiggler2_driver = {
"WIGGLER2",
N_("Modified (with CPU Reset) WIGGLER JTAG Cable"),
URJ_CABLE_DEVICE_PARPORT,

@ -680,7 +680,7 @@ xpc_ext_transfer (urj_cable_t *cable, int len, const char *in, char *out)
/* ---------------------------------------------------------------------- */
urj_cable_driver_t urj_tap_cable_xpc_int_driver = {
const urj_cable_driver_t urj_tap_cable_xpc_int_driver = {
"xpc_int",
N_("Xilinx Platform Cable USB internal chain"),
URJ_CABLE_DEVICE_USB,
@ -707,7 +707,7 @@ urj_usbconn_cable_t urj_tap_cable_usbconn_xpc_int = {
0x0008 /* PID (8) */
};
urj_cable_driver_t urj_tap_cable_xpc_ext_driver = {
const urj_cable_driver_t urj_tap_cable_xpc_ext_driver = {
"xpc_ext",
N_("Xilinx Platform Cable USB external chain"),
URJ_CABLE_DEVICE_USB,

Loading…
Cancel
Save