From patchwork Thu Mar 2 08:05:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aditya Kumar Singh X-Patchwork-Id: 658765 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3D8C2C6FA8E for ; Thu, 2 Mar 2023 08:06:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229453AbjCBIGu (ORCPT ); Thu, 2 Mar 2023 03:06:50 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45622 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229695AbjCBIGp (ORCPT ); Thu, 2 Mar 2023 03:06:45 -0500 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 33CBD34F5E for ; Thu, 2 Mar 2023 00:06:44 -0800 (PST) Received: from pps.filterd (m0279862.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 3225pLLd007485; Thu, 2 Mar 2023 08:05:55 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=qcppdkim1; bh=IuS8CiINANoWXW3ZqLYC9o9ewOdKaPcsvL9bh4EgnHg=; b=H1p4gEWnOjF6pe3+4kKTkGZtIacVgJkQD3zYx+eXebytndDWgrWi7xSlNSy32XZbkCoS LCfc9SAHKUJ6WYD49GbKxCUbnSBBQEOtnVEj2DDhzBNX7WGB2PVlE9RPTWv5zPHs4bNg QnVDj0QEDGWBSADJ6HGSSet11zC4s+eKINPXBdzYRicXyJ62IrOm6IQ+rvVj/Ga+hiPu pxUcLZQEZdU4lPB3PPb8iZpo3dm2l43xVFOud92qqDlicipOnHyOtDp1juK1scwHNrS6 Dr7SIkAZefwbSu4JaO/5rjm1yWHDwWmH5DK9PEk30Kp80C35MMhKe6cKfVyfrkUgW5Y0 8g== Received: from nalasppmta03.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3p2ar11w5r-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 02 Mar 2023 08:05:54 +0000 Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA03.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 32285sBC016096 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 2 Mar 2023 08:05:54 GMT Received: from adisi-linux.qualcomm.com (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.41; Thu, 2 Mar 2023 00:05:52 -0800 From: Aditya Kumar Singh To: CC: , Aditya Kumar Singh Subject: [PATCH v2 1/7] wifi: mac80211: rework on 6 GHz power type definition Date: Thu, 2 Mar 2023 13:35:28 +0530 Message-ID: <20230302080534.22821-2-quic_adisi@quicinc.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230302080534.22821-1-quic_adisi@quicinc.com> References: <20230302080534.22821-1-quic_adisi@quicinc.com> MIME-Version: 1.0 X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nalasex01a.na.qualcomm.com (10.47.209.196) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: aXoPVqItQJjdDhUjceq_yef2csjp_FMX X-Proofpoint-ORIG-GUID: aXoPVqItQJjdDhUjceq_yef2csjp_FMX X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-03-02_04,2023-03-02_01,2023-02-09_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 mlxscore=0 bulkscore=0 impostorscore=0 phishscore=0 lowpriorityscore=0 suspectscore=0 priorityscore=1501 spamscore=0 mlxlogscore=893 adultscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2303020069 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org 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 --- include/linux/ieee80211.h | 33 ++++++++++++++++++++------------- 1 file changed, 20 insertions(+), 13 deletions(-) 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 */