Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src-draft/trunk]: src/sys/dev/usb Use ieee80211_tx_complete() to free mbuf/n...
details: https://anonhg.NetBSD.org/src-all/rev/64cc86636033
branches: trunk
changeset: 986206:64cc86636033
user: Martin Husemann <martin%NetBSD.org@localhost>
date: Thu Feb 11 18:22:40 2021 +0100
description:
Use ieee80211_tx_complete() to free mbuf/node info.
Freeing them manually may bypass "tx complete" callbacks and break
timeout handling.
diffstat:
sys/dev/usb/if_urtwn.c | 11 +++++++++--
sys/dev/usb/if_urtwnvar.h | 2 ++
2 files changed, 11 insertions(+), 2 deletions(-)
diffs (54 lines):
diff -r 650e7f23f152 -r 64cc86636033 sys/dev/usb/if_urtwn.c
--- a/sys/dev/usb/if_urtwn.c Thu Feb 11 18:20:29 2021 +0100
+++ b/sys/dev/usb/if_urtwn.c Thu Feb 11 18:22:40 2021 +0100
@@ -849,6 +849,8 @@
data->sc = sc; /* Backpointer for callbacks. */
data->pidx = j;
+ data->m = NULL;
+ data->ni = NULL;
error = usbd_create_xfer(sc->tx_pipe[j],
URTWN_TXBUFSZ, USBD_FORCE_SHORT_XFER, 0,
@@ -2996,6 +2998,11 @@
DPRINTFN(DBG_FN|DBG_TX, ("%s: %s: status=%d\n",
device_xname(sc->sc_dev), __func__, status));
+ if (data->m) {
+ ieee80211_tx_complete(data->ni, data->m, 0);
+ data->m = NULL;
+ data->ni = NULL;
+ }
urtwn_put_tx_data(sc, data);
s = splnet();
@@ -3215,6 +3222,8 @@
xferlen = txd_len + m->m_pkthdr.len + padsize;
m_copydata(m, 0, m->m_pkthdr.len, (char *)&txd[0] + txd_len + padsize);
+ data->m = m;
+ data->ni = ni;
if (data->xfer == NULL) {
/* NNN Don't crash ... but what is going on! */
@@ -3320,8 +3329,6 @@
urtwn_put_tx_data(sc, data);
continue;
}
- m_freem(m);
- ieee80211_free_node(ni);
sc->tx_timer = 5;
callout_schedule(&sc->sc_watchdog_to, hz);
}
diff -r 650e7f23f152 -r 64cc86636033 sys/dev/usb/if_urtwnvar.h
--- a/sys/dev/usb/if_urtwnvar.h Thu Feb 11 18:20:29 2021 +0100
+++ b/sys/dev/usb/if_urtwnvar.h Thu Feb 11 18:22:40 2021 +0100
@@ -80,6 +80,8 @@
size_t pidx;
struct usbd_xfer *xfer;
uint8_t *buf;
+ struct mbuf *m;
+ struct ieee80211_node *ni;
TAILQ_ENTRY(urtwn_tx_data) next;
};
Home |
Main Index |
Thread Index |
Old Index