1. 13 10月, 2007 25 次提交
    • D
      USB: gadget: gadget zero cleanups · ca2bdf4b
      David Brownell 提交于
      Clean up gadget zero, using newer APIs and conventions:
      
       - gadget_is_dualspeed() and gadget_is_otg() ... #ifdef removal
      
       - Remove many now-needless #includes
      
       - Use the VERBOSE_DEBUG convention
      
       - Some whitespace fixes.
      
       - A few comment updates
       
       - Plus a few other small cleanups:  don't pass gfp_t around when it's
         always going to be GFP_ATOMIC, and do static init of serial number.
      
      Also go to straight GPL; there's no real point in dual licensing this
      stuff any more.
      Signed-off-by: NDavid Brownell <dbrownell@users.sourceforge.net>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      ca2bdf4b
    • D
      USB: gadget: file storage gadget cleanups · 2e806f67
      David Brownell 提交于
      Clean up the file storage gadget, using newer APIs and conventions:
      
       - gadget_is_dualspeed() and gadget_is_otg() ... #ifdef removal
      
       - Remove many now-needless #includes
      
       - Use the DEBUG (from Kconfig+Makefile) and VERBOSE_DEBUG conventions.
      
       - Remove some "sparse" warnings (it still dislikes the __user annotations)
      
      This gave only a minor object code shrinkage.
      Signed-off-by: NDavid Brownell <dbrownell@users.sourceforge.net>
      Cc: Alan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      2e806f67
    • D
      USB: gadget: serial gadget cleanups · 51a0e85c
      David Brownell 提交于
      Clean up the serial gadget, using newer APIs and conventions:
      
       - gadget_is_dualspeed() and gadget_is_otg() ... #ifdef removal
      
       - Remove many now-needless #includes
      
       - Use the DEBUG and VERBOSE_DEBUG conventions; turned up a bug in
         the original debug messaging
      
       - Various whitespace fixes.
      
      This gave only a minor object code shrinkage, but the source looks
      much cleaner in various places.
      Signed-off-by: NDavid Brownell <dbrownell@users.sourceforge.net>
      Cc: Al Borchers <alborchers@steinerpoint.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      51a0e85c
    • D
      USB: gadget: gmidi cleanups · 8c070216
      David Brownell 提交于
      Clean up the midi gadget, using newer APIs and conventions:
      
       - Remove many now-needless #includes
      
       - Use the DEBUG (from Kconfig+Makefile) and VERBOSE_DEBUG conventions.
      
       - Whitespace fixes
      
      There should be no effect on object code size.
      Signed-off-by: NDavid Brownell <dbrownell@users.sourceforge.net>
      Cc: Ben Williamson <ben.williamson@greyinnovation.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      8c070216
    • D
      USB: gadget: ethernet gadget cleanups, shrinkage · 0cf4f2de
      David Brownell 提交于
      Clean up the ethernet gadget, using newer APIs and conventions:
      
       - gadget_is_dualspeed() and gadget_is_otg() ... #ifdef removal
      
       - Remove many now-needless #includes
      
       - Use the VERBOSE_DEBUG convention
      
       - Minor whitespace fixes.
      
       - Fix a warning from "sparse".
      
      Surprisingly, this saved about 2K of code (16%) on a fullspeed-only
      ARMv4 platform.  I'm bit puzzled by that (it's so much!), but approve
      of the result.
      Signed-off-by: NDavid Brownell <dbrownell@users.sourceforge.net>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      0cf4f2de
    • D
      USB: gadget: gadget_is_{dualspeed,otg} predicates and cleanup · a4e3ef55
      David Brownell 提交于
      This adds two small inlines to the gadget stack, which will
      often evaluate to compile-time constants.  That can help
      shrink object code and remove #ifdeffery.
      
       - gadget_is_dualspeed(), currently always a compile-time
         constant (depending on which controller is selected).
      
       - gadget_is_otg(), usually a compile time "false", but this
         is a runtime test if the platform enables OTG (since it's
         reasonable to populate boards with different USB sockets).
      
      It also updates two peripheral controller drivers to use these:
      
       - fsl_usb2_udc, mostly OTG-related bugfixes:  non-OTG devices
         must follow the rules about drawing VBUS power, and OTG ones
         need to reject invalid SET_FEATURE requests.
      
       - omap_udc, just scrubbing a bit of #ifdeffery.
      
      And also gadgetfs, which lost some #ifdefs and moved to a more
      standard handling of DEBUG and VERBOSE_DEBUG.
      
      The main benefits come from patches which will follow.
      Signed-off-by: NDavid Brownell <dbrownell@users.sourceforge.net>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      a4e3ef55
    • N
      USB: Add drivers/usb/misc/iowarrior.c to the Makefile · a1d534bb
      Nico Erfurth 提交于
      This patch adds the new iowarrior module to the Makefile in drivers/usb.
      Currently the module isn't build unless another driver from usb/misc is
      selected.
      Signed-off-by: NNico Erfurth <masta@perlgolf.de>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      a1d534bb
    • A
      USB: separate out endpoint queue management and DMA mapping routines · 9a9bf406
      Alan Stern 提交于
      This patch (as953) separates out three key portions from
      usb_hcd_submit_urb(), usb_hcd_unlink_urb(), and usb_hcd_giveback_urb()
      and puts them in separate functions of their own.  In the next patch,
      these functions will be called directly by host controller drivers
      while holding their private spinlocks, which will remove the
      possibility of some unpleasant races.
      
      The code responsible for mapping and unmapping DMA buffers is also
      placed into a couple of separate subroutines, for the sake of
      cleanliness and consistency.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      9a9bf406
    • A
      USB: update spinlock usage for root-hub URBs · 9439eb94
      Alan Stern 提交于
      This patch (as952) adjusts the spinlock usage in the root-hub
      emulation part of usbcore, to make it match more closely the pattern
      used by regular host controller drivers.  To wit: The private lock
      (usb_hcd_root_hub_lock) is held throughout the important parts, and it
      is dropped temporarily without re-enabling interrupts around the call
      to usb_hcd_giveback_urb().
      
      A nice side effect is that the code now avoids calling
      local_irq_save(), thereby becoming more RT-friendly.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      9439eb94
    • A
      USB: cleanup for previous patches · d617bc83
      Alan Stern 提交于
      This patch (as951) cleans up a few loose ends from earlier patches.
      Redundant checks for non-NULL urb->dev are removed, as are checks of
      urb->dev->bus (which can never be NULL).  Conversely, a check for
      non-NULL urb->ep is added to the unlink paths.
      
      A homegrown round-down-to-power-of-2 loop is simplified by using the
      ilog2 routine.  The comparison in usb_urb_dir_in() is made more
      transparent.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      d617bc83
    • A
      USB: avoid urb->pipe in usbmon · 18ea5d00
      Alan Stern 提交于
      This patch (as949) changes the usbmon driver to use the new urb->ep
      field rather than urb->pipe.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Cc: Pete Zaitcev <zaitcev@redhat.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      18ea5d00
    • A
      USB: avoid urb->pipe in usbfs · 93cf9b90
      Alan Stern 提交于
      This patch (as948) removes most of the references to urb->pipe from
      the usbfs routines in devio.c.  The one tricky aspect is in
      snoop_urb(), which can be called before the URB is submitted and which
      uses usb_urb_dir_in().  For this to work properly, the URB's direction
      flag must be set manually in proc_do_submiturb().
      
      The patch also fixes a minor bug; the wValue, wIndex, and wLength
      fields were snooped in proc_do_submiturb() without conversion from
      le16 to CPU-byte-ordering.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      93cf9b90
    • A
      USB: address-0 handling during device initialization · 4326ed0b
      Alan Stern 提交于
      This patch (as947) changes the device initialization and enumeration
      code in hub.c; now udev->devnum will be set to 0 while the device is
      being accessed at address 0.  Until now this wasn't needed because the
      address value was passed as part of urb->pipe; without that field the
      device address must be stored elsewhere.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      4326ed0b
    • A
      USB: avoid using urb->pipe in usbcore · 5e60a161
      Alan Stern 提交于
      This patch (as946) eliminates many of the uses of urb->pipe in
      usbcore.  Unfortunately there will have to be a significant API
      change, affecting all USB drivers, before we can remove it entirely.
      This patch contents itself with changing only the interface to
      usb_buffer_map_sg() and friends: The pipe argument is replaced with a
      direction flag.  That can be done easily because those routines get
      used in only one place.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      5e60a161
    • A
      USB: add direction bit to urb->transfer_flags · fea34091
      Alan Stern 提交于
      This patch (as945) adds a bit to urb->transfer_flags for recording the
      direction of the URB.  The bit is set/cleared automatically in
      usb_submit_urb() so drivers don't have to worry about it (although as
      a result, it isn't valid until the URB has been submitted).  Inline
      routines are added for easily checking an URB's direction.  They
      replace calls to usb_pipein in the DMA-mapping parts of hcd.c.
      
      For non-control endpoints, the direction is determined directly from
      the endpoint descriptor.  However control endpoints are
      bi-directional; for them the direction is determined from the
      bRequestType byte and the wLength value in the setup packet.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      fea34091
    • A
      USB: add ep->enable · bdd016ba
      Alan Stern 提交于
      This patch (as944) adds an explicit "enabled" field to the
      usb_host_endpoint structure and uses it in place of the current
      mechanism.  This is merely a time-space tradeoff; it makes checking
      whether URBs may be submitted to an endpoint simpler.  The existing
      mechanism is efficient when converting urb->pipe to an endpoint
      pointer, but it's not so efficient when urb->ep is used instead.
      
      As a side effect, the procedure for enabling an endpoint is now a
      little more complicated.  The ad-hoc inline code in usb.c and hub.c
      for enabling ep0 is now replaced with calls to usb_enable_endpoint,
      which is no longer static.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      bdd016ba
    • A
      USB: add urb->ep · 5b653c79
      Alan Stern 提交于
      This patch (as943) prepares the way for eliminating urb->pipe by
      introducing an endpoint pointer into struct urb.  For now urb->ep
      is set by usb_submit_urb() from the pipe value; eventually drivers
      will set it themselves and we will remove urb->pipe completely.
      
      The patch also adds new inline routines to retrieve an endpoint
      descriptor's number and transfer type, essentially as replacements for
      usb_pipeendpoint and usb_pipetype.
      
      usb_submit_urb(), usb_hcd_submit_urb(), and usb_hcd_unlink_urb() are
      converted to use the new field and new routines.  Other parts of
      usbcore will be converted in later patches.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      5b653c79
    • A
      USB: Storage: usbat_check_status(): fix check-after-use · a96173af
      Adrian Bunk 提交于
      The Coverity checker spotted that we have already oops'ed if "us"
      was NULL.
      
      Since "us" can't be NULL in the only caller this patch removes the
      NULL check.
      Signed-off-by: NAdrian Bunk <bunk@stusta.de>
      Signed-off-by: NMatthew Dharm <mdharm-usb@one-eyed-alien.net>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      a96173af
    • D
      USB: usb_gadget.h whitespace fixes · efc9052e
      David Brownell 提交于
      This just fixes some whitespace bugs in <linux/usb_gadget.h>,
      mostly extraneous spaces where a single tab suffices.
      Signed-off-by: NDavid Brownell <dbrownell@users.sourceforge.net>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      efc9052e
    • R
      USB: Remove dead references to "SAFE_SERIAL" CONFIG variables. · 9f705bde
      Robert P. J. Day 提交于
      Remove the references to CONFIG_USBD_SAFE_SERIAL_{VENDOR,PRODUCT},
      which aren't defined in any Kconfig file.
      Signed-off-by: NRobert P. J. Day <rpjday@mindspring.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      9f705bde
    • M
      USB: OHCI handles more ZFMicro quirks · 89a0fd18
      Mike Nuss 提交于
      The ZF Micro OHCI controller exhibits unexpected behavior that seems to be
      related to high load.  Under certain conditions, the controller will
      complete a TD, remove it from the endpoint's queue, and fail to add it to
      the donelist. This causes the endpoint to appear to stop responding. Worse,
      if the device is removed while in that state, OHCI will hang while waiting
      for the orphaned TD to complete.  The situation is not recoverable without
      rebooting.
      
      This fix enhances the scope of the existing OHCI_QUIRK_ZFMICRO flag:
      
       1. A watchdog routine periodically scans the OHCI structures to check
          for orphaned TDs. In these cases the TD is taken back from the
          controller and completed normally.
      
       2. If a device is removed while the endpoint is hung but before the
          watchdog catches the situation, any outstanding TDs are taken back
          from the controller in the 'sanitize' phase.
      
      The ohci-hcd driver used to print "INTR_SF lossage" in this situation;
      this changes it to the universally accurate "ED unlink timeout".  Other
      instances of this message presumably have different root causes.
      
      Both this Compaq quirk and a NEC quirk are now properly compiled out for
      non-PCI builds of this driver.
      Signed-off-by: NMike Nuss <mike@terascala.com>
      Signed-off-by: NDavid Brownell <dbrownell@users.sourceforge.net>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      89a0fd18
    • P
      usblp: Make use of URB_FREE_BUFFER · e8fa0ce6
      Pete Zaitcev 提交于
      Employ the new API URB_FREE_BUFFER that we've got. There was talk of a combined
      constructor for this case, but apparently it's not happening, so just set the
      flag explicitly for now.
      Signed-off-by: NPete Zaitcev <zaitcev@redhat.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      e8fa0ce6
    • P
      usblp: Implement the ENOSPC convention · 7f477358
      Pete Zaitcev 提交于
      This patch implements a mode when a printer returns ENOSPC when it runs
      out of paper. The default remains the same as before. An application which
      wishes to use this function has to enable it explicitly with an ioctl
      LPABORT.
      
      This is done on a request by our (Fedora) CUPS guy, Tim Waugh. The API is
      similar enough to the lp0's one that CUPS works with both (but see below),
      but it's has some differences.
      
      Most importantly, the abort mode is persistent in case of lp0: once tunelp
      was run your cat fill blow up until you reboot or run tunelp again. For
      usblp, I made it so the abort mode is only in effect as long as device
      is open. This way you can mix and match CUPS and cat(1) freely and nothing
      bad happens even if you run out of paper. It is also safer in the face
      of any unexpected crashes.
      
      It has to be noted that mixing LPABORT and O_NONBLOCK is not advised.
      It probably does not do what you want: instead of returning -ENOSPC
      it will always return -EAGAIN (because it would otherwise block while
      waiting for the paper). Applications which use O_NONBLOCK should continue
      to use LPGETSTATUS like before.
      
      Finally, CUPS actually requires patching to take full advantage of this.
      It has several components; those which invoke LPABORT work, but some of
      them need the ioctl added. This is completely compatible, you can mix
      old CUPS and new kernels or vice versa.
      Signed-off-by: NPete Zaitcev <zaitcev@redhat.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      7f477358
    • J
      USB: Clean up duplicate includes in drivers/usb/ · ca337db6
      Jesper Juhl 提交于
      This patch cleans up duplicate includes in
      	drivers/usb/
      Signed-off-by: NJesper Juhl <jesper.juhl@gmail.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      ca337db6
    • M
      USB: Remove unneeded pointer intf from speedtch_upload_firmware() · 011db815
      Micah Gruber 提交于
      This trivial patch removes the unneeded pointer intf returned from
      usb_ifnum_to_if(), which is never used. The check for NULL can be simply done
      by if (!usb_ifnum_to_if(usb_dev, 2)).
      Signed-off-by: NMicah Gruber <micah.gruber@gmail.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      011db815
  2. 12 10月, 2007 15 次提交