linux-acpi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mario Limonciello <mario_limonciello@dell.com>
To: Matthew Garrett <mjg59@srcf.ucam.org>
Cc: linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] Ignore garbage in dell-wmi events
Date: Tue, 28 Apr 2009 12:40:34 -0500	[thread overview]
Message-ID: <49F73F92.9000201@dell.com> (raw)


[-- Attachment #1.1: Type: text/plain, Size: 537 bytes --]

Hi:

In debugging with some future machines that actually contain BIOS level
support for dell-wmi, I've determined that the upper half of the data
that comes back from wmi_get_event_data may sometimes contain extra
information that isn't currently relevant when pulling scan codes out of
the data.  This causes dell-wmi to improperly respond to these events.

I'm attaching a patch (Exchange would munge up the line breaks otherwise).

Thanks,

-- 
Mario Limonciello
*Dell | Linux Engineering*
mario_limonciello@dell.com

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: dell-wmi-mask-buffer.patch --]
[-- Type: text/x-patch; name="dell-wmi-mask-buffer.patch", Size: 693 bytes --]

--- a/drivers/platform/x86/dell-wmi.c~	2009-04-28 12:32:32.000000000 -0500
+++ b/drivers/platform/x86/dell-wmi.c	2009-04-28 12:33:02.000000000 -0500
@@ -182,7 +182,7 @@
 
 	if (obj && obj->type == ACPI_TYPE_BUFFER) {
 		int *buffer = (int *)obj->buffer.pointer;
-		key = dell_wmi_get_entry_by_scancode(buffer[1]);
+		key = dell_wmi_get_entry_by_scancode(0xFFFF & buffer[1]);
 		if (key) {
 			input_report_key(dell_wmi_input_dev, key->keycode, 1);
 			input_sync(dell_wmi_input_dev);
@@ -190,7 +190,7 @@
 			input_sync(dell_wmi_input_dev);
 		} else
 			printk(KERN_INFO "dell-wmi: Unknown key %x pressed\n",
-			       buffer[1]);
+			       0xFFFF & buffer[1]);
 	}
 }
 

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 260 bytes --]

             reply	other threads:[~2009-04-28 17:40 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-28 17:40 Mario Limonciello [this message]
2009-04-29 16:55 ` [PATCH] Ignore garbage in dell-wmi events Matthew Garrett
2009-04-29 18:13   ` Mario Limonciello
2009-04-29 18:28     ` Matthew Garrett
2009-04-29 20:16 ` Andrew Morton

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=49F73F92.9000201@dell.com \
    --to=mario_limonciello@dell.com \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mjg59@srcf.ucam.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).