From owner-freebsd-hackers@FreeBSD.ORG Tue Nov 29 06:02:01 2005 Return-Path: X-Original-To: freebsd-hackers@freebsd.org Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9CCE916A41F for ; Tue, 29 Nov 2005 06:02:01 +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 3669443D46 for ; Tue, 29 Nov 2005 06:02:01 +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 jAT5xJ1D017937; Mon, 28 Nov 2005 22:59:19 -0700 (MST) (envelope-from imp@bsdimp.com) Date: Mon, 28 Nov 2005 22:59:48 -0700 (MST) Message-Id: <20051128.225948.82990411.imp@bsdimp.com> To: fierykylin@gmail.com From: "M. Warner Losh" In-Reply-To: <87ab37ab0511280850y1bca554n1da9b11c321be34b@mail.gmail.com> References: <87ab37ab0511280850y1bca554n1da9b11c321be34b@mail.gmail.com> 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]); Mon, 28 Nov 2005 22:59:19 -0700 (MST) Cc: freebsd-hackers@freebsd.org Subject: Re: puzzle about the pci_add_child X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Nov 2005 06:02:01 -0000 In message: <87ab37ab0511280850y1bca554n1da9b11c321be34b@mail.gmail.com> kylin writes: : i am reading the pci code of freeBSD 53 ,and come to the puzzle of : pci_add_child. : 1 : why should we =09pci_cfg_save(dinfo->cfg.dev, dinfo, 0); after we have : already fill the cfg in pci_read_device ? It hasn't been completely filled in by pci_read_device. : 2 : what 's the purpose of the function couple : pci_cfg_save(dinfo->cfg.dev, dinfo, 0); : pci_cfg_restore(dinfo->cfg.dev, dinfo) : below is the function ,thank u Power state gets set to D0 as a side effect so that the device is live for the probe. Warner