include: replace linux/module.h with "struct module" wherever possible
[linux-2.6/next.git] / include / linux / caif / caif_socket.h
blobd9cb19b7cff79c03feaed0421169ada719fd2b2b
1 /* linux/caif_socket.h
2 * CAIF Definitions for CAIF socket and network layer
3 * Copyright (C) ST-Ericsson AB 2010
4 * Author: Sjur Brendeland/ sjur.brandeland@stericsson.com
5 * License terms: GNU General Public License (GPL) version 2
6 */
8 #ifndef _LINUX_CAIF_SOCKET_H
9 #define _LINUX_CAIF_SOCKET_H
11 #include <linux/types.h>
13 #ifdef __KERNEL__
14 #include <linux/socket.h>
15 #else
16 #include <sys/socket.h>
17 #endif
19 /**
20 * enum caif_link_selector - Physical Link Selection.
21 * @CAIF_LINK_HIGH_BANDW: Physical interface for high-bandwidth
22 * traffic.
23 * @CAIF_LINK_LOW_LATENCY: Physical interface for low-latency
24 * traffic.
26 * CAIF Link Layers can register their link properties.
27 * This enum is used for choosing between CAIF Link Layers when
28 * setting up CAIF Channels when multiple CAIF Link Layers exists.
30 enum caif_link_selector {
31 CAIF_LINK_HIGH_BANDW,
32 CAIF_LINK_LOW_LATENCY
35 /**
36 * enum caif_channel_priority - CAIF channel priorities.
38 * @CAIF_PRIO_MIN: Min priority for a channel.
39 * @CAIF_PRIO_LOW: Low-priority channel.
40 * @CAIF_PRIO_NORMAL: Normal/default priority level.
41 * @CAIF_PRIO_HIGH: High priority level
42 * @CAIF_PRIO_MAX: Max priority for channel
44 * Priority can be set on CAIF Channels in order to
45 * prioritize between traffic on different CAIF Channels.
46 * These priority levels are recommended, but the priority value
47 * is not restricted to the values defined in this enum, any value
48 * between CAIF_PRIO_MIN and CAIF_PRIO_MAX could be used.
50 enum caif_channel_priority {
51 CAIF_PRIO_MIN = 0x01,
52 CAIF_PRIO_LOW = 0x04,
53 CAIF_PRIO_NORMAL = 0x0f,
54 CAIF_PRIO_HIGH = 0x14,
55 CAIF_PRIO_MAX = 0x1F
58 /**
59 * enum caif_protocol_type - CAIF Channel type.
60 * @CAIFPROTO_AT: Classic AT channel.
61 * @CAIFPROTO_DATAGRAM: Datagram channel.
62 * @CAIFPROTO_DATAGRAM_LOOP: Datagram loopback channel, used for testing.
63 * @CAIFPROTO_UTIL: Utility (Psock) channel.
64 * @CAIFPROTO_RFM: Remote File Manager
65 * @CAIFPROTO_DEBUG: Debug link
67 * This enum defines the CAIF Channel type to be used. This defines
68 * the service to connect to on the modem.
70 enum caif_protocol_type {
71 CAIFPROTO_AT,
72 CAIFPROTO_DATAGRAM,
73 CAIFPROTO_DATAGRAM_LOOP,
74 CAIFPROTO_UTIL,
75 CAIFPROTO_RFM,
76 CAIFPROTO_DEBUG,
77 _CAIFPROTO_MAX
79 #define CAIFPROTO_MAX _CAIFPROTO_MAX
81 /**
82 * enum caif_at_type - AT Service Endpoint
83 * @CAIF_ATTYPE_PLAIN: Connects to a plain vanilla AT channel.
85 enum caif_at_type {
86 CAIF_ATTYPE_PLAIN = 2
88 /**
89 * enum caif_debug_type - Content selection for debug connection
90 * @CAIF_DEBUG_TRACE_INTERACTIVE: Connection will contain
91 * both trace and interactive debug.
92 * @CAIF_DEBUG_TRACE: Connection contains trace only.
93 * @CAIF_DEBUG_INTERACTIVE: Connection to interactive debug.
95 enum caif_debug_type {
96 CAIF_DEBUG_TRACE_INTERACTIVE = 0,
97 CAIF_DEBUG_TRACE,
98 CAIF_DEBUG_INTERACTIVE,
102 * enum caif_debug_service - Debug Service Endpoint
103 * @CAIF_RADIO_DEBUG_SERVICE: Debug service on the Radio sub-system
104 * @CAIF_APP_DEBUG_SERVICE: Debug for the applications sub-system
106 enum caif_debug_service {
107 CAIF_RADIO_DEBUG_SERVICE = 1,
108 CAIF_APP_DEBUG_SERVICE
112 * struct sockaddr_caif - the sockaddr structure for CAIF sockets.
113 * @family: Address family number, must be AF_CAIF.
114 * @u: Union of address data 'switched' by family.
116 * @u.at: Applies when family = CAIFPROTO_AT.
118 * @u.at.type: Type of AT link to set up (enum caif_at_type).
120 * @u.util: Applies when family = CAIFPROTO_UTIL
122 * @u.util.service: Utility service name.
124 * @u.dgm: Applies when family = CAIFPROTO_DATAGRAM
126 * @u.dgm.connection_id: Datagram connection id.
128 * @u.dgm.nsapi: NSAPI of the PDP-Context.
130 * @u.rfm: Applies when family = CAIFPROTO_RFM
132 * @u.rfm.connection_id: Connection ID for RFM.
134 * @u.rfm.volume: Volume to mount.
136 * @u.dbg: Applies when family = CAIFPROTO_DEBUG.
138 * @u.dbg.type: Type of debug connection to set up
139 * (caif_debug_type).
141 * @u.dbg.service: Service sub-system to connect (caif_debug_service
142 * Description:
143 * This structure holds the connect parameters used for setting up a
144 * CAIF Channel. It defines the service to connect to on the modem.
146 struct sockaddr_caif {
147 sa_family_t family;
148 union {
149 struct {
150 __u8 type; /* type: enum caif_at_type */
151 } at; /* CAIFPROTO_AT */
152 struct {
153 char service[16];
154 } util; /* CAIFPROTO_UTIL */
155 union {
156 __u32 connection_id;
157 __u8 nsapi;
158 } dgm; /* CAIFPROTO_DATAGRAM(_LOOP)*/
159 struct {
160 __u32 connection_id;
161 char volume[16];
162 } rfm; /* CAIFPROTO_RFM */
163 struct {
164 __u8 type; /* type:enum caif_debug_type */
165 __u8 service; /* service:caif_debug_service */
166 } dbg; /* CAIFPROTO_DEBUG */
167 } u;
171 * enum caif_socket_opts - CAIF option values for getsockopt and setsockopt.
173 * @CAIFSO_LINK_SELECT: Selector used if multiple CAIF Link layers are
174 * available. Either a high bandwidth
175 * link can be selected (CAIF_LINK_HIGH_BANDW) or
176 * or a low latency link (CAIF_LINK_LOW_LATENCY).
177 * This option is of type __u32.
178 * Alternatively SO_BINDTODEVICE can be used.
180 * @CAIFSO_REQ_PARAM: Used to set the request parameters for a
181 * utility channel. (maximum 256 bytes). This
182 * option must be set before connecting.
184 * @CAIFSO_RSP_PARAM: Gets the response parameters for a utility
185 * channel. (maximum 256 bytes). This option
186 * is valid after a successful connect.
189 * This enum defines the CAIF Socket options to be used on a socket
190 * of type PF_CAIF.
193 enum caif_socket_opts {
194 CAIFSO_LINK_SELECT = 127,
195 CAIFSO_REQ_PARAM = 128,
196 CAIFSO_RSP_PARAM = 129,
199 #endif /* _LINUX_CAIF_SOCKET_H */