Skip to contentSkip to conversation

staging: r8188eu: remove unused functions

PATCH In review Michael Straube 2 participants 8 messages Aug 29, 2021 – Aug 30, 2021 Staging

lore
Share & tools
lore
#0 lore raw

cover staging: r8188eu: remove unused functions

This series removes unused functions from core/rtw_wlan_util.c.

Michael Straube (6):
staging: r8188eu: remove rtw_get_oper_bw()
staging: r8188eu: remove rtw_get_oper_choffset()
staging: r8188eu: remove get_bsstype()
staging: r8188eu: remove CAM_empty_entry()
staging: r8188eu: remove is_ap_in_wep()
staging: r8188eu: remove should_forbid_n_rate()

 drivers/staging/r8188eu/core/rtw_wlan_util.c  | 91 -------------------
 .../staging/r8188eu/include/rtw_mlme_ext.h    |  6 --
 2 files changed, 97 deletions(-)
Signature · 1 line
2.32.0
#1 lore raw

PATCH 1/6 staging: r8188eu: remove rtw_get_oper_bw()

Function rtw_get_oper_bw() is unused, remove it.

---
 drivers/staging/r8188eu/core/rtw_wlan_util.c   | 5 -----
 drivers/staging/r8188eu/include/rtw_mlme_ext.h | 1 -
 2 files changed, 6 deletions(-)
drivers/staging/r8188eu/core/rtw_wlan_util.c +0 -5
index a3a5e1c64c4a..e13e4dd189be 100644
@@ -304,11 +304,6 @@ inline void rtw_set_oper_ch(struct adapter *adapter, u8 ch)
 	adapter->mlmeextpriv.oper_channel = ch;
 }
 
-inline u8 rtw_get_oper_bw(struct adapter *adapter)
-{
-	return adapter->mlmeextpriv.oper_bwmode;
-}
-
 inline void rtw_set_oper_bw(struct adapter *adapter, u8 bw)
 {
 	adapter->mlmeextpriv.oper_bwmode = bw;
drivers/staging/r8188eu/include/rtw_mlme_ext.h +0 -1
index d2f4d3ce7b90..b3ca9f3fba7f 100644
@@ -447,7 +447,6 @@ void Set_MSR(struct adapter *padapter, u8 type);
 
 u8 rtw_get_oper_ch(struct adapter *adapter);
 void rtw_set_oper_ch(struct adapter *adapter, u8 ch);
-u8 rtw_get_oper_bw(struct adapter *adapter);
 void rtw_set_oper_bw(struct adapter *adapter, u8 bw);
 u8 rtw_get_oper_choffset(struct adapter *adapter);
 void rtw_set_oper_choffset(struct adapter *adapter, u8 offset);
Signature · 1 line
2.32.0
#2 lore raw

PATCH 2/6 staging: r8188eu: remove rtw_get_oper_choffset()

In reply to Michael Straube

Function rtw_get_oper_choffset() is unused, remove it.

---
 drivers/staging/r8188eu/core/rtw_wlan_util.c   | 5 -----
 drivers/staging/r8188eu/include/rtw_mlme_ext.h | 1 -
 2 files changed, 6 deletions(-)
drivers/staging/r8188eu/core/rtw_wlan_util.c +0 -5
index e13e4dd189be..57330b3a66d7 100644
@@ -309,11 +309,6 @@ inline void rtw_set_oper_bw(struct adapter *adapter, u8 bw)
 	adapter->mlmeextpriv.oper_bwmode = bw;
 }
 
-inline u8 rtw_get_oper_choffset(struct adapter *adapter)
-{
-	return adapter->mlmeextpriv.oper_ch_offset;
-}
-
 inline void rtw_set_oper_choffset(struct adapter *adapter, u8 offset)
 {
 	adapter->mlmeextpriv.oper_ch_offset = offset;
drivers/staging/r8188eu/include/rtw_mlme_ext.h +0 -1
index b3ca9f3fba7f..fe3a32f17308 100644
@@ -448,7 +448,6 @@ void Set_MSR(struct adapter *padapter, u8 type);
 u8 rtw_get_oper_ch(struct adapter *adapter);
 void rtw_set_oper_ch(struct adapter *adapter, u8 ch);
 void rtw_set_oper_bw(struct adapter *adapter, u8 bw);
-u8 rtw_get_oper_choffset(struct adapter *adapter);
 void rtw_set_oper_choffset(struct adapter *adapter, u8 offset);
 
 void set_channel_bwmode(struct adapter *padapter, unsigned char channel,
Signature · 1 line
2.32.0
#3 lore raw

PATCH 3/6 staging: r8188eu: remove get_bsstype()

In reply to Michael Straube

Function get_bsstype() is unused, remove it.

---
 drivers/staging/r8188eu/core/rtw_wlan_util.c   | 10 ----------
 drivers/staging/r8188eu/include/rtw_mlme_ext.h |  1 -
 2 files changed, 11 deletions(-)
drivers/staging/r8188eu/core/rtw_wlan_util.c +0 -10
index 57330b3a66d7..bc10a08d01e6 100644
@@ -363,16 +363,6 @@ void set_channel_bwmode(struct adapter *padapter, unsigned char channel, unsigne
 	SetBWMode(padapter, bwmode, channel_offset);
 }
 
-int get_bsstype(unsigned short capability)
-{
-	if (capability & BIT(0))
-		return WIFI_FW_AP_STATE;
-	else if (capability & BIT(1))
-		return WIFI_FW_ADHOC_STATE;
-	else
-		return 0;
-}
-
 __inline u8 *get_my_bssid(struct wlan_bssid_ex *pnetwork)
 {
 	return pnetwork->MacAddress;
drivers/staging/r8188eu/include/rtw_mlme_ext.h +0 -1
index fe3a32f17308..c6b17da73c5f 100644
@@ -473,7 +473,6 @@ u8 collect_bss_info(struct adapter *padapter, struct recv_frame *precv_frame,
 void update_network(struct wlan_bssid_ex *dst, struct wlan_bssid_ex *src,
 		    struct adapter *adapter, bool update_ie);
 
-int get_bsstype(unsigned short capability);
 u8 *get_my_bssid(struct wlan_bssid_ex *pnetwork);
 u16 get_beacon_interval(struct wlan_bssid_ex *bss);
 
Signature · 1 line
2.32.0
#4 lore raw

PATCH 4/6 staging: r8188eu: remove CAM_empty_entry()

In reply to Michael Straube

Function CAM_empty_entry() is unused, remove it.

---
 drivers/staging/r8188eu/core/rtw_wlan_util.c   | 5 -----
 drivers/staging/r8188eu/include/rtw_mlme_ext.h | 1 -
 2 files changed, 6 deletions(-)
drivers/staging/r8188eu/core/rtw_wlan_util.c +0 -5
index bc10a08d01e6..ddc84f6b74e2 100644
@@ -427,11 +427,6 @@ unsigned int decide_wait_for_beacon_timeout(unsigned int bcn_interval)
 		return bcn_interval << 2;
 }
 
-void CAM_empty_entry(struct adapter *Adapter, u8 ucIndex)
-{
-	rtw_hal_set_hwreg(Adapter, HW_VAR_CAM_EMPTY_ENTRY, (u8 *)(&ucIndex));
-}
-
 void invalidate_cam_all(struct adapter *padapter)
 {
 	rtw_hal_set_hwreg(padapter, HW_VAR_CAM_INVALID_ALL, NULL);
drivers/staging/r8188eu/include/rtw_mlme_ext.h +0 -1
index c6b17da73c5f..01f770d02e5f 100644
@@ -462,7 +462,6 @@ void write_cam(struct adapter *padapter, u8 entry, u16 ctrl, u8 *mac, u8 *key);
 void clear_cam_entry(struct adapter *padapter, u8 entry);
 
 void invalidate_cam_all(struct adapter *padapter);
-void CAM_empty_entry(struct adapter * Adapter, u8 ucIndex);
 
 int allocate_fw_sta_entry(struct adapter *padapter);
 void flush_all_cam_entry(struct adapter *padapter);
Signature · 1 line
2.32.0
#5 lore raw

PATCH 5/6 staging: r8188eu: remove is_ap_in_wep()

In reply to Michael Straube

Function is_ap_in_wep() is unused, remove it.

---
 drivers/staging/r8188eu/core/rtw_wlan_util.c  | 30 -------------------
 .../staging/r8188eu/include/rtw_mlme_ext.h    |  1 -
 2 files changed, 31 deletions(-)
drivers/staging/r8188eu/core/rtw_wlan_util.c +0 -30
index ddc84f6b74e2..8491d82f4a70 100644
@@ -1134,36 +1134,6 @@ unsigned int should_forbid_n_rate(struct adapter *padapter)
 	}
 }
 
-unsigned int is_ap_in_wep(struct adapter *padapter)
-{
-	u32 i;
-	struct ndis_802_11_var_ie *pIE;
-	struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
-	struct mlme_ext_info	*pmlmeinfo = &pmlmeext->mlmext_info;
-	struct wlan_bssid_ex		*cur_network = &pmlmeinfo->network;
-
-	if (rtw_get_capability((struct wlan_bssid_ex *)cur_network) & WLAN_CAPABILITY_PRIVACY) {
-		for (i = sizeof(struct ndis_802_11_fixed_ie); i < pmlmeinfo->network.IELength;) {
-			pIE = (struct ndis_802_11_var_ie *)(pmlmeinfo->network.IEs + i);
-
-			switch (pIE->ElementID) {
-			case _VENDOR_SPECIFIC_IE_:
-				if (!memcmp(pIE->data, RTW_WPA_OUI, 4))
-					return false;
-				break;
-			case _RSN_IE_2_:
-				return false;
-			default:
-				break;
-			}
-			i += (pIE->Length + 2);
-		}
-		return true;
-	} else {
-		return false;
-	}
-}
-
 int wifirate2_ratetbl_inx(unsigned char rate)
 {
 	int	inx = 0;
drivers/staging/r8188eu/include/rtw_mlme_ext.h +0 -1
index 01f770d02e5f..1695a9695ddf 100644
@@ -516,7 +516,6 @@ unsigned int receive_disconnect(struct adapter *padapter,
 unsigned char get_highest_rate_idx(u32 mask);
 int support_short_GI(struct adapter *padapter, struct HT_caps_element *caps);
 unsigned int is_ap_in_tkip(struct adapter *padapter);
-unsigned int is_ap_in_wep(struct adapter *padapter);
 unsigned int should_forbid_n_rate(struct adapter *padapter);
 
 void report_join_res(struct adapter *padapter, int res);
Signature · 1 line
2.32.0
#6 lore raw

PATCH 6/6 staging: r8188eu: remove should_forbid_n_rate()

In reply to Michael Straube

Function should_forbid_n_rate() is unused, remove it.

---
 drivers/staging/r8188eu/core/rtw_wlan_util.c  | 36 -------------------
 .../staging/r8188eu/include/rtw_mlme_ext.h    |  1 -
 2 files changed, 37 deletions(-)
drivers/staging/r8188eu/core/rtw_wlan_util.c +0 -36
index 8491d82f4a70..ccb5fbbc3ffb 100644
@@ -1098,42 +1098,6 @@ unsigned int is_ap_in_tkip(struct adapter *padapter)
 	}
 }
 
-unsigned int should_forbid_n_rate(struct adapter *padapter)
-{
-	u32 i;
-	struct ndis_802_11_var_ie *pIE;
-	struct mlme_priv	*pmlmepriv = &padapter->mlmepriv;
-	struct wlan_bssid_ex  *cur_network = &pmlmepriv->cur_network.network;
-
-	if (rtw_get_capability((struct wlan_bssid_ex *)cur_network) & WLAN_CAPABILITY_PRIVACY) {
-		for (i = sizeof(struct ndis_802_11_fixed_ie); i < cur_network->IELength;) {
-			pIE = (struct ndis_802_11_var_ie *)(cur_network->IEs + i);
-
-			switch (pIE->ElementID) {
-			case _VENDOR_SPECIFIC_IE_:
-				if (!memcmp(pIE->data, RTW_WPA_OUI, 4) &&
-				    ((!memcmp((pIE->data + 12), WPA_CIPHER_SUITE_CCMP, 4)) ||
-				    (!memcmp((pIE->data + 16), WPA_CIPHER_SUITE_CCMP, 4))))
-					return false;
-				break;
-			case _RSN_IE_2_:
-				if  ((!memcmp((pIE->data + 8), RSN_CIPHER_SUITE_CCMP, 4))  ||
-				     (!memcmp((pIE->data + 12), RSN_CIPHER_SUITE_CCMP, 4)))
-					return false;
-				break;
-			default:
-				break;
-			}
-
-			i += (pIE->Length + 2);
-		}
-
-		return true;
-	} else {
-		return false;
-	}
-}
-
 int wifirate2_ratetbl_inx(unsigned char rate)
 {
 	int	inx = 0;
drivers/staging/r8188eu/include/rtw_mlme_ext.h +0 -1
index 1695a9695ddf..e15e2cec77bd 100644
@@ -516,7 +516,6 @@ unsigned int receive_disconnect(struct adapter *padapter,
 unsigned char get_highest_rate_idx(u32 mask);
 int support_short_GI(struct adapter *padapter, struct HT_caps_element *caps);
 unsigned int is_ap_in_tkip(struct adapter *padapter);
-unsigned int should_forbid_n_rate(struct adapter *padapter);
 
 void report_join_res(struct adapter *padapter, int res);
 void report_survey_event(struct adapter *padapter, struct recv_frame *precv_frame);
Signature · 1 line
2.32.0
Acked-by on the v1 series
#7 lore raw
In reply to Michael Straube
Quoted 11 lines · Michael Straube

This series removes unused functions from core/rtw_wlan_util.c.

Michael Straube (6):
staging: r8188eu: remove rtw_get_oper_bw()
staging: r8188eu: remove rtw_get_oper_choffset()
staging: r8188eu: remove get_bsstype()
staging: r8188eu: remove CAM_empty_entry()
staging: r8188eu: remove is_ap_in_wep()
staging: r8188eu: remove should_forbid_n_rate()

Quoted 7 lines
 drivers/staging/r8188eu/core/rtw_wlan_util.c  | 91 -------------------
 .../staging/r8188eu/include/rtw_mlme_ext.h    |  6 --
 2 files changed, 97 deletions(-)

--
2.32.0

Dear Michael,

Looks good and builds/runs fine for me, many thanks.

Regards,
Phil