Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix compile error on linux 6.6 #85

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions modules/exanic/exanic-main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1058,7 +1058,7 @@ static int exanic_probe(struct pci_dev *pdev,
goto err_req_regions;
}

#if defined(CONFIG_PCIEAER)
#if defined(CONFIG_PCIEAER) && LINUX_VERSION_CODE < KERNEL_VERSION(6, 6, 0)
pci_enable_pcie_error_reporting(pdev);
#endif
pci_set_master(pdev);
Expand Down Expand Up @@ -1883,7 +1883,7 @@ static int exanic_probe(struct pci_dev *pdev,
err_regs_ioremap:
err_regs_size:
err_regs_bar_type:
#if defined(CONFIG_PCIEAER)
#if defined(CONFIG_PCIEAER) && LINUX_VERSION_CODE < KERNEL_VERSION(6, 6, 0)
pci_disable_pcie_error_reporting(pdev);
#endif
pci_release_regions(pdev);
Expand Down Expand Up @@ -2002,7 +2002,7 @@ static void exanic_remove(struct pci_dev *pdev)
if (exanic->regs_virt != NULL)
iounmap(exanic->regs_virt);

#if defined(CONFIG_PCIEAER)
#if defined(CONFIG_PCIEAER) && LINUX_VERSION_CODE < KERNEL_VERSION(6, 6, 0)
pci_disable_pcie_error_reporting(pdev);
#endif
pci_release_regions(pdev);
Expand Down
29 changes: 24 additions & 5 deletions modules/exasock/exasock-bonding-sysfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,12 @@
&& LINUX_VERSION_CODE < KERNEL_VERSION(3, 13, 0) \
&& !__HAS_NETDEV_CLASS_CREATE_FILE_NS
static const void *
exabond_get_sysfs_namespace(struct class *cls,
exabond_get_sysfs_namespace(
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 6, 0)
const struct class *cls,
#else
struct class *cls,
#endif
const struct class_attribute *attr)
{
/* This will need to be augmented if we wish to support net namespacing
Expand All @@ -29,8 +34,15 @@ exabond_get_sysfs_namespace(struct class *cls,
#endif

static ssize_t
exabond_masters_show(struct class *c,
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 34)
exabond_masters_show(
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 6, 0)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This has changed on 6.4.0 from what I can see, not 6.6.0

const struct class *c,
#else
struct class *c,
#endif
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 6, 0)
const struct class_attribute *cattr,
#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 34)
struct class_attribute *cattr,
#endif
char *buf)
Expand Down Expand Up @@ -71,8 +83,15 @@ exabond_masters_show(struct class *c,
}

static ssize_t
exabond_masters_store(struct class *c,
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 34)
exabond_masters_store(
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 6, 0)
const struct class *c,
#else
struct class *c,
#endif
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 6, 0)
const struct class_attribute *cattr,
#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 34)
struct class_attribute *cattr,
#endif
const char *buf, size_t count)
Expand Down
4 changes: 3 additions & 1 deletion modules/exasock/exasock-tcp.c
Original file line number Diff line number Diff line change
Expand Up @@ -1426,8 +1426,10 @@ static void exasock_tcp_dead(struct kref *ref)
/* need biglock for this one function to avoid race condition */
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 36)
static DECLARE_MUTEX(update_biglock);
#else
#elif LINUX_VERSION_CODE < KERNEL_VERSION(6, 4, 0)
static DEFINE_SEMAPHORE(update_biglock);
#else
static DEFINE_SEMAPHORE(update_biglock, 1);
#endif
int exasock_tcp_update(struct exasock_tcp *tcp,
uint32_t local_addr, uint16_t local_port,
Expand Down