Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 23 May 2004 20:14:02 -0500
From:      Craig Boston <craig@tobuj.gank.org>
To:        Sam Lawrance <boris@brooknet.com.au>
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: USB ethernet CDC driver
Message-ID:  <200405232014.02736.craig@tobuj.gank.org>
In-Reply-To: <1085358339.10526.28.camel@dirk>
References:  <1085318525.10526.25.camel@dirk> <200405231512.14217.craig@tobuj.gank.org> <1085358339.10526.28.camel@dirk>

next in thread | previous in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200405232014.02736.craig>