From: Ondrej Zary <linux@rainbow-software.org>
To: Dan Williams <dcbw@redhat.com>
Cc: linux-wireless@vger.kernel.org
Subject: airo: SIOCSIWAP (airo_set_wap) breaks scan
Date: Sat, 3 Oct 2015 22:29:58 +0200 [thread overview]
Message-ID: <201510032229.58460.linux@rainbow-software.org> (raw)
Hello,
found a weird problem while testing airo with multiple APs: the first scan
correctly shows all APs. After associating to one of them, subsequent scans
only show this single AP.
Tracked the problem down to SIOCSIWAP (airo_set_wap) - the APList rid affects
scan results.
Clearing APList before starting scan and setting it back after scan completes
makes it work (see the patch below). Is that an acceptable solution?
BTW. Instead of being dynamically allocated, APList should be a member of
struct airo_info and track the real card's state. That would simplify this
work-around and also suspend/resume.
diff --git a/drivers/net/wireless/airo.c b/drivers/net/wireless/airo.c
index 8ae838d..b4f79a7 100644
--- a/drivers/net/wireless/airo.c
+++ b/drivers/net/wireless/airo.c
@@ -3042,6 +3042,11 @@ static void airo_process_scan_results (struct airo_info *ai) {
}
out:
+ if (ai->APList) {
+ 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);
@@ -7233,6 +7238,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
@@ -7242,6 +7248,12 @@ static int airo_set_scan(struct net_device *dev,
* Jean II */
if (ai->flags & FLAG_RADIO_MASK) return -ENETDOWN;
+ if (!ai->APList)
+ ai->APList = kmalloc(sizeof(APListRid), GFP_KERNEL);
+ if (!ai->APList)
+ return -ENOMEM;
+ readAPListRid(ai, ai->APList);
+
if (down_interruptible(&ai->sem))
return -ERESTARTSYS;
@@ -7250,6 +7262,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
reply other threads:[~2015-10-03 20:36 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=201510032229.58460.linux@rainbow-software.org \
--to=linux@rainbow-software.org \
--cc=dcbw@redhat.com \
--cc=linux-wireless@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).