From 20472703306372312ea885d4b1ffc722bc213ccb Mon Sep 17 00:00:00 2001 From: WeebDataHoarder <57538841+WeebDataHoarder@users.noreply.github.com> Date: Tue, 20 Oct 2020 20:19:23 +0200 Subject: [PATCH] Fixed fm10k build on newer kernels --- src/kcompat.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/kcompat.h b/src/kcompat.h index 011bd68..c5609d6 100644 --- a/src/kcompat.h +++ b/src/kcompat.h @@ -257,9 +257,11 @@ struct msix_entry { #define node_online(node) ((node) == 0) #endif +#if ( LINUX_VERSION_CODE < KERNEL_VERSION(5,4,0) ) #ifndef num_online_cpus #define num_online_cpus() smp_num_cpus #endif +#endif #ifndef cpu_online #define cpu_online(cpuid) test_bit((cpuid), &cpu_online_map) @@ -2111,7 +2113,9 @@ void _kc_pci_disable_link_state(struct pci_dev *dev, int state); #define pci_disable_link_state(p, s) _kc_pci_disable_link_state(p, s) #else /* < 2.6.26 */ #define NETDEV_CAN_SET_GSO_MAX_SIZE +#if LINUX_VERSION_CODE < KERNEL_VERSION(5,4,0) #include +#endif #define HAVE_NETDEV_VLAN_FEATURES #ifndef PCI_EXP_LNKCAP_ASPMS #define PCI_EXP_LNKCAP_ASPMS 0x00000c00 /* ASPM Support */