# iwl3945: Failed to register network device (error -12)

## nader emami

Hello,

I have recently compiled the new kernel (kenrenl-2.6.24-gentoo-r8 ) in relation of the wireless of my laptop (ipw3945). The 

```
dmesg | grep iwl
```

 gives the next result:

 *Quote:*   

> 
> 
> iwl3945: Intel(R) PRO/Wireless 3945ABG/BG Network Connection driver for Linux, 1.1.17k
> 
> iwl3945: Copyright(c) 2003-2007 Intel Corporation
> ...

 

It seems that the wireless has been found, but I have yet no wireless connection, because of the error I suppose.

Would somebody tell me what is the problem and how I can solve it?

Besides the 

```
dmesg | grep eth
```

 gives the next message:

 *Quote:*   

> 
> 
> eth0: RTL8101e at 0xe0036000, 00:16:d4:25:5a:b2, XID 34000000 IRQ 223
> 
> Driver 'sd' needs updating - please use bus_type methods
> ...

 

That means that the eth1 is assigned to the wired network interface.

How can I find the wireless network interface, eth2!?

with regards,

Nader

----------

## sonicbhoc

Did you use genkernel or did you compile by hand?

----------

## nader emami

I have done it manually and not with genkernel! It there different between them?

----------

## IvanMajhen

Do you have this selected under Cryptographic API                                                                                               

```

                                               < >   Sequence Number IV Generator                                                                                     

                                                -*-   Cryptographic algorithm manager                                                                                 

                                                -*-   HMAC support                                                                                                   

                                                < >   XCBC support                                                                                                   

                                                < >   Null algorithms                                                                                                 

                                                <*>   MD4 digest algorithm                                                                                         

                                                -*-   MD5 digest algorithm                                                                                           

                                                -*-   SHA1 digest algorithm                                                                                           

                                                < >   SHA224 and SHA256 digest algorithm                                                                           

                                                < >   SHA384 and SHA512 digest algorithms                                                                           

                                                < >   Whirlpool digest algorithms                                                                                     

                                                < >   Tiger digest algorithms                                                                                         

                                                < >   GF(2^128) multiplication functions (EXPERIMENTAL)                                                               

                                                {*}   ECB support                                                                                                     

                                                -*-   CBC support                                                                                                     

                                                < >   PCBC support                                                                                                     

                                                < >   LRW support (EXPERIMENTAL)                                                                                       

                                                < >   XTS support (EXPERIMENTAL)                                                                                     

                                                < >   CTR support                                                                                                     

                                                < >   GCM/GMAC support                                                                                                 

                                                < >   CCM support                                                                                                     

                                                < >   Software async crypto daemon                                                                                     

                                                -*-   DES and Triple DES EDE cipher algorithms                                                                         

                                               < >   FCrypt cipher algorithm                                                                                         

                                               < >   Blowfish cipher algorithm                                                                                       

                                               < >   Twofish cipher algorithm                                                                                         

                                                < >   Twofish cipher algorithms (i586)                                                                                 

                                               < >   Serpent cipher algorithm                                                                                         

                                                -*-   AES cipher algorithms                                                                                           

                                               <*>   AES cipher algorithms (i586)         

                                                 < >   CAST5 (CAST-128) cipher algorithm                                                                               

                                                 < >   CAST6 (CAST-256) cipher algorithm                                                                               

                                                 < >   TEA, XTEA and XETA cipher algorithms                                                                             

                                                 {*}   ARC4 cipher algorithm                                                                                           

                                                 < >   Khazad cipher algorithm                                                                                         

                                               < >   Anubis cipher algorithm                                                                                         

                                               < >   SEED cipher algorithm                                                                                           

                                              < >   Salsa20 stream cipher algorithm (EXPERIMENTAL)                                                                   

                                                  < >   Salsa20 stream cipher algorithm (i586) (EXPERIMENTAL)                                                           

                                                  -*-   Deflate compression algorithm                                                                                   

                                                  <*>   Michael MIC keyed digest algorithm                                                                             

                                                  < >   CRC32c CRC algorithm                                                                                             

                                                  < >   Camellia cipher algorithms                                                                                       

                                                  < >   Testing module                                                                                                   

                                                  -*-   Authenc support                                                                                                 

                                                  < >   LZO compression algorithm                                                                                       

                                                  [ ]   Hardware crypto devices  --->        
```

Not as modules.

----------

## nader emami

I don't know whether I have selected this option under Cryptographic API. Now I am at work and this evening I can check it at home. 

However thank you.

Nader

----------

## nader emami

Sorry, to answer lately. I have checked the Cryptographic  options and have set them as you said. Now the error disappeared:  

```
dmesg | grep iwl 
```

 *Quote:*   

>  iwl3945: Intel(R) PRO/Wireless 3945ABG/BG Network Connection driver for Linux, 1.1.17kds
> 
> iwl3945: Copyright(c) 2003-2007 Intel Corporation
> 
> iwl3945: Detected Intel PRO/Wireless 3945ABG Network Connection
> ...

 

And the iwconfig gives the next message:

 *Quote:*   

> lo        no wireless extensions.
> 
> eth1      no wireless extensions.
> 
> sit0      no wireless extensions.
> ...

 

But I haven't yet wireless connection. 

Would you tell me what I have to do more to get a wireless connection?

With regards,

NaderLast edited by nader emami on Wed Jun 04, 2008 8:59 pm; edited 1 time in total

----------

## pappy_mcfae

Try a .25 kernel. The .24 family has numerous noted problems with wireless.

Blessed be!

Pappy

----------

## IvanMajhen

Try:

ifconfig wlan0 up

iwconfig wlan0 txpower on

iwlist wlan0 scan --> this should find networks

iwconfig wlan0 essid yournetworkname key s:yourkey --> set your networks essid, if you have assci key then put s: before key

dhcpcd wlan0

This only works with wep key. For wpa  you need wpa_supplicant. 

Read this http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=4&chap=4

----------

## nader emami

Thank you. I would setup the wireless network via DHCP server. There are two method to setup wireless network, wpa_suppicant and wireless_tools. With which one can I do the setup? How can I get the key for wireless network if I want to setup this with wireless-tool?

Nader

----------

## pappy_mcfae

If you are going to use WPA encryption, you will need wpa_supplicant. If you use WEP, you can skirt by that. I'm not sure how it's done, but I know it is doable.

Blessed be!

Pappy

----------

## IvanMajhen

Just emerge wpa_supplicant with qt3 use flag. It is easiest.

Then you will get nice gui where you can scan for networks, enter wep/wpa keys and even connect to unencrypted networks.

Example for /etc/conf.d/net for wpa:

```
modules=( "wpa_supplicant" )

wpa_supplicant_wlan0="-Dwext"

wpa_timeout_wlan0=5

config_ZyXEL=( "192.168.1.23/24 brd 192.168.1.255" )

routes_ZyXEL=( "default gw 192.168.1.1" )

dns_servers_ZyXEL=( "195.29.150.3" "195.29.150.4" )

```

This is static configuration. If you have dhcp then you don't have to enter this. (last 3 lines)

Example for /etc/wpa_supplicant/wpa_supplicant.conf

```

ctrl_interface=/var/run/wpa_supplicant

ctrl_interface_group=wheel

update_config=1

network={

        ssid="ZyXEL"

        key_mgmt=NONE

        wep_key0=c5c5c2c2c2

}

```

If you are in wheel group than you can add networks from gui. If not, you can only select and connect to networks already defined.

Don't forget to link net.lo to net.wlan0

```
cd /etc/init.d

ln -s net.lo net.wlan0

```

----------

## nader emami

Hello, my apologize for the lately apply. I have done what you have said, but if I start the wireless :

```
/etc/init.d/net.wlan0 start 
```

It gives the next message:

 *Quote:*   

> * Starting wlan0
> 
>  *   Wireless radio has been killed for interface wlan0
> 
>  *   wpa_supplicant will launch, but not associate until
> ...

 

So I have to solve the last point. I don't know how!

Nader

----------

## IvanMajhen

It looks like your wlan radio is turned off.

Is your wireless turned on? Do you have some switch/led which indicates state of your wireless radio?

Also try

ifconfig wlan0 up

iwconfig wlan0 txpower on

and then try starting wireless.

----------

## nader emami

Hello, the wireless led is on, it is in the front of laptop. I have checked everything and seen that everything is OK! I will send the result of two commands: #dmesg | grep wlan0

 *Quote:*   

> ADDRCONF(NETDEV_UP): wlan0: link is not ready
> 
> wlan0: Initial auth_alg=0
> 
> wlan0: authenticate with AP 00:e0:98:4e:80:ca
> ...

 

And the second one is:iwconfig which gives the next one:

 *Quote:*   

> lo        no wireless extensions.
> 
> eth1      no wireless extensions.
> 
> sit0      no wireless extensions.
> ...

 

But if I restart the wlan0 again with /etc/init.d/net.wlan0 the next message appears 

 *Quote:*   

> * Stopping wlan0
> 
>  *   Bringing down wlan0
> 
>  *     Stopping dhcpcd on wlan0 ...                                       [ ok ]
> ...

 

Then I run iwconfig and the result is:

 *Quote:*   

> lo        no wireless extensions.
> 
> eth1      no wireless extensions.
> 
> sit0      no wireless extensions.
> ...

 

So after this operations txpower becomes off! Why I don'y know. I don't have yet wireless connection. Maybe I have to do some extra. I would appreciate well if somebody help me to solve this last step!

Regards,

Nader

----------

## IvanMajhen

Do you have this options selected in your kernel?

```
CONFIG_RFKILL=y

CONFIG_RFKILL_INPUT=y

CONFIG_RFKILL_LEDS=y

CONFIG_INPUT_POLLDEV=y
```

Can you connect to network manualy, (without init scripts)?

Also try adding this to /etc/conf.d/net

```

preup(){

    iwconfig wlan0 txpower on

}

```

.

and restart wireless.

----------

## nader emami

I have checked the ".config" file and seen it: # CONFIG_RFKILL is not set. In which section of .config file can I find this option? I will add the preup function in net file also.

Nader

----------

## IvanMajhen

Do not edit .config file directly. Use menuconfig and search function.

----------

## nader emami

I have found the nest options :

```
CONFIG_RFKILL=y

CONFIG_INPUT_POLLDEV=y

```

But not the other ones.

```
CONFIG_RFKILL_INPUT=y

CONFIG_RFKILL_LEDS=y

```

----------

## IvanMajhen

Last two are selected automatically.

----------

## nader emami

I have not found the CONFIG_RFKILL_LEDS but the other one well and I have compile the kernel with these options as module (M). But unfortunately I have no wireless connection. And if I start the net.wlan0 interface[/i] /etc/init/net.wlan0 restart it gives the next:

get yet the next message 

* *Quote:*   

>  Stopping wlan0
> 
>  *   Bringing down wlan0
> 
>  *     Shutting down wlan0 ...                                            [ ok ]
> ...

 

It is now a mysterious problem and I don't know whether I would take more time to solve it. I don't know any solution.

regards,

Nader

----------

## IvanMajhen

Does your

iwlist wlan0 scan

find networks?

Does your wpa_gui find networks?

I also have first message ioctl[SIOCSIWAUTH]: Operation not supported, but don't have second one.

What encryption are you using?

Can you connect from command line using wireless tools?

----------

## nader emami

The blow message is the result of iwlist wlan0 scan:

 *Quote:*   

> Cell 02 - Address: 00:E0:98:4E:80:CA
> 
>                     ESSID:"Untitled"
> 
>                     Mode:Master
> ...

 

It has been recognized during scan, with a off for Encryption. But about other question:

Does your wpa_gui find networks? I don't know about wpa_gui.

What encryption are you using? From the scanning the encrytion is off

Can you connect from command line using wireless tools? How can I do this or which command can I use to do this? 

Regards, 

Nader

----------

## IvanMajhen

You will have wpa_gui if you emerge wpa_supplicant with qt3 use flag:

```
[ebuild   R   ] net-wireless/wpa_supplicant-0.5.10  USE="dbus qt3 readline ssl -gnutls -gsm -madwifi -qt4" 704 kB

```

http://en.wikipedia.org/wiki/Wpa_supplicant

Yes, wpa_gui finds my networks. Currently using wep.

I already explained to you here here.

From your iwlist with wireless tools do:

```
ifconfig wlan0 up

iwconfig  wlan0 txpower on

iwconfig wlan0 essid Untitled

dhcpcd wlan0

```

----------

## nader emami

The  "wpa_supplicat-0.5.10" is masked for my system, because I use the ACCESS_KEYWORD="x86" in my /etc/make.conf file.

I think I didn't need this the wpa_gui at this moment. Besides I have installed the "wifi_radar" tool with which I can see the wireless activities, but I have to read more about it.  

The emerge -p net-wireless/wpa_supplicant-0.5.10" gives the next:

 *Quote:*   

> !!! All ebuilds that could satisfy "=net-wireless/wpa_supplicant-0.5.10" have been masked.
> 
> !!! One of the following masked packages is required to complete your request:
> 
> - net-wireless/wpa_supplicant-0.5.10 (masked by: ~x86 keyword)

 

Only If I want to install a masked package, do I have to do the next :

USE="~x86" emerge =net-wireless/wpa_supplicant-0.5.10

Regards,

Nader

----------

## IvanMajhen

Did you connect to you network with wireless tools? This way you can be sure that your wireless is working.

0.5.10 is masked for x86. 

Do:

```
emerge -pv wpa_supplicant
```

and post your result.

----------

## nader emami

I have done it and installed wpa-supplicat-0.5.7. Then I have done the next command sequentially :

ifconfig wlan0 up

iwconfig wlan0 txpower on

iwconfig wlan0 essid Untitled

dhcpcd wlan0

And for the last one I have got :

 *Quote:*   

> err, wlan0: timed out
> 
> warn, wlan0: using IPV4LL address 169.254.173.128
> 
> err, wlan0: Failed to lookup hostname via DNS: Name or service not known
> ...

 

I don't understand it more!

Regards,

Nader

----------

## IvanMajhen

But, were you associated? 

Post iwconfig output after setting essid.

----------

## nader emami

It is the result after "iwconfig wlan0 essid Untitled"

 *Quote:*   

> lo        no wireless extensions.
> 
> eth1      no wireless extensions.
> 
> sit0      no wireless extensions.
> ...

 

----------

## IvanMajhen

It looks like you are connected.

Dhcpcd should receive IP from router....

----------

## nader emami

Hello,

I am here again. After my work I have some time at home to do what with my laptop. I have now wireless connection actually!

I would appreciate you for your time and advice to solve my problem. 

I have still two more question in relation with wired and wireless connection. I would ask these question. 

During booing I have seen these two messages: the first one is foe wireless and the other one is for wired connection.

 *Quote:*   

> 1- ioctl[SIOCSIWAUTH]: Operation not supported
> 
> WEXT auth param 4 value 0x0 - ioctl[SIOCSIWAUTH]: Operation not supported [ ok ]th param 5 value 0x1 - 
> 
> wlan0: Failed to lookup hostname via DNS: Name or service not known

 

 *Quote:*   

> 2 - eth1: Failed to lookup hostname via DNS: Name or service not known

 

Do you have any suggestion about these message?

Regards,

Nader

----------

## IvanMajhen

Which version of dhcpcd do you have?

----------

## nader emami

The equery l dhcpcd gives this:

 *Quote:*   

> net-misc/dhcpcd-3.2.3

 

----------

## IvanMajhen

Try different versions. I  have 4.0.0_beta5, but dont know if this works on stable arch. (too much ~x86 depencies)

----------

