From patchwork Thu Mar 7 18:29:46 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Williamson X-Patchwork-Id: 225893 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id ACE452C0392 for ; Fri, 8 Mar 2013 05:30:14 +1100 (EST) Received: from localhost ([::1]:34106 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UDfa0-0001wF-Sq for incoming@patchwork.ozlabs.org; Thu, 07 Mar 2013 13:30:12 -0500 Received: from eggs.gnu.org ([208.118.235.92]:41498) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UDfZd-0001sL-LT for qemu-devel@nongnu.org; Thu, 07 Mar 2013 13:29:50 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UDfZc-0000LV-5m for qemu-devel@nongnu.org; Thu, 07 Mar 2013 13:29:49 -0500 Received: from mx1.redhat.com ([209.132.183.28]:45760) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UDfZb-0000LR-VE for qemu-devel@nongnu.org; Thu, 07 Mar 2013 13:29:48 -0500 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r27ITlq7001761 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 7 Mar 2013 13:29:47 -0500 Received: from bling.home (ovpn-113-45.phx2.redhat.com [10.3.113.45]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r27ITkQt001163; Thu, 7 Mar 2013 13:29:46 -0500 To: mst@redhat.com From: Alex Williamson Date: Thu, 07 Mar 2013 11:29:46 -0700 Message-ID: <20130307182932.22161.62817.stgit@bling.home> User-Agent: StGit/0.16 MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: qemu-devel@nongnu.org Subject: [Qemu-devel] [PATCH] xio3130: Add map_irq functions X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Just like root ports, I think these are supposed to be direct mapped. Signed-off-by: Alex Williamson --- hw/xio3130_downstream.c | 7 +++++++ hw/xio3130_upstream.c | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/hw/xio3130_downstream.c b/hw/xio3130_downstream.c index 7f00bc8..c484770 100644 --- a/hw/xio3130_downstream.c +++ b/hw/xio3130_downstream.c @@ -54,6 +54,11 @@ static void xio3130_downstream_reset(DeviceState *qdev) pci_bridge_reset(qdev); } +static int xio3130_downstream_map_irq(PCIDevice *pci_dev, int irq_num) +{ + return irq_num; +} + static int xio3130_downstream_initfn(PCIDevice *d) { PCIBridge* br = DO_UPCAST(PCIBridge, dev, d); @@ -61,6 +66,8 @@ static int xio3130_downstream_initfn(PCIDevice *d) PCIESlot *s = DO_UPCAST(PCIESlot, port, p); int rc; + pci_bridge_map_irq(br, NULL, xio3130_downstream_map_irq); + rc = pci_bridge_initfn(d); if (rc < 0) { return rc; diff --git a/hw/xio3130_upstream.c b/hw/xio3130_upstream.c index 70b15d3..c233a43 100644 --- a/hw/xio3130_upstream.c +++ b/hw/xio3130_upstream.c @@ -51,12 +51,19 @@ static void xio3130_upstream_reset(DeviceState *qdev) pcie_cap_deverr_reset(d); } +static int xio3130_upstream_map_irq(PCIDevice *pci_dev, int irq_num) +{ + return irq_num; +} + static int xio3130_upstream_initfn(PCIDevice *d) { PCIBridge* br = DO_UPCAST(PCIBridge, dev, d); PCIEPort *p = DO_UPCAST(PCIEPort, br, br); int rc; + pci_bridge_map_irq(br, NULL, xio3130_upstream_map_irq); + rc = pci_bridge_initfn(d); if (rc < 0) { return rc;