linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Can't scan on ETSI domains when operating ch is DFS
@ 2019-09-11  7:58 Aaron Komisar
  2019-09-11 16:28 ` Peter Oh
  0 siblings, 1 reply; 2+ messages in thread
From: Aaron Komisar @ 2019-09-11  7:58 UTC (permalink / raw)
  To: linux-wireless; +Cc: Aaron Komisar

In non-ETSI reg domains scan is blocked when operating channel is a DFS ch.
For ETSI domains, however, once DFS channel is marked as available afer
the CAC, this channel will remain available even after leaving this channel.
Therefore a new CAC will not be required when scan is done.

In cfg80211 scan is not blocked for ETSI reg domains.
This patch enables scan in mac80211 as well when operating channel is a radar
channel for ETSI reg domains.

Signed-off-by: Aaron Komisar <aaron.komisar@tandemg.com>
---
 include/net/cfg80211.h | 8 ++++++++
 net/mac80211/scan.c    | 6 ++++--
 net/wireless/reg.c     | 1 +
 net/wireless/reg.h     | 8 --------
 4 files changed, 13 insertions(+), 10 deletions(-)

diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index 5253e7f667bd..5349898ed3e6 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -5546,6 +5546,14 @@ const struct ieee80211_reg_rule *freq_reg_info(struct wiphy *wiphy,
 const char *reg_initiator_name(enum nl80211_reg_initiator initiator);
 
 /**
+ * regulatory_pre_cac_allowed - if pre-CAC allowed in the current dfs domain
+ * @wiphy: wiphy for which pre-CAC capability is checked.
+
+ * Pre-CAC is allowed only in ETSI domain.
+ */
+bool regulatory_pre_cac_allowed(struct wiphy *wiphy);
+
+/**
  * DOC: Internal regulatory db functions
  *
  */
diff --git a/net/mac80211/scan.c b/net/mac80211/scan.c
index adf94ba1ed77..812ff820844b 100644
--- a/net/mac80211/scan.c
+++ b/net/mac80211/scan.c
@@ -523,7 +523,8 @@ static int ieee80211_start_sw_scan(struct ieee80211_local *local,
 static bool ieee80211_can_scan(struct ieee80211_local *local,
 			       struct ieee80211_sub_if_data *sdata)
 {
-	if (ieee80211_is_radar_required(local))
+	if (ieee80211_is_radar_required(local) &&
+	    !regulatory_pre_cac_allowed(local->hw.wiphy))
 		return false;
 
 	if (!list_empty(&local->roc_list))
@@ -630,7 +631,8 @@ static int __ieee80211_start_scan(struct ieee80211_sub_if_data *sdata,
 
 	lockdep_assert_held(&local->mtx);
 
-	if (local->scan_req || ieee80211_is_radar_required(local))
+	if (local->scan_req || (ieee80211_is_radar_required(local) &&
+	    !regulatory_pre_cac_allowed(local->hw.wiphy)))
 		return -EBUSY;
 
 	if (!ieee80211_can_scan(local, sdata)) {
diff --git a/net/wireless/reg.c b/net/wireless/reg.c
index 5311d0ae2454..50d3242c4985 100644
--- a/net/wireless/reg.c
+++ b/net/wireless/reg.c
@@ -3883,6 +3883,7 @@ bool regulatory_pre_cac_allowed(struct wiphy *wiphy)
 
 	return pre_cac_allowed;
 }
+EXPORT_SYMBOL(regulatory_pre_cac_allowed);
 
 void regulatory_propagate_dfs_state(struct wiphy *wiphy,
 				    struct cfg80211_chan_def *chandef,
diff --git a/net/wireless/reg.h b/net/wireless/reg.h
index 504133d76de4..dc8f689bd469 100644
--- a/net/wireless/reg.h
+++ b/net/wireless/reg.h
@@ -156,14 +156,6 @@ bool regulatory_indoor_allowed(void);
 #define REG_PRE_CAC_EXPIRY_GRACE_MS 2000
 
 /**
- * regulatory_pre_cac_allowed - if pre-CAC allowed in the current dfs domain
- * @wiphy: wiphy for which pre-CAC capability is checked.
-
- * Pre-CAC is allowed only in ETSI domain.
- */
-bool regulatory_pre_cac_allowed(struct wiphy *wiphy);
-
-/**
  * regulatory_propagate_dfs_state - Propagate DFS channel state to other wiphys
  * @wiphy - wiphy on which radar is detected and the event will be propagated
  *	to other available wiphys having the same DFS domain
-- 
2.11.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] Can't scan on ETSI domains when operating ch is DFS
  2019-09-11  7:58 [PATCH] Can't scan on ETSI domains when operating ch is DFS Aaron Komisar
@ 2019-09-11 16:28 ` Peter Oh
  0 siblings, 0 replies; 2+ messages in thread
From: Peter Oh @ 2019-09-11 16:28 UTC (permalink / raw)
  To: Aaron Komisar; +Cc: linux-wireless

On Wed, Sep 11, 2019 at 12:59 AM Aaron Komisar
<aaron.komisar@tandemg.com> wrote:
>
> In non-ETSI reg domains scan is blocked when operating channel is a DFS ch.
> For ETSI domains, however, once DFS channel is marked as available afer
> the CAC, this channel will remain available even after leaving this channel.
> Therefore a new CAC will not be required when scan is done.
>
> In cfg80211 scan is not blocked for ETSI reg domains.
> This patch enables scan in mac80211 as well when operating channel is a radar
> channel for ETSI reg domains.
>
> Signed-off-by: Aaron Komisar <aaron.komisar@tandemg.com>
> ---
>  include/net/cfg80211.h | 8 ++++++++
>  net/mac80211/scan.c    | 6 ++++--
>  net/wireless/reg.c     | 1 +
>  net/wireless/reg.h     | 8 --------
>  4 files changed, 13 insertions(+), 10 deletions(-)
>
> diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
> index 5253e7f667bd..5349898ed3e6 100644
> --- a/include/net/cfg80211.h
> +++ b/include/net/cfg80211.h
> @@ -5546,6 +5546,14 @@ const struct ieee80211_reg_rule *freq_reg_info(struct wiphy *wiphy,
>  const char *reg_initiator_name(enum nl80211_reg_initiator initiator);
>
>  /**
> + * regulatory_pre_cac_allowed - if pre-CAC allowed in the current dfs domain
> + * @wiphy: wiphy for which pre-CAC capability is checked.
> +
> + * Pre-CAC is allowed only in ETSI domain.
> + */
> +bool regulatory_pre_cac_allowed(struct wiphy *wiphy);
> +
> +/**
>   * DOC: Internal regulatory db functions
>   *
>   */
> diff --git a/net/mac80211/scan.c b/net/mac80211/scan.c
> index adf94ba1ed77..812ff820844b 100644
> --- a/net/mac80211/scan.c
> +++ b/net/mac80211/scan.c
> @@ -523,7 +523,8 @@ static int ieee80211_start_sw_scan(struct ieee80211_local *local,
>  static bool ieee80211_can_scan(struct ieee80211_local *local,
>                                struct ieee80211_sub_if_data *sdata)
>  {
> -       if (ieee80211_is_radar_required(local))
> +       if (ieee80211_is_radar_required(local) &&
> +           !regulatory_pre_cac_allowed(local->hw.wiphy))
"pre-CAC allowed" doesn't mean that you can use the channel without CAC is done.
>                 return false;
>
>         if (!list_empty(&local->roc_list))
> @@ -630,7 +631,8 @@ static int __ieee80211_start_scan(struct ieee80211_sub_if_data *sdata,
>
>         lockdep_assert_held(&local->mtx);
>
> -       if (local->scan_req || ieee80211_is_radar_required(local))
> +       if (local->scan_req || (ieee80211_is_radar_required(local) &&
> +           !regulatory_pre_cac_allowed(local->hw.wiphy)))
>                 return -EBUSY;
>
>         if (!ieee80211_can_scan(local, sdata)) {
> diff --git a/net/wireless/reg.c b/net/wireless/reg.c
> index 5311d0ae2454..50d3242c4985 100644
> --- a/net/wireless/reg.c
> +++ b/net/wireless/reg.c
> @@ -3883,6 +3883,7 @@ bool regulatory_pre_cac_allowed(struct wiphy *wiphy)
>
>         return pre_cac_allowed;
>  }
> +EXPORT_SYMBOL(regulatory_pre_cac_allowed);
>
>  void regulatory_propagate_dfs_state(struct wiphy *wiphy,
>                                     struct cfg80211_chan_def *chandef,
> diff --git a/net/wireless/reg.h b/net/wireless/reg.h
> index 504133d76de4..dc8f689bd469 100644
> --- a/net/wireless/reg.h
> +++ b/net/wireless/reg.h
> @@ -156,14 +156,6 @@ bool regulatory_indoor_allowed(void);
>  #define REG_PRE_CAC_EXPIRY_GRACE_MS 2000
>
>  /**
> - * regulatory_pre_cac_allowed - if pre-CAC allowed in the current dfs domain
> - * @wiphy: wiphy for which pre-CAC capability is checked.
> -
> - * Pre-CAC is allowed only in ETSI domain.
> - */
> -bool regulatory_pre_cac_allowed(struct wiphy *wiphy);
> -
> -/**
>   * regulatory_propagate_dfs_state - Propagate DFS channel state to other wiphys
>   * @wiphy - wiphy on which radar is detected and the event will be propagated
>   *     to other available wiphys having the same DFS domain
> --
> 2.11.0
>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-09-11 16:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-11  7:58 [PATCH] Can't scan on ETSI domains when operating ch is DFS Aaron Komisar
2019-09-11 16:28 ` Peter Oh

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 NNTP newsgroup(s).