Path: blob/main/sys/contrib/dev/iwlwifi/mld/low_latency.h
48286 views
/* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */1/*2* Copyright (C) 2024 Intel Corporation3*/4#ifndef __iwl_mld_low_latency_h__5#define __iwl_mld_low_latency_h__67/**8* struct iwl_mld_low_latency_packets_counters - Packets counters9* @lock: synchronize the counting in data path against the worker10* @vo_vi: per-mac, counts the number of TX and RX voice and video packets11*/12struct iwl_mld_low_latency_packets_counters {13spinlock_t lock;14u32 vo_vi[NUM_MAC_INDEX_DRIVER];15} ____cacheline_aligned_in_smp;1617/**18* enum iwl_mld_low_latency_cause - low-latency set causes19*20* @LOW_LATENCY_TRAFFIC: indicates low-latency traffic was detected21* @LOW_LATENCY_DEBUGFS: low-latency mode set from debugfs22* @LOW_LATENCY_VIF_TYPE: low-latency mode set because of vif type (AP)23*/24enum iwl_mld_low_latency_cause {25LOW_LATENCY_TRAFFIC = BIT(0),26LOW_LATENCY_DEBUGFS = BIT(1),27LOW_LATENCY_VIF_TYPE = BIT(2),28};2930/**31* struct iwl_mld_low_latency - Manage low-latency detection and activation.32* @work: this work is used to detect low-latency by monitoring the number of33* voice and video packets transmitted in a period of time. If the34* threshold is reached, low-latency is activated. When active,35* it is deactivated if the threshold is not reached within a36* 10-second period.37* @timestamp: timestamp of the last update.38* @window_start: per-mac, timestamp of the start of the current window. when39* the window is over, the counters are reset.40* @pkts_counters: per-queue array voice/video packet counters41* @result: per-mac latest low-latency result42* @stopped: if true, ignore the requests to update the counters43*/44struct iwl_mld_low_latency {45struct wiphy_delayed_work work;46unsigned long timestamp;47unsigned long window_start[NUM_MAC_INDEX_DRIVER];48struct iwl_mld_low_latency_packets_counters *pkts_counters;49bool result[NUM_MAC_INDEX_DRIVER];50bool stopped;51};5253int iwl_mld_low_latency_init(struct iwl_mld *mld);54void iwl_mld_low_latency_free(struct iwl_mld *mld);55void iwl_mld_low_latency_restart_cleanup(struct iwl_mld *mld);56void iwl_mld_vif_update_low_latency(struct iwl_mld *mld,57struct ieee80211_vif *vif,58bool low_latency,59enum iwl_mld_low_latency_cause cause);60void iwl_mld_low_latency_update_counters(struct iwl_mld *mld,61struct ieee80211_hdr *hdr,62struct ieee80211_sta *sta,63u8 queue);64void iwl_mld_low_latency_stop(struct iwl_mld *mld);65void iwl_mld_low_latency_restart(struct iwl_mld *mld);6667#endif /* __iwl_mld_low_latency_h__ */686970