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 Reinstate the existing radiotap attach fun...



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

description:
Reinstate the existing radiotap attach function.

diffstat:

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

diffs (69 lines):

diff -r 2f104b43ed9e -r 0aa4b82690ee sys/dev/pci/if_iwn.c
--- a/sys/dev/pci/if_iwn.c      Sat May 23 01:30:30 2020 +1000
+++ b/sys/dev/pci/if_iwn.c      Sun May 24 18:57:39 2020 +1000
@@ -208,7 +208,7 @@
 static int     iwn_config_complete(device_t);
 static int     iwn4965_attach(struct iwn_softc *, pci_product_id_t);
 static int     iwn5000_attach(struct iwn_softc *, pci_product_id_t);
-//static void  iwn_radiotap_attach(struct iwn_softc *);
+static void    iwn_radiotap_attach(struct iwn_softc *, struct ifnet *);
 static int     iwn_detach(device_t , int);
 #if 0
 static void    iwn_power(int, void *);
@@ -782,8 +782,6 @@
        sc->amrr.amrr_min_success_threshold =  1;
        sc->amrr.amrr_max_success_threshold = 15;
 
-//     iwn_radiotap_attach(sc);
-
        /* Use common softint-based if_input */
        /* XXX NetBSD add call to ieee80211_announce for dmesg. */
 
@@ -799,6 +797,8 @@
                return 0;
        }
 
+       iwn_radiotap_attach(sc, vap->iv_ifp);
+
        callout_setfunc(&sc->scan_to, iwn_next_scan, vap);
        if (pmf_device_register(self, NULL, iwn_resume))
                pmf_class_network_register(self, vap->iv_ifp);
@@ -989,10 +989,12 @@
        sc->sc_newstate = vap->iv_newstate;
        vap->iv_newstate = iwn_newstate;
 
+#if 0
        /* Attach the packet filter */
        bpf_attach2(vap->iv_ifp, DLT_IEEE802_11_RADIO,
            sizeof(struct ieee80211_frame) + IEEE80211_RADIOTAP_HDRLEN,
            &sc->sc_drvbpf);
+#endif
 
        ieee80211_init(ifp);
 
@@ -1160,15 +1162,12 @@
        return 0;
 }
 
-#if 0
 /*
  * Attach the interface to 802.11 radiotap.
  */
 static void
-iwn_radiotap_attach(struct iwn_softc *sc)
-{
-       struct ifnet *ifp = sc->sc_ic.ic_ifp;
-
+iwn_radiotap_attach(struct iwn_softc *sc, struct ifnet *ifp)
+{
        bpf_attach2(ifp, DLT_IEEE802_11_RADIO,
            sizeof (struct ieee80211_frame) + IEEE80211_RADIOTAP_HDRLEN,
            &sc->sc_drvbpf);
@@ -1181,7 +1180,6 @@
        sc->sc_txtap.wt_ihdr.it_len = htole16(sc->sc_txtap_len);
        sc->sc_txtap.wt_ihdr.it_present = htole32(IWN_TX_RADIOTAP_PRESENT);
 }
-#endif
 
 static int
 iwn_detach(device_t self, int flags __unused)



Home | Main Index | Thread Index | Old Index