18e99ea8dSJohannes Berg /* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */ 28e99ea8dSJohannes Berg /* 3*59505471SJohannes Berg * Copyright (C) 2012-2014, 2020, 2022 Intel Corporation 48e99ea8dSJohannes Berg * Copyright (C) 2013-2015 Intel Mobile Communications GmbH 58e99ea8dSJohannes Berg * Copyright (C) 2016-2017 Intel Deutschland GmbH 68e99ea8dSJohannes Berg */ 7d172a5efSJohannes Berg #ifndef __iwl_fw_api_binding_h__ 8d172a5efSJohannes Berg #define __iwl_fw_api_binding_h__ 9d172a5efSJohannes Berg 10aa4936b1SNathan Errera #include <fw/file.h> 11aa4936b1SNathan Errera #include <fw/img.h> 12aa4936b1SNathan Errera 13d172a5efSJohannes Berg #define MAX_MACS_IN_BINDING (3) 14d172a5efSJohannes Berg #define MAX_BINDINGS (4) 15d172a5efSJohannes Berg 16d172a5efSJohannes Berg /** 17d172a5efSJohannes Berg * struct iwl_binding_cmd_v1 - configuring bindings 18d172a5efSJohannes Berg * ( BINDING_CONTEXT_CMD = 0x2b ) 19d172a5efSJohannes Berg * @id_and_color: ID and color of the relevant Binding, 20d172a5efSJohannes Berg * &enum iwl_ctxt_id_and_color 21*59505471SJohannes Berg * @action: action to perform, see &enum iwl_ctxt_action 22d172a5efSJohannes Berg * @macs: array of MAC id and colors which belong to the binding, 23d172a5efSJohannes Berg * &enum iwl_ctxt_id_and_color 24d172a5efSJohannes Berg * @phy: PHY id and color which belongs to the binding, 25d172a5efSJohannes Berg * &enum iwl_ctxt_id_and_color 26d172a5efSJohannes Berg */ 27d172a5efSJohannes Berg struct iwl_binding_cmd_v1 { 28d172a5efSJohannes Berg /* COMMON_INDEX_HDR_API_S_VER_1 */ 29d172a5efSJohannes Berg __le32 id_and_color; 30d172a5efSJohannes Berg __le32 action; 31d172a5efSJohannes Berg /* BINDING_DATA_API_S_VER_1 */ 32d172a5efSJohannes Berg __le32 macs[MAX_MACS_IN_BINDING]; 33d172a5efSJohannes Berg __le32 phy; 34d172a5efSJohannes Berg } __packed; /* BINDING_CMD_API_S_VER_1 */ 35d172a5efSJohannes Berg 36d172a5efSJohannes Berg /** 37d172a5efSJohannes Berg * struct iwl_binding_cmd - configuring bindings 38d172a5efSJohannes Berg * ( BINDING_CONTEXT_CMD = 0x2b ) 39d172a5efSJohannes Berg * @id_and_color: ID and color of the relevant Binding, 40d172a5efSJohannes Berg * &enum iwl_ctxt_id_and_color 41*59505471SJohannes Berg * @action: action to perform, see &enum iwl_ctxt_action 42d172a5efSJohannes Berg * @macs: array of MAC id and colors which belong to the binding 43d172a5efSJohannes Berg * &enum iwl_ctxt_id_and_color 44d172a5efSJohannes Berg * @phy: PHY id and color which belongs to the binding 45d172a5efSJohannes Berg * &enum iwl_ctxt_id_and_color 46d172a5efSJohannes Berg * @lmac_id: the lmac id the binding belongs to 47d172a5efSJohannes Berg */ 48d172a5efSJohannes Berg struct iwl_binding_cmd { 49d172a5efSJohannes Berg /* COMMON_INDEX_HDR_API_S_VER_1 */ 50d172a5efSJohannes Berg __le32 id_and_color; 51d172a5efSJohannes Berg __le32 action; 52d172a5efSJohannes Berg /* BINDING_DATA_API_S_VER_1 */ 53d172a5efSJohannes Berg __le32 macs[MAX_MACS_IN_BINDING]; 54d172a5efSJohannes Berg __le32 phy; 55d172a5efSJohannes Berg __le32 lmac_id; 56d172a5efSJohannes Berg } __packed; /* BINDING_CMD_API_S_VER_2 */ 57d172a5efSJohannes Berg 58d172a5efSJohannes Berg #define IWL_BINDING_CMD_SIZE_V1 sizeof(struct iwl_binding_cmd_v1) 59d172a5efSJohannes Berg #define IWL_LMAC_24G_INDEX 0 60d172a5efSJohannes Berg #define IWL_LMAC_5G_INDEX 1 61d172a5efSJohannes Berg 62d172a5efSJohannes Berg /* The maximal number of fragments in the FW's schedule session */ 63d172a5efSJohannes Berg #define IWL_MVM_MAX_QUOTA 128 64d172a5efSJohannes Berg 65d172a5efSJohannes Berg /** 6672cbb73eSDavid Spinadel * struct iwl_time_quota_data_v1 - configuration of time quota per binding 67d172a5efSJohannes Berg * @id_and_color: ID and color of the relevant Binding, 68d172a5efSJohannes Berg * &enum iwl_ctxt_id_and_color 69d172a5efSJohannes Berg * @quota: absolute time quota in TU. The scheduler will try to divide the 70d172a5efSJohannes Berg * remainig quota (after Time Events) according to this quota. 71d172a5efSJohannes Berg * @max_duration: max uninterrupted context duration in TU 72d172a5efSJohannes Berg */ 7372cbb73eSDavid Spinadel struct iwl_time_quota_data_v1 { 74d172a5efSJohannes Berg __le32 id_and_color; 75d172a5efSJohannes Berg __le32 quota; 76d172a5efSJohannes Berg __le32 max_duration; 77d172a5efSJohannes Berg } __packed; /* TIME_QUOTA_DATA_API_S_VER_1 */ 78d172a5efSJohannes Berg 79d172a5efSJohannes Berg /** 80d172a5efSJohannes Berg * struct iwl_time_quota_cmd - configuration of time quota between bindings 81d172a5efSJohannes Berg * ( TIME_QUOTA_CMD = 0x2c ) 82d172a5efSJohannes Berg * @quotas: allocations per binding 83d172a5efSJohannes Berg * Note: on non-CDB the fourth one is the auxilary mac and is 84d172a5efSJohannes Berg * essentially zero. 85d172a5efSJohannes Berg * On CDB the fourth one is a regular binding. 86d172a5efSJohannes Berg */ 8772cbb73eSDavid Spinadel struct iwl_time_quota_cmd_v1 { 8872cbb73eSDavid Spinadel struct iwl_time_quota_data_v1 quotas[MAX_BINDINGS]; 8972cbb73eSDavid Spinadel } __packed; /* TIME_QUOTA_ALLOCATION_CMD_API_S_VER_1 */ 9072cbb73eSDavid Spinadel 9172cbb73eSDavid Spinadel enum iwl_quota_low_latency { 9272cbb73eSDavid Spinadel IWL_QUOTA_LOW_LATENCY_NONE = 0, 9372cbb73eSDavid Spinadel IWL_QUOTA_LOW_LATENCY_TX = BIT(0), 9472cbb73eSDavid Spinadel IWL_QUOTA_LOW_LATENCY_RX = BIT(1), 9572cbb73eSDavid Spinadel IWL_QUOTA_LOW_LATENCY_TX_RX = 9672cbb73eSDavid Spinadel IWL_QUOTA_LOW_LATENCY_TX | IWL_QUOTA_LOW_LATENCY_RX, 9772cbb73eSDavid Spinadel }; 9872cbb73eSDavid Spinadel 9972cbb73eSDavid Spinadel /** 10072cbb73eSDavid Spinadel * struct iwl_time_quota_data - configuration of time quota per binding 10172cbb73eSDavid Spinadel * @id_and_color: ID and color of the relevant Binding. 10272cbb73eSDavid Spinadel * @quota: absolute time quota in TU. The scheduler will try to divide the 10372cbb73eSDavid Spinadel * remainig quota (after Time Events) according to this quota. 10472cbb73eSDavid Spinadel * @max_duration: max uninterrupted context duration in TU 10572cbb73eSDavid Spinadel * @low_latency: low latency status, &enum iwl_quota_low_latency 10672cbb73eSDavid Spinadel */ 10772cbb73eSDavid Spinadel struct iwl_time_quota_data { 10872cbb73eSDavid Spinadel __le32 id_and_color; 10972cbb73eSDavid Spinadel __le32 quota; 11072cbb73eSDavid Spinadel __le32 max_duration; 11172cbb73eSDavid Spinadel __le32 low_latency; 11272cbb73eSDavid Spinadel } __packed; /* TIME_QUOTA_DATA_API_S_VER_2 */ 11372cbb73eSDavid Spinadel 11472cbb73eSDavid Spinadel /** 11572cbb73eSDavid Spinadel * struct iwl_time_quota_cmd - configuration of time quota between bindings 11672cbb73eSDavid Spinadel * ( TIME_QUOTA_CMD = 0x2c ) 11772cbb73eSDavid Spinadel * Note: on non-CDB the fourth one is the auxilary mac and is essentially zero. 11872cbb73eSDavid Spinadel * On CDB the fourth one is a regular binding. 11972cbb73eSDavid Spinadel * 12072cbb73eSDavid Spinadel * @quotas: allocations per binding 12172cbb73eSDavid Spinadel */ 122d172a5efSJohannes Berg struct iwl_time_quota_cmd { 123d172a5efSJohannes Berg struct iwl_time_quota_data quotas[MAX_BINDINGS]; 12472cbb73eSDavid Spinadel } __packed; /* TIME_QUOTA_ALLOCATION_CMD_API_S_VER_2 */ 125d172a5efSJohannes Berg 126d172a5efSJohannes Berg #endif /* __iwl_fw_api_binding_h__ */ 127