* [PATCH] staging: rtl8723bs: Rename CamelCase NDIS encryption state enums
@ 2026-10-01 19:47 Marinela Tatiana Selseth
2026-10-02 6:07 ` Greg Kroah-Hartman
0 siblings, 1 reply; 3+ messages in thread
From: Marinela Tatiana Selseth @ 2026-10-01 19:47 UTC (permalink / raw)
To: Greg Kroah-Hartman; +Cc: linux-staging, linux-kernel, Marinela Tatiana Selseth
The identifiers Ndis802_11WEPDisabled and Ndis802_11EncryptionDisabled
violate the Linux kernel coding style guideline regarding naming
conventions. Uppercase snake_case is preferred for enum constants.
Rename both constants to NDIS_802_11_WEP_DISABLED and
NDIS_802_11_ENCRYPTION_DISABLED across the driver framework to conform
to standard kernel conventions.
Signed-off-by: Marinela Tatiana Selseth <marinela.selseth@firmwaredesign.org>
---
drivers/staging/rtl8723bs/core/rtw_ap.c | 2 +-
drivers/staging/rtl8723bs/core/rtw_mlme.c | 8 ++++----
drivers/staging/rtl8723bs/include/wlan_bssdef.h | 4 ++--
drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c | 12 ++++++------
drivers/staging/rtl8723bs/os_dep/os_intfs.c | 2 +-
5 files changed, 14 insertions(+), 14 deletions(-)
diff --git a/drivers/staging/rtl8723bs/core/rtw_ap.c b/drivers/staging/rtl8723bs/core/rtw_ap.c
index 4728f62a1557..0fdf06cc7226 100644
--- a/drivers/staging/rtl8723bs/core/rtw_ap.c
+++ b/drivers/staging/rtl8723bs/core/rtw_ap.c
@@ -1909,7 +1909,7 @@ void stop_ap_mode(struct adapter *padapter)
0,
sizeof(struct security_priv));
padapter->securitypriv.ndisauthtype = Ndis802_11AuthModeOpen;
- padapter->securitypriv.ndisencryptstatus = Ndis802_11WEPDisabled;
+ padapter->securitypriv.ndisencryptstatus = NDIS_802_11_WEP_DISABLED;
/* for ACL */
spin_lock_bh(&pacl_node_q->lock);
diff --git a/drivers/staging/rtl8723bs/core/rtw_mlme.c b/drivers/staging/rtl8723bs/core/rtw_mlme.c
index d18768a51b19..0860d42b8487 100644
--- a/drivers/staging/rtl8723bs/core/rtw_mlme.c
+++ b/drivers/staging/rtl8723bs/core/rtw_mlme.c
@@ -605,7 +605,7 @@ static bool rtw_is_desired_network(struct adapter *adapter, struct wlan_network
u8 *p = NULL;
uint ie_len = 0;
- if ((desired_encmode == Ndis802_11EncryptionDisabled) && (privacy != 0))
+ if ((desired_encmode == NDIS_802_11_ENCRYPTION_DISABLED) && (privacy != 0))
bselected = false;
if (psecuritypriv->ndisauthtype == Ndis802_11AuthModeWPA2PSK) {
@@ -621,7 +621,7 @@ static bool rtw_is_desired_network(struct adapter *adapter, struct wlan_network
}
}
- if ((desired_encmode != Ndis802_11EncryptionDisabled) && (privacy == 0))
+ if ((desired_encmode != NDIS_802_11_ENCRYPTION_DISABLED) && (privacy == 0))
bselected = false;
if (check_fwstate(pmlmepriv, WIFI_ADHOC_STATE)) {
@@ -1114,7 +1114,7 @@ void rtw_reset_securitypriv(struct adapter *adapter)
adapter->securitypriv.btkip_countermeasure_time = backupTKIPcountermeasure_time;
adapter->securitypriv.ndisauthtype = Ndis802_11AuthModeOpen;
- adapter->securitypriv.ndisencryptstatus = Ndis802_11WEPDisabled;
+ adapter->securitypriv.ndisencryptstatus = NDIS_802_11_WEP_DISABLED;
} else {
/* reset values in securitypriv */
@@ -1130,7 +1130,7 @@ void rtw_reset_securitypriv(struct adapter *adapter)
psec_priv->dot118021XGrpKeyid = 1;
psec_priv->ndisauthtype = Ndis802_11AuthModeOpen;
- psec_priv->ndisencryptstatus = Ndis802_11WEPDisabled;
+ psec_priv->ndisencryptstatus = NDIS_802_11_WEP_DISABLED;
/* */
}
spin_unlock_bh(&adapter->security_key_mutex);
diff --git a/drivers/staging/rtl8723bs/include/wlan_bssdef.h b/drivers/staging/rtl8723bs/include/wlan_bssdef.h
index f4c1456f1476..86e4bf92f14b 100644
--- a/drivers/staging/rtl8723bs/include/wlan_bssdef.h
+++ b/drivers/staging/rtl8723bs/include/wlan_bssdef.h
@@ -69,8 +69,8 @@ enum ndis_802_11_authentication_mode {
enum {
Ndis802_11WEPEnabled,
Ndis802_11Encryption1Enabled = Ndis802_11WEPEnabled,
- Ndis802_11WEPDisabled,
- Ndis802_11EncryptionDisabled = Ndis802_11WEPDisabled,
+ NDIS_802_11_WEP_DISABLED,
+ NDIS_802_11_ENCRYPTION_DISABLED = NDIS_802_11_WEP_DISABLED,
Ndis802_11WEPKeyAbsent,
Ndis802_11Encryption1KeyAbsent = Ndis802_11WEPKeyAbsent,
Ndis802_11WEPNotSupported,
diff --git a/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c b/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c
index 3468d4114f60..90c822a8ee26 100644
--- a/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c
+++ b/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c
@@ -1338,7 +1338,7 @@ static int rtw_cfg80211_set_auth_type(struct security_priv *psecuritypriv,
static int rtw_cfg80211_set_cipher(struct security_priv *psecuritypriv, u32 cipher, bool ucast)
{
- u32 ndisencryptstatus = Ndis802_11EncryptionDisabled;
+ u32 ndisencryptstatus = NDIS_802_11_ENCRYPTION_DISABLED;
u32 *profile_cipher = ucast ? &psecuritypriv->dot11_privacy_algrthm :
&psecuritypriv->dot118021XGrpPrivacy;
@@ -1352,7 +1352,7 @@ static int rtw_cfg80211_set_cipher(struct security_priv *psecuritypriv, u32 ciph
switch (cipher) {
case IW_AUTH_CIPHER_NONE:
*profile_cipher = _NO_PRIVACY_;
- ndisencryptstatus = Ndis802_11EncryptionDisabled;
+ ndisencryptstatus = NDIS_802_11_ENCRYPTION_DISABLED;
break;
case WLAN_CIPHER_SUITE_WEP40:
*profile_cipher = _WEP40_;
@@ -1463,7 +1463,7 @@ static int rtw_cfg80211_set_wpa_ie(struct adapter *padapter, u8 *pie, size_t iel
switch (group_cipher) {
case WPA_CIPHER_NONE:
padapter->securitypriv.dot118021XGrpPrivacy = _NO_PRIVACY_;
- padapter->securitypriv.ndisencryptstatus = Ndis802_11EncryptionDisabled;
+ padapter->securitypriv.ndisencryptstatus = NDIS_802_11_ENCRYPTION_DISABLED;
break;
case WPA_CIPHER_WEP40:
padapter->securitypriv.dot118021XGrpPrivacy = _WEP40_;
@@ -1486,7 +1486,7 @@ static int rtw_cfg80211_set_wpa_ie(struct adapter *padapter, u8 *pie, size_t iel
switch (pairwise_cipher) {
case WPA_CIPHER_NONE:
padapter->securitypriv.dot11_privacy_algrthm = _NO_PRIVACY_;
- padapter->securitypriv.ndisencryptstatus = Ndis802_11EncryptionDisabled;
+ padapter->securitypriv.ndisencryptstatus = NDIS_802_11_ENCRYPTION_DISABLED;
break;
case WPA_CIPHER_WEP40:
padapter->securitypriv.dot11_privacy_algrthm = _WEP40_;
@@ -1568,7 +1568,7 @@ static int cfg80211_rtw_join_ibss(struct wiphy *wiphy, struct net_device *ndev,
ndis_ssid.ssid_length = params->ssid_len;
memcpy(ndis_ssid.ssid, (u8 *)params->ssid, params->ssid_len);
- psecuritypriv->ndisencryptstatus = Ndis802_11EncryptionDisabled;
+ psecuritypriv->ndisencryptstatus = NDIS_802_11_ENCRYPTION_DISABLED;
psecuritypriv->dot11_privacy_algrthm = _NO_PRIVACY_;
psecuritypriv->dot118021XGrpPrivacy = _NO_PRIVACY_;
psecuritypriv->dot11_auth_algrthm = dot11_auth_algrthm_open; /* open system */
@@ -1664,7 +1664,7 @@ static int cfg80211_rtw_connect(struct wiphy *wiphy, struct net_device *ndev,
if (check_fwstate(pmlmepriv, _FW_UNDER_SURVEY))
rtw_scan_abort(padapter);
- psecuritypriv->ndisencryptstatus = Ndis802_11EncryptionDisabled;
+ psecuritypriv->ndisencryptstatus = NDIS_802_11_ENCRYPTION_DISABLED;
psecuritypriv->dot11_privacy_algrthm = _NO_PRIVACY_;
psecuritypriv->dot118021XGrpPrivacy = _NO_PRIVACY_;
psecuritypriv->dot11_auth_algrthm = dot11_auth_algrthm_open; /* open system */
diff --git a/drivers/staging/rtl8723bs/os_dep/os_intfs.c b/drivers/staging/rtl8723bs/os_dep/os_intfs.c
index c15056ee207c..e0d043172819 100644
--- a/drivers/staging/rtl8723bs/os_dep/os_intfs.c
+++ b/drivers/staging/rtl8723bs/os_dep/os_intfs.c
@@ -540,7 +540,7 @@ static void rtw_init_default_value(struct adapter *padapter)
psecuritypriv->dot118021XGrpKeyid = 1;
psecuritypriv->ndisauthtype = Ndis802_11AuthModeOpen;
- psecuritypriv->ndisencryptstatus = Ndis802_11WEPDisabled;
+ psecuritypriv->ndisencryptstatus = NDIS_802_11_WEP_DISABLED;
/* registry_priv */
rtw_init_registrypriv_dev_network(padapter);
--
2.43.0
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] staging: rtl8723bs: Rename CamelCase NDIS encryption state enums
2026-10-01 19:47 [PATCH] staging: rtl8723bs: Rename CamelCase NDIS encryption state enums Marinela Tatiana Selseth
@ 2026-10-02 6:07 ` Greg Kroah-Hartman
2026-10-03 3:16 ` Marinela Tatiana Selseth
0 siblings, 1 reply; 3+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-02 6:07 UTC (permalink / raw)
To: Marinela Tatiana Selseth; +Cc: linux-staging, linux-kernel
On Thu, Oct 01, 2026 at 02:47:10PM -0500, Marinela Tatiana Selseth wrote:
> The identifiers Ndis802_11WEPDisabled and Ndis802_11EncryptionDisabled
> violate the Linux kernel coding style guideline regarding naming
> conventions. Uppercase snake_case is preferred for enum constants.
>
> Rename both constants to NDIS_802_11_WEP_DISABLED and
> NDIS_802_11_ENCRYPTION_DISABLED across the driver framework to conform
> to standard kernel conventions.
Why just these 2?
And shouldn't these be using the in-kernel NDIS values instead of
redefining them? They seem to be just using random numbers, as the enum
isn't specified. Or is this just a state value and doesn't reflect
anything actually sent to the device or network stack?
thanks,
greg k-h
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] staging: rtl8723bs: Rename CamelCase NDIS encryption state enums
2026-10-02 6:07 ` Greg Kroah-Hartman
@ 2026-10-03 3:16 ` Marinela Tatiana Selseth
0 siblings, 0 replies; 3+ messages in thread
From: Marinela Tatiana Selseth @ 2026-10-03 3:16 UTC (permalink / raw)
To: gregkh; +Cc: linux-kernel, linux-staging, marinela.selseth
Hi Greg,
Thank you for the review and the excellent questions.
You are entirely right. These constants are strictly internal software
state values tracked inside 'struct security_priv'. They are used
internally by the driver's connection management loops and are never
compiled into raw packet payloads sent over the air or passed down
directly to the core network stack.
The driver replicates this NDIS layout internally because it was
originally ported from a legacy unified vendor baseline, and the
mainline kernel does not export a generic NDIS encryption status enum
stack for staging items.
Your point is completely taken, the rest of the anonymous enum block
contains similar CamelCase leftovers (e.g., Ndis802_11WEPEnabled,
Ndis802_11WEPKeyAbsent).
While here, can condense the duplicate defines in one, like
NDIS_802_11_ENCRYPTION_DISABLED, and NDIS_802_11_WEP_DISABLED.
Will scale up this work and submit a v2 patch series that converts the
entire enum infrastructure cleanly over to standard uppercase NDIS
snake_case conventions.
Best regards,
Marinela
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-10-03 3:17 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-01 19:47 [PATCH] staging: rtl8723bs: Rename CamelCase NDIS encryption state enums Marinela Tatiana Selseth
2026-10-02 6:07 ` Greg Kroah-Hartman
2026-10-03 3:16 ` Marinela Tatiana Selseth
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®