| .. | .. |
|---|
| 1 | +/* SPDX-License-Identifier: GPL-2.0-only */ |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Copyright 2002-2005, Instant802 Networks, Inc. |
|---|
| 3 | 4 | * Copyright 2005, Devicescape Software, Inc. |
|---|
| 4 | 5 | * Copyright 2006-2007 Jiri Benc <jbenc@suse.cz> |
|---|
| 5 | 6 | * Copyright 2007-2010 Johannes Berg <johannes@sipsolutions.net> |
|---|
| 6 | 7 | * Copyright 2013-2015 Intel Mobile Communications GmbH |
|---|
| 7 | | - * Copyright (C) 2018 Intel Corporation |
|---|
| 8 | | - * |
|---|
| 9 | | - * This program is free software; you can redistribute it and/or modify |
|---|
| 10 | | - * it under the terms of the GNU General Public License version 2 as |
|---|
| 11 | | - * published by the Free Software Foundation. |
|---|
| 8 | + * Copyright (C) 2018-2020 Intel Corporation |
|---|
| 12 | 9 | */ |
|---|
| 13 | 10 | |
|---|
| 14 | 11 | #ifndef IEEE80211_I_H |
|---|
| .. | .. |
|---|
| 96 | 93 | size_t supp_rates_len; |
|---|
| 97 | 94 | struct ieee80211_rate *beacon_rate; |
|---|
| 98 | 95 | |
|---|
| 96 | + u32 vht_cap_info; |
|---|
| 97 | + |
|---|
| 99 | 98 | /* |
|---|
| 100 | 99 | * During association, we save an ERP value from a probe response so |
|---|
| 101 | 100 | * that we can feed ERP info to the driver when handling the |
|---|
| .. | .. |
|---|
| 147 | 146 | #define TX_DROP ((__force ieee80211_tx_result) 1u) |
|---|
| 148 | 147 | #define TX_QUEUED ((__force ieee80211_tx_result) 2u) |
|---|
| 149 | 148 | |
|---|
| 150 | | -#define IEEE80211_TX_NO_SEQNO BIT(0) |
|---|
| 151 | 149 | #define IEEE80211_TX_UNICAST BIT(1) |
|---|
| 152 | 150 | #define IEEE80211_TX_PS_BUFFERED BIT(2) |
|---|
| 153 | 151 | |
|---|
| .. | .. |
|---|
| 201 | 199 | }; |
|---|
| 202 | 200 | |
|---|
| 203 | 201 | struct ieee80211_rx_data { |
|---|
| 204 | | - struct napi_struct *napi; |
|---|
| 202 | + struct list_head *list; |
|---|
| 205 | 203 | struct sk_buff *skb; |
|---|
| 206 | 204 | struct ieee80211_local *local; |
|---|
| 207 | 205 | struct ieee80211_sub_if_data *sdata; |
|---|
| .. | .. |
|---|
| 250 | 248 | u8 *head, *tail; |
|---|
| 251 | 249 | int head_len, tail_len; |
|---|
| 252 | 250 | struct ieee80211_meshconf_ie *meshconf; |
|---|
| 253 | | - u16 csa_counter_offsets[IEEE80211_MAX_CSA_COUNTERS_NUM]; |
|---|
| 254 | | - u8 csa_current_counter; |
|---|
| 251 | + u16 cntdwn_counter_offsets[IEEE80211_MAX_CNTDWN_COUNTERS_NUM]; |
|---|
| 252 | + u8 cntdwn_current_counter; |
|---|
| 255 | 253 | struct rcu_head rcu_head; |
|---|
| 256 | 254 | }; |
|---|
| 257 | 255 | |
|---|
| 258 | 256 | struct probe_resp { |
|---|
| 259 | 257 | struct rcu_head rcu_head; |
|---|
| 260 | 258 | int len; |
|---|
| 261 | | - u16 csa_counter_offsets[IEEE80211_MAX_CSA_COUNTERS_NUM]; |
|---|
| 262 | | - u8 data[0]; |
|---|
| 259 | + u16 cntdwn_counter_offsets[IEEE80211_MAX_CNTDWN_COUNTERS_NUM]; |
|---|
| 260 | + u8 data[]; |
|---|
| 261 | +}; |
|---|
| 262 | + |
|---|
| 263 | +struct fils_discovery_data { |
|---|
| 264 | + struct rcu_head rcu_head; |
|---|
| 265 | + int len; |
|---|
| 266 | + u8 data[]; |
|---|
| 267 | +}; |
|---|
| 268 | + |
|---|
| 269 | +struct unsol_bcast_probe_resp_data { |
|---|
| 270 | + struct rcu_head rcu_head; |
|---|
| 271 | + int len; |
|---|
| 272 | + u8 data[]; |
|---|
| 263 | 273 | }; |
|---|
| 264 | 274 | |
|---|
| 265 | 275 | struct ps_data { |
|---|
| .. | .. |
|---|
| 277 | 287 | struct ieee80211_if_ap { |
|---|
| 278 | 288 | struct beacon_data __rcu *beacon; |
|---|
| 279 | 289 | struct probe_resp __rcu *probe_resp; |
|---|
| 290 | + struct fils_discovery_data __rcu *fils_discovery; |
|---|
| 291 | + struct unsol_bcast_probe_resp_data __rcu *unsol_bcast_probe_resp; |
|---|
| 280 | 292 | |
|---|
| 281 | 293 | /* to be used after channel switch. */ |
|---|
| 282 | 294 | struct cfg80211_beacon_data *next_beacon; |
|---|
| .. | .. |
|---|
| 284 | 296 | |
|---|
| 285 | 297 | struct ps_data ps; |
|---|
| 286 | 298 | atomic_t num_mcast_sta; /* number of stations receiving multicast */ |
|---|
| 287 | | - enum ieee80211_smps_mode req_smps, /* requested smps mode */ |
|---|
| 288 | | - driver_smps_mode; /* smps mode request */ |
|---|
| 289 | 299 | |
|---|
| 290 | | - struct work_struct request_smps_work; |
|---|
| 291 | 300 | bool multicast_to_unicast; |
|---|
| 292 | 301 | }; |
|---|
| 293 | 302 | |
|---|
| .. | .. |
|---|
| 365 | 374 | |
|---|
| 366 | 375 | u8 key[WLAN_KEY_LEN_WEP104]; |
|---|
| 367 | 376 | u8 key_len, key_idx; |
|---|
| 368 | | - bool done; |
|---|
| 377 | + bool done, waiting; |
|---|
| 378 | + bool peer_confirmed; |
|---|
| 369 | 379 | bool timeout_started; |
|---|
| 370 | 380 | |
|---|
| 371 | 381 | u16 sae_trans, sae_status; |
|---|
| .. | .. |
|---|
| 444 | 454 | |
|---|
| 445 | 455 | u8 bssid[ETH_ALEN] __aligned(2); |
|---|
| 446 | 456 | |
|---|
| 447 | | - u16 aid; |
|---|
| 448 | | - |
|---|
| 449 | 457 | bool powersave; /* powersave requested for this iface */ |
|---|
| 450 | 458 | bool broken_ap; /* AP is broken -- turn off powersave */ |
|---|
| 451 | 459 | bool have_beacon; |
|---|
| .. | .. |
|---|
| 488 | 496 | unsigned int uapsd_max_sp_len; |
|---|
| 489 | 497 | |
|---|
| 490 | 498 | int wmm_last_param_set; |
|---|
| 499 | + int mu_edca_last_param_set; |
|---|
| 491 | 500 | |
|---|
| 492 | 501 | u8 use_4addr; |
|---|
| 493 | 502 | |
|---|
| .. | .. |
|---|
| 524 | 533 | struct ieee80211_ht_cap ht_capa_mask; /* Valid parts of ht_capa */ |
|---|
| 525 | 534 | struct ieee80211_vht_cap vht_capa; /* configured VHT overrides */ |
|---|
| 526 | 535 | struct ieee80211_vht_cap vht_capa_mask; /* Valid parts of vht_capa */ |
|---|
| 536 | + struct ieee80211_s1g_cap s1g_capa; /* configured S1G overrides */ |
|---|
| 537 | + struct ieee80211_s1g_cap s1g_capa_mask; /* valid s1g_capa bits */ |
|---|
| 527 | 538 | |
|---|
| 528 | 539 | /* TDLS support */ |
|---|
| 529 | 540 | u8 tdls_peer[ETH_ALEN] __aligned(2); |
|---|
| .. | .. |
|---|
| 543 | 554 | * get stuck in a downgraded situation and flush takes forever. |
|---|
| 544 | 555 | */ |
|---|
| 545 | 556 | struct delayed_work tx_tspec_wk; |
|---|
| 557 | + |
|---|
| 558 | + /* Information elements from the last transmitted (Re)Association |
|---|
| 559 | + * Request frame. |
|---|
| 560 | + */ |
|---|
| 561 | + u8 *assoc_req_ies; |
|---|
| 562 | + size_t assoc_req_ies_len; |
|---|
| 546 | 563 | }; |
|---|
| 547 | 564 | |
|---|
| 548 | 565 | struct ieee80211_if_ibss { |
|---|
| .. | .. |
|---|
| 807 | 824 | IEEE80211_TXQ_STOP, |
|---|
| 808 | 825 | IEEE80211_TXQ_AMPDU, |
|---|
| 809 | 826 | IEEE80211_TXQ_NO_AMSDU, |
|---|
| 827 | + IEEE80211_TXQ_STOP_NETIF_TX, |
|---|
| 810 | 828 | }; |
|---|
| 811 | 829 | |
|---|
| 812 | 830 | /** |
|---|
| .. | .. |
|---|
| 817 | 835 | * a fq_flow which is already owned by a different tin |
|---|
| 818 | 836 | * @def_cvars: codel vars for @def_flow |
|---|
| 819 | 837 | * @frags: used to keep fragments created after dequeue |
|---|
| 838 | + * @schedule_order: used with ieee80211_local->active_txqs |
|---|
| 839 | + * @schedule_round: counter to prevent infinite loops on TXQ scheduling |
|---|
| 820 | 840 | */ |
|---|
| 821 | 841 | struct txq_info { |
|---|
| 822 | 842 | struct fq_tin tin; |
|---|
| .. | .. |
|---|
| 824 | 844 | struct codel_vars def_cvars; |
|---|
| 825 | 845 | struct codel_stats cstats; |
|---|
| 826 | 846 | struct sk_buff_head frags; |
|---|
| 847 | + struct list_head schedule_order; |
|---|
| 848 | + u16 schedule_round; |
|---|
| 827 | 849 | unsigned long flags; |
|---|
| 828 | 850 | |
|---|
| 829 | 851 | /* keep last! */ |
|---|
| .. | .. |
|---|
| 881 | 903 | /* bit field of ACM bits (BIT(802.1D tag)) */ |
|---|
| 882 | 904 | u8 wmm_acm; |
|---|
| 883 | 905 | |
|---|
| 884 | | - struct ieee80211_key __rcu *keys[NUM_DEFAULT_KEYS + NUM_DEFAULT_MGMT_KEYS]; |
|---|
| 906 | + struct ieee80211_key __rcu *keys[NUM_DEFAULT_KEYS + |
|---|
| 907 | + NUM_DEFAULT_MGMT_KEYS + |
|---|
| 908 | + NUM_DEFAULT_BEACON_KEYS]; |
|---|
| 885 | 909 | struct ieee80211_key __rcu *default_unicast_key; |
|---|
| 886 | 910 | struct ieee80211_key __rcu *default_multicast_key; |
|---|
| 887 | 911 | struct ieee80211_key __rcu *default_mgmt_key; |
|---|
| 912 | + struct ieee80211_key __rcu *default_beacon_key; |
|---|
| 888 | 913 | |
|---|
| 889 | 914 | u16 sequence_number; |
|---|
| 890 | 915 | __be16 control_port_protocol; |
|---|
| 891 | 916 | bool control_port_no_encrypt; |
|---|
| 917 | + bool control_port_no_preauth; |
|---|
| 892 | 918 | bool control_port_over_nl80211; |
|---|
| 893 | 919 | int encrypt_headroom; |
|---|
| 894 | 920 | |
|---|
| .. | .. |
|---|
| 940 | 966 | bool rc_has_vht_mcs_mask[NUM_NL80211_BANDS]; |
|---|
| 941 | 967 | u16 rc_rateidx_vht_mcs_mask[NUM_NL80211_BANDS][NL80211_VHT_NSS_MAX]; |
|---|
| 942 | 968 | |
|---|
| 969 | + /* Beacon frame (non-MCS) rate (as a bitmap) */ |
|---|
| 970 | + u32 beacon_rateidx_mask[NUM_NL80211_BANDS]; |
|---|
| 971 | + bool beacon_rate_set; |
|---|
| 972 | + |
|---|
| 943 | 973 | union { |
|---|
| 944 | 974 | struct ieee80211_if_ap ap; |
|---|
| 945 | 975 | struct ieee80211_if_wds wds; |
|---|
| .. | .. |
|---|
| 958 | 988 | struct dentry *default_unicast_key; |
|---|
| 959 | 989 | struct dentry *default_multicast_key; |
|---|
| 960 | 990 | struct dentry *default_mgmt_key; |
|---|
| 991 | + struct dentry *default_beacon_key; |
|---|
| 961 | 992 | } debugfs; |
|---|
| 962 | 993 | #endif |
|---|
| 963 | 994 | |
|---|
| .. | .. |
|---|
| 1072 | 1103 | * a scan complete for an aborted scan. |
|---|
| 1073 | 1104 | * @SCAN_HW_CANCELLED: Set for our scan work function when the scan is being |
|---|
| 1074 | 1105 | * cancelled. |
|---|
| 1106 | + * @SCAN_BEACON_WAIT: Set whenever we're passive scanning because of radar/no-IR |
|---|
| 1107 | + * and could send a probe request after receiving a beacon. |
|---|
| 1108 | + * @SCAN_BEACON_DONE: Beacon received, we can now send a probe request |
|---|
| 1075 | 1109 | */ |
|---|
| 1076 | 1110 | enum { |
|---|
| 1077 | 1111 | SCAN_SW_SCANNING, |
|---|
| .. | .. |
|---|
| 1080 | 1114 | SCAN_COMPLETED, |
|---|
| 1081 | 1115 | SCAN_ABORTED, |
|---|
| 1082 | 1116 | SCAN_HW_CANCELLED, |
|---|
| 1117 | + SCAN_BEACON_WAIT, |
|---|
| 1118 | + SCAN_BEACON_DONE, |
|---|
| 1083 | 1119 | }; |
|---|
| 1084 | 1120 | |
|---|
| 1085 | 1121 | /** |
|---|
| .. | .. |
|---|
| 1114 | 1150 | struct codel_vars *cvars; |
|---|
| 1115 | 1151 | struct codel_params cparams; |
|---|
| 1116 | 1152 | |
|---|
| 1153 | + /* protects active_txqs and txqi->schedule_order */ |
|---|
| 1154 | + spinlock_t active_txq_lock[IEEE80211_NUM_ACS]; |
|---|
| 1155 | + struct list_head active_txqs[IEEE80211_NUM_ACS]; |
|---|
| 1156 | + u16 schedule_round[IEEE80211_NUM_ACS]; |
|---|
| 1157 | + |
|---|
| 1158 | + u16 airtime_flags; |
|---|
| 1159 | + u32 aql_txq_limit_low[IEEE80211_NUM_ACS]; |
|---|
| 1160 | + u32 aql_txq_limit_high[IEEE80211_NUM_ACS]; |
|---|
| 1161 | + u32 aql_threshold; |
|---|
| 1162 | + atomic_t aql_total_pending_airtime; |
|---|
| 1163 | + |
|---|
| 1117 | 1164 | const struct ieee80211_ops *ops; |
|---|
| 1118 | 1165 | |
|---|
| 1119 | 1166 | /* |
|---|
| .. | .. |
|---|
| 1132 | 1179 | /* number of interfaces with corresponding FIF_ flags */ |
|---|
| 1133 | 1180 | int fif_fcsfail, fif_plcpfail, fif_control, fif_other_bss, fif_pspoll, |
|---|
| 1134 | 1181 | fif_probe_req; |
|---|
| 1135 | | - int probe_req_reg; |
|---|
| 1182 | + bool probe_req_reg; |
|---|
| 1183 | + bool rx_mcast_action_reg; |
|---|
| 1136 | 1184 | unsigned int filter_flags; /* FIF_* */ |
|---|
| 1137 | 1185 | |
|---|
| 1138 | 1186 | bool wiphy_ciphers_allocated; |
|---|
| .. | .. |
|---|
| 1186 | 1234 | /* number of RX chains the hardware has */ |
|---|
| 1187 | 1235 | u8 rx_chains; |
|---|
| 1188 | 1236 | |
|---|
| 1237 | + /* bitmap of which sbands were copied */ |
|---|
| 1238 | + u8 sband_allocated; |
|---|
| 1239 | + |
|---|
| 1189 | 1240 | int tx_headroom; /* required headroom for hardware/radiotap */ |
|---|
| 1190 | 1241 | |
|---|
| 1191 | 1242 | /* Tasklet and skb queue to process calls from IRQ mode. All frames |
|---|
| .. | .. |
|---|
| 1214 | 1265 | |
|---|
| 1215 | 1266 | struct sk_buff_head pending[IEEE80211_MAX_QUEUES]; |
|---|
| 1216 | 1267 | struct tasklet_struct tx_pending_tasklet; |
|---|
| 1268 | + struct tasklet_struct wake_txqs_tasklet; |
|---|
| 1217 | 1269 | |
|---|
| 1218 | 1270 | atomic_t agg_queue_stop[IEEE80211_MAX_QUEUES]; |
|---|
| 1219 | 1271 | |
|---|
| .. | .. |
|---|
| 1222 | 1274 | |
|---|
| 1223 | 1275 | struct rate_control_ref *rate_ctrl; |
|---|
| 1224 | 1276 | |
|---|
| 1225 | | - struct crypto_cipher *wep_tx_tfm; |
|---|
| 1226 | | - struct crypto_cipher *wep_rx_tfm; |
|---|
| 1277 | + struct arc4_ctx wep_tx_ctx; |
|---|
| 1278 | + struct arc4_ctx wep_rx_ctx; |
|---|
| 1227 | 1279 | u32 wep_iv; |
|---|
| 1228 | 1280 | |
|---|
| 1229 | 1281 | /* see iface.c */ |
|---|
| .. | .. |
|---|
| 1233 | 1285 | |
|---|
| 1234 | 1286 | /* |
|---|
| 1235 | 1287 | * Key mutex, protects sdata's key_list and sta_info's |
|---|
| 1236 | | - * key pointers (write access, they're RCU.) |
|---|
| 1288 | + * key pointers and ptk_idx (write access, they're RCU.) |
|---|
| 1237 | 1289 | */ |
|---|
| 1238 | 1290 | struct mutex key_mtx; |
|---|
| 1239 | 1291 | |
|---|
| .. | .. |
|---|
| 1319 | 1371 | */ |
|---|
| 1320 | 1372 | |
|---|
| 1321 | 1373 | bool pspolling; |
|---|
| 1322 | | - bool offchannel_ps_enabled; |
|---|
| 1323 | 1374 | /* |
|---|
| 1324 | 1375 | * PS can only be enabled when we have exactly one managed |
|---|
| 1325 | 1376 | * interface (and monitors) in PS, this then points there. |
|---|
| .. | .. |
|---|
| 1348 | 1399 | struct dentry *rcdir; |
|---|
| 1349 | 1400 | struct dentry *keys; |
|---|
| 1350 | 1401 | } debugfs; |
|---|
| 1402 | + bool force_tx_status; |
|---|
| 1351 | 1403 | #endif |
|---|
| 1352 | 1404 | |
|---|
| 1353 | 1405 | /* |
|---|
| .. | .. |
|---|
| 1417 | 1469 | u8 ttl; |
|---|
| 1418 | 1470 | u16 pre_value; |
|---|
| 1419 | 1471 | u16 reason_code; |
|---|
| 1472 | + u32 max_switch_time; |
|---|
| 1420 | 1473 | }; |
|---|
| 1421 | 1474 | |
|---|
| 1422 | 1475 | /* Parsed Information Elements */ |
|---|
| .. | .. |
|---|
| 1432 | 1485 | const u8 *supp_rates; |
|---|
| 1433 | 1486 | const u8 *ds_params; |
|---|
| 1434 | 1487 | const struct ieee80211_tim_ie *tim; |
|---|
| 1435 | | - const u8 *challenge; |
|---|
| 1436 | 1488 | const u8 *rsn; |
|---|
| 1489 | + const u8 *rsnx; |
|---|
| 1437 | 1490 | const u8 *erp_info; |
|---|
| 1438 | 1491 | const u8 *ext_supp_rates; |
|---|
| 1439 | 1492 | const u8 *wmm_info; |
|---|
| .. | .. |
|---|
| 1445 | 1498 | const struct ieee80211_meshconf_ie *mesh_config; |
|---|
| 1446 | 1499 | const u8 *he_cap; |
|---|
| 1447 | 1500 | const struct ieee80211_he_operation *he_operation; |
|---|
| 1501 | + const struct ieee80211_he_spr *he_spr; |
|---|
| 1448 | 1502 | const struct ieee80211_mu_edca_param_set *mu_edca_param_set; |
|---|
| 1503 | + const struct ieee80211_he_6ghz_capa *he_6ghz_capa; |
|---|
| 1449 | 1504 | const u8 *uora_element; |
|---|
| 1450 | 1505 | const u8 *mesh_id; |
|---|
| 1451 | 1506 | const u8 *peering; |
|---|
| .. | .. |
|---|
| 1457 | 1512 | const struct ieee80211_channel_sw_ie *ch_switch_ie; |
|---|
| 1458 | 1513 | const struct ieee80211_ext_chansw_ie *ext_chansw_ie; |
|---|
| 1459 | 1514 | const struct ieee80211_wide_bw_chansw_ie *wide_bw_chansw_ie; |
|---|
| 1515 | + const u8 *max_channel_switch_time; |
|---|
| 1460 | 1516 | const u8 *country_elem; |
|---|
| 1461 | 1517 | const u8 *pwr_constr_elem; |
|---|
| 1462 | 1518 | const u8 *cisco_dtpc_elem; |
|---|
| .. | .. |
|---|
| 1465 | 1521 | const struct ieee80211_sec_chan_offs_ie *sec_chan_offs; |
|---|
| 1466 | 1522 | struct ieee80211_mesh_chansw_params_ie *mesh_chansw_params_ie; |
|---|
| 1467 | 1523 | const struct ieee80211_bss_max_idle_period_ie *max_idle_period_ie; |
|---|
| 1524 | + const struct ieee80211_multiple_bssid_configuration *mbssid_config_ie; |
|---|
| 1525 | + const struct ieee80211_bssid_index *bssid_index; |
|---|
| 1526 | + u8 max_bssid_indicator; |
|---|
| 1527 | + u8 dtim_count; |
|---|
| 1528 | + u8 dtim_period; |
|---|
| 1529 | + const struct ieee80211_addba_ext_ie *addba_ext_ie; |
|---|
| 1530 | + const struct ieee80211_s1g_cap *s1g_capab; |
|---|
| 1531 | + const struct ieee80211_s1g_oper_ie *s1g_oper; |
|---|
| 1532 | + const struct ieee80211_s1g_bcn_compat_ie *s1g_bcn_compat; |
|---|
| 1533 | + const struct ieee80211_aid_response_ie *aid_resp; |
|---|
| 1468 | 1534 | |
|---|
| 1469 | 1535 | /* length of them, respectively */ |
|---|
| 1470 | 1536 | u8 ext_capab_len; |
|---|
| 1471 | 1537 | u8 ssid_len; |
|---|
| 1472 | 1538 | u8 supp_rates_len; |
|---|
| 1473 | 1539 | u8 tim_len; |
|---|
| 1474 | | - u8 challenge_len; |
|---|
| 1475 | 1540 | u8 rsn_len; |
|---|
| 1541 | + u8 rsnx_len; |
|---|
| 1476 | 1542 | u8 ext_supp_rates_len; |
|---|
| 1477 | 1543 | u8 wmm_info_len; |
|---|
| 1478 | 1544 | u8 wmm_param_len; |
|---|
| .. | .. |
|---|
| 1483 | 1549 | u8 prep_len; |
|---|
| 1484 | 1550 | u8 perr_len; |
|---|
| 1485 | 1551 | u8 country_elem_len; |
|---|
| 1552 | + u8 bssid_index_len; |
|---|
| 1553 | + |
|---|
| 1554 | + void *nontx_profile; |
|---|
| 1486 | 1555 | |
|---|
| 1487 | 1556 | /* whether a parse error occurred while retrieving these elements */ |
|---|
| 1488 | 1557 | bool parse_error; |
|---|
| .. | .. |
|---|
| 1581 | 1650 | void ieee80211_sta_work(struct ieee80211_sub_if_data *sdata); |
|---|
| 1582 | 1651 | void ieee80211_sta_rx_queued_mgmt(struct ieee80211_sub_if_data *sdata, |
|---|
| 1583 | 1652 | struct sk_buff *skb); |
|---|
| 1653 | +void ieee80211_sta_rx_queued_ext(struct ieee80211_sub_if_data *sdata, |
|---|
| 1654 | + struct sk_buff *skb); |
|---|
| 1584 | 1655 | void ieee80211_sta_reset_beacon_monitor(struct ieee80211_sub_if_data *sdata); |
|---|
| 1585 | 1656 | void ieee80211_sta_reset_conn_monitor(struct ieee80211_sub_if_data *sdata); |
|---|
| 1586 | 1657 | void ieee80211_mgd_stop(struct ieee80211_sub_if_data *sdata); |
|---|
| .. | .. |
|---|
| 1642 | 1713 | struct ieee80211_rx_status *rx_status, |
|---|
| 1643 | 1714 | struct ieee80211_mgmt *mgmt, |
|---|
| 1644 | 1715 | size_t len, |
|---|
| 1645 | | - struct ieee802_11_elems *elems, |
|---|
| 1646 | 1716 | struct ieee80211_channel *channel); |
|---|
| 1647 | 1717 | void ieee80211_rx_bss_put(struct ieee80211_local *local, |
|---|
| 1648 | 1718 | struct ieee80211_bss *bss); |
|---|
| .. | .. |
|---|
| 1680 | 1750 | struct cfg80211_csa_settings *params); |
|---|
| 1681 | 1751 | |
|---|
| 1682 | 1752 | /* interface handling */ |
|---|
| 1753 | +#define MAC80211_SUPPORTED_FEATURES_TX (NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM | \ |
|---|
| 1754 | + NETIF_F_HW_CSUM | NETIF_F_SG | \ |
|---|
| 1755 | + NETIF_F_HIGHDMA | NETIF_F_GSO_SOFTWARE) |
|---|
| 1756 | +#define MAC80211_SUPPORTED_FEATURES_RX (NETIF_F_RXCSUM) |
|---|
| 1757 | +#define MAC80211_SUPPORTED_FEATURES (MAC80211_SUPPORTED_FEATURES_TX | \ |
|---|
| 1758 | + MAC80211_SUPPORTED_FEATURES_RX) |
|---|
| 1759 | + |
|---|
| 1683 | 1760 | int ieee80211_iface_init(void); |
|---|
| 1684 | 1761 | void ieee80211_iface_exit(void); |
|---|
| 1685 | 1762 | int ieee80211_if_add(struct ieee80211_local *local, const char *name, |
|---|
| .. | .. |
|---|
| 1702 | 1779 | bool __ieee80211_recalc_txpower(struct ieee80211_sub_if_data *sdata); |
|---|
| 1703 | 1780 | void ieee80211_recalc_txpower(struct ieee80211_sub_if_data *sdata, |
|---|
| 1704 | 1781 | bool update_bss); |
|---|
| 1782 | +void ieee80211_recalc_offload(struct ieee80211_local *local); |
|---|
| 1705 | 1783 | |
|---|
| 1706 | 1784 | static inline bool ieee80211_sdata_running(struct ieee80211_sub_if_data *sdata) |
|---|
| 1707 | 1785 | { |
|---|
| .. | .. |
|---|
| 1715 | 1793 | struct net_device *dev); |
|---|
| 1716 | 1794 | netdev_tx_t ieee80211_subif_start_xmit(struct sk_buff *skb, |
|---|
| 1717 | 1795 | struct net_device *dev); |
|---|
| 1796 | +netdev_tx_t ieee80211_subif_start_xmit_8023(struct sk_buff *skb, |
|---|
| 1797 | + struct net_device *dev); |
|---|
| 1718 | 1798 | void __ieee80211_subif_start_xmit(struct sk_buff *skb, |
|---|
| 1719 | 1799 | struct net_device *dev, |
|---|
| 1720 | 1800 | u32 info_flags, |
|---|
| 1721 | | - u32 ctrl_flags); |
|---|
| 1801 | + u32 ctrl_flags, |
|---|
| 1802 | + u64 *cookie); |
|---|
| 1722 | 1803 | void ieee80211_purge_tx_queue(struct ieee80211_hw *hw, |
|---|
| 1723 | 1804 | struct sk_buff_head *skbs); |
|---|
| 1724 | 1805 | struct sk_buff * |
|---|
| .. | .. |
|---|
| 1726 | 1807 | struct sk_buff *skb, u32 info_flags); |
|---|
| 1727 | 1808 | void ieee80211_tx_monitor(struct ieee80211_local *local, struct sk_buff *skb, |
|---|
| 1728 | 1809 | struct ieee80211_supported_band *sband, |
|---|
| 1729 | | - int retry_count, int shift, bool send_to_cooked); |
|---|
| 1810 | + int retry_count, int shift, bool send_to_cooked, |
|---|
| 1811 | + struct ieee80211_tx_status *status); |
|---|
| 1730 | 1812 | |
|---|
| 1731 | 1813 | void ieee80211_check_fast_xmit(struct sta_info *sta); |
|---|
| 1732 | 1814 | void ieee80211_check_fast_xmit_all(struct ieee80211_local *local); |
|---|
| .. | .. |
|---|
| 1734 | 1816 | void ieee80211_clear_fast_xmit(struct sta_info *sta); |
|---|
| 1735 | 1817 | int ieee80211_tx_control_port(struct wiphy *wiphy, struct net_device *dev, |
|---|
| 1736 | 1818 | const u8 *buf, size_t len, |
|---|
| 1737 | | - const u8 *dest, __be16 proto, bool unencrypted); |
|---|
| 1819 | + const u8 *dest, __be16 proto, bool unencrypted, |
|---|
| 1820 | + u64 *cookie); |
|---|
| 1821 | +int ieee80211_probe_mesh_link(struct wiphy *wiphy, struct net_device *dev, |
|---|
| 1822 | + const u8 *buf, size_t len); |
|---|
| 1738 | 1823 | |
|---|
| 1739 | 1824 | /* HT */ |
|---|
| 1740 | 1825 | void ieee80211_apply_htcap_overrides(struct ieee80211_sub_if_data *sdata, |
|---|
| .. | .. |
|---|
| 1761 | 1846 | void ___ieee80211_start_rx_ba_session(struct sta_info *sta, |
|---|
| 1762 | 1847 | u8 dialog_token, u16 timeout, |
|---|
| 1763 | 1848 | u16 start_seq_num, u16 ba_policy, u16 tid, |
|---|
| 1764 | | - u16 buf_size, bool tx, bool auto_seq); |
|---|
| 1849 | + u16 buf_size, bool tx, bool auto_seq, |
|---|
| 1850 | + const struct ieee80211_addba_ext_ie *addbaext); |
|---|
| 1765 | 1851 | void ieee80211_sta_tear_down_BA_sessions(struct sta_info *sta, |
|---|
| 1766 | 1852 | enum ieee80211_agg_stop_reason reason); |
|---|
| 1767 | 1853 | void ieee80211_process_delba(struct ieee80211_sub_if_data *sdata, |
|---|
| .. | .. |
|---|
| 1825 | 1911 | ieee80211_he_cap_ie_to_sta_he_cap(struct ieee80211_sub_if_data *sdata, |
|---|
| 1826 | 1912 | struct ieee80211_supported_band *sband, |
|---|
| 1827 | 1913 | const u8 *he_cap_ie, u8 he_cap_len, |
|---|
| 1914 | + const struct ieee80211_he_6ghz_capa *he_6ghz_capa, |
|---|
| 1828 | 1915 | struct sta_info *sta); |
|---|
| 1916 | +void |
|---|
| 1917 | +ieee80211_he_spr_ie_to_bss_conf(struct ieee80211_vif *vif, |
|---|
| 1918 | + const struct ieee80211_he_spr *he_spr_ie_elem); |
|---|
| 1919 | + |
|---|
| 1920 | +void |
|---|
| 1921 | +ieee80211_he_op_ie_to_bss_conf(struct ieee80211_vif *vif, |
|---|
| 1922 | + const struct ieee80211_he_operation *he_op_ie_elem); |
|---|
| 1923 | + |
|---|
| 1924 | +/* S1G */ |
|---|
| 1925 | +void ieee80211_s1g_sta_rate_init(struct sta_info *sta); |
|---|
| 1829 | 1926 | |
|---|
| 1830 | 1927 | /* Spectrum management */ |
|---|
| 1831 | 1928 | void ieee80211_process_measurement_req(struct ieee80211_sub_if_data *sdata, |
|---|
| .. | .. |
|---|
| 1836 | 1933 | * @sdata: the sdata of the interface which has received the frame |
|---|
| 1837 | 1934 | * @elems: parsed 802.11 elements received with the frame |
|---|
| 1838 | 1935 | * @current_band: indicates the current band |
|---|
| 1936 | + * @vht_cap_info: VHT capabilities of the transmitter |
|---|
| 1839 | 1937 | * @sta_flags: contains information about own capabilities and restrictions |
|---|
| 1840 | 1938 | * to decide which channel switch announcements can be accepted. Only the |
|---|
| 1841 | 1939 | * following subset of &enum ieee80211_sta_flags are evaluated: |
|---|
| .. | .. |
|---|
| 1850 | 1948 | int ieee80211_parse_ch_switch_ie(struct ieee80211_sub_if_data *sdata, |
|---|
| 1851 | 1949 | struct ieee802_11_elems *elems, |
|---|
| 1852 | 1950 | enum nl80211_band current_band, |
|---|
| 1951 | + u32 vht_cap_info, |
|---|
| 1853 | 1952 | u32 sta_flags, u8 *bssid, |
|---|
| 1854 | 1953 | struct ieee80211_csa_ie *csa_ie); |
|---|
| 1855 | 1954 | |
|---|
| .. | .. |
|---|
| 1883 | 1982 | void ieee80211_set_wmm_default(struct ieee80211_sub_if_data *sdata, |
|---|
| 1884 | 1983 | bool bss_notify, bool enable_qos); |
|---|
| 1885 | 1984 | void ieee80211_xmit(struct ieee80211_sub_if_data *sdata, |
|---|
| 1886 | | - struct sta_info *sta, struct sk_buff *skb, |
|---|
| 1887 | | - u32 txdata_flags); |
|---|
| 1985 | + struct sta_info *sta, struct sk_buff *skb); |
|---|
| 1888 | 1986 | |
|---|
| 1889 | 1987 | void __ieee80211_tx_skb_tid_band(struct ieee80211_sub_if_data *sdata, |
|---|
| 1890 | 1988 | struct sk_buff *skb, int tid, |
|---|
| 1891 | | - enum nl80211_band band, u32 txdata_flags); |
|---|
| 1989 | + enum nl80211_band band); |
|---|
| 1990 | + |
|---|
| 1991 | +/* sta_out needs to be checked for ERR_PTR() before using */ |
|---|
| 1992 | +int ieee80211_lookup_ra_sta(struct ieee80211_sub_if_data *sdata, |
|---|
| 1993 | + struct sk_buff *skb, |
|---|
| 1994 | + struct sta_info **sta_out); |
|---|
| 1892 | 1995 | |
|---|
| 1893 | 1996 | static inline void |
|---|
| 1894 | 1997 | ieee80211_tx_skb_tid_band(struct ieee80211_sub_if_data *sdata, |
|---|
| 1895 | 1998 | struct sk_buff *skb, int tid, |
|---|
| 1896 | | - enum nl80211_band band, u32 txdata_flags) |
|---|
| 1999 | + enum nl80211_band band) |
|---|
| 1897 | 2000 | { |
|---|
| 1898 | 2001 | rcu_read_lock(); |
|---|
| 1899 | | - __ieee80211_tx_skb_tid_band(sdata, skb, tid, band, txdata_flags); |
|---|
| 2002 | + __ieee80211_tx_skb_tid_band(sdata, skb, tid, band); |
|---|
| 1900 | 2003 | rcu_read_unlock(); |
|---|
| 1901 | 2004 | } |
|---|
| 1902 | 2005 | |
|---|
| .. | .. |
|---|
| 1914 | 2017 | } |
|---|
| 1915 | 2018 | |
|---|
| 1916 | 2019 | __ieee80211_tx_skb_tid_band(sdata, skb, tid, |
|---|
| 1917 | | - chanctx_conf->def.chan->band, 0); |
|---|
| 2020 | + chanctx_conf->def.chan->band); |
|---|
| 1918 | 2021 | rcu_read_unlock(); |
|---|
| 1919 | 2022 | } |
|---|
| 1920 | 2023 | |
|---|
| .. | .. |
|---|
| 1927 | 2030 | |
|---|
| 1928 | 2031 | u32 ieee802_11_parse_elems_crc(const u8 *start, size_t len, bool action, |
|---|
| 1929 | 2032 | struct ieee802_11_elems *elems, |
|---|
| 1930 | | - u64 filter, u32 crc); |
|---|
| 2033 | + u64 filter, u32 crc, u8 *transmitter_bssid, |
|---|
| 2034 | + u8 *bss_bssid); |
|---|
| 1931 | 2035 | static inline void ieee802_11_parse_elems(const u8 *start, size_t len, |
|---|
| 1932 | 2036 | bool action, |
|---|
| 1933 | | - struct ieee802_11_elems *elems) |
|---|
| 2037 | + struct ieee802_11_elems *elems, |
|---|
| 2038 | + u8 *transmitter_bssid, |
|---|
| 2039 | + u8 *bss_bssid) |
|---|
| 1934 | 2040 | { |
|---|
| 1935 | | - ieee802_11_parse_elems_crc(start, len, action, elems, 0, 0); |
|---|
| 2041 | + ieee802_11_parse_elems_crc(start, len, action, elems, 0, 0, |
|---|
| 2042 | + transmitter_bssid, bss_bssid); |
|---|
| 1936 | 2043 | } |
|---|
| 1937 | 2044 | |
|---|
| 1938 | 2045 | |
|---|
| .. | .. |
|---|
| 1949 | 2056 | void ieee80211_send_nullfunc(struct ieee80211_local *local, |
|---|
| 1950 | 2057 | struct ieee80211_sub_if_data *sdata, |
|---|
| 1951 | 2058 | bool powersave); |
|---|
| 1952 | | -void ieee80211_sta_rx_notify(struct ieee80211_sub_if_data *sdata, |
|---|
| 1953 | | - struct ieee80211_hdr *hdr); |
|---|
| 2059 | +void ieee80211_send_4addr_nullfunc(struct ieee80211_local *local, |
|---|
| 2060 | + struct ieee80211_sub_if_data *sdata); |
|---|
| 1954 | 2061 | void ieee80211_sta_tx_notify(struct ieee80211_sub_if_data *sdata, |
|---|
| 1955 | 2062 | struct ieee80211_hdr *hdr, bool ack, u16 tx_time); |
|---|
| 1956 | 2063 | |
|---|
| .. | .. |
|---|
| 2034 | 2141 | struct ieee80211_sub_if_data *sdata); |
|---|
| 2035 | 2142 | void ieee80211_fill_txq_stats(struct cfg80211_txq_stats *txqstats, |
|---|
| 2036 | 2143 | struct txq_info *txqi); |
|---|
| 2144 | +void ieee80211_wake_txqs(unsigned long data); |
|---|
| 2037 | 2145 | void ieee80211_send_auth(struct ieee80211_sub_if_data *sdata, |
|---|
| 2038 | 2146 | u16 transaction, u16 auth_alg, u16 status, |
|---|
| 2039 | 2147 | const u8 *extra, size_t extra_len, const u8 *bssid, |
|---|
| 2040 | 2148 | const u8 *da, const u8 *key, u8 key_len, u8 key_idx, |
|---|
| 2041 | 2149 | u32 tx_flags); |
|---|
| 2042 | 2150 | void ieee80211_send_deauth_disassoc(struct ieee80211_sub_if_data *sdata, |
|---|
| 2043 | | - const u8 *bssid, u16 stype, u16 reason, |
|---|
| 2151 | + const u8 *da, const u8 *bssid, |
|---|
| 2152 | + u16 stype, u16 reason, |
|---|
| 2044 | 2153 | bool send_frame, u8 *frame_buf); |
|---|
| 2045 | 2154 | |
|---|
| 2046 | 2155 | enum { |
|---|
| .. | .. |
|---|
| 2049 | 2158 | IEEE80211_PROBE_FLAG_RANDOM_SN = BIT(2), |
|---|
| 2050 | 2159 | }; |
|---|
| 2051 | 2160 | |
|---|
| 2052 | | -int ieee80211_build_preq_ies(struct ieee80211_local *local, u8 *buffer, |
|---|
| 2161 | +int ieee80211_build_preq_ies(struct ieee80211_sub_if_data *sdata, u8 *buffer, |
|---|
| 2053 | 2162 | size_t buffer_len, |
|---|
| 2054 | 2163 | struct ieee80211_scan_ies *ie_desc, |
|---|
| 2055 | 2164 | const u8 *ie, size_t ie_len, |
|---|
| .. | .. |
|---|
| 2068 | 2177 | enum nl80211_band band, u32 *basic_rates); |
|---|
| 2069 | 2178 | int __ieee80211_request_smps_mgd(struct ieee80211_sub_if_data *sdata, |
|---|
| 2070 | 2179 | enum ieee80211_smps_mode smps_mode); |
|---|
| 2071 | | -int __ieee80211_request_smps_ap(struct ieee80211_sub_if_data *sdata, |
|---|
| 2072 | | - enum ieee80211_smps_mode smps_mode); |
|---|
| 2073 | 2180 | void ieee80211_recalc_smps(struct ieee80211_sub_if_data *sdata); |
|---|
| 2074 | 2181 | void ieee80211_recalc_min_chandef(struct ieee80211_sub_if_data *sdata); |
|---|
| 2075 | 2182 | |
|---|
| .. | .. |
|---|
| 2085 | 2192 | u32 cap); |
|---|
| 2086 | 2193 | u8 *ieee80211_ie_build_vht_oper(u8 *pos, struct ieee80211_sta_vht_cap *vht_cap, |
|---|
| 2087 | 2194 | const struct cfg80211_chan_def *chandef); |
|---|
| 2195 | +u8 ieee80211_ie_len_he_cap(struct ieee80211_sub_if_data *sdata, u8 iftype); |
|---|
| 2088 | 2196 | u8 *ieee80211_ie_build_he_cap(u8 *pos, |
|---|
| 2089 | 2197 | const struct ieee80211_sta_he_cap *he_cap, |
|---|
| 2090 | 2198 | u8 *end); |
|---|
| 2199 | +void ieee80211_ie_build_he_6ghz_cap(struct ieee80211_sub_if_data *sdata, |
|---|
| 2200 | + struct sk_buff *skb); |
|---|
| 2201 | +u8 *ieee80211_ie_build_he_oper(u8 *pos, struct cfg80211_chan_def *chandef); |
|---|
| 2091 | 2202 | int ieee80211_parse_bitrates(struct cfg80211_chan_def *chandef, |
|---|
| 2092 | 2203 | const struct ieee80211_supported_band *sband, |
|---|
| 2093 | 2204 | const u8 *srates, int srates_len, u32 *rates); |
|---|
| .. | .. |
|---|
| 2098 | 2209 | struct sk_buff *skb, bool need_basic, |
|---|
| 2099 | 2210 | enum nl80211_band band); |
|---|
| 2100 | 2211 | u8 *ieee80211_add_wmm_info_ie(u8 *buf, u8 qosinfo); |
|---|
| 2212 | +void ieee80211_add_s1g_capab_ie(struct ieee80211_sub_if_data *sdata, |
|---|
| 2213 | + struct ieee80211_sta_s1g_cap *caps, |
|---|
| 2214 | + struct sk_buff *skb); |
|---|
| 2215 | +void ieee80211_add_aid_request_ie(struct ieee80211_sub_if_data *sdata, |
|---|
| 2216 | + struct sk_buff *skb); |
|---|
| 2101 | 2217 | |
|---|
| 2102 | 2218 | /* channel management */ |
|---|
| 2103 | 2219 | bool ieee80211_chandef_ht_oper(const struct ieee80211_ht_operation *ht_oper, |
|---|
| 2104 | 2220 | struct cfg80211_chan_def *chandef); |
|---|
| 2105 | | -bool ieee80211_chandef_vht_oper(const struct ieee80211_vht_operation *oper, |
|---|
| 2221 | +bool ieee80211_chandef_vht_oper(struct ieee80211_hw *hw, u32 vht_cap_info, |
|---|
| 2222 | + const struct ieee80211_vht_operation *oper, |
|---|
| 2223 | + const struct ieee80211_ht_operation *htop, |
|---|
| 2224 | + struct cfg80211_chan_def *chandef); |
|---|
| 2225 | +bool ieee80211_chandef_he_6ghz_oper(struct ieee80211_sub_if_data *sdata, |
|---|
| 2226 | + const struct ieee80211_he_operation *he_oper, |
|---|
| 2227 | + struct cfg80211_chan_def *chandef); |
|---|
| 2228 | +bool ieee80211_chandef_s1g_oper(const struct ieee80211_s1g_oper_ie *oper, |
|---|
| 2106 | 2229 | struct cfg80211_chan_def *chandef); |
|---|
| 2107 | 2230 | u32 ieee80211_chandef_downgrade(struct cfg80211_chan_def *c); |
|---|
| 2108 | 2231 | |
|---|
| .. | .. |
|---|
| 2182 | 2305 | void ieee80211_tdls_handle_disconnect(struct ieee80211_sub_if_data *sdata, |
|---|
| 2183 | 2306 | const u8 *peer, u16 reason); |
|---|
| 2184 | 2307 | const char *ieee80211_get_reason_code_string(u16 reason_code); |
|---|
| 2308 | +u16 ieee80211_encode_usf(int val); |
|---|
| 2309 | +u8 *ieee80211_get_bssid(struct ieee80211_hdr *hdr, size_t len, |
|---|
| 2310 | + enum nl80211_iftype type); |
|---|
| 2185 | 2311 | |
|---|
| 2186 | 2312 | extern const struct ethtool_ops ieee80211_ethtool_ops; |
|---|
| 2187 | 2313 | |
|---|
| 2314 | +u32 ieee80211_calc_expected_tx_airtime(struct ieee80211_hw *hw, |
|---|
| 2315 | + struct ieee80211_vif *vif, |
|---|
| 2316 | + struct ieee80211_sta *pubsta, |
|---|
| 2317 | + int len, bool ampdu); |
|---|
| 2188 | 2318 | #ifdef CONFIG_MAC80211_NOINLINE |
|---|
| 2189 | 2319 | #define debug_noinline noinline |
|---|
| 2190 | 2320 | #else |
|---|