ethernet:marvell:Fix compilation errors in K5.15

Fix compilation errors in K5.15
  1. signature of netif_napi_add has changed,
     use netif_napi_add_weight instead
  2. addr issues arising due to constifying
     *dev_addr varable defined in net_device struct

Jira ESDP-16549
Bug 3882239

Change-Id: Id644925d2e1cee71d7fc8f97e9c1982897a744ef
Signed-off-by: Sheetal Tigadoli <stigadoli@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2858625
Reviewed-by: Sumeet Gupta <sumeetg@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
This commit is contained in:
Sheetal Tigadoli
2023-02-15 09:50:11 +00:00
committed by mobile promotions
parent 4abc0b9d03
commit be8bd94e28
3 changed files with 9 additions and 2 deletions

View File

@@ -646,7 +646,7 @@ static void oak_read_set_mac_address(struct pci_dev *pdev)
if (rc != 0) { if (rc != 0) {
pr_info("Device MAC address : %pM\n", device_mac); pr_info("Device MAC address : %pM\n", device_mac);
ether_addr_copy(np->mac_address, nic_mac); ether_addr_copy(np->mac_address, nic_mac);
ether_addr_copy(netdev->dev_addr, nic_mac); eth_hw_addr_set(netdev, nic_mac);
pr_info("MAC address of NIC : %pM\n", nic_mac); pr_info("MAC address of NIC : %pM\n", nic_mac);
} }
} }

View File

@@ -574,7 +574,11 @@ void oak_net_add_napi(struct net_device *netdev)
while (num_ldg > 0) { while (num_ldg > 0) {
/* Initialize a napi context */ /* Initialize a napi context */
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0)
netif_napi_add_weight(netdev, &ldg->napi, oak_net_poll, napi_wt);
#else
netif_napi_add(netdev, &ldg->napi, oak_net_poll, napi_wt); netif_napi_add(netdev, &ldg->napi, oak_net_poll, napi_wt);
#endif
/* Enable NAPI scheduling */ /* Enable NAPI scheduling */
napi_enable(&ldg->napi); napi_enable(&ldg->napi);
++ldg; ++ldg;
@@ -626,7 +630,8 @@ int oak_net_set_mac_addr(struct net_device *dev, void *p_addr)
if (rc == 0) { if (rc == 0) {
rc = -EINVAL; rc = -EINVAL;
} else { } else {
memcpy(dev->dev_addr, addr->sa_data, ETH_ALEN); //memcpy(dev->dev_addr, addr->sa_data, ETH_ALEN);
dev_addr_mod(dev, 0, addr->sa_data, ETH_ALEN);
/* When an interface come up we need to remember the /* When an interface come up we need to remember the
* MAC address of an interface. Because the same MAC * MAC address of an interface. Because the same MAC

View File

@@ -29,6 +29,8 @@
/* Include for relation to classifier linux/if_vlan.h */ /* Include for relation to classifier linux/if_vlan.h */
#include "linux/if_vlan.h" #include "linux/if_vlan.h"
#include <linux/version.h>
#define OAK_ONEBYTE 1 #define OAK_ONEBYTE 1
extern u32 rxs; extern u32 rxs;