# Connecting to wireless networks with ipw3945 & ndiswrapper

## Pobega

After failing to get the ipw3945 and iwl3945 drivers working, I decided to try the ndiswrappers route. Everything seems to work, except that dhcpcd times out when I try to connect to my network. After consulting with a friend on IRC (not #gentoo) he told me a bit of information I've never even heard of...

 *Quote:*   

> 20:49 < pobega> The freaking card works, I'm able to scan for networks, 
> 
>                 but I can't connect  because dhcpcd times out
> 
> 20:49 <@Alvin^> better smash some tables
> ...

 

Can someone explain to me what he means, and walk me through getting it working? I just want my wireless to work!Last edited by Pobega on Sat Jun 21, 2008 4:30 am; edited 1 time in total

----------

## Pobega

Note: I actually ended up getting my wireless working by running "dhcpcd wlan0", but now I need to do it at every boot. Is there any way to set up wpa_supplicant to run that after associating my interface with my router?

----------

## pappy_mcfae

If you are using ndiswrapper, you must use a .22 or a .25 kernel. If you are using a .23 or .24 kernel, you will either get tenuous connections, or none at all...more so the latter. The .22 kernels also tend to play nice with wpa_supplicant.

Blessed be!

Pappy

----------

## d2_racing

Can you post your lspci, because if you have a IPW3945ABG, there is no reason at all that the iwl3945 will not work. Maybe that you can retry and I think that we can figure what is going on.

----------

## Pobega

 *d2_racing wrote:*   

> Can you post your lspci, because if you have a IPW3945ABG, there is no reason at all that the iwl3945 will not work. Maybe that you can retry and I think that we can figure what is going on.

 

```
ackbar pobega # lspci

00:00.0 Host bridge: Intel Corporation Mobile 945GM/PM/GMS, 943/940

GML and 945GT Express Memory Controller Hub (rev 03)

00:02.0 VGA compatible controller: Intel Corporation Mobile 945GM/G

MS, 943/940GML Express Integrated Graphics Controller (rev 03)

00:02.1 Display controller: Intel Corporation Mobile 945GM/GMS, 943

/940GML Express Integrated Graphics Controller (rev 03)

00:1b.0 Audio device: Intel Corporation 82801G (ICH7 Family) High D

efinition Audio Controller (rev 02)

00:1c.0 PCI bridge: Intel Corporation 82801G (ICH7 Family) PCI Expr

ess Port 1 (rev 02)

00:1c.1 PCI bridge: Intel Corporation 82801G (ICH7 Family) PCI Expr

ess Port 2 (rev 02)

00:1c.2 PCI bridge: Intel Corporation 82801G (ICH7 Family) PCI Expr

ess Port 3 (rev 02)

00:1d.0 USB Controller: Intel Corporation 82801G (ICH7 Family) USB 

UHCI Controller #1 (rev 02)

00:1d.1 USB Controller: Intel Corporation 82801G (ICH7 Family) USB 

UHCI Controller #2 (rev 02)

00:1d.2 USB Controller: Intel Corporation 82801G (ICH7 Family) USB 

UHCI Controller #3 (rev 02)

00:1d.3 USB Controller: Intel Corporation 82801G (ICH7 Family) USB 

UHCI Controller #4 (rev 02)

00:1d.7 USB Controller: Intel Corporation 82801G (ICH7 Family) USB2

 EHCI Controller (rev 02)

00:1e.0 PCI bridge: Intel Corporation 82801 Mobile PCI Bridge (rev 

e2)

00:1f.0 ISA bridge: Intel Corporation 82801GBM (ICH7-M) LPC Interfa

ce Bridge (rev 02)

00:1f.2 IDE interface: Intel Corporation 82801GBM/GHM (ICH7 Family)

 SATA IDE Controller (rev 02)

00:1f.3 SMBus: Intel Corporation 82801G (ICH7 Family) SMBus Control

ler (rev 02)

03:00.0 Network controller: Intel Corporation PRO/Wireless 3945ABG 

Network Connection (rev 02)

05:01.0 FireWire (IEEE 1394): Ricoh Co Ltd R5C832 IEEE 1394 Control

ler

05:01.1 SD Host controller: Ricoh Co Ltd R5C822 SD/SDIO/MMC/MS/MSPr

o Host Adapter (rev 19)

05:01.2 System peripheral: Ricoh Co Ltd Unknown device 0843 (rev 01

)

05:01.3 System peripheral: Ricoh Co Ltd R5C592 Memory Stick Bus Hos

t Adapter (rev 0a)

05:07.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL-81

10SC/8169SC Gigabit Ethernet (rev 10)
```

----------

## Pobega

Well I am running a new kernel and the deprecated ipw3945 drivers (patched to work on >=kernel-2.6.24) but I'm having the same problem. I see eth1, I can scan networks, I can associate with them, but once I try to run a DHCP client on the interface it times out. Is there any way to see what the problem is specifically?

----------

## d2_racing

First, you need to remove all of your ipw3945d program, because you need to use the new Iwl3945 driver.

After that, we can help you to make this thing work  :Smile: 

----------

## jeanfrancis

I agree with d2_racing, you should abandon any ipw3945 driver or ndiswrapper, iwlwifi will continue to work an will be upgraded, so switching now will avoid you many problems in the future  :Wink: 

First, get rid of any ipw3945 or ndiswrapper package.

Then, edit your kernel. Get rid of the old 802.11 stack and enable mac802.11 stack as a module.

Then, you may want to read those sections :

http://gentoo-wiki.com/HARDWARE_ipw3945#iwlwifi

http://gentoo-wiki.com/HARDWARE_ipw3945#iwlwifi_2

Compile your new kernel and boot it. (If you only changed modules, you may just make modules_install and avoid to reboot).

Your driver should then work, you'll have the wlan0 interface. You need to create the init script net.wlan0 :

```

cd /etc/init.d

ln -s net.lo net.wlan0

rm net.eth1

```

Let us know if it works  :Smile: 

----------

## Pobega

The thing is I've tried 4 different kernels with iwlwifi, and no matter what I don't even get a wlan0 interface (which I got on i686 Gentoo, but now I'm on amd64). And yes, I installed the ucode. For some reason the drivers just don't recognize my card...I've tried so many times.

Edit: Running kernel 2.6.25-r2 with iwl3945 drivers, and everything installed correctly (I triple checked), yet I don't have a wlan0 interface. I also removed the line for the ipw3945 drivers from /etc/udev/rules.d/70-persistent.net-rules (That is the filename off of the top of my head, could easily be wrong). Nothing. Nada. Nilch.

edit2: Here's my config -- http://rafb.net/p/GqDhTV32.html

----------

## kernelOfTruth

 *Pobega wrote:*   

> The thing is I've tried 4 different kernels with iwlwifi, and no matter what I don't even get a wlan0 interface (which I got on i686 Gentoo, but now I'm on amd64). And yes, I installed the ucode. For some reason the drivers just don't recognize my card...I've tried so many times.
> 
> Edit: Running kernel 2.6.25-r2 with iwl3945 drivers, and everything installed correctly (I triple checked), yet I don't have a wlan0 interface. I also removed the line for the ipw3945 drivers from /etc/udev/rules.d/70-persistent.net-rules (That is the filename off of the top of my head, could easily be wrong). Nothing. Nada. Nilch.
> 
> edit2: Here's my config -- http://rafb.net/p/GqDhTV32.html

 

ok, if you can't to get it work at all, (after having tried all gentoo-sources kernels / vanilla-sources), then give zen-sources a try (not supported by gentoo):

http://www.zen-sources.org/

this is working fine for me with the iwl3945 driver & knetworkmanager

good luck   :Smile: 

----------

## Pobega

 *kernelOfTruth wrote:*   

>  *Pobega wrote:*   The thing is I've tried 4 different kernels with iwlwifi, and no matter what I don't even get a wlan0 interface (which I got on i686 Gentoo, but now I'm on amd64). And yes, I installed the ucode. For some reason the drivers just don't recognize my card...I've tried so many times.
> 
> Edit: Running kernel 2.6.25-r2 with iwl3945 drivers, and everything installed correctly (I triple checked), yet I don't have a wlan0 interface. I also removed the line for the ipw3945 drivers from /etc/udev/rules.d/70-persistent.net-rules (That is the filename off of the top of my head, could easily be wrong). Nothing. Nada. Nilch.
> 
> edit2: Here's my config -- http://rafb.net/p/GqDhTV32.html 
> ...

 

I can't even figure out how to download the sources from there.

Edit: See https://forums.gentoo.org/viewtopic-p-5128463.html#5128463

----------

## jeanfrancis

Could you please post the outputs of :

```

rmmod iwl3945

rmmod mac80211

modprobe mac80211

modprobe iwl3945

dmesg | tail

ifconfig -a

```

----------

## Pobega

```
ackbar zen-sources # dmesg | tail

iwl3945: Intel(R) PRO/Wireless 3945ABG/BG Network Connection driver for Linux, 1.2.23k

iwl3945: Copyright(c) 2003-2007 Intel Corporation

ACPI: PCI Interrupt 0000:03:00.0[A] -> GSI 17 (level, low) -> IRQ 17

PCI: Setting latency timer of device 0000:03:00.0 to 64

iwl3945: Detected Intel PRO/Wireless 3945ABG Network Connection

iwl3945: Tunable channels: 11 802.11bg, 13 802.11a channels

phy1: Selected rate control algorithm 'iwl-3945-rs'

phy1: Failed to initialize wep

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

iwl3945: probe of 0000:03:00.0 failed with error -12

ackbar zen-sources # ifconfig -a

eth0      Link encap:Ethernet  HWaddr 00:17:31:FA:94:1F  

          inet addr:192.168.1.68  Bcast:192.168.1.255  Mask:255.255.255.0

          inet6 addr: fe80::217:31ff:fefa:941f/64 Scope:Link

          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

          RX packets:192720 errors:0 dropped:0 overruns:0 frame:0

          TX packets:120401 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000 

          RX bytes:274383309 (261.6 Mb)  TX bytes:9673021 (9.2 Mb)

          Interrupt:18 Base address:0xec00 

lo        Link encap:Local Loopback  

          inet addr:127.0.0.1  Mask:255.0.0.0

          inet6 addr: ::1/128 Scope:Host

          UP LOOPBACK RUNNING  MTU:16436  Metric:1

          RX packets:4104 errors:0 dropped:0 overruns:0 frame:0

          TX packets:4104 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:0 

          RX bytes:205200 (200.3 Kb)  TX bytes:205200 (200.3 Kb)

sit0      Link encap:IPv6-in-IPv4  

          NOARP  MTU:1480  Metric:1

          RX packets:0 errors:0 dropped:0 overruns:0 frame:0

          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:0 

          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)
```

----------

## jeanfrancis

Your security options on your kernel are wrong.

Set them in-kernel, rebuild it, boot it, and watch the magic happen  :Smile: 

```

# Security options

#

# CONFIG_KEYS is not set

# CONFIG_SECURITY is not set

# CONFIG_SECURITY_FILE_CAPABILITIES is not set

CONFIG_CRYPTO=y

CONFIG_CRYPTO_ALGAPI=y

CONFIG_CRYPTO_BLKCIPHER=y

# CONFIG_CRYPTO_SEQIV is not set

CONFIG_CRYPTO_MANAGER=y

# CONFIG_CRYPTO_HMAC is not set

# CONFIG_CRYPTO_XCBC is not set

# CONFIG_CRYPTO_NULL is not set

# CONFIG_CRYPTO_MD4 is not set

CONFIG_CRYPTO_MD5=y

CONFIG_CRYPTO_SHA1=y

# CONFIG_CRYPTO_SHA256 is not set

# CONFIG_CRYPTO_SHA512 is not set

# CONFIG_CRYPTO_WP512 is not set

# CONFIG_CRYPTO_TGR192 is not set

# CONFIG_CRYPTO_GF128MUL is not set

CONFIG_CRYPTO_ECB=y

# CONFIG_CRYPTO_CBC is not set

# CONFIG_CRYPTO_PCBC is not set

# CONFIG_CRYPTO_LRW is not set

# CONFIG_CRYPTO_XTS is not set

# CONFIG_CRYPTO_CTR is not set

# CONFIG_CRYPTO_GCM is not set

# CONFIG_CRYPTO_CCM is not set

# CONFIG_CRYPTO_CRYPTD is not set

# CONFIG_CRYPTO_DES is not set

# CONFIG_CRYPTO_FCRYPT is not set

# CONFIG_CRYPTO_BLOWFISH is not set

# CONFIG_CRYPTO_TWOFISH is not set

# CONFIG_CRYPTO_TWOFISH_X86_64 is not set

# CONFIG_CRYPTO_SERPENT is not set

CONFIG_CRYPTO_AES=y

CONFIG_CRYPTO_AES_X86_64=y

# CONFIG_CRYPTO_CAST5 is not set

# CONFIG_CRYPTO_CAST6 is not set

# CONFIG_CRYPTO_TEA is not set

CONFIG_CRYPTO_ARC4=y

# CONFIG_CRYPTO_KHAZAD is not set

# CONFIG_CRYPTO_ANUBIS is not set

# CONFIG_CRYPTO_SEED is not set

# CONFIG_CRYPTO_SALSA20 is not set

# CONFIG_CRYPTO_SALSA20_X86_64 is not set

# CONFIG_CRYPTO_DEFLATE is not set

CONFIG_CRYPTO_MICHAEL_MIC=y

# CONFIG_CRYPTO_CRC32C is not set

# CONFIG_CRYPTO_CAMELLIA is not set

# CONFIG_CRYPTO_TEST is not set

# CONFIG_CRYPTO_AUTHENC is not set

# CONFIG_CRYPTO_LZO is not set

CONFIG_CRYPTO_HW=y

# CONFIG_CRYPTO_DEV_HIFN_795X is not set

CONFIG_HAVE_KVM=y

CONFIG_VIRTUALIZATION=y

# CONFIG_KVM is not set

# CONFIG_VIRTIO_PCI is not set

# CONFIG_VIRTIO_BALLOON is not set

```

----------

## purak

Hi,

Do you try this command?

```
ln -s net.lo net.wlan0 && rm net.eth1 && rm -rf /etc/udev/rules.d/70-persistent.net-rules && reboot
```

Your system will reboot...

 :Smile: 

----------

## Pobega

http://rafb.net/p/2385oM67.html is my config, and yet I'm still getting compile fails.  :Sad: 

----------

## jeanfrancis

```
#

# Security options

#

# CONFIG_KEYS is not set

# CONFIG_SECURITY is not set

# CONFIG_SECURITY_FILE_CAPABILITIES is not set

CONFIG_CRYPTO=y

 

```

Your cryptographic options aren't correct. What compilation fails ?

----------

## Pobega

The same ones as before, and what aren't right about them? They are the same as in what you told me to put in the .config file.

----------

## jeanfrancis

Do not modify .config itself, always use make menuconfig to configure your kernel.

Your .config file is not available anymore, but when I read it, I didn't see any cryptographic option right after CONFIG_CRYPTO=y.

And as I remember, you never talked about compile errors, but errors in dmesg when trying to load the driver.

Use menuconfig to build in-kernel all the cryptographic algorithms I shown you and your problem should be resolved...

----------

## Pobega

 *jeanfrancis wrote:*   

> Do not modify .config itself, always use make menuconfig to configure your kernel.
> 
> Your .config file is not available anymore, but when I read it, I didn't see any cryptographic option right after CONFIG_CRYPTO=y.
> 
> And as I remember, you never talked about compile errors, but errors in dmesg when trying to load the driver.
> ...

 

Yeah, I actually figured that out myself. I got everything working yesterday and now I have iwl3945 working perfectly! Should I be loading the iwlcode module though?

----------

## jeanfrancis

 *Pobega wrote:*   

> 
> 
> Yeah, I actually figured that out myself. I got everything working yesterday and now I have iwl3945 working perfectly! Should I be loading the iwlcode module though?

 

Nice that it works ! I don't know the iwlcode module, never saw it around  :Wink: 

----------

