build/patch/kernel/archive/sunxi-6.5/patches.megous/8723cs-Load-the-MAC-address-from-local-mac-address.patch

43 lines
1.6 KiB
Diff
Raw Normal View History

From c63f62e3c746d0b1a496e7026c8d713108dd6c13 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ond=C5=99ej=20Jirman?= <megi@xff.cz>
Date: Wed, 25 Nov 2020 14:20:34 +0100
Subject: [PATCH 121/464] 8723cs: Load the MAC address from local-mac-address
Signed-off-by: Ondrej Jirman <megi@xff.cz>
---
drivers/staging/rtl8723cs/os_dep/linux/sdio_intf.c | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/rtl8723cs/os_dep/linux/sdio_intf.c b/drivers/staging/rtl8723cs/os_dep/linux/sdio_intf.c
index 5a84037f3745..c20c136d111d 100644
--- a/drivers/staging/rtl8723cs/os_dep/linux/sdio_intf.c
+++ b/drivers/staging/rtl8723cs/os_dep/linux/sdio_intf.c
@@ -823,6 +823,10 @@ _adapter *rtw_sdio_primary_adapter_init(struct dvobj_priv *dvobj)
{
int status = _FAIL;
PADAPTER padapter = NULL;
+ PSDIO_DATA psdio = &dvobj->intf_data;
+ struct device_node *np = psdio->func->dev.of_node;
+ const unsigned char *addr;
+ int len;
padapter = (_adapter *)rtw_zvmalloc(sizeof(*padapter));
if (padapter == NULL)
@@ -883,8 +887,11 @@ _adapter *rtw_sdio_primary_adapter_init(struct dvobj_priv *dvobj)
}
/* 3 8. get WLan MAC address */
- /* set mac addr */
- rtw_macaddr_cfg(adapter_mac_addr(padapter), get_hal_mac_addr(padapter));
+ if (np && (addr = of_get_property(np, "local-mac-address", &len)) && len == ETH_ALEN) {
+ memcpy(adapter_mac_addr(padapter), addr, ETH_ALEN);
+ } else {
+ rtw_macaddr_cfg(adapter_mac_addr(padapter), get_hal_mac_addr(padapter));
+ }
#ifdef CONFIG_MI_WITH_MBSSID_CAM
rtw_mbid_camid_alloc(padapter, adapter_mac_addr(padapter));
--
2.34.1