1. 21 1月, 2011 1 次提交
    • D
      kconfig: rename CONFIG_EMBEDDED to CONFIG_EXPERT · 6a108a14
      David Rientjes 提交于
      The meaning of CONFIG_EMBEDDED has long since been obsoleted; the option
      is used to configure any non-standard kernel with a much larger scope than
      only small devices.
      
      This patch renames the option to CONFIG_EXPERT in init/Kconfig and fixes
      references to the option throughout the kernel.  A new CONFIG_EMBEDDED
      option is added that automatically selects CONFIG_EXPERT when enabled and
      can be used in the future to isolate options that should only be
      considered for embedded systems (RISC architectures, SLOB, etc).
      
      Calling the option "EXPERT" more accurately represents its intention: only
      expert users who understand the impact of the configuration changes they
      are making should enable it.
      Reviewed-by: NIngo Molnar <mingo@elte.hu>
      Acked-by: NDavid Woodhouse <david.woodhouse@intel.com>
      Signed-off-by: NDavid Rientjes <rientjes@google.com>
      Cc: Greg KH <gregkh@suse.de>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Jens Axboe <axboe@kernel.dk>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Robin Holt <holt@sgi.com>
      Cc: <linux-arch@vger.kernel.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      6a108a14
  2. 12 1月, 2011 1 次提交
  3. 23 12月, 2010 1 次提交
  4. 10 12月, 2010 1 次提交
    • J
      HID: Add and use hid_<level>: dev_<level> equivalents · 4291ee30
      Joe Perches 提交于
      Neaten current uses of dev_<level> by adding and using
      hid specific hid_<level> macros.
      
      Convert existing uses of dev_<level> uses to hid_<level>.
      Convert hid-pidff printk uses to hid_<level>.
      
      Remove err_hid and use hid_err instead.
      
      Add missing newlines to logging messages where necessary.
      Coalesce format strings.
      
      Add and use pr_fmt(fmt) KBUILD_MODNAME ": " fmt
      
      Other miscellaneous changes:
      
      Add const struct hid_device * argument to hid-core functions
      extract() and implement() so hid_<level> can be used by them.
      Fix bad indentation in hid-core hid_input_field function
      that calls extract() function above.
      Signed-off-by: NJoe Perches <joe@perches.com>
      Signed-off-by: NJiri Kosina <jkosina@suse.cz>
      4291ee30
  5. 07 12月, 2010 2 次提交
    • V
      HID: Consolidate device existence checks in hiddev_ioctl · 33d6eb57
      Valentine Barshak 提交于
      Currently, if the device has been removed before hiddev_ioctl(),
      the -EIO is returned. If it's removed while hiddev_ioctl() is in
      progress, some commands are still processed fine, others
      return -ENODEV. This change takes the "existancelock" before
      processing ioctl commands and releases it at the end.
      If the device has been removed, always returns -ENODEV.
      Signed-off-by: NValentine Barshak <vbarshak@mvista.com>
      Signed-off-by: NJiri Kosina <jkosina@suse.cz>
      33d6eb57
    • V
      HID: Fix race between disconnect and hiddev_ioctl · 1a8e8fab
      Valentine Barshak 提交于
      A USB HID device can be disconnected at any time.
      If this happens right before or while hiddev_ioctl is in progress,
      the hiddev_ioctl tries to access invalid hiddev->hid pointer.
      When the hid device is disconnected, the hiddev_disconnect()
      ends up with a call to hid_device_release() which frees
      hid_device, but doesn't set the hiddev->hid pointer to NULL.
      If the deallocated memory region has been re-used by the kernel,
      this can cause a crash or memory corruption.
      
      Since disconnect can happen at any time, we can't initialize
      struct hid_device *hid = hiddev->hid at the beginning of ioctl
      and then use it.
      
      This change checks hiddev->exist flag while holding
      the existancelock and uses hid_device only if it exists.
      Signed-off-by: NValentine Barshak <vbarshak@mvista.com>
      Signed-off-by: NJiri Kosina <jkosina@suse.cz>
      1a8e8fab
  6. 25 11月, 2010 1 次提交
  7. 18 11月, 2010 2 次提交
  8. 15 10月, 2010 1 次提交
    • A
      llseek: automatically add .llseek fop · 6038f373
      Arnd Bergmann 提交于
      All file_operations should get a .llseek operation so we can make
      nonseekable_open the default for future file operations without a
      .llseek pointer.
      
      The three cases that we can automatically detect are no_llseek, seq_lseek
      and default_llseek. For cases where we can we can automatically prove that
      the file offset is always ignored, we use noop_llseek, which maintains
      the current behavior of not returning an error from a seek.
      
      New drivers should normally not use noop_llseek but instead use no_llseek
      and call nonseekable_open at open time.  Existing drivers can be converted
      to do the same when the maintainer knows for certain that no user code
      relies on calling seek on the device file.
      
      The generated code is often incorrectly indented and right now contains
      comments that clarify for each added line why a specific variant was
      chosen. In the version that gets submitted upstream, the comments will
      be gone and I will manually fix the indentation, because there does not
      seem to be a way to do that using coccinelle.
      
      Some amount of new code is currently sitting in linux-next that should get
      the same modifications, which I will do at the end of the merge window.
      
      Many thanks to Julia Lawall for helping me learn to write a semantic
      patch that does all this.
      
      ===== begin semantic patch =====
      // This adds an llseek= method to all file operations,
      // as a preparation for making no_llseek the default.
      //
      // The rules are
      // - use no_llseek explicitly if we do nonseekable_open
      // - use seq_lseek for sequential files
      // - use default_llseek if we know we access f_pos
      // - use noop_llseek if we know we don't access f_pos,
      //   but we still want to allow users to call lseek
      //
      @ open1 exists @
      identifier nested_open;
      @@
      nested_open(...)
      {
      <+...
      nonseekable_open(...)
      ...+>
      }
      
      @ open exists@
      identifier open_f;
      identifier i, f;
      identifier open1.nested_open;
      @@
      int open_f(struct inode *i, struct file *f)
      {
      <+...
      (
      nonseekable_open(...)
      |
      nested_open(...)
      )
      ...+>
      }
      
      @ read disable optional_qualifier exists @
      identifier read_f;
      identifier f, p, s, off;
      type ssize_t, size_t, loff_t;
      expression E;
      identifier func;
      @@
      ssize_t read_f(struct file *f, char *p, size_t s, loff_t *off)
      {
      <+...
      (
         *off = E
      |
         *off += E
      |
         func(..., off, ...)
      |
         E = *off
      )
      ...+>
      }
      
      @ read_no_fpos disable optional_qualifier exists @
      identifier read_f;
      identifier f, p, s, off;
      type ssize_t, size_t, loff_t;
      @@
      ssize_t read_f(struct file *f, char *p, size_t s, loff_t *off)
      {
      ... when != off
      }
      
      @ write @
      identifier write_f;
      identifier f, p, s, off;
      type ssize_t, size_t, loff_t;
      expression E;
      identifier func;
      @@
      ssize_t write_f(struct file *f, const char *p, size_t s, loff_t *off)
      {
      <+...
      (
        *off = E
      |
        *off += E
      |
        func(..., off, ...)
      |
        E = *off
      )
      ...+>
      }
      
      @ write_no_fpos @
      identifier write_f;
      identifier f, p, s, off;
      type ssize_t, size_t, loff_t;
      @@
      ssize_t write_f(struct file *f, const char *p, size_t s, loff_t *off)
      {
      ... when != off
      }
      
      @ fops0 @
      identifier fops;
      @@
      struct file_operations fops = {
       ...
      };
      
      @ has_llseek depends on fops0 @
      identifier fops0.fops;
      identifier llseek_f;
      @@
      struct file_operations fops = {
      ...
       .llseek = llseek_f,
      ...
      };
      
      @ has_read depends on fops0 @
      identifier fops0.fops;
      identifier read_f;
      @@
      struct file_operations fops = {
      ...
       .read = read_f,
      ...
      };
      
      @ has_write depends on fops0 @
      identifier fops0.fops;
      identifier write_f;
      @@
      struct file_operations fops = {
      ...
       .write = write_f,
      ...
      };
      
      @ has_open depends on fops0 @
      identifier fops0.fops;
      identifier open_f;
      @@
      struct file_operations fops = {
      ...
       .open = open_f,
      ...
      };
      
      // use no_llseek if we call nonseekable_open
      ////////////////////////////////////////////
      @ nonseekable1 depends on !has_llseek && has_open @
      identifier fops0.fops;
      identifier nso ~= "nonseekable_open";
      @@
      struct file_operations fops = {
      ...  .open = nso, ...
      +.llseek = no_llseek, /* nonseekable */
      };
      
      @ nonseekable2 depends on !has_llseek @
      identifier fops0.fops;
      identifier open.open_f;
      @@
      struct file_operations fops = {
      ...  .open = open_f, ...
      +.llseek = no_llseek, /* open uses nonseekable */
      };
      
      // use seq_lseek for sequential files
      /////////////////////////////////////
      @ seq depends on !has_llseek @
      identifier fops0.fops;
      identifier sr ~= "seq_read";
      @@
      struct file_operations fops = {
      ...  .read = sr, ...
      +.llseek = seq_lseek, /* we have seq_read */
      };
      
      // use default_llseek if there is a readdir
      ///////////////////////////////////////////
      @ fops1 depends on !has_llseek && !nonseekable1 && !nonseekable2 && !seq @
      identifier fops0.fops;
      identifier readdir_e;
      @@
      // any other fop is used that changes pos
      struct file_operations fops = {
      ... .readdir = readdir_e, ...
      +.llseek = default_llseek, /* readdir is present */
      };
      
      // use default_llseek if at least one of read/write touches f_pos
      /////////////////////////////////////////////////////////////////
      @ fops2 depends on !fops1 && !has_llseek && !nonseekable1 && !nonseekable2 && !seq @
      identifier fops0.fops;
      identifier read.read_f;
      @@
      // read fops use offset
      struct file_operations fops = {
      ... .read = read_f, ...
      +.llseek = default_llseek, /* read accesses f_pos */
      };
      
      @ fops3 depends on !fops1 && !fops2 && !has_llseek && !nonseekable1 && !nonseekable2 && !seq @
      identifier fops0.fops;
      identifier write.write_f;
      @@
      // write fops use offset
      struct file_operations fops = {
      ... .write = write_f, ...
      +	.llseek = default_llseek, /* write accesses f_pos */
      };
      
      // Use noop_llseek if neither read nor write accesses f_pos
      ///////////////////////////////////////////////////////////
      
      @ fops4 depends on !fops1 && !fops2 && !fops3 && !has_llseek && !nonseekable1 && !nonseekable2 && !seq @
      identifier fops0.fops;
      identifier read_no_fpos.read_f;
      identifier write_no_fpos.write_f;
      @@
      // write fops use offset
      struct file_operations fops = {
      ...
       .write = write_f,
       .read = read_f,
      ...
      +.llseek = noop_llseek, /* read and write both use no f_pos */
      };
      
      @ depends on has_write && !has_read && !fops1 && !fops2 && !has_llseek && !nonseekable1 && !nonseekable2 && !seq @
      identifier fops0.fops;
      identifier write_no_fpos.write_f;
      @@
      struct file_operations fops = {
      ... .write = write_f, ...
      +.llseek = noop_llseek, /* write uses no f_pos */
      };
      
      @ depends on has_read && !has_write && !fops1 && !fops2 && !has_llseek && !nonseekable1 && !nonseekable2 && !seq @
      identifier fops0.fops;
      identifier read_no_fpos.read_f;
      @@
      struct file_operations fops = {
      ... .read = read_f, ...
      +.llseek = noop_llseek, /* read uses no f_pos */
      };
      
      @ depends on !has_read && !has_write && !fops1 && !fops2 && !has_llseek && !nonseekable1 && !nonseekable2 && !seq @
      identifier fops0.fops;
      @@
      struct file_operations fops = {
      ...
      +.llseek = noop_llseek, /* no read or write fn */
      };
      ===== End semantic patch =====
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Cc: Julia Lawall <julia@diku.dk>
      Cc: Christoph Hellwig <hch@infradead.org>
      6038f373
  9. 12 10月, 2010 1 次提交
  10. 01 10月, 2010 2 次提交
    • P
      HID: Fix for problems with eGalax/DWAV multi-touch-screen · f5166110
      Philipp Merkel 提交于
      This patch fixes three problems with the eGalax/DWAV multi-touch
      screen found in the Eee PC T101MT:
      
      1) While there is a dedicated multitouch driver for the screen
         (hid-egalax.c), the MULTI_INPUT quirk is also applied, preventing
         the hid-egalax driver from working. This patch removes the quirk
         so the hid-egalax driver can handle the device correctly.
      2) The x and y coordinates sent by the screen in multi-touch mode are
         shifted by three bits from the events sent in single-touch mode, thus
         the coordinates are out of range, leading to the pointer being stuck
         in the bottom-right corner if no additional calibration is applied
         (e.g. in the X evdev driver). This patch shifts the coordinates back.
         This does not decrease accuracy as the last three bits of the "wrong"
         coordinates are always 0.
      3) Only multi-touch pressure events are sent, single touch emulation is
         missing pressure information. This patch adds single-touch
         ABS_PRESSURE events.
      Signed-off-by: NPhilipp Merkel <mail@philmerk.de>
      Acked-by: NStéphane Chatty <chatty@enac.fr>
      Signed-off-by: NJiri Kosina <jkosina@suse.cz>
      f5166110
    • R
      HID: add NOGET quirk for AXIS 295 Video Surveillance Joystick · 8038298f
      Rok Mandeljc 提交于
      This patch adds the NOGET quirk for AXIS 295 Video Surveillance Joystick
      (despite AXIS brand the vendor is actually CH Products). Without the quirk, the
      joystick is detected but does not generate any events.
      Signed-off-by: NRok Mandeljc <rok.mandeljc@gmail.com>
      Signed-off-by: NJiri Kosina <jkosina@suse.cz>
      8038298f
  11. 24 9月, 2010 1 次提交
  12. 22 9月, 2010 2 次提交
    • A
      HID: trivial formatting fix · 12e52725
      Alan Ott 提交于
      Added blank line after declarations.
      Signed-off-by: NAlan Ott <alan@signal11.us>
      Signed-off-by: NJiri Kosina <jkosina@suse.cz>
      12e52725
    • A
      HID: don't Send Feature Reports on Interrupt Endpoint · fe2c91ee
      Alan Ott 提交于
      Feature reports should only be sent on the control endpoint.
      
      The USB HID standard is unclear and confusing on this issue. It seems to
      suggest that Feature reports can be sent on a HID device's Interrupt OUT
      endpoint.  This cannot be the case because the report type is not encoded in
      transfers sent out the Interrput OUT endpoint.  If Feature reports were sent on
      the Interrupt OUT endpint, they would be indistinguishable from Output reports
      in the case where Report IDs were not used.
      
      Further, Windows and Mac OS X do not send Feature reports out the interrupt OUT
      Endpoint.  They will only go out the Control Endpoint.
      
      In addition, many devices simply do not hande Feature reports sent out the
      Interrupt OUT endpoint.
      
      Reported-by: simon@mungewell.org
      Signed-off-by: NAlan Ott <alan@signal11.us>
      Signed-off-by: NJiri Kosina <jkosina@suse.cz>
      fe2c91ee
  13. 14 9月, 2010 1 次提交
    • G
      HID: fix hiddev's use of usb_find_interface · 8fe294ca
      Guillaume Chazarain 提交于
      My macbook infrared remote control was broken by commit
      bd25f4dd ("HID: hiddev: use
      usb_find_interface, get rid of BKL").
      
      This device appears in dmesg as:
      apple 0003:05AC:8242.0001: hiddev0,hidraw0: USB HID v1.11 Device
      [Apple Computer, Inc. IR Receiver] on usb-0000:00:1d.2-1/input0
      
      It stopped working as lircd was getting ENODEV when opening /dev/usb/hiddev0.
      
      AFAICS hiddev_driver is a dummy driver so usb_find_interface(&hiddev_driver)
      does not find anything.
      
      The device is associated with the usbhid driver, so let's do
      usb_find_interface(&hid_driver) instead.
      
      $ ls -l /sys/devices/pci0000:00/0000:00:1d.2/usb7/7-1/7-1:1.0/usb/hiddev0/device/driver
      lrwxrwxrwx 1 root root 0 2010-09-12 16:28 /sys/devices/pci0000:00/0000:00:1d.2/usb7/7-1/7-1:1.0/usb/hiddev0/device/driver -> ../../../../../../bus/usb/drivers/usbhid
      Signed-off-by: NGuillaume Chazarain <guichaz@gmail.com>
      Signed-off-by: NJiri Kosina <jkosina@suse.cz>
      8fe294ca
  14. 03 9月, 2010 1 次提交
  15. 01 9月, 2010 1 次提交
  16. 30 8月, 2010 1 次提交
  17. 24 8月, 2010 2 次提交
  18. 23 8月, 2010 1 次提交
    • N
      HID: add support for two Waltop tablets · 72a46344
      Nikolai Kondrashov 提交于
      Add support for Waltop Slim Tablet 5.8 inch and Media Tablet 10.6 inch.
      
      These (and other Waltop) tablets are usually sold by different companies
      (such as Genius and Trust) and with different names, but with the same USB
      vendor/product IDs.
      
      Slim Tablet 5.8 inch is known to also be sold as Genius G-Pen F350 and Trust
      Widescreen Mini Tablet (item no 16485).
      
      Media Tablet 10.6 inch is known to also be sold as Genius G-Pen M609 and
      M609X. Of these only the latter is known to be supported.
      Signed-off-by: NNikolai Kondrashov <spbnick@gmail.com>
      Signed-off-by: NJiri Kosina <jkosina@suse.cz>
      72a46344
  19. 19 8月, 2010 1 次提交
  20. 13 8月, 2010 2 次提交
  21. 10 8月, 2010 1 次提交
    • N
      HID: Add support for UC-Logic WP????U tablets · f8a489cc
      Nikolai Kondrashov 提交于
      Add support for UC-Logic WP4030U, WP5540U and WP8060U tablets.
      These tablets are usually sold by Genius, Trust and possibly others under
      different names and in different cases, but with the original USB
      vendor/product IDs.
      
      Currently, these tablets are supported by standalone X.org driver WizardPen.
      This patch aims to fix them in the kernel and make them supported by the
      generic evdev X.org driver. Still, some minor fixes in the X.org driver are
      to be made for the full stack support.
      Signed-off-by: NNikolai Kondrashov <spbnick@gmail.com>
      Signed-off-by: NJiri Kosina <jkosina@suse.cz>
      f8a489cc
  22. 19 7月, 2010 1 次提交
  23. 14 7月, 2010 1 次提交
    • A
      HID: hiddev: use usb_find_interface, get rid of BKL · bd25f4dd
      Arnd Bergmann 提交于
      This removes the private hiddev_table in the usbhid
      driver and changes it to use usb_find_interface
      instead.
      
      The advantage is that we can avoid the race between
      usb_register_dev and usb_open and no longer need the
      big kernel lock.
      
      This doesn't introduce race condition -- the intf pointer could be
      invalidated only in hiddev_disconnect() through usb_deregister_dev(),
      but that will block on minor_rwsem and not actually remove the device
      until usb_open().
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Cc: Jiri Kosina <jkosina@suse.cz>
      Cc: "Greg Kroah-Hartman" <gregkh@suse.de>
      Signed-off-by: NJiri Kosina <jkosina@suse.cz>
      bd25f4dd
  24. 12 7月, 2010 3 次提交
  25. 21 5月, 2010 2 次提交
    • D
      USB: rename usb_buffer_alloc() and usb_buffer_free() users · 997ea58e
      Daniel Mack 提交于
      For more clearance what the functions actually do,
      
        usb_buffer_alloc() is renamed to usb_alloc_coherent()
        usb_buffer_free()  is renamed to usb_free_coherent()
      
      They should only be used in code which really needs DMA coherency.
      
      All call sites have been changed accordingly, except for staging
      drivers.
      Signed-off-by: NDaniel Mack <daniel@caiaq.de>
      Cc: Alan Stern <stern@rowland.harvard.edu>
      Cc: Pedro Ribeiro <pedrib@gmail.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      997ea58e
    • A
      USB: remove uses of URB_NO_SETUP_DMA_MAP · 0ede76fc
      Alan Stern 提交于
      This patch (as1350) removes all usages of coherent buffers for USB
      control-request setup-packet buffers.  There's no good reason to
      reserve coherent memory for these things; control requests are hardly
      ever used in large quantity (the major exception is firmware
      transfers, and they aren't time-critical).  Furthermore, only seven
      drivers used it.  We might as well always use streaming DMA mappings
      for setup-packet buffers, and remove some extra complexity from
      usbcore.
      
      The DMA-mapping portion of hcd.c is currently in flux.  A separate
      patch will be submitted to remove support for URB_NO_SETUP_DMA_MAP
      after everything else settles down.  The removal should go smoothly,
      as by then nobody will be using it.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      0ede76fc
  26. 18 5月, 2010 1 次提交
    • A
      HID: hidraw: Use Interrupt Endpoint for OUT Transfers if Available · a8ab5d58
      Alan Ott 提交于
      This patch makes the hidraw driver use the first Interrupt OUT endpoint for
      HID transfers to the device if such an endpoint exists. This is consistent
      with the behavior of the hiddev driver, and the logic is similar.
      
      From the USB HID specification:
      
         The Interrupt Out pipe is optional. If a device declares an Interrupt Out
         endpoint then Output reports are transmitted by the host to the device
         through the Interrupt Out endpoint. If no Interrupt Out endpoint is
         declared then Output reports are transmitted to a device through the
         Control endpoint, using Set_Report(Output) requests.
      Signed-off-by: NAlan Ott <alan@signal11.us>
      Signed-off-by: NJiri Kosina <jkosina@suse.cz>
      a8ab5d58
  27. 10 5月, 2010 1 次提交
  28. 08 5月, 2010 1 次提交
  29. 27 4月, 2010 1 次提交
  30. 19 4月, 2010 1 次提交
    • B
      HID: add HID_QUIRK_HIDDEV_FORCE and HID_QUIRK_NO_IGNORE · b5e5a37e
      Bastien Nocera 提交于
      Add two quirks to make it possible for usbhid module options to
      override whether a device is ignored (HID_QUIRK_NO_IGNORE) and
      whether to connect a hiddev device (HID_QUIRK_HIDDEV_FORCE).
      
      Passing HID_QUIRK_NO_IGNORE for your device means that it will
      not be ignored by the HID layer, even if present in a blacklist.
      
      HID_QUIRK_HIDDEV_FORCE will force the creation of a hiddev for that
      device, making it accessible from user-space.
      
      Tested with an Apple IR Receiver, switching it from using appleir
      to using lirc's macmini driver.
      Signed-off-by: NBastien Nocera <hadess@hadess.net>
      Signed-off-by: NJiri Kosina <jkosina@suse.cz>
      b5e5a37e
  31. 03 4月, 2010 1 次提交