tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

RE: Conceptual USB doc?



On Sun, 8 Mar 2026, adr wrote:
> PS. Axelson's books are pretty good.

Axelson's books are a great starting point.

For an experienced kernel hacker, I think I'd emphasize the following
practical points.

1. USB is not Ethernet -- the host and device controllers implement layer 3
as well as layer 2. Many instincts for how to do things over Ethernet will
be misleading.  In particular, because you can't see layer 2 from outside
the host controller, tools like USB visualization in Wireshark are much less
useful that they are in Ethernet -- you can't see the layer 2 events that
lead to layer 3 problems. This doesn't mean you can't debug, but you need to
be aware that Wireshark can't give the same authoritative view of USB
traffic that it can give of Ethernet.

 2. It's good to study and become really comfortable with how USB handles
"transfers" so you know exactly when sending data is likely to cause an
interrupt on the receiving side. "I sent the data!" "Yes, but you didn't do
the thing that guarantees that the receiver thinks that the transfer is
complete, and it's still waiting for that."

3. There is a free compliance test from USB-IF.  Device makers often don't
run it, and use situational testing with Windows as their primary QA. "I
plugged it in and it works." The very highest volume devices are typically
compliant, but surprisingly many devices have problems when used in any way
other than anticipated.

4. If you're building your own device, hold your nose (the tests run on
Windows only) and run the tests, they're pretty good.

Best regards,
--Terry





Home | Main Index | Thread Index | Old Index