1 /*
2  * Copyright (c) 2013-2019 The Linux Foundation. All rights reserved.
3  * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
4  *
5  * Permission to use, copy, modify, and/or distribute this software for
6  * any purpose with or without fee is hereby granted, provided that the
7  * above copyright notice and this permission notice appear in all
8  * copies.
9  *
10  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
11  * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
12  * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
13  * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
14  * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
15  * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
16  * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
17  * PERFORMANCE OF THIS SOFTWARE.
18  */
19 
20 #if !defined(WLAN_QCT_SYS_H__)
21 #define WLAN_QCT_SYS_H__
22 
23 /**===========================================================================
24 
25    \file  wlan_qct_sys.h
26 
27    \brief System module API
28 
29    ==========================================================================*/
30 
31 /* $HEADER$ */
32 
33 /*---------------------------------------------------------------------------
34    Include files
35    -------------------------------------------------------------------------*/
36 #include <qdf_types.h>
37 #include <qdf_status.h>
38 #include <scheduler_api.h>
39 
40 struct mac_context;
41 
42 /*---------------------------------------------------------------------------
43    Preprocessor definitions and constants
44    -------------------------------------------------------------------------*/
45 
46 /*---------------------------------------------------------------------------
47    Type declarations
48    -------------------------------------------------------------------------*/
49 
50 /**
51  * sys_rsp_cb() - SYS async response callback
52  * @user_data: context data for callback
53  *
54  * This is a protype for the callback function that SYS makes to various
55  * modules in the system.
56  *
57  * Return: None
58  */
59 typedef void (*sys_rsp_cb)(void *user_data);
60 
61 /**
62  * sys_build_message_header() - to build the sys message header
63  * @msg_id: message id
64  * @msg: pointer to message context
65  *
66  * This function will initialize the SYS message header with the
67  * message type and any internal fields needed for a new SYS
68  * message. This function sets all but the message body, which is up
69  * to the caller to setup based on the specific message being built.
70  *
71  * NOTE: There are internal / reserved items in a SYS message that
72  * must be set correctly for the message to be recognized as a SYS
73  * message by the SYS message handlers.  It is important for every SYS
74  * message to be setup / built / initialized through this function.
75  *
76  * Return: QDF_STATUS
77  */
78 QDF_STATUS sys_build_message_header(SYS_MSG_ID msg_id,
79 				    struct scheduler_msg *msg);
80 
81 /**
82  * umac_stop() - send schedule message to mc thread to stop umac (sme and mac)
83  *
84  * Return: status of operation
85  */
86 QDF_STATUS umac_stop(void);
87 
88 QDF_STATUS sys_mc_process_handler(struct scheduler_msg *msg);
89 
90 /**
91  * sys_process_mmh_msg() - api to process an mmh message
92  * @mac: pointer to mac context
93  * @msg: pointer to message
94  *
95  * This API is used to process an mmh message.
96  *
97  * NOTE WELL: Ownership of the @msg bodyptr, if present, is always
98  * transferred, and the caller must not attempt to dereference or free
99  * the bodyptr after invoking this API.
100  *
101  * Return: none
102  */
103 void sys_process_mmh_msg(struct mac_context *mac,
104 			 struct scheduler_msg *msg);
105 
106 #endif /* WLAN_QCT_SYS_H__ */
107