# How to enable wireless card?

## rainer

I have a beautiful new notebook (Belinea made by Compal) and want to free it from the network cable.

It has a built-in wireless card Intel 3945ABG Golan that I can see with lspci and iwconfig.

It is, however, not active, i.e. I don't see it with ifconfig, and "ifconfig wlan0 up" gives me error 132. 

And unfortunately, the machine does not have a switch on the outside to enable it.

There is the usual <Fn+F2> combination but apparently it needs Windows to work.

Is there a way to switch the card on without installing Windows? I did google but probably my search keywords were too unspecific, I did not find anything useful.

Thanks for help,

Rainer

----------

## aCOSwt

Hello,

1/ The driver you need will be built with your kernel (from 2.6.24) if CONFIG_IWL3945 is activated.

2/ You should additionally need a firmware to download from http://intellinuxwireless.org/ and put it under /lib/firmware.

In order to activate the device, I would rather look behind /proc/acpi/... or /proc/net/...

then something like 

echo 1 > /proc/....

should be able to activate your device.

----------

## rainer

aCOSwt, thanks a lot, but I don't think the driver is the problem. iwl3945 is built into the kernel and shows up when I ask with modprobe. 

I have a very similar machine for my other daughter, which is dual boot with Windows, and here, switching the WLAN Card on under Ẃindows was the solution. The WLAN card itself works perfectly well, once it is on.

I think my question really is: Is there a bash command that replaces the physical switch or the <Fn+F2> key combination?

My second daughter doesn't need Windows, I'd love to avoid installing it just for the sake of switching the network card on...

Thanks for any hint,

Rainer

Edit: Sorry I should have mentioned that I did not find anything under /proc that looked like my WLAN card (I didn't see the Ethernet card either, maybe I'm not understanding enough what I should be looking for...). I'm not completely dumb but this as an area where I've never been before...

----------

## aCOSwt

Have you looked around /proc/acpi/manufacturer/wireless ?

----------

## rainer

No manufacturer folder:

```
~ # dir /proc/acpi

ac_adapter  battery  button  dsdt  embedded_controller  event  fadt  fan  info  power_resource  processor  sleep  thermal_zone  video  wakeup

```

Under /proc/net there is a "file" called wireless but echoing 1 doesn't work:

```
~ # echo 1 > /proc/net/wireless

-bash: echo: write error: Input/output error

```

----------

## cach0rr0

hiya

'manufacturer' should in your case be replaced with your actual manufacturer

in terms of echoing "1" onto /proc/net/wireless...you can't do that. 

You can, however

```

cat /proc/net/wireless

```

at any rate, even with the driver in the kernel, you still need to install the firmware for that card - good news is it's in portage (no need to get it from the site mentioned previously)

```

* net-wireless/iwl3945-ucode

     Available versions:  

   (0)   2.14.1.5 15.28.1.6 15.28.1.8

   (1)   (~)15.28.2.8 15.32.2.9

     Homepage:            http://intellinuxwireless.org/?p=iwlwifi

     Description:         Intel (R) PRO/Wireless 3945ABG Network Connection ucode

```

with both the driver AND the firmware (ucode) installed, modprobe iwl3945, then check 

```

cat /proc/net/wireless
```

your interface should show up; for this example, call it wlan0

The next thing to ensure the *hardware* side of things is setup as it should be:

```

ifconfig wlan0 up

```

replacing wlan0 with whatever is appropriate of course. Check dmesg output once you've done that, and assuming no errors, we can progress further. 

Once that goes through without a hitch we can look at tweaking further

In terms of the button to turn it off and on, only things I've seen are the RF_KILL option in the kernel, which, from experience has been buggy as all hell.

----------

## rainer

Thanks, followed your advice and emerged ucode etc:

```

>>> Recording net-wireless/iwl3945-ucode in "world" favorites file...

>>> Auto-cleaning packages...

>>> No outdated packages were found on your system.

 * GNU info directory index is up-to-date.

hanna admin # modprobe iwl3945-ucode

FATAL: Module iwl3945_ucode not found.

hanna admin # modprobe iwl3945

hanna admin # lsmod |grep 3945

iwl3945                67744  0

iwlcore                80488  1 iwl3945

mac80211              108988  2 iwl3945,iwlcore

led_class               2644  2 iwl3945,iwlcore

cfg80211               64160  3 iwl3945,iwlcore,mac80211

hanna admin # modprobe -r iwl3945

hanna admin # lsmod | grep 3945

hanna admin # modprobe iwl3945

hanna admin # lsmod | grep 3945

iwl3945                67744  0

iwlcore                80488  1 iwl3945

mac80211              108988  2 iwl3945,iwlcore

led_class               2644  2 iwl3945,iwlcore

cfg80211               64160  3 iwl3945,iwlcore,mac80211

hanna admin # cat /proc/net/wireless

Inter-| sta-|   Quality        |   Discarded packets               | Missed | WE

 face | tus | link level noise |  nwid  crypt   frag  retry   misc | beacon | 22

 wlan0: 0000    0     0     0        0      0      0      0      0        0

hanna admin # ifconfig wlan0 up

SIOCSIFFLAGS: Unknown error 132

```

Here is the relevant (?) dmesg output:

```

hanna admin # dmesg | grep wireless

hanna admin # dmesg | grep 3945

[   88.056682] iwl3945: Intel(R) PRO/Wireless 3945ABG/BG Network Connection driver for Linux, 1.2.26ks

[   88.056685] iwl3945: Copyright(c) 2003-2009 Intel Corporation

[   88.056784] iwl3945 0000:01:00.0: PCI INT A -> GSI 16 (level, low) -> IRQ 16

[   88.056799] iwl3945 0000:01:00.0: setting latency timer to 64

[   88.126425] iwl3945 0000:01:00.0: Tunable channels: 13 802.11bg, 23 802.11a channels

[   88.126429] iwl3945 0000:01:00.0: Detected Intel Wireless WiFi Link 3945ABG

[   88.126578] iwl3945 0000:01:00.0: irq 29 for MSI/MSI-X

[   88.129365] phy0: Selected rate control algorithm 'iwl-3945-rs'

[12152.019685] iwl3945 0000:01:00.0: PCI INT A disabled

[12163.478628] iwl3945: Intel(R) PRO/Wireless 3945ABG/BG Network Connection driver for Linux, 1.2.26ks

[12163.478632] iwl3945: Copyright(c) 2003-2009 Intel Corporation

[12163.478722] iwl3945 0000:01:00.0: PCI INT A -> GSI 16 (level, low) -> IRQ 16

[12163.478741] iwl3945 0000:01:00.0: setting latency timer to 64

[12163.534106] iwl3945 0000:01:00.0: Tunable channels: 13 802.11bg, 23 802.11a channels

[12163.534111] iwl3945 0000:01:00.0: Detected Intel Wireless WiFi Link 3945ABG

[12163.534261] iwl3945 0000:01:00.0: irq 29 for MSI/MSI-X

[12163.546194] phy0: Selected rate control algorithm 'iwl-3945-rs'

```

Doesn't look that bad, except that the card is not "switched on"...

Thanks for more help, im really desparate (this is supposed to be a Christmas present...)

Rainer

----------

## rainer

Here is what the networkmanager plasmoid shows:

http://godesberg.homelinux.net/wlan.png

----------

## zlomek

Hi. you need in kernel 

```
Symbol: IWL3945 [=y]                                                                                                                   │  

  │ Prompt: Intel PRO/Wireless 3945ABG/BG Network Connection (iwl3945)                                                                     │  

  │   Defined at drivers/net/wireless/iwlwifi/Kconfig:91                                                                                   │  

  │   Depends on: NETDEVICES [=y] && WLAN [=y] && IWLWIFI [=y]                                                                             │  

  │   Location:                                                                                                                            │  

  │     -> Device Drivers                                                                                                                  │  

  │       -> Network device support (NETDEVICES [=y])                                                                                      │  

  │         -> Wireless LAN (WLAN [=y])                                                                                                    │  

  │           -> Wireless LAN (IEEE 802.11) (WLAN_80211 [=y])                                                                              │  

  │             -> Intel Wireless Wifi (IWLWIFI [=y])    
```

install

```
net-wireless/iwl3945-ucode

```

and for example 

```
net-misc/wicd

```

 to run wifi

Pozdrawiam zlomek

----------

## gcyoung

A related problem! Help!!

I have recently obtained a Toshiba “Equium” laptop into which I have installed

a pcmia wireless card which uses an Atheros Ethernet controller (AR5007G).

I did a quick Ubuntu setup to find out the hardware and it all works fine on that, so I know the hardware will function, but as a confirmed Gentoo user I want to set it up with a Gentoo system.

I have followed the various (and varied!) manuals and notes, manual pages etc. that are available on the internet, with the following results (xxxxxxxx to replace passwords and ssid's). I find this gives me a signal, but I am unable to 

make any connections, although “ifconfig” will setup an IP address I cannot access anything on my network or the internet. (The failure is not due to a lack of nameserver, I have that set up.

I have also disabled and removed my “wired” connection to prevent that affecting anything. The madwifi I have installed is madwifi-hal-0.10.5.6-r4100-20090929 

which I understand to be suitable for the wireless care I have installed.

The messages I receive are:

		“Waiting for association

		 Backgroounding”

I am new to wireless networking and would be grateful if anyone knowledgeable could look at the setup below and advise where I am going wrong. I don't think the fault lies in my kernel, since I have set all the CONFIG options recommended by the various documents I have read.

“NET” FILE SETTINGS

…...............................................................................

modules=( "wpa_supplicant" )

wpa_supplicant_ath0="-Dmadwifi"

iwconfig_ath0="mode managed"

key_ESSID1="[1] s:xxxxxxxxxxxxxx [1] enc open"

key_ESSID2="[2] s:xxxxxxxxxxxxxx [1] enc restricted"

preferred_apps=( "ESSID1" "ESSID2" )

config_ESSID1=( "192.168.1.4 brd 192.168.1.255" )

routes_ESSID1=( "default via 192.168.1.1" )

#

config_ESSID2=( "dhcp" )

fallback_ESSID2=( "192.168.1.6/24" )

fallback_route_ESSID2=( "default via 192.168.1.1" )

WPA_APPLICANT.CONF SETTINGS.

…..............................................................................

 WPA-PSK/TKIP

ctrl_interface=/var/run/wpa_supplicant

update_config=1

ap_scan=1

network={

	ssid="xxxxxxxxxxxxxxxxx"

	key_mgmt=WPA-PSK

#	scan_ssid=1

	proto=WPA

	pairwise=TKIP

	group=TKIP

	psk="s:xxxxxxxxxxxxxxxxxx”

	priority=5

}

network={

	ssid="xxxxxxxxxxxxxxx"

	proto=WPA

	key_mgmt=WPA-PSK

	pairwise=TKIP

	group=TKIP

	psk="xxxxxxxxxx"

	priority=2

}Last edited by gcyoung on Sat Dec 26, 2009 11:45 pm; edited 1 time in total

----------

## cach0rr0

rainer, 

check this real quick:

```

zgrep RFKILL /proc/config.gz

```

RFKILL is known to be very buggy. If you have 

CONFIG_RFKILL=y

, go back into menuconfig, and change it to 

#CONFIG_RFKILL is not set

(meaning, untick it in menuconfig)

Do that, rebuild your kernel, install it as you would normally, and go from there. I am betting that is what's breaking things.

(and if that works, you can thank me by finding the idiot who decided to put nuts on key lime pie, strangling them, and making it publicly known this is an offence punishable by death)

----------

## rainer

catch0rr0, thanks for the precise instruction - I did indeed find

```

CONFIG_IWL3945_RFKILL=y

```

and I will set this to "n".

However, in the meantime, I had repartitioned and used 40G of the 400g to install WinXP on /dev/sda1. As it turns out, Windows, with all custom drivers installed, has the same problem, so that I start to believe it's a hardware problem. As briefly mentioned at some point, we have an almost identical machine in the family (hard- and software 18 months older, though...), and here, everything works perfectly fine.

I think that I should follow that route first before using your time end effort even more.

Thanks very much so far,

Rainer

PS: I'll try to find that idiot anyway...

----------

## aCOSwt

Would'nt your wireless system be (de)activable in the bios ?

----------

## gcyoung

Thanks CacheOrrO for your advice, but I had already been down that road. I don't have RFKILL set. The  problem for me seems one of failure to "associate" .As indicated, I have Ubuntu set up on a separate partion on the same machine and the tail of dmesg there reads:

"wlan0: athenticated with AP xxxxxxxxxxxxxx

wlan0: athenticated

wlan0: associated with "xxxxxxxxxxxxxxx"

wlan0: RX AssocRespc from "xxxxxxxxxxxxxxxxx"

wlan0: associated"

I note that Gentoo initiates the device as wlan0 but changes to ath0 on reboot.

"/etc/init.d/net.ath0 start" (or restart) only gets as far as:

"waiting for association

backgrounding"

"iwconfig" shows up with the correct ESSID and if I use "ifconfig ath0 192.168.1.4 etc" from a bash teminal it takes the static address that I give but will not connect.

I tried the gentoo madwifi program originally but couldn't get that to work and assumed it didn't like my Atheros chip so I looked on the internet and found the one I am using which was stated as capable of working with my card.

My gentoo "dmesg" recognises the pci card and the modulles, but nothing about association, so it must be there that the problem lies.

I note that the wireless applet that comes with gnome shows a strong signal, so there must be some connection, but states that ath0 is "disconnected"

This is all very frustrating, as I'm sure it is a simple matter, if I just understood more about how wifi works! Cable seems so simple by comparison.

----------

## rainer

aCOSwt, thanks for the hint, but I have checked this - no way to access the wireless card in the BIOS settings.

It'll take a few days to find out but I'm convinced that tit's a hardware problem, really!

----------

## gcyoung

My problem might be solved. I have been making it too complicated. It seems I may not need wpa supplicant and madwifi to connect. A straightforward  "modules=( "iwconfig" ) plus essid number and key in my /etc/conf.d/net file seems to do the trick.

The only problem now is that I still can't connect to any networks as; according to dmesg wlan0 (ath0 is not the required device with this setup)  associates with an AP and then immediately disassociates, giving ( Reaon: 1) as the whyfor. 

Can anyone explain Reason 1? Has it to do with passwords?

----------

## cach0rr0

 *gcyoung wrote:*   

> 
> 
> "wlan0: athenticated with AP xxxxxxxxxxxxxx
> 
> wlan0: athenticated
> ...

 

Yours is a completely different issue. For starters:

-atheros cards are well supported using nothing but in-kernel drivers. There should be no need to snag external packages. 

-if you use in-kernel drivers, it will be wlan0; ath0 is for madwifi-ng. The fact that it gets renamed tells me udev is acting up - go into /etc/udev/rules.d and look for 

```

 KERNEL=="ath*", NAME="wlan0"

```

change to

```

 KERNEL=="wlan*", NAME="wlan0"

```

or...you could just remove that file (or comment stuff out if you're uncomfortable removing it), reboot, and it should be fixed so that at least the name is correct. 

 *gcyoung wrote:*   

> 
> 
> "iwconfig" shows up with the correct ESSID and if I use "ifconfig ath0 192.168.1.4 etc" from a bash teminal it takes the static address that I give but will not connect.
> 
> 

 

don't bother with that. Sort out the udev issue first. If the problem persists, then see if you can get wpa_supplicant to associate by hand - configure your wpa_supplicant.conf (outside the scope of this post), then do this in `screen`:

```
wpa_supplicant -Dwext -i wlan0 -c /etc/wpa_supplicant/wpa_supplicant.conf
```

exit the `screen` session, but  leave it running. 

Then fire off your dhcp client and see if you can get an address. 

If you absolutely must do this by hand, remember you need to give it an IP, broadcast, netmask...AND a default gateway - be willing to bet you forgot the `route`

----------

## cach0rr0

 *rainer wrote:*   

> aCOSwt, thanks for the hint, but I have checked this - no way to access the wireless card in the BIOS settings.
> 
> It'll take a few days to find out but I'm convinced that tit's a hardware problem, really!

 

yip, if RFKILL didn't do it, I'm out of ideas, and you're pretty much out of things you can try if it's nothing in the OS, and nothing you can see in the BIOS. 

Maybe check and see if there is a BIOS update for this laptop? Last thing I can think of really.

----------

## gcyoung

Cacch0rr0

Followed your advice to the letter (Nb broadcast, netmask routes, resolv.conf, hosts,hosts.deny,hosts,allow etc, are all understood by me and  setup  :-- also eth0 deleted from setup).

You were correct about udev, so  I corrected that, setup wpa_supplicant.conf with a minimal setup, and entered the command line you suggested.

The result, in brief, was that the IP was recognised, and association made, but then dissassociated and the following error message issued:

      'WPA:4-way handshake failed -preshared key may be incorrect'

Which suggests the psk key I entered is is incorrect;--BUT I know that is not so.

Do you have any ideas on this? I have spent so much time on this that I am almost considering a peramanent Ubuntu setupt!!

----------

## cach0rr0

gotcha RE: your understanding of the routing bits

so for the wpa_supplicant stuff...what's your wpa_supplicant.conf look like?

I use a very simplistic one

```

network={

               ssid="amnotawirelessnetwork"

               scan_ssid=1

               key_mgmt=WPA-PSK

               psk="pA$$w0rD"

}
```

(obviously I changed my details)

Other things to look at - consider removing lib80211 from the kernel if you have it in there. select only cfg80211 and mac80211 (don't know if that's a cause, but is a best practice AFAIK)

----------

## gcyoung

The result is always the same. I have meticulously followed the Gentoo manual, and the Gentoo Wiki on setting up wifi, and I always get into a loop of association/disassociation. Looking around on other forums it would seem that this is not uncommon, and I have seen no reports of any solution other than a change of kernel version. It would seem, therefore, that the problem must lie in the kernel.

Since there seems little use for me in having a laptop that's tied to a cable connection,  Ive decided to stick with what was my "testing" Ubuntu installation for the moment, since, although I don't like Ubuntu's tendency towards a "windows like" habit of reducing choice, at least it works! I shall look closely at it, and see if I can follow how it's wifi setup varies from my Gentoo setup, if I can.

Many thanks cach0rr0 for your attempts to help.

----------

