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.

If the card is supported by the kernel, then there is nothing special about a MacBook, and one may refer to the common WiFi instructions in case of problems; if the card is not supported by your running kernel, then some hacking may be required.

Initial setup and check

If you’ve installed Debian with the Laptop or Gnome-Desktop installation, you have the basic necessary tools; otherwise install wireless-tools for wireless, and optionally NetworkManager for a user interface (so you can select a network), or use an alternative, as discussed at WiFi.

To start, try running iwconfig.

Getting packages

It is significantly easier to setup wireless with a working (wired) network connection, for installing packages and finding documentation.

If you do not have access to a wired connection, you can boot into Mac OS X (if you are dual-booting) and download required packages, or else obtain them from a separate computer with working wireless connection, but these both may involve multiple back-and-forth cycles and using dpkg manually instead of aptitude/apt-get.

Identify wireless card

The first step is to identify your network card; "AirPort" and "AirPort Extreme" are Apple product names for varying hardware, with "AirPort Extreme" meaning "IEEE 802.11g" (and for more recent cards, /n (802.11n)). Different cards require different configuration.

Under GNOME or KDE, one can use a graphical application, as described at How to Identify PCI. Alternatively, one can check manually via:

update-pciids # if necessary; run as root, to update PCI database
lspci | grep -E "Atheros|Broadcom" # Finds card

MacBooks before the late 2008 models use Atheros chipsets, while late 2008 are now using Broadcom 4322 chipset.

Some Atheros models work out-of-the-box with more recent (lenny) kernels; Broadcom chipsets all require non-free firmware, and thus require some user intervention.

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 is a completely free driver, without any firmware, which make it the preferred version for users of lenny and more recent releases. madwifi and ndiswrapper are still mentioned for people not having a kernel recent enough, notably etch users.

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.

User reports

Madwifi

Madwifi is the earlier, partly non-free series of Atheros drivers; it also has some issues with WPA, as discussed below.

To use this, you will need to build kernel modules. For some cards, this can be largely automated via module-assistant, but for some cards, notably the AR5008 (PCI-ID 168c:0024), you cannot use module-assistant as of this writing, and must instead install an unofficial release manually.

Most cards

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.

AR5008

The airport card in the newest MacBook (AR5008, PCI-ID 168c:0024) is working with a svn version from madwifi (with WPA support). This was added in branch madwifi-hal-0.9.30.13 which was then merged back into the trunk, as noted in http://madwifi-project.org/ticket/1001#comment:194 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.

WPA

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 AR5008 (PCI-ID 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

To start wireless up on boot, add the following to /etc/network/interfaces (unless you intend to use NetworkManager, 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