Quote:
Originally Posted by
Corona688
Or read and understand the device driver source code. That's likely to be quite difficult unfortunately.
If these are binary drivers without source code, you're wholly out of luck.
There are c source of cdc-acm.c, sierra.c, option.c in drivers/usb I was able to recompile (create *.ko files) and use after that.
For example, drivers/usb/class/cdc-acm.c overrides tty method:
741 static int acm_tty_chars_in_buffer(struct tty_struct *tty);
That method supposes to return amount of not sent data.
Unfortunately, it makes those calculations based on amount of urb buffers returned by
505 static void acm_write_bulk(struct urb *urb);
acm_write_bulk seems to return urb buffer after its data were transferred to device, not really sent to destination.
Quote:
Originally Posted by
Corona688
What do you need TIOCOUTQ for? Might there be a workaround that doesn't involve bare-metal hardware driver hacking?
For example, I have a USB modem connected to my intel machine and I want to send packets over it with the lowest latency the modem provides.
When network is in good condition the latency (or delay) is lower or about 1 second, which is good.
When network goes weak latency can be huge (even 1 minute).
The idea was:
1) send a packet over sendto()
2) check if packet was sent completely in "short" time.
3a) if it was sent fast enough, my app is happy and continues to send packets over it.
3b) if it wasn't, my app resends that packet over another USB modem and stops using the first modem until it's in good condition again.
If I was able to check if modem is empty I'd be able to implement it.