#
# Original File
# -------------
#	http://www.Linux-Sec.net/Wireless/Install-HOWTO/madwifi/madwifi.wl-config.sh
#	http://www.Linux-Sec.net/Wireless/Install-HOWTO/WL/wl.install-simple.sh
#
#
# 10-Dec-03 amo Install Wireless PCI card ( Netgear WQG311 -- 802.11g )
# 19-Dec-03 amo Allow for 2.6.0 vs 2.4.23 kernels
# 02-Jan-04 amo Added slackware/redhat switch
# 28-Sep-04 amo Moved and Renamed to wl.install-simple.sh, added ath_rate_onoe modules
#
#
#
# First stop the network
# -----------------------
if [ -f /etc/redhat-release ];
then
  /etc/rc.d/init.d/network stop
fi
#
if [ -f /etc/slackware-version ];
then
  ifconfig ath0 down
fi
#
#
if [ `uname -r` = "2.6.0" ];
then
  #
  rmmod ath_pci.ko
  rmmod ath_hal.ko
  rmmod wlan_wep.ko
  rmmod wlan.ko
  #
  WLAN="/lib/modules/`uname -r`/net/wlan.ko"
  HAL="/lib/modules/`uname -r`/net/ath_hal.ko"
  RATEONE="/lib/modules/`uname -r`/net/ath_rate_onoe.o"
  PCI="/lib/modules/`uname -r`/net/ath_pci.ko"
  #
else 
  #
  rmmod ath_pci.o
  rmmod ath_hal.o
  rmmod wlan_wep.o
  rmmod wlan.o
  #
  WLAN="/lib/modules/`uname -r`/net/wlan.o"
  HAL="/lib/modules/`uname -r`/net/ath_hal.o"
  RATEONE="/lib/modules/`uname -r`/net/ath_rate_onoe.o"
  PCI="/lib/modules/`uname -r`/net/ath_pci.o"
  #
fi
#
#
#
# Add the wireless drivers
# ------------------------
insmod $WLAN
#
insmod  $HAL
#	Warning: loading ath_hal/ath_hal.o will taint the kernel: non-GPL license - Proprietary
#	  See http://www.tux.org/lkml/#export-tainted for information about tainted modules
#	Module ath_hal loaded, with warnings
#
insmod  $RATEONE
#
insmod  $PCI
#	ath0: 11b rates: 1Mbps 2Mbps 5.5Mbps 11Mbps
#	ath0: 11g rates: 1Mbps 2Mbps 5.5Mbps 11Mbps 6Mbps 9Mbps 12Mbps 18Mbps 24Mbps 36Mbps 48Mbps 54Mbps
#	ath0: 802.11 address: 00:09:5b:89:48:97
#
#
# Restart with the wirless network ( ath0 )
# --------------------------------
if [ -f /etc/redhat-release ];
then
  /etc/rc.d/init.d/network start
  #
  # other end of the wireless connection
  #
  route add -net 192.168.1.0 gw 192.168.1.11 netmask 255.255.255.0 ath0
fi
#
if [ -f /etc/slackware-version ];
then
  ifconfig ath0 192.168.1.12 broadcast 192.168.1.255 netmask 255.255.255.0 up
  #
  # other end of the wireless connection
  #
  route add -net 192.168.1.0 gw 192.168.1.12 netmask 255.255.255.0 ath0
fi
#
#
ifconfig -v
#
#
lsmod
# --------
# Module                  Size  Used by    Tainted: P  
# ath_pci                30736   1 
# ath_hal               109792   1  [ath_pci]
# wlan                   37056   1  [ath_pci]
#
#
# dmesg
# --------------
# wlan: 0.7.1.1 BETA (Sam Leffler <sam@errno.com>)
# ath_hal: module license 'Proprietary' taints kernel.
# ath_hal: 0.9.5.3 BETA (Sam Leffler <sam@errno.com>)
# ath_pci: 0.8.3.2 BETA (Sam Leffler <sam@errno.com>)
# ath0: 11b rates: 1Mbps 2Mbps 5.5Mbps 11Mbps
# ath0: 11g rates: 1Mbps 2Mbps 5.5Mbps 11Mbps 6Mbps 9Mbps 12Mbps 18Mbps 24Mbps 36Mbps 48Mbps 54Mbps
# ath0: 802.11 address: 00:09:5b:89:48:97
# ath0: Atheros 5212: mem=0xff8f0000, irq=21
#
#
# End of file

