From owner-freebsd-current@FreeBSD.ORG Fri Jan 27 07:40:50 2006 Return-Path: X-Original-To: current@freebsd.org Delivered-To: freebsd-current@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0BA9F16A420 for ; Fri, 27 Jan 2006 07:40:50 +0000 (GMT) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (vc4-2-0-87.dsl.netrack.net [199.45.160.85]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9886143D48 for ; Fri, 27 Jan 2006 07:40:49 +0000 (GMT) (envelope-from imp@bsdimp.com) Received: from localhost (localhost.village.org [127.0.0.1] (may be forged)) by harmony.bsdimp.com (8.13.3/8.13.3) with ESMTP id k0R7dSlS059689; Fri, 27 Jan 2006 00:39:28 -0700 (MST) (envelope-from imp@bsdimp.com) Date: Fri, 27 Jan 2006 00:39:27 -0700 (MST) Message-Id: <20060127.003927.08393947.imp@bsdimp.com> To: rizzo@icir.org From: "M. Warner Losh" 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> X-Mailer: Mew version 3.3 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-2.0 (harmony.bsdimp.com [127.0.0.1]); Fri, 27 Jan 2006 00:39:29 -0700 (MST) Cc: current@freebsd.org Subject: Re: if_flags usage etc. X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Jan 2006 07:40:50 -0000 In message: <20060126225244.B37507@xorpc.icir.org> Luigi Rizzo writes: : On Thu, Jan 26, 2006 at 09:03:22PM -0700, M. Warner Losh wrote: : > In message: <20060124075437.B67285@xorpc.icir.org> : > Luigi Rizzo 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