1d172a5efSJohannes Berg /******************************************************************************
2d172a5efSJohannes Berg  *
3d172a5efSJohannes Berg  * This file is provided under a dual BSD/GPLv2 license.  When using or
4d172a5efSJohannes Berg  * redistributing this file, you may do so under either license.
5d172a5efSJohannes Berg  *
6d172a5efSJohannes Berg  * GPL LICENSE SUMMARY
7d172a5efSJohannes Berg  *
8d172a5efSJohannes Berg  * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved.
9d172a5efSJohannes Berg  * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH
10d172a5efSJohannes Berg  * Copyright(c) 2016 - 2017 Intel Deutschland GmbH
11d172a5efSJohannes Berg  *
12d172a5efSJohannes Berg  * This program is free software; you can redistribute it and/or modify
13d172a5efSJohannes Berg  * it under the terms of version 2 of the GNU General Public License as
14d172a5efSJohannes Berg  * published by the Free Software Foundation.
15d172a5efSJohannes Berg  *
16d172a5efSJohannes Berg  * This program is distributed in the hope that it will be useful, but
17d172a5efSJohannes Berg  * WITHOUT ANY WARRANTY; without even the implied warranty of
18d172a5efSJohannes Berg  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
19d172a5efSJohannes Berg  * General Public License for more details.
20d172a5efSJohannes Berg  *
21d172a5efSJohannes Berg  * The full GNU General Public License is included in this distribution
22d172a5efSJohannes Berg  * in the file called COPYING.
23d172a5efSJohannes Berg  *
24d172a5efSJohannes Berg  * Contact Information:
25d172a5efSJohannes Berg  *  Intel Linux Wireless <linuxwifi@intel.com>
26d172a5efSJohannes Berg  * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
27d172a5efSJohannes Berg  *
28d172a5efSJohannes Berg  * BSD LICENSE
29d172a5efSJohannes Berg  *
30d172a5efSJohannes Berg  * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved.
31d172a5efSJohannes Berg  * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH
32d172a5efSJohannes Berg  * Copyright(c) 2016 - 2017 Intel Deutschland GmbH
33d172a5efSJohannes Berg  * All rights reserved.
34d172a5efSJohannes Berg  *
35d172a5efSJohannes Berg  * Redistribution and use in source and binary forms, with or without
36d172a5efSJohannes Berg  * modification, are permitted provided that the following conditions
37d172a5efSJohannes Berg  * are met:
38d172a5efSJohannes Berg  *
39d172a5efSJohannes Berg  *  * Redistributions of source code must retain the above copyright
40d172a5efSJohannes Berg  *    notice, this list of conditions and the following disclaimer.
41d172a5efSJohannes Berg  *  * Redistributions in binary form must reproduce the above copyright
42d172a5efSJohannes Berg  *    notice, this list of conditions and the following disclaimer in
43d172a5efSJohannes Berg  *    the documentation and/or other materials provided with the
44d172a5efSJohannes Berg  *    distribution.
45d172a5efSJohannes Berg  *  * Neither the name Intel Corporation nor the names of its
46d172a5efSJohannes Berg  *    contributors may be used to endorse or promote products derived
47d172a5efSJohannes Berg  *    from this software without specific prior written permission.
48d172a5efSJohannes Berg  *
49d172a5efSJohannes Berg  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
50d172a5efSJohannes Berg  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
51d172a5efSJohannes Berg  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
52d172a5efSJohannes Berg  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
53d172a5efSJohannes Berg  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
54d172a5efSJohannes Berg  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
55d172a5efSJohannes Berg  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
56d172a5efSJohannes Berg  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
57d172a5efSJohannes Berg  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
58d172a5efSJohannes Berg  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
59d172a5efSJohannes Berg  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
60d172a5efSJohannes Berg  *
61d172a5efSJohannes Berg  *****************************************************************************/
62d172a5efSJohannes Berg 
63d172a5efSJohannes Berg #ifndef __iwl_fw_api_context_h__
64d172a5efSJohannes Berg #define __iwl_fw_api_context_h__
65d172a5efSJohannes Berg 
66d172a5efSJohannes Berg /**
67d172a5efSJohannes Berg  * enum iwl_ctxt_id_and_color - ID and color fields in context dword
68d172a5efSJohannes Berg  * @FW_CTXT_ID_POS: position of the ID
69d172a5efSJohannes Berg  * @FW_CTXT_ID_MSK: mask of the ID
70d172a5efSJohannes Berg  * @FW_CTXT_COLOR_POS: position of the color
71d172a5efSJohannes Berg  * @FW_CTXT_COLOR_MSK: mask of the color
72d172a5efSJohannes Berg  * @FW_CTXT_INVALID: value used to indicate unused/invalid
73d172a5efSJohannes Berg  */
74d172a5efSJohannes Berg enum iwl_ctxt_id_and_color {
75d172a5efSJohannes Berg 	FW_CTXT_ID_POS		= 0,
76d172a5efSJohannes Berg 	FW_CTXT_ID_MSK		= 0xff << FW_CTXT_ID_POS,
77d172a5efSJohannes Berg 	FW_CTXT_COLOR_POS	= 8,
78d172a5efSJohannes Berg 	FW_CTXT_COLOR_MSK	= 0xff << FW_CTXT_COLOR_POS,
79d172a5efSJohannes Berg 	FW_CTXT_INVALID		= 0xffffffff,
80d172a5efSJohannes Berg };
81d172a5efSJohannes Berg 
82d172a5efSJohannes Berg #define FW_CMD_ID_AND_COLOR(_id, _color) (((_id) << FW_CTXT_ID_POS) |\
83d172a5efSJohannes Berg 					  ((_color) << FW_CTXT_COLOR_POS))
84d172a5efSJohannes Berg 
85d172a5efSJohannes Berg /* Possible actions on PHYs, MACs and Bindings */
86d172a5efSJohannes Berg enum iwl_ctxt_action {
87d172a5efSJohannes Berg 	FW_CTXT_ACTION_STUB = 0,
88d172a5efSJohannes Berg 	FW_CTXT_ACTION_ADD,
89d172a5efSJohannes Berg 	FW_CTXT_ACTION_MODIFY,
90d172a5efSJohannes Berg 	FW_CTXT_ACTION_REMOVE,
91d172a5efSJohannes Berg 	FW_CTXT_ACTION_NUM
92d172a5efSJohannes Berg }; /* COMMON_CONTEXT_ACTION_API_E_VER_1 */
93d172a5efSJohannes Berg 
94d172a5efSJohannes Berg #endif /* __iwl_fw_api_context_h__ */
95