Author: avos
Date: Thu Mar 28 09:50:25 2019
New Revision: 345636
URL: https://svnweb.freebsd.org/changeset/base/345636

Log:
  MFC r344990:
  Fix ieee80211_radiotap(9) usage in wireless drivers:
  
  - Alignment issues:
   * Add missing __packed attributes + padding across all drivers; in
  most places there was an assumption that padding will be always
  minimally suitable; in few places - e.g., in urtw(4) / rtwn(4) -
  padding was just missing.
   * Add __aligned(8) attribute for all Rx radiotap headers since they can
  contain 64-bit TSF timestamp; it cannot appear in Tx radiotap headers, so
  just drop the attribute here. Refresh ieee80211_radiotap(9) man page
  accordingly.
  
  - Since net80211 automatically updates channel frequency / flags in
  ieee80211_radiotap_chan_change() drop duplicate setup for these fields
  in drivers.

Modified:
  stable/11/share/man/man9/ieee80211_radiotap.9
  stable/11/sys/dev/ath/if_athioctl.h
  stable/11/sys/dev/bwi/if_bwi.c
  stable/11/sys/dev/bwi/if_bwivar.h
  stable/11/sys/dev/bwn/if_bwn.c
  stable/11/sys/dev/bwn/if_bwnvar.h
  stable/11/sys/dev/ipw/if_ipwvar.h
  stable/11/sys/dev/iwi/if_iwivar.h
  stable/11/sys/dev/iwm/if_iwmvar.h
  stable/11/sys/dev/iwn/if_iwn.c
  stable/11/sys/dev/iwn/if_iwnvar.h
  stable/11/sys/dev/malo/if_maloioctl.h
  stable/11/sys/dev/mwl/if_mwlioctl.h
  stable/11/sys/dev/otus/if_otus.c
  stable/11/sys/dev/otus/if_otusreg.h
  stable/11/sys/dev/ral/rt2560var.h
  stable/11/sys/dev/ral/rt2661var.h
  stable/11/sys/dev/ral/rt2860var.h
  stable/11/sys/dev/rtwn/if_rtwn.c
  stable/11/sys/dev/rtwn/if_rtwnreg.h
  stable/11/sys/dev/urtwn/if_urtwn.c
  stable/11/sys/dev/urtwn/if_urtwnvar.h
  stable/11/sys/dev/usb/wlan/if_rsu.c
  stable/11/sys/dev/usb/wlan/if_rsureg.h
  stable/11/sys/dev/usb/wlan/if_rumvar.h
  stable/11/sys/dev/usb/wlan/if_run.c
  stable/11/sys/dev/usb/wlan/if_runvar.h
  stable/11/sys/dev/usb/wlan/if_uathvar.h
  stable/11/sys/dev/usb/wlan/if_upgtvar.h
  stable/11/sys/dev/usb/wlan/if_uralvar.h
  stable/11/sys/dev/usb/wlan/if_urtw.c
  stable/11/sys/dev/usb/wlan/if_urtwvar.h
  stable/11/sys/dev/usb/wlan/if_zydreg.h
  stable/11/sys/dev/wi/if_wireg.h
  stable/11/sys/dev/wpi/if_wpivar.h
  stable/11/sys/dev/wtap/if_wtapioctl.h
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/share/man/man9/ieee80211_radiotap.9
==============================================================================
--- stable/11/share/man/man9/ieee80211_radiotap.9       Thu Mar 28 09:18:22 
2019        (r345635)
+++ stable/11/share/man/man9/ieee80211_radiotap.9       Thu Mar 28 09:50:25 
2019        (r345636)
@@ -27,7 +27,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd August 4, 2009
+.Dd March 28, 2019
 .Dt IEEE80211_RADIOTAP 9
 .Os
 .Sh NAME
@@ -257,7 +257,7 @@ struct wi_rx_radiotap_header {
         uint16_t       wr_chan_flags;
         uint8_t        wr_antsignal;
         uint8_t        wr_antnoise;
-} __packed;
+} __packed __aligned(8);
 .Ed
 .Pp
 and transmit definitions for the Atheros driver:

Modified: stable/11/sys/dev/ath/if_athioctl.h
==============================================================================
--- stable/11/sys/dev/ath/if_athioctl.h Thu Mar 28 09:18:22 2019        
(r345635)
+++ stable/11/sys/dev/ath/if_athioctl.h Thu Mar 28 09:50:25 2019        
(r345636)
@@ -371,7 +371,7 @@ struct ath_rx_radiotap_header {
         */
        struct ath_radiotap_vendor_hdr wr_v;
 #endif /* ATH_ENABLE_RADIOTAP_VENDOR_EXT */
-} __packed;
+} __packed __aligned(8);
 
 #define ATH_TX_RADIOTAP_PRESENT (              \
        (1 << IEEE80211_RADIOTAP_FLAGS)         | \

Modified: stable/11/sys/dev/bwi/if_bwi.c
==============================================================================
--- stable/11/sys/dev/bwi/if_bwi.c      Thu Mar 28 09:18:22 2019        
(r345635)
+++ stable/11/sys/dev/bwi/if_bwi.c      Thu Mar 28 09:50:25 2019        
(r345636)
@@ -1727,15 +1727,6 @@ bwi_set_channel(struct ieee80211com *ic)
        bwi_rf_set_chan(mac, ieee80211_chan2ieee(ic, c), 0);
 
        sc->sc_rates = ieee80211_get_ratetable(c);
-
-       /*
-        * Setup radio tap channel freq and flags
-        */
-       sc->sc_tx_th.wt_chan_freq = sc->sc_rx_th.wr_chan_freq =
-               htole16(c->ic_freq);
-       sc->sc_tx_th.wt_chan_flags = sc->sc_rx_th.wr_chan_flags =
-               htole16(c->ic_flags & 0xffff);
-
        BWI_UNLOCK(sc);
 }
 

Modified: stable/11/sys/dev/bwi/if_bwivar.h
==============================================================================
--- stable/11/sys/dev/bwi/if_bwivar.h   Thu Mar 28 09:18:22 2019        
(r345635)
+++ stable/11/sys/dev/bwi/if_bwivar.h   Thu Mar 28 09:50:25 2019        
(r345636)
@@ -511,7 +511,7 @@ struct bwi_tx_radiotap_hdr {
        uint8_t         wt_rate;
        uint16_t        wt_chan_freq;
        uint16_t        wt_chan_flags;
-};
+} __packed;
 
 #define BWI_RX_RADIOTAP_PRESENT                                \
        ((1 << IEEE80211_RADIOTAP_TSFT) |               \
@@ -531,7 +531,7 @@ struct bwi_rx_radiotap_hdr {
        int8_t          wr_antsignal;
        int8_t          wr_antnoise;
        /* TODO: sq */
-};
+} __packed __aligned(8);
 
 struct bwi_vap {
        struct ieee80211vap     bv_vap;

Modified: stable/11/sys/dev/bwn/if_bwn.c
==============================================================================
--- stable/11/sys/dev/bwn/if_bwn.c      Thu Mar 28 09:18:22 2019        
(r345635)
+++ stable/11/sys/dev/bwn/if_bwn.c      Thu Mar 28 09:50:25 2019        
(r345636)
@@ -1831,14 +1831,6 @@ bwn_set_channel(struct ieee80211com *ic)
        bwn_mac_enable(mac);
 
 fail:
-       /*
-        * Setup radio tap channel freq and flags
-        */
-       sc->sc_tx_th.wt_chan_freq = sc->sc_rx_th.wr_chan_freq =
-               htole16(ic->ic_curchan->ic_freq);
-       sc->sc_tx_th.wt_chan_flags = sc->sc_rx_th.wr_chan_flags =
-               htole16(ic->ic_curchan->ic_flags & 0xffff);
-
        BWN_UNLOCK(sc);
 }
 

Modified: stable/11/sys/dev/bwn/if_bwnvar.h
==============================================================================
--- stable/11/sys/dev/bwn/if_bwnvar.h   Thu Mar 28 09:18:22 2019        
(r345635)
+++ stable/11/sys/dev/bwn/if_bwnvar.h   Thu Mar 28 09:50:25 2019        
(r345636)
@@ -565,7 +565,7 @@ struct bwn_rx_radiotap_header {
        int8_t                          wr_antsignal;
        int8_t                          wr_antnoise;
        u_int8_t                        wr_antenna;
-};
+} __packed __aligned(8);
 
 #define        BWN_TX_RADIOTAP_PRESENT (               \
        (1 << IEEE80211_RADIOTAP_FLAGS)         | \
@@ -583,7 +583,7 @@ struct bwn_tx_radiotap_header {
        u_int16_t                       wt_chan_flags;
        u_int8_t                        wt_txpower;
        u_int8_t                        wt_antenna;
-};
+} __packed;
 
 struct bwn_stats {
        int32_t                         rtsfail;

Modified: stable/11/sys/dev/ipw/if_ipwvar.h
==============================================================================
--- stable/11/sys/dev/ipw/if_ipwvar.h   Thu Mar 28 09:18:22 2019        
(r345635)
+++ stable/11/sys/dev/ipw/if_ipwvar.h   Thu Mar 28 09:50:25 2019        
(r345636)
@@ -55,11 +55,12 @@ struct ipw_soft_buf {
 struct ipw_rx_radiotap_header {
        struct ieee80211_radiotap_header wr_ihdr;
        uint8_t         wr_flags;
+       uint8_t         wr_pad;
        uint16_t        wr_chan_freq;
        uint16_t        wr_chan_flags;
        int8_t          wr_antsignal;
        int8_t          wr_antnoise;
-};
+} __packed __aligned(8);
 
 #define IPW_RX_RADIOTAP_PRESENT                                                
\
        ((1 << IEEE80211_RADIOTAP_FLAGS) |                              \
@@ -70,9 +71,10 @@ struct ipw_rx_radiotap_header {
 struct ipw_tx_radiotap_header {
        struct ieee80211_radiotap_header wt_ihdr;
        uint8_t         wt_flags;
+       uint8_t         wt_pad;
        uint16_t        wt_chan_freq;
        uint16_t        wt_chan_flags;
-};
+} __packed;
 
 #define IPW_TX_RADIOTAP_PRESENT                                                
\
        ((1 << IEEE80211_RADIOTAP_FLAGS) |                              \

Modified: stable/11/sys/dev/iwi/if_iwivar.h
==============================================================================
--- stable/11/sys/dev/iwi/if_iwivar.h   Thu Mar 28 09:18:22 2019        
(r345635)
+++ stable/11/sys/dev/iwi/if_iwivar.h   Thu Mar 28 09:50:25 2019        
(r345636)
@@ -36,7 +36,7 @@ struct iwi_rx_radiotap_header {
        int8_t          wr_antsignal;
        int8_t          wr_antnoise;
        uint8_t         wr_antenna;
-};
+} __packed __aligned(8);
 
 #define IWI_RX_RADIOTAP_PRESENT                                                
\
        ((1 << IEEE80211_RADIOTAP_FLAGS) |                              \
@@ -49,9 +49,10 @@ struct iwi_rx_radiotap_header {
 struct iwi_tx_radiotap_header {
        struct ieee80211_radiotap_header wt_ihdr;
        uint8_t         wt_flags;
+       uint8_t         wt_pad;
        uint16_t        wt_chan_freq;
        uint16_t        wt_chan_flags;
-};
+} __packed;
 
 #define IWI_TX_RADIOTAP_PRESENT                                                
\
        ((1 << IEEE80211_RADIOTAP_FLAGS) |                              \

Modified: stable/11/sys/dev/iwm/if_iwmvar.h
==============================================================================
--- stable/11/sys/dev/iwm/if_iwmvar.h   Thu Mar 28 09:18:22 2019        
(r345635)
+++ stable/11/sys/dev/iwm/if_iwmvar.h   Thu Mar 28 09:50:25 2019        
(r345636)
@@ -113,7 +113,7 @@ struct iwm_rx_radiotap_header {
        uint16_t        wr_chan_flags;
        int8_t          wr_dbm_antsignal;
        int8_t          wr_dbm_antnoise;
-} __packed;
+} __packed __aligned(8);
 
 #define IWM_RX_RADIOTAP_PRESENT                                                
\
        ((1 << IEEE80211_RADIOTAP_TSFT) |                               \

Modified: stable/11/sys/dev/iwn/if_iwn.c
==============================================================================
--- stable/11/sys/dev/iwn/if_iwn.c      Thu Mar 28 09:18:22 2019        
(r345635)
+++ stable/11/sys/dev/iwn/if_iwn.c      Thu Mar 28 09:50:25 2019        
(r345636)
@@ -8892,18 +8892,12 @@ iwn_scan_end(struct ieee80211com *ic)
 static void
 iwn_set_channel(struct ieee80211com *ic)
 {
-       const struct ieee80211_channel *c = ic->ic_curchan;
        struct iwn_softc *sc = ic->ic_softc;
        int error;
 
        DPRINTF(sc, IWN_DEBUG_TRACE, "->Doing %s\n", __func__);
 
        IWN_LOCK(sc);
-       sc->sc_rxtap.wr_chan_freq = htole16(c->ic_freq);
-       sc->sc_rxtap.wr_chan_flags = htole16(c->ic_flags);
-       sc->sc_txtap.wt_chan_freq = htole16(c->ic_freq);
-       sc->sc_txtap.wt_chan_flags = htole16(c->ic_flags);
-
        /*
         * Only need to set the channel in Monitor mode. AP scanning and auth
         * are already taken care of by their respective firmware commands.

Modified: stable/11/sys/dev/iwn/if_iwnvar.h
==============================================================================
--- stable/11/sys/dev/iwn/if_iwnvar.h   Thu Mar 28 09:18:22 2019        
(r345635)
+++ stable/11/sys/dev/iwn/if_iwnvar.h   Thu Mar 28 09:50:25 2019        
(r345636)
@@ -62,7 +62,7 @@ struct iwn_rx_radiotap_header {
        uint16_t        wr_chan_flags;
        int8_t          wr_dbm_antsignal;
        int8_t          wr_dbm_antnoise;
-} __packed;
+} __packed __aligned(8);
 
 #define IWN_RX_RADIOTAP_PRESENT                                                
\
        ((1 << IEEE80211_RADIOTAP_TSFT) |                               \

Modified: stable/11/sys/dev/malo/if_maloioctl.h
==============================================================================
--- stable/11/sys/dev/malo/if_maloioctl.h       Thu Mar 28 09:18:22 2019        
(r345635)
+++ stable/11/sys/dev/malo/if_maloioctl.h       Thu Mar 28 09:50:25 2019        
(r345636)
@@ -91,7 +91,7 @@ struct malo_rx_radiotap_header {
        int8_t          wr_antsignal;
        int8_t          wr_antnoise;
        u_int8_t        wr_antenna;
-};
+} __packed __aligned(8);
 
 #define MALO_TX_RADIOTAP_PRESENT (             \
        (1 << IEEE80211_RADIOTAP_FLAGS)         | \
@@ -109,6 +109,6 @@ struct malo_tx_radiotap_header {
        u_int16_t       wt_chan_flags;
        u_int8_t        wt_txpower;
        u_int8_t        wt_antenna;
-};
+} __packed;
 
 #endif /* _DEV_MALO_MVIOCTL_H */

Modified: stable/11/sys/dev/mwl/if_mwlioctl.h
==============================================================================
--- stable/11/sys/dev/mwl/if_mwlioctl.h Thu Mar 28 09:18:22 2019        
(r345635)
+++ stable/11/sys/dev/mwl/if_mwlioctl.h Thu Mar 28 09:50:25 2019        
(r345636)
@@ -113,7 +113,7 @@ struct mwl_rx_radiotap_header {
        int8_t          wr_antsignal;
        int8_t          wr_antnoise;
        u_int8_t        wr_antenna;
-};
+} __packed __aligned(8);
 
 #define MWL_TX_RADIOTAP_PRESENT (              \
        (1 << IEEE80211_RADIOTAP_FLAGS)         | \
@@ -131,6 +131,6 @@ struct mwl_tx_radiotap_header {
        u_int16_t       wt_chan_flags;
        u_int8_t        wt_txpower;
        u_int8_t        wt_antenna;
-};
+} __packed;
 
 #endif /* _DEV_MWL_MVIOCTL_H */

Modified: stable/11/sys/dev/otus/if_otus.c
==============================================================================
--- stable/11/sys/dev/otus/if_otus.c    Thu Mar 28 09:18:22 2019        
(r345635)
+++ stable/11/sys/dev/otus/if_otus.c    Thu Mar 28 09:50:25 2019        
(r345636)
@@ -1670,8 +1670,6 @@ otus_sub_rxeof(struct otus_softc *sc, uint8_t *buf, in
                struct mbuf mb;
 
                tap->wr_flags = 0;
-               tap->wr_chan_freq = htole16(ic->ic_ibss_chan->ic_freq);
-               tap->wr_chan_flags = htole16(ic->ic_ibss_chan->ic_flags);
                tap->wr_antsignal = tail->rssi;
                tap->wr_rate = 2;       /* In case it can't be found below. */
                switch (tail->status & AR_RX_STATUS_MT_MASK) {

Modified: stable/11/sys/dev/otus/if_otusreg.h
==============================================================================
--- stable/11/sys/dev/otus/if_otusreg.h Thu Mar 28 09:18:22 2019        
(r345635)
+++ stable/11/sys/dev/otus/if_otusreg.h Thu Mar 28 09:50:25 2019        
(r345636)
@@ -900,7 +900,7 @@ struct otus_rx_radiotap_header {
        uint16_t        wr_chan_freq;
        uint16_t        wr_chan_flags;
        uint8_t         wr_antsignal;
-} __packed;
+} __packed __aligned(8);
 
 #define OTUS_RX_RADIOTAP_PRESENT                       \
        (1 << IEEE80211_RADIOTAP_FLAGS |                \

Modified: stable/11/sys/dev/ral/rt2560var.h
==============================================================================
--- stable/11/sys/dev/ral/rt2560var.h   Thu Mar 28 09:18:22 2019        
(r345635)
+++ stable/11/sys/dev/ral/rt2560var.h   Thu Mar 28 09:50:25 2019        
(r345636)
@@ -27,7 +27,7 @@ struct rt2560_rx_radiotap_header {
        int8_t          wr_antsignal;
        int8_t          wr_antnoise;
        uint8_t         wr_antenna;
-};
+} __packed __aligned(8);
 
 #define RT2560_RX_RADIOTAP_PRESENT                                     \
        ((1 << IEEE80211_RADIOTAP_TSFT) |                               \
@@ -45,7 +45,7 @@ struct rt2560_tx_radiotap_header {
        uint16_t        wt_chan_freq;
        uint16_t        wt_chan_flags;
        uint8_t         wt_antenna;
-};
+} __packed;
 
 #define RT2560_TX_RADIOTAP_PRESENT                                     \
        ((1 << IEEE80211_RADIOTAP_FLAGS) |                              \

Modified: stable/11/sys/dev/ral/rt2661var.h
==============================================================================
--- stable/11/sys/dev/ral/rt2661var.h   Thu Mar 28 09:18:22 2019        
(r345635)
+++ stable/11/sys/dev/ral/rt2661var.h   Thu Mar 28 09:50:25 2019        
(r345636)
@@ -42,7 +42,7 @@ struct rt2661_tx_radiotap_header {
        uint8_t         wt_rate;
        uint16_t        wt_chan_freq;
        uint16_t        wt_chan_flags;
-} __packed __aligned(8);
+} __packed;
 
 #define RT2661_TX_RADIOTAP_PRESENT                                     \
        ((1 << IEEE80211_RADIOTAP_FLAGS) |                              \

Modified: stable/11/sys/dev/ral/rt2860var.h
==============================================================================
--- stable/11/sys/dev/ral/rt2860var.h   Thu Mar 28 09:18:22 2019        
(r345635)
+++ stable/11/sys/dev/ral/rt2860var.h   Thu Mar 28 09:50:25 2019        
(r345636)
@@ -55,7 +55,7 @@ struct rt2860_tx_radiotap_header {
        uint8_t         wt_rate;
        uint16_t        wt_chan_freq;
        uint16_t        wt_chan_flags;
-} __packed __aligned(8);
+} __packed;
 
 #define RT2860_TX_RADIOTAP_PRESENT                                     \
        ((1 << IEEE80211_RADIOTAP_FLAGS) |                              \

Modified: stable/11/sys/dev/rtwn/if_rtwn.c
==============================================================================
--- stable/11/sys/dev/rtwn/if_rtwn.c    Thu Mar 28 09:18:22 2019        
(r345635)
+++ stable/11/sys/dev/rtwn/if_rtwn.c    Thu Mar 28 09:50:25 2019        
(r345636)
@@ -1540,8 +1540,6 @@ rtwn_rx_frame(struct rtwn_softc *sc, struct r92c_rx_de
                        tap->wr_rate = 0x80 | (rate - 12);
                }
                tap->wr_dbm_antsignal = rssi;
-               tap->wr_chan_freq = htole16(ic->ic_curchan->ic_freq);
-               tap->wr_chan_flags = htole16(ic->ic_curchan->ic_flags);
        }
 
        RTWN_UNLOCK(sc);
@@ -1734,8 +1732,6 @@ rtwn_tx(struct rtwn_softc *sc, struct mbuf *m, struct 
                struct rtwn_tx_radiotap_header *tap = &sc->sc_txtap;
 
                tap->wt_flags = 0;
-               tap->wt_chan_freq = htole16(ic->ic_curchan->ic_freq);
-               tap->wt_chan_flags = htole16(ic->ic_curchan->ic_flags);
 
                ieee80211_radiotap_tx(vap, m);
        }

Modified: stable/11/sys/dev/rtwn/if_rtwnreg.h
==============================================================================
--- stable/11/sys/dev/rtwn/if_rtwnreg.h Thu Mar 28 09:18:22 2019        
(r345635)
+++ stable/11/sys/dev/rtwn/if_rtwnreg.h Thu Mar 28 09:50:25 2019        
(r345636)
@@ -1217,7 +1217,7 @@ struct rtwn_rx_radiotap_header {
        uint16_t        wr_chan_freq;
        uint16_t        wr_chan_flags;
        uint8_t         wr_dbm_antsignal;
-} __packed;
+} __packed __aligned(8);
 
 #define RTWN_RX_RADIOTAP_PRESENT                       \
        (1 << IEEE80211_RADIOTAP_FLAGS |                \
@@ -1228,6 +1228,7 @@ struct rtwn_rx_radiotap_header {
 struct rtwn_tx_radiotap_header {
        struct ieee80211_radiotap_header wt_ihdr;
        uint8_t         wt_flags;
+       uint8_t         wt_pad;
        uint16_t        wt_chan_freq;
        uint16_t        wt_chan_flags;
 } __packed;

Modified: stable/11/sys/dev/urtwn/if_urtwn.c
==============================================================================
--- stable/11/sys/dev/urtwn/if_urtwn.c  Thu Mar 28 09:18:22 2019        
(r345635)
+++ stable/11/sys/dev/urtwn/if_urtwn.c  Thu Mar 28 09:50:25 2019        
(r345636)
@@ -4841,10 +4841,6 @@ urtwn_set_channel(struct ieee80211com *ic)
                urtwn_set_led(sc, URTWN_LED_LINK, !sc->ledlink);
        }
        urtwn_set_chan(sc, c, NULL);
-       sc->sc_rxtap.wr_chan_freq = htole16(c->ic_freq);
-       sc->sc_rxtap.wr_chan_flags = htole16(c->ic_flags);
-       sc->sc_txtap.wt_chan_freq = htole16(c->ic_freq);
-       sc->sc_txtap.wt_chan_flags = htole16(c->ic_flags);
        URTWN_UNLOCK(sc);
 }
 

Modified: stable/11/sys/dev/urtwn/if_urtwnvar.h
==============================================================================
--- stable/11/sys/dev/urtwn/if_urtwnvar.h       Thu Mar 28 09:18:22 2019        
(r345635)
+++ stable/11/sys/dev/urtwn/if_urtwnvar.h       Thu Mar 28 09:50:25 2019        
(r345636)
@@ -55,9 +55,10 @@ struct urtwn_rx_radiotap_header {
 struct urtwn_tx_radiotap_header {
        struct ieee80211_radiotap_header wt_ihdr;
        uint8_t         wt_flags;
+       uint8_t         wt_pad;
        uint16_t        wt_chan_freq;
        uint16_t        wt_chan_flags;
-} __packed __aligned(8);
+} __packed;
 
 #define URTWN_TX_RADIOTAP_PRESENT                      \
        (1 << IEEE80211_RADIOTAP_FLAGS |                \

Modified: stable/11/sys/dev/usb/wlan/if_rsu.c
==============================================================================
--- stable/11/sys/dev/usb/wlan/if_rsu.c Thu Mar 28 09:18:22 2019        
(r345635)
+++ stable/11/sys/dev/usb/wlan/if_rsu.c Thu Mar 28 09:50:25 2019        
(r345636)
@@ -1830,8 +1830,6 @@ rsu_rx_frame(struct rsu_softc *sc, uint8_t *buf, int p
 #endif
                /* XXX not nice */
                tap->wr_dbm_antsignal = rsu_hwrssi_to_rssi(sc, sc->sc_currssi);
-               tap->wr_chan_freq = htole16(ic->ic_curchan->ic_freq);
-               tap->wr_chan_flags = htole16(ic->ic_curchan->ic_flags);
        }
 
        return (m);
@@ -2117,7 +2115,6 @@ static int
 rsu_tx_start(struct rsu_softc *sc, struct ieee80211_node *ni, 
     struct mbuf *m0, struct rsu_data *data)
 {
-       struct ieee80211com *ic = &sc->sc_ic;
         struct ieee80211vap *vap = ni->ni_vap;
        struct ieee80211_frame *wh;
        struct ieee80211_key *k = NULL;
@@ -2229,8 +2226,6 @@ rsu_tx_start(struct rsu_softc *sc, struct ieee80211_no
                struct rsu_tx_radiotap_header *tap = &sc->sc_txtap;
 
                tap->wt_flags = 0;
-               tap->wt_chan_freq = htole16(ic->ic_curchan->ic_freq);
-               tap->wt_chan_flags = htole16(ic->ic_curchan->ic_flags);
                ieee80211_radiotap_tx(vap, m0);
        }
 

Modified: stable/11/sys/dev/usb/wlan/if_rsureg.h
==============================================================================
--- stable/11/sys/dev/usb/wlan/if_rsureg.h      Thu Mar 28 09:18:22 2019        
(r345635)
+++ stable/11/sys/dev/usb/wlan/if_rsureg.h      Thu Mar 28 09:50:25 2019        
(r345636)
@@ -689,9 +689,10 @@ struct rsu_rx_radiotap_header {
 struct rsu_tx_radiotap_header {
        struct ieee80211_radiotap_header wt_ihdr;
        uint8_t         wt_flags;
+       uint8_t         wt_pad;
        uint16_t        wt_chan_freq;
        uint16_t        wt_chan_flags;
-} __packed __aligned(8);
+} __packed;
 
 #define RSU_TX_RADIOTAP_PRESENT                        \
        (1 << IEEE80211_RADIOTAP_FLAGS |        \

Modified: stable/11/sys/dev/usb/wlan/if_rumvar.h
==============================================================================
--- stable/11/sys/dev/usb/wlan/if_rumvar.h      Thu Mar 28 09:18:22 2019        
(r345635)
+++ stable/11/sys/dev/usb/wlan/if_rumvar.h      Thu Mar 28 09:50:25 2019        
(r345636)
@@ -49,7 +49,7 @@ struct rum_tx_radiotap_header {
        uint16_t        wt_chan_freq;
        uint16_t        wt_chan_flags;
        uint8_t         wt_antenna;
-} __packed __aligned(8);
+} __packed;
 
 #define RT2573_TX_RADIOTAP_PRESENT                                     \
        ((1 << IEEE80211_RADIOTAP_FLAGS) |                              \

Modified: stable/11/sys/dev/usb/wlan/if_run.c
==============================================================================
--- stable/11/sys/dev/usb/wlan/if_run.c Thu Mar 28 09:18:22 2019        
(r345635)
+++ stable/11/sys/dev/usb/wlan/if_run.c Thu Mar 28 09:50:25 2019        
(r345636)
@@ -2830,8 +2830,6 @@ run_rx_frame(struct run_softc *sc, struct mbuf *m, uin
                uint16_t phy;
 
                tap->wr_flags = 0;
-               tap->wr_chan_freq = htole16(ic->ic_curchan->ic_freq);
-               tap->wr_chan_flags = htole16(ic->ic_curchan->ic_flags);
                tap->wr_antsignal = rssi;
                tap->wr_antenna = ant;
                tap->wr_dbm_antsignal = run_rssi2dbm(sc, rssi, ant);
@@ -3096,8 +3094,6 @@ tr_setup:
                            (struct rt2860_txwi *)(&data->desc + sizeof(struct 
rt2870_txd));
                        tap->wt_flags = 0;
                        tap->wt_rate = rt2860_rates[data->ridx].rate;
-                       tap->wt_chan_freq = htole16(ic->ic_curchan->ic_freq);
-                       tap->wt_chan_flags = htole16(ic->ic_curchan->ic_flags);
                        tap->wt_hwqueue = index;
                        if (le16toh(txwi->phy) & RT2860_PHY_SHPRE)
                                tap->wt_flags |= IEEE80211_RADIOTAP_F_SHORTPRE;

Modified: stable/11/sys/dev/usb/wlan/if_runvar.h
==============================================================================
--- stable/11/sys/dev/usb/wlan/if_runvar.h      Thu Mar 28 09:18:22 2019        
(r345635)
+++ stable/11/sys/dev/usb/wlan/if_runvar.h      Thu Mar 28 09:50:25 2019        
(r345636)
@@ -71,7 +71,7 @@ struct run_tx_radiotap_header {
        uint16_t        wt_chan_freq;
        uint16_t        wt_chan_flags;
        uint8_t         wt_hwqueue;
-} __packed __aligned(8);
+} __packed;
 
 #define IEEE80211_RADIOTAP_HWQUEUE 15
 

Modified: stable/11/sys/dev/usb/wlan/if_uathvar.h
==============================================================================
--- stable/11/sys/dev/usb/wlan/if_uathvar.h     Thu Mar 28 09:18:22 2019        
(r345635)
+++ stable/11/sys/dev/usb/wlan/if_uathvar.h     Thu Mar 28 09:50:25 2019        
(r345636)
@@ -67,9 +67,10 @@ struct uath_rx_radiotap_header {
 struct uath_tx_radiotap_header {
        struct ieee80211_radiotap_header wt_ihdr;
        uint8_t         wt_flags;
+       uint8_t         wt_pad;
        uint16_t        wt_chan_freq;
        uint16_t        wt_chan_flags;
-} __packed __aligned(8);
+} __packed;
 
 #define        UATH_TX_RADIOTAP_PRESENT                                        
\
        ((1 << IEEE80211_RADIOTAP_FLAGS) |                              \

Modified: stable/11/sys/dev/usb/wlan/if_upgtvar.h
==============================================================================
--- stable/11/sys/dev/usb/wlan/if_upgtvar.h     Thu Mar 28 09:18:22 2019        
(r345635)
+++ stable/11/sys/dev/usb/wlan/if_upgtvar.h     Thu Mar 28 09:50:25 2019        
(r345636)
@@ -394,7 +394,7 @@ struct upgt_tx_radiotap_header {
        uint8_t         wt_rate;
        uint16_t        wt_chan_freq;
        uint16_t        wt_chan_flags;
-} __packed __aligned(8);
+} __packed;
 
 #define UPGT_TX_RADIOTAP_PRESENT                                       \
        ((1 << IEEE80211_RADIOTAP_FLAGS) |                              \

Modified: stable/11/sys/dev/usb/wlan/if_uralvar.h
==============================================================================
--- stable/11/sys/dev/usb/wlan/if_uralvar.h     Thu Mar 28 09:18:22 2019        
(r345635)
+++ stable/11/sys/dev/usb/wlan/if_uralvar.h     Thu Mar 28 09:50:25 2019        
(r345636)
@@ -51,7 +51,7 @@ struct ural_tx_radiotap_header {
        uint16_t        wt_chan_freq;
        uint16_t        wt_chan_flags;
        uint8_t         wt_antenna;
-} __packed __aligned(8);
+} __packed;
 
 #define RAL_TX_RADIOTAP_PRESENT                                                
\
        ((1 << IEEE80211_RADIOTAP_FLAGS) |                              \

Modified: stable/11/sys/dev/usb/wlan/if_urtw.c
==============================================================================
--- stable/11/sys/dev/usb/wlan/if_urtw.c        Thu Mar 28 09:18:22 2019        
(r345635)
+++ stable/11/sys/dev/usb/wlan/if_urtw.c        Thu Mar 28 09:50:25 2019        
(r345636)
@@ -1686,11 +1686,7 @@ urtw_tx_start(struct urtw_softc *sc, struct ieee80211_
        if (ieee80211_radiotap_active_vap(vap)) {
                struct urtw_tx_radiotap_header *tap = &sc->sc_txtap;
 
-               /* XXX Are variables correct?  */
                tap->wt_flags = 0;
-               tap->wt_chan_freq = htole16(ic->ic_curchan->ic_freq);
-               tap->wt_chan_flags = htole16(ic->ic_curchan->ic_flags);
-
                ieee80211_radiotap_tx(vap, m0);
        }
 
@@ -3995,9 +3991,7 @@ urtw_rxeof(struct usb_xfer *xfer, struct urtw_data *da
        if (ieee80211_radiotap_active(ic)) {
                struct urtw_rx_radiotap_header *tap = &sc->sc_rxtap;
 
-               /* XXX Are variables correct?  */
-               tap->wr_chan_freq = htole16(ic->ic_curchan->ic_freq);
-               tap->wr_chan_flags = htole16(ic->ic_curchan->ic_flags);
+               tap->wr_flags = 0;
                tap->wr_dbm_antsignal = (int8_t)rssi;
        }
 

Modified: stable/11/sys/dev/usb/wlan/if_urtwvar.h
==============================================================================
--- stable/11/sys/dev/usb/wlan/if_urtwvar.h     Thu Mar 28 09:18:22 2019        
(r345635)
+++ stable/11/sys/dev/usb/wlan/if_urtwvar.h     Thu Mar 28 09:50:25 2019        
(r345636)
@@ -56,6 +56,7 @@ typedef STAILQ_HEAD(, urtw_data) urtw_datahead;
 struct urtw_rx_radiotap_header {
        struct ieee80211_radiotap_header wr_ihdr;
        uint8_t         wr_flags;
+       uint8_t         wr_pad;
        uint16_t        wr_chan_freq;
        uint16_t        wr_chan_flags;
        int8_t          wr_dbm_antsignal;
@@ -69,9 +70,10 @@ struct urtw_rx_radiotap_header {
 struct urtw_tx_radiotap_header {
        struct ieee80211_radiotap_header wt_ihdr;
        uint8_t         wt_flags;
+       uint8_t         wt_pad;
        uint16_t        wt_chan_freq;
        uint16_t        wt_chan_flags;
-} __packed __aligned(8);
+} __packed;
 
 #define URTW_TX_RADIOTAP_PRESENT                                       \
        ((1 << IEEE80211_RADIOTAP_FLAGS) |                              \

Modified: stable/11/sys/dev/usb/wlan/if_zydreg.h
==============================================================================
--- stable/11/sys/dev/usb/wlan/if_zydreg.h      Thu Mar 28 09:18:22 2019        
(r345635)
+++ stable/11/sys/dev/usb/wlan/if_zydreg.h      Thu Mar 28 09:50:25 2019        
(r345636)
@@ -1200,7 +1200,7 @@ struct zyd_tx_radiotap_header {
        uint8_t                 wt_rate;
        uint16_t                wt_chan_freq;
        uint16_t                wt_chan_flags;
-} __packed __aligned(8);
+} __packed;
 
 #define ZYD_TX_RADIOTAP_PRESENT                                                
\
        ((1 << IEEE80211_RADIOTAP_FLAGS) |                              \

Modified: stable/11/sys/dev/wi/if_wireg.h
==============================================================================
--- stable/11/sys/dev/wi/if_wireg.h     Thu Mar 28 09:18:22 2019        
(r345635)
+++ stable/11/sys/dev/wi/if_wireg.h     Thu Mar 28 09:50:25 2019        
(r345636)
@@ -707,7 +707,7 @@ struct wi_rx_radiotap_header {
        u_int16_t       wr_chan_flags;
        u_int8_t        wr_antsignal;
        u_int8_t        wr_antnoise;
-};
+} __packed __aligned(8);
 
 #define WI_TX_RADIOTAP_PRESENT \
        ((1 << IEEE80211_RADIOTAP_FLAGS) | \
@@ -720,5 +720,5 @@ struct wi_tx_radiotap_header {
        u_int8_t        wt_rate;
        u_int16_t       wt_chan_freq;
        u_int16_t       wt_chan_flags;
-};
+} __packed;
 #endif /* IEEE80211_RADIOTAP_F_CFP */

Modified: stable/11/sys/dev/wpi/if_wpivar.h
==============================================================================
--- stable/11/sys/dev/wpi/if_wpivar.h   Thu Mar 28 09:18:22 2019        
(r345635)
+++ stable/11/sys/dev/wpi/if_wpivar.h   Thu Mar 28 09:50:25 2019        
(r345636)
@@ -26,7 +26,7 @@ struct wpi_rx_radiotap_header {
        int8_t          wr_dbm_antsignal;
        int8_t          wr_dbm_antnoise;
        uint8_t         wr_antenna;
-} __packed;
+} __packed __aligned(8);
 
 #define WPI_RX_RADIOTAP_PRESENT                                                
\
        ((1 << IEEE80211_RADIOTAP_TSFT) |                               \

Modified: stable/11/sys/dev/wtap/if_wtapioctl.h
==============================================================================
--- stable/11/sys/dev/wtap/if_wtapioctl.h       Thu Mar 28 09:18:22 2019        
(r345635)
+++ stable/11/sys/dev/wtap/if_wtapioctl.h       Thu Mar 28 09:50:25 2019        
(r345636)
@@ -157,7 +157,7 @@ struct wtap_rx_radiotap_header {
        u_int8_t        wr_chan_ieee;
        int8_t          wr_chan_maxpow;
 #endif
-} __packed;
+} __packed __aligned(8);
 
 #define WTAP_TX_RADIOTAP_PRESENT (             \
        0)
@@ -165,7 +165,6 @@ struct wtap_rx_radiotap_header {
 struct wtap_tx_radiotap_header {
        struct ieee80211_radiotap_header wt_ihdr;
 #if 0
-       u_int64_t       wt_tsf;
        u_int8_t        wt_flags;
        u_int8_t        wt_rate;
        u_int8_t        wt_txpower;
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to