X-Git-Url: https://jxself.org/git/?a=blobdiff_plain;f=include%2Flinux%2Fieee80211.h;h=6729ad02e2398f785692c7b7450fa36ae8915ebc;hb=3d744935c5ad5735c5a5ea0486e0c6389aa2c94f;hp=d2d4435610290efd3b6005fd277110149879ad95;hpb=83cf639325d2819ac04cae9c086b7062da60b762;p=carl9170fw.git diff --git a/include/linux/ieee80211.h b/include/linux/ieee80211.h index d2d4435..6729ad0 100644 --- a/include/linux/ieee80211.h +++ b/include/linux/ieee80211.h @@ -1724,6 +1724,23 @@ static inline bool ieee80211_is_robust_mgmt_frame(struct ieee80211_hdr *hdr) return false; } +/** + * ieee80211_is_public_action - check if frame is a public action frame + * @hdr: the frame + * @len: length of the frame + */ +static inline bool ieee80211_is_public_action(struct ieee80211_hdr *hdr, + size_t len) +{ + struct ieee80211_mgmt *mgmt = (void *)hdr; + + if (len < IEEE80211_MIN_ACTION_SIZE) + return false; + if (!ieee80211_is_action(hdr->frame_control)) + return false; + return mgmt->u.action.category == WLAN_CATEGORY_PUBLIC; +} + /** * ieee80211_fhss_chan_to_freq - get channel frequency * @channel: the FHSS channel