Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 15 Nov 2013 10:05:59 -0500
From:      John Baldwin <jhb@freebsd.org>
To:        Bruce Evans <brde@optusnet.com.au>
Cc:        svn-src-head@freebsd.org, George Neville-Neil <gnn@freebsd.org>, svn-src-all@freebsd.org, Sergey Kandaurov <pluknet@freebsd.org>, src-committers@freebsd.org
Subject:   Re: svn commit: r258142 - head/sys/net
Message-ID:  <201311151005.59405.jhb@freebsd.org>
In-Reply-To: <20131115223304.R2093@besplex.bde.org>
References:  <201311142007.rAEK7InH068095@svn.freebsd.org> <A2749F6A-4F91-4DC7-A2C4-0F75AE20DB5E@freebsd.org> <20131115223304.R2093@besplex.bde.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Friday, November 15, 2013 7:23:23 am Bruce Evans wrote:
> On Thu, 14 Nov 2013, George Neville-Neil wrote:
> Does the API require defining OUI_FREEBSD as a value that needs to be
> shifted left by 24 to use?  It would be more useful to define it as the
> left-shifted value.  Then it gives the base for the FreeBSD range.
> Values that aren't left shifted have the advantage of fitting in 32 bits,
> so that their natural type is always int the type needed to hold the
> left-shifted value can be implementation-defined (it should be int64_t
> on 32-bit systems and long on 64-bit systems).

The API is free to be whatever we want.  I agree that it would be simpler
to make the full value explicit.  Perhaps something like this:

#define OUI_FREEBSD_BASE 0x589cfc000000
#define OUI_FREEBSD(nic)  (OUI_FREEBSD_BASE | (nic))

And then you can have:

#define OUI_FREEBSD_BHYVE_LOW OUI_FREEBSD(0x000001)
#define OUI_FREEBSD_BHYVE_HIGH OUI_FREEBSD(0x00ffff)

That avoids the needs for any casts, etc.

-- 
John Baldwin



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