if_frad.h 2.9 KB

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