distinguish between drv and it's id enum now called drv_id
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 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245
diff --git a/api.c b/api.c
index 4998d97..1a2f312 100644
--- a/api.c
+++ b/api.c
@@ -1150,19 +1150,19 @@ static int numpgas()
for (i = 0; i < total_devices; i++) {
#ifdef USE_BITFORCE
- if (devices[i]->drv->drv == DRIVER_BITFORCE)
+ if (devices[i]->drv->drv_id == DRIVER_BITFORCE)
count++;
#endif
#ifdef USE_ICARUS
- if (devices[i]->drv->drv == DRIVER_ICARUS)
+ if (devices[i]->drv->drv_id == DRIVER_ICARUS)
count++;
#endif
#ifdef USE_ZTEX
- if (devices[i]->drv->drv == DRIVER_ZTEX)
+ if (devices[i]->drv->drv_id == DRIVER_ZTEX)
count++;
#endif
#ifdef USE_MODMINER
- if (devices[i]->drv->drv == DRIVER_MODMINER)
+ if (devices[i]->drv->drv_id == DRIVER_MODMINER)
count++;
#endif
}
@@ -1176,19 +1176,19 @@ static int pgadevice(int pgaid)
for (i = 0; i < total_devices; i++) {
#ifdef USE_BITFORCE
- if (devices[i]->drv->drv == DRIVER_BITFORCE)
+ if (devices[i]->drv->drv_id == DRIVER_BITFORCE)
count++;
#endif
#ifdef USE_ICARUS
- if (devices[i]->drv->drv == DRIVER_ICARUS)
+ if (devices[i]->drv->drv_id == DRIVER_ICARUS)
count++;
#endif
#ifdef USE_ZTEX
- if (devices[i]->drv->drv == DRIVER_ZTEX)
+ if (devices[i]->drv->drv_id == DRIVER_ZTEX)
count++;
#endif
#ifdef USE_MODMINER
- if (devices[i]->drv->drv == DRIVER_MODMINER)
+ if (devices[i]->drv->drv_id == DRIVER_MODMINER)
count++;
#endif
if (count == (pgaid + 1))
@@ -1532,11 +1532,11 @@ static void pgastatus(struct io_data *io_data, int pga, bool isjson, bool precom
float temp = cgpu->temp;
#ifdef USE_ZTEX
- if (cgpu->drv->drv == DRIVER_ZTEX && cgpu->device_ztex)
+ if (cgpu->drv->drv_id == DRIVER_ZTEX && cgpu->device_ztex)
frequency = cgpu->device_ztex->freqM1 * (cgpu->device_ztex->freqM + 1);
#endif
#ifdef USE_MODMINER
- if (cgpu->drv->drv == DRIVER_MODMINER)
+ if (cgpu->drv->drv_id == DRIVER_MODMINER)
frequency = cgpu->clock;
#endif
diff --git a/cgminer.c b/cgminer.c
index 1a43e77..7a95d1f 100644
--- a/cgminer.c
+++ b/cgminer.c
@@ -5950,7 +5950,7 @@ static void *watchdog_thread(void __maybe_unused *userdata)
continue;
#ifdef WANT_CPUMINE
- if (cgpu->drv->drv == DRIVER_CPU)
+ if (cgpu->drv->drv_id == DRIVER_CPU)
continue;
#endif
if (cgpu->status != LIFE_WELL && (now.tv_sec - thr->last.tv_sec < WATCHDOG_SICK_TIME)) {
@@ -6342,7 +6342,7 @@ void enable_curses(void) {
#ifndef WANT_CPUMINE
struct device_drv cpu_drv;
struct device_drv cpu_drv = {
- .drv = DRIVER_CPU,
+ .drv_id = DRIVER_CPU,
.name = "CPU",
};
#endif
@@ -6375,7 +6375,7 @@ void enable_device(struct cgpu_info *cgpu)
adj_width(mining_threads, &dev_width);
#endif
#ifdef HAVE_OPENCL
- if (cgpu->drv->drv == DRIVER_OPENCL) {
+ if (cgpu->drv->drv_id == DRIVER_OPENCL) {
gpu_threads += cgpu->threads;
}
#endif
@@ -6680,7 +6680,7 @@ int main(int argc, char *argv[])
enable_device(devices[i]);
} else if (i < total_devices) {
if (opt_removedisabled) {
- if (devices[i]->drv->drv == DRIVER_CPU)
+ if (devices[i]->drv->drv_id == DRIVER_CPU)
--opt_n_threads;
} else {
enable_device(devices[i]);
diff --git a/driver-bitforce.c b/driver-bitforce.c
index 69da9a5..de1a8e6 100644
--- a/driver-bitforce.c
+++ b/driver-bitforce.c
@@ -751,7 +751,7 @@ static struct api_data *bitforce_api_stats(struct cgpu_info *cgpu)
}
struct device_drv bitforce_drv = {
- .drv = DRIVER_BITFORCE,
+ .drv_id = DRIVER_BITFORCE,
.dname = "BitForce",
.name = "BFL",
.drv_detect = bitforce_detect,
diff --git a/driver-cpu.c b/driver-cpu.c
index 4b0c086..a8b7a56 100644
--- a/driver-cpu.c
+++ b/driver-cpu.c
@@ -844,7 +844,7 @@ CPUSearch:
}
struct device_drv cpu_drv = {
- .drv = DRIVER_CPU,
+ .drv_id = DRIVER_CPU,
.dname = "cpu",
.name = "CPU",
.drv_detect = cpu_detect,
diff --git a/driver-icarus.c b/driver-icarus.c
index 4930031..9a99e86 100644
--- a/driver-icarus.c
+++ b/driver-icarus.c
@@ -901,7 +901,7 @@ static void icarus_shutdown(struct thr_info *thr)
}
struct device_drv icarus_drv = {
- .drv = DRIVER_ICARUS,
+ .drv_id = DRIVER_ICARUS,
.dname = "Icarus",
.name = "ICA",
.drv_detect = icarus_detect,
diff --git a/driver-modminer.c b/driver-modminer.c
index 02ad85d..22812aa 100644
--- a/driver-modminer.c
+++ b/driver-modminer.c
@@ -1185,7 +1185,7 @@ static char *modminer_set_device(struct cgpu_info *modminer, char *option, char
}
struct device_drv modminer_drv = {
- .drv = DRIVER_MODMINER,
+ .drv_id = DRIVER_MODMINER,
.dname = "ModMiner",
.name = "MMQ",
.drv_detect = modminer_detect,
diff --git a/driver-opencl.c b/driver-opencl.c
index 299d8c4..0521ac1 100644
--- a/driver-opencl.c
+++ b/driver-opencl.c
@@ -770,7 +770,7 @@ retry:
thr = mining_thr[i];
mutex_unlock(&mining_thr_lock);
cgpu = thr->cgpu;
- if (cgpu->drv->drv != DRIVER_OPENCL)
+ if (cgpu->drv->drv_id != DRIVER_OPENCL)
continue;
if (dev_from_id(i) != selected)
continue;
@@ -1159,7 +1159,7 @@ select_cgpu:
thr = mining_thr[thr_id];
mutex_unlock(&mining_thr_lock);
cgpu = thr->cgpu;
- if (cgpu->drv->drv != DRIVER_OPENCL)
+ if (cgpu->drv->drv_id != DRIVER_OPENCL)
continue;
if (dev_from_id(thr_id) != gpu)
continue;
@@ -1188,7 +1188,7 @@ select_cgpu:
thr = mining_thr[thr_id];
mutex_unlock(&mining_thr_lock);
cgpu = thr->cgpu;
- if (cgpu->drv->drv != DRIVER_OPENCL)
+ if (cgpu->drv->drv_id != DRIVER_OPENCL)
continue;
if (dev_from_id(thr_id) != gpu)
continue;
@@ -1227,7 +1227,7 @@ select_cgpu:
thr = mining_thr[thr_id];
mutex_unlock(&mining_thr_lock);
cgpu = thr->cgpu;
- if (cgpu->drv->drv != DRIVER_OPENCL)
+ if (cgpu->drv->drv_id != DRIVER_OPENCL)
continue;
if (dev_from_id(thr_id) != gpu)
continue;
@@ -1574,7 +1574,7 @@ static void opencl_thread_shutdown(struct thr_info *thr)
}
struct device_drv opencl_drv = {
- .drv = DRIVER_OPENCL,
+ .drv_id = DRIVER_OPENCL,
.dname = "opencl",
.name = "GPU",
.drv_detect = opencl_detect,
diff --git a/miner.h b/miner.h
index f25b626..87d58fe 100644
--- a/miner.h
+++ b/miner.h
@@ -273,7 +273,7 @@ struct thr_info;
struct work;
struct device_drv {
- enum drv_driver drv;
+ enum drv_driver drv_id;
char *dname;
char *name;
diff --git a/usbutils.c b/usbutils.c
index a34028e..ba4db39 100644
--- a/usbutils.c
+++ b/usbutils.c
@@ -1117,17 +1117,17 @@ static struct usb_find_devices *usb_check_each(int drvnum, struct device_drv *dr
static struct usb_find_devices *usb_check(__maybe_unused struct device_drv *drv, __maybe_unused struct libusb_device *dev)
{
#ifdef USE_BITFORCE
- if (drv->drv == DRIVER_BITFORCE)
+ if (drv->drv_id == DRIVER_BITFORCE)
return usb_check_each(DRV_BITFORCE, drv, dev);
#endif
#ifdef USE_ICARUS
- if (drv->drv == DRIVER_ICARUS)
+ if (drv->drv_id == DRIVER_ICARUS)
return usb_check_each(DRV_ICARUS, drv, dev);
#endif
#ifdef USE_MODMINER
- if (drv->drv == DRIVER_MODMINER)
+ if (drv->drv_id == DRIVER_MODMINER)
return usb_check_each(DRV_MODMINER, drv, dev);
#endif