1. 28 4月, 2007 3 次提交
    • T
      USB: Allow transfer_buffer with transfer_dma · 35d07fd5
      Tony Lindgren 提交于
      Some host controller drivers may need a PIO fallback when a DMA channel
      is temporarily unavailable.  This patch provides an address that such
      drivers can use for PIO in those cases, and nulls that field out when
      no such address is available (highmem) which should help usbmon.
      Signed-off-by: NTony Lindgren <tony@atomide.com>
      Signed-off-by: NDavid Brownell <dbrownell@users.sourceforge.net>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      35d07fd5
    • K
      USB: make usbdevices export their device nodes instead of using a separate class · 9f8b17e6
      Kay Sievers 提交于
      o The "real" usb-devices export now a device node which can
        populate /dev/bus/usb.
      
      o The usb_device class is optional now and can be disabled in the
        kernel config. Major/minor of the "real" devices and class devices
        are the same.
      
      o The environment of the usb-device event contains DEVNUM and BUSNUM to
        help udev and get rid of the ugly udev rule we need for the class
        devices.
      
      o The usb-devices and usb-interfaces share the same bus, so I used
        the new "struct device_type" to let these devices identify
        themselves. This also removes the current logic of using a magic
        platform-pointer.
        The name of the device_type is also added to the environment
        which makes it easier to distinguish the different kinds of devices
        on the same subsystem.
      
        It looks like this:
          add@/devices/pci0000:00/0000:00:1d.1/usb2/2-1
          ACTION=add
          DEVPATH=/devices/pci0000:00/0000:00:1d.1/usb2/2-1
          SUBSYSTEM=usb
          SEQNUM=1533
          MAJOR=189
          MINOR=131
          DEVTYPE=usb_device
          PRODUCT=46d/c03e/2000
          TYPE=0/0/0
          BUSNUM=002
          DEVNUM=004
      
      This udev rule works as a replacement for usb_device class devices:
        SUBSYSTEM=="usb", ACTION=="add", ENV{DEVTYPE}=="usb_device", \
          NAME="bus/usb/$env{BUSNUM}/$env{DEVNUM}", MODE="0644"
      
      Updated patch, which needs the device_type patches in Greg's tree.
      
      I also got a bugzilla assigned for this. :)
        https://bugzilla.novell.com/show_bug.cgi?id=250659Signed-off-by: NKay Sievers <kay.sievers@vrfy.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      
      9f8b17e6
    • G
      USB: remove use of the bus rwsem, as it doesn't really protect anything. · 341487a8
      Greg Kroah-Hartman 提交于
      The driver core stopped using the rwsem a long time ago, yet the USB
      core still grabbed the lock, thinking it protected something.  This
      patch removes that useless use.
      
      Cc: Alan Stern <stern@rowland.harvard.edu>
      Cc: Oliver Neukum <oneukum@suse.de>
      Cc: David Brownell <david-b@pacbell.net>
      Cc: linux-usb-devel <linux-usb-devel@lists.sourceforge.net>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      341487a8
  2. 10 3月, 2007 1 次提交
  3. 24 2月, 2007 1 次提交
  4. 17 2月, 2007 1 次提交
    • A
      USB: unconfigure devices which have config 0 · 3f141e2a
      Alan Stern 提交于
      Some USB devices do have a configuration 0, in contravention of the
      USB spec.  Normally 0 is supposed to indicate that a device is
      unconfigured.
      
      While we can't change what the device is doing, we can change usbcore.
      This patch (as852) allows usb_set_configuration() to accept a config
      value of -1 as indicating that the device should be unconfigured.  The
      request actually sent to the device will still contain 0 as the value.
      But even if the device does have a configuration 0, dev->actconfig
      will be set to NULL and dev->state will be set to USB_STATE_ADDRESS.
      
      Without some sort of special-case handling like this, there is no way
      to unconfigure these non-compliant devices.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      3f141e2a
  5. 08 2月, 2007 1 次提交
  6. 08 12月, 2006 1 次提交
  7. 02 12月, 2006 2 次提交
  8. 22 11月, 2006 1 次提交
  9. 17 11月, 2006 1 次提交
  10. 05 10月, 2006 1 次提交
    • D
      IRQ: Maintain regs pointer globally rather than passing to IRQ handlers · 7d12e780
      David Howells 提交于
      Maintain a per-CPU global "struct pt_regs *" variable which can be used instead
      of passing regs around manually through all ~1800 interrupt handlers in the
      Linux kernel.
      
      The regs pointer is used in few places, but it potentially costs both stack
      space and code to pass it around.  On the FRV arch, removing the regs parameter
      from all the genirq function results in a 20% speed up of the IRQ exit path
      (ie: from leaving timer_interrupt() to leaving do_IRQ()).
      
      Where appropriate, an arch may override the generic storage facility and do
      something different with the variable.  On FRV, for instance, the address is
      maintained in GR28 at all times inside the kernel as part of general exception
      handling.
      
      Having looked over the code, it appears that the parameter may be handed down
      through up to twenty or so layers of functions.  Consider a USB character
      device attached to a USB hub, attached to a USB controller that posts its
      interrupts through a cascaded auxiliary interrupt controller.  A character
      device driver may want to pass regs to the sysrq handler through the input
      layer which adds another few layers of parameter passing.
      
      I've build this code with allyesconfig for x86_64 and i386.  I've runtested the
      main part of the code on FRV and i386, though I can't test most of the drivers.
      I've also done partial conversion for powerpc and MIPS - these at least compile
      with minimal configurations.
      
      This will affect all archs.  Mostly the changes should be relatively easy.
      Take do_IRQ(), store the regs pointer at the beginning, saving the old one:
      
      	struct pt_regs *old_regs = set_irq_regs(regs);
      
      And put the old one back at the end:
      
      	set_irq_regs(old_regs);
      
      Don't pass regs through to generic_handle_irq() or __do_IRQ().
      
      In timer_interrupt(), this sort of change will be necessary:
      
      	-	update_process_times(user_mode(regs));
      	-	profile_tick(CPU_PROFILING, regs);
      	+	update_process_times(user_mode(get_irq_regs()));
      	+	profile_tick(CPU_PROFILING);
      
      I'd like to move update_process_times()'s use of get_irq_regs() into itself,
      except that i386, alone of the archs, uses something other than user_mode().
      
      Some notes on the interrupt handling in the drivers:
      
       (*) input_dev() is now gone entirely.  The regs pointer is no longer stored in
           the input_dev struct.
      
       (*) finish_unlinks() in drivers/usb/host/ohci-q.c needs checking.  It does
           something different depending on whether it's been supplied with a regs
           pointer or not.
      
       (*) Various IRQ handler function pointers have been moved to type
           irq_handler_t.
      Signed-Off-By: NDavid Howells <dhowells@redhat.com>
      (cherry picked from 1b16e7ac850969f38b375e511e3fa2f474a33867 commit)
      7d12e780
  11. 28 9月, 2006 5 次提交
  12. 01 7月, 2006 1 次提交
  13. 22 6月, 2006 2 次提交
  14. 21 3月, 2006 2 次提交
  15. 01 2月, 2006 1 次提交
  16. 05 1月, 2006 2 次提交
    • A
      [PATCH] USB: fix local variable clash · f3d34ed4
      Alan Stern 提交于
      This patch (as621) fixes a local variable conflict I accidently
      introduced into usb_set_configuration.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      f3d34ed4
    • A
      [PATCH] USB: Consider power budget when choosing configuration · 55c52718
      Alan Stern 提交于
      This patch (as609) changes the way we keep track of power budgeting for
      USB hubs and devices, and it updates the choose_configuration routine to
      take this information into account.  (This is something we should have
      been doing all along.)  A new field in struct usb_device holds the amount
      of bus current available from the upstream port, and the usb_hub structure
      keeps track of the current available for each downstream port.
      
      Two new rules for configuration selection are added:
      
      	Don't select a self-powered configuration when only bus power
      	is available.
      
      	Don't select a configuration requiring more bus power than is
      	available.
      
      However the first rule is #if-ed out, because I found that the internal
      hub in my HP USB keyboard claims that its only configuration is
      self-powered.  The rule would prevent the configuration from being chosen,
      leaving the hub & keyboard unconfigured.  Since similar descriptor errors
      may turn out to be fairly common, it seemed wise not to include a rule
      that would break automatic configuration unnecessarily for such devices.
      
      The second rule may also trigger unnecessarily, although this should be
      less common.  More likely it will annoy people by sometimes failing to
      accept configurations that should never have been chosen in the first
      place.
      
      The patch also changes usbcore's reaction when no configuration is
      suitable.  Instead of raising an error and rejecting the device, now
      the core will simply leave the device unconfigured.  People can always
      work around such problems by installing configurations manually through
      sysfs.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      55c52718
  17. 18 11月, 2005 2 次提交
  18. 29 10月, 2005 5 次提交
    • A
      [PATCH] usbcore: Fix handling of sysfs strings and other attributes · 4f62efe6
      Alan Stern 提交于
      This patch (as592) makes a few small improvements to the way device
      strings are handled, and it fixes some bugs in a couple of other sysfs
      attribute routines.  (Look at show_configuration_string() to see what I
      mean.)
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      4f62efe6
    • A
      [PATCH] usbcore: Use kzalloc instead of kmalloc/memset · 0a1ef3b5
      Alan Stern 提交于
      This patch (as590) fixes up all the remaining places where usbcore can
      use kzalloc rather than kmalloc/memset.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      0a1ef3b5
    • A
      [PATCH] usbcore: endpoint attributes track altsetting changes · 0e6c8e8d
      Alan Stern 提交于
      This patch (as588) fixes the way endpoint attribute files are registered
      and unregistered.  Now they will correctly track along with altsetting
      changes.  This fixes bugzilla entry #5467.
      
      In a separate but related change, when a usb_reset_configuration call
      fails, the device state is not changed to USB_STATE_ADDRESS.  In the
      first place, failure means that we don't know what the state is, not
      that we know the device is unconfigured.  In the second place, doing
      this can potentially lead to a memory leak, since usbcore might not
      realize there still is a current configuration that needs to be
      destroyed.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      0e6c8e8d
    • A
      [PATCH] USB: usb_bulk_message() handles interrupts endpoints · d09d36a9
      Alan Stern 提交于
      Because there is no bulk_interrupt_message() routine and no
      USBDEVFS_INTERRUPT ioctl, people have been forced to abuse the
      usb_bulk_message() routine and USBDEVFS_BULK by using them for interrupt
      transfers as well as bulk transfers.
      
      This patch (as567) formalizes this practice and adds code to
      usb_bulk_message() for detecting when the target is really an interrupt
      endpoint.  If it is, the routine submits an interrupt URB (using the
      default interval) instead of a bulk URB.  In theory this should help HCDs
      that don't like it when people try to mix transfer types, queuing both
      periodic and non-periodic types for the same endpoint.
      
      Not fully tested -- I don't have any programs that use USBDEVFS_BULK for
      interrupt transfers -- but it compiles okay and normal bulk messages work
      as well as before.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      
       drivers/usb/core/message.c |   24 ++++++++++++++++++++----
       1 file changed, 20 insertions(+), 4 deletions(-)
      d09d36a9
    • D
      [PATCH] usb_interface power state · db690874
      David Brownell 提交于
      This updates the handling of power state for USB interfaces.
      
        - Formalizes an existing invariant:  interface "power state" is a boolean:
          ON when I/O is allowed, and FREEZE otherwise.  It does so by defining
          some inlined helpers, then using them.
      
        - Adds a useful invariant:  the only interfaces marked active are those
          bound to non-suspended drivers.  Later patches build on this invariant.
      
        - Simplifies the interface driver API (and removes some error paths) by
          removing the requirement that they record power state changes during
          suspend and resume callbacks.  Now usbcore does that.
      
      A few drivers were simplified to address that last change.
      Signed-off-by: NDavid Brownell <dbrownell@users.sourceforge.net>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      
       drivers/usb/core/hub.c       |   33 +++++++++------------
       drivers/usb/core/message.c   |    1
       drivers/usb/core/usb.c       |   65 +++++++++++++++++++++++++++++++++----------
       drivers/usb/core/usb.h       |   18 +++++++++++
       drivers/usb/input/hid-core.c |    2 -
       drivers/usb/misc/usbtest.c   |   10 ------
       drivers/usb/net/pegasus.c    |    2 -
       drivers/usb/net/usbnet.c     |    2 -
       8 files changed, 85 insertions(+), 48 deletions(-)
      db690874
  19. 28 10月, 2005 1 次提交
  20. 22 9月, 2005 1 次提交
  21. 09 9月, 2005 2 次提交
    • D
      [PATCH] USB: remove annoying message · 8f34c288
      david-b@pacbell.net 提交于
      Avoid an annoying message that can appear if devices are disconnected
      in the middle of a USB scatterlist operation.
      
      Message noted in http://bugzilla.kernel.org/show_bug.cgi?id=4373
      (but the real issue there seems to be a SCSI level hang).
      Signed-off-by: NDavid Brownell <dbrownell@users.sourceforge.net>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      8f34c288
    • A
      [PATCH] USB: URB_ASYNC_UNLINK flag removed from the kernel · b375a049
      Alan Stern 提交于
      29 July 2005, Cambridge, MA:
      
      This afternoon Alan Stern submitted a patch to remove the URB_ASYNC_UNLINK
      flag from the Linux kernel.  Mr. Stern explained, "This flag is a relic
      from an earlier, less-well-designed system.  For over a year it hasn't
      been used for anything other than printing warning messages."
      
      An anonymous spokesman for the Linux kernel development community
      commented, "This is exactly the sort of thing we see happening all the
      time.  As the kernel evolves, support for old techniques and old code can
      be jettisoned and replaced by newer, better approaches.  Proprietary
      operating systems do not have the freedom or flexibility to change so
      quickly."
      
      Mr. Stern, a staff member at Harvard University's Rowland Institute who
      works on Linux only as a hobby, noted that the patch (labelled as548) did
      not update two files, keyspan.c and option.c, in the USB drivers' "serial"
      subdirectory.  "Those files need more extensive changes," he remarked.
      "They examine the status field of several URBs at times when they're not
      supposed to.  That will need to be fixed before the URB_ASYNC_UNLINK flag
      is removed."
      
      Greg Kroah-Hartman, the kernel maintainer responsible for overseeing all
      of Linux's USB drivers, did not respond to our inquiries or return our
      calls.  His only comment was "Applied, thanks."
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      b375a049
  22. 30 7月, 2005 1 次提交
  23. 13 7月, 2005 1 次提交
  24. 04 5月, 2005 1 次提交
    • S
      [PATCH] USB: Spelling fixes for drivers/usb. · 093cf723
      Steven Cole 提交于
      Here are some spelling corrections for drivers/usb.
      
      cancelation -> cancellation
      succesful -> successful
      cancelation -> cancellation
      decriptor -> descriptor
      Initalize -> Initialize
      wierd -> weird
      Protocoll -> Protocol
      occured -> occurred
      successfull -> successful
      Procesing -> Processing
      devide -> divide
      Isochronuous -> Isochronous
      noticable -> noticeable
      Basicly -> Basically
      transfering -> transferring
      intialize -> initialize
      Incomming -> Incoming
      additionnal -> additional
      asume -> assume
      Unfortunatly -> Unfortunately
      retreive -> retrieve
      tranceiver -> transceiver
      Compatiblity -> Compatibility
      Incorprated -> Incorporated
      existance -> existence
      Ununsual -> Unusual
      Signed-off-by: NSteven Cole <elenstev@mesatop.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      093cf723