iPXE
undi.h
Go to the documentation of this file.
1 #ifndef _UNDI_H
2 #define _UNDI_H
3 
4 /** @file
5  *
6  * UNDI driver
7  *
8  */
9 
10 FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
11 
12 #ifndef ASSEMBLY
13 
14 #include <ipxe/device.h>
15 #include <pxe_types.h>
16 
17 /** An UNDI device
18  *
19  * This structure is used by assembly code as well as C; do not alter
20  * this structure without editing pxeprefix.S to match.
21  */
22 struct undi_device {
23  /** PXENV+ structure address */
24  SEGOFF16_t pxenv;
25  /** !PXE structure address */
26  SEGOFF16_t ppxe;
27  /** Entry point */
28  SEGOFF16_t entry;
29  /** Free base memory after load */
31  /** Free base memory prior to load */
33  /** PCI bus:dev.fn, or @c UNDI_NO_PCI_BUSDEVFN */
35  /** ISAPnP card select number, or @c UNDI_NO_ISAPNP_CSN */
37  /** ISAPnP read port, or @c UNDI_NO_ISAPNP_READ_PORT */
39  /** PCI vendor ID
40  *
41  * Filled in only for the preloaded UNDI device by pxeprefix.S
42  */
44  /** PCI device ID
45  *
46  * Filled in only for the preloaded UNDI device by pxeprefix.S
47  */
49  /** Flags
50  *
51  * This is the bitwise OR of zero or more UNDI_FL_XXX
52  * constants.
53  */
55 
56  /** Driver-private data
57  *
58  * Use undi_set_drvdata() and undi_get_drvdata() to access this
59  * field.
60  */
61  void *priv;
62 } __attribute__ (( packed ));
63 
64 /**
65  * Set UNDI driver-private data
66  *
67  * @v undi UNDI device
68  * @v priv Private data
69  */
70 static inline void undi_set_drvdata ( struct undi_device *undi, void *priv ) {
71  undi->priv = priv;
72 }
73 
74 /**
75  * Get UNDI driver-private data
76  *
77  * @v undi UNDI device
78  * @ret priv Private data
79  */
80 static inline void * undi_get_drvdata ( struct undi_device *undi ) {
81  return undi->priv;
82 }
83 
84 #endif /* ASSEMBLY */
85 
86 /** PCI bus:dev.fn field is invalid */
87 #define UNDI_NO_PCI_BUSDEVFN 0xffff
88 
89 /** ISAPnP card select number field is invalid */
90 #define UNDI_NO_ISAPNP_CSN 0xffff
91 
92 /** ISAPnP read port field is invalid */
93 #define UNDI_NO_ISAPNP_READ_PORT 0xffff
94 
95 /** UNDI flag: START_UNDI has been called */
96 #define UNDI_FL_STARTED 0x0001
97 
98 /** UNDI flag: UNDI_STARTUP and UNDI_INITIALIZE have been called */
99 #define UNDI_FL_INITIALIZED 0x0002
100 
101 /** UNDI flag: keep stack resident */
102 #define UNDI_FL_KEEP_ALL 0x0004
103 
104 #endif /* _UNDI_H */
UINT16_t restore_fbms
Free base memory prior to load.
Definition: undi.h:32
FILE_LICENCE(GPL2_OR_LATER_OR_UBDL)
UINT16_t flags
Flags.
Definition: undi.h:54
SEGOFF16_t ppxe
!PXE structure address
Definition: undi.h:26
static void * undi_get_drvdata(struct undi_device *undi)
Get UNDI driver-private data.
Definition: undi.h:80
SEGOFF16_t pxenv
PXENV+ structure address.
Definition: undi.h:24
UINT16_t isapnp_csn
ISAPnP card select number, or UNDI_NO_ISAPNP_CSN.
Definition: undi.h:36
void * priv
Driver-private data.
Definition: undi.h:61
SEGOFF16_t entry
Entry point.
Definition: undi.h:28
UINT16_t pci_device
PCI device ID.
Definition: undi.h:48
UINT16_t pci_vendor
PCI vendor ID.
Definition: undi.h:43
UINT16_t isapnp_read_port
ISAPnP read port, or UNDI_NO_ISAPNP_READ_PORT.
Definition: undi.h:38
UINT16_t fbms
Free base memory after load.
Definition: undi.h:30
An UNDI device.
Definition: undi.h:22
UINT16_t pci_busdevfn
PCI bus:dev.fn, or UNDI_NO_PCI_BUSDEVFN.
Definition: undi.h:34
static struct tlan_private * priv
Definition: tlan.c:224
uint16_t UINT16_t
A 16-bit unsigned integer.
Definition: pxe_types.h:34
PXE data types.
Device model.
static void undi_set_drvdata(struct undi_device *undi, void *priv)
Set UNDI driver-private data.
Definition: undi.h:70
struct undi_device __attribute__