aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/cfg.c
diff options
context:
space:
mode:
authorIlan Peer <ilan.peer@intel.com>2013-12-19 06:25:29 -0500
committerJohannes Berg <johannes.berg@intel.com>2014-02-04 15:48:18 -0500
commit2fae062e503bd087d1ef7aebfd5c6707c6ec5564 (patch)
tree58794fc6a7490119daedf58a751677c7f1848c67 /net/mac80211/cfg.c
parent1693d34416a4b07e291578b4b87dc811876046cf (diff)
mac80211: Fix ROC duration == 0 handling
In case the given ROC duration is 0, update it to a minimal value before setting the ieee80211_roc_work parameters, so it also would be valid for cases where scan is in progress or there are other ROCs queued. Signed-off-by: Ilan Peer <ilan.peer@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211/cfg.c')
-rw-r--r--net/mac80211/cfg.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index cf961a5f3aa9..d2125a37014a 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -2628,6 +2628,18 @@ static int ieee80211_start_roc_work(struct ieee80211_local *local,
2628 if (!roc) 2628 if (!roc)
2629 return -ENOMEM; 2629 return -ENOMEM;
2630 2630
2631 /*
2632 * If the duration is zero, then the driver
2633 * wouldn't actually do anything. Set it to
2634 * 10 for now.
2635 *
2636 * TODO: cancel the off-channel operation
2637 * when we get the SKB's TX status and
2638 * the wait time was zero before.
2639 */
2640 if (!duration)
2641 duration = 10;
2642
2631 roc->chan = channel; 2643 roc->chan = channel;
2632 roc->duration = duration; 2644 roc->duration = duration;
2633 roc->req_duration = duration; 2645 roc->req_duration = duration;
@@ -2651,18 +2663,6 @@ static int ieee80211_start_roc_work(struct ieee80211_local *local,
2651 2663
2652 /* otherwise actually kick it off here (for error handling) */ 2664 /* otherwise actually kick it off here (for error handling) */
2653 2665
2654 /*
2655 * If the duration is zero, then the driver
2656 * wouldn't actually do anything. Set it to
2657 * 10 for now.
2658 *
2659 * TODO: cancel the off-channel operation
2660 * when we get the SKB's TX status and
2661 * the wait time was zero before.
2662 */
2663 if (!duration)
2664 duration = 10;
2665
2666 ret = drv_remain_on_channel(local, sdata, channel, duration, type); 2666 ret = drv_remain_on_channel(local, sdata, channel, duration, type);
2667 if (ret) { 2667 if (ret) {
2668 kfree(roc); 2668 kfree(roc);