|
@@ -4707,6 +4707,42 @@ out:
|
|
|
}
|
|
|
EXPORT_SYMBOL(il_mac_change_interface);
|
|
|
|
|
|
+void
|
|
|
+il_mac_flush(struct ieee80211_hw *hw, bool drop)
|
|
|
+{
|
|
|
+ struct il_priv *il = hw->priv;
|
|
|
+ unsigned long timeout = jiffies + msecs_to_jiffies(500);
|
|
|
+ int i;
|
|
|
+
|
|
|
+ mutex_lock(&il->mutex);
|
|
|
+ D_MAC80211("enter\n");
|
|
|
+
|
|
|
+ if (il->txq == NULL)
|
|
|
+ goto out;
|
|
|
+
|
|
|
+ for (i = 0; i < il->hw_params.max_txq_num; i++) {
|
|
|
+ struct il_queue *q;
|
|
|
+
|
|
|
+ if (i == il->cmd_queue)
|
|
|
+ continue;
|
|
|
+
|
|
|
+ q = &il->txq[i].q;
|
|
|
+ if (q->read_ptr == q->write_ptr)
|
|
|
+ continue;
|
|
|
+
|
|
|
+ if (time_after(jiffies, timeout)) {
|
|
|
+ IL_ERR("Failed to flush queue %d\n", q->id);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+
|
|
|
+ msleep(20);
|
|
|
+ }
|
|
|
+out:
|
|
|
+ D_MAC80211("leave\n");
|
|
|
+ mutex_unlock(&il->mutex);
|
|
|
+}
|
|
|
+EXPORT_SYMBOL(il_mac_flush);
|
|
|
+
|
|
|
/*
|
|
|
* On every watchdog tick we check (latest) time stamp. If it does not
|
|
|
* change during timeout period and queue is not empty we reset firmware.
|