home *** CD-ROM | disk | FTP | other *** search
/ Media Share 9 / MEDIASHARE_09.ISO / network / src_1218.zip / HS.H < prev    next >
C/C++ Source or Header  |  1991-02-11  |  2KB  |  87 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. };
  30. extern struct hs Hs[];
  31.  
  32. /* Register offset info, specific to the DRSI PCPA and Eagle cards
  33.  * E.g., to read the data port on channel A, use
  34.  *      inportb(hdlc[dev].base + CHANA + DATA)
  35.  */
  36. #define    CHANB        0    /* Base of channel B regs */
  37. #define    CHANA        2    /* Base of channel A regs */
  38.  
  39. /* 8530 ports on each channel */
  40. #define    CTL    0
  41. #define    DATA    1
  42.  
  43. struct hdlc {
  44.     long rxints;        /* Receiver interrupts */
  45.     long txints;        /* Transmitter interrupts */
  46.     long exints;        /* External/status interrupts */
  47.     long spints;        /* Special receiver interrupts */
  48.     long rxbytes;        /* Total receive bytes */
  49.     long nomem;        /* Buffer allocate failures */
  50.     long toobig;        /* Giant receiver packets */
  51.     long crcerr;        /* CRC Errors */
  52.     long aborts;        /* Receiver aborts */
  53.     long good;        /* Valid frames */
  54.     long txpkts;
  55.     long overrun;        /* Receiver overruns */
  56.  
  57.     int16 bufsiz;        /* Size of rcvbuf */
  58.  
  59.     int dev;        /* Device number */
  60.     int clkrev;        /* Clock pins swapped */
  61.     int16 ctl;        /* Control register */
  62.     int16 data;        /* Data register */
  63.     int16 speed;        /* Line speed, bps */
  64.     long txdelay;        /* Keyup delay, ticks */ 
  65.     char p;            /* P-persistence value */
  66.     struct mbuf *txq;    /* Transmit queue */
  67.  
  68.     struct iface *iface;    /* Associated interface */
  69.     int32 deftime;        /* Time when we can next transmit */
  70. };
  71.  
  72. #define    OFF    0
  73. #define    ON    1
  74.  
  75. /* Baud rate generator definitions */
  76. struct baudrate {
  77.     int16 speed;
  78.     char val;
  79. };
  80. /* In hs.c: */
  81. void hsint __ARGS((int dev));
  82.  
  83. /* In hsvec.asm: */
  84. INTERRUPT hs0vec __ARGS((int dev));
  85.  
  86. #endif /* _HS_H */
  87.