diff mbox series

[v2,1/7] wifi: mac80211: rework on 6 GHz power type definition

Message ID 20230302080534.22821-2-quic_adisi@quicinc.com
State Superseded
Headers show
Series wifi: cfg80211/mac80211: extend 6 GHz support for all power modes | expand

Commit Message

Aditya Kumar Singh March 2, 2023, 8:05 a.m. UTC
6 GHz regulatory domain introduces different modes for 6 GHz AP
operation - Low Power Indoor(LPI), Standard Power(SP) and Very Low
Power(VLP). 6 GHz non-AP 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.
Also due to IEEE80211_REG_UNSET_*, it is difficult to use
_MAX to size arrays.

Move IEEE80211_REG_UNSET_* to last after *_MAX for both AP and
client power mode enums.

Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
---
 include/linux/ieee80211.h | 33 ++++++++++++++++++++-------------
 1 file changed, 20 insertions(+), 13 deletions(-)
diff mbox series

Patch

diff --git a/include/linux/ieee80211.h b/include/linux/ieee80211.h
index 2463bdd2a382..24d4b5ef3de2 100644
--- a/include/linux/ieee80211.h
+++ b/include/linux/ieee80211.h
@@ -2173,41 +2173,48 @@  int ieee80211_get_vht_max_nss(struct ieee80211_vht_cap *cap,
 			      unsigned int max_vht_nss);
 
 /**
- * enum ieee80211_ap_reg_power - regulatory power for a Access Point
+ * enum ieee80211_ap_reg_power - regulatory power for an 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_SP: Standard Power Access Point
+ * @IEEE80211_REG_VLP: Very Low Power Access Point
+ * @__IEEE80211_REG_AP_POWER_AFTER_LAST: internal use
  * @IEEE80211_REG_AP_POWER_MAX: maximum value
+ * @IEEE80211_REG_UNSET_AP: Access Point has no regulatory power
+ *	mode.
  */
 enum ieee80211_ap_reg_power {
-	IEEE80211_REG_UNSET_AP,
 	IEEE80211_REG_LPI_AP,
 	IEEE80211_REG_SP_AP,
 	IEEE80211_REG_VLP_AP,
-	IEEE80211_REG_AP_POWER_AFTER_LAST,
+
+	/* keep last */
+	__IEEE80211_REG_AP_POWER_AFTER_LAST,
 	IEEE80211_REG_AP_POWER_MAX =
-		IEEE80211_REG_AP_POWER_AFTER_LAST - 1,
+		__IEEE80211_REG_AP_POWER_AFTER_LAST - 1,
+	/* always last in order to use _MAX to size arrays */
+	IEEE80211_REG_UNSET_AP = 0xFF,
 };
 
 /**
  * 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
+ * @IEEE80211_REG_UNSET_CLIENT: Client has no regulatory power mode
  */
 enum ieee80211_client_reg_power {
-	IEEE80211_REG_UNSET_CLIENT,
 	IEEE80211_REG_DEFAULT_CLIENT,
 	IEEE80211_REG_SUBORDINATE_CLIENT,
-	IEEE80211_REG_CLIENT_POWER_AFTER_LAST,
+
+	/* keep last */
+	__IEEE80211_REG_CLIENT_POWER_AFTER_LAST,
 	IEEE80211_REG_CLIENT_POWER_MAX =
-		IEEE80211_REG_CLIENT_POWER_AFTER_LAST - 1,
+		__IEEE80211_REG_CLIENT_POWER_AFTER_LAST - 1,
+	/* always last in order to use _MAX to size arrays */
+	IEEE80211_REG_UNSET_CLIENT = 0XFF,
 };
 
 /* 802.11ax HE MAC capabilities */