Lines Matching refs:attrs

68 			   struct net *netns, struct nlattr **attrs)  in __cfg80211_wdev_from_attrs()  argument
71 bool have_ifidx = attrs[NL80211_ATTR_IFINDEX]; in __cfg80211_wdev_from_attrs()
72 bool have_wdev_id = attrs[NL80211_ATTR_WDEV]; in __cfg80211_wdev_from_attrs()
81 ifidx = nla_get_u32(attrs[NL80211_ATTR_IFINDEX]); in __cfg80211_wdev_from_attrs()
83 wdev_id = nla_get_u64(attrs[NL80211_ATTR_WDEV]); in __cfg80211_wdev_from_attrs()
140 __cfg80211_rdev_from_attrs(struct net *netns, struct nlattr **attrs) in __cfg80211_rdev_from_attrs() argument
147 if (!attrs[NL80211_ATTR_WIPHY] && in __cfg80211_rdev_from_attrs()
148 !attrs[NL80211_ATTR_IFINDEX] && in __cfg80211_rdev_from_attrs()
149 !attrs[NL80211_ATTR_WDEV]) in __cfg80211_rdev_from_attrs()
152 if (attrs[NL80211_ATTR_WIPHY]) in __cfg80211_rdev_from_attrs()
154 nla_get_u32(attrs[NL80211_ATTR_WIPHY])); in __cfg80211_rdev_from_attrs()
156 if (attrs[NL80211_ATTR_WDEV]) { in __cfg80211_rdev_from_attrs()
157 u64 wdev_id = nla_get_u64(attrs[NL80211_ATTR_WDEV]); in __cfg80211_rdev_from_attrs()
180 if (attrs[NL80211_ATTR_IFINDEX]) { in __cfg80211_rdev_from_attrs()
181 int ifindex = nla_get_u32(attrs[NL80211_ATTR_IFINDEX]); in __cfg80211_rdev_from_attrs()
222 return __cfg80211_rdev_from_attrs(netns, info->attrs); in cfg80211_get_dev_from_info()
1265 static unsigned int nl80211_link_id(struct nlattr **attrs) in nl80211_link_id() argument
1267 struct nlattr *linkid = attrs[NL80211_ATTR_MLO_LINK_ID]; in nl80211_link_id()
1275 static int nl80211_link_id_or_invalid(struct nlattr **attrs) in nl80211_link_id_or_invalid() argument
1277 struct nlattr *linkid = attrs[NL80211_ATTR_MLO_LINK_ID]; in nl80211_link_id_or_invalid()
1356 if (info->attrs[NL80211_ATTR_KEY_DATA]) { in nl80211_parse_key_old()
1357 k->p.key = nla_data(info->attrs[NL80211_ATTR_KEY_DATA]); in nl80211_parse_key_old()
1358 k->p.key_len = nla_len(info->attrs[NL80211_ATTR_KEY_DATA]); in nl80211_parse_key_old()
1361 if (info->attrs[NL80211_ATTR_KEY_SEQ]) { in nl80211_parse_key_old()
1362 k->p.seq = nla_data(info->attrs[NL80211_ATTR_KEY_SEQ]); in nl80211_parse_key_old()
1363 k->p.seq_len = nla_len(info->attrs[NL80211_ATTR_KEY_SEQ]); in nl80211_parse_key_old()
1366 if (info->attrs[NL80211_ATTR_KEY_IDX]) in nl80211_parse_key_old()
1367 k->idx = nla_get_u8(info->attrs[NL80211_ATTR_KEY_IDX]); in nl80211_parse_key_old()
1369 if (info->attrs[NL80211_ATTR_KEY_CIPHER]) in nl80211_parse_key_old()
1370 k->p.cipher = nla_get_u32(info->attrs[NL80211_ATTR_KEY_CIPHER]); in nl80211_parse_key_old()
1372 k->def = !!info->attrs[NL80211_ATTR_KEY_DEFAULT]; in nl80211_parse_key_old()
1373 k->defmgmt = !!info->attrs[NL80211_ATTR_KEY_DEFAULT_MGMT]; in nl80211_parse_key_old()
1382 if (info->attrs[NL80211_ATTR_KEY_TYPE]) in nl80211_parse_key_old()
1383 k->type = nla_get_u32(info->attrs[NL80211_ATTR_KEY_TYPE]); in nl80211_parse_key_old()
1385 if (info->attrs[NL80211_ATTR_KEY_DEFAULT_TYPES]) { in nl80211_parse_key_old()
1389 info->attrs[NL80211_ATTR_KEY_DEFAULT_TYPES], in nl80211_parse_key_old()
1410 if (info->attrs[NL80211_ATTR_KEY]) in nl80211_parse_key()
1411 err = nl80211_parse_key_new(info, info->attrs[NL80211_ATTR_KEY], k); in nl80211_parse_key()
1466 struct nlattr *keys = info->attrs[NL80211_ATTR_KEYS]; in nl80211_parse_connkeys()
3219 *punct_bitmap = nla_get_u32(info->attrs[NL80211_ATTR_PUNCT_BITMAP]); in nl80211_parse_punct_bitmap()
3231 struct nlattr **attrs = info->attrs; in nl80211_parse_chandef() local
3234 if (!attrs[NL80211_ATTR_WIPHY_FREQ]) { in nl80211_parse_chandef()
3235 NL_SET_ERR_MSG_ATTR(extack, attrs[NL80211_ATTR_WIPHY_FREQ], in nl80211_parse_chandef()
3241 nla_get_u32(info->attrs[NL80211_ATTR_WIPHY_FREQ])); in nl80211_parse_chandef()
3242 if (info->attrs[NL80211_ATTR_WIPHY_FREQ_OFFSET]) in nl80211_parse_chandef()
3244 nla_get_u32(info->attrs[NL80211_ATTR_WIPHY_FREQ_OFFSET]); in nl80211_parse_chandef()
3255 NL_SET_ERR_MSG_ATTR(extack, attrs[NL80211_ATTR_WIPHY_FREQ], in nl80211_parse_chandef()
3260 if (attrs[NL80211_ATTR_WIPHY_CHANNEL_TYPE]) { in nl80211_parse_chandef()
3263 chantype = nla_get_u32(attrs[NL80211_ATTR_WIPHY_CHANNEL_TYPE]); in nl80211_parse_chandef()
3273 if (attrs[NL80211_ATTR_CENTER_FREQ1] && in nl80211_parse_chandef()
3274 chandef->center_freq1 != nla_get_u32(attrs[NL80211_ATTR_CENTER_FREQ1])) { in nl80211_parse_chandef()
3276 attrs[NL80211_ATTR_CENTER_FREQ1], in nl80211_parse_chandef()
3281 if (attrs[NL80211_ATTR_CENTER_FREQ2] && in nl80211_parse_chandef()
3282 nla_get_u32(attrs[NL80211_ATTR_CENTER_FREQ2])) { in nl80211_parse_chandef()
3284 attrs[NL80211_ATTR_CENTER_FREQ2], in nl80211_parse_chandef()
3291 attrs[NL80211_ATTR_WIPHY_CHANNEL_TYPE], in nl80211_parse_chandef()
3295 } else if (attrs[NL80211_ATTR_CHANNEL_WIDTH]) { in nl80211_parse_chandef()
3297 nla_get_u32(attrs[NL80211_ATTR_CHANNEL_WIDTH]); in nl80211_parse_chandef()
3302 attrs[NL80211_ATTR_CHANNEL_WIDTH], in nl80211_parse_chandef()
3307 if (attrs[NL80211_ATTR_CENTER_FREQ1]) { in nl80211_parse_chandef()
3309 nla_get_u32(attrs[NL80211_ATTR_CENTER_FREQ1]); in nl80211_parse_chandef()
3310 if (attrs[NL80211_ATTR_CENTER_FREQ1_OFFSET]) in nl80211_parse_chandef()
3312 attrs[NL80211_ATTR_CENTER_FREQ1_OFFSET]); in nl80211_parse_chandef()
3316 if (attrs[NL80211_ATTR_CENTER_FREQ2]) in nl80211_parse_chandef()
3318 nla_get_u32(attrs[NL80211_ATTR_CENTER_FREQ2]); in nl80211_parse_chandef()
3321 if (info->attrs[NL80211_ATTR_WIPHY_EDMG_CHANNELS]) { in nl80211_parse_chandef()
3323 nla_get_u8(info->attrs[NL80211_ATTR_WIPHY_EDMG_CHANNELS]); in nl80211_parse_chandef()
3325 if (info->attrs[NL80211_ATTR_WIPHY_EDMG_BW_CONFIG]) in nl80211_parse_chandef()
3327 nla_get_u8(info->attrs[NL80211_ATTR_WIPHY_EDMG_BW_CONFIG]); in nl80211_parse_chandef()
3424 int link_id = nl80211_link_id_or_invalid(info->attrs); in nl80211_set_channel()
3459 if (info->attrs[NL80211_ATTR_IFINDEX]) { in nl80211_set_wiphy()
3460 int ifindex = nla_get_u32(info->attrs[NL80211_ATTR_IFINDEX]); in nl80211_set_wiphy()
3471 info->attrs); in nl80211_set_wiphy()
3489 if (info->attrs[NL80211_ATTR_WIPHY_NAME]) in nl80211_set_wiphy()
3491 rdev, nla_data(info->attrs[NL80211_ATTR_WIPHY_NAME])); in nl80211_set_wiphy()
3497 if (info->attrs[NL80211_ATTR_WIPHY_TXQ_PARAMS]) { in nl80211_set_wiphy()
3523 info->attrs[NL80211_ATTR_WIPHY_TXQ_PARAMS], in nl80211_set_wiphy()
3537 nl80211_link_id_or_invalid(info->attrs); in nl80211_set_wiphy()
3556 if (info->attrs[NL80211_ATTR_WIPHY_FREQ]) { in nl80211_set_wiphy()
3557 int link_id = nl80211_link_id_or_invalid(info->attrs); in nl80211_set_wiphy()
3574 if (info->attrs[NL80211_ATTR_WIPHY_TX_POWER_SETTING]) { in nl80211_set_wiphy()
3588 type = nla_get_u32(info->attrs[idx]); in nl80211_set_wiphy()
3590 if (!info->attrs[NL80211_ATTR_WIPHY_TX_POWER_LEVEL] && in nl80211_set_wiphy()
3598 mbm = nla_get_u32(info->attrs[idx]); in nl80211_set_wiphy()
3606 if (info->attrs[NL80211_ATTR_WIPHY_ANTENNA_TX] && in nl80211_set_wiphy()
3607 info->attrs[NL80211_ATTR_WIPHY_ANTENNA_RX]) { in nl80211_set_wiphy()
3617 tx_ant = nla_get_u32(info->attrs[NL80211_ATTR_WIPHY_ANTENNA_TX]); in nl80211_set_wiphy()
3618 rx_ant = nla_get_u32(info->attrs[NL80211_ATTR_WIPHY_ANTENNA_RX]); in nl80211_set_wiphy()
3638 if (info->attrs[NL80211_ATTR_WIPHY_RETRY_SHORT]) { in nl80211_set_wiphy()
3640 info->attrs[NL80211_ATTR_WIPHY_RETRY_SHORT]); in nl80211_set_wiphy()
3645 if (info->attrs[NL80211_ATTR_WIPHY_RETRY_LONG]) { in nl80211_set_wiphy()
3647 info->attrs[NL80211_ATTR_WIPHY_RETRY_LONG]); in nl80211_set_wiphy()
3652 if (info->attrs[NL80211_ATTR_WIPHY_FRAG_THRESHOLD]) { in nl80211_set_wiphy()
3654 info->attrs[NL80211_ATTR_WIPHY_FRAG_THRESHOLD]); in nl80211_set_wiphy()
3672 if (info->attrs[NL80211_ATTR_WIPHY_RTS_THRESHOLD]) { in nl80211_set_wiphy()
3674 info->attrs[NL80211_ATTR_WIPHY_RTS_THRESHOLD]); in nl80211_set_wiphy()
3678 if (info->attrs[NL80211_ATTR_WIPHY_COVERAGE_CLASS]) { in nl80211_set_wiphy()
3679 if (info->attrs[NL80211_ATTR_WIPHY_DYN_ACK]) { in nl80211_set_wiphy()
3685 info->attrs[NL80211_ATTR_WIPHY_COVERAGE_CLASS]); in nl80211_set_wiphy()
3689 if (info->attrs[NL80211_ATTR_WIPHY_DYN_ACK]) { in nl80211_set_wiphy()
3698 if (info->attrs[NL80211_ATTR_TXQ_LIMIT]) { in nl80211_set_wiphy()
3705 info->attrs[NL80211_ATTR_TXQ_LIMIT]); in nl80211_set_wiphy()
3709 if (info->attrs[NL80211_ATTR_TXQ_MEMORY_LIMIT]) { in nl80211_set_wiphy()
3716 info->attrs[NL80211_ATTR_TXQ_MEMORY_LIMIT]); in nl80211_set_wiphy()
3720 if (info->attrs[NL80211_ATTR_TXQ_QUANTUM]) { in nl80211_set_wiphy()
3727 info->attrs[NL80211_ATTR_TXQ_QUANTUM]); in nl80211_set_wiphy()
4087 if (info->attrs[NL80211_ATTR_MNTR_FLAGS]) { in nl80211_parse_mon_options()
4091 err = parse_monitor_flags(info->attrs[NL80211_ATTR_MNTR_FLAGS], in nl80211_parse_mon_options()
4103 if (info->attrs[NL80211_ATTR_MU_MIMO_GROUP_DATA]) { in nl80211_parse_mon_options()
4114 nla_data(info->attrs[NL80211_ATTR_MU_MIMO_GROUP_DATA]); in nl80211_parse_mon_options()
4125 if (info->attrs[NL80211_ATTR_MU_MIMO_FOLLOW_MAC_ADDR]) { in nl80211_parse_mon_options()
4135 nla_data(info->attrs[NL80211_ATTR_MU_MIMO_FOLLOW_MAC_ADDR]); in nl80211_parse_mon_options()
4181 if (info->attrs[NL80211_ATTR_IFTYPE]) { in nl80211_set_interface()
4182 ntype = nla_get_u32(info->attrs[NL80211_ATTR_IFTYPE]); in nl80211_set_interface()
4187 if (info->attrs[NL80211_ATTR_MESH_ID]) { in nl80211_set_interface()
4201 nla_len(info->attrs[NL80211_ATTR_MESH_ID]); in nl80211_set_interface()
4203 nla_data(info->attrs[NL80211_ATTR_MESH_ID]), in nl80211_set_interface()
4208 if (info->attrs[NL80211_ATTR_4ADDR]) { in nl80211_set_interface()
4209 params.use_4addr = !!nla_get_u8(info->attrs[NL80211_ATTR_4ADDR]); in nl80211_set_interface()
4252 if (!info->attrs[NL80211_ATTR_IFNAME]) in _nl80211_new_interface()
4255 if (info->attrs[NL80211_ATTR_IFTYPE]) in _nl80211_new_interface()
4256 type = nla_get_u32(info->attrs[NL80211_ATTR_IFTYPE]); in _nl80211_new_interface()
4263 info->attrs[NL80211_ATTR_MAC]) { in _nl80211_new_interface()
4264 nla_memcpy(params.macaddr, info->attrs[NL80211_ATTR_MAC], in _nl80211_new_interface()
4270 if (info->attrs[NL80211_ATTR_4ADDR]) { in _nl80211_new_interface()
4271 params.use_4addr = !!nla_get_u8(info->attrs[NL80211_ATTR_4ADDR]); in _nl80211_new_interface()
4289 nla_data(info->attrs[NL80211_ATTR_IFNAME]), in _nl80211_new_interface()
4299 if (info->attrs[NL80211_ATTR_SOCKET_OWNER]) in _nl80211_new_interface()
4304 if (!info->attrs[NL80211_ATTR_MESH_ID]) in _nl80211_new_interface()
4310 nla_len(info->attrs[NL80211_ATTR_MESH_ID]); in _nl80211_new_interface()
4312 nla_data(info->attrs[NL80211_ATTR_MESH_ID]), in _nl80211_new_interface()
4395 if (!info->attrs[NL80211_ATTR_NOACK_MAP]) in nl80211_set_noack_map()
4401 noack_map = nla_get_u16(info->attrs[NL80211_ATTR_NOACK_MAP]); in nl80211_set_noack_map()
4499 int link_id = nl80211_link_id_or_invalid(info->attrs); in nl80211_get_key()
4512 if (info->attrs[NL80211_ATTR_KEY_IDX]) { in nl80211_get_key()
4513 key_idx = nla_get_u8(info->attrs[NL80211_ATTR_KEY_IDX]); in nl80211_get_key()
4521 if (info->attrs[NL80211_ATTR_MAC]) in nl80211_get_key()
4522 mac_addr = nla_data(info->attrs[NL80211_ATTR_MAC]); in nl80211_get_key()
4525 if (info->attrs[NL80211_ATTR_KEY_TYPE]) { in nl80211_get_key()
4526 u32 kt = nla_get_u32(info->attrs[NL80211_ATTR_KEY_TYPE]); in nl80211_get_key()
4588 int link_id = nl80211_link_id_or_invalid(info->attrs); in nl80211_set_key()
4683 if (info->attrs[NL80211_ATTR_MAC]) in nl80211_set_key()
4684 mac_addr = nla_data(info->attrs[NL80211_ATTR_MAC]); in nl80211_set_key()
4714 int link_id = nl80211_link_id_or_invalid(info->attrs); in nl80211_new_key()
4726 if (info->attrs[NL80211_ATTR_MAC]) in nl80211_new_key()
4727 mac_addr = nla_data(info->attrs[NL80211_ATTR_MAC]); in nl80211_new_key()
4744 info->attrs[NL80211_ATTR_VLAN_ID]) in nl80211_new_key()
4745 key.p.vlan_id = nla_get_u16(info->attrs[NL80211_ATTR_VLAN_ID]); in nl80211_new_key()
4785 int link_id = nl80211_link_id_or_invalid(info->attrs); in nl80211_del_key()
4792 if (info->attrs[NL80211_ATTR_MAC]) in nl80211_del_key()
4793 mac_addr = nla_data(info->attrs[NL80211_ATTR_MAC]); in nl80211_del_key()
4875 if (!info->attrs[NL80211_ATTR_ACL_POLICY]) in parse_acl_data()
4878 acl_policy = nla_get_u32(info->attrs[NL80211_ATTR_ACL_POLICY]); in parse_acl_data()
4883 if (!info->attrs[NL80211_ATTR_MAC_ADDRS]) in parse_acl_data()
4886 n_entries = validate_acl_mac_addrs(info->attrs[NL80211_ATTR_MAC_ADDRS]); in parse_acl_data()
4898 nla_for_each_nested(attr, info->attrs[NL80211_ATTR_MAC_ADDRS], tmp) { in parse_acl_data()
5140 struct nlattr *attrs[], in nl80211_parse_tx_bitrate_mask() argument
5190 if (!attrs[attr]) in nl80211_parse_tx_bitrate_mask()
5197 nla_for_each_nested(tx_rates, attrs[attr], rem) { in nl80211_parse_tx_bitrate_mask()
5364 struct nlattr *attrs, in nl80211_parse_mbssid_config() argument
5373 if (nla_parse_nested(tb, NL80211_MBSSID_CONFIG_ATTR_MAX, attrs, NULL, in nl80211_parse_mbssid_config()
5426 nl80211_parse_mbssid_elems(struct wiphy *wiphy, struct nlattr *attrs) in nl80211_parse_mbssid_elems() argument
5436 nla_for_each_nested(nl_elems, attrs, rem_elems) { in nl80211_parse_mbssid_elems()
5447 nla_for_each_nested(nl_elems, attrs, rem_elems) { in nl80211_parse_mbssid_elems()
5456 nl80211_parse_rnr_elems(struct wiphy *wiphy, struct nlattr *attrs, in nl80211_parse_rnr_elems() argument
5464 nla_for_each_nested(nl_elems, attrs, rem_elems) { in nl80211_parse_rnr_elems()
5479 nla_for_each_nested(nl_elems, attrs, rem_elems) { in nl80211_parse_rnr_elems()
5487 static int nl80211_parse_he_bss_color(struct nlattr *attrs, in nl80211_parse_he_bss_color() argument
5493 err = nla_parse_nested(tb, NL80211_HE_BSS_COLOR_ATTR_MAX, attrs, in nl80211_parse_he_bss_color()
5512 struct nlattr *attrs[], in nl80211_parse_beacon() argument
5521 bcn->link_id = nl80211_link_id(attrs); in nl80211_parse_beacon()
5523 if (attrs[NL80211_ATTR_BEACON_HEAD]) { in nl80211_parse_beacon()
5524 bcn->head = nla_data(attrs[NL80211_ATTR_BEACON_HEAD]); in nl80211_parse_beacon()
5525 bcn->head_len = nla_len(attrs[NL80211_ATTR_BEACON_HEAD]); in nl80211_parse_beacon()
5531 if (attrs[NL80211_ATTR_BEACON_TAIL]) { in nl80211_parse_beacon()
5532 bcn->tail = nla_data(attrs[NL80211_ATTR_BEACON_TAIL]); in nl80211_parse_beacon()
5533 bcn->tail_len = nla_len(attrs[NL80211_ATTR_BEACON_TAIL]); in nl80211_parse_beacon()
5540 if (attrs[NL80211_ATTR_IE]) { in nl80211_parse_beacon()
5541 bcn->beacon_ies = nla_data(attrs[NL80211_ATTR_IE]); in nl80211_parse_beacon()
5542 bcn->beacon_ies_len = nla_len(attrs[NL80211_ATTR_IE]); in nl80211_parse_beacon()
5545 if (attrs[NL80211_ATTR_IE_PROBE_RESP]) { in nl80211_parse_beacon()
5547 nla_data(attrs[NL80211_ATTR_IE_PROBE_RESP]); in nl80211_parse_beacon()
5549 nla_len(attrs[NL80211_ATTR_IE_PROBE_RESP]); in nl80211_parse_beacon()
5552 if (attrs[NL80211_ATTR_IE_ASSOC_RESP]) { in nl80211_parse_beacon()
5554 nla_data(attrs[NL80211_ATTR_IE_ASSOC_RESP]); in nl80211_parse_beacon()
5556 nla_len(attrs[NL80211_ATTR_IE_ASSOC_RESP]); in nl80211_parse_beacon()
5559 if (attrs[NL80211_ATTR_PROBE_RESP]) { in nl80211_parse_beacon()
5560 bcn->probe_resp = nla_data(attrs[NL80211_ATTR_PROBE_RESP]); in nl80211_parse_beacon()
5561 bcn->probe_resp_len = nla_len(attrs[NL80211_ATTR_PROBE_RESP]); in nl80211_parse_beacon()
5564 if (attrs[NL80211_ATTR_FTM_RESPONDER]) { in nl80211_parse_beacon()
5569 attrs[NL80211_ATTR_FTM_RESPONDER], in nl80211_parse_beacon()
5594 if (attrs[NL80211_ATTR_HE_BSS_COLOR]) { in nl80211_parse_beacon()
5595 err = nl80211_parse_he_bss_color(attrs[NL80211_ATTR_HE_BSS_COLOR], in nl80211_parse_beacon()
5602 if (attrs[NL80211_ATTR_MBSSID_ELEMS]) { in nl80211_parse_beacon()
5605 attrs[NL80211_ATTR_MBSSID_ELEMS]); in nl80211_parse_beacon()
5612 if (bcn->mbssid_ies && attrs[NL80211_ATTR_EMA_RNR_ELEMS]) { in nl80211_parse_beacon()
5615 attrs[NL80211_ATTR_EMA_RNR_ELEMS], in nl80211_parse_beacon()
5631 static int nl80211_parse_he_obss_pd(struct nlattr *attrs, in nl80211_parse_he_obss_pd() argument
5637 err = nla_parse_nested(tb, NL80211_HE_OBSS_PD_ATTR_MAX, attrs, in nl80211_parse_he_obss_pd()
5676 struct nlattr *attrs, in nl80211_parse_fils_discovery() argument
5687 ret = nla_parse_nested(tb, NL80211_FILS_DISCOVERY_ATTR_MAX, attrs, in nl80211_parse_fils_discovery()
5707 struct nlattr *attrs, in nl80211_parse_unsol_bcast_probe_resp() argument
5720 attrs, NULL, NULL); in nl80211_parse_unsol_bcast_probe_resp()
5933 unsigned int link_id = nl80211_link_id(info->attrs); in nl80211_start_ap()
5950 if (!info->attrs[NL80211_ATTR_BEACON_INTERVAL] || in nl80211_start_ap()
5951 !info->attrs[NL80211_ATTR_DTIM_PERIOD] || in nl80211_start_ap()
5952 !info->attrs[NL80211_ATTR_BEACON_HEAD]) in nl80211_start_ap()
5959 err = nl80211_parse_beacon(rdev, info->attrs, &params->beacon, in nl80211_start_ap()
5965 nla_get_u32(info->attrs[NL80211_ATTR_BEACON_INTERVAL]); in nl80211_start_ap()
5967 nla_get_u32(info->attrs[NL80211_ATTR_DTIM_PERIOD]); in nl80211_start_ap()
5981 if (info->attrs[NL80211_ATTR_SSID]) { in nl80211_start_ap()
5982 params->ssid = nla_data(info->attrs[NL80211_ATTR_SSID]); in nl80211_start_ap()
5984 nla_len(info->attrs[NL80211_ATTR_SSID]); in nl80211_start_ap()
6003 if (info->attrs[NL80211_ATTR_HIDDEN_SSID]) in nl80211_start_ap()
6005 info->attrs[NL80211_ATTR_HIDDEN_SSID]); in nl80211_start_ap()
6007 params->privacy = !!info->attrs[NL80211_ATTR_PRIVACY]; in nl80211_start_ap()
6009 if (info->attrs[NL80211_ATTR_AUTH_TYPE]) { in nl80211_start_ap()
6011 info->attrs[NL80211_ATTR_AUTH_TYPE]); in nl80211_start_ap()
6025 if (info->attrs[NL80211_ATTR_INACTIVITY_TIMEOUT]) { in nl80211_start_ap()
6031 info->attrs[NL80211_ATTR_INACTIVITY_TIMEOUT]); in nl80211_start_ap()
6034 if (info->attrs[NL80211_ATTR_P2P_CTWINDOW]) { in nl80211_start_ap()
6040 nla_get_u8(info->attrs[NL80211_ATTR_P2P_CTWINDOW]); in nl80211_start_ap()
6048 if (info->attrs[NL80211_ATTR_P2P_OPPPS]) { in nl80211_start_ap()
6055 tmp = nla_get_u8(info->attrs[NL80211_ATTR_P2P_OPPPS]); in nl80211_start_ap()
6064 if (info->attrs[NL80211_ATTR_WIPHY_FREQ]) { in nl80211_start_ap()
6079 if (info->attrs[NL80211_ATTR_PUNCT_BITMAP]) { in nl80211_start_ap()
6095 if (info->attrs[NL80211_ATTR_TX_RATES]) { in nl80211_start_ap()
6096 err = nl80211_parse_tx_bitrate_mask(info, info->attrs, in nl80211_start_ap()
6109 if (info->attrs[NL80211_ATTR_SMPS_MODE]) { in nl80211_start_ap()
6111 nla_get_u8(info->attrs[NL80211_ATTR_SMPS_MODE]); in nl80211_start_ap()
6137 params->pbss = nla_get_flag(info->attrs[NL80211_ATTR_PBSS]); in nl80211_start_ap()
6143 if (info->attrs[NL80211_ATTR_ACL_POLICY]) { in nl80211_start_ap()
6153 nla_get_flag(info->attrs[NL80211_ATTR_TWT_RESPONDER]); in nl80211_start_ap()
6155 if (info->attrs[NL80211_ATTR_HE_OBSS_PD]) { in nl80211_start_ap()
6157 info->attrs[NL80211_ATTR_HE_OBSS_PD], in nl80211_start_ap()
6163 if (info->attrs[NL80211_ATTR_FILS_DISCOVERY]) { in nl80211_start_ap()
6165 info->attrs[NL80211_ATTR_FILS_DISCOVERY], in nl80211_start_ap()
6171 if (info->attrs[NL80211_ATTR_UNSOL_BCAST_PROBE_RESP]) { in nl80211_start_ap()
6173 rdev, info->attrs[NL80211_ATTR_UNSOL_BCAST_PROBE_RESP], in nl80211_start_ap()
6179 if (info->attrs[NL80211_ATTR_MBSSID_CONFIG]) { in nl80211_start_ap()
6181 info->attrs[NL80211_ATTR_MBSSID_CONFIG], in nl80211_start_ap()
6203 if (info->attrs[NL80211_ATTR_AP_SETTINGS_FLAGS]) in nl80211_start_ap()
6205 info->attrs[NL80211_ATTR_AP_SETTINGS_FLAGS]); in nl80211_start_ap()
6206 else if (info->attrs[NL80211_ATTR_EXTERNAL_AUTH_SUPPORT]) in nl80211_start_ap()
6210 info->attrs[NL80211_ATTR_SOCKET_OWNER] && in nl80211_start_ap()
6226 if (info->attrs[NL80211_ATTR_SOCKET_OWNER]) in nl80211_start_ap()
6249 unsigned int link_id = nl80211_link_id(info->attrs); in nl80211_set_beacon()
6265 err = nl80211_parse_beacon(rdev, info->attrs, &params, info->extack); in nl80211_set_beacon()
6282 unsigned int link_id = nl80211_link_id(info->attrs); in nl80211_stop_ap()
6309 nla = info->attrs[NL80211_ATTR_STA_FLAGS2]; in parse_station_flags()
6325 nla = info->attrs[NL80211_ATTR_STA_FLAGS]; in parse_station_flags()
6823 if (!info->attrs[NL80211_ATTR_MAC]) in nl80211_get_station()
6826 mac_addr = nla_data(info->attrs[NL80211_ATTR_MAC]); in nl80211_get_station()
7011 struct nlattr *vlanattr = info->attrs[NL80211_ATTR_STA_VLAN]; in get_vlan()
7053 if (!info->attrs[NL80211_ATTR_STA_WME]) in nl80211_parse_sta_wme()
7056 nla = info->attrs[NL80211_ATTR_STA_WME]; in nl80211_parse_sta_wme()
7083 if (info->attrs[NL80211_ATTR_STA_SUPPORTED_CHANNELS]) { in nl80211_parse_sta_channel_info()
7085 nla_data(info->attrs[NL80211_ATTR_STA_SUPPORTED_CHANNELS]); in nl80211_parse_sta_channel_info()
7087 nla_len(info->attrs[NL80211_ATTR_STA_SUPPORTED_CHANNELS]); in nl80211_parse_sta_channel_info()
7097 if (info->attrs[NL80211_ATTR_STA_SUPPORTED_OPER_CLASSES]) { in nl80211_parse_sta_channel_info()
7099 nla_data(info->attrs[NL80211_ATTR_STA_SUPPORTED_OPER_CLASSES]); in nl80211_parse_sta_channel_info()
7101 nla_len(info->attrs[NL80211_ATTR_STA_SUPPORTED_OPER_CLASSES]); in nl80211_parse_sta_channel_info()
7111 if (info->attrs[NL80211_ATTR_PEER_AID]) in nl80211_set_station_tdls()
7112 params->aid = nla_get_u16(info->attrs[NL80211_ATTR_PEER_AID]); in nl80211_set_station_tdls()
7113 if (info->attrs[NL80211_ATTR_HT_CAPABILITY]) in nl80211_set_station_tdls()
7115 nla_data(info->attrs[NL80211_ATTR_HT_CAPABILITY]); in nl80211_set_station_tdls()
7116 if (info->attrs[NL80211_ATTR_VHT_CAPABILITY]) in nl80211_set_station_tdls()
7118 nla_data(info->attrs[NL80211_ATTR_VHT_CAPABILITY]); in nl80211_set_station_tdls()
7119 if (info->attrs[NL80211_ATTR_HE_CAPABILITY]) { in nl80211_set_station_tdls()
7121 nla_data(info->attrs[NL80211_ATTR_HE_CAPABILITY]); in nl80211_set_station_tdls()
7123 nla_len(info->attrs[NL80211_ATTR_HE_CAPABILITY]); in nl80211_set_station_tdls()
7125 if (info->attrs[NL80211_ATTR_EHT_CAPABILITY]) { in nl80211_set_station_tdls()
7127 nla_data(info->attrs[NL80211_ATTR_EHT_CAPABILITY]); in nl80211_set_station_tdls()
7129 nla_len(info->attrs[NL80211_ATTR_EHT_CAPABILITY]); in nl80211_set_station_tdls()
7153 if (info->attrs[NL80211_ATTR_STA_TX_POWER_SETTING]) { in nl80211_parse_sta_txpower_setting()
7160 txpwr->type = nla_get_u8(info->attrs[idx]); in nl80211_parse_sta_txpower_setting()
7165 if (info->attrs[idx]) in nl80211_parse_sta_txpower_setting()
7166 txpwr->power = nla_get_s16(info->attrs[idx]); in nl80211_parse_sta_txpower_setting()
7197 if (info->attrs[NL80211_ATTR_STA_AID]) in nl80211_set_station()
7198 params.aid = nla_get_u16(info->attrs[NL80211_ATTR_STA_AID]); in nl80211_set_station()
7200 if (info->attrs[NL80211_ATTR_VLAN_ID]) in nl80211_set_station()
7201 params.vlan_id = nla_get_u16(info->attrs[NL80211_ATTR_VLAN_ID]); in nl80211_set_station()
7203 if (info->attrs[NL80211_ATTR_STA_LISTEN_INTERVAL]) in nl80211_set_station()
7205 nla_get_u16(info->attrs[NL80211_ATTR_STA_LISTEN_INTERVAL]); in nl80211_set_station()
7209 if (info->attrs[NL80211_ATTR_STA_SUPPORT_P2P_PS]) in nl80211_set_station()
7211 nla_get_u8(info->attrs[NL80211_ATTR_STA_SUPPORT_P2P_PS]); in nl80211_set_station()
7215 if (!info->attrs[NL80211_ATTR_MAC]) in nl80211_set_station()
7219 nl80211_link_id_or_invalid(info->attrs); in nl80211_set_station()
7221 if (info->attrs[NL80211_ATTR_MLD_ADDR]) { in nl80211_set_station()
7230 mac_addr = nla_data(info->attrs[NL80211_ATTR_MLD_ADDR]); in nl80211_set_station()
7233 nla_data(info->attrs[NL80211_ATTR_MAC]); in nl80211_set_station()
7237 mac_addr = nla_data(info->attrs[NL80211_ATTR_MAC]); in nl80211_set_station()
7241 if (info->attrs[NL80211_ATTR_STA_SUPPORTED_RATES]) { in nl80211_set_station()
7243 nla_data(info->attrs[NL80211_ATTR_STA_SUPPORTED_RATES]); in nl80211_set_station()
7245 nla_len(info->attrs[NL80211_ATTR_STA_SUPPORTED_RATES]); in nl80211_set_station()
7248 if (info->attrs[NL80211_ATTR_STA_CAPABILITY]) { in nl80211_set_station()
7250 nla_get_u16(info->attrs[NL80211_ATTR_STA_CAPABILITY]); in nl80211_set_station()
7254 if (info->attrs[NL80211_ATTR_STA_EXT_CAPABILITY]) { in nl80211_set_station()
7256 nla_data(info->attrs[NL80211_ATTR_STA_EXT_CAPABILITY]); in nl80211_set_station()
7258 nla_len(info->attrs[NL80211_ATTR_STA_EXT_CAPABILITY]); in nl80211_set_station()
7264 if (info->attrs[NL80211_ATTR_STA_PLINK_ACTION]) in nl80211_set_station()
7266 nla_get_u8(info->attrs[NL80211_ATTR_STA_PLINK_ACTION]); in nl80211_set_station()
7268 if (info->attrs[NL80211_ATTR_STA_PLINK_STATE]) { in nl80211_set_station()
7270 nla_get_u8(info->attrs[NL80211_ATTR_STA_PLINK_STATE]); in nl80211_set_station()
7271 if (info->attrs[NL80211_ATTR_MESH_PEER_AID]) in nl80211_set_station()
7273 info->attrs[NL80211_ATTR_MESH_PEER_AID]); in nl80211_set_station()
7277 if (info->attrs[NL80211_ATTR_LOCAL_MESH_POWER_MODE]) in nl80211_set_station()
7279 info->attrs[NL80211_ATTR_LOCAL_MESH_POWER_MODE]); in nl80211_set_station()
7281 if (info->attrs[NL80211_ATTR_OPMODE_NOTIF]) { in nl80211_set_station()
7284 nla_get_u8(info->attrs[NL80211_ATTR_OPMODE_NOTIF]); in nl80211_set_station()
7287 if (info->attrs[NL80211_ATTR_HE_6GHZ_CAPABILITY]) in nl80211_set_station()
7289 nla_data(info->attrs[NL80211_ATTR_HE_6GHZ_CAPABILITY]); in nl80211_set_station()
7291 if (info->attrs[NL80211_ATTR_AIRTIME_WEIGHT]) in nl80211_set_station()
7293 nla_get_u16(info->attrs[NL80211_ATTR_AIRTIME_WEIGHT]); in nl80211_set_station()
7356 if (!info->attrs[NL80211_ATTR_MAC]) in nl80211_new_station()
7359 if (!info->attrs[NL80211_ATTR_STA_LISTEN_INTERVAL]) in nl80211_new_station()
7362 if (!info->attrs[NL80211_ATTR_STA_SUPPORTED_RATES]) in nl80211_new_station()
7365 if (!info->attrs[NL80211_ATTR_STA_AID] && in nl80211_new_station()
7366 !info->attrs[NL80211_ATTR_PEER_AID]) in nl80211_new_station()
7370 nl80211_link_id_or_invalid(info->attrs); in nl80211_new_station()
7372 if (info->attrs[NL80211_ATTR_MLD_ADDR]) { in nl80211_new_station()
7373 mac_addr = nla_data(info->attrs[NL80211_ATTR_MLD_ADDR]); in nl80211_new_station()
7376 nla_data(info->attrs[NL80211_ATTR_MAC]); in nl80211_new_station()
7380 mac_addr = nla_data(info->attrs[NL80211_ATTR_MAC]); in nl80211_new_station()
7384 nla_data(info->attrs[NL80211_ATTR_STA_SUPPORTED_RATES]); in nl80211_new_station()
7386 nla_len(info->attrs[NL80211_ATTR_STA_SUPPORTED_RATES]); in nl80211_new_station()
7388 nla_get_u16(info->attrs[NL80211_ATTR_STA_LISTEN_INTERVAL]); in nl80211_new_station()
7390 if (info->attrs[NL80211_ATTR_VLAN_ID]) in nl80211_new_station()
7391 params.vlan_id = nla_get_u16(info->attrs[NL80211_ATTR_VLAN_ID]); in nl80211_new_station()
7393 if (info->attrs[NL80211_ATTR_STA_SUPPORT_P2P_PS]) { in nl80211_new_station()
7395 nla_get_u8(info->attrs[NL80211_ATTR_STA_SUPPORT_P2P_PS]); in nl80211_new_station()
7405 if (info->attrs[NL80211_ATTR_PEER_AID]) in nl80211_new_station()
7406 params.aid = nla_get_u16(info->attrs[NL80211_ATTR_PEER_AID]); in nl80211_new_station()
7408 params.aid = nla_get_u16(info->attrs[NL80211_ATTR_STA_AID]); in nl80211_new_station()
7410 if (info->attrs[NL80211_ATTR_STA_CAPABILITY]) { in nl80211_new_station()
7412 nla_get_u16(info->attrs[NL80211_ATTR_STA_CAPABILITY]); in nl80211_new_station()
7416 if (info->attrs[NL80211_ATTR_STA_EXT_CAPABILITY]) { in nl80211_new_station()
7418 nla_data(info->attrs[NL80211_ATTR_STA_EXT_CAPABILITY]); in nl80211_new_station()
7420 nla_len(info->attrs[NL80211_ATTR_STA_EXT_CAPABILITY]); in nl80211_new_station()
7423 if (info->attrs[NL80211_ATTR_HT_CAPABILITY]) in nl80211_new_station()
7425 nla_data(info->attrs[NL80211_ATTR_HT_CAPABILITY]); in nl80211_new_station()
7427 if (info->attrs[NL80211_ATTR_VHT_CAPABILITY]) in nl80211_new_station()
7429 nla_data(info->attrs[NL80211_ATTR_VHT_CAPABILITY]); in nl80211_new_station()
7431 if (info->attrs[NL80211_ATTR_HE_CAPABILITY]) { in nl80211_new_station()
7433 nla_data(info->attrs[NL80211_ATTR_HE_CAPABILITY]); in nl80211_new_station()
7435 nla_len(info->attrs[NL80211_ATTR_HE_CAPABILITY]); in nl80211_new_station()
7437 if (info->attrs[NL80211_ATTR_EHT_CAPABILITY]) { in nl80211_new_station()
7439 nla_data(info->attrs[NL80211_ATTR_EHT_CAPABILITY]); in nl80211_new_station()
7441 nla_len(info->attrs[NL80211_ATTR_EHT_CAPABILITY]); in nl80211_new_station()
7451 if (info->attrs[NL80211_ATTR_HE_6GHZ_CAPABILITY]) in nl80211_new_station()
7453 nla_data(info->attrs[NL80211_ATTR_HE_6GHZ_CAPABILITY]); in nl80211_new_station()
7455 if (info->attrs[NL80211_ATTR_OPMODE_NOTIF]) { in nl80211_new_station()
7458 nla_get_u8(info->attrs[NL80211_ATTR_OPMODE_NOTIF]); in nl80211_new_station()
7461 if (info->attrs[NL80211_ATTR_STA_PLINK_ACTION]) in nl80211_new_station()
7463 nla_get_u8(info->attrs[NL80211_ATTR_STA_PLINK_ACTION]); in nl80211_new_station()
7465 if (info->attrs[NL80211_ATTR_AIRTIME_WEIGHT]) in nl80211_new_station()
7467 nla_get_u16(info->attrs[NL80211_ATTR_AIRTIME_WEIGHT]); in nl80211_new_station()
7526 info->attrs[NL80211_ATTR_PEER_AID]) in nl80211_new_station()
7566 info->attrs[NL80211_ATTR_PEER_AID]) in nl80211_new_station()
7632 if (info->attrs[NL80211_ATTR_MAC]) in nl80211_del_station()
7633 params.mac = nla_data(info->attrs[NL80211_ATTR_MAC]); in nl80211_del_station()
7655 if (info->attrs[NL80211_ATTR_MGMT_SUBTYPE]) { in nl80211_del_station()
7657 nla_get_u8(info->attrs[NL80211_ATTR_MGMT_SUBTYPE]); in nl80211_del_station()
7666 if (info->attrs[NL80211_ATTR_REASON_CODE]) { in nl80211_del_station()
7668 nla_get_u16(info->attrs[NL80211_ATTR_REASON_CODE]); in nl80211_del_station()
7807 if (!info->attrs[NL80211_ATTR_MAC]) in nl80211_get_mpath()
7810 dst = nla_data(info->attrs[NL80211_ATTR_MAC]); in nl80211_get_mpath()
7842 if (!info->attrs[NL80211_ATTR_MAC]) in nl80211_set_mpath()
7845 if (!info->attrs[NL80211_ATTR_MPATH_NEXT_HOP]) in nl80211_set_mpath()
7848 dst = nla_data(info->attrs[NL80211_ATTR_MAC]); in nl80211_set_mpath()
7849 next_hop = nla_data(info->attrs[NL80211_ATTR_MPATH_NEXT_HOP]); in nl80211_set_mpath()
7867 if (!info->attrs[NL80211_ATTR_MAC]) in nl80211_new_mpath()
7870 if (!info->attrs[NL80211_ATTR_MPATH_NEXT_HOP]) in nl80211_new_mpath()
7873 dst = nla_data(info->attrs[NL80211_ATTR_MAC]); in nl80211_new_mpath()
7874 next_hop = nla_data(info->attrs[NL80211_ATTR_MPATH_NEXT_HOP]); in nl80211_new_mpath()
7891 if (info->attrs[NL80211_ATTR_MAC]) in nl80211_del_mpath()
7892 dst = nla_data(info->attrs[NL80211_ATTR_MAC]); in nl80211_del_mpath()
7915 if (!info->attrs[NL80211_ATTR_MAC]) in nl80211_get_mpp()
7918 dst = nla_data(info->attrs[NL80211_ATTR_MAC]); in nl80211_get_mpp()
8004 params.link_id = nl80211_link_id_or_invalid(info->attrs); in nl80211_set_bss()
8014 if (info->attrs[NL80211_ATTR_BSS_CTS_PROT]) in nl80211_set_bss()
8016 nla_get_u8(info->attrs[NL80211_ATTR_BSS_CTS_PROT]); in nl80211_set_bss()
8017 if (info->attrs[NL80211_ATTR_BSS_SHORT_PREAMBLE]) in nl80211_set_bss()
8019 nla_get_u8(info->attrs[NL80211_ATTR_BSS_SHORT_PREAMBLE]); in nl80211_set_bss()
8020 if (info->attrs[NL80211_ATTR_BSS_SHORT_SLOT_TIME]) in nl80211_set_bss()
8022 nla_get_u8(info->attrs[NL80211_ATTR_BSS_SHORT_SLOT_TIME]); in nl80211_set_bss()
8023 if (info->attrs[NL80211_ATTR_BSS_BASIC_RATES]) { in nl80211_set_bss()
8025 nla_data(info->attrs[NL80211_ATTR_BSS_BASIC_RATES]); in nl80211_set_bss()
8027 nla_len(info->attrs[NL80211_ATTR_BSS_BASIC_RATES]); in nl80211_set_bss()
8029 if (info->attrs[NL80211_ATTR_AP_ISOLATE]) in nl80211_set_bss()
8030 params.ap_isolate = !!nla_get_u8(info->attrs[NL80211_ATTR_AP_ISOLATE]); in nl80211_set_bss()
8031 if (info->attrs[NL80211_ATTR_BSS_HT_OPMODE]) in nl80211_set_bss()
8033 nla_get_u16(info->attrs[NL80211_ATTR_BSS_HT_OPMODE]); in nl80211_set_bss()
8035 if (info->attrs[NL80211_ATTR_P2P_CTWINDOW]) { in nl80211_set_bss()
8039 nla_get_u8(info->attrs[NL80211_ATTR_P2P_CTWINDOW]); in nl80211_set_bss()
8045 if (info->attrs[NL80211_ATTR_P2P_OPPPS]) { in nl80211_set_bss()
8050 tmp = nla_get_u8(info->attrs[NL80211_ATTR_P2P_OPPPS]); in nl80211_set_bss()
8087 if (info->attrs[NL80211_ATTR_USER_REG_HINT_TYPE]) in nl80211_req_set_reg()
8089 nla_get_u32(info->attrs[NL80211_ATTR_USER_REG_HINT_TYPE]); in nl80211_req_set_reg()
8096 if (!info->attrs[NL80211_ATTR_REG_ALPHA2]) in nl80211_req_set_reg()
8099 data = nla_data(info->attrs[NL80211_ATTR_REG_ALPHA2]); in nl80211_req_set_reg()
8102 if (info->attrs[NL80211_ATTR_SOCKET_OWNER]) { in nl80211_req_set_reg()
8104 is_indoor = !!info->attrs[NL80211_ATTR_REG_INDOOR]; in nl80211_req_set_reg()
8315 if (!info->attrs[NL80211_ATTR_MESH_CONFIG]) in nl80211_parse_mesh_config()
8317 …if (nla_parse_nested_deprecated(tb, NL80211_MESHCONF_ATTR_MAX, info->attrs[NL80211_ATTR_MESH_CONFI… in nl80211_parse_mesh_config()
8453 if (!info->attrs[NL80211_ATTR_MESH_SETUP]) in nl80211_parse_mesh_setup()
8455 …if (nla_parse_nested_deprecated(tb, NL80211_MESH_SETUP_ATTR_MAX, info->attrs[NL80211_ATTR_MESH_SET… in nl80211_parse_mesh_setup()
8614 if (info->attrs[NL80211_ATTR_WIPHY]) { in nl80211_get_reg_do()
8809 if (!info->attrs[NL80211_ATTR_REG_ALPHA2]) in nl80211_set_reg()
8812 if (!info->attrs[NL80211_ATTR_REG_RULES]) in nl80211_set_reg()
8815 alpha2 = nla_data(info->attrs[NL80211_ATTR_REG_ALPHA2]); in nl80211_set_reg()
8817 if (info->attrs[NL80211_ATTR_DFS_REGION]) in nl80211_set_reg()
8818 dfs_region = nla_get_u8(info->attrs[NL80211_ATTR_DFS_REGION]); in nl80211_set_reg()
8820 nla_for_each_nested(nl_reg_rule, info->attrs[NL80211_ATTR_REG_RULES], in nl80211_set_reg()
8850 nla_for_each_nested(nl_reg_rule, info->attrs[NL80211_ATTR_REG_RULES], in nl80211_set_reg()
8977 int nl80211_parse_random_mac(struct nlattr **attrs, in nl80211_parse_random_mac() argument
8982 if (!attrs[NL80211_ATTR_MAC] && !attrs[NL80211_ATTR_MAC_MASK]) { in nl80211_parse_random_mac()
8992 if (!attrs[NL80211_ATTR_MAC] || !attrs[NL80211_ATTR_MAC_MASK]) in nl80211_parse_random_mac()
8995 memcpy(mac_addr, nla_data(attrs[NL80211_ATTR_MAC]), ETH_ALEN); in nl80211_parse_random_mac()
8996 memcpy(mac_addr_mask, nla_data(attrs[NL80211_ATTR_MAC_MASK]), ETH_ALEN); in nl80211_parse_random_mac()
9069 void *request, struct nlattr **attrs, in nl80211_check_scan_flags() argument
9076 if (!attrs[NL80211_ATTR_SCAN_FLAGS]) in nl80211_check_scan_flags()
9097 *flags = nla_get_u32(attrs[NL80211_ATTR_SCAN_FLAGS]); in nl80211_check_scan_flags()
9137 err = nl80211_parse_random_mac(attrs, mac_addr, mac_addr_mask); in nl80211_check_scan_flags()
9168 if (info->attrs[NL80211_ATTR_SCAN_FREQ_KHZ]) { in nl80211_trigger_scan()
9172 scan_freqs = info->attrs[NL80211_ATTR_SCAN_FREQ_KHZ]; in nl80211_trigger_scan()
9174 } else if (info->attrs[NL80211_ATTR_SCAN_FREQUENCIES]) in nl80211_trigger_scan()
9175 scan_freqs = info->attrs[NL80211_ATTR_SCAN_FREQUENCIES]; in nl80211_trigger_scan()
9185 if (info->attrs[NL80211_ATTR_SCAN_SSIDS]) in nl80211_trigger_scan()
9186 nla_for_each_nested(attr, info->attrs[NL80211_ATTR_SCAN_SSIDS], tmp) in nl80211_trigger_scan()
9192 if (info->attrs[NL80211_ATTR_IE]) in nl80211_trigger_scan()
9193 ie_len = nla_len(info->attrs[NL80211_ATTR_IE]); in nl80211_trigger_scan()
9288 nla_for_each_nested(attr, info->attrs[NL80211_ATTR_SCAN_SSIDS], tmp) { in nl80211_trigger_scan()
9299 if (info->attrs[NL80211_ATTR_IE]) { in nl80211_trigger_scan()
9300 request->ie_len = nla_len(info->attrs[NL80211_ATTR_IE]); in nl80211_trigger_scan()
9302 nla_data(info->attrs[NL80211_ATTR_IE]), in nl80211_trigger_scan()
9311 if (info->attrs[NL80211_ATTR_SCAN_SUPP_RATES]) { in nl80211_trigger_scan()
9313 info->attrs[NL80211_ATTR_SCAN_SUPP_RATES], in nl80211_trigger_scan()
9334 if (info->attrs[NL80211_ATTR_MEASUREMENT_DURATION]) { in nl80211_trigger_scan()
9336 nla_get_u16(info->attrs[NL80211_ATTR_MEASUREMENT_DURATION]); in nl80211_trigger_scan()
9338 nla_get_flag(info->attrs[NL80211_ATTR_MEASUREMENT_DURATION_MANDATORY]); in nl80211_trigger_scan()
9341 err = nl80211_check_scan_flags(wiphy, wdev, request, info->attrs, in nl80211_trigger_scan()
9347 nla_get_flag(info->attrs[NL80211_ATTR_TX_NO_CCK_RATE]); in nl80211_trigger_scan()
9358 if (info->attrs[NL80211_ATTR_BSSID]) in nl80211_trigger_scan()
9360 nla_data(info->attrs[NL80211_ATTR_BSSID]), ETH_ALEN); in nl80211_trigger_scan()
9362 info->attrs[NL80211_ATTR_MAC]) in nl80211_trigger_scan()
9363 memcpy(request->bssid, nla_data(info->attrs[NL80211_ATTR_MAC]), in nl80211_trigger_scan()
9411 struct nlattr **attrs) in nl80211_parse_sched_scan_plans() argument
9416 if (!attrs[NL80211_ATTR_SCHED_SCAN_PLANS]) { in nl80211_parse_sched_scan_plans()
9425 interval = nla_get_u32(attrs[NL80211_ATTR_SCHED_SCAN_INTERVAL]); in nl80211_parse_sched_scan_plans()
9442 nla_for_each_nested(attr, attrs[NL80211_ATTR_SCHED_SCAN_PLANS], tmp) { in nl80211_parse_sched_scan_plans()
9530 struct nlattr **attrs, int max_match_sets) in nl80211_parse_sched_scan() argument
9540 if (attrs[NL80211_ATTR_SCAN_FREQUENCIES]) { in nl80211_parse_sched_scan()
9542 attrs[NL80211_ATTR_SCAN_FREQUENCIES]); in nl80211_parse_sched_scan()
9549 if (attrs[NL80211_ATTR_SCAN_SSIDS]) in nl80211_parse_sched_scan()
9550 nla_for_each_nested(attr, attrs[NL80211_ATTR_SCAN_SSIDS], in nl80211_parse_sched_scan()
9566 if (attrs[NL80211_ATTR_SCHED_SCAN_MATCH]) { in nl80211_parse_sched_scan()
9568 attrs[NL80211_ATTR_SCHED_SCAN_MATCH], in nl80211_parse_sched_scan()
9604 if (attrs[NL80211_ATTR_IE]) in nl80211_parse_sched_scan()
9605 ie_len = nla_len(attrs[NL80211_ATTR_IE]); in nl80211_parse_sched_scan()
9612 if (attrs[NL80211_ATTR_SCHED_SCAN_PLANS]) { in nl80211_parse_sched_scan()
9617 if (attrs[NL80211_ATTR_SCHED_SCAN_INTERVAL]) in nl80211_parse_sched_scan()
9621 attrs[NL80211_ATTR_SCHED_SCAN_PLANS], tmp) in nl80211_parse_sched_scan()
9630 if (!attrs[NL80211_ATTR_SCHED_SCAN_INTERVAL]) in nl80211_parse_sched_scan()
9641 (attrs[NL80211_ATTR_SCHED_SCAN_RELATIVE_RSSI] || in nl80211_parse_sched_scan()
9642 attrs[NL80211_ATTR_SCHED_SCAN_RSSI_ADJUST])) in nl80211_parse_sched_scan()
9691 if (attrs[NL80211_ATTR_SCAN_FREQUENCIES]) { in nl80211_parse_sched_scan()
9694 attrs[NL80211_ATTR_SCAN_FREQUENCIES], in nl80211_parse_sched_scan()
9742 nla_for_each_nested(attr, attrs[NL80211_ATTR_SCAN_SSIDS], in nl80211_parse_sched_scan()
9756 if (attrs[NL80211_ATTR_SCHED_SCAN_MATCH]) { in nl80211_parse_sched_scan()
9758 attrs[NL80211_ATTR_SCHED_SCAN_MATCH], in nl80211_parse_sched_scan()
9830 nla_data(attrs[NL80211_ATTR_IE]), in nl80211_parse_sched_scan()
9834 err = nl80211_check_scan_flags(wiphy, wdev, request, attrs, true); in nl80211_parse_sched_scan()
9838 if (attrs[NL80211_ATTR_SCHED_SCAN_DELAY]) in nl80211_parse_sched_scan()
9840 nla_get_u32(attrs[NL80211_ATTR_SCHED_SCAN_DELAY]); in nl80211_parse_sched_scan()
9842 if (attrs[NL80211_ATTR_SCHED_SCAN_RELATIVE_RSSI]) { in nl80211_parse_sched_scan()
9844 attrs[NL80211_ATTR_SCHED_SCAN_RELATIVE_RSSI]); in nl80211_parse_sched_scan()
9849 attrs[NL80211_ATTR_SCHED_SCAN_RSSI_ADJUST]) { in nl80211_parse_sched_scan()
9853 attrs[NL80211_ATTR_SCHED_SCAN_RSSI_ADJUST]); in nl80211_parse_sched_scan()
9862 err = nl80211_parse_sched_scan_plans(wiphy, n_plans, request, attrs); in nl80211_parse_sched_scan()
9888 want_multi = info->attrs[NL80211_ATTR_SCHED_SCAN_MULTI]; in nl80211_start_sched_scan()
9894 info->attrs, in nl80211_start_sched_scan()
9914 if (info->attrs[NL80211_ATTR_SOCKET_OWNER]) in nl80211_start_sched_scan()
9938 if (info->attrs[NL80211_ATTR_COOKIE]) { in nl80211_stop_sched_scan()
9939 cookie = nla_get_u64(info->attrs[NL80211_ATTR_COOKIE]); in nl80211_stop_sched_scan()
9992 if (nla_get_flag(info->attrs[NL80211_ATTR_RADAR_BACKGROUND])) { in nl80211_start_radar_detection()
10093 unsigned int link_id = nl80211_link_id(info->attrs); in nl80211_channel_switch()
10138 if (!info->attrs[NL80211_ATTR_WIPHY_FREQ] || in nl80211_channel_switch()
10139 !info->attrs[NL80211_ATTR_CH_SWITCH_COUNT]) in nl80211_channel_switch()
10143 if (need_new_beacon && !info->attrs[NL80211_ATTR_CSA_IES]) in nl80211_channel_switch()
10149 cs_count = nla_get_u32(info->attrs[NL80211_ATTR_CH_SWITCH_COUNT]); in nl80211_channel_switch()
10158 err = nl80211_parse_beacon(rdev, info->attrs, &params.beacon_after, in nl80211_channel_switch()
10171 info->attrs[NL80211_ATTR_CSA_IES], in nl80211_channel_switch()
10273 !nla_get_flag(info->attrs[NL80211_ATTR_HANDLE_DFS])) { in nl80211_channel_switch()
10279 if (info->attrs[NL80211_ATTR_CH_SWITCH_BLOCK_TX]) in nl80211_channel_switch()
10282 if (info->attrs[NL80211_ATTR_PUNCT_BITMAP]) { in nl80211_channel_switch()
10665 if (!info->attrs[NL80211_ATTR_MAC]) in nl80211_authenticate()
10668 if (!info->attrs[NL80211_ATTR_AUTH_TYPE]) in nl80211_authenticate()
10671 if (!info->attrs[NL80211_ATTR_SSID]) in nl80211_authenticate()
10674 if (!info->attrs[NL80211_ATTR_WIPHY_FREQ]) in nl80211_authenticate()
10719 bssid = nla_data(info->attrs[NL80211_ATTR_MAC]); in nl80211_authenticate()
10720 freq = MHZ_TO_KHZ(nla_get_u32(info->attrs[NL80211_ATTR_WIPHY_FREQ])); in nl80211_authenticate()
10721 if (info->attrs[NL80211_ATTR_WIPHY_FREQ_OFFSET]) in nl80211_authenticate()
10723 nla_get_u32(info->attrs[NL80211_ATTR_WIPHY_FREQ_OFFSET]); in nl80211_authenticate()
10729 ssid = nla_data(info->attrs[NL80211_ATTR_SSID]); in nl80211_authenticate()
10730 ssid_len = nla_len(info->attrs[NL80211_ATTR_SSID]); in nl80211_authenticate()
10732 if (info->attrs[NL80211_ATTR_IE]) { in nl80211_authenticate()
10733 req.ie = nla_data(info->attrs[NL80211_ATTR_IE]); in nl80211_authenticate()
10734 req.ie_len = nla_len(info->attrs[NL80211_ATTR_IE]); in nl80211_authenticate()
10737 auth_type = nla_get_u32(info->attrs[NL80211_ATTR_AUTH_TYPE]); in nl80211_authenticate()
10745 !info->attrs[NL80211_ATTR_AUTH_DATA]) in nl80211_authenticate()
10748 if (info->attrs[NL80211_ATTR_AUTH_DATA]) { in nl80211_authenticate()
10754 req.auth_data = nla_data(info->attrs[NL80211_ATTR_AUTH_DATA]); in nl80211_authenticate()
10755 req.auth_data_len = nla_len(info->attrs[NL80211_ATTR_AUTH_DATA]); in nl80211_authenticate()
10758 local_state_change = !!info->attrs[NL80211_ATTR_LOCAL_STATE_CHANGE]; in nl80211_authenticate()
10771 req.link_id = nl80211_link_id_or_invalid(info->attrs); in nl80211_authenticate()
10775 if (!info->attrs[NL80211_ATTR_MLD_ADDR]) in nl80211_authenticate()
10777 req.ap_mld_addr = nla_data(info->attrs[NL80211_ATTR_MLD_ADDR]); in nl80211_authenticate()
10800 if (!info->attrs[NL80211_ATTR_SOCKET_OWNER]) { in validate_pae_over_nl80211()
10820 settings->control_port = info->attrs[NL80211_ATTR_CONTROL_PORT]; in nl80211_crypto_settings()
10822 if (info->attrs[NL80211_ATTR_CONTROL_PORT_ETHERTYPE]) { in nl80211_crypto_settings()
10826 info->attrs[NL80211_ATTR_CONTROL_PORT_ETHERTYPE]); in nl80211_crypto_settings()
10831 if (info->attrs[NL80211_ATTR_CONTROL_PORT_NO_ENCRYPT]) in nl80211_crypto_settings()
10836 if (info->attrs[NL80211_ATTR_CONTROL_PORT_OVER_NL80211]) { in nl80211_crypto_settings()
10844 if (info->attrs[NL80211_ATTR_CONTROL_PORT_NO_PREAUTH]) in nl80211_crypto_settings()
10848 if (info->attrs[NL80211_ATTR_CIPHER_SUITES_PAIRWISE]) { in nl80211_crypto_settings()
10852 data = nla_data(info->attrs[NL80211_ATTR_CIPHER_SUITES_PAIRWISE]); in nl80211_crypto_settings()
10853 len = nla_len(info->attrs[NL80211_ATTR_CIPHER_SUITES_PAIRWISE]); in nl80211_crypto_settings()
10871 if (info->attrs[NL80211_ATTR_CIPHER_SUITE_GROUP]) { in nl80211_crypto_settings()
10873 nla_get_u32(info->attrs[NL80211_ATTR_CIPHER_SUITE_GROUP]); in nl80211_crypto_settings()
10879 if (info->attrs[NL80211_ATTR_WPA_VERSIONS]) { in nl80211_crypto_settings()
10881 nla_get_u32(info->attrs[NL80211_ATTR_WPA_VERSIONS]); in nl80211_crypto_settings()
10886 if (info->attrs[NL80211_ATTR_AKM_SUITES]) { in nl80211_crypto_settings()
10890 data = nla_data(info->attrs[NL80211_ATTR_AKM_SUITES]); in nl80211_crypto_settings()
10891 len = nla_len(info->attrs[NL80211_ATTR_AKM_SUITES]); in nl80211_crypto_settings()
10903 if (info->attrs[NL80211_ATTR_PMK]) { in nl80211_crypto_settings()
10904 if (nla_len(info->attrs[NL80211_ATTR_PMK]) != WLAN_PMK_LEN) in nl80211_crypto_settings()
10911 settings->psk = nla_data(info->attrs[NL80211_ATTR_PMK]); in nl80211_crypto_settings()
10914 if (info->attrs[NL80211_ATTR_SAE_PASSWORD]) { in nl80211_crypto_settings()
10921 nla_data(info->attrs[NL80211_ATTR_SAE_PASSWORD]); in nl80211_crypto_settings()
10923 nla_len(info->attrs[NL80211_ATTR_SAE_PASSWORD]); in nl80211_crypto_settings()
10926 if (info->attrs[NL80211_ATTR_SAE_PWE]) in nl80211_crypto_settings()
10928 nla_get_u8(info->attrs[NL80211_ATTR_SAE_PWE]); in nl80211_crypto_settings()
10937 struct nlattr **attrs) in nl80211_assoc_bss() argument
10944 if (!attrs[NL80211_ATTR_MAC] || !attrs[NL80211_ATTR_WIPHY_FREQ]) in nl80211_assoc_bss()
10947 bssid = nla_data(attrs[NL80211_ATTR_MAC]); in nl80211_assoc_bss()
10949 freq = MHZ_TO_KHZ(nla_get_u32(attrs[NL80211_ATTR_WIPHY_FREQ])); in nl80211_assoc_bss()
10950 if (attrs[NL80211_ATTR_WIPHY_FREQ_OFFSET]) in nl80211_assoc_bss()
10951 freq += nla_get_u32(attrs[NL80211_ATTR_WIPHY_FREQ_OFFSET]); in nl80211_assoc_bss()
10972 struct nlattr **attrs = NULL; in nl80211_associate() local
10981 if (!info->attrs[NL80211_ATTR_SSID]) in nl80211_associate()
10991 ssid = nla_data(info->attrs[NL80211_ATTR_SSID]); in nl80211_associate()
10992 ssid_len = nla_len(info->attrs[NL80211_ATTR_SSID]); in nl80211_associate()
10994 if (info->attrs[NL80211_ATTR_IE]) { in nl80211_associate()
10995 req.ie = nla_data(info->attrs[NL80211_ATTR_IE]); in nl80211_associate()
10996 req.ie_len = nla_len(info->attrs[NL80211_ATTR_IE]); in nl80211_associate()
11006 if (info->attrs[NL80211_ATTR_USE_MFP]) { in nl80211_associate()
11008 nla_get_u32(info->attrs[NL80211_ATTR_USE_MFP]); in nl80211_associate()
11015 if (info->attrs[NL80211_ATTR_PREV_BSSID]) in nl80211_associate()
11016 req.prev_bssid = nla_data(info->attrs[NL80211_ATTR_PREV_BSSID]); in nl80211_associate()
11018 if (nla_get_flag(info->attrs[NL80211_ATTR_DISABLE_HT])) in nl80211_associate()
11021 if (info->attrs[NL80211_ATTR_HT_CAPABILITY_MASK]) in nl80211_associate()
11023 nla_data(info->attrs[NL80211_ATTR_HT_CAPABILITY_MASK]), in nl80211_associate()
11026 if (info->attrs[NL80211_ATTR_HT_CAPABILITY]) { in nl80211_associate()
11027 if (!info->attrs[NL80211_ATTR_HT_CAPABILITY_MASK]) in nl80211_associate()
11030 nla_data(info->attrs[NL80211_ATTR_HT_CAPABILITY]), in nl80211_associate()
11034 if (nla_get_flag(info->attrs[NL80211_ATTR_DISABLE_VHT])) in nl80211_associate()
11037 if (nla_get_flag(info->attrs[NL80211_ATTR_DISABLE_HE])) in nl80211_associate()
11040 if (nla_get_flag(info->attrs[NL80211_ATTR_DISABLE_EHT])) in nl80211_associate()
11043 if (info->attrs[NL80211_ATTR_VHT_CAPABILITY_MASK]) in nl80211_associate()
11045 nla_data(info->attrs[NL80211_ATTR_VHT_CAPABILITY_MASK]), in nl80211_associate()
11048 if (info->attrs[NL80211_ATTR_VHT_CAPABILITY]) { in nl80211_associate()
11049 if (!info->attrs[NL80211_ATTR_VHT_CAPABILITY_MASK]) in nl80211_associate()
11052 nla_data(info->attrs[NL80211_ATTR_VHT_CAPABILITY]), in nl80211_associate()
11056 if (nla_get_flag(info->attrs[NL80211_ATTR_USE_RRM])) { in nl80211_associate()
11066 if (info->attrs[NL80211_ATTR_FILS_KEK]) { in nl80211_associate()
11067 req.fils_kek = nla_data(info->attrs[NL80211_ATTR_FILS_KEK]); in nl80211_associate()
11068 req.fils_kek_len = nla_len(info->attrs[NL80211_ATTR_FILS_KEK]); in nl80211_associate()
11069 if (!info->attrs[NL80211_ATTR_FILS_NONCES]) in nl80211_associate()
11072 nla_data(info->attrs[NL80211_ATTR_FILS_NONCES]); in nl80211_associate()
11075 if (info->attrs[NL80211_ATTR_S1G_CAPABILITY_MASK]) { in nl80211_associate()
11076 if (!info->attrs[NL80211_ATTR_S1G_CAPABILITY]) in nl80211_associate()
11079 nla_data(info->attrs[NL80211_ATTR_S1G_CAPABILITY_MASK]), in nl80211_associate()
11083 if (info->attrs[NL80211_ATTR_S1G_CAPABILITY]) { in nl80211_associate()
11084 if (!info->attrs[NL80211_ATTR_S1G_CAPABILITY_MASK]) in nl80211_associate()
11087 nla_data(info->attrs[NL80211_ATTR_S1G_CAPABILITY]), in nl80211_associate()
11091 req.link_id = nl80211_link_id_or_invalid(info->attrs); in nl80211_associate()
11093 if (info->attrs[NL80211_ATTR_MLO_LINKS]) { in nl80211_associate()
11094 unsigned int attrsize = NUM_NL80211_ATTR * sizeof(*attrs); in nl80211_associate()
11104 if (info->attrs[NL80211_ATTR_MAC] || in nl80211_associate()
11105 info->attrs[NL80211_ATTR_WIPHY_FREQ] || in nl80211_associate()
11106 !info->attrs[NL80211_ATTR_MLD_ADDR]) in nl80211_associate()
11109 req.ap_mld_addr = nla_data(info->attrs[NL80211_ATTR_MLD_ADDR]); in nl80211_associate()
11112 attrs = kzalloc(attrsize, GFP_KERNEL); in nl80211_associate()
11113 if (!attrs) in nl80211_associate()
11117 info->attrs[NL80211_ATTR_MLO_LINKS], in nl80211_associate()
11119 memset(attrs, 0, attrsize); in nl80211_associate()
11121 nla_parse_nested(attrs, NL80211_ATTR_MAX, in nl80211_associate()
11124 if (!attrs[NL80211_ATTR_MLO_LINK_ID]) { in nl80211_associate()
11129 link_id = nla_get_u8(attrs[NL80211_ATTR_MLO_LINK_ID]); in nl80211_associate()
11136 nl80211_assoc_bss(rdev, ssid, ssid_len, attrs); in nl80211_associate()
11143 if (attrs[NL80211_ATTR_IE]) { in nl80211_associate()
11145 nla_data(attrs[NL80211_ATTR_IE]); in nl80211_associate()
11147 nla_len(attrs[NL80211_ATTR_IE]); in nl80211_associate()
11169 nla_get_flag(attrs[NL80211_ATTR_MLO_LINK_DISABLED]); in nl80211_associate()
11191 kfree(attrs); in nl80211_associate()
11192 attrs = NULL; in nl80211_associate()
11197 req.bss = nl80211_assoc_bss(rdev, ssid, ssid_len, info->attrs); in nl80211_associate()
11209 if (!err && info->attrs[NL80211_ATTR_SOCKET_OWNER]) { in nl80211_associate()
11223 kfree(attrs); in nl80211_associate()
11241 if (!info->attrs[NL80211_ATTR_MAC]) in nl80211_deauthenticate()
11244 if (!info->attrs[NL80211_ATTR_REASON_CODE]) in nl80211_deauthenticate()
11254 bssid = nla_data(info->attrs[NL80211_ATTR_MAC]); in nl80211_deauthenticate()
11256 reason_code = nla_get_u16(info->attrs[NL80211_ATTR_REASON_CODE]); in nl80211_deauthenticate()
11262 if (info->attrs[NL80211_ATTR_IE]) { in nl80211_deauthenticate()
11263 ie = nla_data(info->attrs[NL80211_ATTR_IE]); in nl80211_deauthenticate()
11264 ie_len = nla_len(info->attrs[NL80211_ATTR_IE]); in nl80211_deauthenticate()
11267 local_state_change = !!info->attrs[NL80211_ATTR_LOCAL_STATE_CHANGE]; in nl80211_deauthenticate()
11289 if (!info->attrs[NL80211_ATTR_MAC]) in nl80211_disassociate()
11292 if (!info->attrs[NL80211_ATTR_REASON_CODE]) in nl80211_disassociate()
11302 bssid = nla_data(info->attrs[NL80211_ATTR_MAC]); in nl80211_disassociate()
11304 reason_code = nla_get_u16(info->attrs[NL80211_ATTR_REASON_CODE]); in nl80211_disassociate()
11310 if (info->attrs[NL80211_ATTR_IE]) { in nl80211_disassociate()
11311 ie = nla_data(info->attrs[NL80211_ATTR_IE]); in nl80211_disassociate()
11312 ie_len = nla_len(info->attrs[NL80211_ATTR_IE]); in nl80211_disassociate()
11315 local_state_change = !!info->attrs[NL80211_ATTR_LOCAL_STATE_CHANGE]; in nl80211_disassociate()
11363 if (!info->attrs[NL80211_ATTR_SSID] || in nl80211_join_ibss()
11364 !nla_len(info->attrs[NL80211_ATTR_SSID])) in nl80211_join_ibss()
11369 if (info->attrs[NL80211_ATTR_BEACON_INTERVAL]) in nl80211_join_ibss()
11371 nla_get_u32(info->attrs[NL80211_ATTR_BEACON_INTERVAL]); in nl80211_join_ibss()
11386 if (info->attrs[NL80211_ATTR_MAC]) { in nl80211_join_ibss()
11387 ibss.bssid = nla_data(info->attrs[NL80211_ATTR_MAC]); in nl80211_join_ibss()
11392 ibss.ssid = nla_data(info->attrs[NL80211_ATTR_SSID]); in nl80211_join_ibss()
11393 ibss.ssid_len = nla_len(info->attrs[NL80211_ATTR_SSID]); in nl80211_join_ibss()
11395 if (info->attrs[NL80211_ATTR_IE]) { in nl80211_join_ibss()
11396 ibss.ie = nla_data(info->attrs[NL80211_ATTR_IE]); in nl80211_join_ibss()
11397 ibss.ie_len = nla_len(info->attrs[NL80211_ATTR_IE]); in nl80211_join_ibss()
11433 ibss.channel_fixed = !!info->attrs[NL80211_ATTR_FREQ_FIXED]; in nl80211_join_ibss()
11434 ibss.privacy = !!info->attrs[NL80211_ATTR_PRIVACY]; in nl80211_join_ibss()
11436 if (info->attrs[NL80211_ATTR_BSS_BASIC_RATES]) { in nl80211_join_ibss()
11438 nla_data(info->attrs[NL80211_ATTR_BSS_BASIC_RATES]); in nl80211_join_ibss()
11440 nla_len(info->attrs[NL80211_ATTR_BSS_BASIC_RATES]); in nl80211_join_ibss()
11450 if (info->attrs[NL80211_ATTR_HT_CAPABILITY_MASK]) in nl80211_join_ibss()
11452 nla_data(info->attrs[NL80211_ATTR_HT_CAPABILITY_MASK]), in nl80211_join_ibss()
11455 if (info->attrs[NL80211_ATTR_HT_CAPABILITY]) { in nl80211_join_ibss()
11456 if (!info->attrs[NL80211_ATTR_HT_CAPABILITY_MASK]) in nl80211_join_ibss()
11459 nla_data(info->attrs[NL80211_ATTR_HT_CAPABILITY]), in nl80211_join_ibss()
11463 if (info->attrs[NL80211_ATTR_MCAST_RATE] && in nl80211_join_ibss()
11465 nla_get_u32(info->attrs[NL80211_ATTR_MCAST_RATE]))) in nl80211_join_ibss()
11468 if (ibss.privacy && info->attrs[NL80211_ATTR_KEYS]) { in nl80211_join_ibss()
11483 nla_get_flag(info->attrs[NL80211_ATTR_CONTROL_PORT]); in nl80211_join_ibss()
11485 if (info->attrs[NL80211_ATTR_CONTROL_PORT_OVER_NL80211]) { in nl80211_join_ibss()
11497 nla_get_flag(info->attrs[NL80211_ATTR_HANDLE_DFS]); in nl80211_join_ibss()
11503 else if (info->attrs[NL80211_ATTR_SOCKET_OWNER]) in nl80211_join_ibss()
11541 if (!info->attrs[NL80211_ATTR_MCAST_RATE]) in nl80211_set_mcast_rate()
11544 nla_rate = nla_get_u32(info->attrs[NL80211_ATTR_MCAST_RATE]); in nl80211_set_mcast_rate()
11680 info->attrs); in nl80211_testmode_do()
11694 if (!info->attrs[NL80211_ATTR_TESTDATA]) in nl80211_testmode_do()
11699 nla_data(info->attrs[NL80211_ATTR_TESTDATA]), in nl80211_testmode_do()
11700 nla_len(info->attrs[NL80211_ATTR_TESTDATA])); in nl80211_testmode_do()
11821 if (!info->attrs[NL80211_ATTR_SSID] || in nl80211_connect()
11822 !nla_len(info->attrs[NL80211_ATTR_SSID])) in nl80211_connect()
11825 if (info->attrs[NL80211_ATTR_AUTH_TYPE]) { in nl80211_connect()
11827 nla_get_u32(info->attrs[NL80211_ATTR_AUTH_TYPE]); in nl80211_connect()
11834 connect.privacy = info->attrs[NL80211_ATTR_PRIVACY]; in nl80211_connect()
11836 if (info->attrs[NL80211_ATTR_WANT_1X_4WAY_HS] && in nl80211_connect()
11840 connect.want_1x = info->attrs[NL80211_ATTR_WANT_1X_4WAY_HS]; in nl80211_connect()
11854 if (info->attrs[NL80211_ATTR_BG_SCAN_PERIOD] && in nl80211_connect()
11857 nla_get_u16(info->attrs[NL80211_ATTR_BG_SCAN_PERIOD]); in nl80211_connect()
11860 if (info->attrs[NL80211_ATTR_MAC]) in nl80211_connect()
11861 connect.bssid = nla_data(info->attrs[NL80211_ATTR_MAC]); in nl80211_connect()
11862 else if (info->attrs[NL80211_ATTR_MAC_HINT]) in nl80211_connect()
11864 nla_data(info->attrs[NL80211_ATTR_MAC_HINT]); in nl80211_connect()
11865 connect.ssid = nla_data(info->attrs[NL80211_ATTR_SSID]); in nl80211_connect()
11866 connect.ssid_len = nla_len(info->attrs[NL80211_ATTR_SSID]); in nl80211_connect()
11868 if (info->attrs[NL80211_ATTR_IE]) { in nl80211_connect()
11869 connect.ie = nla_data(info->attrs[NL80211_ATTR_IE]); in nl80211_connect()
11870 connect.ie_len = nla_len(info->attrs[NL80211_ATTR_IE]); in nl80211_connect()
11873 if (info->attrs[NL80211_ATTR_USE_MFP]) { in nl80211_connect()
11874 connect.mfp = nla_get_u32(info->attrs[NL80211_ATTR_USE_MFP]); in nl80211_connect()
11883 if (info->attrs[NL80211_ATTR_PREV_BSSID]) in nl80211_connect()
11885 nla_data(info->attrs[NL80211_ATTR_PREV_BSSID]); in nl80211_connect()
11887 if (info->attrs[NL80211_ATTR_WIPHY_FREQ]) in nl80211_connect()
11889 info->attrs[NL80211_ATTR_WIPHY_FREQ])); in nl80211_connect()
11890 if (info->attrs[NL80211_ATTR_WIPHY_FREQ_OFFSET]) in nl80211_connect()
11892 nla_get_u32(info->attrs[NL80211_ATTR_WIPHY_FREQ_OFFSET]); in nl80211_connect()
11898 } else if (info->attrs[NL80211_ATTR_WIPHY_FREQ_HINT]) { in nl80211_connect()
11899 freq = nla_get_u32(info->attrs[NL80211_ATTR_WIPHY_FREQ_HINT]); in nl80211_connect()
11906 if (info->attrs[NL80211_ATTR_WIPHY_EDMG_CHANNELS]) { in nl80211_connect()
11908 nla_get_u8(info->attrs[NL80211_ATTR_WIPHY_EDMG_CHANNELS]); in nl80211_connect()
11910 if (info->attrs[NL80211_ATTR_WIPHY_EDMG_BW_CONFIG]) in nl80211_connect()
11912 nla_get_u8(info->attrs[NL80211_ATTR_WIPHY_EDMG_BW_CONFIG]); in nl80211_connect()
11915 if (connect.privacy && info->attrs[NL80211_ATTR_KEYS]) { in nl80211_connect()
11921 if (nla_get_flag(info->attrs[NL80211_ATTR_DISABLE_HT])) in nl80211_connect()
11924 if (info->attrs[NL80211_ATTR_HT_CAPABILITY_MASK]) in nl80211_connect()
11926 nla_data(info->attrs[NL80211_ATTR_HT_CAPABILITY_MASK]), in nl80211_connect()
11929 if (info->attrs[NL80211_ATTR_HT_CAPABILITY]) { in nl80211_connect()
11930 if (!info->attrs[NL80211_ATTR_HT_CAPABILITY_MASK]) { in nl80211_connect()
11935 nla_data(info->attrs[NL80211_ATTR_HT_CAPABILITY]), in nl80211_connect()
11939 if (nla_get_flag(info->attrs[NL80211_ATTR_DISABLE_VHT])) in nl80211_connect()
11942 if (nla_get_flag(info->attrs[NL80211_ATTR_DISABLE_HE])) in nl80211_connect()
11945 if (nla_get_flag(info->attrs[NL80211_ATTR_DISABLE_EHT])) in nl80211_connect()
11948 if (info->attrs[NL80211_ATTR_VHT_CAPABILITY_MASK]) in nl80211_connect()
11950 nla_data(info->attrs[NL80211_ATTR_VHT_CAPABILITY_MASK]), in nl80211_connect()
11953 if (info->attrs[NL80211_ATTR_VHT_CAPABILITY]) { in nl80211_connect()
11954 if (!info->attrs[NL80211_ATTR_VHT_CAPABILITY_MASK]) { in nl80211_connect()
11959 nla_data(info->attrs[NL80211_ATTR_VHT_CAPABILITY]), in nl80211_connect()
11963 if (nla_get_flag(info->attrs[NL80211_ATTR_USE_RRM])) { in nl80211_connect()
11975 connect.pbss = nla_get_flag(info->attrs[NL80211_ATTR_PBSS]); in nl80211_connect()
11981 if (info->attrs[NL80211_ATTR_BSS_SELECT]) { in nl80211_connect()
11988 err = parse_bss_select(info->attrs[NL80211_ATTR_BSS_SELECT], in nl80211_connect()
11998 info->attrs[NL80211_ATTR_FILS_ERP_USERNAME] && in nl80211_connect()
11999 info->attrs[NL80211_ATTR_FILS_ERP_REALM] && in nl80211_connect()
12000 info->attrs[NL80211_ATTR_FILS_ERP_NEXT_SEQ_NUM] && in nl80211_connect()
12001 info->attrs[NL80211_ATTR_FILS_ERP_RRK]) { in nl80211_connect()
12003 nla_data(info->attrs[NL80211_ATTR_FILS_ERP_USERNAME]); in nl80211_connect()
12005 nla_len(info->attrs[NL80211_ATTR_FILS_ERP_USERNAME]); in nl80211_connect()
12007 nla_data(info->attrs[NL80211_ATTR_FILS_ERP_REALM]); in nl80211_connect()
12009 nla_len(info->attrs[NL80211_ATTR_FILS_ERP_REALM]); in nl80211_connect()
12012 info->attrs[NL80211_ATTR_FILS_ERP_NEXT_SEQ_NUM]); in nl80211_connect()
12014 nla_data(info->attrs[NL80211_ATTR_FILS_ERP_RRK]); in nl80211_connect()
12016 nla_len(info->attrs[NL80211_ATTR_FILS_ERP_RRK]); in nl80211_connect()
12017 } else if (info->attrs[NL80211_ATTR_FILS_ERP_USERNAME] || in nl80211_connect()
12018 info->attrs[NL80211_ATTR_FILS_ERP_REALM] || in nl80211_connect()
12019 info->attrs[NL80211_ATTR_FILS_ERP_NEXT_SEQ_NUM] || in nl80211_connect()
12020 info->attrs[NL80211_ATTR_FILS_ERP_RRK]) { in nl80211_connect()
12025 if (nla_get_flag(info->attrs[NL80211_ATTR_EXTERNAL_AUTH_SUPPORT])) { in nl80211_connect()
12026 if (!info->attrs[NL80211_ATTR_SOCKET_OWNER]) { in nl80211_connect()
12035 if (nla_get_flag(info->attrs[NL80211_ATTR_MLO_SUPPORT])) in nl80211_connect()
12045 if (!err && info->attrs[NL80211_ATTR_SOCKET_OWNER]) { in nl80211_connect()
12074 if (info->attrs[NL80211_ATTR_IE]) { in nl80211_update_connect_params()
12075 connect.ie = nla_data(info->attrs[NL80211_ATTR_IE]); in nl80211_update_connect_params()
12076 connect.ie_len = nla_len(info->attrs[NL80211_ATTR_IE]); in nl80211_update_connect_params()
12089 info->attrs[NL80211_ATTR_FILS_ERP_USERNAME] && in nl80211_update_connect_params()
12090 info->attrs[NL80211_ATTR_FILS_ERP_REALM] && in nl80211_update_connect_params()
12091 info->attrs[NL80211_ATTR_FILS_ERP_NEXT_SEQ_NUM] && in nl80211_update_connect_params()
12092 info->attrs[NL80211_ATTR_FILS_ERP_RRK]) { in nl80211_update_connect_params()
12094 nla_data(info->attrs[NL80211_ATTR_FILS_ERP_USERNAME]); in nl80211_update_connect_params()
12096 nla_len(info->attrs[NL80211_ATTR_FILS_ERP_USERNAME]); in nl80211_update_connect_params()
12098 nla_data(info->attrs[NL80211_ATTR_FILS_ERP_REALM]); in nl80211_update_connect_params()
12100 nla_len(info->attrs[NL80211_ATTR_FILS_ERP_REALM]); in nl80211_update_connect_params()
12103 info->attrs[NL80211_ATTR_FILS_ERP_NEXT_SEQ_NUM]); in nl80211_update_connect_params()
12105 nla_data(info->attrs[NL80211_ATTR_FILS_ERP_RRK]); in nl80211_update_connect_params()
12107 nla_len(info->attrs[NL80211_ATTR_FILS_ERP_RRK]); in nl80211_update_connect_params()
12109 } else if (info->attrs[NL80211_ATTR_FILS_ERP_USERNAME] || in nl80211_update_connect_params()
12110 info->attrs[NL80211_ATTR_FILS_ERP_REALM] || in nl80211_update_connect_params()
12111 info->attrs[NL80211_ATTR_FILS_ERP_NEXT_SEQ_NUM] || in nl80211_update_connect_params()
12112 info->attrs[NL80211_ATTR_FILS_ERP_RRK]) { in nl80211_update_connect_params()
12116 if (info->attrs[NL80211_ATTR_AUTH_TYPE]) { in nl80211_update_connect_params()
12117 auth_type = nla_get_u32(info->attrs[NL80211_ATTR_AUTH_TYPE]); in nl80211_update_connect_params()
12151 if (!info->attrs[NL80211_ATTR_REASON_CODE]) in nl80211_disconnect()
12154 reason = nla_get_u16(info->attrs[NL80211_ATTR_REASON_CODE]); in nl80211_disconnect()
12175 if (info->attrs[NL80211_ATTR_PID]) { in nl80211_wiphy_netns()
12176 u32 pid = nla_get_u32(info->attrs[NL80211_ATTR_PID]); in nl80211_wiphy_netns()
12179 } else if (info->attrs[NL80211_ATTR_NETNS_FD]) { in nl80211_wiphy_netns()
12180 u32 fd = nla_get_u32(info->attrs[NL80211_ATTR_NETNS_FD]); in nl80211_wiphy_netns()
12210 if (!info->attrs[NL80211_ATTR_PMKID]) in nl80211_setdel_pmksa()
12213 pmksa.pmkid = nla_data(info->attrs[NL80211_ATTR_PMKID]); in nl80211_setdel_pmksa()
12215 if (info->attrs[NL80211_ATTR_MAC]) { in nl80211_setdel_pmksa()
12216 pmksa.bssid = nla_data(info->attrs[NL80211_ATTR_MAC]); in nl80211_setdel_pmksa()
12217 } else if (info->attrs[NL80211_ATTR_SSID] && in nl80211_setdel_pmksa()
12218 info->attrs[NL80211_ATTR_FILS_CACHE_ID] && in nl80211_setdel_pmksa()
12220 info->attrs[NL80211_ATTR_PMK])) { in nl80211_setdel_pmksa()
12221 pmksa.ssid = nla_data(info->attrs[NL80211_ATTR_SSID]); in nl80211_setdel_pmksa()
12222 pmksa.ssid_len = nla_len(info->attrs[NL80211_ATTR_SSID]); in nl80211_setdel_pmksa()
12224 nla_data(info->attrs[NL80211_ATTR_FILS_CACHE_ID]); in nl80211_setdel_pmksa()
12228 if (info->attrs[NL80211_ATTR_PMK]) { in nl80211_setdel_pmksa()
12229 pmksa.pmk = nla_data(info->attrs[NL80211_ATTR_PMK]); in nl80211_setdel_pmksa()
12230 pmksa.pmk_len = nla_len(info->attrs[NL80211_ATTR_PMK]); in nl80211_setdel_pmksa()
12233 if (info->attrs[NL80211_ATTR_PMK_LIFETIME]) in nl80211_setdel_pmksa()
12235 nla_get_u32(info->attrs[NL80211_ATTR_PMK_LIFETIME]); in nl80211_setdel_pmksa()
12237 if (info->attrs[NL80211_ATTR_PMK_REAUTH_THRESHOLD]) in nl80211_setdel_pmksa()
12240 info->attrs[NL80211_ATTR_PMK_REAUTH_THRESHOLD]); in nl80211_setdel_pmksa()
12297 if (!info->attrs[NL80211_ATTR_TDLS_ACTION] || in nl80211_tdls_mgmt()
12298 !info->attrs[NL80211_ATTR_STATUS_CODE] || in nl80211_tdls_mgmt()
12299 !info->attrs[NL80211_ATTR_TDLS_DIALOG_TOKEN] || in nl80211_tdls_mgmt()
12300 !info->attrs[NL80211_ATTR_IE] || in nl80211_tdls_mgmt()
12301 !info->attrs[NL80211_ATTR_MAC]) in nl80211_tdls_mgmt()
12304 peer = nla_data(info->attrs[NL80211_ATTR_MAC]); in nl80211_tdls_mgmt()
12305 action_code = nla_get_u8(info->attrs[NL80211_ATTR_TDLS_ACTION]); in nl80211_tdls_mgmt()
12306 status_code = nla_get_u16(info->attrs[NL80211_ATTR_STATUS_CODE]); in nl80211_tdls_mgmt()
12307 dialog_token = nla_get_u8(info->attrs[NL80211_ATTR_TDLS_DIALOG_TOKEN]); in nl80211_tdls_mgmt()
12308 initiator = nla_get_flag(info->attrs[NL80211_ATTR_TDLS_INITIATOR]); in nl80211_tdls_mgmt()
12309 if (info->attrs[NL80211_ATTR_TDLS_PEER_CAPABILITY]) in nl80211_tdls_mgmt()
12311 nla_get_u32(info->attrs[NL80211_ATTR_TDLS_PEER_CAPABILITY]); in nl80211_tdls_mgmt()
12312 link_id = nl80211_link_id_or_invalid(info->attrs); in nl80211_tdls_mgmt()
12317 nla_data(info->attrs[NL80211_ATTR_IE]), in nl80211_tdls_mgmt()
12318 nla_len(info->attrs[NL80211_ATTR_IE])); in nl80211_tdls_mgmt()
12332 if (!info->attrs[NL80211_ATTR_TDLS_OPERATION] || in nl80211_tdls_oper()
12333 !info->attrs[NL80211_ATTR_MAC]) in nl80211_tdls_oper()
12336 operation = nla_get_u8(info->attrs[NL80211_ATTR_TDLS_OPERATION]); in nl80211_tdls_oper()
12337 peer = nla_data(info->attrs[NL80211_ATTR_MAC]); in nl80211_tdls_oper()
12346 unsigned int link_id = nl80211_link_id(info->attrs); in nl80211_remain_on_channel()
12355 if (!info->attrs[NL80211_ATTR_WIPHY_FREQ] || in nl80211_remain_on_channel()
12356 !info->attrs[NL80211_ATTR_DURATION]) in nl80211_remain_on_channel()
12359 duration = nla_get_u32(info->attrs[NL80211_ATTR_DURATION]); in nl80211_remain_on_channel()
12440 if (!info->attrs[NL80211_ATTR_COOKIE]) in nl80211_cancel_remain_on_channel()
12446 cookie = nla_get_u64(info->attrs[NL80211_ATTR_COOKIE]); in nl80211_cancel_remain_on_channel()
12455 unsigned int link_id = nl80211_link_id(info->attrs); in nl80211_set_tx_bitrate_mask()
12465 err = nl80211_parse_tx_bitrate_mask(info, info->attrs, in nl80211_set_tx_bitrate_mask()
12483 if (!info->attrs[NL80211_ATTR_FRAME_MATCH]) in nl80211_register_mgmt()
12486 if (info->attrs[NL80211_ATTR_FRAME_TYPE]) in nl80211_register_mgmt()
12487 frame_type = nla_get_u16(info->attrs[NL80211_ATTR_FRAME_TYPE]); in nl80211_register_mgmt()
12512 if (info->attrs[NL80211_ATTR_RECEIVE_MULTICAST] && in nl80211_register_mgmt()
12521 nla_data(info->attrs[NL80211_ATTR_FRAME_MATCH]), in nl80211_register_mgmt()
12522 nla_len(info->attrs[NL80211_ATTR_FRAME_MATCH]), in nl80211_register_mgmt()
12523 info->attrs[NL80211_ATTR_RECEIVE_MULTICAST], in nl80211_register_mgmt()
12538 info->attrs[NL80211_ATTR_DONT_WAIT_FOR_ACK], in nl80211_tx_mgmt()
12541 if (!info->attrs[NL80211_ATTR_FRAME]) in nl80211_tx_mgmt()
12549 if (!info->attrs[NL80211_ATTR_WIPHY_FREQ]) in nl80211_tx_mgmt()
12569 if (info->attrs[NL80211_ATTR_DURATION]) { in nl80211_tx_mgmt()
12572 params.wait = nla_get_u32(info->attrs[NL80211_ATTR_DURATION]); in nl80211_tx_mgmt()
12583 params.offchan = info->attrs[NL80211_ATTR_OFFCHANNEL_TX_OK]; in nl80211_tx_mgmt()
12588 params.no_cck = nla_get_flag(info->attrs[NL80211_ATTR_TX_NO_CCK_RATE]); in nl80211_tx_mgmt()
12594 if (info->attrs[NL80211_ATTR_WIPHY_FREQ]) { in nl80211_tx_mgmt()
12610 params.link_id = nl80211_link_id_or_invalid(info->attrs); in nl80211_tx_mgmt()
12623 params.buf = nla_data(info->attrs[NL80211_ATTR_FRAME]); in nl80211_tx_mgmt()
12624 params.len = nla_len(info->attrs[NL80211_ATTR_FRAME]); in nl80211_tx_mgmt()
12626 if (info->attrs[NL80211_ATTR_CSA_C_OFFSETS_TX]) { in nl80211_tx_mgmt()
12627 int len = nla_len(info->attrs[NL80211_ATTR_CSA_C_OFFSETS_TX]); in nl80211_tx_mgmt()
12635 nla_data(info->attrs[NL80211_ATTR_CSA_C_OFFSETS_TX]); in nl80211_tx_mgmt()
12686 if (!info->attrs[NL80211_ATTR_COOKIE]) in nl80211_tx_mgmt_cancel_wait()
12710 cookie = nla_get_u64(info->attrs[NL80211_ATTR_COOKIE]); in nl80211_tx_mgmt_cancel_wait()
12724 if (!info->attrs[NL80211_ATTR_PS_STATE]) in nl80211_set_power_save()
12727 ps_state = nla_get_u32(info->attrs[NL80211_ATTR_PS_STATE]); in nl80211_set_power_save()
12979 struct nlattr *attrs[NL80211_ATTR_CQM_MAX + 1]; in nl80211_set_cqm() local
12983 cqm = info->attrs[NL80211_ATTR_CQM]; in nl80211_set_cqm()
12987 err = nla_parse_nested_deprecated(attrs, NL80211_ATTR_CQM_MAX, cqm, in nl80211_set_cqm()
12993 if (attrs[NL80211_ATTR_CQM_RSSI_THOLD] && in nl80211_set_cqm()
12994 attrs[NL80211_ATTR_CQM_RSSI_HYST]) { in nl80211_set_cqm()
12996 nla_data(attrs[NL80211_ATTR_CQM_RSSI_THOLD]); in nl80211_set_cqm()
12997 int len = nla_len(attrs[NL80211_ATTR_CQM_RSSI_THOLD]); in nl80211_set_cqm()
12998 u32 hysteresis = nla_get_u32(attrs[NL80211_ATTR_CQM_RSSI_HYST]); in nl80211_set_cqm()
13007 if (attrs[NL80211_ATTR_CQM_TXE_RATE] && in nl80211_set_cqm()
13008 attrs[NL80211_ATTR_CQM_TXE_PKTS] && in nl80211_set_cqm()
13009 attrs[NL80211_ATTR_CQM_TXE_INTVL]) { in nl80211_set_cqm()
13010 u32 rate = nla_get_u32(attrs[NL80211_ATTR_CQM_TXE_RATE]); in nl80211_set_cqm()
13011 u32 pkts = nla_get_u32(attrs[NL80211_ATTR_CQM_TXE_PKTS]); in nl80211_set_cqm()
13012 u32 intvl = nla_get_u32(attrs[NL80211_ATTR_CQM_TXE_INTVL]); in nl80211_set_cqm()
13054 if (info->attrs[NL80211_ATTR_MESH_CONFIG]) { in nl80211_join_mesh()
13061 if (!info->attrs[NL80211_ATTR_MESH_ID] || in nl80211_join_mesh()
13062 !nla_len(info->attrs[NL80211_ATTR_MESH_ID])) in nl80211_join_mesh()
13065 setup.mesh_id = nla_data(info->attrs[NL80211_ATTR_MESH_ID]); in nl80211_join_mesh()
13066 setup.mesh_id_len = nla_len(info->attrs[NL80211_ATTR_MESH_ID]); in nl80211_join_mesh()
13068 if (info->attrs[NL80211_ATTR_MCAST_RATE] && in nl80211_join_mesh()
13070 nla_get_u32(info->attrs[NL80211_ATTR_MCAST_RATE]))) in nl80211_join_mesh()
13073 if (info->attrs[NL80211_ATTR_BEACON_INTERVAL]) { in nl80211_join_mesh()
13075 nla_get_u32(info->attrs[NL80211_ATTR_BEACON_INTERVAL]); in nl80211_join_mesh()
13084 if (info->attrs[NL80211_ATTR_DTIM_PERIOD]) { in nl80211_join_mesh()
13086 nla_get_u32(info->attrs[NL80211_ATTR_DTIM_PERIOD]); in nl80211_join_mesh()
13091 if (info->attrs[NL80211_ATTR_MESH_SETUP]) { in nl80211_join_mesh()
13101 if (info->attrs[NL80211_ATTR_WIPHY_FREQ]) { in nl80211_join_mesh()
13110 if (info->attrs[NL80211_ATTR_BSS_BASIC_RATES]) { in nl80211_join_mesh()
13111 u8 *rates = nla_data(info->attrs[NL80211_ATTR_BSS_BASIC_RATES]); in nl80211_join_mesh()
13113 nla_len(info->attrs[NL80211_ATTR_BSS_BASIC_RATES]); in nl80211_join_mesh()
13127 if (info->attrs[NL80211_ATTR_TX_RATES]) { in nl80211_join_mesh()
13128 err = nl80211_parse_tx_bitrate_mask(info, info->attrs, in nl80211_join_mesh()
13145 nla_get_flag(info->attrs[NL80211_ATTR_HANDLE_DFS]); in nl80211_join_mesh()
13147 if (info->attrs[NL80211_ATTR_CONTROL_PORT_OVER_NL80211]) { in nl80211_join_mesh()
13158 if (!err && info->attrs[NL80211_ATTR_SOCKET_OWNER]) in nl80211_join_mesh()
13608 if (!info->attrs[NL80211_ATTR_WOWLAN_TRIGGERS]) { in nl80211_set_wowlan()
13615 info->attrs[NL80211_ATTR_WOWLAN_TRIGGERS], in nl80211_set_wowlan()
14009 if (!info->attrs[NL80211_ATTR_COALESCE_RULE]) { in nl80211_set_coalesce()
14015 nla_for_each_nested(rule, info->attrs[NL80211_ATTR_COALESCE_RULE], in nl80211_set_coalesce()
14029 nla_for_each_nested(rule, info->attrs[NL80211_ATTR_COALESCE_RULE], in nl80211_set_coalesce()
14073 if (!info->attrs[NL80211_ATTR_REKEY_DATA]) in nl80211_set_rekey_data()
14077 info->attrs[NL80211_ATTR_REKEY_DATA], in nl80211_set_rekey_data()
14154 if (!info->attrs[NL80211_ATTR_MAC]) in nl80211_probe_client()
14171 addr = nla_data(info->attrs[NL80211_ATTR_MAC]); in nl80211_probe_client()
14286 if (!info->attrs[NL80211_ATTR_NAN_MASTER_PREF]) in nl80211_start_nan()
14290 nla_get_u8(info->attrs[NL80211_ATTR_NAN_MASTER_PREF]); in nl80211_start_nan()
14292 if (info->attrs[NL80211_ATTR_BANDS]) { in nl80211_start_nan()
14293 u32 bands = nla_get_u32(info->attrs[NL80211_ATTR_BANDS]); in nl80211_start_nan()
14407 if (!info->attrs[NL80211_ATTR_NAN_FUNC]) in nl80211_nan_add_func()
14411 info->attrs[NL80211_ATTR_NAN_FUNC], in nl80211_nan_add_func()
14641 if (!info->attrs[NL80211_ATTR_COOKIE]) in nl80211_nan_del_func()
14644 cookie = nla_get_u64(info->attrs[NL80211_ATTR_COOKIE]); in nl80211_nan_del_func()
14665 if (info->attrs[NL80211_ATTR_NAN_MASTER_PREF]) { in nl80211_nan_change_config()
14667 nla_get_u8(info->attrs[NL80211_ATTR_NAN_MASTER_PREF]); in nl80211_nan_change_config()
14674 if (info->attrs[NL80211_ATTR_BANDS]) { in nl80211_nan_change_config()
14675 u32 bands = nla_get_u32(info->attrs[NL80211_ATTR_BANDS]); in nl80211_nan_change_config()
14869 if (!info->attrs[NL80211_ATTR_MDID] || in nl80211_update_ft_ies()
14870 !info->attrs[NL80211_ATTR_IE]) in nl80211_update_ft_ies()
14874 ft_params.md = nla_get_u16(info->attrs[NL80211_ATTR_MDID]); in nl80211_update_ft_ies()
14875 ft_params.ie = nla_data(info->attrs[NL80211_ATTR_IE]); in nl80211_update_ft_ies()
14876 ft_params.ie_len = nla_len(info->attrs[NL80211_ATTR_IE]); in nl80211_update_ft_ies()
14900 if (info->attrs[NL80211_ATTR_CRIT_PROT_ID]) in nl80211_crit_protocol_start()
14901 proto = nla_get_u16(info->attrs[NL80211_ATTR_CRIT_PROT_ID]); in nl80211_crit_protocol_start()
14907 if (!info->attrs[NL80211_ATTR_MAX_CRIT_PROT_DURATION]) in nl80211_crit_protocol_start()
14911 nla_get_u16(info->attrs[NL80211_ATTR_MAX_CRIT_PROT_DURATION]); in nl80211_crit_protocol_start()
14963 info->attrs); in nl80211_vendor_cmd()
14979 if (!info->attrs[NL80211_ATTR_VENDOR_ID] || in nl80211_vendor_cmd()
14980 !info->attrs[NL80211_ATTR_VENDOR_SUBCMD]) in nl80211_vendor_cmd()
14983 vid = nla_get_u32(info->attrs[NL80211_ATTR_VENDOR_ID]); in nl80211_vendor_cmd()
14984 subcmd = nla_get_u32(info->attrs[NL80211_ATTR_VENDOR_SUBCMD]); in nl80211_vendor_cmd()
15014 if (info->attrs[NL80211_ATTR_VENDOR_DATA]) { in nl80211_vendor_cmd()
15015 data = nla_data(info->attrs[NL80211_ATTR_VENDOR_DATA]); in nl80211_vendor_cmd()
15016 len = nla_len(info->attrs[NL80211_ATTR_VENDOR_DATA]); in nl80211_vendor_cmd()
15019 info->attrs[NL80211_ATTR_VENDOR_DATA], in nl80211_vendor_cmd()
15294 if (info->attrs[NL80211_ATTR_QOS_MAP]) { in nl80211_set_qos_map()
15295 pos = nla_data(info->attrs[NL80211_ATTR_QOS_MAP]); in nl80211_set_qos_map()
15296 len = nla_len(info->attrs[NL80211_ATTR_QOS_MAP]); in nl80211_set_qos_map()
15345 if (!info->attrs[NL80211_ATTR_TSID] || !info->attrs[NL80211_ATTR_MAC] || in nl80211_add_tx_ts()
15346 !info->attrs[NL80211_ATTR_USER_PRIO]) in nl80211_add_tx_ts()
15349 tsid = nla_get_u8(info->attrs[NL80211_ATTR_TSID]); in nl80211_add_tx_ts()
15350 up = nla_get_u8(info->attrs[NL80211_ATTR_USER_PRIO]); in nl80211_add_tx_ts()
15361 peer = nla_data(info->attrs[NL80211_ATTR_MAC]); in nl80211_add_tx_ts()
15363 if (info->attrs[NL80211_ATTR_ADMITTED_TIME]) { in nl80211_add_tx_ts()
15365 nla_get_u16(info->attrs[NL80211_ATTR_ADMITTED_TIME]); in nl80211_add_tx_ts()
15399 if (!info->attrs[NL80211_ATTR_TSID] || !info->attrs[NL80211_ATTR_MAC]) in nl80211_del_tx_ts()
15402 tsid = nla_get_u8(info->attrs[NL80211_ATTR_TSID]); in nl80211_del_tx_ts()
15403 peer = nla_data(info->attrs[NL80211_ATTR_MAC]); in nl80211_del_tx_ts()
15435 if (!info->attrs[NL80211_ATTR_MAC] || in nl80211_tdls_channel_switch()
15436 !info->attrs[NL80211_ATTR_OPER_CLASS]) in nl80211_tdls_channel_switch()
15462 addr = nla_data(info->attrs[NL80211_ATTR_MAC]); in nl80211_tdls_channel_switch()
15463 oper_class = nla_get_u8(info->attrs[NL80211_ATTR_OPER_CLASS]); in nl80211_tdls_channel_switch()
15493 if (!info->attrs[NL80211_ATTR_MAC]) in nl80211_tdls_cancel_channel_switch()
15496 addr = nla_data(info->attrs[NL80211_ATTR_MAC]); in nl80211_tdls_cancel_channel_switch()
15521 nla = info->attrs[NL80211_ATTR_MULTICAST_TO_UNICAST_ENABLED]; in nl80211_set_multicast_to_unicast()
15543 if (!info->attrs[NL80211_ATTR_MAC] || !info->attrs[NL80211_ATTR_PMK]) in nl80211_set_pmk()
15552 pmk_conf.aa = nla_data(info->attrs[NL80211_ATTR_MAC]); in nl80211_set_pmk()
15558 pmk_conf.pmk = nla_data(info->attrs[NL80211_ATTR_PMK]); in nl80211_set_pmk()
15559 pmk_conf.pmk_len = nla_len(info->attrs[NL80211_ATTR_PMK]); in nl80211_set_pmk()
15566 if (info->attrs[NL80211_ATTR_PMKR0_NAME]) in nl80211_set_pmk()
15568 nla_data(info->attrs[NL80211_ATTR_PMKR0_NAME]); in nl80211_set_pmk()
15592 if (!info->attrs[NL80211_ATTR_MAC]) in nl80211_del_pmk()
15596 aa = nla_data(info->attrs[NL80211_ATTR_MAC]); in nl80211_del_pmk()
15612 if (!info->attrs[NL80211_ATTR_SSID] && in nl80211_external_auth()
15617 if (!info->attrs[NL80211_ATTR_BSSID]) in nl80211_external_auth()
15620 if (!info->attrs[NL80211_ATTR_STATUS_CODE]) in nl80211_external_auth()
15625 if (info->attrs[NL80211_ATTR_SSID]) { in nl80211_external_auth()
15626 params.ssid.ssid_len = nla_len(info->attrs[NL80211_ATTR_SSID]); in nl80211_external_auth()
15630 nla_data(info->attrs[NL80211_ATTR_SSID]), in nl80211_external_auth()
15634 memcpy(params.bssid, nla_data(info->attrs[NL80211_ATTR_BSSID]), in nl80211_external_auth()
15637 params.status = nla_get_u16(info->attrs[NL80211_ATTR_STATUS_CODE]); in nl80211_external_auth()
15639 if (info->attrs[NL80211_ATTR_PMKID]) in nl80211_external_auth()
15640 params.pmkid = nla_data(info->attrs[NL80211_ATTR_PMKID]); in nl80211_external_auth()
15647 bool dont_wait_for_ack = info->attrs[NL80211_ATTR_DONT_WAIT_FOR_ACK]; in nl80211_tx_control_port()
15667 if (!info->attrs[NL80211_ATTR_FRAME] || in nl80211_tx_control_port()
15668 !info->attrs[NL80211_ATTR_MAC] || in nl80211_tx_control_port()
15669 !info->attrs[NL80211_ATTR_CONTROL_PORT_ETHERTYPE]) { in nl80211_tx_control_port()
15699 buf = nla_data(info->attrs[NL80211_ATTR_FRAME]); in nl80211_tx_control_port()
15700 len = nla_len(info->attrs[NL80211_ATTR_FRAME]); in nl80211_tx_control_port()
15701 dest = nla_data(info->attrs[NL80211_ATTR_MAC]); in nl80211_tx_control_port()
15702 proto = nla_get_u16(info->attrs[NL80211_ATTR_CONTROL_PORT_ETHERTYPE]); in nl80211_tx_control_port()
15704 nla_get_flag(info->attrs[NL80211_ATTR_CONTROL_PORT_NO_ENCRYPT]); in nl80211_tx_control_port()
15706 link_id = nl80211_link_id_or_invalid(info->attrs); in nl80211_tx_control_port()
15726 unsigned int link_id = nl80211_link_id(info->attrs); in nl80211_get_ftm_responder_stats()
15801 if (!info->attrs[NL80211_ATTR_STATUS_CODE] || in nl80211_update_owe_info()
15802 !info->attrs[NL80211_ATTR_MAC]) in nl80211_update_owe_info()
15806 owe_info.status = nla_get_u16(info->attrs[NL80211_ATTR_STATUS_CODE]); in nl80211_update_owe_info()
15807 nla_memcpy(owe_info.peer, info->attrs[NL80211_ATTR_MAC], ETH_ALEN); in nl80211_update_owe_info()
15809 if (info->attrs[NL80211_ATTR_IE]) { in nl80211_update_owe_info()
15810 owe_info.ie = nla_data(info->attrs[NL80211_ATTR_IE]); in nl80211_update_owe_info()
15811 owe_info.ie_len = nla_len(info->attrs[NL80211_ATTR_IE]); in nl80211_update_owe_info()
15831 if (!info->attrs[NL80211_ATTR_MAC] || in nl80211_probe_mesh_link()
15832 !info->attrs[NL80211_ATTR_FRAME]) { in nl80211_probe_mesh_link()
15840 dest = nla_data(info->attrs[NL80211_ATTR_MAC]); in nl80211_probe_mesh_link()
15841 buf = nla_data(info->attrs[NL80211_ATTR_FRAME]); in nl80211_probe_mesh_link()
15842 len = nla_len(info->attrs[NL80211_ATTR_FRAME]); in nl80211_probe_mesh_link()
15861 struct nlattr *attrs[], struct net_device *dev, in parse_tid_conf() argument
15870 if (!attrs[NL80211_TID_CONFIG_ATTR_TIDS]) in parse_tid_conf()
15874 nla_get_flag(attrs[NL80211_TID_CONFIG_ATTR_OVERRIDE]); in parse_tid_conf()
15875 tid_conf->tids = nla_get_u16(attrs[NL80211_TID_CONFIG_ATTR_TIDS]); in parse_tid_conf()
15888 if (attrs[NL80211_TID_CONFIG_ATTR_NOACK]) { in parse_tid_conf()
15891 nla_get_u8(attrs[NL80211_TID_CONFIG_ATTR_NOACK]); in parse_tid_conf()
15894 if (attrs[NL80211_TID_CONFIG_ATTR_RETRY_SHORT]) { in parse_tid_conf()
15897 nla_get_u8(attrs[NL80211_TID_CONFIG_ATTR_RETRY_SHORT]); in parse_tid_conf()
15903 if (attrs[NL80211_TID_CONFIG_ATTR_RETRY_LONG]) { in parse_tid_conf()
15906 nla_get_u8(attrs[NL80211_TID_CONFIG_ATTR_RETRY_LONG]); in parse_tid_conf()
15912 if (attrs[NL80211_TID_CONFIG_ATTR_AMPDU_CTRL]) { in parse_tid_conf()
15915 nla_get_u8(attrs[NL80211_TID_CONFIG_ATTR_AMPDU_CTRL]); in parse_tid_conf()
15918 if (attrs[NL80211_TID_CONFIG_ATTR_RTSCTS_CTRL]) { in parse_tid_conf()
15921 nla_get_u8(attrs[NL80211_TID_CONFIG_ATTR_RTSCTS_CTRL]); in parse_tid_conf()
15924 if (attrs[NL80211_TID_CONFIG_ATTR_AMSDU_CTRL]) { in parse_tid_conf()
15927 nla_get_u8(attrs[NL80211_TID_CONFIG_ATTR_AMSDU_CTRL]); in parse_tid_conf()
15930 if (attrs[NL80211_TID_CONFIG_ATTR_TX_RATE_TYPE]) { in parse_tid_conf()
15933 tid_conf->txrate_type = nla_get_u8(attrs[idx]); in parse_tid_conf()
15937 err = nl80211_parse_tx_bitrate_mask(info, attrs, attr, in parse_tid_conf()
15965 struct nlattr *attrs[NL80211_TID_CONFIG_ATTR_MAX + 1]; in nl80211_set_tid_config() local
15966 unsigned int link_id = nl80211_link_id(info->attrs); in nl80211_set_tid_config()
15974 if (!info->attrs[NL80211_ATTR_TID_CONFIG]) in nl80211_set_tid_config()
15980 nla_for_each_nested(tid, info->attrs[NL80211_ATTR_TID_CONFIG], in nl80211_set_tid_config()
15991 if (info->attrs[NL80211_ATTR_MAC]) in nl80211_set_tid_config()
15992 tid_config->peer = nla_data(info->attrs[NL80211_ATTR_MAC]); in nl80211_set_tid_config()
15996 nla_for_each_nested(tid, info->attrs[NL80211_ATTR_TID_CONFIG], in nl80211_set_tid_config()
15998 ret = nla_parse_nested(attrs, NL80211_TID_CONFIG_ATTR_MAX, in nl80211_set_tid_config()
16004 ret = parse_tid_conf(rdev, attrs, dev, in nl80211_set_tid_config()
16041 if (!info->attrs[NL80211_ATTR_COLOR_CHANGE_COUNT] || in nl80211_color_change()
16042 !info->attrs[NL80211_ATTR_COLOR_CHANGE_COLOR] || in nl80211_color_change()
16043 !info->attrs[NL80211_ATTR_COLOR_CHANGE_ELEMS]) in nl80211_color_change()
16046 params.count = nla_get_u8(info->attrs[NL80211_ATTR_COLOR_CHANGE_COUNT]); in nl80211_color_change()
16047 params.color = nla_get_u8(info->attrs[NL80211_ATTR_COLOR_CHANGE_COLOR]); in nl80211_color_change()
16049 err = nl80211_parse_beacon(rdev, info->attrs, &params.beacon_next, in nl80211_color_change()
16059 info->attrs[NL80211_ATTR_COLOR_CHANGE_ELEMS], in nl80211_color_change()
16135 if (!info->attrs[NL80211_ATTR_MAC] || in nl80211_set_fils_aad()
16136 !info->attrs[NL80211_ATTR_FILS_KEK] || in nl80211_set_fils_aad()
16137 !info->attrs[NL80211_ATTR_FILS_NONCES]) in nl80211_set_fils_aad()
16140 fils_aad.macaddr = nla_data(info->attrs[NL80211_ATTR_MAC]); in nl80211_set_fils_aad()
16141 fils_aad.kek_len = nla_len(info->attrs[NL80211_ATTR_FILS_KEK]); in nl80211_set_fils_aad()
16142 fils_aad.kek = nla_data(info->attrs[NL80211_ATTR_FILS_KEK]); in nl80211_set_fils_aad()
16143 nonces = nla_data(info->attrs[NL80211_ATTR_FILS_NONCES]); in nl80211_set_fils_aad()
16153 unsigned int link_id = nl80211_link_id(info->attrs); in nl80211_add_link()
16168 if (!info->attrs[NL80211_ATTR_MAC] || in nl80211_add_link()
16169 !is_valid_ether_addr(nla_data(info->attrs[NL80211_ATTR_MAC]))) in nl80211_add_link()
16175 nla_data(info->attrs[NL80211_ATTR_MAC])); in nl80211_add_link()
16189 unsigned int link_id = nl80211_link_id(info->attrs); in nl80211_remove_link()
16194 if (!info->attrs[NL80211_ATTR_MLO_LINK_ID]) in nl80211_remove_link()
16224 if (add && !info->attrs[NL80211_ATTR_MAC]) in nl80211_add_mod_link_station()
16227 if (!info->attrs[NL80211_ATTR_MLD_ADDR]) in nl80211_add_mod_link_station()
16230 if (add && !info->attrs[NL80211_ATTR_STA_SUPPORTED_RATES]) in nl80211_add_mod_link_station()
16233 params.mld_mac = nla_data(info->attrs[NL80211_ATTR_MLD_ADDR]); in nl80211_add_mod_link_station()
16235 if (info->attrs[NL80211_ATTR_MAC]) { in nl80211_add_mod_link_station()
16236 params.link_mac = nla_data(info->attrs[NL80211_ATTR_MAC]); in nl80211_add_mod_link_station()
16241 if (!info->attrs[NL80211_ATTR_MLO_LINK_ID]) in nl80211_add_mod_link_station()
16244 params.link_id = nla_get_u8(info->attrs[NL80211_ATTR_MLO_LINK_ID]); in nl80211_add_mod_link_station()
16246 if (info->attrs[NL80211_ATTR_STA_SUPPORTED_RATES]) { in nl80211_add_mod_link_station()
16248 nla_data(info->attrs[NL80211_ATTR_STA_SUPPORTED_RATES]); in nl80211_add_mod_link_station()
16250 nla_len(info->attrs[NL80211_ATTR_STA_SUPPORTED_RATES]); in nl80211_add_mod_link_station()
16253 if (info->attrs[NL80211_ATTR_HT_CAPABILITY]) in nl80211_add_mod_link_station()
16255 nla_data(info->attrs[NL80211_ATTR_HT_CAPABILITY]); in nl80211_add_mod_link_station()
16257 if (info->attrs[NL80211_ATTR_VHT_CAPABILITY]) in nl80211_add_mod_link_station()
16259 nla_data(info->attrs[NL80211_ATTR_VHT_CAPABILITY]); in nl80211_add_mod_link_station()
16261 if (info->attrs[NL80211_ATTR_HE_CAPABILITY]) { in nl80211_add_mod_link_station()
16263 nla_data(info->attrs[NL80211_ATTR_HE_CAPABILITY]); in nl80211_add_mod_link_station()
16265 nla_len(info->attrs[NL80211_ATTR_HE_CAPABILITY]); in nl80211_add_mod_link_station()
16267 if (info->attrs[NL80211_ATTR_EHT_CAPABILITY]) { in nl80211_add_mod_link_station()
16269 nla_data(info->attrs[NL80211_ATTR_EHT_CAPABILITY]); in nl80211_add_mod_link_station()
16271 nla_len(info->attrs[NL80211_ATTR_EHT_CAPABILITY]); in nl80211_add_mod_link_station()
16281 if (info->attrs[NL80211_ATTR_HE_6GHZ_CAPABILITY]) in nl80211_add_mod_link_station()
16283 nla_data(info->attrs[NL80211_ATTR_HE_6GHZ_CAPABILITY]); in nl80211_add_mod_link_station()
16285 if (info->attrs[NL80211_ATTR_OPMODE_NOTIF]) { in nl80211_add_mod_link_station()
16288 nla_get_u8(info->attrs[NL80211_ATTR_OPMODE_NOTIF]); in nl80211_add_mod_link_station()
16329 if (!info->attrs[NL80211_ATTR_MLD_ADDR] || in nl80211_remove_link_station()
16330 !info->attrs[NL80211_ATTR_MLO_LINK_ID]) in nl80211_remove_link_station()
16333 params.mld_mac = nla_data(info->attrs[NL80211_ATTR_MLD_ADDR]); in nl80211_remove_link_station()
16334 params.link_id = nla_get_u8(info->attrs[NL80211_ATTR_MLO_LINK_ID]); in nl80211_remove_link_station()
16353 if (!info->attrs[NL80211_ATTR_MAC] && in nl80211_set_hw_timestamp()
16357 if (info->attrs[NL80211_ATTR_MAC]) in nl80211_set_hw_timestamp()
16358 hwts.macaddr = nla_data(info->attrs[NL80211_ATTR_MAC]); in nl80211_set_hw_timestamp()
16361 nla_get_flag(info->attrs[NL80211_ATTR_HW_TIMESTAMP_ENABLED]); in nl80211_set_hw_timestamp()
16480 info->attrs); in nl80211_pre_doit()
16511 struct nlattr *link_id = info->attrs[NL80211_ATTR_MLO_LINK_ID]; in nl80211_pre_doit()
16534 if (info->attrs[NL80211_ATTR_MLO_LINK_ID] || in nl80211_pre_doit()
16643 if (!info->attrs[NL80211_ATTR_SAR_SPEC]) in nl80211_set_sar_specs()
16647 info->attrs[NL80211_ATTR_SAR_SPEC], in nl80211_set_sar_specs()