7 #ifndef _RPMSG_INTERNAL_H_
8 #define _RPMSG_INTERNAL_H_
13 #if defined __cplusplus
18 #include <metal/log.h>
20 #define RPMSG_ASSERT(_exp, _msg) do { \
22 metal_log(METAL_LOG_EMERGENCY, \
23 "FATAL: %s - "_msg, __func__); \
28 #define RPMSG_ASSERT(_exp, _msg) metal_assert(_exp)
32 #define RPMSG_BUF_HELD_SHIFT 16
33 #define RPMSG_BUF_HELD_MASK (0xFFFFU << RPMSG_BUF_HELD_SHIFT)
35 #define RPMSG_LOCATE_HDR(p) \
36 ((struct rpmsg_hdr *)((unsigned char *)(p) - sizeof(struct rpmsg_hdr)))
37 #define RPMSG_LOCATE_DATA(p) ((unsigned char *)(p) + sizeof(struct rpmsg_hdr))
101 uint32_t src, uint32_t dest,
136 #if defined __cplusplus
#define RPMSG_NAME_SIZE
Definition: rpmsg.h:28
void(* rpmsg_ns_unbind_cb)(struct rpmsg_endpoint *ept)
Definition: rpmsg.h:55
#define RPMSG_ADDR_ANY
Definition: rpmsg.h:33
int(* rpmsg_ept_cb)(struct rpmsg_endpoint *ept, void *data, size_t len, uint32_t src, void *priv)
Definition: rpmsg.h:52
static struct rpmsg_endpoint * rpmsg_get_ept_from_addr(struct rpmsg_device *rdev, uint32_t addr)
Definition: rpmsg_internal.h:106
int rpmsg_send_ns_message(struct rpmsg_endpoint *ept, unsigned long flags)
Definition: rpmsg.c:138
METAL_PACKED_BEGIN struct rpmsg_hdr METAL_PACKED_END
rpmsg_ns_flags
dynamic name service announcement flags
Definition: rpmsg_internal.h:42
@ RPMSG_NS_DESTROY
A known remote service was just destroyed.
Definition: rpmsg_internal.h:46
@ RPMSG_NS_CREATE
A new remote service was just created.
Definition: rpmsg_internal.h:44
void rpmsg_register_endpoint(struct rpmsg_device *rdev, struct rpmsg_endpoint *ept, const char *name, uint32_t src, uint32_t dest, rpmsg_ept_cb cb, rpmsg_ns_unbind_cb ns_unbind_cb, void *priv)
Definition: rpmsg.c:302
struct rpmsg_endpoint * rpmsg_get_endpoint(struct rpmsg_device *rvdev, const char *name, uint32_t addr, uint32_t dest_addr)
Definition: rpmsg.c:259
void rpmsg_ept_decref(struct rpmsg_endpoint *ept)
Definition: rpmsg.c:107
void rpmsg_ept_incref(struct rpmsg_endpoint *ept)
Definition: rpmsg.c:101
Representation of a RPMsg device.
Definition: rpmsg.h:133
Structure that binds a local RPMsg address to its user.
Definition: rpmsg.h:65
struct rpmsg_device * rdev
Pointer to the RPMsg device.
Definition: rpmsg.h:70
void * priv
Private data for the driver's use.
Definition: rpmsg.h:97
char name[RPMSG_NAME_SIZE]
Name of the service supported.
Definition: rpmsg.h:67
rpmsg_ept_cb cb
User rx callback, return value of this callback is reserved for future use, for now,...
Definition: rpmsg.h:88
uint32_t addr
Local address of the endpoint.
Definition: rpmsg.h:73
rpmsg_ns_unbind_cb ns_unbind_cb
Endpoint service unbind callback, called when remote ept is destroyed.
Definition: rpmsg.h:91
uint32_t dest_addr
Address of the default remote endpoint binded.
Definition: rpmsg.h:76
Common header for all RPMsg messages.
Definition: rpmsg_internal.h:55
uint32_t dst
Destination address.
Definition: rpmsg_internal.h:60
uint16_t flags
Message flags.
Definition: rpmsg_internal.h:69
uint32_t src
Source address.
Definition: rpmsg_internal.h:57
uint32_t reserved
Reserved for future use.
Definition: rpmsg_internal.h:63
uint16_t len
Length of payload (in bytes)
Definition: rpmsg_internal.h:66
Dynamic name service announcement message.
Definition: rpmsg_internal.h:82
char name[RPMSG_NAME_SIZE]
Name of the remote service that is being published.
Definition: rpmsg_internal.h:84
uint32_t addr
Endpoint address of the remote service that is being published.
Definition: rpmsg_internal.h:87
uint32_t flags
Indicates whether service is created or destroyed.
Definition: rpmsg_internal.h:90