XilinxProcessorIPLib/drivers/pciepsu/src/xpciepsu_caps.c
u8 XPciePsu_PrintAllCapabilites(XPciePsu *InstancePtr, u8 Bus, u8 Device,
		u8 Function)
{

	u32 CapBase = XPciePsu_GetBaseCapability(InstancePtr, Bus, Device,
			Function);

	xil_printf("CAP-IDs:");
	while (CapBase != 0U) {
		if (XPciePsu_ReadConfigSpace(InstancePtr, Bus, Device,
			Function, XPciePsu_GetCapabilityAddr(CapBase), &CapBase) != (u8)XST_SUCCESS) {
			return XST_FAILURE;
		}
		xil_printf("0x%X ", CapBase & XPCIEPSU_CFG_CAP_ID_LOC);
		CapBase = (u32)((CapBase >> XPCIEPSU_CAP_SHIFT) & (u32)XPCIEPSU_CAP_PTR_LOC);
	}
	xil_printf("\r\n");
	return XST_SUCCESS;
}
/******************************************************************************/
/**
* This function prints all the available capabilities in the Function.
*
* @param   InstancePtr pointer to XPciePsu Instance Pointer
* @param   Bus is the number of the Bus
* @param   Device is the number of the Device
* @param   Function is number of the Function
*
* @return  XST_SUCCESS on success
* XST_FAILURE on failure.
*
*******************************************************************************/
This function prints all the available capabilities in the Function.
This function prints all the available capabilities in the Function .
u8 XPciePsu_PrintAllCapabilites(XPciePsu *InstancePtr, u8 Bus, u8 Device,
		u8 Function)
{
	u32 CapBase = XPciePsu_GetBaseCapability(InstancePtr, Bus, Device,
			Function);
	xil_printf("CAP-IDs:");
	while (CapBase != 0U) {
		if (XPciePsu_ReadConfigSpace(InstancePtr, Bus, Device,
			Function, XPciePsu_GetCapabilityAddr(CapBase), &CapBase) != (u8)XST_SUCCESS) {
			return XST_FAILURE;
		}
		xil_printf("0x%X ", CapBase & XPCIEPSU_CFG_CAP_ID_LOC);
		CapBase = (u32)((CapBase >> XPCIEPSU_CAP_SHIFT) & (u32)XPCIEPSU_CAP_PTR_LOC);
	}
	xil_printf("\r\n");
	return XST_SUCCESS;
}
u8 XPciePsu_PrintAllCapabilites ( XPciePsu * InstancePtr , u8 Bus , u8 Device , u8 Function ) { u32 CapBase = XPciePsu_GetBaseCapability ( InstancePtr , Bus , Device , Function ) ; xil_printf ( " " ) ; while ( CapBase != 0U ) { if ( XPciePsu_ReadConfigSpace ( InstancePtr , Bus , Device , Function , XPciePsu_GetCapabilityAddr ( CapBase ) , & CapBase ) != ( u8 ) XST_SUCCESS ) { return XST_FAILURE ; } xil_printf ( " " , CapBase & XPCIEPSU_CFG_CAP_ID_LOC ) ; CapBase = ( u32 ) ( ( CapBase >> XPCIEPSU_CAP_SHIFT ) & ( u32 ) XPCIEPSU_CAP_PTR_LOC ) ; } xil_printf ( " \r \n " ) ; return XST_SUCCESS ; }
This function prints all the available capabilities in the Function.
This function prints all the available capabilities in the Function .