From owner-freebsd-drivers@freebsd.org Wed May 4 14:19:32 2016 Return-Path: Delivered-To: freebsd-drivers@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 ECBCBB2C9CA for ; Wed, 4 May 2016 14:19:32 +0000 (UTC) (envelope-from john@baldwin.cx) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BFC091B44 for ; Wed, 4 May 2016 14:19:32 +0000 (UTC) (envelope-from john@baldwin.cx) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id AB67DB960; Wed, 4 May 2016 10:19:31 -0400 (EDT) From: John Baldwin To: freebsd-drivers@freebsd.org Subject: Re: Porting FreeBSD driver from 8.4 to 10.3 - PCI_ENABLE_MSI definition missing Date: Wed, 04 May 2016 07:16:19 -0700 Message-ID: <8107686.DyeUg95lUZ@ralph.baldwin.cx> User-Agent: KMail/4.14.3 (FreeBSD/10.2-STABLE; KDE/4.14.3; amd64; ; ) In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Wed, 04 May 2016 10:19:31 -0400 (EDT) X-BeenThere: freebsd-drivers@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: Writing device drivers for FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 May 2016 14:19:33 -0000 On Thursday, April 14, 2016 11:40:02 PM Reguna, Lakshmi wrote: > Hi, > > I am attempting to port a freebsd driver from 8.4 to 10.3. I ran into the following compilation error. I am not able to find any file which declares PCI_ENABLE_MSI, PCI_ENABLE_MSIX, PCI_DISABLE_MSI etc. The actual definition of PCI_ENABLE_MSI seems to point to pci_enable_msi_method in pci.c. Any thoughts on what might be missing ? > > DEVMETHOD(pci_enable_msi, pci_enable_msi_method), > > > Build Error: > > @/dev/pci/pcivar.h:459:5: error: implicit declaration of function 'PCI_ENABLE_MSI' is invalid in C99 > [-Werror,-Wimplicit-function-declaration] > PCI_ENABLE_MSI(device_get_parent(dev), dev, address, data); > > > @/dev/pci/pcivar.h:465:5: error: implicit declaration of function 'PCI_ENABLE_MSIX' is invalid in C99 > [-Werror,-Wimplicit-function-declaration] > PCI_ENABLE_MSIX(device_get_parent(dev), dev, index, address, data); > > @/dev/pci/pcivar.h:471:5: error: implicit declaration of function 'PCI_DISABLE_MSI' is invalid in C99 > [-Werror,-Wimplicit-function-declaration] > PCI_DISABLE_MSI(device_get_parent(dev), dev); > ^ > @/dev/pci/pcivar.h:501:13: error: implicit declaration of function 'PCI_MSIX_PBA_BAR' is invalid in C99 > [-Werror,-Wimplicit-function-declaration] > return (PCI_MSIX_PBA_BAR(device_get_parent(dev), dev)); > ^ > @/dev/pci/pcivar.h:507:13: error: implicit declaration of function 'PCI_MSIX_TABLE_BAR' is invalid in C99 > [-Werror,-Wimplicit-function-declaration] > return (PCI_MSIX_TABLE_BAR(device_get_parent(dev), dev)); > > @/dev/pci/pcivar.h:520:13: error: implicit declaration of function 'PCI_CHILD_ADDED' is invalid in C99 > [-Werror,-Wimplicit-function-declaration] > return (PCI_CHILD_ADDED(device_get_parent(dev), dev)); You need to add 'pci_if.h' to your SRCS line in your kernel module Makefile. -- John Baldwin