Date: Fri, 12 Mar 2010 00:27:43 -0800 From: Juli Mallett <jmallett@FreeBSD.org> To: Qing Li <qingli@freebsd.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, "Robert N. M. Watson" <rwatson@freebsd.org> Subject: Re: svn commit: r205024 - head/sys/net Message-ID: <eaa228be1003120027p3f8731d6xf02134a4db19cc27@mail.gmail.com> In-Reply-To: <9ace436c1003120011v3c627aadka2e57615ae01fe6f@mail.gmail.com> References: <201003111756.o2BHukJu042449@svn.freebsd.org> <alpine.BSF.2.00.1003112128020.97017@fledge.watson.org> <9ace436c1003111530s3bd0de9cq451671909fb6aa64@mail.gmail.com> <5ADB6F0D-11F1-4F9F-87A0-64F57063981E@freebsd.org> <9ace436c1003112352l3b2505ceq63d9c78954520497@mail.gmail.com> <A543276F-1982-4F12-B325-7277C2B42C92@freebsd.org> <9ace436c1003120011v3c627aadka2e57615ae01fe6f@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, Mar 12, 2010 at 00:11, Qing Li <qingli@freebsd.org> wrote: > I like Julian's suggestion because it is simple and very low risk. > And there isn't a need to check for interface type any more. > Here is why: For actual link state, you can already see whether a driver is in UNKNOWN state, like: %%% /* * Values for if_link_state. */ #define LINK_STATE_UNKNOWN 0 /* link invalid/unknown */ #define LINK_STATE_DOWN 1 /* link is down */ #define LINK_STATE_UP 2 /* link is up */ %%% Therefore you should be able to easily add assertions and debugging printfs for interfaces that don't event support *setting* link state -- which is the real problem more than changing link state, since a driver probably won't report link as down if it has no intention of changing it. It doesn't help that there are two things wrt link state floating around -- one in the form of LINK_STATE (the one that matters here) and the other in ifmedia stuff. I think that's confusing this discussion gratuitously. Juli.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?eaa228be1003120027p3f8731d6xf02134a4db19cc27>