aboutsummaryrefslogtreecommitdiffstats
path: root/package/madwifi/patches/420-diversity_fix.patch
blob: 90bcd0e160a6d40ac0f452875e408457a8a2173e (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
75
76
77
78
79
80
81
82
83
84
85
86
--- a/ath/if_ath.c
+++ b/ath/if_ath.c
@@ -797,7 +797,6 @@ ath_attach(u_int16_t devid, struct net_d
 		break;
 	}
 
-	sc->sc_setdefantenna = ath_setdefantenna;
 	sc->sc_rc = ieee80211_rate_attach(sc, ratectl);
 	if (sc->sc_rc == NULL) {
 		error = EIO;
@@ -2624,9 +2623,6 @@ ath_init(struct net_device *dev)
 	ath_radar_update(sc);
 	ath_rp_flush(sc);
 
-	/* Set the default RX antenna; it may get lost on reset. */
-	ath_setdefantenna(sc, sc->sc_defant);
-
 	/*
 	 * Setup the hardware after reset: the key cache
 	 * is filled as needed and the receive engine is
@@ -3019,7 +3015,6 @@ ath_reset(struct net_device *dev)
 	ath_setintmit(sc);
 	ath_update_txpow(sc);		/* update tx power state */
 	ath_radar_update(sc);
-	ath_setdefantenna(sc, sc->sc_defant);
 	if (ath_startrecv(sc) != 0)	/* restart recv */
 		EPRINTF(sc, "Unable to start receive logic.\n");
 	if (sc->sc_softled)
@@ -5353,27 +5348,6 @@ ath_beacon_send(struct ath_softc *sc, in
 	} else if ((sc->sc_updateslot == COMMIT) && (sc->sc_slotupdate == slot))
 		ath_setslottime(sc);		/* commit change to hardware */
 
-	if ((!sc->sc_stagbeacons || slot == 0) && (!sc->sc_diversity)) {
-		unsigned int otherant;
-		/*
-		 * Check recent per-antenna transmit statistics and flip
-		 * the default rx antenna if noticeably more frames went out
-		 * on the non-default antenna.  Only do this if rx diversity
-		 * is off.
-		 * XXX assumes 2 antennae
-		 */
-		otherant = sc->sc_defant & 1 ? 2 : 1;
-		if (sc->sc_ant_tx[otherant] > sc->sc_ant_tx[sc->sc_defant] + 
-				ATH_ANTENNA_DIFF) {
-			DPRINTF(sc, ATH_DEBUG_BEACON,
-				"Flip default antenna to %u, %u > %u\n",
-				otherant, sc->sc_ant_tx[otherant],
-				sc->sc_ant_tx[sc->sc_defant]);
-			ath_setdefantenna(sc, otherant);
-		}
-		sc->sc_ant_tx[1] = sc->sc_ant_tx[2] = 0;
-	}
-
 	if (bfaddr != 0) {
 		/*
 		 * Stop any current DMA and put the new frame(s) on the queue.
@@ -6734,9 +6708,8 @@ ath_setdefantenna(struct ath_softc *sc,
 {
 	struct ath_hal *ah = sc->sc_ah;
 
-	/* XXX block beacon interrupts */
-	ath_hal_setdiversity(ah, (sc->sc_diversity != 0));
 	ath_hal_setdefantenna(ah, antenna);
+	ath_hal_setantennaswitch(ah, sc->sc_diversity ? 0 : antenna);
 	if (sc->sc_defant != antenna)
 		sc->sc_stats.ast_ant_defswitch++;
 	sc->sc_defant = antenna;
@@ -11160,7 +11133,7 @@ ATH_SYSCTL_DECL(ath_sysctl_halparam, ctl
 					break;
 				}
 				sc->sc_diversity = val;
-				ath_hal_setdiversity(ah, val);
+				ath_setdefantenna(sc, sc->sc_defant);
 				break;
 			case ATH_TXINTRPERIOD:
 				/* XXX: validate? */
--- a/ath/if_athvar.h
+++ b/ath/if_athvar.h
@@ -640,7 +640,6 @@ struct ath_softc {
 	spinlock_t sc_hal_lock;                 /* hardware access lock */
 	struct ath_ratectrl *sc_rc;		/* tx rate control support */
 	struct ath_tx99 *sc_tx99; 		/* tx99 support */
-	void (*sc_setdefantenna)(struct ath_softc *, u_int);
 	const struct ath_hw_detect *sc_hwinfo;
 
 	unsigned int 	sc_invalid:1;		/* being detached */
{ color: #cc0000; font-weight: bold; background-color: #fff0f0 } /* Comment.Special */ .highlight .gd { color: #000000; background-color: #ffdddd } /* Generic.Deleted */ .highlight .ge { font-style: italic } /* Generic.Emph */ .highlight .gr { color: #aa0000 } /* Generic.Error */ .highlight .gh { color: #333333 } /* Generic.Heading */ .highlight .gi { color: #000000; background-color: #ddffdd } /* Generic.Inserted */ .highlight .go { color: #888888 } /* Generic.Output */ .highlight .gp { color: #555555 } /* Generic.Prompt */ .highlight .gs { font-weight: bold } /* Generic.Strong */ .highlight .gu { color: #666666 } /* Generic.Subheading */ .highlight .gt { color: #aa0000 } /* Generic.Traceback */ .highlight .kc { color: #008800; font-weight: bold } /* Keyword.Constant */ .highlight .kd { color: #008800; font-weight: bold } /* Keyword.Declaration */ .highlight .kn { color: #008800; font-weight: bold } /* Keyword.Namespace */ .highlight .kp { color: #008800 } /* Keyword.Pseudo */ .highlight .kr { color: #008800; font-weight: bold } /* Keyword.Reserved */ .highlight .kt { color: #888888; font-weight: bold } /* Keyword.Type */ .highlight .m { color: #0000DD; font-weight: bold } /* Literal.Number */ .highlight .s { color: #dd2200; background-color: #fff0f0 } /* Literal.String */ .highlight .na { color: #336699 } /* Name.Attribute */ .highlight .nb { color: #003388 } /* Name.Builtin */ .highlight .nc { color: #bb0066; font-weight: bold } /* Name.Class */ .highlight .no { color: #003366; font-weight: bold } /* Name.Constant */ .highlight .nd { color: #555555 } /* Name.Decorator */ .highlight .ne { color: #bb0066; font-weight: bold } /* Name.Exception */ .highlight .nf { color: #0066bb; font-weight: bold } /* Name.Function */ .highlight .nl { color: #336699; font-style: italic } /* Name.Label */ .highlight .nn { color: #bb0066; font-weight: bold } /* Name.Namespace */ .highlight .py { color: #336699; font-weight: bold } /* Name.Property */ .highlight .nt { color: #bb0066; font-weight: bold } /* Name.Tag */ .highlight .nv { color: #336699 } /* Name.Variable */ .highlight .ow { color: #008800 } /* Operator.Word */ .highlight .w { color: #bbbbbb } /* Text.Whitespace */ .highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */ .highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */ .highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */ .highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */ .highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */ .highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
--- a/net80211/ieee80211_input.c
+++ b/net80211/ieee80211_input.c
@@ -294,10 +294,10 @@ ieee80211_input(struct ieee80211vap * va
 			break;
 		case IEEE80211_M_IBSS:
 		case IEEE80211_M_AHDEMO:
-			if (!IEEE80211_ADDR_EQ(wh->i_addr3, vap->iv_bssid) ||
+			if ((!IEEE80211_ADDR_EQ(wh->i_addr3, vap->iv_bssid) ||
 			    (!IEEE80211_ADDR_EQ(wh->i_addr1, vap->iv_myaddr) &&
-			     !IEEE80211_IS_MULTICAST(wh->i_addr1) &&
-			     (subtype != IEEE80211_FC0_SUBTYPE_BEACON))) {
+			     !IEEE80211_IS_MULTICAST(wh->i_addr1))) &&
+			     (type == IEEE80211_FC0_TYPE_DATA)) {
 				if (!(vap->iv_dev->flags & IFF_PROMISC)) {
 					IEEE80211_DISCARD_MAC(vap, IEEE80211_MSG_INPUT,
 						bssid, NULL, "%s", "not to bss");
@@ -322,22 +322,15 @@ ieee80211_input(struct ieee80211vap * va
 			}
 			/* Do not try to find a node reference if the packet really did come from the BSS */
 			if (type == IEEE80211_FC0_TYPE_DATA && ni == vap->iv_bss &&
-					!IEEE80211_ADDR_EQ(vap->iv_bss->ni_macaddr, wh->i_addr2) &&
 					IEEE80211_ADDR_EQ(vap->iv_bssid, wh->i_addr3)) {
 				/* Try to find sender in local node table. */
-				ni = ieee80211_find_node(&ic->ic_sta, wh->i_addr2);
+				if (!ni_or_null) {
+					ieee80211_unref_node(&ni);
+					ni = ieee80211_find_txnode(vap, wh->i_addr2);
+				}
 				if (ni == NULL) {
-					/*
-					 * Fake up a node for this newly discovered
-					 * member of the IBSS.  This should probably
-					 * done after an ACL check.
-					 */
-					ni = ieee80211_fakeup_adhoc_node(vap,
-							wh->i_addr2);
-					if (ni == NULL) {
-						/* NB: stat kept for alloc failure */
-						goto err;
-					}
+					/* NB: stat kept for alloc failure */
+					goto discard;
 				}
 			}
 			iwspy_event(vap, ni, rssi);
@@ -3553,8 +3546,8 @@ ieee80211_recv_mgmt(struct ieee80211vap
 				(((vap->iv_opmode == IEEE80211_M_HOSTAP) ||
 				 (vap->iv_opmode == IEEE80211_M_WDS)) &&
 				(scan.capinfo & IEEE80211_CAPINFO_ESS))) {
+			struct ieee80211_node *tni = NULL;
 			struct ieee80211vap *avp = NULL;
-			int do_unref = 0;
 			int found = 0;
 
 			IEEE80211_LOCK_IRQ(vap->iv_ic);
@@ -3570,14 +3563,12 @@ ieee80211_recv_mgmt(struct ieee80211vap
 					}
 				}
 				if (found)
-					ni = ni_or_null = avp->iv_wdsnode;
+					tni = ieee80211_ref_node(avp->iv_wdsnode);
 			} else if ((vap->iv_opmode == IEEE80211_M_WDS) && vap->iv_wdsnode) {
 				found = 1;
-				ni = ni_or_null = vap->iv_wdsnode;
-			} else if (vap->iv_opmode == IEEE80211_M_IBSS) {
-				ni_or_null = ieee80211_find_node(&ic->ic_sta, wh->i_addr2);
-				if (ni_or_null)
-					ni = ni_or_null;
+				tni = ieee80211_ref_node(vap->iv_wdsnode);
+			} else if ((vap->iv_opmode == IEEE80211_M_IBSS) && (vap->iv_state == IEEE80211_S_RUN)) {
+				tni = ieee80211_find_node(&ic->ic_sta, wh->i_addr2);
 				found = 1;
 			}
 			IEEE80211_UNLOCK_IRQ(vap->iv_ic);
@@ -3585,20 +3576,21 @@ ieee80211_recv_mgmt(struct ieee80211vap
 			if (!found)
 				break;
 
-			if (ni_or_null == NULL) {
+			memcpy(&SKB_CB(skb)->beacon_tsf, scan.tstamp, sizeof(u_int64_t));
+
+			if (tni == NULL) {
 				if (avp) {
 					IEEE80211_LOCK_IRQ(ic);
-					ni = ieee80211_add_neighbor(avp, wh, &scan);
+					tni = ieee80211_add_neighbor(avp, wh, &scan);
 					/* force assoc */
-					ni->ni_associd |= 0xc000;
-					avp->iv_wdsnode = ieee80211_ref_node(ni);
+					tni->ni_associd |= 0xc000;
+					avp->iv_wdsnode = ieee80211_ref_node(tni);
 					IEEE80211_UNLOCK_IRQ(ic);
 				} else if ((vap->iv_opmode == IEEE80211_M_IBSS) &&
 				           IEEE80211_ADDR_EQ(wh->i_addr3, vap->iv_bssid)) {
 					/* Create a new entry in the neighbor table. */
-					ni = ieee80211_add_neighbor(vap, wh, &scan);
+					tni = ieee80211_add_neighbor(vap, wh, &scan);
 				}
-				do_unref = 1;
 			} else {
 				/*
 				 * Copy data from beacon to neighbor table.
@@ -3606,39 +3598,38 @@ ieee80211_recv_mgmt(struct ieee80211vap
 				 * ieee80211_add_neighbor(), so we just copy
 				 * everything over to be safe.
 				 */
-				ni->ni_esslen = scan.ssid[1];
-				memcpy(ni->ni_essid, scan.ssid + 2, scan.ssid[1]);
-				IEEE80211_ADDR_COPY(ni->ni_bssid, wh->i_addr3);
-				memcpy(ni->ni_tstamp.data, scan.tstamp,
-					sizeof(ni->ni_tstamp));
-				ni->ni_inact = ni->ni_inact_reload;
-				ni->ni_intval = 
+				tni->ni_esslen = scan.ssid[1];
+				memcpy(tni->ni_essid, scan.ssid + 2, scan.ssid[1]);
+				IEEE80211_ADDR_COPY(tni->ni_bssid, wh->i_addr3);
+				memcpy(tni->ni_tstamp.data, scan.tstamp,
+					sizeof(tni->ni_tstamp));
+				tni->ni_inact = tni->ni_inact_reload;
+				tni->ni_intval =
 					IEEE80211_BINTVAL_SANITISE(scan.bintval);
-				ni->ni_capinfo = scan.capinfo;
-				ni->ni_chan = ic->ic_curchan;
-				ni->ni_fhdwell = scan.fhdwell;
-				ni->ni_fhindex = scan.fhindex;
-				ni->ni_erp = scan.erp;
-				ni->ni_timoff = scan.timoff;
+				tni->ni_capinfo = scan.capinfo;
+				tni->ni_chan = ic->ic_curchan;
+				tni->ni_fhdwell = scan.fhdwell;
+				tni->ni_fhindex = scan.fhindex;
+				tni->ni_erp = scan.erp;
+				tni->ni_timoff = scan.timoff;
 				if (scan.wme != NULL)
-					ieee80211_saveie(&ni->ni_wme_ie, scan.wme);
+					ieee80211_saveie(&tni->ni_wme_ie, scan.wme);
 				if (scan.wpa != NULL)
-					ieee80211_saveie(&ni->ni_wpa_ie, scan.wpa);
+					ieee80211_saveie(&tni->ni_wpa_ie, scan.wpa);
 				if (scan.rsn != NULL)
-					ieee80211_saveie(&ni->ni_rsn_ie, scan.rsn);
+					ieee80211_saveie(&tni->ni_rsn_ie, scan.rsn);
 				if (scan.ath != NULL)
-					ieee80211_saveath(ni, scan.ath);
+					ieee80211_saveath(tni, scan.ath);
 
 				/* NB: must be after ni_chan is setup */
-				ieee80211_setup_rates(ni, scan.rates,
+				ieee80211_setup_rates(tni, scan.rates,
 					scan.xrates, IEEE80211_F_DOSORT);
 			}
-			if (ni != NULL) {
-				ni->ni_rssi = rssi;
-				ni->ni_rtsf = rtsf;
-				ni->ni_last_rx = jiffies;
-				if (do_unref)
-					ieee80211_unref_node(&ni);
+			if (tni != NULL) {
+				tni->ni_rssi = rssi;
+				tni->ni_rtsf = rtsf;
+				tni->ni_last_rx = jiffies;
+				ieee80211_unref_node(&tni);
 			}
 		}
 		break;
--- a/net80211/ieee80211_node.c
+++ b/net80211/ieee80211_node.c
@@ -53,6 +53,7 @@
 
 #include <net80211/ieee80211_var.h>
 #include <net80211/if_athproto.h>
+#include <net80211/ieee80211_node.h>
 
 /*
  * Association IDs are managed with a bit vector.
@@ -317,16 +318,11 @@ ieee80211_create_ibss(struct ieee80211va
 	/* Check to see if we already have a node for this mac
 	 * NB: we gain a node reference here
 	 */
-	ni = ieee80211_find_txnode(vap, vap->iv_myaddr);
+	ieee80211_node_table_reset(&ic->ic_sta, vap);
+	ni = ieee80211_alloc_node_table(vap, vap->iv_myaddr);
 	if (ni == NULL) {
-		ni = ieee80211_alloc_node_table(vap, vap->iv_myaddr);
-		IEEE80211_DPRINTF(vap, IEEE80211_MSG_ASSOC,
-				  "%s: ni:%p allocated for " MAC_FMT "\n",
-				  __func__, ni, MAC_ADDR(vap->iv_myaddr));
-		if (ni == NULL) {
-			/* XXX recovery? */
-			return;
-		}
+		/* XXX recovery? */
+		return;
 	}
 
 	IEEE80211_ADDR_COPY(ni->ni_bssid, vap->iv_myaddr);
@@ -647,7 +643,7 @@ ieee80211_sta_join1(struct ieee80211_nod
 		(vap->iv_state == IEEE80211_S_RUN) && bssid_equal(obss, selbs)); */
 	vap->iv_bss = selbs;
 	IEEE80211_ADDR_COPY(vap->iv_bssid, selbs->ni_bssid);
-	if (obss != NULL) {
+	if ((obss != NULL) && (obss != selbs)) {
 		if (obss->ni_table)
 			ieee80211_node_leave(obss);
 		ieee80211_unref_node(&obss);
--- a/ath/if_ath.c
+++ b/ath/if_ath.c
@@ -6625,14 +6625,6 @@ ath_recv_mgmt(struct ieee80211vap * vap,
 
 	sc->sc_recv_mgmt(vap, ni_or_null, skb, subtype, rssi, rtsf);
 
-	/* Lookup the new node if any (this grabs a reference to it) */
-	ni = ieee80211_find_rxnode(vap->iv_ic, vap,
-	         (const struct ieee80211_frame_min *)skb->data);
-	if (ni == NULL) {
-		DPRINTF(sc, ATH_DEBUG_BEACON, "Dropping; node unknown.\n");
-		return;
-	}
-
 	switch (subtype) {
 	case IEEE80211_FC0_SUBTYPE_BEACON:
 		/* update RSSI statistics for use by the HAL */
@@ -6654,11 +6646,9 @@ ath_recv_mgmt(struct ieee80211vap * vap,
 			 * we do the IBSS merging in software. Also do not merge
 			 * if the difference it too small. Otherwise we are playing
 			 * tsf-pingpong with other vendors drivers */
-			beacon_tsf = le64_to_cpu(ni->ni_tstamp.tsf);
-			if (beacon_tsf > rtsf + 0xffff) {
+			beacon_tsf = le64_to_cpu(SKB_CB(skb)->beacon_tsf);
+			if (beacon_tsf > rtsf + 0xffff)
 				ath_hal_settsf64(sc->sc_ah, beacon_tsf - rtsf);
-				ieee80211_ibss_merge(ni);
-			}
 			break;
 		}
 		/* NB: Fall Through */
@@ -6680,13 +6670,21 @@ ath_recv_mgmt(struct ieee80211vap * vap,
 			hw_tsf = ath_hal_gettsf64(sc->sc_ah);
 			hw_tu  = hw_tsf >> 10;
 
-			beacon_tsf = le64_to_cpu(ni->ni_tstamp.tsf);
+			beacon_tsf = le64_to_cpu(SKB_CB(skb)->beacon_tsf);
 			beacon_tu  = beacon_tsf >> 10;
 
+			if (!beacon_tsf)
+				break;
+
+			if (IEEE80211_ADDR_EQ(wh->i_addr3, vap->iv_bssid))
+				break;
+
 			DPRINTF(sc, ATH_DEBUG_BEACON,
-					"Beacon transmitted at %10llx, "
+					"Beacon transmitted from "MAC_FMT" ("MAC_FMT") at %10llx, "
 					"received at %10llx(%lld), hw TSF "
 					"%10llx(%lld)\n",
+					MAC_ADDR(wh->i_addr3),
+					MAC_ADDR(vap->iv_bssid),
 					beacon_tsf,
 					rtsf, rtsf - beacon_tsf,
 					hw_tsf, hw_tsf - beacon_tsf);
@@ -6699,39 +6697,13 @@ ath_recv_mgmt(struct ieee80211vap * vap,
 				do_merge = 1;
 			}
 
-			/* Check sc_nexttbtt */
-			if (sc->sc_nexttbtt < hw_tu) {
-				DPRINTF(sc, ATH_DEBUG_BEACON,
-					"sc_nexttbtt (%8x TU) is in the past "
-					"(tsf %8x TU), updating timers\n",
-					sc->sc_nexttbtt, hw_tu);
-				do_merge = 1;
-			}
-
-			intval = ni->ni_intval & HAL_BEACON_PERIOD;
-#if 0
-			/* This code is disabled since it would produce
-			 * unwanted merge. For instance, in a two nodes network
-			 * A & B, A can merge to B and at the same time, B will
-			 * merge to A, still having a split */
-			if (intval != 0) {
-				if ((sc->sc_nexttbtt % intval) !=
-						(beacon_tu % intval)) {
-					DPRINTF(sc, ATH_DEBUG_BEACON,
-							"ibss merge: "
-							"sc_nexttbtt %10x TU "
-							"(%3d) beacon %10x TU "
-							"(%3d)\n",
-							sc->sc_nexttbtt,
-							sc->sc_nexttbtt % intval,
-							beacon_tu,
-							beacon_tu % intval);
-					do_merge = 1;
-				}
-			}
-#endif
-			if (do_merge)
+			if (do_merge) {
+				/* Lookup the new node if any (this grabs a reference to it) */
+				ni = ieee80211_find_txnode(vap, wh->i_addr2);
+				memcpy(ni->ni_bssid, wh->i_addr3, IEEE80211_ADDR_LEN);
 				ieee80211_ibss_merge(ni);
+				ieee80211_unref_node(&ni);
+			}
 
 			if ((sc->sc_opmode == HAL_M_IBSS) &&
 					ath_hw_check_atim(sc, 1, vap->iv_bss->ni_intval))
@@ -6739,8 +6711,6 @@ ath_recv_mgmt(struct ieee80211vap * vap,
 		}
 		break;
 	}
-
-	ieee80211_unref_node(&ni);
 }
 
 static void
--- a/net80211/ieee80211_linux.h
+++ b/net80211/ieee80211_linux.h
@@ -411,7 +411,7 @@ typedef spinlock_t acl_lock_t;
  *     8 bytes so we reserve/avoid it.
  */
 	struct ieee80211_cb {
-	u_int8_t vlan[8];			/* reserve for vlan tag info */
+	u_int64_t beacon_tsf;
 	struct ieee80211_node *ni;
 	u_int32_t flags;
 #define	M_LINK0		0x01			/* frame needs WEP encryption */
--- a/net80211/ieee80211_scan_sta.c
+++ b/net80211/ieee80211_scan_sta.c
@@ -1125,11 +1125,8 @@ adhoc_default_action(struct ieee80211vap
 	u_int8_t zeroMacAddr[IEEE80211_ADDR_LEN];
 
 	memset(&zeroMacAddr, 0, IEEE80211_ADDR_LEN);
-	if (IEEE80211_ADDR_EQ(se->se_bssid, &zeroMacAddr[0])) {
-		ieee80211_create_ibss(vap, se->se_chan);
-		return 1;
-	} else
-		return ieee80211_sta_join(vap, se);
+	ieee80211_create_ibss(vap, se->se_chan);
+	return 1;
 }
 
 static const struct ieee80211_scanner adhoc_default = {