custom message type for VM_INFO
[minix3.git] / sys / lib / libsa / netif.h
blob446f63ae24f97251d03183733312e2fb13337835
1 /* $NetBSD: netif.h,v 1.7 2009/01/17 14:00:36 tsutsui Exp $ */
3 #ifndef __SYS_LIBNETBOOT_NETIF_H
4 #define __SYS_LIBNETBOOT_NETIF_H
6 #include "iodesc.h"
8 struct netif; /* forward */
10 struct netif_driver {
11 char *netif_bname;
12 int (*netif_match)(struct netif *, void *);
13 int (*netif_probe)(struct netif *, void *);
14 void (*netif_init)(struct iodesc *, void *);
15 int (*netif_get)(struct iodesc *, void *, size_t, saseconds_t);
16 int (*netif_put)(struct iodesc *, void *, size_t);
17 void (*netif_end)(struct netif *);
18 struct netif_dif *netif_ifs;
19 int netif_nifs;
22 struct netif_dif {
23 int dif_unit;
24 int dif_nsel;
25 struct netif_stats *dif_stats;
26 void *dif_private;
27 /* the following fields are used internally by the netif layer */
28 u_long dif_used;
31 struct netif_stats {
32 int collisions;
33 int collision_error;
34 int missed;
35 int sent;
36 int received;
37 int deferred;
38 int overflow;
41 struct netif {
42 struct netif_driver *nif_driver;
43 int nif_unit;
44 int nif_sel;
45 void *nif_devdata;
48 extern struct netif_driver *netif_drivers[]; /* machdep */
49 extern int n_netif_drivers;
51 extern int netif_debug;
53 void netif_init(void);
54 struct netif *netif_select(void *);
55 int netif_probe(struct netif *, void *);
56 void netif_attach(struct netif *, struct iodesc *, void *);
57 void netif_detach(struct netif *);
59 int netif_open(void *);
60 int netif_close(int);
62 #endif /* __SYS_LIBNETBOOT_NETIF_H */