]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commitdiff
Merge tag 'usb-4.8-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb
authorLinus Torvalds <torvalds@linux-foundation.org>
Mon, 25 Jul 2016 00:22:18 +0000 (17:22 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Mon, 25 Jul 2016 00:22:18 +0000 (17:22 -0700)
Pull USB updates from Greg KH:
 "Here's the big USB driver update for 4.8-rc1.  Lots of the normal
  stuff in here, musb, gadget, xhci, and other updates and fixes.  All
  of the details are in the shortlog.

  All of these have been in linux-next for a while with no reported
  issues"

* tag 'usb-4.8-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (169 commits)
  cdc-acm: beautify probe()
  cdc-wdm: use the common CDC parser
  cdc-acm: cleanup error handling
  cdc-acm: use the common parser
  usbnet: move the CDC parser into USB core
  usb: musb: sunxi: Simplify dr_mode handling
  usb: musb: sunxi: make unexported symbols static
  usb: musb: cppi41: add dma channel tracepoints
  usb: musb: cppi41: move struct cppi41_dma_channel to header
  usb: musb: cleanup cppi_dma header
  usb: musb: gadget: add usb-request tracepoints
  usb: musb: host: add urb tracepoints
  usb: musb: add tracepoints to dump interrupt events
  usb: musb: add tracepoints for register access
  usb: musb: dsps: use musb register read/write wrappers instead
  usb: musb: switch dev_dbg to tracepoints
  usb: musb: add tracepoints support for debugging
  usb: quirks: Add no-lpm quirk for Elan
  phy: rcar-gen3-usb2: fix mutex_lock calling in interrupt
  phy: rockhip-usb: use devm_add_action_or_reset()
  ...

1  2 
drivers/net/usb/usbnet.c

diff --combined drivers/net/usb/usbnet.c
index 6086a0163249c5e05d8cdf92b1b834c3da4a71a7,b56d78ab4139921d585f968c8979cb0625bbe583..3bfb592093263bef36c4fa88de4fed60dbbb1ac1
@@@ -42,7 -42,6 +42,6 @@@
  #include <linux/mii.h>
  #include <linux/usb.h>
  #include <linux/usb/usbnet.h>
- #include <linux/usb/cdc.h>
  #include <linux/slab.h>
  #include <linux/kernel.h>
  #include <linux/pm_runtime.h>
@@@ -395,11 -394,8 +394,11 @@@ int usbnet_change_mtu (struct net_devic
        dev->hard_mtu = net->mtu + net->hard_header_len;
        if (dev->rx_urb_size == old_hard_mtu) {
                dev->rx_urb_size = dev->hard_mtu;
 -              if (dev->rx_urb_size > old_rx_urb_size)
 +              if (dev->rx_urb_size > old_rx_urb_size) {
 +                      usbnet_pause_rx(dev);
                        usbnet_unlink_rx_urbs(dev);
 +                      usbnet_resume_rx(dev);
 +              }
        }
  
        /* max qlen depend on hard_mtu and rx_urb_size */
@@@ -1511,9 -1507,8 +1510,9 @@@ static void usbnet_bh (unsigned long pa
        } else if (netif_running (dev->net) &&
                   netif_device_present (dev->net) &&
                   netif_carrier_ok(dev->net) &&
 -                 !timer_pending (&dev->delay) &&
 -                 !test_bit (EVENT_RX_HALT, &dev->flags)) {
 +                 !timer_pending(&dev->delay) &&
 +                 !test_bit(EVENT_RX_PAUSED, &dev->flags) &&
 +                 !test_bit(EVENT_RX_HALT, &dev->flags)) {
                int     temp = dev->rxq.qlen;
  
                if (temp < RX_QLEN(dev)) {
        return err;
  }
  
- int cdc_parse_cdc_header(struct usb_cdc_parsed_header *hdr,
-                               struct usb_interface *intf,
-                               u8 *buffer,
-                               int buflen)
- {
-       /* duplicates are ignored */
-       struct usb_cdc_union_desc *union_header = NULL;
-       /* duplicates are not tolerated */
-       struct usb_cdc_header_desc *header = NULL;
-       struct usb_cdc_ether_desc *ether = NULL;
-       struct usb_cdc_mdlm_detail_desc *detail = NULL;
-       struct usb_cdc_mdlm_desc *desc = NULL;
-       unsigned int elength;
-       int cnt = 0;
-       memset(hdr, 0x00, sizeof(struct usb_cdc_parsed_header));
-       hdr->phonet_magic_present = false;
-       while (buflen > 0) {
-               elength = buffer[0];
-               if (!elength) {
-                       dev_err(&intf->dev, "skipping garbage byte\n");
-                       elength = 1;
-                       goto next_desc;
-               }
-               if (buffer[1] != USB_DT_CS_INTERFACE) {
-                       dev_err(&intf->dev, "skipping garbage\n");
-                       goto next_desc;
-               }
-               switch (buffer[2]) {
-               case USB_CDC_UNION_TYPE: /* we've found it */
-                       if (elength < sizeof(struct usb_cdc_union_desc))
-                               goto next_desc;
-                       if (union_header) {
-                               dev_err(&intf->dev, "More than one union descriptor, skipping ...\n");
-                               goto next_desc;
-                       }
-                       union_header = (struct usb_cdc_union_desc *)buffer;
-                       break;
-               case USB_CDC_COUNTRY_TYPE:
-                       if (elength < sizeof(struct usb_cdc_country_functional_desc))
-                               goto next_desc;
-                       hdr->usb_cdc_country_functional_desc =
-                               (struct usb_cdc_country_functional_desc *)buffer;
-                       break;
-               case USB_CDC_HEADER_TYPE:
-                       if (elength != sizeof(struct usb_cdc_header_desc))
-                               goto next_desc;
-                       if (header)
-                               return -EINVAL;
-                       header = (struct usb_cdc_header_desc *)buffer;
-                       break;
-               case USB_CDC_ACM_TYPE:
-                       if (elength < sizeof(struct usb_cdc_acm_descriptor))
-                               goto next_desc;
-                       hdr->usb_cdc_acm_descriptor =
-                               (struct usb_cdc_acm_descriptor *)buffer;
-                       break;
-               case USB_CDC_ETHERNET_TYPE:
-                       if (elength != sizeof(struct usb_cdc_ether_desc))
-                               goto next_desc;
-                       if (ether)
-                               return -EINVAL;
-                       ether = (struct usb_cdc_ether_desc *)buffer;
-                       break;
-               case USB_CDC_CALL_MANAGEMENT_TYPE:
-                       if (elength < sizeof(struct usb_cdc_call_mgmt_descriptor))
-                               goto next_desc;
-                       hdr->usb_cdc_call_mgmt_descriptor =
-                               (struct usb_cdc_call_mgmt_descriptor *)buffer;
-                       break;
-               case USB_CDC_DMM_TYPE:
-                       if (elength < sizeof(struct usb_cdc_dmm_desc))
-                               goto next_desc;
-                       hdr->usb_cdc_dmm_desc =
-                               (struct usb_cdc_dmm_desc *)buffer;
-                       break;
-               case USB_CDC_MDLM_TYPE:
-                       if (elength < sizeof(struct usb_cdc_mdlm_desc *))
-                               goto next_desc;
-                       if (desc)
-                               return -EINVAL;
-                       desc = (struct usb_cdc_mdlm_desc *)buffer;
-                       break;
-               case USB_CDC_MDLM_DETAIL_TYPE:
-                       if (elength < sizeof(struct usb_cdc_mdlm_detail_desc *))
-                               goto next_desc;
-                       if (detail)
-                               return -EINVAL;
-                       detail = (struct usb_cdc_mdlm_detail_desc *)buffer;
-                       break;
-               case USB_CDC_NCM_TYPE:
-                       if (elength < sizeof(struct usb_cdc_ncm_desc))
-                               goto next_desc;
-                       hdr->usb_cdc_ncm_desc = (struct usb_cdc_ncm_desc *)buffer;
-                       break;
-               case USB_CDC_MBIM_TYPE:
-                       if (elength < sizeof(struct usb_cdc_mbim_desc))
-                               goto next_desc;
-                       hdr->usb_cdc_mbim_desc = (struct usb_cdc_mbim_desc *)buffer;
-                       break;
-               case USB_CDC_MBIM_EXTENDED_TYPE:
-                       if (elength < sizeof(struct usb_cdc_mbim_extended_desc))
-                               break;
-                       hdr->usb_cdc_mbim_extended_desc =
-                               (struct usb_cdc_mbim_extended_desc *)buffer;
-                       break;
-               case CDC_PHONET_MAGIC_NUMBER:
-                       hdr->phonet_magic_present = true;
-                       break;
-               default:
-                       /*
-                        * there are LOTS more CDC descriptors that
-                        * could legitimately be found here.
-                        */
-                       dev_dbg(&intf->dev, "Ignoring descriptor: type %02x, length %ud\n",
-                                       buffer[2], elength);
-                       goto next_desc;
-               }
-               cnt++;
- next_desc:
-               buflen -= elength;
-               buffer += elength;
-       }
-       hdr->usb_cdc_union_desc = union_header;
-       hdr->usb_cdc_header_desc = header;
-       hdr->usb_cdc_mdlm_detail_desc = detail;
-       hdr->usb_cdc_mdlm_desc = desc;
-       hdr->usb_cdc_ether_desc = ether;
-       return cnt;
- }
- EXPORT_SYMBOL(cdc_parse_cdc_header);
  /*
   * The function can't be called inside suspend/resume callback,
   * otherwise deadlock will be caused.