driver-hashfast.h 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /*
  2. * Copyright 2013 Con Kolivas <kernel@kolivas.org>
  3. * Copyright 2013 Hashfast
  4. *
  5. * This program is free software; you can redistribute it and/or modify it
  6. * under the terms of the GNU General Public License as published by the Free
  7. * Software Foundation; either version 3 of the License, or (at your option)
  8. * any later version. See COPYING for more details.
  9. */
  10. #ifndef HASHFAST_H
  11. #define HASHFAST_H
  12. #ifdef USE_HASHFAST
  13. #include "miner.h"
  14. #include "elist.h"
  15. #include "hf_protocol.h"
  16. #define HASHFAST_MINER_THREADS 1
  17. #define HF_NUM_SEQUENCE 256
  18. struct hashfast_info {
  19. int asic_count; // # of chips in the chain
  20. int core_count; // # of cores per chip
  21. int device_type; // What sort of device this is
  22. int ref_frequency; // Reference clock rate
  23. uint16_t hash_sequence; // The next hash sequence # to be sent
  24. struct hf_g1_die_data *die_status; // Array of per-die voltage, current, temperature sensor data
  25. struct hf_long_statistics *die_statistics; // Array of per-die error counters
  26. int hash_clock_rate; // Hash clock rate to use, in Mhz
  27. struct hf_usb_init_base usb_init_base; // USB Base information from USB_INIT
  28. struct hf_config_data config_data; // Configuration data used from USB_INIT
  29. int core_bitmap_size; // in bytes
  30. uint32_t *core_bitmap; // Core OK bitmap test results, run with PLL Bypassed
  31. struct work **works;
  32. uint16_t device_sequence_head; // The most recent sequence number the device dispatched
  33. uint16_t device_sequence_tail; // The most recently completed job in the device
  34. uint16_t hash_sequence_tail; // Follows device_sequence_tail around to free work
  35. };
  36. #endif /* USE_HASHFAST */
  37. #endif /* HASHFAST_H */