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 Reorder sections.



details:   https://anonhg.NetBSD.org/src-all/rev/26f7ba1db0c4
branches:  trunk
changeset: 987131:26f7ba1db0c4
user:      Nathanial Sloss <nat%netbsd.org@localhost>
date:      Sat Jun 20 08:28:08 2020 +1000

description:
Reorder sections.

diffstat:

 sys/dev/pci/if_iwn.c |  30 ++++++++++++------------------
 1 files changed, 12 insertions(+), 18 deletions(-)

diffs (47 lines):

diff -r d7a5e6de7ca9 -r 26f7ba1db0c4 sys/dev/pci/if_iwn.c
--- a/sys/dev/pci/if_iwn.c      Sat Jun 20 08:27:22 2020 +1000
+++ b/sys/dev/pci/if_iwn.c      Sat Jun 20 08:28:08 2020 +1000
@@ -3444,24 +3444,6 @@
                ridx = wn->ridx[ni->ni_txrate];
        rinfo = &iwn_rates[ridx];
 
-       /* Encrypt the frame if need be. */
-       /*
-        * XXX For now, NetBSD swaps the encryption and bpf sections
-        * in order to match old code and other drivers. Tests with
-        * tcpdump indicates that the order is irrelevant, however,
-        * as bpf produces unencrypted data for both ordering choices.
-        */
-       if (wh->i_fc[1] & IEEE80211_FC1_PROTECTED) {
-               k = ieee80211_crypto_encap(ni, m);
-               if (k == NULL) {
-                       m_freem(m);
-                       return ENOBUFS;
-               }
-               /* Packet header may have moved, reset our local pointer. */
-               wh = mtod(m, struct ieee80211_frame *);
-       }
-       totlen = m->m_pkthdr.len;
-
        if (sc->sc_drvbpf != NULL) {
                struct iwn_tx_radiotap_header *tap = &sc->sc_txtap;
 
@@ -3476,6 +3458,18 @@
                bpf_mtap2(sc->sc_drvbpf, tap, sc->sc_txtap_len, m, BPF_D_OUT);
        }
 
+       /* Encrypt the frame if need be. */
+       if (wh->i_fc[1] & IEEE80211_FC1_PROTECTED) {
+               k = ieee80211_crypto_encap(ni, m);
+               if (k == NULL) {
+                       m_freem(m);
+                       return ENOBUFS;
+               }
+               /* Packet header may have moved, reset our local pointer. */
+               wh = mtod(m, struct ieee80211_frame *);
+       }
+       totlen = m->m_pkthdr.len;
+
        /* Prepare TX firmware command. */
        cmd = &ring->cmd[ring->cur];
        cmd->code = IWN_CMD_TX_DATA;



Home | Main Index | Thread Index | Old Index