summaryrefslogtreecommitdiff
path: root/arch/arm/plat-omap/include/syslink/sysipc_ioctl.h
blob: d6f4428e7161555576dc444d036552fe41666df4 (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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
/*
 *  sysipc_ioctl.h
 *
 *  Definitions of sysmgr driver types and structures..
 *
 *  Copyright (C) 2008-2009 Texas Instruments, Inc.
 *
 *  This package is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License version 2 as
 *  published by the Free Software Foundation.
 *
 *  THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
 *  IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
 *  WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
 *  PURPOSE.
 */

#ifndef _SYSIPC_IOCTL_H_
#define _SYSIPC_IOCTL_H_

/* Standard headers */
#include <linux/types.h>

/* Syslink headers */
#include <ipc_ioctl.h>
#include <ipc.h>


/* =============================================================================
 *  Macros and types
 * =============================================================================
 */
/*  ----------------------------------------------------------------------------
 *  IOCTL command IDs for sysmgr
 *  ----------------------------------------------------------------------------
 */
/* IOC Magic Number for sysmgr */
#define SYSIPC_IOC_MAGIC		IPC_IOC_MAGIC

/* IOCTL command numbers for ipc/sysipc */
enum sysipc_drv_cmd {
	IPC_SETUP = IPC_BASE_CMD,
	IPC_DESTROY,
	IPC_CONTROL,
	IPC_READCONFIG,
	IPC_WRITECONFIG
 };

/* Command for ipc_setup */
#define CMD_IPC_SETUP \
			_IOWR(SYSIPC_IOC_MAGIC, IPC_SETUP, \
			struct sysipc_cmd_args)

/* Command for ipc_destroy */
#define CMD_IPC_DESTROY \
			_IOWR(SYSIPC_IOC_MAGIC, IPC_DESTROY, \
			struct sysipc_cmd_args)

/* Command for load callback */
#define CMD_IPC_CONTROL \
			_IOWR(SYSIPC_IOC_MAGIC, IPC_CONTROL, \
			struct sysipc_cmd_args)

/* Command for ipc_read_config */
#define CMD_IPC_READCONFIG \
			_IOWR(SYSIPC_IOC_MAGIC, IPC_READCONFIG, \
			struct sysipc_cmd_args)

/* Command for ipc_write_config */
#define CMD_IPC_WRITECONFIG \
			_IOWR(SYSIPC_IOC_MAGIC, IPC_WRITECONFIG, \
			struct sysipc_cmd_args)


/*  ----------------------------------------------------------------------------
 *  Command arguments for sysmgr
 *  ----------------------------------------------------------------------------
 */
/* Command arguments for sysmgr */
struct sysipc_cmd_args {
	union {
		struct {
			u16 proc_id;
			s32 cmd_id;
			void *arg;
		} control;

		struct {
			u16 remote_proc_id;
			u32 tag;
			void *cfg;
			u32 size;
		} read_config;

		struct {
			u16 remote_proc_id;
			u32 tag;
			void *cfg;
			u32 size;
		} write_config;

		struct {
			struct ipc_config *config;
		} setup;
	} args;

	s32 api_status;
};

/*  ----------------------------------------------------------------------------
 *  IOCTL functions for sysmgr module
 *  ----------------------------------------------------------------------------
 */
/* ioctl interface function for sysmgr */
int sysipc_ioctl(struct inode *inode, struct file *filp,
			unsigned int cmd, unsigned long args, bool user);

#endif /* _SYSIPC_IOCTL_H_ */