Bug 96471 - Intel 7265 can't connect to AP of the phone and link is unstable
Summary: Intel 7265 can't connect to AP of the phone and link is unstable
Status: CLOSED CODE_FIX
Alias: None
Product: Drivers
Classification: Unclassified
Component: network-wireless (show other bugs)
Hardware: All Linux
: P1 normal
Assignee: drivers_network-wireless@kernel-bugs.osdl.org
URL: https://www.dropbox.com/s/uccte1ag1oh...
Keywords:
Depends on:
Blocks:
 
Reported: 2015-04-10 16:23 UTC by onorua
Modified: 2015-05-10 05:39 UTC (History)
2 users (show)

See Also:
Kernel Version: 4.0.0-rc7
Subsystem:
Regression: No
Bisected commit-id:


Attachments
dmesg after fresh reboot with new kernel with enabled traces (28.28 KB, text/plain)
2015-04-10 16:23 UTC, onorua
Details
wpa supplicant log with -dd startup argument (91.84 KB, text/plain)
2015-04-12 03:05 UTC, onorua
Details
X220 dmesg output (31.19 KB, text/plain)
2015-04-13 08:18 UTC, onorua
Details
X220 wpa_supplicant with -dd flags (75.39 KB, text/plain)
2015-04-13 08:19 UTC, onorua
Details
WPA wussplicant log disabled (hopefully) p2p (98.26 KB, text/plain)
2015-04-18 04:49 UTC, onorua
Details
WPA supplicant log without P2P (86.12 KB, text/plain)
2015-04-18 07:16 UTC, onorua
Details
old config with "new" device (299.45 KB, text/plain)
2015-04-22 04:26 UTC, onorua
Details
Connect to BB Classic (15.41 KB, text/plain)
2015-04-22 07:48 UTC, onorua
Details
All needed info with and without P2P (3.70 MB, application/octet-stream)
2015-04-24 08:43 UTC, onorua
Details
Fix association to non P2P manager legacy AP (1.54 KB, application/octet-stream)
2015-04-26 10:12 UTC, Ilan Peer
Details
With patch analysis (1.73 MB, application/x-gtar-compressed)
2015-05-02 06:33 UTC, onorua
Details

Description onorua 2015-04-10 16:23:43 UTC
Created attachment 173731 [details]
dmesg after fresh reboot with new kernel with enabled traces

I have just received Lenovo ThinkPad X1 3 gen with network card:
04:00.0 Network controller: Intel Corporation Wireless 7265 (rev 59)

Currently I have kernel 4.0.0-rc7 and firmware iwlwifi-7265-12, I can't connect to any of access points provided by smartphones and I have periodic link drops on Ubnt Unify APs and TP-Link, maybe on others too, but I have these available only. 
What bothers me a lot is that I can't use my mobile phone (Blackberry q10 and Blackberry Classic) as access point for my new laptop. 
I've made trace, in accordance to wiki: 
trace-cmd record -e iwlwifi -e mac80211 -e cfg80211 -e iwlwifi_msg
Link has been posted to "URL" field of the bug. 

Please let me know if you need anything else or how can I debug more.
Comment 1 Emmanuel Grumbach 2015-04-11 20:26:30 UTC
can you please run the supplicant with -dd and provide its log?

Clearly, the supplicant is disassociating, but I can't know why...

thanks.
Comment 2 onorua 2015-04-12 03:05:51 UTC
Created attachment 173781 [details]
wpa supplicant log with -dd startup argument

Here is the requested wpa_supplicant output. Access point name of my phone is BlackBerry AP.
Comment 3 Emmanuel Grumbach 2015-04-13 07:39:44 UTC
Hi,

thanks for that.
So your AP seems not to accept Intel device. Is it configured as 11n only?
Your AP is buggy in a way that forces us (Intel device) to disable WMM which in turn will disable 11n.

You seem not to have problems with Molochko, right?
The logs seem fine when you associate to Molochko
Comment 4 onorua 2015-04-13 07:54:27 UTC
Indeed I don't have any problem with Molochko (TP-Link with 11n standard), and I do have problems with my mobile devices. The problem is that my X220 with WiFi card:
03:00.0 Network controller: Intel Corporation Centrino Advanced-N 6205
has connection to both of my phones without any problem. 
It might be possible that device request you to switch off the 11n mode for power saving reasons, it's mobile phone, and it almost impossible to get more than 56Mb/s over the air.
Any way, do you mean that if access point doesn't support 11n starndard you will not connect at all? Aren't they backword compatible?
Comment 5 Emmanuel Grumbach 2015-04-13 08:10:51 UTC
(In reply to onorua from comment #4)
> Indeed I don't have any problem with Molochko (TP-Link with 11n standard),
> and I do have problems with my mobile devices. The problem is that my X220
> with WiFi card:
> 03:00.0 Network controller: Intel Corporation Centrino Advanced-N 6205
> has connection to both of my phones without any problem. 

That's interesting. Please share the dmesg output of that.

> It might be possible that device request you to switch off the 11n mode for
> power saving reasons, it's mobile phone, and it almost impossible to get
> more than 56Mb/s over the air.

No - the AP is just buggy.

> Any way, do you mean that if access point doesn't support 11n starndard you
> will not connect at all? Aren't they backword compatible?

We should be able to connect, but there are APs that have a setting to disallow association to stations that don't support certain features. So in order to cope with the buggy AP, we switch off many features. Note that 7265 can't associate because the AP refuses the association.
Comment 6 onorua 2015-04-13 08:18:18 UTC
Created attachment 173831 [details]
X220 dmesg output

Here is the dmesg output for x220
Comment 7 onorua 2015-04-13 08:19:33 UTC
Created attachment 173841 [details]
X220 wpa_supplicant with -dd flags

Just to prove that my X220 has connection to AP from my BlackBerry phone.
Comment 8 Emmanuel Grumbach 2015-04-16 07:44:28 UTC
I can't parse the frames from the log :(

Can you add a monitor interface and capture the association?

thanks.
Comment 9 onorua 2015-04-16 07:57:12 UTC
Sorry, I'm afraid I did not understand you. 
I can redo association if you need it, could you please let me know what monitor interface are you talking about?
Comment 10 Emmanuel Grumbach 2015-04-16 08:49:00 UTC
forget it.

My colleague helped me and I could parse your frames :)

can you please disable P2P in the supplicant? Either in the configuration file, or in the compilation.

Thanks.
Comment 11 onorua 2015-04-18 04:49:28 UTC
Created attachment 174341 [details]
WPA wussplicant log disabled (hopefully) p2p

So, I've searched how to disable p2p, found some misleading information, mostly on how to enable it :) Finally I came up with following wpa.conf:
---------------------
p2p_listen_channel=0
p2p_oper_channel=0
p2p_go_intent=0
p2p_no_group_iface=0

I've executed:
sudo /sbin/wpa_supplicant -dd -f wpa_supplicant_withoutp2p.log -u -c wpa.conf -O /run/wpa_supplicant
and tried to connect to my BlackBerry AP, without success. 
If I've disabled p2p incorrectly, let me know how to do it properly or if you don't know as well I'll recompile the kernel, I just have important work to do and don't want to reboot now, but if it's needed - I'll do.
Comment 12 onorua 2015-04-18 07:16:48 UTC
Created attachment 174351 [details]
WPA supplicant log without P2P

Please ignore my previous comment, as obviously I haven't disabled P2P. 

I had a time to compile wpa_supplicant version 2.4 with following config:
=======
CONFIG_BACKEND=file
CONFIG_CTRL_IFACE=y
CONFIG_DEBUG_FILE=y
CONFIG_DEBUG_SYSLOG=y
CONFIG_DEBUG_SYSLOG_FACILITY=LOG_DAEMON
CONFIG_DRIVER_NL80211=y
CONFIG_DRIVER_WEXT=y
CONFIG_DRIVER_WIRED=y
CONFIG_EAP_GTC=y
CONFIG_EAP_LEAP=y
CONFIG_EAP_MD5=y
CONFIG_EAP_MSCHAPV2=y
CONFIG_EAP_OTP=y
CONFIG_EAP_PEAP=y
CONFIG_EAP_TLS=y
CONFIG_EAP_TTLS=y
CONFIG_IEEE8021X_EAPOL=y
CONFIG_IPV6=y
CONFIG_LIBNL32=y
CONFIG_PEERKEY=y
CONFIG_PKCS12=y
CONFIG_WPS=y
CFLAGS += -I/usr/include/libnl3
CONFIG_CTRL_IFACE_DBUS=y
CONFIG_CTRL_IFACE_DBUS_NEW=y
CONFIG_CTRL_IFACE_DBUS_INTRO=y
========
and it's working now. wpa_supplicant log in debug mode is in attachment.
Comment 13 Ilan Peer 2015-04-19 13:50:32 UTC
I think that you have disabled too much :)

Can you please go back to the original configuration file that u used, and only disable CONFIG_HT_OVERRIDES and CONFIG_VHT_OVERRIDES?

FWIW, in order to disable p2p, you only need to remove CONFIG_P2P, or set p2p_disabled=1 in the wlan0 configuration file.

Also if possible please run trace-cmd as follows:

sudo trace-cmd record -e cfg80211 -e mac80211 -e iwlwifi -e iwlwifi_data -e iwlwifi_msg
Comment 14 onorua 2015-04-19 16:30:21 UTC
I've taken apt-source wpasupplicant config, and compiled it with version 2.4 (my debian version is 2.3). Here is the config:
==================
CONFIG_DRIVER_WEXT=y
CONFIG_DRIVER_NL80211=y
CONFIG_LIBNL32=y
CONFIG_DRIVER_WIRED=y
CONFIG_DRIVER_NONE=y
CONFIG_IEEE8021X_EAPOL=y
CONFIG_EAP_MD5=y
CONFIG_EAP_MSCHAPV2=y
CONFIG_EAP_TLS=y
CONFIG_EAP_PEAP=y
CONFIG_EAP_TTLS=y
CONFIG_EAP_FAST=y
CONFIG_EAP_GTC=y
CONFIG_EAP_OTP=y
CONFIG_EAP_SIM=y
CONFIG_EAP_PSK=y
CONFIG_EAP_PWD=y
CONFIG_EAP_PAX=y
CONFIG_EAP_LEAP=y
CONFIG_EAP_AKA=y
CONFIG_EAP_AKA_PRIME=y
CONFIG_EAP_SAKE=y
CONFIG_EAP_GPSK=y
CONFIG_EAP_GPSK_SHA256=y
CONFIG_EAP_TNC=y
CONFIG_WPS=y
CONFIG_WPS_ER=y
CONFIG_WPS_REG_DISABLE_OPEN=y
CONFIG_WPS_NFC=y
CONFIG_EAP_IKEV2=y
CONFIG_EAP_EKE=y
CONFIG_PKCS12=y
CONFIG_SMARTCARD=y
CONFIG_PCSC=y
CONFIG_HT_OVERRIDES=n
CONFIG_VHT_OVERRIDES=n
CONFIG_CTRL_IFACE=y
CONFIG_READLINE=y
CONFIG_BACKEND=file
CONFIG_MAIN=main
CONFIG_OS=unix
CONFIG_ELOOP=eloop
CONFIG_L2_PACKET=linux
CONFIG_PEERKEY=y
CONFIG_IEEE80211W=y
CONFIG_TLS=openssl
CONFIG_TLSV11=y
CONFIG_TLSV12=y
CONFIG_CTRL_IFACE_DBUS=y
CONFIG_CTRL_IFACE_DBUS_NEW=y
CONFIG_CTRL_IFACE_DBUS_INTRO=y
CONFIG_IEEE80211R=y
CONFIG_DEBUG_FILE=y
CONFIG_DEBUG_SYSLOG=y
CONFIG_DEBUG_SYSLOG_FACILITY=LOG_DAEMON
CONFIG_DEBUG_LINUX_TRACING=y
CONFIG_DELAYED_MIC_ERROR_REPORT=y
CONFIG_IEEE80211N=y
CONFIG_IEEE80211AC=y
CONFIG_WNM=y
CONFIG_AP=y
CONFIG_P2P=y
CONFIG_TDLS=y
CONFIG_WIFI_DISPLAY=y
CONFIG_AUTOSCAN_EXPONENTIAL=y
CONFIG_AUTOSCAN_PERIODIC=y
CONFIG_BGSCAN_SIMPLE=y
CONFIG_IBSS_RSN=y
==================
I was able to connect to my phone, please download the trace-cmd from following link (it's 8MB attachment doesn't accept it). 
https://www.dropbox.com/s/uccte1ag1ohl8hh/trace.dat?dl=0

Then I was curious and enabled all the options you asked me to disable, and I can connect again:
https://www.dropbox.com/s/gxindon4szbrfqk/trace_with_all_enabled.dat?dl=0

Then I did recompilation of "debian" source package wpa version 2.3 and with default config I could connect as well.. 

I run out of ideas... maybe you can see something strange?
Comment 15 Ilan Peer 2015-04-20 11:09:32 UTC
Looking at this now. Can you go back to the original failed configuration and re-test. If it fails, send me the trace.dat + wpa_supplicant log + wpa_supplicant build configuration file. 10x :)
Comment 16 Ilan Peer 2015-04-20 14:22:58 UTC
In the first trace all seems ok. As far as I understand you device disconnected from one AP (84:db:ac:a8:e7:4a) on channel 9 and switched to another one (94:eb:cd:bf:62:d9) on channel 11.

This is also the case in the 2nd trace file. I also examined the traffic captured in the 2nd trace and everything looks ok, other than the fact the the association request going out from the device does not include HT although the AP DOES indicate support for it in the beacons. This is a bit strange ...
Comment 17 Ilan Peer 2015-04-21 18:32:28 UTC
Johannes and Emmanuel pointed that the AP is publishing bad WMM parameters, and thus mac80211 disable WMM, which implies that HT is disabled as well. So this clarifies that non HT association.
Comment 18 onorua 2015-04-22 04:26:17 UTC
Created attachment 174761 [details]
old config with "new" device

So, it's weird because previously I could not connect to neither of my devices, and now the one which was connected already with that "limited" compilation config is able to connect, but the other one, which was never connected - still can't connect:
https://www.dropbox.com/s/43w734vtzakjk3l/old_config.dat?dl=0

So it's some problem with initial connection setup, after this phase devices can connect with any of the mentioned configs.
Comment 19 Ilan Peer 2015-04-22 06:44:12 UTC
The trace file shows a successful connection to 'Putin Huilo' (with valid HT association). Same is also see in the wpa_supplicant log.

FWIW, the "Blackberry AP" is not see during scan.
Comment 20 onorua 2015-04-22 06:59:11 UTC
Yes, because it's BlackBerry Classic to be connected to, my Q10 has AP name Blackberry AP, but Classic has BlackBerry Classic AP. I've tried to connect but it could not, it just "stuck"
Comment 21 Ilan Peer 2015-04-22 07:14:46 UTC
It does not seem that this ssid was configured for connection. Have a look at the wpa_supplicant log: the AP is found when scanning, but it is not selected for connection attempt as there is no matching network block.
Comment 22 onorua 2015-04-22 07:48:13 UTC
Created attachment 174771 [details]
Connect to BB Classic

I'm really sorry for your time, I've tried to connect, it "stuck" for some reason for minute or so without any reply and I restarted connman. 
Now I got error message and pressed retry several times. 
https://www.dropbox.com/s/di80vreuj5f3cmd/2bbclassic.dat?dl=0

AP point name you look for is: BlackBerryClassic
Comment 23 Ilan Peer 2015-04-22 09:55:36 UTC
no problem .. I'm glad to help.

The log file you attached does not contain much other than scan results. 
From the trace file you attached I was not able to find what was wrong in the association flow. Just to be clear, this is the case where the original configuration is used. right? If so, can you please try again, but this time remove P2P_CONFIG from the wpa_supplicant configuration.

Couple of notes:
1. For some reason no beacons are seen from this AP/P2P GO, only probe responses, which is strange.
2. As before, the P2P GO is publishing bad WMM parameters.
3. When you post again, please also attached dmesg and the config file that you used.

Thanks.
Comment 24 onorua 2015-04-22 10:08:27 UTC
Yes, that was original config. According to wpa source package from debian repository it's:
==================
CONFIG_DRIVER_WEXT=y
CONFIG_DRIVER_NL80211=y
CONFIG_LIBNL32=y
CONFIG_DRIVER_WIRED=y
CONFIG_DRIVER_NONE=y
CONFIG_IEEE8021X_EAPOL=y
CONFIG_EAP_MD5=y
CONFIG_EAP_MSCHAPV2=y
CONFIG_EAP_TLS=y
CONFIG_EAP_PEAP=y
CONFIG_EAP_TTLS=y
CONFIG_EAP_FAST=y
CONFIG_EAP_GTC=y
CONFIG_EAP_OTP=y
CONFIG_EAP_SIM=y
CONFIG_EAP_PSK=y
CONFIG_EAP_PWD=y
CONFIG_EAP_PAX=y
CONFIG_EAP_LEAP=y
CONFIG_EAP_AKA=y
CONFIG_EAP_AKA_PRIME=y
CONFIG_EAP_SAKE=y
CONFIG_EAP_GPSK=y
CONFIG_EAP_GPSK_SHA256=y
CONFIG_EAP_TNC=y
CONFIG_WPS=y
CONFIG_WPS_ER=y
CONFIG_WPS_REG_DISABLE_OPEN=y
CONFIG_WPS_NFC=y
CONFIG_EAP_IKEV2=y
CONFIG_EAP_EKE=y
CONFIG_PKCS12=y
CONFIG_SMARTCARD=y
CONFIG_PCSC=y
CONFIG_HT_OVERRIDES=y
CONFIG_VHT_OVERRIDES=y
CONFIG_CTRL_IFACE=y
CONFIG_READLINE=y
CONFIG_BACKEND=file
CONFIG_MAIN=main
CONFIG_OS=unix
CONFIG_ELOOP=eloop
CONFIG_L2_PACKET=linux
CONFIG_PEERKEY=y
CONFIG_IEEE80211W=y
CONFIG_TLS=openssl
CONFIG_TLSV11=y
CONFIG_TLSV12=y
CONFIG_CTRL_IFACE_DBUS=y
CONFIG_CTRL_IFACE_DBUS_NEW=y
CONFIG_CTRL_IFACE_DBUS_INTRO=y
CONFIG_IEEE80211R=y
CONFIG_DEBUG_FILE=y
CONFIG_DEBUG_SYSLOG=y
CONFIG_DEBUG_SYSLOG_FACILITY=LOG_DAEMON
CONFIG_DEBUG_LINUX_TRACING=y
CONFIG_DELAYED_MIC_ERROR_REPORT=y
CONFIG_IEEE80211N=y
CONFIG_IEEE80211AC=y
CONFIG_WNM=y
CONFIG_AP=y
CONFIG_P2P=y
CONFIG_TDLS=y
CONFIG_WIFI_DISPLAY=y
CONFIG_AUTOSCAN_EXPONENTIAL=y
CONFIG_AUTOSCAN_PERIODIC=y
CONFIG_BGSCAN_SIMPLE=y
CONFIG_IBSS_RSN=y
====

Is there any wpa_supplicant debug option I can use to show you more valuable info?
Comment 25 Ilan Peer 2015-04-22 10:21:25 UTC
Can't say I understand why they chose to enable all these options, as some are clearly meant for testing.
Can you retest with CONFIG_P2P=N (or just remove the line)?

When running the wpa_supplicant please add the following options: -ddT (this way I could also get the wpa_supplicant logs in the trace file), and send the files I requested previously.
Comment 26 onorua 2015-04-24 08:43:10 UTC
Created attachment 174971 [details]
All needed info with and without P2P

I've executed tests with P2P enabled and without it, and created archive with 2 sets of data:
trace, wpa_supplicant.log and dmesg for you. 
In short, I do have connection without P2P.
Comment 27 Ilan Peer 2015-04-26 10:11:56 UTC
Sorry for not replying earlier .. we were on a long holiday weekend :) 

It is still difficult to understand why the AP in rejecting the association request, but this might due with the fact the the association request includes and P2P IE which incomplete. I'm attaching a patch to hostap (on top of the latest tip on the community hostap, but should also cleanly apply on 2.3 or 2.4). Can you please give it a try (with P2P enabled)?

If this till does not work, can you try getting some logs from the blackberry phone?
Comment 28 Ilan Peer 2015-04-26 10:12:43 UTC
Created attachment 175111 [details]
Fix association to non P2P manager legacy AP
Comment 29 onorua 2015-05-02 06:33:09 UTC
Created attachment 175541 [details]
With patch analysis

Sorry for the delayed reply, had really busy week and I needed to have my mobile hotspot working :) 

So, I've compiled 2.3 version after applied your patch, and I was able to connect to my mobile phone AP. Here is the data I could gather for you for analysis.
Comment 30 Emmanuel Grumbach 2015-05-02 17:23:03 UTC
Good - I am closing the bug.

Thanks.
Comment 31 Ilan Peer 2015-05-03 05:33:05 UTC
Great. Thanks for all your support and help with this bug.

BTW, the patch was also sent to the hostap mainling list: http://patchwork.ozlabs.org/patch/465485/
Comment 32 onorua 2015-05-03 06:12:36 UTC
Thank you for the help, I don't know what would I do without your help and my mobile hotspot ;)
Comment 33 Ilan Peer 2015-05-10 05:39:22 UTC
FWIW, after the patch was reviewed by hostap maintainer .. the final version for this fix is merged to hostap repository. See http://w1.fi/gitweb/gitweb.cgi?p=hostap.git;a=commit;h=9b05135aa477f2c64d08bdb99062907cf767c1ea

Note You need to log in before you can comment on or make changes to this bug.