2020-02-04 05:02:42

by Jupiter

[permalink] [raw]
Subject: Failed to can wifi Invalid Sched_scan parameters

Here is more debug information:

# lsmod
Module Size Used by
option 45056 0
usb_wwan 20480 1 option
usbserial 36864 2 option,usb_wwan
mwifiex_sdio 36864 0
mwifiex 282624 1 mwifiex_sdio
evbug 16384 0

# dmesg | grep mwifiex
[ 34.511371] mwifiex_sdio mmc0:0001:1: info: FW download over, size
258680 bytes
[ 34.788787] mwifiex_sdio mmc0:0001:1: WLAN FW is active
[ 34.873196] mwifiex_sdio mmc0:0001:1: CMD_RESP: cmd 0x242 error, result=0x2
[ 34.880490] mwifiex_sdio mmc0:0001:1: mwifiex_process_cmdresp: cmd
0x242 failed during initialization
[ 35.143577] mwifiex_sdio mmc0:0001:1: info: MWIFIEX VERSION:
mwifiex 1.0 (14.68.36.p60)
[ 35.152105] mwifiex_sdio mmc0:0001:1: driver_version = mwifiex 1.0
(14.68.36.p60)
[ 59.004255] ieee80211 phy0: mwifiex_cfg80211_sched_scan_start :
Invalid Sched_scan parameters
[ 85.976707] ieee80211 phy0: mwifiex_cfg80211_sched_scan_start :
Invalid Sched_scan parameters
[ 166.949603] ieee80211 phy0: mwifiex_cfg80211_sched_scan_start :
Invalid Sched_scan parameters
[ 409.846886] ieee80211 phy0: mwifiex_cfg80211_sched_scan_start :
Invalid Sched_scan parameters
[ 709.774170] ieee80211 phy0: mwifiex_cfg80211_sched_scan_start :
Invalid Sched_scan parameters
[ 1009.659982] ieee80211 phy0: mwifiex_cfg80211_sched_scan_start :
Invalid Sched_scan parameters
[ 1309.572448] ieee80211 phy0: mwifiex_cfg80211_sched_scan_start :
Invalid Sched_scan parameters
[ 1609.481624] ieee80211 phy0: mwifiex_cfg80211_sched_scan_start :
Invalid Sched_scan parameters
[ 1909.370729] ieee80211 phy0: mwifiex_cfg80211_sched_scan_start :
Invalid Sched_scan parameters
[ 2209.279569] ieee80211 phy0: mwifiex_cfg80211_sched_scan_start :
Invalid Sched_scan parameters
[ 2509.170356] ieee80211 phy0: mwifiex_cfg80211_sched_scan_start :
Invalid Sched_scan parameters
[ 2809.085551] ieee80211 phy0: mwifiex_cfg80211_sched_scan_start :
Invalid Sched_scan parameters
[ 3108.989242] ieee80211 phy0: mwifiex_cfg80211_sched_scan_start :
Invalid Sched_scan parameters
[ 3348.887201] ieee80211 phy0: mwifiex_cfg80211_sched_scan_start :
Invalid Sched_scan parameters
[ 3375.844143] ieee80211 phy0: mwifiex_cfg80211_sched_scan_start :
Invalid Sched_scan parameters
[ 3456.825648] ieee80211 phy0: mwifiex_cfg80211_sched_scan_start :
Invalid Sched_scan parameters
[ 3699.809750] ieee80211 phy0: mwifiex_cfg80211_sched_scan_start :
Invalid Sched_scan parameters
[ 3699.952233] mwifiex_sdio mmc0:0001:1: info: trying to associate to
'Centaur24GRouter1' bssid 68:ff:7b:3e:d4:24
[ 3700.025358] mwifiex_sdio mmc0:0001:1: info: associated to bssid
68:ff:7b:3e:d4:24 successfully
[ 3706.132761] mwifiex_sdio mmc0:0001:1: info: successfully
disconnected from 68:ff:7b:3e:d4:24: reason code 15
[ 3717.123970] mwifiex_sdio mmc0:0001:1: info: trying to associate to
'Centaur24GRouter1' bssid 68:ff:7b:3e:d4:24
[ 3717.441578] mwifiex_sdio mmc0:0001:1: info: associated to bssid
68:ff:7b:3e:d4:24 successfully
[ 3723.543587] mwifiex_sdio mmc0:0001:1: info: successfully
disconnected from 68:ff:7b:3e:d4:24: reason code 15
[ 3727.794640] ieee80211 phy0: mwifiex_cfg80211_sched_scan_start :
Invalid Sched_scan parameters
[ 3736.782236] ieee80211 phy0: mwifiex_cfg80211_sched_scan_start :
Invalid Sched_scan parameters
[ 3763.809277] ieee80211 phy0: mwifiex_cfg80211_sched_scan_start :
Invalid Sched_scan parameters
[ 3844.811545] ieee80211 phy0: mwifiex_cfg80211_sched_scan_start :
Invalid Sched_scan parameters
[ 4087.803951] ieee80211 phy0: mwifiex_cfg80211_sched_scan_start :
Invalid Sched_scan parameters
[ 4387.748929] ieee80211 phy0: mwifiex_cfg80211_sched_scan_start :
Invalid Sched_scan parameters
[ 4687.718771] ieee80211 phy0: mwifiex_cfg80211_sched_scan_start :
Invalid Sched_scan parameters
[ 4987.705092] ieee80211 phy0: mwifiex_cfg80211_sched_scan_start :
Invalid Sched_scan parameters
[ 5287.646353] ieee80211 phy0: mwifiex_cfg80211_sched_scan_start :
Invalid Sched_scan parameters
[ 5587.643812] ieee80211 phy0: mwifiex_cfg80211_sched_scan_start :
Invalid Sched_scan parameters
[ 5753.760955] mwifiex_sdio mmc0:0001:1: info: trying to associate to
'Centaur24GRouter1' bssid 68:ff:7b:3e:d4:24
[ 5753.838800] mwifiex_sdio mmc0:0001:1: info: associated to bssid
68:ff:7b:3e:d4:24 successfully
[ 5754.162917] mwifiex_sdio mmc0:0001:1: CMD_RESP: cmd 0x23f error, result=0x2
[ 5848.971534] mwifiex_sdio mmc0:0001:1: CMD_RESP: cmd 0x23f error, result=0x2
[19611.826761] mwifiex_sdio mmc0:0001:1: info: successfully
disconnected from 68:ff:7b:3e:d4:24: reason code 3
[19654.931976] ieee80211 phy0: mwifiex_cfg80211_sched_scan_start :
Invalid Sched_scan parameters
[19686.885717] ieee80211 phy0: mwifiex_cfg80211_sched_scan_start :
Invalid Sched_scan parameters
[19713.896301] ieee80211 phy0: mwifiex_cfg80211_sched_scan_start :
Invalid Sched_scan parameters
[19794.907957] ieee80211 phy0: mwifiex_cfg80211_sched_scan_start :
Invalid Sched_scan parameters
[20037.947625] ieee80211 phy0: mwifiex_cfg80211_sched_scan_start :
Invalid Sched_scan parameters
[20337.974674] ieee80211 phy0: mwifiex_cfg80211_sched_scan_start :
Invalid Sched_scan parameters
[20637.962485] ieee80211 phy0: mwifiex_cfg80211_sched_scan_start :
Invalid Sched_scan parameters
[20716.944299] ieee80211 phy0: mwifiex_cfg80211_sched_scan_start :
Invalid Sched_scan parameters
[20743.951609] ieee80211 phy0: mwifiex_cfg80211_sched_scan_start :
Invalid Sched_scan parameters
[20824.989582] ieee80211 phy0: mwifiex_cfg80211_sched_scan_start :
Invalid Sched_scan parameters
[21068.022269] ieee80211 phy0: mwifiex_cfg80211_sched_scan_start :
Invalid Sched_scan parameters
[21367.979313] ieee80211 phy0: mwifiex_cfg80211_sched_scan_start :
Invalid Sched_scan parameters
[21667.945929] ieee80211 phy0: mwifiex_cfg80211_sched_scan_start :
Invalid Sched_scan parameters
[21967.964944] ieee80211 phy0: mwifiex_cfg80211_sched_scan_start :
Invalid Sched_scan parameters
[22267.953450] ieee80211 phy0: mwifiex_cfg80211_sched_scan_start :
Invalid Sched_scan parameters
[22567.955314] ieee80211 phy0: mwifiex_cfg80211_sched_scan_start :
Invalid Sched_scan parameters
[22867.961508] ieee80211 phy0: mwifiex_cfg80211_sched_scan_start :
Invalid Sched_scan parameters
[23168.000460] ieee80211 phy0: mwifiex_cfg80211_sched_scan_start :
Invalid Sched_scan parameters
[23468.005767] ieee80211 phy0: mwifiex_cfg80211_sched_scan_start :
Invalid Sched_scan parameters
[23676.996473] ieee80211 phy0: mwifiex_cfg80211_sched_scan_start :
Invalid Sched_scan parameters
[23703.958751] ieee80211 phy0: mwifiex_cfg80211_sched_scan_start :
Invalid Sched_scan parameters

Where is the WiFi driver? Please let me know if you need more debug information.

Thank you.

Kind regards,

- jh


On 2/4/20, JH <[email protected]> wrote:
> Hi,
>
> I am running kernel 4.19.75 on iMX6, the WiFi was working most of
> time, but from time to time, the connman could not get WiFi be
> connected due to following error:
>
> [23703.958751] ieee80211 phy0: mwifiex_cfg80211_sched_scan_start :
> Invalid Sched_scan parameters
>
> What does that error means, in which circumstance it occurred? How can
> we prevent it?
>
> Thank you.
>
> Kind regards,
>
> - jh
>


2020-02-04 08:24:58

by Daniel Wagner

[permalink] [raw]
Subject: Re: Failed to can wifi Invalid Sched_scan parameters

Hi JH,

On Tue, Feb 04, 2020 at 04:00:54PM +1100, JH wrote:
> [23703.958751] ieee80211 phy0: mwifiex_cfg80211_sched_scan_start :
> Invalid Sched_scan parameters
>
> Where is the WiFi driver? Please let me know if you need more debug information.

linux/drivers/net/wireless/marvell/mwifiex

> > I am running kernel 4.19.75 on iMX6, the WiFi was working most of
> > time, but from time to time, the connman could not get WiFi be
> > connected due to following error:
> >
> > [23703.958751] ieee80211 phy0: mwifiex_cfg80211_sched_scan_start :
> > Invalid Sched_scan parameters
> >
> > What does that error means, in which circumstance it occurred? How can
> > we prevent it?

The 'Invalid Sched_scan parameters' indicates, wpa_supplicant is
providing the wrong parameters. Best thing is to monitor between
wpa_supplicant and kernel the netlink messages. iwmon is an excellent
tool for this.

Thanks,
Daniel

2020-02-06 11:22:24

by Jupiter

[permalink] [raw]
Subject: Re: Failed to can wifi Invalid Sched_scan parameters

Hi Daniel,

On 2/4/20, Daniel Wagner <[email protected]> wrote:
> The 'Invalid Sched_scan parameters' indicates, wpa_supplicant is
> providing the wrong parameters. Best thing is to monitor between
> wpa_supplicant and kernel the netlink messages. iwmon is an excellent
> tool for this.

Thanks for the tip, I did not realize that connman is actually heavily
relied on wpa_supplicant, if I restarted wpa_supplicant, most of time
it popped up mwifiex_sdio messages, then the WiFi could be up:

$ systemctl restart wpa_supplicant
[ 371.617417] mwifiex_sdio mmc0:0001:1: info: 2
[ 371.647545] mwifiex_sdio mmc0:0001:1: info: associated to bssid 34:08:04:12:y
[ 371.726667] IPv6: ADDRCONF(NETDEV_CHANGE): mlan0: link becomes ready
[ 371.772758] mwifiex_sdio mmc0:0001:1: CMD_RESP: cmd 0x23f error, result=0x2

But sometime when I restated wpa_supplicant, that message did not
come, the WiFi network was still down.

How is mwifiex_sdio related to wpa_supplicant?

Why it is nondeterministic, sometime restart wpa_supplicant could
bring mwifiex_sdio and WiFi up, something it couldn't?

I think mwifiex_sdio is the lowest layer to interact to WiFi modem, in
which circumstance it could bring WiFi modem up and in which
circumstance it couldn't?

That is far too unstable, I always thought I could rely on connman for
WiFi connection stability, but it seems that beyond connman capacity,
so what I can do when the WiFi is not up when restart wpa_supplicant
could not fix it?

Thank you very much Daniel.

Kind regards,

- jh

2020-02-06 13:30:31

by Daniel Wagner

[permalink] [raw]
Subject: Re: Failed to can wifi Invalid Sched_scan parameters

On Thu, Feb 06, 2020 at 10:08:16PM +1100, JH wrote:
> On 2/4/20, Daniel Wagner <[email protected]> wrote:
> > The 'Invalid Sched_scan parameters' indicates, wpa_supplicant is
> > providing the wrong parameters. Best thing is to monitor between
> > wpa_supplicant and kernel the netlink messages. iwmon is an excellent
> > tool for this.
>
> Thanks for the tip, I did not realize that connman is actually heavily
> relied on wpa_supplicant, if I restarted wpa_supplicant, most of time
> it popped up mwifiex_sdio messages, then the WiFi could be up:

The good news here: with iwd ConnMan doesn't have to rely on
wpa_supplicant anymore. We had to add *a lot* of code to ConnMan
because of wpa_supplicant including a lot of work arounds. With iwd we
have a clear separation between the domains. So I strongly recommend
to look at iwd.

> $ systemctl restart wpa_supplicant
> [ 371.617417] mwifiex_sdio mmc0:0001:1: info: 2
> [ 371.647545] mwifiex_sdio mmc0:0001:1: info: associated to bssid 34:08:04:12:y
> [ 371.726667] IPv6: ADDRCONF(NETDEV_CHANGE): mlan0: link becomes ready
> [ 371.772758] mwifiex_sdio mmc0:0001:1: CMD_RESP: cmd 0x23f error, result=0x2
>
> But sometime when I restated wpa_supplicant, that message did not
> come, the WiFi network was still down.

You need to look at what your hardware/firmware, driver and
wpa_supplicant is going on. This is something ConnMan can't fix.

> How is mwifiex_sdio related to wpa_supplicant?

wpa_supplicant steers your WiFi chip.

> Why it is nondeterministic, sometime restart wpa_supplicant could
> bring mwifiex_sdio and WiFi up, something it couldn't?

That is the sad part about WiFi. The quality of the firmware, driver
and wpa_supplicant varies a lot. Some combination works great, others
are unusable.

> I think mwifiex_sdio is the lowest layer to interact to WiFi modem, in
> which circumstance it could bring WiFi modem up and in which
> circumstance it couldn't?

Sure, depending on the quality of the firmware and driver it might be
your main problem.

Don't get me wrong. I don't say your current setup is not good, but
from expierence firmware/drivers and wpa_supplicant tend to be
problematic.

iwd on the other hand is able to hide most of the nasty stuff for
ConnMan and I think in the long run it will be a lot more reliable
then wpa_supplicant was.

> That is far too unstable, I always thought I could rely on connman for
> WiFi connection stability, but it seems that beyond connman capacity,
> so what I can do when the WiFi is not up when restart wpa_supplicant
> could not fix it?

Try iwd.

Thanks,
Daniel