Пример #1
0
/*
 *  ======== WMD_MSG_RegisterNotify ========
 */
DSP_STATUS WMD_MSG_RegisterNotify(struct MSG_QUEUE *hMsgQueue, u32 uEventMask,
                                  u32 uNotifyType,
                                  struct DSP_NOTIFICATION *hNotification)
{
    DSP_STATUS status = DSP_SOK;

    if (!MEM_IsValidHandle(hMsgQueue, MSGQ_SIGNATURE) || !hNotification) {
        status = DSP_EMEMORY;
        goto func_end;
    }
    if (!(uEventMask == DSP_NODEMESSAGEREADY || uEventMask == 0)) {
        status = DSP_ENODETYPE;
        goto func_end;
    }
    if (uNotifyType != DSP_SIGNALEVENT) {
        status = DSP_EWRONGSTATE;
        goto func_end;
    }
    status = NTFY_Register(hMsgQueue->hNtfy, hNotification, uEventMask,
                           uNotifyType);
    if (status == DSP_EVALUE) {
        /*  Not registered. Ok, since we couldn't have known. Node
         *  notifications are split between node state change handled
         *  by NODE, and message ready handled by MSG.  */
        status = DSP_SOK;
    }
func_end:
    return status;
}
Пример #2
0
/*
 *  ======== WMD_CHNL_RegisterNotify ========
 *      Registers for events on a particular channel.
 */
DSP_STATUS WMD_CHNL_RegisterNotify(struct CHNL_OBJECT *hChnl, u32 uEventMask,
				  u32 uNotifyType,
				  struct DSP_NOTIFICATION *hNotification)
{
	DSP_STATUS status = DSP_SOK;

	DBC_Assert(!(uEventMask & ~(DSP_STREAMDONE | DSP_STREAMIOCOMPLETION)));

	status = NTFY_Register(hChnl->hNtfy, hNotification, uEventMask,
			      uNotifyType);

	return status;
}
Пример #3
0
/*
 *  ======== WMD_DEH_RegisterNotify ========
 *      Registers for DEH notifications.
 */
DSP_STATUS WMD_DEH_RegisterNotify(struct DEH_MGR *hDehMgr, u32 uEventMask,
				 u32 uNotifyType,
				 struct DSP_NOTIFICATION *hNotification)
{
	DSP_STATUS status = DSP_SOK;
	struct DEH_MGR *pDehMgr = (struct DEH_MGR *)hDehMgr;

	if (MEM_IsValidHandle(pDehMgr, SIGNATURE)) {
		status = NTFY_Register(pDehMgr->hNtfy, hNotification,
			 uEventMask, uNotifyType);
	}

	return status;
}
Пример #4
0
/*
 *  ======== WMD_MSG_RegisterNotify ========
 */
DSP_STATUS WMD_MSG_RegisterNotify(struct MSG_QUEUE *hMsgQueue, u32 uEventMask,
				  u32 uNotifyType,
				  struct DSP_NOTIFICATION *hNotification)
{
	DSP_STATUS status = DSP_SOK;

	DBC_Require(MEM_IsValidHandle(hMsgQueue, MSGQ_SIGNATURE));
	DBC_Require(hNotification != NULL);
	DBC_Require(uEventMask == DSP_NODEMESSAGEREADY || uEventMask == 0);
	DBC_Require(uNotifyType == DSP_SIGNALEVENT);

	status = NTFY_Register(hMsgQueue->hNtfy, hNotification, uEventMask,
			      uNotifyType);

	if (status == DSP_EVALUE) {
		/*  Not registered. Ok, since we couldn't have known. Node
		 *  notifications are split between node state change handled
		 *  by NODE, and message ready handled by MSG.  */
		status = DSP_SOK;
	}

	return status;
}