aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Kaiser <martin@kaiser.cx>2022-03-27 20:09:44 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-04-04 07:33:47 +0200
commit38238ecbfb63bbcfb27ee28951b2b0692daf6133 (patch)
tree4b9287bd938707bba7ec008e26291e492b91b70f
parentstaging: r8188eu: use ieee80211 macro for sequence number (diff)
staging: r8188eu: use ieee80211 define for fragment number
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> Link: https://lore.kernel.org/r/20220327180944.712545-10-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/staging/r8188eu/core/rtw_recv.c2
-rw-r--r--drivers/staging/r8188eu/include/wifi.h3
2 files changed, 1 insertions, 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)))