Home | History | Annotate | Line # | Download | only in libsa
netif.h revision 1.5
      1 /*	$NetBSD: netif.h,v 1.5 2003/03/12 14:49:19 drochner Exp $	*/
      2 
      3 #ifndef __SYS_LIBNETBOOT_NETIF_H
      4 #define __SYS_LIBNETBOOT_NETIF_H
      5 
      6 #include "iodesc.h"
      7 
      8 struct netif; /* forward */
      9 
     10 struct netif_driver {
     11 	char	*netif_bname;
     12 	int	(*netif_match) __P((struct netif *, void *));
     13 	int	(*netif_probe) __P((struct netif *, void *));
     14 	void	(*netif_init) __P((struct iodesc *, void *));
     15 	int	(*netif_get) __P((struct iodesc *, void *, size_t, time_t));
     16 	int	(*netif_put) __P((struct iodesc *, void *, size_t));
     17 	void	(*netif_end) __P((struct netif *));
     18 	struct	netif_dif *netif_ifs;
     19 	int	netif_nifs;
     20 };
     21 
     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;
     29 };
     30 
     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;
     39 };
     40 
     41 struct netif {
     42 	struct netif_driver	*nif_driver;
     43 	int			nif_unit;
     44 	int			nif_sel;
     45 	void			*nif_devdata;
     46 };
     47 
     48 extern struct netif_driver	*netif_drivers[];	/* machdep */
     49 extern int			n_netif_drivers;
     50 
     51 extern int			netif_debug;
     52 
     53 void		netif_init __P((void));
     54 struct netif	*netif_select __P((void *));
     55 int		netif_probe __P((struct netif *, void *));
     56 void		netif_attach __P((struct netif *, struct iodesc *, void *));
     57 void		netif_detach __P((struct netif *));
     58 
     59 int		netif_open __P((void *));
     60 int		netif_close __P((int));
     61 
     62 #endif /* __SYS_LIBNETBOOT_NETIF_H */
     63