aboutsummaryrefslogtreecommitdiffstats
path: root/package/madwifi/patches/312-erpupdate.patch
blob: 162e2c36e381e4610e0d52beccaaf89a023c214d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
Index: madwifi-trunk-r3280/net80211/ieee80211_beacon.c
===================================================================
--- madwifi-trunk-r3280.orig/net80211/ieee80211_beacon.c	2008-01-28 17:27:08.000000000 +0100
+++ madwifi-trunk-r3280/net80211/ieee80211_beacon.c	2008-01-28 17:32:30.587778482 +0100
@@ -542,10 +542,10 @@
 			vap->iv_flags &= ~IEEE80211_F_XRUPDATE;
 		}
 #endif
-		if ((ic->ic_flags_ext & IEEE80211_FEXT_ERPUPDATE) && 
+		if ((vap->iv_flags_ext & IEEE80211_FEXT_ERPUPDATE) &&
 				(bo->bo_erp != NULL)) {
 			(void)ieee80211_add_erp(bo->bo_erp, ic);
-			ic->ic_flags_ext &= ~IEEE80211_FEXT_ERPUPDATE;
+			vap->iv_flags_ext &= ~IEEE80211_FEXT_ERPUPDATE;
 		}
 	}
 	/* if it is a mode change beacon for dynamic turbo case */
Index: madwifi-trunk-r3280/net80211/ieee80211_input.c
===================================================================
--- madwifi-trunk-r3280.orig/net80211/ieee80211_input.c	2008-01-28 17:30:33.905937066 +0100
+++ madwifi-trunk-r3280/net80211/ieee80211_input.c	2008-01-28 17:31:42.836941957 +0100
@@ -3423,9 +3423,12 @@
 			/* Assume no ERP IE == 11b AP */
 			if ((!has_erp || (has_erp && (scan.erp & IEEE80211_ERP_NON_ERP_PRESENT))) &&
 				!(ic->ic_flags & IEEE80211_F_USEPROT)) {
+				struct ieee80211vap *tmpvap;
 
 				ic->ic_flags |= IEEE80211_F_USEPROT;
-				ic->ic_flags_ext |= IEEE80211_FEXT_ERPUPDATE;
+				TAILQ_FOREACH(tmpvap, &ic->ic_vaps, iv_next) {
+					tmpvap->iv_flags_ext |= IEEE80211_FEXT_ERPUPDATE;
+				}
 			}
 		}
 
Index: madwifi-trunk-r3280/net80211/ieee80211_node.c
===================================================================
--- madwifi-trunk-r3280.orig/net80211/ieee80211_node.c	2008-01-28 17:30:34.525972400 +0100
+++ madwifi-trunk-r3280/net80211/ieee80211_node.c	2008-01-28 17:31:42.844938410 +0100
@@ -2021,8 +2021,12 @@
 		}
 
 		/* Update ERP element if this is first non ERP station */
-		if (ic->ic_nonerpsta == 1)
-			ic->ic_flags_ext |= IEEE80211_FEXT_ERPUPDATE;
+		if (ic->ic_nonerpsta == 1) {
+			struct ieee80211vap *tmpvap;
+			TAILQ_FOREACH(tmpvap, &ic->ic_vaps, iv_next) {
+				tmpvap->iv_flags_ext |= IEEE80211_FEXT_ERPUPDATE;
+			}
+		}
 	} else
 		ni->ni_flags |= IEEE80211_NODE_ERP;
 }
@@ -2225,6 +2229,8 @@
 		IEEE80211_NOTE(vap, IEEE80211_MSG_ASSOC, ni,
 			"non-ERP station leaves, count now %d", ic->ic_nonerpsta);
 		if (ic->ic_nonerpsta == 0) {
+			struct ieee80211vap *tmpvap;
+
 			IEEE80211_DPRINTF(vap, IEEE80211_MSG_ASSOC,
 				"%s: disable use of protection\n", __func__);
 			ic->ic_flags &= ~IEEE80211_F_USEPROT;
@@ -2236,7 +2242,9 @@
 				ic->ic_flags |= IEEE80211_F_SHPREAMBLE;
 				ic->ic_flags &= ~IEEE80211_F_USEBARKER;
 			}
-			ic->ic_flags_ext |= IEEE80211_FEXT_ERPUPDATE;
+			TAILQ_FOREACH(tmpvap, &ic->ic_vaps, iv_next) {
+				tmpvap->iv_flags_ext |= IEEE80211_FEXT_ERPUPDATE;
+			}
 		}
 	}
 }