Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 247670
b: refs/heads/master
c: b85c573
h: refs/heads/master
v: v3
  • Loading branch information
Mohammed Shafi Shajakhan authored and John W. Linville committed May 16, 2011
1 parent d67eedb commit fef0deb
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 2 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: 8afbcc8bfb549a522298fa4a31ee5155c2b5f7a0
refs/heads/master: b85c5734f00886ee0f33ef4d0038ed9a278eefce
31 changes: 30 additions & 1 deletion trunk/drivers/net/wireless/ath/ath9k/recv.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,33 @@ static inline bool ath_is_alt_ant_ratio_better(int alt_ratio, int maxdelta,
(alt_rssi_avg > main_rssi_avg + mindelta)) && (pkt_count > 50);
}

static inline bool ath_ant_div_comb_alt_check(u8 div_group, int alt_ratio,
int curr_main_set, int curr_alt_set,
int alt_rssi_avg, int main_rssi_avg)
{
bool result = false;
switch (div_group) {
case 0:
if (alt_ratio > ATH_ANT_DIV_COMB_ALT_ANT_RATIO)
result = true;
break;
case 1:
if ((((curr_main_set == ATH_ANT_DIV_COMB_LNA2) &&
(curr_alt_set == ATH_ANT_DIV_COMB_LNA1) &&
(alt_rssi_avg >= (main_rssi_avg - 5))) ||
((curr_main_set == ATH_ANT_DIV_COMB_LNA1) &&
(curr_alt_set == ATH_ANT_DIV_COMB_LNA2) &&
(alt_rssi_avg >= (main_rssi_avg - 2)))) &&
(alt_rssi_avg >= 4))
result = true;
else
result = false;
break;
}

return result;
}

static inline bool ath9k_check_auto_sleep(struct ath_softc *sc)
{
return sc->ps_enabled &&
Expand Down Expand Up @@ -1413,7 +1440,9 @@ static void ath_ant_comb_scan(struct ath_softc *sc, struct ath_rx_status *rs)
}

if (!antcomb->scan) {
if (alt_ratio > ATH_ANT_DIV_COMB_ALT_ANT_RATIO) {
if (ath_ant_div_comb_alt_check(div_ant_conf.div_group,
alt_ratio, curr_main_set, curr_alt_set,
alt_rssi_avg, main_rssi_avg)) {
if (curr_alt_set == ATH_ANT_DIV_COMB_LNA2) {
/* Switch main and alt LNA */
div_ant_conf.main_lna_conf =
Expand Down

0 comments on commit fef0deb

Please sign in to comment.