-PKG_REV:=$(if $(CONFIG_MADWIFI_TESTING),3776,3314)
-PKG_VERSION:=r$(PKG_REV)
+
+ifneq ($(CONFIG_MADWIFI_UPSTREAM),)
+ 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-upstream
+else