Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp3495167pxb; Mon, 18 Oct 2021 16:54:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzDuf1WX9a2WDQDcQG+mve8+ZBHPdEBMaW/wAin37c0b41itHZC/lureiBNbVw8ZRHJa4zQ X-Received: by 2002:a17:907:6da3:: with SMTP id sb35mr15322038ejc.519.1634601250601; Mon, 18 Oct 2021 16:54:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634601250; cv=none; d=google.com; s=arc-20160816; b=PdKoCdirTawgHQ7Qh5Pkx6xnvIw/A99mk/RMcJiNmp/nDQMMip0MIftkOxm/2to4C8 3g7Wj4ZzPpuBFQ2nDiOixQI/zULFn33Ud4TikTcDOOLry8R905/S4bUOU8Sdzc9H+ydl 6qgyFwZkw2nSXIoDwROhI1wzrUS06gCmHMwO92Cdxm9euiFbgv0CCRz8MDL5XfRwu8G+ jU7YRtm2McBjQCaFrXk1NjsKzO/HfTjeCje5nqm/TmNaTH5o1ufdjFmMA4FE9O5p4rc1 Esr4az9ebL9J+gA9kEMQXEQrR2+vIqbPtaRZ0bUXB+ve/2JTq1BS6i1hzVaWc6oPCjAm fzqQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=h9xef1BdV2s5K8jvEv+9b3xMe2Df/5AScMK5N11/sEo=; b=vJ5PFzwgqw3o+PvqzlZ+A7S9F3YxkQOIXgWWZY/04d+6o3KMzTzODCIJzi71LYQUmg 97lyGkjXOC3luSHStuqgnXr9g3GSsNSi01+xk9dZYBTRvGCpFt/GBYzhrDo2rdkaYOlS MRedAKRCXRmfsXCKLgdw9KPPS1BjaHmff9HXl7OXB6QZ5IZCO30/sOQncl7glRSqtEcz kNEAH7swfkB44gNolEh9bwEX2xayT9pjTzVQcTiZ3cSR2AuZ0MgjUTrNrih+OvQh/efG eJk0/oBTo5PhEtcSA4XrUiilvT+NvasMYf+ieG14sNe0DzVZBEZrJCZAZ7MUhTNSyfmg FDbg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=XYqT2a99; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dr14si32052364ejc.16.2021.10.18.16.53.55; Mon, 18 Oct 2021 16:54:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=XYqT2a99; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233671AbhJRXwq (ORCPT + 64 others); Mon, 18 Oct 2021 19:52:46 -0400 Received: from mail.kernel.org ([198.145.29.99]:35066 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233425AbhJRXwm (ORCPT ); Mon, 18 Oct 2021 19:52:42 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id F1ACA61206; Mon, 18 Oct 2021 23:50:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1634601031; bh=PW3M1jNhvW2Fe4gchYFcyIN+J1hiNouMdSO0FaS5GcU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XYqT2a99iLcUePO7yDAUA1dgDucpN3kn6OPfOsj5FCR4XlvwjjEPM+SrBdyge15MQ xvmBRMatQk/d/qx9k6p87keXGs3BTxNDIioOLO9BJshUWL+kXRsOyad7PDI3Jiz2P9 2AcmuVmtcxtgHZ7GVp5kg5NJ7QFclvKvof05l6Lq+3U251yC8ulOsCRIAH1FGeBY4X MlVMPrjqaogZM2IATSKsf3ZkZZbERqEN/a4DNBtPoSU+c17iHUlS5s7tLG2A1tu6Li AjRib7GCObboJUNafisk0QPNEnwAhfvI1YTIRqzfmAcZrdeFqt+0O/itJnfYCtFQRX MrAKArozAjNjA== From: Jakub Kicinski To: kvalo@codeaurora.org Cc: linux-wireless@vger.kernel.org, Jakub Kicinski , ajay.kathat@microchip.com, claudiu.beznea@microchip.com Subject: [PATCH 12/15] wireless: wilc1000: use eth_hw_addr_set() Date: Mon, 18 Oct 2021 16:50:18 -0700 Message-Id: <20211018235021.1279697-13-kuba@kernel.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211018235021.1279697-1-kuba@kernel.org> References: <20211018235021.1279697-1-kuba@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Commit 406f42fa0d3c ("net-next: When a bond have a massive amount of VLANs...") introduced a rbtree for faster Ethernet address look up. To maintain netdev->dev_addr in this tree we need to make all the writes to it got through appropriate helpers. Signed-off-by: Jakub Kicinski --- CC: ajay.kathat@microchip.com CC: claudiu.beznea@microchip.com CC: kvalo@codeaurora.org CC: linux-wireless@vger.kernel.org --- drivers/net/wireless/microchip/wilc1000/netdev.c | 13 +++++++++---- drivers/net/wireless/microchip/wilc1000/netdev.h | 3 ++- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/drivers/net/wireless/microchip/wilc1000/netdev.c b/drivers/net/wireless/microchip/wilc1000/netdev.c index d3b33c6ab93a..690572e01a2a 100644 --- a/drivers/net/wireless/microchip/wilc1000/netdev.c +++ b/drivers/net/wireless/microchip/wilc1000/netdev.c @@ -111,7 +111,8 @@ static struct net_device *get_if_handler(struct wilc *wilc, u8 *mac_header) return ndev; } -void wilc_wlan_set_bssid(struct net_device *wilc_netdev, u8 *bssid, u8 mode) +void wilc_wlan_set_bssid(struct net_device *wilc_netdev, const u8 *bssid, + u8 mode) { struct wilc_vif *vif = netdev_priv(wilc_netdev); @@ -594,10 +595,14 @@ static int wilc_mac_open(struct net_device *ndev) wilc_set_operation_mode(vif, wilc_get_vif_idx(vif), vif->iftype, vif->idx); - if (is_valid_ether_addr(ndev->dev_addr)) + if (is_valid_ether_addr(ndev->dev_addr)) { wilc_set_mac_address(vif, ndev->dev_addr); - else - wilc_get_mac_address(vif, ndev->dev_addr); + } else { + u8 addr[ETH_ALEN]; + + wilc_get_mac_address(vif, addr); + eth_hw_addr_set(ndev, addr); + } netdev_dbg(ndev, "Mac address: %pM\n", ndev->dev_addr); if (!is_valid_ether_addr(ndev->dev_addr)) { diff --git a/drivers/net/wireless/microchip/wilc1000/netdev.h b/drivers/net/wireless/microchip/wilc1000/netdev.h index 79f73a72da57..b9a88b3e322f 100644 --- a/drivers/net/wireless/microchip/wilc1000/netdev.h +++ b/drivers/net/wireless/microchip/wilc1000/netdev.h @@ -287,7 +287,8 @@ void wilc_frmw_to_host(struct wilc *wilc, u8 *buff, u32 size, u32 pkt_offset); void wilc_mac_indicate(struct wilc *wilc); void wilc_netdev_cleanup(struct wilc *wilc); void wilc_wfi_mgmt_rx(struct wilc *wilc, u8 *buff, u32 size); -void wilc_wlan_set_bssid(struct net_device *wilc_netdev, u8 *bssid, u8 mode); +void wilc_wlan_set_bssid(struct net_device *wilc_netdev, const u8 *bssid, + u8 mode); struct wilc_vif *wilc_netdev_ifc_init(struct wilc *wl, const char *name, int vif_type, enum nl80211_iftype type, bool rtnl_locked); -- 2.31.1