iPXE
Data Structures | Defines | 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...

Defines

#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.
#define __eisa_driver   __table_entry ( EISA_DRIVERS, 01 )
 Declare an EISA driver.

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.
static void enable_eisa_device (struct eisa_device *eisa)
 Enable EISA device.
static void disable_eisa_device (struct eisa_device *eisa)
 Disable EISA device.
static void eisa_set_drvdata (struct eisa_device *eisa, void *priv)
 Set EISA driver-private data.
static void * eisa_get_drvdata (struct eisa_device *eisa)
 Get EISA driver-private data.

Define Documentation

#define EISA_MIN_SLOT   (0x1)

Definition at line 16 of file eisa.h.

Referenced by eisabus_probe().

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

Definition at line 17 of file eisa.h.

Referenced by eisabus_probe().

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

Definition at line 18 of file eisa.h.

Referenced by eisabus_probe().

#define EISA_VENDOR_ID   ( 0xc80 )

Definition at line 20 of file eisa.h.

Referenced by eisabus_probe().

#define EISA_PROD_ID   ( 0xc82 )

Definition at line 21 of file eisa.h.

Referenced by eisabus_probe().

#define EISA_GLOBAL_CONFIG   ( 0xc84 )

Definition at line 22 of file eisa.h.

Referenced by eisa_device_enabled().

#define EISA_CMD_RESET   ( 1 << 2 )

Definition at line 24 of file eisa.h.

Referenced by eisa_device_enabled().

#define EISA_CMD_ENABLE   ( 1 << 0 )

Definition at line 25 of file eisa.h.

Referenced by eisa_device_enabled().

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

EISA driver table.

Definition at line 83 of file eisa.h.

Referenced by eisa_probe().

Declare an EISA driver.

Definition at line 86 of file eisa.h.


Function Documentation

FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL  )
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.

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().

                                                                   {
        /* Set reset line high for 1000 Ás.  Spec says 500 Ás, but
         * this doesn't work for all cards, so we are conservative.
         */
        outb ( EISA_CMD_RESET, eisa->ioaddr + EISA_GLOBAL_CONFIG );
        udelay ( 1000 ); /* Must wait 800 */

        /* Set reset low and write a 1 to ENABLE.  Delay again, in
         * case the card takes a while to wake up.
         */
        outb ( enabled ? EISA_CMD_ENABLE : 0,
               eisa->ioaddr + EISA_GLOBAL_CONFIG );
        udelay ( 1000 ); /* Must wait 800 */

        DBG ( "EISA %s device %02x\n", ( enabled ? "enabled" : "disabled" ),
              eisa->slot );
}
static void enable_eisa_device ( struct eisa_device eisa) [inline, static]

Enable EISA device.

Parameters:
eisaEISA device

Definition at line 95 of file eisa.h.

References eisa_device_enabled().

Referenced by el3_eisa_probe().

                                                                   {
        eisa_device_enabled ( eisa, 1 );
}
static void disable_eisa_device ( struct eisa_device eisa) [inline, static]

Disable EISA device.

Parameters:
eisaEISA device

Definition at line 104 of file eisa.h.

References eisa_device_enabled().

Referenced by el3_eisa_disable().

                                                                    {
        eisa_device_enabled ( eisa, 0 );
}
static void eisa_set_drvdata ( struct eisa_device eisa,
void *  priv 
) [inline, static]

Set EISA driver-private data.

Parameters:
eisaEISA device
privPrivate data

Definition at line 114 of file eisa.h.

References eisa_device::priv, and priv.

                                                                             {
        eisa->priv = priv;
}
static void* eisa_get_drvdata ( struct eisa_device eisa) [inline, static]

Get EISA driver-private data.

Parameters:
eisaEISA device
Return values:
privPrivate data

Definition at line 124 of file eisa.h.

References eisa_device::priv.

                                                                   {
        return eisa->priv;
}