Driver Compilation Error

While building a PCI-based network device driver in FreeBSD, you may encounter these errors.
@/sys/bus.h:320: device_if.h: No such file or directory
@/sys/bus.h:321: bus_if.h: No such file or directory
@/pci/pcivar.h:176: pci_if.h: No such file or directory

As the error message indicates, the header files device_if.h, bus_if.h, and pci_if.h required for compiling PCI-based network device driver are either missing or not included in the compilation.

Case 1: Missing
Check if /sys symbolic link is properly set to point to sys directory in the FreeBSD Kernel sources. While building drivers, a symbolic link is created in the driver source directory, where compilation is initiated, each to /sys and /sys/ARCH (ARCH: amd64, i386, etc) directories. So, if /sys is not properly set, you may encounter such error messages.

Case 2: Not included
Include bus_if.h, device_if.h and pci_if.h by adding below line in Makefile.
SRC += bus_if.h device_if.h pci_if.h

Stumble
Delicious
Technorati
Twitter
Facebook

Bookmark and Share
Your Ad Here

0 comments

Post a Comment