summaryrefstree
path: root/kernel/drivers/misc/tzdev/tz_iwio.h
blob: c6ef5c2c58828916b64745e331e7b68c24190993 (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
/*
 * Copyright (C) 2012-2017, Samsung Electronics Co., Ltd.
 *
 * This software is licensed under the terms of the GNU General Public
 * License version 2, as published by the Free Software Foundation, and
 * may be copied, distributed, and modified under those terms.
 *
 * 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 __TZ_IWIO_H__
#define __TZ_IWIO_H__

enum {
	TZ_IWIO_CONNECT_LOG,
	TZ_IWIO_CONNECT_SERVICE,
	TZ_IWIO_CONNECT_TRANSPORT,
	TZ_IWIO_CONNECT_PROFILER,
	TZ_IWIO_CONNECT_PANIC_DUMP,
	TZ_IWIO_CONNECT_SOCKET_EVENTS,
	TZ_IWIO_CONNECT_SOCKET,
	TZ_IWIO_CONNECT_NWFS,
	TZ_IWIO_CONNECT_CNT
};

#define TZ_IWIO_AUX_BUF_SIZE PAGE_SIZE

struct tz_iwio_aux_channel {
	char buffer[TZ_IWIO_AUX_BUF_SIZE];
} __packed;

typedef int (*tz_iwio_callback_t)(void *buf, unsigned long num_pages, void *ext_data);
typedef void (*tz_iwio_callback_cleanup_t)(void *buf,
		unsigned long num_pages, void *ext_data);

struct tz_iwio_aux_channel *tz_iwio_get_aux_channel(void);
void tz_iwio_put_aux_channel(void);
int tz_iwio_alloc_aux_channel(int cpu);
void *tz_iwio_alloc_iw_channel(unsigned int mode, unsigned int num_pages,
		tz_iwio_callback_t pre_callback, tz_iwio_callback_cleanup_t pre_callback_cleanup,
		void *calback_data);
void tz_iwio_free_iw_channel(void *ch);

#endif /* __TZ_IWIO_H__ */