scc.h 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  1. /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
  2. /* $Id: scc.h,v 1.29 1997/04/02 14:56:45 jreuter Exp jreuter $ */
  3. #ifndef _UAPI_SCC_H
  4. #define _UAPI_SCC_H
  5. /* selection of hardware types */
  6. #define PA0HZP 0x00 /* hardware type for PA0HZP SCC card and compatible */
  7. #define EAGLE 0x01 /* hardware type for EAGLE card */
  8. #define PC100 0x02 /* hardware type for PC100 card */
  9. #define PRIMUS 0x04 /* hardware type for PRIMUS-PC (DG9BL) card */
  10. #define DRSI 0x08 /* hardware type for DRSI PC*Packet card */
  11. #define BAYCOM 0x10 /* hardware type for BayCom (U)SCC */
  12. /* DEV ioctl() commands */
  13. enum SCC_ioctl_cmds {
  14. SIOCSCCRESERVED = SIOCDEVPRIVATE,
  15. SIOCSCCCFG,
  16. SIOCSCCINI,
  17. SIOCSCCCHANINI,
  18. SIOCSCCSMEM,
  19. SIOCSCCGKISS,
  20. SIOCSCCSKISS,
  21. SIOCSCCGSTAT,
  22. SIOCSCCCAL
  23. };
  24. /* Device parameter control (from WAMPES) */
  25. enum L1_params {
  26. PARAM_DATA,
  27. PARAM_TXDELAY,
  28. PARAM_PERSIST,
  29. PARAM_SLOTTIME,
  30. PARAM_TXTAIL,
  31. PARAM_FULLDUP,
  32. PARAM_SOFTDCD, /* was: PARAM_HW */
  33. PARAM_MUTE, /* ??? */
  34. PARAM_DTR,
  35. PARAM_RTS,
  36. PARAM_SPEED,
  37. PARAM_ENDDELAY, /* ??? */
  38. PARAM_GROUP,
  39. PARAM_IDLE,
  40. PARAM_MIN,
  41. PARAM_MAXKEY,
  42. PARAM_WAIT,
  43. PARAM_MAXDEFER,
  44. PARAM_TX,
  45. PARAM_HWEVENT = 31,
  46. PARAM_RETURN = 255 /* reset kiss mode */
  47. };
  48. /* fulldup parameter */
  49. enum FULLDUP_modes {
  50. KISS_DUPLEX_HALF, /* normal CSMA operation */
  51. KISS_DUPLEX_FULL, /* fullduplex, key down trx after transmission */
  52. KISS_DUPLEX_LINK, /* fullduplex, key down trx after 'idletime' sec */
  53. KISS_DUPLEX_OPTIMA /* fullduplex, let the protocol layer control the hw */
  54. };
  55. /* misc. parameters */
  56. #define TIMER_OFF 65535U /* to switch off timers */
  57. #define NO_SUCH_PARAM 65534U /* param not implemented */
  58. /* HWEVENT parameter */
  59. enum HWEVENT_opts {
  60. HWEV_DCD_ON,
  61. HWEV_DCD_OFF,
  62. HWEV_ALL_SENT
  63. };
  64. /* channel grouping */
  65. #define RXGROUP 0100 /* if set, only tx when all channels clear */
  66. #define TXGROUP 0200 /* if set, don't transmit simultaneously */
  67. /* Tx/Rx clock sources */
  68. enum CLOCK_sources {
  69. CLK_DPLL, /* normal halfduplex operation */
  70. CLK_EXTERNAL, /* external clocking (G3RUH/DF9IC modems) */
  71. CLK_DIVIDER, /* Rx = DPLL, Tx = divider (fullduplex with */
  72. /* modems without clock regeneration */
  73. CLK_BRG /* experimental fullduplex mode with DPLL/BRG for */
  74. /* MODEMs without clock recovery */
  75. };
  76. /* Tx state */
  77. enum TX_state {
  78. TXS_IDLE, /* Transmitter off, no data pending */
  79. TXS_BUSY, /* waiting for permission to send / tailtime */
  80. TXS_ACTIVE, /* Transmitter on, sending data */
  81. TXS_NEWFRAME, /* reset CRC and send (next) frame */
  82. TXS_IDLE2, /* Transmitter on, no data pending */
  83. TXS_WAIT, /* Waiting for Mintime to expire */
  84. TXS_TIMEOUT /* We had a transmission timeout */
  85. };
  86. typedef unsigned long io_port; /* type definition for an 'io port address' */
  87. /* SCC statistical information */
  88. struct scc_stat {
  89. long rxints; /* Receiver interrupts */
  90. long txints; /* Transmitter interrupts */
  91. long exints; /* External/status interrupts */
  92. long spints; /* Special receiver interrupts */
  93. long txframes; /* Packets sent */
  94. long rxframes; /* Number of Frames Actually Received */
  95. long rxerrs; /* CRC Errors */
  96. long txerrs; /* KISS errors */
  97. unsigned int nospace; /* "Out of buffers" */
  98. unsigned int rx_over; /* Receiver Overruns */
  99. unsigned int tx_under; /* Transmitter Underruns */
  100. unsigned int tx_state; /* Transmitter state */
  101. int tx_queued; /* tx frames enqueued */
  102. unsigned int maxqueue; /* allocated tx_buffers */
  103. unsigned int bufsize; /* used buffersize */
  104. };
  105. struct scc_modem {
  106. long speed; /* Line speed, bps */
  107. char clocksrc; /* 0 = DPLL, 1 = external, 2 = divider */
  108. char nrz; /* NRZ instead of NRZI */
  109. };
  110. struct scc_kiss_cmd {
  111. int command; /* one of the KISS-Commands defined above */
  112. unsigned param; /* KISS-Param */
  113. };
  114. struct scc_hw_config {
  115. io_port data_a; /* data port channel A */
  116. io_port ctrl_a; /* control port channel A */
  117. io_port data_b; /* data port channel B */
  118. io_port ctrl_b; /* control port channel B */
  119. io_port vector_latch; /* INTACK-Latch (#) */
  120. io_port special; /* special function port */
  121. int irq; /* irq */
  122. long clock; /* clock */
  123. char option; /* command for function port */
  124. char brand; /* hardware type */
  125. char escc; /* use ext. features of a 8580/85180/85280 */
  126. };
  127. /* (#) only one INTACK latch allowed. */
  128. struct scc_mem_config {
  129. unsigned int dummy;
  130. unsigned int bufsize;
  131. };
  132. struct scc_calibrate {
  133. unsigned int time;
  134. unsigned char pattern;
  135. };
  136. #endif /* _UAPI_SCC_H */