scc.h 2.8 KB

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