-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathusbctrl.h
More file actions
89 lines (73 loc) · 1.99 KB
/
usbctrl.h
File metadata and controls
89 lines (73 loc) · 1.99 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
/* usbctrl.h */
#ifndef _USBCTRL_H
#define _USBCTRL_H
#ifdef __cplusplus
extern "C" {
#endif
/**
* structure returned by HF_USBCTRL_CORE_OVERVIEW
*/
typedef struct {
uint8_t die_count;
uint8_t core_count; // cores
uint16_t total_cores;
uint16_t total_good_cores;
uint8_t shed_supported;
uint16_t groups;
uint8_t cores_per_group;
uint16_t cores_per_group_cycle;
uint8_t groups_per_group_cycle;
uint8_t group_core_offset;
uint16_t inflight;
uint16_t active_jobs;
uint16_t group_mask;
uint8_t group_shift;
} hf_usbctrl_core_overview;
int hfctrl_core_overview(hf_usbctrl_core_overview *overview, libusb_device_handle *dev);
/*
* HF_USBCTRL_CORE_ENABLE
*/
int hfctrl_core_enable(libusb_device_handle *dev, int core, int persist);
/*
* HF_USBCTRL_CORE_DISABLE
*/
int hfctrl_core_disable(libusb_device_handle *dev, int core, int persist);
/*
* HF_USBCTRL_CORE_CLEAR
*/
int hfctrl_core_clear(libusb_device_handle *dev, int persist);
/**
* structure returned by HF_USBCTRL_CORE_STATUS
*/
typedef struct {
uint8_t core_good;
uint8_t core_persist;
uint32_t core_ranges;
uint32_t core_nonces;
} hf_usbctrl_core_status;
int hfctrl_core_status(hf_usbctrl_core_status *status, libusb_device_handle *dev, int core);
/**
* structure returned by HF_USBCTRL_CORE_DIE_STATUS
*/
typedef struct {
uint8_t core_good[12];
uint8_t core_persist[12];
uint8_t core_pending[12];
uint8_t core_active[12];
uint64_t die_hashes;
uint64_t die_nonces;
} hf_usbctrl_core_die_status;
int hfctrl_core_die_status(hf_usbctrl_core_die_status *status, libusb_device_handle *dev, int die);
/**
* structure returned by HF_USBCTRL_CORE_ASIC_STATUS
*/
typedef struct {
uint8_t core_good[48];
uint64_t asic_hashes;
uint64_t asic_nonces;
} hf_usbctrl_core_asic_status;
int hfctrl_core_asic_status(hf_usbctrl_core_asic_status *status, libusb_device_handle *dev, int asic);
#ifdef __cplusplus
}
#endif
#endif /* _USBCTRL_H */