Linux wireless drivers development
 help / color / mirror / Atom feed
* [PATCH/RFT 11/12] ath10k: re-arrange PCI init code
From: Michal Kazior @ 2013-10-30 11:42 UTC (permalink / raw)
  To: ath10k; +Cc: linux-wireless, greearb, Michal Kazior
In-Reply-To: <1383133346-8135-1-git-send-email-michal.kazior@tieto.com>

This patch moves irq registering after necessary
structures have been allocated and initialized.
This should prevent interrupts from causing
tasklet access invalid memory pointers.

Reported-By: Ben Greear <greearb@candelatech.com>
Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
---
 drivers/net/wireless/ath/ath10k/ce.c  | 19 +++++++--
 drivers/net/wireless/ath/ath10k/ce.h  |  1 +
 drivers/net/wireless/ath/ath10k/pci.c | 79 +++++++++++++++++++++--------------
 3 files changed, 64 insertions(+), 35 deletions(-)

diff --git a/drivers/net/wireless/ath/ath10k/ce.c b/drivers/net/wireless/ath/ath10k/ce.c
index 3e8395d..7517b94 100644
--- a/drivers/net/wireless/ath/ath10k/ce.c
+++ b/drivers/net/wireless/ath/ath10k/ce.c
@@ -792,6 +792,21 @@ static void ath10k_ce_per_engine_handler_adjust(struct ath10k_ce_pipe *ce_state,
 	ath10k_pci_sleep(ar);
 }
 
+int ath10k_ce_enable_err_irq(struct ath10k *ar)
+{
+	int i, ret;
+
+	ret = ath10k_pci_wake(ar);
+	if (ret)
+		return ret;
+
+	for (i = 0; i < CE_COUNT; i++)
+		ath10k_ce_error_intr_enable(ar, ath10k_ce_base_address(i));
+
+	ath10k_pci_sleep(ar);
+	return 0;
+}
+
 int ath10k_ce_disable_interrupts(struct ath10k *ar)
 {
 	int ce_id, ret;
@@ -1058,7 +1073,6 @@ struct ath10k_ce_pipe *ath10k_ce_init(struct ath10k *ar,
 				const struct ce_attr *attr)
 {
 	struct ath10k_ce_pipe *ce_state;
-	u32 ctrl_addr = ath10k_ce_base_address(ce_id);
 	int ret;
 
 	/*
@@ -1104,9 +1118,6 @@ struct ath10k_ce_pipe *ath10k_ce_init(struct ath10k *ar,
 		}
 	}
 
-	/* Enable CE error interrupts */
-	ath10k_ce_error_intr_enable(ar, ctrl_addr);
-
 out:
 	ath10k_pci_sleep(ar);
 	return ce_state;
diff --git a/drivers/net/wireless/ath/ath10k/ce.h b/drivers/net/wireless/ath/ath10k/ce.h
index 67dbde6..8a58bac 100644
--- a/drivers/net/wireless/ath/ath10k/ce.h
+++ b/drivers/net/wireless/ath/ath10k/ce.h
@@ -235,6 +235,7 @@ void ath10k_ce_deinit(struct ath10k_ce_pipe *ce_state);
 void ath10k_ce_per_engine_service_any(struct ath10k *ar);
 void ath10k_ce_per_engine_service(struct ath10k *ar, unsigned int ce_id);
 int ath10k_ce_disable_interrupts(struct ath10k *ar);
+int ath10k_ce_enable_err_irq(struct ath10k *ar);
 
 /* ce_attr.flags values */
 /* Use NonSnooping PCIe accesses? */
diff --git a/drivers/net/wireless/ath/ath10k/pci.c b/drivers/net/wireless/ath/ath10k/pci.c
index 43cdc35..7b606d0 100644
--- a/drivers/net/wireless/ath/ath10k/pci.c
+++ b/drivers/net/wireless/ath/ath10k/pci.c
@@ -1786,18 +1786,6 @@ static int ath10k_pci_ce_init(struct ath10k *ar)
 		pipe_info->buf_sz = (size_t) (attr->src_sz_max);
 	}
 
-	/*
-	 * Initially, establish CE completion handlers for use with BMI.
-	 * These are overwritten with generic handlers after we exit BMI phase.
-	 */
-	pipe_info = &ar_pci->pipe_info[BMI_CE_NUM_TO_TARG];
-	ath10k_ce_send_cb_register(pipe_info->ce_hdl,
-				   ath10k_pci_bmi_send_done, 0);
-
-	pipe_info = &ar_pci->pipe_info[BMI_CE_NUM_TO_HOST];
-	ath10k_ce_recv_cb_register(pipe_info->ce_hdl,
-				   ath10k_pci_bmi_recv_data);
-
 	return 0;
 }
 
@@ -1830,17 +1818,27 @@ static void ath10k_pci_fw_interrupt_handler(struct ath10k *ar)
 	ath10k_pci_sleep(ar);
 }
 
+static void ath10k_pci_start_bmi(struct ath10k *ar)
+{
+	struct ath10k_pci *ar_pci = ath10k_pci_priv(ar);
+	struct ath10k_pci_pipe *pipe;
+
+	/*
+	 * Initially, establish CE completion handlers for use with BMI.
+	 * These are overwritten with generic handlers after we exit BMI phase.
+	 */
+	pipe = &ar_pci->pipe_info[BMI_CE_NUM_TO_TARG];
+	ath10k_ce_send_cb_register(pipe->ce_hdl, ath10k_pci_bmi_send_done, 0);
+
+	pipe = &ar_pci->pipe_info[BMI_CE_NUM_TO_HOST];
+	ath10k_ce_recv_cb_register(pipe->ce_hdl, ath10k_pci_bmi_recv_data);
+}
+
 static int ath10k_pci_hif_power_up(struct ath10k *ar)
 {
 	struct ath10k_pci *ar_pci = ath10k_pci_priv(ar);
 	int ret;
 
-	ret = ath10k_pci_start_intr(ar);
-	if (ret) {
-		ath10k_err("could not start interrupt handling (%d)\n", ret);
-		goto err;
-	}
-
 	/*
 	 * Bring the target up cleanly.
 	 *
@@ -1854,13 +1852,9 @@ static int ath10k_pci_hif_power_up(struct ath10k *ar)
 	ret = ath10k_pci_device_reset(ar);
 	if (ret) {
 		ath10k_err("failed to reset target (%d)\n", ret);
-		goto err_irq;
+		goto err;
 	}
 
-	ret = ath10k_pci_wait_for_target_init(ar);
-	if (ret)
-		goto err_irq;
-
 	if (!test_bit(ATH10K_PCI_FEATURE_SOC_POWER_SAVE, ar_pci->features))
 		/* Force AWAKE forever */
 		ath10k_do_pci_wake(ar);
@@ -1869,25 +1863,48 @@ static int ath10k_pci_hif_power_up(struct ath10k *ar)
 	if (ret)
 		goto err_ps;
 
+	ret = ath10k_ce_disable_interrupts(ar);
+	if (ret) {
+		ath10k_err("could not disable CE interrupts (%d)\n", ret);
+		goto err_ce;
+	}
+
+	ret = ath10k_pci_start_intr(ar);
+	if (ret) {
+		ath10k_err("could not start interrupt handling (%d)\n", ret);
+		goto err_ce;
+	}
+
+	ret = ath10k_pci_wait_for_target_init(ar);
+	if (ret)
+		goto err_irq;
+
+	ret = ath10k_ce_enable_err_irq(ar);
+	if (ret)
+		goto err_irq;
+
 	ret = ath10k_pci_init_config(ar);
 	if (ret)
-		goto err_ce;
+		goto err_irq;
 
 	ret = ath10k_pci_wake_target_cpu(ar);
 	if (ret) {
 		ath10k_err("could not wake up target CPU (%d)\n", ret);
-		goto err_ce;
+		goto err_irq;
 	}
 
+	ath10k_pci_start_bmi(ar);
 	return 0;
 
+err_irq:
+	ath10k_ce_disable_interrupts(ar);
+	ath10k_pci_stop_intr(ar);
+	ath10k_pci_kill_tasklet(ar);
 err_ce:
 	ath10k_pci_ce_deinit(ar);
 err_ps:
 	if (!test_bit(ATH10K_PCI_FEATURE_SOC_POWER_SAVE, ar_pci->features))
 		ath10k_do_pci_sleep(ar);
-err_irq:
-	ath10k_pci_stop_intr(ar);
 err:
 	return ret;
 }
@@ -2156,7 +2173,7 @@ static int ath10k_pci_start_intr_legacy(struct ath10k *ar)
 	if (ret < 0)
 		return ret;
 
-	ret = ath10k_do_pci_wake(ar);
+	ret = ath10k_pci_wake(ar);
 	if (ret) {
 		free_irq(ar_pci->pdev->irq, ar);
 		ath10k_err("target didn't wake up (%d)\n", ret);
@@ -2176,7 +2193,7 @@ static int ath10k_pci_start_intr_legacy(struct ath10k *ar)
 		  ar_pci->mem + (SOC_CORE_BASE_ADDRESS |
 				 PCIE_INTR_ENABLE_ADDRESS));
 
-	ath10k_do_pci_sleep(ar);
+	ath10k_pci_sleep(ar);
 	ath10k_info("legacy interrupt handling\n");
 	return 0;
 }
@@ -2252,7 +2269,7 @@ static int ath10k_pci_wait_for_target_init(struct ath10k *ar)
 	int wait_limit = 300; /* 3 sec */
 	int ret;
 
-	ret = ath10k_do_pci_wake(ar);
+	ret = ath10k_pci_wake(ar);
 	if (ret) {
 		ath10k_err("target didn't wake up (%d)\n", ret);
 		return ret;
@@ -2277,7 +2294,7 @@ static int ath10k_pci_wait_for_target_init(struct ath10k *ar)
 	}
 
 out:
-	ath10k_do_pci_sleep(ar);
+	ath10k_pci_sleep(ar);
 	return ret;
 }
 
-- 
1.8.4.rc3


^ permalink raw reply related

* [PATCH/RFT 12/12] ath10k: add some debug prints
From: Michal Kazior @ 2013-10-30 11:42 UTC (permalink / raw)
  To: ath10k; +Cc: linux-wireless, greearb, Michal Kazior
In-Reply-To: <1383133346-8135-1-git-send-email-michal.kazior@tieto.com>

Some errors were handled too silently. Also add a
print indicating BMI is booted.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
---
 drivers/net/wireless/ath/ath10k/pci.c | 18 ++++++++++++++----
 1 file changed, 14 insertions(+), 4 deletions(-)

diff --git a/drivers/net/wireless/ath/ath10k/pci.c b/drivers/net/wireless/ath/ath10k/pci.c
index 7b606d0..42dd0b7 100644
--- a/drivers/net/wireless/ath/ath10k/pci.c
+++ b/drivers/net/wireless/ath/ath10k/pci.c
@@ -1832,6 +1832,8 @@ static void ath10k_pci_start_bmi(struct ath10k *ar)
 
 	pipe = &ar_pci->pipe_info[BMI_CE_NUM_TO_HOST];
 	ath10k_ce_recv_cb_register(pipe->ce_hdl, ath10k_pci_bmi_recv_data);
+
+	ath10k_dbg(ATH10K_DBG_BOOT, "boot start bmi\n");
 }
 
 static int ath10k_pci_hif_power_up(struct ath10k *ar)
@@ -1860,8 +1862,10 @@ static int ath10k_pci_hif_power_up(struct ath10k *ar)
 		ath10k_do_pci_wake(ar);
 
 	ret = ath10k_pci_ce_init(ar);
-	if (ret)
+	if (ret) {
+		ath10k_err("could not initialize CE (%d)\n", ret);
 		goto err_ps;
+	}
 
 	ret = ath10k_ce_disable_interrupts(ar);
 	if (ret) {
@@ -1876,16 +1880,22 @@ static int ath10k_pci_hif_power_up(struct ath10k *ar)
 	}
 
 	ret = ath10k_pci_wait_for_target_init(ar);
-	if (ret)
+	if (ret) {
+		ath10k_err("failed to wait for target to init (%d)\n", ret);
 		goto err_irq;
+	}
 
 	ret = ath10k_ce_enable_err_irq(ar);
-	if (ret)
+	if (ret) {
+		ath10k_err("failed to enable CE error irq (%d)\n", ret);
 		goto err_irq;
+	}
 
 	ret = ath10k_pci_init_config(ar);
-	if (ret)
+	if (ret) {
+		ath10k_err("failed to setup init config (%d)\n", ret);
 		goto err_irq;
+	}
 
 	ret = ath10k_pci_wake_target_cpu(ar);
 	if (ret) {
-- 
1.8.4.rc3


^ permalink raw reply related

* Re: [PATCH 09/16] wl1251: disable power saving in monitor mode
From: Pavel Machek @ 2013-10-30 11:46 UTC (permalink / raw)
  To: Pali Rohár
  Cc: Luciano Coelho, John W. Linville, Johannes Berg, David S. Miller,
	linux-wireless, netdev, linux-kernel, freemangordon,
	aaro.koskinen, sre, joni.lapilainen, David Gnedt
In-Reply-To: <1382819655-30430-10-git-send-email-pali.rohar@gmail.com>

On Sat 2013-10-26 22:34:08, Pali Rohár wrote:
> From: David Gnedt <david.gnedt@davizone.at>
> 
> Force power saving off while monitor interface is present.
> 
> Signed-off-by: David Gnedt <david.gnedt@davizone.at>
> ---
>  drivers/net/wireless/ti/wl1251/main.c |    7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/net/wireless/ti/wl1251/main.c b/drivers/net/wireless/ti/wl1251/main.c
> index 727f2ee..62cb374 100644
> --- a/drivers/net/wireless/ti/wl1251/main.c
> +++ b/drivers/net/wireless/ti/wl1251/main.c
> @@ -617,7 +617,8 @@ static int wl1251_op_config(struct ieee80211_hw *hw, u32 changed)
>  			goto out_sleep;
>  	}
>  
> -	if (conf->flags & IEEE80211_CONF_PS && !wl->psm_requested) {
> +	if (conf->flags & IEEE80211_CONF_PS && !wl->psm_requested &&
> +	    !wl->monitor_present) {
>  		wl1251_debug(DEBUG_PSM, "psm enabled");
>  
>  		wl->psm_requested = true;
> @@ -633,8 +634,8 @@ static int wl1251_op_config(struct ieee80211_hw *hw, u32 changed)
>  		ret = wl1251_ps_set_mode(wl, STATION_POWER_SAVE_MODE);
>  		if (ret < 0)
>  			goto out_sleep;
> -	} else if (!(conf->flags & IEEE80211_CONF_PS) &&
> -		   wl->psm_requested) {
> +	} else if ((!(conf->flags & IEEE80211_CONF_PS) || wl->monitor_present)
> +		   && wl->psm_requested) {
>  		wl1251_debug(DEBUG_PSM, "psm disabled");
>  

These boolean expressions make my head spin. Introduce helper function 

can_do_pm()... return (conf->flags & IEEE80211_CONF_PS) &&
!wl->monitor_present

?

Thanks,
									Pavel
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

^ permalink raw reply

* Re: [PATCH 10/16] wl1251: fix channel switching in monitor mode
From: Pavel Machek @ 2013-10-30 11:47 UTC (permalink / raw)
  To: Pali Rohár
  Cc: Luciano Coelho, John W. Linville, Johannes Berg, David S. Miller,
	linux-wireless, netdev, linux-kernel, freemangordon,
	aaro.koskinen, sre, joni.lapilainen, David Gnedt
In-Reply-To: <1382819655-30430-11-git-send-email-pali.rohar@gmail.com>

On Sat 2013-10-26 22:34:09, Pali Rohár wrote:
> From: David Gnedt <david.gnedt@davizone.at>
> 
> Use the ENABLE_RX command for channel switching when no interface is present
> (monitor mode only).
> The advantage of ENABLE_RX is that it leaves the tx data path disabled in
> firmware, whereas the usual JOIN command seems to transmit some frames at
> firmware level.
> 
> Signed-off-by: David Gnedt <david.gnedt@davizone.at>

Missing signoff, otherwise

Reviewed-by: Pavel Machek <pavel@ucw.cz>
								Pavel

-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

^ permalink raw reply

* Re: [PATCH 11/16] wl1251: enable tx path in monitor mode if necessary for packet injection
From: Pavel Machek @ 2013-10-30 11:51 UTC (permalink / raw)
  To: Pali Rohár
  Cc: Luciano Coelho, John W. Linville, Johannes Berg, David S. Miller,
	linux-wireless, netdev, linux-kernel, freemangordon,
	aaro.koskinen, sre, joni.lapilainen, David Gnedt
In-Reply-To: <1382819655-30430-12-git-send-email-pali.rohar@gmail.com>

Hi!
> 
> If necessary enable the tx path in monitor mode for packet injection using
> the JOIN command with BSS_TYPE_STA_BSS and zero BSSID.
> 
> Signed-off-by: David Gnedt <david.gnedt@davizone.at>
> ---
>  drivers/net/wireless/ti/wl1251/main.c   |    5 +++++
>  drivers/net/wireless/ti/wl1251/tx.c     |   17 +++++++++++++++++
>  drivers/net/wireless/ti/wl1251/wl1251.h |    1 +
>  3 files changed, 23 insertions(+)
> 
> diff --git a/drivers/net/wireless/ti/wl1251/main.c b/drivers/net/wireless/ti/wl1251/main.c
> diff --git a/drivers/net/wireless/ti/wl1251/tx.c b/drivers/net/wireless/ti/wl1251/tx.c
> index 3cc82fd..1de4ccb 100644
> --- a/drivers/net/wireless/ti/wl1251/tx.c
> +++ b/drivers/net/wireless/ti/wl1251/tx.c
> @@ -28,6 +28,7 @@
>  #include "tx.h"
>  #include "ps.h"
>  #include "io.h"
> +#include "event.h"
>  
>  static bool wl1251_tx_double_buffer_busy(struct wl1251 *wl, u32 data_out_count)
>  {
> @@ -298,6 +299,22 @@ static int wl1251_tx_frame(struct wl1251 *wl, struct sk_buff *skb)
>  		}
>  	}
>  
> +	/* Enable tx path in monitor mode for packet injection */
> +	if ((wl->vif == NULL) && !wl->joined) {
> +		ret = wl1251_cmd_join(wl, BSS_TYPE_STA_BSS, wl->channel,
> +				      wl->beacon_int, wl->dtim_period);
> +		if (ret < 0)
> +			wl1251_warning("join failed");
> +		else {
> +			ret = wl1251_event_wait(wl, JOIN_EVENT_COMPLETE_ID,
> +						100);
> +			if (ret < 0)
> +				wl1251_warning("join timeout");
> +			else
> +				wl->joined = true;
> +		}
> +	}

Create function enable_tx_for_packet_injection() and then just return
so that you don't have to nest ifs?

Thanks,
									Pavel
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

^ permalink raw reply

* Re: [PATCH 12/16] wl1251: disable retry and ACK policy for injected packets
From: Pavel Machek @ 2013-10-30 11:52 UTC (permalink / raw)
  To: Pali Rohár
  Cc: Luciano Coelho, John W. Linville, Johannes Berg, David S. Miller,
	linux-wireless, netdev, linux-kernel, freemangordon,
	aaro.koskinen, sre, joni.lapilainen, David Gnedt
In-Reply-To: <1382819655-30430-13-git-send-email-pali.rohar@gmail.com>

On Sat 2013-10-26 22:34:11, Pali Rohár wrote:
> From: David Gnedt <david.gnedt@davizone.at>
> 
> Set the retry limit to 0 and disable the ACK policy for injected packets.
> 
> Signed-off-by: David Gnedt <david.gnedt@davizone.at>

Missing sign-off, otherwise ok:

Reviewed-by: Pavel Machek <pavel@ucw.cz>
									Pavel
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

^ permalink raw reply

* Re: [PATCH 13/16] wl1251: enforce changed hw encryption support on monitor state change
From: Pavel Machek @ 2013-10-30 11:55 UTC (permalink / raw)
  To: Pali Rohár
  Cc: Luciano Coelho, John W. Linville, Johannes Berg, David S. Miller,
	linux-wireless, netdev, linux-kernel, freemangordon,
	aaro.koskinen, sre, joni.lapilainen, David Gnedt
In-Reply-To: <1382819655-30430-14-git-send-email-pali.rohar@gmail.com>

On Sat 2013-10-26 22:34:12, Pali Rohár wrote:
> From: David Gnedt <david.gnedt@davizone.at>
> 
> The firmware doesn't support per packet encryption selection, so disable hw
> encryption support completly while a monitor interface is present to support

"completely".

> injection of packets (which shouldn't get encrypted by hw).
> To enforce the changed hw encryption support force a disassociation on
> non-monitor interfaces.
> For disassociation a workaround using hw connection monitor is employed,
> which temporary enables hw connection manager flag.
> 
> Signed-off-by: David Gnedt <david.gnedt@davizone.at>

Missing sign-off.

> index 174f403..f054741 100644
> --- a/drivers/net/wireless/ti/wl1251/main.c
> +++ b/drivers/net/wireless/ti/wl1251/main.c
> @@ -685,6 +685,16 @@ static int wl1251_op_config(struct ieee80211_hw *hw, u32 changed)
>  		wl->power_level = conf->power_level;
>  	}
>  
> +	/*
> +	 * Tell stack that connection is lost because hw encryption isn't
> +	 * supported in monitor mode.
> +	 * XXX This requires temporary enabling the hw connection monitor flag
> +	 */

"of the" and I guess you can remove the XXX? This way it looks like
workaround is not complete.

Thanks,
									Pavel

-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

^ permalink raw reply

* Re: [PATCH 14/16] wl1251: add nvs file name to module firmware list
From: Pavel Machek @ 2013-10-30 11:55 UTC (permalink / raw)
  To: Pali Rohár
  Cc: Luciano Coelho, John W. Linville, Johannes Berg, David S. Miller,
	linux-wireless, netdev, linux-kernel, freemangordon,
	aaro.koskinen, sre, joni.lapilainen
In-Reply-To: <1382819655-30430-15-git-send-email-pali.rohar@gmail.com>

On Sat 2013-10-26 22:34:13, Pali Rohár wrote:
> Signed-off-by: Pali Rohár <pali.rohar@gmail.com>

Reviewed-by: Pavel Machek <pavel@ucw.cz>

-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

^ permalink raw reply

* Re: [PATCH] iwl3945: do not print RFKILL message
From: Pedro Francisco @ 2013-10-30 13:34 UTC (permalink / raw)
  To: Stanislaw Gruszka; +Cc: ML linux-wireless
In-Reply-To: <20131030083432.GA1478@redhat.com>

On Wed, Oct 30, 2013 at 8:34 AM, Stanislaw Gruszka <sgruszka@redhat.com> wrote:
> Dietmar or Pedro, could you test attached patch (my old laptop with 3945
> does not work any longer). It is alternative to previous patch posted
> before, does rfkill work ok with it?

My main laptop is no longer the one with the 3945. That being said, I
still intend to test the other patches (powersave) and I can add this
one to the mix, I just don't know when :)

-- 
Pedro

^ permalink raw reply

* ath9k EEPROM change
From: Cedric VONCKEN @ 2013-10-30 14:08 UTC (permalink / raw)
  To: linux-wireless

	I have an issue with the wireless card in temperature around 5°C.

	This card using an AR9xxx chipset.

	To fix my issue I need to change several values in EEPROM (xlna gain, cca threshold, noise floor threshold in 2.4 and 5 GHz band). 

	I know is not possible to write the EEPROM register with ATH9K.

	I looking for in the driver and I found the function ath9k_hw_def_set_board_values in eeprom_def.c. In this function, the cca threshold is set to the value 28.

	Is it possible to change all needed EEPROM value with this function? 
	Is it use for all ath9k chipset?

	If is not possible with this function, have you another solution?

	Thanks for your help.
	                
Cedric Voncken 



^ permalink raw reply

* Re: [PATCH -next] libertas: fix error return code in if_cs_probe()
From: Dan Williams @ 2013-10-30 14:42 UTC (permalink / raw)
  To: Wei Yongjun
  Cc: linville, hsweeten, gregkh, yongjun_wei, linux-wireless,
	libertas-dev
In-Reply-To: <CAPgLHd9nCFPvSWMtrinySm=9bESiKXpYZgZYj6fhzUQKVJFkhw@mail.gmail.com>

On Wed, 2013-10-30 at 13:22 +0800, Wei Yongjun wrote:
> From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
> 
> Fix to return -ENODEV in the unknown model error handling
> case instead of 0, as done elsewhere in this function.
> 
> Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>

Acked-by: Dan Williams <dcbw@redhat.com>

> ---
>  drivers/net/wireless/libertas/if_cs.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/net/wireless/libertas/if_cs.c b/drivers/net/wireless/libertas/if_cs.c
> index ef8c98e..f499efc 100644
> --- a/drivers/net/wireless/libertas/if_cs.c
> +++ b/drivers/net/wireless/libertas/if_cs.c
> @@ -902,6 +902,7 @@ static int if_cs_probe(struct pcmcia_device *p_dev)
>  	if (card->model == MODEL_UNKNOWN) {
>  		pr_err("unsupported manf_id 0x%04x / card_id 0x%04x\n",
>  		       p_dev->manf_id, p_dev->card_id);
> +		ret = -ENODEV;
>  		goto out2;
>  	}
>  
> 
> 
> _______________________________________________
> libertas-dev mailing list
> libertas-dev@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/libertas-dev



^ permalink raw reply

* [PATCH-mac80211] cfg80211: fix ibss wext chandef creation
From: Simon Wunderlich @ 2013-10-30 15:09 UTC (permalink / raw)
  To: linux-wireless; +Cc: Simon Wunderlich, Johannes Berg

The wext internal chandefs for ibss should be created using the
cfg80211_chandef_create() functions. Initializing fields manually is
error-prone.

Reported-by: Dirk Gouders <dirk@gouders.net>
Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de>
Cc: Johannes Berg <johannes.berg@intel.com>
---
 net/wireless/ibss.c |   18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/net/wireless/ibss.c b/net/wireless/ibss.c
index 403fe29..a710019 100644
--- a/net/wireless/ibss.c
+++ b/net/wireless/ibss.c
@@ -246,7 +246,7 @@ int cfg80211_ibss_wext_join(struct cfg80211_registered_device *rdev,
 
 	/* try to find an IBSS channel if none requested ... */
 	if (!wdev->wext.ibss.chandef.chan) {
-		wdev->wext.ibss.chandef.width = NL80211_CHAN_WIDTH_20_NOHT;
+		struct ieee80211_channel *new_chan = NULL;
 
 		for (band = 0; band < IEEE80211_NUM_BANDS; band++) {
 			struct ieee80211_supported_band *sband;
@@ -262,18 +262,19 @@ int cfg80211_ibss_wext_join(struct cfg80211_registered_device *rdev,
 					continue;
 				if (chan->flags & IEEE80211_CHAN_DISABLED)
 					continue;
-				wdev->wext.ibss.chandef.chan = chan;
-				wdev->wext.ibss.chandef.center_freq1 =
-					chan->center_freq;
+				new_chan = chan;
 				break;
 			}
 
-			if (wdev->wext.ibss.chandef.chan)
+			if (new_chan)
 				break;
 		}
 
-		if (!wdev->wext.ibss.chandef.chan)
+		if (!new_chan)
 			return -EINVAL;
+
+		cfg80211_chandef_create(&wdev->wext.ibss.chandef, new_chan,
+					NL80211_CHAN_NO_HT);
 	}
 
 	/* don't join -- SSID is not there */
@@ -347,9 +348,8 @@ int cfg80211_ibss_wext_siwfreq(struct net_device *dev,
 		return err;
 
 	if (chan) {
-		wdev->wext.ibss.chandef.chan = chan;
-		wdev->wext.ibss.chandef.width = NL80211_CHAN_WIDTH_20_NOHT;
-		wdev->wext.ibss.chandef.center_freq1 = freq;
+		cfg80211_chandef_create(&wdev->wext.ibss.chandef, chan,
+					NL80211_CHAN_NO_HT);
 		wdev->wext.ibss.channel_fixed = true;
 	} else {
 		/* cfg80211_ibss_wext_join will pick one if needed */
-- 
1.7.10.4


^ permalink raw reply related

* [PATCH] hwsim tests: use argparse module
From: Johannes Berg @ 2013-10-30 16:20 UTC (permalink / raw)
  To: linux-wireless; +Cc: j, Johannes Berg

From: Johannes Berg <johannes.berg@intel.com>

Instead of re-implementing a command-line parser, use the
argparse module.

The only real change (I hope) is that the test module must
now be given to the -f option without the .py suffix.

Also, --help now works, and if a test module/test name is
given that doesn't exist, the valid list is printed.

Signed-hostap: Johannes Berg <johannes.berg@intel.com>
---
 tests/hwsim/run-all.sh   |   4 +-
 tests/hwsim/run-tests.py | 144 +++++++++++++++++++++++++----------------------
 2 files changed, 80 insertions(+), 68 deletions(-)

diff --git a/tests/hwsim/run-all.sh b/tests/hwsim/run-all.sh
index 07006af..9471dd8 100755
--- a/tests/hwsim/run-all.sh
+++ b/tests/hwsim/run-all.sh
@@ -24,7 +24,7 @@ if [ "x$1" = "xconcurrent-valgrind" ]; then
     DATE=`ls -1tr $LOGDIR | tail -1 | cut -f1 -d-`
     rm $LOGDIR/last-debug
     for i in autogo discovery grpform; do
-	./run-tests.py -l $LOGDIR/$DATE-run-$i $DB -e $LOGDIR/$DATE-failed-$i -r $LOGDIR/results.txt -f test_p2p_$i.py || errors=1
+	./run-tests.py -l $LOGDIR/$DATE-run-$i $DB -e $LOGDIR/$DATE-failed-$i -r $LOGDIR/results.txt -f test_p2p_$i || errors=1
 	cat $LOGDIR/$DATE-run-$i >> $LOGDIR/last-debug
     done
     ./stop-wifi.sh
@@ -45,7 +45,7 @@ elif [ "x$1" = "xconcurrent" ]; then
     DATE=`ls -1tr $LOGDIR | tail -1 | cut -f1 -d-`
     rm $LOGDIR/last-debug
     for i in autogo discovery grpform; do
-	./run-tests.py -l $LOGDIR/$DATE-run-$i $DB -e $LOGDIR/$DATE-failed-$i -r $LOGDIR/results.txt -f test_p2p_$i.py || errors=1
+	./run-tests.py -l $LOGDIR/$DATE-run-$i $DB -e $LOGDIR/$DATE-failed-$i -r $LOGDIR/results.txt -f test_p2p_$i || errors=1
 	cat $LOGDIR/$DATE-run-$i >> $LOGDIR/last-debug
     done
     ./stop-wifi.sh
diff --git a/tests/hwsim/run-tests.py b/tests/hwsim/run-tests.py
index e319eec..89ed3a0 100755
--- a/tests/hwsim/run-tests.py
+++ b/tests/hwsim/run-tests.py
@@ -11,6 +11,7 @@ import re
 import sys
 import time
 from datetime import datetime
+import argparse
 
 import logging
 logger = logging.getLogger(__name__)
@@ -47,49 +48,74 @@ def report(conn, build, commit, run, test, result, diff):
             print "sql: %r" % (params, )
 
 def main():
-    test_file = None
-    error_file = None
-    log_file = None
-    results_file = None
-    conn = None
+    tests = []
+    test_modules = []
+    for t in os.listdir("."):
+        m = re.match(r'(test_.*)\.py$', t)
+        if m:
+            logger.debug("Import test cases from " + t)
+            mod = __import__(m.group(1))
+            test_modules.append(mod.__name__)
+            for s in dir(mod):
+                if s.startswith("test_"):
+                    func = mod.__dict__.get(s)
+                    tests.append(func)
+    test_names = list(set([t.__name__ for t in tests]))
+
     run = None
-    build = None
     commit = None
-    idx = 1
     print_res = False
-    if len(sys.argv) > 1 and sys.argv[1] == '-d':
-        logging.basicConfig(level=logging.DEBUG)
-        idx = idx + 1
-    elif len(sys.argv) > 1 and sys.argv[1] == '-q':
-        logging.basicConfig(level=logging.WARNING)
-        print_res = True
-        idx = idx + 1
-    elif len(sys.argv) > 2 and sys.argv[1] == '-l':
-        log_file = sys.argv[2]
-        logging.basicConfig(filename=log_file,level=logging.DEBUG)
-        idx = idx + 2
+
+    parser = argparse.ArgumentParser(description='hwsim test runner')
+    group = parser.add_mutually_exclusive_group()
+    group.add_argument('-d', const=logging.DEBUG, action='store_const',
+                       dest='loglevel', default=logging.INFO,
+                       help="verbose debug output")
+    group.add_argument('-q', const=logging.WARNING, action='store_const',
+                       dest='loglevel', help="be quiet")
+    group.add_argument('-l', metavar='<filename>', dest='logfile',
+                       help='debug log filename')
+
+    parser.add_argument('-e', metavar="<filename>", dest='errorfile',
+                        help='error filename')
+    parser.add_argument('-r', metavar="<filename>", dest='resultsfile',
+                        help='results filename')
+    parser.add_argument('-S', metavar='<sqlite3 db>', dest='database',
+                        help='database to write results to')
+    parser.add_argument('-b', metavar='<build>', dest='build', help='build ID')
+    parser.add_argument('-L', dest='update_tests_db',
+                        help='Update DB test descriptions')
+    parser.add_argument('-f', dest='testmodule', metavar='<test module>',
+                        help='execute only tests from this test module',
+                        type=str, choices=[[]] + test_modules)
+    parser.add_argument('tests', metavar='<test>', nargs='*', type=str,
+                        help='tests to run (only valid without -f)',
+                        choices=[[]] + test_names)
+
+    args = parser.parse_args()
+
+    if args.tests and args.testmodule:
+        print 'Invalid arguments - both test module and tests given'
+        sys.exit(2)
+
+    if args.logfile:
+        logging.basicConfig(filename=args.logfile,
+                            level=logging.DEBUG)
+        log_to_file = True
     else:
-        logging.basicConfig(level=logging.INFO)
-
-    while len(sys.argv) > idx:
-        if len(sys.argv) > idx + 1 and sys.argv[idx] == '-e':
-            error_file = sys.argv[idx + 1]
-            idx = idx + 2
-        elif len(sys.argv) > idx + 1 and sys.argv[idx] == '-r':
-            results_file = sys.argv[idx + 1]
-            idx = idx + 2
-        elif len(sys.argv) > idx + 1 and sys.argv[idx] == '-f':
-            test_file = sys.argv[idx + 1]
-            idx = idx + 2
-        elif len(sys.argv) > idx + 1 and sys.argv[idx] == '-S':
-            import sqlite3
-            conn = sqlite3.connect(sys.argv[idx + 1])
-            idx = idx + 2
-        elif len(sys.argv) > idx + 1 and sys.argv[idx] == '-b':
-            build = sys.argv[idx + 1]
-            idx = idx + 2
-        else:
-            break
+        logging.basicConfig(level=args.loglevel)
+        log_to_file = False
+        if args.loglevel == logging.WARNING:
+            print_res = True
+
+    error_file = args.errorfile
+    results_file = args.resultsfile
+
+    if args.database:
+        import sqlite3
+        conn = sqlite3.connect(args.database)
+    else:
+        conn = None
 
     if conn:
         run = str(int(time.time()))
@@ -101,20 +127,7 @@ def main():
         except IOError:
             pass
 
-    tests = []
-    for t in os.listdir("."):
-        m = re.match(r'(test_.*)\.py$', t)
-        if m:
-            if test_file and test_file not in t:
-                continue
-            logger.debug("Import test cases from " + t)
-            mod = __import__(m.group(1))
-            for s in dir(mod):
-                if s.startswith("test_"):
-                    func = mod.__dict__.get(s)
-                    tests.append(func)
-
-    if len(sys.argv) > idx and sys.argv[idx] == '-L':
+    if args.update_tests_db:
         for t in tests:
             print t.__name__ + " - " + t.__doc__
             if conn:
@@ -130,10 +143,6 @@ def main():
             conn.close()
         sys.exit(0)
 
-    if len(sys.argv) > idx:
-        test_filter = sys.argv[idx]
-    else:
-        test_filter = None
 
     dev0 = WpaSupplicant('wlan0', '/tmp/wpas-wlan0')
     dev1 = WpaSupplicant('wlan1', '/tmp/wpas-wlan1')
@@ -156,12 +165,15 @@ def main():
     failed = []
 
     for t in tests:
-        if test_filter:
-            if test_filter != t.__name__:
+        if args.tests:
+            if not t.__name__ in args.tests:
+                continue
+        if args.testmodule:
+            if not t.__module__ == args.testmodule:
                 continue
         reset_devs(dev, apdev)
         logger.info("START " + t.__name__)
-        if log_file:
+        if log_to_file:
             print "START " + t.__name__
             sys.stdout.flush()
         if t.__doc__:
@@ -191,11 +203,11 @@ def main():
             else:
                 passed.append(t.__name__)
                 result = "PASS"
-            report(conn, build, commit, run, t.__name__, result, diff)
+            report(conn, args.build, commit, run, t.__name__, result, diff)
             result = result + " " + t.__name__ + " "
             result = result + str(diff.total_seconds()) + " " + str(end)
             logger.info(result)
-            if log_file or print_res:
+            if log_to_file or print_res:
                 print result
                 sys.stdout.flush()
             if results_file:
@@ -207,10 +219,10 @@ def main():
             diff = end - start
             logger.info(e)
             failed.append(t.__name__)
-            report(conn, build, commit, run, t.__name__, "FAIL", diff)
+            report(conn, args.build, commit, run, t.__name__, "FAIL", diff)
             result = "FAIL " + t.__name__ + " " + str(diff.total_seconds()) + " " + str(end)
             logger.info(result)
-            if log_file:
+            if log_to_file:
                 print result
                 sys.stdout.flush()
             if results_file:
@@ -224,7 +236,7 @@ def main():
                 logger.info("Failed to issue TEST-STOP after " + t.__name__ + " for " + d.ifname)
                 logger.info(e)
 
-    if not test_filter:
+    if not args.tests:
         reset_devs(dev, apdev)
 
     if conn:
@@ -242,7 +254,7 @@ def main():
     logger.info("passed all " + str(len(passed)) + " test case(s)")
     if len(skipped):
         logger.info("skipped " + str(len(skipped)) + " test case(s)")
-    if log_file:
+    if log_to_file:
         print "passed all " + str(len(passed)) + " test case(s)"
         if len(skipped):
             print "skipped " + str(len(skipped)) + " test case(s)"
-- 
1.8.4.rc3


^ permalink raw reply related

* [PATCH v2] hwsim tests: use argparse module
From: Johannes Berg @ 2013-10-30 16:25 UTC (permalink / raw)
  To: linux-wireless; +Cc: j, Johannes Berg

From: Johannes Berg <johannes.berg@intel.com>

Instead of re-implementing a command-line parser, use the
argparse module.

The only real change (I hope) is that the test module must
now be given to the -f option without the .py suffix.

Also, --help now works, and if a test module/test name is
given that doesn't exist, the valid list is printed.

Signed-hostap: Johannes Berg <johannes.berg@intel.com>
---
 tests/hwsim/run-all.sh   |   4 +-
 tests/hwsim/run-tests.py | 144 +++++++++++++++++++++++++----------------------
 2 files changed, 80 insertions(+), 68 deletions(-)

diff --git a/tests/hwsim/run-all.sh b/tests/hwsim/run-all.sh
index 07006af..9471dd8 100755
--- a/tests/hwsim/run-all.sh
+++ b/tests/hwsim/run-all.sh
@@ -24,7 +24,7 @@ if [ "x$1" = "xconcurrent-valgrind" ]; then
     DATE=`ls -1tr $LOGDIR | tail -1 | cut -f1 -d-`
     rm $LOGDIR/last-debug
     for i in autogo discovery grpform; do
-	./run-tests.py -l $LOGDIR/$DATE-run-$i $DB -e $LOGDIR/$DATE-failed-$i -r $LOGDIR/results.txt -f test_p2p_$i.py || errors=1
+	./run-tests.py -l $LOGDIR/$DATE-run-$i $DB -e $LOGDIR/$DATE-failed-$i -r $LOGDIR/results.txt -f test_p2p_$i || errors=1
 	cat $LOGDIR/$DATE-run-$i >> $LOGDIR/last-debug
     done
     ./stop-wifi.sh
@@ -45,7 +45,7 @@ elif [ "x$1" = "xconcurrent" ]; then
     DATE=`ls -1tr $LOGDIR | tail -1 | cut -f1 -d-`
     rm $LOGDIR/last-debug
     for i in autogo discovery grpform; do
-	./run-tests.py -l $LOGDIR/$DATE-run-$i $DB -e $LOGDIR/$DATE-failed-$i -r $LOGDIR/results.txt -f test_p2p_$i.py || errors=1
+	./run-tests.py -l $LOGDIR/$DATE-run-$i $DB -e $LOGDIR/$DATE-failed-$i -r $LOGDIR/results.txt -f test_p2p_$i || errors=1
 	cat $LOGDIR/$DATE-run-$i >> $LOGDIR/last-debug
     done
     ./stop-wifi.sh
diff --git a/tests/hwsim/run-tests.py b/tests/hwsim/run-tests.py
index e319eec..9644b4a 100755
--- a/tests/hwsim/run-tests.py
+++ b/tests/hwsim/run-tests.py
@@ -11,6 +11,7 @@ import re
 import sys
 import time
 from datetime import datetime
+import argparse
 
 import logging
 logger = logging.getLogger(__name__)
@@ -47,49 +48,74 @@ def report(conn, build, commit, run, test, result, diff):
             print "sql: %r" % (params, )
 
 def main():
-    test_file = None
-    error_file = None
-    log_file = None
-    results_file = None
-    conn = None
+    tests = []
+    test_modules = []
+    for t in os.listdir("."):
+        m = re.match(r'(test_.*)\.py$', t)
+        if m:
+            logger.debug("Import test cases from " + t)
+            mod = __import__(m.group(1))
+            test_modules.append(mod.__name__)
+            for s in dir(mod):
+                if s.startswith("test_"):
+                    func = mod.__dict__.get(s)
+                    tests.append(func)
+    test_names = list(set([t.__name__ for t in tests]))
+
     run = None
-    build = None
     commit = None
-    idx = 1
     print_res = False
-    if len(sys.argv) > 1 and sys.argv[1] == '-d':
-        logging.basicConfig(level=logging.DEBUG)
-        idx = idx + 1
-    elif len(sys.argv) > 1 and sys.argv[1] == '-q':
-        logging.basicConfig(level=logging.WARNING)
-        print_res = True
-        idx = idx + 1
-    elif len(sys.argv) > 2 and sys.argv[1] == '-l':
-        log_file = sys.argv[2]
-        logging.basicConfig(filename=log_file,level=logging.DEBUG)
-        idx = idx + 2
+
+    parser = argparse.ArgumentParser(description='hwsim test runner')
+    group = parser.add_mutually_exclusive_group()
+    group.add_argument('-d', const=logging.DEBUG, action='store_const',
+                       dest='loglevel', default=logging.INFO,
+                       help="verbose debug output")
+    group.add_argument('-q', const=logging.WARNING, action='store_const',
+                       dest='loglevel', help="be quiet")
+    group.add_argument('-l', metavar='<filename>', dest='logfile',
+                       help='debug log filename')
+
+    parser.add_argument('-e', metavar="<filename>", dest='errorfile',
+                        help='error filename')
+    parser.add_argument('-r', metavar="<filename>", dest='resultsfile',
+                        help='results filename')
+    parser.add_argument('-S', metavar='<sqlite3 db>', dest='database',
+                        help='database to write results to')
+    parser.add_argument('-b', metavar='<build>', dest='build', help='build ID')
+    parser.add_argument('-L', action='store_true', dest='update_tests_db',
+                        help='List tests (and update descriptions in DB)')
+    parser.add_argument('-f', dest='testmodule', metavar='<test module>',
+                        help='execute only tests from this test module',
+                        type=str, choices=[[]] + test_modules)
+    parser.add_argument('tests', metavar='<test>', nargs='*', type=str,
+                        help='tests to run (only valid without -f)',
+                        choices=[[]] + test_names)
+
+    args = parser.parse_args()
+
+    if args.tests and args.testmodule:
+        print 'Invalid arguments - both test module and tests given'
+        sys.exit(2)
+
+    if args.logfile:
+        logging.basicConfig(filename=args.logfile,
+                            level=logging.DEBUG)
+        log_to_file = True
     else:
-        logging.basicConfig(level=logging.INFO)
-
-    while len(sys.argv) > idx:
-        if len(sys.argv) > idx + 1 and sys.argv[idx] == '-e':
-            error_file = sys.argv[idx + 1]
-            idx = idx + 2
-        elif len(sys.argv) > idx + 1 and sys.argv[idx] == '-r':
-            results_file = sys.argv[idx + 1]
-            idx = idx + 2
-        elif len(sys.argv) > idx + 1 and sys.argv[idx] == '-f':
-            test_file = sys.argv[idx + 1]
-            idx = idx + 2
-        elif len(sys.argv) > idx + 1 and sys.argv[idx] == '-S':
-            import sqlite3
-            conn = sqlite3.connect(sys.argv[idx + 1])
-            idx = idx + 2
-        elif len(sys.argv) > idx + 1 and sys.argv[idx] == '-b':
-            build = sys.argv[idx + 1]
-            idx = idx + 2
-        else:
-            break
+        logging.basicConfig(level=args.loglevel)
+        log_to_file = False
+        if args.loglevel == logging.WARNING:
+            print_res = True
+
+    error_file = args.errorfile
+    results_file = args.resultsfile
+
+    if args.database:
+        import sqlite3
+        conn = sqlite3.connect(args.database)
+    else:
+        conn = None
 
     if conn:
         run = str(int(time.time()))
@@ -101,20 +127,7 @@ def main():
         except IOError:
             pass
 
-    tests = []
-    for t in os.listdir("."):
-        m = re.match(r'(test_.*)\.py$', t)
-        if m:
-            if test_file and test_file not in t:
-                continue
-            logger.debug("Import test cases from " + t)
-            mod = __import__(m.group(1))
-            for s in dir(mod):
-                if s.startswith("test_"):
-                    func = mod.__dict__.get(s)
-                    tests.append(func)
-
-    if len(sys.argv) > idx and sys.argv[idx] == '-L':
+    if args.update_tests_db:
         for t in tests:
             print t.__name__ + " - " + t.__doc__
             if conn:
@@ -130,10 +143,6 @@ def main():
             conn.close()
         sys.exit(0)
 
-    if len(sys.argv) > idx:
-        test_filter = sys.argv[idx]
-    else:
-        test_filter = None
 
     dev0 = WpaSupplicant('wlan0', '/tmp/wpas-wlan0')
     dev1 = WpaSupplicant('wlan1', '/tmp/wpas-wlan1')
@@ -156,12 +165,15 @@ def main():
     failed = []
 
     for t in tests:
-        if test_filter:
-            if test_filter != t.__name__:
+        if args.tests:
+            if not t.__name__ in args.tests:
+                continue
+        if args.testmodule:
+            if not t.__module__ == args.testmodule:
                 continue
         reset_devs(dev, apdev)
         logger.info("START " + t.__name__)
-        if log_file:
+        if log_to_file:
             print "START " + t.__name__
             sys.stdout.flush()
         if t.__doc__:
@@ -191,11 +203,11 @@ def main():
             else:
                 passed.append(t.__name__)
                 result = "PASS"
-            report(conn, build, commit, run, t.__name__, result, diff)
+            report(conn, args.build, commit, run, t.__name__, result, diff)
             result = result + " " + t.__name__ + " "
             result = result + str(diff.total_seconds()) + " " + str(end)
             logger.info(result)
-            if log_file or print_res:
+            if log_to_file or print_res:
                 print result
                 sys.stdout.flush()
             if results_file:
@@ -207,10 +219,10 @@ def main():
             diff = end - start
             logger.info(e)
             failed.append(t.__name__)
-            report(conn, build, commit, run, t.__name__, "FAIL", diff)
+            report(conn, args.build, commit, run, t.__name__, "FAIL", diff)
             result = "FAIL " + t.__name__ + " " + str(diff.total_seconds()) + " " + str(end)
             logger.info(result)
-            if log_file:
+            if log_to_file:
                 print result
                 sys.stdout.flush()
             if results_file:
@@ -224,7 +236,7 @@ def main():
                 logger.info("Failed to issue TEST-STOP after " + t.__name__ + " for " + d.ifname)
                 logger.info(e)
 
-    if not test_filter:
+    if not args.tests:
         reset_devs(dev, apdev)
 
     if conn:
@@ -242,7 +254,7 @@ def main():
     logger.info("passed all " + str(len(passed)) + " test case(s)")
     if len(skipped):
         logger.info("skipped " + str(len(skipped)) + " test case(s)")
-    if log_file:
+    if log_to_file:
         print "passed all " + str(len(passed)) + " test case(s)"
         if len(skipped):
             print "skipped " + str(len(skipped)) + " test case(s)"
-- 
1.8.4.rc3


^ permalink raw reply related

* Re: [PATCH v2] hwsim tests: use argparse module
From: Johannes Berg @ 2013-10-30 16:27 UTC (permalink / raw)
  To: linux-wireless; +Cc: j
In-Reply-To: <1383150313-4155-1-git-send-email-johannes@sipsolutions.net>

Err, this went to the wrong list, sorry.

johannes


^ permalink raw reply

* Re: [PATCH/RFT 00/12] ath10k: pci fixes 2013-10-30
From: Ben Greear @ 2013-10-30 17:06 UTC (permalink / raw)
  To: Michal Kazior; +Cc: ath10k, linux-wireless
In-Reply-To: <1383133346-8135-1-git-send-email-michal.kazior@tieto.com>

On 10/30/2013 04:42 AM, Michal Kazior wrote:
> Hi,
> 
> This patchset contains a slew of PCI/CE cleanups
> and fixes. The aim of the patchset is to deal with
> CE null dereference bugs Ben has been reporting on
> the mailing list for some time now.
> 
> I've done some brief testing and don't see any
> major regressions. I wasn't able to reproduce the
> reported bugs though. @Ben: Could you perhaps test
> this, please?

I'll test these later today, thanks!

Ben

-- 
Ben Greear <greearb@candelatech.com>
Candela Technologies Inc  http://www.candelatech.com


^ permalink raw reply

* [PATCH] nl80211: better document NL80211_CMD_TDLS_MGMT
From: Arik Nemtsov @ 2013-10-30 17:09 UTC (permalink / raw)
  To: linux-wireless; +Cc: Johannes Berg, Arik Nemtsov

This command has different semantics depending on the action code sent.
Document this fact and detail the supported action codes.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
---
 include/uapi/linux/nl80211.h | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/include/uapi/linux/nl80211.h b/include/uapi/linux/nl80211.h
index f752e98..877c048 100644
--- a/include/uapi/linux/nl80211.h
+++ b/include/uapi/linux/nl80211.h
@@ -581,7 +581,14 @@
  *	operation, %NL80211_ATTR_MAC contains the peer MAC address, and
  *	%NL80211_ATTR_REASON_CODE the reason code to be used (only with
  *	%NL80211_TDLS_TEARDOWN).
- * @NL80211_CMD_TDLS_MGMT: Send a TDLS management frame.
+ * @NL80211_CMD_TDLS_MGMT: Send a TDLS management frame. The
+ *	%NL80211_ATTR_TDLS_ACTION attribute determines the typ of frame to be
+ *	sent. Public Action codes (802.11-2012 8.1.5.1) will be sent as
+ *	802.11 management frames, while TDLS action codes (802.11-2012
+ *	8.5.13.1) will be encapsulated and sent as data frames. The currently
+ *	supported Public Action code is %WLAN_PUB_ACTION_TDLS_DISCOVER_RES
+ *	and the currently supported TDLS actions codes are given in
+ *	&enum ieee80211_tdls_actioncode.
  *
  * @NL80211_CMD_UNEXPECTED_FRAME: Used by an application controlling an AP
  *	(or GO) interface (i.e. hostapd) to ask for unexpected frames to
-- 
1.8.1.2


^ permalink raw reply related

* [patch v2] libertas: potential oops in debugfs
From: Dan Carpenter @ 2013-10-30 17:12 UTC (permalink / raw)
  To: John W. Linville
  Cc: libertas-dev, linux-wireless, netdev, linux-kernel,
	kernel-janitors
In-Reply-To: <20131025144452.GA28451@ngolde.de>

If we do a zero size allocation then it will oops.  Also we can't be
sure the user passes us a NUL terminated string so I've added a
terminator.

This code can only be triggered by root.

Reported-by: Nico Golde <nico@ngolde.de>
Reported-by: Fabian Yamaguchi <fabs@goesec.de>
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/net/wireless/libertas/debugfs.c b/drivers/net/wireless/libertas/debugfs.c
index 668dd27..1917348 100644
--- a/drivers/net/wireless/libertas/debugfs.c
+++ b/drivers/net/wireless/libertas/debugfs.c
@@ -913,7 +913,10 @@ static ssize_t lbs_debugfs_write(struct file *f, const char __user *buf,
 	char *p2;
 	struct debug_data *d = f->private_data;
 
-	pdata = kmalloc(cnt, GFP_KERNEL);
+	if (cnt == 0)
+		return 0;
+
+	pdata = kmalloc(cnt + 1, GFP_KERNEL);
 	if (pdata == NULL)
 		return 0;
 
@@ -922,6 +925,7 @@ static ssize_t lbs_debugfs_write(struct file *f, const char __user *buf,
 		kfree(pdata);
 		return 0;
 	}
+	pdata[cnt] = '\0';
 
 	p0 = pdata;
 	for (i = 0; i < num_of_items; i++) {

^ permalink raw reply related

* Re: [PATCH/RFT 12/12] ath10k: add some debug prints
From: Joe Perches @ 2013-10-30 17:16 UTC (permalink / raw)
  To: Michal Kazior; +Cc: ath10k, linux-wireless, greearb
In-Reply-To: <1383133346-8135-13-git-send-email-michal.kazior@tieto.com>

On Wed, 2013-10-30 at 12:42 +0100, Michal Kazior wrote:
> Some errors were handled too silently.

These aren't really debug prints.

> diff --git a/drivers/net/wireless/ath/ath10k/pci.c b/drivers/net/wireless/ath/ath10k/pci.c
[]
> @@ -1860,8 +1862,10 @@ static int ath10k_pci_hif_power_up(struct ath10k *ar)
>  		ath10k_do_pci_wake(ar);
>  
>  	ret = ath10k_pci_ce_init(ar);
> -	if (ret)
> +	if (ret) {
> +		ath10k_err("could not initialize CE (%d)\n", ret);

Rather than try to reinterpret the function name,
perhaps it's better to simply emit the function name
as is done most other places like:

		ath10k_err("ath10k_pci_ce_init failed: (%d)\n", ret);


> @@ -1876,16 +1880,22 @@ static int ath10k_pci_hif_power_up(struct ath10k *ar)
>  	}
>  
>  	ret = ath10k_pci_wait_for_target_init(ar);
> -	if (ret)
> +	if (ret) {
> +		ath10k_err("failed to wait for target to init (%d)\n", ret);
>  		goto err_irq;
> +	}

Like this one, because the function did wait,
but the init was unsuccessful.



^ permalink raw reply

* pull-request: iwlwifi-next 2013-10-07
From: Emmanuel Grumbach @ 2013-10-30 17:36 UTC (permalink / raw)
  To: John Linville; +Cc: linux-wireless

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

John,

This the last pull request before merge window opens.

There are a few fixes from Johannes mostly clean up patches. We have
also a few other fixes that are relevant for the new firmware that has
not been released yet.

Tell me about any issues you might face with it. Thanks.

emmanuel

The following changes since commit 246dd9922e859768aa522daa6c1c601785e57e0c:

  iwlwifi: mvm: fix operator precedence (2013-10-18 16:02:38 +0200)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/iwlwifi-next.git
for-john

for you to fetch changes up to c92f06a1dea1e444213d860a20023f72c134e20a:

  iwlwifi: mvm: BT Coex - fix copy paste issue (2013-10-30 19:20:48 +0200)

----------------------------------------------------------------
Alexander Bondar (1):
      iwlwifi: mvm: update UAPSD support TLV bits

Emmanuel Grumbach (2):
      iwlwifi: mvm: BT Coex fix NULL pointer dereference
      iwlwifi: mvm: BT Coex - fix copy paste issue

Johannes Berg (5):
      iwlwifi: transport config n_no_reclaim_cmds should be unsigned
      iwlwifi: pcie: move warning message into warning
      iwlwifi: mvm: capture the FCS in monitor mode
      iwlwifi: mvm: add missing break in debugfs
      iwlwifi: warn if firmware image doesn't exist

Michael Opdenacker (1):
      iwlwifi: remove duplicate includes

 drivers/net/wireless/iwlwifi/dvm/ucode.c    |    9 ++++-----
 drivers/net/wireless/iwlwifi/iwl-fw.h       |    3 ++-
 drivers/net/wireless/iwlwifi/iwl-io.c       |    1 -
 drivers/net/wireless/iwlwifi/iwl-trans.h    |    2 +-
 drivers/net/wireless/iwlwifi/mvm/bt-coex.c  |    8 ++++++--
 drivers/net/wireless/iwlwifi/mvm/debugfs.c  |    1 +
 drivers/net/wireless/iwlwifi/mvm/fw.c       |    8 +++-----
 drivers/net/wireless/iwlwifi/mvm/mac-ctxt.c |    8 +++++++-
 drivers/net/wireless/iwlwifi/mvm/mac80211.c |   14 +++++++++-----
 drivers/net/wireless/iwlwifi/mvm/mvm.h      |    1 -
 drivers/net/wireless/iwlwifi/mvm/ops.c      |    2 +-
 drivers/net/wireless/iwlwifi/mvm/rx.c       |    6 +++++-
 drivers/net/wireless/iwlwifi/pcie/tx.c      |    9 ++++-----
 13 files changed, 43 insertions(+), 29 deletions(-)


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply

* Re: pull-request: iwlwifi-next 2013-10-07
From: Johannes Berg @ 2013-10-30 17:43 UTC (permalink / raw)
  To: Emmanuel Grumbach; +Cc: John Linville, linux-wireless
In-Reply-To: <527143AA.5070900@gmail.com>

And yes, I support that - Emmanuel is taking over the tree from me :-)

johannes


^ permalink raw reply

* Re: [PATCH] nl80211: better document NL80211_CMD_TDLS_MGMT
From: Bob Copeland @ 2013-10-30 18:43 UTC (permalink / raw)
  To: Arik Nemtsov; +Cc: linux-wireless, Johannes Berg
In-Reply-To: <1383152974-13097-1-git-send-email-arik@wizery.com>

On Wed, Oct 30, 2013 at 07:09:34PM +0200, Arik Nemtsov wrote:
> + * @NL80211_CMD_TDLS_MGMT: Send a TDLS management frame. The
> + *	%NL80211_ATTR_TDLS_ACTION attribute determines the typ of frame to be

type typo there.

> + *	sent. Public Action codes (802.11-2012 8.1.5.1) will be sent as
> + *	802.11 management frames, while TDLS action codes (802.11-2012

-- 
Bob Copeland %% www.bobcopeland.com

^ permalink raw reply

* AP mode with hostapd
From: Drasko DRASKOVIC @ 2013-10-30 19:05 UTC (permalink / raw)
  To: ath6kl-devel, linux-wireless

HI all,
I have AR6004 USB dongle connected to Linux kernel 3.10, and am
testing latest hostapd.

I noticed that I was able to put the dongle in the AP mode only for
not-n mode (a or g).

Enabling both of these options:
hw_mode=g
ieee80211n=1

gives an error like this on starting:

random: Trying to read entropy from /dev/random
Configuration file: /home/drasko/hostapd.conf
HT (IEEE 802.11n) with WPA/WPA2 requires CCMP/GCMP to be enabled,
disabling HT capabilities
rfkill: initial event: idx=0 type=1 op=0 soft=0 hard=0
rfkill: initial event: idx=1 type=1 op=0 soft=0 hard=0
rfkill: initial event: idx=2 type=2 op=0 soft=0 hard=0
rfkill: initial event: idx=5 type=1 op=0 soft=0 hard=0
nl80211: Using driver-based roaming
nl80211: Supports Probe Response offload in AP mode
nl80211: Disable use_monitor with device_ap_sme since no monitor mode
support detected
nl80211: interface wlan3 in phy phy3
nl80211: Add own interface ifindex 6
nl80211: Set mode ifindex 6 iftype 3 (AP)
nl80211: Setup AP - device_ap_sme=1 use_monitor=0
nl80211: Subscribe to mgmt frames with AP handle 0x1441480 (device SME)
nl80211: Register frame type=0xd0 nl_handle=0x1441480
nl80211: Register frame match - hexdump(len=0): [NULL]
nl80211: Enable Probe Request reporting nl_preq=0x14414c0
nl80211: Register frame type=0x40 nl_handle=0x14414c0
nl80211: Register frame match - hexdump(len=0): [NULL]
BSS count 1, BSSID mask 00:00:00:00:00:00 (0 bits)
nl80211: Regulatory information - country=FR
nl80211: 2402-2482 @ 40 MHz
nl80211: 2402-2482 @ 20 mBm
nl80211: 5170-5250 @ 40 MHz
nl80211: 5170-5250 @ 20 mBm
nl80211: 5250-5330 @ 40 MHz
nl80211: 5250-5330 @ 20 mBm
nl80211: 5490-5710 @ 40 MHz
nl80211: 5490-5710 @ 27 mBm
nl80211: 57240-65880 @ 2160 MHz
nl80211: 57240-65880 @ 40 mBm
nl80211: Added 802.11b mode based on 802.11g information
Completing interface initialization
Mode: IEEE 802.11g  Channel: 7  Frequency: 2442 MHz
DFS 0 channels required radar detection
nl80211: Set freq 2442 (ht_enabled=1, vht_enabled=0, bandwidth=20 MHz,
cf1=2442 MHz, cf2=0 MHz)
nl80211: Failed to set channel (freq=2442): -22 (Invalid argument)
Could not set channel for kernel driver
wlan3: Unable to setup interface.
wlan3: Flushing old station entries
nl80211: flush -> DEL_STATION wlan3 (all)
wlan3: Deauthenticate all stations
nl80211: sta_remove -> DEL_STATION wlan3 ff:ff:ff:ff:ff:ff --> 0 (Success)
wpa_driver_nl80211_set_key: ifindex=6 (wlan3) alg=0 addr=(nil)
key_idx=0 set_tx=0 seq_len=0 key_len=0
wpa_driver_nl80211_set_key: ifindex=6 (wlan3) alg=0 addr=(nil)
key_idx=1 set_tx=0 seq_len=0 key_len=0
wpa_driver_nl80211_set_key: ifindex=6 (wlan3) alg=0 addr=(nil)
key_idx=2 set_tx=0 seq_len=0 key_len=0
wpa_driver_nl80211_set_key: ifindex=6 (wlan3) alg=0 addr=(nil)
key_idx=3 set_tx=0 seq_len=0 key_len=0
nl80211: Skip disabling of Probe Request reporting
nl_preq=0x8888888889cc9c49 while in AP mode
netlink: Operstate: linkmode=0, operstate=6
nl80211: Set mode ifindex 6 iftype 2 (STATION)
nl80211: Disable Probe Request reporting nl_preq=0x8888888889cc9c49
nl80211: Unsubscribe mgmt frames handle 0x8888888889cc9c09 (AP
teardown (dev SME))
Failed to initialize interface

I have tried several channels - all were rejected with the same message.

Any idea where these error messages come from?


Best regards,
Drasko

^ permalink raw reply

* pull request: bluetooth 2013-10-30
From: Gustavo Padovan @ 2013-10-30 19:38 UTC (permalink / raw)
  To: linville; +Cc: linux-wireless, linux-bluetooth, linux-kernel

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

Hi John,

A last fix to the 3.12. I ended forgetting to send it before, I hope we can
still make the way to 3.12. It is a revert and it fixes an issue with bluetooth
suspend/hibernate that had many bug reports. Please pull or let me know of any
problems. Thanks!

	Gustavo
--
The following changes since commit c7515d2365a6b8a018950198ebe1f5be793cd4bb:

  brcmsmac: call bcma_core_pci_power_save() from non-atomic context (2013-09-26 14:02:34 -0400)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth master

for you to fetch changes up to b1a8014471b01dd862de9f91bbbff1296afac42d:

  Bluetooth: revert: "Bluetooth: Add missing reset_resume dev_pm_ops" (2013-10-02 16:01:49 -0300)

----------------------------------------------------------------
Hans de Goede (1):
      Bluetooth: revert: "Bluetooth: Add missing reset_resume dev_pm_ops"

 drivers/bluetooth/btusb.c | 1 -
 1 file changed, 1 deletion(-)

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

^ permalink raw reply

* Re: [patch v2] libertas: potential oops in debugfs
From: Dan Williams @ 2013-10-30 19:51 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: John W. Linville, libertas-dev, linux-wireless, netdev,
	linux-kernel, kernel-janitors
In-Reply-To: <20131030171251.GA4130@longonot.mountain>

On Wed, 2013-10-30 at 20:12 +0300, Dan Carpenter wrote:
> If we do a zero size allocation then it will oops.  Also we can't be
> sure the user passes us a NUL terminated string so I've added a
> terminator.
> 
> This code can only be triggered by root.
> 
> Reported-by: Nico Golde <nico@ngolde.de>
> Reported-by: Fabian Yamaguchi <fabs@goesec.de>
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Acked-by: Dan Williams <dcbw@redhat.com>

> 
> diff --git a/drivers/net/wireless/libertas/debugfs.c b/drivers/net/wireless/libertas/debugfs.c
> index 668dd27..1917348 100644
> --- a/drivers/net/wireless/libertas/debugfs.c
> +++ b/drivers/net/wireless/libertas/debugfs.c
> @@ -913,7 +913,10 @@ static ssize_t lbs_debugfs_write(struct file *f, const char __user *buf,
>  	char *p2;
>  	struct debug_data *d = f->private_data;
>  
> -	pdata = kmalloc(cnt, GFP_KERNEL);
> +	if (cnt == 0)
> +		return 0;
> +
> +	pdata = kmalloc(cnt + 1, GFP_KERNEL);
>  	if (pdata == NULL)
>  		return 0;
>  
> @@ -922,6 +925,7 @@ static ssize_t lbs_debugfs_write(struct file *f, const char __user *buf,
>  		kfree(pdata);
>  		return 0;
>  	}
> +	pdata[cnt] = '\0';
>  
>  	p0 = pdata;
>  	for (i = 0; i < num_of_items; i++) {
> --
> 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



^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox