Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 301016
b: refs/heads/master
c: 8f942b9
h: refs/heads/master
v: v3
  • Loading branch information
Gabor Juhos authored and John W. Linville committed Apr 16, 2012
1 parent 0dbed28 commit 08b191f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 14 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: ea6f792b2b893249e0eeffdb3fe0ea191eaf80d7
refs/heads/master: 8f942b9b8165eb4079d38979ec37a2bf3f983761
21 changes: 8 additions & 13 deletions trunk/drivers/net/wireless/ath/ath9k/eeprom.c
Original file line number Diff line number Diff line change
Expand Up @@ -293,9 +293,7 @@ u16 ath9k_hw_get_max_edge_power(u16 freq, struct cal_ctl_edges *pRdEdgesPower,
u16 ath9k_hw_get_scaled_power(struct ath_hw *ah, u16 power_limit,
u8 antenna_reduction)
{
u16 scaled_power;

scaled_power = power_limit - antenna_reduction;
u16 reduction = antenna_reduction;

/*
* Reduce scaled Power by number of chains active
Expand All @@ -305,22 +303,19 @@ u16 ath9k_hw_get_scaled_power(struct ath_hw *ah, u16 power_limit,
case 1:
break;
case 2:
if (scaled_power > REDUCE_SCALED_POWER_BY_TWO_CHAIN)
scaled_power -= REDUCE_SCALED_POWER_BY_TWO_CHAIN;
else
scaled_power = 0;
reduction += REDUCE_SCALED_POWER_BY_TWO_CHAIN;
break;
case 3:
if (scaled_power > REDUCE_SCALED_POWER_BY_THREE_CHAIN)
scaled_power -= REDUCE_SCALED_POWER_BY_THREE_CHAIN;
else
scaled_power = 0;
reduction += REDUCE_SCALED_POWER_BY_THREE_CHAIN;
break;
}

scaled_power = max((u16)0, scaled_power);
if (power_limit > reduction)
power_limit -= reduction;
else
power_limit = 0;

return scaled_power;
return power_limit;
}

void ath9k_hw_update_regulatory_maxpower(struct ath_hw *ah)
Expand Down

0 comments on commit 08b191f

Please sign in to comment.