Installing ethernet and wireless on a MacBook Pro using wpa_supplicant and a 2.6.23 kernel.
Network Cards
- Network controller: Atheros Communications, Inc. AR5418 802.11a/b/g/n Wireless PCI Express Adapter (rev 01)
- Ethernet controller: Marvell Technology Group Ltd. Unknown device 436a (rev 13)
Ethernet Driver - SysKonnect Yukon2
Device Drivers
[*] Network Device Support
[*] Ethernet (1000 Mbit)
<*> SysKonnect Yukon2 support
Note: This driver is somewhat new, so older kernels (like the one on the gentoo 2007.1 install disc) will not support the ethernet card. I do not know at what specific point it was added to the kernel, but 2.6.23 and later have it.
Ethernet Tweak
I use ifplugd to speed up boot time, as eth0 is hardly ever connected.
emerge ifplugd
Wireless Driver - MadWifi-NG
I had to install the latest version of madwifi-ng from source as even the unstable version in portage did not support my card. Run the commands below but substitute ’source_folder’ with the folder created by ‘tar xzf madwifi-ng-current.tar.gz’. (Source: gentoo wiki)
cd /usr/src
wget http://snapshots.madwifi.org/madwifi-ng-current.tar.gz
tar xzf madwifi-ng-current.tar.gz
cd source_folder
make
make install
ln -s /usr/src/source_folder /usr/include/madwifi
reboot
Note: Check ‘lsmod’ to for ‘ath_pci’ and ‘wlan_scan_sta’ after reboot. Run ‘modprobe’ if either is missing. When changing kernel versions, rerun ‘make & make install’.
Detecting Wireless Networks
emerge wireless-tools
iwlist ath0 scan
Note: There is also ‘wlanconfig ath0 list scan’ but I prefer ‘iwlist’ because of the extra information.
Connecting to a Wireless Network
I chose to use wpa_supplicant to manage the list of servers my notebook should connect to, however ‘iwconfig ath0 essid any’ can also be used. (Source: gentoo wireless howto)
echo "net-wireless/wpa_supplicant madwifi" >> /etc/portage/package.use
emerge wpa_supplicant
ln -s /etc/init.d/net.lo /etc/init.d/net.ath0
rc-update add net.ath0 default
/etc/wpa_supplicant/wpa_supplicant.conf
ctrl_interface=/var/run/wpa_supplicant
eapol_version=1
ap_scan=1
fast_reauth=1
network={
ssid="some wep network"
key_mgmt=NONE
wep_key0=xxxxxxxxxx
wep_tx_keyidx=0
priority=5
}
network={
ssid="a network with no encryption"
key_mgmt=NONE
priority=10
}
/etc/conf.d/net
#wpa
modules=("wpa_supplicant")
wpa_supplicant_auth0="-Dmadwifi"
wpa_timeout_ath0=20
#ath0
config_ath0=("dhcp")
dhcp_ath0="nontp nonis"
Note: It is possible that emerging wpa_supplicant with the madwifi use flag as above, will also emerge madwifi-ng requiring an ‘emerge –unmerge madwifi-ng’ and a reinstall of madwifi from source, but I did not encounter this.