[PATCH] wifi: mac80211: check the control channel before downgrading the bandwidth

Michael-cy Lee (李峻宇) Michael-cy.Lee at mediatek.com
Wed Mar 15 03:01:36 PDT 2023


Hi, 

On Tue, 2023-03-14 at 09:40 +0100, Johannes Berg wrote:
> Hi,
> 
> > It matters because Extender's STA interface's ifmgd->flags is
> > changed
> > during bandwidth downgrading and remains changed to the next
> > association.
> 
> OK but then _that_ seems like the problem here, no?

Right.

> 
> > Since there is no way to reset ifmgd->flags after bandwidth
> > downgrading, we check the control channel before downgrading the
> > bandwidth. If the control channels are different, we directly fail
> > the
> > association.
> > 
> 
> Right, but what if you had an association to some other AP, or two
> chanctxes were allowed, or something else?

In our scenario, if two chanctxs were allowed,
ieee80211_link_use_channel would not return non-zero, and the
association should succeed.

And if Extender's STA interface had an association with some other AP,
it would first de-authenticate with that AP, then scan and associate
with another new AP. The same issue still happens in this case.

To deal with other cases, the new function
ieee80211_check_same_ctrl_channel iterates through ieee80211_local's
chanctx_list to find a chanctx with the same cfg80211_chan_def as
RootAP.

> 
> I feel we should probably instead just reset these ifmgd->flags
> before
> association, or so?

Yes, it might also be a solution.

> 
> johannes


Best, 
Michael


More information about the Linux-mediatek mailing list