Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp5939238ybi; Wed, 12 Jun 2019 11:03:37 -0700 (PDT) X-Google-Smtp-Source: APXvYqy1R7Js27Yz6xfBZUKHC2pp+S/xRkJiRS9tdUY2VOZlZUuIp9KBT+m9zfRhA5IOzNV2ZadQ X-Received: by 2002:a17:902:467:: with SMTP id 94mr27233665ple.131.1560362617326; Wed, 12 Jun 2019 11:03:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560362617; cv=none; d=google.com; s=arc-20160816; b=JqK0JChxg+mtmZvu/Zpciof/PE74g7o5rKEzV+VI7ZGz4LssrcNKL7pjsH8umhGQUe QJRqg7CeQMl9bhmzLjf5yeXyVKpu17CMPZsWw0PALU31QTs85isLcUmVgubShToPNY4i WyfgMO47yHWXIcsuhwcFU5hgSH9kfipuE5wCYLn62xp+z5h/fKLk9M5u76bPDpiSURpi znAfZuGq7izsVVIF7fgnIH1/sCZIf7vEdVdZavQn9zDSeV5JL9iFCPVOOUb8fyqxNska th6tKfMasIRvtC9AF/GGndyKng63RBvj2kYfheeMS6n0nLN8q7SKQ10WvD1zmi9J+8TL 7R+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from:dkim-signature; bh=uE7MZuq+3WIUc6HVpm5xYAX5d0PSwwq0bThVMtvspxM=; b=mnNAlOVFFydytbiUDtARYqstAQ9/Ge8vU2ssr2f9TT4YABP1pyFRz7F0tR1WCEWZ3h izlI8aoPHUtdZe/PMl8p8xqQkdYOFRqHMAG8jp/wDO1AAAfziFr0avwT7Dh6w8B7gX9R 5CMhi+DdYuKvxiUhaYtb2Jq54DG+wVcSY8kzCxg30Zol4v8NJlhVN0BPff+tg8/JKgx5 xvLW09fAqxZeGB6JWeOhRNJ1CxuXGGXPzSlecSg2paSX/rK1bYEetynb8HKdYvQ0izBn qUwPXV17x349lY+5/3OMVL5mtJ6iZzvzN7bHar7WQ0c0D2PjmbjIt/NlEysjjW3JtPW8 SktQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@marvell.com header.s=pfpt0818 header.b=rBtlwPhm; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=marvell.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y8si399013pgi.449.2019.06.12.11.03.22; Wed, 12 Jun 2019 11:03:37 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@marvell.com header.s=pfpt0818 header.b=rBtlwPhm; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=marvell.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2439928AbfFLO6v (ORCPT + 99 others); Wed, 12 Jun 2019 10:58:51 -0400 Received: from mx0b-0016f401.pphosted.com ([67.231.156.173]:37466 "EHLO mx0b-0016f401.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2436945AbfFLO6v (ORCPT ); Wed, 12 Jun 2019 10:58:51 -0400 Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x5CEqUSr023837 for ; Wed, 12 Jun 2019 07:58:49 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : mime-version : content-type; s=pfpt0818; bh=uE7MZuq+3WIUc6HVpm5xYAX5d0PSwwq0bThVMtvspxM=; b=rBtlwPhmEEHNqJUV6+r6bl6/AP/yob8HY+CPPkMp2yhktBYN4bQvI/VWf9WM4SUUMEUR PGEBzTxKUNgkHuLaY1Qr6rRIuqZv/pf7IAncntSkrGZhCcNnn45PAaJ9raSiQt/gOPpc X5iZROgLWEGlPlbGachC8T8A2uctxqSm/eBl5dlh5Qrkxx0iD7exZn/LOZcKrGU9XfCz 3E5ZifeMLgaPKl8LoNrXKXdOWXK93wgX475DoSIWhkHtCDcSXH9ZXiv5KjWu1MW+jYIs boSFc/wOVg/+yzpoHXaFXnRfA26ZCYyvGosz+TSTWiNqo+7Uf/3odQpv9TOIwfY8+FUm tg== Received: from sc-exch03.marvell.com ([199.233.58.183]) by mx0b-0016f401.pphosted.com with ESMTP id 2t2r82aqd7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT) for ; Wed, 12 Jun 2019 07:58:49 -0700 Received: from SC-EXCH01.marvell.com (10.93.176.81) by SC-EXCH03.marvell.com (10.93.176.83) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Wed, 12 Jun 2019 07:58:48 -0700 Received: from maili.marvell.com (10.93.176.43) by SC-EXCH01.marvell.com (10.93.176.81) with Microsoft SMTP Server id 15.0.1367.3 via Frontend Transport; Wed, 12 Jun 2019 07:58:48 -0700 Received: from gbhat-ThinkPad-T430.marvell.com (gbhat-thinkpad-t430.marvell.com [10.31.176.18]) by maili.marvell.com (Postfix) with ESMTP id 3D51E3F703F; Wed, 12 Jun 2019 07:58:47 -0700 (PDT) From: Ganapathi Bhat To: CC: Ganapathi Bhat Subject: [PATCH] mwifiex: update set_mac_address logic Date: Wed, 12 Jun 2019 20:28:44 +0530 Message-ID: <1560351524-16779-1-git-send-email-gbhat@marvell.com> X-Mailer: git-send-email 1.9.1 MIME-Version: 1.0 Content-Type: text/plain X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-06-12_07:,, signatures=0 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org In set_mac_address, driver check for interfaces with same bss_type For first STA entry, this would return 3 interfaces since all priv's have bss_type as 0 due to kzalloc. Thus mac address gets changed for STA unexpected. This patch adds check for first STA and avoids mac address change. This patch also adds mac_address change for p2p based on bss_num type. Signed-off-by: Ganapathi Bhat --- drivers/net/wireless/marvell/mwifiex/main.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/net/wireless/marvell/mwifiex/main.c b/drivers/net/wireless/marvell/mwifiex/main.c index f6da8ed..4c14b48 100644 --- a/drivers/net/wireless/marvell/mwifiex/main.c +++ b/drivers/net/wireless/marvell/mwifiex/main.c @@ -960,10 +960,10 @@ int mwifiex_set_mac_address(struct mwifiex_private *priv, mac_addr = old_mac_addr; - if (priv->bss_type == MWIFIEX_BSS_TYPE_P2P) + if (priv->bss_type == MWIFIEX_BSS_TYPE_P2P) { mac_addr |= BIT_ULL(MWIFIEX_MAC_LOCAL_ADMIN_BIT); - - if (mwifiex_get_intf_num(priv->adapter, priv->bss_type) > 1) { + mac_addr += priv->bss_num; + } else if (priv->adapter->priv[0] != priv) { /* Set mac address based on bss_type/bss_num */ mac_addr ^= BIT_ULL(priv->bss_type + 8); mac_addr += priv->bss_num; -- 1.9.1