2007 / Apple MacBook, Atheros WiFi and NetworkManager

Apple MacBook, Atheros WiFi and NetworkManager

I'm successfully using my MacBook1,1 (August 2006) with Debian Etch/Lenny and wireless networking works great with the madwifi-source package and networkmanager.

About NetworkManager

NetworkManager is a small daemon running in the background, taking control over your unconfigured network interfaces (hard-coded network configuration is possible for certain interfaces, if this is wanted). A client then connects to the NetworkManager daemon using D-BUS.

Using NetworkManager, you can get Mac OS X-like network interface configuration (a notification area icon with a drop-down list of available networks). More information on the NetworkManager homepage.

Installing the network driver

If you have not already installed the wireless network driver, you can do so in Debian by entering the following commands:

# aptitude install madwifi-source madwifi-tools
# m-a prepare
# m-a a-i madwifi
# modprobe ath_pci

You can now proceed to installing NetworkManager:

# aptitude install network-manager network-manager-gnome

The Problem

By default, the Atheros network adapter is configured to be compatible to 802.11a/b/g standards. This makes the adapter hop between frequencies, and it seems like this is the reason why NetworkManager is not able to associate with an 802.11g access point.

The Solution

You can make the WiFi adapter only use a specific frequency and mode by selecting which kind of 802.11 standard (a, b or g) you want to use. Hints on how to to this can be found on fehu.org, for example:

If the card should be bound to 802.11a,b or g, do
$ iwpriv ath0 mode X
where X stands for 0=802.11a/b/g, 1=802.11a, 2=802.11b, or 3=802.11g.

So, if you want to connect to an 802.11g access point, do the following:

# iwpriv ath0 mode 3

Editing the startup scripts

This change is not permanent, if you re-load the driver or re-start your MacBook, the mode will default to 0 again. To make your change permanent, add the following lines to your /etc/rc.local:

# fix madwifi (http://madwifi.org/ticket/1030)
modprobe ath_pci
(sleep 10 && /sbin/iwpriv ath0 mode 3) &

Conclusion

NetworkManager on the MacBook is great! It makes networking very easy and associating with access points is as easy as selecting the corresponding AP from a popup menu. Hopefully this small bug with the wifi card not being able to associate with an access point will be fixed in a future release of the MadWifi driver, so we don't need to specify which standard from the 802.11 series we want to use.

Links


Thu Jul 19 14:43:08 2007 +0000