--- zzzz-none-000/linux-2.6.39.4/drivers/usb/core/hcd.c 2011-08-03 19:43:28.000000000 +0000 +++ puma6-atom-6490-729/linux-2.6.39.4/drivers/usb/core/hcd.c 2021-11-10 13:38:17.000000000 +0000 @@ -1455,6 +1455,9 @@ atomic_inc(&urb->use_count); atomic_inc(&urb->dev->urbnum); usbmon_urb_submit(&hcd->self, urb); +#ifdef AVM_USB_TRACE + avm_usb_trace_submit(hcd, urb); +#endif /* NOTE requirements on root-hub callers (usbfs and the hub * driver, for now): URBs' urb->transfer_buffer must be @@ -1477,6 +1480,10 @@ if (unlikely(status)) { usbmon_urb_submit_error(&hcd->self, urb, status); +#ifdef AVM_USB_TRACE + avm_usb_trace_error(hcd, urb, status); +#endif + urb->hcpriv = NULL; INIT_LIST_HEAD(&urb->urb_list); atomic_dec(&urb->use_count); @@ -1579,6 +1586,10 @@ unmap_urb_for_dma(hcd, urb); usbmon_urb_complete(&hcd->self, urb, status); +#ifdef AVM_USB_TRACE + avm_usb_trace_complete(hcd, urb, status); +#endif + usb_unanchor_urb(urb); /* pass ownership to the completion handler */ @@ -1764,6 +1775,8 @@ struct usb_interface *iface = usb_ifnum_to_if(udev, cur_alt->desc.bInterfaceNumber); + if (!iface) + return -EINVAL; if (iface->resetting_device) { /* * The USB core just reset the device, so the xHCI host @@ -2460,6 +2473,11 @@ } if (hcd->uses_new_polling && HCD_POLL_RH(hcd)) usb_hcd_poll_rh_status(hcd); + +#ifdef AVM_USB_TRACE + avm_usb_register_trace_device (hcd); +#endif + return retval; error_create_attr_group: @@ -2554,6 +2572,10 @@ free_irq(hcd->irq, hcd); } +#ifdef AVM_USB_TRACE + avm_usb_deregister_trace_device (hcd); +#endif + usb_put_dev(hcd->self.root_hub); usb_deregister_bus(&hcd->self); hcd_buffer_destroy(hcd);