Browse Source

Bugfix: Remove devtype variable from driver API

This fixes RPC ordering for non-deprecated commands, possibly at the expense of ordering in deprecated ones
Luke Dashjr 12 years ago
parent
commit
ff00c7e66e
5 changed files with 1 additions and 8 deletions
  1. 1 3
      api.c
  2. 0 1
      driver-cpu.c
  3. 0 1
      driver-opencl.c
  4. 0 2
      miner.c
  5. 0 1
      miner.h

+ 1 - 3
api.c

@@ -1421,8 +1421,6 @@ int find_index_by_cgpu(struct cgpu_info *cgpu)
 			break;
 			break;
 		if (devices[i]->device != devices[i] && !per_proc)
 		if (devices[i]->device != devices[i] && !per_proc)
 			continue;
 			continue;
-		if (cgpu->devtype == devices[i]->devtype)
-			++n;
 	}
 	}
 	rd_unlock(&devices_lock);
 	rd_unlock(&devices_lock);
 	return n;
 	return n;
@@ -1521,7 +1519,7 @@ void devstatus_an(struct io_data *io_data, struct cgpu_info *cgpu, bool isjson,
 			break;
 			break;
 	}
 	}
 
 
-	root = api_add_int(root, (char*)cgpu->devtype, &n, true);
+	root = api_add_int(root, "PGA", &n, true);
 	root = api_add_device_identifier(root, cgpu);
 	root = api_add_device_identifier(root, cgpu);
 	root = api_add_string(root, "Enabled", bool2str(enabled), false);
 	root = api_add_string(root, "Enabled", bool2str(enabled), false);
 	root = api_add_string(root, "Status", status2str(status), false);
 	root = api_add_string(root, "Status", status2str(status), false);

+ 0 - 1
driver-cpu.c

@@ -764,7 +764,6 @@ static int cpu_autodetect()
 
 
 		cgpu = &cpus[i];
 		cgpu = &cpus[i];
 		cgpu->drv = &cpu_drv;
 		cgpu->drv = &cpu_drv;
-		cgpu->devtype = "CPU";
 		cgpu->deven = DEV_ENABLED;
 		cgpu->deven = DEV_ENABLED;
 		cgpu->threads = 1;
 		cgpu->threads = 1;
 		cgpu->kname = algo_names[opt_algo];
 		cgpu->kname = algo_names[opt_algo];

+ 0 - 1
driver-opencl.c

@@ -1349,7 +1349,6 @@ static int opencl_autodetect()
 		cgpu = &gpus[i];
 		cgpu = &gpus[i];
 		struct opencl_device_data * const data = cgpu->device_data;
 		struct opencl_device_data * const data = cgpu->device_data;
 		
 		
-		cgpu->devtype = "GPU";
 		cgpu->deven = DEV_ENABLED;
 		cgpu->deven = DEV_ENABLED;
 		cgpu->drv = &opencl_api;
 		cgpu->drv = &opencl_api;
 		cgpu->device_id = i;
 		cgpu->device_id = i;

+ 0 - 2
miner.c

@@ -10553,8 +10553,6 @@ void allocate_cgpu(struct cgpu_info *cgpu, unsigned int *kp)
 	int j;
 	int j;
 	
 	
 	struct device_drv *api = cgpu->drv;
 	struct device_drv *api = cgpu->drv;
-	if (!cgpu->devtype)
-		cgpu->devtype = "PGA";
 	cgpu->cgminer_stats.getwork_wait_min.tv_sec = MIN_SEC_UNSET;
 	cgpu->cgminer_stats.getwork_wait_min.tv_sec = MIN_SEC_UNSET;
 	
 	
 	int threadobj = cgpu->threads;
 	int threadobj = cgpu->threads;

+ 0 - 1
miner.h

@@ -444,7 +444,6 @@ struct cgpu_info {
 	int device_line_id;
 	int device_line_id;
 	struct device_drv *drv;
 	struct device_drv *drv;
 	const struct bfg_set_device_definition *set_device_funcs;
 	const struct bfg_set_device_definition *set_device_funcs;
-	const char *devtype;
 	int device_id;
 	int device_id;
 	char *dev_repr;
 	char *dev_repr;
 	char *dev_repr_ns;
 	char *dev_repr_ns;