eeh_init 内核服务
用途
此服务在用于 EEH 功能的 PCI/PCI-E 总线上注册单功能适配器插槽。
语法
#include <sys/eeh.h>
eeh_handle_t eeh_init(pbid, slot, flag)
long pbid;
long slot;
long flag;
参数
| 项 | 描述 |
|---|---|
| 普比德 | AIX®父总线标识符 |
| 插槽 (slot) | 设备插槽 (device*8+function)。 这与 CuDv中的 "connwhere" 属性相同。 |
| 标记 | 启用 eeh 的标志 |
描述
普比德 参数用于标识总线类型和编号。 在 PCI 和 PCI-X 总线的情况下,总线类型为 IO_PCI。 如果总线类型为 IO_PCIE ,那么设备位于 PCI-E (PCI Express) 总线上。 总线号是在总线配置期间确定的唯一标识。 ioacc.h 中定义的 BID_VAL 宏用于生成 投标。 slot 自变量是设备/功能组合 ((device*8) + 功能) ,如 PCI 寻址方案中一样。 EEH_ENABLE 的 旗 参数用于启用插槽。 EEH_DISABLE 的 旗 自变量未启用插槽,但仍分配 EEH 句柄。 此服务应仅由单功能适配器驱动程序调用。
为设备驱动程序提供了宏 EEH_INIT(普比德, 槽, 旗) 以调用该服务。 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);
};
这是导出的内核服务。
执行环境
只能从进程环境中调用此服务。
返回值
| 项 | 描述 |
|---|---|
| EHEH_FAIL | 无法分配 EEH 句柄。 |
| EEH_NO_SUPPORT | EEH 在此系统上不受支持,未分配任何句柄。 |
| struct eeh_handle * | 如果成功。 |