summaryrefslogtreecommitdiff
path: root/drivers/staging/nmf-cm/cm/engine/api/channel_engine.h
blob: 19353ee7328413eed0fc77aa41b47ff56b634482 (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
/*
 * Copyright (C) ST-Ericsson SA 2010
 * Author: Jean-Philippe FASSINO <jean-philippe.fassino@stericsson.com> for ST-Ericsson.
 * License terms: GNU General Public License (GPL) version 2.
 */
/*!
 * \brief Communication Component Manager internal API type.
 */

#ifndef CHANNEL_ENGINE_H
#define CHANNEL_ENGINE_H

#include <nmf/inc/channel_type.h>
#include <nmf/inc/service_type.h>
#include <cm/engine/communication/inc/communication_type.h>

/*!
 * \brief Internal channel identification.
 *
 * Same as t_nmf_channel meaning but this the channel used internaly by
 * OS Integration part
 *
 * \ingroup CM_OS_API
 */
typedef t_uint32 t_os_channel;

/*!
 * \brief Invalid value for os_channel
 *
 * Invalid value for os channel.
 *
 * \ingroup CM_OS_API
 */
#define NMF_OS_CHANNEL_INVALID_HANDLE       0xffffffff

/*!
 * \brief Structure used for storing required parameters for Interface Callback
 * messages.
 *
 * This struture is used internally by CM_GetMessage() and CM_ExecuteMessage() as
 * the message content in the given buffer.
 *
 * \ingroup CM_ENGINE_API
 */
typedef struct {
    t_nmf_mpc2host_handle       THIS;               //!< Context of interface implementation
    t_uint32                    methodIndex;        //!< Method index in interface
    char                        params[1];          //!< Is of variable length concretely
} t_interface_data;

/*!
 * \brief Structure used for storing required parameters for Service Callback
 * messages.
 *
 * This struture is used internally by CM_GetMessage() and CM_ExecuteMessage() as
 * the message content in the given buffer.
 *
 * \ingroup CM_ENGINE_API
 */
typedef struct {
    t_nmf_service_type type;        //!< Type of the service message
    t_nmf_service_data data;
} t_service_data;

typedef enum {
	MSG_INTERFACE,
	MSG_SERVICE
} t_message_type;

/*!
 * \brief Structure used for storing required parameters for the internal NMF
 * messages.
 *
 * This struture is used internally by CM_GetMessage() and CM_ExecuteMessage() as
 * the message content in the given buffer.
 *
 * \ingroup CM_ENGINE_API
 */
typedef struct {
    t_message_type type;           //!< Type of the nmf message
    union {
	t_interface_data    itf;
	t_service_data      srv;
    } data;
} t_os_message;

/*!
 * \brief Structure used for storing required parameters for the internal NMF
 * messages.
 *
 * This struture is used internally by CM_GetMessage() and CM_ExecuteMessage() as
 * the message content in the given buffer.
 *
 * \ingroup CM_ENGINE_API
 */
typedef struct {
    t_nmf_channel               channel;        //!< Channel (required to handle service message)
    t_os_message                osMsg;
} t_nmf_message;

#endif /* CHANNEL_ENGINE_H */