1 /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2 /* Copyright (c) 2022/23 Siemens Mobility GmbH */
3 #ifndef _LINUX_GSMMUX_H
4 #define _LINUX_GSMMUX_H
6 #include <linux/const.h>
8 #include <linux/ioctl.h>
9 #include <linux/types.h>
12 * flags definition for n_gsm
15 * struct gsm_config_ext.flags
16 * struct gsm_dlci_config.flags
18 /* Forces a DLCI reset if set. Otherwise, a DLCI reset is only done if
19 * incompatible settings were provided. Always cleared on retrieval.
21 #define GSM_FL_RESTART _BITUL(0)
24 * struct gsm_config - n_gsm basic configuration parameters
26 * This structure is used in combination with GSMIOC_GETCONF and GSMIOC_SETCONF
27 * to retrieve and set the basic parameters of an n_gsm ldisc.
28 * struct gsm_config_ext can be used to configure extended ldisc parameters.
30 * All timers are in units of 1/100th of a second.
32 * @adaption: Convergence layer type
33 * @encapsulation: Framing (0 = basic option, 1 = advanced option)
34 * @initiator: Initiator or responder
35 * @t1: Acknowledgment timer
36 * @t2: Response timer for multiplexer control channel
37 * @t3: Response timer for wake-up procedure
38 * @n2: Maximum number of retransmissions
39 * @mru: Maximum incoming frame payload size
40 * @mtu: Maximum outgoing frame payload size
42 * @i: Frame type (1 = UIH, 2 = UI)
43 * @unused: Can not be used
47 unsigned int adaption;
48 unsigned int encapsulation;
49 unsigned int initiator;
58 unsigned int unused[8];
61 #define GSMIOC_GETCONF _IOR('G', 0, struct gsm_config)
62 #define GSMIOC_SETCONF _IOW('G', 1, struct gsm_config)
65 * struct gsm_netconfig - n_gsm network configuration parameters
67 * This structure is used in combination with GSMIOC_ENABLE_NET and
68 * GSMIOC_DISABLE_NET to enable or disable a network data connection
69 * over a mux virtual tty channel. This is for modems that support
70 * data connections with raw IP frames instead of PPP.
72 * @adaption: Adaption to use in network mode.
73 * @protocol: Protocol to use - only ETH_P_IP supported.
74 * @unused2: Can not be used.
75 * @if_name: Interface name format string.
76 * @unused: Can not be used.
78 struct gsm_netconfig {
79 unsigned int adaption;
80 unsigned short protocol;
81 unsigned short unused2;
82 char if_name[IFNAMSIZ];
86 #define GSMIOC_ENABLE_NET _IOW('G', 2, struct gsm_netconfig)
87 #define GSMIOC_DISABLE_NET _IO('G', 3)
89 /* get the base tty number for a configured gsmmux tty */
90 #define GSMIOC_GETFIRST _IOR('G', 4, __u32)
93 * struct gsm_config_ext - n_gsm extended configuration parameters
95 * This structure is used in combination with GSMIOC_GETCONF_EXT and
96 * GSMIOC_SETCONF_EXT to retrieve and set the extended parameters of an
99 * All timers are in units of 1/100th of a second.
101 * @keep_alive: Control channel keep-alive in 1/100th of a second (0 to disable).
102 * @wait_config: Wait for DLCI config before opening virtual link?
103 * @flags: Mux specific flags.
104 * @reserved: For future use, must be initialized to zero.
106 struct gsm_config_ext {
113 #define GSMIOC_GETCONF_EXT _IOR('G', 5, struct gsm_config_ext)
114 #define GSMIOC_SETCONF_EXT _IOW('G', 6, struct gsm_config_ext)
117 * struct gsm_dlci_config - n_gsm channel configuration parameters
119 * This structure is used in combination with GSMIOC_GETCONF_DLCI and
120 * GSMIOC_SETCONF_DLCI to retrieve and set the channel specific parameters
123 * Set the channel accordingly before calling GSMIOC_GETCONF_DLCI.
125 * @channel: DLCI (0 for the associated DLCI).
126 * @adaption: Convergence layer type.
127 * @mtu: Maximum transfer unit.
128 * @priority: Priority (0 for default value).
129 * @i: Frame type (1 = UIH, 2 = UI).
130 * @k: Window size (0 for default value).
131 * @flags: DLCI specific flags.
132 * @reserved: For future use, must be initialized to zero.
134 struct gsm_dlci_config {
145 #define GSMIOC_GETCONF_DLCI _IOWR('G', 7, struct gsm_dlci_config)
146 #define GSMIOC_SETCONF_DLCI _IOW('G', 8, struct gsm_dlci_config)