2023-11-19 22:14:50

by Philipp Hortmann

[permalink] [raw]
Subject: [PATCH 00/14] staging: rtl8192e: IS_DOT11D_ENABLE() returns always false

IS_DOT11D_ENABLE() returns always false. Remove dead code accordingly.

Tested with rtl8192e (WLL6130-D99) in Mode n (12.5 MB/s)
Transferred this patch over wlan connection of rtl8192e.

Philipp Hortmann (14):
staging: rtl8192e: Remove unexecuted rtllib_extract_country_ie()
staging: rtl8192e: Remove unused function dot11d_update_country()
staging: rtl8192e: Remove IS_DOT11D_ENABLE(ieee)
staging: rtl8192e: Remove unused function dot11d_scan_complete()
staging: rtl8192e: Remove unused function dot11d_reset()
staging: rtl8192e: Remove unused macros IS_EQUAL_CIE_SRC and friends
staging: rtl8192e: Remove unused function copy_mac_addr()
staging: rtl8192e: Remove unused variable dot11d_info->state
staging: rtl8192e: Remove unused variables from struct rt_dot11d_info
staging: rtl8192e: Remove unused variable country_watchdog
staging: rtl8192e: Remove unused variable global_domain
staging: rtl8192e: Remove unused function dot11d_init()
staging: rtl8192e: Remove unused struct chnl_txpow_triple
staging: rtl8192e: Remove unused variable bss_start_channel

drivers/staging/rtl8192e/dot11d.c | 93 --------------------
drivers/staging/rtl8192e/dot11d.h | 56 +-----------
drivers/staging/rtl8192e/rtl8192e/rtl_core.c | 1 -
drivers/staging/rtl8192e/rtllib.h | 3 -
drivers/staging/rtl8192e/rtllib_rx.c | 31 -------
drivers/staging/rtl8192e/rtllib_softmac.c | 20 -----
6 files changed, 1 insertion(+), 203 deletions(-)

--
2.42.0


2023-11-19 22:15:32

by Philipp Hortmann

[permalink] [raw]
Subject: [PATCH 05/14] staging: rtl8192e: Remove unused function dot11d_reset()

Remove unused function dot11d_reset().

Signed-off-by: Philipp Hortmann <[email protected]>
---
drivers/staging/rtl8192e/dot11d.c | 17 -----------------
drivers/staging/rtl8192e/dot11d.h | 1 -
2 files changed, 18 deletions(-)

diff --git a/drivers/staging/rtl8192e/dot11d.c b/drivers/staging/rtl8192e/dot11d.c
index 95fb56cb77fc..f0241982c7a8 100644
--- a/drivers/staging/rtl8192e/dot11d.c
+++ b/drivers/staging/rtl8192e/dot11d.c
@@ -42,20 +42,3 @@ void dot11d_channel_map(struct rtllib_device *ieee)
ieee->bss_start_channel = 10;
}
EXPORT_SYMBOL(dot11d_channel_map);
-
-void dot11d_reset(struct rtllib_device *ieee)
-{
- struct rt_dot11d_info *dot11d_info = GET_DOT11D_INFO(ieee);
- u32 i;
-
- memset(dot11d_info->channel_map, 0, MAX_CHANNEL_NUMBER + 1);
- memset(dot11d_info->max_tx_power_list, 0xFF, MAX_CHANNEL_NUMBER + 1);
- for (i = 1; i <= 11; i++)
- (dot11d_info->channel_map)[i] = 1;
- for (i = 12; i <= 14; i++)
- (dot11d_info->channel_map)[i] = 2;
- dot11d_info->state = DOT11D_STATE_NONE;
- dot11d_info->country_len = 0;
- RESET_CIE_WATCHDOG(ieee);
-}
-
diff --git a/drivers/staging/rtl8192e/dot11d.h b/drivers/staging/rtl8192e/dot11d.h
index 9e8328af887c..0ca803be3965 100644
--- a/drivers/staging/rtl8192e/dot11d.h
+++ b/drivers/staging/rtl8192e/dot11d.h
@@ -72,6 +72,5 @@ static inline void RESET_CIE_WATCHDOG(struct rtllib_device *__ieee_dev)

void dot11d_init(struct rtllib_device *dev);
void dot11d_channel_map(struct rtllib_device *ieee);
-void dot11d_reset(struct rtllib_device *dev);

#endif
--
2.42.0

2023-11-19 22:15:43

by Philipp Hortmann

[permalink] [raw]
Subject: [PATCH 06/14] staging: rtl8192e: Remove unused macros IS_EQUAL_CIE_SRC and friends

Remove unused macros IS_EQUAL_CIE_SRC, UPDATE_CIE_WATCHDOG,
UPDATE_CIE_SRC and IS_COUNTRY_IE_VALID.

Signed-off-by: Philipp Hortmann <[email protected]>
---
drivers/staging/rtl8192e/dot11d.h | 11 -----------
1 file changed, 11 deletions(-)

diff --git a/drivers/staging/rtl8192e/dot11d.h b/drivers/staging/rtl8192e/dot11d.h
index 0ca803be3965..fd0a2df189bf 100644
--- a/drivers/staging/rtl8192e/dot11d.h
+++ b/drivers/staging/rtl8192e/dot11d.h
@@ -52,15 +52,6 @@ static inline void copy_mac_addr(unsigned char *des, unsigned char *src)
#define GET_DOT11D_INFO(__ieee_dev) \
((struct rt_dot11d_info *)((__ieee_dev)->dot11d_info))

-#define IS_COUNTRY_IE_VALID(__ieee_dev) \
- (GET_DOT11D_INFO(__ieee_dev)->country_len > 0)
-
-#define IS_EQUAL_CIE_SRC(__ieee_dev, __address) \
- ether_addr_equal_unaligned( \
- GET_DOT11D_INFO(__ieee_dev)->country_src_addr, __address)
-#define UPDATE_CIE_SRC(__ieee_dev, __address) \
- copy_mac_addr(GET_DOT11D_INFO(__ieee_dev)->country_src_addr, __address)
-
#define GET_CIE_WATCHDOG(__ieee_dev) \
(GET_DOT11D_INFO(__ieee_dev)->country_watchdog)
static inline void RESET_CIE_WATCHDOG(struct rtllib_device *__ieee_dev)
@@ -68,8 +59,6 @@ static inline void RESET_CIE_WATCHDOG(struct rtllib_device *__ieee_dev)
GET_CIE_WATCHDOG(__ieee_dev) = 0;
}

-#define UPDATE_CIE_WATCHDOG(__ieee_dev) (++GET_CIE_WATCHDOG(__ieee_dev))
-
void dot11d_init(struct rtllib_device *dev);
void dot11d_channel_map(struct rtllib_device *ieee);

--
2.42.0

2023-11-19 22:15:50

by Philipp Hortmann

[permalink] [raw]
Subject: [PATCH 07/14] staging: rtl8192e: Remove unused function copy_mac_addr()

Remove unused function copy_mac_addr().

Signed-off-by: Philipp Hortmann <[email protected]>
---
drivers/staging/rtl8192e/dot11d.h | 5 -----
1 file changed, 5 deletions(-)

diff --git a/drivers/staging/rtl8192e/dot11d.h b/drivers/staging/rtl8192e/dot11d.h
index fd0a2df189bf..d3da4af4a16b 100644
--- a/drivers/staging/rtl8192e/dot11d.h
+++ b/drivers/staging/rtl8192e/dot11d.h
@@ -44,11 +44,6 @@ struct rt_dot11d_info {
enum dot11d_state state;
};

-static inline void copy_mac_addr(unsigned char *des, unsigned char *src)
-{
- memcpy(des, src, 6);
-}
-
#define GET_DOT11D_INFO(__ieee_dev) \
((struct rt_dot11d_info *)((__ieee_dev)->dot11d_info))

--
2.42.0

2023-11-19 22:16:00

by Philipp Hortmann

[permalink] [raw]
Subject: [PATCH 02/14] staging: rtl8192e: Remove unused function dot11d_update_country()

Remove unused function dot11d_update_country().

Signed-off-by: Philipp Hortmann <[email protected]>
---
drivers/staging/rtl8192e/dot11d.c | 44 -------------------------------
drivers/staging/rtl8192e/dot11d.h | 2 --
2 files changed, 46 deletions(-)

diff --git a/drivers/staging/rtl8192e/dot11d.c b/drivers/staging/rtl8192e/dot11d.c
index fdc39e6e7abb..fc65a63a4de6 100644
--- a/drivers/staging/rtl8192e/dot11d.c
+++ b/drivers/staging/rtl8192e/dot11d.c
@@ -61,50 +61,6 @@ void dot11d_reset(struct rtllib_device *ieee)
RESET_CIE_WATCHDOG(ieee);
}

-void dot11d_update_country(struct rtllib_device *dev, u8 *address,
- u16 country_len, u8 *country)
-{
- struct rt_dot11d_info *dot11d_info = GET_DOT11D_INFO(dev);
- u8 i, j, number_of_triples, max_channel_number;
- struct chnl_txpow_triple *triple;
-
- memset(dot11d_info->channel_map, 0, MAX_CHANNEL_NUMBER + 1);
- memset(dot11d_info->max_tx_power_list, 0xFF, MAX_CHANNEL_NUMBER + 1);
- max_channel_number = 0;
- number_of_triples = (country_len - 3) / 3;
- triple = (struct chnl_txpow_triple *)(country + 3);
- for (i = 0; i < number_of_triples; i++) {
- if (max_channel_number >= triple->first_channel) {
- netdev_info(dev->dev,
- "%s: Invalid country IE, skip it......1\n",
- __func__);
- return;
- }
- if (MAX_CHANNEL_NUMBER < (triple->first_channel +
- triple->num_channels)) {
- netdev_info(dev->dev,
- "%s: Invalid country IE, skip it......2\n",
- __func__);
- return;
- }
-
- for (j = 0; j < triple->num_channels; j++) {
- dot11d_info->channel_map[triple->first_channel + j] = 1;
- dot11d_info->max_tx_power_list[triple->first_channel + j] =
- triple->max_tx_power;
- max_channel_number = triple->first_channel + j;
- }
-
- triple = (struct chnl_txpow_triple *)((u8 *)triple + 3);
- }
-
- UPDATE_CIE_SRC(dev, address);
-
- dot11d_info->country_len = country_len;
- memcpy(dot11d_info->country_buffer, country, country_len);
- dot11d_info->state = DOT11D_STATE_LEARNED;
-}
-
void dot11d_scan_complete(struct rtllib_device *dev)
{
struct rt_dot11d_info *dot11d_info = GET_DOT11D_INFO(dev);
diff --git a/drivers/staging/rtl8192e/dot11d.h b/drivers/staging/rtl8192e/dot11d.h
index 78d1ca1e7743..39bda2f94eed 100644
--- a/drivers/staging/rtl8192e/dot11d.h
+++ b/drivers/staging/rtl8192e/dot11d.h
@@ -77,8 +77,6 @@ static inline void RESET_CIE_WATCHDOG(struct rtllib_device *__ieee_dev)
void dot11d_init(struct rtllib_device *dev);
void dot11d_channel_map(struct rtllib_device *ieee);
void dot11d_reset(struct rtllib_device *dev);
-void dot11d_update_country(struct rtllib_device *dev, u8 *address,
- u16 country_len, u8 *country);
void dot11d_scan_complete(struct rtllib_device *dev);

#endif
--
2.42.0

2023-11-19 22:16:01

by Philipp Hortmann

[permalink] [raw]
Subject: [PATCH 04/14] staging: rtl8192e: Remove unused function dot11d_scan_complete()

Remove unused function dot11d_scan_complete().

Signed-off-by: Philipp Hortmann <[email protected]>
---
drivers/staging/rtl8192e/dot11d.c | 15 ---------------
drivers/staging/rtl8192e/dot11d.h | 1 -
2 files changed, 16 deletions(-)

diff --git a/drivers/staging/rtl8192e/dot11d.c b/drivers/staging/rtl8192e/dot11d.c
index 9eb941326bc8..95fb56cb77fc 100644
--- a/drivers/staging/rtl8192e/dot11d.c
+++ b/drivers/staging/rtl8192e/dot11d.c
@@ -59,18 +59,3 @@ void dot11d_reset(struct rtllib_device *ieee)
RESET_CIE_WATCHDOG(ieee);
}

-void dot11d_scan_complete(struct rtllib_device *dev)
-{
- struct rt_dot11d_info *dot11d_info = GET_DOT11D_INFO(dev);
-
- switch (dot11d_info->state) {
- case DOT11D_STATE_LEARNED:
- dot11d_info->state = DOT11D_STATE_DONE;
- break;
- case DOT11D_STATE_DONE:
- dot11d_reset(dev);
- break;
- case DOT11D_STATE_NONE:
- break;
- }
-}
diff --git a/drivers/staging/rtl8192e/dot11d.h b/drivers/staging/rtl8192e/dot11d.h
index c28067510653..9e8328af887c 100644
--- a/drivers/staging/rtl8192e/dot11d.h
+++ b/drivers/staging/rtl8192e/dot11d.h
@@ -73,6 +73,5 @@ static inline void RESET_CIE_WATCHDOG(struct rtllib_device *__ieee_dev)
void dot11d_init(struct rtllib_device *dev);
void dot11d_channel_map(struct rtllib_device *ieee);
void dot11d_reset(struct rtllib_device *dev);
-void dot11d_scan_complete(struct rtllib_device *dev);

#endif
--
2.42.0

2023-11-19 22:16:12

by Philipp Hortmann

[permalink] [raw]
Subject: [PATCH 10/14] staging: rtl8192e: Remove unused variable country_watchdog

country_watchdog is initialized to 0 and then never changed. Remove
related macros and functions.

Signed-off-by: Philipp Hortmann <[email protected]>
---
drivers/staging/rtl8192e/dot11d.c | 1 -
drivers/staging/rtl8192e/dot11d.h | 8 --------
2 files changed, 9 deletions(-)

diff --git a/drivers/staging/rtl8192e/dot11d.c b/drivers/staging/rtl8192e/dot11d.c
index b524ebe31869..b8ba95a65f27 100644
--- a/drivers/staging/rtl8192e/dot11d.c
+++ b/drivers/staging/rtl8192e/dot11d.c
@@ -19,7 +19,6 @@ void dot11d_init(struct rtllib_device *ieee)
struct rt_dot11d_info *dot11d_info = GET_DOT11D_INFO(ieee);

memset(dot11d_info->channel_map, 0, MAX_CHANNEL_NUMBER + 1);
- RESET_CIE_WATCHDOG(ieee);
}
EXPORT_SYMBOL(dot11d_init);

diff --git a/drivers/staging/rtl8192e/dot11d.h b/drivers/staging/rtl8192e/dot11d.h
index 64fd39cddc22..82748b12bd82 100644
--- a/drivers/staging/rtl8192e/dot11d.h
+++ b/drivers/staging/rtl8192e/dot11d.h
@@ -25,20 +25,12 @@ struct chnl_txpow_triple {
*/

struct rt_dot11d_info {
- u8 country_watchdog;
u8 channel_map[MAX_CHANNEL_NUMBER + 1];
};

#define GET_DOT11D_INFO(__ieee_dev) \
((struct rt_dot11d_info *)((__ieee_dev)->dot11d_info))

-#define GET_CIE_WATCHDOG(__ieee_dev) \
- (GET_DOT11D_INFO(__ieee_dev)->country_watchdog)
-static inline void RESET_CIE_WATCHDOG(struct rtllib_device *__ieee_dev)
-{
- GET_CIE_WATCHDOG(__ieee_dev) = 0;
-}
-
void dot11d_init(struct rtllib_device *dev);
void dot11d_channel_map(struct rtllib_device *ieee);

--
2.42.0

2023-11-19 22:16:15

by Philipp Hortmann

[permalink] [raw]
Subject: [PATCH 08/14] staging: rtl8192e: Remove unused variable dot11d_info->state

Remove unused variable dot11d_info->state. Remove unused enum
dot11d_state as well.

Signed-off-by: Philipp Hortmann <[email protected]>
---
drivers/staging/rtl8192e/dot11d.c | 1 -
drivers/staging/rtl8192e/dot11d.h | 8 --------
2 files changed, 9 deletions(-)

diff --git a/drivers/staging/rtl8192e/dot11d.c b/drivers/staging/rtl8192e/dot11d.c
index f0241982c7a8..08cf95d26911 100644
--- a/drivers/staging/rtl8192e/dot11d.c
+++ b/drivers/staging/rtl8192e/dot11d.c
@@ -18,7 +18,6 @@ void dot11d_init(struct rtllib_device *ieee)
{
struct rt_dot11d_info *dot11d_info = GET_DOT11D_INFO(ieee);

- dot11d_info->state = DOT11D_STATE_NONE;
dot11d_info->country_len = 0;
memset(dot11d_info->channel_map, 0, MAX_CHANNEL_NUMBER + 1);
memset(dot11d_info->max_tx_power_list, 0xFF, MAX_CHANNEL_NUMBER + 1);
diff --git a/drivers/staging/rtl8192e/dot11d.h b/drivers/staging/rtl8192e/dot11d.h
index d3da4af4a16b..c7d35ec86aae 100644
--- a/drivers/staging/rtl8192e/dot11d.h
+++ b/drivers/staging/rtl8192e/dot11d.h
@@ -16,12 +16,6 @@ struct chnl_txpow_triple {
u8 max_tx_power;
};

-enum dot11d_state {
- DOT11D_STATE_NONE = 0,
- DOT11D_STATE_LEARNED,
- DOT11D_STATE_DONE,
-};
-
/**
* struct rt_dot11d_info * @country_len: value greater than 0 if
* @country_buffer contains valid country information element.
@@ -40,8 +34,6 @@ struct rt_dot11d_info {

u8 channel_map[MAX_CHANNEL_NUMBER + 1];
u8 max_tx_power_list[MAX_CHANNEL_NUMBER + 1];
-
- enum dot11d_state state;
};

#define GET_DOT11D_INFO(__ieee_dev) \
--
2.42.0

2023-11-19 22:16:18

by Philipp Hortmann

[permalink] [raw]
Subject: [PATCH 03/14] staging: rtl8192e: Remove IS_DOT11D_ENABLE(ieee)

Variable "enabled" is initialized to false and never changed. Therefore
IS_DOT11D_ENABLE(ieee) returns always false. Remove dead code.

Signed-off-by: Philipp Hortmann <[email protected]>
---
drivers/staging/rtl8192e/dot11d.c | 2 --
drivers/staging/rtl8192e/dot11d.h | 4 ----
drivers/staging/rtl8192e/rtllib_softmac.c | 20 --------------------
3 files changed, 26 deletions(-)

diff --git a/drivers/staging/rtl8192e/dot11d.c b/drivers/staging/rtl8192e/dot11d.c
index fc65a63a4de6..9eb941326bc8 100644
--- a/drivers/staging/rtl8192e/dot11d.c
+++ b/drivers/staging/rtl8192e/dot11d.c
@@ -18,8 +18,6 @@ void dot11d_init(struct rtllib_device *ieee)
{
struct rt_dot11d_info *dot11d_info = GET_DOT11D_INFO(ieee);

- dot11d_info->enabled = false;
-
dot11d_info->state = DOT11D_STATE_NONE;
dot11d_info->country_len = 0;
memset(dot11d_info->channel_map, 0, MAX_CHANNEL_NUMBER + 1);
diff --git a/drivers/staging/rtl8192e/dot11d.h b/drivers/staging/rtl8192e/dot11d.h
index 39bda2f94eed..c28067510653 100644
--- a/drivers/staging/rtl8192e/dot11d.h
+++ b/drivers/staging/rtl8192e/dot11d.h
@@ -33,8 +33,6 @@ enum dot11d_state {
*/

struct rt_dot11d_info {
- bool enabled;
-
u16 country_len;
u8 country_buffer[MAX_IE_LEN];
u8 country_src_addr[6];
@@ -54,8 +52,6 @@ static inline void copy_mac_addr(unsigned char *des, unsigned char *src)
#define GET_DOT11D_INFO(__ieee_dev) \
((struct rt_dot11d_info *)((__ieee_dev)->dot11d_info))

-#define IS_DOT11D_ENABLE(__ieee_dev) \
- (GET_DOT11D_INFO(__ieee_dev)->enabled)
#define IS_COUNTRY_IE_VALID(__ieee_dev) \
(GET_DOT11D_INFO(__ieee_dev)->country_len > 0)

diff --git a/drivers/staging/rtl8192e/rtllib_softmac.c b/drivers/staging/rtl8192e/rtllib_softmac.c
index 42d652fe8601..08349f522c83 100644
--- a/drivers/staging/rtl8192e/rtllib_softmac.c
+++ b/drivers/staging/rtl8192e/rtllib_softmac.c
@@ -492,10 +492,6 @@ static void rtllib_softmac_scan_syncro(struct rtllib_device *ieee)
ieee->actscanning = false;
ieee->sync_scan_hurryup = 0;

- if (ieee->link_state >= MAC80211_LINKED) {
- if (IS_DOT11D_ENABLE(ieee))
- dot11d_scan_complete(ieee);
- }
mutex_unlock(&ieee->scan_mutex);

ieee->be_scan_inprogress = false;
@@ -552,8 +548,6 @@ static void rtllib_softmac_scan_wq(void *data)
return;

out:
- if (IS_DOT11D_ENABLE(ieee))
- dot11d_scan_complete(ieee);
ieee->current_network.channel = last_channel;

out1:
@@ -609,10 +603,6 @@ static void rtllib_start_scan(struct rtllib_device *ieee)
{
ieee->rtllib_ips_leave_wq(ieee->dev);

- if (IS_DOT11D_ENABLE(ieee)) {
- if (IS_COUNTRY_IE_VALID(ieee))
- RESET_CIE_WATCHDOG(ieee);
- }
if (ieee->softmac_features & IEEE_SOFTMAC_SCAN) {
if (ieee->scanning_continue == 0) {
ieee->actscanning = true;
@@ -625,10 +615,6 @@ static void rtllib_start_scan(struct rtllib_device *ieee)
/* called with wx_mutex held */
void rtllib_start_scan_syncro(struct rtllib_device *ieee)
{
- if (IS_DOT11D_ENABLE(ieee)) {
- if (IS_COUNTRY_IE_VALID(ieee))
- RESET_CIE_WATCHDOG(ieee);
- }
ieee->sync_scan_hurryup = 0;
if (ieee->softmac_features & IEEE_SOFTMAC_SCAN)
rtllib_softmac_scan_syncro(ieee);
@@ -2090,10 +2076,6 @@ static void rtllib_start_bss(struct rtllib_device *ieee)
{
unsigned long flags;

- if (IS_DOT11D_ENABLE(ieee) && !IS_COUNTRY_IE_VALID(ieee)) {
- if (!ieee->global_domain)
- return;
- }
/* check if we have already found the net we
* are interested in (if any).
* if not (we are disassociated and we are not
@@ -2128,8 +2110,6 @@ void rtllib_disassociate(struct rtllib_device *ieee)
if (ieee->softmac_features & IEEE_SOFTMAC_TX_QUEUE)
rtllib_reset_queue(ieee);

- if (IS_DOT11D_ENABLE(ieee))
- dot11d_reset(ieee);
ieee->link_state = MAC80211_NOLINK;
ieee->is_set_key = false;
ieee->wap_set = 0;
--
2.42.0

2023-11-19 22:16:21

by Philipp Hortmann

[permalink] [raw]
Subject: [PATCH 09/14] staging: rtl8192e: Remove unused variables from struct rt_dot11d_info

Remove unused variables country_len, country_buffer, country_src_addr and
max_tx_power_list. Remove comments about usage as well.

Signed-off-by: Philipp Hortmann <[email protected]>
---
drivers/staging/rtl8192e/dot11d.c | 2 --
drivers/staging/rtl8192e/dot11d.h | 9 +--------
2 files changed, 1 insertion(+), 10 deletions(-)

diff --git a/drivers/staging/rtl8192e/dot11d.c b/drivers/staging/rtl8192e/dot11d.c
index 08cf95d26911..b524ebe31869 100644
--- a/drivers/staging/rtl8192e/dot11d.c
+++ b/drivers/staging/rtl8192e/dot11d.c
@@ -18,9 +18,7 @@ void dot11d_init(struct rtllib_device *ieee)
{
struct rt_dot11d_info *dot11d_info = GET_DOT11D_INFO(ieee);

- dot11d_info->country_len = 0;
memset(dot11d_info->channel_map, 0, MAX_CHANNEL_NUMBER + 1);
- memset(dot11d_info->max_tx_power_list, 0xFF, MAX_CHANNEL_NUMBER + 1);
RESET_CIE_WATCHDOG(ieee);
}
EXPORT_SYMBOL(dot11d_init);
diff --git a/drivers/staging/rtl8192e/dot11d.h b/drivers/staging/rtl8192e/dot11d.h
index c7d35ec86aae..64fd39cddc22 100644
--- a/drivers/staging/rtl8192e/dot11d.h
+++ b/drivers/staging/rtl8192e/dot11d.h
@@ -17,23 +17,16 @@ struct chnl_txpow_triple {
};

/**
- * struct rt_dot11d_info * @country_len: value greater than 0 if
- * @country_buffer contains valid country information element.
+ * struct rt_dot11d_info
* @channel_map: holds channel values
* 0 - invalid,
* 1 - valid (active scan),
* 2 - valid (passive scan)
- * @country_src_addr - Source AP of the country IE
*/

struct rt_dot11d_info {
- u16 country_len;
- u8 country_buffer[MAX_IE_LEN];
- u8 country_src_addr[6];
u8 country_watchdog;
-
u8 channel_map[MAX_CHANNEL_NUMBER + 1];
- u8 max_tx_power_list[MAX_CHANNEL_NUMBER + 1];
};

#define GET_DOT11D_INFO(__ieee_dev) \
--
2.42.0

2023-11-19 22:16:25

by Philipp Hortmann

[permalink] [raw]
Subject: [PATCH 11/14] staging: rtl8192e: Remove unused variable global_domain

global_domain is initialized to false and then never used.

Signed-off-by: Philipp Hortmann <[email protected]>
---
drivers/staging/rtl8192e/dot11d.c | 2 --
drivers/staging/rtl8192e/rtllib.h | 1 -
2 files changed, 3 deletions(-)

diff --git a/drivers/staging/rtl8192e/dot11d.c b/drivers/staging/rtl8192e/dot11d.c
index b8ba95a65f27..fd488e2fa815 100644
--- a/drivers/staging/rtl8192e/dot11d.c
+++ b/drivers/staging/rtl8192e/dot11d.c
@@ -26,8 +26,6 @@ void dot11d_channel_map(struct rtllib_device *ieee)
{
int i;

- ieee->global_domain = false;
-
memset(GET_DOT11D_INFO(ieee)->channel_map, 0,
sizeof(GET_DOT11D_INFO(ieee)->channel_map));
for (i = 0; i < channel_array.len; i++)
diff --git a/drivers/staging/rtl8192e/rtllib.h b/drivers/staging/rtl8192e/rtllib.h
index 1d0878d1f696..820951602fb0 100644
--- a/drivers/staging/rtl8192e/rtllib.h
+++ b/drivers/staging/rtl8192e/rtllib.h
@@ -1322,7 +1322,6 @@ struct rtllib_device {

/* map of allowed channels. 0 is dummy */
void *dot11d_info;
- bool global_domain;
u8 active_channel_map[MAX_CHANNEL_NUMBER+1];

u8 bss_start_channel;
--
2.42.0

2023-11-19 22:16:40

by Philipp Hortmann

[permalink] [raw]
Subject: [PATCH 12/14] staging: rtl8192e: Remove unused function dot11d_init()

The variable dot11d_info->channel_map is initialized in dot11d_init() and
in dot11d_channel_map(). dot11d_init() is called only once just before
dot11d_channel_map(). Therefore dot11d_init() can be removed.

Signed-off-by: Philipp Hortmann <[email protected]>
---
drivers/staging/rtl8192e/dot11d.c | 8 --------
drivers/staging/rtl8192e/dot11d.h | 1 -
drivers/staging/rtl8192e/rtl8192e/rtl_core.c | 1 -
3 files changed, 10 deletions(-)

diff --git a/drivers/staging/rtl8192e/dot11d.c b/drivers/staging/rtl8192e/dot11d.c
index fd488e2fa815..9ec112e00e38 100644
--- a/drivers/staging/rtl8192e/dot11d.c
+++ b/drivers/staging/rtl8192e/dot11d.c
@@ -14,14 +14,6 @@ struct channel_list {

static struct channel_list channel_array = {{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13}, 13};

-void dot11d_init(struct rtllib_device *ieee)
-{
- struct rt_dot11d_info *dot11d_info = GET_DOT11D_INFO(ieee);
-
- memset(dot11d_info->channel_map, 0, MAX_CHANNEL_NUMBER + 1);
-}
-EXPORT_SYMBOL(dot11d_init);
-
void dot11d_channel_map(struct rtllib_device *ieee)
{
int i;
diff --git a/drivers/staging/rtl8192e/dot11d.h b/drivers/staging/rtl8192e/dot11d.h
index 82748b12bd82..767bbbc8b01d 100644
--- a/drivers/staging/rtl8192e/dot11d.h
+++ b/drivers/staging/rtl8192e/dot11d.h
@@ -31,7 +31,6 @@ struct rt_dot11d_info {
#define GET_DOT11D_INFO(__ieee_dev) \
((struct rt_dot11d_info *)((__ieee_dev)->dot11d_info))

-void dot11d_init(struct rtllib_device *dev);
void dot11d_channel_map(struct rtllib_device *ieee);

#endif
diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
index 4b842a1789c2..c3466291e221 100644
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
+++ b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
@@ -795,7 +795,6 @@ static short _rtl92e_get_channel_map(struct net_device *dev)

struct r8192_priv *priv = rtllib_priv(dev);

- dot11d_init(priv->rtllib);
dot11d_channel_map(priv->rtllib);
for (i = 1; i <= 11; i++)
(priv->rtllib->active_channel_map)[i] = 1;
--
2.42.0

2023-11-19 22:16:51

by Philipp Hortmann

[permalink] [raw]
Subject: [PATCH 13/14] staging: rtl8192e: Remove unused struct chnl_txpow_triple

Remove unused struct chnl_txpow_triple.

Signed-off-by: Philipp Hortmann <[email protected]>
---
drivers/staging/rtl8192e/dot11d.h | 6 ------
1 file changed, 6 deletions(-)

diff --git a/drivers/staging/rtl8192e/dot11d.h b/drivers/staging/rtl8192e/dot11d.h
index 767bbbc8b01d..5c02e51c39cd 100644
--- a/drivers/staging/rtl8192e/dot11d.h
+++ b/drivers/staging/rtl8192e/dot11d.h
@@ -10,12 +10,6 @@

#include "rtllib.h"

-struct chnl_txpow_triple {
- u8 first_channel;
- u8 num_channels;
- u8 max_tx_power;
-};
-
/**
* struct rt_dot11d_info
* @channel_map: holds channel values
--
2.42.0

2023-11-19 22:17:02

by Philipp Hortmann

[permalink] [raw]
Subject: [PATCH 14/14] staging: rtl8192e: Remove unused variable bss_start_channel

Remove unused variable bss_start_channel.

Signed-off-by: Philipp Hortmann <[email protected]>
---
drivers/staging/rtl8192e/dot11d.c | 1 -
drivers/staging/rtl8192e/rtllib.h | 2 --
2 files changed, 3 deletions(-)

diff --git a/drivers/staging/rtl8192e/dot11d.c b/drivers/staging/rtl8192e/dot11d.c
index 9ec112e00e38..d51d4afff61e 100644
--- a/drivers/staging/rtl8192e/dot11d.c
+++ b/drivers/staging/rtl8192e/dot11d.c
@@ -25,6 +25,5 @@ void dot11d_channel_map(struct rtllib_device *ieee)

for (i = 12; i <= 13; i++)
GET_DOT11D_INFO(ieee)->channel_map[i] = 2;
- ieee->bss_start_channel = 10;
}
EXPORT_SYMBOL(dot11d_channel_map);
diff --git a/drivers/staging/rtl8192e/rtllib.h b/drivers/staging/rtl8192e/rtllib.h
index 820951602fb0..77ae259eab35 100644
--- a/drivers/staging/rtl8192e/rtllib.h
+++ b/drivers/staging/rtl8192e/rtllib.h
@@ -1324,8 +1324,6 @@ struct rtllib_device {
void *dot11d_info;
u8 active_channel_map[MAX_CHANNEL_NUMBER+1];

- u8 bss_start_channel;
-
int rate; /* current rate */
int basic_rate;

--
2.42.0

2023-11-21 07:32:28

by Dan Carpenter

[permalink] [raw]
Subject: Re: [PATCH 00/14] staging: rtl8192e: IS_DOT11D_ENABLE() returns always false

Looks good.

Reviewed-by: Dan Carpenter <[email protected]>

regards,
dan carpenter