Logitech Wingman Attack joystick

Mathew Kanner mat at cnd.mcgill.ca
Mon May 5 14:35:09 PDT 2003


[ Not for -questions ]

On May 05, Alex Teslik wrote:
> [...]
> and no response when I actually press a button.
> 
> Is there another way to test or calibrate joysticks in FreeBSD?
> Out of ideas. Any help much appreciated.

	Hello Alex,
	Feel brave?  Try this untested patch, it's against 4.8-rc1 I
think.  I don't have a soundblaster so it's really just a wild guess.

	Uh, use modules. and edit /usr/src/sys/modules/joy/Makefile as
-SRCS    = bus_if.h device_if.h isa_if.h joy.c
+SRCS    = bus_if.h device_if.h isa_if.h pci_if.h joy.c

	Cheers,
	--Mat

-- 
Brain: Are you pondering what I'm pondering?
Pinky: I think so, Brain, but me and Pippi Longstocking... I mean,
what would the children look like?
-------------- next part --------------
--- joy.c.old	Mon May  5 09:14:16 2003
+++ joy.c	Mon May  5 09:26:55 2003
@@ -44,6 +44,9 @@
 #include <isa/isavar.h>
 #include "isa_if.h"
 
+#include <pci/pcireg.h>
+#include <pci/pcivar.h>
+#include "pci_if.h"
 /* The game port can manage 4 buttons and 4 variable resistors (usually 2
  * joysticks, each with 2 buttons and 2 pots.) via the port at address 0x201.
  * Getting the state of the buttons is done by reading the game port:
@@ -70,7 +73,7 @@
 #define JOY_SOFTC(unit) (struct joy_softc *) \
         devclass_get_softc(joy_devclass,(unit))
 
-static int joy_probe (device_t);
+static int joy_isa_probe (device_t);
 static int joy_attach (device_t);
 
 #define CDEV_MAJOR 51
@@ -111,7 +114,7 @@
 };
 
 static int
-joy_probe (device_t dev)
+joy_isa_probe (device_t dev)
 {
     if (ISA_PNP_PROBE(device_get_parent(dev), dev, joy_ids) == ENXIO)
         return ENXIO;
@@ -144,19 +147,52 @@
     return 0;
 }
 
-static device_method_t joy_methods[] = {
-    DEVMETHOD(device_probe,	joy_probe),
+static device_method_t joy_isa_methods[] = {
+    DEVMETHOD(device_probe,	joy_isa_probe),
     DEVMETHOD(device_attach,	joy_attach),
     { 0, 0 }
 };
 
 static driver_t joy_isa_driver = {
     "joy",
-    joy_methods,
+    joy_isa_methods,
     sizeof (struct joy_softc)
 };
 
 DRIVER_MODULE(joy, isa, joy_isa_driver, joy_devclass, 0, 0);
+
+static int
+joy_pci_probe(device_t dev)
+{
+	char *s = NULL;
+
+	switch (pci_get_devid(dev)) {
+	    case 0x70021102:
+		s = "Creative EMU10K1 Joystick";
+		device_quiet(dev);
+		break;
+	    case 0x70031102:
+		s = "Creative EMU10K2 Joystick";
+		device_quiet(dev);
+		break;
+	}
+	if (s) device_set_desc(dev, s);
+	    return s ? 0 : ENXIO;
+}
+
+static device_method_t joy_pci_methods[] = {
+    DEVMETHOD(device_probe, joy_pci_probe),
+    DEVMETHOD(device_attach, joy_attach),
+    { 0, 0 }
+};
+
+static driver_t joy_pci_driver = {
+	"joy",
+	joy_pci_methods,
+	sizeof (struct joy_softc)
+};
+
+DRIVER_MODULE(joy, pci, joy_pci_driver, joy_devclass, 0, 0);
 
 static int
 joyopen(dev_t dev, int flags, int fmt, struct proc *p)


More information about the freebsd-multimedia mailing list