home *** CD-ROM | disk | FTP | other *** search
/ Doom Fever / Doom_Fever-1995_Maple_Media.iso / dmutil / drivers.zip / PKTDRVR.H < prev    next >
C/C++ Source or Header  |  1990-04-11  |  3KB  |  104 lines

  1. #ifndef    CL_ETHERNET
  2.  
  3. #define    PK_MAX    3    /* Add extra interrupt hooks if you increase this */
  4.  
  5. /* Packet driver interface classes */
  6. #define    CL_NONE        0
  7. #define    CL_ETHERNET    1
  8. #define    CL_PRONET_10    2
  9. #define    CL_IEEE8025    3
  10. #define    CL_OMNINET    4
  11. #define    CL_APPLETALK    5
  12. #define    CL_SERIAL_LINE    6
  13. #define    CL_STARLAN    7
  14. #define    CL_ARCNET    8
  15. #define    CL_AX25        9
  16. #define    CL_KISS        10
  17. #define CL_IEEE8023    11
  18. #define CL_FDDI     12
  19. #define CL_INTERNET_X25 13
  20. #define CL_LANSTAR    14
  21. #define CL_SLFP     15
  22. #define    CL_NETROM    16
  23. #define NCLASS        17
  24.  
  25. /* Packet driver interface types (not a complete list) */
  26. #define    TC500        1
  27. #define    PC2000        10
  28. #define    WD8003        14
  29. #define    PC8250        15
  30. #define    ANYTYPE        0xffff
  31.  
  32. /* Packet driver function call numbers. From Appendix B. */
  33. #define    DRIVER_INFO        1
  34. #define    ACCESS_TYPE        2
  35. #define    RELEASE_TYPE        3
  36. #define    SEND_PKT        4
  37. #define    TERMINATE        5
  38. #define    GET_ADDRESS        6
  39. #define    RESET_INTERFACE        7
  40. #define GET_PARAMETERS        10
  41. #define AS_SEND_PKT        11
  42. #define    SET_RCV_MODE        20
  43. #define    GET_RCV_MODE        21
  44. #define    SET_MULTICAST_LIST    22
  45. #define    GET_MULTICAST_LIST    23
  46. #define    GET_STATISTICS        24
  47. #define SET_ADDRESS        25
  48.  
  49. /* Packet driver error return codes. From Appendix C. */
  50.  
  51. #define    NO_ERROR    0
  52. #define    BAD_HANDLE    1    /* invalid handle number */
  53. #define    NO_CLASS    2    /* no interfaces of specified class found */
  54. #define    NO_TYPE        3    /* no interfaces of specified type found */
  55. #define    NO_NUMBER    4    /* no interfaces of specified number found */
  56. #define    BAD_TYPE    5    /* bad packet type specified */
  57. #define    NO_MULTICAST    6    /* this interface does not support multicast */
  58. #define    CANT_TERMINATE    7    /* this packet driver cannot terminate */
  59. #define    BAD_MODE    8    /* an invalid receiver mode was specified */
  60. #define    NO_SPACE    9    /* operation failed because of insufficient space */
  61. #define    TYPE_INUSE    10    /* the type had previously been accessed, and not released */
  62. #define    BAD_COMMAND    11    /* the command was out of range, or not    implemented */
  63. #define    CANT_SEND    12    /* the packet couldn't be sent (usually    hardware error) */
  64. #define CANT_SET    13    /* hardware address couldn't be changed (> 1 handle open) */
  65. #define BAD_ADDRESS    14    /* hardware address has bad length or format */
  66. #define CANT_RESET    15    /* couldn't reset interface (> 1 handle open) */
  67.  
  68. typedef union {
  69.     struct {
  70.         unsigned char lo;
  71.         unsigned char hi;
  72.     } byte;
  73.     unsigned short word;
  74. } ureg;
  75.  
  76. #define    CARRY_FLAG    0x1
  77.  
  78. struct pktdrvr {
  79.     int class;    /* Interface class (ether/slip/etc) */
  80.     int intno;    /* Interrupt vector */
  81.     short handle1;    /* Driver handle(s) */
  82.     short handle2;
  83.     struct mbuf *buffer;    /* Currently allocated rx buffer */
  84.     struct mbuf *rcvq;    /* Receive queue */
  85.     struct iface *iface;
  86. };
  87.  
  88. extern struct pktdrvr Pktdrvr[];
  89.  
  90. /* In pktdrvr.c: */
  91. void pkint __ARGS((int dev,unsigned short di,unsigned short si,
  92.     unsigned short bp,unsigned short dx,unsigned short cx,
  93.     unsigned short bx,unsigned short ax,unsigned short ds,
  94.     unsigned short es));
  95. int pk_send __ARGS((struct mbuf *bp,struct iface *iface,int32 gateway,
  96.     int prec,int del,int tput,int rel));
  97.  
  98. /* In pkvec.asm: */
  99. INTERRUPT pkvec0 __ARGS((void));
  100. INTERRUPT pkvec1 __ARGS((void));
  101. INTERRUPT pkvec2 __ARGS((void));
  102.  
  103. #endif    /* CL_ETHERNET */
  104.