Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/ath/if_ath_tx.c
Show First 20 Lines • Show All 1,521 Lines • ▼ Show 20 Lines | |||||
* Note that this may cause the mbuf to be reallocated, so | * Note that this may cause the mbuf to be reallocated, so | ||||
* m0 may not be valid. | * m0 may not be valid. | ||||
*/ | */ | ||||
static int | static int | ||||
ath_tx_normal_setup(struct ath_softc *sc, struct ieee80211_node *ni, | ath_tx_normal_setup(struct ath_softc *sc, struct ieee80211_node *ni, | ||||
struct ath_buf *bf, struct mbuf *m0, struct ath_txq *txq) | struct ath_buf *bf, struct mbuf *m0, struct ath_txq *txq) | ||||
{ | { | ||||
struct ieee80211vap *vap = ni->ni_vap; | struct ieee80211vap *vap = ni->ni_vap; | ||||
struct ath_hal *ah = sc->sc_ah; | |||||
struct ieee80211com *ic = &sc->sc_ic; | struct ieee80211com *ic = &sc->sc_ic; | ||||
const struct chanAccParams *cap = &ic->ic_wme.wme_chanParams; | const struct chanAccParams *cap = &ic->ic_wme.wme_chanParams; | ||||
int error, iswep, ismcast, isfrag, ismrr; | int error, iswep, ismcast, isfrag, ismrr; | ||||
int keyix, hdrlen, pktlen, try0 = 0; | int keyix, hdrlen, pktlen, try0 = 0; | ||||
u_int8_t rix = 0, txrate = 0; | u_int8_t rix = 0, txrate = 0; | ||||
struct ath_desc *ds; | struct ath_desc *ds; | ||||
struct ieee80211_frame *wh; | struct ieee80211_frame *wh; | ||||
u_int subtype, flags; | u_int subtype, flags; | ||||
▲ Show 20 Lines • Show All 230 Lines • ▼ Show 20 Lines | #endif | ||||
*/ | */ | ||||
m0->m_nextpkt = NULL; | m0->m_nextpkt = NULL; | ||||
if (IFF_DUMPPKTS(sc, ATH_DEBUG_XMIT)) | if (IFF_DUMPPKTS(sc, ATH_DEBUG_XMIT)) | ||||
ieee80211_dump_pkt(ic, mtod(m0, const uint8_t *), m0->m_len, | ieee80211_dump_pkt(ic, mtod(m0, const uint8_t *), m0->m_len, | ||||
sc->sc_hwmap[rix].ieeerate, -1); | sc->sc_hwmap[rix].ieeerate, -1); | ||||
if (ieee80211_radiotap_active_vap(vap)) { | if (ieee80211_radiotap_active_vap(vap)) { | ||||
u_int64_t tsf = ath_hal_gettsf64(ah); | |||||
sc->sc_tx_th.wt_tsf = htole64(tsf); | |||||
sc->sc_tx_th.wt_flags = sc->sc_hwmap[rix].txflags; | sc->sc_tx_th.wt_flags = sc->sc_hwmap[rix].txflags; | ||||
if (iswep) | if (iswep) | ||||
sc->sc_tx_th.wt_flags |= IEEE80211_RADIOTAP_F_WEP; | sc->sc_tx_th.wt_flags |= IEEE80211_RADIOTAP_F_WEP; | ||||
if (isfrag) | if (isfrag) | ||||
sc->sc_tx_th.wt_flags |= IEEE80211_RADIOTAP_F_FRAG; | sc->sc_tx_th.wt_flags |= IEEE80211_RADIOTAP_F_FRAG; | ||||
sc->sc_tx_th.wt_rate = sc->sc_hwmap[rix].ieeerate; | sc->sc_tx_th.wt_rate = sc->sc_hwmap[rix].ieeerate; | ||||
sc->sc_tx_th.wt_txpower = ieee80211_get_node_txpower(ni); | sc->sc_tx_th.wt_txpower = ieee80211_get_node_txpower(ni); | ||||
sc->sc_tx_th.wt_antenna = sc->sc_txantenna; | sc->sc_tx_th.wt_antenna = sc->sc_txantenna; | ||||
▲ Show 20 Lines • Show All 264 Lines • ▼ Show 20 Lines | |||||
} | } | ||||
static int | static int | ||||
ath_tx_raw_start(struct ath_softc *sc, struct ieee80211_node *ni, | ath_tx_raw_start(struct ath_softc *sc, struct ieee80211_node *ni, | ||||
struct ath_buf *bf, struct mbuf *m0, | struct ath_buf *bf, struct mbuf *m0, | ||||
const struct ieee80211_bpf_params *params) | const struct ieee80211_bpf_params *params) | ||||
{ | { | ||||
struct ieee80211com *ic = &sc->sc_ic; | struct ieee80211com *ic = &sc->sc_ic; | ||||
struct ath_hal *ah = sc->sc_ah; | |||||
struct ieee80211vap *vap = ni->ni_vap; | struct ieee80211vap *vap = ni->ni_vap; | ||||
int error, ismcast, ismrr; | int error, ismcast, ismrr; | ||||
int keyix, hdrlen, pktlen, try0, txantenna; | int keyix, hdrlen, pktlen, try0, txantenna; | ||||
u_int8_t rix, txrate; | u_int8_t rix, txrate; | ||||
struct ieee80211_frame *wh; | struct ieee80211_frame *wh; | ||||
u_int flags; | u_int flags; | ||||
HAL_PKT_TYPE atype; | HAL_PKT_TYPE atype; | ||||
const HAL_RATE_TABLE *rt; | const HAL_RATE_TABLE *rt; | ||||
▲ Show 20 Lines • Show All 118 Lines • ▼ Show 20 Lines | #endif | ||||
*/ | */ | ||||
atype = HAL_PKT_TYPE_PSPOLL; | atype = HAL_PKT_TYPE_PSPOLL; | ||||
if (IFF_DUMPPKTS(sc, ATH_DEBUG_XMIT)) | if (IFF_DUMPPKTS(sc, ATH_DEBUG_XMIT)) | ||||
ieee80211_dump_pkt(ic, mtod(m0, caddr_t), m0->m_len, | ieee80211_dump_pkt(ic, mtod(m0, caddr_t), m0->m_len, | ||||
sc->sc_hwmap[rix].ieeerate, -1); | sc->sc_hwmap[rix].ieeerate, -1); | ||||
if (ieee80211_radiotap_active_vap(vap)) { | if (ieee80211_radiotap_active_vap(vap)) { | ||||
u_int64_t tsf = ath_hal_gettsf64(ah); | |||||
sc->sc_tx_th.wt_tsf = htole64(tsf); | |||||
sc->sc_tx_th.wt_flags = sc->sc_hwmap[rix].txflags; | sc->sc_tx_th.wt_flags = sc->sc_hwmap[rix].txflags; | ||||
if (wh->i_fc[1] & IEEE80211_FC1_PROTECTED) | if (wh->i_fc[1] & IEEE80211_FC1_PROTECTED) | ||||
sc->sc_tx_th.wt_flags |= IEEE80211_RADIOTAP_F_WEP; | sc->sc_tx_th.wt_flags |= IEEE80211_RADIOTAP_F_WEP; | ||||
if (m0->m_flags & M_FRAG) | if (m0->m_flags & M_FRAG) | ||||
sc->sc_tx_th.wt_flags |= IEEE80211_RADIOTAP_F_FRAG; | sc->sc_tx_th.wt_flags |= IEEE80211_RADIOTAP_F_FRAG; | ||||
sc->sc_tx_th.wt_rate = sc->sc_hwmap[rix].ieeerate; | sc->sc_tx_th.wt_rate = sc->sc_hwmap[rix].ieeerate; | ||||
sc->sc_tx_th.wt_txpower = MIN(params->ibp_power, | sc->sc_tx_th.wt_txpower = MIN(params->ibp_power, | ||||
ieee80211_get_node_txpower(ni)); | ieee80211_get_node_txpower(ni)); | ||||
▲ Show 20 Lines • Show All 4,001 Lines • Show Last 20 Lines |