Lines Matching refs:msg

1066 static int nl80211_msg_put_wmm_rules(struct sk_buff *msg,  in nl80211_msg_put_wmm_rules()  argument
1071 nla_nest_start_noflag(msg, NL80211_FREQUENCY_ATTR_WMM); in nl80211_msg_put_wmm_rules()
1077 struct nlattr *nl_wmm_rule = nla_nest_start_noflag(msg, j); in nl80211_msg_put_wmm_rules()
1082 if (nla_put_u16(msg, NL80211_WMMR_CW_MIN, in nl80211_msg_put_wmm_rules()
1084 nla_put_u16(msg, NL80211_WMMR_CW_MAX, in nl80211_msg_put_wmm_rules()
1086 nla_put_u8(msg, NL80211_WMMR_AIFSN, in nl80211_msg_put_wmm_rules()
1088 nla_put_u16(msg, NL80211_WMMR_TXOP, in nl80211_msg_put_wmm_rules()
1092 nla_nest_end(msg, nl_wmm_rule); in nl80211_msg_put_wmm_rules()
1094 nla_nest_end(msg, nl_wmm_rules); in nl80211_msg_put_wmm_rules()
1102 static int nl80211_msg_put_channel(struct sk_buff *msg, struct wiphy *wiphy, in nl80211_msg_put_channel() argument
1115 if (nla_put_u32(msg, NL80211_FREQUENCY_ATTR_FREQ, in nl80211_msg_put_channel()
1119 if (nla_put_u32(msg, NL80211_FREQUENCY_ATTR_OFFSET, chan->freq_offset)) in nl80211_msg_put_channel()
1123 nla_put_flag(msg, NL80211_FREQUENCY_ATTR_DISABLED)) in nl80211_msg_put_channel()
1126 if (nla_put_flag(msg, NL80211_FREQUENCY_ATTR_NO_IR)) in nl80211_msg_put_channel()
1128 if (nla_put_flag(msg, __NL80211_FREQUENCY_ATTR_NO_IBSS)) in nl80211_msg_put_channel()
1132 if (nla_put_flag(msg, NL80211_FREQUENCY_ATTR_RADAR)) in nl80211_msg_put_channel()
1139 if (nla_put_u32(msg, NL80211_FREQUENCY_ATTR_DFS_STATE, in nl80211_msg_put_channel()
1142 if (nla_put_u32(msg, NL80211_FREQUENCY_ATTR_DFS_TIME, in nl80211_msg_put_channel()
1145 if (nla_put_u32(msg, in nl80211_msg_put_channel()
1154 nla_put_flag(msg, NL80211_FREQUENCY_ATTR_NO_HT40_MINUS)) in nl80211_msg_put_channel()
1157 nla_put_flag(msg, NL80211_FREQUENCY_ATTR_NO_HT40_PLUS)) in nl80211_msg_put_channel()
1160 nla_put_flag(msg, NL80211_FREQUENCY_ATTR_NO_80MHZ)) in nl80211_msg_put_channel()
1163 nla_put_flag(msg, NL80211_FREQUENCY_ATTR_NO_160MHZ)) in nl80211_msg_put_channel()
1166 nla_put_flag(msg, NL80211_FREQUENCY_ATTR_INDOOR_ONLY)) in nl80211_msg_put_channel()
1169 nla_put_flag(msg, NL80211_FREQUENCY_ATTR_IR_CONCURRENT)) in nl80211_msg_put_channel()
1172 nla_put_flag(msg, NL80211_FREQUENCY_ATTR_NO_20MHZ)) in nl80211_msg_put_channel()
1175 nla_put_flag(msg, NL80211_FREQUENCY_ATTR_NO_10MHZ)) in nl80211_msg_put_channel()
1178 nla_put_flag(msg, NL80211_FREQUENCY_ATTR_NO_HE)) in nl80211_msg_put_channel()
1181 nla_put_flag(msg, NL80211_FREQUENCY_ATTR_1MHZ)) in nl80211_msg_put_channel()
1184 nla_put_flag(msg, NL80211_FREQUENCY_ATTR_2MHZ)) in nl80211_msg_put_channel()
1187 nla_put_flag(msg, NL80211_FREQUENCY_ATTR_4MHZ)) in nl80211_msg_put_channel()
1190 nla_put_flag(msg, NL80211_FREQUENCY_ATTR_8MHZ)) in nl80211_msg_put_channel()
1193 nla_put_flag(msg, NL80211_FREQUENCY_ATTR_16MHZ)) in nl80211_msg_put_channel()
1196 nla_put_flag(msg, NL80211_FREQUENCY_ATTR_NO_320MHZ)) in nl80211_msg_put_channel()
1199 nla_put_flag(msg, NL80211_FREQUENCY_ATTR_NO_EHT)) in nl80211_msg_put_channel()
1203 if (nla_put_u32(msg, NL80211_FREQUENCY_ATTR_MAX_TX_POWER, in nl80211_msg_put_channel()
1212 if (nl80211_msg_put_wmm_rules(msg, rule)) in nl80211_msg_put_channel()
1223 static bool nl80211_put_txq_stats(struct sk_buff *msg, in nl80211_put_txq_stats() argument
1231 nla_put_u32(msg, NL80211_TXQ_STATS_ ## attr, txqstats->memb)) \ in nl80211_put_txq_stats()
1235 txqattr = nla_nest_start_noflag(msg, attrtype); in nl80211_put_txq_stats()
1250 nla_nest_end(msg, txqattr); in nl80211_put_txq_stats()
1596 static int nl80211_put_iftypes(struct sk_buff *msg, u32 attr, u16 ifmodes) in nl80211_put_iftypes() argument
1598 struct nlattr *nl_modes = nla_nest_start_noflag(msg, attr); in nl80211_put_iftypes()
1606 if ((ifmodes & 1) && nla_put_flag(msg, i)) in nl80211_put_iftypes()
1612 nla_nest_end(msg, nl_modes); in nl80211_put_iftypes()
1620 struct sk_buff *msg, in nl80211_put_iface_combinations() argument
1626 nl_combis = nla_nest_start_noflag(msg, in nl80211_put_iface_combinations()
1637 nl_combi = nla_nest_start_noflag(msg, i + 1); in nl80211_put_iface_combinations()
1641 nl_limits = nla_nest_start_noflag(msg, in nl80211_put_iface_combinations()
1649 nl_limit = nla_nest_start_noflag(msg, j + 1); in nl80211_put_iface_combinations()
1652 if (nla_put_u32(msg, NL80211_IFACE_LIMIT_MAX, in nl80211_put_iface_combinations()
1655 if (nl80211_put_iftypes(msg, NL80211_IFACE_LIMIT_TYPES, in nl80211_put_iface_combinations()
1658 nla_nest_end(msg, nl_limit); in nl80211_put_iface_combinations()
1661 nla_nest_end(msg, nl_limits); in nl80211_put_iface_combinations()
1664 nla_put_flag(msg, NL80211_IFACE_COMB_STA_AP_BI_MATCH)) in nl80211_put_iface_combinations()
1666 if (nla_put_u32(msg, NL80211_IFACE_COMB_NUM_CHANNELS, in nl80211_put_iface_combinations()
1668 nla_put_u32(msg, NL80211_IFACE_COMB_MAXNUM, in nl80211_put_iface_combinations()
1672 (nla_put_u32(msg, NL80211_IFACE_COMB_RADAR_DETECT_WIDTHS, in nl80211_put_iface_combinations()
1674 nla_put_u32(msg, NL80211_IFACE_COMB_RADAR_DETECT_REGIONS, in nl80211_put_iface_combinations()
1678 nla_put_u32(msg, NL80211_IFACE_COMB_BI_MIN_GCD, in nl80211_put_iface_combinations()
1682 nla_nest_end(msg, nl_combi); in nl80211_put_iface_combinations()
1685 nla_nest_end(msg, nl_combis); in nl80211_put_iface_combinations()
1694 struct sk_buff *msg) in nl80211_send_wowlan_tcp_caps() argument
1702 nl_tcp = nla_nest_start_noflag(msg, in nl80211_send_wowlan_tcp_caps()
1707 if (nla_put_u32(msg, NL80211_WOWLAN_TCP_DATA_PAYLOAD, in nl80211_send_wowlan_tcp_caps()
1711 if (nla_put_u32(msg, NL80211_WOWLAN_TCP_DATA_PAYLOAD, in nl80211_send_wowlan_tcp_caps()
1715 if (tcp->seq && nla_put_flag(msg, NL80211_WOWLAN_TCP_DATA_PAYLOAD_SEQ)) in nl80211_send_wowlan_tcp_caps()
1718 if (tcp->tok && nla_put(msg, NL80211_WOWLAN_TCP_DATA_PAYLOAD_TOKEN, in nl80211_send_wowlan_tcp_caps()
1722 if (nla_put_u32(msg, NL80211_WOWLAN_TCP_DATA_INTERVAL, in nl80211_send_wowlan_tcp_caps()
1726 if (nla_put_u32(msg, NL80211_WOWLAN_TCP_WAKE_PAYLOAD, in nl80211_send_wowlan_tcp_caps()
1730 nla_nest_end(msg, nl_tcp); in nl80211_send_wowlan_tcp_caps()
1734 static int nl80211_send_wowlan(struct sk_buff *msg, in nl80211_send_wowlan() argument
1743 nl_wowlan = nla_nest_start_noflag(msg, in nl80211_send_wowlan()
1749 nla_put_flag(msg, NL80211_WOWLAN_TRIG_ANY)) || in nl80211_send_wowlan()
1751 nla_put_flag(msg, NL80211_WOWLAN_TRIG_DISCONNECT)) || in nl80211_send_wowlan()
1753 nla_put_flag(msg, NL80211_WOWLAN_TRIG_MAGIC_PKT)) || in nl80211_send_wowlan()
1755 nla_put_flag(msg, NL80211_WOWLAN_TRIG_GTK_REKEY_SUPPORTED)) || in nl80211_send_wowlan()
1757 nla_put_flag(msg, NL80211_WOWLAN_TRIG_GTK_REKEY_FAILURE)) || in nl80211_send_wowlan()
1759 nla_put_flag(msg, NL80211_WOWLAN_TRIG_EAP_IDENT_REQUEST)) || in nl80211_send_wowlan()
1761 nla_put_flag(msg, NL80211_WOWLAN_TRIG_4WAY_HANDSHAKE)) || in nl80211_send_wowlan()
1763 nla_put_flag(msg, NL80211_WOWLAN_TRIG_RFKILL_RELEASE))) in nl80211_send_wowlan()
1774 if (nla_put(msg, NL80211_WOWLAN_TRIG_PKT_PATTERN, in nl80211_send_wowlan()
1780 nla_put_u32(msg, NL80211_WOWLAN_TRIG_NET_DETECT, in nl80211_send_wowlan()
1784 if (large && nl80211_send_wowlan_tcp_caps(rdev, msg)) in nl80211_send_wowlan()
1787 nla_nest_end(msg, nl_wowlan); in nl80211_send_wowlan()
1793 static int nl80211_send_coalesce(struct sk_buff *msg, in nl80211_send_coalesce() argument
1808 if (nla_put(msg, NL80211_ATTR_COALESCE_RULE, sizeof(rule), &rule)) in nl80211_send_coalesce()
1815 nl80211_send_iftype_data(struct sk_buff *msg, in nl80211_send_iftype_data() argument
1822 if (nl80211_put_iftypes(msg, NL80211_BAND_IFTYPE_ATTR_IFTYPES, in nl80211_send_iftype_data()
1827 if (nla_put(msg, NL80211_BAND_IFTYPE_ATTR_HE_CAP_MAC, in nl80211_send_iftype_data()
1830 nla_put(msg, NL80211_BAND_IFTYPE_ATTR_HE_CAP_PHY, in nl80211_send_iftype_data()
1833 nla_put(msg, NL80211_BAND_IFTYPE_ATTR_HE_CAP_MCS_SET, in nl80211_send_iftype_data()
1836 nla_put(msg, NL80211_BAND_IFTYPE_ATTR_HE_CAP_PPE, in nl80211_send_iftype_data()
1859 if (nla_put(msg, NL80211_BAND_IFTYPE_ATTR_EHT_CAP_MAC, in nl80211_send_iftype_data()
1862 nla_put(msg, NL80211_BAND_IFTYPE_ATTR_EHT_CAP_PHY, in nl80211_send_iftype_data()
1865 nla_put(msg, NL80211_BAND_IFTYPE_ATTR_EHT_CAP_MCS_SET, in nl80211_send_iftype_data()
1867 nla_put(msg, NL80211_BAND_IFTYPE_ATTR_EHT_CAP_PPE, in nl80211_send_iftype_data()
1873 nla_put(msg, NL80211_BAND_IFTYPE_ATTR_HE_6GHZ_CAPA, in nl80211_send_iftype_data()
1879 nla_put(msg, NL80211_BAND_IFTYPE_ATTR_VENDOR_ELEMS, in nl80211_send_iftype_data()
1886 static int nl80211_send_band_rateinfo(struct sk_buff *msg, in nl80211_send_band_rateinfo() argument
1896 (nla_put(msg, NL80211_BAND_ATTR_HT_MCS_SET, in nl80211_send_band_rateinfo()
1899 nla_put_u16(msg, NL80211_BAND_ATTR_HT_CAPA, in nl80211_send_band_rateinfo()
1901 nla_put_u8(msg, NL80211_BAND_ATTR_HT_AMPDU_FACTOR, in nl80211_send_band_rateinfo()
1903 nla_put_u8(msg, NL80211_BAND_ATTR_HT_AMPDU_DENSITY, in nl80211_send_band_rateinfo()
1909 (nla_put(msg, NL80211_BAND_ATTR_VHT_MCS_SET, in nl80211_send_band_rateinfo()
1912 nla_put_u32(msg, NL80211_BAND_ATTR_VHT_CAPA, in nl80211_send_band_rateinfo()
1918 nla_nest_start_noflag(msg, in nl80211_send_band_rateinfo()
1928 iftdata = nla_nest_start_noflag(msg, i + 1); in nl80211_send_band_rateinfo()
1932 err = nl80211_send_iftype_data(msg, sband, in nl80211_send_band_rateinfo()
1937 nla_nest_end(msg, iftdata); in nl80211_send_band_rateinfo()
1940 nla_nest_end(msg, nl_iftype_data); in nl80211_send_band_rateinfo()
1945 (nla_put_u8(msg, NL80211_BAND_ATTR_EDMG_CHANNELS, in nl80211_send_band_rateinfo()
1947 nla_put_u8(msg, NL80211_BAND_ATTR_EDMG_BW_CONFIG, in nl80211_send_band_rateinfo()
1953 nl_rates = nla_nest_start_noflag(msg, NL80211_BAND_ATTR_RATES); in nl80211_send_band_rateinfo()
1958 nl_rate = nla_nest_start_noflag(msg, i); in nl80211_send_band_rateinfo()
1963 if (nla_put_u32(msg, NL80211_BITRATE_ATTR_RATE, in nl80211_send_band_rateinfo()
1967 nla_put_flag(msg, in nl80211_send_band_rateinfo()
1971 nla_nest_end(msg, nl_rate); in nl80211_send_band_rateinfo()
1974 nla_nest_end(msg, nl_rates); in nl80211_send_band_rateinfo()
1978 (nla_put(msg, NL80211_BAND_ATTR_S1G_CAPA, in nl80211_send_band_rateinfo()
1981 nla_put(msg, NL80211_BAND_ATTR_S1G_MCS_NSS_SET, in nl80211_send_band_rateinfo()
1990 nl80211_send_mgmt_stypes(struct sk_buff *msg, in nl80211_send_mgmt_stypes() argument
2001 nl_ifs = nla_nest_start_noflag(msg, NL80211_ATTR_TX_FRAME_TYPES); in nl80211_send_mgmt_stypes()
2006 nl_ftypes = nla_nest_start_noflag(msg, ift); in nl80211_send_mgmt_stypes()
2013 nla_put_u16(msg, NL80211_ATTR_FRAME_TYPE, in nl80211_send_mgmt_stypes()
2019 nla_nest_end(msg, nl_ftypes); in nl80211_send_mgmt_stypes()
2022 nla_nest_end(msg, nl_ifs); in nl80211_send_mgmt_stypes()
2024 nl_ifs = nla_nest_start_noflag(msg, NL80211_ATTR_RX_FRAME_TYPES); in nl80211_send_mgmt_stypes()
2029 nl_ftypes = nla_nest_start_noflag(msg, ift); in nl80211_send_mgmt_stypes()
2036 nla_put_u16(msg, NL80211_ATTR_FRAME_TYPE, in nl80211_send_mgmt_stypes()
2042 nla_nest_end(msg, nl_ftypes); in nl80211_send_mgmt_stypes()
2044 nla_nest_end(msg, nl_ifs); in nl80211_send_mgmt_stypes()
2053 if (nla_put_u32(msg, i, NL80211_CMD_ ## n)) \
2059 struct sk_buff *msg) in nl80211_add_commands_unsplit() argument
2092 if (nla_put_u32(msg, i, NL80211_CMD_SET_WIPHY_NETNS)) in nl80211_add_commands_unsplit()
2098 if (nla_put_u32(msg, i, NL80211_CMD_SET_CHANNEL)) in nl80211_add_commands_unsplit()
2111 if (nla_put_u32(msg, i, NL80211_CMD_REGISTER_BEACONS)) in nl80211_add_commands_unsplit()
2122 if (nla_put_u32(msg, i, NL80211_CMD_CONNECT)) in nl80211_add_commands_unsplit()
2128 if (nla_put_u32(msg, i, NL80211_CMD_DISCONNECT)) in nl80211_add_commands_unsplit()
2139 struct sk_buff *msg) in nl80211_send_pmsr_ftm_capa() argument
2146 ftm = nla_nest_start_noflag(msg, NL80211_PMSR_TYPE_FTM); in nl80211_send_pmsr_ftm_capa()
2150 if (cap->ftm.asap && nla_put_flag(msg, NL80211_PMSR_FTM_CAPA_ATTR_ASAP)) in nl80211_send_pmsr_ftm_capa()
2153 nla_put_flag(msg, NL80211_PMSR_FTM_CAPA_ATTR_NON_ASAP)) in nl80211_send_pmsr_ftm_capa()
2156 nla_put_flag(msg, NL80211_PMSR_FTM_CAPA_ATTR_REQ_LCI)) in nl80211_send_pmsr_ftm_capa()
2159 nla_put_flag(msg, NL80211_PMSR_FTM_CAPA_ATTR_REQ_CIVICLOC)) in nl80211_send_pmsr_ftm_capa()
2161 if (nla_put_u32(msg, NL80211_PMSR_FTM_CAPA_ATTR_PREAMBLES, in nl80211_send_pmsr_ftm_capa()
2164 if (nla_put_u32(msg, NL80211_PMSR_FTM_CAPA_ATTR_BANDWIDTHS, in nl80211_send_pmsr_ftm_capa()
2168 nla_put_u32(msg, NL80211_PMSR_FTM_CAPA_ATTR_MAX_BURSTS_EXPONENT, in nl80211_send_pmsr_ftm_capa()
2172 nla_put_u32(msg, NL80211_PMSR_FTM_CAPA_ATTR_MAX_FTMS_PER_BURST, in nl80211_send_pmsr_ftm_capa()
2176 nla_put_flag(msg, NL80211_PMSR_FTM_CAPA_ATTR_TRIGGER_BASED)) in nl80211_send_pmsr_ftm_capa()
2179 nla_put_flag(msg, NL80211_PMSR_FTM_CAPA_ATTR_NON_TRIGGER_BASED)) in nl80211_send_pmsr_ftm_capa()
2182 nla_nest_end(msg, ftm); in nl80211_send_pmsr_ftm_capa()
2187 struct sk_buff *msg) in nl80211_send_pmsr_capa() argument
2200 pmsr = nla_nest_start_noflag(msg, NL80211_ATTR_PEER_MEASUREMENTS); in nl80211_send_pmsr_capa()
2204 if (nla_put_u32(msg, NL80211_PMSR_ATTR_MAX_PEERS, cap->max_peers)) in nl80211_send_pmsr_capa()
2208 nla_put_flag(msg, NL80211_PMSR_ATTR_REPORT_AP_TSF)) in nl80211_send_pmsr_capa()
2212 nla_put_flag(msg, NL80211_PMSR_ATTR_RANDOMIZE_MAC_ADDR)) in nl80211_send_pmsr_capa()
2215 caps = nla_nest_start_noflag(msg, NL80211_PMSR_ATTR_TYPE_CAPA); in nl80211_send_pmsr_capa()
2219 if (nl80211_send_pmsr_ftm_capa(cap, msg)) in nl80211_send_pmsr_capa()
2222 nla_nest_end(msg, caps); in nl80211_send_pmsr_capa()
2223 nla_nest_end(msg, pmsr); in nl80211_send_pmsr_capa()
2230 struct sk_buff *msg) in nl80211_put_iftype_akm_suites() argument
2240 nested = nla_nest_start(msg, NL80211_ATTR_IFTYPE_AKM_SUITES); in nl80211_put_iftype_akm_suites()
2245 nested_akms = nla_nest_start(msg, i + 1); in nl80211_put_iftype_akm_suites()
2251 if (nl80211_put_iftypes(msg, NL80211_IFTYPE_AKM_ATTR_IFTYPES, in nl80211_put_iftype_akm_suites()
2255 if (nla_put(msg, NL80211_IFTYPE_AKM_ATTR_SUITES, in nl80211_put_iftype_akm_suites()
2260 nla_nest_end(msg, nested_akms); in nl80211_put_iftype_akm_suites()
2263 nla_nest_end(msg, nested); in nl80211_put_iftype_akm_suites()
2270 struct sk_buff *msg) in nl80211_put_tid_config_support() argument
2278 supp = nla_nest_start(msg, NL80211_ATTR_TID_CONFIG); in nl80211_put_tid_config_support()
2283 nla_put_u64_64bit(msg, NL80211_TID_CONFIG_ATTR_VIF_SUPP, in nl80211_put_tid_config_support()
2289 nla_put_u64_64bit(msg, NL80211_TID_CONFIG_ATTR_PEER_SUPP, in nl80211_put_tid_config_support()
2295 if (nla_put_u8(msg, NL80211_TID_CONFIG_ATTR_RETRY_SHORT, in nl80211_put_tid_config_support()
2298 if (nla_put_u8(msg, NL80211_TID_CONFIG_ATTR_RETRY_LONG, in nl80211_put_tid_config_support()
2302 nla_nest_end(msg, supp); in nl80211_put_tid_config_support()
2306 nla_nest_cancel(msg, supp); in nl80211_put_tid_config_support()
2312 struct sk_buff *msg) in nl80211_put_sar_specs() argument
2323 sar_capa = nla_nest_start(msg, NL80211_ATTR_SAR_SPEC); in nl80211_put_sar_specs()
2327 if (nla_put_u32(msg, NL80211_SAR_ATTR_TYPE, rdev->wiphy.sar_capa->type)) in nl80211_put_sar_specs()
2330 specs = nla_nest_start(msg, NL80211_SAR_ATTR_SPECS); in nl80211_put_sar_specs()
2336 sub_freq_range = nla_nest_start(msg, i + 1); in nl80211_put_sar_specs()
2340 if (nla_put_u32(msg, NL80211_SAR_ATTR_SPECS_START_FREQ, in nl80211_put_sar_specs()
2344 if (nla_put_u32(msg, NL80211_SAR_ATTR_SPECS_END_FREQ, in nl80211_put_sar_specs()
2348 nla_nest_end(msg, sub_freq_range); in nl80211_put_sar_specs()
2351 nla_nest_end(msg, specs); in nl80211_put_sar_specs()
2352 nla_nest_end(msg, sar_capa); in nl80211_put_sar_specs()
2356 nla_nest_cancel(msg, sar_capa); in nl80211_put_sar_specs()
2360 static int nl80211_put_mbssid_support(struct wiphy *wiphy, struct sk_buff *msg) in nl80211_put_mbssid_support() argument
2367 config = nla_nest_start(msg, NL80211_ATTR_MBSSID_CONFIG); in nl80211_put_mbssid_support()
2371 if (nla_put_u8(msg, NL80211_MBSSID_CONFIG_ATTR_MAX_INTERFACES, in nl80211_put_mbssid_support()
2376 nla_put_u8(msg, in nl80211_put_mbssid_support()
2381 nla_nest_end(msg, config); in nl80211_put_mbssid_support()
2385 nla_nest_cancel(msg, config); in nl80211_put_mbssid_support()
2398 struct sk_buff *msg, u32 portid, u32 seq, in nl80211_send_wiphy() argument
2412 hdr = nl80211hdr_put(msg, portid, seq, flags, cmd); in nl80211_send_wiphy()
2419 if (nla_put_u32(msg, NL80211_ATTR_WIPHY, rdev->wiphy_idx) || in nl80211_send_wiphy()
2420 nla_put_string(msg, NL80211_ATTR_WIPHY_NAME, in nl80211_send_wiphy()
2422 nla_put_u32(msg, NL80211_ATTR_GENERATION, in nl80211_send_wiphy()
2431 if (nla_put_u8(msg, NL80211_ATTR_WIPHY_RETRY_SHORT, in nl80211_send_wiphy()
2433 nla_put_u8(msg, NL80211_ATTR_WIPHY_RETRY_LONG, in nl80211_send_wiphy()
2435 nla_put_u32(msg, NL80211_ATTR_WIPHY_FRAG_THRESHOLD, in nl80211_send_wiphy()
2437 nla_put_u32(msg, NL80211_ATTR_WIPHY_RTS_THRESHOLD, in nl80211_send_wiphy()
2439 nla_put_u8(msg, NL80211_ATTR_WIPHY_COVERAGE_CLASS, in nl80211_send_wiphy()
2441 nla_put_u8(msg, NL80211_ATTR_MAX_NUM_SCAN_SSIDS, in nl80211_send_wiphy()
2443 nla_put_u8(msg, NL80211_ATTR_MAX_NUM_SCHED_SCAN_SSIDS, in nl80211_send_wiphy()
2445 nla_put_u16(msg, NL80211_ATTR_MAX_SCAN_IE_LEN, in nl80211_send_wiphy()
2447 nla_put_u16(msg, NL80211_ATTR_MAX_SCHED_SCAN_IE_LEN, in nl80211_send_wiphy()
2449 nla_put_u8(msg, NL80211_ATTR_MAX_MATCH_SETS, in nl80211_send_wiphy()
2454 nla_put_flag(msg, NL80211_ATTR_SUPPORT_IBSS_RSN)) in nl80211_send_wiphy()
2457 nla_put_flag(msg, NL80211_ATTR_SUPPORT_MESH_AUTH)) in nl80211_send_wiphy()
2460 nla_put_flag(msg, NL80211_ATTR_SUPPORT_AP_UAPSD)) in nl80211_send_wiphy()
2463 nla_put_flag(msg, NL80211_ATTR_ROAM_SUPPORT)) in nl80211_send_wiphy()
2466 nla_put_flag(msg, NL80211_ATTR_TDLS_SUPPORT)) in nl80211_send_wiphy()
2469 nla_put_flag(msg, NL80211_ATTR_TDLS_EXTERNAL_SETUP)) in nl80211_send_wiphy()
2476 if (nla_put(msg, NL80211_ATTR_CIPHER_SUITES, in nl80211_send_wiphy()
2481 if (nla_put_u8(msg, NL80211_ATTR_MAX_NUM_PMKIDS, in nl80211_send_wiphy()
2486 nla_put_flag(msg, NL80211_ATTR_CONTROL_PORT_ETHERTYPE)) in nl80211_send_wiphy()
2489 if (nla_put_u32(msg, NL80211_ATTR_WIPHY_ANTENNA_AVAIL_TX, in nl80211_send_wiphy()
2491 nla_put_u32(msg, NL80211_ATTR_WIPHY_ANTENNA_AVAIL_RX, in nl80211_send_wiphy()
2496 nla_put_u32(msg, NL80211_ATTR_PROBE_RESP_OFFLOAD, in nl80211_send_wiphy()
2508 if (nla_put_u32(msg, in nl80211_send_wiphy()
2511 nla_put_u32(msg, in nl80211_send_wiphy()
2523 if (nl80211_put_iftypes(msg, NL80211_ATTR_SUPPORTED_IFTYPES, in nl80211_send_wiphy()
2531 nl_bands = nla_nest_start_noflag(msg, in nl80211_send_wiphy()
2552 nl_band = nla_nest_start_noflag(msg, band); in nl80211_send_wiphy()
2558 if (nl80211_send_band_rateinfo(msg, sband, in nl80211_send_wiphy()
2567 nl_freqs = nla_nest_start_noflag(msg, in nl80211_send_wiphy()
2575 nl_freq = nla_nest_start_noflag(msg, in nl80211_send_wiphy()
2583 msg, &rdev->wiphy, chan, in nl80211_send_wiphy()
2587 nla_nest_end(msg, nl_freq); in nl80211_send_wiphy()
2595 nla_nest_end(msg, nl_freqs); in nl80211_send_wiphy()
2598 nla_nest_end(msg, nl_band); in nl80211_send_wiphy()
2607 nla_nest_end(msg, nl_bands); in nl80211_send_wiphy()
2621 nl_cmds = nla_nest_start_noflag(msg, in nl80211_send_wiphy()
2626 i = nl80211_add_commands_unsplit(rdev, msg); in nl80211_send_wiphy()
2646 nla_nest_end(msg, nl_cmds); in nl80211_send_wiphy()
2654 nla_put_u32(msg, in nl80211_send_wiphy()
2660 nla_put_flag(msg, NL80211_ATTR_OFFCHANNEL_TX_OK)) in nl80211_send_wiphy()
2669 if (nl80211_send_wowlan(msg, rdev, state->split)) in nl80211_send_wiphy()
2679 if (nl80211_put_iftypes(msg, NL80211_ATTR_SOFTWARE_IFTYPES, in nl80211_send_wiphy()
2683 if (nl80211_put_iface_combinations(&rdev->wiphy, msg, in nl80211_send_wiphy()
2693 nla_put_u32(msg, NL80211_ATTR_DEVICE_AP_SME, in nl80211_send_wiphy()
2705 if (nla_put_u32(msg, NL80211_ATTR_FEATURE_FLAGS, features)) in nl80211_send_wiphy()
2709 nla_put(msg, NL80211_ATTR_HT_CAPABILITY_MASK, in nl80211_send_wiphy()
2716 nla_put_u32(msg, NL80211_ATTR_MAC_ACL_MAX, in nl80211_send_wiphy()
2736 if (nl80211_send_mgmt_stypes(msg, mgmt_stypes)) in nl80211_send_wiphy()
2739 if (nla_put_u32(msg, NL80211_ATTR_MAX_NUM_SCHED_SCAN_PLANS, in nl80211_send_wiphy()
2741 nla_put_u32(msg, NL80211_ATTR_MAX_SCAN_PLAN_INTERVAL, in nl80211_send_wiphy()
2743 nla_put_u32(msg, NL80211_ATTR_MAX_SCAN_PLAN_ITERATIONS, in nl80211_send_wiphy()
2748 (nla_put(msg, NL80211_ATTR_EXT_CAPA, in nl80211_send_wiphy()
2751 nla_put(msg, NL80211_ATTR_EXT_CAPA_MASK, in nl80211_send_wiphy()
2757 nla_put(msg, NL80211_ATTR_VHT_CAPABILITY_MASK, in nl80211_send_wiphy()
2762 if (nla_put(msg, NL80211_ATTR_MAC, ETH_ALEN, in nl80211_send_wiphy()
2767 nla_put(msg, NL80211_ATTR_MAC_MASK, ETH_ALEN, in nl80211_send_wiphy()
2774 attr = nla_nest_start(msg, NL80211_ATTR_MAC_ADDRS); in nl80211_send_wiphy()
2779 if (nla_put(msg, i + 1, ETH_ALEN, in nl80211_send_wiphy()
2783 nla_nest_end(msg, attr); in nl80211_send_wiphy()
2789 if (nl80211_send_coalesce(msg, rdev)) in nl80211_send_wiphy()
2793 (nla_put_flag(msg, NL80211_ATTR_SUPPORT_5_MHZ) || in nl80211_send_wiphy()
2794 nla_put_flag(msg, NL80211_ATTR_SUPPORT_10_MHZ))) in nl80211_send_wiphy()
2798 nla_put_u32(msg, NL80211_ATTR_MAX_AP_ASSOC_STA, in nl80211_send_wiphy()
2809 nested = nla_nest_start_noflag(msg, in nl80211_send_wiphy()
2816 if (nla_put(msg, i + 1, sizeof(*info), info)) in nl80211_send_wiphy()
2819 nla_nest_end(msg, nested); in nl80211_send_wiphy()
2826 nested = nla_nest_start_noflag(msg, in nl80211_send_wiphy()
2833 if (nla_put(msg, i + 1, sizeof(*info), info)) in nl80211_send_wiphy()
2836 nla_nest_end(msg, nested); in nl80211_send_wiphy()
2842 nla_put_u8(msg, NL80211_ATTR_MAX_CSA_COUNTERS, in nl80211_send_wiphy()
2847 nla_put_flag(msg, NL80211_ATTR_WIPHY_SELF_MANAGED_REG)) in nl80211_send_wiphy()
2851 nla_put_u32(msg, NL80211_ATTR_SCHED_SCAN_MAX_REQS, in nl80211_send_wiphy()
2855 if (nla_put(msg, NL80211_ATTR_EXT_FEATURES, in nl80211_send_wiphy()
2864 nested = nla_nest_start_noflag(msg, in nl80211_send_wiphy()
2872 nla_put_flag(msg, i)) in nl80211_send_wiphy()
2877 nla_nest_end(msg, nested); in nl80211_send_wiphy()
2887 nested = nla_nest_start_noflag(msg, in nl80211_send_wiphy()
2898 nested_ext_capab = nla_nest_start_noflag(msg, in nl80211_send_wiphy()
2901 nla_put_u32(msg, NL80211_ATTR_IFTYPE, in nl80211_send_wiphy()
2903 nla_put(msg, NL80211_ATTR_EXT_CAPA, in nl80211_send_wiphy()
2906 nla_put(msg, NL80211_ATTR_EXT_CAPA_MASK, in nl80211_send_wiphy()
2912 (nla_put_u16(msg, in nl80211_send_wiphy()
2915 nla_put_u16(msg, in nl80211_send_wiphy()
2920 nla_nest_end(msg, nested_ext_capab); in nl80211_send_wiphy()
2924 nla_nest_end(msg, nested); in nl80211_send_wiphy()
2931 if (nla_put_u32(msg, NL80211_ATTR_BANDS, in nl80211_send_wiphy()
2942 !nl80211_put_txq_stats(msg, &txqstats, in nl80211_send_wiphy()
2946 if (nla_put_u32(msg, NL80211_ATTR_TXQ_LIMIT, in nl80211_send_wiphy()
2949 if (nla_put_u32(msg, NL80211_ATTR_TXQ_MEMORY_LIMIT, in nl80211_send_wiphy()
2952 if (nla_put_u32(msg, NL80211_ATTR_TXQ_QUANTUM, in nl80211_send_wiphy()
2960 if (nl80211_send_pmsr_capa(rdev, msg)) in nl80211_send_wiphy()
2967 nla_put(msg, NL80211_ATTR_AKM_SUITES, in nl80211_send_wiphy()
2972 if (nl80211_put_iftype_akm_suites(rdev, msg)) in nl80211_send_wiphy()
2975 if (nl80211_put_tid_config_support(rdev, msg)) in nl80211_send_wiphy()
2980 if (nl80211_put_sar_specs(rdev, msg)) in nl80211_send_wiphy()
2983 if (nl80211_put_mbssid_support(&rdev->wiphy, msg)) in nl80211_send_wiphy()
2986 if (nla_put_u16(msg, NL80211_ATTR_MAX_NUM_AKM_SUITES, in nl80211_send_wiphy()
2991 nla_put_flag(msg, NL80211_ATTR_MLO_SUPPORT); in nl80211_send_wiphy()
2994 nla_put_u16(msg, NL80211_ATTR_MAX_HW_TIMESTAMP_PEERS, in nl80211_send_wiphy()
3003 genlmsg_end(msg, hdr); in nl80211_send_wiphy()
3007 genlmsg_cancel(msg, hdr); in nl80211_send_wiphy()
3143 struct sk_buff *msg; in nl80211_get_wiphy() local
3147 msg = nlmsg_new(4096, GFP_KERNEL); in nl80211_get_wiphy()
3148 if (!msg) in nl80211_get_wiphy()
3151 if (nl80211_send_wiphy(rdev, NL80211_CMD_NEW_WIPHY, msg, in nl80211_get_wiphy()
3154 nlmsg_free(msg); in nl80211_get_wiphy()
3158 return genlmsg_reply(msg, info); in nl80211_get_wiphy()
3820 int nl80211_send_chandef(struct sk_buff *msg, const struct cfg80211_chan_def *chandef) in nl80211_send_chandef() argument
3825 if (nla_put_u32(msg, NL80211_ATTR_WIPHY_FREQ, in nl80211_send_chandef()
3828 if (nla_put_u32(msg, NL80211_ATTR_WIPHY_FREQ_OFFSET, in nl80211_send_chandef()
3835 if (nla_put_u32(msg, NL80211_ATTR_WIPHY_CHANNEL_TYPE, in nl80211_send_chandef()
3842 if (nla_put_u32(msg, NL80211_ATTR_CHANNEL_WIDTH, chandef->width)) in nl80211_send_chandef()
3844 if (nla_put_u32(msg, NL80211_ATTR_CENTER_FREQ1, chandef->center_freq1)) in nl80211_send_chandef()
3847 nla_put_u32(msg, NL80211_ATTR_CENTER_FREQ2, chandef->center_freq2)) in nl80211_send_chandef()
3853 static int nl80211_send_iface(struct sk_buff *msg, u32 portid, u32 seq, int flags, in nl80211_send_iface() argument
3865 hdr = nl80211hdr_put(msg, portid, seq, flags, cmd); in nl80211_send_iface()
3870 (nla_put_u32(msg, NL80211_ATTR_IFINDEX, dev->ifindex) || in nl80211_send_iface()
3871 nla_put_string(msg, NL80211_ATTR_IFNAME, dev->name))) in nl80211_send_iface()
3874 if (nla_put_u32(msg, NL80211_ATTR_WIPHY, rdev->wiphy_idx) || in nl80211_send_iface()
3875 nla_put_u32(msg, NL80211_ATTR_IFTYPE, wdev->iftype) || in nl80211_send_iface()
3876 nla_put_u64_64bit(msg, NL80211_ATTR_WDEV, wdev_id(wdev), in nl80211_send_iface()
3878 nla_put(msg, NL80211_ATTR_MAC, ETH_ALEN, wdev_address(wdev)) || in nl80211_send_iface()
3879 nla_put_u32(msg, NL80211_ATTR_GENERATION, in nl80211_send_iface()
3882 nla_put_u8(msg, NL80211_ATTR_4ADDR, wdev->use_4addr)) in nl80211_send_iface()
3890 if (ret == 0 && nl80211_send_chandef(msg, &chandef)) in nl80211_send_iface()
3899 nla_put_u32(msg, NL80211_ATTR_WIPHY_TX_POWER_LEVEL, in nl80211_send_iface()
3909 nla_put(msg, NL80211_ATTR_SSID, wdev->u.ap.ssid_len, in nl80211_send_iface()
3916 nla_put(msg, NL80211_ATTR_SSID, wdev->u.client.ssid_len, in nl80211_send_iface()
3922 nla_put(msg, NL80211_ATTR_SSID, wdev->u.ibss.ssid_len, in nl80211_send_iface()
3937 !nl80211_put_txq_stats(msg, &txqstats, in nl80211_send_iface()
3944 struct nlattr *links = nla_nest_start(msg, in nl80211_send_iface()
3951 struct nlattr *link = nla_nest_start(msg, link_id + 1); in nl80211_send_iface()
3958 if (nla_put_u8(msg, NL80211_ATTR_MLO_LINK_ID, link_id)) in nl80211_send_iface()
3960 if (nla_put(msg, NL80211_ATTR_MAC, ETH_ALEN, in nl80211_send_iface()
3965 if (ret == 0 && nl80211_send_chandef(msg, &chandef)) in nl80211_send_iface()
3968 nla_nest_end(msg, link); in nl80211_send_iface()
3971 nla_nest_end(msg, links); in nl80211_send_iface()
3974 genlmsg_end(msg, hdr); in nl80211_send_iface()
3980 genlmsg_cancel(msg, hdr); in nl80211_send_iface()
4062 struct sk_buff *msg; in nl80211_get_interface() local
4066 msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL); in nl80211_get_interface()
4067 if (!msg) in nl80211_get_interface()
4070 if (nl80211_send_iface(msg, info->snd_portid, info->snd_seq, 0, in nl80211_get_interface()
4072 nlmsg_free(msg); in nl80211_get_interface()
4076 return genlmsg_reply(msg, info); in nl80211_get_interface()
4277 struct sk_buff *msg; in _nl80211_new_interface() local
4315 msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL); in _nl80211_new_interface()
4316 if (!msg) in _nl80211_new_interface()
4323 nlmsg_free(msg); in _nl80211_new_interface()
4326 nlmsg_free(msg); in _nl80211_new_interface()
4360 if (nl80211_send_iface(msg, info->snd_portid, info->snd_seq, 0, in _nl80211_new_interface()
4362 nlmsg_free(msg); in _nl80211_new_interface()
4366 return genlmsg_reply(msg, info); in _nl80211_new_interface()
4470 struct sk_buff *msg; member
4481 nla_put(cookie->msg, NL80211_ATTR_KEY_SEQ, in get_key_callback()
4484 nla_put_u32(cookie->msg, NL80211_ATTR_KEY_CIPHER, in get_key_callback()
4488 key = nla_nest_start_noflag(cookie->msg, NL80211_ATTR_KEY); in get_key_callback()
4493 nla_put(cookie->msg, NL80211_KEY_SEQ, in get_key_callback()
4496 nla_put_u32(cookie->msg, NL80211_KEY_CIPHER, in get_key_callback()
4500 if (nla_put_u8(cookie->msg, NL80211_KEY_IDX, cookie->idx)) in get_key_callback()
4503 nla_nest_end(cookie->msg, key); in get_key_callback()
4522 struct sk_buff *msg; in nl80211_get_key() local
4565 msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL); in nl80211_get_key()
4566 if (!msg) in nl80211_get_key()
4569 hdr = nl80211hdr_put(msg, info->snd_portid, info->snd_seq, 0, in nl80211_get_key()
4574 cookie.msg = msg; in nl80211_get_key()
4577 if (nla_put_u32(msg, NL80211_ATTR_IFINDEX, dev->ifindex) || in nl80211_get_key()
4578 nla_put_u8(msg, NL80211_ATTR_KEY_IDX, key_idx)) in nl80211_get_key()
4581 nla_put(msg, NL80211_ATTR_MAC, ETH_ALEN, mac_addr)) in nl80211_get_key()
4597 genlmsg_end(msg, hdr); in nl80211_get_key()
4598 return genlmsg_reply(msg, info); in nl80211_get_key()
4603 nlmsg_free(msg); in nl80211_get_key()
5909 struct sk_buff *msg; in nl80211_send_ap_started() local
5912 msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL); in nl80211_send_ap_started()
5913 if (!msg) in nl80211_send_ap_started()
5916 hdr = nl80211hdr_put(msg, 0, 0, 0, NL80211_CMD_START_AP); in nl80211_send_ap_started()
5920 if (nla_put_u32(msg, NL80211_ATTR_WIPHY, rdev->wiphy_idx) || in nl80211_send_ap_started()
5921 nla_put_u32(msg, NL80211_ATTR_IFINDEX, wdev->netdev->ifindex) || in nl80211_send_ap_started()
5922 nla_put_u64_64bit(msg, NL80211_ATTR_WDEV, wdev_id(wdev), in nl80211_send_ap_started()
5925 nla_put(msg, NL80211_ATTR_SSID, wdev->u.ap.ssid_len, in nl80211_send_ap_started()
5928 nla_put_u8(msg, NL80211_ATTR_MLO_LINK_ID, link_id))) in nl80211_send_ap_started()
5931 genlmsg_end(msg, hdr); in nl80211_send_ap_started()
5933 genlmsg_multicast_netns(&nl80211_fam, wiphy_net(wiphy), msg, 0, in nl80211_send_ap_started()
5937 nlmsg_free(msg); in nl80211_send_ap_started()
6399 bool nl80211_put_sta_rate(struct sk_buff *msg, struct rate_info *info, int attr) in nl80211_put_sta_rate() argument
6406 rate = nla_nest_start_noflag(msg, attr); in nl80211_put_sta_rate()
6415 nla_put_u32(msg, NL80211_RATE_INFO_BITRATE32, bitrate)) in nl80211_put_sta_rate()
6418 nla_put_u16(msg, NL80211_RATE_INFO_BITRATE, bitrate_compat)) in nl80211_put_sta_rate()
6471 if (rate_flg && nla_put_flag(msg, rate_flg)) in nl80211_put_sta_rate()
6475 if (nla_put_u8(msg, NL80211_RATE_INFO_MCS, info->mcs)) in nl80211_put_sta_rate()
6478 nla_put_flag(msg, NL80211_RATE_INFO_SHORT_GI)) in nl80211_put_sta_rate()
6481 if (nla_put_u8(msg, NL80211_RATE_INFO_VHT_MCS, info->mcs)) in nl80211_put_sta_rate()
6483 if (nla_put_u8(msg, NL80211_RATE_INFO_VHT_NSS, info->nss)) in nl80211_put_sta_rate()
6486 nla_put_flag(msg, NL80211_RATE_INFO_SHORT_GI)) in nl80211_put_sta_rate()
6489 if (nla_put_u8(msg, NL80211_RATE_INFO_HE_MCS, info->mcs)) in nl80211_put_sta_rate()
6491 if (nla_put_u8(msg, NL80211_RATE_INFO_HE_NSS, info->nss)) in nl80211_put_sta_rate()
6493 if (nla_put_u8(msg, NL80211_RATE_INFO_HE_GI, info->he_gi)) in nl80211_put_sta_rate()
6495 if (nla_put_u8(msg, NL80211_RATE_INFO_HE_DCM, info->he_dcm)) in nl80211_put_sta_rate()
6498 nla_put_u8(msg, NL80211_RATE_INFO_HE_RU_ALLOC, in nl80211_put_sta_rate()
6502 if (nla_put_u8(msg, NL80211_RATE_INFO_S1G_MCS, info->mcs)) in nl80211_put_sta_rate()
6504 if (nla_put_u8(msg, NL80211_RATE_INFO_S1G_NSS, info->nss)) in nl80211_put_sta_rate()
6507 nla_put_flag(msg, NL80211_RATE_INFO_SHORT_GI)) in nl80211_put_sta_rate()
6510 if (nla_put_u8(msg, NL80211_RATE_INFO_EHT_MCS, info->mcs)) in nl80211_put_sta_rate()
6512 if (nla_put_u8(msg, NL80211_RATE_INFO_EHT_NSS, info->nss)) in nl80211_put_sta_rate()
6514 if (nla_put_u8(msg, NL80211_RATE_INFO_EHT_GI, info->eht_gi)) in nl80211_put_sta_rate()
6517 nla_put_u8(msg, NL80211_RATE_INFO_EHT_RU_ALLOC, in nl80211_put_sta_rate()
6522 nla_nest_end(msg, rate); in nl80211_put_sta_rate()
6526 static bool nl80211_put_signal(struct sk_buff *msg, u8 mask, s8 *signal, in nl80211_put_signal() argument
6535 attr = nla_nest_start_noflag(msg, id); in nl80211_put_signal()
6543 if (nla_put_u8(msg, i, signal[i])) in nl80211_put_signal()
6547 nla_nest_end(msg, attr); in nl80211_put_signal()
6552 static int nl80211_send_station(struct sk_buff *msg, u32 cmd, u32 portid, in nl80211_send_station() argument
6561 hdr = nl80211hdr_put(msg, portid, seq, flags, cmd); in nl80211_send_station()
6567 if (nla_put_u32(msg, NL80211_ATTR_IFINDEX, dev->ifindex) || in nl80211_send_station()
6568 nla_put(msg, NL80211_ATTR_MAC, ETH_ALEN, mac_addr) || in nl80211_send_station()
6569 nla_put_u32(msg, NL80211_ATTR_GENERATION, sinfo->generation)) in nl80211_send_station()
6572 sinfoattr = nla_nest_start_noflag(msg, NL80211_ATTR_STA_INFO); in nl80211_send_station()
6579 nla_put_ ## type(msg, NL80211_STA_INFO_ ## attr, \ in nl80211_send_station()
6585 nla_put_u64_64bit(msg, NL80211_STA_INFO_ ## attr, \ in nl80211_send_station()
6596 nla_put_u32(msg, NL80211_STA_INFO_RX_BYTES, in nl80211_send_station()
6602 nla_put_u32(msg, NL80211_STA_INFO_TX_BYTES, in nl80211_send_station()
6627 if (!nl80211_put_signal(msg, sinfo->chains, in nl80211_send_station()
6633 if (!nl80211_put_signal(msg, sinfo->chains, in nl80211_send_station()
6639 if (!nl80211_put_sta_rate(msg, &sinfo->txrate, in nl80211_send_station()
6644 if (!nl80211_put_sta_rate(msg, &sinfo->rxrate, in nl80211_send_station()
6663 bss_param = nla_nest_start_noflag(msg, in nl80211_send_station()
6669 nla_put_flag(msg, NL80211_STA_BSS_PARAM_CTS_PROT)) || in nl80211_send_station()
6671 nla_put_flag(msg, NL80211_STA_BSS_PARAM_SHORT_PREAMBLE)) || in nl80211_send_station()
6673 nla_put_flag(msg, NL80211_STA_BSS_PARAM_SHORT_SLOT_TIME)) || in nl80211_send_station()
6674 nla_put_u8(msg, NL80211_STA_BSS_PARAM_DTIM_PERIOD, in nl80211_send_station()
6676 nla_put_u16(msg, NL80211_STA_BSS_PARAM_BEACON_INTERVAL, in nl80211_send_station()
6680 nla_nest_end(msg, bss_param); in nl80211_send_station()
6683 nla_put(msg, NL80211_STA_INFO_STA_FLAGS, in nl80211_send_station()
6707 tidsattr = nla_nest_start_noflag(msg, in nl80211_send_station()
6721 tidattr = nla_nest_start_noflag(msg, tid + 1); in nl80211_send_station()
6727 nla_put_u64_64bit(msg, NL80211_TID_STATS_ ## attr, \ in nl80211_send_station()
6740 !nl80211_put_txq_stats(msg, &tidstats->txq_stats, in nl80211_send_station()
6744 nla_nest_end(msg, tidattr); in nl80211_send_station()
6747 nla_nest_end(msg, tidsattr); in nl80211_send_station()
6750 nla_nest_end(msg, sinfoattr); in nl80211_send_station()
6753 nla_put(msg, NL80211_ATTR_IE, sinfo->assoc_req_ies_len, in nl80211_send_station()
6758 nla_put(msg, NL80211_ATTR_RESP_IE, sinfo->assoc_resp_ies_len, in nl80211_send_station()
6763 if (nla_put_u8(msg, NL80211_ATTR_MLO_LINK_ID, in nl80211_send_station()
6768 nla_put(msg, NL80211_ATTR_MLD_ADDR, ETH_ALEN, in nl80211_send_station()
6774 genlmsg_end(msg, hdr); in nl80211_send_station()
6779 genlmsg_cancel(msg, hdr); in nl80211_send_station()
6842 struct sk_buff *msg; in nl80211_get_station() local
6860 msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL); in nl80211_get_station()
6861 if (!msg) { in nl80211_get_station()
6866 if (nl80211_send_station(msg, NL80211_CMD_NEW_STATION, in nl80211_get_station()
6869 nlmsg_free(msg); in nl80211_get_station()
6873 return genlmsg_reply(msg, info); in nl80211_get_station()
7708 static int nl80211_send_mpath(struct sk_buff *msg, u32 portid, u32 seq, in nl80211_send_mpath() argument
7716 hdr = nl80211hdr_put(msg, portid, seq, flags, NL80211_CMD_NEW_MPATH); in nl80211_send_mpath()
7720 if (nla_put_u32(msg, NL80211_ATTR_IFINDEX, dev->ifindex) || in nl80211_send_mpath()
7721 nla_put(msg, NL80211_ATTR_MAC, ETH_ALEN, dst) || in nl80211_send_mpath()
7722 nla_put(msg, NL80211_ATTR_MPATH_NEXT_HOP, ETH_ALEN, next_hop) || in nl80211_send_mpath()
7723 nla_put_u32(msg, NL80211_ATTR_GENERATION, pinfo->generation)) in nl80211_send_mpath()
7726 pinfoattr = nla_nest_start_noflag(msg, NL80211_ATTR_MPATH_INFO); in nl80211_send_mpath()
7730 nla_put_u32(msg, NL80211_MPATH_INFO_FRAME_QLEN, in nl80211_send_mpath()
7734 nla_put_u32(msg, NL80211_MPATH_INFO_SN, pinfo->sn)) || in nl80211_send_mpath()
7736 nla_put_u32(msg, NL80211_MPATH_INFO_METRIC, in nl80211_send_mpath()
7739 nla_put_u32(msg, NL80211_MPATH_INFO_EXPTIME, in nl80211_send_mpath()
7742 nla_put_u8(msg, NL80211_MPATH_INFO_FLAGS, in nl80211_send_mpath()
7745 nla_put_u32(msg, NL80211_MPATH_INFO_DISCOVERY_TIMEOUT, in nl80211_send_mpath()
7748 nla_put_u8(msg, NL80211_MPATH_INFO_DISCOVERY_RETRIES, in nl80211_send_mpath()
7751 nla_put_u8(msg, NL80211_MPATH_INFO_HOP_COUNT, in nl80211_send_mpath()
7754 nla_put_u32(msg, NL80211_MPATH_INFO_PATH_CHANGE, in nl80211_send_mpath()
7758 nla_nest_end(msg, pinfoattr); in nl80211_send_mpath()
7760 genlmsg_end(msg, hdr); in nl80211_send_mpath()
7764 genlmsg_cancel(msg, hdr); in nl80211_send_mpath()
7826 struct sk_buff *msg; in nl80211_get_mpath() local
7847 msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL); in nl80211_get_mpath()
7848 if (!msg) in nl80211_get_mpath()
7851 if (nl80211_send_mpath(msg, info->snd_portid, info->snd_seq, 0, in nl80211_get_mpath()
7853 nlmsg_free(msg); in nl80211_get_mpath()
7857 return genlmsg_reply(msg, info); in nl80211_get_mpath()
7934 struct sk_buff *msg; in nl80211_get_mpp() local
7955 msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL); in nl80211_get_mpp()
7956 if (!msg) in nl80211_get_mpp()
7959 if (nl80211_send_mpath(msg, info->snd_portid, info->snd_seq, 0, in nl80211_get_mpp()
7961 nlmsg_free(msg); in nl80211_get_mpp()
7965 return genlmsg_reply(msg, info); in nl80211_get_mpp()
8156 struct sk_buff *msg; in nl80211_get_mesh_config() local
8176 msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL); in nl80211_get_mesh_config()
8177 if (!msg) in nl80211_get_mesh_config()
8179 hdr = nl80211hdr_put(msg, info->snd_portid, info->snd_seq, 0, in nl80211_get_mesh_config()
8183 pinfoattr = nla_nest_start_noflag(msg, NL80211_ATTR_MESH_CONFIG); in nl80211_get_mesh_config()
8186 if (nla_put_u32(msg, NL80211_ATTR_IFINDEX, dev->ifindex) || in nl80211_get_mesh_config()
8187 nla_put_u16(msg, NL80211_MESHCONF_RETRY_TIMEOUT, in nl80211_get_mesh_config()
8189 nla_put_u16(msg, NL80211_MESHCONF_CONFIRM_TIMEOUT, in nl80211_get_mesh_config()
8191 nla_put_u16(msg, NL80211_MESHCONF_HOLDING_TIMEOUT, in nl80211_get_mesh_config()
8193 nla_put_u16(msg, NL80211_MESHCONF_MAX_PEER_LINKS, in nl80211_get_mesh_config()
8195 nla_put_u8(msg, NL80211_MESHCONF_MAX_RETRIES, in nl80211_get_mesh_config()
8197 nla_put_u8(msg, NL80211_MESHCONF_TTL, in nl80211_get_mesh_config()
8199 nla_put_u8(msg, NL80211_MESHCONF_ELEMENT_TTL, in nl80211_get_mesh_config()
8201 nla_put_u8(msg, NL80211_MESHCONF_AUTO_OPEN_PLINKS, in nl80211_get_mesh_config()
8203 nla_put_u32(msg, NL80211_MESHCONF_SYNC_OFFSET_MAX_NEIGHBOR, in nl80211_get_mesh_config()
8205 nla_put_u8(msg, NL80211_MESHCONF_HWMP_MAX_PREQ_RETRIES, in nl80211_get_mesh_config()
8207 nla_put_u32(msg, NL80211_MESHCONF_PATH_REFRESH_TIME, in nl80211_get_mesh_config()
8209 nla_put_u16(msg, NL80211_MESHCONF_MIN_DISCOVERY_TIMEOUT, in nl80211_get_mesh_config()
8211 nla_put_u32(msg, NL80211_MESHCONF_HWMP_ACTIVE_PATH_TIMEOUT, in nl80211_get_mesh_config()
8213 nla_put_u16(msg, NL80211_MESHCONF_HWMP_PREQ_MIN_INTERVAL, in nl80211_get_mesh_config()
8215 nla_put_u16(msg, NL80211_MESHCONF_HWMP_PERR_MIN_INTERVAL, in nl80211_get_mesh_config()
8217 nla_put_u16(msg, NL80211_MESHCONF_HWMP_NET_DIAM_TRVS_TIME, in nl80211_get_mesh_config()
8219 nla_put_u8(msg, NL80211_MESHCONF_HWMP_ROOTMODE, in nl80211_get_mesh_config()
8221 nla_put_u16(msg, NL80211_MESHCONF_HWMP_RANN_INTERVAL, in nl80211_get_mesh_config()
8223 nla_put_u8(msg, NL80211_MESHCONF_GATE_ANNOUNCEMENTS, in nl80211_get_mesh_config()
8225 nla_put_u8(msg, NL80211_MESHCONF_FORWARDING, in nl80211_get_mesh_config()
8227 nla_put_s32(msg, NL80211_MESHCONF_RSSI_THRESHOLD, in nl80211_get_mesh_config()
8229 nla_put_u32(msg, NL80211_MESHCONF_HT_OPMODE, in nl80211_get_mesh_config()
8231 nla_put_u32(msg, NL80211_MESHCONF_HWMP_PATH_TO_ROOT_TIMEOUT, in nl80211_get_mesh_config()
8233 nla_put_u16(msg, NL80211_MESHCONF_HWMP_ROOT_INTERVAL, in nl80211_get_mesh_config()
8235 nla_put_u16(msg, NL80211_MESHCONF_HWMP_CONFIRMATION_INTERVAL, in nl80211_get_mesh_config()
8237 nla_put_u32(msg, NL80211_MESHCONF_POWER_MODE, in nl80211_get_mesh_config()
8239 nla_put_u16(msg, NL80211_MESHCONF_AWAKE_WINDOW, in nl80211_get_mesh_config()
8241 nla_put_u32(msg, NL80211_MESHCONF_PLINK_TIMEOUT, in nl80211_get_mesh_config()
8243 nla_put_u8(msg, NL80211_MESHCONF_CONNECTED_TO_GATE, in nl80211_get_mesh_config()
8245 nla_put_u8(msg, NL80211_MESHCONF_NOLEARN, in nl80211_get_mesh_config()
8247 nla_put_u8(msg, NL80211_MESHCONF_CONNECTED_TO_AS, in nl80211_get_mesh_config()
8250 nla_nest_end(msg, pinfoattr); in nl80211_get_mesh_config()
8251 genlmsg_end(msg, hdr); in nl80211_get_mesh_config()
8252 return genlmsg_reply(msg, info); in nl80211_get_mesh_config()
8256 nlmsg_free(msg); in nl80211_get_mesh_config()
8559 struct sk_buff *msg) in nl80211_put_regdom() argument
8564 if (nla_put_string(msg, NL80211_ATTR_REG_ALPHA2, regdom->alpha2) || in nl80211_put_regdom()
8566 nla_put_u8(msg, NL80211_ATTR_DFS_REGION, regdom->dfs_region))) in nl80211_put_regdom()
8569 nl_reg_rules = nla_nest_start_noflag(msg, NL80211_ATTR_REG_RULES); in nl80211_put_regdom()
8584 nl_reg_rule = nla_nest_start_noflag(msg, i); in nl80211_put_regdom()
8593 if (nla_put_u32(msg, NL80211_ATTR_REG_RULE_FLAGS, in nl80211_put_regdom()
8595 nla_put_u32(msg, NL80211_ATTR_FREQ_RANGE_START, in nl80211_put_regdom()
8597 nla_put_u32(msg, NL80211_ATTR_FREQ_RANGE_END, in nl80211_put_regdom()
8599 nla_put_u32(msg, NL80211_ATTR_FREQ_RANGE_MAX_BW, in nl80211_put_regdom()
8601 nla_put_u32(msg, NL80211_ATTR_POWER_RULE_MAX_ANT_GAIN, in nl80211_put_regdom()
8603 nla_put_u32(msg, NL80211_ATTR_POWER_RULE_MAX_EIRP, in nl80211_put_regdom()
8605 nla_put_u32(msg, NL80211_ATTR_DFS_CAC_TIME, in nl80211_put_regdom()
8609 nla_nest_end(msg, nl_reg_rule); in nl80211_put_regdom()
8612 nla_nest_end(msg, nl_reg_rules); in nl80211_put_regdom()
8624 struct sk_buff *msg; in nl80211_get_reg_do() local
8628 msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL); in nl80211_get_reg_do()
8629 if (!msg) in nl80211_get_reg_do()
8632 hdr = nl80211hdr_put(msg, info->snd_portid, info->snd_seq, 0, in nl80211_get_reg_do()
8663 nla_put_u32(msg, NL80211_ATTR_WIPHY, get_wiphy_idx(wiphy))) in nl80211_get_reg_do()
8670 nla_put_u32(msg, NL80211_ATTR_USER_REG_HINT_TYPE, in nl80211_get_reg_do()
8677 if (nl80211_put_regdom(regdom, msg)) in nl80211_get_reg_do()
8682 genlmsg_end(msg, hdr); in nl80211_get_reg_do()
8684 return genlmsg_reply(msg, info); in nl80211_get_reg_do()
8691 nlmsg_free(msg); in nl80211_get_reg_do()
8695 static int nl80211_send_regdom(struct sk_buff *msg, struct netlink_callback *cb, in nl80211_send_regdom() argument
8699 void *hdr = nl80211hdr_put(msg, NETLINK_CB(cb->skb).portid, seq, flags, in nl80211_send_regdom()
8707 if (nl80211_put_regdom(regdom, msg)) in nl80211_send_regdom()
8711 nla_put_u32(msg, NL80211_ATTR_USER_REG_HINT_TYPE, in nl80211_send_regdom()
8716 nla_put_u32(msg, NL80211_ATTR_WIPHY, get_wiphy_idx(wiphy))) in nl80211_send_regdom()
8720 nla_put_flag(msg, NL80211_ATTR_WIPHY_SELF_MANAGED_REG)) in nl80211_send_regdom()
8723 genlmsg_end(msg, hdr); in nl80211_send_regdom()
8727 genlmsg_cancel(msg, hdr); in nl80211_send_regdom()
10342 static int nl80211_send_bss(struct sk_buff *msg, struct netlink_callback *cb, in nl80211_send_bss() argument
10356 hdr = nl80211hdr_put(msg, NETLINK_CB(cb->skb).portid, seq, flags, in nl80211_send_bss()
10363 if (nla_put_u32(msg, NL80211_ATTR_GENERATION, rdev->bss_generation)) in nl80211_send_bss()
10366 nla_put_u32(msg, NL80211_ATTR_IFINDEX, wdev->netdev->ifindex)) in nl80211_send_bss()
10368 if (nla_put_u64_64bit(msg, NL80211_ATTR_WDEV, wdev_id(wdev), in nl80211_send_bss()
10372 bss = nla_nest_start_noflag(msg, NL80211_ATTR_BSS); in nl80211_send_bss()
10376 nla_put(msg, NL80211_BSS_BSSID, ETH_ALEN, res->bssid))) in nl80211_send_bss()
10382 nla_put_flag(msg, NL80211_BSS_PRESP_DATA)) in nl80211_send_bss()
10390 if (nla_put_u64_64bit(msg, NL80211_BSS_TSF, ies->tsf, in nl80211_send_bss()
10393 if (ies->len && nla_put(msg, NL80211_BSS_INFORMATION_ELEMENTS, in nl80211_send_bss()
10401 if (nla_put_u64_64bit(msg, NL80211_BSS_BEACON_TSF, ies->tsf, in nl80211_send_bss()
10404 if (ies->len && nla_put(msg, NL80211_BSS_BEACON_IES, in nl80211_send_bss()
10411 nla_put_u16(msg, NL80211_BSS_BEACON_INTERVAL, res->beacon_interval)) in nl80211_send_bss()
10413 if (nla_put_u16(msg, NL80211_BSS_CAPABILITY, res->capability) || in nl80211_send_bss()
10414 nla_put_u32(msg, NL80211_BSS_FREQUENCY, res->channel->center_freq) || in nl80211_send_bss()
10415 nla_put_u32(msg, NL80211_BSS_FREQUENCY_OFFSET, in nl80211_send_bss()
10417 nla_put_u32(msg, NL80211_BSS_CHAN_WIDTH, res->scan_width) || in nl80211_send_bss()
10418 nla_put_u32(msg, NL80211_BSS_SEEN_MS_AGO, in nl80211_send_bss()
10423 (nla_put_u64_64bit(msg, NL80211_BSS_PARENT_TSF, in nl80211_send_bss()
10425 nla_put(msg, NL80211_BSS_PARENT_BSSID, ETH_ALEN, in nl80211_send_bss()
10430 nla_put_u64_64bit(msg, NL80211_BSS_LAST_SEEN_BOOTTIME, in nl80211_send_bss()
10434 if (!nl80211_put_signal(msg, intbss->pub.chains, in nl80211_send_bss()
10441 if (nla_put_u32(msg, NL80211_BSS_SIGNAL_MBM, res->signal)) in nl80211_send_bss()
10445 if (nla_put_u8(msg, NL80211_BSS_SIGNAL_UNSPEC, res->signal)) in nl80211_send_bss()
10457 (nla_put_u32(msg, NL80211_BSS_STATUS, in nl80211_send_bss()
10460 (nla_put_u8(msg, NL80211_BSS_MLO_LINK_ID, in nl80211_send_bss()
10462 nla_put(msg, NL80211_BSS_MLD_ADDR, ETH_ALEN, in nl80211_send_bss()
10469 nla_put_u32(msg, NL80211_BSS_STATUS, in nl80211_send_bss()
10477 nla_nest_end(msg, bss); in nl80211_send_bss()
10479 genlmsg_end(msg, hdr); in nl80211_send_bss()
10485 genlmsg_cancel(msg, hdr); in nl80211_send_bss()
10537 static int nl80211_send_survey(struct sk_buff *msg, u32 portid, u32 seq, in nl80211_send_survey() argument
10549 hdr = nl80211hdr_put(msg, portid, seq, flags, in nl80211_send_survey()
10554 if (nla_put_u32(msg, NL80211_ATTR_IFINDEX, dev->ifindex)) in nl80211_send_survey()
10557 infoattr = nla_nest_start_noflag(msg, NL80211_ATTR_SURVEY_INFO); in nl80211_send_survey()
10562 nla_put_u32(msg, NL80211_SURVEY_INFO_FREQUENCY, in nl80211_send_survey()
10567 nla_put_u32(msg, NL80211_SURVEY_INFO_FREQUENCY_OFFSET, in nl80211_send_survey()
10572 nla_put_u8(msg, NL80211_SURVEY_INFO_NOISE, survey->noise)) in nl80211_send_survey()
10575 nla_put_flag(msg, NL80211_SURVEY_INFO_IN_USE)) in nl80211_send_survey()
10578 nla_put_u64_64bit(msg, NL80211_SURVEY_INFO_TIME, in nl80211_send_survey()
10582 nla_put_u64_64bit(msg, NL80211_SURVEY_INFO_TIME_BUSY, in nl80211_send_survey()
10586 nla_put_u64_64bit(msg, NL80211_SURVEY_INFO_TIME_EXT_BUSY, in nl80211_send_survey()
10590 nla_put_u64_64bit(msg, NL80211_SURVEY_INFO_TIME_RX, in nl80211_send_survey()
10594 nla_put_u64_64bit(msg, NL80211_SURVEY_INFO_TIME_TX, in nl80211_send_survey()
10598 nla_put_u64_64bit(msg, NL80211_SURVEY_INFO_TIME_SCAN, in nl80211_send_survey()
10602 nla_put_u64_64bit(msg, NL80211_SURVEY_INFO_TIME_BSS_RX, in nl80211_send_survey()
10606 nla_nest_end(msg, infoattr); in nl80211_send_survey()
10608 genlmsg_end(msg, hdr); in nl80211_send_survey()
10612 genlmsg_cancel(msg, hdr); in nl80211_send_survey()
12388 struct sk_buff *msg; in nl80211_remain_on_channel() local
12440 msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL); in nl80211_remain_on_channel()
12441 if (!msg) in nl80211_remain_on_channel()
12444 hdr = nl80211hdr_put(msg, info->snd_portid, info->snd_seq, 0, in nl80211_remain_on_channel()
12457 if (nla_put_u64_64bit(msg, NL80211_ATTR_COOKIE, cookie, in nl80211_remain_on_channel()
12461 genlmsg_end(msg, hdr); in nl80211_remain_on_channel()
12463 return genlmsg_reply(msg, info); in nl80211_remain_on_channel()
12468 nlmsg_free(msg); in nl80211_remain_on_channel()
12574 struct sk_buff *msg = NULL; in nl80211_tx_mgmt() local
12684 msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL); in nl80211_tx_mgmt()
12685 if (!msg) in nl80211_tx_mgmt()
12688 hdr = nl80211hdr_put(msg, info->snd_portid, info->snd_seq, 0, in nl80211_tx_mgmt()
12701 if (msg) { in nl80211_tx_mgmt()
12702 if (nla_put_u64_64bit(msg, NL80211_ATTR_COOKIE, cookie, in nl80211_tx_mgmt()
12706 genlmsg_end(msg, hdr); in nl80211_tx_mgmt()
12707 return genlmsg_reply(msg, info); in nl80211_tx_mgmt()
12715 nlmsg_free(msg); in nl80211_tx_mgmt()
12790 struct sk_buff *msg; in nl80211_get_power_save() local
12799 msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL); in nl80211_get_power_save()
12800 if (!msg) in nl80211_get_power_save()
12803 hdr = nl80211hdr_put(msg, info->snd_portid, info->snd_seq, 0, in nl80211_get_power_save()
12815 if (nla_put_u32(msg, NL80211_ATTR_PS_STATE, ps_state)) in nl80211_get_power_save()
12818 genlmsg_end(msg, hdr); in nl80211_get_power_save()
12819 return genlmsg_reply(msg, info); in nl80211_get_power_save()
12824 nlmsg_free(msg); in nl80211_get_power_save()
13213 static int nl80211_send_wowlan_patterns(struct sk_buff *msg, in nl80211_send_wowlan_patterns() argument
13223 nl_pats = nla_nest_start_noflag(msg, NL80211_WOWLAN_TRIG_PKT_PATTERN); in nl80211_send_wowlan_patterns()
13228 nl_pat = nla_nest_start_noflag(msg, i + 1); in nl80211_send_wowlan_patterns()
13232 if (nla_put(msg, NL80211_PKTPAT_MASK, DIV_ROUND_UP(pat_len, 8), in nl80211_send_wowlan_patterns()
13234 nla_put(msg, NL80211_PKTPAT_PATTERN, pat_len, in nl80211_send_wowlan_patterns()
13236 nla_put_u32(msg, NL80211_PKTPAT_OFFSET, in nl80211_send_wowlan_patterns()
13239 nla_nest_end(msg, nl_pat); in nl80211_send_wowlan_patterns()
13241 nla_nest_end(msg, nl_pats); in nl80211_send_wowlan_patterns()
13246 static int nl80211_send_wowlan_tcp(struct sk_buff *msg, in nl80211_send_wowlan_tcp() argument
13254 nl_tcp = nla_nest_start_noflag(msg, in nl80211_send_wowlan_tcp()
13259 if (nla_put_in_addr(msg, NL80211_WOWLAN_TCP_SRC_IPV4, tcp->src) || in nl80211_send_wowlan_tcp()
13260 nla_put_in_addr(msg, NL80211_WOWLAN_TCP_DST_IPV4, tcp->dst) || in nl80211_send_wowlan_tcp()
13261 nla_put(msg, NL80211_WOWLAN_TCP_DST_MAC, ETH_ALEN, tcp->dst_mac) || in nl80211_send_wowlan_tcp()
13262 nla_put_u16(msg, NL80211_WOWLAN_TCP_SRC_PORT, tcp->src_port) || in nl80211_send_wowlan_tcp()
13263 nla_put_u16(msg, NL80211_WOWLAN_TCP_DST_PORT, tcp->dst_port) || in nl80211_send_wowlan_tcp()
13264 nla_put(msg, NL80211_WOWLAN_TCP_DATA_PAYLOAD, in nl80211_send_wowlan_tcp()
13266 nla_put_u32(msg, NL80211_WOWLAN_TCP_DATA_INTERVAL, in nl80211_send_wowlan_tcp()
13268 nla_put(msg, NL80211_WOWLAN_TCP_WAKE_PAYLOAD, in nl80211_send_wowlan_tcp()
13270 nla_put(msg, NL80211_WOWLAN_TCP_WAKE_MASK, in nl80211_send_wowlan_tcp()
13275 nla_put(msg, NL80211_WOWLAN_TCP_DATA_PAYLOAD_SEQ, in nl80211_send_wowlan_tcp()
13280 nla_put(msg, NL80211_WOWLAN_TCP_DATA_PAYLOAD_TOKEN, in nl80211_send_wowlan_tcp()
13285 nla_nest_end(msg, nl_tcp); in nl80211_send_wowlan_tcp()
13290 static int nl80211_send_wowlan_nd(struct sk_buff *msg, in nl80211_send_wowlan_nd() argument
13299 nd = nla_nest_start_noflag(msg, NL80211_WOWLAN_TRIG_NET_DETECT); in nl80211_send_wowlan_nd()
13304 nla_put_u32(msg, NL80211_ATTR_SCHED_SCAN_INTERVAL, in nl80211_send_wowlan_nd()
13308 if (nla_put_u32(msg, NL80211_ATTR_SCHED_SCAN_DELAY, req->delay)) in nl80211_send_wowlan_nd()
13314 if (nla_put_s8(msg, NL80211_ATTR_SCHED_SCAN_RELATIVE_RSSI, in nl80211_send_wowlan_nd()
13320 if (nla_put(msg, NL80211_ATTR_SCHED_SCAN_RSSI_ADJUST, in nl80211_send_wowlan_nd()
13325 freqs = nla_nest_start_noflag(msg, NL80211_ATTR_SCAN_FREQUENCIES); in nl80211_send_wowlan_nd()
13330 if (nla_put_u32(msg, i, req->channels[i]->center_freq)) in nl80211_send_wowlan_nd()
13334 nla_nest_end(msg, freqs); in nl80211_send_wowlan_nd()
13337 matches = nla_nest_start_noflag(msg, in nl80211_send_wowlan_nd()
13343 match = nla_nest_start_noflag(msg, i); in nl80211_send_wowlan_nd()
13347 if (nla_put(msg, NL80211_SCHED_SCAN_MATCH_ATTR_SSID, in nl80211_send_wowlan_nd()
13351 nla_nest_end(msg, match); in nl80211_send_wowlan_nd()
13353 nla_nest_end(msg, matches); in nl80211_send_wowlan_nd()
13356 scan_plans = nla_nest_start_noflag(msg, NL80211_ATTR_SCHED_SCAN_PLANS); in nl80211_send_wowlan_nd()
13361 scan_plan = nla_nest_start_noflag(msg, i + 1); in nl80211_send_wowlan_nd()
13365 if (nla_put_u32(msg, NL80211_SCHED_SCAN_PLAN_INTERVAL, in nl80211_send_wowlan_nd()
13368 nla_put_u32(msg, NL80211_SCHED_SCAN_PLAN_ITERATIONS, in nl80211_send_wowlan_nd()
13371 nla_nest_end(msg, scan_plan); in nl80211_send_wowlan_nd()
13373 nla_nest_end(msg, scan_plans); in nl80211_send_wowlan_nd()
13375 nla_nest_end(msg, nd); in nl80211_send_wowlan_nd()
13383 struct sk_buff *msg; in nl80211_get_wowlan() local
13398 msg = nlmsg_new(size, GFP_KERNEL); in nl80211_get_wowlan()
13399 if (!msg) in nl80211_get_wowlan()
13402 hdr = nl80211hdr_put(msg, info->snd_portid, info->snd_seq, 0, in nl80211_get_wowlan()
13410 nl_wowlan = nla_nest_start_noflag(msg, in nl80211_get_wowlan()
13416 nla_put_flag(msg, NL80211_WOWLAN_TRIG_ANY)) || in nl80211_get_wowlan()
13418 nla_put_flag(msg, NL80211_WOWLAN_TRIG_DISCONNECT)) || in nl80211_get_wowlan()
13420 nla_put_flag(msg, NL80211_WOWLAN_TRIG_MAGIC_PKT)) || in nl80211_get_wowlan()
13422 nla_put_flag(msg, NL80211_WOWLAN_TRIG_GTK_REKEY_FAILURE)) || in nl80211_get_wowlan()
13424 nla_put_flag(msg, NL80211_WOWLAN_TRIG_EAP_IDENT_REQUEST)) || in nl80211_get_wowlan()
13426 nla_put_flag(msg, NL80211_WOWLAN_TRIG_4WAY_HANDSHAKE)) || in nl80211_get_wowlan()
13428 nla_put_flag(msg, NL80211_WOWLAN_TRIG_RFKILL_RELEASE))) in nl80211_get_wowlan()
13431 if (nl80211_send_wowlan_patterns(msg, rdev)) in nl80211_get_wowlan()
13434 if (nl80211_send_wowlan_tcp(msg, in nl80211_get_wowlan()
13439 msg, in nl80211_get_wowlan()
13443 nla_nest_end(msg, nl_wowlan); in nl80211_get_wowlan()
13446 genlmsg_end(msg, hdr); in nl80211_get_wowlan()
13447 return genlmsg_reply(msg, info); in nl80211_get_wowlan()
13450 nlmsg_free(msg); in nl80211_get_wowlan()
13839 static int nl80211_send_coalesce_rules(struct sk_buff *msg, in nl80211_send_coalesce_rules() argument
13849 nl_rules = nla_nest_start_noflag(msg, NL80211_ATTR_COALESCE_RULE); in nl80211_send_coalesce_rules()
13854 nl_rule = nla_nest_start_noflag(msg, i + 1); in nl80211_send_coalesce_rules()
13859 if (nla_put_u32(msg, NL80211_ATTR_COALESCE_RULE_DELAY, in nl80211_send_coalesce_rules()
13863 if (nla_put_u32(msg, NL80211_ATTR_COALESCE_RULE_CONDITION, in nl80211_send_coalesce_rules()
13867 nl_pats = nla_nest_start_noflag(msg, in nl80211_send_coalesce_rules()
13873 nl_pat = nla_nest_start_noflag(msg, j + 1); in nl80211_send_coalesce_rules()
13877 if (nla_put(msg, NL80211_PKTPAT_MASK, in nl80211_send_coalesce_rules()
13880 nla_put(msg, NL80211_PKTPAT_PATTERN, pat_len, in nl80211_send_coalesce_rules()
13882 nla_put_u32(msg, NL80211_PKTPAT_OFFSET, in nl80211_send_coalesce_rules()
13885 nla_nest_end(msg, nl_pat); in nl80211_send_coalesce_rules()
13887 nla_nest_end(msg, nl_pats); in nl80211_send_coalesce_rules()
13888 nla_nest_end(msg, nl_rule); in nl80211_send_coalesce_rules()
13890 nla_nest_end(msg, nl_rules); in nl80211_send_coalesce_rules()
13898 struct sk_buff *msg; in nl80211_get_coalesce() local
13904 msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL); in nl80211_get_coalesce()
13905 if (!msg) in nl80211_get_coalesce()
13908 hdr = nl80211hdr_put(msg, info->snd_portid, info->snd_seq, 0, in nl80211_get_coalesce()
13913 if (rdev->coalesce && nl80211_send_coalesce_rules(msg, rdev)) in nl80211_get_coalesce()
13916 genlmsg_end(msg, hdr); in nl80211_get_coalesce()
13917 return genlmsg_reply(msg, info); in nl80211_get_coalesce()
13920 nlmsg_free(msg); in nl80211_get_coalesce()
14185 struct sk_buff *msg; in nl80211_probe_client() local
14201 msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL); in nl80211_probe_client()
14202 if (!msg) in nl80211_probe_client()
14205 hdr = nl80211hdr_put(msg, info->snd_portid, info->snd_seq, 0, in nl80211_probe_client()
14218 if (nla_put_u64_64bit(msg, NL80211_ATTR_COOKIE, cookie, in nl80211_probe_client()
14222 genlmsg_end(msg, hdr); in nl80211_probe_client()
14224 return genlmsg_reply(msg, info); in nl80211_probe_client()
14229 nlmsg_free(msg); in nl80211_probe_client()
14438 struct sk_buff *msg = NULL; in nl80211_nan_add_func() local
14624 msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL); in nl80211_nan_add_func()
14625 if (!msg) { in nl80211_nan_add_func()
14630 hdr = nl80211hdr_put(msg, info->snd_portid, info->snd_seq, 0, in nl80211_nan_add_func()
14642 nlmsg_free(msg); in nl80211_nan_add_func()
14647 if (nla_put_u64_64bit(msg, NL80211_ATTR_COOKIE, func->cookie, in nl80211_nan_add_func()
14651 func_attr = nla_nest_start_noflag(msg, NL80211_ATTR_NAN_FUNC); in nl80211_nan_add_func()
14655 if (nla_put_u8(msg, NL80211_NAN_FUNC_INSTANCE_ID, in nl80211_nan_add_func()
14659 nla_nest_end(msg, func_attr); in nl80211_nan_add_func()
14661 genlmsg_end(msg, hdr); in nl80211_nan_add_func()
14662 return genlmsg_reply(msg, info); in nl80211_nan_add_func()
14665 nlmsg_free(msg); in nl80211_nan_add_func()
14740 struct sk_buff *msg; in cfg80211_nan_match() local
14746 msg = nlmsg_new(NLMSG_DEFAULT_SIZE, gfp); in cfg80211_nan_match()
14747 if (!msg) in cfg80211_nan_match()
14750 hdr = nl80211hdr_put(msg, 0, 0, 0, NL80211_CMD_NAN_MATCH); in cfg80211_nan_match()
14752 nlmsg_free(msg); in cfg80211_nan_match()
14756 if (nla_put_u32(msg, NL80211_ATTR_WIPHY, rdev->wiphy_idx) || in cfg80211_nan_match()
14757 (wdev->netdev && nla_put_u32(msg, NL80211_ATTR_IFINDEX, in cfg80211_nan_match()
14759 nla_put_u64_64bit(msg, NL80211_ATTR_WDEV, wdev_id(wdev), in cfg80211_nan_match()
14763 if (nla_put_u64_64bit(msg, NL80211_ATTR_COOKIE, match->cookie, in cfg80211_nan_match()
14765 nla_put(msg, NL80211_ATTR_MAC, ETH_ALEN, match->addr)) in cfg80211_nan_match()
14768 match_attr = nla_nest_start_noflag(msg, NL80211_ATTR_NAN_MATCH); in cfg80211_nan_match()
14772 local_func_attr = nla_nest_start_noflag(msg, in cfg80211_nan_match()
14777 if (nla_put_u8(msg, NL80211_NAN_FUNC_INSTANCE_ID, match->inst_id)) in cfg80211_nan_match()
14780 nla_nest_end(msg, local_func_attr); in cfg80211_nan_match()
14782 peer_func_attr = nla_nest_start_noflag(msg, in cfg80211_nan_match()
14787 if (nla_put_u8(msg, NL80211_NAN_FUNC_TYPE, match->type) || in cfg80211_nan_match()
14788 nla_put_u8(msg, NL80211_NAN_FUNC_INSTANCE_ID, match->peer_inst_id)) in cfg80211_nan_match()
14792 nla_put(msg, NL80211_NAN_FUNC_SERVICE_INFO, match->info_len, in cfg80211_nan_match()
14796 nla_nest_end(msg, peer_func_attr); in cfg80211_nan_match()
14797 nla_nest_end(msg, match_attr); in cfg80211_nan_match()
14798 genlmsg_end(msg, hdr); in cfg80211_nan_match()
14802 msg, 0, NL80211_MCGRP_NAN, gfp); in cfg80211_nan_match()
14804 genlmsg_unicast(wiphy_net(&rdev->wiphy), msg, in cfg80211_nan_match()
14810 nlmsg_free(msg); in cfg80211_nan_match()
14821 struct sk_buff *msg; in cfg80211_nan_func_terminated() local
14828 msg = nlmsg_new(NLMSG_DEFAULT_SIZE, gfp); in cfg80211_nan_func_terminated()
14829 if (!msg) in cfg80211_nan_func_terminated()
14832 hdr = nl80211hdr_put(msg, 0, 0, 0, NL80211_CMD_DEL_NAN_FUNCTION); in cfg80211_nan_func_terminated()
14834 nlmsg_free(msg); in cfg80211_nan_func_terminated()
14838 if (nla_put_u32(msg, NL80211_ATTR_WIPHY, rdev->wiphy_idx) || in cfg80211_nan_func_terminated()
14839 (wdev->netdev && nla_put_u32(msg, NL80211_ATTR_IFINDEX, in cfg80211_nan_func_terminated()
14841 nla_put_u64_64bit(msg, NL80211_ATTR_WDEV, wdev_id(wdev), in cfg80211_nan_func_terminated()
14845 if (nla_put_u64_64bit(msg, NL80211_ATTR_COOKIE, cookie, in cfg80211_nan_func_terminated()
14849 func_attr = nla_nest_start_noflag(msg, NL80211_ATTR_NAN_FUNC); in cfg80211_nan_func_terminated()
14853 if (nla_put_u8(msg, NL80211_NAN_FUNC_INSTANCE_ID, inst_id) || in cfg80211_nan_func_terminated()
14854 nla_put_u8(msg, NL80211_NAN_FUNC_TERM_REASON, reason)) in cfg80211_nan_func_terminated()
14857 nla_nest_end(msg, func_attr); in cfg80211_nan_func_terminated()
14858 genlmsg_end(msg, hdr); in cfg80211_nan_func_terminated()
14862 msg, 0, NL80211_MCGRP_NAN, gfp); in cfg80211_nan_func_terminated()
14864 genlmsg_unicast(wiphy_net(&rdev->wiphy), msg, in cfg80211_nan_func_terminated()
14870 nlmsg_free(msg); in cfg80211_nan_func_terminated()
14878 struct sk_buff *msg; in nl80211_get_protocol_features() local
14880 msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL); in nl80211_get_protocol_features()
14881 if (!msg) in nl80211_get_protocol_features()
14884 hdr = nl80211hdr_put(msg, info->snd_portid, info->snd_seq, 0, in nl80211_get_protocol_features()
14889 if (nla_put_u32(msg, NL80211_ATTR_PROTOCOL_FEATURES, in nl80211_get_protocol_features()
14893 genlmsg_end(msg, hdr); in nl80211_get_protocol_features()
14894 return genlmsg_reply(msg, info); in nl80211_get_protocol_features()
14897 kfree_skb(msg); in nl80211_get_protocol_features()
15768 struct sk_buff *msg; in nl80211_get_ftm_responder_stats() local
15784 msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL); in nl80211_get_ftm_responder_stats()
15785 if (!msg) in nl80211_get_ftm_responder_stats()
15788 hdr = nl80211hdr_put(msg, info->snd_portid, info->snd_seq, 0, in nl80211_get_ftm_responder_stats()
15793 if (nla_put_u32(msg, NL80211_ATTR_IFINDEX, dev->ifindex)) in nl80211_get_ftm_responder_stats()
15796 ftm_stats_attr = nla_nest_start_noflag(msg, in nl80211_get_ftm_responder_stats()
15803 nla_put_ ## type(msg, NL80211_FTM_STATS_ ## name, \ in nl80211_get_ftm_responder_stats()
15808 nla_put_u64_64bit(msg, NL80211_FTM_STATS_ ## name, \ in nl80211_get_ftm_responder_stats()
15823 nla_nest_end(msg, ftm_stats_attr); in nl80211_get_ftm_responder_stats()
15825 genlmsg_end(msg, hdr); in nl80211_get_ftm_responder_stats()
15826 return genlmsg_reply(msg, info); in nl80211_get_ftm_responder_stats()
15829 nlmsg_free(msg); in nl80211_get_ftm_responder_stats()
17615 struct sk_buff *msg; in nl80211_notify_wiphy() local
17621 msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL); in nl80211_notify_wiphy()
17622 if (!msg) in nl80211_notify_wiphy()
17625 if (nl80211_send_wiphy(rdev, cmd, msg, 0, 0, 0, &state) < 0) { in nl80211_notify_wiphy()
17626 nlmsg_free(msg); in nl80211_notify_wiphy()
17630 genlmsg_multicast_netns(&nl80211_fam, wiphy_net(&rdev->wiphy), msg, 0, in nl80211_notify_wiphy()
17638 struct sk_buff *msg; in nl80211_notify_iface() local
17640 msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL); in nl80211_notify_iface()
17641 if (!msg) in nl80211_notify_iface()
17644 if (nl80211_send_iface(msg, 0, 0, 0, rdev, wdev, cmd) < 0) { in nl80211_notify_iface()
17645 nlmsg_free(msg); in nl80211_notify_iface()
17649 genlmsg_multicast_netns(&nl80211_fam, wiphy_net(&rdev->wiphy), msg, 0, in nl80211_notify_iface()
17653 static int nl80211_add_scan_req(struct sk_buff *msg, in nl80211_add_scan_req() argument
17664 nest = nla_nest_start_noflag(msg, NL80211_ATTR_SCAN_SSIDS); in nl80211_add_scan_req()
17668 if (nla_put(msg, i, req->ssids[i].ssid_len, req->ssids[i].ssid)) in nl80211_add_scan_req()
17671 nla_nest_end(msg, nest); in nl80211_add_scan_req()
17674 nest = nla_nest_start(msg, NL80211_ATTR_SCAN_FREQ_KHZ); in nl80211_add_scan_req()
17678 if (nla_put_u32(msg, i, in nl80211_add_scan_req()
17682 nla_nest_end(msg, nest); in nl80211_add_scan_req()
17684 nest = nla_nest_start_noflag(msg, in nl80211_add_scan_req()
17689 if (nla_put_u32(msg, i, req->channels[i]->center_freq)) in nl80211_add_scan_req()
17692 nla_nest_end(msg, nest); in nl80211_add_scan_req()
17696 nla_put(msg, NL80211_ATTR_IE, req->ie_len, req->ie)) in nl80211_add_scan_req()
17700 nla_put_u32(msg, NL80211_ATTR_SCAN_FLAGS, req->flags)) in nl80211_add_scan_req()
17706 (nla_put_u64_64bit(msg, NL80211_ATTR_SCAN_START_TIME_TSF, in nl80211_add_scan_req()
17708 nla_put(msg, NL80211_ATTR_SCAN_START_TIME_TSF_BSSID, ETH_ALEN, in nl80211_add_scan_req()
17717 static int nl80211_prep_scan_msg(struct sk_buff *msg, in nl80211_prep_scan_msg() argument
17725 hdr = nl80211hdr_put(msg, portid, seq, flags, cmd); in nl80211_prep_scan_msg()
17729 if (nla_put_u32(msg, NL80211_ATTR_WIPHY, rdev->wiphy_idx) || in nl80211_prep_scan_msg()
17730 (wdev->netdev && nla_put_u32(msg, NL80211_ATTR_IFINDEX, in nl80211_prep_scan_msg()
17732 nla_put_u64_64bit(msg, NL80211_ATTR_WDEV, wdev_id(wdev), in nl80211_prep_scan_msg()
17737 nl80211_add_scan_req(msg, rdev); in nl80211_prep_scan_msg()
17739 genlmsg_end(msg, hdr); in nl80211_prep_scan_msg()
17743 genlmsg_cancel(msg, hdr); in nl80211_prep_scan_msg()
17748 nl80211_prep_sched_scan_msg(struct sk_buff *msg, in nl80211_prep_sched_scan_msg() argument
17753 hdr = nl80211hdr_put(msg, 0, 0, 0, cmd); in nl80211_prep_sched_scan_msg()
17757 if (nla_put_u32(msg, NL80211_ATTR_WIPHY, in nl80211_prep_sched_scan_msg()
17759 nla_put_u32(msg, NL80211_ATTR_IFINDEX, req->dev->ifindex) || in nl80211_prep_sched_scan_msg()
17760 nla_put_u64_64bit(msg, NL80211_ATTR_COOKIE, req->reqid, in nl80211_prep_sched_scan_msg()
17764 genlmsg_end(msg, hdr); in nl80211_prep_sched_scan_msg()
17768 genlmsg_cancel(msg, hdr); in nl80211_prep_sched_scan_msg()
17775 struct sk_buff *msg; in nl80211_send_scan_start() local
17777 msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL); in nl80211_send_scan_start()
17778 if (!msg) in nl80211_send_scan_start()
17781 if (nl80211_prep_scan_msg(msg, rdev, wdev, 0, 0, 0, in nl80211_send_scan_start()
17783 nlmsg_free(msg); in nl80211_send_scan_start()
17787 genlmsg_multicast_netns(&nl80211_fam, wiphy_net(&rdev->wiphy), msg, 0, in nl80211_send_scan_start()
17794 struct sk_buff *msg; in nl80211_build_scan_msg() local
17796 msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL); in nl80211_build_scan_msg()
17797 if (!msg) in nl80211_build_scan_msg()
17800 if (nl80211_prep_scan_msg(msg, rdev, wdev, 0, 0, 0, in nl80211_build_scan_msg()
17803 nlmsg_free(msg); in nl80211_build_scan_msg()
17807 return msg; in nl80211_build_scan_msg()
17812 struct sk_buff *msg) in nl80211_send_scan_msg() argument
17814 if (!msg) in nl80211_send_scan_msg()
17817 genlmsg_multicast_netns(&nl80211_fam, wiphy_net(&rdev->wiphy), msg, 0, in nl80211_send_scan_msg()
17823 struct sk_buff *msg; in nl80211_send_sched_scan() local
17825 msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL); in nl80211_send_sched_scan()
17826 if (!msg) in nl80211_send_sched_scan()
17829 if (nl80211_prep_sched_scan_msg(msg, req, cmd) < 0) { in nl80211_send_sched_scan()
17830 nlmsg_free(msg); in nl80211_send_sched_scan()
17834 genlmsg_multicast_netns(&nl80211_fam, wiphy_net(req->wiphy), msg, 0, in nl80211_send_sched_scan()
17838 static bool nl80211_reg_change_event_fill(struct sk_buff *msg, in nl80211_reg_change_event_fill() argument
17842 if (nla_put_u8(msg, NL80211_ATTR_REG_INITIATOR, request->initiator)) in nl80211_reg_change_event_fill()
17846 if (nla_put_u8(msg, NL80211_ATTR_REG_TYPE, in nl80211_reg_change_event_fill()
17850 if (nla_put_u8(msg, NL80211_ATTR_REG_TYPE, in nl80211_reg_change_event_fill()
17855 if (nla_put_u8(msg, NL80211_ATTR_REG_TYPE, in nl80211_reg_change_event_fill()
17859 if (nla_put_u8(msg, NL80211_ATTR_REG_TYPE, in nl80211_reg_change_event_fill()
17861 nla_put_string(msg, NL80211_ATTR_REG_ALPHA2, in nl80211_reg_change_event_fill()
17870 nla_put_u32(msg, NL80211_ATTR_WIPHY, request->wiphy_idx)) in nl80211_reg_change_event_fill()
17875 nla_put_flag(msg, NL80211_ATTR_WIPHY_SELF_MANAGED_REG)) in nl80211_reg_change_event_fill()
17892 struct sk_buff *msg; in nl80211_common_reg_change_event() local
17895 msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL); in nl80211_common_reg_change_event()
17896 if (!msg) in nl80211_common_reg_change_event()
17899 hdr = nl80211hdr_put(msg, 0, 0, 0, cmd_id); in nl80211_common_reg_change_event()
17903 if (!nl80211_reg_change_event_fill(msg, request)) in nl80211_common_reg_change_event()
17906 genlmsg_end(msg, hdr); in nl80211_common_reg_change_event()
17909 genlmsg_multicast_allns(&nl80211_fam, msg, 0, in nl80211_common_reg_change_event()
17916 nlmsg_free(msg); in nl80211_common_reg_change_event()
17926 struct sk_buff *msg; in nl80211_send_mlme_event() local
17929 msg = nlmsg_new(100 + len + req_ies_len, gfp); in nl80211_send_mlme_event()
17930 if (!msg) in nl80211_send_mlme_event()
17933 hdr = nl80211hdr_put(msg, 0, 0, 0, cmd); in nl80211_send_mlme_event()
17935 nlmsg_free(msg); in nl80211_send_mlme_event()
17939 if (nla_put_u32(msg, NL80211_ATTR_WIPHY, rdev->wiphy_idx) || in nl80211_send_mlme_event()
17940 nla_put_u32(msg, NL80211_ATTR_IFINDEX, netdev->ifindex) || in nl80211_send_mlme_event()
17941 nla_put(msg, NL80211_ATTR_FRAME, len, buf) || in nl80211_send_mlme_event()
17943 nla_put(msg, NL80211_ATTR_REQ_IE, req_ies_len, req_ies))) in nl80211_send_mlme_event()
17946 if (reconnect && nla_put_flag(msg, NL80211_ATTR_RECONNECT_REQUESTED)) in nl80211_send_mlme_event()
17951 nla_nest_start_noflag(msg, NL80211_ATTR_STA_WME); in nl80211_send_mlme_event()
17955 if (nla_put_u8(msg, NL80211_STA_WME_UAPSD_QUEUES, in nl80211_send_mlme_event()
17959 nla_nest_end(msg, nla_wmm); in nl80211_send_mlme_event()
17962 genlmsg_end(msg, hdr); in nl80211_send_mlme_event()
17964 genlmsg_multicast_netns(&nl80211_fam, wiphy_net(&rdev->wiphy), msg, 0, in nl80211_send_mlme_event()
17969 nlmsg_free(msg); in nl80211_send_mlme_event()
18045 struct sk_buff *msg; in nl80211_send_mlme_timeout() local
18048 msg = nlmsg_new(NLMSG_DEFAULT_SIZE, gfp); in nl80211_send_mlme_timeout()
18049 if (!msg) in nl80211_send_mlme_timeout()
18052 hdr = nl80211hdr_put(msg, 0, 0, 0, cmd); in nl80211_send_mlme_timeout()
18054 nlmsg_free(msg); in nl80211_send_mlme_timeout()
18058 if (nla_put_u32(msg, NL80211_ATTR_WIPHY, rdev->wiphy_idx) || in nl80211_send_mlme_timeout()
18059 nla_put_u32(msg, NL80211_ATTR_IFINDEX, netdev->ifindex) || in nl80211_send_mlme_timeout()
18060 nla_put_flag(msg, NL80211_ATTR_TIMED_OUT) || in nl80211_send_mlme_timeout()
18061 nla_put(msg, NL80211_ATTR_MAC, ETH_ALEN, addr)) in nl80211_send_mlme_timeout()
18064 genlmsg_end(msg, hdr); in nl80211_send_mlme_timeout()
18066 genlmsg_multicast_netns(&nl80211_fam, wiphy_net(&rdev->wiphy), msg, 0, in nl80211_send_mlme_timeout()
18071 nlmsg_free(msg); in nl80211_send_mlme_timeout()
18095 struct sk_buff *msg; in nl80211_send_connect_result() local
18117 msg = nlmsg_new(100 + cr->req_ie_len + cr->resp_ie_len + in nl80211_send_connect_result()
18121 if (!msg) in nl80211_send_connect_result()
18124 hdr = nl80211hdr_put(msg, 0, 0, 0, NL80211_CMD_CONNECT); in nl80211_send_connect_result()
18126 nlmsg_free(msg); in nl80211_send_connect_result()
18130 if (nla_put_u32(msg, NL80211_ATTR_WIPHY, rdev->wiphy_idx) || in nl80211_send_connect_result()
18131 nla_put_u32(msg, NL80211_ATTR_IFINDEX, netdev->ifindex) || in nl80211_send_connect_result()
18133 nla_put(msg, NL80211_ATTR_MAC, ETH_ALEN, connected_addr)) || in nl80211_send_connect_result()
18134 nla_put_u16(msg, NL80211_ATTR_STATUS_CODE, in nl80211_send_connect_result()
18138 (nla_put_flag(msg, NL80211_ATTR_TIMED_OUT) || in nl80211_send_connect_result()
18139 nla_put_u32(msg, NL80211_ATTR_TIMEOUT_REASON, in nl80211_send_connect_result()
18142 nla_put(msg, NL80211_ATTR_REQ_IE, cr->req_ie_len, cr->req_ie)) || in nl80211_send_connect_result()
18144 nla_put(msg, NL80211_ATTR_RESP_IE, cr->resp_ie_len, in nl80211_send_connect_result()
18147 nla_put_u16(msg, NL80211_ATTR_FILS_ERP_NEXT_SEQ_NUM, in nl80211_send_connect_result()
18151 nla_put(msg, NL80211_ATTR_FILS_KEK, cr->fils.kek_len, in nl80211_send_connect_result()
18154 nla_put(msg, NL80211_ATTR_PMK, cr->fils.pmk_len, cr->fils.pmk)) || in nl80211_send_connect_result()
18156 nla_put(msg, NL80211_ATTR_PMKID, WLAN_PMKID_LEN, cr->fils.pmkid))))) in nl80211_send_connect_result()
18163 nested = nla_nest_start(msg, NL80211_ATTR_MLO_LINKS); in nl80211_send_connect_result()
18173 nested_mlo_links = nla_nest_start(msg, i); in nl80211_send_connect_result()
18177 if (nla_put_u8(msg, NL80211_ATTR_MLO_LINK_ID, link) || in nl80211_send_connect_result()
18179 nla_put(msg, NL80211_ATTR_BSSID, ETH_ALEN, bssid)) || in nl80211_send_connect_result()
18181 nla_put(msg, NL80211_ATTR_MAC, ETH_ALEN, in nl80211_send_connect_result()
18183 nla_put_u16(msg, NL80211_ATTR_STATUS_CODE, in nl80211_send_connect_result()
18187 nla_nest_end(msg, nested_mlo_links); in nl80211_send_connect_result()
18190 nla_nest_end(msg, nested); in nl80211_send_connect_result()
18193 genlmsg_end(msg, hdr); in nl80211_send_connect_result()
18195 genlmsg_multicast_netns(&nl80211_fam, wiphy_net(&rdev->wiphy), msg, 0, in nl80211_send_connect_result()
18200 nlmsg_free(msg); in nl80211_send_connect_result()
18207 struct sk_buff *msg; in nl80211_send_roamed() local
18231 msg = nlmsg_new(100 + info->req_ie_len + info->resp_ie_len + in nl80211_send_roamed()
18235 if (!msg) in nl80211_send_roamed()
18238 hdr = nl80211hdr_put(msg, 0, 0, 0, NL80211_CMD_ROAM); in nl80211_send_roamed()
18240 nlmsg_free(msg); in nl80211_send_roamed()
18244 if (nla_put_u32(msg, NL80211_ATTR_WIPHY, rdev->wiphy_idx) || in nl80211_send_roamed()
18245 nla_put_u32(msg, NL80211_ATTR_IFINDEX, netdev->ifindex) || in nl80211_send_roamed()
18246 nla_put(msg, NL80211_ATTR_MAC, ETH_ALEN, connected_addr) || in nl80211_send_roamed()
18248 nla_put(msg, NL80211_ATTR_REQ_IE, info->req_ie_len, in nl80211_send_roamed()
18251 nla_put(msg, NL80211_ATTR_RESP_IE, info->resp_ie_len, in nl80211_send_roamed()
18254 nla_put_u16(msg, NL80211_ATTR_FILS_ERP_NEXT_SEQ_NUM, in nl80211_send_roamed()
18257 nla_put(msg, NL80211_ATTR_FILS_KEK, info->fils.kek_len, in nl80211_send_roamed()
18260 nla_put(msg, NL80211_ATTR_PMK, info->fils.pmk_len, info->fils.pmk)) || in nl80211_send_roamed()
18262 nla_put(msg, NL80211_ATTR_PMKID, WLAN_PMKID_LEN, info->fils.pmkid))) in nl80211_send_roamed()
18269 nested = nla_nest_start(msg, NL80211_ATTR_MLO_LINKS); in nl80211_send_roamed()
18279 nested_mlo_links = nla_nest_start(msg, i); in nl80211_send_roamed()
18283 if (nla_put_u8(msg, NL80211_ATTR_MLO_LINK_ID, link) || in nl80211_send_roamed()
18285 nla_put(msg, NL80211_ATTR_BSSID, ETH_ALEN, bssid)) || in nl80211_send_roamed()
18287 nla_put(msg, NL80211_ATTR_MAC, ETH_ALEN, in nl80211_send_roamed()
18291 nla_nest_end(msg, nested_mlo_links); in nl80211_send_roamed()
18294 nla_nest_end(msg, nested); in nl80211_send_roamed()
18297 genlmsg_end(msg, hdr); in nl80211_send_roamed()
18299 genlmsg_multicast_netns(&nl80211_fam, wiphy_net(&rdev->wiphy), msg, 0, in nl80211_send_roamed()
18304 nlmsg_free(msg); in nl80211_send_roamed()
18311 struct sk_buff *msg; in nl80211_send_port_authorized() local
18314 msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL); in nl80211_send_port_authorized()
18315 if (!msg) in nl80211_send_port_authorized()
18318 hdr = nl80211hdr_put(msg, 0, 0, 0, NL80211_CMD_PORT_AUTHORIZED); in nl80211_send_port_authorized()
18320 nlmsg_free(msg); in nl80211_send_port_authorized()
18324 if (nla_put_u32(msg, NL80211_ATTR_WIPHY, rdev->wiphy_idx) || in nl80211_send_port_authorized()
18325 nla_put_u32(msg, NL80211_ATTR_IFINDEX, netdev->ifindex) || in nl80211_send_port_authorized()
18326 nla_put(msg, NL80211_ATTR_MAC, ETH_ALEN, bssid)) in nl80211_send_port_authorized()
18330 if (nla_put(msg, NL80211_ATTR_TD_BITMAP, in nl80211_send_port_authorized()
18334 genlmsg_end(msg, hdr); in nl80211_send_port_authorized()
18336 genlmsg_multicast_netns(&nl80211_fam, wiphy_net(&rdev->wiphy), msg, 0, in nl80211_send_port_authorized()
18341 nlmsg_free(msg); in nl80211_send_port_authorized()
18348 struct sk_buff *msg; in nl80211_send_disconnected() local
18351 msg = nlmsg_new(100 + ie_len, GFP_KERNEL); in nl80211_send_disconnected()
18352 if (!msg) in nl80211_send_disconnected()
18355 hdr = nl80211hdr_put(msg, 0, 0, 0, NL80211_CMD_DISCONNECT); in nl80211_send_disconnected()
18357 nlmsg_free(msg); in nl80211_send_disconnected()
18361 if (nla_put_u32(msg, NL80211_ATTR_WIPHY, rdev->wiphy_idx) || in nl80211_send_disconnected()
18362 nla_put_u32(msg, NL80211_ATTR_IFINDEX, netdev->ifindex) || in nl80211_send_disconnected()
18364 nla_put_u16(msg, NL80211_ATTR_REASON_CODE, reason)) || in nl80211_send_disconnected()
18366 nla_put_flag(msg, NL80211_ATTR_DISCONNECTED_BY_AP)) || in nl80211_send_disconnected()
18367 (ie && nla_put(msg, NL80211_ATTR_IE, ie_len, ie))) in nl80211_send_disconnected()
18370 genlmsg_end(msg, hdr); in nl80211_send_disconnected()
18372 genlmsg_multicast_netns(&nl80211_fam, wiphy_net(&rdev->wiphy), msg, 0, in nl80211_send_disconnected()
18377 nlmsg_free(msg); in nl80211_send_disconnected()
18385 struct sk_buff *msg; in cfg80211_links_removed() local
18404 msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL); in cfg80211_links_removed()
18405 if (!msg) in cfg80211_links_removed()
18408 hdr = nl80211hdr_put(msg, 0, 0, 0, NL80211_CMD_LINKS_REMOVED); in cfg80211_links_removed()
18410 nlmsg_free(msg); in cfg80211_links_removed()
18414 if (nla_put_u32(msg, NL80211_ATTR_WIPHY, rdev->wiphy_idx) || in cfg80211_links_removed()
18415 nla_put_u32(msg, NL80211_ATTR_IFINDEX, dev->ifindex)) in cfg80211_links_removed()
18418 links = nla_nest_start(msg, NL80211_ATTR_MLO_LINKS); in cfg80211_links_removed()
18426 link = nla_nest_start(msg, link_id + 1); in cfg80211_links_removed()
18430 if (nla_put_u8(msg, NL80211_ATTR_MLO_LINK_ID, link_id)) in cfg80211_links_removed()
18433 nla_nest_end(msg, link); in cfg80211_links_removed()
18437 nla_nest_end(msg, links); in cfg80211_links_removed()
18439 genlmsg_end(msg, hdr); in cfg80211_links_removed()
18441 genlmsg_multicast_netns(&nl80211_fam, wiphy_net(&rdev->wiphy), msg, 0, in cfg80211_links_removed()
18446 nlmsg_free(msg); in cfg80211_links_removed()
18454 struct sk_buff *msg; in nl80211_send_ibss_bssid() local
18457 msg = nlmsg_new(NLMSG_DEFAULT_SIZE, gfp); in nl80211_send_ibss_bssid()
18458 if (!msg) in nl80211_send_ibss_bssid()
18461 hdr = nl80211hdr_put(msg, 0, 0, 0, NL80211_CMD_JOIN_IBSS); in nl80211_send_ibss_bssid()
18463 nlmsg_free(msg); in nl80211_send_ibss_bssid()
18467 if (nla_put_u32(msg, NL80211_ATTR_WIPHY, rdev->wiphy_idx) || in nl80211_send_ibss_bssid()
18468 nla_put_u32(msg, NL80211_ATTR_IFINDEX, netdev->ifindex) || in nl80211_send_ibss_bssid()
18469 nla_put(msg, NL80211_ATTR_MAC, ETH_ALEN, bssid)) in nl80211_send_ibss_bssid()
18472 genlmsg_end(msg, hdr); in nl80211_send_ibss_bssid()
18474 genlmsg_multicast_netns(&nl80211_fam, wiphy_net(&rdev->wiphy), msg, 0, in nl80211_send_ibss_bssid()
18479 nlmsg_free(msg); in nl80211_send_ibss_bssid()
18488 struct sk_buff *msg; in cfg80211_notify_new_peer_candidate() local
18496 msg = nlmsg_new(100 + ie_len, gfp); in cfg80211_notify_new_peer_candidate()
18497 if (!msg) in cfg80211_notify_new_peer_candidate()
18500 hdr = nl80211hdr_put(msg, 0, 0, 0, NL80211_CMD_NEW_PEER_CANDIDATE); in cfg80211_notify_new_peer_candidate()
18502 nlmsg_free(msg); in cfg80211_notify_new_peer_candidate()
18506 if (nla_put_u32(msg, NL80211_ATTR_WIPHY, rdev->wiphy_idx) || in cfg80211_notify_new_peer_candidate()
18507 nla_put_u32(msg, NL80211_ATTR_IFINDEX, dev->ifindex) || in cfg80211_notify_new_peer_candidate()
18508 nla_put(msg, NL80211_ATTR_MAC, ETH_ALEN, addr) || in cfg80211_notify_new_peer_candidate()
18510 nla_put(msg, NL80211_ATTR_IE, ie_len, ie)) || in cfg80211_notify_new_peer_candidate()
18512 nla_put_u32(msg, NL80211_ATTR_RX_SIGNAL_DBM, sig_dbm))) in cfg80211_notify_new_peer_candidate()
18515 genlmsg_end(msg, hdr); in cfg80211_notify_new_peer_candidate()
18517 genlmsg_multicast_netns(&nl80211_fam, wiphy_net(&rdev->wiphy), msg, 0, in cfg80211_notify_new_peer_candidate()
18522 nlmsg_free(msg); in cfg80211_notify_new_peer_candidate()
18531 struct sk_buff *msg; in nl80211_michael_mic_failure() local
18534 msg = nlmsg_new(NLMSG_DEFAULT_SIZE, gfp); in nl80211_michael_mic_failure()
18535 if (!msg) in nl80211_michael_mic_failure()
18538 hdr = nl80211hdr_put(msg, 0, 0, 0, NL80211_CMD_MICHAEL_MIC_FAILURE); in nl80211_michael_mic_failure()
18540 nlmsg_free(msg); in nl80211_michael_mic_failure()
18544 if (nla_put_u32(msg, NL80211_ATTR_WIPHY, rdev->wiphy_idx) || in nl80211_michael_mic_failure()
18545 nla_put_u32(msg, NL80211_ATTR_IFINDEX, netdev->ifindex) || in nl80211_michael_mic_failure()
18546 (addr && nla_put(msg, NL80211_ATTR_MAC, ETH_ALEN, addr)) || in nl80211_michael_mic_failure()
18547 nla_put_u32(msg, NL80211_ATTR_KEY_TYPE, key_type) || in nl80211_michael_mic_failure()
18549 nla_put_u8(msg, NL80211_ATTR_KEY_IDX, key_id)) || in nl80211_michael_mic_failure()
18550 (tsc && nla_put(msg, NL80211_ATTR_KEY_SEQ, 6, tsc))) in nl80211_michael_mic_failure()
18553 genlmsg_end(msg, hdr); in nl80211_michael_mic_failure()
18555 genlmsg_multicast_netns(&nl80211_fam, wiphy_net(&rdev->wiphy), msg, 0, in nl80211_michael_mic_failure()
18560 nlmsg_free(msg); in nl80211_michael_mic_failure()
18567 struct sk_buff *msg; in nl80211_send_beacon_hint_event() local
18571 msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_ATOMIC); in nl80211_send_beacon_hint_event()
18572 if (!msg) in nl80211_send_beacon_hint_event()
18575 hdr = nl80211hdr_put(msg, 0, 0, 0, NL80211_CMD_REG_BEACON_HINT); in nl80211_send_beacon_hint_event()
18577 nlmsg_free(msg); in nl80211_send_beacon_hint_event()
18585 if (nla_put_u32(msg, NL80211_ATTR_WIPHY, get_wiphy_idx(wiphy))) in nl80211_send_beacon_hint_event()
18589 nl_freq = nla_nest_start_noflag(msg, NL80211_ATTR_FREQ_BEFORE); in nl80211_send_beacon_hint_event()
18593 if (nl80211_msg_put_channel(msg, wiphy, channel_before, false)) in nl80211_send_beacon_hint_event()
18595 nla_nest_end(msg, nl_freq); in nl80211_send_beacon_hint_event()
18598 nl_freq = nla_nest_start_noflag(msg, NL80211_ATTR_FREQ_AFTER); in nl80211_send_beacon_hint_event()
18602 if (nl80211_msg_put_channel(msg, wiphy, channel_after, false)) in nl80211_send_beacon_hint_event()
18604 nla_nest_end(msg, nl_freq); in nl80211_send_beacon_hint_event()
18606 genlmsg_end(msg, hdr); in nl80211_send_beacon_hint_event()
18609 genlmsg_multicast_allns(&nl80211_fam, msg, 0, in nl80211_send_beacon_hint_event()
18616 nlmsg_free(msg); in nl80211_send_beacon_hint_event()
18625 struct sk_buff *msg; in nl80211_send_remain_on_chan_event() local
18628 msg = nlmsg_new(NLMSG_DEFAULT_SIZE, gfp); in nl80211_send_remain_on_chan_event()
18629 if (!msg) in nl80211_send_remain_on_chan_event()
18632 hdr = nl80211hdr_put(msg, 0, 0, 0, cmd); in nl80211_send_remain_on_chan_event()
18634 nlmsg_free(msg); in nl80211_send_remain_on_chan_event()
18638 if (nla_put_u32(msg, NL80211_ATTR_WIPHY, rdev->wiphy_idx) || in nl80211_send_remain_on_chan_event()
18639 (wdev->netdev && nla_put_u32(msg, NL80211_ATTR_IFINDEX, in nl80211_send_remain_on_chan_event()
18641 nla_put_u64_64bit(msg, NL80211_ATTR_WDEV, wdev_id(wdev), in nl80211_send_remain_on_chan_event()
18643 nla_put_u32(msg, NL80211_ATTR_WIPHY_FREQ, chan->center_freq) || in nl80211_send_remain_on_chan_event()
18644 nla_put_u32(msg, NL80211_ATTR_WIPHY_CHANNEL_TYPE, in nl80211_send_remain_on_chan_event()
18646 nla_put_u64_64bit(msg, NL80211_ATTR_COOKIE, cookie, in nl80211_send_remain_on_chan_event()
18651 nla_put_u32(msg, NL80211_ATTR_DURATION, duration)) in nl80211_send_remain_on_chan_event()
18654 genlmsg_end(msg, hdr); in nl80211_send_remain_on_chan_event()
18656 genlmsg_multicast_netns(&nl80211_fam, wiphy_net(&rdev->wiphy), msg, 0, in nl80211_send_remain_on_chan_event()
18661 nlmsg_free(msg); in nl80211_send_remain_on_chan_event()
18670 struct sk_buff *msg; in cfg80211_assoc_comeback() local
18675 msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL); in cfg80211_assoc_comeback()
18676 if (!msg) in cfg80211_assoc_comeback()
18679 hdr = nl80211hdr_put(msg, 0, 0, 0, NL80211_CMD_ASSOC_COMEBACK); in cfg80211_assoc_comeback()
18681 nlmsg_free(msg); in cfg80211_assoc_comeback()
18685 if (nla_put_u32(msg, NL80211_ATTR_WIPHY, rdev->wiphy_idx) || in cfg80211_assoc_comeback()
18686 nla_put_u32(msg, NL80211_ATTR_IFINDEX, netdev->ifindex) || in cfg80211_assoc_comeback()
18687 nla_put(msg, NL80211_ATTR_MAC, ETH_ALEN, ap_addr) || in cfg80211_assoc_comeback()
18688 nla_put_u32(msg, NL80211_ATTR_TIMEOUT, timeout)) in cfg80211_assoc_comeback()
18691 genlmsg_end(msg, hdr); in cfg80211_assoc_comeback()
18693 genlmsg_multicast_netns(&nl80211_fam, wiphy_net(&rdev->wiphy), msg, 0, in cfg80211_assoc_comeback()
18698 nlmsg_free(msg); in cfg80211_assoc_comeback()
18747 struct sk_buff *msg; in cfg80211_new_sta() local
18751 msg = nlmsg_new(NLMSG_DEFAULT_SIZE, gfp); in cfg80211_new_sta()
18752 if (!msg) in cfg80211_new_sta()
18755 if (nl80211_send_station(msg, NL80211_CMD_NEW_STATION, 0, 0, 0, in cfg80211_new_sta()
18757 nlmsg_free(msg); in cfg80211_new_sta()
18761 genlmsg_multicast_netns(&nl80211_fam, wiphy_net(&rdev->wiphy), msg, 0, in cfg80211_new_sta()
18771 struct sk_buff *msg; in cfg80211_del_sta_sinfo() local
18779 msg = nlmsg_new(NLMSG_DEFAULT_SIZE, gfp); in cfg80211_del_sta_sinfo()
18780 if (!msg) { in cfg80211_del_sta_sinfo()
18785 if (nl80211_send_station(msg, NL80211_CMD_DEL_STATION, 0, 0, 0, in cfg80211_del_sta_sinfo()
18787 nlmsg_free(msg); in cfg80211_del_sta_sinfo()
18791 genlmsg_multicast_netns(&nl80211_fam, wiphy_net(&rdev->wiphy), msg, 0, in cfg80211_del_sta_sinfo()
18802 struct sk_buff *msg; in cfg80211_conn_failed() local
18805 msg = nlmsg_new(NLMSG_GOODSIZE, gfp); in cfg80211_conn_failed()
18806 if (!msg) in cfg80211_conn_failed()
18809 hdr = nl80211hdr_put(msg, 0, 0, 0, NL80211_CMD_CONN_FAILED); in cfg80211_conn_failed()
18811 nlmsg_free(msg); in cfg80211_conn_failed()
18815 if (nla_put_u32(msg, NL80211_ATTR_IFINDEX, dev->ifindex) || in cfg80211_conn_failed()
18816 nla_put(msg, NL80211_ATTR_MAC, ETH_ALEN, mac_addr) || in cfg80211_conn_failed()
18817 nla_put_u32(msg, NL80211_ATTR_CONN_FAILED_REASON, reason)) in cfg80211_conn_failed()
18820 genlmsg_end(msg, hdr); in cfg80211_conn_failed()
18822 genlmsg_multicast_netns(&nl80211_fam, wiphy_net(&rdev->wiphy), msg, 0, in cfg80211_conn_failed()
18827 nlmsg_free(msg); in cfg80211_conn_failed()
18836 struct sk_buff *msg; in __nl80211_unexpected_frame() local
18843 msg = nlmsg_new(100, gfp); in __nl80211_unexpected_frame()
18844 if (!msg) in __nl80211_unexpected_frame()
18847 hdr = nl80211hdr_put(msg, 0, 0, 0, cmd); in __nl80211_unexpected_frame()
18849 nlmsg_free(msg); in __nl80211_unexpected_frame()
18853 if (nla_put_u32(msg, NL80211_ATTR_WIPHY, rdev->wiphy_idx) || in __nl80211_unexpected_frame()
18854 nla_put_u32(msg, NL80211_ATTR_IFINDEX, dev->ifindex) || in __nl80211_unexpected_frame()
18855 nla_put(msg, NL80211_ATTR_MAC, ETH_ALEN, addr)) in __nl80211_unexpected_frame()
18858 genlmsg_end(msg, hdr); in __nl80211_unexpected_frame()
18859 genlmsg_unicast(wiphy_net(&rdev->wiphy), msg, nlportid); in __nl80211_unexpected_frame()
18863 nlmsg_free(msg); in __nl80211_unexpected_frame()
18914 struct sk_buff *msg; in nl80211_send_mgmt() local
18917 msg = nlmsg_new(100 + info->len, gfp); in nl80211_send_mgmt()
18918 if (!msg) in nl80211_send_mgmt()
18921 hdr = nl80211hdr_put(msg, 0, 0, 0, NL80211_CMD_FRAME); in nl80211_send_mgmt()
18923 nlmsg_free(msg); in nl80211_send_mgmt()
18927 if (nla_put_u32(msg, NL80211_ATTR_WIPHY, rdev->wiphy_idx) || in nl80211_send_mgmt()
18928 (netdev && nla_put_u32(msg, NL80211_ATTR_IFINDEX, in nl80211_send_mgmt()
18930 nla_put_u64_64bit(msg, NL80211_ATTR_WDEV, wdev_id(wdev), in nl80211_send_mgmt()
18933 nla_put_u8(msg, NL80211_ATTR_MLO_LINK_ID, info->link_id)) || in nl80211_send_mgmt()
18934 nla_put_u32(msg, NL80211_ATTR_WIPHY_FREQ, KHZ_TO_MHZ(info->freq)) || in nl80211_send_mgmt()
18935 nla_put_u32(msg, NL80211_ATTR_WIPHY_FREQ_OFFSET, info->freq % 1000) || in nl80211_send_mgmt()
18937 nla_put_u32(msg, NL80211_ATTR_RX_SIGNAL_DBM, info->sig_dbm)) || in nl80211_send_mgmt()
18938 nla_put(msg, NL80211_ATTR_FRAME, info->len, info->buf) || in nl80211_send_mgmt()
18940 nla_put_u32(msg, NL80211_ATTR_RXMGMT_FLAGS, info->flags)) || in nl80211_send_mgmt()
18941 (info->rx_tstamp && nla_put_u64_64bit(msg, in nl80211_send_mgmt()
18945 (info->ack_tstamp && nla_put_u64_64bit(msg, in nl80211_send_mgmt()
18951 genlmsg_end(msg, hdr); in nl80211_send_mgmt()
18953 return genlmsg_unicast(wiphy_net(&rdev->wiphy), msg, nlportid); in nl80211_send_mgmt()
18956 nlmsg_free(msg); in nl80211_send_mgmt()
18967 struct sk_buff *msg; in nl80211_frame_tx_status() local
18977 msg = nlmsg_new(100 + status->len, gfp); in nl80211_frame_tx_status()
18978 if (!msg) in nl80211_frame_tx_status()
18981 hdr = nl80211hdr_put(msg, 0, 0, 0, command); in nl80211_frame_tx_status()
18983 nlmsg_free(msg); in nl80211_frame_tx_status()
18987 if (nla_put_u32(msg, NL80211_ATTR_WIPHY, rdev->wiphy_idx) || in nl80211_frame_tx_status()
18988 (netdev && nla_put_u32(msg, NL80211_ATTR_IFINDEX, in nl80211_frame_tx_status()
18990 nla_put_u64_64bit(msg, NL80211_ATTR_WDEV, wdev_id(wdev), in nl80211_frame_tx_status()
18992 nla_put(msg, NL80211_ATTR_FRAME, status->len, status->buf) || in nl80211_frame_tx_status()
18993 nla_put_u64_64bit(msg, NL80211_ATTR_COOKIE, status->cookie, in nl80211_frame_tx_status()
18995 (status->ack && nla_put_flag(msg, NL80211_ATTR_ACK)) || in nl80211_frame_tx_status()
18997 nla_put_u64_64bit(msg, NL80211_ATTR_TX_HW_TIMESTAMP, in nl80211_frame_tx_status()
19000 nla_put_u64_64bit(msg, NL80211_ATTR_RX_HW_TIMESTAMP, in nl80211_frame_tx_status()
19004 genlmsg_end(msg, hdr); in nl80211_frame_tx_status()
19006 genlmsg_multicast_netns(&nl80211_fam, wiphy_net(&rdev->wiphy), msg, 0, in nl80211_frame_tx_status()
19011 nlmsg_free(msg); in nl80211_frame_tx_status()
19048 struct sk_buff *msg; in __nl80211_rx_control_port() local
19057 msg = nlmsg_new(100 + skb->len, gfp); in __nl80211_rx_control_port()
19058 if (!msg) in __nl80211_rx_control_port()
19061 hdr = nl80211hdr_put(msg, 0, 0, 0, NL80211_CMD_CONTROL_PORT_FRAME); in __nl80211_rx_control_port()
19063 nlmsg_free(msg); in __nl80211_rx_control_port()
19067 if (nla_put_u32(msg, NL80211_ATTR_WIPHY, rdev->wiphy_idx) || in __nl80211_rx_control_port()
19068 nla_put_u32(msg, NL80211_ATTR_IFINDEX, dev->ifindex) || in __nl80211_rx_control_port()
19069 nla_put_u64_64bit(msg, NL80211_ATTR_WDEV, wdev_id(wdev), in __nl80211_rx_control_port()
19071 nla_put(msg, NL80211_ATTR_MAC, ETH_ALEN, addr) || in __nl80211_rx_control_port()
19072 nla_put_u16(msg, NL80211_ATTR_CONTROL_PORT_ETHERTYPE, proto) || in __nl80211_rx_control_port()
19074 nla_put_u8(msg, NL80211_ATTR_MLO_LINK_ID, link_id)) || in __nl80211_rx_control_port()
19075 (unencrypted && nla_put_flag(msg, in __nl80211_rx_control_port()
19079 frame = nla_reserve(msg, NL80211_ATTR_FRAME, skb->len); in __nl80211_rx_control_port()
19084 genlmsg_end(msg, hdr); in __nl80211_rx_control_port()
19086 return genlmsg_unicast(wiphy_net(&rdev->wiphy), msg, nlportid); in __nl80211_rx_control_port()
19089 nlmsg_free(msg); in __nl80211_rx_control_port()
19111 struct sk_buff *msg = nlmsg_new(NLMSG_DEFAULT_SIZE, gfp); in cfg80211_prepare_cqm() local
19114 if (!msg) in cfg80211_prepare_cqm()
19117 cb = (void **)msg->cb; in cfg80211_prepare_cqm()
19119 cb[0] = nl80211hdr_put(msg, 0, 0, 0, NL80211_CMD_NOTIFY_CQM); in cfg80211_prepare_cqm()
19121 nlmsg_free(msg); in cfg80211_prepare_cqm()
19125 if (nla_put_u32(msg, NL80211_ATTR_WIPHY, rdev->wiphy_idx) || in cfg80211_prepare_cqm()
19126 nla_put_u32(msg, NL80211_ATTR_IFINDEX, dev->ifindex)) in cfg80211_prepare_cqm()
19129 if (mac && nla_put(msg, NL80211_ATTR_MAC, ETH_ALEN, mac)) in cfg80211_prepare_cqm()
19132 cb[1] = nla_nest_start_noflag(msg, NL80211_ATTR_CQM); in cfg80211_prepare_cqm()
19138 return msg; in cfg80211_prepare_cqm()
19140 nlmsg_free(msg); in cfg80211_prepare_cqm()
19144 static void cfg80211_send_cqm(struct sk_buff *msg, gfp_t gfp) in cfg80211_send_cqm() argument
19146 void **cb = (void **)msg->cb; in cfg80211_send_cqm()
19149 nla_nest_end(msg, cb[1]); in cfg80211_send_cqm()
19150 genlmsg_end(msg, cb[0]); in cfg80211_send_cqm()
19152 memset(msg->cb, 0, sizeof(msg->cb)); in cfg80211_send_cqm()
19154 genlmsg_multicast_netns(&nl80211_fam, wiphy_net(&rdev->wiphy), msg, 0, in cfg80211_send_cqm()
19189 struct sk_buff *msg; in cfg80211_cqm_rssi_notify_work() local
19204 msg = cfg80211_prepare_cqm(wdev->netdev, NULL, GFP_KERNEL); in cfg80211_cqm_rssi_notify_work()
19205 if (!msg) in cfg80211_cqm_rssi_notify_work()
19208 if (nla_put_u32(msg, NL80211_ATTR_CQM_RSSI_THRESHOLD_EVENT, in cfg80211_cqm_rssi_notify_work()
19212 if (rssi_level && nla_put_s32(msg, NL80211_ATTR_CQM_RSSI_LEVEL, in cfg80211_cqm_rssi_notify_work()
19216 cfg80211_send_cqm(msg, GFP_KERNEL); in cfg80211_cqm_rssi_notify_work()
19221 nlmsg_free(msg); in cfg80211_cqm_rssi_notify_work()
19230 struct sk_buff *msg; in cfg80211_cqm_txe_notify() local
19232 msg = cfg80211_prepare_cqm(dev, peer, gfp); in cfg80211_cqm_txe_notify()
19233 if (!msg) in cfg80211_cqm_txe_notify()
19236 if (nla_put_u32(msg, NL80211_ATTR_CQM_TXE_PKTS, num_packets)) in cfg80211_cqm_txe_notify()
19239 if (nla_put_u32(msg, NL80211_ATTR_CQM_TXE_RATE, rate)) in cfg80211_cqm_txe_notify()
19242 if (nla_put_u32(msg, NL80211_ATTR_CQM_TXE_INTVL, intvl)) in cfg80211_cqm_txe_notify()
19245 cfg80211_send_cqm(msg, gfp); in cfg80211_cqm_txe_notify()
19249 nlmsg_free(msg); in cfg80211_cqm_txe_notify()
19256 struct sk_buff *msg; in cfg80211_cqm_pktloss_notify() local
19260 msg = cfg80211_prepare_cqm(dev, peer, gfp); in cfg80211_cqm_pktloss_notify()
19261 if (!msg) in cfg80211_cqm_pktloss_notify()
19264 if (nla_put_u32(msg, NL80211_ATTR_CQM_PKT_LOSS_EVENT, num_packets)) in cfg80211_cqm_pktloss_notify()
19267 cfg80211_send_cqm(msg, gfp); in cfg80211_cqm_pktloss_notify()
19271 nlmsg_free(msg); in cfg80211_cqm_pktloss_notify()
19277 struct sk_buff *msg; in cfg80211_cqm_beacon_loss_notify() local
19279 msg = cfg80211_prepare_cqm(dev, NULL, gfp); in cfg80211_cqm_beacon_loss_notify()
19280 if (!msg) in cfg80211_cqm_beacon_loss_notify()
19283 if (nla_put_flag(msg, NL80211_ATTR_CQM_BEACON_LOSS_EVENT)) in cfg80211_cqm_beacon_loss_notify()
19286 cfg80211_send_cqm(msg, gfp); in cfg80211_cqm_beacon_loss_notify()
19290 nlmsg_free(msg); in cfg80211_cqm_beacon_loss_notify()
19298 struct sk_buff *msg; in nl80211_gtk_rekey_notify() local
19302 msg = nlmsg_new(NLMSG_DEFAULT_SIZE, gfp); in nl80211_gtk_rekey_notify()
19303 if (!msg) in nl80211_gtk_rekey_notify()
19306 hdr = nl80211hdr_put(msg, 0, 0, 0, NL80211_CMD_SET_REKEY_OFFLOAD); in nl80211_gtk_rekey_notify()
19308 nlmsg_free(msg); in nl80211_gtk_rekey_notify()
19312 if (nla_put_u32(msg, NL80211_ATTR_WIPHY, rdev->wiphy_idx) || in nl80211_gtk_rekey_notify()
19313 nla_put_u32(msg, NL80211_ATTR_IFINDEX, netdev->ifindex) || in nl80211_gtk_rekey_notify()
19314 nla_put(msg, NL80211_ATTR_MAC, ETH_ALEN, bssid)) in nl80211_gtk_rekey_notify()
19317 rekey_attr = nla_nest_start_noflag(msg, NL80211_ATTR_REKEY_DATA); in nl80211_gtk_rekey_notify()
19321 if (nla_put(msg, NL80211_REKEY_DATA_REPLAY_CTR, in nl80211_gtk_rekey_notify()
19325 nla_nest_end(msg, rekey_attr); in nl80211_gtk_rekey_notify()
19327 genlmsg_end(msg, hdr); in nl80211_gtk_rekey_notify()
19329 genlmsg_multicast_netns(&nl80211_fam, wiphy_net(&rdev->wiphy), msg, 0, in nl80211_gtk_rekey_notify()
19334 nlmsg_free(msg); in nl80211_gtk_rekey_notify()
19354 struct sk_buff *msg; in nl80211_pmksa_candidate_notify() local
19358 msg = nlmsg_new(NLMSG_DEFAULT_SIZE, gfp); in nl80211_pmksa_candidate_notify()
19359 if (!msg) in nl80211_pmksa_candidate_notify()
19362 hdr = nl80211hdr_put(msg, 0, 0, 0, NL80211_CMD_PMKSA_CANDIDATE); in nl80211_pmksa_candidate_notify()
19364 nlmsg_free(msg); in nl80211_pmksa_candidate_notify()
19368 if (nla_put_u32(msg, NL80211_ATTR_WIPHY, rdev->wiphy_idx) || in nl80211_pmksa_candidate_notify()
19369 nla_put_u32(msg, NL80211_ATTR_IFINDEX, netdev->ifindex)) in nl80211_pmksa_candidate_notify()
19372 attr = nla_nest_start_noflag(msg, NL80211_ATTR_PMKSA_CANDIDATE); in nl80211_pmksa_candidate_notify()
19376 if (nla_put_u32(msg, NL80211_PMKSA_CANDIDATE_INDEX, index) || in nl80211_pmksa_candidate_notify()
19377 nla_put(msg, NL80211_PMKSA_CANDIDATE_BSSID, ETH_ALEN, bssid) || in nl80211_pmksa_candidate_notify()
19379 nla_put_flag(msg, NL80211_PMKSA_CANDIDATE_PREAUTH))) in nl80211_pmksa_candidate_notify()
19382 nla_nest_end(msg, attr); in nl80211_pmksa_candidate_notify()
19384 genlmsg_end(msg, hdr); in nl80211_pmksa_candidate_notify()
19386 genlmsg_multicast_netns(&nl80211_fam, wiphy_net(&rdev->wiphy), msg, 0, in nl80211_pmksa_candidate_notify()
19391 nlmsg_free(msg); in nl80211_pmksa_candidate_notify()
19415 struct sk_buff *msg; in nl80211_ch_switch_notify() local
19418 msg = nlmsg_new(NLMSG_DEFAULT_SIZE, gfp); in nl80211_ch_switch_notify()
19419 if (!msg) in nl80211_ch_switch_notify()
19422 hdr = nl80211hdr_put(msg, 0, 0, 0, notif); in nl80211_ch_switch_notify()
19424 nlmsg_free(msg); in nl80211_ch_switch_notify()
19428 if (nla_put_u32(msg, NL80211_ATTR_IFINDEX, netdev->ifindex)) in nl80211_ch_switch_notify()
19432 nla_put_u8(msg, NL80211_ATTR_MLO_LINK_ID, link_id)) in nl80211_ch_switch_notify()
19435 if (nl80211_send_chandef(msg, chandef)) in nl80211_ch_switch_notify()
19439 if (nla_put_u32(msg, NL80211_ATTR_CH_SWITCH_COUNT, count)) in nl80211_ch_switch_notify()
19442 nla_put_flag(msg, NL80211_ATTR_CH_SWITCH_BLOCK_TX)) in nl80211_ch_switch_notify()
19446 if (nla_put_u32(msg, NL80211_ATTR_PUNCT_BITMAP, punct_bitmap)) in nl80211_ch_switch_notify()
19449 genlmsg_end(msg, hdr); in nl80211_ch_switch_notify()
19451 genlmsg_multicast_netns(&nl80211_fam, wiphy_net(&rdev->wiphy), msg, 0, in nl80211_ch_switch_notify()
19456 nlmsg_free(msg); in nl80211_ch_switch_notify()
19532 struct sk_buff *msg; in cfg80211_bss_color_notify() local
19539 msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL); in cfg80211_bss_color_notify()
19540 if (!msg) in cfg80211_bss_color_notify()
19543 hdr = nl80211hdr_put(msg, 0, 0, 0, cmd); in cfg80211_bss_color_notify()
19547 if (nla_put_u32(msg, NL80211_ATTR_IFINDEX, dev->ifindex)) in cfg80211_bss_color_notify()
19551 nla_put_u32(msg, NL80211_ATTR_COLOR_CHANGE_COUNT, count)) in cfg80211_bss_color_notify()
19555 nla_put_u64_64bit(msg, NL80211_ATTR_OBSS_COLOR_BITMAP, in cfg80211_bss_color_notify()
19559 genlmsg_end(msg, hdr); in cfg80211_bss_color_notify()
19562 msg, 0, NL80211_MCGRP_MLME, GFP_KERNEL); in cfg80211_bss_color_notify()
19565 nlmsg_free(msg); in cfg80211_bss_color_notify()
19576 struct sk_buff *msg; in nl80211_radar_notify() local
19579 msg = nlmsg_new(NLMSG_DEFAULT_SIZE, gfp); in nl80211_radar_notify()
19580 if (!msg) in nl80211_radar_notify()
19583 hdr = nl80211hdr_put(msg, 0, 0, 0, NL80211_CMD_RADAR_DETECT); in nl80211_radar_notify()
19585 nlmsg_free(msg); in nl80211_radar_notify()
19589 if (nla_put_u32(msg, NL80211_ATTR_WIPHY, rdev->wiphy_idx)) in nl80211_radar_notify()
19596 if (nla_put_u32(msg, NL80211_ATTR_IFINDEX, netdev->ifindex) || in nl80211_radar_notify()
19597 nla_put_u64_64bit(msg, NL80211_ATTR_WDEV, wdev_id(wdev), in nl80211_radar_notify()
19602 if (nla_put_u32(msg, NL80211_ATTR_RADAR_EVENT, event)) in nl80211_radar_notify()
19605 if (nl80211_send_chandef(msg, chandef)) in nl80211_radar_notify()
19608 genlmsg_end(msg, hdr); in nl80211_radar_notify()
19610 genlmsg_multicast_netns(&nl80211_fam, wiphy_net(&rdev->wiphy), msg, 0, in nl80211_radar_notify()
19615 nlmsg_free(msg); in nl80211_radar_notify()
19622 struct sk_buff *msg; in cfg80211_sta_opmode_change_notify() local
19630 msg = nlmsg_new(NLMSG_DEFAULT_SIZE, gfp); in cfg80211_sta_opmode_change_notify()
19631 if (!msg) in cfg80211_sta_opmode_change_notify()
19634 hdr = nl80211hdr_put(msg, 0, 0, 0, NL80211_CMD_STA_OPMODE_CHANGED); in cfg80211_sta_opmode_change_notify()
19636 nlmsg_free(msg); in cfg80211_sta_opmode_change_notify()
19640 if (nla_put_u32(msg, NL80211_ATTR_WIPHY, rdev->wiphy_idx)) in cfg80211_sta_opmode_change_notify()
19643 if (nla_put_u32(msg, NL80211_ATTR_IFINDEX, dev->ifindex)) in cfg80211_sta_opmode_change_notify()
19646 if (nla_put(msg, NL80211_ATTR_MAC, ETH_ALEN, mac)) in cfg80211_sta_opmode_change_notify()
19650 nla_put_u8(msg, NL80211_ATTR_SMPS_MODE, sta_opmode->smps_mode)) in cfg80211_sta_opmode_change_notify()
19654 nla_put_u32(msg, NL80211_ATTR_CHANNEL_WIDTH, sta_opmode->bw)) in cfg80211_sta_opmode_change_notify()
19658 nla_put_u8(msg, NL80211_ATTR_NSS, sta_opmode->rx_nss)) in cfg80211_sta_opmode_change_notify()
19661 genlmsg_end(msg, hdr); in cfg80211_sta_opmode_change_notify()
19663 genlmsg_multicast_netns(&nl80211_fam, wiphy_net(&rdev->wiphy), msg, 0, in cfg80211_sta_opmode_change_notify()
19669 nlmsg_free(msg); in cfg80211_sta_opmode_change_notify()
19679 struct sk_buff *msg; in cfg80211_probe_status() local
19684 msg = nlmsg_new(NLMSG_DEFAULT_SIZE, gfp); in cfg80211_probe_status()
19686 if (!msg) in cfg80211_probe_status()
19689 hdr = nl80211hdr_put(msg, 0, 0, 0, NL80211_CMD_PROBE_CLIENT); in cfg80211_probe_status()
19691 nlmsg_free(msg); in cfg80211_probe_status()
19695 if (nla_put_u32(msg, NL80211_ATTR_WIPHY, rdev->wiphy_idx) || in cfg80211_probe_status()
19696 nla_put_u32(msg, NL80211_ATTR_IFINDEX, dev->ifindex) || in cfg80211_probe_status()
19697 nla_put(msg, NL80211_ATTR_MAC, ETH_ALEN, addr) || in cfg80211_probe_status()
19698 nla_put_u64_64bit(msg, NL80211_ATTR_COOKIE, cookie, in cfg80211_probe_status()
19700 (acked && nla_put_flag(msg, NL80211_ATTR_ACK)) || in cfg80211_probe_status()
19701 (is_valid_ack_signal && nla_put_s32(msg, NL80211_ATTR_ACK_SIGNAL, in cfg80211_probe_status()
19705 genlmsg_end(msg, hdr); in cfg80211_probe_status()
19707 genlmsg_multicast_netns(&nl80211_fam, wiphy_net(&rdev->wiphy), msg, 0, in cfg80211_probe_status()
19712 nlmsg_free(msg); in cfg80211_probe_status()
19720 struct sk_buff *msg; in cfg80211_report_obss_beacon_khz() local
19728 msg = nlmsg_new(len + 100, GFP_ATOMIC); in cfg80211_report_obss_beacon_khz()
19729 if (!msg) { in cfg80211_report_obss_beacon_khz()
19734 hdr = nl80211hdr_put(msg, 0, 0, 0, NL80211_CMD_FRAME); in cfg80211_report_obss_beacon_khz()
19738 if (nla_put_u32(msg, NL80211_ATTR_WIPHY, rdev->wiphy_idx) || in cfg80211_report_obss_beacon_khz()
19740 (nla_put_u32(msg, NL80211_ATTR_WIPHY_FREQ, in cfg80211_report_obss_beacon_khz()
19742 nla_put_u32(msg, NL80211_ATTR_WIPHY_FREQ_OFFSET, in cfg80211_report_obss_beacon_khz()
19745 nla_put_u32(msg, NL80211_ATTR_RX_SIGNAL_DBM, sig_dbm)) || in cfg80211_report_obss_beacon_khz()
19746 nla_put(msg, NL80211_ATTR_FRAME, len, frame)) in cfg80211_report_obss_beacon_khz()
19749 genlmsg_end(msg, hdr); in cfg80211_report_obss_beacon_khz()
19751 genlmsg_unicast(wiphy_net(&rdev->wiphy), msg, reg->nlportid); in cfg80211_report_obss_beacon_khz()
19758 nlmsg_free(msg); in cfg80211_report_obss_beacon_khz()
19763 static int cfg80211_net_detect_results(struct sk_buff *msg, in cfg80211_net_detect_results() argument
19770 nl_results = nla_nest_start_noflag(msg, in cfg80211_net_detect_results()
19778 nl_match = nla_nest_start_noflag(msg, i); in cfg80211_net_detect_results()
19789 if (nla_put(msg, NL80211_ATTR_SSID, match->ssid.ssid_len, in cfg80211_net_detect_results()
19791 nla_nest_cancel(msg, nl_match); in cfg80211_net_detect_results()
19796 nl_freqs = nla_nest_start_noflag(msg, in cfg80211_net_detect_results()
19799 nla_nest_cancel(msg, nl_match); in cfg80211_net_detect_results()
19804 if (nla_put_u32(msg, j, match->channels[j])) { in cfg80211_net_detect_results()
19805 nla_nest_cancel(msg, nl_freqs); in cfg80211_net_detect_results()
19806 nla_nest_cancel(msg, nl_match); in cfg80211_net_detect_results()
19811 nla_nest_end(msg, nl_freqs); in cfg80211_net_detect_results()
19814 nla_nest_end(msg, nl_match); in cfg80211_net_detect_results()
19818 nla_nest_end(msg, nl_results); in cfg80211_net_detect_results()
19827 struct sk_buff *msg; in cfg80211_report_wowlan_wakeup() local
19836 msg = nlmsg_new(size, gfp); in cfg80211_report_wowlan_wakeup()
19837 if (!msg) in cfg80211_report_wowlan_wakeup()
19840 hdr = nl80211hdr_put(msg, 0, 0, 0, NL80211_CMD_SET_WOWLAN); in cfg80211_report_wowlan_wakeup()
19844 if (nla_put_u32(msg, NL80211_ATTR_WIPHY, rdev->wiphy_idx) || in cfg80211_report_wowlan_wakeup()
19845 nla_put_u64_64bit(msg, NL80211_ATTR_WDEV, wdev_id(wdev), in cfg80211_report_wowlan_wakeup()
19849 if (wdev->netdev && nla_put_u32(msg, NL80211_ATTR_IFINDEX, in cfg80211_report_wowlan_wakeup()
19856 reasons = nla_nest_start_noflag(msg, in cfg80211_report_wowlan_wakeup()
19862 nla_put_flag(msg, NL80211_WOWLAN_TRIG_DISCONNECT)) in cfg80211_report_wowlan_wakeup()
19865 nla_put_flag(msg, NL80211_WOWLAN_TRIG_MAGIC_PKT)) in cfg80211_report_wowlan_wakeup()
19868 nla_put_flag(msg, NL80211_WOWLAN_TRIG_GTK_REKEY_FAILURE)) in cfg80211_report_wowlan_wakeup()
19871 nla_put_flag(msg, NL80211_WOWLAN_TRIG_EAP_IDENT_REQUEST)) in cfg80211_report_wowlan_wakeup()
19874 nla_put_flag(msg, NL80211_WOWLAN_TRIG_4WAY_HANDSHAKE)) in cfg80211_report_wowlan_wakeup()
19877 nla_put_flag(msg, NL80211_WOWLAN_TRIG_RFKILL_RELEASE)) in cfg80211_report_wowlan_wakeup()
19881 nla_put_u32(msg, NL80211_WOWLAN_TRIG_PKT_PATTERN, in cfg80211_report_wowlan_wakeup()
19886 nla_put_flag(msg, NL80211_WOWLAN_TRIG_WAKEUP_TCP_MATCH)) in cfg80211_report_wowlan_wakeup()
19890 nla_put_flag(msg, NL80211_WOWLAN_TRIG_WAKEUP_TCP_CONNLOST)) in cfg80211_report_wowlan_wakeup()
19894 nla_put_flag(msg, in cfg80211_report_wowlan_wakeup()
19910 nla_put_u32(msg, len_attr, wakeup->packet_len)) in cfg80211_report_wowlan_wakeup()
19913 if (nla_put(msg, pkt_attr, wakeup->packet_present_len, in cfg80211_report_wowlan_wakeup()
19919 cfg80211_net_detect_results(msg, wakeup)) in cfg80211_report_wowlan_wakeup()
19922 nla_nest_end(msg, reasons); in cfg80211_report_wowlan_wakeup()
19925 genlmsg_end(msg, hdr); in cfg80211_report_wowlan_wakeup()
19927 genlmsg_multicast_netns(&nl80211_fam, wiphy_net(&rdev->wiphy), msg, 0, in cfg80211_report_wowlan_wakeup()
19932 nlmsg_free(msg); in cfg80211_report_wowlan_wakeup()
19943 struct sk_buff *msg; in cfg80211_tdls_oper_request() local
19949 msg = nlmsg_new(NLMSG_DEFAULT_SIZE, gfp); in cfg80211_tdls_oper_request()
19950 if (!msg) in cfg80211_tdls_oper_request()
19953 hdr = nl80211hdr_put(msg, 0, 0, 0, NL80211_CMD_TDLS_OPER); in cfg80211_tdls_oper_request()
19955 nlmsg_free(msg); in cfg80211_tdls_oper_request()
19959 if (nla_put_u32(msg, NL80211_ATTR_WIPHY, rdev->wiphy_idx) || in cfg80211_tdls_oper_request()
19960 nla_put_u32(msg, NL80211_ATTR_IFINDEX, dev->ifindex) || in cfg80211_tdls_oper_request()
19961 nla_put_u8(msg, NL80211_ATTR_TDLS_OPERATION, oper) || in cfg80211_tdls_oper_request()
19962 nla_put(msg, NL80211_ATTR_MAC, ETH_ALEN, peer) || in cfg80211_tdls_oper_request()
19964 nla_put_u16(msg, NL80211_ATTR_REASON_CODE, reason_code))) in cfg80211_tdls_oper_request()
19967 genlmsg_end(msg, hdr); in cfg80211_tdls_oper_request()
19969 genlmsg_multicast_netns(&nl80211_fam, wiphy_net(&rdev->wiphy), msg, 0, in cfg80211_tdls_oper_request()
19974 nlmsg_free(msg); in cfg80211_tdls_oper_request()
20049 struct sk_buff *msg; in cfg80211_ft_event() local
20057 msg = nlmsg_new(100 + ft_event->ies_len + ft_event->ric_ies_len, in cfg80211_ft_event()
20059 if (!msg) in cfg80211_ft_event()
20062 hdr = nl80211hdr_put(msg, 0, 0, 0, NL80211_CMD_FT_EVENT); in cfg80211_ft_event()
20066 if (nla_put_u32(msg, NL80211_ATTR_WIPHY, rdev->wiphy_idx) || in cfg80211_ft_event()
20067 nla_put_u32(msg, NL80211_ATTR_IFINDEX, netdev->ifindex) || in cfg80211_ft_event()
20068 nla_put(msg, NL80211_ATTR_MAC, ETH_ALEN, ft_event->target_ap)) in cfg80211_ft_event()
20072 nla_put(msg, NL80211_ATTR_IE, ft_event->ies_len, ft_event->ies)) in cfg80211_ft_event()
20075 nla_put(msg, NL80211_ATTR_IE_RIC, ft_event->ric_ies_len, in cfg80211_ft_event()
20079 genlmsg_end(msg, hdr); in cfg80211_ft_event()
20081 genlmsg_multicast_netns(&nl80211_fam, wiphy_net(&rdev->wiphy), msg, 0, in cfg80211_ft_event()
20085 nlmsg_free(msg); in cfg80211_ft_event()
20092 struct sk_buff *msg; in cfg80211_crit_proto_stopped() local
20103 msg = nlmsg_new(NLMSG_DEFAULT_SIZE, gfp); in cfg80211_crit_proto_stopped()
20104 if (!msg) in cfg80211_crit_proto_stopped()
20107 hdr = nl80211hdr_put(msg, 0, 0, 0, NL80211_CMD_CRIT_PROTOCOL_STOP); in cfg80211_crit_proto_stopped()
20111 if (nla_put_u32(msg, NL80211_ATTR_WIPHY, rdev->wiphy_idx) || in cfg80211_crit_proto_stopped()
20112 nla_put_u64_64bit(msg, NL80211_ATTR_WDEV, wdev_id(wdev), in cfg80211_crit_proto_stopped()
20116 genlmsg_end(msg, hdr); in cfg80211_crit_proto_stopped()
20118 genlmsg_unicast(wiphy_net(&rdev->wiphy), msg, nlportid); in cfg80211_crit_proto_stopped()
20122 nlmsg_free(msg); in cfg80211_crit_proto_stopped()
20130 struct sk_buff *msg; in nl80211_send_ap_stopped() local
20133 msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL); in nl80211_send_ap_stopped()
20134 if (!msg) in nl80211_send_ap_stopped()
20137 hdr = nl80211hdr_put(msg, 0, 0, 0, NL80211_CMD_STOP_AP); in nl80211_send_ap_stopped()
20141 if (nla_put_u32(msg, NL80211_ATTR_WIPHY, rdev->wiphy_idx) || in nl80211_send_ap_stopped()
20142 nla_put_u32(msg, NL80211_ATTR_IFINDEX, wdev->netdev->ifindex) || in nl80211_send_ap_stopped()
20143 nla_put_u64_64bit(msg, NL80211_ATTR_WDEV, wdev_id(wdev), in nl80211_send_ap_stopped()
20146 nla_put_u8(msg, NL80211_ATTR_MLO_LINK_ID, link_id))) in nl80211_send_ap_stopped()
20149 genlmsg_end(msg, hdr); in nl80211_send_ap_stopped()
20151 genlmsg_multicast_netns(&nl80211_fam, wiphy_net(wiphy), msg, 0, in nl80211_send_ap_stopped()
20155 nlmsg_free(msg); in nl80211_send_ap_stopped()
20164 struct sk_buff *msg; in cfg80211_external_auth_request() local
20170 msg = nlmsg_new(NLMSG_DEFAULT_SIZE, gfp); in cfg80211_external_auth_request()
20171 if (!msg) in cfg80211_external_auth_request()
20174 hdr = nl80211hdr_put(msg, 0, 0, 0, NL80211_CMD_EXTERNAL_AUTH); in cfg80211_external_auth_request()
20178 if (nla_put_u32(msg, NL80211_ATTR_WIPHY, rdev->wiphy_idx) || in cfg80211_external_auth_request()
20179 nla_put_u32(msg, NL80211_ATTR_IFINDEX, dev->ifindex) || in cfg80211_external_auth_request()
20180 nla_put_u32(msg, NL80211_ATTR_AKM_SUITES, params->key_mgmt_suite) || in cfg80211_external_auth_request()
20181 nla_put_u32(msg, NL80211_ATTR_EXTERNAL_AUTH_ACTION, in cfg80211_external_auth_request()
20183 nla_put(msg, NL80211_ATTR_BSSID, ETH_ALEN, params->bssid) || in cfg80211_external_auth_request()
20184 nla_put(msg, NL80211_ATTR_SSID, params->ssid.ssid_len, in cfg80211_external_auth_request()
20187 nla_put(msg, NL80211_ATTR_MLD_ADDR, ETH_ALEN, params->mld_addr))) in cfg80211_external_auth_request()
20190 genlmsg_end(msg, hdr); in cfg80211_external_auth_request()
20191 genlmsg_unicast(wiphy_net(&rdev->wiphy), msg, in cfg80211_external_auth_request()
20196 nlmsg_free(msg); in cfg80211_external_auth_request()
20207 struct sk_buff *msg; in cfg80211_update_owe_info_event() local
20212 msg = nlmsg_new(NLMSG_DEFAULT_SIZE, gfp); in cfg80211_update_owe_info_event()
20213 if (!msg) in cfg80211_update_owe_info_event()
20216 hdr = nl80211hdr_put(msg, 0, 0, 0, NL80211_CMD_UPDATE_OWE_INFO); in cfg80211_update_owe_info_event()
20220 if (nla_put_u32(msg, NL80211_ATTR_WIPHY, rdev->wiphy_idx) || in cfg80211_update_owe_info_event()
20221 nla_put_u32(msg, NL80211_ATTR_IFINDEX, netdev->ifindex) || in cfg80211_update_owe_info_event()
20222 nla_put(msg, NL80211_ATTR_MAC, ETH_ALEN, owe_info->peer)) in cfg80211_update_owe_info_event()
20226 nla_put(msg, NL80211_ATTR_IE, owe_info->ie_len, owe_info->ie)) in cfg80211_update_owe_info_event()
20230 if (nla_put_u8(msg, NL80211_ATTR_MLO_LINK_ID, in cfg80211_update_owe_info_event()
20235 nla_put(msg, NL80211_ATTR_MLD_ADDR, ETH_ALEN, in cfg80211_update_owe_info_event()
20240 genlmsg_end(msg, hdr); in cfg80211_update_owe_info_event()
20242 genlmsg_multicast_netns(&nl80211_fam, wiphy_net(&rdev->wiphy), msg, 0, in cfg80211_update_owe_info_event()
20247 genlmsg_cancel(msg, hdr); in cfg80211_update_owe_info_event()
20248 nlmsg_free(msg); in cfg80211_update_owe_info_event()