svn commit: r330213 - stable/11/sys/dev/iwm
Eitan Adler
eadler at FreeBSD.org
Thu Mar 1 06:44:33 UTC 2018
Author: eadler
Date: Thu Mar 1 06:44:32 2018
New Revision: 330213
URL: https://svnweb.freebsd.org/changeset/base/330213
Log:
MFC r318229:
[iwm] Adjust if_iwm_sta.h prototypes, don't pass iwm_node to rm_sta().
* Since a RUN -> INIT/SCAN transition seems to immediately destroy the
ieee80211_node for the AP, we can't read the in_assoc value from there.
Instead just directly pass that information via a boolean_t argument.
* Adds iwm_mvm_rm_sta_id() function, which just unconditionally removes
the station from the firmware.
* The iwm_mvm_rm_sta() function shouldn't actually remove the station from
firmware when we are still associated (i.e. during a RUN -> INIT/SCAN
transition).
* So when disassociating we will first call iwm_mvm_rm_sta() to drain the
queues/fifos. Later during disassociation we will then use
iwm_mvm_rm_sta_id() to actually remove the station.
Inspired-By: Linux iwlwifi
Modified:
stable/11/sys/dev/iwm/if_iwm.c
stable/11/sys/dev/iwm/if_iwm_sta.c
stable/11/sys/dev/iwm/if_iwm_sta.h
Directory Properties:
stable/11/ (props changed)
Modified: stable/11/sys/dev/iwm/if_iwm.c
==============================================================================
--- stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 06:42:47 2018 (r330212)
+++ stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 06:44:32 2018 (r330213)
@@ -4413,8 +4413,7 @@ iwm_newstate(struct ieee80211vap *vap, enum ieee80211_
myerr = ivp->iv_newstate(vap, nstate, arg);
IEEE80211_UNLOCK(ic);
IWM_LOCK(sc);
- in = IWM_NODE(vap->iv_bss);
- error = iwm_mvm_rm_sta(sc, vap, in);
+ error = iwm_mvm_rm_sta(sc, vap, FALSE);
if (error) {
device_printf(sc->sc_dev,
"%s: Failed to remove station: %d\n",
Modified: stable/11/sys/dev/iwm/if_iwm_sta.c
==============================================================================
--- stable/11/sys/dev/iwm/if_iwm_sta.c Thu Mar 1 06:42:47 2018 (r330212)
+++ stable/11/sys/dev/iwm/if_iwm_sta.c Thu Mar 1 06:44:32 2018 (r330213)
@@ -213,10 +213,9 @@ iwm_mvm_update_sta(struct iwm_softc *sc, struct iwm_no
}
int
-iwm_mvm_drain_sta(struct iwm_softc *sc, struct iwm_node *in, boolean_t drain)
+iwm_mvm_drain_sta(struct iwm_softc *sc, struct iwm_vap *ivp, boolean_t drain)
{
struct iwm_mvm_add_sta_cmd cmd = {};
- struct iwm_vap *ivp = IWM_VAP(in->in_ni.ni_vap);
int ret;
uint32_t status;
@@ -275,13 +274,13 @@ iwm_mvm_rm_sta_common(struct iwm_softc *sc)
int
iwm_mvm_rm_sta(struct iwm_softc *sc, struct ieee80211vap *vap,
- struct iwm_node *in)
+ boolean_t is_assoc)
{
uint32_t tfd_queue_msk = 0;
int ret;
int ac;
- ret = iwm_mvm_drain_sta(sc, in, TRUE);
+ ret = iwm_mvm_drain_sta(sc, IWM_VAP(vap), TRUE);
if (ret)
return ret;
mbufq_drain(&sc->sc_snd); /* XXX needed ? */
@@ -297,18 +296,25 @@ iwm_mvm_rm_sta(struct iwm_softc *sc, struct ieee80211v
if (ret)
return ret;
#endif
- ret = iwm_mvm_drain_sta(sc, in, FALSE);
+ ret = iwm_mvm_drain_sta(sc, IWM_VAP(vap), FALSE);
-#if 0
/* if we are associated - we can't remove the AP STA now */
- if (sta->assoc)
+ if (is_assoc)
return ret;
-#endif
+
/* XXX wait until STA is drained */
ret = iwm_mvm_rm_sta_common(sc);
return ret;
+}
+
+int
+iwm_mvm_rm_sta_id(struct iwm_softc *sc, struct ieee80211vap *vap)
+{
+ /* XXX wait until STA is drained */
+
+ return iwm_mvm_rm_sta_common(sc);
}
static int
Modified: stable/11/sys/dev/iwm/if_iwm_sta.h
==============================================================================
--- stable/11/sys/dev/iwm/if_iwm_sta.h Thu Mar 1 06:42:47 2018 (r330212)
+++ stable/11/sys/dev/iwm/if_iwm_sta.h Thu Mar 1 06:44:32 2018 (r330213)
@@ -211,12 +211,13 @@ extern int iwm_mvm_sta_send_to_fw(struct iwm_softc *sc
extern int iwm_mvm_add_sta(struct iwm_softc *sc, struct iwm_node *in);
extern int iwm_mvm_update_sta(struct iwm_softc *sc, struct iwm_node *in);
extern int iwm_mvm_rm_sta(struct iwm_softc *sc, struct ieee80211vap *vap,
- struct iwm_node *in);
+ boolean_t is_assoc);
+extern int iwm_mvm_rm_sta_id(struct iwm_softc *sc, struct ieee80211vap *vap);
extern int iwm_mvm_add_aux_sta(struct iwm_softc *sc);
extern void iwm_mvm_del_aux_sta(struct iwm_softc *sc);
-extern int iwm_mvm_drain_sta(struct iwm_softc *sc, struct iwm_node *in,
+extern int iwm_mvm_drain_sta(struct iwm_softc *sc, struct iwm_vap *ivp,
boolean_t drain);
#endif /* __IF_IWM_STA_H__ */
More information about the svn-src-all
mailing list