3 @@ -10476,11 +10476,11 @@ set_node_txpower(void *arg, struct ieee8
4 * XXX: this function needs some locking to avoid being called
5 * twice/interrupted. Returns the value actually stored. */
7 -ath_set_clamped_maxtxpower(struct ath_softc *sc,
8 - u_int32_t new_clamped_maxtxpower)
9 +ath_set_clamped_maxtxpower(struct ath_softc *sc, u_int32_t new_txpwr)
11 - new_clamped_maxtxpower -= sc->sc_poweroffset;
12 - (void)ath_hal_settxpowlimit(sc->sc_ah, new_clamped_maxtxpower);
13 + new_txpwr = ((new_txpwr < sc->sc_poweroffset) ? 0 :
14 + new_txpwr - sc->sc_poweroffset);
15 + (void)ath_hal_settxpowlimit(sc->sc_ah, new_txpwr);
16 return ath_get_clamped_maxtxpower(sc);
19 @@ -11031,6 +11031,7 @@ enum {
27 @@ -11311,6 +11312,9 @@ ATH_SYSCTL_DECL(ath_sysctl_halparam, ctl
28 ath_debug_global = (val & ATH_DEBUG_GLOBAL);
31 + case ATH_POWEROFFSET:
32 + sc->sc_poweroffset = val;
37 @@ -11478,6 +11482,9 @@ ATH_SYSCTL_DECL(ath_sysctl_halparam, ctl
39 val = sc->sc_debug | ath_debug_global;
41 + case ATH_POWEROFFSET:
42 + val = sc->sc_poweroffset;
45 val = sc->sc_txantenna;
47 @@ -11619,6 +11626,12 @@ static const ctl_table ath_sysctl_templa
50 { .ctl_name = CTL_AUTO,
51 + .procname = "poweroffset",
53 + .proc_handler = ath_sysctl_halparam,
54 + .extra2 = (void *)ATH_POWEROFFSET,
56 + { .ctl_name = CTL_AUTO,
57 .procname = "txantenna",
59 .proc_handler = ath_sysctl_halparam,