scc.h 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /* $Id: scc.h,v 1.29 1997/04/02 14:56:45 jreuter Exp jreuter $ */
  3. #ifndef _SCC_H
  4. #define _SCC_H
  5. #include <uapi/linux/scc.h>
  6. enum {TX_OFF, TX_ON}; /* command for scc_key_trx() */
  7. /* Vector masks in RR2B */
  8. #define VECTOR_MASK 0x06
  9. #define TXINT 0x00
  10. #define EXINT 0x02
  11. #define RXINT 0x04
  12. #define SPINT 0x06
  13. #ifdef CONFIG_SCC_DELAY
  14. #define Inb(port) inb_p(port)
  15. #define Outb(port, val) outb_p(val, port)
  16. #else
  17. #define Inb(port) inb(port)
  18. #define Outb(port, val) outb(val, port)
  19. #endif
  20. /* SCC channel control structure for KISS */
  21. struct scc_kiss {
  22. unsigned char txdelay; /* Transmit Delay 10 ms/cnt */
  23. unsigned char persist; /* Persistence (0-255) as a % */
  24. unsigned char slottime; /* Delay to wait on persistence hit */
  25. unsigned char tailtime; /* Delay after last byte written */
  26. unsigned char fulldup; /* Full Duplex mode 0=CSMA 1=DUP 2=ALWAYS KEYED */
  27. unsigned char waittime; /* Waittime before any transmit attempt */
  28. unsigned int maxkeyup; /* Maximum time to transmit (seconds) */
  29. unsigned int mintime; /* Minimal offtime after MAXKEYUP timeout (seconds) */
  30. unsigned int idletime; /* Maximum idle time in ALWAYS KEYED mode (seconds) */
  31. unsigned int maxdefer; /* Timer for CSMA channel busy limit */
  32. unsigned char tx_inhibit; /* Transmit is not allowed when set */
  33. unsigned char group; /* Group ID for AX.25 TX interlocking */
  34. unsigned char mode; /* 'normal' or 'hwctrl' mode (unused) */
  35. unsigned char softdcd; /* Use DPLL instead of DCD pin for carrier detect */
  36. };
  37. /* SCC channel structure */
  38. struct scc_channel {
  39. int init; /* channel exists? */
  40. struct net_device *dev; /* link to device control structure */
  41. struct net_device_stats dev_stat;/* device statistics */
  42. char brand; /* manufacturer of the board */
  43. long clock; /* used clock */
  44. io_port ctrl; /* I/O address of CONTROL register */
  45. io_port data; /* I/O address of DATA register */
  46. io_port special; /* I/O address of special function port */
  47. int irq; /* Number of Interrupt */
  48. char option;
  49. char enhanced; /* Enhanced SCC support */
  50. unsigned char wreg[16]; /* Copy of last written value in WRx */
  51. unsigned char status; /* Copy of R0 at last external interrupt */
  52. unsigned char dcd; /* DCD status */
  53. struct scc_kiss kiss; /* control structure for KISS params */
  54. struct scc_stat stat; /* statistical information */
  55. struct scc_modem modem; /* modem information */
  56. struct sk_buff_head tx_queue; /* next tx buffer */
  57. struct sk_buff *rx_buff; /* pointer to frame currently received */
  58. struct sk_buff *tx_buff; /* pointer to frame currently transmitted */
  59. /* Timer */
  60. struct timer_list tx_t; /* tx timer for this channel */
  61. struct timer_list tx_wdog; /* tx watchdogs */
  62. /* Channel lock */
  63. spinlock_t lock; /* Channel guard lock */
  64. };
  65. #endif /* defined(_SCC_H) */