* [PATCH 0/7] staging: rtl8192e: Remove wireless modes A and N_5G
@ 2023-03-27 21:02 Philipp Hortmann
2023-03-27 21:02 ` [PATCH 1/7] staging: rtl8192e: Remove rtl92e_config_phy Philipp Hortmann
` (6 more replies)
0 siblings, 7 replies; 8+ messages in thread
From: Philipp Hortmann @ 2023-03-27 21:02 UTC (permalink / raw)
To: Greg Kroah-Hartman, linux-staging, linux-kernel
Remove WIRELESS_MODE_N_5G and WIRELESS_MODE_A which are not supported by
hardware to remove dead code and increase readability.
Tested with rtl8192e on wireless modes: B, G, N_24G
Transferred this patch over wlan connection of rtl8192e
Philipp Hortmann (7):
staging: rtl8192e: Remove rtl92e_config_phy
staging: rtl8192e: Remove _rtl92e_get_supported_wireless_mode
staging: rtl8192e: Remove 5G wireless_mode in rtl92e_set_wireless_mode
staging: rtl8192e: Remove unused if clauses in
rtl92e_set_wireless_mode
staging: rtl8192e: Remove wireless modes A, N_5G from _rtl92e_hwconfig
staging: rtl8192e: Remove wireless modes A, N_5G from
rtl92e_set_channel
staging: rtl8192e: Remove wireless mode WIRELESS_MODE_N_5G
.../staging/rtl8192e/rtl8192e/r8192E_dev.c | 19 +-------
.../staging/rtl8192e/rtl8192e/r8192E_phy.c | 18 --------
.../staging/rtl8192e/rtl8192e/r8192E_phy.h | 1 -
drivers/staging/rtl8192e/rtl8192e/rtl_core.c | 43 ++++---------------
drivers/staging/rtl8192e/rtl8192e/rtl_dm.c | 6 +--
5 files changed, 12 insertions(+), 75 deletions(-)
--
2.39.2
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH 1/7] staging: rtl8192e: Remove rtl92e_config_phy
2023-03-27 21:02 [PATCH 0/7] staging: rtl8192e: Remove wireless modes A and N_5G Philipp Hortmann
@ 2023-03-27 21:02 ` Philipp Hortmann
2023-03-27 21:02 ` [PATCH 2/7] staging: rtl8192e: Remove _rtl92e_get_supported_wireless_mode Philipp Hortmann
` (5 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: Philipp Hortmann @ 2023-03-27 21:02 UTC (permalink / raw)
To: Greg Kroah-Hartman, linux-staging, linux-kernel
Remove rtl92e_config_phy to improve readability.
Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
---
drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c | 2 +-
drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c | 9 ---------
drivers/staging/rtl8192e/rtl8192e/r8192E_phy.h | 1 -
3 files changed, 1 insertion(+), 11 deletions(-)
diff --git a/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c b/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c
index 1eb063fe660a..f4fdaeff2917 100644
--- a/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c
+++ b/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c
@@ -691,7 +691,7 @@ bool rtl92e_start_adapter(struct net_device *dev)
}
if (priv->rst_progress == RESET_TYPE_NORESET) {
- rtStatus = rtl92e_config_phy(dev);
+ rtStatus = rtl92e_config_rf(dev);
if (!rtStatus) {
netdev_info(dev, "RF Config failed\n");
return rtStatus;
diff --git a/drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c b/drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c
index bd302f5cb356..139d8268c8dc 100644
--- a/drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c
+++ b/drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c
@@ -468,15 +468,6 @@ void rtl92e_set_tx_power(struct net_device *dev, u8 channel)
rtl92e_set_ofdm_tx_power(dev, powerlevelOFDM24G);
}
-bool rtl92e_config_phy(struct net_device *dev)
-{
- bool rtStatus = true;
-
- rtStatus = rtl92e_config_rf(dev);
-
- return rtStatus;
-}
-
u8 rtl92e_config_rf_path(struct net_device *dev, enum rf90_radio_path eRFPath)
{
diff --git a/drivers/staging/rtl8192e/rtl8192e/r8192E_phy.h b/drivers/staging/rtl8192e/rtl8192e/r8192E_phy.h
index 498da6be3e4e..6c4c33ded6a9 100644
--- a/drivers/staging/rtl8192e/rtl8192e/r8192E_phy.h
+++ b/drivers/staging/rtl8192e/rtl8192e/r8192E_phy.h
@@ -39,7 +39,6 @@ bool rtl92e_check_bb_and_rf(struct net_device *dev,
bool rtl92e_config_bb(struct net_device *dev);
void rtl92e_get_tx_power(struct net_device *dev);
void rtl92e_set_tx_power(struct net_device *dev, u8 channel);
-bool rtl92e_config_phy(struct net_device *dev);
u8 rtl92e_config_rf_path(struct net_device *dev, enum rf90_radio_path eRFPath);
u8 rtl92e_set_channel(struct net_device *dev, u8 channel);
--
2.39.2
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH 2/7] staging: rtl8192e: Remove _rtl92e_get_supported_wireless_mode
2023-03-27 21:02 [PATCH 0/7] staging: rtl8192e: Remove wireless modes A and N_5G Philipp Hortmann
2023-03-27 21:02 ` [PATCH 1/7] staging: rtl8192e: Remove rtl92e_config_phy Philipp Hortmann
@ 2023-03-27 21:02 ` Philipp Hortmann
2023-03-27 21:02 ` [PATCH 3/7] staging: rtl8192e: Remove 5G wireless_mode in rtl92e_set_wireless_mode Philipp Hortmann
` (4 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: Philipp Hortmann @ 2023-03-27 21:02 UTC (permalink / raw)
To: Greg Kroah-Hartman, linux-staging, linux-kernel
Remove _rtl92e_get_supported_wireless_mode to improve readability.
Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
---
drivers/staging/rtl8192e/rtl8192e/rtl_core.c | 10 +---------
1 file changed, 1 insertion(+), 9 deletions(-)
diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
index ecc3f0c6c267..12e5132fa788 100644
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
+++ b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
@@ -593,18 +593,10 @@ static void _rtl92e_refresh_support_rate(struct r8192_priv *priv)
}
}
-static u8 _rtl92e_get_supported_wireless_mode(struct net_device *dev)
-{
- u8 ret = 0;
-
- ret = (WIRELESS_MODE_N_24G | WIRELESS_MODE_G | WIRELESS_MODE_B);
- return ret;
-}
-
void rtl92e_set_wireless_mode(struct net_device *dev, u8 wireless_mode)
{
struct r8192_priv *priv = rtllib_priv(dev);
- u8 support_mode = _rtl92e_get_supported_wireless_mode(dev);
+ u8 support_mode = (WIRELESS_MODE_N_24G | WIRELESS_MODE_G | WIRELESS_MODE_B);
if ((wireless_mode == WIRELESS_MODE_AUTO) ||
((wireless_mode & support_mode) == 0)) {
--
2.39.2
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH 3/7] staging: rtl8192e: Remove 5G wireless_mode in rtl92e_set_wireless_mode
2023-03-27 21:02 [PATCH 0/7] staging: rtl8192e: Remove wireless modes A and N_5G Philipp Hortmann
2023-03-27 21:02 ` [PATCH 1/7] staging: rtl8192e: Remove rtl92e_config_phy Philipp Hortmann
2023-03-27 21:02 ` [PATCH 2/7] staging: rtl8192e: Remove _rtl92e_get_supported_wireless_mode Philipp Hortmann
@ 2023-03-27 21:02 ` Philipp Hortmann
2023-03-27 21:02 ` [PATCH 4/7] staging: rtl8192e: Remove unused if clauses " Philipp Hortmann
` (3 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: Philipp Hortmann @ 2023-03-27 21:02 UTC (permalink / raw)
To: Greg Kroah-Hartman, linux-staging, linux-kernel
Remove wireless_mode == WIRELESS_MODE_N_5G as 5G is not supported by
hardware and to improve readability.
Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
---
drivers/staging/rtl8192e/rtl8192e/rtl_core.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
index 12e5132fa788..c03978353a90 100644
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
+++ b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
@@ -624,12 +624,11 @@ void rtl92e_set_wireless_mode(struct net_device *dev, u8 wireless_mode)
priv->rtllib->mode = wireless_mode;
- if ((wireless_mode == WIRELESS_MODE_N_24G) ||
- (wireless_mode == WIRELESS_MODE_N_5G)) {
+ if (wireless_mode == WIRELESS_MODE_N_24G)
priv->rtllib->ht_info->enable_ht = 1;
- } else {
+ else
priv->rtllib->ht_info->enable_ht = 0;
- }
+
_rtl92e_refresh_support_rate(priv);
}
--
2.39.2
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH 4/7] staging: rtl8192e: Remove unused if clauses in rtl92e_set_wireless_mode
2023-03-27 21:02 [PATCH 0/7] staging: rtl8192e: Remove wireless modes A and N_5G Philipp Hortmann
` (2 preceding siblings ...)
2023-03-27 21:02 ` [PATCH 3/7] staging: rtl8192e: Remove 5G wireless_mode in rtl92e_set_wireless_mode Philipp Hortmann
@ 2023-03-27 21:02 ` Philipp Hortmann
2023-03-27 21:02 ` [PATCH 5/7] staging: rtl8192e: Remove wireless modes A, N_5G from _rtl92e_hwconfig Philipp Hortmann
` (2 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: Philipp Hortmann @ 2023-03-27 21:02 UTC (permalink / raw)
To: Greg Kroah-Hartman, linux-staging, linux-kernel
Equation (support_mode & WIRELESS_MODE_N_24G) will always be true. Remove
resulting dead code.
Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
---
drivers/staging/rtl8192e/rtl8192e/rtl_core.c | 21 ++------------------
1 file changed, 2 insertions(+), 19 deletions(-)
diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
index c03978353a90..689a5e16eb4d 100644
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
+++ b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
@@ -598,25 +598,8 @@ void rtl92e_set_wireless_mode(struct net_device *dev, u8 wireless_mode)
struct r8192_priv *priv = rtllib_priv(dev);
u8 support_mode = (WIRELESS_MODE_N_24G | WIRELESS_MODE_G | WIRELESS_MODE_B);
- if ((wireless_mode == WIRELESS_MODE_AUTO) ||
- ((wireless_mode & support_mode) == 0)) {
- if (support_mode & WIRELESS_MODE_N_24G) {
- wireless_mode = WIRELESS_MODE_N_24G;
- } else if (support_mode & WIRELESS_MODE_N_5G) {
- wireless_mode = WIRELESS_MODE_N_5G;
- } else if ((support_mode & WIRELESS_MODE_A)) {
- wireless_mode = WIRELESS_MODE_A;
- } else if ((support_mode & WIRELESS_MODE_G)) {
- wireless_mode = WIRELESS_MODE_G;
- } else if ((support_mode & WIRELESS_MODE_B)) {
- wireless_mode = WIRELESS_MODE_B;
- } else {
- netdev_info(dev,
- "%s(): Unsupported mode requested. Fallback to 802.11b\n",
- __func__);
- wireless_mode = WIRELESS_MODE_B;
- }
- }
+ if ((wireless_mode == WIRELESS_MODE_AUTO) || ((wireless_mode & support_mode) == 0))
+ wireless_mode = WIRELESS_MODE_N_24G;
if ((wireless_mode & (WIRELESS_MODE_B | WIRELESS_MODE_G)) ==
(WIRELESS_MODE_G | WIRELESS_MODE_B))
--
2.39.2
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH 5/7] staging: rtl8192e: Remove wireless modes A, N_5G from _rtl92e_hwconfig
2023-03-27 21:02 [PATCH 0/7] staging: rtl8192e: Remove wireless modes A and N_5G Philipp Hortmann
` (3 preceding siblings ...)
2023-03-27 21:02 ` [PATCH 4/7] staging: rtl8192e: Remove unused if clauses " Philipp Hortmann
@ 2023-03-27 21:02 ` Philipp Hortmann
2023-03-27 21:03 ` [PATCH 6/7] staging: rtl8192e: Remove wireless modes A, N_5G from rtl92e_set_channel Philipp Hortmann
2023-03-27 21:03 ` [PATCH 7/7] staging: rtl8192e: Remove wireless mode WIRELESS_MODE_N_5G Philipp Hortmann
6 siblings, 0 replies; 8+ messages in thread
From: Philipp Hortmann @ 2023-03-27 21:02 UTC (permalink / raw)
To: Greg Kroah-Hartman, linux-staging, linux-kernel
Remove WIRELESS_MODE_N_5G and WIRELESS_MODE_A as those are not supported
by hardware and to improve readability. Combine WIRELESS_MODE_G with
default to improve readability.
Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
---
drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c | 17 +----------------
1 file changed, 1 insertion(+), 16 deletions(-)
diff --git a/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c b/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c
index f4fdaeff2917..1da14e737aa4 100644
--- a/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c
+++ b/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c
@@ -503,16 +503,6 @@ static void _rtl92e_hwconfig(struct net_device *dev)
regRATR = RATE_ALL_CCK;
regRRSR = RATE_ALL_CCK;
break;
- case WIRELESS_MODE_A:
- regBwOpMode = BW_OPMODE_5G | BW_OPMODE_20MHZ;
- regRATR = RATE_ALL_OFDM_AG;
- regRRSR = RATE_ALL_OFDM_AG;
- break;
- case WIRELESS_MODE_G:
- regBwOpMode = BW_OPMODE_20MHZ;
- regRATR = RATE_ALL_CCK | RATE_ALL_OFDM_AG;
- regRRSR = RATE_ALL_CCK | RATE_ALL_OFDM_AG;
- break;
case WIRELESS_MODE_AUTO:
case WIRELESS_MODE_N_24G:
regBwOpMode = BW_OPMODE_20MHZ;
@@ -520,12 +510,7 @@ static void _rtl92e_hwconfig(struct net_device *dev)
RATE_ALL_OFDM_1SS | RATE_ALL_OFDM_2SS;
regRRSR = RATE_ALL_CCK | RATE_ALL_OFDM_AG;
break;
- case WIRELESS_MODE_N_5G:
- regBwOpMode = BW_OPMODE_5G;
- regRATR = RATE_ALL_OFDM_AG | RATE_ALL_OFDM_1SS |
- RATE_ALL_OFDM_2SS;
- regRRSR = RATE_ALL_OFDM_AG;
- break;
+ case WIRELESS_MODE_G:
default:
regBwOpMode = BW_OPMODE_20MHZ;
regRATR = RATE_ALL_CCK | RATE_ALL_OFDM_AG;
--
2.39.2
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH 6/7] staging: rtl8192e: Remove wireless modes A, N_5G from rtl92e_set_channel
2023-03-27 21:02 [PATCH 0/7] staging: rtl8192e: Remove wireless modes A and N_5G Philipp Hortmann
` (4 preceding siblings ...)
2023-03-27 21:02 ` [PATCH 5/7] staging: rtl8192e: Remove wireless modes A, N_5G from _rtl92e_hwconfig Philipp Hortmann
@ 2023-03-27 21:03 ` Philipp Hortmann
2023-03-27 21:03 ` [PATCH 7/7] staging: rtl8192e: Remove wireless mode WIRELESS_MODE_N_5G Philipp Hortmann
6 siblings, 0 replies; 8+ messages in thread
From: Philipp Hortmann @ 2023-03-27 21:03 UTC (permalink / raw)
To: Greg Kroah-Hartman, linux-staging, linux-kernel
Remove WIRELESS_MODE_N_5G and WIRELESS_MODE_A as those are not supported
by hardware and to improve readability.
Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
---
drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c | 9 ---------
1 file changed, 9 deletions(-)
diff --git a/drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c b/drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c
index 139d8268c8dc..dd666701138e 100644
--- a/drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c
+++ b/drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c
@@ -696,15 +696,6 @@ u8 rtl92e_set_channel(struct net_device *dev, u8 channel)
switch (priv->rtllib->mode) {
- case WIRELESS_MODE_A:
- case WIRELESS_MODE_N_5G:
- if (channel <= 14) {
- netdev_warn(dev,
- "Channel %d not available in 802.11a.\n",
- channel);
- return false;
- }
- break;
case WIRELESS_MODE_B:
if (channel > 14) {
netdev_warn(dev,
--
2.39.2
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH 7/7] staging: rtl8192e: Remove wireless mode WIRELESS_MODE_N_5G
2023-03-27 21:02 [PATCH 0/7] staging: rtl8192e: Remove wireless modes A and N_5G Philipp Hortmann
` (5 preceding siblings ...)
2023-03-27 21:03 ` [PATCH 6/7] staging: rtl8192e: Remove wireless modes A, N_5G from rtl92e_set_channel Philipp Hortmann
@ 2023-03-27 21:03 ` Philipp Hortmann
6 siblings, 0 replies; 8+ messages in thread
From: Philipp Hortmann @ 2023-03-27 21:03 UTC (permalink / raw)
To: Greg Kroah-Hartman, linux-staging, linux-kernel
Remove WIRELESS_MODE_N_5G from equations as it is not supported by
hardware and to improve readability.
Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
---
drivers/staging/rtl8192e/rtl8192e/rtl_core.c | 3 +--
drivers/staging/rtl8192e/rtl8192e/rtl_dm.c | 6 ++----
2 files changed, 3 insertions(+), 6 deletions(-)
diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
index 689a5e16eb4d..7506d7eb7b4c 100644
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
+++ b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
@@ -581,8 +581,7 @@ static void _rtl92e_refresh_support_rate(struct r8192_priv *priv)
{
struct rtllib_device *ieee = priv->rtllib;
- if (ieee->mode == WIRELESS_MODE_N_24G ||
- ieee->mode == WIRELESS_MODE_N_5G) {
+ if (ieee->mode == WIRELESS_MODE_N_24G) {
memcpy(ieee->reg_dot11ht_oper_rate_set,
ieee->reg_ht_supp_rate_set, 16);
memcpy(ieee->reg_dot11tx_ht_oper_rate_set,
diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_dm.c b/drivers/staging/rtl8192e/rtl8192e/rtl_dm.c
index d45808760638..b5f4d0230da7 100644
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_dm.c
+++ b/drivers/staging/rtl8192e/rtl8192e/rtl_dm.c
@@ -296,8 +296,7 @@ static void _rtl92e_dm_check_rate_adaptive(struct net_device *dev)
if (pra->rate_adaptive_disabled)
return;
- if (!(priv->rtllib->mode == WIRELESS_MODE_N_24G ||
- priv->rtllib->mode == WIRELESS_MODE_N_5G))
+ if (priv->rtllib->mode != WIRELESS_MODE_N_24G)
return;
if (priv->rtllib->state == RTLLIB_LINKED) {
@@ -971,8 +970,7 @@ void rtl92e_dm_restore_state(struct net_device *dev)
if (priv->rate_adaptive.rate_adaptive_disabled)
return;
- if (!(priv->rtllib->mode == WIRELESS_MODE_N_24G ||
- priv->rtllib->mode == WIRELESS_MODE_N_5G))
+ if (priv->rtllib->mode != WIRELESS_MODE_N_24G)
return;
ratr_value = reg_ratr;
ratr_value &= ~(RATE_ALL_OFDM_2SS);
--
2.39.2
^ permalink raw reply related [flat|nested] 8+ messages in thread
end of thread, other threads:[~2023-03-27 21:03 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-03-27 21:02 [PATCH 0/7] staging: rtl8192e: Remove wireless modes A and N_5G Philipp Hortmann
2023-03-27 21:02 ` [PATCH 1/7] staging: rtl8192e: Remove rtl92e_config_phy Philipp Hortmann
2023-03-27 21:02 ` [PATCH 2/7] staging: rtl8192e: Remove _rtl92e_get_supported_wireless_mode Philipp Hortmann
2023-03-27 21:02 ` [PATCH 3/7] staging: rtl8192e: Remove 5G wireless_mode in rtl92e_set_wireless_mode Philipp Hortmann
2023-03-27 21:02 ` [PATCH 4/7] staging: rtl8192e: Remove unused if clauses " Philipp Hortmann
2023-03-27 21:02 ` [PATCH 5/7] staging: rtl8192e: Remove wireless modes A, N_5G from _rtl92e_hwconfig Philipp Hortmann
2023-03-27 21:03 ` [PATCH 6/7] staging: rtl8192e: Remove wireless modes A, N_5G from rtl92e_set_channel Philipp Hortmann
2023-03-27 21:03 ` [PATCH 7/7] staging: rtl8192e: Remove wireless mode WIRELESS_MODE_N_5G Philipp Hortmann
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).