Commit graph

180888 commits

Author SHA1 Message Date
Alan Ott a8ab5d58b0 HID: hidraw: Use Interrupt Endpoint for OUT Transfers if Available
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: Alan Ott <alan@signal11.us>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2010-05-18 10:43:23 +02:00
Don Prince 117ea33a18 HID: hid-samsung: remove redundant key mappings
Remove 7 redundant key mappings from Desktop Wireless 6000 that are
already handled by the default hid code.

Reported-by: Robert Schedel <r.schedel@yahoo.de>
Signed-off-by: Don Prince <dhprince-devel@yahoo.co.uk>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2010-05-18 10:41:19 +02:00
Jiri Kosina d0742abaa1 HID: add omitted hid-zydacron.c file
Commit a9885c8f7b ("HID: Zydacron Remote Control driver") added
hid-zydracon driver by Don Prince, but mistakenly omitted hid-zydracon.c
file itself. Properly add the file.

Reported-by: Don Prince <dhprince.devel@yahoo.co.uk>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2010-05-17 20:58:47 +02:00
Don Prince b355850ba3 HID: hid-samsung: add support for Creative Desktop Wireless 6000
Add support for the multimedia buttons of the Creative Desktop Wireless 6000
keyboard/mouse combo which are not currently handled by the default/samsung HID
driver.

Signed-off-by: Don Prince <dhprince-devel@yahoo.co.uk>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2010-05-17 13:36:44 +02:00
Don Prince a9885c8f7b HID: Zydacron Remote Control driver
A specialised HID driver for the Zydacron Remote Control (usb id: 13ec:0006).

The specialised HID driver adds support for the buttons which are not

currently handled by the default HID driver.

Signed-off-by: Don Prince <dhprince-devel@yahoo.co.uk>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2010-05-17 10:37:04 +02:00
Julia Lawall 1721a238ba HID: Use kmemdup
Use kmemdup when some other buffer is immediately copied into the
allocated region.

A simplified version of the semantic patch that makes this change is as
follows: (http://coccinelle.lip6.fr/)

// <smpl>
@@
expression from,to,size,flag;
statement S;
@@

-  to = \(kmalloc\|kzalloc\)(size,flag);
+  to = kmemdup(from,size,flag);
   if (to==NULL || ...) S
-  memcpy(to, from, size);
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2010-05-17 10:25:41 +02:00
Antonio Ospite 81cd584394 HID: hidraw: fix indentation
Signed-off-by: Antonio Ospite <ospite@studenti.unina.it>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2010-05-11 10:47:55 +02:00
Peter Hutterer fe6065dc30 HID: add multi-input quirk for eGalax Touchcontroller
I've got one of these devices on my desk and it seems that it suffers from
the ABS_Z/ABS_RX issue that we've seen in other devices before. This patch
uses the same reasoning as 9db630b48 ("HID: add multi-input quirk for NextWindow
Touchscreen").

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2010-05-10 08:48:07 +02:00
Wayne Thomas bf280628fc HID: add support for BTC Emprex 3009URF III Vista MCE Remote
The Behavior Tech. Computer Corp. (BTC) remote branded as "Emprex 3009URF III
Vista Remote Controller" uses non-standard mappings for all of its 'special
purpose' keys (0xffbc usage page).  This patch modifies the existing
hid-topseed quirky driver to support both remotes in order to prevent
proliferation of in-kernel quirky drivers until such a time that udev remapping
works with these devices.  Tested successfully with both the "Emprex" remote
and the "CyberLink" remote originally supported by the hid-topseed driver.

Signed-off-by: Wayne Thomas <waynethomas69@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2010-04-29 00:45:01 +02:00
Przemo Firszt 15d8ee9a96 HID: wacom: add ABI doc entry for speed attribute
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2010-04-23 02:14:10 +02:00
Jiri Kosina 96a7813736 HID: fix build failure
Fix build failure introduced by 4afb032068 ("HID: fix
support for Wacom Intuos 4 wireless") due to missing coma.

Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2010-04-23 00:22:07 +02:00
Jiri Kosina 4afb032068 HID: fix support for Wacom Intuos 4 wireless
Commit ed9eac5b49 ("HID: add support for the Wacom Intuos 4 wireles")
forgot to add VID/PID to hid_blacklist[]. Fix that up.

Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2010-04-21 16:22:30 +02:00
Bastien Nocera ed9eac5b49 HID: add support for the Wacom Intuos 4 wireless
Same command set as the Graphire Bluetooth tablet.

Signed-off-by: Bastien Nocera <hadess@hadess.net>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2010-04-21 16:22:03 +02:00
Lorenzo Castelli 1839221293 HID: add mappings for a few keys found on Logitech MX3200
The keys are added to the generic wireless mappings in case other
keyboards use them. Note that the product ID for the MX3200 is the same
as USB_DEVICE_ID_S510_RECEIVER_2.

Signed-off-by: Lorenzo Castelli <lcastelli@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2010-04-19 13:26:28 +02:00
Bastien Nocera b5e5a37e36 HID: add HID_QUIRK_HIDDEV_FORCE and HID_QUIRK_NO_IGNORE
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: Bastien Nocera <hadess@hadess.net>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2010-04-19 13:11:43 +02:00
Pete Zaitcev 75c28df87e HID: non-overlapping zeroing of extra bits
From my review of the way the unused bits of report are being zeroed,
it seems like there must be a bug. Currently, the zeroing is done
in hid_output_field and it covers any bits between the last used bit
and the end of the byte. But in case of, say, my keyboard, NumLock is
mask 0x01 and CapsLock is 0x02. Invoking hid_output_field for NumLock
definitely zeroes across CapsLock. The only reason this works is that
the fields are sorted by the offset.

It would be more correct and simpler to zero-fill the buffer into
which the fields are set.

The patch is tested with an IBM keyboard that is improperly sensitive
to out-of-report pad bits, the extra bits are still zeroed and the
fields continue to work as expected. It is also tested with good
keyboards.

In case, a related bug in RHEL 5 is tracked with Red Hat bug 513934.

Signed-off-by: Pete Zaitcev <zaitcev@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2010-04-13 15:55:49 +02:00
Stephane Chatty 6dec143a50 HID: add support for 3M multitouch 22" display
Now support the 22" display and its updated firmware, including touch
width and height.

The number of touches can now go up to 60, and our single touch emulation
will fail when there are more than 6-7 touches; further work is needed on
this.

Signed-off-by: Stephane Chatty <chatty@enac.fr>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2010-04-11 20:34:50 +02:00
Alan Stern 3d61510f4e HID: usbhid: enable remote wakeup for keyboards
This patch (as1365) enables remote wakeup by default for USB keyboard
devices.  Keyboards in general are supposed to be wakeup devices, but
the correct place to enable it depends on the device's bus; no single
approach will work for all keyboard devices.  In particular, this
covers only USB keyboards (and then only those supporting the boot
protocol).

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2010-04-03 01:36:03 +02:00
Przemo Firszt 20a3ce7e49 HID: add sysfs speed attribute for wacom bluetooth tablet
The attribute allows to change reporting speed of tablet from userspace through
sysfs file. The attribute is RW, valid values: 0 is low speed, 1 is high speed.
High speed is the default setting. Using low speed is a workaround if you
experience lag when using the tablet.

Signed-off-by: Przemo Firszt <przemo@firszt.eu>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2010-03-22 09:55:26 +01:00
Przemo Firszt 06c7c313b5 HID: separate mode switching function for wacom bluetooth driver
wacom_poke function allows to switch tablet reporting speed. The patch
dosen't add any new functionality, but it's preparation for user-space
speed switching through sysfs.

Signed-off-by: Przemo Firszt <przemo@firszt.eu>
Signed-off-by: Bastien Nocera <hadess@hadess.net>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2010-03-22 09:55:04 +01:00
Przemo Firszt 59d2334ac9 HID: expose wacom pen tablet battery through power_supply class
This patch exposes wacom pen tablet battery capacity and ac state thru
power_supply class is sysfs.

Signed-off-by: Przemo Firszt <przemo@firszt.eu>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2010-03-16 11:55:43 +01:00
Bruno Prémont 4da361b691 HID: register debugfs entries before adding device
Register debugfs entries before calling device_add() so debugfs entries are
already present when HID driver's probe function gets called on device hotplug.

Also undo debugfs entry registration if device_add() fails so status
HID_STAT_ADDED and debugfs registration status remain consistent and we don't
leak the debugfs entries.

Signed-off-by: Bruno Prémont <bonbons@linux-vserver.org>
Cc: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2010-03-15 14:55:40 +01:00
Linus Torvalds a85821fce2 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid: (41 commits)
  HID: usbhid: initialize interface pointers early enough
  HID: extend mask for BUTTON usage page
  HID: hid-ntrig: Single touch mode tap
  HID: hid-ntrig: multitouch cleanup and fix
  HID: n-trig: remove unnecessary tool switching
  HID: hid-ntrig add multi input quirk and clean up
  HID: usbhid: introduce timeout for stuck ctrl/out URBs
  HID: magicmouse: coding style and probe failure fixes
  HID: remove MODULE_VERSION from new drivers
  HID: fix up Kconfig entry for MagicMouse
  HID: add a device driver for the Apple Magic Mouse.
  HID: Export hid_register_report
  HID: Support for MosArt multitouch panel
  HID: add pressure support for the Stantum multitouch panel
  HID: fixed bug in single-touch emulation on the stantum panel
  HID: fix typo in error message
  HID: add mapping for "AL Network Chat" usage
  HID: use multi input quirk for TouchPack touchscreen
  HID: make full-fledged hid-bus drivers properly selectable
  HID: make Wacom modesetting failures non-fatal
  ...
2010-02-25 14:42:39 -08:00
Jiri Kosina 14ef2b0c02 Merge branches 'upstream', 'raw_report_modifications' and 'apple_magic_mouse' into for-linus
Conflicts:
	drivers/hid/Kconfig
2010-02-25 17:39:16 +01:00
Linus Torvalds 10df38cafc Merge git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux-2.6-for-linus
* git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux-2.6-for-linus: (44 commits)
  Add MAINTAINERS entry for virtio_console
  virtio: console: Fill ports' entire in_vq with buffers
  virtio: console: Error out if we can't allocate buffers for control queue
  virtio: console: Add ability to remove module
  virtio: console: Ensure no memleaks in case of unused buffers
  virtio: console: show error message if hvc_alloc fails for console ports
  virtio: console: Add debugfs files for each port to expose debug info
  virtio: console: Add ability to hot-unplug ports
  virtio: console: Handle port hot-plug
  virtio: console: Remove cached data on port close
  virtio: console: Register with sysfs and create a 'name' attribute for ports
  virtio: console: Ensure only one process can have a port open at a time
  virtio: console: Add file operations to ports for open/read/write/poll
  virtio: console: Associate each port with a char device
  virtio: console: Prepare for writing to userspace buffers
  virtio: console: Add a new MULTIPORT feature, support for generic ports
  virtio: console: Introduce a send_buf function for a common path for sending data to host
  virtio: console: Introduce function to hand off data from host to readers
  virtio: console: Separate out find_vqs operation into a different function
  virtio: console: Separate out console init into a new function
  ...
2010-02-25 07:22:59 -08:00
Linus Torvalds dbd004291e Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/security-testing-2.6
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/security-testing-2.6:
  netlabel: fix export of SELinux categories > 127
2010-02-25 07:09:54 -08:00
Joshua Roys c36f74e67f netlabel: fix export of SELinux categories > 127
This fixes corrupted CIPSO packets when SELinux categories greater than 127
are used.  The bug occured on the second (and later) loops through the
while; the inner for loop through the ebitmap->maps array used the same
index as the NetLabel catmap->bitmap array, even though the NetLabel bitmap
is twice as long as the SELinux bitmap.

Signed-off-by: Joshua Roys <joshua.roys@gtri.gatech.edu>
Acked-by: Paul Moore <paul.moore@hp.com>
Signed-off-by: James Morris <jmorris@namei.org>
2010-02-25 17:49:20 +11:00
Linus Torvalds 7491612c7d Merge branch 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jgarzik/libata-dev
* 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jgarzik/libata-dev:
  ahci: disable FPDMA auto-activate optimization on NVIDIA AHCI
2010-02-24 21:12:11 -08:00
Robert Hancock 453d3131ec ahci: disable FPDMA auto-activate optimization on NVIDIA AHCI
Mike Cui reported that his system with an NVIDIA MCP79 (aka MCP7A)
chipset stopped working with 2.6.32. The problem appears to be that
2.6.32 now enables the FPDMA auto-activate optimization in the ahci
driver. The drive works fine with this enabled on an Intel AHCI so
this appears to be a chipset bug.  Since MCP79 is a fairly recent
NVIDIA chipset and we don't have any info on whether any other NVIDIA
chipsets have this issue, disable FPDMA AA optimization on all NVIDIA
AHCI controllers for now.

Should address http://bugzilla.kernel.org/show_bug.cgi?id=14922

Signed-off-by: Robert Hancock <hancockrwd@gmail.com>
While-we-investigate-issue-this-patch-looks-good-to-me-by:
	Prajakta Gudadhe <pgudadhe@nvidia.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Cc: stable@kernel.org
2010-02-24 22:44:48 -05:00
Xiaotian Feng baac35c415 security: fix error return path in ima_inode_alloc
If radix_tree_preload is failed in ima_inode_alloc, we don't need
radix_tree_preload_end because kernel is alread preempt enabled

Signed-off-by: Xiaotian Feng <dfeng@redhat.com>
Signed-off-by: Mimi Zohar <zohar@us.ibm.com>
Signed-off-by: James Morris <jmorris@namei.org>
2010-02-25 07:54:33 +11:00
Linus Torvalds 60b341b778 Linux 2.6.33 2010-02-24 10:52:17 -08:00
Linus Torvalds 1e6c5c4e4c Merge branch 'urgent' of git://git.kernel.org/pub/scm/linux/kernel/git/kyle/parisc-2.6
* 'urgent' of git://git.kernel.org/pub/scm/linux/kernel/git/kyle/parisc-2.6:
  parisc: Set PCI CLS early in boot.
2010-02-24 10:51:21 -08:00
Linus Torvalds 46fe24389a Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/aegl/linux-2.6
* 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/aegl/linux-2.6:
  [IA64] Fix broken sn2 build
2010-02-24 10:51:04 -08:00
Carlos O'Donell 5fd4514bb3 parisc: Set PCI CLS early in boot.
Set the PCI CLS early in the boot process to prevent
device failures. In pcibios_set_master use the new
pci_cache_line_size instead of a hard-coded value.

Signed-off-by: Carlos O'Donell <carlos@codesourcery.com>
Reviewed-by: Grant Grundler <grundler@google.com>
Signed-off-by: Kyle McMartin <kyle@redhat.com>
2010-02-24 17:30:36 +00:00
Linus Torvalds 7b1f94b8a6 Merge branch 'for-linus' of git://git.monstr.eu/linux-2.6-microblaze
* 'for-linus' of git://git.monstr.eu/linux-2.6-microblaze:
  microblaze: Fix out_le32() macro
  microblaze: Fix cache loop function for cache range
2010-02-24 07:43:02 -08:00
Linus Torvalds 83d90addc8 Merge branch 'for-linus' of git://git.kernel.dk/linux-2.6-block
* 'for-linus' of git://git.kernel.dk/linux-2.6-block:
  Revert "block: improve queue_should_plug() by looking at IO depths"
2010-02-24 07:42:42 -08:00
Steven J. Magnani 83b4d17d88 microblaze: Fix out_le32() macro
Trailing semicolon causes compilation involving out_le32() to fail.

Signed-off-by: Steven J. Magnani <steve@digidescorp.com>
Signed-off-by: Michal Simek <monstr@monstr.eu>
2010-02-24 13:18:49 +01:00
Michal Simek 0d670b2472 microblaze: Fix cache loop function for cache range
I create wrong asm code but none test shows that this part of code is wrong.
I am not convinces that were good idea to create asm optimized macros
for caches. The reason is that there is not optimization with previous code
that's why make sense to add old code and do some benchmarking which
functions are faster.

Signed-off-by: Michal Simek <monstr@monstr.eu>
2010-02-24 13:18:29 +01:00
Amit Shah c610028611 Add MAINTAINERS entry for virtio_console
I'm taking ownership of the virtio_console module; but I'll continue
feeding patches via Rusty.

Signed-off-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2010-02-24 14:23:07 +10:30
Amit Shah d693356192 virtio: console: Fill ports' entire in_vq with buffers
Instead of allocating just one buffer for a port's in_vq, fill
the entire in_vq with buffers so the host need not stall while
an application consumes the data and makes the buffer available
again for the host.

Signed-off-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2010-02-24 14:23:06 +10:30
Amit Shah 22a29eacd2 virtio: console: Error out if we can't allocate buffers for control queue
With MULTIPORT support, the control queue is an integral part of the
functioning of the device. If we can't get any buffers allocated, the
host won't be able to relay important information and the device may not
function as intended.

Ensure 'probe' doesn't succeed until the control queue has at least one
buffer allocated for its ivq.

Signed-off-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2010-02-24 14:23:04 +10:30
Amit Shah 7177876fea virtio: console: Add ability to remove module
Add the ability to remove the virtio_console module.

This aids debugging.

Signed-off-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2010-02-24 14:23:04 +10:30
Amit Shah a9cdd48557 virtio: console: Ensure no memleaks in case of unused buffers
If unused data exists in in_vq, ensure we flush that first and then
detach unused buffers, which will ensure all buffers from the in_vq are
removed.

Also ensure we free the buffers after detaching them.

Signed-off-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2010-02-24 14:23:03 +10:30
Amit Shah 298add723a virtio: console: show error message if hvc_alloc fails for console ports
Signed-off-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2010-02-24 14:23:02 +10:30
Amit Shah d99393effd virtio: console: Add debugfs files for each port to expose debug info
This is helpful in examining ports' state.

Signed-off-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2010-02-24 14:23:01 +10:30
Amit Shah 1f7aa42d16 virtio: console: Add ability to hot-unplug ports
Remove port data; deregister from the hvc core if it's a console port.

Signed-off-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2010-02-24 14:23:00 +10:30
Amit Shah 7f5d810dac virtio: console: Handle port hot-plug
If the 'nr_ports' variable in the config space is updated to a higher
value, that means new ports have been hotplugged.

Introduce a new workqueue to handle such updates and create new ports.

Signed-off-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2010-02-24 14:22:58 +10:30
Amit Shah 88f251ac58 virtio: console: Remove cached data on port close
Remove any data that we might have in a port's inbuf when closing a port
or when any data is received when a port is closed.

Signed-off-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2010-02-24 14:22:57 +10:30
Amit Shah 431edb8a8b virtio: console: Register with sysfs and create a 'name' attribute for ports
The host can set a name for ports so that they're easily discoverable
instead of going by the /dev/vportNpn naming. This attribute will be
placed in /sys/class/virtio-ports/vportNpn/name. udev scripts can then
create symlinks to the port using the name.

Signed-off-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2010-02-24 14:22:56 +10:30
Amit Shah 3c7969ccb5 virtio: console: Ensure only one process can have a port open at a time
Add a guest_connected field that ensures only one process
can have a port open at a time.

This also ensures we don't have a race when we later add support for
dropping buffers when closing the char dev and buffer caching is turned
off for the particular port.

Signed-off-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2010-02-24 14:22:55 +10:30