1. 26 7月, 2008 1 次提交
  2. 23 7月, 2008 1 次提交
    • A
      usb_serial: API all change · 95da310e
      Alan Cox 提交于
      USB serial likes to use port->tty back pointers for the real work it does and
      to do so without any actual locking. Unfortunately when you consider hangup
      events, hangup/parallel reopen or even worse hangup followed by parallel close
      events the tty->port and port->tty pointers are not guaranteed to be the same
      as port->tty is the active tty while tty->port is the port the tty may or
      may not still be attached to.
      
      So rework the entire API to pass the tty struct. For console cases we need
      to pass both for now. This shows up multiple drivers that immediately crash
      with USB console some of which have been fixed in the process.
      
      Longer term we need a proper tty as console abstraction
      Signed-off-by: NAlan Cox <alan@redhat.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      95da310e
  3. 22 7月, 2008 4 次提交
    • A
      USB Gadget: documentation update · f579c2b4
      Alan Stern 提交于
      This patch (as1102) clarifies two points in the USB Gadget kerneldoc:
      
      	Request completion callbacks are always made with interrupts
      	disabled;
      
      	Device controllers may not support STALLing the status stage
      	of a control transfer after the data stage is over.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Acked-by: NDavid Brownell <dbrownell@users.sourceforge.net>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      f579c2b4
    • F
      usb: irda: cleanup on ir-usb module · e0d795e4
      Felipe Balbi 提交于
      General cleanup on ir-usb module. Introduced
      a common header that could be used also on
      usb gadget framework.
      
      Lot's of cleanups and now using macros from the header
      file.
      Signed-off-by: NFelipe Balbi <me@felipebalbi.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      e0d795e4
    • D
      usb gadget: composite gadget core · 40982be5
      David Brownell 提交于
      Add <linux/usb/composite.h> interfaces for composite gadget drivers, and
      basic implementation support behind it:
      
        - struct usb_function ... groups one or more interfaces into a function
          managed as one unit within a configuration, to which it's added by
          usb_add_function().
      
        - struct usb_configuration ... groups one or more such functions into
          a configuration managed as one unit by a driver, to which it's added
          by usb_add_config().  These operate at either high or full/low speeds
          and at a given bMaxPower.
      
        - struct usb_composite_driver ... groups one or more such configurations
          into a gadget driver, which may be registered or unregistered.
      
        - struct usb_composite_dev ... a usb_composite_driver manages this; it
          wraps the usb_gadget exposed by the controller driver.
      
      This also includes some basic kerneldoc.
      
      How to use it (the short version):  provide a usb_composite_driver with a
      bind() that calls usb_add_config() for each of the needed configurations.
      The configurations in turn have bind() calls, which will usb_add_function()
      for each function required.  Each function's bind() allocates resources
      needed to perform its tasks, like endpoints; sometimes configurations will
      allocate resources too.
      
      Separate patches will convert most gadget drivers to this infrastructure.
      Signed-off-by: NDavid Brownell <dbrownell@users.sourceforge.net>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      40982be5
    • D
      usb gadget: descriptor copying support · a4c39c41
      David Brownell 提交于
      Define three new descriptor manipulation utilities, for use when
      setting up functions that may have multiple instances:
      
      	usb_copy_descriptors() to copy a vector of descriptors
      	usb_free_descriptors() to free the copy
      	usb_find_endpoint() to find a copied version
      
      These will be used as follows.  Functions will continue to have static
      tables of descriptors they update, now used as __initdata templates.
      
      When a function creates a new instance, it patches those tables with
      relevant interface and string IDs, plus endpoint assignments.  Then it
      copies those morphed descriptors, associates the copies with the new
      function instance, and records the endpoint descriptors to use when
      activating the endpoints.  When initialization is done, only the copies
      remain in memory.  The copies are freed on driver removal.
      
      This ensures that each instance has descriptors which hold the right
      instance-specific data.  Two instances in the same configuration will
      obviously never share the same interface IDs or use the same endpoints.
      Instances in different configurations won't do so either, which means
      this is slightly less memory-efficient in some cases.
      
      This also includes a bugfix to the epautoconf code that shows up with
      this usage model.  It must replace the previous endpoint number when
      updating the template descriptors, not just mask in a few more bits.
      Signed-off-by: NDavid Brownell <dbrownell@users.sourceforge.net>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      a4c39c41
  4. 28 6月, 2008 1 次提交
  5. 21 5月, 2008 1 次提交
  6. 15 5月, 2008 1 次提交
    • G
      USB: add association.h · d23039ee
      Greg Kroah-Hartman 提交于
      This will be used by the wireless usb code, as well as potentially other
      USB code.
      
      Originally based on some .c code written by Inaky Perez-Gonzalez
      <inaky.perez-gonzalez@intel.com>
      
      Cc: Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
      Cc: David Brownell <david-b@pacbell.net>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      d23039ee
  7. 03 5月, 2008 3 次提交
  8. 25 4月, 2008 4 次提交
  9. 07 4月, 2008 1 次提交
  10. 25 3月, 2008 1 次提交
  11. 11 3月, 2008 2 次提交
  12. 02 2月, 2008 5 次提交
    • G
      USB: fix codingstyle issues in include/linux/usb/ · 41dceed5
      Greg Kroah-Hartman 提交于
      Fixes a number of coding style issues in the USB public header files.
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      41dceed5
    • O
      USB: stop io performed by mos7720 upon close() · a1cd7e99
      Oliver Neukum 提交于
      This fixes a problem where the mos7720 driver will make io to a device from
      which it has been logically disconnected. It does so by introducing a flag by
      which the generic usb serial code can signal the subdrivers their
      disconnection and appropriate locking.
      Signed-off-by: NOliver Neukum <oneukum@suse.de>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      
      a1cd7e99
    • R
      USB: linux/usb/Kbuild needs only "header-y", not "unifdef-y" · 6d71190e
      Robert P. J. Day 提交于
      Given that none of the referenced header files test the proprocessor
      conditional __KERNEL__, there's no point "unifdef"fing them.
      Signed-off-by: NRobert P. J. Day <rpjday@crashcourse.ca>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      6d71190e
    • A
      USB: usb_serial: clean tty reference in the last close · 9a6b1efa
      Aristeu Rozanski 提交于
      When a usb serial adapter is used as console, the usb serial console
      driver bumps the open_count on the port struct used but doesn't attach
      a real tty to it (only a fake one temporaly). If this port is opened later
      using the regular character device interface, the open method won't
      initialize the port, which is the expected, and will receive a brand new
      tty struct created by tty layer, which will be stored in port->tty.
      
      When the last close is issued, open_count won't be 0 because of the
      console usage and the port->tty will still contain the old tty value. This
      is the last ttyUSB<n> close so the allocated tty will be freed by the
      tty layer. The usb_serial and usb_serial_port are still in use by the
      console, so port_free() won't be called (serial_close() ->
      usb_serial_put() -> destroy_serial() -> port_free()), so the scheduled
      work (port->work, usb_serial_port_work()) will still run. And
      usb_serial_port_work() does:
      (...)
              tty = port->tty;
              if (!tty)
                      return;
      
              tty_wakeup(tty);
      which causes (manually copied):
      
      Faulting instruction address: 0x6b6b6b68
      Oops: Kernel access of bad area, sig: 11 [#1]
      PREEMPT PowerMac
      Modules linked in: binfmt_misc ipv6 nfs lockd nfs_acl sunrpc dm_snapshot dm_mirror dm_mod hfsplus uinput ams input_polldev genrtc cpufreq_powersave i2c_powermac therm_adt746x snd_aoa_codec_tas snd_aoa_fabric_layout snd_aoa joydev snd_aoa_i2sbus snd_pcm_oss snd_mixer_oss snd_pcm snd_timer snd_page_alloc pmac_zilog serial_core evdev ide_cd cdrom snd appletouch soundcore snd_aoa_soundbus bcm43xx firmware_class usbhid ieee80211softmac ff_memless firewire_ohci firewire_core ieee80211 ieee80211_crypt crc_itu_t sungem sungem_phy uninorth_agp agpart ssb
      NIP: 6b6b6b68 LR: c01b2108 CTR: 6b6b6b6b
      REGS: c106de80 TRAP: 0400   Not tainted  (2.6.24-rc2)
      MSR: 40009032 <EE,ME,IR,DR>  CR: 82004024  XER: 00000000
      TASK = c106b4c0[5] 'events/0' THREAD: c106c000
      GPR00: 6b6b6b6b c106df30 c106b4c0 c2d613a0 00009032 00000001 00001a00 00000001
      GPR08: 00000008 00000000 00000000 c106c000 42004028 00000000 016ffbe0 0171a724
      GPR16: 016ffcf4 00240e24 00240e70 016fee68 016ff9a4 c03046c4 c0327f50 c03046fc
      GPR24: c106b6b9 c106b4c0 c101d610 c106c000 c02160fc c1eac1dc c2d613ac c2d613a0
      NIP [6b6b6b68] 0x6b6b6b68
      LR [c01b2108] tty_wakeup+0x6c/0x9c
      Call Trace:
      [c106df30] [c01b20e8] tty_wakeup+0x4c/0x9c (unreliable)
      [c106df40] [c0216138] usb_serial_port_work+0x3c/0x78
      [c106df50] [c00432e8] run_workqueue+0xc4/0x15c
      [c106df90] [c0043798] worker_thread+0xa0/0x124
      [c106dfd0] [c0048224] kthread+0x48/0x84
      [c106dff0] [c00129bc] kernel_thread+0x44/0x60
      Instruction dump:
      XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX
      XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX
      Slab corruption: size-2048 start=c2d613a0, len=2048
      Redzone: 0x9f911029d74e35b/0x9f911029d74e35b.
      Last user: [<c01b16d8>](release_one_tty+0xbc/0xf4)
      050: 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b
      Prev obj: start=c2d60b88, len=2048
      Redzone: 0x9f911029d74e35b/0x9f911029d74e35b.
      Last user: [<c00f30ec>](show_stat+0x410/0x428)
      000: 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b
      010: 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b
      
      This patch avoids this, clearing port->tty considering if the port is
      used as serial console or not
      Signed-off-by: NAristeu Rozanski <arozansk@redhat.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      
      9a6b1efa
    • C
      USB: add Printer Gadget Driver · 25a010c8
      Craig W. Nadler 提交于
      G_PRINTER: Adds a USB printer gadget driver for use in printer firmware.
      
      This adds a USB printer gadget driver for use in printer firmware.
      The printer gadget channels data between the USB host and a userspace
      program driving the print engine. The user space program reads and
      writes the device file /dev/g_printer to receive or send printer data.
      It can use ioctl calls to the device file to get or set printer status.
      Signed-off-by: NCraig W. Nadler <craig@nadler.us>
      Signed-off-by: NDavid Brownell <dbrownell@users.sourceforge.net>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      25a010c8
  13. 01 2月, 2008 1 次提交
  14. 16 10月, 2007 1 次提交
  15. 13 10月, 2007 3 次提交
    • A
      USB: serial core should respect driver requirements · 063a2da8
      Alan Stern 提交于
      This patch (as997) fixes a bug in the USB serial core.  The core needs
      to pay attention to drivers' requirements regarding the number and
      type of endpoints a device has.
      
      At the same time, the patch changes the NUM_DONT_CARE constant (which
      is stored in a single-byte field) from -1 to a safer, unsigned value.
      It also improves the kerneldoc for several fields in the
      usb_serial_driver structure.
      
      Finally, the patch replaces a list_for_each() with list_for_each_entry().
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      
      063a2da8
    • D
      USB: move <linux/usb_gadget.h> to <linux/usb/gadget.h> · 9454a57a
      David Brownell 提交于
      Move <linux/usb_gadget.h> to <linux/usb/gadget.h>, reducing
      some of the clutter in the main include directory.
      Signed-off-by: NDavid Brownell <dbrownell@users.sourceforge.net>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      9454a57a
    • A
      USB: remove USB_QUIRK_NO_AUTOSUSPEND · a691efa9
      Alan Stern 提交于
      This patch (as995) cleans up the remains of the former NO_AUTOSUSPEND
      quirk.  Since autosuspend is disabled by default, we will let
      userspace worry about which devices can safely be suspended.  Thus the
      lengthy series of quirk entries is no longer needed, and neither is
      the quirk ID.  I suppose someone might eventually run across a hub
      that can't be suspended; let's ignore the possibility for now.
      
      The patch also cleans up the hasty way in which autosuspend gets
      disabled.  Setting udev->autosuspend_delay to -1 wasn't quite right,
      because the value is always supposed to be a multiple of HZ.  It's
      better to leave the delay value alone and set autosuspend_disabled,
      which is what the quirk routine used to do.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Cc: stable <stable@kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      a691efa9
  16. 13 7月, 2007 3 次提交
  17. 28 4月, 2007 2 次提交
  18. 24 2月, 2007 3 次提交
  19. 17 2月, 2007 2 次提交