[PATCH 4/4] staging: rtl8723bs: coalesce issue_probereq functions into a single one

From: Leonardo Martins Martins

Date: Thu Sep 03 2026 - 01:20:28 EST


The function _issue_probereq() and its wrappers issue_probereq() and
issue_probereq_ex() have a difference of a single parameter in how
they're called, which is the value of append_wps - 0 for
issue_probereq_ex() and 1 for issue_probereq() - meaning that these
wrappers don't bring much value, remove both of them, rename
_issue_probereq() to issue_probereq(), and replace the usages of the
wrappers with the unified function (with the value of append_wps added,
with true and false instead of 1 and 0 since it's a bool).

issue_probereq() and issue_probereq_ex() are not used in any other file
so the unified function was not added to the header file and kept the
static type.

Signed-off-by: Leonardo Martins Martins <dev.lmmrtns@xxxxxxxxx>
---
drivers/staging/rtl8723bs/core/rtw_mlme_ext.c | 54 +++++++++++-------------
drivers/staging/rtl8723bs/include/rtw_mlme_ext.h | 2 -
2 files changed, 25 insertions(+), 31 deletions(-)

diff --git a/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c b/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c
index b3642c5021a230bd70e5d8fd8d5bf77ad1d8946a..c39fb142302edf267edca31babce40120c74451e 100644
--- a/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c
+++ b/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c
@@ -2401,8 +2401,8 @@ void issue_probersp(struct adapter *padapter, unsigned char *da, u8 is_valid_p2p
dump_mgntframe(padapter, pmgntframe);
}

-static void _issue_probereq(struct adapter *padapter, struct ndis_802_11_ssid *pssid, u8 *da,
- bool append_wps)
+static void issue_probereq(struct adapter *padapter, struct ndis_802_11_ssid *pssid, u8 *da,
+ bool append_wps)
{
struct xmit_frame *pmgntframe;
struct pkt_attrib *pattrib;
@@ -2481,16 +2481,6 @@ static void _issue_probereq(struct adapter *padapter, struct ndis_802_11_ssid *p
dump_mgntframe(padapter, pmgntframe);
}

-inline void issue_probereq(struct adapter *padapter, struct ndis_802_11_ssid *pssid, u8 *da)
-{
- _issue_probereq(padapter, pssid, da, 1);
-}
-
-void issue_probereq_ex(struct adapter *padapter, struct ndis_802_11_ssid *pssid, u8 *da)
-{
- _issue_probereq(padapter, pssid, da, 0);
-}
-
/* if psta == NULL, indicate we are station(client) now... */
void issue_auth(struct adapter *padapter, struct sta_info *psta, unsigned short status)
{
@@ -3727,22 +3717,25 @@ void site_survey(struct adapter *padapter)

/* IOT issue, When wifi_spec is not set, send one probe req without WPS IE. */
if (padapter->registrypriv.wifi_spec)
- issue_probereq(padapter, &(pmlmeext->sitesurvey_res.ssid[i]), NULL);
+ issue_probereq(padapter,
+ &pmlmeext->sitesurvey_res.ssid[i],
+ NULL, true);
else
- issue_probereq_ex(padapter,
- &pmlmeext->sitesurvey_res.ssid[i],
- NULL);
+ issue_probereq(padapter,
+ &pmlmeext->sitesurvey_res.ssid[i],
+ NULL, false);

- issue_probereq(padapter, &(pmlmeext->sitesurvey_res.ssid[i]), NULL);
+ issue_probereq(padapter, &pmlmeext->sitesurvey_res.ssid[i],
+ NULL, true);
}

if (pmlmeext->sitesurvey_res.scan_mode == SCAN_ACTIVE) {
/* IOT issue, When wifi_spec is not set, send one probe req without WPS IE. */
if (padapter->registrypriv.wifi_spec)
- issue_probereq(padapter, NULL, NULL);
+ issue_probereq(padapter, NULL, NULL, true);
else
- issue_probereq_ex(padapter, NULL, NULL);
- issue_probereq(padapter, NULL, NULL);
+ issue_probereq(padapter, NULL, NULL, false);
+ issue_probereq(padapter, NULL, NULL, true);
}
}
}
@@ -4860,15 +4853,18 @@ void linked_status_chk(struct adapter *padapter)
{
if (rx_chk != _SUCCESS) {
if (pmlmeext->retry == 0) {
- issue_probereq_ex(padapter,
- &pmlmeinfo->network.ssid,
- pmlmeinfo->network.mac_address);
- issue_probereq_ex(padapter,
- &pmlmeinfo->network.ssid,
- pmlmeinfo->network.mac_address);
- issue_probereq_ex(padapter,
- &pmlmeinfo->network.ssid,
- pmlmeinfo->network.mac_address);
+ issue_probereq(padapter,
+ &pmlmeinfo->network.ssid,
+ pmlmeinfo->network.mac_address,
+ false);
+ issue_probereq(padapter,
+ &pmlmeinfo->network.ssid,
+ pmlmeinfo->network.mac_address,
+ false);
+ issue_probereq(padapter,
+ &pmlmeinfo->network.ssid,
+ pmlmeinfo->network.mac_address,
+ false);
}
}

diff --git a/drivers/staging/rtl8723bs/include/rtw_mlme_ext.h b/drivers/staging/rtl8723bs/include/rtw_mlme_ext.h
index 8e35aabb0ccf96a2bb0c1208db8ad74598a687e0..d486cd462509e9d43d43a7d6718a3bb3935df52d 100644
--- a/drivers/staging/rtl8723bs/include/rtw_mlme_ext.h
+++ b/drivers/staging/rtl8723bs/include/rtw_mlme_ext.h
@@ -541,8 +541,6 @@ void issue_probersp(struct adapter *padapter, unsigned char *da, u8 is_valid_p2p
void issue_assocreq(struct adapter *padapter);
void issue_asocrsp(struct adapter *padapter, unsigned short status, struct sta_info *pstat, int pkt_type);
void issue_auth(struct adapter *padapter, struct sta_info *psta, unsigned short status);
-void issue_probereq(struct adapter *padapter, struct ndis_802_11_ssid *pssid, u8 *da);
-void issue_probereq_ex(struct adapter *padapter, struct ndis_802_11_ssid *pssid, u8 *da);
int issue_nulldata(struct adapter *padapter, unsigned char *da, unsigned int power_mode, int try_cnt, int wait_ms);
s32 issue_nulldata_in_interrupt(struct adapter *padapter, u8 *da);
int issue_qos_nulldata(struct adapter *padapter, unsigned char *da, u16 tid, int try_cnt, int wait_ms);

--
2.47.3