Remove the --device and --remove-disabled options which don't work in a meaningful way any more
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180
diff --git a/README b/README
index 80a4b4e..3d3b3fa 100644
--- a/README
+++ b/README
@@ -198,7 +198,6 @@ Options for both config file and command line:
--btc-address <arg> Set bitcoin target address when solo mining to bitcoind
--compact Use compact display without per device statistics
--debug|-D Enable debug output
---device|-d <arg> Select device to use, one value, range and/or comma separated (e.g. 0-2,4) default: all
--disable-rejecting Automatically disable pools that continually reject shares
--drillbit-options <arg> Set drillbit options <int|ext>:clock[:clock_divider][:voltage]
--expiry|-E <arg> Upper bound on how many seconds after getting work we consider a share from it stale (default: 120)
@@ -228,7 +227,6 @@ Options for both config file and command line:
--quiet|-q Disable logging output, display status and errors
--quota|-U <arg> quota;URL combination for server with load-balance strategy quotas
--real-quiet Disable all output
---remove-disabled Remove disabled devices entirely, as if they didn't exist
--rotate <arg> Change multipool strategy from failover to regularly rotate at N minutes (default: 0)
--round-robin Change multipool strategy from failover to round robin on failure
--scan-time|-s <arg> Upper bound on time spent scanning current work, in seconds (default: -1)
@@ -438,10 +436,6 @@ If one of the 10 devices stops working, hotplug - if enabled, as is default
--usb :0 will disable all USB I/O other than to initialise libusb
-NOTE: The --device option will limit which devices are in use based on their
-numbering order of the total devices, so if you hotplug USB devices regularly,
-it will not reliably be the same devices.
-
---
WHILE RUNNING:
diff --git a/cgminer.c b/cgminer.c
index 95fffe7..3b0a2ea 100644
--- a/cgminer.c
+++ b/cgminer.c
@@ -159,10 +159,7 @@ bool opt_restart = true;
bool opt_nogpu;
struct list_head scan_devices;
-static bool devices_enabled[MAX_DEVICES];
-static int opt_devs_enabled;
static bool opt_display_devs;
-static bool opt_removedisabled;
int total_devices;
int zombie_devs;
static int most_devices;
@@ -740,49 +737,6 @@ void get_intrange(char *arg, int *val1, int *val2)
*val2 = *val1;
}
-static char *set_devices(char *arg)
-{
- int i, val1 = 0, val2 = 0;
- char *nextptr;
-
- if (*arg) {
- if (*arg == '?') {
- opt_display_devs = true;
- return NULL;
- }
- } else
- return "Invalid device parameters";
-
- nextptr = strtok(arg, ",");
- if (nextptr == NULL)
- return "Invalid parameters for set devices";
- get_intrange(nextptr, &val1, &val2);
- if (val1 < 0 || val1 > MAX_DEVICES || val2 < 0 || val2 > MAX_DEVICES ||
- val1 > val2) {
- return "Invalid value passed to set devices";
- }
-
- for (i = val1; i <= val2; i++) {
- devices_enabled[i] = true;
- opt_devs_enabled++;
- }
-
- while ((nextptr = strtok(NULL, ",")) != NULL) {
- get_intrange(nextptr, &val1, &val2);
- if (val1 < 0 || val1 > MAX_DEVICES || val2 < 0 || val2 > MAX_DEVICES ||
- val1 > val2) {
- return "Invalid value passed to set devices";
- }
-
- for (i = val1; i <= val2; i++) {
- devices_enabled[i] = true;
- opt_devs_enabled++;
- }
- }
-
- return NULL;
-}
-
static char *set_balance(enum pool_strategy *strategy)
{
*strategy = POOL_BALANCE;
@@ -1361,9 +1315,6 @@ static struct opt_table opt_config_table[] = {
OPT_WITHOUT_ARG("--debug|-D",
enable_debug, &opt_debug,
"Enable debug output"),
- OPT_WITH_ARG("--device|-d",
- set_devices, NULL, NULL,
- "Select device to use, one value, range and/or comma separated (e.g. 0-2,4) default: all"),
OPT_WITHOUT_ARG("--disable-rejecting",
opt_set_bool, &opt_disable_pool,
"Automatically disable pools that continually reject shares"),
@@ -1496,9 +1447,6 @@ static struct opt_table opt_config_table[] = {
OPT_WITHOUT_ARG("--real-quiet",
opt_set_bool, &opt_realquiet,
"Disable all output"),
- OPT_WITHOUT_ARG("--remove-disabled",
- opt_set_bool, &opt_removedisabled,
- "Remove disabled devices entirely, as if they didn't exist"),
OPT_WITH_ARG("--retries",
set_null, NULL, NULL,
opt_hidden),
@@ -5039,27 +4987,6 @@ void write_config(FILE *fcfg)
fprintf(fcfg, ",\n\"stop-time\" : \"%d:%d\"", schedstop.tm.tm_hour, schedstop.tm.tm_min);
if (opt_socks_proxy && *opt_socks_proxy)
fprintf(fcfg, ",\n\"socks-proxy\" : \"%s\"", json_escape(opt_socks_proxy));
- if (opt_devs_enabled) {
- fprintf(fcfg, ",\n\"device\" : \"");
- bool extra_devs = false;
-
- for (i = 0; i < MAX_DEVICES; i++) {
- if (devices_enabled[i]) {
- int startd = i;
-
- if (extra_devs)
- fprintf(fcfg, ",");
- while (i < MAX_DEVICES && devices_enabled[i + 1])
- ++i;
- fprintf(fcfg, "%d", startd);
- if (i > startd)
- fprintf(fcfg, "-%d", i);
- }
- }
- fprintf(fcfg, "\"");
- }
- if (opt_removedisabled)
- fprintf(fcfg, ",\n\"remove-disabled\" : true");
if (opt_api_allow)
fprintf(fcfg, ",\n\"api-allow\" : \"%s\"", json_escape(opt_api_allow));
if (strcmp(opt_api_mcast_addr, API_MCAST_ADDR) != 0)
@@ -9097,8 +9024,7 @@ static void hotplug_process(void)
int dev_no = total_devices + i;
cgpu = devices[dev_no];
- if (!opt_devs_enabled || (opt_devs_enabled && devices_enabled[dev_no]))
- enable_device(cgpu);
+ enable_device(cgpu);
cgpu->cgminer_stats.getwork_wait_min.tv_sec = MIN_SEC_UNSET;
cgpu->rolling = cgpu->total_mhashes = 0;
}
@@ -9442,23 +9368,8 @@ int main(int argc, char *argv[])
}
mining_threads = 0;
- if (opt_devs_enabled) {
- for (i = 0; i < MAX_DEVICES; i++) {
- if (devices_enabled[i]) {
- if (i >= total_devices)
- quit (1, "Command line options set a device that doesn't exist");
- enable_device(devices[i]);
- } else if (i < total_devices) {
- if (!opt_removedisabled)
- enable_device(devices[i]);
- devices[i]->deven = DEV_DISABLED;
- }
- }
- total_devices = cgminer_id_count;
- } else {
- for (i = 0; i < total_devices; ++i)
- enable_device(devices[i]);
- }
+ for (i = 0; i < total_devices; ++i)
+ enable_device(devices[i]);
#ifdef USE_USBUTILS
if (!total_devices) {