Deprecate preferred packet size functions in usbutils since they're unhelpful.
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 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292
diff --git a/driver-avalon.c b/driver-avalon.c
index 75cd06e..0e6ab3b 100644
--- a/driver-avalon.c
+++ b/driver-avalon.c
@@ -780,7 +780,6 @@ static bool avalon_detect_one(libusb_device *dev, struct usb_find_devices *found
/* Even though this is an FTDI type chip, we want to do the parsing
* all ourselves so set it to std usb type */
avalon->usbdev->usb_type = USB_TYPE_STD;
- usb_set_pps(avalon, AVALON_USB_PACKETSIZE);
usb_buffer_enable(avalon);
/* We have a real Avalon! */
diff --git a/driver-avalon.h b/driver-avalon.h
index 063fb68..e84ddbb 100644
--- a/driver-avalon.h
+++ b/driver-avalon.h
@@ -64,7 +64,6 @@
#define AVALON_AUTO_CYCLE 1024
#define AVALON_FTDI_READSIZE 510
-#define AVALON_USB_PACKETSIZE 512
#define AVALON_READBUF_SIZE 8192
#define AVALON_RESET_TIMEOUT 100
#define AVALON_READ_TIMEOUT 18 /* Enough to only half fill the buffer */
diff --git a/driver-icarus.c b/driver-icarus.c
index 43a460e..64c1fd1 100644
--- a/driver-icarus.c
+++ b/driver-icarus.c
@@ -55,10 +55,6 @@
// The size of a successful nonce read
#define ICARUS_READ_SIZE 4
-#define AMU_PREF_PACKET 256
-#define BLT_PREF_PACKET 512
-#define ICA_PREF_PACKET 256
-
// Ensure the sizes are correct for the Serial read
#if (ICARUS_READ_SIZE != 4)
#error ICARUS_READ_SIZE must be 4
@@ -329,8 +325,6 @@ static void icarus_initialise(struct cgpu_info *icarus, int baud)
case IDENT_LLT:
case IDENT_CMR1:
case IDENT_CMR2:
- usb_set_pps(icarus, BLT_PREF_PACKET);
-
// Reset
transfer(icarus, FTDI_TYPE_OUT, FTDI_REQUEST_RESET, FTDI_VALUE_RESET,
interface, C_RESET);
@@ -404,8 +398,6 @@ static void icarus_initialise(struct cgpu_info *icarus, int baud)
interface, C_PURGERX);
break;
case IDENT_ICA:
- usb_set_pps(icarus, ICA_PREF_PACKET);
-
// Set Data Control
transfer(icarus, PL2303_CTRL_OUT, PL2303_REQUEST_CTRL, PL2303_VALUE_CTRL,
interface, C_SETDATA);
@@ -426,8 +418,6 @@ static void icarus_initialise(struct cgpu_info *icarus, int baud)
interface, C_VENDOR);
break;
case IDENT_AMU:
- usb_set_pps(icarus, AMU_PREF_PACKET);
-
// Enable the UART
transfer(icarus, CP210X_TYPE_OUT, CP210X_REQUEST_IFC_ENABLE,
CP210X_VALUE_UART_ENABLE,
diff --git a/usbutils.c b/usbutils.c
index 589ee8a..81990a8 100644
--- a/usbutils.c
+++ b/usbutils.c
@@ -103,8 +103,8 @@ static struct list_head ut_list;
#ifdef USE_BFLSC
// N.B. transfer size is 512 with USB2.0, but only 64 with USB1.1
static struct usb_epinfo bas_epinfos[] = {
- { LIBUSB_TRANSFER_TYPE_BULK, 64, EPI(1), 0, 0, 0 },
- { LIBUSB_TRANSFER_TYPE_BULK, 64, EPO(2), 0, 0, 0 }
+ { LIBUSB_TRANSFER_TYPE_BULK, 64, EPI(1), 0, 0 },
+ { LIBUSB_TRANSFER_TYPE_BULK, 64, EPO(2), 0, 0 }
};
static struct usb_intinfo bas_ints[] = {
@@ -115,8 +115,8 @@ static struct usb_intinfo bas_ints[] = {
#ifdef USE_BITFORCE
// N.B. transfer size is 512 with USB2.0, but only 64 with USB1.1
static struct usb_epinfo bfl_epinfos[] = {
- { LIBUSB_TRANSFER_TYPE_BULK, 64, EPI(1), 0, 0, 0 },
- { LIBUSB_TRANSFER_TYPE_BULK, 64, EPO(2), 0, 0, 0 }
+ { LIBUSB_TRANSFER_TYPE_BULK, 64, EPI(1), 0, 0 },
+ { LIBUSB_TRANSFER_TYPE_BULK, 64, EPO(2), 0, 0 }
};
static struct usb_intinfo bfl_ints[] = {
@@ -126,12 +126,12 @@ static struct usb_intinfo bfl_ints[] = {
#ifdef USE_BITFURY
static struct usb_epinfo bfu0_epinfos[] = {
- { LIBUSB_TRANSFER_TYPE_INTERRUPT, 8, EPI(2), 0, 0, 0 }
+ { LIBUSB_TRANSFER_TYPE_INTERRUPT, 8, EPI(2), 0, 0 }
};
static struct usb_epinfo bfu1_epinfos[] = {
- { LIBUSB_TRANSFER_TYPE_BULK, 16, EPI(3), 0, 0, 0 },
- { LIBUSB_TRANSFER_TYPE_BULK, 16, EPO(4), 0, 0, 0 }
+ { LIBUSB_TRANSFER_TYPE_BULK, 16, EPI(3), 0, 0 },
+ { LIBUSB_TRANSFER_TYPE_BULK, 16, EPO(4), 0, 0 }
};
/* Default to interface 1 */
@@ -145,12 +145,12 @@ static struct usb_intinfo bfu_ints[] = {
#include "driver-hashfast.h"
static struct usb_epinfo hfa0_epinfos[] = {
- { LIBUSB_TRANSFER_TYPE_INTERRUPT, 8, EPI(3), 0, 0, 0 }
+ { LIBUSB_TRANSFER_TYPE_INTERRUPT, 8, EPI(3), 0, 0 }
};
static struct usb_epinfo hfa1_epinfos[] = {
- { LIBUSB_TRANSFER_TYPE_BULK, 64, EPI(1), 0, 0, 0 },
- { LIBUSB_TRANSFER_TYPE_BULK, 64, EPO(2), 0, 0, 0 }
+ { LIBUSB_TRANSFER_TYPE_BULK, 64, EPI(1), 0, 0 },
+ { LIBUSB_TRANSFER_TYPE_BULK, 64, EPO(2), 0, 0 }
};
/* Default to interface 1 */
@@ -162,8 +162,8 @@ static struct usb_intinfo hfa_ints[] = {
#ifdef USE_MODMINER
static struct usb_epinfo mmq_epinfos[] = {
- { LIBUSB_TRANSFER_TYPE_BULK, 64, EPI(3), 0, 0, 0 },
- { LIBUSB_TRANSFER_TYPE_BULK, 64, EPO(3), 0, 0, 0 }
+ { LIBUSB_TRANSFER_TYPE_BULK, 64, EPI(3), 0, 0 },
+ { LIBUSB_TRANSFER_TYPE_BULK, 64, EPO(3), 0, 0 }
};
static struct usb_intinfo mmq_ints[] = {
@@ -173,8 +173,8 @@ static struct usb_intinfo mmq_ints[] = {
#ifdef USE_AVALON
static struct usb_epinfo ava_epinfos[] = {
- { LIBUSB_TRANSFER_TYPE_BULK, 64, EPI(1), 0, 0, 0 },
- { LIBUSB_TRANSFER_TYPE_BULK, 64, EPO(2), 0, 0, 0 }
+ { LIBUSB_TRANSFER_TYPE_BULK, 64, EPI(1), 0, 0 },
+ { LIBUSB_TRANSFER_TYPE_BULK, 64, EPO(2), 0, 0 }
};
static struct usb_intinfo ava_ints[] = {
@@ -184,8 +184,8 @@ static struct usb_intinfo ava_ints[] = {
#ifdef USE_KLONDIKE
static struct usb_epinfo kln_epinfos[] = {
- { LIBUSB_TRANSFER_TYPE_BULK, 64, EPI(1), 0, 0, 0 },
- { LIBUSB_TRANSFER_TYPE_BULK, 64, EPO(1), 0, 0, 0 }
+ { LIBUSB_TRANSFER_TYPE_BULK, 64, EPI(1), 0, 0 },
+ { LIBUSB_TRANSFER_TYPE_BULK, 64, EPO(1), 0, 0 }
};
static struct usb_intinfo kln_ints[] = {
@@ -195,8 +195,8 @@ static struct usb_intinfo kln_ints[] = {
#ifdef USE_ICARUS
static struct usb_epinfo ica_epinfos[] = {
- { LIBUSB_TRANSFER_TYPE_BULK, 64, EPI(3), 0, 0, 0 },
- { LIBUSB_TRANSFER_TYPE_BULK, 64, EPO(2), 0, 0, 0 }
+ { LIBUSB_TRANSFER_TYPE_BULK, 64, EPI(3), 0, 0 },
+ { LIBUSB_TRANSFER_TYPE_BULK, 64, EPO(2), 0, 0 }
};
static struct usb_intinfo ica_ints[] = {
@@ -204,8 +204,8 @@ static struct usb_intinfo ica_ints[] = {
};
static struct usb_epinfo amu_epinfos[] = {
- { LIBUSB_TRANSFER_TYPE_BULK, 64, EPI(1), 0, 0, 0 },
- { LIBUSB_TRANSFER_TYPE_BULK, 64, EPO(1), 0, 0, 0 }
+ { LIBUSB_TRANSFER_TYPE_BULK, 64, EPI(1), 0, 0 },
+ { LIBUSB_TRANSFER_TYPE_BULK, 64, EPO(1), 0, 0 }
};
static struct usb_intinfo amu_ints[] = {
@@ -213,8 +213,8 @@ static struct usb_intinfo amu_ints[] = {
};
static struct usb_epinfo llt_epinfos[] = {
- { LIBUSB_TRANSFER_TYPE_BULK, 64, EPI(1), 0, 0, 0 },
- { LIBUSB_TRANSFER_TYPE_BULK, 64, EPO(2), 0, 0, 0 }
+ { LIBUSB_TRANSFER_TYPE_BULK, 64, EPI(1), 0, 0 },
+ { LIBUSB_TRANSFER_TYPE_BULK, 64, EPO(2), 0, 0 }
};
static struct usb_intinfo llt_ints[] = {
@@ -222,8 +222,8 @@ static struct usb_intinfo llt_ints[] = {
};
static struct usb_epinfo cmr1_epinfos[] = {
- { LIBUSB_TRANSFER_TYPE_BULK, 64, EPI(1), 0, 0, 0 },
- { LIBUSB_TRANSFER_TYPE_BULK, 64, EPO(2), 0, 0, 0 }
+ { LIBUSB_TRANSFER_TYPE_BULK, 64, EPI(1), 0, 0 },
+ { LIBUSB_TRANSFER_TYPE_BULK, 64, EPO(2), 0, 0 }
};
static struct usb_intinfo cmr1_ints[] = {
@@ -231,20 +231,20 @@ static struct usb_intinfo cmr1_ints[] = {
};
static struct usb_epinfo cmr2_epinfos0[] = {
- { LIBUSB_TRANSFER_TYPE_BULK, 64, EPI(1), 0, 0, 0 },
- { LIBUSB_TRANSFER_TYPE_BULK, 64, EPO(2), 0, 0, 0 }
+ { LIBUSB_TRANSFER_TYPE_BULK, 64, EPI(1), 0, 0 },
+ { LIBUSB_TRANSFER_TYPE_BULK, 64, EPO(2), 0, 0 }
};
static struct usb_epinfo cmr2_epinfos1[] = {
- { LIBUSB_TRANSFER_TYPE_BULK, 64, EPI(3), 0, 0, 0 },
- { LIBUSB_TRANSFER_TYPE_BULK, 64, EPO(4), 0, 0, 0 },
+ { LIBUSB_TRANSFER_TYPE_BULK, 64, EPI(3), 0, 0 },
+ { LIBUSB_TRANSFER_TYPE_BULK, 64, EPO(4), 0, 0 },
};
static struct usb_epinfo cmr2_epinfos2[] = {
- { LIBUSB_TRANSFER_TYPE_BULK, 64, EPI(5), 0, 0, 0 },
- { LIBUSB_TRANSFER_TYPE_BULK, 64, EPO(6), 0, 0, 0 },
+ { LIBUSB_TRANSFER_TYPE_BULK, 64, EPI(5), 0, 0 },
+ { LIBUSB_TRANSFER_TYPE_BULK, 64, EPO(6), 0, 0 },
};
static struct usb_epinfo cmr2_epinfos3[] = {
- { LIBUSB_TRANSFER_TYPE_BULK, 64, EPI(7), 0, 0, 0 },
- { LIBUSB_TRANSFER_TYPE_BULK, 64, EPO(8), 0, 0, 0 }
+ { LIBUSB_TRANSFER_TYPE_BULK, 64, EPI(7), 0, 0 },
+ { LIBUSB_TRANSFER_TYPE_BULK, 64, EPO(8), 0, 0 }
};
static struct usb_intinfo cmr2_ints[] = {
@@ -3171,40 +3171,6 @@ enum sub_ident usb_ident(struct cgpu_info *cgpu)
return ident;
}
-/*
- * If you pass both intinfo and epinfo as <0 then it will set all
- * endpoints to PrefPacketSize
- * If intinfo >=0 but epinfo <0 then it will set all endpoints
- * for the given one intinfo to PrefPacketSize
- * If both are >=0 then it will set only the specified single
- * endpoint (intinfo,epinfo) to PrefPacketSize
- */
-void _usb_set_pps(struct cgpu_info *cgpu, int intinfo, int epinfo, uint16_t PrefPacketSize)
-{
- struct usb_find_devices *found;
- int pstate;
-
- DEVWLOCK(cgpu, pstate);
-
- if (cgpu->usbdev) {
- found = cgpu->usbdev->found;
- if (intinfo >= 0 && epinfo >= 0)
- found->intinfos[intinfo].epinfos[epinfo].PrefPacketSize = PrefPacketSize;
- else {
- if (intinfo >= 0) {
- for (epinfo = 0; epinfo < found->intinfos[intinfo].epinfo_count; epinfo++)
- found->intinfos[intinfo].epinfos[epinfo].PrefPacketSize = PrefPacketSize;
- } else {
- for (intinfo = 0; intinfo < found->intinfo_count ; intinfo++)
- for (epinfo = 0; epinfo < found->intinfos[intinfo].epinfo_count; epinfo++)
- found->intinfos[intinfo].epinfos[epinfo].PrefPacketSize = PrefPacketSize;
- }
- }
- }
-
- DEVWUNLOCK(cgpu, pstate);
-}
-
// Need to set all devices with matching usbdev
void usb_set_dev_start(struct cgpu_info *cgpu)
{
diff --git a/usbutils.h b/usbutils.h
index 06df71d..b3a96e9 100644
--- a/usbutils.h
+++ b/usbutils.h
@@ -122,7 +122,6 @@ struct usb_epinfo {
uint16_t size;
unsigned char ep;
uint16_t wMaxPacketSize;
- uint16_t PrefPacketSize;
bool found;
};
@@ -405,8 +404,6 @@ void usb_disable_cps(struct cgpu_info *cgpu);
int _usb_interface(struct cgpu_info *cgpu, int intinfo);
#define usb_interface(_cgpu) _usb_interface(_cgpu, DEFAULT_INTINFO)
enum sub_ident usb_ident(struct cgpu_info *cgpu);
-void _usb_set_pps(struct cgpu_info *cgpu, int intinfo, int epinfo, uint16_t PrefPacketSize);
-#define usb_set_pps(_cgpu, _pps) _usb_set_pps(_cgpu, -1, -1, _pps)
void usb_set_dev_start(struct cgpu_info *cgpu);
void usb_cleanup();
void usb_initialise();