#$FreeBSD$
.PATH:  ${.CURDIR}
KMOD    = if_ixl
KMODDIR ?= /boot/kernel
SRCS    = device_if.h bus_if.h pci_if.h
SRCS    += if_ixl.c ixl_pf_main.c ixl_pf_qmgr.c ixl_txrx.c ixl_pf_i2c.c i40e_osdep.c
# Shared source
SRCS    += i40e_common.c i40e_nvm.c i40e_adminq.c i40e_lan_hmc.c i40e_hmc.c i40e_dcb.c
# Compat source
SRCS    += freebsd_compat_common.c

CFLAGS	+= $(STRIP_FLAGS)
# Add INET and INET6 for the standalone code, in-kernel options control it
CFLAGS	+= -DSMP -DINET -DINET6 -DIXL_STANDALONE_BUILD

# Enable netmap(4) support
# CFLAGS += -DDEV_NETMAP

# Add RSS support if using FreeBSD11 (HEAD)
# CFLAGS += -DRSS

# Enable SR-IOV PF support
SRIOV_ENABLE = 1

# Enable iWARP support
IWARP_ENABLE = 1

# Print even more debug messages
# CFLAGS += -DIXL_DEBUG

# SR-IOV support requires additional files and a kernel version check
KERNVER != uname -K
VERS_CHECK != test $(KERNVER) -ge 1100000 ; echo $$?

.if $(SRIOV_ENABLE) && !$(VERS_CHECK)
CFLAGS += -DPCI_IOV
SRCS += pci_iov_if.h
SRCS += ixl_pf_iov.c
.endif

.if $(IWARP_ENABLE)
CFLAGS += -DIXL_IW
SRCS += ixl_iw.c
.endif

DEBUG_FC ?= 0
.if ${DEBUG_FC}
CFLAGS += -DIXL_DEBUG_FC
.endif

DEBUG_RXCSUM ?= 0
.if ${DEBUG_RXCSUM}
CFLAGS += -DIXL_RXCSUM_DEBUG_COUNTERS
.endif

.include <bsd.kmod.mk>
