2021-10-07 22:58:32

by Nick

[permalink] [raw]
Subject: [RFC v2] mt76: mt7615: mt7622: fix ibss and meshpoint

Fixes: d8d59f66d136 ("mt76: mt7615: support 16 interfaces").

commit 7f4b7920318b ("mt76: mt7615: add ibss support") introduced IBSS
and commit f4ec7fdf7f83 ("mt76: mt7615: enable support for mesh")
meshpoint support.

Both used in the "get_omac_idx"-function:

if (~mask & BIT(HW_BSSID_0))
return HW_BSSID_0;

With commit d8d59f66d136 ("mt76: mt7615: support 16 interfaces") the
ibss and meshpoint mode should "prefer hw bssid slot 1-3". However,
with that change the ibss or meshpoint mode will not send any beacon on
the mt7622 wifi anymore. Devices were still able to exchange data but
only if a bssid already existed. Two mt7622 devices will never be able
to communicate.

This commits reverts the preferation of slot 1-3 for ibss and
meshpoint. Only NL80211_IFTYPE_STATION will still prefer slot 1-3.

Tested on Banana Pi R64.

Signed-off-by: Nick Hainke <[email protected]>
---
drivers/net/wireless/mediatek/mt76/mt7615/main.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/mediatek/mt76/mt7615/main.c b/drivers/net/wireless/mediatek/mt76/mt7615/main.c
index dada43d6d879..51260a669d16 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7615/main.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7615/main.c
@@ -135,8 +135,6 @@ static int get_omac_idx(enum nl80211_iftype type, u64 mask)
int i;

switch (type) {
- case NL80211_IFTYPE_MESH_POINT:
- case NL80211_IFTYPE_ADHOC:
case NL80211_IFTYPE_STATION:
/* prefer hw bssid slot 1-3 */
i = get_free_idx(mask, HW_BSSID_1, HW_BSSID_3);
@@ -160,6 +158,8 @@ static int get_omac_idx(enum nl80211_iftype type, u64 mask)
return HW_BSSID_0;

break;
+ case NL80211_IFTYPE_ADHOC:
+ case NL80211_IFTYPE_MESH_POINT:
case NL80211_IFTYPE_MONITOR:
case NL80211_IFTYPE_AP:
/* ap uses hw bssid 0 and ext bssid */
--
2.33.0


2021-10-09 08:33:12

by Kalle Valo

[permalink] [raw]
Subject: Re: [RFC v2] mt76: mt7615: mt7622: fix ibss and meshpoint

Nick Hainke <[email protected]> writes:

> Fixes: d8d59f66d136 ("mt76: mt7615: support 16 interfaces").

The fixes tag should be in the end, before Signed-off-by tags. But I can
fix that during commit.

> commit 7f4b7920318b ("mt76: mt7615: add ibss support") introduced IBSS
> and commit f4ec7fdf7f83 ("mt76: mt7615: enable support for mesh")
> meshpoint support.
>
> Both used in the "get_omac_idx"-function:
>
> if (~mask & BIT(HW_BSSID_0))
> return HW_BSSID_0;
>
> With commit d8d59f66d136 ("mt76: mt7615: support 16 interfaces") the
> ibss and meshpoint mode should "prefer hw bssid slot 1-3". However,
> with that change the ibss or meshpoint mode will not send any beacon on
> the mt7622 wifi anymore. Devices were still able to exchange data but
> only if a bssid already existed. Two mt7622 devices will never be able
> to communicate.
>
> This commits reverts the preferation of slot 1-3 for ibss and
> meshpoint. Only NL80211_IFTYPE_STATION will still prefer slot 1-3.
>
> Tested on Banana Pi R64.
>
> Signed-off-by: Nick Hainke <[email protected]>

Felix, can I take this to wireless-drivers? Ack?

--
https://patchwork.kernel.org/project/linux-wireless/list/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches

2021-10-09 13:23:52

by Daniel Golle

[permalink] [raw]
Subject: Re: [RFC v2] mt76: mt7615: mt7622: fix ibss and meshpoint

On Sat, Oct 09, 2021 at 12:37:53PM +0200, Nick wrote:
> On 10/9/21 10:32, Kalle Valo wrote:
>
> > Nick Hainke <[email protected]> writes:
> >
> > > Fixes: d8d59f66d136 ("mt76: mt7615: support 16 interfaces").
> > The fixes tag should be in the end, before Signed-off-by tags. But I can
> > fix that during commit.
> Thanks for feedback. Already changed that locally but I did not want to spam
> you with another RFC v3. :)
> I was able to organize me a BPI-MT7615 PCIE Express Card. With and without
> this patch beacons were sent on the mt7615 pcie, so the patch did not make
> any difference. However, the mt7622 wifi will only work with my patch.

Does Mesh+AP or Ad-Hoc+AP also work on MT7622 and does it still work on
MT7615E card with your patch applied?

2021-10-11 09:13:42

by Nick

[permalink] [raw]
Subject: Re: [RFC v2] mt76: mt7615: mt7622: fix ibss and meshpoint

My tests on todays OpenWrt Trunk with my and without my patch showed:
- MT7622: AP + AdHoc (only AP is working, in every case)
- BPI-MT7615: AP + AdHoc (with and without my patch still works).

I thought something would change if I apply my patch with the
HW-Addresses. However everything stays the same:

With my patch:
AdHoc: Shenzhen_4e:4b:dd (38:83:9a:4e:4b:dd)
AP: address: 3a:83:9a:4e:4b:dd (3a:83:9a:4e:4b:dd)

Without my patch:
AdHoc: Shenzhen_4e:4b:dd (38:83:9a:4e:4b:dd)
AP: 3a:83:9a:4e:4b:dd (3a:83:9a:4e:4b:dd)

Bests
Nick

On 10/9/21 15:22, Daniel Golle wrote:
> On Sat, Oct 09, 2021 at 12:37:53PM +0200, Nick wrote:
>> On 10/9/21 10:32, Kalle Valo wrote:
>>
>>> Nick Hainke <[email protected]> writes:
>>>
>>>> Fixes: d8d59f66d136 ("mt76: mt7615: support 16 interfaces").
>>> The fixes tag should be in the end, before Signed-off-by tags. But I can
>>> fix that during commit.
>> Thanks for feedback. Already changed that locally but I did not want to spam
>> you with another RFC v3. :)
>> I was able to organize me a BPI-MT7615 PCIE Express Card. With and without
>> this patch beacons were sent on the mt7615 pcie, so the patch did not make
>> any difference. However, the mt7622 wifi will only work with my patch.
> Does Mesh+AP or Ad-Hoc+AP also work on MT7622 and does it still work on
> MT7615E card with your patch applied?

2021-10-18 03:42:51

by Frank Wunderlich

[permalink] [raw]
Subject: Aw: Re: [RFC v2] mt76: mt7615: mt7622: fix ibss and meshpoint

> Gesendet: Samstag, 09. Oktober 2021 um 15:22 Uhr
> Von: "Daniel Golle" <[email protected]>

> Does Mesh+AP or Ad-Hoc+AP also work on MT7622 and does it still work on
> MT7615E card with your patch applied?

tested bananapi-r2 with mt7615 and bananapi-r64 with internal mt7622-wmac

ibss/ad-hoc: working
AP-Mode: still working

regards Frank

2021-10-18 03:43:58

by Daniel Golle

[permalink] [raw]
Subject: Re: Re: [RFC v2] mt76: mt7615: mt7622: fix ibss and meshpoint

On Sun, Oct 17, 2021 at 02:28:16PM +0200, Frank Wunderlich wrote:
> > Gesendet: Samstag, 09. Oktober 2021 um 15:22 Uhr
> > Von: "Daniel Golle" <[email protected]>
>
> > Does Mesh+AP or Ad-Hoc+AP also work on MT7622 and does it still work on
> > MT7615E card with your patch applied?
>
> tested bananapi-r2 with mt7615 and bananapi-r64 with internal mt7622-wmac
>
> ibss/ad-hoc: working
> AP-Mode: still working

Independently of each other or simultanously?
What I meant was to ask if **simultanous** Mesh+AP or Ad-Hoc+AP still
works on MT7615E (you can only test that with OpenWrt-patched hostapd
or by using wpa_supplicant to setup the AP as well as mesh/ad-hoc
interface by settings in wpa_supplicant.conf)

2021-10-18 10:12:55

by Nick

[permalink] [raw]
Subject: Re: [RFC v2] mt76: mt7615: mt7622: fix ibss and meshpoint

On 10/17/21 15:52, Daniel Golle wrote:

> Independently of each other or simultanously?

My tests were done simultanously. The "plus" means to the same time with
my post. However, simultanously AP and AdHoc was never be possible with
the patch, nor without the patch.

Bests
Nick

2021-10-18 10:14:49

by Nick

[permalink] [raw]
Subject: Re: [RFC v2] mt76: mt7615: mt7622: fix ibss and meshpoint

Sorry, I should have added, that the simultanously mode was not working
on the mt7622 with and without patch. With mt7615e it was working.

Bests
Nick

On 10/18/21 12:11, Nick wrote:
> On 10/17/21 15:52, Daniel Golle wrote:
>
>> Independently of each other or simultanously?
>
> My tests were done simultanously. The "plus" means to the same time
> with my post. However, simultanously AP and AdHoc was never be
> possible with the patch, nor without the patch.
>
> Bests
> Nick
>

2021-10-18 10:17:13

by Felix Fietkau

[permalink] [raw]
Subject: Re: [RFC v2] mt76: mt7615: mt7622: fix ibss and meshpoint

On 2021-10-09 10:32, Kalle Valo wrote:
> Nick Hainke <[email protected]> writes:
>
>> Fixes: d8d59f66d136 ("mt76: mt7615: support 16 interfaces").
>
> The fixes tag should be in the end, before Signed-off-by tags. But I can
> fix that during commit.
>
>> commit 7f4b7920318b ("mt76: mt7615: add ibss support") introduced IBSS
>> and commit f4ec7fdf7f83 ("mt76: mt7615: enable support for mesh")
>> meshpoint support.
>>
>> Both used in the "get_omac_idx"-function:
>>
>> if (~mask & BIT(HW_BSSID_0))
>> return HW_BSSID_0;
>>
>> With commit d8d59f66d136 ("mt76: mt7615: support 16 interfaces") the
>> ibss and meshpoint mode should "prefer hw bssid slot 1-3". However,
>> with that change the ibss or meshpoint mode will not send any beacon on
>> the mt7622 wifi anymore. Devices were still able to exchange data but
>> only if a bssid already existed. Two mt7622 devices will never be able
>> to communicate.
>>
>> This commits reverts the preferation of slot 1-3 for ibss and
>> meshpoint. Only NL80211_IFTYPE_STATION will still prefer slot 1-3.
>>
>> Tested on Banana Pi R64.
>>
>> Signed-off-by: Nick Hainke <[email protected]>
>
> Felix, can I take this to wireless-drivers? Ack?
Acked-by: Felix Fietkau <[email protected]>

2021-10-23 07:31:05

by Kalle Valo

[permalink] [raw]
Subject: Re: [RFC,v2] mt76: mt7615: mt7622: fix ibss and meshpoint

Nick Hainke <[email protected]> wrote:

> commit 7f4b7920318b ("mt76: mt7615: add ibss support") introduced IBSS
> and commit f4ec7fdf7f83 ("mt76: mt7615: enable support for mesh")
> meshpoint support.
>
> Both used in the "get_omac_idx"-function:
>
> if (~mask & BIT(HW_BSSID_0))
> return HW_BSSID_0;
>
> With commit d8d59f66d136 ("mt76: mt7615: support 16 interfaces") the
> ibss and meshpoint mode should "prefer hw bssid slot 1-3". However,
> with that change the ibss or meshpoint mode will not send any beacon on
> the mt7622 wifi anymore. Devices were still able to exchange data but
> only if a bssid already existed. Two mt7622 devices will never be able
> to communicate.
>
> This commits reverts the preferation of slot 1-3 for ibss and
> meshpoint. Only NL80211_IFTYPE_STATION will still prefer slot 1-3.
>
> Tested on Banana Pi R64.
>
> Fixes: d8d59f66d136 ("mt76: mt7615: support 16 interfaces")
> Signed-off-by: Nick Hainke <[email protected]>
> Acked-by: Felix Fietkau <[email protected]>

Patch applied to wireless-drivers-next.git, thanks.

753453afacc0 mt76: mt7615: mt7622: fix ibss and meshpoint

--
https://patchwork.kernel.org/project/linux-wireless/patch/[email protected]/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches