[PCIE9098] Scan while starting hostapd on second MAC makes BSS creation fail

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

[PCIE9098] Scan while starting hostapd on second MAC makes BSS creation fail

5,235 Views
martinetd
Contributor IV

Hello,

I am using a AW-XM458 wireless module sample, which use this driver with PCIE9098, on an imx8mp-evk board with the 5.10.72-2.2.0 BSP (as per previous threads, adjusted to restore PCI behaviour on old soc; but this also happens without that PCI workaround patch on our production boards)

 

That wifi module has two independant MACs, so it is possible to e.g. connect mlan0 (first mac) to an AP and run hostapd on muap0 (second mac) at the same time.

We ran into a problem trying to start hostapd at boot, where networkmanager would do a scan on mlan0 and hostapd would refuse to start with this error:

[ 2279.721584] IOCTL failed: 00000000b7cff4c2 id=0x20000, sub_id=0x20001 action=1, status_code=0x1

where the id is MLAN_IOCTL_BSS and sub_id is MLAN_OID_BSS_START

 

I was able to reproduce on evk just running `iw mlan0 scan` while starting hostapd, here's logs with no debugs (attached is the same log with drvdbg=0xffffff as I wasn't sure what to provide)

 

root@imx8mpevk:~# modprobe moal
[ 7046.194696] wlan: Loading MWLAN driver
[ 7046.198911] wlan: Driver loaded successfully
[ 7046.198917] wlan: Register to Bus Driver...
root@imx8mpevk:~# [ 7046.207675] Attach moal handle ops, card interface type: 0x206
[ 7046.214862] No module param cfg file specified
[ 7046.219336] rx_work=1 cpu_num=4
[ 7046.222495] Attach mlan adapter operations.card_type is 0x206.
[ 7046.231163] Request firmware: nxp/pcieuart9098_combo_v1.bin
[ 7046.237223] WLAN FW already running! Skip FW download
[ 7046.242316] WLAN FW is active
[ 7046.245303] on_time is 7046466184407
[ 7046.273706] fw_cap_info=0x81c3fa3, dev_cap_mask=0xffffffff
[ 7046.279235] max_p2p_conn = 8, max_sta_conn = 64
[ 7046.296300] wlan: version = PCIE9098--17.92.5.p11-MM5X17283.p2-GPL-(FP92) 
[ 7046.304021] Attach moal handle ops, card interface type: 0x206
[ 7046.309958] No module param cfg file specified
[ 7046.314479] rx_work=1 cpu_num=4
[ 7046.317718] Attach mlan adapter operations.card_type is 0x206.
[ 7046.339225] Request firmware: nxp/pcieuart9098_combo_v1.bin
[ 7046.345556] WLAN FW already running! Skip FW download
[ 7046.350690] WLAN FW is active
[ 7046.353709] on_time is 7046574589033
[ 7046.371280] fw_cap_info=0x81c3fa3, dev_cap_mask=0xffffffff
[ 7046.376915] max_p2p_conn = 8, max_sta_conn = 64
[ 7046.387936] wlan: version = PCIE9098--17.92.5.p11-MM5X17283.p2-GPL-(FP92) 
[ 7046.395524] wlan: Register to Bus Driver Done

root@imx8mpevk:~# 
root@imx8mpevk:~# 
root@imx8mpevk:~# systemctl start hostapd iw-scan
[ 7052.734717] br0: port 1(muap0) entered blocking state
[ 7052.739874] br0: port 1(muap0) entered disabled state
[ 7052.745582] device muap0 entered promiscuous mode
[ 7052.750396] audit: type=1700 audit(1655958335.989:45): dev=muap0 prom=256 old_prom=0 auid=4294967295 uid=0 gid=0 ses=4294967295
[ 7052.752612] wlan: mlan0 START SCAN
[ 7052.776449] wlan: Starting AP
[ 7052.779940] Get ht_cap from beacon ies: 0xc
[ 7052.784236] Get vht_cap from beacon ies: 0x0
[ 7052.788538] Get vht_oprat_ie from beacon ies: chan_width=0
[ 7052.794125] fw doesn't support 11ax
[ 7052.798412] CMD_RESP: cmd 0xb1 error, result=0x1
[ 7052.803050] IOCTL failed: 0000000002e7555e id=0x20000, sub_id=0x20001 action=1, status_code=0x1
[ 7052.851101] device muap0 left promiscuous mode
[ 7052.855880] audit: type=1700 audit(1655958336.109:46): dev=muap0 prom=0 old_prom=256 auid=4294967295 uid=0 gid=0 ses=4294967295
[ 7052.855938] br0: port 1(muap0) entered disabled state
Job for hostapd.service failed because the control process exited with error code.
See "systemctl status hostapd.service" and "journalctl -xe" for details.
[ 7055.366625] wlan: SCAN COMPLETED: scanned AP count=12

 

 

 

hostapd without iw scan works fine.

Here's the hostapd config

 

hw_mode=a
channel=44
ssid=myap
wpa_passphrase=myap_pass
interface=muap0
bridge=br0
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP
rsn_pairwise=CCMP
driver=nl80211
country_code=JP
ctrl_interface=/var/run/hostapd
ctrl_interface_group=0
disassoc_low_ack=1
preamble=1
wmm_enabled=1
macaddr_acl=0
auth_algs=1
ignore_broadcast_ssid=0
wpa=2
ieee80211ac=1
ieee80211ax=1
ieee80211n=1
ieee80211d=1
ieee80211h=1
logger_syslog=-1
logger_syslog_level=2
logger_stdout=-1
logger_stdout_level=2

 

 

the two services just start hostapd for one, and run `ip link set mlan0 up; iw mlan0 scan` for the other one. full script attached with log file, but they are more complex than necessary because I first thought this had to happen immediately after module load (that is not the case)

 

Would you have recommendations for how to start both services reliably?

In particular we've tried retries for hostapd which might look like it works but sometimes the AP is not properly setup and userspace thinks it is fine, so I'd rather avoid something like this as it is not reliable. And waiting for hostapd to start networkmanager brings in other ordering difficulties...

Ideally the firmware should be able to handle this (I assume the scan requires a change of frequency range for the other mac which interrupts the setup operation), but instead perhaps the driver could take a lock and make the bss setup and scan wait for each other?

 

Thanks,

Dominique

0 Kudos
19 Replies

5,057 Views
weidong_sun
NXP TechSupport
NXP TechSupport

Hi @martinetd ,

 

I tested it using systemctl to start hostapd.

Attachment is 2 configuration files of hostapd, and hostapd.service

below is my logs:

root@imx8qmmek:~/bin_mxm# systemctl start hostapd
[ 310.987678] wlan: SCAN COMPLETED: scanned AP count=0
[ 310.998266] wlan: HostMlme uap0 send deauth/disassoc
[ 311.011722] wlan: HostMlme muap0 send deauth/disassoc
[ 311.020659] wlan: Starting AP
[ 311.023961] Get ht_cap from beacon ies: 0x2c
[ 311.028556] fw doesn't support 11ax
[ 311.035766] wlan: AP started
[ 311.038703] IPv6: ADDRCONF(NETDEV_CHANGE): muap0: link becomes ready
[ 311.046644] Set AC=3, txop=47 cwmin=3, cwmax=7 aifs=1
[ 311.052093] Set AC=2, txop=94 cwmin=7, cwmax=15 aifs=1
[ 311.057615] wlan: Starting AP
[ 311.060874] Get ht_cap from beacon ies: 0x1ff
[ 311.065400] Get vht_cap from beacon ies: 0x338179b0
[ 311.070314] Get vht_oprat_ie from beacon ies: chan_width=0
[ 311.080631] wlan: AP started
[ 311.083597] Set AC=0, txop=0 cwmin=15, cwmax=63 aifs=3
[ 311.089117] IPv6: ADDRCONF(NETDEV_CHANGE): uap0: link becomes ready
[ 311.095689] Set AC=1, txop=0 cwmin=15, cwmax=1023 aifs=7
[ 311.102231] Set AC=3, txop=47 cwmin=3, cwmax=7 aifs=1
[ 311.107683] Set AC=2, txop=94 cwmin=7, cwmax=15 aifs=1
root@imx8qmmek:~/bin_mxm# [ 311.113154] Set AC=0, txop=0 cwmin=15, cwmax=63 aifs=3
[ 311.120667] Set AC=1, txop=0 cwmin=15, cwmax=1023 aifs=7

-------------------------------------------

Then run iw mlan0 scan, no problem. I didn't encounter any errors.

Starting commands:

# systemctl --system daemon-reload

# systemctl start hostapd

[Note]

1. I also tested your configurations for hostapd.conf, but failed.

2. Before starting service, interfaces you want to use should be up.

# ifconfig mlan0 up

# ifconfig uap0 up

# ifconfig muap0 up

3. hostapd.service is in the /lib/systemd/system/ path.

 

Regards,

weidong

 

0 Kudos

5,045 Views
martinetd
Contributor IV

hi @weidong_sun 

 

The scan has to be simultaneous to hostapd startup for the failure to reproduce.

As illustrated in my last post, you should have these messages on dmesg:

[  344.231956] wlan: mlan0 START SCAN
[  344.245359] wlan: Starting AP

 Notice how "Starting AP" happens ~14ms after START SCAN, so both commands need to be run at the same time.

When they start simultaneously like this, sometimes (often) hostapd fails to start.

 

There is no problem with scans before or after AP was started, but unfortunately with networkmanager we do not control when scans happen and when system starts the scan starts at the same time as hostapd startup for our setup.

It is possible to add an ugly "sleep 5" to delay hostapd startup, but there should be a better solution.

 

Thank you,

Dominique

0 Kudos

5,038 Views
weidong_sun
NXP TechSupport
NXP TechSupport

Dear @martinetd ,

 

>>It is possible to add an ugly "sleep 5" to delay hostapd startup, but there should be a better solution.

According to my test, the starting speed of hostapd is faster, I feel that 3 seconds should be enough.

 

try it, please!

Regards,

weidong

0 Kudos

5,165 Views
weidong_sun
NXP TechSupport
NXP TechSupport

Hello @martinetd ,

 

I created a full AP that can provide IP address for the device connected muap. No any problem.

1. nano /etc/hostapd-mac2-2g.conf

ctrl_interface=/var/run/hostapd
interface=muap0
driver=nl80211
ssid=NIL_STA2_SSID_2G
hw_mode=g
channel=6
beacon_int=100
dtim_period=1
wmm_enabled=1
ignore_broadcast_ssid=0
max_num_sta=10
ieee80211n=1
rts_threshold=256
fragm_threshold=2346
ht_capab=[SHORT-GI-20]
#ieee80211d=1
#country_code=US
#uapsd_advertisement_enabled=0
#accept_mac_file=/etc/hostapd.accept
#deny_mac_file=/etc/hostapd.deny
own_ip_addr=192.168.2.2 # this is the muap0 ip address

2. nano /etc/udhcpd.conf

# The start and end of the IP lease block
start 192.168.2.1
end 192.168.2.24
interface uap0 #default: eth0
max_leases 20 #default: 254
remaining yes #default: yes
auto_time 7200 #default: 7200 (2 hours)
decline_time 3600 #default: 3600 (1 hour)
conflict_time 3600 #default: 3600 (1 hour)
offer_time 60 #default: 60 (1 minute)
min_lease 60 #defult: 60
lease_file /etc/udhcpd.leases
opt dns 192.168.0.1 #router IP
option subnet 255.255.255.0
opt router 192.168.2.1 # muap0 gw IP
option domain local
option lease 864000

3. touch /etc/udhcpd.leases

4. Loading driver (using FP92 driver released in default linux bsp)

root@imx8qmmek:/lib/modules/5.10.72-lts-5.10.y+ga68e31b63f86/extra# insmod mlan.ko
[ 232.073994] mlan: loading out-of-tree module taints kernel.
root@imx8qmmek:/lib/modules/5.10.72-lts-5.10.y+ga68e31b63f86/extra# insmod moal.ko mod_para=nxp/wifi_mod_para.conf
[ 250.346565] wlan: Loading MWLAN driver
[ 250.351225] wlan: Driver loaded successfully
[ 250.351329] wlan: Register to Bus Driver...
root@imx8qmmek:/lib/modules/5.10.72-lts-5.10.y+ga68e31b63f86/extr[ 250.360155] wlan_pcie 0000:01:00.0: enabling device (0000 -> 0002)
a# [ 250.371856] Attach moal handle ops, card interface type: 0x206
[ 250.380068] PCIE9098: init module param from usr cfg
[ 250.385138] card_type: PCIE9098, config block: 0
[ 250.389799] cfg80211_wext=0xf
[ 250.392773] max_vir_bss=1
[ 250.395428] cal_data_cfg=none
[ 250.398442] ps_mode = 1
[ 250.400887] auto_ds = 1
[ 250.403375] host_mlme=enable
[ 250.406280] mac_addr=00:50:43:20:12:34
[ 250.410059] fw_name=nxp/pcieuart9098_combo_v1.bin
[ 250.414808] rx_work=1 cpu_num=6
[ 250.417993] Attach mlan adapter operations.card_type is 0x206.
[ 250.425292] Request firmware: nxp/pcieuart9098_combo_v1.bin
[ 250.797318] FW download over, size 673800 bytes
[ 251.125310] WLAN FW is active
[ 251.128309] on_time is 251123080250
[ 251.147585] VDLL image: len=148860
[ 251.151258] fw_cap_info=0xc8fcffa3, dev_cap_mask=0xffffffff
[ 251.156902] max_p2p_conn = 8, max_sta_conn = 64
[ 251.170759] wlan: version = PCIE9098--17.68.1.p109.2-MM5X17283.p2-GPL-(FP92)
[ 251.178761] wlan_pcie 0000:01:00.1: enabling device (0000 -> 0002)
[ 251.185162] Attach moal handle ops, card interface type: 0x206
[ 251.191689] PCIE9098: init module param from usr cfg
[ 251.196748] card_type: PCIE9098, config block: 1
[ 251.201389] cfg80211_wext=0xf
[ 251.204357] max_vir_bss=1
[ 251.207080] cal_data_cfg=none
[ 251.210600] ps_mode = 1
[ 251.213063] auto_ds = 1
[ 251.215551] host_mlme=enable
[ 251.218511] mac_addr=00:50:43:20:52:56
[ 251.222584] fw_name=nxp/pcieuart9098_combo_v1.bin
[ 251.227326] rx_work=1 cpu_num=6
[ 251.230502] Attach mlan adapter operations.card_type is 0x206.
[ 251.249398] Request firmware: nxp/pcieuart9098_combo_v1.bin
[ 251.256529] WLAN FW already running! Skip FW download
[ 251.261657] WLAN FW is active
[ 251.264642] on_time is 251259415875
[ 251.272040] VDLL image: len=148860
[ 251.275688] fw_cap_info=0x68fcffa3, dev_cap_mask=0xffffffff
[ 251.281419] max_p2p_conn = 8, max_sta_conn = 64
[ 251.293609] wlan: version = PCIE9098--17.68.1.p109.2-MM5X17283.p2-GPL-(FP92)
[ 251.302138] wlan: Register to Bus Driver Done

5. adding IP address for muap0

root@imx8qmmek:/lib/modules/5.10.72-lts-5.10.y+ga68e31b63f86/extra# ifconfig muap0 192.168.2.2 netmask 255.255.255.0 up
root@imx8qmmek:/lib/modules/5.10.72-lts-5.10.y+ga68e31b63f86/extra# route add default gw 192.168.2.1

6. Starting hosapd service

root@imx8qmmek:/lib/modules/5.10.72-lts-5.10.y+ga68e31b63f86/extra# hostapd -d /etc/hostapd-mac2-2g.conf -B

random: Trying to read entropy from /dev/random
Configuration file: /etc/hostapd-mac2-2g.conf
nl80211: TDLS supported
nl80211: TDLS external setup
nl80211: Supported cipher 00-0f-ac:1
nl80211: Supported cipher 00-0f-ac:5
nl80211: Supported cipher 00-0f-ac:2
nl80211: Supported cipher 00-0f-ac:4
nl80211: Supported cipher 00-14-72:1
nl80211: Supported cipher 00-0f-ac:6
nl80211: Supported cipher 00-0f-ac:11
nl80211: Supported cipher 00-0f-ac:12
nl80211: Supported cipher 00-0f-ac:8
nl80211: Supported cipher 00-0f-ac:9
nl80211: Supported cipher 00-0f-ac:10
nl80211: Supports Probe Response offload in AP mode
nl80211: Using driver-based off-channel TX
nl80211: TDLS channel switch
nl80211: Driver-advertised extended capabilities (default) - hexdump(len=11): 00 00 00 00 21 00 00 40 00 00 00
nl80211: Driver-advertised extended capabilities mask (default) - hexdump(len=11): 00 00 00 00 21 00 00 40 00 00 00
nl80211: Supported vendor command: vendor_id=0x5043 subcmd=0
nl80211: Supported vendor command: vendor_id=0x5043 subcmd=4105
nl80211: Supported vendor command: vendor_id=0x5043 subcmd=7
nl80211: Supported vendor command: vendor_id=0x5043 subcmd=4608
nl80211: Supported vendor command: vendor_id=0x5043 subcmd=4609
nl80211: Supported vendor command: vendor_id=0x5043 subcmd=4610
nl80211: Supported vendor command: vendor_id=0x5043 subcmd=5376
nl80211: Supported vendor command: vendor_id=0x5043 subcmd=5888
nl80211: Supported vendor command: vendor_id=0x5043 subcmd=5889
nl80211: Supported vendor command: vendor_id=0x5043 subcmd=5890
nl80211: Supported vendor command: vendor_id=0x5043 subcmd=3
nl80211: Supported vendor command: vendor_id=0x5043 subcmd=4
nl80211: Supported vendor command: vendor_id=0x5043 subcmd=5
nl80211: Supported vendor command: vendor_id=0x5043 subcmd=256
nl80211: Supported vendor command: vendor_id=0x5043 subcmd=5126
nl80211: Supported vendor command: vendor_id=0x5043 subcmd=5124
nl80211: Supported vendor command: vendor_id=0x5043 subcmd=4106
nl80211: Supported vendor command: vendor_id=0x5043 subcmd=4109
nl80211: Supported vendor command: vendor_id=0x5043 subcmd=5121
nl80211: Supported vendor command: vendor_id=0x5043 subcmd=5123
nl80211: Supported vendor command: vendor_id=0x5043 subcmd=5120
nl80211: Supported vendor command: vendor_id=0x5043 subcmd=5122
nl80211: Supported vendor command: vendor_id=0x5043 subcmd=5128
nl80211: Supported vendor command: vendor_id=0x5043 subcmd=5125
nl80211: Supported vendor command: vendor_id=0x5043 subcmd=5127
nl80211: Supported vendor command: vendor_id=0x5043 subcmd=17
nl80211: Supported vendor command: vendor_id=0x5043 subcmd=18
nl80211: Supported vendor event: vendor_id=0x5043 subcmd=0
nl80211: Supported vendor event: vendor_id=0x5043 subcmd=1
nl80211: Supported vendor event: vendor_id=0x5043 subcmd=5377
nl80211: Supported vendor event: vendor_id=0x5043 subcmd=65539
nl80211: Supported vendor event: vendor_id=0x5043 subcmd=65540
nl80211: Supported vendor event: vendor_id=0x5043 subcmd=65541
nl80211: Supported vendor event: vendor_id=0x5043 subcmd=65542
nl80211: Supported vendor event: vendor_id=0x5043 subcmd=65543
nl80211: Supported vendor event: vendor_id=0x5043 subcmd=65544
nl80211: Supported vendor event: vendor_id=0x5043 subcmd=65547
nl80211: Supported vendor event: vendor_id=0x5043 subcmd=65548
nl80211: Supported vendor event: vendor_id=0x5043 subcmd=65549
nl80211: Supported vendor event: vendor_id=0x5043 subcmd=65550
nl80211: Use separate P2P group interface (driver advertised support)
nl80211: interface muap0 in phy mwiphy1
nl80211: Set mode ifindex 7 iftype 3 (AP)
nl80211: Setup AP(muap0) - device_ap_sme=0 use_monitor=0
nl80211: Subscribe to mgmt frames with AP handle 0xaaab0d3fcd10
nl80211: Register frame type=0xb0 (WLAN_FC_STYPE_AUTH) nl_handle=0xaaab0d3fcd10 match=
nl80211: Register frame type=0x0 (WLAN_FC_STYPE_ASSOC_REQ) nl_handle=0xaaab0d3fcd10 [ 356.400534] wlan: HostMlme muap0 send deauth/disassoc
match=
nl80211: Register frame type=0x20 (WLAN_FC_STYPE_REASSOC_REQ) nl_handle=0xaaab0d3fcd10 match=
nl80211: Register frame type=0xa0 (WLAN_FC_STYPE_DISASSOC) nl_handle=0xaaab0d3fcd10 match=
nl80211: Register frame type=0xc0 (WLAN_FC_STYPE_DEAUTH) nl_handle=0xaaab0d3fcd10 match=
nl80211: Register frame type=0x40 (WLAN_FC_STYPE_PROBE_REQ) nl_handle=0xaaab0d3fcd10 match=
nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0xaaab0d3fcd10 match=04
nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0xaaab0d3fcd10 match=0501
nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0xaaab0d3fcd10 match=0503
nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0xaaab0d3fcd10 match=0504
nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0xaaab0d3fcd10 match=06
nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0xaaab0d3fcd10 match=08
nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0xaaab0d3fcd10 match=09
nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0xaaab0d3fcd10 match=0a
nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0xaaab0d3fcd10 match=11
nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0xaaab0d3fcd10 match=7f
rfkill: Cannot open RFKILL control device
nl80211: RFKILL status not available
nl80211: Add own interface ifindex 7 (ifidx_reason -1)
nl80211: if_indices[16]: 7(-1)
phy: mwiphy1
BSS count 1, BSSID mask 00:00:00:00:00:00 (0 bits)
nl80211: Regulatory information - country=00
nl80211: 2402-2472 @ 40 MHz 20 mBm
nl80211: 2457-2482 @ 20 MHz 20 mBm (no IR)
nl80211: 2474-2494 @ 20 MHz 20 mBm (no OFDM) (no IR)
nl80211: 5170-5250 @ 80 MHz 20 mBm (no IR)
nl80211: 5250-5330 @ 80 MHz 20 mBm (DFS) (no IR)
nl80211: 5490-5730 @ 160 MHz 20 mBm (DFS) (no IR)
nl80211: 5735-5835 @ 80 MHz 20 mBm (no IR)
nl80211: 57240-63720 @ 2160 MHz 0 mBm
nl80211: Added 802.11b mode based on 802.11g information
nl80211: Mode IEEE 802.11g: 2412 2417 2422 2427 2432 2437 2442 2447 2452 2457 2462 2467[NO_IR] 2472[NO_IR] 2484[NO_IR]
nl80211: Mode IEEE 802.11a: 5180[NO_IR] 5200[NO_IR] 5220[NO_IR] 5240[NO_IR] 5260[NO_IR][RADAR] 5280[NO_IR][RADAR] 5300[NO_IR][RADAR] 5320[NO_IR][RADAR] 5500[NO_IR][RADAR] 5520[NO_IR][RADAR] 5540[NO_IR][RADAR]
nl80211: Mode IEEE 802.11b: 2412 2417 2422 2427 2432 2437 2442 2447 2452 2457 2462 2467[NO_IR] 2472[NO_IR] 2484[NO_IR]
Completing interface initialization
Mode: IEEE 802.11g Channel: 6 Frequency: 2437 MHz
DFS 0 channels required radar detection
nl80211: Set freq 2437 (ht_enabled=1, vht_enabled=0, he_enabled=0, bandwidth=20 MHz, cf1=2437 MHz, cf2=0 MHz)
* freq=2437
* he_enabled=0
* vht_enabled=0
* ht_enabled=1
* sec_channel_offset=0
* channel_type=1
RATE[0] rate=10 flags=0x1
RATE[1] rate=20 flags=0x1
RATE[2] rate=55 flags=0x1
RATE[3] rate=110 flags=0x1
RATE[4] rate=60 flags=0x0
RATE[5] rate=90 flags=0x0
RATE[6] rate=120 flags=0x0
RATE[7] rate=180 flags=0x0
RATE[8] rate=240 flags=0x0
RATE[9] rate=360 flags=0x0
RATE[10] rate=480 flags=0x0
RATE[11] rate=540 flags=0x0
hostapd_setup_bss(hapd=0xaaab0d3f60f0 (muap0), first=1)
muap0: Flushing old station entries
nl80211: flush -> DEL_STATION muap0 (all)
muap0: Deauthenticate all stations
nl80211: send_mlme - da= ff:ff:ff:ff:ff:ff noack=0 freq=0 no_cck=0 offchanok=0 wait_time=0 fc=0xc0 (WLAN_FC_STYPE_DEAUTH) nlmode=3
nl80211: send_mlme -> send_frame
nl80211: send_frame - Use bss->freq=2437
nl80211: send_frame -> send_frame_cmd
wpa_driver_nl80211_set_key: ifindex=7 (muap0) alg=0 addr=(nil) key_idx=0 set_tx=0 seq_len=0 key_len=0
wpa_driver_nl80211_set_key: ifindex=7 (muap0) alg=0 addr=(nil) key_idx=1 set_tx=0 seq_len=0 key_len=0
wpa_driver_nl80211_set_key: ifindex=7 (muap0) alg=0 addr=(nil) key_idx=2 set_tx=0 seq_len=0 key_len=0
wpa_driver_nl80211_set_key: if[ 356.740721] wlan: Starting AP
index=7 (muap0) alg=0 addr=(nil) key_idx=3 set_tx=0 seq_len=0 key[ 356.749950] Get ht_cap from beacon ies: 0x2c
_len=0
Using interface muap0 with hwaddr 00:50:43:20:53:56 and s[ 356.758636] fw doesn't support 11ax
sid "NIL_STA2_SSID_2G"
nl80211: Set beacon (beacon_set=0)
nl802[ 356.772392] wlan: AP started
11: Beacon head - hexdump(len=67): 80 00 00 00 ff ff ff ff ff ff [ 356.776079] IPv6: ADDRCONF(NETDEV_CHANGE): muap0: link becomes ready
00 50 43 20 53 56 00 50 43 20 53 56 00 00 00 00 00 00 00 00 00 00[ 356.790357] Set AC=3, txop=47 cwmin=3, cwmax=7 aifs=1
64 00 01 04 00 10 4e 49 4c 5f 53 54 41 32 5f 53 53 49 44 5f 32 4[ 356.799041] Set AC=2, txop=94 cwmin=7, cwmax=15 aifs=1
7 01 08 82 84 8b 96 0c 12 18 24 03 01 06
nl80211: Beacon tail - [ 356.809927] Set AC=0, txop=0 cwmin=15, cwmax=63 aifs=3
hexdump(len=101): 2a 01 04 32 04 30 48 60 6c 3b 02 51 00 2d 1a 2c[ 356.820767] Set AC=1, txop=0 cwmin=15, cwmax=1023 aifs=7
00 03 ff ff 00 00 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 00 00 00 3d 16 06 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 7f 08 04 00 00 02 21 00 00 40 dd 18 00 50 f2 02 01 01 01 00 03 a4 00 00 27 a4 00 00 42 43 5e 00 62 32 2f 00
nl80211: ifindex=7
nl80211: beacon_int=100
nl80211: beacon_rate=0
nl80211: rate_type=0
nl80211: dtim_period=1
nl80211: ssid=NIL_STA2_SSID_2G
* beacon_int=100
* dtim_period=1
nl80211: proberesp (offload) - hexdump(len=168): 50 00 00 00 00 00 00 00 00 00 00 50 43 20 53 56 00 50 43 20 53 56 00 00 00 00 00 00 00 00 00 00 64 00 01 04 00 10 4e 49 4c 5f 53 54 41 32 5f 53 53 49 44 5f 32 47 01 08 82 84 8b 96 0c 12 18 24 03 01 06 2a 01 04 32 04 30 48 60 6c 3b 02 51 00 2d 1a 2c 00 03 ff ff 00 00 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 00 00 00 3d 16 06 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 7f 08 04 00 00 02 21 00 00 40 dd 18 00 50 f2 02 01 01 01 00 03 a4 00 00 27 a4 00 00 42 43 5e 00 62 32 2f 00
nl80211: hidden SSID not in use
nl80211: privacy=0
nl80211: auth_algs=0x3
nl80211: wpa_version=0x0
nl80211: key_mgmt_suites=0x4
nl80211: pairwise_ciphers=0x0
nl80211: group_cipher=0x1
nl80211: SMPS mode - off
nl80211: beacon_ies - hexdump(len=10): 7f 08 04 00 00 02 21 00 00 40
nl80211: proberesp_ies - hexdump(len=10): 7f 08 04 00 00 02 21 00 00 40
nl80211: assocresp_ies - hexdump(len=10): 7f 08 04 00 00 02 21 00 00 40
nl80211: ap_max_inactivity=300
nl80211: Set muap0 operstate 0->1 (UP)
netlink: Operstate: ifindex=7 linkmode=-1 (no change), operstate=6 (IF_OPER_UP)
nl80211: TX queue param set: queue=0 aifs=1 cw_min=3 cw_max=7 burst_time=15 --> res=0
nl80211: TX queue param set: queue=1 aifs=1 cw_min=7 cw_max=15 burst_time=30 --> res=0
nl80211: TX queue param set: queue=2 aifs=3 cw_min=15 cw_max=63 burst_time=0 --> res=0
nl80211: TX queue param set: queue=3 aifs=7 cw_min=15 cw_max=1023 burst_time=0 --> res=0
muap0: interface state UNINITIALIZED->ENABLED
muap0: AP-ENABLED
muap0: Setup of interface done.

7. starting DHCP service

root@imx8qmmek:/lib/modules/5.10.72-lts-5.10.y+ga68e31b63f86/extra# udhcpd -S /etc/udhcpd.conf -f &

[1] 701
udhcpd: started, v1.33.1

8. Connecting mobile to the muap0

root@imx8qmmek:/lib/modules/5.10.72-lts-5.10.y+ga68e31b63f86/extra# [ 397.207861] muap0:
[ 397.207883] wlan: HostMlme Auth received from a4:XX:XX:XX:74:b5
[ 397.216646] wlan: HostMlme muap0 send Auth
[ 397.223874] muap0:
[ 397.223885] wlan: HostMlme MICRO_AP_STA_ASSOC a4:XX:XX:XX:74:b5
[ 397.234062] wlan: UAP/GO add peer station, address =a4:XX:XX:XX:74:b5
[ 397.244627] wlan: HostMlme muap0 send assoc/reassoc resp
udhcpd: sending OFFER to 192.168.2.1
udhcpd: sending OFFER to 192.168.2.1
udhcpd: sending ACK to 192.168.2.1
[ 419.352863] muap0:
[ 419.352883] wlan: HostMlme Deauth Receive from a4:XX:XX:XX:74:b5
[ 419.361317] wlan: hostmlme notify deauth station a4:XX:XX:XX:74:b5
[ 419.367565] muap0:
[ 419.367575] wlan: EVENT: MICRO_AP_STA_DEAUTH a4:XX:XX:XX:74:b5
[ 419.585198] wlan: hostmlme notify deauth station a4:XX:XX:XX:74:b5
[ 419.591476] muap0:
[ 419.591486] wlan: EVENT: MICRO_AP_STA_DEAUTH a4:XX:XX:XX:74:b5
[ 434.002260] muap0:
[ 434.002279] wlan: HostMlme Auth received from a4:XX:XX:XX:74:b5
[ 434.010916] wlan: HostMlme muap0 send Auth
[ 434.018674] muap0:
[ 434.018685] wlan: HostMlme MICRO_AP_STA_ASSOC a4:XX:XX:XX:74:b5
[ 434.028636] wlan: UAP/GO add peer station, address =a4:XX:XX:XX:74:b5
[ 434.035682] wlan: HostMlme muap0 send assoc/reassoc resp
udhcpd: sending OFFER to 192.168.2.1
udhcpd: sending OFFER to 192.168.2.1

On Mobile side:

weidong_sun_1-1656061595148.png

 

[Note]

My board is not connected to external router, so it can't access internet. But my mobile can get IP address from muap0.

 

Regards,

weidong

 

 

 

 

 

 

0 Kudos

5,159 Views
martinetd
Contributor IV

@weidong_sun 

Thank you for looking.

As said in the original post and my latest message, hostapd does start sometimes (and starts reliably when not doing a scan); I have no problem setting up an AP if the first MAC is not used at the same time.

 

The problem is that sometimes hostapd would not start for our product, and it seems to be due to scans so I provided a reproducer. hostapd should never fail to start!

In our product we use NetworkManager with one MAC available for client setup and the second MAC for AP with hostapd, and it is extremly difficult to control when NetworkManager does its scans so a workaround to just not run scan is not acceptable for us. Please try to reproduce hostapd start failures with my reproducer (just running `iw mlan0 scan` at the same time), and if you can confirm the problem escalate for internal investigation.

Thank you.

0 Kudos

5,118 Views
weidong_sun
NXP TechSupport
NXP TechSupport

Hello @martinetd ,

 

I enabled 2 uAPs, and write a script, for you reference.

-----------------------------

#! /bin/bash

insmod /home/root/bin_mxm/mlan.ko

insmod /home/root/bin_mxm/moal.ko mod_para=nxp/wifi_mod_para.conf

 

for (( i = 1; i <= 10; i++ ))

do

    ifconfig -a 2>&1 | grep -E "(mlan0|uap0|wfd0|mmlan0|muap0|mwfd0)" > /dev/null

    if [ $? -eq 0 ]; then

        break

    fi

    sleep 1

done

echo "enable uap0 and add gateway"

   ifconfig uap0 192.168.6.2 netmask 255.255.255.0 up

   route add default gw 192.168.6.1

echo "starting hostapd service for uap0"

   hostapd /etc/hostapd-uap0-5g.conf -B

echo "starting udhcpd service for uap0"

   udhcpd -S /etc/udhcpd-uap0.conf -f &

   sleep 1

echo "enable muap0 and add gatewy"

   ifconfig muap0 192.168.5.2 netmask 255.255.255.0 up

   route add default gw 192.168.5.1

echo "startig hosapd service for muap0"

   hostapd  /etc/hostapd-muap0-2g.conf -B

echo "starting udhcpd service for muap0"

   udhcpd -S /etc/udhcpd-muap0.conf -f &

--------------------------

Regards,

weidong

0 Kudos

5,111 Views
martinetd
Contributor IV

hi @weidong_sun 

I am thankful that you are looking but I cannot help but to think that I am not clear enough.

I have no problem setting up only APs. I can also setup AP + client if I am careful with timing scans.

But it is not normal that AP fails to setup when client scans at the wrong time.

 

I do not need more advice, please ask someone to look at the error and traces I have provided in for example https://community.nxp.com/t5/Wireless-Connectivity/PCIE9098-Scan-while-starting-hostapd-on-second-MA... and https://community.nxp.com/t5/Wireless-Connectivity/PCIE9098-Scan-while-starting-hostapd-on-second-MA... (previous two posts)

I would be glad to provide more informations if you cannot reproduce the problem.

Thank you,

Dominique

0 Kudos

5,150 Views
weidong_sun
NXP TechSupport
NXP TechSupport

Hello @martinetd ,

 

Actually , IOCTRL failed , The error message will not cause any issue, It only means that driver doesn't support commands from user application. 

you mentioned your hostapd can't start automatically sometimes. 

attachment may be helful for you.

 

Regards,

weidong

 

0 Kudos

5,133 Views
martinetd
Contributor IV

hi @weidong_sun

I will say it once again: I can make hostapd work perfectly fine if I only use a single MAC, or configuring both MACs as AP on different bands; I do not need help with this.

My problem is using one MAC as client (networkmanager, but here reproduced with a simple scan) and another as AP.

 

That IOCTRL failed message is a real problem. Here are some more traces at hostapd level if you do not believe me:

[ 1564.868614] IOCTL failed: 00000000cd58a33e id=0x20000, sub_id=0x20001 action=1, status_code=0x1

traced down to woal_request_ioctl returning -1 with the following stack trace:
        woal_request_ioctl+0
        woal_cfg80211_add_beacon+1860
        nl80211_start_ap+1912
        genl_family_rcv_msg_doit+208
        genl_rcv_msg+236
        netlink_rcv_skb+100
        genl_rcv+64
        netlink_unicast+556
        netlink_sendmsg+464
        ____sys_sendmsg+520
        ___sys_sendmsg+132
        __sys_sendmsg+112
        __arm64_sys_sendmsg+44
        el0_svc_common.constprop.0+128
        do_el0_svc+40
        el0_svc+32
        el0_sync_handler+164
        el0_sync+384

traced down to strace and these NLMSG_ERROR errors:

sendmsg(5, {msg_name={sa_family=AF_NETLINK, nl_pid=0, nl_groups=00000000}, msg_namelen=12, msg_iov=[{iov_base=[{nlmsg_len=480, nlmsg_type=nl80211, nlmsg_flags=NLM_F_REQUEST|NLM_F_ACK, nlmsg_seq=1656304066, nlmsg_pid=-801109714}, "\x0f\x00\x00\x00\x08\x00\x03\x00\x08\x00\x00\x00\x47\x00\x0e\x00\x80\x00\x00\x00\xff\xff\xff\xff\xff\xff\x34\x6f\x24\xc0\xc6\xcb\x34\x6f\x24\xc0\xc6\xcb\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x64\x00\x01\x04\x00\x10\x4e\x49\x4c\x5f\x53\x54\x41\x32\x5f\x53\x53\x49\x44\x5f\x32\x47\x01\x08\x82\x84\x8b\x96\x0c\x12\x18\x24\x03\x01\x06\x00\x69\x00\x0f\x00\x2a\x01\x04\x32\x04\x30\x48\x60\x6c\x3b\x02\x51\x00\x2d\x1a\x2c\x00\x03\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x3d\x16\x06\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x08\x04\x00\x00\x00\x21\x00\x00\x40\xdd\x18\x00\x50\xf2\x02\x01\x01\x01\x00\x03\xa4\x00\x00\x27\xa4\x00\x00\x42\x43\x5e\x00\x62\x32\x2f\x00\x00\x00\x00\x08\x00\x0c\x00\x64\x00\x00\x00\x08\x00\x0d\x00\x01\x00\x00\x00\x14\x00\x34\x00\x4e\x49\x4c\x5f\x53\x54\x41\x32\x5f\x53\x53\x49\x44\x5f\x32\x47\xac\x00\x91\x00\x50\x00\x00\x00\x00\x00\x00\x00\x00\x00\x34\x6f\x24\xc0\xc6\xcb\x34\x6f\x24\xc0\xc6\xcb\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x64\x00\x01\x04\x00\x10\x4e\x49\x4c\x5f\x53\x54\x41\x32\x5f\x53\x53\x49\x44\x5f\x32\x47\x01\x08\x82\x84\x8b\x96\x0c\x12\x18\x24\x03\x01\x06\x2a\x01\x04\x32\x04\x30\x48\x60\x6c\x3b\x02\x51\x00\x2d\x1a\x2c\x00\x03\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x3d\x16\x06\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x08\x04\x00\x00\x00\x21\x00\x00\x40\xdd\x18\x00\x50\xf2\x02\x01\x01\x01\x00\x03\xa4\x00\x00\x27\xa4\x00\x00\x42\x43\x5e\x00\x62\x32\x2f\x00\x08\x00\x7e\x00\x00\x00\x00\x00\x0e\x00\x2a\x00\x7f\x08\x04\x00\x00\x00\x21\x00\x00\x40\x00\x00\x0e\x00\x7f\x00\x7f\x08\x04\x00\x00\x00\x21\x00\x00\x40\x00\x00\x0e\x00\x80\x00\x7f\x08\x04\x00\x00\x00\x21\x00\x00\x40\x00\x00\x06\x00\x96\x00\x2c\x01\x00\x00"], iov_len=480}], msg_iovlen=1, msg_controllen=0, msg_flags=0}, 0) = 480
mmap(NULL, 20480, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xffff8fc64000
recvmsg(5, {msg_name={sa_family=AF_NETLINK, nl_pid=0, nl_groups=00000000}, msg_namelen=12, msg_iov=[{iov_base=[{nlmsg_len=36, nlmsg_type=NLMSG_ERROR, nlmsg_flags=NLM_F_CAPPED, nlmsg_seq=1656304066, nlmsg_pid=-801109714}, {error=-EFAULT, msg={nlmsg_len=480, nlmsg_type=nl80211, nlmsg_flags=NLM_F_REQUEST|NLM_F_ACK, nlmsg_seq=1656304066, nlmsg_pid=-801109714}}], iov_len=16384}], msg_iovlen=1, msg_controllen=0, msg_flags=0}, MSG_PEEK|MSG_TRUNC) = 36
recvmsg(5, {msg_name={sa_family=AF_NETLINK, nl_pid=0, nl_groups=00000000}, msg_namelen=12, msg_iov=[{iov_base=[{nlmsg_len=36, nlmsg_type=NLMSG_ERROR, nlmsg_flags=NLM_F_CAPPED, nlmsg_seq=1656304066, nlmsg_pid=-801109714}, {error=-EFAULT, msg={nlmsg_len=480, nlmsg_type=nl80211, nlmsg_flags=NLM_F_REQUEST|NLM_F_ACK, nlmsg_seq=1656304066, nlmsg_pid=-801109714}}], iov_len=16384}], msg_iovlen=1, msg_controllen=0, msg_flags=0}, 0) = 36
munmap(0xffff8fc64000, 20480)           = 0
munmap(0xffff8fc69000, 16384)           = 0
writev(1, [{iov_base="nl80211: Beacon set failed: -14 (Bad address)", iov_len=45}, {iov_base="\n", iov_len=1}], 2) = 46
writev(1, [{iov_base="Failed to set beacon parameters", iov_len=31}, {iov_base="\n", iov_len=1}], 2) = 32

As you can see, hostapd fails immediately after that "ioctl" failure:

- https://w1.fi/cgit/hostap/tree/src/ap/beacon.c#n1970 ('Failed to set beacon parameters' message)

- https://w1.fi/cgit/hostap/tree/src/drivers/driver_nl80211.c#n4848 ('Beacon set failed' message)

- send_and_recv_msgs_connect_handle() just above can be traced down to these netlink calls

- and the code calling set_beacon() just keeps propagating the error and fails immediately, exiting hostapd in my case.

 

Could you please report this problem to the firmware developers and/or provide advice to workaround this problem in the driver?

 

Thank you,

Dominique

0 Kudos

5,183 Views
weidong_sun
NXP TechSupport
NXP TechSupport

Hello @martinetd ,

 

I just tested the conf file.

weidong_sun_0-1656050590014.png

 

It is ok.

Regards,

weidong

0 Kudos

5,186 Views
weidong_sun
NXP TechSupport
NXP TechSupport

Hello @martinetd ,

 

I got a script for NO.2 MAC , configure it to work on 2.4G(sorry for previous config!), please!  for 9098, we suggest: MAC0 -- 5G; MAC1--2.4G.

-----------------------

ctrl_interface=/var/run/hostapd
interface=muap0
driver=nl80211
ssid=NIL_STA2_SSID_2G
hw_mode=g
channel=6
beacon_int=100
dtim_period=1
wmm_enabled=1
ignore_broadcast_ssid=0
max_num_sta=10
ieee80211n=1
rts_threshold=256
fragm_threshold=2346
ht_capab=[SHORT-GI-20]
#ieee80211d=1
#country_code=US
#uapsd_advertisement_enabled=0
#accept_mac_file=/etc/hostapd.accept
#deny_mac_file=/etc/hostapd.deny

------------------------

Regards,

weidong

 

0 Kudos

5,170 Views
martinetd
Contributor IV

hi @weidong_sun 

I can reproduce the same problem with 2g bands.

 

root@imx8mpevk:~# iw mlan0 scan > /dev/null & hostapd hostapd-test-2g.conf  
[1] 1406
[  344.231956] wlan: mlan0 START SCAN
Configuration file: hostapd-test-2g.conf
rfkill: Cannot open RFKILL control device
Using interface muap0 with hwadd[  344.245359] wlan: Starting AP
r 34:6f:24:c0:c6:cb and ssid "NIL[  344.251268] Get ht_cap from beacon ies: 0x2c
_STA2_SSID_2G"
[  344.258342] fw doesn't support 11ax
[  344.263790] CMD_RESP: cmd 0xb1 error, result=0x1
[  344.268430] IOCTL failed: 00000000a3bfba04 id=0x20000, sub_id=0x20001 action=1, status_code=0x1
Failed to set beacon parameters
Interface initialization failed
muap0: interface state UNINITIALIZED->DISABLED
muap0: AP-DISABLED 
muap0: Unable to setup interface.
muap0: interface state DISABLED->DISABLED
muap0: AP-DISABLED 
muap0: CTRL-EVENT-TERMINATING 
hostapd_free_hapd_data: Interface muap0 wasn't started
nl80211: deinit ifname=muap0 disabled_11b_rates=0
root@imx8mpevk:~# [  346.969441] wlan: SCAN COMPLETED: scanned AP count=16

[1]+  Done                    iw mlan0 scan > /dev/null
root@imx8mpevk:~# 
root@imx8mpevk:~# cat hostapd-test-2g.conf
ctrl_interface=/var/run/hostapd
interface=muap0
driver=nl80211
ssid=NIL_STA2_SSID_2G
hw_mode=g
channel=6
beacon_int=100
dtim_period=1
wmm_enabled=1
ignore_broadcast_ssid=0
max_num_sta=10
ieee80211n=1
rts_threshold=256
fragm_threshold=2346
ht_capab=[SHORT-GI-20]

 

Out of 10 tries it worked once for me, so it does not fail every time, but it should be easy to reproduce.

 

Thank you

Dominique

0 Kudos

4,493 Views
weidong_sun
NXP TechSupport
NXP TechSupport

Hello @martinetd ,

 

Several days ago, a distributor FAE also submitted the question to our SFDC system. I replied to him.

I tested it according to your steps.

when mlan0 is scanning AP, muap can't be noramlly started.

So We should adjust our strategy, wait for the scanning to end, and then start muap0, below script for your reference.

========================================

for (( i = 1; i <= 10; i++ ))
do
     iw mlan0 scan >/dev/null &
     if [ $? -eq 0 ]; then
         break;
      else
         sleep 1
     fi
done

ifconfig muap0 192.168.5.2 netmask 255.255.255.0 up
route add default gw 192.168.5.1
hostapd /etc/hostapd-muap0.conf -B

========================================

Have a nice day!

Regards,

weidong

0 Kudos

5,107 Views
weidong_sun
NXP TechSupport
NXP TechSupport

Hi @martinetd ,

 

I used the same commands as yours, but I can't reproduce your issue.

-------------------------

1. mlan0 + uap0
# ifconfig mlan0 up
# ifconfig uap0 up
# iw mlan0 scan > /dev/null & hostapd /etc/hostapd-uap0-5g.conf
[1] 686
[ 164.149266] wlan: mlan0 START SCAN
Configuration file: /etc/hostapd-uap0-5g.conf
rfkill: Cannot open RFKILL control device
uap0: interface state UNINITIALIZED->COUNTRY_UPDATE
uap0: interface state COUNTRY_UPDATE->HT_SCAN[ 165.973283] uap0: Skip change virtual intf on uap: type=2

[ 166.302749] uap0: Skip change virtual intf on uap: type=3
Failed to request a scan of neighboring BSSes ret=-16 (Device or resource busy) - try to scan again
[ 167.289592] wlan: SCAN COMPLETED: scanned AP count=5
[ 167.719061] wlan: SCAN COMPLETED: scanned AP count=0
[ 167.730140] wlan: HostMlme uap0 send deauth/disassoc
Using interface uap0 with hwaddr 00:50:43:20:13:34 and ssid "uap0-5g-80m"
[ 167.774601] wlan: Starting AP
[ 167.777937] Get ht_cap from beacon ies: 0x1ff
[ 167.782514] Get vht_cap from beacon ies: 0x338179b0
[ 167.787456] Get vht_oprat_ie from beacon ies: chan_width=0
[ 167.797838] wlan: AP started
[ 167.800758] IPv6: ADDRCONF(NETDEV_CHANGE): uap0: link becomes ready
[ 167.809605] Set AC=3, txop=47 cwmin=3, cwmax=7 aifs=1
[ 167.814933] Set AC=2, txop=94 cwmin=7, cwmax=15 aifs=1
[ 167.820429] Set AC=0, txop=0 cwmin=15, cwmax=63 aifs=3
[ 167.825832] Set AC=1, txop=0 cwmin=15, cwmax=1023 aifs=7
uap0: interface state HT_SCAN->ENABLED
uap0: AP-ENABLED

Stop :
Cuap0: interface state ENABLED->DISABLED[ 213.389938] wlan: HostMlme uap0 send deauth/disassoc

uap0: AP-DISABLED
uap0: CTRL-EVENT-TERMINATING
nl80211: deinit ifname=uap0 disabled_11b_rates=0
[ 213.413362] wlan: Stoping AP
[ 213.416468] wlan: AP stopped
[1]+ Done iw mlan0 scan > /dev/null


2. mlan0 + muap0
# ifconfig muap0 up
# iw mlan0 scan > /dev/null & hostapd /etc/hostapd-muap0-2g.conf
[1] 696
[ 347.475572] wlan: mlan0 START SCAN
Configuration file: /etc/hostapd-muap0-2g.conf
rfkill: Cannot open RFKILL control device[ 347.488032] wlan: HostMlme muap0 send deauth/disassoc

muap0: interface state UNINITIALIZED->COUNTRY_UPDATE
Using interface muap0 with hwaddr 00:50:43:20:53:56 and ssid "mua[ 348.936316] wlan: Starting AP
p0_2g_20m"
[ 348.944544] Get ht_cap from beacon ies: 0x2c
[ 348.949879] fw doesn't support 11ax
[ 348.956396] wlan: AP started
[ 348.959365] IPv6: ADDRCONF(NETDEV_CHANGE): muap0: link becomes ready
[ 348.966684] Set AC=3, txop=47 cwmin=3, cwmax=7 aifs=1
[ 348.972340] Set AC=2, txop=94 cwmin=7, cwmax=15 aifs=1
[ 348.977849] Set AC=0, txop=0 cwmin=15, cwmax=63 aifs=3
[ 348.983344] Set AC=1, txop=0 cwmin=15, cwmax=1023 aifs=7
muap0: interface state COUNTRY_UPDATE->ENABLED
muap0: AP-ENABLED
[ 349.096371] wlan: SCAN COMPLETED: scanned AP count=7

---------------------------

Regards,

weidong

0 Kudos

5,092 Views
martinetd
Contributor IV

hi @weidong_sun 

you didn't share the config used for your two attempts, but the first example has an HT SCAN at the start of hostapd so it doesn't try to create bss immediately when scan is starting; you won't reproduce easily with it (although as illustrated in my example with channel=0 it *might* be possible to reproduce from time to time if running the mlan0 scan in a loop, see https://community.nxp.com/t5/Wireless-Connectivity/PCIE9098-Scan-while-starting-hostapd-on-second-MA...  -- but I wouldn't recommend spending time on this)

 

The second example also spends ~1.5s on deauth and country update according to the timestamps; I'm not sure why it needs to do this as it does not when I run hostapd here it: on my logs we had,

[  344.231956] wlan: mlan0 START SCAN
[  344.245359] wlan: Starting AP

 so less than 14ms between scan start and AP start driver messages,

as opposed to

[ 347.475572] wlan: mlan0 START SCAN
[ 348.956396] wlan: AP started

so 1.48s in the logs you provided.

Please try to reproduce a few times with the config at the end of https://community.nxp.com/t5/Wireless-Connectivity/PCIE9098-Scan-while-starting-hostapd-on-second-MA... ; even with this hostapd sometimes starts for me as well but it fails roughly 9 out of 10 times so if you can get timestamps close I believe you should be able to reproduce.

 

Thank you,

Dominique

0 Kudos

5,213 Views
weidong_sun
NXP TechSupport
NXP TechSupport

Hello @martinetd ,

 

Yes, 88W9098 supports 2 MACs.

MAC0 : mlan0/uap0/wfd0.  It supports 802.11ax (WiFi 6)

MAC1: mmlan0/muap0/mwfd0.  It supports 802.11ac, NOT support 802.11ax

 

check your hospapd, please!

Have a good day!

Regards,

weidong

 

 

0 Kudos

5,210 Views
martinetd
Contributor IV

hi @weidong_sun 

> MAC1: mmlan0/muap0/mwfd0. It supports 802.11ac, NOT support 802.11ax

 

Ah, I hadn't noticed this point -- but that's not the problem here. I can still reproduce with `ieee80211ax=0` in my hostapd.conf (and incidentally still get `fw doesn't support 11ax` in dmesg, but the actual error here is `IOCTL failed: 00000000cf2502a9 id=0x20000, sub_id=0x20001 action=1, status_code=0x1` which is not present when hostapd starts when it starts alone)

 

The problem is really related to the scan on the first mac, as hostapd starts reliably if there is no scan at the same time.

Please try to reproduce by starting iw mlan0 scan and hostapd on muap0 at the same time, it is as easy as:

 

# ip link set mlan0 up

# iw mlan0 scan > /dev/null & hostapd /etc/hostapd.conf

 

 

Thank you,

Dominique

0 Kudos

5,194 Views
weidong_sun
NXP TechSupport
NXP TechSupport

Hello @martinetd ,

 

Try it like below in hostapd.conf

---------------------------------------------------

interface=muap0
hw_mode=a
channel=0
country_code=US
ssid=NXP_Demo
auth_algs=1
ieee80211n=1
wpa=2
wpa_key_mgmt=WPA-PSK
rsn_pairwise=CCMP
wpa_passphrase=123456789

------------------------------------

Regards,

weidong

0 Kudos

5,190 Views
martinetd
Contributor IV

 

Hello @weidong_sun 

 

Thank you for the config to test. I had to change the country to JP due to regulations here.

You are changing the timings by having hostapd detect a free channel first with channel=0, so the reproducer needs adjustments:

 - I can reproduce with your configuration and explicitly setting channel=48, and a simple "iw mlan0 scan & hostapd hostapd.conf" as before.

 - I can also reproduce with your config as is (channel=0) by running "while true; do iw mlan0 scan > /dev/null; done & hostapd hostapd-test.conf" instead -- this keeps scans in a loop on the first mac, so by the time hostapd decided on a channel there is a chance another scan is running on mlan0. I did not reproduce as reliably with this (fails around 1/3 tries here), but I get the same `IOCTL failed: 000000002b099576 id=0x20000, sub_id=0x20001 action=1, status_code=0x1` error.

 

root@imx8mpevk:~# while true; do iw mlan0 scan > /dev/null; done & hostapd hostapd-test.conf 
[1] 40908
[97032.553437] wlan: mlan0 START SCAN
Configuration file: hostapd-test.conf
rfkill: Cannot open RFKILL control device
muap0: interface state UNINITIALIZED->COUNTRY_UPDATE
ACS: Automatic channel selection started, this may take a bit
[97035.290953] wlan: SCAN COMPLETED: scanned AP count=12
[97035.457403] wlan: SCAN COMPLETED: scanned AP count=4
muap0: interface state COUNTRY_UPDATE->ACS
muap0: ACS-STARTED 
[97035.640136] wlan: SCAN COMPLETED: scanned AP count=2
[97035.654286] wlan: mlan0 START SCAN
[97038.390485] wlan: SCAN COMPLETED: scanned AP count=16
[97038.557165] wlan: SCAN COMPLETED: scanned AP count=3
[97038.738326] wlan: SCAN COMPLETED: scanned AP count=3
[97038.747872] wlan: mlan0 START SCAN


[97041.483785] wlan: SCAN COMPLETED: scanned AP count=18
[97041.650355] wlan: SCAN COMPLETED: scanned AP count=1
muap0: ACS-COMPLETED freq=5220 channel=44
Using interface muap0 with hwaddr 34:6f:24:c0:c6:cb a[97041.668262] wlan: mlan0 START SCAN
nd ssid "NXP_Demo"
[97041.673989] wlan: Starting AP
[97041.678867] Get ht_cap from beacon ies: 0xc
[97041.683223] fw doesn't support 11ax
[97041.687269] CMD_RESP: cmd 0xb1 error, result=0x1
[97041.691917] IOCTL failed: 000000002b099576 id=0x20000, sub_id=0x20001 action=1, status_code=0x1
Failed to set beacon parameters
Interface initialization failed
muap0: interface state ACS->DISABLED
muap0: AP-DISABLED 
ACS: Possibly channel configuration is invalid, please report this along with your config file.
ACS: Failed to start
muap0: AP-DISABLED 
hostapd_free_hapd_data: Interface muap0 wasn't started
nl80211: deinit ifname=muap0 disabled_11b_rates=0
muap0: interface state DISABLED->DISABLED
muap0: interface state DISABLED->DISABLED
muap0: AP-DISABLED 
muap0: CTRL-EVENT-TERMINATING 
hostapd_free_hapd_data: Interface muap0 wasn't started
root@imx8mpevk:~# 
root@imx8mpevk:~# 
root@imx8mpevk:~# [97044.402700] wlan: SCAN COMPLETED: scanned AP count=18
[97044.415849] wlan: mlan0 START SCAN
fg
while true; do
    iw mlan0 scan > /dev/null;
done
^C
root@imx8mpevk:~# [97047.149915] wlan: SCAN COMPLETED: scanned AP count=18

root@imx8mpevk:~# 
root@imx8mpevk:~# cat hostapd-test.conf  
interface=muap0
hw_mode=a
channel=0
country_code=JP
ssid=NXP_Demo
auth_algs=1
ieee80211n=1
wpa=2
wpa_key_mgmt=WPA-PSK
rsn_pairwise=CCMP
wpa_passphrase=123456789

 

Thank you,

Dominique

0 Kudos