Browse Source

bitfury: Add driver-bitfury.h for shared function declarations

Luke Dashjr 12 years ago
parent
commit
c5c541b54d
4 changed files with 23 additions and 13 deletions
  1. 1 1
      Makefile.am
  2. 20 0
      driver-bitfury.h
  3. 1 3
      driver-littlefury.c
  4. 1 9
      driver-metabank.c

+ 1 - 1
Makefile.am

@@ -211,7 +211,7 @@ bfgminer_SOURCES += driver-ztex.c libztex.c libztex.h
 endif
 
 if HAS_BITFURY
-bfgminer_SOURCES += driver-bitfury.c libbitfury.c libbitfury.h spidevc.h spidevc.c driver-metabank.c tm_i2c.h tm_i2c.c
+bfgminer_SOURCES += driver-bitfury.c driver-bitfury.h libbitfury.c libbitfury.h spidevc.h spidevc.c driver-metabank.c tm_i2c.h tm_i2c.c
 
 if HAS_LITTLEFURY
 bfgminer_SOURCES += driver-littlefury.c

+ 20 - 0
driver-bitfury.h

@@ -0,0 +1,20 @@
+#ifndef BFG_DRIVER_BITFURY_H
+#define BFG_DRIVER_BITFURY_H
+
+#include <stdbool.h>
+#include <stdint.h>
+
+#include "miner.h"
+
+extern bool bitfury_prepare(struct thr_info *);
+extern bool bitfury_init_oldbuf(struct cgpu_info *);
+
+extern int64_t bitfury_scanHash(struct thr_info *);
+
+extern bool bitfury_job_prepare(struct thr_info *, struct work *, uint64_t max_nonce);
+extern void bitfury_do_io(struct thr_info *);
+extern int64_t bitfury_job_process_results(struct thr_info *, struct work *, bool stopping);
+
+extern void bitfury_shutdown(struct thr_info *);
+
+#endif

+ 1 - 3
driver-littlefury.c

@@ -15,6 +15,7 @@
 #include <unistd.h>
 
 #include "deviceapi.h"
+#include "driver-bitfury.h"
 #include "fpgautils.h"
 #include "libbitfury.h"
 #include "logging.h"
@@ -410,9 +411,6 @@ int64_t littlefury_job_process_results(struct thr_info *thr, struct work *work,
 	return 0x100000000;
 }
 
-extern int64_t bitfury_scanHash(struct thr_info *);
-extern void bitfury_shutdown(struct thr_info *);
-
 static void littlefury_shutdown(struct thr_info *thr)
 {
 	struct cgpu_info * const cgpu = thr->cgpu;

+ 1 - 9
driver-metabank.c

@@ -25,6 +25,7 @@
 #include "config.h"
 
 #include "deviceapi.h"
+#include "driver-bitfury.h"
 #include "libbitfury.h"
 #include "spidevc.h"
 #include "tm_i2c.h"
@@ -148,8 +149,6 @@ static void metabank_detect(void)
 	noserial_detect_manual(&metabank_drv, metabank_autodetect);
 }
 
-extern bool bitfury_prepare(struct thr_info *);
-
 static
 bool metabank_init(struct thr_info *thr)
 {
@@ -170,19 +169,12 @@ bool metabank_init(struct thr_info *thr)
 	return true;
 }
 
-extern int64_t bitfury_scanHash(struct thr_info *);
-extern void bitfury_shutdown(struct thr_info *);
-
 static void metabank_shutdown(struct thr_info *thr)
 {
 	bitfury_shutdown(thr);
 	tm_i2c_close();
 }
 
-extern bool bitfury_job_prepare(struct thr_info *, struct work *, uint64_t max_nonce);
-extern void bitfury_do_io(struct thr_info *);
-extern int64_t bitfury_job_process_results(struct thr_info *, struct work *, bool stopping);
-
 struct device_drv metabank_drv = {
 	.dname = "metabank",
 	.name = "MBF",