Return-path: Received: from mx0b-0016f401.pphosted.com ([67.231.156.173]:37644 "EHLO mx0b-0016f401.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751452AbeDYJiv (ORCPT ); Wed, 25 Apr 2018 05:38:51 -0400 From: Xinming Hu To: Linux Wireless CC: Kalle Valo , Brian Norris , Dmitry Torokhov , , Zhiyuan Yang , Tim Song , Cathy Luo , James Cao , Ganapathi Bhat , Ellie Reeves , Xinming Hu Subject: [PATCH 3/3] mwifiex: keep user configured mac address during changing virtual interface Date: Wed, 25 Apr 2018 17:38:14 +0800 Message-ID: <1524649094-20069-3-git-send-email-huxm@marvell.com> (sfid-20180425_113854_207183_A3BF4126) In-Reply-To: <1524649094-20069-1-git-send-email-huxm@marvell.com> References: <1524649094-20069-1-git-send-email-huxm@marvell.com> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-wireless-owner@vger.kernel.org List-ID: During changing virtual interface, keep using previous net device mac address. Signed-off-by: Xinming Hu --- drivers/net/wireless/marvell/mwifiex/main.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/marvell/mwifiex/main.c b/drivers/net/wireless/marvell/mwifiex/main.c index b5f99a1..2f2b115 100644 --- a/drivers/net/wireless/marvell/mwifiex/main.c +++ b/drivers/net/wireless/marvell/mwifiex/main.c @@ -1333,7 +1333,10 @@ void mwifiex_init_priv_params(struct mwifiex_private *priv, priv->assocresp_idx = MWIFIEX_AUTO_IDX_MASK; priv->gen_idx = MWIFIEX_AUTO_IDX_MASK; priv->num_tx_timeout = 0; - ether_addr_copy(priv->curr_addr, priv->adapter->perm_addr); + if (is_valid_ether_addr(dev->dev_addr)) + ether_addr_copy(priv->curr_addr, dev->dev_addr); + else + ether_addr_copy(priv->curr_addr, priv->adapter->perm_addr); if (GET_BSS_ROLE(priv) == MWIFIEX_BSS_ROLE_STA || GET_BSS_ROLE(priv) == MWIFIEX_BSS_ROLE_UAP) { -- 1.9.1