[Madwifi-cvs] madwifi/ath if_ath.c,1.42,1.43
Status: Beta
Brought to you by:
otaku
From: Bruno R. <br...@us...> - 2005-07-12 09:38:47
|
Update of /cvsroot/madwifi/madwifi/ath In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20970/ath Modified Files: if_ath.c Log Message: - better solution to the last fix (beacon miss): keep it all in the ath (driver) part Index: if_ath.c =================================================================== RCS file: /cvsroot/madwifi/madwifi/ath/if_ath.c,v retrieving revision 1.42 retrieving revision 1.43 diff -C2 -d -r1.42 -r1.43 *** if_ath.c 11 Jul 2005 20:02:19 -0000 1.42 --- if_ath.c 12 Jul 2005 09:38:38 -0000 1.43 *************** *** 997,1015 **** struct ieee80211com *ic = &sc->sc_ic; - DPRINTF(sc, ATH_DEBUG_ANY, "%s\n", __func__); KASSERT(ic->ic_opmode == IEEE80211_M_STA, ("unexpected operating mode %u", ic->ic_opmode)); if (ic->ic_state == IEEE80211_S_RUN) { ! if ((ic->ic_bss->ni_flags & IEEE80211_NODE_BMISS) == 0) { ! /* first time: flag the node and send probe request */ ! DPRINTF(sc, ATH_DEBUG_BEACON, ! "%s: beacons missed - flag and send probe request\n", ! __func__); ! ic->ic_bss->ni_flags |= IEEE80211_NODE_BMISS; ! IEEE80211_SEND_MGMT(ic, ic->ic_bss, ! IEEE80211_FC0_SUBTYPE_PROBE_REQ, 0); ! } ! else { ! /* second time in a row, try to reassoc */ DPRINTF(sc, ATH_DEBUG_BEACON, "%s: beacons missed again - reassoc\n", __func__); --- 997,1009 ---- struct ieee80211com *ic = &sc->sc_ic; KASSERT(ic->ic_opmode == IEEE80211_M_STA, ("unexpected operating mode %u", ic->ic_opmode)); + if (ic->ic_state == IEEE80211_S_RUN) { ! if (sc->sc_bmisscount >= 1) { ! /* ! * we have already missed beacons before and did not receive ! * a probe response or beacon in the mean time ! */ DPRINTF(sc, ATH_DEBUG_BEACON, "%s: beacons missed again - reassoc\n", __func__); *************** *** 1022,1025 **** --- 1016,1028 ---- ieee80211_new_state(ic, IEEE80211_S_ASSOC, -1); } + else { + /* first time: increment bmisscount and send probe request */ + DPRINTF(sc, ATH_DEBUG_BEACON, + "%s: beacons missed - send probe request\n", + __func__); + sc->sc_bmisscount++; + IEEE80211_SEND_MGMT(ic, ic->ic_bss, + IEEE80211_FC0_SUBTYPE_PROBE_REQ, 0); + } } } *************** *** 2888,2891 **** --- 2891,2895 ---- ath_hal_beacontimers(ah, &bs); sc->sc_imask |= HAL_INT_BMISS; + sc->sc_bmisscount = 0; ath_hal_intrset(ah, sc->sc_imask); } else { /* IBSS or HOSTAP */ *************** *** 3587,3590 **** --- 3591,3609 ---- } } + if (ic->ic_opmode == IEEE80211_M_STA && + ic->ic_state == IEEE80211_S_RUN && + sc->sc_bmisscount > 0) { + struct ieee80211_frame *wh; + wh = (struct ieee80211_frame *) skb->data; + if (IEEE80211_ADDR_EQ(wh->i_addr2, ic->ic_bss->ni_bssid)) { + DPRINTF(sc, ATH_DEBUG_BEACON, + "[%s] received %s after beacon miss - clear\n", + ether_sprintf(wh->i_addr2), + (subtype == IEEE80211_FC0_SUBTYPE_BEACON) ? + "beacon" : "probe response"); + sc->sc_bmisscount = 0; + ic->ic_mgt_timer = 0; + } + } break; } |