FreeBSD out of tree driver missing rules / guide

Vanco, Juraj juraj.vanco at intel.com
Fri Apr 6 14:25:18 UTC 2018


Hello,

I try to write out of tree driver Makefile but I always get issues in headers.
My general question is if there are typical rules to compile out of tree driver.
Here is my code:

.include <bsd.init.mk>

.PATH: ${QATPATH}/qat_c3xxx $(FREEBSDPATH)

KMOD= my_module
SRCS=    my_module.c
SRCS+= device_if.h bus_if.h

.if exists(${SYSDIR}/compat/linuxkpi/common/include)
CFLAGS+= -I${SYSDIR}/compat/linuxkpi/common/include
.endif

.include <bsd.kmod.mk>

With the code above I am getting issues like
/usr/src/sys/sys/kernel.h:58:24: error: use of undeclared identifier 'MAXPATHLEN'
extern char kernelname[MAXPATHLEN];

I could be adding header by header by my own decision, but perhaps there is a rule
what headers to include to the SRCS?

jv
--------------------------------------------------------------
Intel Research and Development Ireland Limited
Registered in Ireland
Registered Office: Collinstown Industrial Park, Leixlip, County Kildare
Registered Number: 308263


This e-mail and any attachments may contain confidential material for the sole
use of the intended recipient(s). Any review or distribution by others is
strictly prohibited. If you are not the intended recipient, please contact the
sender and delete all copies.


More information about the freebsd-drivers mailing list