From 2d6e73eaf2006f979662589bbc0f8e9fc8f1fe70 Mon Sep 17 00:00:00 2001 From: thepeople Date: Thu, 15 May 2008 00:59:34 +0000 Subject: This patch adds a number of configuration options to the MadWifi package. You can now configure the HAL, bus, default rate control algorithm as well as the debug mode from within make menuconfig. The goal is to be able to support hardware profiles with different HALs without messing around with the Makefile directly. Signed-off-by: Axel Gembe git-svn-id: svn://svn.openwrt.org/openwrt/trunk@11140 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- package/madwifi/Config.in | 152 ++++++++++++++++++++++++++++++++++++++++++++++ package/madwifi/Makefile | 144 ++++++++++++++++++++++++++++++++----------- 2 files changed, 261 insertions(+), 35 deletions(-) create mode 100644 package/madwifi/Config.in (limited to 'package') diff --git a/package/madwifi/Config.in b/package/madwifi/Config.in new file mode 100644 index 000000000..d2bc4e0bb --- /dev/null +++ b/package/madwifi/Config.in @@ -0,0 +1,152 @@ +# MadWifi configuration + +config MADWIFI_DEBUG + bool "Enable compilation of debugging features" + depends on EXPERIMENTAL + default n + +choice + prompt "Bus selection" + default MADWIFI_BUS_DEFAULT + help + This option controls how MadWifi communicates with the hardware. + +config MADWIFI_BUS_DEFAULT + bool "Use default bus" + help + This makes MadWifi determine the needed bus based on the target + hardware. This will generally work most of the time, but there are some + cases where you need to override it. + +config MADWIFI_BUS_PCI + bool "Use PCI bus" + depends on PCI_SUPPORT + +config MADWIFI_BUS_AHB + bool "Use AHB bus" + depends on TARGET_atheros + +endchoice + +choice + prompt "HAL selection" + default MADWIFI_HAL_DEFAULT + help + This option controls how MadWifi communicates with the hardware. + +config MADWIFI_HAL_DEFAULT + bool "Use default HAL" + help + This makes MadWifi determine the needed HAL based on the target + hardware. This will generally work most of the time, but there are some + cases where you need to override it. + +config MADWIFI_HAL_MIPS_BE_ELF + bool "Use MIPS big endian ELF HAL" + depends on mips + depends on BIG_ENDIAN + +config MADWIFI_HAL_MIPS_LE_ELF + bool "Use MIPS little endian ELF HAL" + depends on mips + depends on !BIG_ENDIAN + +config MADWIFI_HAL_I386_ELF + bool "Use i386 ELF HAL" + depends on TARGET_x86 + +config MADWIFI_HAL_XSCALE_BE_ELF + bool "Use XScale big endian ELF HAL" + depends TARGET_ixp4xx + depends on BIG_ENDIAN + +config MADWIFI_HAL_XSCALE_LE_ELF + bool "Use XScale little endian ELF HAL" + depends TARGET_iop32x + depends on !BIG_ENDIAN + +config MADWIFI_HAL_ARMV4_LE_ELF + bool "Use ARMV4 little endian ELF HAL" + depends TARGET_storm + depends on !BIG_ENDIAN + +config MADWIFI_HAL_AP30 + bool "Use AP30 HAL" + depends on TARGET_atheros + +config MADWIFI_HAL_AP43 + bool "Use AP43 HAL" + depends on TARGET_atheros + +config MADWIFI_HAL_AP51 + bool "Use AP51 HAL" + depends on TARGET_atheros + +config MADWIFI_HAL_AP61 + bool "Use AP61 HAL" + depends on TARGET_atheros + +endchoice + +choice + prompt "Rate control algorithm selection" + default MADWIFI_RCA_MINSTREL + help + This option controls how MadWifi chooses its bitrate. + +config MADWIFI_RCA_MINSTREL + bool "Use the Minstrel rate control algorithm" + help + This code is takes a wandering minstrel approach. Wander around the + different rates, singing wherever you can. And then, look at the + performance, and make a choice. Note that the wandering minstrel will + always wander in directions where he/she feels he/she will get paid + the best for his/her work. + +config MADWIFI_RCA_ONOE + bool "Use the Onoe rate control algorithm" + help + Onoe is a credit based RCA where the value of the credit is determined + by the frequency of successful, erroneous and retransmissions + accumulated during a fixed invocation period of 1000 ms. If less than + 10% of the packets need to be retransmitted at a particular rate, Onoe + keeps increasing its credit point till the threshold value of 10 is + reached. At this point, the current transmission rate is increased to + the next available higher rate and the process repeated with credit + score of zero. Similar logic holds for deducting the credit score and + moving to a lower bit-rate for failed packet + transmission/retransmission attempts. However, once a bit-rate has + been marked as failure in the previous attempt, Onoe will not attempt + to select that bit-rate until 10 seconds have elapsed since the last + attempt. Due to the manner in which it operates, Onoe is conservative + in rate selection and is less sensitive to individual packet failure. + +config MADWIFI_RCA_AMRR + bool "Use the AMRR rate control algorithm" + help + AMRR uses Binary Exponential Backoff (BEB) technique to adapt the + length (threshold) of the sampling period used to change the values of + bit-rate and transmission count parameters. It uses probe packets and + depending on their transmission status adaptively changes the threshold + value. The adaptation mechanism ensures fewer failed + transmission/retransmission and higher throughput by not switching to a + higher rate as specified by the backoff mechanism. In addition to this, + the AMRR employs heuristics to capture the short-term variations of the + channel by judiciously setting the rate and transmission count + parameters. + +config MADWIFI_RCA_SAMPLERATE + bool "Use the SampleRate rate control algorithm" + help + SampleRate decides on the transmission bit-rate based on the past + history of performance; it keeps a record of the number of successive + failures, the number of successful transmits and the total transmission + time along with the destination for that bit-rate. Stale samples are + removed based on a EWMA windowing mechanism. If in the sampling + process, no successful acknowledgment is received or the number of + packets sent is multiple of 10 on a specific link, it transmits the + packet with the highest rate which has not failed 4 successive times. + Other than that it transmits packets at the rate which has the lowest + average transmission time. + +endchoice diff --git a/package/madwifi/Makefile b/package/madwifi/Makefile index 697f2b68a..ef83702a8 100644 --- a/package/madwifi/Makefile +++ b/package/madwifi/Makefile @@ -25,48 +25,115 @@ PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/$(if $(PKG_BRANCH),$(PKG_BRANCH),madwifi-trun include $(INCLUDE_DIR)/package.mk -# MADWIFI_DEBUG=1 +ifdef CONFIG_MADWIFI_BUS_DEFAULT + ifneq ($(CONFIG_TARGET_atheros),) + BUS:=AHB + else + ifneq ($(CONFIG_PCI_SUPPORT),) + BUS:=PCI + endif + endif -ifeq ($(ARCH),mips) - HAL_TARGET:=mips-be-elf -endif -ifeq ($(ARCH),mipsel) - HAL_TARGET:=mips-le-elf -endif -ifeq ($(ARCH),i386) - HAL_TARGET:=i386-elf -endif -ifeq ($(ARCH),i686) - HAL_TARGET:=i386-elf -endif -ifeq ($(BOARD),ixp4xx) - HAL_TARGET:=xscale-be-elf -endif -ifeq ($(BOARD),iop32x) - HAL_TARGET:=xscale-le-elf -endif -ifeq ($(ARCH),powerpc) - HAL_TARGET:=powerpc-be-elf -endif -ifeq ($(BOARD),storm) - HAL_TARGET:=armv4-le-elf + # XXX: remove this check later when we have PCI support properly detected on all targets + ifneq ($(CONFIG_TARGET_ar7)$(CONFIG_TARGET_uml),) + BUS:= + endif +else + ifdef CONFIG_MADWIFI_BUS_PCI + BUS:=PCI + else + ifdef CONFIG_MADWIFI_BUS_AHB + BUS:=AHB + endif + endif endif -ifneq ($(CONFIG_TARGET_atheros),) - BUS:=AHB - HAL_TARGET:=ap51 +ifdef CONFIG_MADWIFI_HAL_DEFAULT + ifeq ($(ARCH),mips) + HAL_TARGET:=mips-be-elf + endif + ifeq ($(ARCH),mipsel) + HAL_TARGET:=mips-le-elf + endif + ifeq ($(ARCH),i386) + HAL_TARGET:=i386-elf + endif + ifeq ($(ARCH),i686) + HAL_TARGET:=i386-elf + endif + ifeq ($(BOARD),ixp4xx) + HAL_TARGET:=xscale-be-elf + endif + ifeq ($(BOARD),iop32x) + HAL_TARGET:=xscale-le-elf + endif + ifeq ($(ARCH),powerpc) + HAL_TARGET:=powerpc-be-elf + endif + ifeq ($(BOARD),storm) + HAL_TARGET:=armv4-le-elf + endif + ifneq ($(CONFIG_TARGET_atheros),) + HAL_TARGET:=ap51 + endif else - ifneq ($(CONFIG_PCI_SUPPORT),) - BUS:=PCI + ifdef CONFIG_MADWIFI_HAL_MIPS_BE_ELF + HAL_TARGET:=mips-be-elf + endif + + ifdef CONFIG_MADWIFI_HAL_MIPS_LE_ELF + HAL_TARGET:=mips-le-elf endif + + ifdef CONFIG_MADWIFI_HAL_I386_ELF + HAL_TARGET:=i386-elf + endif + + ifdef CONFIG_MADWIFI_HAL_XSCALE_BE_ELF + HAL_TARGET:=xscale-be-elf + endif + + ifdef CONFIG_MADWIFI_HAL_XSCALE_LE_ELF + HAL_TARGET:=xscale-le-elf + endif + + ifdef CONFIG_MADWIFI_HAL_ARMV4_LE_ELF + HAL_TARGET:=armv4-le-elf + endif + + ifdef CONFIG_MADWIFI_HAL_AP30 + HAL_TARGET:=ap30 + endif + + ifdef CONFIG_MADWIFI_HAL_AP43 + HAL_TARGET:=ap43 + endif + + ifdef CONFIG_MADWIFI_HAL_AP51 + HAL_TARGET:=ap51 + endif + + ifdef CONFIG_MADWIFI_HAL_AP61 + HAL_TARGET:=ap61 + endif + +endif + +ifdef CONFIG_MADWIFI_RCA_MINSTREL + RATE_CONTROL:=minstrel +endif + +ifdef CONFIG_MADWIFI_RCA_ONOE + RATE_CONTROL:=onoe endif -# XXX: remove this check later when we have PCI support properly detected on all targets -ifneq ($(CONFIG_TARGET_ar7)$(CONFIG_TARGET_uml),) - BUS:= +ifdef CONFIG_MADWIFI_RCA_AMRR + RATE_CONTROL:=amrr endif -RATE_CONTROL:=minstrel +ifdef CONFIG_MADWIFI_RCA_SAMPLERATE + RATE_CONTROL:=sample +endif MADWIFI_FILES:= \ $(PKG_BUILD_DIR)/net80211/wlan.$(LINUX_KMOD_SUFFIX) \ @@ -102,7 +169,7 @@ ifeq ($(findstring PCI,$(BUS)),PCI) endif MADWIFI_APPLETS:=80211stats,athchans,athctrl,athkey,athstats,wlanconfig -ifneq ($(MADWIFI_DEBUG),) +ifdef CONFIG_MADWIFI_DEBUG MADWIFI_APPLETS:=$(strip $(MADWIFI_APPLETS)),athdebug,80211debug endif @@ -120,6 +187,13 @@ define KernelPackage/madwifi/description This package contains a driver for Atheros 802.11a/b/g chipsets. endef +define KernelPackage/madwifi/config + menu "MadWifi Configuration" + depends on PACKAGE_kmod-madwifi + source "$(SOURCE)/Config.in" + endmenu +endef + MAKE_ARGS:= \ PATH="$(TARGET_PATH)" \ ARCH="$(LINUX_KARCH)" \ @@ -131,7 +205,7 @@ MAKE_ARGS:= \ LDOPTS="--no-warn-mismatch " \ ATH_RATE="ath_rate/$(RATE_CONTROL)" \ WARNINGS="-Wno-unused" \ - $(if $(MADWIFI_DEBUG),,DEBUG="") \ + $(ifndef CONFIG_MADWIFI_DEBUG,DEBUG="") \ DOMULTI=1 MAKE_VARS:= \ -- cgit v1.2.3