Commit 84364a18298b60f8abcc6d2b409452981a2f00db

ckolivas 2014-02-27T16:18:56

Add an option to disable dynamic core shedding on hashfast devices.

diff --git a/cgminer.c b/cgminer.c
index dcf014e..36d1158 100644
--- a/cgminer.c
+++ b/cgminer.c
@@ -1314,6 +1314,9 @@ static struct opt_table opt_config_table[] = {
 	OPT_WITH_ARG("--hfa-name",
 		     opt_set_charp, NULL, &opt_hfa_name,
 		     "Set a unique name for a single hashfast device specified with --usb or the first device found"),
+	OPT_WITHOUT_ARG("--hfa-noshed",
+			opt_set_bool, &opt_hfa_noshed,
+			"Disable hashfast dynamic core disabling feature"),
 	OPT_WITH_ARG("--hfa-ntime-roll",
 		     opt_set_intval, NULL, &opt_hfa_ntime_roll,
 		     opt_hidden),
diff --git a/driver-hashfast.c b/driver-hashfast.c
index 8954a82..8defc4a 100644
--- a/driver-hashfast.c
+++ b/driver-hashfast.c
@@ -28,6 +28,7 @@ int opt_hfa_fan_default = HFA_FAN_DEFAULT;
 int opt_hfa_fan_max = HFA_FAN_MAX;
 int opt_hfa_fan_min = HFA_FAN_MIN;
 int opt_hfa_fail_drop = 10;
+bool opt_hfa_noshed;
 
 char *opt_hfa_name;
 
@@ -391,7 +392,8 @@ static bool hfa_reset(struct cgpu_info *hashfast, struct hashfast_info *info)
 	hu->preamble = HF_PREAMBLE;
 	hu->operation_code = OP_USB_INIT;
 	hu->protocol = PROTOCOL_GLOBAL_WORK_QUEUE;	// Protocol to use
-	hu->shed_supported = true;
+	if (!opt_hfa_noshed)
+		hu->shed_supported = true;
 	// Force PLL bypass
 	hu->pll_bypass = opt_hfa_pll_bypass;
 	hu->hash_clock = info->hash_clock_rate;		// Hash clock rate in Mhz
diff --git a/driver-hashfast.h b/driver-hashfast.h
index 237de03..0c7b811 100644
--- a/driver-hashfast.h
+++ b/driver-hashfast.h
@@ -26,6 +26,7 @@ int opt_hfa_fan_default;
 int opt_hfa_fan_max;
 int opt_hfa_fan_min;
 int opt_hfa_fail_drop;
+bool opt_hfa_noshed;
 
 char *set_hfa_fan(char *arg);
 char *opt_hfa_name;