From dd088f6377307346c475c58587d9da7459126b48 Mon Sep 17 00:00:00 2001 From: Jakub Fornal Date: Wed, 28 Feb 2018 13:58:58 +0100 Subject: Support for newer kernel versions - ensuring backwarg compatibility --- kmod/igb/igb_main.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/kmod/igb/igb_main.c b/kmod/igb/igb_main.c index 490570bd..97af0376 100644 --- a/kmod/igb/igb_main.c +++ b/kmod/igb/igb_main.c @@ -214,7 +214,11 @@ static long igb_ioctl_file(struct file *file, unsigned int cmd, unsigned long arg); static void igb_vm_open(struct vm_area_struct *vma); static void igb_vm_close(struct vm_area_struct *vma); +#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,11,0) static int igb_vm_fault(struct vm_fault *fdata); +#else +static int igb_vm_fault(struct vm_area_struct *area, struct vm_fault *fdata); +#endif static int igb_mmap(struct file *file, struct vm_area_struct *vma); static ssize_t igb_read(struct file *file, char __user *buf, size_t count, loff_t *pos); @@ -1090,8 +1094,13 @@ static void igb_set_interrupt_capability(struct igb_adapter *adapter, bool msix) for (i = 0; i < numvecs; i++) adapter->msix_entries[i].entry = i; +#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,12,0) err = pci_enable_msix_exact(pdev, adapter->msix_entries, numvecs); +#else + err = pci_enable_msix(pdev, + adapter->msix_entries, numvecs); +#endif if (err == 0) break; } @@ -10708,8 +10717,11 @@ static void igb_vm_open(struct vm_area_struct *vma) static void igb_vm_close(struct vm_area_struct *vma) { } - +#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,11,0) static int igb_vm_fault(struct vm_fault *fdata) +#else +static int igb_vm_fault(struct vm_area_struct *area, struct vm_fault *fdata) +#endif { return VM_FAULT_SIGBUS; } -- cgit v1.2.1