1 /*
2 * Remote processor messaging sockets
3 *
4 * Copyright (c) 2011-2013, Texas Instruments Incorporated
5 * All rights reserved.
6 *
7 * Ohad Ben-Cohen <ohad@wizery.com>
8 *
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions
11 * are met:
12 *
13 * * Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer.
15 *
16 * * Redistributions in binary form must reproduce the above copyright
17 * notice, this list of conditions and the following disclaimer in the
18 * documentation and/or other materials provided with the distribution.
19 *
20 * * Neither the name of Texas Instruments Incorporated nor the names of
21 * its contributors may be used to endorse or promote products derived
22 * from this software without specific prior written permission.
23 *
24 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
25 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
26 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
27 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
28 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
29 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
30 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
31 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
32 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
33 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
34 * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
35 */
36 #ifndef __NET_RPMSG_H
37 #define __NET_RPMSG_H
39 #include <linux/types.h>
40 #include <sys/socket.h>
42 /* user space needs this */
43 #ifndef AF_RPMSG
44 #include <linux/version.h>
45 #if LINUX_VERSION_CODE < KERNEL_VERSION(3,9,0)
46 #define AF_RPMSG 40
47 #else
48 #define AF_RPMSG 41
49 #endif /* LINUX_VERSION_CODE */
50 #endif /* AF_RPMSG */
52 /* Connection and socket states */
53 enum {
54 RPMSG_CONNECTED = 1, /* wait_for_packet() wants this... */
55 RPMSG_OPEN,
56 RPMSG_LISTENING,
57 RPMSG_CLOSED,
58 };
60 struct sockaddr_rpmsg {
61 sa_family_t family;
62 __u32 vproc_id;
63 __u32 addr;
64 };
66 #define RPMSG_LOCALHOST ((__u32) ~0UL)
68 #endif /* __NET_RPMSG_H */