From 8becf17417efa2a3dbe7b1a19ca80bc626060d45 Mon Sep 17 00:00:00 2001
From: Felix Fietkau <nbd@openwrt.org>
Date: Sat, 2 Apr 2011 01:10:01 +0000
Subject: ath9k: fix adhoc beacon issues (#9163)

SVN-Revision: 26395
---
 .../patches/570-ath9k_fix_ibss_beacon_slot.patch        | 17 +++++++++++++++++
 .../patches/571-ath9k_fix_beacon_config_mode.patch      | 11 +++++++++++
 2 files changed, 28 insertions(+)
 create mode 100644 package/mac80211/patches/570-ath9k_fix_ibss_beacon_slot.patch
 create mode 100644 package/mac80211/patches/571-ath9k_fix_beacon_config_mode.patch

(limited to 'package/mac80211/patches')

diff --git a/package/mac80211/patches/570-ath9k_fix_ibss_beacon_slot.patch b/package/mac80211/patches/570-ath9k_fix_ibss_beacon_slot.patch
new file mode 100644
index 0000000000..50a5bc1182
--- /dev/null
+++ b/package/mac80211/patches/570-ath9k_fix_ibss_beacon_slot.patch
@@ -0,0 +1,17 @@
+--- a/drivers/net/wireless/ath/ath9k/beacon.c
++++ b/drivers/net/wireless/ath/ath9k/beacon.c
+@@ -392,14 +392,6 @@ void ath_beacon_tasklet(unsigned long da
+ 	tsf += TU_TO_USEC(ah->config.sw_beacon_response_time);
+ 	tsftu = TSF_TO_TU((tsf * ATH_BCBUF) >>32, tsf * ATH_BCBUF);
+ 	slot = (tsftu % (intval * ATH_BCBUF)) / intval;
+-	/*
+-	 * Reverse the slot order to get slot 0 on the TBTT offset that does
+-	 * not require TSF adjustment and other slots adding
+-	 * slot/ATH_BCBUF * beacon_int to timestamp. For example, with
+-	 * ATH_BCBUF = 4, we process beacon slots as follows: 3 2 1 0 3 2 1 ..
+-	 * and slot 0 is at correct offset to TBTT.
+-	 */
+-	slot = ATH_BCBUF - slot - 1;
+ 	vif = sc->beacon.bslot[slot];
+ 
+ 	ath_dbg(common, ATH_DBG_BEACON,
diff --git a/package/mac80211/patches/571-ath9k_fix_beacon_config_mode.patch b/package/mac80211/patches/571-ath9k_fix_beacon_config_mode.patch
new file mode 100644
index 0000000000..4ba74f86dc
--- /dev/null
+++ b/package/mac80211/patches/571-ath9k_fix_beacon_config_mode.patch
@@ -0,0 +1,11 @@
+--- a/drivers/net/wireless/ath/ath9k/beacon.c
++++ b/drivers/net/wireless/ath/ath9k/beacon.c
+@@ -700,7 +700,7 @@ void ath_beacon_config(struct ath_softc 
+ 	if (cur_conf->dtim_period == 0)
+ 		cur_conf->dtim_period = 1;
+ 
+-	switch (iftype) {
++	switch (sc->sc_ah->opmode) {
+ 	case NL80211_IFTYPE_AP:
+ 		ath_beacon_config_ap(sc, cur_conf);
+ 		break;
-- 
cgit v1.2.3