From patchwork Mon Oct 18 23:50:07 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Kicinski X-Patchwork-Id: 12568317 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id AA705C433F5 for ; Mon, 18 Oct 2021 23:50:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8A048610A2 for ; Mon, 18 Oct 2021 23:50:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233213AbhJRXwk (ORCPT ); Mon, 18 Oct 2021 19:52:40 -0400 Received: from mail.kernel.org ([198.145.29.99]:34924 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229529AbhJRXwj (ORCPT ); Mon, 18 Oct 2021 19:52:39 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 5EF5C610C9; Mon, 18 Oct 2021 23:50:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1634601027; bh=YWPJFhR/l+eQySnV51ofF78uS2SuUCZXlnOxFI2jA4o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WjLhIofykXm6rVzJl23qlB+zwsIbBLuxWJ9mhqdXxranKt0fwYJbKOTKCg2pwrD3s dR4uljMmxmc9Hz+yDX1vZkD5Jn8ekNIW12eXZ+zCMpsTeNWH2CLCHEYyLSelCvVOyq yLg3Jd0eaSSBY39rZvCp2IgEn0a7tFHLFcrcUcF+c/W0DziQmBPiIx3sdU2WxZwv6y urjoJb82jQ0MfICWfbwRiXrxfysd/ChihrdFDQeOC26ri+MT+CqCLyUgBAY7QHU4A/ gjxiJ9dN4IHhZGyxungMfCeC1q7HtYzf2SOMHwvtLKcxADrVDplSLpmAMtteAlzImS VPmowAUWbB8zQ== From: Jakub Kicinski To: kvalo@codeaurora.org Cc: linux-wireless@vger.kernel.org, Jakub Kicinski Subject: [PATCH 01/15] wireless: use eth_hw_addr_set() Date: Mon, 18 Oct 2021 16:50:07 -0700 Message-Id: <20211018235021.1279697-2-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 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Convert all WiFi drivers from memcpy(... ETH_ADDR) to eth_hw_addr_set(): @@ expression dev, np; @@ - memcpy(dev->dev_addr, np, ETH_ALEN) + eth_hw_addr_set(dev, np) Signed-off-by: Jakub Kicinski --- drivers/net/wireless/ath/ath6kl/cfg80211.c | 2 +- drivers/net/wireless/atmel/atmel.c | 2 +- drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c | 6 +++--- drivers/net/wireless/intel/ipw2x00/ipw2100.c | 4 ++-- drivers/net/wireless/intel/ipw2x00/ipw2200.c | 4 ++-- drivers/net/wireless/intersil/hostap/hostap_main.c | 4 ++-- drivers/net/wireless/intersil/orinoco/main.c | 2 +- drivers/net/wireless/marvell/libertas/cmd.c | 5 ++--- drivers/net/wireless/marvell/libertas/main.c | 4 ++-- drivers/net/wireless/marvell/mwifiex/uap_event.c | 3 +-- drivers/net/wireless/quantenna/qtnfmac/core.c | 2 +- 11 files changed, 18 insertions(+), 20 deletions(-) diff --git a/drivers/net/wireless/ath/ath6kl/cfg80211.c b/drivers/net/wireless/ath/ath6kl/cfg80211.c index fefdc6753acd..51cc5f898a79 100644 --- a/drivers/net/wireless/ath/ath6kl/cfg80211.c +++ b/drivers/net/wireless/ath/ath6kl/cfg80211.c @@ -3803,7 +3803,7 @@ struct wireless_dev *ath6kl_interface_add(struct ath6kl *ar, const char *name, vif->htcap[NL80211_BAND_2GHZ].ht_enable = true; vif->htcap[NL80211_BAND_5GHZ].ht_enable = true; - memcpy(ndev->dev_addr, ar->mac_addr, ETH_ALEN); + eth_hw_addr_set(ndev, ar->mac_addr); if (fw_vif_idx != 0) { ndev->dev_addr[0] = (ndev->dev_addr[0] ^ (1 << fw_vif_idx)) | 0x2; diff --git a/drivers/net/wireless/atmel/atmel.c b/drivers/net/wireless/atmel/atmel.c index febce4e8b3dd..3d782fabbfe6 100644 --- a/drivers/net/wireless/atmel/atmel.c +++ b/drivers/net/wireless/atmel/atmel.c @@ -3730,7 +3730,7 @@ static int probe_atmel_card(struct net_device *dev) 0x00, 0x04, 0x25, 0x00, 0x00, 0x00 }; printk(KERN_ALERT "%s: *** Invalid MAC address. UPGRADE Firmware ****\n", dev->name); - memcpy(dev->dev_addr, default_mac, ETH_ALEN); + eth_hw_addr_set(dev, default_mac); } } diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c index db5f8535fdb5..fed9cd5f29a2 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c @@ -244,7 +244,7 @@ static int brcmf_netdev_set_mac_address(struct net_device *ndev, void *addr) } else { brcmf_dbg(TRACE, "updated to %pM\n", sa->sa_data); memcpy(ifp->mac_addr, sa->sa_data, ETH_ALEN); - memcpy(ifp->ndev->dev_addr, ifp->mac_addr, ETH_ALEN); + eth_hw_addr_set(ifp->ndev, ifp->mac_addr); } return err; } @@ -655,7 +655,7 @@ int brcmf_net_attach(struct brcmf_if *ifp, bool locked) ndev->ethtool_ops = &brcmf_ethtool_ops; /* set the mac address & netns */ - memcpy(ndev->dev_addr, ifp->mac_addr, ETH_ALEN); + eth_hw_addr_set(ndev, ifp->mac_addr); dev_net_set(ndev, wiphy_net(cfg_to_wiphy(drvr->config))); INIT_WORK(&ifp->multicast_work, _brcmf_set_multicast_list); @@ -830,7 +830,7 @@ static int brcmf_net_p2p_attach(struct brcmf_if *ifp) ndev->netdev_ops = &brcmf_netdev_ops_p2p; /* set the mac address */ - memcpy(ndev->dev_addr, ifp->mac_addr, ETH_ALEN); + eth_hw_addr_set(ndev, ifp->mac_addr); if (register_netdev(ndev) != 0) { bphy_err(drvr, "couldn't register the p2p net device\n"); diff --git a/drivers/net/wireless/intel/ipw2x00/ipw2100.c b/drivers/net/wireless/intel/ipw2x00/ipw2100.c index 47eb89b773cf..2ace2b27ecad 100644 --- a/drivers/net/wireless/intel/ipw2x00/ipw2100.c +++ b/drivers/net/wireless/intel/ipw2x00/ipw2100.c @@ -4685,7 +4685,7 @@ static int ipw2100_read_mac_address(struct ipw2100_priv *priv) return -EIO; } - memcpy(priv->net_dev->dev_addr, addr, ETH_ALEN); + eth_hw_addr_set(priv->net_dev, addr); IPW_DEBUG_INFO("card MAC is %pM\n", priv->net_dev->dev_addr); return 0; @@ -4712,7 +4712,7 @@ static int ipw2100_set_mac_address(struct ipw2100_priv *priv, int batch_mode) if (priv->config & CFG_CUSTOM_MAC) { memcpy(cmd.host_command_parameters, priv->mac_addr, ETH_ALEN); - memcpy(priv->net_dev->dev_addr, priv->mac_addr, ETH_ALEN); + eth_hw_addr_set(priv->net_dev, priv->mac_addr); } else memcpy(cmd.host_command_parameters, priv->net_dev->dev_addr, ETH_ALEN); diff --git a/drivers/net/wireless/intel/ipw2x00/ipw2200.c b/drivers/net/wireless/intel/ipw2x00/ipw2200.c index 9a99f482c84a..0a38d17744a9 100644 --- a/drivers/net/wireless/intel/ipw2x00/ipw2200.c +++ b/drivers/net/wireless/intel/ipw2x00/ipw2200.c @@ -11185,7 +11185,7 @@ static int ipw_up(struct ipw_priv *priv) ipw_init_ordinals(priv); if (!(priv->config & CFG_CUSTOM_MAC)) eeprom_parse_mac(priv, priv->mac_addr); - memcpy(priv->net_dev->dev_addr, priv->mac_addr, ETH_ALEN); + eth_hw_addr_set(priv->net_dev, priv->mac_addr); ipw_set_geo(priv); @@ -11542,7 +11542,7 @@ static int ipw_prom_alloc(struct ipw_priv *priv) priv->prom_priv->priv = priv; strcpy(priv->prom_net_dev->name, "rtap%d"); - memcpy(priv->prom_net_dev->dev_addr, priv->mac_addr, ETH_ALEN); + eth_hw_addr_set(priv->prom_net_dev, priv->mac_addr); priv->prom_net_dev->type = ARPHRD_IEEE80211_RADIOTAP; priv->prom_net_dev->netdev_ops = &ipw_prom_netdev_ops; diff --git a/drivers/net/wireless/intersil/hostap/hostap_main.c b/drivers/net/wireless/intersil/hostap/hostap_main.c index 54f67b682b6a..787f685e70b4 100644 --- a/drivers/net/wireless/intersil/hostap/hostap_main.c +++ b/drivers/net/wireless/intersil/hostap/hostap_main.c @@ -713,9 +713,9 @@ static int prism2_set_mac_address(struct net_device *dev, void *p) read_lock_bh(&local->iface_lock); list_for_each(ptr, &local->hostap_interfaces) { iface = list_entry(ptr, struct hostap_interface, list); - memcpy(iface->dev->dev_addr, addr->sa_data, ETH_ALEN); + eth_hw_addr_set(iface->dev, addr->sa_data); } - memcpy(local->dev->dev_addr, addr->sa_data, ETH_ALEN); + eth_hw_addr_set(local->dev, addr->sa_data); read_unlock_bh(&local->iface_lock); return 0; diff --git a/drivers/net/wireless/intersil/orinoco/main.c b/drivers/net/wireless/intersil/orinoco/main.c index 0e73a10cc06c..7df88d20ff3d 100644 --- a/drivers/net/wireless/intersil/orinoco/main.c +++ b/drivers/net/wireless/intersil/orinoco/main.c @@ -2265,7 +2265,7 @@ int orinoco_if_add(struct orinoco_private *priv, netif_carrier_off(dev); - memcpy(dev->dev_addr, wiphy->perm_addr, ETH_ALEN); + eth_hw_addr_set(dev, wiphy->perm_addr); dev->base_addr = base_addr; dev->irq = irq; diff --git a/drivers/net/wireless/marvell/libertas/cmd.c b/drivers/net/wireless/marvell/libertas/cmd.c index a4d9dd73b258..104d2b6dc9af 100644 --- a/drivers/net/wireless/marvell/libertas/cmd.c +++ b/drivers/net/wireless/marvell/libertas/cmd.c @@ -150,10 +150,9 @@ int lbs_update_hw_spec(struct lbs_private *priv) memmove(priv->current_addr, cmd.permanentaddr, ETH_ALEN); if (!priv->copied_hwaddr) { - memcpy(priv->dev->dev_addr, priv->current_addr, ETH_ALEN); + eth_hw_addr_set(priv->dev, priv->current_addr); if (priv->mesh_dev) - memcpy(priv->mesh_dev->dev_addr, - priv->current_addr, ETH_ALEN); + eth_hw_addr_set(priv->mesh_dev, priv->current_addr); priv->copied_hwaddr = 1; } diff --git a/drivers/net/wireless/marvell/libertas/main.c b/drivers/net/wireless/marvell/libertas/main.c index 64fc5e410864..5c9f295536ea 100644 --- a/drivers/net/wireless/marvell/libertas/main.c +++ b/drivers/net/wireless/marvell/libertas/main.c @@ -302,9 +302,9 @@ int lbs_set_mac_address(struct net_device *dev, void *addr) dev = priv->dev; memcpy(priv->current_addr, phwaddr->sa_data, ETH_ALEN); - memcpy(dev->dev_addr, phwaddr->sa_data, ETH_ALEN); + eth_hw_addr_set(dev, phwaddr->sa_data); if (priv->mesh_dev) - memcpy(priv->mesh_dev->dev_addr, phwaddr->sa_data, ETH_ALEN); + eth_hw_addr_set(priv->mesh_dev, phwaddr->sa_data); return ret; } diff --git a/drivers/net/wireless/marvell/mwifiex/uap_event.c b/drivers/net/wireless/marvell/mwifiex/uap_event.c index 9121447e2701..2e25d72dcac5 100644 --- a/drivers/net/wireless/marvell/mwifiex/uap_event.c +++ b/drivers/net/wireless/marvell/mwifiex/uap_event.c @@ -197,8 +197,7 @@ int mwifiex_process_uap_event(struct mwifiex_private *priv) mwifiex_dbg(adapter, EVENT, "AP EVENT: event id: %#x\n", eventcause); priv->port_open = false; - memcpy(priv->netdev->dev_addr, adapter->event_body + 2, - ETH_ALEN); + eth_hw_addr_set(priv->netdev, adapter->event_body + 2); if (priv->hist_data) mwifiex_hist_data_reset(priv); mwifiex_check_uap_capabilities(priv, adapter->event_skb); diff --git a/drivers/net/wireless/quantenna/qtnfmac/core.c b/drivers/net/wireless/quantenna/qtnfmac/core.c index 01725237836e..907a1c2c1b6d 100644 --- a/drivers/net/wireless/quantenna/qtnfmac/core.c +++ b/drivers/net/wireless/quantenna/qtnfmac/core.c @@ -179,7 +179,7 @@ static int qtnf_netdev_set_mac_address(struct net_device *ndev, void *addr) sa->sa_data); if (ret) - memcpy(ndev->dev_addr, old_addr, ETH_ALEN); + eth_hw_addr_set(ndev, old_addr); return ret; } From patchwork Mon Oct 18 23:50:08 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Kicinski X-Patchwork-Id: 12568319 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A8A1FC4332F for ; Mon, 18 Oct 2021 23:50:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8EEF661250 for ; Mon, 18 Oct 2021 23:50:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233239AbhJRXwl (ORCPT ); Mon, 18 Oct 2021 19:52:41 -0400 Received: from mail.kernel.org ([198.145.29.99]:34930 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229710AbhJRXwj (ORCPT ); Mon, 18 Oct 2021 19:52:39 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id A2B4161177; Mon, 18 Oct 2021 23:50:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1634601027; bh=ozgquof7mrl3x3m/m1WfeR4uowUm86vibx6xBhByfp4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=E+uD3DrdwGP00PFL7lwbzfp7QGCPiqRIQ6U2XPz6oJVcfiCH9evRalvuUlGHbQbRs 1DDAP8XxcoyRmx6t4GaO/urZ0/ouE8guN4g4Lo8pIyf4jLOG3yIOPQoaI0EhVBFVv1 7WnV638yVIsW2Pc432zpdel5m71018zYEWus0fgrLz+xQ6VkIfc9ZzG2tWRN+cmB8E MHxQdMOFwffHE4hlXAZuqWaPjSLPjvy0+9vdbzK3Og6eNMje1W2tZ0M+u/OBtX33Am rj4W9C8xXvHyaZ2Z3922f0Vp8f7EedPgAY4SbVU9qb00iKJncgTcOawcoTpDrwmIwi NMIxHB0FKNW5A== From: Jakub Kicinski To: kvalo@codeaurora.org Cc: linux-wireless@vger.kernel.org, Jakub Kicinski Subject: [PATCH 02/15] wireless: use eth_hw_addr_set() instead of ether_addr_copy() Date: Mon, 18 Oct 2021 16:50:08 -0700 Message-Id: <20211018235021.1279697-3-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 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. Convert wireless from ether_addr_copy() to eth_hw_addr_set(): @@ expression dev, np; @@ - ether_addr_copy(dev->dev_addr, np) + eth_hw_addr_set(dev, np) Signed-off-by: Jakub Kicinski --- drivers/net/wireless/ath/wil6210/cfg80211.c | 4 ++-- drivers/net/wireless/ath/wil6210/main.c | 6 +++--- drivers/net/wireless/marvell/mwifiex/main.c | 2 +- drivers/net/wireless/quantenna/qtnfmac/core.c | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/net/wireless/ath/wil6210/cfg80211.c b/drivers/net/wireless/ath/wil6210/cfg80211.c index 1ff2679963f0..bd8d0a54af77 100644 --- a/drivers/net/wireless/ath/wil6210/cfg80211.c +++ b/drivers/net/wireless/ath/wil6210/cfg80211.c @@ -723,9 +723,9 @@ wil_cfg80211_add_iface(struct wiphy *wiphy, const char *name, ndev = vif_to_ndev(vif); ether_addr_copy(ndev->perm_addr, ndev_main->perm_addr); if (is_valid_ether_addr(params->macaddr)) { - ether_addr_copy(ndev->dev_addr, params->macaddr); + eth_hw_addr_set(ndev, params->macaddr); } else { - ether_addr_copy(ndev->dev_addr, ndev_main->perm_addr); + eth_hw_addr_set(ndev, ndev_main->perm_addr); ndev->dev_addr[0] = (ndev->dev_addr[0] ^ (1 << vif->mid)) | 0x2; /* locally administered */ } diff --git a/drivers/net/wireless/ath/wil6210/main.c b/drivers/net/wireless/ath/wil6210/main.c index 3ba5b2550a8c..7da87c9f363f 100644 --- a/drivers/net/wireless/ath/wil6210/main.c +++ b/drivers/net/wireless/ath/wil6210/main.c @@ -1358,7 +1358,7 @@ static int wil_get_bl_info(struct wil6210_priv *wil) ether_addr_copy(ndev->perm_addr, mac); ether_addr_copy(wiphy->perm_addr, mac); if (!is_valid_ether_addr(ndev->dev_addr)) - ether_addr_copy(ndev->dev_addr, mac); + eth_hw_addr_set(ndev, mac); if (rf_status) {/* bad RF cable? */ wil_err(wil, "RF communication error 0x%04x", @@ -1431,7 +1431,7 @@ static int wil_get_otp_info(struct wil6210_priv *wil) ether_addr_copy(ndev->perm_addr, mac); ether_addr_copy(wiphy->perm_addr, mac); if (!is_valid_ether_addr(ndev->dev_addr)) - ether_addr_copy(ndev->dev_addr, mac); + eth_hw_addr_set(ndev, mac); return 0; } @@ -1609,7 +1609,7 @@ int wil_reset(struct wil6210_priv *wil, bool load_fw) struct net_device *ndev = wil->main_ndev; ether_addr_copy(ndev->perm_addr, mac); - ether_addr_copy(ndev->dev_addr, ndev->perm_addr); + eth_hw_addr_set(ndev, ndev->perm_addr); return 0; } diff --git a/drivers/net/wireless/marvell/mwifiex/main.c b/drivers/net/wireless/marvell/mwifiex/main.c index 7943fd3b3058..a0f9a6113f78 100644 --- a/drivers/net/wireless/marvell/mwifiex/main.c +++ b/drivers/net/wireless/marvell/mwifiex/main.c @@ -985,7 +985,7 @@ int mwifiex_set_mac_address(struct mwifiex_private *priv, return ret; } - ether_addr_copy(dev->dev_addr, priv->curr_addr); + eth_hw_addr_set(dev, priv->curr_addr); return 0; } diff --git a/drivers/net/wireless/quantenna/qtnfmac/core.c b/drivers/net/wireless/quantenna/qtnfmac/core.c index 907a1c2c1b6d..2a63ffdc4b2c 100644 --- a/drivers/net/wireless/quantenna/qtnfmac/core.c +++ b/drivers/net/wireless/quantenna/qtnfmac/core.c @@ -478,7 +478,7 @@ int qtnf_core_net_attach(struct qtnf_wmac *mac, struct qtnf_vif *vif, dev->needs_free_netdev = true; dev_net_set(dev, wiphy_net(wiphy)); dev->ieee80211_ptr = &vif->wdev; - ether_addr_copy(dev->dev_addr, vif->mac_addr); + eth_hw_addr_set(dev, vif->mac_addr); dev->flags |= IFF_BROADCAST | IFF_MULTICAST; dev->watchdog_timeo = QTNF_DEF_WDOG_TIMEOUT; dev->tx_queue_len = 100; From patchwork Mon Oct 18 23:50:09 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Kicinski X-Patchwork-Id: 12568321 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id AF707C433F5 for ; Mon, 18 Oct 2021 23:50:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9750961263 for ; Mon, 18 Oct 2021 23:50:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233252AbhJRXwl (ORCPT ); Mon, 18 Oct 2021 19:52:41 -0400 Received: from mail.kernel.org ([198.145.29.99]:34936 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232256AbhJRXwj (ORCPT ); Mon, 18 Oct 2021 19:52:39 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id E4FF061206; Mon, 18 Oct 2021 23:50:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1634601028; bh=ukd+R49DUQREErzqLqUOozd0TGISYib4Ep8MxPeGCK8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tmxfz7bndsAIXWpgf/Mr/NQD2VGTxKBNtwDolUo2Sc1xO8+iINTz7KrR7idMPmf79 rkQ+RoyFfRrvG8jyAsa46v4rhgkkmXhZBm+zQWreUP15BNy4NWf2sKRtoXC8kjl20o h8f0vnA4Bm5sWKgFrIcWE1Iap4SZQGBPzfaR83a1SZLU7PtqME9TozOPgaaOm9892C P7RnR4+RoObPGBVdW4VE4WKL8Ywdzq0QJaLnO+k6xitW8p/ANF14TAzHKzLJhS+YXa 4zjbcJ6K+zTJ7cutqdAwQOx47jRrmY88C0iAtGfCmjNf1fGIgVzDo5yweIJdjt9BHP zDdPfaFQtGxuw== From: Jakub Kicinski To: kvalo@codeaurora.org Cc: linux-wireless@vger.kernel.org, Jakub Kicinski Subject: [PATCH 03/15] wireless: use eth_hw_addr_set() for dev->addr_len cases Date: Mon, 18 Oct 2021 16:50:09 -0700 Message-Id: <20211018235021.1279697-4-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 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Convert all WiFi drivers from memcpy(... dev->addr_len) to eth_hw_addr_set(): @@ expression dev, np; @@ - memcpy(dev->dev_addr, np, dev->addr_len) + eth_hw_addr_set(dev, np) Manually checked the netdevs are allocated with alloc_etherdev(), so dev->addr_len must be equal to ETH_ALEN. Signed-off-by: Jakub Kicinski --- drivers/net/wireless/atmel/atmel.c | 2 +- drivers/net/wireless/zydas/zd1201.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/atmel/atmel.c b/drivers/net/wireless/atmel/atmel.c index 3d782fabbfe6..8290cf881a1b 100644 --- a/drivers/net/wireless/atmel/atmel.c +++ b/drivers/net/wireless/atmel/atmel.c @@ -1296,7 +1296,7 @@ static int atmel_set_mac_address(struct net_device *dev, void *p) { struct sockaddr *addr = p; - memcpy (dev->dev_addr, addr->sa_data, dev->addr_len); + eth_hw_addr_set(dev, addr->sa_data); return atmel_open(dev); } diff --git a/drivers/net/wireless/zydas/zd1201.c b/drivers/net/wireless/zydas/zd1201.c index 097805b55c59..6b735fee7b18 100644 --- a/drivers/net/wireless/zydas/zd1201.c +++ b/drivers/net/wireless/zydas/zd1201.c @@ -857,7 +857,7 @@ static int zd1201_set_mac_address(struct net_device *dev, void *p) addr->sa_data, dev->addr_len, 1); if (err) return err; - memcpy(dev->dev_addr, addr->sa_data, dev->addr_len); + eth_hw_addr_set(dev, addr->sa_data); return zd1201_mac_reset(zd); } From patchwork Mon Oct 18 23:50:10 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Kicinski X-Patchwork-Id: 12568323 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C9731C433EF for ; Mon, 18 Oct 2021 23:50:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A23626128B for ; Mon, 18 Oct 2021 23:50:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233389AbhJRXwm (ORCPT ); Mon, 18 Oct 2021 19:52:42 -0400 Received: from mail.kernel.org ([198.145.29.99]:34930 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229524AbhJRXwk (ORCPT ); Mon, 18 Oct 2021 19:52:40 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 33552610C9; Mon, 18 Oct 2021 23:50:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1634601028; bh=kwH7Lzwfk17wYLmdNe76BVq2rpoTyKD/qw17t0ZoCMM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LVy+aGWYMB5bvRmkMSX+8JGuZR2BnjVJ0/MgKlc4Hwm+LIvQf4DZO+FpORR8jdaXe ygRqta97+ie5hmsD0lJAT3/B+ibXNW3EEAjEe+e5tNIvP1cnBZ7nfwmhpGtFQBTbUY g6mkM5ef8kILlD0QJ2iEJqUpZX/qG75wzSDuIXcWrD2PIgK0XM5BQvRqR2u5ecczJ5 3MzhIGDUdDE+a/Hj70sePCCgJ2rv2IHl8g4JIX2aukBKMejpspK1xVNFUgsOHIV5k/ xzyfvBhkRL7TjqjHwrMV0/MnWZi/h/RSkB0XcQMqMP0FX61j94mGtwqwsXqOO979Ps Hs+b27DOag7WA== From: Jakub Kicinski To: kvalo@codeaurora.org Cc: linux-wireless@vger.kernel.org, Jakub Kicinski Subject: [PATCH 04/15] wireless: ath6kl: use eth_hw_addr_set() Date: Mon, 18 Oct 2021 16:50:10 -0700 Message-Id: <20211018235021.1279697-5-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 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. Do the special encoding on the stack, then copy the address. Signed-off-by: Jakub Kicinski --- CC: kvalo@codeaurora.org CC: linux-wireless@vger.kernel.org --- drivers/net/wireless/ath/ath6kl/cfg80211.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/net/wireless/ath/ath6kl/cfg80211.c b/drivers/net/wireless/ath/ath6kl/cfg80211.c index 51cc5f898a79..bd1183830e91 100644 --- a/drivers/net/wireless/ath/ath6kl/cfg80211.c +++ b/drivers/net/wireless/ath/ath6kl/cfg80211.c @@ -3781,6 +3781,7 @@ struct wireless_dev *ath6kl_interface_add(struct ath6kl *ar, const char *name, { struct net_device *ndev; struct ath6kl_vif *vif; + u8 addr[ETH_ALEN]; ndev = alloc_netdev(sizeof(*vif), name, name_assign_type, ether_setup); if (!ndev) @@ -3803,14 +3804,14 @@ struct wireless_dev *ath6kl_interface_add(struct ath6kl *ar, const char *name, vif->htcap[NL80211_BAND_2GHZ].ht_enable = true; vif->htcap[NL80211_BAND_5GHZ].ht_enable = true; - eth_hw_addr_set(ndev, ar->mac_addr); + ether_addr_copy(addr, ar->mac_addr); if (fw_vif_idx != 0) { - ndev->dev_addr[0] = (ndev->dev_addr[0] ^ (1 << fw_vif_idx)) | - 0x2; + addr[0] = (addr[0] ^ (1 << fw_vif_idx)) | 0x2; if (test_bit(ATH6KL_FW_CAPABILITY_CUSTOM_MAC_ADDR, ar->fw_capabilities)) - ndev->dev_addr[4] ^= 0x80; + addr[4] ^= 0x80; } + eth_hw_addr_set(ndev, addr); init_netdev(ndev); From patchwork Mon Oct 18 23:50:11 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Kicinski X-Patchwork-Id: 12568325 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 20ACDC433FE for ; Mon, 18 Oct 2021 23:50:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0F2C861177 for ; Mon, 18 Oct 2021 23:50:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233423AbhJRXwm (ORCPT ); Mon, 18 Oct 2021 19:52:42 -0400 Received: from mail.kernel.org ([198.145.29.99]:34966 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233214AbhJRXwk (ORCPT ); Mon, 18 Oct 2021 19:52:40 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 7B10861212; Mon, 18 Oct 2021 23:50:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1634601028; bh=jIuhnQdYPilsja0WYjDomP62jFeD4RXWayZ4HTtnz+o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Gh719nB2PJ+N78txqniyyeUouV96PACt4TWvnN6tSrigWS0x/OMUB6Vo4vZzkiLUN rGxGhanh5ja+GHY/Z7Ati712lh29v9P5o2aV62qTlAoYyrtwq1x1lbGsEQzc63aVmZ DUbGUOe1GtxhXoNzUGN+Vcf1uZ+cfxbw4cR7H4zPfS5U8HBRVwNpY85iUg7V66174Z KoXhIL7PPYxNcUxYOxCHetetzxWCjarFkkdpZMFw0e4f7RXqMLpVT4/ErT7bMvVqse eQKqTt0OsV7hDExKODSHaL+cFsmzs9obVcx8qsLPia0AVfOHFUTZid8m3jX72Nq7Hj ImlqJiCaALxQw== From: Jakub Kicinski To: kvalo@codeaurora.org Cc: linux-wireless@vger.kernel.org, Jakub Kicinski , merez@codeaurora.org, wil6210@qti.qualcomm.com Subject: [PATCH 05/15] wireless: wil6210: use eth_hw_addr_set() Date: Mon, 18 Oct 2021 16:50:11 -0700 Message-Id: <20211018235021.1279697-6-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 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. Do the special encoding on the stack, then copy the address. Signed-off-by: Jakub Kicinski --- CC: merez@codeaurora.org CC: kvalo@codeaurora.org CC: linux-wireless@vger.kernel.org CC: wil6210@qti.qualcomm.com --- drivers/net/wireless/ath/wil6210/cfg80211.c | 8 +++++--- drivers/net/wireless/ath/wil6210/wil6210.h | 2 +- drivers/net/wireless/ath/wil6210/wmi.c | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/drivers/net/wireless/ath/wil6210/cfg80211.c b/drivers/net/wireless/ath/wil6210/cfg80211.c index bd8d0a54af77..764d1d14132b 100644 --- a/drivers/net/wireless/ath/wil6210/cfg80211.c +++ b/drivers/net/wireless/ath/wil6210/cfg80211.c @@ -725,9 +725,11 @@ wil_cfg80211_add_iface(struct wiphy *wiphy, const char *name, if (is_valid_ether_addr(params->macaddr)) { eth_hw_addr_set(ndev, params->macaddr); } else { - eth_hw_addr_set(ndev, ndev_main->perm_addr); - ndev->dev_addr[0] = (ndev->dev_addr[0] ^ (1 << vif->mid)) | - 0x2; /* locally administered */ + u8 addr[ETH_ALEN]; + + ether_addr_copy(addr, ndev_main->perm_addr); + addr[0] = (addr[0] ^ (1 << vif->mid)) | 0x2; /* locally administered */ + eth_hw_addr_set(ndev, addr); } wdev = vif_to_wdev(vif); ether_addr_copy(wdev->address, ndev->dev_addr); diff --git a/drivers/net/wireless/ath/wil6210/wil6210.h b/drivers/net/wireless/ath/wil6210/wil6210.h index 30392eb1cbbd..11946ecd0b99 100644 --- a/drivers/net/wireless/ath/wil6210/wil6210.h +++ b/drivers/net/wireless/ath/wil6210/wil6210.h @@ -1341,7 +1341,7 @@ struct wil6210_priv *wil_cfg80211_init(struct device *dev); void wil_cfg80211_deinit(struct wil6210_priv *wil); void wil_p2p_wdev_free(struct wil6210_priv *wil); -int wmi_set_mac_address(struct wil6210_priv *wil, void *addr); +int wmi_set_mac_address(struct wil6210_priv *wil, const void *addr); int wmi_pcp_start(struct wil6210_vif *vif, int bi, u8 wmi_nettype, u8 chan, u8 edmg_chan, u8 hidden_ssid, u8 is_go); int wmi_pcp_stop(struct wil6210_vif *vif); diff --git a/drivers/net/wireless/ath/wil6210/wmi.c b/drivers/net/wireless/ath/wil6210/wmi.c index 2dc8406736f4..dd8abbb28849 100644 --- a/drivers/net/wireless/ath/wil6210/wmi.c +++ b/drivers/net/wireless/ath/wil6210/wmi.c @@ -2097,7 +2097,7 @@ int wmi_echo(struct wil6210_priv *wil) WIL_WMI_CALL_GENERAL_TO_MS); } -int wmi_set_mac_address(struct wil6210_priv *wil, void *addr) +int wmi_set_mac_address(struct wil6210_priv *wil, const void *addr) { struct wil6210_vif *vif = ndev_to_vif(wil->main_ndev); struct wmi_set_mac_address_cmd cmd; From patchwork Mon Oct 18 23:50:12 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Kicinski X-Patchwork-Id: 12568327 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DF14DC4332F for ; Mon, 18 Oct 2021 23:50:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C278E61002 for ; Mon, 18 Oct 2021 23:50:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233256AbhJRXwn (ORCPT ); Mon, 18 Oct 2021 19:52:43 -0400 Received: from mail.kernel.org ([198.145.29.99]:34974 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233225AbhJRXwk (ORCPT ); Mon, 18 Oct 2021 19:52:40 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id CE06361206; Mon, 18 Oct 2021 23:50:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1634601029; bh=DBQUeNzVSQKmMw1csFG8/5M8FZQUluIRCnZ5+nd6sjk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vGh89+VH/sifJi2xi7QPAhKGEBz4rhX5Qlc+jx2p5TQvyXK8oqWlt8cPyYoVQfmUT veWslQCqCXBb0KmTokxqxeUOFbEHdVc7WIciYjSHQIw0dZc+YyQCNfZTR0Aj3bzodI kk7UEPUvSYAU6l5RWseIGr0aMzY6RjmEURPK8PtUrsA9mWCFhxedQj7D+RNFknUTNl CLNN97lLXbTWrTJdx5nYBbHuvdPCFUBlaTbDfzlnaxJiYvL8ae2ehecqWH0PI7klDB COpyhfom7T1hB9qYgo2oZQEPMOqFuGpLuTS4lYg71bg7HCoyrAGUw+sez2yhSXx2ky bderGkGKgypFg== From: Jakub Kicinski To: kvalo@codeaurora.org Cc: linux-wireless@vger.kernel.org, Jakub Kicinski , simon@thekelleys.org.uk Subject: [PATCH 06/15] wireless: atmel: use eth_hw_addr_set() Date: Mon, 18 Oct 2021 16:50:12 -0700 Message-Id: <20211018235021.1279697-7-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 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. Use a buffer on the stack. Note that atmel_get_mib() is a wrapper around atmel_copy_to_host(). For the to device direction we just need to make sure functions respect argument being cost. Signed-off-by: Jakub Kicinski --- CC: simon@thekelleys.org.uk CC: kvalo@codeaurora.org CC: linux-wireless@vger.kernel.org --- drivers/net/wireless/atmel/atmel.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/drivers/net/wireless/atmel/atmel.c b/drivers/net/wireless/atmel/atmel.c index 8290cf881a1b..35c2e798d98b 100644 --- a/drivers/net/wireless/atmel/atmel.c +++ b/drivers/net/wireless/atmel/atmel.c @@ -600,7 +600,7 @@ static void atmel_set_mib8(struct atmel_private *priv, u8 type, u8 index, static void atmel_set_mib16(struct atmel_private *priv, u8 type, u8 index, u16 data); static void atmel_set_mib(struct atmel_private *priv, u8 type, u8 index, - u8 *data, int data_len); + const u8 *data, int data_len); static void atmel_get_mib(struct atmel_private *priv, u8 type, u8 index, u8 *data, int data_len); static void atmel_scan(struct atmel_private *priv, int specific_ssid); @@ -3669,6 +3669,7 @@ static int probe_atmel_card(struct net_device *dev) { int rc = 0; struct atmel_private *priv = netdev_priv(dev); + u8 addr[ETH_ALEN] = {}; /* reset pccard */ if (priv->bus_type == BUS_TYPE_PCCARD) @@ -3693,7 +3694,9 @@ static int probe_atmel_card(struct net_device *dev) if (i == 0) { printk(KERN_ALERT "%s: MAC failed to boot MAC address reader.\n", dev->name); } else { - atmel_copy_to_host(dev, dev->dev_addr, atmel_read16(dev, MR2), 6); + + atmel_copy_to_host(dev, addr, atmel_read16(dev, MR2), 6); + eth_hw_addr_set(dev, addr); /* got address, now squash it again until the network interface is opened */ if (priv->bus_type == BUS_TYPE_PCCARD) @@ -3705,7 +3708,8 @@ static int probe_atmel_card(struct net_device *dev) /* Mac address easy in this case. */ priv->card_type = CARD_TYPE_PARALLEL_FLASH; atmel_write16(dev, BSR, 1); - atmel_copy_to_host(dev, dev->dev_addr, 0xc000, 6); + atmel_copy_to_host(dev, addr, 0xc000, 6); + eth_hw_addr_set(dev, addr); atmel_write16(dev, BSR, 0x200); rc = 1; } else { @@ -3713,7 +3717,8 @@ static int probe_atmel_card(struct net_device *dev) for the Mac Address */ priv->card_type = CARD_TYPE_SPI_FLASH; if (atmel_wakeup_firmware(priv) == 0) { - atmel_get_mib(priv, Mac_Address_Mib_Type, 0, dev->dev_addr, 6); + atmel_get_mib(priv, Mac_Address_Mib_Type, 0, addr, 6); + eth_hw_addr_set(dev, addr); /* got address, now squash it again until the network interface is opened */ @@ -4103,7 +4108,7 @@ static void atmel_set_mib16(struct atmel_private *priv, u8 type, u8 index, } static void atmel_set_mib(struct atmel_private *priv, u8 type, u8 index, - u8 *data, int data_len) + const u8 *data, int data_len) { struct get_set_mib m; m.type = type; From patchwork Mon Oct 18 23:50:13 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Kicinski X-Patchwork-Id: 12568329 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DE8C2C433F5 for ; Mon, 18 Oct 2021 23:50:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C4C97610A2 for ; Mon, 18 Oct 2021 23:50:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233600AbhJRXwo (ORCPT ); Mon, 18 Oct 2021 19:52:44 -0400 Received: from mail.kernel.org ([198.145.29.99]:34992 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233236AbhJRXwl (ORCPT ); Mon, 18 Oct 2021 19:52:41 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 243956127B; Mon, 18 Oct 2021 23:50:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1634601029; bh=xKtnU/YSjFfwcbqPxqi4YidSRh0HkLrNGsdlECBJNps=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=J4SQpqYU+Daj2gBpnLkQjuo6RiTkP7gSm3QyGzlS94RVBmj8T6pdIYlqvFkafuD9g 4ATTxElxU3mJM5/St2dm0LQySMueaJh+j7gNgL4wOg/6m1ymR7syoF76xhuuBVs+PC 36dek9ld9862j0puOMtcFy6hoezleUjv20BnT6lGhAg5L48kHB3riftYks8+xELTRH GqTbYNCLGXIS0EuXXpxZZdSs+uw/ivM/5YHgd7SS8JI+r+rfljqf6n2PHQHHgs9rCH Rd313vvr8QZT+3kOe8PCrPDTP+F/xUHiqPLBxALQvshFcizsSf1N8IZZm1PwamC5Nf K9s6QlPEoF+Iw== From: Jakub Kicinski To: kvalo@codeaurora.org Cc: linux-wireless@vger.kernel.org, Jakub Kicinski , aspriel@gmail.com, franky.lin@broadcom.com, hante.meuleman@broadcom.com, chi-hsien.lin@infineon.com, wright.feng@infineon.com, chung-hsien.hsu@infineon.com, johannes.berg@intel.com, brcm80211-dev-list.pdl@broadcom.com, SHA-cyfmac-dev-list@infineon.com Subject: [PATCH 07/15] wireless: brcmfmac: prepare for const netdev->dev_addr Date: Mon, 18 Oct 2021 16:50:13 -0700 Message-Id: <20211018235021.1279697-8-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 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org netdev->dev_addr will become const soon. Make sure local variables maintain that qualifier. Signed-off-by: Jakub Kicinski --- CC: aspriel@gmail.com CC: franky.lin@broadcom.com CC: hante.meuleman@broadcom.com CC: chi-hsien.lin@infineon.com CC: wright.feng@infineon.com CC: chung-hsien.hsu@infineon.com CC: kvalo@codeaurora.org CC: johannes.berg@intel.com CC: linux-wireless@vger.kernel.org CC: brcm80211-dev-list.pdl@broadcom.com CC: SHA-cyfmac-dev-list@infineon.com --- drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c index 9ac0d8c73d5a..4735063e4c03 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c @@ -2125,7 +2125,7 @@ static int brcmf_p2p_disable_p2p_if(struct brcmf_cfg80211_vif *vif) struct brcmf_cfg80211_info *cfg = wdev_to_cfg(&vif->wdev); struct net_device *pri_ndev = cfg_to_ndev(cfg); struct brcmf_if *ifp = netdev_priv(pri_ndev); - u8 *addr = vif->wdev.netdev->dev_addr; + const u8 *addr = vif->wdev.netdev->dev_addr; return brcmf_fil_iovar_data_set(ifp, "p2p_ifdis", addr, ETH_ALEN); } @@ -2135,7 +2135,7 @@ static int brcmf_p2p_release_p2p_if(struct brcmf_cfg80211_vif *vif) struct brcmf_cfg80211_info *cfg = wdev_to_cfg(&vif->wdev); struct net_device *pri_ndev = cfg_to_ndev(cfg); struct brcmf_if *ifp = netdev_priv(pri_ndev); - u8 *addr = vif->wdev.netdev->dev_addr; + const u8 *addr = vif->wdev.netdev->dev_addr; return brcmf_fil_iovar_data_set(ifp, "p2p_ifdel", addr, ETH_ALEN); } From patchwork Mon Oct 18 23:50:14 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Kicinski X-Patchwork-Id: 12568331 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0C309C433EF for ; Mon, 18 Oct 2021 23:50:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id EB0E2610A2 for ; Mon, 18 Oct 2021 23:50:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233236AbhJRXwo (ORCPT ); Mon, 18 Oct 2021 19:52:44 -0400 Received: from mail.kernel.org ([198.145.29.99]:35014 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229710AbhJRXwl (ORCPT ); Mon, 18 Oct 2021 19:52:41 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id AB63161207; Mon, 18 Oct 2021 23:50:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1634601029; bh=TGdJ3lbDpePudMe8CH/lgolQLsf4z+Ob8jFN/7vgx2c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gWUrAE8TVZUCrMMuPPmWh2fqLN6ccUHXww49zFi5ZZ1Vx2YmYCeISjysrVcG1K7K3 d+uBRNFYOTbuVRQTSqhDImXs+Jn6+D0yEYRbNUAzF730E2RBp1UhbIANK4XoW66lVu MYm7AuGV93iOUynAnLLK+bxeADsSYq4SDuvC2cxUctlfXVRoX/a+1TkPi+X0gKVbhC jmBts5BYXHlLoLXXsTFMKw/mjXGlv9e64PzpChRIIDGfWTfTbT6wc8oT9TKd6ZIEOj J1X9z3d/oSN8CN0KVbZQzhT3y3vay9CPt9D342xKjRJNmSs2+oLJ9QF2WXi2Hmb9wN bdPA4g5htbQDw== From: Jakub Kicinski To: kvalo@codeaurora.org Cc: linux-wireless@vger.kernel.org, Jakub Kicinski , bigeasy@linutronix.de, arnd@arndb.de Subject: [PATCH 08/15] wireless: cisco: use eth_hw_addr_set() Date: Mon, 18 Oct 2021 16:50:14 -0700 Message-Id: <20211018235021.1279697-9-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 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. Use dev_addr_set() to match the existing logic. setup_card() is always passed netdev->dev_addr, so pass the netdev pointer instead and assign the address using a helper there. Signed-off-by: Jakub Kicinski Reviewed-by: Sebastian Andrzej Siewior --- CC: kvalo@codeaurora.org CC: bigeasy@linutronix.de CC: arnd@arndb.de CC: linux-wireless@vger.kernel.org --- drivers/net/wireless/cisco/airo.c | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/drivers/net/wireless/cisco/airo.c b/drivers/net/wireless/cisco/airo.c index 65dd8cff1b01..45594f003ef7 100644 --- a/drivers/net/wireless/cisco/airo.c +++ b/drivers/net/wireless/cisco/airo.c @@ -1109,7 +1109,7 @@ struct airo_info; static int get_dec_u16(char *buffer, int *start, int limit); static void OUT4500(struct airo_info *, u16 reg, u16 value); static unsigned short IN4500(struct airo_info *, u16 reg); -static u16 setup_card(struct airo_info*, u8 *mac, int lock); +static u16 setup_card(struct airo_info*, struct net_device *dev, int lock); static int enable_MAC(struct airo_info *ai, int lock); static void disable_MAC(struct airo_info *ai, int lock); static void enable_interrupts(struct airo_info*); @@ -2337,9 +2337,9 @@ static int airo_set_mac_address(struct net_device *dev, void *p) disable_MAC(ai, 1); writeConfigRid (ai, 1); enable_MAC(ai, 1); - memcpy (ai->dev->dev_addr, addr->sa_data, dev->addr_len); + dev_addr_set(ai->dev, addr->sa_data); if (ai->wifidev) - memcpy (ai->wifidev->dev_addr, addr->sa_data, dev->addr_len); + dev_addr_set(ai->wifidev, addr->sa_data); return 0; } @@ -2854,7 +2854,7 @@ static struct net_device *_init_airo_card(unsigned short irq, int port, } if (probe) { - if (setup_card(ai, dev->dev_addr, 1) != SUCCESS) { + if (setup_card(ai, dev, 1) != SUCCESS) { airo_print_err(dev->name, "MAC could not be enabled"); rc = -EIO; goto err_out_map; @@ -2972,7 +2972,7 @@ int reset_airo_card(struct net_device *dev) if (reset_card (dev, 1)) return -1; - if (setup_card(ai, dev->dev_addr, 1) != SUCCESS) { + if (setup_card(ai, dev, 1) != SUCCESS) { airo_print_err(dev->name, "MAC could not be enabled"); return -1; } @@ -3817,7 +3817,8 @@ static inline void set_auth_type(struct airo_info *local, int auth_type) local->last_auth = auth_type; } -static int noinline_for_stack airo_readconfig(struct airo_info *ai, u8 *mac, int lock) +static int noinline_for_stack airo_readconfig(struct airo_info *ai, + struct net_device *dev, int lock) { int i, status; /* large variables, so don't inline this function, @@ -3861,9 +3862,7 @@ static int noinline_for_stack airo_readconfig(struct airo_info *ai, u8 *mac, int } /* Save off the MAC */ - for (i = 0; i < ETH_ALEN; i++) { - mac[i] = ai->config.macAddr[i]; - } + eth_hw_addr_set(dev, ai->config.macAddr); /* Check to see if there are any insmod configured rates to add */ @@ -3879,7 +3878,7 @@ static int noinline_for_stack airo_readconfig(struct airo_info *ai, u8 *mac, int } -static u16 setup_card(struct airo_info *ai, u8 *mac, int lock) +static u16 setup_card(struct airo_info *ai, struct net_device *dev, int lock) { Cmd cmd; Resp rsp; @@ -3925,7 +3924,7 @@ static u16 setup_card(struct airo_info *ai, u8 *mac, int lock) if (lock) up(&ai->sem); if (ai->config.len == 0) { - status = airo_readconfig(ai, mac, lock); + status = airo_readconfig(ai, dev, lock); if (status != SUCCESS) return ERROR; } @@ -5654,7 +5653,7 @@ static int __maybe_unused airo_pci_resume(struct device *dev_d) if (prev_state != PCI_D1) { reset_card(dev, 0); mpi_init_descriptors(ai); - setup_card(ai, dev->dev_addr, 0); + setup_card(ai, dev, 0); clear_bit(FLAG_RADIO_OFF, &ai->flags); clear_bit(FLAG_PENDING_XMIT, &ai->flags); } else { @@ -7534,7 +7533,7 @@ static int airo_config_commit(struct net_device *dev, readSsidRid(local, &SSID_rid); if (test_bit(FLAG_MPI,&local->flags)) - setup_card(local, dev->dev_addr, 1); + setup_card(local, dev, 1); else reset_airo_card(dev); disable_MAC(local, 1); @@ -8208,7 +8207,7 @@ static int flashrestart(struct airo_info *ai, struct net_device *dev) if (status != SUCCESS) return status; } - status = setup_card(ai, dev->dev_addr, 1); + status = setup_card(ai, dev, 1); if (!test_bit(FLAG_MPI,&ai->flags)) for (i = 0; i < MAX_FIDS; i++) { From patchwork Mon Oct 18 23:50:15 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Kicinski X-Patchwork-Id: 12568333 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 924A2C4332F for ; Mon, 18 Oct 2021 23:50:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 835DF610A2 for ; Mon, 18 Oct 2021 23:50:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233581AbhJRXwp (ORCPT ); Mon, 18 Oct 2021 19:52:45 -0400 Received: from mail.kernel.org ([198.145.29.99]:35028 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232256AbhJRXwl (ORCPT ); Mon, 18 Oct 2021 19:52:41 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 09509610FB; 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=1634601030; bh=RRGS3Z7RNEHcCPZWMqyWim5nDZFB2OyvLivHgEivPwk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=eoMS3iEiHokuGRUfsmAw+Pm064fRjhFz+2OKC9Oo9QMLRX0GM95ShDEF45NMenfsz EGUUH+6lI2x7ZNjuM3VnF3tcoPDoS8pK4o4x/wKW94dxLzkqm0PKkJfenb+BXAm/2z Eu2hJ0f+2d/qIpVk7TKtHzY+AHqAtgV08eVNNTXQXDorP1LRPDpVn3MCieh/G0f8Vo NOIBf92MPEBuWxtGiZmguTjYmg6vZZrPg1RvSuX+l5BJfWiFv3qCudVWEZ8GWmVOgz xob83JG8kUS8QuTJE2rkTCtXc+65oBL6Pqcit+iu4CkKGSNSl8mEAkxYw2Q9uYwxFY i1WBgKukxOBhQ== From: Jakub Kicinski To: kvalo@codeaurora.org Cc: linux-wireless@vger.kernel.org, Jakub Kicinski , stas.yakovlev@gmail.com Subject: [PATCH 09/15] wireless: ipw2200: prepare for const netdev->dev_addr Date: Mon, 18 Oct 2021 16:50:15 -0700 Message-Id: <20211018235021.1279697-10-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 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org netdev->dev_addr will be come const soon, constify the argument to command send to avoid compiler warnings. Signed-off-by: Jakub Kicinski --- CC: stas.yakovlev@gmail.com CC: kvalo@codeaurora.org CC: linux-wireless@vger.kernel.org --- drivers/net/wireless/intel/ipw2x00/ipw2200.c | 6 +++--- drivers/net/wireless/intel/ipw2x00/ipw2200.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/net/wireless/intel/ipw2x00/ipw2200.c b/drivers/net/wireless/intel/ipw2x00/ipw2200.c index 0a38d17744a9..23037bfc9e4c 100644 --- a/drivers/net/wireless/intel/ipw2x00/ipw2200.c +++ b/drivers/net/wireless/intel/ipw2x00/ipw2200.c @@ -199,7 +199,7 @@ static int ipw_queue_tx_reclaim(struct ipw_priv *priv, struct clx2_tx_queue *txq, int qindex); static int ipw_queue_reset(struct ipw_priv *priv); -static int ipw_queue_tx_hcmd(struct ipw_priv *priv, int hcmd, void *buf, +static int ipw_queue_tx_hcmd(struct ipw_priv *priv, int hcmd, const void *buf, int len, int sync); static void ipw_tx_queue_free(struct ipw_priv *); @@ -2264,7 +2264,7 @@ static int ipw_send_cmd_simple(struct ipw_priv *priv, u8 command) } static int ipw_send_cmd_pdu(struct ipw_priv *priv, u8 command, u8 len, - void *data) + const void *data) { struct host_cmd cmd = { .cmd = command, @@ -5033,7 +5033,7 @@ static int ipw_queue_tx_reclaim(struct ipw_priv *priv, return used; } -static int ipw_queue_tx_hcmd(struct ipw_priv *priv, int hcmd, void *buf, +static int ipw_queue_tx_hcmd(struct ipw_priv *priv, int hcmd, const void *buf, int len, int sync) { struct clx2_tx_queue *txq = &priv->txq_cmd; diff --git a/drivers/net/wireless/intel/ipw2x00/ipw2200.h b/drivers/net/wireless/intel/ipw2x00/ipw2200.h index 98fe62737888..55cac934f4ee 100644 --- a/drivers/net/wireless/intel/ipw2x00/ipw2200.h +++ b/drivers/net/wireless/intel/ipw2x00/ipw2200.h @@ -1945,7 +1945,7 @@ struct host_cmd { u8 cmd; u8 len; u16 reserved; - u32 *param; + const u32 *param; } __packed; /* XXX */ struct cmdlog_host_cmd { From patchwork Mon Oct 18 23:50:16 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Kicinski X-Patchwork-Id: 12568335 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id F2B1DC433FE for ; Mon, 18 Oct 2021 23:50:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D999F610A2 for ; Mon, 18 Oct 2021 23:50:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233660AbhJRXwp (ORCPT ); Mon, 18 Oct 2021 19:52:45 -0400 Received: from mail.kernel.org ([198.145.29.99]:35046 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233343AbhJRXwm (ORCPT ); Mon, 18 Oct 2021 19:52:42 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 526B561212; 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=1634601030; bh=N+zy+U2tgRh/l27HwBJ04BEcTXccUWflGL4ZqT3xikA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=g+uJmcIeHW4XUXuDoS0WoUMbD04z/51oZbeVVf6ut0ZI6SiQmMW1370W632MB2HiW 3bi5WTSva9D+S8+ez1p4bWvJA89AqxwZ0Y4dJiDLsvYYa73VniTNYGdM/eVmDkTFXI gaxTf+1hg2ZlIOMnUF1QV8zls6TGPhY5ElNkW3ERXG2MVdJ/XOHv7E5COpSTS/3KTo zAxyueCO8wosK0gSwHb/CL3acmxilIw6BRtJXBkoaMRlYYjrLmuEF8oJj9CEv8jHA6 BtPP4ytw9A9+f/ldJ8vj06BbliJW/KMSKJlVD0VJDHEXY/bcv7JgQZ4k0DBN9mKcDn EkipNAw6+kXZA== From: Jakub Kicinski To: kvalo@codeaurora.org Cc: linux-wireless@vger.kernel.org, Jakub Kicinski , j@w1.fi, arnd@arndb.de Subject: [PATCH 10/15] wireless: intersil: use eth_hw_addr_set() Date: Mon, 18 Oct 2021 16:50:16 -0700 Message-Id: <20211018235021.1279697-11-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 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: j@w1.fi CC: kvalo@codeaurora.org CC: arnd@arndb.de CC: linux-wireless@vger.kernel.org --- drivers/net/wireless/intersil/hostap/hostap_hw.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/intersil/hostap/hostap_hw.c b/drivers/net/wireless/intersil/hostap/hostap_hw.c index 9a19046217df..e459e7192ae9 100644 --- a/drivers/net/wireless/intersil/hostap/hostap_hw.c +++ b/drivers/net/wireless/intersil/hostap/hostap_hw.c @@ -1403,14 +1403,17 @@ static int prism2_hw_init2(struct net_device *dev, int initial) hfa384x_events_only_cmd(dev); if (initial) { + u8 addr[ETH_ALEN] = {}; struct list_head *ptr; + prism2_check_sta_fw_version(local); if (hfa384x_get_rid(dev, HFA384X_RID_CNFOWNMACADDR, - dev->dev_addr, 6, 1) < 0) { + addr, ETH_ALEN, 1) < 0) { printk("%s: could not get own MAC address\n", dev->name); } + eth_hw_addr_set(dev, addr); list_for_each(ptr, &local->hostap_interfaces) { iface = list_entry(ptr, struct hostap_interface, list); eth_hw_addr_inherit(iface->dev, dev); From patchwork Mon Oct 18 23:50:17 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Kicinski X-Patchwork-Id: 12568337 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 87040C43217 for ; Mon, 18 Oct 2021 23:50:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 751BE61002 for ; Mon, 18 Oct 2021 23:50:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233559AbhJRXwq (ORCPT ); Mon, 18 Oct 2021 19:52:46 -0400 Received: from mail.kernel.org ([198.145.29.99]:35060 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233395AbhJRXwm (ORCPT ); Mon, 18 Oct 2021 19:52:42 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id A78756128A; 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=1634601030; bh=5wULzODvrAyrwTGlx9z5JklV+k/oNgcKP11IvnpY3Dw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Aefl9/yNWHgSxtrBTemrGBEmfzbI3NkkTIAm9ZYQ7C1HSBLeMuQvoYMcyBlnn8aIY 0VcjbSe32K+m0YlfxBggEYdDHKaOKnu5uKORXtwsFDV9sav6dCuCJeR/CQSHDmpWFA WLELYRgeA78CwOiOgBiNfW/gGtVgSDPnF06yqB7ugyEzeBJQ4/kFnxhTSI+KXI4JeU EVyGYikajoUs/WhfQ8nSe+17FBxy1Aa5m2hHsk4T2rWzWW7R3CgB3HGLaDHFFgQdCb Oamoit96/infQOslSd6e4JJ99LP5qO/k9zUcuECP3NhQ6XFwtC1mLDtjWH3u167Wza +oCfR01532JJA== From: Jakub Kicinski To: kvalo@codeaurora.org Cc: linux-wireless@vger.kernel.org, Jakub Kicinski , johannes@sipsolutions.net Subject: [PATCH 11/15] wireless: mac80211_hwsim: use eth_hw_addr_set() Date: Mon, 18 Oct 2021 16:50:17 -0700 Message-Id: <20211018235021.1279697-12-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 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: johannes@sipsolutions.net CC: kvalo@codeaurora.org CC: linux-wireless@vger.kernel.org --- drivers/net/wireless/mac80211_hwsim.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/mac80211_hwsim.c b/drivers/net/wireless/mac80211_hwsim.c index 0adae76eb8df..8d0ae99eca94 100644 --- a/drivers/net/wireless/mac80211_hwsim.c +++ b/drivers/net/wireless/mac80211_hwsim.c @@ -3527,13 +3527,16 @@ static const struct net_device_ops hwsim_netdev_ops = { static void hwsim_mon_setup(struct net_device *dev) { + u8 addr[ETH_ALEN]; + dev->netdev_ops = &hwsim_netdev_ops; dev->needs_free_netdev = true; ether_setup(dev); dev->priv_flags |= IFF_NO_QUEUE; dev->type = ARPHRD_IEEE80211_RADIOTAP; - eth_zero_addr(dev->dev_addr); - dev->dev_addr[0] = 0x12; + eth_zero_addr(addr); + addr[0] = 0x12; + eth_hw_addr_set(dev, addr); } static struct mac80211_hwsim_data *get_hwsim_data_ref_from_addr(const u8 *addr) From patchwork Mon Oct 18 23:50:18 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Kicinski X-Patchwork-Id: 12568339 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 018D0C433F5 for ; Mon, 18 Oct 2021 23:50:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id DFB92610A2 for ; Mon, 18 Oct 2021 23:50:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233671AbhJRXwq (ORCPT ); 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 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); From patchwork Mon Oct 18 23:50:19 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Kicinski X-Patchwork-Id: 12568341 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 96A07C4332F for ; Mon, 18 Oct 2021 23:50:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 816AD610A2 for ; Mon, 18 Oct 2021 23:50:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233772AbhJRXwr (ORCPT ); Mon, 18 Oct 2021 19:52:47 -0400 Received: from mail.kernel.org ([198.145.29.99]:35072 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233309AbhJRXwn (ORCPT ); Mon, 18 Oct 2021 19:52:43 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 50C7061250; Mon, 18 Oct 2021 23:50:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1634601031; bh=dE88fn6owS/u78BUKFz1R0smoxBiZvJ8wnfDQQe5xoc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pL1mN36XvnbzWof7/iie+mTIz8Vho80rcn/+xKY65bdOHdiH+NErxQYc4CU19hFNA DFwSO+sZjmn/8MCFtv/xpHxjPMQ3L4nfxKRzS1oNnRbiyIJRJ0qOqbOeqvgK1hfQFR W6vJ+883SqCQxxzL6R/6vMdrlHrOiBGCBNujC7gQeF2P6pFpYS5v7aQjMo7oXMBE3q Xvs+xR+02eE8HohbIgvStu38WnGH/IxRUkTXLP5J3rKPjM6m4W7y6ssiNVgWYWW202 x658RLY0qKcku1hacraLlDp6gEFHdS867VFmcvEqW65ZxnFWUKmEpn1o7eOz9Pp70p /AnECQiQujzKw== From: Jakub Kicinski To: kvalo@codeaurora.org Cc: linux-wireless@vger.kernel.org, Jakub Kicinski Subject: [PATCH 13/15] wireless: ray_cs: use eth_hw_addr_set() Date: Mon, 18 Oct 2021 16:50:19 -0700 Message-Id: <20211018235021.1279697-14-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 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: kvalo@codeaurora.org CC: linux-wireless@vger.kernel.org --- drivers/net/wireless/ray_cs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/wireless/ray_cs.c b/drivers/net/wireless/ray_cs.c index 0f5009c47cd0..e3a3dc3e45b4 100644 --- a/drivers/net/wireless/ray_cs.c +++ b/drivers/net/wireless/ray_cs.c @@ -791,7 +791,7 @@ static int ray_dev_init(struct net_device *dev) #endif /* RAY_IMMEDIATE_INIT */ /* copy mac and broadcast addresses to linux device */ - memcpy(dev->dev_addr, &local->sparm.b4.a_mac_addr, ADDRLEN); + eth_hw_addr_set(dev, local->sparm.b4.a_mac_addr); eth_broadcast_addr(dev->broadcast); dev_dbg(&link->dev, "ray_dev_init ending\n"); From patchwork Mon Oct 18 23:50:20 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Kicinski X-Patchwork-Id: 12568343 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DE7D1C433FE for ; Mon, 18 Oct 2021 23:50:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C47C7610C7 for ; Mon, 18 Oct 2021 23:50:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233395AbhJRXwr (ORCPT ); Mon, 18 Oct 2021 19:52:47 -0400 Received: from mail.kernel.org ([198.145.29.99]:35060 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233452AbhJRXwn (ORCPT ); Mon, 18 Oct 2021 19:52:43 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 92BDB610C9; Mon, 18 Oct 2021 23:50:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1634601031; bh=YMFq0DgrKnedKvOU0oWg0iFrHFF1hqJrmAgBziUbGRk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fN9AYYrWZlfW0FGC1/1EGl9aC7ik918Ib0EcSZw5d+pHLJ8MJWTMlYpkugnc7ay1c XeoGdh2OE55OBncQVw+xS/DHGCWkPlWfu6u9ywkKEPWbxq8S0A53hwn7TMkZrZTM5+ zyQHpRLNd2pl9rEh9JIQ/3VPdsjzVXi9FJrFjyvqgIzYycGJNiqrmAc04XrqZralpj x8E7mtk908/8QLnjboNtT1UIsZQQy2E+VbEpGq3zHdY0YDePrqsUbRUQ0D79/IfYDx R9KDOYIJb1xEF7S/o3nt/HfBDTLzVu3sIO9+r8EPSobXo/HhZVgDwWg34uD2cZo5/8 SNL8djgE8HCUQ== From: Jakub Kicinski To: kvalo@codeaurora.org Cc: linux-wireless@vger.kernel.org, Jakub Kicinski Subject: [PATCH 14/15] wireless: wl3501_cs: use eth_hw_addr_set() Date: Mon, 18 Oct 2021 16:50:20 -0700 Message-Id: <20211018235021.1279697-15-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 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: kvalo@codeaurora.org CC: linux-wireless@vger.kernel.org --- drivers/net/wireless/wl3501_cs.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/net/wireless/wl3501_cs.c b/drivers/net/wireless/wl3501_cs.c index 672f5d5f3f2c..dad38fc04243 100644 --- a/drivers/net/wireless/wl3501_cs.c +++ b/drivers/net/wireless/wl3501_cs.c @@ -1945,8 +1945,7 @@ static int wl3501_config(struct pcmcia_device *link) goto failed; } - for (i = 0; i < 6; i++) - dev->dev_addr[i] = ((char *)&this->mac_addr)[i]; + eth_hw_addr_set(dev, this->mac_addr); /* print probe information */ printk(KERN_INFO "%s: wl3501 @ 0x%3.3x, IRQ %d, " From patchwork Mon Oct 18 23:50:21 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Kicinski X-Patchwork-Id: 12568345 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 33932C433EF for ; Mon, 18 Oct 2021 23:50:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 251AF610C7 for ; Mon, 18 Oct 2021 23:50:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233669AbhJRXws (ORCPT ); Mon, 18 Oct 2021 19:52:48 -0400 Received: from mail.kernel.org ([198.145.29.99]:35098 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233465AbhJRXwn (ORCPT ); Mon, 18 Oct 2021 19:52:43 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id D55EE61263; Mon, 18 Oct 2021 23:50:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1634601032; bh=FKcDdTU5soWw0lsJvOd/rPFAVLe46GuoH4+QCsmTUD0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LoFGHBPG8xx48ht+av+s5ERVVDE4oJqrhyDAddJgvfzpZN9Z6nSGCQdnqZHUjCsGb NTZGJ7DCPgcLjuT5ZCxszHdNv9ev437IfSsMMOj/b6D5544D9vShSVm3ZEeOLiMWkg /V5JZ8d6WxyPISJP4eGIXZ3EK77AxSFLNwwCzhFgvnOy5t6DPEQSrRl+3/pVJDJWeJ yNZKXbjQSndJ2I3IYtJAuEDF2IQ6jv7sR6WzsU/E9mO0Ex9dh6AZy6LOo9KhkVF3i0 SwlmVP2aWMISDY0sahfctCgSy5p3rEItIoWrpfTVGdxfS6fgtpUNy7KR3ulElkiScl EBamRJ8/fdfig== From: Jakub Kicinski To: kvalo@codeaurora.org Cc: linux-wireless@vger.kernel.org, Jakub Kicinski Subject: [PATCH 15/15] wireless: zd1201: use eth_hw_addr_set() Date: Mon, 18 Oct 2021 16:50:21 -0700 Message-Id: <20211018235021.1279697-16-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 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: kvalo@codeaurora.org CC: linux-wireless@vger.kernel.org --- drivers/net/wireless/zydas/zd1201.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/net/wireless/zydas/zd1201.c b/drivers/net/wireless/zydas/zd1201.c index 6b735fee7b18..e64e4e579518 100644 --- a/drivers/net/wireless/zydas/zd1201.c +++ b/drivers/net/wireless/zydas/zd1201.c @@ -507,7 +507,7 @@ static int zd1201_getconfig(struct zd1201 *zd, int rid, void *riddata, * byte data[12] * total: 16 */ -static int zd1201_setconfig(struct zd1201 *zd, int rid, void *buf, int len, int wait) +static int zd1201_setconfig(struct zd1201 *zd, int rid, const void *buf, int len, int wait) { int err; unsigned char *request; @@ -1729,6 +1729,7 @@ static int zd1201_probe(struct usb_interface *interface, int err; short porttype; char buf[IW_ESSID_MAX_SIZE+2]; + u8 addr[ETH_ALEN]; usb = interface_to_usbdev(interface); @@ -1779,10 +1780,10 @@ static int zd1201_probe(struct usb_interface *interface, dev->watchdog_timeo = ZD1201_TX_TIMEOUT; strcpy(dev->name, "wlan%d"); - err = zd1201_getconfig(zd, ZD1201_RID_CNFOWNMACADDR, - dev->dev_addr, dev->addr_len); + err = zd1201_getconfig(zd, ZD1201_RID_CNFOWNMACADDR, addr, ETH_ALEN); if (err) goto err_start; + eth_hw_addr_set(dev, addr); /* Set wildcard essid to match zd->essid */ *(__le16 *)buf = cpu_to_le16(0);