Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src-draft/trunk]: src/sys/dev/pci Rework iwn_tx to take a vap.



details:   https://anonhg.NetBSD.org/src-all/rev/1a480d2421d6
branches:  trunk
changeset: 989656:1a480d2421d6
user:      Nathanial Sloss <nat%netbsd.org@localhost>
date:      Sat Jun 20 08:33:17 2020 +1000

description:
Rework iwn_tx to take a vap.

diffstat:

 sys/dev/pci/if_iwn.c |  14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)

diffs (51 lines):

diff -r c7581a7b28f8 -r 1a480d2421d6 sys/dev/pci/if_iwn.c
--- a/sys/dev/pci/if_iwn.c      Sat Jun 20 08:32:15 2020 +1000
+++ b/sys/dev/pci/if_iwn.c      Sat Jun 20 08:33:17 2020 +1000
@@ -302,7 +302,7 @@
 #ifdef notyet
 static void    iwn5000_reset_sched(struct iwn_softc *, int, int);
 #endif
-static int     iwn_tx(struct iwn_softc *, struct mbuf *,
+static int     iwn_tx(struct ieee80211vap *, struct mbuf *,
                    struct ieee80211_node *, int);
 static void    iwn_start(struct ifnet *);
 static void    iwn_watchdog(struct ifnet *);
@@ -3357,13 +3357,13 @@
         bpf_mtap3(vap->iv_rawbpf, m, BPF_D_OUT);
 
        if ((m = ieee80211_encap(vap, ni, m)) == NULL) {
+       if (iwn_tx(vap, m, ni, ac) != 0) {
                ieee80211_free_node(ni);
                if_statinc(ifp, if_oerrors);
                return ENOMEM;
        }
 
 
-       if (iwn_tx(sc, m, ni, ac) != 0) {
                ieee80211_free_node(ni);
                if_statinc(ifp, if_oerrors);
                        return ENXIO;
@@ -3381,10 +3381,10 @@
 }
 
 static int
-iwn_tx(struct iwn_softc *sc, struct mbuf *m, struct ieee80211_node *ni, int ac)
-{
-       struct ieee80211com *ic = &sc->sc_ic;
-       struct ieee80211vap *vap = TAILQ_FIRST(&ic->ic_vaps);
+iwn_tx(struct ieee80211vap *vap, struct mbuf *m, struct ieee80211_node *ni, int ac)
+{
+       struct ieee80211com *ic = vap->iv_ic;
+       struct iwn_softc *sc = ic->ic_softc;
        //struct iwn_node *wn = (void *)ni;
        struct iwn_tx_ring *ring;
        struct iwn_tx_desc *desc;
@@ -3746,7 +3746,7 @@
 
                //bpf_mtap3(ic->ic_rawbpf, m, BPF_D_OUT);
 
-               if (iwn_tx(sc, m, ni, ac) != 0) {
+               if (iwn_tx(vap, m, ni, ac) != 0) {
                        ieee80211_free_node(ni);
                        if_statinc(ifp, if_oerrors);
                        continue;



Home | Main Index | Thread Index | Old Index