From owner-freebsd-usb@FreeBSD.ORG Sun Apr 13 10:00:03 2008 Return-Path: Delivered-To: freebsd-usb@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 757C51065677 for ; Sun, 13 Apr 2008 10:00:03 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 4EEE68FC26 for ; Sun, 13 Apr 2008 10:00:03 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.2/8.14.2) with ESMTP id m3DA03EY029487 for ; Sun, 13 Apr 2008 10:00:03 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.2/8.14.1/Submit) id m3DA03Sw029486; Sun, 13 Apr 2008 10:00:03 GMT (envelope-from gnats) Resent-Date: Sun, 13 Apr 2008 10:00:03 GMT Resent-Message-Id: <200804131000.m3DA03Sw029486@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-usb@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Dmitry Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A234A106564A for ; Sun, 13 Apr 2008 09:54:27 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21]) by mx1.freebsd.org (Postfix) with ESMTP id 8CE118FC0C for ; Sun, 13 Apr 2008 09:54:27 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.14.2/8.14.2) with ESMTP id m3D9sMmn011842 for ; Sun, 13 Apr 2008 09:54:22 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.14.2/8.14.1/Submit) id m3D9sMOh011840; Sun, 13 Apr 2008 09:54:22 GMT (envelope-from nobody) Message-Id: <200804130954.m3D9sMOh011840@www.freebsd.org> Date: Sun, 13 Apr 2008 09:54:22 GMT From: Dmitry To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: usb/122712: Sony Vaio RF keyboard/mouse receiver works incorrectly X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Apr 2008 10:00:03 -0000 >Number: 122712 >Category: usb >Synopsis: Sony Vaio RF keyboard/mouse receiver works incorrectly >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-usb >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sun Apr 13 10:00:02 UTC 2008 >Closed-Date: >Last-Modified: >Originator: Dmitry >Release: FreeBSD 7.0 >Organization: home >Environment: FreeBSD kb 7.0-STABLE FreeBSD 7.0-STABLE #0: Sun Apr 13 13:02:23 MSD 2008 root@kb:/var/tmp/obj/usr/src/sys/KB i386 >Description: Wireless Mouse device of Sony VGP-WRC1 mouse/keyboard receiver has the same program interface as Microsoft Wireless Notebook Optical Mouse. >How-To-Repeat: >Fix: Patch attached with submission follows: --- src/sys/dev/usb/usbdevs.orig 2008-04-13 11:13:11.000000000 +0400 +++ src/sys/dev/usb/usbdevs 2008-04-13 11:17:06.000000000 +0400 @@ -2123,6 +2123,7 @@ product SONY CLIE_NX60 0x00da Sony Clie nx60 product SONY CLIE_TH55 0x0144 Sony Clie th55 product SONY CLIE_TJ37 0x0169 Sony Clie tj37 +product SONY RF_RECEIVER 0x01db Sony RF mouse/kbd Receiver VGP-WRC1 /* Sony Ericsson products */ product SONYERICSSON DCU10 0x0528 USB Cable --- src/sys/dev/usb/usb_quirks.c.orig 2008-04-13 11:17:26.000000000 +0400 +++ src/sys/dev/usb/usb_quirks.c 2008-04-13 11:59:46.000000000 +0400 @@ -90,6 +90,7 @@ ANY, { UQ_MS_BAD_CLASS | UQ_MS_LEADING_BYTE }}, { USB_VENDOR_MICROSOFT, USB_PRODUCT_MICROSOFT_WLINTELLIMOUSE, ANY, { UQ_MS_LEADING_BYTE }}, + { USB_VENDOR_SONY, USB_PRODUCT_SONY_RF_RECEIVER, ANY, { UQ_MS_BAD_CLASS }}, /* Devices which should be ignored by uhid */ { USB_VENDOR_APC, USB_PRODUCT_APC_UPS, >Release-Note: >Audit-Trail: >Unformatted: From owner-freebsd-usb@FreeBSD.ORG Mon Apr 14 04:22:45 2008 Return-Path: Delivered-To: freebsd-usb@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1C078106566B; Mon, 14 Apr 2008 04:22:45 +0000 (UTC) (envelope-from linimon@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id E890E8FC22; Mon, 14 Apr 2008 04:22:44 +0000 (UTC) (envelope-from linimon@FreeBSD.org) Received: from freefall.freebsd.org (linimon@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.2/8.14.2) with ESMTP id m3E4MihJ022932; Mon, 14 Apr 2008 04:22:44 GMT (envelope-from linimon@freefall.freebsd.org) Received: (from linimon@localhost) by freefall.freebsd.org (8.14.2/8.14.1/Submit) id m3E4MiQe022928; Mon, 14 Apr 2008 04:22:44 GMT (envelope-from linimon) Date: Mon, 14 Apr 2008 04:22:44 GMT Message-Id: <200804140422.m3E4MiQe022928@freefall.freebsd.org> To: romerogordon@telefonica.net, linimon@FreeBSD.org, freebsd-usb@FreeBSD.org From: linimon@FreeBSD.org Cc: Subject: Re: usb/122621: [patch] [request] New driver for Sierra Wireless 3G USM modem 875U X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Apr 2008 04:22:45 -0000 Old Synopsis: New driver for Sierra Wireless 3G USM modem 875U New Synopsis: [patch] [request] New driver for Sierra Wireless 3G USM modem 875U State-Changed-From-To: open->feedback State-Changed-By: linimon State-Changed-When: Mon Apr 14 04:21:58 UTC 2008 State-Changed-Why: Note that feedback was requested. http://www.freebsd.org/cgi/query-pr.cgi?pr=122621 From owner-freebsd-usb@FreeBSD.ORG Mon Apr 14 11:06:58 2008 Return-Path: Delivered-To: freebsd-usb@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6D1E91065673 for ; Mon, 14 Apr 2008 11:06:58 +0000 (UTC) (envelope-from owner-bugmaster@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 5C3A78FC18 for ; Mon, 14 Apr 2008 11:06:58 +0000 (UTC) (envelope-from owner-bugmaster@FreeBSD.org) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.2/8.14.2) with ESMTP id m3EB6wUX072408 for ; Mon, 14 Apr 2008 11:06:58 GMT (envelope-from owner-bugmaster@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.2/8.14.1/Submit) id m3EB6vlQ072404 for freebsd-usb@FreeBSD.org; Mon, 14 Apr 2008 11:06:57 GMT (envelope-from owner-bugmaster@FreeBSD.org) Date: Mon, 14 Apr 2008 11:06:57 GMT Message-Id: <200804141106.m3EB6vlQ072404@freefall.freebsd.org> X-Authentication-Warning: freefall.freebsd.org: gnats set sender to owner-bugmaster@FreeBSD.org using -f From: FreeBSD bugmaster To: freebsd-usb@FreeBSD.org Cc: Subject: Current problem reports assigned to freebsd-usb@FreeBSD.org X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Apr 2008 11:06:58 -0000 Current FreeBSD problem reports Critical problems S Tracker Resp. Description -------------------------------------------------------------------------------- o usb/84750 usb [hang] 6-BETA2 reboot/shutdown with root_fs on externa o usb/91629 usb usbd_abort_pipe() may result in infinite loop 2 problems total. Serious problems S Tracker Resp. Description -------------------------------------------------------------------------------- o i386/46371 usb USB controller cannot be initialized on IBM Netfinity o bin/57255 usb usbd and multi-function devices o usb/63621 usb [umass] [panic] USB MemoryStick Reader stalls/crashes o usb/69006 usb [usbdevs] [patch] Apple Cinema Display hangs USB ports o usb/71155 usb [ulpt] misbehaving usb-printer hangs processes, causes o usb/73307 usb [panic] Kernel panics on USB disconnect o usb/74771 usb [umass] [hang] mounting write-protected umass device a o usb/75705 usb [umass] [panic] da0 attach / Optio S4 (with backtrace) o usb/75797 usb [pcm] 5.3-STABLE(2005 1/4) detect USB headset, But can o usb/76395 usb [uhci] USB printer does not work, usbdevs says "addr 0 o usb/77184 usb [umass] [panic] kernel panic on USB device disconnect, o usb/77294 usb [ulpcom] [panic] ucom + ulpcom panic o usb/79269 usb [ohci] USB ohci da0 plug/unplug causes crashes and loc o usb/79287 usb [uhci] [hang] UHCI hang after interrupt transfer o usb/79524 usb [ulpt] printing to Minolta PagePro 1[23]xxW via USB fa a usb/79656 usb [ehci] RHSC interrupts lost o usb/79722 usb [ehci] wrong alignments in ehci.h o usb/80040 usb [hang] Use of sound mixer causes system freeze with ua o usb/80361 usb [umass] [patch] mounting of Dell usb-stick fails o usb/80829 usb [modules] [panic] possible panic when loading USB-modu o usb/80862 usb [patch] USB locking issues: missing some Giant calls o usb/82350 usb [ucom] [panic] null pointer dereference in USB stack o usb/82520 usb [udbp] [reboot] Reboot when USL101 connected s usb/82569 usb [umass] [panic] USB mass storage plug/unplug causes sy o usb/82660 usb [echi] [panic] EHCI: I/O stuck in state 'physrd'/panic o usb/83563 usb [umass] [panic] Page Fault while detaching Mpman Usb d o usb/83677 usb [usb] [request] usb controller often not detected (Sun o usb/83756 usb [ums] [patch] Microsoft Intellimouse Explorer 4.0A doe o usb/83977 usb [ucom] [panic] ucom1: open bulk out error (addr 2): IN o usb/84326 usb [umass] Panic trying to connect SCSI tape drive via US s usb/84336 usb [usb] [reboot] instant system reboot when unmounting a o usb/86767 usb [umass] [patch] bogus "slice starts beyond end of the o usb/88743 usb [hang] USB makes kernel hang at boot (regression in 6. p usb/88966 usb [modules] kldunload ucom.ko returns "Device busy" erro s usb/89003 usb [request] LaCie Firewire drive not properly supported o usb/89954 usb [umass] [panic] USB Disk driver race condition? o usb/90700 usb [umass] [panic] Kernel panic on connect/mount/use umas o usb/91238 usb [umass] USB tape unit fails to write a second tape fil o usb/91283 usb [boot] booting very slow with usb devices connection ( o usb/91538 usb [ulpt] [patch] Unable to print to EPSON CX3500 o usb/91906 usb [ehci] [hang] FreeBSD hangs while booting with USB leg o usb/92052 usb [unlpt] usbd causes defunct process with busy file-han o usb/92083 usb [ural] [panic] panic using WPA on ural NIC in 6.0-RELE o usb/92142 usb [uhub] SET_ADDR_FAILED and SHORT_XFER errors from usb o usb/92171 usb [panic] panic unplugging Vodafone Mobile Connect (UMTS o usb/93155 usb [ulpt] /dev/ulpt0: device busy, USB printer does not w o usb/93408 usb [mouse] hw.acpi.cpu.cx_lowest=C3 on AMD Turion causes o usb/93640 usb [echi] [irq] device ehci causes interrupt storm on thi o usb/93828 usb [ochi] [panic] ohci causes panic on boot (HP Pavillion o usb/94166 usb [umass] [boot] btx halted with a flashcard plugged o usb/94384 usb [panic] kernel panic with usb2 hardware o usb/94717 usb [ulpt] Reading from /dev/ulpt can break work of a UHCI o usb/94813 usb [umass] mounting write-protected umass device freezes o usb/94897 usb [panic] Kernel Panic when cleanly unmounting USB disk s usb/95348 usb [kbd] USB keyboard unplug causes noise on screen o usb/95562 usb [umass] Write Stress in USB Mass drive causes "vinvalb s usb/95636 usb [umass] [boot] 5 minute delay at boot when using VT620 s usb/96120 usb [ums] [request] USB mouse not always detected o usb/96224 usb [usb] [msdosfs] mount_msdosfs cause page fault in sync o usb/96457 usb [umass] [panic] fatback on umass = reboot s usb/97286 usb [mouse] [request] MS Wireless Intellimouse Explorer 2. o usb/99431 usb [kbd] FreeBSD on MSI 6566E (Intel 845E motherboards) d o usb/101096 usb [if_ural] [panic] USB WLAN occasionally causes kernel- o usb/101448 usb [ohci] FBSD 6.1-STABLE/AMD64 crashes under heavy USB/O o usb/101752 usb [umass] [panic] 6.1-RELEASE kernel panic on usb device o usb/102066 usb [ukbd] usb keyboard and multimedia keys don't work f usb/102096 usb [patch] usbd(8) does not handle multiple devices in on o usb/103025 usb [uhub] [panic] wrong detection of USB device for FreeB o usb/104292 usb [umass] [hang] system lockup on forced umount of usb-s o usb/104830 usb [umass] system crashes when copying data to umass devi o usb/105186 usb [ehci] [panic] USB 2.0/ehci on FreeBSD 6.2-PRE/AMD64 c o usb/106615 usb [uftdi] uftdi module does not automatically load with o usb/106648 usb [umass] [hang] USB Floppy on D1950 10 min Hang on Inse s usb/106832 usb USB HP printer is not detected by kernel when ACPI ena o usb/107248 usb [umass] [patch] scsi_da.c quirk for Cowon iAUDIO X5 MP o usb/107446 usb [umass] umass problems (usb and fw disks) o usb/107827 usb [ohci] [panic] ohci_add_done addr not found o usb/107848 usb [umass] [request] cannot access Samsung flash disk o usb/107924 usb [patch] usbd(8) does not call detach o usb/108513 usb [umass] Creative MuVo TX FM fails in 6.2-RELEASE (regr o usb/109274 usb [usb] MCP55 USB Controller fails to attach in AMD64 Cu o usb/109397 usb [panic] on boot from USB flash o usb/110856 usb [ugen] [patch] interrupt in msgs are truncated when bu o usb/110988 usb [umass] [patch] Handling of quirk IGNORE_RESIDUE is um o usb/111753 usb [uhid] [panic] Replicable system panic involving UHID s usb/112568 usb [umass] [request] USB mode may wrong when mounting Pla o usb/112631 usb [panic] Problem with SONY DSC-S80 camera on umount o usb/112640 usb [usb] [hang] Kernel freezes when writing a file to an o usb/113478 usb [boot] [request] FreeBSD could not start on Core2Duo n s usb/113629 usb [ukbd] Dropped USB keyboard events on Dell Latitude D6 o usb/113672 usb [ehci] [panic] Kernel panic with AEWIN CB6971 o usb/113851 usb [boot] Unable to boot install cd from USB-CDROM s usb/113977 usb [request] Need a way to set mode of USB disk's write c o usb/114310 usb [libusb] [patch] [panic] USB hub attachment panics ker o usb/114682 usb [umass] generic USB media-card reader unusable o kern/114780 usb [uplcom] [panic] Panics while stress testing the uplco o usb/115298 usb [ulpt] [panic] Turning off USB printer panics kernel o usb/116561 usb [umodem] [panic] RELENG_6 umodem panic "trying to slee o usb/116699 usb [usbhid] USB HID devices do not initialize at system b o usb/116947 usb [ukbd] [patch] enable boot protocol on the USB keyboar o usb/117200 usb [ugen] ugen0 prints strange string on attach if detach o usb/117313 usb [umass] [panic] panic on usb camera insertion o usb/117613 usb [uhci] [irq] uhci interrupt storm & USB leaked memory o usb/117946 usb [panic] D-Link DUB-E100 rev. B1 crashes FreeBSD 7.0-BE o usb/117955 usb [umass] [panic] inserting minolta dimage a2 crashes OS o usb/118140 usb [ucom] [patch] quick hack for ucom to get it behave wi o usb/118141 usb [ucom] usb serial and nokia phones ucomreadcb ucomread o usb/118353 usb [panic] [ppp] repeatable kernel panic during ppp(4) se o usb/118391 usb [usbdevs] [patch] Add uscanner ID for Epson CX4800 o usb/118480 usb [umass] Timeout in USB mass storage freezes vfs layer o usb/119018 usb [usbd] HP ScanJet 4300C found as knowndev but not reco o usb/119201 usb [cam] [patch] Quirks for Olympus FE-210 camera, LG and o usb/119481 usb [hang] FreeBSD not responding after connecting USB-Mas o usb/119509 usb USB flaky on Dell Optiplex 755 o usb/119513 usb [irq] inserting dlink dwl-g630 wireless card results i o usb/119977 usb [ums] Mouse does not work in a Cherry-USB keyboard/mou o usb/120017 usb [ehci] [patch] CS5536 (AMD Geode) USB 2.0 quirk o usb/120034 usb [hang] 6.2 & 6.3 hangs on boot at usb0: OHCI with 1.5 o usb/120283 usb [panic] Automation reboot with wireless keyboard & mou o usb/120321 usb [hang] System hangs when transferring data to WD MyBoo o usb/120729 usb [panic] fault while in kernel mode with connecting USB o usb/120786 usb Kernelpanik when forced umount of a dettached USB Hard f usb/120873 usb [zyd] [panic] if_zyd and if_rum panic in usb_transfer_ o usb/121232 usb remove PCCARD rebooted system o usb/121275 usb [boot] FreeBSD fails to boot with usb legacy support e o usb/121474 usb [cam] [patch] QUIRK: SAMSUNG HM250JI in LaCie usb hard o usb/121708 usb [kbd] nforce 650i mobo w/ usb keyboard infinite key re o usb/121734 usb [ugen] ugen HP1022 printer device not working since up o usb/121755 usb [ohci] [patch] Fix panic after ohci/uhub cardbus devic o usb/121861 usb [kbd] Don't work Fn keys on USB Microsoft Natural Ergo o usb/122483 usb [panic] [ulpt] Repeatable panic in 7.0-STABLE o usb/122539 usb [ohci] [panic] AnyDATA ADU-E1000D - kernel panic: ohci 132 problems total. Non-critical problems S Tracker Resp. Description -------------------------------------------------------------------------------- o conf/30929 usb [usb] [patch] use usbd to initialize USB ADSL modem o usb/40948 usb [umass] [request] USB HP CDW8200 does not work o usb/48342 usb [usbd] [patch] usbd dynamic device list. s usb/51958 usb [urio] [patch] update for urio driver s usb/52026 usb [usb] [request] umass driver support for InSystem ISD2 o usb/59698 usb [kbd] [patch] Rework of ukbd HID to AT code translatio s usb/62257 usb [umass] [request] card reader UCR-61S2B is only half-s o usb/66547 usb [ucom] Palm Tungsten T USB does not initialize correct o usb/68232 usb [ugen] [patch] ugen(4) isochronous handling correction o usb/70523 usb [umct] [patch] umct sending/receiving wrong characters o usb/71280 usb [aue] aue0 device (linksys usb100tx) doesn't work in 1 o usb/71416 usb [ugen] Cryptoflex e-gate USB token (ugen0) detach is n o usb/71417 usb [ugen] Cryptoflex e-gate USB token (ugen0) communicati o usb/71455 usb [umass] Slow USB umass performance of 5.3 s usb/72733 usb [ucom] [request] Kyocera 7135 Palm OS connection probl o usb/74211 usb [umass] USB flash drive causes CAM status 0x4 on 4.10R a usb/74453 usb [umass] [patch] Q-lity CD-RW USB ECW-043 (ScanLogic SL o usb/75764 usb [umass] [patch] "umass0: Phase Error" - no device for o usb/75800 usb [ucom] ucom1: init failed STALLED error in time of syn s usb/75928 usb [umass] [request] Cytronix SmartMedia card (SMC) reade o usb/76461 usb [umass] disklabel of umass(4)-CAM(4)-da(4) not used by o usb/76653 usb [umass] [patch] Problem with Asahi Optical usb device o usb/76732 usb Mouse problems with USB KVM Switch o usb/78984 usb [umass] [patch] Creative MUVO umass failure o usb/79723 usb [usb] [request] prepare for high speed isochronous tra o usb/80774 usb [patch] have "usbd_find_desc" in line with the other " s usb/80776 usb [udav] [request] UDAV device driver shouldn't use usb_ s usb/80777 usb [request] usb_rem_task() should wait for callback to c o usb/80854 usb [patch] [request] suggestion for new iface-no-probe me o usb/80935 usb [uvisor] [patch] uvisor.c is not work with CLIE TH55. f usb/81621 usb [ehci] [hang] external hd hangs under load on ehci o usb/83863 usb [ugen] Communication problem between opensc/openct via s usb/85067 usb [uscanner] Cannot attach ScanJet 4300C to usb device o usb/85257 usb [boot] BTX boot loader fails on USB CDROM (HP DL145 Op o usb/86298 usb [mouse] Known good USB mouse won't work with correct s o usb/87224 usb Cannot mount USB Zip750 o usb/87648 usb [mouse] Logitech USB-optical mouse problem. o usb/88408 usb [axe] axe0 read PHY failed o usb/91546 usb [umodem] [patch] Nokia 6630 mobile phone does not work o usb/91811 usb [umass] Compact Flash in HP Photosmart 2610 return " o usb/91896 usb [camcontrol] Serial Number of USB Memory Sticks is not o usb/92852 usb [ums] [patch] Vertical scroll not working properly on o usb/93389 usb [umass] [patch] Digital Camera Pentax S60 don't work o usb/93872 usb [cam] [patch] SCSI quirk required for ELTA 8061 OL USB o usb/95037 usb [umass] USB disk not recognized on hot-plug. o usb/96381 usb [cam] [patch] add a quirk table entry for a flash ram o usb/97175 usb [umass] [hang] USB cardreader hangs system o usb/97472 usb [cam] [patch] add support for Olympus C150,D390 o usb/98343 usb [boot] BBB reset failed errors with Creative Muvo MP3 o usb/99538 usb [kbd] while using USB keyboard default params of atkbd o usb/100746 usb [kbd] system does not boot due to USB keyboard problem o usb/101761 usb [usb] [patch] [request] usb.h: increase maximal size o o usb/101775 usb [libusbhid] [patch] possible error in report descripto o usb/102678 usb [kbd] Dell PowerEdge DRAC5 USB Keyboard does not work o usb/102976 usb [panic] Casio Exilim Digital Camera causes panic on in o usb/103046 usb [ulpt] [patch] ulpt event driven I/O with select(2) an o usb/103289 usb [request] USB 2.0 problems on AMD LX-800 CPU and CS-55 o usb/103418 usb [usbhidctl] [patch] [request] usbhidctl: add ability t o usb/103917 usb [uhub] USB driver reports "Addr 0 should never happen" o usb/104290 usb [umass] [patch] quirk: TOSHIBA DVD-RAM drive (libretto o usb/104352 usb [ural] [patch] ural driver doesnt work o usb/104645 usb [umass] [request] Rave C-201 MP3 player does not commu o usb/105065 usb [sata] SATA - USB Bridge o usb/105361 usb [panic] Kernel panic during unmounting mass storage (C o usb/106041 usb [usb] [request] FreeBSD does not recognise Mustek Bear o usb/106621 usb [axe] [patch] DLINK DUB-E100 support broken o usb/106861 usb [usbdevs] [patch]: usbdevs update: Add product ACER Ze o usb/107243 usb [cam] [patch] Apacer USB Flash Drive quirk o usb/107388 usb [patch] [request] new driver: add utoppy device from N o usb/107496 usb [uhub] USB device problem on RELENG_6_2 (SHORT_XFER) ( o usb/107665 usb [usbdevs] [patch] uscanner support for epson stylus DX s usb/107701 usb [usbd] [request] usbd ignores "detach" o usb/107935 usb [uplcom] [panic] panic while accessing /dev/cuaU0 o usb/108056 usb [ohci] Mouse gets powered off during device probe when s usb/108344 usb [panic] kernel with atausb panics when unplugging USB o usb/110197 usb [umass] Sony PSP umass device does not detach from EHC s usb/110991 usb [usbdevs] [patch] QUIRK: Super Top IDE DEVICE (depends o usb/112461 usb [ehci] [request] ehci USB 2.0 doesn't work on nforce4 o usb/112463 usb [umass] problem with Samsung USB DVD writer, libscg an o usb/112944 usb [ulpt] [patch] Bi-directional access to HP LaserJet 10 o usb/113060 usb [usbdevs] [patch] Samsung printer not working in bidir o usb/113432 usb [ucom] WARNING: attempt to net_add_domain(netgraph) af o conf/114013 usb [patch] WITHOUT_USB allow to compil a lot of USB stuff o usb/114068 usb [umass] [patch] Problems with connection of the umass o usb/114916 usb [umass] [patch] USB Maxtor drive (L300RO) requires qui o usb/115080 usb [usbdevs] [patch] allow using a Hercules HWGUSB2-54-V2 o usb/115400 usb [ehci] Problem with EHCI on ASUS M2N4-SLI o usb/115933 usb [uftdi] [patch] RATOC REX-USB60F (usb serial converter o usb/115935 usb [usbdevs] [patch] kernel counterproductively attaches o usb/116282 usb [ulpt] Cannot print on USB HP LJ1018 or LJ1300 f usb/116898 usb [panic] sleeping thread while using USB hard drive to o usb/117075 usb [scsi_da] [patch] quirk: USB Samsung YP-U3 MP3 o usb/117183 usb [panic] USB/fusefs -- panic while transferring large a o usb/117185 usb [umodem] [patch] Add support for UNION interface descr o usb/117205 usb [uscanner] [patch] uscanner support for HP ScanJet 447 o usb/117546 usb [usbdevs] [patch] Add MaxStream ZigBee product ID to u o usb/117598 usb [uaudio] [patch] Not possible to record with Plantroni o usb/117893 usb [umass] Lacie USB DVD writing failing o usb/117911 usb [ums] [request] Mouse Gembird MUSWC not work o usb/117938 usb [ums] [patch] Adding support for MS WL Natural and MS o usb/118098 usb [umass] 6th gen iPod causes problems when disconnectin o usb/118374 usb [usbdevs] [patch] support Option GlobeTrotter Max 3.6 o usb/118479 usb [ubsa] [patch] ubsa driver does not recognize AnyDATA o usb/118485 usb [usbdevs] [patch] Logitech Headset Workaround s usb/118571 usb [boot] [request] fix BTX issues when booting FreeBSD 7 o usb/118686 usb [usbdevs] [patch] teach usbdevs / ubsa(4) about Huawei o usb/118741 usb [umass] [patch] Support for Nikon D300 digital camera o usb/119150 usb [usbdevs] [patch] new usbdevs for CDMA 1xEVDO devices o usb/119227 usb [ubsa] [patch] ubsa buffer is too small; should be tun o usb/119389 usb [umass] Sony DSC-W1 CBI reset failed, STALLED (regress o usb/119633 usb [umass] umass0: BBB reset failed, IOERROR (regression) o usb/119653 usb [cam] [patch] iriver s7 player sync cache error patch o usb/119981 usb [usbdevs] [patch] add support for LOGITEC LAN-GTJ/U2 g o usb/120572 usb [umass] [patch] quirk to support ASUS P535 as umass (a f usb/120859 usb laserjet1000 PR#99460 how to install the patch? o usb/121045 usb [uftdi] [patch] Add support for PC-OP-RS1 and KURO-RS o usb/121052 usb [ums] Microsoft Notebook Optical Mouse 3000 (model 104 o usb/121169 usb Issues with usb mp3 player o usb/121184 usb [uipaq] [patch] add ids from linux ipaq driver (plus a o usb/121426 usb [patch] [uscanner] add HP ScanJet 3570C o usb/122025 usb [patch] uscanner does not attach to Epson RX620 printe o usb/122119 usb [umass] umass device causes creation of daX but not da o usb/122547 usb [ehci] USB Printer not being recognized after reboot p usb/122610 usb Add Verizon v740 support to ubsa(4) f usb/122621 usb [patch] [request] New driver for Sierra Wireless 3G US o usb/122712 usb [usbdevs] [patch] Sony Vaio RF keyboard/mouse receiver 126 problems total. From owner-freebsd-usb@FreeBSD.ORG Tue Apr 15 02:40:04 2008 Return-Path: Delivered-To: freebsd-usb@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C12D6106564A for ; Tue, 15 Apr 2008 02:40:04 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id AABAB8FC19 for ; Tue, 15 Apr 2008 02:40:04 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.2/8.14.2) with ESMTP id m3F2e4qu064893 for ; Tue, 15 Apr 2008 02:40:04 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.2/8.14.1/Submit) id m3F2e4ro064892; Tue, 15 Apr 2008 02:40:04 GMT (envelope-from gnats) Date: Tue, 15 Apr 2008 02:40:04 GMT Message-Id: <200804150240.m3F2e4ro064892@freefall.freebsd.org> To: freebsd-usb@FreeBSD.org From: "Tim Smith" Cc: Subject: Re: usb/121708: [kbd] nforce 650i mobo w/ usb keyboard infinite key repeat hang (regression) X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Tim Smith List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Apr 2008 02:40:04 -0000 The following reply was made to PR usb/121708; it has been noted by GNATS. From: "Tim Smith" To: bug-followup@FreeBSD.org Cc: Subject: Re: usb/121708: [kbd] nforce 650i mobo w/ usb keyboard infinite key repeat hang (regression) Date: Mon, 14 Apr 2008 20:02:52 -0600 I finally got a PS/2 keyboard and hooked it up: it works (tested with 7.0-RELEASE-i386-bootonly.iso). It seems to have a slight delay (when I press multiple times in a menu, it takes a second or so before it finally arrives at the desired menu item), but it does work without any keyboard hangs. However, I was unable to test beyond the basic installer menus, because the hard disk isn't being detected, similar to: http://www.mail-archive.com/freebsd-hardware@freebsd.org/msg02596.html Regards, Timothy -- If you're not part of the solution, you're part of the precipitate. From owner-freebsd-usb@FreeBSD.ORG Tue Apr 15 20:50:01 2008 Return-Path: Delivered-To: freebsd-usb@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B9AB1106567A for ; Tue, 15 Apr 2008 20:50:01 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 9878B8FC20 for ; Tue, 15 Apr 2008 20:50:01 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.2/8.14.2) with ESMTP id m3FKo1Iw073838 for ; Tue, 15 Apr 2008 20:50:01 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.2/8.14.1/Submit) id m3FKo1DF073837; Tue, 15 Apr 2008 20:50:01 GMT (envelope-from gnats) Resent-Date: Tue, 15 Apr 2008 20:50:01 GMT Resent-Message-Id: <200804152050.m3FKo1DF073837@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-usb@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, David Gilbert Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B84C61065671 for ; Tue, 15 Apr 2008 20:42:30 +0000 (UTC) (envelope-from dgilbert@daveg.ca) Received: from ox.eicat.ca (ox.eicat.ca [66.96.30.35]) by mx1.freebsd.org (Postfix) with ESMTP id 94F828FC16 for ; Tue, 15 Apr 2008 20:42:30 +0000 (UTC) (envelope-from dgilbert@daveg.ca) Received: by ox.eicat.ca (Postfix, from userid 66) id C715CBD24; Tue, 15 Apr 2008 16:23:01 -0400 (EDT) Received: by canoe.dclg.ca (Postfix, from userid 101) id 2B8031145; Tue, 15 Apr 2008 16:23:01 -0400 (EDT) Message-Id: <20080415202301.2B8031145@canoe.dclg.ca> Date: Tue, 15 Apr 2008 16:23:01 -0400 (EDT) From: David Gilbert To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Cc: Subject: usb/122803: Add usbdevs and ubsa support for Dell internal CDMA Modem X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: David Gilbert List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Apr 2008 20:50:01 -0000 >Number: 122803 >Category: usb >Synopsis: Add usbdevs and ubsa support for Dell internal CDMA Modem >Confidential: no >Severity: serious >Priority: high >Responsible: freebsd-usb >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Tue Apr 15 20:50:01 UTC 2008 >Closed-Date: >Last-Modified: >Originator: David Gilbert >Release: FreeBSD 7.0-RELEASE amd64 >Organization: DaveG.ca >Environment: System: FreeBSD canoe.dclg.ca 7.0-RELEASE FreeBSD 7.0-RELEASE #2: Tue Apr 15 15:23:43 EDT 2008 dgilbert@canoe.dclg.ca:/canoe/64/usr/src/sys/amd64/compile/CANOE64 amd64 This applies to all supported versions in the tree. Patches are against the above version. >Description: Dell's branded version of the Novatel Wireless card has different usb vendor and product numbers. >How-To-Repeat: Note that the Dell part shows up attached to ugen, not ucom. >Fix: The following patch Adds the product ID for the card and also addes this to ubsa. This change should be suitable for MFC to both 7-STABLE and 6-STABLE (dunno about 5-STABLE) --- usbdevs.orig 2008-02-29 13:08:19.000000000 -0500 +++ usbdevs 2008-04-15 16:16:48.096510768 -0400 @@ -1078,6 +1078,7 @@ product DELL PORT 0x0058 Port Replicator product DELL BC02 0x8000 BC02 Bluetooth USB Adapter product DELL TM350 0x8103 TrueMobile 350 Bluetooth USB Adapter +product DELL CDMA_MODEM 0x8135 Dell Novatel Wireless CDMA /* Delorme Paublishing products */ product DELORME EARTHMATE 0x0100 Earthmate GPS --- ubsa.c.orig 2008-04-15 16:18:04.726520448 -0400 +++ ubsa.c 2008-04-15 16:18:20.903522274 -0400 @@ -224,6 +224,8 @@ { USB_VENDOR_PERACOM, USB_PRODUCT_PERACOM_SERIAL1 }, /* Novatel Wireless Merlin cards */ { USB_VENDOR_NOVATEL, USB_PRODUCT_NOVATEL_U740 }, + /* DELL Version of the above */ + { USB_VENDOR_DELL, USB_PRODUCT_DELL_CDMA_MODEM }, /* Option Vodafone MC3G */ { USB_VENDOR_OPTION, USB_PRODUCT_OPTION_VODAFONEMC3G }, /* Option GlobeTrotter 3G */ >Release-Note: >Audit-Trail: >Unformatted: From owner-freebsd-usb@FreeBSD.ORG Wed Apr 16 15:40:02 2008 Return-Path: Delivered-To: freebsd-usb@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 315DB1065670 for ; Wed, 16 Apr 2008 15:40:02 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 08F628FC17 for ; Wed, 16 Apr 2008 15:40:02 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.2/8.14.2) with ESMTP id m3GFe1xi086110 for ; Wed, 16 Apr 2008 15:40:01 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.2/8.14.1/Submit) id m3GFe19v086102; Wed, 16 Apr 2008 15:40:01 GMT (envelope-from gnats) Resent-Date: Wed, 16 Apr 2008 15:40:01 GMT Resent-Message-Id: <200804161540.m3GFe19v086102@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-usb@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Maurice Castro Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9D8BD106566C for ; Wed, 16 Apr 2008 15:30:57 +0000 (UTC) (envelope-from maurice@atum.castro.aus.net) Received: from mail.clari.net.au (mail.clari.net.au [203.29.224.21]) by mx1.freebsd.org (Postfix) with ESMTP id BA1B58FC0A for ; Wed, 16 Apr 2008 15:30:54 +0000 (UTC) (envelope-from maurice@atum.castro.aus.net) Received: from horus.castro.aus.net (horus.castro.aus.net [202.147.99.225]) by mail.clari.net.au (8.13.6/8.13.1) with ESMTP id m3GEs8vu049046 for ; Thu, 17 Apr 2008 00:54:09 +1000 (EST) (envelope-from maurice@atum.castro.aus.net) Received: from atum.castro.aus.net (atum.castro.aus.net [202.147.99.226]) by horus.castro.aus.net (8.12.11/8.12.11) with ESMTP id m3GEpekm068425 for ; Thu, 17 Apr 2008 00:51:40 +1000 (EST) (envelope-from maurice@atum.castro.aus.net) Received: from atum.castro.aus.net (localhost.castro.aus.net [127.0.0.1]) by atum.castro.aus.net (8.14.2/8.14.2) with ESMTP id m3GEs3c0005212 for ; Thu, 17 Apr 2008 00:54:03 +1000 (EST) (envelope-from maurice@atum.castro.aus.net) Received: (from maurice@localhost) by atum.castro.aus.net (8.14.2/8.14.2/Submit) id m3GEs2Ha005211; Thu, 17 Apr 2008 00:54:02 +1000 (EST) (envelope-from maurice) Message-Id: <200804161454.m3GEs2Ha005211@atum.castro.aus.net> Date: Thu, 17 Apr 2008 00:54:02 +1000 (EST) From: Maurice Castro To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Cc: Subject: usb/122819: Patch to provide dynamic additions to the usb quirks table X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Maurice Castro List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Apr 2008 15:40:02 -0000 >Number: 122819 >Category: usb >Synopsis: Patch to provide dynamic additions to the usb quirks table >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-usb >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Wed Apr 16 15:40:01 UTC 2008 >Closed-Date: >Last-Modified: >Originator: Maurice Castro >Release: FreeBSD 7.0-RELEASE i386 >Organization: >Environment: System: FreeBSD atum.castro.aus.net 7.0-RELEASE FreeBSD 7.0-RELEASE #9: Wed Apr 16 17:42:53 EST 2008 root@atum.castro.aus.net:/scratch/src/sys/i386/compile/USBTEST i386 FreeBSD all versions >Description: The current USB implementation uses a quirks table that is compiled into the kernel. Under most circumstances this approach works. However, some manufacturers of USB devices have reused keys used in the table and hence changing the compiled in table will result in an inappropriate entries being present. A localised method of changing the quirks values without recompiling their kernel would assist developers and users facing this problem. USB developers in particular can benefit from the ability to prevent a device inappropriately identifying itself as a hid device without having to recompile their kernel. The supplied patch uses entries in the kernel environment to create a dynamic quirks table. The data is available at boot time so devices that are connected across a reboot are correctly handled. This table can also be updated after boot time by calling an IOCTL. >How-To-Repeat: >Fix: diff -ur /usr/src/share/man/man4/usb.4 /scratch/src/share/man/man4/usb.4 --- /usr/src/share/man/man4/usb.4 2008-04-11 22:43:31.000000000 +1000 +++ /scratch/src/share/man/man4/usb.4 2008-04-17 00:23:48.000000000 +1000 @@ -288,6 +288,66 @@ .Em DANGEROUS and should be used with great care since it can destroy the bus integrity. +.It Dv USB_SETDYNQUIRKS +This command will cause the dynamic quirks table to be rebuilt from the +contents of the kernel environment. Environment strings of the form +.Pp +.Ic usb.quirk.N="VENDOR PRODUCT REVISION FLAGS" +.Pp +where +.Ic N +is a number between 0 and 9 and quirks must be numbered contiguously; +.Ic VENDOR PRODUCT +and +.Ic REVISION +are constants that identify the device (the value 0xffff for +.Ic REVISION +denotes all revisions); and +.Ic FLAGS +is any combination of +.Bl -bullet -offset indent -compact +.It +SWAP_UNICODE +.It +MS_REVZ +.It +NO_STRINGS +.It +BAD_ADC +.It +BUS_POWERED +.It +BAD_AUDIO +.It +SPUR_BUT_UP +.It +AU_NO_XU +.It +POWER_CLAIM +.It +AU_NO_FRAC +.It +AU_INP_ASYNC +.It +BROKEN_BIDIR +.It +OPEN_CLEARSTALL +.It +HID_IGNORE +.It +KBD_IGNORE +.It +MS_BAD_CLASS +.It +MS_LEADING_BYTE +.El +separated by "|" characters. These lines set the quirks for each device +identified. +.Pp +The dynamic quirks table is designed to supplement the quirks table built +in to the kernel. It is of particular use to developers working with devices +that inappropriately share vendor, product and revision information and hence +cannot be correctly added in to the kernel's quirks table. .El .Pp The include file diff -ur /usr/src/sys/dev/usb/usb.c /scratch/src/sys/dev/usb/usb.c --- /usr/src/sys/dev/usb/usb.c 2008-04-11 22:43:56.000000000 +1000 +++ /scratch/src/sys/dev/usb/usb.c 2008-04-16 23:23:55.000000000 +1000 @@ -668,6 +668,10 @@ *(struct usb_device_stats *)data = sc->sc_bus->stats; break; + case USB_SETDYNQUIRKS: + usbd_populate_dynamic_quirks(); + break; + default: return (EINVAL); } diff -ur /usr/src/sys/dev/usb/usb.h /scratch/src/sys/dev/usb/usb.h --- /usr/src/sys/dev/usb/usb.h 2008-04-11 22:43:56.000000000 +1000 +++ /scratch/src/sys/dev/usb/usb.h 2008-04-16 23:22:34.000000000 +1000 @@ -673,6 +673,7 @@ #define USB_DISCOVER _IO ('U', 3) #define USB_DEVICEINFO _IOWR('U', 4, struct usb_device_info) #define USB_DEVICESTATS _IOR ('U', 5, struct usb_device_stats) +#define USB_SETDYNQUIRKS _IO ('U', 6) /* Generic HID device */ #define USB_GET_REPORT_DESC _IOR ('U', 21, struct usb_ctl_report_desc) diff -ur /usr/src/sys/dev/usb/usb_quirks.c /scratch/src/sys/dev/usb/usb_quirks.c --- /usr/src/sys/dev/usb/usb_quirks.c 2008-04-11 22:43:56.000000000 +1000 +++ /scratch/src/sys/dev/usb/usb_quirks.c 2008-04-16 17:42:12.000000000 +1000 @@ -42,8 +42,11 @@ #include #include +#include +#include #include +#include #include "usbdevs.h" #include @@ -54,12 +57,14 @@ #define ANY 0xffff -static const struct usbd_quirk_entry { +struct usbd_quirk_entry { u_int16_t idVendor; u_int16_t idProduct; u_int16_t bcdDevice; struct usbd_quirks quirks; -} usb_quirks[] = { +}; + +static struct usbd_quirk_entry usb_quirks[] = { { USB_VENDOR_INSIDEOUT, USB_PRODUCT_INSIDEOUT_EDGEPORT4, 0x094, { UQ_SWAP_UNICODE}}, { USB_VENDOR_DALLAS, USB_PRODUCT_DALLAS_J6502, 0x0a2, { UQ_BAD_ADC }}, @@ -117,15 +122,24 @@ const struct usbd_quirks usbd_no_quirk = { 0 }; -const struct usbd_quirks * -usbd_find_quirk(usb_device_descriptor_t *d) +#define MAX_DYNAMIC_USB_QUIRKS 10 +#define ENVNAMEROOT "usb.quirk." +#define SEPCHAR "|" + +static struct usbd_quirk_entry dynamic_usb_quirks[MAX_DYNAMIC_USB_QUIRKS]; + +static struct usbd_quirks * +usbd_search_quirk(struct usbd_quirk_entry *quirks, usb_device_descriptor_t *d); + +static struct usbd_quirks * +usbd_search_quirk(struct usbd_quirk_entry *quirks, usb_device_descriptor_t *d) { - const struct usbd_quirk_entry *t; + struct usbd_quirk_entry *t; u_int16_t vendor = UGETW(d->idVendor); u_int16_t product = UGETW(d->idProduct); u_int16_t revision = UGETW(d->bcdDevice); - for (t = usb_quirks; t->idVendor != 0; t++) { + for (t = quirks; t->idVendor != 0; t++) { if (t->idVendor == vendor && t->idProduct == product && (t->bcdDevice == ANY || t->bcdDevice == revision)) @@ -139,3 +153,134 @@ #endif return (&t->quirks); } + +const struct usbd_quirks * +usbd_find_quirk(usb_device_descriptor_t *d) +{ + struct usbd_quirks *quirks; + /* check the dynamic quirks list first for local entries */ + quirks = usbd_search_quirk((struct usbd_quirk_entry *) dynamic_usb_quirks, d); + if (quirks->uq_flags != 0) + return quirks; + /* check the compiled in quirks list if dynamic entry not set */ + return(usbd_search_quirk((struct usbd_quirk_entry *) usb_quirks, d)); +} + +void usbd_populate_dynamic_quirks() +{ + /* the size of envkey must exceed the length of ENVNAMEROOT */ + /* and the maximum number of digits in MAX_DYNAMIC_USB_QUIRKS plus 1 */ + /* as the environment size is limitted to 512 entries and a maximum */ + /* of 128 usb devices are supported 3 digits is appropriate for + all valid values of MAX_DYNAMIC_USB_QUIRKS */ + const int envkeysz = strlen(ENVNAMEROOT)+3+1; + char envkey[envkeysz]; + int i; + char *env; + char *pt; + char *e; + int n; + for (i=0; iRelease-Note: >Audit-Trail: >Unformatted: From owner-freebsd-usb@FreeBSD.ORG Wed Apr 16 17:52:55 2008 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AE373106564A; Wed, 16 Apr 2008 17:52:55 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe13.swipnet.se [212.247.155.129]) by mx1.freebsd.org (Postfix) with ESMTP id C05828FC2C; Wed, 16 Apr 2008 17:52:54 +0000 (UTC) (envelope-from hselasky@c2i.net) X-Cloudmark-Score: 0.000000 [] Received: from [62.113.133.152] (account mc467741@c2i.net [62.113.133.152] verified) by mailfe13.swip.net (CommuniGate Pro SMTP 5.1.13) with ESMTPA id 510471276; Wed, 16 Apr 2008 18:52:50 +0200 From: Hans Petter Selasky To: freebsd-usb@freebsd.org, Maurice Castro Date: Wed, 16 Apr 2008 18:54:02 +0200 User-Agent: KMail/1.9.7 References: <200804161454.m3GEs2Ha005211@atum.castro.aus.net> In-Reply-To: <200804161454.m3GEs2Ha005211@atum.castro.aus.net> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200804161854.03438.hselasky@c2i.net> Cc: FreeBSD-gnats-submit@freebsd.org Subject: Re: usb/122819: Patch to provide dynamic additions to the usb quirks table X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Apr 2008 17:52:55 -0000 Hi, Maybe you can prefix the string version of the quirks by the USB module name ? For example: MS_REVZ -> UMS_REVZ AU_NO_FRAC -> UAUDIO_NO_FRAC Then it is easier to know where the quirk belongs. Add a short description of what the quirk does in the "usb" manpage. There might be a race condition reading and writing the quirks. Probably a mutex is appropriate. You can improve the quirk string to numerical conversion code by using binary search. Else your patch looks fine to me. --HPS On Wednesday 16 April 2008, Maurice Castro wrote: > >Number: 122819 > >Category: usb > >Synopsis: Patch to provide dynamic additions to the usb quirks table > >Confidential: no > >Severity: non-critical > >Priority: medium > >Responsible: freebsd-usb > >State: open > >Quarter: > >Keywords: > >Date-Required: > >Class: change-request > >Submitter-Id: current-users > >Arrival-Date: Wed Apr 16 15:40:01 UTC 2008 > >Closed-Date: > >Last-Modified: > >Originator: Maurice Castro > >Release: FreeBSD 7.0-RELEASE i386 > >Organization: > >Environment: > > System: FreeBSD atum.castro.aus.net 7.0-RELEASE FreeBSD 7.0-RELEASE #9: Wed > Apr 16 17:42:53 EST 2008 > root@atum.castro.aus.net:/scratch/src/sys/i386/compile/USBTEST i386 > > > > FreeBSD all versions > > >Description: > > The current USB implementation uses a quirks table that is compiled > into the kernel. Under most circumstances this approach works. > However, some manufacturers of USB devices have reused keys used > in the table and hence changing the compiled in table will result > in an inappropriate entries being present. A localised method of > changing the quirks values without recompiling their kernel would > assist developers and users facing this problem. USB developers in > particular can benefit from the ability to prevent a device > inappropriately identifying itself as a hid device without having > to recompile their kernel. > > The supplied patch uses entries in the kernel environment to create > a dynamic quirks table. The data is available at boot time so > devices that are connected across a reboot are correctly handled. > This table can also be updated after boot time by calling an IOCTL. > > >How-To-Repeat: > >Fix: > > diff -ur /usr/src/share/man/man4/usb.4 /scratch/src/share/man/man4/usb.4 > --- /usr/src/share/man/man4/usb.4 2008-04-11 22:43:31.000000000 +1000 > +++ /scratch/src/share/man/man4/usb.4 2008-04-17 00:23:48.000000000 +1000 > @@ -288,6 +288,66 @@ > .Em DANGEROUS > and should be used with great care since it > can destroy the bus integrity. > +.It Dv USB_SETDYNQUIRKS > +This command will cause the dynamic quirks table to be rebuilt from the > +contents of the kernel environment. Environment strings of the form > +.Pp > +.Ic usb.quirk.N="VENDOR PRODUCT REVISION FLAGS" > +.Pp > +where > +.Ic N > +is a number between 0 and 9 and quirks must be numbered contiguously; > +.Ic VENDOR PRODUCT > +and > +.Ic REVISION > +are constants that identify the device (the value 0xffff for > +.Ic REVISION > +denotes all revisions); and > +.Ic FLAGS > +is any combination of > +.Bl -bullet -offset indent -compact > +.It > +SWAP_UNICODE > +.It > +MS_REVZ > +.It > +NO_STRINGS > +.It > +BAD_ADC > +.It > +BUS_POWERED > +.It > +BAD_AUDIO > +.It > +SPUR_BUT_UP > +.It > +AU_NO_XU > +.It > +POWER_CLAIM > +.It > +AU_NO_FRAC > +.It > +AU_INP_ASYNC > +.It > +BROKEN_BIDIR > +.It > +OPEN_CLEARSTALL > +.It > +HID_IGNORE > +.It > +KBD_IGNORE > +.It > +MS_BAD_CLASS > +.It > +MS_LEADING_BYTE > +.El > +separated by "|" characters. These lines set the quirks for each device > +identified. > +.Pp > +The dynamic quirks table is designed to supplement the quirks table built > +in to the kernel. It is of particular use to developers working with > devices +that inappropriately share vendor, product and revision > information and hence +cannot be correctly added in to the kernel's quirks > table. > .El > .Pp > The include file > diff -ur /usr/src/sys/dev/usb/usb.c /scratch/src/sys/dev/usb/usb.c > --- /usr/src/sys/dev/usb/usb.c 2008-04-11 22:43:56.000000000 +1000 > +++ /scratch/src/sys/dev/usb/usb.c 2008-04-16 23:23:55.000000000 +1000 > @@ -668,6 +668,10 @@ > *(struct usb_device_stats *)data = sc->sc_bus->stats; > break; > > + case USB_SETDYNQUIRKS: > + usbd_populate_dynamic_quirks(); > + break; > + > default: > return (EINVAL); > } > diff -ur /usr/src/sys/dev/usb/usb.h /scratch/src/sys/dev/usb/usb.h > --- /usr/src/sys/dev/usb/usb.h 2008-04-11 22:43:56.000000000 +1000 > +++ /scratch/src/sys/dev/usb/usb.h 2008-04-16 23:22:34.000000000 +1000 > @@ -673,6 +673,7 @@ > #define USB_DISCOVER _IO ('U', 3) > #define USB_DEVICEINFO _IOWR('U', 4, struct usb_device_info) > #define USB_DEVICESTATS _IOR ('U', 5, struct usb_device_stats) > +#define USB_SETDYNQUIRKS _IO ('U', 6) > > /* Generic HID device */ > #define USB_GET_REPORT_DESC _IOR ('U', 21, struct usb_ctl_report_desc) > diff -ur /usr/src/sys/dev/usb/usb_quirks.c > /scratch/src/sys/dev/usb/usb_quirks.c --- > /usr/src/sys/dev/usb/usb_quirks.c 2008-04-11 22:43:56.000000000 +1000 +++ > /scratch/src/sys/dev/usb/usb_quirks.c 2008-04-16 17:42:12.000000000 +1000 > @@ -42,8 +42,11 @@ > > #include > #include > +#include > +#include > > #include > +#include > > #include "usbdevs.h" > #include > @@ -54,12 +57,14 @@ > > #define ANY 0xffff > > -static const struct usbd_quirk_entry { > +struct usbd_quirk_entry { > u_int16_t idVendor; > u_int16_t idProduct; > u_int16_t bcdDevice; > struct usbd_quirks quirks; > -} usb_quirks[] = { > +}; > + > +static struct usbd_quirk_entry usb_quirks[] = { > { USB_VENDOR_INSIDEOUT, USB_PRODUCT_INSIDEOUT_EDGEPORT4, > 0x094, { UQ_SWAP_UNICODE}}, > { USB_VENDOR_DALLAS, USB_PRODUCT_DALLAS_J6502, 0x0a2, { UQ_BAD_ADC > }}, @@ -117,15 +122,24 @@ > > const struct usbd_quirks usbd_no_quirk = { 0 }; > > -const struct usbd_quirks * > -usbd_find_quirk(usb_device_descriptor_t *d) > +#define MAX_DYNAMIC_USB_QUIRKS 10 > +#define ENVNAMEROOT "usb.quirk." > +#define SEPCHAR "|" > + > +static struct usbd_quirk_entry dynamic_usb_quirks[MAX_DYNAMIC_USB_QUIRKS]; > + > +static struct usbd_quirks * > +usbd_search_quirk(struct usbd_quirk_entry *quirks, usb_device_descriptor_t > *d); + > +static struct usbd_quirks * > +usbd_search_quirk(struct usbd_quirk_entry *quirks, usb_device_descriptor_t > *d) { > - const struct usbd_quirk_entry *t; > + struct usbd_quirk_entry *t; > u_int16_t vendor = UGETW(d->idVendor); > u_int16_t product = UGETW(d->idProduct); > u_int16_t revision = UGETW(d->bcdDevice); > > - for (t = usb_quirks; t->idVendor != 0; t++) { > + for (t = quirks; t->idVendor != 0; t++) { > if (t->idVendor == vendor && > t->idProduct == product && > (t->bcdDevice == ANY || t->bcdDevice == revision)) > @@ -139,3 +153,134 @@ > #endif > return (&t->quirks); > } > + > +const struct usbd_quirks * > +usbd_find_quirk(usb_device_descriptor_t *d) > +{ > + struct usbd_quirks *quirks; > + /* check the dynamic quirks list first for local entries */ > + quirks = usbd_search_quirk((struct usbd_quirk_entry *) > dynamic_usb_quirks, d); + if (quirks->uq_flags != 0) > + return quirks; > + /* check the compiled in quirks list if dynamic entry not set */ > + return(usbd_search_quirk((struct usbd_quirk_entry *) usb_quirks, d)); > +} > + > +void usbd_populate_dynamic_quirks() > +{ > + /* the size of envkey must exceed the length of ENVNAMEROOT */ > + /* and the maximum number of digits in MAX_DYNAMIC_USB_QUIRKS plus 1 */ > + /* as the environment size is limitted to 512 entries and a maximum */ > + /* of 128 usb devices are supported 3 digits is appropriate for > + all valid values of MAX_DYNAMIC_USB_QUIRKS */ > + const int envkeysz = strlen(ENVNAMEROOT)+3+1; > + char envkey[envkeysz]; > + int i; > + char *env; > + char *pt; > + char *e; > + int n; > + for (i=0; i + { > + dynamic_usb_quirks[i].quirks.uq_flags = 0; > + dynamic_usb_quirks[i].idVendor = 0; > + dynamic_usb_quirks[i].idProduct = 0; > + dynamic_usb_quirks[i].bcdDevice = 0; > + snprintf(envkey,envkeysz,"%s%d",ENVNAMEROOT,i); > + if (testenv(envkey)) > + { > +#ifdef USB_DEBUG > + printf("usbd config %s\n", envkey); > +#endif > + env = getenv(envkey); > + dynamic_usb_quirks[i].idVendor = strtoul(env, &pt, 0); > + dynamic_usb_quirks[i].idProduct = strtoul(pt, &pt, 0); > + dynamic_usb_quirks[i].bcdDevice = strtoul(pt, &pt, 0); > + /* skip anything which isn't a flag */ > + while (*pt && !isalpha(*pt)) pt++; > + /* read in flags */ > + while (*pt) > + { > + e = strstr(pt,SEPCHAR); > + if (!e) > + { > + n = strlen(pt); > + } > + else > + { > + n = e - pt; > + } > + if (!strncmp("SWAP_UNICODE", pt, n)) > + dynamic_usb_quirks[i].quirks.uq_flags |= UQ_SWAP_UNICODE; > + if (!strncmp("MS_REVZ", pt, n)) > + dynamic_usb_quirks[i].quirks.uq_flags |= UQ_MS_REVZ; > + if (!strncmp("NO_STRINGS", pt, n)) > + dynamic_usb_quirks[i].quirks.uq_flags |= UQ_NO_STRINGS; > + if (!strncmp("BAD_ADC", pt, n)) > + dynamic_usb_quirks[i].quirks.uq_flags |= UQ_BAD_ADC; > + if (!strncmp("BUS_POWERED", pt, n)) > + dynamic_usb_quirks[i].quirks.uq_flags |= UQ_BUS_POWERED; > + if (!strncmp("BAD_AUDIO", pt, n)) > + dynamic_usb_quirks[i].quirks.uq_flags |= UQ_BAD_AUDIO; > + if (!strncmp("SPUR_BUT_UP", pt, n)) > + dynamic_usb_quirks[i].quirks.uq_flags |= UQ_SPUR_BUT_UP; > + if (!strncmp("AU_NO_XU", pt, n)) > + dynamic_usb_quirks[i].quirks.uq_flags |= UQ_AU_NO_XU; > + if (!strncmp("POWER_CLAIM", pt, n)) > + dynamic_usb_quirks[i].quirks.uq_flags |= UQ_POWER_CLAIM; > + if (!strncmp("AU_NO_FRAC", pt, n)) > + dynamic_usb_quirks[i].quirks.uq_flags |= UQ_AU_NO_FRAC; > + if (!strncmp("AU_INP_ASYNC", pt, n)) > + dynamic_usb_quirks[i].quirks.uq_flags |= UQ_AU_INP_ASYNC; > + if (!strncmp("BROKEN_BIDIR", pt, n)) > + dynamic_usb_quirks[i].quirks.uq_flags |= UQ_BROKEN_BIDIR; > + if (!strncmp("OPEN_CLEARSTALL", pt, n)) > + dynamic_usb_quirks[i].quirks.uq_flags |= UQ_OPEN_CLEARSTALL; > + if (!strncmp("HID_IGNORE", pt, n)) > + dynamic_usb_quirks[i].quirks.uq_flags |= UQ_HID_IGNORE; > + if (!strncmp("KBD_IGNORE", pt, n)) > + dynamic_usb_quirks[i].quirks.uq_flags |= UQ_KBD_IGNORE; > + if (!strncmp("MS_BAD_CLASS", pt, n)) > + dynamic_usb_quirks[i].quirks.uq_flags |= UQ_MS_BAD_CLASS; > + if (!strncmp("MS_LEADING_BYTE", pt, n)) > + dynamic_usb_quirks[i].quirks.uq_flags |= UQ_MS_LEADING_BYTE; > + pt += n; > + pt += strspn(pt, SEPCHAR); > + } > +#ifdef USB_DEBUG > + printf("usbd quirk %d %x %x %x %x\n", > + dynamic_usb_quirks[i].quirks.uq_flags, > + dynamic_usb_quirks[i].idVendor, > + dynamic_usb_quirks[i].idProduct, > + dynamic_usb_quirks[i].bcdDevice, > + dynamic_usb_quirks[i].quirks.uq_flags > + ); > +#endif > + freeenv(env); > + } > + else > + { > + break; > + } > + } > + for (; i + { > +#ifdef USB_DEBUG > + printf("usbd clear dynamic quirk %d\n", i); > +#endif > + dynamic_usb_quirks[i].quirks.uq_flags = 0; > + dynamic_usb_quirks[i].idVendor = 0; > + dynamic_usb_quirks[i].idProduct = 0; > + dynamic_usb_quirks[i].bcdDevice = 0; > + snprintf(envkey,envkeysz,"%s%d",ENVNAMEROOT,i); > + if (testenv(envkey)) > + { > +#ifdef USB_DEBUG > + printf("usbd key %s invalid as earlier entry missing\n", envkey); > +#endif > + } > + } > +} > + > +SYSINIT(usbd_populate_dynamic_quirks, SI_SUB_KLD, SI_ORDER_MIDDLE, > + usbd_populate_dynamic_quirks, NULL); > diff -ur /usr/src/sys/dev/usb/usb_quirks.h > /scratch/src/sys/dev/usb/usb_quirks.h --- > /usr/src/sys/dev/usb/usb_quirks.h 2008-04-11 22:43:56.000000000 +1000 +++ > /scratch/src/sys/dev/usb/usb_quirks.h 2008-04-16 11:09:35.000000000 +1000 > @@ -62,3 +62,5 @@ > extern const struct usbd_quirks usbd_no_quirk; > > const struct usbd_quirks *usbd_find_quirk(usb_device_descriptor_t *); > + > +void usbd_populate_dynamic_quirks(void); > > >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 "freebsd-usb-unsubscribe@freebsd.org" From owner-freebsd-usb@FreeBSD.ORG Wed Apr 16 18:00:07 2008 Return-Path: Delivered-To: freebsd-usb@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0D6B61065671 for ; Wed, 16 Apr 2008 18:00:07 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id F3EA98FC1E for ; Wed, 16 Apr 2008 18:00:06 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.2/8.14.2) with ESMTP id m3GI06qW097203 for ; Wed, 16 Apr 2008 18:00:06 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.2/8.14.1/Submit) id m3GI06vk097202; Wed, 16 Apr 2008 18:00:06 GMT (envelope-from gnats) Date: Wed, 16 Apr 2008 18:00:06 GMT Message-Id: <200804161800.m3GI06vk097202@freefall.freebsd.org> To: freebsd-usb@FreeBSD.org From: Hans Petter Selasky Cc: Subject: Re: usb/122819: Patch to provide dynamic additions to the usb quirks table X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Hans Petter Selasky List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Apr 2008 18:00:07 -0000 The following reply was made to PR usb/122819; it has been noted by GNATS. From: Hans Petter Selasky To: freebsd-usb@freebsd.org, Maurice Castro Cc: FreeBSD-gnats-submit@freebsd.org Subject: Re: usb/122819: Patch to provide dynamic additions to the usb quirks table Date: Wed, 16 Apr 2008 18:54:02 +0200 Hi, Maybe you can prefix the string version of the quirks by the USB module name ? For example: MS_REVZ -> UMS_REVZ AU_NO_FRAC -> UAUDIO_NO_FRAC Then it is easier to know where the quirk belongs. Add a short description of what the quirk does in the "usb" manpage. There might be a race condition reading and writing the quirks. Probably a mutex is appropriate. You can improve the quirk string to numerical conversion code by using binary search. Else your patch looks fine to me. --HPS On Wednesday 16 April 2008, Maurice Castro wrote: > >Number: 122819 > >Category: usb > >Synopsis: Patch to provide dynamic additions to the usb quirks table > >Confidential: no > >Severity: non-critical > >Priority: medium > >Responsible: freebsd-usb > >State: open > >Quarter: > >Keywords: > >Date-Required: > >Class: change-request > >Submitter-Id: current-users > >Arrival-Date: Wed Apr 16 15:40:01 UTC 2008 > >Closed-Date: > >Last-Modified: > >Originator: Maurice Castro > >Release: FreeBSD 7.0-RELEASE i386 > >Organization: > >Environment: > > System: FreeBSD atum.castro.aus.net 7.0-RELEASE FreeBSD 7.0-RELEASE #9: Wed > Apr 16 17:42:53 EST 2008 > root@atum.castro.aus.net:/scratch/src/sys/i386/compile/USBTEST i386 > > > > FreeBSD all versions > > >Description: > > The current USB implementation uses a quirks table that is compiled > into the kernel. Under most circumstances this approach works. > However, some manufacturers of USB devices have reused keys used > in the table and hence changing the compiled in table will result > in an inappropriate entries being present. A localised method of > changing the quirks values without recompiling their kernel would > assist developers and users facing this problem. USB developers in > particular can benefit from the ability to prevent a device > inappropriately identifying itself as a hid device without having > to recompile their kernel. > > The supplied patch uses entries in the kernel environment to create > a dynamic quirks table. The data is available at boot time so > devices that are connected across a reboot are correctly handled. > This table can also be updated after boot time by calling an IOCTL. > > >How-To-Repeat: > >Fix: > > diff -ur /usr/src/share/man/man4/usb.4 /scratch/src/share/man/man4/usb.4 > --- /usr/src/share/man/man4/usb.4 2008-04-11 22:43:31.000000000 +1000 > +++ /scratch/src/share/man/man4/usb.4 2008-04-17 00:23:48.000000000 +1000 > @@ -288,6 +288,66 @@ > .Em DANGEROUS > and should be used with great care since it > can destroy the bus integrity. > +.It Dv USB_SETDYNQUIRKS > +This command will cause the dynamic quirks table to be rebuilt from the > +contents of the kernel environment. Environment strings of the form > +.Pp > +.Ic usb.quirk.N="VENDOR PRODUCT REVISION FLAGS" > +.Pp > +where > +.Ic N > +is a number between 0 and 9 and quirks must be numbered contiguously; > +.Ic VENDOR PRODUCT > +and > +.Ic REVISION > +are constants that identify the device (the value 0xffff for > +.Ic REVISION > +denotes all revisions); and > +.Ic FLAGS > +is any combination of > +.Bl -bullet -offset indent -compact > +.It > +SWAP_UNICODE > +.It > +MS_REVZ > +.It > +NO_STRINGS > +.It > +BAD_ADC > +.It > +BUS_POWERED > +.It > +BAD_AUDIO > +.It > +SPUR_BUT_UP > +.It > +AU_NO_XU > +.It > +POWER_CLAIM > +.It > +AU_NO_FRAC > +.It > +AU_INP_ASYNC > +.It > +BROKEN_BIDIR > +.It > +OPEN_CLEARSTALL > +.It > +HID_IGNORE > +.It > +KBD_IGNORE > +.It > +MS_BAD_CLASS > +.It > +MS_LEADING_BYTE > +.El > +separated by "|" characters. These lines set the quirks for each device > +identified. > +.Pp > +The dynamic quirks table is designed to supplement the quirks table built > +in to the kernel. It is of particular use to developers working with > devices +that inappropriately share vendor, product and revision > information and hence +cannot be correctly added in to the kernel's quirks > table. > .El > .Pp > The include file > diff -ur /usr/src/sys/dev/usb/usb.c /scratch/src/sys/dev/usb/usb.c > --- /usr/src/sys/dev/usb/usb.c 2008-04-11 22:43:56.000000000 +1000 > +++ /scratch/src/sys/dev/usb/usb.c 2008-04-16 23:23:55.000000000 +1000 > @@ -668,6 +668,10 @@ > *(struct usb_device_stats *)data = sc->sc_bus->stats; > break; > > + case USB_SETDYNQUIRKS: > + usbd_populate_dynamic_quirks(); > + break; > + > default: > return (EINVAL); > } > diff -ur /usr/src/sys/dev/usb/usb.h /scratch/src/sys/dev/usb/usb.h > --- /usr/src/sys/dev/usb/usb.h 2008-04-11 22:43:56.000000000 +1000 > +++ /scratch/src/sys/dev/usb/usb.h 2008-04-16 23:22:34.000000000 +1000 > @@ -673,6 +673,7 @@ > #define USB_DISCOVER _IO ('U', 3) > #define USB_DEVICEINFO _IOWR('U', 4, struct usb_device_info) > #define USB_DEVICESTATS _IOR ('U', 5, struct usb_device_stats) > +#define USB_SETDYNQUIRKS _IO ('U', 6) > > /* Generic HID device */ > #define USB_GET_REPORT_DESC _IOR ('U', 21, struct usb_ctl_report_desc) > diff -ur /usr/src/sys/dev/usb/usb_quirks.c > /scratch/src/sys/dev/usb/usb_quirks.c --- > /usr/src/sys/dev/usb/usb_quirks.c 2008-04-11 22:43:56.000000000 +1000 +++ > /scratch/src/sys/dev/usb/usb_quirks.c 2008-04-16 17:42:12.000000000 +1000 > @@ -42,8 +42,11 @@ > > #include > #include > +#include > +#include > > #include > +#include > > #include "usbdevs.h" > #include > @@ -54,12 +57,14 @@ > > #define ANY 0xffff > > -static const struct usbd_quirk_entry { > +struct usbd_quirk_entry { > u_int16_t idVendor; > u_int16_t idProduct; > u_int16_t bcdDevice; > struct usbd_quirks quirks; > -} usb_quirks[] = { > +}; > + > +static struct usbd_quirk_entry usb_quirks[] = { > { USB_VENDOR_INSIDEOUT, USB_PRODUCT_INSIDEOUT_EDGEPORT4, > 0x094, { UQ_SWAP_UNICODE}}, > { USB_VENDOR_DALLAS, USB_PRODUCT_DALLAS_J6502, 0x0a2, { UQ_BAD_ADC > }}, @@ -117,15 +122,24 @@ > > const struct usbd_quirks usbd_no_quirk = { 0 }; > > -const struct usbd_quirks * > -usbd_find_quirk(usb_device_descriptor_t *d) > +#define MAX_DYNAMIC_USB_QUIRKS 10 > +#define ENVNAMEROOT "usb.quirk." > +#define SEPCHAR "|" > + > +static struct usbd_quirk_entry dynamic_usb_quirks[MAX_DYNAMIC_USB_QUIRKS]; > + > +static struct usbd_quirks * > +usbd_search_quirk(struct usbd_quirk_entry *quirks, usb_device_descriptor_t > *d); + > +static struct usbd_quirks * > +usbd_search_quirk(struct usbd_quirk_entry *quirks, usb_device_descriptor_t > *d) { > - const struct usbd_quirk_entry *t; > + struct usbd_quirk_entry *t; > u_int16_t vendor = UGETW(d->idVendor); > u_int16_t product = UGETW(d->idProduct); > u_int16_t revision = UGETW(d->bcdDevice); > > - for (t = usb_quirks; t->idVendor != 0; t++) { > + for (t = quirks; t->idVendor != 0; t++) { > if (t->idVendor == vendor && > t->idProduct == product && > (t->bcdDevice == ANY || t->bcdDevice == revision)) > @@ -139,3 +153,134 @@ > #endif > return (&t->quirks); > } > + > +const struct usbd_quirks * > +usbd_find_quirk(usb_device_descriptor_t *d) > +{ > + struct usbd_quirks *quirks; > + /* check the dynamic quirks list first for local entries */ > + quirks = usbd_search_quirk((struct usbd_quirk_entry *) > dynamic_usb_quirks, d); + if (quirks->uq_flags != 0) > + return quirks; > + /* check the compiled in quirks list if dynamic entry not set */ > + return(usbd_search_quirk((struct usbd_quirk_entry *) usb_quirks, d)); > +} > + > +void usbd_populate_dynamic_quirks() > +{ > + /* the size of envkey must exceed the length of ENVNAMEROOT */ > + /* and the maximum number of digits in MAX_DYNAMIC_USB_QUIRKS plus 1 */ > + /* as the environment size is limitted to 512 entries and a maximum */ > + /* of 128 usb devices are supported 3 digits is appropriate for > + all valid values of MAX_DYNAMIC_USB_QUIRKS */ > + const int envkeysz = strlen(ENVNAMEROOT)+3+1; > + char envkey[envkeysz]; > + int i; > + char *env; > + char *pt; > + char *e; > + int n; > + for (i=0; i + { > + dynamic_usb_quirks[i].quirks.uq_flags = 0; > + dynamic_usb_quirks[i].idVendor = 0; > + dynamic_usb_quirks[i].idProduct = 0; > + dynamic_usb_quirks[i].bcdDevice = 0; > + snprintf(envkey,envkeysz,"%s%d",ENVNAMEROOT,i); > + if (testenv(envkey)) > + { > +#ifdef USB_DEBUG > + printf("usbd config %s\n", envkey); > +#endif > + env = getenv(envkey); > + dynamic_usb_quirks[i].idVendor = strtoul(env, &pt, 0); > + dynamic_usb_quirks[i].idProduct = strtoul(pt, &pt, 0); > + dynamic_usb_quirks[i].bcdDevice = strtoul(pt, &pt, 0); > + /* skip anything which isn't a flag */ > + while (*pt && !isalpha(*pt)) pt++; > + /* read in flags */ > + while (*pt) > + { > + e = strstr(pt,SEPCHAR); > + if (!e) > + { > + n = strlen(pt); > + } > + else > + { > + n = e - pt; > + } > + if (!strncmp("SWAP_UNICODE", pt, n)) > + dynamic_usb_quirks[i].quirks.uq_flags |= UQ_SWAP_UNICODE; > + if (!strncmp("MS_REVZ", pt, n)) > + dynamic_usb_quirks[i].quirks.uq_flags |= UQ_MS_REVZ; > + if (!strncmp("NO_STRINGS", pt, n)) > + dynamic_usb_quirks[i].quirks.uq_flags |= UQ_NO_STRINGS; > + if (!strncmp("BAD_ADC", pt, n)) > + dynamic_usb_quirks[i].quirks.uq_flags |= UQ_BAD_ADC; > + if (!strncmp("BUS_POWERED", pt, n)) > + dynamic_usb_quirks[i].quirks.uq_flags |= UQ_BUS_POWERED; > + if (!strncmp("BAD_AUDIO", pt, n)) > + dynamic_usb_quirks[i].quirks.uq_flags |= UQ_BAD_AUDIO; > + if (!strncmp("SPUR_BUT_UP", pt, n)) > + dynamic_usb_quirks[i].quirks.uq_flags |= UQ_SPUR_BUT_UP; > + if (!strncmp("AU_NO_XU", pt, n)) > + dynamic_usb_quirks[i].quirks.uq_flags |= UQ_AU_NO_XU; > + if (!strncmp("POWER_CLAIM", pt, n)) > + dynamic_usb_quirks[i].quirks.uq_flags |= UQ_POWER_CLAIM; > + if (!strncmp("AU_NO_FRAC", pt, n)) > + dynamic_usb_quirks[i].quirks.uq_flags |= UQ_AU_NO_FRAC; > + if (!strncmp("AU_INP_ASYNC", pt, n)) > + dynamic_usb_quirks[i].quirks.uq_flags |= UQ_AU_INP_ASYNC; > + if (!strncmp("BROKEN_BIDIR", pt, n)) > + dynamic_usb_quirks[i].quirks.uq_flags |= UQ_BROKEN_BIDIR; > + if (!strncmp("OPEN_CLEARSTALL", pt, n)) > + dynamic_usb_quirks[i].quirks.uq_flags |= UQ_OPEN_CLEARSTALL; > + if (!strncmp("HID_IGNORE", pt, n)) > + dynamic_usb_quirks[i].quirks.uq_flags |= UQ_HID_IGNORE; > + if (!strncmp("KBD_IGNORE", pt, n)) > + dynamic_usb_quirks[i].quirks.uq_flags |= UQ_KBD_IGNORE; > + if (!strncmp("MS_BAD_CLASS", pt, n)) > + dynamic_usb_quirks[i].quirks.uq_flags |= UQ_MS_BAD_CLASS; > + if (!strncmp("MS_LEADING_BYTE", pt, n)) > + dynamic_usb_quirks[i].quirks.uq_flags |= UQ_MS_LEADING_BYTE; > + pt += n; > + pt += strspn(pt, SEPCHAR); > + } > +#ifdef USB_DEBUG > + printf("usbd quirk %d %x %x %x %x\n", > + dynamic_usb_quirks[i].quirks.uq_flags, > + dynamic_usb_quirks[i].idVendor, > + dynamic_usb_quirks[i].idProduct, > + dynamic_usb_quirks[i].bcdDevice, > + dynamic_usb_quirks[i].quirks.uq_flags > + ); > +#endif > + freeenv(env); > + } > + else > + { > + break; > + } > + } > + for (; i + { > +#ifdef USB_DEBUG > + printf("usbd clear dynamic quirk %d\n", i); > +#endif > + dynamic_usb_quirks[i].quirks.uq_flags = 0; > + dynamic_usb_quirks[i].idVendor = 0; > + dynamic_usb_quirks[i].idProduct = 0; > + dynamic_usb_quirks[i].bcdDevice = 0; > + snprintf(envkey,envkeysz,"%s%d",ENVNAMEROOT,i); > + if (testenv(envkey)) > + { > +#ifdef USB_DEBUG > + printf("usbd key %s invalid as earlier entry missing\n", envkey); > +#endif > + } > + } > +} > + > +SYSINIT(usbd_populate_dynamic_quirks, SI_SUB_KLD, SI_ORDER_MIDDLE, > + usbd_populate_dynamic_quirks, NULL); > diff -ur /usr/src/sys/dev/usb/usb_quirks.h > /scratch/src/sys/dev/usb/usb_quirks.h --- > /usr/src/sys/dev/usb/usb_quirks.h 2008-04-11 22:43:56.000000000 +1000 +++ > /scratch/src/sys/dev/usb/usb_quirks.h 2008-04-16 11:09:35.000000000 +1000 > @@ -62,3 +62,5 @@ > extern const struct usbd_quirks usbd_no_quirk; > > const struct usbd_quirks *usbd_find_quirk(usb_device_descriptor_t *); > + > +void usbd_populate_dynamic_quirks(void); > > >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 "freebsd-usb-unsubscribe@freebsd.org" From owner-freebsd-usb@FreeBSD.ORG Thu Apr 17 03:10:04 2008 Return-Path: Delivered-To: freebsd-usb@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2ED87106564A for ; Thu, 17 Apr 2008 03:10:04 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 109B58FC18 for ; Thu, 17 Apr 2008 03:10:04 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.2/8.14.2) with ESMTP id m3H3A39h048397 for ; Thu, 17 Apr 2008 03:10:03 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.2/8.14.1/Submit) id m3H3A3gP048390; Thu, 17 Apr 2008 03:10:03 GMT (envelope-from gnats) Date: Thu, 17 Apr 2008 03:10:03 GMT Message-Id: <200804170310.m3H3A3gP048390@freefall.freebsd.org> To: freebsd-usb@FreeBSD.org From: Maurice Castro Cc: Subject: Re: usb/122819: Patch to provide dynamic additions to the usb quirks table X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Maurice Castro List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Apr 2008 03:10:04 -0000 The following reply was made to PR usb/122819; it has been noted by GNATS. From: Maurice Castro To: bug-followup@FreeBSD.org, maurice@castro.aus.net Cc: Subject: Re: usb/122819: Patch to provide dynamic additions to the usb quirks table Date: Thu, 17 Apr 2008 12:23:36 +1000 --Apple-Mail-2-311066617 Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Hi Hans, in addition to the corrections below I have added an extra utility to the system this utility calls the ioctl to load the dynamic quirks table. Patch is attached. As noted below I have not incorporated the bsearch for the reasons stated. Maurice Castro From: Hans Petter Selasky Date: Wed, 16 Apr 2008 18:54:02 +0200 > Hi, > > Maybe you can prefix the string version of the quirks by the USB > module name ? > > For example: > > MS_REVZ -> UMS_REVZ > AU_NO_FRAC -> UAUDIO_NO_FRAC > Done > Then it is easier to know where the quirk belongs. > > Add a short description of what the quirk does in the "usb" manpage. > Done > There might be a race condition reading and writing the quirks. > Probably a > mutex is appropriate. > Done > You can improve the quirk string to numerical conversion code by > using binary > search. > Wrote code to use bsearch and then backed it out. Value of binary searching on lists less than 20 items is minimal and required additional memory copy operation and release, due to non-destructive parsing technique used on environment variables. > Else your patch looks fine to me. --Apple-Mail-2-311066617 Content-Disposition: attachment; filename=usb.diff Content-Type: application/octet-stream; x-unix-mode=0644; name="usb.diff" Content-Transfer-Encoding: 7bit diff -ru /usr/src/share/man/man4/usb.4 /scratch/src/share/man/man4/usb.4 --- /usr/src/share/man/man4/usb.4 2008-04-11 22:43:31.000000000 +1000 +++ /scratch/src/share/man/man4/usb.4 2008-04-17 08:39:01.000000000 +1000 @@ -288,6 +288,66 @@ .Em DANGEROUS and should be used with great care since it can destroy the bus integrity. +.It Dv USB_SETDYNQUIRKS +This command will cause the dynamic quirks table to be rebuilt from the +contents of the kernel environment. Environment strings of the form +.Pp +.Ic usb.quirk.N="VENDOR PRODUCT REVISION FLAGS" +.Pp +where +.Ic N +is a number between 0 and 9 and quirks must be numbered contiguously; +.Ic VENDOR PRODUCT +and +.Ic REVISION +are constants that identify the device (the value 0xffff for +.Ic REVISION +denotes all revisions); and +.Ic FLAGS +is any combination of +.Bl -tag -width "UOPEN_CLEARSTALL" -compact -offset indent +.It USWAP_UNICODE +has some Unicode strings swapped. +.It UMS_REVZ +mouse has Z-axis reversed +.It UNO_STRINGS +string descriptors are broken. +.It UBAD_ADC +bad audio spec version number. +.It UBUS_POWERED +device is bus powered, despite claim +.It UBAD_AUDIO +device claims audio class, but isn't +.It USPUR_BUT_UP +spurious mouse button up events +.It UAU_NO_XU +audio device has broken extension unit +.It UPOWER_CLAIM +hub lies about power status +.It UAU_NO_FRAC +don't adjust for fractional samples +.It UAU_INP_ASYNC +input is async despite claim of adaptive +.It UBROKEN_BIDIR +printer has broken bidir mode +.It UOPEN_CLEARSTALL +device needs clear endpoint stall +.It UHID_IGNORE +device should be ignored by hid class +.It UKBD_IGNORE +device should be ignored by both kbd and hid class +.It UMS_BAD_CLASS +doesn't identify properly +.It UMS_LEADING_BYTE +mouse sends an unknown leading byte. +.El +separated by "|" characters. These lines set the quirks for each device +identified. +.Pp +The dynamic quirks table is designed to supplement the quirks table built +in to the kernel. It is of particular use to developers working with devices +that inappropriately share vendor, product and revision information and hence +cannot be correctly added in to the kernel's quirks table. .El .Pp The include file diff -ru /usr/src/sys/dev/usb/usb.c /scratch/src/sys/dev/usb/usb.c --- /usr/src/sys/dev/usb/usb.c 2008-04-11 22:43:56.000000000 +1000 +++ /scratch/src/sys/dev/usb/usb.c 2008-04-16 23:23:55.000000000 +1000 @@ -668,6 +668,10 @@ *(struct usb_device_stats *)data = sc->sc_bus->stats; break; + case USB_SETDYNQUIRKS: + usbd_populate_dynamic_quirks(); + break; + default: return (EINVAL); } diff -ru /usr/src/sys/dev/usb/usb.h /scratch/src/sys/dev/usb/usb.h --- /usr/src/sys/dev/usb/usb.h 2008-04-11 22:43:56.000000000 +1000 +++ /scratch/src/sys/dev/usb/usb.h 2008-04-16 23:22:34.000000000 +1000 @@ -673,6 +673,7 @@ #define USB_DISCOVER _IO ('U', 3) #define USB_DEVICEINFO _IOWR('U', 4, struct usb_device_info) #define USB_DEVICESTATS _IOR ('U', 5, struct usb_device_stats) +#define USB_SETDYNQUIRKS _IO ('U', 6) /* Generic HID device */ #define USB_GET_REPORT_DESC _IOR ('U', 21, struct usb_ctl_report_desc) diff -ru /usr/src/sys/dev/usb/usb_quirks.c /scratch/src/sys/dev/usb/usb_quirks.c --- /usr/src/sys/dev/usb/usb_quirks.c 2008-04-11 22:43:56.000000000 +1000 +++ /scratch/src/sys/dev/usb/usb_quirks.c 2008-04-17 12:02:12.000000000 +1000 @@ -42,8 +42,13 @@ #include #include +#include +#include +#include +#include #include +#include #include "usbdevs.h" #include @@ -54,12 +59,14 @@ #define ANY 0xffff -static const struct usbd_quirk_entry { +struct usbd_quirk_entry { u_int16_t idVendor; u_int16_t idProduct; u_int16_t bcdDevice; struct usbd_quirks quirks; -} usb_quirks[] = { +}; + +static struct usbd_quirk_entry usb_quirks[] = { { USB_VENDOR_INSIDEOUT, USB_PRODUCT_INSIDEOUT_EDGEPORT4, 0x094, { UQ_SWAP_UNICODE}}, { USB_VENDOR_DALLAS, USB_PRODUCT_DALLAS_J6502, 0x0a2, { UQ_BAD_ADC }}, @@ -117,15 +124,24 @@ const struct usbd_quirks usbd_no_quirk = { 0 }; -const struct usbd_quirks * -usbd_find_quirk(usb_device_descriptor_t *d) +#define MAX_DYNAMIC_USB_QUIRKS 10 +#define ENVNAMEROOT "usb.quirk." +#define SEPCHAR "|" + +static struct usbd_quirk_entry dynamic_usb_quirks[MAX_DYNAMIC_USB_QUIRKS]; + +static struct usbd_quirks * +usbd_search_quirk(struct usbd_quirk_entry *quirks, usb_device_descriptor_t *d); + +static struct usbd_quirks * +usbd_search_quirk(struct usbd_quirk_entry *quirks, usb_device_descriptor_t *d) { - const struct usbd_quirk_entry *t; + struct usbd_quirk_entry *t; u_int16_t vendor = UGETW(d->idVendor); u_int16_t product = UGETW(d->idProduct); u_int16_t revision = UGETW(d->bcdDevice); - for (t = usb_quirks; t->idVendor != 0; t++) { + for (t = quirks; t->idVendor != 0; t++) { if (t->idVendor == vendor && t->idProduct == product && (t->bcdDevice == ANY || t->bcdDevice == revision)) @@ -139,3 +155,150 @@ #endif return (&t->quirks); } + +struct mtx dyn_mtx; + +const struct usbd_quirks * +usbd_find_quirk(usb_device_descriptor_t *d) +{ + struct usbd_quirks *quirks; + /* although it should NEVER happen that this routine is called */ + /* before the populate routine has been called, we check that */ + /* the initialisation of the mutex has occured */ + if (mtx_initialized(&dyn_mtx)) + { + /* check the dynamic quirks list first for local entries */ + mtx_lock(&dyn_mtx); + quirks = usbd_search_quirk((struct usbd_quirk_entry *) dynamic_usb_quirks, d); + mtx_unlock(&dyn_mtx); + if (quirks->uq_flags != 0) + return quirks; + } + /* check the compiled in quirks list if dynamic entry not set */ + return(usbd_search_quirk((struct usbd_quirk_entry *) usb_quirks, d)); +} + +void usbd_populate_dynamic_quirks() +{ + /* the size of envkey must exceed the length of ENVNAMEROOT */ + /* and the maximum number of digits in MAX_DYNAMIC_USB_QUIRKS plus 1 */ + /* as the environment size is limitted to 512 entries and a maximum */ + /* of 128 usb devices are supported 3 digits is appropriate for + all valid values of MAX_DYNAMIC_USB_QUIRKS */ + const int envkeysz = strlen(ENVNAMEROOT)+3+1; + char envkey[envkeysz]; + int i; + char *env; + char *pt; + char *e; + int n; + /* this routine should be first called well before any USB */ + /* busses or devices are detected */ + if (!mtx_initialized(&dyn_mtx)) + mtx_init(&dyn_mtx, "usb_dynquirks", NULL, MTX_DEF); + mtx_lock(&dyn_mtx); + for (i=0; i diff -rNu /usr/src/usr.bin/usbquirksload/usbquirksload.1 /scratch/src/usr.bin/usbquirksload/usbquirksload.1 --- /usr/src/usr.bin/usbquirksload/usbquirksload.1 1970-01-01 10:00:00.000000000 +1000 +++ /scratch/src/usr.bin/usbquirksload/usbquirksload.1 2008-04-17 10:44:32.000000000 +1000 @@ -0,0 +1,50 @@ +.\" $FreeBSD$ +.\" +.\" Copyright (c) 2008 The FreeBSD Project. +.\" All rights reserved. +.\" +.\" This code is derived from software contributed to the FreeBSD Project +.\" by Maurice Castro. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE FREEBSD PROJECT AND CONTRIBUTORS +.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED +.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS +.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +.\" POSSIBILITY OF SUCH DAMAGE. +.\" +.Dd April 17, 2008 +.Dt USBQUIRKSLOAD 1 +.Os +.Sh NAME +.Nm usbquirksload +.Nd Load usb dynamic quirks table from environment data +.Sh SYNOPSIS +.Nm +.Sh DESCRIPTION +The +.Nm +utility loads the kernel's dynamic quirks table from strings contained in +the kernel environment. +.Sh SEE ALSO +.Xr usb 4 +.Xr kenv 1 +.Sh HISTORY +The +.Nm +command appeared in +.Fx 7.0 . diff -rNu /usr/src/usr.bin/usbquirksload/usbquirksload.c /scratch/src/usr.bin/usbquirksload/usbquirksload.c --- /usr/src/usr.bin/usbquirksload/usbquirksload.c 1970-01-01 10:00:00.000000000 +1000 +++ /scratch/src/usr.bin/usbquirksload/usbquirksload.c 2008-04-17 10:40:13.000000000 +1000 @@ -0,0 +1,54 @@ +/* + * Copyright (c) 2008 The FreeBSD Project. + * All rights reserved. + * + * This code is derived from software contributed to the FreeBSD Project + * by Maurice Castro. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE FREEBSD PROJECT AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * $FreeBSD$ + */ + +#include +#include +#include +#include +#include + +int main(int argc, char *argv[]) +{ + int d, r; + d = open("/dev/usb0", O_RDONLY); + if (d == -1) + { + perror(argv[0]); + exit(1); + } + r = ioctl(d, USB_SETDYNQUIRKS, 0); + if (r == -1) + { + perror(argv[0]); + exit(2); + } + close(d); + exit(0); +} --Apple-Mail-2-311066617 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit --Apple-Mail-2-311066617-- From owner-freebsd-usb@FreeBSD.ORG Thu Apr 17 07:34:49 2008 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 48E14106564A for ; Thu, 17 Apr 2008 07:34:49 +0000 (UTC) (envelope-from freebsd@insightbb.com) Received: from mxsf05.insightbb.com (mxsf05.insightbb.com [74.128.0.75]) by mx1.freebsd.org (Postfix) with ESMTP id 0AF248FC24 for ; Thu, 17 Apr 2008 07:34:48 +0000 (UTC) (envelope-from freebsd@insightbb.com) X-IronPort-AV: E=Sophos;i="4.25,669,1199682000"; d="scan'208";a="330056498" Received: from unknown (HELO asav00.insightbb.com) ([172.31.249.124]) by mxsf05.insightbb.com with ESMTP; 17 Apr 2008 03:05:45 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AuAAAPeTBkjQLicL/2dsb2JhbAAIrR4 X-IronPort-AV: E=Sophos;i="4.25,670,1199682000"; d="scan'208";a="171088236" Received: from 208-46-39-11.dia.static.qwest.net (HELO [10.7.44.57]) ([208.46.39.11]) by asavout00.insightbb.com with ESMTP; 17 Apr 2008 03:05:45 -0400 From: Steven Friedrich To: freebsd-usb@freebsd.org Date: Thu, 17 Apr 2008 03:05:42 -0400 User-Agent: KMail/1.9.7 References: <4909786.409461@sourceforge.net> In-Reply-To: <4909786.409461@sourceforge.net> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200804170305.43300.freebsd@insightbb.com> Subject: Re: [gutenprint - Help] RE: FreeBSD 7.0-RELEASE+CUPS+gutenprint+Epson X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Apr 2008 07:34:49 -0000 On Wednesday 16 April 2008 08:10:14 pm SourceForge.net wrote: > Read and respond to this message at: > https://sourceforge.net/forum/message.php?msg_id=4909786 > By: lexort > > With my changes to NetBSD-current, reading works. I was suggesting making > cups not read at all in case bringing that patch over was too daunting. > > ______________________________________________________________________ > You are receiving this email because you elected to monitor this forum. > To stop monitoring this forum, login to SourceForge.net and visit: > https://sourceforge.net/forum/unmonitor.php?forum_id=409461 Do we have a USB guru who could work with Greg Troxel (https://sourceforge.net/sendmessage.php?touser=195727) and debug the problem with printing to a USB connected printer? From owner-freebsd-usb@FreeBSD.ORG Thu Apr 17 11:31:10 2008 Return-Path: Delivered-To: freebsd-usb@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1659C1065672; Thu, 17 Apr 2008 11:31:10 +0000 (UTC) (envelope-from linimon@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id E53228FC27; Thu, 17 Apr 2008 11:31:09 +0000 (UTC) (envelope-from linimon@FreeBSD.org) Received: from freefall.freebsd.org (linimon@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.2/8.14.2) with ESMTP id m3HBV9cv006312; Thu, 17 Apr 2008 11:31:09 GMT (envelope-from linimon@freefall.freebsd.org) Received: (from linimon@localhost) by freefall.freebsd.org (8.14.2/8.14.1/Submit) id m3HBV9hS006308; Thu, 17 Apr 2008 11:31:09 GMT (envelope-from linimon) Date: Thu, 17 Apr 2008 11:31:09 GMT Message-Id: <200804171131.m3HBV9hS006308@freefall.freebsd.org> To: romerogordon@telefonica.net, linimon@FreeBSD.org, freebsd-usb@FreeBSD.org From: linimon@FreeBSD.org Cc: Subject: Re: usb/122621: [patch] [request] New driver for Sierra Wireless 3G USM modem 875U X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Apr 2008 11:31:10 -0000 Synopsis: [patch] [request] New driver for Sierra Wireless 3G USM modem 875U State-Changed-From-To: feedback->open State-Changed-By: linimon State-Changed-When: Thu Apr 17 11:27:15 UTC 2008 State-Changed-Why: Note that feedback was received. http://www.freebsd.org/cgi/query-pr.cgi?pr=122621 From owner-freebsd-usb@FreeBSD.ORG Thu Apr 17 15:06:32 2008 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8C8C0106564A; Thu, 17 Apr 2008 15:06:32 +0000 (UTC) (envelope-from avg@icyb.net.ua) Received: from falcon.cybervisiontech.com (falcon.cybervisiontech.com [217.20.163.9]) by mx1.freebsd.org (Postfix) with ESMTP id 029A38FC24; Thu, 17 Apr 2008 15:06:31 +0000 (UTC) (envelope-from avg@icyb.net.ua) Received: from localhost (localhost [127.0.0.1]) by falcon.cybervisiontech.com (Postfix) with ESMTP id 2F91E43DF9B; Thu, 17 Apr 2008 18:06:30 +0300 (EEST) X-Virus-Scanned: Debian amavisd-new at falcon.cybervisiontech.com Received: from falcon.cybervisiontech.com ([127.0.0.1]) by localhost (falcon.cybervisiontech.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id kQ57qe9KBH6i; Thu, 17 Apr 2008 18:06:30 +0300 (EEST) Received: from [10.2.1.87] (gateway.cybervisiontech.com.ua [88.81.251.18]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by falcon.cybervisiontech.com (Postfix) with ESMTP id 7D33243C478; Thu, 17 Apr 2008 18:06:29 +0300 (EEST) Message-ID: <48076774.4090602@icyb.net.ua> Date: Thu, 17 Apr 2008 18:06:28 +0300 From: Andriy Gapon User-Agent: Thunderbird 2.0.0.12 (X11/20080311) MIME-Version: 1.0 To: Paul Schmehl References: <1207959807.00055755.1207949401@10.7.7.3> <1208046195.00056100.1208036121@10.7.7.3> <539c60b90804141549u6a138ad9u9c77bbfcbbad0ff3@mail.gmail.com> <20080415175347.GA29045@slackbox.xs4all.nl> <539c60b90804151134q7a25a141m1205a1b04d8ffc2c@mail.gmail.com> <20080415192028.GA31706@slackbox.xs4all.nl> <539c60b90804160910q3a242d7amb474b40065d6c9c6@mail.gmail.com> <1208373797.00057829.1208362805@10.7.7.3> <48071956.2090103@icyb.net.ua> <767FB33508C0E8E4E3CAA61A@utd65257.utdallas.edu> In-Reply-To: <767FB33508C0E8E4E3CAA61A@utd65257.utdallas.edu> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: freebsd-scsi@freebsd.org, freebsd-stable@freebsd.org, freebsd-usb@freebsd.org Subject: Re: umass causes panic on 7 amd64 X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Apr 2008 15:06:32 -0000 on 17/04/2008 17:56 Paul Schmehl said the following: > > I wish I had a core file to analyze. *Every* time I reboot my machine, I have > to disconnect my usb drive. Then I have to remount it after I'm back up and > running. If I leave it connected during the reboot, I get the same kind of > errors that were posted by Steve. After the system is up and running, umass is > detected normally and I can mount and use the drive with no problems. I'm on > i386, so it doesn't look like an AMD-specific problem. > > # uname -a > FreeBSD utd65257.utdallas.edu 7.0-STABLE FreeBSD 7.0-STABLE #6: Wed Apr 16 > 17:14:28 CDT 2008 utd65257.utdallas.edu:/usr/obj/usr/src/sys/GENERIC i386 > > I've rebuilt kernel and world six times in the hopes that recent src updates > would fix the problem. > > Unfortunately, since the error occurs during boot, I know of no way to capture > the error message. If I log console would that do it? I doubt the console is > logging at that point. I don't think syslogd is even running yet. > Eh I think I saw something like this myself. Do you by a chance have that new device sg in your kernel? I assume you do (GENERIC) - try to drop it. I am not sure if this is some brokenness of that driver or fighting of several USB drivers over the same hardware. P.S. sorry for the wide broadcast, but I think that users on all 3 lists might be interested. -- Andriy Gapon From owner-freebsd-usb@FreeBSD.ORG Thu Apr 17 15:37:50 2008 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 47AC8106566C; Thu, 17 Apr 2008 15:37:50 +0000 (UTC) (envelope-from avg@icyb.net.ua) Received: from falcon.cybervisiontech.com (falcon.cybervisiontech.com [217.20.163.9]) by mx1.freebsd.org (Postfix) with ESMTP id B24988FC14; Thu, 17 Apr 2008 15:37:49 +0000 (UTC) (envelope-from avg@icyb.net.ua) Received: from localhost (localhost [127.0.0.1]) by falcon.cybervisiontech.com (Postfix) with ESMTP id 68672744009; Thu, 17 Apr 2008 18:37:48 +0300 (EEST) X-Virus-Scanned: Debian amavisd-new at falcon.cybervisiontech.com Received: from falcon.cybervisiontech.com ([127.0.0.1]) by localhost (falcon.cybervisiontech.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 7VYLjk1KJSpA; Thu, 17 Apr 2008 18:37:48 +0300 (EEST) Received: from [10.2.1.87] (gateway.cybervisiontech.com.ua [88.81.251.18]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by falcon.cybervisiontech.com (Postfix) with ESMTP id 37B4643D7DD; Thu, 17 Apr 2008 18:37:46 +0300 (EEST) Message-ID: <48076EC9.4090002@icyb.net.ua> Date: Thu, 17 Apr 2008 18:37:45 +0300 From: Andriy Gapon User-Agent: Thunderbird 2.0.0.12 (X11/20080311) MIME-Version: 1.0 To: Paul Schmehl References: <1207959807.00055755.1207949401@10.7.7.3> <1208046195.00056100.1208036121@10.7.7.3> <539c60b90804141549u6a138ad9u9c77bbfcbbad0ff3@mail.gmail.com> <20080415175347.GA29045@slackbox.xs4all.nl> <539c60b90804151134q7a25a141m1205a1b04d8ffc2c@mail.gmail.com> <20080415192028.GA31706@slackbox.xs4all.nl> <539c60b90804160910q3a242d7amb474b40065d6c9c6@mail.gmail.com> <1208373797.00057829.1208362805@10.7.7.3> <48071956.2090103@icyb.net.ua> <767FB33508C0E8E4E3CAA61A@utd65257.utdallas.edu> <48076774.4090602@icyb.net.ua> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: freebsd-scsi@freebsd.org, freebsd-stable@freebsd.org, freebsd-usb@freebsd.org Subject: Re: umass causes panic on 7 amd64 X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Apr 2008 15:37:50 -0000 on 17/04/2008 18:31 Paul Schmehl said the following: > --On Thursday, April 17, 2008 18:06:28 +0300 Andriy Gapon > wrote: > >> on 17/04/2008 17:56 Paul Schmehl said the following: >>> I wish I had a core file to analyze. *Every* time I reboot my machine, I >>> have to disconnect my usb drive. Then I have to remount it after I'm back >>> up and running. If I leave it connected during the reboot, I get the same >>> kind of errors that were posted by Steve. After the system is up and >>> running, umass is detected normally and I can mount and use the drive with >>> no problems. I'm on i386, so it doesn't look like an AMD-specific problem. >>> >>> # uname -a >>> FreeBSD utd65257.utdallas.edu 7.0-STABLE FreeBSD 7.0-STABLE #6: Wed Apr 16 >>> 17:14:28 CDT 2008 utd65257.utdallas.edu:/usr/obj/usr/src/sys/GENERIC >>> i386 >>> >>> I've rebuilt kernel and world six times in the hopes that recent src updates >>> would fix the problem. >>> >>> Unfortunately, since the error occurs during boot, I know of no way to >>> capture the error message. If I log console would that do it? I doubt the >>> console is logging at that point. I don't think syslogd is even running >>> yet. >>> >> Eh I think I saw something like this myself. >> Do you by a chance have that new device sg in your kernel? >> I assume you do (GENERIC) - try to drop it. >> I am not sure if this is some brokenness of that driver or fighting of >> several USB drivers over the same hardware. >> >> P.S. sorry for the wide broadcast, but I think that users on all 3 lists >> might be interested. > > This is all I have in my GENERIC conf file: > > # grep -i sg /usr/src/sys/i386/conf/GENERIC > options SYSVMSG # SYSV-style message queues > I see. Then maybe sg was a red herring in my case. -- Andriy Gapon From owner-freebsd-usb@FreeBSD.ORG Thu Apr 17 16:01:51 2008 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E5E5D106566C; Thu, 17 Apr 2008 16:01:51 +0000 (UTC) (envelope-from pauls@utdallas.edu) Received: from smtp3.utdallas.edu (smtp3.utdallas.edu [129.110.10.49]) by mx1.freebsd.org (Postfix) with ESMTP id C70668FC19; Thu, 17 Apr 2008 16:01:51 +0000 (UTC) (envelope-from pauls@utdallas.edu) Received: from utd65257.utdallas.edu (utd65257.utdallas.edu [129.110.3.28]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp3.utdallas.edu (Postfix) with ESMTP id D6BE465504; Thu, 17 Apr 2008 10:31:39 -0500 (CDT) Date: Thu, 17 Apr 2008 10:31:39 -0500 From: Paul Schmehl To: Andriy Gapon Message-ID: In-Reply-To: <48076774.4090602@icyb.net.ua> References: <1207959807.00055755.1207949401@10.7.7.3> <1208046195.00056100.1208036121@10.7.7.3> <539c60b90804141549u6a138ad9u9c77bbfcbbad0ff3@mail.gmail.com> <20080415175347.GA29045@slackbox.xs4all.nl> <539c60b90804151134q7a25a141m1205a1b04d8ffc2c@mail.gmail.com> <20080415192028.GA31706@slackbox.xs4all.nl> <539c60b90804160910q3a242d7amb474b40065d6c9c6@mail.gmail.com> <1208373797.00057829.1208362805@10.7.7.3> <48071956.2090103@icyb.net.ua> <767FB33508C0E8E4E3CAA61A@utd65257.utdallas.edu> <48076774.4090602@icyb.net.ua> X-Mailer: Mulberry/4.0.8 (Linux/x86) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline Cc: freebsd-scsi@freebsd.org, freebsd-stable@freebsd.org, freebsd-usb@freebsd.org Subject: Re: umass causes panic on 7 amd64 X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Apr 2008 16:01:52 -0000 --On Thursday, April 17, 2008 18:06:28 +0300 Andriy Gapon wrote: > on 17/04/2008 17:56 Paul Schmehl said the following: >> >> I wish I had a core file to analyze. *Every* time I reboot my machine, I >> have to disconnect my usb drive. Then I have to remount it after I'm back >> up and running. If I leave it connected during the reboot, I get the same >> kind of errors that were posted by Steve. After the system is up and >> running, umass is detected normally and I can mount and use the drive with >> no problems. I'm on i386, so it doesn't look like an AMD-specific problem. >> >> # uname -a >> FreeBSD utd65257.utdallas.edu 7.0-STABLE FreeBSD 7.0-STABLE #6: Wed Apr 16 >> 17:14:28 CDT 2008 utd65257.utdallas.edu:/usr/obj/usr/src/sys/GENERIC >> i386 >> >> I've rebuilt kernel and world six times in the hopes that recent src updates >> would fix the problem. >> >> Unfortunately, since the error occurs during boot, I know of no way to >> capture the error message. If I log console would that do it? I doubt the >> console is logging at that point. I don't think syslogd is even running >> yet. >> > > Eh I think I saw something like this myself. > Do you by a chance have that new device sg in your kernel? > I assume you do (GENERIC) - try to drop it. > I am not sure if this is some brokenness of that driver or fighting of > several USB drivers over the same hardware. > > P.S. sorry for the wide broadcast, but I think that users on all 3 lists > might be interested. This is all I have in my GENERIC conf file: # grep -i sg /usr/src/sys/i386/conf/GENERIC options SYSVMSG # SYSV-style message queues -- Paul Schmehl (pauls@utdallas.edu) Senior Information Security Analyst The University of Texas at Dallas http://www.utdallas.edu/ir/security/ From owner-freebsd-usb@FreeBSD.ORG Thu Apr 17 16:45:48 2008 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B0235106566B for ; Thu, 17 Apr 2008 16:45:48 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe13.swip.net [212.247.155.129]) by mx1.freebsd.org (Postfix) with ESMTP id 2221D8FC18 for ; Thu, 17 Apr 2008 16:45:47 +0000 (UTC) (envelope-from hselasky@c2i.net) X-Cloudmark-Score: 0.000000 [] Received: from [62.113.133.152] (account mc467741@c2i.net [62.113.133.152] verified) by mailfe13.swip.net (CommuniGate Pro SMTP 5.1.13) with ESMTPA id 512112563; Thu, 17 Apr 2008 18:45:37 +0200 From: Hans Petter Selasky To: freebsd-usb@freebsd.org, Maurice Castro Date: Thu, 17 Apr 2008 18:46:48 +0200 User-Agent: KMail/1.9.7 References: <200804170310.m3H3A3gP048390@freefall.freebsd.org> In-Reply-To: <200804170310.m3H3A3gP048390@freefall.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200804171846.49169.hselasky@c2i.net> Cc: Subject: Re: usb/122819: Patch to provide dynamic additions to the usb quirks table X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Apr 2008 16:45:48 -0000 Hi, You need to do a little bit more work regarding the token naming. There is no USB module called "UAU". Instead of "UAU_NO_FRAC" I think you should have changed it to "UAUDIO_NO_FRAC". The same applies for most of the other quirk tokens aswell. "UHID_IGNORE" is fine. Search the kernel sources for where these tokens are used to figure out the module name: find /usr/src/sys -name "*.c" -and -exec grep -H AU_NO_FRAC {} \; Else your changes are OK. --HPS On Thursday 17 April 2008, Maurice Castro wrote: > The following reply was made to PR usb/122819; it has been noted by GNATS. > --Apple-Mail-2-311066617 > Content-Disposition: attachment; > filename=usb.diff > Content-Type: application/octet-stream; > x-unix-mode=0644; > name="usb.diff" > Content-Transfer-Encoding: 7bit > > diff -ru /usr/src/share/man/man4/usb.4 /scratch/src/share/man/man4/usb.4 > --- /usr/src/share/man/man4/usb.4 2008-04-11 22:43:31.000000000 +1000 > +++ /scratch/src/share/man/man4/usb.4 2008-04-17 08:39:01.000000000 +1000 > @@ -288,6 +288,66 @@ > .Em DANGEROUS > and should be used with great care since it > can destroy the bus integrity. > +.It Dv USB_SETDYNQUIRKS > +This command will cause the dynamic quirks table to be rebuilt from the > +contents of the kernel environment. Environment strings of the form > +.Pp > +.Ic usb.quirk.N="VENDOR PRODUCT REVISION FLAGS" > +.Pp > +where > +.Ic N > +is a number between 0 and 9 and quirks must be numbered contiguously; > +.Ic VENDOR PRODUCT > +and > +.Ic REVISION > +are constants that identify the device (the value 0xffff for > +.Ic REVISION > +denotes all revisions); and > +.Ic FLAGS > +is any combination of > +.Bl -tag -width "UOPEN_CLEARSTALL" -compact -offset indent > +.It USWAP_UNICODE > +has some Unicode strings swapped. > +.It UMS_REVZ > +mouse has Z-axis reversed > +.It UNO_STRINGS > +string descriptors are broken. > +.It UBAD_ADC > +bad audio spec version number. > +.It UBUS_POWERED > +device is bus powered, despite claim > +.It UBAD_AUDIO > +device claims audio class, but isn't > +.It USPUR_BUT_UP > +spurious mouse button up events > +.It UAU_NO_XU > +audio device has broken extension unit > +.It UPOWER_CLAIM > +hub lies about power status > +.It UAU_NO_FRAC > +don't adjust for fractional samples > +.It UAU_INP_ASYNC > +input is async despite claim of adaptive > +.It UBROKEN_BIDIR > +printer has broken bidir mode > +.It UOPEN_CLEARSTALL > +device needs clear endpoint stall > +.It UHID_IGNORE > +device should be ignored by hid class > +.It UKBD_IGNORE > +device should be ignored by both kbd and hid class > +.It UMS_BAD_CLASS > +doesn't identify properly > +.It UMS_LEADING_BYTE > +mouse sends an unknown leading byte. From owner-freebsd-usb@FreeBSD.ORG Thu Apr 17 18:51:27 2008 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 29AEE106566B for ; Thu, 17 Apr 2008 18:51:27 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id D319E8FC16 for ; Thu, 17 Apr 2008 18:51:26 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.2/8.14.1) with ESMTP id m3HImKsp044635; Thu, 17 Apr 2008 12:48:20 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Thu, 17 Apr 2008 12:49:18 -0600 (MDT) Message-Id: <20080417.124918.-1929116202.imp@bsdimp.com> To: hselasky@c2i.net From: "M. Warner Losh" In-Reply-To: <200804171846.49169.hselasky@c2i.net> References: <200804170310.m3H3A3gP048390@freefall.freebsd.org> <200804171846.49169.hselasky@c2i.net> X-Mailer: Mew version 5.2 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: maurice@castro.aus.net, freebsd-usb@freebsd.org Subject: Re: usb/122819: Patch to provide dynamic additions to the usb quirks table X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Apr 2008 18:51:27 -0000 In message: <200804171846.49169.hselasky@c2i.net> Hans Petter Selasky writes: : You need to do a little bit more work regarding the token naming. There is no : USB module called "UAU". Instead of "UAU_NO_FRAC" I think you should have : changed it to "UAUDIO_NO_FRAC". The same applies for most of the other quirk : tokens aswell. "UHID_IGNORE" is fine. : : Search the kernel sources for where these tokens are used to figure out the : module name: : : find /usr/src/sys -name "*.c" -and -exec grep -H AU_NO_FRAC {} \; : : Else your changes are OK. I don't suppose there's some way to automatically generate these things? I like the idea... Warner : --HPS : : On Thursday 17 April 2008, Maurice Castro wrote: : > The following reply was made to PR usb/122819; it has been noted by GNATS. : : > --Apple-Mail-2-311066617 : > Content-Disposition: attachment; : > filename=usb.diff : > Content-Type: application/octet-stream; : > x-unix-mode=0644; : > name="usb.diff" : > Content-Transfer-Encoding: 7bit : > : > diff -ru /usr/src/share/man/man4/usb.4 /scratch/src/share/man/man4/usb.4 : > --- /usr/src/share/man/man4/usb.4 2008-04-11 22:43:31.000000000 +1000 : > +++ /scratch/src/share/man/man4/usb.4 2008-04-17 08:39:01.000000000 +1000 : > @@ -288,6 +288,66 @@ : > .Em DANGEROUS : > and should be used with great care since it : > can destroy the bus integrity. : > +.It Dv USB_SETDYNQUIRKS : > +This command will cause the dynamic quirks table to be rebuilt from the : > +contents of the kernel environment. Environment strings of the form : > +.Pp : > +.Ic usb.quirk.N="VENDOR PRODUCT REVISION FLAGS" : > +.Pp : > +where : > +.Ic N : > +is a number between 0 and 9 and quirks must be numbered contiguously; : > +.Ic VENDOR PRODUCT : > +and : > +.Ic REVISION : > +are constants that identify the device (the value 0xffff for : > +.Ic REVISION : > +denotes all revisions); and : > +.Ic FLAGS : > +is any combination of : > +.Bl -tag -width "UOPEN_CLEARSTALL" -compact -offset indent : > +.It USWAP_UNICODE : > +has some Unicode strings swapped. : > +.It UMS_REVZ : > +mouse has Z-axis reversed : > +.It UNO_STRINGS : > +string descriptors are broken. : > +.It UBAD_ADC : > +bad audio spec version number. : > +.It UBUS_POWERED : > +device is bus powered, despite claim : > +.It UBAD_AUDIO : > +device claims audio class, but isn't : > +.It USPUR_BUT_UP : > +spurious mouse button up events : > +.It UAU_NO_XU : > +audio device has broken extension unit : > +.It UPOWER_CLAIM : > +hub lies about power status : > +.It UAU_NO_FRAC : > +don't adjust for fractional samples : > +.It UAU_INP_ASYNC : > +input is async despite claim of adaptive : > +.It UBROKEN_BIDIR : > +printer has broken bidir mode : > +.It UOPEN_CLEARSTALL : > +device needs clear endpoint stall : > +.It UHID_IGNORE : > +device should be ignored by hid class : > +.It UKBD_IGNORE : > +device should be ignored by both kbd and hid class : > +.It UMS_BAD_CLASS : > +doesn't identify properly : > +.It UMS_LEADING_BYTE : > +mouse sends an unknown leading byte. : : : : _______________________________________________ : freebsd-usb@freebsd.org mailing list : http://lists.freebsd.org/mailman/listinfo/freebsd-usb : To unsubscribe, send any mail to "freebsd-usb-unsubscribe@freebsd.org" : : From owner-freebsd-usb@FreeBSD.ORG Fri Apr 18 00:00:07 2008 Return-Path: Delivered-To: freebsd-usb@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BC76D1065670 for ; Fri, 18 Apr 2008 00:00:07 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id A38BE8FC14 for ; Fri, 18 Apr 2008 00:00:07 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.2/8.14.2) with ESMTP id m3I004Ul000490 for ; Fri, 18 Apr 2008 00:00:04 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.2/8.14.1/Submit) id m3I004WD000489; Fri, 18 Apr 2008 00:00:04 GMT (envelope-from gnats) Date: Fri, 18 Apr 2008 00:00:04 GMT Message-Id: <200804180000.m3I004WD000489@freefall.freebsd.org> To: freebsd-usb@FreeBSD.org From: Maurice Castro Cc: Subject: Re: usb/122819: Patch to provide dynamic additions to the usb quirks table X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Maurice Castro List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Apr 2008 00:00:07 -0000 The following reply was made to PR usb/122819; it has been noted by GNATS. From: Maurice Castro To: bug-followup@FreeBSD.org, maurice@castro.aus.net Cc: Subject: Re: usb/122819: Patch to provide dynamic additions to the usb quirks table Date: Fri, 18 Apr 2008 09:55:05 +1000 --Apple-Mail-4-388555214 Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit From: hselasky@c2i.net > You need to do a little bit more work regarding the token naming. > There is no USB module called "UAU". Instead of "UAU_NO_FRAC" I > think you should have changed it to "UAUDIO_NO_FRAC". The same > applies for most of the other quirk tokens aswell. "UHID_IGNORE" is > fine. Hi Hans, changes made as requested. Summary of quirk, module quirk appears in and naming below. Please note that 2 of the quirks appear to be unused. Updated patch attached. Maurice Castro * UQ_SWAP_UNICODE /usr/src/sys/dev/usb/usbdi.c: int swap = dev->quirks->uq_flags & UQ_SWAP_UNICODE; USWAP_UNICODE -> USBDI_SWAP_UNICODE * UQ_NO_STRINGS /usr/src/sys/dev/usb/usbdi.c: if (dev->quirks->uq_flags & UQ_NO_STRINGS) UNO_STRINGS -> USBDI_NO_STRINGS * UQ_BAD_ADC /usr/src/sys/dev/sound/usb/uaudio.c: if (!(usbd_get_quirks(sc- >sc_udev)->uq_flags & UQ_BAD_ADC) && UBAD_ADC -> UAUDIO_BAD_ADC * UQ_BUS_POWERED /usr/src/sys/dev/usb/usb_subr.c: if (!(dev->quirks->uq_flags & UQ_BUS_POWERED) && UBUS_POWERED -> USB_BUS_POWERED * UQ_BAD_AUDIO /usr/src/sys/dev/sound/usb/uaudio.c: (usbd_get_quirks(uaa- >device)->uq_flags & UQ_BAD_AUDIO)) UBAD_AUDIO -> UAUDIO_BAD_AUDIO * UQ_SPUR_BUT_UP /usr/src/sys/dev/usb/ums.c: if (usbd_get_quirks(uaa->device)- >uq_flags & UQ_SPUR_BUT_UP) { USPUR_BUT_UP -> UMS_SPUR_BUT_UP * UQ_AU_NO_XU /usr/src/sys/dev/sound/usb/uaudio.c: if (usbd_get_quirks(sc- >sc_udev)->uq_flags & UQ_AU_NO_XU) UAU_NO_XU -> UAUDIO_NO_XU * UQ_POWER_CLAIM /usr/src/sys/dev/usb/usb_subr.c: if (dev- >quirks->uq_flags & UQ_POWER_CLAIM) { UPOWER_CLAIM -> USB_POWER_CLAIM * UQ_AU_NO_FRAC /usr/src/sys/dev/sound/usb/uaudio.c: if (usbd_get_quirks(sc- >sc_udev)->uq_flags & UQ_AU_NO_FRAC) UAU_NO_FRAC -> UAUDIO_AU_NO_FRAC * UQ_AU_INP_ASYNC /usr/src/sys/dev/sound/usb/uaudio.c: if ((usbd_get_quirks(sc- >sc_udev)->uq_flags & UQ_AU_INP_ASYNC) && UAU_INP_ASYNC -> UAUDIO_INP_ASYNC * UQ_BROKEN_BIDIR /usr/src/sys/dev/usb/ulpt.c: if (usbd_get_quirks(dev)->uq_flags & UQ_BROKEN_BIDIR) { UBROKEN_BIDIR -> ULPT_BROKEN_BIDIR * UQ_OPEN_CLEARSTALL /usr/src/sys/dev/usb/usb_subr.c: if (dev->quirks->uq_flags & UQ_OPEN_CLEARSTALL) { * UQ_HID_IGNORE /usr/src/sys/dev/usb/uhid.c: if (usbd_get_quirks(uaa->device)- >uq_flags & UQ_HID_IGNORE) UHID_IGNORE -> UHID_IGNORE * UQ_KBD_IGNORE /usr/src/sys/dev/usb/ukbd.c: if (usbd_get_quirks(uaa->device)- >uq_flags & UQ_KBD_IGNORE) UKBD_IGNORE -> UKBD_IGNORE * UQ_MS_BAD_CLASS /usr/src/sys/dev/usb/ums.c: if (usbd_get_quirks(uaa->device)- >uq_flags & UQ_MS_BAD_CLASS) { UMS_BAD_CLASS -> UMS_BAD_CLASS * UQ_MS_REVZ UMS_REVZ -> MS_REVZ * UQ_MS_LEADING_BYTE UMS_LEADING_BYTE -> MS_LEADING_BYTE --Apple-Mail-4-388555214 Content-Disposition: attachment; filename=usb.diff Content-Type: application/octet-stream; x-unix-mode=0644; name="usb.diff" Content-Transfer-Encoding: 7bit diff -ur /usr/src/share/man/man4/usb.4 /scratch/src/share/man/man4/usb.4 --- /usr/src/share/man/man4/usb.4 2008-04-11 22:43:31.000000000 +1000 +++ /scratch/src/share/man/man4/usb.4 2008-04-18 09:38:37.000000000 +1000 @@ -288,6 +288,66 @@ .Em DANGEROUS and should be used with great care since it can destroy the bus integrity. +.It Dv USB_SETDYNQUIRKS +This command will cause the dynamic quirks table to be rebuilt from the +contents of the kernel environment. Environment strings of the form +.Pp +.Ic usb.quirk.N="VENDOR PRODUCT REVISION FLAGS" +.Pp +where +.Ic N +is a number between 0 and 9 and quirks must be numbered contiguously; +.Ic VENDOR PRODUCT +and +.Ic REVISION +are constants that identify the device (the value 0xffff for +.Ic REVISION +denotes all revisions); and +.Ic FLAGS +is any combination of +.Bl -tag -width "UOPEN_CLEARSTALL" -compact -offset indent +.It USBDI_SWAP_UNICODE +has some Unicode strings swapped. +.It USBDI_NO_STRINGS +string descriptors are broken. +.It UAUDIO_BAD_ADC +bad audio spec version number. +.It USB_BUS_POWERED +device is bus powered, despite claim +.It UAUDIO_BAD_AUDIO +device claims audio class, but isn't +.It UMS_SPUR_BUT_UP +spurious mouse button up events +.It UAUDIO_NO_XU +audio device has broken extension unit +.It USB_POWER_CLAIM +hub lies about power status +.It UAUDIO_NO_FRAC +don't adjust for fractional samples +.It UAUDIO_INP_ASYNC +input is async despite claim of adaptive +.It ULPT_BROKEN_BIDIR +printer has broken bidir mode +.It USB_OPEN_CLEARSTALL +device needs clear endpoint stall +.It UHID_IGNORE +device should be ignored by hid class +.It UKBD_IGNORE +device should be ignored by both kbd and hid class +.It UMS_BAD_CLASS +doesn't identify properly +.It MS_LEADING_BYTE +mouse sends an unknown leading byte. +.It MS_REVZ +mouse has Z-axis reversed +.El +separated by "|" characters. These lines set the quirks for each device +identified. +.Pp +The dynamic quirks table is designed to supplement the quirks table built +in to the kernel. It is of particular use to developers working with devices +that inappropriately share vendor, product and revision information and hence +cannot be correctly added in to the kernel's quirks table. .El .Pp The include file diff -ur /usr/src/sys/dev/usb/usb.c /scratch/src/sys/dev/usb/usb.c --- /usr/src/sys/dev/usb/usb.c 2008-04-11 22:43:56.000000000 +1000 +++ /scratch/src/sys/dev/usb/usb.c 2008-04-16 23:23:55.000000000 +1000 @@ -668,6 +668,10 @@ *(struct usb_device_stats *)data = sc->sc_bus->stats; break; + case USB_SETDYNQUIRKS: + usbd_populate_dynamic_quirks(); + break; + default: return (EINVAL); } diff -ur /usr/src/sys/dev/usb/usb.h /scratch/src/sys/dev/usb/usb.h --- /usr/src/sys/dev/usb/usb.h 2008-04-11 22:43:56.000000000 +1000 +++ /scratch/src/sys/dev/usb/usb.h 2008-04-16 23:22:34.000000000 +1000 @@ -673,6 +673,7 @@ #define USB_DISCOVER _IO ('U', 3) #define USB_DEVICEINFO _IOWR('U', 4, struct usb_device_info) #define USB_DEVICESTATS _IOR ('U', 5, struct usb_device_stats) +#define USB_SETDYNQUIRKS _IO ('U', 6) /* Generic HID device */ #define USB_GET_REPORT_DESC _IOR ('U', 21, struct usb_ctl_report_desc) diff -ur /usr/src/sys/dev/usb/usb_quirks.c /scratch/src/sys/dev/usb/usb_quirks.c --- /usr/src/sys/dev/usb/usb_quirks.c 2008-04-11 22:43:56.000000000 +1000 +++ /scratch/src/sys/dev/usb/usb_quirks.c 2008-04-18 09:33:58.000000000 +1000 @@ -42,8 +42,13 @@ #include #include +#include +#include +#include +#include #include +#include #include "usbdevs.h" #include @@ -54,12 +59,14 @@ #define ANY 0xffff -static const struct usbd_quirk_entry { +struct usbd_quirk_entry { u_int16_t idVendor; u_int16_t idProduct; u_int16_t bcdDevice; struct usbd_quirks quirks; -} usb_quirks[] = { +}; + +static struct usbd_quirk_entry usb_quirks[] = { { USB_VENDOR_INSIDEOUT, USB_PRODUCT_INSIDEOUT_EDGEPORT4, 0x094, { UQ_SWAP_UNICODE}}, { USB_VENDOR_DALLAS, USB_PRODUCT_DALLAS_J6502, 0x0a2, { UQ_BAD_ADC }}, @@ -117,15 +124,24 @@ const struct usbd_quirks usbd_no_quirk = { 0 }; -const struct usbd_quirks * -usbd_find_quirk(usb_device_descriptor_t *d) +#define MAX_DYNAMIC_USB_QUIRKS 10 +#define ENVNAMEROOT "usb.quirk." +#define SEPCHAR "|" + +static struct usbd_quirk_entry dynamic_usb_quirks[MAX_DYNAMIC_USB_QUIRKS]; + +static struct usbd_quirks * +usbd_search_quirk(struct usbd_quirk_entry *quirks, usb_device_descriptor_t *d); + +static struct usbd_quirks * +usbd_search_quirk(struct usbd_quirk_entry *quirks, usb_device_descriptor_t *d) { - const struct usbd_quirk_entry *t; + struct usbd_quirk_entry *t; u_int16_t vendor = UGETW(d->idVendor); u_int16_t product = UGETW(d->idProduct); u_int16_t revision = UGETW(d->bcdDevice); - for (t = usb_quirks; t->idVendor != 0; t++) { + for (t = quirks; t->idVendor != 0; t++) { if (t->idVendor == vendor && t->idProduct == product && (t->bcdDevice == ANY || t->bcdDevice == revision)) @@ -139,3 +155,150 @@ #endif return (&t->quirks); } + +struct mtx dyn_mtx; + +const struct usbd_quirks * +usbd_find_quirk(usb_device_descriptor_t *d) +{ + struct usbd_quirks *quirks; + /* although it should NEVER happen that this routine is called */ + /* before the populate routine has been called, we check that */ + /* the initialisation of the mutex has occured */ + if (mtx_initialized(&dyn_mtx)) + { + /* check the dynamic quirks list first for local entries */ + mtx_lock(&dyn_mtx); + quirks = usbd_search_quirk((struct usbd_quirk_entry *) dynamic_usb_quirks, d); + mtx_unlock(&dyn_mtx); + if (quirks->uq_flags != 0) + return quirks; + } + /* check the compiled in quirks list if dynamic entry not set */ + return(usbd_search_quirk((struct usbd_quirk_entry *) usb_quirks, d)); +} + +void usbd_populate_dynamic_quirks() +{ + /* the size of envkey must exceed the length of ENVNAMEROOT */ + /* and the maximum number of digits in MAX_DYNAMIC_USB_QUIRKS plus 1 */ + /* as the environment size is limitted to 512 entries and a maximum */ + /* of 128 usb devices are supported 3 digits is appropriate for + all valid values of MAX_DYNAMIC_USB_QUIRKS */ + const int envkeysz = strlen(ENVNAMEROOT)+3+1; + char envkey[envkeysz]; + int i; + char *env; + char *pt; + char *e; + int n; + /* this routine should be first called well before any USB */ + /* busses or devices are detected */ + if (!mtx_initialized(&dyn_mtx)) + mtx_init(&dyn_mtx, "usb_dynquirks", NULL, MTX_DEF); + mtx_lock(&dyn_mtx); + for (i=0; i diff -rNu /usr/src/usr.bin/usbquirksload/usbquirksload.1 /scratch/src/usr.bin/usbquirksload/usbquirksload.1 --- /usr/src/usr.bin/usbquirksload/usbquirksload.1 1970-01-01 10:00:00.000000000 +1000 +++ /scratch/src/usr.bin/usbquirksload/usbquirksload.1 2008-04-17 10:44:32.000000000 +1000 @@ -0,0 +1,50 @@ +.\" $FreeBSD$ +.\" +.\" Copyright (c) 2008 The FreeBSD Project. +.\" All rights reserved. +.\" +.\" This code is derived from software contributed to the FreeBSD Project +.\" by Maurice Castro. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE FREEBSD PROJECT AND CONTRIBUTORS +.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED +.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS +.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +.\" POSSIBILITY OF SUCH DAMAGE. +.\" +.Dd April 17, 2008 +.Dt USBQUIRKSLOAD 1 +.Os +.Sh NAME +.Nm usbquirksload +.Nd Load usb dynamic quirks table from environment data +.Sh SYNOPSIS +.Nm +.Sh DESCRIPTION +The +.Nm +utility loads the kernel's dynamic quirks table from strings contained in +the kernel environment. +.Sh SEE ALSO +.Xr usb 4 +.Xr kenv 1 +.Sh HISTORY +The +.Nm +command appeared in +.Fx 7.0 . diff -rNu /usr/src/usr.bin/usbquirksload/usbquirksload.c /scratch/src/usr.bin/usbquirksload/usbquirksload.c --- /usr/src/usr.bin/usbquirksload/usbquirksload.c 1970-01-01 10:00:00.000000000 +1000 +++ /scratch/src/usr.bin/usbquirksload/usbquirksload.c 2008-04-17 10:40:13.000000000 +1000 @@ -0,0 +1,54 @@ +/* + * Copyright (c) 2008 The FreeBSD Project. + * All rights reserved. + * + * This code is derived from software contributed to the FreeBSD Project + * by Maurice Castro. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE FREEBSD PROJECT AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * $FreeBSD$ + */ + +#include +#include +#include +#include +#include + +int main(int argc, char *argv[]) +{ + int d, r; + d = open("/dev/usb0", O_RDONLY); + if (d == -1) + { + perror(argv[0]); + exit(1); + } + r = ioctl(d, USB_SETDYNQUIRKS, 0); + if (r == -1) + { + perror(argv[0]); + exit(2); + } + close(d); + exit(0); +} --Apple-Mail-4-388555214 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit --Apple-Mail-4-388555214-- From owner-freebsd-usb@FreeBSD.ORG Sat Apr 19 16:28:35 2008 Return-Path: Delivered-To: freebsd-usb@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5B3B01065673 for ; Sat, 19 Apr 2008 16:28:35 +0000 (UTC) (envelope-from fkr@ripley.bytemine.net) Received: from min.bytemine.net (min.bytemine.net [134.106.146.209]) by mx1.freebsd.org (Postfix) with ESMTP id 0C92C8FC22 for ; Sat, 19 Apr 2008 16:28:35 +0000 (UTC) (envelope-from fkr@ripley.bytemine.net) Received: from [134.106.146.206] (port=54437 helo=nostromo.bytemine.net) by min.bytemine.net with esmtps (TLSv1:AES256-SHA:256) (Exim 4.63) (envelope-from ) id 1JnFPi-0004wW-GJ; Sat, 19 Apr 2008 17:55:42 +0200 Received: from [192.168.5.10] (helo=ripley.bytemine.net ident=_exim) by nostromo.bytemine.net with esmtp (Exim 4.69) (envelope-from ) id 1JnFSb-0006eN-GV; Sat, 19 Apr 2008 17:58:41 +0200 Received: from fkr by ripley.bytemine.net with local (Exim 4.69) (envelope-from ) id 1JnFSa-0003U0-4b; Sat, 19 Apr 2008 17:58:40 +0200 Date: Sat, 19 Apr 2008 17:58:40 +0200 From: Felix Kronlage To: Volker Message-ID: <20080419155840.GD18299@ripley.bytemine.net> References: <200804112040.m3BKe2RU084756@freefall.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="/9DWx/yDrRhgMJTb" Content-Disposition: inline In-Reply-To: <200804112040.m3BKe2RU084756@freefall.freebsd.org> Organisation: bytemine - http://www.bytemine.net/ User-Agent: Mutt/1.5.17 (2007-11-01) Cc: freebsd-usb@FreeBSD.org Subject: Re: usb/122621: New driver for Sierra Wireless 3G USM modem 875U X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Apr 2008 16:28:35 -0000 --/9DWx/yDrRhgMJTb Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Apr 11, 2008 at 08:40:02PM +0000, Volker wrote: > I haven't checked your code line by line carefully but what's the reason > for not just including support for this device into ubsa? the device id seem to be the same as for Sierra Wireless MC8775[1], so a seperate driver is likely not needed. felix [1] | fkr(ripley):sys/dev/usb %> grep 0x6812 usbdevs | product SIERRA MC8775 0x6812 MC8775 HSDPA (usbdevs from OpenBSD) --=20 GPG/PGP: D9AC74D0 / 076E 1E87 3E05 1C7F B1A0 8A48 0D31 9BD3 D9AC 74D0 http://hazardous.org/~fkr - fkr@hazardous.org - fkr@silc|irc - FKR-RIPE https://www.bytemine.net/ - bytemine - BSD based Hosting/Solutions/Ideas --/9DWx/yDrRhgMJTb Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.8 (OpenBSD) iD8DBQFIChawDTGb09msdNARAiOVAJ9o8Tm2cpFnW0SUqspyCdDB7WJFeQCfQPrY 2qFjn8QOhAx5LX5xq/JHjjQ= =UIba -----END PGP SIGNATURE----- --/9DWx/yDrRhgMJTb-- From owner-freebsd-usb@FreeBSD.ORG Sat Apr 19 22:00:10 2008 Return-Path: Delivered-To: freebsd-usb@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5D5571065671 for ; Sat, 19 Apr 2008 22:00:10 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 348B28FC22 for ; Sat, 19 Apr 2008 22:00:10 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.2/8.14.2) with ESMTP id m3JM0AdM017320 for ; Sat, 19 Apr 2008 22:00:10 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.2/8.14.1/Submit) id m3JM0AVj017319; Sat, 19 Apr 2008 22:00:10 GMT (envelope-from gnats) Date: Sat, 19 Apr 2008 22:00:10 GMT Message-Id: <200804192200.m3JM0AVj017319@freefall.freebsd.org> To: freebsd-usb@FreeBSD.org From: Pegasus Mc cleaft Cc: Subject: Re: usb/122547: [ehci] USB Printer not being recognized after reboot X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Pegasus Mc cleaft List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Apr 2008 22:00:10 -0000 The following reply was made to PR usb/122547; it has been noted by GNATS. From: Pegasus Mc cleaft To: bug-followup@freebsd.org, ken@mthelicon.com Cc: Subject: Re: usb/122547: [ehci] USB Printer not being recognized after reboot Date: Sat, 19 Apr 2008 22:59:19 +0100 Found something interesting. If you add a USB hub between the PC and the devices that are not recognised on boot up, they will be polled correctly after reboot.