1/****************************************************************************
2 ****************************************************************************
3 ***
4 ***   This header was automatically generated from a Linux kernel header
5 ***   of the same name, to make information necessary for userspace to
6 ***   call into the kernel available to libc.  It contains only constants,
7 ***   structures, and macros generated from the original header, and thus,
8 ***   contains no copyrightable information.
9 ***
10 ***   To edit the content of this header, modify the corresponding
11 ***   source file (e.g. under external/kernel-headers/original/) then
12 ***   run bionic/libc/kernel/tools/update_all.py
13 ***
14 ***   Any manual change here will be lost the next time this script will
15 ***   be run. You've been warned!
16 ***
17 ****************************************************************************
18 ****************************************************************************/
19#ifndef _CS_PROTOCOL_H
20#define _CS_PROTOCOL_H
21#include <linux/types.h>
22#include <linux/ioctl.h>
23/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
24#define CS_DEV_FILE_NAME "/dev/cmt_speech"
25#define CS_IF_VERSION 2
26#define CS_CMD_SHIFT 28
27#define CS_DOMAIN_SHIFT 24
28/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
29#define CS_CMD_MASK 0xff000000
30#define CS_PARAM_MASK 0xffffff
31#define CS_CMD(id,dom) (((id) << CS_CMD_SHIFT) | ((dom) << CS_DOMAIN_SHIFT))
32#define CS_ERROR CS_CMD(1, 0)
33/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
34#define CS_RX_DATA_RECEIVED CS_CMD(2, 0)
35#define CS_TX_DATA_READY CS_CMD(3, 0)
36#define CS_TX_DATA_SENT CS_CMD(4, 0)
37#define CS_ERR_PEER_RESET 0
38/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
39#define CS_FEAT_TSTAMP_RX_CTRL (1 << 0)
40#define CS_FEAT_ROLLING_RX_COUNTER (2 << 0)
41#define CS_STATE_CLOSED 0
42#define CS_STATE_OPENED 1
43/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
44#define CS_STATE_CONFIGURED 2
45#define CS_MAX_BUFFERS_SHIFT 4
46#define CS_MAX_BUFFERS (1 << CS_MAX_BUFFERS_SHIFT)
47struct cs_buffer_config {
48/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
49  __u32 rx_bufs;
50  __u32 tx_bufs;
51  __u32 buf_size;
52  __u32 flags;
53/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
54  __u32 reserved[4];
55};
56struct cs_timestamp {
57  __u32 tv_sec;
58/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
59  __u32 tv_nsec;
60};
61struct cs_mmap_config_block {
62  __u32 reserved1;
63/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
64  __u32 buf_size;
65  __u32 rx_bufs;
66  __u32 tx_bufs;
67  __u32 reserved2;
68/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
69  __u32 rx_offsets[CS_MAX_BUFFERS];
70  __u32 tx_offsets[CS_MAX_BUFFERS];
71  __u32 rx_ptr;
72  __u32 rx_ptr_boundary;
73/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
74  __u32 reserved3[2];
75  struct cs_timestamp tstamp_rx_ctrl;
76};
77#define CS_IO_MAGIC 'C'
78/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
79#define CS_IOW(num,dtype) _IOW(CS_IO_MAGIC, num, dtype)
80#define CS_IOR(num,dtype) _IOR(CS_IO_MAGIC, num, dtype)
81#define CS_IOWR(num,dtype) _IOWR(CS_IO_MAGIC, num, dtype)
82#define CS_IO(num) _IO(CS_IO_MAGIC, num)
83/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
84#define CS_GET_STATE CS_IOR(21, unsigned int)
85#define CS_SET_WAKELINE CS_IOW(23, unsigned int)
86#define CS_GET_IF_VERSION CS_IOR(30, unsigned int)
87#define CS_CONFIG_BUFS CS_IOW(31, struct cs_buffer_config)
88/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
89#endif
90