Need ad-hoc/master mode on D-Link DWL G510

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

Sapphire

23-11-2008 21:22:17

Hey all!
I've been googling and reading for the whole day and I'm so tired that I ask you not to ban me if I'm asking something absolutely lame )) Help me please, or give a direction to move)
So, here's the task. I've got D-Link DWL G510 (RaLink RT2561/RT61) and Ubuntu 8.04.1. The kernel is 2.6.24-21-generic. I need to make an ad-hoc network, or (it would be fantastic if possible) make it work in Master mode.
I haven't change anything so everything is running on the default. Here's my lsmod
# lsmod | grep rt61
rt61pci 25472 0
rt2x00pci 11264 1 rt61pci
rt2x00lib 22528 2 rt61pci,rt2x00pci
mac80211 165652 3 rt61pci,rt2x00pci,rt2x00lib
eeprom_93cx6 3200 1 rt61pci

But when I'm trying Master mode, here's what I see
# iwconfig wlan0 mode Master
Error for wireless request "Set Mode" (8B06)
SET failed on device wlan0 ; Invalid argument.
And when I'm trying to make it work in Ad-Hoc mode, I see this
# iwconfig wlan0 mode Ad-Hoc
# ifconfig wlan0 up
SIOCSIFFLAGS Operation not supported

But in the Managed mode it works.

So what should I do? Should I compile the latest rt2x00 drivers? Do they support Ad-Hoc? Do they support Master mode on my card? And will they work on my distrib?

IvD

23-11-2008 22:00:03

Master mode is only available in rt2x00.git or wireless-testing.git, and it must be combined using hostapd (latest version) search this forum for other peoples experience.

As for adhoc mode, that should just work, what is the output of 'dmesg'? and 'ifconfig -a' ? and 'iwconfig'?

Sapphire

24-11-2008 00:21:03

Oh... So I guess having Master mode is quite difficult)

About ad-hoc.
# ifconfig -a
eth0 Link encapEthernet HWaddr 000c6e566735
UP BROADCAST MULTICAST MTU1500 Metric1
RX packets0 errors0 dropped0 overruns0 frame0
TX packets0 errors0 dropped0 overruns0 carrier0
collisions0 txqueuelen1000
RX bytes0 (0.0 B) TX bytes0 (0.0 B)
Interrupt20

lo Link encapLocal Loopback
inet addr127.0.0.1 Mask255.0.0.0
inet6 addr 1/128 ScopeHost
UP LOOPBACK RUNNING MTU16436 Metric1
RX packets3111 errors0 dropped0 overruns0 frame0
TX packets3111 errors0 dropped0 overruns0 carrier0
collisions0 txqueuelen0
RX bytes177634 (173.4 KB) TX bytes177634 (173.4 KB)

nas0 Link encapEthernet HWaddr 00a0c578e595
inet6 addr fe802a0c5fffe78e595/64 ScopeLink
UP BROADCAST RUNNING MULTICAST MTU1500 Metric1
RX packets3631199 errors0 dropped0 overruns0 frame0
TX packets3941274 errors225 dropped0 overruns225 carrier0
collisions0 txqueuelen1000
RX bytes2655851073 (2.4 GB) TX bytes1781754863 (1.6 GB)

ppp0 Link encapPoint-to-Point Protocol
inet addr91.78.247.132 P-t-P91.78.244.1 Mask255.255.255.255
UP POINTOPOINT RUNNING NOARP MULTICAST MTU1492 Metric1
RX packets1060907 errors0 dropped0 overruns0 frame0
TX packets1555315 errors0 dropped0 overruns0 carrier0
collisions0 txqueuelen3
RX bytes173610202 (165.5 MB) TX bytes1373871958 (1.2 GB)

wlan0 Link encapEthernet HWaddr 001b110171f5
BROADCAST MULTICAST MTU1500 Metric1
RX packets0 errors0 dropped0 overruns0 frame0
TX packets0 errors0 dropped0 overruns0 carrier0
collisions0 txqueuelen1000
RX bytes0 (0.0 B) TX bytes0 (0.0 B)

wmaster0 Link encapUNSPEC HWaddr 00-1B-11-01-71-F5-00-00-00-00-00-00-00-00-00-00
BROADCAST MULTICAST MTU1500 Metric1
RX packets0 errors0 dropped0 overruns0 frame0
TX packets0 errors0 dropped0 overruns0 carrier0
collisions0 txqueuelen1000
RX bytes0 (0.0 B) TX bytes0 (0.0 B)

# iwconfig
lo no wireless extensions.

eth0 no wireless extensions.

wmaster0 no wireless extensions.

wlan0 IEEE 802.11g ESSID""
ModeManaged Frequency2.462 GHz Access Point Not-Associated
Tx-Power=27 dBm
Retry min limit7 RTS throff Fragment thr=2346 B
Encryption keyoff
Link Quality0 Signal level0 Noise level0
Rx invalid nwid0 Rx invalid crypt0 Rx invalid frag0
Tx excessive retries0 Invalid misc0 Missed beacon0

nas0 no wireless extensions.

ppp0 no wireless extensions.

And dmesg output is really large, but the last entries are
phy0 -> rt2x00mac_add_interface Error - rt2x00 does not support Adhoc or Master mode<3>phy0 -> rt61pci_mcu_request Error - mcu request error. Request 0x50 failed for token 0xff.
As I can see, they appear after I try to do "ifconfig wlan0 up".

PS didn't see this before... Seems like the rt2x00 I have actually doesn't support Adhoc or Master mode %) What should I do then?

IvD

24-11-2008 09:01:20

Ehm, kernel 2.6.24 had master mode and adhoc mode disabled due to various bugs.
It was enabled in a later version, but I am not sure if that was in 2.6.25 or 2.6.26. So you need to at least upgrade your kernel to a more recent version.

desb

25-11-2008 09:14:23

Ad-hoc mode seems not to work with current wireless-testing (2.6.28-rc6-wl), too, only setting mode to managed works.

[code35of8x0r]# iwconfig wlan0 mode ad-hoc
Error for wireless request "Set Mode" (8B06) :
SET failed on device wlan0 ; Operation not supported.[/code35of8x0r]

Is the ad-hoc mode buggy at the moment or might my configuration be wrong?

IvD

25-11-2008 09:22:45

I think you are trying to switch to adhoc mode while the interface is up, that is not allowed.
You must bring the interface down before switching operating modes.

desb

25-11-2008 09:35:58

The interface should be down, i am doing "ifconfig wlan0 down" before that.

During the boot-process i get the same error with this configuration in /etc/network/interfaces

[code34eziaoh]auto wlan0
allow-hotplug wlan0
iface wlan0 inet static
address 192.168.18.2
netmask 255.255.255.128
pre-up iwconfig $IFACE mode ad-hoc
pre-up iwconfig $IFACE essid mesh1
up iwconfig $IFACE channel 1[/code34eziaoh]

The same configuration works when switching to an older kernel image / driver (2.6.27-rc4).

IvD

25-11-2008 10:39:32

Is there any debug information in the log?

desb

25-11-2008 12:44:08

No, there are no output messages with dmesg and syslog. 'Ralink debug output' and most mac80211 debugging options are set. I have a rt73usb device in use, i just noticed the device mentioned in the subject of the thread, but this shouldnt make a difference, or can it?

Is there a way to trigger some debug messages concerning this issue?

IvD

25-11-2008 12:57:04

rt61 and rt73 should behave the same on this area.

desb

25-11-2008 16:38:00

Maybe somebody can reproduce the issue, i did nothing more than pulling the latest wireless-testing and tried to set the device to ad-hoc mode.

irvingleonard

16-03-2009 05:58:42

Maybe this can help.
I have an RT2500 802.11g Cardbus/mini-PCI in kubuntu 8.04.2 and the same problem "rt2x00 does not support Adhoc or Master mode". The funny is that when I had gutsy (7.10) it worked like a charm, it only needed the "wireless-mode" and "wireless-essid" directives in /etc/network/interfaces to work perfectly. Now, in hardy, is imposible to bring the interface up after switching it to ad-hoc, it looks like
#iwconfig
lo no wireless extensions.

eth0 no wireless extensions.

wmaster0 no wireless extensions.

wlan0 IEEE 802.11g ESSID"uni.net"
ModeAd-Hoc Frequency2.412 GHz Cell Not-Associated
Tx-Power=27 dBm
Retry min limit7 RTS throff Fragment thr=2346 B
Link Quality0 Signal level0 Noise level0
Rx invalid nwid0 Rx invalid crypt0 Rx invalid frag0
Tx excessive retries0 Invalid misc0 Missed beacon0
and a "SIOCSIFFLAGS" error on ifconfig up

I follow the same process than the roginal post and get
#lsmod | grep rt2
rt2500pci 22656 0
rt2x00pci 12800 1 rt2500pci
rt2x00lib 25344 2 rt2500pci,rt2x00pci
rfkill 10144 1 rt2x00lib
input_polldev 6928 1 rt2x00lib
crc_itu_t 3584 1 rt2x00lib
mac80211 192532 3 rt2500pci,rt2x00pci,rt2x00lib
eeprom_93cx6 3840 1 rt2500pci

IvD

16-03-2009 08:41:55

can you try running "iwlist wlan0 scan" after you brought up the interface?
some user reported beaconing didn't kick in until a scan command was issued (this is being further investigated).