summaryrefslogtreecommitdiffstats
path: root/sys/net80211/ieee80211_tdma.c
diff options
context:
space:
mode:
authorsam <sam@FreeBSD.org>2009-02-10 23:52:28 +0000
committersam <sam@FreeBSD.org>2009-02-10 23:52:28 +0000
commit29a739cb60ccf8c2457c837b6cfb6df866a25bfe (patch)
tree7ed8d7ba4b0c89d1211268d7e80f605fb9151a9c /sys/net80211/ieee80211_tdma.c
parent78cd28584afadc83e4e9628681ed6a423a265706 (diff)
downloadFreeBSD-src-29a739cb60ccf8c2457c837b6cfb6df866a25bfe.zip
FreeBSD-src-29a739cb60ccf8c2457c837b6cfb6df866a25bfe.tar.gz
when operating as a slave, clear neighbor entries and the peer bss node
on beacon miss while here, remove a stray pointless write of iv_bmiss_count
Diffstat (limited to 'sys/net80211/ieee80211_tdma.c')
-rw-r--r--sys/net80211/ieee80211_tdma.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/sys/net80211/ieee80211_tdma.c b/sys/net80211/ieee80211_tdma.c
index d41e039..33afc79 100644
--- a/sys/net80211/ieee80211_tdma.c
+++ b/sys/net80211/ieee80211_tdma.c
@@ -173,6 +173,15 @@ tdma_vdetach(struct ieee80211vap *vap)
setackpolicy(vap->iv_ic, 0); /* enable ACK's */
}
+static void
+sta_leave(void *arg, struct ieee80211_node *ni)
+{
+ struct ieee80211vap *vap = arg;
+
+ if (ni->ni_vap == vap && ni != vap->iv_bss)
+ ieee80211_node_leave(ni);
+}
+
/*
* TDMA state machine handler.
*/
@@ -180,10 +189,11 @@ static int
tdma_newstate(struct ieee80211vap *vap, enum ieee80211_state nstate, int arg)
{
struct ieee80211_tdma_state *ts = vap->iv_tdma;
+ struct ieee80211com *ic = vap->iv_ic;
enum ieee80211_state ostate;
int status;
- IEEE80211_LOCK_ASSERT(vap->iv_ic);
+ IEEE80211_LOCK_ASSERT(ic);
ostate = vap->iv_state;
IEEE80211_DPRINTF(vap, IEEE80211_MSG_STATE, "%s: %s -> %s (%d)\n",
@@ -201,6 +211,11 @@ tdma_newstate(struct ieee80211vap *vap, enum ieee80211_state nstate, int arg)
*/
vap->iv_state = nstate; /* state transition */
ieee80211_cancel_scan(vap); /* background scan */
+ if (ostate == IEEE80211_S_RUN) {
+ /* purge station table; entries are stale */
+ ieee80211_iterate_nodes(&ic->ic_sta, sta_leave, vap);
+ ieee80211_free_node(vap->iv_bss); /* XXX */
+ }
if (vap->iv_flags_ext & IEEE80211_FEXT_SCANREQ) {
ieee80211_check_scan(vap,
vap->iv_scanreq_flags,
@@ -326,7 +341,6 @@ tdma_recv_mgmt(struct ieee80211_node *ni, struct mbuf *m0,
* Count beacon frame for s/w bmiss handling.
*/
vap->iv_swbmiss_count++;
- vap->iv_bmiss_count = 0;
/*
* Process tdma ie. The contents are used to sync
* the slot timing, reconfigure the bss, etc.
OpenPOWER on IntegriCloud