Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

HowTo Replace iwl3945 with ipw3945 Lenny i386

Share your HowTo, Documentation, Tips and Tricks. Not for support questions!.
Post Reply
Message
Author
User avatar
julian67
Posts: 4633
Joined: 2007-04-06 14:39
Location: Just hanging around
Been thanked: 7 times

HowTo Replace iwl3945 with ipw3945 Lenny i386

#1 Post by julian67 »

EDIT: Kernel 2.6.26 arrived in Lenny today (28 August 2008) and for it seems to have solved all the issues I had with iwl3945. So one month after writing the howto I'm back to using Debian Lenny's default iwl3945 driver and network-manager. Try it first before following this howto.



This howto assumes that you have the usual tools installed to compile a package from source and also the patch package.

1: Purpose

The iwl3945 driver and unicode have been problematic for many users who were happier with the reliable but now deprecated ipw3945 driver and userspace daemon. I had been tolerably satisfied until recent updates to the iwl3945 firmware left me with frequent disconnections and timeouts, CPU spikes, browser crashes, occasional complete crashes of X and even a kernel oops.

I resolved to try the old ipw3945 driver. I've been successful in this, I now have a fully functional and reliable 3945ABG wireless adapter with working LED, stronger signal, reliable scanning and no panics. Just like old times except I'm using kernel 2.6.25-2-686 :-)

Here's how to do it

2: Obtain the necessary packages:

The old Debian driver package won't work on kernels 2.6.24 and newer so we'll build the driver from the Intel package available at http://ipw3945.sourceforge.net/downloads.php Download the newest version which is 1.2.2

Also download the unicode from http://bughost.org/ipw3945/ucode/ipw394 ... 1.14.2.tgz

We'll also need a patch which will enable the driver to build on the newer kernels. Go to http://james.colannino.org/downloads.html and download ipw3945-1.2.2.patch.

And finally download the old Debian ipw3945d package from http://snapshot.debian.net/archive/2007 ... 5_i386.deb

3: Install the unicode

Unpack ipw3945-ucode-1.14.2.tgz

As root:

Code: Select all

# cp ipw3945.ucode /lib/firmware
4: Patch and build the driver

Unpack the driver tarball ipw3945-1.2.2.tgz. Copy the patch file ipw3945-1.2.2.patch into the directory ipw3945-1.2.2. We can now patch the driver so it will build on our newer kernel:

Code: Select all

$ cd ipw3945-1.22
$ patch ipw3945.h ipw3945-1.2.2.patch
Now we can build the driver. I used checkinstall to make a deb package for me and to automatically install the driver.

Code: Select all

$ make
and as root:

Code: Select all

# checkinstall
If you prefer not to use checkinstall you can simply use make & make install instead

Now we have the unicode and the driver installed, it's time to install the userspace daemon.

5: Install the ipw3945 daemon

The old Debian package is preferred to Intel's source package for the following reasons:

a) The daemon needs to run with root privileges in userspace. This is a poor idea. Fortunately the Debian package solves this problem by automatically creating a special user and group Debian-ipw3945d. This special user has no access to a shell and is only able to run the ipw3945d. This is much safer than having the daemon run with full root privileges.

b) The Debian package creates the necessary startup scripts, modprobe.d file, logrotate script, and installs the docs/man page to the correct place. Everything is automatically in the right place and has the right permissions.

c) It's easy and it works :-)

Change to the directory containing your downloaded ipw3945d_1.7.22-5_i386.deb and as root:

Code: Select all

# dpkg -i ipw3945d_1.7.22-5_i386.deb
We now have the driver, the unicode and the userspace daemon successfully installed. The next step is to make sure the ipw3945 driver loads at boot in preference to the iwl3945 driver.

6: Blacklist iwl3945

iwl3945 is a kernel module so simply adding it to /etc/modprobe.d/blacklist will not prevent it from loading. Instead we create the file /etc/modprobe.d/00local as root:

Code: Select all

# touch /etc/modprobe.d/00local
and add the following lines to it

Code: Select all

#disable iwl3945 to allow ipw3945
install iwl3945 /bin/true
and save.

7: Nearly done!

Reboot, connect, enjoy :-)


Disclaimer: I'm no expert so following this howto is done at your own risk. However, everything is fully and easily reversible as my method uses deb packages to install the driver and the userspace daemon which can be purged using your preferred package manager. To remove the unicode is as simple as deleting the file in /lib/firmware and to re-enable iwl3945 is as easy as deleting the file /etc/modprobe.d/00local.

As far as I can tell the only issue anyone might have will be in running make to build the driver. If this fails please ensure you have the packages build-essential and checkinstall installed and also the linux-headers package for your kernel.
Last edited by julian67 on 2008-08-28 02:53, edited 1 time in total.

oz123
Posts: 49
Joined: 2008-07-21 07:49
Location: Germany

SOLVED !

#2 Post by oz123 »

Thanks for your guide, my wireless is now working. However, putting the laptop to sleep and waking it up breaks wireless.
Any idea how to solve ?
I am using lenny on a lenovo 3000 N100, and kernel 2.6.25.2

thanks, Oz.

User avatar
julian67
Posts: 4633
Joined: 2007-04-06 14:39
Location: Just hanging around
Been thanked: 7 times

#3 Post by julian67 »

I also have a Lenovo 3000 series, a Y400, running the same kernel. I have the same issue and have tried all kinds of ways to fix it. These include whitelisting ipw3945 in /etc/default/acpi-support, adding scripts to /etc/acpi/suspend.d and /etc/acpi/resume.d, modifying pre-existsing acpi scripts and startup scripts called by the acpi scripts. It don't work! I've done a lot of reading and this is pretty common across different distributions using network-manager 0.6.6 and various wireless drivers. Occasionally network-manager is fine on resume but mostly it isn't. As far as I can tell the bug is caused by dhcdbd. dhcdbd is not going to be used by NM 0.7 so nobody wants to spend time fixing it.

Meanwhile the annoying but reliable workaround is to run

Code: Select all

# /etc/init.d/network-manager restart
on resuming.

I'm sorry I can't be more helpful. If you find a solution I hope you can post here. I didn't notice the problem when I wrote the howto because essentially I use this laptop as a desktop replacement, it's rarely powered off and almost never suspended as I have a smaller laptop for carrying around.

rduke
Posts: 94
Joined: 2007-02-08 19:07
Location: Quito, Ecuador

#4 Post by rduke »

Thanks for the howto. Unfortunately, the author of the patch states that he has stopped supporting it, so it is likely to break with future kernel releases. FWIW I am running kernel 2.6.26 and the iwl3945 driver is much improved over the 2.6.25 version, though still prone to random disconnects and still no led. It is unfortunate for people with the 3945ABG wireless adapter that the Debian team chose to freeze Lenny at that particular kernel - in my experience the most unstable ever.

Still, for those folks staying in the Stable branch your procedure is just the ticket.

User avatar
julian67
Posts: 4633
Joined: 2007-04-06 14:39
Location: Just hanging around
Been thanked: 7 times

#5 Post by julian67 »

OK, there is a way to have it all work :D

The problem lies with dhcdbd which is used by network-manager. In the past I've used Wicd but at some point in Lenny's progress the tray icon got broken (I think due to changing versions of python). Fortunately the latest version, Wicd 1.5.1, works perfectly. I uninstalled network-manager and network-manager-gnome and installed Wicd 1.5.1. Everything works very well, resume is no problem and the connection is up on reboot and logging in.

caveats:

Wicd conflicts with network-manager so nm must be uninstalled. Before you uninstall network-manager and network-manager-gnome/kde make sure you have the packages available in case you run into a problem with Wicd and wish to re-install. You should find the packages in /var/cache/apt/archives. If they're not present then use apt-get to download them (without installing/re-installing)

Code: Select all

# apt-get install -d network-manager network-manager-gnome network-manager-openvpn network-manager-openvpn-gnome network-manager-vpnc network-manager-vpnc-gnome network-manager-pptp network-manager-pptp-gnome network-manager-kde network-manager-pptp network-manager-pptp-gnome
Remove gnome or kde specific packages from the above list according to your desktop environment. If you don't use openvpn or pptp also remove those from the list.

Make sure your package manager is configured to retain packages in the cache on uninstalling them.


Obtain Wicd

There is a Debian/Ubuntu apt repository but it's out of date. Get the latest version of Wicd from https://sourceforge.net/project/showfil ... _id=617639 Choose the deb package, not the source tarball.

Uninstall network-manager

Code: Select all

# apt-get remove network-manager
This will also remove network-manager-gnome/kde

Prepare your interfaces file

As root edit /etc/network/interfaces to look like

Code: Select all

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback
There shouldn't be anything else in there unless you have an interface which you prefer not to manage with Wicd (i.e. perhaps a wired interface with static IP address for NAT with DHCP server acting as a gateway for a LAN).

Install Wicd

Code: Select all

# dpkg -i wicd_1.5.1_all.deb
On successful installation the the wicd daemon starts automatically and a suitable menu entry for wicd is added and also an autostart entry for the tray icon. To see the tray icon immediately:

Alt+F2 <wicd-client>

You should now have the wicd daemon running and the wicd tray icon in your notification area/system tray. Click on the icon to configure your wireless adapter. If you don't want wicd to manage your wired adapter just leave the "Wired Interface" box in wicd preferences empty and the wired adapter can be configured via /etc/network/interfaces or any other network config tool you prefer.

Post Reply