Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 275061
b: refs/heads/master
c: 3209e06
h: refs/heads/master
i:
  275059: dbaf937
v: v3
  • Loading branch information
Andres Salomon authored and John W. Linville committed Nov 2, 2011
1 parent 341131a commit 7999661
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 13 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: 93348928f2c980718434b1bc42f9d7638d665db4
refs/heads/master: 3209e061ad04465b3999091f315049c95ac6cbcb
25 changes: 17 additions & 8 deletions trunk/drivers/net/wireless/libertas/cfg.c
Original file line number Diff line number Diff line change
Expand Up @@ -728,15 +728,9 @@ static void lbs_scan_worker(struct work_struct *work)
le16_to_cpu(scan_cmd->hdr.size),
lbs_ret_scan, 0);

if (priv->scan_channel >= priv->scan_req->n_channels) {
if (priv->scan_channel >= priv->scan_req->n_channels)
/* Mark scan done */
if (priv->internal_scan)
kfree(priv->scan_req);
else
cfg80211_scan_done(priv->scan_req, false);

priv->scan_req = NULL;
}
lbs_scan_done(priv);

/* Restart network */
if (carrier)
Expand Down Expand Up @@ -774,6 +768,21 @@ static void _internal_start_scan(struct lbs_private *priv, bool internal,
lbs_deb_leave(LBS_DEB_CFG80211);
}

/*
* Clean up priv->scan_req. Should be used to handle the allocation details.
*/
void lbs_scan_done(struct lbs_private *priv)
{
WARN_ON(!priv->scan_req);

if (priv->internal_scan)
kfree(priv->scan_req);
else
cfg80211_scan_done(priv->scan_req, false);

priv->scan_req = NULL;
}

static int lbs_cfg_scan(struct wiphy *wiphy,
struct net_device *dev,
struct cfg80211_scan_request *request)
Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/net/wireless/libertas/cfg.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ int lbs_reg_notifier(struct wiphy *wiphy,
void lbs_send_disconnect_notification(struct lbs_private *priv);
void lbs_send_mic_failureevent(struct lbs_private *priv, u32 event);

void lbs_scan_done(struct lbs_private *priv);
void lbs_scan_deinit(struct lbs_private *priv);
int lbs_disconnect(struct lbs_private *priv, u16 reason);

Expand Down
6 changes: 2 additions & 4 deletions trunk/drivers/net/wireless/libertas/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -255,10 +255,8 @@ static int lbs_eth_stop(struct net_device *dev)

lbs_update_mcast(priv);
cancel_delayed_work_sync(&priv->scan_work);
if (priv->scan_req) {
cfg80211_scan_done(priv->scan_req, false);
priv->scan_req = NULL;
}
if (priv->scan_req)
lbs_scan_done(priv);

netif_carrier_off(priv->dev);

Expand Down

0 comments on commit 7999661

Please sign in to comment.