From: Michael Straube <straube.linux@gmail.com>
To: gregkh@linuxfoundation.org
Cc: hdegoede@redhat.com, Larry.Finger@lwfinger.net,
linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org,
Michael Straube <straube.linux@gmail.com>
Subject: [PATCH v2 7/8] staging: rtl8723bs: move rtw_report_sec_ie to core/rtw_mlme.c
Date: Fri, 1 Aug 2025 10:31:30 +0200 [thread overview]
Message-ID: <20250801083131.82915-8-straube.linux@gmail.com> (raw)
In-Reply-To: <20250801083131.82915-1-straube.linux@gmail.com>
Move the function rtw_report_sec_ie from os_dep/mlme_linux.c to
core/rtw_mlme.c to reduce code in the os_dep directory.
Signed-off-by: Michael Straube <straube.linux@gmail.com>
---
v1 -> v2: no changes
drivers/staging/rtl8723bs/core/rtw_mlme.c | 34 +++++++++++++++++++
.../staging/rtl8723bs/include/mlme_osdep.h | 2 --
drivers/staging/rtl8723bs/os_dep/mlme_linux.c | 34 -------------------
3 files changed, 34 insertions(+), 36 deletions(-)
diff --git a/drivers/staging/rtl8723bs/core/rtw_mlme.c b/drivers/staging/rtl8723bs/core/rtw_mlme.c
index 839496aef933..4c816fb2500b 100644
--- a/drivers/staging/rtl8723bs/core/rtw_mlme.c
+++ b/drivers/staging/rtl8723bs/core/rtw_mlme.c
@@ -2033,6 +2033,40 @@ static int rtw_append_pmkid(struct adapter *Adapter, int iEntry, u8 *ie, uint ie
return ie_len;
}
+static void rtw_report_sec_ie(struct adapter *adapter, u8 authmode, u8 *sec_ie)
+{
+ uint len;
+ u8 *buff, *p, i;
+ union iwreq_data wrqu;
+
+ buff = NULL;
+ if (authmode == WLAN_EID_VENDOR_SPECIFIC) {
+ buff = rtw_zmalloc(IW_CUSTOM_MAX);
+ if (!buff)
+ return;
+
+ p = buff;
+
+ p += scnprintf(p, IW_CUSTOM_MAX - (p - buff), "ASSOCINFO(ReqIEs =");
+
+ len = sec_ie[1] + 2;
+ len = (len < IW_CUSTOM_MAX) ? len : IW_CUSTOM_MAX;
+
+ for (i = 0; i < len; i++)
+ p += scnprintf(p, IW_CUSTOM_MAX - (p - buff), "%02x", sec_ie[i]);
+
+ p += scnprintf(p, IW_CUSTOM_MAX - (p - buff), ")");
+
+ memset(&wrqu, 0, sizeof(wrqu));
+
+ wrqu.data.length = p - buff;
+
+ wrqu.data.length = (wrqu.data.length < IW_CUSTOM_MAX) ? wrqu.data.length : IW_CUSTOM_MAX;
+
+ kfree(buff);
+ }
+}
+
signed int rtw_restruct_sec_ie(struct adapter *adapter, u8 *in_ie, u8 *out_ie, uint in_len)
{
u8 authmode = 0x0;
diff --git a/drivers/staging/rtl8723bs/include/mlme_osdep.h b/drivers/staging/rtl8723bs/include/mlme_osdep.h
index 8e8b5de285dc..3930d9e6dab7 100644
--- a/drivers/staging/rtl8723bs/include/mlme_osdep.h
+++ b/drivers/staging/rtl8723bs/include/mlme_osdep.h
@@ -8,8 +8,6 @@
#define __MLME_OSDEP_H_
-extern void rtw_report_sec_ie(struct adapter *adapter, u8 authmode, u8 *sec_ie);
-
void rtw_reset_securitypriv(struct adapter *adapter);
#endif /* _MLME_OSDEP_H_ */
diff --git a/drivers/staging/rtl8723bs/os_dep/mlme_linux.c b/drivers/staging/rtl8723bs/os_dep/mlme_linux.c
index d2f4855e9d9d..918d9496d7cc 100644
--- a/drivers/staging/rtl8723bs/os_dep/mlme_linux.c
+++ b/drivers/staging/rtl8723bs/os_dep/mlme_linux.c
@@ -65,37 +65,3 @@ void rtw_reset_securitypriv(struct adapter *adapter)
/* add for CONFIG_IEEE80211W, none 11w also can use */
spin_unlock_bh(&adapter->security_key_mutex);
}
-
-void rtw_report_sec_ie(struct adapter *adapter, u8 authmode, u8 *sec_ie)
-{
- uint len;
- u8 *buff, *p, i;
- union iwreq_data wrqu;
-
- buff = NULL;
- if (authmode == WLAN_EID_VENDOR_SPECIFIC) {
- buff = rtw_zmalloc(IW_CUSTOM_MAX);
- if (!buff)
- return;
-
- p = buff;
-
- p += scnprintf(p, IW_CUSTOM_MAX - (p - buff), "ASSOCINFO(ReqIEs =");
-
- len = sec_ie[1] + 2;
- len = (len < IW_CUSTOM_MAX) ? len : IW_CUSTOM_MAX;
-
- for (i = 0; i < len; i++)
- p += scnprintf(p, IW_CUSTOM_MAX - (p - buff), "%02x", sec_ie[i]);
-
- p += scnprintf(p, IW_CUSTOM_MAX - (p - buff), ")");
-
- memset(&wrqu, 0, sizeof(wrqu));
-
- wrqu.data.length = p - buff;
-
- wrqu.data.length = (wrqu.data.length < IW_CUSTOM_MAX) ? wrqu.data.length : IW_CUSTOM_MAX;
-
- kfree(buff);
- }
-}
--
2.50.1
next prev parent reply other threads:[~2025-08-01 8:32 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-01 8:31 [PATCH v2 0/8] staging: rtl8723bs: get rid of os_dep/mlme_linux.c Michael Straube
2025-08-01 8:31 ` [PATCH v2 1/8] staging: rtl8723bs: remove wrapper rtw_os_indicate_scan_done Michael Straube
2025-08-01 8:31 ` [PATCH v2 2/8] staging: rtl8723bs: move init_mlme_ext_timer to core/rtw_mlme_ext.c Michael Straube
2025-08-01 8:31 ` [PATCH v2 3/8] staging: rtl8723bs: move rtw_init_mlme_timer to core/rtw_mlme.c Michael Straube
2025-08-01 8:31 ` [PATCH v2 4/8] staging: rtl8723bs: remove wrapper init_addba_retry_timer Michael Straube
2025-08-01 8:31 ` [PATCH v2 5/8] staging: rtl8723bs: merge rtw_os_indicate_connect into rtw_indicate_connect Michael Straube
2025-08-01 8:31 ` [PATCH v2 6/8] staging: rtl8723bs: merge rtw_os_indicate_disconnect into rtw_indicate_disconnect Michael Straube
2025-08-01 8:31 ` Michael Straube [this message]
2025-08-01 8:31 ` [PATCH v2 8/8] staging: rtl8723bs: move rtw_reset_securitypriv to core/rtw_mlme.c Michael Straube
2025-08-05 11:02 ` [PATCH v2 0/8] staging: rtl8723bs: get rid of os_dep/mlme_linux.c Hans de Goede
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250801083131.82915-8-straube.linux@gmail.com \
--to=straube.linux@gmail.com \
--cc=Larry.Finger@lwfinger.net \
--cc=gregkh@linuxfoundation.org \
--cc=hdegoede@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-staging@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.