Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 195114 - net.* fails to start rt61 wireless if because of missing /proc/net/wireless entry
Summary: net.* fails to start rt61 wireless if because of missing /proc/net/wireless e...
Status: RESOLVED WONTFIX
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High major (vote)
Assignee: Mobile Herd (OBSOLETE)
URL:
Whiteboard:
Keywords:
Depends on: 183085
Blocks:
  Show dependency tree
 
Reported: 2007-10-08 15:34 UTC by Martin Kramer
Modified: 2009-09-04 02:00 UTC (History)
1 user (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Kramer 2007-10-08 15:34:41 UTC
I'm using a RaLink RT2561/RT61 rev B wireless card in my notebook. Because neither rt2x00 nor rt61 compile with my current kernel (gentoo-sources-2.6.22-r8), I have to use ralink-rt61 driver. 
With this driver however the network initialization script fails. 

/etc/init.d/net.ra0 --verbose start gives

* Starting ra0
*   Loading modules for ra0
*     modules: apipa arping ccwgroup macchanger macnet rename iwconfig essidnet iptunnel ifconfig pppd system dhcpcs ip6to4
*       iwconfig provides wireless
*       ifconfig provides interface
*       pppd provides ppp
*       dhcpcd provides dhcp
*   Configuring ra0 for MAC address 00:13:D3:75:1C:26 ...
*   Wireless extensions not found for ra0
*   Bringing up ra0
*     dhcp
*       Running dhcpcd ...
Error, ra0: timed out
*       ra0 received address 169.254.30.152/16

I checked the iwconfig script in /lib/rcscripts/net and found out, that the script checks /proc/net/wireless and /sys/class/net/<if>/wireless to determine if a wireless extension is loaded. Neither of the two entries exist with ralink-rt61 driver (as well as with rt2x00, as I could read out of the forums). If I bring up the card manually by running ifconfig, iwconfig and iwpriv, the card associates without any problem and dhcpcd is getting the correct IP.

iwconfig without any parameters shows "no wireless extensions." for all but the wireless card as soon as the rt61 module is loaded.

Reproducible: Always

Steps to Reproduce:
1. emerge ralink-rt61
2. Execute network init script for wireless interface
3.

Actual Results:  
dhcpcd timing out, because module is not modprobed by net.* dcript, because the script thinks, that ra0 has no wireless extensions

Expected Results:  
Configuring th wireless card correctly
Comment 1 SpanKY gentoo-dev 2007-10-08 15:49:29 UTC
sounds like the kernel wireless drivers arent doing enough ?
Comment 2 Martin Kramer 2007-10-08 16:03:52 UTC
(In reply to comment #1)
> sounds like the kernel wireless drivers arent doing enough ?
> 

That#s whatI fear too, but honestly, I cannot wait for the driver devs to fix that  (if they would ever fix it, because it isn't anything that reduces the functionality of the driver). 
I think it's something that should be fixed on the script side. As I said iwconfig without params could be used to determine if a card has wireless extensions. 

# iwfonfig

eth0 no wireless extensions.

ra0 no wireless extensions.

# modprobe rt61
# iwconfig

eth0 no wireless extensions.

ra0 RT61 Wireless  ESSID:"" Nickname:""
    Mode:Auto  Frequency:2.412 GHz  Bit Rate=54 Mb/s
    RTS thr:off  Fragment thr:off
    Encryption key:off

So as soon as you modprobe the driver the "no wireless extensions." goes away for ra0 in iwconfig.

I checked the baselayout-2 files, but the method of checking for wireless extensions is the same as in the current baselayout. 
Comment 3 Roy Marples (RETIRED) gentoo-dev 2007-10-09 16:07:17 UTC
iwconfig output is not reliable enough.

Sorry, but I got sick of specific driver hacks for iwconfig, so we enforce either /proc/net/wireless or something in /sys. If there isn't anything in either to show it's wireless then the driver will have to be patched.
Comment 4 Martin Kramer 2007-10-09 17:21:41 UTC
(In reply to comment #3)
> iwconfig output is not reliable enough.
> 
> Sorry, but I got sick of specific driver hacks for iwconfig, so we enforce
> either /proc/net/wireless or something in /sys. If there isn't anything in
> either to show it's wireless then the driver will have to be patched.
> 

That would be the best solution I guess. But where can I file a BUG report with RaLink? As I said. It's the ralink driver not the rt61 or rt2x00 (which seams to lack of entries in &proc/net/wireless as well...) one.
Comment 5 Roy Marples (RETIRED) gentoo-dev 2007-10-09 18:02:47 UTC
Our mobile team could try and patch the driver. If they can't then they will close this as UPSTREAM.

You could try on the rt2x00 forums.
Comment 6 Martin Kramer 2007-10-14 10:28:37 UTC
I've done some more research, and as far as I can tell ralink-rt61 desperately tries to be a "normal" network card rather then being a wlan card. I've compared the /sys/class/net/${dev}/ directory of both the ra0 and eth0 interface. They look practically the same

# ls -li /sys/class/net/{eth0,ra0}/
/sys/class/net/eth0/:
insgesamt 0
5603 -r--r--r-- 1 root root 4096 14. Okt 12:19 address
5597 -r--r--r-- 1 root root 4096 14. Okt 12:19 addr_len
5604 -r--r--r-- 1 root root 4096 14. Okt 12:19 broadcast
5605 -r--r--r-- 1 root root 4096 14. Okt 12:19 carrier
5595 lrwxrwxrwx 1 root root    0 14. Okt 12:19 device -> ../../../devices/pci0000:00/0000:00:04.0
5606 -r--r--r-- 1 root root 4096 14. Okt 12:19 dormant
5600 -r--r--r-- 1 root root 4096 14. Okt 12:19 features
5609 -rw-r--r-- 1 root root 4096 14. Okt 12:19 flags
5599 -r--r--r-- 1 root root 4096 14. Okt 12:19 ifindex
5598 -r--r--r-- 1 root root 4096 14. Okt 12:19 iflink
5602 -r--r--r-- 1 root root 4096 14. Okt 12:19 link_mode
5608 -rw-r--r-- 1 root root 4096 14. Okt 12:19 mtu
5607 -r--r--r-- 1 root root 4096 14. Okt 12:19 operstate
5636 drwxr-xr-x 2 root root    0 14. Okt 12:19 power
5612 drwxr-xr-x 2 root root    0 14. Okt 12:19 statistics
5594 lrwxrwxrwx 1 root root    0 14. Okt 12:19 subsystem -> ../../../class/net
5610 -rw-r--r-- 1 root root 4096 14. Okt 12:19 tx_queue_len
5601 -r--r--r-- 1 root root 4096 14. Okt 12:19 type
5593 -rw-r--r-- 1 root root 4096 14. Okt 12:19 uevent
5611 -rw-r--r-- 1 root root 4096 14. Okt 12:19 weight

/sys/class/net/ra0/:
insgesamt 0
6986 -r--r--r-- 1 root root 4096 14. Okt 11:55 address
6980 -r--r--r-- 1 root root 4096 14. Okt 11:55 addr_len
6987 -r--r--r-- 1 root root 4096 14. Okt 11:55 broadcast
6988 -r--r--r-- 1 root root 4096 14. Okt 11:55 carrier
6989 -r--r--r-- 1 root root 4096 14. Okt 11:55 dormant
6983 -r--r--r-- 1 root root 4096 14. Okt 11:55 features
6992 -rw-r--r-- 1 root root 4096 14. Okt 11:55 flags
6982 -r--r--r-- 1 root root 4096 14. Okt 11:55 ifindex
6981 -r--r--r-- 1 root root 4096 14. Okt 11:55 iflink
6985 -r--r--r-- 1 root root 4096 14. Okt 11:55 link_mode
6991 -rw-r--r-- 1 root root 4096 14. Okt 11:55 mtu
6990 -r--r--r-- 1 root root 4096 14. Okt 11:55 operstate
7019 drwxr-xr-x 2 root root    0 14. Okt 11:55 power
6995 drwxr-xr-x 2 root root    0 14. Okt 11:55 statistics
6979 lrwxrwxrwx 1 root root    0 14. Okt 11:55 subsystem -> ../../../class/net
6993 -rw-r--r-- 1 root root 4096 14. Okt 11:55 tx_queue_len
6984 -r--r--r-- 1 root root 4096 14. Okt 11:55 type
6978 -rw-r--r-- 1 root root 4096 14. Okt 11:55 uevent
6994 -rw-r--r-- 1 root root 4096 14. Okt 11:55 weight

I'm no expert for WLAN devices, but shouldn't the ralink directory look totally or at least a bit different? As you see there is no wireless file at all. And it get's even better. Upon checking /proc/net/dev I found out that ra0 appears there. Totally wrong place if you ask me.
Comment 7 Roy Marples (RETIRED) gentoo-dev 2007-10-14 10:34:15 UTC
(In reply to comment #6)
> I've done some more research, and as far as I can tell ralink-rt61 desperately
> tries to be a "normal" network card rather then being a wlan card. I've
> compared the /sys/class/net/${dev}/ directory of both the ra0 and eth0
> interface. They look practically the same

That sucks ass

> 
> I'm no expert for WLAN devices, but shouldn't the ralink directory look totally
> or at least a bit different? As you see there is no wireless file at all. And
> it get's even better. Upon checking /proc/net/dev I found out that ra0 appears
> there. Totally wrong place if you ask me.

Every network interface has an entry there, wireless or otherwise.
Comment 8 Martin Kramer 2007-10-14 10:59:58 UTC
> 
> Every network interface has an entry there, wireless or otherwise.
> 

OK. So the only real problem(s) is/are that ralink-rt61 refuses to create an entry in /proc/net/wireless and /sys/class/net/ra0/wireless. 

Reading through tons of forums posts I came across problems that older versions of the rt61 driver used to produced error msgs like this: "Driver using old /proc/net/wireless support, please fix driver !" Is /proc/net/wirelss deprecated? And if so could it be RaLink kicked out support for it but "forgot" to implement the /sys/class/net stuff?
Comment 9 Roy Marples (RETIRED) gentoo-dev 2007-10-14 12:05:22 UTC
(In reply to comment #8)
> Reading through tons of forums posts I came across problems that older versions
> of the rt61 driver used to produced error msgs like this: "Driver using old
> /proc/net/wireless support, please fix driver !" Is /proc/net/wirelss
> deprecated? And if so could it be RaLink kicked out support for it but "forgot"
> to implement the /sys/class/net stuff?
> 

/proc/net/wireless is deprecated, but only if the same stuff can be found in /sys somewhere. That's why we check for both, and currently onlt some ra drivers provide neither.
Comment 10 Martin Kramer 2007-10-14 12:34:46 UTC
(In reply to comment #9)
> 
> /proc/net/wireless is deprecated, but only if the same stuff can be found in
> /sys somewhere. That's why we check for both, and currently onlt some ra
> drivers provide neither.
> 

But wouldn't it be best to implement some "pretend-wireless" option tot the init scripts that just deactivates these tests for such cards? 
Comment 11 Roy Marples (RETIRED) gentoo-dev 2007-10-14 17:03:07 UTC
(In reply to comment #10)
> But wouldn't it be best to implement some "pretend-wireless" option tot the
> init scripts that just deactivates these tests for such cards?

No, it would be best to fix the driver.
Comment 12 Martin Kramer 2007-10-15 11:20:48 UTC
(In reply to comment #11)
>
> No, it would be best to fix the driver.
> 

Sorry. didn't want to sound rude. I just tried to come up with some ideas for workarounds until the driver gets fixed (if it will ever get fixed).
Comment 13 Jeremy Olexa (darkside) (RETIRED) archtester gentoo-dev Security 2009-09-04 02:00:20 UTC
removed from tree, wontfix