Browse Source

antminer: Match Product strings including "Antminer"

Luke Dashjr 10 years ago
parent
commit
90db7870b5
2 changed files with 8 additions and 0 deletions
  1. 1 0
      70-bfgminer.rules.in
  2. 7 0
      driver-antminer.c

+ 1 - 0
70-bfgminer.rules.in

@@ -9,6 +9,7 @@ LABEL="bfgminer_start"
 @USE_BITFORCE_TRUE@ENV{ID_MODEL}=="*BitFORCE*SHA256*", GOTO="bfgminer_add"
 @USE_COINTERRA_TRUE@ENV{ID_MODEL}=="*GoldStrike*", GOTO="bfgminer_add"
 @USE_DRILLBIT_TRUE@ENV{manufacturer}=="*Drillbit*", GOTO="bfgminer_add"
+@USE_ICARUS_TRUE@ENV{ID_MODEL}=="*Antminer*", GOTO="bfgminer_add"
 @USE_ICARUS_TRUE@ENV{ID_MODEL}=="*Cairnsmore1*", GOTO="bfgminer_add"
 @USE_ICARUS_TRUE@ENV{ID_MODEL}=="*Block*Erupter*", GOTO="bfgminer_add"
 @USE_HASHBUSTER_TRUE@ENV{ID_MODEL}=="*HashBuster*", GOTO="bfgminer_add"

+ 7 - 0
driver-antminer.c

@@ -65,6 +65,12 @@ bool antminer_detect_one(const char *devpath)
 	return true;
 }
 
+static
+bool antminer_lowl_match(const struct lowlevel_device_info * const info)
+{
+	return lowlevel_match_lowlproduct(info, &lowl_vcom, "Antminer");
+}
+
 static
 bool antminer_lowl_probe(const struct lowlevel_device_info * const info)
 {
@@ -212,6 +218,7 @@ void antminer_drv_init()
 	antminer_drv = icarus_drv;
 	antminer_drv.dname = "antminer";
 	antminer_drv.name = "AMU";
+	antminer_drv.lowl_match = antminer_lowl_match;
 	antminer_drv.lowl_probe = antminer_lowl_probe;
 	antminer_drv.set_device = antminer_set_device,
 	antminer_drv.identify_device = antminer_identify;