18c2ecf20Sopenharmony_ci/******************************************************************************
28c2ecf20Sopenharmony_ci *
38c2ecf20Sopenharmony_ci * This file is provided under a dual BSD/GPLv2 license.  When using or
48c2ecf20Sopenharmony_ci * redistributing this file, you may do so under either license.
58c2ecf20Sopenharmony_ci *
68c2ecf20Sopenharmony_ci * GPL LICENSE SUMMARY
78c2ecf20Sopenharmony_ci *
88c2ecf20Sopenharmony_ci * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved.
98c2ecf20Sopenharmony_ci * Copyright(c) 2013 - 2014 Intel Mobile Communications GmbH
108c2ecf20Sopenharmony_ci * Copyright(c) 2015 - 2016 Intel Deutschland GmbH
118c2ecf20Sopenharmony_ci * Copyright(c) 2018 - 2020 Intel Corporation
128c2ecf20Sopenharmony_ci *
138c2ecf20Sopenharmony_ci * This program is free software; you can redistribute it and/or modify
148c2ecf20Sopenharmony_ci * it under the terms of version 2 of the GNU General Public License as
158c2ecf20Sopenharmony_ci * published by the Free Software Foundation.
168c2ecf20Sopenharmony_ci *
178c2ecf20Sopenharmony_ci * This program is distributed in the hope that it will be useful, but
188c2ecf20Sopenharmony_ci * WITHOUT ANY WARRANTY; without even the implied warranty of
198c2ecf20Sopenharmony_ci * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
208c2ecf20Sopenharmony_ci * General Public License for more details.
218c2ecf20Sopenharmony_ci *
228c2ecf20Sopenharmony_ci * The full GNU General Public License is included in this distribution
238c2ecf20Sopenharmony_ci * in the file called COPYING.
248c2ecf20Sopenharmony_ci *
258c2ecf20Sopenharmony_ci * Contact Information:
268c2ecf20Sopenharmony_ci *  Intel Linux Wireless <linuxwifi@intel.com>
278c2ecf20Sopenharmony_ci * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
288c2ecf20Sopenharmony_ci *
298c2ecf20Sopenharmony_ci * BSD LICENSE
308c2ecf20Sopenharmony_ci *
318c2ecf20Sopenharmony_ci * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved.
328c2ecf20Sopenharmony_ci * Copyright(c) 2013 - 2014 Intel Mobile Communications GmbH
338c2ecf20Sopenharmony_ci * Copyright(c) 2015 - 2016 Intel Deutschland GmbH
348c2ecf20Sopenharmony_ci * Copyright(c) 2018 - 2020 Intel Corporation
358c2ecf20Sopenharmony_ci * All rights reserved.
368c2ecf20Sopenharmony_ci *
378c2ecf20Sopenharmony_ci * Redistribution and use in source and binary forms, with or without
388c2ecf20Sopenharmony_ci * modification, are permitted provided that the following conditions
398c2ecf20Sopenharmony_ci * are met:
408c2ecf20Sopenharmony_ci *
418c2ecf20Sopenharmony_ci *  * Redistributions of source code must retain the above copyright
428c2ecf20Sopenharmony_ci *    notice, this list of conditions and the following disclaimer.
438c2ecf20Sopenharmony_ci *  * Redistributions in binary form must reproduce the above copyright
448c2ecf20Sopenharmony_ci *    notice, this list of conditions and the following disclaimer in
458c2ecf20Sopenharmony_ci *    the documentation and/or other materials provided with the
468c2ecf20Sopenharmony_ci *    distribution.
478c2ecf20Sopenharmony_ci *  * Neither the name Intel Corporation nor the names of its
488c2ecf20Sopenharmony_ci *    contributors may be used to endorse or promote products derived
498c2ecf20Sopenharmony_ci *    from this software without specific prior written permission.
508c2ecf20Sopenharmony_ci *
518c2ecf20Sopenharmony_ci * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
528c2ecf20Sopenharmony_ci * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
538c2ecf20Sopenharmony_ci * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
548c2ecf20Sopenharmony_ci * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
558c2ecf20Sopenharmony_ci * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
568c2ecf20Sopenharmony_ci * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
578c2ecf20Sopenharmony_ci * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
588c2ecf20Sopenharmony_ci * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
598c2ecf20Sopenharmony_ci * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
608c2ecf20Sopenharmony_ci * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
618c2ecf20Sopenharmony_ci * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
628c2ecf20Sopenharmony_ci *
638c2ecf20Sopenharmony_ci *****************************************************************************/
648c2ecf20Sopenharmony_ci
658c2ecf20Sopenharmony_ci#ifndef __sta_h__
668c2ecf20Sopenharmony_ci#define __sta_h__
678c2ecf20Sopenharmony_ci
688c2ecf20Sopenharmony_ci#include <linux/spinlock.h>
698c2ecf20Sopenharmony_ci#include <net/mac80211.h>
708c2ecf20Sopenharmony_ci#include <linux/wait.h>
718c2ecf20Sopenharmony_ci
728c2ecf20Sopenharmony_ci#include "iwl-trans.h" /* for IWL_MAX_TID_COUNT */
738c2ecf20Sopenharmony_ci#include "fw-api.h" /* IWL_MVM_STATION_COUNT_MAX */
748c2ecf20Sopenharmony_ci#include "rs.h"
758c2ecf20Sopenharmony_ci
768c2ecf20Sopenharmony_cistruct iwl_mvm;
778c2ecf20Sopenharmony_cistruct iwl_mvm_vif;
788c2ecf20Sopenharmony_ci
798c2ecf20Sopenharmony_ci/**
808c2ecf20Sopenharmony_ci * DOC: DQA - Dynamic Queue Allocation -introduction
818c2ecf20Sopenharmony_ci *
828c2ecf20Sopenharmony_ci * Dynamic Queue Allocation (AKA "DQA") is a feature implemented in iwlwifi
838c2ecf20Sopenharmony_ci * driver to allow dynamic allocation of queues on-demand, rather than allocate
848c2ecf20Sopenharmony_ci * them statically ahead of time. Ideally, we would like to allocate one queue
858c2ecf20Sopenharmony_ci * per RA/TID, thus allowing an AP - for example - to send BE traffic to STA2
868c2ecf20Sopenharmony_ci * even if it also needs to send traffic to a sleeping STA1, without being
878c2ecf20Sopenharmony_ci * blocked by the sleeping station.
888c2ecf20Sopenharmony_ci *
898c2ecf20Sopenharmony_ci * Although the queues in DQA mode are dynamically allocated, there are still
908c2ecf20Sopenharmony_ci * some queues that are statically allocated:
918c2ecf20Sopenharmony_ci *	TXQ #0 - command queue
928c2ecf20Sopenharmony_ci *	TXQ #1 - aux frames
938c2ecf20Sopenharmony_ci *	TXQ #2 - P2P device frames
948c2ecf20Sopenharmony_ci *	TXQ #3 - P2P GO/SoftAP GCAST/BCAST frames
958c2ecf20Sopenharmony_ci *	TXQ #4 - BSS DATA frames queue
968c2ecf20Sopenharmony_ci *	TXQ #5-8 - Non-QoS and MGMT frames queue pool
978c2ecf20Sopenharmony_ci *	TXQ #9 - P2P GO/SoftAP probe responses
988c2ecf20Sopenharmony_ci *	TXQ #10-31 - DATA frames queue pool
998c2ecf20Sopenharmony_ci * The queues are dynamically taken from either the MGMT frames queue pool or
1008c2ecf20Sopenharmony_ci * the DATA frames one. See the %iwl_mvm_dqa_txq for more information on every
1018c2ecf20Sopenharmony_ci * queue.
1028c2ecf20Sopenharmony_ci *
1038c2ecf20Sopenharmony_ci * When a frame for a previously unseen RA/TID comes in, it needs to be deferred
1048c2ecf20Sopenharmony_ci * until a queue is allocated for it, and only then can be TXed. Therefore, it
1058c2ecf20Sopenharmony_ci * is placed into %iwl_mvm_tid_data.deferred_tx_frames, and a worker called
1068c2ecf20Sopenharmony_ci * %mvm->add_stream_wk later allocates the queues and TXes the deferred frames.
1078c2ecf20Sopenharmony_ci *
1088c2ecf20Sopenharmony_ci * For convenience, MGMT is considered as if it has TID=8, and go to the MGMT
1098c2ecf20Sopenharmony_ci * queues in the pool. If there is no longer a free MGMT queue to allocate, a
1108c2ecf20Sopenharmony_ci * queue will be allocated from the DATA pool instead. Since QoS NDPs can create
1118c2ecf20Sopenharmony_ci * a problem for aggregations, they too will use a MGMT queue.
1128c2ecf20Sopenharmony_ci *
1138c2ecf20Sopenharmony_ci * When adding a STA, a DATA queue is reserved for it so that it can TX from
1148c2ecf20Sopenharmony_ci * it. If no such free queue exists for reserving, the STA addition will fail.
1158c2ecf20Sopenharmony_ci *
1168c2ecf20Sopenharmony_ci * If the DATA queue pool gets exhausted, no new STA will be accepted, and if a
1178c2ecf20Sopenharmony_ci * new RA/TID comes in for an existing STA, one of the STA's queues will become
1188c2ecf20Sopenharmony_ci * shared and will serve more than the single TID (but always for the same RA!).
1198c2ecf20Sopenharmony_ci *
1208c2ecf20Sopenharmony_ci * When a RA/TID needs to become aggregated, no new queue is required to be
1218c2ecf20Sopenharmony_ci * allocated, only mark the queue as aggregated via the ADD_STA command. Note,
1228c2ecf20Sopenharmony_ci * however, that a shared queue cannot be aggregated, and only after the other
1238c2ecf20Sopenharmony_ci * TIDs become inactive and are removed - only then can the queue be
1248c2ecf20Sopenharmony_ci * reconfigured and become aggregated.
1258c2ecf20Sopenharmony_ci *
1268c2ecf20Sopenharmony_ci * When removing a station, its queues are returned to the pool for reuse. Here
1278c2ecf20Sopenharmony_ci * we also need to make sure that we are synced with the worker thread that TXes
1288c2ecf20Sopenharmony_ci * the deferred frames so we don't get into a situation where the queues are
1298c2ecf20Sopenharmony_ci * removed and then the worker puts deferred frames onto the released queues or
1308c2ecf20Sopenharmony_ci * tries to allocate new queues for a STA we don't need anymore.
1318c2ecf20Sopenharmony_ci */
1328c2ecf20Sopenharmony_ci
1338c2ecf20Sopenharmony_ci/**
1348c2ecf20Sopenharmony_ci * DOC: station table - introduction
1358c2ecf20Sopenharmony_ci *
1368c2ecf20Sopenharmony_ci * The station table is a list of data structure that reprensent the stations.
1378c2ecf20Sopenharmony_ci * In STA/P2P client mode, the driver will hold one station for the AP/ GO.
1388c2ecf20Sopenharmony_ci * In GO/AP mode, the driver will have as many stations as associated clients.
1398c2ecf20Sopenharmony_ci * All these stations are reflected in the fw's station table. The driver
1408c2ecf20Sopenharmony_ci * keeps the fw's station table up to date with the ADD_STA command. Stations
1418c2ecf20Sopenharmony_ci * can be removed by the REMOVE_STA command.
1428c2ecf20Sopenharmony_ci *
1438c2ecf20Sopenharmony_ci * All the data related to a station is held in the structure %iwl_mvm_sta
1448c2ecf20Sopenharmony_ci * which is embed in the mac80211's %ieee80211_sta (in the drv_priv) area.
1458c2ecf20Sopenharmony_ci * This data includes the index of the station in the fw, per tid information
1468c2ecf20Sopenharmony_ci * (sequence numbers, Block-ack state machine, etc...). The stations are
1478c2ecf20Sopenharmony_ci * created and deleted by the %sta_state callback from %ieee80211_ops.
1488c2ecf20Sopenharmony_ci *
1498c2ecf20Sopenharmony_ci * The driver holds a map: %fw_id_to_mac_id that allows to fetch a
1508c2ecf20Sopenharmony_ci * %ieee80211_sta (and the %iwl_mvm_sta embedded into it) based on a fw
1518c2ecf20Sopenharmony_ci * station index. That way, the driver is able to get the tid related data in
1528c2ecf20Sopenharmony_ci * O(1) in time sensitive paths (Tx / Tx response / BA notification). These
1538c2ecf20Sopenharmony_ci * paths are triggered by the fw, and the driver needs to get a pointer to the
1548c2ecf20Sopenharmony_ci * %ieee80211 structure. This map helps to get that pointer quickly.
1558c2ecf20Sopenharmony_ci */
1568c2ecf20Sopenharmony_ci
1578c2ecf20Sopenharmony_ci/**
1588c2ecf20Sopenharmony_ci * DOC: station table - locking
1598c2ecf20Sopenharmony_ci *
1608c2ecf20Sopenharmony_ci * As stated before, the station is created / deleted by mac80211's %sta_state
1618c2ecf20Sopenharmony_ci * callback from %ieee80211_ops which can sleep. The next paragraph explains
1628c2ecf20Sopenharmony_ci * the locking of a single stations, the next ones relates to the station
1638c2ecf20Sopenharmony_ci * table.
1648c2ecf20Sopenharmony_ci *
1658c2ecf20Sopenharmony_ci * The station holds the sequence number per tid. So this data needs to be
1668c2ecf20Sopenharmony_ci * accessed in the Tx path (which is softIRQ). It also holds the Block-Ack
1678c2ecf20Sopenharmony_ci * information (the state machine / and the logic that checks if the queues
1688c2ecf20Sopenharmony_ci * were drained), so it also needs to be accessible from the Tx response flow.
1698c2ecf20Sopenharmony_ci * In short, the station needs to be access from sleepable context as well as
1708c2ecf20Sopenharmony_ci * from tasklets, so the station itself needs a spinlock.
1718c2ecf20Sopenharmony_ci *
1728c2ecf20Sopenharmony_ci * The writers of %fw_id_to_mac_id map are serialized by the global mutex of
1738c2ecf20Sopenharmony_ci * the mvm op_mode. This is possible since %sta_state can sleep.
1748c2ecf20Sopenharmony_ci * The pointers in this map are RCU protected, hence we won't replace the
1758c2ecf20Sopenharmony_ci * station while we have Tx / Tx response / BA notification running.
1768c2ecf20Sopenharmony_ci *
1778c2ecf20Sopenharmony_ci * If a station is deleted while it still has packets in its A-MPDU queues,
1788c2ecf20Sopenharmony_ci * then the reclaim flow will notice that there is no station in the map for
1798c2ecf20Sopenharmony_ci * sta_id and it will dump the responses.
1808c2ecf20Sopenharmony_ci */
1818c2ecf20Sopenharmony_ci
1828c2ecf20Sopenharmony_ci/**
1838c2ecf20Sopenharmony_ci * DOC: station table - internal stations
1848c2ecf20Sopenharmony_ci *
1858c2ecf20Sopenharmony_ci * The FW needs a few internal stations that are not reflected in
1868c2ecf20Sopenharmony_ci * mac80211, such as broadcast station in AP / GO mode, or AUX sta for
1878c2ecf20Sopenharmony_ci * scanning and P2P device (during the GO negotiation).
1888c2ecf20Sopenharmony_ci * For these kind of stations we have %iwl_mvm_int_sta struct which holds the
1898c2ecf20Sopenharmony_ci * data relevant for them from both %iwl_mvm_sta and %ieee80211_sta.
1908c2ecf20Sopenharmony_ci * Usually the data for these stations is static, so no locking is required,
1918c2ecf20Sopenharmony_ci * and no TID data as this is also not needed.
1928c2ecf20Sopenharmony_ci * One thing to note, is that these stations have an ID in the fw, but not
1938c2ecf20Sopenharmony_ci * in mac80211. In order to "reserve" them a sta_id in %fw_id_to_mac_id
1948c2ecf20Sopenharmony_ci * we fill ERR_PTR(EINVAL) in this mapping and all other dereferencing of
1958c2ecf20Sopenharmony_ci * pointers from this mapping need to check that the value is not error
1968c2ecf20Sopenharmony_ci * or NULL.
1978c2ecf20Sopenharmony_ci *
1988c2ecf20Sopenharmony_ci * Currently there is only one auxiliary station for scanning, initialized
1998c2ecf20Sopenharmony_ci * on init.
2008c2ecf20Sopenharmony_ci */
2018c2ecf20Sopenharmony_ci
2028c2ecf20Sopenharmony_ci/**
2038c2ecf20Sopenharmony_ci * DOC: station table - AP Station in STA mode
2048c2ecf20Sopenharmony_ci *
2058c2ecf20Sopenharmony_ci * %iwl_mvm_vif includes the index of the AP station in the fw's STA table:
2068c2ecf20Sopenharmony_ci * %ap_sta_id. To get the point to the corresponding %ieee80211_sta,
2078c2ecf20Sopenharmony_ci * &fw_id_to_mac_id can be used. Due to the way the fw works, we must not remove
2088c2ecf20Sopenharmony_ci * the AP station from the fw before setting the MAC context as unassociated.
2098c2ecf20Sopenharmony_ci * Hence, %fw_id_to_mac_id[%ap_sta_id] will be NULLed when the AP station is
2108c2ecf20Sopenharmony_ci * removed by mac80211, but the station won't be removed in the fw until the
2118c2ecf20Sopenharmony_ci * VIF is set as unassociated. Then, %ap_sta_id will be invalidated.
2128c2ecf20Sopenharmony_ci */
2138c2ecf20Sopenharmony_ci
2148c2ecf20Sopenharmony_ci/**
2158c2ecf20Sopenharmony_ci * DOC: station table - Drain vs. Flush
2168c2ecf20Sopenharmony_ci *
2178c2ecf20Sopenharmony_ci * Flush means that all the frames in the SCD queue are dumped regardless the
2188c2ecf20Sopenharmony_ci * station to which they were sent. We do that when we disassociate and before
2198c2ecf20Sopenharmony_ci * we remove the STA of the AP. The flush can be done synchronously against the
2208c2ecf20Sopenharmony_ci * fw.
2218c2ecf20Sopenharmony_ci * Drain means that the fw will drop all the frames sent to a specific station.
2228c2ecf20Sopenharmony_ci * This is useful when a client (if we are IBSS / GO or AP) disassociates.
2238c2ecf20Sopenharmony_ci */
2248c2ecf20Sopenharmony_ci
2258c2ecf20Sopenharmony_ci/**
2268c2ecf20Sopenharmony_ci * DOC: station table - fw restart
2278c2ecf20Sopenharmony_ci *
2288c2ecf20Sopenharmony_ci * When the fw asserts, or we have any other issue that requires to reset the
2298c2ecf20Sopenharmony_ci * driver, we require mac80211 to reconfigure the driver. Since the private
2308c2ecf20Sopenharmony_ci * data of the stations is embed in mac80211's %ieee80211_sta, that data will
2318c2ecf20Sopenharmony_ci * not be zeroed and needs to be reinitialized manually.
2328c2ecf20Sopenharmony_ci * %IWL_MVM_STATUS_IN_HW_RESTART is set during restart and that will hint us
2338c2ecf20Sopenharmony_ci * that we must not allocate a new sta_id but reuse the previous one. This
2348c2ecf20Sopenharmony_ci * means that the stations being re-added after the reset will have the same
2358c2ecf20Sopenharmony_ci * place in the fw as before the reset. We do need to zero the %fw_id_to_mac_id
2368c2ecf20Sopenharmony_ci * map, since the stations aren't in the fw any more. Internal stations that
2378c2ecf20Sopenharmony_ci * are not added by mac80211 will be re-added in the init flow that is called
2388c2ecf20Sopenharmony_ci * after the restart: mac80211 call's %iwl_mvm_mac_start which calls to
2398c2ecf20Sopenharmony_ci * %iwl_mvm_up.
2408c2ecf20Sopenharmony_ci */
2418c2ecf20Sopenharmony_ci
2428c2ecf20Sopenharmony_ci/**
2438c2ecf20Sopenharmony_ci * DOC: AP mode - PS
2448c2ecf20Sopenharmony_ci *
2458c2ecf20Sopenharmony_ci * When a station is asleep, the fw will set it as "asleep". All frames on
2468c2ecf20Sopenharmony_ci * shared queues (i.e. non-aggregation queues) to that station will be dropped
2478c2ecf20Sopenharmony_ci * by the fw (%TX_STATUS_FAIL_DEST_PS failure code).
2488c2ecf20Sopenharmony_ci *
2498c2ecf20Sopenharmony_ci * AMPDUs are in a separate queue that is stopped by the fw. We just need to
2508c2ecf20Sopenharmony_ci * let mac80211 know when there are frames in these queues so that it can
2518c2ecf20Sopenharmony_ci * properly handle trigger frames.
2528c2ecf20Sopenharmony_ci *
2538c2ecf20Sopenharmony_ci * When a trigger frame is received, mac80211 tells the driver to send frames
2548c2ecf20Sopenharmony_ci * from the AMPDU queues or sends frames to non-aggregation queues itself,
2558c2ecf20Sopenharmony_ci * depending on which ACs are delivery-enabled and what TID has frames to
2568c2ecf20Sopenharmony_ci * transmit. Note that mac80211 has all the knowledge since all the non-agg
2578c2ecf20Sopenharmony_ci * frames are buffered / filtered, and the driver tells mac80211 about agg
2588c2ecf20Sopenharmony_ci * frames). The driver needs to tell the fw to let frames out even if the
2598c2ecf20Sopenharmony_ci * station is asleep. This is done by %iwl_mvm_sta_modify_sleep_tx_count.
2608c2ecf20Sopenharmony_ci *
2618c2ecf20Sopenharmony_ci * When we receive a frame from that station with PM bit unset, the driver
2628c2ecf20Sopenharmony_ci * needs to let the fw know that this station isn't asleep any more. This is
2638c2ecf20Sopenharmony_ci * done by %iwl_mvm_sta_modify_ps_wake in response to mac80211 signaling the
2648c2ecf20Sopenharmony_ci * station's wakeup.
2658c2ecf20Sopenharmony_ci *
2668c2ecf20Sopenharmony_ci * For a GO, the Service Period might be cut short due to an absence period
2678c2ecf20Sopenharmony_ci * of the GO. In this (and all other cases) the firmware notifies us with the
2688c2ecf20Sopenharmony_ci * EOSP_NOTIFICATION, and we notify mac80211 of that. Further frames that we
2698c2ecf20Sopenharmony_ci * already sent to the device will be rejected again.
2708c2ecf20Sopenharmony_ci *
2718c2ecf20Sopenharmony_ci * See also "AP support for powersaving clients" in mac80211.h.
2728c2ecf20Sopenharmony_ci */
2738c2ecf20Sopenharmony_ci
2748c2ecf20Sopenharmony_ci/**
2758c2ecf20Sopenharmony_ci * enum iwl_mvm_agg_state
2768c2ecf20Sopenharmony_ci *
2778c2ecf20Sopenharmony_ci * The state machine of the BA agreement establishment / tear down.
2788c2ecf20Sopenharmony_ci * These states relate to a specific RA / TID.
2798c2ecf20Sopenharmony_ci *
2808c2ecf20Sopenharmony_ci * @IWL_AGG_OFF: aggregation is not used
2818c2ecf20Sopenharmony_ci * @IWL_AGG_QUEUED: aggregation start work has been queued
2828c2ecf20Sopenharmony_ci * @IWL_AGG_STARTING: aggregation are starting (between start and oper)
2838c2ecf20Sopenharmony_ci * @IWL_AGG_ON: aggregation session is up
2848c2ecf20Sopenharmony_ci * @IWL_EMPTYING_HW_QUEUE_ADDBA: establishing a BA session - waiting for the
2858c2ecf20Sopenharmony_ci *	HW queue to be empty from packets for this RA /TID.
2868c2ecf20Sopenharmony_ci * @IWL_EMPTYING_HW_QUEUE_DELBA: tearing down a BA session - waiting for the
2878c2ecf20Sopenharmony_ci *	HW queue to be empty from packets for this RA /TID.
2888c2ecf20Sopenharmony_ci */
2898c2ecf20Sopenharmony_cienum iwl_mvm_agg_state {
2908c2ecf20Sopenharmony_ci	IWL_AGG_OFF = 0,
2918c2ecf20Sopenharmony_ci	IWL_AGG_QUEUED,
2928c2ecf20Sopenharmony_ci	IWL_AGG_STARTING,
2938c2ecf20Sopenharmony_ci	IWL_AGG_ON,
2948c2ecf20Sopenharmony_ci	IWL_EMPTYING_HW_QUEUE_ADDBA,
2958c2ecf20Sopenharmony_ci	IWL_EMPTYING_HW_QUEUE_DELBA,
2968c2ecf20Sopenharmony_ci};
2978c2ecf20Sopenharmony_ci
2988c2ecf20Sopenharmony_ci/**
2998c2ecf20Sopenharmony_ci * struct iwl_mvm_tid_data - holds the states for each RA / TID
3008c2ecf20Sopenharmony_ci * @seq_number: the next WiFi sequence number to use
3018c2ecf20Sopenharmony_ci * @next_reclaimed: the WiFi sequence number of the next packet to be acked.
3028c2ecf20Sopenharmony_ci *	This is basically (last acked packet++).
3038c2ecf20Sopenharmony_ci * @rate_n_flags: Rate at which Tx was attempted. Holds the data between the
3048c2ecf20Sopenharmony_ci *	Tx response (TX_CMD), and the block ack notification (COMPRESSED_BA).
3058c2ecf20Sopenharmony_ci * @lq_color: the color of the LQ command as it appears in tx response.
3068c2ecf20Sopenharmony_ci * @amsdu_in_ampdu_allowed: true if A-MSDU in A-MPDU is allowed.
3078c2ecf20Sopenharmony_ci * @state: state of the BA agreement establishment / tear down.
3088c2ecf20Sopenharmony_ci * @txq_id: Tx queue used by the BA session / DQA
3098c2ecf20Sopenharmony_ci * @ssn: the first packet to be sent in AGG HW queue in Tx AGG start flow, or
3108c2ecf20Sopenharmony_ci *	the first packet to be sent in legacy HW queue in Tx AGG stop flow.
3118c2ecf20Sopenharmony_ci *	Basically when next_reclaimed reaches ssn, we can tell mac80211 that
3128c2ecf20Sopenharmony_ci *	we are ready to finish the Tx AGG stop / start flow.
3138c2ecf20Sopenharmony_ci * @tx_time: medium time consumed by this A-MPDU
3148c2ecf20Sopenharmony_ci * @tpt_meas_start: time of the throughput measurements start, is reset every HZ
3158c2ecf20Sopenharmony_ci * @tx_count_last: number of frames transmitted during the last second
3168c2ecf20Sopenharmony_ci * @tx_count: counts the number of frames transmitted since the last reset of
3178c2ecf20Sopenharmony_ci *	 tpt_meas_start
3188c2ecf20Sopenharmony_ci */
3198c2ecf20Sopenharmony_cistruct iwl_mvm_tid_data {
3208c2ecf20Sopenharmony_ci	u16 seq_number;
3218c2ecf20Sopenharmony_ci	u16 next_reclaimed;
3228c2ecf20Sopenharmony_ci	/* The rest is Tx AGG related */
3238c2ecf20Sopenharmony_ci	u32 rate_n_flags;
3248c2ecf20Sopenharmony_ci	u8 lq_color;
3258c2ecf20Sopenharmony_ci	bool amsdu_in_ampdu_allowed;
3268c2ecf20Sopenharmony_ci	enum iwl_mvm_agg_state state;
3278c2ecf20Sopenharmony_ci	u16 txq_id;
3288c2ecf20Sopenharmony_ci	u16 ssn;
3298c2ecf20Sopenharmony_ci	u16 tx_time;
3308c2ecf20Sopenharmony_ci	unsigned long tpt_meas_start;
3318c2ecf20Sopenharmony_ci	u32 tx_count_last;
3328c2ecf20Sopenharmony_ci	u32 tx_count;
3338c2ecf20Sopenharmony_ci};
3348c2ecf20Sopenharmony_ci
3358c2ecf20Sopenharmony_cistruct iwl_mvm_key_pn {
3368c2ecf20Sopenharmony_ci	struct rcu_head rcu_head;
3378c2ecf20Sopenharmony_ci	struct {
3388c2ecf20Sopenharmony_ci		u8 pn[IWL_MAX_TID_COUNT][IEEE80211_CCMP_PN_LEN];
3398c2ecf20Sopenharmony_ci	} ____cacheline_aligned_in_smp q[];
3408c2ecf20Sopenharmony_ci};
3418c2ecf20Sopenharmony_ci
3428c2ecf20Sopenharmony_cistruct iwl_mvm_delba_data {
3438c2ecf20Sopenharmony_ci	u32 baid;
3448c2ecf20Sopenharmony_ci} __packed;
3458c2ecf20Sopenharmony_ci
3468c2ecf20Sopenharmony_cistruct iwl_mvm_nssn_sync_data {
3478c2ecf20Sopenharmony_ci	u32 baid;
3488c2ecf20Sopenharmony_ci	u32 nssn;
3498c2ecf20Sopenharmony_ci} __packed;
3508c2ecf20Sopenharmony_ci
3518c2ecf20Sopenharmony_cistruct iwl_mvm_rss_sync_notif {
3528c2ecf20Sopenharmony_ci	struct iwl_mvm_internal_rxq_notif metadata;
3538c2ecf20Sopenharmony_ci	union {
3548c2ecf20Sopenharmony_ci		struct iwl_mvm_delba_data delba;
3558c2ecf20Sopenharmony_ci		struct iwl_mvm_nssn_sync_data nssn_sync;
3568c2ecf20Sopenharmony_ci	};
3578c2ecf20Sopenharmony_ci} __packed;
3588c2ecf20Sopenharmony_ci
3598c2ecf20Sopenharmony_ci/**
3608c2ecf20Sopenharmony_ci * struct iwl_mvm_rxq_dup_data - per station per rx queue data
3618c2ecf20Sopenharmony_ci * @last_seq: last sequence per tid for duplicate packet detection
3628c2ecf20Sopenharmony_ci * @last_sub_frame: last subframe packet
3638c2ecf20Sopenharmony_ci */
3648c2ecf20Sopenharmony_cistruct iwl_mvm_rxq_dup_data {
3658c2ecf20Sopenharmony_ci	__le16 last_seq[IWL_MAX_TID_COUNT + 1];
3668c2ecf20Sopenharmony_ci	u8 last_sub_frame[IWL_MAX_TID_COUNT + 1];
3678c2ecf20Sopenharmony_ci} ____cacheline_aligned_in_smp;
3688c2ecf20Sopenharmony_ci
3698c2ecf20Sopenharmony_ci/**
3708c2ecf20Sopenharmony_ci * struct iwl_mvm_sta - representation of a station in the driver
3718c2ecf20Sopenharmony_ci * @sta_id: the index of the station in the fw (will be replaced by id_n_color)
3728c2ecf20Sopenharmony_ci * @tfd_queue_msk: the tfd queues used by the station
3738c2ecf20Sopenharmony_ci * @mac_id_n_color: the MAC context this station is linked to
3748c2ecf20Sopenharmony_ci * @tid_disable_agg: bitmap: if bit(tid) is set, the fw won't send ampdus for
3758c2ecf20Sopenharmony_ci *	tid.
3768c2ecf20Sopenharmony_ci * @max_agg_bufsize: the maximal size of the AGG buffer for this station
3778c2ecf20Sopenharmony_ci * @sta_type: station type
3788c2ecf20Sopenharmony_ci * @sta_state: station state according to enum %ieee80211_sta_state
3798c2ecf20Sopenharmony_ci * @bt_reduced_txpower: is reduced tx power enabled for this station
3808c2ecf20Sopenharmony_ci * @next_status_eosp: the next reclaimed packet is a PS-Poll response and
3818c2ecf20Sopenharmony_ci *	we need to signal the EOSP
3828c2ecf20Sopenharmony_ci * @lock: lock to protect the whole struct. Since %tid_data is access from Tx
3838c2ecf20Sopenharmony_ci * and from Tx response flow, it needs a spinlock.
3848c2ecf20Sopenharmony_ci * @tid_data: per tid data + mgmt. Look at %iwl_mvm_tid_data.
3858c2ecf20Sopenharmony_ci * @tid_to_baid: a simple map of TID to baid
3868c2ecf20Sopenharmony_ci * @lq_sta: holds rate scaling data, either for the case when RS is done in
3878c2ecf20Sopenharmony_ci *	the driver - %rs_drv or in the FW - %rs_fw.
3888c2ecf20Sopenharmony_ci * @reserved_queue: the queue reserved for this STA for DQA purposes
3898c2ecf20Sopenharmony_ci *	Every STA has is given one reserved queue to allow it to operate. If no
3908c2ecf20Sopenharmony_ci *	such queue can be guaranteed, the STA addition will fail.
3918c2ecf20Sopenharmony_ci * @tx_protection: reference counter for controlling the Tx protection.
3928c2ecf20Sopenharmony_ci * @tt_tx_protection: is thermal throttling enable Tx protection?
3938c2ecf20Sopenharmony_ci * @disable_tx: is tx to this STA disabled?
3948c2ecf20Sopenharmony_ci * @amsdu_enabled: bitmap of TX AMSDU allowed TIDs.
3958c2ecf20Sopenharmony_ci *	In case TLC offload is not active it is either 0xFFFF or 0.
3968c2ecf20Sopenharmony_ci * @max_amsdu_len: max AMSDU length
3978c2ecf20Sopenharmony_ci * @orig_amsdu_len: used to save the original amsdu_len when it is changed via
3988c2ecf20Sopenharmony_ci *      debugfs.  If it's set to 0, it means that it is it's not set via
3998c2ecf20Sopenharmony_ci *      debugfs.
4008c2ecf20Sopenharmony_ci * @agg_tids: bitmap of tids whose status is operational aggregated (IWL_AGG_ON)
4018c2ecf20Sopenharmony_ci * @sleep_tx_count: the number of frames that we told the firmware to let out
4028c2ecf20Sopenharmony_ci *	even when that station is asleep. This is useful in case the queue
4038c2ecf20Sopenharmony_ci *	gets empty before all the frames were sent, which can happen when
4048c2ecf20Sopenharmony_ci *	we are sending frames from an AMPDU queue and there was a hole in
4058c2ecf20Sopenharmony_ci *	the BA window. To be used for UAPSD only.
4068c2ecf20Sopenharmony_ci * @ptk_pn: per-queue PTK PN data structures
4078c2ecf20Sopenharmony_ci * @dup_data: per queue duplicate packet detection data
4088c2ecf20Sopenharmony_ci * @deferred_traffic_tid_map: indication bitmap of deferred traffic per-TID
4098c2ecf20Sopenharmony_ci * @tx_ant: the index of the antenna to use for data tx to this station. Only
4108c2ecf20Sopenharmony_ci *	used during connection establishment (e.g. for the 4 way handshake
4118c2ecf20Sopenharmony_ci *	exchange).
4128c2ecf20Sopenharmony_ci *
4138c2ecf20Sopenharmony_ci * When mac80211 creates a station it reserves some space (hw->sta_data_size)
4148c2ecf20Sopenharmony_ci * in the structure for use by driver. This structure is placed in that
4158c2ecf20Sopenharmony_ci * space.
4168c2ecf20Sopenharmony_ci *
4178c2ecf20Sopenharmony_ci */
4188c2ecf20Sopenharmony_cistruct iwl_mvm_sta {
4198c2ecf20Sopenharmony_ci	u32 sta_id;
4208c2ecf20Sopenharmony_ci	u32 tfd_queue_msk;
4218c2ecf20Sopenharmony_ci	u32 mac_id_n_color;
4228c2ecf20Sopenharmony_ci	u16 tid_disable_agg;
4238c2ecf20Sopenharmony_ci	u16 max_agg_bufsize;
4248c2ecf20Sopenharmony_ci	enum iwl_sta_type sta_type;
4258c2ecf20Sopenharmony_ci	enum ieee80211_sta_state sta_state;
4268c2ecf20Sopenharmony_ci	bool bt_reduced_txpower;
4278c2ecf20Sopenharmony_ci	bool next_status_eosp;
4288c2ecf20Sopenharmony_ci	spinlock_t lock;
4298c2ecf20Sopenharmony_ci	struct iwl_mvm_tid_data tid_data[IWL_MAX_TID_COUNT + 1];
4308c2ecf20Sopenharmony_ci	u8 tid_to_baid[IWL_MAX_TID_COUNT];
4318c2ecf20Sopenharmony_ci	union {
4328c2ecf20Sopenharmony_ci		struct iwl_lq_sta_rs_fw rs_fw;
4338c2ecf20Sopenharmony_ci		struct iwl_lq_sta rs_drv;
4348c2ecf20Sopenharmony_ci	} lq_sta;
4358c2ecf20Sopenharmony_ci	struct ieee80211_vif *vif;
4368c2ecf20Sopenharmony_ci	struct iwl_mvm_key_pn __rcu *ptk_pn[4];
4378c2ecf20Sopenharmony_ci	struct iwl_mvm_rxq_dup_data *dup_data;
4388c2ecf20Sopenharmony_ci
4398c2ecf20Sopenharmony_ci	u8 reserved_queue;
4408c2ecf20Sopenharmony_ci
4418c2ecf20Sopenharmony_ci	/* Temporary, until the new TLC will control the Tx protection */
4428c2ecf20Sopenharmony_ci	s8 tx_protection;
4438c2ecf20Sopenharmony_ci	bool tt_tx_protection;
4448c2ecf20Sopenharmony_ci
4458c2ecf20Sopenharmony_ci	bool disable_tx;
4468c2ecf20Sopenharmony_ci	u16 amsdu_enabled;
4478c2ecf20Sopenharmony_ci	u16 max_amsdu_len;
4488c2ecf20Sopenharmony_ci	u16 orig_amsdu_len;
4498c2ecf20Sopenharmony_ci	bool sleeping;
4508c2ecf20Sopenharmony_ci	u8 agg_tids;
4518c2ecf20Sopenharmony_ci	u8 sleep_tx_count;
4528c2ecf20Sopenharmony_ci	u8 avg_energy;
4538c2ecf20Sopenharmony_ci	u8 tx_ant;
4548c2ecf20Sopenharmony_ci};
4558c2ecf20Sopenharmony_ci
4568c2ecf20Sopenharmony_ciu16 iwl_mvm_tid_queued(struct iwl_mvm *mvm, struct iwl_mvm_tid_data *tid_data);
4578c2ecf20Sopenharmony_ci
4588c2ecf20Sopenharmony_cistatic inline struct iwl_mvm_sta *
4598c2ecf20Sopenharmony_ciiwl_mvm_sta_from_mac80211(struct ieee80211_sta *sta)
4608c2ecf20Sopenharmony_ci{
4618c2ecf20Sopenharmony_ci	return (void *)sta->drv_priv;
4628c2ecf20Sopenharmony_ci}
4638c2ecf20Sopenharmony_ci
4648c2ecf20Sopenharmony_ci/**
4658c2ecf20Sopenharmony_ci * struct iwl_mvm_int_sta - representation of an internal station (auxiliary or
4668c2ecf20Sopenharmony_ci * broadcast)
4678c2ecf20Sopenharmony_ci * @sta_id: the index of the station in the fw (will be replaced by id_n_color)
4688c2ecf20Sopenharmony_ci * @type: station type
4698c2ecf20Sopenharmony_ci * @tfd_queue_msk: the tfd queues used by the station
4708c2ecf20Sopenharmony_ci */
4718c2ecf20Sopenharmony_cistruct iwl_mvm_int_sta {
4728c2ecf20Sopenharmony_ci	u32 sta_id;
4738c2ecf20Sopenharmony_ci	enum iwl_sta_type type;
4748c2ecf20Sopenharmony_ci	u32 tfd_queue_msk;
4758c2ecf20Sopenharmony_ci};
4768c2ecf20Sopenharmony_ci
4778c2ecf20Sopenharmony_ci/**
4788c2ecf20Sopenharmony_ci * Send the STA info to the FW.
4798c2ecf20Sopenharmony_ci *
4808c2ecf20Sopenharmony_ci * @mvm: the iwl_mvm* to use
4818c2ecf20Sopenharmony_ci * @sta: the STA
4828c2ecf20Sopenharmony_ci * @update: this is true if the FW is being updated about a STA it already knows
4838c2ecf20Sopenharmony_ci *	about. Otherwise (if this is a new STA), this should be false.
4848c2ecf20Sopenharmony_ci * @flags: if update==true, this marks what is being changed via ORs of values
4858c2ecf20Sopenharmony_ci *	from enum iwl_sta_modify_flag. Otherwise, this is ignored.
4868c2ecf20Sopenharmony_ci */
4878c2ecf20Sopenharmony_ciint iwl_mvm_sta_send_to_fw(struct iwl_mvm *mvm, struct ieee80211_sta *sta,
4888c2ecf20Sopenharmony_ci			   bool update, unsigned int flags);
4898c2ecf20Sopenharmony_ciint iwl_mvm_add_sta(struct iwl_mvm *mvm,
4908c2ecf20Sopenharmony_ci		    struct ieee80211_vif *vif,
4918c2ecf20Sopenharmony_ci		    struct ieee80211_sta *sta);
4928c2ecf20Sopenharmony_ci
4938c2ecf20Sopenharmony_cistatic inline int iwl_mvm_update_sta(struct iwl_mvm *mvm,
4948c2ecf20Sopenharmony_ci				     struct ieee80211_vif *vif,
4958c2ecf20Sopenharmony_ci				     struct ieee80211_sta *sta)
4968c2ecf20Sopenharmony_ci{
4978c2ecf20Sopenharmony_ci	return iwl_mvm_sta_send_to_fw(mvm, sta, true, 0);
4988c2ecf20Sopenharmony_ci}
4998c2ecf20Sopenharmony_ci
5008c2ecf20Sopenharmony_ciint iwl_mvm_wait_sta_queues_empty(struct iwl_mvm *mvm,
5018c2ecf20Sopenharmony_ci				  struct iwl_mvm_sta *mvm_sta);
5028c2ecf20Sopenharmony_ciint iwl_mvm_rm_sta(struct iwl_mvm *mvm,
5038c2ecf20Sopenharmony_ci		   struct ieee80211_vif *vif,
5048c2ecf20Sopenharmony_ci		   struct ieee80211_sta *sta);
5058c2ecf20Sopenharmony_ciint iwl_mvm_rm_sta_id(struct iwl_mvm *mvm,
5068c2ecf20Sopenharmony_ci		      struct ieee80211_vif *vif,
5078c2ecf20Sopenharmony_ci		      u8 sta_id);
5088c2ecf20Sopenharmony_ciint iwl_mvm_set_sta_key(struct iwl_mvm *mvm,
5098c2ecf20Sopenharmony_ci			struct ieee80211_vif *vif,
5108c2ecf20Sopenharmony_ci			struct ieee80211_sta *sta,
5118c2ecf20Sopenharmony_ci			struct ieee80211_key_conf *keyconf,
5128c2ecf20Sopenharmony_ci			u8 key_offset);
5138c2ecf20Sopenharmony_ciint iwl_mvm_remove_sta_key(struct iwl_mvm *mvm,
5148c2ecf20Sopenharmony_ci			   struct ieee80211_vif *vif,
5158c2ecf20Sopenharmony_ci			   struct ieee80211_sta *sta,
5168c2ecf20Sopenharmony_ci			   struct ieee80211_key_conf *keyconf);
5178c2ecf20Sopenharmony_ci
5188c2ecf20Sopenharmony_civoid iwl_mvm_update_tkip_key(struct iwl_mvm *mvm,
5198c2ecf20Sopenharmony_ci			     struct ieee80211_vif *vif,
5208c2ecf20Sopenharmony_ci			     struct ieee80211_key_conf *keyconf,
5218c2ecf20Sopenharmony_ci			     struct ieee80211_sta *sta, u32 iv32,
5228c2ecf20Sopenharmony_ci			     u16 *phase1key);
5238c2ecf20Sopenharmony_ci
5248c2ecf20Sopenharmony_civoid iwl_mvm_rx_eosp_notif(struct iwl_mvm *mvm,
5258c2ecf20Sopenharmony_ci			   struct iwl_rx_cmd_buffer *rxb);
5268c2ecf20Sopenharmony_ci
5278c2ecf20Sopenharmony_ci/* AMPDU */
5288c2ecf20Sopenharmony_ciint iwl_mvm_sta_rx_agg(struct iwl_mvm *mvm, struct ieee80211_sta *sta,
5298c2ecf20Sopenharmony_ci		       int tid, u16 ssn, bool start, u16 buf_size, u16 timeout);
5308c2ecf20Sopenharmony_ciint iwl_mvm_sta_tx_agg_start(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
5318c2ecf20Sopenharmony_ci			struct ieee80211_sta *sta, u16 tid, u16 *ssn);
5328c2ecf20Sopenharmony_ciint iwl_mvm_sta_tx_agg_oper(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
5338c2ecf20Sopenharmony_ci			    struct ieee80211_sta *sta, u16 tid, u16 buf_size,
5348c2ecf20Sopenharmony_ci			    bool amsdu);
5358c2ecf20Sopenharmony_ciint iwl_mvm_sta_tx_agg_stop(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
5368c2ecf20Sopenharmony_ci			    struct ieee80211_sta *sta, u16 tid);
5378c2ecf20Sopenharmony_ciint iwl_mvm_sta_tx_agg_flush(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
5388c2ecf20Sopenharmony_ci			    struct ieee80211_sta *sta, u16 tid);
5398c2ecf20Sopenharmony_ci
5408c2ecf20Sopenharmony_ciint iwl_mvm_sta_tx_agg(struct iwl_mvm *mvm, struct ieee80211_sta *sta,
5418c2ecf20Sopenharmony_ci		       int tid, u8 queue, bool start);
5428c2ecf20Sopenharmony_ci
5438c2ecf20Sopenharmony_ciint iwl_mvm_add_aux_sta(struct iwl_mvm *mvm, u32 lmac_id);
5448c2ecf20Sopenharmony_ciint iwl_mvm_rm_aux_sta(struct iwl_mvm *mvm);
5458c2ecf20Sopenharmony_ci
5468c2ecf20Sopenharmony_ciint iwl_mvm_alloc_bcast_sta(struct iwl_mvm *mvm, struct ieee80211_vif *vif);
5478c2ecf20Sopenharmony_ciint iwl_mvm_send_add_bcast_sta(struct iwl_mvm *mvm, struct ieee80211_vif *vif);
5488c2ecf20Sopenharmony_ciint iwl_mvm_add_p2p_bcast_sta(struct iwl_mvm *mvm, struct ieee80211_vif *vif);
5498c2ecf20Sopenharmony_ciint iwl_mvm_send_rm_bcast_sta(struct iwl_mvm *mvm, struct ieee80211_vif *vif);
5508c2ecf20Sopenharmony_ciint iwl_mvm_rm_p2p_bcast_sta(struct iwl_mvm *mvm, struct ieee80211_vif *vif);
5518c2ecf20Sopenharmony_ciint iwl_mvm_add_mcast_sta(struct iwl_mvm *mvm, struct ieee80211_vif *vif);
5528c2ecf20Sopenharmony_ciint iwl_mvm_rm_mcast_sta(struct iwl_mvm *mvm, struct ieee80211_vif *vif);
5538c2ecf20Sopenharmony_ciint iwl_mvm_allocate_int_sta(struct iwl_mvm *mvm,
5548c2ecf20Sopenharmony_ci			     struct iwl_mvm_int_sta *sta,
5558c2ecf20Sopenharmony_ci				    u32 qmask, enum nl80211_iftype iftype,
5568c2ecf20Sopenharmony_ci				    enum iwl_sta_type type);
5578c2ecf20Sopenharmony_civoid iwl_mvm_dealloc_bcast_sta(struct iwl_mvm *mvm, struct ieee80211_vif *vif);
5588c2ecf20Sopenharmony_civoid iwl_mvm_dealloc_int_sta(struct iwl_mvm *mvm, struct iwl_mvm_int_sta *sta);
5598c2ecf20Sopenharmony_ciint iwl_mvm_add_snif_sta(struct iwl_mvm *mvm, struct ieee80211_vif *vif);
5608c2ecf20Sopenharmony_ciint iwl_mvm_rm_snif_sta(struct iwl_mvm *mvm, struct ieee80211_vif *vif);
5618c2ecf20Sopenharmony_civoid iwl_mvm_dealloc_snif_sta(struct iwl_mvm *mvm);
5628c2ecf20Sopenharmony_ci
5638c2ecf20Sopenharmony_civoid iwl_mvm_sta_modify_ps_wake(struct iwl_mvm *mvm,
5648c2ecf20Sopenharmony_ci				struct ieee80211_sta *sta);
5658c2ecf20Sopenharmony_civoid iwl_mvm_sta_modify_sleep_tx_count(struct iwl_mvm *mvm,
5668c2ecf20Sopenharmony_ci				       struct ieee80211_sta *sta,
5678c2ecf20Sopenharmony_ci				       enum ieee80211_frame_release_type reason,
5688c2ecf20Sopenharmony_ci				       u16 cnt, u16 tids, bool more_data,
5698c2ecf20Sopenharmony_ci				       bool single_sta_queue);
5708c2ecf20Sopenharmony_ciint iwl_mvm_drain_sta(struct iwl_mvm *mvm, struct iwl_mvm_sta *mvmsta,
5718c2ecf20Sopenharmony_ci		      bool drain);
5728c2ecf20Sopenharmony_civoid iwl_mvm_sta_modify_disable_tx(struct iwl_mvm *mvm,
5738c2ecf20Sopenharmony_ci				   struct iwl_mvm_sta *mvmsta, bool disable);
5748c2ecf20Sopenharmony_civoid iwl_mvm_sta_modify_disable_tx_ap(struct iwl_mvm *mvm,
5758c2ecf20Sopenharmony_ci				      struct ieee80211_sta *sta,
5768c2ecf20Sopenharmony_ci				      bool disable);
5778c2ecf20Sopenharmony_civoid iwl_mvm_modify_all_sta_disable_tx(struct iwl_mvm *mvm,
5788c2ecf20Sopenharmony_ci				       struct iwl_mvm_vif *mvmvif,
5798c2ecf20Sopenharmony_ci				       bool disable);
5808c2ecf20Sopenharmony_civoid iwl_mvm_csa_client_absent(struct iwl_mvm *mvm, struct ieee80211_vif *vif);
5818c2ecf20Sopenharmony_ciint iwl_mvm_sta_ensure_queue(struct iwl_mvm *mvm, struct ieee80211_txq *txq);
5828c2ecf20Sopenharmony_civoid iwl_mvm_add_new_dqa_stream_wk(struct work_struct *wk);
5838c2ecf20Sopenharmony_ciint iwl_mvm_add_pasn_sta(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
5848c2ecf20Sopenharmony_ci			 struct iwl_mvm_int_sta *sta, u8 *addr, u32 cipher,
5858c2ecf20Sopenharmony_ci			 u8 *key, u32 key_len);
5868c2ecf20Sopenharmony_ci#endif /* __sta_h__ */
587