Linux-Wireless Archive mirror
 help / color / mirror / Atom feed
* [PATCH] mac80211: handle HW ROC expired properly
@ 2015-12-07 10:06 Johannes Berg
  0 siblings, 0 replies; only message in thread
From: Johannes Berg @ 2015-12-07 10:06 UTC (permalink / raw
  To: linux-wireless; +Cc: Ilan Peer

From: Ilan Peer <ilan.peer@intel.com>

In case of HW ROC, when the driver reports that the ROC expired,
it is not sufficient to purge the ROCs based on the remaining
time, as it possible that the device finished the ROC session
before the actual requested duration.

To handle such cases, in case of ROC expired notification from
the driver, complete all the ROCs which are marked with hw_begun,
regardless of the remaining duration.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
 net/mac80211/offchannel.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/net/mac80211/offchannel.c b/net/mac80211/offchannel.c
index 6719b27aad66..8b2f4eaac2ba 100644
--- a/net/mac80211/offchannel.c
+++ b/net/mac80211/offchannel.c
@@ -224,7 +224,11 @@ static unsigned long ieee80211_end_finished_rocs(struct ieee80211_local *local,
 			    msecs_to_jiffies(roc->duration) -
 			    now;
 
-		if (roc->abort || remaining <= 0)
+		/* In case of HW ROC, it is possible that the HW finished the
+		 * ROC session before the actual requested time. In such a case
+		 * end the ROC session (disregarding the remaining time).
+		 */
+		if (roc->abort || roc->hw_begun || remaining <= 0)
 			ieee80211_roc_notify_destroy(roc);
 		else
 			remaining_dur_min = min(remaining_dur_min, remaining);
-- 
2.6.2


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2015-12-07 10:06 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-12-07 10:06 [PATCH] mac80211: handle HW ROC expired properly Johannes Berg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).