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

@@ -574,7 +574,11 @@ void oak_net_add_napi(struct net_device *netdev)
while (num_ldg > 0) {
/* 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);
#endif
/* Enable NAPI scheduling */
napi_enable(&ldg->napi);
++ldg;
@@ -626,7 +630,8 @@ int oak_net_set_mac_addr(struct net_device *dev, void *p_addr)
if (rc == 0) {
rc = -EINVAL;
} 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
* MAC address of an interface. Because the same MAC