driver-drillbit.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. /*
  2. * Copyright 2013 Con Kolivas
  3. *
  4. * This program is free software; you can redistribute it and/or modify it
  5. * under the terms of the GNU General Public License as published by the Free
  6. * Software Foundation; either version 3 of the License, or (at your option)
  7. * any later version. See COPYING for more details.
  8. */
  9. #ifndef BITFURY_H
  10. #define BITFURY_H
  11. #include "miner.h"
  12. #include "usbutils.h"
  13. #define WORK_HISTORY_LEN 4
  14. struct drillbit_chip_info;
  15. /* drillbit_info structure applies to entire device */
  16. struct drillbit_info {
  17. struct cgpu_info *base_cgpu;
  18. uint8_t protocol_version;
  19. uint8_t num_chips;
  20. uint16_t capabilities;
  21. char product[8];
  22. uint32_t serial;
  23. struct drillbit_chip_info *chips;
  24. struct timeval tv_lastchipinfo;
  25. struct timeval tv_lasttemp;
  26. uint16_t temp;
  27. uint16_t max_temp;
  28. };
  29. enum drillbit_chip_state {
  30. IDLE, /* Has no work */
  31. WORKING_NOQUEUED, /* Has current work but nothing queued as "next work" */
  32. WORKING_QUEUED /* Has current work and a piece of work queued for after that */
  33. };
  34. struct drillbit_chip_info {
  35. uint16_t chip_id;
  36. struct work *current_work[WORK_HISTORY_LEN];
  37. enum drillbit_chip_state state;
  38. struct timeval tv_start;
  39. uint32_t success_count;
  40. uint32_t error_count;
  41. uint32_t timeout_count;
  42. uint32_t work_sent_count;
  43. uint32_t success_auto;
  44. uint32_t error_auto;
  45. int auto_delta;
  46. int auto_max;
  47. };
  48. #endif /* BITFURY_H */