svn commit: r249569 - head/sys/dev/ath
Adrian Chadd
adrian at FreeBSD.org
Tue Apr 16 21:26:45 UTC 2013
Author: adrian
Date: Tue Apr 16 21:26:44 2013
New Revision: 249569
URL: http://svnweb.freebsd.org/changeset/base/249569
Log:
Use the new net80211 method to fetch the node TX power, rather than
directly referencing ni->ni_txpower.
This provides the hardware with a slightly more accurate idea of
the maximum TX power to be using.
This is part of a series to get per-packet TPC to work (better).
Tested:
* AR5416, hostap mode
Modified:
head/sys/dev/ath/if_ath_beacon.c
head/sys/dev/ath/if_ath_tx.c
Modified: head/sys/dev/ath/if_ath_beacon.c
==============================================================================
--- head/sys/dev/ath/if_ath_beacon.c Tue Apr 16 20:36:32 2013 (r249568)
+++ head/sys/dev/ath/if_ath_beacon.c Tue Apr 16 21:26:44 2013 (r249569)
@@ -322,7 +322,7 @@ ath_beacon_setup(struct ath_softc *sc, s
, m->m_len + IEEE80211_CRC_LEN /* frame length */
, sizeof(struct ieee80211_frame)/* header length */
, HAL_PKT_TYPE_BEACON /* Atheros packet type */
- , ni->ni_txpower /* txpower XXX */
+ , ieee80211_get_node_txpower(ni) /* txpower XXX */
, rate, 1 /* series 0 rate/tries */
, HAL_TXKEYIX_INVALID /* no encryption */
, antenna /* antenna mode */
Modified: head/sys/dev/ath/if_ath_tx.c
==============================================================================
--- head/sys/dev/ath/if_ath_tx.c Tue Apr 16 20:36:32 2013 (r249568)
+++ head/sys/dev/ath/if_ath_tx.c Tue Apr 16 21:26:44 2013 (r249569)
@@ -1722,7 +1722,7 @@ ath_tx_normal_setup(struct ath_softc *sc
if (isfrag)
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_txpower = ni->ni_txpower;
+ sc->sc_tx_th.wt_txpower = ieee80211_get_node_txpower(ni);
sc->sc_tx_th.wt_antenna = sc->sc_txantenna;
ieee80211_radiotap_tx(vap, m0);
@@ -1743,7 +1743,7 @@ ath_tx_normal_setup(struct ath_softc *sc
bf->bf_state.bfs_pktlen = pktlen;
bf->bf_state.bfs_hdrlen = hdrlen;
bf->bf_state.bfs_atype = atype;
- bf->bf_state.bfs_txpower = ni->ni_txpower;
+ bf->bf_state.bfs_txpower = ieee80211_get_node_txpower(ni);
bf->bf_state.bfs_txrate0 = txrate;
bf->bf_state.bfs_try0 = try0;
bf->bf_state.bfs_keyix = keyix;
@@ -2088,7 +2088,8 @@ ath_tx_raw_start(struct ath_softc *sc, s
if (m0->m_flags & M_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_txpower = ni->ni_txpower;
+ sc->sc_tx_th.wt_txpower = MIN(params->ibp_power,
+ ieee80211_get_node_txpower(ni));
sc->sc_tx_th.wt_antenna = sc->sc_txantenna;
ieee80211_radiotap_tx(vap, m0);
@@ -2104,7 +2105,8 @@ ath_tx_raw_start(struct ath_softc *sc, s
bf->bf_state.bfs_pktlen = pktlen;
bf->bf_state.bfs_hdrlen = hdrlen;
bf->bf_state.bfs_atype = atype;
- bf->bf_state.bfs_txpower = params->ibp_power;
+ bf->bf_state.bfs_txpower = MIN(params->ibp_power,
+ ieee80211_get_node_txpower(ni));
bf->bf_state.bfs_txrate0 = txrate;
bf->bf_state.bfs_try0 = try0;
bf->bf_state.bfs_keyix = keyix;
More information about the svn-src-all
mailing list