Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp3493192pxb; Mon, 18 Oct 2021 16:51:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwU8+08xwOhLiXN9FjQCQy0JVJ3k+38t8KLtBwubuRAYvLJGpuHvABksGD5DhBI+qhJSNzd X-Received: by 2002:a05:6402:13ce:: with SMTP id a14mr50250439edx.64.1634601068537; Mon, 18 Oct 2021 16:51:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634601068; cv=none; d=google.com; s=arc-20160816; b=xwOhM94PABT5cknYr0P60M2wVT+RhFVQEQMB3kG5sC2bjQVhlGNa8pU1KkaPo+RdO9 UpNDkJDGjoiZH84ZGpguXWNc+nb6VmLQRqtaFUDsGgB04yN69R3ZsCWNhY4OYk6jmp1B EPT/Te38N+Ww/0m0tCXVVlqlLygVz4je6CXU8ReAqg/X47spbos0ecFFFhCDqGb6Tspt VFE5kSMwjQaCABVHVDkuX72zOx8GHgyr0b3plXHRLQY7kYf8H7QJr5yxcu5cFCpk/dtG WulGITh/BqkX0xsIF+o7oYaMSTrdb2+2i/tClR8AMLSUu2hWX3EMZ8ci6wWC6ZOApFUw P8uQ== 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=c5Uy1ctuInRGGHM93zmbI0GVjy6aN4nG464OVRJ19RI=; b=oC9SAON4Njtw7bTqtW/MmXg54W6Z4BGMf5Go/dr4c4bRy//JJXe8TKj0IgajABx6+A E0TbsNeZ92OdGJ/Q644jCtI8ru6Ga7mpBRUHEyaXEMEqpRPdbZTO5ifX8WBU/IcbRn17 n/PTSWIl3yv2pRtbypShk/lom4myvqA9BnDTRpHELsYuLslMqY2pGajLBkNCbharyHgP 3ej/qKqY5gmUNGn6zv5g92FvtXZSDxNH+xZsLmPNXAMh96ifgyr/roZFh0qde+CJ33i3 fVFj02n/4GKD7DXA2GbsF3dvko6F2jr4+CQoSDrdCiFG7iB1D5+19GcFl6voMU+N3dIl 7+Sw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=gWUrAE8T; 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 y15si22817152edd.182.2021.10.18.16.50.53; Mon, 18 Oct 2021 16:51:08 -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=gWUrAE8T; 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 S233236AbhJRXwo (ORCPT + 64 others); 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 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. 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 --- 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++) { -- 2.31.1