rt2x00 master mode HOWTO

Live forum: http://rt2x00.serialmonkey.com/viewtopic.php?t=4963

oberon

23-08-2008 13:51:31

Hi

I've got a simple home WiFi network a Linux based router that got a rt2x00 based card and a desktop that got the same card and dual boots between Linux and Windows XP. Right now both of them have the legacy driver (when the desktop boots into Linux) and communicate in ad-hoc mode.
I installed kernel 2.6.26 on both of them and interested in using the new driver and while doing so turn the router box into a "real" AP. (Got a Windows based laptop and so does my roommate)

What I need a is a step by step HOWTO document on how to achieve that
1. how to configure the kernel ?
2. how to compile/configure hostapd (what version to use?)
3. what should the boot scripts look like ?

I think centralizing this in one thread and making it sticky will help other ppl as well.
Trying to search through the forum overwhelmed me with old and maybe obsolete threads.

Spy84464

25-08-2008 18:19:30

Hello,
I don't know how well master mode work at the moment, there have been a few patches about the matter posted on the list recently, but haven't seen any success story to point you to, yet. Also, rt2x00's master mode (and ad-hoc) support may be disabled in kernel 2.6.26 because they were not working, that has to be checked.
There should be no kernel configuration required though, if hostap is up and running, then everything should just work, providing there's no driver or mac80211 bug, so I can only suggest you to look at the hostap website.

Regards,
Romain

ganto

04-10-2008 00:53:56

I would like to report the progress of my try to make the rt61pci driver run as access point.

Hardware 0014.0 Network controller RaLink RT2561/RT61 802.11g PCI

[b36qwi7yo]Without encryption[/b36qwi7yo] [ WORKS![/color36qwi7yo] ]
[list36qwi7yo]
[*36qwi7yo]kernel sources >2.6.26 (success with debian 2.6.26-1)
patch 008-allow-ap-vlan-modes.patch from http//johannes.sipsolutions.net/patche ... 26-14%3a52[/*m36qwi7yo]
[*36qwi7yo]firmware Debian firmware-ralink 0.12 (lenny)[/*m36qwi7yo]
[*36qwi7yo]hostapd 0.6.4 (testing)
driver 80211nl[/*m36qwi7yo][/listu36qwi7yo]
Works for me under Debian Lenny.

[b36qwi7yo]With WPA2[/b36qwi7yo] [ FAILS![/color36qwi7yo] ]
[list36qwi7yo]
[*36qwi7yo] kernel sources latest rt2x00-branch from git//git.kernel.org/pub/scm/linux/kern ... rt2x00.git
patch http//sourceforge.net/mailarchive/mess ... nplanet.nl
note load rt61pci module with parameter [i36qwi7yo]nohwcrypt=0[/i36qwi7yo] (if load with default value no connection possible)[/*m36qwi7yo]
[*36qwi7yo]firmware Debian firmware-ralink 0.12 (lenny)[/*m36qwi7yo]
[*36qwi7yo] hostapd latest sources from git//w1.fi/srv/git/hostap.git
driver 80211nl[/*m36qwi7yo][/listu36qwi7yo]
Client (Apple Macbook Air) can authenticate and connect to the network. ARP request received and answered from AP but client doesn't get the answers. Sometimes ARP lookup works but no answer to ICMP echo request from AP.

Modules output
[quote36qwi7yo]Linux saturn 2.6.27-rc6-wl-saturn #1 Fri Oct 3 212534 CEST 2008 i686 GNU/Linux

[ 5.350673] cfg80211 Calling CRDA to update world regulatory domain
...
[ 7.072078] rt61pci 00000014.0 PCI INT A -> Link[LNKB] -> GSI 12 (level, low) -> IRQ 12
[ 7.079767] phy0 -> rt61pci_validate_eeprom EEPROM recovery - NIC 0xff80
[ 7.079788] phy0 -> rt61pci_validate_eeprom EEPROM recovery - RSSI OFFSET BG 0x0000
[ 7.079810] phy0 -> rt61pci_validate_eeprom EEPROM recovery - RSSI OFFSET A 0x0000
[ 7.079836] phy0 -> rt2x00_set_chip Info - Chipset detected - rt 0301, rf 0003, rev 0002561c.
[ 7.194941] phy0 Selected rate control algorithm 'pid'
[ 7.628638] Registered led device rt61pci-phy0radio
[ 7.628823] Registered led device rt61pci-phy0assoc
...
[ 16.937931] phy0 -> rt2x00lib_request_firmware Info - Loading firmware file 'rt2561s.bin'.
[ 16.938094] firmware requesting rt2561s.bin
[ 17.073613] phy0 -> rt2x00lib_request_firmware Info - Firmware detected - version 0.8.
[ 17.117377] phy0 -> rt2x00mac_conf_tx Info - Configured TX queue 0 - CWmin 5, CWmax 10, Aifs 2, TXop 0.
[ 17.117566] phy0 -> rt2x00mac_conf_tx Info - Configured TX queue 1 - CWmin 5, CWmax 10, Aifs 2, TXop 0.
[ 17.117718] phy0 -> rt2x00mac_conf_tx Info - Configured TX queue 2 - CWmin 5, CWmax 10, Aifs 2, TXop 0.
[ 17.117870] phy0 -> rt2x00mac_conf_tx Info - Configured TX queue 3 - CWmin 5, CWmax 10, Aifs 2, TXop 0.[/quote36qwi7yo]

Hostapd output
[quote36qwi7yo]Oct 4 003129 saturn hostapd wlan0 WPA rekeying GTK
Oct 4 003129 saturn hostapd wlan0 STA 0016cbb836dc WPA sending 1/2 msg of Group Key Handshake
Oct 4 003130 saturn hostapd wlan0 STA 0016cbb836dc WPA EAPOL-Key timeout
Oct 4 003130 saturn hostapd wlan0 STA 0016cbb836dc WPA sending 1/2 msg of Group Key Handshake
Oct 4 003131 saturn hostapd wlan0 STA 0016cbb836dc WPA EAPOL-Key timeout
Oct 4 003131 saturn hostapd wlan0 STA 0016cbb836dc WPA sending 1/2 msg of Group Key Handshake
Oct 4 003132 saturn hostapd wlan0 STA 0016cbb836dc WPA EAPOL-Key timeout
Oct 4 003132 saturn hostapd wlan0 STA 0016cbb836dc WPA sending 1/2 msg of Group Key Handshake
Oct 4 003132 saturn hostapd wlan0 STA 0016cbb836dc IEEE 802.1X unauthorizing port
Oct 4 003132 saturn hostapd wlan0 STA 0016cbb836dc IEEE 802.11 deauthenticated due to local deauth request
Oct 4 003132 saturn hostapd wlan0 STA 0016cbb836dc IEEE 802.11 authentication OK (open system)
Oct 4 003132 saturn hostapd wlan0 STA 0016cbb836dc MLME MLME-AUTHENTICATE.indication(0016cbb836dc, OPEN_SYSTEM)
Oct 4 003132 saturn hostapd wlan0 STA 0016cbb836dc MLME MLME-DELETEKEYS.request(0016cbb836dc)
Oct 4 003132 saturn hostapd wlan0 STA 0016cbb836dc IEEE 802.11 authenticated
Oct 4 003132 saturn hostapd wlan0 STA 0016cbb836dc IEEE 802.11 association OK (aid 1)
Oct 4 003132 saturn hostapd wlan0 STA 0016cbb836dc IEEE 802.11 associated (aid 1, accounting session 48E68A81-0000000B)
Oct 4 003132 saturn hostapd wlan0 STA 0016cbb836dc MLME MLME-ASSOCIATE.indication(0016cbb836dc)
Oct 4 003132 saturn hostapd wlan0 STA 0016cbb836dc MLME MLME-DELETEKEYS.request(0016cbb836dc)
Oct 4 003132 saturn hostapd wlan0 STA 0016cbb836dc WPA event 1 notification
Oct 4 003132 saturn hostapd wlan0 STA 0016cbb836dc WPA start authentication
Oct 4 003132 saturn hostapd wlan0 STA 0016cbb836dc IEEE 802.1X unauthorizing port
Oct 4 003132 saturn hostapd wlan0 STA 0016cbb836dc WPA sending 1/4 msg of 4-Way Handshake
Oct 4 003132 saturn hostapd wlan0 STA 0016cbb836dc WPA received EAPOL-Key frame (2/4 Pairwise)
Oct 4 003132 saturn hostapd wlan0 STA 0016cbb836dc WPA sending 3/4 msg of 4-Way Handshake
Oct 4 003132 saturn hostapd wlan0 STA 0016cbb836dc WPA received EAPOL-Key frame (4/4 Pairwise)
Oct 4 003132 saturn hostapd wlan0 STA 0016cbb836dc IEEE 802.1X authorizing port
Oct 4 003132 saturn hostapd wlan0 STA 0016cbb836dc WPA pairwise key handshake completed (RSN)[/quote36qwi7yo]

No errors in logs (

Here some private notes about installation http//ganto.no-ip.org/trac/wiki/LinuxM ... ess/Ralink

Is there anybody else on this topic? Is this issue known? Is there somewhere an official bugzilla or goes development trough (legacy?) mailinglist and forum?

Greetings ganto

oberon

04-10-2008 15:38:36

"hostapd 0.6.4 (testing)" / "hostapd latest sources from git"

Care to share how you built/configured hostapd ?
(including post installation configuration files like hostapd.conf - if there is such a file)

ganto

04-10-2008 16:46:49

.config for building hostapd (I'm not sure if the EAP things are really necessary for such a setup)
[quoteao5fq7s7]# Example hostapd build time configuration
#
# This file lists the configuration options that are used when building the
# hostapd binary. All lines starting with # are ignored. Configuration option
# lines must be commented out complete, if they are not to be included, i.e.,
# just setting VARIABLE=n is not disabling that variable.
#
# This file is included in Makefile, so variables like CFLAGS and LIBS can also
# be modified from here. In most cass, these lines should use += in order not
# to override previous values of the variables.

# Driver interface for Host AP driver
#CONFIG_DRIVER_HOSTAP=y

# Driver interface for wired authenticator
#CONFIG_DRIVER_WIRED=y

# Driver interface for madwifi driver
#CONFIG_DRIVER_MADWIFI=y
#CFLAGS += -I../head # change to reflect local setup; directory for madwifi src

# Driver interface for Prism54 driver
#CONFIG_DRIVER_PRISM54=y

# Driver interface for drivers using the nl80211 kernel interface
CONFIG_DRIVER_NL80211=y

# IEEE 802.11F/IAPP
CONFIG_IAPP=y

# WPA2/IEEE 802.11i RSN pre-authentication
CONFIG_RSN_PREAUTH=y

# PeerKey handshake for Station to Station Link (IEEE 802.11e DLS)
CONFIG_PEERKEY=y

# Integrated EAP server
CONFIG_EAP=y

# EAP-MD5 for the integrated EAP server
CONFIG_EAP_MD5=y

# EAP-TLS for the integrated EAP server
CONFIG_EAP_TLS=y

# EAP-MSCHAPv2 for the integrated EAP server
CONFIG_EAP_MSCHAPV2=y

# EAP-PEAP for the integrated EAP server
CONFIG_EAP_PEAP=y

# EAP-GTC for the integrated EAP server
CONFIG_EAP_GTC=y

# EAP-TTLS for the integrated EAP server
CONFIG_EAP_TTLS=y

# EAP-SIM for the integrated EAP server
CONFIG_EAP_SIM=y

# EAP-AKA for the integrated EAP server
CONFIG_EAP_AKA=y

# EAP-PAX for the integrated EAP server
CONFIG_EAP_PAX=y

# EAP-PSK for the integrated EAP server (this is _not_ needed for WPA-PSK)
CONFIG_EAP_PSK=y

# EAP-SAKE for the integrated EAP server
CONFIG_EAP_SAKE=y

# EAP-GPSK for the integrated EAP server
CONFIG_EAP_GPSK=y
# Include support for optional SHA256 cipher suite in EAP-GPSK
CONFIG_EAP_GPSK_SHA256=y

# EAP-FAST for the integrated EAP server
# Note Default OpenSSL package does not include support for all the
# functionality needed for EAP-FAST. If EAP-FAST is enabled with OpenSSL,
# the OpenSSL library must be patched (openssl-0.9.9-session-ticket.patch)
# to add the needed functions.
#CONFIG_EAP_FAST=y

# EAP-IKEv2
#CONFIG_EAP_IKEV2=y

# Trusted Network Connect (EAP-TNC)
#CONFIG_EAP_TNC=y

# PKCS#12 (PFX) support (used to read private key and certificate file from
# a file that usually has extension .p12 or .pfx)
CONFIG_PKCS12=y

# RADIUS authentication server. This provides access to the integrated EAP
# server from external hosts using RADIUS.
#CONFIG_RADIUS_SERVER=y

# Build IPv6 support for RADIUS operations
#CONFIG_IPV6=y

# IEEE 802.11r/D4.1 (Fast BSS Transition)
# This enables an experimental implementation of a draft version of
# IEEE 802.11r. This draft is still subject to change, so it should be noted
# that this version may not comply with the final standard.
#CONFIG_IEEE80211R=y

# Use the hostapd's IEEE 802.11 authentication (ACL), but without
# the IEEE 802.11 Management capability (e.g., madwifi or FreeBSD/net80211)
#CONFIG_DRIVER_RADIUS_ACL=y[/quoteao5fq7s7]
hostapd.conf (minimal configuration to use WPA2 authentication)
[quoteao5fq7s7]##### hostapd configuration file ##############################################

# device configuration
interface=wlan0
driver=nl80211

# hostapd event logger configuration
logger_syslog=-1
logger_syslog_level=0
logger_stdout=0
logger_stdout_level=4

debug=4
dump_file=/tmp/hostapd.dump

# Interface for separate control program.
ctrl_interface=/var/run/hostapd
ctrl_interface_group=0


# IEEE 802.11 related configuration
ssid=molihua-test
#country_code=US
#ieee80211d=1
hw_mode=g
channel=8
beacon_int=100
max_num_sta=255


# Mac address ACL
macaddr_acl=0
#deny_mac_file=/etc/hostapd/hostapd.deny


# WPA/IEEE 802.11i configuration

# Enable WPA.
# bit0 = WPA
# bit1 = IEEE 802.11i/RSN (WPA2) (dot11RSNAEnabled)
wpa=2
wpa_passphrase=*************
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP CCMP
#wpa_group_rekey=600
#wpa_gmk_rekey=86400[/quoteao5fq7s7]
More information can be found in the trac wiki I posted before...

I can join the network, the client can lookup the MAC address of the AP and store it in his ARP cache. Send ICMP echo requests to AP which receives them. But no answer is received at the client (checked with tcpdump) and probably not even sent by the AP. No ICMP echo reply with tcpdump on interface wlan0. No iptables rules on AP.

Interface configuration
[quoteao5fq7s7]wlan0 Link encapEthernet HWaddr 001c106592b0
inet addr10.0.0.11 Bcast10.0.255.255 Mask255.255.0.0
UP BROADCAST RUNNING MULTICAST MTU1500 Metric1
RX packets894 errors0 dropped0 overruns0 frame0
TX packets588 errors0 dropped0 overruns0 carrier0
collisions0 txqueuelen1000
RX bytes60113 (58.7 KiB) TX bytes43393 (42.3 KiB)[/quoteao5fq7s7]
[quoteao5fq7s7]wlan0 IEEE 802.11bg ESSID"molihua-test"
ModeMaster Frequency2.447 GHz Tx-Power=16 dBm
Retry min limit7 RTS throff Fragment thr=2352 B
Encryption key****-****-****-****-****-****-****-**** [3]
Power Managementoff
Link Quality0 Signal level0 Noise level0
Rx invalid nwid0 Rx invalid crypt0 Rx invalid frag0
Tx excessive retries0 Invalid misc0 Missed beacon0[/quoteao5fq7s7]
Thanks for a look at it...
ganto

cherry314159

04-10-2008 17:52:34

ganto

I've followed your steps on kernel 2.6.26.5 on an ixp425 and my rt2500 mini-pci card is working!
However, I do get lots of these messages
[quote3qad9fmo]
SKB BUG Invalid truesize (232) len=71, sizeof(sk_buff)=168
[/quote3qad9fmo]
Have you seen this?

ganto

04-10-2008 18:04:43

Yes, i saw this when testing the AP with the 2.6.26 kernel too
[quote1uh4zvyt]Oct 3 124010 saturn kernel [993064.070630] wlan0 BC TX buffer full - dropping the oldest frame
Oct 3 124317 saturn kernel [993250.272919] SKB BUG Invalid truesize (240) len=71, sizeof(sk_buff)=176
...
Oct 3 125249 saturn kernel [993822.410073] __ratelimit 2 messages suppressed[/quote1uh4zvyt]
Since I use the rt2x00-sources this message disappeared

I've followed your steps on kernel 2.6.26.5 on an ixp425 and my rt2500 mini-pci card is working!
[/quote1uh4zvyt]
It works with WPA2? o That would be great... Can you provide some more information about your configuration? hostapd build-config and hostapd.conf?

ganto

cherry314159

04-10-2008 21:45:48

I meant that it works without encryption. This is the first
time I got the AP mode to work.

I'm making the switch to 2.6.27. It's complicated because
as other drivers and programs need to be adapted. My
platform is OpenWrt.

ganto

17-10-2008 13:04:14

I just saw that there was a patch submitted for 2.6.28-rc1

rt2x00 Implement HW encryption (rt61pci)
[url1uqis7f7]http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=61e754f44b57060464b1fcf261a8428ecfa23bed[/url1uqis7f7]

I will check if it's possible to use WPA2 encryption with rt61pci now. Stay tuned!

GNUtoo

06-11-2008 14:54:20

hello,
I've tried the following kernel
2.6.26 [works but desasociate-reassociate loop]
if I connect to the wireless access point the client keep associating and dissociating...the result is when I do a dmesg in ssh the flow is not continuous...so too slow to replace my router...
2.6.27 [doesn't work]
iwlist eth2 scan doesn't show me the essid
wireless-testing [doesn't work]
same as above
rt2x00 git [doesn't compile with the allow-ap-modes patch]
doesn't find NL80211_IFTYPE_AP and NL80211_IFTYPE_AP_VLAN

And each time I changed kernel I recompiled libnl and hostapd-0.6.4

cengique

06-11-2008 17:16:42


rt2x00 git [doesn't compile with the allow-ap-modes patch]
doesn't find NL80211_IFTYPE_AP and NL80211_IFTYPE_AP_VLAN
[/quote2hgq4lma]
I'm not very clear about this. Doesn't the rt2x00 git already contain the allow-ap-modes patch? If the patch was posted to the main kernel tree by IvD, I'd think he already tested it on the rt2x00 tree. Do you know what is the contents of this patch?


And each time I changed kernel I recompiled libnl and hostapd-0.6.4[/quote2hgq4lma]
Do you mean you compiled the GIT versions of hostapd 0.6.4 and libnl? Because if not, I am about to try it. I have rt2x00-kernel and the git versions of hostapd installed right now, and I've been using my rt61pci in AP mode for about a month now.

It may take me a few more weeks to try this because it's crunch time for me at work and I have problems with using git to ignore my local changes to hostapd that conflict with upstream changes. I'm new to it )

GNUtoo

07-11-2008 14:42:43


rt2x00 git [doesn't compile with the allow-ap-modes patch]
doesn't find NL80211_IFTYPE_AP and NL80211_IFTYPE_AP_VLAN
[/quote2m2qik0k]
I'm not very clear about this. Doesn't the rt2x00 git already contain the allow-ap-modes patch? If the patch was posted to the main kernel tree by IvD, I'd think he already tested it on the rt2x00 tree. Do you know what is the contents of this patch?
[/quote2m2qik0k]
[code2m2qik0k]# cat 009-allow-ap-vlan-modes.patch
Subject: mac80211: allow AP and VLAN modes

This patch allows switching interfaces into AP/VLAN modes using
cfg80211 (nl80211). Don't allow doing it with wext because then
people will just attempt to do it manually (without hostapd) and
complain that it doesn't work.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
---
net/mac80211/cfg.c | 4 ++++
1 file changed, 4 insertions(+)

--- everything.orig/net/mac80211/cfg.c 2008-05-21 17:40:38.000000000 +0200
+++ everything/net/mac80211/cfg.c 2008-05-21 17:47:46.000000000 +0200
@@ -33,6 +33,10 @@ nl80211_type_to_mac80211_type(enum nl802
case NL80211_IFTYPE_MESH_POINT:
return IEEE80211_IF_TYPE_MESH_POINT;
#endif
+ case NL80211_IFTYPE_AP:
+ return IEEE80211_IF_TYPE_AP;
+ case NL80211_IFTYPE_AP_VLAN:
+ return IEEE80211_IF_TYPE_VLAN;
case NL80211_IFTYPE_WDS:
return IEEE80211_IF_TYPE_WDS;
default:

[/code2m2qik0k]


And each time I changed kernel I recompiled libnl and hostapd-0.6.4[/quote2m2qik0k]
Do you mean you compiled the GIT versions of hostapd 0.6.4 and libnl? Because if not, I am about to try it. I have rt2x00-kernel and the git versions of hostapd installed right now, and I've been using my rt61pci in AP mode for about a month now.

It may take me a few more weeks to try this because it's crunch time for me at work and I have problems with using git to ignore my local changes to hostapd that conflict with upstream changes. I'm new to it )[/quote2m2qik0k]
I tried the last libnl(1.1-r1) and hostapd(0.6.4) from gentoo so they are released and not from git


I'll try without the patch...

GNUtoo

07-11-2008 20:34:54

I'll try without the patch...[/quote12gqou2l]
doesn't work...doesn't find the netlink...
and libnl is activated into hostapd(i had to comment parts of the ebuild because it didn't find things in the source...)

the strange thing is that the following works
*broadcom card
*kenrel 2.6.27
*hostapd 0.6.4
*libnl 1.1-r1

and it works fine...but the broadcom card has a firmware...

mabe i'll buy a PCI broadcom card at that point...(my test were made with a pc-card)

tompl

28-12-2008 00:05:19

i was checking the cfg.c file, and found difference between them

kernel 2.6.28 from kernel.org

[codeijkupwjx]static bool nl80211_type_check(enum nl80211_iftype type)
{
switch (type) {
case NL80211_IFTYPE_ADHOC:
case NL80211_IFTYPE_STATION:
case NL80211_IFTYPE_MONITOR:
#ifdef CONFIG_MAC80211_MESH
case NL80211_IFTYPE_MESH_POINT:
#endif
case NL80211_IFTYPE_WDS:
case NL80211_IFTYPE_AP:
case NL80211_IFTYPE_AP_VLAN:
return true;
default:
return false;
}
}[/codeijkupwjx]

but there is NO function static enum ieee80211_if_types from patch 009-allow-ap-vlan-modes.patch

cfg.c from 2.6.28-rc9-wl-smp(git rt2x00)
[codeijkupwjx]static enum ieee80211_if_types
nl80211_type_to_mac80211_type(enum nl80211_iftype type)
{
switch (type) {
case NL80211_IFTYPE_UNSPECIFIED:
return IEEE80211_IF_TYPE_STA;
case NL80211_IFTYPE_ADHOC:
return IEEE80211_IF_TYPE_IBSS;
case NL80211_IFTYPE_STATION:
return IEEE80211_IF_TYPE_STA;
case NL80211_IFTYPE_MONITOR:
return IEEE80211_IF_TYPE_MNTR;
#ifdef CONFIG_MAC80211_MESH
case NL80211_IFTYPE_MESH_POINT:
return IEEE80211_IF_TYPE_MESH_POINT;
#endif
case NL80211_IFTYPE_WDS:
return IEEE80211_IF_TYPE_WDS;
default:
return IEEE80211_IF_TYPE_INVALID;
}
}[/codeijkupwjx]




try,
[codeijkupwjx]
Subject: mac80211: allow AP and VLAN modes

This patch allows switching interfaces into AP/VLAN modes using
cfg80211 (nl80211). Don't allow doing it with wext because then
people will just attempt to do it manually (without hostapd) and
complain that it doesn't work.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
---
net/mac80211/cfg.c | 2 ++
1 file changed, 2 insertions(+)

--- everything.orig/net/mac80211/cfg.c 2008-10-15 08:33:50.000000000 +0200
+++ everything/net/mac80211/cfg.c 2008-10-15 08:34:12.000000000 +0200
@@ -26,6 +26,8 @@ static bool nl80211_type_check(enum nl80
#ifdef CONFIG_MAC80211_MESH
case NL80211_IFTYPE_MESH_POINT:
#endif
+ case NL80211_IFTYPE_AP:
+ case NL80211_IFTYPE_AP_VLAN:
case NL80211_IFTYPE_WDS:
return true;
default:[/codeijkupwjx]

Kanamara

30-12-2008 12:43:58

[quoteuigxm43i]
try,
[codeuigxm43i]
Subject: mac80211: allow AP and VLAN modes

This patch allows switching interfaces into AP/VLAN modes using
cfg80211 (nl80211). Don't allow doing it with wext because then
people will just attempt to do it manually (without hostapd) and
complain that it doesn't work.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
---
net/mac80211/cfg.c | 2 ++
1 file changed, 2 insertions(+)

--- everything.orig/net/mac80211/cfg.c 2008-10-15 08:33:50.000000000 +0200
+++ everything/net/mac80211/cfg.c 2008-10-15 08:34:12.000000000 +0200
@@ -26,6 +26,8 @@ static bool nl80211_type_check(enum nl80
#ifdef CONFIG_MAC80211_MESH
case NL80211_IFTYPE_MESH_POINT:
#endif
+ case NL80211_IFTYPE_AP:
+ case NL80211_IFTYPE_AP_VLAN:
case NL80211_IFTYPE_WDS:
return true;
default:[/codeuigxm43i][/quoteuigxm43i]

this fine.
help deal with the problem
[codeuigxm43i]
# hostapd -dd hostapd.conf
Configuration file: hostapd.conf
ctrl_interface_group=0
Opening raw packet socket for ifindex -1208310116
BSS count 1, BSSID mask ff:ff:ff:ff:ff:ff (0 bits)
SIOCGIWRANGE: WE(compiled)=22 WE(source)=21 enc_capa=0xf
wlan0: IEEE 802.11 Configured channel (8) not found from the channel list of current mode (1) IEEE 802.11g
wlan0: IEEE 802.11 Hardware does not support configured channel
Could not select hw_mode and channel. (-1)
wlan0: Unable to setup interface.
rmdir[ctrl_interface]: No such file or directory
[/codeuigxm43i]

tompl

31-12-2008 01:19:19

[quote35hqqgqg]
help deal with the problem
[code35hqqgqg]
# hostapd -dd hostapd.conf
Configuration file: hostapd.conf
ctrl_interface_group=0
Opening raw packet socket for ifindex -1208310116
BSS count 1, BSSID mask ff:ff:ff:ff:ff:ff (0 bits)
SIOCGIWRANGE: WE(compiled)=22 WE(source)=21 enc_capa=0xf
wlan0: IEEE 802.11 Configured channel (8) not found from the channel list of current mode (1) IEEE 802.11g
wlan0: IEEE 802.11 Hardware does not support configured channel
Could not select hw_mode and channel. (-1)
wlan0: Unable to setup interface.
rmdir[ctrl_interface]: No such file or directory
[/code35hqqgqg][/quote35hqqgqg][/quote35hqqgqg]
do u compile rt2x00 kernel? i tried before to compile the latest kernel from kernel.org with wireless-next and ap/vlan patch without success (got the same errors)u need to

[code35hqqgqg]1. GIT
wget http://www.kernel.org/pub/software/scm/git/git-1.5.0.5.tar.gz
tar zxf git-1.5.0.5.tar.gz
cd git-1.5.0.5
make; make prefix=/usr/local install

2. RT2x00 CVS
git clone git://git.kernel.org/pub/scm/linux/kernel/git/ivd/rt2x00.git/
cp rt2x00 /usr/src/
ln -s /usr/src/rt2x00 /usr/src/linux

3. kernel
cd /usr/src/linux
make menuconfig
make all
make modules_install
cp /usr/src/linux/arch/x86/boot/bzImage /boot/

4. lilo
mcedit /etc/lilo.conf
lilo

5. LIBNL
wget http://people.suug.ch/~tgr/libnl/files/libnl-1.1.tar.gz
tar zxf libnl-1.1.tar.gz
cd libnl-1.1
cp libnl-1.1 /usr/src/libnl
./configure
make
make install

5. HOSTAPD
git clone git://w1.fi/srv/git/hostap.git
cd hostap/hostapd/
cp defconfig .config

CONFIG_DRIVER_NL80211=y
LIBNL=/usr/src/libnl
CFLAGS += -I$(LIBNL)/include
LIBS += -L$(LIBNL)/lib
make && make install
touch /etc/hostapd/hostapd.conf
hostapd -Bdd /etc/hostapd/hostapd.conf
[/code35hqqgqg]
its my personal notes.

hotbelgo

31-12-2008 13:34:26

I have a spare D-Link Airplus G DWL G510 wireless pci, which reports containing a RaLink RT2561/RT61 rev B 802.11gchip.

I first thought this could be done using iwconfig

iwconfig wlan0 essid thuisnet mode master

but that resulted in

Error for wireless request "Set Mode" (8B06)
SET failed on device wlan0 ; Invalid argument.

It seems as though rt2x000 drivers for my card are under development, but that a howto exists.

Configuring the hostapd that comes with Mandriva 2009 to use nl80211 (which I presume is necessary given that you need specifically to compile it) led to
Line 17 invalid/unknown driver 'nl80211'

So it looks as though I need to recompile the code with nl80211 included. Mandriva comes with libnl 1.1, which seems to be the latest. The latest development code (Hostap 0.6.6) compiled OK, but the git code did not.

Running as a user gives
ioctl[SIOCSIFFLAGS] Permission denied

While as root
# ./hostapd -dd /etc/hostapd/hostapd.conf
Configuration file /etc/hostapd/hostapd.conf
ctrl_interface_group=0
Failed to set interface wlan0 to master mode.
nl80211 driver initialization failed.
wlan0 Unable to setup interface.
rmdir[ctrl_interface] No such file or directory
ELOOP remaining socket sock=5 eloop_data=0x84a3848 user_data=(nil) handler=0x8079420

Si it seems to be the master mode issue again. I really don't want to have to recompile a kernel if at all possible.
Any advice?
HB

tompl

31-12-2008 14:01:36

U cant use IWCONFIG to set the master mode.... u have to use hostapd instead.
paste source of net/mac80211/cfg.c and uname -a.
Its a diffrence between mac80211 and accepting master mode. Since kernel 2.6.24 all kernels have subsystem mac80211(http//liquidat.wordpress.com/2007/03/0 ... rnel-tree/). But to use master mode on rt61 u need to compile with ap/vlan patch that for new kernels 2.6.28 doesnt work.

Read this topic from beginning. In my post before u have all steps to make ur wifi working in master mode.

hotbelgo

31-12-2008 14:22:34

Here you go

I didn't follow all that you said, but I might be capable of compiling a module or two if needed.


Linux 2.6.27.7-desktop586-1mnb #1 SMP Thu Dec 11 163208 EST 2008 i686 Intel(R) Celeron(R) CPU 2.26GHz GNU/Linux
[code36ux73dx]

/*
* mac80211 configuration hooks for cfg80211
*
* Copyright 2006, 2007 Johannes Berg <johannes@sipsolutions.net>
*
* This file is GPLv2 as found in COPYING.
*/

#include <linux/ieee80211.h>
#include <linux/nl80211.h>
#include <linux/rtnetlink.h>
#include <net/net_namespace.h>
#include <linux/rcupdate.h>
#include <net/cfg80211.h>
#include "ieee80211_i.h"
#include "cfg.h"
#include "rate.h"
#include "mesh.h"

static enum ieee80211_if_types
nl80211_type_to_mac80211_type(enum nl80211_iftype type)
{
switch (type) {
case NL80211_IFTYPE_UNSPECIFIED:
return IEEE80211_IF_TYPE_STA;
case NL80211_IFTYPE_ADHOC:
return IEEE80211_IF_TYPE_IBSS;
case NL80211_IFTYPE_STATION:
return IEEE80211_IF_TYPE_STA;
case NL80211_IFTYPE_MONITOR:
return IEEE80211_IF_TYPE_MNTR;
#ifdef CONFIG_MAC80211_MESH
case NL80211_IFTYPE_MESH_POINT:
return IEEE80211_IF_TYPE_MESH_POINT;
#endif
case NL80211_IFTYPE_WDS:
return IEEE80211_IF_TYPE_WDS;
default:
return IEEE80211_IF_TYPE_INVALID;
}
}
[/code36ux73dx]

tompl

31-12-2008 15:31:16

u didnt apply ap/vlan patch, u need to manual edit that file and change one function
[code2fej4cy0]static enum ieee80211_if_types
nl80211_type_to_mac80211_type(enum nl80211_iftype type)
{
switch (type) {
case NL80211_IFTYPE_UNSPECIFIED:
return IEEE80211_IF_TYPE_STA;
case NL80211_IFTYPE_ADHOC:
return IEEE80211_IF_TYPE_IBSS;
case NL80211_IFTYPE_STATION:
return IEEE80211_IF_TYPE_STA;
case NL80211_IFTYPE_MONITOR:
return IEEE80211_IF_TYPE_MNTR;
#ifdef CONFIG_MAC80211_MESH
case NL80211_IFTYPE_MESH_POINT:
return IEEE80211_IF_TYPE_MESH_POINT;
#endif
case NL80211_IFTYPE_AP:
return IEEE80211_IF_TYPE_AP;
case NL80211_IFTYPE_AP_VLAN:
return IEEE80211_IF_TYPE_VLAN;
case NL80211_IFTYPE_WDS:
return IEEE80211_IF_TYPE_WDS;
default:
return IEEE80211_IF_TYPE_INVALID;
}
}[/code2fej4cy0]

or apply patch from command line
do it in ur kernel source folder
patch -p1 < /path/to/009-allow-ap-vlan-modes.patch


http//johannes.sipsolutions.net/patche ... odes.patch

hotbelgo

01-01-2009 16:21:09

I recompiled the mac80211 module with the patch and replaced the existing mac80211.ko.gz in /lib/modules but modprobe is failing

WARNING Error inserting mac80211 (/lib/modules/2.6.27.7-desktop586-1mnb/kernel/net/mac80211/mac80211.ko.gz) Invalid module format

This is because I am having trouble getting the module to be the right format

mac80211 version magic '2.6.27.7-1mnbcustom SMP mod_unload 586 ' should be '2.6.27.7-desktop586-1mnb SMP mod_unload 586 '

But I can't find the right file is /usr/src/linux to fix this

tompl

02-01-2009 16:27:36

I recompiled the mac80211 module with the patch and replaced the existing mac80211.ko.gz in /lib/modules but modprobe is failing

WARNING Error inserting mac80211 (/lib/modules/2.6.27.7-desktop586-1mnb/kernel/net/mac80211/mac80211.ko.gz) Invalid module format

This is because I am having trouble getting the module to be the right format

mac80211 version magic '2.6.27.7-1mnbcustom SMP mod_unload 586 ' should be '2.6.27.7-desktop586-1mnb SMP mod_unload 586 '

But I can't find the right file is /usr/src/linux to fix this[/quote2ioh6f8c]
Did u compile kernel with mac80211 as a module(M) or built-in(*)

hotbelgo

03-01-2009 07:56:17

WOW - it works ... sort of! Thanks!
I can now follow the instructions on the sitre and get a result. But I can't start hostapd in daemon mode ( -B ) as that always leads to errors

./hostapd -B ./hostapd.conf
Configuration file ./hostapd.conf
Failed to update rate sets in kernel module
Mode IEEE 802.11g Channel 8 Frequency 2447 MHz
Failed to set CTS protect in kernel driver
Failed to set Short Slot Time option in kernel driver
Could not set preamble for kernel driver
Using interface wlan0 with hwaddr 00195b8a46f7 and ssid 'test'
Failed to set CTS protect in kernel driver
Failed to set Short Slot Time option in kernel driver
Could not set preamble for kernel driver

Any ideas

IvD

03-01-2009 09:51:33

Did you use the latest version of hostapd (the .git version) and did you enable nl80211?

hotbelgo

03-01-2009 15:36:22

I'm using the latest development (not git) version, but automagically it now all works (all i think i changed was to set the country code to my country). If you find yourself driving down a particular suburban street in western Europe and see a hotspot called "free wifi" it might just be mine![/color31spxaq3]

eludias

05-01-2009 14:07:17

I still cannot get the rt61pci to get into host ap mode.

Things learned in the process, mostly Debian Sid related, all together in one place

[code1sut13u5]apt-get install git-core[/code1sut13u5] will install git. Needed.

[code1sut13u5]008-allow-ap-vlan-modes.patch[/code1sut13u5] which enables host ap mode is in linux kernel 2.6.28 onwards.

Debian has 2.6.26 in unstable, 2.6.27 in experimental so you need a custom kernel.

[code1sut13u5]apt-get install firmware-ralink[/code1sut13u5] will install needed firmware for Debian.

Debian has an too old hostapd which does not contain needed driver. However, it also contains usefull manual pages and infrastructure. So do install the old version with [code1sut13u5]apt-get install hostapd[/code1sut13u5]

Get hostapd with '[code1sut13u5]git clone git://w1.fi/srv/git/hostap.git[/code1sut13u5]'. All dependencies are in Debian packages ([code1sut13u5]apt-get install libnl-dev[/code1sut13u5])

hostapd needs to be configured to use driver 80211nl. This needs to be compiled in manually (don't know why not enabled by default), copy hostapd/defconfig to hostapd/.config and set [code1sut13u5]CONFIG_DRIVER_NL80211=y[/code1sut13u5] . Run make. Copy hostapd to /usr/sbin over the old version in Debian.

Edit /etc/hostapd/hostapd.conf

Add to /etc/network/interfaces
[quote1sut13u5]auto wlan0
iface wlan0 inet manual
hostapd /etc/hostapd/hostapd.conf
[/quote1sut13u5]
This should bring up wlan0 on boot, and run hostapd.

Test configuration with '[code1sut13u5]hostapd -dd /etc/hostapd/hostapd.conf[/code1sut13u5]'. Also look in dmesg for clues.

....but...

This doesn't work for me, while I've got the feeling that it should.

[code1sut13u5]latti:~# hostapd -dd /etc/hostapd/hostapd.conf
Configuration file: /etc/hostapd/hostapd.conf
ctrl_interface_group=0
Failed to set interface wlan0 to master mode.
nl80211 driver initialization failed.
wlan0: Unable to setup interface.
rmdir[ctrl_interface]: No such file or directory
ELOOP: remaining socket: sock=5 eloop_data=0x8d6e840 user_data=(nil) handler=0x807bc00
[/code1sut13u5]

Ok, so could not set master mode. That's the same error as when patch is not applied, but this is 2.6.28 which should work out-of-the-box.

More output

[code1sut13u5]
latti:~# uname -a
Linux latti 2.6.28 #4 Mon Jan 5 12:18:15 CET 2009 i686 GNU/Linux

latti:~# hostapd -v
hostapd v0.6.6
User space daemon for IEEE 802.11 AP management,
IEEE 802.1X/WPA/WPA2/EAP/RADIUS Authenticator
Copyright (c) 2002-2008, Jouni Malinen <j@w1.fi> and contributors

latti:~# iwconfig wlan0
wlan0 IEEE 802.11bg ESSID:""
Mode:Managed Frequency:2.412 GHz Access Point: Not-Associated
Tx-Power=19 dBm
Retry min limit:7 RTS thr:off Fragment thr=2352 B
Encryption key:off
Power Management:off
Link Quality:0 Signal level:0 Noise level:0
Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0
Tx excessive retries:0 Invalid misc:0 Missed beacon:0

latti:~# iwconfig wlan0 mode master
Error for wireless request "Set Mode" (8B06) :
SET failed on device wlan0 ; Invalid argument.
[/code1sut13u5]

The only worrisome part from dmesg is

[code1sut13u5][ 22.909172] cfg80211: Calling CRDA for country: US
[/code1sut13u5]

...and I'm in .nl and don't know how to set the crda and don't know whether it matters.

Anyone any idea?

Thanks,
Rutger.

cengique

05-01-2009 15:49:45

I still cannot get the rt61pci to get into host ap mode.

Debian has 2.6.26 in unstable, 2.6.27 in experimental so you need a custom kernel.

...

All dependencies are in Debian packages ([code2o4zlw3s]apt-get install libnl-dev[/code2o4zlw3s])

[/quote2o4zlw3s]

Since you're already compiling a custom kernel, why don't you try the rt2x00-kernel? I got it to work with that. Also, you may need to compile libnl from source, too. See the post above with step-by-step instructions to get these from GIT repositories.

hotbelgo

05-01-2009 19:15:54

Did you recompile the mac80211 kernel module? That's what I needed to do after applying the patch http//linux-tinkering.blogspot.com/
HB

eludias

05-01-2009 19:55:55

Yes, I compiled the whole kernel (2.6.28), which should be less error prone than one module.

...and now compiling whole new kernel again, but rt2x00 branch this time. Should be done in 1.5 hours (slow PC)...

This rt2x00 branch seems to be based upon a lot of other trees it contains about 9000(!) changesets not in mainline.

eludias

05-01-2009 21:05:12

Ok, I'm somewhat further now. I've got a new git kernel freshly taken from git tree rt2x00 )

'bridge_packets' may not be set in hostapd.conf, otherwise you'll get a 'Failed to set bridge_packets for kernel driver'.

In short
- 2.6.28 is not good enough as kernel
- no security mode works (== can connect from Windows XP)
- WEP mode also works
- WPA (wpa=1) I can give in a key in Windows, but I don't know which (it expects 5 or 10 ASCII, or 13 or 26 hex while I have a passphrase).
- WPA2 mode (wpa=2) does not work at all. Cannot get to enter passphrase

O well, at least I've got WEP working. That's something.

cengique

05-01-2009 22:03:12

Ok, I'm somewhat further now. I've got a new git kernel freshly taken from git tree rt2x00 )

O well, at least I've got WEP working. That's something.[/quote34t96uph]
Hey, at least you got [i34t96uph]some[/i34t96uph] encryption to work! I didn't even get WEP. x Would you mind posting important parts of your hostapd.conf (maybe just changes from default?). Did you play with module parameters to enable/disable hardware encryption?

CheerfulBoy

08-01-2009 03:11:41

And now, I have

linux 2.6.28-gentoo i686 AMD Athlon(tm) XP
hostapd v0.6.6
libnl v1.1-r1

Wi-Fi works fine after setting (MAC80211_RC_MINSTREL [=y]) and set that as default rate control algorithm (MAC80211_RC_DEFAULT_MINSTREL [=y]). Before this action Windows Vista can't connect to my AP, by reason is low signal of my AP. And now is works, but I afraid to upgrade my hostapd to v0.6.7.. Well, and I hate this messages in my log

[code1ux8tj3c]------------[ cut here ]------------
WARNING: at net/core/skbuff.c:154 skb_truesize_bug+0x2e/0x33()
SKB BUG: Invalid truesize (304) len=130, sizeof(sk_buff)=176
Modules linked in: nfsd lockd sunrpc exportfs w83627hf hwmon_vid pppoe pppox ipt_MASQUERADE ipt_REDIRECT iptable_nat nf_nat nf_conntrack_ipv4 nf_conntrack nf_defrag_ipv4 xt_TCPMSS ipt_REJECT iptable_filter iptable_mangle bnep rfcomm l2cap btusb analog gameport via_rhine i2c_viapro r8169 fan rt61pci rt2x00pci rt2x00lib eeprom_93cx6 thermal processor button thermal_sys dm_snapshot dm_mirror dm_region_hash dm_log sbp2 ohci1394 ieee1394 ohci_hcd ssb uhci_hcd usb_storage hid ehci_hcd usbcore scsi_transport_fc scsi_wait_scan
Pid: 9231, comm: hostapd Not tainted 2.6.28-gentoo #5
Call Trace:
[<c011ad7b>] warn_slowpath+0x61/0x78
[<c011621f>] default_wake_function+0x0/0x8
[<c037169d>] nl80211_set_station+0x114/0x130
[<c031f097>] netlink_sendskb+0x19/0x2f
[<c011570a>] update_curr+0x5f/0x93
[<c0118fed>] check_preempt_wakeup+0x12e/0x15a
[<c030aad9>] skb_truesize_bug+0x2e/0x33
[<c0307ae4>] sock_rfree+0x1e/0x42
[<c030a136>] skb_release_head_state+0x4c/0x7d
[<c030a739>] skb_release_all+0x8/0x10
[<c030a045>] __kfree_skb+0x8/0x61
[<c030c526>] skb_free_datagram+0xa/0x2c
[<c035de82>] packet_recvmsg+0x1a3/0x1af
[<c0305905>] sock_recvmsg+0xc7/0xe2
[<c03059d7>] sock_sendmsg+0xb7/0xd0
[<c0127ee4>] autoremove_wake_function+0x0/0x2d
[<c0164784>] core_sys_select+0x1cb/0x29f
[<c03066c5>] sys_recvfrom+0xb4/0x11d
[<c016153d>] do_path_lookup+0xc7/0x110
[<c015c484>] cp_new_stat64+0xfc/0x10e
[<c0306747>] sys_recv+0x19/0x1d
[<c0306b57>] sys_socketcall+0x10d/0x1a9
[<c010361d>] sysenter_do_call+0x12/0x21
---[ end trace 0930e305075668eb ]---
------------[ cut here ]------------
WARNING: at net/core/skbuff.c:154 skb_truesize_bug+0x2e/0x33()
SKB BUG: Invalid truesize (304) len=135, sizeof(sk_buff)=176
Modules linked in: nfsd lockd sunrpc exportfs w83627hf hwmon_vid pppoe pppox ipt_MASQUERADE ipt_REDIRECT iptable_nat nf_nat nf_conntrack_ipv4 nf_conntrack nf_defrag_ipv4 xt_TCPMSS ipt_REJECT iptable_filter iptable_mangle bnep rfcomm l2cap btusb analog gameport via_rhine i2c_viapro r8169 fan rt61pci rt2x00pci rt2x00lib eeprom_93cx6 thermal processor button thermal_sys dm_snapshot dm_mirror dm_region_hash dm_log sbp2 ohci1394 ieee1394 ohci_hcd ssb uhci_hcd usb_storage hid ehci_hcd usbcore scsi_transport_fc scsi_wait_scan
Pid: 9231, comm: hostapd Tainted: G W 2.6.28-gentoo #5
Call Trace:
[<c011ad7b>] warn_slowpath+0x61/0x78
[<c011621f>] default_wake_function+0x0/0x8
[<c030ef2a>] dev_hard_start_xmit+0x169/0x1c2
[<c0319e9c>] __qdisc_run+0xa4/0x159
[<c031101c>] dev_queue_xmit+0x34d/0x381
[<c0381b60>] ieee80211_monitor_start_xmit+0x6d/0x7b
[<c030ef2a>] dev_hard_start_xmit+0x169/0x1c2
[<c0319e9c>] __qdisc_run+0xa4/0x159
[<c030aad9>] skb_truesize_bug+0x2e/0x33
[<c0307ae4>] sock_rfree+0x1e/0x42
[<c030a136>] skb_release_head_state+0x4c/0x7d
[<c030a739>] skb_release_all+0x8/0x10
[<c030a045>] __kfree_skb+0x8/0x61
[<c030c526>] skb_free_datagram+0xa/0x2c
[<c035de82>] packet_recvmsg+0x1a3/0x1af
[<c0305905>] sock_recvmsg+0xc7/0xe2
[<c0127ee4>] autoremove_wake_function+0x0/0x2d
[<c0127ee4>] autoremove_wake_function+0x0/0x2d
[<c0164784>] core_sys_select+0x1cb/0x29f
[<c030658f>] sys_recvmsg+0x148/0x1ca
[<c03066c5>] sys_recvfrom+0xb4/0x11d
[<c01400a0>] find_get_page+0x10/0x3f
[<c0140233>] find_lock_page+0x10/0x42
[<c0141c5c>] filemap_fault+0x1ac/0x304
[<c013ec27>] handle_fasteoi_irq+0x0/0x77
[<c011e303>] irq_exit+0x3c/0x55
[<c01053b1>] do_IRQ+0x96/0xa9
[<c01041bb>] common_interrupt+0x23/0x28
[<c0306747>] sys_recv+0x19/0x1d
[<c0306b57>] sys_socketcall+0x10d/0x1a9
[<c010361d>] sysenter_do_call+0x12/0x21
---[ end trace 0930e305075668eb ]---
------------[ cut here ]------------
WARNING: at net/core/skbuff.c:154 skb_truesize_bug+0x2e/0x33()
SKB BUG: Invalid truesize (304) len=135, sizeof(sk_buff)=176
Modules linked in: nfsd lockd sunrpc exportfs w83627hf hwmon_vid pppoe pppox ipt_MASQUERADE ipt_REDIRECT iptable_nat nf_nat nf_conntrack_ipv4 nf_conntrack nf_defrag_ipv4 xt_TCPMSS ipt_REJECT iptable_filter iptable_mangle bnep rfcomm l2cap btusb analog gameport via_rhine i2c_viapro r8169 fan rt61pci rt2x00pci rt2x00lib eeprom_93cx6 thermal processor button thermal_sys dm_snapshot dm_mirror dm_region_hash dm_log sbp2 ohci1394 ieee1394 ohci_hcd ssb uhci_hcd usb_storage hid ehci_hcd usbcore scsi_transport_fc scsi_wait_scan
Pid: 9231, comm: hostapd Tainted: G W 2.6.28-gentoo #5
Call Trace:
[<c011ad7b>] warn_slowpath+0x61/0x78
[<c011621f>] default_wake_function+0x0/0x8
[<c030ef2a>] dev_hard_start_xmit+0x169/0x1c2
[<c0319e9c>] __qdisc_run+0xa4/0x159
[<c031101c>] dev_queue_xmit+0x34d/0x381
[<c0381b60>] ieee80211_monitor_start_xmit+0x6d/0x7b
[<c030ef2a>] dev_hard_start_xmit+0x169/0x1c2
[<c0319e9c>] __qdisc_run+0xa4/0x159
[<c030aad9>] skb_truesize_bug+0x2e/0x33
[<c0307ae4>] sock_rfree+0x1e/0x42
[<c030a136>] skb_release_head_state+0x4c/0x7d
[<c030a739>] skb_release_all+0x8/0x10
[<c030a045>] __kfree_skb+0x8/0x61
[<c030c526>] skb_free_datagram+0xa/0x2c
[<c035de82>] packet_recvmsg+0x1a3/0x1af
[<c0305905>] sock_recvmsg+0xc7/0xe2
[<c0127ee4>] autoremove_wake_function+0x0/0x2d
[<c0127ee4>] autoremove_wake_function+0x0/0x2d
[<c0164784>] core_sys_select+0x1cb/0x29f
[<c030658f>] sys_recvmsg+0x148/0x1ca
[<c03066c5>] sys_recvfrom+0xb4/0x11d
[<c01400a0>] find_get_page+0x10/0x3f
[<c0140233>] find_lock_page+0x10/0x42
[<c0141c5c>] filemap_fault+0x1ac/0x304
[<c013ec27>] handle_fasteoi_irq+0x0/0x77
[<c011e303>] irq_exit+0x3c/0x55
[<c01053b1>] do_IRQ+0x96/0xa9
[<c01041bb>] common_interrupt+0x23/0x28
[<c0306747>] sys_recv+0x19/0x1d
[<c0306b57>] sys_socketcall+0x10d/0x1a9
[<c010361d>] sysenter_do_call+0x12/0x21
---[ end trace 0930e305075668eb ]---[/code1ux8tj3c]

CheerfulBoy

08-01-2009 09:02:07

I forced to use this patch for hide skb bug

[code3tty7buo]--- everything.orig/net/core/skbuff.c.orig 2009-01-08 15:47:40.000000000 +0700
+++ everything/net/core/skbuff.c 2009-01-08 15:48:07.000000000 +0700
@@ -149,9 +149,9 @@

void skb_truesize_bug(struct sk_buff *skb)
{
- WARN(net_ratelimit(), KERN_ERR "SKB BUG: Invalid truesize (%u) "
- "len=%u, sizeof(sk_buff)=%Zd\n",
- skb->truesize, skb->len, sizeof(struct sk_buff));
+// WARN(net_ratelimit(), KERN_ERR "SKB BUG: Invalid truesize (%u) "
+// "len=%u, sizeof(sk_buff)=%Zd\n",
+// skb->truesize, skb->len, sizeof(struct sk_buff));
}
EXPORT_SYMBOL(skb_truesize_bug);[/code3tty7buo]

[url3tty7buo]ftp://moo.kraslan.ru/incoming/patches/2.6.28-skbuff.patch[/url3tty7buo]

priffo

09-01-2009 12:33:37

Hi i need some pointers. I don't know what to do. This is what i've done

Ubuntu 8.10
#lspci
0607.0 Network controller RaLink RT2561/RT61 802.11g PCI

1. Git version 1.5.6.3

2. RT2x00 kernel
git clone git//git.kernel.org/pub/scm/linux/kern ... t2x00.git/
$ uname -a
Linux agua 2.6.28-rc9.2410-wl #2 SMP Thu Jan 8 180508 CLST 2009 i686 GNU/Linux

3. LIBNL
downloaded from http//people.suug.ch/~tgr/libnl/files/libnl-1.1.tar.gz
modify the file include/netlink-local.h to add <limits.h>
make && make install

4. HOSTAPD
git clone git//w1.fi/srv/git/hostap.git
modify the defconfig file
CONFIG_DRIVER_NL80211=y
LIBNL=/home/priffo/libnl-1.1/
CFLAGS += -I$(LIBNL)/include
LIBS += -L$(LIBNL)/lib
make && make install

Then
hostapd /etc/hostapd/hostapd.conf

return this
# hostapd /etc/hostapd/hostapd.conf
Configuration file /etc/hostapd/hostapd.conf
Failed to set interface wlan0 to master mode.
nl80211 driver initialization failed.
rmdir[ctrl_interface] No such file or directory
ELOOP remaining socket sock=5 eloop_data=0x91df848 user_data=(nil) handler=0x8075400

and

# iwconfig
wlan0 IEEE 802.11bg ESSID"XXX"
ModeManaged Frequency2.462 GHz Access Point Not-Associated
Tx-Power=12 dBm
Retry min limit7 RTS throff Fragment thr=2352 B
Encryption keyoff
Power Managementoff
Link Quality0 Signal level0 Noise level0
Rx invalid nwid0 Rx invalid crypt0 Rx invalid frag0
Tx excessive retries0 Invalid misc0 Missed beacon0
if i do
# /etc/init.d/hostapd start
* Starting advanced IEEE 802.11 management [ OK ]

iwconfig shows the same

any ideas ?

Regards,
Pedro

CheerfulBoy

10-01-2009 01:17:12

[code1uzk45ba]# cat 2.6.28-allow-ap-vlan-modes.patch
Subject: mac80211: allow AP and VLAN modes

This patch allows switching interfaces into AP/VLAN modes using
cfg80211 (nl80211). Don't allow doing it with wext because then
people will just attempt to do it manually (without hostapd) and
complain that it doesn't work.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
---
net/mac80211/cfg.c | 2 ++
1 file changed, 2 insertions(+)

--- everything.orig/net/mac80211/cfg.c 2008-10-07 20:05:30.000000000 +0200
+++ everything/net/mac80211/cfg.c 2008-10-07 20:06:37.000000000 +0200
@@ -33,6 +33,8 @@ static bool nl80211_type_check(enum nl80
#ifdef CONFIG_MAC80211_MESH
case NL80211_IFTYPE_MESH_POINT:
#endif
+ case NL80211_IFTYPE_AP:
+ case NL80211_IFTYPE_AP_VLAN:
case NL80211_IFTYPE_WDS:
return true;
default:[/code1uzk45ba]
ftp//moo.kraslan.ru/incoming/patches/2 ... odes.patch

priffo

12-01-2009 11:32:20

This is part of my default net/mac80211/cfg.c
[code3j6lyka6]
static bool nl80211_type_check(enum nl80211_iftype type)
{
switch (type) {
case NL80211_IFTYPE_ADHOC:
case NL80211_IFTYPE_STATION:
case NL80211_IFTYPE_MONITOR:
#ifdef CONFIG_MAC80211_MESH
case NL80211_IFTYPE_MESH_POINT:
#endif
case NL80211_IFTYPE_AP:
case NL80211_IFTYPE_AP_VLAN:
case NL80211_IFTYPE_WDS:
return true;
default:
return false;
}
}[/code3j6lyka6]

I think it's already patched =(.

_cyclops_

07-02-2009 09:02:38

Hi Guys,

Been following this thread a bit as i have a rt61pci card. I actually have two, a linksys WMP54G (version 4.1) and a Belkin (ver 6000df). I got the belkin card working as a client (not tested, but Kismet actually works so i'm assuming that's all ok). Is it correct that these two cards both use rt61pci?

I'm running debian stable and am using a self compiled libnl because debian stable only has 1.0~pre6 or something. I also have the 2.6.28 kernel compiled on there (also needed it for some other device support). Currently i haven't got it working yet.

However i do have a question about https//ganto.no-ip.org/trac/wiki/LinuxRouter/Ralink
It says i can use the 008-allow-ap-vlan-modes.patch patch OR get the git kernel source.

I'm currently compiling 2.6.28.4 with the 008 patch (still running, takes ages to compile).
What version is the git kernel source? Is that really needed to get master mode working or should the 2.6.28.4 with patch work too?


[update]
When compiling 2.6.28.4 with the 008 patch from http//johannes.sipsolutions.net/patche ... 6-14%3a52/ i get this error

[quote1wx5sgfd]
CC [M] net/mac80211/cfg.o
net/mac80211/cfg.c In function 'nl80211_type_check'
net/mac80211/cfg.c37 error 'IEEE80211_IF_TYPE_AP' undeclared (first use in this function)
net/mac80211/cfg.c37 error (Each undeclared identifier is reported only once
net/mac80211/cfg.c37 error for each function it appears in.)
net/mac80211/cfg.c39 error 'IEEE80211_IF_TYPE_VLAN' undeclared (first use in this function)
make[3] *** [net/mac80211/cfg.o] Error 1
make[2] *** [net/mac80211] Error 2
make[1] *** [net] Error 2
make[1] Leaving directory `/usr/src/linux'
make *** [debian/stamp-build-kernel] Error 2
[/quote1wx5sgfd]

Going to build the rt2x00 git kernel now... (or at least try)
Just another question, when will the master mode be in the normal kernel tree? Will it be 2.6.29?

_cyclops_

07-02-2009 17:15:44

Sweeeeeeeeet! I got it working!

What i needed to do was get the git rt2x00 kernel
[quotewmbhdt0w]
prof-x/etc/hostapd# uname -a
Linux prof-x 2.6.29-rc3-wlcyclops-00000-g620724c #2 Sat Feb 7 132229 CET 2009 i686 GNU/Linux
[/quotewmbhdt0w]

Then had to compile libnl and got the latest hostapd from the GIT.

Works super with WPA-Personal (PSK)

cengique

10-02-2009 05:30:12

I've been using rt61pci in master mode for a while now in unencrypted mode. To enable encryption I tried to upgrade both the kernel drivers and the hostapd version, but none of the newer configurations worked for me!

Here's my device
[code1juoi9sc]# lspci -v -s 01:06.0
01:06.0 Network controller: RaLink RT2561/RT61 rev B 802.11g
Subsystem: RaLink Unknown device 2561
[/code1juoi9sc]

I included attachments of working and failing hostapd outputs. Basically new hostapd (versions 0.6.7 and 0.7.0) refuse to work with the older rt2x00 kernel driver, and also fail to authenticate with newer rt2x00 kernel. The hostapd people suggested there may be something wrong with the updated drivers

On Sat, Jan 31, 2009 at 352 PM, Jouni Malinen <j@w1.fi> wrote

> On Sat, Jan 31, 2009 at 033906PM -0500, Cengiz Günay wrote
>
> > I have been using hostapd 0.6.4 for my rt61 PCI device since about October
> > with no problems. Recently I upgraded both the kernel drivers for rt2x00 and
> > hostapd and I can no longer get the master mode working. I would appreciate
> > if you have any insights on how I can upgrade to recent versions of hostapd
> > without breaking my configuration.
>
> [b1juoi9sc]It looks like the new driver does not report TX status for management
> frames sent by hostapd. This is required to be able to implement
> association processing correctly in AP mode.[/b1juoi9sc]

But since other people got it to work with kernel 2.6.29-rc3 recently, I am a little confused. Any suggestions?

cengique

15-02-2009 21:21:07

I still couldn't get 2.6.29-rc3 to work with new hostapd (>=0.6.7), but I learned something; if hostapd says
[code35z79odn]Configuration file: /etc/hostapd/hostapd.conf
ctrl_interface_group=0
Opening raw packet socket for ifindex -1
BSS count 1, BSSID mask ff:ff:ff:ff:ff:ff (0 bits)
Failed to set country code
wlan0: Unable to setup interface.[/code35z79odn]

It may be because while compiling git version of hostapd you forgot to edit the [b35z79odn].config[/b35z79odn] file to enable [b35z79odn]CONFIG_DRIVER_NL80211[/b35z79odn]. ) If you're compiling the git version of libnl, you also need to set [b35z79odn]CONFIG_LIBNL20=1[/b35z79odn]. Somehow hostapd does not give the proper error that the nl80211 driver is missing. After fixing it, I started getting an error about not being able to set the channel. I see messages like these in dmesg
[code35z79odn]phy0: HW CONFIG: freq=2442
phy0 -> rt2x00mac_conf_tx: Info - Configured TX queue 0 - CWmin: 5, CWmax: 10, Aifs: 2, TXop: 0.
phy0 -> rt2x00mac_conf_tx: Info - Configured TX queue 1 - CWmin: 5, CWmax: 10, Aifs: 2, TXop: 0.
phy0 -> rt2x00mac_conf_tx: Info - Configured TX queue 2 - CWmin: 5, CWmax: 10, Aifs: 2, TXop: 0.
phy0 -> rt2x00mac_conf_tx: Info - Configured TX queue 3 - CWmin: 5, CWmax: 10, Aifs: 2, TXop: 0.[/code35z79odn]
I am not sure if they signal an error.

IvD

15-02-2009 21:41:59

The rt2x00 message prefix "Info" indicates the message is for informational purposes only.
So the debug messages you posted above are information only and do not indicate problems.

cengique

15-02-2009 22:54:19

The rt2x00 message prefix "Info" indicates the message is for informational purposes only.
So the debug messages you posted above are information only and do not indicate problems.[/quote1azchvt3]

Thanks, that helps. I must have a problem with libnl or hostapd, or the way I compile them. I cannot even get the results I got a while ago. (

ganto

16-02-2009 01:01:13

Sweeeeeeeeet! I got it working![/quote2u16eou1]
NICE! I made it too... I think we're soon going to see it in 2.6.29 stable D

Here my setup

[b2u16eou1]Master mode with rt61pci and 2.6.29 and WPA2 Encryption[/b2u16eou1] [ WORKS![/color2u16eou1] ]
[list2u16eou1]
[*2u16eou1]kernel sources =2.6.29-rc5 (vanilla)[/*m2u16eou1]
[*2u16eou1]libnl1 1.1-2 (lenny)[/*m2u16eou1]
[*2u16eou1]firmware Debian firmware-ralink 0.14 (lenny)[/*m2u16eou1]
[*2u16eou1]hostapd latest sources from git//w1.fi/srv/git/hostap.git (hostapd v0.7.0)
driver 80211nl[/*m2u16eou1]
[*2u16eou1]configuration as posted before [url2u16eou1]http://rt2x00.serialmonkey.com/phpBB/viewtopic.php?p=30863#p30863[/url2u16eou1][/*m2u16eou1][/listu2u16eou1]

Note if you get this error when restarting hostapd...
[quote2u16eou1]
Configuration file /etc/hostapd/hostapd.conf
ctrl_interface_group=0
eapol_version=2
Failed to create interface mon.wlan0.
nl80211 driver initialization failed.
wlan0 Unable to setup interface.
Flushing old station entries
Deauthenticate all stations
[/quote2u16eou1]
... you first have to reload the 'rt61pci' kernel module

dmesg
[quote2u16eou1]
Linux version 2.6.29-rc5-c3via (root@saturn) (gcc version 4.1.2 20061115 (prerelease) (Debian 4.1.1-21)) #2 Mon Feb 16 033907 CET 2009
...
cfg80211 Using static regulatory domain info
cfg80211 Regulatory domain US
(start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp)
(2402000 KHz - 2472000 KHz @ 40000 KHz), (600 mBi, 2700 mBm)
(5170000 KHz - 5190000 KHz @ 40000 KHz), (600 mBi, 2300 mBm)
(5190000 KHz - 5210000 KHz @ 40000 KHz), (600 mBi, 2300 mBm)
(5210000 KHz - 5230000 KHz @ 40000 KHz), (600 mBi, 2300 mBm)
(5230000 KHz - 5330000 KHz @ 40000 KHz), (600 mBi, 2300 mBm)
(5735000 KHz - 5835000 KHz @ 40000 KHz), (600 mBi, 3000 mBm)
cfg80211 Calling CRDA for country US
...
rt61pci 00000014.0 PCI INT A -> Link[LNKB] -> GSI 12 (level, low) -> IRQ 12
phy0 -> rt61pci_validate_eeprom EEPROM recovery - NIC 0xff80
phy0 -> rt61pci_validate_eeprom EEPROM recovery - RSSI OFFSET BG 0x0000
phy0 -> rt61pci_validate_eeprom EEPROM recovery - RSSI OFFSET A 0x0000
phy0 -> rt2x00_set_chip Info - Chipset detected - rt 0301, rf 0003, rev 0002561c.
wmaster0 (rt61pci) not using net_device_ops yet
phy0 Selected rate control algorithm 'minstrel'
wlan0 (rt61pci) not using net_device_ops yet
Registered led device rt61pci-phy0radio
Registered led device rt61pci-phy0assoc
...
mon.wlan0 (rt61pci) not using net_device_ops yet
phy0 -> rt2x00lib_request_firmware Info - Loading firmware file 'rt2561s.bin'.
rt61pci 00000014.0 firmware requesting rt2561s.bin
phy0 -> rt2x00lib_request_firmware Info - Firmware detected - version 0.8.
phy0 -> rt2x00mac_conf_tx Info - Configured TX queue 0 - CWmin 5, CWmax 10, Aifs 2, TXop 0.
phy0 -> rt2x00mac_conf_tx Info - Configured TX queue 1 - CWmin 5, CWmax 10, Aifs 2, TXop 0.
phy0 -> rt2x00mac_conf_tx Info - Configured TX queue 2 - CWmin 5, CWmax 10, Aifs 2, TXop 0.
phy0 -> rt2x00mac_conf_tx Info - Configured TX queue 3 - CWmin 5, CWmax 10, Aifs 2, TXop 0.
...
[/quote2u16eou1]

hostapd output
[quote2u16eou1]
Configuration file /etc/hostapd/hostapd.conf
ctrl_interface_group=0
eapol_version=2
Opening raw packet socket for ifindex 162416168
BSS count 1, BSSID mask ffffffffffff (0 bits)
SIOCGIWRANGE WE(compiled)=22 WE(source)=21 enc_capa=0xf
nl80211 Added 802.11b mode based on 802.11g information
Allowed channel mode=1 chan=1 freq=2412 MHz max_tx_power=19 dBm
Allowed channel mode=1 chan=2 freq=2417 MHz max_tx_power=18 dBm
Allowed channel mode=1 chan=3 freq=2422 MHz max_tx_power=18 dBm
Allowed channel mode=1 chan=4 freq=2427 MHz max_tx_power=17 dBm
Allowed channel mode=1 chan=5 freq=2432 MHz max_tx_power=17 dBm
Allowed channel mode=1 chan=6 freq=2437 MHz max_tx_power=16 dBm
Allowed channel mode=1 chan=7 freq=2442 MHz max_tx_power=16 dBm
Allowed channel mode=1 chan=8 freq=2447 MHz max_tx_power=16 dBm
Allowed channel mode=1 chan=9 freq=2452 MHz max_tx_power=16 dBm
Allowed channel mode=1 chan=10 freq=2457 MHz max_tx_power=15 dBm
Allowed channel mode=1 chan=11 freq=2462 MHz max_tx_power=15 dBm
Allowed channel mode=0 chan=1 freq=2412 MHz max_tx_power=19 dBm
Allowed channel mode=0 chan=2 freq=2417 MHz max_tx_power=18 dBm
Allowed channel mode=0 chan=3 freq=2422 MHz max_tx_power=18 dBm
Allowed channel mode=0 chan=4 freq=2427 MHz max_tx_power=17 dBm
Allowed channel mode=0 chan=5 freq=2432 MHz max_tx_power=17 dBm
Allowed channel mode=0 chan=6 freq=2437 MHz max_tx_power=16 dBm
Allowed channel mode=0 chan=7 freq=2442 MHz max_tx_power=16 dBm
Allowed channel mode=0 chan=8 freq=2447 MHz max_tx_power=16 dBm
Allowed channel mode=0 chan=9 freq=2452 MHz max_tx_power=16 dBm
Allowed channel mode=0 chan=10 freq=2457 MHz max_tx_power=15 dBm
Allowed channel mode=0 chan=11 freq=2462 MHz max_tx_power=15 dBm
RATE[0] rate=10 flags=0x2
RATE[1] rate=20 flags=0x6
RATE[2] rate=55 flags=0x6
RATE[3] rate=110 flags=0x6
RATE[4] rate=60 flags=0x0
RATE[5] rate=90 flags=0x0
RATE[6] rate=120 flags=0x0
RATE[7] rate=180 flags=0x0
RATE[8] rate=240 flags=0x0
RATE[9] rate=360 flags=0x0
RATE[10] rate=480 flags=0x0
RATE[11] rate=540 flags=0x0
Passive scanning not supported
Flushing old station entries
Deauthenticate all stations
Mode IEEE 802.11g Channel 8 Frequency 2447 MHz
Using interface wlan0 with hwaddr 001c106592b0 and ssid 'molihua-test'
SSID - hexdump_ascii(len=12)
...
PSK (ASCII passphrase) - hexdump_ascii(len=19)
...
PSK (from passphrase) - hexdump(len=32) ...
WPA group state machine entering state GTK_INIT (VLAN-ID 0)
GMK - hexdump(len=32) [REMOVED]
GTK - hexdump(len=32) [REMOVED]
WPA group state machine entering state SETKEYSDONE (VLAN-ID 0)
wlan0 Setup of interface done.
[/quote2u16eou1]

----

Then I also tred to stick with "stable" kernel sources so I choose the ubuntu jaunty kernel sources

[b2u16eou1]Master mode with rt61pci and 2.6.28[/b2u16eou1] [ FAILS![/color2u16eou1] ]
[list2u16eou1]
[*2u16eou1]kernel sources =2.6.28.5 (ubuntu 2.6.28-8.22)
patches changed cfg.c as mentionned here [url2u16eou1]http://rt2x00.serialmonkey.com/phpBB/viewtopic.php?p=31683&sid=33b4e158ae341ff47c8e15bc7fe30a4b#p31683[/url2u16eou1][/*m2u16eou1]
[*2u16eou1]libnl1 1.1-2 (lenny)[/*m2u16eou1]
[*2u16eou1]firmware Debian firmware-ralink 0.14 (lenny)[/*m2u16eou1]
[*2u16eou1]hostapd latest sources from git//w1.fi/srv/git/hostap.git (hostapd v0.7.0)
driver 80211nl[/*m2u16eou1][/listu2u16eou1]

dmesg
[quote2u16eou1]Linux version 2.6.28.5-c3via (root@saturn) (gcc version 4.1.2 20061115 (prerelease) (Debian 4.1.1-21)) #2 Sun Feb 15 225432 CET 2009 ()
...
cfg80211 Using static regulatory domain info
cfg80211 Regulatory domain US
(start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp)
(2402000 KHz - 2472000 KHz @ 40000 KHz), (600 mBi, 2700 mBm)
(5170000 KHz - 5190000 KHz @ 40000 KHz), (600 mBi, 2300 mBm)
(5190000 KHz - 5210000 KHz @ 40000 KHz), (600 mBi, 2300 mBm)
(5210000 KHz - 5230000 KHz @ 40000 KHz), (600 mBi, 2300 mBm)
(5230000 KHz - 5330000 KHz @ 40000 KHz), (600 mBi, 2300 mBm)
(5735000 KHz - 5835000 KHz @ 40000 KHz), (600 mBi, 3000 mBm)
cfg80211 Calling CRDA for country US
...
rt61pci 00000014.0 PCI INT A -> Link[LNKB] -> GSI 12 (level, low) -> IRQ 12
phy0 -> rt61pci_validate_eeprom EEPROM recovery - NIC 0xff80
phy0 -> rt61pci_validate_eeprom EEPROM recovery - RSSI OFFSET BG 0x0000
phy0 -> rt61pci_validate_eeprom EEPROM recovery - RSSI OFFSET A 0x0000
phy0 -> rt2x00_set_chip Info - Chipset detected - rt 0301, rf 0003, rev 0002561c.
phy0 Selected rate control algorithm 'pid'
Registered led device rt61pci-phy0radio
Registered led device rt61pci-phy0assoc
...
phy0 -> rt2x00lib_request_firmware Info - Loading firmware file 'rt2561s.bin'.
rt61pci 00000014.0 firmware requesting rt2561s.bin
phy0 -> rt2x00lib_request_firmware Info - Firmware detected - version 0.8.
phy0 -> rt2x00mac_conf_tx Info - Configured TX queue 0 - CWmin 5, CWmax 10, Aifs 2, TXop 0.
phy0 -> rt2x00mac_conf_tx Info - Configured TX queue 1 - CWmin 5, CWmax 10, Aifs 2, TXop 0.
phy0 -> rt2x00mac_conf_tx Info - Configured TX queue 2 - CWmin 5, CWmax 10, Aifs 2, TXop 0.
phy0 -> rt2x00mac_conf_tx Info - Configured TX queue 3 - CWmin 5, CWmax 10, Aifs 2, TXop 0.
phy0 -> rt2x00mac_conf_tx Info - Configured TX queue 0 - CWmin 5, CWmax 10, Aifs 2, TXop 0.
phy0 -> rt2x00mac_conf_tx Info - Configured TX queue 1 - CWmin 5, CWmax 10, Aifs 2, TXop 0.
phy0 -> rt2x00mac_conf_tx Info - Configured TX queue 2 - CWmin 5, CWmax 10, Aifs 2, TXop 0.
phy0 -> rt2x00mac_conf_tx Info - Configured TX queue 3 - CWmin 5, CWmax 10, Aifs 2, TXop 0.
phy0 -> rt2x00mac_conf_tx Info - Configured TX queue 0 - CWmin 5, CWmax 10, Aifs 2, TXop 0.
phy0 -> rt2x00mac_conf_tx Info - Configured TX queue 1 - CWmin 5, CWmax 10, Aifs 2, TXop 0.
phy0 -> rt2x00mac_conf_tx Info - Configured TX queue 2 - CWmin 5, CWmax 10, Aifs 2, TXop 0.
phy0 -> rt2x00mac_conf_tx Info - Configured TX queue 3 - CWmin 5, CWmax 10, Aifs 2, TXop 0.
[/quote2u16eou1]
hostapd output
[quote2u16eou1]
Configuration file /etc/hostapd/hostapd.conf
ctrl_interface_group=0
eapol_version=2
Opening raw packet socket for ifindex 158717480
BSS count 1, BSSID mask ffffffffffff (0 bits)
SIOCGIWRANGE WE(compiled)=22 WE(source)=21 enc_capa=0xf
nl80211 Added 802.11b mode based on 802.11g information
Allowed channel mode=1 chan=1 freq=2412 MHz max_tx_power=0 dBm
Allowed channel mode=1 chan=2 freq=2417 MHz max_tx_power=0 dBm
Allowed channel mode=1 chan=3 freq=2422 MHz max_tx_power=0 dBm
Allowed channel mode=1 chan=4 freq=2427 MHz max_tx_power=0 dBm
Allowed channel mode=1 chan=5 freq=2432 MHz max_tx_power=0 dBm
Allowed channel mode=1 chan=6 freq=2437 MHz max_tx_power=0 dBm
Allowed channel mode=1 chan=7 freq=2442 MHz max_tx_power=0 dBm
Allowed channel mode=1 chan=8 freq=2447 MHz max_tx_power=0 dBm
Allowed channel mode=1 chan=9 freq=2452 MHz max_tx_power=0 dBm
Allowed channel mode=1 chan=10 freq=2457 MHz max_tx_power=0 dBm
Allowed channel mode=1 chan=11 freq=2462 MHz max_tx_power=0 dBm
Allowed channel mode=0 chan=1 freq=2412 MHz max_tx_power=0 dBm
Allowed channel mode=0 chan=2 freq=2417 MHz max_tx_power=0 dBm
Allowed channel mode=0 chan=3 freq=2422 MHz max_tx_power=0 dBm
Allowed channel mode=0 chan=4 freq=2427 MHz max_tx_power=0 dBm
Allowed channel mode=0 chan=5 freq=2432 MHz max_tx_power=0 dBm
Allowed channel mode=0 chan=6 freq=2437 MHz max_tx_power=0 dBm
Allowed channel mode=0 chan=7 freq=2442 MHz max_tx_power=0 dBm
Allowed channel mode=0 chan=8 freq=2447 MHz max_tx_power=0 dBm
Allowed channel mode=0 chan=9 freq=2452 MHz max_tx_power=0 dBm
Allowed channel mode=0 chan=10 freq=2457 MHz max_tx_power=0 dBm
Allowed channel mode=0 chan=11 freq=2462 MHz max_tx_power=0 dBm
RATE[0] rate=10 flags=0x2
RATE[1] rate=20 flags=0x6
RATE[2] rate=55 flags=0x6
RATE[3] rate=110 flags=0x6
RATE[4] rate=60 flags=0x0
RATE[5] rate=90 flags=0x0
RATE[6] rate=120 flags=0x0
RATE[7] rate=180 flags=0x0
RATE[8] rate=240 flags=0x0
RATE[9] rate=360 flags=0x0
RATE[10] rate=480 flags=0x0
RATE[11] rate=540 flags=0x0
Passive scanning not supported
Flushing old station entries
Deauthenticate all stations
Mode IEEE 802.11g Channel 8 Frequency 2447 MHz
Could not set channel for kernel driver
wlan0 Unable to setup interface.
Flushing old station entries
Deauthenticate all stations
rmdir[ctrl_interface] No such file or directory
[/quote2u16eou1]

ganto

n_petr

16-02-2009 20:13:01

Dear _cyclops_ and ganto,
I have still AP (mode master) problems with recent gits (compile procedure works well)
a) MGMT (TX callback) fail
b) unknown vendor specific information element ignored (vendor OUI 001018 len=9)

You can see more at [urlzr374ule]http://rt2x00.serialmonkey.com/phpBB/viewtopic.php?f=5&t=5150[/urlzr374ule]. Dou you have some comments? Was anybody successful with this card? Is anybody think, that will should work?

I attached new version of my install script (some user interaction needed)
#!/bin/bash

# Get IvD's rt2x00 kenrel
cg clone git//git.kernel.org/pub/scm/linux/kern ... t2x00.git/

# Get wireless regdb
git clone git//git.kernel.org/pub/scm/linux/kern ... -regdb.git

# Get crda
git clone git//git.kernel.org/pub/scm/linux/kern ... f/crda.git

# Get libnl
git clone git//git.kernel.org/pub/scm/libs/netlink/libnl.git

# Get hostapd, wpa-supplicant, etc...
git clone git//w1.fi/srv/git/hostap.git

# Get iw
git clone http//git.sipsolutions.net/iw.git

# Compile hack
cp ./rt2x00/include/linux/nl80211.h /usr/include/linux

# Mount DebugFS
mount -t debugfs none /debug

###
# Build libnl & install it
cd libnl

# This is going to install libnl into /usr.
# you may need to point this elsewhere for your system.
autoconf
./configure --prefix=/usr
make && make install
cd ..

###
# Build crda & install it (and install the wireless regdb)
cd wireless-regdb

# First we need to create the location for the wireless regulatory
# database
mkdir -p /usr/lib/crda

# Now we copy the regulatory db over. Note, no need to 'make' here as
# the wireless regdb shipped by git is already signed and setup as needed
cp regulatory.bin /usr/lib/crda/

cd ..

# Now we build crda
cd crda

# I HIGHLY recommend installing this as it configures udev for using crda
# automatically.
make && make install

cd ..

###
# Build iw & install it

cd iw

# You can leave out the 'sudo make install' if you don't want
# to install iw or overwrite your system iw.
make && make install

cd ..

###
# Build hostapd & install it

cd hostap/hostapd

# Copy the default config to .config for use during this build
cp defconfig .config

# Edit .config
vi .config

# you need to uncomment these lines, at a minimum, and make sure
# CONFIG_LIBNL_LOC points to wherever you installed libnl to in
# step 3.
#
# CONFIG_DRIVER_NL80211=y
# LIBNL=/usr
# CFLAGS += -I$(LIBNL)/include
# LIBS += -L$(LIBNL)/lib
#
# and add
#
# CONFIG_LIBNL20=y
#
# If it dies with
# error 'struct hostapd_config' has no member named 'ieee80211n'
#
# uncomment
#
# CONFIG_IEEE80211N=y
#

# You can leave out the 'sudo make install' if you don't want
# to install hostapd or overwrite your system hostapd.
make && make install

cd ../..

###
# Build IvD's rt2x00 kernel and install it, then reboot

cd rt2x00
make menuconfig && make && make modules_install && make install && echo "do not forget create images with mkinitramfs"

---hostpad.conf---
interface=wlan0
driver=nl80211
country_code=CZ
logger_syslog=-1
logger_syslog_level=2
logger_stdout=1
logger_stdout_level=2
ssid=myap
channel=6
hw_mode=g
macaddr_acl=0
auth_algs=1
eap_server=0
own_ip_addr=192.168.0.1
ctrl_interface=/var/run/hostapd
ctrl_interface_group=0

cengique

17-02-2009 16:58:06

Sweeeeeeeeet! I got it working![/quote1k6gvfux]
NICE! I made it too... I think we're soon going to see it in 2.6.29 stable D
[/quote1k6gvfux]

Thanks ganto for the information! Your hostapd outputs helped me figure out that I had an old udev installation. I now have WPA2 working on my rt61! The details of my setup can be found here viewtopic.php?f=5&t=5157&p=32220#p32220

--cengiz

Crystal

28-02-2009 06:06:34

Hi all
I' ve been tracking the discussion for a while for I have RaLink RT2561/RT61 card and want to set AP with it. However, I am completely lost in all variants of configuration described in this forum. The one thing which I did for certain is compiling a 2.6.29-rc3-wl git kernel.
Nevertheless, after this I'm unable to set my card in master mode and I suppose I miss some technicality
I've also known from this forum that for some kernels it's necessary to apply something-like-80211-patch, but for 28 and onwards it isn't, yes?
Could you help me for a little?

cengique

02-03-2009 20:09:51

Hi all
Nevertheless, after this I'm unable to set my card in master mode and I suppose I miss some technicality[/quoterwwpn0eu]
Can you be more specific? What happens when you run hostapd? What version of hostapd are you using?


I've also known from this forum that for some kernels it's necessary to apply something-like-80211-patch, but for 28 and onwards it isn't, yes?[/quoterwwpn0eu]
No need for a patch if you're compiling the rt2x00 GIT kernel. See the post on at end of page 3 for details.

ganto

03-03-2009 10:29:55

I think the thing that is still missing is the hostapd with the nl80211 driver. Binary shipped versions of the hostapd normally don't have this driver compiled in yet. So you need to recompile it for your installation. For the hostapd configuration please see the previous posts by me.

cheers, ganto

Crystal

07-03-2009 07:22:02

my [i2l841nnp]installed[/i2l841nnp] hostapd is v0.5.9
then i tried to compile it from sources as it was said a page ago
first i downloaded libnl and got it installed
then i tried to amend def_config file in hostapd sources dir so as paths for libnl are correct
However, i get this output at the attemp of compilation
[code2l841nnp]crystal@Crystal:~/OperaDownloads/cogito-0.18.1/hostap/hostapd$ make
cc -MMD -O2 -Wall -g -DHOSTAPD_DUMP_STATE -I../src -I../src/crypto -I../src/utils -I../src/common /usr/local/include -DCONFIG_CTRL_IFACE -DCONFIG_CTRL_IFACE_UNIX -DCONFIG_IAPP -DCONFIG_RSN_PREAUTH -DCONFIG_PEERKEY -DCONFIG_IEEE80211N -DCONFIG_DRIVER_HOSTAP -DCONFIG_DRIVER_NL80211 -DEAP_MD5 -DEAP_TLS -DEAP_PEAP -DEAP_TTLS -DEAP_MSCHAPv2 -DEAP_GTC -DEAP_SERVER -DEAP_TLS_FUNCS -DPKCS12_FUNCS -DINTERNAL_SHA256 -DCONFIG_NO_FIPS186_2_PRF -DCONFIG_NO_T_PRF -DCONFIG_IPV6 -DNEED_MLME -c -o driver_nl80211.o driver_nl80211.c
driver_nl80211.c: In function ‘send_and_recv_msgs’:
driver_nl80211.c:190: warning: passing argument 1 of ‘nl_send_auto_complete’ from incompatible pointer type
driver_nl80211.c:205: warning: passing argument 1 of ‘nl_recvmsgs’ from incompatible pointer type
driver_nl80211.c: In function ‘i802_init_sockets’:
driver_nl80211.c:2540: warning: implicit declaration of function ‘nl_handle_alloc_cb’
driver_nl80211.c:2540: warning: assignment makes pointer from integer without a cast
driver_nl80211.c:2546: warning: passing argument 1 of ‘genl_connect’ from incompatible pointer type
driver_nl80211.c:2557: warning: passing argument 1 of ‘genl_ctrl_alloc_cache’ from incompatible pointer type
driver_nl80211.c:2557: error: too few arguments to function ‘genl_ctrl_alloc_cache’
driver_nl80211.c: In function ‘i802_deinit’:
driver_nl80211.c:3016: warning: implicit declaration of function ‘nl_handle_destroy’
make: *** [driver_nl80211.o] Error 1
[/code2l841nnp]

IvD

07-03-2009 09:13:29

Well compile problems for hostapd belong on a hostapd forum or mailinglist where the developers might provide support.

Crystal

09-03-2009 17:44:41

the thing was in CONFIG_libnl20 not set
if not set, function applies with two arguments , so call with one was regarded erronous
after i compiled hostapd I had to [code1cc2mw7k]root@Crystal:~# export LD_LIBRARY_PATH=/usr/local/lib
[/code1cc2mw7k] every time I have to run hostapd , otherwise he won't locate libnl2.0
And even after that (and after CRDA was installed in place) and master mode was put in action, I still can't see my network in the available networks list...
[code1cc2mw7k]$ sudo cat /etc/hostapd/hostapd.conf | awk /^[^#].*$/
interface=wlan0
driver=nl80211
logger_syslog=0
logger_syslog_level=2
logger_stdout=-1
logger_stdout_level=2
debug=4
dump_file=/tmp/hostapd.dump
ctrl_interface=/var/run/hostapd
ctrl_interface_group=0
ssid=test
country_code=RU
ieee80211d=1
hw_mode=g
beacon_int=100
dtim_period=2
max_num_sta=255
rts_threshold=2347
fragm_threshold=2346
macaddr_acl=0
auth_algs=3
ignore_broadcast_ssid=0
wme_enabled=1
wme_ac_bk_cwmin=4
wme_ac_bk_cwmax=10
wme_ac_bk_aifs=7
wme_ac_bk_txop_limit=0
wme_ac_bk_acm=0
wme_ac_be_aifs=3
wme_ac_be_cwmin=4
wme_ac_be_cwmax=10
wme_ac_be_txop_limit=0
wme_ac_be_acm=0
wme_ac_vi_aifs=2
wme_ac_vi_cwmin=3
wme_ac_vi_cwmax=4
wme_ac_vi_txop_limit=94
wme_ac_vi_acm=0
wme_ac_vo_aifs=2
wme_ac_vo_cwmin=2
wme_ac_vo_cwmax=3
wme_ac_vo_txop_limit=47
wme_ac_vo_acm=0
wep_default_key=1
wep_key0=9049857783
wep_key1="vwxyz"
eapol_key_index_workaround=0
eap_server=0
own_ip_addr=127.0.0.1

$ iwconfig wlan0
wlan0 IEEE 802.11bg Mode:Master Frequency:2.412 GHz Tx-Power=17 dBm
Retry min limit:7 RTS thr=2347 B Fragment thr=2346 B
Power Management:off
Link Quality:0 Signal level:0 Noise level:0
Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0
Tx excessive retries:0 Invalid misc:0 Missed beacon:0
[/code1cc2mw7k]

cengique

09-03-2009 18:00:11

after i compiled hostapd I had to [codex413paag]root@Crystal:~# export LD_LIBRARY_PATH=/usr/local/lib
[/codex413paag] every time I have to run hostapd , otherwise he won't locate libnl2.0
[/quotex413paag]
You can add /usr/local/lib to your /etc/ld.so.conf file and rerun 'ldconfig' to avoid that.


And even after that (and after CRDA was installed in place) and master mode was put in action, I still can't see my network in the available networks list...
[/quotex413paag]
Can you post a bit of what you get when you run hostapd? To capture the debug meesages produced by hostapd you can run it like this[codex413paag] # hostapd -dd /etc/hostapd.conf 2>&1 > output.log [/codex413paag]

Crystal

09-03-2009 19:34:28

[code18opi3tp]$ sudo hostapd -ddB /etc/hostapd/hostapd.conf
[sudo] password for crystal:
Configuration file: /etc/hostapd/hostapd.conf
Line 44: DEPRECATED: 'debug' configuration variable is not used anymore
ctrl_interface_group=0
Opening raw packet socket for ifindex 1633878026
BSS count 1, BSSID mask ff:ff:ff:ff:ff:ff (0 bits)
SIOCGIWRANGE: WE(compiled)=22 WE(source)=21 enc_capa=0xf
nl80211: Added 802.11b mode based on 802.11g information
Allowed channel: mode=1 chan=1 freq=2412 MHz max_tx_power=17 dBm
Allowed channel: mode=1 chan=2 freq=2417 MHz max_tx_power=17 dBm
Allowed channel: mode=1 chan=3 freq=2422 MHz max_tx_power=17 dBm
Allowed channel: mode=1 chan=4 freq=2427 MHz max_tx_power=16 dBm
Allowed channel: mode=1 chan=5 freq=2432 MHz max_tx_power=16 dBm
Allowed channel: mode=1 chan=6 freq=2437 MHz max_tx_power=16 dBm
Allowed channel: mode=1 chan=7 freq=2442 MHz max_tx_power=16 dBm
Allowed channel: mode=1 chan=8 freq=2447 MHz max_tx_power=16 dBm
Allowed channel: mode=1 chan=9 freq=2452 MHz max_tx_power=16 dBm
Allowed channel: mode=1 chan=10 freq=2457 MHz max_tx_power=17 dBm
Allowed channel: mode=1 chan=11 freq=2462 MHz max_tx_power=17 dBm
Allowed channel: mode=0 chan=1 freq=2412 MHz max_tx_power=17 dBm
Allowed channel: mode=0 chan=2 freq=2417 MHz max_tx_power=17 dBm
Allowed channel: mode=0 chan=3 freq=2422 MHz max_tx_power=17 dBm
Allowed channel: mode=0 chan=4 freq=2427 MHz max_tx_power=16 dBm
Allowed channel: mode=0 chan=5 freq=2432 MHz max_tx_power=16 dBm
Allowed channel: mode=0 chan=6 freq=2437 MHz max_tx_power=16 dBm
Allowed channel: mode=0 chan=7 freq=2442 MHz max_tx_power=16 dBm
Allowed channel: mode=0 chan=8 freq=2447 MHz max_tx_power=16 dBm
Allowed channel: mode=0 chan=9 freq=2452 MHz max_tx_power=16 dBm
Allowed channel: mode=0 chan=10 freq=2457 MHz max_tx_power=17 dBm
Allowed channel: mode=0 chan=11 freq=2462 MHz max_tx_power=17 dBm
RATE[0] rate=10 flags=0x2
RATE[1] rate=20 flags=0x6
RATE[2] rate=55 flags=0x6
RATE[3] rate=110 flags=0x6
RATE[4] rate=60 flags=0x0
RATE[5] rate=90 flags=0x0
RATE[6] rate=120 flags=0x0
RATE[7] rate=180 flags=0x0
RATE[8] rate=240 flags=0x0
RATE[9] rate=360 flags=0x0
RATE[10] rate=480 flags=0x0
RATE[11] rate=540 flags=0x0
Passive scanning not supported
Flushing old station entries
Deauthenticate all stations
Using interface wlan0 with hwaddr 00:21:91:82:6a:7e and ssid 'test'
wlan0: Setup of interface done.
[/code18opi3tp]

And it prints it only once each time I boot up
after this output looks like
[code18opi3tp]
sudo hostapd -ddB /etc/hostapd/hostapd.conf
Configuration file: /etc/hostapd/hostapd.conf
Line 44: DEPRECATED: 'debug' configuration variable is not used anymore
ctrl_interface_group=0
Failed to create interface mon.wlan0.
nl80211 driver initialization failed.
wlan0: Unable to setup interface.
[/code18opi3tp]

cengique

09-03-2009 20:19:18

[code3pvifa7u]Configuration file: /etc/hostapd/hostapd.conf
Line 44: DEPRECATED: 'debug' configuration variable is not used anymore
[/code3pvifa7u][/quote3pvifa7u]This sounds like you're still using the hostapd.conf file from your old 0.5.X version. I'd copy over the newer hostapd.conf template from your new hostapd installation. It's usually in the source directory.

[code3pvifa7u]
...
Deauthenticate all stations
Using interface wlan0 with hwaddr 00:21:91:82:6a:7e and ssid 'test'
wlan0: Setup of interface done.
[/code3pvifa7u]
[/quote3pvifa7u]This looks good. In my working configuration I have an additional line of information that is missing in your case. After the line "Deauthenticate..." and before the line "Using interface...", I get a line that says [code3pvifa7u]
Mode: IEEE 802.11g Channel: 7 Frequency: 2442 MHz
[/code3pvifa7u] that is missing in your case. To get this, you may need to choose the channel in your hostapd.conf file (e.g., "channel=7").


And it prints it only once each time I boot up
after this output looks like
[code3pvifa7u]
sudo hostapd -ddB /etc/hostapd/hostapd.conf
Configuration file: /etc/hostapd/hostapd.conf
Line 44: DEPRECATED: 'debug' configuration variable is not used anymore
ctrl_interface_group=0
Failed to create interface mon.wlan0.
nl80211 driver initialization failed.
wlan0: Unable to setup interface.
[/code3pvifa7u][/quote3pvifa7u]This is weird. Do you kill the previous one before running it again? This looks like the interface already exists.

Crystal

10-03-2009 14:30:37

And the last thing was setting my channel to some value(7)
After that I could see my network in the list from windows laptop
Though gateway doesn't respond(
But that's completely different story, probably..

dopaminble

10-03-2009 18:32:50

the thing was in CONFIG_libnl20 not set
if not set, function applies with two arguments , so call with one was regarded erronous
[/quote2l0atw34]

So please can you tell me what you have changed? I have looked briefly about that, but didn't find the function so far.

Crystal

10-03-2009 19:10:34

there is line compiling hostapd
[code2bzi3kbs]driver_nl80211.c:2557: error: too few arguments to function ‘genl_ctrl_alloc_cache’[/code2bzi3kbs]
After some hours I went so desperate I dared open the source driver_nl80211.c
Well. i can't locate it now... perhaps, after configuring the variant has gone
But there was #ifdef CONFIG_LIBNL20 statement
And it controlled the way this function is called (with one or two args)
As I had libnl 2.0, the call was supposed to be invoked with only one, but because the define was not set, source was trying to be built to call with 2 which led to error `too few args'
define can be set in .config file in the source folder of hostapd

dopaminble

12-03-2009 20:03:38

Thank you for your reply...
My problem was an old libnl in /usr/local/lib which results in "too many arguments"

After changing everything (kernel, libnl, hostapd,...), i give up for now.

I still have problems getting into Master mode with my rt2500 based PCI card

a) MGMT (TX callback) fail //only with visible SSID
b) unknown vendor specific information element ignored (vendor OUI 001018 len=9)
c) iw reg get returns US (startup-value) and not the one set with hostap
d) my card is in master mode, but SSID are not setable (no value shown with iwconfig)
e) => AP not visible