Lines Matching +full:low +full:- +full:latency
1 // SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause
3 * Copyright (C) 2012-2014, 2018, 2021-2022 Intel Corporation
4 * Copyright (C) 2013-2014 Intel Mobile Communications GmbH
5 * Copyright (C) 2016-2017 Intel Deutschland GmbH
8 #include "fw-api.h"
33 if (vif == data->disabled_vif) in iwl_mvm_quota_iterator()
36 if (!mvmvif->deflink.phy_ctxt) in iwl_mvm_quota_iterator()
40 id = mvmvif->deflink.phy_ctxt->id; in iwl_mvm_quota_iterator()
48 switch (vif->type) { in iwl_mvm_quota_iterator()
50 if (vif->cfg.assoc) in iwl_mvm_quota_iterator()
55 if (mvmvif->ap_ibss_active) in iwl_mvm_quota_iterator()
59 if (mvmvif->monitor_active) in iwl_mvm_quota_iterator()
69 if (data->colors[id] < 0) in iwl_mvm_quota_iterator()
70 data->colors[id] = mvmvif->deflink.phy_ctxt->color; in iwl_mvm_quota_iterator()
72 WARN_ON_ONCE(data->colors[id] != in iwl_mvm_quota_iterator()
73 mvmvif->deflink.phy_ctxt->color); in iwl_mvm_quota_iterator()
75 data->n_interfaces[id]++; in iwl_mvm_quota_iterator()
78 if (mvmvif->dbgfs_quota_min) in iwl_mvm_quota_iterator()
79 data->dbgfs_min[id] = max(data->dbgfs_min[id], in iwl_mvm_quota_iterator()
80 mvmvif->dbgfs_quota_min); in iwl_mvm_quota_iterator()
83 if (iwl_mvm_vif_low_latency(mvmvif) && !data->low_latency[id]) { in iwl_mvm_quota_iterator()
84 data->n_low_latency_bindings++; in iwl_mvm_quota_iterator()
85 data->low_latency[id] = true; in iwl_mvm_quota_iterator()
94 int i, phy_id = -1, beacon_int = 0; in iwl_mvm_adjust_quota_for_noa()
96 if (!mvm->noa_duration || !mvm->noa_vif) in iwl_mvm_adjust_quota_for_noa()
99 mvmvif = iwl_mvm_vif_from_mac80211(mvm->noa_vif); in iwl_mvm_adjust_quota_for_noa()
100 if (!mvmvif->ap_ibss_active) in iwl_mvm_adjust_quota_for_noa()
103 phy_id = mvmvif->deflink.phy_ctxt->id; in iwl_mvm_adjust_quota_for_noa()
104 beacon_int = mvm->noa_vif->bss_conf.beacon_int; in iwl_mvm_adjust_quota_for_noa()
110 u32 id_n_c = le32_to_cpu(data->id_and_color); in iwl_mvm_adjust_quota_for_noa()
112 u32 quota = le32_to_cpu(data->quota); in iwl_mvm_adjust_quota_for_noa()
117 quota *= (beacon_int - mvm->noa_duration); in iwl_mvm_adjust_quota_for_noa()
121 le32_to_cpu(data->quota), quota); in iwl_mvm_adjust_quota_for_noa()
123 data->quota = cpu_to_le32(quota); in iwl_mvm_adjust_quota_for_noa()
136 .colors = { -1, -1, -1, -1 }, in iwl_mvm_update_quotas()
139 struct iwl_time_quota_cmd *last = &mvm->last_quota_cmd; in iwl_mvm_update_quotas()
143 lockdep_assert_held(&mvm->mutex); in iwl_mvm_update_quotas()
145 if (fw_has_capa(&mvm->fw->ucode_capa, in iwl_mvm_update_quotas()
150 if (test_bit(IWL_MVM_STATUS_IN_HW_RESTART, &mvm->status)) in iwl_mvm_update_quotas()
157 mvm->hw, IEEE80211_IFACE_ITER_NORMAL, in iwl_mvm_update_quotas()
168 qdata->id_and_color = cpu_to_le32(FW_CTXT_INVALID); in iwl_mvm_update_quotas()
177 n_non_lowlat -= data.n_interfaces[i]; in iwl_mvm_update_quotas()
185 * Reserve quota for the low latency binding in case that in iwl_mvm_update_quotas()
187 * low latency one. Split the rest of the quota equally in iwl_mvm_update_quotas()
190 quota = (QUOTA_100 - QUOTA_LOWLAT_MIN) / n_non_lowlat; in iwl_mvm_update_quotas()
191 quota_rem = QUOTA_100 - n_non_lowlat * quota - in iwl_mvm_update_quotas()
194 "quota: low-latency binding active, remaining quota per other binding: %d\n", in iwl_mvm_update_quotas()
198 * There are 0 or more than 1 low latency bindings, or all the in iwl_mvm_update_quotas()
199 * data interfaces belong to the single low latency binding. in iwl_mvm_update_quotas()
208 /* values don't really matter - won't be used */ in iwl_mvm_update_quotas()
219 qdata->id_and_color = in iwl_mvm_update_quotas()
223 qdata->quota = cpu_to_le32(0); in iwl_mvm_update_quotas()
226 qdata->quota = in iwl_mvm_update_quotas()
233 * bindings is in low latency. For this case, allocate in iwl_mvm_update_quotas()
234 * the minimal required quota for the low latency in iwl_mvm_update_quotas()
237 qdata->quota = cpu_to_le32(QUOTA_LOWLAT_MIN); in iwl_mvm_update_quotas()
239 qdata->quota = in iwl_mvm_update_quotas()
242 WARN_ONCE(le32_to_cpu(qdata->quota) > QUOTA_100, in iwl_mvm_update_quotas()
244 idx, le32_to_cpu(qdata->quota), QUOTA_100); in iwl_mvm_update_quotas()
246 qdata->max_duration = cpu_to_le32(0); in iwl_mvm_update_quotas()
254 if (le32_to_cpu(qdata->quota) != 0) { in iwl_mvm_update_quotas()
255 le32_add_cpu(&qdata->quota, quota_rem); in iwl_mvm_update_quotas()
265 /* check that we have non-zero quota for all valid bindings */ in iwl_mvm_update_quotas()
269 if (qdata->id_and_color != last_data->id_and_color) in iwl_mvm_update_quotas()
271 if (qdata->max_duration != last_data->max_duration) in iwl_mvm_update_quotas()
273 if (abs((int)le32_to_cpu(qdata->quota) - in iwl_mvm_update_quotas()
274 (int)le32_to_cpu(last_data->quota)) in iwl_mvm_update_quotas()
277 if (qdata->id_and_color == cpu_to_le32(FW_CTXT_INVALID)) in iwl_mvm_update_quotas()
279 WARN_ONCE(qdata->quota == 0, in iwl_mvm_update_quotas()
285 * to re-initialize a lot of state and that can have an adverse in iwl_mvm_update_quotas()
297 mvm->last_quota_cmd = cmd; in iwl_mvm_update_quotas()