aboutsummaryrefslogtreecommitdiff
path: root/pcap.c
diff options
context:
space:
mode:
authorTomasz Moń <desowin@gmail.com>2022-05-15 21:17:34 +0200
committerTomasz Moń <desowin@gmail.com>2022-05-15 21:17:34 +0200
commit3b9f5172a84caedf15f74d2ebc44cb98793b9224 (patch)
tree6ed642ecc67dc25ec81cd0936000df6c701bb1c7 /pcap.c
parent2a7fcca8954579e48b6ad93ac0a62469bcfc8fe2 (diff)
Add speed specific USB 2.0/1.1/1.0 linktypes
USB 2.0/1.1/1.0 devices (or 3.x and newer when connected to hosts that are not Super-Speed capable) operate at one of three speeds: * Low-Speed (1.5 Mbps) * Full-Speed (12 Mbps) * High-Speed (480 Mbps) While the packets are generally common to all three speeds, there are some differences that span across different layers. The capture speed should be available to analyzer and it makes sense to expose it via speed specific linktypes. Existing USB 2.0/1.1/1.0 captures can be manually, retroactively updated to speed specific linktype. Low-Speed device will always operate at Low-Speed, regardless of what host it is connected to. USB cable connected to Low-Speed device only ever carries packets sent at Low-Speed. High-Speed device will operate at High-Speed when connected to High-Speed capable host. If High-Speed Detection Handshake succeeds, the cable will only carry High-Speed packets. Full-Speed device will always operate at Full-Speed, regardless of what host it is connected to. High-Speed device connected to Full-Speed host or hub, will operate at Full-Speed. The cable connected to device operating at Full-Speed can only carry Full-Speed or Low-Speed packets preceded by Low-Speed preamble (PRE packet) sent at Full-Speed. Non-hub device operating at Full-Speed always ignores Low-Speed packets. The hub forwards the Low-Speed packets to downstream ports but does not act upon the actual Low-Speed packet contents. The packets intended for device operating at Full-Speed are always sent at Full-Speed.
Diffstat (limited to 'pcap.c')
-rw-r--r--pcap.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/pcap.c b/pcap.c
index 5ab891e5..fe0762a3 100644
--- a/pcap.c
+++ b/pcap.c
@@ -3336,6 +3336,9 @@ static struct dlt_choice dlt_choices[] = {
DLT_CHOICE(ETW, "Event Tracing for Windows messages"),
DLT_CHOICE(NETANALYZER_NG, "Hilscher netANALYZER NG pseudo-footer"),
DLT_CHOICE(ZBOSS_NCP, "ZBOSS NCP protocol with pseudo-header"),
+ DLT_CHOICE(USB_2_0_LOW_SPEED, "Low-Speed USB 2.0/1.1/1.0 as transmitted over the cable"),
+ DLT_CHOICE(USB_2_0_FULL_SPEED, "Full-Speed USB 2.0/1.1/1.0 as transmitted over the cable"),
+ DLT_CHOICE(USB_2_0_HIGH_SPEED, "High-Speed USB 2.0 as transmitted over the cable"),
DLT_CHOICE_SENTINEL
};