From owner-freebsd-multimedia@FreeBSD.ORG Mon May 5 14:35:09 2003 Return-Path: Delivered-To: freebsd-multimedia@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 746D137B401 for ; Mon, 5 May 2003 14:35:09 -0700 (PDT) Received: from hak.cnd.mcgill.ca (hak.cnd.mcgill.ca [132.216.11.133]) by mx1.FreeBSD.org (Postfix) with ESMTP id B179F43FA3 for ; Mon, 5 May 2003 14:35:08 -0700 (PDT) (envelope-from mat@hak.cnd.mcgill.ca) Received: from hak.cnd.mcgill.ca (localhost.cnd.mcgill.ca [127.0.0.1]) by hak.cnd.mcgill.ca (8.12.3p2/8.12.3) with ESMTP id h45Lbf6d044104; Mon, 5 May 2003 17:37:41 -0400 (EDT) (envelope-from mat@hak.cnd.mcgill.ca) Received: (from mat@localhost) by hak.cnd.mcgill.ca (8.12.3p2/8.12.3/Submit) id h45Lbflg044103; Mon, 5 May 2003 17:37:41 -0400 (EDT) Date: Mon, 5 May 2003 17:37:40 -0400 From: Mathew Kanner To: Alex Teslik Message-ID: <20030505213740.GF31681@cnd.mcgill.ca> References: <20030505070220.M38996@acatysmoof.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="jI8keyz6grp/JLjh" Content-Disposition: inline In-Reply-To: <20030505070220.M38996@acatysmoof.com> Organization: I speak for myself, operating in Montreal, CANADA User-Agent: Mutt/1.5.3i X-Spam-Status: No, hits=-38.5 required=5.0 tests=EMAIL_ATTRIBUTION,IN_REP_TO,PATCH_UNIFIED_DIFF, QUOTED_EMAIL_TEXT,REFERENCES,REPLY_WITH_QUOTES, USER_AGENT_MUTT version=2.53 X-Spam-Checker-Version: SpamAssassin 2.53 (1.174.2.15-2003-03-30-exp) cc: list-freebsd-multimedia Subject: Re: Logitech Wingman Attack joystick X-BeenThere: freebsd-multimedia@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Multimedia discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 May 2003 21:35:09 -0000 --jI8keyz6grp/JLjh Content-Type: text/plain; charset=us-ascii Content-Disposition: inline [ 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? --jI8keyz6grp/JLjh Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="48_sys_isa_joy.c.patch" --- joy.c.old Mon May 5 09:14:16 2003 +++ joy.c Mon May 5 09:26:55 2003 @@ -44,6 +44,9 @@ #include #include "isa_if.h" +#include +#include +#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) --jI8keyz6grp/JLjh--