Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

wifi: nl80211: split out UHR operation information

The beacon doesn't contain the full UHR operation, a number
of fields (such as NPCA) are only partially there. Add a new
attribute to contain the full information, so it's available
to the driver/mac80211.

Link: https://patch.msgid.link/20260303221710.866bacf82639.Iafdf37fb0f4304bdcdb824977d61e17b38c47685@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>

+22 -10
+6
include/uapi/linux/nl80211.h
··· 3001 3001 * interference detection is not performed on these sub-channels, their 3002 3002 * corresponding bits are consistently set to zero. 3003 3003 * 3004 + * @NL80211_ATTR_UHR_OPERATION: Full UHR Operation element, as it appears in 3005 + * association response etc., since it's abridged in the beacon. Used 3006 + * for START_AP etc. 3007 + * 3004 3008 * @NUM_NL80211_ATTR: total number of nl80211_attrs available 3005 3009 * @NL80211_ATTR_MAX: highest attribute number currently defined 3006 3010 * @__NL80211_ATTR_AFTER_LAST: internal use ··· 3579 3575 NL80211_ATTR_DISABLE_UHR, 3580 3576 3581 3577 NL80211_ATTR_INCUMBENT_SIGNAL_INTERFERENCE_BITMAP, 3578 + 3579 + NL80211_ATTR_UHR_OPERATION, 3582 3580 3583 3581 /* add attributes here, update the policy in nl80211.c */ 3584 3582
+16 -10
net/wireless/nl80211.c
··· 344 344 return 0; 345 345 } 346 346 347 + static int validate_uhr_operation(const struct nlattr *attr, 348 + struct netlink_ext_ack *extack) 349 + { 350 + const u8 *data = nla_data(attr); 351 + unsigned int len = nla_len(attr); 352 + 353 + if (!ieee80211_uhr_oper_size_ok(data, len, false)) 354 + return -EINVAL; 355 + return 0; 356 + } 357 + 347 358 /* policy for the attributes */ 348 359 static const struct nla_policy nl80211_policy[NUM_NL80211_ATTR]; 349 360 ··· 960 949 [NL80211_ATTR_UHR_CAPABILITY] = 961 950 NLA_POLICY_VALIDATE_FN(NLA_BINARY, validate_uhr_capa, 255), 962 951 [NL80211_ATTR_DISABLE_UHR] = { .type = NLA_FLAG }, 952 + [NL80211_ATTR_UHR_OPERATION] = 953 + NLA_POLICY_VALIDATE_FN(NLA_BINARY, validate_uhr_operation), 963 954 }; 964 955 965 956 /* policy for the key attributes */ ··· 6514 6501 return -EINVAL; 6515 6502 } 6516 6503 6517 - cap = cfg80211_find_ext_elem(WLAN_EID_EXT_UHR_OPER, ies, ies_len); 6518 - if (cap) { 6519 - if (!cap->datalen) 6520 - return -EINVAL; 6521 - params->uhr_oper = (void *)(cap->data + 1); 6522 - if (!ieee80211_uhr_oper_size_ok((const u8 *)params->uhr_oper, 6523 - cap->datalen - 1, true)) 6524 - return -EINVAL; 6525 - } 6526 - 6527 6504 return 0; 6528 6505 } 6529 6506 ··· 6954 6951 err = nl80211_calculate_ap_params(params); 6955 6952 if (err) 6956 6953 goto out; 6954 + 6955 + if (info->attrs[NL80211_ATTR_UHR_OPERATION]) 6956 + params->uhr_oper = nla_data(info->attrs[NL80211_ATTR_UHR_OPERATION]); 6957 6957 6958 6958 err = nl80211_validate_ap_phy_operation(params); 6959 6959 if (err)