Author: avos
Date: Mon Mar 11 01:27:01 2019
New Revision: 344990
URL: https://svnweb.freebsd.org/changeset/base/344990

Log:
  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.
  
  Tested with Netgear WG111 v3 (urtw(4)), STA mode.
  
  MFC after:    2 weeks

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

Modified: head/share/man/man9/ieee80211_radiotap.9
==============================================================================
--- head/share/man/man9/ieee80211_radiotap.9    Mon Mar 11 01:12:23 2019        
(r344989)
+++ head/share/man/man9/ieee80211_radiotap.9    Mon Mar 11 01:27:01 2019        
(r344990)
@@ -27,7 +27,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd August 4, 2009
+.Dd March 11, 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: head/sys/dev/ath/if_athioctl.h
==============================================================================
--- head/sys/dev/ath/if_athioctl.h      Mon Mar 11 01:12:23 2019        
(r344989)
+++ head/sys/dev/ath/if_athioctl.h      Mon Mar 11 01:27:01 2019        
(r344990)
@@ -373,7 +373,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: head/sys/dev/bwi/if_bwi.c
==============================================================================
--- head/sys/dev/bwi/if_bwi.c   Mon Mar 11 01:12:23 2019        (r344989)
+++ head/sys/dev/bwi/if_bwi.c   Mon Mar 11 01:27:01 2019        (r344990)
@@ -1729,15 +1729,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: head/sys/dev/bwi/if_bwivar.h
==============================================================================
--- head/sys/dev/bwi/if_bwivar.h        Mon Mar 11 01:12:23 2019        
(r344989)
+++ head/sys/dev/bwi/if_bwivar.h        Mon Mar 11 01:27:01 2019        
(r344990)
@@ -513,7 +513,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) |               \
@@ -533,7 +533,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: head/sys/dev/bwn/if_bwn.c
==============================================================================
--- head/sys/dev/bwn/if_bwn.c   Mon Mar 11 01:12:23 2019        (r344989)
+++ head/sys/dev/bwn/if_bwn.c   Mon Mar 11 01:27:01 2019        (r344990)
@@ -2001,14 +2001,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: head/sys/dev/bwn/if_bwnvar.h
==============================================================================
--- head/sys/dev/bwn/if_bwnvar.h        Mon Mar 11 01:12:23 2019        
(r344989)
+++ head/sys/dev/bwn/if_bwnvar.h        Mon Mar 11 01:27:01 2019        
(r344990)
@@ -570,7 +570,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)         | \
@@ -588,7 +588,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: head/sys/dev/ipw/if_ipwvar.h
==============================================================================
--- head/sys/dev/ipw/if_ipwvar.h        Mon Mar 11 01:12:23 2019        
(r344989)
+++ head/sys/dev/ipw/if_ipwvar.h        Mon Mar 11 01:27:01 2019        
(r344990)
@@ -57,11 +57,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) |                              \
@@ -72,9 +73,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: head/sys/dev/iwi/if_iwivar.h
==============================================================================
--- head/sys/dev/iwi/if_iwivar.h        Mon Mar 11 01:12:23 2019        
(r344989)
+++ head/sys/dev/iwi/if_iwivar.h        Mon Mar 11 01:27:01 2019        
(r344990)
@@ -38,7 +38,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) |                              \
@@ -51,9 +51,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: head/sys/dev/iwm/if_iwmvar.h
==============================================================================
--- head/sys/dev/iwm/if_iwmvar.h        Mon Mar 11 01:12:23 2019        
(r344989)
+++ head/sys/dev/iwm/if_iwmvar.h        Mon Mar 11 01:27:01 2019        
(r344990)
@@ -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: head/sys/dev/iwn/if_iwn.c
==============================================================================
--- head/sys/dev/iwn/if_iwn.c   Mon Mar 11 01:12:23 2019        (r344989)
+++ head/sys/dev/iwn/if_iwn.c   Mon Mar 11 01:27:01 2019        (r344990)
@@ -9102,18 +9102,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: head/sys/dev/iwn/if_iwnvar.h
==============================================================================
--- head/sys/dev/iwn/if_iwnvar.h        Mon Mar 11 01:12:23 2019        
(r344989)
+++ head/sys/dev/iwn/if_iwnvar.h        Mon Mar 11 01:27:01 2019        
(r344990)
@@ -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: head/sys/dev/malo/if_maloioctl.h
==============================================================================
--- head/sys/dev/malo/if_maloioctl.h    Mon Mar 11 01:12:23 2019        
(r344989)
+++ head/sys/dev/malo/if_maloioctl.h    Mon Mar 11 01:27:01 2019        
(r344990)
@@ -93,7 +93,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)         | \
@@ -111,6 +111,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: head/sys/dev/mwl/if_mwlioctl.h
==============================================================================
--- head/sys/dev/mwl/if_mwlioctl.h      Mon Mar 11 01:12:23 2019        
(r344989)
+++ head/sys/dev/mwl/if_mwlioctl.h      Mon Mar 11 01:27:01 2019        
(r344990)
@@ -115,7 +115,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)         | \
@@ -133,6 +133,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: head/sys/dev/otus/if_otus.c
==============================================================================
--- head/sys/dev/otus/if_otus.c Mon Mar 11 01:12:23 2019        (r344989)
+++ head/sys/dev/otus/if_otus.c Mon Mar 11 01:27:01 2019        (r344990)
@@ -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: head/sys/dev/otus/if_otusreg.h
==============================================================================
--- head/sys/dev/otus/if_otusreg.h      Mon Mar 11 01:12:23 2019        
(r344989)
+++ head/sys/dev/otus/if_otusreg.h      Mon Mar 11 01:27:01 2019        
(r344990)
@@ -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: head/sys/dev/ral/rt2560var.h
==============================================================================
--- head/sys/dev/ral/rt2560var.h        Mon Mar 11 01:12:23 2019        
(r344989)
+++ head/sys/dev/ral/rt2560var.h        Mon Mar 11 01:27:01 2019        
(r344990)
@@ -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: head/sys/dev/ral/rt2661var.h
==============================================================================
--- head/sys/dev/ral/rt2661var.h        Mon Mar 11 01:12:23 2019        
(r344989)
+++ head/sys/dev/ral/rt2661var.h        Mon Mar 11 01:27:01 2019        
(r344990)
@@ -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: head/sys/dev/ral/rt2860var.h
==============================================================================
--- head/sys/dev/ral/rt2860var.h        Mon Mar 11 01:12:23 2019        
(r344989)
+++ head/sys/dev/ral/rt2860var.h        Mon Mar 11 01:27:01 2019        
(r344990)
@@ -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: head/sys/dev/rtwn/if_rtwn.c
==============================================================================
--- head/sys/dev/rtwn/if_rtwn.c Mon Mar 11 01:12:23 2019        (r344989)
+++ head/sys/dev/rtwn/if_rtwn.c Mon Mar 11 01:27:01 2019        (r344990)
@@ -1560,10 +1560,6 @@ rtwn_set_channel(struct ieee80211com *ic)
 
        RTWN_LOCK(sc);
        rtwn_set_chan(sc, c);
-       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);
        RTWN_UNLOCK(sc);
 }
 

Modified: head/sys/dev/rtwn/if_rtwnvar.h
==============================================================================
--- head/sys/dev/rtwn/if_rtwnvar.h      Mon Mar 11 01:12:23 2019        
(r344989)
+++ head/sys/dev/rtwn/if_rtwnvar.h      Mon Mar 11 01:27:01 2019        
(r344990)
@@ -62,9 +62,10 @@ 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 __aligned(8);
+} __packed;
 
 #define RTWN_TX_RADIOTAP_PRESENT                       \
        (1 << IEEE80211_RADIOTAP_FLAGS |                \

Modified: head/sys/dev/usb/wlan/if_rsu.c
==============================================================================
--- head/sys/dev/usb/wlan/if_rsu.c      Mon Mar 11 01:12:23 2019        
(r344989)
+++ head/sys/dev/usb/wlan/if_rsu.c      Mon Mar 11 01:27:01 2019        
(r344990)
@@ -2447,8 +2447,6 @@ rsu_rx_frame(struct rsu_softc *sc, struct mbuf *m)
 
                tap->wr_rate = rxs.c_rate;
                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);
        };
 
        (void) ieee80211_add_rx_params(m, &rxs);
@@ -2750,7 +2748,6 @@ rsu_tx_start(struct rsu_softc *sc, struct ieee80211_no
     struct mbuf *m0, struct rsu_data *data)
 {
        const struct ieee80211_txparam *tp = ni->ni_txparms;
-       struct ieee80211com *ic = &sc->sc_ic;
         struct ieee80211vap *vap = ni->ni_vap;
        struct ieee80211_frame *wh;
        struct ieee80211_key *k = NULL;
@@ -2894,8 +2891,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: head/sys/dev/usb/wlan/if_rsureg.h
==============================================================================
--- head/sys/dev/usb/wlan/if_rsureg.h   Mon Mar 11 01:12:23 2019        
(r344989)
+++ head/sys/dev/usb/wlan/if_rsureg.h   Mon Mar 11 01:27:01 2019        
(r344990)
@@ -800,9 +800,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: head/sys/dev/usb/wlan/if_rumvar.h
==============================================================================
--- head/sys/dev/usb/wlan/if_rumvar.h   Mon Mar 11 01:12:23 2019        
(r344989)
+++ head/sys/dev/usb/wlan/if_rumvar.h   Mon Mar 11 01:27:01 2019        
(r344990)
@@ -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: head/sys/dev/usb/wlan/if_run.c
==============================================================================
--- head/sys/dev/usb/wlan/if_run.c      Mon Mar 11 01:12:23 2019        
(r344989)
+++ head/sys/dev/usb/wlan/if_run.c      Mon Mar 11 01:27:01 2019        
(r344990)
@@ -2900,8 +2900,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);
@@ -3173,8 +3171,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: head/sys/dev/usb/wlan/if_runvar.h
==============================================================================
--- head/sys/dev/usb/wlan/if_runvar.h   Mon Mar 11 01:12:23 2019        
(r344989)
+++ head/sys/dev/usb/wlan/if_runvar.h   Mon Mar 11 01:27:01 2019        
(r344990)
@@ -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: head/sys/dev/usb/wlan/if_uathvar.h
==============================================================================
--- head/sys/dev/usb/wlan/if_uathvar.h  Mon Mar 11 01:12:23 2019        
(r344989)
+++ head/sys/dev/usb/wlan/if_uathvar.h  Mon Mar 11 01:27:01 2019        
(r344990)
@@ -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: head/sys/dev/usb/wlan/if_upgtvar.h
==============================================================================
--- head/sys/dev/usb/wlan/if_upgtvar.h  Mon Mar 11 01:12:23 2019        
(r344989)
+++ head/sys/dev/usb/wlan/if_upgtvar.h  Mon Mar 11 01:27:01 2019        
(r344990)
@@ -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: head/sys/dev/usb/wlan/if_uralvar.h
==============================================================================
--- head/sys/dev/usb/wlan/if_uralvar.h  Mon Mar 11 01:12:23 2019        
(r344989)
+++ head/sys/dev/usb/wlan/if_uralvar.h  Mon Mar 11 01:27:01 2019        
(r344990)
@@ -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: head/sys/dev/usb/wlan/if_urtw.c
==============================================================================
--- head/sys/dev/usb/wlan/if_urtw.c     Mon Mar 11 01:12:23 2019        
(r344989)
+++ head/sys/dev/usb/wlan/if_urtw.c     Mon Mar 11 01:27:01 2019        
(r344990)
@@ -1684,11 +1684,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);
        }
 
@@ -3976,9 +3972,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: head/sys/dev/usb/wlan/if_urtwvar.h
==============================================================================
--- head/sys/dev/usb/wlan/if_urtwvar.h  Mon Mar 11 01:12:23 2019        
(r344989)
+++ head/sys/dev/usb/wlan/if_urtwvar.h  Mon Mar 11 01:27:01 2019        
(r344990)
@@ -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: head/sys/dev/usb/wlan/if_zydreg.h
==============================================================================
--- head/sys/dev/usb/wlan/if_zydreg.h   Mon Mar 11 01:12:23 2019        
(r344989)
+++ head/sys/dev/usb/wlan/if_zydreg.h   Mon Mar 11 01:27:01 2019        
(r344990)
@@ -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: head/sys/dev/wi/if_wireg.h
==============================================================================
--- head/sys/dev/wi/if_wireg.h  Mon Mar 11 01:12:23 2019        (r344989)
+++ head/sys/dev/wi/if_wireg.h  Mon Mar 11 01:27:01 2019        (r344990)
@@ -709,7 +709,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) | \
@@ -722,5 +722,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: head/sys/dev/wpi/if_wpivar.h
==============================================================================
--- head/sys/dev/wpi/if_wpivar.h        Mon Mar 11 01:12:23 2019        
(r344989)
+++ head/sys/dev/wpi/if_wpivar.h        Mon Mar 11 01:27:01 2019        
(r344990)
@@ -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: head/sys/dev/wtap/if_wtapioctl.h
==============================================================================
--- head/sys/dev/wtap/if_wtapioctl.h    Mon Mar 11 01:12:23 2019        
(r344989)
+++ head/sys/dev/wtap/if_wtapioctl.h    Mon Mar 11 01:27:01 2019        
(r344990)
@@ -159,7 +159,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)
@@ -167,7 +167,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