xref: /titanic_44/usr/src/grub/grub-0.97/netboot/nic.h (revision 49b225e1cfa7bbf7738d4df0a03f18e3283426eb)
1  /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License as
4  * published by the Free Software Foundation; either version 2, or (at
5  * your option) any later version.
6  */
7 
8 #ifndef	NIC_H
9 #define NIC_H
10 
11 #include "dev.h"
12 
13 typedef enum {
14 	DISABLE = 0,
15 	ENABLE,
16 	FORCE
17 } irq_action_t;
18 
19 /*
20  *	Structure returned from eth_probe and passed to other driver
21  *	functions.
22  */
23 struct nic
24 {
25 	struct dev	dev;  /* This must come first */
26 	int		(*poll)P((struct nic *, int retrieve));
27 	void		(*transmit)P((struct nic *, const char *d,
28 				unsigned int t, unsigned int s, const char *p));
29 	void		(*irq)P((struct nic *, irq_action_t));
30 	int		flags;	/* driver specific flags */
31 	struct rom_info	*rom_info;	/* -> rom_info from main */
32 	unsigned char	*node_addr;
33 	unsigned char	*packet;
34 	unsigned int	packetlen;
35 	unsigned int	ioaddr;
36 	unsigned char	irqno;
37 	void		*priv_data;	/* driver can hang private data here */
38 };
39 
40 extern int  eth_probe(struct dev *dev);
41 extern int  eth_poll(int retrieve);
42 extern void eth_transmit(const char *d, unsigned int t, unsigned int s, const void *p);
43 extern void eth_disable(void);
44 extern void eth_irq(irq_action_t action);
45 #endif	/* NIC_H */
46