1. 15 10月, 2008 11 次提交
  2. 22 7月, 2008 2 次提交
    • M
      USB: fix usb_reset_device and usb_reset_composite_device(take 3) · 742120c6
      Ming Lei 提交于
      This patch renames the existing usb_reset_device in hub.c to
      usb_reset_and_verify_device and renames the existing
      usb_reset_composite_device to usb_reset_device. Also the new
      usb_reset_and_verify_device does't need to be EXPORTED .
      
      The idea of the patch is that external interface driver
      should warn the other interfaces' driver of the same
      device before and after reseting the usb device. One interface
      driver shoud call _old_ usb_reset_composite_device instead of
      _old_ usb_reset_device since it can't assume the device contains
      only one interface. The _old_ usb_reset_composite_device
      is safe for single interface device also. we rename the two
      functions to make the change easily.
      
      This patch is under guideline from Alan Stern.
      Signed-off-by: NMing Lei <tom.leiming@gmail.com>
      742120c6
    • M
      USB: remove interface parameter of usb_reset_composite_device · 625f6949
      Ming Lei 提交于
      From the current implementation of usb_reset_composite_device
      function, the iface parameter is no longer useful. This function
      doesn't do something special for the iface usb_interface,compared
      with other interfaces in the usb_device. So remove the parameter
      and fix the related caller.
      Signed-off-by: NMing Lei <tom.leiming@gmail.com>
      Acked-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      625f6949
  3. 29 4月, 2008 1 次提交
  4. 22 4月, 2008 4 次提交
    • O
      HID: fix race between open() and disconnect() in usbhid · 69626f23
      Oliver Neukum 提交于
      There is a window:
      
      task A					task B
      spin_lock_irq(&usbhid->inlock);	/* Sync with error handler */
      usb_set_intfdata(intf, NULL);
      spin_unlock_irq(&usbhid->inlock);
      usb_kill_urb(usbhid->urbin);
      usb_kill_urb(usbhid->urbout);
      usb_kill_urb(usbhid->urbctrl);
      
      del_timer_sync(&usbhid->io_retry);
      cancel_work_sync(&usbhid->reset_work);
      
      						if (!hid->open++) {
      							res = usb_autopm_get_interface(usbhid->intf);
      							if (res < 0) {
      								hid->open--;
      								return -EIO;
      							}
      						}
      						if (hid_start_in(hid))
      
      if (hid->claimed & HID_CLAIMED_INPUT)
      	hidinput_disconnect(hid);
      
      in which an open() to an already disconnected device will submit an URB
      to an undead device. In case disconnect() was called by an ioctl, this'll
      oops. Fix by introducing a new flag and checking it in hid_start_in().
      Signed-off-by: NOliver Neukum <oneukum@suse.de>
      Signed-off-by: NJiri Kosina <jkosina@suse.cz>
      69626f23
    • J
      HID: move wait from hid to usbhid · 1d1bdd20
      Jiri Slaby 提交于
      Since only place where this is used is usbhid, move it there.
      Signed-off-by: NJiri Slaby <jslaby@suse.cz>
      Signed-off-by: NJiri Kosina <jkosina@suse.cz>
      1d1bdd20
    • J
      HID: fix sparse warnings · 282bfd4c
      Jiri Slaby 提交于
      Fix these sparse warnings:
      .../hid/hid-core.c:100:15: warning: incorrect type in assignment (different signedness)
      .../hid/hid-core.c:100:15:    expected signed int [usertype] *value
      .../hid/hid-core.c:100:15:    got unsigned int *<noident>
              by unsigned -> s32
      
      .../hid/hid-input-quirks.c:336:10: warning: Using plain integer as NULL pointer
              by 0 -> NULL
      
      .../hid/usbhid/hid-core.c:786:46: warning: incorrect type in argument 3 (different signedness)
      .../hid/usbhid/hid-core.c:786:46:    expected int *max
      .../hid/usbhid/hid-core.c:786:46:    got unsigned int *<noident>
      .../hid/usbhid/hid-core.c:787:47: warning: incorrect type in argument 3 (different signedness)
      .../hid/usbhid/hid-core.c:787:47:    expected int *max
      .../hid/usbhid/hid-core.c:787:47:    got unsigned int *<noident>
      .../hid/usbhid/hid-core.c:788:48: warning: incorrect type in argument 3 (different signedness)
      .../hid/usbhid/hid-core.c:788:48:    expected int *max
      .../hid/usbhid/hid-core.c:788:48:    got unsigned int *<noident>
              by int -> unsigned int
      Signed-off-by: NJiri Slaby <jirislaby@gmail.com>
      Signed-off-by: NJiri Kosina <jkosina@suse.cz>
      282bfd4c
    • P
      HID: fixup fullspeed interval on highspeed Afatech DVB-T IR kbd · f345c37c
      Pekka Sarnila 提交于
      Many vendors highspeed devices give erroneously fullspeed interval value in
      endpoint descriptor for interrupt endpoints. This quirk fixes up that by
      recalculating the right value for highspeed device.
      
      At the time of hid configuration this quirk calculates which highspeed interval
      value gives same interval delay as, or next smaller then, what it would be if
      the original value would be interpreted as fullspeed value. In subsequent urbs
      that new value is used instead.
      
      Forming the 'hid->name' in usb_hid_config() was moved up to accommodate more
      descriptive printk reporting the fixup.
      
      In this patch the quirk is set for one such device: Afatech DVB-T 2 infrared
      HID-keyboard. It reports value 16 which means 4,069s in highspeed while
      obviously 16ms was intended. In this case quirk calculates new value to be 8
      which gives when interpreted as highspeed value 16ms as wanted. The behavior of
      the device was verified to be what expected both before and after the patch.
      Signed-off-by: NPekka Sarnila <sarnila@adit.fi>
      Signed-off-by: NJiri Kosina <jkosina@suse.cz>
      f345c37c
  5. 18 3月, 2008 1 次提交
  6. 14 10月, 2007 3 次提交
    • J
      HID: add hidraw interface · 86166b7b
      Jiri Kosina 提交于
      hidraw is an interface that is going to obsolete hiddev one
      day.
      
      Many userland applications are using libusb instead of using
      kernel-provided hiddev interface. This is caused by various
      reasons - the HID parser in kernel doesn't handle all the
      HID hardware on the planet properly, some devices might require
      its own specific quirks/drivers, etc.
      
      hiddev interface tries to do its best to parse all the received
      reports properly, and presents only parsed usages into userspace.
      This is however often not enough, and that's the reason why
      many userland applications just don't use hiddev at all, and
      rather use libusb to read raw USB events and process them on
      their own.
      
      Another drawback of hiddev is that it is USB-specific.
      
      hidraw interface provides userspace readers with really raw HID
      reports, no matter what the low-level transport layer is (USB/BT),
      and gives the userland applications all the freedom to process
      the HID reports in a way they wish to.
      Signed-off-by: NJiri Kosina <jkosina@suse.cz>
      86166b7b
    • J
      USB HID: provide hook for hidraw write() · efc493f9
      Jiri Kosina 提交于
      Add hook in usbhid for write() callback from hidraw. Sends the
      report to the device through control pipe.
      Signed-off-by: NJiri Kosina <jkosina@suse.cz>
      efc493f9
    • O
      HID: minimal autosuspend support for USB HID devices · 933e3187
      Oliver Neukum 提交于
      Autosuspend for USB HID devices remains problematic as far as mice
      and keyboards are concerned. While I am working on a grand solution,
      here's a minimalist patch that works for those devices not continously
      in use.
      Signed-off-by: NOliver Neukum <oneukum@suse.de>
      Signed-off-by: NJiri Kosina <jkosina@suse.cz>
      933e3187
  7. 02 8月, 2007 3 次提交
  8. 13 7月, 2007 2 次提交
    • A
      USB: add reset_resume method · f07600cf
      Alan Stern 提交于
      This patch (as918) introduces a new USB driver method: reset_resume.
      It is called when a device needs to be reset as part of a resume
      procedure (whether because of a device quirk or because of the
      USB-Persist facility), thereby taking over a role formerly assigned to
      the post_reset method.  As a consequence, post_reset no longer needs
      an argument indicating whether it is being called as part of a
      reset-resume.  This separation of functions makes the code clearer.
      
      In addition, the pre_reset and post_reset method return types are
      changed; they now must return an error code.  The return value is
      unused at present, but at some later time we may unbind drivers and
      re-probe if they encounter an error during reset handling.
      
      The existing pre_reset and post_reset methods in the usbhid,
      usb-storage, and hub drivers are updated to match the new
      requirements.  For usbhid the post_reset routine is also used for
      reset_resume (duplicate method pointers); for the other drivers a new
      reset_resume routine is added.  The change to hub.c looks bigger than
      it really is, because mark_children_for_reset_resume() gets moved down
      next to the new hub_reset_resume() routine.
      
      A minor change to usb-storage makes the usb_stor_report_bus_reset()
      routine acquire the host lock instead of requiring the caller to hold
      it already.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NJiri Kosina <jkosina@suse.cz>
      CC: Matthew Dharm <mdharm-usb@one-eyed-alien.net>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      
      f07600cf
    • A
      USB: add USB-Persist facility · 0458d5b4
      Alan Stern 提交于
      This patch (as886) adds the controversial USB-persist facility,
      allowing USB devices to persist across a power loss during system
      suspend.
      
      The facility is controlled by a new Kconfig option (with appropriate
      warnings about the potential dangers); when the option is off the
      behavior will remain the same as it is now.  But when the option is
      on, people will be able to use suspend-to-disk and keep their USB
      filesystems intact -- something particularly valuable for small
      machines where the root filesystem is on a USB device!
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      0458d5b4
  9. 09 7月, 2007 4 次提交
    • J
      HID: separate quirks for report descriptor fixup · ea9a4a8b
      Jiri Kosina 提交于
      Lately there have been quite a lot of bug reports against broken devices
      which require us to fix their report descriptor in the runtime, before it
      is passed to the HID parser. Those devices have eaten quite an amount of
      our quirks space, which isn't particularly necessary - the quirks are not
      needed after the report descriptor is parsed, and they just consume bits.
      
      Therefore this patch separates the quirks for report descriptor fixup, and
      moves their handling into separate code. The quirks are then forgotten as
      soon as the report descriptor has been parsed.
      
      Module parameter 'rdesc_quirks' is introduced to be able to modify these
      quirks in runtime in a similar way to 'quirks' parameter for ordinary HID
      quirks.
      Signed-off-by: NJiri Kosina <jkosina@suse.cz>
      ea9a4a8b
    • J
      HID: support for Petalynx Maxter remote control · 92d9e6e6
      Jiri Kosina 提交于
      Petalynx Maxter remote control [1] 0x18b1/0x0037 emits 0xfa and 0xfc from
      consumer page (reserved in HUT 1.12) for back and more keys. It also emits
      a few usages from LOGIVENDOR page, which need adding.
      
      Also, this device has broken report descriptor - the reported maximum is too
      low - it doesn't contain the range for 'back' and 'more' keys, so we need to
      bump it up before the report descriptor is being parsed.
      
      Besides all this, it also requires NOGET quirk.
      
      This patch does so.
      
      [1] http://www.elmak.pl/index.php?option=com_phpshop&page=shop.browse&category_id=14&ext=opis&lang=enSigned-off-by: NJiri Kosina <jkosina@suse.cz>
      92d9e6e6
    • A
      USB HID: avoid flush_scheduled_work() · 2fa45a4c
      Alan Stern 提交于
      This patch (as914) replaces a call to flush_scheduled_work() with
      cancel_work_sync(), in order to help avoid potential deadlocks.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NJiri Kosina <jkosina@suse.cz>
      2fa45a4c
    • J
      HID: make debugging output runtime-configurable · 58037eb9
      Jiri Kosina 提交于
      There have been many reports recently about broken HID devices, the
      diagnosis of which required users to recompile their kernels in order
      to be able to provide debugging output needed for coding a quirk for
      a particular device.
      
      This patch makes CONFIG_HID_DEBUG default y if !EMBEDDED and makes it
      possible to control debugging output produced by HID code by supplying
      'debug=1' module parameter.
      Signed-off-by: NJiri Kosina <jkosina@suse.cz>
      58037eb9
  10. 09 5月, 2007 3 次提交
  11. 19 4月, 2007 2 次提交
  12. 18 4月, 2007 1 次提交
  13. 16 4月, 2007 1 次提交
  14. 11 4月, 2007 2 次提交