diff mbox series

[2/7] mac80211: rework on 6 GHz power type definition

Message ID 20220704102341.5692-3-quic_adisi@quicinc.com (mailing list archive)
State Changes Requested
Delegated to: Johannes Berg
Headers show
Series cfg80211/mac80211: extend 6 GHz support for all power modes | expand

Commit Message

Aditya Kumar Singh July 4, 2022, 10:23 a.m. UTC
6 GHz regulatory domains introduces different modes for 6 GHz AP
operation - Low Power Indoor(LPI), Standard Power(SP) and Very Low
Power(VLP). 6 GHz STAs could be operated as either Regular or
Subordinate clients. We have separate definitions of AP and client.

However, IEEE80211_REG_UNSET_* is not a defined power type. Hence,
remove IEEE80211_REG_UNSET_* from both AP and client power mode
enums.

To demonstrate unset or invalid type, (IEEE80211_REG_*_POWER_MAX + 1)
value can be used instead.

Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
---
 include/linux/ieee80211.h | 10 ++++------
 net/mac80211/util.c       |  2 +-
 2 files changed, 5 insertions(+), 7 deletions(-)

Comments

Johannes Berg Sept. 6, 2022, 10:59 a.m. UTC | #1
On Mon, 2022-07-04 at 15:53 +0530, Aditya Kumar Singh wrote:
> 
> +++ b/include/linux/ieee80211.h
> @@ -2132,18 +2132,17 @@ int ieee80211_get_vht_max_nss(struct ieee80211_vht_cap *cap,
>  /**
>   * enum ieee80211_ap_reg_power - regulatory power for a Access Point
>   *
> - * @IEEE80211_REG_UNSET_AP: Access Point has no regulatory power mode
>   * @IEEE80211_REG_LPI: Indoor Access Point
>   * @IEEE80211_REG_SP: Standard power Access Point
>   * @IEEE80211_REG_VLP: Very low power Access Point
> 

So these other values *do* come from the spec? Otherwise I think we
should move them somewhere else (e.g. cfg80211.h)

johannes
Aditya Kumar Singh Nov. 3, 2022, 6 a.m. UTC | #2
On 9/6/2022 16:29, Johannes Berg wrote:
> On Mon, 2022-07-04 at 15:53 +0530, Aditya Kumar Singh wrote:
>>
>> +++ b/include/linux/ieee80211.h
>> @@ -2132,18 +2132,17 @@ int ieee80211_get_vht_max_nss(struct ieee80211_vht_cap *cap,
>>   /**
>>    * enum ieee80211_ap_reg_power - regulatory power for a Access Point
>>    *
>> - * @IEEE80211_REG_UNSET_AP: Access Point has no regulatory power mode
>>    * @IEEE80211_REG_LPI: Indoor Access Point
>>    * @IEEE80211_REG_SP: Standard power Access Point
>>    * @IEEE80211_REG_VLP: Very low power Access Point
>>
> 
> So these other values *do* come from the spec? Otherwise I think we
> should move them somewhere else (e.g. cfg80211.h)
Yes, other values do come from spec.

> johannes
diff mbox series

Patch

diff --git a/include/linux/ieee80211.h b/include/linux/ieee80211.h
index f386f9ed41f3..606b5ba8b161 100644
--- a/include/linux/ieee80211.h
+++ b/include/linux/ieee80211.h
@@ -2132,18 +2132,17 @@  int ieee80211_get_vht_max_nss(struct ieee80211_vht_cap *cap,
 /**
  * enum ieee80211_ap_reg_power - regulatory power for a Access Point
  *
- * @IEEE80211_REG_UNSET_AP: Access Point has no regulatory power mode
  * @IEEE80211_REG_LPI: Indoor Access Point
  * @IEEE80211_REG_SP: Standard power Access Point
  * @IEEE80211_REG_VLP: Very low power Access Point
- * @IEEE80211_REG_AP_POWER_AFTER_LAST: internal
+ * @IEEE80211_REG_AP_POWER_AFTER_LAST: internal use
  * @IEEE80211_REG_AP_POWER_MAX: maximum value
  */
 enum ieee80211_ap_reg_power {
-	IEEE80211_REG_UNSET_AP,
 	IEEE80211_REG_LPI_AP,
 	IEEE80211_REG_SP_AP,
 	IEEE80211_REG_VLP_AP,
+	/* keep last */
 	IEEE80211_REG_AP_POWER_AFTER_LAST,
 	IEEE80211_REG_AP_POWER_MAX =
 		IEEE80211_REG_AP_POWER_AFTER_LAST - 1,
@@ -2152,16 +2151,15 @@  enum ieee80211_ap_reg_power {
 /**
  * enum ieee80211_client_reg_power - regulatory power for a client
  *
- * @IEEE80211_REG_UNSET_CLIENT: Client has no regulatory power mode
  * @IEEE80211_REG_DEFAULT_CLIENT: Default Client
  * @IEEE80211_REG_SUBORDINATE_CLIENT: Subordinate Client
- * @IEEE80211_REG_CLIENT_POWER_AFTER_LAST: internal
+ * @IEEE80211_REG_CLIENT_POWER_AFTER_LAST: internal use
  * @IEEE80211_REG_CLIENT_POWER_MAX: maximum value
  */
 enum ieee80211_client_reg_power {
-	IEEE80211_REG_UNSET_CLIENT,
 	IEEE80211_REG_DEFAULT_CLIENT,
 	IEEE80211_REG_SUBORDINATE_CLIENT,
+	/* keep last */
 	IEEE80211_REG_CLIENT_POWER_AFTER_LAST,
 	IEEE80211_REG_CLIENT_POWER_MAX =
 		IEEE80211_REG_CLIENT_POWER_AFTER_LAST - 1,
diff --git a/net/mac80211/util.c b/net/mac80211/util.c
index bccc3a309ed0..efdea5c2f2db 100644
--- a/net/mac80211/util.c
+++ b/net/mac80211/util.c
@@ -3524,7 +3524,7 @@  bool ieee80211_chandef_he_6ghz_oper(struct ieee80211_sub_if_data *sdata,
 		bss_conf->power_type = IEEE80211_REG_SP_AP;
 		break;
 	default:
-		bss_conf->power_type = IEEE80211_REG_UNSET_AP;
+		bss_conf->power_type = IEEE80211_REG_AP_POWER_MAX + 1;
 		break;
 	}