From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=38295 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OOr0M-0000uE-Bk for qemu-devel@nongnu.org; Wed, 16 Jun 2010 07:42:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OOr0K-0004uy-Mc for qemu-devel@nongnu.org; Wed, 16 Jun 2010 07:42:02 -0400 Received: from mail.valinux.co.jp ([210.128.90.3]:53659) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OOr0K-0004uY-As for qemu-devel@nongnu.org; Wed, 16 Jun 2010 07:42:00 -0400 Date: Wed, 16 Jun 2010 20:38:18 +0900 From: Isaku Yamahata Message-ID: <20100616113818.GA25458@valinux.co.jp> References: <20100615091207.GA1365@redhat.com> <20100616022002.GB7932@valinux.co.jp> <20100616085425.GA4637@redhat.com> <20100616094353.GB23748@valinux.co.jp> <20100616111944.GA5661@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20100616111944.GA5661@redhat.com> Subject: [Qemu-devel] Re: [PATCH 2/2] pci: don't overwrite pci header type. List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Michael S. Tsirkin" Cc: blauwirbel@gmail.com, qemu-devel@nongnu.org On Wed, Jun 16, 2010 at 02:19:44PM +0300, Michael S. Tsirkin wrote: > > > > Apb host bridge specifies PCI_HEADER_TYPE_BRIDGE in PCIDeviceInfo, > > > > on the other hand pbc_pci_host_init() sets the register > > > > to PCI_HEADER_TYPE_NORMAL. > > > > To be honest I don't know why it does so, but that is what Blue wants. > > > > > > BTW I think it would be prettier to have is_bridge instead of header_type > > > as a qdev property. Agree? > > > > The spec version 3.0 defines three header types. > > 0:normal device, 1:pci-to-pci bridge, 2:card bus bridge > > So I'd like the name a bit more generic than is_bridge. > > Any suggestion? > > Could we just have functions that set up header for > each type, such as > pci_init_normal_header() > pci_init_p2p_bridge_header() > pci_init_cardbus_header() I see. You mean device specific initialization function should call one of them. Then header_type property will be dropped. I'll split pci p2p bridge related functions into a file at first. Then introduce helper functions. -- yamahata