summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
47661ce)
Signed-off-by: Michal Demin <michaldemin@gmail.com>
#ifdef JTAGKEY
char *pbuf;
unsigned short vid, pid;
#ifdef JTAGKEY
char *pbuf;
unsigned short vid, pid;
int line, len, num;
#endif
int line, len, num;
#endif
pbuf = buf + i;
for (; i < len; i++) {
pbuf = buf + i;
for (; i < len; i++) {
- if (buf[i] == ' ' || buf[i] == '\t')
+ if (buf[i] == ' ' || buf[i] == '\t' || buf[i] == ':')
+ iface = 0;
+ pbuf = buf + i;
+ if (pbuf[0] == ':') {
+ iface = atoi(pbuf + 1);
+ }
+
pp_config[num].real = 0;
pp_config[num].usb_vid = vid;
pp_config[num].usb_pid = pid;
pp_config[num].real = 0;
pp_config[num].usb_vid = vid;
pp_config[num].usb_pid = pid;
+ pp_config[num].usb_iface = iface;
pp_config[num].open = jtagkey_open;
pp_config[num].close = jtagkey_close;
pp_config[num].transfer = jtagkey_transfer;
pp_config[num].open = jtagkey_open;
pp_config[num].close = jtagkey_close;
pp_config[num].transfer = jtagkey_transfer;
+
+unsigned short config_usb_iface(int num) {
+ unsigned short ret = 0x00;
+ int i;
+
+ read_config();
+
+ for (i=0; i<sizeof(pp_config)/sizeof(struct parport_config); i++) {
+ if (pp_config[i].num == num) {
+ ret = pp_config[i].usb_iface;
+ break;
+ }
+ }
+
+ return ret;
+}
+
unsigned char real;
unsigned short usb_vid;
unsigned short usb_pid;
unsigned char real;
unsigned short usb_vid;
unsigned short usb_pid;
+ unsigned short usb_iface;
int (*open) (int num);
void (*close) (int handle);
int (*transfer) (WD_TRANSFER *tr, int fd, unsigned int request, int ppbase, int ecpbase, int num);
int (*open) (int num);
void (*close) (int handle);
int (*transfer) (WD_TRANSFER *tr, int fd, unsigned int request, int ppbase, int ecpbase, int num);
unsigned char __attribute__ ((visibility ("hidden"))) config_is_real_pport(int num);
unsigned short __attribute__ ((visibility ("hidden"))) config_usb_vid(int num);
unsigned short __attribute__ ((visibility ("hidden"))) config_usb_pid(int num);
unsigned char __attribute__ ((visibility ("hidden"))) config_is_real_pport(int num);
unsigned short __attribute__ ((visibility ("hidden"))) config_usb_vid(int num);
unsigned short __attribute__ ((visibility ("hidden"))) config_usb_pid(int num);
+unsigned short __attribute__ ((visibility ("hidden"))) config_usb_iface(int num);
-static int jtagkey_init(unsigned short vid, unsigned short pid) {
+static int jtagkey_init(unsigned short vid, unsigned short pid, unsigned short iface) {
int ret = 0;
unsigned char c;
int ret = 0;
unsigned char c;
- if ((ret = ftdi_set_interface(&ftdic, INTERFACE_A)) != 0) {
+ if ((ret = ftdi_set_interface(&ftdic, iface)) != 0) {
fprintf(stderr, "unable to set interface: %d (%s)\n", ret, ftdi_get_error_string(&ftdic));
return ret;
}
fprintf(stderr, "unable to set interface: %d (%s)\n", ret, ftdi_get_error_string(&ftdic));
return ret;
}
int jtagkey_open(int num) {
int ret;
int jtagkey_open(int num) {
int ret;
- ret = jtagkey_init(config_usb_vid(num), config_usb_pid(num));
+ ret = jtagkey_init(config_usb_vid(num), config_usb_pid(num), config_usb_iface(num));
if (ret >= 0)
ret = 0xff;
if (ret >= 0)
ret = 0xff;
# Amontec Jtagkey
LPT2 = FTDI:0403:cff8
# Amontec Jtagkey
LPT2 = FTDI:0403:cff8
+# Dangerous Prototypes Bus Blaster v2
+LPT3 = FTDI:0403:6010:2
+