linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch] airo: fix test for FLAG_RADIO_DOWN
@ 2012-03-05 18:10 Dan Carpenter
  0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2012-03-05 18:10 UTC (permalink / raw)
  To: John W. Linville; +Cc: linux-wireless, kernel-janitors

We should be doing a shift (1 << FLAG_RADIO_DOWN) here before testing
the flag.  As luck would have it, this test works almost correctly.
The current code tests for FLAG_RADIO_OFF instead of FLAG_RADIO_DOWN.

#define FLAG_RADIO_OFF  0       /* User disabling of MAC */
#define FLAG_RADIO_DOWN 1       /* ifup/ifdown disabling of MAC */

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
I don't have this hardware.  Please review carefully.

diff --git a/drivers/net/wireless/airo.c b/drivers/net/wireless/airo.c
index 1c008c6..ddc061d 100644
--- a/drivers/net/wireless/airo.c
+++ b/drivers/net/wireless/airo.c
@@ -1869,7 +1869,7 @@ static int readStatsRid(struct airo_info*ai, StatsRid *sr, int rid, int lock)
 
 static void try_auto_wep(struct airo_info *ai)
 {
-	if (auto_wep && !(ai->flags & FLAG_RADIO_DOWN)) {
+	if (auto_wep && !test_bit(FLAG_RADIO_DOWN, &ai->flags)) {
 		ai->expires = RUN_AT(3*HZ);
 		wake_up_interruptible(&ai->thr_wait);
 	}

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2012-03-05 18:10 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-05 18:10 [patch] airo: fix test for FLAG_RADIO_DOWN Dan Carpenter

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