qcacmn: add a new function to update net_device->dev_addr

In kernel 5.17, net_device->dev_addr is changed to const unsigned char*
and can only be updated via dev_addr_mod(). Add a new function
qdf_net_update_net_device_dev_addr() to call kernel API dev_addr_mod().

Change-Id: Ifecfb453f5dc6b066892c04f4bdbec3759e32c53
CRs-Fixed: 3298120
This commit is contained in:
Rajesh Chauhan
2022-09-22 11:53:59 -07:00
committed by Madan Koyyalamudi
parent 1cb111d3bc
commit e895717ffb
4 changed files with 106 additions and 4 deletions

View File

@@ -1,5 +1,6 @@
/*
* Copyright (c) 2014-2020 The Linux Foundation. All rights reserved.
* Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved.
*
* Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the
@@ -41,6 +42,7 @@
#include <linux/ctype.h>
#include "epping_main.h"
#include "epping_internal.h"
#include "qdf_net_if.h"
static int epping_start_adapter(epping_adapter_t *adapter);
static void epping_stop_adapter(epping_adapter_t *adapter);
@@ -220,7 +222,8 @@ static int epping_set_mac_address(struct net_device *dev, void *addr)
struct sockaddr *psta_mac_addr = addr;
qdf_mem_copy(&adapter->macAddressCurrent,
psta_mac_addr->sa_data, ETH_ALEN);
qdf_mem_copy(dev->dev_addr, psta_mac_addr->sa_data, ETH_ALEN);
qdf_net_update_net_device_dev_addr(dev, psta_mac_addr->sa_data,
ETH_ALEN);
return 0;
}
@@ -379,7 +382,9 @@ epping_adapter_t *epping_add_adapter(epping_context_t *pEpping_ctx,
adapter->dev = dev;
adapter->pEpping_ctx = pEpping_ctx;
adapter->device_mode = device_mode; /* station, SAP, etc */
qdf_mem_copy(dev->dev_addr, (void *)macAddr, sizeof(tSirMacAddr));
qdf_net_update_net_device_dev_addr(dev,
(void *)macAddr,
sizeof(tSirMacAddr));
qdf_mem_copy(adapter->macAddressCurrent.bytes,
macAddr, sizeof(tSirMacAddr));
qdf_spinlock_create(&adapter->data_lock);