Broadcom reports "not ready"

New install, wireless has never worked. Let’s get straight to the vitals.


maint@craken:~> uname -a
Linux craken 2.6.31.8-0.1-default #1 SMP 2009-12-15 23:55:40 +0100 i686 athlon i386 GNU/Linux
 
craken:~ # lspci|grep Broadcom -
05:02.0 Network controller: Broadcom Corporation BCM4318 [AirForce One 54g] 802.11g Wireless LAN Controller (rev 02)

craken:~ # lsmod |grep b43 -
b43                   152956  0
ssb                    53576  1 b43
pcmcia                 42152  2 b43,ssb
mac80211              214776  1 b43
cfg80211              103584  2 b43,mac80211
led_class               4836  1 b43
pcmcia_core            41748  5 b43,ssb,pcmcia,yenta_socket,rsrc_nonstatic
c

Ok, it sees the card and the modules are load. Even the little light works.


craken:~ # dmesg|grep -E "b43|wlan0|phy0|80211" -
    8.768270] b43-pci-bridge 0000:05:02.0: PCI INT A -> GSI 20 (level, low) -> IRQ 20
    8.852413] cfg80211: Calling CRDA to update world regulatory domain
    8.901686] b43-phy0: Broadcom 4318 WLAN found (core revision 9)
    9.365915] phy0: Selected rate control algorithm 'minstrel'
   27.044111] b43 ssb0:0: firmware: requesting b43/ucode5.fw
   27.062810] b43 ssb0:0: firmware: requesting b43/pcm5.fw
   27.083878] b43 ssb0:0: firmware: requesting b43/b0g0initvals5.fw
   27.105223] b43 ssb0:0: firmware: requesting b43/b0g0bsinitvals5.fw
   27.244062] b43-phy0: Loading firmware version 410.2160 (2007-05-26 15:32:10)
   27.288594] Registered led device: b43-phy0::radio
   27.303484] ADDRCONF(NETDEV_UP): wlan0: link is not ready
[22777.901133] b43-pci-bridge 0000:05:02.0: PCI INT A disabled
[22811.468866] cfg80211: Calling CRDA to update world regulatory domain
[22811.875202] b43-pci-bridge 0000:05:02.0: PCI INT A -> GSI 20 (level, low) -> IRQ 20
[22811.954543] b43-phy0: Broadcom 4318 WLAN found (core revision 9)
[22812.021950] phy0: Selected rate control algorithm 'is minstrel'
[22817.044118] b43 ssb0:0: firmware: requesting b43/ucode5.fw
[22817.058740] b43 ssb0:0: firmware: requesting b43/pcm5.fw
[22817.075984] b43 ssb0:0: firmware: requesting b43/b0g0initvals5.fw
[22817.093016] b43 ssb0:0: firmware: requesting b43/b0g0bsinitvals5.fw
[22817.224065] b43-phy0: Loading firmware version 410.2160 (2007-05-26 15:32:10)
[22817.264508] Registered led device: b43-phy0::radio
[22817.272652] ADDRCONF(NETDEV_UP): wlan0: link is not ready

Much the same info except the last. The device never comes up. I’ve conviced myself it’s not a configuration problem. Network Manager never reports the device as ready. Even if disable NM and set all the link parameters manually the link never reports as ready. It scans ok.


craken:/ # iwlist scan
lo        Interface doesn't support scanning.

eth0      Interface doesn't support scanning.

wmaster0  Interface doesn't support scanning.

wlan0     Scan completed :
          Cell 01 - Address: 00:0D:88:9A:8E:32
                    Channel:1
                    Frequency:2.412 GHz (Channel 1)
                    Quality=70/70  Signal level=-40 dBm
                    Encryption key:on
                    ESSID:"Roc"
                    Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 11 Mb/s
                    Mode:Master
                    Extra:tsf=000000138c9c79f0
                    Extra: Last beacon: 1328ms ago
                    IE: Unknown: 0003526F63
                    IE: Unknown: 010482840B16
                    IE: Unknown: 030101
                    IE: Unknown: 0406000200000000



craken:~ # ip link show wlan0
6: wlan0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast state DOWN qlen 1000
    link/ether 00:14:a5:13:ea:f4 brd ff:ff:ff:ff:ff:ff

That is my router. Note it’s old-school 802.11b and because of that I spent a lot of time thinking it was just a configuration issue but I keep coming back to where dmesg says the device is not ready.

The NM applet just shows a little progress bar stuck at 90%.

One time it popped up reporting a link and asking for authentication. When I typed in the router key wireless worked but I haven’t been able to reproduce that brief success and I didn’t think to capture any dmesg at that point. This all makes me think there is some kind of timeout issue in the driver.

What say you? How do I proceed in debugging this?

OK, made some progress by disabling NM and using a HEX key instead of an ascii one. /etc/sysconfig doesn’t like ascii keys. Doesn’t explain why my previous efforts to use an open link didn’t work. Anyway, wlan0 shows up, I need to get the link address set and a route programed. Time to dig out my notes on networking 101. Once I get my link configure manually I’ll go back and try NM again.

Question, what is the proper IP command for attaching the host address to the device? I read the man page but I get all confused.

is any of swerdna’s guide of help to you?

HowTo Configure a network card in Suse/openSUSE 10, 11 for LAN and Internet Access.

Thanks for the link pdc_2. I’ll check it out.

Unfortunately, the guide depends on NetworkManager which, in my case, only reports “device not ready”.

I’ve now got the device up and sending packets via ifconfig and iwconfig but I’m trying to migrate to ip only I when I type in what I think to be valid ip commands I get syntax errors. I’ll puzzle it out but I’d like to know what the proper ip syntax is to associate an address with a device.

Here is what I got so far. Note the error “file exists”. I don’t know if it’s complaining the address exists, it doesn’t, or the device exists, which of course it does, but I don’t see where it has and address associated with it and I can’t seem to set one.

Here’s what I got so far.


craken:~ # sh -x src/wireless.sh
+ ip link set wlan0 down
+ ip link set eth0 down
+ iwconfig wlan0 mode Ad-Hoc
+ iwconfig wlan0 ap 00:0D:88:9A:8E:32
+ iwconfig wlan0 essid Roc
+ iwconfig wlan0 channel 1
+ iwconfig wlan0 rate 11M auto
+ iwconfig wlan0 key '[1]'
+ iwconfig wlan0 key 616E-7469-6D61-676E-6574-3636-36
+ iwconfig wlan0 txpower on
+ ip addr add 192.168.1.19 dev wlan0
RTNETLINK answers: File exists
+ route delete 192.168.1.0 dev eth0
SIOCDELRT: No such process
+ route add 192.168.1.0 dev wlan0
SIOCADDRT: Network is down
+ route add default gw 192.168.1.10
SIOCADDRT: No such process
+ sleep 2
+ iwconfig wlan0
wlan0     IEEE 802.11bg  ESSID:"Roc"
          Mode:Ad-Hoc  Frequency:2.412 GHz  Cell: 00:0D:88:9A:8E:32
          Tx-Power=20 dBm
          Retry  long limit:7   RTS thr:off   Fragment thr:off
          Encryption key:616E-7469-6D61-676E-6574-3636-36
          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

+ ip link show wlan0
4: wlan0: <BROADCAST,MULTICAST> mtu 1500 qdisc pfifo_fast state DOWN qlen 1000
    link/ether 00:14:a5:13:ea:f4 brd ff:ff:ff:ff:ff:ff

Not the error "RTNETLINK answers: File exists
". Can’t remember whether that implies the address is defined, which it isn’t or the device is defined, which of course it is, I just want to set the address.

Ok, finally got this card working but just with manual scripts not with NetworkManager. It was a comedy of errors, mostly.

NetworkManager refuses to try and change the wireless channel. Right now it’s stuck on ch. 11 and I don’t know why. I’ve no problem listing and setting the channel through iwconfig.

The last is important because my neighbor has his AP wide open ( and his power on max. ) So during debugging, when I turned off authorization, his AP would take on my SSID! This caused no end of confusion until I finally aquired clue and changed the channel on my router. That is when I saw my own, unique, SSID still being broadcast on the other channel!

Now I’m in the habbit of locking down my router pretty tight. I only allow a range of about 32 addresses to connect, ( 16 for static hosts and 16 for dynamic hosts. ) This was causing the router to regect my connection attempts because I wasn’t setting the src address on the routes when using ip.

If you look at the routes I set you’ll see a static /32 route to the router. This seems to be needed for the wireless to work but not for a wired connection. I don’t know if this is related to source address issue or a separate problem. I haven’t spent any time tracking it down.

Here is the bash script I use to bring up wireless. You can see that I’m doing anything fancy. Other than the points above I just set the device parameters, assign addresses and then create some routes. It’s frustrating that I can’t make NetworkManager do this simple configuration task. In my book it’s NRFPT ( Not Ready For Prime Time. ) A big issue with NM is the way it just sits there when it doesn’t like the card configuration. All input and no output. It’s like a script over a script over a script. I never would have got my problem solved trying to guess what NM was waiting for.

#!/bin/bash                          
#                                    
# wireless.simple.sh                 
#                                    
# for ip syntax see /usr/share/doc/packages/iproute2/ip-cref.pdf


verbose=1
myname="craken1"
wire="eth0"     
wireless="wlan0"
device="dev $wireless"
hobbits="192.168.1.0" 
myadd="192.168.1.19"  
loadd="127.0.0.2"     
prefix="/24"          
gatew="192.168.1.10"  
local_opts="broadcast + scope host"
link_opts="scope global proto static"
dhcp_eth0="/var/run/dhcpcd-eth0.pid" 
dhcp_wlan0="/var/run/dhcpcd-wlan0.pid"

killdhcp () { # 1:interface
    if  -e $dhcp_$1 ]     
    then                   
        kill -TERM `cat $dhcp_$1` 
        return 0                  
    else                          
        echo "DHCP Daemon not found"
        return 1                    
    fi                              
}                                   

# teardown
killdhcp eth0
killdhcp wlan0
ip link set $wireless down
ip link set $wire down    

# Configure wireless device
iwconfig wlan0 mode managed
iwconfig wlan0 ap "00:0D:88:9A:8E:32"
# iwconfig wlan0 ap any
iwconfig wlan0 essid "Roc_1.0"
iwconfig wlan0 channel 6
# iwconfig wlan0 modu 11b    # not supported
iwconfig wlan0 rate 11M auto
iwconfig wlan0 key [1]
iwconfig wlan0 key 616a-bunc-hofh-exdi-gits-here-36
iwconfig wlan0 key on
iwconfig wlan0 txpower on

# Assign an address to the device and bring it up
ip addr replace $myadd$prefix $device $local_opts
ip link set $wireless up

# Assign a loopback address in case we don't have one
ip addr add $loadd/8 dev lo label lo:localhost $local_opts # loopback address

# Create routes to the outside
ip route add $hobbits$prefix $link_opts src $myadd $device
ip route add ${gatew}/32  scope link src $myadd $device   # I understand the router needing
# this but is it normal to be here? Without it the next command complains.
#
# The src tag here is very important otherwise the router rejects the packets as not
# from our network
ip route replace default $link_opts via $gatew src $myadd $device
ip route flush cache

# Optionally, display the changes
if  $verbose -eq 1 ]
then
    ifstatus $wireless
    netstat -rn
fi

exit 0
# End of script



craken:~ # ifconfig wlan0
wlan0     Link encap:Ethernet  HWaddr 00:14:A5:13:EA:F4
          inet addr:192.168.1.19  Bcast:192.168.1.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:17301 errors:0 dropped:0 overruns:0 frame:0
          TX packets:16947 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:18125872 (17.2 Mb)  TX bytes:2789834 (2.6 Mb)

craken:~ # ip route show
192.168.1.10 dev wlan0  scope link  src 192.168.1.19
192.168.1.0/24 dev wlan0  proto kernel  scope link  src 192.168.1.19
127.0.0.0/8 dev lo  scope link
default via 192.168.1.10 dev wlan0  proto static  src 192.168.1.19
craken:~ #