Loading...
1/* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */
2/*
3 * Copyright (C) 2012-2014, 2020, 2022 Intel Corporation
4 * Copyright (C) 2013-2015 Intel Mobile Communications GmbH
5 * Copyright (C) 2016-2017 Intel Deutschland GmbH
6 */
7#ifndef __iwl_fw_api_binding_h__
8#define __iwl_fw_api_binding_h__
9
10#include <fw/file.h>
11#include <fw/img.h>
12
13#define MAX_MACS_IN_BINDING (3)
14#define MAX_BINDINGS (4)
15
16/**
17 * struct iwl_binding_cmd_v1 - configuring bindings
18 * ( BINDING_CONTEXT_CMD = 0x2b )
19 * @id_and_color: ID and color of the relevant Binding,
20 * &enum iwl_ctxt_id_and_color
21 * @action: action to perform, see &enum iwl_ctxt_action
22 * @macs: array of MAC id and colors which belong to the binding,
23 * &enum iwl_ctxt_id_and_color
24 * @phy: PHY id and color which belongs to the binding,
25 * &enum iwl_ctxt_id_and_color
26 */
27struct iwl_binding_cmd_v1 {
28 /* COMMON_INDEX_HDR_API_S_VER_1 */
29 __le32 id_and_color;
30 __le32 action;
31 /* BINDING_DATA_API_S_VER_1 */
32 __le32 macs[MAX_MACS_IN_BINDING];
33 __le32 phy;
34} __packed; /* BINDING_CMD_API_S_VER_1 */
35
36/**
37 * struct iwl_binding_cmd - configuring bindings
38 * ( BINDING_CONTEXT_CMD = 0x2b )
39 * @id_and_color: ID and color of the relevant Binding,
40 * &enum iwl_ctxt_id_and_color
41 * @action: action to perform, see &enum iwl_ctxt_action
42 * @macs: array of MAC id and colors which belong to the binding
43 * &enum iwl_ctxt_id_and_color
44 * @phy: PHY id and color which belongs to the binding
45 * &enum iwl_ctxt_id_and_color
46 * @lmac_id: the lmac id the binding belongs to
47 */
48struct iwl_binding_cmd {
49 /* COMMON_INDEX_HDR_API_S_VER_1 */
50 __le32 id_and_color;
51 __le32 action;
52 /* BINDING_DATA_API_S_VER_1 */
53 __le32 macs[MAX_MACS_IN_BINDING];
54 __le32 phy;
55 __le32 lmac_id;
56} __packed; /* BINDING_CMD_API_S_VER_2 */
57
58#define IWL_BINDING_CMD_SIZE_V1 sizeof(struct iwl_binding_cmd_v1)
59#define IWL_LMAC_24G_INDEX 0
60#define IWL_LMAC_5G_INDEX 1
61
62/* The maximal number of fragments in the FW's schedule session */
63#define IWL_MVM_MAX_QUOTA 128
64
65/**
66 * struct iwl_time_quota_data_v1 - configuration of time quota per binding
67 * @id_and_color: ID and color of the relevant Binding,
68 * &enum iwl_ctxt_id_and_color
69 * @quota: absolute time quota in TU. The scheduler will try to divide the
70 * remainig quota (after Time Events) according to this quota.
71 * @max_duration: max uninterrupted context duration in TU
72 */
73struct iwl_time_quota_data_v1 {
74 __le32 id_and_color;
75 __le32 quota;
76 __le32 max_duration;
77} __packed; /* TIME_QUOTA_DATA_API_S_VER_1 */
78
79/**
80 * struct iwl_time_quota_cmd - configuration of time quota between bindings
81 * ( TIME_QUOTA_CMD = 0x2c )
82 * @quotas: allocations per binding
83 * Note: on non-CDB the fourth one is the auxilary mac and is
84 * essentially zero.
85 * On CDB the fourth one is a regular binding.
86 */
87struct iwl_time_quota_cmd_v1 {
88 struct iwl_time_quota_data_v1 quotas[MAX_BINDINGS];
89} __packed; /* TIME_QUOTA_ALLOCATION_CMD_API_S_VER_1 */
90
91enum iwl_quota_low_latency {
92 IWL_QUOTA_LOW_LATENCY_NONE = 0,
93 IWL_QUOTA_LOW_LATENCY_TX = BIT(0),
94 IWL_QUOTA_LOW_LATENCY_RX = BIT(1),
95 IWL_QUOTA_LOW_LATENCY_TX_RX =
96 IWL_QUOTA_LOW_LATENCY_TX | IWL_QUOTA_LOW_LATENCY_RX,
97};
98
99/**
100 * struct iwl_time_quota_data - configuration of time quota per binding
101 * @id_and_color: ID and color of the relevant Binding.
102 * @quota: absolute time quota in TU. The scheduler will try to divide the
103 * remainig quota (after Time Events) according to this quota.
104 * @max_duration: max uninterrupted context duration in TU
105 * @low_latency: low latency status, &enum iwl_quota_low_latency
106 */
107struct iwl_time_quota_data {
108 __le32 id_and_color;
109 __le32 quota;
110 __le32 max_duration;
111 __le32 low_latency;
112} __packed; /* TIME_QUOTA_DATA_API_S_VER_2 */
113
114/**
115 * struct iwl_time_quota_cmd - configuration of time quota between bindings
116 * ( TIME_QUOTA_CMD = 0x2c )
117 * Note: on non-CDB the fourth one is the auxilary mac and is essentially zero.
118 * On CDB the fourth one is a regular binding.
119 *
120 * @quotas: allocations per binding
121 */
122struct iwl_time_quota_cmd {
123 struct iwl_time_quota_data quotas[MAX_BINDINGS];
124} __packed; /* TIME_QUOTA_ALLOCATION_CMD_API_S_VER_2 */
125
126#endif /* __iwl_fw_api_binding_h__ */
1/******************************************************************************
2 *
3 * This file is provided under a dual BSD/GPLv2 license. When using or
4 * redistributing this file, you may do so under either license.
5 *
6 * GPL LICENSE SUMMARY
7 *
8 * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved.
9 * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH
10 * Copyright(c) 2016 - 2017 Intel Deutschland GmbH
11 *
12 * This program is free software; you can redistribute it and/or modify
13 * it under the terms of version 2 of the GNU General Public License as
14 * published by the Free Software Foundation.
15 *
16 * This program is distributed in the hope that it will be useful, but
17 * WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 * General Public License for more details.
20 *
21 * The full GNU General Public License is included in this distribution
22 * in the file called COPYING.
23 *
24 * Contact Information:
25 * Intel Linux Wireless <linuxwifi@intel.com>
26 * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
27 *
28 * BSD LICENSE
29 *
30 * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved.
31 * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH
32 * Copyright(c) 2016 - 2017 Intel Deutschland GmbH
33 * All rights reserved.
34 *
35 * Redistribution and use in source and binary forms, with or without
36 * modification, are permitted provided that the following conditions
37 * are met:
38 *
39 * * Redistributions of source code must retain the above copyright
40 * notice, this list of conditions and the following disclaimer.
41 * * Redistributions in binary form must reproduce the above copyright
42 * notice, this list of conditions and the following disclaimer in
43 * the documentation and/or other materials provided with the
44 * distribution.
45 * * Neither the name Intel Corporation nor the names of its
46 * contributors may be used to endorse or promote products derived
47 * from this software without specific prior written permission.
48 *
49 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
50 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
51 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
52 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
53 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
54 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
55 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
56 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
57 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
58 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
59 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
60 *
61 *****************************************************************************/
62
63#ifndef __iwl_fw_api_binding_h__
64#define __iwl_fw_api_binding_h__
65
66#define MAX_MACS_IN_BINDING (3)
67#define MAX_BINDINGS (4)
68
69/**
70 * struct iwl_binding_cmd_v1 - configuring bindings
71 * ( BINDING_CONTEXT_CMD = 0x2b )
72 * @id_and_color: ID and color of the relevant Binding,
73 * &enum iwl_ctxt_id_and_color
74 * @action: action to perform, one of FW_CTXT_ACTION_*
75 * @macs: array of MAC id and colors which belong to the binding,
76 * &enum iwl_ctxt_id_and_color
77 * @phy: PHY id and color which belongs to the binding,
78 * &enum iwl_ctxt_id_and_color
79 */
80struct iwl_binding_cmd_v1 {
81 /* COMMON_INDEX_HDR_API_S_VER_1 */
82 __le32 id_and_color;
83 __le32 action;
84 /* BINDING_DATA_API_S_VER_1 */
85 __le32 macs[MAX_MACS_IN_BINDING];
86 __le32 phy;
87} __packed; /* BINDING_CMD_API_S_VER_1 */
88
89/**
90 * struct iwl_binding_cmd - configuring bindings
91 * ( BINDING_CONTEXT_CMD = 0x2b )
92 * @id_and_color: ID and color of the relevant Binding,
93 * &enum iwl_ctxt_id_and_color
94 * @action: action to perform, one of FW_CTXT_ACTION_*
95 * @macs: array of MAC id and colors which belong to the binding
96 * &enum iwl_ctxt_id_and_color
97 * @phy: PHY id and color which belongs to the binding
98 * &enum iwl_ctxt_id_and_color
99 * @lmac_id: the lmac id the binding belongs to
100 */
101struct iwl_binding_cmd {
102 /* COMMON_INDEX_HDR_API_S_VER_1 */
103 __le32 id_and_color;
104 __le32 action;
105 /* BINDING_DATA_API_S_VER_1 */
106 __le32 macs[MAX_MACS_IN_BINDING];
107 __le32 phy;
108 __le32 lmac_id;
109} __packed; /* BINDING_CMD_API_S_VER_2 */
110
111#define IWL_BINDING_CMD_SIZE_V1 sizeof(struct iwl_binding_cmd_v1)
112#define IWL_LMAC_24G_INDEX 0
113#define IWL_LMAC_5G_INDEX 1
114
115/* The maximal number of fragments in the FW's schedule session */
116#define IWL_MVM_MAX_QUOTA 128
117
118/**
119 * struct iwl_time_quota_data_v1 - configuration of time quota per binding
120 * @id_and_color: ID and color of the relevant Binding,
121 * &enum iwl_ctxt_id_and_color
122 * @quota: absolute time quota in TU. The scheduler will try to divide the
123 * remainig quota (after Time Events) according to this quota.
124 * @max_duration: max uninterrupted context duration in TU
125 */
126struct iwl_time_quota_data_v1 {
127 __le32 id_and_color;
128 __le32 quota;
129 __le32 max_duration;
130} __packed; /* TIME_QUOTA_DATA_API_S_VER_1 */
131
132/**
133 * struct iwl_time_quota_cmd - configuration of time quota between bindings
134 * ( TIME_QUOTA_CMD = 0x2c )
135 * @quotas: allocations per binding
136 * Note: on non-CDB the fourth one is the auxilary mac and is
137 * essentially zero.
138 * On CDB the fourth one is a regular binding.
139 */
140struct iwl_time_quota_cmd_v1 {
141 struct iwl_time_quota_data_v1 quotas[MAX_BINDINGS];
142} __packed; /* TIME_QUOTA_ALLOCATION_CMD_API_S_VER_1 */
143
144enum iwl_quota_low_latency {
145 IWL_QUOTA_LOW_LATENCY_NONE = 0,
146 IWL_QUOTA_LOW_LATENCY_TX = BIT(0),
147 IWL_QUOTA_LOW_LATENCY_RX = BIT(1),
148 IWL_QUOTA_LOW_LATENCY_TX_RX =
149 IWL_QUOTA_LOW_LATENCY_TX | IWL_QUOTA_LOW_LATENCY_RX,
150};
151
152/**
153 * struct iwl_time_quota_data - configuration of time quota per binding
154 * @id_and_color: ID and color of the relevant Binding.
155 * @quota: absolute time quota in TU. The scheduler will try to divide the
156 * remainig quota (after Time Events) according to this quota.
157 * @max_duration: max uninterrupted context duration in TU
158 * @low_latency: low latency status, &enum iwl_quota_low_latency
159 */
160struct iwl_time_quota_data {
161 __le32 id_and_color;
162 __le32 quota;
163 __le32 max_duration;
164 __le32 low_latency;
165} __packed; /* TIME_QUOTA_DATA_API_S_VER_2 */
166
167/**
168 * struct iwl_time_quota_cmd - configuration of time quota between bindings
169 * ( TIME_QUOTA_CMD = 0x2c )
170 * Note: on non-CDB the fourth one is the auxilary mac and is essentially zero.
171 * On CDB the fourth one is a regular binding.
172 *
173 * @quotas: allocations per binding
174 */
175struct iwl_time_quota_cmd {
176 struct iwl_time_quota_data quotas[MAX_BINDINGS];
177} __packed; /* TIME_QUOTA_ALLOCATION_CMD_API_S_VER_2 */
178
179#endif /* __iwl_fw_api_binding_h__ */