This service registers a single-function adapter slot on a PCI/PCI-E bus for EEH function.
#include <sys/eeh.h>
eeh_handle_t eeh_init(pbid, slot, flag)
long pbid;
long slot;
long flag;
Item | Description |
---|---|
pbid | AIX® parent bus identifier |
slot | device slot (device*8+function). This is same as "connwhere" property in CuDv. |
flag | flag that enables eeh |
The pbid argument identifies a bus type and number. The bus type is IO_PCI in the case of PCI and PCI-X bus. If the bus type is IO_PCIE, the device is on PCI-E (PCI Express) bus. The bus number is a unique identifier determined during bus configuration. The BID_VAL macro defined in ioacc.h is used to generate the bid. The slot argument is the device/function combination ((device*8) + function) as in the PCI addressing scheme. The flag argument of EEH_ENABLE enables the slot. The flag argument of EEH_DISABLE does not enable the slot but still allocates an EEH handle. This service should be called only by the single-function adapter drivers.
The macro EEH_INIT(pbid, slot, flag) is provided for the device drivers to call this service. The eeh_handle is defined as follows in <sys/eeh.h>:
/*
* This is the eeh_handle structure for the eeh_* services
*/
typedef struct eeh_handle * eeh_handle_t;
struct eeh_handle {
struct eeh_handle *next;
long bid; /* bus id passed to eeh_init */
long slot; /* slot passed to eeh_init */
long flag; /* flag passed to eeh_init */
int config_addr; /* Configuration Space Address */
int eeh_mode; /* Indicates safe mode */
uint retry_delay; /* re-read the slot state after *
* these many seconds. */
int reserved1;
int reserved2;
int reserved3;
long long PHB_Unit_ID; /* /pci@ */
void (*eeh_clear)(eeh_handle_t);
long (*eeh_enable_pio)(eeh_handle_t);
long (*eeh_enable_dma)(eeh_handle_t);
long (*eeh_reset_slot)(eeh_handle_t, int);
long (*eeh_enable_slot)(eeh_handle_t);
long (*eeh_disable_slot)(eeh_handle_t);
long (*eeh_read_slot_state)(eeh_handle_t, long *, long *);
long (*eeh_slot_error)(eeh_handle_t, int, char *, long);
struct eeh_shared_domain *parent_sd; /* point back to the parent
* shared domain structure if
* in shared domain, NULL if singlefunc.
*/
void (*eeh_configure_bridge)(eeh_handle_t);
void (*eeh_broadcast)(eeh_handle_t, unsigned long long);
};
This is an exported kernel service.
This service can only be called from the process environment.
Item | Description |
---|---|
EEH_FAIL | Unable to allocate EEH handle. |
EEH_NO_SUPPORT | EEH not supported on this system, no handle allocated. |
struct eeh_handle * | If successful. |