Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 266361
b: refs/heads/master
c: b4c3f34
h: refs/heads/master
i:
  266359: 6e25120
v: v3
  • Loading branch information
Daniel Drake authored and John W. Linville committed Sep 27, 2011
1 parent 9be9a0f commit 0f05423
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 18 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: 38ba3c57af1c737966fb58bcbeecdc71f5f4fa90
refs/heads/master: b4c3f34afffcab01b6eb5155399a0b85b1123ada
33 changes: 17 additions & 16 deletions trunk/drivers/net/wireless/libertas/cfg.c
Original file line number Diff line number Diff line change
Expand Up @@ -695,7 +695,7 @@ static void lbs_scan_worker(struct work_struct *work)
tlv = scan_cmd->tlvbuffer;

/* add SSID TLV */
if (priv->scan_req->n_ssids)
if (priv->scan_req->n_ssids && priv->scan_req->ssids[0].ssid_len > 0)
tlv += lbs_add_ssid_tlv(tlv,
priv->scan_req->ssids[0].ssid,
priv->scan_req->ssids[0].ssid_len);
Expand Down Expand Up @@ -736,7 +736,6 @@ static void lbs_scan_worker(struct work_struct *work)
cfg80211_scan_done(priv->scan_req, false);

priv->scan_req = NULL;
priv->last_scan = jiffies;
}

/* Restart network */
Expand Down Expand Up @@ -1302,24 +1301,26 @@ static int lbs_cfg_connect(struct wiphy *wiphy, struct net_device *dev,
lbs_deb_enter(LBS_DEB_CFG80211);

if (!sme->bssid) {
/* Run a scan if one isn't in-progress already and if the last
* scan was done more than 2 seconds ago.
*/
if (priv->scan_req == NULL &&
time_after(jiffies, priv->last_scan + (2 * HZ))) {
struct cfg80211_scan_request *creq;
struct cfg80211_scan_request *creq;

creq = _new_connect_scan_req(wiphy, sme);
if (!creq) {
ret = -EINVAL;
goto done;
}
/*
* Scan for the requested network after waiting for existing
* scans to finish.
*/
lbs_deb_assoc("assoc: waiting for existing scans\n");
wait_event_interruptible_timeout(priv->scan_q,
(priv->scan_req == NULL),
(15 * HZ));

lbs_deb_assoc("assoc: scanning for compatible AP\n");
_internal_start_scan(priv, true, creq);
creq = _new_connect_scan_req(wiphy, sme);
if (!creq) {
ret = -EINVAL;
goto done;
}

/* Wait for any in-progress scan to complete */
lbs_deb_assoc("assoc: scanning for compatible AP\n");
_internal_start_scan(priv, true, creq);

lbs_deb_assoc("assoc: waiting for scan to complete\n");
wait_event_interruptible_timeout(priv->scan_q,
(priv->scan_req == NULL),
Expand Down
1 change: 0 additions & 1 deletion trunk/drivers/net/wireless/libertas/dev.h
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,6 @@ struct lbs_private {
wait_queue_head_t scan_q;
/* Whether the scan was initiated internally and not by cfg80211 */
bool internal_scan;
unsigned long last_scan;
};

extern struct cmd_confirm_sleep confirm_sleep;
Expand Down

0 comments on commit 0f05423

Please sign in to comment.