# \[PATCH 01/31\] mac80211: add HE 6GHz cap IE in 6GHz band only

- From: Luca Coelho \<hidden\>
- Date: 2021-06-18 10:42:06 
- List: linux-wireless
- Page: https://ratatoskr.run/linux-wireless/2021/06/15767844
- Thread: https://ratatoskr.run/linux-wireless/2021/06/15767845/t.md

```text
From: Shaul Triebitz <redacted>

The HE 6GHz capability IE should be added to the
association request only when operating in the 6GHz band.

Signed-off-by: Shaul Triebitz <redacted>
Signed-off-by: Luca Coelho <redacted>
---
 net/mac80211/util.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/net/mac80211/util.c b/net/mac80211/util.c
index 0a0481f5af48..a0ff27487686 100644
--- a/net/mac80211/util.c
+++ b/net/mac80211/util.c
@@ -6,7 +6,7 @@
  * Copyright 2007	Johannes Berg <johannes@sipsolutions.net>
  * Copyright 2013-2014  Intel Mobile Communications GmbH
  * Copyright (C) 2015-2017	Intel Deutschland GmbH
- * Copyright (C) 2018-2020 Intel Corporation
+ * Copyright (C) 2018-2021 Intel Corporation
  *
  * utilities for mac80211
  */
@@ -2950,6 +2950,9 @@ void ieee80211_ie_build_he_6ghz_cap(struct ieee80211_sub_if_data *sdata,
 	if (!sband)
 		return;
 
+	if (sband->band != NL80211_BAND_6GHZ)
+		return;
+
 	iftd = ieee80211_get_sband_iftype_data(sband, iftype);
 	if (WARN_ON(!iftd))
 		return;
-- 
2.32.0

```
