From 5034ae5d5d8d3641b807406e1cc142b3a281b33e Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Sun, 31 May 2009 14:45:04 +0000 Subject: [PATCH] madwifi: if a txpower value below the poweroffset is requested, set the internal txpower to 0db SVN-Revision: 16234 --- .../madwifi/patches/438-poweroffset_sysctl.patch | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/package/madwifi/patches/438-poweroffset_sysctl.patch b/package/madwifi/patches/438-poweroffset_sysctl.patch index 2a6d27cc5d..662f2b09d2 100644 --- a/package/madwifi/patches/438-poweroffset_sysctl.patch +++ b/package/madwifi/patches/438-poweroffset_sysctl.patch @@ -1,5 +1,21 @@ --- a/ath/if_ath.c +++ b/ath/if_ath.c +@@ -10474,11 +10474,11 @@ set_node_txpower(void *arg, struct ieee8 + * XXX: this function needs some locking to avoid being called + * twice/interrupted. Returns the value actually stored. */ + static u_int32_t +-ath_set_clamped_maxtxpower(struct ath_softc *sc, +- u_int32_t new_clamped_maxtxpower) ++ath_set_clamped_maxtxpower(struct ath_softc *sc, u_int32_t new_txpwr) + { +- new_clamped_maxtxpower -= sc->sc_poweroffset; +- (void)ath_hal_settxpowlimit(sc->sc_ah, new_clamped_maxtxpower); ++ new_txpwr = ((new_txpwr < sc->sc_poweroffset) ? 0 : ++ new_txpwr - sc->sc_poweroffset); ++ (void)ath_hal_settxpowlimit(sc->sc_ah, new_txpwr); + return ath_get_clamped_maxtxpower(sc); + } + @@ -11029,6 +11029,7 @@ enum { ATH_DEBUG, ATH_TXANTENNA, -- 2.30.2