• Bruno Randolf's avatar
    ath5k: Track current TX power separately from max TX power · 51f00622
    Bruno Randolf authored
    Add a new variable to keep track of the currently configured tx power. Before
    max_pwr was re-used for keeping the maximum allowed power as well as the
    current configuration. Doing a min() on it allows you to lower the txpower, but
    how would you be able to make it higher again?
    
    This patch fixes that by adding a new variable ah_cur_pwr which is used instead
    of txp_max_pwr to keep the current configuration. txp_max_pwr is used to check
    if we are within the limits.
    
    Another problem fixed by this patch is that it avoids setting a zero txpower
    when things are initialized first and the current power is not yet set.
    Signed-off-by: default avatarBruno Randolf <br1@einfach.org>
    Acked-by: default avatarNick Kossifidis <mickflemm@gmail.com>
    Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
    51f00622
ath5k.h 45.1 KB