const bool initial_activation = (di->active < 0);
di->active = altsetting;
if (altsetting < 0)
return;
// alt 0 is already selected by SET_CONFIGURATION; some devices
// (e.g. Novation Launchkey MK2) stop responding if it is sent again
if (!(initial_activation && altsetting == 0)) {
// set the new interface
control.Transfer(USB_REQTYPE_INTERFACE_SET, USB_REQ_SET_INTERFACE, altsetting, interface, 0, NULL, this);
}
Ah I see. Thanks.No, I mean I'll probably change the core to remove the initial SET_INTERFACE requests and any device that needs them will have to perform them in its own driver.
This thing is a PITA though... it requires a powered hub, sometimes gets stuck in a loop where it keeps constantly bringing the link up and down, and only seems to implement the bare minimum of CDC-ECM functionality (no multicast filtering, no statistic collection). However if it's used under windows with the proprietary driver there's a bunch of extra options like configuring the link mode, tcp/udp checksum offload, etc. So there must be a bunch of vendor-specific commands...$ iperf -c 192.168.0.117 -i 1
------------------------------------------------------------
Client connecting to 192.168.0.117, TCP port 5001
TCP window size: 512 KByte (default)
------------------------------------------------------------
[ 1] local 192.168.0.30 port 56063 connected with 192.168.0.117 port 5001
[ ID] Interval Transfer Bandwidth
[ 1] 0.0000-1.0000 sec 17.6 MBytes 148 Mbits/sec
[ 1] 1.0000-2.0000 sec 17.6 MBytes 148 Mbits/sec
[ 1] 2.0000-3.0000 sec 17.9 MBytes 150 Mbits/sec
[ 1] 3.0000-4.0000 sec 17.9 MBytes 150 Mbits/sec
[ 1] 4.0000-5.0000 sec 17.9 MBytes 150 Mbits/sec
[ 1] 5.0000-6.0000 sec 17.9 MBytes 150 Mbits/sec
[ 1] 6.0000-7.0000 sec 17.9 MBytes 150 Mbits/sec
[ 1] 7.0000-8.0000 sec 17.8 MBytes 149 Mbits/sec
[ 1] 8.0000-9.0000 sec 17.2 MBytes 145 Mbits/sec
[ 1] 9.0000-10.0000 sec 17.2 MBytes 145 Mbits/sec
[ 1] 0.0000-10.0152 sec 177 MBytes 148 Mbits/sec