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; development has moved to the free ath5k/ath9k drivers (above), but madwifi remains useful for earlier kernel users, notably on etch.

In addition to being non-free, madwifi:

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:0023/168c:0024), the current Debian package does not support it, so you must instead install the current development snapshot of madwifi-hal 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
aptitude install madwifi-source madwifi-tools madwifi-doc

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.

AR5008

The AR5008 card (PCI-ID 168c:0023/168c:0024), used in some MacBooks, is not supported by the current stable release of madwifi (0.9.4), nor in the current Debian packages for madwifi-source (currently 0.9.2/r1842 for etch, 0.9.4/r3772 for lenny).

However, it is supported (with WPA support) in the current development branch, or “trunk”, and thus works if you download, compile, and manually install the current development version.

Installation

The madwifi-hal package is available at MadWifi snapshots; the current release is 0.10.5.6, available at madwifi-hal-0.10.5.6-current.tar.gz.

Simply download the package, then, as root, unzip, compile, and install it:

su # become root
tar zxfv madwifi-hal-0.10.5.6-current.tar.gz # unzip
cd madwifi-hal-0.10.5.6/
make # compile
make install # install

Alternatively, if you know the release number, you can use subversion:

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

or wget:

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

Support details

Details on the exact status of AR5008 support in madwifi:

Driver stops working: rx FIFO overrun

In some cases, the madwifi driver stops working after a while. If so, check the kernel messages (via dmesg); if you get the following error:

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

then you have the “rx FIFO overrun” error, ticket 1017.

Maybe there is a solution in the discussion

WPA

If you use WPA,

You will need to recompile wpa_supplicant to use WPA with a madwifi driver.

Ndiswrapper

Ndiswrapper takes a Windows driver, and wraps it for use by Linux. It is thus mostly closed, and hard to debug.

AR5008

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 around. 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