From 87d109b75773b0476d6b709d3eafa3ca82ef67f2 Mon Sep 17 00:00:00 2001 From: Bjarne von Horn Date: Wed, 7 Feb 2024 15:00:19 +0100 Subject: [PATCH 1/4] add missing include for igc on suse 15.5 --- devices/igc/igc_xdp-5.14-ethercat.c | 1 + 1 file changed, 1 insertion(+) diff --git a/devices/igc/igc_xdp-5.14-ethercat.c b/devices/igc/igc_xdp-5.14-ethercat.c index 5c2d7458..bb928243 100644 --- a/devices/igc/igc_xdp-5.14-ethercat.c +++ b/devices/igc/igc_xdp-5.14-ethercat.c @@ -2,6 +2,7 @@ /* Copyright (c) 2020, Intel Corporation. */ #include +#include #include "igc-5.14-ethercat.h" #include "igc_xdp-5.14-ethercat.h" From fb67d42fc77e6de9ed1533760a293772b83a6e80 Mon Sep 17 00:00:00 2001 From: Bjarne von Horn Date: Wed, 7 Feb 2024 15:19:55 +0100 Subject: [PATCH 2/4] further igc fixes for leap 15.5 --- devices/igc/igc_main-5.14-ethercat.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/devices/igc/igc_main-5.14-ethercat.c b/devices/igc/igc_main-5.14-ethercat.c index d8af934a..48a2fe7c 100644 --- a/devices/igc/igc_main-5.14-ethercat.c +++ b/devices/igc/igc_main-5.14-ethercat.c @@ -19,6 +19,17 @@ #include "igc_tsn-5.14-ethercat.h" #include "igc_xdp-5.14-ethercat.h" +#ifdef CONFIG_SUSE_KERNEL +#include +#else +# ifndef SUSE_VERSION +# define SUSE_VERSION 0 +# endif +# ifndef SUSE_PATCHLEVEL +# define SUSE_PATCHLEVEL 0 +# endif +#endif + #define DRV_SUMMARY "Intel(R) 2.5G Ethernet Linux Driver (EtherCAT enabled)" #define DEFAULT_MSG_ENABLE (NETIF_MSG_DRV | NETIF_MSG_PROBE | NETIF_MSG_LINK) @@ -953,7 +964,11 @@ static int igc_set_mac(struct net_device *netdev, void *p) if (!is_valid_ether_addr(addr->sa_data)) return -EADDRNOTAVAIL; +#if SUSE_VERSION == 15 && SUSE_PATCHLEVEL >= 5 + eth_hw_addr_set(netdev, addr->sa_data); +#else memcpy(netdev->dev_addr, addr->sa_data, netdev->addr_len); +#endif memcpy(hw->mac.addr, addr->sa_data, netdev->addr_len); /* set the correct pool for the new PF MAC address in entry 0 */ @@ -2243,7 +2258,11 @@ static int __igc_xdp_run_prog(struct igc_adapter *adapter, return IGC_XDP_REDIRECT; break; default: +#if SUSE_VERSION == 15 && SUSE_PATCHLEVEL == 5 + bpf_warn_invalid_xdp_action(adapter->netdev, prog, act); +#else bpf_warn_invalid_xdp_action(act); +#endif fallthrough; case XDP_ABORTED: out_failure: @@ -6109,7 +6128,11 @@ static int igc_probe(struct pci_dev *pdev, dev_err(&pdev->dev, "NVM Read Error\n"); } +#if SUSE_VERSION == 15 && SUSE_PATCHLEVEL >= 5 + eth_hw_addr_set(netdev, hw->mac.addr); +#else memcpy(netdev->dev_addr, hw->mac.addr, netdev->addr_len); +#endif if (!is_valid_ether_addr(netdev->dev_addr)) { dev_err(&pdev->dev, "Invalid MAC Address\n"); From fddb7c883e84cf224292310af8f7a925d837fa08 Mon Sep 17 00:00:00 2001 From: Bjarne von Horn Date: Wed, 7 Feb 2024 15:21:04 +0100 Subject: [PATCH 3/4] fix -Wcomment in igc --- devices/igc/igc_main-5.14-ethercat.c | 2 -- devices/igc/igc_main-6.4-ethercat.c | 2 -- devices/igc/igc_main-6.6-ethercat.c | 2 -- 3 files changed, 6 deletions(-) diff --git a/devices/igc/igc_main-5.14-ethercat.c b/devices/igc/igc_main-5.14-ethercat.c index 48a2fe7c..0c83a84d 100644 --- a/devices/igc/igc_main-5.14-ethercat.c +++ b/devices/igc/igc_main-5.14-ethercat.c @@ -5854,8 +5854,6 @@ void ec_poll(struct net_device *netdev) } } -/** - /* PCIe configuration access */ void igc_read_pci_cfg(struct igc_hw *hw, u32 reg, u16 *value) { diff --git a/devices/igc/igc_main-6.4-ethercat.c b/devices/igc/igc_main-6.4-ethercat.c index c3da785b..b9e24d0b 100644 --- a/devices/igc/igc_main-6.4-ethercat.c +++ b/devices/igc/igc_main-6.4-ethercat.c @@ -6579,8 +6579,6 @@ void ec_poll(struct net_device *netdev) } } -/** - /* PCIe configuration access */ void igc_read_pci_cfg(struct igc_hw *hw, u32 reg, u16 *value) { diff --git a/devices/igc/igc_main-6.6-ethercat.c b/devices/igc/igc_main-6.6-ethercat.c index 237e8adb..14cd159f 100644 --- a/devices/igc/igc_main-6.6-ethercat.c +++ b/devices/igc/igc_main-6.6-ethercat.c @@ -6699,8 +6699,6 @@ void ec_poll(struct net_device *netdev) } } -/** - /* PCIe configuration access */ void igc_read_pci_cfg(struct igc_hw *hw, u32 reg, u16 *value) { From 6f3a174de11f0ecc0580ee5ee29a611123804967 Mon Sep 17 00:00:00 2001 From: Bjarne von Horn Date: Wed, 7 Feb 2024 15:24:21 +0100 Subject: [PATCH 4/4] further ccat fixes for leap 15.5 --- devices/ccat/netdev.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/devices/ccat/netdev.c b/devices/ccat/netdev.c index 44e7f669..b122b790 100644 --- a/devices/ccat/netdev.c +++ b/devices/ccat/netdev.c @@ -31,6 +31,17 @@ #define request_dma(X, Y) ((int)(-EINVAL)) #endif +#ifdef CONFIG_SUSE_KERNEL +#include +#else +# ifndef SUSE_VERSION +# define SUSE_VERSION 0 +# endif +# ifndef SUSE_PATCHLEVEL +# define SUSE_PATCHLEVEL 0 +# endif +#endif + #include "module.h" /** @@ -897,7 +908,7 @@ static int ccat_eth_init_netdev(struct ccat_eth_priv *priv) /* init netdev with MAC and stack callbacks */ -#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 15, 0) +#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 15, 0) || (SUSE_VERSION == 15 && SUSE_PATCHLEVEL == 5) u8 mac_addr[ETH_ALEN]; if (priv->netdev->addr_len != ETH_ALEN)