Re: [EXT] Re: [PATCH v10 1/2] wifi: mwifiex: add host mlme for client mode

From: Brian Norris
Date: Fri May 24 2024 - 13:02:36 EST


On Fri, May 24, 2024 at 2:46 AM David Lin <yu-hao.lin@xxxxxxx> wrote:
> > From: Brian Norris <briannorris@xxxxxxxxxxxx>
> >
> > On Thu, Apr 18, 2024 at 02:06:25PM +0800, David Lin wrote:
> > > +static int
> > > +mwifiex_cfg80211_probe_client(struct wiphy *wiphy,
> > > + struct net_device *dev, const u8 *peer,
> > > + u64 *cookie) {
> > > + return -EOPNOTSUPP;
> > > +}
> > > +
> >
> > > + mwifiex_cfg80211_ops.probe_client =
> > > + mwifiex_cfg80211_probe_client;
> >
> > For the record, I feel like this question was not adequately handled from v8.
> > That thread is:
> >
> > https://lore.kern/
> > el.org%2Fall%2FCA%2BASDXM1PEMRyxRpBryJ7G6e7yzG8Ku%2Bg2_qpHN3g5d
> > jFpAWkw%40mail.gmail.com%2F&data=05%7C02%7Cyu-hao.lin%40nxp.com%
> > 7C0b65f7e4a5fc46c8bdbc08dc7ac2c9ff%7C686ea1d3bc2b4c6fa92cd99c5c301
> > 635%7C0%7C0%7C638520224227876720%7CUnknown%7CTWFpbGZsb3d8eyJ
> > WIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7
> > C0%7C%7C%7C&sdata=MpqW1U4yTgDcM0g20DRSAxEnHkNNkd2hwsZrVAxg8p
> > w%3D&reserved=0
> > Re: [EXT] Re: [PATCH v8 1/2] wifi: mwifiex: add host mlme for client mode
>
> The difference with and without hooking probe_client() is that "poll_command_supported" of hostapd will be set or not.
> If "poll_command_supported" is not set (won't hook probe_client), it will let hostapd to set "use_monitor" and client can't
> connect to AP.

Yes, I already said that in the above reply.

If you read my v8 reply, my suggestion was that you need to fix
hostapd, rather than advertise lies in the kernel. You don't support
probe_client, so you shouldn't advertise it.

I think you should dig into the reasoning from this commit to figure
out what to do:
https://w1.fi/cgit/hostap/commit/?id=a11241fa114923b47892ad3279966839e9c2741d

Personally, I'm not sure what hostapd is doing with
NL80211_CMD_PROBE_CLIENT ... but you're the one submitting the code,
not me.

> Maybe I can put following comments:
>
> Hook probe_client to avoid hostapd to set "poll_command_supported" as 0 and set "use_monitor" to 1.

If we really can't fix hostapd, I'd avoid using such literal
descriptions of implementation details like variable names. Maybe
better:

"hostapd looks for NL80211_CMD_PROBE_CLIENT support; otherwise, it
requires monitor-mode support (which mwifiex doesn't support). Provide
fake probe_client support to work around this."

But again, please actually explore the reason hostapd is doing this
first, and see if you can fix it.

Brian