FreeBSD/sys/mips/rmi/xlr_pci.c
/*
 * XLS PCIe can have upto 4 links, and each link has its on IRQ
 * Find the link on which the device is on 
 */
XLS PCIe can have upto 4 links, and each link has its on IRQ
Find the link on which the device is on
XLS PCIe can have upto 4 links and each link has its on IRQ Find the link on which the device is on
static int
xls_pcie_link(device_t pcib, device_t dev)
{
	device_t parent, tmp;
	printf("xls_pcie_link : bus %s dev %s\n", device_get_nameunit(pcib),
		device_get_nameunit(dev));
	tmp = dev;
	while (1) {
		parent = device_get_parent(tmp);
		if (parent == NULL || parent == pcib) {
			device_printf(dev, "Cannot find parent bus\n");
			return (-1);
		}
		if (strcmp(device_get_nameunit(parent), "pci0") == 0)
			break;
		tmp = parent;
	}
	return (pci_get_slot(tmp));
}
static int xls_pcie_link ( device_t pcib , device_t dev ) { device_t parent , tmp ; printf ( " \n " , device_get_nameunit ( pcib ) , device_get_nameunit ( dev ) ) ; tmp = dev ; while ( 1 ) { parent = device_get_parent ( tmp ) ; if ( parent == NULL || parent == pcib ) { device_printf ( dev , " \n " ) ; return ( -1 ) ; } if ( strcmp ( device_get_nameunit ( parent ) , " " ) == 0 ) break ; tmp = parent ; } return ( pci_get_slot ( tmp ) ) ; }
XLS PCIe can have upto 4 links, and each link has its on IRQ
 Find the link on which the device is on
XLS PCIe can have upto 4 links and each link has its on IRQ Find the link on which the device is on
/* find the lane on which the slot is connected to */