From 19dde0bd71e3dffb03ddc509019e22250f4e20c0 Mon Sep 17 00:00:00 2001 From: Janusz Dziedzic Date: Thu, 21 Mar 2013 15:47:54 +0100 Subject: cfg80211: add P2P Notice of Absence attribute Add P2P Notice of Absence attribute structure. Signed-off-by: Janusz Dziedzic Signed-off-by: Johannes Berg --- include/linux/ieee80211.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'include/linux/ieee80211.h') diff --git a/include/linux/ieee80211.h b/include/linux/ieee80211.h index 4cf0c9e4dd99..d10b5bba3268 100644 --- a/include/linux/ieee80211.h +++ b/include/linux/ieee80211.h @@ -1027,6 +1027,26 @@ enum ieee80211_p2p_attr_id { IEEE80211_P2P_ATTR_MAX }; +/* Notice of Absence attribute - described in P2P spec 4.1.14 */ +/* Typical max value used here */ +#define IEEE80211_P2P_NOA_DESC_MAX 4 + +struct ieee80211_p2p_noa_desc { + u8 count; + __le32 duration; + __le32 interval; + __le32 start_time; +} __packed; + +struct ieee80211_p2p_noa_attr { + u8 index; + u8 oppps_ctwindow; + struct ieee80211_p2p_noa_desc desc[IEEE80211_P2P_NOA_DESC_MAX]; +} __packed; + +#define IEEE80211_P2P_OPPPS_ENABLE_BIT BIT(7) +#define IEEE80211_P2P_OPPPS_CTWINDOW_MASK 0x7F + /** * struct ieee80211_bar - HT Block Ack Request * -- cgit v1.2.1 From 79ba1d8910f517c3bd39d794ddb1a5b4c03795c4 Mon Sep 17 00:00:00 2001 From: Johannes Berg Date: Wed, 27 Mar 2013 14:38:07 +0100 Subject: mac80211: parse Timeout Interval Element using a struct Instead of open-coding the accesses and length check do the length check in the IE parser and assign a struct pointer for use in the remaining code. Signed-off-by: Johannes Berg --- include/linux/ieee80211.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'include/linux/ieee80211.h') diff --git a/include/linux/ieee80211.h b/include/linux/ieee80211.h index d10b5bba3268..e46fea8b972e 100644 --- a/include/linux/ieee80211.h +++ b/include/linux/ieee80211.h @@ -1955,6 +1955,16 @@ enum ieee80211_timeout_interval_type { WLAN_TIMEOUT_ASSOC_COMEBACK = 3 /* 802.11w */, }; +/** + * struct ieee80211_timeout_interval_ie - Timeout Interval element + * @type: type, see &enum ieee80211_timeout_interval_type + * @value: timeout interval value + */ +struct ieee80211_timeout_interval_ie { + u8 type; + __le32 value; +} __packed; + /* BACK action code */ enum ieee80211_back_actioncode { WLAN_ACTION_ADDBA_REQ = 0, -- cgit v1.2.1 From 37799e52a29af2268d1fbe18908a0d6b9f68af88 Mon Sep 17 00:00:00 2001 From: Johannes Berg Date: Tue, 26 Mar 2013 14:02:26 +0100 Subject: mac80211: unify CSA action frame/beacon processing CSA action frame content should be processed as variable IEs rather than fixed to make it extensible. Unify the code and process them just like CSA in beacons to make it easier to extend for HT/VHT. Signed-off-by: Johannes Berg --- include/linux/ieee80211.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'include/linux/ieee80211.h') diff --git a/include/linux/ieee80211.h b/include/linux/ieee80211.h index e46fea8b972e..8f80b3a93501 100644 --- a/include/linux/ieee80211.h +++ b/include/linux/ieee80211.h @@ -840,9 +840,7 @@ struct ieee80211_mgmt { } __packed wme_action; struct{ u8 action_code; - u8 element_id; - u8 length; - struct ieee80211_channel_sw_ie sw_elem; + u8 variable[0]; } __packed chan_switch; struct{ u8 action_code; -- cgit v1.2.1 From b4f286a1c0ad0b84c2d502b354d4d98d5a86c64b Mon Sep 17 00:00:00 2001 From: Johannes Berg Date: Tue, 26 Mar 2013 14:13:58 +0100 Subject: mac80211: support extended channel switch Support extended channel switch when the operating class is one of the global operating classes as defined in Annex E of 802.11-2012. If it isn't, disconnect from the AP instead. Signed-off-by: Johannes Berg --- include/linux/ieee80211.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'include/linux/ieee80211.h') diff --git a/include/linux/ieee80211.h b/include/linux/ieee80211.h index 8f80b3a93501..2a10acc65a54 100644 --- a/include/linux/ieee80211.h +++ b/include/linux/ieee80211.h @@ -672,6 +672,18 @@ struct ieee80211_channel_sw_ie { u8 count; } __packed; +/** + * struct ieee80211_ext_chansw_ie + * + * This structure represents the "Extended Channel Switch Announcement element" + */ +struct ieee80211_ext_chansw_ie { + u8 mode; + u8 new_operating_class; + u8 new_ch_num; + u8 count; +} __packed; + /** * struct ieee80211_tim * -- cgit v1.2.1 From 85220d71bf3ca1ba9129e0744247ae5f61bec559 Mon Sep 17 00:00:00 2001 From: Johannes Berg Date: Mon, 25 Mar 2013 18:29:27 +0100 Subject: mac80211: support secondary channel offset in CSA Add support for the secondary channel offset IE in channel switch announcements. This is necessary for proper handling of CSA on HT access points. For this to work it is also necessary to convert everything here to use chandef structs instead of just channels. The driver updates aren't really correct though. In particular, the TI wl18xx driver update can't possibly be right since it just ignores the new channel width for lack of firmware API. Signed-off-by: Johannes Berg --- include/linux/ieee80211.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'include/linux/ieee80211.h') diff --git a/include/linux/ieee80211.h b/include/linux/ieee80211.h index 2a10acc65a54..95621528436c 100644 --- a/include/linux/ieee80211.h +++ b/include/linux/ieee80211.h @@ -684,6 +684,16 @@ struct ieee80211_ext_chansw_ie { u8 count; } __packed; +/** + * struct ieee80211_sec_chan_offs_ie - secondary channel offset IE + * @sec_chan_offs: secondary channel offset, uses IEEE80211_HT_PARAM_CHA_SEC_* + * values here + * This structure represents the "Secondary Channel Offset element" + */ +struct ieee80211_sec_chan_offs_ie { + u8 sec_chan_offs; +} __packed; + /** * struct ieee80211_tim * @@ -1648,6 +1658,7 @@ enum ieee80211_eid { WLAN_EID_HT_CAPABILITY = 45, WLAN_EID_HT_OPERATION = 61, + WLAN_EID_SECONDARY_CHANNEL_OFFSET = 62, WLAN_EID_RSN = 48, WLAN_EID_MMIE = 76, -- cgit v1.2.1 From 1b3a2e494bc793445f576c5476e9767cf7621684 Mon Sep 17 00:00:00 2001 From: Johannes Berg Date: Tue, 26 Mar 2013 15:17:18 +0100 Subject: mac80211: handle extended channel switch announcement Handle the (public) extended channel switch announcement action frames. Parts of the data in these frames isn't really in IEs, but put it into the elems struct anyway to simplify the handling. Signed-off-by: Johannes Berg --- include/linux/ieee80211.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'include/linux/ieee80211.h') diff --git a/include/linux/ieee80211.h b/include/linux/ieee80211.h index 95621528436c..ce07161c8735 100644 --- a/include/linux/ieee80211.h +++ b/include/linux/ieee80211.h @@ -864,6 +864,11 @@ struct ieee80211_mgmt { u8 action_code; u8 variable[0]; } __packed chan_switch; + struct{ + u8 action_code; + struct ieee80211_ext_chansw_ie data; + u8 variable[0]; + } __packed ext_chan_switch; struct{ u8 action_code; u8 dialog_token; @@ -1816,6 +1821,7 @@ enum ieee80211_key_len { /* Public action codes */ enum ieee80211_pub_actioncode { + WLAN_PUB_ACTION_EXT_CHANSW_ANN = 4, WLAN_PUB_ACTION_TDLS_DISCOVER_RES = 14, }; -- cgit v1.2.1 From b2e506bfc4d752b68a0ccaae1e977898263eba4c Mon Sep 17 00:00:00 2001 From: Johannes Berg Date: Tue, 26 Mar 2013 14:54:16 +0100 Subject: mac80211: parse VHT channel switch IEs VHT introduces multiple IEs that need to be parsed for a wide bandwidth channel switch. Two are (currently) needed in mac80211: * wide bandwidth channel switch element * channel switch wrapper element The former is contained in the latter for beacons and probe responses, but not for the spectrum management action frames so the IE parser needs a new argument to differentiate them. Signed-off-by: Johannes Berg --- include/linux/ieee80211.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'include/linux/ieee80211.h') diff --git a/include/linux/ieee80211.h b/include/linux/ieee80211.h index ce07161c8735..06b0ed0154a4 100644 --- a/include/linux/ieee80211.h +++ b/include/linux/ieee80211.h @@ -694,6 +694,14 @@ struct ieee80211_sec_chan_offs_ie { u8 sec_chan_offs; } __packed; +/** + * struct ieee80211_wide_bw_chansw_ie - wide bandwidth channel switch IE + */ +struct ieee80211_wide_bw_chansw_ie { + u8 new_channel_width; + u8 new_center_freq_seg0, new_center_freq_seg1; +} __packed; + /** * struct ieee80211_tim * @@ -1698,6 +1706,8 @@ enum ieee80211_eid { WLAN_EID_VHT_CAPABILITY = 191, WLAN_EID_VHT_OPERATION = 192, WLAN_EID_OPMODE_NOTIF = 199, + WLAN_EID_WIDE_BW_CHANNEL_SWITCH = 194, + WLAN_EID_CHANNEL_SWITCH_WRAPPER = 196, /* 802.11ad */ WLAN_EID_NON_TX_BSSID_CAP = 83, -- cgit v1.2.1