xref: /freebsd/sys/contrib/dev/iwlwifi/fw/api/context.h (revision 9af1bba44e1ce9b0296ae56760b564d67ab7a1cf)
1bfcc09ddSBjoern A. Zeeb /* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */
2bfcc09ddSBjoern A. Zeeb /*
3*9af1bba4SBjoern A. Zeeb  * Copyright (C) 2012-2014, 2022 Intel Corporation
4bfcc09ddSBjoern A. Zeeb  * Copyright (C) 2013-2015 Intel Mobile Communications GmbH
5bfcc09ddSBjoern A. Zeeb  * Copyright (C) 2016-2017 Intel Deutschland GmbH
6bfcc09ddSBjoern A. Zeeb  */
7bfcc09ddSBjoern A. Zeeb #ifndef __iwl_fw_api_context_h__
8bfcc09ddSBjoern A. Zeeb #define __iwl_fw_api_context_h__
9bfcc09ddSBjoern A. Zeeb 
10bfcc09ddSBjoern A. Zeeb /**
11bfcc09ddSBjoern A. Zeeb  * enum iwl_ctxt_id_and_color - ID and color fields in context dword
12bfcc09ddSBjoern A. Zeeb  * @FW_CTXT_ID_POS: position of the ID
13bfcc09ddSBjoern A. Zeeb  * @FW_CTXT_ID_MSK: mask of the ID
14bfcc09ddSBjoern A. Zeeb  * @FW_CTXT_COLOR_POS: position of the color
15bfcc09ddSBjoern A. Zeeb  * @FW_CTXT_COLOR_MSK: mask of the color
16bfcc09ddSBjoern A. Zeeb  * @FW_CTXT_INVALID: value used to indicate unused/invalid
17bfcc09ddSBjoern A. Zeeb  */
18bfcc09ddSBjoern A. Zeeb enum iwl_ctxt_id_and_color {
19bfcc09ddSBjoern A. Zeeb 	FW_CTXT_ID_POS		= 0,
20bfcc09ddSBjoern A. Zeeb 	FW_CTXT_ID_MSK		= 0xff << FW_CTXT_ID_POS,
21bfcc09ddSBjoern A. Zeeb 	FW_CTXT_COLOR_POS	= 8,
22bfcc09ddSBjoern A. Zeeb 	FW_CTXT_COLOR_MSK	= 0xff << FW_CTXT_COLOR_POS,
23bfcc09ddSBjoern A. Zeeb 	FW_CTXT_INVALID		= 0xffffffff,
24bfcc09ddSBjoern A. Zeeb };
25bfcc09ddSBjoern A. Zeeb 
26bfcc09ddSBjoern A. Zeeb #define FW_CMD_ID_AND_COLOR(_id, _color) (((_id) << FW_CTXT_ID_POS) |\
27bfcc09ddSBjoern A. Zeeb 					  ((_color) << FW_CTXT_COLOR_POS))
28bfcc09ddSBjoern A. Zeeb 
29*9af1bba4SBjoern A. Zeeb /**
30*9af1bba4SBjoern A. Zeeb  * enum iwl_ctxt_action - Posssible actions on PHYs, MACs, Bindings and other
31*9af1bba4SBjoern A. Zeeb  * @FW_CTXT_ACTION_INVALID: unused, invalid action
32*9af1bba4SBjoern A. Zeeb  * @FW_CTXT_ACTION_ADD: add the context
33*9af1bba4SBjoern A. Zeeb  * @FW_CTXT_ACTION_MODIFY: modify the context
34*9af1bba4SBjoern A. Zeeb  * @FW_CTXT_ACTION_REMOVE: remove the context
35*9af1bba4SBjoern A. Zeeb  */
36bfcc09ddSBjoern A. Zeeb enum iwl_ctxt_action {
37*9af1bba4SBjoern A. Zeeb 	FW_CTXT_ACTION_INVALID = 0,
38bfcc09ddSBjoern A. Zeeb 	FW_CTXT_ACTION_ADD,
39bfcc09ddSBjoern A. Zeeb 	FW_CTXT_ACTION_MODIFY,
40bfcc09ddSBjoern A. Zeeb 	FW_CTXT_ACTION_REMOVE,
41bfcc09ddSBjoern A. Zeeb }; /* COMMON_CONTEXT_ACTION_API_E_VER_1 */
42bfcc09ddSBjoern A. Zeeb 
43bfcc09ddSBjoern A. Zeeb #endif /* __iwl_fw_api_context_h__ */
44