]> rtime.felk.cvut.cz Git - l4.git/blob - l4/pkg/ankh/lib/netboot/dev.h
Inital import
[l4.git] / l4 / pkg / ankh / lib / netboot / dev.h
1 #ifndef _DEV_H
2 #define _DEV_H
3
4 #include "grub.h"
5 #include "isa.h"
6 #include "pci.h"
7
8 /* Need to check the packing of this struct if Etherboot is ported */
9 struct dev_id
10 {
11         unsigned short  vendor_id;
12         unsigned short  device_id;
13         unsigned char   bus_type;
14 #define PCI_BUS_TYPE    1
15 #define ISA_BUS_TYPE    2
16 };
17
18 /* Dont use sizeof, that will include the padding */
19 #define DEV_ID_SIZE     8
20
21
22 struct pci_probe_state 
23 {
24 #ifdef CONFIG_PCI
25         struct pci_device dev;
26         int advance;
27 #else
28         int dummy;
29 #endif
30 };
31 struct isa_probe_state
32 {
33 #ifdef CONFIG_ISA
34         const struct isa_driver *driver;
35         int advance;
36 #else
37         int dummy;
38 #endif
39 };
40
41 union probe_state
42 {
43         struct pci_probe_state pci;
44         struct isa_probe_state isa;
45 };
46
47 struct dev
48 {
49         void            (*disable)P((struct dev *));
50         struct dev_id   devid;  /* device ID string (sent to DHCP server) */
51         int             index;  /* Index of next device on this controller to probe */
52         int             type;           /* Type of device I am probing for */
53         int             how_probe;      /* First, next or awake */
54         int     to_probe;       /* Flavor of device I am probing */
55         int             failsafe;       /* Failsafe probe requested */
56         int             type_index;     /* Index of this device (within type) */
57         union probe_state state;
58 };
59
60 enum probe_type
61 {
62     PROBE_NONE = 1,
63     PROBE_PCI  = 2,
64     PROBE_ISA  = 3,
65     PROBE_ANKH = 4,
66 };
67
68
69 #define NIC_DRIVER    0
70 #define DISK_DRIVER   1
71 #define FLOPPY_DRIVER 2
72
73 #define BRIDGE_DRIVER 1000
74
75 #define PROBE_FIRST  (-1)
76 #define PROBE_NEXT   0
77 #define PROBE_AWAKE  1          /* After calling disable bring up the same device */
78
79 /* The probe result codes are selected
80  * to allow them to be fed back into the probe
81  * routine and get a successful probe.
82  */
83 #define PROBE_FAILED PROBE_FIRST
84 #define PROBE_WORKED  PROBE_NEXT
85
86 extern int probe(struct dev *dev);
87 extern void disable(struct dev *dev);
88
89 #endif /* _DEV_H */