For that matter, the usb subsystem could use a bit of an upgrade to make
drivers easier to write.
Others have said that as well. But it needs somebody to actually do
it. A lot depends on the complexity of the driver. I recently wrote a
simple driver and a Linux kernel counterpart without too much effort.
Yes, when the USBS framework was specified (ten years ago?) most USB
chips were ugly beasts, with predefined endpoints, lots of limitations,
and lots of bugs.
Most of the recent chips that I've seen appear to have a control
endpoint and some number of fairly generic endpoints. Combining the
usbs_rx_endpoint and usbs_tx_endpoint into a single thing
(usbs_endpoint), adding an endpoint number and direction, and things
like that would be helpful. I could make a list.
Many of the ideas could break the existing USBS drivers. Would this be OK?
But, if we wanted to get fancy, most of the events that a USBS driver
respond to are the same:
- Respond to a bus reset
- Set the address
- Read an RX endpoint
- Fill a TX endpoint.
...
A common code base for USB drivers might be really helpful. I could do
this work, but would it be accepted?
Frank