Rename gpxe to .
[grub-extras.git] / src / include / gpxe / isa.h
blob63027a5a48b06ea92ae71df475564083cdf5a35b
1 #ifndef ISA_H
2 #define ISA_H
4 FILE_LICENCE ( GPL2_OR_LATER );
6 #include <stdint.h>
7 #include <gpxe/isa_ids.h>
8 #include <gpxe/device.h>
9 #include <gpxe/tables.h>
11 /** An ISA device */
12 struct isa_device {
13 /** Generic device */
14 struct device dev;
15 /** I/O address */
16 uint16_t ioaddr;
17 /** Driver for this device */
18 struct isa_driver *driver;
19 /** Driver-private data
21 * Use isa_set_drvdata() and isa_get_drvdata() to access
22 * this field.
24 void *priv;
25 /** Driver name */
26 const char *driver_name;
30 * An individual ISA device, identified by probe address
33 typedef uint16_t isa_probe_addr_t;
35 /** An ISA driver */
36 struct isa_driver {
37 /** Name */
38 const char *name;
39 /** Probe address list */
40 isa_probe_addr_t *probe_addrs;
41 /** Number of entries in probe address list */
42 unsigned int addr_count;
43 /** Manufacturer ID to be assumed for this device */
44 uint16_t vendor_id;
45 /** Product ID to be assumed for this device */
46 uint16_t prod_id;
47 /**
48 * Probe device
50 * @v isa ISA device
51 * @v id Matching entry in ID table
52 * @ret rc Return status code
54 int ( * probe ) ( struct isa_device *isa );
55 /**
56 * Remove device
58 * @v isa ISA device
60 void ( * remove ) ( struct isa_device *isa );
63 /** ISA driver table */
64 #define ISA_DRIVERS __table ( struct isa_driver, "isa_drivers" )
66 /** Declare an ISA driver */
67 #define __isa_driver __table_entry ( ISA_DRIVERS, 01 )
69 /**
70 * Set ISA driver-private data
72 * @v isa ISA device
73 * @v priv Private data
75 static inline void isa_set_drvdata ( struct isa_device *isa, void *priv ) {
76 isa->priv = priv;
79 /**
80 * Get ISA driver-private data
82 * @v isa ISA device
83 * @ret priv Private data
85 static inline void * isa_get_drvdata ( struct isa_device *isa ) {
86 return isa->priv;
90 * ISA_ROM is parsed by parserom.pl to generate Makefile rules and
91 * files for rom-o-matic.
94 #define ISA_ROM( IMAGE, DESCRIPTION )
96 #endif /* ISA_H */