From: Martin Kaiser <martin@kaiser.cx>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Larry Finger <Larry.Finger@lwfinger.net>,
Phillip Potter <phil@philpotter.co.uk>,
Michael Straube <straube.linux@gmail.com>,
linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org,
David Laight <David.Laight@ACULAB.COM>,
Martin Kaiser <martin@kaiser.cx>
Subject: [PATCH v2 9/9] staging: r8188eu: use ieee80211 define for fragment number
Date: Sun, 27 Mar 2022 20:09:44 +0200 [thread overview]
Message-ID: <20220327180944.712545-10-martin@kaiser.cx> (raw)
In-Reply-To: <20220327180944.712545-1-martin@kaiser.cx>
Use the IEEE80211_SCTL_FRAG define to extract the fragment number from an
incoming frame.
pattrib->frag_num must be in host endianness, we have to convert
hdr->seq_ctrl, this field is little-endian.
Remove the local GetFragNum macro, it is not used any more.
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
---
drivers/staging/r8188eu/core/rtw_recv.c | 2 +-
drivers/staging/r8188eu/include/wifi.h | 3 ---
2 files changed, 1 insertion(+), 4 deletions(-)
diff --git a/drivers/staging/r8188eu/core/rtw_recv.c b/drivers/staging/r8188eu/core/rtw_recv.c
index 415747da7e3b..62cf2df90073 100644
--- a/drivers/staging/r8188eu/core/rtw_recv.c
+++ b/drivers/staging/r8188eu/core/rtw_recv.c
@@ -1077,7 +1077,7 @@ static int validate_recv_frame(struct adapter *adapter, struct recv_frame *precv
pattrib->to_fr_ds = get_tofr_ds(ptr);
- pattrib->frag_num = GetFragNum(ptr);
+ pattrib->frag_num = le16_to_cpu(hdr->seq_ctrl) & IEEE80211_SCTL_FRAG;
pattrib->seq_num = IEEE80211_SEQ_TO_SN(le16_to_cpu(hdr->seq_ctrl));
pattrib->pw_save = ieee80211_has_pm(hdr->frame_control);
diff --git a/drivers/staging/r8188eu/include/wifi.h b/drivers/staging/r8188eu/include/wifi.h
index dbda1880c45a..e10cf17d6aa0 100644
--- a/drivers/staging/r8188eu/include/wifi.h
+++ b/drivers/staging/r8188eu/include/wifi.h
@@ -189,9 +189,6 @@ enum WIFI_REG_DOMAIN {
*(__le16 *)(pbuf) |= cpu_to_le16(type); \
} while (0)
-#define GetFragNum(pbuf) \
- (le16_to_cpu(*(__le16 *)((size_t)(pbuf) + 22)) & 0x0f)
-
#define GetTupleCache(pbuf) \
(cpu_to_le16(*(unsigned short *)((size_t)(pbuf) + 22)))
--
2.30.2
prev parent reply other threads:[~2022-03-27 18:10 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-23 7:48 [PATCH 0/7] staging: r8188eu: use ieee80211 helpers for parsing Martin Kaiser
2022-03-23 7:48 ` [PATCH 1/7] staging: r8188eu: use ieee80211 define for version check Martin Kaiser
2022-03-23 14:28 ` David Laight
2022-03-27 18:19 ` Martin Kaiser
2022-03-23 23:59 ` kernel test robot
2022-03-23 7:48 ` [PATCH 2/7] staging: r8188eu: use ieee80211 helper to read the pwr bit Martin Kaiser
2022-03-23 7:48 ` [PATCH 3/7] staging: r8188eu: use standard mechanisms for control frames Martin Kaiser
2022-03-23 7:48 ` [PATCH 4/7] staging: r8188eu: use standard mechanisms for data frames Martin Kaiser
2022-03-23 7:48 ` [PATCH 5/7] staging: r8188eu: use standard mechanisms for qos " Martin Kaiser
2022-03-23 7:48 ` [PATCH 6/7] staging: r8188eu: remove unused data frame subtypes Martin Kaiser
2022-03-23 7:48 ` [PATCH 7/7] staging: r8188eu: remove unused control " Martin Kaiser
2022-03-27 18:09 ` [PATCH v2 0/9] staging: r8188eu: use ieee80211 helpers for parsing Martin Kaiser
2022-03-27 18:09 ` [PATCH v2 1/9] staging: r8188eu: use ieee80211 define for version check Martin Kaiser
2022-03-27 18:09 ` [PATCH v2 2/9] staging: r8188eu: use ieee80211 helper to read the pwr bit Martin Kaiser
2022-03-27 18:09 ` [PATCH v2 3/9] staging: r8188eu: use standard mechanisms for control frames Martin Kaiser
2022-03-27 18:09 ` [PATCH v2 4/9] staging: r8188eu: use standard mechanisms for data frames Martin Kaiser
2022-03-27 18:09 ` [PATCH v2 5/9] staging: r8188eu: use standard mechanisms for qos " Martin Kaiser
2022-03-27 18:09 ` [PATCH v2 6/9] staging: r8188eu: remove unused data frame subtypes Martin Kaiser
2022-03-27 18:09 ` [PATCH v2 7/9] staging: r8188eu: remove unused control " Martin Kaiser
2022-03-27 18:09 ` [PATCH v2 8/9] staging: r8188eu: use ieee80211 macro for sequence number Martin Kaiser
2022-03-27 18:09 ` Martin Kaiser [this message]
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=20220327180944.712545-10-martin@kaiser.cx \
--to=martin@kaiser.cx \
--cc=David.Laight@ACULAB.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 \
--cc=straube.linux@gmail.com \
/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