OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
WOL for if_vr? (was: Re: freebsd driving porting questions)

From: Stefan Sperling (stspstsp.name)
Date: Sat Mar 01 2008 - 07:36:39 CST


Hey Stuart,

On Sat, Mar 01, 2008 at 12:06:00PM +0000, Stuart Henderson wrote:
> I'm attempting to port yongari's newer vr(4) driver from FreeBSD.

Yongari's version of that driver also has wake on lan support.

> So far I have mostly just reverted the style changes and re-ordered
> things so the diff has a better signal:noise ratio and just starting
> to change things to try and get it to build

Would you be interested in trying to port the wake on lan support
over as well, instead of removing it from the driver?

I have an old diff that adds the necessary ioctls and teaches
ifconfig about them:
http://www.stsp.name/openbsd/OpenBSD-current-wol-2007-10-14.diff

The diff also has some driver changes (if_xl, if_vr, if_sis).

It's based on diffs I made for FreeBSD.

The diff is untested, but did compile back in October last year when
I wrote this on a train (literally). I never got around to see whether
it actually works.

The ifconfig changes should be straightforward.

The driver parts in my diff are very likely buggy, I guess for you
the only usable driver bits would be the vr_ioctl parts. FreeBSD dropped
the ioctl's I introduced in favour of using their ifcaps ioctl, but
it looks like OpenBSD does not have ifcaps. So a new set of ioctls
would be needed anyway.

Yongari's if_vr WOL-enabling code is great, I've been using it since
he wrote it and never had any problems so far. My version of that worked
but had lots of magic numbers because the only "documentation" I had was
the Linux driver. Yongari has data sheets, so his code is much cleaner.

It would be great to see a small but serious step towards WOL support
in OpenBSD. I would also like to help with coding and testing, time
permitting.

Once WOL is working with if_vr, we could ask the community to help
implementing the driver-specific WOL code for more cards.
I have written a small guide to adding WOL support to drivers that
would almost equally apply to OpenBSD:
http://marc.info/?l=freebsd-hackers&m=119602736908444&w=2

--
stefan
http://stsp.name PGP Key: 0xF59D25F0

[demime 1.01d removed an attachment of type application/pgp-signature]