TP-LINK WiFi adapter failed after kernel upgrade

Issues Related to Hardware (Sound, Video, Printers, Scanners, Webcams, Touchpads, Keyboards, Sensors, Drives, GRUB, etc.)

Moderator: Moderators

Re: TP-LINK wireless adapter failed after kernel upgrade

Postby Fitzcarraldo » Wed May 08, 2013 6:32

Actually your problem is making me curious. If you look at one of the Atheros pages at the Linux Wireless Website, the ath9k_htc module (which I don't have loaded but you do) is for USB wireless adapters. The ath9k_hw module (which we both have loaded) is for 802.11n PCIe and USB adapters according to the Linux Wireless Website. What I'm not sure is if you need both loaded, either of them loaded, or only one specifically loaded. What does your lsmod output look like when you have the 3.7 kernel loaded and the TP-LINK adapter is working? Any difference from the situation with the 3.9 kernel?

If you look at the Atheros Devices for ath9k_htc, you will see "Atheros chipset:AR7010+AR9287 USB vendor:0x0cf3 USB product:0x7015" is listed. I see from the lsusb output you posted that is precisely what you have. So it appears you do need the ath9k_htc module.

The Linux Wireless Website confirms that firmware is needed for the ath_htc module:

http://wireless.kernel.org/en/users/Dri ... c#Firmware

Firmware

This driver requires firmware. The firmware can be obtained from firmware tree.

Alternately you can download it from here: http://wireless.kernel.org/download/htc_fw/.

Older firmware map:

AR9271 - ar9271.fw
AR7010 - ar7010.fw or ar7010_1_1.fw

Newer firmware map:

AR9271 - htc_9271.fw
AR7010 - htc_7010.fw

The firmware has to be placed in the correct location, usually /lib/firmware. This could vary among distributions, so check your distro's policies if loading of the firmware fails.

Looking at the firmware files installed by the package sys-kernel/linux-firmware-20130421, I can see the above-mentioned firmware files are included:

Code: Select all
# cat /etc/portage/savedconfig/sys-kernel/linux-firmware-20130421 | grep ar9
ar9170-1.fw
ar9170-2.fw
ar9271.fw
# cat /etc/portage/savedconfig/sys-kernel/linux-firmware-20130421 | grep ar7
ar7010_1_1.fw
ar7010.fw
# cat /etc/portage/savedconfig/sys-kernel/linux-firmware-20130421 | grep htc_
htc_7010.fw
htc_9271.fw
#

So, if you do indeed need the module ath9k_htc to be loaded, then you also need to have the latest version of linux-firmware installed.

If you find from the output of the lsmod command with the 3.7 kernel that you only have ath9k_htc loaded then you could blacklist the ath9k_hw module and reboot to the 3.9 kernel to check what happens. Conversely, if you find from the output of the lsmod command for the 3.7 kernel that you only have the ath9k_hw module loaded then you could blacklist the ath9k_htc module and reboot to the 3.9 kernel to check what happens.

Another thing I notice from the /var/log/messages and dmesg output you posted earlier is the the Belkin adapter appears to be using the World regulatory domain (00) whereas the TP-LINK adapter is using the CN (China) regulatory domain. If you don't know what that means, read my blog post Setting the wireless regulatory domain in Linux on your laptop. Are you actually in China? If you are not, you could try changing the regulatory domain (see my aforementioned blog post):

Code: Select all
# iw reg set <ISO_3166-1_alpha-2>

where <ISO_3166-1_alpha-2> is the country code for the country you are actually in. You'll need to install net-wireless/iw if you don't already have it installed:

Code: Select all
equo install net-wireless/iw
User avatar
Fitzcarraldo
Sagely Hen
 
Posts: 7977
Joined: Sat Mar 10, 2007 5:40
Location: United Kingdom

Re: TP-LINK wireless adapter failed after kernel upgrade

Postby nickdanger » Wed May 08, 2013 19:26

I too noticed the problem with the wireless domain, but did not know what to do about it. Thank you for explaining it so well. I am not in China so I changed the code using the instructions in your blog. I did not have net-wireless/iw installed, so somehow I missed that, but have it now.
I have the firmware installed.
Code: Select all
>>         Available:     version: 20130421 ~ tag: NoTag ~ revision: 0
>>         Installed:     version: 20130421 ~ tag: NoTag ~ revision: 0

these are listed in directory /lib/firmware.
Code: Select all
htc_7010.fw                  rt73.bin
htc_9271.fw                  RTL8192E

Kernel 3.9-r3 loads these modules.
Code: Select all
ath9k_htc              45154  0
ath9k_common            1825  1 ath9k_htc
ath9k_hw              332394  2 ath9k_common,ath9k_htc
ath                    13348  3 ath9k_common,ath9k_htc,ath9k_hw
mac80211              235239  1 ath9k_htc
cfg80211              154987  3 ath,mac80211,ath9k_htc

Kernel 3.7.0 loads these modules.
Code: Select all
ath9k_htc              44307  0
ath9k_common            1810  1 ath9k_htc
ath9k_hw              313593  2 ath9k_common,ath9k_htc
ath                    13253  3 ath9k_common,ath9k_htc,ath9k_hw
mac80211              207479  1 ath9k_htc
cfg80211              141008  3 ath,mac80211,ath9k_htc

The setting for the wireless domain reverts to CN after every reboot. Is there a way to maintain the setting for "US"?
nickdanger
Simple Hen
 
Posts: 89
Joined: Mon Aug 10, 2009 4:02

Re: TP-LINK wireless adapter failed after kernel upgrade

Postby Fitzcarraldo » Wed May 08, 2013 22:09

Oh well, at least it looks like the correct modules are loaded in the case of the 3.9-r3 kernel.

To force the wireless regulatory domain to US at each boot, create a file /etc/local.d/01regulatory.start containing the following lines:

Code: Select all
#!/bin/bash
# Force the wireless regulatory domain to be US:
iw reg set US

and make it executable:

Code: Select all
# chmod +x /etc/local.d/01regulatory.start

Then after the PC has booted you can use the following command as root user in a Konsole/Terminal window to check it has been set:

Code: Select all
iw reg get
User avatar
Fitzcarraldo
Sagely Hen
 
Posts: 7977
Joined: Sat Mar 10, 2007 5:40
Location: United Kingdom

Re: TP-LINK wireless adapter failed after kernel upgrade

Postby nickdanger » Thu May 09, 2013 3:30

The fix for the regulatory domain you posted works well. According to dmesg, the adapter came up as CN and then CRDA was called and it was switched to the US.
I have found that the TP-Link adapter "associates" with the wireless router, and I can read the signal strength from it. The problem seems to occur when the adapter authenticates.

I am now thinking the problem is in the D-bus security policy because when I try to use the Gnome mn-applet (network-manager) it says, "You are not allowed to access the system configuration" in the GUI.
In the terminal window the error is:
Code: Select all
** (nm-applet:19971): WARNING **: Failed to initialize D-Bus: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.

If I try to complete the connection with wicd instead of networkmanager the error is:
Code: Select all
setting encryption info...
ERROR:dbus.connection:Exception in handler for D-Bus signal:
Traceback (most recent call last):
  File "/usr/lib64/python2.7/site-packages/dbus/connection.py", line 230, in maybe_handle_message
    self._handler(*args, **kwargs)
  File "/usr/share/wicd/gtk/gui.py", line 253, in handle_connection_results
    error(self.window, language[results], block=False)
KeyError: dbus.String(u'bad_pass')

It looks like it is trying to say "bad password" but I certain I entered the WPA2 encryption phrase correctly. In investigating this problem I have entered it many times.
nickdanger
Simple Hen
 
Posts: 89
Joined: Mon Aug 10, 2009 4:02

Re: TP-LINK wireless adapter failed after kernel upgrade

Postby Fitzcarraldo » Thu May 09, 2013 13:02

Those error messages look quite useful. I wonder if you have the same problem as user inch in Gentoo Forums post [SOLVED] TP-Link TL-WN821N V3 WLAN Stick? He appears to have the same USB WiFi adapter as you. He had to use wpa_supplicant and start wpa_supplicant with the "-Dnl80211" parameter. I don't know how or if you can do that with NetworkManager or Wicd.
User avatar
Fitzcarraldo
Sagely Hen
 
Posts: 7977
Joined: Sat Mar 10, 2007 5:40
Location: United Kingdom

Re: TP-LINK wireless adapter failed after kernel upgrade

Postby TDKyon » Thu May 09, 2013 13:56

I got many tp-link devices - 4 wireless antennas, 1 router and 1 network extender oh and my latest purchase is 5 port(s) switch. Everything is working, one of my antennas (721n) is using the same firmware 9271. All tp link devices are working on 100% and was detected automatically in Sabayon, even the ralink 2870. The last time when I had to install that firmware was back in the beginning of 2011, since ubuntu 12.04 came out the hardware support for all brands of wireless devices has been dramatically improved until this day today.

There you go: https://docs.google.com/file/d/0BzLYQvo ... sp=sharing
a link with compat drivers and the ar9271 firmware from 2011.
TDKyon
Young Hen
 
Posts: 25
Joined: Mon Apr 29, 2013 9:52

Re: TP-LINK wireless adapter failed after kernel upgrade

Postby nickdanger » Thu May 09, 2013 18:10

The drivers are certainly working. No problem until I upgraded to kernel 3.9r-3. I was trying to find where my upgrade was broken, because perhaps others had the same problem. No others have reported this problem, so I think we will try a fresh install and see what happens. Fitzcarraldo has already taught me more than all of my instructors (thank you!), so that is all good.
nickdanger
Simple Hen
 
Posts: 89
Joined: Mon Aug 10, 2009 4:02

Re: TP-LINK wireless adapter failed after kernel upgrade

Postby Fitzcarraldo » Thu May 09, 2013 21:30

You can check what NetworkManager is using for the SSID, key management method and the PSK by looking in the file /etc/wpa_supplicant/wpa_supplicant.conf, which is created by NetworkManager. Do the contents look correct?
User avatar
Fitzcarraldo
Sagely Hen
 
Posts: 7977
Joined: Sat Mar 10, 2007 5:40
Location: United Kingdom

Re: TP-LINK wireless adapter failed after kernel upgrade

Postby nickdanger » Fri May 10, 2013 2:46

I looked at file /etc/wpa_supplicant/wpa_supplicant.conf while using the Belkin adapter, and then also after rebooting with the TP-Link adapter. Always the same, and the information is correct. Just to check I entered a different encryption key, and the file updated to the new key. The key is in plain text, I guess Linux does not keep every secret.
nickdanger
Simple Hen
 
Posts: 89
Joined: Mon Aug 10, 2009 4:02

Re: TP-LINK wireless adapter failed after kernel upgrade

Postby Fitzcarraldo » Fri May 10, 2013 11:36

Yes, there is a bug report out about that lack of security in wpa_supplicant.conf, although it is not quite as bad as it first seems, as the file is owned by the root user.

I wish I could find out how to make NetworkManager tell wpa_supplicant to use -Dnl80211 instead of -Dwext, so that you could at least check if the solution found by Gentoo user inch also works for you. You could try a little experiment: Stop NetworkManager and run wpa_supplicant to see what happens:

Code: Select all
# /etc/init.d/NetworkManager stop
# wpa_supplicant -B -Dnl80211 -i wlan0 -c /etc/wpa_supplicant/wpa_supplicant.conf
User avatar
Fitzcarraldo
Sagely Hen
 
Posts: 7977
Joined: Sat Mar 10, 2007 5:40
Location: United Kingdom

PreviousNext

Return to Hardware

Who is online

Users browsing this forum: No registered users and 1 guest