xref: /linux/include/uapi/linux/gsmmux.h (revision 84b9b44b)
1 /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2 #ifndef _LINUX_GSMMUX_H
3 #define _LINUX_GSMMUX_H
4 
5 #include <linux/if.h>
6 #include <linux/ioctl.h>
7 #include <linux/types.h>
8 
9 struct gsm_config
10 {
11 	unsigned int adaption;
12 	unsigned int encapsulation;
13 	unsigned int initiator;
14 	unsigned int t1;
15 	unsigned int t2;
16 	unsigned int t3;
17 	unsigned int n2;
18 	unsigned int mru;
19 	unsigned int mtu;
20 	unsigned int k;
21 	unsigned int i;
22 	unsigned int unused[8];	/* Can not be used */
23 };
24 
25 #define GSMIOC_GETCONF		_IOR('G', 0, struct gsm_config)
26 #define GSMIOC_SETCONF		_IOW('G', 1, struct gsm_config)
27 
28 struct gsm_netconfig {
29 	unsigned int adaption;  /* Adaption to use in network mode */
30 	unsigned short protocol;/* Protocol to use - only ETH_P_IP supported */
31 	unsigned short unused2;	/* Can not be used */
32 	char if_name[IFNAMSIZ];	/* interface name format string */
33 	__u8 unused[28];        /* Can not be used */
34 };
35 
36 #define GSMIOC_ENABLE_NET      _IOW('G', 2, struct gsm_netconfig)
37 #define GSMIOC_DISABLE_NET     _IO('G', 3)
38 
39 /* get the base tty number for a configured gsmmux tty */
40 #define GSMIOC_GETFIRST		_IOR('G', 4, __u32)
41 
42 struct gsm_config_ext {
43 	__u32 keep_alive;	/* Control channel keep-alive in 1/100th of a
44 				 * second (0 to disable)
45 				 */
46 	__u32 wait_config;	/* Wait for DLCI config before opening virtual link? */
47 	__u32 reserved[6];	/* For future use, must be initialized to zero */
48 };
49 
50 #define GSMIOC_GETCONF_EXT	_IOR('G', 5, struct gsm_config_ext)
51 #define GSMIOC_SETCONF_EXT	_IOW('G', 6, struct gsm_config_ext)
52 
53 /* Set channel accordingly before calling GSMIOC_GETCONF_DLCI. */
54 struct gsm_dlci_config {
55 	__u32 channel;		/* DLCI (0 for the associated DLCI) */
56 	__u32 adaption;		/* Convergence layer type */
57 	__u32 mtu;		/* Maximum transfer unit */
58 	__u32 priority;		/* Priority (0 for default value) */
59 	__u32 i;		/* Frame type (1 = UIH, 2 = UI) */
60 	__u32 k;		/* Window size (0 for default value) */
61 	__u32 reserved[8];	/* For future use, must be initialized to zero */
62 };
63 
64 #define GSMIOC_GETCONF_DLCI	_IOWR('G', 7, struct gsm_dlci_config)
65 #define GSMIOC_SETCONF_DLCI	_IOW('G', 8, struct gsm_dlci_config)
66 
67 #endif
68