Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 340989
b: refs/heads/master
c: f162cac
h: refs/heads/master
i:
  340987: edb8bd7
v: v3
  • Loading branch information
Amitkumar Karwar authored and John W. Linville committed Oct 29, 2012
1 parent 16bc24c commit 7985ccc
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 11 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: e45a841972b9d43e19e61ab3089bbe0d52a990e8
refs/heads/master: f162cac83ba474eb71ea2aa7788bd77f1692f4d2
5 changes: 5 additions & 0 deletions trunk/drivers/net/wireless/mwifiex/cfg80211.c
Original file line number Diff line number Diff line change
Expand Up @@ -1828,6 +1828,11 @@ mwifiex_cfg80211_scan(struct wiphy *wiphy,

priv->scan_request = request;

if (priv->user_scan_cfg) {
dev_err(priv->adapter->dev, "cmd: Scan already in process..\n");
return -EBUSY;
}

priv->user_scan_cfg = kzalloc(sizeof(struct mwifiex_user_scan_cfg),
GFP_KERNEL);
if (!priv->user_scan_cfg) {
Expand Down
14 changes: 10 additions & 4 deletions trunk/drivers/net/wireless/mwifiex/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,16 @@ static void scan_delay_timer_fn(unsigned long data)
spin_unlock_irqrestore(&adapter->mwifiex_cmd_lock, flags);

if (priv->user_scan_cfg) {
dev_dbg(priv->adapter->dev,
"info: %s: scan aborted\n", __func__);
cfg80211_scan_done(priv->scan_request, 1);
priv->scan_request = NULL;
if (priv->scan_request) {
dev_dbg(priv->adapter->dev,
"info: aborting scan\n");
cfg80211_scan_done(priv->scan_request, 1);
priv->scan_request = NULL;
} else {
dev_dbg(priv->adapter->dev,
"info: scan already aborted\n");
}

kfree(priv->user_scan_cfg);
priv->user_scan_cfg = NULL;
}
Expand Down
8 changes: 8 additions & 0 deletions trunk/drivers/net/wireless/mwifiex/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -472,6 +472,14 @@ mwifiex_open(struct net_device *dev)
static int
mwifiex_close(struct net_device *dev)
{
struct mwifiex_private *priv = mwifiex_netdev_get_priv(dev);

if (priv->scan_request) {
dev_dbg(priv->adapter->dev, "aborting scan on ndo_stop\n");
cfg80211_scan_done(priv->scan_request, 1);
priv->scan_request = NULL;
}

return 0;
}

Expand Down
25 changes: 19 additions & 6 deletions trunk/drivers/net/wireless/mwifiex/scan.c
Original file line number Diff line number Diff line change
Expand Up @@ -1768,16 +1768,29 @@ int mwifiex_ret_802_11_scan(struct mwifiex_private *priv,
}

if (priv->user_scan_cfg) {
dev_dbg(priv->adapter->dev,
"info: %s: sending scan results\n", __func__);
cfg80211_scan_done(priv->scan_request, 0);
priv->scan_request = NULL;
if (priv->scan_request) {
dev_dbg(priv->adapter->dev,
"info: notifying scan done\n");
cfg80211_scan_done(priv->scan_request, 0);
priv->scan_request = NULL;
} else {
dev_dbg(priv->adapter->dev,
"info: scan already aborted\n");
}

kfree(priv->user_scan_cfg);
priv->user_scan_cfg = NULL;
}
} else {
if (!mwifiex_wmm_lists_empty(adapter) &&
(priv->scan_request && (priv->scan_request->flags &
if (priv->user_scan_cfg && !priv->scan_request) {
spin_unlock_irqrestore(&adapter->scan_pending_q_lock,
flags);
adapter->scan_delay_cnt = MWIFIEX_MAX_SCAN_DELAY_CNT;
mod_timer(&priv->scan_delay_timer, jiffies);
dev_dbg(priv->adapter->dev,
"info: %s: triggerring scan abort\n", __func__);
} else if (!mwifiex_wmm_lists_empty(adapter) &&
(priv->scan_request && (priv->scan_request->flags &
NL80211_SCAN_FLAG_LOW_PRIORITY))) {
spin_unlock_irqrestore(&adapter->scan_pending_q_lock,
flags);
Expand Down

0 comments on commit 7985ccc

Please sign in to comment.