From owner-freebsd-usb@freebsd.org Sun Oct 1 21:07:20 2017 Return-Path: Delivered-To: freebsd-usb@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E9BD9E2EA2F for ; Sun, 1 Oct 2017 21:07:20 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from nov-007-i577.relay.mailchannels.net (nov-007-i577.relay.mailchannels.net [46.232.183.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 87F2A6F426 for ; Sun, 1 Oct 2017 21:07:18 +0000 (UTC) (envelope-from ian@freebsd.org) X-Sender-Id: _forwarded-from|73.78.92.27 Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id D23B27C945D for ; Sun, 1 Oct 2017 20:59:27 +0000 (UTC) Received: from outbound1a.eu.mailhop.org (unknown [100.96.146.253]) (Authenticated sender: duocircle) by relay.mailchannels.net (Postfix) with ESMTPA id 3E7CE7C958D for ; Sun, 1 Oct 2017 20:59:27 +0000 (UTC) X-Sender-Id: _forwarded-from|73.78.92.27 Received: from outbound1a.eu.mailhop.org (outbound1a.eu.mailhop.org [172.20.107.195]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384) by 0.0.0.0:2500 (trex/5.9.14); Sun, 01 Oct 2017 20:59:27 +0000 X-MC-Relay: Forwarding X-MailChannels-SenderId: _forwarded-from|73.78.92.27 X-MailChannels-Auth-Id: duocircle X-Absorbed-Cold: 27a36056093f6961_1506891567690_1847463218 X-MC-Loop-Signature: 1506891567690:1191600439 X-MC-Ingress-Time: 1506891567690 X-MHO-User: 65d9b828-a6eb-11e7-a893-25625093991c X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 73.78.92.27 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [73.78.92.27]) by outbound1.eu.mailhop.org (Halon) with ESMTPSA id 65d9b828-a6eb-11e7-a893-25625093991c; Sun, 01 Oct 2017 20:59:22 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id v91KxJqE001826; Sun, 1 Oct 2017 14:59:19 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <1506891559.22078.50.camel@freebsd.org> Subject: Re: USB/U3G: Added support for Panasonic CF-F9 GOBI 3G modem to U3G module From: Ian Lepore To: Tomasz CEDRO , Hans Petter Selasky Cc: "freebsd-usb@FreeBSD.org" Date: Sun, 01 Oct 2017 14:59:19 -0600 In-Reply-To: References: <1506465459.73082.168.camel@freebsd.org> <165556bc-c011-bebd-feee-5bbd4cb5943e@selasky.org> <1506876055.22078.24.camel@freebsd.org> <87d62aba-0b35-8b20-cf1f-9fd2de2d301a@selasky.org> <1506882193.22078.32.camel@freebsd.org> <1506886709.22078.43.camel@freebsd.org> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.18.5.1 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Oct 2017 21:07:21 -0000 On Sun, 2017-10-01 at 22:20 +0200, Tomasz CEDRO wrote: > On Sun, Oct 1, 2017 at 9:38 PM, Ian Lepore wrote: > >=20 > > On Sun, 2017-10-01 at 20:59 +0200, Tomasz CEDRO wrote: > > >=20 > > > On Sun, Oct 1, 2017 at 8:23 PM, Ian Lepore > > > wrote: > > > >=20 > > > >=20 > > > > On Sun, 2017-10-01 at 20:17 +0200, Tomasz CEDRO wrote: > > > > >=20 > > > > >=20 > > > > > [...old stuff...] > > > I have verified on uath device (more on that below) and it turns > > > out > > > $cdev works fine.. but it returns /dev/usb/X.Y.Z not the > > > /dev/cuaU0 > > > which does not work with this "gobi_loader" utility which > > > requires > > > /dev/cuaU0 (CDC / serial port device)... any clues how to replace > > > $cdev with cuaUX? :-) > > >=20 > > > Regarding the UATH, I have TP-LINK TL-WN822N Ver2.0 based on > > > Atheros > > > 9002[1] and it seems to work with modified /dev/devd/uath.conf > > > but > > > the > > > uathload returns "Operation not permitted" when executed as root > > > and > > > during boot.. > > >=20 > > > [1] https://wikidevi.com/wiki/TP-LINK_TL-WN822N_v2 > > >=20 > > Hmmm.=A0=A0I think we need to key off the tty 'attach' event instead = of > > the > > devfs 'create' event.=A0=A0The tty attach for a usb device is the one > > event > > that has all the info we need in one message.=A0=A0This is assuming t= he > > device name in dmesg on attach is u3g0 or u3g1 or whatever. > >=20 > > attach 100 { > > =A0=A0=A0=A0=A0=A0=A0=A0device-name=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0"(u3g)[0-9]+"; > > =A0=A0=A0=A0=A0=A0=A0=A0match "vendor"=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0"= 0x04da"; > > =A0=A0=A0=A0=A0=A0=A0=A0match "product"=A0=A0=A0=A0=A0=A0=A0=A0=A0"0x= 250e"; > > =A0=A0=A0=A0=A0=A0=A0=A0action "/usr/local/bin/gobi_loader /dev/cua$t= tyname > > /boot/firmware/gobi/"; > > }; > >=20 > > The way I arrived at this conclusion was to first look in the devd > > source to figure out/remind myself that devd creates variables from > > all > > the tag=3Dvalue tuples it finds in the events coming from the kernel. > > =A0Then I connected to devd using netcat so I could watch the events > > as > > they happen: > >=20 > > =A0 nc -U /var/run/devd.pipe > >=20 > > then I plugged in a usb-serial adapter (I have no u3g stuff), which > > creates a whole lot of events.=A0=A0The last one was the tty attach: > >=20 > > +uplcom0 at bus=3D1 hubaddr=3D1 port=3D1 devaddr=3D2 interface=3D0 > > ugen=3Dugen1.2 > > vendor=3D0x067b product=3D0x2303 devclass=3D0x00 devsubclass=3D0x00 > > devproto=3D0x00 sernum=3D"" release=3D0x0300 mode=3Dhost intclass=3D0= xff > > intsubclass=3D0x00 intprotocol=3D0x00 ttyname=3DU0 ttyports=3D1 on uh= ub1 > >=20 > > The '+' means it's an attach, the "device-name" variable is set > > from > > the space-delimited word after the +, and then vars are created > > from > > all the tag=3Dvalue tuples between 'at' and 'on'.=A0=A0So that gives = us > > the > > info to match product and vendor, and ttyname is the suffix to > > append > > to /dev/cua to make the cdev name. > >=20 > > -- Ian > Awsome! That works!! Thank you Ian!! Thank you for pointing out how > that was achieved! :-) >=20 > Is there any way to echo something out to the console to notify user > that firmware is being updated? This takes some time and it would be > nice to see something happens in the background.. I cannot see > anything with action "logging blah"; maybe no need for that? >=20 I think you can use logger(1) in the action, like: =A0 action "logger -p kern.crit Loading firmware to cua$ttyname ; =A0 =A0 /usr/local/bin/gobi_loader etc etc" The 'kern.crit' should be a high enough priority to ensure it comes out on the console, but it depends on syslog.conf of course. =A0If gobi_loader outputs a nice message it could be piped to logger(1) instead of putting the message in the command. -- Ian