blob: 5c3536cbd57a98e98261f86dc543497128cf6154 [file] [log] [blame]
Shad Ansari2f7f9be2017-06-07 13:34:53 -07001/*
2<:copyright-BRCM:2016:DUAL/GPL:standard
3
4 Broadcom Proprietary and Confidential.(c) 2016 Broadcom
5 All Rights Reserved
6
7Unless you and Broadcom execute a separate written software license
8agreement governing use of this software, this software is licensed
9to you under the terms of the GNU General Public License version 2
10(the "GPL"), available at http://www.broadcom.com/licenses/GPLv2.php,
11with the following added to such license:
12
13 As a special exception, the copyright holders of this software give
14 you permission to link this software with independent modules, and
15 to copy and distribute the resulting executable under terms of your
16 choice, provided that you also meet, for each linked independent
17 module, the terms and conditions of the license of that module.
18 An independent module is a module which is not derived from this
19 software. The special exception does not apply to any modifications
20 of the software.
21
22Not withstanding the above, under no circumstances may you combine
23this software in any way with any other Broadcom software provided
24under a license other than the GPL, without Broadcom's express prior
25written consent.
26
27:>
28 */
29
30#ifndef BCMOLT_DEV_LOG_IOCTL_H_
31#define BCMOLT_DEV_LOG_IOCTL_H_
32
33#include <linux/ioctl.h>
34
35#include <bcm_dev_log.h>
36
37#define DEV_LOG_CHRDEV_MAX_KERNEL_IDS 32
38
39/* ID descriptor */
40typedef struct dev_log_id_info
41{
42 uint32_t index;
43 char name[MAX_DEV_LOG_ID_NAME + 1];
44 bcm_dev_log_level default_level;
45 bcm_dev_log_id_type default_type;
46} dev_log_id_info;
47
48/* ioctl parameters */
49typedef union dev_log_io_param
50{
51 struct
52 {
53 int num_ids;
54 dev_log_id_info ids[DEV_LOG_CHRDEV_MAX_KERNEL_IDS];
55 } db_read;
56
57 struct
58 {
59 uint32_t index;
60 bcm_dev_log_level level_print;
61 bcm_dev_log_level level_save;
62 } level_set;
63
64 struct
65 {
66 uint32_t index;
67 bcm_dev_log_id_type type;
68 } type_set;
69
70 struct
71 {
72 uint32_t offset;
73 char msg[MAX_DEV_LOG_STRING_SIZE + 1];
74 } msg_read;
75
76} dev_log_io_param;
77
78/* Use 'S' as magic number */
79#define DEV_LOG_CHRDEV_IOC_MAGIC 'S'
80
81#define DEV_LOG_CHRDEV_DB_READ _IOR(DEV_LOG_CHRDEV_IOC_MAGIC, 1, dev_log_io_param)
82#define DEV_LOG_CHRDEV_LEVEL_SET _IOW(DEV_LOG_CHRDEV_IOC_MAGIC, 2, dev_log_io_param)
83#define DEV_LOG_CHRDEV_TYPE_SET _IOW(DEV_LOG_CHRDEV_IOC_MAGIC, 3, dev_log_io_param)
84#define DEV_LOG_CHRDEV_MSG_READ _IOR(DEV_LOG_CHRDEV_IOC_MAGIC, 4, dev_log_io_param)
85
86#endif