-/* $OpenBSD: qwx.c,v 1.29 2024/02/09 09:53:50 stsp Exp $ */
+/* $OpenBSD: qwx.c,v 1.30 2024/02/09 09:55:17 stsp Exp $ */
/*
* Copyright 2023 Stefan Sperling <stsp@openbsd.org>
int qwx_mac_start(struct qwx_softc *);
void qwx_mac_scan_finish(struct qwx_softc *);
int qwx_mac_mgmt_tx_wmi(struct qwx_softc *, struct qwx_vif *, uint8_t,
- struct mbuf *);
+ struct ieee80211_node *, struct mbuf *);
int qwx_dp_tx(struct qwx_softc *, struct qwx_vif *, uint8_t,
struct ieee80211_node *, struct mbuf *);
int qwx_dp_tx_send_reo_cmd(struct qwx_softc *, struct dp_rx_tid *,
#endif
if (frame_type == IEEE80211_FC0_TYPE_MGT)
- return qwx_mac_mgmt_tx_wmi(sc, arvif, pdev_id, m);
+ return qwx_mac_mgmt_tx_wmi(sc, arvif, pdev_id, ni, m);
return qwx_dp_tx(sc, arvif, pdev_id, ni, m);
}
m_freem(tx_data->m);
tx_data->m = NULL;
+ ieee80211_release_node(ic, tx_data->ni);
+ tx_data->ni = NULL;
+
if (arvif->txmgmt.queued > 0)
arvif->txmgmt.queued--;
qwx_dp_tx_complete_msdu(struct qwx_softc *sc, struct dp_tx_ring *tx_ring,
uint32_t msdu_id, struct hal_tx_status *ts)
{
+ struct ieee80211com *ic = &sc->sc_ic;
struct qwx_tx_data *tx_data = &tx_ring->data[msdu_id];
if (ts->buf_rel_source != HAL_WBM_REL_SRC_MODULE_TQM) {
tx_data->m = NULL;
/* TODO: Tx rate adjustment? */
+
+ ieee80211_release_node(ic, tx_data->ni);
+ tx_data->ni = NULL;
if (tx_ring->queued > 0)
tx_ring->queued--;
}
tx_data->m = m;
+ tx_data->ni = ni;
qwx_hal_tx_cmd_desc_setup(sc,
hal_tcl_desc + sizeof(struct hal_tlv_hdr), &ti);
int
qwx_mac_mgmt_tx_wmi(struct qwx_softc *sc, struct qwx_vif *arvif,
- uint8_t pdev_id, struct mbuf *m)
+ uint8_t pdev_id, struct ieee80211_node *ni, struct mbuf *m)
{
struct qwx_txmgmt_queue *txmgmt = &arvif->txmgmt;
struct qwx_tx_data *tx_data;
sc->sc_dev.dv_xname, ret);
goto err_unmap_buf;
}
+ tx_data->ni = ni;
txmgmt->cur = (txmgmt->cur + 1) % nitems(txmgmt->data);
txmgmt->queued++;