/* Resolve the referenced port number into a port struct pointer.  */
static struct stliport * stli_getport(unsigned int brdnr, unsigned int panelnr, unsigned int portnr)
/* Resolve the referenced port number into a port struct pointer.  */
static struct stliport * stli_getport(unsigned int brdnr, unsigned int panelnr, unsigned int portnr)
{
	struct stlibrd *brdp;
	unsigned int i;
	if (brdnr >= STL_MAXBRDS)
		return NULL;
	brdp = stli_brds[brdnr];
	if (brdp == NULL)
		return NULL;
	for (i = 0; (i < panelnr); i++)
		portnr += brdp->panels[i];
	if (portnr >= brdp->nrports)
		return NULL;
	return brdp->ports[portnr];
}