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 |
|
---|
41 | extern struct nic nic;
|
---|
42 | extern int eth_probe(struct dev *dev);
|
---|
43 | extern int eth_poll(int retrieve);
|
---|
44 | extern void eth_transmit(const char *d, unsigned int t, unsigned int s, const void *p);
|
---|
45 | extern void eth_disable(void);
|
---|
46 | extern void eth_irq(irq_action_t action);
|
---|
47 | extern int eth_load_configuration(struct dev *dev);
|
---|
48 | extern int eth_load(struct dev *dev);;
|
---|
49 | #endif /* NIC_H */
|
---|