Browse Source

Make work->device_id unsigned

Luke Dashjr 11 years ago
parent
commit
f5fd7a3ff5
3 changed files with 5 additions and 3 deletions
  1. 1 1
      driver-bifury.c
  2. 1 1
      driver-knc.c
  3. 3 1
      miner.h

+ 1 - 1
driver-bifury.c

@@ -70,7 +70,7 @@ parse:
 
 struct bifury_state {
 	bytes_t buf;
-	uint32_t last_work_id;
+	work_device_id_t last_work_id;
 	int needwork;
 	bool has_needwork;
 	uint8_t *osc6_bits;

+ 1 - 1
driver-knc.c

@@ -598,7 +598,7 @@ void knc_poll(struct thr_info * const thr)
 			--knc->workqueue_size;
 			DL_DELETE(knc->workqueue, work);
 			work->device_id = knc->next_id++ & 0x7fff;
-			HASH_ADD_INT(knc->devicework, device_id, work);
+			HASH_ADD(hh, knc->devicework, device_id, sizeof(work->device_id), work);
 			if (!--workaccept)
 				break;
 		}

+ 3 - 1
miner.h

@@ -1311,6 +1311,8 @@ struct pool {
 #define GETWORK_MODE_STRATUM 'S'
 #define GETWORK_MODE_GBT 'G'
 
+typedef unsigned work_device_id_t;
+
 struct work {
 	unsigned char	data[128];
 	unsigned char	midstate[32];
@@ -1347,7 +1349,7 @@ struct work {
 
 	unsigned char	work_restart_id;
 	int		id;
-	int		device_id;
+	work_device_id_t device_id;
 	UT_hash_handle hh;
 	
 	// Please don't use this if it's at all possible, I'd like to get rid of it eventually.