Table of Contents

Installing Madwifi on Slackware

Madwifi
Wireless support in Slackware has much improved since Slackware 10.0 (the first release to support non-PCMCIA wireless cards out of the box). The madwifi driver for Atheros based chipsets works fine with the current 2.6.x series of kernels and the 2.4.x kernels found in Slackware releases prior to 12.0. The Slackware configuration files support unencrypted, WEP- and WPA-protected connections. For WPA encryption, the wpa_supplicant package (part of Slackware since 12.0) is an additional requirement.
If you need WPA encryption, be sure to read the Support for WPA encryption section of this page.

This Wiki page explains how to install an appropriate Madwifi package on your Slackware computer, and gives directions on how to build your own package if you need to (for instance if you run a non-Slackware kernel).

The madwifi driver is capable of creating so-called virtual access points or VAPs. This is being done on a base device called wifi0 which will show up in your listings of ifconfig and iwconfig, and is not linked to the wireless extensions. You should never have to use this wifi0 network device. The user station (a VAP of type “sta”) will by created by default when the kernel module loads and is called ath0. This ath0 is the real network device, which you will be configuring and using.
People who want to create something other than a user station, for instance a real Access Point (master mode) will want to read this MadWiki documentation.

Obtaining slackware packages for madwifi

Binary Slackware packages for the madwifi driver can be found at slackware.com. They can be installed onto your computer using installpkg or upgradepkg. They are packages for specific kernels. The package naming convention is madwifi-${VERSION}_${KERNELVERSION}-i486-${NUMBER}.tgz. Here, ${VERSION} is the version of the madwifi source package, and ${KERNELVERSION} is the version of the kernel that the package is meant for. The ${NUMBER} is the build number. In case there are multiple packages where only the build number differs, then the package with the highest build number is the most recent and should be used.

Building a slackware package for madwifi from source

You can build your own package for any kernel version that you are running, too. If you want to know if any of the downloadable packages matches your running kernel, you can check the version of your running kernel with the command

uname -r

Loading the kernel modules automatically

You can use hotplug/udev to load the madwifi driver automatically. There is nothing to configure; hotplug/udev takes care of everything. If you do not use hotplug or udev, you can add a line like this to /etc/rc.d/rc.modules:

/sbin/modprobe ath_pci

which will then load the kernel module when the computer boots.

If you need to pass parameters to the madwifi driver, like a different country code, you can create a file in the /etc/modprobe.d/ directory which contains these parameters. The filename is yours to choose - let's use 'madwifi' as the name. For example, suppose you need to tell the driver to use country code 25. You create the file “/etc/modprobe.d/madwifi” and add the following single line to it:

options ath_pci countrycode=25

(by the way, a list of country codes is available on the madwifi Wiki).

If your (older) version of Slackware does not have a /etc/modprobe.d directory, you can add the line
options ath_pci countrycode=25

to the file /etc/modprobe.conf (for 2.6 kernels) or /etc/modules.conf (for 2.4 kernels) instead.

Network configuration

rc.wireless.conf

If you have a Wireless Access Point that is broadcasting its station ID (the ESSID), and is not configured for encrypted traffic, then you're ready to go with the default configuration as it comes with Slackware. This kind of open wireless network is typical when

  1. you just took your Wireless Access Point out of the box you bought it in, and didn't have time yet to configure it;
  1. you are at an airport/hotel/pub where they offer free wireless access.

If you need to configure specific parameters to make the wireless card talk to your Access Point - for instance, the ESSID (in case the Access Point is hiding its station ID), or the channel, or a WEP key, etc) then you will need to edit either the file

/etc/rc.d/rc.wireless.conf

or the file

/etc/rc.d/rc.inet1.conf

(one of the two will do) and add a specific configuration that matches your wireless card and Access Point. Let's use /etc/rc.d/rc.wireless.conf as an example of how to configure your wireless.

You will notice that the content of /etc/rc.d/rc.wireless.conf is basically a number of sections that apply to certain (ranges of) wireless network cards. The distinguishing factor is the hardware address (the MAC address) of a card. A section for a specific card or range of cards looks like this:

  MAC_Address)
      INFO="a string that decribes your card type"
      PARAMETER1="value1"
      PARAMETER2="value2"
      [more parameters] .......
      ;;

The MAC_Address in this example can be a full MAC address (six HEX bytes separated by colons, like 00:12:8E:A0:32:DC) that matches a single network card, or a wildcard address that matches a whole range of cards, typically all cards from a specific vendor (like 00:12:8E:A0:*).
You are going to add such a section for your card, and this is how to do it:

rc.inet1.conf

Slackware since release 10.2 understands network interfaces whose names do not start with eth. A network card that shows up as ath0 can not be setup with an IP address using the configuration files that are part of pre-Slackware 10.2 releases. We are going to assume here that you are running Slackware 10.2 or newer. For older releases, read Updating the network scripts and Configuration the manual way.

WPA="wpa_supplicant"
WPADRIVER="wext"

but this is how you could do it in rc.inet1.conf as well:

IFNAME[1]="ath0"
   ...
WLAN_WPA[1]="wpa_supplicant"
WLAN_WPADRIVER[1]="wext"

You can configure your card in either one, or both of the configuration files, but the settings in rc.inet1.conf will always have priority. It depends on your own taste which of the two configuration files you want to put your configuration in, but if I may make a suggestion: don't use rc.wireless.conf and group all of the network configuration (wireless as well as non-wireless) for an interface nicely together in rc.inet1.conf.

(Re) starting the network interface

If you're using Slackware 10.2 or newer, or in case you run an older release but updated your network scripts, you can start your ath0 interface like this:

/etc/rc.d/rc.inet1 ath0_start

or restart it like this (after making changes to the above configuration files for instance):

/etc/rc.d/rc.inet1 ath0_restart

Earlier versions of Slackware will (re-)start all configured interfaces at once, because all you can run is

/etc/rc.d/rc.inet1

Updating the network scripts (Slackware 10.1 and older)

The network scripts of Slackware 10.2 or later can be used in older releases of Slackware as well. You will need /etc/rc.d/rc.wireless* and /etc/rc.d/rc.inet1*
If you have difficulties extracting these files from a Slackware CD or Internet server, you can find them here too.

Network configuration the manual way (Slackware 10.1 and older)

These are the relatively easy ways to get slackware to bring up your interface:

  1. Run /etc/rc.d/rc.wireless to configure the wireless parameters for your card.
  2. Run dhcpcd ath0 which should be enough to get you up and running;
  3. It depends on your local network and your settings if you want ifconfig (instead of dhcpcd) and possibly additional iwconfig commands.
  4. Put a dhcpcd ath0 or ifconfig ath0 statement at the bottom of /etc/rc.d/rc.local
  5. If you're using hotplug, you can have it automatically bring up the interface by editing /etc/hotplug/net.agent and inserting the following lines in the case add|register) branch:
         ath*)
           dhcpcd -n $INTERFACE % If you use dhcp for the interface
           % or if you prefer to just hardcode your interface, put your ifconfig statement here.
           % ifconfig $INTERFACE 192.168.1.1 netmask 255.255.255.0 ...
           ;;

    In the remove|unregister branch it will automatically bring down dhcpcd if running.

Support for WPA encryption

I am assuming that you already have your madwifi-powered card up and running. Do not try to add WPA support if you do not yet have a functional wireless network connection! Also, if you run Slackware older than 10.2 you will need the updated network scripts that are mentioned in the previous section Updating the network scripts (Slackware 10.1 and older).

The madwifi package obtained here works well with the wpa_supplicant package found in Slackware 12.0. Starting with the linux kernel 2.6.14, madwifi and wpa_supplicant can communicate using wpa_supplicant's “wext” driver using the kernel's “wireless extensions”. For older kernel versions, you will need wpa_supplicant's “madwifi” driver for which you need the wpa_supplicant package found here.

If you want to compile your own wpa_supplicant package, you might find some useful information in the Setting up a Client Using WPA-PSK Wiki page.

Note:
Recent wpa_supplicant should have support for roaming open networks as well
as for wpa-protected networks. This makes the waproamd
program obsolete for instance.
Note:
When you want to re-build wpa_supplicant and run a Linux kernel older than 2.6.14,
make sure you have installed the madwifi package on your system as well.
The wpa_supplicant build needs the include files which the madwifi package installs.
If you want to use the SlackBuild scripts for madwifi and wpa_supplicant
which you can find here to rebuild the packages for your system,
build them in that specific order (first build and install madwifi,
then build and install wpa_supplicant).
The madwifi include files will be detected by the wpa_supplicant build script and madwifi support enabled.

WPA debugging

Author(s) and further pointers