driver-klondike.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. #ifndef BFG_DRIVER_KLONDIKE_H
  2. #define BFG_DRIVER_KLONDIKE_H
  3. #include <stdbool.h>
  4. #include <stdint.h>
  5. #include <sys/time.h>
  6. #include <pthread.h>
  7. #include "lowlevel.h"
  8. #include "miner.h"
  9. struct klondike_info {
  10. pthread_rwlock_t stat_lock;
  11. struct thr_info replies_thr;
  12. cglock_t klist_lock;
  13. struct klist *used;
  14. struct klist *free;
  15. int kline_count;
  16. int used_count;
  17. int block_seq;
  18. struct klist *status;
  19. struct device_info *devinfo;
  20. struct klist *cfg;
  21. struct jobque *jobque;
  22. int noncecount;
  23. uint64_t hashcount;
  24. uint64_t errorcount;
  25. uint64_t noisecount;
  26. int incorrect_slave_sequential;
  27. int16_t nonce_offset;
  28. // us Delay from USB reply to being processed
  29. double delay_count;
  30. double delay_total;
  31. double delay_min;
  32. double delay_max;
  33. struct timeval tv_last_nonce_received;
  34. // Time from recieving one nonce to the next
  35. double nonce_count;
  36. double nonce_total;
  37. double nonce_min;
  38. double nonce_max;
  39. int wque_size;
  40. int wque_cleared;
  41. int clock;
  42. bool initialised;
  43. struct libusb_device_handle *usbdev_handle;
  44. // TODO:
  45. bool usbinfo_nodev;
  46. int max_work_count;
  47. int old_work_ms;
  48. };
  49. extern bool klondike_lowl_probe_custom(const struct lowlevel_device_info * const info, struct device_drv * const drv, struct klondike_info * const klninfo);
  50. extern struct device_drv klondike_drv;
  51. #endif