wl12xx: fix passive and radar channel generation for scheduled scan
authorLuciano Coelho <coelho@ti.com>
Fri, 27 May 2011 12:34:45 +0000 (15:34 +0300)
committerJohn W. Linville <linville@tuxdriver.com>
Tue, 31 May 2011 18:47:24 +0000 (14:47 -0400)
We were comparing bitwise AND results with a boolean, so when the
boolean was set to true, it was not matching as it should.

Fix this by booleanizing the bitwise AND results with !!.

Signed-off-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/wl12xx/scan.c

index f37e5a3919763b45f5b2f96f4f9b9d6d54e3f9ad..f223e0ed0c41a250af418f632d5a1a4a71ae8e61 100644 (file)
@@ -338,8 +338,8 @@ wl1271_scan_get_sched_scan_channels(struct wl1271 *wl,
                flags = req->channels[i]->flags;
 
                if (!(flags & IEEE80211_CHAN_DISABLED) &&
-                   ((flags & IEEE80211_CHAN_PASSIVE_SCAN) == passive) &&
-                   ((flags & IEEE80211_CHAN_RADAR) == radar) &&
+                   (!!(flags & IEEE80211_CHAN_PASSIVE_SCAN) == passive) &&
+                   (!!(flags & IEEE80211_CHAN_RADAR) == radar) &&
                    (req->channels[i]->band == band)) {
                        wl1271_debug(DEBUG_SCAN, "band %d, center_freq %d ",
                                     req->channels[i]->band,