Problems with TL-WN321G wifi dongle

Johan Ribenfors
I'm having trouble getting my TL-WN321G wifi usb dongle to work.

I'm using the BSP from Pengutronix and the 3.1.1 kernel

OSELAS(R)-Mini2440-2011.11.0 / mini2440-2011.11.0
ptxdist-2011.11.0/2011-12-20T12:16:19+0000

uname -a
Linux mini2440 3.1.1-ptx-2011.11.0 #19 PREEMPT Mon Feb 6 10:52:58 GMT 2012
armv4tl GNU/Linux

By researching and enabling various options in the ptxdist kernelconfig
menu I've got as far as the board recognising the dongle when it's plugged
in.

I've also installed 'USB WiFi kits 2010-07-28' by extracting the /lib and
/usr directories into my mini2440's root.

scan-wifi results in:
modprobe: module rt73usb not found in modules.dep
modprobe: module ath9k_htc not found in modules.dep
modprobe: module rt73usb not found in modules.dep
modprobe: module ath9k_htc not found in modules.dep
ifconfig: SIOCGIFFLAGS: No such device
0 Access Point Found

Which step have I missed?  What other information should I provide?

Johan Ribenfors
When the dongle is plugged in, I get:

usb 1-1: new full speed USB device using s3c2410-ohci and address 2
usb 1-1: New USB device found, idVendor=148f, idProduct=2070
usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
usb 1-1: Product: 802.11 g WLAN
usb 1-1: Manufacturer: Ralink
usb 1-1: SerialNumber: 1.0
usb 1-1: configuration #1 chosen from 1 choice

Juergen Beisert
You have extracted an archive made for a different kernel. It cannot work
in this way. With the content of this 'USB WiFi kits 2010-07-28' archive
you are depending on the FA 2.6.32.2 kernel and its root filesystem. You
can achieve the same result if you enable 'wpa_supplicant' in your PTXdist
project and enable the correct drivers in the kernel.

Juergen Beisert
In the kernel config ensure to enable "CONFIG_RT73USB=y" for the 'rt73usb'
module and "CONFIG_ATH9K_HTC=y" for the 'ath9k_htc' module.

Johan Ribenfors
Regarding the different kernel versions:
I thought that might be the case, but it did give me the various _wifi
programs.

wpa_supplicant is enabled in the project, and running it on the mini gives
me the following output:

# wpa_supplicant -Dralink -iwlan0 -c/etc/wpa_supplicant.conf -dd

Initializing interface 'wlan0' conf '/etc/wpa_supplicant.conf' driver
'ralink' ctrl_interface 'N/A' bridge 'N/A'
Configuration file '/etc/wpa_supplicant.conf' -> '/etc/wpa_supplicant.conf'
Reading configuration file '/etc/wpa_supplicant.conf'
Line: 1 - start of a new network block
ssid - hexdump_ascii(len=5):
     64 69 63 61 6d                                    dicam
scan_ssid=1 (0x1)
key_mgmt: 0x2
PSK (ASCII passphrase) - hexdump_ascii(len=9): [REMOVED]
PSK (from passphrase) - hexdump(len=32): [REMOVED]
Priority group 0
   id=0 ssid='office'
wpa_driver_ralink_init
wlan0: No such device
Failed to initialize driver interface
Failed to add interface wlan0
Cancelling scan request
Cancelling authentication timeout


Regarding your second comment:

I don't have those options.

I only have:

--- Wireless LAN                                                           
                           <*>   USB ZD1201 based Wireless device support  
                                                    <*>   IEEE 802.11 for
Host AP (Prism2/2.5/3 and WEP/TKIP/CCMP)                                   
  [*]     Support downloading firmware images with Host AP driver          
                          [*]       Support for non-volatile firmware
download

Johan Ribenfors
(The SSID is the same in both lines - cut and paste error.)

Juergen Beisert
You have. But you must enable some other entries first. Some protocols and
so on. Run the search feature of Kconfig for these symbols and you will see
what else has to be enabled to get these entries visible and active.

Johan Ribenfors
Ah, I see them now.  Thanks.

I'll give it a go...

Johan Ribenfors
Right...

Not got as far as I'd have hoped.

Firstly, CONFIG_RT73USB and CONFIG_ATH9K_HTC are both enabled, but I still
get the message:

root:mini2440:~ scan-wifi
modprobe: module rt73usb not found in modules.dep
modprobe: module ath9k_htc not found in modules.dep
modprobe: module rt73usb not found in modules.dep
modprobe: module ath9k_htc not found in modules.dep
ifconfig: SIOCGIFFLAGS: No such device
0 Access Point Found

Secondly, when I exit 'pxtdist kernelconfig' I get a warning : 'warning:
(USB_WUSB) selects UWB which has unmet direct dependencies (EXPERIMENTAL &&
PCI)'

EXPERIMENTAL is enabled, but I don't seem to be able to enable PCI -
following the dependencies back seems to require I select a different
System Type from the currently selected (and correct?) S3C2440.

Thirdly, wpa_supplicant was complaining about not finding the RT2X00
firmware, but has now gone back to saying 'wlan0: No such device'