7 #define RX_BUF_SIZE ETH_MTU /* buffer size variables. NB !! */
8 #define TX_BUF_SIZE ETH_MTU /* must be same as in pkt_rx*.* */
11 #pragma Off(Align_members)
16 typedef enum { /* Packet-driver classes */
34 typedef enum { /* Packet-driver receive modes */
35 PDRX_OFF
= 1, /* turn off receiver */
36 PDRX_DIRECT
, /* receive only to this interface */
37 PDRX_BROADCAST
, /* DIRECT + broadcast packets */
38 PDRX_MULTICAST1
, /* BROADCAST + limited multicast */
39 PDRX_MULTICAST2
, /* BROADCAST + all multicast */
40 PDRX_ALL_PACKETS
, /* receive all packets on network */
50 BYTE
class; /* = 1 for DEC/Interl/Xerox Ethernet */
51 BYTE number
; /* = 0 for single LAN adapter */
52 WORD type
; /* = 13 for 3C523 */
53 BYTE funcs
; /* Basic/Extended/HiPerf functions */
54 WORD intr
; /* user interrupt vector number */
55 WORD handle
; /* Handle associated with session */
56 BYTE name
[15]; /* Name of adapter interface,ie.3C523*/
57 BOOL quiet
; /* (don't) print errors to stdout */
58 const char *error
; /* address of error string */
59 BYTE majVer
; /* Major driver implementation ver. */
60 BYTE minVer
; /* Minor driver implementation ver. */
61 BYTE dummyLen
; /* length of following data */
62 WORD MAClength
; /* HiPerformance data, N/A */
63 WORD MTU
; /* HiPerformance data, N/A */
64 WORD multicast
; /* HiPerformance data, N/A */
65 WORD rcvrBuffers
; /* valid for */
66 WORD UMTbufs
; /* High Performance drivers only */
67 WORD postEOIintr
; /* Usage ?? */
70 #define PKT_PARAM_SIZE 14 /* members majVer - postEOIintr */
74 DWORD inPackets
; /* # of packets received */
75 DWORD outPackets
; /* # of packets transmitted */
76 DWORD inBytes
; /* # of bytes received */
77 DWORD outBytes
; /* # of bytes transmitted */
78 DWORD inErrors
; /* # of reception errors */
79 DWORD outErrors
; /* # of transmission errors */
80 DWORD lost
; /* # of packets lost (RX) */
88 BYTE data
[TX_BUF_SIZE
];
92 WORD firstCount
; /* # of bytes on 1st */
93 WORD secondCount
; /* and 2nd upcall */
94 WORD handle
; /* instance that upcalled */
95 ETHER destin
; /* E-net destination address */
96 ETHER source
; /* E-net source address */
97 WORD proto
; /* protocol number */
98 BYTE data
[RX_BUF_SIZE
];
103 #pragma pop(Align_members)
110 * Prototypes for publics
117 extern PKT_STAT pktStat
; /* statistics for packets */
118 extern PKT_INFO pktInfo
; /* packet-driver information */
120 extern PKT_RX_MODE receiveMode
;
121 extern ETHER myAddress
, ethBroadcast
;
123 extern BOOL
PktInitDriver (PKT_RX_MODE mode
);
124 extern BOOL
PktExitDriver (void);
126 extern const char *PktGetErrorStr (int errNum
);
127 extern const char *PktGetClassName (WORD
class);
128 extern const char *PktRXmodeStr (PKT_RX_MODE mode
);
129 extern BOOL
PktSearchDriver (void);
130 extern int PktReceive (BYTE
*buf
, int max
);
131 extern BOOL
PktTransmit (const void *eth
, int len
);
132 extern DWORD
PktRxDropped (void);
133 extern BOOL
PktReleaseHandle (WORD handle
);
134 extern BOOL
PktTerminHandle (WORD handle
);
135 extern BOOL
PktResetInterface (WORD handle
);
136 extern BOOL
PktSetReceiverMode(PKT_RX_MODE mode
);
137 extern BOOL
PktGetReceiverMode(PKT_RX_MODE
*mode
);
138 extern BOOL
PktGetStatistics (WORD handle
);
139 extern BOOL
PktSessStatistics (WORD handle
);
140 extern BOOL
PktResetStatistics(WORD handle
);
141 extern BOOL
PktGetAddress (ETHER
*addr
);
142 extern BOOL
PktSetAddress (const ETHER
*addr
);
143 extern BOOL
PktGetDriverInfo (void);
144 extern BOOL
PktGetDriverParam (void);
145 extern void PktQueueBusy (BOOL busy
);
146 extern WORD
PktBuffersUsed (void);
152 #endif /* __PKTDRVR_H */