/* Clear the port stats structure. We also return it zeroed out...  */
static int stl_clrportstats(struct stlport *portp, comstats_t __user *cp)
/* Clear the port stats structure. We also return it zeroed out...  */
static int stl_clrportstats(struct stlport *portp, comstats_t __user *cp)
{
	comstats_t	stl_comstats;
	if (!portp) {
		if (copy_from_user(&stl_comstats, cp, sizeof(comstats_t)))
			return -EFAULT;
		portp = stl_getport(stl_comstats.brd, stl_comstats.panel,
			stl_comstats.port);
		if (portp == NULL)
			return -ENODEV;
	}
	memset(&portp->stats, 0, sizeof(comstats_t));
	portp->stats.brd = portp->brdnr;
	portp->stats.panel = portp->panelnr;
	portp->stats.port = portp->portnr;
	return copy_to_user(cp, &portp->stats,
			    sizeof(comstats_t)) ? -EFAULT : 0;
}