From owner-freebsd-hackers@FreeBSD.ORG Sun May 23 18:14:54 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 304F216A4CE for ; Sun, 23 May 2004 18:14:54 -0700 (PDT) Received: from ion.gank.org (ion.gank.org [69.55.238.164]) by mx1.FreeBSD.org (Postfix) with ESMTP id DBAD543D45 for ; Sun, 23 May 2004 18:14:53 -0700 (PDT) (envelope-from craig@tobuj.gank.org) Received: from aldaris.auir.gank.org (arbiter.gank.org [64.81.113.221]) by ion.gank.org (mail) with ESMTP id 3797D2C191; Sun, 23 May 2004 20:14:08 -0500 (CDT) From: Craig Boston To: Sam Lawrance Date: Sun, 23 May 2004 20:14:02 -0500 User-Agent: KMail/1.6.2 References: <1085318525.10526.25.camel@dirk> <200405231512.14217.craig@tobuj.gank.org> <1085358339.10526.28.camel@dirk> In-Reply-To: <1085358339.10526.28.camel@dirk> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <200405232014.02736.craig@tobuj.gank.org> cc: freebsd-hackers@freebsd.org Subject: Re: USB ethernet CDC driver X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 May 2004 01:14:54 -0000 On Sunday 23 May 2004 7:25 pm, Sam Lawrance wrote: > That would be great, I would love to take a look at it. I'll go ahead and copy the list in case anybody else is interested... You can grab the source at http://www.gank.org/freebsd/cdce.tar.gz I'm planning to eventually make a FreeBSD projects page -- I have a few local patches and such I'd like to share. If and when I ever get time to do that, I'll move this in with it, but the above link should work until then. The list archives will have to suffice as documentation until then, here's a few random comments about it: * It's set up as a standalone kernel module. If you have the kernel source on your system it should be as simple as "cd cdce; make all && make install". That will dump it in /boot/kernel/if_cdce.ko, which can be loaded by any of the normal means. * When you plug in the device, if all goes well, you should end up with a cdce0 network device. Just ifconfig it and go. * It registers itself as the handler for the CDC Ethernet class. If your device doesn't report itself as that, you may have to add a specific device ID for it in the cdce_devs[] structure (get the values from usbdevs -v). If it complains about not being able to find endpoints, try adding it in there with the CDCE_NO_UNION flag. Linux on the Zaurus seems to be slightly non-conformant to the spec, so it may be similar on the iPaq. * The driver generates a random MAC address for the local end rather than trying to read it from the device. While incorrect for real Ethernet adapters, it seems to be fine (and may even be necessary) for these kinds of point-to-point connections. * There is special handling for the Zaurus's nonstandard frame format, but it should be off by default for other devices. This hasn't been tested yet, though :) * The driver is targeted at -CURRENT. It was originally developed against 5.2-RELEASE sources and should still compile fine on those systems. It would probably require some work to back-port to stable though. * Not entirely sure what to do about the copyright message -- I borrowed heavily from the if_axe and if_aue drivers... * BSD license, so feel free to do whatever with it :) * Also applies is my standard disclaimer: It works fine on my system, but may cause your toaster to explode. I used to sometimes get panics on detach, but I think the problem is fixed now. Haven't had one in quite a while, even if I unplug it while transferring something. Good luck! Craig