aboutsummaryrefslogtreecommitdiffstats
path: root/package/madwifi/patches-r3776/303-bssid_alloc.patch
blob: c10a21cf9be6cdfeca9eb00a414729952d8ae8d9 (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
Index: madwifi-trunk-r3776/ath/if_ath.c
===================================================================
--- madwifi-trunk-r3776.orig/ath/if_ath.c	2008-07-17 01:49:58.000000000 +0200
+++ madwifi-trunk-r3776/ath/if_ath.c	2008-07-17 01:57:39.000000000 +0200
@@ -1333,7 +1333,7 @@
 		/* Use RadioTAP interface type for monitor mode. */
 		dev->type = ARPHRD_IEEE80211_RADIOTAP;
 
-	if (flags & IEEE80211_CLONE_BSSID) {
+	if (!(flags & IEEE80211_CLONE_BSSID)) {
 		if (sc->sc_hasbmask) {
 			struct ieee80211vap *v;
 			uint64_t id_mask = 0;
@@ -1347,11 +1347,12 @@
 			TAILQ_FOREACH(v, &ic->ic_vaps, iv_next)
 				id_mask |= (1 << ATH_GET_VAP_ID(v->iv_myaddr));
 
-			for (id = 1; id < ath_maxvaps; id++) {
+			for (id = 0; id < ath_maxvaps; id++) {
 				/* Get the first available slot. */
 				if ((id_mask & (1 << id)) == 0) {
 					ATH_SET_VAP_BSSID(vap->iv_myaddr, id);
 					ATH_SET_VAP_BSSID(vap->iv_bssid, id);
+					sc->sc_bclast = id;
 					break;
 				}
 			}
@@ -1359,7 +1360,12 @@
 			EPRINTF(sc, "Unique BSSID requested on HW that does"
 				"does not support the necessary features.");
 		}
+	} else {
+		/* share the BSSID of the last created VAP */
+		ATH_SET_VAP_BSSID(vap->iv_myaddr, sc->sc_bclast);
+		ATH_SET_VAP_BSSID(vap->iv_bssid, sc->sc_bclast);
 	}
+
 	avp->av_bslot = -1;
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,15)
 	atomic_set(&avp->av_beacon_alloc, 0);
Index: madwifi-trunk-r3776/ath/if_athvar.h
===================================================================
--- madwifi-trunk-r3776.orig/ath/if_athvar.h	2008-07-17 01:27:21.000000000 +0200
+++ madwifi-trunk-r3776/ath/if_athvar.h	2008-07-17 01:57:15.000000000 +0200
@@ -802,7 +802,7 @@
 	} sc_updateslot;			/* slot time update fsm */
 	int sc_slotupdate;			/* slot to next advance fsm */
 	struct ieee80211vap **sc_bslot;		/* beacon xmit slots */
-	int sc_bnext;				/* next slot for beacon xmit */
+	int sc_bclast;				/* last used slot for beacon xmit */
 
 	int sc_beacon_cal;			/* use beacon timer for calibration */
 	long unsigned int sc_calinterval_sec;	/* current interval for calibration (in seconds) */