1. 13 10月, 2007 16 次提交
    • 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 24 次提交