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/6e7502c58cdd
branches:  trunk
changeset: 367151:6e7502c58cdd
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 1585ee2e3061 -r 6e7502c58cdd 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
@@ -3000,7 +3000,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;
        }
@@ -3319,7 +3320,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 *);
@@ -3340,17 +3340,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);
@@ -3659,9 +3658,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