home *** CD-ROM | disk | FTP | other *** search
/ Media Share 9 / MEDIASHARE_09.ISO / hamradio / s920603.zip / HS.H < prev    next >
C/C++ Source or Header  |  1992-04-03  |  2KB  |  88 lines

  1. #ifndef    _HS_H
  2. #define    _HS_H
  3. /* Hardware-dependent routines for the DRSI or Eagle cards for the PC
  4.  * driving a high speed modem. These cards both contain Zilog 8530s.
  5.  */
  6.  
  7. #ifndef    _GLOBAL_H
  8. #include "global.h"
  9. #endif
  10.  
  11. #ifndef    _MBUF_H
  12. #include "mbuf.h"
  13. #endif
  14.  
  15. #ifndef    _IFACE_H
  16. #include "iface.h"
  17. #endif
  18.  
  19. #define    NHS    1        /* One card max */
  20.  
  21. struct hs {
  22.     struct {
  23.         INTERRUPT (*vec) __ARGS((void));
  24.     } save;
  25.  
  26.     int16 addr;    /* Base I/O adHsess */
  27.     int16 vec;    /* Vector */
  28.     long ints;    /* Interrupt count */
  29.     char chain;    /* Interrupt chaining enable */
  30. };
  31. extern struct hs Hs[];
  32.  
  33. /* Register offset info, specific to the DRSI PCPA and Eagle cards
  34.  * E.g., to read the data port on channel A, use
  35.  *      inportb(hdlc[dev].base + CHANA + DATA)
  36.  */
  37. #define    CHANB        0    /* Base of channel B regs */
  38. #define    CHANA        2    /* Base of channel A regs */
  39.  
  40. /* 8530 ports on each channel */
  41. #define    CTL    0
  42. #define    DATA    1
  43.  
  44. struct hdlc {
  45.     long rxints;        /* Receiver interrupts */
  46.     long txints;        /* Transmitter interrupts */
  47.     long exints;        /* External/status interrupts */
  48.     long spints;        /* Special receiver interrupts */
  49.     long rxbytes;        /* Total receive bytes */
  50.     long nomem;        /* Buffer allocate failures */
  51.     long toobig;        /* Giant receiver packets */
  52.     long crcerr;        /* CRC Errors */
  53.     long aborts;        /* Receiver aborts */
  54.     long good;        /* Valid frames */
  55.     long txpkts;
  56.     long overrun;        /* Receiver overruns */
  57.  
  58.     int16 bufsiz;        /* Size of rcvbuf */
  59.  
  60.     int dev;        /* Device number */
  61.     int clkrev;        /* Clock pins swapped */
  62.     int16 ctl;        /* Control register */
  63.     int16 data;        /* Data register */
  64.     int16 speed;        /* Line speed, bps */
  65.     long txdelay;        /* Keyup delay, ticks */ 
  66.     char p;            /* P-persistence value */
  67.     struct mbuf *txq;    /* Transmit queue */
  68.  
  69.     struct iface *iface;    /* Associated interface */
  70.     int32 deftime;        /* Time when we can next transmit */
  71. };
  72.  
  73. #define    OFF    0
  74. #define    ON    1
  75.  
  76. /* Baud rate generator definitions */
  77. struct baudrate {
  78.     int16 speed;
  79.     char val;
  80. };
  81. /* In hs.c: */
  82. INTERRUPT (far *(hsint) __ARGS((int dev)))();
  83.  
  84. /* In hsvec.asm: */
  85. INTERRUPT hs0vec __ARGS((int dev));
  86.  
  87. #endif /* _HS_H */
  88.