beb6db4996d5475deb27ea1512c2f3e2913ad8dc
[openwrt/staging/nbd.git] / package / kernel / qca-nss-dp / patches / 0017-nss-dp-use-proper-netdev-MAC-helpers.patch
1 From 704706969301076961c15423dedce9e2e6f1026e Mon Sep 17 00:00:00 2001
2 From: Robert Marko <robimarko@gmail.com>
3 Date: Thu, 29 Sep 2022 20:39:07 +0200
4 Subject: [PATCH 16/16] nss-dp: use proper netdev MAC helpers
5
6 mac_addr is const, so utilize proper helpers for setting random and
7 desired MAC addres as old ones were dropped in newer kernels.
8
9 Signed-off-by: Robert Marko <robimarko@gmail.com>
10 ---
11 nss_dp_main.c | 4 ++--
12 1 file changed, 2 insertions(+), 2 deletions(-)
13
14 --- a/nss_dp_main.c
15 +++ b/nss_dp_main.c
16 @@ -599,9 +599,9 @@ static int32_t nss_dp_of_get_pdata(struc
17
18 ret = of_get_mac_address(np, maddr);
19 if (!ret && is_valid_ether_addr(maddr)) {
20 - ether_addr_copy(netdev->dev_addr, maddr);
21 + eth_hw_addr_set(netdev, maddr);
22 } else {
23 - random_ether_addr(netdev->dev_addr);
24 + eth_hw_addr_random(netdev);
25 pr_info("GMAC%d(%px) Invalid MAC@ - using %pM\n", dp_priv->macid,
26 dp_priv, netdev->dev_addr);
27 }