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