Browse Source

rockminer: Autodetect with "R-BOX miner" or "RX-BOX miner" product strings

Luke Dashjr 11 years ago
parent
commit
2d09732c0f
3 changed files with 11 additions and 0 deletions
  1. 2 0
      70-bfgminer.rules.in
  2. 1 0
      configure.ac
  3. 8 0
      driver-rockminer.c

+ 2 - 0
70-bfgminer.rules.in

@@ -19,6 +19,8 @@ LABEL="bfgminer_start"
 @HAS_LITTLEFURY_TRUE@ENV{ID_MODEL}=="*LittleFury*", GOTO="bfgminer_add"
 @HAS_MODMINER_TRUE@ENV{ID_MODEL}=="*ModMiner*", GOTO="bfgminer_add"
 @HAS_NANOFURY_TRUE@ENV{idVendor}=="04d8", ENV{idProduct}=="00de", ENV{ID_MODEL}=="*NanoFury*", GOTO="bfgminer_add"
+@USE_ROCKMINER_TRUE@ENV{ID_MODEL}=="*R-BOX miner*", GOTO="bfgminer_add"
+@USE_ROCKMINER_TRUE@ENV{ID_MODEL}=="*RX-BOX miner*", GOTO="bfgminer_add"
 @HAS_TWINFURY_TRUE@ENV{ID_MODEL}=="*Twinfury*", GOTO="bfgminer_add"
 @HAS_X6500_TRUE@ENV{idVendor}=="0403", ENV{idProduct}=="6001", ENV{ID_MODEL}=="*X6500 FPGA Miner*", GOTO="bfgminer_add"
 @HAS_ZTEX_TRUE@ENV{ID_MODEL}=="*btcminer for ZTEX*", GOTO="bfgminer_add"

+ 1 - 0
configure.ac

@@ -1046,6 +1046,7 @@ if test "x$rockminer" = xyes; then
 	AC_DEFINE([USE_ROCKMINER], [1], [Defined to 1 if RockMiner support is wanted])
 	need_lowl_vcom=yes
 	has_asic=yes
+	have_udevrules=true
 fi
 AM_CONDITIONAL([USE_ROCKMINER], [test x$rockminer = xyes])
 

+ 8 - 0
driver-rockminer.c

@@ -15,6 +15,7 @@
 #include <unistd.h>
 
 #include "deviceapi.h"
+#include "lowlevel.h"
 #include "lowl-vcom.h"
 #include "miner.h"
 
@@ -62,6 +63,12 @@ void rockminer_job_buf_set_freq(uint8_t * const buf, const unsigned short freq)
 	buf[0x31] = (freq / 10) - 1;
 }
 
+static
+bool rockminer_lowl_match(const struct lowlevel_device_info * const info)
+{
+	return lowlevel_match_product(info, "R-BOX miner") || lowlevel_match_product(info, "RX-BOX miner");
+}
+
 static const uint8_t golden_midstate[] = {
 	0x4a, 0x54, 0x8f, 0xe4, 0x71, 0xfa, 0x3a, 0x9a,
 	0x13, 0x71, 0x14, 0x45, 0x56, 0xc3, 0xf6, 0x4d,
@@ -478,6 +485,7 @@ struct device_drv rockminer_drv = {
 	.dname = "rockminer",
 	.name = "RKM",
 	
+	.lowl_match = rockminer_lowl_match,
 	.lowl_probe = rockminer_lowl_probe,
 	
 	.thread_init = rockminer_init,