Orange Pi5 kernel

Deprecated Linux kernel 5.10.110 for OrangePi 5/5B/5+ boards

3 Commits   0 Branches   0 Tags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300    1) /* SPDX-License-Identifier: GPL-2.0-only */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300    2) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300    3)  * Copyright 2002-2005, Instant802 Networks, Inc.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300    4)  * Copyright 2005, Devicescape Software, Inc.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300    5)  * Copyright 2006-2007	Jiri Benc <jbenc@suse.cz>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300    6)  * Copyright 2007-2010	Johannes Berg <johannes@sipsolutions.net>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300    7)  * Copyright 2013-2015  Intel Mobile Communications GmbH
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300    8)  * Copyright (C) 2018-2020 Intel Corporation
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300    9)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   10) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   11) #ifndef IEEE80211_I_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   12) #define IEEE80211_I_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   13) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   14) #include <linux/kernel.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   15) #include <linux/device.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   16) #include <linux/if_ether.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   17) #include <linux/interrupt.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   18) #include <linux/list.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   19) #include <linux/netdevice.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   20) #include <linux/skbuff.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   21) #include <linux/workqueue.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   22) #include <linux/types.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   23) #include <linux/spinlock.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   24) #include <linux/etherdevice.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   25) #include <linux/leds.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   26) #include <linux/idr.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   27) #include <linux/rhashtable.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   28) #include <net/ieee80211_radiotap.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   29) #include <net/cfg80211.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   30) #include <net/mac80211.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   31) #include <net/fq.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   32) #include "key.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   33) #include "sta_info.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   34) #include "debug.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   35) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   36) extern const struct cfg80211_ops mac80211_config_ops;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   37) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   38) struct ieee80211_local;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   39) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   40) /* Maximum number of broadcast/multicast frames to buffer when some of the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   41)  * associated stations are using power saving. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   42) #define AP_MAX_BC_BUFFER 128
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   43) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   44) /* Maximum number of frames buffered to all STAs, including multicast frames.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   45)  * Note: increasing this limit increases the potential memory requirement. Each
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   46)  * frame can be up to about 2 kB long. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   47) #define TOTAL_MAX_TX_BUFFER 512
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   48) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   49) /* Required encryption head and tailroom */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   50) #define IEEE80211_ENCRYPT_HEADROOM 8
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   51) #define IEEE80211_ENCRYPT_TAILROOM 18
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   52) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   53) /* power level hasn't been configured (or set to automatic) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   54) #define IEEE80211_UNSET_POWER_LEVEL	INT_MIN
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   55) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   56) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   57)  * Some APs experience problems when working with U-APSD. Decreasing the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   58)  * probability of that happening by using legacy mode for all ACs but VO isn't
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   59)  * enough.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   60)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   61)  * Cisco 4410N originally forced us to enable VO by default only because it
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   62)  * treated non-VO ACs as legacy.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   63)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   64)  * However some APs (notably Netgear R7000) silently reclassify packets to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   65)  * different ACs. Since u-APSD ACs require trigger frames for frame retrieval
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   66)  * clients would never see some frames (e.g. ARP responses) or would fetch them
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   67)  * accidentally after a long time.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   68)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   69)  * It makes little sense to enable u-APSD queues by default because it needs
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   70)  * userspace applications to be aware of it to actually take advantage of the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   71)  * possible additional powersavings. Implicitly depending on driver autotrigger
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   72)  * frame support doesn't make much sense.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   73)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   74) #define IEEE80211_DEFAULT_UAPSD_QUEUES 0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   75) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   76) #define IEEE80211_DEFAULT_MAX_SP_LEN		\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   77) 	IEEE80211_WMM_IE_STA_QOSINFO_SP_ALL
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   78) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   79) extern const u8 ieee80211_ac_to_qos_mask[IEEE80211_NUM_ACS];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   80) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   81) #define IEEE80211_DEAUTH_FRAME_LEN	(24 /* hdr */ + 2 /* reason */)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   82) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   83) #define IEEE80211_MAX_NAN_INSTANCE_ID 255
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   84) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   85) struct ieee80211_bss {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   86) 	u32 device_ts_beacon, device_ts_presp;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   87) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   88) 	bool wmm_used;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   89) 	bool uapsd_supported;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   90) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   91) #define IEEE80211_MAX_SUPP_RATES 32
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   92) 	u8 supp_rates[IEEE80211_MAX_SUPP_RATES];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   93) 	size_t supp_rates_len;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   94) 	struct ieee80211_rate *beacon_rate;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   95) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   96) 	u32 vht_cap_info;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   97) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   98) 	/*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   99) 	 * During association, we save an ERP value from a probe response so
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  100) 	 * that we can feed ERP info to the driver when handling the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  101) 	 * association completes. these fields probably won't be up-to-date
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  102) 	 * otherwise, you probably don't want to use them.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  103) 	 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  104) 	bool has_erp_value;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  105) 	u8 erp_value;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  106) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  107) 	/* Keep track of the corruption of the last beacon/probe response. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  108) 	u8 corrupt_data;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  109) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  110) 	/* Keep track of what bits of information we have valid info for. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  111) 	u8 valid_data;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  112) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  113) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  114) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  115)  * enum ieee80211_corrupt_data_flags - BSS data corruption flags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  116)  * @IEEE80211_BSS_CORRUPT_BEACON: last beacon frame received was corrupted
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  117)  * @IEEE80211_BSS_CORRUPT_PROBE_RESP: last probe response received was corrupted
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  118)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  119)  * These are bss flags that are attached to a bss in the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  120)  * @corrupt_data field of &struct ieee80211_bss.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  121)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  122) enum ieee80211_bss_corrupt_data_flags {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  123) 	IEEE80211_BSS_CORRUPT_BEACON		= BIT(0),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  124) 	IEEE80211_BSS_CORRUPT_PROBE_RESP	= BIT(1)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  125) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  126) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  127) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  128)  * enum ieee80211_valid_data_flags - BSS valid data flags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  129)  * @IEEE80211_BSS_VALID_WMM: WMM/UAPSD data was gathered from non-corrupt IE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  130)  * @IEEE80211_BSS_VALID_RATES: Supported rates were gathered from non-corrupt IE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  131)  * @IEEE80211_BSS_VALID_ERP: ERP flag was gathered from non-corrupt IE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  132)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  133)  * These are bss flags that are attached to a bss in the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  134)  * @valid_data field of &struct ieee80211_bss.  They show which parts
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  135)  * of the data structure were received as a result of an un-corrupted
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  136)  * beacon/probe response.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  137)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  138) enum ieee80211_bss_valid_data_flags {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  139) 	IEEE80211_BSS_VALID_WMM			= BIT(1),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  140) 	IEEE80211_BSS_VALID_RATES		= BIT(2),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  141) 	IEEE80211_BSS_VALID_ERP			= BIT(3)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  142) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  143) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  144) typedef unsigned __bitwise ieee80211_tx_result;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  145) #define TX_CONTINUE	((__force ieee80211_tx_result) 0u)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  146) #define TX_DROP		((__force ieee80211_tx_result) 1u)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  147) #define TX_QUEUED	((__force ieee80211_tx_result) 2u)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  148) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  149) #define IEEE80211_TX_UNICAST		BIT(1)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  150) #define IEEE80211_TX_PS_BUFFERED	BIT(2)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  151) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  152) struct ieee80211_tx_data {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  153) 	struct sk_buff *skb;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  154) 	struct sk_buff_head skbs;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  155) 	struct ieee80211_local *local;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  156) 	struct ieee80211_sub_if_data *sdata;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  157) 	struct sta_info *sta;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  158) 	struct ieee80211_key *key;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  159) 	struct ieee80211_tx_rate rate;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  160) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  161) 	unsigned int flags;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  162) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  163) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  164) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  165) typedef unsigned __bitwise ieee80211_rx_result;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  166) #define RX_CONTINUE		((__force ieee80211_rx_result) 0u)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  167) #define RX_DROP_UNUSABLE	((__force ieee80211_rx_result) 1u)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  168) #define RX_DROP_MONITOR		((__force ieee80211_rx_result) 2u)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  169) #define RX_QUEUED		((__force ieee80211_rx_result) 3u)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  170) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  171) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  172)  * enum ieee80211_packet_rx_flags - packet RX flags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  173)  * @IEEE80211_RX_AMSDU: a-MSDU packet
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  174)  * @IEEE80211_RX_MALFORMED_ACTION_FRM: action frame is malformed
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  175)  * @IEEE80211_RX_DEFERRED_RELEASE: frame was subjected to receive reordering
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  176)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  177)  * These are per-frame flags that are attached to a frame in the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  178)  * @rx_flags field of &struct ieee80211_rx_status.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  179)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  180) enum ieee80211_packet_rx_flags {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  181) 	IEEE80211_RX_AMSDU			= BIT(3),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  182) 	IEEE80211_RX_MALFORMED_ACTION_FRM	= BIT(4),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  183) 	IEEE80211_RX_DEFERRED_RELEASE		= BIT(5),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  184) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  185) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  186) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  187)  * enum ieee80211_rx_flags - RX data flags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  188)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  189)  * @IEEE80211_RX_CMNTR: received on cooked monitor already
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  190)  * @IEEE80211_RX_BEACON_REPORTED: This frame was already reported
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  191)  *	to cfg80211_report_obss_beacon().
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  192)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  193)  * These flags are used across handling multiple interfaces
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  194)  * for a single frame.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  195)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  196) enum ieee80211_rx_flags {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  197) 	IEEE80211_RX_CMNTR		= BIT(0),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  198) 	IEEE80211_RX_BEACON_REPORTED	= BIT(1),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  199) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  200) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  201) struct ieee80211_rx_data {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  202) 	struct list_head *list;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  203) 	struct sk_buff *skb;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  204) 	struct ieee80211_local *local;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  205) 	struct ieee80211_sub_if_data *sdata;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  206) 	struct sta_info *sta;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  207) 	struct ieee80211_key *key;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  208) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  209) 	unsigned int flags;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  210) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  211) 	/*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  212) 	 * Index into sequence numbers array, 0..16
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  213) 	 * since the last (16) is used for non-QoS,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  214) 	 * will be 16 on non-QoS frames.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  215) 	 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  216) 	int seqno_idx;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  217) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  218) 	/*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  219) 	 * Index into the security IV/PN arrays, 0..16
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  220) 	 * since the last (16) is used for CCMP-encrypted
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  221) 	 * management frames, will be set to 16 on mgmt
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  222) 	 * frames and 0 on non-QoS frames.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  223) 	 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  224) 	int security_idx;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  225) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  226) 	union {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  227) 		struct {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  228) 			u32 iv32;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  229) 			u16 iv16;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  230) 		} tkip;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  231) 		struct {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  232) 			u8 pn[IEEE80211_CCMP_PN_LEN];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  233) 		} ccm_gcm;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  234) 	};
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  235) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  236) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  237) struct ieee80211_csa_settings {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  238) 	const u16 *counter_offsets_beacon;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  239) 	const u16 *counter_offsets_presp;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  240) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  241) 	int n_counter_offsets_beacon;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  242) 	int n_counter_offsets_presp;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  243) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  244) 	u8 count;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  245) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  246) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  247) struct beacon_data {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  248) 	u8 *head, *tail;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  249) 	int head_len, tail_len;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  250) 	struct ieee80211_meshconf_ie *meshconf;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  251) 	u16 cntdwn_counter_offsets[IEEE80211_MAX_CNTDWN_COUNTERS_NUM];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  252) 	u8 cntdwn_current_counter;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  253) 	struct rcu_head rcu_head;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  254) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  255) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  256) struct probe_resp {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  257) 	struct rcu_head rcu_head;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  258) 	int len;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  259) 	u16 cntdwn_counter_offsets[IEEE80211_MAX_CNTDWN_COUNTERS_NUM];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  260) 	u8 data[];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  261) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  262) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  263) struct fils_discovery_data {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  264) 	struct rcu_head rcu_head;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  265) 	int len;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  266) 	u8 data[];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  267) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  268) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  269) struct unsol_bcast_probe_resp_data {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  270) 	struct rcu_head rcu_head;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  271) 	int len;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  272) 	u8 data[];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  273) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  274) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  275) struct ps_data {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  276) 	/* yes, this looks ugly, but guarantees that we can later use
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  277) 	 * bitmap_empty :)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  278) 	 * NB: don't touch this bitmap, use sta_info_{set,clear}_tim_bit */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  279) 	u8 tim[sizeof(unsigned long) * BITS_TO_LONGS(IEEE80211_MAX_AID + 1)]
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  280) 			__aligned(__alignof__(unsigned long));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  281) 	struct sk_buff_head bc_buf;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  282) 	atomic_t num_sta_ps; /* number of stations in PS mode */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  283) 	int dtim_count;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  284) 	bool dtim_bc_mc;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  285) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  286) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  287) struct ieee80211_if_ap {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  288) 	struct beacon_data __rcu *beacon;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  289) 	struct probe_resp __rcu *probe_resp;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  290) 	struct fils_discovery_data __rcu *fils_discovery;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  291) 	struct unsol_bcast_probe_resp_data __rcu *unsol_bcast_probe_resp;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  292) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  293) 	/* to be used after channel switch. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  294) 	struct cfg80211_beacon_data *next_beacon;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  295) 	struct list_head vlans; /* write-protected with RTNL and local->mtx */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  296) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  297) 	struct ps_data ps;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  298) 	atomic_t num_mcast_sta; /* number of stations receiving multicast */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  299) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  300) 	bool multicast_to_unicast;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  301) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  302) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  303) struct ieee80211_if_wds {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  304) 	struct sta_info *sta;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  305) 	u8 remote_addr[ETH_ALEN];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  306) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  307) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  308) struct ieee80211_if_vlan {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  309) 	struct list_head list; /* write-protected with RTNL and local->mtx */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  310) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  311) 	/* used for all tx if the VLAN is configured to 4-addr mode */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  312) 	struct sta_info __rcu *sta;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  313) 	atomic_t num_mcast_sta; /* number of stations receiving multicast */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  314) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  315) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  316) struct mesh_stats {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  317) 	__u32 fwded_mcast;		/* Mesh forwarded multicast frames */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  318) 	__u32 fwded_unicast;		/* Mesh forwarded unicast frames */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  319) 	__u32 fwded_frames;		/* Mesh total forwarded frames */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  320) 	__u32 dropped_frames_ttl;	/* Not transmitted since mesh_ttl == 0*/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  321) 	__u32 dropped_frames_no_route;	/* Not transmitted, no route found */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  322) 	__u32 dropped_frames_congestion;/* Not forwarded due to congestion */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  323) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  324) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  325) #define PREQ_Q_F_START		0x1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  326) #define PREQ_Q_F_REFRESH	0x2
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  327) struct mesh_preq_queue {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  328) 	struct list_head list;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  329) 	u8 dst[ETH_ALEN];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  330) 	u8 flags;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  331) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  332) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  333) struct ieee80211_roc_work {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  334) 	struct list_head list;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  335) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  336) 	struct ieee80211_sub_if_data *sdata;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  337) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  338) 	struct ieee80211_channel *chan;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  339) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  340) 	bool started, abort, hw_begun, notified;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  341) 	bool on_channel;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  342) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  343) 	unsigned long start_time;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  344) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  345) 	u32 duration, req_duration;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  346) 	struct sk_buff *frame;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  347) 	u64 cookie, mgmt_tx_cookie;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  348) 	enum ieee80211_roc_type type;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  349) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  350) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  351) /* flags used in struct ieee80211_if_managed.flags */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  352) enum ieee80211_sta_flags {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  353) 	IEEE80211_STA_CONNECTION_POLL	= BIT(1),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  354) 	IEEE80211_STA_CONTROL_PORT	= BIT(2),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  355) 	IEEE80211_STA_DISABLE_HT	= BIT(4),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  356) 	IEEE80211_STA_MFP_ENABLED	= BIT(6),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  357) 	IEEE80211_STA_UAPSD_ENABLED	= BIT(7),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  358) 	IEEE80211_STA_NULLFUNC_ACKED	= BIT(8),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  359) 	IEEE80211_STA_RESET_SIGNAL_AVE	= BIT(9),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  360) 	IEEE80211_STA_DISABLE_40MHZ	= BIT(10),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  361) 	IEEE80211_STA_DISABLE_VHT	= BIT(11),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  362) 	IEEE80211_STA_DISABLE_80P80MHZ	= BIT(12),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  363) 	IEEE80211_STA_DISABLE_160MHZ	= BIT(13),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  364) 	IEEE80211_STA_DISABLE_WMM	= BIT(14),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  365) 	IEEE80211_STA_ENABLE_RRM	= BIT(15),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  366) 	IEEE80211_STA_DISABLE_HE	= BIT(16),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  367) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  368) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  369) struct ieee80211_mgd_auth_data {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  370) 	struct cfg80211_bss *bss;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  371) 	unsigned long timeout;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  372) 	int tries;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  373) 	u16 algorithm, expected_transaction;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  374) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  375) 	u8 key[WLAN_KEY_LEN_WEP104];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  376) 	u8 key_len, key_idx;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  377) 	bool done, waiting;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  378) 	bool peer_confirmed;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  379) 	bool timeout_started;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  380) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  381) 	u16 sae_trans, sae_status;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  382) 	size_t data_len;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  383) 	u8 data[];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  384) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  385) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  386) struct ieee80211_mgd_assoc_data {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  387) 	struct cfg80211_bss *bss;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  388) 	const u8 *supp_rates;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  389) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  390) 	unsigned long timeout;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  391) 	int tries;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  392) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  393) 	u16 capability;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  394) 	u8 prev_bssid[ETH_ALEN];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  395) 	u8 ssid[IEEE80211_MAX_SSID_LEN];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  396) 	u8 ssid_len;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  397) 	u8 supp_rates_len;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  398) 	bool wmm, uapsd;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  399) 	bool need_beacon;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  400) 	bool synced;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  401) 	bool timeout_started;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  402) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  403) 	u8 ap_ht_param;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  404) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  405) 	struct ieee80211_vht_cap ap_vht_cap;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  406) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  407) 	u8 fils_nonces[2 * FILS_NONCE_LEN];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  408) 	u8 fils_kek[FILS_MAX_KEK_LEN];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  409) 	size_t fils_kek_len;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  410) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  411) 	size_t ie_len;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  412) 	u8 ie[];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  413) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  414) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  415) struct ieee80211_sta_tx_tspec {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  416) 	/* timestamp of the first packet in the time slice */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  417) 	unsigned long time_slice_start;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  418) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  419) 	u32 admitted_time; /* in usecs, unlike over the air */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  420) 	u8 tsid;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  421) 	s8 up; /* signed to be able to invalidate with -1 during teardown */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  422) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  423) 	/* consumed TX time in microseconds in the time slice */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  424) 	u32 consumed_tx_time;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  425) 	enum {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  426) 		TX_TSPEC_ACTION_NONE = 0,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  427) 		TX_TSPEC_ACTION_DOWNGRADE,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  428) 		TX_TSPEC_ACTION_STOP_DOWNGRADE,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  429) 	} action;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  430) 	bool downgraded;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  431) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  432) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  433) DECLARE_EWMA(beacon_signal, 4, 4)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  434) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  435) struct ieee80211_if_managed {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  436) 	struct timer_list timer;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  437) 	struct timer_list conn_mon_timer;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  438) 	struct timer_list bcn_mon_timer;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  439) 	struct timer_list chswitch_timer;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  440) 	struct work_struct monitor_work;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  441) 	struct work_struct chswitch_work;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  442) 	struct work_struct beacon_connection_loss_work;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  443) 	struct work_struct csa_connection_drop_work;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  444) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  445) 	unsigned long beacon_timeout;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  446) 	unsigned long probe_timeout;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  447) 	int probe_send_count;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  448) 	bool nullfunc_failed;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  449) 	bool connection_loss;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  450) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  451) 	struct cfg80211_bss *associated;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  452) 	struct ieee80211_mgd_auth_data *auth_data;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  453) 	struct ieee80211_mgd_assoc_data *assoc_data;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  454) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  455) 	u8 bssid[ETH_ALEN] __aligned(2);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  456) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  457) 	bool powersave; /* powersave requested for this iface */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  458) 	bool broken_ap; /* AP is broken -- turn off powersave */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  459) 	bool have_beacon;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  460) 	u8 dtim_period;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  461) 	enum ieee80211_smps_mode req_smps, /* requested smps mode */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  462) 				 driver_smps_mode; /* smps mode request */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  463) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  464) 	struct work_struct request_smps_work;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  465) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  466) 	unsigned int flags;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  467) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  468) 	bool csa_waiting_bcn;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  469) 	bool csa_ignored_same_chan;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  470) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  471) 	bool beacon_crc_valid;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  472) 	u32 beacon_crc;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  473) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  474) 	bool status_acked;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  475) 	bool status_received;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  476) 	__le16 status_fc;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  477) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  478) 	enum {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  479) 		IEEE80211_MFP_DISABLED,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  480) 		IEEE80211_MFP_OPTIONAL,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  481) 		IEEE80211_MFP_REQUIRED
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  482) 	} mfp; /* management frame protection */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  483) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  484) 	/*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  485) 	 * Bitmask of enabled u-apsd queues,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  486) 	 * IEEE80211_WMM_IE_STA_QOSINFO_AC_BE & co. Needs a new association
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  487) 	 * to take effect.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  488) 	 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  489) 	unsigned int uapsd_queues;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  490) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  491) 	/*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  492) 	 * Maximum number of buffered frames AP can deliver during a
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  493) 	 * service period, IEEE80211_WMM_IE_STA_QOSINFO_SP_ALL or similar.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  494) 	 * Needs a new association to take effect.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  495) 	 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  496) 	unsigned int uapsd_max_sp_len;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  497) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  498) 	int wmm_last_param_set;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  499) 	int mu_edca_last_param_set;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  500) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  501) 	u8 use_4addr;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  502) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  503) 	s16 p2p_noa_index;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  504) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  505) 	struct ewma_beacon_signal ave_beacon_signal;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  506) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  507) 	/*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  508) 	 * Number of Beacon frames used in ave_beacon_signal. This can be used
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  509) 	 * to avoid generating less reliable cqm events that would be based
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  510) 	 * only on couple of received frames.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  511) 	 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  512) 	unsigned int count_beacon_signal;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  513) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  514) 	/* Number of times beacon loss was invoked. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  515) 	unsigned int beacon_loss_count;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  516) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  517) 	/*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  518) 	 * Last Beacon frame signal strength average (ave_beacon_signal / 16)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  519) 	 * that triggered a cqm event. 0 indicates that no event has been
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  520) 	 * generated for the current association.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  521) 	 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  522) 	int last_cqm_event_signal;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  523) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  524) 	/*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  525) 	 * State variables for keeping track of RSSI of the AP currently
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  526) 	 * connected to and informing driver when RSSI has gone
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  527) 	 * below/above a certain threshold.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  528) 	 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  529) 	int rssi_min_thold, rssi_max_thold;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  530) 	int last_ave_beacon_signal;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  531) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  532) 	struct ieee80211_ht_cap ht_capa; /* configured ht-cap over-rides */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  533) 	struct ieee80211_ht_cap ht_capa_mask; /* Valid parts of ht_capa */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  534) 	struct ieee80211_vht_cap vht_capa; /* configured VHT overrides */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  535) 	struct ieee80211_vht_cap vht_capa_mask; /* Valid parts of vht_capa */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  536) 	struct ieee80211_s1g_cap s1g_capa; /* configured S1G overrides */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  537) 	struct ieee80211_s1g_cap s1g_capa_mask; /* valid s1g_capa bits */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  538) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  539) 	/* TDLS support */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  540) 	u8 tdls_peer[ETH_ALEN] __aligned(2);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  541) 	struct delayed_work tdls_peer_del_work;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  542) 	struct sk_buff *orig_teardown_skb; /* The original teardown skb */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  543) 	struct sk_buff *teardown_skb; /* A copy to send through the AP */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  544) 	spinlock_t teardown_lock; /* To lock changing teardown_skb */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  545) 	bool tdls_chan_switch_prohibited;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  546) 	bool tdls_wider_bw_prohibited;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  547) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  548) 	/* WMM-AC TSPEC support */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  549) 	struct ieee80211_sta_tx_tspec tx_tspec[IEEE80211_NUM_ACS];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  550) 	/* Use a separate work struct so that we can do something here
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  551) 	 * while the sdata->work is flushing the queues, for example.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  552) 	 * otherwise, in scenarios where we hardly get any traffic out
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  553) 	 * on the BE queue, but there's a lot of VO traffic, we might
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  554) 	 * get stuck in a downgraded situation and flush takes forever.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  555) 	 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  556) 	struct delayed_work tx_tspec_wk;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  557) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  558) 	/* Information elements from the last transmitted (Re)Association
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  559) 	 * Request frame.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  560) 	 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  561) 	u8 *assoc_req_ies;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  562) 	size_t assoc_req_ies_len;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  563) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  564) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  565) struct ieee80211_if_ibss {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  566) 	struct timer_list timer;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  567) 	struct work_struct csa_connection_drop_work;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  568) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  569) 	unsigned long last_scan_completed;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  570) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  571) 	u32 basic_rates;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  572) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  573) 	bool fixed_bssid;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  574) 	bool fixed_channel;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  575) 	bool privacy;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  576) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  577) 	bool control_port;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  578) 	bool userspace_handles_dfs;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  579) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  580) 	u8 bssid[ETH_ALEN] __aligned(2);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  581) 	u8 ssid[IEEE80211_MAX_SSID_LEN];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  582) 	u8 ssid_len, ie_len;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  583) 	u8 *ie;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  584) 	struct cfg80211_chan_def chandef;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  585) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  586) 	unsigned long ibss_join_req;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  587) 	/* probe response/beacon for IBSS */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  588) 	struct beacon_data __rcu *presp;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  589) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  590) 	struct ieee80211_ht_cap ht_capa; /* configured ht-cap over-rides */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  591) 	struct ieee80211_ht_cap ht_capa_mask; /* Valid parts of ht_capa */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  592) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  593) 	spinlock_t incomplete_lock;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  594) 	struct list_head incomplete_stations;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  595) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  596) 	enum {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  597) 		IEEE80211_IBSS_MLME_SEARCH,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  598) 		IEEE80211_IBSS_MLME_JOINED,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  599) 	} state;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  600) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  601) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  602) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  603)  * struct ieee80211_if_ocb - OCB mode state
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  604)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  605)  * @housekeeping_timer: timer for periodic invocation of a housekeeping task
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  606)  * @wrkq_flags: OCB deferred task action
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  607)  * @incomplete_lock: delayed STA insertion lock
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  608)  * @incomplete_stations: list of STAs waiting for delayed insertion
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  609)  * @joined: indication if the interface is connected to an OCB network
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  610)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  611) struct ieee80211_if_ocb {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  612) 	struct timer_list housekeeping_timer;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  613) 	unsigned long wrkq_flags;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  614) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  615) 	spinlock_t incomplete_lock;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  616) 	struct list_head incomplete_stations;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  617) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  618) 	bool joined;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  619) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  620) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  621) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  622)  * struct ieee80211_mesh_sync_ops - Extensible synchronization framework interface
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  623)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  624)  * these declarations define the interface, which enables
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  625)  * vendor-specific mesh synchronization
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  626)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  627)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  628) struct ieee802_11_elems;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  629) struct ieee80211_mesh_sync_ops {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  630) 	void (*rx_bcn_presp)(struct ieee80211_sub_if_data *sdata,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  631) 			     u16 stype,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  632) 			     struct ieee80211_mgmt *mgmt,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  633) 			     struct ieee802_11_elems *elems,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  634) 			     struct ieee80211_rx_status *rx_status);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  635) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  636) 	/* should be called with beacon_data under RCU read lock */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  637) 	void (*adjust_tsf)(struct ieee80211_sub_if_data *sdata,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  638) 			   struct beacon_data *beacon);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  639) 	/* add other framework functions here */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  640) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  641) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  642) struct mesh_csa_settings {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  643) 	struct rcu_head rcu_head;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  644) 	struct cfg80211_csa_settings settings;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  645) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  646) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  647) struct ieee80211_if_mesh {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  648) 	struct timer_list housekeeping_timer;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  649) 	struct timer_list mesh_path_timer;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  650) 	struct timer_list mesh_path_root_timer;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  651) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  652) 	unsigned long wrkq_flags;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  653) 	unsigned long mbss_changed;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  654) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  655) 	bool userspace_handles_dfs;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  656) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  657) 	u8 mesh_id[IEEE80211_MAX_MESH_ID_LEN];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  658) 	size_t mesh_id_len;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  659) 	/* Active Path Selection Protocol Identifier */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  660) 	u8 mesh_pp_id;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  661) 	/* Active Path Selection Metric Identifier */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  662) 	u8 mesh_pm_id;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  663) 	/* Congestion Control Mode Identifier */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  664) 	u8 mesh_cc_id;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  665) 	/* Synchronization Protocol Identifier */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  666) 	u8 mesh_sp_id;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  667) 	/* Authentication Protocol Identifier */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  668) 	u8 mesh_auth_id;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  669) 	/* Local mesh Sequence Number */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  670) 	u32 sn;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  671) 	/* Last used PREQ ID */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  672) 	u32 preq_id;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  673) 	atomic_t mpaths;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  674) 	/* Timestamp of last SN update */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  675) 	unsigned long last_sn_update;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  676) 	/* Time when it's ok to send next PERR */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  677) 	unsigned long next_perr;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  678) 	/* Timestamp of last PREQ sent */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  679) 	unsigned long last_preq;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  680) 	struct mesh_rmc *rmc;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  681) 	spinlock_t mesh_preq_queue_lock;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  682) 	struct mesh_preq_queue preq_queue;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  683) 	int preq_queue_len;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  684) 	struct mesh_stats mshstats;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  685) 	struct mesh_config mshcfg;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  686) 	atomic_t estab_plinks;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  687) 	u32 mesh_seqnum;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  688) 	bool accepting_plinks;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  689) 	int num_gates;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  690) 	struct beacon_data __rcu *beacon;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  691) 	const u8 *ie;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  692) 	u8 ie_len;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  693) 	enum {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  694) 		IEEE80211_MESH_SEC_NONE = 0x0,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  695) 		IEEE80211_MESH_SEC_AUTHED = 0x1,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  696) 		IEEE80211_MESH_SEC_SECURED = 0x2,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  697) 	} security;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  698) 	bool user_mpm;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  699) 	/* Extensible Synchronization Framework */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  700) 	const struct ieee80211_mesh_sync_ops *sync_ops;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  701) 	s64 sync_offset_clockdrift_max;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  702) 	spinlock_t sync_offset_lock;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  703) 	/* mesh power save */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  704) 	enum nl80211_mesh_power_mode nonpeer_pm;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  705) 	int ps_peers_light_sleep;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  706) 	int ps_peers_deep_sleep;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  707) 	struct ps_data ps;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  708) 	/* Channel Switching Support */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  709) 	struct mesh_csa_settings __rcu *csa;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  710) 	enum {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  711) 		IEEE80211_MESH_CSA_ROLE_NONE,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  712) 		IEEE80211_MESH_CSA_ROLE_INIT,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  713) 		IEEE80211_MESH_CSA_ROLE_REPEATER,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  714) 	} csa_role;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  715) 	u8 chsw_ttl;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  716) 	u16 pre_value;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  717) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  718) 	/* offset from skb->data while building IE */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  719) 	int meshconf_offset;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  720) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  721) 	struct mesh_table *mesh_paths;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  722) 	struct mesh_table *mpp_paths; /* Store paths for MPP&MAP */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  723) 	int mesh_paths_generation;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  724) 	int mpp_paths_generation;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  725) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  726) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  727) #ifdef CONFIG_MAC80211_MESH
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  728) #define IEEE80211_IFSTA_MESH_CTR_INC(msh, name)	\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  729) 	do { (msh)->mshstats.name++; } while (0)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  730) #else
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  731) #define IEEE80211_IFSTA_MESH_CTR_INC(msh, name) \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  732) 	do { } while (0)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  733) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  734) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  735) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  736)  * enum ieee80211_sub_if_data_flags - virtual interface flags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  737)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  738)  * @IEEE80211_SDATA_ALLMULTI: interface wants all multicast packets
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  739)  * @IEEE80211_SDATA_OPERATING_GMODE: operating in G-only mode
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  740)  * @IEEE80211_SDATA_DONT_BRIDGE_PACKETS: bridge packets between
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  741)  *	associated stations and deliver multicast frames both
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  742)  *	back to wireless media and to the local net stack.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  743)  * @IEEE80211_SDATA_DISCONNECT_RESUME: Disconnect after resume.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  744)  * @IEEE80211_SDATA_IN_DRIVER: indicates interface was added to driver
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  745)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  746) enum ieee80211_sub_if_data_flags {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  747) 	IEEE80211_SDATA_ALLMULTI		= BIT(0),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  748) 	IEEE80211_SDATA_OPERATING_GMODE		= BIT(2),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  749) 	IEEE80211_SDATA_DONT_BRIDGE_PACKETS	= BIT(3),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  750) 	IEEE80211_SDATA_DISCONNECT_RESUME	= BIT(4),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  751) 	IEEE80211_SDATA_IN_DRIVER		= BIT(5),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  752) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  753) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  754) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  755)  * enum ieee80211_sdata_state_bits - virtual interface state bits
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  756)  * @SDATA_STATE_RUNNING: virtual interface is up & running; this
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  757)  *	mirrors netif_running() but is separate for interface type
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  758)  *	change handling while the interface is up
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  759)  * @SDATA_STATE_OFFCHANNEL: This interface is currently in offchannel
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  760)  *	mode, so queues are stopped
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  761)  * @SDATA_STATE_OFFCHANNEL_BEACON_STOPPED: Beaconing was stopped due
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  762)  *	to offchannel, reset when offchannel returns
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  763)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  764) enum ieee80211_sdata_state_bits {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  765) 	SDATA_STATE_RUNNING,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  766) 	SDATA_STATE_OFFCHANNEL,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  767) 	SDATA_STATE_OFFCHANNEL_BEACON_STOPPED,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  768) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  769) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  770) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  771)  * enum ieee80211_chanctx_mode - channel context configuration mode
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  772)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  773)  * @IEEE80211_CHANCTX_SHARED: channel context may be used by
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  774)  *	multiple interfaces
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  775)  * @IEEE80211_CHANCTX_EXCLUSIVE: channel context can be used
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  776)  *	only by a single interface. This can be used for example for
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  777)  *	non-fixed channel IBSS.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  778)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  779) enum ieee80211_chanctx_mode {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  780) 	IEEE80211_CHANCTX_SHARED,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  781) 	IEEE80211_CHANCTX_EXCLUSIVE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  782) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  783) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  784) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  785)  * enum ieee80211_chanctx_replace_state - channel context replacement state
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  786)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  787)  * This is used for channel context in-place reservations that require channel
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  788)  * context switch/swap.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  789)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  790)  * @IEEE80211_CHANCTX_REPLACE_NONE: no replacement is taking place
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  791)  * @IEEE80211_CHANCTX_WILL_BE_REPLACED: this channel context will be replaced
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  792)  *	by a (not yet registered) channel context pointed by %replace_ctx.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  793)  * @IEEE80211_CHANCTX_REPLACES_OTHER: this (not yet registered) channel context
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  794)  *	replaces an existing channel context pointed to by %replace_ctx.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  795)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  796) enum ieee80211_chanctx_replace_state {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  797) 	IEEE80211_CHANCTX_REPLACE_NONE,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  798) 	IEEE80211_CHANCTX_WILL_BE_REPLACED,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  799) 	IEEE80211_CHANCTX_REPLACES_OTHER,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  800) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  801) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  802) struct ieee80211_chanctx {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  803) 	struct list_head list;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  804) 	struct rcu_head rcu_head;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  805) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  806) 	struct list_head assigned_vifs;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  807) 	struct list_head reserved_vifs;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  808) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  809) 	enum ieee80211_chanctx_replace_state replace_state;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  810) 	struct ieee80211_chanctx *replace_ctx;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  811) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  812) 	enum ieee80211_chanctx_mode mode;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  813) 	bool driver_present;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  814) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  815) 	struct ieee80211_chanctx_conf conf;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  816) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  817) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  818) struct mac80211_qos_map {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  819) 	struct cfg80211_qos_map qos_map;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  820) 	struct rcu_head rcu_head;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  821) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  822) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  823) enum txq_info_flags {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  824) 	IEEE80211_TXQ_STOP,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  825) 	IEEE80211_TXQ_AMPDU,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  826) 	IEEE80211_TXQ_NO_AMSDU,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  827) 	IEEE80211_TXQ_STOP_NETIF_TX,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  828) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  829) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  830) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  831)  * struct txq_info - per tid queue
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  832)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  833)  * @tin: contains packets split into multiple flows
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  834)  * @def_flow: used as a fallback flow when a packet destined to @tin hashes to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  835)  *	a fq_flow which is already owned by a different tin
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  836)  * @def_cvars: codel vars for @def_flow
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  837)  * @frags: used to keep fragments created after dequeue
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  838)  * @schedule_order: used with ieee80211_local->active_txqs
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  839)  * @schedule_round: counter to prevent infinite loops on TXQ scheduling
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  840)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  841) struct txq_info {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  842) 	struct fq_tin tin;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  843) 	struct fq_flow def_flow;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  844) 	struct codel_vars def_cvars;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  845) 	struct codel_stats cstats;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  846) 	struct sk_buff_head frags;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  847) 	struct list_head schedule_order;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  848) 	u16 schedule_round;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  849) 	unsigned long flags;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  850) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  851) 	/* keep last! */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  852) 	struct ieee80211_txq txq;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  853) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  854) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  855) struct ieee80211_if_mntr {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  856) 	u32 flags;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  857) 	u8 mu_follow_addr[ETH_ALEN] __aligned(2);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  858) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  859) 	struct list_head list;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  860) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  861) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  862) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  863)  * struct ieee80211_if_nan - NAN state
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  864)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  865)  * @conf: current NAN configuration
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  866)  * @func_ids: a bitmap of available instance_id's
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  867)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  868) struct ieee80211_if_nan {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  869) 	struct cfg80211_nan_conf conf;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  870) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  871) 	/* protects function_inst_ids */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  872) 	spinlock_t func_lock;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  873) 	struct idr function_inst_ids;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  874) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  875) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  876) struct ieee80211_sub_if_data {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  877) 	struct list_head list;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  878) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  879) 	struct wireless_dev wdev;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  880) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  881) 	/* keys */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  882) 	struct list_head key_list;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  883) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  884) 	/* count for keys needing tailroom space allocation */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  885) 	int crypto_tx_tailroom_needed_cnt;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  886) 	int crypto_tx_tailroom_pending_dec;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  887) 	struct delayed_work dec_tailroom_needed_wk;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  888) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  889) 	struct net_device *dev;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  890) 	struct ieee80211_local *local;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  891) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  892) 	unsigned int flags;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  893) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  894) 	unsigned long state;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  895) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  896) 	char name[IFNAMSIZ];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  897) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  898) 	struct ieee80211_fragment_cache frags;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  899) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  900) 	/* TID bitmap for NoAck policy */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  901) 	u16 noack_map;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  902) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  903) 	/* bit field of ACM bits (BIT(802.1D tag)) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  904) 	u8 wmm_acm;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  905) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  906) 	struct ieee80211_key __rcu *keys[NUM_DEFAULT_KEYS +
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  907) 					 NUM_DEFAULT_MGMT_KEYS +
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  908) 					 NUM_DEFAULT_BEACON_KEYS];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  909) 	struct ieee80211_key __rcu *default_unicast_key;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  910) 	struct ieee80211_key __rcu *default_multicast_key;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  911) 	struct ieee80211_key __rcu *default_mgmt_key;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  912) 	struct ieee80211_key __rcu *default_beacon_key;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  913) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  914) 	u16 sequence_number;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  915) 	__be16 control_port_protocol;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  916) 	bool control_port_no_encrypt;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  917) 	bool control_port_no_preauth;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  918) 	bool control_port_over_nl80211;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  919) 	int encrypt_headroom;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  920) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  921) 	atomic_t num_tx_queued;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  922) 	struct ieee80211_tx_queue_params tx_conf[IEEE80211_NUM_ACS];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  923) 	struct mac80211_qos_map __rcu *qos_map;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  924) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  925) 	struct work_struct csa_finalize_work;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  926) 	bool csa_block_tx; /* write-protected by sdata_lock and local->mtx */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  927) 	struct cfg80211_chan_def csa_chandef;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  928) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  929) 	struct list_head assigned_chanctx_list; /* protected by chanctx_mtx */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  930) 	struct list_head reserved_chanctx_list; /* protected by chanctx_mtx */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  931) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  932) 	/* context reservation -- protected with chanctx_mtx */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  933) 	struct ieee80211_chanctx *reserved_chanctx;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  934) 	struct cfg80211_chan_def reserved_chandef;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  935) 	bool reserved_radar_required;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  936) 	bool reserved_ready;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  937) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  938) 	/* used to reconfigure hardware SM PS */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  939) 	struct work_struct recalc_smps;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  940) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  941) 	struct work_struct work;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  942) 	struct sk_buff_head skb_queue;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  943) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  944) 	u8 needed_rx_chains;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  945) 	enum ieee80211_smps_mode smps_mode;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  946) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  947) 	int user_power_level; /* in dBm */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  948) 	int ap_power_level; /* in dBm */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  949) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  950) 	bool radar_required;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  951) 	struct delayed_work dfs_cac_timer_work;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  952) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  953) 	/*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  954) 	 * AP this belongs to: self in AP mode and
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  955) 	 * corresponding AP in VLAN mode, NULL for
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  956) 	 * all others (might be needed later in IBSS)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  957) 	 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  958) 	struct ieee80211_if_ap *bss;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  959) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  960) 	/* bitmap of allowed (non-MCS) rate indexes for rate control */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  961) 	u32 rc_rateidx_mask[NUM_NL80211_BANDS];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  962) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  963) 	bool rc_has_mcs_mask[NUM_NL80211_BANDS];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  964) 	u8  rc_rateidx_mcs_mask[NUM_NL80211_BANDS][IEEE80211_HT_MCS_MASK_LEN];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  965) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  966) 	bool rc_has_vht_mcs_mask[NUM_NL80211_BANDS];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  967) 	u16 rc_rateidx_vht_mcs_mask[NUM_NL80211_BANDS][NL80211_VHT_NSS_MAX];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  968) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  969) 	/* Beacon frame (non-MCS) rate (as a bitmap) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  970) 	u32 beacon_rateidx_mask[NUM_NL80211_BANDS];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  971) 	bool beacon_rate_set;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  972) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  973) 	union {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  974) 		struct ieee80211_if_ap ap;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  975) 		struct ieee80211_if_wds wds;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  976) 		struct ieee80211_if_vlan vlan;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  977) 		struct ieee80211_if_managed mgd;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  978) 		struct ieee80211_if_ibss ibss;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  979) 		struct ieee80211_if_mesh mesh;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  980) 		struct ieee80211_if_ocb ocb;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  981) 		struct ieee80211_if_mntr mntr;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  982) 		struct ieee80211_if_nan nan;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  983) 	} u;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  984) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  985) #ifdef CONFIG_MAC80211_DEBUGFS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  986) 	struct {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  987) 		struct dentry *subdir_stations;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  988) 		struct dentry *default_unicast_key;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  989) 		struct dentry *default_multicast_key;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  990) 		struct dentry *default_mgmt_key;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  991) 		struct dentry *default_beacon_key;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  992) 	} debugfs;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  993) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  994) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  995) 	/* must be last, dynamically sized area in this! */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  996) 	struct ieee80211_vif vif;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  997) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  998) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  999) static inline
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1000) struct ieee80211_sub_if_data *vif_to_sdata(struct ieee80211_vif *p)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1001) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1002) 	return container_of(p, struct ieee80211_sub_if_data, vif);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1003) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1004) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1005) static inline void sdata_lock(struct ieee80211_sub_if_data *sdata)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1006) 	__acquires(&sdata->wdev.mtx)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1007) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1008) 	mutex_lock(&sdata->wdev.mtx);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1009) 	__acquire(&sdata->wdev.mtx);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1010) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1011) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1012) static inline void sdata_unlock(struct ieee80211_sub_if_data *sdata)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1013) 	__releases(&sdata->wdev.mtx)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1014) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1015) 	mutex_unlock(&sdata->wdev.mtx);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1016) 	__release(&sdata->wdev.mtx);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1017) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1018) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1019) #define sdata_dereference(p, sdata) \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1020) 	rcu_dereference_protected(p, lockdep_is_held(&sdata->wdev.mtx))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1021) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1022) static inline void
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1023) sdata_assert_lock(struct ieee80211_sub_if_data *sdata)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1024) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1025) 	lockdep_assert_held(&sdata->wdev.mtx);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1026) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1027) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1028) static inline int
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1029) ieee80211_chandef_get_shift(struct cfg80211_chan_def *chandef)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1030) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1031) 	switch (chandef->width) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1032) 	case NL80211_CHAN_WIDTH_5:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1033) 		return 2;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1034) 	case NL80211_CHAN_WIDTH_10:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1035) 		return 1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1036) 	default:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1037) 		return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1038) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1039) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1040) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1041) static inline int
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1042) ieee80211_vif_get_shift(struct ieee80211_vif *vif)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1043) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1044) 	struct ieee80211_chanctx_conf *chanctx_conf;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1045) 	int shift = 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1046) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1047) 	rcu_read_lock();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1048) 	chanctx_conf = rcu_dereference(vif->chanctx_conf);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1049) 	if (chanctx_conf)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1050) 		shift = ieee80211_chandef_get_shift(&chanctx_conf->def);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1051) 	rcu_read_unlock();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1052) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1053) 	return shift;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1054) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1055) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1056) enum {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1057) 	IEEE80211_RX_MSG	= 1,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1058) 	IEEE80211_TX_STATUS_MSG	= 2,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1059) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1060) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1061) enum queue_stop_reason {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1062) 	IEEE80211_QUEUE_STOP_REASON_DRIVER,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1063) 	IEEE80211_QUEUE_STOP_REASON_PS,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1064) 	IEEE80211_QUEUE_STOP_REASON_CSA,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1065) 	IEEE80211_QUEUE_STOP_REASON_AGGREGATION,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1066) 	IEEE80211_QUEUE_STOP_REASON_SUSPEND,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1067) 	IEEE80211_QUEUE_STOP_REASON_SKB_ADD,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1068) 	IEEE80211_QUEUE_STOP_REASON_OFFCHANNEL,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1069) 	IEEE80211_QUEUE_STOP_REASON_FLUSH,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1070) 	IEEE80211_QUEUE_STOP_REASON_TDLS_TEARDOWN,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1071) 	IEEE80211_QUEUE_STOP_REASON_RESERVE_TID,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1072) 	IEEE80211_QUEUE_STOP_REASON_IFTYPE_CHANGE,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1073) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1074) 	IEEE80211_QUEUE_STOP_REASONS,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1075) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1076) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1077) #ifdef CONFIG_MAC80211_LEDS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1078) struct tpt_led_trigger {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1079) 	char name[32];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1080) 	const struct ieee80211_tpt_blink *blink_table;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1081) 	unsigned int blink_table_len;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1082) 	struct timer_list timer;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1083) 	struct ieee80211_local *local;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1084) 	unsigned long prev_traffic;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1085) 	unsigned long tx_bytes, rx_bytes;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1086) 	unsigned int active, want;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1087) 	bool running;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1088) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1089) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1090) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1091) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1092)  * mac80211 scan flags - currently active scan mode
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1093)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1094)  * @SCAN_SW_SCANNING: We're currently in the process of scanning but may as
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1095)  *	well be on the operating channel
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1096)  * @SCAN_HW_SCANNING: The hardware is scanning for us, we have no way to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1097)  *	determine if we are on the operating channel or not
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1098)  * @SCAN_ONCHANNEL_SCANNING:  Do a software scan on only the current operating
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1099)  *	channel. This should not interrupt normal traffic.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1100)  * @SCAN_COMPLETED: Set for our scan work function when the driver reported
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1101)  *	that the scan completed.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1102)  * @SCAN_ABORTED: Set for our scan work function when the driver reported
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1103)  *	a scan complete for an aborted scan.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1104)  * @SCAN_HW_CANCELLED: Set for our scan work function when the scan is being
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1105)  *	cancelled.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1106)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1107) enum {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1108) 	SCAN_SW_SCANNING,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1109) 	SCAN_HW_SCANNING,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1110) 	SCAN_ONCHANNEL_SCANNING,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1111) 	SCAN_COMPLETED,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1112) 	SCAN_ABORTED,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1113) 	SCAN_HW_CANCELLED,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1114) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1115) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1116) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1117)  * enum mac80211_scan_state - scan state machine states
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1118)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1119)  * @SCAN_DECISION: Main entry point to the scan state machine, this state
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1120)  *	determines if we should keep on scanning or switch back to the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1121)  *	operating channel
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1122)  * @SCAN_SET_CHANNEL: Set the next channel to be scanned
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1123)  * @SCAN_SEND_PROBE: Send probe requests and wait for probe responses
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1124)  * @SCAN_SUSPEND: Suspend the scan and go back to operating channel to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1125)  *	send out data
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1126)  * @SCAN_RESUME: Resume the scan and scan the next channel
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1127)  * @SCAN_ABORT: Abort the scan and go back to operating channel
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1128)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1129) enum mac80211_scan_state {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1130) 	SCAN_DECISION,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1131) 	SCAN_SET_CHANNEL,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1132) 	SCAN_SEND_PROBE,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1133) 	SCAN_SUSPEND,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1134) 	SCAN_RESUME,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1135) 	SCAN_ABORT,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1136) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1137) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1138) struct ieee80211_local {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1139) 	/* embed the driver visible part.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1140) 	 * don't cast (use the static inlines below), but we keep
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1141) 	 * it first anyway so they become a no-op */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1142) 	struct ieee80211_hw hw;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1143) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1144) 	struct fq fq;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1145) 	struct codel_vars *cvars;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1146) 	struct codel_params cparams;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1147) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1148) 	/* protects active_txqs and txqi->schedule_order */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1149) 	spinlock_t active_txq_lock[IEEE80211_NUM_ACS];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1150) 	struct list_head active_txqs[IEEE80211_NUM_ACS];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1151) 	u16 schedule_round[IEEE80211_NUM_ACS];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1152) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1153) 	u16 airtime_flags;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1154) 	u32 aql_txq_limit_low[IEEE80211_NUM_ACS];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1155) 	u32 aql_txq_limit_high[IEEE80211_NUM_ACS];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1156) 	u32 aql_threshold;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1157) 	atomic_t aql_total_pending_airtime;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1158) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1159) 	const struct ieee80211_ops *ops;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1160) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1161) 	/*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1162) 	 * private workqueue to mac80211. mac80211 makes this accessible
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1163) 	 * via ieee80211_queue_work()
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1164) 	 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1165) 	struct workqueue_struct *workqueue;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1166) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1167) 	unsigned long queue_stop_reasons[IEEE80211_MAX_QUEUES];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1168) 	int q_stop_reasons[IEEE80211_MAX_QUEUES][IEEE80211_QUEUE_STOP_REASONS];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1169) 	/* also used to protect ampdu_ac_queue and amdpu_ac_stop_refcnt */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1170) 	spinlock_t queue_stop_reason_lock;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1171) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1172) 	int open_count;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1173) 	int monitors, cooked_mntrs;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1174) 	/* number of interfaces with corresponding FIF_ flags */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1175) 	int fif_fcsfail, fif_plcpfail, fif_control, fif_other_bss, fif_pspoll,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1176) 	    fif_probe_req;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1177) 	bool probe_req_reg;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1178) 	bool rx_mcast_action_reg;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1179) 	unsigned int filter_flags; /* FIF_* */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1180) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1181) 	bool wiphy_ciphers_allocated;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1182) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1183) 	bool use_chanctx;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1184) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1185) 	/* protects the aggregated multicast list and filter calls */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1186) 	spinlock_t filter_lock;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1187) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1188) 	/* used for uploading changed mc list */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1189) 	struct work_struct reconfig_filter;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1190) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1191) 	/* aggregated multicast list */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1192) 	struct netdev_hw_addr_list mc_list;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1193) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1194) 	bool tim_in_locked_section; /* see ieee80211_beacon_get() */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1195) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1196) 	/*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1197) 	 * suspended is true if we finished all the suspend _and_ we have
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1198) 	 * not yet come up from resume. This is to be used by mac80211
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1199) 	 * to ensure driver sanity during suspend and mac80211's own
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1200) 	 * sanity. It can eventually be used for WoW as well.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1201) 	 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1202) 	bool suspended;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1203) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1204) 	/*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1205) 	 * Resuming is true while suspended, but when we're reprogramming the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1206) 	 * hardware -- at that time it's allowed to use ieee80211_queue_work()
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1207) 	 * again even though some other parts of the stack are still suspended
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1208) 	 * and we still drop received frames to avoid waking the stack.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1209) 	 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1210) 	bool resuming;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1211) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1212) 	/*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1213) 	 * quiescing is true during the suspend process _only_ to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1214) 	 * ease timer cancelling etc.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1215) 	 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1216) 	bool quiescing;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1217) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1218) 	/* device is started */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1219) 	bool started;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1220) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1221) 	/* device is during a HW reconfig */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1222) 	bool in_reconfig;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1223) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1224) 	/* wowlan is enabled -- don't reconfig on resume */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1225) 	bool wowlan;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1226) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1227) 	struct work_struct radar_detected_work;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1228) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1229) 	/* number of RX chains the hardware has */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1230) 	u8 rx_chains;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1231) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1232) 	/* bitmap of which sbands were copied */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1233) 	u8 sband_allocated;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1234) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1235) 	int tx_headroom; /* required headroom for hardware/radiotap */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1236) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1237) 	/* Tasklet and skb queue to process calls from IRQ mode. All frames
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1238) 	 * added to skb_queue will be processed, but frames in
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1239) 	 * skb_queue_unreliable may be dropped if the total length of these
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1240) 	 * queues increases over the limit. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1241) #define IEEE80211_IRQSAFE_QUEUE_LIMIT 128
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1242) 	struct tasklet_struct tasklet;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1243) 	struct sk_buff_head skb_queue;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1244) 	struct sk_buff_head skb_queue_unreliable;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1245) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1246) 	spinlock_t rx_path_lock;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1247) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1248) 	/* Station data */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1249) 	/*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1250) 	 * The mutex only protects the list, hash table and
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1251) 	 * counter, reads are done with RCU.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1252) 	 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1253) 	struct mutex sta_mtx;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1254) 	spinlock_t tim_lock;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1255) 	unsigned long num_sta;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1256) 	struct list_head sta_list;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1257) 	struct rhltable sta_hash;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1258) 	struct timer_list sta_cleanup;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1259) 	int sta_generation;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1260) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1261) 	struct sk_buff_head pending[IEEE80211_MAX_QUEUES];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1262) 	struct tasklet_struct tx_pending_tasklet;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1263) 	struct tasklet_struct wake_txqs_tasklet;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1264) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1265) 	atomic_t agg_queue_stop[IEEE80211_MAX_QUEUES];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1266) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1267) 	/* number of interfaces with allmulti RX */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1268) 	atomic_t iff_allmultis;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1269) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1270) 	struct rate_control_ref *rate_ctrl;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1271) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1272) 	struct arc4_ctx wep_tx_ctx;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1273) 	struct arc4_ctx wep_rx_ctx;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1274) 	u32 wep_iv;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1275) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1276) 	/* see iface.c */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1277) 	struct list_head interfaces;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1278) 	struct list_head mon_list; /* only that are IFF_UP && !cooked */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1279) 	struct mutex iflist_mtx;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1280) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1281) 	/*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1282) 	 * Key mutex, protects sdata's key_list and sta_info's
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1283) 	 * key pointers and ptk_idx (write access, they're RCU.)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1284) 	 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1285) 	struct mutex key_mtx;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1286) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1287) 	/* mutex for scan and work locking */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1288) 	struct mutex mtx;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1289) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1290) 	/* Scanning and BSS list */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1291) 	unsigned long scanning;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1292) 	struct cfg80211_ssid scan_ssid;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1293) 	struct cfg80211_scan_request *int_scan_req;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1294) 	struct cfg80211_scan_request __rcu *scan_req;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1295) 	struct ieee80211_scan_request *hw_scan_req;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1296) 	struct cfg80211_chan_def scan_chandef;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1297) 	enum nl80211_band hw_scan_band;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1298) 	int scan_channel_idx;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1299) 	int scan_ies_len;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1300) 	int hw_scan_ies_bufsize;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1301) 	struct cfg80211_scan_info scan_info;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1302) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1303) 	struct work_struct sched_scan_stopped_work;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1304) 	struct ieee80211_sub_if_data __rcu *sched_scan_sdata;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1305) 	struct cfg80211_sched_scan_request __rcu *sched_scan_req;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1306) 	u8 scan_addr[ETH_ALEN];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1307) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1308) 	unsigned long leave_oper_channel_time;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1309) 	enum mac80211_scan_state next_scan_state;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1310) 	struct delayed_work scan_work;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1311) 	struct ieee80211_sub_if_data __rcu *scan_sdata;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1312) 	/* For backward compatibility only -- do not use */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1313) 	struct cfg80211_chan_def _oper_chandef;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1314) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1315) 	/* Temporary remain-on-channel for off-channel operations */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1316) 	struct ieee80211_channel *tmp_channel;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1317) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1318) 	/* channel contexts */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1319) 	struct list_head chanctx_list;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1320) 	struct mutex chanctx_mtx;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1321) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1322) #ifdef CONFIG_MAC80211_LEDS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1323) 	struct led_trigger tx_led, rx_led, assoc_led, radio_led;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1324) 	struct led_trigger tpt_led;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1325) 	atomic_t tx_led_active, rx_led_active, assoc_led_active;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1326) 	atomic_t radio_led_active, tpt_led_active;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1327) 	struct tpt_led_trigger *tpt_led_trigger;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1328) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1329) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1330) #ifdef CONFIG_MAC80211_DEBUG_COUNTERS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1331) 	/* SNMP counters */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1332) 	/* dot11CountersTable */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1333) 	u32 dot11TransmittedFragmentCount;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1334) 	u32 dot11MulticastTransmittedFrameCount;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1335) 	u32 dot11FailedCount;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1336) 	u32 dot11RetryCount;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1337) 	u32 dot11MultipleRetryCount;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1338) 	u32 dot11FrameDuplicateCount;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1339) 	u32 dot11ReceivedFragmentCount;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1340) 	u32 dot11MulticastReceivedFrameCount;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1341) 	u32 dot11TransmittedFrameCount;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1342) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1343) 	/* TX/RX handler statistics */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1344) 	unsigned int tx_handlers_drop;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1345) 	unsigned int tx_handlers_queued;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1346) 	unsigned int tx_handlers_drop_wep;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1347) 	unsigned int tx_handlers_drop_not_assoc;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1348) 	unsigned int tx_handlers_drop_unauth_port;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1349) 	unsigned int rx_handlers_drop;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1350) 	unsigned int rx_handlers_queued;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1351) 	unsigned int rx_handlers_drop_nullfunc;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1352) 	unsigned int rx_handlers_drop_defrag;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1353) 	unsigned int tx_expand_skb_head;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1354) 	unsigned int tx_expand_skb_head_cloned;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1355) 	unsigned int rx_expand_skb_head_defrag;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1356) 	unsigned int rx_handlers_fragments;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1357) 	unsigned int tx_status_drop;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1358) #define I802_DEBUG_INC(c) (c)++
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1359) #else /* CONFIG_MAC80211_DEBUG_COUNTERS */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1360) #define I802_DEBUG_INC(c) do { } while (0)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1361) #endif /* CONFIG_MAC80211_DEBUG_COUNTERS */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1362) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1363) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1364) 	int total_ps_buffered; /* total number of all buffered unicast and
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1365) 				* multicast packets for power saving stations
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1366) 				*/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1367) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1368) 	bool pspolling;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1369) 	/*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1370) 	 * PS can only be enabled when we have exactly one managed
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1371) 	 * interface (and monitors) in PS, this then points there.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1372) 	 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1373) 	struct ieee80211_sub_if_data *ps_sdata;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1374) 	struct work_struct dynamic_ps_enable_work;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1375) 	struct work_struct dynamic_ps_disable_work;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1376) 	struct timer_list dynamic_ps_timer;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1377) 	struct notifier_block ifa_notifier;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1378) 	struct notifier_block ifa6_notifier;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1379) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1380) 	/*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1381) 	 * The dynamic ps timeout configured from user space via WEXT -
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1382) 	 * this will override whatever chosen by mac80211 internally.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1383) 	 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1384) 	int dynamic_ps_forced_timeout;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1385) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1386) 	int user_power_level; /* in dBm, for all interfaces */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1387) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1388) 	enum ieee80211_smps_mode smps_mode;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1389) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1390) 	struct work_struct restart_work;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1391) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1392) #ifdef CONFIG_MAC80211_DEBUGFS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1393) 	struct local_debugfsdentries {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1394) 		struct dentry *rcdir;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1395) 		struct dentry *keys;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1396) 	} debugfs;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1397) 	bool force_tx_status;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1398) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1399) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1400) 	/*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1401) 	 * Remain-on-channel support
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1402) 	 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1403) 	struct delayed_work roc_work;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1404) 	struct list_head roc_list;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1405) 	struct work_struct hw_roc_start, hw_roc_done;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1406) 	unsigned long hw_roc_start_time;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1407) 	u64 roc_cookie_counter;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1408) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1409) 	struct idr ack_status_frames;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1410) 	spinlock_t ack_status_lock;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1411) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1412) 	struct ieee80211_sub_if_data __rcu *p2p_sdata;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1413) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1414) 	/* virtual monitor interface */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1415) 	struct ieee80211_sub_if_data __rcu *monitor_sdata;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1416) 	struct cfg80211_chan_def monitor_chandef;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1417) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1418) 	/* extended capabilities provided by mac80211 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1419) 	u8 ext_capa[8];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1420) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1421) 	/* TDLS channel switch */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1422) 	struct work_struct tdls_chsw_work;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1423) 	struct sk_buff_head skb_queue_tdls_chsw;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1424) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1425) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1426) static inline struct ieee80211_sub_if_data *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1427) IEEE80211_DEV_TO_SUB_IF(struct net_device *dev)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1428) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1429) 	return netdev_priv(dev);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1430) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1431) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1432) static inline struct ieee80211_sub_if_data *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1433) IEEE80211_WDEV_TO_SUB_IF(struct wireless_dev *wdev)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1434) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1435) 	return container_of(wdev, struct ieee80211_sub_if_data, wdev);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1436) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1437) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1438) static inline struct ieee80211_supported_band *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1439) ieee80211_get_sband(struct ieee80211_sub_if_data *sdata)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1440) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1441) 	struct ieee80211_local *local = sdata->local;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1442) 	struct ieee80211_chanctx_conf *chanctx_conf;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1443) 	enum nl80211_band band;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1444) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1445) 	rcu_read_lock();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1446) 	chanctx_conf = rcu_dereference(sdata->vif.chanctx_conf);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1447) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1448) 	if (!chanctx_conf) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1449) 		rcu_read_unlock();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1450) 		return NULL;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1451) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1452) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1453) 	band = chanctx_conf->def.chan->band;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1454) 	rcu_read_unlock();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1455) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1456) 	return local->hw.wiphy->bands[band];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1457) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1458) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1459) /* this struct holds the value parsing from channel switch IE  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1460) struct ieee80211_csa_ie {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1461) 	struct cfg80211_chan_def chandef;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1462) 	u8 mode;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1463) 	u8 count;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1464) 	u8 ttl;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1465) 	u16 pre_value;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1466) 	u16 reason_code;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1467) 	u32 max_switch_time;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1468) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1469) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1470) /* Parsed Information Elements */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1471) struct ieee802_11_elems {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1472) 	const u8 *ie_start;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1473) 	size_t total_len;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1474) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1475) 	/* pointers to IEs */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1476) 	const struct ieee80211_tdls_lnkie *lnk_id;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1477) 	const struct ieee80211_ch_switch_timing *ch_sw_timing;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1478) 	const u8 *ext_capab;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1479) 	const u8 *ssid;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1480) 	const u8 *supp_rates;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1481) 	const u8 *ds_params;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1482) 	const struct ieee80211_tim_ie *tim;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1483) 	const u8 *challenge;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1484) 	const u8 *rsn;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1485) 	const u8 *rsnx;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1486) 	const u8 *erp_info;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1487) 	const u8 *ext_supp_rates;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1488) 	const u8 *wmm_info;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1489) 	const u8 *wmm_param;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1490) 	const struct ieee80211_ht_cap *ht_cap_elem;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1491) 	const struct ieee80211_ht_operation *ht_operation;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1492) 	const struct ieee80211_vht_cap *vht_cap_elem;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1493) 	const struct ieee80211_vht_operation *vht_operation;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1494) 	const struct ieee80211_meshconf_ie *mesh_config;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1495) 	const u8 *he_cap;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1496) 	const struct ieee80211_he_operation *he_operation;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1497) 	const struct ieee80211_he_spr *he_spr;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1498) 	const struct ieee80211_mu_edca_param_set *mu_edca_param_set;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1499) 	const struct ieee80211_he_6ghz_capa *he_6ghz_capa;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1500) 	const u8 *uora_element;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1501) 	const u8 *mesh_id;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1502) 	const u8 *peering;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1503) 	const __le16 *awake_window;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1504) 	const u8 *preq;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1505) 	const u8 *prep;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1506) 	const u8 *perr;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1507) 	const struct ieee80211_rann_ie *rann;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1508) 	const struct ieee80211_channel_sw_ie *ch_switch_ie;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1509) 	const struct ieee80211_ext_chansw_ie *ext_chansw_ie;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1510) 	const struct ieee80211_wide_bw_chansw_ie *wide_bw_chansw_ie;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1511) 	const u8 *max_channel_switch_time;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1512) 	const u8 *country_elem;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1513) 	const u8 *pwr_constr_elem;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1514) 	const u8 *cisco_dtpc_elem;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1515) 	const struct ieee80211_timeout_interval_ie *timeout_int;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1516) 	const u8 *opmode_notif;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1517) 	const struct ieee80211_sec_chan_offs_ie *sec_chan_offs;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1518) 	struct ieee80211_mesh_chansw_params_ie *mesh_chansw_params_ie;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1519) 	const struct ieee80211_bss_max_idle_period_ie *max_idle_period_ie;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1520) 	const struct ieee80211_multiple_bssid_configuration *mbssid_config_ie;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1521) 	const struct ieee80211_bssid_index *bssid_index;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1522) 	u8 max_bssid_indicator;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1523) 	u8 dtim_count;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1524) 	u8 dtim_period;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1525) 	const struct ieee80211_addba_ext_ie *addba_ext_ie;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1526) 	const struct ieee80211_s1g_cap *s1g_capab;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1527) 	const struct ieee80211_s1g_oper_ie *s1g_oper;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1528) 	const struct ieee80211_s1g_bcn_compat_ie *s1g_bcn_compat;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1529) 	const struct ieee80211_aid_response_ie *aid_resp;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1530) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1531) 	/* length of them, respectively */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1532) 	u8 ext_capab_len;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1533) 	u8 ssid_len;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1534) 	u8 supp_rates_len;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1535) 	u8 tim_len;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1536) 	u8 challenge_len;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1537) 	u8 rsn_len;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1538) 	u8 rsnx_len;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1539) 	u8 ext_supp_rates_len;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1540) 	u8 wmm_info_len;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1541) 	u8 wmm_param_len;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1542) 	u8 he_cap_len;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1543) 	u8 mesh_id_len;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1544) 	u8 peering_len;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1545) 	u8 preq_len;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1546) 	u8 prep_len;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1547) 	u8 perr_len;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1548) 	u8 country_elem_len;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1549) 	u8 bssid_index_len;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1550) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1551) 	/* whether a parse error occurred while retrieving these elements */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1552) 	bool parse_error;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1553) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1554) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1555) static inline struct ieee80211_local *hw_to_local(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1556) 	struct ieee80211_hw *hw)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1557) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1558) 	return container_of(hw, struct ieee80211_local, hw);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1559) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1560) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1561) static inline struct txq_info *to_txq_info(struct ieee80211_txq *txq)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1562) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1563) 	return container_of(txq, struct txq_info, txq);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1564) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1565) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1566) static inline bool txq_has_queue(struct ieee80211_txq *txq)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1567) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1568) 	struct txq_info *txqi = to_txq_info(txq);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1569) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1570) 	return !(skb_queue_empty(&txqi->frags) && !txqi->tin.backlog_packets);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1571) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1572) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1573) static inline int ieee80211_bssid_match(const u8 *raddr, const u8 *addr)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1574) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1575) 	return ether_addr_equal(raddr, addr) ||
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1576) 	       is_broadcast_ether_addr(raddr);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1577) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1578) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1579) static inline bool
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1580) ieee80211_have_rx_timestamp(struct ieee80211_rx_status *status)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1581) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1582) 	WARN_ON_ONCE(status->flag & RX_FLAG_MACTIME_START &&
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1583) 		     status->flag & RX_FLAG_MACTIME_END);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1584) 	if (status->flag & (RX_FLAG_MACTIME_START | RX_FLAG_MACTIME_END))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1585) 		return true;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1586) 	/* can't handle non-legacy preamble yet */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1587) 	if (status->flag & RX_FLAG_MACTIME_PLCP_START &&
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1588) 	    status->encoding == RX_ENC_LEGACY)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1589) 		return true;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1590) 	return false;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1591) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1592) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1593) void ieee80211_vif_inc_num_mcast(struct ieee80211_sub_if_data *sdata);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1594) void ieee80211_vif_dec_num_mcast(struct ieee80211_sub_if_data *sdata);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1595) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1596) /* This function returns the number of multicast stations connected to this
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1597)  * interface. It returns -1 if that number is not tracked, that is for netdevs
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1598)  * not in AP or AP_VLAN mode or when using 4addr.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1599)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1600) static inline int
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1601) ieee80211_vif_get_num_mcast_if(struct ieee80211_sub_if_data *sdata)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1602) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1603) 	if (sdata->vif.type == NL80211_IFTYPE_AP)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1604) 		return atomic_read(&sdata->u.ap.num_mcast_sta);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1605) 	if (sdata->vif.type == NL80211_IFTYPE_AP_VLAN && !sdata->u.vlan.sta)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1606) 		return atomic_read(&sdata->u.vlan.num_mcast_sta);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1607) 	return -1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1608) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1609) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1610) u64 ieee80211_calculate_rx_timestamp(struct ieee80211_local *local,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1611) 				     struct ieee80211_rx_status *status,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1612) 				     unsigned int mpdu_len,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1613) 				     unsigned int mpdu_offset);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1614) int ieee80211_hw_config(struct ieee80211_local *local, u32 changed);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1615) void ieee80211_tx_set_protected(struct ieee80211_tx_data *tx);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1616) void ieee80211_bss_info_change_notify(struct ieee80211_sub_if_data *sdata,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1617) 				      u32 changed);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1618) void ieee80211_configure_filter(struct ieee80211_local *local);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1619) u32 ieee80211_reset_erp_info(struct ieee80211_sub_if_data *sdata);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1620) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1621) u64 ieee80211_mgmt_tx_cookie(struct ieee80211_local *local);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1622) int ieee80211_attach_ack_skb(struct ieee80211_local *local, struct sk_buff *skb,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1623) 			     u64 *cookie, gfp_t gfp);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1624) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1625) void ieee80211_check_fast_rx(struct sta_info *sta);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1626) void __ieee80211_check_fast_rx_iface(struct ieee80211_sub_if_data *sdata);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1627) void ieee80211_check_fast_rx_iface(struct ieee80211_sub_if_data *sdata);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1628) void ieee80211_clear_fast_rx(struct sta_info *sta);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1629) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1630) /* STA code */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1631) void ieee80211_sta_setup_sdata(struct ieee80211_sub_if_data *sdata);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1632) int ieee80211_mgd_auth(struct ieee80211_sub_if_data *sdata,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1633) 		       struct cfg80211_auth_request *req);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1634) int ieee80211_mgd_assoc(struct ieee80211_sub_if_data *sdata,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1635) 			struct cfg80211_assoc_request *req);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1636) int ieee80211_mgd_deauth(struct ieee80211_sub_if_data *sdata,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1637) 			 struct cfg80211_deauth_request *req);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1638) int ieee80211_mgd_disassoc(struct ieee80211_sub_if_data *sdata,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1639) 			   struct cfg80211_disassoc_request *req);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1640) void ieee80211_send_pspoll(struct ieee80211_local *local,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1641) 			   struct ieee80211_sub_if_data *sdata);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1642) void ieee80211_recalc_ps(struct ieee80211_local *local);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1643) void ieee80211_recalc_ps_vif(struct ieee80211_sub_if_data *sdata);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1644) int ieee80211_set_arp_filter(struct ieee80211_sub_if_data *sdata);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1645) void ieee80211_sta_work(struct ieee80211_sub_if_data *sdata);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1646) void ieee80211_sta_rx_queued_mgmt(struct ieee80211_sub_if_data *sdata,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1647) 				  struct sk_buff *skb);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1648) void ieee80211_sta_rx_queued_ext(struct ieee80211_sub_if_data *sdata,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1649) 				 struct sk_buff *skb);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1650) void ieee80211_sta_reset_beacon_monitor(struct ieee80211_sub_if_data *sdata);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1651) void ieee80211_sta_reset_conn_monitor(struct ieee80211_sub_if_data *sdata);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1652) void ieee80211_mgd_stop(struct ieee80211_sub_if_data *sdata);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1653) void ieee80211_mgd_conn_tx_status(struct ieee80211_sub_if_data *sdata,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1654) 				  __le16 fc, bool acked);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1655) void ieee80211_mgd_quiesce(struct ieee80211_sub_if_data *sdata);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1656) void ieee80211_sta_restart(struct ieee80211_sub_if_data *sdata);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1657) void ieee80211_sta_handle_tspec_ac_params(struct ieee80211_sub_if_data *sdata);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1658) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1659) /* IBSS code */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1660) void ieee80211_ibss_notify_scan_completed(struct ieee80211_local *local);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1661) void ieee80211_ibss_setup_sdata(struct ieee80211_sub_if_data *sdata);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1662) void ieee80211_ibss_rx_no_sta(struct ieee80211_sub_if_data *sdata,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1663) 			      const u8 *bssid, const u8 *addr, u32 supp_rates);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1664) int ieee80211_ibss_join(struct ieee80211_sub_if_data *sdata,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1665) 			struct cfg80211_ibss_params *params);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1666) int ieee80211_ibss_leave(struct ieee80211_sub_if_data *sdata);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1667) void ieee80211_ibss_work(struct ieee80211_sub_if_data *sdata);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1668) void ieee80211_ibss_rx_queued_mgmt(struct ieee80211_sub_if_data *sdata,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1669) 				   struct sk_buff *skb);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1670) int ieee80211_ibss_csa_beacon(struct ieee80211_sub_if_data *sdata,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1671) 			      struct cfg80211_csa_settings *csa_settings);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1672) int ieee80211_ibss_finish_csa(struct ieee80211_sub_if_data *sdata);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1673) void ieee80211_ibss_stop(struct ieee80211_sub_if_data *sdata);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1674) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1675) /* OCB code */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1676) void ieee80211_ocb_work(struct ieee80211_sub_if_data *sdata);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1677) void ieee80211_ocb_rx_no_sta(struct ieee80211_sub_if_data *sdata,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1678) 			     const u8 *bssid, const u8 *addr, u32 supp_rates);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1679) void ieee80211_ocb_setup_sdata(struct ieee80211_sub_if_data *sdata);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1680) int ieee80211_ocb_join(struct ieee80211_sub_if_data *sdata,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1681) 		       struct ocb_setup *setup);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1682) int ieee80211_ocb_leave(struct ieee80211_sub_if_data *sdata);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1683) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1684) /* mesh code */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1685) void ieee80211_mesh_work(struct ieee80211_sub_if_data *sdata);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1686) void ieee80211_mesh_rx_queued_mgmt(struct ieee80211_sub_if_data *sdata,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1687) 				   struct sk_buff *skb);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1688) int ieee80211_mesh_csa_beacon(struct ieee80211_sub_if_data *sdata,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1689) 			      struct cfg80211_csa_settings *csa_settings);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1690) int ieee80211_mesh_finish_csa(struct ieee80211_sub_if_data *sdata);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1691) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1692) /* scan/BSS handling */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1693) void ieee80211_scan_work(struct work_struct *work);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1694) int ieee80211_request_ibss_scan(struct ieee80211_sub_if_data *sdata,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1695) 				const u8 *ssid, u8 ssid_len,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1696) 				struct ieee80211_channel **channels,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1697) 				unsigned int n_channels,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1698) 				enum nl80211_bss_scan_width scan_width);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1699) int ieee80211_request_scan(struct ieee80211_sub_if_data *sdata,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1700) 			   struct cfg80211_scan_request *req);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1701) void ieee80211_scan_cancel(struct ieee80211_local *local);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1702) void ieee80211_run_deferred_scan(struct ieee80211_local *local);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1703) void ieee80211_scan_rx(struct ieee80211_local *local, struct sk_buff *skb);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1704) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1705) void ieee80211_mlme_notify_scan_completed(struct ieee80211_local *local);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1706) struct ieee80211_bss *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1707) ieee80211_bss_info_update(struct ieee80211_local *local,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1708) 			  struct ieee80211_rx_status *rx_status,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1709) 			  struct ieee80211_mgmt *mgmt,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1710) 			  size_t len,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1711) 			  struct ieee80211_channel *channel);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1712) void ieee80211_rx_bss_put(struct ieee80211_local *local,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1713) 			  struct ieee80211_bss *bss);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1714) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1715) /* scheduled scan handling */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1716) int
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1717) __ieee80211_request_sched_scan_start(struct ieee80211_sub_if_data *sdata,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1718) 				     struct cfg80211_sched_scan_request *req);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1719) int ieee80211_request_sched_scan_start(struct ieee80211_sub_if_data *sdata,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1720) 				       struct cfg80211_sched_scan_request *req);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1721) int ieee80211_request_sched_scan_stop(struct ieee80211_local *local);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1722) void ieee80211_sched_scan_end(struct ieee80211_local *local);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1723) void ieee80211_sched_scan_stopped_work(struct work_struct *work);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1724) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1725) /* off-channel/mgmt-tx */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1726) void ieee80211_offchannel_stop_vifs(struct ieee80211_local *local);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1727) void ieee80211_offchannel_return(struct ieee80211_local *local);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1728) void ieee80211_roc_setup(struct ieee80211_local *local);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1729) void ieee80211_start_next_roc(struct ieee80211_local *local);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1730) void ieee80211_roc_purge(struct ieee80211_local *local,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1731) 			 struct ieee80211_sub_if_data *sdata);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1732) int ieee80211_remain_on_channel(struct wiphy *wiphy, struct wireless_dev *wdev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1733) 				struct ieee80211_channel *chan,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1734) 				unsigned int duration, u64 *cookie);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1735) int ieee80211_cancel_remain_on_channel(struct wiphy *wiphy,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1736) 				       struct wireless_dev *wdev, u64 cookie);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1737) int ieee80211_mgmt_tx(struct wiphy *wiphy, struct wireless_dev *wdev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1738) 		      struct cfg80211_mgmt_tx_params *params, u64 *cookie);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1739) int ieee80211_mgmt_tx_cancel_wait(struct wiphy *wiphy,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1740) 				  struct wireless_dev *wdev, u64 cookie);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1741) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1742) /* channel switch handling */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1743) void ieee80211_csa_finalize_work(struct work_struct *work);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1744) int ieee80211_channel_switch(struct wiphy *wiphy, struct net_device *dev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1745) 			     struct cfg80211_csa_settings *params);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1746) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1747) /* interface handling */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1748) #define MAC80211_SUPPORTED_FEATURES_TX	(NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM | \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1749) 					 NETIF_F_HW_CSUM | NETIF_F_SG | \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1750) 					 NETIF_F_HIGHDMA | NETIF_F_GSO_SOFTWARE)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1751) #define MAC80211_SUPPORTED_FEATURES_RX	(NETIF_F_RXCSUM)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1752) #define MAC80211_SUPPORTED_FEATURES	(MAC80211_SUPPORTED_FEATURES_TX | \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1753) 					 MAC80211_SUPPORTED_FEATURES_RX)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1754) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1755) int ieee80211_iface_init(void);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1756) void ieee80211_iface_exit(void);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1757) int ieee80211_if_add(struct ieee80211_local *local, const char *name,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1758) 		     unsigned char name_assign_type,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1759) 		     struct wireless_dev **new_wdev, enum nl80211_iftype type,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1760) 		     struct vif_params *params);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1761) int ieee80211_if_change_type(struct ieee80211_sub_if_data *sdata,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1762) 			     enum nl80211_iftype type);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1763) void ieee80211_if_remove(struct ieee80211_sub_if_data *sdata);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1764) void ieee80211_remove_interfaces(struct ieee80211_local *local);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1765) u32 ieee80211_idle_off(struct ieee80211_local *local);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1766) void ieee80211_recalc_idle(struct ieee80211_local *local);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1767) void ieee80211_adjust_monitor_flags(struct ieee80211_sub_if_data *sdata,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1768) 				    const int offset);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1769) int ieee80211_do_open(struct wireless_dev *wdev, bool coming_up);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1770) void ieee80211_sdata_stop(struct ieee80211_sub_if_data *sdata);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1771) int ieee80211_add_virtual_monitor(struct ieee80211_local *local);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1772) void ieee80211_del_virtual_monitor(struct ieee80211_local *local);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1773) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1774) bool __ieee80211_recalc_txpower(struct ieee80211_sub_if_data *sdata);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1775) void ieee80211_recalc_txpower(struct ieee80211_sub_if_data *sdata,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1776) 			      bool update_bss);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1777) void ieee80211_recalc_offload(struct ieee80211_local *local);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1778) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1779) static inline bool ieee80211_sdata_running(struct ieee80211_sub_if_data *sdata)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1780) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1781) 	return test_bit(SDATA_STATE_RUNNING, &sdata->state);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1782) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1783) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1784) /* tx handling */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1785) void ieee80211_clear_tx_pending(struct ieee80211_local *local);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1786) void ieee80211_tx_pending(unsigned long data);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1787) netdev_tx_t ieee80211_monitor_start_xmit(struct sk_buff *skb,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1788) 					 struct net_device *dev);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1789) netdev_tx_t ieee80211_subif_start_xmit(struct sk_buff *skb,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1790) 				       struct net_device *dev);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1791) netdev_tx_t ieee80211_subif_start_xmit_8023(struct sk_buff *skb,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1792) 					    struct net_device *dev);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1793) void __ieee80211_subif_start_xmit(struct sk_buff *skb,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1794) 				  struct net_device *dev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1795) 				  u32 info_flags,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1796) 				  u32 ctrl_flags,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1797) 				  u64 *cookie);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1798) void ieee80211_purge_tx_queue(struct ieee80211_hw *hw,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1799) 			      struct sk_buff_head *skbs);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1800) struct sk_buff *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1801) ieee80211_build_data_template(struct ieee80211_sub_if_data *sdata,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1802) 			      struct sk_buff *skb, u32 info_flags);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1803) void ieee80211_tx_monitor(struct ieee80211_local *local, struct sk_buff *skb,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1804) 			  struct ieee80211_supported_band *sband,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1805) 			  int retry_count, int shift, bool send_to_cooked,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1806) 			  struct ieee80211_tx_status *status);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1807) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1808) void ieee80211_check_fast_xmit(struct sta_info *sta);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1809) void ieee80211_check_fast_xmit_all(struct ieee80211_local *local);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1810) void ieee80211_check_fast_xmit_iface(struct ieee80211_sub_if_data *sdata);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1811) void ieee80211_clear_fast_xmit(struct sta_info *sta);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1812) int ieee80211_tx_control_port(struct wiphy *wiphy, struct net_device *dev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1813) 			      const u8 *buf, size_t len,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1814) 			      const u8 *dest, __be16 proto, bool unencrypted,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1815) 			      u64 *cookie);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1816) int ieee80211_probe_mesh_link(struct wiphy *wiphy, struct net_device *dev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1817) 			      const u8 *buf, size_t len);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1818) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1819) /* HT */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1820) void ieee80211_apply_htcap_overrides(struct ieee80211_sub_if_data *sdata,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1821) 				     struct ieee80211_sta_ht_cap *ht_cap);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1822) bool ieee80211_ht_cap_ie_to_sta_ht_cap(struct ieee80211_sub_if_data *sdata,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1823) 				       struct ieee80211_supported_band *sband,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1824) 				       const struct ieee80211_ht_cap *ht_cap_ie,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1825) 				       struct sta_info *sta);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1826) void ieee80211_send_delba(struct ieee80211_sub_if_data *sdata,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1827) 			  const u8 *da, u16 tid,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1828) 			  u16 initiator, u16 reason_code);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1829) int ieee80211_send_smps_action(struct ieee80211_sub_if_data *sdata,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1830) 			       enum ieee80211_smps_mode smps, const u8 *da,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1831) 			       const u8 *bssid);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1832) void ieee80211_request_smps_ap_work(struct work_struct *work);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1833) void ieee80211_request_smps_mgd_work(struct work_struct *work);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1834) bool ieee80211_smps_is_restrictive(enum ieee80211_smps_mode smps_mode_old,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1835) 				   enum ieee80211_smps_mode smps_mode_new);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1836) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1837) void ___ieee80211_stop_rx_ba_session(struct sta_info *sta, u16 tid,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1838) 				     u16 initiator, u16 reason, bool stop);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1839) void __ieee80211_stop_rx_ba_session(struct sta_info *sta, u16 tid,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1840) 				    u16 initiator, u16 reason, bool stop);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1841) void ___ieee80211_start_rx_ba_session(struct sta_info *sta,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1842) 				      u8 dialog_token, u16 timeout,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1843) 				      u16 start_seq_num, u16 ba_policy, u16 tid,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1844) 				      u16 buf_size, bool tx, bool auto_seq,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1845) 				      const struct ieee80211_addba_ext_ie *addbaext);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1846) void ieee80211_sta_tear_down_BA_sessions(struct sta_info *sta,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1847) 					 enum ieee80211_agg_stop_reason reason);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1848) void ieee80211_process_delba(struct ieee80211_sub_if_data *sdata,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1849) 			     struct sta_info *sta,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1850) 			     struct ieee80211_mgmt *mgmt, size_t len);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1851) void ieee80211_process_addba_resp(struct ieee80211_local *local,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1852) 				  struct sta_info *sta,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1853) 				  struct ieee80211_mgmt *mgmt,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1854) 				  size_t len);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1855) void ieee80211_process_addba_request(struct ieee80211_local *local,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1856) 				     struct sta_info *sta,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1857) 				     struct ieee80211_mgmt *mgmt,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1858) 				     size_t len);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1859) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1860) int __ieee80211_stop_tx_ba_session(struct sta_info *sta, u16 tid,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1861) 				   enum ieee80211_agg_stop_reason reason);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1862) int ___ieee80211_stop_tx_ba_session(struct sta_info *sta, u16 tid,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1863) 				    enum ieee80211_agg_stop_reason reason);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1864) void ieee80211_start_tx_ba_cb(struct sta_info *sta, int tid,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1865) 			      struct tid_ampdu_tx *tid_tx);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1866) void ieee80211_stop_tx_ba_cb(struct sta_info *sta, int tid,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1867) 			     struct tid_ampdu_tx *tid_tx);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1868) void ieee80211_ba_session_work(struct work_struct *work);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1869) void ieee80211_tx_ba_session_handle_start(struct sta_info *sta, int tid);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1870) void ieee80211_release_reorder_timeout(struct sta_info *sta, int tid);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1871) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1872) u8 ieee80211_mcs_to_chains(const struct ieee80211_mcs_info *mcs);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1873) enum nl80211_smps_mode
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1874) ieee80211_smps_mode_to_smps_mode(enum ieee80211_smps_mode smps);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1875) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1876) /* VHT */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1877) void
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1878) ieee80211_vht_cap_ie_to_sta_vht_cap(struct ieee80211_sub_if_data *sdata,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1879) 				    struct ieee80211_supported_band *sband,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1880) 				    const struct ieee80211_vht_cap *vht_cap_ie,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1881) 				    struct sta_info *sta);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1882) enum ieee80211_sta_rx_bandwidth ieee80211_sta_cap_rx_bw(struct sta_info *sta);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1883) enum ieee80211_sta_rx_bandwidth ieee80211_sta_cur_vht_bw(struct sta_info *sta);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1884) void ieee80211_sta_set_rx_nss(struct sta_info *sta);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1885) enum ieee80211_sta_rx_bandwidth
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1886) ieee80211_chan_width_to_rx_bw(enum nl80211_chan_width width);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1887) enum nl80211_chan_width ieee80211_sta_cap_chan_bw(struct sta_info *sta);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1888) void ieee80211_sta_set_rx_nss(struct sta_info *sta);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1889) void ieee80211_process_mu_groups(struct ieee80211_sub_if_data *sdata,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1890) 				 struct ieee80211_mgmt *mgmt);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1891) u32 __ieee80211_vht_handle_opmode(struct ieee80211_sub_if_data *sdata,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1892)                                   struct sta_info *sta, u8 opmode,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1893) 				  enum nl80211_band band);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1894) void ieee80211_vht_handle_opmode(struct ieee80211_sub_if_data *sdata,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1895) 				 struct sta_info *sta, u8 opmode,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1896) 				 enum nl80211_band band);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1897) void ieee80211_apply_vhtcap_overrides(struct ieee80211_sub_if_data *sdata,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1898) 				      struct ieee80211_sta_vht_cap *vht_cap);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1899) void ieee80211_get_vht_mask_from_cap(__le16 vht_cap,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1900) 				     u16 vht_mask[NL80211_VHT_NSS_MAX]);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1901) enum nl80211_chan_width
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1902) ieee80211_sta_rx_bw_to_chan_width(struct sta_info *sta);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1903) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1904) /* HE */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1905) void
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1906) ieee80211_he_cap_ie_to_sta_he_cap(struct ieee80211_sub_if_data *sdata,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1907) 				  struct ieee80211_supported_band *sband,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1908) 				  const u8 *he_cap_ie, u8 he_cap_len,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1909) 				  const struct ieee80211_he_6ghz_capa *he_6ghz_capa,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1910) 				  struct sta_info *sta);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1911) void
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1912) ieee80211_he_spr_ie_to_bss_conf(struct ieee80211_vif *vif,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1913) 				const struct ieee80211_he_spr *he_spr_ie_elem);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1914) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1915) void
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1916) ieee80211_he_op_ie_to_bss_conf(struct ieee80211_vif *vif,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1917) 			const struct ieee80211_he_operation *he_op_ie_elem);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1918) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1919) /* S1G */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1920) void ieee80211_s1g_sta_rate_init(struct sta_info *sta);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1921) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1922) /* Spectrum management */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1923) void ieee80211_process_measurement_req(struct ieee80211_sub_if_data *sdata,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1924) 				       struct ieee80211_mgmt *mgmt,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1925) 				       size_t len);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1926) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1927)  * ieee80211_parse_ch_switch_ie - parses channel switch IEs
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1928)  * @sdata: the sdata of the interface which has received the frame
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1929)  * @elems: parsed 802.11 elements received with the frame
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1930)  * @current_band: indicates the current band
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1931)  * @vht_cap_info: VHT capabilities of the transmitter
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1932)  * @sta_flags: contains information about own capabilities and restrictions
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1933)  *	to decide which channel switch announcements can be accepted. Only the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1934)  *	following subset of &enum ieee80211_sta_flags are evaluated:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1935)  *	%IEEE80211_STA_DISABLE_HT, %IEEE80211_STA_DISABLE_VHT,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1936)  *	%IEEE80211_STA_DISABLE_40MHZ, %IEEE80211_STA_DISABLE_80P80MHZ,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1937)  *	%IEEE80211_STA_DISABLE_160MHZ.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1938)  * @bssid: the currently connected bssid (for reporting)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1939)  * @csa_ie: parsed 802.11 csa elements on count, mode, chandef and mesh ttl.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1940) 	All of them will be filled with if success only.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1941)  * Return: 0 on success, <0 on error and >0 if there is nothing to parse.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1942)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1943) int ieee80211_parse_ch_switch_ie(struct ieee80211_sub_if_data *sdata,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1944) 				 struct ieee802_11_elems *elems,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1945) 				 enum nl80211_band current_band,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1946) 				 u32 vht_cap_info,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1947) 				 u32 sta_flags, u8 *bssid,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1948) 				 struct ieee80211_csa_ie *csa_ie);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1949) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1950) /* Suspend/resume and hw reconfiguration */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1951) int ieee80211_reconfig(struct ieee80211_local *local);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1952) void ieee80211_stop_device(struct ieee80211_local *local);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1953) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1954) int __ieee80211_suspend(struct ieee80211_hw *hw,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1955) 			struct cfg80211_wowlan *wowlan);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1956) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1957) static inline int __ieee80211_resume(struct ieee80211_hw *hw)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1958) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1959) 	struct ieee80211_local *local = hw_to_local(hw);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1960) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1961) 	WARN(test_bit(SCAN_HW_SCANNING, &local->scanning) &&
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1962) 	     !test_bit(SCAN_COMPLETED, &local->scanning),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1963) 		"%s: resume with hardware scan still in progress\n",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1964) 		wiphy_name(hw->wiphy));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1965) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1966) 	return ieee80211_reconfig(hw_to_local(hw));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1967) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1968) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1969) /* utility functions/constants */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1970) extern const void *const mac80211_wiphy_privid; /* for wiphy privid */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1971) int ieee80211_frame_duration(enum nl80211_band band, size_t len,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1972) 			     int rate, int erp, int short_preamble,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1973) 			     int shift);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1974) void ieee80211_regulatory_limit_wmm_params(struct ieee80211_sub_if_data *sdata,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1975) 					   struct ieee80211_tx_queue_params *qparam,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1976) 					   int ac);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1977) void ieee80211_set_wmm_default(struct ieee80211_sub_if_data *sdata,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1978) 			       bool bss_notify, bool enable_qos);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1979) void ieee80211_xmit(struct ieee80211_sub_if_data *sdata,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1980) 		    struct sta_info *sta, struct sk_buff *skb);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1981) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1982) void __ieee80211_tx_skb_tid_band(struct ieee80211_sub_if_data *sdata,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1983) 				 struct sk_buff *skb, int tid,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1984) 				 enum nl80211_band band);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1985) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1986) /* sta_out needs to be checked for ERR_PTR() before using */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1987) int ieee80211_lookup_ra_sta(struct ieee80211_sub_if_data *sdata,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1988) 			    struct sk_buff *skb,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1989) 			    struct sta_info **sta_out);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1990) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1991) static inline void
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1992) ieee80211_tx_skb_tid_band(struct ieee80211_sub_if_data *sdata,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1993) 			  struct sk_buff *skb, int tid,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1994) 			  enum nl80211_band band)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1995) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1996) 	rcu_read_lock();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1997) 	__ieee80211_tx_skb_tid_band(sdata, skb, tid, band);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1998) 	rcu_read_unlock();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1999) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2000) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2001) static inline void ieee80211_tx_skb_tid(struct ieee80211_sub_if_data *sdata,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2002) 					struct sk_buff *skb, int tid)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2003) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2004) 	struct ieee80211_chanctx_conf *chanctx_conf;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2005) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2006) 	rcu_read_lock();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2007) 	chanctx_conf = rcu_dereference(sdata->vif.chanctx_conf);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2008) 	if (WARN_ON(!chanctx_conf)) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2009) 		rcu_read_unlock();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2010) 		kfree_skb(skb);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2011) 		return;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2012) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2013) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2014) 	__ieee80211_tx_skb_tid_band(sdata, skb, tid,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2015) 				    chanctx_conf->def.chan->band);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2016) 	rcu_read_unlock();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2017) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2018) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2019) static inline void ieee80211_tx_skb(struct ieee80211_sub_if_data *sdata,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2020) 				    struct sk_buff *skb)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2021) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2022) 	/* Send all internal mgmt frames on VO. Accordingly set TID to 7. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2023) 	ieee80211_tx_skb_tid(sdata, skb, 7);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2024) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2025) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2026) u32 ieee802_11_parse_elems_crc(const u8 *start, size_t len, bool action,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2027) 			       struct ieee802_11_elems *elems,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2028) 			       u64 filter, u32 crc, u8 *transmitter_bssid,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2029) 			       u8 *bss_bssid);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2030) static inline void ieee802_11_parse_elems(const u8 *start, size_t len,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2031) 					  bool action,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2032) 					  struct ieee802_11_elems *elems,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2033) 					  u8 *transmitter_bssid,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2034) 					  u8 *bss_bssid)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2035) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2036) 	ieee802_11_parse_elems_crc(start, len, action, elems, 0, 0,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2037) 				   transmitter_bssid, bss_bssid);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2038) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2039) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2040) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2041) extern const int ieee802_1d_to_ac[8];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2042) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2043) static inline int ieee80211_ac_from_tid(int tid)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2044) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2045) 	return ieee802_1d_to_ac[tid & 7];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2046) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2047) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2048) void ieee80211_dynamic_ps_enable_work(struct work_struct *work);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2049) void ieee80211_dynamic_ps_disable_work(struct work_struct *work);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2050) void ieee80211_dynamic_ps_timer(struct timer_list *t);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2051) void ieee80211_send_nullfunc(struct ieee80211_local *local,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2052) 			     struct ieee80211_sub_if_data *sdata,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2053) 			     bool powersave);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2054) void ieee80211_send_4addr_nullfunc(struct ieee80211_local *local,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2055) 				   struct ieee80211_sub_if_data *sdata);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2056) void ieee80211_sta_tx_notify(struct ieee80211_sub_if_data *sdata,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2057) 			     struct ieee80211_hdr *hdr, bool ack, u16 tx_time);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2058) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2059) void ieee80211_wake_queues_by_reason(struct ieee80211_hw *hw,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2060) 				     unsigned long queues,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2061) 				     enum queue_stop_reason reason,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2062) 				     bool refcounted);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2063) void ieee80211_stop_vif_queues(struct ieee80211_local *local,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2064) 			       struct ieee80211_sub_if_data *sdata,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2065) 			       enum queue_stop_reason reason);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2066) void ieee80211_wake_vif_queues(struct ieee80211_local *local,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2067) 			       struct ieee80211_sub_if_data *sdata,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2068) 			       enum queue_stop_reason reason);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2069) void ieee80211_stop_queues_by_reason(struct ieee80211_hw *hw,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2070) 				     unsigned long queues,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2071) 				     enum queue_stop_reason reason,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2072) 				     bool refcounted);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2073) void ieee80211_wake_queue_by_reason(struct ieee80211_hw *hw, int queue,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2074) 				    enum queue_stop_reason reason,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2075) 				    bool refcounted);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2076) void ieee80211_stop_queue_by_reason(struct ieee80211_hw *hw, int queue,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2077) 				    enum queue_stop_reason reason,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2078) 				    bool refcounted);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2079) void ieee80211_propagate_queue_wake(struct ieee80211_local *local, int queue);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2080) void ieee80211_add_pending_skb(struct ieee80211_local *local,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2081) 			       struct sk_buff *skb);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2082) void ieee80211_add_pending_skbs(struct ieee80211_local *local,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2083) 				struct sk_buff_head *skbs);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2084) void ieee80211_flush_queues(struct ieee80211_local *local,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2085) 			    struct ieee80211_sub_if_data *sdata, bool drop);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2086) void __ieee80211_flush_queues(struct ieee80211_local *local,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2087) 			      struct ieee80211_sub_if_data *sdata,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2088) 			      unsigned int queues, bool drop);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2089) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2090) static inline bool ieee80211_can_run_worker(struct ieee80211_local *local)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2091) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2092) 	/*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2093) 	 * It's unsafe to try to do any work during reconfigure flow.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2094) 	 * When the flow ends the work will be requeued.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2095) 	 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2096) 	if (local->in_reconfig)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2097) 		return false;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2098) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2099) 	/*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2100) 	 * If quiescing is set, we are racing with __ieee80211_suspend.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2101) 	 * __ieee80211_suspend flushes the workers after setting quiescing,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2102) 	 * and we check quiescing / suspended before enqueing new workers.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2103) 	 * We should abort the worker to avoid the races below.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2104) 	 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2105) 	if (local->quiescing)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2106) 		return false;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2107) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2108) 	/*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2109) 	 * We might already be suspended if the following scenario occurs:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2110) 	 * __ieee80211_suspend		Control path
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2111) 	 *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2112) 	 *				if (local->quiescing)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2113) 	 *					return;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2114) 	 * local->quiescing = true;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2115) 	 * flush_workqueue();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2116) 	 *				queue_work(...);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2117) 	 * local->suspended = true;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2118) 	 * local->quiescing = false;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2119) 	 *				worker starts running...
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2120) 	 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2121) 	if (local->suspended)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2122) 		return false;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2123) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2124) 	return true;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2125) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2126) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2127) int ieee80211_txq_setup_flows(struct ieee80211_local *local);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2128) void ieee80211_txq_set_params(struct ieee80211_local *local);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2129) void ieee80211_txq_teardown_flows(struct ieee80211_local *local);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2130) void ieee80211_txq_init(struct ieee80211_sub_if_data *sdata,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2131) 			struct sta_info *sta,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2132) 			struct txq_info *txq, int tid);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2133) void ieee80211_txq_purge(struct ieee80211_local *local,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2134) 			 struct txq_info *txqi);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2135) void ieee80211_txq_remove_vlan(struct ieee80211_local *local,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2136) 			       struct ieee80211_sub_if_data *sdata);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2137) void ieee80211_fill_txq_stats(struct cfg80211_txq_stats *txqstats,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2138) 			      struct txq_info *txqi);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2139) void ieee80211_wake_txqs(unsigned long data);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2140) void ieee80211_send_auth(struct ieee80211_sub_if_data *sdata,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2141) 			 u16 transaction, u16 auth_alg, u16 status,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2142) 			 const u8 *extra, size_t extra_len, const u8 *bssid,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2143) 			 const u8 *da, const u8 *key, u8 key_len, u8 key_idx,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2144) 			 u32 tx_flags);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2145) void ieee80211_send_deauth_disassoc(struct ieee80211_sub_if_data *sdata,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2146) 				    const u8 *da, const u8 *bssid,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2147) 				    u16 stype, u16 reason,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2148) 				    bool send_frame, u8 *frame_buf);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2149) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2150) enum {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2151) 	IEEE80211_PROBE_FLAG_DIRECTED		= BIT(0),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2152) 	IEEE80211_PROBE_FLAG_MIN_CONTENT	= BIT(1),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2153) 	IEEE80211_PROBE_FLAG_RANDOM_SN		= BIT(2),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2154) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2155) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2156) int ieee80211_build_preq_ies(struct ieee80211_sub_if_data *sdata, u8 *buffer,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2157) 			     size_t buffer_len,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2158) 			     struct ieee80211_scan_ies *ie_desc,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2159) 			     const u8 *ie, size_t ie_len,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2160) 			     u8 bands_used, u32 *rate_masks,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2161) 			     struct cfg80211_chan_def *chandef,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2162) 			     u32 flags);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2163) struct sk_buff *ieee80211_build_probe_req(struct ieee80211_sub_if_data *sdata,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2164) 					  const u8 *src, const u8 *dst,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2165) 					  u32 ratemask,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2166) 					  struct ieee80211_channel *chan,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2167) 					  const u8 *ssid, size_t ssid_len,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2168) 					  const u8 *ie, size_t ie_len,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2169) 					  u32 flags);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2170) u32 ieee80211_sta_get_rates(struct ieee80211_sub_if_data *sdata,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2171) 			    struct ieee802_11_elems *elems,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2172) 			    enum nl80211_band band, u32 *basic_rates);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2173) int __ieee80211_request_smps_mgd(struct ieee80211_sub_if_data *sdata,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2174) 				 enum ieee80211_smps_mode smps_mode);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2175) void ieee80211_recalc_smps(struct ieee80211_sub_if_data *sdata);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2176) void ieee80211_recalc_min_chandef(struct ieee80211_sub_if_data *sdata);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2177) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2178) size_t ieee80211_ie_split_vendor(const u8 *ies, size_t ielen, size_t offset);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2179) u8 *ieee80211_ie_build_ht_cap(u8 *pos, struct ieee80211_sta_ht_cap *ht_cap,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2180) 			      u16 cap);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2181) u8 *ieee80211_ie_build_ht_oper(u8 *pos, struct ieee80211_sta_ht_cap *ht_cap,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2182) 			       const struct cfg80211_chan_def *chandef,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2183) 			       u16 prot_mode, bool rifs_mode);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2184) void ieee80211_ie_build_wide_bw_cs(u8 *pos,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2185) 				   const struct cfg80211_chan_def *chandef);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2186) u8 *ieee80211_ie_build_vht_cap(u8 *pos, struct ieee80211_sta_vht_cap *vht_cap,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2187) 			       u32 cap);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2188) u8 *ieee80211_ie_build_vht_oper(u8 *pos, struct ieee80211_sta_vht_cap *vht_cap,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2189) 				const struct cfg80211_chan_def *chandef);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2190) u8 ieee80211_ie_len_he_cap(struct ieee80211_sub_if_data *sdata, u8 iftype);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2191) u8 *ieee80211_ie_build_he_cap(u8 *pos,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2192) 			      const struct ieee80211_sta_he_cap *he_cap,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2193) 			      u8 *end);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2194) void ieee80211_ie_build_he_6ghz_cap(struct ieee80211_sub_if_data *sdata,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2195) 				    struct sk_buff *skb);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2196) u8 *ieee80211_ie_build_he_oper(u8 *pos, struct cfg80211_chan_def *chandef);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2197) int ieee80211_parse_bitrates(struct cfg80211_chan_def *chandef,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2198) 			     const struct ieee80211_supported_band *sband,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2199) 			     const u8 *srates, int srates_len, u32 *rates);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2200) int ieee80211_add_srates_ie(struct ieee80211_sub_if_data *sdata,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2201) 			    struct sk_buff *skb, bool need_basic,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2202) 			    enum nl80211_band band);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2203) int ieee80211_add_ext_srates_ie(struct ieee80211_sub_if_data *sdata,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2204) 				struct sk_buff *skb, bool need_basic,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2205) 				enum nl80211_band band);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2206) u8 *ieee80211_add_wmm_info_ie(u8 *buf, u8 qosinfo);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2207) void ieee80211_add_s1g_capab_ie(struct ieee80211_sub_if_data *sdata,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2208) 				struct ieee80211_sta_s1g_cap *caps,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2209) 				struct sk_buff *skb);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2210) void ieee80211_add_aid_request_ie(struct ieee80211_sub_if_data *sdata,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2211) 				  struct sk_buff *skb);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2212) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2213) /* channel management */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2214) bool ieee80211_chandef_ht_oper(const struct ieee80211_ht_operation *ht_oper,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2215) 			       struct cfg80211_chan_def *chandef);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2216) bool ieee80211_chandef_vht_oper(struct ieee80211_hw *hw, u32 vht_cap_info,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2217) 				const struct ieee80211_vht_operation *oper,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2218) 				const struct ieee80211_ht_operation *htop,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2219) 				struct cfg80211_chan_def *chandef);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2220) bool ieee80211_chandef_he_6ghz_oper(struct ieee80211_sub_if_data *sdata,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2221) 				    const struct ieee80211_he_operation *he_oper,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2222) 				    struct cfg80211_chan_def *chandef);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2223) bool ieee80211_chandef_s1g_oper(const struct ieee80211_s1g_oper_ie *oper,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2224) 				struct cfg80211_chan_def *chandef);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2225) u32 ieee80211_chandef_downgrade(struct cfg80211_chan_def *c);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2226) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2227) int __must_check
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2228) ieee80211_vif_use_channel(struct ieee80211_sub_if_data *sdata,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2229) 			  const struct cfg80211_chan_def *chandef,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2230) 			  enum ieee80211_chanctx_mode mode);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2231) int __must_check
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2232) ieee80211_vif_reserve_chanctx(struct ieee80211_sub_if_data *sdata,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2233) 			      const struct cfg80211_chan_def *chandef,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2234) 			      enum ieee80211_chanctx_mode mode,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2235) 			      bool radar_required);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2236) int __must_check
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2237) ieee80211_vif_use_reserved_context(struct ieee80211_sub_if_data *sdata);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2238) int ieee80211_vif_unreserve_chanctx(struct ieee80211_sub_if_data *sdata);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2239) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2240) int __must_check
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2241) ieee80211_vif_change_bandwidth(struct ieee80211_sub_if_data *sdata,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2242) 			       const struct cfg80211_chan_def *chandef,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2243) 			       u32 *changed);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2244) void ieee80211_vif_release_channel(struct ieee80211_sub_if_data *sdata);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2245) void ieee80211_vif_vlan_copy_chanctx(struct ieee80211_sub_if_data *sdata);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2246) void ieee80211_vif_copy_chanctx_to_vlans(struct ieee80211_sub_if_data *sdata,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2247) 					 bool clear);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2248) int ieee80211_chanctx_refcount(struct ieee80211_local *local,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2249) 			       struct ieee80211_chanctx *ctx);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2250) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2251) void ieee80211_recalc_smps_chanctx(struct ieee80211_local *local,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2252) 				   struct ieee80211_chanctx *chanctx);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2253) void ieee80211_recalc_chanctx_min_def(struct ieee80211_local *local,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2254) 				      struct ieee80211_chanctx *ctx);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2255) bool ieee80211_is_radar_required(struct ieee80211_local *local);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2256) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2257) void ieee80211_dfs_cac_timer(unsigned long data);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2258) void ieee80211_dfs_cac_timer_work(struct work_struct *work);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2259) void ieee80211_dfs_cac_cancel(struct ieee80211_local *local);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2260) void ieee80211_dfs_radar_detected_work(struct work_struct *work);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2261) int ieee80211_send_action_csa(struct ieee80211_sub_if_data *sdata,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2262) 			      struct cfg80211_csa_settings *csa_settings);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2263) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2264) bool ieee80211_cs_valid(const struct ieee80211_cipher_scheme *cs);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2265) bool ieee80211_cs_list_valid(const struct ieee80211_cipher_scheme *cs, int n);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2266) const struct ieee80211_cipher_scheme *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2267) ieee80211_cs_get(struct ieee80211_local *local, u32 cipher,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2268) 		 enum nl80211_iftype iftype);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2269) int ieee80211_cs_headroom(struct ieee80211_local *local,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2270) 			  struct cfg80211_crypto_settings *crypto,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2271) 			  enum nl80211_iftype iftype);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2272) void ieee80211_recalc_dtim(struct ieee80211_local *local,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2273) 			   struct ieee80211_sub_if_data *sdata);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2274) int ieee80211_check_combinations(struct ieee80211_sub_if_data *sdata,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2275) 				 const struct cfg80211_chan_def *chandef,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2276) 				 enum ieee80211_chanctx_mode chanmode,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2277) 				 u8 radar_detect);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2278) int ieee80211_max_num_channels(struct ieee80211_local *local);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2279) enum nl80211_chan_width ieee80211_get_sta_bw(struct ieee80211_sta *sta);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2280) void ieee80211_recalc_chanctx_chantype(struct ieee80211_local *local,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2281) 				       struct ieee80211_chanctx *ctx);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2282) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2283) /* TDLS */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2284) int ieee80211_tdls_mgmt(struct wiphy *wiphy, struct net_device *dev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2285) 			const u8 *peer, u8 action_code, u8 dialog_token,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2286) 			u16 status_code, u32 peer_capability,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2287) 			bool initiator, const u8 *extra_ies,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2288) 			size_t extra_ies_len);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2289) int ieee80211_tdls_oper(struct wiphy *wiphy, struct net_device *dev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2290) 			const u8 *peer, enum nl80211_tdls_operation oper);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2291) void ieee80211_tdls_peer_del_work(struct work_struct *wk);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2292) int ieee80211_tdls_channel_switch(struct wiphy *wiphy, struct net_device *dev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2293) 				  const u8 *addr, u8 oper_class,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2294) 				  struct cfg80211_chan_def *chandef);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2295) void ieee80211_tdls_cancel_channel_switch(struct wiphy *wiphy,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2296) 					  struct net_device *dev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2297) 					  const u8 *addr);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2298) void ieee80211_teardown_tdls_peers(struct ieee80211_sub_if_data *sdata);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2299) void ieee80211_tdls_chsw_work(struct work_struct *wk);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2300) void ieee80211_tdls_handle_disconnect(struct ieee80211_sub_if_data *sdata,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2301) 				      const u8 *peer, u16 reason);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2302) const char *ieee80211_get_reason_code_string(u16 reason_code);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2303) u16 ieee80211_encode_usf(int val);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2304) u8 *ieee80211_get_bssid(struct ieee80211_hdr *hdr, size_t len,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2305) 			enum nl80211_iftype type);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2306) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2307) extern const struct ethtool_ops ieee80211_ethtool_ops;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2308) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2309) u32 ieee80211_calc_expected_tx_airtime(struct ieee80211_hw *hw,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2310) 				       struct ieee80211_vif *vif,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2311) 				       struct ieee80211_sta *pubsta,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2312) 				       int len, bool ampdu);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2313) #ifdef CONFIG_MAC80211_NOINLINE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2314) #define debug_noinline noinline
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2315) #else
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2316) #define debug_noinline
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2317) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2318) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2319) void ieee80211_init_frag_cache(struct ieee80211_fragment_cache *cache);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2320) void ieee80211_destroy_frag_cache(struct ieee80211_fragment_cache *cache);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2321) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2322) #endif /* IEEE80211_I_H */