FreeBSD/sys/mips/nlm/xlp_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
xlp_pcie_link(device_t pcib, device_t dev)
{
	device_t parent, tmp;
	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_function(tmp));
}
static int xlp_pcie_link ( device_t pcib , device_t dev ) { device_t parent , tmp ; 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_function ( 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 */