aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorJouni Malinen <jouni.malinen@atheros.com>2011-05-16 12:40:15 -0400
committerJohn W. Linville <linville@tuxdriver.com>2011-05-19 10:37:18 -0400
commited9d01026f156db2d638cbb045231c7a8fde877d (patch)
tree0c99c25b87973112db1b8464e5ad429cd943786f /net
parent79d2b1570bcc31b846ccb2114a34e98ca87bf1d9 (diff)
cfg80211: Use consistent BSS matching between scan and sme
cfg80211 scan code adds separate BSS entries if the same BSS shows up on multiple channels. However, sme implementation does not use the frequency when fetching the BSS entry. Fix this by adding channel information to cfg80211_roamed() and include it in cfg80211_get_bss() calls. Please note that drivers using cfg80211_roamed() need to be modified to fully implement this fix. This commit includes only minimal changes to avoid compilation issues; it maintains the old (broken) behavior for most drivers. ath6kl was the only one that I could test, so I updated it to provide the operating frequency in the roamed event. Signed-off-by: Jouni Malinen <jouni.malinen@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net')
-rw-r--r--net/wireless/core.h5
-rw-r--r--net/wireless/sme.c19
-rw-r--r--net/wireless/util.c2
3 files changed, 19 insertions, 7 deletions
diff --git a/net/wireless/core.h b/net/wireless/core.h
index bf0fb40e3c8b..3dce1f167eba 100644
--- a/net/wireless/core.h
+++ b/net/wireless/core.h
@@ -245,6 +245,7 @@ struct cfg80211_event {
245 u16 status; 245 u16 status;
246 } cr; 246 } cr;
247 struct { 247 struct {
248 struct ieee80211_channel *channel;
248 u8 bssid[ETH_ALEN]; 249 u8 bssid[ETH_ALEN];
249 const u8 *req_ie; 250 const u8 *req_ie;
250 const u8 *resp_ie; 251 const u8 *resp_ie;
@@ -392,7 +393,9 @@ int __cfg80211_disconnect(struct cfg80211_registered_device *rdev,
392int cfg80211_disconnect(struct cfg80211_registered_device *rdev, 393int cfg80211_disconnect(struct cfg80211_registered_device *rdev,
393 struct net_device *dev, u16 reason, 394 struct net_device *dev, u16 reason,
394 bool wextev); 395 bool wextev);
395void __cfg80211_roamed(struct wireless_dev *wdev, const u8 *bssid, 396void __cfg80211_roamed(struct wireless_dev *wdev,
397 struct ieee80211_channel *channel,
398 const u8 *bssid,
396 const u8 *req_ie, size_t req_ie_len, 399 const u8 *req_ie, size_t req_ie_len,
397 const u8 *resp_ie, size_t resp_ie_len); 400 const u8 *resp_ie, size_t resp_ie_len);
398int cfg80211_mgd_wext_connect(struct cfg80211_registered_device *rdev, 401int cfg80211_mgd_wext_connect(struct cfg80211_registered_device *rdev,
diff --git a/net/wireless/sme.c b/net/wireless/sme.c
index e17b0bee6bdc..b7b6ff8be553 100644
--- a/net/wireless/sme.c
+++ b/net/wireless/sme.c
@@ -250,7 +250,8 @@ static struct cfg80211_bss *cfg80211_get_conn_bss(struct wireless_dev *wdev)
250 if (wdev->conn->params.privacy) 250 if (wdev->conn->params.privacy)
251 capa |= WLAN_CAPABILITY_PRIVACY; 251 capa |= WLAN_CAPABILITY_PRIVACY;
252 252
253 bss = cfg80211_get_bss(wdev->wiphy, NULL, wdev->conn->params.bssid, 253 bss = cfg80211_get_bss(wdev->wiphy, wdev->conn->params.channel,
254 wdev->conn->params.bssid,
254 wdev->conn->params.ssid, 255 wdev->conn->params.ssid,
255 wdev->conn->params.ssid_len, 256 wdev->conn->params.ssid_len,
256 WLAN_CAPABILITY_ESS | WLAN_CAPABILITY_PRIVACY, 257 WLAN_CAPABILITY_ESS | WLAN_CAPABILITY_PRIVACY,
@@ -470,7 +471,10 @@ void __cfg80211_connect_result(struct net_device *dev, const u8 *bssid,
470 } 471 }
471 472
472 if (!bss) 473 if (!bss)
473 bss = cfg80211_get_bss(wdev->wiphy, NULL, bssid, 474 bss = cfg80211_get_bss(wdev->wiphy,
475 wdev->conn ? wdev->conn->params.channel :
476 NULL,
477 bssid,
474 wdev->ssid, wdev->ssid_len, 478 wdev->ssid, wdev->ssid_len,
475 WLAN_CAPABILITY_ESS, 479 WLAN_CAPABILITY_ESS,
476 WLAN_CAPABILITY_ESS); 480 WLAN_CAPABILITY_ESS);
@@ -538,7 +542,9 @@ void cfg80211_connect_result(struct net_device *dev, const u8 *bssid,
538} 542}
539EXPORT_SYMBOL(cfg80211_connect_result); 543EXPORT_SYMBOL(cfg80211_connect_result);
540 544
541void __cfg80211_roamed(struct wireless_dev *wdev, const u8 *bssid, 545void __cfg80211_roamed(struct wireless_dev *wdev,
546 struct ieee80211_channel *channel,
547 const u8 *bssid,
542 const u8 *req_ie, size_t req_ie_len, 548 const u8 *req_ie, size_t req_ie_len,
543 const u8 *resp_ie, size_t resp_ie_len) 549 const u8 *resp_ie, size_t resp_ie_len)
544{ 550{
@@ -565,7 +571,7 @@ void __cfg80211_roamed(struct wireless_dev *wdev, const u8 *bssid,
565 cfg80211_put_bss(&wdev->current_bss->pub); 571 cfg80211_put_bss(&wdev->current_bss->pub);
566 wdev->current_bss = NULL; 572 wdev->current_bss = NULL;
567 573
568 bss = cfg80211_get_bss(wdev->wiphy, NULL, bssid, 574 bss = cfg80211_get_bss(wdev->wiphy, channel, bssid,
569 wdev->ssid, wdev->ssid_len, 575 wdev->ssid, wdev->ssid_len,
570 WLAN_CAPABILITY_ESS, WLAN_CAPABILITY_ESS); 576 WLAN_CAPABILITY_ESS, WLAN_CAPABILITY_ESS);
571 577
@@ -603,7 +609,9 @@ void __cfg80211_roamed(struct wireless_dev *wdev, const u8 *bssid,
603#endif 609#endif
604} 610}
605 611
606void cfg80211_roamed(struct net_device *dev, const u8 *bssid, 612void cfg80211_roamed(struct net_device *dev,
613 struct ieee80211_channel *channel,
614 const u8 *bssid,
607 const u8 *req_ie, size_t req_ie_len, 615 const u8 *req_ie, size_t req_ie_len,
608 const u8 *resp_ie, size_t resp_ie_len, gfp_t gfp) 616 const u8 *resp_ie, size_t resp_ie_len, gfp_t gfp)
609{ 617{
@@ -619,6 +627,7 @@ void cfg80211_roamed(struct net_device *dev, const u8 *bssid,
619 return; 627 return;
620 628
621 ev->type = EVENT_ROAMED; 629 ev->type = EVENT_ROAMED;
630 ev->rm.channel = channel;
622 memcpy(ev->rm.bssid, bssid, ETH_ALEN); 631 memcpy(ev->rm.bssid, bssid, ETH_ALEN);
623 ev->rm.req_ie = ((u8 *)ev) + sizeof(*ev); 632 ev->rm.req_ie = ((u8 *)ev) + sizeof(*ev);
624 ev->rm.req_ie_len = req_ie_len; 633 ev->rm.req_ie_len = req_ie_len;
diff --git a/net/wireless/util.c b/net/wireless/util.c
index f0536d44d43c..4d7b83fbc32f 100644
--- a/net/wireless/util.c
+++ b/net/wireless/util.c
@@ -746,7 +746,7 @@ static void cfg80211_process_wdev_events(struct wireless_dev *wdev)
746 NULL); 746 NULL);
747 break; 747 break;
748 case EVENT_ROAMED: 748 case EVENT_ROAMED:
749 __cfg80211_roamed(wdev, ev->rm.bssid, 749 __cfg80211_roamed(wdev, ev->rm.channel, ev->rm.bssid,
750 ev->rm.req_ie, ev->rm.req_ie_len, 750 ev->rm.req_ie, ev->rm.req_ie_len,
751 ev->rm.resp_ie, ev->rm.resp_ie_len); 751 ev->rm.resp_ie, ev->rm.resp_ie_len);
752 break; 752 break;