Wireshark-bugs: [Wireshark-bugs] [Bug 5370] Add support for USB isochronous

Date: Mon, 8 Nov 2010 11:44:08 -0800 (PST)
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5370

--- Comment #8 from Chris Maynard <christopher.maynard@xxxxxxxxx> 2010-11-08 11:43:57 PST ---
Maybe we should do something like this?

1) Replace the guint8 data[8] field of wiretap/pcap-common.c's linux_usb_phdr
struct with gtype equivalents of this (from linux/drivers/usb/mon/mon_bin.c's
mon_bin_hdr struct):

        union {
                unsigned char setup[SETUP_LEN]; /* Only for Control S-type */
                struct iso_rec {
                        int error_count;
                        int numdesc;
                } iso;
        } s;

2) In wiretap/pcap-common/pcap_process_linux_usb_pseudoheader(), test if
phdr->type is URB_ISOCHRONOUS or (URB_TRANSFER_IN | URB_ISOCHRONOUS), and if
so, byte swap the error_count and numdesc fields above if we need to.

This will deliver all multibyte fields in the USB pseudoheader in host-endian
format, thus the tvb_memcpy() routines would apply in packet-usb.c.

3) I think we may need to do the same for the iso_numdesc's as well, i.e., byte
swap if needed in pcap-common.c all the multi-byte fields in each one's
mon_bin_isodesc struct, namely status, off, len and pad, since they are also
added in host-endian order.  (Although probably no need for packet-usb to add
pad to tree as it's just meaningless padding and should be zero anyway.)

Would we also need to do the same thing for the multi-byte setup fields -
value, index and length, when applicable?  Today they are added assuming
little-endian byte order, but I'm not sure that's correct.

-- 
Configure bugmail: https://bugs.wireshark.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.