Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 162907
b: refs/heads/master
c: bbac31f
h: refs/heads/master
i:
  162905: b91ff48
  162903: bed55ef
v: v3
  • Loading branch information
Johannes Berg authored and John W. Linville committed Sep 16, 2009
1 parent f1013b3 commit 925abde
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 9 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 8c6c03fe230c448e5795464a9d73efb796acf3d6
refs/heads/master: bbac31f4c0339f6c51afbd0edfb4959df9b53fa9
21 changes: 13 additions & 8 deletions trunk/net/wireless/sme.c
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ void cfg80211_conn_work(struct work_struct *work)
rtnl_unlock();
}

static bool cfg80211_get_conn_bss(struct wireless_dev *wdev)
static struct cfg80211_bss *cfg80211_get_conn_bss(struct wireless_dev *wdev)
{
struct cfg80211_registered_device *rdev = wiphy_to_dev(wdev->wiphy);
struct cfg80211_bss *bss;
Expand All @@ -205,22 +205,22 @@ static bool cfg80211_get_conn_bss(struct wireless_dev *wdev)
WLAN_CAPABILITY_ESS | WLAN_CAPABILITY_PRIVACY,
capa);
if (!bss)
return false;
return NULL;

memcpy(wdev->conn->bssid, bss->bssid, ETH_ALEN);
wdev->conn->params.bssid = wdev->conn->bssid;
wdev->conn->params.channel = bss->channel;
wdev->conn->state = CFG80211_CONN_AUTHENTICATE_NEXT;
schedule_work(&rdev->conn_work);

cfg80211_put_bss(bss);
return true;
return bss;
}

static void __cfg80211_sme_scan_done(struct net_device *dev)
{
struct wireless_dev *wdev = dev->ieee80211_ptr;
struct cfg80211_registered_device *rdev = wiphy_to_dev(wdev->wiphy);
struct cfg80211_bss *bss;

ASSERT_WDEV_LOCK(wdev);

Expand All @@ -234,7 +234,10 @@ static void __cfg80211_sme_scan_done(struct net_device *dev)
wdev->conn->state != CFG80211_CONN_SCAN_AGAIN)
return;

if (!cfg80211_get_conn_bss(wdev)) {
bss = cfg80211_get_conn_bss(wdev);
if (bss) {
cfg80211_put_bss(bss);
} else {
/* not found */
if (wdev->conn->state == CFG80211_CONN_SCAN_AGAIN)
schedule_work(&rdev->conn_work);
Expand Down Expand Up @@ -670,6 +673,7 @@ int __cfg80211_connect(struct cfg80211_registered_device *rdev,
{
struct wireless_dev *wdev = dev->ieee80211_ptr;
struct ieee80211_channel *chan;
struct cfg80211_bss *bss = NULL;
int err;

ASSERT_WDEV_LOCK(wdev);
Expand Down Expand Up @@ -760,7 +764,7 @@ int __cfg80211_connect(struct cfg80211_registered_device *rdev,

/* don't care about result -- but fill bssid & channel */
if (!wdev->conn->params.bssid || !wdev->conn->params.channel)
cfg80211_get_conn_bss(wdev);
bss = cfg80211_get_conn_bss(wdev);

wdev->sme_state = CFG80211_SME_CONNECTING;
wdev->connect_keys = connkeys;
Expand All @@ -770,10 +774,11 @@ int __cfg80211_connect(struct cfg80211_registered_device *rdev,
wdev->conn->prev_bssid_valid = true;
}

/* we're good if we have both BSSID and channel */
if (wdev->conn->params.bssid && wdev->conn->params.channel) {
/* we're good if we have a matching bss struct */
if (bss) {
wdev->conn->state = CFG80211_CONN_AUTHENTICATE_NEXT;
err = cfg80211_conn_do_work(wdev);
cfg80211_put_bss(bss);
} else {
/* otherwise we'll need to scan for the AP first */
err = cfg80211_conn_scan(wdev);
Expand Down

0 comments on commit 925abde

Please sign in to comment.