1 #ifndef _WCD_DSP_GLINK_H
2 #define _WCD_DSP_GLINK_H
3 
4 #include <linux/types.h>
5 
6 #define WDSP_CH_NAME_MAX_LEN 50
7 
8 enum {
9 	WDSP_REG_PKT = 1,
10 	WDSP_CMD_PKT,
11 	WDSP_READY_PKT,
12 };
13 #define WDSP_READY_PKT WDSP_READY_PKT
14 
15 /*
16  * struct wdsp_reg_pkt -  Glink channel information structure format
17  * @no_of_channels:   Number of glink channels to open
18  * @payload[0]:       Dynamic array contains all the glink channels information
19  */
20 struct wdsp_reg_pkt {
21 	__u8 no_of_channels;
22 	__u8 payload[0];
23 };
24 
25 /*
26  * struct wdsp_cmd_pkt - WDSP command packet format
27  * @ch_name:         Name of the glink channel
28  * @payload_size:    Size of the payload
29  * @payload[0]:      Actual data payload
30  */
31 struct wdsp_cmd_pkt {
32 	char ch_name[WDSP_CH_NAME_MAX_LEN];
33 	__u32 payload_size;
34 	__u8 payload[0];
35 };
36 
37 /*
38  * struct wdsp_write_pkt - Format that userspace send the data to driver.
39  * @pkt_type:      Type of the packet(REG or CMD PKT)
40  * @payload[0]:    Payload is either cmd or reg pkt structure based on pkt type
41  */
42 struct wdsp_write_pkt {
43 	__u8 pkt_type;
44 	__u8 payload[0];
45 };
46 
47 /*
48  * struct wdsp_glink_ch_cfg - Defines the glink channel configuration.
49  * @ch_name:           Name of the glink channel
50  * @latency_in_us:     Latency specified in micro seconds for QOS
51  * @no_of_intents:     Number of intents prequeued
52  * @intents_size[0]:   Dynamic array to specify size of each intent
53  */
54 struct wdsp_glink_ch_cfg {
55 	char name[WDSP_CH_NAME_MAX_LEN];
56 	__u32 latency_in_us;
57 	__u32 no_of_intents;
58 	__u32 intents_size[0];
59 };
60 #endif /* _WCD_DSP_GLINK_H */
61