Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 181545 - net-wireless/madwifi-ng can't set channel: /etc/init.d/net.ath0 starts with wrong channel and fails
Summary: net-wireless/madwifi-ng can't set channel: /etc/init.d/net.ath0 starts with w...
Status: RESOLVED NEEDINFO
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: x86 Linux
: High major (vote)
Assignee: Steev Klimaszewski (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-06-10 16:05 UTC by Nilton Volpato
Modified: 2008-02-08 11:30 UTC (History)
5 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
output from emerge --info (emerge.info,3.45 KB, text/plain)
2007-06-10 16:07 UTC, Nilton Volpato
Details
output from lspci -v (lspci-verbose.txt,5.38 KB, text/plain)
2007-06-10 18:14 UTC, Nilton Volpato
Details
dmesg of 2.6.21.5 (dmesg,26.70 KB, text/plain)
2007-06-24 05:45 UTC, Kyle Brantley
Details
output of emerge --info (info,2.74 KB, text/plain)
2007-06-24 05:45 UTC, Kyle Brantley
Details
2.6.21.5 .config (.config,51.34 KB, text/plain)
2007-06-24 05:46 UTC, Kyle Brantley
Details
lspci -vv (lspci,7.10 KB, text/plain)
2007-06-24 20:03 UTC, Kyle Brantley
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Nilton Volpato 2007-06-10 16:05:58 UTC
I'm using net-wireless/madwifi-ng tried with versions 0.9.2.1 and 0.9.3.1, none of which worked. When starting /etc/init.d/net.ath0 it tries to connect to the wrong channel and dhcp (of course) times out.

It would not be necessary to explicitly set the channel. But, setting it does not work either. None of this worked:
channel_ath0="6"
channel_foo="6" # where foo is my essid
iwconfig_ath0="channel 6"

By restarting manually some times, then it randomly connects to the right channel. This is annoying as the service must be restarted manually after the boot.

Reproducible: Always

Steps to Reproduce:




I'm using:
- D-Link PCMCIA model: DWL-G650.
- gentoo-sources-2.6.20-r8

and tried with:
- madwifi-ng-0.9.2.1
- madwifi-ng-0.9.3.1
Comment 1 Nilton Volpato 2007-06-10 16:07:33 UTC
Created attachment 121671 [details]
output from emerge --info
Comment 2 Steev Klimaszewski (RETIRED) gentoo-dev 2007-06-10 16:35:59 UTC
what about the output of lspci -vv ?
Comment 3 Nilton Volpato 2007-06-10 18:14:42 UTC
Created attachment 121680 [details]
output from lspci -v
Comment 4 Nilton Volpato 2007-06-10 21:41:03 UTC
I've noticed another thing. When it fails to set the correct channel (which is channel 6) it also fails to discover the correct essid address (look below). 

 * Starting ath0
 *   Configuring wireless network for ath0
 *     ath0 connected to ESSID "foo" at 00:00:00:00:00:00
 *     in managed mode on channel 11 (WEP enabled - restricted)
 *   Bringing up ath0
 *     dhcp
 *       Running dhcpcd ...
Error, ath0: timed out                                                    [ !! ]
Comment 5 Steev Klimaszewski (RETIRED) gentoo-dev 2007-06-11 18:30:57 UTC
If the mac address is 00:... then its not actually associating...
Comment 6 Nilton Volpato 2007-06-11 18:45:14 UTC
(In reply to comment #5)
> If the mac address is 00:... then its not actually associating...
> 

Yes, that's the problem. And I'm not the only one with this same problem. I've seen many other gentoo users asking for help about this issue in the forums.
Comment 7 Steev Klimaszewski (RETIRED) gentoo-dev 2007-06-11 18:52:55 UTC
Also, could you try a newer kernel and 0.9.3.1 ?
Comment 8 Steev Klimaszewski (RETIRED) gentoo-dev 2007-06-11 18:53:57 UTC
Also, what is the setup of the access point?  Are you doing anything like ESSID cloaking? What kind of access point is it?  Are all of the users having issues with a rev C card (mine is rev B)
Comment 9 Nilton Volpato 2007-06-11 22:55:37 UTC
        (In reply to comment #7)
> Also, could you try a newer kernel and 0.9.3.1 ?

I've also tried with madwifi-ng 0.9.3.1, as I said. I will try with a ~x86 kernel and see what happens.

I've already tried with: linux-2.6.18-suspend2-r1 and linux-2.6.20-gentoo-r8.

(In reply to comment #8)
> Also, what is the setup of the access point?  Are you doing anything like ESSID
> cloaking? What kind of access point is it?  Are all of the users having issues
> with a rev C card (mine is rev B)

There is nothing special with the access point. It was working before I did a fresh reinstall of my gentoo system. It's a D-Link DI-524 router.

One of the other users reported using a D-Link DWL-G520 card, but gave no other info.

Some threads about this:
http://forums.gentoo.org/viewtopic-t-552928-highlight-.html
http://forums.gentoo.org/viewtopic-t-555331-highlight-.html
http://forums.gentoo.org/viewtopic-t-541909-highlight-.html
http://forums.gentoo.org/viewtopic-t-537514-highlight-.html
Comment 10 Kyle Brantley 2007-06-24 04:57:54 UTC
I'm also having this problem. Had it for several months, asked around in IRC, searched, had no other occurances, so I wrote it off as some stupid detail and worked around it (by blacklisting net.ath0 as hotplug, and then starting, killing (ctrl+c), and restarting the init script).

Running 2.6.21 and madwifi r2295. Kernel comes from kernel.org; not gentoo provided or built. madwifi is checked out of the svn repo and built into the kernel (no modules here).

The problem is simple: I recieve a random channel upon initial start of the device (via init scripts). The AP is on channel 1, the init scripts autodetect channel 11 or 7, seemingly at random. ctrl+c the init script, start it again, the correct channel is found, AP is assosciated with, and DHCP acquires an address.

I'm currently testing again with 2.6.21.5 and madwifi r2512 (checked out today, right now), and once the kernel builds I'll reboot and post emerge --info along with lspci -v, relevant dmesg, .config and other tidbits of related info.


If I had to *guess* as to where this problem is, I would be forced to say this is a but in the network startup script, somewhere in some madwifi specific code (?). If I bring up the interface manually with iwconfig by telling it the essid, it correctly picks up and detects both the AP mac address and channel, and then assosciates correctly. DHCP functions normally, too. I have tested this both with and without WEP, both via the init scripts and manually.

It should be noted that I do *not* have any version of the madwifi-ng package emerged, and the same applies to the kernel - those are both hand-maintained and updated. I doubt this is a bug in madwifi-ng, or the kernel - the behavior is only present when used in combo with the gentoo init scripts. 

The card in question is a DWL-AG660. Once this new kernel builds, I'll reboot, give it a whirl, and post all of the good debugging info that is of use.
Comment 11 Kyle Brantley 2007-06-24 05:41:59 UTC
2.6.21.5 and madwifi r2512 failed, same problem. More info coming once it times out and I can bring up bugzilla here on my laptop.
Comment 12 Kyle Brantley 2007-06-24 05:45:27 UTC
Created attachment 122942 [details]
dmesg of 2.6.21.5
Comment 13 Kyle Brantley 2007-06-24 05:45:58 UTC
Created attachment 122943 [details]
output of emerge --info
Comment 14 Kyle Brantley 2007-06-24 05:46:32 UTC
Created attachment 122945 [details]
2.6.21.5 .config
Comment 15 Steev Klimaszewski (RETIRED) gentoo-dev 2007-06-24 11:39:59 UTC
Does the same thing happen when using the init script and you set the channel in the conf?  e.g. something like channel_ath0="1" (i don't know the exact context, please consult the net.example script for that - i use networkmanager personally and haven't had any issues)  
Comment 16 Kyle Brantley 2007-06-24 19:50:19 UTC
Just tested with channel_ath0="1", as per net.example. Rebooted, watched the init script find the AP on channel 11 (which it isn't).

I also tried setting the AP to channel 11, and rebooted again. That time, it was found on channel 7. Rebooted again, found it on 11 (where it was at the time)...
... but it also failed to get a DHCP address. Read: same end result as when it finds it on the wrong channel.

It works correctly on the second try every time, though.
Comment 17 Kyle Brantley 2007-06-24 19:51:41 UTC
Scratch that "every time" - it just took me three start/break/start cycles to get it on the correct channel...
Comment 18 Kyle Brantley 2007-06-24 20:03:25 UTC
Created attachment 122975 [details]
lspci -vv

Forgot my lspci -vv.
Comment 19 Quido Meijer 2007-07-07 08:39:47 UTC
funny thing is:
my channel setting in conf.d/net ( channel_apienet="7" )is totally being ignored. Most of the time the initscript says its connected to channel 7 or channel 11, but in reality it only connects to channel 6, this is what iwlist ath0 channel tells me:
Current Frequency=2.437 GHz (Channel 6)

So the init script is also lying about which channel it is connecting to. I am associated to the AP though:
ath0      IEEE 802.11g  ESSID:"apienet"  Nickname:""
          Mode:Managed  Frequency:2.437 GHz  Access Point: 00:13:D4:32:25:DF   

I'm running x86 stable:
sys-apps/baselayout-1.12.9-r2
sys-kernel/gentoo-sources-2.6.20-r8
Comment 20 Steev Klimaszewski (RETIRED) gentoo-dev 2008-01-23 03:32:46 UTC
Does this still happen with a recent kernel and 0.9.3.3?
Comment 21 rob miller 2008-02-08 11:30:28 UTC
sorry for the delay.  in my hands the behaviour is unchanged with madwifi-ng-0.9.3.3 and kernel 2.6.23.  the sequence of events for me is:

boot or eject/insert card (netgear wg511t)
start net.ath0
 -> essid detected correctly but mac address may be 00:00:00:00:00:00
 -> channel may or may not be detected correctly
 -> ath0 times out for dhcpd, gets a 169. address
restart net.ath0
 -> essid, mac, channel all correct, connection working