Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F162382094
D7943.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D7943.diff
View Options
Index: head/sys/dev/iwm/if_iwm.c
===================================================================
--- head/sys/dev/iwm/if_iwm.c
+++ head/sys/dev/iwm/if_iwm.c
@@ -329,6 +329,8 @@
struct ieee80211_node *, int);
static int iwm_raw_xmit(struct ieee80211_node *, struct mbuf *,
const struct ieee80211_bpf_params *);
+static int iwm_mvm_flush_tx_path(struct iwm_softc *sc,
+ uint32_t tfd_msk, uint32_t flags);
static int iwm_mvm_send_add_sta_cmd_status(struct iwm_softc *,
struct iwm_mvm_add_sta_cmd_v7 *,
int *);
@@ -3517,7 +3519,6 @@
* mvm/tx.c
*/
-#if 0
/*
* Note that there are transports that buffer frames before they reach
* the firmware. This means that after flush_tx_path is called, the
@@ -3527,23 +3528,21 @@
* 3) wait for the transport queues to be empty
*/
int
-iwm_mvm_flush_tx_path(struct iwm_softc *sc, int tfd_msk, int sync)
+iwm_mvm_flush_tx_path(struct iwm_softc *sc, uint32_t tfd_msk, uint32_t flags)
{
+ int ret;
struct iwm_tx_path_flush_cmd flush_cmd = {
.queues_ctl = htole32(tfd_msk),
.flush_ctl = htole16(IWM_DUMP_TX_FIFO_FLUSH),
};
- int ret;
- ret = iwm_mvm_send_cmd_pdu(sc, IWM_TXPATH_FLUSH,
- sync ? IWM_CMD_SYNC : IWM_CMD_ASYNC,
+ ret = iwm_mvm_send_cmd_pdu(sc, IWM_TXPATH_FLUSH, flags,
sizeof(flush_cmd), &flush_cmd);
if (ret)
device_printf(sc->sc_dev,
"Flushing tx queue failed: %d\n", ret);
return ret;
}
-#endif
/*
* BEGIN mvm/sta.c
@@ -3899,6 +3898,8 @@
static int
iwm_release(struct iwm_softc *sc, struct iwm_node *in)
{
+ uint32_t tfd_msk;
+
/*
* Ok, so *technically* the proper set of calls for going
* from RUN back to SCAN is:
@@ -3918,7 +3919,18 @@
* back to nothing anyway, we'll just do a complete device reset.
* Up your's, device!
*/
- /* iwm_mvm_flush_tx_path(sc, 0xf, 1); */
+ /*
+ * Just using 0xf for the queues mask is fine as long as we only
+ * get here from RUN state.
+ */
+ tfd_msk = 0xf;
+ mbufq_drain(&sc->sc_snd);
+ iwm_mvm_flush_tx_path(sc, tfd_msk, IWM_CMD_SYNC);
+ /*
+ * We seem to get away with just synchronously sending the
+ * IWM_TXPATH_FLUSH command.
+ */
+// iwm_trans_wait_tx_queue_empty(sc, tfd_msk);
iwm_stop_device(sc);
iwm_init_hw(sc);
if (in)
@@ -4125,7 +4137,17 @@
if (((in = IWM_NODE(vap->iv_bss)) != NULL))
in->in_assoc = 0;
- iwm_release(sc, NULL);
+ if (nstate == IEEE80211_S_INIT) {
+ IWM_UNLOCK(sc);
+ IEEE80211_LOCK(ic);
+ error = ivp->iv_newstate(vap, nstate, arg);
+ IEEE80211_UNLOCK(ic);
+ IWM_LOCK(sc);
+ iwm_release(sc, NULL);
+ IWM_UNLOCK(sc);
+ IEEE80211_LOCK(ic);
+ return error;
+ }
/*
* It's impossible to directly go RUN->SCAN. If we iwm_release()
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Jul 13, 5:11 PM (8 h, 28 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
35039164
Default Alt Text
D7943.diff (2 KB)
Attached To
Mode
D7943: [iwm] Improve reliability of iwm_release on disassociation a bit.
Attached
Detach File
Event Timeline
Log In to Comment