summaryrefslogtreecommitdiff
path: root/net/mac80211
diff options
context:
space:
mode:
authorBenjamin Berg <benjamin.berg@intel.com>2026-09-21 14:40:54 +0200
committerJohannes Berg <johannes.berg@intel.com>2026-09-28 11:13:39 +0200
commitfc14cfab631994c872e2ebb65de8c50c49bda38e (patch)
treef1faeb2cd1eb0e987adc9b7fbd7f406dd076eb5f /net/mac80211
parent89665aeecd0f0c6b4ae620dfd4c67b99751f4cd1 (diff)
downloadlinux-next-fc14cfab631994c872e2ebb65de8c50c49bda38e.tar.gz
linux-next-fc14cfab631994c872e2ebb65de8c50c49bda38e.zip
wifi: mac80211: add helpers to parse/generate CIP Capabilities
The Control Integrity Protocol (CIP) Capabilities need to be added to and parsed from the association request and response. Signed-off-by: Benjamin Berg <benjamin.berg@intel.com> Link: https://patch.msgid.link/20260921144048.a3249c0b78ad.Ia3ea929dd6381cf8b04e3dd0c38e709e335113c2@changeid Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211')
-rw-r--r--net/mac80211/ieee80211_i.h3
-rw-r--r--net/mac80211/parse.c4
-rw-r--r--net/mac80211/util.c19
3 files changed, 26 insertions, 0 deletions
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h
index 10767666c45c..658550faf64a 100644
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
@@ -1878,6 +1878,7 @@ struct ieee802_11_elems {
const struct ieee80211_ttlm_elem *ttlm[IEEE80211_TTLM_MAX_CNT];
const struct ieee80211_uhr_cap *uhr_cap;
const struct ieee80211_uhr_operation *uhr_operation;
+ const struct ieee80211_cip_cap *cip_cap;
/* not the order in the psd values is per element, not per chandef */
struct ieee80211_parsed_tpe tpe;
@@ -2778,6 +2779,8 @@ int ieee80211_put_uhr_cap(struct sk_buff *skb,
const struct ieee80211_supported_band *sband);
void ieee80211_put_reg_conn(struct ieee80211_sub_if_data *sdata,
struct sk_buff *skb);
+int ieee80211_put_cip_cap(struct sk_buff *skb,
+ struct ieee80211_sub_if_data *sdata);
/* channel management */
bool ieee80211_chandef_ht_oper(const struct ieee80211_ht_operation *ht_oper,
diff --git a/net/mac80211/parse.c b/net/mac80211/parse.c
index cb2be167cde7..3b66ca7d7a5c 100644
--- a/net/mac80211/parse.c
+++ b/net/mac80211/parse.c
@@ -205,6 +205,10 @@ ieee80211_parse_extension_element(u32 *crc,
elems->ttlm_num++;
}
break;
+ case WLAN_EID_EXT_CIP_CAPA:
+ if (len >= sizeof(*elems->cip_cap))
+ elems->cip_cap = data;
+ break;
case WLAN_EID_EXT_UHR_OPER:
if (params->mode < IEEE80211_CONN_MODE_UHR)
break;
diff --git a/net/mac80211/util.c b/net/mac80211/util.c
index e2b5b2b21c34..c193a75ef06e 100644
--- a/net/mac80211/util.c
+++ b/net/mac80211/util.c
@@ -4680,6 +4680,25 @@ int ieee80211_put_uhr_cap(struct sk_buff *skb,
return 0;
}
+int ieee80211_put_cip_cap(struct sk_buff *skb,
+ struct ieee80211_sub_if_data *sdata)
+{
+ const struct wiphy_iftype_ext_capab *ift_ext_capa =
+ cfg80211_get_iftype_ext_capa(sdata->local->hw.wiphy,
+ ieee80211_vif_type_p2p(&sdata->vif));
+ u8 cip_capabilities = ift_ext_capa ? ift_ext_capa->cip_capabilities : 0;
+
+ if (skb_tailroom(skb) < 4)
+ return -ENOBUFS;
+
+ skb_put_u8(skb, WLAN_EID_EXTENSION);
+ skb_put_u8(skb, 2);
+ skb_put_u8(skb, WLAN_EID_EXT_CIP_CAPA);
+ skb_put_u8(skb, cip_capabilities);
+
+ return 0;
+}
+
const char *ieee80211_conn_mode_str(enum ieee80211_conn_mode mode)
{
static const char * const modes[] = {