if_frad.h 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. /* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
  2. /*
  3. * DLCI/FRAD Definitions for Frame Relay Access Devices. DLCI devices are
  4. * created for each DLCI associated with a FRAD. The FRAD driver
  5. * is not truly a network device, but the lower level device
  6. * handler. This allows other FRAD manufacturers to use the DLCI
  7. * code, including its RFC1490 encapsulation alongside the current
  8. * implementation for the Sangoma cards.
  9. *
  10. * Version: @(#)if_ifrad.h 0.15 31 Mar 96
  11. *
  12. * Author: Mike McLagan <mike.mclagan@linux.org>
  13. *
  14. * Changes:
  15. * 0.15 Mike McLagan changed structure defs (packed)
  16. * re-arranged flags
  17. * added DLCI_RET vars
  18. *
  19. * This program is free software; you can redistribute it and/or
  20. * modify it under the terms of the GNU General Public License
  21. * as published by the Free Software Foundation; either version
  22. * 2 of the License, or (at your option) any later version.
  23. */
  24. #ifndef _UAPI_FRAD_H_
  25. #define _UAPI_FRAD_H_
  26. #include <linux/if.h>
  27. /* Structures and constants associated with the DLCI device driver */
  28. struct dlci_add
  29. {
  30. char devname[IFNAMSIZ];
  31. short dlci;
  32. };
  33. #define DLCI_GET_CONF (SIOCDEVPRIVATE + 2)
  34. #define DLCI_SET_CONF (SIOCDEVPRIVATE + 3)
  35. /*
  36. * These are related to the Sangoma SDLA and should remain in order.
  37. * Code within the SDLA module is based on the specifics of this
  38. * structure. Change at your own peril.
  39. */
  40. struct dlci_conf {
  41. short flags;
  42. short CIR_fwd;
  43. short Bc_fwd;
  44. short Be_fwd;
  45. short CIR_bwd;
  46. short Bc_bwd;
  47. short Be_bwd;
  48. /* these are part of the status read */
  49. short Tc_fwd;
  50. short Tc_bwd;
  51. short Tf_max;
  52. short Tb_max;
  53. /* add any new fields here above is a mirror of sdla_dlci_conf */
  54. };
  55. #define DLCI_GET_SLAVE (SIOCDEVPRIVATE + 4)
  56. /* configuration flags for DLCI */
  57. #define DLCI_IGNORE_CIR_OUT 0x0001
  58. #define DLCI_ACCOUNT_CIR_IN 0x0002
  59. #define DLCI_BUFFER_IF 0x0008
  60. #define DLCI_VALID_FLAGS 0x000B
  61. /* defines for the actual Frame Relay hardware */
  62. #define FRAD_GET_CONF (SIOCDEVPRIVATE)
  63. #define FRAD_SET_CONF (SIOCDEVPRIVATE + 1)
  64. #define FRAD_LAST_IOCTL FRAD_SET_CONF
  65. /*
  66. * Based on the setup for the Sangoma SDLA. If changes are
  67. * necessary to this structure, a routine will need to be
  68. * added to that module to copy fields.
  69. */
  70. struct frad_conf
  71. {
  72. short station;
  73. short flags;
  74. short kbaud;
  75. short clocking;
  76. short mtu;
  77. short T391;
  78. short T392;
  79. short N391;
  80. short N392;
  81. short N393;
  82. short CIR_fwd;
  83. short Bc_fwd;
  84. short Be_fwd;
  85. short CIR_bwd;
  86. short Bc_bwd;
  87. short Be_bwd;
  88. /* Add new fields here, above is a mirror of the sdla_conf */
  89. };
  90. #define FRAD_STATION_CPE 0x0000
  91. #define FRAD_STATION_NODE 0x0001
  92. #define FRAD_TX_IGNORE_CIR 0x0001
  93. #define FRAD_RX_ACCOUNT_CIR 0x0002
  94. #define FRAD_DROP_ABORTED 0x0004
  95. #define FRAD_BUFFERIF 0x0008
  96. #define FRAD_STATS 0x0010
  97. #define FRAD_MCI 0x0100
  98. #define FRAD_AUTODLCI 0x8000
  99. #define FRAD_VALID_FLAGS 0x811F
  100. #define FRAD_CLOCK_INT 0x0001
  101. #define FRAD_CLOCK_EXT 0x0000
  102. #endif /* _UAPI_FRAD_H_ */