From owner-freebsd-usb@FreeBSD.ORG Sat Nov 29 01:16:21 2014 Return-Path: Delivered-To: usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1F5081B9; Sat, 29 Nov 2014 01:16:21 +0000 (UTC) Received: from elvis.mu.org (elvis.mu.org [IPv6:2001:470:1f05:b76::196]) by mx1.freebsd.org (Postfix) with ESMTP id 0C0B0D55; Sat, 29 Nov 2014 01:16:21 +0000 (UTC) Received: from AlfredMacbookAir.local (c-76-21-10-192.hsd1.ca.comcast.net [76.21.10.192]) by elvis.mu.org (Postfix) with ESMTPSA id ADD60341F850; Fri, 28 Nov 2014 17:16:20 -0800 (PST) Message-ID: <54791E62.5000406@freebsd.org> Date: Fri, 28 Nov 2014 17:16:18 -0800 From: Alfred Perlstein Organization: FreeBSD User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: Jesus Monroy , usb@freebsd.org Subject: Re: Question on ue devices autoconfigure versus Linux. References: <1417223131.59789.YahooMailBasic@web140503.mail.bf1.yahoo.com> In-Reply-To: <1417223131.59789.YahooMailBasic@web140503.mail.bf1.yahoo.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Hans Petter Selasky X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Nov 2014 01:16:21 -0000 Well sure, but we have devd in FreeBSD for some time. It actually does handle the hot plug (sort-of...) I made a custom devd hook for it. The actual problem is that if I boot FreeBSD with the device plugged in then devd never runs my hooks. That and I'm not sure if devd is even the right place... to put my hooks, but it sure seems like it... except for the "doesn't show up at boot". Also really interested in knowing how the heck Linux figures out the IP address? Is there some usb ethernet spec for autoconfiguring??? -Alfred On 11/28/14, 5:05 PM, Jesus Monroy wrote: > Alfred, > I usually don't get the USB mailing list in my inbox. However, > for some reason I fished this out of spam. Indicating to me > I should answer this. > > THE ANSWER: > > Hot swapping has never been a strong point for BSD. > Basically they think, "hot swapping" means, flip a > mechanical switch, remove the device. They DON'T > think like a USB device; which is "plug in and pull" > - at will. > > In the Linux world, there is an army of people that > attack problems like this 'ad hoc'. The BSD > community is far too formal to get it done in > any reasonable time frame. > > In the Linux world, there are a host of "post-boot" > solutions, such as systemd, busd, etc. They all > generally trap an event, be it real (such as an IRQ), > network, program, or user. This is usually > leverage by /proc, dmesg or similar. > > Hope this helps. > FWIW: I'm living in El Paso Texas for the next 6 months. > > Best of Luck, > Jesse > > > -------------------------------------------- > On Fri, 11/28/14, Alfred Perlstein wrote: > > Subject: Question on ue devices autoconfigure versus Linux. > To: usb@freebsd.org > Cc: "Hans Petter Selasky" > Date: Friday, November 28, 2014, 5:37 PM > > Hello, > > We have a widget here, basically a "beagleclone" that runs > Linux. > > When I plug it into an ubuntu host it shows up as: > > usb0 Link encap:Ethernet HWaddr > 8a:18:9f:c4:a9:02 > inet > addr:169.254.99.129 Bcast:169.254.99.131 > Mask:255.255.255.252 > inet6 addr: > fe80::8818:9fff:fec4:a902/64 Scope:Link > UP BROADCAST > RUNNING MULTICAST MTU:1500 Metric:1 > RX packets:3 > errors:0 dropped:0 overruns:0 frame:0 > TX packets:56 > errors:0 dropped:0 overruns:0 carrier:0 > collisions:0 > txqueuelen:1000 > RX bytes:626 > (626.0 B) TX bytes:10727 (10.7 KB) > > Requires no special setup. > > However on a FreeBSD machine I need to do this: > > USBDEV=$(shell dmesg | grep '^ugen.*LCD' | sed -E > 's/^ugen([0-9]+\.[0-9]+).*/\1/') > # target to make the device show up on freebsd. > config-freebsd: > usbconfig -d > $(USBDEV) set_config 1 > sleep 5 > ifconfig ue0 inet > 169.254.99.129/24 up > > Basically I need to grep dmesg for "ugen" and the string > "LCD", then I > need to run: > usbconfig -d 3.3 set_config 1 # (3.3 comes from > dmesg) > then.. > ifconfig ue0 inet 169.254.99.129/24 up > > Any idea why Linux can do this all automagically but FreeBSD > needs > manual help? > > > I even tried putting some stuff into devd.conf, however devd > doesn't > seem to the right thing if the device is plugged in at boot > time. This > is because devd only seems to know when a device is plugged > in, however > it doesn't trigger events when the device has been present > since boot. > > Any tips on this? We can get around this with some > custom rc scripts, > but I was just wondering if FreeBSD could make it more plug > and play. > > thanks, > -Alfred > _______________________________________________ > freebsd-usb@freebsd.org > mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-usb > To unsubscribe, send any mail to "freebsd-usb-unsubscribe@freebsd.org" > >