unify the usb cable drivers

git-svn-id: https://urjtag.svn.sourceforge.net/svnroot/urjtag/trunk@1719 b68d4a1b-bc3d-0410-92ed-d4ac073336b7
master
Mike Frysinger 15 years ago
parent 28ce1b7021
commit 6696a91bc6

@ -51,7 +51,7 @@
Constify the cable drivers.
* src/tap/cable/generic_usbconn_list.h, src/tap/cable/generic_usbconn.c,
src/tap/cable/generic_usbconn.h: Unify the list of usb cable drivers.
src/tap/cable/generic_usbconn.h: Unify the list of usb sub cable drivers.
* src/tap/cable/ft2232.c, src/tap/cable/ft2232_list.h: Unify the list of
ftdi usb cable drivers.
@ -67,6 +67,10 @@
cable drivers to unify duplicate code and to help with FTDI part decls.
Avoids defining USB cable drivers when support has been disabled.
* src/tap/usbconn.h, src/tap/usbconn.c, src/tap/usbconn_list.h,
src/tap/usbconn/libftd2xx.c, src/tap/usbconn/libftdi.c,
src/tap/usbconn/libusb.c: Unify the usb cable drivers.
2010-01-22 Mike Frysinger <vapier@gentoo.org>
* src/cmd/cmd_bit.c (cmd_bit_print_params): Fix strncat length handling.

@ -29,31 +29,11 @@
#include <urjtag/usbconn.h>
/* @@@@ RFHH stick these into a .h file */
#ifdef HAVE_LIBUSB
extern urj_usbconn_driver_t urj_tap_usbconn_libusb_driver;
#endif /* HAVE_LIBUSB */
#ifdef ENABLE_LOWLEVEL_FTD2XX
extern urj_usbconn_driver_t urj_tap_usbconn_ftd2xx_driver;
extern urj_usbconn_driver_t urj_tap_usbconn_ftd2xx_mpsse_driver;
#endif /* ENABLE_LOWLEVEL_FTD2XX */
#ifdef ENABLE_LOWLEVEL_FTDI
extern urj_usbconn_driver_t urj_tap_usbconn_ftdi_driver;
extern urj_usbconn_driver_t urj_tap_usbconn_ftdi_mpsse_driver;
#endif /* ENABLE_LOWLEVEL_FTDI */
#include "usbconn.h"
urj_usbconn_driver_t *urj_tap_usbconn_drivers[] = {
#ifdef HAVE_LIBUSB
&urj_tap_usbconn_libusb_driver,
#endif /* HAVE_LIBUSB */
#ifdef ENABLE_LOWLEVEL_FTD2XX
&urj_tap_usbconn_ftd2xx_driver,
&urj_tap_usbconn_ftd2xx_mpsse_driver,
#endif /* ENABLE_LOWLEVEL_FTD2XX */
#ifdef ENABLE_LOWLEVEL_FTDI
&urj_tap_usbconn_ftdi_driver,
&urj_tap_usbconn_ftdi_mpsse_driver,
#endif /* ENABLE_LOWLEVEL_FTDI */
#define _URJ_LIST(item) &urj_tap_usbconn_##item##_driver,
#include "usbconn_list.h"
NULL /* last must be NULL */
};

@ -0,0 +1,31 @@
/*
* $Id: buses.h 1711 2010-01-23 19:12:01Z vapier $
*
* Copyright (C) 2003 ETC s.r.o.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
*
* Written by Marcel Telka <marcel@telka.sk>, 2003.
*
*/
#ifndef URJ_CABLE_USBCONN_H
#define URJ_CABLE_USBCONN_H
#define _URJ_LIST(item) extern urj_usbconn_driver_t urj_tap_usbconn_##item##_driver;
#include "usbconn_list.h"
#endif /* URJ_CABLE_USBCONN_H */

@ -43,7 +43,7 @@
#include <urjtag/log.h>
#include <urjtag/usbconn.h>
#include "libftdx.h"
#include "../usbconn.h"
/* enables debug output */
static const char *module = "usbconn_ftd2xx_";
@ -67,9 +67,6 @@ typedef struct
uint8_t *recv_buf;
} ftd2xx_param_t;
urj_usbconn_driver_t urj_tap_usbconn_ftd2xx_driver;
urj_usbconn_driver_t urj_tap_usbconn_ftd2xx_mpsse_driver;
static int usbconn_ftd2xx_common_open (urj_usbconn_t *conn, urj_log_level_t ll);
static void usbconn_ftd2xx_free (urj_usbconn_t *conn);

@ -43,6 +43,7 @@
#include <urjtag/log.h>
#include <urjtag/usbconn.h>
#include "libftdx.h"
#include "../usbconn.h"
typedef struct
{
@ -62,9 +63,6 @@ typedef struct
uint8_t *recv_buf;
} ftdi_param_t;
urj_usbconn_driver_t urj_tap_usbconn_ftdi_driver;
urj_usbconn_driver_t urj_tap_usbconn_ftdi_mpsse_driver;
static int usbconn_ftdi_common_open (urj_usbconn_t *conn, urj_log_level_t ll);
static void usbconn_ftdi_free (urj_usbconn_t *conn);

@ -46,6 +46,7 @@
#include <urjtag/error.h>
#include <urjtag/log.h>
#include <urjtag/usbconn.h>
#include "../usbconn.h"
typedef struct
{
@ -53,8 +54,6 @@ typedef struct
struct usb_dev_handle *handle;
} urj_usbconn_libusb_param_t;
urj_usbconn_driver_t urj_tap_usbconn_libusb_driver;
/* ---------------------------------------------------------------------- */
static int

@ -0,0 +1,37 @@
/*
* $Id: buses.h 1687 2009-12-29 23:53:09Z arniml $
*
* Copyright (C) 2003 ETC s.r.o.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
*
* Written by Marcel Telka <marcel@telka.sk>, 2003.
*
*/
#ifdef HAVE_LIBUSB
_URJ_LIST(libusb)
#endif
#ifdef ENABLE_LOWLEVEL_FTD2XX
_URJ_LIST(ftd2xx)
_URJ_LIST(ftd2xx_mpsse)
#endif
#ifdef ENABLE_LOWLEVEL_FTDI
_URJ_LIST(ftdi)
_URJ_LIST(ftdi_mpsse)
#endif
#undef _URJ_LIST
Loading…
Cancel
Save