[PATCH][RESEND] Force mouse detection as imps/2 (and fix my KVM switch)
jhf_at_rivenstone.net
Date: 08/31/03
- Previous message: Felix Seeger: "Re: Reiser4 snapshot problems"
- Next in thread: Petr Baudis: "Re: [RESEND] Force mouse detection as imps/2 (and fix my KVM switch)"
- Reply: Petr Baudis: "Re: [RESEND] Force mouse detection as imps/2 (and fix my KVM switch)"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Sun, 31 Aug 2003 09:06:19 -0400 To: vojtech@suse.cz
After working out the symptoms of a problem I was having using my
scroll mouse with my KVM switch when running 2.6 kernels, I made this
patch which fixes the problem for me. I think it would be useful to
have this in the kernel, especially since it has other uses too.
I have a Logitech mouse with a scroll wheel that 2.6 kernels
detect as supporting the Logitech ps2++ protocol, and enable it as
such. My KVM switch supports only the Microsoft imps2 protocol for
using the scroll wheel, so after switching away from a box running a
2.6 kernel and back again, my scroll wheel no longer works; evbug
doesn't see any mouse events at all when I turn the scroll wheel.
2.4 (and Windows) don't have this problem because they use imps2
drivers, which my mouse is compatible with. So the appended patch
creates a new module/boot parameter, psmouse_imps2, largely copied
from psmouse_noext. With the option, the mouse detection is limited
to only the base ps2 protocol and the imps2 extensions, my mouse is
detected as a generic imps/2 device, and the scroll wheel works
properly again.
I've been using this patch for about a month. I've since seen
another use for this parameter; with it it is possible to disable the
synaptics touchpad driver and still use an external imps2 mouse.
I'm not sure if short-circuiting the mouse detection this way
might leave some mice wedged, or cause them to be improperly detected
though. Do the tests for imps/2 mice depend on any of the commands in
the detection this patch skips to initialize the mouse somehow?
This patch is against -test4; it applies to -test4-mm4 with
offsets (I'm running -mm4). More than half the length of the patch is
indentation. Is there a possibility of getting this applied?
diff -urN linux-2.6.0-test4/Documentation/kernel-parameters.txt linux-2.6.0-test4_changed/Documentation/kernel-parameters.txt
--- linux-2.6.0-test4/Documentation/kernel-parameters.txt 2003-08-31 08:08:00.000000000 -0400
+++ linux-2.6.0-test4_changed/Documentation/kernel-parameters.txt 2003-08-31 08:15:29.000000000 -0400
@@ -785,6 +785,8 @@
psmouse_noext [HW,MOUSE] Disable probing for PS2 mouse protocol extensions
+ psmouse_imps2 [HW,MOUSE] Probe only for Intellimouse PS2 mouse protocol extensions
+
pss= [HW,OSS] Personal Sound System (ECHO ESC614)
Format: <io>,<mss_io>,<mss_irq>,<mss_dma>,<mpu_io>,<mpu_irq>
diff -urN linux-2.6.0-test4/drivers/input/mouse/psmouse-base.c linux-2.6.0-test4_changed/drivers/input/mouse/psmouse-base.c
--- linux-2.6.0-test4/drivers/input/mouse/psmouse-base.c 2003-07-27 12:58:51.000000000 -0400
+++ linux-2.6.0-test4_changed/drivers/input/mouse/psmouse-base.c 2003-08-31 08:15:29.000000000 -0400
@@ -25,6 +25,8 @@
MODULE_DESCRIPTION("PS/2 mouse driver");
MODULE_PARM(psmouse_noext, "1i");
MODULE_PARM_DESC(psmouse_noext, "Disable any protocol extensions. Useful for KVM switches.");
+MODULE_PARM(psmouse_imps2, "1i");
+MODULE_PARM_DESC(psmouse_imps2, "Limit protocol extensions to the Intellimouse protocol.");
MODULE_PARM(psmouse_resolution, "i");
MODULE_PARM_DESC(psmouse_resolution, "Resolution, in dpi.");
MODULE_PARM(psmouse_smartscroll, "i");
@@ -34,6 +36,7 @@
#define PSMOUSE_LOGITECH_SMARTSCROLL 1
static int psmouse_noext;
+static int psmouse_imps2;
int psmouse_resolution;
int psmouse_smartscroll = PSMOUSE_LOGITECH_SMARTSCROLL;
@@ -250,66 +253,68 @@
if (psmouse_noext)
return PSMOUSE_PS2;
-/*
- * Try Synaptics TouchPad magic ID
- */
-
- param[0] = 0;
- psmouse_command(psmouse, param, PSMOUSE_CMD_SETRES);
- psmouse_command(psmouse, param, PSMOUSE_CMD_SETRES);
- psmouse_command(psmouse, param, PSMOUSE_CMD_SETRES);
- psmouse_command(psmouse, param, PSMOUSE_CMD_SETRES);
- psmouse_command(psmouse, param, PSMOUSE_CMD_GETINFO);
+ if (!psmouse_imps2) {
- if (param[1] == 0x47) {
- psmouse->vendor = "Synaptics";
- psmouse->name = "TouchPad";
- if (!synaptics_init(psmouse))
- return PSMOUSE_SYNAPTICS;
- else
- return PSMOUSE_PS2;
- }
+ /*
+ * Try Synaptics TouchPad magic ID
+ */
-/*
- * Try Genius NetMouse magic init.
- */
+ param[0] = 0;
+ psmouse_command(psmouse, param, PSMOUSE_CMD_SETRES);
+ psmouse_command(psmouse, param, PSMOUSE_CMD_SETRES);
+ psmouse_command(psmouse, param, PSMOUSE_CMD_SETRES);
+ psmouse_command(psmouse, param, PSMOUSE_CMD_SETRES);
+ psmouse_command(psmouse, param, PSMOUSE_CMD_GETINFO);
+
+ if (param[1] == 0x47) {
+ psmouse->vendor = "Synaptics";
+ psmouse->name = "TouchPad";
+ if (!synaptics_init(psmouse))
+ return PSMOUSE_SYNAPTICS;
+ else
+ return PSMOUSE_PS2;
+ }
- param[0] = 3;
- psmouse_command(psmouse, param, PSMOUSE_CMD_SETRES);
- psmouse_command(psmouse, NULL, PSMOUSE_CMD_SETSCALE11);
- psmouse_command(psmouse, NULL, PSMOUSE_CMD_SETSCALE11);
- psmouse_command(psmouse, NULL, PSMOUSE_CMD_SETSCALE11);
- psmouse_command(psmouse, param, PSMOUSE_CMD_GETINFO);
+ /*
+ * Try Genius NetMouse magic init.
+ */
- if (param[0] == 0x00 && param[1] == 0x33 && param[2] == 0x55) {
+ param[0] = 3;
+ psmouse_command(psmouse, param, PSMOUSE_CMD_SETRES);
+ psmouse_command(psmouse, NULL, PSMOUSE_CMD_SETSCALE11);
+ psmouse_command(psmouse, NULL, PSMOUSE_CMD_SETSCALE11);
+ psmouse_command(psmouse, NULL, PSMOUSE_CMD_SETSCALE11);
+ psmouse_command(psmouse, param, PSMOUSE_CMD_GETINFO);
- set_bit(BTN_EXTRA, psmouse->dev.keybit);
- set_bit(BTN_SIDE, psmouse->dev.keybit);
- set_bit(REL_WHEEL, psmouse->dev.relbit);
+ if (param[0] == 0x00 && param[1] == 0x33 && param[2] == 0x55) {
- psmouse->vendor = "Genius";
- psmouse->name = "Wheel Mouse";
- return PSMOUSE_GENPS;
- }
+ set_bit(BTN_EXTRA, psmouse->dev.keybit);
+ set_bit(BTN_SIDE, psmouse->dev.keybit);
+ set_bit(REL_WHEEL, psmouse->dev.relbit);
-/*
- * Try Logitech magic ID.
- */
+ psmouse->vendor = "Genius";
+ psmouse->name = "Wheel Mouse";
+ return PSMOUSE_GENPS;
+ }
- param[0] = 0;
- psmouse_command(psmouse, param, PSMOUSE_CMD_SETRES);
- psmouse_command(psmouse, NULL, PSMOUSE_CMD_SETSCALE11);
- psmouse_command(psmouse, NULL, PSMOUSE_CMD_SETSCALE11);
- psmouse_command(psmouse, NULL, PSMOUSE_CMD_SETSCALE11);
- param[1] = 0;
- psmouse_command(psmouse, param, PSMOUSE_CMD_GETINFO);
+ /*
+ * Try Logitech magic ID.
+ */
- if (param[1]) {
- int type = ps2pp_detect_model(psmouse, param);
- if (type)
- return type;
+ param[0] = 0;
+ psmouse_command(psmouse, param, PSMOUSE_CMD_SETRES);
+ psmouse_command(psmouse, NULL, PSMOUSE_CMD_SETSCALE11);
+ psmouse_command(psmouse, NULL, PSMOUSE_CMD_SETSCALE11);
+ psmouse_command(psmouse, NULL, PSMOUSE_CMD_SETSCALE11);
+ param[1] = 0;
+ psmouse_command(psmouse, param, PSMOUSE_CMD_GETINFO);
+
+ if (param[1]) {
+ int type = ps2pp_detect_model(psmouse, param);
+ if (type)
+ return type;
+ }
}
-
/*
* Try IntelliMouse magic init.
*/
@@ -555,6 +560,12 @@
return 1;
}
+static int __init psmouse_imps2_setup(char *str)
+{
+ psmouse_imps2 = 1;
+ return 1;
+}
+
static int __init psmouse_resolution_setup(char *str)
{
get_option(&str, &psmouse_resolution);
@@ -568,6 +579,7 @@
}
__setup("psmouse_noext", psmouse_noext_setup);
+__setup("psmouse_imps2", psmouse_imps2_setup);
__setup("psmouse_resolution=", psmouse_resolution_setup);
__setup("psmouse_smartscroll=", psmouse_smartscroll_setup);
-- Joseph Fannin jhf@rivenstone.net "Linus, please apply. Breaks everything. But is cool." -- Rusty Russell.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
- application/pgp-signature attachment: stored
- Previous message: Felix Seeger: "Re: Reiser4 snapshot problems"
- Next in thread: Petr Baudis: "Re: [RESEND] Force mouse detection as imps/2 (and fix my KVM switch)"
- Reply: Petr Baudis: "Re: [RESEND] Force mouse detection as imps/2 (and fix my KVM switch)"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
- Console debugging wishlist was: Re: oops pauser.
... > In my quest to get better debug data from users in Fedora bug reports, ...
What I would like to have is a "more" option for the kernel that makes ... a larger scroll
back buffer. ... That's the killer issues why this patch is a bad idea. ... (Linux-Kernel) - Re: Supporting tilt-wheels at the OS level.
... > horizontal tilt events from the mouse to the kernel. ... > bookkeeping
of two streams of scroll events for a mouse ... basically the same way Linux does
at the driver level: ... able to tell us how they updated this for the tilt wheel. ...
(comp.os.linux.development.apps) - Please help: Odd mouse problem with kernel-2.6.7-1.494.2.2
... I use a ps/2 scroll mouse on all of ... and since installing the 2.6.7-1.494.2.2
kernel the scroll ... did not occur on any previous kernel or under fc1 or rh9.
... and if I boot the former it never occurs while if I boot the latter, ... (Fedora) - Re: kernel recompile minor problems: help
... Press the "Scroll Lock" or "Pause" key to see the shutdown errors ... search
more info about your soundcard. ... or it's based on a Chipset and you can select that
in the kernel config. ... > stopped and devices shutdown and then I get continuous
rolling screenfulls ... (comp.os.linux.setup) - Re: Please help: Odd mouse problem with kernel-2.6.7-1.494.2.2
... and since installing the 2.6.7-1.494.2.2 kernel the scroll ... > wheel
on the mouse is somewhat hosed. ... (My system got bjorked for a totally unrelated reason.)
... The kernel option hack does not work for me. ... (Fedora)