/* Locate an existing ppp channel. The caller should have locked the all_channels_lock. First we look in the new_channels list, then in the all_channels list. If found in the new_channels list, we move it to the all_channels list. This is for speed when we have a lot of channels in use.  */
static struct channel * ppp_find_channel(struct ppp_net *pn, int unit)
/* Locate an existing ppp channel. The caller should have locked the all_channels_lock. First we look in the new_channels list, then in the all_channels list. If found in the new_channels list, we move it to the all_channels list. This is for speed when we have a lot of channels in use.  */
static struct channel * ppp_find_channel(struct ppp_net *pn, int unit)
{
	struct channel *pch;
	list_for_each_entry(pch, &pn->new_channels, list) {
		if (pch->file.index == unit) {
			list_move(&pch->list, &pn->all_channels);
			return pch;
		}
	}
	list_for_each_entry(pch, &pn->all_channels, list) {
		if (pch->file.index == unit)
			return pch;
	}
	return NULL;
}