Categories
gentoo problems

How to install and configure TL-WN722N on gentoo

1. First make sure you have these options compiled into kernel

CONFIG_ATH_COMMON=m
CONFIG_ATH9K_HW=m
CONFIG_ATH9K_COMMON=m
CONFIG_ATH9K_HTC=m

If you cannot find them within your config it means that some other dependencies are missing from your kernel.
You can find it more easily with “make xconfig” and selecting option “show all”
2. Most likely you will have to select:

CONFIG_CFG80211
CONFIG_CFG80211_WEXT

Without these two you will receive a lot of fancy errors like:

ioctl[SIOCSIWPMKSA]: Invalid argument

3. If you will see warning related to RFKILL you can fix them by compiling RFKILL into your kernel and emerge rfkill as well.

CONFIG_RFKILL=y
CONFIG_RFKILL_LEDS=y
CONFIG_RFKILL_INPUT=y
CONFIG_ATH9K_RFKILL=y

After that you can check status of your device by:

rfkill list all

and if it’s blocked just unblock it by

rfkill unblock wifi

Ok.. now iwconfig should show some info about your device.
The only thing left is to confiugre /etc/wpa_supplicant/wpa_supplicant.conf file

for most common WPA2 configuration it should contain :

network={
ssid="yourSSID"
proto=WPA2
key_mgmt=WPA-PSK
pairwise=CCMP TKIP
group=CCMP TKIP WEP104 WEP40
priority=2
psk="yourpassword"
}

If you want to avoid having password in plaintext you can use command
wpa_passphrase yourSsid password

and then paste
psk=yourGeneratedHash

(note missing quotes!)

Now is time to check your configuration:

wpa_supplicant -iwlan0 -dd -Dwext -c/etc/wpa_supplicant/wpa_supplicant.conf

If everything works do

ln -s /etc/init.d/net.lo /etc/init.d/net.wlan0

and add it to default runlevel

rc-update add  net.wlan0 boot

In case of problems check:

  1. Is your card visible by lsusb ?
  2. Do you have any errors in dmesg
  3. Did you rebooted after recompiling modles?

I didn’t have to download anything drivers from suspicious pages! So please do not do this!
Everything worked on a modern kernel 3.13.7

Other common samples of wpa_supplicant.conf configurations related to different router’s security settings can be found here:
http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?style=printable&part=4&chap=4#doc_chap2