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
8
#ifndef _LINUX_CAIF_SOCKET_H
9
#define _LINUX_CAIF_SOCKET_H
11
#include <linux/types.h>
14
#include <linux/socket.h>
16
#include <sys/socket.h>
20
* enum caif_link_selector - Physical Link Selection.
21
* @CAIF_LINK_HIGH_BANDW: Physical interface for high-bandwidth
23
* @CAIF_LINK_LOW_LATENCY: Physical interface for low-latency
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 {
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 {
53
CAIF_PRIO_NORMAL = 0x0f,
54
CAIF_PRIO_HIGH = 0x14,
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
66
* This enum defines the CAIF Channel type to be used. This defines
67
* the service to connect to on the modem.
69
enum caif_protocol_type {
72
CAIFPROTO_DATAGRAM_LOOP,
77
#define CAIFPROTO_MAX _CAIFPROTO_MAX
80
* enum caif_at_type - AT Service Endpoint
81
* @CAIF_ATTYPE_PLAIN: Connects to a plain vanilla AT channel.
88
* struct sockaddr_caif - the sockaddr structure for CAIF sockets.
89
* @family: Address family number, must be AF_CAIF.
90
* @u: Union of address data 'switched' by family.
92
* @u.at: Applies when family = CAIFPROTO_AT.
94
* @u.at.type: Type of AT link to set up (enum caif_at_type).
96
* @u.util: Applies when family = CAIFPROTO_UTIL
98
* @u.util.service: Utility service name.
100
* @u.dgm: Applies when family = CAIFPROTO_DATAGRAM
102
* @u.dgm.connection_id: Datagram connection id.
104
* @u.dgm.nsapi: NSAPI of the PDP-Context.
106
* @u.rfm: Applies when family = CAIFPROTO_RFM
108
* @u.rfm.connection_id: Connection ID for RFM.
110
* @u.rfm.volume: Volume to mount.
113
* This structure holds the connect parameters used for setting up a
114
* CAIF Channel. It defines the service to connect to on the modem.
116
struct sockaddr_caif {
120
__u8 type; /* type: enum caif_at_type */
121
} at; /* CAIFPROTO_AT */
124
} util; /* CAIFPROTO_UTIL */
128
} dgm; /* CAIFPROTO_DATAGRAM(_LOOP)*/
132
} rfm; /* CAIFPROTO_RFM */
137
* enum caif_socket_opts - CAIF option values for getsockopt and setsockopt.
139
* @CAIFSO_LINK_SELECT: Selector used if multiple CAIF Link layers are
140
* available. Either a high bandwidth
141
* link can be selected (CAIF_LINK_HIGH_BANDW) or
142
* or a low latency link (CAIF_LINK_LOW_LATENCY).
143
* This option is of type __u32.
144
* Alternatively SO_BINDTODEVICE can be used.
146
* @CAIFSO_REQ_PARAM: Used to set the request parameters for a
147
* utility channel. (maximum 256 bytes). This
148
* option must be set before connecting.
150
* @CAIFSO_RSP_PARAM: Gets the response parameters for a utility
151
* channel. (maximum 256 bytes). This option
152
* is valid after a successful connect.
155
* This enum defines the CAIF Socket options to be used on a socket
159
enum caif_socket_opts {
160
CAIFSO_LINK_SELECT = 127,
161
CAIFSO_REQ_PARAM = 128,
162
CAIFSO_RSP_PARAM = 129,
165
#endif /* _LINUX_CAIF_SOCKET_H */