xref: /wlan-dirver/qca-wifi-host-cmn/umac/cmn_services/serialization/src/wlan_serialization_debug_i.h (revision dd4dc88b837a295134aa9869114a2efee0f4894b)
1 /*
2  * Copyright (c) 2018-2019 The Linux Foundation. All rights reserved.
3  *
4  * Permission to use, copy, modify, and/or distribute this software for
5  * any purpose with or without fee is hereby granted, provided that the
6  * above copyright notice and this permission notice appear in all
7  * copies.
8  *
9  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
10  * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
11  * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
12  * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
13  * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
14  * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
15  * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
16  * PERFORMANCE OF THIS SOFTWARE.
17  */
18 /**
19  * DOC: wlan_serialization_debug_i.h
20  * This file defines the prototypes for the debug functions
21  * for the serialization component.
22  */
23 
24 #ifndef __WLAN_SERIALIZATION_DEBUG_I_H
25 #define __WLAN_SERIALIZATION_DEBUG_I_H
26 
27 #ifdef WLAN_SER_DEBUG
28 
29 #define SER_MAX_HISTORY_CMDS 50
30 
31 #define WLAN_SER_LINE "--------------------"\
32 		      "--------------------"
33 
34 #define WLAN_SER_HISTORY_HEADER "CMD_TYPE|CMD_ID|VDEV_ID|"\
35 				"BLOCKING|PRIORITY|ACTION|"\
36 				"  QUEUE|           REASON|"
37 
38 enum ser_queue_type {
39 	SER_PDEV_QUEUE_TYPE,
40 	SER_VDEV_QUEUE_TYPE,
41 };
42 
43 struct ser_data {
44 		/*
45 		 * Serialization Actions that modifies the serialization queues
46 		 * 0: SER_REQUEST
47 		 * 1: SER_REMOVE
48 		 * 2: SER_CANCEL
49 		 * 3: SER_TIMEOUT
50 		 * 4: SER_ACTIVATION_FAILED
51 		 * 5: SER_PENDING_TO_ACTIVE
52 		 */
53 		uint32_t cmd_type:6,	/* max 2^6 = 64 types of commands */
54 		cmd_id:16,		/* max cmd_id = 2^16  */
55 		is_blocking:1,
56 		is_high_priority:1,
57 		add_remove:1,
58 		active_pending:1,
59 		data_updated:1,
60 		ser_reason:5;
61 
62 		uint16_t vdev_id;
63 };
64 
65 struct ser_history {
66 	struct ser_data data[SER_MAX_HISTORY_CMDS];
67 	uint16_t index;
68 };
69 #endif /* WLAN_SER_DEBUG */
70 #endif
71 
72