[tcp] Allow out-of-order receive queue to be discarded
[gpxe.git] / src / arch / i386 / include / undi.h
blobde6925b672e2eb65c4047700a5d3d669de20ceb4
1 #ifndef _UNDI_H
2 #define _UNDI_H
4 /** @file
6 * UNDI driver
8 */
10 FILE_LICENCE ( GPL2_OR_LATER );
12 #ifndef ASSEMBLY
14 #include <gpxe/device.h>
15 #include <pxe_types.h>
17 /** An UNDI device
19 * This structure is used by assembly code as well as C; do not alter
20 * this structure without editing pxeprefix.S to match.
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 */
30 UINT16_t fbms;
31 /** Free base memory prior to load */
32 UINT16_t restore_fbms;
33 /** PCI bus:dev.fn, or @c UNDI_NO_PCI_BUSDEVFN */
34 UINT16_t pci_busdevfn;
35 /** ISAPnP card select number, or @c UNDI_NO_ISAPNP_CSN */
36 UINT16_t isapnp_csn;
37 /** ISAPnP read port, or @c UNDI_NO_ISAPNP_READ_PORT */
38 UINT16_t isapnp_read_port;
39 /** PCI vendor ID
41 * Filled in only for the preloaded UNDI device by pxeprefix.S
43 UINT16_t pci_vendor;
44 /** PCI device ID
46 * Filled in only for the preloaded UNDI device by pxeprefix.S
48 UINT16_t pci_device;
49 /** Flags
51 * This is the bitwise OR of zero or more UNDI_FL_XXX
52 * constants.
54 UINT16_t flags;
56 /** Generic device */
57 struct device dev;
58 /** Driver-private data
60 * Use undi_set_drvdata() and undi_get_drvdata() to access this
61 * field.
63 void *priv;
64 } __attribute__ (( packed ));
66 /**
67 * Set UNDI driver-private data
69 * @v undi UNDI device
70 * @v priv Private data
72 static inline void undi_set_drvdata ( struct undi_device *undi, void *priv ) {
73 undi->priv = priv;
76 /**
77 * Get UNDI driver-private data
79 * @v undi UNDI device
80 * @ret priv Private data
82 static inline void * undi_get_drvdata ( struct undi_device *undi ) {
83 return undi->priv;
86 #endif /* ASSEMBLY */
88 /** PCI bus:dev.fn field is invalid */
89 #define UNDI_NO_PCI_BUSDEVFN 0xffff
91 /** ISAPnP card select number field is invalid */
92 #define UNDI_NO_ISAPNP_CSN 0xffff
94 /** ISAPnP read port field is invalid */
95 #define UNDI_NO_ISAPNP_READ_PORT 0xffff
97 /** UNDI flag: START_UNDI has been called */
98 #define UNDI_FL_STARTED 0x0001
100 /** UNDI flag: UNDI_STARTUP and UNDI_INITIALIZE have been called */
101 #define UNDI_FL_INITIALIZED 0x0002
103 /** UNDI flag: keep stack resident */
104 #define UNDI_FL_KEEP_ALL 0x0004
106 #endif /* _UNDI_H */