Browse Source

Add driver interface for zero_stats function

Compatible with cgminer function by the same name
Luke Dashjr 11 years ago
parent
commit
3bc9ba5a0f
2 changed files with 3 additions and 0 deletions
  1. 2 0
      miner.c
  2. 1 0
      miner.h

+ 2 - 0
miner.c

@@ -7197,6 +7197,8 @@ void zero_stats(void)
 		cgpu->cgminer_stats.getwork_wait_max.tv_sec = 0;
 		cgpu->cgminer_stats.getwork_wait_max.tv_sec = 0;
 		cgpu->cgminer_stats.getwork_wait_max.tv_usec = 0;
 		cgpu->cgminer_stats.getwork_wait_max.tv_usec = 0;
 		mutex_unlock(&hash_lock);
 		mutex_unlock(&hash_lock);
+		
+		cgpu->drv->zero_stats(cgpu);
 	}
 	}
 }
 }
 
 

+ 1 - 0
miner.h

@@ -316,6 +316,7 @@ struct device_drv {
 	void (*proc_wlogprint_status)(struct cgpu_info *);
 	void (*proc_wlogprint_status)(struct cgpu_info *);
 	void (*proc_tui_wlogprint_choices)(struct cgpu_info *);
 	void (*proc_tui_wlogprint_choices)(struct cgpu_info *);
 	const char *(*proc_tui_handle_choice)(struct cgpu_info *, int input);
 	const char *(*proc_tui_handle_choice)(struct cgpu_info *, int input);
+	void (*zero_stats)(struct cgpu_info *);
 
 
 	// Thread-specific functions
 	// Thread-specific functions
 	bool (*thread_prepare)(struct thr_info *);
 	bool (*thread_prepare)(struct thr_info *);