Plx使用手册学习----12 PlxPci_NotificationCancel

本文详细介绍了PLXPCI设备中使用的PlxPci_NotificationCancel函数,该函数用于取消之前通过PlxPci_NotificationRegisterFor注册的通知对象。文章提供了函数的语法、参数说明、返回代码及使用示例,帮助开发者理解并正确使用此API。

Syntax:

PLX_STATUS
PlxPci_NotificationCancel(
PLX_DEVICE_OBJECT *pDevice,
PLX_NOTIFY_OBJECT *pEvent
);

PLX Chip Support:
All PLX 9000 devices, 8311, 8000 DMA, 6000 NT, & 8000 NT
Description:

取消以前在plxpci_notificationregisterfor中注册的通知对象。
Cancels a notification object previously registered with PlxPci_NotificationRegisterFor.
Parameters:
pDevice
Pointer to an open device
pEvent
A pointer to a PLX notification object previously registered with PlxPci_NotificationRegisterFor.
Return Codes:

CodeDescription
ApiSuccessThe function returned successfully
ApiNullParamOne or more parameters is NULL
ApiInvalidDeviceInfoThe device object is not a valid PLX device or has not been opened
ApiInvalidHandleThe PLX driver was unable to reference the event handle
ApiInsufficientResourcesInsufficient resources to create the notification object
ApiFailedThe notification object is not valid or not registered

Usage:

PLX_INTERRUPT IntSources;
PLX_STATUS rc;
PLX_NOTIFY_OBJECT Event;
// Clear interrupt sources
memset(&IntSources, 0, sizeof(PLX_INTERRUPT));5-80
// Register for interrupt notification
IntSources.Doorbell = (1 << 16) | 0xF; // Doorbells 16, & 0-3
IntSources.Message_0 = 1;
IntSources.ResetDeassert = 1;
IntSources.PmeDeassert = 1;
IntSources.GPIO_4_5 = 1;
IntSources.GPIO_14_15 = 1;
rc =
PlxPci_NotificationRegisterFor(
pDevice,
&IntSources,
&Event
);
if (rc != ApiSuccess)
{
// ERROR – Unable to register interrupt notification
}
// Wait for the interrupt
rc =
PlxPci_NotificationWait(
pDevice,
&Event,
10 * 1000 // 10 second timeout
);
switch (rc)
{
case ApiSuccess:
// Interrupt occurred
break;
case ApiWaitTimeout:
// ERROR - Timeout waiting for Interrupt Event
break;
case ApiWaitCanceled:
// ERROR – Event not registered for wait
break;
}
// Cancel interrupt notification
rc =
PlxPci_NotificationCancel(
pDevice,
&Event
);
if (rc != ApiSuccess)
{
// ERROR – Unable to cancel interrupt notification
}

 

评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值