Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1242667 > unrolled thread

[RFC PATCH 2/2] airo: fix scan after SIOCSIWAP (airo_set_wap)

Started byOndrej Zary <linux@rainbow-software.org>
First post2015-10-08 20:20 +0200
Last post2015-10-09 16:40 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [RFC PATCH 2/2] airo: fix scan after SIOCSIWAP (airo_set_wap) Ondrej Zary <linux@rainbow-software.org> - 2015-10-08 20:20 +0200
    Re: [RFC PATCH 2/2] airo: fix scan after SIOCSIWAP (airo_set_wap) Dan Williams <dcbw@redhat.com> - 2015-10-09 16:40 +0200

#1242667 — [RFC PATCH 2/2] airo: fix scan after SIOCSIWAP (airo_set_wap)

FromOndrej Zary <linux@rainbow-software.org>
Date2015-10-08 20:20 +0200
Subject[RFC PATCH 2/2] airo: fix scan after SIOCSIWAP (airo_set_wap)
Message-ID<qhnXj-2RM-15@gated-at.bofh.it>
SIOCSIWAP (airo_set_wap) affects scan: only the AP specified by
SIOCSIWAP is present in scan results.

This makes NetworkManager work for the first time but then unable to
find any other APs.

Clear APList before starting scan and set it back after scan completes
to work-around the problem.

Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
---
 drivers/net/wireless/airo.c |   13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/drivers/net/wireless/airo.c b/drivers/net/wireless/airo.c
index 4ef2f98..654a172 100644
--- a/drivers/net/wireless/airo.c
+++ b/drivers/net/wireless/airo.c
@@ -3037,6 +3037,11 @@ static void airo_process_scan_results (struct airo_info *ai) {
 	}
 
 out:
+	/* write APList back (we cleared it in airo_set_scan) */
+	disable_MAC(ai, 0);
+	writeAPListRid(ai, &ai->APList, 0);
+	enable_MAC(ai, 0);
+
 	ai->scan_timeout = 0;
 	clear_bit(JOB_SCAN_RESULTS, &ai->jobs);
 	up(&ai->sem);
@@ -7216,6 +7221,7 @@ static int airo_set_scan(struct net_device *dev,
 	Cmd cmd;
 	Resp rsp;
 	int wake = 0;
+	APListRid APList_rid_empty;
 
 	/* Note : you may have realised that, as this is a SET operation,
 	 * this is privileged and therefore a normal user can't
@@ -7233,6 +7239,13 @@ static int airo_set_scan(struct net_device *dev,
 	if (ai->scan_timeout > 0)
 		goto out;
 
+	/* Clear APList as it affects scan results */
+	memset(&APList_rid_empty, 0, sizeof(APList_rid_empty));
+	APList_rid_empty.len = cpu_to_le16(sizeof(APList_rid_empty));
+	disable_MAC(ai, 0);
+	writeAPListRid(ai, &APList_rid_empty, 0);
+	enable_MAC(ai, 0);
+
 	/* Initiate a scan command */
 	ai->scan_timeout = RUN_AT(3*HZ);
 	memset(&cmd, 0, sizeof(cmd));
-- 
Ondrej Zary

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [next] | [standalone]


#1243441

FromDan Williams <dcbw@redhat.com>
Date2015-10-09 16:40 +0200
Message-ID<qhGZZ-4Tm-41@gated-at.bofh.it>
In reply to#1242667
On Thu, 2015-10-08 at 20:14 +0200, Ondrej Zary wrote:
> SIOCSIWAP (airo_set_wap) affects scan: only the AP specified by
> SIOCSIWAP is present in scan results.
> 
> This makes NetworkManager work for the first time but then unable to
> find any other APs.
> 
> Clear APList before starting scan and set it back after scan completes
> to work-around the problem.

Sounds plausible.  But does this cause any problems while the device is
associated and a scan is requested?  If not then it seems fine.

Dan

> Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
> ---
>  drivers/net/wireless/airo.c |   13 +++++++++++++
>  1 file changed, 13 insertions(+)
> 
> diff --git a/drivers/net/wireless/airo.c b/drivers/net/wireless/airo.c
> index 4ef2f98..654a172 100644
> --- a/drivers/net/wireless/airo.c
> +++ b/drivers/net/wireless/airo.c
> @@ -3037,6 +3037,11 @@ static void airo_process_scan_results (struct airo_info *ai) {
>  	}
>  
>  out:
> +	/* write APList back (we cleared it in airo_set_scan) */
> +	disable_MAC(ai, 0);
> +	writeAPListRid(ai, &ai->APList, 0);
> +	enable_MAC(ai, 0);
> +
>  	ai->scan_timeout = 0;
>  	clear_bit(JOB_SCAN_RESULTS, &ai->jobs);
>  	up(&ai->sem);
> @@ -7216,6 +7221,7 @@ static int airo_set_scan(struct net_device *dev,
>  	Cmd cmd;
>  	Resp rsp;
>  	int wake = 0;
> +	APListRid APList_rid_empty;
>  
>  	/* Note : you may have realised that, as this is a SET operation,
>  	 * this is privileged and therefore a normal user can't
> @@ -7233,6 +7239,13 @@ static int airo_set_scan(struct net_device *dev,
>  	if (ai->scan_timeout > 0)
>  		goto out;
>  
> +	/* Clear APList as it affects scan results */
> +	memset(&APList_rid_empty, 0, sizeof(APList_rid_empty));
> +	APList_rid_empty.len = cpu_to_le16(sizeof(APList_rid_empty));
> +	disable_MAC(ai, 0);
> +	writeAPListRid(ai, &APList_rid_empty, 0);
> +	enable_MAC(ai, 0);
> +
>  	/* Initiate a scan command */
>  	ai->scan_timeout = RUN_AT(3*HZ);
>  	memset(&cmd, 0, sizeof(cmd));


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web