Date: Fri, 27 Jan 2006 00:39:27 -0700 (MST) From: "M. Warner Losh" <imp@bsdimp.com> To: rizzo@icir.org Cc: current@freebsd.org Subject: Re: if_flags usage etc. Message-ID: <20060127.003927.08393947.imp@bsdimp.com> In-Reply-To: <20060126225244.B37507@xorpc.icir.org> References: <20060124075437.B67285@xorpc.icir.org> <20060126.210322.56187611.imp@bsdimp.com> <20060126225244.B37507@xorpc.icir.org>
next in thread | previous in thread | raw e-mail | index | archive | help
In message: <20060126225244.B37507@xorpc.icir.org>
Luigi Rizzo <rizzo@icir.org> writes:
: On Thu, Jan 26, 2006 at 09:03:22PM -0700, M. Warner Losh wrote:
: > In message: <20060124075437.B67285@xorpc.icir.org>
: > Luigi Rizzo <rizzo@icir.org> writes:
: > : - some drivers try to manipulate flags that they should not e.g.
: > : if_ed
: > : sets IFF_ALTPHYS (IFF_LINK*, but it is almost a capability here)
: >
: > Why is this wrong?
:
: if possible, i think each IFF_ flag should be modified only by one entity (the
: stack or the driver). This way you can split them into different variables
: and reduce the amount of synchronization required to access them.
:
: The link flags are kind-of special in that some drivers use them to request
: a specific media, others (e.g. ed here, but some others too) to report up
: whatever they found by probing the link.
:
: I guess (though haven't looked in detail) that the "mii" approach has
: a cleaner way to deal with these issues.
Actually, the ifmedia approach has a cleaner way of dealing. mii uses
ifmedia. ifmedia reports all the possible media types to ifconfig,
and then reports its status. mii has a nearly identical way of
doing this for devices with mii busses, or pseudo mii busses.
ed should likely be fully converted to using ifmedia, but I'm not sure
I want to risk breaking ISA cards that I don't have access to to make
it so. I just don't have the time...
Warner
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20060127.003927.08393947.imp>
