X-Git-Url: https://git.rohieb.name/openwrt.git/blobdiff_plain/a5fbb602d476c54718ceff0576772f841def79f5..2c6e69a1c56a77df431f23ae01d27b59880c2ec0:/package/madwifi/patches/414-txpower.patch diff --git a/package/madwifi/patches/414-txpower.patch b/package/madwifi/patches/414-txpower.patch index 3e7e315d1..753cd010f 100644 --- a/package/madwifi/patches/414-txpower.patch +++ b/package/madwifi/patches/414-txpower.patch @@ -12,7 +12,7 @@ KASSERT(c->ic_ieee < IEEE80211_CHAN_MAX, ("channel with bogus ieee number %u", c->ic_ieee)); setbit(ic->ic_chan_avail, c->ic_ieee); -+ ic->ic_max_txpower = max(ic->ic_max_txpower, (u16) c->ic_maxpower * 2); ++ ic->ic_max_txpower = max(ic->ic_max_txpower, (u16) (c->ic_maxpower * 2)); if (c->ic_scanflags & IEEE80211_NOSCAN_DEFAULT) c->ic_scanflags |= IEEE80211_NOSCAN_SET; @@ -63,7 +63,7 @@ + power = ic->ic_max_txpower; + if (ic->ic_bsschan && (ic->ic_bsschan != IEEE80211_CHAN_ANYC)) -+ power = min(power, ic->ic_bsschan->ic_maxpower); ++ power = min(power, (u_int16_t) ic->ic_bsschan->ic_maxpower); + /* txpower (128 values, but will print out only IW_MAX_TXPOWER) */ - range->num_txpower = (ic->ic_txpowlimit >= 8) ? IW_MAX_TXPOWER : ic->ic_txpowlimit; @@ -79,8 +79,12 @@ - (IW_MAX_TXPOWER - i - 1) * step; range->txpower_capa = IW_TXPOW_DBM; -@@ -1382,10 +1388,8 @@ ieee80211_ioctl_siwtxpow(struct net_devi - disabled = (fixed && vap->iv_bss->ni_txpower == 0); +@@ -1379,13 +1385,11 @@ ieee80211_ioctl_siwtxpow(struct net_devi + int fixed, disabled; + + fixed = (ic->ic_flags & IEEE80211_F_TXPOW_FIXED); +- disabled = (fixed && vap->iv_bss->ni_txpower == 0); ++ disabled = (fixed && ic->ic_txpowlimit == 0); if (rrq->disabled) { if (!disabled) { - if ((ic->ic_caps & IEEE80211_C_TXPMGT) == 0) @@ -125,7 +129,7 @@ ic->ic_flags &= ~IEEE80211_F_TXPOW_FIXED; } done: -@@ -1588,9 +1574,22 @@ ieee80211_ioctl_giwtxpow(struct net_devi +@@ -1588,9 +1574,23 @@ ieee80211_ioctl_giwtxpow(struct net_devi { struct ieee80211vap *vap = dev->priv; struct ieee80211com *ic = vap->iv_ic; @@ -136,9 +140,10 @@ + struct ieee80211_channel *c; + u_int16_t txp = ic->ic_max_txpower; + -+ if (ic->ic_bsschan && (ic->ic_bsschan != IEEE80211_CHAN_ANYC)) -+ txp = min(txp, ic->ic_bsschan->ic_maxpower); -+ } else if (ic->ic_cur_txpower > 0) { ++ if (ic->ic_bsschan && (ic->ic_bsschan != IEEE80211_CHAN_ANYC)) { ++ txp = min(txp, (u16) ic->ic_bsschan->ic_maxpower); ++ } ++ if (ic->ic_cur_txpower > 0) { + txp = min(txp, ic->ic_cur_txpower); + } + if (ic->ic_flags & IEEE80211_F_TXPOW_FIXED) { @@ -161,7 +166,7 @@ static void ath_poll_disable(struct net_device *dev); static void ath_poll_enable(struct net_device *dev); -@@ -3159,7 +3158,7 @@ ath_tx_startraw(struct net_device *dev, +@@ -3168,7 +3167,7 @@ ath_tx_startraw(struct net_device *dev, try0 = ph->try0; rt = sc->sc_currates; txrate = dot11_to_ratecode(sc, rt, ph->rate0); @@ -170,7 +175,7 @@ hdrlen = ieee80211_anyhdrsize(wh); pktlen = skb->len + IEEE80211_CRC_LEN; -@@ -8381,7 +8380,7 @@ ath_tx_start(struct net_device *dev, str +@@ -8394,7 +8393,7 @@ ath_tx_start(struct net_device *dev, str pktlen, /* packet length */ hdrlen, /* header length */ atype, /* Atheros packet type */ @@ -179,7 +184,7 @@ txrate, try0, /* series 0 rate/tries */ keyix, /* key cache index */ antenna, /* antenna mode */ -@@ -10364,59 +10363,16 @@ ath_get_clamped_maxtxpower(struct ath_so +@@ -10387,59 +10386,16 @@ ath_get_clamped_maxtxpower(struct ath_so /* XXX: this function needs some locking to avoid being called * twice/interrupted */