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 improved tx functions required for new stack.



details:   https://anonhg.NetBSD.org/src-all/rev/dde23403865d
branches:  trunk
changeset: 950524:dde23403865d
user:      Nathanial Sloss <nat%netbsd.org@localhost>
date:      Sun May 24 18:59:18 2020 +1000

description:
improved tx functions required for new stack.

diffstat:

 sys/dev/pci/if_iwn.c |  23 +++++++++++++++--------
 1 files changed, 15 insertions(+), 8 deletions(-)

diffs (112 lines):

diff -r 5c94640b4cb3 -r dde23403865d sys/dev/pci/if_iwn.c
--- a/sys/dev/pci/if_iwn.c      Sun May 24 18:58:23 2020 +1000
+++ b/sys/dev/pci/if_iwn.c      Sun May 24 18:59:18 2020 +1000
@@ -2091,13 +2091,12 @@
 static void
 iwn_newassoc(struct ieee80211_node *ni, int isnew)
 {
-       //struct iwn_softc *sc = ni->ni_ic->ic_ifp->if_softc;
-       //struct iwn_node *wn = (void *)ni;
-//     uint8_t rate;
-//     int ridx, i;
+//     struct iwn_softc *sc = ni->ni_ic->ic_ifp->if_softc;
+       struct iwn_node *wn = (void *)ni;
+       uint8_t rate;
+       int ridx, i;
 
 //     ieee80211_amrr_node_init(&sc->amrr, &wn->amn);
-#if 0
        /* Start at lowest available bit-rate, AMRR will raise. */
        ni->ni_txrate = 0;
 
@@ -2109,7 +2108,6 @@
                                break;
                wn->ridx[i] = ridx;
        }
-#endif
 }
 
 static int
@@ -3200,7 +3198,7 @@
 
        s = splnet();
 
-       IF_ENQUEUE(&ic->ic_mgtq, m);
+       IF_ENQUEUE(&vap->iv_ifp->if_snd, m);
         if_statadd(vap->iv_ifp, if_obytes, pktlen);
         if (mcast)
                 if_statinc(vap->iv_ifp, if_omcasts);
@@ -3249,11 +3247,13 @@
        KASSERT(sc != NULL);
        KASSERT(m != NULL);
 
+#if 0
        if ((ifp->if_flags & (IFF_RUNNING | IFF_OACTIVE)) != IFF_RUNNING)
                return 0;
 
        if (vap->iv_state != IEEE80211_S_RUN)
                return ENXIO;
+#endif
 
        if (m->m_len < sizeof (*eh) &&
            (m = m_pullup(m, sizeof (*eh))) == NULL) {
@@ -3261,6 +3261,7 @@
                        return EIO;
        }
        eh = mtod(m, struct ether_header *);
+#if 0
        /* classify mbuf so we can find which tx ring to use */
        if (ieee80211_classify(ni, m) != 0) {
                m_freem(m);
@@ -3268,6 +3269,7 @@
                if_statinc(ifp, if_oerrors);
                        return ENOBUFS;
        }
+#endif
 
        /* No QoS encapsulation for EAPOL frames. */
        ac = (eh->ether_type != htons(ETHERTYPE_PAE)) ?
@@ -3275,11 +3277,13 @@
 
         bpf_mtap3(vap->iv_rawbpf, m, BPF_D_OUT);
 
+#if 0
        if ((m = ieee80211_encap(vap, ni, m)) == NULL) {
                ieee80211_free_node(ni);
                if_statinc(ifp, if_oerrors);
                return ENOMEM;
        }
+#endif
 
 
        if (iwn_tx(sc, m, ni, ac) != 0) {
@@ -3290,10 +3294,12 @@
 
        sc->sc_tx_timer = 5;
        ifp->if_timer = 1;
+#if 0
 
        m_freem(m);
        ieee80211_free_node(ni);
 
+#endif
        return 0;
 }
 
@@ -3302,7 +3308,7 @@
 {
        struct ieee80211com *ic = &sc->sc_ic;
        struct ieee80211vap *vap = TAILQ_FIRST(&ic->ic_vaps);
-       struct iwn_node *wn = (void *)ni;
+       //struct iwn_node *wn = (void *)ni;
        struct iwn_tx_ring *ring;
        struct iwn_tx_desc *desc;
        struct iwn_tx_data *data;
@@ -3310,6 +3316,7 @@
        struct iwn_cmd_data *tx;
        const struct iwn_rate *rinfo;
        struct ieee80211_frame *wh;
+       struct iwn_node *wn = (void *)ni;
        struct ieee80211_key *k = NULL;
        struct mbuf *m1;
        uint32_t flags;



Home | Main Index | Thread Index | Old Index