WiFi wireless networking on MacBooks generally works under Debian, sometimes out-of-the-box, but support and configuration depend on the specific hardware (and kernel support for it), and may require some hacking.

Identify wireless card

Macbooks before the late 2008 models are using Atheros chipset. Late 2008 are now using Broadcom 4322 chipset.

Broadcom chipset

Broadcom has developed a driver, which contained a closed part.

the driver can be downloaded from here:

http://www.broadcom.com/support/802.11/linux_sta.php

Note: I'm using Debian Lenny with kernel 2.6.26-1-amd64on a new unibody MacBook Pro. I found that an earlier version of the Broadcom driver (hybrid-portsrc-x86-64_5_10_27_6.tar.gz) could provide "iwlist eth1 scan" results and could send DHCP requests. However, this version never received an address, even though my router was handing out IPs to my other machine. But when I upgraded to the latest version (hybrid-portsrc-x86-64_5_10_27_11.tar.gz) I got wireless working both unencrypted and with 64-bit WEP.

Note: After following the Broadcom README, you need to 'cp wl.ko /lib/modules/2.6.26-1-amd64/kernel/net/wireless' and run 'depmod -a'.

For >= 2.6.27 kernels, you need a patch to compile the driver, see:

http://ubuntuforums.org/showthread.php?t=896713&page=5

[Richard Shore: I have only been able to get the Broadcom wireless working following this slightly more detailed guide. It's written for a Macbook Pro using Etch, but it's the only thing that's worked for my late 2007 Macbook, for Lenny, both i386 and amd64. [javascript:void(0);/*1236686532710*/ http://dendiz.verisux.com/2008/11/27/installing-debian-on-a-macbook-pro-part-2/]]

Atheros chipset

There are three possibilities for Atheros chipset: ath9k, madwifi drivers or the ndiswrapper way. Both have some common procedures, which you need to perform at the end (see the "common setup" subsection). ath9k is a completly free driver, without any firmware, which make it the prefered version. madwifi and ndiswrapper are still mentionned for people not having a kernel recent enough.

Ath9k

Atheros is now providing support for (>=) AR5416 cards with the ath9k driver.

See http://wireless.kernel.org/en/users/Drivers/ath9k for more details.

At least in the initial black MacBook, ath5k works fine. WPA does not seem to work on white ?MacBook1,1. Use madwifi.

Ath9k is now part of linux 2.6.27, and this version appears to work pretty well on my black macbook with an Atheros ar5418. There are a few bugs but it doesn't affect my traffic. This is tested using open and WPA.

There are drivers backported to 2.6.26 and earlier by the linux-wireless project, however i couldn't get these to work. Looking through the changelogs shows that they haven't had as much attention lately, however this is probably due to 2.6.27. This is the compat-wireless branch.

I now run a custom 2.6.27 kernel on lenny as the madwifi drivers were not reliable. There wre no issues with the installation.

802.11n is also supported by I haven't tried that yet.

Madwifi

Add 'contrib' and 'non-free' to your main Debian repository then update your packages list with

aptitude update

Install the madwifi kernel module source and the ability to compile it

aptitude install module-assistant

Compile it

m-a prepare
m-a a-i madwifi
modprobe ath_pci

See http://madwifi-project.org/wiki/UserDocs/Distro/Debian/MadWifi for more details.

Note: the current stable madwifi debian package (0.9.2+r1842.20061207-2etch1) isn't compatible with the latest stable kernel versions (2.6.22.1) -- use madwifi-source from Debian testing.

The quick and ugly way until 0.9.30.13 or later is available as .deb package:

svn checkout http://svn.madwifi-project.org/trunk madwifi-hal-0.9.30.13
cd madwifi-hal-0.9.30.13/
make
make install

or:

apt-get install wget
wget http://snapshots.madwifi-project.org/madwifi-hal-0.9.30.13-current.tar.gz
tar zxfv madwifi-hal-0.9.30.13-current.tar.gz
cd madwifi-hal-0.9.30.13/
make
make install

The 0.9.30.13 version seems buggy on macbook core 2 duo 2 Ghz (the driver stops working after a while). Unfortunately, even the subversion version is buggy (as of 12/08/2007) :

$ dmesg | grep wifi | uniq -c | tail -n 1
    576 wifi0: rx FIFO overrun; resetting

Maybe there is a solution in the discussion http://ubuntuforums.org/showthread.php?t=587366.

Note: if you use WPA, the wpa_supplicant from squeeze does not support the madwifi private interface, and the wext interface of the madwifi driver des not go along well with wpa_supplicant. You will need to recompile wpa_supplicant to use WPA with a madwifi driver.

Ndiswrapper

The following procedure worked on etch/i386 with card 168c:0024

Get the D-link DWA645 card drivers for Windows XP from somewhere (for example from http://www.dlink.com/products/support.asp?pid=489&sec=0 as suggested in http://madwifi-project.org/ticket/1001#comment:13)

This is a zip file: dwa645_drivers_102.zip Unzip it. You will need the files ar5416.sys and net5416.inf from the Driver subdirectory.

The D-link driver not permit to scan wireless networks arround. Is possible get this feature using the driver of ThinkPad 802.11abgn wireless LAN driver, avaliable in http://www-307.ibm.com/pc/support/site.wss/document.do?lndocid=MIGR-66449 . You need to get the file 7iwc28ww.exe, and extract with cabextract. Are the same files, but in a newer version.

Run the following:

aptitude install module-assistant
m-a prepare
m-a a-i ndiswrapper
ndiswrapper -i net4516.inf

The last command has to be run in the "Driver" directory, it copies the driver into /etc/ndiswrapper and does some additional setup.

Proceed to the "Common setup" subsection. Just make sure you add the following

        pre-up modprobe ndiswrapper
        post-down rmmod ndiswrapper

right after the "iface ath0 inet dhcp" line.

Common setup

Install wireless support

aptitude install wireless-tools

See iwconfig(8) for more details on iwconfig

To start wireless up on boot, add the following to /etc/network/interfaces (unless you intend to use network Manager, in which case you don't need this)

# Starts the wireless card on boot
auto ath0
iface ath0 inet dhcp

Restart networking.

/etc/init.d/networking restart

CategoryWireless