From owner-freebsd-usb@FreeBSD.ORG Sun Sep 4 11:26:55 2005 Return-Path: X-Original-To: freebsd-usb@freebsd.org Delivered-To: freebsd-usb@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6935916A41F for ; Sun, 4 Sep 2005 11:26:55 +0000 (GMT) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe01.swip.net [212.247.154.1]) by mx1.FreeBSD.org (Postfix) with ESMTP id 55EB243D46 for ; Sun, 4 Sep 2005 11:26:53 +0000 (GMT) (envelope-from hselasky@c2i.net) X-T2-Posting-ID: Y1QAsIk9O44SO+J/q9KNyQ== Received: from mp-216-89-246.daxnet.no ([193.216.89.246] verified) by mailfe01.swip.net (CommuniGate Pro SMTP 4.3.4) with ESMTP id 54644590; Sun, 04 Sep 2005 13:26:50 +0200 From: Hans Petter Selasky To: jpandrusky@gmail.com, freebsd-usb@freebsd.org Date: Sun, 4 Sep 2005 13:27:42 +0200 User-Agent: KMail/1.7 References: <200508261423.46583.hselasky@c2i.net> <1125777448.9511.7.camel@localhost> In-Reply-To: <1125777448.9511.7.camel@localhost> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200509041327.45054.hselasky@c2i.net> Cc: Subject: Re: Problems with uhid device. X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: hselasky@c2i.net List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Sep 2005 11:26:55 -0000 On Saturday 03 September 2005 21:57, John-Paul Andrusky wrote: > Hi, > > Sorry for the long silence. I tried both of the alternatives below with > no success with either (does exactly the same thing). I've tried to > isolate the dmesg with hw.usb.uhci.debug=15 (please see bellow). As for > the version of FreeBSD (I guess I should have mentioned it before), I'm > running STABLE. > > Sep 3 07:58:52 sol kernel: uhci_non_isoc_done: xfer=0xc1cf7800 > pipe=0xc1a8717c transfer done > Sep 3 07:58:52 sol kernel: uhci_dump_td: TD(0xc1cf79e0) at 1802b9e4 = > link=0x1802ba04 status=0x1c000004 token=0x00817c69 buffer=0x1802b9d0 > Sep 3 07:58:52 sol kernel: uhci_dump_td: 1802ba04 > 1c000004,errcnt=3,actlen=5 pid=69,addr=124,endpt=2,D=0,maxlen=5 > Sep 3 07:58:52 sol kernel: uhci_dump_td: TD(0xc1cf7a00) at 1802ba04 = > link=0x00000001 status=0x1d500000 token=0x00097c69 buffer=0x1802b9d5 > Sep 3 07:58:52 sol kernel: uhci_dump_td: 1 > 1d500000,errcnt=3,actlen=1 > pid=69,addr=124,endpt=2,D=1,maxlen=1 I think the problem here is that the uhid driver sets up a too large packet for the interrupt endpoint. The above shows that the first packet is 5 bytes and the last packet is 1 byte, which makes up the 6 bytes of the interrupt structure. The size of the interrupt packet comes from the function: "hid_report_size()". "cat /sys/dev/usb/*hid* | more" if (id != 0) { size += 8; ^^^ maybe this is wrong, hence we are already adding 7 to the size below ? *idp = id; /* XXX wrong */ } else *idp = 0; return ((size + 7) / 8); A temporary patch might be to add something to the file "/sys/dev/usb/uhid.c" Where you find: sc->sc_isize = hid_report_size(desc, size, hid_input, &sc->sc_iid); sc->sc_osize = hid_report_size(desc, size, hid_output, &sc->sc_oid); sc->sc_fsize = hid_report_size(desc, size, hid_feature, &sc->sc_fid); Add here: if(sc->sc_isize > ed->wMaxPacketSize) sc->sc_isize = ed->wMaxPacketSize; Then try again. You should now only see a single interrupt packet with "maxlen=5". --HPS From owner-freebsd-usb@FreeBSD.ORG Mon Sep 5 11:02:30 2005 Return-Path: X-Original-To: freebsd-usb@freebsd.org Delivered-To: freebsd-usb@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id CECB316A44C for ; Mon, 5 Sep 2005 11:02:30 +0000 (GMT) (envelope-from owner-bugmaster@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8028643D48 for ; Mon, 5 Sep 2005 11:02:30 +0000 (GMT) (envelope-from owner-bugmaster@freebsd.org) Received: from freefall.freebsd.org (peter@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.3/8.13.3) with ESMTP id j85B2Uxb077077 for ; Mon, 5 Sep 2005 11:02:30 GMT (envelope-from owner-bugmaster@freebsd.org) Received: (from peter@localhost) by freefall.freebsd.org (8.13.3/8.13.1/Submit) id j85B2TiQ077071 for freebsd-usb@freebsd.org; Mon, 5 Sep 2005 11:02:29 GMT (envelope-from owner-bugmaster@freebsd.org) Date: Mon, 5 Sep 2005 11:02:29 GMT Message-Id: <200509051102.j85B2TiQ077071@freefall.freebsd.org> X-Authentication-Warning: freefall.freebsd.org: peter set sender to owner-bugmaster@freebsd.org using -f From: FreeBSD bugmaster To: freebsd-usb@FreeBSD.org Cc: Subject: Current problem reports assigned to you 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, 05 Sep 2005 11:02:30 -0000 Current FreeBSD problem reports Critical problems Serious problems S Submitted Tracker Resp. Description ------------------------------------------------------------------------------- o [2002/07/19] usb/40792 usb signals lead to data loss on device ugen o [2002/12/10] usb/46176 usb [panic] umass causes kernel panic if devi o [2002/12/19] i386/46371 usb USB controller cannot be initialized on I o [2003/09/26] bin/57255 usb usbd and multi-function devices f [2003/12/11] usb/60131 usb [usb] Page fault on disconnect of USB dev s [2003/12/15] usb/60276 usb [usb] Kernel panic when plugging in USB ( o [2004/01/20] usb/61627 usb [usb] [patch] New USB printer not support f [2004/01/30] usb/62088 usb [usb] Logitech Cordless/Optical Mouse not o [2004/02/03] kern/62309 usb panic: ugen driver f [2004/03/01] usb/63621 usb [usb] USB MemoryStick Reader stalls/crash o [2004/07/13] usb/69006 usb [patch] Apple Cinema Display hangs USB po o [2004/08/30] usb/71155 usb [usb] misbehaving usb-printer hangs proce o [2004/10/30] usb/73307 usb [panic] Kernel panics on USB disconnect o [2004/12/30] usb/75648 usb [panic] panic while loading usb.ko on 4.1 o [2005/01/01] usb/75705 usb [panic] da0 attach / Optio S4 (with backt o [2005/01/04] usb/75797 usb 5.3-STABLE(2005 1/4) detect USB headset, o [2005/01/13] usb/76204 usb panic while using usb attached modem o [2005/01/18] usb/76395 usb USB printer does not work, usbdevs says " o [2005/01/21] usb/76554 usb Panram "yoyo" USB MP3 player causes panic o [2005/01/25] usb/76684 usb Toshiba PDR-M4 camera connected via USB h o [2005/02/06] usb/77184 usb kernel panic on USB device disconnect o [2005/02/09] usb/77294 usb ucom + ulpcom panic o [2005/02/16] usb/77604 usb Sluggish Logitch LX700 USB Mouse f [2005/02/20] usb/77799 usb [panic] on attach of a mp3 player to USB o [2005/02/23] usb/77940 usb [patch] [panic] insertion of usb keyboard o [2005/03/18] usb/78989 usb please add USB keyboard support to instal o [2005/03/22] usb/79140 usb WD Firewire/USB Combo hangs under load on o [2005/03/27] usb/79269 usb USB ohci da0 plug/unplug causes crashes a o [2005/03/27] usb/79287 usb UHCI hang after interrupt transfer o [2005/04/02] usb/79436 usb Panic: ohci_abort_xfer: not in process co o [2005/04/04] usb/79524 usb printing to Minolta PagePro 1[23]xxW via o [2005/04/07] usb/79656 usb [usb] RHSC interrupts lost o [2005/04/09] usb/79722 usb [usb] wrong alignments in ehci.h o [2005/04/17] usb/80040 usb [hang] Use of sound mixer causes system f o [2005/04/22] usb/80260 usb Travan USB tape drive fails to write o [2005/04/26] usb/80361 usb mounting of usb-stick fails o [2005/04/26] usb/80373 usb usb keyboard does not respond o [2005/05/04] usb/80628 usb recent USB MFCs cause panics o [2005/05/06] usb/80685 usb panic in usb_cold_explore() at begining o [2005/05/09] usb/80829 usb possible panic when loading USB-modules o [2005/05/10] usb/80862 usb USB locking issues o [2005/05/20] usb/81308 usb Polling a ugen(4) control endpoint causes o [2005/05/26] usb/81524 usb panic: usb_cold_explore: busses to explor f [2005/06/01] usb/81774 usb 2nd generation iPod mini cannot be mounte o [2005/06/13] usb/82198 usb Panic on attaching of ONKI N-338 USB MP3 o [2005/06/15] usb/82272 usb Can not recognize Casio camera EX-Z40 as o [2005/06/22] usb/82520 usb Reboot when USL101 connected o [2005/06/26] usb/82660 usb EHCI: I/O stuck in state 'physrd'/panic o [2005/07/16] usb/83563 usb Page Fault while detaching Mpman Usb devi o [2005/07/18] usb/83677 usb [usb] usb controller not detected o [2005/07/19] usb/83756 usb Microsoft Intellimouse Explorer 4.0A does o [2005/07/23] usb/83942 usb [patch] QUIRK: Langel USB flash mp3 playe o [2005/07/24] usb/83977 usb [panic] ucom1: open bulk out error (addr o [2005/07/29] usb/84295 usb Install FreeBSD with usb keyboard need st o [2005/07/30] usb/84336 usb [usb] [reboot] instant system reboot when o [2005/08/15] usb/84936 usb install - usb keyboard not recognized 56 problems total. Non-critical problems S Submitted Tracker Resp. Description ------------------------------------------------------------------------------- o [2001/09/30] conf/30929 usb [patch] use usbd to initialize USB ADSL m o [2001/12/09] kern/32652 usb [patch] A new ioctl to uscanner s [2001/12/09] ports/32653 usb Added patches to improve USB scanner supp o [2002/07/24] usb/40948 usb [usb] USB HP CDW8200 does not work o [2002/08/07] usb/41415 usb [usb] [patch] Some USB scanners cannot ta o [2003/02/16] bin/48342 usb [PATCH] usbd dynamic device list. o [2003/05/08] kern/51958 usb [usb] [patch] update for urio driver o [2003/05/10] kern/52026 usb [usb] feature request: umass driver suppo o [2003/06/08] usb/53025 usb [PATCH] ugen does not allow O_NONBLOCK fo o [2003/08/28] usb/56095 usb [patch] QUIRK: Apacer Pen Drive fails to o [2003/11/11] usb/59169 usb [patch] ulpt is missing read operation o [2003/12/15] usb/60248 usb [patch] Problem with USB printer HP Laser o [2004/01/12] bin/61234 usb [usb] [patch] usbhidaction doesn't suppor o [2004/03/06] usb/63837 usb [patch] USB: hid_is_collection() only loo o [2004/04/11] usb/65436 usb QUIRK: [patch] to add support for PNY Att o [2004/04/19] kern/65769 usb [usb] Call to tcflush(x, TCIFLUSH) stops f [2004/05/11] kern/66547 usb [usb] Palm Tungsten T USB does not initia o [2004/06/23] usb/68232 usb [patch] ugen(4) isochronous handling corr o [2004/06/27] usb/68412 usb [usb] [patch] QUIRK: Philips KEY013 USB M o [2004/08/16] usb/70523 usb [usb] [patch] umct sending/receiving wron o [2004/08/25] usb/70942 usb [usb] Genius Wireless USB mouse: moused d o [2004/09/06] usb/71416 usb [usb] Cryptoflex e-gate USB token (ugen0) o [2004/09/06] usb/71417 usb [usb] Cryptoflex e-gate USB token (ugen0) o [2004/09/07] usb/71455 usb [usb] Slow USB umass performance of 5.3 o [2004/09/11] kern/71605 usb [usb] [patch] umass doesn't recognize mul o [2004/10/05] usb/72344 usb [patch] [usb] QUIRK: Dane-Elec zMate 512 o [2004/10/06] i386/72380 usb [usb] USB does not work [dual Celeron Abi o [2004/10/15] usb/72732 usb [patch] Kyocera 7135 quirk. o [2004/10/15] usb/72733 usb Kyocera 7135 Palm OS connection problem. o [2004/10/23] usb/73056 usb [usb] Sun Microsystems Type 6 USB mouse n o [2004/11/21] usb/74211 usb USB flash drive causes CAM status 0x4 on o [2004/11/25] usb/74358 usb [umass] unplugging at boot time an umass o [2004/11/27] usb/74453 usb Q-lity CD-RW USB ECW-043 (ScanLogic SL11R o [2004/11/30] usb/74557 usb imation 500mb usb key can only be written o [2004/12/02] usb/74609 usb [patch] [usb] allowing cdma modems to wor o [2004/12/09] usb/74880 usb [patch] [usb] Samsung N400 cellphone/acm o [2004/12/12] usb/74989 usb (regression) Lost USB support between 5.2 o [2004/12/28] usb/75578 usb [patch] QUIRK: PNY USB flash key o [2005/01/04] usb/75800 usb ucom1: init failed STALLED error in time o [2005/01/07] usb/75928 usb Cytronix SmartMedia card (SMC) reader has o [2005/01/19] usb/76461 usb disklabel of umass(4)-CAM(4)-da(4) not us o [2005/01/27] usb/76732 usb Mouse problems with USB KVM Switch o [2005/03/03] usb/78371 usb Philips Wearable Audio Player (128) fails o [2005/03/07] usb/78543 usb [patch] Support for Trip-Lite USB 2 Seria o [2005/03/18] usb/78984 usb Creative MUVO umass failure o [2005/04/09] usb/79723 usb [usb] prepare for high speed isochronous o [2005/04/09] usb/79725 usb [patch] [usb] USB device speed is not dou o [2005/04/14] usb/79893 usb New usbdevs/umass quirks derived from Lin o [2005/04/16] usb/80010 usb Add support for the AEI USB to LAN adapte o [2005/04/27] usb/80383 usb [PATCH] Add quirk for uhid to ignore cert o [2005/04/27] usb/80420 usb atapicam stops iPod functionality o [2005/05/08] usb/80773 usb "usbd_get_string()" could have taken a le o [2005/05/08] usb/80774 usb have "usbd_find_desc" in line with the ot o [2005/05/08] usb/80776 usb UDAV device driver shouldn't use usb_add_ o [2005/05/08] usb/80777 usb usb_rem_task() should wait for callback t o [2005/05/10] usb/80854 usb suggestion for new iface-no-probe mechani o [2005/05/12] usb/80935 usb uvisor.c is not work with CLIE TH55. o [2005/05/15] usb/81073 usb [patch] fix umass NO_GETMAXLUN quirk o [2005/05/18] usb/81191 usb Support for Curitel HX-550C USB modem to o [2005/05/29] usb/81621 usb external hd hangs under load on ehci o [2005/05/30] usb/81656 usb umass problem with Minolta DiMage S414 Di o [2005/06/20] usb/82436 usb [patch] USL101 Host-to-Host bridge suppor o [2005/06/30] usb/82839 usb [patch] add support for Aceeca Mez1000 de o [2005/07/05] usb/83022 usb ALI USB 2.0 EHCI Controller is not detect o [2005/07/12] usb/83353 usb [patch] ums driver limits number of butto o [2005/07/15] usb/83504 usb SpeedTouch USB stop working on recent cur o [2005/07/21] usb/83863 usb Communication problem between opensc/open o [2005/08/06] usb/84608 usb Sony digital camera DSC-P100, rev 2.00/5. o [2005/08/18] usb/85067 usb Cannot attach ScanJet 4300C to usb device 69 problems total. From owner-freebsd-usb@FreeBSD.ORG Mon Sep 5 18:28:49 2005 Return-Path: X-Original-To: freebsd-usb@hub.freebsd.org Delivered-To: freebsd-usb@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C841916A41F; Mon, 5 Sep 2005 18:28:49 +0000 (GMT) (envelope-from linimon@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 86D6A43D46; Mon, 5 Sep 2005 18:28:49 +0000 (GMT) (envelope-from linimon@FreeBSD.org) Received: from freefall.freebsd.org (linimon@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.3/8.13.3) with ESMTP id j85ISn6D034426; Mon, 5 Sep 2005 18:28:49 GMT (envelope-from linimon@freefall.freebsd.org) Received: (from linimon@localhost) by freefall.freebsd.org (8.13.3/8.13.1/Submit) id j85ISnW2034422; Mon, 5 Sep 2005 18:28:49 GMT (envelope-from linimon) Date: Mon, 5 Sep 2005 18:28:49 GMT From: Mark Linimon Message-Id: <200509051828.j85ISnW2034422@freefall.freebsd.org> To: linimon@FreeBSD.org, freebsd-bugs@FreeBSD.org, freebsd-usb@FreeBSD.org Cc: Subject: Re: usb/82350: [usb] null pointer dereference in USB stack 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, 05 Sep 2005 18:28:49 -0000 Old Synopsis: null pointer dereference in USB stack New Synopsis: [usb] null pointer dereference in USB stack Responsible-Changed-From-To: freebsd-bugs->freebsd-usb Responsible-Changed-By: linimon Responsible-Changed-When: Mon Sep 5 18:28:29 GMT 2005 Responsible-Changed-Why: Canonicalize assignment. http://www.freebsd.org/cgi/query-pr.cgi?pr=82350 From owner-freebsd-usb@FreeBSD.ORG Tue Sep 6 18:08:52 2005 Return-Path: X-Original-To: freebsd-usb@freebsd.org Delivered-To: freebsd-usb@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E1F2E16A41F for ; Tue, 6 Sep 2005 18:08:52 +0000 (GMT) (envelope-from mathieu-prevot@wanadoo.fr) Received: from smtp2.wanadoo.fr (smtp2.wanadoo.fr [193.252.22.29]) by mx1.FreeBSD.org (Postfix) with ESMTP id 81EC043D48 for ; Tue, 6 Sep 2005 18:08:52 +0000 (GMT) (envelope-from mathieu-prevot@wanadoo.fr) Received: from me-wanadoo.net (localhost [127.0.0.1]) by mwinf0206.wanadoo.fr (SMTP Server) with ESMTP id 9D5651C00161 for ; Tue, 6 Sep 2005 20:08:51 +0200 (CEST) Received: from [192.168.0.2] (APuteaux-151-1-48-67.w82-124.abo.wanadoo.fr [82.124.235.67]) by mwinf0206.wanadoo.fr (SMTP Server) with ESMTP id BDC1E1C00171 for ; Tue, 6 Sep 2005 20:08:45 +0200 (CEST) X-ME-UUID: 20050906180847777.BDC1E1C00171@mwinf0206.wanadoo.fr Mime-Version: 1.0 (Apple Message framework v622) Content-Transfer-Encoding: 7bit Message-Id: Content-Type: text/plain; charset=US-ASCII; format=flowed To: freebsd-usb@freebsd.org From: Mathieu PREVOT Date: Tue, 6 Sep 2005 20:08:33 +0200 X-Mailer: Apple Mail (2.622) Subject: kernel panic with pure usb2umass pluged on pure usb1only motherboard port 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: Tue, 06 Sep 2005 18:08:53 -0000 Hello, my kernel panics when I plug a pure USB2 umass. My motherboard has a VIA KT200 and has only USB1 ports. However, everything works perfectly with USB1 and USB1&2 umass. I used a custom kernel 5.4 but I noticed that behavior since 5.2.1. I not able to provide the output. Is it a known issue ? Regards, MP From owner-freebsd-usb@FreeBSD.ORG Tue Sep 6 18:54:59 2005 Return-Path: X-Original-To: freebsd-usb@freebsd.org Delivered-To: freebsd-usb@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C582B16A41F for ; Tue, 6 Sep 2005 18:54:59 +0000 (GMT) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe16.tele2.se [212.247.155.225]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4187F43D46 for ; Tue, 6 Sep 2005 18:54:58 +0000 (GMT) (envelope-from hselasky@c2i.net) X-T2-Posting-ID: Y1QAsIk9O44SO+J/q9KNyQ== Received: from mp-216-88-165.daxnet.no ([193.216.88.165] verified) by mailfe16.swip.net (CommuniGate Pro SMTP 4.3.4) with ESMTP id 16752659; Tue, 06 Sep 2005 20:54:56 +0200 From: Hans Petter Selasky To: freebsd-usb@freebsd.org Date: Tue, 6 Sep 2005 20:55:49 +0200 User-Agent: KMail/1.7 References: In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200509062055.51077.hselasky@c2i.net> Cc: Mathieu PREVOT Subject: Re: kernel panic with pure usb2umass pluged on pure usb1only motherboard port X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: hselasky@c2i.net List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Sep 2005 18:54:59 -0000 On Tuesday 06 September 2005 20:08, Mathieu PREVOT wrote: > Hello, > > my kernel panics when I plug a pure USB2 umass. My motherboard has a > VIA KT200 and has only USB1 ports. > However, everything works perfectly with USB1 and USB1&2 umass. > I used a custom kernel 5.4 but I noticed that behavior since 5.2.1. I > not able to provide the output. > > Is it a known issue ? There is one known bug in umass that will produce a panic on attach: In "/sys/dev/usb/umass.c", maybe you can manually apply the following patch: *************** *** 928,934 **** #endif if (sc->quirks & ALT_IFACE_1) { ! err = usbd_set_interface(0, 1); if (err) { DPRINTF(UDMASS_USB, ("%s: could not switch to " "Alt Interface %d\n", --- 929,935 ---- #endif if (sc->quirks & ALT_IFACE_1) { ! err = usbd_set_interface(uaa->iface, 1); if (err) { DPRINTF(UDMASS_USB, ("%s: could not switch to " "Alt Interface %d\n", I am not sure if this is what is causing your panic. But could you make sure that you have the following options in your kernel config file: options KDB # Enable kernel debugger support. options DDB # Support DDB. options GDB # Support remote GDB. Then recompile the kernel, and then reproduce the panic. When the kernel enters the debugger. Type "backtrace". Write down the function names, not all the parameters, and post it. --HPS From owner-freebsd-usb@FreeBSD.ORG Tue Sep 6 23:00:23 2005 Return-Path: X-Original-To: freebsd-usb@hub.freebsd.org Delivered-To: freebsd-usb@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5696B16A41F for ; Tue, 6 Sep 2005 23:00:23 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id CE31243D46 for ; Tue, 6 Sep 2005 23:00:22 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.3/8.13.3) with ESMTP id j86N0ME8076739 for ; Tue, 6 Sep 2005 23:00:22 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.3/8.13.1/Submit) id j86N0MYS076735; Tue, 6 Sep 2005 23:00:22 GMT (envelope-from gnats) Resent-Date: Tue, 6 Sep 2005 23:00:22 GMT Resent-Message-Id: <200509062300.j86N0MYS076735@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, Wesley Gentine Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9C64B16A41F for ; Tue, 6 Sep 2005 22:59:14 +0000 (GMT) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (www.freebsd.org [216.136.204.117]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6A08543D55 for ; Tue, 6 Sep 2005 22:59:14 +0000 (GMT) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.13.1/8.13.1) with ESMTP id j86MxEg5014261 for ; Tue, 6 Sep 2005 22:59:14 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.13.1/8.13.1/Submit) id j86MxEeZ014260; Tue, 6 Sep 2005 22:59:14 GMT (envelope-from nobody) Message-Id: <200509062259.j86MxEeZ014260@www.freebsd.org> Date: Tue, 6 Sep 2005 22:59:14 GMT From: Wesley Gentine To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-2.3 Cc: Subject: usb/85814: Microsoft Wireless Mouse doesnt work 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: Tue, 06 Sep 2005 23:00:23 -0000 >Number: 85814 >Category: usb >Synopsis: Microsoft Wireless Mouse doesnt work >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-usb >State: open >Quarter: >Keywords: >Date-Required: >Class: update >Submitter-Id: current-users >Arrival-Date: Tue Sep 06 23:00:22 GMT 2005 >Closed-Date: >Last-Modified: >Originator: Wesley Gentine >Release: 6.0-BETA4 >Organization: >Environment: FreeBSD powerplant 6.0-BETA4 FreeBSD 6.0-BETA4 #0: Tue Sep 6 19:05:25 BRT 2005 root@powerplant:/usr/src/sys/i386/compile/POWERPLANT6 i386 >Description: This mouse is probed as: uhid0: Microsoft Microsoft USB Wireless Mouse, rev 2.00/0.17, addr 2, iclass 3/1 and not as ums0. Output of usbdevs -v: addr 1: full speed, self powered, config 1, UHCI root hub(0x0000), VIA(0x0000), rev 1.00 port 1 addr 2: low speed, power 50 mA, config 1, Microsoft USB Wireless Mouse(0x00b9), Microsoft(0x045e), rev 0.17 >How-To-Repeat: >Fix: >Release-Note: >Audit-Trail: >Unformatted: From owner-freebsd-usb@FreeBSD.ORG Thu Sep 8 19:37:07 2005 Return-Path: X-Original-To: freebsd-usb@freebsd.org Delivered-To: freebsd-usb@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6113F16A41F for ; Thu, 8 Sep 2005 19:37:07 +0000 (GMT) (envelope-from mathieu-prevot@wanadoo.fr) Received: from smtp3.wanadoo.fr (smtp3.wanadoo.fr [193.252.22.28]) by mx1.FreeBSD.org (Postfix) with ESMTP id E98B943D49 for ; Thu, 8 Sep 2005 19:37:05 +0000 (GMT) (envelope-from mathieu-prevot@wanadoo.fr) Received: from me-wanadoo.net (localhost [127.0.0.1]) by mwinf0303.wanadoo.fr (SMTP Server) with ESMTP id A134F1C00384 for ; Thu, 8 Sep 2005 21:37:04 +0200 (CEST) Received: from [192.168.0.2] (APuteaux-151-1-63-204.w82-120.abo.wanadoo.fr [82.120.53.204]) by mwinf0303.wanadoo.fr (SMTP Server) with ESMTP id 4BC321C003F1; Thu, 8 Sep 2005 21:36:58 +0200 (CEST) X-ME-UUID: 20050908193658310.4BC321C003F1@mwinf0303.wanadoo.fr In-Reply-To: <200509062055.51077.hselasky@c2i.net> References: <200509062055.51077.hselasky@c2i.net> Mime-Version: 1.0 (Apple Message framework v622) Content-Type: multipart/mixed; boundary=Apple-Mail-2--275355228 Message-Id: <1b28f5016a1a3d22a7ae89a118db2d98@wanadoo.fr> From: Mathieu PREVOT Date: Thu, 8 Sep 2005 21:36:56 +0200 To: hselasky@c2i.net X-Mailer: Apple Mail (2.622) Cc: freebsd-usb@freebsd.org Subject: Re: kernel panic with pure usb2umass pluged on pure usb1only motherboard port 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, 08 Sep 2005 19:37:07 -0000 --Apple-Mail-2--275355228 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII; format=flowed > On Tuesday 06 September 2005 20:08, Mathieu PREVOT wrote: >> Hello, >> >> my kernel panics when I plug a pure USB2 umass. My motherboard has a >> VIA KT200 and has only USB1 ports. >> However, everything works perfectly with USB1 and USB1&2 umass. >> I used a custom kernel 5.4 but I noticed that behavior since 5.2.1. I >> not able to provide the output. >> >> Is it a known issue ? > > There is one known bug in umass that will produce a panic on attach: > > In "/sys/dev/usb/umass.c", maybe you can manually apply the following > patch: > > *************** > *** 928,934 **** > #endif > > if (sc->quirks & ALT_IFACE_1) { > ! err = usbd_set_interface(0, 1); > if (err) { > DPRINTF(UDMASS_USB, ("%s: could not switch to " > "Alt Interface %d\n", > --- 929,935 ---- > #endif > > if (sc->quirks & ALT_IFACE_1) { > ! err = usbd_set_interface(uaa->iface, 1); > if (err) { > DPRINTF(UDMASS_USB, ("%s: could not switch to " > "Alt Interface %d\n", > > I am not sure if this is what is causing your panic. > > But could you make sure that you have the following options in your > kernel > config file: > > options KDB # Enable kernel debugger > support. > options DDB # Support DDB. > options GDB # Support remote GDB. > > Then recompile the kernel, and then reproduce the panic. When the > kernel > enters the debugger. Type "backtrace". Write down the function names, > not all > the parameters, and post it. Sorry for my lack of responsiveness (work...). Now I am on it. 1. I didn't apply patch(es) you sent because there was already a very similar set of instructions at this place (cf joined umass.c) 2. Just before the copyright note displayed by the kernel I have: GDB: no debug ports present KDB: debugger backends: ddb KDB: current backend: ddb 3. I used trace instead of backtrace (no such command) and obtained: Tracing pid 36 tid 100042 td 0xc1a43300 strcmp(...) at strcmp+0xc sysctl_find_oidname(...) atsysctl_find_oidname+0x1d sysctl_register_oid(...) at sysctl_register_oid+0x13 sysctl_add_oid(...) at sysctl_add_oid+0x15a device_sysctl_init(...) at device_sysctl_init+0xdd device_attach(...) at device_attach+0xe device_probe_and_attach(...) at device_probe_and_attach+0xb4 usbd_probe_and_attach(...) at usbd_probe_and_attach+0x2f1 usbd_new_device(...) at usbd_new_device+0x27b uhub_explore(...) at uhub_explore+0x250 usb_discover(...) at usb_discover+0x2f usb_event_thread(...) at usb_event_thread+0x66 fork_exit(...)at fork_exit+0x74 fork_trampoline() at fork_trampoline+0x8 --- trap 0x1, eip = 0, esp = 0xd541bd7c, ebp = 0 --- In fact When I plug USB2umass I have several times the "lost device" message: Sep 8 20:36:11 fbox kernel: umass0: vendor 0x10d6 USB 2.0(FS) FLASH DISK, rev 1.10/1.00, addr 3 Sep 8 20:36:11 fbox kernel: da0 at umass-sim0 bus 0 target 0 lun 0 Sep 8 20:36:11 fbox kernel: da0: Removable Direct Access SCSI-0 device Sep 8 20:36:11 fbox kernel: da0: 1.000MB/s transfers Sep 8 20:36:11 fbox kernel: da0: 1001MB (2051809 512 byte sectors: 64H 32S/T 1001C) Sep 8 20:36:13 fbox kernel: umass0: BBB reset failed, STALLED Sep 8 20:36:13 fbox kernel: umass0: at uhub0 port 1 (addr 3) disconnected Sep 8 20:36:13 fbox kernel: (da0:umass-sim0:0:0:0): lost device Sep 8 20:36:13 fbox kernel: (da0:umass-sim0:0:0:0): Synchronize cache failed, status == 0x39, scsi status == 0x0 Sep 8 20:36:13 fbox kernel: (da0:umass-sim0:0:0:0): removing device entry Sep 8 20:36:13 fbox kernel: umass0: detached Sep 8 20:36:24 fbox kernel: umass0: vendor 0x10d6 USB 2.0(FS) FLASH DISK, rev 1.10/1.00, addr 3 Sep 8 20:36:25 fbox kernel: da0 at umass-sim0 bus 0 target 0 lun 0 Sep 8 20:36:25 fbox kernel: da0: Removable Direct Access SCSI-0 device Sep 8 20:36:25 fbox kernel: da0: 1.000MB/s transfers Sep 8 20:36:25 fbox kernel: da0: 1001MB (2051809 512 byte sectors: 64H 32S/T 1001C) Sep 8 20:36:26 fbox kernel: umass0: BBB reset failed, STALLED Sep 8 20:36:26 fbox kernel: umass0: at uhub0 port 1 (addr 3) disconnected Sep 8 20:36:26 fbox kernel: (da0:umass-sim0:0:0:0): lost device Sep 8 20:36:26 fbox kernel: (da0:umass-sim0:0:0:0): Synchronize cache failed, status == 0x39, scsi status == 0x0 Sep 8 20:36:26 fbox kernel: (da0:umass-sim0:0:0:0): removing device entry Sep 8 20:36:26 fbox kernel: umass0: detached Sep 8 20:36:38 fbox kernel: umass0: vendor 0x10d6 USB 2.0(FS) FLASH DISK, rev 1.10/1.00, addr 3 Sep 8 20:36:38 fbox kernel: da0 at umass-sim0 bus 0 target 0 lun 0 Sep 8 20:36:38 fbox kernel: da0: Removable Direct Access SCSI-0 device Sep 8 20:36:38 fbox kernel: da0: 1.000MB/s transfers Sep 8 20:36:38 fbox kernel: da0: 1001MB (2051809 512 byte sectors: 64H 32S/T 1001C) Sep 8 20:36:40 fbox kernel: umass0: BBB reset failed, STALLED Sep 8 20:36:40 fbox kernel: umass0: BBB bulk-in clear stall failed, STALLED Sep 8 20:36:40 fbox kernel: umass0: at uhub0 port 1 (addr 3) disconnected Sep 8 20:36:40 fbox kernel: (da0:umass-sim0:0:0:0): lost device Sep 8 20:36:40 fbox kernel: (da0:umass-sim0:0:0:0): Synchronize cache failed, status == 0x39, scsi status == 0x0 Sep 8 20:36:40 fbox kernel: (da0:umass-sim0:0:0:0): removing device entry Sep 8 20:36:40 fbox kernel: umass0: detached Sep 8 21:00:28 fbox syslogd: kernel boot file is /boot/kernel/kernel Sep 8 21:00:28 fbox kernel: Sep 8 21:00:28 fbox kernel: Sep 8 21:00:28 fbox kernel: Fatal trap 12: page fault while in kernel mode Sep 8 21:00:28 fbox kernel: fault virtual address = 0x0 Sep 8 21:00:28 fbox kernel: fault code = supervisor read, page not present Sep 8 21:00:28 fbox kernel: instruction pointer = 0x8:0xc056e0ac Sep 8 21:00:28 fbox kernel: stack pointer = 0x10:0xd541b784 Sep 8 21:00:28 fbox kernel: frame pointer = 0x10:0xd541b784 Sep 8 21:00:28 fbox kernel: code segment = base 0x0, limit 0xfffff, type 0x1b Sep 8 21:00:28 fbox kernel: = DPL 0, pres 1, def32 1, gran 1 Sep 8 21:00:28 fbox kernel: processor eflags = interrupt enabled, resume, IOPL = 0 Sep 8 21:00:28 fbox kernel: current process = 36 (usb0) when I unplug USB2umass, I have nothing. When I replug USB2umass, the kernel panics (Fatal trap 12) Regards, MP --Apple-Mail-2--275355228 Content-Transfer-Encoding: 7bit Content-Type: text/plain; x-unix-mode=0777; name="umass.c" Content-Disposition: attachment; filename=umass.c /*- * Copyright (c) 1999 MAEKAWA Masahide , * Nick Hibma * All rights reserved. * * 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 AUTHOR 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 AUTHOR 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: src/sys/dev/usb/umass.c,v 1.112.2.6 2005/03/31 19:38:40 iedowse Exp $ * $NetBSD: umass.c,v 1.28 2000/04/02 23:46:53 augustss Exp $ */ /* Also already merged from NetBSD: * $NetBSD: umass.c,v 1.67 2001/11/25 19:05:22 augustss Exp $ * $NetBSD: umass.c,v 1.90 2002/11/04 19:17:33 pooka Exp $ * $NetBSD: umass.c,v 1.108 2003/11/07 17:03:25 wiz Exp $ * $NetBSD: umass.c,v 1.109 2003/12/04 13:57:31 keihan Exp $ */ /* * Universal Serial Bus Mass Storage Class specs: * http://www.usb.org/developers/devclass_docs/usb_msc_overview_1.2.pdf * http://www.usb.org/developers/devclass_docs/usbmassbulk_10.pdf * http://www.usb.org/developers/devclass_docs/usb_msc_cbi_1.1.pdf * http://www.usb.org/developers/devclass_docs/usbmass-ufi10.pdf */ /* * Ported to NetBSD by Lennart Augustsson . * Parts of the code written by Jason R. Thorpe . */ /* * The driver handles 3 Wire Protocols * - Command/Bulk/Interrupt (CBI) * - Command/Bulk/Interrupt with Command Completion Interrupt (CBI with CCI) * - Mass Storage Bulk-Only (BBB) * (BBB refers Bulk/Bulk/Bulk for Command/Data/Status phases) * * Over these wire protocols it handles the following command protocols * - SCSI * - UFI (floppy command set) * - 8070i (ATAPI) * * UFI and 8070i (ATAPI) are transformed versions of the SCSI command set. The * sc->transform method is used to convert the commands into the appropriate * format (if at all necessary). For example, UFI requires all commands to be * 12 bytes in length amongst other things. * * The source code below is marked and can be split into a number of pieces * (in this order): * * - probe/attach/detach * - generic transfer routines * - BBB * - CBI * - CBI_I (in addition to functions from CBI) * - CAM (Common Access Method) * - SCSI * - UFI * - 8070i (ATAPI) * * The protocols are implemented using a state machine, for the transfers as * well as for the resets. The state machine is contained in umass_*_state. * The state machine is started through either umass_*_transfer or * umass_*_reset. * * The reason for doing this is a) CAM performs a lot better this way and b) it * avoids using tsleep from interrupt context (for example after a failed * transfer). */ /* * The SCSI related part of this driver has been derived from the * dev/ppbus/vpo.c driver, by Nicolas Souchu (nsouch@freebsd.org). * * The CAM layer uses so called actions which are messages sent to the host * adapter for completion. The actions come in through umass_cam_action. The * appropriate block of routines is called depending on the transport protocol * in use. When the transfer has finished, these routines call * umass_cam_cb again to complete the CAM command. */ /* * XXX Currently CBI with CCI is not supported because it bombs the system * when the device is detached (low frequency interrupts are detached * too late. */ #undef CBI_I #include #include #include #include #include #include #include #include #include #include "usbdevs.h" #include #include #include #include #include #include #include #ifdef USB_DEBUG #define DIF(m, x) if (umassdebug & (m)) do { x ; } while (0) #define DPRINTF(m, x) if (umassdebug & (m)) logprintf x #define UDMASS_GEN 0x00010000 /* general */ #define UDMASS_SCSI 0x00020000 /* scsi */ #define UDMASS_UFI 0x00040000 /* ufi command set */ #define UDMASS_ATAPI 0x00080000 /* 8070i command set */ #define UDMASS_CMD (UDMASS_SCSI|UDMASS_UFI|UDMASS_ATAPI) #define UDMASS_USB 0x00100000 /* USB general */ #define UDMASS_BBB 0x00200000 /* Bulk-Only transfers */ #define UDMASS_CBI 0x00400000 /* CBI transfers */ #define UDMASS_WIRE (UDMASS_BBB|UDMASS_CBI) #define UDMASS_ALL 0xffff0000 /* all of the above */ int umassdebug = 0; SYSCTL_NODE(_hw_usb, OID_AUTO, umass, CTLFLAG_RW, 0, "USB umass"); SYSCTL_INT(_hw_usb_umass, OID_AUTO, debug, CTLFLAG_RW, &umassdebug, 0, "umass debug level"); #else #define DIF(m, x) /* nop */ #define DPRINTF(m, x) /* nop */ #endif /* Generic definitions */ /* Direction for umass_*_transfer */ #define DIR_NONE 0 #define DIR_IN 1 #define DIR_OUT 2 /* device name */ #define DEVNAME "umass" #define DEVNAME_SIM "umass-sim" #define UMASS_MAX_TRANSFER_SIZE 65536 /* Approximate maximum transfer speeds (assumes 33% overhead). */ #define UMASS_FULL_TRANSFER_SPEED 1000 #define UMASS_HIGH_TRANSFER_SPEED 40000 #define UMASS_FLOPPY_TRANSFER_SPEED 20 #define UMASS_TIMEOUT 5000 /* msecs */ /* CAM specific definitions */ #define UMASS_SCSIID_MAX 1 /* maximum number of drives expected */ #define UMASS_SCSIID_HOST UMASS_SCSIID_MAX #define MS_TO_TICKS(ms) ((ms) * hz / 1000) /* Bulk-Only features */ #define UR_BBB_RESET 0xff /* Bulk-Only reset */ #define UR_BBB_GET_MAX_LUN 0xfe /* Get maximum lun */ /* Command Block Wrapper */ typedef struct { uDWord dCBWSignature; # define CBWSIGNATURE 0x43425355 uDWord dCBWTag; uDWord dCBWDataTransferLength; uByte bCBWFlags; # define CBWFLAGS_OUT 0x00 # define CBWFLAGS_IN 0x80 uByte bCBWLUN; uByte bCDBLength; # define CBWCDBLENGTH 16 uByte CBWCDB[CBWCDBLENGTH]; } umass_bbb_cbw_t; #define UMASS_BBB_CBW_SIZE 31 /* Command Status Wrapper */ typedef struct { uDWord dCSWSignature; # define CSWSIGNATURE 0x53425355 # define CSWSIGNATURE_OLYMPUS_C1 0x55425355 uDWord dCSWTag; uDWord dCSWDataResidue; uByte bCSWStatus; # define CSWSTATUS_GOOD 0x0 # define CSWSTATUS_FAILED 0x1 # define CSWSTATUS_PHASE 0x2 } umass_bbb_csw_t; #define UMASS_BBB_CSW_SIZE 13 /* CBI features */ #define UR_CBI_ADSC 0x00 typedef unsigned char umass_cbi_cbl_t[16]; /* Command block */ typedef union { struct { unsigned char type; #define IDB_TYPE_CCI 0x00 unsigned char value; #define IDB_VALUE_PASS 0x00 #define IDB_VALUE_FAIL 0x01 #define IDB_VALUE_PHASE 0x02 #define IDB_VALUE_PERSISTENT 0x03 #define IDB_VALUE_STATUS_MASK 0x03 } common; struct { unsigned char asc; unsigned char ascq; } ufi; } umass_cbi_sbl_t; struct umass_softc; /* see below */ typedef void (*transfer_cb_f) (struct umass_softc *sc, void *priv, int residue, int status); #define STATUS_CMD_OK 0 /* everything ok */ #define STATUS_CMD_UNKNOWN 1 /* will have to fetch sense */ #define STATUS_CMD_FAILED 2 /* transfer was ok, command failed */ #define STATUS_WIRE_FAILED 3 /* couldn't even get command across */ typedef void (*wire_reset_f) (struct umass_softc *sc, int status); typedef void (*wire_transfer_f) (struct umass_softc *sc, int lun, void *cmd, int cmdlen, void *data, int datalen, int dir, u_int timeout, transfer_cb_f cb, void *priv); typedef void (*wire_state_f) (usbd_xfer_handle xfer, usbd_private_handle priv, usbd_status err); typedef int (*command_transform_f) (struct umass_softc *sc, unsigned char *cmd, int cmdlen, unsigned char **rcmd, int *rcmdlen); struct umass_devdescr_t { u_int32_t vid; # define VID_WILDCARD 0xffffffff # define VID_EOT 0xfffffffe u_int32_t pid; # define PID_WILDCARD 0xffffffff # define PID_EOT 0xfffffffe u_int32_t rid; # define RID_WILDCARD 0xffffffff # define RID_EOT 0xfffffffe /* wire and command protocol */ u_int16_t proto; # define UMASS_PROTO_BBB 0x0001 /* USB wire protocol */ # define UMASS_PROTO_CBI 0x0002 # define UMASS_PROTO_CBI_I 0x0004 # define UMASS_PROTO_WIRE 0x00ff /* USB wire protocol mask */ # define UMASS_PROTO_SCSI 0x0100 /* command protocol */ # define UMASS_PROTO_ATAPI 0x0200 # define UMASS_PROTO_UFI 0x0400 # define UMASS_PROTO_RBC 0x0800 # define UMASS_PROTO_COMMAND 0xff00 /* command protocol mask */ /* Device specific quirks */ u_int16_t quirks; # define NO_QUIRKS 0x0000 /* The drive does not support Test Unit Ready. Convert to Start Unit */ # define NO_TEST_UNIT_READY 0x0001 /* The drive does not reset the Unit Attention state after REQUEST * SENSE has been sent. The INQUIRY command does not reset the UA * either, and so CAM runs in circles trying to retrieve the initial * INQUIRY data. */ # define RS_NO_CLEAR_UA 0x0002 /* The drive does not support START STOP. */ # define NO_START_STOP 0x0004 /* Don't ask for full inquiry data (255b). */ # define FORCE_SHORT_INQUIRY 0x0008 /* Needs to be initialised the Shuttle way */ # define SHUTTLE_INIT 0x0010 /* Drive needs to be switched to alternate iface 1 */ # define ALT_IFACE_1 0x0020 /* Drive does not do 1Mb/s, but just floppy speeds (20kb/s) */ # define FLOPPY_SPEED 0x0040 /* The device can't count and gets the residue of transfers wrong */ # define IGNORE_RESIDUE 0x0080 /* No GetMaxLun call */ # define NO_GETMAXLUN 0x0100 /* The device uses a weird CSWSIGNATURE. */ # define WRONG_CSWSIG 0x0200 /* Device cannot handle INQUIRY so fake a generic response */ # define NO_INQUIRY 0x0400 /* Device cannot handle INQUIRY EVPD, return CHECK CONDITION */ # define NO_INQUIRY_EVPD 0x0800 }; Static struct umass_devdescr_t umass_devdescrs[] = { { USB_VENDOR_ASAHIOPTICAL, PID_WILDCARD, RID_WILDCARD, UMASS_PROTO_ATAPI | UMASS_PROTO_CBI_I, RS_NO_CLEAR_UA }, { USB_VENDOR_FUJIPHOTO, USB_PRODUCT_FUJIPHOTO_MASS0100, RID_WILDCARD, UMASS_PROTO_ATAPI | UMASS_PROTO_CBI_I, RS_NO_CLEAR_UA }, { USB_VENDOR_GENESYS, USB_PRODUCT_GENESYS_GL641USB2IDE, RID_WILDCARD, UMASS_PROTO_SCSI | UMASS_PROTO_BBB, FORCE_SHORT_INQUIRY | NO_START_STOP | IGNORE_RESIDUE }, { USB_VENDOR_GENESYS, USB_PRODUCT_GENESYS_GL641USB2IDE_2, RID_WILDCARD, UMASS_PROTO_ATAPI | UMASS_PROTO_BBB, FORCE_SHORT_INQUIRY | NO_START_STOP | IGNORE_RESIDUE }, { USB_VENDOR_GENESYS, USB_PRODUCT_GENESYS_GL641USB, RID_WILDCARD, UMASS_PROTO_SCSI | UMASS_PROTO_BBB, FORCE_SHORT_INQUIRY | NO_START_STOP | IGNORE_RESIDUE }, { USB_VENDOR_HITACHI, USB_PRODUCT_HITACHI_DVDCAM_USB, RID_WILDCARD, UMASS_PROTO_ATAPI | UMASS_PROTO_CBI_I, NO_INQUIRY }, { USB_VENDOR_HP, USB_PRODUCT_HP_CDW8200, RID_WILDCARD, UMASS_PROTO_ATAPI | UMASS_PROTO_CBI_I, NO_TEST_UNIT_READY | NO_START_STOP }, { USB_VENDOR_INSYSTEM, USB_PRODUCT_INSYSTEM_USBCABLE, RID_WILDCARD, UMASS_PROTO_ATAPI | UMASS_PROTO_CBI, NO_TEST_UNIT_READY | NO_START_STOP | ALT_IFACE_1 }, { USB_VENDOR_IODATA, USB_PRODUCT_IODATA_IU_CD2, RID_WILDCARD, UMASS_PROTO_SCSI | UMASS_PROTO_BBB, NO_QUIRKS }, { USB_VENDOR_IODATA, USB_PRODUCT_IODATA_DVR_UEH8, RID_WILDCARD, UMASS_PROTO_SCSI | UMASS_PROTO_BBB, NO_QUIRKS }, { USB_VENDOR_IOMEGA, USB_PRODUCT_IOMEGA_ZIP100, RID_WILDCARD, /* XXX This is not correct as there are Zip drives that use ATAPI. */ UMASS_PROTO_SCSI | UMASS_PROTO_BBB, NO_TEST_UNIT_READY }, { USB_VENDOR_LOGITEC, USB_PRODUCT_LOGITEC_LDR_H443SU2, RID_WILDCARD, UMASS_PROTO_SCSI, NO_QUIRKS }, { USB_VENDOR_LOGITEC, USB_PRODUCT_LOGITEC_LDR_H443U2, RID_WILDCARD, UMASS_PROTO_SCSI | UMASS_PROTO_BBB, NO_QUIRKS }, { USB_VENDOR_MELCO, USB_PRODUCT_MELCO_DUBPXXG, RID_WILDCARD, UMASS_PROTO_SCSI | UMASS_PROTO_BBB, FORCE_SHORT_INQUIRY | NO_START_STOP | IGNORE_RESIDUE }, { USB_VENDOR_MICROTECH, USB_PRODUCT_MICROTECH_DPCM, RID_WILDCARD, UMASS_PROTO_SCSI | UMASS_PROTO_CBI, NO_TEST_UNIT_READY | NO_START_STOP }, { USB_VENDOR_MSYSTEMS, USB_PRODUCT_MSYSTEMS_DISKONKEY, RID_WILDCARD, UMASS_PROTO_SCSI | UMASS_PROTO_BBB, IGNORE_RESIDUE | NO_GETMAXLUN | RS_NO_CLEAR_UA }, { USB_VENDOR_MSYSTEMS, USB_PRODUCT_MSYSTEMS_DISKONKEY2, RID_WILDCARD, UMASS_PROTO_ATAPI | UMASS_PROTO_BBB, NO_QUIRKS }, { USB_VENDOR_NEODIO, USB_PRODUCT_NEODIO_ND3260, RID_WILDCARD, UMASS_PROTO_SCSI | UMASS_PROTO_BBB, FORCE_SHORT_INQUIRY }, { USB_VENDOR_OLYMPUS, USB_PRODUCT_OLYMPUS_C1, RID_WILDCARD, UMASS_PROTO_SCSI | UMASS_PROTO_BBB, WRONG_CSWSIG }, { USB_VENDOR_ONSPEC, USB_PRODUCT_ONSPEC_UCF100, RID_WILDCARD, UMASS_PROTO_ATAPI | UMASS_PROTO_BBB, NO_INQUIRY | NO_GETMAXLUN }, { USB_VENDOR_PANASONIC, USB_PRODUCT_PANASONIC_KXLCB20AN, RID_WILDCARD, UMASS_PROTO_SCSI | UMASS_PROTO_BBB, NO_QUIRKS }, { USB_VENDOR_PANASONIC, USB_PRODUCT_PANASONIC_KXLCB35AN, RID_WILDCARD, UMASS_PROTO_SCSI | UMASS_PROTO_BBB, NO_QUIRKS }, { USB_VENDOR_PLEXTOR, USB_PRODUCT_PLEXTOR_40_12_40U, RID_WILDCARD, UMASS_PROTO_SCSI | UMASS_PROTO_BBB, NO_TEST_UNIT_READY }, { USB_VENDOR_PNY, USB_PRODUCT_PNY_ATTACHE, RID_WILDCARD, UMASS_PROTO_SCSI | UMASS_PROTO_BBB, IGNORE_RESIDUE }, { USB_VENDOR_SANDISK, USB_PRODUCT_SANDISK_SDCZ2_256, RID_WILDCARD, UMASS_PROTO_SCSI | UMASS_PROTO_BBB, IGNORE_RESIDUE }, { USB_VENDOR_SCANLOGIC, USB_PRODUCT_SCANLOGIC_SL11R, RID_WILDCARD, UMASS_PROTO_ATAPI | UMASS_PROTO_BBB, NO_INQUIRY }, { USB_VENDOR_SHUTTLE, USB_PRODUCT_SHUTTLE_EUSB, RID_WILDCARD, UMASS_PROTO_ATAPI | UMASS_PROTO_CBI_I, NO_TEST_UNIT_READY | NO_START_STOP | SHUTTLE_INIT }, { USB_VENDOR_SIGMATEL, USB_PRODUCT_SIGMATEL_I_BEAD100, RID_WILDCARD, UMASS_PROTO_SCSI | UMASS_PROTO_BBB, SHUTTLE_INIT }, { USB_VENDOR_SIIG, USB_PRODUCT_SIIG_WINTERREADER, RID_WILDCARD, UMASS_PROTO_SCSI | UMASS_PROTO_BBB, IGNORE_RESIDUE }, { USB_VENDOR_SONY, USB_PRODUCT_SONY_DSC, RID_WILDCARD, UMASS_PROTO_RBC | UMASS_PROTO_CBI, NO_QUIRKS }, { USB_VENDOR_SONY, USB_PRODUCT_SONY_HANDYCAM, RID_WILDCARD, UMASS_PROTO_RBC | UMASS_PROTO_CBI, NO_QUIRKS }, { USB_VENDOR_SONY, USB_PRODUCT_SONY_MSC, RID_WILDCARD, UMASS_PROTO_RBC | UMASS_PROTO_CBI, NO_QUIRKS }, { USB_VENDOR_TREK, USB_PRODUCT_TREK_THUMBDRIVE_8MB, RID_WILDCARD, UMASS_PROTO_ATAPI | UMASS_PROTO_BBB, IGNORE_RESIDUE }, { USB_VENDOR_TRUMPION, USB_PRODUCT_TRUMPION_C3310, RID_WILDCARD, UMASS_PROTO_UFI | UMASS_PROTO_CBI, NO_QUIRKS }, { USB_VENDOR_TWINMOS, USB_PRODUCT_TWINMOS_MDIV, RID_WILDCARD, UMASS_PROTO_SCSI | UMASS_PROTO_BBB, NO_QUIRKS }, { USB_VENDOR_WESTERN, USB_PRODUCT_WESTERN_EXTHDD, RID_WILDCARD, UMASS_PROTO_SCSI | UMASS_PROTO_BBB, FORCE_SHORT_INQUIRY | NO_START_STOP | IGNORE_RESIDUE }, { USB_VENDOR_YANO, USB_PRODUCT_YANO_U640MO, RID_WILDCARD, UMASS_PROTO_ATAPI | UMASS_PROTO_CBI_I, FORCE_SHORT_INQUIRY }, { VID_EOT, PID_EOT, RID_EOT, 0, 0 } }; /* the per device structure */ struct umass_softc { USBBASEDEVICE sc_dev; /* base device */ usbd_device_handle sc_udev; /* USB device */ struct cam_sim *umass_sim; /* SCSI Interface Module */ unsigned char flags; /* various device flags */ # define UMASS_FLAGS_GONE 0x01 /* devices is no more */ u_int16_t proto; /* wire and cmd protocol */ u_int16_t quirks; /* they got it almost right */ usbd_interface_handle iface; /* Mass Storage interface */ int ifaceno; /* MS iface number */ u_int8_t bulkin; /* bulk-in Endpoint Address */ u_int8_t bulkout; /* bulk-out Endpoint Address */ u_int8_t intrin; /* intr-in Endp. (CBI) */ usbd_pipe_handle bulkin_pipe; usbd_pipe_handle bulkout_pipe; usbd_pipe_handle intrin_pipe; /* Reset the device in a wire protocol specific way */ wire_reset_f reset; /* The start of a wire transfer. It prepares the whole transfer (cmd, * data, and status stage) and initiates it. It is up to the state * machine (below) to handle the various stages and errors in these */ wire_transfer_f transfer; /* The state machine, handling the various states during a transfer */ wire_state_f state; /* The command transform function is used to conver the SCSI commands * into their derivatives, like UFI, ATAPI, and friends. */ command_transform_f transform; /* command transform */ /* Bulk specific variables for transfers in progress */ umass_bbb_cbw_t cbw; /* command block wrapper */ umass_bbb_csw_t csw; /* command status wrapper*/ /* CBI specific variables for transfers in progress */ umass_cbi_cbl_t cbl; /* command block */ umass_cbi_sbl_t sbl; /* status block */ /* generic variables for transfers in progress */ /* ctrl transfer requests */ usb_device_request_t request; /* xfer handles * Most of our operations are initiated from interrupt context, so * we need to avoid using the one that is in use. We want to avoid * allocating them in the interrupt context as well. */ /* indices into array below */ # define XFER_BBB_CBW 0 /* Bulk-Only */ # define XFER_BBB_DATA 1 # define XFER_BBB_DCLEAR 2 # define XFER_BBB_CSW1 3 # define XFER_BBB_CSW2 4 # define XFER_BBB_SCLEAR 5 # define XFER_BBB_RESET1 6 # define XFER_BBB_RESET2 7 # define XFER_BBB_RESET3 8 # define XFER_CBI_CB 0 /* CBI */ # define XFER_CBI_DATA 1 # define XFER_CBI_STATUS 2 # define XFER_CBI_DCLEAR 3 # define XFER_CBI_SCLEAR 4 # define XFER_CBI_RESET1 5 # define XFER_CBI_RESET2 6 # define XFER_CBI_RESET3 7 # define XFER_NR 9 /* maximum number */ usbd_xfer_handle transfer_xfer[XFER_NR]; /* for ctrl xfers */ int transfer_dir; /* data direction */ void *transfer_data; /* data buffer */ int transfer_datalen; /* (maximum) length */ int transfer_actlen; /* actual length */ transfer_cb_f transfer_cb; /* callback */ void *transfer_priv; /* for callback */ int transfer_status; int transfer_state; # define TSTATE_ATTACH 0 /* in attach */ # define TSTATE_IDLE 1 # define TSTATE_BBB_COMMAND 2 /* CBW transfer */ # define TSTATE_BBB_DATA 3 /* Data transfer */ # define TSTATE_BBB_DCLEAR 4 /* clear endpt stall */ # define TSTATE_BBB_STATUS1 5 /* clear endpt stall */ # define TSTATE_BBB_SCLEAR 6 /* clear endpt stall */ # define TSTATE_BBB_STATUS2 7 /* CSW transfer */ # define TSTATE_BBB_RESET1 8 /* reset command */ # define TSTATE_BBB_RESET2 9 /* in clear stall */ # define TSTATE_BBB_RESET3 10 /* out clear stall */ # define TSTATE_CBI_COMMAND 11 /* command transfer */ # define TSTATE_CBI_DATA 12 /* data transfer */ # define TSTATE_CBI_STATUS 13 /* status transfer */ # define TSTATE_CBI_DCLEAR 14 /* clear ep stall */ # define TSTATE_CBI_SCLEAR 15 /* clear ep stall */ # define TSTATE_CBI_RESET1 16 /* reset command */ # define TSTATE_CBI_RESET2 17 /* in clear stall */ # define TSTATE_CBI_RESET3 18 /* out clear stall */ # define TSTATE_STATES 19 /* # of states above */ /* SCSI/CAM specific variables */ unsigned char cam_scsi_command[CAM_MAX_CDBLEN]; unsigned char cam_scsi_command2[CAM_MAX_CDBLEN]; struct scsi_sense cam_scsi_sense; struct scsi_sense cam_scsi_test_unit_ready; usb_callout_t cam_scsi_rescan_ch; int timeout; /* in msecs */ int maxlun; /* maximum LUN number */ }; #ifdef USB_DEBUG char *states[TSTATE_STATES+1] = { /* should be kept in sync with the list at transfer_state */ "Attach", "Idle", "BBB CBW", "BBB Data", "BBB Data bulk-in/-out clear stall", "BBB CSW, 1st attempt", "BBB CSW bulk-in clear stall", "BBB CSW, 2nd attempt", "BBB Reset", "BBB bulk-in clear stall", "BBB bulk-out clear stall", "CBI Command", "CBI Data", "CBI Status", "CBI Data bulk-in/-out clear stall", "CBI Status intr-in clear stall", "CBI Reset", "CBI bulk-in clear stall", "CBI bulk-out clear stall", NULL }; #endif /* If device cannot return valid inquiry data, fake it */ Static uint8_t fake_inq_data[SHORT_INQUIRY_LENGTH] = { 0, /*removable*/ 0x80, SCSI_REV_2, SCSI_REV_2, /*additional_length*/ 31, 0, 0, 0 }; /* USB device probe/attach/detach functions */ USB_DECLARE_DRIVER(umass); Static int umass_match_proto (struct umass_softc *sc, usbd_interface_handle iface, usbd_device_handle udev); /* quirk functions */ Static void umass_init_shuttle (struct umass_softc *sc); /* generic transfer functions */ Static usbd_status umass_setup_transfer (struct umass_softc *sc, usbd_pipe_handle pipe, void *buffer, int buflen, int flags, usbd_xfer_handle xfer); Static usbd_status umass_setup_ctrl_transfer (struct umass_softc *sc, usbd_device_handle udev, usb_device_request_t *req, void *buffer, int buflen, int flags, usbd_xfer_handle xfer); Static void umass_clear_endpoint_stall (struct umass_softc *sc, u_int8_t endpt, usbd_pipe_handle pipe, int state, usbd_xfer_handle xfer); Static void umass_reset (struct umass_softc *sc, transfer_cb_f cb, void *priv); /* Bulk-Only related functions */ Static void umass_bbb_reset (struct umass_softc *sc, int status); Static void umass_bbb_transfer (struct umass_softc *sc, int lun, void *cmd, int cmdlen, void *data, int datalen, int dir, u_int timeout, transfer_cb_f cb, void *priv); Static void umass_bbb_state (usbd_xfer_handle xfer, usbd_private_handle priv, usbd_status err); Static int umass_bbb_get_max_lun (struct umass_softc *sc); /* CBI related functions */ Static int umass_cbi_adsc (struct umass_softc *sc, char *buffer, int buflen, usbd_xfer_handle xfer); Static void umass_cbi_reset (struct umass_softc *sc, int status); Static void umass_cbi_transfer (struct umass_softc *sc, int lun, void *cmd, int cmdlen, void *data, int datalen, int dir, u_int timeout, transfer_cb_f cb, void *priv); Static void umass_cbi_state (usbd_xfer_handle xfer, usbd_private_handle priv, usbd_status err); /* CAM related functions */ Static void umass_cam_action (struct cam_sim *sim, union ccb *ccb); Static void umass_cam_poll (struct cam_sim *sim); Static void umass_cam_cb (struct umass_softc *sc, void *priv, int residue, int status); Static void umass_cam_sense_cb (struct umass_softc *sc, void *priv, int residue, int status); Static void umass_cam_quirk_cb (struct umass_softc *sc, void *priv, int residue, int status); Static void umass_cam_rescan_callback (struct cam_periph *periph,union ccb *ccb); Static void umass_cam_rescan (void *addr); Static int umass_cam_attach_sim (struct umass_softc *sc); Static int umass_cam_attach (struct umass_softc *sc); Static int umass_cam_detach_sim (struct umass_softc *sc); /* SCSI specific functions */ Static int umass_scsi_transform (struct umass_softc *sc, unsigned char *cmd, int cmdlen, unsigned char **rcmd, int *rcmdlen); /* UFI specific functions */ #define UFI_COMMAND_LENGTH 12 /* UFI commands are always 12 bytes */ Static int umass_ufi_transform (struct umass_softc *sc, unsigned char *cmd, int cmdlen, unsigned char **rcmd, int *rcmdlen); /* ATAPI (8070i) specific functions */ #define ATAPI_COMMAND_LENGTH 12 /* ATAPI commands are always 12 bytes */ Static int umass_atapi_transform (struct umass_softc *sc, unsigned char *cmd, int cmdlen, unsigned char **rcmd, int *rcmdlen); /* RBC specific functions */ Static int umass_rbc_transform (struct umass_softc *sc, unsigned char *cmd, int cmdlen, unsigned char **rcmd, int *rcmdlen); #ifdef USB_DEBUG /* General debugging functions */ Static void umass_bbb_dump_cbw (struct umass_softc *sc, umass_bbb_cbw_t *cbw); Static void umass_bbb_dump_csw (struct umass_softc *sc, umass_bbb_csw_t *csw); Static void umass_cbi_dump_cmd (struct umass_softc *sc, void *cmd, int cmdlen); Static void umass_dump_buffer (struct umass_softc *sc, u_int8_t *buffer, int buflen, int printlen); #endif #if defined(__FreeBSD__) MODULE_DEPEND(umass, cam, 1,1,1); #endif /* * USB device probe/attach/detach */ /* * Match the device we are seeing with the devices supported. Fill in the * description in the softc accordingly. This function is called from both * probe and attach. */ Static int umass_match_proto(struct umass_softc *sc, usbd_interface_handle iface, usbd_device_handle udev) { usb_device_descriptor_t *dd; usb_interface_descriptor_t *id; int i; int found = 0; sc->sc_udev = udev; sc->proto = 0; sc->quirks = 0; dd = usbd_get_device_descriptor(udev); /* An entry specifically for Y-E Data devices as they don't fit in the * device description table. */ if (UGETW(dd->idVendor) == USB_VENDOR_YEDATA && UGETW(dd->idProduct) == USB_PRODUCT_YEDATA_FLASHBUSTERU) { /* Revisions < 1.28 do not handle the interrupt endpoint * very well. */ if (UGETW(dd->bcdDevice) < 0x128) { sc->proto = UMASS_PROTO_UFI | UMASS_PROTO_CBI; } else { sc->proto = UMASS_PROTO_UFI | UMASS_PROTO_CBI_I; } /* * Revisions < 1.28 do not have the TEST UNIT READY command * Revisions == 1.28 have a broken TEST UNIT READY */ if (UGETW(dd->bcdDevice) <= 0x128) sc->quirks |= NO_TEST_UNIT_READY; sc->quirks |= RS_NO_CLEAR_UA | FLOPPY_SPEED; return(UMATCH_VENDOR_PRODUCT); } /* Check the list of supported devices for a match. While looking, * check for wildcarded and fully matched. First match wins. */ for (i = 0; umass_devdescrs[i].vid != VID_EOT && !found; i++) { if (umass_devdescrs[i].vid == VID_WILDCARD && umass_devdescrs[i].pid == PID_WILDCARD && umass_devdescrs[i].rid == RID_WILDCARD) { printf("umass: ignoring invalid wildcard quirk\n"); continue; } if ((umass_devdescrs[i].vid == UGETW(dd->idVendor) || umass_devdescrs[i].vid == VID_WILDCARD) && (umass_devdescrs[i].pid == UGETW(dd->idProduct) || umass_devdescrs[i].pid == PID_WILDCARD)) { if (umass_devdescrs[i].rid == RID_WILDCARD) { sc->proto = umass_devdescrs[i].proto; sc->quirks = umass_devdescrs[i].quirks; return (UMATCH_VENDOR_PRODUCT); } else if (umass_devdescrs[i].rid == UGETW(dd->bcdDevice)) { sc->proto = umass_devdescrs[i].proto; sc->quirks = umass_devdescrs[i].quirks; return (UMATCH_VENDOR_PRODUCT_REV); } /* else RID does not match */ } } /* Check for a standards compliant device */ id = usbd_get_interface_descriptor(iface); if (id == NULL || id->bInterfaceClass != UICLASS_MASS) return(UMATCH_NONE); switch (id->bInterfaceSubClass) { case UISUBCLASS_SCSI: sc->proto |= UMASS_PROTO_SCSI; break; case UISUBCLASS_UFI: sc->proto |= UMASS_PROTO_UFI; break; case UISUBCLASS_RBC: sc->proto |= UMASS_PROTO_RBC; break; case UISUBCLASS_SFF8020I: case UISUBCLASS_SFF8070I: sc->proto |= UMASS_PROTO_ATAPI; break; default: DPRINTF(UDMASS_GEN, ("%s: Unsupported command protocol %d\n", USBDEVNAME(sc->sc_dev), id->bInterfaceSubClass)); return(UMATCH_NONE); } switch (id->bInterfaceProtocol) { case UIPROTO_MASS_CBI: sc->proto |= UMASS_PROTO_CBI; break; case UIPROTO_MASS_CBI_I: sc->proto |= UMASS_PROTO_CBI_I; break; case UIPROTO_MASS_BBB_OLD: case UIPROTO_MASS_BBB: sc->proto |= UMASS_PROTO_BBB; break; default: DPRINTF(UDMASS_GEN, ("%s: Unsupported wire protocol %d\n", USBDEVNAME(sc->sc_dev), id->bInterfaceProtocol)); return(UMATCH_NONE); } return(UMATCH_DEVCLASS_DEVSUBCLASS_DEVPROTO); } USB_MATCH(umass) { USB_MATCH_START(umass, uaa); struct umass_softc *sc = device_get_softc(self); USB_MATCH_SETUP; if (uaa->iface == NULL) return(UMATCH_NONE); return(umass_match_proto(sc, uaa->iface, uaa->device)); } USB_ATTACH(umass) { USB_ATTACH_START(umass, sc, uaa); usb_interface_descriptor_t *id; usb_endpoint_descriptor_t *ed; char devinfo[1024]; int i; int err; /* * the softc struct is bzero-ed in device_set_driver. We can safely * call umass_detach without specifically initialising the struct. */ usbd_devinfo(uaa->device, 0, devinfo); USB_ATTACH_SETUP; sc->iface = uaa->iface; sc->ifaceno = uaa->ifaceno; usb_callout_init(sc->cam_scsi_rescan_ch); /* initialise the proto and drive values in the umass_softc (again) */ (void) umass_match_proto(sc, sc->iface, uaa->device); id = usbd_get_interface_descriptor(sc->iface); #ifdef USB_DEBUG printf("%s: ", USBDEVNAME(sc->sc_dev)); switch (sc->proto&UMASS_PROTO_COMMAND) { case UMASS_PROTO_SCSI: printf("SCSI"); break; case UMASS_PROTO_ATAPI: printf("8070i (ATAPI)"); break; case UMASS_PROTO_UFI: printf("UFI"); break; case UMASS_PROTO_RBC: printf("RBC"); break; default: printf("(unknown 0x%02x)", sc->proto&UMASS_PROTO_COMMAND); break; } printf(" over "); switch (sc->proto&UMASS_PROTO_WIRE) { case UMASS_PROTO_BBB: printf("Bulk-Only"); break; case UMASS_PROTO_CBI: /* uses Comand/Bulk pipes */ printf("CBI"); break; case UMASS_PROTO_CBI_I: /* uses Comand/Bulk/Interrupt pipes */ printf("CBI with CCI"); #ifndef CBI_I printf(" (using CBI)"); #endif break; default: printf("(unknown 0x%02x)", sc->proto&UMASS_PROTO_WIRE); } printf("; quirks = 0x%04x\n", sc->quirks); #endif #ifndef CBI_I if (sc->proto & UMASS_PROTO_CBI_I) { /* See beginning of file for comment on the use of CBI with CCI */ sc->proto = (sc->proto & ~UMASS_PROTO_CBI_I) | UMASS_PROTO_CBI; } #endif if (sc->quirks & ALT_IFACE_1) { err = usbd_set_interface(uaa->iface, 1); if (err) { DPRINTF(UDMASS_USB, ("%s: could not switch to " "Alt Interface %d\n", USBDEVNAME(sc->sc_dev), 1)); umass_detach(self); USB_ATTACH_ERROR_RETURN; } } /* * In addition to the Control endpoint the following endpoints * are required: * a) bulk-in endpoint. * b) bulk-out endpoint. * and for Control/Bulk/Interrupt with CCI (CBI_I) * c) intr-in * * The endpoint addresses are not fixed, so we have to read them * from the device descriptors of the current interface. */ for (i = 0 ; i < id->bNumEndpoints ; i++) { ed = usbd_interface2endpoint_descriptor(sc->iface, i); if (!ed) { printf("%s: could not read endpoint descriptor\n", USBDEVNAME(sc->sc_dev)); USB_ATTACH_ERROR_RETURN; } if (UE_GET_DIR(ed->bEndpointAddress) == UE_DIR_IN && (ed->bmAttributes & UE_XFERTYPE) == UE_BULK) { sc->bulkin = ed->bEndpointAddress; } else if (UE_GET_DIR(ed->bEndpointAddress) == UE_DIR_OUT && (ed->bmAttributes & UE_XFERTYPE) == UE_BULK) { sc->bulkout = ed->bEndpointAddress; } else if (sc->proto & UMASS_PROTO_CBI_I && UE_GET_DIR(ed->bEndpointAddress) == UE_DIR_IN && (ed->bmAttributes & UE_XFERTYPE) == UE_INTERRUPT) { sc->intrin = ed->bEndpointAddress; #ifdef USB_DEBUG if (UGETW(ed->wMaxPacketSize) > 2) { DPRINTF(UDMASS_CBI, ("%s: intr size is %d\n", USBDEVNAME(sc->sc_dev), UGETW(ed->wMaxPacketSize))); } #endif } } /* check whether we found all the endpoints we need */ if (!sc->bulkin || !sc->bulkout || (sc->proto & UMASS_PROTO_CBI_I && !sc->intrin) ) { DPRINTF(UDMASS_USB, ("%s: endpoint not found %d/%d/%d\n", USBDEVNAME(sc->sc_dev), sc->bulkin, sc->bulkout, sc->intrin)); umass_detach(self); USB_ATTACH_ERROR_RETURN; } /* Open the bulk-in and -out pipe */ err = usbd_open_pipe(sc->iface, sc->bulkout, USBD_EXCLUSIVE_USE, &sc->bulkout_pipe); if (err) { DPRINTF(UDMASS_USB, ("%s: cannot open %d-out pipe (bulk)\n", USBDEVNAME(sc->sc_dev), sc->bulkout)); umass_detach(self); USB_ATTACH_ERROR_RETURN; } err = usbd_open_pipe(sc->iface, sc->bulkin, USBD_EXCLUSIVE_USE, &sc->bulkin_pipe); if (err) { DPRINTF(UDMASS_USB, ("%s: could not open %d-in pipe (bulk)\n", USBDEVNAME(sc->sc_dev), sc->bulkin)); umass_detach(self); USB_ATTACH_ERROR_RETURN; } /* Open the intr-in pipe if the protocol is CBI with CCI. * Note: early versions of the Zip drive do have an interrupt pipe, but * this pipe is unused. * * We do not open the interrupt pipe as an interrupt pipe, but as a * normal bulk endpoint. We send an IN transfer down the wire at the * appropriate time, because we know exactly when to expect data on * that endpoint. This saves bandwidth, but more important, makes the * code for handling the data on that endpoint simpler. No data * arriving concurrently. */ if (sc->proto & UMASS_PROTO_CBI_I) { err = usbd_open_pipe(sc->iface, sc->intrin, USBD_EXCLUSIVE_USE, &sc->intrin_pipe); if (err) { DPRINTF(UDMASS_USB, ("%s: couldn't open %d-in (intr)\n", USBDEVNAME(sc->sc_dev), sc->intrin)); umass_detach(self); USB_ATTACH_ERROR_RETURN; } } /* initialisation of generic part */ sc->transfer_state = TSTATE_ATTACH; /* request a sufficient number of xfer handles */ for (i = 0; i < XFER_NR; i++) { sc->transfer_xfer[i] = usbd_alloc_xfer(uaa->device); if (!sc->transfer_xfer[i]) { DPRINTF(UDMASS_USB, ("%s: Out of memory\n", USBDEVNAME(sc->sc_dev))); umass_detach(self); USB_ATTACH_ERROR_RETURN; } } /* Initialise the wire protocol specific methods */ if (sc->proto & UMASS_PROTO_BBB) { sc->reset = umass_bbb_reset; sc->transfer = umass_bbb_transfer; sc->state = umass_bbb_state; } else if (sc->proto & (UMASS_PROTO_CBI|UMASS_PROTO_CBI_I)) { sc->reset = umass_cbi_reset; sc->transfer = umass_cbi_transfer; sc->state = umass_cbi_state; #ifdef USB_DEBUG } else { panic("%s:%d: Unknown proto 0x%02x", __FILE__, __LINE__, sc->proto); #endif } if (sc->proto & UMASS_PROTO_SCSI) sc->transform = umass_scsi_transform; else if (sc->proto & UMASS_PROTO_UFI) sc->transform = umass_ufi_transform; else if (sc->proto & UMASS_PROTO_ATAPI) sc->transform = umass_atapi_transform; else if (sc->proto & UMASS_PROTO_RBC) sc->transform = umass_rbc_transform; #ifdef USB_DEBUG else panic("No transformation defined for command proto 0x%02x", sc->proto & UMASS_PROTO_COMMAND); #endif /* From here onwards the device can be used. */ if (sc->quirks & SHUTTLE_INIT) umass_init_shuttle(sc); /* Get the maximum LUN supported by the device. */ if ((sc->proto & UMASS_PROTO_WIRE) == UMASS_PROTO_BBB) sc->maxlun = umass_bbb_get_max_lun(sc); else sc->maxlun = 0; if ((sc->proto & UMASS_PROTO_SCSI) || (sc->proto & UMASS_PROTO_ATAPI) || (sc->proto & UMASS_PROTO_UFI) || (sc->proto & UMASS_PROTO_RBC)) { /* Prepare the SCSI command block */ sc->cam_scsi_sense.opcode = REQUEST_SENSE; sc->cam_scsi_test_unit_ready.opcode = TEST_UNIT_READY; /* register the SIM */ err = umass_cam_attach_sim(sc); if (err) { umass_detach(self); USB_ATTACH_ERROR_RETURN; } /* scan the new sim */ err = umass_cam_attach(sc); if (err) { umass_cam_detach_sim(sc); umass_detach(self); USB_ATTACH_ERROR_RETURN; } } else { panic("%s:%d: Unknown proto 0x%02x", __FILE__, __LINE__, sc->proto); } sc->transfer_state = TSTATE_IDLE; DPRINTF(UDMASS_GEN, ("%s: Attach finished\n", USBDEVNAME(sc->sc_dev))); USB_ATTACH_SUCCESS_RETURN; } USB_DETACH(umass) { USB_DETACH_START(umass, sc); int err = 0; int i; DPRINTF(UDMASS_USB, ("%s: detached\n", USBDEVNAME(sc->sc_dev))); sc->flags |= UMASS_FLAGS_GONE; /* abort all the pipes in case there are transfers active. */ usbd_abort_default_pipe(sc->sc_udev); if (sc->bulkout_pipe) usbd_abort_pipe(sc->bulkout_pipe); if (sc->bulkin_pipe) usbd_abort_pipe(sc->bulkin_pipe); if (sc->intrin_pipe) usbd_abort_pipe(sc->intrin_pipe); usb_uncallout_drain(sc->cam_scsi_rescan_ch, umass_cam_rescan, sc); if ((sc->proto & UMASS_PROTO_SCSI) || (sc->proto & UMASS_PROTO_ATAPI) || (sc->proto & UMASS_PROTO_UFI) || (sc->proto & UMASS_PROTO_RBC)) /* detach the SCSI host controller (SIM) */ err = umass_cam_detach_sim(sc); for (i = 0; i < XFER_NR; i++) if (sc->transfer_xfer[i]) usbd_free_xfer(sc->transfer_xfer[i]); /* remove all the pipes */ if (sc->bulkout_pipe) usbd_close_pipe(sc->bulkout_pipe); if (sc->bulkin_pipe) usbd_close_pipe(sc->bulkin_pipe); if (sc->intrin_pipe) usbd_close_pipe(sc->intrin_pipe); return(err); } Static void umass_init_shuttle(struct umass_softc *sc) { usb_device_request_t req; u_char status[2]; /* The Linux driver does this, but no one can tell us what the * command does. */ req.bmRequestType = UT_READ_VENDOR_DEVICE; req.bRequest = 1; /* XXX unknown command */ USETW(req.wValue, 0); USETW(req.wIndex, sc->ifaceno); USETW(req.wLength, sizeof status); (void) usbd_do_request(sc->sc_udev, &req, &status); DPRINTF(UDMASS_GEN, ("%s: Shuttle init returned 0x%02x%02x\n", USBDEVNAME(sc->sc_dev), status[0], status[1])); } /* * Generic functions to handle transfers */ Static usbd_status umass_setup_transfer(struct umass_softc *sc, usbd_pipe_handle pipe, void *buffer, int buflen, int flags, usbd_xfer_handle xfer) { usbd_status err; /* Initialise a USB transfer and then schedule it */ (void) usbd_setup_xfer(xfer, pipe, (void *) sc, buffer, buflen, flags, sc->timeout, sc->state); err = usbd_transfer(xfer); if (err && err != USBD_IN_PROGRESS) { DPRINTF(UDMASS_BBB, ("%s: failed to setup transfer, %s\n", USBDEVNAME(sc->sc_dev), usbd_errstr(err))); return(err); } return (USBD_NORMAL_COMPLETION); } Static usbd_status umass_setup_ctrl_transfer(struct umass_softc *sc, usbd_device_handle udev, usb_device_request_t *req, void *buffer, int buflen, int flags, usbd_xfer_handle xfer) { usbd_status err; /* Initialise a USB control transfer and then schedule it */ (void) usbd_setup_default_xfer(xfer, udev, (void *) sc, sc->timeout, req, buffer, buflen, flags, sc->state); err = usbd_transfer(xfer); if (err && err != USBD_IN_PROGRESS) { DPRINTF(UDMASS_BBB, ("%s: failed to setup ctrl transfer, %s\n", USBDEVNAME(sc->sc_dev), usbd_errstr(err))); /* do not reset, as this would make us loop */ return(err); } return (USBD_NORMAL_COMPLETION); } Static void umass_clear_endpoint_stall(struct umass_softc *sc, u_int8_t endpt, usbd_pipe_handle pipe, int state, usbd_xfer_handle xfer) { usbd_device_handle udev; DPRINTF(UDMASS_BBB, ("%s: Clear endpoint 0x%02x stall\n", USBDEVNAME(sc->sc_dev), endpt)); usbd_interface2device_handle(sc->iface, &udev); sc->transfer_state = state; usbd_clear_endpoint_toggle(pipe); sc->request.bmRequestType = UT_WRITE_ENDPOINT; sc->request.bRequest = UR_CLEAR_FEATURE; USETW(sc->request.wValue, UF_ENDPOINT_HALT); USETW(sc->request.wIndex, endpt); USETW(sc->request.wLength, 0); umass_setup_ctrl_transfer(sc, udev, &sc->request, NULL, 0, 0, xfer); } Static void umass_reset(struct umass_softc *sc, transfer_cb_f cb, void *priv) { sc->transfer_cb = cb; sc->transfer_priv = priv; /* The reset is a forced reset, so no error (yet) */ sc->reset(sc, STATUS_CMD_OK); } /* * Bulk protocol specific functions */ Static void umass_bbb_reset(struct umass_softc *sc, int status) { usbd_device_handle udev; KASSERT(sc->proto & UMASS_PROTO_BBB, ("%s: umass_bbb_reset: wrong sc->proto 0x%02x\n", USBDEVNAME(sc->sc_dev), sc->proto)); /* * Reset recovery (5.3.4 in Universal Serial Bus Mass Storage Class) * * For Reset Recovery the host shall issue in the following order: * a) a Bulk-Only Mass Storage Reset * b) a Clear Feature HALT to the Bulk-In endpoint * c) a Clear Feature HALT to the Bulk-Out endpoint * * This is done in 3 steps, states: * TSTATE_BBB_RESET1 * TSTATE_BBB_RESET2 * TSTATE_BBB_RESET3 * * If the reset doesn't succeed, the device should be port reset. */ DPRINTF(UDMASS_BBB, ("%s: Bulk Reset\n", USBDEVNAME(sc->sc_dev))); sc->transfer_state = TSTATE_BBB_RESET1; sc->transfer_status = status; usbd_interface2device_handle(sc->iface, &udev); /* reset is a class specific interface write */ sc->request.bmRequestType = UT_WRITE_CLASS_INTERFACE; sc->request.bRequest = UR_BBB_RESET; USETW(sc->request.wValue, 0); USETW(sc->request.wIndex, sc->ifaceno); USETW(sc->request.wLength, 0); umass_setup_ctrl_transfer(sc, udev, &sc->request, NULL, 0, 0, sc->transfer_xfer[XFER_BBB_RESET1]); } Static void umass_bbb_transfer(struct umass_softc *sc, int lun, void *cmd, int cmdlen, void *data, int datalen, int dir, u_int timeout, transfer_cb_f cb, void *priv) { KASSERT(sc->proto & UMASS_PROTO_BBB, ("%s: umass_bbb_transfer: wrong sc->proto 0x%02x\n", USBDEVNAME(sc->sc_dev), sc->proto)); /* Be a little generous. */ sc->timeout = timeout + UMASS_TIMEOUT; /* * Do a Bulk-Only transfer with cmdlen bytes from cmd, possibly * a data phase of datalen bytes from/to the device and finally a * csw read phase. * If the data direction was inbound a maximum of datalen bytes * is stored in the buffer pointed to by data. * * umass_bbb_transfer initialises the transfer and lets the state * machine in umass_bbb_state handle the completion. It uses the * following states: * TSTATE_BBB_COMMAND * -> TSTATE_BBB_DATA * -> TSTATE_BBB_STATUS * -> TSTATE_BBB_STATUS2 * -> TSTATE_BBB_IDLE * * An error in any of those states will invoke * umass_bbb_reset. */ /* check the given arguments */ KASSERT(datalen == 0 || data != NULL, ("%s: datalen > 0, but no buffer",USBDEVNAME(sc->sc_dev))); KASSERT(cmdlen <= CBWCDBLENGTH, ("%s: cmdlen exceeds CDB length in CBW (%d > %d)", USBDEVNAME(sc->sc_dev), cmdlen, CBWCDBLENGTH)); KASSERT(dir == DIR_NONE || datalen > 0, ("%s: datalen == 0 while direction is not NONE\n", USBDEVNAME(sc->sc_dev))); KASSERT(datalen == 0 || dir != DIR_NONE, ("%s: direction is NONE while datalen is not zero\n", USBDEVNAME(sc->sc_dev))); KASSERT(sizeof(umass_bbb_cbw_t) == UMASS_BBB_CBW_SIZE, ("%s: CBW struct does not have the right size (%ld vs. %d)\n", USBDEVNAME(sc->sc_dev), (long)sizeof(umass_bbb_cbw_t), UMASS_BBB_CBW_SIZE)); KASSERT(sizeof(umass_bbb_csw_t) == UMASS_BBB_CSW_SIZE, ("%s: CSW struct does not have the right size (%ld vs. %d)\n", USBDEVNAME(sc->sc_dev), (long)sizeof(umass_bbb_csw_t), UMASS_BBB_CSW_SIZE)); /* * Determine the direction of the data transfer and the length. * * dCBWDataTransferLength (datalen) : * This field indicates the number of bytes of data that the host * intends to transfer on the IN or OUT Bulk endpoint(as indicated by * the Direction bit) during the execution of this command. If this * field is set to 0, the device will expect that no data will be * transferred IN or OUT during this command, regardless of the value * of the Direction bit defined in dCBWFlags. * * dCBWFlags (dir) : * The bits of the Flags field are defined as follows: * Bits 0-6 reserved * Bit 7 Direction - this bit shall be ignored if the * dCBWDataTransferLength field is zero. * 0 = data Out from host to device * 1 = data In from device to host */ /* Fill in the Command Block Wrapper * We fill in all the fields, so there is no need to bzero it first. */ USETDW(sc->cbw.dCBWSignature, CBWSIGNATURE); /* We don't care about the initial value, as long as the values are unique */ USETDW(sc->cbw.dCBWTag, UGETDW(sc->cbw.dCBWTag) + 1); USETDW(sc->cbw.dCBWDataTransferLength, datalen); /* DIR_NONE is treated as DIR_OUT (0x00) */ sc->cbw.bCBWFlags = (dir == DIR_IN? CBWFLAGS_IN:CBWFLAGS_OUT); sc->cbw.bCBWLUN = lun; sc->cbw.bCDBLength = cmdlen; bcopy(cmd, sc->cbw.CBWCDB, cmdlen); DIF(UDMASS_BBB, umass_bbb_dump_cbw(sc, &sc->cbw)); /* store the details for the data transfer phase */ sc->transfer_dir = dir; sc->transfer_data = data; sc->transfer_datalen = datalen; sc->transfer_actlen = 0; sc->transfer_cb = cb; sc->transfer_priv = priv; sc->transfer_status = STATUS_CMD_OK; /* move from idle to the command state */ sc->transfer_state = TSTATE_BBB_COMMAND; /* Send the CBW from host to device via bulk-out endpoint. */ if (umass_setup_transfer(sc, sc->bulkout_pipe, &sc->cbw, UMASS_BBB_CBW_SIZE, 0, sc->transfer_xfer[XFER_BBB_CBW])) { umass_bbb_reset(sc, STATUS_WIRE_FAILED); } } Static void umass_bbb_state(usbd_xfer_handle xfer, usbd_private_handle priv, usbd_status err) { struct umass_softc *sc = (struct umass_softc *) priv; usbd_xfer_handle next_xfer; KASSERT(sc->proto & UMASS_PROTO_BBB, ("%s: umass_bbb_state: wrong sc->proto 0x%02x\n", USBDEVNAME(sc->sc_dev), sc->proto)); /* * State handling for BBB transfers. * * The subroutine is rather long. It steps through the states given in * Annex A of the Bulk-Only specification. * Each state first does the error handling of the previous transfer * and then prepares the next transfer. * Each transfer is done asynchronously so after the request/transfer * has been submitted you will find a 'return;'. */ DPRINTF(UDMASS_BBB, ("%s: Handling BBB state %d (%s), xfer=%p, %s\n", USBDEVNAME(sc->sc_dev), sc->transfer_state, states[sc->transfer_state], xfer, usbd_errstr(err))); /* Give up if the device has detached. */ if (sc->flags & UMASS_FLAGS_GONE) { sc->transfer_state = TSTATE_IDLE; sc->transfer_cb(sc, sc->transfer_priv, sc->transfer_datalen, STATUS_CMD_FAILED); return; } switch (sc->transfer_state) { /***** Bulk Transfer *****/ case TSTATE_BBB_COMMAND: /* Command transport phase, error handling */ if (err) { DPRINTF(UDMASS_BBB, ("%s: failed to send CBW\n", USBDEVNAME(sc->sc_dev))); /* If the device detects that the CBW is invalid, then * the device may STALL both bulk endpoints and require * a Bulk-Reset */ umass_bbb_reset(sc, STATUS_WIRE_FAILED); return; } /* Data transport phase, setup transfer */ sc->transfer_state = TSTATE_BBB_DATA; if (sc->transfer_dir == DIR_IN) { if (umass_setup_transfer(sc, sc->bulkin_pipe, sc->transfer_data, sc->transfer_datalen, USBD_SHORT_XFER_OK, sc->transfer_xfer[XFER_BBB_DATA])) umass_bbb_reset(sc, STATUS_WIRE_FAILED); return; } else if (sc->transfer_dir == DIR_OUT) { if (umass_setup_transfer(sc, sc->bulkout_pipe, sc->transfer_data, sc->transfer_datalen, 0, /* fixed length transfer */ sc->transfer_xfer[XFER_BBB_DATA])) umass_bbb_reset(sc, STATUS_WIRE_FAILED); return; } else { DPRINTF(UDMASS_BBB, ("%s: no data phase\n", USBDEVNAME(sc->sc_dev))); } /* FALLTHROUGH if no data phase, err == 0 */ case TSTATE_BBB_DATA: /* Command transport phase, error handling (ignored if no data * phase (fallthrough from previous state)) */ if (sc->transfer_dir != DIR_NONE) { /* retrieve the length of the transfer that was done */ usbd_get_xfer_status(xfer, NULL, NULL, &sc->transfer_actlen, NULL); if (err) { DPRINTF(UDMASS_BBB, ("%s: Data-%s %db failed, " "%s\n", USBDEVNAME(sc->sc_dev), (sc->transfer_dir == DIR_IN?"in":"out"), sc->transfer_datalen,usbd_errstr(err))); if (err == USBD_STALLED) { umass_clear_endpoint_stall(sc, (sc->transfer_dir == DIR_IN? sc->bulkin:sc->bulkout), (sc->transfer_dir == DIR_IN? sc->bulkin_pipe:sc->bulkout_pipe), TSTATE_BBB_DCLEAR, sc->transfer_xfer[XFER_BBB_DCLEAR]); return; } else { /* Unless the error is a pipe stall the * error is fatal. */ umass_bbb_reset(sc,STATUS_WIRE_FAILED); return; } } } DIF(UDMASS_BBB, if (sc->transfer_dir == DIR_IN) umass_dump_buffer(sc, sc->transfer_data, sc->transfer_datalen, 48)); /* FALLTHROUGH, err == 0 (no data phase or successfull) */ case TSTATE_BBB_DCLEAR: /* stall clear after data phase */ case TSTATE_BBB_SCLEAR: /* stall clear after status phase */ /* Reading of CSW after bulk stall condition in data phase * (TSTATE_BBB_DATA2) or bulk-in stall condition after * reading CSW (TSTATE_BBB_SCLEAR). * In the case of no data phase or successfull data phase, * err == 0 and the following if block is passed. */ if (err) { /* should not occur */ /* try the transfer below, even if clear stall failed */ DPRINTF(UDMASS_BBB, ("%s: bulk-%s stall clear failed" ", %s\n", USBDEVNAME(sc->sc_dev), (sc->transfer_dir == DIR_IN? "in":"out"), usbd_errstr(err))); umass_bbb_reset(sc, STATUS_WIRE_FAILED); return; } /* Status transport phase, setup transfer */ if (sc->transfer_state == TSTATE_BBB_COMMAND || sc->transfer_state == TSTATE_BBB_DATA || sc->transfer_state == TSTATE_BBB_DCLEAR) { /* After no data phase, successfull data phase and * after clearing bulk-in/-out stall condition */ sc->transfer_state = TSTATE_BBB_STATUS1; next_xfer = sc->transfer_xfer[XFER_BBB_CSW1]; } else { /* After first attempt of fetching CSW */ sc->transfer_state = TSTATE_BBB_STATUS2; next_xfer = sc->transfer_xfer[XFER_BBB_CSW2]; } /* Read the Command Status Wrapper via bulk-in endpoint. */ if (umass_setup_transfer(sc, sc->bulkin_pipe, &sc->csw, UMASS_BBB_CSW_SIZE, 0, next_xfer)) { umass_bbb_reset(sc, STATUS_WIRE_FAILED); return; } return; case TSTATE_BBB_STATUS1: /* first attempt */ case TSTATE_BBB_STATUS2: /* second attempt */ /* Status transfer, error handling */ if (err) { DPRINTF(UDMASS_BBB, ("%s: Failed to read CSW, %s%s\n", USBDEVNAME(sc->sc_dev), usbd_errstr(err), (sc->transfer_state == TSTATE_BBB_STATUS1? ", retrying":""))); /* If this was the first attempt at fetching the CSW * retry it, otherwise fail. */ if (sc->transfer_state == TSTATE_BBB_STATUS1) { umass_clear_endpoint_stall(sc, sc->bulkin, sc->bulkin_pipe, TSTATE_BBB_SCLEAR, sc->transfer_xfer[XFER_BBB_SCLEAR]); return; } else { umass_bbb_reset(sc, STATUS_WIRE_FAILED); return; } } DIF(UDMASS_BBB, umass_bbb_dump_csw(sc, &sc->csw)); /* Translate weird command-status signatures. */ if ((sc->quirks & WRONG_CSWSIG) && UGETDW(sc->csw.dCSWSignature) == CSWSIGNATURE_OLYMPUS_C1) USETDW(sc->csw.dCSWSignature, CSWSIGNATURE); int Residue; Residue = UGETDW(sc->csw.dCSWDataResidue); if (Residue == 0 && sc->transfer_datalen - sc->transfer_actlen != 0) Residue = sc->transfer_datalen - sc->transfer_actlen; /* Check CSW and handle any error */ if (UGETDW(sc->csw.dCSWSignature) != CSWSIGNATURE) { /* Invalid CSW: Wrong signature or wrong tag might * indicate that the device is confused -> reset it. */ printf("%s: Invalid CSW: sig 0x%08x should be 0x%08x\n", USBDEVNAME(sc->sc_dev), UGETDW(sc->csw.dCSWSignature), CSWSIGNATURE); umass_bbb_reset(sc, STATUS_WIRE_FAILED); return; } else if (UGETDW(sc->csw.dCSWTag) != UGETDW(sc->cbw.dCBWTag)) { printf("%s: Invalid CSW: tag %d should be %d\n", USBDEVNAME(sc->sc_dev), UGETDW(sc->csw.dCSWTag), UGETDW(sc->cbw.dCBWTag)); umass_bbb_reset(sc, STATUS_WIRE_FAILED); return; /* CSW is valid here */ } else if (sc->csw.bCSWStatus > CSWSTATUS_PHASE) { printf("%s: Invalid CSW: status %d > %d\n", USBDEVNAME(sc->sc_dev), sc->csw.bCSWStatus, CSWSTATUS_PHASE); umass_bbb_reset(sc, STATUS_WIRE_FAILED); return; } else if (sc->csw.bCSWStatus == CSWSTATUS_PHASE) { printf("%s: Phase Error, residue = %d\n", USBDEVNAME(sc->sc_dev), Residue); umass_bbb_reset(sc, STATUS_WIRE_FAILED); return; } else if (sc->transfer_actlen > sc->transfer_datalen) { /* Buffer overrun! Don't let this go by unnoticed */ panic("%s: transferred %db instead of %db", USBDEVNAME(sc->sc_dev), sc->transfer_actlen, sc->transfer_datalen); } else if (sc->csw.bCSWStatus == CSWSTATUS_FAILED) { DPRINTF(UDMASS_BBB, ("%s: Command Failed, res = %d\n", USBDEVNAME(sc->sc_dev), Residue)); /* SCSI command failed but transfer was succesful */ sc->transfer_state = TSTATE_IDLE; sc->transfer_cb(sc, sc->transfer_priv, Residue, STATUS_CMD_FAILED); return; } else { /* success */ sc->transfer_state = TSTATE_IDLE; sc->transfer_cb(sc, sc->transfer_priv, Residue, STATUS_CMD_OK); return; } /***** Bulk Reset *****/ case TSTATE_BBB_RESET1: if (err) printf("%s: BBB reset failed, %s\n", USBDEVNAME(sc->sc_dev), usbd_errstr(err)); umass_clear_endpoint_stall(sc, sc->bulkin, sc->bulkin_pipe, TSTATE_BBB_RESET2, sc->transfer_xfer[XFER_BBB_RESET2]); return; case TSTATE_BBB_RESET2: if (err) /* should not occur */ printf("%s: BBB bulk-in clear stall failed, %s\n", USBDEVNAME(sc->sc_dev), usbd_errstr(err)); /* no error recovery, otherwise we end up in a loop */ umass_clear_endpoint_stall(sc, sc->bulkout, sc->bulkout_pipe, TSTATE_BBB_RESET3, sc->transfer_xfer[XFER_BBB_RESET3]); return; case TSTATE_BBB_RESET3: if (err) /* should not occur */ printf("%s: BBB bulk-out clear stall failed, %s\n", USBDEVNAME(sc->sc_dev), usbd_errstr(err)); /* no error recovery, otherwise we end up in a loop */ sc->transfer_state = TSTATE_IDLE; if (sc->transfer_priv) { sc->transfer_cb(sc, sc->transfer_priv, sc->transfer_datalen, sc->transfer_status); } return; /***** Default *****/ default: panic("%s: Unknown state %d", USBDEVNAME(sc->sc_dev), sc->transfer_state); } } Static int umass_bbb_get_max_lun(struct umass_softc *sc) { usbd_device_handle udev; usb_device_request_t req; usbd_status err; usb_interface_descriptor_t *id; int maxlun = 0; u_int8_t buf = 0; usbd_interface2device_handle(sc->iface, &udev); id = usbd_get_interface_descriptor(sc->iface); /* The Get Max Lun command is a class-specific request. */ req.bmRequestType = UT_READ_CLASS_INTERFACE; req.bRequest = UR_BBB_GET_MAX_LUN; USETW(req.wValue, 0); USETW(req.wIndex, id->bInterfaceNumber); USETW(req.wLength, 1); err = usbd_do_request(udev, &req, &buf); switch (err) { case USBD_NORMAL_COMPLETION: maxlun = buf; DPRINTF(UDMASS_BBB, ("%s: Max Lun is %d\n", USBDEVNAME(sc->sc_dev), maxlun)); break; case USBD_STALLED: case USBD_SHORT_XFER: default: /* Device doesn't support Get Max Lun request. */ printf("%s: Get Max Lun not supported (%s)\n", USBDEVNAME(sc->sc_dev), usbd_errstr(err)); /* XXX Should we port_reset the device? */ break; } return(maxlun); } /* * Command/Bulk/Interrupt (CBI) specific functions */ Static int umass_cbi_adsc(struct umass_softc *sc, char *buffer, int buflen, usbd_xfer_handle xfer) { usbd_device_handle udev; KASSERT(sc->proto & (UMASS_PROTO_CBI|UMASS_PROTO_CBI_I), ("%s: umass_cbi_adsc: wrong sc->proto 0x%02x\n", USBDEVNAME(sc->sc_dev), sc->proto)); usbd_interface2device_handle(sc->iface, &udev); sc->request.bmRequestType = UT_WRITE_CLASS_INTERFACE; sc->request.bRequest = UR_CBI_ADSC; USETW(sc->request.wValue, 0); USETW(sc->request.wIndex, sc->ifaceno); USETW(sc->request.wLength, buflen); return umass_setup_ctrl_transfer(sc, udev, &sc->request, buffer, buflen, 0, xfer); } Static void umass_cbi_reset(struct umass_softc *sc, int status) { int i; # define SEND_DIAGNOSTIC_CMDLEN 12 KASSERT(sc->proto & (UMASS_PROTO_CBI|UMASS_PROTO_CBI_I), ("%s: umass_cbi_reset: wrong sc->proto 0x%02x\n", USBDEVNAME(sc->sc_dev), sc->proto)); /* * Command Block Reset Protocol * * First send a reset request to the device. Then clear * any possibly stalled bulk endpoints. * * This is done in 3 steps, states: * TSTATE_CBI_RESET1 * TSTATE_CBI_RESET2 * TSTATE_CBI_RESET3 * * If the reset doesn't succeed, the device should be port reset. */ DPRINTF(UDMASS_CBI, ("%s: CBI Reset\n", USBDEVNAME(sc->sc_dev))); KASSERT(sizeof(sc->cbl) >= SEND_DIAGNOSTIC_CMDLEN, ("%s: CBL struct is too small (%ld < %d)\n", USBDEVNAME(sc->sc_dev), (long)sizeof(sc->cbl), SEND_DIAGNOSTIC_CMDLEN)); sc->transfer_state = TSTATE_CBI_RESET1; sc->transfer_status = status; /* The 0x1d code is the SEND DIAGNOSTIC command. To distinguish between * the two the last 10 bytes of the cbl is filled with 0xff (section * 2.2 of the CBI spec). */ sc->cbl[0] = 0x1d; /* Command Block Reset */ sc->cbl[1] = 0x04; for (i = 2; i < SEND_DIAGNOSTIC_CMDLEN; i++) sc->cbl[i] = 0xff; umass_cbi_adsc(sc, sc->cbl, SEND_DIAGNOSTIC_CMDLEN, sc->transfer_xfer[XFER_CBI_RESET1]); /* XXX if the command fails we should reset the port on the hub */ } Static void umass_cbi_transfer(struct umass_softc *sc, int lun, void *cmd, int cmdlen, void *data, int datalen, int dir, u_int timeout, transfer_cb_f cb, void *priv) { KASSERT(sc->proto & (UMASS_PROTO_CBI|UMASS_PROTO_CBI_I), ("%s: umass_cbi_transfer: wrong sc->proto 0x%02x\n", USBDEVNAME(sc->sc_dev), sc->proto)); /* Be a little generous. */ sc->timeout = timeout + UMASS_TIMEOUT; /* * Do a CBI transfer with cmdlen bytes from cmd, possibly * a data phase of datalen bytes from/to the device and finally a * csw read phase. * If the data direction was inbound a maximum of datalen bytes * is stored in the buffer pointed to by data. * * umass_cbi_transfer initialises the transfer and lets the state * machine in umass_cbi_state handle the completion. It uses the * following states: * TSTATE_CBI_COMMAND * -> XXX fill in * * An error in any of those states will invoke * umass_cbi_reset. */ /* check the given arguments */ KASSERT(datalen == 0 || data != NULL, ("%s: datalen > 0, but no buffer",USBDEVNAME(sc->sc_dev))); KASSERT(datalen == 0 || dir != DIR_NONE, ("%s: direction is NONE while datalen is not zero\n", USBDEVNAME(sc->sc_dev))); /* store the details for the data transfer phase */ sc->transfer_dir = dir; sc->transfer_data = data; sc->transfer_datalen = datalen; sc->transfer_actlen = 0; sc->transfer_cb = cb; sc->transfer_priv = priv; sc->transfer_status = STATUS_CMD_OK; /* move from idle to the command state */ sc->transfer_state = TSTATE_CBI_COMMAND; DIF(UDMASS_CBI, umass_cbi_dump_cmd(sc, cmd, cmdlen)); /* Send the Command Block from host to device via control endpoint. */ if (umass_cbi_adsc(sc, cmd, cmdlen, sc->transfer_xfer[XFER_CBI_CB])) umass_cbi_reset(sc, STATUS_WIRE_FAILED); } Static void umass_cbi_state(usbd_xfer_handle xfer, usbd_private_handle priv, usbd_status err) { struct umass_softc *sc = (struct umass_softc *) priv; KASSERT(sc->proto & (UMASS_PROTO_CBI|UMASS_PROTO_CBI_I), ("%s: umass_cbi_state: wrong sc->proto 0x%02x\n", USBDEVNAME(sc->sc_dev), sc->proto)); /* * State handling for CBI transfers. */ DPRINTF(UDMASS_CBI, ("%s: Handling CBI state %d (%s), xfer=%p, %s\n", USBDEVNAME(sc->sc_dev), sc->transfer_state, states[sc->transfer_state], xfer, usbd_errstr(err))); /* Give up if the device has detached. */ if (sc->flags & UMASS_FLAGS_GONE) { sc->transfer_state = TSTATE_IDLE; sc->transfer_cb(sc, sc->transfer_priv, sc->transfer_datalen, STATUS_CMD_FAILED); return; } switch (sc->transfer_state) { /***** CBI Transfer *****/ case TSTATE_CBI_COMMAND: if (err == USBD_STALLED) { DPRINTF(UDMASS_CBI, ("%s: Command Transport failed\n", USBDEVNAME(sc->sc_dev))); /* Status transport by control pipe (section 2.3.2.1). * The command contained in the command block failed. * * The control pipe has already been unstalled by the * USB stack. * Section 2.4.3.1.1 states that the bulk in endpoints * should not be stalled at this point. */ sc->transfer_state = TSTATE_IDLE; sc->transfer_cb(sc, sc->transfer_priv, sc->transfer_datalen, STATUS_CMD_FAILED); return; } else if (err) { DPRINTF(UDMASS_CBI, ("%s: failed to send ADSC\n", USBDEVNAME(sc->sc_dev))); umass_cbi_reset(sc, STATUS_WIRE_FAILED); return; } sc->transfer_state = TSTATE_CBI_DATA; if (sc->transfer_dir == DIR_IN) { if (umass_setup_transfer(sc, sc->bulkin_pipe, sc->transfer_data, sc->transfer_datalen, USBD_SHORT_XFER_OK, sc->transfer_xfer[XFER_CBI_DATA])) umass_cbi_reset(sc, STATUS_WIRE_FAILED); } else if (sc->transfer_dir == DIR_OUT) { if (umass_setup_transfer(sc, sc->bulkout_pipe, sc->transfer_data, sc->transfer_datalen, 0, /* fixed length transfer */ sc->transfer_xfer[XFER_CBI_DATA])) umass_cbi_reset(sc, STATUS_WIRE_FAILED); } else if (sc->proto & UMASS_PROTO_CBI_I) { DPRINTF(UDMASS_CBI, ("%s: no data phase\n", USBDEVNAME(sc->sc_dev))); sc->transfer_state = TSTATE_CBI_STATUS; if (umass_setup_transfer(sc, sc->intrin_pipe, &sc->sbl, sizeof(sc->sbl), 0, /* fixed length transfer */ sc->transfer_xfer[XFER_CBI_STATUS])){ umass_cbi_reset(sc, STATUS_WIRE_FAILED); } } else { DPRINTF(UDMASS_CBI, ("%s: no data phase\n", USBDEVNAME(sc->sc_dev))); /* No command completion interrupt. Request * sense data. */ sc->transfer_state = TSTATE_IDLE; sc->transfer_cb(sc, sc->transfer_priv, 0, STATUS_CMD_UNKNOWN); } return; case TSTATE_CBI_DATA: /* retrieve the length of the transfer that was done */ usbd_get_xfer_status(xfer,NULL,NULL,&sc->transfer_actlen,NULL); if (err) { DPRINTF(UDMASS_CBI, ("%s: Data-%s %db failed, " "%s\n", USBDEVNAME(sc->sc_dev), (sc->transfer_dir == DIR_IN?"in":"out"), sc->transfer_datalen,usbd_errstr(err))); if (err == USBD_STALLED) { umass_clear_endpoint_stall(sc, sc->bulkin, sc->bulkin_pipe, TSTATE_CBI_DCLEAR, sc->transfer_xfer[XFER_CBI_DCLEAR]); } else { umass_cbi_reset(sc, STATUS_WIRE_FAILED); } return; } DIF(UDMASS_CBI, if (sc->transfer_dir == DIR_IN) umass_dump_buffer(sc, sc->transfer_data, sc->transfer_actlen, 48)); if (sc->proto & UMASS_PROTO_CBI_I) { sc->transfer_state = TSTATE_CBI_STATUS; if (umass_setup_transfer(sc, sc->intrin_pipe, &sc->sbl, sizeof(sc->sbl), 0, /* fixed length transfer */ sc->transfer_xfer[XFER_CBI_STATUS])){ umass_cbi_reset(sc, STATUS_WIRE_FAILED); } } else { /* No command completion interrupt. Request * sense to get status of command. */ sc->transfer_state = TSTATE_IDLE; sc->transfer_cb(sc, sc->transfer_priv, sc->transfer_datalen - sc->transfer_actlen, STATUS_CMD_UNKNOWN); } return; case TSTATE_CBI_STATUS: if (err) { DPRINTF(UDMASS_CBI, ("%s: Status Transport failed\n", USBDEVNAME(sc->sc_dev))); /* Status transport by interrupt pipe (section 2.3.2.2). */ if (err == USBD_STALLED) { umass_clear_endpoint_stall(sc, sc->intrin, sc->intrin_pipe, TSTATE_CBI_SCLEAR, sc->transfer_xfer[XFER_CBI_SCLEAR]); } else { umass_cbi_reset(sc, STATUS_WIRE_FAILED); } return; } /* Dissect the information in the buffer */ if (sc->proto & UMASS_PROTO_UFI) { int status; /* Section 3.4.3.1.3 specifies that the UFI command * protocol returns an ASC and ASCQ in the interrupt * data block. */ DPRINTF(UDMASS_CBI, ("%s: UFI CCI, ASC = 0x%02x, " "ASCQ = 0x%02x\n", USBDEVNAME(sc->sc_dev), sc->sbl.ufi.asc, sc->sbl.ufi.ascq)); if (sc->sbl.ufi.asc == 0 && sc->sbl.ufi.ascq == 0) status = STATUS_CMD_OK; else status = STATUS_CMD_FAILED; sc->transfer_state = TSTATE_IDLE; sc->transfer_cb(sc, sc->transfer_priv, sc->transfer_datalen - sc->transfer_actlen, status); } else { /* Command Interrupt Data Block */ DPRINTF(UDMASS_CBI, ("%s: type=0x%02x, value=0x%02x\n", USBDEVNAME(sc->sc_dev), sc->sbl.common.type, sc->sbl.common.value)); if (sc->sbl.common.type == IDB_TYPE_CCI) { int err; if ((sc->sbl.common.value&IDB_VALUE_STATUS_MASK) == IDB_VALUE_PASS) { err = STATUS_CMD_OK; } else if ((sc->sbl.common.value & IDB_VALUE_STATUS_MASK) == IDB_VALUE_FAIL || (sc->sbl.common.value & IDB_VALUE_STATUS_MASK) == IDB_VALUE_PERSISTENT) { err = STATUS_CMD_FAILED; } else { err = STATUS_WIRE_FAILED; } sc->transfer_state = TSTATE_IDLE; sc->transfer_cb(sc, sc->transfer_priv, sc->transfer_datalen-sc->transfer_actlen, err); } } return; case TSTATE_CBI_DCLEAR: if (err) { /* should not occur */ printf("%s: CBI bulk-in/out stall clear failed, %s\n", USBDEVNAME(sc->sc_dev), usbd_errstr(err)); umass_cbi_reset(sc, STATUS_WIRE_FAILED); } sc->transfer_state = TSTATE_IDLE; sc->transfer_cb(sc, sc->transfer_priv, sc->transfer_datalen, STATUS_CMD_FAILED); return; case TSTATE_CBI_SCLEAR: if (err) /* should not occur */ printf("%s: CBI intr-in stall clear failed, %s\n", USBDEVNAME(sc->sc_dev), usbd_errstr(err)); /* Something really bad is going on. Reset the device */ umass_cbi_reset(sc, STATUS_CMD_FAILED); return; /***** CBI Reset *****/ case TSTATE_CBI_RESET1: if (err) printf("%s: CBI reset failed, %s\n", USBDEVNAME(sc->sc_dev), usbd_errstr(err)); umass_clear_endpoint_stall(sc, sc->bulkin, sc->bulkin_pipe, TSTATE_CBI_RESET2, sc->transfer_xfer[XFER_CBI_RESET2]); return; case TSTATE_CBI_RESET2: if (err) /* should not occur */ printf("%s: CBI bulk-in stall clear failed, %s\n", USBDEVNAME(sc->sc_dev), usbd_errstr(err)); /* no error recovery, otherwise we end up in a loop */ umass_clear_endpoint_stall(sc, sc->bulkout, sc->bulkout_pipe, TSTATE_CBI_RESET3, sc->transfer_xfer[XFER_CBI_RESET3]); return; case TSTATE_CBI_RESET3: if (err) /* should not occur */ printf("%s: CBI bulk-out stall clear failed, %s\n", USBDEVNAME(sc->sc_dev), usbd_errstr(err)); /* no error recovery, otherwise we end up in a loop */ sc->transfer_state = TSTATE_IDLE; if (sc->transfer_priv) { sc->transfer_cb(sc, sc->transfer_priv, sc->transfer_datalen, sc->transfer_status); } return; /***** Default *****/ default: panic("%s: Unknown state %d", USBDEVNAME(sc->sc_dev), sc->transfer_state); } } /* * CAM specific functions (used by SCSI, UFI, 8070i (ATAPI)) */ Static int umass_cam_attach_sim(struct umass_softc *sc) { struct cam_devq *devq; /* Per device Queue */ /* A HBA is attached to the CAM layer. * * The CAM layer will then after a while start probing for * devices on the bus. The number of SIMs is limited to one. */ devq = cam_simq_alloc(1 /*maximum openings*/); if (devq == NULL) return(ENOMEM); sc->umass_sim = cam_sim_alloc(umass_cam_action, umass_cam_poll, DEVNAME_SIM, sc /*priv*/, USBDEVUNIT(sc->sc_dev) /*unit number*/, 1 /*maximum device openings*/, 0 /*maximum tagged device openings*/, devq); if (sc->umass_sim == NULL) { cam_simq_free(devq); return(ENOMEM); } if(xpt_bus_register(sc->umass_sim, USBDEVUNIT(sc->sc_dev)) != CAM_SUCCESS) return(ENOMEM); return(0); } Static void umass_cam_rescan_callback(struct cam_periph *periph, union ccb *ccb) { #ifdef USB_DEBUG if (ccb->ccb_h.status != CAM_REQ_CMP) { DPRINTF(UDMASS_SCSI, ("%s:%d Rescan failed, 0x%04x\n", periph->periph_name, periph->unit_number, ccb->ccb_h.status)); } else { DPRINTF(UDMASS_SCSI, ("%s%d: Rescan succeeded\n", periph->periph_name, periph->unit_number)); } #endif xpt_free_path(ccb->ccb_h.path); free(ccb, M_USBDEV); } Static void umass_cam_rescan(void *addr) { struct umass_softc *sc = (struct umass_softc *) addr; struct cam_path *path; union ccb *ccb; DPRINTF(UDMASS_SCSI, ("scbus%d: scanning for %s:%d:%d:%d\n", cam_sim_path(sc->umass_sim), USBDEVNAME(sc->sc_dev), cam_sim_path(sc->umass_sim), USBDEVUNIT(sc->sc_dev), CAM_LUN_WILDCARD)); ccb = malloc(sizeof(union ccb), M_USBDEV, M_NOWAIT | M_ZERO); if (ccb == NULL) return; if (xpt_create_path(&path, xpt_periph, cam_sim_path(sc->umass_sim), CAM_TARGET_WILDCARD, CAM_LUN_WILDCARD) != CAM_REQ_CMP) return; xpt_setup_ccb(&ccb->ccb_h, path, 5/*priority (low)*/); ccb->ccb_h.func_code = XPT_SCAN_BUS; ccb->ccb_h.cbfcnp = umass_cam_rescan_callback; ccb->crcn.flags = CAM_FLAG_NONE; xpt_action(ccb); /* The scan is in progress now. */ } Static int umass_cam_attach(struct umass_softc *sc) { #ifndef USB_DEBUG if (bootverbose) #endif printf("%s:%d:%d:%d: Attached to scbus%d\n", USBDEVNAME(sc->sc_dev), cam_sim_path(sc->umass_sim), USBDEVUNIT(sc->sc_dev), CAM_LUN_WILDCARD, cam_sim_path(sc->umass_sim)); if (!cold) { /* Notify CAM of the new device after a short delay. Any * failure is benign, as the user can still do it by hand * (camcontrol rescan ). Only do this if we are not * booting, because CAM does a scan after booting has * completed, when interrupts have been enabled. */ usb_callout(sc->cam_scsi_rescan_ch, MS_TO_TICKS(200), umass_cam_rescan, sc); } return(0); /* always succesfull */ } /* umass_cam_detach * detach from the CAM layer */ Static int umass_cam_detach_sim(struct umass_softc *sc) { if (sc->umass_sim) { if (xpt_bus_deregister(cam_sim_path(sc->umass_sim))) cam_sim_free(sc->umass_sim, /*free_devq*/TRUE); else return(EBUSY); sc->umass_sim = NULL; } return(0); } /* umass_cam_action * CAM requests for action come through here */ Static void umass_cam_action(struct cam_sim *sim, union ccb *ccb) { struct umass_softc *sc = (struct umass_softc *)sim->softc; /* The softc is still there, but marked as going away. umass_cam_detach * has not yet notified CAM of the lost device however. */ if (sc && (sc->flags & UMASS_FLAGS_GONE)) { DPRINTF(UDMASS_SCSI, ("%s:%d:%d:%d:func_code 0x%04x: " "Invalid target (gone)\n", USBDEVNAME(sc->sc_dev), cam_sim_path(sc->umass_sim), ccb->ccb_h.target_id, ccb->ccb_h.target_lun, ccb->ccb_h.func_code)); ccb->ccb_h.status = CAM_TID_INVALID; xpt_done(ccb); return; } /* Verify, depending on the operation to perform, that we either got a * valid sc, because an existing target was referenced, or otherwise * the SIM is addressed. * * This avoids bombing out at a printf and does give the CAM layer some * sensible feedback on errors. */ switch (ccb->ccb_h.func_code) { case XPT_SCSI_IO: case XPT_RESET_DEV: case XPT_GET_TRAN_SETTINGS: case XPT_SET_TRAN_SETTINGS: case XPT_CALC_GEOMETRY: /* the opcodes requiring a target. These should never occur. */ if (sc == NULL) { printf("%s:%d:%d:%d:func_code 0x%04x: " "Invalid target (target needed)\n", DEVNAME_SIM, cam_sim_path(sc->umass_sim), ccb->ccb_h.target_id, ccb->ccb_h.target_lun, ccb->ccb_h.func_code); ccb->ccb_h.status = CAM_TID_INVALID; xpt_done(ccb); return; } break; case XPT_PATH_INQ: case XPT_NOOP: /* The opcodes sometimes aimed at a target (sc is valid), * sometimes aimed at the SIM (sc is invalid and target is * CAM_TARGET_WILDCARD) */ if (sc == NULL && ccb->ccb_h.target_id != CAM_TARGET_WILDCARD) { DPRINTF(UDMASS_SCSI, ("%s:%d:%d:%d:func_code 0x%04x: " "Invalid target (no wildcard)\n", DEVNAME_SIM, cam_sim_path(sc->umass_sim), ccb->ccb_h.target_id, ccb->ccb_h.target_lun, ccb->ccb_h.func_code)); ccb->ccb_h.status = CAM_TID_INVALID; xpt_done(ccb); return; } break; default: /* XXX Hm, we should check the input parameters */ break; } /* Perform the requested action */ switch (ccb->ccb_h.func_code) { case XPT_SCSI_IO: { struct ccb_scsiio *csio = &ccb->csio; /* deref union */ int dir; unsigned char *cmd; int cmdlen; unsigned char *rcmd; int rcmdlen; DPRINTF(UDMASS_SCSI, ("%s:%d:%d:%d:XPT_SCSI_IO: " "cmd: 0x%02x, flags: 0x%02x, " "%db cmd/%db data/%db sense\n", USBDEVNAME(sc->sc_dev), cam_sim_path(sc->umass_sim), ccb->ccb_h.target_id, ccb->ccb_h.target_lun, csio->cdb_io.cdb_bytes[0], ccb->ccb_h.flags & CAM_DIR_MASK, csio->cdb_len, csio->dxfer_len, csio->sense_len)); /* clear the end of the buffer to make sure we don't send out * garbage. */ DIF(UDMASS_SCSI, if ((ccb->ccb_h.flags & CAM_DIR_MASK) == CAM_DIR_OUT) umass_dump_buffer(sc, csio->data_ptr, csio->dxfer_len, 48)); if (sc->transfer_state != TSTATE_IDLE) { DPRINTF(UDMASS_SCSI, ("%s:%d:%d:%d:XPT_SCSI_IO: " "I/O in progress, deferring (state %d, %s)\n", USBDEVNAME(sc->sc_dev), cam_sim_path(sc->umass_sim), ccb->ccb_h.target_id, ccb->ccb_h.target_lun, sc->transfer_state,states[sc->transfer_state])); ccb->ccb_h.status = CAM_SCSI_BUSY; xpt_done(ccb); return; } switch(ccb->ccb_h.flags&CAM_DIR_MASK) { case CAM_DIR_IN: dir = DIR_IN; break; case CAM_DIR_OUT: dir = DIR_OUT; break; default: dir = DIR_NONE; } ccb->ccb_h.status = CAM_REQ_INPROG | CAM_SIM_QUEUED; if (csio->ccb_h.flags & CAM_CDB_POINTER) { cmd = (unsigned char *) csio->cdb_io.cdb_ptr; } else { cmd = (unsigned char *) &csio->cdb_io.cdb_bytes; } cmdlen = csio->cdb_len; rcmd = (unsigned char *) &sc->cam_scsi_command; rcmdlen = sizeof(sc->cam_scsi_command); /* sc->transform will convert the command to the command * (format) needed by the specific command set and return * the converted command in a buffer pointed to be rcmd. * We pass in a buffer, but if the command does not * have to be transformed it returns a ptr to the original * buffer (see umass_scsi_transform). */ if (sc->transform(sc, cmd, cmdlen, &rcmd, &rcmdlen)) { /* * Handle EVPD inquiry for broken devices first * NO_INQUIRY also implies NO_INQUIRY_EVPD */ if ((sc->quirks & (NO_INQUIRY_EVPD | NO_INQUIRY)) && rcmd[0] == INQUIRY && (rcmd[1] & SI_EVPD)) { struct scsi_sense_data *sense; sense = &ccb->csio.sense_data; bzero(sense, sizeof(*sense)); sense->error_code = SSD_CURRENT_ERROR; sense->flags = SSD_KEY_ILLEGAL_REQUEST; sense->add_sense_code = 0x24; sense->extra_len = 10; ccb->csio.scsi_status = SCSI_STATUS_CHECK_COND; ccb->ccb_h.status = CAM_SCSI_STATUS_ERROR | CAM_AUTOSNS_VALID; xpt_done(ccb); return; } /* Return fake inquiry data for broken devices */ if ((sc->quirks & NO_INQUIRY) && rcmd[0] == INQUIRY) { struct ccb_scsiio *csio = &ccb->csio; memcpy(csio->data_ptr, &fake_inq_data, sizeof(fake_inq_data)); csio->scsi_status = SCSI_STATUS_OK; ccb->ccb_h.status = CAM_REQ_CMP; xpt_done(ccb); return; } if ((sc->quirks & FORCE_SHORT_INQUIRY) && rcmd[0] == INQUIRY) { csio->dxfer_len = SHORT_INQUIRY_LENGTH; } sc->transfer(sc, ccb->ccb_h.target_lun, rcmd, rcmdlen, csio->data_ptr, csio->dxfer_len, dir, ccb->ccb_h.timeout, umass_cam_cb, (void *) ccb); } else { ccb->ccb_h.status = CAM_REQ_INVALID; xpt_done(ccb); } break; } case XPT_PATH_INQ: { struct ccb_pathinq *cpi = &ccb->cpi; DPRINTF(UDMASS_SCSI, ("%s:%d:%d:%d:XPT_PATH_INQ:.\n", (sc == NULL? DEVNAME_SIM:USBDEVNAME(sc->sc_dev)), cam_sim_path(sc->umass_sim), ccb->ccb_h.target_id, ccb->ccb_h.target_lun)); /* host specific information */ cpi->version_num = 1; cpi->hba_inquiry = 0; cpi->target_sprt = 0; cpi->hba_misc = PIM_NO_6_BYTE; cpi->hba_eng_cnt = 0; cpi->max_target = UMASS_SCSIID_MAX; /* one target */ cpi->initiator_id = UMASS_SCSIID_HOST; strncpy(cpi->sim_vid, "FreeBSD", SIM_IDLEN); strncpy(cpi->hba_vid, "USB SCSI", HBA_IDLEN); strncpy(cpi->dev_name, cam_sim_name(sim), DEV_IDLEN); cpi->unit_number = cam_sim_unit(sim); cpi->bus_id = USBDEVUNIT(sc->sc_dev); if (sc == NULL) { cpi->base_transfer_speed = 0; cpi->max_lun = 0; } else { if (sc->quirks & FLOPPY_SPEED) { cpi->base_transfer_speed = UMASS_FLOPPY_TRANSFER_SPEED; } else if (usbd_get_speed(sc->sc_udev) == USB_SPEED_HIGH) { cpi->base_transfer_speed = UMASS_HIGH_TRANSFER_SPEED; } else { cpi->base_transfer_speed = UMASS_FULL_TRANSFER_SPEED; } cpi->max_lun = sc->maxlun; } cpi->ccb_h.status = CAM_REQ_CMP; xpt_done(ccb); break; } case XPT_RESET_DEV: { DPRINTF(UDMASS_SCSI, ("%s:%d:%d:%d:XPT_RESET_DEV:.\n", USBDEVNAME(sc->sc_dev), cam_sim_path(sc->umass_sim), ccb->ccb_h.target_id, ccb->ccb_h.target_lun)); ccb->ccb_h.status = CAM_REQ_INPROG; umass_reset(sc, umass_cam_cb, (void *) ccb); break; } case XPT_GET_TRAN_SETTINGS: { struct ccb_trans_settings *cts = &ccb->cts; DPRINTF(UDMASS_SCSI, ("%s:%d:%d:%d:XPT_GET_TRAN_SETTINGS:.\n", USBDEVNAME(sc->sc_dev), cam_sim_path(sc->umass_sim), ccb->ccb_h.target_id, ccb->ccb_h.target_lun)); cts->valid = 0; cts->flags = 0; /* no disconnection, tagging */ ccb->ccb_h.status = CAM_REQ_CMP; xpt_done(ccb); break; } case XPT_SET_TRAN_SETTINGS: { DPRINTF(UDMASS_SCSI, ("%s:%d:%d:%d:XPT_SET_TRAN_SETTINGS:.\n", USBDEVNAME(sc->sc_dev), cam_sim_path(sc->umass_sim), ccb->ccb_h.target_id, ccb->ccb_h.target_lun)); ccb->ccb_h.status = CAM_FUNC_NOTAVAIL; xpt_done(ccb); break; } case XPT_CALC_GEOMETRY: { cam_calc_geometry(&ccb->ccg, /*extended*/1); xpt_done(ccb); break; } case XPT_NOOP: { DPRINTF(UDMASS_SCSI, ("%s:%d:%d:%d:XPT_NOOP:.\n", (sc == NULL? DEVNAME_SIM:USBDEVNAME(sc->sc_dev)), cam_sim_path(sc->umass_sim), ccb->ccb_h.target_id, ccb->ccb_h.target_lun)); ccb->ccb_h.status = CAM_REQ_CMP; xpt_done(ccb); break; } default: DPRINTF(UDMASS_SCSI, ("%s:%d:%d:%d:func_code 0x%04x: " "Not implemented\n", (sc == NULL? DEVNAME_SIM:USBDEVNAME(sc->sc_dev)), cam_sim_path(sc->umass_sim), ccb->ccb_h.target_id, ccb->ccb_h.target_lun, ccb->ccb_h.func_code)); ccb->ccb_h.status = CAM_FUNC_NOTAVAIL; xpt_done(ccb); break; } } /* umass_cam_poll * all requests are handled through umass_cam_action, requests * are never pending. So, nothing to do here. */ Static void umass_cam_poll(struct cam_sim *sim) { #ifdef USB_DEBUG struct umass_softc *sc = (struct umass_softc *) sim->softc; DPRINTF(UDMASS_SCSI, ("%s: CAM poll\n", USBDEVNAME(sc->sc_dev))); #endif /* nop */ } /* umass_cam_cb * finalise a completed CAM command */ Static void umass_cam_cb(struct umass_softc *sc, void *priv, int residue, int status) { union ccb *ccb = (union ccb *) priv; struct ccb_scsiio *csio = &ccb->csio; /* deref union */ /* If the device is gone, just fail the request. */ if (sc->flags & UMASS_FLAGS_GONE) { ccb->ccb_h.status = CAM_TID_INVALID; xpt_done(ccb); return; } csio->resid = residue; switch (status) { case STATUS_CMD_OK: ccb->ccb_h.status = CAM_REQ_CMP; xpt_done(ccb); break; case STATUS_CMD_UNKNOWN: case STATUS_CMD_FAILED: switch (ccb->ccb_h.func_code) { case XPT_SCSI_IO: { unsigned char *rcmd; int rcmdlen; /* fetch sense data */ /* the rest of the command was filled in at attach */ sc->cam_scsi_sense.length = csio->sense_len; DPRINTF(UDMASS_SCSI,("%s: Fetching %db sense data\n", USBDEVNAME(sc->sc_dev), csio->sense_len)); rcmd = (unsigned char *) &sc->cam_scsi_command; rcmdlen = sizeof(sc->cam_scsi_command); if (sc->transform(sc, (unsigned char *) &sc->cam_scsi_sense, sizeof(sc->cam_scsi_sense), &rcmd, &rcmdlen)) { if ((sc->quirks & FORCE_SHORT_INQUIRY) && (rcmd[0] == INQUIRY)) { csio->sense_len = SHORT_INQUIRY_LENGTH; } sc->transfer(sc, ccb->ccb_h.target_lun, rcmd, rcmdlen, &csio->sense_data, csio->sense_len, DIR_IN, ccb->ccb_h.timeout, umass_cam_sense_cb, (void *) ccb); } else { panic("transform(REQUEST_SENSE) failed"); } break; } case XPT_RESET_DEV: /* Reset failed */ ccb->ccb_h.status = CAM_REQ_CMP_ERR; xpt_done(ccb); break; default: panic("umass_cam_cb called for func_code %d", ccb->ccb_h.func_code); } break; case STATUS_WIRE_FAILED: /* the wire protocol failed and will have recovered * (hopefully). We return an error to CAM and let CAM retry * the command if necessary. */ ccb->ccb_h.status = CAM_REQ_CMP_ERR; xpt_done(ccb); break; default: panic("%s: Unknown status %d in umass_cam_cb", USBDEVNAME(sc->sc_dev), status); } } /* Finalise a completed autosense operation */ Static void umass_cam_sense_cb(struct umass_softc *sc, void *priv, int residue, int status) { union ccb *ccb = (union ccb *) priv; struct ccb_scsiio *csio = &ccb->csio; /* deref union */ unsigned char *rcmd; int rcmdlen; if (sc->flags & UMASS_FLAGS_GONE) { ccb->ccb_h.status = CAM_AUTOSENSE_FAIL; xpt_done(ccb); return; } switch (status) { case STATUS_CMD_OK: case STATUS_CMD_UNKNOWN: case STATUS_CMD_FAILED: /* Getting sense data always succeeds (apart from wire * failures). */ if ((sc->quirks & RS_NO_CLEAR_UA) && csio->cdb_io.cdb_bytes[0] == INQUIRY && (csio->sense_data.flags & SSD_KEY) == SSD_KEY_UNIT_ATTENTION) { /* Ignore unit attention errors in the case where * the Unit Attention state is not cleared on * REQUEST SENSE. They will appear again at the next * command. */ ccb->ccb_h.status = CAM_REQ_CMP; } else if ((csio->sense_data.flags & SSD_KEY) == SSD_KEY_NO_SENSE) { /* No problem after all (in the case of CBI without * CCI) */ ccb->ccb_h.status = CAM_REQ_CMP; } else if ((sc->quirks & RS_NO_CLEAR_UA) && (csio->cdb_io.cdb_bytes[0] == READ_CAPACITY) && ((csio->sense_data.flags & SSD_KEY) == SSD_KEY_UNIT_ATTENTION)) { /* * Some devices do not clear the unit attention error * on request sense. We insert a test unit ready * command to make sure we clear the unit attention * condition, then allow the retry to proceed as * usual. */ ccb->ccb_h.status = CAM_SCSI_STATUS_ERROR | CAM_AUTOSNS_VALID; csio->scsi_status = SCSI_STATUS_CHECK_COND; #if 0 DELAY(300000); #endif DPRINTF(UDMASS_SCSI,("%s: Doing a sneaky" "TEST_UNIT_READY\n", USBDEVNAME(sc->sc_dev))); /* the rest of the command was filled in at attach */ rcmd = (unsigned char *) &sc->cam_scsi_command2; rcmdlen = sizeof(sc->cam_scsi_command2); if (sc->transform(sc, (unsigned char *) &sc->cam_scsi_test_unit_ready, sizeof(sc->cam_scsi_test_unit_ready), &rcmd, &rcmdlen)) { sc->transfer(sc, ccb->ccb_h.target_lun, rcmd, rcmdlen, NULL, 0, DIR_NONE, ccb->ccb_h.timeout, umass_cam_quirk_cb, (void *) ccb); } else { panic("transform(TEST_UNIT_READY) failed"); } break; } else { ccb->ccb_h.status = CAM_SCSI_STATUS_ERROR | CAM_AUTOSNS_VALID; csio->scsi_status = SCSI_STATUS_CHECK_COND; } xpt_done(ccb); break; default: DPRINTF(UDMASS_SCSI, ("%s: Autosense failed, status %d\n", USBDEVNAME(sc->sc_dev), status)); ccb->ccb_h.status = CAM_AUTOSENSE_FAIL; xpt_done(ccb); } } /* * This completion code just handles the fact that we sent a test-unit-ready * after having previously failed a READ CAPACITY with CHECK_COND. Even * though this command succeeded, we have to tell CAM to retry. */ Static void umass_cam_quirk_cb(struct umass_softc *sc, void *priv, int residue, int status) { union ccb *ccb = (union ccb *) priv; DPRINTF(UDMASS_SCSI, ("%s: Test unit ready returned status %d\n", USBDEVNAME(sc->sc_dev), status)); if (sc->flags & UMASS_FLAGS_GONE) { ccb->ccb_h.status = CAM_TID_INVALID; xpt_done(ccb); return; } #if 0 ccb->ccb_h.status = CAM_REQ_CMP; #endif ccb->ccb_h.status = CAM_SCSI_STATUS_ERROR | CAM_AUTOSNS_VALID; ccb->csio.scsi_status = SCSI_STATUS_CHECK_COND; xpt_done(ccb); } Static int umass_driver_load(module_t mod, int what, void *arg) { switch (what) { case MOD_UNLOAD: case MOD_LOAD: default: return(usbd_driver_load(mod, what, arg)); } } /* * SCSI specific functions */ Static int umass_scsi_transform(struct umass_softc *sc, unsigned char *cmd, int cmdlen, unsigned char **rcmd, int *rcmdlen) { switch (cmd[0]) { case TEST_UNIT_READY: if (sc->quirks & NO_TEST_UNIT_READY) { KASSERT(*rcmdlen >= sizeof(struct scsi_start_stop_unit), ("rcmdlen = %d < %ld, buffer too small", *rcmdlen, (long)sizeof(struct scsi_start_stop_unit))); DPRINTF(UDMASS_SCSI, ("%s: Converted TEST_UNIT_READY " "to START_UNIT\n", USBDEVNAME(sc->sc_dev))); memset(*rcmd, 0, *rcmdlen); (*rcmd)[0] = START_STOP_UNIT; (*rcmd)[4] = SSS_START; return 1; } /* fallthrough */ case INQUIRY: /* some drives wedge when asked for full inquiry information. */ if (sc->quirks & FORCE_SHORT_INQUIRY) { memcpy(*rcmd, cmd, cmdlen); *rcmdlen = cmdlen; (*rcmd)[4] = SHORT_INQUIRY_LENGTH; return 1; } /* fallthrough */ default: *rcmd = cmd; /* We don't need to copy it */ *rcmdlen = cmdlen; } return 1; } /* RBC specific functions */ Static int umass_rbc_transform(struct umass_softc *sc, unsigned char *cmd, int cmdlen, unsigned char **rcmd, int *rcmdlen) { switch (cmd[0]) { /* these commands are defined in RBC: */ case READ_10: case READ_CAPACITY: case START_STOP_UNIT: case SYNCHRONIZE_CACHE: case WRITE_10: case 0x2f: /* VERIFY_10 is absent from scsi_all.h??? */ case INQUIRY: case MODE_SELECT_10: case MODE_SENSE_10: case TEST_UNIT_READY: case WRITE_BUFFER: /* The following commands are not listed in my copy of the RBC specs. * CAM however seems to want those, and at least the Sony DSC device * appears to support those as well */ case REQUEST_SENSE: case PREVENT_ALLOW: *rcmd = cmd; /* We don't need to copy it */ *rcmdlen = cmdlen; return 1; /* All other commands are not legal in RBC */ default: printf("%s: Unsupported RBC command 0x%02x", USBDEVNAME(sc->sc_dev), cmd[0]); printf("\n"); return 0; /* failure */ } } /* * UFI specific functions */ Static int umass_ufi_transform(struct umass_softc *sc, unsigned char *cmd, int cmdlen, unsigned char **rcmd, int *rcmdlen) { /* A UFI command is always 12 bytes in length */ KASSERT(*rcmdlen >= UFI_COMMAND_LENGTH, ("rcmdlen = %d < %d, buffer too small", *rcmdlen, UFI_COMMAND_LENGTH)); *rcmdlen = UFI_COMMAND_LENGTH; memset(*rcmd, 0, UFI_COMMAND_LENGTH); switch (cmd[0]) { /* Commands of which the format has been verified. They should work. * Copy the command into the (zeroed out) destination buffer. */ case TEST_UNIT_READY: if (sc->quirks & NO_TEST_UNIT_READY) { /* Some devices do not support this command. * Start Stop Unit should give the same results */ DPRINTF(UDMASS_UFI, ("%s: Converted TEST_UNIT_READY " "to START_UNIT\n", USBDEVNAME(sc->sc_dev))); (*rcmd)[0] = START_STOP_UNIT; (*rcmd)[4] = SSS_START; } else { memcpy(*rcmd, cmd, cmdlen); } return 1; case REZERO_UNIT: case REQUEST_SENSE: case FORMAT_UNIT: case INQUIRY: case START_STOP_UNIT: case SEND_DIAGNOSTIC: case PREVENT_ALLOW: case READ_CAPACITY: case READ_10: case WRITE_10: case POSITION_TO_ELEMENT: /* SEEK_10 */ case WRITE_AND_VERIFY: case VERIFY: case MODE_SELECT_10: case MODE_SENSE_10: case READ_12: case WRITE_12: case READ_FORMAT_CAPACITIES: memcpy(*rcmd, cmd, cmdlen); return 1; default: printf("%s: Unsupported UFI command 0x%02x\n", USBDEVNAME(sc->sc_dev), cmd[0]); return 0; /* failure */ } } /* * 8070i (ATAPI) specific functions */ Static int umass_atapi_transform(struct umass_softc *sc, unsigned char *cmd, int cmdlen, unsigned char **rcmd, int *rcmdlen) { /* An ATAPI command is always 12 bytes in length. */ KASSERT(*rcmdlen >= ATAPI_COMMAND_LENGTH, ("rcmdlen = %d < %d, buffer too small", *rcmdlen, ATAPI_COMMAND_LENGTH)); *rcmdlen = ATAPI_COMMAND_LENGTH; memset(*rcmd, 0, ATAPI_COMMAND_LENGTH); switch (cmd[0]) { /* Commands of which the format has been verified. They should work. * Copy the command into the (zeroed out) destination buffer. */ case INQUIRY: memcpy(*rcmd, cmd, cmdlen); /* some drives wedge when asked for full inquiry information. */ if (sc->quirks & FORCE_SHORT_INQUIRY) (*rcmd)[4] = SHORT_INQUIRY_LENGTH; return 1; case TEST_UNIT_READY: if (sc->quirks & NO_TEST_UNIT_READY) { KASSERT(*rcmdlen >= sizeof(struct scsi_start_stop_unit), ("rcmdlen = %d < %ld, buffer too small", *rcmdlen, (long)sizeof(struct scsi_start_stop_unit))); DPRINTF(UDMASS_SCSI, ("%s: Converted TEST_UNIT_READY " "to START_UNIT\n", USBDEVNAME(sc->sc_dev))); memset(*rcmd, 0, *rcmdlen); (*rcmd)[0] = START_STOP_UNIT; (*rcmd)[4] = SSS_START; return 1; } /* fallthrough */ case REZERO_UNIT: case REQUEST_SENSE: case START_STOP_UNIT: case SEND_DIAGNOSTIC: case PREVENT_ALLOW: case READ_CAPACITY: case READ_10: case WRITE_10: case POSITION_TO_ELEMENT: /* SEEK_10 */ case SYNCHRONIZE_CACHE: case MODE_SELECT_10: case MODE_SENSE_10: case READ_BUFFER: case 0x42: /* READ_SUBCHANNEL */ case 0x43: /* READ_TOC */ case 0x44: /* READ_HEADER */ case 0x51: /* READ_DISK_INFO */ case 0x52: /* READ_TRACK_INFO */ case 0x54: /* SEND_OPC */ case 0x59: /* READ_MASTER_CUE */ case 0x5b: /* CLOSE_TR_SESSION */ case 0x5c: /* READ_BUFFER_CAP */ case 0x5d: /* SEND_CUE_SHEET */ case 0xa1: /* BLANK */ case 0xa6: /* EXCHANGE_MEDIUM */ case 0xad: /* READ_DVD_STRUCTURE */ case 0xbb: /* SET_CD_SPEED */ case 0xe5: /* READ_TRACK_INFO_PHILIPS */ memcpy(*rcmd, cmd, cmdlen); return 1; case READ_12: case WRITE_12: default: printf("%s: Unsupported ATAPI command 0x%02x\n", USBDEVNAME(sc->sc_dev), cmd[0]); return 0; /* failure */ } } /* (even the comment is missing) */ DRIVER_MODULE(umass, uhub, umass_driver, umass_devclass, umass_driver_load, 0); #ifdef USB_DEBUG Static void umass_bbb_dump_cbw(struct umass_softc *sc, umass_bbb_cbw_t *cbw) { int clen = cbw->bCDBLength; int dlen = UGETDW(cbw->dCBWDataTransferLength); u_int8_t *c = cbw->CBWCDB; int tag = UGETDW(cbw->dCBWTag); int flags = cbw->bCBWFlags; DPRINTF(UDMASS_BBB, ("%s: CBW %d: cmd = %db " "(0x%02x%02x%02x%02x%02x%02x%s), " "data = %db, dir = %s\n", USBDEVNAME(sc->sc_dev), tag, clen, c[0], c[1], c[2], c[3], c[4], c[5], (clen > 6? "...":""), dlen, (flags == CBWFLAGS_IN? "in": (flags == CBWFLAGS_OUT? "out":"")))); } Static void umass_bbb_dump_csw(struct umass_softc *sc, umass_bbb_csw_t *csw) { int sig = UGETDW(csw->dCSWSignature); int tag = UGETW(csw->dCSWTag); int res = UGETDW(csw->dCSWDataResidue); int status = csw->bCSWStatus; DPRINTF(UDMASS_BBB, ("%s: CSW %d: sig = 0x%08x (%s), tag = %d, " "res = %d, status = 0x%02x (%s)\n", USBDEVNAME(sc->sc_dev), tag, sig, (sig == CSWSIGNATURE? "valid":"invalid"), tag, res, status, (status == CSWSTATUS_GOOD? "good": (status == CSWSTATUS_FAILED? "failed": (status == CSWSTATUS_PHASE? "phase":""))))); } Static void umass_cbi_dump_cmd(struct umass_softc *sc, void *cmd, int cmdlen) { u_int8_t *c = cmd; int dir = sc->transfer_dir; DPRINTF(UDMASS_BBB, ("%s: cmd = %db " "(0x%02x%02x%02x%02x%02x%02x%s), " "data = %db, dir = %s\n", USBDEVNAME(sc->sc_dev), cmdlen, c[0], c[1], c[2], c[3], c[4], c[5], (cmdlen > 6? "...":""), sc->transfer_datalen, (dir == DIR_IN? "in": (dir == DIR_OUT? "out": (dir == DIR_NONE? "no data phase": ""))))); } Static void umass_dump_buffer(struct umass_softc *sc, u_int8_t *buffer, int buflen, int printlen) { int i, j; char s1[40]; char s2[40]; char s3[5]; s1[0] = '\0'; s3[0] = '\0'; sprintf(s2, " buffer=%p, buflen=%d", buffer, buflen); for (i = 0; i < buflen && i < printlen; i++) { j = i % 16; if (j == 0 && i != 0) { DPRINTF(UDMASS_GEN, ("%s: 0x %s%s\n", USBDEVNAME(sc->sc_dev), s1, s2)); s2[0] = '\0'; } sprintf(&s1[j*2], "%02x", buffer[i] & 0xff); } if (buflen > printlen) sprintf(s3, " ..."); DPRINTF(UDMASS_GEN, ("%s: 0x %s%s%s\n", USBDEVNAME(sc->sc_dev), s1, s2, s3)); } #endif --Apple-Mail-2--275355228 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII; format=flowed --Apple-Mail-2--275355228-- From owner-freebsd-usb@FreeBSD.ORG Fri Sep 9 17:09:45 2005 Return-Path: X-Original-To: freebsd-usb@freebsd.org Delivered-To: freebsd-usb@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8B0C316A41F for ; Fri, 9 Sep 2005 17:09:45 +0000 (GMT) (envelope-from pm940@yahoo.com) Received: from web54002.mail.yahoo.com (web54002.mail.yahoo.com [206.190.36.226]) by mx1.FreeBSD.org (Postfix) with SMTP id DD1E243D53 for ; Fri, 9 Sep 2005 17:09:44 +0000 (GMT) (envelope-from pm940@yahoo.com) Received: (qmail 77244 invoked by uid 60001); 9 Sep 2005 17:09:44 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:Received:Date:From:Subject:To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=ZoB8xpfO7tVbN58GCYU9uzpI2BxlkeYYg6+4NKuH8oG+Qaer1EPpw3RVkVMusRvRpLZES1vHEGWhs2h8bk9bii5v/i/V/F6G7MhJW0I6SqTcO7dzAlPmIVtmv4tANawOIh7fPSiMG2UMl3G41cQ4109ot5H2uNPs3jqj4ueXBfE= ; Message-ID: <20050909170944.77242.qmail@web54002.mail.yahoo.com> Received: from [69.237.122.17] by web54002.mail.yahoo.com via HTTP; Fri, 09 Sep 2005 10:09:43 PDT Date: Fri, 9 Sep 2005 10:09:43 -0700 (PDT) From: Paul Marciano To: freebsd-questions@freebsd.org, freebsd-usb@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Cc: Subject: Will USB serial ever be fixed? 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: Fri, 09 Sep 2005 17:09:45 -0000 I have a general question on the status of USB to serial support in FreeBSD (specifically the ucom and ftdi drivers). I need an extra serial port on my system and for reasons outside the scope of this email I can't just plug in a PCI card. I'm trying to use USB, but it seems that ucom is broken and no one is fixing it. A tcflush() bug posted last year reports that USB serial ports hang on a call to tcflush(). This can be observed by using getty on one. Another poster reported problems running PPP (including a kernel crash). Given the lack of movement in these bugs, it looks like the FreeBSD developers don't care about ucom... certainly not enough to fix it. Now I could get up on a soapbox and say how unacceptable it is for a fundamental peripheral like serial ports (even though they're over USB) to be so obviously broken for so long... but I won't, because I'm not a developer and I understand that it's a volunteer thing and overall FreeBSD is otherwise excellent. So without wanting to offend (whilst secretly being pretty frustrated with the corner I find myself in) I would like to know, hopefully from someone responsible for the subsystem, if ucom/ftdi is likely to be fixed in the next six months. Sigh. I really don't want to have to move to Linux for something this small, but USB serial is a system component I can't change. Be honest. Be brutal. I need to know where FreeBSD stands on this. Thanks, Paul. ______________________________________________________ Click here to donate to the Hurricane Katrina relief effort. http://store.yahoo.com/redcross-donate3/ From owner-freebsd-usb@FreeBSD.ORG Fri Sep 9 19:00:14 2005 Return-Path: X-Original-To: freebsd-usb@freebsd.org Delivered-To: freebsd-usb@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3796C16A41F; Fri, 9 Sep 2005 19:00:14 +0000 (GMT) (envelope-from frank@exit.com) Received: from tinker.exit.com (tinker.exit.com [206.223.0.1]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1DE4143D6B; Fri, 9 Sep 2005 19:00:07 +0000 (GMT) (envelope-from frank@exit.com) Received: from realtime.exit.com (realtime [206.223.0.5]) by tinker.exit.com (8.13.4/8.13.3) with ESMTP id j89IxuRr012287; Fri, 9 Sep 2005 11:59:56 -0700 (PDT) (envelope-from frank@exit.com) Received: from realtime.exit.com (localhost [127.0.0.1]) by realtime.exit.com (8.13.4/8.13.3) with ESMTP id j89IxrJL032278; Fri, 9 Sep 2005 11:59:53 -0700 (PDT) (envelope-from frank@exit.com) Received: (from frank@localhost) by realtime.exit.com (8.13.4/8.13.4/Submit) id j89IxrXu032277; Fri, 9 Sep 2005 11:59:53 -0700 (PDT) (envelope-from frank@exit.com) X-Authentication-Warning: realtime.exit.com: frank set sender to frank@exit.com using -f From: Frank Mayhar To: Paul Marciano In-Reply-To: <20050909170944.77242.qmail@web54002.mail.yahoo.com> References: <20050909170944.77242.qmail@web54002.mail.yahoo.com> Content-Type: text/plain Content-Transfer-Encoding: 7bit Organization: Exit Consulting Date: Fri, 09 Sep 2005 11:59:52 -0700 Message-Id: <1126292392.11649.5.camel@realtime.exit.com> Mime-Version: 1.0 X-Mailer: Evolution 2.2.3 FreeBSD GNOME Team Port X-Virus-Scanned: ClamAV 0.86.1/1073/Fri Sep 9 08:13:08 2005 on tinker.exit.com X-Virus-Status: Clean Cc: freebsd-questions@freebsd.org, freebsd-usb@freebsd.org Subject: Re: Will USB serial ever be fixed? X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: frank@exit.com List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Sep 2005 19:00:14 -0000 On Fri, 2005-09-09 at 10:09 -0700, Paul Marciano wrote: > I have a general question on the status of USB to > serial support in FreeBSD (specifically the ucom and > ftdi drivers). > > I need an extra serial port on my system and for > reasons outside the scope of this email I can't just > plug in a PCI card. I'm trying to use USB, but it > seems that ucom is broken and no one is fixing it. > > A tcflush() bug posted last year reports that USB > serial ports hang on a call to tcflush(). This can be > observed by using getty on one. > > Another poster reported problems running PPP > (including a kernel crash). Well, I've got a handful of such devices that appear to work just fine. Now, mine are based on the Prolific PL-2303* chips but you don't mention any specific hardware. All I know is that I'm using them for consoles (and am running getty on them) with no hangs or crashes of any kind. I'm also pretty sure that if you could provide fixes (or at least better characterization of the problems you're seeing), your concerns might be more likely to be addressed. As you know, this is an all-volunteer effort. -- Frank Mayhar frank@exit.com http://www.exit.com/ Exit Consulting http://www.gpsclock.com/ http://www.exit.com/blog/frank/ From owner-freebsd-usb@FreeBSD.ORG Fri Sep 9 19:28:23 2005 Return-Path: X-Original-To: freebsd-usb@freebsd.org Delivered-To: freebsd-usb@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2289416A41F; Fri, 9 Sep 2005 19:28:23 +0000 (GMT) (envelope-from garys@opusnet.com) Received: from opusnet.com (mail.opusnet.com [209.210.200.6]) by mx1.FreeBSD.org (Postfix) with ESMTP id C756043D45; Fri, 9 Sep 2005 19:28:22 +0000 (GMT) (envelope-from garys@opusnet.com) Received: from localhost.localhost [70.98.246.232] by opusnet.com with ESMTP (SMTPD32-8.05) id A252F030138; Fri, 09 Sep 2005 12:28:18 -0700 Received: from localhost.localhost (localhost.localhost [127.0.0.1]) by localhost.localhost (8.13.3/8.13.3) with ESMTP id j89JT0NI007803; Fri, 9 Sep 2005 12:29:00 -0700 (PDT) (envelope-from garys@opusnet.com) Received: (from jojo@localhost) by localhost.localhost (8.13.3/8.13.3/Submit) id j89JSsH6007802; Fri, 9 Sep 2005 12:28:54 -0700 (PDT) (envelope-from garys@opusnet.com) To: Paul Marciano References: <20050909170944.77242.qmail@web54002.mail.yahoo.com> From: garys@opusnet.com (Gary W. Swearingen) Date: Fri, 09 Sep 2005 12:28:54 -0700 In-Reply-To: <20050909170944.77242.qmail@web54002.mail.yahoo.com> (Paul Marciano's message of "Fri, 9 Sep 2005 10:09:43 -0700 (PDT)") Message-ID: <66y866yr9l.866@mail.opusnet.com> User-Agent: Gnus/5.1007 (Gnus v5.10.7) XEmacs/21.4.17 (Jumbo Shrimp, berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: freebsd-questions@freebsd.org, freebsd-usb@freebsd.org Subject: Re: Will USB serial ever be fixed? 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: Fri, 09 Sep 2005 19:28:23 -0000 Paul Marciano writes: > So without wanting to offend (whilst secretly being > pretty frustrated with the corner I find myself in) I > would like to know, hopefully from someone responsible > for the subsystem, if ucom/ftdi is likely to be fixed > in the next six months. You can probably learn something about who, if anyone, is responsible by poking around http://www.freebsd.org/cgi/cvsweb.cgi/src/sys/dev/usb/ From owner-freebsd-usb@FreeBSD.ORG Fri Sep 9 19:40:54 2005 Return-Path: X-Original-To: freebsd-usb@FreeBSD.ORG Delivered-To: freebsd-usb@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id AF67C16A41F; Fri, 9 Sep 2005 19:40:54 +0000 (GMT) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (vc4-2-0-87.dsl.netrack.net [199.45.160.85]) by mx1.FreeBSD.org (Postfix) with ESMTP id 54B3A43D46; Fri, 9 Sep 2005 19:40:54 +0000 (GMT) (envelope-from imp@bsdimp.com) Received: from localhost (localhost.village.org [127.0.0.1] (may be forged)) by harmony.bsdimp.com (8.13.3/8.13.3) with ESMTP id j89JdXmJ047656; Fri, 9 Sep 2005 13:39:33 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Fri, 09 Sep 2005 13:39:33 -0600 (MDT) Message-Id: <20050909.133933.74701845.imp@bsdimp.com> To: pm940@yahoo.com From: Warner Losh In-Reply-To: <20050909170944.77242.qmail@web54002.mail.yahoo.com> References: <20050909170944.77242.qmail@web54002.mail.yahoo.com> X-Mailer: Mew version 3.3 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-2.0 (harmony.bsdimp.com [127.0.0.1]); Fri, 09 Sep 2005 13:39:33 -0600 (MDT) Cc: freebsd-questions@FreeBSD.ORG, freebsd-usb@FreeBSD.ORG Subject: Re: Will USB serial ever be fixed? 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: Fri, 09 Sep 2005 19:40:54 -0000 > Be honest. Be brutal. I need to know where FreeBSD > stands on this. Personal opinion: You overstate the probelems, and have a bad attitude. More details: I use umodem + ucom all the time for connecting to the internet on my laptop. I've had exactly 0 problems doing this for the past 4 years. I run current every day on this laptop, and do substantial development. If the problems were as dire as you suggest, I'd be unable to do this at all. There may be other problems in the serial subsystem intersected with usb, however I think you vastly overstate your case. Even to the point that it will be hard for you to effect change because people don't take you seriously. Warner From owner-freebsd-usb@FreeBSD.ORG Fri Sep 9 19:50:58 2005 Return-Path: X-Original-To: freebsd-usb@freebsd.org Delivered-To: freebsd-usb@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E0CEE16A41F; Fri, 9 Sep 2005 19:50:58 +0000 (GMT) (envelope-from mike@sentex.net) Received: from smarthost1.sentex.ca (smarthost1.sentex.ca [64.7.153.18]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6919443D45; Fri, 9 Sep 2005 19:50:58 +0000 (GMT) (envelope-from mike@sentex.net) Received: from pumice6.sentex.ca (pumice6.sentex.ca [64.7.153.21]) by smarthost1.sentex.ca (8.13.3/8.13.3) with ESMTP id j89Jov4j094031; Fri, 9 Sep 2005 15:50:57 -0400 (EDT) (envelope-from mike@sentex.net) Received: from lava.sentex.ca (pyroxene.sentex.ca [199.212.134.18]) by pumice6.sentex.ca (8.13.3/8.13.3) with ESMTP id j89Jov99095885; Fri, 9 Sep 2005 15:50:57 -0400 (EDT) (envelope-from mike@sentex.net) Received: from simian.sentex.net (simeon.sentex.ca [192.168.43.27]) by lava.sentex.ca (8.13.3/8.13.3) with ESMTP id j89Jot2g055360 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 9 Sep 2005 15:50:55 -0400 (EDT) (envelope-from mike@sentex.net) Message-Id: <6.2.3.4.0.20050909152156.05cfd970@64.7.153.2> X-Mailer: QUALCOMM Windows Eudora Version 6.2.3.4 Date: Fri, 09 Sep 2005 15:51:21 -0400 To: Paul Marciano From: Mike Tancsa In-Reply-To: <1126292392.11649.5.camel@realtime.exit.com> References: <20050909170944.77242.qmail@web54002.mail.yahoo.com> <1126292392.11649.5.camel@realtime.exit.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed X-Virus-Scanned: by amavisd-new X-Scanned-By: MIMEDefang 2.51 on 64.7.153.18 X-Scanned-By: MIMEDefang 2.51 on 64.7.153.21 Cc: freebsd-questions@freebsd.org, freebsd-usb@freebsd.org Subject: Re: Will USB serial ever be fixed? 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: Fri, 09 Sep 2005 19:50:59 -0000 At 02:59 PM 09/09/2005, Frank Mayhar wrote: >On Fri, 2005-09-09 at 10:09 -0700, Paul Marciano wrote: > > I have a general question on the status of USB to > > serial support in FreeBSD (specifically the ucom and > > ftdi drivers). > > > > I need an extra serial port on my system and for > > reasons outside the scope of this email I can't just > > plug in a PCI card. I'm trying to use USB, but it > > seems that ucom is broken and no one is fixing it. > > > > A tcflush() bug posted last year reports that USB > > serial ports hang on a call to tcflush(). This can be > > observed by using getty on one. > > > > Another poster reported problems running PPP > > (including a kernel crash). > >Well, I've got a handful of such devices that appear to work just fine. >Now, mine are based on the Prolific PL-2303* chips but you don't mention >any specific hardware. All I know is that I'm using them for consoles >(and am running getty on them) with no hangs or crashes of any kind. I am using the 2 port serial USB card from http://www.byterunner.com/ and it works quite well on RELENG_5 and RELENG_6 ucom0: FTDI USB FAST SERIAL ADAPTER, rev 2.00/5.00, addr 3 ucom1: FTDI USB FAST SERIAL ADAPTER, rev 2.00/5.00, addr 3 There were a number of fixes that went into RELENG_5 that fixed panics that I was seeing. I use this ucom device presently to access 2 servers without any issues If you can provide more detail as to exactly what you were doing to trigger the panic, I can try and reproduce it on my gear here to see if its fixed or not. ---Mike From owner-freebsd-usb@FreeBSD.ORG Fri Sep 9 20:49:10 2005 Return-Path: X-Original-To: freebsd-usb@freebsd.org Delivered-To: freebsd-usb@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id BD2E016A41F for ; Fri, 9 Sep 2005 20:49:10 +0000 (GMT) (envelope-from mike@sentex.net) Received: from smarthost1.sentex.ca (smarthost1.sentex.ca [64.7.153.18]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4EFBA43D4C for ; Fri, 9 Sep 2005 20:49:10 +0000 (GMT) (envelope-from mike@sentex.net) Received: from pumice6.sentex.ca (pumice6.sentex.ca [64.7.153.21]) by smarthost1.sentex.ca (8.13.3/8.13.3) with ESMTP id j89Kn96q098762 for ; Fri, 9 Sep 2005 16:49:09 -0400 (EDT) (envelope-from mike@sentex.net) Received: from lava.sentex.ca (pyroxene.sentex.ca [199.212.134.18]) by pumice6.sentex.ca (8.13.3/8.13.3) with ESMTP id j89Kn9W8010682 for ; Fri, 9 Sep 2005 16:49:09 -0400 (EDT) (envelope-from mike@sentex.net) Received: from simian.sentex.net (simeon.sentex.ca [192.168.43.27]) by lava.sentex.ca (8.13.3/8.13.3) with ESMTP id j89Kn8gR055719 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Fri, 9 Sep 2005 16:49:08 -0400 (EDT) (envelope-from mike@sentex.net) Message-Id: <6.2.3.4.0.20050909164550.06dbe990@64.7.153.2> X-Mailer: QUALCOMM Windows Eudora Version 6.2.3.4 Date: Fri, 09 Sep 2005 16:49:27 -0400 To: freebsd-usb@freebsd.org From: Mike Tancsa Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed X-Virus-Scanned: by amavisd-new X-Scanned-By: MIMEDefang 2.51 on 64.7.153.18 X-Scanned-By: MIMEDefang 2.51 on 64.7.153.21 Subject: USB modems (analog) 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: Fri, 09 Sep 2005 20:49:10 -0000 Anyone know of where I can find some small analog USB modems that work with FreeBSD ? Most on the market are of the Connexant/Winmodem variety which of course do not work. Someone mentioned and "ELSA MicroLink 56k USB modem". Does anyone know where I could source one of these in North America ? Ideally something that draws its power from the USB port and does not require an extra power blob. ---Mike -------------------------------------------------------------------- Mike Tancsa, tel +1 519 651 3400 Sentex Communications, mike@sentex.net Providing Internet since 1994 www.sentex.net Cambridge, Ontario Canada www.sentex.net/mike From owner-freebsd-usb@FreeBSD.ORG Fri Sep 9 22:19:57 2005 Return-Path: X-Original-To: freebsd-usb@freebsd.org Delivered-To: freebsd-usb@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5E04E16A41F for ; Fri, 9 Sep 2005 22:19:57 +0000 (GMT) (envelope-from jmg@hydrogen.funkthat.com) Received: from hydrogen.funkthat.com (gate.funkthat.com [69.17.45.168]) by mx1.FreeBSD.org (Postfix) with ESMTP id 029AD43D45 for ; Fri, 9 Sep 2005 22:19:56 +0000 (GMT) (envelope-from jmg@hydrogen.funkthat.com) Received: from hydrogen.funkthat.com (localhost.funkthat.com [127.0.0.1]) by hydrogen.funkthat.com (8.13.3/8.13.3) with ESMTP id j89MJu1K037887; Fri, 9 Sep 2005 15:19:56 -0700 (PDT) (envelope-from jmg@hydrogen.funkthat.com) Received: (from jmg@localhost) by hydrogen.funkthat.com (8.13.3/8.13.3/Submit) id j89MJu7Y037886; Fri, 9 Sep 2005 15:19:56 -0700 (PDT) (envelope-from jmg) Date: Fri, 9 Sep 2005 15:19:56 -0700 From: John-Mark Gurney To: Paul Marciano Message-ID: <20050909221955.GF793@funkthat.com> Mail-Followup-To: Paul Marciano , freebsd-usb@freebsd.org References: <20050909170944.77242.qmail@web54002.mail.yahoo.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050909170944.77242.qmail@web54002.mail.yahoo.com> User-Agent: Mutt/1.4.2.1i X-Operating-System: FreeBSD 5.4-RELEASE-p6 i386 X-PGP-Fingerprint: B7 EC EF F8 AE ED A7 31 96 7A 22 B3 D8 56 36 F4 X-Files: The truth is out there X-URL: http://resnet.uoregon.edu/~gurney_j/ X-Resume: http://resnet.uoregon.edu/~gurney_j/resume.html Cc: freebsd-usb@freebsd.org Subject: Re: Will USB serial ever be fixed? X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: John-Mark Gurney List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Sep 2005 22:19:57 -0000 Paul Marciano wrote this message on Fri, Sep 09, 2005 at 10:09 -0700: > Be honest. Be brutal. I need to know where FreeBSD > stands on this. to be brtual: What are you going to do about it? Ask not what FreeBSD can do for you, but what you can do for FreeBSD. (To steal a quote from someone else who adopted the quote to FreeBSD.) People keep forgetting that FreeBSD is a volunteer organization, and demanding that people fix things for them. FreeBSD was built by developers and hobbiest who have free time to work on the code. If it's this important to you, start a fund and find someone to pay to do the work for you. . -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not." From owner-freebsd-usb@FreeBSD.ORG Fri Sep 9 22:21:28 2005 Return-Path: X-Original-To: freebsd-usb@freebsd.org Delivered-To: freebsd-usb@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1FB7016A420 for ; Fri, 9 Sep 2005 22:21:28 +0000 (GMT) (envelope-from pm940@yahoo.com) Received: from web54010.mail.yahoo.com (web54010.mail.yahoo.com [206.190.36.234]) by mx1.FreeBSD.org (Postfix) with SMTP id 6387E43D46 for ; Fri, 9 Sep 2005 22:21:27 +0000 (GMT) (envelope-from pm940@yahoo.com) Received: (qmail 2217 invoked by uid 60001); 9 Sep 2005 22:21:26 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:Received:Date:From:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=5JasZrZ+x3AHE7CXVldexEIJGx69nOWIpIWE3UlCjPipFEN7uCjRNl1OeX0fMLOcWsWEGD0sbRbXr0RCB9LHlrxXE14cc2NyEO1kLduG34TbQJgrig7MO9cHtMx1Q8hknSSMnCNG07kYrk/BBl6nRblxNSplJ+5xZ/Vb5C9tmCg= ; Message-ID: <20050909222126.2215.qmail@web54010.mail.yahoo.com> Received: from [69.237.122.17] by web54010.mail.yahoo.com via HTTP; Fri, 09 Sep 2005 15:21:26 PDT Date: Fri, 9 Sep 2005 15:21:26 -0700 (PDT) From: Paul Marciano To: frank@exit.com In-Reply-To: <1126292392.11649.5.camel@realtime.exit.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Cc: freebsd-questions@freebsd.org, freebsd-usb@freebsd.org Subject: Re: Will USB serial ever be fixed? 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: Fri, 09 Sep 2005 22:21:28 -0000 --- Frank Mayhar wrote: > Well, I've got a handful of such devices that appear > to work just fine. > Now, mine are based on the Prolific PL-2303* chips > but you don't mention > any specific hardware. All I know is that I'm using > them for consoles > (and am running getty on them) with no hangs or > crashes of any kind. Thanks Frank. I'm using a converter based on the FTDI232BM, on FreeBSD 5.3-RELEASE. ucom0: FTDI USB to Serial Cable, rev 1.10/4.00, addr 2 I am seeing the ucom0 work with normal input/output, but not with getty. With getting it prompts for the login then, upon hitting return, freezes. Without getty I can send and receive characters all day long without problems. Once the freeze happens, I can stty -f ucom0 -hup and data starts again. Referencing the following: http://lists.freebsd.org/pipermail/freebsd-questions/2004-June/049433.html http://www.freebsd.org/cgi/query-pr.cgi?pr=65769 --- Warner Losh wrote: > Personal opinion: You overstate the probelems, and > have a bad attitude. Perhaps, at least on one count. > I use umodem + ucom all the time for connecting to > the internet on my laptop. I've had exactly 0 > problems doing this for the past 4 years. I'm happy for you. I've been using FreeBSD since it was called 386BSD + patches and there are many things I've never had problems with too. It seems we're both happy people... mostly. > There may be other problems in the serial subsystem > intersected with usb [...] That's precisely the area I'm interested in. > Even to the point that it will be hard for you to > effect change because people don't take you > seriously. I don't want to effect change, I just want a working system. If you're serious about supporting an operating system you have to support all your uses, even the assholes. Thanks, Paul. __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com From owner-freebsd-usb@FreeBSD.ORG Fri Sep 9 23:29:32 2005 Return-Path: X-Original-To: freebsd-usb@freebsd.org Delivered-To: freebsd-usb@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7E9CB16A41F; Fri, 9 Sep 2005 23:29:32 +0000 (GMT) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (vc4-2-0-87.dsl.netrack.net [199.45.160.85]) by mx1.FreeBSD.org (Postfix) with ESMTP id 152B243D46; Fri, 9 Sep 2005 23:29:32 +0000 (GMT) (envelope-from imp@bsdimp.com) Received: from localhost (localhost.village.org [127.0.0.1] (may be forged)) by harmony.bsdimp.com (8.13.3/8.13.3) with ESMTP id j89NSHu5049235; Fri, 9 Sep 2005 17:28:17 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Fri, 09 Sep 2005 17:28:16 -0600 (MDT) Message-Id: <20050909.172816.112623086.imp@bsdimp.com> To: pm940@yahoo.com From: "M. Warner Losh" In-Reply-To: <20050909222126.2215.qmail@web54010.mail.yahoo.com> References: <1126292392.11649.5.camel@realtime.exit.com> <20050909222126.2215.qmail@web54010.mail.yahoo.com> X-Mailer: Mew version 3.3 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-2.0 (harmony.bsdimp.com [127.0.0.1]); Fri, 09 Sep 2005 17:28:17 -0600 (MDT) Cc: freebsd-questions@freebsd.org, freebsd-usb@freebsd.org Subject: Re: Will USB serial ever be fixed? 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: Fri, 09 Sep 2005 23:29:32 -0000 In message: <20050909222126.2215.qmail@web54010.mail.yahoo.com> Paul Marciano writes: : > Even to the point that it will be hard for you to : > effect change because people don't take you : > seriously. : : I don't want to effect change, I just want a working : system. If the system isn't working for you, then you're advocating a change. : If you're serious about supporting an : operating system you have to support all your uses, : even the assholes. Since I don't have usb serial hardware that's tickling the problem, I'm unmotivated to do anything about the problems. And even if I was motivated, I can't even begin to do anything about the problem without hardware. And even if I had the hardware, it has to be important to me. Either for something cool I'm hacking on, or because I get a fist full of dollars for my efforts. You asked for honesty, and I'll give you some more: You are being a jerk and acting like you are entitled to having your particular problem fixed without pitching in and helping in some way. This combination is particularly bad when faced with an open source project. It will get you nowhere but frustrated when we don't cow-tow to your demands. Have a nice day. Warner From owner-freebsd-usb@FreeBSD.ORG Fri Sep 9 23:42:37 2005 Return-Path: X-Original-To: freebsd-usb@freebsd.org Delivered-To: freebsd-usb@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8933A16A425 for ; Fri, 9 Sep 2005 23:42:37 +0000 (GMT) (envelope-from pm940@yahoo.com) Received: from web54007.mail.yahoo.com (web54007.mail.yahoo.com [206.190.36.231]) by mx1.FreeBSD.org (Postfix) with SMTP id BB52F43D48 for ; Fri, 9 Sep 2005 23:42:36 +0000 (GMT) (envelope-from pm940@yahoo.com) Received: (qmail 7920 invoked by uid 60001); 9 Sep 2005 23:42:35 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:Received:Date:From:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=lk9qmJppZ2ODtKe/GUL9LUZdOoLrLRbVROkGxtg5A6meUE6/N+xiYEYKuM0z17jmRCIcbtXiDdyDzIzyV73VaAcsMftbgFVPfdeERTxb4UvMWg+EbH0+2asCNfKFVk63rDVoCRAmLQMf+cvwqNRtl50G8kfXtI46vNStAriyrGk= ; Message-ID: <20050909234235.7917.qmail@web54007.mail.yahoo.com> Received: from [69.237.122.17] by web54007.mail.yahoo.com via HTTP; Fri, 09 Sep 2005 16:42:35 PDT Date: Fri, 9 Sep 2005 16:42:35 -0700 (PDT) From: Paul Marciano To: "M. Warner Losh" In-Reply-To: <20050909.172816.112623086.imp@bsdimp.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Cc: freebsd-questions@freebsd.org, freebsd-usb@freebsd.org Subject: Re: Will USB serial ever be fixed? 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: Fri, 09 Sep 2005 23:42:37 -0000 --- "M. Warner Losh" wrote: > You asked for honesty, and I'll give you some more: > You are being a jerk and acting like you are > entitled to having your particular > problem fixed without pitching in and helping in > some way. You're funny... but actually I was only asking for an assessment... asking if it was going to be fixed. If not, that's my problem. No demands explicit or implied. I'm neither demanding nor expecting anything except the truth. For you, the truth is that it isn't a problem you're interested in (besides calling me names, which let's face it, is fun). That's not intended as a slant on you, mearly an interpretation of your position. That there's an open bug says it hasn't been a problem on the top of anyone elses list. If the final truth is that there are bigger fish to fry and so it's going to be a while before the heroic USB developers get around to this, then that's fine and it's something I'll have to deal with. However, if someone is a week away from fixing it, then that would be useful to know. Thanks, Paul. ______________________________________________________ Click here to donate to the Hurricane Katrina relief effort. http://store.yahoo.com/redcross-donate3/ From owner-freebsd-usb@FreeBSD.ORG Fri Sep 9 23:49:54 2005 Return-Path: X-Original-To: freebsd-usb@freebsd.org Delivered-To: freebsd-usb@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 36FCF16A41F; Fri, 9 Sep 2005 23:49:54 +0000 (GMT) (envelope-from vizion@vizion.occoxmail.com) Received: from lakecmmtao05.coxmail.com (lakecmmtao05.coxmail.com [68.99.120.79]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7BCCF43D46; Fri, 9 Sep 2005 23:49:53 +0000 (GMT) (envelope-from vizion@vizion.occoxmail.com) Received: from dns1 ([64.58.171.82]) by lakecmmtao05.coxmail.com (InterMail vM.6.01.05.02 201-2131-123-102-20050715) with ESMTP id <20050909234954.NCNS2425.lakecmmtao05.coxmail.com@dns1>; Fri, 9 Sep 2005 19:49:54 -0400 From: Vizion To: freebsd-questions@freebsd.org Date: Fri, 9 Sep 2005 16:45:34 -0700 User-Agent: KMail/1.8 References: <1126292392.11649.5.camel@realtime.exit.com> <20050909222126.2215.qmail@web54010.mail.yahoo.com> <20050909.172816.112623086.imp@bsdimp.com> In-Reply-To: <20050909.172816.112623086.imp@bsdimp.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200509091645.36177.vizion@vizion.occoxmail.com> Cc: pm940@yahoo.com, freebsd-usb@freebsd.org Subject: Re: Will USB serial ever be fixed? 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: Fri, 09 Sep 2005 23:49:54 -0000 On Friday 09 September 2005 16:28, the author M. Warner Losh contributed to the dialogue on- Re: Will USB serial ever be fixed?: >In message: <20050909222126.2215.qmail@web54010.mail.yahoo.com> > > Paul Marciano writes: >: > Even to the point that it will be hard for you to >: > effect change because people don't take you >: > seriously. >: >: I don't want to effect change, I just want a working >: system. > >If the system isn't working for you, then you're advocating a change. > >: If you're serious about supporting an >: operating system you have to support all your uses, >: even the assholes. > >Since I don't have usb serial hardware that's tickling the problem, >I'm unmotivated to do anything about the problems. And even if I was >motivated, I can't even begin to do anything about the problem without >hardware. And even if I had the hardware, it has to be important to >me. Either for something cool I'm hacking on, or because I get a fist >full of dollars for my efforts. > >You asked for honesty, and I'll give you some more: You are being a >jerk and acting like you are entitled to having your particular >problem fixed without pitching in and helping in some way. This >combination is particularly bad when faced with an open source >project. It will get you nowhere but frustrated when we don't cow-tow >to your demands. > >Have a nice day. Hey Warner come on relax a bit It has been said that the human being is mearly a glorified ice do-nut -- if you carry on giving people a hard time they might forget to concentrate on the attractive stuff you have on top and concentrate on the debris at the bottom david > >Warner >_______________________________________________ >freebsd-questions@freebsd.org mailing list >http://lists.freebsd.org/mailman/listinfo/freebsd-questions >To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.org" -- 40 yrs navigating and computing in blue waters. English Owner & Captain of British Registered 60' bluewater Ketch S/V Taurus. Currently in San Diego, CA. Sailing bound for Europe via Panama Canal after completing engineroom refit. From owner-freebsd-usb@FreeBSD.ORG Sat Sep 10 02:27:58 2005 Return-Path: X-Original-To: freebsd-usb@freebsd.org Delivered-To: freebsd-usb@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5423F16A420 for ; Sat, 10 Sep 2005 02:27:58 +0000 (GMT) (envelope-from tomdean@speakeasy.org) Received: from mail23.sea5.speakeasy.net (mail23.sea5.speakeasy.net [69.17.117.25]) by mx1.FreeBSD.org (Postfix) with ESMTP id DDD4343D46 for ; Sat, 10 Sep 2005 02:27:57 +0000 (GMT) (envelope-from tomdean@speakeasy.org) Received: (qmail 25478 invoked from network); 10 Sep 2005 02:27:57 -0000 Received: from dsl081-020-229.sea1.dsl.speakeasy.net (HELO asus.tddhome) ([64.81.20.229]) (envelope-sender ) by mail23.sea5.speakeasy.net (qmail-ldap-1.03) with AES256-SHA encrypted SMTP for ; 10 Sep 2005 02:27:57 -0000 Received: from asus.tddhome (localhost.tddhome [127.0.0.1]) by asus.tddhome (8.13.3/8.12.11) with ESMTP id j8A2RuBu067914; Fri, 9 Sep 2005 19:27:56 -0700 (PDT) (envelope-from tomdean@speakeasy.org) Received: (from tomdean@localhost) by asus.tddhome (8.13.3/8.12.11/Submit) id j8A2RumI067911; Fri, 9 Sep 2005 19:27:56 -0700 (PDT) (envelope-from tomdean@speakeasy.org) Date: Fri, 9 Sep 2005 19:27:56 -0700 (PDT) Message-Id: <200509100227.j8A2RumI067911@asus.tddhome> X-Authentication-Warning: asus.tddhome: tomdean set sender to tomdean@speakeasy.org using -f From: User Tomdean To: pm940@yahoo.com In-reply-to: <20050909170944.77242.qmail@web54002.mail.yahoo.com> (message from Paul Marciano on Fri, 9 Sep 2005 10:09:43 -0700 (PDT)) References: <20050909170944.77242.qmail@web54002.mail.yahoo.com> Cc: freebsd-questions@freebsd.org, freebsd-usb@freebsd.org Subject: Re: Will USB serial ever be fixed? 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, 10 Sep 2005 02:27:58 -0000 I have pushed the ucom/uftdi drivers VERY hard over the past couple weeks, attempting to get more thru-put. I have had NO problems, other than being unable to get a consistent one byte thruput every 6.2 uSec. This is a problem of the FreeBSD scheduler, NOT the USB code. Kudos to the USB developers. tomdean From owner-freebsd-usb@FreeBSD.ORG Sat Sep 10 09:36:50 2005 Return-Path: X-Original-To: freebsd-usb@freebsd.org Delivered-To: freebsd-usb@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E742316A41F for ; Sat, 10 Sep 2005 09:36:50 +0000 (GMT) (envelope-from ticso@cicely12.cicely.de) Received: from srv1.cosmo-project.de (srv1.cosmo-project.de [213.83.6.106]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1CC4D43D48 for ; Sat, 10 Sep 2005 09:36:49 +0000 (GMT) (envelope-from ticso@cicely12.cicely.de) Received: from cicely5.cicely.de (cicely5.cicely.de [10.1.1.7]) (authenticated bits=0) by srv1.cosmo-project.de (8.12.10/8.12.10) with ESMTP id j8A9ajBS031987 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=OK); Sat, 10 Sep 2005 11:36:47 +0200 (CEST) (envelope-from ticso@cicely12.cicely.de) Received: from cicely12.cicely.de (cicely12.cicely.de [10.1.1.14]) by cicely5.cicely.de (8.12.10/8.12.10) with ESMTP id j8A9aHqK096225 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 10 Sep 2005 11:36:18 +0200 (CEST) (envelope-from ticso@cicely12.cicely.de) Received: from cicely12.cicely.de (localhost [127.0.0.1]) by cicely12.cicely.de (8.12.11/8.12.11) with ESMTP id j8A9aHGk023652; Sat, 10 Sep 2005 11:36:17 +0200 (CEST) (envelope-from ticso@cicely12.cicely.de) Received: (from ticso@localhost) by cicely12.cicely.de (8.12.11/8.12.11/Submit) id j8A9aFFO023651; Sat, 10 Sep 2005 11:36:15 +0200 (CEST) (envelope-from ticso) Date: Sat, 10 Sep 2005 11:36:15 +0200 From: Bernd Walter To: Mike Tancsa Message-ID: <20050910093615.GN20336@cicely12.cicely.de> References: <6.2.3.4.0.20050909164550.06dbe990@64.7.153.2> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <6.2.3.4.0.20050909164550.06dbe990@64.7.153.2> X-Operating-System: FreeBSD cicely12.cicely.de 5.2-CURRENT alpha User-Agent: Mutt/1.5.9i X-Spam-Status: No, score=-5.9 required=3.0 tests=ALL_TRUSTED,BAYES_00 autolearn=ham version=3.0.4 X-Spam-Report: * -3.3 ALL_TRUSTED Did not pass through any untrusted hosts * -2.6 BAYES_00 BODY: Bayesian spam probability is 0 to 1% * [score: 0.0000] X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on cicely12.cicely.de Cc: freebsd-usb@freebsd.org Subject: Re: USB modems (analog) X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: ticso@cicely.de List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Sep 2005 09:36:51 -0000 On Fri, Sep 09, 2005 at 04:49:27PM -0400, Mike Tancsa wrote: > > Anyone know of where I can find some small analog USB modems that > work with FreeBSD ? Most on the market are of the Connexant/Winmodem > variety which of course do not work. Someone mentioned and "ELSA > MicroLink 56k USB modem". Does anyone know where I could source one > of these in North America ? Ideally something that draws its power > from the USB port and does not require an extra power blob. A used on seems to be the best choice these days. Be carefull about ELSA/devolo modems, they had been using a fine working Lucent chipset, but now are using an STM softmodem one. They didn't change the product name. USR/3Com is also bad these day, they have a new softmodem modell now. Maybe Multitech is a choice - never tried them. If you find one please let me know, I personally gave it up. -- B.Walter BWCT http://www.bwct.de bernd@bwct.de info@bwct.de From owner-freebsd-usb@FreeBSD.ORG Sat Sep 10 12:47:50 2005 Return-Path: X-Original-To: freebsd-usb@freebsd.org Delivered-To: freebsd-usb@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id EFE4E16A41F for ; Sat, 10 Sep 2005 12:47:49 +0000 (GMT) (envelope-from nb_root@videotron.ca) Received: from relais.videotron.ca (relais.videotron.ca [24.201.245.36]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9755143D45 for ; Sat, 10 Sep 2005 12:47:49 +0000 (GMT) (envelope-from nb_root@videotron.ca) Received: from clk01a ([66.130.198.54]) by VL-MO-MR003.ip.videotron.ca (Sun Java System Messaging Server 6.2-2.05 (built Apr 28 2005)) with ESMTP id <0IML000BDQ7O4130@VL-MO-MR003.ip.videotron.ca> for freebsd-usb@freebsd.org; Sat, 10 Sep 2005 08:47:49 -0400 (EDT) Date: Sat, 10 Sep 2005 08:47:40 -0400 From: Nicolas Blais To: freebsd-usb@freebsd.org Message-id: <200509100847.48217.nb_root@videotron.ca> MIME-version: 1.0 Content-type: multipart/signed; boundary=nextPart2747988.iIkbTydzmp; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-transfer-encoding: 7bit User-Agent: KMail/1.8.2 Subject: USB card reader not working in 7-CURRENT 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, 10 Sep 2005 12:47:50 -0000 --nextPart2747988.iIkbTydzmp Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Hi, I have a Mitsumi 7/1 multi-card reader with integrated floppy. The memo= ry=20 card part doesn't work in FreeBSD 7-CURRENT. If it is plugged in at boot, I= =20 get : uhci0: port 0xc400-0xc41f irq 11 at device 16.0= on=20 pci0 uhci0: Reserved 0x20 bytes for rid 0x20 type 4 at 0xc400 uhci0: [GIANT-LOCKED] uhci0: LegSup =3D 0x8030 usb0: on uhci0 usb0: USB revision 1.0 usbd_get_string: getting lang failed, using 0 uhub0: VIA UHCI root hub, class 9/0, rev 1.00/1.00, addr 1 uhub0: 2 ports with 2 removable, self powered uhci1: port 0xc800-0xc81f irq 11 at device 16.1= on=20 pci0 uhci1: Reserved 0x20 bytes for rid 0x20 type 4 at 0xc800 uhci1: [GIANT-LOCKED] uhci1: LegSup =3D 0x8030 usb1: on uhci1 usb1: USB revision 1.0 usbd_get_string: getting lang failed, using 0 uhub1: VIA UHCI root hub, class 9/0, rev 1.00/1.00, addr 1 uhub1: 2 ports with 2 removable, self powered uhci2: port 0xd000-0xd01f irq 10 at device 16.2= on=20 pci0 uhci2: Reserved 0x20 bytes for rid 0x20 type 4 at 0xd000 uhci2: [GIANT-LOCKED] uhci2: LegSup =3D 0x8030 usb2: on uhci2 usb2: USB revision 1.0 usbd_get_string: getting lang failed, using 0 uhub2: VIA UHCI root hub, class 9/0, rev 1.00/1.00, addr 1 uhub2: 2 ports with 2 removable, self powered uhci3: port 0xd400-0xd41f irq 10 at device 16.3= on=20 pci0 uhci3: Reserved 0x20 bytes for rid 0x20 type 4 at 0xd400 uhci3: [GIANT-LOCKED] uhci3: LegSup =3D 0x8030 usb3: on uhci3 usb3: USB revision 1.0 usbd_get_string: getting lang failed, using 0 uhub3: VIA UHCI root hub, class 9/0, rev 1.00/1.00, addr 1 uhub3: 2 ports with 2 removable, self powered ehci0: mem 0xfbc00000-0xfbc000ff irq 5 at=20 device 16.4 on pci0 ehci0: Reserved 0x100 bytes for rid 0x10 type 3 at 0xfbc00000 ehci0: [GIANT-LOCKED] usb4: waiting for BIOS to give up control usb4: EHCI version 1.0 usb4: companion controllers, 2 ports each: usb0 usb1 usb2 usb3 usb4: on ehci0 usb4: USB revision 2.0 uhub4: VIA EHCI root hub, class 9/0, rev 2.00/1.00, addr 1 uhub4: 8 ports with 8 removable, self powered umass0: VIA Technologies Inc. Mitsumi multi cardreader, rev 2.00/0.03, addr= 2 umass0: SCSI over Bulk-Only; quirks =3D 0x0000 umass0:0:0:-1: Attached to scbus0 (probe1:umass-sim0:0:0:0): Request completed with CAM_REQ_CMP_ERR (probe1:umass-sim0:0:0:0): Retrying Command (probe1:umass-sim0:0:0:0): Request completed with CAM_REQ_CMP_ERR (probe1:umass-sim0:0:0:0): Retrying Command (probe1:umass-sim0:0:0:0): Request completed with CAM_REQ_CMP_ERR (probe1:umass-sim0:0:0:0): Retrying Command (probe1:umass-sim0:0:0:0): Request completed with CAM_REQ_CMP_ERR (probe1:umass-sim0:0:0:0): Retrying Command (probe1:umass-sim0:0:0:0): Request completed with CAM_REQ_CMP_ERR (probe1:umass-sim0:0:0:0): error 5 (probe1:umass-sim0:0:0:0): Retries Exausted and camcontrol devlist -v : scbus0 on umass-sim0 bus 0: if I camcontrol rescan 0: ehci_timeout: exfer=3D0xc36d2900 ehci_timeout_task: xfer=3D0xc36d2900 ehci_abort_xfer: xfer=3D0xc36d2900 pipe=3D0xc36d1300 ehci_intr1: door bell ehci_device_clear_toggle: epipe=3D0xc36d1200 status=3D0x0 usbd_dump_pipe: pipe=3D0xc36d1200 usbd_dump_iface: iface=3D0xc35bfc40 device=3D0xc36b9d80 idesc=3D0xc35bfc69 index=3D0 altindex=3D0 priv=3D0 usbd_dump_device: dev=3D0xc36b9d80 bus=3D0xc35b6800 default_pipe=3D0xc36b9e00 address=3D2 config=3D1 depth=3D1 speed=3D3 self_powered=3D0 power=3D100 la= ngid=3D1033 usbd_dump_endpoint: endp=3D0xc36a4ae0 edesc=3D0xc35bfc72 refcnt=3D1 bEndpointAddress=3D0x81 (usbd_dump_pipe:) refcnt=3D1 running=3D0 aborting=3D0 intrxfer=3D0, repeat=3D0, interval=3D-1 ehci_device_clear_toggle: epipe=3D0xc36d1300 status=3D0x0 usbd_dump_pipe: pipe=3D0xc36d1300 usbd_dump_iface: iface=3D0xc35bfc40 device=3D0xc36b9d80 idesc=3D0xc35bfc69 index=3D0 altindex=3D0 priv=3D0 usbd_dump_device: dev=3D0xc36b9d80 bus=3D0xc35b6800 default_pipe=3D0xc36b9e00 address=3D2 config=3D1 depth=3D1 speed=3D3 self_powered=3D0 power=3D100 la= ngid=3D1033 usbd_dump_endpoint: endp=3D0xc36a4ae8 edesc=3D0xc35bfc79 refcnt=3D1 bEndpointAddress=3D0x02 (usbd_dump_pipe:) refcnt=3D1 running=3D0 aborting=3D0 intrxfer=3D0, repeat=3D0, interval=3D-1 (probe0:umass-sim0:0:0:0): Request completed with CAM_REQ_CMP_ERR (probe0:umass-sim0:0:0:0): Retrying Command ehci_timeout: exfer=3D0xc36d2900 ehci_timeout_task: xfer=3D0xc36d2900 ehci_abort_xfer: xfer=3D0xc36d2900 pipe=3D0xc36d1300 ehci_intr1: door bell ehci_device_clear_toggle: epipe=3D0xc36d1200 status=3D0x0 usbd_dump_pipe: pipe=3D0xc36d1200 usbd_dump_iface: iface=3D0xc35bfc40 device=3D0xc36b9d80 idesc=3D0xc35bfc69 index=3D0 altindex=3D0 priv=3D0 usbd_dump_device: dev=3D0xc36b9d80 bus=3D0xc35b6800 default_pipe=3D0xc36b9e00 address=3D2 config=3D1 depth=3D1 speed=3D3 self_powered=3D0 power=3D100 la= ngid=3D1033 usbd_dump_endpoint: endp=3D0xc36a4ae0 edesc=3D0xc35bfc72 refcnt=3D1 bEndpointAddress=3D0x81 (usbd_dump_pipe:) refcnt=3D1 running=3D0 aborting=3D0 intrxfer=3D0, repeat=3D0, interval=3D-1 ehci_device_clear_toggle: epipe=3D0xc36d1300 status=3D0x0 usbd_dump_pipe: pipe=3D0xc36d1300 usbd_dump_iface: iface=3D0xc35bfc40 device=3D0xc36b9d80 idesc=3D0xc35bfc69 index=3D0 altindex=3D0 priv=3D0 usbd_dump_device: dev=3D0xc36b9d80 bus=3D0xc35b6800 default_pipe=3D0xc36b9e00 address=3D2 config=3D1 depth=3D1 speed=3D3 self_powered=3D0 power=3D100 la= ngid=3D1033 usbd_dump_endpoint: endp=3D0xc36a4ae8 edesc=3D0xc35bfc79 refcnt=3D1 bEndpointAddress=3D0x02 (usbd_dump_pipe:) refcnt=3D1 running=3D0 aborting=3D0 intrxfer=3D0, repeat=3D0, interval=3D-1 (probe0:umass-sim0:0:0:0): Request completed with CAM_REQ_CMP_ERR (probe0:umass-sim0:0:0:0): Retrying Command ehci_timeout: exfer=3D0xc36d2900 ehci_timeout_task: xfer=3D0xc36d2900 ehci_abort_xfer: xfer=3D0xc36d2900 pipe=3D0xc36d1300 ehci_intr1: door bell ehci_device_clear_toggle: epipe=3D0xc36d1200 status=3D0x0 usbd_dump_pipe: pipe=3D0xc36d1200 usbd_dump_iface: iface=3D0xc35bfc40 device=3D0xc36b9d80 idesc=3D0xc35bfc69 index=3D0 altindex=3D0 priv=3D0 usbd_dump_device: dev=3D0xc36b9d80 bus=3D0xc35b6800 default_pipe=3D0xc36b9e00 address=3D2 config=3D1 depth=3D1 speed=3D3 self_powered=3D0 power=3D100 la= ngid=3D1033 usbd_dump_endpoint: endp=3D0xc36a4ae0 edesc=3D0xc35bfc72 refcnt=3D1 bEndpointAddress=3D0x81 (usbd_dump_pipe:) refcnt=3D1 running=3D0 aborting=3D0 intrxfer=3D0, repeat=3D0, interval=3D-1 ehci_device_clear_toggle: epipe=3D0xc36d1300 status=3D0x0 usbd_dump_pipe: pipe=3D0xc36d1300 usbd_dump_iface: iface=3D0xc35bfc40 device=3D0xc36b9d80 idesc=3D0xc35bfc69 index=3D0 altindex=3D0 priv=3D0 usbd_dump_device: dev=3D0xc36b9d80 bus=3D0xc35b6800 default_pipe=3D0xc36b9e00 address=3D2 config=3D1 depth=3D1 speed=3D3 self_powered=3D0 power=3D100 la= ngid=3D1033 usbd_dump_endpoint: endp=3D0xc36a4ae8 edesc=3D0xc35bfc79 refcnt=3D1 bEndpointAddress=3D0x02 (usbd_dump_pipe:) refcnt=3D1 running=3D0 aborting=3D0 intrxfer=3D0, repeat=3D0, interval=3D-1 (probe0:umass-sim0:0:0:0): Request completed with CAM_REQ_CMP_ERR (probe0:umass-sim0:0:0:0): Retrying Command and during the probe, camcontrol devlist -v: scbus0 on umass-sim0 bus 0: < > at scbus0 target 0 lun 0 (probe0) < > at scbus0 target -1 lun -1 () debug flags used: hw.usb.debug=3D1 hw.usb.umass.debug=3D1 hw.usb.ehci.debug=3D1 Hotpluging after boot saves me 5 minutes of boot time but then still doesn'= t=20 work. Any suggestions? =2D-=20 =46reeBSD 7.0-CURRENT #0: Wed Sep 7 18:04:05 EDT 2005 =20 root@clk01a:/usr/obj/usr/src/sys/CLK01A=20 PGP? : http://66.130.198.54:8081/security/nb_root.asc --nextPart2747988.iIkbTydzmp Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2 (FreeBSD) iD8DBQBDItX0z38ton5LGeIRAjSTAKCm7SzOJUsTVhGFA5S0shDVozYbSQCeI/Eh isFr6T+KpXQHqZnDejM9ETw= =DsgA -----END PGP SIGNATURE----- --nextPart2747988.iIkbTydzmp-- From owner-freebsd-usb@FreeBSD.ORG Sat Sep 10 14:56:14 2005 Return-Path: X-Original-To: freebsd-usb@freebsd.org Delivered-To: freebsd-usb@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2EFF316A420 for ; Sat, 10 Sep 2005 14:56:14 +0000 (GMT) (envelope-from mike@sentex.net) Received: from smarthost1.sentex.ca (smarthost1.sentex.ca [64.7.153.18]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4DE2943D46 for ; Sat, 10 Sep 2005 14:56:13 +0000 (GMT) (envelope-from mike@sentex.net) Received: from pumice6.sentex.ca (pumice6.sentex.ca [64.7.153.21]) by smarthost1.sentex.ca (8.13.3/8.13.3) with ESMTP id j8AEuCXO044780 for ; Sat, 10 Sep 2005 10:56:12 -0400 (EDT) (envelope-from mike@sentex.net) Received: from lava.sentex.ca (pyroxene.sentex.ca [199.212.134.18]) by pumice6.sentex.ca (8.13.3/8.13.3) with ESMTP id j8AEuCw4018712; Sat, 10 Sep 2005 10:56:12 -0400 (EDT) (envelope-from mike@sentex.net) Received: from simian.sentex.net (simeon.sentex.ca [192.168.43.27]) by lava.sentex.ca (8.13.3/8.13.3) with ESMTP id j8AEuAAN058787 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 10 Sep 2005 10:56:11 -0400 (EDT) (envelope-from mike@sentex.net) Message-Id: <6.2.3.4.0.20050910105251.04ea9300@64.7.153.2> X-Mailer: QUALCOMM Windows Eudora Version 6.2.3.4 Date: Sat, 10 Sep 2005 10:56:28 -0400 To: ticso@cicely.de From: Mike Tancsa In-Reply-To: <20050910093615.GN20336@cicely12.cicely.de> References: <6.2.3.4.0.20050909164550.06dbe990@64.7.153.2> <20050910093615.GN20336@cicely12.cicely.de> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed X-Virus-Scanned: by amavisd-new X-Scanned-By: MIMEDefang 2.51 on 64.7.153.18 X-Scanned-By: MIMEDefang 2.51 on 64.7.153.21 Cc: freebsd-usb@freebsd.org Subject: Re: USB modems (analog) 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, 10 Sep 2005 14:56:14 -0000 At 05:36 AM 10/09/2005, Bernd Walter wrote: >A used one seems to be the best choice these days. >Be carefull about ELSA/devolo modems, they had been using a fine >working Lucent chipset, but now are using an STM softmodem one. Thanks for the heads up. Of all the local devices I found, they almost all used the STM softmodem chipset. >They didn't change the product name. >USR/3Com is also bad these day, they have a new softmodem modell now. >Maybe Multitech is a choice - never tried them. Same deal, STM. >If you find one please let me know, I personally gave it up. Assuming that programming info were available, how much time and money would you guestimate it would take to develop a FreeBSD driver for it ? We *might* have some money available to fund it and would let the driver be put into the tree. ---Mike From owner-freebsd-usb@FreeBSD.ORG Sat Sep 10 15:44:32 2005 Return-Path: X-Original-To: freebsd-usb@freebsd.org Delivered-To: freebsd-usb@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9FE2116A41F for ; Sat, 10 Sep 2005 15:44:32 +0000 (GMT) (envelope-from ticso@cicely12.cicely.de) Received: from srv1.cosmo-project.de (srv1.cosmo-project.de [213.83.6.106]) by mx1.FreeBSD.org (Postfix) with ESMTP id C4FF343D46 for ; Sat, 10 Sep 2005 15:44:31 +0000 (GMT) (envelope-from ticso@cicely12.cicely.de) Received: from cicely5.cicely.de (cicely5.cicely.de [10.1.1.7]) (authenticated bits=0) by srv1.cosmo-project.de (8.12.10/8.12.10) with ESMTP id j8AFiQBS038652 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=OK); Sat, 10 Sep 2005 17:44:28 +0200 (CEST) (envelope-from ticso@cicely12.cicely.de) Received: from cicely12.cicely.de (cicely12.cicely.de [10.1.1.14]) by cicely5.cicely.de (8.12.10/8.12.10) with ESMTP id j8AFhmqK099117 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 10 Sep 2005 17:43:49 +0200 (CEST) (envelope-from ticso@cicely12.cicely.de) Received: from cicely12.cicely.de (localhost [127.0.0.1]) by cicely12.cicely.de (8.12.11/8.12.11) with ESMTP id j8AFhmpN024877; Sat, 10 Sep 2005 17:43:48 +0200 (CEST) (envelope-from ticso@cicely12.cicely.de) Received: (from ticso@localhost) by cicely12.cicely.de (8.12.11/8.12.11/Submit) id j8AFhlMd024876; Sat, 10 Sep 2005 17:43:47 +0200 (CEST) (envelope-from ticso) Date: Sat, 10 Sep 2005 17:43:47 +0200 From: Bernd Walter To: Mike Tancsa Message-ID: <20050910154346.GA20336@cicely12.cicely.de> References: <6.2.3.4.0.20050909164550.06dbe990@64.7.153.2> <20050910093615.GN20336@cicely12.cicely.de> <6.2.3.4.0.20050910105251.04ea9300@64.7.153.2> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <6.2.3.4.0.20050910105251.04ea9300@64.7.153.2> X-Operating-System: FreeBSD cicely12.cicely.de 5.2-CURRENT alpha User-Agent: Mutt/1.5.9i X-Spam-Status: No, score=-5.9 required=3.0 tests=ALL_TRUSTED,BAYES_00 autolearn=ham version=3.0.4 X-Spam-Report: * -3.3 ALL_TRUSTED Did not pass through any untrusted hosts * -2.6 BAYES_00 BODY: Bayesian spam probability is 0 to 1% * [score: 0.0000] X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on cicely12.cicely.de Cc: ticso@cicely.de, freebsd-usb@freebsd.org Subject: Re: USB modems (analog) X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: ticso@cicely.de List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Sep 2005 15:44:32 -0000 On Sat, Sep 10, 2005 at 10:56:28AM -0400, Mike Tancsa wrote: > At 05:36 AM 10/09/2005, Bernd Walter wrote: > > >A used one seems to be the best choice these days. > >Be carefull about ELSA/devolo modems, they had been using a fine > >working Lucent chipset, but now are using an STM softmodem one. > > Thanks for the heads up. Of all the local devices I found, they > almost all used the STM softmodem chipset. That's the same I'd found out, USR/3Com has something else, but it is still a softmodem without documentation. > > >They didn't change the product name. > >USR/3Com is also bad these day, they have a new softmodem modell now. > >Maybe Multitech is a choice - never tried them. > > Same deal, STM. :( > >If you find one please let me know, I personally gave it up. > > Assuming that programming info were available, how much time and > money would you guestimate it would take to develop a FreeBSD driver > for it ? We *might* have some money available to fund it and would > let the driver be put into the tree. There is a linux driver available for the STM chipset, which is partly BSD licenced source and binary. Don't remember the licence of the binary part. The binary part is the modem itself and the AT-command parsing. The remaning is transporting data. It should be possible to port the driver, but it still contains binary parts and of course there are performance implications for a softmodem. Doing the modulation/demodulation completely from scratch is hard work. I personnaly already thought about building one using an embedded modem together with an FTDI USB-uart. -- B.Walter BWCT http://www.bwct.de bernd@bwct.de info@bwct.de From owner-freebsd-usb@FreeBSD.ORG Sat Sep 10 17:11:03 2005 Return-Path: X-Original-To: usb@freebsd.org Delivered-To: freebsd-usb@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id BAB0316A41F for ; Sat, 10 Sep 2005 17:11:03 +0000 (GMT) (envelope-from Alexander@Leidinger.net) Received: from www.ebusiness-leidinger.de (jojo.ms-net.de [84.16.236.246]) by mx1.FreeBSD.org (Postfix) with ESMTP id 31DB043D48 for ; Sat, 10 Sep 2005 17:11:02 +0000 (GMT) (envelope-from Alexander@Leidinger.net) Received: from Andro-Beta.Leidinger.net (p54A5ECE8.dip.t-dialin.net [84.165.236.232]) (authenticated bits=0) by www.ebusiness-leidinger.de (8.13.1/8.13.1) with ESMTP id j8AH03hG030778 for ; Sat, 10 Sep 2005 19:00:16 +0200 (CEST) (envelope-from Alexander@Leidinger.net) Received: from Magellan.Leidinger.net (Magellan.Leidinger.net [192.168.1.1]) by Andro-Beta.Leidinger.net (8.13.3/8.13.3) with ESMTP id j8AHA5Fs073362 for ; Sat, 10 Sep 2005 19:10:06 +0200 (CEST) (envelope-from Alexander@Leidinger.net) Date: Sat, 10 Sep 2005 19:10:05 +0200 From: Alexander Leidinger To: usb@freebsd.org Message-ID: <20050910191005.3382853a@Magellan.Leidinger.net> X-Mailer: Sylpheed-Claws 1.9.14 (GTK+ 2.6.10; i386-portbld-freebsd7.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new Cc: Subject: ehci patch, please test 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, 10 Sep 2005 17:11:03 -0000 Hi, at http://www.Leidinger.net/FreeBSD/current-patches/usb.diff I have a patch which syncs parts of ehci with *BSD/DragonFly. It will print the name of some more chipsets (ICH*, NV*, ...) and has a fix for vendor strings longer than 16 characters. Please test, I want to commit it next week. Bye, Alexander. -- To boldly go where I surely don't belong. http://www.Leidinger.net Alexander @ Leidinger.net GPG fingerprint = C518 BC70 E67F 143F BE91 3365 79E2 9C60 B006 3FE7