[mako] can not create an ad-hoc network

Bug #1337753 reported by Antti Kaijanmäki
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
linux-mako (Ubuntu)
Confirmed
Undecided
Unassigned
network-manager (Ubuntu)
Invalid
Low
Unassigned
wpa (Ubuntu)
Incomplete
Medium
Unassigned

Bug Description

When trying to create an adhoc network using network-manager with mako kernel "Linux ubuntu-phablet 3.4.0-5-mako #28-Ubuntu SMP PREEMPT Fri Mar 28 15:20:22 UTC 2014 armv7l armv7l armv7l GNU/Linux" the creation fails with:

NetworkManager[1347]: <info> Activation (wlan0) starting connection 'Ubuntu hotspot'
wpa_supplicant[1735]: wlan0: CTRL-EVENT-SCAN-STARTED
kernel: [ 1202.120128] wlan: [1352:E :SME] csrMoveTempScanResultsToMainList: 2908: 11d AP Bssid 00:1e:ab:04:92:77 chan= 1, rssi = -83, countryCode TW
kernel: [ 1202.120341] wlan: [1352:E :SME] csrMoveTempScanResultsToMainList: 2908: 11d AP Bssid c8:60:00:dc:42:90 chan= 8, rssi = -66, countryCode GB
kernel: [ 1202.120616] wlan: [1352:E :SME] csrMoveTempScanResultsToMainList: 2928: Information about current country Bssid c8:60:00:dc:42:90 chan= 8, rssi = -66, countryCode GB
wpa_supplicant[1735]: wlan0: Trying to associate with SSID 'Ubuntu hotspot'
NetworkManager[1347]: <info> (wlan0): supplicant interface state: disconnected -> associating
kernel: [ 1202.989958] wlan: [1352:E :PE ] limMlmAddBss: 1672: TRYING TO HIDE SSID 0
kernel: [ 1202.990477] wlan: [1352:E :PE ] mlm_add_sta: 1573: GF: 0, ChnlWidth: 0, MimoPS: 0, lsigTXOP: 0, dsssCCK: 0, SGI20: 0, SGI400
kernel: [ 1203.007416] wlan: [1352:F :PE ] limProcessIbssMlmAddBssRsp: 2524: could not activate Heartbeat timer
kernel: [ 1203.008087] VOS ASSERT in logDebug Line 219
kernel: [ 1203.008759] ------------[ cut here ]------------
kernel: [ 1203.008850] WARNING: at /build/buildd/linux-mako-3.4.0/drivers/staging/prima/CORE/SYS/legacy/src/utils/src/logApi.c:219 logDebug+0xc0/0xf4()
kernel: [ 1203.008881] Modules linked in:
kernel: [ 1203.008972] [<c00150d0>] (unwind_backtrace+0x0/0xe8) from [<c08cbf68>] (dump_stack+0x20/0x24)
kernel: [ 1203.009033] [<c08cbf68>] (dump_stack+0x20/0x24) from [<c0075628>] (warn_slowpath_common+0x5c/0x74)
kernel: [ 1203.009094] [<c0075628>] (warn_slowpath_common+0x5c/0x74) from [<c00756fc>] (warn_slowpath_null+0x2c/0x34)
kernel: [ 1203.009186] [<c00756fc>] (warn_slowpath_null+0x2c/0x34) from [<c069aad4>] (logDebug+0xc0/0xf4)
kernel: [ 1203.009247] [<c069aad4>] (logDebug+0xc0/0xf4) from [<c05e06cc>] (limLog+0x48/0x50)
kernel: [ 1203.009339] [<c05e06cc>] (limLog+0x48/0x50) from [<c05fdce8>] (limProcessMlmAddBssRsp+0x168/0xd40)
kernel: [ 1203.009400] [<c05fdce8>] (limProcessMlmAddBssRsp+0x168/0xd40) from [<c05f5010>] (limProcessMessages+0xe74/0x10ac)
kernel: [ 1203.009491] [<c05f5010>] (limProcessMessages+0xe74/0x10ac) from [<c05f5560>] (limMessageProcessor+0x274/0x2bc)
kernel: [ 1203.009552] [<c05f5560>] (limMessageProcessor+0x274/0x2bc) from [<c05db1a8>] (peProcessMessages+0x54/0x5c)
kernel: [ 1203.009613] [<c05db1a8>] (peProcessMessages+0x54/0x5c) from [<c06ba540>] (VosMCThread+0x44c/0x68c)
kernel: [ 1203.009705] [<c06ba540>] (VosMCThread+0x44c/0x68c) from [<c0095954>] (kthread+0x9c/0xa8)
kernel: [ 1203.009766] [<c0095954>] (kthread+0x9c/0xa8) from [<c000ee74>] (kernel_thread_exit+0x0/0x8)
kernel: [ 1203.009827] ---[ end trace 4821fc77d3719675 ]---
NetworkManager[1347]: <warn> Activation (wlan0/wireless): Ad-Hoc network creation took too long, failing activation.
NetworkManager[1347]: <info> (wlan0): device state change: config -> failed (reason 'supplicant-timeout') [50 120 11]
wpa_supplicant[1735]: wlan0: CTRL-EVENT-DISCONNECTED bssid=00:00:00:00:00:00 reason=3 locally_generated=1

Revision history for this message
Antti Kaijanmäki (kaijanmaki) wrote :
summary: - can not create an ad-hoc network
+ [mako] can not create an ad-hoc network
Revision history for this message
Antti Kaijanmäki (kaijanmaki) wrote :

You can reproduce by copying this configuration file to the device:

On host:
$ adb push Ubuntu\ hotspot /etc/NetworkManager/system-connections/Ubuntu\ hotspot

On Device:
$ sudo chmod 600 /etc/NetworkManager/system-connections/Ubuntu\ hotspot
$ sudo restart network-manager
$ nmcli c up uuid aab22b5d-7342-48dc-8920-1b7da31d6829

description: updated
Revision history for this message
Mathieu Trudel-Lapierre (cyphermox) wrote :

This would be a kernel bug. There is nothing NM can do if the device says it supports ad-hoc and really doesn't.

Changed in network-manager (Ubuntu):
status: New → Invalid
importance: Undecided → Low
Changed in wpasupplicant (Ubuntu):
importance: Undecided → Medium
status: New → Incomplete
Revision history for this message
Mathieu Trudel-Lapierre (cyphermox) wrote :

There may or may not be something to do with wpasupplicant here in some cases; while we need to first make sure ad-hoc works at all with the wcnss driver, there may be work needed in wpasupplicant as well, so I'll mark this Incomplete for wpa for now.

affects: wpasupplicant (Ubuntu) → wpa (Ubuntu)
Revision history for this message
Tony Espy (awe) wrote :

A couple of comments...

Currently Ubuntu uses "adhoc" for it's Hotspot functionality. This seems at odds with what other OSes do. Both OSX and Android use mode=Master which is what's used by Access Points.

When our Hotspot is run in adhoc mode, it:

1. Is invisible to Android, as Android implements Wi-Fi direct. The Wi-Fi scan list filters out all adhoc networks, and the Wi-Fi Direct settings page doesn't show any present adhoc network either.

2. iOS and OSX both show Adhoc networks as "Devices" ( a separate sub-menu item in the WiFi menu ) vs. just being listed with the other available Wi-Fi networks.

3. Some iOS or OSX devices may display a warning about the hotspot not being connected to the Internet, although once connected, Internet connectivity is provided.

Revision history for this message
Tony Espy (awe) wrote :

@Mathieu

What's the difference between the wpasupplicant (Ubuntu) package and the wpa (Ubuntu) package?

Revision history for this message
Tony Espy (awe) wrote :

When I follow Antti's instructions in comment #2, I get the following error when trying to activate the hotspot:

root@ubuntu-phablet:~# nmcli c up uuid aab22b5d-7342-48dc-8920-1b7da31d6829
Error: No suitable device found: no device found for connection 'Ubuntu hotspot'.

Revision history for this message
Tony Espy (awe) wrote :

OK, after updating the mac-address in Antti's connection file, I was able to get this to work. I now see the following when I run the nmcli command:

root@ubuntu-phablet:~# nmcli c up uuid aab22b5d-7342-48dc-8920-1b7da31d6829
Error: Timeout 90 sec expired.

...and I get the same NetworkManager log messages in syslog about Ad-Hoc taking too long to associate:

Jul 10 21:31:51 ubuntu-phablet NetworkManager[3465]: <info> Activation (wlan0) starting connection 'hotspot'
Jul 10 21:31:51 ubuntu-phablet NetworkManager[3465]: <info> (wlan0): device state change: disconnected -> prepare (reason 'none') [30 40 0]
Jul 10 21:31:51 ubuntu-phablet NetworkManager[3465]: <info> Activation (wlan0) Stage 1 of 5 (Device Prepare) scheduled...
Jul 10 21:31:51 ubuntu-phablet NetworkManager[3465]: <info> Activation (wlan0) Stage 1 of 5 (Device Prepare) started...
Jul 10 21:31:51 ubuntu-phablet NetworkManager[3465]: <info> Activation (wlan0) Stage 2 of 5 (Device Configure) scheduled...
Jul 10 21:31:51 ubuntu-phablet NetworkManager[3465]: <info> Activation (wlan0) Stage 1 of 5 (Device Prepare) complete.
Jul 10 21:31:51 ubuntu-phablet NetworkManager[3465]: <info> Activation (wlan0) Stage 2 of 5 (Device Configure) starting...
Jul 10 21:31:51 ubuntu-phablet NetworkManager[3465]: <info> (wlan0): device state change: prepare -> config (reason 'none') [40 50 0]
Jul 10 21:31:51 ubuntu-phablet NetworkManager[3465]: <info> Activation (wlan0/wireless): connection 'hotspot' has security, and secrets exist. No new secrets needed.
Jul 10 21:31:51 ubuntu-phablet NetworkManager[3465]: <info> Config: added 'ssid' value 'hotspot'
Jul 10 21:31:51 ubuntu-phablet NetworkManager[3465]: <info> Config: added 'mode' value '1'
Jul 10 21:31:51 ubuntu-phablet NetworkManager[3465]: <info> Config: added 'frequency' value '2412'
Jul 10 21:31:51 ubuntu-phablet NetworkManager[3465]: <info> Config: added 'key_mgmt' value 'WPA-PSK'
Jul 10 21:31:51 ubuntu-phablet NetworkManager[3465]: <info> Config: added 'psk' value '<omitted>'
Jul 10 21:31:51 ubuntu-phablet NetworkManager[3465]: <info> Config: added 'proto' value 'RSN'
Jul 10 21:31:51 ubuntu-phablet NetworkManager[3465]: <info> Config: added 'pairwise' value 'CCMP'
Jul 10 21:31:51 ubuntu-phablet NetworkManager[3465]: <info> Config: added 'group' value 'CCMP'
Jul 10 21:31:51 ubuntu-phablet NetworkManager[3465]: <info> Activation (wlan0) Stage 2 of 5 (Device Configure) complete.
Jul 10 21:31:51 ubuntu-phablet NetworkManager[3465]: <info> Config: set interface ap_scan to 2
Jul 10 21:31:51 ubuntu-phablet NetworkManager[3465]: <info> (wlan0): supplicant interface state: inactive -> associating
Jul 10 21:32:17 ubuntu-phablet NetworkManager[3465]: <warn> Activation (wlan0/wireless): Ad-Hoc network creation took too long, failing activation.
Jul 10 21:32:17 ubuntu-phablet NetworkManager[3465]: <info> (wlan0): device state change: config -> failed (reason 'supplicant-timeout') [50 120 11]
Jul 10 21:32:17 ubuntu-phablet NetworkManager[3465]: <warn> Activation (wlan0) failed for connection 'hotspot'
Jul 10 21:32:17 ubuntu-phablet NetworkManager[3465]: <info> (wlan0): device state change: failed -> disconnected (reason 'none') [120 30

Revision history for this message
Tony Espy (awe) wrote :
Download full text (3.4 KiB)

And a better snippet... every time the nmcli command is run to bring up the adhoc connection, the same kernel stack-trace as show in the description is produced:

Jul 10 21:43:07 ubuntu-phablet wpa_supplicant[1706]: wlan0: Trying to associate with SSID 'hotspot'
Jul 10 21:43:07 ubuntu-phablet NetworkManager[3465]: <info> (wlan0): supplicant interface state: disconnected -> associating
Jul 10 21:43:07 ubuntu-phablet kernel: [ 943.291683] wlan: [1356:E :PE ] limMlmAddBss: 1672: TRYING TO HIDE SSID 0
Jul 10 21:43:07 ubuntu-phablet kernel: [ 943.291866] wlan: [1356:E :PE ] mlm_add_sta: 1573: GF: 0, ChnlWidth: 0, MimoPS: 0, lsigTXOP: 0, dsssCCK: 0, SGI20: 0, SGI400
Jul 10 21:43:07 ubuntu-phablet kernel: [ 943.306515] wlan: [1356:F :PE ] limProcessIbssMlmAddBssRsp: 2524: could not activate Heartbeat timer
Jul 10 21:43:07 ubuntu-phablet kernel: [ 943.306699] VOS ASSERT in logDebug Line 219
Jul 10 21:43:07 ubuntu-phablet kernel: [ 943.306790] ------------[ cut here ]------------
Jul 10 21:43:07 ubuntu-phablet kernel: [ 943.306821] WARNING: at /build/buildd/linux-mako-3.4.0/drivers/staging/prima/CORE/SYS/legacy/src/utils/src/logApi.c:219 logDebug+0xc0/0xf4()
Jul 10 21:43:07 ubuntu-phablet kernel: [ 943.306821] Modules linked in:
Jul 10 21:43:07 ubuntu-phablet kernel: [ 943.306851] [<c0014f88>] (unwind_backtrace+0x0/0xe8) from [<c08c5b04>] (dump_stack+0x20/0x24)
Jul 10 21:43:07 ubuntu-phablet kernel: [ 943.306851] [<c08c5b04>] (dump_stack+0x20/0x24) from [<c00754a4>] (warn_slowpath_common+0x5c/0x74)
Jul 10 21:43:07 ubuntu-phablet kernel: [ 943.306882] [<c00754a4>] (warn_slowpath_common+0x5c/0x74) from [<c0075578>] (warn_slowpath_null+0x2c/0x34)
Jul 10 21:43:07 ubuntu-phablet kernel: [ 943.306912] [<c0075578>] (warn_slowpath_null+0x2c/0x34) from [<c06a5c34>] (logDebug+0xc0/0xf4)
Jul 10 21:43:07 ubuntu-phablet kernel: [ 943.306912] [<c06a5c34>] (logDebug+0xc0/0xf4) from [<c05eb82c>] (limLog+0x48/0x50)
Jul 10 21:43:07 ubuntu-phablet kernel: [ 943.306943] [<c05eb82c>] (limLog+0x48/0x50) from [<c0608e48>] (limProcessMlmAddBssRsp+0x168/0xd40)
Jul 10 21:43:07 ubuntu-phablet kernel: [ 943.306973] [<c0608e48>] (limProcessMlmAddBssRsp+0x168/0xd40) from [<c0600170>] (limProcessMessages+0xe74/0x10ac)
Jul 10 21:43:07 ubuntu-phablet kernel: [ 943.306973] [<c0600170>] (limProcessMessages+0xe74/0x10ac) from [<c06006c0>] (limMessageProcessor+0x274/0x2bc)
Jul 10 21:43:07 ubuntu-phablet kernel: [ 943.307004] [<c06006c0>] (limMessageProcessor+0x274/0x2bc) from [<c05e6308>] (peProcessMessages+0x54/0x5c)
Jul 10 21:43:07 ubuntu-phablet kernel: [ 943.307004] [<c05e6308>] (peProcessMessages+0x54/0x5c) from [<c06c56a0>] (VosMCThread+0x44c/0x68c)
Jul 10 21:43:07 ubuntu-phablet kernel: [ 943.307034] [<c06c56a0>] (VosMCThread+0x44c/0x68c) from [<c0095400>] (kthread+0x9c/0xa8)
Jul 10 21:43:07 ubuntu-phablet kernel: [ 943.307065] [<c0095400>] (kthread+0x9c/0xa8) from [<c000edb4>] (kernel_thread_exit+0x0/0x8)
Jul 10 21:43:07 ubuntu-phablet kernel: [ 943.307065] ---[ end trace 344cbbc63d880e12 ]---
Jul 10 21:43:15 ubuntu-phablet kernel: [ 951.645475] healthd: battery l=100 v=4317 t=30.9 h=2 st=5 c=-1 chg=u
Jul 10 21:43:25 ubuntu-phablet kernel: [ 961.645475] hea...

Read more...

Revision history for this message
Tony Espy (awe) wrote :

One other comment, it may well be that since mako's Wi-Fi driver ( qcom prima? ) is built with P2P support enabled, that adhoc support isn't really supported...

Revision history for this message
Tony Espy (awe) wrote :

Also, it should be noted that NM 0.9.9.8 has support for AP-mode hotspots. We should investigate how much work it would be to leverage this as opposed to using the "adhoc" method.

Revision history for this message
Tony Espy (awe) wrote :
Revision history for this message
Alfonso Sanchez-Beato (alfonsosanchezbeato) wrote :

Same error for OEM phones:

<<
phablet@ubuntu-phablet:~$ nmcli c up uuid aab22b5d-7342-48dc-8920-1b7da31d6829

Error: Timeout 90 sec expired.
>>

I attach the syslog. NM fails with the same reason:

Jul 11 09:29:59 ubuntu-phablet NetworkManager[1456]: <warn> Activation (wlan0/wireless): Ad-Hoc network creation took too long, failing activation.

Revision history for this message
Tony Espy (awe) wrote :

By the way, here's the mako WiFi driver version info logged in the kernel:

wlan: WCNSS WLAN version 1.4.1.2
wlan: WCNSS software version 201038
wlan: WCNSS hardware version WCN v2.0 RadioPhy vIris_TSMC_2.0 with 48MHz XO

Revision history for this message
Tony Espy (awe) wrote :

NM apparently has grown support for "ap" mode style hotspots. It should be possible to write the NM connection file with mode="ap" instead of mode="adhoc".

So, I took Antti's connection file and modified it to use mode="ap" instead of "adhoc". I don't get the same stack trace when trying to activate such a connection on mako, however it doesn't seem to work all that well. I initially saw the AP in the network list of my laptop ( trusty ), and an Android phone, however when I tried to connect via Android, it appeared the defined psk in Antti's connection file is too short for WPA-PSK ( the PSK needs to be 8 chars minimum ) so the Android connect button was never active.

Once I corrected this by adding a few trailing characters, I tried to connect with both OS X ( Invalid Password error ), and Android ( tries to connect, fails, no error displayed ).

Revision history for this message
Seth Forshee (sforshee) wrote :

As far as the errors from the driver goes, the first one I see is "could not activate Heartbeat timer" (not sure yet what the heartbeat timer does, perhaps expiring peer STAs in the IBSS network when beacons aren't seen for some period). This is printed using some internal logging functions and has the log level LOGP, and any message of this log level will trigger the stack trace.

There's a few ways for enabling the heartbeat timer to fail. The first is that some ACTIVEMODE_OFFLOAD feature is enabled, the second is that the timer hasn't been initialized, and the third is that the actual timer activation fails for any of a variety of reasons. There's no clues in the log about why it failed.

However it's also not apparent whether or not failing to activate the heartbeat timer is fatal. The driver just logs the error and continues on. Without digging deeper into the driver I can't tell whether it's the cause for IBSS not working; it could just be a symptom of a larger hardware misconfiguration or even unrelated to the other observed issues.

Tony Espy (awe)
Changed in linux-mako (Ubuntu):
status: New → Confirmed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.