linux-staging.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
From: Michael Straube <straube.linux@gmail.com>
To: gregkh@linuxfoundation.org
Cc: Larry.Finger@lwfinger.net, phil@philpotter.co.uk,
	linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org,
	Michael Straube <straube.linux@gmail.com>
Subject: [PATCH 37/47] staging: r8188eu: remove rtw_ies_remove_ie()
Date: Wed, 22 Sep 2021 22:04:10 +0200	[thread overview]
Message-ID: <20210922200420.9693-38-straube.linux@gmail.com> (raw)
In-Reply-To: <20210922200420.9693-1-straube.linux@gmail.com>

Function rtw_ies_remove_ie() is not used, remove it. It is the only
user of rtw_get_ie_ex(), remove that function as well.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
---
 drivers/staging/r8188eu/core/rtw_ieee80211.c | 90 --------------------
 drivers/staging/r8188eu/include/ieee80211.h  |  4 -
 2 files changed, 94 deletions(-)

diff --git a/drivers/staging/r8188eu/core/rtw_ieee80211.c b/drivers/staging/r8188eu/core/rtw_ieee80211.c
index bc7ab84c0e05..b2a376867c54 100644
--- a/drivers/staging/r8188eu/core/rtw_ieee80211.c
+++ b/drivers/staging/r8188eu/core/rtw_ieee80211.c
@@ -201,96 +201,6 @@ u8 *rtw_get_ie(u8 *pbuf, int index, int *len, int limit)
 	return NULL;
 }
 
-/**
- * rtw_get_ie_ex - Search specific IE from a series of IEs
- * @in_ie: Address of IEs to search
- * @in_len: Length limit from in_ie
- * @eid: Element ID to match
- * @oui: OUI to match
- * @oui_len: OUI length
- * @ie: If not NULL and the specific IE is found, the IE will be copied to the buf starting from the specific IE
- * @ielen: If not NULL and the specific IE is found, will set to the length of the entire IE
- *
- * Returns: The address of the specific IE found, or NULL
- */
-u8 *rtw_get_ie_ex(u8 *in_ie, uint in_len, u8 eid, u8 *oui, u8 oui_len, u8 *ie, uint *ielen)
-{
-	uint cnt;
-	u8 *target_ie = NULL;
-
-	if (ielen)
-		*ielen = 0;
-
-	if (!in_ie || in_len <= 0)
-		return target_ie;
-
-	cnt = 0;
-
-	while (cnt < in_len) {
-		if (eid == in_ie[cnt] && (!oui || !memcmp(&in_ie[cnt + 2], oui, oui_len))) {
-			target_ie = &in_ie[cnt];
-
-			if (ie)
-				memcpy(ie, &in_ie[cnt], in_ie[cnt + 1] + 2);
-
-			if (ielen)
-				*ielen = in_ie[cnt + 1] + 2;
-
-			break;
-		} else {
-			cnt += in_ie[cnt + 1] + 2; /* goto next */
-		}
-	}
-	return target_ie;
-}
-
-/**
- * rtw_ies_remove_ie - Find matching IEs and remove
- * @ies: Address of IEs to search
- * @ies_len: Pointer of length of ies, will update to new length
- * @offset: The offset to start scarch
- * @eid: Element ID to match
- * @oui: OUI to match
- * @oui_len: OUI length
- *
- * Returns: _SUCCESS: ies is updated, _FAIL: not updated
- */
-int rtw_ies_remove_ie(u8 *ies, uint *ies_len, uint offset, u8 eid, u8 *oui, u8 oui_len)
-{
-	int ret = _FAIL;
-	u8 *target_ie;
-	u32 target_ielen;
-	u8 *start;
-	uint search_len;
-
-	if (!ies || !ies_len || *ies_len <= offset)
-		goto exit;
-
-	start = ies + offset;
-	search_len = *ies_len - offset;
-
-	while (1) {
-		target_ie = rtw_get_ie_ex(start, search_len, eid, oui, oui_len, NULL, &target_ielen);
-		if (target_ie && target_ielen) {
-			u8 buf[MAX_IE_SZ] = {0};
-			u8 *remain_ies = target_ie + target_ielen;
-			uint remain_len = search_len - (remain_ies - start);
-
-			memcpy(buf, remain_ies, remain_len);
-			memcpy(target_ie, buf, remain_len);
-			*ies_len = *ies_len - target_ielen;
-			ret = _SUCCESS;
-
-			start = target_ie;
-			search_len = remain_len;
-		} else {
-			break;
-		}
-	}
-exit:
-	return ret;
-}
-
 void rtw_set_supported_rate(u8 *SupportedRates, uint mode)
 {
 
diff --git a/drivers/staging/r8188eu/include/ieee80211.h b/drivers/staging/r8188eu/include/ieee80211.h
index 36c95adb9d85..65e21d5d5b46 100644
--- a/drivers/staging/r8188eu/include/ieee80211.h
+++ b/drivers/staging/r8188eu/include/ieee80211.h
@@ -1103,10 +1103,6 @@ u8 *rtw_set_ie_mesh_ch_switch_parm(u8 *buf, u32 *buf_len, u8 ttl,
 				   u8 flags, u16 reason, u16 precedence);
 
 u8 *rtw_get_ie(u8 *pbuf, int index, int *len, int limit);
-u8 *rtw_get_ie_ex(u8 *in_ie, uint in_len, u8 eid, u8 *oui,
-		  u8 oui_len, u8 *ie, uint *ielen);
-int rtw_ies_remove_ie(u8 *ies, uint *ies_len, uint offset,
-		      u8 eid, u8 *oui, u8 oui_len);
 
 void rtw_set_supported_rate(u8 *SupportedRates, uint mode);
 
-- 
2.33.0


  parent reply	other threads:[~2021-09-22 20:05 UTC|newest]

Thread overview: 48+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-22 20:03 [PATCH 00/47] staging: r8188eu: remove unused functions Michael Straube
2021-09-22 20:03 ` [PATCH 01/47] staging: r8188eu: remove EFUSE_ShadowRead() Michael Straube
2021-09-22 20:03 ` [PATCH 02/47] staging: r8188eu: remove efuse_GetCurrentSize() Michael Straube
2021-09-22 20:03 ` [PATCH 03/47] staging: r8188eu: remove efuse_GetMaxSize() Michael Straube
2021-09-22 20:03 ` [PATCH 04/47] staging: r8188eu: remove rtw_BT_efuse_map_write() Michael Straube
2021-09-22 20:03 ` [PATCH 05/47] staging: r8188eu: remove rtw_efuse_access() Michael Straube
2021-09-22 20:03 ` [PATCH 06/47] staging: r8188eu: remove rtw_efuse_map_write() Michael Straube
2021-09-22 20:03 ` [PATCH 07/47] staging: r8188eu: remove rtw_BT_efuse_map_read() Michael Straube
2021-09-22 20:03 ` [PATCH 08/47] staging: r8188eu: remove rtw_efuse_map_read() Michael Straube
2021-09-22 20:03 ` [PATCH 09/47] staging: r8188eu: remove _rtw_dequeue_network() Michael Straube
2021-09-22 20:03 ` [PATCH 10/47] staging: r8188eu: remove _rtw_enqueue_network() Michael Straube
2021-09-22 20:03 ` [PATCH 11/47] staging: r8188eu: remove rtw_get_timestampe_from_ie() Michael Straube
2021-09-22 20:03 ` [PATCH 12/47] staging: r8188eu: remove rtw_scan_abort() Michael Straube
2021-09-22 20:03 ` [PATCH 13/47] staging: r8188eu: remove issue_action_spct_ch_switch() Michael Straube
2021-09-22 20:03 ` [PATCH 14/47] staging: r8188eu: remove issue_probereq_p2p_ex() Michael Straube
2021-09-22 20:03 ` [PATCH 15/47] staging: r8188eu: remove sreset_get_wifi_status() Michael Straube
2021-09-22 20:03 ` [PATCH 16/47] staging: r8188eu: remove build_deauth_p2p_ie() Michael Straube
2021-09-22 20:03 ` [PATCH 17/47] staging: r8188eu: remove rtw_freq2ch() Michael Straube
2021-09-22 20:03 ` [PATCH 18/47] staging: r8188eu: remove rtw_set_802_11_add_key() Michael Straube
2021-09-22 20:03 ` [PATCH 19/47] staging: r8188eu: remove rtw_set_802_11_remove_key() Michael Straube
2021-09-22 20:03 ` [PATCH 20/47] staging: r8188eu: remove rtw_set_802_11_remove_wep() Michael Straube
2021-09-22 20:03 ` [PATCH 21/47] staging: r8188eu: remove rtw_set_country() Michael Straube
2021-09-22 20:03 ` [PATCH 22/47] staging: r8188eu: remove rtw_set_scan_mode() Michael Straube
2021-09-22 20:03 ` [PATCH 23/47] staging: r8188eu: remove rtw_validate_ssid() Michael Straube
2021-09-22 20:03 ` [PATCH 24/47] staging: r8188eu: remove rtw_set_channel_plan() Michael Straube
2021-09-22 20:03 ` [PATCH 25/47] staging: r8188eu: remove rtw_atoi() Michael Straube
2021-09-22 20:03 ` [PATCH 26/47] staging: r8188eu: remove rtw_cbuf_push() Michael Straube
2021-09-22 20:04 ` [PATCH 27/47] staging: r8188eu: remove rtw_cbuf_full() Michael Straube
2021-09-22 20:04 ` [PATCH 28/47] staging: r8188eu: remove rtw_os_read_port() Michael Straube
2021-09-22 20:04 ` [PATCH 29/47] staging: r8188eu: remove rtw_IOL_cmd_buf_dump() Michael Straube
2021-09-22 20:04 ` [PATCH 30/47] staging: r8188eu: remove action_public_str() Michael Straube
2021-09-22 20:04 ` [PATCH 31/47] staging: r8188eu: remove dump_ies() Michael Straube
2021-09-22 20:04 ` [PATCH 32/47] staging: r8188eu: remove hal_ch_offset_to_secondary_ch_offset() Michael Straube
2021-09-22 20:04 ` [PATCH 33/47] staging: r8188eu: remove secondary_ch_offset_to_hal_ch_offset() Michael Straube
2021-09-22 20:04 ` [PATCH 34/47] staging: r8188eu: remove ieee80211_get_hdrlen() Michael Straube
2021-09-22 20:04 ` [PATCH 35/47] staging: r8188eu: remove ieee80211_is_empty_essid() Michael Straube
2021-09-22 20:04 ` [PATCH 36/47] staging: r8188eu: remove rtw_action_frame_parse() Michael Straube
2021-09-22 20:04 ` Michael Straube [this message]
2021-09-22 20:04 ` [PATCH 38/47] staging: r8188eu: remove rtw_set_ie_ch_switch() Michael Straube
2021-09-22 20:04 ` [PATCH 39/47] staging: r8188eu: remove rtw_set_ie_mesh_ch_switch_parm() Michael Straube
2021-09-22 20:04 ` [PATCH 40/47] staging: r8188eu: remove rtw_set_ie_secondary_ch_offset() Michael Straube
2021-09-22 20:04 ` [PATCH 41/47] staging: r8188eu: remove enum secondary_ch_offset Michael Straube
2021-09-22 20:04 ` [PATCH 42/47] staging: r8188eu: remove rtw_dequeue_recvbuf() Michael Straube
2021-09-22 20:04 ` [PATCH 43/47] staging: r8188eu: remove rtw_enqueue_recvbuf() Michael Straube
2021-09-22 20:04 ` [PATCH 44/47] staging: r8188eu: remove rtw_enqueue_recvbuf_to_head() Michael Straube
2021-09-22 20:04 ` [PATCH 45/47] staging: r8188eu: remove rtw_init_recvframe() Michael Straube
2021-09-22 20:04 ` [PATCH 46/47] staging: r8188eu: remove rtw_calculate_wlan_pkt_size_by_attribue() Michael Straube
2021-09-22 20:04 ` [PATCH 47/47] staging: r8188eu: remove rtw_sctx_done() Michael Straube

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=20210922200420.9693-38-straube.linux@gmail.com \
    --to=straube.linux@gmail.com \
    --cc=Larry.Finger@lwfinger.net \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-staging@lists.linux.dev \
    --cc=phil@philpotter.co.uk \
    /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 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).