Fix broken is_beacon().

Signed-off-by: Pete Zaitcev <[EMAIL PROTECTED]>

---

This wart came with -rc3. The -rc2 was ok. It's not like nobody noticed:
Johannes' snapshot has a different fix (which is somewhat defective,
he declared a CPU-order word as __be16). But the strangest thing is, the
git tree "wireless-2.6" is not fixed even though it contains a softmac
branch. I suppose Johannes simply forgot to push his fix out to John.

-- Pete

--- linux-2.6.16-rc5/net/ieee80211/ieee80211_rx.c       2006-02-26 
23:04:57.000000000 -0800
+++ linux-2.6.16-rc5-lem/net/ieee80211/ieee80211_rx.c   2006-02-26 
23:11:49.000000000 -0800
@@ -1301,7 +1301,7 @@ static void update_network(struct ieee80
        /* dst->last_associate is not overwritten */
 }
 
-static inline int is_beacon(int fc)
+static inline int is_beacon(__le16 fc)
 {
        return (WLAN_FC_GET_STYPE(le16_to_cpu(fc)) == IEEE80211_STYPE_BEACON);
 }
@@ -1348,9 +1348,7 @@ static void ieee80211_process_probe_resp
                                     escape_essid(info_element->data,
                                                  info_element->len),
                                     MAC_ARG(beacon->header.addr3),
-                                    is_beacon(le16_to_cpu
-                                              (beacon->header.
-                                               frame_ctl)) ?
+                                    is_beacon(beacon->header.frame_ctl) ?
                                     "BEACON" : "PROBE RESPONSE");
                return;
        }
@@ -1400,9 +1398,7 @@ static void ieee80211_process_probe_resp
                                     escape_essid(network.ssid,
                                                  network.ssid_len),
                                     MAC_ARG(network.bssid),
-                                    is_beacon(le16_to_cpu
-                                              (beacon->header.
-                                               frame_ctl)) ?
+                                    is_beacon(beacon->header.frame_ctl) ?
                                     "BEACON" : "PROBE RESPONSE");
 #endif
                memcpy(target, &network, sizeof(*target));
@@ -1412,16 +1408,14 @@ static void ieee80211_process_probe_resp
                                     escape_essid(target->ssid,
                                                  target->ssid_len),
                                     MAC_ARG(target->bssid),
-                                    is_beacon(le16_to_cpu
-                                              (beacon->header.
-                                               frame_ctl)) ?
+                                    is_beacon(beacon->header.frame_ctl) ?
                                     "BEACON" : "PROBE RESPONSE");
                update_network(target, &network);
        }
 
        spin_unlock_irqrestore(&ieee->lock, flags);
 
-       if (is_beacon(le16_to_cpu(beacon->header.frame_ctl))) {
+       if (is_beacon(beacon->header.frame_ctl)) {
                if (ieee->handle_beacon != NULL)
                        ieee->handle_beacon(dev, beacon, &network);
        } else {
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to