From owner-svn-src-head@freebsd.org Wed Apr 20 13:23:08 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4C09AB150FF; Wed, 20 Apr 2016 13:23:08 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 02BE114DE; Wed, 20 Apr 2016 13:23:07 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3KDN75i045925; Wed, 20 Apr 2016 13:23:07 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3KDN7fC045924; Wed, 20 Apr 2016 13:23:07 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201604201323.u3KDN7fC045924@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Wed, 20 Apr 2016 13:23:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298343 - head/sys/arm64/cavium X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Apr 2016 13:23:08 -0000 Author: andrew Date: Wed Apr 20 13:23:06 2016 New Revision: 298343 URL: https://svnweb.freebsd.org/changeset/base/298343 Log: Pull out the MSI/MSI-X handling calls to simplify future intrng integration. Obtained from: ABT Systems Ltd Sponsored by: The FreeBSD Foundation Modified: head/sys/arm64/cavium/thunder_pcie_pem.c Modified: head/sys/arm64/cavium/thunder_pcie_pem.c ============================================================================== --- head/sys/arm64/cavium/thunder_pcie_pem.c Wed Apr 20 07:44:50 2016 (r298342) +++ head/sys/arm64/cavium/thunder_pcie_pem.c Wed Apr 20 13:23:06 2016 (r298343) @@ -126,6 +126,11 @@ static int thunder_pem_adjust_resource(d struct resource *, rman_res_t, rman_res_t); static struct resource * thunder_pem_alloc_resource(device_t, device_t, int, int *, rman_res_t, rman_res_t, rman_res_t, u_int); +static int thunder_pem_alloc_msi(device_t, device_t, int, int, int *); +static int thunder_pem_release_msi(device_t, device_t, int, int *); +static int thunder_pem_map_msi(device_t, device_t, int, uint64_t *, uint32_t *); +static int thunder_pem_alloc_msix(device_t, device_t, int *); +static int thunder_pem_release_msix(device_t, device_t, int); static int thunder_pem_attach(device_t); static int thunder_pem_deactivate_resource(device_t, device_t, int, int, struct resource *); @@ -169,11 +174,12 @@ static device_method_t thunder_pem_metho DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), - DEVMETHOD(pcib_map_msi, arm_map_msi), - DEVMETHOD(pcib_alloc_msix, arm_alloc_msix), - DEVMETHOD(pcib_release_msix, arm_release_msix), - DEVMETHOD(pcib_alloc_msi, arm_alloc_msi), - DEVMETHOD(pcib_release_msi, arm_release_msi), + DEVMETHOD(pcib_map_msi, thunder_pem_map_msi), + DEVMETHOD(pcib_alloc_msix, thunder_pem_alloc_msix), + DEVMETHOD(pcib_release_msix, thunder_pem_release_msix), + DEVMETHOD(pcib_alloc_msi, thunder_pem_alloc_msi), + DEVMETHOD(pcib_release_msi, thunder_pem_release_msi), + DEVMETHOD_END }; @@ -315,6 +321,43 @@ thunder_pem_adjust_resource(device_t dev } static int +thunder_pem_alloc_msi(device_t pci, device_t child, int count, int maxcount, + int *irqs) +{ + + return (arm_alloc_msi(pci, child, count, maxcount, irqs)); +} + +static int +thunder_pem_release_msi(device_t pci, device_t child, int count, int *irqs) +{ + + return (arm_release_msi(pci, child, count, irqs)); +} + +static int +thunder_pem_map_msi(device_t pci, device_t child, int irq, uint64_t *addr, + uint32_t *data) +{ + + return (arm_map_msi(pci, child, irq, addr, data)); +} + +static int +thunder_pem_alloc_msix(device_t pci, device_t child, int *irq) +{ + + return (arm_alloc_msix(pci, child, irq)); +} + +static int +thunder_pem_release_msix(device_t pci, device_t child, int irq) +{ + + return (arm_release_msix(pci, child, irq)); +} + +static int thunder_pem_identify(device_t dev) { struct thunder_pem_softc *sc;