atmsap.h 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  1. /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
  2. /* atmsap.h - ATM Service Access Point addressing definitions */
  3. /* Written 1995-1999 by Werner Almesberger, EPFL LRC/ICA */
  4. #ifndef _LINUX_ATMSAP_H
  5. #define _LINUX_ATMSAP_H
  6. #include <linux/atmapi.h>
  7. /*
  8. * BEGIN_xx and END_xx markers are used for automatic generation of
  9. * documentation. Do not change them.
  10. */
  11. /*
  12. * Layer 2 protocol identifiers
  13. */
  14. /* BEGIN_L2 */
  15. #define ATM_L2_NONE 0 /* L2 not specified */
  16. #define ATM_L2_ISO1745 0x01 /* Basic mode ISO 1745 */
  17. #define ATM_L2_Q291 0x02 /* ITU-T Q.291 (Rec. I.441) */
  18. #define ATM_L2_X25_LL 0x06 /* ITU-T X.25, link layer */
  19. #define ATM_L2_X25_ML 0x07 /* ITU-T X.25, multilink */
  20. #define ATM_L2_LAPB 0x08 /* Extended LAPB, half-duplex (Rec. T.71) */
  21. #define ATM_L2_HDLC_ARM 0x09 /* HDLC ARM (ISO/IEC 4335) */
  22. #define ATM_L2_HDLC_NRM 0x0a /* HDLC NRM (ISO/IEC 4335) */
  23. #define ATM_L2_HDLC_ABM 0x0b /* HDLC ABM (ISO/IEC 4335) */
  24. #define ATM_L2_ISO8802 0x0c /* LAN LLC (ISO/IEC 8802/2) */
  25. #define ATM_L2_X75 0x0d /* ITU-T X.75, SLP */
  26. #define ATM_L2_Q922 0x0e /* ITU-T Q.922 */
  27. #define ATM_L2_USER 0x10 /* user-specified */
  28. #define ATM_L2_ISO7776 0x11 /* ISO 7776 DTE-DTE */
  29. /* END_L2 */
  30. /*
  31. * Layer 3 protocol identifiers
  32. */
  33. /* BEGIN_L3 */
  34. #define ATM_L3_NONE 0 /* L3 not specified */
  35. #define ATM_L3_X25 0x06 /* ITU-T X.25, packet layer */
  36. #define ATM_L3_ISO8208 0x07 /* ISO/IEC 8208 */
  37. #define ATM_L3_X223 0x08 /* ITU-T X.223 | ISO/IEC 8878 */
  38. #define ATM_L3_ISO8473 0x09 /* ITU-T X.233 | ISO/IEC 8473 */
  39. #define ATM_L3_T70 0x0a /* ITU-T T.70 minimum network layer */
  40. #define ATM_L3_TR9577 0x0b /* ISO/IEC TR 9577 */
  41. #define ATM_L3_H310 0x0c /* ITU-T Recommendation H.310 */
  42. #define ATM_L3_H321 0x0d /* ITU-T Recommendation H.321 */
  43. #define ATM_L3_USER 0x10 /* user-specified */
  44. /* END_L3 */
  45. /*
  46. * High layer identifiers
  47. */
  48. /* BEGIN_HL */
  49. #define ATM_HL_NONE 0 /* HL not specified */
  50. #define ATM_HL_ISO 0x01 /* ISO */
  51. #define ATM_HL_USER 0x02 /* user-specific */
  52. #define ATM_HL_HLP 0x03 /* high layer profile - UNI 3.0 only */
  53. #define ATM_HL_VENDOR 0x04 /* vendor-specific application identifier */
  54. /* END_HL */
  55. /*
  56. * ITU-T coded mode of operation
  57. */
  58. /* BEGIN_IMD */
  59. #define ATM_IMD_NONE 0 /* mode not specified */
  60. #define ATM_IMD_NORMAL 1 /* normal mode of operation */
  61. #define ATM_IMD_EXTENDED 2 /* extended mode of operation */
  62. /* END_IMD */
  63. /*
  64. * H.310 code points
  65. */
  66. #define ATM_TT_NONE 0 /* terminal type not specified */
  67. #define ATM_TT_RX 1 /* receive only */
  68. #define ATM_TT_TX 2 /* send only */
  69. #define ATM_TT_RXTX 3 /* receive and send */
  70. #define ATM_MC_NONE 0 /* no multiplexing */
  71. #define ATM_MC_TS 1 /* transport stream (TS) */
  72. #define ATM_MC_TS_FEC 2 /* transport stream with forward error corr. */
  73. #define ATM_MC_PS 3 /* program stream (PS) */
  74. #define ATM_MC_PS_FEC 4 /* program stream with forward error corr. */
  75. #define ATM_MC_H221 5 /* ITU-T Rec. H.221 */
  76. /*
  77. * SAP structures
  78. */
  79. #define ATM_MAX_HLI 8 /* maximum high-layer information length */
  80. struct atm_blli {
  81. unsigned char l2_proto; /* layer 2 protocol */
  82. union {
  83. struct {
  84. unsigned char mode; /* mode of operation (ATM_IMD_xxx), 0 if */
  85. /* absent */
  86. unsigned char window; /* window size (k), 1-127 (0 to omit) */
  87. } itu; /* ITU-T encoding */
  88. unsigned char user; /* user-specified l2 information */
  89. } l2;
  90. unsigned char l3_proto; /* layer 3 protocol */
  91. union {
  92. struct {
  93. unsigned char mode; /* mode of operation (ATM_IMD_xxx), 0 if */
  94. /* absent */
  95. unsigned char def_size; /* default packet size (log2), 4-12 (0 to */
  96. /* omit) */
  97. unsigned char window;/* packet window size, 1-127 (0 to omit) */
  98. } itu; /* ITU-T encoding */
  99. unsigned char user; /* user specified l3 information */
  100. struct { /* if l3_proto = ATM_L3_H310 */
  101. unsigned char term_type; /* terminal type */
  102. unsigned char fw_mpx_cap; /* forward multiplexing capability */
  103. /* only if term_type != ATM_TT_NONE */
  104. unsigned char bw_mpx_cap; /* backward multiplexing capability */
  105. /* only if term_type != ATM_TT_NONE */
  106. } h310;
  107. struct { /* if l3_proto = ATM_L3_TR9577 */
  108. unsigned char ipi; /* initial protocol id */
  109. unsigned char snap[5];/* IEEE 802.1 SNAP identifier */
  110. /* (only if ipi == NLPID_IEEE802_1_SNAP) */
  111. } tr9577;
  112. } l3;
  113. } __ATM_API_ALIGN;
  114. struct atm_bhli {
  115. unsigned char hl_type; /* high layer information type */
  116. unsigned char hl_length; /* length (only if hl_type == ATM_HL_USER || */
  117. /* hl_type == ATM_HL_ISO) */
  118. unsigned char hl_info[ATM_MAX_HLI];/* high layer information */
  119. };
  120. #define ATM_MAX_BLLI 3 /* maximum number of BLLI elements */
  121. struct atm_sap {
  122. struct atm_bhli bhli; /* local SAP, high-layer information */
  123. struct atm_blli blli[ATM_MAX_BLLI] __ATM_API_ALIGN;
  124. /* local SAP, low-layer info */
  125. };
  126. static __inline__ int blli_in_use(struct atm_blli blli)
  127. {
  128. return blli.l2_proto || blli.l3_proto;
  129. }
  130. #endif