/* This function fills in a rocket_ports struct with information about what boards/ports are in the system. This info is passed to user space. See setrocket.c where the info is used to create the /dev/ttyRx ports.  */
static int get_ports(struct r_port *info, struct rocket_ports __user *retports)
/* This function fills in a rocket_ports struct with information about what boards/ports are in the system. This info is passed to user space. See setrocket.c where the info is used to create the /dev/ttyRx ports.  */
static int get_ports(struct r_port *info, struct rocket_ports __user *retports)
{
	struct rocket_ports tmp;
	int board;
	if (!retports)
		return -EFAULT;
	memset(&tmp, 0, sizeof (tmp));
	tmp.tty_major = rocket_driver->major;
	for (board = 0; board < 4; board++) {
		tmp.rocketModel[board].model = rocketModel[board].model;
		strcpy(tmp.rocketModel[board].modelString, rocketModel[board].modelString);
		tmp.rocketModel[board].numPorts = rocketModel[board].numPorts;
		tmp.rocketModel[board].loadrm2 = rocketModel[board].loadrm2;
		tmp.rocketModel[board].startingPortNumber = rocketModel[board].startingPortNumber;
	}
	if (copy_to_user(retports, &tmp, sizeof (*retports)))
		return -EFAULT;
	return 0;
}