Porting FreeBSD driver from 8.4 to 10.3 - PCI_ENABLE_MSI definition missing

John Baldwin john at baldwin.cx
Wed May 4 14:19:33 UTC 2016


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



More information about the freebsd-drivers mailing list