From 9f8570f3cd5ac426578693c4d3d9ff1c16f2a8c6 Mon Sep 17 00:00:00 2001 From: Bjarne von Horn Date: Wed, 7 Feb 2024 15:19:55 +0100 Subject: [PATCH] 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");