diff options
author | gerald <gerald@f5534014-38df-0310-8fa8-9805f1628bb7> | 2009-05-26 00:32:16 +0000 |
---|---|---|
committer | gerald <gerald@f5534014-38df-0310-8fa8-9805f1628bb7> | 2009-05-26 00:32:16 +0000 |
commit | 74780fae4388438bb292b33182b06c4557a522fa (patch) | |
tree | 6f40594728fdaaef71428753705ffd5baad25363 /epan/dissectors/packet-usb.c | |
parent | e41188f940ae2ef1858bd9fd2e4a7b39c80aaa2d (diff) |
From Roberto Mariani via bug 3324:
- Removed heuristic for find if is_request and used event_type
- URB_INTERRUPT don't goes in reverse direction... fixed
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@28477 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'epan/dissectors/packet-usb.c')
-rw-r--r-- | epan/dissectors/packet-usb.c | 58 |
1 files changed, 7 insertions, 51 deletions
diff --git a/epan/dissectors/packet-usb.c b/epan/dissectors/packet-usb.c index d6e94210ec..c44bc3c101 100644 --- a/epan/dissectors/packet-usb.c +++ b/epan/dissectors/packet-usb.c @@ -1672,60 +1672,16 @@ dissect_linux_usb_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent, dissect_linux_usb_pseudo_header(tvb, pinfo, tree); type = pinfo->pseudo_header->linux_usb.transfer_type; -#if 0 - /* The direction flag is broken so we must strip it off */ - endpoint=pinfo->pseudo_header->linux_usb.endpoint_number; -#else - endpoint=pinfo->pseudo_header->linux_usb.endpoint_number&(~URB_TRANSFER_IN); -#endif - tmp_addr=pinfo->pseudo_header->linux_usb.device_address; + + endpoint = pinfo->pseudo_header->linux_usb.endpoint_number & (~URB_TRANSFER_IN); + + tmp_addr = pinfo->pseudo_header->linux_usb.device_address; setup_flag = pinfo->pseudo_header->linux_usb.setup_flag; -#if 0 - /* this is how it is supposed to work but this flag seems to be broken -- ronnie */ - is_request = endpoint & URB_TRANSFER_IN; -#else - /* Determine whether this is a request or a response */ - switch(type){ - case URB_BULK: - case URB_CONTROL: - case URB_ISOCHRONOUS: - switch(pinfo->pseudo_header->linux_usb.event_type){ - case URB_SUBMIT: - is_request=TRUE; - break; - case URB_COMPLETE: - case URB_ERROR: - is_request=FALSE; - break; - default: - DISSECTOR_ASSERT_NOT_REACHED(); - } - break; - case URB_INTERRUPT: - switch(pinfo->pseudo_header->linux_usb.event_type){ - case URB_SUBMIT: - is_request=FALSE; - break; - case URB_COMPLETE: - case URB_ERROR: - is_request=TRUE; - break; - default: - DISSECTOR_ASSERT_NOT_REACHED(); - } - break; - default: - DISSECTOR_ASSERT_NOT_REACHED(); - } -#endif + is_request = (pinfo->pseudo_header->linux_usb.event_type == URB_SUBMIT) ? TRUE : FALSE; - /* Set up addresses and ports. - * Note that URB_INTERRUPT goes in the reverse direction and thus - * the request comes from the device and not the host. - */ - if ( (is_request&&(type!=URB_INTERRUPT)) - || (!is_request&&(type==URB_INTERRUPT)) ){ + /* Set up addresses and ports. */ + if (is_request) { src_addr.device = src_device = 0xffffffff; src_addr.endpoint = src_endpoint = NO_ENDPOINT; dst_addr.device = dst_device = htolel(tmp_addr); |