dp: rx: mst: Added interrupt handlers.
1) Down request for MST sideband messages TX to RX. 2) Down reply for MST sideband messages from RX to TX. Signed-off-by: Andrei-Liviu Simion <andrei.simion@xilinx.com>
This commit is contained in:
parent
8bbd926b0b
commit
40a6c28bcf
2 changed files with 78 additions and 0 deletions
|
@ -762,6 +762,18 @@ typedef struct {
|
|||
passed to the training
|
||||
pattern 3 callback
|
||||
function. */
|
||||
XDp_IntrHandler IntrDownReqHandler; /**< Callback function for down
|
||||
request interrupts. */
|
||||
void *IntrDownReqCallbackRef; /**< A pointer to the user data
|
||||
passed to the down
|
||||
request callback
|
||||
function. */
|
||||
XDp_IntrHandler IntrDownReplyHandler; /**< Callback function for down
|
||||
reply interrupts. */
|
||||
void *IntrDownReplyCallbackRef; /**< A pointer to the user data
|
||||
passed to the down
|
||||
reply callback
|
||||
function. */
|
||||
} XDp_Rx;
|
||||
|
||||
/**
|
||||
|
@ -894,6 +906,10 @@ void XDp_RxSetIntrTp2Handler(XDp *InstancePtr,
|
|||
XDp_IntrHandler CallbackFunc, void *CallbackRef);
|
||||
void XDp_RxSetIntrTp3Handler(XDp *InstancePtr,
|
||||
XDp_IntrHandler CallbackFunc, void *CallbackRef);
|
||||
void XDp_RxSetIntrDownReqHandler(XDp *InstancePtr,
|
||||
XDp_IntrHandler CallbackFunc, void *CallbackRef);
|
||||
void XDp_RxSetIntrDownReplyHandler(XDp *InstancePtr,
|
||||
XDp_IntrHandler CallbackFunc, void *CallbackRef);
|
||||
|
||||
/* xdp_mst.c: Multi-stream transport (MST) functions for enabling or disabling
|
||||
* MST mode. */
|
||||
|
|
|
@ -592,6 +592,62 @@ void XDp_RxSetIntrTp3Handler(XDp *InstancePtr,
|
|||
InstancePtr->RxInstance.IntrTp3CallbackRef = CallbackRef;
|
||||
}
|
||||
|
||||
/******************************************************************************/
|
||||
/**
|
||||
* This function installs a callback function for when a down request interrupt
|
||||
* occurs.
|
||||
*
|
||||
* @param InstancePtr is a pointer to the XDp instance.
|
||||
* @param CallbackFunc is the address to the callback function.
|
||||
* @param CallbackRef is the user data item that will be passed to the
|
||||
* callback function when it is invoked.
|
||||
*
|
||||
* @return None.
|
||||
*
|
||||
* @note None.
|
||||
*
|
||||
*******************************************************************************/
|
||||
void XDp_RxSetIntrDownReqHandler(XDp *InstancePtr,
|
||||
XDp_IntrHandler CallbackFunc, void *CallbackRef)
|
||||
{
|
||||
/* Verify arguments. */
|
||||
Xil_AssertVoid(InstancePtr != NULL);
|
||||
Xil_AssertVoid(XDp_GetCoreType(InstancePtr) == XDP_RX);
|
||||
Xil_AssertVoid(CallbackFunc != NULL);
|
||||
Xil_AssertVoid(CallbackRef != NULL);
|
||||
|
||||
InstancePtr->RxInstance.IntrDownReqHandler = CallbackFunc;
|
||||
InstancePtr->RxInstance.IntrDownReqCallbackRef = CallbackRef;
|
||||
}
|
||||
|
||||
/******************************************************************************/
|
||||
/**
|
||||
* This function installs a callback function for when a down reply interrupt
|
||||
* occurs.
|
||||
*
|
||||
* @param InstancePtr is a pointer to the XDp instance.
|
||||
* @param CallbackFunc is the address to the callback function.
|
||||
* @param CallbackRef is the user data item that will be passed to the
|
||||
* callback function when it is invoked.
|
||||
*
|
||||
* @return None.
|
||||
*
|
||||
* @note None.
|
||||
*
|
||||
*******************************************************************************/
|
||||
void XDp_RxSetIntrDownReplyHandler(XDp *InstancePtr,
|
||||
XDp_IntrHandler CallbackFunc, void *CallbackRef)
|
||||
{
|
||||
/* Verify arguments. */
|
||||
Xil_AssertVoid(InstancePtr != NULL);
|
||||
Xil_AssertVoid(XDp_GetCoreType(InstancePtr) == XDP_RX);
|
||||
Xil_AssertVoid(CallbackFunc != NULL);
|
||||
Xil_AssertVoid(CallbackRef != NULL);
|
||||
|
||||
InstancePtr->RxInstance.IntrDownReplyHandler = CallbackFunc;
|
||||
InstancePtr->RxInstance.IntrDownReplyCallbackRef = CallbackRef;
|
||||
}
|
||||
|
||||
/******************************************************************************/
|
||||
/**
|
||||
* This function is the interrupt handler for the XDp driver operating in TX
|
||||
|
@ -738,4 +794,10 @@ static void XDp_RxInterruptHandler(XDp *InstancePtr)
|
|||
InstancePtr->RxInstance.IntrExtPktHandler(
|
||||
InstancePtr->RxInstance.IntrExtPktCallbackRef);
|
||||
}
|
||||
|
||||
/* The TX has issued a down request; a sideband message is ready. */
|
||||
if (IntrStatus & XDP_RX_INTERRUPT_CAUSE_DOWN_REQUEST_MASK) {
|
||||
InstancePtr->RxInstance.IntrDownReqHandler(
|
||||
InstancePtr->RxInstance.IntrDownReqCallbackRef);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue