This patch allows the user to select the version 
of madwifi to be built. At the moment the following 
sources are supported:

- Use subversion revision 3314
- Use subversion revision 3776
- Use stable release version 0.9.4

Since many user asked on the forum how to use madwifi 
0.9.4 i thought that this patch could be usefull

Signed-off-by: Roberto Riggio <[EMAIL PROTECTED]> 

--
Index: patches-stable/111-minstrel_crash.patch
===================================================================
--- patches-stable/111-minstrel_crash.patch     (revisione 0)
+++ patches-stable/111-minstrel_crash.patch     (revisione 0)
@@ -0,0 +1,14 @@
+Index: madwifi-0.9.4/ath_rate/minstrel/minstrel.c
+===================================================================
+--- madwifi-0.9.4.old/ath_rate/minstrel/minstrel.c     2007-12-12 
05:11:07.000000000 +0100
++++ madwifi-0.9.4/ath_rate/minstrel/minstrel.c 2008-07-24 15:15:41.000000000 
+0200
+@@ -394,6 +394,9 @@
+       int rc1, rc2, rc3;         /* Index into the rate table, so for 
example, it is  0..11 */
+       int rixc1, rixc2, rixc3;   /* The actual bit rate used */
+ 
++      if (sn->num_rates <= 0)
++              return; 
++
+       if (sn->is_sampling) {
+               sn->is_sampling = 0;
+               if (sn->rs_sample_rate_slower)
Index: patches-stable/104-autocreate_none.patch
===================================================================
--- patches-stable/104-autocreate_none.patch    (revisione 0)
+++ patches-stable/104-autocreate_none.patch    (revisione 0)
@@ -0,0 +1,13 @@
+Index: madwifi-0.9.4/ath/if_ath.c
+===================================================================
+--- madwifi-0.9.4.old/ath/if_ath.c     2008-02-13 06:13:10.000000000 +0100
++++ madwifi-0.9.4/ath/if_ath.c 2008-05-06 10:25:15.000000000 +0200
+@@ -404,7 +404,7 @@
+       struct ath_hal *ah;
+       HAL_STATUS status;
+       int error = 0, i;
+-      int autocreatemode = IEEE80211_M_STA;
++      int autocreatemode = -1;
+       u_int8_t csz;
+ 
+       sc->devid = devid;
Index: Config.in
===================================================================
--- Config.in   (revisione 11967)
+++ Config.in   (copia locale)
@@ -5,14 +5,24 @@
        depends on EXPERIMENTAL && PACKAGE_kmod-madwifi
        default n
 
-config MADWIFI_TESTING
-       bool "Use the testing version of MadWiFi"
+choice
+       prompt "Madwifi version"
        depends on PACKAGE_kmod-madwifi
-       default n
+       default MADWIFI_LEGACY
        help
-         Use the testing version of MadWiFi, which is newer, but also less 
tested
-         May contain unexpected bugs :)
+         This option allows you to select the version of MadiWifi to be built.
 
+config MADWIFI_LEGACY
+       bool "Use subversion revision 3314"
+
+config MADWIFI_TESTING
+       bool "Use subversion revision 3776"
+
+config MADWIFI_STABLE
+       bool "Use stable release version 0.9.4"
+
+endchoice
+
 choice
        prompt "Rate control algorithm selection"
        depends on PACKAGE_kmod-madwifi
Index: Makefile
===================================================================
--- Makefile    (revisione 11967)
+++ Makefile    (copia locale)
@@ -10,21 +10,39 @@
 include $(INCLUDE_DIR)/kernel.mk
 
 PKG_NAME:=madwifi
-PKG_REV:=$(if $(CONFIG_MADWIFI_TESTING),3776,3314)
-PKG_VERSION:=r$(PKG_REV)
+
+ifneq ($(CONFIG_MADWIFI_STABLE),)
+
+  PKG_VERSION:=0.9.4
+  PKG_RELEASE:=1
+
+  PKG_SOURCE:=madwifi-$(PKG_VERSION).tar.gz
+  PKG_SOURCE_URL:=http://downloads.sourceforge.net/madwifi/
+  PKG_MD5SUM:=399d20de8d855a59f20058857c2178ad
+
+  PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/madwifi-$(PKG_VERSION)
+
+  PATCH_DIR=./patches-stable
+
+else
+
+  PKG_REV:=$(if $(CONFIG_MADWIFI_TESTING),3776,3314)
+  PKG_VERSION:=r$(PKG_REV)
 # PKG_BRANCH:=madwifi-dfs
-PKG_RELEASE:=1
+  PKG_RELEASE:=1
 
-PKG_SOURCE_PROTO:=svn
-PKG_SOURCE_VERSION:=$(PKG_REV)
-PKG_SOURCE_SUBDIR:=$(if 
$(PKG_BRANCH),$(PKG_BRANCH),madwifi-trunk)-$(PKG_VERSION)
-PKG_SOURCE_URL:=http://svn.madwifi.org/madwifi/$(if 
$(PKG_BRANCH),branches/$(PKG_BRANCH),trunk)
-PKG_SOURCE:=$(PKG_SOURCE_SUBDIR).tar.gz
+  PKG_SOURCE_PROTO:=svn
+  PKG_SOURCE_VERSION:=$(PKG_REV)
+  PKG_SOURCE_SUBDIR:=$(if 
$(PKG_BRANCH),$(PKG_BRANCH),madwifi-trunk)-$(PKG_VERSION)
+  PKG_SOURCE_URL:=http://svn.madwifi.org/madwifi/$(if 
$(PKG_BRANCH),branches/$(PKG_BRANCH),trunk)
+  PKG_SOURCE:=$(PKG_SOURCE_SUBDIR).tar.gz
 
-PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/$(if 
$(PKG_BRANCH),$(PKG_BRANCH),madwifi-trunk)-$(PKG_VERSION)
+  PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/$(if 
$(PKG_BRANCH),$(PKG_BRANCH),madwifi-trunk)-$(PKG_VERSION)
 
-PATCH_DIR=$(if $(CONFIG_MADWIFI_TESTING),./patches-testing,./patches)
+  PATCH_DIR=$(if $(CONFIG_MADWIFI_TESTING),./patches-testing,./patches)
 
+endif
+
 include $(INCLUDE_DIR)/package.mk
 
 ifneq ($(CONFIG_TARGET_atheros),)
@@ -125,7 +143,6 @@
   MADWIFI_APPLETS:=$(strip $(MADWIFI_APPLETS)),athdebug,80211debug
 endif
 
-
 define KernelPackage/madwifi
   SUBMENU:=Wireless Drivers
   TITLE:=Driver for Atheros wireless chipsets
@@ -164,7 +181,10 @@
 MAKE_VARS:= \
        COPTS="-DCONFIG_ATHEROS_RATE_DEFAULT='\"$(RATE_CONTROL)\"' 
-DATH_REVERSE_ENGINEERING=1" \
 
-HALFILE:=$(lastword $(sort $(wildcard ./ath_hal-*.tgz)))
+ifeq ($(CONFIG_MADWIFI_STABLE),)
+  HALFILE:=$(lastword $(sort $(wildcard ./ath_hal-*.tgz)))
+endif
+
 ifneq ($(HALFILE),)
   define Build/Prepare
        $(call Build/Prepare/Default)
@@ -217,7 +237,7 @@
        $(INSTALL_DIR) $(1)/lib/wifi
        $(INSTALL_DATA) ./files/lib/wifi/madwifi.sh $(1)/lib/wifi
        $(INSTALL_DIR) $(1)/usr/sbin
-       $(CP) $(PKG_BUILD_DIR)/tools/{madwifi_multi,$(MADWIFI_APPLETS)} 
$(1)/usr/sbin/
+       $(CP) $(PKG_BUILD_DIR)/tools/{$(MADWIFI_APPLETS)} $(1)/usr/sbin/
 endef
 
 $(eval $(call KernelPackage,madwifi))
_______________________________________________
openwrt-devel mailing list
[email protected]
http://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

Reply via email to