From owner-freebsd-hackers@FreeBSD.ORG Thu Dec 8 15:57:07 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E23D5106567A for ; Thu, 8 Dec 2011 15:57:07 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe06.c2i.net [212.247.154.162]) by mx1.freebsd.org (Postfix) with ESMTP id 6AC548FC18 for ; Thu, 8 Dec 2011 15:57:06 +0000 (UTC) X-T2-Spam-Status: No, hits=-0.2 required=5.0 tests=ALL_TRUSTED, BAYES_50 Received: from [188.126.198.129] (account mc467741@c2i.net HELO laptop002.hselasky.homeunix.org) by mailfe06.swip.net (CommuniGate Pro SMTP 5.4.2) with ESMTPA id 213190603; Thu, 08 Dec 2011 16:57:05 +0100 From: Hans Petter Selasky To: freebsd-hackers@freebsd.org Date: Thu, 8 Dec 2011 16:54:31 +0100 User-Agent: KMail/1.13.5 (FreeBSD/8.2-STABLE; KDE/4.4.5; amd64; ; ) References: <201112081539.11014.hselasky@c2i.net> In-Reply-To: X-Face: *nPdTl_}RuAI6^PVpA02T?$%Xa^>@hE0uyUIoiha$pC:9TVgl.Oq, NwSZ4V"|LR.+tj}g5 %V,x^qOs~mnU3]Gn; cQLv&.N>TrxmSFf+p6(30a/{)KUU!s}w\IhQBj}[g}bj0I3^glmC( :AuzV9:.hESm-x4h240C`9=w MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201112081654.31641.hselasky@c2i.net> Cc: Lorenzo Cogotti Subject: Re: USB Texas Instruments CDCE modem not recognized by cdce X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Dec 2011 15:57:08 -0000 On Thursday 08 December 2011 16:35:47 Lorenzo Cogotti wrote: > Il giorno gio, 08/12/2011 alle 15.39 +0100, Hans Petter Selasky ha > > scritto: > > Typically you need to select configuration 1 for dual RNDIS/CDCE devices > > to work. > > > > 1) Locate your device: > > > > usbconfig > > > > 2) Set config 1 > > > > usbconfig -d X.Y set_config 1 > > > > To permanently do this, you can set the configuration index 1 quirk for > > your device. > > I tried editing if_cdce.c adding to the static array mentioned in my > first mail: > > {USB_VPI(USB_VENDOR_TI, 0x6060, 0)}, > > obviously if this edit is necessary, a nice good little #define for > 0x6060 should be added where appropriate. > > The device get detected and properly claimed by the cdce module. > It is all good unless I actually try to connect with: > dhclient ue0 > > When I try this, the DHCP request just hangs and times out. > > I tried usbconfig -d 0.2 set_config 1 > This produces: > > cdce0: at uhub0, port 3, addr 2 (disconnected) > cdce0: on usbus0 > ue0: on cdce0 > ue0: Ethernet address: 00:e1:a7:76:76:81 > cdce1: on usbus0 > cdce1: No valid alternate setting found > device_attach: cdce1 attach returned 6 > cdce1: on usbus0 > cdce1: No valid alternate setting found > device_attach: cdce1 attach returned 6 > > Despite this moltitude of scary messages, dhclient now works good and I > can surf with my USB modem on FreeBSD, which is as awesome as it sounds. > Hi, > So, the questions now are: > 1) was the if_cdce.c edit necessary, or the usbconfig is more than > enough? The usbconfig is more than enough. > 2) how/should could this stuff be made in an automagic way by FreeBSD? > Since everything I have on this desktop has been detected flawlessly, > this was the only thing that made me suffer. The easiest way would be to create a devd config file: cat << EOF > /usr/local/etc/devd/myusbdevice.conf notify 100 { match "system" "USB"; match "subsystem" "DEVICE"; match "type" "ATTACH"; match "vendor" "0x0000"; match "product" "0x0000"; action "usbconfig -d $cdev set_config 1" }; EOF /etc/rc.d/devd restart The "vendor" is idVendor and "product" is idProduct. See output from this command: usbconfig -d X.Y dump_device_desc --HPS