Skip to contentSkip to conversation

extend mac80211 mesh DFS and CSA functionality

PATCH Applied Simon Wunderlich 2 participants 4 messages May 23, 2017 – May 24, 2017 mac80211

lore
Share & tools
lore
#0 lore raw

v2 cover extend mac80211 mesh DFS and CSA functionality

This patchset includes the remaining two patches for the CSA handling, with Johannes change suggestions integrated.

Cheers,
Simon

Simon Wunderlich (2):
mac80211: mesh: support sending wide bandwidth CSA
mac80211: enable VHT for mesh channel processing

 net/mac80211/ieee80211_i.h |  2 ++
 net/mac80211/mesh.c        | 49 +++++++++++++++++++++++++++++++++++++++++++---
 net/mac80211/util.c        | 40 +++++++++++++++++++++++++++++++++++++
 3 files changed, 88 insertions(+), 3 deletions(-)
Signature · 1 line
2.11.0
#1 lore raw

PATCH v2 1/2 mac80211: mesh: support sending wide bandwidth CSA

To support HT and VHT CSA, beacons and action frames must include the corresponding IEs.

---
Changes to PATCHv1 (Thanks Johannes)
* change patch subject (originally: mac80211: add wide bandwidth
channel switch announcement to CSA action frames and mesh beacons)
* use skb_put() to simplify csa handling

---
 net/mac80211/ieee80211_i.h |  2 ++
 net/mac80211/mesh.c        | 45 +++++++++++++++++++++++++++++++++++++++++++--
 net/mac80211/util.c        | 40 ++++++++++++++++++++++++++++++++++++++++
 3 files changed, 85 insertions(+), 2 deletions(-)
net/mac80211/ieee80211_i.h +2 -0
index c960e4999380..e3a0b295c5ce 100644
@@ -2066,6 +2066,8 @@ u8 *ieee80211_ie_build_ht_cap(u8 *pos, struct ieee80211_sta_ht_cap *ht_cap,
 u8 *ieee80211_ie_build_ht_oper(u8 *pos, struct ieee80211_sta_ht_cap *ht_cap,
 			       const struct cfg80211_chan_def *chandef,
 			       u16 prot_mode, bool rifs_mode);
+u8 *ieee80211_ie_build_wide_bw_cs(u8 *pos,
+				  const struct cfg80211_chan_def *chandef);
 u8 *ieee80211_ie_build_vht_cap(u8 *pos, struct ieee80211_sta_vht_cap *vht_cap,
 			       u32 cap);
 u8 *ieee80211_ie_build_vht_oper(u8 *pos, struct ieee80211_sta_vht_cap *vht_cap,
net/mac80211/mesh.c +43 -2

63 lines not on this page · raw message

net/mac80211/util.c +40 -0
index ac9ac6c35594..d2e885cbfdf8 100644
@@ -2414,6 +2414,37 @@ u8 *ieee80211_ie_build_ht_oper(u8 *pos, struct ieee80211_sta_ht_cap *ht_cap,
 	return pos + sizeof(struct ieee80211_ht_operation);
 }
 
+u8 *ieee80211_ie_build_wide_bw_cs(u8 *pos,
+				  const struct cfg80211_chan_def *chandef)
+{
+	*pos++ = WLAN_EID_WIDE_BW_CHANNEL_SWITCH;	/* EID */
+	*pos++ = 3;					/* IE length */
+	/* New channel width */
+	switch (chandef->width) {
+	case NL80211_CHAN_WIDTH_80:
+		*pos++ = IEEE80211_VHT_CHANWIDTH_80MHZ;
+		break;
+	case NL80211_CHAN_WIDTH_160:
+		*pos++ = IEEE80211_VHT_CHANWIDTH_160MHZ;
+		break;
+	case NL80211_CHAN_WIDTH_80P80:
+		*pos++ = IEEE80211_VHT_CHANWIDTH_80P80MHZ;
+		break;
+	default:
+		*pos++ = IEEE80211_VHT_CHANWIDTH_USE_HT;
+	}
+
+	/* new center frequency segment 0 */
+	*pos++ = ieee80211_frequency_to_channel(chandef->center_freq1);
+	/* new center frequency segment 1 */
+	if (chandef->center_freq2)
+		*pos++ = ieee80211_frequency_to_channel(chandef->center_freq2);
+	else
+		*pos++ = 0;
+
+	return pos;
+}
+
 u8 *ieee80211_ie_build_vht_oper(u8 *pos, struct ieee80211_sta_vht_cap *vht_cap,
 				const struct cfg80211_chan_def *chandef)
 {
@@ -2964,6 +2995,7 @@ int ieee80211_send_action_csa(struct ieee80211_sub_if_data *sdata,
 	skb = dev_alloc_skb(local->tx_headroom + hdr_len +
 			    5 + /* channel switch announcement element */
 			    3 + /* secondary channel offset element */
+			    5 + /* wide bandwidth channel switch announcement */
 			    8); /* mesh channel switch parameters element */
 	if (!skb)
 		return -ENOMEM;
@@ -3022,6 +3054,14 @@ int ieee80211_send_action_csa(struct ieee80211_sub_if_data *sdata,
 		pos += 2;
 	}
 
+	if (csa_settings->chandef.width == NL80211_CHAN_WIDTH_80 ||
+	    csa_settings->chandef.width == NL80211_CHAN_WIDTH_80P80 ||
+	    csa_settings->chandef.width == NL80211_CHAN_WIDTH_160) {
+		skb_put(skb, 5);
+		pos = ieee80211_ie_build_wide_bw_cs(pos,
+						    &csa_settings->chandef);
+	}
+
 	ieee80211_tx_skb(sdata, skb);
 	return 0;
 }
Signature · 1 line
2.11.0
#2 lore raw

PATCH v2 2/2 mac80211: enable VHT for mesh channel processing

In reply to Simon Wunderlich
---
 net/mac80211/mesh.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
net/mac80211/mesh.c +3 -1
index 872a05606f06..d526fbd81d10 100644
@@ -989,12 +989,14 @@ ieee80211_mesh_process_chnswitch(struct ieee80211_sub_if_data *sdata,
 	if (!sband)
 		return false;
 
-	sta_flags = IEEE80211_STA_DISABLE_VHT;
+	sta_flags = 0;
 	switch (sdata->vif.bss_conf.chandef.width) {
 	case NL80211_CHAN_WIDTH_20_NOHT:
 		sta_flags |= IEEE80211_STA_DISABLE_HT;
 	case NL80211_CHAN_WIDTH_20:
 		sta_flags |= IEEE80211_STA_DISABLE_40MHZ;
+	case NL80211_CHAN_WIDTH_40:
+		sta_flags |= IEEE80211_STA_DISABLE_VHT;
 		break;
 	default:
 		break;
Signature · 1 line
2.11.0
maintainer Applied
#3 lore raw
In reply to Simon Wunderlich
Quoted 2 lines · Simon Wunderlich

This patchset includes the remaining two patches for the CSA handling, with Johannes change suggestions integrated.

Applied, thanks for respinning.

I made a small change and removed the return from ieee80211_ie_build_wide_bw_cs() since it wasn't used, and I would like to use the safer skb way of doing this more.

(But it doesn't work yet because IBSS uses this to fill a non-SKB buffer, and changing that is a bit complex)

johannes