summaryrefslogtreecommitdiff
path: root/drivers/soc/qcom/glink_loopback_commands.h
blob: b4375ddbd1a8d00058542c0615e6d0d67a837431 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
/* Copyright (c) 2014-2015, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
 * only version 2 as published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 */
#ifndef _GLINK_LOOPBACK_COMMANDS_H_
#define _GLINK_LOOPBACK_COMMANDS_H_

#define MAX_NAME_LEN 32

enum request_type {
	OPEN = 1,
	CLOSE,
	QUEUE_RX_INTENT_CONFIG,
	TX_CONFIG,
	RX_DONE_CONFIG,
};

struct req_hdr {
	uint32_t req_id;
	uint32_t req_type;
	uint32_t req_size;
};

struct open_req {
	uint32_t delay_ms;
	uint32_t name_len;
	char ch_name[MAX_NAME_LEN];
};

struct close_req {
	uint32_t delay_ms;
	uint32_t name_len;
	char ch_name[MAX_NAME_LEN];
};

struct queue_rx_intent_config_req {
	uint32_t num_intents;
	uint32_t intent_size;
	uint32_t random_delay;
	uint32_t delay_ms;
	uint32_t name_len;
	char ch_name[MAX_NAME_LEN];
};

enum transform_type {
	NO_TRANSFORM = 0,
	PACKET_COUNT,
	CHECKSUM,
};

struct tx_config_req {
	uint32_t random_delay;
	uint32_t delay_ms;
	uint32_t echo_count;
	uint32_t transform_type;
	uint32_t name_len;
	char ch_name[MAX_NAME_LEN];
};

struct rx_done_config_req {
	uint32_t random_delay;
	uint32_t delay_ms;
	uint32_t name_len;
	char ch_name[MAX_NAME_LEN];
};

union req_payload {
	struct open_req open;
	struct close_req close;
	struct queue_rx_intent_config_req q_rx_int_conf;
	struct tx_config_req tx_conf;
	struct rx_done_config_req rx_done_conf;
};

struct req {
	struct req_hdr hdr;
	union req_payload payload;
};

struct resp {
	uint32_t req_id;
	uint32_t req_type;
	uint32_t response;
};

/*
 * Tracer Packet Event IDs for Loopback Client/Server.
 * This being a client of G-Link, the tracer packet events start
 * from 256.
 */
enum loopback_tracer_pkt_events {
	LOOPBACK_SRV_TX = 256,
	LOOPBACK_SRV_RX = 257,
	LOOPBACK_CLNT_TX = 258,
	LOOPBACK_CLNT_RX = 259,
};
#endif