iPXE
Data Structures | Macros | Functions
eisa.h File Reference
#include <stdint.h>
#include <ipxe/isa_ids.h>
#include <ipxe/device.h>
#include <ipxe/tables.h>

Go to the source code of this file.

Data Structures

struct  eisa_device_id
 An EISA device ID list entry. More...
 
struct  eisa_device
 An EISA device. More...
 
struct  eisa_driver
 An EISA driver. More...
 

Macros

#define EISA_MIN_SLOT   (0x1)
 
#define EISA_MAX_SLOT   (0xf) /* Must be 2^n - 1 */
 
#define EISA_SLOT_BASE(n)   ( 0x1000 * (n) )
 
#define EISA_VENDOR_ID   ( 0xc80 )
 
#define EISA_PROD_ID   ( 0xc82 )
 
#define EISA_GLOBAL_CONFIG   ( 0xc84 )
 
#define EISA_CMD_RESET   ( 1 << 2 )
 
#define EISA_CMD_ENABLE   ( 1 << 0 )
 
#define EISA_DRIVERS   __table ( struct eisa_driver, "eisa_drivers" )
 EISA driver table. More...
 
#define __eisa_driver   __table_entry ( EISA_DRIVERS, 01 )
 Declare an EISA driver. More...
 

Functions

 FILE_LICENCE (GPL2_OR_LATER_OR_UBDL)
 
void eisa_device_enabled (struct eisa_device *eisa, int enabled)
 Reset and enable/disable an EISA device. More...
 
static void enable_eisa_device (struct eisa_device *eisa)
 Enable EISA device. More...
 
static void disable_eisa_device (struct eisa_device *eisa)
 Disable EISA device. More...
 
static void eisa_set_drvdata (struct eisa_device *eisa, void *priv)
 Set EISA driver-private data. More...
 
static void * eisa_get_drvdata (struct eisa_device *eisa)
 Get EISA driver-private data. More...
 

Macro Definition Documentation

◆ EISA_MIN_SLOT

#define EISA_MIN_SLOT   (0x1)

Definition at line 16 of file eisa.h.

◆ EISA_MAX_SLOT

#define EISA_MAX_SLOT   (0xf) /* Must be 2^n - 1 */

Definition at line 17 of file eisa.h.

◆ EISA_SLOT_BASE

#define EISA_SLOT_BASE (   n)    ( 0x1000 * (n) )

Definition at line 18 of file eisa.h.

◆ EISA_VENDOR_ID

#define EISA_VENDOR_ID   ( 0xc80 )

Definition at line 20 of file eisa.h.

◆ EISA_PROD_ID

#define EISA_PROD_ID   ( 0xc82 )

Definition at line 21 of file eisa.h.

◆ EISA_GLOBAL_CONFIG

#define EISA_GLOBAL_CONFIG   ( 0xc84 )

Definition at line 22 of file eisa.h.

◆ EISA_CMD_RESET

#define EISA_CMD_RESET   ( 1 << 2 )

Definition at line 24 of file eisa.h.

◆ EISA_CMD_ENABLE

#define EISA_CMD_ENABLE   ( 1 << 0 )

Definition at line 25 of file eisa.h.

◆ EISA_DRIVERS

#define EISA_DRIVERS   __table ( struct eisa_driver, "eisa_drivers" )

EISA driver table.

Definition at line 83 of file eisa.h.

◆ __eisa_driver

#define __eisa_driver   __table_entry ( EISA_DRIVERS, 01 )

Declare an EISA driver.

Definition at line 86 of file eisa.h.

Function Documentation

◆ FILE_LICENCE()

FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL  )

◆ eisa_device_enabled()

void eisa_device_enabled ( struct eisa_device eisa,
int  enabled 
)

Reset and enable/disable an EISA device.

Parameters
eisaEISA device
enabled1=enable, 0=disable

Definition at line 20 of file eisa.c.

20  {
21  /* Set reset line high for 1000 Ás. Spec says 500 Ás, but
22  * this doesn't work for all cards, so we are conservative.
23  */
25  udelay ( 1000 ); /* Must wait 800 */
26 
27  /* Set reset low and write a 1 to ENABLE. Delay again, in
28  * case the card takes a while to wake up.
29  */
30  outb ( enabled ? EISA_CMD_ENABLE : 0,
31  eisa->ioaddr + EISA_GLOBAL_CONFIG );
32  udelay ( 1000 ); /* Must wait 800 */
33 
34  DBG ( "EISA %s device %02x\n", ( enabled ? "enabled" : "disabled" ),
35  eisa->slot );
36 }
void udelay(unsigned long usecs)
Delay for a fixed number of microseconds.
Definition: timer.c:60
unsigned int slot
Slot number.
Definition: eisa.h:42
#define EISA_CMD_RESET
Definition: eisa.h:24
uint16_t ioaddr
I/O address.
Definition: eisa.h:44
#define outb(data, io_addr)
Definition: io.h:309
#define EISA_CMD_ENABLE
Definition: eisa.h:25
#define EISA_GLOBAL_CONFIG
Definition: eisa.h:22
#define DBG(...)
Print a debugging message.
Definition: compiler.h:498

References DBG, EISA_CMD_ENABLE, EISA_CMD_RESET, EISA_GLOBAL_CONFIG, eisa_device::ioaddr, outb, eisa_device::slot, and udelay().

Referenced by disable_eisa_device(), and enable_eisa_device().

◆ enable_eisa_device()

static void enable_eisa_device ( struct eisa_device eisa)
inlinestatic

Enable EISA device.

Parameters
eisaEISA device

Definition at line 95 of file eisa.h.

95  {
96  eisa_device_enabled ( eisa, 1 );
97 }
void eisa_device_enabled(struct eisa_device *eisa, int enabled)
Reset and enable/disable an EISA device.
Definition: eisa.c:20

References eisa_device_enabled().

Referenced by el3_eisa_probe().

◆ disable_eisa_device()

static void disable_eisa_device ( struct eisa_device eisa)
inlinestatic

Disable EISA device.

Parameters
eisaEISA device

Definition at line 104 of file eisa.h.

104  {
105  eisa_device_enabled ( eisa, 0 );
106 }
void eisa_device_enabled(struct eisa_device *eisa, int enabled)
Reset and enable/disable an EISA device.
Definition: eisa.c:20

References eisa_device_enabled().

Referenced by el3_eisa_disable().

◆ eisa_set_drvdata()

static void eisa_set_drvdata ( struct eisa_device eisa,
void *  priv 
)
inlinestatic

Set EISA driver-private data.

Parameters
eisaEISA device
privPrivate data

Definition at line 114 of file eisa.h.

114  {
115  eisa->priv = priv;
116 }
static struct tlan_private * priv
Definition: tlan.c:224
void * priv
Driver-private data.
Definition: eisa.h:56

References eisa_device::priv, and priv.

Referenced by legacy_eisa_set_drvdata().

◆ eisa_get_drvdata()

static void* eisa_get_drvdata ( struct eisa_device eisa)
inlinestatic

Get EISA driver-private data.

Parameters
eisaEISA device
Return values
privPrivate data

Definition at line 124 of file eisa.h.

124  {
125  return eisa->priv;
126 }
void * priv
Driver-private data.
Definition: eisa.h:56

References eisa_device::priv.

Referenced by legacy_eisa_get_drvdata().