June 2025 | ||||||
Mo | Tu | We | Th | Fr | Sa | Su |
26 | 27 | 28 | 29 | 30 | 31 | 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 | 1 | 2 | 3 | 4 | 5 | 6 |
001: /* linux/caif_socket.h 002: * CAIF Definitions for CAIF socket and network layer 003: * Copyright (C) ST-Ericsson AB 2010 004: * Author: Sjur Brendeland/ sjur.brandeland@stericsson.com 005: * License terms: GNU General Public License (GPL) version 2 006: */ 007: 008: #ifndef _LINUX_CAIF_SOCKET_H 009: #define _LINUX_CAIF_SOCKET_H 010: 011: #include <linux/types.h> 012: #include <linux/socket.h> 013: 014: /** 015: * enum caif_link_selector - Physical Link Selection. 016: * @CAIF_LINK_HIGH_BANDW: Physical interface for high-bandwidth 017: * traffic. 018: * @CAIF_LINK_LOW_LATENCY: Physical interface for low-latency 019: * traffic. 020: * 021: * CAIF Link Layers can register their link properties. 022: * This enum is used for choosing between CAIF Link Layers when 023: * setting up CAIF Channels when multiple CAIF Link Layers exists. 024: */ 025: enum caif_link_selector { 026: CAIF_LINK_HIGH_BANDW, 027: CAIF_LINK_LOW_LATENCY 028: }; 029: 030: /** 031: * enum caif_channel_priority - CAIF channel priorities. 032: * 033: * @CAIF_PRIO_MIN: Min priority for a channel. 034: * @CAIF_PRIO_LOW: Low-priority channel. 035: * @CAIF_PRIO_NORMAL: Normal/default priority level. 036: * @CAIF_PRIO_HIGH: High priority level 037: * @CAIF_PRIO_MAX: Max priority for channel 038: * 039: * Priority can be set on CAIF Channels in order to 040: * prioritize between traffic on different CAIF Channels. 041: * These priority levels are recommended, but the priority value 042: * is not restricted to the values defined in this enum, any value 043: * between CAIF_PRIO_MIN and CAIF_PRIO_MAX could be used. 044: */ 045: enum caif_channel_priority { 046: CAIF_PRIO_MIN = 0x01, 047: CAIF_PRIO_LOW = 0x04, 048: CAIF_PRIO_NORMAL = 0x0f, 049: CAIF_PRIO_HIGH = 0x14, 050: CAIF_PRIO_MAX = 0x1F 051: }; 052: 053: /** 054: * enum caif_protocol_type - CAIF Channel type. 055: * @CAIFPROTO_AT: Classic AT channel. 056: * @CAIFPROTO_DATAGRAM: Datagram channel. 057: * @CAIFPROTO_DATAGRAM_LOOP: Datagram loopback channel, used for testing. 058: * @CAIFPROTO_UTIL: Utility (Psock) channel. 059: * @CAIFPROTO_RFM: Remote File Manager 060: * @CAIFPROTO_DEBUG: Debug link 061: * 062: * This enum defines the CAIF Channel type to be used. This defines 063: * the service to connect to on the modem. 064: */ 065: enum caif_protocol_type { 066: CAIFPROTO_AT, 067: CAIFPROTO_DATAGRAM, 068: CAIFPROTO_DATAGRAM_LOOP, 069: CAIFPROTO_UTIL, 070: CAIFPROTO_RFM, 071: CAIFPROTO_DEBUG, 072: _CAIFPROTO_MAX 073: }; 074: #define CAIFPROTO_MAX _CAIFPROTO_MAX 075: 076: /** 077: * enum caif_at_type - AT Service Endpoint 078: * @CAIF_ATTYPE_PLAIN: Connects to a plain vanilla AT channel. 079: */ 080: enum caif_at_type { 081: CAIF_ATTYPE_PLAIN = 2 082: }; 083: /** 084: * enum caif_debug_type - Content selection for debug connection 085: * @CAIF_DEBUG_TRACE_INTERACTIVE: Connection will contain 086: * both trace and interactive debug. 087: * @CAIF_DEBUG_TRACE: Connection contains trace only. 088: * @CAIF_DEBUG_INTERACTIVE: Connection to interactive debug. 089: */ 090: enum caif_debug_type { 091: CAIF_DEBUG_TRACE_INTERACTIVE = 0, 092: CAIF_DEBUG_TRACE, 093: CAIF_DEBUG_INTERACTIVE, 094: }; 095: 096: /** 097: * enum caif_debug_service - Debug Service Endpoint 098: * @CAIF_RADIO_DEBUG_SERVICE: Debug service on the Radio sub-system 099: * @CAIF_APP_DEBUG_SERVICE: Debug for the applications sub-system 100: */ 101: enum caif_debug_service { 102: CAIF_RADIO_DEBUG_SERVICE = 1, 103: CAIF_APP_DEBUG_SERVICE 104: }; 105: 106: /** 107: * struct sockaddr_caif - the sockaddr structure for CAIF sockets. 108: * @family: Address family number, must be AF_CAIF. 109: * @u: Union of address data 'switched' by family. 110: * : 111: * @u.at: Applies when family = CAIFPROTO_AT. 112: * 113: * @u.at.type: Type of AT link to set up (enum caif_at_type). 114: * 115: * @u.util: Applies when family = CAIFPROTO_UTIL 116: * 117: * @u.util.service: Utility service name. 118: * 119: * @u.dgm: Applies when family = CAIFPROTO_DATAGRAM 120: * 121: * @u.dgm.connection_id: Datagram connection id. 122: * 123: * @u.dgm.nsapi: NSAPI of the PDP-Context. 124: * 125: * @u.rfm: Applies when family = CAIFPROTO_RFM 126: * 127: * @u.rfm.connection_id: Connection ID for RFM. 128: * 129: * @u.rfm.volume: Volume to mount. 130: * 131: * @u.dbg: Applies when family = CAIFPROTO_DEBUG. 132: * 133: * @u.dbg.type: Type of debug connection to set up 134: * (caif_debug_type). 135: * 136: * @u.dbg.service: Service sub-system to connect (caif_debug_service 137: * Description: 138: * This structure holds the connect parameters used for setting up a 139: * CAIF Channel. It defines the service to connect to on the modem. 140: */ 141: struct sockaddr_caif { 142: __kernel_sa_family_t family; 143: union { 144: struct { 145: __u8 type; /* type: enum caif_at_type */ 146: } at; /* CAIFPROTO_AT */ 147: struct { 148: char service[16]; 149: } util; /* CAIFPROTO_UTIL */ 150: union { 151: __u32 connection_id; 152: __u8 nsapi; 153: } dgm; /* CAIFPROTO_DATAGRAM(_LOOP)*/ 154: struct { 155: __u32 connection_id; 156: char volume[16]; 157: } rfm; /* CAIFPROTO_RFM */ 158: struct { 159: __u8 type; /* type:enum caif_debug_type */ 160: __u8 service; /* service:caif_debug_service */ 161: } dbg; /* CAIFPROTO_DEBUG */ 162: } u; 163: }; 164: 165: /** 166: * enum caif_socket_opts - CAIF option values for getsockopt and setsockopt. 167: * 168: * @CAIFSO_LINK_SELECT: Selector used if multiple CAIF Link layers are 169: * available. Either a high bandwidth 170: * link can be selected (CAIF_LINK_HIGH_BANDW) or 171: * or a low latency link (CAIF_LINK_LOW_LATENCY). 172: * This option is of type __u32. 173: * Alternatively SO_BINDTODEVICE can be used. 174: * 175: * @CAIFSO_REQ_PARAM: Used to set the request parameters for a 176: * utility channel. (maximum 256 bytes). This 177: * option must be set before connecting. 178: * 179: * @CAIFSO_RSP_PARAM: Gets the response parameters for a utility 180: * channel. (maximum 256 bytes). This option 181: * is valid after a successful connect. 182: * 183: * 184: * This enum defines the CAIF Socket options to be used on a socket 185: * of type PF_CAIF. 186: * 187: */ 188: enum caif_socket_opts { 189: CAIFSO_LINK_SELECT = 127, 190: CAIFSO_REQ_PARAM = 128, 191: CAIFSO_RSP_PARAM = 129, 192: }; 193: 194: #endif /* _LINUX_CAIF_SOCKET_H */ 195: