18e99ea8dSJohannes Berg /* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */
28e99ea8dSJohannes Berg /*
3*59505471SJohannes Berg  * Copyright (C) 2012-2014, 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_context_h__
8d172a5efSJohannes Berg #define __iwl_fw_api_context_h__
9d172a5efSJohannes Berg 
10d172a5efSJohannes Berg /**
11d172a5efSJohannes Berg  * enum iwl_ctxt_id_and_color - ID and color fields in context dword
12d172a5efSJohannes Berg  * @FW_CTXT_ID_POS: position of the ID
13d172a5efSJohannes Berg  * @FW_CTXT_ID_MSK: mask of the ID
14d172a5efSJohannes Berg  * @FW_CTXT_COLOR_POS: position of the color
15d172a5efSJohannes Berg  * @FW_CTXT_COLOR_MSK: mask of the color
16d172a5efSJohannes Berg  * @FW_CTXT_INVALID: value used to indicate unused/invalid
17d172a5efSJohannes Berg  */
18d172a5efSJohannes Berg enum iwl_ctxt_id_and_color {
19d172a5efSJohannes Berg 	FW_CTXT_ID_POS		= 0,
20d172a5efSJohannes Berg 	FW_CTXT_ID_MSK		= 0xff << FW_CTXT_ID_POS,
21d172a5efSJohannes Berg 	FW_CTXT_COLOR_POS	= 8,
22d172a5efSJohannes Berg 	FW_CTXT_COLOR_MSK	= 0xff << FW_CTXT_COLOR_POS,
23d172a5efSJohannes Berg 	FW_CTXT_INVALID		= 0xffffffff,
24d172a5efSJohannes Berg };
25d172a5efSJohannes Berg 
26d172a5efSJohannes Berg #define FW_CMD_ID_AND_COLOR(_id, _color) (((_id) << FW_CTXT_ID_POS) |\
27d172a5efSJohannes Berg 					  ((_color) << FW_CTXT_COLOR_POS))
28d172a5efSJohannes Berg 
29*59505471SJohannes Berg /**
30*59505471SJohannes Berg  * enum iwl_ctxt_action - Posssible actions on PHYs, MACs, Bindings and other
31*59505471SJohannes Berg  * @FW_CTXT_ACTION_INVALID: unused, invalid action
32*59505471SJohannes Berg  * @FW_CTXT_ACTION_ADD: add the context
33*59505471SJohannes Berg  * @FW_CTXT_ACTION_MODIFY: modify the context
34*59505471SJohannes Berg  * @FW_CTXT_ACTION_REMOVE: remove the context
35*59505471SJohannes Berg  */
36d172a5efSJohannes Berg enum iwl_ctxt_action {
37*59505471SJohannes Berg 	FW_CTXT_ACTION_INVALID = 0,
38d172a5efSJohannes Berg 	FW_CTXT_ACTION_ADD,
39d172a5efSJohannes Berg 	FW_CTXT_ACTION_MODIFY,
40d172a5efSJohannes Berg 	FW_CTXT_ACTION_REMOVE,
41d172a5efSJohannes Berg }; /* COMMON_CONTEXT_ACTION_API_E_VER_1 */
42d172a5efSJohannes Berg 
43d172a5efSJohannes Berg #endif /* __iwl_fw_api_context_h__ */
44