summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOndrej Zary <linux@rainbow-software.org>2015-10-16 15:04:14 -0400
committerKalle Valo <kvalo@codeaurora.org>2015-10-28 14:54:39 -0400
commitdae0412d0caa4948da07fe4ad91352b5b61a70ec (patch)
tree65b2cf23b80532c9ec27a92972d4ef14c1f87299
parentf675f93a797a18fc1f82030d56d02286039d0fb3 (diff)
airo: fix scan after SIOCSIWAP (airo_set_wap)
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. To avoid losing packets during scan, modify disable_MAC() to omit netif_carrier_off() call when lock == 2. Signed-off-by: Ondrej Zary <linux@rainbow-software.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
-rw-r--r--drivers/net/wireless/airo.c20
1 files changed, 17 insertions, 3 deletions
diff --git a/drivers/net/wireless/airo.c b/drivers/net/wireless/airo.c
index 4ef2f986888b..17c40f06f13e 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) {
3037 } 3037 }
3038 3038
3039out: 3039out:
3040 /* write APList back (we cleared it in airo_set_scan) */
3041 disable_MAC(ai, 2);
3042 writeAPListRid(ai, &ai->APList, 0);
3043 enable_MAC(ai, 0);
3044
3040 ai->scan_timeout = 0; 3045 ai->scan_timeout = 0;
3041 clear_bit(JOB_SCAN_RESULTS, &ai->jobs); 3046 clear_bit(JOB_SCAN_RESULTS, &ai->jobs);
3042 up(&ai->sem); 3047 up(&ai->sem);
@@ -3608,17 +3613,18 @@ static void disable_MAC( struct airo_info *ai, int lock ) {
3608 Cmd cmd; 3613 Cmd cmd;
3609 Resp rsp; 3614 Resp rsp;
3610 3615
3611 if (lock && down_interruptible(&ai->sem)) 3616 if (lock == 1 && down_interruptible(&ai->sem))
3612 return; 3617 return;
3613 3618
3614 if (test_bit(FLAG_ENABLED, &ai->flags)) { 3619 if (test_bit(FLAG_ENABLED, &ai->flags)) {
3615 netif_carrier_off(ai->dev); 3620 if (lock != 2) /* lock == 2 means don't disable carrier */
3621 netif_carrier_off(ai->dev);
3616 memset(&cmd, 0, sizeof(cmd)); 3622 memset(&cmd, 0, sizeof(cmd));
3617 cmd.cmd = MAC_DISABLE; // disable in case already enabled 3623 cmd.cmd = MAC_DISABLE; // disable in case already enabled
3618 issuecommand(ai, &cmd, &rsp); 3624 issuecommand(ai, &cmd, &rsp);
3619 clear_bit(FLAG_ENABLED, &ai->flags); 3625 clear_bit(FLAG_ENABLED, &ai->flags);
3620 } 3626 }
3621 if (lock) 3627 if (lock == 1)
3622 up(&ai->sem); 3628 up(&ai->sem);
3623} 3629}
3624 3630
@@ -7216,6 +7222,7 @@ static int airo_set_scan(struct net_device *dev,
7216 Cmd cmd; 7222 Cmd cmd;
7217 Resp rsp; 7223 Resp rsp;
7218 int wake = 0; 7224 int wake = 0;
7225 APListRid APList_rid_empty;
7219 7226
7220 /* Note : you may have realised that, as this is a SET operation, 7227 /* Note : you may have realised that, as this is a SET operation,
7221 * this is privileged and therefore a normal user can't 7228 * this is privileged and therefore a normal user can't
@@ -7233,6 +7240,13 @@ static int airo_set_scan(struct net_device *dev,
7233 if (ai->scan_timeout > 0) 7240 if (ai->scan_timeout > 0)
7234 goto out; 7241 goto out;
7235 7242
7243 /* Clear APList as it affects scan results */
7244 memset(&APList_rid_empty, 0, sizeof(APList_rid_empty));
7245 APList_rid_empty.len = cpu_to_le16(sizeof(APList_rid_empty));
7246 disable_MAC(ai, 2);
7247 writeAPListRid(ai, &APList_rid_empty, 0);
7248 enable_MAC(ai, 0);
7249
7236 /* Initiate a scan command */ 7250 /* Initiate a scan command */
7237 ai->scan_timeout = RUN_AT(3*HZ); 7251 ai->scan_timeout = RUN_AT(3*HZ);
7238 memset(&cmd, 0, sizeof(cmd)); 7252 memset(&cmd, 0, sizeof(cmd));