1. 19 11月, 2011 6 次提交
    • A
      USB: make the usbfs memory limit configurable · 3f5eb8d5
      Alan Stern 提交于
      The 16-MB global limit on memory used by usbfs isn't suitable for all
      people.  It's a reasonable default, but there are applications
      (especially for SuperSpeed devices) that need a lot more.
      
      This patch (as1498) creates a writable module parameter for usbcore to
      control the global limit.  The default is still 16 MB, but users can
      change it at runtime, even after usbcore has been loaded.  As a
      special case, setting the value to 0 is treated the same as the hard
      limit of 2047 MB.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      3f5eb8d5
    • A
      USB: change the memory limits in usbfs URB submission · add1aaea
      Alan Stern 提交于
      For a long time people have complained about the limitations imposed
      by usbfs.  URBs coming from userspace are not allowed to have transfer
      buffers larger than a more-or-less arbitrary maximum.
      
      While it is generally a good idea to avoid large transfer buffers
      (because the data has to be bounced to/from a contiguous kernel-space
      buffer), it's not the kernel's job to enforce such limits.  Programs
      should be allowed to submit URBs as large as they like; if there isn't
      sufficient contiguous memory available then the submission will fail
      with a simple ENOMEM error.
      
      On the other hand, we would like to prevent programs from submitting a
      lot of small URBs and using up all the DMA-able kernel memory.  To
      that end, this patch (as1497) replaces the old limits on individual
      transfer buffers with a single global limit on the total amount of
      memory in use by usbfs.  The global limit is set to 16 MB as a nice
      compromise value: not too big, but large enough to hold about 300 ms
      of data for high-speed transfers.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      add1aaea
    • A
      USB: unify some error pathways in usbfs · 52fb743d
      Alan Stern 提交于
      This patch (as1496) unifies the error-return pathways of several
      functions in the usbfs driver.  This is not a very important change by
      itself; it merely prepares the way for the next patch in this series.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      52fb743d
    • A
      USB: remove homegrown UTF conversion routine for gadgets · 86dc243c
      Alan Stern 提交于
      This patch (as1502) removes the UTF8-to-UTF16 conversion routine in
      the USB gadget library and replaces it with a call to the equivalent
      function in the NLS library.
      
      The only downside worth noting is that the NLS library routine
      requires the output buffer to be 16-bit aligned.  This is always true
      in the gadget code, because the output buffer is always a
      usb_request buffer being used to send a string descriptor.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      86dc243c
    • A
      NLS: improve UTF8 -> UTF16 string conversion routine · 0720a06a
      Alan Stern 提交于
      The utf8s_to_utf16s conversion routine needs to be improved.  Unlike
      its utf16s_to_utf8s sibling, it doesn't accept arguments specifying
      the maximum length of the output buffer or the endianness of its
      16-bit output.
      
      This patch (as1501) adds the two missing arguments, and adjusts the
      only two places in the kernel where the function is called.  A
      follow-on patch will add a third caller that does utilize the new
      capabilities.
      
      The two conversion routines are still annoyingly inconsistent in the
      way they handle invalid byte combinations.  But that's a subject for a
      different patch.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      CC: Clemens Ladisch <clemens@ladisch.de>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      0720a06a
    • A
      OHCI: remove uses of hcd->state · b7463c71
      Alan Stern 提交于
      This patch (as1500) removes all uses of the objectionable hcd->state
      variable from the ohci-hcd family of drivers.  It is replaced by a
      private ohci->rh_state field, just as in uhci-hcd and ehci-hcd.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      b7463c71
  2. 16 11月, 2011 34 次提交