Commit 8e69d75f36f58adefa32a5b3250c9ec4ddb0202d

Con Kolivas 2013-04-07T11:59:14

Store the subid for the work item in avalon.

diff --git a/driver-avalon.c b/driver-avalon.c
index b263d0a..959b43e 100644
--- a/driver-avalon.c
+++ b/driver-avalon.c
@@ -771,15 +771,17 @@ static inline void adjust_fan(struct avalon_info *info)
 
 static bool avalon_fill(struct cgpu_info *avalon)
 {
+	int subid, mc = avalon_infos[avalon->device_id]->miner_count;
 	struct work *work;
-	int mc = avalon_infos[avalon->device_id]->miner_count;
 
 	if (avalon->queued >= mc)
 		return true;
 	work = get_queued(avalon);
 	if (unlikely(!work))
 		return false;
-	avalon->works[avalon->work_array * mc + avalon->queued++] = work;
+	subid = avalon->queued++;
+	work->subid = subid;
+	avalon->works[avalon->work_array * mc + subid] = work;
 	if (avalon->queued >= mc)
 		return true;
 	return false;