Monday, June 18, 2007

How to install Intel iwlwifi 4965AGN wireless drivers on Ubuntu

This guide is not actual anymore. Just update to the latest Ubuntu Gutsy and boot with the generic kernel. The wireless module is not automatically loaded, so you must do it manually

sudo modprobe iwl4965


The old guide:

Download some source code


wget http://intellinuxwireless.org/iwlwifi/downloads/iwlwifi-0.0.32.tgz
tar -xzf iwlwifi-0.0.32.tgz

wget http://intellinuxwireless.org/mac80211/downloads/mac80211-8.0.1.tgz
tar -xzf mac80211-8.0.1.tgz

wget http://intellinuxwireless.org/iwlwifi/downloads/iwlwifi-4965-ucode-4.44.15.tgz
tar -xzf iwlwifi-4965-ucode-4.44.15.tgz


Download the kernel source and essential compilation tools

sudo apt-get install build-essential linux-headers-`uname -r`

Link the source in to the kernels binary directory. Without this the compilation will fail.

ln -s /usr/src/linux-headers-`uname -r` /lib/modules/`uname -r`/source


Compile the iwlwifi sources

cd mac80211-8.0.1
make patch_kernel
cd ../iwlwifi-0.0.32
make
make install

Copy the firmware in to the correct directory

cd ../iwlwifi-4965-ucode-4.44.15
cp iwlwifi-4965.ucode /lib/firmware/`uname -r`

and to load the wireless driver into the kernel:

modprobe iwl4965

If you experience problem with the system stability try to turn the hardware switch OFF before booting or rebooting your PC.

35 comments:

Anonymous said...

Hi Zoltan,

Thanks for this. I have a small problem that I thought I would post. I followed these instructions to the letter but I get a segmentation fault at the last step:

sudo modprobe iwl4965
Segmentation fault

Message from syslogd@9400 at Tue Jun 19 12:57:43 2007 ...
9400 kernel: [129402.848000] Oops: 0002 [#1]

etc.... I will post the full output on ubuntuforums

Anonymous said...

Hi,

This caused the system to stall during reboot. So, I booted an older kernel and then added the modules to the blacklist so I could boot again.

I followed the instructions to the letter so I don't know what went wrong.

This is on a Feisty installation

Anonymous said...

Does not work on my Toshiba A200.
I can load the driver after installation, but I can't see any wireless device.
After reboot my system hangs.

Removed the patch and it works again.

Still no wireless connection.
Meanwhile I'll get myself an USB-Stick, this Intel stuff sucks.

Zoltan said...

Thank you, I added a warning message to the post. Another solution may be the installation of the latest ndiswrapper drivers .

Anonymous said...

I got the reboot problem on a Feisty x86_64 install also. Thankfully, I had another kernel I could boot to also.

Anonymous said...

if this works well, can you update the ubuntu Wiki? The current instructions are requiring ndiswrapper: https://help.ubuntu.com/community/WifiDocs/Driver/Intel_4965_AGN_WiFi_Driver/Fiesty

Anonymous said...

I appreciate the attempt,
but I'm also reporting a sytem failure on feisty x86.

Thanks anyway ryan

Anonymous said...

I read somewhere else that this
works with Ubuntu Gutsy, so
I backported Gutsy kernel 2.6.22
to my Feisty-x86_64 and
it's working ok here.

Anonymous said...

Sweet, it worked in Gutsy, no hangups yet :) *knock on keybord*

Anonymous said...

Since 2.6.22 has some new RFKILL code, I figured I backport from Gutsy too, but it turned out to be slightly worse than first though (partly due to nvidia drivers). So, the latest anonymous user, you wouldn't mind giving a little HOWTO for it?

Cheers,

Kjetil

Anonymous said...

MAKE SURE YOU GET THE LATEST VERSION OF iwlwifi!

The instructions above are for 0.0.32 and they are already up to 0.0.34 (two updates today). You're best bet is to just download it yourself from

http://intellinuxwireless.org/

Zoltan said...

Previous Anonymous,

can you confirm that the latest iwlwifi 0.0.34 also works with this HOW-TO?

VeloSol said...

I was reading a 'HOWTO' for the NDISWrapper version of this, and one of the big things to do is go into Windows and BEFORE YOU SHUTDOWN disable your wireless radio using the hardware button (either switch or Fn+F#) and then do all the install stuff, then attempt to use your hardware switch.

Either way, it may stop that segfault stuff - I'm about to go try it and I will post back here and ubuntuforums (hopefully from wireless!)

-VeloSol

VeloSol said...

Posting back here from windows - I did all the install and I went to reboot after reading about getting my 965GM/X3100 working with the latest drivers from git and the computer doesn't boot! I eventually get it to fail out to a prompt by getting out of the splash with Alt+F1 and then Ctrl+Alt+Del and iwl4965 is loading, yet I hadn't modprobe'd it... Trying to blacklist again so I can boot, but as of yet I was unable to get iwlwifi/iwl4965 with the .34 drivers.
Also posted at the ubuntuforums page.

Riska said...

ipw3945-ucode-1.14.2
iwlwifi-0.0.38
mac80211-9.0.2
#uname -r
2.6.20-16-generic
#gcc --version
gcc (GCC) 4.1.2 (Ubuntu 4.1.2-0ubuntu4)
modprobe iwl4965
Fallo de segmentación
Message from syslogd@coreduo at Sun Jul 15 15:13:52 2007 ...
coreduo kernel: [ 177.652000] EIP: [f907ed0e] iwl_pci_probe+0x8e/0x11c0 [iwl4
965] SS:ESP 0068:f5755db4


# modprobe -r iwl4965
No response

#lsmod | grep iwl
iwl4965 193754 1
mac80211 175364 1 iwl4965

I had to blacklist iwl4965

Riska said...

ipw3945-ucode-1.14.2
iwlwifi-0.0.38
mac80211-9.0.2
#uname -r
2.6.20-16-generic
#gcc --version
gcc (GCC) 4.1.2 (Ubuntu 4.1.2-0ubuntu4)
modprobe iwl4965
Fallo de segmentación
Message from syslogd@coreduo at Sun Jul 15 15:13:52 2007 ...
coreduo kernel: [ 177.652000] EIP: [f907ed0e] iwl_pci_probe+0x8e/0x11c0 [iwl4
965] SS:ESP 0068:f5755db4


# modprobe -r iwl4965
No response

#lsmod | grep iwl
iwl4965 193754 1
mac80211 175364 1 iwl4965

I had to blacklist iwl4965

Riska said...

ipw3945-ucode-1.14.2
iwlwifi-0.0.38
mac80211-9.0.2
#uname -r
2.6.20-16-generic
#gcc --version
gcc (GCC) 4.1.2 (Ubuntu 4.1.2-0ubuntu4)
modprobe iwl4965
Fallo de segmentación
Message from syslogd@coreduo at Sun Jul 15 15:13:52 2007 ...
coreduo kernel: [ 177.652000] EIP: [f907ed0e] iwl_pci_probe+0x8e/0x11c0 [iwl4
965] SS:ESP 0068:f5755db4


# modprobe -r iwl4965
No response

#lsmod | grep iwl
iwl4965 193754 1
mac80211 175364 1 iwl4965

I had to blacklist iwl4965

Pierre said...

I am running Ubuntu Fiesty 7.04 on a dell inspiron 6400 with the Intel Next Gen Wireless N card.

I follow your guide, till I get this:

mac80211 headers not found in:

/lib/modules/2.6.20-16-generic/source/include/net/

Please install the mac80211 subsystem.

Terminating.
make: *** [compatible/kversion] Error 2


It says to install that subsystem, so I go to that intel website, and I follow the steps on how to install that, but I only get as far as the 2nd step, I extract the file, but then when it tells me to run the GIT or whatever, I get this:

pepe@PePe-Mobile:~$ mac80211-9.0.2/origin/GIT
bash: mac80211-9.0.2/origin/GIT: Permission denied


Then I try to run sudo infront of it, but it tells me, "command not found"

------------------------------

I am stuck, please help me!!

Thanks in advance

Zoltan Kuscsik said...

Hi,

please read the comments. This guid works for Gutsy. Try to upgrade your ubuntu or install a Gutsy kernel.

Zoltan

Pierre said...

How do I install a Gusty Kernel, and will that replace my Feisty?

Thanks in advance

Zoltan Kuscsik said...
This comment has been removed by the author.
Zoltan Kuscsik said...

You can upgrade your system to Gutsy, but you risk that something will be broken (Gutsy is the development branch) or you can install a gutsy kernel and kernel-sources to feisty. The second option preserves your feisty installation.

Pierre said...

So, I am getting that permission denied error because I am on Feisty?

Anonymous said...

I'm new to Linux, and followed this guide in Fiesty until I also had my system hang at reboot. I don't know how to recover it at this point, what should I do?

Zoltan Kuscsik said...

Hi,

try to boot an older kernel or with wireless switch off. I hope it will work.

Zoltan

Anonymous said...

I can reboot into an older kernel, but all of my work in the new one is gone. Is there a way I can save/undo the wireless drivers, or should I just update my older kernel (will that over-write the currently unfunctional one)?

Thanks for the help.

Zoltan Kuscsik said...

There are two solutions:

1. You may delete manually the module from the kernel modules directory. To locate the iwl4965 module you can use:

find /lib/modules/ -name "iwl4965.ko"

after simply:
sudo rm /lib/modules/....../iwl4965.ko

2. Second solution: Blacklist the iwl4965 module. Edit the file

gksudo sudo gedit /etc/modprobe.d/blacklist

and write

blacklist iwl4965

But be careful! This will disable iwl4965 driver for all present and future kernels on your system! You may need to remove this line in the future.

Moreover, the iwl4965 driver is already included in the development version of Ubuntu. At the and of October it will be a nice and stable release :)

qbox said...

Any SOLUTION PLEASE :)))

qbox@qboxcom:~/tools/iwlwifi-1.1.21$ make
Makefile:22:
Makefile:23: WARNING: $SHELL not set to bash.
Makefile:24: If you experience build errors, try
Makefile:25: 'make SHELL=/bin/bash'.
Makefile:26:
make -C /lib/modules/2.6.22-14-generic/source O=/lib/modules/2.6.22-14-generic/build M=/home/qbox/tools/iwlwifi-1.1.21/compatible/ EXTRA_CFLAGS="-DCONFIG_IWLWIFI_DEBUG=y -DCONFIG_IWLWIFI_SPECTRUM_MEASUREMENT=y -DCONFIG_IWLWIFI_HT=y -DCONFIG_IWLWIFI_HT_AGG=y -DCONFIG_IWLWIFI_SENSITIVITY=y -DCONFIG_IWLWIFI_QOS=y" modules
make[1]: Entering directory `/usr/src/linux-source-2.6.22'
CC [M] /home/qbox/tools/iwlwifi-1.1.21/compatible/iwl3945-base.o
/home/qbox/tools/iwlwifi-1.1.21/compatible/iwl3945-base.c: In function ‘iwl3945_pci_probe’:
/home/qbox/tools/iwlwifi-1.1.21/compatible/iwl3945-base.c:8333: error: ‘struct ieee80211_hw’ has no member named ‘preferred_rate_control’
make[3]: *** [/home/qbox/tools/iwlwifi-1.1.21/compatible/iwl3945-base.o] Error 1
make[2]: *** [_module_/home/qbox/tools/iwlwifi-1.1.21/compatible] Error 2
make[1]: *** [modules] Error 2
make[1]: Leaving directory `/usr/src/linux-source-2.6.22'
make: *** [modules] Error 2
qbox@qboxcom:~/tools/iwlwifi-1.1.21$

Anonymous said...

downloaded newest packs... installation without errors... boots just fine... only one problem...

modprobe iwl4965 output:
FATAL: Error inserting iwl4965 (/lib/modules/2.6.22-14-generic/kernel/drivers/net/wireless/iwl4965.ko): Unknown symbol in module, or unknown parameter (see dmesg)

part of dmesg:

[ 325.252000] iwl4965: Unknown symbol ieee80211_stop_BA_session
[ 325.252000] iwl4965: Unknown symbol ieee80211_start_BA_session
[ 512.800000] iwl4965: Unknown symbol ieee80211_stop_BA_session
[ 512.800000] iwl4965: Unknown symbol ieee80211_start_BA_session

how could this be resolved?

Zoltan Kuscsik said...

Hi,

the problem is that the latest iwlwifi uses the ieee80211_stop_BA_session() function from the latest mac80211 driver. The above described solution patches only the mac80211 driver to the kernel source to allow the compilation of iwlwifi driver. The correct solution should be the recompilation ot the actual kernel with the actual mac80211 driver. Did you try the included 4965AGN driver in the actual generic Gutsy kernel?

iuuuuan said...

Hi,

I have tried your solution on OpenSuse 10.3 but I had no success in loading module iwl4965, so I used solution compat-wireless from "Linux wireless page" - http://linuxwireless.org/en/users/Download . You don't have to recompile kernel and there are a lot of wireless drivers included.

Regards,
iuuuuan

mordantae said...

i could kiss this post..!!! such hassle i've been through...now to get the blue led light on my m1530 to actually light up when wireless is active! thanks a bunch for this post! its stuff like this that makes the linux world go round..

Anonymous said...

Amiable fill someone in on and this fill someone in on helped me alot in my college assignement. Thanks you on your information.

Anonymous said...

Thanks for sharing this link, but unfortunately it seems to be down... Does anybody have a mirror or another source? Please answer to my post if you do!

I would appreciate if a staff member here at kuscsik.blogspot.com could post it.

Thanks,
Daniel

Anonymous said...

Greetings,

Thanks for sharing the link - but unfortunately it seems to be down? Does anybody here at kuscsik.blogspot.com have a mirror or another source?


Thanks,
Mark