driver-zeus.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. #ifndef INCLUDE_DRIVER_ZEUS_H
  2. #define INCLUDE_DRIVER_ZEUS_H
  3. #ifdef USE_ZEUS
  4. #define ZEUS_PROTOCOL_DEBUG 1
  5. #define ZEUS_CHIP_GEN 1
  6. #define ZEUS_CHIP_GEN1_CORES 8
  7. #define ZEUS_CHIP_CORES ZEUS_CHIP_GEN1_CORES
  8. #define ZEUS_MIN_CHIPS 6
  9. #define ZEUS_MAX_CHIPS 1024
  10. #define ZEUS_IO_SPEED 115200
  11. #define ZEUS_READ_FAULT_DECISECONDS 2
  12. #define ZEUS_COMMAND_PKT_LEN 84
  13. #define ZEUS_EVENT_PKT_LEN 4
  14. #define ZEUS_CLK_MAX 382 // 0xff * 3/2
  15. #define ZEUS_CLK_MIN 2
  16. #define ZEUS_USB_ID_MODEL_STR1 "CP2102_USB_to_UART_Bridge_Controller"
  17. #define ZEUS_USB_ID_MODEL_STR2 "FT232R_USB_UART"
  18. #define PIPE_R 0
  19. #define PIPE_W 1
  20. struct ZEUS_INFO {
  21. char device_name[24];
  22. int device_fd;
  23. int using_libusb;
  24. bool serial_reopen;
  25. unsigned int nonce_count[ZEUS_MAX_CHIPS][ZEUS_CHIP_CORES];
  26. unsigned int error_count[ZEUS_MAX_CHIPS][ZEUS_CHIP_CORES];
  27. unsigned int workdone;
  28. struct timeval workstart;
  29. struct timeval workend;
  30. struct timeval scanwork_time;
  31. struct timeval work_timeout;
  32. double hashes_per_s;
  33. uint64_t golden_speed_per_core; // speed per core per sec
  34. uint32_t read_count;
  35. uint32_t last_nonce;
  36. int next_chip_clk;
  37. unsigned char freqcode;
  38. struct thr_info *thr;
  39. pthread_t sworkpth;
  40. pthread_mutex_t lock;
  41. cgsem_t wusem;
  42. struct work *current_work;
  43. int baud;
  44. int cores_per_chip;
  45. int chips_count_max;
  46. int chips_count;
  47. int chip_clk;
  48. int chips_bit_num; // log2(chips_count_max)
  49. };
  50. extern struct device_drv zeus_drv;
  51. #endif /* USE_ZEUS */
  52. #endif /* INCLUDE_DRIVER_ZEUS_H */