Date: Mon, 2 Oct 2017 00:05:59 +0200 From: Tomasz CEDRO <tomek@cedro.info> To: Ian Lepore <ian@freebsd.org> Cc: Hans Petter Selasky <hps@selasky.org>, "freebsd-usb@FreeBSD.org" <freebsd-usb@freebsd.org> Subject: Re: USB/U3G: Added support for Panasonic CF-F9 GOBI 3G modem to U3G module Message-ID: <CAFYkXjkZDw0_xgUZZrEJk51atmWe6tsjqz3bK13K1U=GQhaLoQ@mail.gmail.com> In-Reply-To: <1506891559.22078.50.camel@freebsd.org> References: <CAFYkXjnF%2BwkrxNC6nf9s20AytVkszykEcPsr=roiaYugAo5YWg@mail.gmail.com> <ec4baec2-66a9-c5ce-eb89-01f553890a11@selasky.org> <1506465459.73082.168.camel@freebsd.org> <165556bc-c011-bebd-feee-5bbd4cb5943e@selasky.org> <CAFYkXjm=TsHzjXgfFFRyXdSnj3RoeN%2BMNE_K5DBuHphygcqyjw@mail.gmail.com> <1506876055.22078.24.camel@freebsd.org> <CAFYkXjkYsfdWPBJu_wQWZcbHzR9vG0W7qdscBF1ornsZik6gbw@mail.gmail.com> <87d62aba-0b35-8b20-cf1f-9fd2de2d301a@selasky.org> <CAFYkXjkzm%2Bz4c9chtvO_Go9cfnn3_Awpx2m%2BcvNUZR_qxX1-Sw@mail.gmail.com> <1506882193.22078.32.camel@freebsd.org> <CAFYkXjmaJZ7biOtfdHP_-YJ_vKBoj0XXPDZxatraB8iVEgmxeQ@mail.gmail.com> <1506886709.22078.43.camel@freebsd.org> <CAFYkXjmS0vPj8KCDZcOoaWqzZ1%2Bxv7LcAhBjcNtE-sDy%2BJZtSw@mail.gmail.com> <1506891559.22078.50.camel@freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, Oct 1, 2017 at 10:59 PM, Ian Lepore <ian@freebsd.org> wrote: > On Sun, 2017-10-01 at 22:20 +0200, Tomasz CEDRO wrote: >> On Sun, Oct 1, 2017 at 9:38 PM, Ian Lepore <ian@freebsd.org> wrote: >> > >> > On Sun, 2017-10-01 at 20:59 +0200, Tomasz CEDRO wrote: >> > > >> > > On Sun, Oct 1, 2017 at 8:23 PM, Ian Lepore <ian@freebsd.org> >> > > wrote: >> > > > >> > > > >> > > > On Sun, 2017-10-01 at 20:17 +0200, Tomasz CEDRO wrote: >> > > > > >> > > > > >> > > > > [...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? :-) >> > > >> > > 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.. >> > > >> > > [1] https://wikidevi.com/wiki/TP-LINK_TL-WN822N_v2 >> > > >> > Hmmm. I think we need to key off the tty 'attach' event instead of >> > the >> > devfs 'create' event. The tty attach for a usb device is the one >> > event >> > that has all the info we need in one message. This is assuming the >> > device name in dmesg on attach is u3g0 or u3g1 or whatever. >> > >> > attach 100 { >> > device-name "(u3g)[0-9]+"; >> > match "vendor" "0x04da"; >> > match "product" "0x250e"; >> > action "/usr/local/bin/gobi_loader /dev/cua$ttyname >> > /boot/firmware/gobi/"; >> > }; >> > >> > 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=value tuples it finds in the events coming from the kernel. >> > Then I connected to devd using netcat so I could watch the events >> > as >> > they happen: >> > >> > nc -U /var/run/devd.pipe >> > >> > then I plugged in a usb-serial adapter (I have no u3g stuff), which >> > creates a whole lot of events. The last one was the tty attach: >> > >> > +uplcom0 at bus=1 hubaddr=1 port=1 devaddr=2 interface=0 >> > ugen=ugen1.2 >> > vendor=0x067b product=0x2303 devclass=0x00 devsubclass=0x00 >> > devproto=0x00 sernum="" release=0x0300 mode=host intclass=0xff >> > intsubclass=0x00 intprotocol=0x00 ttyname=U0 ttyports=1 on uhub1 >> > >> > 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=value tuples between 'at' and 'on'. So 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. >> > >> > -- Ian >> Awsome! That works!! Thank you Ian!! Thank you for pointing out how >> that was achieved! :-) >> >> 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? >> > > I think you can use logger(1) in the action, like: > > action "logger -p kern.crit Loading firmware to cua$ttyname ; > /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. If > gobi_loader outputs a nice message it could be piped to logger(1) > instead of putting the message in the command. > > -- Ian Logger works with syslog which is loaded after modules and firmware, this is why I could not see the message.. but additional action with /bin/echo seems to do the job :-) Thank you guys! You are the best! FreeBSD ROX!!! =) https://github.com/freebsd/freebsd/pull/115 -- CeDeROM, SQ7MHZ, http://www.tomek.cedro.info
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAFYkXjkZDw0_xgUZZrEJk51atmWe6tsjqz3bK13K1U=GQhaLoQ>