Drivers: Staging: ccg: Made checkpatch.pl clean
[firefly-linux-kernel-4.4.55.git] / drivers / staging / csr / csr_log_configure.h
1 #ifndef CSR_LOG_CONFIGURE_H__
2 #define CSR_LOG_CONFIGURE_H__
3 /*****************************************************************************
4
5             (c) Cambridge Silicon Radio Limited 2010
6             All rights reserved and confidential information of CSR
7
8             Refer to LICENSE.txt included with this source for details
9             on the license terms.
10
11 *****************************************************************************/
12
13 #include "csr_types.h"
14 #include "csr_log.h"
15
16 #ifdef __cplusplus
17 extern "C" {
18 #endif
19
20 /*---------------------------------*/
21 /* Log init/deinit                 */
22 /*---------------------------------*/
23 void CsrLogInit(CsrUint8 size);
24 void CsrLogDeinit(void);
25
26 /*---------------------------------*/
27 /* Log Framework Tech info         */
28 /*---------------------------------*/
29 void CsrLogTechInfoRegister(void);
30
31 /* Set the logging level for the environment outside the scheduler context */
32 void CsrLogLevelEnvironmentSet(CsrLogLevelEnvironment environmentLogLevel);
33
34
35 /* Set the logging level for all scheduler tasks */
36 /* This function call takes precedence over all previous calls to CsrLogLevelTaskSetSpecific() */
37 void CsrLogLevelTaskSetAll(CsrLogLevelTask tasksLogLevelMask);
38
39 /* Set the logging level for a given Task */
40 /* This function can be used as a complement to CsrLogLevelTaskSetAll() to add more _or_ less log from a given task than what is set
41 generally with CsrLogLevelTaskSetAll(). */
42 void CsrLogLevelTaskSetSpecific(CsrSchedQid taskId, CsrLogLevelTask taskLogLevelMask);
43
44
45 /*--------------------------------------------*/
46 /*  Filtering on log text warning levels      */
47 /*--------------------------------------------*/
48 typedef CsrUint32 CsrLogLevelText;
49 #define CSR_LOG_LEVEL_TEXT_OFF       ((CsrLogLevelText) 0x0000)
50
51 #define CSR_LOG_LEVEL_TEXT_CRITICAL  ((CsrLogLevelText) 0x0001)
52 #define CSR_LOG_LEVEL_TEXT_ERROR     ((CsrLogLevelText) 0x0002)
53 #define CSR_LOG_LEVEL_TEXT_WARNING   ((CsrLogLevelText) 0x0004)
54 #define CSR_LOG_LEVEL_TEXT_INFO      ((CsrLogLevelText) 0x0008)
55 #define CSR_LOG_LEVEL_TEXT_DEBUG     ((CsrLogLevelText) 0x0010)
56
57 #define CSR_LOG_LEVEL_TEXT_ALL       ((CsrLogLevelText) 0xFFFF)
58
59 /* The log text interface is used by both scheduler tasks and components outside the scheduler context.
60  * Therefore a CsrLogTextTaskId is introduced. It is effectively considered as two CsrUint16's. The lower
61  * 16 bits corresponds one2one with the scheduler queueId's (CsrSchedQid) and as such these bits can not be used
62  * by components outside scheduler tasks. The upper 16 bits are allocated for use of components outside the
63  * scheduler like drivers etc. Components in this range is defined independently by each technology. To avoid
64  * clashes the technologies are only allowed to assign values within the same restrictive range as allies to
65  * primitive identifiers. eg. for the framework components outside the scheduler is only allowed to assign
66  * taskId's in the range 0x0600xxxx to 0x06FFxxxx. And so on for other technologies. */
67 typedef CsrUint32 CsrLogTextTaskId;
68
69 /* Set the text logging level for all Tasks */
70 /* This function call takes precedence over all previous calls to CsrLogLevelTextSetTask() and CsrLogLevelTextSetTaskSubOrigin() */
71 void CsrLogLevelTextSetAll(CsrLogLevelText warningLevelMask);
72
73 /* Set the text logging level for a given Task */
74 /* This function call takes precedence over all previous calls to CsrLogLevelTextSetTaskSubOrigin(), but it can be used as a complement to
75  * CsrLogLevelTextSetAll() to add more _or_ less log from a given task than what is set generally with CsrLogLevelTextSetAll(). */
76 void CsrLogLevelTextSetTask(CsrLogTextTaskId taskId, CsrLogLevelText warningLevelMask);
77
78 /* Set the text logging level for a given tasks subOrigin */
79 /* This function can be used as a complement to CsrLogLevelTextSetAll() and CsrLogLevelTextSetTask() to add more _or_ less log from a given
80  * subOrigin within a task than what is set generally with CsrLogLevelTextSetAll() _or_ CsrLogLevelTextSetTask(). */
81 void CsrLogLevelTextSetTaskSubOrigin(CsrLogTextTaskId taskId, CsrUint16 subOrigin, CsrLogLevelText warningLevelMask);
82
83 /*******************************************************************************
84
85     NAME
86         CsrLogLevelTextSet
87
88     DESCRIPTION
89         Set the text logging level for a given origin and optionally sub origin
90         by name. If either string is NULL or zero length, it is interpreted as
91         all origins and/or all sub origins respectively. If originName is NULL
92         or zero length, subOriginName is ignored.
93
94         Passing NULL or zero length strings in both originName and subOriginName
95         is equivalent to calling CsrLogLevelTextSetAll, and overrides all
96         previous filter configurations for all origins and sub origins.
97
98         Passing NULL or a zero length string in subOriginName overrides all
99         previous filter configurations for all sub origins of the specified
100         origin.
101
102         Note: the supplied strings may be accessed after the function returns
103         and must remain valid and constant until CsrLogDeinit is called.
104
105         Note: when specifying an origin (originName is not NULL and not zero
106         length), this function can only be used for origins that use the
107         csr_log_text_2.h interface for registration and logging. Filtering for
108         origins that use the legacy csr_log_text.h interface must be be
109         configured using the legacy filter configuration functions that accept
110         a CsrLogTextTaskId as origin specifier. However, when not specifying an
111         origin this function also affects origins that have been registered with
112         the legacy csr_log_text.h interface. Furthermore, using this function
113         and the legacy filter configuration functions on the same origin is not
114         allowed.
115
116     PARAMETERS
117         originName - a string containing the name of the origin. Can be NULL or
118             zero length to set the log level for all origins. In this case, the
119             subOriginName parameter will be ignored.
120         subOriginName - a string containing the name of the sub origin. Can be
121             NULL or zero length to set the log level for all sub origins of the
122             specified origin.
123         warningLevelMask - The desired log level for the specified origin(s) and
124             sub origin(s).
125
126 *******************************************************************************/
127 void CsrLogLevelTextSet(const CsrCharString *originName,
128     const CsrCharString *subOriginName,
129     CsrLogLevelText warningLevelMask);
130
131 #ifdef __cplusplus
132 }
133 #endif
134
135 #endif