logo

oasis-root

Compiled tree of Oasis Linux based on own branch at <https://hacktivis.me/git/oasis/> git clone https://anongit.hacktivis.me/git/oasis-root.git

gsmmux.h (4509B)


  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
  5. #include <linux/const.h>
  6. #include <linux/if.h>
  7. #include <linux/ioctl.h>
  8. #include <linux/types.h>
  9. /*
  10. * flags definition for n_gsm
  11. *
  12. * Used by:
  13. * struct gsm_config_ext.flags
  14. * struct gsm_dlci_config.flags
  15. */
  16. /* Forces a DLCI reset if set. Otherwise, a DLCI reset is only done if
  17. * incompatible settings were provided. Always cleared on retrieval.
  18. */
  19. #define GSM_FL_RESTART _BITUL(0)
  20. /**
  21. * struct gsm_config - n_gsm basic configuration parameters
  22. *
  23. * This structure is used in combination with GSMIOC_GETCONF and GSMIOC_SETCONF
  24. * to retrieve and set the basic parameters of an n_gsm ldisc.
  25. * struct gsm_config_ext can be used to configure extended ldisc parameters.
  26. *
  27. * All timers are in units of 1/100th of a second.
  28. *
  29. * @adaption: Convergence layer type
  30. * @encapsulation: Framing (0 = basic option, 1 = advanced option)
  31. * @initiator: Initiator or responder
  32. * @t1: Acknowledgment timer
  33. * @t2: Response timer for multiplexer control channel
  34. * @t3: Response timer for wake-up procedure
  35. * @n2: Maximum number of retransmissions
  36. * @mru: Maximum incoming frame payload size
  37. * @mtu: Maximum outgoing frame payload size
  38. * @k: Window size
  39. * @i: Frame type (1 = UIH, 2 = UI)
  40. * @unused: Can not be used
  41. */
  42. struct gsm_config
  43. {
  44. unsigned int adaption;
  45. unsigned int encapsulation;
  46. unsigned int initiator;
  47. unsigned int t1;
  48. unsigned int t2;
  49. unsigned int t3;
  50. unsigned int n2;
  51. unsigned int mru;
  52. unsigned int mtu;
  53. unsigned int k;
  54. unsigned int i;
  55. unsigned int unused[8];
  56. };
  57. #define GSMIOC_GETCONF _IOR('G', 0, struct gsm_config)
  58. #define GSMIOC_SETCONF _IOW('G', 1, struct gsm_config)
  59. /**
  60. * struct gsm_netconfig - n_gsm network configuration parameters
  61. *
  62. * This structure is used in combination with GSMIOC_ENABLE_NET and
  63. * GSMIOC_DISABLE_NET to enable or disable a network data connection
  64. * over a mux virtual tty channel. This is for modems that support
  65. * data connections with raw IP frames instead of PPP.
  66. *
  67. * @adaption: Adaption to use in network mode.
  68. * @protocol: Protocol to use - only ETH_P_IP supported.
  69. * @unused2: Can not be used.
  70. * @if_name: Interface name format string.
  71. * @unused: Can not be used.
  72. */
  73. struct gsm_netconfig {
  74. unsigned int adaption;
  75. unsigned short protocol;
  76. unsigned short unused2;
  77. char if_name[IFNAMSIZ];
  78. __u8 unused[28];
  79. };
  80. #define GSMIOC_ENABLE_NET _IOW('G', 2, struct gsm_netconfig)
  81. #define GSMIOC_DISABLE_NET _IO('G', 3)
  82. /* get the base tty number for a configured gsmmux tty */
  83. #define GSMIOC_GETFIRST _IOR('G', 4, __u32)
  84. /**
  85. * struct gsm_config_ext - n_gsm extended configuration parameters
  86. *
  87. * This structure is used in combination with GSMIOC_GETCONF_EXT and
  88. * GSMIOC_SETCONF_EXT to retrieve and set the extended parameters of an
  89. * n_gsm ldisc.
  90. *
  91. * All timers are in units of 1/100th of a second.
  92. *
  93. * @keep_alive: Control channel keep-alive in 1/100th of a second (0 to disable).
  94. * @wait_config: Wait for DLCI config before opening virtual link?
  95. * @flags: Mux specific flags.
  96. * @reserved: For future use, must be initialized to zero.
  97. */
  98. struct gsm_config_ext {
  99. __u32 keep_alive;
  100. __u32 wait_config;
  101. __u32 flags;
  102. __u32 reserved[5];
  103. };
  104. #define GSMIOC_GETCONF_EXT _IOR('G', 5, struct gsm_config_ext)
  105. #define GSMIOC_SETCONF_EXT _IOW('G', 6, struct gsm_config_ext)
  106. /**
  107. * struct gsm_dlci_config - n_gsm channel configuration parameters
  108. *
  109. * This structure is used in combination with GSMIOC_GETCONF_DLCI and
  110. * GSMIOC_SETCONF_DLCI to retrieve and set the channel specific parameters
  111. * of an n_gsm ldisc.
  112. *
  113. * Set the channel accordingly before calling GSMIOC_GETCONF_DLCI.
  114. *
  115. * @channel: DLCI (0 for the associated DLCI).
  116. * @adaption: Convergence layer type.
  117. * @mtu: Maximum transfer unit.
  118. * @priority: Priority (0 for default value).
  119. * @i: Frame type (1 = UIH, 2 = UI).
  120. * @k: Window size (0 for default value).
  121. * @flags: DLCI specific flags.
  122. * @reserved: For future use, must be initialized to zero.
  123. */
  124. struct gsm_dlci_config {
  125. __u32 channel;
  126. __u32 adaption;
  127. __u32 mtu;
  128. __u32 priority;
  129. __u32 i;
  130. __u32 k;
  131. __u32 flags;
  132. __u32 reserved[7];
  133. };
  134. #define GSMIOC_GETCONF_DLCI _IOWR('G', 7, struct gsm_dlci_config)
  135. #define GSMIOC_SETCONF_DLCI _IOW('G', 8, struct gsm_dlci_config)
  136. #endif