Browse Source

ftdi: Make ftdi lowlevel code independent of x6500 driver

Luke Dashjr 11 years ago
parent
commit
b932c0cffc
4 changed files with 16 additions and 4 deletions
  1. 5 1
      Makefile.am
  2. 9 1
      configure.ac
  3. 1 1
      lowlevel.c
  4. 1 1
      lowlevel.h

+ 5 - 1
Makefile.am

@@ -255,7 +255,7 @@ bfgminer_SOURCES += driver-modminer.c
 endif
 
 if HAS_X6500
-bfgminer_SOURCES += driver-x6500.c ft232r.c ft232r.h jtag.c jtag.h
+bfgminer_SOURCES += driver-x6500.c jtag.c jtag.h
 endif
 
 if HAS_ZTEX
@@ -299,6 +299,10 @@ if USE_HASHFAST
 bfgminer_SOURCES += driver-hashfast.c
 endif
 
+if NEED_BFG_LOWL_FTDI
+bfgminer_SOURCES += ft232r.c ft232r.h
+endif
+
 if NEED_BFG_LOWL_HID
 bfgminer_SOURCES += lowl-hid.c lowl-hid.h
 bfgminer_CPPFLAGS += $(hidapi_CFLAGS)

+ 9 - 1
configure.ac

@@ -124,6 +124,7 @@ need_binloader=no
 need_dynclock=no
 need_lowl_vcom=no
 need_lowlevel=no
+need_lowl_ftdi=no
 need_lowl_hid=no
 need_lowl_pci=no
 need_lowl_usb=no
@@ -663,7 +664,7 @@ fi
 if test "x$x6500" = xyes; then
 	AC_DEFINE([USE_X6500], [1], [Defined to 1 if X6500 support is wanted])
 	need_dynclock=yes
-	need_lowl_usb=yes
+	need_lowl_ftdi=yes
 	need_binloader=yes
 	has_fpga=yes
 	have_udevrules=true
@@ -977,6 +978,12 @@ if test "x$need_lowl_vcom" != "xno"; then
 	fi
 fi
 
+lowllist="$lowllist ftdi/need_lowl_ftdi"
+if test x$need_lowl_ftdi = xyes; then
+	AC_DEFINE([NEED_BFG_LOWL_FTDI], [1], [Defined to 1 if lowlevel ftdi drivers are being used])
+	need_lowl_usb=yes
+fi
+
 if test "x$need_lowl_usb" = "xno"; then
 	libusb=no
 	LIBUSB_LIBS=''
@@ -1258,6 +1265,7 @@ AM_CONDITIONAL([NEED_LIBBLKMAKER], [test x$with_system_libblkmaker != xyes])
 AM_CONDITIONAL([NEED_BFG_BINLOADER], [test x$need_binloader = xyes])
 AM_CONDITIONAL([NEED_DYNCLOCK], [test x$need_dynclock = xyes])
 AM_CONDITIONAL([NEED_BFG_LOWL_VCOM], [test x$need_lowl_vcom = xyes])
+AM_CONDITIONAL([NEED_BFG_LOWL_FTDI], [test x$need_lowl_ftdi = xyes])
 AM_CONDITIONAL([NEED_BFG_LOWL_HID], [test x$need_lowl_hid = xyes])
 AM_CONDITIONAL([NEED_BFG_LOWL_PCI], [test x$need_lowl_pci = xyes])
 AM_CONDITIONAL([NEED_BFG_LOWLEVEL], [test x$need_lowlevel = xyes])

+ 1 - 1
lowlevel.c

@@ -94,7 +94,7 @@ struct lowlevel_device_info *lowlevel_scan()
 	LL_CONCAT(devinfo_list, devinfo_mid_list);
 #endif
 	
-#ifdef USE_X6500
+#ifdef NEED_BFG_LOWL_FTDI
 	devinfo_mid_list = lowl_ft232r.devinfo_scan();
 	LL_CONCAT(devinfo_list, devinfo_mid_list);
 #endif

+ 1 - 1
lowlevel.h

@@ -57,7 +57,7 @@ extern struct lowlevel_device_info *lowlevel_ref(const struct lowlevel_device_in
 extern void lowlevel_devinfo_semicpy(struct lowlevel_device_info *dst, const struct lowlevel_device_info *src);
 extern void lowlevel_devinfo_free(struct lowlevel_device_info *);
 
-#ifdef USE_X6500
+#ifdef NEED_BFG_LOWL_FTDI
 extern struct lowlevel_driver lowl_ft232r;
 #endif
 #ifdef NEED_BFG_LOWL_HID