From owner-freebsd-usb@freebsd.org Sun Oct 1 20:21:08 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 D7FA6E2D929 for ; Sun, 1 Oct 2017 20:21:08 +0000 (UTC) (envelope-from tomek.cedro@gmail.com) Received: from mail-ua0-x244.google.com (mail-ua0-x244.google.com [IPv6:2607:f8b0:400c:c08::244]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 941206D870; Sun, 1 Oct 2017 20:21:08 +0000 (UTC) (envelope-from tomek.cedro@gmail.com) Received: by mail-ua0-x244.google.com with SMTP id q29so1257189uaf.4; Sun, 01 Oct 2017 13:21:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=VaCo1NgvkvQhr64e5skpq9Zc8WuUqHZb15XC0E6IQRU=; b=Z3eFGUHf144OT+pywkSKumMag8up9Z+0pkEfsRB1RQ7KRW2tsgdEyJ8aP1vmvTCH0r xbbc4lT356lalXSf2iABFgzGUBgdOIwgVv/D7x1KMhtwhBltU1KxgMk7zSoyfxnGPmgG QRVjRCi88/YS8qoKQ1whokt5pSdF4fdrsbNJTWlpSCs1/9FXzJ5HfjoG4v0iBB0WSzTv DVcF5hPY04p5DFlsAJnN4Thh/Hh8AiN54YWW9ScjQjLpRVkrwIQDgaJvM/tTj1kCS05q 4eFNz7GSSv3KILB2N6PFfsxpGDe680BDntq+TIM+41TgmHY4lKswSUzZ7qmjxLKH30Er J8+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=VaCo1NgvkvQhr64e5skpq9Zc8WuUqHZb15XC0E6IQRU=; b=C+jEH67vHYHPNINKHhtghpsCgYf5pmQj5lm4JENTogPXWZ6kyJdGXON5DseWgbmjDS cb4Iqxd0RRbAMw//OVG0EGu78ACMH+s2C/tb/i8EHL8cgCDFFq9R4iU1aCKc/T8iMQDP 0PzEAwqenLAhMHWdBk1zt4GryqRD/TUyTWmJCpXuf+Baeore+rV2/f1kF3GfcSB6NyC3 TFN75egnwsi4uwpottelEO4nLIdlogW5FQVE/DY5x3XjQQjki4JERZ05aM+jEyTHNuM8 Q7Bo0VuE5UkboX8JHwjUnhrQaSM2USgzEXqVSrAPSRjwDb2MQJlK1HJzCJsDWLrMj2Oo zabA== X-Gm-Message-State: AHPjjUhOywG9HBXkMIWDT7a15+XQqOx7VHDWHA8Ty5xsq4tRmLE9vRFU f/AmGpTXFHSBtKFYlwn/50I99Xm4NPKbN6rZ46dw5A== X-Google-Smtp-Source: AOwi7QArxMa1Id6bWjSkl/UOjvGQQN5PsCjB0idnQBwgCg3LBOgdqVST63V9D20yp0ayRJkfZEqKzuYZ1jYjl3clBbU= X-Received: by 10.176.6.195 with SMTP id g61mr8997769uag.161.1506889267326; Sun, 01 Oct 2017 13:21:07 -0700 (PDT) MIME-Version: 1.0 Sender: tomek.cedro@gmail.com Received: by 10.159.53.237 with HTTP; Sun, 1 Oct 2017 13:20:46 -0700 (PDT) In-Reply-To: <1506886709.22078.43.camel@freebsd.org> 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> From: Tomasz CEDRO Date: Sun, 1 Oct 2017 22:20:46 +0200 X-Google-Sender-Auth: nt4yCjfoZMHfJhq7sUI4cAqZjGY Message-ID: Subject: Re: USB/U3G: Added support for Panasonic CF-F9 GOBI 3G modem to U3G module To: Ian Lepore , Hans Petter Selasky Cc: "freebsd-usb@FreeBSD.org" Content-Type: text/plain; charset="UTF-8" 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 20:21:09 -0000 On Sun, Oct 1, 2017 at 9:38 PM, Ian Lepore wrote: > On Sun, 2017-10-01 at 20:59 +0200, Tomasz CEDRO wrote: >> On Sun, Oct 1, 2017 at 8:23 PM, Ian Lepore 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? -- CeDeROM, SQ7MHZ, http://www.tomek.cedro.info