Commit fba4a1e6 authored by Johannes Berg's avatar Johannes Berg Committed by John W. Linville

mac80211: fix IBSS code

This patch fixes two errors introduced by

    commit 19d35612f3cd7f60dd9174c0100584e21f5a1025
    Author: Bruno Randolf <bruno@thinktube.com>
    Date:   Mon Feb 18 11:21:36 2008 +0900

        mac80211: enable IBSS merging

The first error is an endianness problem that sparse found and
the second is a build failure when CONFIG_MAC80211_IBSS_DEBUG
is not set.
Signed-off-by: default avatarJohannes Berg <johannes@sipsolutions.net>
Cc: Bruno Randolf <bruno@thinktube.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent f3af89d1
...@@ -2413,7 +2413,7 @@ static void ieee80211_rx_bss_info(struct net_device *dev, ...@@ -2413,7 +2413,7 @@ static void ieee80211_rx_bss_info(struct net_device *dev,
/* check if we need to merge IBSS */ /* check if we need to merge IBSS */
if (sdata->vif.type == IEEE80211_IF_TYPE_IBSS && beacon && if (sdata->vif.type == IEEE80211_IF_TYPE_IBSS && beacon &&
!local->sta_sw_scanning && !local->sta_hw_scanning && !local->sta_sw_scanning && !local->sta_hw_scanning &&
mgmt->u.beacon.capab_info & WLAN_CAPABILITY_IBSS && bss->capability & WLAN_CAPABILITY_IBSS &&
bss->freq == local->oper_channel->center_freq && bss->freq == local->oper_channel->center_freq &&
elems.ssid_len == sdata->u.sta.ssid_len && elems.ssid_len == sdata->u.sta.ssid_len &&
memcmp(elems.ssid, sdata->u.sta.ssid, sdata->u.sta.ssid_len) == 0) { memcmp(elems.ssid, sdata->u.sta.ssid, sdata->u.sta.ssid_len) == 0) {
...@@ -2453,12 +2453,12 @@ static void ieee80211_rx_bss_info(struct net_device *dev, ...@@ -2453,12 +2453,12 @@ static void ieee80211_rx_bss_info(struct net_device *dev,
jiffies); jiffies);
#endif /* CONFIG_MAC80211_IBSS_DEBUG */ #endif /* CONFIG_MAC80211_IBSS_DEBUG */
if (beacon_timestamp > rx_timestamp) { if (beacon_timestamp > rx_timestamp) {
#ifdef CONFIG_MAC80211_IBSS_DEBUG #ifndef CONFIG_MAC80211_IBSS_DEBUG
if (net_ratelimit()) if (net_ratelimit())
#endif
printk(KERN_DEBUG "%s: beacon TSF higher than " printk(KERN_DEBUG "%s: beacon TSF higher than "
"local TSF - IBSS merge with BSSID %s\n", "local TSF - IBSS merge with BSSID %s\n",
dev->name, print_mac(mac, mgmt->bssid)); dev->name, print_mac(mac, mgmt->bssid));
#endif /* CONFIG_MAC80211_IBSS_DEBUG */
ieee80211_sta_join_ibss(dev, &sdata->u.sta, bss); ieee80211_sta_join_ibss(dev, &sdata->u.sta, bss);
ieee80211_ibss_add_sta(dev, NULL, ieee80211_ibss_add_sta(dev, NULL,
mgmt->bssid, mgmt->sa); mgmt->bssid, mgmt->sa);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment