ath9k: Do a quick scan only when scan_not_start is true
PATCH 1/8 ath9k: Do a quick scan only when scan_not_start is true
From: Sujith Manoharan <[email protected]>
Right now, it is being done for all cases.
--- drivers/net/wireless/ath/ath9k/antenna.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-)
drivers/net/wireless/ath/ath9k/antenna.c +4 -6
@@ -798,14 +798,12 @@ void ath_ant_comb_scan(struct ath_softc *sc, struct ath_rx_status *rs) } goto div_comb_done; } +ath_select_ant_div_from_quick_scan (antcomb, &div_ant_conf, + main_rssi_avg, alt_rssi_avg, + alt_ratio); + antcomb->quick_scan_cnt++; } -ath_select_ant_div_from_quick_scan (antcomb, &div_ant_conf, - main_rssi_avg, alt_rssi_avg, - alt_ratio); - - antcomb->quick_scan_cnt++; - div_comb_done:ath_ant_div_conf_fast_divbias (&div_ant_conf, antcomb, alt_ratio);ath9k_hw_antdiv_comb_conf_set (sc->sc_ah, &div_ant_conf);
Signature · 1 line
1.8.3.4
PATCH 2/8 ath9k: Use a subroutine to check for short scan
From: Sujith Manoharan <[email protected]>
--- drivers/net/wireless/ath/ath9k/antenna.c | 37 ++++++++++++++++++++------------ 1 file changed, 23 insertions(+), 14 deletions(-)
drivers/net/wireless/ath/ath9k/antenna.c +23 -14
@@ -579,6 +579,27 @@ static void ath_ant_div_conf_fast_divbias(struct ath_hw_antcomb_conf *ant_conf, } } +static bool ath_ant_short_scan_check (struct ath_ant_comb *antcomb) +{ +int alt_ratio; + +if (!antcomb->scan || !antcomb->alt_good) +return false; + +if (time_after (jiffies, antcomb->scan_start_time + +msecs_to_jiffies (ATH_ANT_DIV_COMB_SHORT_SCAN_INTR ))) +return true; + +if (antcomb->total_pkt_count ==ATH_ANT_DIV_COMB_SHORT_SCAN_PKTCOUNT ) { + alt_ratio = ((antcomb->alt_recv_cnt *100 ) / + antcomb->total_pkt_count); +if (alt_ratio <ATH_ANT_DIV_COMB_ALT_ANT_RATIO ) +return true; + } + +return false; +} +void ath_ant_comb_scan (struct ath_softc *sc,struct ath_rx_status *rs) {struct ath_hw_antcomb_conf div_ant_conf;
@@ -613,22 +634,10 @@ void ath_ant_comb_scan(struct ath_softc *sc, struct ath_rx_status *rs) }/* Short scan check */ -if (antcomb->scan && antcomb->alt_good) { -if (time_after (jiffies, antcomb->scan_start_time + -msecs_to_jiffies (ATH_ANT_DIV_COMB_SHORT_SCAN_INTR ))) - short_scan = true; -else -if (antcomb->total_pkt_count == -ATH_ANT_DIV_COMB_SHORT_SCAN_PKTCOUNT ) { - alt_ratio = ((antcomb->alt_recv_cnt *100 ) / - antcomb->total_pkt_count); -if (alt_ratio <ATH_ANT_DIV_COMB_ALT_ANT_RATIO ) - short_scan = true; - } - } + short_scan =ath_ant_short_scan_check (antcomb);if (((antcomb->total_pkt_count <ATH_ANT_DIV_COMB_MAX_PKTCOUNT ) || - rs->rs_moreaggr) && !short_scan) + rs->rs_moreaggr) && !short_scan)return ;if (antcomb->total_pkt_count) {
Signature · 1 line
1.8.3.4
PATCH 3/8 ath9k: Add ALT check for cards with GROUP-3 config
In reply to Sujith ManoharanFrom: Sujith Manoharan <[email protected]>
--- drivers/net/wireless/ath/ath9k/antenna.c | 50 +++++++++++++++++++++----------- 1 file changed, 33 insertions(+), 17 deletions(-)
drivers/net/wireless/ath/ath9k/antenna.c +33 -17
@@ -64,28 +64,45 @@ 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) +static inline bool ath_ant_div_comb_alt_check (struct ath_hw_antcomb_conf conf, +int alt_ratio,int alt_rssi_avg, +int main_rssi_avg) { -bool result = false; -switch (div_group) { +bool result, set1, set2; + + result = set1 = set2 = false; + +if (conf.main_lna_conf ==ATH_ANT_DIV_COMB_LNA2 && + conf.alt_lna_conf ==ATH_ANT_DIV_COMB_LNA1 ) + set1 = true; + +if (conf.main_lna_conf ==ATH_ANT_DIV_COMB_LNA1 && + conf.alt_lna_conf ==ATH_ANT_DIV_COMB_LNA2 ) + set2 = true; + +switch (conf.div_group) {case 0 :if (alt_ratio >ATH_ANT_DIV_COMB_ALT_ANT_RATIO ) result = true;break ;case 1 :case 2 : -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 )) +if (alt_rssi_avg <4 ) +break ; + +if ((set1 && (alt_rssi_avg >= (main_rssi_avg -5 ))) || + (set2 && (alt_rssi_avg >= (main_rssi_avg -2 )))) result = true; -else - result = false; + +break ; +case 3 : +if (alt_rssi_avg <4 ) +break ; + +if ((set1 && (alt_rssi_avg >= (main_rssi_avg -3 ))) || + (set2 && (alt_rssi_avg >= (main_rssi_avg +3 )))) + result = true; +break ; }
@@ -671,9 +688,8 @@ void ath_ant_comb_scan(struct ath_softc *sc, struct ath_rx_status *rs) }if (!antcomb->scan) { -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 (ath_ant_div_comb_alt_check (div_ant_conf, alt_ratio, + 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 =
Signature · 1 line
1.8.3.4
PATCH 4/8 ath9k: Use a subroutine to try LNA switch
In reply to Sujith ManoharanFrom: Sujith Manoharan <[email protected]>
--- drivers/net/wireless/ath/ath9k/antenna.c | 92 ++++++++++++++++++-------------- 1 file changed, 52 insertions(+), 40 deletions(-)
drivers/net/wireless/ath/ath9k/antenna.c +52 -40
@@ -64,7 +64,7 @@ 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 (struct ath_hw_antcomb_conf conf, +static inline bool ath_ant_div_comb_alt_check (struct ath_hw_antcomb_conf *conf,int alt_ratio,int alt_rssi_avg,int main_rssi_avg) {
@@ -72,15 +72,15 @@ static inline bool ath_ant_div_comb_alt_check(struct ath_hw_antcomb_conf conf, result = set1 = set2 = false; -if (conf.main_lna_conf ==ATH_ANT_DIV_COMB_LNA2 && - conf.alt_lna_conf ==ATH_ANT_DIV_COMB_LNA1 ) +if (conf->main_lna_conf ==ATH_ANT_DIV_COMB_LNA2 && + conf->alt_lna_conf ==ATH_ANT_DIV_COMB_LNA1 ) set1 = true; -if (conf.main_lna_conf ==ATH_ANT_DIV_COMB_LNA1 && - conf.alt_lna_conf ==ATH_ANT_DIV_COMB_LNA2 ) +if (conf->main_lna_conf ==ATH_ANT_DIV_COMB_LNA1 && + conf->alt_lna_conf ==ATH_ANT_DIV_COMB_LNA2 ) set2 = true; -switch (conf.div_group) { +switch (conf->div_group) {case 0 :if (alt_ratio >ATH_ANT_DIV_COMB_ALT_ANT_RATIO ) result = true;
@@ -596,6 +596,43 @@ static void ath_ant_div_conf_fast_divbias(struct ath_hw_antcomb_conf *ant_conf, } } +static bool ath_ant_try_switch (struct ath_hw_antcomb_conf *div_ant_conf, +int alt_ratio,int alt_rssi_avg, +int main_rssi_avg,int curr_main_set, +int curr_alt_set) +{ +bool ret = false; + +if (ath_ant_div_comb_alt_check (div_ant_conf, alt_ratio, + 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 =ATH_ANT_DIV_COMB_LNA2 ; + div_ant_conf->alt_lna_conf =ATH_ANT_DIV_COMB_LNA1 ; + }else if (curr_alt_set ==ATH_ANT_DIV_COMB_LNA1 ) { + div_ant_conf->main_lna_conf =ATH_ANT_DIV_COMB_LNA1 ; + div_ant_conf->alt_lna_conf =ATH_ANT_DIV_COMB_LNA2 ; + } + + ret = true; + }else if ((curr_alt_set !=ATH_ANT_DIV_COMB_LNA1 ) && + (curr_alt_set !=ATH_ANT_DIV_COMB_LNA2 )) { +/* +Set alt to another LNA. +*/ +if (curr_main_set ==ATH_ANT_DIV_COMB_LNA2 ) + div_ant_conf->alt_lna_conf =ATH_ANT_DIV_COMB_LNA1 ; +else if (curr_main_set ==ATH_ANT_DIV_COMB_LNA1 ) + div_ant_conf->alt_lna_conf =ATH_ANT_DIV_COMB_LNA2 ; + + ret = true; + } + +return ret; +} +static bool ath_ant_short_scan_check (struct ath_ant_comb *antcomb) {int alt_ratio;
@@ -626,7 +663,7 @@ void ath_ant_comb_scan(struct ath_softc *sc, struct ath_rx_status *rs)int main_rssi = rs->rs_rssi_ctl0;int alt_rssi = rs->rs_rssi_ctl1;int rx_ant_conf, main_ant_conf; -bool short_scan = false; +bool short_scan = false, ret; rx_ant_conf = (rs->rs_rssi_ctl2 >>ATH_ANT_RX_CURRENT_SHIFT ) &ATH_ANT_RX_MASK ;
@@ -666,11 +703,9 @@ void ath_ant_comb_scan(struct ath_softc *sc, struct ath_rx_status *rs) antcomb->total_pkt_count); } -ath9k_hw_antdiv_comb_conf_get (sc->sc_ah, &div_ant_conf); curr_alt_set = div_ant_conf.alt_lna_conf; curr_main_set = div_ant_conf.main_lna_conf; - antcomb->count++;if (antcomb->count ==ATH_ANT_DIV_COMB_MAX_COUNT ) {
@@ -688,40 +723,17 @@ void ath_ant_comb_scan(struct ath_softc *sc, struct ath_rx_status *rs) }if (!antcomb->scan) { -if (ath_ant_div_comb_alt_check (div_ant_conf, alt_ratio, - 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 = -ATH_ANT_DIV_COMB_LNA2 ; - div_ant_conf.alt_lna_conf = -ATH_ANT_DIV_COMB_LNA1 ; - }else if (curr_alt_set ==ATH_ANT_DIV_COMB_LNA1 ) { - div_ant_conf.main_lna_conf = -ATH_ANT_DIV_COMB_LNA1 ; - div_ant_conf.alt_lna_conf = -ATH_ANT_DIV_COMB_LNA2 ; - } - - goto div_comb_done; - }else if ((curr_alt_set !=ATH_ANT_DIV_COMB_LNA1 ) && - (curr_alt_set !=ATH_ANT_DIV_COMB_LNA2 )) { -/* Set alt to another LNA */ -if (curr_main_set ==ATH_ANT_DIV_COMB_LNA2 ) - div_ant_conf.alt_lna_conf = -ATH_ANT_DIV_COMB_LNA1 ; -else if (curr_main_set ==ATH_ANT_DIV_COMB_LNA1 ) - div_ant_conf.alt_lna_conf = -ATH_ANT_DIV_COMB_LNA2 ; - - goto div_comb_done; - } - -if ((alt_rssi_avg < (main_rssi_avg + - div_ant_conf.lna1_lna2_delta))) + ret =ath_ant_try_switch (&div_ant_conf, alt_ratio, + alt_rssi_avg, main_rssi_avg, + curr_main_set, curr_alt_set); +if (ret) goto div_comb_done; } +if (!antcomb->scan && + (alt_rssi_avg < (main_rssi_avg + div_ant_conf.lna1_lna2_delta))) + goto div_comb_done; +if (!antcomb->scan_not_start) {switch (curr_alt_set) {case ATH_ANT_DIV_COMB_LNA2 :
Signature · 1 line
1.8.3.4
PATCH 5/8 ath9k: Use a helper function for checking LNA options
In reply to Sujith ManoharanFrom: Sujith Manoharan <[email protected]>
--- drivers/net/wireless/ath/ath9k/antenna.c | 166 +++++++++++++++---------------- 1 file changed, 79 insertions(+), 87 deletions(-)
drivers/net/wireless/ath/ath9k/antenna.c +79 -87
@@ -596,6 +596,79 @@ static void ath_ant_div_conf_fast_divbias(struct ath_hw_antcomb_conf *ant_conf, } } +static void ath_ant_try_scan (struct ath_ant_comb *antcomb, +struct ath_hw_antcomb_conf *conf, +int curr_alt_set,int alt_rssi_avg, +int main_rssi_avg) +{ +switch (curr_alt_set) { +case ATH_ANT_DIV_COMB_LNA2 : + antcomb->rssi_lna2 = alt_rssi_avg; + antcomb->rssi_lna1 = main_rssi_avg; + antcomb->scan = true; +/* set to A+B */ + conf->main_lna_conf =ATH_ANT_DIV_COMB_LNA1 ; + conf->alt_lna_conf =ATH_ANT_DIV_COMB_LNA1_PLUS_LNA2 ; +break ; +case ATH_ANT_DIV_COMB_LNA1 : + antcomb->rssi_lna1 = alt_rssi_avg; + antcomb->rssi_lna2 = main_rssi_avg; + antcomb->scan = true; +/* set to A+B */ + conf->main_lna_conf =ATH_ANT_DIV_COMB_LNA2 ; + conf->alt_lna_conf =ATH_ANT_DIV_COMB_LNA1_PLUS_LNA2 ; +break ; +case ATH_ANT_DIV_COMB_LNA1_PLUS_LNA2 : + antcomb->rssi_add = alt_rssi_avg; + antcomb->scan = true; +/* set to A-B */ + conf->alt_lna_conf =ATH_ANT_DIV_COMB_LNA1_MINUS_LNA2 ; +break ; +case ATH_ANT_DIV_COMB_LNA1_MINUS_LNA2 : + antcomb->rssi_sub = alt_rssi_avg; + antcomb->scan = false; +if (antcomb->rssi_lna2 > + (antcomb->rssi_lna1 +ATH_ANT_DIV_COMB_LNA1_LNA2_SWITCH_DELTA )) { +/* use LNA2 as main LNA */ +if ((antcomb->rssi_add > antcomb->rssi_lna1) && + (antcomb->rssi_add > antcomb->rssi_sub)) { +/* set to A+B */ + conf->main_lna_conf =ATH_ANT_DIV_COMB_LNA2 ; + conf->alt_lna_conf =ATH_ANT_DIV_COMB_LNA1_PLUS_LNA2 ; + }else if (antcomb->rssi_sub > + antcomb->rssi_lna1) { +/* set to A-B */ + conf->main_lna_conf =ATH_ANT_DIV_COMB_LNA2 ; + conf->alt_lna_conf =ATH_ANT_DIV_COMB_LNA1_MINUS_LNA2 ; + }else { +/* set to LNA1 */ + conf->main_lna_conf =ATH_ANT_DIV_COMB_LNA2 ; + conf->alt_lna_conf =ATH_ANT_DIV_COMB_LNA1 ; + } + }else { +/* use LNA1 as main LNA */ +if ((antcomb->rssi_add > antcomb->rssi_lna2) && + (antcomb->rssi_add > antcomb->rssi_sub)) { +/* set to A+B */ + conf->main_lna_conf =ATH_ANT_DIV_COMB_LNA1 ; + conf->alt_lna_conf =ATH_ANT_DIV_COMB_LNA1_PLUS_LNA2 ; + }else if (antcomb->rssi_sub > + antcomb->rssi_lna1) { +/* set to A-B */ + conf->main_lna_conf =ATH_ANT_DIV_COMB_LNA1 ; + conf->alt_lna_conf =ATH_ANT_DIV_COMB_LNA1_MINUS_LNA2 ; + }else { +/* set to LNA2 */ + conf->main_lna_conf =ATH_ANT_DIV_COMB_LNA1 ; + conf->alt_lna_conf =ATH_ANT_DIV_COMB_LNA2 ; + } + } +break ; +default : +break ; + } +} + static bool ath_ant_try_switch(struct ath_hw_antcomb_conf *div_ant_conf, int alt_ratio, int alt_rssi_avg, int main_rssi_avg, int curr_main_set,
@@ -735,103 +808,22 @@ void ath_ant_comb_scan(struct ath_softc *sc, struct ath_rx_status *rs) goto div_comb_done;if (!antcomb->scan_not_start) { -switch (curr_alt_set) { -case ATH_ANT_DIV_COMB_LNA2 : - antcomb->rssi_lna2 = alt_rssi_avg; - antcomb->rssi_lna1 = main_rssi_avg; - antcomb->scan = true; -/* set to A+B */ - div_ant_conf.main_lna_conf = -ATH_ANT_DIV_COMB_LNA1 ; - div_ant_conf.alt_lna_conf = -ATH_ANT_DIV_COMB_LNA1_PLUS_LNA2 ; -break ; -case ATH_ANT_DIV_COMB_LNA1 : - antcomb->rssi_lna1 = alt_rssi_avg; - antcomb->rssi_lna2 = main_rssi_avg; - antcomb->scan = true; -/* set to A+B */ - div_ant_conf.main_lna_conf =ATH_ANT_DIV_COMB_LNA2 ; - div_ant_conf.alt_lna_conf = -ATH_ANT_DIV_COMB_LNA1_PLUS_LNA2 ; -break ; -case ATH_ANT_DIV_COMB_LNA1_PLUS_LNA2 : - antcomb->rssi_add = alt_rssi_avg; - antcomb->scan = true; -/* set to A-B */ - div_ant_conf.alt_lna_conf = -ATH_ANT_DIV_COMB_LNA1_MINUS_LNA2 ; -break ; -case ATH_ANT_DIV_COMB_LNA1_MINUS_LNA2 : - antcomb->rssi_sub = alt_rssi_avg; - antcomb->scan = false; -if (antcomb->rssi_lna2 > - (antcomb->rssi_lna1 + -ATH_ANT_DIV_COMB_LNA1_LNA2_SWITCH_DELTA )) { -/* use LNA2 as main LNA */ -if ((antcomb->rssi_add > antcomb->rssi_lna1) && - (antcomb->rssi_add > antcomb->rssi_sub)) { -/* set to A+B */ - div_ant_conf.main_lna_conf = -ATH_ANT_DIV_COMB_LNA2 ; - div_ant_conf.alt_lna_conf = -ATH_ANT_DIV_COMB_LNA1_PLUS_LNA2 ; - }else if (antcomb->rssi_sub > - antcomb->rssi_lna1) { -/* set to A-B */ - div_ant_conf.main_lna_conf = -ATH_ANT_DIV_COMB_LNA2 ; - div_ant_conf.alt_lna_conf = -ATH_ANT_DIV_COMB_LNA1_MINUS_LNA2 ; - }else { -/* set to LNA1 */ - div_ant_conf.main_lna_conf = -ATH_ANT_DIV_COMB_LNA2 ; - div_ant_conf.alt_lna_conf = -ATH_ANT_DIV_COMB_LNA1 ; - } - }else { -/* use LNA1 as main LNA */ -if ((antcomb->rssi_add > antcomb->rssi_lna2) && - (antcomb->rssi_add > antcomb->rssi_sub)) { -/* set to A+B */ - div_ant_conf.main_lna_conf = -ATH_ANT_DIV_COMB_LNA1 ; - div_ant_conf.alt_lna_conf = -ATH_ANT_DIV_COMB_LNA1_PLUS_LNA2 ; - }else if (antcomb->rssi_sub > - antcomb->rssi_lna1) { -/* set to A-B */ - div_ant_conf.main_lna_conf = -ATH_ANT_DIV_COMB_LNA1 ; - div_ant_conf.alt_lna_conf = -ATH_ANT_DIV_COMB_LNA1_MINUS_LNA2 ; - }else { -/* set to LNA2 */ - div_ant_conf.main_lna_conf = -ATH_ANT_DIV_COMB_LNA1 ; - div_ant_conf.alt_lna_conf = -ATH_ANT_DIV_COMB_LNA2 ; - } - } -break ; -default : -break ; - } +ath_ant_try_scan (antcomb, &div_ant_conf, curr_alt_set, + alt_rssi_avg, main_rssi_avg); }else {if (!antcomb->alt_good) { antcomb->scan_not_start = false;/* Set alt to another LNA */ if (curr_main_set ==ATH_ANT_DIV_COMB_LNA2 ) { div_ant_conf.main_lna_conf = -ATH_ANT_DIV_COMB_LNA2 ; +ATH_ANT_DIV_COMB_LNA2 ; div_ant_conf.alt_lna_conf = -ATH_ANT_DIV_COMB_LNA1 ; +ATH_ANT_DIV_COMB_LNA1 ; }else if (curr_main_set ==ATH_ANT_DIV_COMB_LNA1 ) { div_ant_conf.main_lna_conf = -ATH_ANT_DIV_COMB_LNA1 ; +ATH_ANT_DIV_COMB_LNA1 ; div_ant_conf.alt_lna_conf = -ATH_ANT_DIV_COMB_LNA2 ; +ATH_ANT_DIV_COMB_LNA2 ; } goto div_comb_done; }
Signature · 1 line
1.8.3.4
PATCH 6/8 ath9k: Simplify checks in quick_scan
In reply to Sujith ManoharanFrom: Sujith Manoharan <[email protected]>
There is a function to do a ratio comparison for ALT, so make use of it.
--- drivers/net/wireless/ath/ath9k/antenna.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-)
drivers/net/wireless/ath/ath9k/antenna.c +10 -10
@@ -203,11 +203,11 @@ static void ath_select_ant_div_from_quick_scan(struct ath_ant_comb *antcomb,else antcomb->first_ratio = false; }else { -if ((((alt_ratio >=ATH_ANT_DIV_COMB_ALT_ANT_RATIO2 ) && - (alt_rssi_avg > main_rssi_avg + -ATH_ANT_DIV_COMB_LNA1_DELTA_HI )) || - (alt_rssi_avg > main_rssi_avg)) && - (antcomb->total_pkt_count >50 )) +if (ath_is_alt_ant_ratio_better (alt_ratio, +ATH_ANT_DIV_COMB_LNA1_DELTA_HI , +0 , + main_rssi_avg, alt_rssi_avg, + antcomb->total_pkt_count)) antcomb->first_ratio = true;else antcomb->first_ratio = false;
@@ -258,11 +258,11 @@ static void ath_select_ant_div_from_quick_scan(struct ath_ant_comb *antcomb,else antcomb->second_ratio = false; }else { -if ((((alt_ratio >=ATH_ANT_DIV_COMB_ALT_ANT_RATIO2 ) && - (alt_rssi_avg > main_rssi_avg + -ATH_ANT_DIV_COMB_LNA1_DELTA_HI )) || - (alt_rssi_avg > main_rssi_avg)) && - (antcomb->total_pkt_count >50 )) +if (ath_is_alt_ant_ratio_better (alt_ratio, +ATH_ANT_DIV_COMB_LNA1_DELTA_HI , +0 , + main_rssi_avg, alt_rssi_avg, + antcomb->total_pkt_count)) antcomb->second_ratio = true;else antcomb->second_ratio = false;
Signature · 1 line
1.8.3.4
PATCH 7/8 ath9k: Use a subroutine to calculate ALT ratio
In reply to Sujith ManoharanFrom: Sujith Manoharan <[email protected]>
--- drivers/net/wireless/ath/ath9k/antenna.c | 173 ++++++++++++++----------------- 1 file changed, 79 insertions(+), 94 deletions(-)
drivers/net/wireless/ath/ath9k/antenna.c +79 -94
@@ -164,6 +164,74 @@ static void ath_lnaconf_alt_good_scan(struct ath_ant_comb *antcomb, } } +static void ath_ant_set_alt_ratio (struct ath_ant_comb *antcomb, +struct ath_hw_antcomb_conf *conf) +{ +/* set alt to the conf with maximun ratio */ +if (antcomb->first_ratio && antcomb->second_ratio) { +if (antcomb->rssi_second > antcomb->rssi_third) { +/* first alt*/ +if ((antcomb->first_quick_scan_conf ==ATH_ANT_DIV_COMB_LNA1 ) || + (antcomb->first_quick_scan_conf ==ATH_ANT_DIV_COMB_LNA2 )) +/* Set alt LNA1 or LNA2*/ +if (conf->main_lna_conf ==ATH_ANT_DIV_COMB_LNA2 ) + conf->alt_lna_conf =ATH_ANT_DIV_COMB_LNA1 ; +else + conf->alt_lna_conf =ATH_ANT_DIV_COMB_LNA2 ; +else +/* Set alt to A+B or A-B */ + conf->alt_lna_conf = + antcomb->first_quick_scan_conf; + }else if ((antcomb->second_quick_scan_conf ==ATH_ANT_DIV_COMB_LNA1 ) || + (antcomb->second_quick_scan_conf ==ATH_ANT_DIV_COMB_LNA2 )) { +/* Set alt LNA1 or LNA2 */ +if (conf->main_lna_conf ==ATH_ANT_DIV_COMB_LNA2 ) + conf->alt_lna_conf =ATH_ANT_DIV_COMB_LNA1 ; +else + conf->alt_lna_conf =ATH_ANT_DIV_COMB_LNA2 ; + }else { +/* Set alt to A+B or A-B */ + conf->alt_lna_conf = antcomb->second_quick_scan_conf; + } + }else if (antcomb->first_ratio) { +/* first alt */ +if ((antcomb->first_quick_scan_conf ==ATH_ANT_DIV_COMB_LNA1 ) || + (antcomb->first_quick_scan_conf ==ATH_ANT_DIV_COMB_LNA2 )) +/* Set alt LNA1 or LNA2 */ +if (conf->main_lna_conf ==ATH_ANT_DIV_COMB_LNA2 ) + conf->alt_lna_conf =ATH_ANT_DIV_COMB_LNA1 ; +else + conf->alt_lna_conf =ATH_ANT_DIV_COMB_LNA2 ; +else +/* Set alt to A+B or A-B */ + conf->alt_lna_conf = antcomb->first_quick_scan_conf; + }else if (antcomb->second_ratio) { +/* second alt */ +if ((antcomb->second_quick_scan_conf ==ATH_ANT_DIV_COMB_LNA1 ) || + (antcomb->second_quick_scan_conf ==ATH_ANT_DIV_COMB_LNA2 )) +/* Set alt LNA1 or LNA2 */ +if (conf->main_lna_conf ==ATH_ANT_DIV_COMB_LNA2 ) + conf->alt_lna_conf =ATH_ANT_DIV_COMB_LNA1 ; +else + conf->alt_lna_conf =ATH_ANT_DIV_COMB_LNA2 ; +else +/* Set alt to A+B or A-B */ + conf->alt_lna_conf = antcomb->second_quick_scan_conf; + }else { +/* main is largest */ +if ((antcomb->main_conf ==ATH_ANT_DIV_COMB_LNA1 ) || + (antcomb->main_conf ==ATH_ANT_DIV_COMB_LNA2 )) +/* Set alt LNA1 or LNA2 */ +if (conf->main_lna_conf ==ATH_ANT_DIV_COMB_LNA2 ) + conf->alt_lna_conf =ATH_ANT_DIV_COMB_LNA1 ; +else + conf->alt_lna_conf =ATH_ANT_DIV_COMB_LNA2 ; +else +/* Set alt to A+B or A-B */ + conf->alt_lna_conf = antcomb->main_conf; + } +} + static void ath_select_ant_div_from_quick_scan(struct ath_ant_comb *antcomb, struct ath_hw_antcomb_conf *div_ant_conf, int main_rssi_avg, int alt_rssi_avg,
@@ -220,17 +288,21 @@ static void ath_select_ant_div_from_quick_scan(struct ath_ant_comb *antcomb, antcomb->rssi_first = main_rssi_avg; antcomb->rssi_third = alt_rssi_avg; -if (antcomb->second_quick_scan_conf ==ATH_ANT_DIV_COMB_LNA1 ) +switch (antcomb->second_quick_scan_conf) { +case ATH_ANT_DIV_COMB_LNA1 : antcomb->rssi_lna1 = alt_rssi_avg; -else if (antcomb->second_quick_scan_conf == -ATH_ANT_DIV_COMB_LNA2 ) +break ; +case ATH_ANT_DIV_COMB_LNA2 : antcomb->rssi_lna2 = alt_rssi_avg; -else if (antcomb->second_quick_scan_conf == -ATH_ANT_DIV_COMB_LNA1_PLUS_LNA2 ) { +break ; +case ATH_ANT_DIV_COMB_LNA1_PLUS_LNA2 :if (antcomb->main_conf ==ATH_ANT_DIV_COMB_LNA2 ) antcomb->rssi_lna2 = main_rssi_avg;else if (antcomb->main_conf ==ATH_ANT_DIV_COMB_LNA1 ) antcomb->rssi_lna1 = main_rssi_avg; +break ; +default : +break ; } if (antcomb->rssi_lna2 > antcomb->rssi_lna1 +
@@ -268,95 +340,8 @@ static void ath_select_ant_div_from_quick_scan(struct ath_ant_comb *antcomb, antcomb->second_ratio = false; } -/* set alt to the conf with maximun ratio */ -if (antcomb->first_ratio && antcomb->second_ratio) { -if (antcomb->rssi_second > antcomb->rssi_third) { -/* first alt*/ -if ((antcomb->first_quick_scan_conf == -ATH_ANT_DIV_COMB_LNA1 ) || - (antcomb->first_quick_scan_conf == -ATH_ANT_DIV_COMB_LNA2 )) -/* Set alt LNA1 or LNA2*/ -if (div_ant_conf->main_lna_conf == -ATH_ANT_DIV_COMB_LNA2 ) - div_ant_conf->alt_lna_conf = -ATH_ANT_DIV_COMB_LNA1 ; -else - div_ant_conf->alt_lna_conf = -ATH_ANT_DIV_COMB_LNA2 ; -else -/* Set alt to A+B or A-B */ - div_ant_conf->alt_lna_conf = - antcomb->first_quick_scan_conf; - }else if ((antcomb->second_quick_scan_conf == -ATH_ANT_DIV_COMB_LNA1 ) || - (antcomb->second_quick_scan_conf == -ATH_ANT_DIV_COMB_LNA2 )) { -/* Set alt LNA1 or LNA2 */ -if (div_ant_conf->main_lna_conf == -ATH_ANT_DIV_COMB_LNA2 ) - div_ant_conf->alt_lna_conf = -ATH_ANT_DIV_COMB_LNA1 ; -else - div_ant_conf->alt_lna_conf = -ATH_ANT_DIV_COMB_LNA2 ; - }else { -/* Set alt to A+B or A-B */ - div_ant_conf->alt_lna_conf = - antcomb->second_quick_scan_conf; - } - }else if (antcomb->first_ratio) { -/* first alt */ -if ((antcomb->first_quick_scan_conf == -ATH_ANT_DIV_COMB_LNA1 ) || - (antcomb->first_quick_scan_conf == -ATH_ANT_DIV_COMB_LNA2 )) -/* Set alt LNA1 or LNA2 */ -if (div_ant_conf->main_lna_conf == -ATH_ANT_DIV_COMB_LNA2 ) - div_ant_conf->alt_lna_conf = -ATH_ANT_DIV_COMB_LNA1 ; -else - div_ant_conf->alt_lna_conf = -ATH_ANT_DIV_COMB_LNA2 ; -else -/* Set alt to A+B or A-B */ - div_ant_conf->alt_lna_conf = - antcomb->first_quick_scan_conf; - }else if (antcomb->second_ratio) { -/* second alt */ -if ((antcomb->second_quick_scan_conf == -ATH_ANT_DIV_COMB_LNA1 ) || - (antcomb->second_quick_scan_conf == -ATH_ANT_DIV_COMB_LNA2 )) -/* Set alt LNA1 or LNA2 */ -if (div_ant_conf->main_lna_conf == -ATH_ANT_DIV_COMB_LNA2 ) - div_ant_conf->alt_lna_conf = -ATH_ANT_DIV_COMB_LNA1 ; -else - div_ant_conf->alt_lna_conf = -ATH_ANT_DIV_COMB_LNA2 ; -else -/* Set alt to A+B or A-B */ - div_ant_conf->alt_lna_conf = - antcomb->second_quick_scan_conf; - }else { -/* main is largest */ -if ((antcomb->main_conf ==ATH_ANT_DIV_COMB_LNA1 ) || - (antcomb->main_conf ==ATH_ANT_DIV_COMB_LNA2 )) -/* Set alt LNA1 or LNA2 */ -if (div_ant_conf->main_lna_conf == -ATH_ANT_DIV_COMB_LNA2 ) - div_ant_conf->alt_lna_conf = -ATH_ANT_DIV_COMB_LNA1 ; -else - div_ant_conf->alt_lna_conf = -ATH_ANT_DIV_COMB_LNA2 ; -else -/* Set alt to A+B or A-B */ - div_ant_conf->alt_lna_conf = antcomb->main_conf; - } +ath_ant_set_alt_ratio (antcomb, div_ant_conf); +break ;default :break ;
Signature · 1 line
1.8.3.4
PATCH 8/8 ath9k: Add statistics for antenna diversity
In reply to Sujith ManoharanFrom: Sujith Manoharan <[email protected]>
--- drivers/net/wireless/ath/ath9k/antenna.c | 7 +++ drivers/net/wireless/ath/ath9k/debug.c | 89 +++++++++++++++++++++++++++----- drivers/net/wireless/ath/ath9k/debug.h | 21 +++++--- 3 files changed, 96 insertions(+), 21 deletions(-)
drivers/net/wireless/ath/ath9k/antenna.c +7 -0
@@ -745,6 +745,12 @@ void ath_ant_comb_scan(struct ath_softc *sc, struct ath_rx_status *rs) } } +if (main_rssi ==ATH9K_RSSI_BAD ) +ANT_STAT_INC (ANT_MAIN , invalid_rssi); + +if (alt_rssi ==ATH9K_RSSI_BAD ) +ANT_STAT_INC (ANT_ALT , invalid_rssi); +/* Short scan check */ short_scan =ath_ant_short_scan_check (antcomb);
@@ -821,6 +827,7 @@ void ath_ant_comb_scan(struct ath_softc *sc, struct ath_rx_status *rs) div_comb_done:ath_ant_div_conf_fast_divbias (&div_ant_conf, antcomb, alt_ratio);ath9k_hw_antdiv_comb_conf_set (sc->sc_ah, &div_ant_conf); +ath9k_debug_stat_ant (sc, &div_ant_conf, main_rssi_avg, alt_rssi_avg); antcomb->scan_start_time = jiffies; antcomb->total_pkt_count =0 ;
drivers/net/wireless/ath/ath9k/debug.c +75 -14
118 lines not on this page · raw message
drivers/net/wireless/ath/ath9k/debug.h +14 -7
@@ -29,7 +29,7 @@ struct fft_sample_tlv;#define TX_STAT_INC (q, c) sc->debug.stats.txstats[q].c++#define RESET_STAT_INC (sc, type) sc->debug.stats.reset[type]++#define ANT_STAT_INC (i, c) sc->debug.stats.ant_stats[i].c++ -#define ANT_LNA_INC (i, c) sc->debug.stats.ant_stats[i].lna_config_cnt[c]++; +#define ANT_LNA_INC (i, c) sc->debug.stats.ant_stats[i].lna_recv_cnt[c]++;#else #define TX_STAT_INC (q, c) do { } while (0)#define RESET_STAT_INC (sc, type) do { } while (0)
@@ -252,7 +252,10 @@ struct ath_rx_stats {struct ath_antenna_stats {u32 recv_cnt; -u32 lna_config_cnt[4 ]; +u32 rssi_avg; +u32 invalid_rssi; +u32 lna_recv_cnt[4 ]; +u32 lna_attempt_cnt[4 ]; };struct ath_stats {
@@ -294,10 +297,11 @@ void ath9k_sta_remove_debugfs(struct ieee80211_hw *hw,struct ieee80211_vif *vif, struct ieee80211_sta *sta, struct dentry *dir); -void ath_debug_send_fft_sample (struct ath_softc *sc,struct fft_sample_tlv *fft_sample); - +void ath9k_debug_stat_ant (struct ath_softc *sc, +struct ath_hw_antcomb_conf *div_ant_conf, +int main_rssi_avg,int alt_rssi_avg);#else #define RX_STAT_INC (c)/* NOP */
@@ -310,12 +314,10 @@ static inline int ath9k_init_debug(struct ath_hw *ah)static inline void ath9k_deinit_debug (struct ath_softc *sc) { } -static inline void ath_debug_stat_interrupt (struct ath_softc *sc,enum ath9k_int status) { } - static inline void ath_debug_stat_tx(struct ath_softc *sc, struct ath_buf *bf, struct ath_tx_status *ts,
@@ -323,11 +325,16 @@ static inline void ath_debug_stat_tx(struct ath_softc *sc, unsigned int flags) { } -static inline void ath_debug_stat_rx (struct ath_softc *sc,struct ath_rx_status *rs) { } +static inline void ath9k_debug_stat_ant (struct ath_softc *sc, +struct ath_hw_antcomb_conf *div_ant_conf, +int main_rssi_avg,int alt_rssi_avg) +{ + +}#endif /* CONFIG_ATH9K_DEBUGFS */
Signature · 1 line
1.8.3.4
PATCH v2 8/8 ath9k: Add statistics for antenna diversity
From: Sujith Manoharan <[email protected]>
--- drivers/net/wireless/ath/ath9k/antenna.c | 18 ++++--- drivers/net/wireless/ath/ath9k/debug.c | 85 ++++++++++++++++++++++++++------ drivers/net/wireless/ath/ath9k/debug.h | 20 +++++--- 3 files changed, 95 insertions(+), 28 deletions(-)
drivers/net/wireless/ath/ath9k/antenna.c +11 -7
@@ -734,15 +734,18 @@ void ath_ant_comb_scan(struct ath_softc *sc, struct ath_rx_status *rs) antcomb->main_total_rssi += main_rssi; antcomb->alt_total_rssi += alt_rssi; -if (main_ant_conf == rx_ant_conf) { +if (main_ant_conf == rx_ant_conf) antcomb->main_recv_cnt++; -ANT_STAT_INC (ANT_MAIN , recv_cnt); -ANT_LNA_INC (ANT_MAIN , rx_ant_conf); - }else { +else antcomb->alt_recv_cnt++; -ANT_STAT_INC (ANT_ALT , recv_cnt); -ANT_LNA_INC (ANT_ALT , rx_ant_conf); - } + } + +if (main_ant_conf == rx_ant_conf) { +ANT_STAT_INC (ANT_MAIN , recv_cnt); +ANT_LNA_INC (ANT_MAIN , rx_ant_conf); + }else { +ANT_STAT_INC (ANT_ALT , recv_cnt); +ANT_LNA_INC (ANT_ALT , rx_ant_conf); }/* Short scan check */
@@ -821,6 +824,7 @@ void ath_ant_comb_scan(struct ath_softc *sc, struct ath_rx_status *rs) div_comb_done:ath_ant_div_conf_fast_divbias (&div_ant_conf, antcomb, alt_ratio);ath9k_hw_antdiv_comb_conf_set (sc->sc_ah, &div_ant_conf); +ath9k_debug_stat_ant (sc, &div_ant_conf, main_rssi_avg, alt_rssi_avg); antcomb->scan_start_time = jiffies; antcomb->total_pkt_count =0 ;
drivers/net/wireless/ath/ath9k/debug.c +71 -14
114 lines not on this page · raw message
drivers/net/wireless/ath/ath9k/debug.h +13 -7
@@ -29,7 +29,7 @@ struct fft_sample_tlv;#define TX_STAT_INC (q, c) sc->debug.stats.txstats[q].c++#define RESET_STAT_INC (sc, type) sc->debug.stats.reset[type]++#define ANT_STAT_INC (i, c) sc->debug.stats.ant_stats[i].c++ -#define ANT_LNA_INC (i, c) sc->debug.stats.ant_stats[i].lna_config_cnt[c]++; +#define ANT_LNA_INC (i, c) sc->debug.stats.ant_stats[i].lna_recv_cnt[c]++;#else #define TX_STAT_INC (q, c) do { } while (0)#define RESET_STAT_INC (sc, type) do { } while (0)
@@ -252,7 +252,9 @@ struct ath_rx_stats {struct ath_antenna_stats {u32 recv_cnt; -u32 lna_config_cnt[4 ]; +u32 rssi_avg; +u32 lna_recv_cnt[4 ]; +u32 lna_attempt_cnt[4 ]; };struct ath_stats {
@@ -294,10 +296,11 @@ void ath9k_sta_remove_debugfs(struct ieee80211_hw *hw,struct ieee80211_vif *vif, struct ieee80211_sta *sta, struct dentry *dir); -void ath_debug_send_fft_sample (struct ath_softc *sc,struct fft_sample_tlv *fft_sample); - +void ath9k_debug_stat_ant (struct ath_softc *sc, +struct ath_hw_antcomb_conf *div_ant_conf, +int main_rssi_avg,int alt_rssi_avg);#else #define RX_STAT_INC (c)/* NOP */
@@ -310,12 +313,10 @@ static inline int ath9k_init_debug(struct ath_hw *ah)static inline void ath9k_deinit_debug (struct ath_softc *sc) { } -static inline void ath_debug_stat_interrupt (struct ath_softc *sc,enum ath9k_int status) { } - static inline void ath_debug_stat_tx(struct ath_softc *sc, struct ath_buf *bf, struct ath_tx_status *ts,
@@ -323,11 +324,16 @@ static inline void ath_debug_stat_tx(struct ath_softc *sc, unsigned int flags) { } -static inline void ath_debug_stat_rx (struct ath_softc *sc,struct ath_rx_status *rs) { } +static inline void ath9k_debug_stat_ant (struct ath_softc *sc, +struct ath_hw_antcomb_conf *div_ant_conf, +int main_rssi_avg,int alt_rssi_avg) +{ + +}#endif /* CONFIG_ATH9K_DEBUGFS */
Signature · 1 line
1.8.3.4
cross compile backports?
Hello,
I've been cross compiling compat-wireless and now I'm trying backports. It looks like conf.c and zconf.tab.c are being compiled as arm and then the build process is trying to run conf on my x86 host. Results using the below make parameters I was using for compat-wireless......
Generating local configuration database from kernel ... done.
gcc -Wall -Wmissing-prototypes -Wstrict-prototypes -O2 -fomit-frame-pointer -c -o conf.o conf.c
gcc -Wall -Wmissing-prototypes -Wstrict-prototypes -O2 -fomit-frame-pointer -c -o zconf.tab.o zconf.tab.c
gcc conf.o zconf.tab.o -o conf
./kconf/conf: ./kconf/conf: cannot execute binary file
There must be a way to build conf as x86 and the actual drivers as arm without butchering the makefile? I've been cross compiling compat-wireless with....
make prefix=%{_prefix}
CROSS_COMPILE=/opt/freescale/usr/local/gcc-4.6.2-glibc-2.13-linaro-multilib-2011.12/fsl-linaro-toolchain/bin/arm-none-linux-gnueabi- \
ARCH=arm \
KLIB=/media/hdd1/ltibs/n100/rootfs/lib/modules/%{kversion} \
KLIB_BUILD=/media/hdd1/ltibs/n100/rpm/BUILD/linuxJon
Re: cross compile backports?
Quoted 5 lines · Jonathan Bagg
I've been cross compiling compat-wireless and now I'm trying backports. It looks like
conf.candzconf.tab.care being compiled as arm and then the build process is trying to run conf on my x86 host. Results using the below make parameters I was using for compat-wireless......
Howdy. :)
(btw, I'm CC'ing the backports mailing list, which is a better place to
ask these sorts of questions)
I found that the backports cross-compile process worked much the same way as building compat-wireless. This is what I'm doing currently in my build script: (This is using a backports package generated last night using the backports git HEAD code with the cw1200 driver integrated)
set -a
CROSS_COMPILE=${CROSS_COMPILE}
ARCH=${TARGET_CPU}
KLIB_BUILD=${DEV_PATH}/${LINUX_DIR}
KLIB=${TARGET_ROOT_ON_HOST}
set +a
make oldconfig # menuconfig worked here too
make
make install
That said, the 'make install' target isn't currently sane for cross-builds due to the bacport_firmware_install script not respecting prefixes. I just commented that script (and a few others like initrd updates) out of the Makefiles, and I had a successful build/install.
- Solomon
Signature · 3 lines
Solomon Peachy pizza at shaftnet dot org Delray Beach, FL ^^ (email/xmpp) ^^ Quidquid latine dictum sit, altum viditur.
Re: cross compile backports?
Quoted 27 lines · Solomon Peachy
Quoted 5 lines · Jonathan Bagg
I've been cross compiling compat-wireless and now I'm trying backports. It looks like
conf.candzconf.tab.care being compiled as arm and then the build process is trying to run conf on my x86 host. Results using the below make parameters I was using for compat-wireless......Howdy. :)
(btw, I'm CC'ing the backports mailing list, which is a better place to
ask these sorts of questions)I found that the backports cross-compile process worked much the same way as building compat-wireless. This is what I'm doing currently in my build script: (This is using a backports package generated last night using the backports git HEAD code with the cw1200 driver integrated)
set -a
CROSS_COMPILE=${CROSS_COMPILE}
ARCH=${TARGET_CPU}
KLIB_BUILD=${DEV_PATH}/${LINUX_DIR}
KLIB=${TARGET_ROOT_ON_HOST}
set +a
make oldconfig # menuconfig worked here too
make
make install
Quoted 4 lines
That said, the 'make install' target isn't currently sane for cross-builds due to the
bacport_firmware_installscript not respecting prefixes. I just commented that script (and a few others like initrd updates) out of the Makefiles, and I had a successful build/install.
Thanks, now:
https://backports.wiki.kernel.org/index.php/Documentation#Cross_compiling
Patches welcome to help improve the cross compile install target.
Luis
Re: cross compile backports?
Quoted 3 lines · Luis R. Rodriguez
https://backports.wiki.kernel.org/index.php/Documentation#Cross_compiling
Patches welcome to help improve the cross compile install target.
I'm thinking the right way to proceed is that if CROSS_COMPILE is set, simply skip all of the stuff that is only relevant for local systems. (That and respecting a prefix for the udev rules)
I'll post a patch or two to that effect tonight.
- Solomon
Signature · 3 lines
Solomon Peachy pizza at shaftnet dot org Delray Beach, FL ^^ (email/xmpp) ^^ Quidquid latine dictum sit, altum viditur.
Re: cross compile backports with LTIB
In reply to Solomon PeachyQuoted 6 lines · Solomon Peachy
Quoted 5 lines · Jonathan Bagg
I've been cross compiling compat-wireless and now I'm trying backports. It looks like
conf.candzconf.tab.care being compiled as arm and then the build process is trying to run conf on my x86 host. Results using the below make parameters I was using for compat-wireless......
Learned some things....Problem was LTIB (ltib = Freescale tool) environment. Outside of LTIB, backports cross compiles fine. To get backports happy in LTIB need to use UNSPOOF/SPOOF_PATH to switch between host and cross environment....
%Build
export PATH=$UNSPOOF_PATH
make defconfig-cw1200 make prefix=%{_prefix} CROSS_COMPILE=${TOOLCHAIN_PATH}/bin/${TOOLCHAIN_PREFIX} ARCH=$LINTARCH KLIB=${TOP}/rootfs/lib/modules/%{kversion} KLIB_BUILD=${TOP}/rpm/BUILD/linux
export PATH=$SPOOF_PATH
make prefix=%{_prefix} CROSS_COMPILE=${TOOLCHAIN_PATH}/bin/${TOOLCHAIN_PREFIX} ARCH=$LINTARCH KLIB=${TOP}/rootfs/lib/modules/%{kversion} KLIB_BUILD=${TOP}/rpm/BUILD/linux
Jon
Quoted 26 lines
Howdy. :)
(btw, I'm CC'ing the backports mailing list, which is a better place to
ask these sorts of questions)I found that the backports cross-compile process worked much the same way as building compat-wireless. This is what I'm doing currently in my build script: (This is using a backports package generated last night using the backports git HEAD code with the cw1200 driver integrated)
set -a CROSS_COMPILE=${CROSS_COMPILE} ARCH=${TARGET_CPU} KLIB_BUILD=${DEV_PATH}/${LINUX_DIR} KLIB=${TARGET_ROOT_ON_HOST} set +a make oldconfig # menuconfig worked here too make make installThat said, the 'make install' target isn't currently sane for cross-builds due to the
bacport_firmware_installscript not respecting prefixes. I just commented that script (and a few others like initrd updates) out of the Makefiles, and I had a successful build/install.- Solomon
Signature · 4 lines
Jonathan Bagg Software Developer NAD Electronics | Lenbrook Industries Limited 633 Granite Court, Pickering, Ontario, Canada L1W 3K1 | 905-831-0799 ext 4478 | http://www.nadelectronics.com
Re: cross compile backports with LTIB
Quoted 9 lines · Jonathan Bagg
Quoted 6 lines · Solomon Peachy
Quoted 5 lines · Jonathan Bagg
I've been cross compiling compat-wireless and now I'm trying backports. It looks like
conf.candzconf.tab.care being compiled as arm and then the build process is trying to run conf on my x86 host. Results using the below make parameters I was using for compat-wireless......Learned some things....Problem was LTIB (ltib = Freescale tool) environment. Outside of LTIB, backports cross compiles fine. To get backports happy in LTIB need to use UNSPOOF/SPOOF_PATH to switch between host and cross environment....
(this is for the LTIBs spec file for backports = dist/lfs-5.1/backports/backports.spec - forgot to mention in previous post)
Quoted 10 lines
%Build
export PATH=$UNSPOOF_PATHmake defconfig-cw1200 make prefix=%{_prefix} CROSS_COMPILE=${TOOLCHAIN_PATH}/bin/${TOOLCHAIN_PREFIX} ARCH=$LINTARCH KLIB=${TOP}/rootfs/lib/modules/%{kversion} KLIB_BUILD=${TOP}/rpm/BUILD/linux
export PATH=$SPOOF_PATH
make prefix=%{_prefix} CROSS_COMPILE=${TOOLCHAIN_PATH}/bin/${TOOLCHAIN_PREFIX} ARCH=$LINTARCH KLIB=${TOP}/rootfs/lib/modules/%{kversion} KLIB_BUILD=${TOP}/rpm/BUILD/linux
Jon
Issue reading kernel config
In reply to Jonathan BaggHello,
I am cross compiling backports successful using "alldefconfig". I would like use menuconfig and have conf read in options from my kernel instead of the default. (CONFIG_BT is not enabled in the default and I want to enable BT drivers in backports). It looks like kconf/conf program is loading a kernel config from the root of backports called Kconfig. When I replace this file with my kernel config (from 2.6.35-3) I get many....
Kconfig:1967: syntax error
Kconfig:1966: unknown statement "CONFIG_CRC_ITU_T" Kconfig:1967: unknown statement "CONFIG_CRC32" Kconfig:1971: syntax error
Kconfig:1970: unknown statement "CONFIG_ZLIB_INFLATE" Kconfig:1971: unknown statement "CONFIG_ZLIB_DEFLATE" Kconfig:1972: unknown statement "CONFIG_LZO_COMPRESS" Kconfig:1973: unknown statement "CONFIG_LZO_DECOMPRESS" Kconfig:1974: unknown statement "CONFIG_GENERIC_ALLOCATOR" Kconfig:1975: unknown statement "CONFIG_HAS_IOMEM" Kconfig:1976: unknown statement "CONFIG_HAS_IOPORT" Kconfig:1977: unknown statement "CONFIG_HAS_DMA" Kconfig:1978: unknown statement "CONFIG_NLATTR" make[1]: *** [menuconfig] Error 1
make: *** [menuconfig] Error 2
What is the right way to do this? I could add CONFIG_BT=y to the default Kconfig file, but that seems hackish.
Jon
Re: Issue reading kernel config
So I had a look at the Kconfig file and realised it isn't a kernel config. If I add
config BT
def_bool y
under the "# some hacks ..." section, I can enable BT drivers in backports in the menuconfig. So if a kconfig depends on an external config, there is no way to feed in a kernel config to backports? you list external config under "# some hacks ..." section?
Jon
Quoted 24 lines · Jonathan Bagg
Hello,
I am cross compiling backports successful using "alldefconfig". I would like use menuconfig and have conf read in options from my kernel instead of the default. (
CONFIG_BTis not enabled in the default and I want to enable BT drivers in backports). It looks like kconf/conf program is loading a kernel config from the root of backports calledKconfig. When I replace this file with my kernel config (from 2.6.35-3) I get many....Kconfig:1967: syntax error
Kconfig:1966: unknown statement "CONFIG_CRC_ITU_T" Kconfig:1967: unknown statement "CONFIG_CRC32" Kconfig:1971: syntax error
Kconfig:1970: unknown statement "CONFIG_ZLIB_INFLATE" Kconfig:1971: unknown statement "CONFIG_ZLIB_DEFLATE" Kconfig:1972: unknown statement "CONFIG_LZO_COMPRESS" Kconfig:1973: unknown statement "CONFIG_LZO_DECOMPRESS" Kconfig:1974: unknown statement "CONFIG_GENERIC_ALLOCATOR" Kconfig:1975: unknown statement "CONFIG_HAS_IOMEM" Kconfig:1976: unknown statement "CONFIG_HAS_IOPORT" Kconfig:1977: unknown statement "CONFIG_HAS_DMA" Kconfig:1978: unknown statement "CONFIG_NLATTR" make[1]: *** [menuconfig] Error 1
make: *** [menuconfig] Error 2What is the right way to do this? I could add
CONFIG_BT=yto the defaultKconfigfile, but that seems hackish.Jon
Re: Issue reading kernel config
Quoted 10 lines · Jonathan Bagg
So I had a look at the
Kconfigfile and realised it isn't a kernel config. If I addconfig BT
def_boolyunder the "# some hacks ..." section, I can enable BT drivers in backports in the menuconfig. So if a kconfig depends on an external config, there is no way to feed in a kernel config to backports? you list external config under "# some hacks ..." section?
The script should create a dummy Kconfig.kernel from your kernel's .config, and read that for the dependencies from the kernel.
johannes
Re: Issue reading kernel config
Quoted 7 lines · Johannes Berg
Quoted 6 lines · Jonathan Bagg
So I had a look at the
Kconfigfile and realised it isn't a kernel config. If I addconfig BT
def_booly
Quoted 6 lines
Quoted 4 lines
under the "# some hacks ..." section, I can enable BT drivers in backports in the menuconfig. So if a kconfig depends on an external config, there is no way to feed in a kernel config to backports? you list external config under "# some hacks ..." section?
The script should create a dummy
Kconfig.kernelfrom your kernel's .config, and read that for the dependencies from the kernel.
I'd like to figure out why it isn't working. Which script reads the kernel's .config?
Jon
Re: Issue reading kernel config
Quoted 5 lines · Jonathan Bagg
Quoted 2 lines
The script should create a dummy
Kconfig.kernelfrom your kernel's .config, and read that for the dependencies from the kernel.I'd like to figure out why it isn't working. Which script reads the kernel's .config?
It's an inline script in the Makefile, this part:
@set -e ; if [ "$$(cat .kernel_config_md5 2>/dev/null)" != "$(CONFIG_MD5)" ] ;\
then \
echo -n "Generating local configuration database from kernel ..." ;\...
johannes
Re: [PATCH v2 8/8] ath9k: Add statistics for antenna diversity
In reply to Sujith ManoharanI can't get this one to apply. Please check the latest tree and fix it up?
Thanks,
John
Quoted 245 lines · Sujith Manoharan
From: Sujith Manoharan <[email protected]>
Signed-off-by Sujith Manoharan <[email protected]>--- drivers/net/wireless/ath/ath9k/antenna.c | 18 ++++--- drivers/net/wireless/ath/ath9k/debug.c | 85 ++++++++++++++++++++++++++------ drivers/net/wireless/ath/ath9k/debug.h | 20 +++++--- 3 files changed, 95 insertions(+), 28 deletions(-)drivers/net/wireless/ath/ath9k/antenna.c +11
-7@@ -734,15 +734,18 @@ void ath_ant_comb_scan(struct ath_softc *sc, struct ath_rx_status *rs) antcomb->main_total_rssi += main_rssi; antcomb->alt_total_rssi += alt_rssi; -if (main_ant_conf == rx_ant_conf) { +if (main_ant_conf == rx_ant_conf) antcomb->main_recv_cnt++; -ANT_STAT_INC (ANT_MAIN , recv_cnt); -ANT_LNA_INC (ANT_MAIN , rx_ant_conf); - }else { +else antcomb->alt_recv_cnt++; -ANT_STAT_INC (ANT_ALT , recv_cnt); -ANT_LNA_INC (ANT_ALT , rx_ant_conf); - } + } + +if (main_ant_conf == rx_ant_conf) { +ANT_STAT_INC (ANT_MAIN , recv_cnt); +ANT_LNA_INC (ANT_MAIN , rx_ant_conf); + }else { +ANT_STAT_INC (ANT_ALT , recv_cnt); +ANT_LNA_INC (ANT_ALT , rx_ant_conf); }/* Short scan check */ @@ -821,6 +824,7 @@ void ath_ant_comb_scan(struct ath_softc *sc, struct ath_rx_status *rs) div_comb_done:ath_ant_div_conf_fast_divbias (&div_ant_conf, antcomb, alt_ratio);ath9k_hw_antdiv_comb_conf_set (sc->sc_ah, &div_ant_conf); +ath9k_debug_stat_ant (sc, &div_ant_conf, main_rssi_avg, alt_rssi_avg); antcomb->scan_start_time = jiffies; antcomb->total_pkt_count =0 ;drivers/net/wireless/ath/ath9k/debug.c +71
-14@@ -321,6 +321,20 @@ static const struct file_operations fops_bt_ant_diversity = { .llseek = default_llseek, }; +void ath9k_debug_stat_ant (struct ath_softc *sc, +struct ath_hw_antcomb_conf *div_ant_conf, +int main_rssi_avg,int alt_rssi_avg) +{ +struct ath_antenna_stats *as_main = &sc->debug.stats.ant_stats[ANT_MAIN ]; +struct ath_antenna_stats *as_alt = &sc->debug.stats.ant_stats[ANT_ALT ]; + + as_main->lna_attempt_cnt[div_ant_conf->main_lna_conf]++; + as_alt->lna_attempt_cnt[div_ant_conf->alt_lna_conf]++; + + as_main->rssi_avg = main_rssi_avg; + as_alt->rssi_avg = alt_rssi_avg; +} +static ssize_t read_file_antenna_diversity (struct file *file,char __user *user_buf,size_t count,loff_t *ppos)@@ -330,9 +344,14 @@ static ssize_t read_file_antenna_diversity(struct file *file,struct ath9k_hw_capabilities *pCap = &ah->caps;struct ath_antenna_stats *as_main = &sc->debug.stats.ant_stats[ANT_MAIN ];struct ath_antenna_stats *as_alt = &sc->debug.stats.ant_stats[ANT_ALT ]; +struct ath_hw_antcomb_conf div_ant_conf;unsigned int len =0 , size =1024 ;ssize_t retval =0 ;char *buf; +char *lna_conf_str[4 ] = {"LNA1_MINUS_LNA2" , +"LNA2" , +"LNA1" , +"LNA1_PLUS_LNA2" }; buf =kzalloc (size,GFP_KERNEL );if (buf ==NULL )@@ -344,28 +363,66 @@ static ssize_t read_file_antenna_diversity(struct file *file, goto exit; } +ath9k_ps_wakeup (sc); +ath9k_hw_antdiv_comb_conf_get (ah, &div_ant_conf); + len +=snprintf (buf + len, size - len,"Current MAIN config : %s\n" , + lna_conf_str[div_ant_conf.main_lna_conf]); + len +=snprintf (buf + len, size - len,"Current ALT config : %s\n" , + lna_conf_str[div_ant_conf.alt_lna_conf]); + len +=snprintf (buf + len, size - len,"Average MAIN RSSI : %d\n" , + as_main->rssi_avg); + len +=snprintf (buf + len, size - len,"Average ALT RSSI : %d\n\n" , + as_alt->rssi_avg); +ath9k_ps_restore (sc); + + len +=snprintf (buf + len, size - len,"Packet Receive Cnt:\n" ); + len +=snprintf (buf + len, size - len,"-------------------\n" ); + len +=snprintf (buf + len, size - len,"%30s%15s\n" ,"MAIN" ,"ALT" ); - len +=snprintf (buf + len, size - len,"%-15s%15d%15d\n" , -"RECV CNT" , + len +=snprintf (buf + len, size - len,"%-14s:%15d%15d\n" , +"TOTAL COUNT" , as_main->recv_cnt, as_alt->recv_cnt); - len +=snprintf (buf + len, size - len,"%-15s%15d%15d\n" , + len +=snprintf (buf + len, size - len,"%-14s:%15d%15d\n" , +"LNA1" , + as_main->lna_recv_cnt[ATH_ANT_DIV_COMB_LNA1 ], + as_alt->lna_recv_cnt[ATH_ANT_DIV_COMB_LNA1 ]); + len +=snprintf (buf + len, size - len,"%-14s:%15d%15d\n" , +"LNA2" , + as_main->lna_recv_cnt[ATH_ANT_DIV_COMB_LNA2 ], + as_alt->lna_recv_cnt[ATH_ANT_DIV_COMB_LNA2 ]); + len +=snprintf (buf + len, size - len,"%-14s:%15d%15d\n" , +"LNA1 + LNA2" , + as_main->lna_recv_cnt[ATH_ANT_DIV_COMB_LNA1_PLUS_LNA2 ], + as_alt->lna_recv_cnt[ATH_ANT_DIV_COMB_LNA1_PLUS_LNA2 ]); + len +=snprintf (buf + len, size - len,"%-14s:%15d%15d\n" , +"LNA1 - LNA2" , + as_main->lna_recv_cnt[ATH_ANT_DIV_COMB_LNA1_MINUS_LNA2 ], + as_alt->lna_recv_cnt[ATH_ANT_DIV_COMB_LNA1_MINUS_LNA2 ]); + + len +=snprintf (buf + len, size - len,"\nLNA Config Attempts:\n" ); + len +=snprintf (buf + len, size - len,"--------------------\n" ); + + len +=snprintf (buf + len, size - len,"%30s%15s\n" , +"MAIN" ,"ALT" ); + len +=snprintf (buf + len, size - len,"%-14s:%15d%15d\n" ,"LNA1" , - as_main->lna_config_cnt[ATH_ANT_DIV_COMB_LNA1 ], - as_alt->lna_config_cnt[ATH_ANT_DIV_COMB_LNA1 ]); - len +=snprintf (buf + len, size - len,"%-15s%15d%15d\n" , + as_main->lna_attempt_cnt[ATH_ANT_DIV_COMB_LNA1 ], + as_alt->lna_attempt_cnt[ATH_ANT_DIV_COMB_LNA1 ]); + len +=snprintf (buf + len, size - len,"%-14s:%15d%15d\n" ,"LNA2" , - as_main->lna_config_cnt[ATH_ANT_DIV_COMB_LNA2 ], - as_alt->lna_config_cnt[ATH_ANT_DIV_COMB_LNA2 ]); - len +=snprintf (buf + len, size - len,"%-15s%15d%15d\n" , + as_main->lna_attempt_cnt[ATH_ANT_DIV_COMB_LNA2 ], + as_alt->lna_attempt_cnt[ATH_ANT_DIV_COMB_LNA2 ]); + len +=snprintf (buf + len, size - len,"%-14s:%15d%15d\n" ,"LNA1 + LNA2" , - as_main->lna_config_cnt[ATH_ANT_DIV_COMB_LNA1_PLUS_LNA2 ], - as_alt->lna_config_cnt[ATH_ANT_DIV_COMB_LNA1_PLUS_LNA2 ]); - len +=snprintf (buf + len, size - len,"%-15s%15d%15d\n" , + as_main->lna_attempt_cnt[ATH_ANT_DIV_COMB_LNA1_PLUS_LNA2 ], + as_alt->lna_attempt_cnt[ATH_ANT_DIV_COMB_LNA1_PLUS_LNA2 ]); + len +=snprintf (buf + len, size - len,"%-14s:%15d%15d\n" ,"LNA1 - LNA2" , - as_main->lna_config_cnt[ATH_ANT_DIV_COMB_LNA1_MINUS_LNA2 ], - as_alt->lna_config_cnt[ATH_ANT_DIV_COMB_LNA1_MINUS_LNA2 ]); + as_main->lna_attempt_cnt[ATH_ANT_DIV_COMB_LNA1_MINUS_LNA2 ], + as_alt->lna_attempt_cnt[ATH_ANT_DIV_COMB_LNA1_MINUS_LNA2 ]); + exit:if (len > size) len = size;drivers/net/wireless/ath/ath9k/debug.h +13
-7@@ -29,7 +29,7 @@ struct fft_sample_tlv;#define TX_STAT_INC (q, c) sc->debug.stats.txstats[q].c++#define RESET_STAT_INC (sc, type) sc->debug.stats.reset[type]++#define ANT_STAT_INC (i, c) sc->debug.stats.ant_stats[i].c++ -#define ANT_LNA_INC (i, c) sc->debug.stats.ant_stats[i].lna_config_cnt[c]++; +#define ANT_LNA_INC (i, c) sc->debug.stats.ant_stats[i].lna_recv_cnt[c]++;#else #define TX_STAT_INC (q, c) do { } while (0)#define RESET_STAT_INC (sc, type) do { } while (0)@@ -252,7 +252,9 @@ struct ath_rx_stats {struct ath_antenna_stats {u32 recv_cnt; -u32 lna_config_cnt[4 ]; +u32 rssi_avg; +u32 lna_recv_cnt[4 ]; +u32 lna_attempt_cnt[4 ]; };struct ath_stats {@@ -294,10 +296,11 @@ void ath9k_sta_remove_debugfs(struct ieee80211_hw *hw,struct ieee80211_vif *vif, struct ieee80211_sta *sta, struct dentry *dir); -void ath_debug_send_fft_sample (struct ath_softc *sc,struct fft_sample_tlv *fft_sample); - +void ath9k_debug_stat_ant (struct ath_softc *sc, +struct ath_hw_antcomb_conf *div_ant_conf, +int main_rssi_avg,int alt_rssi_avg);#else #define RX_STAT_INC (c)/* NOP */ @@ -310,12 +313,10 @@ static inline int ath9k_init_debug(struct ath_hw *ah)static inline void ath9k_deinit_debug (struct ath_softc *sc) { } -static inline void ath_debug_stat_interrupt (struct ath_softc *sc,enum ath9k_int status) { } - static inline void ath_debug_stat_tx(struct ath_softc *sc, struct ath_buf *bf, struct ath_tx_status *ts,@@ -323,11 +324,16 @@ static inline void ath_debug_stat_tx(struct ath_softc *sc, unsigned int flags) { } -static inline void ath_debug_stat_rx (struct ath_softc *sc,struct ath_rx_status *rs) { } +static inline void ath9k_debug_stat_ant (struct ath_softc *sc, +struct ath_hw_antcomb_conf *div_ant_conf, +int main_rssi_avg,int alt_rssi_avg) +{ + +}#endif /* CONFIG_ATH9K_DEBUGFS */ Signature · 6 lines
1.8.3.4 -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Signature · 2 lines
John W. Linville Someday the world will need a hero, and you [email protected] might be all we have. Be ready.
Re: [PATCH v2 8/8] ath9k: Add statistics for antenna diversity
Nevermind -- I had a patch that I was applying out of order...
Quoted 257 lines · John W. Linville
I can't get this one to apply. Please check the latest tree and fix it up?
Thanks,
John
Quoted 245 lines · Sujith Manoharan
From: Sujith Manoharan <[email protected]>
Signed-off-by Sujith Manoharan <[email protected]>--- drivers/net/wireless/ath/ath9k/antenna.c | 18 ++++--- drivers/net/wireless/ath/ath9k/debug.c | 85 ++++++++++++++++++++++++++------ drivers/net/wireless/ath/ath9k/debug.h | 20 +++++--- 3 files changed, 95 insertions(+), 28 deletions(-)drivers/net/wireless/ath/ath9k/antenna.c +11
-7@@ -734,15 +734,18 @@ void ath_ant_comb_scan(struct ath_softc *sc, struct ath_rx_status *rs) antcomb->main_total_rssi += main_rssi; antcomb->alt_total_rssi += alt_rssi; -if (main_ant_conf == rx_ant_conf) { +if (main_ant_conf == rx_ant_conf) antcomb->main_recv_cnt++; -ANT_STAT_INC (ANT_MAIN , recv_cnt); -ANT_LNA_INC (ANT_MAIN , rx_ant_conf); - }else { +else antcomb->alt_recv_cnt++; -ANT_STAT_INC (ANT_ALT , recv_cnt); -ANT_LNA_INC (ANT_ALT , rx_ant_conf); - } + } + +if (main_ant_conf == rx_ant_conf) { +ANT_STAT_INC (ANT_MAIN , recv_cnt); +ANT_LNA_INC (ANT_MAIN , rx_ant_conf); + }else { +ANT_STAT_INC (ANT_ALT , recv_cnt); +ANT_LNA_INC (ANT_ALT , rx_ant_conf); }/* Short scan check */ @@ -821,6 +824,7 @@ void ath_ant_comb_scan(struct ath_softc *sc, struct ath_rx_status *rs) div_comb_done:ath_ant_div_conf_fast_divbias (&div_ant_conf, antcomb, alt_ratio);ath9k_hw_antdiv_comb_conf_set (sc->sc_ah, &div_ant_conf); +ath9k_debug_stat_ant (sc, &div_ant_conf, main_rssi_avg, alt_rssi_avg); antcomb->scan_start_time = jiffies; antcomb->total_pkt_count =0 ;drivers/net/wireless/ath/ath9k/debug.c +71
-14@@ -321,6 +321,20 @@ static const struct file_operations fops_bt_ant_diversity = { .llseek = default_llseek, }; +void ath9k_debug_stat_ant (struct ath_softc *sc, +struct ath_hw_antcomb_conf *div_ant_conf, +int main_rssi_avg,int alt_rssi_avg) +{ +struct ath_antenna_stats *as_main = &sc->debug.stats.ant_stats[ANT_MAIN ]; +struct ath_antenna_stats *as_alt = &sc->debug.stats.ant_stats[ANT_ALT ]; + + as_main->lna_attempt_cnt[div_ant_conf->main_lna_conf]++; + as_alt->lna_attempt_cnt[div_ant_conf->alt_lna_conf]++; + + as_main->rssi_avg = main_rssi_avg; + as_alt->rssi_avg = alt_rssi_avg; +} +static ssize_t read_file_antenna_diversity (struct file *file,char __user *user_buf,size_t count,loff_t *ppos)@@ -330,9 +344,14 @@ static ssize_t read_file_antenna_diversity(struct file *file,struct ath9k_hw_capabilities *pCap = &ah->caps;struct ath_antenna_stats *as_main = &sc->debug.stats.ant_stats[ANT_MAIN ];struct ath_antenna_stats *as_alt = &sc->debug.stats.ant_stats[ANT_ALT ]; +struct ath_hw_antcomb_conf div_ant_conf;unsigned int len =0 , size =1024 ;ssize_t retval =0 ;char *buf; +char *lna_conf_str[4 ] = {"LNA1_MINUS_LNA2" , +"LNA2" , +"LNA1" , +"LNA1_PLUS_LNA2" }; buf =kzalloc (size,GFP_KERNEL );if (buf ==NULL )@@ -344,28 +363,66 @@ static ssize_t read_file_antenna_diversity(struct file *file, goto exit; } +ath9k_ps_wakeup (sc); +ath9k_hw_antdiv_comb_conf_get (ah, &div_ant_conf); + len +=snprintf (buf + len, size - len,"Current MAIN config : %s\n" , + lna_conf_str[div_ant_conf.main_lna_conf]); + len +=snprintf (buf + len, size - len,"Current ALT config : %s\n" , + lna_conf_str[div_ant_conf.alt_lna_conf]); + len +=snprintf (buf + len, size - len,"Average MAIN RSSI : %d\n" , + as_main->rssi_avg); + len +=snprintf (buf + len, size - len,"Average ALT RSSI : %d\n\n" , + as_alt->rssi_avg); +ath9k_ps_restore (sc); + + len +=snprintf (buf + len, size - len,"Packet Receive Cnt:\n" ); + len +=snprintf (buf + len, size - len,"-------------------\n" ); + len +=snprintf (buf + len, size - len,"%30s%15s\n" ,"MAIN" ,"ALT" ); - len +=snprintf (buf + len, size - len,"%-15s%15d%15d\n" , -"RECV CNT" , + len +=snprintf (buf + len, size - len,"%-14s:%15d%15d\n" , +"TOTAL COUNT" , as_main->recv_cnt, as_alt->recv_cnt); - len +=snprintf (buf + len, size - len,"%-15s%15d%15d\n" , + len +=snprintf (buf + len, size - len,"%-14s:%15d%15d\n" , +"LNA1" , + as_main->lna_recv_cnt[ATH_ANT_DIV_COMB_LNA1 ], + as_alt->lna_recv_cnt[ATH_ANT_DIV_COMB_LNA1 ]); + len +=snprintf (buf + len, size - len,"%-14s:%15d%15d\n" , +"LNA2" , + as_main->lna_recv_cnt[ATH_ANT_DIV_COMB_LNA2 ], + as_alt->lna_recv_cnt[ATH_ANT_DIV_COMB_LNA2 ]); + len +=snprintf (buf + len, size - len,"%-14s:%15d%15d\n" , +"LNA1 + LNA2" , + as_main->lna_recv_cnt[ATH_ANT_DIV_COMB_LNA1_PLUS_LNA2 ], + as_alt->lna_recv_cnt[ATH_ANT_DIV_COMB_LNA1_PLUS_LNA2 ]); + len +=snprintf (buf + len, size - len,"%-14s:%15d%15d\n" , +"LNA1 - LNA2" , + as_main->lna_recv_cnt[ATH_ANT_DIV_COMB_LNA1_MINUS_LNA2 ], + as_alt->lna_recv_cnt[ATH_ANT_DIV_COMB_LNA1_MINUS_LNA2 ]); + + len +=snprintf (buf + len, size - len,"\nLNA Config Attempts:\n" ); + len +=snprintf (buf + len, size - len,"--------------------\n" ); + + len +=snprintf (buf + len, size - len,"%30s%15s\n" , +"MAIN" ,"ALT" ); + len +=snprintf (buf + len, size - len,"%-14s:%15d%15d\n" ,"LNA1" , - as_main->lna_config_cnt[ATH_ANT_DIV_COMB_LNA1 ], - as_alt->lna_config_cnt[ATH_ANT_DIV_COMB_LNA1 ]); - len +=snprintf (buf + len, size - len,"%-15s%15d%15d\n" , + as_main->lna_attempt_cnt[ATH_ANT_DIV_COMB_LNA1 ], + as_alt->lna_attempt_cnt[ATH_ANT_DIV_COMB_LNA1 ]); + len +=snprintf (buf + len, size - len,"%-14s:%15d%15d\n" ,"LNA2" , - as_main->lna_config_cnt[ATH_ANT_DIV_COMB_LNA2 ], - as_alt->lna_config_cnt[ATH_ANT_DIV_COMB_LNA2 ]); - len +=snprintf (buf + len, size - len,"%-15s%15d%15d\n" , + as_main->lna_attempt_cnt[ATH_ANT_DIV_COMB_LNA2 ], + as_alt->lna_attempt_cnt[ATH_ANT_DIV_COMB_LNA2 ]); + len +=snprintf (buf + len, size - len,"%-14s:%15d%15d\n" ,"LNA1 + LNA2" , - as_main->lna_config_cnt[ATH_ANT_DIV_COMB_LNA1_PLUS_LNA2 ], - as_alt->lna_config_cnt[ATH_ANT_DIV_COMB_LNA1_PLUS_LNA2 ]); - len +=snprintf (buf + len, size - len,"%-15s%15d%15d\n" , + as_main->lna_attempt_cnt[ATH_ANT_DIV_COMB_LNA1_PLUS_LNA2 ], + as_alt->lna_attempt_cnt[ATH_ANT_DIV_COMB_LNA1_PLUS_LNA2 ]); + len +=snprintf (buf + len, size - len,"%-14s:%15d%15d\n" ,"LNA1 - LNA2" , - as_main->lna_config_cnt[ATH_ANT_DIV_COMB_LNA1_MINUS_LNA2 ], - as_alt->lna_config_cnt[ATH_ANT_DIV_COMB_LNA1_MINUS_LNA2 ]); + as_main->lna_attempt_cnt[ATH_ANT_DIV_COMB_LNA1_MINUS_LNA2 ], + as_alt->lna_attempt_cnt[ATH_ANT_DIV_COMB_LNA1_MINUS_LNA2 ]); + exit:if (len > size) len = size;drivers/net/wireless/ath/ath9k/debug.h +13
-7@@ -29,7 +29,7 @@ struct fft_sample_tlv;#define TX_STAT_INC (q, c) sc->debug.stats.txstats[q].c++#define RESET_STAT_INC (sc, type) sc->debug.stats.reset[type]++#define ANT_STAT_INC (i, c) sc->debug.stats.ant_stats[i].c++ -#define ANT_LNA_INC (i, c) sc->debug.stats.ant_stats[i].lna_config_cnt[c]++; +#define ANT_LNA_INC (i, c) sc->debug.stats.ant_stats[i].lna_recv_cnt[c]++;#else #define TX_STAT_INC (q, c) do { } while (0)#define RESET_STAT_INC (sc, type) do { } while (0)@@ -252,7 +252,9 @@ struct ath_rx_stats {struct ath_antenna_stats {u32 recv_cnt; -u32 lna_config_cnt[4 ]; +u32 rssi_avg; +u32 lna_recv_cnt[4 ]; +u32 lna_attempt_cnt[4 ]; };struct ath_stats {@@ -294,10 +296,11 @@ void ath9k_sta_remove_debugfs(struct ieee80211_hw *hw,struct ieee80211_vif *vif, struct ieee80211_sta *sta, struct dentry *dir); -void ath_debug_send_fft_sample (struct ath_softc *sc,struct fft_sample_tlv *fft_sample); - +void ath9k_debug_stat_ant (struct ath_softc *sc, +struct ath_hw_antcomb_conf *div_ant_conf, +int main_rssi_avg,int alt_rssi_avg);#else #define RX_STAT_INC (c)/* NOP */ @@ -310,12 +313,10 @@ static inline int ath9k_init_debug(struct ath_hw *ah)static inline void ath9k_deinit_debug (struct ath_softc *sc) { } -static inline void ath_debug_stat_interrupt (struct ath_softc *sc,enum ath9k_int status) { } - static inline void ath_debug_stat_tx(struct ath_softc *sc, struct ath_buf *bf, struct ath_tx_status *ts,@@ -323,11 +324,16 @@ static inline void ath_debug_stat_tx(struct ath_softc *sc, unsigned int flags) { } -static inline void ath_debug_stat_rx (struct ath_softc *sc,struct ath_rx_status *rs) { } +static inline void ath9k_debug_stat_ant (struct ath_softc *sc, +struct ath_hw_antcomb_conf *div_ant_conf, +int main_rssi_avg,int alt_rssi_avg) +{ + +}#endif /* CONFIG_ATH9K_DEBUGFS */ Signature · 6 lines
1.8.3.4 -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.htmlSignature · 2 lines
John W. Linville Someday the world will need a hero, and you [email protected] might be all we have. Be ready.
Signature · 2 lines
John W. Linville Someday the world will need a hero, and you [email protected] might be all we have. Be ready.