1
0
mirror of https://github.com/GOSTSec/sgminer synced 2025-09-02 01:02:11 +00:00

Use the existing device_data for knc state data.

This commit is contained in:
Con Kolivas 2013-10-28 14:27:57 +11:00
parent 1388b84178
commit ac7dc468e2
2 changed files with 5 additions and 8 deletions

View File

@ -365,7 +365,7 @@ static void knc_work_from_queue_to_spi(struct knc_state *knc,
static int64_t knc_process_response(struct thr_info *thr, struct cgpu_info *cgpu, static int64_t knc_process_response(struct thr_info *thr, struct cgpu_info *cgpu,
struct spi_rx_t *rxbuf, int __maybe_unused num) struct spi_rx_t *rxbuf, int __maybe_unused num)
{ {
struct knc_state *knc = cgpu->knc_state; struct knc_state *knc = cgpu->device_data;
struct work *work; struct work *work;
int64_t us; int64_t us;
int submitted, successful, i, num_sent; int submitted, successful, i, num_sent;
@ -568,7 +568,7 @@ static bool knc_detect_one(struct spidev_context *ctx)
cgpu->name = "KnCminer"; cgpu->name = "KnCminer";
cgpu->threads = 1; // .. perhaps our number of devices? cgpu->threads = 1; // .. perhaps our number of devices?
cgpu->knc_state = knc; cgpu->device_data = knc;
add_cgpu(cgpu); add_cgpu(cgpu);
return true; return true;
@ -612,7 +612,7 @@ void knc_detect(bool __maybe_unused hotplug)
static int64_t knc_scanwork(struct thr_info *thr) static int64_t knc_scanwork(struct thr_info *thr)
{ {
struct cgpu_info *cgpu = thr->cgpu; struct cgpu_info *cgpu = thr->cgpu;
struct knc_state *knc = cgpu->knc_state; struct knc_state *knc = cgpu->device_data;
int len, num; int len, num;
int next_read_q; int next_read_q;
@ -646,7 +646,7 @@ static int64_t knc_scanwork(struct thr_info *thr)
static bool knc_queue_full(struct cgpu_info *cgpu) static bool knc_queue_full(struct cgpu_info *cgpu)
{ {
struct knc_state *knc = cgpu->knc_state; struct knc_state *knc = cgpu->device_data;
struct work *work; struct work *work;
int queue_full = true; int queue_full = true;
@ -666,7 +666,7 @@ static bool knc_queue_full(struct cgpu_info *cgpu)
static void knc_flush_work(struct cgpu_info *cgpu) static void knc_flush_work(struct cgpu_info *cgpu)
{ {
struct knc_state *knc = cgpu->knc_state; struct knc_state *knc = cgpu->device_data;
struct work *work; struct work *work;
int len; int len;
int next_read_q, next_read_a; int next_read_q, next_read_a;

View File

@ -497,9 +497,6 @@ struct cgpu_info {
bool polling; bool polling;
bool flash_led; bool flash_led;
#endif /* USE_BITFORCE */ #endif /* USE_BITFORCE */
#if defined(USE_KNC)
struct knc_state *knc_state;
#endif
#if defined(USE_BITFORCE) || defined(USE_BFLSC) #if defined(USE_BITFORCE) || defined(USE_BFLSC)
pthread_mutex_t device_mutex; pthread_mutex_t device_mutex;
#endif /* USE_BITFORCE || USE_BFLSC */ #endif /* USE_BITFORCE || USE_BFLSC */