include $(INCLUDE_DIR)/kernel.mk
PKG_NAME:=madwifi
-PKG_VERSION:=r2420-20070602
+PKG_VERSION:=r2568-20070710
PKG_BRANCH:=madwifi-ng
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_BRANCH)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://snapshots.madwifi.org/$(PKG_BRANCH)
PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/$(PKG_BRANCH)-$(PKG_VERSION)
-PKG_MD5SUM:=1ba88326b8dc8c231562329fc2e39578
+PKG_MD5SUM:=fe5d41acd085d2c46934be3f8839e694
include $(INCLUDE_DIR)/package.mk
define KernelPackage/madwifi
SUBMENU:=Wireless Drivers
TITLE:=Driver for Atheros wireless chipsets
- DEPENDS:=+wireless-tools
+ DEPENDS:=+wireless-tools @!LINUX_2_6_AVR32
DESCRIPTION:=\
This package contains a driver for Atheros 802.11a/b/g chipsets.
URL:=http://madwifi.org/
-Index: madwifi-ng-r2420-20070602/hal/public/mips-be-elf.inc
+Index: madwifi-ng-r2568-20070710/hal/public/mips-be-elf.inc
===================================================================
---- madwifi-ng-r2420-20070602.orig/hal/public/mips-be-elf.inc 2007-06-04 13:21:53.676816552 +0200
-+++ madwifi-ng-r2420-20070602/hal/public/mips-be-elf.inc 2007-06-04 13:21:53.760803784 +0200
+--- madwifi-ng-r2568-20070710.orig/hal/public/mips-be-elf.inc 2007-07-13 11:18:14.641130895 +0200
++++ madwifi-ng-r2568-20070710/hal/public/mips-be-elf.inc 2007-07-13 11:18:14.797139785 +0200
@@ -71,5 +71,5 @@
LDOPTS= -EB
-COPTS+= -G 0 -EB -mno-abicalls -fno-pic -mips2 -Wa,--trap \
+COPTS+= -G 0 -mno-abicalls -fno-pic -mips32 -Wa,--trap \
-fno-strict-aliasing -fno-common -fomit-frame-pointer -mlong-calls
-Index: madwifi-ng-r2420-20070602/hal/public/mips-le-elf.inc
+Index: madwifi-ng-r2568-20070710/hal/public/mips-le-elf.inc
===================================================================
---- madwifi-ng-r2420-20070602.orig/hal/public/mips-le-elf.inc 2007-06-04 13:21:53.681815792 +0200
-+++ madwifi-ng-r2420-20070602/hal/public/mips-le-elf.inc 2007-06-04 13:21:53.760803784 +0200
+--- madwifi-ng-r2568-20070710.orig/hal/public/mips-le-elf.inc 2007-07-13 11:18:14.645131124 +0200
++++ madwifi-ng-r2568-20070710/hal/public/mips-le-elf.inc 2007-07-13 11:18:14.801140014 +0200
@@ -68,5 +68,5 @@
LDOPTS= -EL
-COPTS+= -G 0 -EL -mno-abicalls -fno-pic -mips2 -Wa,--trap \
+COPTS+= -G 0 -mno-abicalls -fno-pic -mips32 -Wa,--trap \
-fno-strict-aliasing -fno-common -fomit-frame-pointer -mlong-calls
-Index: madwifi-ng-r2420-20070602/hal/public/xscale-be-elf.inc
+Index: madwifi-ng-r2568-20070710/hal/public/xscale-be-elf.inc
===================================================================
---- madwifi-ng-r2420-20070602.orig/hal/public/xscale-be-elf.inc 2007-06-04 13:21:53.688814728 +0200
-+++ madwifi-ng-r2420-20070602/hal/public/xscale-be-elf.inc 2007-06-04 13:21:53.760803784 +0200
+--- madwifi-ng-r2568-20070710.orig/hal/public/xscale-be-elf.inc 2007-07-13 11:18:14.657131806 +0200
++++ madwifi-ng-r2568-20070710/hal/public/xscale-be-elf.inc 2007-07-13 11:18:14.821141156 +0200
@@ -77,5 +77,5 @@
LDOPTS= -EB
-COPTS+= -march=armv4 -mbig-endian -fno-strict-aliasing -fno-common -mapcs-32 \
+COPTS+= -march=armv5te -mbig-endian -fno-strict-aliasing -fno-common \
-mtune=xscale -mshort-load-bytes
-Index: madwifi-ng-r2420-20070602/Makefile
-===================================================================
---- madwifi-ng-r2420-20070602.orig/Makefile 2007-06-04 13:21:53.694813816 +0200
-+++ madwifi-ng-r2420-20070602/Makefile 2007-06-04 13:21:53.760803784 +0200
-@@ -56,7 +56,7 @@
-
- all: modules tools
-
--modules: configcheck svnversion.h
-+modules: svnversion.h
- ifdef LINUX24
- for i in $(DIRS_MODULES); do \
- $(MAKE) -C $$i || exit 1; \
-Index: madwifi-ng-r2420-20070602/tools/80211debug.c
+Index: madwifi-ng-r2568-20070710/tools/80211debug.c
===================================================================
---- madwifi-ng-r2420-20070602.orig/tools/80211debug.c 2007-06-04 13:21:53.599828256 +0200
-+++ madwifi-ng-r2420-20070602/tools/80211debug.c 2007-06-04 13:21:53.990768824 +0200
+--- madwifi-ng-r2568-20070710.orig/tools/80211debug.c 2007-07-13 11:18:14.513123601 +0200
++++ madwifi-ng-r2568-20070710/tools/80211debug.c 2007-07-13 11:18:15.097156885 +0200
@@ -49,6 +49,10 @@
#include <getopt.h>
#include <err.h>
const char *ifname = "ath0";
const char *cp, *tp;
const char *sep;
-Index: madwifi-ng-r2420-20070602/tools/80211stats.c
+Index: madwifi-ng-r2568-20070710/tools/80211stats.c
===================================================================
---- madwifi-ng-r2420-20070602.orig/tools/80211stats.c 2007-06-04 13:21:53.607827040 +0200
-+++ madwifi-ng-r2420-20070602/tools/80211stats.c 2007-06-04 13:21:53.991768672 +0200
+--- madwifi-ng-r2568-20070710.orig/tools/80211stats.c 2007-07-13 11:18:14.517123827 +0200
++++ madwifi-ng-r2568-20070710/tools/80211stats.c 2007-07-13 11:18:15.101157110 +0200
@@ -60,6 +60,10 @@
#include "net80211/ieee80211_crypto.h"
#include "net80211/ieee80211_ioctl.h"
int c, len;
struct ieee80211req_sta_info *si;
u_int8_t buf[24*1024], *cp;
-Index: madwifi-ng-r2420-20070602/tools/athchans.c
+Index: madwifi-ng-r2568-20070710/tools/athchans.c
===================================================================
---- madwifi-ng-r2420-20070602.orig/tools/athchans.c 2007-06-04 13:21:53.613826128 +0200
-+++ madwifi-ng-r2420-20070602/tools/athchans.c 2007-06-04 13:21:53.991768672 +0200
+--- madwifi-ng-r2568-20070710.orig/tools/athchans.c 2007-07-13 11:18:14.525124286 +0200
++++ madwifi-ng-r2568-20070710/tools/athchans.c 2007-07-13 11:18:15.121158252 +0200
@@ -59,6 +59,10 @@
#include "net80211/ieee80211_crypto.h"
#include "net80211/ieee80211_ioctl.h"
const char *ifname = "wifi0";
struct ieee80211req_chanlist chanlist;
int c;
-Index: madwifi-ng-r2420-20070602/tools/athctrl.c
+Index: madwifi-ng-r2568-20070710/tools/athctrl.c
===================================================================
---- madwifi-ng-r2420-20070602.orig/tools/athctrl.c 2007-06-04 13:21:53.618825368 +0200
-+++ madwifi-ng-r2420-20070602/tools/athctrl.c 2007-06-04 13:21:53.991768672 +0200
+--- madwifi-ng-r2568-20070710.orig/tools/athctrl.c 2007-07-13 11:18:14.533124742 +0200
++++ madwifi-ng-r2568-20070710/tools/athctrl.c 2007-07-13 11:18:15.149159848 +0200
@@ -53,6 +53,10 @@
#include <net/if.h>
char device[IFNAMSIZ + 1];
int distance = -1;
int c;
-Index: madwifi-ng-r2420-20070602/tools/athdebug.c
+Index: madwifi-ng-r2568-20070710/tools/athdebug.c
===================================================================
---- madwifi-ng-r2420-20070602.orig/tools/athdebug.c 2007-06-04 13:21:53.624824456 +0200
-+++ madwifi-ng-r2420-20070602/tools/athdebug.c 2007-06-04 13:21:53.991768672 +0200
+--- madwifi-ng-r2568-20070710.orig/tools/athdebug.c 2007-07-13 11:18:14.537124968 +0200
++++ madwifi-ng-r2568-20070710/tools/athdebug.c 2007-07-13 11:18:15.169160989 +0200
@@ -52,6 +52,10 @@
#include <getopt.h>
#include <err.h>
#ifdef __linux__
const char *ifname = "wifi0";
#else
-Index: madwifi-ng-r2420-20070602/tools/athkey.c
+Index: madwifi-ng-r2568-20070710/tools/athkey.c
===================================================================
---- madwifi-ng-r2420-20070602.orig/tools/athkey.c 2007-06-04 13:21:53.630823544 +0200
-+++ madwifi-ng-r2420-20070602/tools/athkey.c 2007-06-04 13:21:54.000767304 +0200
+--- madwifi-ng-r2568-20070710.orig/tools/athkey.c 2007-07-13 11:18:14.545125427 +0200
++++ madwifi-ng-r2568-20070710/tools/athkey.c 2007-07-13 11:18:15.197162582 +0200
@@ -59,6 +59,10 @@
#include "net80211/ieee80211_crypto.h"
#include "net80211/ieee80211_ioctl.h"
const char *ifname = "wifi0";
struct ieee80211req_key setkey;
struct ieee80211req_del_key delkey;
-Index: madwifi-ng-r2420-20070602/tools/athstats.c
+Index: madwifi-ng-r2568-20070710/tools/athstats.c
===================================================================
---- madwifi-ng-r2420-20070602.orig/tools/athstats.c 2007-06-04 13:21:53.635822784 +0200
-+++ madwifi-ng-r2420-20070602/tools/athstats.c 2007-06-04 13:21:54.000767304 +0200
+--- madwifi-ng-r2568-20070710.orig/tools/athstats.c 2007-07-13 11:18:14.553125879 +0200
++++ madwifi-ng-r2568-20070710/tools/athstats.c 2007-07-13 11:18:15.237164863 +0200
@@ -63,6 +63,10 @@
#include "wireless_copy.h"
#include "if_athioctl.h"
#ifdef __linux__
const char *ifname = "wifi0";
#else
-Index: madwifi-ng-r2420-20070602/tools/do_multi.c
+Index: madwifi-ng-r2568-20070710/tools/do_multi.c
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ madwifi-ng-r2420-20070602/tools/do_multi.c 2007-06-04 13:21:54.000767304 +0200
++++ madwifi-ng-r2568-20070710/tools/do_multi.c 2007-07-13 11:18:15.265166457 +0200
@@ -0,0 +1,30 @@
+#include <string.h>
+#include "do_multi.h"
+
+ return ret;
+}
-Index: madwifi-ng-r2420-20070602/tools/do_multi.h
+Index: madwifi-ng-r2568-20070710/tools/do_multi.h
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ madwifi-ng-r2420-20070602/tools/do_multi.h 2007-06-04 13:21:54.000767304 +0200
++++ madwifi-ng-r2568-20070710/tools/do_multi.h 2007-07-13 11:18:15.293168054 +0200
@@ -0,0 +1,9 @@
+
+int a80211debug_init(int argc, char *argv[]);
+int athkey_init(int argc, char *argv[]);
+int athstats_init(int argc, char *argv[]);
+int wlanconfig_init(int argc, char *argv[]);
-Index: madwifi-ng-r2420-20070602/tools/Makefile
+Index: madwifi-ng-r2568-20070710/tools/Makefile
===================================================================
---- madwifi-ng-r2420-20070602.orig/tools/Makefile 2007-06-04 13:21:53.649820656 +0200
-+++ madwifi-ng-r2420-20070602/tools/Makefile 2007-06-04 13:21:54.001767152 +0200
+--- madwifi-ng-r2568-20070710.orig/tools/Makefile 2007-07-13 11:18:14.569126791 +0200
++++ madwifi-ng-r2568-20070710/tools/Makefile 2007-07-13 11:18:15.313169194 +0200
@@ -49,6 +49,12 @@
ALL= athstats 80211stats athkey athchans athctrl \
athstats: athstats.c
$(CC) -o athstats $(ALL_CFLAGS) -I$(TOP)/ath $(LDFLAGS) athstats.c
80211stats: 80211stats.c
-Index: madwifi-ng-r2420-20070602/tools/wlanconfig.c
+Index: madwifi-ng-r2568-20070710/tools/wlanconfig.c
===================================================================
---- madwifi-ng-r2420-20070602.orig/tools/wlanconfig.c 2007-06-04 13:21:53.656819592 +0200
-+++ madwifi-ng-r2420-20070602/tools/wlanconfig.c 2007-06-04 13:21:54.001767152 +0200
+--- madwifi-ng-r2568-20070710.orig/tools/wlanconfig.c 2007-07-13 11:18:14.577127250 +0200
++++ madwifi-ng-r2568-20070710/tools/wlanconfig.c 2007-07-13 11:18:15.337170561 +0200
@@ -62,6 +62,10 @@
#include "net80211/ieee80211_crypto.h"
#include "net80211/ieee80211_ioctl.h"
+++ /dev/null
-Index: madwifi-ng-r2420-20070602/ath/if_ath.c
-===================================================================
---- madwifi-ng-r2420-20070602.orig/ath/if_ath.c 2007-06-04 13:21:53.574832056 +0200
-+++ madwifi-ng-r2420-20070602/ath/if_ath.c 2007-06-04 13:21:54.287723680 +0200
-@@ -269,7 +269,7 @@
- static int ath_xchanmode = AH_TRUE; /* enable extended channels */
- static char *autocreate = NULL;
- static char *ratectl = DEF_RATE_CTL;
--static int rfkill = -1;
-+static int rfkill = 0;
- #ifdef ATH_CAP_TPC
- static int tpc = -1;
- #endif
-Index: madwifi-ng-r2420-20070602/ath/if_ath.c
+Index: madwifi-ng-r2568-20070710/ath/if_ath.c
===================================================================
---- madwifi-ng-r2420-20070602.orig/ath/if_ath.c 2007-06-04 13:21:54.287723680 +0200
-+++ madwifi-ng-r2420-20070602/ath/if_ath.c 2007-06-04 13:21:54.479694496 +0200
-@@ -424,7 +424,7 @@
+--- madwifi-ng-r2568-20070710.orig/ath/if_ath.c 2007-07-13 11:18:14.437119270 +0200
++++ madwifi-ng-r2568-20070710/ath/if_ath.c 2007-07-13 11:18:15.697191079 +0200
+@@ -427,7 +427,7 @@
HAL_STATUS status;
int error = 0;
unsigned int i;
-Index: madwifi-ng-r2420-20070602/net80211/ieee80211_rate.c
+Index: madwifi-ng-r2568-20070710/net80211/ieee80211_rate.c
===================================================================
---- madwifi-ng-r2420-20070602.orig/net80211/ieee80211_rate.c 2007-06-04 13:21:53.530838744 +0200
-+++ madwifi-ng-r2420-20070602/net80211/ieee80211_rate.c 2007-06-04 13:21:54.814643576 +0200
+--- madwifi-ng-r2568-20070710.orig/net80211/ieee80211_rate.c 2007-07-13 11:18:14.361114937 +0200
++++ madwifi-ng-r2568-20070710/net80211/ieee80211_rate.c 2007-07-13 11:18:15.945205212 +0200
@@ -100,8 +100,18 @@
ieee80211_load_module(buf);
-Index: madwifi-ng-r2420-20070602/ath/if_ath.c
+Index: madwifi-ng-r2568-20070710/ath/if_ath.c
===================================================================
---- madwifi-ng-r2420-20070602.orig/ath/if_ath.c 2007-06-04 13:21:54.479694496 +0200
-+++ madwifi-ng-r2420-20070602/ath/if_ath.c 2007-06-04 13:21:55.006614392 +0200
-@@ -1980,7 +1980,10 @@
+--- madwifi-ng-r2568-20070710.orig/ath/if_ath.c 2007-07-13 11:18:15.697191079 +0200
++++ madwifi-ng-r2568-20070710/ath/if_ath.c 2007-07-13 11:18:16.181218662 +0200
+@@ -1988,7 +1988,10 @@
ath_draintxq(sc);
if (!sc->sc_invalid) {
ath_stoprecv(sc);
-Index: madwifi-ng-r2420-20070602/ath_rate/minstrel/minstrel.c
+Index: madwifi-ng-r2568-20070710/ath_rate/minstrel/minstrel.c
===================================================================
---- madwifi-ng-r2420-20070602.orig/ath_rate/minstrel/minstrel.c 2007-06-04 13:21:53.488845128 +0200
-+++ madwifi-ng-r2420-20070602/ath_rate/minstrel/minstrel.c 2007-06-04 13:21:55.198585208 +0200
+--- madwifi-ng-r2568-20070710.orig/ath_rate/minstrel/minstrel.c 2007-07-13 11:18:14.209106275 +0200
++++ madwifi-ng-r2568-20070710/ath_rate/minstrel/minstrel.c 2007-07-13 11:18:16.433233021 +0200
@@ -388,6 +388,9 @@
+ struct minstrel_node *sn = ATH_NODE_MINSTREL(an);
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;
-Index: madwifi-ng-r2420-20070602/ath/if_ath.c
+Index: madwifi-ng-r2568-20070710/ath/if_ath.c
===================================================================
---- madwifi-ng-r2420-20070602.orig/ath/if_ath.c 2007-06-04 13:21:55.006614392 +0200
-+++ madwifi-ng-r2420-20070602/ath/if_ath.c 2007-06-04 13:21:55.390556024 +0200
-@@ -5698,7 +5698,8 @@
+--- madwifi-ng-r2568-20070710.orig/ath/if_ath.c 2007-07-13 11:18:16.181218662 +0200
++++ madwifi-ng-r2568-20070710/ath/if_ath.c 2007-07-13 11:18:16.669246471 +0200
+@@ -5732,7 +5732,8 @@
* frame; it'll be dropped where it's not wanted.
*/
if (rs->rs_keyix != HAL_RXKEYIX_INVALID &&
struct ath_node *an;
/*
* Fast path: node is present in the key map;
-Index: madwifi-ng-r2420-20070602/net80211/ieee80211_node.c
+Index: madwifi-ng-r2568-20070710/net80211/ieee80211_node.c
===================================================================
---- madwifi-ng-r2420-20070602.orig/net80211/ieee80211_node.c 2007-06-04 13:21:53.459849536 +0200
-+++ madwifi-ng-r2420-20070602/net80211/ieee80211_node.c 2007-06-04 13:21:55.391555872 +0200
-@@ -1269,8 +1269,6 @@
+--- madwifi-ng-r2568-20070710.orig/net80211/ieee80211_node.c 2007-07-13 11:18:14.117101033 +0200
++++ madwifi-ng-r2568-20070710/net80211/ieee80211_node.c 2007-07-13 11:18:16.669246471 +0200
+@@ -1271,8 +1271,6 @@
IEEE80211_NODE_TABLE_UNLOCK_IRQ(nt);
return ni;
}
#ifdef IEEE80211_DEBUG_REFCNT
EXPORT_SYMBOL(ieee80211_find_rxnode_debug);
-@@ -1278,6 +1276,20 @@
+@@ -1280,6 +1278,20 @@
EXPORT_SYMBOL(ieee80211_find_rxnode);
#endif
/*
* Return a reference to the appropriate node for sending
* a data frame. This handles node discovery in adhoc networks.
-Index: madwifi-ng-r2420-20070602/net80211/ieee80211_node.h
+Index: madwifi-ng-r2568-20070710/net80211/ieee80211_node.h
===================================================================
---- madwifi-ng-r2420-20070602.orig/net80211/ieee80211_node.h 2007-06-04 13:21:53.466848472 +0200
-+++ madwifi-ng-r2420-20070602/net80211/ieee80211_node.h 2007-06-04 13:21:55.392555720 +0200
-@@ -323,6 +323,8 @@
+--- madwifi-ng-r2568-20070710.orig/net80211/ieee80211_node.h 2007-07-13 11:18:14.125101490 +0200
++++ madwifi-ng-r2568-20070710/net80211/ieee80211_node.h 2007-07-13 11:18:16.697248068 +0200
+@@ -328,6 +328,8 @@
*pni = NULL; /* guard against use */
}
-Index: madwifi-ng-r2420-20070602/net80211/ieee80211_scan.c
+Index: madwifi-ng-r2568-20070710/net80211/ieee80211_scan.c
===================================================================
---- madwifi-ng-r2420-20070602.orig/net80211/ieee80211_scan.c 2007-06-04 13:21:53.432853640 +0200
-+++ madwifi-ng-r2420-20070602/net80211/ieee80211_scan.c 2007-06-04 13:21:55.608522888 +0200
+--- madwifi-ng-r2568-20070710.orig/net80211/ieee80211_scan.c 2007-07-13 11:18:14.033096248 +0200
++++ madwifi-ng-r2568-20070710/net80211/ieee80211_scan.c 2007-07-13 11:18:16.977264023 +0200
@@ -291,7 +291,8 @@
struct ieee80211com *ic = vap->iv_ic;
int delay;
-Index: madwifi-ng-r2420-20070602/ath/if_ath.c
+Index: madwifi-ng-r2568-20070710/ath/if_ath.c
===================================================================
---- madwifi-ng-r2420-20070602.orig/ath/if_ath.c 2007-06-04 13:21:55.390556024 +0200
-+++ madwifi-ng-r2420-20070602/ath/if_ath.c 2007-06-04 13:21:55.808492488 +0200
-@@ -4394,16 +4394,31 @@
+--- madwifi-ng-r2568-20070710.orig/ath/if_ath.c 2007-07-13 11:18:16.669246471 +0200
++++ madwifi-ng-r2568-20070710/ath/if_ath.c 2007-07-13 11:18:17.213277476 +0200
+@@ -4426,16 +4426,31 @@
struct ieee80211com *ic = &sc->sc_ic;
struct ath_hal *ah = sc->sc_ah;
struct ieee80211_node *ni;
/* XXX conditionalize multi-bss support? */
if (ic->ic_opmode == IEEE80211_M_HOSTAP) {
/*
-@@ -4417,20 +4432,61 @@
+@@ -4449,20 +4464,61 @@
if (sc->sc_stagbeacons)
intval /= ATH_BCBUF; /* for staggered beacons */
if ((sc->sc_nostabeacons) &&
int dtimperiod, dtimcount;
int cfpperiod, cfpcount;
-@@ -4446,13 +4502,13 @@
+@@ -4478,13 +4534,13 @@
dtimcount = 0; /* XXX? */
cfpperiod = 1; /* NB: no PCF support yet */
cfpcount = 0;
do {
nexttbtt += intval;
if (--dtimcount < 0) {
-@@ -4460,7 +4516,7 @@
+@@ -4492,7 +4548,7 @@
if (--cfpcount < 0)
cfpcount = cfpperiod - 1;
}
#undef FUDGE
memset(&bs, 0, sizeof(bs));
bs.bs_intval = intval;
-@@ -4512,7 +4568,7 @@
+@@ -4544,7 +4600,7 @@
DPRINTF(sc, ATH_DEBUG_BEACON,
"%s: tsf %llu tsf:tu %u intval %u nexttbtt %u dtim %u nextdtim %u bmiss %u sleep %u cfp:period %u maxdur %u next %u timoffset %u\n",
__func__,
bs.bs_intval,
bs.bs_nexttbtt,
bs.bs_dtimperiod,
-@@ -4531,7 +4587,7 @@
+@@ -4566,7 +4622,7 @@
ath_hal_intrset(ah, sc->sc_imask);
} else {
ath_hal_intrset(ah, 0);
intval |= HAL_BEACON_RESET_TSF;
if (ic->ic_opmode == IEEE80211_M_IBSS) {
/*
-@@ -4568,8 +4624,40 @@
+@@ -4603,8 +4659,40 @@
if (ic->ic_opmode == IEEE80211_M_IBSS && sc->sc_hasveol)
ath_beacon_start_adhoc(sc, vap);
}
+++ /dev/null
-Index: madwifi-ng-r2420-20070602/ath/if_ath.c
-===================================================================
---- madwifi-ng-r2420-20070602.orig/ath/if_ath.c 2007-06-04 13:21:55.808492488 +0200
-+++ madwifi-ng-r2420-20070602/ath/if_ath.c 2007-06-04 13:21:56.713354928 +0200
-@@ -271,7 +271,7 @@
- static char *ratectl = DEF_RATE_CTL;
- static int rfkill = 0;
- #ifdef ATH_CAP_TPC
--static int tpc = -1;
-+static int tpc = 0;
- #endif
- static int countrycode = -1;
- static int outdoor = -1;
-Index: madwifi-ng-r2420-20070602/ath/if_ath_ahb.c
+Index: madwifi-ng-r2568-20070710/ath/if_ath_ahb.c
===================================================================
---- madwifi-ng-r2420-20070602.orig/ath/if_ath_ahb.c 2007-06-04 13:21:53.320870664 +0200
-+++ madwifi-ng-r2420-20070602/ath/if_ath_ahb.c 2007-06-04 13:21:57.306264792 +0200
+--- madwifi-ng-r2568-20070710.orig/ath/if_ath_ahb.c 2007-07-13 11:18:13.881087584 +0200
++++ madwifi-ng-r2568-20070710/ath/if_ath_ahb.c 2007-07-13 11:18:17.461291609 +0200
@@ -275,11 +275,10 @@
u_int16_t devid;
if (sc == NULL)
-@@ -289,13 +288,16 @@
+@@ -289,13 +288,17 @@
ath_detach(dev);
if (dev->irq)
free_irq(dev->irq, dev);
- sysType = get_system_type();
- if (!strcmp(sysType, "Atheros AR5315"))
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,19)
-+ devid = (u32) config->tag;
++ devid = sc->aps_sc.devid;
++ config->tag = (unsigned long) devid;
+#else
+ if (!strcmp(get_system_type(), "Atheros AR5315"))
devid = (u_int16_t) (sysRegRead(AR5315_SREV) &
ahb_disable_wmac(devid, wlanNum);
free_netdev(dev);
-@@ -401,7 +403,7 @@
+@@ -401,7 +404,7 @@
static int ahb_wmac_remove(struct platform_device *pdev)
{
return 0;
}
-
-Index: madwifi-ng-r2420-20070602/ath/if_ath.c
+Index: madwifi-ng-r2568-20070710/ath/if_ath.c
===================================================================
---- madwifi-ng-r2420-20070602.orig/ath/if_ath.c 2007-06-04 13:21:56.911324832 +0200
-+++ madwifi-ng-r2420-20070602/ath/if_ath.c 2007-06-04 13:21:57.500235304 +0200
-@@ -407,7 +407,6 @@
+--- madwifi-ng-r2568-20070710.orig/ath/if_ath.c 2007-07-13 11:18:17.213277476 +0200
++++ madwifi-ng-r2568-20070710/ath/if_ath.c 2007-07-13 11:18:17.733307111 +0200
+@@ -410,7 +410,6 @@
* and use the next two bits as the index of the VAP.
*/
#define ATH_SET_VAP_BSSID_MASK(bssid_mask) ((bssid_mask)[0] &= ~(((ATH_BCBUF-1)<<2)|0x02))
#define ATH_SET_VAP_BSSID(bssid, id) \
do { \
if (id) \
-@@ -1048,9 +1047,12 @@
+@@ -1055,9 +1054,12 @@
ic_opmode = opmode;
break;
case IEEE80211_M_IBSS:
break;
case IEEE80211_M_AHDEMO:
case IEEE80211_M_MONITOR:
-@@ -1080,7 +1082,7 @@
+@@ -1087,7 +1089,7 @@
return NULL;
}
- if (sc->sc_nvaps >= ATH_BCBUF) {
+ if (sc->sc_nvaps + sc->sc_nibssvaps >= ATH_BCBUF) {
- printk(KERN_WARNING "too many virtual ap's (already got %d)\n", sc->sc_nvaps);
+ printk(KERN_WARNING "too many virtual APs (already got %d)\n", sc->sc_nvaps);
return NULL;
}
-@@ -1115,8 +1117,9 @@
- */
+@@ -1123,6 +1125,7 @@
if (opmode == IEEE80211_M_MONITOR)
dev->type = ARPHRD_IEEE80211_RADIOTAP;
-- if ((flags & IEEE80211_CLONE_BSSID) &&
-- sc->sc_nvaps != 0 && opmode != IEEE80211_M_WDS && sc->sc_hasbmask) {
+
+ avp->av_bslot = -1;
-+ if ((flags & IEEE80211_CLONE_BSSID) && sc->sc_hasbmask &&
-+ (opmode == IEEE80211_M_HOSTAP || opmode == IEEE80211_M_IBSS)) {
+ if ((flags & IEEE80211_CLONE_BSSID) &&
+ opmode != IEEE80211_M_WDS && sc->sc_hasbmask) {
struct ieee80211vap *v;
- unsigned int id_mask, id;
-
-@@ -1129,18 +1132,22 @@
+@@ -1137,18 +1140,22 @@
/* do a full search to mark all the allocated VAPs */
id_mask = 0;
+ id_mask |= (1 << a->av_bslot);
+ }
-- for (id = 0; id < ATH_BCBUF; id++) {
+- for (id = 1; id < ATH_BCBUF; id++) {
+ /* IBSS mode has local always set, so don't hand out beacon slot 0 to an IBSS vap */
+ for (id = (opmode == IEEE80211_M_IBSS ? 1 : 0); id < ATH_BCBUF; id++) {
/* get the first available slot */
STAILQ_INIT(&avp->av_mcastq.axq_q);
ATH_TXQ_LOCK_INIT(&avp->av_mcastq);
if (opmode == IEEE80211_M_HOSTAP || opmode == IEEE80211_M_IBSS) {
-@@ -1150,33 +1157,14 @@
+@@ -1158,33 +1165,14 @@
*/
avp->av_bcbuf = STAILQ_FIRST(&sc->sc_bbuf);
STAILQ_REMOVE_HEAD(&sc->sc_bbuf, bf_list);
/*
* Multiple VAPs are to transmit beacons and we
* have h/w support for TSF adjusting; enable use
-@@ -1286,7 +1274,9 @@
+@@ -1294,7 +1282,9 @@
sc->sc_stagbeacons = 0;
}
- if (vap->iv_opmode == IEEE80211_M_STA) {
+ if (vap->iv_opmode == IEEE80211_M_IBSS) {
-+ sc->sc_nibssvaps--;
++ sc->sc_nibssvaps--;
+ } else if (vap->iv_opmode == IEEE80211_M_STA) {
sc->sc_nstavaps--;
sc->sc_nostabeacons = 0;
} else if (vap->iv_opmode == IEEE80211_M_MONITOR)
-@@ -3362,7 +3352,7 @@
+@@ -3383,7 +3373,7 @@
sc->sc_opmode == HAL_M_IBSS || /* NB: AHDEMO too */
(sc->sc_nostabeacons) || sc->sc_scanning)
rfilt |= HAL_RX_FILTER_BEACON;
rfilt |= (HAL_RX_FILTER_CONTROL | HAL_RX_FILTER_BEACON |
HAL_RX_FILTER_PROBEREQ | HAL_RX_FILTER_PROM);
return rfilt;
-@@ -5809,12 +5799,20 @@
- type = ieee80211_input(ni, skb, rs->rs_rssi, rs->rs_tstamp);
+@@ -5832,12 +5822,20 @@
+ type = ieee80211_input(ni, skb, rs->rs_rssi, rs_tsf);
ieee80211_unref_node(&ni);
} else {
+ const struct ieee80211_frame_min *wh = (const struct ieee80211_frame_min *) skb->data;
if (ni != NULL) {
struct ath_node *an = ATH_NODE(ni);
ieee80211_keyix_t keyix;
-Index: madwifi-ng-r2420-20070602/ath/if_athvar.h
+Index: madwifi-ng-r2568-20070710/ath/if_athvar.h
===================================================================
---- madwifi-ng-r2420-20070602.orig/ath/if_athvar.h 2007-06-04 13:21:56.911324832 +0200
-+++ madwifi-ng-r2420-20070602/ath/if_athvar.h 2007-06-04 13:21:57.500235304 +0200
-@@ -199,7 +199,7 @@
+--- madwifi-ng-r2568-20070710.orig/ath/if_athvar.h 2007-07-13 11:18:13.781081883 +0200
++++ madwifi-ng-r2568-20070710/ath/if_athvar.h 2007-07-13 11:18:17.737307338 +0200
+@@ -204,7 +204,7 @@
#define ATH_RXBUF 40 /* number of RX buffers */
#define ATH_TXBUF 200 /* number of TX buffers */
/* free buffer threshold to restart net dev */
#define ATH_TXBUF_FREE_THRESHOLD (ATH_TXBUF / 20)
-@@ -594,6 +594,7 @@
- u_int16_t sc_nvaps; /* # of active virtual ap's */
- u_int8_t sc_nstavaps; /* # of active station vaps */
- u_int8_t sc_nmonvaps; /* # of monitor vaps */
+@@ -603,6 +603,7 @@
+ u_int16_t sc_nvaps; /* # of active virtual APs */
+ u_int8_t sc_nstavaps; /* # of active station VAPs */
+ u_int8_t sc_nmonvaps; /* # of monitor VAPs */
+ u_int8_t sc_nibssvaps; /* # of active ibss vaps */
u_int8_t sc_nbcnvaps; /* # of vaps sending beacons */
u_int sc_fftxqmin; /* aggregation threshold */
HAL_INT sc_imask; /* interrupt mask copy */
-Index: madwifi-ng-r2420-20070602/net80211/ieee80211_beacon.c
+Index: madwifi-ng-r2568-20070710/net80211/ieee80211_beacon.c
===================================================================
---- madwifi-ng-r2420-20070602.orig/net80211/ieee80211_beacon.c 2007-06-04 13:21:53.286875832 +0200
-+++ madwifi-ng-r2420-20070602/net80211/ieee80211_beacon.c 2007-06-04 13:21:57.501235152 +0200
+--- madwifi-ng-r2568-20070710.orig/net80211/ieee80211_beacon.c 2007-07-13 11:18:13.785082112 +0200
++++ madwifi-ng-r2568-20070710/net80211/ieee80211_beacon.c 2007-07-13 11:18:17.857314176 +0200
@@ -111,7 +111,7 @@
bo->bo_tim = frm;
*frm++ = IEEE80211_ELEMID_IBSSPARMS;
*frm++ = 2;
*frm++ = 0; *frm++ = 0; /* TODO: ATIM window */
-Index: madwifi-ng-r2420-20070602/net80211/ieee80211_input.c
+Index: madwifi-ng-r2568-20070710/net80211/ieee80211_input.c
===================================================================
---- madwifi-ng-r2420-20070602.orig/net80211/ieee80211_input.c 2007-06-04 13:21:53.292874920 +0200
-+++ madwifi-ng-r2420-20070602/net80211/ieee80211_input.c 2007-06-04 13:21:57.502235000 +0200
-@@ -2939,7 +2939,13 @@
+--- madwifi-ng-r2568-20070710.orig/net80211/ieee80211_input.c 2007-07-13 11:18:13.793082567 +0200
++++ madwifi-ng-r2568-20070710/net80211/ieee80211_input.c 2007-07-13 11:18:17.885315771 +0200
+@@ -2981,7 +2981,13 @@
return;
}
if (ni == vap->iv_bss) {
/*
* XXX Cannot tell if the sender is operating
* in ibss mode. But we need a new node to
-@@ -2948,12 +2954,13 @@
+@@ -2990,12 +2996,13 @@
*/
ni = ieee80211_fakeup_adhoc_node(vap,
wh->i_addr2);
}
IEEE80211_NOTE_MAC(vap, IEEE80211_MSG_INPUT, wh->i_addr2,
-Index: madwifi-ng-r2420-20070602/net80211/ieee80211_node.c
+Index: madwifi-ng-r2568-20070710/net80211/ieee80211_node.c
===================================================================
---- madwifi-ng-r2420-20070602.orig/net80211/ieee80211_node.c 2007-06-04 13:21:55.391555872 +0200
-+++ madwifi-ng-r2420-20070602/net80211/ieee80211_node.c 2007-06-04 13:21:57.503234848 +0200
-@@ -1082,8 +1082,25 @@
+--- madwifi-ng-r2568-20070710.orig/net80211/ieee80211_node.c 2007-07-13 11:18:16.669246471 +0200
++++ madwifi-ng-r2568-20070710/net80211/ieee80211_node.c 2007-07-13 11:18:17.925318050 +0200
+@@ -1084,8 +1084,25 @@
IEEE80211_NODE_TABLE_LOCK_ASSERT(nt);
hash = IEEE80211_NODE_HASH(macaddr);
-+
++
+ /* look for non-ibss nodes first */
- LIST_FOREACH(ni, &nt->nt_hash[hash], ni_hash) {
-- if (IEEE80211_ADDR_EQ(ni->ni_macaddr, macaddr)) {
++ LIST_FOREACH(ni, &nt->nt_hash[hash], ni_hash) {
+ if (IEEE80211_ADDR_EQ(ni->ni_macaddr, macaddr) && ni->ni_vap->iv_opmode != IEEE80211_M_IBSS) {
+ ieee80211_ref_node(ni); /* mark referenced */
+#ifdef IEEE80211_DEBUG_REFCNT
+ }
+
+ /* now look for ibss nodes */
-+ LIST_FOREACH(ni, &nt->nt_hash[hash], ni_hash) {
+ LIST_FOREACH(ni, &nt->nt_hash[hash], ni_hash) {
+- if (IEEE80211_ADDR_EQ(ni->ni_macaddr, macaddr)) {
+ if (IEEE80211_ADDR_EQ(ni->ni_macaddr, macaddr) && ni->ni_vap->iv_opmode == IEEE80211_M_IBSS) {
ieee80211_ref_node(ni); /* mark referenced */
#ifdef IEEE80211_DEBUG_REFCNT
-Index: madwifi-ng-r2420-20070602/net80211/ieee80211_linux.c
+Index: madwifi-ng-r2568-20070710/net80211/ieee80211_linux.c
===================================================================
---- madwifi-ng-r2420-20070602.orig/net80211/ieee80211_linux.c 2007-06-04 13:21:53.255880544 +0200
-+++ madwifi-ng-r2420-20070602/net80211/ieee80211_linux.c 2007-06-04 13:21:57.745198064 +0200
+--- madwifi-ng-r2568-20070710.orig/net80211/ieee80211_linux.c 2007-07-13 11:18:13.701077325 +0200
++++ madwifi-ng-r2568-20070710/net80211/ieee80211_linux.c 2007-07-13 11:18:18.229335376 +0200
@@ -285,6 +285,9 @@
k->wk_cipher->ic_name, k->wk_keyix,
(unsigned long long)rsc );
-Index: madwifi-ng-r2420-20070602/net80211/ieee80211_crypto_ccmp.c
+Index: madwifi-ng-r2568-20070710/net80211/ieee80211_crypto_ccmp.c
===================================================================
---- madwifi-ng-r2420-20070602.orig/net80211/ieee80211_crypto_ccmp.c 2007-06-04 13:21:53.234883736 +0200
-+++ madwifi-ng-r2420-20070602/net80211/ieee80211_crypto_ccmp.c 2007-06-04 13:21:57.936169032 +0200
-@@ -118,6 +118,12 @@
- ctx->cc_ic = vap->iv_ic;
- ctx->cc_tfm = crypto_alloc_cipher("aes", 0,
- CRYPTO_ALG_ASYNC);
-+
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,18)
-+ if (IS_ERR(ctx->cc_tfm))
-+ ctx->cc_tfm = NULL;
-+#endif
-+
- if (ctx->cc_tfm == NULL) {
- IEEE80211_DPRINTF(vap, IEEE80211_MSG_CRYPTO,
- "%s: unable to load kernel AES crypto support\n",
-@@ -465,6 +471,9 @@
+--- madwifi-ng-r2568-20070710.orig/net80211/ieee80211_crypto_ccmp.c 2007-07-13 11:18:13.625072992 +0200
++++ madwifi-ng-r2568-20070710/net80211/ieee80211_crypto_ccmp.c 2007-07-13 11:18:18.465348826 +0200
+@@ -475,6 +475,9 @@
uint8_t *mic, *pos;
u_int space;
ctx->cc_vap->iv_stats.is_crypto_ccmp++;
skb = skb0;
-@@ -579,6 +588,9 @@
+@@ -589,6 +592,9 @@
uint8_t *pos, *mic;
u_int space;
--- /dev/null
+Index: madwifi-ng-r2568-20070710/ath/if_athvar.h
+===================================================================
+--- madwifi-ng-r2568-20070710.orig/ath/if_athvar.h 2007-07-13 11:18:17.737307338 +0200
++++ madwifi-ng-r2568-20070710/ath/if_athvar.h 2007-07-13 11:18:18.709362732 +0200
+@@ -123,6 +123,11 @@
+ #define NETDEV_TX_BUSY 1
+ #endif
+
++#ifndef NETDEV_TX_OK
++#define NETDEV_TX_OK 0
++#define NETDEV_TX_BUSY 1
++#endif
++
+ #if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,23)
+ static inline struct net_device *_alloc_netdev(int sizeof_priv, const char *mask,
+ void (*setup)(struct net_device *))
+++ /dev/null
-Index: madwifi-ng-r2420-20070602/ath/if_ath.c
-===================================================================
---- madwifi-ng-r2420-20070602.orig/ath/if_ath.c 2007-07-02 23:49:33.450710750 +0200
-+++ madwifi-ng-r2420-20070602/ath/if_ath.c 2007-07-02 23:50:43.107064000 +0200
-@@ -8197,16 +8197,15 @@
- wds_ni->ni_rates = vap->iv_bss->ni_rates;
- /* Depending on the sequence of bringing up devices
- * it's possible the rates of the root bss isn't
-- * filled yet.
-- */
-- if (vap->iv_ic->ic_newassoc != NULL &&
-- wds_ni->ni_rates.rs_nrates != 0) {
-+ * filled yet. */
-+ if ((vap->iv_ic->ic_newassoc != NULL) &&
-+ (wds_ni->ni_rates.rs_nrates != 0)) {
- /* Fill in the rates based on our own rates
- * we rely on the rate selection mechanism
-- * to find out which rates actually work!
-- */
-+ * to find out which rates actually work! */
- vap->iv_ic->ic_newassoc(wds_ni, 1);
- }
-+ ieee80211_unref_node(&wds_ni);
- }
- break;
- default:
-Index: madwifi-ng-r2420-20070602/net80211/ieee80211_output.c
-===================================================================
---- madwifi-ng-r2420-20070602.orig/net80211/ieee80211_output.c 2007-07-02 23:49:31.574593500 +0200
-+++ madwifi-ng-r2420-20070602/net80211/ieee80211_output.c 2007-07-02 23:50:37.462711250 +0200
-@@ -268,6 +268,7 @@
- * We'll get the frame back when the time is right.
- */
- ieee80211_pwrsave(ni, skb);
-+ ieee80211_unref_node(&ni);
- return 0;
- }
-
-@@ -282,7 +283,7 @@
- vap->iv_xrvap->iv_sta_assoc) {
- struct sk_buff *skb1;
- ni = ieee80211_find_txnode(vap->iv_xrvap, eh->ether_dhost);
-- skb1 = skb_clone(skb,GFP_ATOMIC);
-+ skb1 = skb_clone(skb, GFP_ATOMIC);
- if (skb1) {
- cb = (struct ieee80211_cb *) skb1->cb;
- cb->ni = ni;
-Index: madwifi-ng-r2420-20070602/net80211/ieee80211_wireless.c
-===================================================================
---- madwifi-ng-r2420-20070602.orig/net80211/ieee80211_wireless.c 2007-07-02 23:49:31.566593000 +0200
-+++ madwifi-ng-r2420-20070602/net80211/ieee80211_wireless.c 2007-07-02 23:49:34.126753000 +0200
-@@ -1088,7 +1088,6 @@
- /* locate a node, read its rssi, check if updated, convert to dBm */
- for (i = 0; i < number; i++) {
- ni = ieee80211_find_node(nt, &vap->iv_spy.mac[i * IEEE80211_ADDR_LEN]);
-- /* TODO: free node ? */
- /* check we are associated w/ this vap */
- if (ni && (ni->ni_vap == vap)) {
- set_quality(&spy_stat[i], ni->ni_rssi, ic->ic_channoise);
-@@ -1100,6 +1099,7 @@
- } else {
- spy_stat[i].updated = IW_QUAL_ALL_INVALID;
- }
-+ ieee80211_unref_node(&ni);
- }
-
- /* copy results to userspace */
-@@ -3153,6 +3153,7 @@
- /* NB: this also checks ik->ik_keylen > sizeof(wk->wk_key) */
- if (ik->ik_keylen > sizeof(ik->ik_keydata))
- return -E2BIG;
-+
- kix = ik->ik_keyix;
- if (kix == IEEE80211_KEYIX_NONE) {
- /* XXX unicast keys currently must be tx/rx */
-@@ -3176,6 +3177,7 @@
- if ((ik->ik_flags & IEEE80211_KEY_XMIT) == 0) /* XXX */
- ik->ik_flags |= IEEE80211_KEY_GROUP; /* XXX */
- }
-+
- error = 0;
- flags = ik->ik_flags & IEEE80211_KEY_COMMON;
- ieee80211_key_update_begin(vap);
-@@ -3190,12 +3192,13 @@
- memset(wk->wk_key, 0, sizeof(wk->wk_key));
- memcpy(wk->wk_key, ik->ik_keydata, ik->ik_keylen);
- if (!ieee80211_crypto_setkey(vap, wk,
-- ni != NULL ? ni->ni_macaddr : ik->ik_macaddr, ni))
-+ (ni != NULL) ? ni->ni_macaddr : ik->ik_macaddr, ni))
- error = -EIO;
- else if ((ik->ik_flags & IEEE80211_KEY_DEFAULT))
- vap->iv_def_txkey = kix;
- } else
- error = -ENXIO;
-+
- ieee80211_key_update_end(vap);
- if (ni != NULL)
- ieee80211_unref_node(&ni);
+++ /dev/null
-Index: madwifi-ng-r2420-20070602/net80211/ieee80211_input.c
-===================================================================
---- madwifi-ng-r2420-20070602.orig/net80211/ieee80211_input.c 2007-07-02 12:50:31.839514500 +0200
-+++ madwifi-ng-r2420-20070602/net80211/ieee80211_input.c 2007-07-02 12:51:10.309918750 +0200
-@@ -2832,7 +2832,7 @@
- ieee80211_add_scan(vap, &scan, wh, subtype, rssi, rstamp);
- return;
- }
-- if (scan.capinfo & IEEE80211_CAPINFO_IBSS) {
-+ if ((vap->iv_opmode == IEEE80211_M_IBSS) && (scan.capinfo & IEEE80211_CAPINFO_IBSS)) {
- if (!IEEE80211_ADDR_EQ(wh->i_addr2, ni->ni_macaddr)) {
- /* Create a new entry in the neighbor table. */
- ni = ieee80211_add_neighbor(vap, wh, &scan);
--- /dev/null
+Index: madwifi-ng-r2568-20070710/ath/if_ath.c
+===================================================================
+--- madwifi-ng-r2568-20070710.orig/ath/if_ath.c 2007-07-13 11:18:17.733307111 +0200
++++ madwifi-ng-r2568-20070710/ath/if_ath.c 2007-07-13 11:18:18.945376179 +0200
+@@ -273,9 +273,7 @@
+ static char *autocreate = NULL;
+ static char *ratectl = DEF_RATE_CTL;
+ static int rfkill = 0;
+-#ifdef ATH_CAP_TPC
+ static int tpc = 0;
+-#endif
+ static int countrycode = -1;
+ static int outdoor = -1;
+ static int xchanmode = -1;
+@@ -533,12 +531,6 @@
+ rfkill ? "on" : "off");
+ ath_hal_setrfsilent(ah, rfkill);
+
+-#ifdef ATH_CAP_TPC
+- printk(KERN_INFO "ath_pci: ath_pci: switching per-packet transmit power control %s\n",
+- tpc ? "on" : "off");
+- ath_hal_settpc(ah, tpc);
+-#endif
+-
+ /*
+ * Setup rate tables for all potential media types.
+ */
+@@ -818,11 +810,18 @@
+ */
+ #ifdef ATH_CAP_TPC
+ sc->sc_hastpc = ath_hal_hastpc(ah);
+- if (sc->sc_hastpc || ath_hal_hastxpowlimit(ah))
++ if(tpc && !sc->sc_hastpc) {
++ printk(KERN_WARNING "ath_pci: WARNING: per-packet transmit power control was requested, but is not supported by the hardware.\n");
++ tpc = 0;
++ }
++ printk(KERN_INFO "ath_pci: switching per-packet transmit power control %s\n",
++ tpc ? "on" : "off");
++ ath_hal_settpc(ah, tpc);
+ #else
+ sc->sc_hastpc = 0;
+- if (ath_hal_hastxpowlimit(ah))
++ tpc = 0; /* TPC is always zero, when compiled without ATH_CAP_TPC */
+ #endif
++ if (sc->sc_hastpc || ath_hal_hastxpowlimit(ah))
+ ic->ic_caps |= IEEE80211_C_TXPMGT;
+
+ /*
+@@ -1836,7 +1835,7 @@
+ ath_stop_locked(dev);
+
+ #ifdef ATH_CAP_TPC
+- /* Re-enable after suspend (?) */
++ /* Re-enable after suspend */
+ ath_hal_settpc(ah, tpc);
+ #endif
+
+@@ -8787,26 +8786,16 @@
+ * Search for the VAP that needs a txpow change, if any
+ */
+ TAILQ_FOREACH(vap, &ic->ic_vaps, iv_next) {
+-#ifdef ATH_CAP_TPC
+- if (ic->ic_newtxpowlimit == vap->iv_bss->ni_txpower) {
++ if (!tpc || ic->ic_newtxpowlimit >= vap->iv_bss->ni_txpower) {
+ vap->iv_bss->ni_txpower = clamped_txpow;
+ ieee80211_iterate_nodes(&vap->iv_ic->ic_sta, set_node_txpower, &clamped_txpow);
+ }
+-#else
+- vap->iv_bss->ni_txpower = clamped_txpow;
+- ieee80211_iterate_nodes(&vap->iv_ic->ic_sta, set_node_txpower, &clamped_txpow);
+-#endif
+ }
+
+- ic->ic_newtxpowlimit = sc->sc_curtxpow = clamped_txpow;
++ sc->sc_curtxpow = clamped_txpow;
+
+-#ifdef ATH_CAP_TPC
+- if (ic->ic_newtxpowlimit >= txpowlimit)
+- ath_hal_settxpowlimit(ah, ic->ic_newtxpowlimit);
+-#else
+- if (ic->ic_newtxpowlimit != txpowlimit)
+- ath_hal_settxpowlimit(ah, ic->ic_newtxpowlimit);
+-#endif
++ if (clamped_txpow != txpowlimit)
++ ath_hal_settxpowlimit(ah, clamped_txpow);
+ }
+
+
+Index: madwifi-ng-r2568-20070710/net80211/ieee80211_wireless.c
+===================================================================
+--- madwifi-ng-r2568-20070710.orig/net80211/ieee80211_wireless.c 2007-07-13 11:18:13.473064331 +0200
++++ madwifi-ng-r2568-20070710/net80211/ieee80211_wireless.c 2007-07-13 11:18:18.949376408 +0200
+@@ -1403,6 +1403,7 @@
+ } else {
+ if (!fixed) /* no change */
+ return 0;
++ ic->ic_newtxpowlimit = IEEE80211_TXPOWER_MAX;
+ ic->ic_flags &= ~IEEE80211_F_TXPOW_FIXED;
+ }
+ done:
Index: madwifi-ng-r2568-20070710/ath/if_ath.c
===================================================================
---- madwifi-ng-r2568-20070710.orig/ath/if_ath.c 2007-07-13 09:14:14.721154018 +0200
-+++ madwifi-ng-r2568-20070710/ath/if_ath.c 2007-07-13 09:14:55.499477843 +0200
+--- madwifi-ng-r2568-20070710.orig/ath/if_ath.c 2007-07-13 11:18:18.945376179 +0200
++++ madwifi-ng-r2568-20070710/ath/if_ath.c 2007-07-13 11:18:19.221391908 +0200
@@ -5711,8 +5711,9 @@
/*
* Reject error frames if we have no vaps that
-Index: madwifi-ng-r2420-20070602/ath/if_ath.c
+Index: madwifi-ng-r2568-20070710/ath/if_ath.c
===================================================================
---- madwifi-ng-r2420-20070602.orig/ath/if_ath.c 2007-06-04 13:21:57.500235304 +0200
-+++ madwifi-ng-r2420-20070602/ath/if_ath.c 2007-06-04 13:21:58.130139544 +0200
+--- madwifi-ng-r2568-20070710.orig/ath/if_ath.c 2007-07-13 11:18:19.221391908 +0200
++++ madwifi-ng-r2568-20070710/ath/if_ath.c 2007-07-13 11:18:19.473406270 +0200
@@ -75,7 +75,7 @@
#include <net80211/if_llc.h>
#endif
#include "net80211/if_athproto.h"
#include "if_athvar.h"
-@@ -382,7 +382,7 @@
- ath_keyprint(sc, __func__, ix, hk, mac); \
- } while (0)
- #else /* defined(AR_DEBUG) */
--#define IFF_DUMPPKTS(sc, _m) netif_msg_dumppkts(&sc->sc_ic)
-+#define IFF_DUMPPKTS(sc, _m) 0
- #define DPRINTF(sc, _m, _fmt, ...)
- #define KEYPRINTF(sc, k, ix, mac)
- #endif /* defined(AR_DEBUG) */
-Index: madwifi-ng-r2420-20070602/ath_rate/amrr/amrr.c
+Index: madwifi-ng-r2568-20070710/ath_rate/amrr/amrr.c
===================================================================
---- madwifi-ng-r2420-20070602.orig/ath_rate/amrr/amrr.c 2007-06-04 13:21:53.164894376 +0200
-+++ madwifi-ng-r2420-20070602/ath_rate/amrr/amrr.c 2007-06-04 13:21:58.131139392 +0200
-@@ -69,7 +69,7 @@
+--- madwifi-ng-r2568-20070710.orig/ath_rate/amrr/amrr.c 2007-07-13 11:18:13.277053162 +0200
++++ madwifi-ng-r2568-20070710/ath_rate/amrr/amrr.c 2007-07-13 11:18:19.473406270 +0200
+@@ -70,7 +70,7 @@
#include "amrr.h"
#ifdef AMRR_DEBUG
#define DPRINTF(sc, _fmt, ...) do { \
if (sc->sc_debug & 0x10) \
-Index: madwifi-ng-r2420-20070602/ath_rate/minstrel/minstrel.c
+Index: madwifi-ng-r2568-20070710/ath_rate/minstrel/minstrel.c
===================================================================
---- madwifi-ng-r2420-20070602.orig/ath_rate/minstrel/minstrel.c 2007-06-04 13:21:57.115293824 +0200
-+++ madwifi-ng-r2420-20070602/ath_rate/minstrel/minstrel.c 2007-06-04 13:21:58.132139240 +0200
-@@ -116,7 +116,7 @@
+--- madwifi-ng-r2568-20070710.orig/ath_rate/minstrel/minstrel.c 2007-07-13 11:18:16.433233021 +0200
++++ madwifi-ng-r2568-20070710/ath_rate/minstrel/minstrel.c 2007-07-13 11:18:19.497407640 +0200
+@@ -117,7 +117,7 @@
#include "minstrel.h"
#ifdef MINSTREL_DEBUG
enum {
ATH_DEBUG_RATE = 0x00000010 /* rate control */
-Index: madwifi-ng-r2420-20070602/ath_rate/onoe/onoe.c
+Index: madwifi-ng-r2568-20070710/ath_rate/onoe/onoe.c
===================================================================
---- madwifi-ng-r2420-20070602.orig/ath_rate/onoe/onoe.c 2007-06-04 13:21:53.176892552 +0200
-+++ madwifi-ng-r2420-20070602/ath_rate/onoe/onoe.c 2007-06-04 13:21:58.132139240 +0200
-@@ -65,7 +65,7 @@
+--- madwifi-ng-r2568-20070710.orig/ath_rate/onoe/onoe.c 2007-07-13 11:18:13.293054074 +0200
++++ madwifi-ng-r2568-20070710/ath_rate/onoe/onoe.c 2007-07-13 11:18:19.525409234 +0200
+@@ -66,7 +66,7 @@
#include "onoe.h"
#ifdef ONOE_DEBUG
enum {
ATH_DEBUG_RATE = 0x00000010, /* rate control */
-Index: madwifi-ng-r2420-20070602/ath_rate/sample/sample.c
+Index: madwifi-ng-r2568-20070710/ath_rate/sample/sample.c
===================================================================
---- madwifi-ng-r2420-20070602.orig/ath_rate/sample/sample.c 2007-06-04 13:21:53.183891488 +0200
-+++ madwifi-ng-r2420-20070602/ath_rate/sample/sample.c 2007-06-04 13:21:58.133139088 +0200
-@@ -67,7 +67,7 @@
+--- madwifi-ng-r2568-20070710.orig/ath_rate/sample/sample.c 2007-07-13 11:18:13.301054529 +0200
++++ madwifi-ng-r2568-20070710/ath_rate/sample/sample.c 2007-07-13 11:18:19.549410604 +0200
+@@ -68,7 +68,7 @@
#include "sample.h"
#ifdef SAMPLE_DEBUG
enum {
ATH_DEBUG_NODE = 0x00080000, /* node management */
-Index: madwifi-ng-r2420-20070602/net80211/ieee80211_proto.c
+Index: madwifi-ng-r2568-20070710/net80211/ieee80211_proto.c
===================================================================
---- madwifi-ng-r2420-20070602.orig/net80211/ieee80211_proto.c 2007-06-04 13:21:53.189890576 +0200
-+++ madwifi-ng-r2420-20070602/net80211/ieee80211_proto.c 2007-06-04 13:21:58.133139088 +0200
-@@ -312,6 +312,7 @@
+--- madwifi-ng-r2568-20070710.orig/net80211/ieee80211_proto.c 2007-07-13 11:18:13.309054985 +0200
++++ madwifi-ng-r2568-20070710/net80211/ieee80211_proto.c 2007-07-13 11:18:19.601413567 +0200
+@@ -286,6 +286,7 @@
}
- EXPORT_SYMBOL(ieee80211_print_essid);
+ EXPORT_SYMBOL(ieee80211_aclator_get);
+#ifdef IEEE80211_DEBUG
void
- ieee80211_dump_pkt(struct ieee80211com *ic,
- const u_int8_t *buf, int len, int rate, int rssi)
-@@ -390,6 +391,7 @@
- }
+ ieee80211_print_essid(const u_int8_t *essid, int len)
+ {
+@@ -312,7 +313,6 @@
}
- EXPORT_SYMBOL(ieee80211_dump_pkt);
-+#endif /* IEEE80211_DEBUG */
-
- int
- ieee80211_fix_rate(struct ieee80211_node *ni, int flags)
-Index: madwifi-ng-r2420-20070602/net80211/ieee80211_proto.h
-===================================================================
---- madwifi-ng-r2420-20070602.orig/net80211/ieee80211_proto.h 2007-06-04 13:21:53.194889816 +0200
-+++ madwifi-ng-r2420-20070602/net80211/ieee80211_proto.h 2007-06-04 13:21:58.134138936 +0200
-@@ -247,7 +247,11 @@
- #endif
- int ieee80211_new_state(struct ieee80211vap *, enum ieee80211_state, int);
- void ieee80211_print_essid(const u_int8_t *, int);
-+#ifdef IEEE80211_DEBUG
- void ieee80211_dump_pkt(struct ieee80211com *, const u_int8_t *, int, int, int);
-+#else
-+#define ieee80211_dump_pkt(...)
-+#endif
- struct sk_buff *ieee80211_getcfframe(struct ieee80211vap *, int);
+ EXPORT_SYMBOL(ieee80211_print_essid);
- /*
-Index: madwifi-ng-r2420-20070602/net80211/ieee80211_var.h
+-#ifdef IEEE80211_DEBUG
+ void
+ ieee80211_dump_pkt(struct ieee80211com *ic,
+ const u_int8_t *buf, int len, int rate, int rssi)
+Index: madwifi-ng-r2568-20070710/net80211/ieee80211_var.h
===================================================================
---- madwifi-ng-r2420-20070602.orig/net80211/ieee80211_var.h 2007-06-04 13:21:53.201888752 +0200
-+++ madwifi-ng-r2420-20070602/net80211/ieee80211_var.h 2007-06-04 13:21:58.134138936 +0200
+--- madwifi-ng-r2568-20070710.orig/net80211/ieee80211_var.h 2007-07-13 11:18:13.317055440 +0200
++++ madwifi-ng-r2568-20070710/net80211/ieee80211_var.h 2007-07-13 11:18:19.625414935 +0200
@@ -35,8 +35,8 @@
#ifndef _NET80211_IEEE80211_VAR_H_
#define _NET80211_IEEE80211_VAR_H_
/* Definitions for IEEE 802.11 drivers. */
#include <net80211/ieee80211_linux.h>
-Index: madwifi-ng-r2420-20070602/tools/do_multi.c
+Index: madwifi-ng-r2568-20070710/tools/do_multi.c
===================================================================
---- madwifi-ng-r2420-20070602.orig/tools/do_multi.c 2007-06-04 13:21:54.000767304 +0200
-+++ madwifi-ng-r2420-20070602/tools/do_multi.c 2007-06-04 13:21:58.134138936 +0200
+--- madwifi-ng-r2568-20070710.orig/tools/do_multi.c 2007-07-13 11:18:15.265166457 +0200
++++ madwifi-ng-r2568-20070710/tools/do_multi.c 2007-07-13 11:18:19.653416531 +0200
@@ -9,16 +9,20 @@
progname = basename(argv[0]);
if(strcmp(progname, "athkey") == 0)
ret = athkey_init(argc, argv);
if(strcmp(progname, "athstats") == 0)
-Index: madwifi-ng-r2420-20070602/tools/Makefile
+Index: madwifi-ng-r2568-20070710/tools/Makefile
===================================================================
---- madwifi-ng-r2420-20070602.orig/tools/Makefile 2007-06-04 13:21:54.001767152 +0200
-+++ madwifi-ng-r2420-20070602/tools/Makefile 2007-06-04 13:21:58.134138936 +0200
+--- madwifi-ng-r2568-20070710.orig/tools/Makefile 2007-07-13 11:18:15.313169194 +0200
++++ madwifi-ng-r2568-20070710/tools/Makefile 2007-07-13 11:18:19.673417671 +0200
@@ -52,7 +52,7 @@
ifdef DOMULTI
OBJS= do_multi.o athstats.o 80211stats.o athkey.o athchans.o athctrl.o \
- athdebug.o 80211debug.o wlanconfig.o
-+ wlanconfig.o
++ wlanconfig.o
ALL= ${OBJS} madwifi_multi
endif
-Index: madwifi-ng-r2420-20070602/ath/if_ath.c
+Index: madwifi-ng-r2568-20070710/ath/if_ath.c
===================================================================
---- madwifi-ng-r2420-20070602.orig/ath/if_ath.c 2007-06-04 13:21:58.130139544 +0200
-+++ madwifi-ng-r2420-20070602/ath/if_ath.c 2007-06-04 13:21:58.427094400 +0200
-@@ -167,7 +167,7 @@
- int, u_int32_t);
+--- madwifi-ng-r2568-20070710.orig/ath/if_ath.c 2007-07-13 11:18:19.473406270 +0200
++++ madwifi-ng-r2568-20070710/ath/if_ath.c 2007-07-13 11:18:20.017437275 +0200
+@@ -170,7 +170,7 @@
+ int, u_int64_t);
static void ath_setdefantenna(struct ath_softc *, u_int);
static struct ath_txq *ath_txq_setup(struct ath_softc *, int, int);
-static void ath_rx_tasklet(TQUEUE_ARG);
static int ath_hardstart(struct sk_buff *, struct net_device *);
static int ath_mgtstart(struct ieee80211com *, struct sk_buff *);
#ifdef ATH_SUPERG_COMP
-@@ -442,7 +442,6 @@
+@@ -444,7 +444,6 @@
ATH_TXBUF_LOCK_INIT(sc);
ATH_RXBUF_LOCK_INIT(sc);
ATH_INIT_TQUEUE(&sc->sc_txtq, ath_tx_tasklet, dev);
ATH_INIT_TQUEUE(&sc->sc_bmisstq, ath_bmiss_tasklet, dev);
ATH_INIT_TQUEUE(&sc->sc_bstucktq, ath_bstuck_tasklet, dev);
-@@ -699,6 +698,8 @@
+@@ -691,6 +690,8 @@
dev->set_mac_address = ath_set_mac_address;
dev->change_mtu = ath_change_mtu;
dev->tx_queue_len = ATH_TXBUF - 1; /* 1 for mgmt frame */
#ifdef USE_HEADERLEN_RESV
dev->hard_header_len += sizeof(struct ieee80211_qosframe) +
sizeof(struct llc) +
-@@ -1664,6 +1665,7 @@
+@@ -1667,6 +1668,7 @@
*/
ath_hal_getisr(ah, &status); /* NB: clears ISR too */
DPRINTF(sc, ATH_DEBUG_INTR, "%s: status 0x%x\n", __func__, status);
status &= sc->sc_imask; /* discard unasked for bits */
if (status & HAL_INT_FATAL) {
sc->sc_stats.ast_hardware++;
-@@ -1699,7 +1701,12 @@
+@@ -1702,7 +1704,14 @@
if (status & HAL_INT_RX) {
sc->sc_tsf = ath_hal_gettsf64(ah);
ath_uapsd_processtriggers(sc);
- ATH_SCHEDULE_TQUEUE(&sc->sc_rxtq, &needmark);
+ sc->sc_isr &= ~HAL_INT_RX;
+ if (netif_rx_schedule_prep(dev)) {
++#ifndef ATH_PRECISE_TSF
+ sc->sc_imask &= ~HAL_INT_RX;
+ ath_hal_intrset(ah, sc->sc_imask);
++#endif
+ __netif_rx_schedule(dev);
+ }
}
if (status & HAL_INT_TX) {
#ifdef ATH_SUPERG_DYNTURBO
-@@ -1725,6 +1732,11 @@
+@@ -1728,6 +1737,11 @@
}
}
#endif
ATH_SCHEDULE_TQUEUE(&sc->sc_txtq, &needmark);
}
if (status & HAL_INT_BMISS) {
-@@ -3295,10 +3307,10 @@
+@@ -3315,10 +3329,10 @@
*
* XXX Using in_softirq is not right since we might
* be called from other soft irq contexts than
netif_stop_queue(dev);
}
-@@ -3311,7 +3323,7 @@
+@@ -3331,7 +3345,7 @@
DPRINTF(sc, ATH_DEBUG_KEYCACHE, "%s:\n", __func__);
netif_start_queue(dev);
if (!in_softirq()) /* NB: see above */
}
/*
-@@ -5569,13 +5581,12 @@
+@@ -5584,13 +5598,12 @@
sc->sc_rxotherant = 0;
}
struct ath_buf *bf;
struct ath_softc *sc = dev->priv;
struct ieee80211com *ic = &sc->sc_ic;
-@@ -5587,12 +5598,15 @@
- unsigned int len;
+@@ -5603,12 +5616,15 @@
int type;
u_int phyerr;
+ u_int64_t rs_tsf;
+ u_int processed = 0, early_stop = 0;
+ u_int rx_limit = dev->quota;
do {
bf = STAILQ_FIRST(&sc->sc_rxbuf);
if (bf == NULL) { /* XXX ??? can this happen */
-@@ -5616,6 +5630,13 @@
+@@ -5632,6 +5648,13 @@
/* NB: never process the self-linked entry at the end */
break;
}
skb = bf->bf_skb;
if (skb == NULL) { /* XXX ??? can this happen */
printk("%s: no skbuff (%s)\n", DEV_NAME(dev), __func__);
-@@ -5654,6 +5675,7 @@
+@@ -5670,6 +5693,7 @@
sc->sc_stats.ast_rx_phyerr++;
phyerr = rs->rs_phyerr & 0x1f;
sc->sc_stats.ast_rx_phy[phyerr]++;
}
if (rs->rs_status & HAL_RXERR_DECRYPT) {
/*
-@@ -5865,9 +5887,29 @@
+@@ -5887,9 +5911,33 @@
STAILQ_INSERT_TAIL(&sc->sc_rxbuf, bf, bf_list);
ATH_RXBUF_UNLOCK_IRQ(sc);
} while (ath_rxbuf_init(sc, bf) == 0);
+ /* Check if more data is received while we were
+ * processing the descriptor chain.
+ */
++#ifndef ATH_PRECISE_TSF
+ ATH_DISABLE_INTR();
+ if (sc->sc_isr & HAL_INT_RX) {
+ sc->sc_isr &= ~HAL_INT_RX;
+ ath_uapsd_processtriggers(sc);
+ goto process_rx_again;
+ }
++#endif
+ netif_rx_complete(dev);
+
++#ifndef ATH_PRECISE_TSF
+ sc->sc_imask |= HAL_INT_RX;
+ ath_hal_intrset(ah, sc->sc_imask);
+ ATH_ENABLE_INTR();
++#endif
+ }
+
+ *budget -= processed;
#undef PA2DESC
}
-@@ -7484,11 +7526,22 @@
+@@ -7512,11 +7560,22 @@
struct net_device *dev = (struct net_device *)data;
struct ath_softc *sc = dev->priv;
netif_wake_queue(dev);
if (sc->sc_softled)
-@@ -7505,6 +7558,7 @@
+@@ -7533,6 +7592,7 @@
struct net_device *dev = (struct net_device *)data;
struct ath_softc *sc = dev->priv;
/*
* Process each active queue.
*/
-@@ -7525,6 +7579,16 @@
+@@ -7553,6 +7613,16 @@
if (sc->sc_uapsdq && txqactive(sc->sc_ah, sc->sc_uapsdq->axq_qnum))
ath_tx_processq(sc, sc->sc_uapsdq);
netif_wake_queue(dev);
if (sc->sc_softled)
-@@ -7542,6 +7606,7 @@
+@@ -7570,6 +7640,7 @@
unsigned int i;
/* Process each active queue. */
for (i = 0; i < HAL_NUM_TX_QUEUES; i++)
if (ATH_TXQ_SETUP(sc, i) && txqactive(sc->sc_ah, i))
ath_tx_processq(sc, &sc->sc_txq[i]);
-@@ -7550,6 +7615,16 @@
+@@ -7578,6 +7649,16 @@
ath_tx_processq(sc, sc->sc_xrtxq);
#endif
netif_wake_queue(dev);
if (sc->sc_softled)
-@@ -7648,6 +7723,7 @@
+@@ -7676,6 +7757,7 @@
ath_draintxq(struct ath_softc *sc)
{
struct ath_hal *ah = sc->sc_ah;
unsigned int i;
/* XXX return value */
-@@ -9167,9 +9243,9 @@
+@@ -9184,9 +9266,9 @@
dev->mtu = mtu;
if ((dev->flags & IFF_RUNNING) && !sc->sc_invalid) {
/* NB: the rx buffers may need to be reallocated */
}
ATH_UNLOCK(sc);
-Index: madwifi-ng-r2420-20070602/ath/if_athvar.h
+Index: madwifi-ng-r2568-20070710/ath/if_athvar.h
===================================================================
---- madwifi-ng-r2420-20070602.orig/ath/if_athvar.h 2007-06-04 13:21:57.500235304 +0200
-+++ madwifi-ng-r2420-20070602/ath/if_athvar.h 2007-06-04 13:21:58.428094248 +0200
-@@ -48,6 +48,10 @@
- #include "if_athioctl.h"
+--- madwifi-ng-r2568-20070710.orig/ath/if_athvar.h 2007-07-13 11:18:18.709362732 +0200
++++ madwifi-ng-r2568-20070710/ath/if_athvar.h 2007-07-13 11:18:20.017437275 +0200
+@@ -49,6 +49,10 @@
#include "net80211/ieee80211.h" /* XXX for WME_NUM_AC */
+ #include <asm/io.h>
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
+#define irqs_disabled() 0
/*
* Deduce if tasklets are available. If not then
* fall back to using the immediate work queue.
-@@ -621,7 +625,6 @@
+@@ -635,7 +639,6 @@
struct ath_buf *sc_rxbufcur; /* current rx buffer */
u_int32_t *sc_rxlink; /* link ptr in last RX desc */
spinlock_t sc_rxbuflock;
- struct ATH_TQ_STRUCT sc_rxtq; /* rx intr tasklet */
struct ATH_TQ_STRUCT sc_rxorntq; /* rxorn intr tasklet */
u_int8_t sc_defant; /* current default antenna */
- u_int8_t sc_rxotherant; /* rx's on non-default antenna*/
-@@ -634,6 +637,7 @@
+ u_int8_t sc_rxotherant; /* RXs on non-default antenna */
+@@ -648,6 +651,7 @@
u_int sc_txintrperiod; /* tx interrupt batching */
struct ath_txq sc_txq[HAL_NUM_TX_QUEUES];
struct ath_txq *sc_ac2q[WME_NUM_AC]; /* WME AC -> h/w qnum */
struct ATH_TQ_STRUCT sc_txtq; /* tx intr tasklet */
u_int8_t sc_grppoll_str[GRPPOLL_RATE_STR_LEN];
struct ath_descdma sc_bdma; /* beacon descriptors */
-@@ -714,6 +718,8 @@
+@@ -720,6 +724,8 @@
#define ATH_TXBUF_LOCK_ASSERT(_sc) \
KASSERT(spin_is_locked(&(_sc)->sc_txbuflock), ("txbuf not locked!"))
#define ATH_RXBUF_LOCK_INIT(_sc) spin_lock_init(&(_sc)->sc_rxbuflock)
#define ATH_RXBUF_LOCK_DESTROY(_sc)
-Index: madwifi-ng-r2420-20070602/net80211/ieee80211_input.c
+Index: madwifi-ng-r2568-20070710/net80211/ieee80211_input.c
===================================================================
---- madwifi-ng-r2420-20070602.orig/net80211/ieee80211_input.c 2007-06-04 13:21:57.502235000 +0200
-+++ madwifi-ng-r2420-20070602/net80211/ieee80211_input.c 2007-06-04 13:21:58.461089232 +0200
+--- madwifi-ng-r2568-20070710.orig/net80211/ieee80211_input.c 2007-07-13 11:18:17.885315771 +0200
++++ madwifi-ng-r2568-20070710/net80211/ieee80211_input.c 2007-07-13 11:18:20.045438868 +0200
@@ -1128,8 +1128,9 @@
if (ni->ni_vlan != 0 && vap->iv_vlgrp != NULL) {
/* attach vlan tag */
-Index: madwifi-ng-r2420-20070602/ath/if_ath.c
+Index: madwifi-ng-r2568-20070710/ath/if_ath.c
===================================================================
---- madwifi-ng-r2420-20070602.orig/ath/if_ath.c 2007-06-04 13:21:58.427094400 +0200
-+++ madwifi-ng-r2420-20070602/ath/if_ath.c 2007-06-04 13:21:58.684055336 +0200
-@@ -2554,7 +2554,7 @@
- /* NB: use this lock to protect an->an_ff_txbuf in athff_can_aggregate()
- * call too.
+--- madwifi-ng-r2568-20070710.orig/ath/if_ath.c 2007-07-13 11:18:20.017437275 +0200
++++ madwifi-ng-r2568-20070710/ath/if_ath.c 2007-07-13 11:18:20.353456423 +0200
+@@ -2558,7 +2558,7 @@
+ /* NB: use this lock to protect an->an_tx_ffbuf (and txq->axq_stageq)
+ * in athff_can_aggregate() call too.
*/
- ATH_TXQ_LOCK_IRQ(txq);
+ ATH_TXQ_LOCK_BH(txq);
if (athff_can_aggregate(sc, eh, an, skb, vap->iv_fragthreshold, &ff_flush)) {
if (an->an_tx_ffbuf[skb->priority]) { /* i.e., frame on the staging queue */
bf = an->an_tx_ffbuf[skb->priority];
-@@ -2562,6 +2562,7 @@
+@@ -2566,6 +2566,7 @@
/* get (and remove) the frame from staging queue */
TAILQ_REMOVE(&txq->axq_stageq, bf, bf_stagelist);
an->an_tx_ffbuf[skb->priority] = NULL;
/*
* chain skbs and add FF magic
-@@ -2584,7 +2585,7 @@
+@@ -2588,7 +2589,7 @@
*/
ATH_HARDSTART_GET_TX_BUF_WITH_LOCK;
if (bf == NULL) {
goto hardstart_fail;
}
DPRINTF(sc, ATH_DEBUG_XMIT | ATH_DEBUG_FF,
-@@ -2596,8 +2597,7 @@
+@@ -2600,8 +2601,7 @@
an->an_tx_ffbuf[skb->priority] = bf;
TAILQ_INSERT_HEAD(&txq->axq_stageq, bf, bf_stagelist);
- ATH_TXQ_UNLOCK_IRQ_EARLY(txq);
+ ATH_TXQ_UNLOCK_BH(txq);
- return 0;
+ return NETDEV_TX_OK;
}
-@@ -2649,12 +2649,12 @@
+@@ -2614,7 +2614,7 @@
+ an->an_tx_ffbuf[skb->priority] = NULL;
+
+ /* NB: ath_tx_start -> ath_tx_txqaddbuf uses ATH_TXQ_LOCK too */
+- ATH_TXQ_UNLOCK_IRQ_EARLY(txq);
++ ATH_TXQ_UNLOCK_BH(txq);
+
+ /* encap and xmit */
+ bf_ff->bf_skb = ieee80211_encap(ni, bf_ff->bf_skb, &framecnt);
+@@ -2663,12 +2663,12 @@
ATH_HARDSTART_GET_TX_BUF_WITH_LOCK;
if (bf == NULL) {
- ATH_TXQ_UNLOCK_IRQ(txq);
+ ff_flush_done:
ff_bypass:
-
-Index: madwifi-ng-r2420-20070602/ath/if_athvar.h
+Index: madwifi-ng-r2568-20070710/ath/if_athvar.h
===================================================================
---- madwifi-ng-r2420-20070602.orig/ath/if_athvar.h 2007-06-04 13:21:58.428094248 +0200
-+++ madwifi-ng-r2420-20070602/ath/if_athvar.h 2007-06-04 13:21:58.684055336 +0200
-@@ -484,6 +484,8 @@
+--- madwifi-ng-r2568-20070710.orig/ath/if_athvar.h 2007-07-13 11:18:20.017437275 +0200
++++ madwifi-ng-r2568-20070710/ath/if_athvar.h 2007-07-13 11:18:20.353456423 +0200
+@@ -497,6 +497,8 @@
#define ATH_TXQ_INTR_PERIOD 5 /* axq_intrcnt period for intr gen */
#define ATH_TXQ_LOCK_INIT(_tq) spin_lock_init(&(_tq)->axq_lock)
#define ATH_TXQ_LOCK_DESTROY(_tq)
-Index: madwifi-ng-r2420-20070602/ath/if_ath.c
+Index: madwifi-ng-r2568-20070710/ath/if_ath.c
===================================================================
---- madwifi-ng-r2420-20070602.orig/ath/if_ath.c 2007-06-04 13:21:58.684055336 +0200
-+++ madwifi-ng-r2420-20070602/ath/if_ath.c 2007-06-04 13:21:58.895023264 +0200
-@@ -3362,7 +3362,9 @@
+--- madwifi-ng-r2568-20070710.orig/ath/if_ath.c 2007-07-13 11:18:20.353456423 +0200
++++ madwifi-ng-r2568-20070710/ath/if_ath.c 2007-07-13 11:18:20.621471697 +0200
+@@ -3384,7 +3384,9 @@
rfilt |= HAL_RX_FILTER_PROM;
if (ic->ic_opmode == IEEE80211_M_STA ||
sc->sc_opmode == HAL_M_IBSS || /* NB: AHDEMO too */
rfilt |= HAL_RX_FILTER_BEACON;
if ((sc->sc_nmonvaps > 0) || ((sc->sc_nvaps > 0) && (sc->sc_nibssvaps > 0)))
rfilt |= (HAL_RX_FILTER_CONTROL | HAL_RX_FILTER_BEACON |
-Index: madwifi-ng-r2420-20070602/net80211/ieee80211_input.c
+Index: madwifi-ng-r2568-20070710/net80211/ieee80211_input.c
===================================================================
---- madwifi-ng-r2420-20070602.orig/net80211/ieee80211_input.c 2007-06-04 13:21:58.461089232 +0200
-+++ madwifi-ng-r2420-20070602/net80211/ieee80211_input.c 2007-06-04 13:21:58.897022960 +0200
+--- madwifi-ng-r2568-20070710.orig/net80211/ieee80211_input.c 2007-07-13 11:18:20.045438868 +0200
++++ madwifi-ng-r2568-20070710/net80211/ieee80211_input.c 2007-07-13 11:18:20.621471697 +0200
@@ -321,11 +321,12 @@
bssid = wh->i_addr3;
}
/* not interested in */
IEEE80211_DISCARD_MAC(vap, IEEE80211_MSG_INPUT,
bssid, NULL, "%s", "not to bss");
-@@ -2542,7 +2544,7 @@
+@@ -2541,7 +2543,7 @@
u_int8_t *frm, *efrm;
u_int8_t *ssid, *rates, *xrates, *wpa, *rsn, *wme, *ath;
u_int8_t rate;
u_int8_t qosinfo;
wh = (struct ieee80211_frame *) skb->data;
-@@ -2564,11 +2566,15 @@
+@@ -2563,11 +2565,15 @@
* o station mode when associated (to collect state
* updates such as 802.11g slot time), or
* o adhoc mode (to discover neighbors)
vap->iv_stats.is_rx_mgtdiscard++;
return;
}
-@@ -2651,6 +2657,7 @@
+@@ -2650,6 +2656,7 @@
break;
}
scan.erp = frm[2];
break;
case IEEE80211_ELEMID_RSN:
scan.rsn = frm;
-@@ -2826,6 +2833,20 @@
+@@ -2867,6 +2874,20 @@
ieee80211_bg_scan(vap);
return;
}
+ /* Update AP protection mode when in 11G mode */
+ if ((vap->iv_opmode == IEEE80211_M_HOSTAP) &&
+ IEEE80211_IS_CHAN_ANYG(ic->ic_curchan)) {
-+
++
+ /* Assume no ERP IE == 11b AP */
+ if ((!has_erp || (has_erp && (scan.erp & IEEE80211_ERP_NON_ERP_PRESENT))) &&
+ !(ic->ic_flags & IEEE80211_F_USEPROT)) {
-+
++
+ ic->ic_flags |= IEEE80211_F_USEPROT;
+ ic->ic_flags_ext |= IEEE80211_FEXT_ERPUPDATE;
+ }
/*
* If scanning, just pass information to the scan module.
*/
-Index: madwifi-ng-r2420-20070602/net80211/ieee80211_node.c
+Index: madwifi-ng-r2568-20070710/net80211/ieee80211_node.c
===================================================================
---- madwifi-ng-r2420-20070602.orig/net80211/ieee80211_node.c 2007-06-04 13:21:57.503234848 +0200
-+++ madwifi-ng-r2420-20070602/net80211/ieee80211_node.c 2007-06-04 13:21:58.897022960 +0200
+--- madwifi-ng-r2568-20070710.orig/net80211/ieee80211_node.c 2007-07-13 11:18:17.925318050 +0200
++++ madwifi-ng-r2568-20070710/net80211/ieee80211_node.c 2007-07-13 11:18:20.637472608 +0200
@@ -332,10 +332,16 @@
/* Update country ie information */
ieee80211_build_countryie(ic);
+
+ if ((vap->iv_flags & IEEE80211_F_PUREG) &&
+ IEEE80211_IS_CHAN_ANYG(chan)) {
-+ ieee80211_setpuregbasicrates(&ni->ni_rates);
++ ieee80211_setpuregbasicrates(&ni->ni_rates);
+ }
(void) ieee80211_sta_join1(PASS_NODE(ni));
}
-Index: madwifi-ng-r2420-20070602/net80211/ieee80211_proto.c
+Index: madwifi-ng-r2568-20070710/net80211/ieee80211_proto.c
===================================================================
---- madwifi-ng-r2420-20070602.orig/net80211/ieee80211_proto.c 2007-06-04 13:21:58.133139088 +0200
-+++ madwifi-ng-r2420-20070602/net80211/ieee80211_proto.c 2007-06-04 13:21:58.898022808 +0200
+--- madwifi-ng-r2568-20070710.orig/net80211/ieee80211_proto.c 2007-07-13 11:18:19.601413567 +0200
++++ madwifi-ng-r2568-20070710/net80211/ieee80211_proto.c 2007-07-13 11:18:20.665474204 +0200
@@ -586,6 +586,28 @@
{ 4, { 2, 4, 11, 22 } }, /* IEEE80211_MODE_TURBO_G (mixed b/g) */
};
/*
* Mark the basic rates for the 11g rate table based on the
* specified mode. For 11b compatibility we mark only 11b
-Index: madwifi-ng-r2420-20070602/net80211/ieee80211_var.h
+Index: madwifi-ng-r2568-20070710/net80211/ieee80211_var.h
===================================================================
---- madwifi-ng-r2420-20070602.orig/net80211/ieee80211_var.h 2007-06-04 13:21:58.134138936 +0200
-+++ madwifi-ng-r2420-20070602/net80211/ieee80211_var.h 2007-06-04 13:21:58.899022656 +0200
-@@ -593,6 +593,8 @@
+--- madwifi-ng-r2568-20070710.orig/net80211/ieee80211_var.h 2007-07-13 11:18:19.625414935 +0200
++++ madwifi-ng-r2568-20070710/net80211/ieee80211_var.h 2007-07-13 11:18:20.705476482 +0200
+@@ -592,6 +592,8 @@
void ieee80211_build_countryie(struct ieee80211com *);
int ieee80211_media_setup(struct ieee80211com *, struct ifmedia *, u_int32_t,
ifm_change_cb_t, ifm_stat_cb_t);
+void ieee80211_setpuregbasicrates(struct ieee80211_rateset *rs);
-+
++
/* Key update synchronization methods. XXX should not be visible. */
static __inline void
--- /dev/null
+Index: madwifi-ng-r2568-20070710/ath/if_ath.c
+===================================================================
+--- madwifi-ng-r2568-20070710.orig/ath/if_ath.c 2007-07-13 11:18:20.621471697 +0200
++++ madwifi-ng-r2568-20070710/ath/if_ath.c 2007-07-13 11:18:21.021494493 +0200
+@@ -153,6 +153,7 @@
+ static void ath_turbo_switch_mode(unsigned long);
+ static int ath_check_beacon_done(struct ath_softc *);
+ #endif
++static void ath_do_calibrate(struct net_device *);
+ static void ath_beacon_send(struct ath_softc *, int *);
+ static void ath_beacon_start_adhoc(struct ath_softc *, struct ieee80211vap *);
+ static void ath_beacon_return(struct ath_softc *, struct ath_buf *);
+@@ -4173,7 +4174,7 @@
+ DPRINTF(sc, ATH_DEBUG_BEACON_PROC,
+ "%s: missed %u consecutive beacons\n",
+ __func__, sc->sc_bmisscount);
+- if (sc->sc_bmisscount > BSTUCK_THRESH)
++ if (sc->sc_bmisscount > BSTUCK_CALIBR_THR)
+ ATH_SCHEDULE_TQUEUE(&sc->sc_bstucktq, needmark);
+ return;
+ }
+@@ -4312,8 +4313,17 @@
+ * check will be true, in which case return
+ * without resetting the driver.
+ */
+- if (sc->sc_bmisscount <= BSTUCK_THRESH)
++ if (sc->sc_bmisscount <= BSTUCK_CALIBR_THR)
+ return;
++
++ if (sc->sc_bmisscount <= BSTUCK_RESET_THR) {
++ ATH_LOCK(sc);
++ ath_do_calibrate(dev);
++ mod_timer(&sc->sc_cal_ch, jiffies + (ath_calinterval * HZ));
++ ATH_UNLOCK(sc);
++ return;
++ }
++
+ printk("%s: stuck beacon; resetting (bmiss count %u)\n",
+ DEV_NAME(dev), sc->sc_bmisscount);
+ ath_reset(dev);
+@@ -8027,17 +8037,13 @@
+ * Periodically recalibrate the PHY to account
+ * for temperature/environment changes.
+ */
+-static void
+-ath_calibrate(unsigned long arg)
++static void ath_do_calibrate(struct net_device *dev)
+ {
+- struct net_device *dev = (struct net_device *) arg;
+ struct ath_softc *sc = dev->priv;
+ struct ath_hal *ah = sc->sc_ah;
+- /* u_int32_t nchans; */
+ HAL_BOOL isIQdone = AH_FALSE;
+
+ sc->sc_stats.ast_per_cal++;
+-
+ DPRINTF(sc, ATH_DEBUG_CALIBRATE, "%s: channel %u/%x\n",
+ __func__, sc->sc_curchan.channel, sc->sc_curchan.channelFlags);
+
+@@ -8055,15 +8061,26 @@
+ __func__, sc->sc_curchan.channel);
+ sc->sc_stats.ast_per_calfail++;
+ }
+-
+- ath_hal_process_noisefloor(ah);
+ if (isIQdone == AH_TRUE)
+ ath_calinterval = ATH_LONG_CALINTERVAL;
+ else
+ ath_calinterval = ATH_SHORT_CALINTERVAL;
++}
++
++static void
++ath_calibrate(unsigned long arg)
++{
++ struct net_device *dev = (struct net_device *) arg;
++ struct ath_softc *sc = dev->priv;
++ struct ath_hal *ah = sc->sc_ah;
++
++ ATH_LOCK(sc);
++ ath_do_calibrate(dev);
++ ath_hal_process_noisefloor(ah);
+
+ sc->sc_cal_ch.expires = jiffies + (ath_calinterval * HZ);
+ add_timer(&sc->sc_cal_ch);
++ ATH_UNLOCK(sc);
+ }
+
+ static void
+Index: madwifi-ng-r2568-20070710/ath/if_athvar.h
+===================================================================
+--- madwifi-ng-r2568-20070710.orig/ath/if_athvar.h 2007-07-13 11:18:20.353456423 +0200
++++ madwifi-ng-r2568-20070710/ath/if_athvar.h 2007-07-13 11:18:21.021494493 +0200
+@@ -538,7 +538,8 @@
+ */
+ #define ATH_TXQ_MOVE_Q(_tqs,_tqd) ATH_TXQ_MOVE_MCASTQ(_tqs,_tqd)
+
+-#define BSTUCK_THRESH 10 /* # of stuck beacons before resetting NB: this is a guess*/
++#define BSTUCK_CALIBR_THR 3 /* # of stuck beacons before restarting calibration */
++#define BSTUCK_RESET_THR 10 /* # of stuck beacons before resetting NB: this is a guess*/
+
+ struct ath_softc {
+ struct ieee80211com sc_ic; /* NB: must be first */
-Index: madwifi-ng-r2420-20070602/ath/if_ath.c
+Index: madwifi-ng-r2568-20070710/ath/if_ath.c
===================================================================
---- madwifi-ng-r2420-20070602.orig/ath/if_ath.c 2007-06-30 23:52:00.743038750 +0200
-+++ madwifi-ng-r2420-20070602/ath/if_ath.c 2007-07-01 00:12:19.127183000 +0200
-@@ -5602,6 +5602,7 @@
- u_int phyerr;
+--- madwifi-ng-r2568-20070710.orig/ath/if_ath.c 2007-07-13 11:18:21.021494493 +0200
++++ madwifi-ng-r2568-20070710/ath/if_ath.c 2007-07-13 11:18:21.297510222 +0200
+@@ -5630,6 +5630,7 @@
+ u_int64_t rs_tsf;
u_int processed = 0, early_stop = 0;
u_int rx_limit = dev->quota;
+ u_int mic_fail = 0;
/* Let the 802.11 layer know about the new noise floor */
sc->sc_channoise = ath_hal_get_channel_noise(ah, &(sc->sc_curchan));
-@@ -5696,25 +5697,7 @@
+@@ -5724,25 +5725,7 @@
}
if (rs->rs_status & HAL_RXERR_MIC) {
sc->sc_stats.ast_rx_badmic++;
}
/*
* Reject error frames if we have no vaps that
-@@ -5772,8 +5755,9 @@
+@@ -5807,8 +5790,9 @@
/*
* Finished monitor mode handling, now reject
* error frames before passing to other vaps
dev_kfree_skb(skb);
skb = NULL;
goto rx_next;
-@@ -5804,6 +5788,27 @@
+@@ -5839,6 +5823,27 @@
sc->sc_hwmap[rs->rs_rate].ieeerate,
rs->rs_rssi);
+ if (mic_fail) {
+ /* Ignore control frames which are reported with mic error */
+ if ((((struct ieee80211_frame *)skb->data)->i_fc[0] &
-+ IEEE80211_FC0_TYPE_MASK) == IEEE80211_FC0_TYPE_CTL)
++ IEEE80211_FC0_TYPE_MASK) == IEEE80211_FC0_TYPE_CTL)
+ goto drop_micfail;
+
+ ni = ieee80211_find_rxnode(ic, (const struct ieee80211_frame_min *) skb->data);
/*
* Locate the node for sender, track state, and then
* pass the (referenced) node up to the 802.11 layer
-Index: madwifi-ng-r2420-20070602/net80211/ieee80211_crypto_ccmp.c
+Index: madwifi-ng-r2568-20070710/net80211/ieee80211_crypto_ccmp.c
===================================================================
---- madwifi-ng-r2420-20070602.orig/net80211/ieee80211_crypto_ccmp.c 2007-06-30 23:52:00.042995000 +0200
-+++ madwifi-ng-r2420-20070602/net80211/ieee80211_crypto_ccmp.c 2007-06-30 23:52:00.999054750 +0200
-@@ -78,7 +78,7 @@
+--- madwifi-ng-r2568-20070710.orig/net80211/ieee80211_crypto_ccmp.c 2007-07-13 11:18:18.465348826 +0200
++++ madwifi-ng-r2568-20070710/net80211/ieee80211_crypto_ccmp.c 2007-07-13 11:18:21.297510222 +0200
+@@ -73,7 +73,7 @@
static int ccmp_encap(struct ieee80211_key *, struct sk_buff *, u_int8_t);
static int ccmp_decap(struct ieee80211_key *, struct sk_buff *, int);
static int ccmp_enmic(struct ieee80211_key *, struct sk_buff *, int);
static const struct ieee80211_cipher ccmp = {
.ic_name = "AES-CCM",
-@@ -304,7 +304,7 @@
+@@ -308,7 +308,7 @@
* Verify and strip MIC from the frame.
*/
static int
{
return 1;
}
-Index: madwifi-ng-r2420-20070602/net80211/ieee80211_crypto.h
+Index: madwifi-ng-r2568-20070710/net80211/ieee80211_crypto.h
===================================================================
---- madwifi-ng-r2420-20070602.orig/net80211/ieee80211_crypto.h 2007-06-30 23:51:53.942613750 +0200
-+++ madwifi-ng-r2420-20070602/net80211/ieee80211_crypto.h 2007-06-30 23:52:01.107061500 +0200
+--- madwifi-ng-r2568-20070710.orig/net80211/ieee80211_crypto.h 2007-07-13 11:18:12.749023072 +0200
++++ madwifi-ng-r2568-20070710/net80211/ieee80211_crypto.h 2007-07-13 11:18:21.317511359 +0200
@@ -145,7 +145,7 @@
int (*ic_encap)(struct ieee80211_key *, struct sk_buff *, u_int8_t);
int (*ic_decap)(struct ieee80211_key *, struct sk_buff *, int);
}
/*
-Index: madwifi-ng-r2420-20070602/net80211/ieee80211_crypto_none.c
+Index: madwifi-ng-r2568-20070710/net80211/ieee80211_crypto_none.c
===================================================================
---- madwifi-ng-r2420-20070602.orig/net80211/ieee80211_crypto_none.c 2007-06-30 23:51:53.950614250 +0200
-+++ madwifi-ng-r2420-20070602/net80211/ieee80211_crypto_none.c 2007-06-30 23:52:01.171065500 +0200
+--- madwifi-ng-r2568-20070710.orig/net80211/ieee80211_crypto_none.c 2007-07-13 11:18:12.757023527 +0200
++++ madwifi-ng-r2568-20070710/net80211/ieee80211_crypto_none.c 2007-07-13 11:18:21.333512274 +0200
@@ -52,7 +52,7 @@
static int none_encap(struct ieee80211_key *, struct sk_buff *, u_int8_t);
static int none_decap(struct ieee80211_key *, struct sk_buff *, int);
{
struct ieee80211vap *vap = k->wk_private;
-Index: madwifi-ng-r2420-20070602/net80211/ieee80211_crypto_tkip.c
+Index: madwifi-ng-r2568-20070710/net80211/ieee80211_crypto_tkip.c
===================================================================
---- madwifi-ng-r2420-20070602.orig/net80211/ieee80211_crypto_tkip.c 2007-06-30 23:51:53.958614750 +0200
-+++ madwifi-ng-r2420-20070602/net80211/ieee80211_crypto_tkip.c 2007-06-30 23:52:01.203067500 +0200
+--- madwifi-ng-r2568-20070710.orig/net80211/ieee80211_crypto_tkip.c 2007-07-13 11:18:12.765023983 +0200
++++ madwifi-ng-r2568-20070710/net80211/ieee80211_crypto_tkip.c 2007-07-13 11:18:21.373514552 +0200
@@ -57,7 +57,7 @@
static int tkip_encap(struct ieee80211_key *, struct sk_buff *, u_int8_t);
static int tkip_enmic(struct ieee80211_key *, struct sk_buff *, int);
struct ieee80211vap *vap = ctx->tc_vap;
u8 mic[IEEE80211_WEP_MICLEN];
u8 mic0[IEEE80211_WEP_MICLEN];
-Index: madwifi-ng-r2420-20070602/net80211/ieee80211_crypto_wep.c
+Index: madwifi-ng-r2568-20070710/net80211/ieee80211_crypto_wep.c
===================================================================
---- madwifi-ng-r2420-20070602.orig/net80211/ieee80211_crypto_wep.c 2007-06-30 23:51:53.966615250 +0200
-+++ madwifi-ng-r2420-20070602/net80211/ieee80211_crypto_wep.c 2007-06-30 23:52:01.211068000 +0200
+--- madwifi-ng-r2568-20070710.orig/net80211/ieee80211_crypto_wep.c 2007-07-13 11:18:12.769024209 +0200
++++ madwifi-ng-r2568-20070710/net80211/ieee80211_crypto_wep.c 2007-07-13 11:18:21.393515692 +0200
@@ -54,7 +54,7 @@
static int wep_encap(struct ieee80211_key *, struct sk_buff *, u_int8_t);
static int wep_decap(struct ieee80211_key *, struct sk_buff *, int);
{
return 1;
}
-Index: madwifi-ng-r2420-20070602/net80211/ieee80211_input.c
+Index: madwifi-ng-r2568-20070710/net80211/ieee80211_input.c
===================================================================
---- madwifi-ng-r2420-20070602.orig/net80211/ieee80211_input.c 2007-06-30 23:52:00.799042250 +0200
-+++ madwifi-ng-r2420-20070602/net80211/ieee80211_input.c 2007-06-30 23:52:01.239069750 +0200
+--- madwifi-ng-r2568-20070710.orig/net80211/ieee80211_input.c 2007-07-13 11:18:20.621471697 +0200
++++ madwifi-ng-r2568-20070710/net80211/ieee80211_input.c 2007-07-13 11:18:21.417517061 +0200
@@ -632,7 +632,7 @@
* Next strip any MSDU crypto bits.
*/
IEEE80211_DISCARD_MAC(vap, IEEE80211_MSG_INPUT,
ni->ni_macaddr, "data", "%s", "demic error");
IEEE80211_NODE_STAT(ni, rx_demicfail);
-@@ -3730,6 +3730,47 @@
+@@ -3772,6 +3772,47 @@
}
#endif
+/*
-+ * Process a frame w/ hw detected MIC failure.
++ * Process a frame w/ hw detected MIC failure.
+ * The frame will be dropped in any case.
+ */
+void
+ struct ieee80211_key *key;
+ int hdrspace;
+ struct ieee80211com *ic = vap->iv_ic;
-+
++
+ if (skb->len < sizeof(struct ieee80211_frame_min)) {
+ IEEE80211_DISCARD_MAC(vap, IEEE80211_MSG_ANY,
+ ni->ni_macaddr, NULL,
+ }
+
+ wh = (struct ieee80211_frame *)skb->data;
-+
++
+ hdrspace = ieee80211_hdrspace(ic, wh);
+ key = ieee80211_crypto_decap(ni, skb, hdrspace);
+ if (key == NULL) {
#ifdef IEEE80211_DEBUG
/*
* Debugging support.
-Index: madwifi-ng-r2420-20070602/net80211/ieee80211_proto.h
+Index: madwifi-ng-r2568-20070710/net80211/ieee80211_proto.h
===================================================================
---- madwifi-ng-r2420-20070602.orig/net80211/ieee80211_proto.h 2007-06-30 23:52:00.331013000 +0200
-+++ madwifi-ng-r2420-20070602/net80211/ieee80211_proto.h 2007-06-30 23:52:01.295073250 +0200
+--- madwifi-ng-r2568-20070710.orig/net80211/ieee80211_proto.h 2007-07-13 11:18:12.785025121 +0200
++++ madwifi-ng-r2568-20070710/net80211/ieee80211_proto.h 2007-07-13 11:18:21.441518427 +0200
@@ -91,6 +91,7 @@
void ieee80211_set11gbasicrates(struct ieee80211_rateset *, enum ieee80211_phymode);
enum ieee80211_phymode ieee80211_get11gbasicrates(struct ieee80211_rateset *);
/*
* Return the size of the 802.11 header for a management or data frame.
-Index: madwifi-ng-r2420-20070602/net80211/ieee80211_linux.c
+Index: madwifi-ng-r2568-20070710/net80211/ieee80211_linux.c
===================================================================
---- madwifi-ng-r2420-20070602.orig/net80211/ieee80211_linux.c 2007-06-30 23:52:00.026994000 +0200
-+++ madwifi-ng-r2420-20070602/net80211/ieee80211_linux.c 2007-06-30 23:52:01.347076500 +0200
+--- madwifi-ng-r2568-20070710.orig/net80211/ieee80211_linux.c 2007-07-13 11:18:18.229335376 +0200
++++ madwifi-ng-r2568-20070710/net80211/ieee80211_linux.c 2007-07-13 11:18:21.485520935 +0200
@@ -291,8 +291,8 @@
/* TODO: needed parameters: count, keyid, key type, src address, TSC */
snprintf(buf, sizeof(buf), "%s(keyid=%d %scast addr=%s)", tag,
memset(&wrqu, 0, sizeof(wrqu));
wrqu.data.length = strlen(buf);
wireless_send_event(dev, IWEVCUSTOM, &wrqu, buf);
-Index: madwifi-ng-r2420-20070602/net80211/ieee80211_output.c
+Index: madwifi-ng-r2568-20070710/net80211/ieee80211_output.c
===================================================================
---- madwifi-ng-r2420-20070602.orig/net80211/ieee80211_output.c 2007-06-30 23:52:00.118999750 +0200
-+++ madwifi-ng-r2420-20070602/net80211/ieee80211_output.c 2007-06-30 23:52:01.355077000 +0200
-@@ -1077,13 +1077,16 @@
+--- madwifi-ng-r2568-20070710.orig/net80211/ieee80211_output.c 2007-07-13 11:18:12.797025805 +0200
++++ madwifi-ng-r2568-20070710/net80211/ieee80211_output.c 2007-07-13 11:18:21.509522302 +0200
+@@ -1079,13 +1079,16 @@
cip = (struct ieee80211_cipher *) key->wk_cipher;
ciphdrsize = cip->ic_header;
tailsize += (cip->ic_trailer + cip->ic_miclen);
/*
* Allocate sk_buff for each subsequent fragment; First fragment
-Index: madwifi-ng-r2420-20070602/net80211/ieee80211_node.c
+Index: madwifi-ng-r2568-20070710/net80211/ieee80211_node.c
===================================================================
---- madwifi-ng-r2420-20070602.orig/net80211/ieee80211_node.c 2007-06-30 23:52:54.850420250 +0200
-+++ madwifi-ng-r2420-20070602/net80211/ieee80211_node.c 2007-07-01 00:18:32.370509250 +0200
-@@ -1885,11 +1885,13 @@
+--- madwifi-ng-r2568-20070710.orig/net80211/ieee80211_node.c 2007-07-13 11:18:20.637472608 +0200
++++ madwifi-ng-r2568-20070710/net80211/ieee80211_node.c 2007-07-13 11:18:21.533523672 +0200
+@@ -1891,11 +1891,13 @@
/* From this point onwards we can no longer find the node,
* so no more references are generated
*/
-Index: madwifi-ng-r2420-20070602/net80211/ieee80211_beacon.c
+Index: madwifi-ng-r2568-20070710/net80211/ieee80211_beacon.c
===================================================================
---- madwifi-ng-r2420-20070602.orig/net80211/ieee80211_beacon.c 2007-06-04 13:21:57.501235152 +0200
-+++ madwifi-ng-r2420-20070602/net80211/ieee80211_beacon.c 2007-06-04 13:21:59.411944680 +0200
+--- madwifi-ng-r2568-20070710.orig/net80211/ieee80211_beacon.c 2007-07-13 11:18:17.857314176 +0200
++++ madwifi-ng-r2568-20070710/net80211/ieee80211_beacon.c 2007-07-13 11:18:21.897544413 +0200
@@ -512,7 +512,7 @@
vap->iv_flags &= ~IEEE80211_F_XRUPDATE;
}