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 | /*
|
---|
9 | * Sun GPL Disclaimer: For the avoidance of doubt, except that if any license choice
|
---|
10 | * other than GPL or LGPL is available it will apply instead, Sun elects to use only
|
---|
11 | * the General Public License version 2 (GPLv2) at this time for any software where
|
---|
12 | * a choice of GPL license versions is made available with the language indicating
|
---|
13 | * that GPLv2 or any later version may be used, or where a choice of which version
|
---|
14 | * of the GPL is applied is otherwise unspecified.
|
---|
15 | */
|
---|
16 |
|
---|
17 | #ifndef NIC_H
|
---|
18 | #define NIC_H
|
---|
19 |
|
---|
20 | #include "dev.h"
|
---|
21 |
|
---|
22 | typedef enum {
|
---|
23 | DISABLE = 0,
|
---|
24 | ENABLE,
|
---|
25 | FORCE
|
---|
26 | } irq_action_t;
|
---|
27 |
|
---|
28 | /*
|
---|
29 | * Structure returned from eth_probe and passed to other driver
|
---|
30 | * functions.
|
---|
31 | */
|
---|
32 | struct nic
|
---|
33 | {
|
---|
34 | struct dev dev; /* This must come first */
|
---|
35 | int (*poll)P((struct nic *, int retrieve));
|
---|
36 | void (*transmit)P((struct nic *, const char *d,
|
---|
37 | unsigned int t, unsigned int s, const char *p));
|
---|
38 | void (*irq)P((struct nic *, irq_action_t));
|
---|
39 | int flags; /* driver specific flags */
|
---|
40 | struct rom_info *rom_info; /* -> rom_info from main */
|
---|
41 | unsigned char *node_addr;
|
---|
42 | unsigned char *packet;
|
---|
43 | unsigned int packetlen;
|
---|
44 | unsigned int ioaddr;
|
---|
45 | unsigned char irqno;
|
---|
46 | void *priv_data; /* driver can hang private data here */
|
---|
47 | };
|
---|
48 |
|
---|
49 |
|
---|
50 | extern struct nic nic;
|
---|
51 | extern int eth_probe(struct dev *dev);
|
---|
52 | extern int eth_poll(int retrieve);
|
---|
53 | extern void eth_transmit(const char *d, unsigned int t, unsigned int s, const void *p);
|
---|
54 | extern void eth_disable(void);
|
---|
55 | extern void eth_irq(irq_action_t action);
|
---|
56 | extern int eth_load_configuration(struct dev *dev);
|
---|
57 | extern int eth_load(struct dev *dev);;
|
---|
58 | #endif /* NIC_H */
|
---|