>Number:         105669
>Category:       usb
>Synopsis:       [patch] MetaGeek Wi-Spy device recognized as keyboard
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-usb
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Sun Nov 19 16:40:21 GMT 2006
>Closed-Date:
>Last-Modified:
>Originator:     Henrik Brix Andersen
>Release:        FreeBSD 6.2-PRERELEASE i386
>Organization:
pil.dk
>Environment:
System: FreeBSD fangorn.brixandersen.dk 6.2-PRERELEASE FreeBSD 6.2-PRERELEASE 
#25: Sun Nov 19 16:47:54 CET 2006 [EMAIL 
PROTECTED]:/usr/obj/usr/src/sys/FANGORN i386


        
>Description:

The USB Wi-Spy spectrum analyzer from MetaGeek LLC [1] is currently
recognized by FreeBSD as a USB keyboard, thus preventing the
user-space tools [2] from attaching to the device using ugen(4) and
libusb.

[1] http://www.metageek.net/
[2] http://www.kismetwireless.net/wispy.shtml

        
>How-To-Repeat:

Plug in a MetaGeek LLC Wi-Spy device and notice the following entries in
dmesg:

Nov 19 16:37:23 fangorn kernel: ukbd0: MetaGeek Wi-Spy, rev 2.00/1.00, addr 2, 
iclass 3/1
Nov 19 16:37:23 fangorn kernel: kbd2 at ukbd0

        
>Fix:

The patch below adds a UQ_KBD_IGNORE flag to usb_quirks.h, similar to
the UQ_HID_IGNORE flag.

The patch also adds the PID of the Wi-Spy device and utilizes the new
UQ_KBD_IGNORE flag to make ukbd(4) ignore this device, leaving it to
be handled by ugen(4):

Nov 19 17:04:28 fangorn kernel: ugen0: MetaGeek Wi-Spy, rev 2.00/1.00, addr 2

It would be nice if __FreeBSD_version in sys/param.h could be bumped
once this patch goes in. This will allow me to test for proper kernel
support in my upcoming port of the above mentioned wispy-tools.

The patch is againt RELENG_6 but applies cleanly to CURRENT.
        

--- wispy-ukbd-ignore.patch begins here ---
--- dev/usb/usbdevs.orig        Tue Jul 18 11:01:11 2006
+++ dev/usb/usbdevs     Tue Jul 18 11:02:10 2006
@@ -795,6 +795,7 @@
 /* Cypress Semiconductor products */
 product CYPRESS MOUSE          0x0001  mouse
 product CYPRESS THERMO         0x0002  thermometer
+product CYPRESS WISPY          0x0bad  MetaGeek Wi-Spy
 product CYPRESS FMRADIO                0x1002  FM Radio
 product CYPRESS SLIM_HUB       0x6560  Slim Hub
 
--- dev/usb/usb_quirks.h.orig   Tue Jul 18 11:02:52 2006
+++ dev/usb/usb_quirks.h        Tue Jul 18 11:03:56 2006
@@ -55,6 +55,7 @@
 #define UQ_ASSUME_CM_OVER_DATA 0x1000 /* modem device breaks on cm over data */
 #define UQ_BROKEN_BIDIR        0x2000  /* printer has broken bidir mode */
 #define UQ_HID_IGNORE  0x8000  /* device should be ignored by hid class */
+#define UQ_KBD_IGNORE  0x8001  /* device should be ignored by kbd class */
                                        
 };
 
--- dev/usb/usb_quirks.c.orig   Tue Jul 18 11:02:56 2006
+++ dev/usb/usb_quirks.c        Tue Jul 18 11:04:58 2006
@@ -110,6 +110,9 @@
        ANY, { UQ_HID_IGNORE }},
  { USB_VENDOR_MGE, USB_PRODUCT_MGE_UPS2,
        ANY, { UQ_HID_IGNORE }},
+ /* Devices which should be ignored by ukbd */
+ { USB_VENDOR_CYPRESS, USB_PRODUCT_CYPRESS_WISPY,
+       ANY, { UQ_KBD_IGNORE }},
  { 0, 0, 0, { 0 } }
 };
 
--- dev/usb/ukbd.c.orig Tue Jul 18 11:05:24 2006
+++ dev/usb/ukbd.c      Tue Jul 18 11:07:25 2006
@@ -150,6 +150,9 @@
        if ((*sw->probe)(unit, (void *)arg, 0))
                return (UMATCH_NONE);
 
+       if (usbd_get_quirks(uaa->device)->uq_flags & UQ_KBD_IGNORE)
+               return (UMATCH_NONE);
+
        return (UMATCH_IFACECLASS_IFACESUBCLASS_IFACEPROTO);
 }
 
--- wispy-ukbd-ignore.patch ends here ---


>Release-Note:
>Audit-Trail:
>Unformatted:
_______________________________________________
freebsd-usb@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-usb
To unsubscribe, send any mail to "[EMAIL PROTECTED]"

Reply via email to