[This is an email copy of a Usenet post to "alt.os.linux.mandrake"]

Hi

I had fun this morning when trying to get the following to work together:
Mandrake 7.2, kernel 2.2.17
Creative SBLive soundcard (with game port)
Logitech Wingman Interceptor joystick on above game port.

The problem is that the SBLive game port appears on IO address 0xa400,
not 0x201 as more usual. The logitech joystick driver in 2.2.17 does not
take any parameters to tell it to use a different IO address - so here is
a patch which applies to drivers/char/joystick/joy-logitech.c

To apply:
cd /usr/src/linux  (or wherever you keep the working kernel source)
patch -p1 < /some-path/joy-logitech-port-patch
make modules
cp drivers/char/joystick/joy-logitecg.o /lib/modules/2.2.17-21mdk/misc/
insmod joystick
insmod joy-logitech js_lt=0xa400

The above assumes a stock Mandrake 7.2 non smp kernel using modules.
Also assumes your kernel configuration is OK.

Simple test is:
od -c /dev/js0
Wibble the joystick - you should get lots of data.

I HAVE NOT tested the patch with a statically linked kernel. If someone
confirms this is still OK, please let me know.

The maintainer of the joy-logitech.c file has this patch also.
Enjoy :)

Tim Southerwood

Patch begins:
*************************************Cut after here**************
diff --unified --recursive linux-2.2.17-orig/drivers/char/joystick/joy-logitech.c 
linux-2.2.17/drivers/char/joystick/joy-logitech.c
--- linux-2.2.17-orig/drivers/char/joystick/joy-logitech.c      Mon Jan  1 10:18:35 
2001
+++ linux-2.2.17/drivers/char/joystick/joy-logitech.c   Mon Jan  1 13:32:49 2001
@@ -31,6 +31,14 @@
  * Vojtech Pavlik, Ucitelska 1576, Prague 8, 182 00 Czech Republic
  */

+/* Patch added 1 Jan 2001 allowing 1 new module parameter. Synopsis:
+ * insmod joy-logitech js_lt=0x????
+ * where 0x???? is the port address of your game port.
+ * Ports may include (but not limited to) 0x201 (standard),
+ * 0xa400 (Creative SBLive)
+ * Tim Southerwood, email: [EMAIL PROTECTED]
+ */
+
 #include <asm/io.h>
 #include <asm/system.h>
 #include <linux/delay.h>
@@ -82,6 +90,12 @@
 static int js_lt_port_list[] __initdata = { 0x201, 0 };
 static struct js_port* js_lt_port __initdata = NULL;

+MODULE_AUTHOR("Vojtech Pavlik <[EMAIL PROTECTED]>");
+
+/* Allows a port address to be supplied */
+MODULE_PARM(js_lt, "1i");
+static int __initdata js_lt[] = { -1 };
+
 /*
  * Device names.
  */
@@ -518,15 +532,37 @@
        return port;
 }

+#ifndef MODULE
+int __init js_lt_setup(SETUP_PARAM)
+{
+        int i;
+
+/* We only get one module parameter right now
+ * but I decided to leave the code generalised for more than one
+ * parameter just in case
+ */
+       SETUP_PARSE(1);
+       for (i = 0; i <= ints[0] && i < 1; i++) js_lt[i] = ints[i+1];
+    return 1;
+}
+__setup("js_lt=", js_lt_setup);
+#endif
+
 #ifdef MODULE
 int init_module(void)
 #else
 int __init js_lt_init(void)
 #endif
 {
-       int *p;
+       int i;

-       for (p = js_lt_port_list; *p; p++) js_lt_port = js_lt_probe(*p, js_lt_port);
+       if (js_lt[0] >= 0) {
+               for (i = 0; (js_lt[i] >= 0) && i < 1; i++)
+                       js_lt_port = js_lt_probe(js_lt[i], js_lt_port);
+       } else {
+               for (i = 0; js_lt_port_list[i]; i++)
+                       js_lt_port = js_lt_probe(js_lt_port_list[i], js_lt_port);
+       }
        if (js_lt_port) return 0;

 #ifdef MODULE
*************************************************** End Patch*************

Reply via email to