All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/8] ath9k: Do a quick scan only when scan_not_start is true
@ 2013-08-01  6:23 Sujith Manoharan
  2013-08-01  6:23 ` [PATCH 2/8] ath9k: Use a subroutine to check for short scan Sujith Manoharan
                   ` (6 more replies)
  0 siblings, 7 replies; 22+ messages in thread
From: Sujith Manoharan @ 2013-08-01  6:23 UTC (permalink / raw)
  To: John Linville; +Cc: linux-wireless

From: Sujith Manoharan <c_manoha@qca.qualcomm.com>

Right now, it is being done for all cases.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
---
 drivers/net/wireless/ath/ath9k/antenna.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/antenna.c b/drivers/net/wireless/ath/ath9k/antenna.c
index 2785dc3..0ba5b86 100644
--- a/drivers/net/wireless/ath/ath9k/antenna.c
+++ b/drivers/net/wireless/ath/ath9k/antenna.c
@@ -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);
-- 
1.8.3.4


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH 2/8] ath9k: Use a subroutine to check for short scan
  2013-08-01  6:23 [PATCH 1/8] ath9k: Do a quick scan only when scan_not_start is true Sujith Manoharan
@ 2013-08-01  6:23 ` Sujith Manoharan
  2013-08-01  6:23 ` [PATCH 3/8] ath9k: Add ALT check for cards with GROUP-3 config Sujith Manoharan
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 22+ messages in thread
From: Sujith Manoharan @ 2013-08-01  6:23 UTC (permalink / raw)
  To: John Linville; +Cc: linux-wireless

From: Sujith Manoharan <c_manoha@qca.qualcomm.com>

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
---
 drivers/net/wireless/ath/ath9k/antenna.c | 37 ++++++++++++++++++++------------
 1 file changed, 23 insertions(+), 14 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/antenna.c b/drivers/net/wireless/ath/ath9k/antenna.c
index 0ba5b86..130e983 100644
--- a/drivers/net/wireless/ath/ath9k/antenna.c
+++ b/drivers/net/wireless/ath/ath9k/antenna.c
@@ -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) {
-- 
1.8.3.4


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH 3/8] ath9k: Add ALT check for cards with GROUP-3 config
  2013-08-01  6:23 [PATCH 1/8] ath9k: Do a quick scan only when scan_not_start is true Sujith Manoharan
  2013-08-01  6:23 ` [PATCH 2/8] ath9k: Use a subroutine to check for short scan Sujith Manoharan
@ 2013-08-01  6:23 ` Sujith Manoharan
  2013-08-01  6:23 ` [PATCH 4/8] ath9k: Use a subroutine to try LNA switch Sujith Manoharan
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 22+ messages in thread
From: Sujith Manoharan @ 2013-08-01  6:23 UTC (permalink / raw)
  To: John Linville; +Cc: linux-wireless

From: Sujith Manoharan <c_manoha@qca.qualcomm.com>

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
---
 drivers/net/wireless/ath/ath9k/antenna.c | 50 +++++++++++++++++++++-----------
 1 file changed, 33 insertions(+), 17 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/antenna.c b/drivers/net/wireless/ath/ath9k/antenna.c
index 130e983..ee25165 100644
--- a/drivers/net/wireless/ath/ath9k/antenna.c
+++ b/drivers/net/wireless/ath/ath9k/antenna.c
@@ -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 =
-- 
1.8.3.4


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH 4/8] ath9k: Use a subroutine to try LNA switch
  2013-08-01  6:23 [PATCH 1/8] ath9k: Do a quick scan only when scan_not_start is true Sujith Manoharan
  2013-08-01  6:23 ` [PATCH 2/8] ath9k: Use a subroutine to check for short scan Sujith Manoharan
  2013-08-01  6:23 ` [PATCH 3/8] ath9k: Add ALT check for cards with GROUP-3 config Sujith Manoharan
@ 2013-08-01  6:23 ` Sujith Manoharan
  2013-08-01  6:23 ` [PATCH 5/8] ath9k: Use a helper function for checking LNA options Sujith Manoharan
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 22+ messages in thread
From: Sujith Manoharan @ 2013-08-01  6:23 UTC (permalink / raw)
  To: John Linville; +Cc: linux-wireless

From: Sujith Manoharan <c_manoha@qca.qualcomm.com>

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
---
 drivers/net/wireless/ath/ath9k/antenna.c | 92 ++++++++++++++++++--------------
 1 file changed, 52 insertions(+), 40 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/antenna.c b/drivers/net/wireless/ath/ath9k/antenna.c
index ee25165..8675c3f 100644
--- a/drivers/net/wireless/ath/ath9k/antenna.c
+++ b/drivers/net/wireless/ath/ath9k/antenna.c
@@ -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:
-- 
1.8.3.4


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH 5/8] ath9k: Use a helper function for checking LNA options
  2013-08-01  6:23 [PATCH 1/8] ath9k: Do a quick scan only when scan_not_start is true Sujith Manoharan
                   ` (2 preceding siblings ...)
  2013-08-01  6:23 ` [PATCH 4/8] ath9k: Use a subroutine to try LNA switch Sujith Manoharan
@ 2013-08-01  6:23 ` Sujith Manoharan
  2013-08-01  6:23 ` [PATCH 6/8] ath9k: Simplify checks in quick_scan Sujith Manoharan
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 22+ messages in thread
From: Sujith Manoharan @ 2013-08-01  6:23 UTC (permalink / raw)
  To: John Linville; +Cc: linux-wireless

From: Sujith Manoharan <c_manoha@qca.qualcomm.com>

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
---
 drivers/net/wireless/ath/ath9k/antenna.c | 166 +++++++++++++++----------------
 1 file changed, 79 insertions(+), 87 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/antenna.c b/drivers/net/wireless/ath/ath9k/antenna.c
index 8675c3f..c52959b 100644
--- a/drivers/net/wireless/ath/ath9k/antenna.c
+++ b/drivers/net/wireless/ath/ath9k/antenna.c
@@ -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;
 		}
-- 
1.8.3.4


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH 6/8] ath9k: Simplify checks in quick_scan
  2013-08-01  6:23 [PATCH 1/8] ath9k: Do a quick scan only when scan_not_start is true Sujith Manoharan
                   ` (3 preceding siblings ...)
  2013-08-01  6:23 ` [PATCH 5/8] ath9k: Use a helper function for checking LNA options Sujith Manoharan
@ 2013-08-01  6:23 ` Sujith Manoharan
  2013-08-01  6:23 ` [PATCH 7/8] ath9k: Use a subroutine to calculate ALT ratio Sujith Manoharan
  2013-08-01  6:23 ` [PATCH 8/8] ath9k: Add statistics for antenna diversity Sujith Manoharan
  6 siblings, 0 replies; 22+ messages in thread
From: Sujith Manoharan @ 2013-08-01  6:23 UTC (permalink / raw)
  To: John Linville; +Cc: linux-wireless

From: Sujith Manoharan <c_manoha@qca.qualcomm.com>

There is a function to do a ratio comparison for ALT,
so make use of it.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
---
 drivers/net/wireless/ath/ath9k/antenna.c | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/antenna.c b/drivers/net/wireless/ath/ath9k/antenna.c
index c52959b..82839b0 100644
--- a/drivers/net/wireless/ath/ath9k/antenna.c
+++ b/drivers/net/wireless/ath/ath9k/antenna.c
@@ -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;
-- 
1.8.3.4


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH 7/8] ath9k: Use a subroutine to calculate ALT ratio
  2013-08-01  6:23 [PATCH 1/8] ath9k: Do a quick scan only when scan_not_start is true Sujith Manoharan
                   ` (4 preceding siblings ...)
  2013-08-01  6:23 ` [PATCH 6/8] ath9k: Simplify checks in quick_scan Sujith Manoharan
@ 2013-08-01  6:23 ` Sujith Manoharan
  2013-08-01  6:23 ` [PATCH 8/8] ath9k: Add statistics for antenna diversity Sujith Manoharan
  6 siblings, 0 replies; 22+ messages in thread
From: Sujith Manoharan @ 2013-08-01  6:23 UTC (permalink / raw)
  To: John Linville; +Cc: linux-wireless

From: Sujith Manoharan <c_manoha@qca.qualcomm.com>

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
---
 drivers/net/wireless/ath/ath9k/antenna.c | 173 ++++++++++++++-----------------
 1 file changed, 79 insertions(+), 94 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/antenna.c b/drivers/net/wireless/ath/ath9k/antenna.c
index 82839b0..42f3b87 100644
--- a/drivers/net/wireless/ath/ath9k/antenna.c
+++ b/drivers/net/wireless/ath/ath9k/antenna.c
@@ -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;
-- 
1.8.3.4


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH 8/8] ath9k: Add statistics for antenna diversity
  2013-08-01  6:23 [PATCH 1/8] ath9k: Do a quick scan only when scan_not_start is true Sujith Manoharan
                   ` (5 preceding siblings ...)
  2013-08-01  6:23 ` [PATCH 7/8] ath9k: Use a subroutine to calculate ALT ratio Sujith Manoharan
@ 2013-08-01  6:23 ` Sujith Manoharan
  2013-08-01 15:27   ` [PATCH v2 " Sujith Manoharan
  6 siblings, 1 reply; 22+ messages in thread
From: Sujith Manoharan @ 2013-08-01  6:23 UTC (permalink / raw)
  To: John Linville; +Cc: linux-wireless

From: Sujith Manoharan <c_manoha@qca.qualcomm.com>

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
---
 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(-)

diff --git a/drivers/net/wireless/ath/ath9k/antenna.c b/drivers/net/wireless/ath/ath9k/antenna.c
index 42f3b87..953d2af 100644
--- a/drivers/net/wireless/ath/ath9k/antenna.c
+++ b/drivers/net/wireless/ath/ath9k/antenna.c
@@ -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;
diff --git a/drivers/net/wireless/ath/ath9k/debug.c b/drivers/net/wireless/ath/ath9k/debug.c
index 56cbe5d..dbb6554 100644
--- a/drivers/net/wireless/ath/ath9k/debug.c
+++ b/drivers/net/wireless/ath/ath9k/debug.c
@@ -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,70 @@ 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",
+			"INVALID RSSI",
+			as_main->invalid_rssi,
+			as_alt->invalid_rssi);
+	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;
diff --git a/drivers/net/wireless/ath/ath9k/debug.h b/drivers/net/wireless/ath/ath9k/debug.h
index a879e45..3d66fc9 100644
--- a/drivers/net/wireless/ath/ath9k/debug.h
+++ b/drivers/net/wireless/ath/ath9k/debug.h
@@ -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 */
 
-- 
1.8.3.4


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH v2 8/8] ath9k: Add statistics for antenna diversity
  2013-08-01  6:23 ` [PATCH 8/8] ath9k: Add statistics for antenna diversity Sujith Manoharan
@ 2013-08-01 15:27   ` Sujith Manoharan
  2013-08-01 16:37     ` cross compile backports? Jonathan Bagg
  2013-08-01 19:44     ` [PATCH v2 8/8] ath9k: Add statistics for antenna diversity John W. Linville
  0 siblings, 2 replies; 22+ messages in thread
From: Sujith Manoharan @ 2013-08-01 15:27 UTC (permalink / raw)
  To: John Linville; +Cc: linux-wireless

From: Sujith Manoharan <c_manoha@qca.qualcomm.com>

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
---
 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(-)

diff --git a/drivers/net/wireless/ath/ath9k/antenna.c b/drivers/net/wireless/ath/ath9k/antenna.c
index 42f3b87..391d557 100644
--- a/drivers/net/wireless/ath/ath9k/antenna.c
+++ b/drivers/net/wireless/ath/ath9k/antenna.c
@@ -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;
diff --git a/drivers/net/wireless/ath/ath9k/debug.c b/drivers/net/wireless/ath/ath9k/debug.c
index 56cbe5d..a43bd8c 100644
--- a/drivers/net/wireless/ath/ath9k/debug.c
+++ b/drivers/net/wireless/ath/ath9k/debug.c
@@ -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;
diff --git a/drivers/net/wireless/ath/ath9k/debug.h b/drivers/net/wireless/ath/ath9k/debug.h
index a879e45..01c5c6a 100644
--- a/drivers/net/wireless/ath/ath9k/debug.h
+++ b/drivers/net/wireless/ath/ath9k/debug.h
@@ -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 */
 
-- 
1.8.3.4


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* cross compile backports?
  2013-08-01 15:27   ` [PATCH v2 " Sujith Manoharan
@ 2013-08-01 16:37     ` Jonathan Bagg
  2013-08-01 17:47       ` Solomon Peachy
  2013-08-01 19:44     ` [PATCH v2 8/8] ath9k: Add statistics for antenna diversity John W. Linville
  1 sibling, 1 reply; 22+ messages in thread
From: Jonathan Bagg @ 2013-08-01 16:37 UTC (permalink / raw)
  To: linux-wireless

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/linux

Jon

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: cross compile backports?
  2013-08-01 16:37     ` cross compile backports? Jonathan Bagg
@ 2013-08-01 17:47       ` Solomon Peachy
  2013-08-01 19:03         ` Luis R. Rodriguez
  2013-08-01 19:12         ` cross compile backports with LTIB Jonathan Bagg
  0 siblings, 2 replies; 22+ messages in thread
From: Solomon Peachy @ 2013-08-01 17:47 UTC (permalink / raw)
  To: Jonathan Bagg; +Cc: linux-wireless, backports

[-- Attachment #1: Type: text/plain, Size: 1449 bytes --]

On Thu, Aug 01, 2013 at 12:37:33PM -0400, Jonathan Bagg wrote:
> 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......

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
-- 
Solomon Peachy        		       pizza at shaftnet dot org
Delray Beach, FL                          ^^ (email/xmpp) ^^
Quidquid latine dictum sit, altum viditur.

[-- Attachment #2: Type: application/pgp-signature, Size: 190 bytes --]

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: cross compile backports?
  2013-08-01 17:47       ` Solomon Peachy
@ 2013-08-01 19:03         ` Luis R. Rodriguez
  2013-08-01 19:36           ` Solomon Peachy
  2013-08-01 19:12         ` cross compile backports with LTIB Jonathan Bagg
  1 sibling, 1 reply; 22+ messages in thread
From: Luis R. Rodriguez @ 2013-08-01 19:03 UTC (permalink / raw)
  To: Solomon Peachy; +Cc: Jonathan Bagg, linux-wireless, backports

On Thu, Aug 1, 2013 at 10:47 AM, Solomon Peachy <pizza@shaftnet.org> wrote:
> On Thu, Aug 01, 2013 at 12:37:33PM -0400, Jonathan Bagg wrote:
>> 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......
>
> 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.

Thanks, now:

https://backports.wiki.kernel.org/index.php/Documentation#Cross_compiling

Patches welcome to help improve the cross compile install target.

  Luis

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: cross compile backports with LTIB
  2013-08-01 17:47       ` Solomon Peachy
  2013-08-01 19:03         ` Luis R. Rodriguez
@ 2013-08-01 19:12         ` Jonathan Bagg
  2013-08-01 19:17           ` Jonathan Bagg
  2013-08-07 19:55           ` Issue reading kernel config Jonathan Bagg
  1 sibling, 2 replies; 22+ messages in thread
From: Jonathan Bagg @ 2013-08-01 19:12 UTC (permalink / raw)
  To: backports; +Cc: Solomon Peachy, linux-wireless

On 13-08-01 01:47 PM, Solomon Peachy wrote:
> On Thu, Aug 01, 2013 at 12:37:33PM -0400, Jonathan Bagg wrote:
>> 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......
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

> 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


-- 
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


^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: cross compile backports with LTIB
  2013-08-01 19:12         ` cross compile backports with LTIB Jonathan Bagg
@ 2013-08-01 19:17           ` Jonathan Bagg
  2013-08-07 19:55           ` Issue reading kernel config Jonathan Bagg
  1 sibling, 0 replies; 22+ messages in thread
From: Jonathan Bagg @ 2013-08-01 19:17 UTC (permalink / raw)
  To: backports; +Cc: Solomon Peachy, linux-wireless

On 13-08-01 03:12 PM, Jonathan Bagg wrote:
> On 13-08-01 01:47 PM, Solomon Peachy wrote:
>> On Thu, Aug 01, 2013 at 12:37:33PM -0400, Jonathan Bagg wrote:
>>> 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......
> 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)
> %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 

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: cross compile backports?
  2013-08-01 19:03         ` Luis R. Rodriguez
@ 2013-08-01 19:36           ` Solomon Peachy
  0 siblings, 0 replies; 22+ messages in thread
From: Solomon Peachy @ 2013-08-01 19:36 UTC (permalink / raw)
  To: Luis R. Rodriguez; +Cc: backports

[-- Attachment #1: Type: text/plain, Size: 652 bytes --]

On Thu, Aug 01, 2013 at 12:03:08PM -0700, Luis R. Rodriguez wrote:
> 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
-- 
Solomon Peachy        		       pizza at shaftnet dot org
Delray Beach, FL                          ^^ (email/xmpp) ^^
Quidquid latine dictum sit, altum viditur.

[-- Attachment #2: Type: application/pgp-signature, Size: 190 bytes --]

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH v2 8/8] ath9k: Add statistics for antenna diversity
  2013-08-01 15:27   ` [PATCH v2 " Sujith Manoharan
  2013-08-01 16:37     ` cross compile backports? Jonathan Bagg
@ 2013-08-01 19:44     ` John W. Linville
  2013-08-01 19:53       ` John W. Linville
  1 sibling, 1 reply; 22+ messages in thread
From: John W. Linville @ 2013-08-01 19:44 UTC (permalink / raw)
  To: Sujith Manoharan; +Cc: linux-wireless

I can't get this one to apply.  Please check the latest tree and fix
it up?

Thanks,

John

On Thu, Aug 01, 2013 at 08:57:06PM +0530, Sujith Manoharan wrote:
> From: Sujith Manoharan <c_manoha@qca.qualcomm.com>
> 
> Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
> ---
>  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(-)
> 
> diff --git a/drivers/net/wireless/ath/ath9k/antenna.c b/drivers/net/wireless/ath/ath9k/antenna.c
> index 42f3b87..391d557 100644
> --- a/drivers/net/wireless/ath/ath9k/antenna.c
> +++ b/drivers/net/wireless/ath/ath9k/antenna.c
> @@ -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;
> diff --git a/drivers/net/wireless/ath/ath9k/debug.c b/drivers/net/wireless/ath/ath9k/debug.c
> index 56cbe5d..a43bd8c 100644
> --- a/drivers/net/wireless/ath/ath9k/debug.c
> +++ b/drivers/net/wireless/ath/ath9k/debug.c
> @@ -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;
> diff --git a/drivers/net/wireless/ath/ath9k/debug.h b/drivers/net/wireless/ath/ath9k/debug.h
> index a879e45..01c5c6a 100644
> --- a/drivers/net/wireless/ath/ath9k/debug.h
> +++ b/drivers/net/wireless/ath/ath9k/debug.h
> @@ -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 */
>  
> -- 
> 1.8.3.4
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

-- 
John W. Linville		Someday the world will need a hero, and you
linville@tuxdriver.com			might be all we have.  Be ready.

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH v2 8/8] ath9k: Add statistics for antenna diversity
  2013-08-01 19:44     ` [PATCH v2 8/8] ath9k: Add statistics for antenna diversity John W. Linville
@ 2013-08-01 19:53       ` John W. Linville
  0 siblings, 0 replies; 22+ messages in thread
From: John W. Linville @ 2013-08-01 19:53 UTC (permalink / raw)
  To: Sujith Manoharan; +Cc: linux-wireless

Nevermind -- I had a patch that I was applying out of order...

On Thu, Aug 01, 2013 at 03:44:18PM -0400, John W. Linville wrote:
> I can't get this one to apply.  Please check the latest tree and fix
> it up?
> 
> Thanks,
> 
> John
> 
> On Thu, Aug 01, 2013 at 08:57:06PM +0530, Sujith Manoharan wrote:
> > From: Sujith Manoharan <c_manoha@qca.qualcomm.com>
> > 
> > Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
> > ---
> >  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(-)
> > 
> > diff --git a/drivers/net/wireless/ath/ath9k/antenna.c b/drivers/net/wireless/ath/ath9k/antenna.c
> > index 42f3b87..391d557 100644
> > --- a/drivers/net/wireless/ath/ath9k/antenna.c
> > +++ b/drivers/net/wireless/ath/ath9k/antenna.c
> > @@ -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;
> > diff --git a/drivers/net/wireless/ath/ath9k/debug.c b/drivers/net/wireless/ath/ath9k/debug.c
> > index 56cbe5d..a43bd8c 100644
> > --- a/drivers/net/wireless/ath/ath9k/debug.c
> > +++ b/drivers/net/wireless/ath/ath9k/debug.c
> > @@ -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;
> > diff --git a/drivers/net/wireless/ath/ath9k/debug.h b/drivers/net/wireless/ath/ath9k/debug.h
> > index a879e45..01c5c6a 100644
> > --- a/drivers/net/wireless/ath/ath9k/debug.h
> > +++ b/drivers/net/wireless/ath/ath9k/debug.h
> > @@ -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 */
> >  
> > -- 
> > 1.8.3.4
> > 
> > --
> > To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
> > the body of a message to majordomo@vger.kernel.org
> > More majordomo info at  http://vger.kernel.org/majordomo-info.html
> > 
> 
> -- 
> John W. Linville		Someday the world will need a hero, and you
> linville@tuxdriver.com			might be all we have.  Be ready.

-- 
John W. Linville		Someday the world will need a hero, and you
linville@tuxdriver.com			might be all we have.  Be ready.

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Issue reading kernel config
  2013-08-01 19:12         ` cross compile backports with LTIB Jonathan Bagg
  2013-08-01 19:17           ` Jonathan Bagg
@ 2013-08-07 19:55           ` Jonathan Bagg
  2013-08-07 20:33             ` Jonathan Bagg
  1 sibling, 1 reply; 22+ messages in thread
From: Jonathan Bagg @ 2013-08-07 19:55 UTC (permalink / raw)
  To: backports

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_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


^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: Issue reading kernel config
  2013-08-07 19:55           ` Issue reading kernel config Jonathan Bagg
@ 2013-08-07 20:33             ` Jonathan Bagg
  2013-08-08  6:37               ` Johannes Berg
  0 siblings, 1 reply; 22+ messages in thread
From: Jonathan Bagg @ 2013-08-07 20:33 UTC (permalink / raw)
  To: backports

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


On 13-08-07 03:55 PM, Jonathan Bagg wrote:
> 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_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
>


^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: Issue reading kernel config
  2013-08-07 20:33             ` Jonathan Bagg
@ 2013-08-08  6:37               ` Johannes Berg
  2013-08-08 11:45                 ` Jonathan Bagg
  0 siblings, 1 reply; 22+ messages in thread
From: Johannes Berg @ 2013-08-08  6:37 UTC (permalink / raw)
  To: Jonathan Bagg; +Cc: backports

On Wed, 2013-08-07 at 16:33 -0400, Jonathan Bagg wrote:
> 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?

The script should create a dummy Kconfig.kernel from your
kernel's .config, and read that for the dependencies from the kernel.

johannes


^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: Issue reading kernel config
  2013-08-08  6:37               ` Johannes Berg
@ 2013-08-08 11:45                 ` Jonathan Bagg
  2013-08-08 12:16                   ` Johannes Berg
  0 siblings, 1 reply; 22+ messages in thread
From: Jonathan Bagg @ 2013-08-08 11:45 UTC (permalink / raw)
  To: Johannes Berg; +Cc: backports

On 13-08-08 02:37 AM, Johannes Berg wrote:
> On Wed, 2013-08-07 at 16:33 -0400, Jonathan Bagg wrote:
>> 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?
> The script should create a dummy Kconfig.kernel from 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

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: Issue reading kernel config
  2013-08-08 11:45                 ` Jonathan Bagg
@ 2013-08-08 12:16                   ` Johannes Berg
  0 siblings, 0 replies; 22+ messages in thread
From: Johannes Berg @ 2013-08-08 12:16 UTC (permalink / raw)
  To: Jonathan Bagg; +Cc: backports

On Thu, 2013-08-08 at 07:45 -0400, Jonathan Bagg wrote:

> > The script should create a dummy Kconfig.kernel from 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


^ permalink raw reply	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2013-08-08 12:16 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-08-01  6:23 [PATCH 1/8] ath9k: Do a quick scan only when scan_not_start is true Sujith Manoharan
2013-08-01  6:23 ` [PATCH 2/8] ath9k: Use a subroutine to check for short scan Sujith Manoharan
2013-08-01  6:23 ` [PATCH 3/8] ath9k: Add ALT check for cards with GROUP-3 config Sujith Manoharan
2013-08-01  6:23 ` [PATCH 4/8] ath9k: Use a subroutine to try LNA switch Sujith Manoharan
2013-08-01  6:23 ` [PATCH 5/8] ath9k: Use a helper function for checking LNA options Sujith Manoharan
2013-08-01  6:23 ` [PATCH 6/8] ath9k: Simplify checks in quick_scan Sujith Manoharan
2013-08-01  6:23 ` [PATCH 7/8] ath9k: Use a subroutine to calculate ALT ratio Sujith Manoharan
2013-08-01  6:23 ` [PATCH 8/8] ath9k: Add statistics for antenna diversity Sujith Manoharan
2013-08-01 15:27   ` [PATCH v2 " Sujith Manoharan
2013-08-01 16:37     ` cross compile backports? Jonathan Bagg
2013-08-01 17:47       ` Solomon Peachy
2013-08-01 19:03         ` Luis R. Rodriguez
2013-08-01 19:36           ` Solomon Peachy
2013-08-01 19:12         ` cross compile backports with LTIB Jonathan Bagg
2013-08-01 19:17           ` Jonathan Bagg
2013-08-07 19:55           ` Issue reading kernel config Jonathan Bagg
2013-08-07 20:33             ` Jonathan Bagg
2013-08-08  6:37               ` Johannes Berg
2013-08-08 11:45                 ` Jonathan Bagg
2013-08-08 12:16                   ` Johannes Berg
2013-08-01 19:44     ` [PATCH v2 8/8] ath9k: Add statistics for antenna diversity John W. Linville
2013-08-01 19:53       ` John W. Linville

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.