From owner-freebsd-usb@FreeBSD.ORG Sun Sep 23 00:36:25 2007 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8702C16A41A for ; Sun, 23 Sep 2007 00:36:25 +0000 (UTC) (envelope-from bright@elvis.mu.org) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.freebsd.org (Postfix) with ESMTP id 7E6DC13C45B for ; Sun, 23 Sep 2007 00:36:25 +0000 (UTC) (envelope-from bright@elvis.mu.org) Received: by elvis.mu.org (Postfix, from userid 1192) id 6406C1A4D7C; Sat, 22 Sep 2007 17:11:15 -0700 (PDT) Date: Sat, 22 Sep 2007 17:11:15 -0700 From: Alfred Perlstein To: Karl Triebes Message-ID: <20070923001115.GR79417@elvis.mu.org> References: <26a198490709220928i59d604f5ka71f3013f465f97a@mail.gmail.com> <26a198490709221044y21077d86x1fe539d32c057b41@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <26a198490709221044y21077d86x1fe539d32c057b41@mail.gmail.com> User-Agent: Mutt/1.4.2.3i Cc: freebsd-usb@freebsd.org Subject: Re: MT USB when? X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Sep 2007 00:36:25 -0000 * Karl Triebes [070922 11:11] wrote: > There's been a lot of talk about making USB multi-threaded. I know > Hans has been at it for quite some time now. Do you know when it'll > see daylight? There are various issues with the locking strategy that Hans has come up with, the code is lacking in documentation and has Hans not been receptive to review feedback from any FreeBSD developer. Currently there is a review initiative in place, at this time it has just begun. The best I can say is that it really is up to Hans to decide if he wants to incorporate the reviews he has asked for (which will lead to his stack's incorporation into FreeBSD), or if he wants his alternative stack to stay separate. The reviews have all been done, but since none of them have been acted on, it's really a matter of Hans picking up the ball and running with it. As you could say, the ball is in his court. -- - Alfred Perlstein From owner-freebsd-usb@FreeBSD.ORG Sun Sep 23 06:04:52 2007 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DF6B216A420 for ; Sun, 23 Sep 2007 06:04:52 +0000 (UTC) (envelope-from raaf@zen.mooo.com) Received: from smtp-4.orange.nl (smtp-4.orange.nl [193.252.22.249]) by mx1.freebsd.org (Postfix) with ESMTP id B83BE13C468 for ; Sun, 23 Sep 2007 06:04:52 +0000 (UTC) (envelope-from raaf@zen.mooo.com) Received: from smtp-4.orange.nl (mwinf6303 [10.232.3.25]) by mwinf6305.orange.nl (SMTP Server) with ESMTP id D485F1C00AB2 for ; Sun, 23 Sep 2007 07:44:51 +0200 (CEST) Received: from me-wanadoo.net (localhost [127.0.0.1]) by mwinf6303.orange.nl (SMTP Server) with ESMTP id DA0887000086 for ; Sun, 23 Sep 2007 07:44:49 +0200 (CEST) Received: from zen.mooo.com (s559292f8.adsl.wanadoo.nl [85.146.146.248]) by mwinf6303.orange.nl (SMTP Server) with ESMTP id C4ED47000084; Sun, 23 Sep 2007 07:44:49 +0200 (CEST) X-ME-UUID: 20070923054449806.C4ED47000084@mwinf6303.orange.nl Received: from zen.mooo.com (zen.mooo.com [127.0.0.1]) by zen.mooo.com (Postfix) with ESMTP id 3A65B97; Sun, 23 Sep 2007 07:44:49 +0200 (CEST) Message-ID: <46F5FD50.7050501@zen.mooo.com> Date: Sun, 23 Sep 2007 07:44:48 +0200 From: Raaf User-Agent: Thunderbird 2.0.0.4 (X11/20070615) MIME-Version: 1.0 To: freebsd-usb@freebsd.org Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: olli@lurza.secnetix.de Subject: Re: uscanner: HP ScanJet 4300C X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Sep 2007 06:04:53 -0000 Oliver Fromme wrote: > Hi, > > I have bought a HP ScanJet 4300C, specifically because > this very scanner is listed in FreeBSD's uscanner(4) > manpage and in SANE's list of supported USB scanners. > > However, this is all I get: > > uscanner0: on uhub0 > uscanner0: setting config no failed > device_attach: uscanner0 attach returned 6 > uhub0: port 4, set config at addr 2 failed > uhub0: device problem (TIMEOUT), disabling port 4 > > That's on 7-current, but it fails the same way on 6-stable. > I also tried on two different machines with different USB > chipsets, and different ports ... No change. > Most USB devices only have one configuration. You could try commenting out the call to usbd_set_config_no() and the related error checking code in the attach routine of uscanner. If that doesn't work or you want to investigate further, adding: options USB_DEBUG to your kernel configuration file will give you some more useful debugging messages. You can control the verbosity level with the hw.usb.debug sysctl. Raaf From owner-freebsd-usb@FreeBSD.ORG Sun Sep 23 06:25:05 2007 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A0AD716A469 for ; Sun, 23 Sep 2007 06:25:05 +0000 (UTC) (envelope-from raaf@zen.mooo.com) Received: from smtp-2.orange.nl (smtp-2.orange.nl [193.252.22.242]) by mx1.freebsd.org (Postfix) with ESMTP id 7950F13C4B7 for ; Sun, 23 Sep 2007 06:25:05 +0000 (UTC) (envelope-from raaf@zen.mooo.com) Received: from me-wanadoo.net (localhost [127.0.0.1]) by mwinf6104.orange.nl (SMTP Server) with ESMTP id 0E3241C00083 for ; Sun, 23 Sep 2007 08:25:04 +0200 (CEST) Received: from zen.mooo.com (s559292f8.adsl.wanadoo.nl [85.146.146.248]) by mwinf6104.orange.nl (SMTP Server) with ESMTP id EC2EB1C00081; Sun, 23 Sep 2007 08:25:03 +0200 (CEST) X-ME-UUID: 20070923062503967.EC2EB1C00081@mwinf6104.orange.nl Received: from zen.mooo.com (zen.mooo.com [127.0.0.1]) by zen.mooo.com (Postfix) with ESMTP id 5715197; Sun, 23 Sep 2007 08:25:01 +0200 (CEST) Message-ID: <46F606BC.9000906@zen.mooo.com> Date: Sun, 23 Sep 2007 08:25:00 +0200 From: Raaf User-Agent: Thunderbird 2.0.0.4 (X11/20070615) MIME-Version: 1.0 To: freebsd-usb@freebsd.org References: <46F5FD50.7050501@zen.mooo.com> In-Reply-To: <46F5FD50.7050501@zen.mooo.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: olli@lurza.secnetix.de Subject: Re: uscanner: HP ScanJet 4300C X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Sep 2007 06:25:05 -0000 Raaf wrote: > Oliver Fromme wrote: >> Hi, >> >> I have bought a HP ScanJet 4300C, specifically because >> this very scanner is listed in FreeBSD's uscanner(4) >> manpage and in SANE's list of supported USB scanners. >> >> However, this is all I get: >> >> uscanner0: > addr 2> on uhub0 >> uscanner0: setting config no failed >> device_attach: uscanner0 attach returned 6 >> uhub0: port 4, set config at addr 2 failed >> uhub0: device problem (TIMEOUT), disabling port 4 >> >> That's on 7-current, but it fails the same way on 6-stable. >> I also tried on two different machines with different USB >> chipsets, and different ports ... No change. >> > > > Most USB devices only have one configuration. You could > try commenting out the call to usbd_set_config_no() and > the related error checking code in the attach routine of > uscanner. Forget about this, apparently a call to usbd_set_config_index is required to allocate the interfaces. > > If that doesn't work or you want to investigate further, > adding: > > options USB_DEBUG > > to your kernel configuration file will give you some > more useful debugging messages. You can control the > verbosity level with the hw.usb.debug sysctl. > > Raaf > From owner-freebsd-usb@FreeBSD.ORG Sun Sep 23 07:30:10 2007 Return-Path: Delivered-To: freebsd-usb@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 999F716A4A9 for ; Sun, 23 Sep 2007 07:30:10 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 850DB13C455 for ; Sun, 23 Sep 2007 07:30:10 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.1/8.14.1) with ESMTP id l8N7UABr059821 for ; Sun, 23 Sep 2007 07:30:10 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.1/8.14.1/Submit) id l8N7UAuF059817; Sun, 23 Sep 2007 07:30:10 GMT (envelope-from gnats) Resent-Date: Sun, 23 Sep 2007 07:30:10 GMT Resent-Message-Id: <200709230730.l8N7UAuF059817@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, Dave Grochowski Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B8A0716A417 for ; Sun, 23 Sep 2007 07:25:41 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21]) by mx1.freebsd.org (Postfix) with ESMTP id AA95013C465 for ; Sun, 23 Sep 2007 07:25:41 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.14.1/8.14.1) with ESMTP id l8N7Pfl7041304 for ; Sun, 23 Sep 2007 07:25:41 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.14.1/8.14.1/Submit) id l8N7PfFU041268; Sun, 23 Sep 2007 07:25:41 GMT (envelope-from nobody) Message-Id: <200709230725.l8N7PfFU041268@www.freebsd.org> Date: Sun, 23 Sep 2007 07:25:41 GMT From: Dave Grochowski To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: usb/116574: [patch] Add device ids for ICH8 USB chipsets X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Sep 2007 07:30:10 -0000 >Number: 116574 >Category: usb >Synopsis: [patch] Add device ids for ICH8 USB chipsets >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-usb >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sun Sep 23 07:30:09 GMT 2007 >Closed-Date: >Last-Modified: >Originator: Dave Grochowski >Release: 7.0-CURRENT >Organization: Lockheed Martin >Environment: FreeBSD wanderer 7.0-CURRENT FreeBSD 7.0-CURRENT #6: Sat Sep 22 00:38:37 EDT 2007 root@wanderer:/usr/obj/usr/src/sys/WANDERER i386 >Description: The patch adds the device ids for the various ICH8 USB chipsets. I followed the naming scheme used for the ICH7 chipsets. >How-To-Repeat: >Fix: Patch attached with submission follows: --- src/sys/dev/usb/ehci_pci.c.orig 2007-09-21 21:39:47.000000000 -0400 +++ src/sys/dev/usb/ehci_pci.c 2007-09-21 21:50:56.000000000 -0400 @@ -117,6 +117,10 @@ static const char *ehci_device_ich6 = "Intel 82801FB (ICH6) USB 2.0 controller"; #define PCI_EHCI_DEVICEID_ICH7 0x27cc8086 static const char *ehci_device_ich7 = "Intel 82801GB/R (ICH7) USB 2.0 controller"; +#define PCI_EHCI_DEVICEID_ICH8_A 0x28368086 +static const char *ehci_device_ich8_a = "Intel 82801H (ICH8) USB 2.0 controller USB2-A"; +#define PCI_EHCI_DEVICEID_ICH8_B 0x283a8086 +static const char *ehci_device_ich8_b = "Intel 82801H (ICH8) USB 2.0 controller USB2-B"; /* NEC */ #define PCI_EHCI_DEVICEID_NEC 0x00e01033 @@ -226,6 +230,10 @@ return (ehci_device_ich6); case PCI_EHCI_DEVICEID_ICH7: return (ehci_device_ich7); + case PCI_EHCI_DEVICEID_ICH8_A: + return (ehci_device_ich8_a); + case PCI_EHCI_DEVICEID_ICH8_B: + return (ehci_device_ich8_b); case PCI_EHCI_DEVICEID_NEC: return (ehci_device_nec); case PCI_EHCI_DEVICEID_NF2: --- src/sys/dev/usb/uhci_pci.c.orig 2007-09-21 20:35:43.000000000 -0400 +++ src/sys/dev/usb/uhci_pci.c 2007-09-21 20:54:57.000000000 -0400 @@ -139,6 +139,21 @@ #define PCI_UHCI_DEVICEID_ICH6_D 0x265b8086 static const char *uhci_device_ich6_d = "Intel 82801FB/FR/FW/FRW (ICH6) USB controller USB-D"; +#define PCI_UHCI_DEVICEID_ICH8_A 0x28308086 +static const char *uhci_device_ich8_a = "Intel 82801H (ICH8) USB controller USB-A"; + +#define PCI_UHCI_DEVICEID_ICH8_B 0x28318086 +static const char *uhci_device_ich8_b = "Intel 82801H (ICH8) USB controller USB-B"; + +#define PCI_UHCI_DEVICEID_ICH8_C 0x28328086 +static const char *uhci_device_ich8_c = "Intel 82801H (ICH8) USB controller USB-C"; + +#define PCI_UHCI_DEVICEID_ICH8_D 0x28348086 +static const char *uhci_device_ich8_d = "Intel 82801H (ICH8) USB controller USB-D"; + +#define PCI_UHCI_DEVICEID_ICH8_E 0x28358086 +static const char *uhci_device_ich8_e = "Intel 82801H (ICH8) USB controller USB-E"; + #define PCI_UHCI_DEVICEID_440MX 0x719a8086 static const char *uhci_device_440mx = "Intel 82443MX USB controller"; @@ -230,6 +245,16 @@ return (uhci_device_ich6_c); } else if (device_id == PCI_UHCI_DEVICEID_ICH6_D) { return (uhci_device_ich6_d); + } else if (device_id == PCI_UHCI_DEVICEID_ICH8_A) { + return (uhci_device_ich8_a); + } else if (device_id == PCI_UHCI_DEVICEID_ICH8_B) { + return (uhci_device_ich8_b); + } else if (device_id == PCI_UHCI_DEVICEID_ICH8_C) { + return (uhci_device_ich8_c); + } else if (device_id == PCI_UHCI_DEVICEID_ICH8_D) { + return (uhci_device_ich8_d); + } else if (device_id == PCI_UHCI_DEVICEID_ICH8_E) { + return (uhci_device_ich8_e); } else if (device_id == PCI_UHCI_DEVICEID_440MX) { return (uhci_device_440mx); } else if (device_id == PCI_UHCI_DEVICEID_460GX) { >Release-Note: >Audit-Trail: >Unformatted: From owner-freebsd-usb@FreeBSD.ORG Sun Sep 23 08:37:18 2007 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2272116A50A for ; Sun, 23 Sep 2007 08:37:18 +0000 (UTC) (envelope-from malus.x@gmail.com) Received: from wx-out-0506.google.com (wx-out-0506.google.com [66.249.82.236]) by mx1.freebsd.org (Postfix) with ESMTP id 1269013C459 for ; Sun, 23 Sep 2007 08:37:16 +0000 (UTC) (envelope-from malus.x@gmail.com) Received: by wx-out-0506.google.com with SMTP id i29so821324wxd for ; Sun, 23 Sep 2007 01:37:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:user-agent:mime-version:to:subject:references:in-reply-to:content-type:content-transfer-encoding; bh=7a3Jr+P2F1KJWA1PN2qitNAvKGzE1Y85Ertb7UY38X4=; b=jYKofFVLuJDwUfcHMc6VryUGkrR6RIFgL35+fH3HTz6idRKtXuD2sBbENAeKSlstTJU6r22frpkM7k1VQmfYvE+uLqGAN9ikBUCIeWd4fKDZBMlhV8i1aXnvnW+aKLsGDEZkyzsaMVGM9Fu24CWd6mwWrpEiesychJSBbvsb2e8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:user-agent:mime-version:to:subject:references:in-reply-to:content-type:content-transfer-encoding; b=O97Ir+CoKJsFqR0IWsu2VSOvvdXkcQJd7CItvxt25ccjF68US51SrRSOM6Oa09E4+JeSwJQoer6FC5y1IXXg+thkbpD71twsSxAIfgqYSjEdMne+vxoT6PoX5a5rkDX+Mkum4Iq2Fnz07rLNhV9BAkIr+3TLolSBmgOL7oBHY20= Received: by 10.90.66.9 with SMTP id o9mr4415600aga.1190535154720; Sun, 23 Sep 2007 01:12:34 -0700 (PDT) Received: from ?192.168.1.2? ( [69.249.2.14]) by mx.google.com with ESMTPS id 20sm3752928agb.2007.09.23.01.12.31 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sun, 23 Sep 2007 01:12:32 -0700 (PDT) Message-ID: <46F61FEE.8090108@gmail.com> Date: Sun, 23 Sep 2007 04:12:30 -0400 From: Dave Grochowski User-Agent: Thunderbird 2.0.0.6 (X11/20070803) MIME-Version: 1.0 To: FreeBSD-gnats-submit@FreeBSD.org, freebsd-usb@FreeBSD.org References: <200709230730.l8N7U92c059811@freefall.freebsd.org> In-Reply-To: <200709230730.l8N7U92c059811@freefall.freebsd.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Subject: Re: usb/116574: [patch] Add device ids for ICH8 USB chipsets X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Sep 2007 08:37:18 -0000 Well, I mean the ICH6 chipsets, but you get the idea. From owner-freebsd-usb@FreeBSD.ORG Sun Sep 23 08:40:12 2007 Return-Path: Delivered-To: freebsd-usb@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2B90B16A417 for ; Sun, 23 Sep 2007 08:40:12 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 00C3713C448 for ; Sun, 23 Sep 2007 08:40:12 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.1/8.14.1) with ESMTP id l8N8eBCq067141 for ; Sun, 23 Sep 2007 08:40:11 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.1/8.14.1/Submit) id l8N8eBoM067140; Sun, 23 Sep 2007 08:40:11 GMT (envelope-from gnats) Date: Sun, 23 Sep 2007 08:40:11 GMT Message-Id: <200709230840.l8N8eBoM067140@freefall.freebsd.org> To: freebsd-usb@FreeBSD.org From: Dave Grochowski Cc: Subject: Re: usb/116574: [patch] Add device ids for ICH8 USB chipsets X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Dave Grochowski List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Sep 2007 08:40:12 -0000 The following reply was made to PR usb/116574; it has been noted by GNATS. From: Dave Grochowski To: FreeBSD-gnats-submit@FreeBSD.org, freebsd-usb@FreeBSD.org Cc: Subject: Re: usb/116574: [patch] Add device ids for ICH8 USB chipsets Date: Sun, 23 Sep 2007 04:12:30 -0400 Well, I mean the ICH6 chipsets, but you get the idea. From owner-freebsd-usb@FreeBSD.ORG Mon Sep 24 06:03:44 2007 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DD21816A418 for ; Mon, 24 Sep 2007 06:03:44 +0000 (UTC) (envelope-from rea-fbsd@codelabs.ru) Received: from pobox.codelabs.ru (pobox.codelabs.ru [144.206.177.45]) by mx1.freebsd.org (Postfix) with ESMTP id 77B1F13C448 for ; Mon, 24 Sep 2007 06:03:43 +0000 (UTC) (envelope-from rea-fbsd@codelabs.ru) DomainKey-Signature: a=rsa-sha1; q=dns; c=simple; s=one; d=codelabs.ru; h=Received:Date:From:To:Cc:Message-ID:MIME-Version:Content-Type:Content-Disposition:Sender:X-Spam-Status:Subject; b=HI2r9qmPf63V9xCGQRKIVflkBPqVpBs9Ia0XlO4kJmJOXpaCTO/VZObzQAU+Bu81tcGflMb/fjOc+8YS98Nq+oiUWtdYxhjIHiGgF9QWLQvOrEhjdIrMKS2eTMKWRuQcW4nJakWcBIT3eyATrgsJC51w2H0G8LXW193DUU6Ppm0=; Received: from void.codelabs.ru (void.codelabs.ru [144.206.177.25]) by pobox.codelabs.ru with esmtpsa (TLSv1:AES256-SHA:256) id 1IZgkl-000Lzr-Jy; Mon, 24 Sep 2007 09:45:07 +0400 Date: Mon, 24 Sep 2007 09:45:03 +0400 From: Eygene Ryabinkin To: hselasky@c2i.net Message-ID: <20070924054503.GE99140@void.codelabs.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline Sender: rea-fbsd@codelabs.ru X-Spam-Status: No, score=-2.0 required=4.0 tests=ALL_TRUSTED,AWL,BAYES_50 Cc: freebsd-usb@freebsd.org Subject: [HPS USB stack] How to read USB events from userland? 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, 24 Sep 2007 06:03:44 -0000 Hans Petter, list, good day. Had not found the answer by googling, so I have to ask here. How one is supposed to get the access to the USB events from the userland code, provided one is running new usb stack? The reason I am asking is that the port sysutils/hal is trying to access the events via the /dev/usb interface, but it is not present in the new stack. So, the port even not compiles, because things like 'struct usb_event' and macros 'USB_EVENT_*' are non-existent. HAL is the dependency of the xorg-server these days, so I am a bit disappointed that portupgrade does not work for me (since hal port is broken) and am I eager to fix this, if it is possible. Thank you! -- Eygene From owner-freebsd-usb@FreeBSD.ORG Mon Sep 24 11:08:43 2007 Return-Path: Delivered-To: freebsd-usb@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5303116A505 for ; Mon, 24 Sep 2007 11:08:43 +0000 (UTC) (envelope-from owner-bugmaster@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 2838B13C47E for ; Mon, 24 Sep 2007 11:08:43 +0000 (UTC) (envelope-from owner-bugmaster@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.1/8.14.1) with ESMTP id l8OB8hoC064356 for ; Mon, 24 Sep 2007 11:08:43 GMT (envelope-from owner-bugmaster@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.1/8.14.1/Submit) id l8OB8fHF064352 for freebsd-usb@FreeBSD.org; Mon, 24 Sep 2007 11:08:41 GMT (envelope-from owner-bugmaster@FreeBSD.org) Date: Mon, 24 Sep 2007 11:08:41 GMT Message-Id: <200709241108.l8OB8fHF064352@freefall.freebsd.org> X-Authentication-Warning: freefall.freebsd.org: gnats set sender to owner-bugmaster@FreeBSD.org using -f From: FreeBSD bugmaster To: freebsd-usb@FreeBSD.org Cc: Subject: Current problem reports assigned to 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, 24 Sep 2007 11:08:43 -0000 Current FreeBSD problem reports Critical problems S Tracker Resp. Description -------------------------------------------------------------------------------- o usb/84750 usb [hang] 6-BETA2 reboot/shutdown with root_fs on externa o usb/91629 usb usbd_abort_pipe() may result in infinite loop 2 problems total. Serious problems S Tracker Resp. Description -------------------------------------------------------------------------------- o usb/46176 usb [panic] umass causes kernel panic if device removed be o i386/46371 usb USB controller cannot be initialized on IBM Netfinity o usb/57085 usb [umass] umass0 problems, with Sony Vio/USB memory stic o bin/57255 usb usbd and multi-function devices o usb/62088 usb [usb] Logitech Cordless/Optical Mouse not working o usb/63621 usb [usb] USB MemoryStick Reader stalls/crashes system o usb/69006 usb [patch] Apple Cinema Display hangs USB ports o usb/71155 usb [usb] misbehaving usb-printer hangs processes, causes o usb/73307 usb [panic] Kernel panics on USB disconnect o usb/74771 usb [umass] mounting write-protected umass device as read/ o usb/75705 usb [panic] da0 attach / Optio S4 (with backtrace) o usb/75797 usb 5.3-STABLE(2005 1/4) detect USB headset, But can not f o usb/76395 usb USB printer does not work, usbdevs says "addr 0 should o usb/77184 usb [panic] kernel panic on USB device disconnect o usb/77294 usb [ulpcom] [panic] ucom + ulpcom panic o usb/79269 usb USB ohci da0 plug/unplug causes crashes and lockups. o usb/79287 usb [uhci] UHCI hang after interrupt transfer o usb/79524 usb printing to Minolta PagePro 1[23]xxW via USB fails wit a usb/79656 usb [usb] RHSC interrupts lost o usb/79722 usb [usb] wrong alignments in ehci.h o usb/80040 usb [hang] Use of sound mixer causes system freeze with ua o usb/80361 usb [patch] mounting of usb-stick fails o usb/80829 usb possible panic when loading USB-modules o usb/80862 usb [patch] USB locking issues: missing some Giant calls o usb/82350 usb [usb] null pointer dereference in USB stack o usb/82520 usb Reboot when USL101 connected s usb/82569 usb [usb] USB mass storage plug/unplug causes system panic o usb/82660 usb [umass] [panic] EHCI: I/O stuck in state 'physrd'/pani o usb/83563 usb [panic] Page Fault while detaching Mpman Usb device o usb/83677 usb [usb] usb controller often not detected (Sun W2100z) o usb/83756 usb [ums] [patch] Microsoft Intellimouse Explorer 4.0A doe o usb/83977 usb [ucom] [panic] ucom1: open bulk out error (addr 2): IN o usb/84326 usb [umass] Panic trying to connect SCSI tape drive via US o usb/84336 usb [usb] [reboot] instant system reboot when unmounting a o usb/86031 usb need support usb nic rt2500 in my 5.4 STABLE o usb/86767 usb [usb] [patch] bogus "slice starts beyond end of the di o usb/88743 usb [hang] USB makes kernel hang at boot (regression in 6. o usb/88966 usb [modules] kldunload ucom.ko returns "Device busy" erro o usb/89003 usb LaCie Firewire drive not properly supported under 6.0 o usb/89954 usb [usb] USB Disk driver race condition? o usb/90700 usb [umass] [panic] Kernel panic on connect/mount/use umas o usb/91238 usb [umass] USB tape unit fails to write a second tape fil o usb/91283 usb booting very slow with usb devices connection (regress o usb/91538 usb [ulpt] [patch] Unable to print to EPSON CX3500 o usb/91906 usb [hang] FreeBSD hangs while booting with USB legacy sup o usb/92052 usb [unlpt] usbd causes defunct process with busy file-han o usb/92083 usb [ural] [panic] panic using WPA on ural NIC in 6.0-RELE o usb/92142 usb SET_ADDR_FAILED and SHORT_XFER errors from usb drivers o usb/92171 usb [panic] panic unplugging Vodafone Mobile Connect (UMTS o usb/93155 usb [ulpt] /dev/ulpt0: device busy, USB printer does not w o usb/93408 usb [mouse] hw.acpi.cpu.cx_lowest=C3 on AMD Turion causes o usb/93640 usb [irq] device ehci causes interrupt storm on this MSI a o usb/93828 usb [panic] ohci causes panic on boot (HP Pavillion d4100e o usb/94166 usb btx halted with a flashcard plugged o usb/94384 usb [panic] kernel panic with usb2 hardware o usb/94717 usb [ulpt] Reading from /dev/ulpt can break work of a UHCI o usb/94813 usb [umass] mounting write-protected umass device freezes o usb/94897 usb [panic] Kernel Panic when cleanly unmounting USB disk o usb/95131 usb [install] Boot/setup process does not accept key strok o usb/95348 usb [kbd] USB keyboard unplug causes noise on screen o usb/95562 usb [umass] Write Stress in USB Mass drive causes "vinvalb o usb/95636 usb [boot] 5 minute delay at boot when using VT6205 based o usb/96120 usb [mouse] USB mouse not always detected o usb/96224 usb [usb] mount_msdosfs cause page fault in syncer process o usb/96457 usb [panic] fatback on umass = reboot o usb/97286 usb [mouse] MS Wireless Intellimouse Explorer 2.0 doesn't o usb/99431 usb [kbd] FreeBSD on MSI 6566E (Intel 845E motherboards) d o usb/101096 usb [if_ural] [panic] USB WLAN occasionally causes kernel- o usb/101448 usb [ohci] FBSD 6.1-STABLE/AMD64 crashes under heavy USB/O o usb/101752 usb [umass] [panic] 6.1-RELEASE kernel panic on usb device o usb/102066 usb [ukbd] usb keyboard and multimedia keys don't work o usb/102096 usb [patch] /usr/sbin/usbd does not handle multiple device o usb/103025 usb [usb] wrong detection of USB device for FreeBSD 6.1 an o usb/104292 usb [hang] system lockup on forced umount of usb-storage d o usb/104830 usb [umass] system crashes when copying data to umass devi o usb/105186 usb USB 2.0/ehci on FreeBSD 6.2-PRE/AMD64 crashes box o usb/106615 usb [uftdi] uftdi module does not automatically load with o usb/106648 usb [hang] USB Floppy on D1950 10 min Hang on Insert w/o F o usb/106832 usb USB HP printer is not detected by kernel when ACPI ena o usb/107248 usb [umass] [patch] scsi_da.c quirk for Cowon iAUDIO X5 MP o usb/107446 usb [umass] umass problems (usb and fw disks) o usb/107827 usb [panic] ohci_add_done addr not found o usb/107848 usb [umass] cannot access Samsung flash disk o usb/107924 usb [patch] usbd(8) does not call detach o usb/108513 usb [umass] Creative MuVo TX FM fails in 6.2-RELEASE (regr o usb/109274 usb [usb] MCP55 USB Controller fails to attach in AMD64 Cu o usb/109397 usb [panic] on boot from USB flash o usb/110856 usb [ugen] [patch] interrupt in msgs are truncated when bu o usb/110988 usb [umass] [patch] Handling of quirk IGNORE_RESIDUE is um o usb/111753 usb [uhid] [panic] Replicable system panic involving UHID o usb/112568 usb USB mode may wrong when mounting Playstation Pro o usb/112631 usb [panic] Problem with SONY DSC-S80 camera o usb/112640 usb [usb] [hang] Kernel freezes when writing a file to an o usb/113478 usb [boot] FreeBSD could not start on Core2Duo notebook fr o usb/113629 usb [ukbd] Dropped USB keyboard events on Dell Latitude D6 o usb/113672 usb [ehci] [panic] Kernel panic with AEWIN CB6971 o usb/113851 usb [boot] Unable to boot install cd from USB-CDROM o usb/113977 usb [feature request] Need a way to set mode of USB disk's o usb/114310 usb [panic] USB hub attachment panics kernel during libusb o usb/114682 usb USB media-card reader unusable o kern/114780 usb [uplcom] [panic] Panics while stress testing the uplco o usb/115298 usb Turning off USB printer panics kernel o usb/116561 usb RELENG_6 umodem panic "trying to sleep while sleeping 103 problems total. Non-critical problems S Tracker Resp. Description -------------------------------------------------------------------------------- o conf/30929 usb [usb] [patch] use usbd to initialize USB ADSL modem o usb/40948 usb [usb] USB HP CDW8200 does not work o usb/48342 usb [PATCH] usbd dynamic device list. f usb/51958 usb [urio] [patch] update for urio driver o usb/52026 usb [usb] feature request: umass driver support for InSyst o usb/56095 usb [usb] [patch] QUIRK: Apacer Pen Drive fails to work o usb/59698 usb [kbd] [patch] Rework of ukbd HID to AT code translatio o usb/62257 usb [umass] card reader UCR-61S2B is only half-supported o usb/63837 usb [uhid] [patch] USB: hid_is_collection() only looks for o usb/65769 usb [usb] Call to tcflush(x, TCIFLUSH) stops input on usb- o usb/66547 usb [usb] Palm Tungsten T USB does not initialize correctl o usb/68232 usb [ugen] [patch] ugen(4) isochronous handling correction o usb/70523 usb [usb] [patch] umct sending/receiving wrong characters o usb/71280 usb [aue] aue0 device (linksys usb100tx) doesn't work in 1 o usb/71416 usb [ugen] Cryptoflex e-gate USB token (ugen0) detach is n o usb/71417 usb [ugen] Cryptoflex e-gate USB token (ugen0) communicati o usb/71455 usb [usb] Slow USB umass performance of 5.3 o usb/72380 usb [usb] USB does not work [dual Celeron Abit] o usb/72733 usb Kyocera 7135 Palm OS connection problem. o usb/73056 usb [usb] Sun Microsystems Type 6 USB mouse not working in o usb/74211 usb [umass] USB flash drive causes CAM status 0x4 on 4.10R f usb/74453 usb [patch] Q-lity CD-RW USB ECW-043 (ScanLogic SL11R chip o usb/74557 usb imation 500mb usb key can only be written halfway on f o usb/75764 usb [umass] [patch] "umass0: Phase Error" - no device for o usb/75800 usb [ucom] ucom1: init failed STALLED error in time of syn o usb/75928 usb Cytronix SmartMedia card (SMC) reader has problems whe o usb/76461 usb [umass] disklabel of umass(4)-CAM(4)-da(4) not used by o usb/76653 usb [umass] [patch] Problem with Asahi Optical usb device o usb/76732 usb Mouse problems with USB KVM Switch f usb/78984 usb [patch] Creative MUVO umass failure o usb/79723 usb [usb] prepare for high speed isochronous transfers o usb/80774 usb [patch] have "usbd_find_desc" in line with the other " o usb/80776 usb [udav] UDAV device driver shouldn't use usb_add_task o usb/80777 usb usb_rem_task() should wait for callback to complete? o usb/80854 usb suggestion for new iface-no-probe mechanism o usb/80935 usb [uvisor] [patch] uvisor.c is not work with CLIE TH55. f usb/81621 usb external hd hangs under load on ehci o usb/83863 usb [ugen] Communication problem between opensc/openct via o usb/85067 usb Cannot attach ScanJet 4300C to usb device o usb/85257 usb [boot] BTX boot loader fails on USB CDROM (HP DL145 Op o usb/86298 usb [mouse] Known good USB mouse won't work with correct s o usb/87224 usb Cannot mount USB Zip750 o usb/87648 usb [mouse] Logitech USB-optical mouse problem. o usb/88408 usb [axe] axe0 read PHY failed o usb/91546 usb [umodem] [patch] Nokia 6630 mobile phone does not work o usb/91811 usb Compact Flash in HP Photosmart 2610 return " Medium n o usb/91896 usb Serial Number of USB Memory Sticks is not passed throu o usb/92852 usb [mouse] [patch] Vertical scroll not working properly o o usb/93389 usb [umass] [patch] Digital Camera Pentax S60 don't work o usb/93872 usb [patch] SCSI quirk required for ELTA 8061 OL USB memor o usb/95037 usb [umass] USB disk not recognized on hot-plug. o usb/95173 usb [umass] [patch] cannot mount external usb harddisk VIA o usb/96381 usb [patch] add a quirk table entry for a flash ram usb st o usb/97175 usb [hang] USB cardreader hangs system o usb/97472 usb [patch] add support for Olympus C150,D390 o usb/98343 usb [boot] BBB reset failed errors with Creative Muvo MP3 o usb/99538 usb [kbd] while using USB keyboard default params of atkbd o usb/100746 usb [kbd] system does not boot due to USB keyboard problem o usb/101761 usb [patch] usb.h: increase maximal size of report descrip o usb/101775 usb [libusbhid] [patch] possible error in report descripto o usb/102678 usb [kbd] Dell PowerEdge DRAC5 USB Keyboard does not work o usb/102976 usb [panic] Casio Exilim Digital Camera cause panic o usb/103046 usb [ulpt] [patch] ulpt event driven I/O with select(2) an o usb/103289 usb USB 2.0 problems on AMD LX-800 CPU and CS-5536 chipset o usb/103418 usb [usb] [patch] usbhidctl: add ability to write output a o usb/103917 usb USB driver reports "Addr 0 should never happen" o usb/104290 usb [umass] [patch] quirk: TOSHIBA DVD-RAM drive (libretto o usb/104352 usb [ural] [patch] ural driver doesnt work o usb/104645 usb Rave C-201 MP3 player does not communicate o usb/105065 usb [sata] SATA - USB Bridge f usb/105361 usb [panic] Kernel panic during unmounting mass storage (C o usb/106041 usb FreeBSD does not recognise Mustek BearPaw 2400TA usb s o usb/106621 usb [axe] [patch] DLINK DUB-E100 support broken o usb/106861 usb [usbdevs] [patch]: usbdevs update: Add product ACER Ze o usb/107243 usb [patch] Apacer USB Flash Drive quirk o usb/107388 usb [PATCH] Add utoppy device from NetBSD o usb/107496 usb USB device problem on RELENG_6_2 (SHORT_XFER) (regress o usb/107665 usb [usb] [patch] uscanner support for epson stylus DX5050 o usb/107701 usb [usbd] usbd ignores "detach" o usb/107935 usb [uplcom] [panic] panic while accessing /dev/cuaU0 o usb/108056 usb [ohci] Mouse gets powered off during device probe when o usb/108344 usb [panic] kernel with atausb panics when unplugging USB o usb/108509 usb [hang] FreeBSD hang at startup after ehci0 detected (C o usb/110197 usb [umass] Sony PSP umass device does not detach from EHC s usb/110991 usb [patch] QUIRK: Super Top IDE DEVICE (depends on usb/11 o usb/112461 usb [ehci] ehci USB 2.0 doesn't work on nforce4 o usb/112463 usb problem with Samsung USB DVD writer, libscg and FreeBS o usb/112944 usb [patch] Bi-directional access to HP LaserJet 1010 prin o usb/113060 usb [usbdevs] [patch] Samsung printer not working in bidir o usb/113432 usb WARNING: attempt to net_add_domain(netgraph) after dom o conf/114013 usb [patch] WITHOUT_USB allow to compil a lot of USB stuff o usb/114068 usb [umass] [patch] Problems with connection of the umass p usb/114860 usb if_udav / ShanTou ST268 USB NIC o usb/114916 usb USB Maxtor drive (L300RO) requires quirk. o usb/114938 usb can't attach eli-devices on external hd o usb/115080 usb using a Hercules HWGUSB2-54-V2 wifi usb adapter o usb/115197 usb can not install from USB stick drive o usb/115400 usb [ehci] Problem with EHCI on ASUS M2N4-SLI o usb/115737 usb uplcom doesn't identify my Prolific 2303 any more o usb/115933 usb RATOC REX-USB60F (usb serial converter) is working o usb/115935 usb [patch] kernel counterproductively attaches to Cyber P o usb/116057 usb [patch] Update quirks for the MetaGeek Wi-Spy o usb/116282 usb Cannot print on USB HP LJ1018 or LJ1300 o usb/116574 usb [patch] Add device ids for ICH8 USB chipsets 104 problems total. From owner-freebsd-usb@FreeBSD.ORG Mon Sep 24 22:33:23 2007 Return-Path: Delivered-To: freebsd-usb@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E40F816A41B; Mon, 24 Sep 2007 22:33:23 +0000 (UTC) (envelope-from linimon@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id BAB1013C448; Mon, 24 Sep 2007 22:33:23 +0000 (UTC) (envelope-from linimon@FreeBSD.org) Received: from freefall.freebsd.org (linimon@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.1/8.14.1) with ESMTP id l8OMXNNu010591; Mon, 24 Sep 2007 22:33:23 GMT (envelope-from linimon@freefall.freebsd.org) Received: (from linimon@localhost) by freefall.freebsd.org (8.14.1/8.14.1/Submit) id l8OMXNCj010587; Mon, 24 Sep 2007 22:33:23 GMT (envelope-from linimon) Date: Mon, 24 Sep 2007 22:33:23 GMT Message-Id: <200709242233.l8OMXNCj010587@freefall.freebsd.org> To: webbegemot@yandex.ru, linimon@FreeBSD.org, freebsd-usb@FreeBSD.org From: linimon@FreeBSD.org Cc: Subject: Re: usb/86031: need support usb nic rt2500 in my 5.4 STABLE 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, 24 Sep 2007 22:33:24 -0000 Synopsis: need support usb nic rt2500 in my 5.4 STABLE State-Changed-From-To: open->closed State-Changed-By: linimon State-Changed-When: Mon Sep 24 22:32:28 UTC 2007 State-Changed-Why: Support was added for this in ural(4), which is available in 6.2. (5.4 is no longer supported, sorry.) http://www.freebsd.org/cgi/query-pr.cgi?pr=86031 From owner-freebsd-usb@FreeBSD.ORG Tue Sep 25 03:30:16 2007 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 01AFB16A418 for ; Tue, 25 Sep 2007 03:30:16 +0000 (UTC) (envelope-from on@cs.ait.ac.th) Received: from mail.cs.ait.ac.th (mail.cs.ait.ac.th [192.41.170.16]) by mx1.freebsd.org (Postfix) with ESMTP id 4544613C4A5 for ; Tue, 25 Sep 2007 03:30:14 +0000 (UTC) (envelope-from on@cs.ait.ac.th) Received: from banyan.cs.ait.ac.th (banyan.cs.ait.ac.th [192.41.170.5]) by mail.cs.ait.ac.th (8.13.1/8.12.11) with ESMTP id l8P2xHKq050105 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Tue, 25 Sep 2007 09:59:17 +0700 (ICT) Received: (from on@localhost) by banyan.cs.ait.ac.th (8.13.3/8.12.11) id l8P2xHOi091307; Tue, 25 Sep 2007 09:59:17 +0700 (ICT) Date: Tue, 25 Sep 2007 09:59:17 +0700 (ICT) Message-Id: <200709250259.l8P2xHOi091307@banyan.cs.ait.ac.th> From: Olivier Nicole To: freebsd-usb@freebsd.org X-Virus-Scanned: on CSIM by amavisd-milter (http://www.amavis.org/) Subject: Reading page count from USB printer 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, 25 Sep 2007 03:30:16 -0000 Hi, I posted this to freebsd-question list, but then I relized this list may be more appropriate. I have an HP2200 printer connected to a 6.2 box via USB. I would like to read the page count. I know the PCL sequence to do that, but I am unsure about the way to access the printer. The pinter shows up at /dev/ulpt0, I can redirect text to it for printing, using cat file.ps >/dev/ulpt0 But I do not manage to read the PCL response. How should I do? In Perl preferably. Best regards, Olivier How to do on a network printer: $ telnet 192.168.1.1 9100 Trying 192.168.1.1... Connected to 192.168.1.1. Escape character is '^]'. ^[%-12345X@PJL JOB NAME="PID=58584 USER=on HOST=host" @PJL USTATUS JOB=ON @PJL USTATUS JOB START NAME="PID=58584 USER=on HOST=host" coucou ^[%-12345X@PJL EOJ NAME="PID=58584 USER=on HOST=host" ^[%-12345X @PJL USTATUS JOB END NAME="PID=58584 USER=on HOST=host" PAGES=2 ^] telnet> q Connection closed. Lines starting with spaces are replies sent by the printer. How I would like to do on USB printer: $ cat > /dev/ulpt0 ^[%-12345X@PJL JOB NAME="PID=58584 USER=on HOST=host" @PJL USTATUS JOB=ON coucou ^[%-12345X@PJL EOJ NAME="PID=58584 USER=on HOST=host" ^[%-12345X and here I need to interrupt (ctrl-C) after waiting for LONG time. The text "coucou" get printed OK, but I do not see the reply sent by the printer. From owner-freebsd-usb@FreeBSD.ORG Tue Sep 25 18:20:06 2007 Return-Path: Delivered-To: freebsd-usb@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CD69E16A418 for ; Tue, 25 Sep 2007 18:20:06 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 9E8DE13C455 for ; Tue, 25 Sep 2007 18:20:06 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.1/8.14.1) with ESMTP id l8PIK6Hj084483 for ; Tue, 25 Sep 2007 18:20:06 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.1/8.14.1/Submit) id l8PIK6Um084479; Tue, 25 Sep 2007 18:20:06 GMT (envelope-from gnats) Date: Tue, 25 Sep 2007 18:20:06 GMT Message-Id: <200709251820.l8PIK6Um084479@freefall.freebsd.org> To: freebsd-usb@FreeBSD.org From: Eugene Grosbein Cc: Subject: Re: usb/91546: [umodem] [patch] Nokia 6630 mobile phone does not work X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Eugene Grosbein List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Sep 2007 18:20:06 -0000 The following reply was made to PR usb/91546; it has been noted by GNATS. From: Eugene Grosbein To: bug-followup@freebsd.org Cc: Alexey Illarionov , usb@freebsd.org Subject: Re: usb/91546: [umodem] [patch] Nokia 6630 mobile phone does not work Date: Wed, 26 Sep 2007 02:10:33 +0800 Hi! I've ported the code committed to NetBSD's umodem driver after http://www.netbsd.org/cgi-bin/query-pr-single.pl?number=29754 The patch for RELENG_6 follows. Sadly, it still does not work for my Nokia E50, it says (debug turned on): umodem_get_desc: no CM desc umodem_get_desc: no CM desc ucom0: Nokia Nokia E50, rev 2.00/1.00, addr 2, iclass 2/2 umodem_get_desc: no CM desc ucom0: data interface 1, has no CM over data, has break ucom0: Could not find data bulk in device_attach: ucom0 attach returned 6 So, my phone has UDESCSUB_CDC_UNION but driver still does not like it. Did I something wrong while porting or it's just phone's problem? Btw, it works via Bluetooth and rfcomm_pppd just fine, but I'd like to see FreeBSD supporting it over USB too :-) Eugene Grosbein From owner-freebsd-usb@FreeBSD.ORG Tue Sep 25 18:20:11 2007 Return-Path: Delivered-To: freebsd-usb@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 875DB16A41A for ; Tue, 25 Sep 2007 18:20:11 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 4BB9A13C457 for ; Tue, 25 Sep 2007 18:20:11 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.1/8.14.1) with ESMTP id l8PIKBCP084533 for ; Tue, 25 Sep 2007 18:20:11 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.1/8.14.1/Submit) id l8PIKBiC084532; Tue, 25 Sep 2007 18:20:11 GMT (envelope-from gnats) Date: Tue, 25 Sep 2007 18:20:11 GMT Message-Id: <200709251820.l8PIKBiC084532@freefall.freebsd.org> To: freebsd-usb@FreeBSD.org From: Eugene Grosbein Cc: Subject: Re: usb/91546: [umodem] [patch] Nokia 6630 mobile phone does not work X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Eugene Grosbein List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Sep 2007 18:20:11 -0000 The following reply was made to PR usb/91546; it has been noted by GNATS. From: Eugene Grosbein To: bug-followup@freebsd.org Cc: Alexey Illarionov , usb@freebsd.org Subject: Re: usb/91546: [umodem] [patch] Nokia 6630 mobile phone does not work Date: Wed, 26 Sep 2007 02:11:26 +0800 Hi! Oops, forgot to attach the patch. --- sys/dev/usb/umodem.c.orig 2006-08-05 22:21:42.000000000 +0800 +++ sys/dev/usb/umodem.c 2007-09-26 01:56:35.000000000 +0800 @@ -178,7 +178,7 @@ Static usbd_status umodem_set_line_coding(struct umodem_softc *sc, usb_cdc_line_state_t *state); -Static void umodem_get_caps(usbd_device_handle, int *, int *); +Static int umodem_get_caps(usbd_device_handle, int *, int *); Static void umodem_get_status(void *, int portno, u_char *lsr, u_char *msr); Static void umodem_set(void *, int, int, int); @@ -261,10 +261,7 @@ if (ret == UMATCH_NONE) return (ret); - umodem_get_caps(uaa->device, &cm, &acm); - if (!(cm & USB_CDC_CM_DOES_CM) || - !(cm & USB_CDC_CM_OVER_DATA) || - !(acm & USB_CDC_ACM_HAS_LINE)) + if (umodem_get_caps(uaa->device, &cm, &acm) == -1) return (UMATCH_NONE); return ret; @@ -276,7 +273,6 @@ usbd_device_handle dev = uaa->device; usb_interface_descriptor_t *id; usb_endpoint_descriptor_t *ed; - usb_cdc_cm_descriptor_t *cmd; char *devinfo = NULL; const char *devname; usbd_status err; @@ -304,15 +300,15 @@ id->bInterfaceClass, id->bInterfaceSubClass); sc->sc_ctl_iface_no = id->bInterfaceNumber; - umodem_get_caps(dev, &sc->sc_cm_cap, &sc->sc_acm_cap); - /* Get the data interface no. */ - cmd = umodem_get_desc(dev, UDESC_CS_INTERFACE, UDESCSUB_CDC_CM); - if (cmd == NULL) { - printf("%s: no CM descriptor\n", devname); + sc->sc_data_iface_no = data_ifcno = + umodem_get_caps(dev, &sc->sc_cm_cap, &sc->sc_acm_cap); + + if (data_ifcno == -1) { + printf("%s: no pointer to data interface\n", + USBDEVNAME(sc->sc_dev)); goto bad; } - sc->sc_data_iface_no = data_ifcno = cmd->bDataInterface; printf("%s: data interface %d, has %sCM over data, has %sbreak\n", devname, data_ifcno, @@ -550,27 +546,35 @@ ucom_status_change(&sc->sc_ucom); } -void +int umodem_get_caps(usbd_device_handle dev, int *cm, int *acm) { usb_cdc_cm_descriptor_t *cmd; usb_cdc_acm_descriptor_t *cad; + usb_cdc_union_descriptor_t *cud; *cm = *acm = 0; cmd = umodem_get_desc(dev, UDESC_CS_INTERFACE, UDESCSUB_CDC_CM); if (cmd == NULL) { DPRINTF(("umodem_get_desc: no CM desc\n")); - return; + } else { + *cm = cmd->bmCapabilities; } - *cm = cmd->bmCapabilities; cad = umodem_get_desc(dev, UDESC_CS_INTERFACE, UDESCSUB_CDC_ACM); if (cad == NULL) { DPRINTF(("umodem_get_desc: no ACM desc\n")); - return; + } else { + *acm = cad->bmCapabilities; + } + + cud = umodem_get_desc(dev, UDESC_CS_INTERFACE, UDESCSUB_CDC_UNION); + if (cud == NULL) { + DPRINTF(("umodem_get_desc: no UNION desc\n")); } - *acm = cad->bmCapabilities; + + return cmd ? cmd->bDataInterface : cud ? cud->bSlaveInterface[0] : -1; } void From owner-freebsd-usb@FreeBSD.ORG Tue Sep 25 18:22:36 2007 Return-Path: Delivered-To: usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F106516A41A for ; Tue, 25 Sep 2007 18:22:36 +0000 (UTC) (envelope-from eugen@grosbein.pp.ru) Received: from grosbein.pp.ru (grgw.svzserv.kemerovo.su [213.184.64.166]) by mx1.freebsd.org (Postfix) with ESMTP id 3928613C494 for ; Tue, 25 Sep 2007 18:22:35 +0000 (UTC) (envelope-from eugen@grosbein.pp.ru) Received: from grosbein.pp.ru (localhost [127.0.0.1]) by grosbein.pp.ru (8.14.1/8.14.1) with ESMTP id l8PIAYhH001889; Wed, 26 Sep 2007 02:10:34 +0800 (KRAST) (envelope-from eugen@grosbein.pp.ru) Received: (from eugen@localhost) by grosbein.pp.ru (8.14.1/8.14.1/Submit) id l8PIAXZE001888; Wed, 26 Sep 2007 02:10:33 +0800 (KRAST) (envelope-from eugen) Date: Wed, 26 Sep 2007 02:10:33 +0800 From: Eugene Grosbein To: bug-followup@freebsd.org Message-ID: <20070925181033.GA1837@grosbein.pp.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.2.2i Cc: usb@freebsd.org Subject: Re: usb/91546: [umodem] [patch] Nokia 6630 mobile phone does not 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, 25 Sep 2007 18:22:37 -0000 Hi! I've ported the code committed to NetBSD's umodem driver after http://www.netbsd.org/cgi-bin/query-pr-single.pl?number=29754 The patch for RELENG_6 follows. Sadly, it still does not work for my Nokia E50, it says (debug turned on): umodem_get_desc: no CM desc umodem_get_desc: no CM desc ucom0: Nokia Nokia E50, rev 2.00/1.00, addr 2, iclass 2/2 umodem_get_desc: no CM desc ucom0: data interface 1, has no CM over data, has break ucom0: Could not find data bulk in device_attach: ucom0 attach returned 6 So, my phone has UDESCSUB_CDC_UNION but driver still does not like it. Did I something wrong while porting or it's just phone's problem? Btw, it works via Bluetooth and rfcomm_pppd just fine, but I'd like to see FreeBSD supporting it over USB too :-) Eugene Grosbein From owner-freebsd-usb@FreeBSD.ORG Tue Sep 25 18:22:38 2007 Return-Path: Delivered-To: usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9715916A417 for ; Tue, 25 Sep 2007 18:22:38 +0000 (UTC) (envelope-from eugen@grosbein.pp.ru) Received: from grosbein.pp.ru (grgw.svzserv.kemerovo.su [213.184.64.166]) by mx1.freebsd.org (Postfix) with ESMTP id BB78D13C4A7 for ; Tue, 25 Sep 2007 18:22:37 +0000 (UTC) (envelope-from eugen@grosbein.pp.ru) Received: from grosbein.pp.ru (localhost [127.0.0.1]) by grosbein.pp.ru (8.14.1/8.14.1) with ESMTP id l8PIBQaB001939; Wed, 26 Sep 2007 02:11:26 +0800 (KRAST) (envelope-from eugen@grosbein.pp.ru) Received: (from eugen@localhost) by grosbein.pp.ru (8.14.1/8.14.1/Submit) id l8PIBQZu001938; Wed, 26 Sep 2007 02:11:26 +0800 (KRAST) (envelope-from eugen) Date: Wed, 26 Sep 2007 02:11:26 +0800 From: Eugene Grosbein To: bug-followup@freebsd.org Message-ID: <20070925181126.GA1900@grosbein.pp.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.2.2i Cc: usb@freebsd.org Subject: Re: usb/91546: [umodem] [patch] Nokia 6630 mobile phone does not 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, 25 Sep 2007 18:22:38 -0000 Hi! Oops, forgot to attach the patch. --- sys/dev/usb/umodem.c.orig 2006-08-05 22:21:42.000000000 +0800 +++ sys/dev/usb/umodem.c 2007-09-26 01:56:35.000000000 +0800 @@ -178,7 +178,7 @@ Static usbd_status umodem_set_line_coding(struct umodem_softc *sc, usb_cdc_line_state_t *state); -Static void umodem_get_caps(usbd_device_handle, int *, int *); +Static int umodem_get_caps(usbd_device_handle, int *, int *); Static void umodem_get_status(void *, int portno, u_char *lsr, u_char *msr); Static void umodem_set(void *, int, int, int); @@ -261,10 +261,7 @@ if (ret == UMATCH_NONE) return (ret); - umodem_get_caps(uaa->device, &cm, &acm); - if (!(cm & USB_CDC_CM_DOES_CM) || - !(cm & USB_CDC_CM_OVER_DATA) || - !(acm & USB_CDC_ACM_HAS_LINE)) + if (umodem_get_caps(uaa->device, &cm, &acm) == -1) return (UMATCH_NONE); return ret; @@ -276,7 +273,6 @@ usbd_device_handle dev = uaa->device; usb_interface_descriptor_t *id; usb_endpoint_descriptor_t *ed; - usb_cdc_cm_descriptor_t *cmd; char *devinfo = NULL; const char *devname; usbd_status err; @@ -304,15 +300,15 @@ id->bInterfaceClass, id->bInterfaceSubClass); sc->sc_ctl_iface_no = id->bInterfaceNumber; - umodem_get_caps(dev, &sc->sc_cm_cap, &sc->sc_acm_cap); - /* Get the data interface no. */ - cmd = umodem_get_desc(dev, UDESC_CS_INTERFACE, UDESCSUB_CDC_CM); - if (cmd == NULL) { - printf("%s: no CM descriptor\n", devname); + sc->sc_data_iface_no = data_ifcno = + umodem_get_caps(dev, &sc->sc_cm_cap, &sc->sc_acm_cap); + + if (data_ifcno == -1) { + printf("%s: no pointer to data interface\n", + USBDEVNAME(sc->sc_dev)); goto bad; } - sc->sc_data_iface_no = data_ifcno = cmd->bDataInterface; printf("%s: data interface %d, has %sCM over data, has %sbreak\n", devname, data_ifcno, @@ -550,27 +546,35 @@ ucom_status_change(&sc->sc_ucom); } -void +int umodem_get_caps(usbd_device_handle dev, int *cm, int *acm) { usb_cdc_cm_descriptor_t *cmd; usb_cdc_acm_descriptor_t *cad; + usb_cdc_union_descriptor_t *cud; *cm = *acm = 0; cmd = umodem_get_desc(dev, UDESC_CS_INTERFACE, UDESCSUB_CDC_CM); if (cmd == NULL) { DPRINTF(("umodem_get_desc: no CM desc\n")); - return; + } else { + *cm = cmd->bmCapabilities; } - *cm = cmd->bmCapabilities; cad = umodem_get_desc(dev, UDESC_CS_INTERFACE, UDESCSUB_CDC_ACM); if (cad == NULL) { DPRINTF(("umodem_get_desc: no ACM desc\n")); - return; + } else { + *acm = cad->bmCapabilities; + } + + cud = umodem_get_desc(dev, UDESC_CS_INTERFACE, UDESCSUB_CDC_UNION); + if (cud == NULL) { + DPRINTF(("umodem_get_desc: no UNION desc\n")); } - *acm = cad->bmCapabilities; + + return cmd ? cmd->bDataInterface : cud ? cud->bSlaveInterface[0] : -1; } void From owner-freebsd-usb@FreeBSD.ORG Tue Sep 25 18:54:02 2007 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7427C16A468 for ; Tue, 25 Sep 2007 18:54:02 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id F25AE13C458 for ; Tue, 25 Sep 2007 18:54:01 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.1/8.13.4) with ESMTP id l8PIpOYq052790; Tue, 25 Sep 2007 12:51:24 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Tue, 25 Sep 2007 12:51:24 -0600 (MDT) Message-Id: <20070925.125124.74698669.imp@bsdimp.com> To: eugen@kuzbass.ru From: Warner Losh In-Reply-To: <200709251820.l8PIK6Um084479@freefall.freebsd.org> References: <200709251820.l8PIK6Um084479@freefall.freebsd.org> 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]); Tue, 25 Sep 2007 12:51:24 -0600 (MDT) Cc: freebsd-usb@freebsd.org Subject: Re: usb/91546: [umodem] [patch] Nokia 6630 mobile phone does not 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, 25 Sep 2007 18:54:02 -0000 Have you tried porting -current's umodem driver back to stable? I think it would work a lot better... Warner From owner-freebsd-usb@FreeBSD.ORG Tue Sep 25 23:31:38 2007 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 07AA016A46C for ; Tue, 25 Sep 2007 23:31:38 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe08.swip.net [212.247.154.225]) by mx1.freebsd.org (Postfix) with ESMTP id 3295013C461 for ; Tue, 25 Sep 2007 23:31:36 +0000 (UTC) (envelope-from hselasky@c2i.net) X-Cloudmark-Score: 0.000000 [] Received: from [85.19.218.45] (account mc467741@c2i.net [85.19.218.45] verified) by mailfe08.swip.net (CommuniGate Pro SMTP 5.1.10) with ESMTPA id 624282714; Wed, 26 Sep 2007 01:31:35 +0200 From: Hans Petter Selasky To: freebsd-scsi@freebsd.org, freebsd-usb@freebsd.org, freebsd-net@freebsd.org Date: Wed, 26 Sep 2007 01:31:47 +0200 User-Agent: KMail/1.9.7 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200709260131.49156.hselasky@c2i.net> Cc: Subject: Request for feedback on common data backstore in the kernel 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, 25 Sep 2007 23:31:38 -0000 Hi, Please keep me CC'ed, hence I'm not on all these lists. In the kernel we currently have two different data backstores: struct mbuf and struct buf These two backstores serve two different device types. "mbufs" are for network devices and "buf" is for disk devices. Problem: The current backstores are loaded into DMA by using the BUS-DMA framework. This appears not to be too fast according to Kip Macy. See: http://perforce.freebsd.org/chv.cgi?CH=126455 Some ideas I have: When a buffer is out out of range for a hardware device and a data-copy is needed I want to simply copy that data in smaller parts to/from a pre-allocated bounce buffer. I want to avoid allocating this buffer when "bus_dmamap_load()" is called. For pre-allocated USB DMA memory I currently have: struct usbd_page struct usbd_page { void *buffer; // virtual address bus_size_t physaddr; // as seen by one of my devices bus_dma_tag_t tag; bus_dmamap_t map; uint32_t length; }; Mostly only "length == PAGE_SIZE" is allowed. When USB allocates DMA memory it allocates the same size all the way and that is PAGE_SIZE bytes. If two different PCI controllers want to communicate directly passing DMA buffers, technically one would need to translate the physical address for device 1 to the physical address as seen by device 2. If this translation table is sorted, the search will be rather quick. Another approach is to limit the number of translations: #define N_MAX_PCI_TRANSLATE 4 struct usbd_page { void *buffer; // virtual address bus_size_t physaddr[N_MAX_PCI_TRANSLATE]; bus_dma_tag_t tag; bus_dmamap_t map; uint32_t length; }; Then PCI device 1 on bus X can use physaddr[0] and PCI device 2 on bus Y can use physaddr[1]. If the physaddr[] is equal to some magic then the DMA buffer is not reachable and must be bounced. Then when two PCI devices talk together all they need to pass is a structure like this: struct usbd_page_cache { struct usbd_page *page_start; uint32_t page_offset_buf; uint32_t page_offset_end; }; And the required DMA address is looked up in some nanos. Has someone been thinking about this topic before ? --HPS From owner-freebsd-usb@FreeBSD.ORG Wed Sep 26 04:52:21 2007 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2FA3B16A46C for ; Wed, 26 Sep 2007 04:52:21 +0000 (UTC) (envelope-from eugen@kuzbass.ru) Received: from www.svzserv.kemerovo.su (www.svzserv.kemerovo.su [213.184.65.80]) by mx1.freebsd.org (Postfix) with ESMTP id 7063913C481 for ; Wed, 26 Sep 2007 04:52:20 +0000 (UTC) (envelope-from eugen@kuzbass.ru) Received: from kuzbass.ru (kost [213.184.65.82]) by www.svzserv.kemerovo.su (8.13.8/8.13.8) with ESMTP id l8Q4E0YG043743; Wed, 26 Sep 2007 12:14:01 +0800 (KRAST) (envelope-from eugen@kuzbass.ru) Message-ID: <46F9DC89.598B7C64@kuzbass.ru> Date: Wed, 26 Sep 2007 12:14:01 +0800 From: Eugene Grosbein Organization: SVZServ X-Mailer: Mozilla 4.8 [en] (Windows NT 5.0; U) X-Accept-Language: ru,en MIME-Version: 1.0 To: Warner Losh References: <200709251820.l8PIK6Um084479@freefall.freebsd.org> <20070925.125124.74698669.imp@bsdimp.com> Content-Type: text/plain; charset=koi8-r Content-Transfer-Encoding: 7bit Cc: freebsd-usb@freebsd.org Subject: Re: usb/91546: [umodem] [patch] Nokia 6630 mobile phone does notwork X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Sep 2007 04:52:21 -0000 Warner Losh wrote: > > Have you tried porting -current's umodem driver back to stable? I > think it would work a lot better... I've glanced at CURRENT's umodem and there is no that code allowing to work with devices without CM descriptor using UNION instead... NetBSD has that code since 2005. Do you think CURRENT's umodem would be useble in this case? Eugene From owner-freebsd-usb@FreeBSD.ORG Wed Sep 26 05:12:17 2007 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4D56416A418 for ; Wed, 26 Sep 2007 05:12:17 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id CA50C13C448 for ; Wed, 26 Sep 2007 05:12:11 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.1/8.13.4) with ESMTP id l8Q5AhZi056876; Tue, 25 Sep 2007 23:10:43 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Tue, 25 Sep 2007 23:10:43 -0600 (MDT) Message-Id: <20070925.231043.-345497328.imp@bsdimp.com> To: eugen@kuzbass.ru From: "M. Warner Losh" In-Reply-To: <46F9DC89.598B7C64@kuzbass.ru> References: <200709251820.l8PIK6Um084479@freefall.freebsd.org> <20070925.125124.74698669.imp@bsdimp.com> <46F9DC89.598B7C64@kuzbass.ru> X-Mailer: Mew version 5.2 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-2.0 (harmony.bsdimp.com [127.0.0.1]); Tue, 25 Sep 2007 23:10:44 -0600 (MDT) Cc: freebsd-usb@freebsd.org Subject: Re: usb/91546: [umodem] [patch] Nokia 6630 mobile phone does notwork X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Sep 2007 05:12:17 -0000 In message: <46F9DC89.598B7C64@kuzbass.ru> Eugene Grosbein writes: : Warner Losh wrote: : > : > Have you tried porting -current's umodem driver back to stable? I : > think it would work a lot better... : : I've glanced at CURRENT's umodem and there is no that code : allowing to work with devices without CM descriptor using UNION instead... : NetBSD has that code since 2005. : : Do you think CURRENT's umodem would be useble in this case? My modem doesn't have a CM descriptor and I quirked it before. I removed the quirk code and it works now without it. The Union code from NetBSD didn't look relevant at all when you chased down all the things that it actually did, but maybe I missed something. Given that umodem from current should just work on -stable w/o any changes (you may need ucom too, which does need one or two changes), it would be worth a shot at trying it. Warner From owner-freebsd-usb@FreeBSD.ORG Wed Sep 26 05:18:11 2007 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8E4D816A417 for ; Wed, 26 Sep 2007 05:18:11 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 4B9EC13C46A for ; Wed, 26 Sep 2007 05:18:11 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.1/8.13.4) with ESMTP id l8Q5HJuP056929; Tue, 25 Sep 2007 23:17:19 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Tue, 25 Sep 2007 23:17:18 -0600 (MDT) Message-Id: <20070925.231718.-423889040.imp@bsdimp.com> To: eugen@kuzbass.ru From: "M. Warner Losh" In-Reply-To: <20070925.231043.-345497328.imp@bsdimp.com> References: <20070925.125124.74698669.imp@bsdimp.com> <46F9DC89.598B7C64@kuzbass.ru> <20070925.231043.-345497328.imp@bsdimp.com> X-Mailer: Mew version 5.2 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-2.0 (harmony.bsdimp.com [127.0.0.1]); Tue, 25 Sep 2007 23:17:19 -0600 (MDT) Cc: freebsd-usb@freebsd.org Subject: Re: usb/91546: [umodem] [patch] Nokia 6630 mobile phone does notwork X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Sep 2007 05:18:11 -0000 In message: <20070925.231043.-345497328.imp@bsdimp.com> "M. Warner Losh" writes: : In message: <46F9DC89.598B7C64@kuzbass.ru> : Eugene Grosbein writes: : : Warner Losh wrote: : : > : : > Have you tried porting -current's umodem driver back to stable? I : : > think it would work a lot better... : : : : I've glanced at CURRENT's umodem and there is no that code : : allowing to work with devices without CM descriptor using UNION instead... : : NetBSD has that code since 2005. : : : : Do you think CURRENT's umodem would be useble in this case? : : My modem doesn't have a CM descriptor and I quirked it before. I : removed the quirk code and it works now without it. The Union code : from NetBSD didn't look relevant at all when you chased down all the : things that it actually did, but maybe I missed something. : : Given that umodem from current should just work on -stable w/o any : changes (you may need ucom too, which does need one or two changes), : it would be worth a shot at trying it. If that doesn't work, btw, I'll port the union code over. Warner From owner-freebsd-usb@FreeBSD.ORG Wed Sep 26 11:40:08 2007 Return-Path: Delivered-To: freebsd-usb@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E620F16A41B for ; Wed, 26 Sep 2007 11:40:08 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id DEE7413C4A8 for ; Wed, 26 Sep 2007 11:40:08 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.1/8.14.1) with ESMTP id l8QBe8ki047056 for ; Wed, 26 Sep 2007 11:40:08 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.1/8.14.1/Submit) id l8QBe8bs047055; Wed, 26 Sep 2007 11:40:08 GMT (envelope-from gnats) Date: Wed, 26 Sep 2007 11:40:08 GMT Message-Id: <200709261140.l8QBe8bs047055@freefall.freebsd.org> To: freebsd-usb@FreeBSD.org From: Eugene Grosbein Cc: Subject: Re: usb/91546: [umodem] [patch] Nokia 6630 mobile phone does not work X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Eugene Grosbein List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Sep 2007 11:40:09 -0000 The following reply was made to PR usb/91546; it has been noted by GNATS. From: Eugene Grosbein To: bug-followup@freebsd.org Cc: "M. Warner Losh" , eugen@kuzbass.ru Subject: Re: usb/91546: [umodem] [patch] Nokia 6630 mobile phone does not work Date: Wed, 26 Sep 2007 19:32:01 +0800 On Tue, 25 Sep 2007, Warner Losh wrote: > My modem doesn't have a CM descriptor and I quirked it before. I > moved the quirk code and it works now without it. The Union code > from NetBSD didn't look relevant at all when you chased down all the > things that it actually did, but maybe I missed something. > Given that umodem from current should just work on -stable w/o any > changes (you may need ucom too, which does need one or two changes), > it would be worth a shot at trying it. I've taken umodem.c,v 1.71 (no changes) and ucom.c,v 1.64 (one-line change for ttycreate() call) from CURRENT, rebuild kernel modules and tried - no luck, it's attached as ugen: umodem_get_desc: no CM desc ugen2: Nokia Nokia E50, rev 2.00/1.00, addr 2 Eugene Grosbein From owner-freebsd-usb@FreeBSD.ORG Wed Sep 26 05:09:24 2007 Return-Path: Delivered-To: freebsd-usb@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0E17016A468; Wed, 26 Sep 2007 05:09:24 +0000 (UTC) (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 A9FC813C48A; Wed, 26 Sep 2007 05:09:23 +0000 (UTC) (envelope-from jmg@hydrogen.funkthat.com) Received: from hydrogen.funkthat.com (gkvdzsioz46jvzap@localhost.funkthat.com [127.0.0.1]) by hydrogen.funkthat.com (8.13.6/8.13.3) with ESMTP id l8Q4s261083635; Tue, 25 Sep 2007 21:54:02 -0700 (PDT) (envelope-from jmg@hydrogen.funkthat.com) Received: (from jmg@localhost) by hydrogen.funkthat.com (8.13.6/8.13.3/Submit) id l8Q4s2hA083634; Tue, 25 Sep 2007 21:54:02 -0700 (PDT) (envelope-from jmg) Date: Tue, 25 Sep 2007 21:54:01 -0700 From: John-Mark Gurney To: Hans Petter Selasky Message-ID: <20070926045401.GB47467@funkthat.com> Mail-Followup-To: Hans Petter Selasky , freebsd-arch@FreeBSD.org References: <200709260131.49156.hselasky@c2i.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200709260131.49156.hselasky@c2i.net> User-Agent: Mutt/1.4.2.1i X-Operating-System: FreeBSD 5.4-RELEASE-p6 i386 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 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-3.0 (hydrogen.funkthat.com [127.0.0.1]); Tue, 25 Sep 2007 21:54:03 -0700 (PDT) X-Mailman-Approved-At: Wed, 26 Sep 2007 13:15:50 +0000 Cc: freebsd-arch@FreeBSD.org Subject: Re: Request for feedback on common data backstore in the kernel 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: Wed, 26 Sep 2007 05:09:24 -0000 Hans Petter Selasky wrote this message on Wed, Sep 26, 2007 at 01:31 +0200: > Please keep me CC'ed, hence I'm not on all these lists. > > In the kernel we currently have two different data backstores: > > struct mbuf > > and > > struct buf > > These two backstores serve two different device types. "mbufs" are for network > devices and "buf" is for disk devices. I don't see how this relates to the rest of your email, but even though they are used similarly, their normal size is quite different... mbufs normally contain 64-256 byte packets, w/ large file transfers attaching a 2k cluster (which comes from a different pool than the core mbuf) to the mbuf... buf is usually something like 16k-64k... > Problem: > > The current backstores are loaded into DMA by using the BUS-DMA framework. > This appears not to be too fast according to Kip Macy. See: > > http://perforce.freebsd.org/chv.cgi?CH=126455 This only works on x86/amd64 because of the direct mapped memory that they support.. This would complete break arches like sparc64 that require an iommu to translate the addresses... and also doesn't address keeping the buffers in sync on arches like arm... sparc64 may have many gigs of memory, but only a 2GB window for mapping main memory... It sounds like the x86/amd64 bus_dma implementation needs to be improved to run more quickly... As w/ all things, you can hardcode stuff, but then you loose portability... > Some ideas I have: > > When a buffer is out out of range for a hardware device and a data-copy is > needed I want to simply copy that data in smaller parts to/from a > pre-allocated bounce buffer. I want to avoid allocating this buffer > when "bus_dmamap_load()" is called. > > For pre-allocated USB DMA memory I currently have: > > struct usbd_page > > struct usbd_page { > void *buffer; // virtual address > bus_size_t physaddr; // as seen by one of my devices > bus_dma_tag_t tag; > bus_dmamap_t map; > uint32_t length; > }; > > Mostly only "length == PAGE_SIZE" is allowed. When USB allocates DMA memory it > allocates the same size all the way and that is PAGE_SIZE bytes. I could see attaching preallocated memory to a tag, and having maps that attempt to use this memory, but that's something else... > If two different PCI controllers want to communicate directly passing DMA > buffers, technically one would need to translate the physical address for > device 1 to the physical address as seen by device 2. If this translation > table is sorted, the search will be rather quick. Another approach is to > limit the number of translations: > > #define N_MAX_PCI_TRANSLATE 4 > > struct usbd_page { > void *buffer; // virtual address > bus_size_t physaddr[N_MAX_PCI_TRANSLATE]; > bus_dma_tag_t tag; > bus_dmamap_t map; > uint32_t length; > }; > > Then PCI device 1 on bus X can use physaddr[0] and PCI device 2 on bus Y can > use physaddr[1]. If the physaddr[] is equal to some magic then the DMA buffer > is not reachable and must be bounced. > > Then when two PCI devices talk together all they need to pass is a structure > like this: > > struct usbd_page_cache { > struct usbd_page *page_start; > uint32_t page_offset_buf; > uint32_t page_offset_end; > }; > > And the required DMA address is looked up in some nanos. > > Has someone been thinking about this topic before ? There is no infastructure to support passing dma address between hardware devices, and is complete unrelated to the issues raised above... This requires the ability to pass in a map to a tag and create a new map... It is possible, as on the sun4v where you have two iommu's.. You'd have to program on iommu to point to the other one, to support that... But it is rare to see devices to dma directly to each other... You usually end up dma'ing to main memory, and then having the other device dma it out of memory.. The only time you need to dma between devices is if one has local memory, and the other device is able to sanely populate it... This is very rare... Also, the PCI bus length can get quite long.. With PCIe, each device is now it's own PCI bus, so you're starting to see PCI bus counts in the 10's and 20's, if not higher.. having an area of all of those, and calculating them and filling them out sounds like a huge expense... I'm a bit puzzeled as to what you wanted to solve, as the problem you stated doesn't relate to the solutions you were thinking about... Maybe I'm missing something? Can you give me an example of where cxgb is writing to the memory on another pci bus, and not main memory? P.S. I redirected to -arch as this seems more related than the other lists... -- 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 Wed Sep 26 14:30:28 2007 Return-Path: Delivered-To: freebsd-usb@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7A47416A418 for ; Wed, 26 Sep 2007 14:30:28 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 84D8E13C458 for ; Wed, 26 Sep 2007 14:30:28 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.1/8.14.1) with ESMTP id l8QEUSlI068729 for ; Wed, 26 Sep 2007 14:30:28 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.1/8.14.1/Submit) id l8QEUStl068728; Wed, 26 Sep 2007 14:30:28 GMT (envelope-from gnats) Date: Wed, 26 Sep 2007 14:30:28 GMT Message-Id: <200709261430.l8QEUStl068728@freefall.freebsd.org> To: freebsd-usb@FreeBSD.org From: Eugene Grosbein Cc: Subject: Re: usb/91546: [umodem] [patch] Nokia 6630 mobile phone does not work X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Eugene Grosbein List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Sep 2007 14:30:28 -0000 The following reply was made to PR usb/91546; it has been noted by GNATS. From: Eugene Grosbein To: bug-followup@freebsd.org Cc: "M. Warner Losh" , usb@freebsd.org Subject: Re: usb/91546: [umodem] [patch] Nokia 6630 mobile phone does not work Date: Wed, 26 Sep 2007 22:28:02 +0800 On Wed, Sep 26, 2007 at 07:32:01PM +0800, Eugene Grosbein wrote: > On Tue, 25 Sep 2007, Warner Losh wrote: > > > My modem doesn't have a CM descriptor and I quirked it before. I > > moved the quirk code and it works now without it. The Union code > > from NetBSD didn't look relevant at all when you chased down all the > > things that it actually did, but maybe I missed something. > > > Given that umodem from current should just work on -stable w/o any > > changes (you may need ucom too, which does need one or two changes), > > it would be worth a shot at trying it. > > I've taken umodem.c,v 1.71 (no changes) and ucom.c,v 1.64 (one-line > change for ttycreate() call) from CURRENT, rebuild kernel modules > and tried - no luck, it's attached as ugen: > > umodem_get_desc: no CM desc > ugen2: Nokia Nokia E50, rev 2.00/1.00, addr 2 Please take a look at this also: http://www.netbsd.org/cgi-bin/query-pr-single.pl?number=33192 It seems that NetBSD's code is not complete for my case too, but Linux's cdc-acm.c is able to deal with such devices. Eugene Grosbein From owner-freebsd-usb@FreeBSD.ORG Wed Sep 26 14:39:33 2007 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F280316A417 for ; Wed, 26 Sep 2007 14:39:33 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id CC0F813C457 for ; Wed, 26 Sep 2007 14:39:33 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.1/8.13.4) with ESMTP id l8QEc0AM066018; Wed, 26 Sep 2007 08:38:00 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Wed, 26 Sep 2007 08:38:00 -0600 (MDT) Message-Id: <20070926.083800.-2068217294.imp@bsdimp.com> To: eugen@kuzbass.ru From: "M. Warner Losh" In-Reply-To: <200709261430.l8QEUStl068728@freefall.freebsd.org> References: <200709261430.l8QEUStl068728@freefall.freebsd.org> X-Mailer: Mew version 5.2 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-2.0 (harmony.bsdimp.com [127.0.0.1]); Wed, 26 Sep 2007 08:38:00 -0600 (MDT) Cc: freebsd-usb@freebsd.org Subject: Re: usb/91546: [umodem] [patch] Nokia 6630 mobile phone does not 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: Wed, 26 Sep 2007 14:39:34 -0000 In message: <200709261430.l8QEUStl068728@freefall.freebsd.org> Eugene Grosbein writes: : The following reply was made to PR usb/91546; it has been noted by GNATS. : : From: Eugene Grosbein : To: bug-followup@freebsd.org : Cc: "M. Warner Losh" , usb@freebsd.org : Subject: Re: usb/91546: [umodem] [patch] Nokia 6630 mobile phone does not work : Date: Wed, 26 Sep 2007 22:28:02 +0800 : : On Wed, Sep 26, 2007 at 07:32:01PM +0800, Eugene Grosbein wrote: : > On Tue, 25 Sep 2007, Warner Losh wrote: : > : > > My modem doesn't have a CM descriptor and I quirked it before. I : > > moved the quirk code and it works now without it. The Union code : > > from NetBSD didn't look relevant at all when you chased down all the : > > things that it actually did, but maybe I missed something. : > : > > Given that umodem from current should just work on -stable w/o any : > > changes (you may need ucom too, which does need one or two changes), : > > it would be worth a shot at trying it. : > : > I've taken umodem.c,v 1.71 (no changes) and ucom.c,v 1.64 (one-line : > change for ttycreate() call) from CURRENT, rebuild kernel modules : > and tried - no luck, it's attached as ugen: : > : > umodem_get_desc: no CM desc : > ugen2: Nokia Nokia E50, rev 2.00/1.00, addr 2 : : Please take a look at this also: : http://www.netbsd.org/cgi-bin/query-pr-single.pl?number=33192 : : It seems that NetBSD's code is not complete for my case too, : but Linux's cdc-acm.c is able to deal with such devices. Thanks for the hints. It is time for a new phone for me anyway :-) Warner From owner-freebsd-usb@FreeBSD.ORG Wed Sep 26 14:40:08 2007 Return-Path: Delivered-To: freebsd-usb@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B9A8B16A417 for ; Wed, 26 Sep 2007 14:40:08 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id C345913C4A5 for ; Wed, 26 Sep 2007 14:40:08 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.1/8.14.1) with ESMTP id l8QEe8wt071267 for ; Wed, 26 Sep 2007 14:40:08 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.1/8.14.1/Submit) id l8QEe8Ns071266; Wed, 26 Sep 2007 14:40:08 GMT (envelope-from gnats) Date: Wed, 26 Sep 2007 14:40:08 GMT Message-Id: <200709261440.l8QEe8Ns071266@freefall.freebsd.org> To: freebsd-usb@FreeBSD.org From: "M. Warner Losh" Cc: Subject: Re: usb/91546: [umodem] [patch] Nokia 6630 mobile phone does not work X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: "M. Warner Losh" List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Sep 2007 14:40:08 -0000 The following reply was made to PR usb/91546; it has been noted by GNATS. From: "M. Warner Losh" To: eugen@kuzbass.ru Cc: bug-followup@freebsd.org Subject: Re: usb/91546: [umodem] [patch] Nokia 6630 mobile phone does not work Date: Wed, 26 Sep 2007 08:36:25 -0600 (MDT) In message: <20070926113201.GA1472@grosbein.pp.ru> Eugene Grosbein writes: : On Tue, 25 Sep 2007, Warner Losh wrote: : : > My modem doesn't have a CM descriptor and I quirked it before. I : > moved the quirk code and it works now without it. The Union code : > from NetBSD didn't look relevant at all when you chased down all the : > things that it actually did, but maybe I missed something. : : > Given that umodem from current should just work on -stable w/o any : > changes (you may need ucom too, which does need one or two changes), : > it would be worth a shot at trying it. : : I've taken umodem.c,v 1.71 (no changes) and ucom.c,v 1.64 (one-line : change for ttycreate() call) from CURRENT, rebuild kernel modules : and tried - no luck, it's attached as ugen: : : umodem_get_desc: no CM desc : ugen2: Nokia Nokia E50, rev 2.00/1.00, addr 2 Thanks Eugen... I'll look at your earlier changes and a merge from NetBSD. Warner From owner-freebsd-usb@FreeBSD.ORG Wed Sep 26 14:52:21 2007 Return-Path: Delivered-To: usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 42C4A16A41B for ; Wed, 26 Sep 2007 14:52:21 +0000 (UTC) (envelope-from eugen@www.svzserv.kemerovo.su) Received: from www.svzserv.kemerovo.su (www.svzserv.kemerovo.su [213.184.65.80]) by mx1.freebsd.org (Postfix) with ESMTP id B65F813C49D for ; Wed, 26 Sep 2007 14:52:20 +0000 (UTC) (envelope-from eugen@www.svzserv.kemerovo.su) Received: from www.svzserv.kemerovo.su (eugen@localhost [127.0.0.1]) by www.svzserv.kemerovo.su (8.13.8/8.13.8) with ESMTP id l8QES3P9087055; Wed, 26 Sep 2007 22:28:03 +0800 (KRAST) (envelope-from eugen@www.svzserv.kemerovo.su) Received: (from eugen@localhost) by www.svzserv.kemerovo.su (8.13.8/8.13.8/Submit) id l8QES2kR087054; Wed, 26 Sep 2007 22:28:02 +0800 (KRAST) (envelope-from eugen) Date: Wed, 26 Sep 2007 22:28:02 +0800 From: Eugene Grosbein To: bug-followup@freebsd.org Message-ID: <20070926142802.GA86911@svzserv.kemerovo.su> References: <20070925.231043.-345497328.imp@bsdimp.com> <20070926113201.GA1472@grosbein.pp.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20070926113201.GA1472@grosbein.pp.ru> User-Agent: Mutt/1.4.2.3i Cc: usb@freebsd.org Subject: Re: usb/91546: [umodem] [patch] Nokia 6630 mobile phone does not 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: Wed, 26 Sep 2007 14:52:21 -0000 On Wed, Sep 26, 2007 at 07:32:01PM +0800, Eugene Grosbein wrote: > On Tue, 25 Sep 2007, Warner Losh wrote: > > > My modem doesn't have a CM descriptor and I quirked it before. I > > moved the quirk code and it works now without it. The Union code > > from NetBSD didn't look relevant at all when you chased down all the > > things that it actually did, but maybe I missed something. > > > Given that umodem from current should just work on -stable w/o any > > changes (you may need ucom too, which does need one or two changes), > > it would be worth a shot at trying it. > > I've taken umodem.c,v 1.71 (no changes) and ucom.c,v 1.64 (one-line > change for ttycreate() call) from CURRENT, rebuild kernel modules > and tried - no luck, it's attached as ugen: > > umodem_get_desc: no CM desc > ugen2: Nokia Nokia E50, rev 2.00/1.00, addr 2 Please take a look at this also: http://www.netbsd.org/cgi-bin/query-pr-single.pl?number=33192 It seems that NetBSD's code is not complete for my case too, but Linux's cdc-acm.c is able to deal with such devices. Eugene Grosbein From owner-freebsd-usb@FreeBSD.ORG Wed Sep 26 16:44:39 2007 Return-Path: Delivered-To: usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E980016A418 for ; Wed, 26 Sep 2007 16:44:39 +0000 (UTC) (envelope-from eugen@grosbein.pp.ru) Received: from grosbein.pp.ru (grgw.svzserv.kemerovo.su [213.184.64.166]) by mx1.freebsd.org (Postfix) with ESMTP id 5F4D013C4A7 for ; Wed, 26 Sep 2007 16:44:38 +0000 (UTC) (envelope-from eugen@grosbein.pp.ru) Received: from grosbein.pp.ru (localhost [127.0.0.1]) by grosbein.pp.ru (8.14.1/8.14.1) with ESMTP id l8QGiSH2006791; Thu, 27 Sep 2007 00:44:28 +0800 (KRAST) (envelope-from eugen@grosbein.pp.ru) Received: (from eugen@localhost) by grosbein.pp.ru (8.14.1/8.14.1/Submit) id l8QGiRGa006790; Thu, 27 Sep 2007 00:44:27 +0800 (KRAST) (envelope-from eugen) Date: Thu, 27 Sep 2007 00:44:27 +0800 From: Eugene Grosbein To: usb@freebsd.org Message-ID: <20070926164427.GA6746@grosbein.pp.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20070925.231043.-345497328.imp@bsdimp.com> User-Agent: Mutt/1.4.2.2i Cc: Subject: Re: usb/91546: [umodem] [patch] Nokia 6630 mobile phone does not 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: Wed, 26 Sep 2007 16:44:40 -0000 Hi! sys/dev/usb/if_cdce.c has the following comment: /* * * The Data Class interface of a networking device shall have a minimum * of two interface settings. The first setting (the default interface * setting) includes no endpoints and therefore no networking traffic is * exchanged whenever the default interface setting is selected. One or * more additional interface settings are used for normal operation, and * therefore each includes a pair of endpoints (one IN, and one OUT) to * exchange network traffic. Select an alternate interface setting to * initialize the network aspects of the device and to enable the * exchange of network traffic. * * * Some devices, most notably cable modems, include interface settings * that have no IN or OUT endpoint, therefore loop through the list of all * available interface settings looking for one with both IN and OUT * endpoints. */ I've added the loop that follows this comment to umodem.c and found that Nokia E50 returns exactly one additional interface, e.g. usbd_get_no_alts() returns 1. And this interface description has id->bNumEndpoints equal to zero, so there is no IN/OUT endpoint. At all. Here I'm stuck. Eugene Grosbein From owner-freebsd-usb@FreeBSD.ORG Wed Sep 26 16:55:29 2007 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 971D516A41B for ; Wed, 26 Sep 2007 16:55:29 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe03.swip.net [212.247.154.65]) by mx1.freebsd.org (Postfix) with ESMTP id D90A013C467 for ; Wed, 26 Sep 2007 16:55:28 +0000 (UTC) (envelope-from hselasky@c2i.net) X-Cloudmark-Score: 0.000000 [] Received: from [85.19.218.45] (account mc467741@c2i.net [85.19.218.45] verified) by mailfe03.swip.net (CommuniGate Pro SMTP 5.1.10) with ESMTPA id 634483471; Wed, 26 Sep 2007 18:55:26 +0200 From: Hans Petter Selasky To: freebsd-usb@freebsd.org Date: Wed, 26 Sep 2007 18:55:45 +0200 User-Agent: KMail/1.9.7 References: <20070926164427.GA6746@grosbein.pp.ru> In-Reply-To: <20070926164427.GA6746@grosbein.pp.ru> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200709261855.46905.hselasky@c2i.net> Cc: usb@freebsd.org, Eugene Grosbein Subject: Re: usb/91546: [umodem] [patch] Nokia 6630 mobile phone does not 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: Wed, 26 Sep 2007 16:55:29 -0000 Hi, > > Here I'm stuck. > Have you dumped the complete USB descriptors using "/usr/ports/sysutils/udesc_dump" ? The device must attach like "ugen" before the utility works. --HPS From owner-freebsd-usb@FreeBSD.ORG Wed Sep 26 17:55:34 2007 Return-Path: Delivered-To: usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 072CE16A419 for ; Wed, 26 Sep 2007 17:55:34 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe03.swip.net [212.247.154.65]) by mx1.freebsd.org (Postfix) with ESMTP id E622013C455 for ; Wed, 26 Sep 2007 17:55:32 +0000 (UTC) (envelope-from hselasky@c2i.net) X-Cloudmark-Score: 0.000000 [] Received: from [85.19.218.45] (account mc467741@c2i.net [85.19.218.45] verified) by mailfe03.swip.net (CommuniGate Pro SMTP 5.1.10) with ESMTPA id 634483471; Wed, 26 Sep 2007 18:55:26 +0200 From: Hans Petter Selasky To: freebsd-usb@freebsd.org Date: Wed, 26 Sep 2007 18:55:45 +0200 User-Agent: KMail/1.9.7 References: <20070926164427.GA6746@grosbein.pp.ru> In-Reply-To: <20070926164427.GA6746@grosbein.pp.ru> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200709261855.46905.hselasky@c2i.net> Cc: usb@freebsd.org, Eugene Grosbein Subject: Re: usb/91546: [umodem] [patch] Nokia 6630 mobile phone does not 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: Wed, 26 Sep 2007 17:55:34 -0000 Hi, > > Here I'm stuck. > Have you dumped the complete USB descriptors using "/usr/ports/sysutils/udesc_dump" ? The device must attach like "ugen" before the utility works. --HPS From owner-freebsd-usb@FreeBSD.ORG Wed Sep 26 18:17:11 2007 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B73F016A419 for ; Wed, 26 Sep 2007 18:17:11 +0000 (UTC) (envelope-from scottl@samsco.org) Received: from pooker.samsco.org (pooker.samsco.org [168.103.85.57]) by mx1.freebsd.org (Postfix) with ESMTP id 7C3C313C455 for ; Wed, 26 Sep 2007 18:17:11 +0000 (UTC) (envelope-from scottl@samsco.org) Received: from scoo-longs-computer.local (wireless.prattprop.com [209.97.224.24] (may be forged)) (authenticated bits=0) by pooker.samsco.org (8.13.8/8.13.8) with ESMTP id l8QHp52N063752; Wed, 26 Sep 2007 11:51:12 -0600 (MDT) (envelope-from scottl@samsco.org) Message-ID: <46FA9C04.9060603@samsco.org> Date: Wed, 26 Sep 2007 11:51:00 -0600 From: Scott Long User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US; rv:1.8.1.6) Gecko/20070802 SeaMonkey/1.1.4 MIME-Version: 1.0 To: Hans Petter Selasky References: <200709260131.49156.hselasky@c2i.net> In-Reply-To: <200709260131.49156.hselasky@c2i.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-2.0.2 (pooker.samsco.org [168.103.85.57]); Wed, 26 Sep 2007 11:51:12 -0600 (MDT) X-Spam-Status: No, score=0.0 required=5.5 tests=none autolearn=failed version=3.1.8 X-Spam-Checker-Version: SpamAssassin 3.1.8 (2007-02-13) on pooker.samsco.org Cc: freebsd-scsi@freebsd.org, freebsd-usb@freebsd.org, freebsd-net@freebsd.org Subject: Re: Request for feedback on common data backstore in the kernel X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Sep 2007 18:17:11 -0000 Hans Petter Selasky wrote: > Hi, > > Please keep me CC'ed, hence I'm not on all these lists. > > In the kernel we currently have two different data backstores: > > struct mbuf > > and > > struct buf > > These two backstores serve two different device types. "mbufs" are for network > devices and "buf" is for disk devices. > > Problem: > > The current backstores are loaded into DMA by using the BUS-DMA framework. > This appears not to be too fast according to Kip Macy. See: > > http://perforce.freebsd.org/chv.cgi?CH=126455 > Busdma isn't fast enough for 1Gb and 10Gb network drivers that are trying to max out their packet rates. It's still fine for storage drivers and other slow/medium speed device drivers, like USB and Firewire. I am working on techniques to make the API easier to use and the implementation fast enough for the aforementioned devices. > Some ideas I have: > > When a buffer is out out of range for a hardware device and a data-copy is > needed I want to simply copy that data in smaller parts to/from a > pre-allocated bounce buffer. I want to avoid allocating this buffer > when "bus_dmamap_load()" is called. I think you've missed the point of having architecture portable drivers. John-Mark describes this further. It also makes little sense to push the responsibility for handling bounce buffers out of a central subsystem and back into every driver. Scott From owner-freebsd-usb@FreeBSD.ORG Wed Sep 26 18:30:07 2007 Return-Path: Delivered-To: freebsd-usb@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8537816A41B for ; Wed, 26 Sep 2007 18:30:07 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 695D113C455 for ; Wed, 26 Sep 2007 18:30:07 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.1/8.14.1) with ESMTP id l8QIU7W3014194 for ; Wed, 26 Sep 2007 18:30:07 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.1/8.14.1/Submit) id l8QIU7BM014191; Wed, 26 Sep 2007 18:30:07 GMT (envelope-from gnats) Date: Wed, 26 Sep 2007 18:30:07 GMT Message-Id: <200709261830.l8QIU7BM014191@freefall.freebsd.org> To: freebsd-usb@FreeBSD.org From: Stefan Walter Cc: Subject: Re: usb/57085: [umass] umass0 problems, with Sony Vio/USB memory stick X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Stefan Walter List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Sep 2007 18:30:07 -0000 The following reply was made to PR usb/57085; it has been noted by GNATS. From: Stefan Walter To: melvyn@webteckies.org Cc: GNATS Subject: Re: usb/57085: [umass] umass0 problems, with Sony Vio/USB memory stick Date: Wed, 26 Sep 2007 20:19:25 +0200 Hi Melvyn, there hasn't been an update on the state of this for quite a while. Are you still experiencing the described problems on a more recent system? Or can this problem report be closed? Best regards, Stefan From owner-freebsd-usb@FreeBSD.ORG Wed Sep 26 19:10:06 2007 Return-Path: Delivered-To: freebsd-usb@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E420916A46D for ; Wed, 26 Sep 2007 19:10:06 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id B77E713C4AA for ; Wed, 26 Sep 2007 19:10:06 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.1/8.14.1) with ESMTP id l8QJA6po016181 for ; Wed, 26 Sep 2007 19:10:06 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.1/8.14.1/Submit) id l8QJA6Ah016179; Wed, 26 Sep 2007 19:10:06 GMT (envelope-from gnats) Date: Wed, 26 Sep 2007 19:10:06 GMT Message-Id: <200709261910.l8QJA6Ah016179@freefall.freebsd.org> To: freebsd-usb@FreeBSD.org From: Stefan Walter Cc: Subject: Re: usb/62088: [usb] Logitech Cordless/Optical Mouse not working X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Stefan Walter List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Sep 2007 19:10:07 -0000 The following reply was made to PR usb/62088; it has been noted by GNATS. From: Stefan Walter To: Jonathan Heaney Cc: Jonathan Fosburgh , Julian Elischer , GNATS Subject: Re: usb/62088: [usb] Logitech Cordless/Optical Mouse not working Date: Wed, 26 Sep 2007 20:30:27 +0200 Hi Jonathan, there hasn't been an update on the state of this for quite a while. Are you still experiencing the described problems on an up-to-date system? Or can this PR be closed? Best regards, Stefan From owner-freebsd-usb@FreeBSD.ORG Wed Sep 26 19:56:57 2007 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9A11716A419; Wed, 26 Sep 2007 19:56:57 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe04.swip.net [212.247.154.97]) by mx1.freebsd.org (Postfix) with ESMTP id 7ADDF13C4A6; Wed, 26 Sep 2007 19:56:56 +0000 (UTC) (envelope-from hselasky@c2i.net) X-Cloudmark-Score: 0.000000 [] Received: from [85.19.218.45] (account mc467741@c2i.net [85.19.218.45] verified) by mailfe04.swip.net (CommuniGate Pro SMTP 5.1.10) with ESMTPA id 626638699; Wed, 26 Sep 2007 21:56:43 +0200 From: Hans Petter Selasky To: Scott Long Date: Wed, 26 Sep 2007 21:57:00 +0200 User-Agent: KMail/1.9.7 References: <200709260131.49156.hselasky@c2i.net> <46FA9C04.9060603@samsco.org> In-Reply-To: <46FA9C04.9060603@samsco.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200709262157.02712.hselasky@c2i.net> Cc: freebsd-scsi@freebsd.org, freebsd-arch@freebsd.org, freebsd-usb@freebsd.org, freebsd-net@freebsd.org Subject: Re: Request for feedback on common data backstore in the kernel X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Sep 2007 19:56:57 -0000 Hi Scott, The discussion has been moved to "freebsd-arch@freebsd.org". Please only reply there next time. On Wednesday 26 September 2007, Scott Long wrote: > Hans Petter Selasky wrote: > > Hi, > > > > Please keep me CC'ed, hence I'm not on all these lists. > > > > In the kernel we currently have two different data backstores: > > > > struct mbuf > > > > and > > > > struct buf > > > > These two backstores serve two different device types. "mbufs" are for > > network devices and "buf" is for disk devices. > > > > Problem: > > > > The current backstores are loaded into DMA by using the BUS-DMA > > framework. This appears not to be too fast according to Kip Macy. See: > > > > http://perforce.freebsd.org/chv.cgi?CH=126455 > > Busdma isn't fast enough for 1Gb and 10Gb network drivers that are > trying to max out their packet rates. It's still fine for storage > drivers and other slow/medium speed device drivers, like USB and > Firewire. I am working on techniques to make the API easier to use > and the implementation fast enough for the aforementioned devices. That's great! > > > Some ideas I have: > > > > When a buffer is out out of range for a hardware device and a data-copy > > is needed I want to simply copy that data in smaller parts to/from a > > pre-allocated bounce buffer. I want to avoid allocating this buffer when > > "bus_dmamap_load()" is called. > > I think you've missed the point of having architecture portable drivers. > John-Mark describes this further. I use the bus_dma framework to allocate and sync all DMA memory, and I assume that is correct. > It also makes little sense to push > the responsibility for handling bounce buffers out of a central > subsystem and back into every driver. I'm thinking about putting some wrappers around the "bus_dmamap_load()" function like: void usbd_rx_buf_load(struct usbd_xfer *xfer, void *buf, uint32_t framebuffer_offset, uint32_t framebuffer_index, uint32_t len); void usbd_tx_buf_load(struct usbd_xfer *xfer, void *buf, uint32_t framebuffer_offset, uint32_t framebuffer_index, uint32_t len); But I haven't figured out all the details yet. The "usbd_xxx_load()" functions should automagically figure out what is best to do and it won't be more than a few lines of code. --HPS From owner-freebsd-usb@FreeBSD.ORG Wed Sep 26 21:40:08 2007 Return-Path: Delivered-To: freebsd-usb@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3C8BA16A468 for ; Wed, 26 Sep 2007 21:40:08 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 2345D13C48D for ; Wed, 26 Sep 2007 21:40:08 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.1/8.14.1) with ESMTP id l8QLe7NS027650 for ; Wed, 26 Sep 2007 21:40:07 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.1/8.14.1/Submit) id l8QLe76E027646; Wed, 26 Sep 2007 21:40:07 GMT (envelope-from gnats) Date: Wed, 26 Sep 2007 21:40:07 GMT Message-Id: <200709262140.l8QLe76E027646@freefall.freebsd.org> To: freebsd-usb@FreeBSD.org From: Jonathan Fosburgh Cc: Subject: Re: usb/62088: [usb] Logitech Cordless/Optical Mouse not working X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Jonathan Fosburgh List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Sep 2007 21:40:08 -0000 The following reply was made to PR usb/62088; it has been noted by GNATS. From: Jonathan Fosburgh To: Stefan Walter Cc: Jonathan Heaney , Julian Elischer , GNATS Subject: Re: usb/62088: [usb] Logitech Cordless/Optical Mouse not working Date: Wed, 26 Sep 2007 15:30:32 -0500 On Wednesday 26 September 2007 13:30:27 Stefan Walter wrote: > Hi Jonathan, > > there hasn't been an update on the state of this for quite a while. Are > you still experiencing the described problems on an up-to-date system? Or > can this PR be closed? > > Best regards, > Stefan It was fixed a long time ago (I think, I am now being forced to run Windows on this system and it has been that way for quite some time, so I really don't remember). Go ahead and close it though, I am fairly sure it is fixed. From owner-freebsd-usb@FreeBSD.ORG Wed Sep 26 23:29:05 2007 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8286D16A418 for ; Wed, 26 Sep 2007 23:29:05 +0000 (UTC) (envelope-from member@childeric.freeserve.co.uk) Received: from smtp2.freeserve.com (smtp2.wanadoo.co.uk [193.252.22.157]) by mx1.freebsd.org (Postfix) with ESMTP id 0D19013C469 for ; Wed, 26 Sep 2007 23:29:04 +0000 (UTC) (envelope-from member@childeric.freeserve.co.uk) Received: from me-wanadoo.net (localhost [127.0.0.1]) by mwinf3114.me.freeserve.com (SMTP Server) with ESMTP id 8B6A85800085 for ; Thu, 27 Sep 2007 01:29:03 +0200 (CEST) Received: from wwinf3106 (wwinf3106 [172.22.158.33]) by mwinf3114.me.freeserve.com (SMTP Server) with ESMTP id 8409E5800084 for ; Thu, 27 Sep 2007 01:29:03 +0200 (CEST) X-ME-UUID: 20070926232903540.8409E5800084@mwinf3114.me.freeserve.com From: Chris Whitehouse To: freebsd-usb@freebsd.org Message-ID: <18119164.87871190849343527.JavaMail.www@wwinf3106> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Originating-IP: [87.194.3.32] X-Wum-Nature: EMAIL-NATURE X-WUM-FROM: |~| X-WUM-TO: |~| X-WUM-REPLYTO: |~| Date: Thu, 27 Sep 2007 01:29:03 +0200 (CEST) Subject: Edimax usb wifi adapter X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: member@childeric.freeserve.co.uk List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Sep 2007 23:29:05 -0000 On Thursday 20 September 2007, Chris Whitehouse wrote: > Hi, > > [Please cc me in any reply as I am not subscribed, thanks] > > I was wondering if it would be possible to add a usb wifi adapter to a > driver. I guess the driver would be ural > > When I insert it dmesg shows > ugen0: Ralink 802.11 bg WLAN, rev 2.00/0.01, addr 2 > > usbdevs -v: > Controller /dev/usb0: > addr 1: full speed, self powered, config 1, OHCI root hub(0x0000), > nVidia(0x0000 ), rev 1.00 > port 1 powered > port 2 powered > port 3 powered > port 4 powered > port 5 powered > port 6 powered > port 7 powered > port 8 powered > Controller /dev/usb1: > addr 1: high speed, self powered, config 1, EHCI root hub(0x0000), > nVidia(0x0000 ), rev 1.00 > port 1 powered > port 2 powered > port 3 addr 2: high speed, power 300 mA, config 1, 802.11 bg WLAN(0x2573), > Rali nk(0x148f), rev 0.01 > port 4 powered > port 5 powered > port 6 powered > port 7 powered > port 8 powered > > I have all of the following in my kernel config > device ehci > device uhci > device ohci > device usb > device ural > device wlan > > Running i386 on amd64 arch > uname -a: > FreeBSD amd64.childeric.freeserve.co.uk 6.2-STABLE FreeBSD 6.2-STABLE #0: > Thu Sep 20 21:48:15 BST 2007 > root at amd64.childeric.freeserve.co.uk:/usr/src/sys/i386/compile/AMD64 i386 > > The CD that came with the device includes various linux drivers in case > that's of any use. > > Thanks very much > > Chris Have you tried if_rum ? --HPS Hi Hans Petter, I haven't but hope to soon. It's not in 6.2 so I installed a 7 snapshot but in the meantime the device is out on loan. However it is the same as this one http://lists.freebsd.org/pipermail/freebsd-current/2007-September/076684.html so I guess I can expect panics. btw did you cc me? Otherwise I probably lost your reply in a combination of spam and webmail and have only just seen the archive. Apologies if so. Thanks Chris From owner-freebsd-usb@FreeBSD.ORG Thu Sep 27 01:13:52 2007 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EE3ED16A418; Thu, 27 Sep 2007 01:13:52 +0000 (UTC) (envelope-from scottl@samsco.org) Received: from pooker.samsco.org (pooker.samsco.org [168.103.85.57]) by mx1.freebsd.org (Postfix) with ESMTP id 7BF9B13C48A; Thu, 27 Sep 2007 01:13:52 +0000 (UTC) (envelope-from scottl@samsco.org) Received: from phobos.samsco.home (phobos.samsco.home [192.168.254.11]) (authenticated bits=0) by pooker.samsco.org (8.13.8/8.13.8) with ESMTP id l8R1DPix065986; Wed, 26 Sep 2007 19:13:26 -0600 (MDT) (envelope-from scottl@samsco.org) Message-ID: <46FB03B1.6020100@samsco.org> Date: Wed, 26 Sep 2007 19:13:21 -0600 From: Scott Long User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US; rv:1.8.1.6) Gecko/20070802 SeaMonkey/1.1.4 MIME-Version: 1.0 To: Hans Petter Selasky References: <200709260131.49156.hselasky@c2i.net> <46FA9C04.9060603@samsco.org> <200709262157.02712.hselasky@c2i.net> In-Reply-To: <200709262157.02712.hselasky@c2i.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-2.0.2 (pooker.samsco.org [168.103.85.57]); Wed, 26 Sep 2007 19:13:26 -0600 (MDT) X-Spam-Status: No, score=-1.4 required=5.5 tests=ALL_TRUSTED autolearn=failed version=3.1.8 X-Spam-Checker-Version: SpamAssassin 3.1.8 (2007-02-13) on pooker.samsco.org Cc: freebsd-scsi@freebsd.org, freebsd-arch@freebsd.org, freebsd-usb@freebsd.org, freebsd-net@freebsd.org Subject: Re: Request for feedback on common data backstore in the kernel 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, 27 Sep 2007 01:13:53 -0000 Hans Petter Selasky wrote: > Hi Scott, > > The discussion has been moved to "freebsd-arch@freebsd.org". Please only reply > there next time. > > On Wednesday 26 September 2007, Scott Long wrote: >> Hans Petter Selasky wrote: >>> Hi, >>> >>> Please keep me CC'ed, hence I'm not on all these lists. >>> >>> In the kernel we currently have two different data backstores: >>> >>> struct mbuf >>> >>> and >>> >>> struct buf >>> >>> These two backstores serve two different device types. "mbufs" are for >>> network devices and "buf" is for disk devices. >>> >>> Problem: >>> >>> The current backstores are loaded into DMA by using the BUS-DMA >>> framework. This appears not to be too fast according to Kip Macy. See: >>> >>> http://perforce.freebsd.org/chv.cgi?CH=126455 >> Busdma isn't fast enough for 1Gb and 10Gb network drivers that are >> trying to max out their packet rates. It's still fine for storage >> drivers and other slow/medium speed device drivers, like USB and >> Firewire. I am working on techniques to make the API easier to use >> and the implementation fast enough for the aforementioned devices. > > That's great! > Well, the point is that I'm not sure why you're so worried about performance issues with USB and busdma. Do you have any test data that shows that it's a problem? >>> Some ideas I have: >>> >>> When a buffer is out out of range for a hardware device and a data-copy >>> is needed I want to simply copy that data in smaller parts to/from a >>> pre-allocated bounce buffer. I want to avoid allocating this buffer when >>> "bus_dmamap_load()" is called. >> I think you've missed the point of having architecture portable drivers. >> John-Mark describes this further. > > I use the bus_dma framework to allocate and sync all DMA memory, and I assume > that is correct. > That is one of the uses of busdma, yes. The other is to handle buffers that have been allocated elsewhere in the system. >> It also makes little sense to push >> the responsibility for handling bounce buffers out of a central >> subsystem and back into every driver. > > I'm thinking about putting some wrappers around the "bus_dmamap_load()" > function like: > > void usbd_rx_buf_load(struct usbd_xfer *xfer, void *buf, > uint32_t framebuffer_offset, uint32_t framebuffer_index, uint32_t len); > > void usbd_tx_buf_load(struct usbd_xfer *xfer, void *buf, > uint32_t framebuffer_offset, uint32_t framebuffer_index, uint32_t len); > > But I haven't figured out all the details yet. The "usbd_xxx_load()" functions > should automagically figure out what is best to do and it won't be more than > a few lines of code. Can you describe what these two wrappers are supposed to do? Are you expecting bus_dmamap_load() to operate synchronously? Scott From owner-freebsd-usb@FreeBSD.ORG Thu Sep 27 13:37:47 2007 Return-Path: Delivered-To: usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 866DF16A41A for ; Thu, 27 Sep 2007 13:37:47 +0000 (UTC) (envelope-from eugen@grosbein.pp.ru) Received: from grosbein.pp.ru (grgw.svzserv.kemerovo.su [213.184.64.166]) by mx1.freebsd.org (Postfix) with ESMTP id 7826D13C467 for ; Thu, 27 Sep 2007 13:37:45 +0000 (UTC) (envelope-from eugen@grosbein.pp.ru) Received: from grosbein.pp.ru (localhost [127.0.0.1]) by grosbein.pp.ru (8.14.1/8.14.1) with ESMTP id l8RDbgMk002166 for ; Thu, 27 Sep 2007 21:37:42 +0800 (KRAST) (envelope-from eugen@grosbein.pp.ru) Received: (from eugen@localhost) by grosbein.pp.ru (8.14.1/8.14.1/Submit) id l8RDbgbI002165 for usb@freebsd.org; Thu, 27 Sep 2007 21:37:42 +0800 (KRAST) (envelope-from eugen) Date: Thu, 27 Sep 2007 21:37:42 +0800 From: Eugene Grosbein To: usb@freebsd.org Message-ID: <20070927133741.GA2148@grosbein.pp.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200709261855.46905.hselasky@c2i.net> User-Agent: Mutt/1.4.2.2i Cc: Subject: Re: usb/91546: [umodem] [patch] Nokia 6630 mobile phone does not 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: Thu, 27 Sep 2007 13:37:47 -0000 On Wed, 26 Sep 2007, Hans Petter Selasky wrote: > Have you dumped the complete USB descriptors > using "/usr/ports/sysutils/udesc_dump" ? I did not even know that it exists, but suspected :-) Thanks. Here it comes: ioctl USB_GET_STRING_DESC: Invalid argument Standard Device Descriptor: bLength 18 bDescriptorType 01 bcdUSB 0200 bDeviceClass 02 bDeviceSubClass 00 bDeviceProtocol 00 bMaxPacketSize 64 idVendor 0421 idProduct 04c9 bcdDevice 0100 iManufacturer 1 iProduct 2 iSerialNumber 0 bNumConfigurations 1 Configuration 0: Standard Configuration Descriptor: bLength 9 bDescriptorType 02 wTotalLength 404 bNumInterface 14 bConfigurationValue 1 iConfiguration 4 bmAttributes c0 (self-powered) bMaxPower 4 (8 mA) Standard Interface Descriptor: bLength 9 bDescriptorType 04 bInterfaceNumber 0 bAlternateSetting 0 bNumEndpoints 0 bInterfaceClass 02 bInterfaceSubClass 08 bInterfaceProtocol 00 iInterface 0 Descriptor: bLength 5 bDescriptorType 24 bDescriptorSubtype 00 05 24 00 10 01 Descriptor: bLength 5 bDescriptorType 24 bDescriptorSubtype 11 05 24 11 00 01 Descriptor: bLength 17 bDescriptorType 24 bDescriptorSubtype 06 11 24 06 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d Standard Interface Descriptor: bLength 9 bDescriptorType 04 bInterfaceNumber 1 bAlternateSetting 0 bNumEndpoints 0 bInterfaceClass 02 bInterfaceSubClass 08 bInterfaceProtocol 01 iInterface 0 Descriptor: bLength 5 bDescriptorType 24 bDescriptorSubtype 00 05 24 00 10 01 Descriptor: bLength 5 bDescriptorType 24 bDescriptorSubtype 08 05 24 08 00 01 Descriptor: bLength 6 bDescriptorType 24 bDescriptorSubtype 06 06 24 06 01 02 03 Standard Interface Descriptor: bLength 9 bDescriptorType 04 bInterfaceNumber 2 bAlternateSetting 0 bNumEndpoints 0 bInterfaceClass 02 bInterfaceSubClass fe bInterfaceProtocol 00 iInterface 0 Descriptor: bLength 5 bDescriptorType 24 bDescriptorSubtype 00 05 24 00 10 01 Descriptor: bLength 5 bDescriptorType 24 bDescriptorSubtype ab 05 24 ab 05 15 Descriptor: bLength 5 bDescriptorType 24 bDescriptorSubtype 06 05 24 06 02 03 Standard Interface Descriptor: bLength 9 bDescriptorType 04 bInterfaceNumber 3 bAlternateSetting 0 bNumEndpoints 0 bInterfaceClass 0a bInterfaceSubClass 00 bInterfaceProtocol 00 iInterface 0 Standard Interface Descriptor: bLength 9 bDescriptorType 04 bInterfaceNumber 3 bAlternateSetting 1 bNumEndpoints 2 bInterfaceClass 0a bInterfaceSubClass 00 bInterfaceProtocol 00 iInterface 0 Descriptor: bLength 4 bDescriptorType 24 bDescriptorSubtype fd 04 24 fd 01 Standard Endpoint Descriptor: bLength 7 bDescriptorType 05 bEndpointAddress 01 (out) bmAttributes 02 (Bulk) wMaxPacketSize 64 bInterval 0 Standard Endpoint Descriptor: bLength 7 bDescriptorType 05 bEndpointAddress 84 (in) bmAttributes 02 (Bulk) wMaxPacketSize 64 bInterval 0 Standard Interface Descriptor: bLength 9 bDescriptorType 04 bInterfaceNumber 4 bAlternateSetting 0 bNumEndpoints 0 bInterfaceClass 02 bInterfaceSubClass 0b bInterfaceProtocol 00 iInterface 5 Descriptor: bLength 5 bDescriptorType 24 bDescriptorSubtype 00 05 24 00 10 01 Descriptor: bLength 5 bDescriptorType 24 bDescriptorSubtype 15 05 24 15 00 01 Descriptor: bLength 5 bDescriptorType 24 bDescriptorSubtype 06 05 24 06 04 05 Standard Interface Descriptor: bLength 9 bDescriptorType 04 bInterfaceNumber 5 bAlternateSetting 0 bNumEndpoints 0 bInterfaceClass 0a bInterfaceSubClass 00 bInterfaceProtocol 00 iInterface 0 Standard Interface Descriptor: bLength 9 bDescriptorType 04 bInterfaceNumber 5 bAlternateSetting 1 bNumEndpoints 2 bInterfaceClass 0a bInterfaceSubClass 00 bInterfaceProtocol 00 iInterface 0 Standard Endpoint Descriptor: bLength 7 bDescriptorType 05 bEndpointAddress 85 (in) bmAttributes 02 (Bulk) wMaxPacketSize 64 bInterval 0 Standard Endpoint Descriptor: bLength 7 bDescriptorType 05 bEndpointAddress 02 (out) bmAttributes 02 (Bulk) wMaxPacketSize 64 bInterval 0 Standard Interface Descriptor: bLength 9 bDescriptorType 04 bInterfaceNumber 6 bAlternateSetting 0 bNumEndpoints 0 bInterfaceClass 02 bInterfaceSubClass 0b bInterfaceProtocol 00 iInterface 6 Descriptor: bLength 5 bDescriptorType 24 bDescriptorSubtype 00 05 24 00 10 01 Descriptor: bLength 5 bDescriptorType 24 bDescriptorSubtype 15 05 24 15 00 01 Descriptor: bLength 5 bDescriptorType 24 bDescriptorSubtype 06 05 24 06 06 07 Standard Interface Descriptor: bLength 9 bDescriptorType 04 bInterfaceNumber 7 bAlternateSetting 0 bNumEndpoints 0 bInterfaceClass 0a bInterfaceSubClass 00 bInterfaceProtocol 00 iInterface 0 Standard Interface Descriptor: bLength 9 bDescriptorType 04 bInterfaceNumber 7 bAlternateSetting 1 bNumEndpoints 2 bInterfaceClass 0a bInterfaceSubClass 00 bInterfaceProtocol 00 iInterface 0 Standard Endpoint Descriptor: bLength 7 bDescriptorType 05 bEndpointAddress 86 (in) bmAttributes 02 (Bulk) wMaxPacketSize 64 bInterval 0 Standard Endpoint Descriptor: bLength 7 bDescriptorType 05 bEndpointAddress 03 (out) bmAttributes 02 (Bulk) wMaxPacketSize 64 bInterval 0 Standard Interface Descriptor: bLength 9 bDescriptorType 04 bInterfaceNumber 8 bAlternateSetting 0 bNumEndpoints 0 bInterfaceClass 02 bInterfaceSubClass 0b bInterfaceProtocol 00 iInterface 7 Descriptor: bLength 5 bDescriptorType 24 bDescriptorSubtype 00 05 24 00 10 01 Descriptor: bLength 5 bDescriptorType 24 bDescriptorSubtype 15 05 24 15 00 01 Descriptor: bLength 5 bDescriptorType 24 bDescriptorSubtype 06 05 24 06 08 09 Standard Interface Descriptor: bLength 9 bDescriptorType 04 bInterfaceNumber 9 bAlternateSetting 0 bNumEndpoints 0 bInterfaceClass 0a bInterfaceSubClass 00 bInterfaceProtocol 00 iInterface 0 Standard Interface Descriptor: bLength 9 bDescriptorType 04 bInterfaceNumber 9 bAlternateSetting 1 bNumEndpoints 2 bInterfaceClass 0a bInterfaceSubClass 00 bInterfaceProtocol 00 iInterface 0 Standard Endpoint Descriptor: bLength 7 bDescriptorType 05 bEndpointAddress 87 (in) bmAttributes 02 (Bulk) wMaxPacketSize 64 bInterval 0 Standard Endpoint Descriptor: bLength 7 bDescriptorType 05 bEndpointAddress 04 (out) bmAttributes 02 (Bulk) wMaxPacketSize 64 bInterval 0 Standard Interface Descriptor: bLength 9 bDescriptorType 04 bInterfaceNumber 10 bAlternateSetting 0 bNumEndpoints 1 bInterfaceClass 02 bInterfaceSubClass 02 bInterfaceProtocol 01 iInterface 8 Descriptor: bLength 5 bDescriptorType 24 bDescriptorSubtype 00 05 24 00 00 01 Descriptor: bLength 4 bDescriptorType 24 bDescriptorSubtype 02 04 24 02 0f Descriptor: bLength 5 bDescriptorType 24 bDescriptorSubtype 06 05 24 06 0a 0b Standard Endpoint Descriptor: bLength 7 bDescriptorType 05 bEndpointAddress 81 (in) bmAttributes 03 (Interrupt) wMaxPacketSize 64 bInterval 128 Standard Interface Descriptor: bLength 9 bDescriptorType 04 bInterfaceNumber 11 bAlternateSetting 0 bNumEndpoints 2 bInterfaceClass 0a bInterfaceSubClass 00 bInterfaceProtocol 00 iInterface 9 Standard Endpoint Descriptor: bLength 7 bDescriptorType 05 bEndpointAddress 88 (in) bmAttributes 02 (Bulk) wMaxPacketSize 64 bInterval 0 Standard Endpoint Descriptor: bLength 7 bDescriptorType 05 bEndpointAddress 05 (out) bmAttributes 02 (Bulk) wMaxPacketSize 64 bInterval 0 Standard Interface Descriptor: bLength 9 bDescriptorType 04 bInterfaceNumber 12 bAlternateSetting 0 bNumEndpoints 1 bInterfaceClass 02 bInterfaceSubClass 02 bInterfaceProtocol ff iInterface 10 Descriptor: bLength 5 bDescriptorType 24 bDescriptorSubtype 00 05 24 00 00 01 Descriptor: bLength 4 bDescriptorType 24 bDescriptorSubtype 02 04 24 02 0f Descriptor: bLength 5 bDescriptorType 24 bDescriptorSubtype 06 05 24 06 0c 0d Standard Endpoint Descriptor: bLength 7 bDescriptorType 05 bEndpointAddress 82 (in) bmAttributes 03 (Interrupt) wMaxPacketSize 64 bInterval 128 Standard Interface Descriptor: bLength 9 bDescriptorType 04 bInterfaceNumber 13 bAlternateSetting 0 bNumEndpoints 2 bInterfaceClass 0a bInterfaceSubClass 00 bInterfaceProtocol 00 iInterface 11 Standard Endpoint Descriptor: bLength 7 bDescriptorType 05 bEndpointAddress 89 (in) bmAttributes 02 (Bulk) wMaxPacketSize 64 bInterval 0 Standard Endpoint Descriptor: bLength 7 bDescriptorType 05 bEndpointAddress 06 (out) bmAttributes 02 (Bulk) wMaxPacketSize 64 bInterval 0 Codes Representing Languages by the Device: bLength 4 bDescriptorType 03 wLANGID[0] 0409 String (index 1): Nokia String (index 2): Nokia E50 From owner-freebsd-usb@FreeBSD.ORG Thu Sep 27 15:56:07 2007 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 90AA816A418; Thu, 27 Sep 2007 15:56:07 +0000 (UTC) (envelope-from avg@icyb.net.ua) Received: from falcon.cybervisiontech.com (falcon.cybervisiontech.com [217.20.163.9]) by mx1.freebsd.org (Postfix) with ESMTP id 0914E13C458; Thu, 27 Sep 2007 15:56:06 +0000 (UTC) (envelope-from avg@icyb.net.ua) Received: from localhost (localhost [127.0.0.1]) by falcon.cybervisiontech.com (Postfix) with ESMTP id 70CED43DAC0; Thu, 27 Sep 2007 18:37:50 +0300 (EEST) X-Virus-Scanned: Debian amavisd-new at falcon.cybervisiontech.com Received: from falcon.cybervisiontech.com ([127.0.0.1]) by localhost (falcon.cybervisiontech.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ZX8a7tqBz1pJ; Thu, 27 Sep 2007 18:37:50 +0300 (EEST) Received: from [10.2.1.87] (gateway.cybervisiontech.com.ua [88.81.251.18]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by falcon.cybervisiontech.com (Postfix) with ESMTP id 1A81243D4DE; Thu, 27 Sep 2007 18:37:50 +0300 (EEST) Message-ID: <46FBCE7D.8060409@icyb.net.ua> Date: Thu, 27 Sep 2007 18:38:37 +0300 From: Andriy Gapon User-Agent: Thunderbird 2.0.0.6 (X11/20070803) MIME-Version: 1.0 To: freebsd-usb@freebsd.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: freebsd-mobile@freebsd.org Subject: usb rndis 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, 27 Sep 2007 15:56:07 -0000 What is status of support of USB devices that talk (MS) RNDIS ? Are there any news or clever hacks ? Essentially I am trying to connect to internet my FreeBSD computer using GPRS via Asus P535 device that runs WM5 (AKU 3). I use "Internet Sharing" program on the device side. I tried using cdce but it doesn't attach to my device. I am open to any suggestions both on PC and device sides. Dump from udesc_dump follows. As I understand from http://www.usb.org/developers/defined_class class e0, subclass 1, protocol 3 seems to mean "Remote NDIS". There is a huge linux patch that seems to be designed to add or improve RNDIS support: http://riksun.riken.go.jp/pub/pub/Linux/kernel/people/gregkh/gregkh-2.6/gregkh-03-usb-2.6.20-rc1-git7.patch Standard Device Descriptor: bLength 18 bDescriptorType 01 bcdUSB 0200 bDeviceClass e0 bDeviceSubClass 01 bDeviceProtocol 03 bMaxPacketSize 16 idVendor 0b05 idProduct 424f bcdDevice 0000 iManufacturer 1 iProduct 2 iSerialNumber 3 bNumConfigurations 1 Configuration 0: Standard Configuration Descriptor: bLength 9 bDescriptorType 02 wTotalLength 62 bNumInterface 2 bConfigurationValue 1 iConfiguration 0 bmAttributes 80 bMaxPower 250 (500 mA) Standard Interface Descriptor: bLength 9 bDescriptorType 04 bInterfaceNumber 0 bAlternateSetting 0 bNumEndpoints 1 bInterfaceClass e0 bInterfaceSubClass 01 bInterfaceProtocol 03 iInterface 0 Descriptor: bLength 5 bDescriptorType 24 bDescriptorSubtype 01 05 24 01 00 01 Descriptor: bLength 4 bDescriptorType 24 bDescriptorSubtype 02 04 24 02 00 Descriptor: bLength 5 bDescriptorType 24 bDescriptorSubtype 02 05 24 02 00 01 Standard Endpoint Descriptor: bLength 7 bDescriptorType 05 bEndpointAddress 81 (in) bmAttributes 03 (Interrupt) wMaxPacketSize 8 bInterval 1 Standard Interface Descriptor: bLength 9 bDescriptorType 04 bInterfaceNumber 1 bAlternateSetting 0 bNumEndpoints 2 bInterfaceClass 0a bInterfaceSubClass 00 bInterfaceProtocol 00 iInterface 0 Standard Endpoint Descriptor: bLength 7 bDescriptorType 05 bEndpointAddress 82 (in) bmAttributes 02 (Bulk) wMaxPacketSize 64 bInterval 0 Standard Endpoint Descriptor: bLength 7 bDescriptorType 05 bEndpointAddress 03 (out) bmAttributes 02 (Bulk) wMaxPacketSize 64 bInterval 0 Codes Representing Languages by the Device: bLength 4 bDescriptorType 03 wLANGID[0] 0409 String (index 1): ASUS String (index 2): ASUS Windows Mobile Device String (index 3): f553b4ec-0dee-9dcc-7a63-40a7b4d674b9 -- Andriy Gapon From owner-freebsd-usb@FreeBSD.ORG Thu Sep 27 16:44:16 2007 Return-Path: Delivered-To: usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7E78216A419 for ; Thu, 27 Sep 2007 16:44:16 +0000 (UTC) (envelope-from eugen@grosbein.pp.ru) Received: from grosbein.pp.ru (grgw.svzserv.kemerovo.su [213.184.64.166]) by mx1.freebsd.org (Postfix) with ESMTP id A4E8913C465 for ; Thu, 27 Sep 2007 16:44:13 +0000 (UTC) (envelope-from eugen@grosbein.pp.ru) Received: from grosbein.pp.ru (localhost [127.0.0.1]) by grosbein.pp.ru (8.14.1/8.14.1) with ESMTP id l8RGiAg4003546 for ; Fri, 28 Sep 2007 00:44:10 +0800 (KRAST) (envelope-from eugen@grosbein.pp.ru) Received: (from eugen@localhost) by grosbein.pp.ru (8.14.1/8.14.1/Submit) id l8RGiAkR003545 for usb@freebsd.org; Fri, 28 Sep 2007 00:44:10 +0800 (KRAST) (envelope-from eugen) Date: Fri, 28 Sep 2007 00:44:10 +0800 From: Eugene Grosbein To: usb@freebsd.org Message-ID: <20070927164409.GA3519@grosbein.pp.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.2.2i Cc: Subject: Re: usb/91546: [umodem] [patch] Nokia 6630 mobile phone does not 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: Thu, 27 Sep 2007 16:44:16 -0000 Well, I've made some progress. I managed to make umodem attach device so that tty line work: # cu -l cuaU0 -s 115200 Connected AT OK ATI Nokia OK ATI0I1I2I3I4I5I6I7I8I9 Nokia 353672014146061 V 4.40.32 17-04-07 RM-170 (c) Nokia. Nokia E50 2006_wk15.v29 OK But the code is awful in style and I need some time to cleanup it. Eugene From owner-freebsd-usb@FreeBSD.ORG Fri Sep 28 13:25:42 2007 Return-Path: Delivered-To: usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C714E16A417; Fri, 28 Sep 2007 13:25:42 +0000 (UTC) (envelope-from eugen@grosbein.pp.ru) Received: from grosbein.pp.ru (grgw.svzserv.kemerovo.su [213.184.64.166]) by mx1.freebsd.org (Postfix) with ESMTP id 16F5413C44B; Fri, 28 Sep 2007 13:25:40 +0000 (UTC) (envelope-from eugen@grosbein.pp.ru) Received: from grosbein.pp.ru (localhost [127.0.0.1]) by grosbein.pp.ru (8.14.1/8.14.1) with ESMTP id l8SDPWYZ001674; Fri, 28 Sep 2007 21:25:32 +0800 (KRAST) (envelope-from eugen@grosbein.pp.ru) Received: (from eugen@localhost) by grosbein.pp.ru (8.14.1/8.14.1/Submit) id l8SDPVLg001673; Fri, 28 Sep 2007 21:25:31 +0800 (KRAST) (envelope-from eugen) Date: Fri, 28 Sep 2007 21:25:30 +0800 From: Eugene Grosbein To: bug-followup@freebsd.org Message-ID: <20070928132530.GA1634@grosbein.pp.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.2.2i Cc: usb@freebsd.org Subject: Re: usb/91546: [umodem] [patch] Nokia 6630 mobile phone does not 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: Fri, 28 Sep 2007 13:25:42 -0000 Hi! Here is the patch allowing to work with Nokia E50 (and hopefully others) as USB modem through device /dev/cuaU0 or like. This is basically the same code from NetBSD with one addition. The code from NetBSD allows to use UNION interface descriptor instead of CM descriptor but takes the first UNION descriptor it finds. That does not work for modern devices having lots of UNION descriptors, where needed is not first. The code uses umodem_get_desc() function to fine UNION, so I made it restartable with additional parameter. To start search from the beginning, the caller passes NULL, or it may pass the descriptor returned by umodem_get_desc() and it continues the search from the next descriptor. The function umodem_get_caps() obtains additional parameters and one of them is device control interface. It ignores any UNION which master interface is not device control interface and that has not at lease two endpoints (we need bulk in and out). So, it successfully finds needed descriptor in my case, attaches the device and it works. --- sys/dev/usb/umodem.c.orig 2007-09-26 21:22:37.000000000 +0800 +++ sys/dev/usb/umodem.c 2007-09-28 21:01:06.000000000 +0800 @@ -172,13 +172,14 @@ struct task sc_task; }; -Static void *umodem_get_desc(usbd_device_handle dev, int type, int subtype); +Static void *umodem_get_desc(usbd_device_handle dev, usb_descriptor_t *, int type, int subtype); +Static usbd_interface_handle umodem_get_interface(struct usb_attach_arg *uaa, int ifcno); Static usbd_status umodem_set_comm_feature(struct umodem_softc *sc, int feature, int state); Static usbd_status umodem_set_line_coding(struct umodem_softc *sc, usb_cdc_line_state_t *state); -Static void umodem_get_caps(usbd_device_handle, int *, int *); +Static int umodem_get_caps(struct usb_attach_arg *, int, int *, int *); Static void umodem_get_status(void *, int portno, u_char *lsr, u_char *msr); Static void umodem_set(void *, int, int, int); @@ -261,10 +262,7 @@ if (ret == UMATCH_NONE) return (ret); - umodem_get_caps(uaa->device, &cm, &acm); - if (!(cm & USB_CDC_CM_DOES_CM) || - !(cm & USB_CDC_CM_OVER_DATA) || - !(acm & USB_CDC_ACM_HAS_LINE)) + if (umodem_get_caps(uaa, -1, &cm, &acm) == -1) return (UMATCH_NONE); return ret; @@ -276,7 +274,6 @@ usbd_device_handle dev = uaa->device; usb_interface_descriptor_t *id; usb_endpoint_descriptor_t *ed; - usb_cdc_cm_descriptor_t *cmd; char *devinfo = NULL; const char *devname; usbd_status err; @@ -304,15 +301,14 @@ id->bInterfaceClass, id->bInterfaceSubClass); sc->sc_ctl_iface_no = id->bInterfaceNumber; - umodem_get_caps(dev, &sc->sc_cm_cap, &sc->sc_acm_cap); - /* Get the data interface no. */ - cmd = umodem_get_desc(dev, UDESC_CS_INTERFACE, UDESCSUB_CDC_CM); - if (cmd == NULL) { - printf("%s: no CM descriptor\n", devname); + sc->sc_data_iface_no = data_ifcno = + umodem_get_caps(uaa, sc->sc_ctl_iface_no, &sc->sc_cm_cap, &sc->sc_acm_cap); + + if (data_ifcno == -1) { + printf("%s: no pointer to data interface\n", devname); goto bad; } - sc->sc_data_iface_no = data_ifcno = cmd->bDataInterface; printf("%s: data interface %d, has %sCM over data, has %sbreak\n", devname, data_ifcno, @@ -550,27 +546,50 @@ ucom_status_change(&sc->sc_ucom); } -void -umodem_get_caps(usbd_device_handle dev, int *cm, int *acm) +Static int +umodem_get_caps(struct usb_attach_arg *uaa, int ctl_iface_no, int *cm, int *acm) { usb_cdc_cm_descriptor_t *cmd; usb_cdc_acm_descriptor_t *cad; + usb_cdc_union_descriptor_t *cud; + usbd_device_handle dev = uaa->device; + usbd_interface_handle iface; + int iface_no = 0; *cm = *acm = 0; - cmd = umodem_get_desc(dev, UDESC_CS_INTERFACE, UDESCSUB_CDC_CM); + cmd = umodem_get_desc(dev, NULL, UDESC_CS_INTERFACE, UDESCSUB_CDC_CM); if (cmd == NULL) { DPRINTF(("umodem_get_desc: no CM desc\n")); - return; + } else { + *cm = cmd->bmCapabilities; } - *cm = cmd->bmCapabilities; - cad = umodem_get_desc(dev, UDESC_CS_INTERFACE, UDESCSUB_CDC_ACM); + cad = umodem_get_desc(dev, NULL, UDESC_CS_INTERFACE, UDESCSUB_CDC_ACM); if (cad == NULL) { DPRINTF(("umodem_get_desc: no ACM desc\n")); - return; + } else { + *acm = cad->bmCapabilities; + } + + cud = NULL; + while ((cud = umodem_get_desc(dev, (usb_descriptor_t *)cud, + UDESC_CS_INTERFACE, UDESCSUB_CDC_UNION))) + { + iface_no = cud->bSlaveInterface[0]; + if (ctl_iface_no == -1) + break; + + iface = umodem_get_interface(uaa,iface_no); + if (ctl_iface_no == cud->bMasterInterface && + usbd_get_interface_descriptor(iface)->bNumEndpoints >= 2) + break; } - *acm = cad->bmCapabilities; + if (cud == NULL) { + DPRINTF(("umodem_get_caps: no UNION desc\n")); + } + + return cmd ? cmd->bDataInterface : cud ? iface_no : -1; } void @@ -586,6 +605,23 @@ *msr = sc->sc_msr; } +Static usbd_interface_handle +umodem_get_interface(struct usb_attach_arg *uaa, int ifcno) +{ + int i; + usb_interface_descriptor_t *id; + + for (i = 0; i < uaa->nifaces; i++) { + if (uaa->ifaces[i] != NULL) { + id = usbd_get_interface_descriptor(uaa->ifaces[i]); + if (id != NULL && id->bInterfaceNumber == ifcno) { + return uaa->ifaces[i]; + } + } + } + return NULL; +} + int umodem_param(void *addr, int portno, struct termios *t) { @@ -776,14 +812,17 @@ return (USBD_NORMAL_COMPLETION); } -void * -umodem_get_desc(usbd_device_handle dev, int type, int subtype) +Static void * +umodem_get_desc(usbd_device_handle dev, usb_descriptor_t *restart, int type, int subtype) { usb_descriptor_t *desc; usb_config_descriptor_t *cd = usbd_get_config_descriptor(dev); uByte *p = (uByte *)cd; uByte *end = p + UGETW(cd->wTotalLength); + if (restart) + p = (uByte *)(restart) + restart->bLength; + while (p < end) { desc = (usb_descriptor_t *)p; if (desc->bDescriptorType == type && From owner-freebsd-usb@FreeBSD.ORG Fri Sep 28 13:30:08 2007 Return-Path: Delivered-To: freebsd-usb@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4F0DC16A419 for ; Fri, 28 Sep 2007 13:30:08 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 3C2FC13C43E for ; Fri, 28 Sep 2007 13:30:08 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.1/8.14.1) with ESMTP id l8SDU7H4098743 for ; Fri, 28 Sep 2007 13:30:07 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.1/8.14.1/Submit) id l8SDU7oH098742; Fri, 28 Sep 2007 13:30:07 GMT (envelope-from gnats) Date: Fri, 28 Sep 2007 13:30:07 GMT Message-Id: <200709281330.l8SDU7oH098742@freefall.freebsd.org> To: freebsd-usb@FreeBSD.org From: Eugene Grosbein Cc: Subject: Re: usb/91546: [umodem] [patch] Nokia 6630 mobile phone does not work X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Eugene Grosbein List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Sep 2007 13:30:08 -0000 The following reply was made to PR usb/91546; it has been noted by GNATS. From: Eugene Grosbein To: bug-followup@freebsd.org Cc: usb@freebsd.org, "M. Warner Losh" Subject: Re: usb/91546: [umodem] [patch] Nokia 6630 mobile phone does not work Date: Fri, 28 Sep 2007 21:25:30 +0800 Hi! Here is the patch allowing to work with Nokia E50 (and hopefully others) as USB modem through device /dev/cuaU0 or like. This is basically the same code from NetBSD with one addition. The code from NetBSD allows to use UNION interface descriptor instead of CM descriptor but takes the first UNION descriptor it finds. That does not work for modern devices having lots of UNION descriptors, where needed is not first. The code uses umodem_get_desc() function to fine UNION, so I made it restartable with additional parameter. To start search from the beginning, the caller passes NULL, or it may pass the descriptor returned by umodem_get_desc() and it continues the search from the next descriptor. The function umodem_get_caps() obtains additional parameters and one of them is device control interface. It ignores any UNION which master interface is not device control interface and that has not at lease two endpoints (we need bulk in and out). So, it successfully finds needed descriptor in my case, attaches the device and it works. --- sys/dev/usb/umodem.c.orig 2007-09-26 21:22:37.000000000 +0800 +++ sys/dev/usb/umodem.c 2007-09-28 21:01:06.000000000 +0800 @@ -172,13 +172,14 @@ struct task sc_task; }; -Static void *umodem_get_desc(usbd_device_handle dev, int type, int subtype); +Static void *umodem_get_desc(usbd_device_handle dev, usb_descriptor_t *, int type, int subtype); +Static usbd_interface_handle umodem_get_interface(struct usb_attach_arg *uaa, int ifcno); Static usbd_status umodem_set_comm_feature(struct umodem_softc *sc, int feature, int state); Static usbd_status umodem_set_line_coding(struct umodem_softc *sc, usb_cdc_line_state_t *state); -Static void umodem_get_caps(usbd_device_handle, int *, int *); +Static int umodem_get_caps(struct usb_attach_arg *, int, int *, int *); Static void umodem_get_status(void *, int portno, u_char *lsr, u_char *msr); Static void umodem_set(void *, int, int, int); @@ -261,10 +262,7 @@ if (ret == UMATCH_NONE) return (ret); - umodem_get_caps(uaa->device, &cm, &acm); - if (!(cm & USB_CDC_CM_DOES_CM) || - !(cm & USB_CDC_CM_OVER_DATA) || - !(acm & USB_CDC_ACM_HAS_LINE)) + if (umodem_get_caps(uaa, -1, &cm, &acm) == -1) return (UMATCH_NONE); return ret; @@ -276,7 +274,6 @@ usbd_device_handle dev = uaa->device; usb_interface_descriptor_t *id; usb_endpoint_descriptor_t *ed; - usb_cdc_cm_descriptor_t *cmd; char *devinfo = NULL; const char *devname; usbd_status err; @@ -304,15 +301,14 @@ id->bInterfaceClass, id->bInterfaceSubClass); sc->sc_ctl_iface_no = id->bInterfaceNumber; - umodem_get_caps(dev, &sc->sc_cm_cap, &sc->sc_acm_cap); - /* Get the data interface no. */ - cmd = umodem_get_desc(dev, UDESC_CS_INTERFACE, UDESCSUB_CDC_CM); - if (cmd == NULL) { - printf("%s: no CM descriptor\n", devname); + sc->sc_data_iface_no = data_ifcno = + umodem_get_caps(uaa, sc->sc_ctl_iface_no, &sc->sc_cm_cap, &sc->sc_acm_cap); + + if (data_ifcno == -1) { + printf("%s: no pointer to data interface\n", devname); goto bad; } - sc->sc_data_iface_no = data_ifcno = cmd->bDataInterface; printf("%s: data interface %d, has %sCM over data, has %sbreak\n", devname, data_ifcno, @@ -550,27 +546,50 @@ ucom_status_change(&sc->sc_ucom); } -void -umodem_get_caps(usbd_device_handle dev, int *cm, int *acm) +Static int +umodem_get_caps(struct usb_attach_arg *uaa, int ctl_iface_no, int *cm, int *acm) { usb_cdc_cm_descriptor_t *cmd; usb_cdc_acm_descriptor_t *cad; + usb_cdc_union_descriptor_t *cud; + usbd_device_handle dev = uaa->device; + usbd_interface_handle iface; + int iface_no = 0; *cm = *acm = 0; - cmd = umodem_get_desc(dev, UDESC_CS_INTERFACE, UDESCSUB_CDC_CM); + cmd = umodem_get_desc(dev, NULL, UDESC_CS_INTERFACE, UDESCSUB_CDC_CM); if (cmd == NULL) { DPRINTF(("umodem_get_desc: no CM desc\n")); - return; + } else { + *cm = cmd->bmCapabilities; } - *cm = cmd->bmCapabilities; - cad = umodem_get_desc(dev, UDESC_CS_INTERFACE, UDESCSUB_CDC_ACM); + cad = umodem_get_desc(dev, NULL, UDESC_CS_INTERFACE, UDESCSUB_CDC_ACM); if (cad == NULL) { DPRINTF(("umodem_get_desc: no ACM desc\n")); - return; + } else { + *acm = cad->bmCapabilities; + } + + cud = NULL; + while ((cud = umodem_get_desc(dev, (usb_descriptor_t *)cud, + UDESC_CS_INTERFACE, UDESCSUB_CDC_UNION))) + { + iface_no = cud->bSlaveInterface[0]; + if (ctl_iface_no == -1) + break; + + iface = umodem_get_interface(uaa,iface_no); + if (ctl_iface_no == cud->bMasterInterface && + usbd_get_interface_descriptor(iface)->bNumEndpoints >= 2) + break; } - *acm = cad->bmCapabilities; + if (cud == NULL) { + DPRINTF(("umodem_get_caps: no UNION desc\n")); + } + + return cmd ? cmd->bDataInterface : cud ? iface_no : -1; } void @@ -586,6 +605,23 @@ *msr = sc->sc_msr; } +Static usbd_interface_handle +umodem_get_interface(struct usb_attach_arg *uaa, int ifcno) +{ + int i; + usb_interface_descriptor_t *id; + + for (i = 0; i < uaa->nifaces; i++) { + if (uaa->ifaces[i] != NULL) { + id = usbd_get_interface_descriptor(uaa->ifaces[i]); + if (id != NULL && id->bInterfaceNumber == ifcno) { + return uaa->ifaces[i]; + } + } + } + return NULL; +} + int umodem_param(void *addr, int portno, struct termios *t) { @@ -776,14 +812,17 @@ return (USBD_NORMAL_COMPLETION); } -void * -umodem_get_desc(usbd_device_handle dev, int type, int subtype) +Static void * +umodem_get_desc(usbd_device_handle dev, usb_descriptor_t *restart, int type, int subtype) { usb_descriptor_t *desc; usb_config_descriptor_t *cd = usbd_get_config_descriptor(dev); uByte *p = (uByte *)cd; uByte *end = p + UGETW(cd->wTotalLength); + if (restart) + p = (uByte *)(restart) + restart->bLength; + while (p < end) { desc = (usb_descriptor_t *)p; if (desc->bDescriptorType == type && From owner-freebsd-usb@FreeBSD.ORG Fri Sep 28 15:45:38 2007 Return-Path: Delivered-To: freebsd-usb@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9BA4916A46E; Fri, 28 Sep 2007 15:45:38 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 872F613C46A; Fri, 28 Sep 2007 15:45:38 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from freefall.freebsd.org (pjd@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.1/8.14.1) with ESMTP id l8SFjcdc005798; Fri, 28 Sep 2007 15:45:38 GMT (envelope-from pjd@freefall.freebsd.org) Received: (from pjd@localhost) by freefall.freebsd.org (8.14.1/8.14.1/Submit) id l8SFjc8Z005794; Fri, 28 Sep 2007 15:45:38 GMT (envelope-from pjd) Date: Fri, 28 Sep 2007 15:45:38 GMT Message-Id: <200709281545.l8SFjc8Z005794@freefall.freebsd.org> To: freebsd@soulrebel.in-berlin.de, pjd@FreeBSD.org, freebsd-usb@FreeBSD.org, pjd@FreeBSD.org From: pjd@FreeBSD.org Cc: Subject: Re: usb/114938: can't attach eli-devices on external hd 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, 28 Sep 2007 15:45:38 -0000 Synopsis: can't attach eli-devices on external hd State-Changed-From-To: open->feedback State-Changed-By: pjd State-Changed-When: Fri Sep 28 15:40:23 UTC 2007 State-Changed-Why: Can you send me the following? - diskinfo -v /dev/da0 /dev/da0s1f - geli dump /dev/ad0s1f - last sector of /dev/da0s1f You can get the last sector by executing this command: dd if=/dev/da0s1f of=./last.bin count=1 iseek=`diskinfo /dev/da0s1f | awk '{printf "%d\n", $4 - 1}'` Be sure not to initialize da0s1f with any important password/keyfile. Responsible-Changed-From-To: freebsd-usb->pjd Responsible-Changed-By: pjd Responsible-Changed-When: Fri Sep 28 15:40:23 UTC 2007 Responsible-Changed-Why: Can you send me the following? - diskinfo -v /dev/da0 /dev/da0s1f - geli dump /dev/ad0s1f - last sector of /dev/da0s1f You can get the last sector by executing this command: dd if=/dev/da0s1f of=./last.bin count=1 iseek=`diskinfo /dev/da0s1f | awk '{printf "%d\n", $4 - 1}'` Be sure not to initialize da0s1f with any important password/keyfile. http://www.freebsd.org/cgi/query-pr.cgi?pr=114938 From owner-freebsd-usb@FreeBSD.ORG Fri Sep 28 16:07:17 2007 Return-Path: Delivered-To: freebsd-usb@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A61BF16A419 for ; Fri, 28 Sep 2007 16:07:17 +0000 (UTC) (envelope-from olli@lurza.secnetix.de) Received: from lurza.secnetix.de (lurza.secnetix.de [83.120.8.8]) by mx1.freebsd.org (Postfix) with ESMTP id 09A5813C461 for ; Fri, 28 Sep 2007 16:07:16 +0000 (UTC) (envelope-from olli@lurza.secnetix.de) Received: from lurza.secnetix.de (localhost [127.0.0.1]) by lurza.secnetix.de (8.14.1/8.14.1) with ESMTP id l8SG5sMc089972 for ; Fri, 28 Sep 2007 18:06:00 +0200 (CEST) (envelope-from oliver.fromme@secnetix.de) Received: (from olli@localhost) by lurza.secnetix.de (8.14.1/8.14.1/Submit) id l8SG5sCx089971; Fri, 28 Sep 2007 18:05:54 +0200 (CEST) (envelope-from olli) Date: Fri, 28 Sep 2007 18:05:54 +0200 (CEST) Message-Id: <200709281605.l8SG5sCx089971@lurza.secnetix.de> From: Oliver Fromme To: freebsd-usb@FreeBSD.ORG In-Reply-To: <200709211708.l8LH8cpc097171@lurza.secnetix.de> X-Newsgroups: list.freebsd-usb User-Agent: tin/1.8.3-20070201 ("Scotasay") (UNIX) (FreeBSD/6.2-STABLE-20070808 (i386)) MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-2.1.2 (lurza.secnetix.de [127.0.0.1]); Fri, 28 Sep 2007 18:06:00 +0200 (CEST) Cc: Subject: Re: uscanner: HP ScanJet 4300C X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: freebsd-usb@FreeBSD.ORG List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Sep 2007 16:07:17 -0000 Oliver Fromme wrote: > I have bought a HP ScanJet 4300C, specifically because > this very scanner is listed in FreeBSD's uscanner(4) > manpage and in SANE's list of supported USB scanners. > > However, this is all I get: > > uscanner0: on uhub0 > uscanner0: setting config no failed > device_attach: uscanner0 attach returned 6 > uhub0: port 4, set config at addr 2 failed > uhub0: device problem (TIMEOUT), disabling port 4 > > That's on 7-current, but it fails the same way on 6-stable. I've now compiled a kernel with USB_DEBUG, and I also added a few lines of debugging printfs myself. This is what I get: uscanner1: on uhub0 usbd_set_config_no: 1 usbd_get_config_desc: confidx=0 usbd_get_desc: type=2, index=0, len=9 usbd_alloc_xfer() = 0xc3b05200 usbd_transfer: xfer=0xc3b05200, flags=2, pipe=0xc3fda380, running=0 usbd_dump_queue: pipe=0xc3fda380 usb_insert_transfer: pipe=0xc3fda380 running=0 timeout=5000 usb_add_task: task=0xc3b05378 usb_task_thread: woke up task=0xc3b05378 usb_schedsoftintr: polling=0 usb_transfer_complete: pipe=0xc3fda380 xfer=0xc3b05200 status=15 actlen=0 usb_transfer_complete: repeat=0 new head=0 usbd_start_next: pipe=0xc3fda380, xfer=0 usbd_free_xfer: 0xc3b05200 usbd_get_config_desc: usbd_get_desc() --> usbd_status 15 usbd_set_config_no: index 0 --> usbd_status 15 uscanner1: setting config no failed [usbd_status=15] device_attach: uscanner1 attach returned 6 usbd_status 15 is USBD_TIMEOUT. I wanted to run udesc_dump, so I compiled a kernel without uscanner so the device would attach to ugen. However, I get this (after a few seconds): uhub_explore: usb_new_device failed, error=TIMEOUT uhub0: device problem (TIMEOUT), disabling port 2 So I get a timeout again. The problem doesn't seem to be uscanner-related, but more low-level. Any ideas how to proceed? Best regards Oliver PS: I'm pretty sure the scanner is not defective. Also, the USB controller is fine; a flash stick plugged into the same port is working perfectly fine. -- Oliver Fromme, secnetix GmbH & Co. KG, Marktplatz 29, 85567 Grafing b. M. Handelsregister: Registergericht Muenchen, HRA 74606, Geschäftsfuehrung: secnetix Verwaltungsgesellsch. mbH, Handelsregister: Registergericht Mün- chen, HRB 125758, Geschäftsführer: Maik Bachmann, Olaf Erb, Ralf Gebhart FreeBSD-Dienstleistungen, -Produkte und mehr: http://www.secnetix.de/bsd "UNIX was not designed to stop you from doing stupid things, because that would also stop you from doing clever things." -- Doug Gwyn From owner-freebsd-usb@FreeBSD.ORG Fri Sep 28 16:21:00 2007 Return-Path: Delivered-To: freebsd-usb@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C327716A421 for ; Fri, 28 Sep 2007 16:21:00 +0000 (UTC) (envelope-from olli@lurza.secnetix.de) Received: from lurza.secnetix.de (lurza.secnetix.de [83.120.8.8]) by mx1.freebsd.org (Postfix) with ESMTP id 3D39413C4D5 for ; Fri, 28 Sep 2007 16:21:00 +0000 (UTC) (envelope-from olli@lurza.secnetix.de) Received: from lurza.secnetix.de (localhost [127.0.0.1]) by lurza.secnetix.de (8.14.1/8.14.1) with ESMTP id l8SGJZNB090439 for ; Fri, 28 Sep 2007 18:19:40 +0200 (CEST) (envelope-from oliver.fromme@secnetix.de) Received: (from olli@localhost) by lurza.secnetix.de (8.14.1/8.14.1/Submit) id l8SGJZF5090438; Fri, 28 Sep 2007 18:19:35 +0200 (CEST) (envelope-from olli) Date: Fri, 28 Sep 2007 18:19:35 +0200 (CEST) Message-Id: <200709281619.l8SGJZF5090438@lurza.secnetix.de> From: Oliver Fromme To: freebsd-usb@FreeBSD.ORG X-Newsgroups: list.freebsd-usb User-Agent: tin/1.8.3-20070201 ("Scotasay") (UNIX) (FreeBSD/6.2-STABLE-20070808 (i386)) MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-2.1.2 (lurza.secnetix.de [127.0.0.1]); Fri, 28 Sep 2007 18:19:40 +0200 (CEST) Cc: Subject: USB2.0 card recommendation 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, 28 Sep 2007 16:21:00 -0000 Hi, I have an old Pentium-II mainboard with a Celeron processor, and I would like to backup the machine onto external HD. However, the old mainboard only supports USB1.0 which is too slow for that purpose. Therefore I'm looking for a PCI card to teach the machine how to speak USB2.0. Are there any brands that work particularly well with FreeBSD, or models that should be avoided? The card should work reliably and fast. At a shop here there is a card with a VIA chip that costs 5 EUR (~ 3.50 USD). That's suspiciously cheap. Would that card work well with FreeBSD? There's another one with an ALI chip on it, it is 8 EUR (~ 5.70 USD), with otherwise the same specs (4 ext. ports, 1 int. port). There are also more expensive cards which also feature firewire ports, also based on VIA or ALI chips. Any recommendations? Best regards Oliver -- Oliver Fromme, secnetix GmbH & Co. KG, Marktplatz 29, 85567 Grafing b. M. Handelsregister: Registergericht Muenchen, HRA 74606, Geschäftsfuehrung: secnetix Verwaltungsgesellsch. mbH, Handelsregister: Registergericht Mün- chen, HRB 125758, Geschäftsführer: Maik Bachmann, Olaf Erb, Ralf Gebhart FreeBSD-Dienstleistungen, -Produkte und mehr: http://www.secnetix.de/bsd It's trivial to make fun of Microsoft products, but it takes a real man to make them work, and a God to make them do anything useful. From owner-freebsd-usb@FreeBSD.ORG Fri Sep 28 17:01:45 2007 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CA1EA16A417 for ; Fri, 28 Sep 2007 17:01:45 +0000 (UTC) (envelope-from freebsdfan@hotmail.com) Received: from bay0-omc2-s23.bay0.hotmail.com (bay0-omc2-s23.bay0.hotmail.com [65.54.246.159]) by mx1.freebsd.org (Postfix) with ESMTP id AD70513C4B6 for ; Fri, 28 Sep 2007 17:01:45 +0000 (UTC) (envelope-from freebsdfan@hotmail.com) Received: from BAY116-W40 ([64.4.38.140]) by bay0-omc2-s23.bay0.hotmail.com with Microsoft SMTPSVC(6.0.3790.3959); Fri, 28 Sep 2007 10:01:45 -0700 Message-ID: X-Originating-IP: [68.225.241.11] From: Chuck T. To: Date: Fri, 28 Sep 2007 10:01:45 -0700 Importance: Normal MIME-Version: 1.0 X-OriginalArrivalTime: 28 Sep 2007 17:01:45.0555 (UTC) FILETIME=[402DD230:01C801F1] Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Subject: snd_uaudio with libusb ? 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, 28 Sep 2007 17:01:45 -0000 I have a Linux application that talks to an USB audio dongle that I'm tryin= g to port to FreeBSD. I have no problem with the audio portion, but I'm al= so trying to use libusb to access the GPIO bits on the chip. If I don't lo= ad snd_uaudio /dev/ugen shows up and libusb works fine and I can access the= GPIO. However when the sound driver is loaded ugen doesn't bind to the de= vice so libusb can't talk to it. I need simultaneous access to the GPIO an= d audio functions, either or isn't acceptable. The GPIO bits I need are no= t supported by HID so that's not an option. Can anyone suggest a solution?=20 Thanks! _________________________________________________________________ Explore the seven wonders of the world http://search.msn.com/results.aspx?q=3D7+wonders+world&mkt=3Den-US&form=3DQ= BRE= From owner-freebsd-usb@FreeBSD.ORG Sat Sep 29 02:06:08 2007 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CE82D16A418 for ; Sat, 29 Sep 2007 02:06:08 +0000 (UTC) (envelope-from xiaofanc@gmail.com) Received: from wa-out-1112.google.com (wa-out-1112.google.com [209.85.146.183]) by mx1.freebsd.org (Postfix) with ESMTP id 7C91313C474 for ; Sat, 29 Sep 2007 02:06:07 +0000 (UTC) (envelope-from xiaofanc@gmail.com) Received: by wa-out-1112.google.com with SMTP id k17so3822657waf for ; Fri, 28 Sep 2007 19:06:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=hpYFy4B75/FeSH/5FAQwaZrMhaE94yZwJlqWKcmKyUk=; b=GyWl4+5EhKJLka8Tp4OOV4TIaqlh04ZuEN9xECOPvM56kE0A9EZ8kjn0Hgh9kAtCdiOCdMFDuU1OFCTb31aacrCghbpqSZloG6lNOP+YbhnNJjik1oYu4izFzez7gtmzTgRkB81vwwYuTWGPUVb0MjjptSNOcRleiijE3mA58bs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=CfP00MQXd5M6XuDBwKUvWqrWO7bz2CTeV21HX+G4cw1lWw9Fo1e+vOM7IIOcoIcK5dRqtGGomDlGbZJLm/waz7mQdy22zOr0e33AKHSLu6Io/irfK4YhYmAy2aMhe8BsENqDRuxCgYsHzfUPKhzkRxNbxSgYE9g+5IiQTJuVaTo= Received: by 10.114.156.1 with SMTP id d1mr1169183wae.1191031567356; Fri, 28 Sep 2007 19:06:07 -0700 (PDT) Received: by 10.114.176.17 with HTTP; Fri, 28 Sep 2007 19:06:07 -0700 (PDT) Message-ID: Date: Sat, 29 Sep 2007 10:06:07 +0800 From: "Xiaofan Chen" To: "Chuck T." In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: Cc: freebsd-usb@freebsd.org Subject: Re: snd_uaudio with libusb ? 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, 29 Sep 2007 02:06:08 -0000 On 9/29/07, Chuck T. wrote: > > I have a Linux application that talks to an USB audio dongle > that I'm trying to port to FreeBSD. I have no problem with the > audio portion, but I'm also trying to use libusb to access the > GPIO bits on the chip. What is the Linux application? How does the Linux work with the audio and GPIO working at the same time? As far as I know, Linux in libusb needs to unbind the kernel driver using the non-portable usb_detach_kernel_driver_np function in order to have access to the usb device --to set the configuration and claim the interface. I think your device is a USB composite USB device with two interfaces (one for USB audio and the other for GPIO). How do you control the GPIO under Linux (by control transfer or interrupt/bulk transfer)? If the Linux application indeed works at the same time as the USB audio, then Linux does bind different driver to different interfaces (one for the usb audio interface and no driver for the GPIO interface). Ok I am now under FreeBSD and the following is the output from a USB composite device (audio and genric). I have the firmware burnt but I have not built the full USB soundcard. http://home.comcast.net/~armag1234/soundcard.html ===[mcuee] ~/Desktop/build/pyusb-0.4.1/samples # sudo ./usbenum.py Device: /dev/ugen0 Device class: 0 Device sub class: 0 Device protocol: 0 Max packet size: 8 idVendor: 4660 idProduct: 15 Device Version: 00.00 Configuration: 1 Total length: 133 selfPowered: 0 remoteWakeup: 0 maxPower: 200 Interface: 0 Alternate Setting: 0 Interface class: 1 Interface sub class: 1 Interface protocol: 0 Interface: 1 Alternate Setting: 0 Interface class: 1 Interface sub class: 2 Interface protocol: 0 Alternate Setting: 1 Interface class: 1 Interface sub class: 2 Interface protocol: 0 Endpoint: 0x2 Type: 1 Max packet size: 96 Interval: 2 Interface: 2 Alternate Setting: 0 Interface class: 0 Interface sub class: 0 Interface protocol: 0 Endpoint: 0x1 Type: 3 Max packet size: 64 Interval: 1 Endpoint: 0x81 Type: 3 Max packet size: 64 Interval: 1 ===[mcuee] ~ # sudo ls -la /dev/ugen* crw-r--r-- 1 root operator 0, 118 Sep 29 09:18 /dev/ugen0 crw-r--r-- 1 root operator 0, 117 Sep 29 09:18 /dev/ugen0.1 So it seems that ugen only binds the first interface for this USB composite device. Not so sure if there is a method to bind the other interfaces. I am also not so sure if libusb will work in this case. I am not that experienced with FreeBSD USB. Sorry no real help here. A bit strange that this USB soundcard is not recognized under FreeBSD. I am using an old version of HPS USB stack. Xiaofan http://mcuee.blogspot.com From owner-freebsd-usb@FreeBSD.ORG Sat Sep 29 05:47:48 2007 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5C83516A417 for ; Sat, 29 Sep 2007 05:47:48 +0000 (UTC) (envelope-from freebsdfan@hotmail.com) Received: from bay0-omc1-s40.bay0.hotmail.com (bay0-omc1-s40.bay0.hotmail.com [65.54.246.112]) by mx1.freebsd.org (Postfix) with ESMTP id 42CEE13C45D for ; Sat, 29 Sep 2007 05:47:48 +0000 (UTC) (envelope-from freebsdfan@hotmail.com) Received: from BAY116-W24 ([64.4.38.124]) by bay0-omc1-s40.bay0.hotmail.com with Microsoft SMTPSVC(6.0.3790.3959); Fri, 28 Sep 2007 22:47:47 -0700 Message-ID: X-Originating-IP: [68.225.241.11] From: Chuck T. To: Xiaofan Chen Date: Fri, 28 Sep 2007 22:47:47 -0700 Importance: Normal In-Reply-To: References: MIME-Version: 1.0 X-OriginalArrivalTime: 29 Sep 2007 05:47:47.0958 (UTC) FILETIME=[43E7F160:01C8025C] Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: freebsd-usb@freebsd.org Subject: RE: snd_uaudio with libusb ? 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, 29 Sep 2007 05:47:48 -0000 On 9/29/07, Chuck T. wrote: >> >> I have a Linux application that talks to an USB audio dongle >> that I'm trying to port to FreeBSD. I have no problem with the >> audio portion, but I'm also trying to use libusb to access the >> GPIO bits on the chip. >=20 >What is the Linux application? How does the Linux work >with the audio and GPIO working at the same time? As far >as I know, Linux in libusb needs to unbind the kernel driver >using the non-portable usb_detach_kernel_driver_np function >in order to have access to the usb device --to set the >configuration and claim the interface. It's an (as yet unreleased) ham radio VoIP program called thelinkbox. =20 It connects ham radio repeater systems together using the Internet=20 (http:cqinet.sf.net). Eventually it will support multiple radio ports=20 which is the reason for using USB audio dongles rather than audio cards. The GPIO bits are connected to the push to talk (PTT) of the transmitter. Other GPIO bits are used to interface to an DTMF decoder used to send commands to the computer from the radio. =20 >I think your device is a USB composite USB device with two >interfaces (one for USB audio and the other for GPIO). How >do you control the GPIO under Linux (by control transfer >or interrupt/bulk transfer)? If the Linux application indeed >works at the same time as the USB audio, then Linux >does bind different driver to different interfaces (one for >the usb audio interface and no driver for the GPIO interface). I talk to the GPIO bits via vendor specific requests to the control pipe. = =20 I do a usb_open() when my application loads and never close it. When I nee= d to set a GPIO bit I use usb_control_msg(). I've never "looked under the=20 covers" to see why it works, but it does. >=20 >Ok I am now under FreeBSD and the following is the output >from a USB composite device (audio and genric). I have >the firmware burnt but I have not built the full USB soundcard. >http://home.comcast.net/~armag1234/soundcard.html >=20 >=3D=3D=3D[mcuee] ~/Desktop/build/pyusb-0.4.1/samples # sudo ./usbenum.py >Device: /dev/ugen0 > Device class: 0 > Device sub class: 0 > Device protocol: 0 > Max packet size: 8 > idVendor: 4660 > idProduct: 15 > Device Version: 00.00 > Configuration: 1 > Total length: 133 > selfPowered: 0 > remoteWakeup: 0 > maxPower: 200 > Interface: 0 > Alternate Setting: 0 > Interface class: 1 > Interface sub class: 1 > Interface protocol: 0 > Interface: 1 > Alternate Setting: 0 > Interface class: 1 > Interface sub class: 2 > Interface protocol: 0 > Alternate Setting: 1 > Interface class: 1 > Interface sub class: 2 > Interface protocol: 0 > Endpoint: 0x2 > Type: 1 > Max packet size: 96 > Interval: 2 > Interface: 2 > Alternate Setting: 0 > Interface class: 0 > Interface sub class: 0 > Interface protocol: 0 > Endpoint: 0x1 > Type: 3 > Max packet size: 64 > Interval: 1 > Endpoint: 0x81 > Type: 3 > Max packet size: 64 > Interval: 1 >=20 >=3D=3D=3D[mcuee] ~ # sudo ls -la /dev/ugen* >crw-r--r-- 1 root operator 0, 118 Sep 29 09:18 /dev/ugen0 >crw-r--r-- 1 root operator 0, 117 Sep 29 09:18 /dev/ugen0.1 >=20 >So it seems that ugen only binds the first interface for this >USB composite device. Not so sure if there is a method to >bind the other interfaces. I am also not so sure if libusb >will work in this case. I am not that experienced with >FreeBSD USB. Sorry no real help here. Thanks for responding anyway! _________________________________________________________________ Discover the new Windows Vista http://search.msn.com/results.aspx?q=3Dwindows+vista&mkt=3Den-US&form=3DQBR= E= From owner-freebsd-usb@FreeBSD.ORG Sat Sep 29 07:17:51 2007 Return-Path: Delivered-To: freebsd-usb@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A70D716A41B; Sat, 29 Sep 2007 07:17:51 +0000 (UTC) (envelope-from stefan@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 7C33E13C44B; Sat, 29 Sep 2007 07:17:51 +0000 (UTC) (envelope-from stefan@FreeBSD.org) Received: from freefall.freebsd.org (stefan@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.1/8.14.1) with ESMTP id l8T7Hpwe063523; Sat, 29 Sep 2007 07:17:51 GMT (envelope-from stefan@freefall.freebsd.org) Received: (from stefan@localhost) by freefall.freebsd.org (8.14.1/8.14.1/Submit) id l8T7Hpme063519; Sat, 29 Sep 2007 07:17:51 GMT (envelope-from stefan) Date: Sat, 29 Sep 2007 07:17:51 GMT Message-Id: <200709290717.l8T7Hpme063519@freefall.freebsd.org> To: jonathan.heaney@blueyonder.co.uk, stefan@FreeBSD.org, freebsd-usb@FreeBSD.org From: stefan@FreeBSD.org Cc: Subject: Re: usb/62088: [usb] Logitech Cordless/Optical Mouse not working 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, 29 Sep 2007 07:17:51 -0000 Synopsis: [usb] Logitech Cordless/Optical Mouse not working State-Changed-From-To: open->closed State-Changed-By: stefan State-Changed-When: Sat Sep 29 07:17:23 UTC 2007 State-Changed-Why: The problem is considered to be fixed. http://www.freebsd.org/cgi/query-pr.cgi?pr=62088 From owner-freebsd-usb@FreeBSD.ORG Sat Sep 29 09:13:06 2007 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C7CAF16A417 for ; Sat, 29 Sep 2007 09:13:06 +0000 (UTC) (envelope-from xiaofanc@gmail.com) Received: from wa-out-1112.google.com (wa-out-1112.google.com [209.85.146.178]) by mx1.freebsd.org (Postfix) with ESMTP id A2EB713C43E for ; Sat, 29 Sep 2007 09:13:06 +0000 (UTC) (envelope-from xiaofanc@gmail.com) Received: by wa-out-1112.google.com with SMTP id k17so3919220waf for ; Sat, 29 Sep 2007 02:13:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=IoNLV24Fgk8OBCfIaPaeeYfWxJp337XB0DlM/0vZtU8=; b=t3VX0GRKuZzbNior98PHWATx8l10u3nYpPhxFXd6v1SYquoZnhV9hZYmlbG+nIyaUe7UMSdDmAls+yeO/o08s8pzoySPwW0DmxV0Z6/qVgHwTKj1FQdQ2vAMgAcKMB1+8eRRTvKuPFJ5jaPbABL3ZpUm7RuTb0uKX0g5BZkwYQk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=FxSkVKX9eUK60u2XaGJi/eGE1nOSFL7szqQA3BcJ6DPvMap8gu3gE3pYgM3wwYDcb73Zu/CfzjpstR8gJtUuVPaMLTGNfznkAZRSWgaDNDr5m+3ZLh+Atc0S2pd4ubhlx58y2kTh+FAtDtn7S9Yjx2y+S/Bj8F1DDpag3vykdU4= Received: by 10.114.157.1 with SMTP id f1mr781922wae.1191057186060; Sat, 29 Sep 2007 02:13:06 -0700 (PDT) Received: by 10.114.176.17 with HTTP; Sat, 29 Sep 2007 02:13:06 -0700 (PDT) Message-ID: Date: Sat, 29 Sep 2007 17:13:06 +0800 From: "Xiaofan Chen" To: "Chuck T." In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: Cc: freebsd-usb@freebsd.org Subject: Re: snd_uaudio with libusb ? 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, 29 Sep 2007 09:13:06 -0000 On 9/29/07, Chuck T. wrote: > > >I think your device is a USB composite USB device with two > >interfaces (one for USB audio and the other for GPIO). How > >do you control the GPIO under Linux (by control transfer > >or interrupt/bulk transfer)? If the Linux application indeed > >works at the same time as the USB audio, then Linux > >does bind different driver to different interfaces (one for > >the usb audio interface and no driver for the GPIO interface). > > I talk to the GPIO bits via vendor specific requests to the control pipe. > I do a usb_open() when my application loads and never close it. When I need > to set a GPIO bit I use usb_control_msg(). I've never "looked under the > covers" to see why it works, but it does. > So this works under Linux but not FreeBSD. Maybe this is just a limitation of libusb under FreeBSD. Anyway, it is said that libusb is just a thin wrapper on top of USB. You may want to use the lower level api instead. I confess I do not know further (like how to bind ugen to individual interfaces and use IOCTL to perform usb transfer). But if post some codes, others may be able to help you. Xiaofan From owner-freebsd-usb@FreeBSD.ORG Sat Sep 29 09:27:18 2007 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DE38E16A417 for ; Sat, 29 Sep 2007 09:27:18 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 9FA0913C455 for ; Sat, 29 Sep 2007 09:27:18 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.1/8.13.4) with ESMTP id l8T9OqH5031934; Sat, 29 Sep 2007 03:24:52 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Sat, 29 Sep 2007 03:24:55 -0600 (MDT) Message-Id: <20070929.032455.-713548378.imp@bsdimp.com> To: xiaofanc@gmail.com From: "M. Warner Losh" In-Reply-To: References: X-Mailer: Mew version 5.2 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-2.0 (harmony.bsdimp.com [127.0.0.1]); Sat, 29 Sep 2007 03:24:52 -0600 (MDT) Cc: freebsd-usb@freebsd.org Subject: Re: snd_uaudio with libusb ? 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, 29 Sep 2007 09:27:18 -0000 In message: "Xiaofan Chen" writes: : On 9/29/07, Chuck T. wrote: : > : > >I think your device is a USB composite USB device with two : > >interfaces (one for USB audio and the other for GPIO). How : > >do you control the GPIO under Linux (by control transfer : > >or interrupt/bulk transfer)? If the Linux application indeed : > >works at the same time as the USB audio, then Linux : > >does bind different driver to different interfaces (one for : > >the usb audio interface and no driver for the GPIO interface). : > : > I talk to the GPIO bits via vendor specific requests to the control pipe. : > I do a usb_open() when my application loads and never close it. When I need : > to set a GPIO bit I use usb_control_msg(). I've never "looked under the : > covers" to see why it works, but it does. : > : : So this works under Linux but not FreeBSD. Maybe this is just a limitation : of libusb under FreeBSD. Anyway, it is said that libusb is just a thin : wrapper on top of USB. You may want to use the lower level api instead. : : I confess I do not know further (like how to bind ugen to individual interfaces : and use IOCTL to perform usb transfer). But if post some codes, : others may be able to help you. You can only do a subset of the ugen operations with /dev/usb, but maybe it would be enough. I believe that the control messages are on the list of things that you can do, however... Warner From owner-freebsd-usb@FreeBSD.ORG Sat Sep 29 11:23:37 2007 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 92D4016A417 for ; Sat, 29 Sep 2007 11:23:37 +0000 (UTC) (envelope-from konatac@gmail.com) Received: from ug-out-1314.google.com (ug-out-1314.google.com [66.249.92.171]) by mx1.freebsd.org (Postfix) with ESMTP id 2B8E513C455 for ; Sat, 29 Sep 2007 11:23:36 +0000 (UTC) (envelope-from konatac@gmail.com) Received: by ug-out-1314.google.com with SMTP id a2so1890520ugf for ; Sat, 29 Sep 2007 04:23:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:mime-version:content-type; bh=nqr9zHodYP8/87fuqSCbmIbXgkMOo5WjxsiaFP9/mcM=; b=LJgqnoz8vxd5M8rlnqGCuAjXdFoLvWpN47sCGterm1ta2R6Ro5D8+/qdgAf6c/Exr0l6pYiW45IlhTh+IqwJmomTewrXZanlIFHpNaEop4WlMpDrMIS0rqn8GYXdJ27P36umAxdoGw67tKRlArJgGK7PfP9LwsKIEj51w2Q8sZU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:mime-version:content-type; b=NFhEURA2NBqu3MlDQRkVWNTReXGrNFj94pl9PRRGKLsF81qEIkkAZ9XAK6dJGghY8xoB06Y9NS33syatObreMtECJDDQXuJZP0xsxsep1lypf5QsuisXuyKrwxrKzgyZClOdAmPTkwBlBm9k/C+e7JBiHBLv6TsPE1idRT6yiHM= Received: by 10.67.26.7 with SMTP id d7mr6260573ugj.1191063449422; Sat, 29 Sep 2007 03:57:29 -0700 (PDT) Received: by 10.66.251.9 with HTTP; Sat, 29 Sep 2007 03:57:29 -0700 (PDT) Message-ID: <1e675500709290357n7d4d221lb07f77c7e4c56663@mail.gmail.com> Date: Sat, 29 Sep 2007 04:57:29 -0600 From: "KONATA CARTER" To: freebsd-usb@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Subject: i need motorolaa41x/v32x drver 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, 29 Sep 2007 11:23:37 -0000 motorolaa41x/v32x drver anyone have this driver From owner-freebsd-usb@FreeBSD.ORG Sat Sep 29 14:42:04 2007 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3D23816A417 for ; Sat, 29 Sep 2007 14:42:04 +0000 (UTC) (envelope-from freebsdfan@hotmail.com) Received: from bay0-omc1-s39.bay0.hotmail.com (bay0-omc1-s39.bay0.hotmail.com [65.54.246.111]) by mx1.freebsd.org (Postfix) with ESMTP id 2265E13C455 for ; Sat, 29 Sep 2007 14:42:04 +0000 (UTC) (envelope-from freebsdfan@hotmail.com) Received: from BAY116-W34 ([64.4.38.134]) by bay0-omc1-s39.bay0.hotmail.com with Microsoft SMTPSVC(6.0.3790.3959); Sat, 29 Sep 2007 07:42:04 -0700 Message-ID: X-Originating-IP: [68.225.241.11] From: Chuck T. To: Xiaofan Chen Date: Sat, 29 Sep 2007 07:42:03 -0700 Importance: Normal In-Reply-To: References: MIME-Version: 1.0 X-OriginalArrivalTime: 29 Sep 2007 14:42:04.0139 (UTC) FILETIME=[E6E0FBB0:01C802A6] Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: freebsd-usb@freebsd.org Subject: RE: snd_uaudio with libusb ? 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, 29 Sep 2007 14:42:04 -0000 > On 9/29/07, Chuck T. wrote: > > > > >I think your device is a USB composite USB device with two > > >interfaces (one for USB audio and the other for GPIO). How > > >do you control the GPIO under Linux (by control transfer > > >or interrupt/bulk transfer)? If the Linux application indeed > > >works at the same time as the USB audio, then Linux > > >does bind different driver to different interfaces (one for > > >the usb audio interface and no driver for the GPIO interface). > > > > I talk to the GPIO bits via vendor specific requests to the control pip= e. > > I do a usb_open() when my application loads and never close it. When I= need > > to set a GPIO bit I use usb_control_msg(). I've never "looked under th= e > > covers" to see why it works, but it does. > > >=20 > So this works under Linux but not FreeBSD. Maybe this is just a limitatio= n > of libusb under FreeBSD. Anyway, it is said that libusb is just a thin > wrapper on top of USB. You may want to use the lower level api instead. Yes I believe that is the case. I'm hoping there is a simple fix that will= allow me to use libusb for OS portability. I don't want to have to write OS spec= ific code if I can avoid it. I've been using FreeBSD since the 1.0 and I really want my app to run on FreeBSD but frankly 90% of the users will probably be running on Linux anyway. > I confess I do not know further (like how to bind ugen to individual inte= rfaces > and use IOCTL to perform usb transfer). But if post some codes, > others may be able to help you. Sure. I doubt it will help as the problem is related to libusb but here's = my code: static usb_dev_handle *udev =3D NULL; void UsbKeyRadio(int bKey) { int ret; char Buf[2] =3D {0xff,0xff}; if(bKey) { // Set PTT bit low Buf[0] =3D 0; } else { // Set PTT bit high Buf[0] =3D 0x20; } ret =3D usb_control_msg(udev,USB_TYPE_VENDOR,WRITE_GPIO,0,0,Buf,2,1000); if(ret !=3D 2) { LOG_ERROR(("%s#%d: usb_control_msg returned %d (%s)\n",__FUNCTION__, __LINE__,ret,Err2String(errno))); } } int UsbInit(void) { struct usb_bus *bus; struct usb_device *dev =3D NULL; int Ret =3D ERR_USB_DEV_OPEN; // assume the worse usb_init(); usb_find_busses(); usb_find_devices(); for (bus =3D usb_busses; bus && dev =3D=3D NULL; bus =3D bus->next) { for (dev =3D bus->devices; dev; dev =3D dev->next) { if(dev->descriptor.idVendor =3D=3D 0x074d &&=20 dev->descriptor.idProduct =3D=3D 0x3556) { break; } else if(dev->descriptor.idVendor =3D=3D 0x077d &&=20 dev->descriptor.idProduct =3D=3D 0x07af) { break; } } } if(dev !=3D NULL) { if((udev =3D usb_open(dev)) !=3D NULL) { Ret =3D 0; } } else { LOG_ERROR(("%s: USB device not found\n",__FUNCTION__)); } return Ret; } _________________________________________________________________ Discover the new Windows Vista http://search.msn.com/results.aspx?q=3Dwindows+vista&mkt=3Den-US&form=3DQBR= E= From owner-freebsd-usb@FreeBSD.ORG Sat Sep 29 14:42:16 2007 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4674816A4C5 for ; Sat, 29 Sep 2007 14:42:16 +0000 (UTC) (envelope-from freebsdfan@hotmail.com) Received: from bay0-omc1-s10.bay0.hotmail.com (bay0-omc1-s10.bay0.hotmail.com [65.54.246.82]) by mx1.freebsd.org (Postfix) with ESMTP id 2CBD313C447 for ; Sat, 29 Sep 2007 14:42:16 +0000 (UTC) (envelope-from freebsdfan@hotmail.com) Received: from BAY116-W36 ([64.4.38.136]) by bay0-omc1-s10.bay0.hotmail.com with Microsoft SMTPSVC(6.0.3790.3959); Sat, 29 Sep 2007 07:42:16 -0700 Message-ID: X-Originating-IP: [68.225.241.11] From: Chuck T. To: Xiaofan Chen Date: Sat, 29 Sep 2007 07:42:16 -0700 Importance: Normal In-Reply-To: References: MIME-Version: 1.0 X-OriginalArrivalTime: 29 Sep 2007 14:42:16.0290 (UTC) FILETIME=[EE1F1420:01C802A6] Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: freebsd-usb@freebsd.org Subject: RE: snd_uaudio with libusb ? 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, 29 Sep 2007 14:42:16 -0000 > On 9/29/07, Chuck T. wrote: > > > > >I think your device is a USB composite USB device with two > > >interfaces (one for USB audio and the other for GPIO). How > > >do you control the GPIO under Linux (by control transfer > > >or interrupt/bulk transfer)? If the Linux application indeed > > >works at the same time as the USB audio, then Linux > > >does bind different driver to different interfaces (one for > > >the usb audio interface and no driver for the GPIO interface). > > > > I talk to the GPIO bits via vendor specific requests to the control pip= e. > > I do a usb_open() when my application loads and never close it. When I= need > > to set a GPIO bit I use usb_control_msg(). I've never "looked under th= e > > covers" to see why it works, but it does. > > >=20 > So this works under Linux but not FreeBSD. Maybe this is just a limitatio= n > of libusb under FreeBSD. Anyway, it is said that libusb is just a thin > wrapper on top of USB. You may want to use the lower level api instead. Yes I believe that is the case. I'm hoping there is a simple fix that will= allow me to use libusb for OS portability. I don't want to have to write OS spec= ific code if I can avoid it. I've been using FreeBSD since the 1.0 and I really want my app to run on FreeBSD but frankly 90% of the users will probably be running on Linux anyway. > I confess I do not know further (like how to bind ugen to individual inte= rfaces > and use IOCTL to perform usb transfer). But if post some codes, > others may be able to help you. Sure. I doubt it will help as the problem is related to libusb but here's = my code: static usb_dev_handle *udev =3D NULL; void UsbKeyRadio(int bKey) { int ret; char Buf[2] =3D {0xff,0xff}; if(bKey) { // Set PTT bit low Buf[0] =3D 0; } else { // Set PTT bit high Buf[0] =3D 0x20; } ret =3D usb_control_msg(udev,USB_TYPE_VENDOR,WRITE_GPIO,0,0,Buf,2,1000); if(ret !=3D 2) { LOG_ERROR(("%s#%d: usb_control_msg returned %d (%s)\n",__FUNCTION__, __LINE__,ret,Err2String(errno))); } } int UsbInit(void) { struct usb_bus *bus; struct usb_device *dev =3D NULL; int Ret =3D ERR_USB_DEV_OPEN; // assume the worse usb_init(); usb_find_busses(); usb_find_devices(); for (bus =3D usb_busses; bus && dev =3D=3D NULL; bus =3D bus->next) { for (dev =3D bus->devices; dev; dev =3D dev->next) { if(dev->descriptor.idVendor =3D=3D 0x074d &&=20 dev->descriptor.idProduct =3D=3D 0x3556) { break; } else if(dev->descriptor.idVendor =3D=3D 0x077d &&=20 dev->descriptor.idProduct =3D=3D 0x07af) { break; } } } if(dev !=3D NULL) { if((udev =3D usb_open(dev)) !=3D NULL) { Ret =3D 0; } } else { LOG_ERROR(("%s: USB device not found\n",__FUNCTION__)); } return Ret; } _________________________________________________________________ Connect to the next generation of MSN Messenger=A0 http://imagine-msn.com/messenger/launch80/default.aspx?locale=3Den-us&sourc= e=3Dwlmailtagline= From owner-freebsd-usb@FreeBSD.ORG Sat Sep 29 15:06:46 2007 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0353716A418 for ; Sat, 29 Sep 2007 15:06:46 +0000 (UTC) (envelope-from xiaofanc@gmail.com) Received: from nz-out-0506.google.com (nz-out-0506.google.com [64.233.162.232]) by mx1.freebsd.org (Postfix) with ESMTP id AC67513C44B for ; Sat, 29 Sep 2007 15:06:45 +0000 (UTC) (envelope-from xiaofanc@gmail.com) Received: by nz-out-0506.google.com with SMTP id l8so1998673nzf for ; Sat, 29 Sep 2007 08:06:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=S+WyEknQLlliwI7U3IQuOKiNoJNiVFSAHJHH4QkflC8=; b=TuA0BrgThXn88S2X8kBNd+Z6ACPVObXQ/BDwuR+QGad28oxj8jC4/48UTPIBaAy5vizPHlr87ebi6zZdOid5z6A4sLmn735fpGC6Bsiy8MkdlzZ11DAGkhw6luo0842nh71I+vkfZwDf4a33Yi3hAkJw14yZY9wn9kDJX06GE30= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=jMpFxIyhyrsstlkzQfnNsNKcQN4R0ElJ/ZpkIY8+sGtycGN03+8NFqCejizrvbxW6vs9B0sATB5fTvv34wbuZUKJbwX5PoH8tckT0M+ImVnaAa+Xt25gaxmYeO7r04SIQdIjRUQq7KIrmVgKL8xPj6okkHiXRGk00RmrTe8p5Y8= Received: by 10.115.77.1 with SMTP id e1mr1542351wal.1191078400575; Sat, 29 Sep 2007 08:06:40 -0700 (PDT) Received: by 10.114.176.17 with HTTP; Sat, 29 Sep 2007 08:06:40 -0700 (PDT) Message-ID: Date: Sat, 29 Sep 2007 23:06:40 +0800 From: "Xiaofan Chen" To: "Chuck T." In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: Cc: freebsd-usb@freebsd.org Subject: Re: snd_uaudio with libusb ? 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, 29 Sep 2007 15:06:46 -0000 On 9/29/07, Chuck T. wrote: > if(dev != NULL) { > if((udev = usb_open(dev)) != NULL) { > Ret = 0; > } Hmm, you do not set USB configurations. I know this might be good for Linux but this will not work under Windows. Not so sure about FreeBSD. I have tested some codes under Linux/Windows and I will do the tests for FreeBSD. I already tested pk2 and Piklab for PICkit 2 under FreeBSD with the help from people here. I always set configurations and calim interfaces (interrupt transfer for PICKit 2 -- HID device). http://forum.microchip.com/tm.aspx?m=106426 Not so sure about control transfer. I think you do not need to claim the interface. Regards, Xiaofan From owner-freebsd-usb@FreeBSD.ORG Sat Sep 29 21:12:31 2007 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 481B516A420 for ; Sat, 29 Sep 2007 21:12:31 +0000 (UTC) (envelope-from thumpper8@comcast.net) Received: from rwcrmhc15.comcast.net (rwcrmhc15.comcast.net [216.148.227.155]) by mx1.freebsd.org (Postfix) with ESMTP id 36FE213C4B9 for ; Sat, 29 Sep 2007 21:12:31 +0000 (UTC) (envelope-from thumpper8@comcast.net) Received: from [192.168.1.102] (c-71-205-1-133.hsd1.mi.comcast.net[71.205.1.133]) by comcast.net (rwcrmhc15) with ESMTP id <20070929210228m1500c69vpe>; Sat, 29 Sep 2007 21:02:28 +0000 Message-ID: <46FEBD62.60903@comcast.net> Date: Sat, 29 Sep 2007 17:02:26 -0400 From: thumpper8 User-Agent: Thunderbird 2.0.0.5 (Windows/20070716) MIME-Version: 1.0 To: freebsd-usb@freebsd.org Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Belkin PS/2 to USB converter, Not Pointing 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, 29 Sep 2007 21:12:31 -0000 I was just wondering if you got the trackman fx to work. I now have the same problem. Adam