2007-01-08 02:24:53 +00:00
|
|
|
#ifndef _UNDI_H
|
|
|
|
|
#define _UNDI_H
|
|
|
|
|
|
|
|
|
|
/** @file
|
|
|
|
|
*
|
|
|
|
|
* UNDI driver
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
|
2007-01-08 03:03:42 +00:00
|
|
|
#include <gpxe/device.h>
|
|
|
|
|
#include <pxe_types.h>
|
|
|
|
|
|
2007-01-09 01:41:26 +00:00
|
|
|
/** An UNDI device
|
|
|
|
|
*
|
|
|
|
|
* This structure is used by assembly code as well as C; do not alter
|
|
|
|
|
* this structure without editing pxeprefix.S to match.
|
|
|
|
|
*/
|
2007-01-08 02:24:53 +00:00
|
|
|
struct undi_device {
|
2007-01-09 01:41:26 +00:00
|
|
|
/** PXENV+ structure address */
|
|
|
|
|
SEGOFF16_t pxenv;
|
|
|
|
|
/** !PXE structure address */
|
|
|
|
|
SEGOFF16_t ppxe;
|
|
|
|
|
/** Entry point */
|
|
|
|
|
SEGOFF16_t entry;
|
|
|
|
|
/** Free base memory after load */
|
|
|
|
|
UINT16_t fbms;
|
|
|
|
|
/** Free base memory prior to load */
|
|
|
|
|
UINT16_t restore_fbms;
|
2007-01-10 15:27:48 +00:00
|
|
|
/** PCI bus:dev.fn, or @c UNDI_NO_PCI_BUSDEVFN */
|
2007-01-09 01:41:26 +00:00
|
|
|
UINT16_t pci_busdevfn;
|
2007-01-10 15:27:48 +00:00
|
|
|
/** ISAPnP card select number, or @c UNDI_NO_ISAPNP_CSN */
|
2007-01-09 01:41:26 +00:00
|
|
|
UINT16_t isapnp_csn;
|
2007-01-10 15:27:48 +00:00
|
|
|
/** ISAPnP read port, or @c UNDI_NO_ISAPNP_READ_PORT */
|
2007-01-09 01:41:26 +00:00
|
|
|
UINT16_t isapnp_read_port;
|
2007-01-10 15:27:48 +00:00
|
|
|
/** PCI vendor ID
|
|
|
|
|
*
|
|
|
|
|
* Filled in only for the preloaded UNDI device by pxeprefix.S
|
|
|
|
|
*/
|
|
|
|
|
UINT16_t pci_vendor;
|
|
|
|
|
/** PCI device ID
|
|
|
|
|
*
|
|
|
|
|
* Filled in only for the preloaded UNDI device by pxeprefix.S
|
|
|
|
|
*/
|
|
|
|
|
UINT16_t pci_device;
|
2007-01-09 01:41:26 +00:00
|
|
|
/** Padding */
|
|
|
|
|
UINT16_t pad;
|
|
|
|
|
|
2007-01-08 02:24:53 +00:00
|
|
|
/** Generic device */
|
|
|
|
|
struct device dev;
|
|
|
|
|
/** Driver-private data
|
|
|
|
|
*
|
|
|
|
|
* Use undi_set_drvdata() and undi_get_drvdata() to access this
|
|
|
|
|
* field.
|
|
|
|
|
*/
|
|
|
|
|
void *priv;
|
2007-01-09 01:41:26 +00:00
|
|
|
} __attribute__ (( packed ));
|
2007-01-08 02:24:53 +00:00
|
|
|
|
2007-01-10 15:27:48 +00:00
|
|
|
/** PCI bus:dev.fn field is invalid */
|
|
|
|
|
#define UNDI_NO_PCI_BUSDEVFN 0xffff
|
|
|
|
|
|
|
|
|
|
/** ISAPnP card select number field is invalid */
|
|
|
|
|
#define UNDI_NO_ISAPNP_CSN 0xffff
|
|
|
|
|
|
|
|
|
|
/** ISAPnP read port field is invalid */
|
|
|
|
|
#define UNDI_NO_ISAPNP_READ_PORT 0xffff
|
|
|
|
|
|
2007-01-08 02:24:53 +00:00
|
|
|
/**
|
|
|
|
|
* Set UNDI driver-private data
|
|
|
|
|
*
|
|
|
|
|
* @v undi UNDI device
|
|
|
|
|
* @v priv Private data
|
|
|
|
|
*/
|
|
|
|
|
static inline void undi_set_drvdata ( struct undi_device *undi, void *priv ) {
|
|
|
|
|
undi->priv = priv;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Get UNDI driver-private data
|
|
|
|
|
*
|
|
|
|
|
* @v undi UNDI device
|
|
|
|
|
* @ret priv Private data
|
|
|
|
|
*/
|
|
|
|
|
static inline void * undi_get_drvdata ( struct undi_device *undi ) {
|
|
|
|
|
return undi->priv;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endif /* _UNDI_H */
|