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() for error case...



details:   https://anonhg.NetBSD.org/src-all/rev/43e4d0450615
branches:  trunk
changeset: 371048:43e4d0450615
user:      Martin Husemann <martin%NetBSD.org@localhost>
date:      Sat Feb 13 18:39:41 2021 +0100

description:
Use ieee80211_tx_complete() for error cases too.

diffstat:

 sys/dev/usb/if_urtwn.c |  12 +++++-------
 1 files changed, 5 insertions(+), 7 deletions(-)

diffs (52 lines):

diff -r 002639a79c5f -r 43e4d0450615 sys/dev/usb/if_urtwn.c
--- a/sys/dev/usb/if_urtwn.c    Fri Feb 12 20:13:04 2021 +0100
+++ b/sys/dev/usb/if_urtwn.c    Sat Feb 13 18:39:41 2021 +0100
@@ -3001,7 +3001,8 @@
            device_xname(sc->sc_dev), __func__, status));
 
        if (data->m) {
-               ieee80211_tx_complete(data->ni, data->m, 0);
+               ieee80211_tx_complete(data->ni, data->m,
+                    status != USBD_NORMAL_COMPLETION);
                data->m = NULL;
                data->ni = NULL;
        }
@@ -3321,7 +3322,6 @@
                        device_printf(sc->sc_dev, "m_pullup failed\n");
                        if_statinc(vap->iv_ifp, if_oerrors);
                        urtwn_put_tx_data(sc, data);
-                       m_freem(m);
                        continue;
                }
                eh = mtod(m, struct ether_header *);
@@ -3342,17 +3342,16 @@
                        ieee80211_free_node(ni);
                        device_printf(sc->sc_dev,
                            "unable to encapsulate packet\n");
+                       ieee80211_tx_complete(ni, m, 1);
                        if_statinc(vap->iv_ifp, if_oerrors);
                        urtwn_put_tx_data(sc, data);
-                       m_freem(m);
                        continue;
                }
 
                if (urtwn_tx(sc, m, ni, data) != 0) {
-                       m_freem(m);
-                       ieee80211_free_node(ni);
                        device_printf(sc->sc_dev,
                            "unable to transmit packet\n");
+                       ieee80211_tx_complete(ni, m, 1);
                        if (vap != NULL)
                                if_statinc(vap->iv_ifp, if_oerrors);
                        urtwn_put_tx_data(sc, data);
@@ -3661,9 +3660,8 @@
        error = urtwn_tx(sc, m, ni, data);
        if (error != 0) {
                if_statinc(vap->iv_ifp, if_oerrors);
+               ieee80211_tx_complete(ni, m, 1);
                urtwn_put_tx_data(sc, data);
-               m_freem(m);
-               ieee80211_free_node(ni);
        } else {
                sc->tx_timer = 5;
                vap->iv_ifp->if_timer = 1;



Home | Main Index | Thread Index | Old Index