Example #1
0
/*
	This function fills chassislist structure with all nodes
	in that chassis
	chassislist structure = structure of one standalone chassis
*/
static void build_chassis(Node *node, ChassisList *chassislist)
{
	Node *remnode = 0;
	Port *port = 0;

	/* we get here with node = chassis_spine */
	chassislist->chassistype = node->chrecord->chassistype;
	insert_spine(node, chassislist);

	/* loop: pass on all ports of node */
	for (port = node->ports; port; port = port->next) {
		if (!port->remoteport)
			continue;
		remnode = port->remoteport->node;

		if (!remnode->chrecord)
			continue; /* some error - line or router not initialized ? FIXME */

		insert_line_router(remnode, chassislist);
	}

	pass_on_lines_catch_spines(chassislist);
	/* this pass needed for to catch routers, since routers connected only */
	/* to spines in slot 1 or 4 and we could miss them first time */
	pass_on_spines_catch_lines(chassislist);

	/* additional 2 passes needed for to overcome a problem of pure "in-chassis" */
	/* connectivity - extra pass to ensure that all related chips/modules */
	/* inserted into the chassislist */
	pass_on_lines_catch_spines(chassislist);
	pass_on_spines_catch_lines(chassislist);
	pass_on_spines_interpolate_chguid(chassislist);
}
Example #2
0
/*
	This function fills chassis structure with all nodes
	in that chassis
	chassis structure = structure of one standalone chassis
*/
static int build_chassis(ibnd_node_t * node, ibnd_chassis_t * chassis)
{
	int p = 0;
	ibnd_node_t *remnode = 0;
	ibnd_port_t *port = 0;

	/* we get here with node = chassis_spine */
	if (insert_spine(node, chassis))
		return -1;

	/* loop: pass on all ports of node */
	for (p = 1; p <= node->numports; p++) {

		port = node->ports[p];
		if (!port || !port->remoteport)
			continue;

		/*
		 * ISR4700 double density fabric board ports 19-36 are
		 * chassis external ports, so skip them
		 */
		if (is_spine_4700x2(node) && (port->portnum > 18))
			continue;

		remnode = port->remoteport->node;

		if (!remnode->ch_found)
			continue;	/* some error - line or router not initialized ? FIXME */

		insert_line_router(remnode, chassis);
	}

	if (pass_on_lines_catch_spines(chassis))
		return -1;
	/* this pass needed for to catch routers, since routers connected only */
	/* to spines in slot 1 or 4 and we could miss them first time */
	if (pass_on_spines_catch_lines(chassis))
		return -1;

	/* additional 2 passes needed for to overcome a problem of pure "in-chassis" */
	/* connectivity - extra pass to ensure that all related chips/modules */
	/* inserted into the chassis */
	if (pass_on_lines_catch_spines(chassis))
		return -1;
	if (pass_on_spines_catch_lines(chassis))
		return -1;
	pass_on_spines_interpolate_chguid(chassis);

	return 0;
}