diff mbox

[v3,2/2] cfg80211/nl80211: add CAC_STARTED event

Message ID 20180301093916.14096-3-sergey.matyukevich.os@quantenna.com (mailing list archive)
State Accepted
Delegated to: Johannes Berg
Headers show

Commit Message

Sergey Matyukevich March 1, 2018, 9:39 a.m. UTC
From: Dmitry Lebed <dlebed@quantenna.com>

CAC_STARTED event is needed for DFS offload feature and
should be generated by driver/HW if DFS_OFFLOAD is enabled.

Signed-off-by: Dmitry Lebed <dlebed@quantenna.com>
---
 include/uapi/linux/nl80211.h | 3 +++
 net/wireless/mlme.c          | 7 +++++--
 2 files changed, 8 insertions(+), 2 deletions(-)
diff mbox

Patch

diff --git a/include/uapi/linux/nl80211.h b/include/uapi/linux/nl80211.h
index 811928ce4e1c..1633c8b8494a 100644
--- a/include/uapi/linux/nl80211.h
+++ b/include/uapi/linux/nl80211.h
@@ -5137,6 +5137,8 @@  enum nl80211_smps_mode {
  *	non-operating channel is expired and no longer valid. New CAC must
  *	be done on this channel before starting the operation. This is not
  *	applicable for ETSI dfs domain where pre-CAC is valid for ever.
+ * @NL80211_RADAR_CAC_STARTED: Channel Availability Check has been started,
+ *	should be generated by HW if NL80211_EXT_FEATURE_DFS_OFFLOAD is enabled.
  */
 enum nl80211_radar_event {
 	NL80211_RADAR_DETECTED,
@@ -5144,6 +5146,7 @@  enum nl80211_radar_event {
 	NL80211_RADAR_CAC_ABORTED,
 	NL80211_RADAR_NOP_FINISHED,
 	NL80211_RADAR_PRE_CAC_EXPIRED,
+	NL80211_RADAR_CAC_STARTED,
 };
 
 /**
diff --git a/net/wireless/mlme.c b/net/wireless/mlme.c
index a877b4d3e5d2..ce5bb624bf01 100644
--- a/net/wireless/mlme.c
+++ b/net/wireless/mlme.c
@@ -914,14 +914,17 @@  void cfg80211_cac_event(struct net_device *netdev,
 		       sizeof(struct cfg80211_chan_def));
 		queue_work(cfg80211_wq, &rdev->propagate_cac_done_wk);
 		cfg80211_sched_dfs_chan_update(rdev);
-		break;
+		/* fall through */
 	case NL80211_RADAR_CAC_ABORTED:
+		wdev->cac_started = false;
+		break;
+	case NL80211_RADAR_CAC_STARTED:
+		wdev->cac_started = true;
 		break;
 	default:
 		WARN_ON(1);
 		return;
 	}
-	wdev->cac_started = false;
 
 	nl80211_radar_notify(rdev, chandef, event, netdev, gfp);
 }