# [SOLVED] TP-Link TL-WN821N V3 WLAN Stick

## inch

Hello, I'm having difficulties getting my TP-Link TL-WN821N V3 WLAN Stick to work.

uname:

```
Linux gentoo 3.6.11-gentoo #43 SMP
```

lsusb:

```
Bus 002 Device 004: ID 0cf3:7015 Atheros Communications, Inc. TP-Link TL-WN821N v3 802.11n [Atheros AR7010+AAR9287]
```

I compiled the whole "Device Drivers -> Network device support -> Wireless LAN -> Atheros Wirelss Cards" branch into the kernel and added ar9170.fw htc_7010.fw to /lib/firmware to make them available. The good part is that wlan0 exists after this. I included all drivers because I had no luck with just using ath9k_htc.

However, when using wpa_supplicant -B -Dwext -i wlan0 -c /etc/wpa_supplicant.conf I get the following error messages:

```
ioctl[SIOCSIWPMKSA]: Invalid argument

ioctl[SIOCSIWMODE]: Invalid argument

ioctl[SIOCGIWRANGE]: Invalid argument

ioctl[SIOCGIWMODE]: Invalid argument

ioctl[SIOCSIWAP]: Invalid argument

ioctl[SIOCSIWENCODEEXT]: Invalid argument

ioctl[SIOCSIWENCODEEXT]: Invalid argument

ioctl[SIOCSIWENCODEEXT]: Invalid argument

ioctl[SIOCSIWENCODEEXT]: Invalid argument

ioctl[SIOCSIWPMKSA]: Invalid argument
```

These messages indicate using the wrong driver, right? How do I get this working, which one is the right driver?Last edited by inch on Sun Feb 03, 2013 3:27 pm; edited 1 time in total

----------

## DONAHUE

needed firmware looks to me to be htc_9271.fw and/or htc_7010.fw both of which can coexist and are provided if you 

```
emerge linux-firmware
```

I would adjust the menuconfig to *Quote:*   

> [*] Networking support  --->
> 
> -*-   Wireless  --->
> 
> --- Wireless                                                                 
> ...

  and recompile and recopy the kernel and reboot.

----------

## chithanh

You should use -Dnl80211 and not -Dwext

Modern drivers do not support the legacy wireless extensions natively but only through CONFIG_CFG80211_WEXT.

----------

## DONAHUE

-Dnl80211 does work better on the devices that it works on, however I  have a couple of 80211n usb adapters that deny nl80211 compatibility, that are happy with wext..

----------

## inch

Hi guys, the -Dnl80211 and a faulty USB cable were the reason   :Shocked: 

For future reference and users that might have to go through the setup of the TP-Link TL-WN821N V3 WLAN Stick:

1. Get the linux-firmware package

2. Compile the driver and firmware into your kernel:

```
Networking support --->

    Wireless --->

        [*] cfg80211 - wireless configurration API

        [*] Generic IEEE 802.11 Networking Stack (mac80211)

Device Drivers --->

    Generic Driver Options --->

        [*] Include in-kernel firmware blobs in kernel binary

        (htc_7010.fw) External firmware blobs to build into kernel binary

        (/lib/firmware) Firmware blobs root directory

    Network device support --->

        [*] Wireless LAN --->

            [*] Atheros Wireless Cards --->

                [*] Atheros HTC based wirelss cards support
```

3. Set up wpa_supplicant and start it with -Dnl80211

4. ???

5. Profit

Thanks for your help!

----------

