提交 2fae062e 编写于 作者: I Ilan Peer 提交者: Johannes Berg

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: NIlan Peer <ilan.peer@intel.com>
Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
上级 1693d344
...@@ -2628,6 +2628,18 @@ static int ieee80211_start_roc_work(struct ieee80211_local *local, ...@@ -2628,6 +2628,18 @@ static int ieee80211_start_roc_work(struct ieee80211_local *local,
if (!roc) if (!roc)
return -ENOMEM; return -ENOMEM;
/*
* If the duration is zero, then the driver
* wouldn't actually do anything. Set it to
* 10 for now.
*
* TODO: cancel the off-channel operation
* when we get the SKB's TX status and
* the wait time was zero before.
*/
if (!duration)
duration = 10;
roc->chan = channel; roc->chan = channel;
roc->duration = duration; roc->duration = duration;
roc->req_duration = duration; roc->req_duration = duration;
...@@ -2651,18 +2663,6 @@ static int ieee80211_start_roc_work(struct ieee80211_local *local, ...@@ -2651,18 +2663,6 @@ static int ieee80211_start_roc_work(struct ieee80211_local *local,
/* otherwise actually kick it off here (for error handling) */ /* otherwise actually kick it off here (for error handling) */
/*
* If the duration is zero, then the driver
* wouldn't actually do anything. Set it to
* 10 for now.
*
* TODO: cancel the off-channel operation
* when we get the SKB's TX status and
* the wait time was zero before.
*/
if (!duration)
duration = 10;
ret = drv_remain_on_channel(local, sdata, channel, duration, type); ret = drv_remain_on_channel(local, sdata, channel, duration, type);
if (ret) { if (ret) {
kfree(roc); kfree(roc);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册