diff options
| author | Sam Leffler <sam@FreeBSD.org> | 2004-04-01 00:38:45 +0000 |
|---|---|---|
| committer | Sam Leffler <sam@FreeBSD.org> | 2004-04-01 00:38:45 +0000 |
| commit | 2f1ad18b34dfc1fccb48307f231b0ed2cbf268fa (patch) | |
| tree | d7cf9a83baabf9976c2b03fef74b9ddd06a31392 /sys/dev/ath | |
| parent | 8d798b52fdfc38cd3d4fcbb244e62851115e637c (diff) | |
Notes
Diffstat (limited to 'sys/dev/ath')
| -rw-r--r-- | sys/dev/ath/if_ath.c | 17 | ||||
| -rw-r--r-- | sys/dev/ath/if_athvar.h | 2 |
2 files changed, 13 insertions, 6 deletions
diff --git a/sys/dev/ath/if_ath.c b/sys/dev/ath/if_ath.c index 3597c52fef8e..9d6b311a662f 100644 --- a/sys/dev/ath/if_ath.c +++ b/sys/dev/ath/if_ath.c @@ -339,15 +339,20 @@ ath_attach(u_int16_t devid, struct ath_softc *sc) &sc->sc_drvbpf); /* * Initialize constant fields. + * XXX make header lengths a multiple of 32-bits so subsequent + * headers are properly aligned; this is a kludge to keep + * certain applications happy. * * NB: the channel is setup each time we transition to the * RUN state to avoid filling it in for each frame. */ - sc->sc_tx_th.wt_ihdr.it_len = sizeof(sc->sc_tx_th); - sc->sc_tx_th.wt_ihdr.it_present = ATH_TX_RADIOTAP_PRESENT; + sc->sc_tx_th_len = roundup(sizeof(sc->sc_tx_th), sizeof(u_int32_t)); + sc->sc_tx_th.wt_ihdr.it_len = htole16(sc->sc_tx_th_len); + sc->sc_tx_th.wt_ihdr.it_present = htole32(ATH_TX_RADIOTAP_PRESENT); - sc->sc_rx_th.wr_ihdr.it_len = sizeof(sc->sc_rx_th); - sc->sc_rx_th.wr_ihdr.it_present = ATH_RX_RADIOTAP_PRESENT; + sc->sc_rx_th_len = roundup(sizeof(sc->sc_rx_th), sizeof(u_int32_t)); + sc->sc_rx_th.wr_ihdr.it_len = htole16(sc->sc_rx_th_len); + sc->sc_rx_th.wr_ihdr.it_present = htole32(ATH_RX_RADIOTAP_PRESENT); return 0; bad: @@ -1726,7 +1731,7 @@ ath_rx_proc(void *arg, int npending) /* XXX TSF */ bpf_mtap2(sc->sc_drvbpf, - &sc->sc_rx_th, sizeof(sc->sc_rx_th), m); + &sc->sc_rx_th, sc->sc_rx_th_len, m); } m_adj(m, -IEEE80211_CRC_LEN); @@ -2070,7 +2075,7 @@ ath_tx_start(struct ath_softc *sc, struct ieee80211_node *ni, struct ath_buf *bf sc->sc_tx_th.wt_antenna = antenna; bpf_mtap2(sc->sc_drvbpf, - &sc->sc_tx_th, sizeof(sc->sc_tx_th), m0); + &sc->sc_tx_th, sc->sc_tx_th_len, m0); } /* diff --git a/sys/dev/ath/if_athvar.h b/sys/dev/ath/if_athvar.h index 13e7a60d32bb..4bf5287ffc4f 100644 --- a/sys/dev/ath/if_athvar.h +++ b/sys/dev/ath/if_athvar.h @@ -115,10 +115,12 @@ struct ath_softc { struct ath_tx_radiotap_header th; u_int8_t pad[64]; } u_tx_rt; + int sc_tx_th_len; union { struct ath_rx_radiotap_header th; u_int8_t pad[64]; } u_rx_rt; + int sc_rx_th_len; struct ath_desc *sc_desc; /* TX/RX descriptors */ bus_dma_segment_t sc_dseg; |
