API - put edevstatus where it was supposed to be
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
diff --git a/api.c b/api.c
index 3511312..6a1d09c 100644
--- a/api.c
+++ b/api.c
@@ -2168,40 +2168,6 @@ static void devstatus(struct io_data *io_data, __maybe_unused SOCKETTYPE c, __ma
io_close(io_data);
}
-#ifdef HAVE_AN_FPGA
-static void pgadev(struct io_data *io_data, __maybe_unused SOCKETTYPE c, char *param, bool isjson, __maybe_unused char group)
-{
- bool io_open = false;
- int numpga = numpgas();
- int id;
-
- if (numpga == 0) {
- message(io_data, MSG_PGANON, 0, NULL, isjson);
- return;
- }
-
- if (param == NULL || *param == '\0') {
- message(io_data, MSG_MISID, 0, NULL, isjson);
- return;
- }
-
- id = atoi(param);
- if (id < 0 || id >= numpga) {
- message(io_data, MSG_INVPGA, id, NULL, isjson);
- return;
- }
-
- message(io_data, MSG_PGADEV, id, NULL, isjson);
-
- if (isjson)
- io_open = io_add(io_data, COMSTR JSON_PGA);
-
- pgastatus(io_data, id, isjson, false);
-
- if (isjson && io_open)
- io_close(io_data);
-}
-
static void edevstatus(struct io_data *io_data, __maybe_unused SOCKETTYPE c, char *param, bool isjson, __maybe_unused char group)
{
bool io_open = false;
@@ -2291,6 +2257,40 @@ static void edevstatus(struct io_data *io_data, __maybe_unused SOCKETTYPE c, cha
io_close(io_data);
}
+#ifdef HAVE_AN_FPGA
+static void pgadev(struct io_data *io_data, __maybe_unused SOCKETTYPE c, char *param, bool isjson, __maybe_unused char group)
+{
+ bool io_open = false;
+ int numpga = numpgas();
+ int id;
+
+ if (numpga == 0) {
+ message(io_data, MSG_PGANON, 0, NULL, isjson);
+ return;
+ }
+
+ if (param == NULL || *param == '\0') {
+ message(io_data, MSG_MISID, 0, NULL, isjson);
+ return;
+ }
+
+ id = atoi(param);
+ if (id < 0 || id >= numpga) {
+ message(io_data, MSG_INVPGA, id, NULL, isjson);
+ return;
+ }
+
+ message(io_data, MSG_PGADEV, id, NULL, isjson);
+
+ if (isjson)
+ io_open = io_add(io_data, COMSTR JSON_PGA);
+
+ pgastatus(io_data, id, isjson, false);
+
+ if (isjson && io_open)
+ io_close(io_data);
+}
+
static void pgaenable(struct io_data *io_data, __maybe_unused SOCKETTYPE c, char *param, bool isjson, __maybe_unused char group)
{
struct cgpu_info *cgpu;