Merge branch 'further_leap_fixes' into 'stable-1.5'

Further leap fixes

See merge request etherlab.org/ethercat!117
This commit is contained in:
Florian Pose
2024-02-07 14:52:11 +00:00
5 changed files with 36 additions and 7 deletions

View File

@@ -31,6 +31,17 @@
#define request_dma(X, Y) ((int)(-EINVAL))
#endif
#ifdef CONFIG_SUSE_KERNEL
#include <linux/suse_version.h>
#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)

View File

@@ -19,6 +19,17 @@
#include "igc_tsn-5.14-ethercat.h"
#include "igc_xdp-5.14-ethercat.h"
#ifdef CONFIG_SUSE_KERNEL
#include <linux/suse_version.h>
#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:
@@ -5835,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)
{
@@ -6109,7 +6126,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");

View File

@@ -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)
{

View File

@@ -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)
{

View File

@@ -2,6 +2,7 @@
/* Copyright (c) 2020, Intel Corporation. */
#include <net/xdp_sock_drv.h>
#include <linux/if_vlan.h>
#include "igc-5.14-ethercat.h"
#include "igc_xdp-5.14-ethercat.h"