diff mbox series

mwifiex: update set_mac_address logic

Message ID CY4PR18MB123726E26A33B0E4F48E785FA0580@CY4PR18MB1237.namprd18.prod.outlook.com (mailing list archive)
State Changes Requested
Delegated to: Kalle Valo
Headers show
Series mwifiex: update set_mac_address logic | expand

Commit Message

Ganapathi Bhat March 27, 2019, 7:29 a.m. UTC
From: Sharvari Harisangam <sharvari@marvell.com>
Date: Wed, 27 Mar 2019 11:47:03 +0530
Subject: mwifiex: update set_mac_address logic

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: Sharvari Harisangam <sharvari@marvell.com>
Signed-off-by: Ganapathi Bhat <gbhat@marvell.com>
---
 drivers/net/wireless/marvell/mwifiex/main.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Kalle Valo March 28, 2019, 1:15 p.m. UTC | #1
Ganapathi Bhat <gbhat@marvell.com> writes:

> From: Sharvari Harisangam <sharvari@marvell.com>
> Date: Wed, 27 Mar 2019 11:47:03 +0530
> Subject: mwifiex: update set_mac_address logic
>
> 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: Sharvari Harisangam <sharvari@marvell.com>
> Signed-off-by: Ganapathi Bhat <gbhat@marvell.com>

The formatting looks broken to me, please use git send-email to send
patches.

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches#format_issues
Ganapathi Bhat June 13, 2019, 6:55 a.m. UTC | #2
Hi Kalle,

I did resend the patch with 'git send-email': https://patchwork.kernel.org/patch/10990209/

Kindly review;

Thanks,
Ganapathi
Kalle Valo June 13, 2019, 7:52 a.m. UTC | #3
Ganapathi Bhat <gbhat@marvell.com> writes:

> I did resend the patch with 'git send-email':
> https://patchwork.kernel.org/patch/10990209/

Thanks, I see it now.
diff mbox series

Patch

diff --git a/drivers/net/wireless/marvell/mwifiex/main.c b/drivers/net/wireless/marvell/mwifiex/main.c
index 5ed2d9b..4eabd94 100644
--- a/drivers/net/wireless/marvell/mwifiex/main.c
+++ b/drivers/net/wireless/marvell/mwifiex/main.c
@@ -965,10 +965,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;