Comments (4)
Sorry, is the libusb mode the error,
event: control, length: 8 bRequestType: 0x21 (OUT), bRequest: 0x0a, wValue: 0x0000, **wIndex: 0x0001**, wLength: 0 type = USB_TYPE_CLASS req = unknown = 0xa **ep0: stalling**
this is make the raw_gaget device halt,and then next request failed, this code result is -1
https://github.com/AristoChen/usb-proxy/blob/6aecd455b2ef3d6734ab92105ca00c01464d4030/proxy.cpp#L490
from raw-gadget.
Please try AristoChen/usb-proxy#6.
from raw-gadget.
ooh! very thanks, i will try it
from raw-gadget.
hi @xairy I test the code AristoChen/usb-proxy#6, there two issues.
- my mouse is a low speed device, and it response the MaxPageSize0 is 0x08, it should change the MaxPackageSize0 0x40, 0x08 make the raw_gadget which use device musb-hdrc.4.auto dead loop,
- ignore usb_raw_ep0_stall when SET_IDLE request to interface 1,it like in linux don't support this request, in proxy.cpp:499
event: control, length: 8
bRequestType: 0x21 (OUT), bRequest: 0x0a, wValue: 0x0000, wIndex: 0x0001, wLength: 0
type = USB_TYPE_CLASS
req = unknown = 0xa
ep0: stalling
I add this code in ep0_loop
--- a/proxy.cpp
+++ b/proxy.cpp
@@ -368,6 +368,12 @@ void ep0_loop(int fd) {
break;
}
}
+ if ((event.ctrl.bRequestType & USB_TYPE_MASK) == USB_TYPE_STANDARD &&
+ event.ctrl.bRequest == USB_REQ_GET_DESCRIPTOR &&
+ (event.ctrl.wValue >> 8) == USB_DT_DEVICE) {
+ struct usb_device_descriptor* pdata = (struct usb_device_descriptor*)&io.data;
+ pdata->bMaxPacketSize0 = 64;
+ }
if (verbose_level >= 2)
printData(io, 0x00, "control", "in");
@@ -495,7 +501,14 @@ void ep0_loop(int fd) {
printf("ep0: transferred %d bytes (out)\n", rv);
}
else {
- usb_raw_ep0_stall(fd);
+ if (event.ctrl.bRequestType == 0x21
+ && event.ctrl.bRequest == 0x0a
+ && event.ctrl.wIndex != 0) {
+ continue;
+ }
+ else {
+ usb_raw_ep0_stall(fd);
+ }
}
}
}
from raw-gadget.
Related Issues (20)
- Document or change behavior with 0-length setup requests HOT 2
- Clean up request flags
- Fix dwc2 issuing disconnect instead of reset HOT 2
- Experiment with USB/IP as a loopback HCD/UDC
- Error redirection a usb device to a qemu virtual machine HOT 12
- Instructions for setting up Raw Gadget on popular boards
- Test Raw Gadget on OpenStick
- Proxy-based Raw Gadget tests
- Facedancer Error w/ Raw Gadget HOT 7
- Logitech webcam can not proxy with AristoChen/usb-proxy HOT 5
- Connect/disconnect in raw-gadget HOT 4
- Assorted raw_gadget.c clean-ups
- Support O_NONBLOCK I/O
- Better support for isochronous transfers
- Support USB 3 SuperSpeed
- device side resume signal HOT 1
- On a Raspberry Pi, follow these instructions. HOT 1
- Unable to compile raw-gadget HOT 1
- How to support option usb data in ep0 control command? HOT 14
- USB_RAW_IOCTL_EP_READ/USB_RAW_IOCTL_EP_WRITE maximum length = PAGE_SIZE HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from raw-gadget.