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>
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);
*(__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)))