-/* $OpenBSD: if_iwm.c,v 1.332 2021/06/30 09:44:56 stsp Exp $ */
+/* $OpenBSD: if_iwm.c,v 1.333 2021/06/30 09:45:47 stsp Exp $ */
/*
* Copyright (c) 2014, 2016 genua gmbh <info@genua.de>
iwm_flush_tx_path(struct iwm_softc *sc, int tfd_queue_msk)
{
struct iwm_tx_path_flush_cmd flush_cmd = {
- .queues_ctl = htole32(tfd_queue_msk),
- .flush_ctl = htole16(IWM_DUMP_TX_FIFO_FLUSH),
+ .sta_id = htole32(IWM_STATION_ID),
+ .tid_mask = htole16(0xffff),
};
int err;
goto done;
}
+ /*
+ * Flushing Tx rings may fail if the AP has disappeared.
+ * We can rely on iwm_newstate_task() to reset everything and begin
+ * scanning again if we are left with outstanding frames on queues.
+ */
err = iwm_wait_tx_queues_empty(sc);
- if (err) {
- printf("%s: Could not empty Tx queues (error %d)\n",
- DEVNAME(sc), err);
-#if 1
- iwm_dump_driver_status(sc);
-#endif
+ if (err)
goto done;
- }
err = iwm_drain_sta(sc, in, 0);
done:
-/* $OpenBSD: if_iwmreg.h,v 1.52 2021/06/01 18:03:56 stsp Exp $ */
+/* $OpenBSD: if_iwmreg.h,v 1.53 2021/06/30 09:45:47 stsp Exp $ */
/******************************************************************************
*
* @flush_ctl: control flags
* @reserved: reserved
*/
-struct iwm_tx_path_flush_cmd {
+struct iwm_tx_path_flush_cmd_v1 {
uint32_t queues_ctl;
uint16_t flush_ctl;
uint16_t reserved;
} __packed; /* IWM_TX_PATH_FLUSH_CMD_API_S_VER_1 */
+/**
+ * struct iwl_tx_path_flush_cmd -- queue/FIFO flush command
+ * @sta_id: station ID to flush
+ * @tid_mask: TID mask to flush
+ * @reserved: reserved
+ */
+struct iwm_tx_path_flush_cmd {
+ uint32_t sta_id;
+ uint16_t tid_mask;
+ uint16_t reserved;
+} __packed; /* TX_PATH_FLUSH_CMD_API_S_VER_2 */
+
/**
* iwm_get_scd_ssn - returns the SSN of the SCD
* @tx_resp: the Tx response from the fw (agg or non-agg)