/* Return the entire driver board structure to a user app.  */
static int stl_getbrdstruct(struct stlbrd __user *arg)
/* Return the entire driver board structure to a user app.  */
static int stl_getbrdstruct(struct stlbrd __user *arg)
{
	struct stlbrd	stl_dummybrd;
	struct stlbrd	*brdp;
	if (copy_from_user(&stl_dummybrd, arg, sizeof(struct stlbrd)))
		return -EFAULT;
	if (stl_dummybrd.brdnr >= STL_MAXBRDS)
		return -ENODEV;
	brdp = stl_brds[stl_dummybrd.brdnr];
	if (!brdp)
		return -ENODEV;
	return copy_to_user(arg, brdp, sizeof(struct stlbrd)) ? -EFAULT : 0;
}