Browse Source

Merge branch 'dev_x6500' into bfgminer

Conflicts:
	API-README
Luke Dashjr 13 years ago
parent
commit
32d95aebc7
2 changed files with 28 additions and 46 deletions
  1. 6 0
      API-README
  2. 22 46
      api.c

+ 6 - 0
API-README

@@ -384,6 +384,12 @@ miner.php - an example web page to access the API
 Feature Changelog for external applications using the API:
 Feature Changelog for external applications using the API:
 
 
 
 
+API V?
+
+Support for the X6500 FPGA was added
+
+----------
+
 API V1.20 (BFGMiner v2.9.0)
 API V1.20 (BFGMiner v2.9.0)
 
 
 Modified API commands:
 Modified API commands:

+ 22 - 46
api.c

@@ -28,7 +28,7 @@
 #include "util.h"
 #include "util.h"
 #include "driver-cpu.h" /* for algo_names[], TODO: re-factor dependency */
 #include "driver-cpu.h" /* for algo_names[], TODO: re-factor dependency */
 
 
-#if defined(USE_BITFORCE) || defined(USE_ICARUS) || defined(USE_ZTEX) || defined(USE_MODMINER)
+#if defined(USE_BITFORCE) || defined(USE_ICARUS) || defined(USE_MODMINER) || defined(USE_X6500) || defined(USE_ZTEX)
 #define HAVE_AN_FPGA 1
 #define HAVE_AN_FPGA 1
 #endif
 #endif
 
 
@@ -168,6 +168,9 @@ static const char *DEVICECODE = ""
 #ifdef USE_ICARUS
 #ifdef USE_ICARUS
 			"ICA "
 			"ICA "
 #endif
 #endif
+#ifdef USE_X6500
+			"XBS "
+#endif
 #ifdef USE_ZTEX
 #ifdef USE_ZTEX
 			"ZTX "
 			"ZTX "
 #endif
 #endif
@@ -575,21 +578,12 @@ struct APIGROUPS {
 static struct IP4ACCESS *ipaccess = NULL;
 static struct IP4ACCESS *ipaccess = NULL;
 static int ips = 0;
 static int ips = 0;
 
 
-#ifdef USE_BITFORCE
-extern struct device_api bitforce_api;
-#endif
-
-#ifdef USE_ICARUS
-extern struct device_api cairnsmore_api;
-extern struct device_api icarus_api;
-#endif
-
-#ifdef USE_ZTEX
-extern struct device_api ztex_api;
+#ifdef HAVE_OPENCL
+extern struct device_api opencl_api;
 #endif
 #endif
 
 
-#ifdef USE_MODMINER
-extern struct device_api modminer_api;
+#ifdef WANT_CPUMINE
+extern struct device_api cpu_api;
 #endif
 #endif
 
 
 // This is only called when expected to be needed (rarely)
 // This is only called when expected to be needed (rarely)
@@ -1016,24 +1010,15 @@ static int numpgas()
 	int i;
 	int i;
 
 
 	for (i = 0; i < total_devices; i++) {
 	for (i = 0; i < total_devices; i++) {
-#ifdef USE_BITFORCE
-		if (devices[i]->api == &bitforce_api)
-			count++;
-#endif
-#ifdef USE_ICARUS
-		if (devices[i]->api == &cairnsmore_api)
-			count++;
-		if (devices[i]->api == &icarus_api)
-			count++;
-#endif
-#ifdef USE_ZTEX
-		if (devices[i]->api == &ztex_api)
-			count++;
+#ifdef HAVE_OPENCL
+		if (devices[i]->api == &opencl_api)
+			continue;
 #endif
 #endif
-#ifdef USE_MODMINER
-		if (devices[i]->api == &modminer_api)
-			count++;
+#ifdef WANT_CPUMINE
+		if (devices[i]->api == &cpu_api)
+			continue;
 #endif
 #endif
+		++count;
 	}
 	}
 	return count;
 	return count;
 }
 }
@@ -1044,24 +1029,15 @@ static int pgadevice(int pgaid)
 	int i;
 	int i;
 
 
 	for (i = 0; i < total_devices; i++) {
 	for (i = 0; i < total_devices; i++) {
-#ifdef USE_BITFORCE
-		if (devices[i]->api == &bitforce_api)
-			count++;
-#endif
-#ifdef USE_ICARUS
-		if (devices[i]->api == &cairnsmore_api)
-			count++;
-		if (devices[i]->api == &icarus_api)
-			count++;
-#endif
-#ifdef USE_ZTEX
-		if (devices[i]->api == &ztex_api)
-			count++;
+#ifdef HAVE_OPENCL
+		if (devices[i]->api == &opencl_api)
+			continue;
 #endif
 #endif
-#ifdef USE_MODMINER
-		if (devices[i]->api == &modminer_api)
-			count++;
+#ifdef WANT_CPUMINE
+		if (devices[i]->api == &cpu_api)
+			continue;
 #endif
 #endif
+		++count;
 		if (count == (pgaid + 1))
 		if (count == (pgaid + 1))
 			return i;
 			return i;
 	}
 	}