aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/ieee80211.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/ieee80211.h')
-rw-r--r--include/linux/ieee80211.h32
1 files changed, 32 insertions, 0 deletions
diff --git a/include/linux/ieee80211.h b/include/linux/ieee80211.h
index 48363c3c40f8..210e2c325534 100644
--- a/include/linux/ieee80211.h
+++ b/include/linux/ieee80211.h
@@ -128,6 +128,7 @@
128#define IEEE80211_QOS_CTL_ACK_POLICY_NOACK 0x0020 128#define IEEE80211_QOS_CTL_ACK_POLICY_NOACK 0x0020
129#define IEEE80211_QOS_CTL_ACK_POLICY_NO_EXPL 0x0040 129#define IEEE80211_QOS_CTL_ACK_POLICY_NO_EXPL 0x0040
130#define IEEE80211_QOS_CTL_ACK_POLICY_BLOCKACK 0x0060 130#define IEEE80211_QOS_CTL_ACK_POLICY_BLOCKACK 0x0060
131#define IEEE80211_QOS_CTL_ACK_POLICY_MASK 0x0060
131/* A-MSDU 802.11n */ 132/* A-MSDU 802.11n */
132#define IEEE80211_QOS_CTL_A_MSDU_PRESENT 0x0080 133#define IEEE80211_QOS_CTL_A_MSDU_PRESENT 0x0080
133/* Mesh Control 802.11s */ 134/* Mesh Control 802.11s */
@@ -543,6 +544,15 @@ static inline int ieee80211_is_qos_nullfunc(__le16 fc)
543 cpu_to_le16(IEEE80211_FTYPE_DATA | IEEE80211_STYPE_QOS_NULLFUNC); 544 cpu_to_le16(IEEE80211_FTYPE_DATA | IEEE80211_STYPE_QOS_NULLFUNC);
544} 545}
545 546
547/**
548 * ieee80211_is_first_frag - check if IEEE80211_SCTL_FRAG is not set
549 * @seq_ctrl: frame sequence control bytes in little-endian byteorder
550 */
551static inline int ieee80211_is_first_frag(__le16 seq_ctrl)
552{
553 return (seq_ctrl & cpu_to_le16(IEEE80211_SCTL_FRAG)) == 0;
554}
555
546struct ieee80211s_hdr { 556struct ieee80211s_hdr {
547 u8 flags; 557 u8 flags;
548 u8 ttl; 558 u8 ttl;
@@ -770,6 +780,9 @@ struct ieee80211_mgmt {
770 } u; 780 } u;
771} __attribute__ ((packed)); 781} __attribute__ ((packed));
772 782
783/* Supported Rates value encodings in 802.11n-2009 7.3.2.2 */
784#define BSS_MEMBERSHIP_SELECTOR_HT_PHY 127
785
773/* mgmt header + 1 byte category code */ 786/* mgmt header + 1 byte category code */
774#define IEEE80211_MIN_ACTION_SIZE offsetof(struct ieee80211_mgmt, u.action.u) 787#define IEEE80211_MIN_ACTION_SIZE offsetof(struct ieee80211_mgmt, u.action.u)
775 788
@@ -1552,6 +1565,8 @@ enum ieee80211_sa_query_action {
1552#define WLAN_CIPHER_SUITE_WEP104 0x000FAC05 1565#define WLAN_CIPHER_SUITE_WEP104 0x000FAC05
1553#define WLAN_CIPHER_SUITE_AES_CMAC 0x000FAC06 1566#define WLAN_CIPHER_SUITE_AES_CMAC 0x000FAC06
1554 1567
1568#define WLAN_CIPHER_SUITE_SMS4 0x00147201
1569
1555/* AKM suite selectors */ 1570/* AKM suite selectors */
1556#define WLAN_AKM_SUITE_8021X 0x000FAC01 1571#define WLAN_AKM_SUITE_8021X 0x000FAC01
1557#define WLAN_AKM_SUITE_PSK 0x000FAC02 1572#define WLAN_AKM_SUITE_PSK 0x000FAC02
@@ -1689,6 +1704,23 @@ static inline bool ieee80211_is_robust_mgmt_frame(struct ieee80211_hdr *hdr)
1689} 1704}
1690 1705
1691/** 1706/**
1707 * ieee80211_is_public_action - check if frame is a public action frame
1708 * @hdr: the frame
1709 * @len: length of the frame
1710 */
1711static inline bool ieee80211_is_public_action(struct ieee80211_hdr *hdr,
1712 size_t len)
1713{
1714 struct ieee80211_mgmt *mgmt = (void *)hdr;
1715
1716 if (len < IEEE80211_MIN_ACTION_SIZE)
1717 return false;
1718 if (!ieee80211_is_action(hdr->frame_control))
1719 return false;
1720 return mgmt->u.action.category == WLAN_CATEGORY_PUBLIC;
1721}
1722
1723/**
1692 * ieee80211_fhss_chan_to_freq - get channel frequency 1724 * ieee80211_fhss_chan_to_freq - get channel frequency
1693 * @channel: the FHSS channel 1725 * @channel: the FHSS channel
1694 * 1726 *